Skip to content

Instantly share code, notes, and snippets.

@FazioNico
Last active May 16, 2022 10:07
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save FazioNico/c23c71863b106a114c42f3c39fd99edf to your computer and use it in GitHub Desktop.
Save FazioNico/c23c71863b106a114c42f3c39fd99edf to your computer and use it in GitHub Desktop.
<!DOCTYPE html>
<html lang="en">
<head>
<base href="./">
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
<script src="./main.esm.js"></script>
</head>
<body>
<p>Price: $ 100 USD</p>
<ngxweb3-payment-btn
to="0x..."
symbol="ETH"
display-error="true"
amount="100"></ngxweb3-payment-btn>
</body>
</html>
This file has been truncated, but you can view the full file.
(()=>{"use strict";var e,r,t={},o={};function n(e){var r=o[e];if(void 0!==r)return r.exports;var i=o[e]={id:e,loaded:!1,exports:{}};return t[e].call(i.exports,i,i.exports,n),i.loaded=!0,i.exports}n.m=t,n.amdO={},e=[],n.O=(r,t,o,i)=>{if(!t){var a=1/0;for(c=0;c<e.length;c++){for(var[t,o,i]=e[c],l=!0,s=0;s<t.length;s++)(!1&i||a>=i)&&Object.keys(n.O).every((e=>n.O[e](t[s])))?t.splice(s--,1):(l=!1,i<a&&(a=i));if(l){e.splice(c--,1);var u=o();void 0!==u&&(r=u)}}return r}i=i||0;for(var c=e.length;c>0&&e[c-1][2]>i;c--)e[c]=e[c-1];e[c]=[t,o,i]},n.n=e=>{var r=e&&e.__esModule?()=>e.default:()=>e;return n.d(r,{a:r}),r},n.d=(e,r)=>{for(var t in r)n.o(r,t)&&!n.o(e,t)&&Object.defineProperty(e,t,{enumerable:!0,get:r[t]})},n.f={},n.e=e=>Promise.all(Object.keys(n.f).reduce(((r,t)=>(n.f[t](e,r),r)),[])),n.u=e=>e+".esm.js",n.miniCssF=e=>{},n.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),n.o=(e,r)=>Object.prototype.hasOwnProperty.call(e,r),r={},n.l=(e,t,o,i)=>{if(r[e])r[e].push(t);else{var a,l;if(void 0!==o)for(var s=document.getElementsByTagName("script"),u=0;u<s.length;u++){var c=s[u];if(c.getAttribute("src")==e){a=c;break}}a||(l=!0,(a=document.createElement("script")).charset="utf-8",a.timeout=120,n.nc&&a.setAttribute("nonce",n.nc),a.src=e),r[e]=[t];var d=(t,o)=>{a.onerror=a.onload=null,clearTimeout(p);var n=r[e];if(delete r[e],a.parentNode&&a.parentNode.removeChild(a),n&&n.forEach((e=>e(o))),t)return t(o)},p=setTimeout(d.bind(null,void 0,{type:"timeout",target:a}),12e4);a.onerror=d.bind(null,a.onerror),a.onload=d.bind(null,a.onload),l&&document.head.appendChild(a)}},n.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.nmd=e=>(e.paths=[],e.children||(e.children=[]),e),(()=>{var e;n.g.importScripts&&(e=n.g.location+"");var r=n.g.document;if(!e&&r&&(r.currentScript&&(e=r.currentScript.src),!e)){var t=r.getElementsByTagName("script");t.length&&(e=t[t.length-1].src)}if(!e)throw new Error("Automatic publicPath is not supported in this browser");e=e.replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/"),n.p=e})(),(()=>{var e={666:0};n.f.j=(r,t)=>{var o=n.o(e,r)?e[r]:void 0;if(0!==o)if(o)t.push(o[2]);else if(666!=r){var i=new Promise(((t,n)=>o=e[r]=[t,n]));t.push(o[2]=i);var a=n.p+n.u(r),l=new Error;n.l(a,(t=>{if(n.o(e,r)&&(0!==(o=e[r])&&(e[r]=void 0),o)){var i=t&&("load"===t.type?"missing":t.type),a=t&&t.target&&t.target.src;l.message="Loading chunk "+r+" failed.\n("+i+": "+a+")",l.name="ChunkLoadError",l.type=i,l.request=a,o[1](l)}}),"chunk-"+r,r)}else e[r]=0},n.O.j=r=>0===e[r];var r=(r,t)=>{var o,i,[a,l,s]=t,u=0;if(a.some((r=>0!==e[r]))){for(o in l)n.o(l,o)&&(n.m[o]=l[o]);if(s)var c=s(n)}for(r&&r(t);u<a.length;u++)i=a[u],n.o(e,i)&&e[i]&&e[i][0](),e[i]=0;return n.O(c)},t=self.webpackChunk=self.webpackChunk||[];t.forEach(r.bind(null,0)),t.push=r.bind(null,t.push.bind(t))})()})();(self.webpackChunk=self.webpackChunk||[]).push([[429],{65125:(t,r,e)=>{"use strict";e(634),e(96882),e(64844),e(40225),e(71686),e(68223),e(27072),e(84870),e(39529),e(15735),e(43108),e(9731),e(49992),e(43430),e(67694),e(53985),e(65388),e(72994),e(39509),e(48836),e(77208),e(61657),e(43105),e(37846),e(16635),e(81804),e(42586),e(43045),e(13489),e(68995),e(73439),e(21515),e(98738),e(17368),e(77950),e(90103),e(88233),e(96708),e(31235),e(74069),e(90977),e(35734),e(85940),e(94908),e(48319),e(44112),e(45794),e(18827),e(41715),e(81382),e(91982),e(73229),e(24074),e(64696),e(13675),e(36920),e(13161),e(90723),e(26618),e(49527),e(65688),e(70315),e(50556),e(6886),e(46106),e(19866),e(14121),e(85371),e(60523);window&&void 0===window.global&&(console.log("window.global is undefined"),window.global=window,global.process={env:{DEBUG:void 0}})},71884:()=>{!function(){var t=document.createElement("script");if(!("noModule"in t)&&"onbeforeload"in t){var r=!1;document.addEventListener("beforeload",(function(e){if(e.target===t)r=!0;else if(!e.target.hasAttribute("nomodule")||!r)return;e.preventDefault()}),!0),t.type="module",t.src=".",document.head.appendChild(t),t.remove()}}()},77111:(t,r,e)=>{var n=e(9859),o=e(26733),i=e(59821),a=n.TypeError;t.exports=function(t){if(o(t))return t;throw a(i(t)+" is not a function")}},57988:(t,r,e)=>{var n=e(9859),o=e(82359),i=e(59821),a=n.TypeError;t.exports=function(t){if(o(t))return t;throw a(i(t)+" is not a constructor")}},88505:(t,r,e)=>{var n=e(9859),o=e(26733),i=n.String,a=n.TypeError;t.exports=function(t){if("object"==typeof t||o(t))return t;throw a("Can't set "+i(t)+" as a prototype")}},9736:(t,r,e)=>{var n=e(70095),o=e(22391),i=e(31787),a=n("unscopables"),u=Array.prototype;null==u[a]&&i.f(u,a,{configurable:!0,value:o(null)}),t.exports=function(t){u[a][t]=!0}},36637:(t,r,e)=>{"use strict";var n=e(30966).charAt;t.exports=function(t,r,e){return r+(e?n(t,r).length:1)}},57728:(t,r,e)=>{var n=e(9859),o=e(91321),i=n.TypeError;t.exports=function(t,r){if(o(r,t))return t;throw i("Incorrect invocation")}},21176:(t,r,e)=>{var n=e(9859),o=e(85052),i=n.String,a=n.TypeError;t.exports=function(t){if(o(t))return t;throw a(i(t)+" is not an object")}},53339:t=>{t.exports="undefined"!=typeof ArrayBuffer&&"undefined"!=typeof DataView},9918:(t,r,e)=>{"use strict";var n,o,i,a=e(53339),u=e(7400),s=e(9859),c=e(26733),f=e(85052),l=e(98270),h=e(81589),p=e(59821),v=e(75762),g=e(14768),d=e(31787).f,y=e(91321),m=e(67567),b=e(56540),x=e(70095),w=e(81441),S=s.Int8Array,R=S&&S.prototype,A=s.Uint8ClampedArray,E=A&&A.prototype,O=S&&m(S),P=R&&m(R),T=Object.prototype,I=s.TypeError,L=x("toStringTag"),U=w("TYPED_ARRAY_TAG"),j=w("TYPED_ARRAY_CONSTRUCTOR"),k=a&&!!b&&"Opera"!==h(s.opera),_=!1,C={Int8Array:1,Uint8Array:1,Uint8ClampedArray:1,Int16Array:2,Uint16Array:2,Int32Array:4,Uint32Array:4,Float32Array:4,Float64Array:8},M={BigInt64Array:8,BigUint64Array:8},N=function(t){if(!f(t))return!1;var r=h(t);return l(C,r)||l(M,r)};for(n in C)(i=(o=s[n])&&o.prototype)?v(i,j,o):k=!1;for(n in M)(i=(o=s[n])&&o.prototype)&&v(i,j,o);if((!k||!c(O)||O===Function.prototype)&&(O=function(){throw I("Incorrect invocation")},k))for(n in C)s[n]&&b(s[n],O);if((!k||!P||P===T)&&(P=O.prototype,k))for(n in C)s[n]&&b(s[n].prototype,P);if(k&&m(E)!==P&&b(E,P),u&&!l(P,L))for(n in _=!0,d(P,L,{get:function(){return f(this)?this[U]:void 0}}),C)s[n]&&v(s[n],U,n);t.exports={NATIVE_ARRAY_BUFFER_VIEWS:k,TYPED_ARRAY_CONSTRUCTOR:j,TYPED_ARRAY_TAG:_&&U,aTypedArray:function(t){if(N(t))return t;throw I("Target is not a typed array")},aTypedArrayConstructor:function(t){if(c(t)&&(!b||y(O,t)))return t;throw I(p(t)+" is not a typed array constructor")},exportTypedArrayMethod:function(t,r,e,n){if(u){if(e)for(var o in C){var i=s[o];if(i&&l(i.prototype,t))try{delete i.prototype[t]}catch(a){try{i.prototype[t]=r}catch(c){}}}P[t]&&!e||g(P,t,e?r:k&&R[t]||r,n)}},exportTypedArrayStaticMethod:function(t,r,e){var n,o;if(u){if(b){if(e)for(n in C)if((o=s[n])&&l(o,t))try{delete o[t]}catch(i){}if(O[t]&&!e)return;try{return g(O,t,e?r:k&&O[t]||r)}catch(i){}}for(n in C)!(o=s[n])||o[t]&&!e||g(o,t,r)}},isView:function(t){if(!f(t))return!1;var r=h(t);return"DataView"===r||l(C,r)||l(M,r)},isTypedArray:N,TypedArray:O,TypedArrayPrototype:P}},53816:(t,r,e)=>{"use strict";var n=e(9859),o=e(65968),i=e(7400),a=e(53339),u=e(51805),s=e(75762),c=e(8312),f=e(24229),l=e(57728),h=e(43329),p=e(34237),v=e(7331),g=e(56201),d=e(67567),y=e(56540),m=e(78151).f,b=e(31787).f,x=e(97065),w=e(69794),S=e(54555),R=e(56407),A=u.PROPER,E=u.CONFIGURABLE,O=R.get,P=R.set,T="ArrayBuffer",I="DataView",L="Wrong index",U=n.ArrayBuffer,j=U,k=j&&j.prototype,_=n.DataView,C=_&&_.prototype,M=Object.prototype,N=n.Array,F=n.RangeError,B=o(x),D=o([].reverse),q=g.pack,H=g.unpack,G=function(t){return[255&t]},V=function(t){return[255&t,t>>8&255]},W=function(t){return[255&t,t>>8&255,t>>16&255,t>>24&255]},Y=function(t){return t[3]<<24|t[2]<<16|t[1]<<8|t[0]},$=function(t){return q(t,23,4)},z=function(t){return q(t,52,8)},K=function(t,r){b(t.prototype,r,{get:function(){return O(this)[r]}})},J=function(t,r,e,n){var o=v(e),i=O(t);if(o+r>i.byteLength)throw F(L);var a=O(i.buffer).bytes,u=o+i.byteOffset,s=w(a,u,u+r);return n?s:D(s)},Q=function(t,r,e,n,o,i){var a=v(e),u=O(t);if(a+r>u.byteLength)throw F(L);for(var s=O(u.buffer).bytes,c=a+u.byteOffset,f=n(+o),l=0;l<r;l++)s[c+l]=f[i?l:r-l-1]};if(a){var X=A&&U.name!==T;if(f((function(){U(1)}))&&f((function(){new U(-1)}))&&!f((function(){return new U,new U(1.5),new U(NaN),X&&!E})))X&&E&&s(U,"name",T);else{(j=function(t){return l(this,k),new U(v(t))}).prototype=k;for(var Z,tt=m(U),rt=0;tt.length>rt;)(Z=tt[rt++])in j||s(j,Z,U[Z]);k.constructor=j}y&&d(C)!==M&&y(C,M);var et=new _(new j(2)),nt=o(C.setInt8);et.setInt8(0,2147483648),et.setInt8(1,2147483649),!et.getInt8(0)&&et.getInt8(1)||c(C,{setInt8:function(t,r){nt(this,t,r<<24>>24)},setUint8:function(t,r){nt(this,t,r<<24>>24)}},{unsafe:!0})}else k=(j=function(t){l(this,k);var r=v(t);P(this,{bytes:B(N(r),0),byteLength:r}),i||(this.byteLength=r)}).prototype,C=(_=function(t,r,e){l(this,C),l(t,k);var n=O(t).byteLength,o=h(r);if(o<0||o>n)throw F("Wrong offset");if(o+(e=void 0===e?n-o:p(e))>n)throw F("Wrong length");P(this,{buffer:t,byteLength:e,byteOffset:o}),i||(this.buffer=t,this.byteLength=e,this.byteOffset=o)}).prototype,i&&(K(j,"byteLength"),K(_,"buffer"),K(_,"byteLength"),K(_,"byteOffset")),c(C,{getInt8:function(t){return J(this,1,t)[0]<<24>>24},getUint8:function(t){return J(this,1,t)[0]},getInt16:function(t){var r=J(this,2,t,arguments.length>1?arguments[1]:void 0);return(r[1]<<8|r[0])<<16>>16},getUint16:function(t){var r=J(this,2,t,arguments.length>1?arguments[1]:void 0);return r[1]<<8|r[0]},getInt32:function(t){return Y(J(this,4,t,arguments.length>1?arguments[1]:void 0))},getUint32:function(t){return Y(J(this,4,t,arguments.length>1?arguments[1]:void 0))>>>0},getFloat32:function(t){return H(J(this,4,t,arguments.length>1?arguments[1]:void 0),23)},getFloat64:function(t){return H(J(this,8,t,arguments.length>1?arguments[1]:void 0),52)},setInt8:function(t,r){Q(this,1,t,G,r)},setUint8:function(t,r){Q(this,1,t,G,r)},setInt16:function(t,r){Q(this,2,t,V,r,arguments.length>2?arguments[2]:void 0)},setUint16:function(t,r){Q(this,2,t,V,r,arguments.length>2?arguments[2]:void 0)},setInt32:function(t,r){Q(this,4,t,W,r,arguments.length>2?arguments[2]:void 0)},setUint32:function(t,r){Q(this,4,t,W,r,arguments.length>2?arguments[2]:void 0)},setFloat32:function(t,r){Q(this,4,t,$,r,arguments.length>2?arguments[2]:void 0)},setFloat64:function(t,r){Q(this,8,t,z,r,arguments.length>2?arguments[2]:void 0)}});S(j,T),S(_,I),t.exports={ArrayBuffer:j,DataView:_}},97065:(t,r,e)=>{"use strict";var n=e(92991),o=e(43231),i=e(39646);t.exports=function(t){for(var r=n(this),e=i(r),a=arguments.length,u=o(a>1?arguments[1]:void 0,e),s=a>2?arguments[2]:void 0,c=void 0===s?e:o(s,e);c>u;)r[u++]=t;return r}},10507:(t,r,e)=>{"use strict";var n=e(9859),o=e(97636),i=e(20266),a=e(92991),u=e(64960),s=e(91943),c=e(82359),f=e(39646),l=e(62324),h=e(28403),p=e(78830),v=n.Array;t.exports=function(t){var r=a(t),e=c(this),n=arguments.length,g=n>1?arguments[1]:void 0,d=void 0!==g;d&&(g=o(g,n>2?arguments[2]:void 0));var y,m,b,x,w,S,R=p(r),A=0;if(!R||this==v&&s(R))for(y=f(r),m=e?new this(y):v(y);y>A;A++)S=d?g(r[A],A):r[A],l(m,A,S);else for(w=(x=h(r,R)).next,m=e?new this:[];!(b=i(w,x)).done;A++)S=d?u(x,g,[b.value,A],!0):b.value,l(m,A,S);return m.length=A,m}},19540:(t,r,e)=>{var n=e(10905),o=e(43231),i=e(39646),a=function(t){return function(r,e,a){var u,s=n(r),c=i(s),f=o(a,c);if(t&&e!=e){for(;c>f;)if((u=s[f++])!=u)return!0}else for(;c>f;f++)if((t||f in s)&&s[f]===e)return t||f||0;return!t&&-1}};t.exports={includes:a(!0),indexOf:a(!1)}},89996:(t,r,e)=>{var n=e(97636),o=e(65968),i=e(9337),a=e(92991),u=e(39646),s=e(87501),c=o([].push),f=function(t){var r=1==t,e=2==t,o=3==t,f=4==t,l=6==t,h=7==t,p=5==t||l;return function(v,g,d,y){for(var m,b,x=a(v),w=i(x),S=n(g,d),R=u(w),A=0,E=y||s,O=r?E(v,R):e||h?E(v,0):void 0;R>A;A++)if((p||A in w)&&(b=S(m=w[A],A,x),t))if(r)O[A]=b;else if(b)switch(t){case 3:return!0;case 5:return m;case 6:return A;case 2:c(O,m)}else switch(t){case 4:return!1;case 7:c(O,m)}return l?-1:o||f?f:O}};t.exports={forEach:f(0),map:f(1),filter:f(2),some:f(3),every:f(4),find:f(5),findIndex:f(6),filterReject:f(7)}},96038:(t,r,e)=>{"use strict";var n=e(24229);t.exports=function(t,r){var e=[][t];return!!e&&n((function(){e.call(null,r||function(){return 1},1)}))}},43143:(t,r,e)=>{var n=e(9859),o=e(77111),i=e(92991),a=e(9337),u=e(39646),s=n.TypeError,c=function(t){return function(r,e,n,c){o(e);var f=i(r),l=a(f),h=u(f),p=t?h-1:0,v=t?-1:1;if(n<2)for(;;){if(p in l){c=l[p],p+=v;break}if(p+=v,t?p<0:h<=p)throw s("Reduce of empty array with no initial value")}for(;t?p>=0:h>p;p+=v)p in l&&(c=e(c,l[p],p,f));return c}};t.exports={left:c(!1),right:c(!0)}},69794:(t,r,e)=>{var n=e(9859),o=e(43231),i=e(39646),a=e(62324),u=n.Array,s=Math.max;t.exports=function(t,r,e){for(var n=i(t),c=o(r,n),f=o(void 0===e?n:e,n),l=u(s(f-c,0)),h=0;c<f;c++,h++)a(l,h,t[c]);return l.length=h,l}},1909:(t,r,e)=>{var n=e(65968);t.exports=n([].slice)},33867:(t,r,e)=>{var n=e(69794),o=Math.floor,i=function(t,r){var e=t.length,s=o(e/2);return e<8?a(t,r):u(t,i(n(t,0,s),r),i(n(t,s),r),r)},a=function(t,r){for(var e,n,o=t.length,i=1;i<o;){for(n=i,e=t[i];n&&r(t[n-1],e)>0;)t[n]=t[--n];n!==i++&&(t[n]=e)}return t},u=function(t,r,e,n){for(var o=r.length,i=e.length,a=0,u=0;a<o||u<i;)t[a+u]=a<o&&u<i?n(r[a],e[u])<=0?r[a++]:e[u++]:a<o?r[a++]:e[u++];return t};t.exports=i},18760:(t,r,e)=>{var n=e(9859),o=e(33718),i=e(82359),a=e(85052),u=e(70095)("species"),s=n.Array;t.exports=function(t){var r;return o(t)&&(r=t.constructor,(i(r)&&(r===s||o(r.prototype))||a(r)&&null===(r=r[u]))&&(r=void 0)),void 0===r?s:r}},87501:(t,r,e)=>{var n=e(18760);t.exports=function(t,r){return new(n(t))(0===r?0:r)}},64960:(t,r,e)=>{var n=e(21176),o=e(57281);t.exports=function(t,r,e,i){try{return i?r(n(e)[0],e[1]):r(e)}catch(a){o(t,"throw",a)}}},74575:(t,r,e)=>{var n=e(70095)("iterator"),o=!1;try{var i=0,a={next:function(){return{done:!!i++}},return:function(){o=!0}};a[n]=function(){return this},Array.from(a,(function(){throw 2}))}catch(u){}t.exports=function(t,r){if(!r&&!o)return!1;var e=!1;try{var i={};i[n]=function(){return{next:function(){return{done:e=!0}}}},t(i)}catch(u){}return e}},27079:(t,r,e)=>{var n=e(65968),o=n({}.toString),i=n("".slice);t.exports=function(t){return i(o(t),8,-1)}},81589:(t,r,e)=>{var n=e(9859),o=e(71601),i=e(26733),a=e(27079),u=e(70095)("toStringTag"),s=n.Object,c="Arguments"==a(function(){return arguments}());t.exports=o?a:function(t){var r,e,n;return void 0===t?"Undefined":null===t?"Null":"string"==typeof(e=function(t,r){try{return t[r]}catch(e){}}(r=s(t),u))?e:c?a(r):"Object"==(n=a(r))&&i(r.callee)?"Arguments":n}},77081:(t,r,e)=>{var n=e(98270),o=e(4826),i=e(97933),a=e(31787);t.exports=function(t,r,e){for(var u=o(r),s=a.f,c=i.f,f=0;f<u.length;f++){var l=u[f];n(t,l)||e&&n(e,l)||s(t,l,c(r,l))}}},48127:(t,r,e)=>{var n=e(70095)("match");t.exports=function(t){var r=/./;try{"/./"[t](r)}catch(e){try{return r[n]=!1,"/./"[t](r)}catch(o){}}return!1}},27528:(t,r,e)=>{var n=e(24229);t.exports=!n((function(){function t(){}return t.prototype.constructor=null,Object.getPrototypeOf(new t)!==t.prototype}))},93723:(t,r,e)=>{"use strict";var n=e(60693).IteratorPrototype,o=e(22391),i=e(65358),a=e(54555),u=e(45495),s=function(){return this};t.exports=function(t,r,e,c){var f=r+" Iterator";return t.prototype=o(n,{next:i(+!c,e)}),a(t,f,!1,!0),u[f]=s,t}},75762:(t,r,e)=>{var n=e(7400),o=e(31787),i=e(65358);t.exports=n?function(t,r,e){return o.f(t,r,i(1,e))}:function(t,r,e){return t[r]=e,t}},65358:t=>{t.exports=function(t,r){return{enumerable:!(1&t),configurable:!(2&t),writable:!(4&t),value:r}}},62324:(t,r,e)=>{"use strict";var n=e(39310),o=e(31787),i=e(65358);t.exports=function(t,r,e){var a=n(r);a in t?o.f(t,a,i(0,e)):t[a]=e}},96616:(t,r,e)=>{var n=e(16039),o=e(31787);t.exports=function(t,r,e){return e.get&&n(e.get,r,{getter:!0}),e.set&&n(e.set,r,{setter:!0}),o.f(t,r,e)}},14768:(t,r,e)=>{var n=e(9859),o=e(26733),i=e(75762),a=e(16039),u=e(12079);t.exports=function(t,r,e,s){var c=!!s&&!!s.unsafe,f=!!s&&!!s.enumerable,l=!!s&&!!s.noTargetGet,h=s&&void 0!==s.name?s.name:r;return o(e)&&a(e,h,s),t===n?(f?t[r]=e:u(r,e),t):(c?!l&&t[r]&&(f=!0):delete t[r],f?t[r]=e:i(t,r,e),t)}},8312:(t,r,e)=>{var n=e(14768);t.exports=function(t,r,e){for(var o in r)n(t,o,r[o],e);return t}},67675:(t,r,e)=>{"use strict";var n=e(23103),o=e(20266),i=e(24231),a=e(51805),u=e(26733),s=e(93723),c=e(67567),f=e(56540),l=e(54555),h=e(75762),p=e(14768),v=e(70095),g=e(45495),d=e(60693),y=a.PROPER,m=a.CONFIGURABLE,b=d.IteratorPrototype,x=d.BUGGY_SAFARI_ITERATORS,w=v("iterator"),S="keys",R="values",A="entries",E=function(){return this};t.exports=function(t,r,e,a,v,d,O){s(e,r,a);var P,T,I,L=function(t){if(t===v&&C)return C;if(!x&&t in k)return k[t];switch(t){case S:case R:case A:return function(){return new e(this,t)}}return function(){return new e(this)}},U=r+" Iterator",j=!1,k=t.prototype,_=k[w]||k["@@iterator"]||v&&k[v],C=!x&&_||L(v),M="Array"==r&&k.entries||_;if(M&&(P=c(M.call(new t)))!==Object.prototype&&P.next&&(i||c(P)===b||(f?f(P,b):u(P[w])||p(P,w,E)),l(P,U,!0,!0),i&&(g[U]=E)),y&&v==R&&_&&_.name!==R&&(!i&&m?h(k,"name",R):(j=!0,C=function(){return o(_,this)})),v)if(T={values:L(R),keys:d?C:L(S),entries:L(A)},O)for(I in T)(x||j||!(I in k))&&p(k,I,T[I]);else n({target:r,proto:!0,forced:x||j},T);return i&&!O||k[w]===C||p(k,w,C,{name:v}),g[r]=C,T}},38423:(t,r,e)=>{var n=e(49276),o=e(98270),i=e(55391),a=e(31787).f;t.exports=function(t){var r=n.Symbol||(n.Symbol={});o(r,t)||a(r,t,{value:i.f(t)})}},7400:(t,r,e)=>{var n=e(24229);t.exports=!n((function(){return 7!=Object.defineProperty({},1,{get:function(){return 7}})[1]}))},22635:(t,r,e)=>{var n=e(9859),o=e(85052),i=n.document,a=o(i)&&o(i.createElement);t.exports=function(t){return a?i.createElement(t):{}}},95694:t=>{t.exports={CSSRuleList:0,CSSStyleDeclaration:0,CSSValueList:0,ClientRectList:0,DOMRectList:0,DOMStringList:0,DOMTokenList:1,DataTransferItemList:0,FileList:0,HTMLAllCollection:0,HTMLCollection:0,HTMLFormElement:0,HTMLSelectElement:0,MediaList:0,MimeTypeArray:0,NamedNodeMap:0,NodeList:1,PaintRequestList:0,Plugin:0,PluginArray:0,SVGLengthList:0,SVGNumberList:0,SVGPathSegList:0,SVGPointList:0,SVGStringList:0,SVGTransformList:0,SourceBufferList:0,StyleSheetList:0,TextTrackCueList:0,TextTrackList:0,TouchList:0}},18865:(t,r,e)=>{var n=e(22635)("span").classList,o=n&&n.constructor&&n.constructor.prototype;t.exports=o===Object.prototype?void 0:o},22671:(t,r,e)=>{var n=e(80598).match(/firefox\/(\d+)/i);t.exports=!!n&&+n[1]},48639:t=>{t.exports="object"==typeof window&&"object"!=typeof Deno},48506:(t,r,e)=>{var n=e(80598);t.exports=/MSIE|Trident/.test(n)},8983:(t,r,e)=>{var n=e(80598),o=e(9859);t.exports=/ipad|iphone|ipod/i.test(n)&&void 0!==o.Pebble},32023:(t,r,e)=>{var n=e(80598);t.exports=/(?:ipad|iphone|ipod).*applewebkit/i.test(n)},28801:(t,r,e)=>{var n=e(27079),o=e(9859);t.exports="process"==n(o.process)},10263:(t,r,e)=>{var n=e(80598);t.exports=/web0s(?!.*chrome)/i.test(n)},80598:(t,r,e)=>{var n=e(31333);t.exports=n("navigator","userAgent")||""},6358:(t,r,e)=>{var n,o,i=e(9859),a=e(80598),u=i.process,s=i.Deno,c=u&&u.versions||s&&s.version,f=c&&c.v8;f&&(o=(n=f.split("."))[0]>0&&n[0]<4?1:+(n[0]+n[1])),!o&&a&&(!(n=a.match(/Edge\/(\d+)/))||n[1]>=74)&&(n=a.match(/Chrome\/(\d+)/))&&(o=+n[1]),t.exports=o},49811:(t,r,e)=>{var n=e(80598).match(/AppleWebKit\/(\d+)\./);t.exports=!!n&&+n[1]},13837:t=>{t.exports=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"]},23103:(t,r,e)=>{var n=e(9859),o=e(97933).f,i=e(75762),a=e(14768),u=e(12079),s=e(77081),c=e(46541);t.exports=function(t,r){var e,f,l,h,p,v=t.target,g=t.global,d=t.stat;if(e=g?n:d?n[v]||u(v,{}):(n[v]||{}).prototype)for(f in r){if(h=r[f],l=t.noTargetGet?(p=o(e,f))&&p.value:e[f],!c(g?f:v+(d?".":"#")+f,t.forced)&&void 0!==l){if(typeof h==typeof l)continue;s(h,l)}(t.sham||l&&l.sham)&&i(h,"sham",!0),a(e,f,h,t)}}},24229:t=>{t.exports=function(t){try{return!!t()}catch(r){return!0}}},94954:(t,r,e)=>{"use strict";e(77950);var n=e(65968),o=e(14768),i=e(63466),a=e(24229),u=e(70095),s=e(75762),c=u("species"),f=RegExp.prototype;t.exports=function(t,r,e,l){var h=u(t),p=!a((function(){var r={};return r[h]=function(){return 7},7!=""[t](r)})),v=p&&!a((function(){var r=!1,e=/a/;return"split"===t&&((e={}).constructor={},e.constructor[c]=function(){return e},e.flags="",e[h]=/./[h]),e.exec=function(){return r=!0,null},e[h](""),!r}));if(!p||!v||e){var g=n(/./[h]),d=r(h,""[t],(function(t,r,e,o,a){var u=n(t),s=r.exec;return s===i||s===f.exec?p&&!a?{done:!0,value:g(r,e,o)}:{done:!0,value:u(e,r,o)}:{done:!1}}));o(String.prototype,t,d[0]),o(f,h,d[1])}l&&s(f[h],"sham",!0)}},34990:(t,r,e)=>{"use strict";var n=e(9859),o=e(33718),i=e(39646),a=e(97636),u=n.TypeError,s=function(t,r,e,n,c,f,l,h){for(var p,v,g=c,d=0,y=!!l&&a(l,h);d<n;){if(d in e){if(p=y?y(e[d],d,r):e[d],f>0&&o(p))v=i(p),g=s(t,r,p,v,g,f-1)-1;else{if(g>=9007199254740991)throw u("Exceed the acceptable array length");t[g]=p}g++}d++}return g};t.exports=s},53171:(t,r,e)=>{var n=e(57188),o=Function.prototype,i=o.apply,a=o.call;t.exports="object"==typeof Reflect&&Reflect.apply||(n?a.bind(i):function(){return a.apply(i,arguments)})},97636:(t,r,e)=>{var n=e(65968),o=e(77111),i=e(57188),a=n(n.bind);t.exports=function(t,r){return o(t),void 0===r?t:i?a(t,r):function(){return t.apply(r,arguments)}}},57188:(t,r,e)=>{var n=e(24229);t.exports=!n((function(){var t=(function(){}).bind();return"function"!=typeof t||t.hasOwnProperty("prototype")}))},20266:(t,r,e)=>{var n=e(57188),o=Function.prototype.call;t.exports=n?o.bind(o):function(){return o.apply(o,arguments)}},51805:(t,r,e)=>{var n=e(7400),o=e(98270),i=Function.prototype,a=n&&Object.getOwnPropertyDescriptor,u=o(i,"name"),s=u&&"something"===(function(){}).name,c=u&&(!n||n&&a(i,"name").configurable);t.exports={EXISTS:u,PROPER:s,CONFIGURABLE:c}},65968:(t,r,e)=>{var n=e(57188),o=Function.prototype,i=o.bind,a=o.call,u=n&&i.bind(a,a);t.exports=n?function(t){return t&&u(t)}:function(t){return t&&function(){return a.apply(t,arguments)}}},31333:(t,r,e)=>{var n=e(9859),o=e(26733),i=function(t){return o(t)?t:void 0};t.exports=function(t,r){return arguments.length<2?i(n[t]):n[t]&&n[t][r]}},78830:(t,r,e)=>{var n=e(81589),o=e(55300),i=e(45495),a=e(70095)("iterator");t.exports=function(t){if(null!=t)return o(t,a)||o(t,"@@iterator")||i[n(t)]}},28403:(t,r,e)=>{var n=e(9859),o=e(20266),i=e(77111),a=e(21176),u=e(59821),s=e(78830),c=n.TypeError;t.exports=function(t,r){var e=arguments.length<2?s(t):r;if(i(e))return a(o(e,t));throw c(u(t)+" is not iterable")}},55300:(t,r,e)=>{var n=e(77111);t.exports=function(t,r){var e=t[r];return null==e?void 0:n(e)}},70017:(t,r,e)=>{var n=e(65968),o=e(92991),i=Math.floor,a=n("".charAt),u=n("".replace),s=n("".slice),c=/\$([$&'`]|\d{1,2}|<[^>]*>)/g,f=/\$([$&'`]|\d{1,2})/g;t.exports=function(t,r,e,n,l,h){var p=e+t.length,v=n.length,g=f;return void 0!==l&&(l=o(l),g=c),u(h,g,(function(o,u){var c;switch(a(u,0)){case"$":return"$";case"&":return t;case"`":return s(r,0,e);case"'":return s(r,p);case"<":c=l[s(u,1,-1)];break;default:var f=+u;if(0===f)return o;if(f>v){var h=i(f/10);return 0===h?o:h<=v?void 0===n[h-1]?a(u,1):n[h-1]+a(u,1):o}c=n[f-1]}return void 0===c?"":c}))}},9859:t=>{var r=function(t){return t&&t.Math==Math&&t};t.exports=r("object"==typeof globalThis&&globalThis)||r("object"==typeof window&&window)||r("object"==typeof self&&self)||r("object"==typeof global&&global)||function(){return this}()||Function("return this")()},98270:(t,r,e)=>{var n=e(65968),o=e(92991),i=n({}.hasOwnProperty);t.exports=Object.hasOwn||function(t,r){return i(o(t),r)}},95977:t=>{t.exports={}},14665:(t,r,e)=>{var n=e(9859);t.exports=function(t,r){var e=n.console;e&&e.error&&(1==arguments.length?e.error(t):e.error(t,r))}},53777:(t,r,e)=>{var n=e(31333);t.exports=n("document","documentElement")},64394:(t,r,e)=>{var n=e(7400),o=e(24229),i=e(22635);t.exports=!n&&!o((function(){return 7!=Object.defineProperty(i("div"),"a",{get:function(){return 7}}).a}))},56201:(t,r,e)=>{var n=e(9859).Array,o=Math.abs,i=Math.pow,a=Math.floor,u=Math.log,s=Math.LN2;t.exports={pack:function(t,r,e){var c,f,l,h=n(e),p=8*e-r-1,v=(1<<p)-1,g=v>>1,d=23===r?i(2,-24)-i(2,-77):0,y=t<0||0===t&&1/t<0?1:0,m=0;for((t=o(t))!=t||t===1/0?(f=t!=t?1:0,c=v):(c=a(u(t)/s),t*(l=i(2,-c))<1&&(c--,l*=2),(t+=c+g>=1?d/l:d*i(2,1-g))*l>=2&&(c++,l/=2),c+g>=v?(f=0,c=v):c+g>=1?(f=(t*l-1)*i(2,r),c+=g):(f=t*i(2,g-1)*i(2,r),c=0));r>=8;)h[m++]=255&f,f/=256,r-=8;for(c=c<<r|f,p+=r;p>0;)h[m++]=255&c,c/=256,p-=8;return h[--m]|=128*y,h},unpack:function(t,r){var e,n=t.length,o=8*n-r-1,a=(1<<o)-1,u=a>>1,s=o-7,c=n-1,f=t[c--],l=127&f;for(f>>=7;s>0;)l=256*l+t[c--],s-=8;for(e=l&(1<<-s)-1,l>>=-s,s+=r;s>0;)e=256*e+t[c--],s-=8;if(0===l)l=1-u;else{if(l===a)return e?NaN:f?-1/0:1/0;e+=i(2,r),l-=u}return(f?-1:1)*e*i(2,l-r)}}},9337:(t,r,e)=>{var n=e(9859),o=e(65968),i=e(24229),a=e(27079),u=n.Object,s=o("".split);t.exports=i((function(){return!u("z").propertyIsEnumerable(0)}))?function(t){return"String"==a(t)?s(t,""):u(t)}:u},20835:(t,r,e)=>{var n=e(26733),o=e(85052),i=e(56540);t.exports=function(t,r,e){var a,u;return i&&n(a=r.constructor)&&a!==e&&o(u=a.prototype)&&u!==e.prototype&&i(t,u),t}},8511:(t,r,e)=>{var n=e(65968),o=e(26733),i=e(85353),a=n(Function.toString);o(i.inspectSource)||(i.inspectSource=function(t){return a(t)}),t.exports=i.inspectSource},56407:(t,r,e)=>{var n,o,i,a=e(18694),u=e(9859),s=e(65968),c=e(85052),f=e(75762),l=e(98270),h=e(85353),p=e(44399),v=e(95977),g="Object already initialized",d=u.TypeError,y=u.WeakMap;if(a||h.state){var m=h.state||(h.state=new y),b=s(m.get),x=s(m.has),w=s(m.set);n=function(t,r){if(x(m,t))throw new d(g);return r.facade=t,w(m,t,r),r},o=function(t){return b(m,t)||{}},i=function(t){return x(m,t)}}else{var S=p("state");v[S]=!0,n=function(t,r){if(l(t,S))throw new d(g);return r.facade=t,f(t,S,r),r},o=function(t){return l(t,S)?t[S]:{}},i=function(t){return l(t,S)}}t.exports={set:n,get:o,has:i,enforce:function(t){return i(t)?o(t):n(t,{})},getterFor:function(t){return function(r){var e;if(!c(r)||(e=o(r)).type!==t)throw d("Incompatible receiver, "+t+" required");return e}}}},91943:(t,r,e)=>{var n=e(70095),o=e(45495),i=n("iterator"),a=Array.prototype;t.exports=function(t){return void 0!==t&&(o.Array===t||a[i]===t)}},33718:(t,r,e)=>{var n=e(27079);t.exports=Array.isArray||function(t){return"Array"==n(t)}},26733:t=>{t.exports=function(t){return"function"==typeof t}},82359:(t,r,e)=>{var n=e(65968),o=e(24229),i=e(26733),a=e(81589),u=e(31333),s=e(8511),c=function(){},f=[],l=u("Reflect","construct"),h=/^\s*(?:class|function)\b/,p=n(h.exec),v=!h.exec(c),g=function(t){if(!i(t))return!1;try{return l(c,f,t),!0}catch(r){return!1}},d=function(t){if(!i(t))return!1;switch(a(t)){case"AsyncFunction":case"GeneratorFunction":case"AsyncGeneratorFunction":return!1}try{return v||!!p(h,s(t))}catch(r){return!0}};d.sham=!0,t.exports=!l||o((function(){var t;return g(g.call)||!g(Object)||!g((function(){t=!0}))||t}))?d:g},90193:(t,r,e)=>{var n=e(98270);t.exports=function(t){return void 0!==t&&(n(t,"value")||n(t,"writable"))}},46541:(t,r,e)=>{var n=e(24229),o=e(26733),i=/#|\.prototype\./,a=function(t,r){var e=s[u(t)];return e==f||e!=c&&(o(r)?n(r):!!r)},u=a.normalize=function(t){return String(t).replace(i,".").toLowerCase()},s=a.data={},c=a.NATIVE="N",f=a.POLYFILL="P";t.exports=a},82292:(t,r,e)=>{var n=e(85052),o=Math.floor;t.exports=Number.isInteger||function(t){return!n(t)&&isFinite(t)&&o(t)===t}},85052:(t,r,e)=>{var n=e(26733);t.exports=function(t){return"object"==typeof t?null!==t:n(t)}},24231:t=>{t.exports=!1},48311:(t,r,e)=>{var n=e(85052),o=e(27079),i=e(70095)("match");t.exports=function(t){var r;return n(t)&&(void 0!==(r=t[i])?!!r:"RegExp"==o(t))}},49395:(t,r,e)=>{var n=e(9859),o=e(31333),i=e(26733),a=e(91321),u=e(66969),s=n.Object;t.exports=u?function(t){return"symbol"==typeof t}:function(t){var r=o("Symbol");return i(r)&&a(r.prototype,s(t))}},89003:(t,r,e)=>{var n=e(9859),o=e(97636),i=e(20266),a=e(21176),u=e(59821),s=e(91943),c=e(39646),f=e(91321),l=e(28403),h=e(78830),p=e(57281),v=n.TypeError,g=function(t,r){this.stopped=t,this.result=r},d=g.prototype;t.exports=function(t,r,e){var n,y,m,b,x,w,S,R=e&&e.that,A=!(!e||!e.AS_ENTRIES),E=!(!e||!e.IS_ITERATOR),O=!(!e||!e.INTERRUPTED),P=o(r,R),T=function(t){return n&&p(n,"normal",t),new g(!0,t)},I=function(t){return A?(a(t),O?P(t[0],t[1],T):P(t[0],t[1])):O?P(t,T):P(t)};if(E)n=t;else{if(!(y=h(t)))throw v(u(t)+" is not iterable");if(s(y)){for(m=0,b=c(t);b>m;m++)if((x=I(t[m]))&&f(d,x))return x;return new g(!1)}n=l(t,y)}for(w=n.next;!(S=i(w,n)).done;){try{x=I(S.value)}catch(L){p(n,"throw",L)}if("object"==typeof x&&x&&f(d,x))return x}return new g(!1)}},57281:(t,r,e)=>{var n=e(20266),o=e(21176),i=e(55300);t.exports=function(t,r,e){var a,u;o(t);try{if(!(a=i(t,"return"))){if("throw"===r)throw e;return e}a=n(a,t)}catch(s){u=!0,a=s}if("throw"===r)throw e;if(u)throw a;return o(a),e}},60693:(t,r,e)=>{"use strict";var n,o,i,a=e(24229),u=e(26733),s=e(22391),c=e(67567),f=e(14768),l=e(70095),h=e(24231),p=l("iterator"),v=!1;[].keys&&("next"in(i=[].keys())?(o=c(c(i)))!==Object.prototype&&(n=o):v=!0),null==n||a((function(){var t={};return n[p].call(t)!==t}))?n={}:h&&(n=s(n)),u(n[p])||f(n,p,(function(){return this})),t.exports={IteratorPrototype:n,BUGGY_SAFARI_ITERATORS:v}},45495:t=>{t.exports={}},39646:(t,r,e)=>{var n=e(34237);t.exports=function(t){return n(t.length)}},16039:(t,r,e)=>{var n=e(24229),o=e(26733),i=e(98270),a=e(7400),u=e(51805).CONFIGURABLE,s=e(8511),c=e(56407),f=c.enforce,l=c.get,h=Object.defineProperty,p=a&&!n((function(){return 8!==h((function(){}),"length",{value:8}).length})),v=String(String).split("String"),g=t.exports=function(t,r,e){if("Symbol("===String(r).slice(0,7)&&(r="["+String(r).replace(/^Symbol\(([^)]*)\)/,"$1")+"]"),e&&e.getter&&(r="get "+r),e&&e.setter&&(r="set "+r),(!i(t,"name")||u&&t.name!==r)&&h(t,"name",{value:r,configurable:!0}),p&&e&&i(e,"arity")&&t.length!==e.arity&&h(t,"length",{value:e.arity}),e&&i(e,"constructor")&&e.constructor){if(a)try{h(t,"prototype",{writable:!1})}catch(o){}}else t.prototype=void 0;var n=f(t);return i(n,"source")||(n.source=v.join("string"==typeof r?r:"")),t};Function.prototype.toString=g((function(){return o(this)&&l(this).source||s(this)}),"toString")},24794:(t,r,e)=>{var n,o,i,a,u,s,c,f,l=e(9859),h=e(97636),p=e(97933).f,v=e(55795).set,g=e(32023),d=e(8983),y=e(10263),m=e(28801),b=l.MutationObserver||l.WebKitMutationObserver,x=l.document,w=l.process,S=l.Promise,R=p(l,"queueMicrotask"),A=R&&R.value;A||(n=function(){var t,r;for(m&&(t=w.domain)&&t.exit();o;){r=o.fn,o=o.next;try{r()}catch(e){throw o?a():i=void 0,e}}i=void 0,t&&t.enter()},g||m||y||!b||!x?!d&&S&&S.resolve?((c=S.resolve(void 0)).constructor=S,f=h(c.then,c),a=function(){f(n)}):m?a=function(){w.nextTick(n)}:(v=h(v,l),a=function(){v(n)}):(u=!0,s=x.createTextNode(""),new b(n).observe(s,{characterData:!0}),a=function(){s.data=u=!u})),t.exports=A||function(t){var r={fn:t,next:void 0};i&&(i.next=r),o||(o=r,a()),i=r}},63839:(t,r,e)=>{var n=e(6358),o=e(24229);t.exports=!!Object.getOwnPropertySymbols&&!o((function(){var t=Symbol();return!String(t)||!(Object(t)instanceof Symbol)||!Symbol.sham&&n&&n<41}))},77274:(t,r,e)=>{var n=e(24229),o=e(70095),i=e(24231),a=o("iterator");t.exports=!n((function(){var t=new URL("b?a=1&b=2&c=3","http://a"),r=t.searchParams,e="";return t.pathname="c%20d",r.forEach((function(t,n){r.delete("b"),e+=n+t})),i&&!t.toJSON||!r.sort||"http://a/c%20d?a=1&c=3"!==t.href||"3"!==r.get("c")||"a=1"!==String(new URLSearchParams("?a=1"))||!r[a]||"a"!==new URL("https://a@b").username||"b"!==new URLSearchParams(new URLSearchParams("a=b")).get("a")||"xn--e1aybc"!==new URL("http://\u0442\u0435\u0441\u0442").host||"#%D0%B1"!==new URL("http://a#\u0431").hash||"a1c3"!==e||"x"!==new URL("http://x",void 0).host}))},18694:(t,r,e)=>{var n=e(9859),o=e(26733),i=e(8511),a=n.WeakMap;t.exports=o(a)&&/native code/.test(i(a))},16485:(t,r,e)=>{"use strict";var n=e(77111),o=function(t){var r,e;this.promise=new t((function(t,n){if(void 0!==r||void 0!==e)throw TypeError("Bad Promise constructor");r=t,e=n})),this.resolve=n(r),this.reject=n(e)};t.exports.f=function(t){return new o(t)}},47272:(t,r,e)=>{var n=e(9859),o=e(48311),i=n.TypeError;t.exports=function(t){if(o(t))throw i("The method doesn't accept regular expressions");return t}},45496:(t,r,e)=>{var n=e(9859),o=e(24229),i=e(65968),a=e(83326),u=e(1017).trim,s=e(41647),c=i("".charAt),f=n.parseFloat,l=n.Symbol,h=l&&l.iterator,p=1/f(s+"-0")!=-1/0||h&&!o((function(){f(Object(h))}));t.exports=p?function(t){var r=u(a(t)),e=f(r);return 0===e&&"-"==c(r,0)?-0:e}:f},36596:(t,r,e)=>{var n=e(9859),o=e(24229),i=e(65968),a=e(83326),u=e(1017).trim,s=e(41647),c=n.parseInt,f=n.Symbol,l=f&&f.iterator,h=/^[+-]?0x/i,p=i(h.exec),v=8!==c(s+"08")||22!==c(s+"0x16")||l&&!o((function(){c(Object(l))}));t.exports=v?function(t,r){var e=u(a(t));return c(e,r>>>0||(p(h,e)?16:10))}:c},47:(t,r,e)=>{"use strict";var n=e(7400),o=e(65968),i=e(20266),a=e(24229),u=e(65632),s=e(10894),c=e(19195),f=e(92991),l=e(9337),h=Object.assign,p=Object.defineProperty,v=o([].concat);t.exports=!h||a((function(){if(n&&1!==h({b:1},h(p({},"a",{enumerable:!0,get:function(){p(this,"b",{value:3,enumerable:!1})}}),{b:2})).b)return!0;var t={},r={},e=Symbol(),o="abcdefghijklmnopqrst";return t[e]=7,o.split("").forEach((function(t){r[t]=t})),7!=h({},t)[e]||u(h({},r)).join("")!=o}))?function(t,r){for(var e=f(t),o=arguments.length,a=1,h=s.f,p=c.f;o>a;)for(var g,d=l(arguments[a++]),y=h?v(u(d),h(d)):u(d),m=y.length,b=0;m>b;)g=y[b++],n&&!i(p,d,g)||(e[g]=d[g]);return e}:h},22391:(t,r,e)=>{var n,o=e(21176),i=e(90219),a=e(13837),u=e(95977),s=e(53777),c=e(22635),f=e(44399),l=f("IE_PROTO"),h=function(){},p=function(t){return"<script>"+t+"</"+"script>"},v=function(t){t.write(p("")),t.close();var r=t.parentWindow.Object;return t=null,r},g=function(){try{n=new ActiveXObject("htmlfile")}catch(o){}var t,r;g="undefined"!=typeof document?document.domain&&n?v(n):((r=c("iframe")).style.display="none",s.appendChild(r),r.src=String("javascript:"),(t=r.contentWindow.document).open(),t.write(p("document.F=Object")),t.close(),t.F):v(n);for(var e=a.length;e--;)delete g.prototype[a[e]];return g()};u[l]=!0,t.exports=Object.create||function(t,r){var e;return null!==t?(h.prototype=o(t),e=new h,h.prototype=null,e[l]=t):e=g(),void 0===r?e:i.f(e,r)}},90219:(t,r,e)=>{var n=e(7400),o=e(17137),i=e(31787),a=e(21176),u=e(10905),s=e(65632);r.f=n&&!o?Object.defineProperties:function(t,r){a(t);for(var e,n=u(r),o=s(r),c=o.length,f=0;c>f;)i.f(t,e=o[f++],n[e]);return t}},31787:(t,r,e)=>{var n=e(9859),o=e(7400),i=e(64394),a=e(17137),u=e(21176),s=e(39310),c=n.TypeError,f=Object.defineProperty,l=Object.getOwnPropertyDescriptor,h="enumerable",p="configurable",v="writable";r.f=o?a?function(t,r,e){if(u(t),r=s(r),u(e),"function"==typeof t&&"prototype"===r&&"value"in e&&v in e&&!e.writable){var n=l(t,r);n&&n.writable&&(t[r]=e.value,e={configurable:p in e?e.configurable:n.configurable,enumerable:h in e?e.enumerable:n.enumerable,writable:!1})}return f(t,r,e)}:f:function(t,r,e){if(u(t),r=s(r),u(e),i)try{return f(t,r,e)}catch(n){}if("get"in e||"set"in e)throw c("Accessors not supported");return"value"in e&&(t[r]=e.value),t}},97933:(t,r,e)=>{var n=e(7400),o=e(20266),i=e(19195),a=e(65358),u=e(10905),s=e(39310),c=e(98270),f=e(64394),l=Object.getOwnPropertyDescriptor;r.f=n?l:function(t,r){if(t=u(t),r=s(r),f)try{return l(t,r)}catch(e){}if(c(t,r))return a(!o(i.f,t,r),t[r])}},78151:(t,r,e)=>{var n=e(90140),o=e(13837).concat("length","prototype");r.f=Object.getOwnPropertyNames||function(t){return n(t,o)}},10894:(t,r)=>{r.f=Object.getOwnPropertySymbols},67567:(t,r,e)=>{var n=e(9859),o=e(98270),i=e(26733),a=e(92991),u=e(44399),s=e(27528),c=u("IE_PROTO"),f=n.Object,l=f.prototype;t.exports=s?f.getPrototypeOf:function(t){var r=a(t);if(o(r,c))return r[c];var e=r.constructor;return i(e)&&r instanceof e?e.prototype:r instanceof f?l:null}},91321:(t,r,e)=>{var n=e(65968);t.exports=n({}.isPrototypeOf)},90140:(t,r,e)=>{var n=e(65968),o=e(98270),i=e(10905),a=e(19540).indexOf,u=e(95977),s=n([].push);t.exports=function(t,r){var e,n=i(t),c=0,f=[];for(e in n)!o(u,e)&&o(n,e)&&s(f,e);for(;r.length>c;)o(n,e=r[c++])&&(~a(f,e)||s(f,e));return f}},65632:(t,r,e)=>{var n=e(90140),o=e(13837);t.exports=Object.keys||function(t){return n(t,o)}},19195:(t,r)=>{"use strict";var e={}.propertyIsEnumerable,n=Object.getOwnPropertyDescriptor,o=n&&!e.call({1:2},1);r.f=o?function(t){var r=n(this,t);return!!r&&r.enumerable}:e},15020:(t,r,e)=>{"use strict";var n=e(24231),o=e(9859),i=e(24229),a=e(49811);t.exports=n||!i((function(){if(!(a&&a<535)){var t=Math.random();__defineSetter__.call(null,t,(function(){})),delete o[t]}}))},56540:(t,r,e)=>{var n=e(65968),o=e(21176),i=e(88505);t.exports=Object.setPrototypeOf||("__proto__"in{}?function(){var t,r=!1,e={};try{(t=n(Object.getOwnPropertyDescriptor(Object.prototype,"__proto__").set))(e,[]),r=e instanceof Array}catch(a){}return function(e,n){return o(e),i(n),r?t(e,n):e.__proto__=n,e}}():void 0)},32914:(t,r,e)=>{var n=e(9859),o=e(20266),i=e(26733),a=e(85052),u=n.TypeError;t.exports=function(t,r){var e,n;if("string"===r&&i(e=t.toString)&&!a(n=o(e,t)))return n;if(i(e=t.valueOf)&&!a(n=o(e,t)))return n;if("string"!==r&&i(e=t.toString)&&!a(n=o(e,t)))return n;throw u("Can't convert object to primitive value")}},4826:(t,r,e)=>{var n=e(31333),o=e(65968),i=e(78151),a=e(10894),u=e(21176),s=o([].concat);t.exports=n("Reflect","ownKeys")||function(t){var r=i.f(u(t)),e=a.f;return e?s(r,e(t)):r}},49276:(t,r,e)=>{var n=e(9859);t.exports=n},64624:t=>{t.exports=function(t){try{return{error:!1,value:t()}}catch(r){return{error:!0,value:r}}}},38321:(t,r,e)=>{var n=e(9859),o=e(74473),i=e(26733),a=e(46541),u=e(8511),s=e(70095),c=e(48639),f=e(24231),l=e(6358),h=o&&o.prototype,p=s("species"),v=!1,g=i(n.PromiseRejectionEvent),d=a("Promise",(function(){var t=u(o),r=t!==String(o);if(!r&&66===l)return!0;if(f&&(!h.catch||!h.finally))return!0;if(l>=51&&/native code/.test(t))return!1;var e=new o((function(t){t(1)})),n=function(t){t((function(){}),(function(){}))};return(e.constructor={})[p]=n,!(v=e.then((function(){}))instanceof n)||!r&&c&&!g}));t.exports={CONSTRUCTOR:d,REJECTION_EVENT:g,SUBCLASSING:v}},74473:(t,r,e)=>{var n=e(9859);t.exports=n.Promise},62391:(t,r,e)=>{var n=e(21176),o=e(85052),i=e(16485);t.exports=function(t,r){if(n(t),o(r)&&r.constructor===t)return r;var e=i.f(t);return(0,e.resolve)(r),e.promise}},96866:(t,r,e)=>{var n=e(74473),o=e(74575),i=e(38321).CONSTRUCTOR;t.exports=i||!o((function(t){n.all(t).then(void 0,(function(){}))}))},26060:(t,r,e)=>{var n=e(31787).f;t.exports=function(t,r,e){e in t||n(t,e,{configurable:!0,get:function(){return r[e]},set:function(t){r[e]=t}})}},93358:t=>{var r=function(){this.head=null,this.tail=null};r.prototype={add:function(t){var r={item:t,next:null};this.head?this.tail.next=r:this.head=r,this.tail=r},get:function(){var t=this.head;if(t)return this.head=t.next,this.tail===t&&(this.tail=null),t.item}},t.exports=r},98115:(t,r,e)=>{var n=e(9859),o=e(20266),i=e(21176),a=e(26733),u=e(27079),s=e(63466),c=n.TypeError;t.exports=function(t,r){var e=t.exec;if(a(e)){var n=o(e,t,r);return null!==n&&i(n),n}if("RegExp"===u(t))return o(s,t,r);throw c("RegExp#exec called on incompatible receiver")}},63466:(t,r,e)=>{"use strict";var n,o,i=e(20266),a=e(65968),u=e(83326),s=e(30895),c=e(25650),f=e(33036),l=e(22391),h=e(56407).get,p=e(42926),v=e(10461),g=f("native-string-replace",String.prototype.replace),d=RegExp.prototype.exec,y=d,m=a("".charAt),b=a("".indexOf),x=a("".replace),w=a("".slice),S=(o=/b*/g,i(d,n=/a/,"a"),i(d,o,"a"),0!==n.lastIndex||0!==o.lastIndex),R=c.BROKEN_CARET,A=void 0!==/()??/.exec("")[1];(S||A||R||p||v)&&(y=function(t){var r,e,n,o,a,c,f,p=this,v=h(p),E=u(t),O=v.raw;if(O)return O.lastIndex=p.lastIndex,r=i(y,O,E),p.lastIndex=O.lastIndex,r;var P=v.groups,T=R&&p.sticky,I=i(s,p),L=p.source,U=0,j=E;if(T&&(I=x(I,"y",""),-1===b(I,"g")&&(I+="g"),j=w(E,p.lastIndex),p.lastIndex>0&&(!p.multiline||p.multiline&&"\n"!==m(E,p.lastIndex-1))&&(L="(?: "+L+")",j=" "+j,U++),e=new RegExp("^(?:"+L+")",I)),A&&(e=new RegExp("^"+L+"$(?!\\s)",I)),S&&(n=p.lastIndex),o=i(d,T?e:p,j),T?o?(o.input=w(o.input,U),o[0]=w(o[0],U),o.index=p.lastIndex,p.lastIndex+=o[0].length):p.lastIndex=0:S&&o&&(p.lastIndex=p.global?o.index+o[0].length:n),A&&o&&o.length>1&&i(g,o[0],e,(function(){for(a=1;a<arguments.length-2;a++)void 0===arguments[a]&&(o[a]=void 0)})),o&&P)for(o.groups=c=l(null),a=0;a<P.length;a++)c[(f=P[a])[0]]=o[f[1]];return o}),t.exports=y},30895:(t,r,e)=>{"use strict";var n=e(21176);t.exports=function(){var t=n(this),r="";return t.hasIndices&&(r+="d"),t.global&&(r+="g"),t.ignoreCase&&(r+="i"),t.multiline&&(r+="m"),t.dotAll&&(r+="s"),t.unicode&&(r+="u"),t.sticky&&(r+="y"),r}},83349:(t,r,e)=>{var n=e(20266),o=e(98270),i=e(91321),a=e(30895),u=RegExp.prototype;t.exports=function(t){var r=t.flags;return void 0!==r||"flags"in u||o(t,"flags")||!i(u,t)?r:n(a,t)}},25650:(t,r,e)=>{var n=e(24229),o=e(9859).RegExp,i=n((function(){var t=o("a","y");return t.lastIndex=2,null!=t.exec("abcd")})),a=i||n((function(){return!o("a","y").sticky})),u=i||n((function(){var t=o("^r","gy");return t.lastIndex=2,null!=t.exec("str")}));t.exports={BROKEN_CARET:u,MISSED_STICKY:a,UNSUPPORTED_Y:i}},42926:(t,r,e)=>{var n=e(24229),o=e(9859).RegExp;t.exports=n((function(){var t=o(".","s");return!(t.dotAll&&t.exec("\n")&&"s"===t.flags)}))},10461:(t,r,e)=>{var n=e(24229),o=e(9859).RegExp;t.exports=n((function(){var t=o("(?<a>b)","g");return"b"!==t.exec("b").groups.a||"bc"!=="b".replace(t,"$<a>c")}))},58885:(t,r,e)=>{var n=e(9859).TypeError;t.exports=function(t){if(null==t)throw n("Can't call method on "+t);return t}},72101:t=>{t.exports=Object.is||function(t,r){return t===r?0!==t||1/t==1/r:t!=t&&r!=r}},12079:(t,r,e)=>{var n=e(9859),o=Object.defineProperty;t.exports=function(t,r){try{o(n,t,{value:r,configurable:!0,writable:!0})}catch(e){n[t]=r}return r}},71832:(t,r,e)=>{"use strict";var n=e(31333),o=e(31787),i=e(70095),a=e(7400),u=i("species");t.exports=function(t){var r=n(t),e=o.f;a&&r&&!r[u]&&e(r,u,{configurable:!0,get:function(){return this}})}},54555:(t,r,e)=>{var n=e(31787).f,o=e(98270),i=e(70095)("toStringTag");t.exports=function(t,r,e){t&&!e&&(t=t.prototype),t&&!o(t,i)&&n(t,i,{configurable:!0,value:r})}},44399:(t,r,e)=>{var n=e(33036),o=e(81441),i=n("keys");t.exports=function(t){return i[t]||(i[t]=o(t))}},85353:(t,r,e)=>{var n=e(9859),o=e(12079),i="__core-js_shared__",a=n[i]||o(i,{});t.exports=a},33036:(t,r,e)=>{var n=e(24231),o=e(85353);(t.exports=function(t,r){return o[t]||(o[t]=void 0!==r?r:{})})("versions",[]).push({version:"3.22.5",mode:n?"pure":"global",copyright:"\xa9 2014-2022 Denis Pushkarev (zloirock.ru)",license:"https://github.com/zloirock/core-js/blob/v3.22.5/LICENSE",source:"https://github.com/zloirock/core-js"})},37942:(t,r,e)=>{var n=e(21176),o=e(57988),i=e(70095)("species");t.exports=function(t,r){var e,a=n(t).constructor;return void 0===a||null==(e=n(a)[i])?r:o(e)}},30966:(t,r,e)=>{var n=e(65968),o=e(43329),i=e(83326),a=e(58885),u=n("".charAt),s=n("".charCodeAt),c=n("".slice),f=function(t){return function(r,e){var n,f,l=i(a(r)),h=o(e),p=l.length;return h<0||h>=p?t?"":void 0:(n=s(l,h))<55296||n>56319||h+1===p||(f=s(l,h+1))<56320||f>57343?t?u(l,h):n:t?c(l,h,h+2):f-56320+(n-55296<<10)+65536}};t.exports={codeAt:f(!1),charAt:f(!0)}},57456:(t,r,e)=>{var n=e(80598);t.exports=/Version\/10(?:\.\d+){1,2}(?: [\w./]+)?(?: Mobile\/\w+)? Safari\//.test(n)},46650:(t,r,e)=>{var n=e(65968),o=e(34237),i=e(83326),a=e(93124),u=e(58885),s=n(a),c=n("".slice),f=Math.ceil,l=function(t){return function(r,e,n){var a,l,h=i(u(r)),p=o(e),v=h.length,g=void 0===n?" ":i(n);return p<=v||""==g?h:((l=s(g,f((a=p-v)/g.length))).length>a&&(l=c(l,0,a)),t?h+l:l+h)}};t.exports={start:l(!1),end:l(!0)}},77321:(t,r,e)=>{"use strict";var n=e(9859),o=e(65968),i=2147483647,a=/[^\0-\u007E]/,u=/[.\u3002\uFF0E\uFF61]/g,s="Overflow: input needs wider integers to process",c=n.RangeError,f=o(u.exec),l=Math.floor,h=String.fromCharCode,p=o("".charCodeAt),v=o([].join),g=o([].push),d=o("".replace),y=o("".split),m=o("".toLowerCase),b=function(t){return t+22+75*(t<26)},x=function(t,r,e){var n=0;for(t=e?l(t/700):t>>1,t+=l(t/r);t>455;)t=l(t/35),n+=36;return l(n+36*t/(t+38))},w=function(t){var r=[];t=function(t){for(var r=[],e=0,n=t.length;e<n;){var o=p(t,e++);if(o>=55296&&o<=56319&&e<n){var i=p(t,e++);56320==(64512&i)?g(r,((1023&o)<<10)+(1023&i)+65536):(g(r,o),e--)}else g(r,o)}return r}(t);var e,n,o=t.length,a=128,u=0,f=72;for(e=0;e<t.length;e++)(n=t[e])<128&&g(r,h(n));var d=r.length,y=d;for(d&&g(r,"-");y<o;){var m=i;for(e=0;e<t.length;e++)(n=t[e])>=a&&n<m&&(m=n);var w=y+1;if(m-a>l((i-u)/w))throw c(s);for(u+=(m-a)*w,a=m,e=0;e<t.length;e++){if((n=t[e])<a&&++u>i)throw c(s);if(n==a){for(var S=u,R=36;;){var A=R<=f?1:R>=f+26?26:R-f;if(S<A)break;var E=S-A,O=36-A;g(r,h(b(A+E%O))),S=l(E/O),R+=36}g(r,h(b(S))),f=x(u,w,y==d),u=0,y++}}u++,a++}return v(r,"")};t.exports=function(t){var r,e,n=[],o=y(d(m(t),u,"."),".");for(r=0;r<o.length;r++)e=o[r],g(n,f(a,e)?"xn--"+w(e):e);return v(n,".")}},93124:(t,r,e)=>{"use strict";var n=e(9859),o=e(43329),i=e(83326),a=e(58885),u=n.RangeError;t.exports=function(t){var r=i(a(this)),e="",n=o(t);if(n<0||n==1/0)throw u("Wrong number of repetitions");for(;n>0;(n>>>=1)&&(r+=r))1&n&&(e+=r);return e}},61466:(t,r,e)=>{"use strict";var n=e(1017).end,o=e(9445);t.exports=o("trimEnd")?function(){return n(this)}:"".trimEnd},9445:(t,r,e)=>{var n=e(51805).PROPER,o=e(24229),i=e(41647);t.exports=function(t){return o((function(){return!!i[t]()||"\u200b\x85\u180e"!=="\u200b\x85\u180e"[t]()||n&&i[t].name!==t}))}},58747:(t,r,e)=>{"use strict";var n=e(1017).start,o=e(9445);t.exports=o("trimStart")?function(){return n(this)}:"".trimStart},1017:(t,r,e)=>{var n=e(65968),o=e(58885),i=e(83326),a=e(41647),u=n("".replace),s="["+a+"]",c=RegExp("^"+s+s+"*"),f=RegExp(s+s+"*$"),l=function(t){return function(r){var e=i(o(r));return 1&t&&(e=u(e,c,"")),2&t&&(e=u(e,f,"")),e}};t.exports={start:l(1),end:l(2),trim:l(3)}},55795:(t,r,e)=>{var n,o,i,a,u=e(9859),s=e(53171),c=e(97636),f=e(26733),l=e(98270),h=e(24229),p=e(53777),v=e(1909),g=e(22635),d=e(77579),y=e(32023),m=e(28801),b=u.setImmediate,x=u.clearImmediate,w=u.process,S=u.Dispatch,R=u.Function,A=u.MessageChannel,E=u.String,O=0,P={},T="onreadystatechange";try{n=u.location}catch(k){}var I=function(t){if(l(P,t)){var r=P[t];delete P[t],r()}},L=function(t){return function(){I(t)}},U=function(t){I(t.data)},j=function(t){u.postMessage(E(t),n.protocol+"//"+n.host)};b&&x||(b=function(t){d(arguments.length,1);var r=f(t)?t:R(t),e=v(arguments,1);return P[++O]=function(){s(r,void 0,e)},o(O),O},x=function(t){delete P[t]},m?o=function(t){w.nextTick(L(t))}:S&&S.now?o=function(t){S.now(L(t))}:A&&!y?(a=(i=new A).port2,i.port1.onmessage=U,o=c(a.postMessage,a)):u.addEventListener&&f(u.postMessage)&&!u.importScripts&&n&&"file:"!==n.protocol&&!h(j)?(o=j,u.addEventListener("message",U,!1)):o=T in g("script")?function(t){p.appendChild(g("script")).onreadystatechange=function(){p.removeChild(this),I(t)}}:function(t){setTimeout(L(t),0)}),t.exports={set:b,clear:x}},90143:(t,r,e)=>{var n=e(65968);t.exports=n(1..valueOf)},43231:(t,r,e)=>{var n=e(43329),o=Math.max,i=Math.min;t.exports=function(t,r){var e=n(t);return e<0?o(e+r,0):i(e,r)}},7331:(t,r,e)=>{var n=e(9859),o=e(43329),i=e(34237),a=n.RangeError;t.exports=function(t){if(void 0===t)return 0;var r=o(t),e=i(r);if(r!==e)throw a("Wrong length or index");return e}},10905:(t,r,e)=>{var n=e(9337),o=e(58885);t.exports=function(t){return n(o(t))}},43329:t=>{var r=Math.ceil,e=Math.floor;t.exports=function(t){var n=+t;return n!=n||0===n?0:(n>0?e:r)(n)}},34237:(t,r,e)=>{var n=e(43329),o=Math.min;t.exports=function(t){return t>0?o(n(t),9007199254740991):0}},92991:(t,r,e)=>{var n=e(9859),o=e(58885),i=n.Object;t.exports=function(t){return i(o(t))}},84262:(t,r,e)=>{var n=e(9859),o=e(72002),i=n.RangeError;t.exports=function(t,r){var e=o(t);if(e%r)throw i("Wrong offset");return e}},72002:(t,r,e)=>{var n=e(9859),o=e(43329),i=n.RangeError;t.exports=function(t){var r=o(t);if(r<0)throw i("The argument can't be less than 0");return r}},92066:(t,r,e)=>{var n=e(9859),o=e(20266),i=e(85052),a=e(49395),u=e(55300),s=e(32914),c=e(70095),f=n.TypeError,l=c("toPrimitive");t.exports=function(t,r){if(!i(t)||a(t))return t;var e,n=u(t,l);if(n){if(void 0===r&&(r="default"),e=o(n,t,r),!i(e)||a(e))return e;throw f("Can't convert object to primitive value")}return void 0===r&&(r="number"),s(t,r)}},39310:(t,r,e)=>{var n=e(92066),o=e(49395);t.exports=function(t){var r=n(t,"string");return o(r)?r:r+""}},71601:(t,r,e)=>{var n={};n[e(70095)("toStringTag")]="z",t.exports="[object z]"===String(n)},83326:(t,r,e)=>{var n=e(9859),o=e(81589),i=n.String;t.exports=function(t){if("Symbol"===o(t))throw TypeError("Cannot convert a Symbol value to a string");return i(t)}},59821:(t,r,e)=>{var n=e(9859).String;t.exports=function(t){try{return n(t)}catch(r){return"Object"}}},42574:(t,r,e)=>{"use strict";var n=e(23103),o=e(9859),i=e(20266),a=e(7400),u=e(48200),s=e(9918),c=e(53816),f=e(57728),l=e(65358),h=e(75762),p=e(82292),v=e(34237),g=e(7331),d=e(84262),y=e(39310),m=e(98270),b=e(81589),x=e(85052),w=e(49395),S=e(22391),R=e(91321),A=e(56540),E=e(78151).f,O=e(35215),P=e(89996).forEach,T=e(71832),I=e(31787),L=e(97933),U=e(56407),j=e(20835),k=U.get,_=U.set,C=I.f,M=L.f,N=Math.round,F=o.RangeError,B=c.ArrayBuffer,D=B.prototype,q=c.DataView,H=s.NATIVE_ARRAY_BUFFER_VIEWS,G=s.TYPED_ARRAY_CONSTRUCTOR,V=s.TYPED_ARRAY_TAG,W=s.TypedArray,Y=s.TypedArrayPrototype,$=s.aTypedArrayConstructor,z=s.isTypedArray,K="BYTES_PER_ELEMENT",J="Wrong length",Q=function(t,r){$(t);for(var e=0,n=r.length,o=new t(n);n>e;)o[e]=r[e++];return o},X=function(t,r){C(t,r,{get:function(){return k(this)[r]}})},Z=function(t){var r;return R(D,t)||"ArrayBuffer"==(r=b(t))||"SharedArrayBuffer"==r},tt=function(t,r){return z(t)&&!w(r)&&r in t&&p(+r)&&r>=0},rt=function(t,r){return r=y(r),tt(t,r)?l(2,t[r]):M(t,r)},et=function(t,r,e){return r=y(r),!(tt(t,r)&&x(e)&&m(e,"value"))||m(e,"get")||m(e,"set")||e.configurable||m(e,"writable")&&!e.writable||m(e,"enumerable")&&!e.enumerable?C(t,r,e):(t[r]=e.value,t)};a?(H||(L.f=rt,I.f=et,X(Y,"buffer"),X(Y,"byteOffset"),X(Y,"byteLength"),X(Y,"length")),n({target:"Object",stat:!0,forced:!H},{getOwnPropertyDescriptor:rt,defineProperty:et}),t.exports=function(t,r,e){var a=t.match(/\d+$/)[0]/8,s=t+(e?"Clamped":"")+"Array",c="get"+t,l="set"+t,p=o[s],y=p,m=y&&y.prototype,b={},w=function(t,r){C(t,r,{get:function(){return function(t,r){var e=k(t);return e.view[c](r*a+e.byteOffset,!0)}(this,r)},set:function(t){return function(t,r,n){var o=k(t);e&&(n=(n=N(n))<0?0:n>255?255:255&n),o.view[l](r*a+o.byteOffset,n,!0)}(this,r,t)},enumerable:!0})};H?u&&(y=r((function(t,r,e,n){return f(t,m),j(x(r)?Z(r)?void 0!==n?new p(r,d(e,a),n):void 0!==e?new p(r,d(e,a)):new p(r):z(r)?Q(y,r):i(O,y,r):new p(g(r)),t,y)})),A&&A(y,W),P(E(p),(function(t){t in y||h(y,t,p[t])})),y.prototype=m):(y=r((function(t,r,e,n){f(t,m);var o,u,s,c=0,l=0;if(x(r)){if(!Z(r))return z(r)?Q(y,r):i(O,y,r);o=r,l=d(e,a);var h=r.byteLength;if(void 0===n){if(h%a)throw F(J);if((u=h-l)<0)throw F(J)}else if((u=v(n)*a)+l>h)throw F(J);s=u/a}else s=g(r),o=new B(u=s*a);for(_(t,{buffer:o,byteOffset:l,byteLength:u,length:s,view:new q(o)});c<s;)w(t,c++)})),A&&A(y,W),m=y.prototype=S(Y)),m.constructor!==y&&h(m,"constructor",y),h(m,G,y),V&&h(m,V,s);var R=y!=p;b[s]=y,n({global:!0,constructor:!0,forced:R,sham:!H},b),K in y||h(y,K,a),K in m||h(m,K,a),T(s)}):t.exports=function(){}},48200:(t,r,e)=>{var n=e(9859),o=e(24229),i=e(74575),a=e(9918).NATIVE_ARRAY_BUFFER_VIEWS,u=n.ArrayBuffer,s=n.Int8Array;t.exports=!a||!o((function(){s(1)}))||!o((function(){new s(-1)}))||!i((function(t){new s,new s(null),new s(1.5),new s(t)}),!0)||o((function(){return 1!==new s(new u(2),1,void 0).length}))},35215:(t,r,e)=>{var n=e(97636),o=e(20266),i=e(57988),a=e(92991),u=e(39646),s=e(28403),c=e(78830),f=e(91943),l=e(9918).aTypedArrayConstructor;t.exports=function(t){var r,e,h,p,v,g,d=i(this),y=a(t),m=arguments.length,b=m>1?arguments[1]:void 0,x=void 0!==b,w=c(y);if(w&&!f(w))for(g=(v=s(y,w)).next,y=[];!(p=o(g,v)).done;)y.push(p.value);for(x&&m>2&&(b=n(b,arguments[2])),e=u(y),h=new(l(d))(e),r=0;e>r;r++)h[r]=x?b(y[r],r):y[r];return h}},81441:(t,r,e)=>{var n=e(65968),o=0,i=Math.random(),a=n(1..toString);t.exports=function(t){return"Symbol("+(void 0===t?"":t)+")_"+a(++o+i,36)}},66969:(t,r,e)=>{var n=e(63839);t.exports=n&&!Symbol.sham&&"symbol"==typeof Symbol.iterator},17137:(t,r,e)=>{var n=e(7400),o=e(24229);t.exports=n&&o((function(){return 42!=Object.defineProperty((function(){}),"prototype",{value:42,writable:!1}).prototype}))},77579:(t,r,e)=>{var n=e(9859).TypeError;t.exports=function(t,r){if(t<r)throw n("Not enough arguments");return t}},55391:(t,r,e)=>{var n=e(70095);r.f=n},70095:(t,r,e)=>{var n=e(9859),o=e(33036),i=e(98270),a=e(81441),u=e(63839),s=e(66969),c=o("wks"),f=n.Symbol,l=f&&f.for,h=s?f:f&&f.withoutSetter||a;t.exports=function(t){if(!i(c,t)||!u&&"string"!=typeof c[t]){var r="Symbol."+t;u&&i(f,t)?c[t]=f[t]:c[t]=s&&l?l(r):h(r)}return c[t]}},41647:t=>{t.exports="\t\n\v\f\r \xa0\u1680\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000\u2028\u2029\ufeff"},65388:(t,r,e)=>{"use strict";var n=e(23103),o=e(9859),i=e(53816),a=e(71832),u="ArrayBuffer",s=i.ArrayBuffer;n({global:!0,constructor:!0,forced:o.ArrayBuffer!==s},{ArrayBuffer:s}),a(u)},72994:(t,r,e)=>{"use strict";var n=e(23103),o=e(65968),i=e(24229),a=e(53816),u=e(21176),s=e(43231),c=e(34237),f=e(37942),l=a.ArrayBuffer,h=a.DataView,p=h.prototype,v=o(l.prototype.slice),g=o(p.getUint8),d=o(p.setUint8);n({target:"ArrayBuffer",proto:!0,unsafe:!0,forced:i((function(){return!new l(2).slice(1,void 0).byteLength}))},{slice:function(t,r){if(v&&void 0===r)return v(u(this),t);for(var e=u(this).byteLength,n=s(t,e),o=s(void 0===r?e:r,e),i=new(f(this,l))(c(o-n)),a=new h(this),p=new h(i),y=0;n<o;)d(p,y++,g(a,n++));return i}})},84870:(t,r,e)=>{"use strict";var n=e(23103),o=e(34990),i=e(77111),a=e(92991),u=e(39646),s=e(87501);n({target:"Array",proto:!0},{flatMap:function(t){var r,e=a(this),n=u(e);return i(t),(r=s(e,0)).length=o(r,e,e,n,0,1,t,arguments.length>1?arguments[1]:void 0),r}})},27072:(t,r,e)=>{"use strict";var n=e(23103),o=e(34990),i=e(92991),a=e(39646),u=e(43329),s=e(87501);n({target:"Array",proto:!0},{flat:function(){var t=arguments.length?arguments[0]:void 0,r=i(this),e=a(r),n=s(r,0);return n.length=o(n,r,r,e,0,void 0===t?1:u(t)),n}})},39529:(t,r,e)=>{"use strict";var n=e(23103),o=e(19540).includes,i=e(24229),a=e(9736);n({target:"Array",proto:!0,forced:i((function(){return!Array(1).includes()}))},{includes:function(t){return o(this,t,arguments.length>1?arguments[1]:void 0)}}),a("includes")},15735:(t,r,e)=>{"use strict";var n=e(10905),o=e(9736),i=e(45495),a=e(56407),u=e(31787).f,s=e(67675),c=e(24231),f=e(7400),l="Array Iterator",h=a.set,p=a.getterFor(l);t.exports=s(Array,"Array",(function(t,r){h(this,{type:l,target:n(t),index:0,kind:r})}),(function(){var t=p(this),r=t.target,e=t.kind,n=t.index++;return!r||n>=r.length?(t.target=void 0,{value:void 0,done:!0}):"keys"==e?{value:n,done:!1}:"values"==e?{value:r[n],done:!1}:{value:[n,r[n]],done:!1}}),"values");var v=i.Arguments=i.Array;if(o("keys"),o("values"),o("entries"),!c&&f&&"values"!==v.name)try{u(v,"name",{value:"values"})}catch(g){}},9731:(t,r,e)=>{"use strict";var n=e(23103),o=e(43143).right,i=e(96038),a=e(6358),u=e(28801);n({target:"Array",proto:!0,forced:!i("reduceRight")||!u&&a>79&&a<83},{reduceRight:function(t){return o(this,t,arguments.length,arguments.length>1?arguments[1]:void 0)}})},43108:(t,r,e)=>{"use strict";var n=e(23103),o=e(43143).left,i=e(96038),a=e(6358),u=e(28801);n({target:"Array",proto:!0,forced:!i("reduce")||!u&&a>79&&a<83},{reduce:function(t){var r=arguments.length;return o(this,t,r,r>1?arguments[1]:void 0)}})},49992:(t,r,e)=>{"use strict";var n=e(23103),o=e(65968),i=e(33718),a=o([].reverse),u=[1,2];n({target:"Array",proto:!0,forced:String(u)===String(u.reverse())},{reverse:function(){return i(this)&&(this.length=this.length),a(this)}})},43430:(t,r,e)=>{"use strict";var n=e(23103),o=e(65968),i=e(77111),a=e(92991),u=e(39646),s=e(83326),c=e(24229),f=e(33867),l=e(96038),h=e(22671),p=e(48506),v=e(6358),g=e(49811),d=[],y=o(d.sort),m=o(d.push),b=c((function(){d.sort(void 0)})),x=c((function(){d.sort(null)})),w=l("sort"),S=!c((function(){if(v)return v<70;if(!(h&&h>3)){if(p)return!0;if(g)return g<603;var t,r,e,n,o="";for(t=65;t<76;t++){switch(r=String.fromCharCode(t),t){case 66:case 69:case 70:case 72:e=3;break;case 68:case 71:e=4;break;default:e=2}for(n=0;n<47;n++)d.push({k:r+n,v:e})}for(d.sort((function(t,r){return r.v-t.v})),n=0;n<d.length;n++)r=d[n].k.charAt(0),o.charAt(o.length-1)!==r&&(o+=r);return"DGBEFHACIJK"!==o}}));n({target:"Array",proto:!0,forced:b||!x||!w||!S},{sort:function(t){void 0!==t&&i(t);var r=a(this);if(S)return void 0===t?y(r):y(r,t);var e,n,o=[],c=u(r);for(n=0;n<c;n++)n in r&&m(o,r[n]);for(f(o,function(t){return function(r,e){return void 0===e?-1:void 0===r?1:void 0!==t?+t(r,e)||0:s(r)>s(e)?1:-1}}(t)),e=o.length,n=0;n<e;)r[n]=o[n++];for(;n<c;)delete r[n++];return r}})},53985:(t,r,e)=>{e(9736)("flatMap")},67694:(t,r,e)=>{e(9736)("flat")},39509:(t,r,e)=>{var n=e(23103),o=Math.hypot,i=Math.abs,a=Math.sqrt;n({target:"Math",stat:!0,arity:2,forced:!!o&&o(1/0,NaN)!==1/0},{hypot:function(t,r){for(var e,n,o=0,u=0,s=arguments.length,c=0;u<s;)c<(e=i(arguments[u++]))?(o=o*(n=c/e)*n+1,c=e):o+=e>0?(n=e/c)*n:e;return c===1/0?1/0:c*a(o)}})},48836:(t,r,e)=>{var n=e(23103),o=e(45496);n({target:"Number",stat:!0,forced:Number.parseFloat!=o},{parseFloat:o})},77208:(t,r,e)=>{var n=e(23103),o=e(36596);n({target:"Number",stat:!0,forced:Number.parseInt!=o},{parseInt:o})},61657:(t,r,e)=>{"use strict";var n=e(23103),o=e(9859),i=e(65968),a=e(43329),u=e(90143),s=e(93124),c=e(24229),f=o.RangeError,l=o.String,h=Math.floor,p=i(s),v=i("".slice),g=i(1..toFixed),d=function(t,r,e){return 0===r?e:r%2==1?d(t,r-1,e*t):d(t*t,r/2,e)},y=function(t,r,e){for(var n=-1,o=e;++n<6;)o+=r*t[n],t[n]=o%1e7,o=h(o/1e7)},m=function(t,r){for(var e=6,n=0;--e>=0;)n+=t[e],t[e]=h(n/r),n=n%r*1e7},b=function(t){for(var r=6,e="";--r>=0;)if(""!==e||0===r||0!==t[r]){var n=l(t[r]);e=""===e?n:e+p("0",7-n.length)+n}return e};n({target:"Number",proto:!0,forced:c((function(){return"0.000"!==g(8e-5,3)||"1"!==g(.9,0)||"1.25"!==g(1.255,2)||"1000000000000000128"!==g(0xde0b6b3a7640080,0)}))||!c((function(){g({})}))},{toFixed:function(t){var r,e,n,o,i=u(this),s=a(t),c=[0,0,0,0,0,0],h="",g="0";if(s<0||s>20)throw f("Incorrect fraction digits");if(i!=i)return"NaN";if(i<=-1e21||i>=1e21)return l(i);if(i<0&&(h="-",i=-i),i>1e-21)if(e=(r=function(t){for(var r=0,e=t;e>=4096;)r+=12,e/=4096;for(;e>=2;)r+=1,e/=2;return r}(i*d(2,69,1))-69)<0?i*d(2,-r,1):i/d(2,r,1),e*=4503599627370496,(r=52-r)>0){for(y(c,0,e),n=s;n>=7;)y(c,1e7,0),n-=7;for(y(c,d(10,n,1),0),n=r-1;n>=23;)m(c,1<<23),n-=23;m(c,1<<n),y(c,1,1),m(c,2),g=b(c)}else y(c,0,e),y(c,1<<-r,0),g=b(c)+p("0",s);return g=s>0?h+((o=g.length)<=s?"0."+p("0",s-o)+g:v(g,0,o-s)+"."+v(g,o-s)):h+g}})},43105:(t,r,e)=>{var n=e(23103),o=e(47);n({target:"Object",stat:!0,arity:2,forced:Object.assign!==o},{assign:o})},37846:(t,r,e)=>{"use strict";var n=e(23103),o=e(7400),i=e(15020),a=e(77111),u=e(92991),s=e(31787);o&&n({target:"Object",proto:!0,forced:i},{__defineGetter__:function(t,r){s.f(u(this),t,{get:a(r),enumerable:!0,configurable:!0})}})},16635:(t,r,e)=>{"use strict";var n=e(23103),o=e(7400),i=e(15020),a=e(77111),u=e(92991),s=e(31787);o&&n({target:"Object",proto:!0,forced:i},{__defineSetter__:function(t,r){s.f(u(this),t,{set:a(r),enumerable:!0,configurable:!0})}})},81804:(t,r,e)=>{var n=e(23103),o=e(89003),i=e(62324);n({target:"Object",stat:!0},{fromEntries:function(t){var r={};return o(t,(function(t,e){i(r,t,e)}),{AS_ENTRIES:!0}),r}})},42586:(t,r,e)=>{"use strict";var n=e(23103),o=e(7400),i=e(15020),a=e(92991),u=e(39310),s=e(67567),c=e(97933).f;o&&n({target:"Object",proto:!0,forced:i},{__lookupGetter__:function(t){var r,e=a(this),n=u(t);do{if(r=c(e,n))return r.get}while(e=s(e))}})},43045:(t,r,e)=>{"use strict";var n=e(23103),o=e(7400),i=e(15020),a=e(92991),u=e(39310),s=e(67567),c=e(97933).f;o&&n({target:"Object",proto:!0,forced:i},{__lookupSetter__:function(t){var r,e=a(this),n=u(t);do{if(r=c(e,n))return r.set}while(e=s(e))}})},13489:(t,r,e)=>{var n=e(23103),o=e(45496);n({global:!0,forced:parseFloat!=o},{parseFloat:o})},68995:(t,r,e)=>{var n=e(23103),o=e(36596);n({global:!0,forced:parseInt!=o},{parseInt:o})},56032:(t,r,e)=>{"use strict";var n=e(23103),o=e(20266),i=e(77111),a=e(16485),u=e(64624),s=e(89003);n({target:"Promise",stat:!0,forced:e(96866)},{all:function(t){var r=this,e=a.f(r),n=e.resolve,c=e.reject,f=u((function(){var e=i(r.resolve),a=[],u=0,f=1;s(t,(function(t){var i=u++,s=!1;f++,o(e,r,t).then((function(t){s||(s=!0,a[i]=t,--f||n(a))}),c)})),--f||n(a)}));return f.error&&c(f.value),e.promise}})},6135:(t,r,e)=>{"use strict";var n=e(23103),o=e(24231),i=e(38321).CONSTRUCTOR,a=e(74473),u=e(31333),s=e(26733),c=e(14768),f=a&&a.prototype;if(n({target:"Promise",proto:!0,forced:i,real:!0},{catch:function(t){return this.then(void 0,t)}}),!o&&s(a)){var l=u("Promise").prototype.catch;f.catch!==l&&c(f,"catch",l,{unsafe:!0})}},86087:(t,r,e)=>{"use strict";var n,o,i,a=e(23103),u=e(24231),s=e(28801),c=e(9859),f=e(20266),l=e(14768),h=e(56540),p=e(54555),v=e(71832),g=e(77111),d=e(26733),y=e(85052),m=e(57728),b=e(37942),x=e(55795).set,w=e(24794),S=e(14665),R=e(64624),A=e(93358),E=e(56407),O=e(74473),P=e(38321),T=e(16485),I="Promise",L=P.CONSTRUCTOR,U=P.REJECTION_EVENT,j=P.SUBCLASSING,k=E.getterFor(I),_=E.set,C=O&&O.prototype,M=O,N=C,F=c.TypeError,B=c.document,D=c.process,q=T.f,H=q,G=!!(B&&B.createEvent&&c.dispatchEvent),V="unhandledrejection",W=function(t){var r;return!(!y(t)||!d(r=t.then))&&r},Y=function(t,r){var e,n,o,i=r.value,a=1==r.state,u=a?t.ok:t.fail,s=t.resolve,c=t.reject,l=t.domain;try{u?(a||(2===r.rejection&&Q(r),r.rejection=1),!0===u?e=i:(l&&l.enter(),e=u(i),l&&(l.exit(),o=!0)),e===t.promise?c(F("Promise-chain cycle")):(n=W(e))?f(n,e,s,c):s(e)):c(i)}catch(h){l&&!o&&l.exit(),c(h)}},$=function(t,r){t.notified||(t.notified=!0,w((function(){for(var e,n=t.reactions;e=n.get();)Y(e,t);t.notified=!1,r&&!t.rejection&&K(t)})))},z=function(t,r,e){var n,o;G?((n=B.createEvent("Event")).promise=r,n.reason=e,n.initEvent(t,!1,!0),c.dispatchEvent(n)):n={promise:r,reason:e},!U&&(o=c["on"+t])?o(n):t===V&&S("Unhandled promise rejection",e)},K=function(t){f(x,c,(function(){var r,e=t.facade,n=t.value;if(J(t)&&(r=R((function(){s?D.emit("unhandledRejection",n,e):z(V,e,n)})),t.rejection=s||J(t)?2:1,r.error))throw r.value}))},J=function(t){return 1!==t.rejection&&!t.parent},Q=function(t){f(x,c,(function(){var r=t.facade;s?D.emit("rejectionHandled",r):z("rejectionhandled",r,t.value)}))},X=function(t,r,e){return function(n){t(r,n,e)}},Z=function(t,r,e){t.done||(t.done=!0,e&&(t=e),t.value=r,t.state=2,$(t,!0))},tt=function(t,r,e){if(!t.done){t.done=!0,e&&(t=e);try{if(t.facade===r)throw F("Promise can't be resolved itself");var n=W(r);n?w((function(){var e={done:!1};try{f(n,r,X(tt,e,t),X(Z,e,t))}catch(o){Z(e,o,t)}})):(t.value=r,t.state=1,$(t,!1))}catch(o){Z({done:!1},o,t)}}};if(L&&(N=(M=function(t){m(this,N),g(t),f(n,this);var r=k(this);try{t(X(tt,r),X(Z,r))}catch(e){Z(r,e)}}).prototype,(n=function(t){_(this,{type:I,done:!1,notified:!1,parent:!1,reactions:new A,rejection:!1,state:0,value:void 0})}).prototype=l(N,"then",(function(t,r){var e=k(this),n=q(b(this,M));return e.parent=!0,n.ok=!d(t)||t,n.fail=d(r)&&r,n.domain=s?D.domain:void 0,0==e.state?e.reactions.add(n):w((function(){Y(n,e)})),n.promise})),o=function(){var t=new n,r=k(t);this.promise=t,this.resolve=X(tt,r),this.reject=X(Z,r)},T.f=q=function(t){return t===M||undefined===t?new o(t):H(t)},!u&&d(O)&&C!==Object.prototype)){i=C.then,j||l(C,"then",(function(t,r){var e=this;return new M((function(t,r){f(i,e,t,r)})).then(t,r)}),{unsafe:!0});try{delete C.constructor}catch(rt){}h&&h(C,N)}a({global:!0,constructor:!0,wrap:!0,forced:L},{Promise:M}),p(M,I,!1,!0),v(I)},21515:(t,r,e)=>{"use strict";var n=e(23103),o=e(24231),i=e(74473),a=e(24229),u=e(31333),s=e(26733),c=e(37942),f=e(62391),l=e(14768),h=i&&i.prototype;if(n({target:"Promise",proto:!0,real:!0,forced:!!i&&a((function(){h.finally.call({then:function(){}},(function(){}))}))},{finally:function(t){var r=c(this,u("Promise")),e=s(t);return this.then(e?function(e){return f(r,t()).then((function(){return e}))}:t,e?function(e){return f(r,t()).then((function(){throw e}))}:t)}}),!o&&s(i)){var p=u("Promise").prototype.finally;h.finally!==p&&l(h,"finally",p,{unsafe:!0})}},73439:(t,r,e)=>{e(86087),e(56032),e(6135),e(26767),e(39320),e(52047)},26767:(t,r,e)=>{"use strict";var n=e(23103),o=e(20266),i=e(77111),a=e(16485),u=e(64624),s=e(89003);n({target:"Promise",stat:!0,forced:e(96866)},{race:function(t){var r=this,e=a.f(r),n=e.reject,c=u((function(){var a=i(r.resolve);s(t,(function(t){o(a,r,t).then(e.resolve,n)}))}));return c.error&&n(c.value),e.promise}})},39320:(t,r,e)=>{"use strict";var n=e(23103),o=e(20266),i=e(16485);n({target:"Promise",stat:!0,forced:e(38321).CONSTRUCTOR},{reject:function(t){var r=i.f(this);return o(r.reject,void 0,t),r.promise}})},52047:(t,r,e)=>{"use strict";var n=e(23103),o=e(31333),i=e(24231),a=e(74473),u=e(38321).CONSTRUCTOR,s=e(62391),c=o("Promise"),f=i&&!u;n({target:"Promise",stat:!0,forced:i||u},{resolve:function(t){return s(f&&this===c?a:this,t)}})},98738:(t,r,e)=>{var n=e(23103),o=e(20266),i=e(21176),a=e(85052),u=e(90193),s=e(24229),c=e(31787),f=e(97933),l=e(67567),h=e(65358);n({target:"Reflect",stat:!0,forced:s((function(){var t=function(){},r=c.f(new t,"a",{configurable:!0});return!1!==Reflect.set(t.prototype,"a",1,r)}))},{set:function t(r,e,n){var s,p,v,g=arguments.length<4?r:arguments[3],d=f.f(i(r),e);if(!d){if(a(p=l(r)))return t(p,e,n,g);d=h(0)}if(u(d)){if(!1===d.writable||!a(g))return!1;if(s=f.f(g,e)){if(s.get||s.set||!1===s.writable)return!1;s.value=n,c.f(g,e,s)}else c.f(g,e,h(0,n))}else{if(void 0===(v=d.set))return!1;o(v,g,n)}return!0}})},17368:(t,r,e)=>{var n=e(7400),o=e(9859),i=e(65968),a=e(46541),u=e(20835),s=e(75762),c=e(78151).f,f=e(91321),l=e(48311),h=e(83326),p=e(83349),v=e(25650),g=e(26060),d=e(14768),y=e(24229),m=e(98270),b=e(56407).enforce,x=e(71832),w=e(70095),S=e(42926),R=e(10461),A=w("match"),E=o.RegExp,O=E.prototype,P=o.SyntaxError,T=i(O.exec),I=i("".charAt),L=i("".replace),U=i("".indexOf),j=i("".slice),k=/^\?<[^\s\d!#%&*+<=>@^][^\s!#%&*+<=>@^]*>/,_=/a/g,C=/a/g,M=new E(_)!==_,N=v.MISSED_STICKY,F=v.UNSUPPORTED_Y,B=n&&(!M||N||S||R||y((function(){return C[A]=!1,E(_)!=_||E(C)==C||"/a/i"!=E(_,"i")})));if(a("RegExp",B)){for(var D=function(t,r){var e,n,o,i,a,c,v=f(O,this),g=l(t),d=void 0===r,y=[],x=t;if(!v&&g&&d&&t.constructor===D)return t;if((g||f(O,t))&&(t=t.source,d&&(r=p(x))),t=void 0===t?"":h(t),r=void 0===r?"":h(r),x=t,S&&"dotAll"in _&&(n=!!r&&U(r,"s")>-1)&&(r=L(r,/s/g,"")),e=r,N&&"sticky"in _&&(o=!!r&&U(r,"y")>-1)&&F&&(r=L(r,/y/g,"")),R&&(i=function(t){for(var r,e=t.length,n=0,o="",i=[],a={},u=!1,s=!1,c=0,f="";n<=e;n++){if("\\"===(r=I(t,n)))r+=I(t,++n);else if("]"===r)u=!1;else if(!u)switch(!0){case"["===r:u=!0;break;case"("===r:T(k,j(t,n+1))&&(n+=2,s=!0),o+=r,c++;continue;case">"===r&&s:if(""===f||m(a,f))throw new P("Invalid capture group name");a[f]=!0,i[i.length]=[f,c],s=!1,f="";continue}s?f+=r:o+=r}return[o,i]}(t),t=i[0],y=i[1]),a=u(E(t,r),v?this:O,D),(n||o||y.length)&&(c=b(a),n&&(c.dotAll=!0,c.raw=D(function(t){for(var r,e=t.length,n=0,o="",i=!1;n<=e;n++)"\\"!==(r=I(t,n))?i||"."!==r?("["===r?i=!0:"]"===r&&(i=!1),o+=r):o+="[\\s\\S]":o+=r+I(t,++n);return o}(t),e)),o&&(c.sticky=!0),y.length&&(c.groups=y)),t!==x)try{s(a,"source",""===x?"(?:)":x)}catch(w){}return a},q=c(E),H=0;q.length>H;)g(D,E,q[H++]);O.constructor=D,D.prototype=O,d(o,"RegExp",D,{constructor:!0})}x("RegExp")},77950:(t,r,e)=>{"use strict";var n=e(23103),o=e(63466);n({target:"RegExp",proto:!0,forced:/./.exec!==o},{exec:o})},90103:(t,r,e)=>{var n=e(7400),o=e(96616),i=e(30895),a=e(24229),u=RegExp.prototype;n&&a((function(){return"sy"!==Object.getOwnPropertyDescriptor(u,"flags").get.call({dotAll:!0,sticky:!0})}))&&o(u,"flags",{configurable:!0,get:i})},88233:(t,r,e)=>{"use strict";var n=e(51805).PROPER,o=e(14768),i=e(21176),a=e(83326),u=e(24229),s=e(83349),c="toString",f=RegExp.prototype.toString,l=u((function(){return"/a/b"!=f.call({source:"a",flags:"b"})})),h=n&&f.name!=c;(l||h)&&o(RegExp.prototype,c,(function(){var t=i(this);return"/"+a(t.source)+"/"+a(s(t))}),{unsafe:!0})},96708:(t,r,e)=>{"use strict";var n,o=e(23103),i=e(65968),a=e(97933).f,u=e(34237),s=e(83326),c=e(47272),f=e(58885),l=e(48127),h=e(24231),p=i("".endsWith),v=i("".slice),g=Math.min,d=l("endsWith");o({target:"String",proto:!0,forced:!!(h||d||(n=a(String.prototype,"endsWith"),!n||n.writable))&&!d},{endsWith:function(t){var r=s(f(this));c(t);var e=arguments.length>1?arguments[1]:void 0,n=r.length,o=void 0===e?n:g(u(e),n),i=s(t);return p?p(r,i,o):v(r,o-i.length,o)===i}})},31235:(t,r,e)=>{"use strict";var n=e(23103),o=e(65968),i=e(47272),a=e(58885),u=e(83326),s=e(48127),c=o("".indexOf);n({target:"String",proto:!0,forced:!s("includes")},{includes:function(t){return!!~c(u(a(this)),u(i(t)),arguments.length>1?arguments[1]:void 0)}})},28673:(t,r,e)=>{"use strict";var n=e(30966).charAt,o=e(83326),i=e(56407),a=e(67675),u="String Iterator",s=i.set,c=i.getterFor(u);a(String,"String",(function(t){s(this,{type:u,string:o(t),index:0})}),(function(){var t,r=c(this),e=r.string,o=r.index;return o>=e.length?{value:void 0,done:!0}:(t=n(e,o),r.index+=t.length,{value:t,done:!1})}))},74069:(t,r,e)=>{"use strict";var n=e(20266),o=e(94954),i=e(21176),a=e(34237),u=e(83326),s=e(58885),c=e(55300),f=e(36637),l=e(98115);o("match",(function(t,r,e){return[function(r){var e=s(this),o=null==r?void 0:c(r,t);return o?n(o,r,e):new RegExp(r)[t](u(e))},function(t){var n=i(this),o=u(t),s=e(r,n,o);if(s.done)return s.value;if(!n.global)return l(n,o);var c=n.unicode;n.lastIndex=0;for(var h,p=[],v=0;null!==(h=l(n,o));){var g=u(h[0]);p[v]=g,""===g&&(n.lastIndex=f(o,a(n.lastIndex),c)),v++}return 0===v?null:p}]}))},90977:(t,r,e)=>{"use strict";var n=e(23103),o=e(46650).end;n({target:"String",proto:!0,forced:e(57456)},{padEnd:function(t){return o(this,t,arguments.length>1?arguments[1]:void 0)}})},35734:(t,r,e)=>{"use strict";var n=e(23103),o=e(46650).start;n({target:"String",proto:!0,forced:e(57456)},{padStart:function(t){return o(this,t,arguments.length>1?arguments[1]:void 0)}})},85940:(t,r,e)=>{"use strict";var n=e(53171),o=e(20266),i=e(65968),a=e(94954),u=e(24229),s=e(21176),c=e(26733),f=e(43329),l=e(34237),h=e(83326),p=e(58885),v=e(36637),g=e(55300),d=e(70017),y=e(98115),m=e(70095)("replace"),b=Math.max,x=Math.min,w=i([].concat),S=i([].push),R=i("".indexOf),A=i("".slice),E="$0"==="a".replace(/./,"$0"),O=!!/./[m]&&""===/./[m]("a","$0");a("replace",(function(t,r,e){var i=O?"$":"$0";return[function(t,e){var n=p(this),i=null==t?void 0:g(t,m);return i?o(i,t,n,e):o(r,h(n),t,e)},function(t,o){var a=s(this),u=h(t);if("string"==typeof o&&-1===R(o,i)&&-1===R(o,"$<")){var p=e(r,a,u,o);if(p.done)return p.value}var g=c(o);g||(o=h(o));var m=a.global;if(m){var E=a.unicode;a.lastIndex=0}for(var O=[];;){var P=y(a,u);if(null===P)break;if(S(O,P),!m)break;""===h(P[0])&&(a.lastIndex=v(u,l(a.lastIndex),E))}for(var T,I="",L=0,U=0;U<O.length;U++){for(var j=h((P=O[U])[0]),k=b(x(f(P.index),u.length),0),_=[],C=1;C<P.length;C++)S(_,void 0===(T=P[C])?T:String(T));var M=P.groups;if(g){var N=w([j],_,k,u);void 0!==M&&S(N,M);var F=h(n(o,void 0,N))}else F=d(j,u,k,_,M,o);k>=L&&(I+=A(u,L,k)+F,L=k+j.length)}return I+A(u,L)}]}),!!u((function(){var t=/./;return t.exec=function(){var t=[];return t.groups={a:"7"},t},"7"!=="".replace(t,"$<a>")}))||!E||O)},94908:(t,r,e)=>{"use strict";var n=e(20266),o=e(94954),i=e(21176),a=e(58885),u=e(72101),s=e(83326),c=e(55300),f=e(98115);o("search",(function(t,r,e){return[function(r){var e=a(this),o=null==r?void 0:c(r,t);return o?n(o,r,e):new RegExp(r)[t](s(e))},function(t){var n=i(this),o=s(t),a=e(r,n,o);if(a.done)return a.value;var c=n.lastIndex;u(c,0)||(n.lastIndex=0);var l=f(n,o);return u(n.lastIndex,c)||(n.lastIndex=c),null===l?-1:l.index}]}))},48319:(t,r,e)=>{"use strict";var n=e(53171),o=e(20266),i=e(65968),a=e(94954),u=e(48311),s=e(21176),c=e(58885),f=e(37942),l=e(36637),h=e(34237),p=e(83326),v=e(55300),g=e(69794),d=e(98115),y=e(63466),m=e(25650),b=e(24229),x=m.UNSUPPORTED_Y,w=4294967295,S=Math.min,R=[].push,A=i(/./.exec),E=i(R),O=i("".slice);a("split",(function(t,r,e){var i;return i="c"=="abbc".split(/(b)*/)[1]||4!="test".split(/(?:)/,-1).length||2!="ab".split(/(?:ab)*/).length||4!=".".split(/(.?)(.?)/).length||".".split(/()()/).length>1||"".split(/.?/).length?function(t,e){var i=p(c(this)),a=void 0===e?w:e>>>0;if(0===a)return[];if(void 0===t)return[i];if(!u(t))return o(r,i,t,a);for(var s,f,l,h=[],v=(t.ignoreCase?"i":"")+(t.multiline?"m":"")+(t.unicode?"u":"")+(t.sticky?"y":""),d=0,m=new RegExp(t.source,v+"g");(s=o(y,m,i))&&!((f=m.lastIndex)>d&&(E(h,O(i,d,s.index)),s.length>1&&s.index<i.length&&n(R,h,g(s,1)),l=s[0].length,d=f,h.length>=a));)m.lastIndex===s.index&&m.lastIndex++;return d===i.length?!l&&A(m,"")||E(h,""):E(h,O(i,d)),h.length>a?g(h,0,a):h}:"0".split(void 0,0).length?function(t,e){return void 0===t&&0===e?[]:o(r,this,t,e)}:r,[function(r,e){var n=c(this),a=null==r?void 0:v(r,t);return a?o(a,r,n,e):o(i,p(n),r,e)},function(t,n){var o=s(this),a=p(t),u=e(i,o,a,n,i!==r);if(u.done)return u.value;var c=f(o,RegExp),v=o.unicode,g=(o.ignoreCase?"i":"")+(o.multiline?"m":"")+(o.unicode?"u":"")+(x?"g":"y"),y=new c(x?"^(?:"+o.source+")":o,g),m=void 0===n?w:n>>>0;if(0===m)return[];if(0===a.length)return null===d(y,a)?[a]:[];for(var b=0,R=0,A=[];R<a.length;){y.lastIndex=x?0:R;var P,T=d(y,x?O(a,R):a);if(null===T||(P=S(h(y.lastIndex+(x?R:0)),a.length))===b)R=l(a,R,v);else{if(E(A,O(a,b,R)),A.length===m)return A;for(var I=1;I<=T.length-1;I++)if(E(A,T[I]),A.length===m)return A;R=b=P}}return E(A,O(a,b)),A}]}),!!b((function(){var t=/(?:)/,r=t.exec;t.exec=function(){return r.apply(this,arguments)};var e="ab".split(t);return 2!==e.length||"a"!==e[0]||"b"!==e[1]})),x)},44112:(t,r,e)=>{"use strict";var n,o=e(23103),i=e(65968),a=e(97933).f,u=e(34237),s=e(83326),c=e(47272),f=e(58885),l=e(48127),h=e(24231),p=i("".startsWith),v=i("".slice),g=Math.min,d=l("startsWith");o({target:"String",proto:!0,forced:!!(h||d||(n=a(String.prototype,"startsWith"),!n||n.writable))&&!d},{startsWith:function(t){var r=s(f(this));c(t);var e=u(g(arguments.length>1?arguments[1]:void 0,r.length)),n=s(t);return p?p(r,n,e):v(r,e,e+n.length)===n}})},18827:(t,r,e)=>{e(65625);var n=e(23103),o=e(61466);n({target:"String",proto:!0,name:"trimEnd",forced:"".trimEnd!==o},{trimEnd:o})},18763:(t,r,e)=>{var n=e(23103),o=e(58747);n({target:"String",proto:!0,name:"trimStart",forced:"".trimLeft!==o},{trimLeft:o})},65625:(t,r,e)=>{var n=e(23103),o=e(61466);n({target:"String",proto:!0,name:"trimEnd",forced:"".trimRight!==o},{trimRight:o})},41715:(t,r,e)=>{e(18763);var n=e(23103),o=e(58747);n({target:"String",proto:!0,name:"trimStart",forced:"".trimStart!==o},{trimStart:o})},45794:(t,r,e)=>{"use strict";var n=e(23103),o=e(1017).trim;n({target:"String",proto:!0,forced:e(9445)("trim")},{trim:function(){return o(this)}})},96882:(t,r,e)=>{e(38423)("asyncIterator")},634:(t,r,e)=>{"use strict";var n=e(23103),o=e(7400),i=e(9859),a=e(65968),u=e(98270),s=e(26733),c=e(91321),f=e(83326),l=e(31787).f,h=e(77081),p=i.Symbol,v=p&&p.prototype;if(o&&s(p)&&(!("description"in v)||void 0!==p().description)){var g={},d=function(){var t=arguments.length<1||void 0===arguments[0]?void 0:f(arguments[0]),r=c(v,this)?new p(t):void 0===t?p():p(t);return""===t&&(g[r]=!0),r};h(d,p),d.prototype=v,v.constructor=d;var y="Symbol(test)"==String(p("test")),m=a(v.toString),b=a(v.valueOf),x=/^Symbol\((.*)\)[^)]+$/,w=a("".replace),S=a("".slice);l(v,"description",{configurable:!0,get:function(){var t=b(this),r=m(t);if(u(g,t))return"";var e=y?S(r,7,-1):w(r,x,"$1");return""===e?void 0:e}}),n({global:!0,constructor:!0,forced:!0},{Symbol:d})}},64844:(t,r,e)=>{e(38423)("match")},40225:(t,r,e)=>{e(38423)("replace")},71686:(t,r,e)=>{e(38423)("search")},68223:(t,r,e)=>{e(38423)("split")},81382:(t,r,e)=>{e(42574)("Float32",(function(t){return function(r,e,n){return t(this,r,e,n)}}))},91982:(t,r,e)=>{e(42574)("Float64",(function(t){return function(r,e,n){return t(this,r,e,n)}}))},26618:(t,r,e)=>{"use strict";var n=e(48200);(0,e(9918).exportTypedArrayStaticMethod)("from",e(35215),n)},24074:(t,r,e)=>{e(42574)("Int16",(function(t){return function(r,e,n){return t(this,r,e,n)}}))},64696:(t,r,e)=>{e(42574)("Int32",(function(t){return function(r,e,n){return t(this,r,e,n)}}))},73229:(t,r,e)=>{e(42574)("Int8",(function(t){return function(r,e,n){return t(this,r,e,n)}}))},49527:(t,r,e)=>{"use strict";var n=e(9918),o=e(48200),i=n.aTypedArrayConstructor;(0,n.exportTypedArrayStaticMethod)("of",(function(){for(var t=0,r=arguments.length,e=new(i(this))(r);r>t;)e[t]=arguments[t++];return e}),o)},65688:(t,r,e)=>{"use strict";var n=e(9859),o=e(20266),i=e(9918),a=e(39646),u=e(84262),s=e(92991),c=e(24229),f=n.RangeError,l=n.Int8Array,h=l&&l.prototype,p=h&&h.set,v=i.aTypedArray,g=i.exportTypedArrayMethod,d=!c((function(){var t=new Uint8ClampedArray(2);return o(p,t,{length:1,0:3},1),3!==t[1]})),y=d&&i.NATIVE_ARRAY_BUFFER_VIEWS&&c((function(){var t=new l(2);return t.set(1),t.set("2",1),0!==t[0]||2!==t[1]}));g("set",(function(t){v(this);var r=u(arguments.length>1?arguments[1]:void 0,1),e=s(t);if(d)return o(p,this,e,r);var n=this.length,i=a(e),c=0;if(i+r>n)throw f("Wrong length");for(;c<i;)this[r+c]=e[c++]}),!d||y)},70315:(t,r,e)=>{"use strict";var n=e(9859),o=e(65968),i=e(24229),a=e(77111),u=e(33867),s=e(9918),c=e(22671),f=e(48506),l=e(6358),h=e(49811),p=s.aTypedArray,v=s.exportTypedArrayMethod,g=n.Uint16Array,d=g&&o(g.prototype.sort),y=!(!d||i((function(){d(new g(2),null)}))&&i((function(){d(new g(2),{})}))),m=!!d&&!i((function(){if(l)return l<74;if(c)return c<67;if(f)return!0;if(h)return h<602;var t,r,e=new g(516),n=Array(516);for(t=0;t<516;t++)r=t%4,e[t]=515-t,n[t]=t-2*r+3;for(d(e,(function(t,r){return(t/4|0)-(r/4|0)})),t=0;t<516;t++)if(e[t]!==n[t])return!0}));v("sort",(function(t){return void 0!==t&&a(t),m?d(this,t):u(p(this),function(t){return function(r,e){return void 0!==t?+t(r,e)||0:e!=e?-1:r!=r?1:0===r&&0===e?1/r>0&&1/e<0?1:-1:r>e}}(t))}),!m||y)},50556:(t,r,e)=>{"use strict";var n=e(9859),o=e(53171),i=e(9918),a=e(24229),u=e(1909),s=n.Int8Array,c=i.aTypedArray,f=i.exportTypedArrayMethod,l=[].toLocaleString,h=!!s&&a((function(){l.call(new s(1))}));f("toLocaleString",(function(){return o(l,h?u(c(this)):c(this),u(arguments))}),a((function(){return[1,2].toLocaleString()!=new s([1,2]).toLocaleString()}))||!a((function(){s.prototype.toLocaleString.call([1,2])})))},13161:(t,r,e)=>{e(42574)("Uint16",(function(t){return function(r,e,n){return t(this,r,e,n)}}))},90723:(t,r,e)=>{e(42574)("Uint32",(function(t){return function(r,e,n){return t(this,r,e,n)}}))},13675:(t,r,e)=>{e(42574)("Uint8",(function(t){return function(r,e,n){return t(this,r,e,n)}}))},36920:(t,r,e)=>{e(42574)("Uint8",(function(t){return function(r,e,n){return t(this,r,e,n)}}),!0)},78596:(t,r,e)=>{var n=e(23103),o=e(9859),i=e(55795).clear;n({global:!0,bind:!0,enumerable:!0,forced:o.clearImmediate!==i},{clearImmediate:i})},6886:(t,r,e)=>{var n=e(9859),o=e(95694),i=e(18865),a=e(15735),u=e(75762),s=e(70095),c=s("iterator"),f=s("toStringTag"),l=a.values,h=function(t,r){if(t){if(t[c]!==l)try{u(t,c,l)}catch(n){t[c]=l}if(t[f]||u(t,f,r),o[r])for(var e in a)if(t[e]!==a[e])try{u(t,e,a[e])}catch(n){t[e]=a[e]}}};for(var p in o)h(n[p]&&n[p].prototype,p);h(i,"DOMTokenList")},46106:(t,r,e)=>{e(78596),e(86471)},19866:(t,r,e)=>{var n=e(23103),o=e(9859),i=e(24794),a=e(77111),u=e(77579),s=e(28801),c=o.process;n({global:!0,enumerable:!0,noTargetGet:!0},{queueMicrotask:function(t){u(arguments.length,1),a(t);var r=s&&c.domain;i(r?r.bind(t):t)}})},86471:(t,r,e)=>{var n=e(23103),o=e(9859),i=e(55795).set;n({global:!0,bind:!0,enumerable:!0,forced:o.setImmediate!==i},{setImmediate:i})},62653:(t,r,e)=>{"use strict";e(15735);var n=e(23103),o=e(9859),i=e(20266),a=e(65968),u=e(7400),s=e(77274),c=e(14768),f=e(8312),l=e(54555),h=e(93723),p=e(56407),v=e(57728),g=e(26733),d=e(98270),y=e(97636),m=e(81589),b=e(21176),x=e(85052),w=e(83326),S=e(22391),R=e(65358),A=e(28403),E=e(78830),O=e(77579),P=e(70095),T=e(33867),I=P("iterator"),L="URLSearchParams",U="URLSearchParamsIterator",j=p.set,k=p.getterFor(L),_=p.getterFor(U),C=Object.getOwnPropertyDescriptor,M=function(t){if(!u)return o[t];var r=C(o,t);return r&&r.value},N=M("fetch"),F=M("Request"),B=M("Headers"),D=F&&F.prototype,q=B&&B.prototype,H=o.RegExp,G=o.TypeError,V=o.decodeURIComponent,W=o.encodeURIComponent,Y=a("".charAt),$=a([].join),z=a([].push),K=a("".replace),J=a([].shift),Q=a([].splice),X=a("".split),Z=a("".slice),tt=/\+/g,rt=Array(4),et=function(t){return rt[t-1]||(rt[t-1]=H("((?:%[\\da-f]{2}){"+t+"})","gi"))},nt=function(t){try{return V(t)}catch(r){return t}},ot=function(t){var r=K(t,tt," "),e=4;try{return V(r)}catch(n){for(;e;)r=K(r,et(e--),nt);return r}},it=/[!'()~]|%20/g,at={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+"},ut=function(t){return at[t]},st=function(t){return K(W(t),it,ut)},ct=h((function(t,r){j(this,{type:U,iterator:A(k(t).entries),kind:r})}),"Iterator",(function(){var t=_(this),r=t.kind,e=t.iterator.next(),n=e.value;return e.done||(e.value="keys"===r?n.key:"values"===r?n.value:[n.key,n.value]),e}),!0),ft=function(t){this.entries=[],this.url=null,void 0!==t&&(x(t)?this.parseObject(t):this.parseQuery("string"==typeof t?"?"===Y(t,0)?Z(t,1):t:w(t)))};ft.prototype={type:L,bindURL:function(t){this.url=t,this.update()},parseObject:function(t){var r,e,n,o,a,u,s,c=E(t);if(c)for(e=(r=A(t,c)).next;!(n=i(e,r)).done;){if(a=(o=A(b(n.value))).next,(u=i(a,o)).done||(s=i(a,o)).done||!i(a,o).done)throw G("Expected sequence with length 2");z(this.entries,{key:w(u.value),value:w(s.value)})}else for(var f in t)d(t,f)&&z(this.entries,{key:f,value:w(t[f])})},parseQuery:function(t){if(t)for(var r,e,n=X(t,"&"),o=0;o<n.length;)(r=n[o++]).length&&(e=X(r,"="),z(this.entries,{key:ot(J(e)),value:ot($(e,"="))}))},serialize:function(){for(var t,r=this.entries,e=[],n=0;n<r.length;)t=r[n++],z(e,st(t.key)+"="+st(t.value));return $(e,"&")},update:function(){this.entries.length=0,this.parseQuery(this.url.query)},updateURL:function(){this.url&&this.url.update()}};var lt=function(){v(this,ht);var t=arguments.length>0?arguments[0]:void 0;j(this,new ft(t))},ht=lt.prototype;if(f(ht,{append:function(t,r){O(arguments.length,2);var e=k(this);z(e.entries,{key:w(t),value:w(r)}),e.updateURL()},delete:function(t){O(arguments.length,1);for(var r=k(this),e=r.entries,n=w(t),o=0;o<e.length;)e[o].key===n?Q(e,o,1):o++;r.updateURL()},get:function(t){O(arguments.length,1);for(var r=k(this).entries,e=w(t),n=0;n<r.length;n++)if(r[n].key===e)return r[n].value;return null},getAll:function(t){O(arguments.length,1);for(var r=k(this).entries,e=w(t),n=[],o=0;o<r.length;o++)r[o].key===e&&z(n,r[o].value);return n},has:function(t){O(arguments.length,1);for(var r=k(this).entries,e=w(t),n=0;n<r.length;)if(r[n++].key===e)return!0;return!1},set:function(t,r){O(arguments.length,1);for(var e,n=k(this),o=n.entries,i=!1,a=w(t),u=w(r),s=0;s<o.length;s++)(e=o[s]).key===a&&(i?Q(o,s--,1):(i=!0,e.value=u));i||z(o,{key:a,value:u}),n.updateURL()},sort:function(){var t=k(this);T(t.entries,(function(t,r){return t.key>r.key?1:-1})),t.updateURL()},forEach:function(t){for(var r,e=k(this).entries,n=y(t,arguments.length>1?arguments[1]:void 0),o=0;o<e.length;)n((r=e[o++]).value,r.key,this)},keys:function(){return new ct(this,"keys")},values:function(){return new ct(this,"values")},entries:function(){return new ct(this,"entries")}},{enumerable:!0}),c(ht,I,ht.entries,{name:"entries"}),c(ht,"toString",(function(){return k(this).serialize()}),{enumerable:!0}),l(lt,L),n({global:!0,constructor:!0,forced:!s},{URLSearchParams:lt}),!s&&g(B)){var pt=a(q.has),vt=a(q.set),gt=function(t){if(x(t)){var r,e=t.body;if(m(e)===L)return r=t.headers?new B(t.headers):new B,pt(r,"content-type")||vt(r,"content-type","application/x-www-form-urlencoded;charset=UTF-8"),S(t,{body:R(0,w(e)),headers:R(0,r)})}return t};if(g(N)&&n({global:!0,enumerable:!0,noTargetGet:!0,forced:!0},{fetch:function(t){return N(t,arguments.length>1?gt(arguments[1]):{})}}),g(F)){var dt=function(t){return v(this,D),new F(t,arguments.length>1?gt(arguments[1]):{})};D.constructor=dt,dt.prototype=D,n({global:!0,constructor:!0,noTargetGet:!0,forced:!0},{Request:dt})}}t.exports={URLSearchParams:lt,getState:k}},60523:(t,r,e)=>{e(62653)},95340:(t,r,e)=>{"use strict";e(28673);var n,o=e(23103),i=e(7400),a=e(77274),u=e(9859),s=e(97636),c=e(65968),f=e(14768),l=e(96616),h=e(57728),p=e(98270),v=e(47),g=e(10507),d=e(69794),y=e(30966).codeAt,m=e(77321),b=e(83326),x=e(54555),w=e(77579),S=e(62653),R=e(56407),A=R.set,E=R.getterFor("URL"),O=S.URLSearchParams,P=S.getState,T=u.URL,I=u.TypeError,L=u.parseInt,U=Math.floor,j=Math.pow,k=c("".charAt),_=c(/./.exec),C=c([].join),M=c(1..toString),N=c([].pop),F=c([].push),B=c("".replace),D=c([].shift),q=c("".split),H=c("".slice),G=c("".toLowerCase),V=c([].unshift),W="Invalid scheme",Y="Invalid host",$="Invalid port",z=/[a-z]/i,K=/[\d+-.a-z]/i,J=/\d/,Q=/^0x/i,X=/^[0-7]+$/,Z=/^\d+$/,tt=/^[\da-f]+$/i,rt=/[\0\t\n\r #%/:<>?@[\\\]^|]/,et=/[\0\t\n\r #/:<>?@[\\\]^|]/,nt=/^[\u0000-\u0020]+|[\u0000-\u0020]+$/g,ot=/[\t\n\r]/g,it=function(t){var r,e,n,o;if("number"==typeof t){for(r=[],e=0;e<4;e++)V(r,t%256),t=U(t/256);return C(r,".")}if("object"==typeof t){for(r="",n=function(t){for(var r=null,e=1,n=null,o=0,i=0;i<8;i++)0!==t[i]?(o>e&&(r=n,e=o),n=null,o=0):(null===n&&(n=i),++o);return o>e&&(r=n,e=o),r}(t),e=0;e<8;e++)o&&0===t[e]||(o&&(o=!1),n===e?(r+=e?":":"::",o=!0):(r+=M(t[e],16),e<7&&(r+=":")));return"["+r+"]"}return t},at={},ut=v({},at,{" ":1,'"':1,"<":1,">":1,"`":1}),st=v({},ut,{"#":1,"?":1,"{":1,"}":1}),ct=v({},st,{"/":1,":":1,";":1,"=":1,"@":1,"[":1,"\\":1,"]":1,"^":1,"|":1}),ft=function(t,r){var e=y(t,0);return e>32&&e<127&&!p(r,t)?t:encodeURIComponent(t)},lt={ftp:21,file:null,http:80,https:443,ws:80,wss:443},ht=function(t,r){var e;return 2==t.length&&_(z,k(t,0))&&(":"==(e=k(t,1))||!r&&"|"==e)},pt=function(t){var r;return t.length>1&&ht(H(t,0,2))&&(2==t.length||"/"===(r=k(t,2))||"\\"===r||"?"===r||"#"===r)},vt=function(t){return"."===t||"%2e"===G(t)},gt={},dt={},yt={},mt={},bt={},xt={},wt={},St={},Rt={},At={},Et={},Ot={},Pt={},Tt={},It={},Lt={},Ut={},jt={},kt={},_t={},Ct={},Mt=function(t,r,e){var n,o,i,a=b(t);if(r){if(o=this.parse(a))throw I(o);this.searchParams=null}else{if(void 0!==e&&(n=new Mt(e,!0)),o=this.parse(a,null,n))throw I(o);(i=P(new O)).bindURL(this),this.searchParams=i}};Mt.prototype={type:"URL",parse:function(t,r,e){var o,i,a,u,s,c=this,f=r||gt,l=0,h="",v=!1,y=!1,m=!1;for(t=b(t),r||(c.scheme="",c.username="",c.password="",c.host=null,c.port=null,c.path=[],c.query=null,c.fragment=null,c.cannotBeABaseURL=!1,t=B(t,nt,"")),t=B(t,ot,""),o=g(t);l<=o.length;){switch(i=o[l],f){case gt:if(!i||!_(z,i)){if(r)return W;f=yt;continue}h+=G(i),f=dt;break;case dt:if(i&&(_(K,i)||"+"==i||"-"==i||"."==i))h+=G(i);else{if(":"!=i){if(r)return W;h="",f=yt,l=0;continue}if(r&&(c.isSpecial()!=p(lt,h)||"file"==h&&(c.includesCredentials()||null!==c.port)||"file"==c.scheme&&!c.host))return;if(c.scheme=h,r)return void(c.isSpecial()&&lt[c.scheme]==c.port&&(c.port=null));h="","file"==c.scheme?f=Tt:c.isSpecial()&&e&&e.scheme==c.scheme?f=mt:c.isSpecial()?f=St:"/"==o[l+1]?(f=bt,l++):(c.cannotBeABaseURL=!0,F(c.path,""),f=kt)}break;case yt:if(!e||e.cannotBeABaseURL&&"#"!=i)return W;if(e.cannotBeABaseURL&&"#"==i){c.scheme=e.scheme,c.path=d(e.path),c.query=e.query,c.fragment="",c.cannotBeABaseURL=!0,f=Ct;break}f="file"==e.scheme?Tt:xt;continue;case mt:if("/"!=i||"/"!=o[l+1]){f=xt;continue}f=Rt,l++;break;case bt:if("/"==i){f=At;break}f=jt;continue;case xt:if(c.scheme=e.scheme,i==n)c.username=e.username,c.password=e.password,c.host=e.host,c.port=e.port,c.path=d(e.path),c.query=e.query;else if("/"==i||"\\"==i&&c.isSpecial())f=wt;else if("?"==i)c.username=e.username,c.password=e.password,c.host=e.host,c.port=e.port,c.path=d(e.path),c.query="",f=_t;else{if("#"!=i){c.username=e.username,c.password=e.password,c.host=e.host,c.port=e.port,c.path=d(e.path),c.path.length--,f=jt;continue}c.username=e.username,c.password=e.password,c.host=e.host,c.port=e.port,c.path=d(e.path),c.query=e.query,c.fragment="",f=Ct}break;case wt:if(!c.isSpecial()||"/"!=i&&"\\"!=i){if("/"!=i){c.username=e.username,c.password=e.password,c.host=e.host,c.port=e.port,f=jt;continue}f=At}else f=Rt;break;case St:if(f=Rt,"/"!=i||"/"!=k(h,l+1))continue;l++;break;case Rt:if("/"!=i&&"\\"!=i){f=At;continue}break;case At:if("@"==i){v&&(h="%40"+h),v=!0,a=g(h);for(var x=0;x<a.length;x++){var w=a[x];if(":"!=w||m){var S=ft(w,ct);m?c.password+=S:c.username+=S}else m=!0}h=""}else if(i==n||"/"==i||"?"==i||"#"==i||"\\"==i&&c.isSpecial()){if(v&&""==h)return"Invalid authority";l-=g(h).length+1,h="",f=Et}else h+=i;break;case Et:case Ot:if(r&&"file"==c.scheme){f=Lt;continue}if(":"!=i||y){if(i==n||"/"==i||"?"==i||"#"==i||"\\"==i&&c.isSpecial()){if(c.isSpecial()&&""==h)return Y;if(r&&""==h&&(c.includesCredentials()||null!==c.port))return;if(u=c.parseHost(h))return u;if(h="",f=Ut,r)return;continue}"["==i?y=!0:"]"==i&&(y=!1),h+=i}else{if(""==h)return Y;if(u=c.parseHost(h))return u;if(h="",f=Pt,r==Ot)return}break;case Pt:if(!_(J,i)){if(i==n||"/"==i||"?"==i||"#"==i||"\\"==i&&c.isSpecial()||r){if(""!=h){var R=L(h,10);if(R>65535)return $;c.port=c.isSpecial()&&R===lt[c.scheme]?null:R,h=""}if(r)return;f=Ut;continue}return $}h+=i;break;case Tt:if(c.scheme="file","/"==i||"\\"==i)f=It;else{if(!e||"file"!=e.scheme){f=jt;continue}if(i==n)c.host=e.host,c.path=d(e.path),c.query=e.query;else if("?"==i)c.host=e.host,c.path=d(e.path),c.query="",f=_t;else{if("#"!=i){pt(C(d(o,l),""))||(c.host=e.host,c.path=d(e.path),c.shortenPath()),f=jt;continue}c.host=e.host,c.path=d(e.path),c.query=e.query,c.fragment="",f=Ct}}break;case It:if("/"==i||"\\"==i){f=Lt;break}e&&"file"==e.scheme&&!pt(C(d(o,l),""))&&(ht(e.path[0],!0)?F(c.path,e.path[0]):c.host=e.host),f=jt;continue;case Lt:if(i==n||"/"==i||"\\"==i||"?"==i||"#"==i){if(!r&&ht(h))f=jt;else if(""==h){if(c.host="",r)return;f=Ut}else{if(u=c.parseHost(h))return u;if("localhost"==c.host&&(c.host=""),r)return;h="",f=Ut}continue}h+=i;break;case Ut:if(c.isSpecial()){if(f=jt,"/"!=i&&"\\"!=i)continue}else if(r||"?"!=i)if(r||"#"!=i){if(i!=n&&(f=jt,"/"!=i))continue}else c.fragment="",f=Ct;else c.query="",f=_t;break;case jt:if(i==n||"/"==i||"\\"==i&&c.isSpecial()||!r&&("?"==i||"#"==i)){if(".."===(s=G(s=h))||"%2e."===s||".%2e"===s||"%2e%2e"===s?(c.shortenPath(),"/"==i||"\\"==i&&c.isSpecial()||F(c.path,"")):vt(h)?"/"==i||"\\"==i&&c.isSpecial()||F(c.path,""):("file"==c.scheme&&!c.path.length&&ht(h)&&(c.host&&(c.host=""),h=k(h,0)+":"),F(c.path,h)),h="","file"==c.scheme&&(i==n||"?"==i||"#"==i))for(;c.path.length>1&&""===c.path[0];)D(c.path);"?"==i?(c.query="",f=_t):"#"==i&&(c.fragment="",f=Ct)}else h+=ft(i,st);break;case kt:"?"==i?(c.query="",f=_t):"#"==i?(c.fragment="",f=Ct):i!=n&&(c.path[0]+=ft(i,at));break;case _t:r||"#"!=i?i!=n&&("'"==i&&c.isSpecial()?c.query+="%27":c.query+="#"==i?"%23":ft(i,at)):(c.fragment="",f=Ct);break;case Ct:i!=n&&(c.fragment+=ft(i,ut))}l++}},parseHost:function(t){var r,e,n;if("["==k(t,0)){if("]"!=k(t,t.length-1))return Y;if(r=function(t){var r,e,n,o,i,a,u,s=[0,0,0,0,0,0,0,0],c=0,f=null,l=0,h=function(){return k(t,l)};if(":"==h()){if(":"!=k(t,1))return;l+=2,f=++c}for(;h();){if(8==c)return;if(":"!=h()){for(r=e=0;e<4&&_(tt,h());)r=16*r+L(h(),16),l++,e++;if("."==h()){if(0==e)return;if(l-=e,c>6)return;for(n=0;h();){if(o=null,n>0){if(!("."==h()&&n<4))return;l++}if(!_(J,h()))return;for(;_(J,h());){if(i=L(h(),10),null===o)o=i;else{if(0==o)return;o=10*o+i}if(o>255)return;l++}s[c]=256*s[c]+o,2!=++n&&4!=n||c++}if(4!=n)return;break}if(":"==h()){if(l++,!h())return}else if(h())return;s[c++]=r}else{if(null!==f)return;l++,f=++c}}if(null!==f)for(a=c-f,c=7;0!=c&&a>0;)u=s[c],s[c--]=s[f+a-1],s[f+--a]=u;else if(8!=c)return;return s}(H(t,1,-1)),!r)return Y;this.host=r}else if(this.isSpecial()){if(t=m(t),_(rt,t))return Y;if(r=function(t){var r,e,n,o,i,a,u,s=q(t,".");if(s.length&&""==s[s.length-1]&&s.length--,(r=s.length)>4)return t;for(e=[],n=0;n<r;n++){if(""==(o=s[n]))return t;if(i=10,o.length>1&&"0"==k(o,0)&&(i=_(Q,o)?16:8,o=H(o,8==i?1:2)),""===o)a=0;else{if(!_(10==i?Z:8==i?X:tt,o))return t;a=L(o,i)}F(e,a)}for(n=0;n<r;n++)if(a=e[n],n==r-1){if(a>=j(256,5-r))return null}else if(a>255)return null;for(u=N(e),n=0;n<e.length;n++)u+=e[n]*j(256,3-n);return u}(t),null===r)return Y;this.host=r}else{if(_(et,t))return Y;for(r="",e=g(t),n=0;n<e.length;n++)r+=ft(e[n],at);this.host=r}},cannotHaveUsernamePasswordPort:function(){return!this.host||this.cannotBeABaseURL||"file"==this.scheme},includesCredentials:function(){return""!=this.username||""!=this.password},isSpecial:function(){return p(lt,this.scheme)},shortenPath:function(){var t=this.path,r=t.length;!r||"file"==this.scheme&&1==r&&ht(t[0],!0)||t.length--},serialize:function(){var t=this,r=t.scheme,e=t.username,n=t.password,o=t.host,i=t.port,a=t.path,u=t.query,s=t.fragment,c=r+":";return null!==o?(c+="//",t.includesCredentials()&&(c+=e+(n?":"+n:"")+"@"),c+=it(o),null!==i&&(c+=":"+i)):"file"==r&&(c+="//"),c+=t.cannotBeABaseURL?a[0]:a.length?"/"+C(a,"/"):"",null!==u&&(c+="?"+u),null!==s&&(c+="#"+s),c},setHref:function(t){var r=this.parse(t);if(r)throw I(r);this.searchParams.update()},getOrigin:function(){var t=this.scheme,r=this.port;if("blob"==t)try{return new Nt(t.path[0]).origin}catch(e){return"null"}return"file"!=t&&this.isSpecial()?t+"://"+it(this.host)+(null!==r?":"+r:""):"null"},getProtocol:function(){return this.scheme+":"},setProtocol:function(t){this.parse(b(t)+":",gt)},getUsername:function(){return this.username},setUsername:function(t){var r=g(b(t));if(!this.cannotHaveUsernamePasswordPort()){this.username="";for(var e=0;e<r.length;e++)this.username+=ft(r[e],ct)}},getPassword:function(){return this.password},setPassword:function(t){var r=g(b(t));if(!this.cannotHaveUsernamePasswordPort()){this.password="";for(var e=0;e<r.length;e++)this.password+=ft(r[e],ct)}},getHost:function(){var t=this.host,r=this.port;return null===t?"":null===r?it(t):it(t)+":"+r},setHost:function(t){this.cannotBeABaseURL||this.parse(t,Et)},getHostname:function(){var t=this.host;return null===t?"":it(t)},setHostname:function(t){this.cannotBeABaseURL||this.parse(t,Ot)},getPort:function(){var t=this.port;return null===t?"":b(t)},setPort:function(t){this.cannotHaveUsernamePasswordPort()||(""==(t=b(t))?this.port=null:this.parse(t,Pt))},getPathname:function(){var t=this.path;return this.cannotBeABaseURL?t[0]:t.length?"/"+C(t,"/"):""},setPathname:function(t){this.cannotBeABaseURL||(this.path=[],this.parse(t,Ut))},getSearch:function(){var t=this.query;return t?"?"+t:""},setSearch:function(t){""==(t=b(t))?this.query=null:("?"==k(t,0)&&(t=H(t,1)),this.query="",this.parse(t,_t)),this.searchParams.update()},getSearchParams:function(){return this.searchParams.facade},getHash:function(){var t=this.fragment;return t?"#"+t:""},setHash:function(t){""!=(t=b(t))?("#"==k(t,0)&&(t=H(t,1)),this.fragment="",this.parse(t,Ct)):this.fragment=null},update:function(){this.query=this.searchParams.serialize()||null}};var Nt=function(t){var r=h(this,Ft),e=w(arguments.length,1)>1?arguments[1]:void 0,n=A(r,new Mt(t,!1,e));i||(r.href=n.serialize(),r.origin=n.getOrigin(),r.protocol=n.getProtocol(),r.username=n.getUsername(),r.password=n.getPassword(),r.host=n.getHost(),r.hostname=n.getHostname(),r.port=n.getPort(),r.pathname=n.getPathname(),r.search=n.getSearch(),r.searchParams=n.getSearchParams(),r.hash=n.getHash())},Ft=Nt.prototype,Bt=function(t,r){return{get:function(){return E(this)[t]()},set:r&&function(t){return E(this)[r](t)},configurable:!0,enumerable:!0}};if(i&&(l(Ft,"href",Bt("serialize","setHref")),l(Ft,"origin",Bt("getOrigin")),l(Ft,"protocol",Bt("getProtocol","setProtocol")),l(Ft,"username",Bt("getUsername","setUsername")),l(Ft,"password",Bt("getPassword","setPassword")),l(Ft,"host",Bt("getHost","setHost")),l(Ft,"hostname",Bt("getHostname","setHostname")),l(Ft,"port",Bt("getPort","setPort")),l(Ft,"pathname",Bt("getPathname","setPathname")),l(Ft,"search",Bt("getSearch","setSearch")),l(Ft,"searchParams",Bt("getSearchParams")),l(Ft,"hash",Bt("getHash","setHash"))),f(Ft,"toJSON",(function(){return E(this).serialize()}),{enumerable:!0}),f(Ft,"toString",(function(){return E(this).serialize()}),{enumerable:!0}),T){var Dt=T.createObjectURL,qt=T.revokeObjectURL;Dt&&f(Nt,"createObjectURL",s(Dt,T)),qt&&f(Nt,"revokeObjectURL",s(qt,T))}x(Nt,"URL"),o({global:!0,constructor:!0,forced:!a,sham:!i},{URL:Nt})},14121:(t,r,e)=>{e(95340)},85371:(t,r,e)=>{"use strict";var n=e(23103),o=e(20266);n({target:"URL",proto:!0,enumerable:!0},{toJSON:function(){return o(URL.prototype.toString,this)}})}},t=>{var r=r=>t(t.s=r);r(71884),r(65125)}]);/*! For license information please see main.esm.js.LICENSE.txt */
(self.webpackChunk=self.webpackChunk||[]).push([[179],{90520:(e,t)=>{"use strict";const r="undefined"!=typeof BigUint64Array,n=Symbol(),i=1024;function o(e,t){const r=new Uint32Array(e),n=new Uint16Array(e);var o=r[t+-4>>>2]>>>1,s=t>>>1;if(o<=i)return String.fromCharCode.apply(String,n.subarray(s,s+o));const a=[];do{const e=n[s+i-1],t=e>=55296&&e<56320?1023:i;a.push(String.fromCharCode.apply(String,n.subarray(s,s+=t))),o-=t}while(o>i);return a.join("")+String.fromCharCode.apply(String,n.subarray(s,s+o))}function s(e){const t={};function r(e,t){return e?o(e.buffer,t):"<yet unknown>"}const n=e.env=e.env||{};return n.abort=n.abort||function(e,i,o,s){const a=t.memory||n.memory;throw Error("abort: "+r(a,e)+" at "+r(a,i)+":"+o+":"+s)},n.trace=n.trace||function(e,i){const o=t.memory||n.memory;console.log("trace: "+r(o,e)+(i?" ":"")+Array.prototype.slice.call(arguments,2,2+i).join(", "))},e.Math=e.Math||Math,e.Date=e.Date||Date,t}function a(e,t){const n=t.exports,i=n.memory,s=n.table,a=n.__alloc,c=n.__retain,u=n.__rtti_base||-1;function l(e){const t=new Uint32Array(i.buffer);if((e>>>=0)>=t[u>>>2])throw Error("invalid id: "+e);return t[(u+4>>>2)+2*e]}function d(e){const t=new Uint32Array(i.buffer);if((e>>>=0)>=t[u>>>2])throw Error("invalid id: "+e);return t[(u+4>>>2)+2*e+1]}function f(e){return 31-Math.clz32(e>>>5&31)}function p(e,t,r){const n=i.buffer;if(r)switch(e){case 2:return new Float32Array(n);case 3:return new Float64Array(n)}else switch(e){case 0:return new(t?Int8Array:Uint8Array)(n);case 1:return new(t?Int16Array:Uint16Array)(n);case 2:return new(t?Int32Array:Uint32Array)(n);case 3:return new(t?BigInt64Array:BigUint64Array)(n)}throw Error("unsupported align: "+e)}function m(e){const t=new Uint32Array(i.buffer),r=t[e+-8>>>2],n=l(r);if(!(1&n))throw Error("not an array: "+r);const o=f(n);var s=t[e+4>>>2];const a=2&n?t[e+12>>>2]:t[s+-4>>>2]>>>o;return p(o,1024&n,2048&n).subarray(s>>>=o,s+a)}function g(e,t,r){return new e(y(e,t,r))}function y(e,t,r){const n=i.buffer,o=new Uint32Array(n),s=o[r+4>>>2];return new e(n,s,o[s+-4>>>2]>>>t)}return e.__allocString=function(e){const t=e.length,r=a(t<<1,1),n=new Uint16Array(i.buffer);for(var o=0,s=r>>>1;o<t;++o)n[s+o]=e.charCodeAt(o);return r},e.__getString=function(e){const t=i.buffer;if(1!==new Uint32Array(t)[e+-8>>>2])throw Error("not a string: "+e);return o(t,e)},e.__allocArray=function(e,t){const r=l(e);if(!(3&r))throw Error("not an array: "+e+" @ "+r);const n=f(r),o=t.length,s=a(o<<n,0),u=a(2&r?16:12,e),h=new Uint32Array(i.buffer);h[u+0>>>2]=c(s),h[u+4>>>2]=s,h[u+8>>>2]=o<<n,2&r&&(h[u+12>>>2]=o);const d=p(n,1024&r,2048&r);if(8192&r)for(let i=0;i<o;++i)d[(s>>>n)+i]=c(t[i]);else d.set(t,s>>>n);return u},e.__getArrayView=m,e.__getArray=function(e){const t=m(e),r=t.length,n=new Array(r);for(let i=0;i<r;i++)n[i]=t[i];return n},e.__getArrayBuffer=function(e){const t=i.buffer,r=new Uint32Array(t)[e+-4>>>2];return t.slice(e,e+r)},e.__getInt8Array=g.bind(null,Int8Array,0),e.__getInt8ArrayView=y.bind(null,Int8Array,0),e.__getUint8Array=g.bind(null,Uint8Array,0),e.__getUint8ArrayView=y.bind(null,Uint8Array,0),e.__getUint8ClampedArray=g.bind(null,Uint8ClampedArray,0),e.__getUint8ClampedArrayView=y.bind(null,Uint8ClampedArray,0),e.__getInt16Array=g.bind(null,Int16Array,1),e.__getInt16ArrayView=y.bind(null,Int16Array,1),e.__getUint16Array=g.bind(null,Uint16Array,1),e.__getUint16ArrayView=y.bind(null,Uint16Array,1),e.__getInt32Array=g.bind(null,Int32Array,2),e.__getInt32ArrayView=y.bind(null,Int32Array,2),e.__getUint32Array=g.bind(null,Uint32Array,2),e.__getUint32ArrayView=y.bind(null,Uint32Array,2),r&&(e.__getInt64Array=g.bind(null,BigInt64Array,3),e.__getInt64ArrayView=y.bind(null,BigInt64Array,3),e.__getUint64Array=g.bind(null,BigUint64Array,3),e.__getUint64ArrayView=y.bind(null,BigUint64Array,3)),e.__getFloat32Array=g.bind(null,Float32Array,2),e.__getFloat32ArrayView=y.bind(null,Float32Array,2),e.__getFloat64Array=g.bind(null,Float64Array,3),e.__getFloat64ArrayView=y.bind(null,Float64Array,3),e.__instanceof=function(e,t){const r=new Uint32Array(i.buffer);var n=r[e+-8>>>2];if(n<=r[u>>>2])do{if(n==t)return!0}while(n=d(n));return!1},e.memory=e.memory||i,e.table=e.table||s,h(n,e)}function c(e){return"undefined"!=typeof Response&&e instanceof Response}async function u(e,t){return c(e=await e)?l(e,t):a(s(t||(t={})),await WebAssembly.instantiate(e instanceof WebAssembly.Module?e:await WebAssembly.compile(e),t))}async function l(e,t){return WebAssembly.instantiateStreaming?a(s(t||(t={})),(await WebAssembly.instantiateStreaming(e,t)).instance):u(c(e=await e)?e.arrayBuffer():e,t)}function h(e,t){var r=t?Object.create(t):{},i=e.__argumentsLength?function(t){e.__argumentsLength.value=t}:e.__setArgumentsLength||e.__setargc||function(){};for(let o in e){if(!Object.prototype.hasOwnProperty.call(e,o))continue;const t=e[o];let s=o.split("."),a=r;for(;s.length>1;){let e=s.shift();Object.prototype.hasOwnProperty.call(a,e)||(a[e]={}),a=a[e]}let c=s[0],u=c.indexOf("#");if(u>=0){let r=c.substring(0,u),s=a[r];if(void 0===s||!s.prototype){let e=function(...t){return e.wrap(e.prototype.constructor(0,...t))};e.prototype={valueOf:function(){return this[n]}},e.wrap=function(t){return Object.create(e.prototype,{[n]:{value:t,writable:!1}})},s&&Object.getOwnPropertyNames(s).forEach((t=>Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(s,t)))),a[r]=e}if(c=c.substring(u+1),a=a[r].prototype,/^(get|set):/.test(c)){if(!Object.prototype.hasOwnProperty.call(a,c=c.substring(4))){let t=e[o.replace("set:","get:")],r=e[o.replace("get:","set:")];Object.defineProperty(a,c,{get:function(){return t(this[n])},set:function(e){r(this[n],e)},enumerable:!0})}}else"constructor"===c?(a[c]=(...e)=>(i(e.length),t(...e))).original=t:(a[c]=function(...e){return i(e.length),t(this[n],...e)}).original=t}else/^(get|set):/.test(c)?Object.prototype.hasOwnProperty.call(a,c=c.substring(4))||Object.defineProperty(a,c,{get:e[o.replace("set:","get:")],set:e[o.replace("get:","set:")],enumerable:!0}):"function"==typeof t&&t!==i?(a[c]=(...e)=>(i(e.length),t(...e))).original=t:a[c]=t}return r}t.instantiate=u,t.instantiateSync=function(e,t){return a(s(t||(t={})),new WebAssembly.Instance(e instanceof WebAssembly.Module?e:new WebAssembly.Module(e),t))},t.instantiateStreaming=l,t.demangle=h},38111:e=>{e.exports=function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e},e.exports.__esModule=!0,e.exports.default=e.exports},52954:e=>{function t(e,t,r,n,i,o,s){try{var a=e[o](s),c=a.value}catch(u){return void r(u)}a.done?t(c):Promise.resolve(c).then(n,i)}e.exports=function(e){return function(){var r=this,n=arguments;return new Promise((function(i,o){var s=e.apply(r,n);function a(e){t(s,i,o,a,c,"next",e)}function c(e){t(s,i,o,a,c,"throw",e)}a(void 0)}))}},e.exports.__esModule=!0,e.exports.default=e.exports},50085:e=>{e.exports=function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")},e.exports.__esModule=!0,e.exports.default=e.exports},15198:e=>{function t(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}e.exports=function(e,r,n){return r&&t(e.prototype,r),n&&t(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e},e.exports.__esModule=!0,e.exports.default=e.exports},2588:e=>{function t(r){return e.exports=t=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},e.exports.__esModule=!0,e.exports.default=e.exports,t(r)}e.exports=t,e.exports.__esModule=!0,e.exports.default=e.exports},60270:(e,t,r)=>{var n=r(40742);e.exports=function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&n(e,t)},e.exports.__esModule=!0,e.exports.default=e.exports},14859:e=>{e.exports=function(e){return e&&e.__esModule?e:{default:e}},e.exports.__esModule=!0,e.exports.default=e.exports},36983:(e,t,r)=>{var n=r(58921).default,i=r(38111);e.exports=function(e,t){if(t&&("object"===n(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return i(e)},e.exports.__esModule=!0,e.exports.default=e.exports},40742:e=>{function t(r,n){return e.exports=t=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},e.exports.__esModule=!0,e.exports.default=e.exports,t(r,n)}e.exports=t,e.exports.__esModule=!0,e.exports.default=e.exports},58921:e=>{function t(r){return e.exports=t="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},e.exports.__esModule=!0,e.exports.default=e.exports,t(r)}e.exports=t,e.exports.__esModule=!0,e.exports.default=e.exports},77162:(e,t,r)=>{e.exports=r(25047)},54269:function(e,t,r){!function(e,t){"use strict";function n(e,t){if(!e)throw new Error(t||"Assertion failed")}function i(e,t){e.super_=t;var r=function(){};r.prototype=t.prototype,e.prototype=new r,e.prototype.constructor=e}function o(e,t,r){if(o.isBN(e))return e;this.negative=0,this.words=null,this.length=0,this.red=null,null!==e&&("le"!==t&&"be"!==t||(r=t,t=10),this._init(e||0,t||10,r||"be"))}var s;"object"==typeof e?e.exports=o:t.BN=o,o.BN=o,o.wordSize=26;try{s="undefined"!=typeof window&&void 0!==window.Buffer?window.Buffer:r(29005).Buffer}catch(A){}function a(e,t){var r=e.charCodeAt(t);return r>=65&&r<=70?r-55:r>=97&&r<=102?r-87:r-48&15}function c(e,t,r){var n=a(e,r);return r-1>=t&&(n|=a(e,r-1)<<4),n}function u(e,t,r,n){for(var i=0,o=Math.min(e.length,r),s=t;s<o;s++){var a=e.charCodeAt(s)-48;i*=n,i+=a>=49?a-49+10:a>=17?a-17+10:a}return i}o.isBN=function(e){return e instanceof o||null!==e&&"object"==typeof e&&e.constructor.wordSize===o.wordSize&&Array.isArray(e.words)},o.max=function(e,t){return e.cmp(t)>0?e:t},o.min=function(e,t){return e.cmp(t)<0?e:t},o.prototype._init=function(e,t,r){if("number"==typeof e)return this._initNumber(e,t,r);if("object"==typeof e)return this._initArray(e,t,r);"hex"===t&&(t=16),n(t===(0|t)&&t>=2&&t<=36);var i=0;"-"===(e=e.toString().replace(/\s+/g,""))[0]&&(i++,this.negative=1),i<e.length&&(16===t?this._parseHex(e,i,r):(this._parseBase(e,t,i),"le"===r&&this._initArray(this.toArray(),t,r)))},o.prototype._initNumber=function(e,t,r){e<0&&(this.negative=1,e=-e),e<67108864?(this.words=[67108863&e],this.length=1):e<4503599627370496?(this.words=[67108863&e,e/67108864&67108863],this.length=2):(n(e<9007199254740992),this.words=[67108863&e,e/67108864&67108863,1],this.length=3),"le"===r&&this._initArray(this.toArray(),t,r)},o.prototype._initArray=function(e,t,r){if(n("number"==typeof e.length),e.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(e.length/3),this.words=new Array(this.length);for(var i=0;i<this.length;i++)this.words[i]=0;var o,s,a=0;if("be"===r)for(i=e.length-1,o=0;i>=0;i-=3)s=e[i]|e[i-1]<<8|e[i-2]<<16,this.words[o]|=s<<a&67108863,this.words[o+1]=s>>>26-a&67108863,(a+=24)>=26&&(a-=26,o++);else if("le"===r)for(i=0,o=0;i<e.length;i+=3)s=e[i]|e[i+1]<<8|e[i+2]<<16,this.words[o]|=s<<a&67108863,this.words[o+1]=s>>>26-a&67108863,(a+=24)>=26&&(a-=26,o++);return this.strip()},o.prototype._parseHex=function(e,t,r){this.length=Math.ceil((e.length-t)/6),this.words=new Array(this.length);for(var n=0;n<this.length;n++)this.words[n]=0;var i,o=0,s=0;if("be"===r)for(n=e.length-1;n>=t;n-=2)i=c(e,t,n)<<o,this.words[s]|=67108863&i,o>=18?(o-=18,s+=1,this.words[s]|=i>>>26):o+=8;else for(n=(e.length-t)%2==0?t+1:t;n<e.length;n+=2)i=c(e,t,n)<<o,this.words[s]|=67108863&i,o>=18?(o-=18,s+=1,this.words[s]|=i>>>26):o+=8;this.strip()},o.prototype._parseBase=function(e,t,r){this.words=[0],this.length=1;for(var n=0,i=1;i<=67108863;i*=t)n++;n--,i=i/t|0;for(var o=e.length-r,s=o%n,a=Math.min(o,o-s)+r,c=0,l=r;l<a;l+=n)c=u(e,l,l+n,t),this.imuln(i),this.words[0]+c<67108864?this.words[0]+=c:this._iaddn(c);if(0!==s){var h=1;for(c=u(e,l,e.length,t),l=0;l<s;l++)h*=t;this.imuln(h),this.words[0]+c<67108864?this.words[0]+=c:this._iaddn(c)}this.strip()},o.prototype.copy=function(e){e.words=new Array(this.length);for(var t=0;t<this.length;t++)e.words[t]=this.words[t];e.length=this.length,e.negative=this.negative,e.red=this.red},o.prototype.clone=function(){var e=new o(null);return this.copy(e),e},o.prototype._expand=function(e){for(;this.length<e;)this.words[this.length++]=0;return this},o.prototype.strip=function(){for(;this.length>1&&0===this.words[this.length-1];)this.length--;return this._normSign()},o.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},o.prototype.inspect=function(){return(this.red?"<BN-R: ":"<BN: ")+this.toString(16)+">"};var l=["","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"],h=[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(e,t,r){r.negative=t.negative^e.negative;var n=e.length+t.length|0;r.length=n,n=n-1|0;var i=0|e.words[0],o=0|t.words[0],s=i*o,a=67108863&s,c=s/67108864|0;r.words[0]=a;for(var u=1;u<n;u++){for(var l=c>>>26,h=67108863&c,d=Math.min(u,t.length-1),f=Math.max(0,u-e.length+1);f<=d;f++){var p=u-f|0;l+=(s=(i=0|e.words[p])*(o=0|t.words[f])+h)/67108864|0,h=67108863&s}r.words[u]=0|h,c=0|l}return 0!==c?r.words[u]=0|c:r.length--,r.strip()}o.prototype.toString=function(e,t){var r;if(t=0|t||1,16===(e=e||10)||"hex"===e){r="";for(var i=0,o=0,s=0;s<this.length;s++){var a=this.words[s],c=(16777215&(a<<i|o)).toString(16);r=0!==(o=a>>>24-i&16777215)||s!==this.length-1?l[6-c.length]+c+r:c+r,(i+=2)>=26&&(i-=26,s--)}for(0!==o&&(r=o.toString(16)+r);r.length%t!=0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}if(e===(0|e)&&e>=2&&e<=36){var u=h[e],f=d[e];r="";var p=this.clone();for(p.negative=0;!p.isZero();){var m=p.modn(f).toString(e);r=(p=p.idivn(f)).isZero()?m+r:l[u-m.length]+m+r}for(this.isZero()&&(r="0"+r);r.length%t!=0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}n(!1,"Base should be between 2 and 36")},o.prototype.toNumber=function(){var e=this.words[0];return 2===this.length?e+=67108864*this.words[1]:3===this.length&&1===this.words[2]?e+=4503599627370496+67108864*this.words[1]:this.length>2&&n(!1,"Number can only safely store up to 53 bits"),0!==this.negative?-e:e},o.prototype.toJSON=function(){return this.toString(16)},o.prototype.toBuffer=function(e,t){return n(void 0!==s),this.toArrayLike(s,e,t)},o.prototype.toArray=function(e,t){return this.toArrayLike(Array,e,t)},o.prototype.toArrayLike=function(e,t,r){var i=this.byteLength(),o=r||Math.max(1,i);n(i<=o,"byte array longer than desired length"),n(o>0,"Requested array length <= 0"),this.strip();var s,a,c="le"===t,u=new e(o),l=this.clone();if(c){for(a=0;!l.isZero();a++)s=l.andln(255),l.iushrn(8),u[a]=s;for(;a<o;a++)u[a]=0}else{for(a=0;a<o-i;a++)u[a]=0;for(a=0;!l.isZero();a++)s=l.andln(255),l.iushrn(8),u[o-a-1]=s}return u},Math.clz32?o.prototype._countBits=function(e){return 32-Math.clz32(e)}:o.prototype._countBits=function(e){var t=e,r=0;return t>=4096&&(r+=13,t>>>=13),t>=64&&(r+=7,t>>>=7),t>=8&&(r+=4,t>>>=4),t>=2&&(r+=2,t>>>=2),r+t},o.prototype._zeroBits=function(e){if(0===e)return 26;var t=e,r=0;return 0==(8191&t)&&(r+=13,t>>>=13),0==(127&t)&&(r+=7,t>>>=7),0==(15&t)&&(r+=4,t>>>=4),0==(3&t)&&(r+=2,t>>>=2),0==(1&t)&&r++,r},o.prototype.bitLength=function(){var e=this.words[this.length-1],t=this._countBits(e);return 26*(this.length-1)+t},o.prototype.zeroBits=function(){if(this.isZero())return 0;for(var e=0,t=0;t<this.length;t++){var r=this._zeroBits(this.words[t]);if(e+=r,26!==r)break}return e},o.prototype.byteLength=function(){return Math.ceil(this.bitLength()/8)},o.prototype.toTwos=function(e){return 0!==this.negative?this.abs().inotn(e).iaddn(1):this.clone()},o.prototype.fromTwos=function(e){return this.testn(e-1)?this.notn(e).iaddn(1).ineg():this.clone()},o.prototype.isNeg=function(){return 0!==this.negative},o.prototype.neg=function(){return this.clone().ineg()},o.prototype.ineg=function(){return this.isZero()||(this.negative^=1),this},o.prototype.iuor=function(e){for(;this.length<e.length;)this.words[this.length++]=0;for(var t=0;t<e.length;t++)this.words[t]=this.words[t]|e.words[t];return this.strip()},o.prototype.ior=function(e){return n(0==(this.negative|e.negative)),this.iuor(e)},o.prototype.or=function(e){return this.length>e.length?this.clone().ior(e):e.clone().ior(this)},o.prototype.uor=function(e){return this.length>e.length?this.clone().iuor(e):e.clone().iuor(this)},o.prototype.iuand=function(e){var t;t=this.length>e.length?e:this;for(var r=0;r<t.length;r++)this.words[r]=this.words[r]&e.words[r];return this.length=t.length,this.strip()},o.prototype.iand=function(e){return n(0==(this.negative|e.negative)),this.iuand(e)},o.prototype.and=function(e){return this.length>e.length?this.clone().iand(e):e.clone().iand(this)},o.prototype.uand=function(e){return this.length>e.length?this.clone().iuand(e):e.clone().iuand(this)},o.prototype.iuxor=function(e){var t,r;this.length>e.length?(t=this,r=e):(t=e,r=this);for(var n=0;n<r.length;n++)this.words[n]=t.words[n]^r.words[n];if(this!==t)for(;n<t.length;n++)this.words[n]=t.words[n];return this.length=t.length,this.strip()},o.prototype.ixor=function(e){return n(0==(this.negative|e.negative)),this.iuxor(e)},o.prototype.xor=function(e){return this.length>e.length?this.clone().ixor(e):e.clone().ixor(this)},o.prototype.uxor=function(e){return this.length>e.length?this.clone().iuxor(e):e.clone().iuxor(this)},o.prototype.inotn=function(e){n("number"==typeof e&&e>=0);var t=0|Math.ceil(e/26),r=e%26;this._expand(t),r>0&&t--;for(var i=0;i<t;i++)this.words[i]=67108863&~this.words[i];return r>0&&(this.words[i]=~this.words[i]&67108863>>26-r),this.strip()},o.prototype.notn=function(e){return this.clone().inotn(e)},o.prototype.setn=function(e,t){n("number"==typeof e&&e>=0);var r=e/26|0,i=e%26;return this._expand(r+1),this.words[r]=t?this.words[r]|1<<i:this.words[r]&~(1<<i),this.strip()},o.prototype.iadd=function(e){var t,r,n;if(0!==this.negative&&0===e.negative)return this.negative=0,t=this.isub(e),this.negative^=1,this._normSign();if(0===this.negative&&0!==e.negative)return e.negative=0,t=this.isub(e),e.negative=1,t._normSign();this.length>e.length?(r=this,n=e):(r=e,n=this);for(var i=0,o=0;o<n.length;o++)t=(0|r.words[o])+(0|n.words[o])+i,this.words[o]=67108863&t,i=t>>>26;for(;0!==i&&o<r.length;o++)t=(0|r.words[o])+i,this.words[o]=67108863&t,i=t>>>26;if(this.length=r.length,0!==i)this.words[this.length]=i,this.length++;else if(r!==this)for(;o<r.length;o++)this.words[o]=r.words[o];return this},o.prototype.add=function(e){var t;return 0!==e.negative&&0===this.negative?(e.negative=0,t=this.sub(e),e.negative^=1,t):0===e.negative&&0!==this.negative?(this.negative=0,t=e.sub(this),this.negative=1,t):this.length>e.length?this.clone().iadd(e):e.clone().iadd(this)},o.prototype.isub=function(e){if(0!==e.negative){e.negative=0;var t=this.iadd(e);return e.negative=1,t._normSign()}if(0!==this.negative)return this.negative=0,this.iadd(e),this.negative=1,this._normSign();var r,n,i=this.cmp(e);if(0===i)return this.negative=0,this.length=1,this.words[0]=0,this;i>0?(r=this,n=e):(r=e,n=this);for(var o=0,s=0;s<n.length;s++)o=(t=(0|r.words[s])-(0|n.words[s])+o)>>26,this.words[s]=67108863&t;for(;0!==o&&s<r.length;s++)o=(t=(0|r.words[s])+o)>>26,this.words[s]=67108863&t;if(0===o&&s<r.length&&r!==this)for(;s<r.length;s++)this.words[s]=r.words[s];return this.length=Math.max(this.length,s),r!==this&&(this.negative=1),this.strip()},o.prototype.sub=function(e){return this.clone().isub(e)};var p=function(e,t,r){var n,i,o,s=e.words,a=t.words,c=r.words,u=0,l=0|s[0],h=8191&l,d=l>>>13,f=0|s[1],p=8191&f,m=f>>>13,g=0|s[2],y=8191&g,b=g>>>13,v=0|s[3],w=8191&v,x=v>>>13,k=0|s[4],S=8191&k,E=k>>>13,A=0|s[5],N=8191&A,T=A>>>13,P=0|s[6],M=8191&P,I=P>>>13,C=0|s[7],R=8191&C,B=C>>>13,O=0|s[8],L=8191&O,z=O>>>13,U=0|s[9],_=8191&U,q=U>>>13,D=0|a[0],V=8191&D,j=D>>>13,F=0|a[1],H=8191&F,W=F>>>13,K=0|a[2],X=8191&K,G=K>>>13,Z=0|a[3],J=8191&Z,Y=Z>>>13,Q=0|a[4],$=8191&Q,ee=Q>>>13,te=0|a[5],re=8191&te,ne=te>>>13,ie=0|a[6],oe=8191&ie,se=ie>>>13,ae=0|a[7],ce=8191&ae,ue=ae>>>13,le=0|a[8],he=8191&le,de=le>>>13,fe=0|a[9],pe=8191&fe,me=fe>>>13;r.negative=e.negative^t.negative,r.length=19;var ge=(u+(n=Math.imul(h,V))|0)+((8191&(i=(i=Math.imul(h,j))+Math.imul(d,V)|0))<<13)|0;u=((o=Math.imul(d,j))+(i>>>13)|0)+(ge>>>26)|0,ge&=67108863,n=Math.imul(p,V),i=(i=Math.imul(p,j))+Math.imul(m,V)|0,o=Math.imul(m,j);var ye=(u+(n=n+Math.imul(h,H)|0)|0)+((8191&(i=(i=i+Math.imul(h,W)|0)+Math.imul(d,H)|0))<<13)|0;u=((o=o+Math.imul(d,W)|0)+(i>>>13)|0)+(ye>>>26)|0,ye&=67108863,n=Math.imul(y,V),i=(i=Math.imul(y,j))+Math.imul(b,V)|0,o=Math.imul(b,j),n=n+Math.imul(p,H)|0,i=(i=i+Math.imul(p,W)|0)+Math.imul(m,H)|0,o=o+Math.imul(m,W)|0;var be=(u+(n=n+Math.imul(h,X)|0)|0)+((8191&(i=(i=i+Math.imul(h,G)|0)+Math.imul(d,X)|0))<<13)|0;u=((o=o+Math.imul(d,G)|0)+(i>>>13)|0)+(be>>>26)|0,be&=67108863,n=Math.imul(w,V),i=(i=Math.imul(w,j))+Math.imul(x,V)|0,o=Math.imul(x,j),n=n+Math.imul(y,H)|0,i=(i=i+Math.imul(y,W)|0)+Math.imul(b,H)|0,o=o+Math.imul(b,W)|0,n=n+Math.imul(p,X)|0,i=(i=i+Math.imul(p,G)|0)+Math.imul(m,X)|0,o=o+Math.imul(m,G)|0;var ve=(u+(n=n+Math.imul(h,J)|0)|0)+((8191&(i=(i=i+Math.imul(h,Y)|0)+Math.imul(d,J)|0))<<13)|0;u=((o=o+Math.imul(d,Y)|0)+(i>>>13)|0)+(ve>>>26)|0,ve&=67108863,n=Math.imul(S,V),i=(i=Math.imul(S,j))+Math.imul(E,V)|0,o=Math.imul(E,j),n=n+Math.imul(w,H)|0,i=(i=i+Math.imul(w,W)|0)+Math.imul(x,H)|0,o=o+Math.imul(x,W)|0,n=n+Math.imul(y,X)|0,i=(i=i+Math.imul(y,G)|0)+Math.imul(b,X)|0,o=o+Math.imul(b,G)|0,n=n+Math.imul(p,J)|0,i=(i=i+Math.imul(p,Y)|0)+Math.imul(m,J)|0,o=o+Math.imul(m,Y)|0;var we=(u+(n=n+Math.imul(h,$)|0)|0)+((8191&(i=(i=i+Math.imul(h,ee)|0)+Math.imul(d,$)|0))<<13)|0;u=((o=o+Math.imul(d,ee)|0)+(i>>>13)|0)+(we>>>26)|0,we&=67108863,n=Math.imul(N,V),i=(i=Math.imul(N,j))+Math.imul(T,V)|0,o=Math.imul(T,j),n=n+Math.imul(S,H)|0,i=(i=i+Math.imul(S,W)|0)+Math.imul(E,H)|0,o=o+Math.imul(E,W)|0,n=n+Math.imul(w,X)|0,i=(i=i+Math.imul(w,G)|0)+Math.imul(x,X)|0,o=o+Math.imul(x,G)|0,n=n+Math.imul(y,J)|0,i=(i=i+Math.imul(y,Y)|0)+Math.imul(b,J)|0,o=o+Math.imul(b,Y)|0,n=n+Math.imul(p,$)|0,i=(i=i+Math.imul(p,ee)|0)+Math.imul(m,$)|0,o=o+Math.imul(m,ee)|0;var xe=(u+(n=n+Math.imul(h,re)|0)|0)+((8191&(i=(i=i+Math.imul(h,ne)|0)+Math.imul(d,re)|0))<<13)|0;u=((o=o+Math.imul(d,ne)|0)+(i>>>13)|0)+(xe>>>26)|0,xe&=67108863,n=Math.imul(M,V),i=(i=Math.imul(M,j))+Math.imul(I,V)|0,o=Math.imul(I,j),n=n+Math.imul(N,H)|0,i=(i=i+Math.imul(N,W)|0)+Math.imul(T,H)|0,o=o+Math.imul(T,W)|0,n=n+Math.imul(S,X)|0,i=(i=i+Math.imul(S,G)|0)+Math.imul(E,X)|0,o=o+Math.imul(E,G)|0,n=n+Math.imul(w,J)|0,i=(i=i+Math.imul(w,Y)|0)+Math.imul(x,J)|0,o=o+Math.imul(x,Y)|0,n=n+Math.imul(y,$)|0,i=(i=i+Math.imul(y,ee)|0)+Math.imul(b,$)|0,o=o+Math.imul(b,ee)|0,n=n+Math.imul(p,re)|0,i=(i=i+Math.imul(p,ne)|0)+Math.imul(m,re)|0,o=o+Math.imul(m,ne)|0;var ke=(u+(n=n+Math.imul(h,oe)|0)|0)+((8191&(i=(i=i+Math.imul(h,se)|0)+Math.imul(d,oe)|0))<<13)|0;u=((o=o+Math.imul(d,se)|0)+(i>>>13)|0)+(ke>>>26)|0,ke&=67108863,n=Math.imul(R,V),i=(i=Math.imul(R,j))+Math.imul(B,V)|0,o=Math.imul(B,j),n=n+Math.imul(M,H)|0,i=(i=i+Math.imul(M,W)|0)+Math.imul(I,H)|0,o=o+Math.imul(I,W)|0,n=n+Math.imul(N,X)|0,i=(i=i+Math.imul(N,G)|0)+Math.imul(T,X)|0,o=o+Math.imul(T,G)|0,n=n+Math.imul(S,J)|0,i=(i=i+Math.imul(S,Y)|0)+Math.imul(E,J)|0,o=o+Math.imul(E,Y)|0,n=n+Math.imul(w,$)|0,i=(i=i+Math.imul(w,ee)|0)+Math.imul(x,$)|0,o=o+Math.imul(x,ee)|0,n=n+Math.imul(y,re)|0,i=(i=i+Math.imul(y,ne)|0)+Math.imul(b,re)|0,o=o+Math.imul(b,ne)|0,n=n+Math.imul(p,oe)|0,i=(i=i+Math.imul(p,se)|0)+Math.imul(m,oe)|0,o=o+Math.imul(m,se)|0;var Se=(u+(n=n+Math.imul(h,ce)|0)|0)+((8191&(i=(i=i+Math.imul(h,ue)|0)+Math.imul(d,ce)|0))<<13)|0;u=((o=o+Math.imul(d,ue)|0)+(i>>>13)|0)+(Se>>>26)|0,Se&=67108863,n=Math.imul(L,V),i=(i=Math.imul(L,j))+Math.imul(z,V)|0,o=Math.imul(z,j),n=n+Math.imul(R,H)|0,i=(i=i+Math.imul(R,W)|0)+Math.imul(B,H)|0,o=o+Math.imul(B,W)|0,n=n+Math.imul(M,X)|0,i=(i=i+Math.imul(M,G)|0)+Math.imul(I,X)|0,o=o+Math.imul(I,G)|0,n=n+Math.imul(N,J)|0,i=(i=i+Math.imul(N,Y)|0)+Math.imul(T,J)|0,o=o+Math.imul(T,Y)|0,n=n+Math.imul(S,$)|0,i=(i=i+Math.imul(S,ee)|0)+Math.imul(E,$)|0,o=o+Math.imul(E,ee)|0,n=n+Math.imul(w,re)|0,i=(i=i+Math.imul(w,ne)|0)+Math.imul(x,re)|0,o=o+Math.imul(x,ne)|0,n=n+Math.imul(y,oe)|0,i=(i=i+Math.imul(y,se)|0)+Math.imul(b,oe)|0,o=o+Math.imul(b,se)|0,n=n+Math.imul(p,ce)|0,i=(i=i+Math.imul(p,ue)|0)+Math.imul(m,ce)|0,o=o+Math.imul(m,ue)|0;var Ee=(u+(n=n+Math.imul(h,he)|0)|0)+((8191&(i=(i=i+Math.imul(h,de)|0)+Math.imul(d,he)|0))<<13)|0;u=((o=o+Math.imul(d,de)|0)+(i>>>13)|0)+(Ee>>>26)|0,Ee&=67108863,n=Math.imul(_,V),i=(i=Math.imul(_,j))+Math.imul(q,V)|0,o=Math.imul(q,j),n=n+Math.imul(L,H)|0,i=(i=i+Math.imul(L,W)|0)+Math.imul(z,H)|0,o=o+Math.imul(z,W)|0,n=n+Math.imul(R,X)|0,i=(i=i+Math.imul(R,G)|0)+Math.imul(B,X)|0,o=o+Math.imul(B,G)|0,n=n+Math.imul(M,J)|0,i=(i=i+Math.imul(M,Y)|0)+Math.imul(I,J)|0,o=o+Math.imul(I,Y)|0,n=n+Math.imul(N,$)|0,i=(i=i+Math.imul(N,ee)|0)+Math.imul(T,$)|0,o=o+Math.imul(T,ee)|0,n=n+Math.imul(S,re)|0,i=(i=i+Math.imul(S,ne)|0)+Math.imul(E,re)|0,o=o+Math.imul(E,ne)|0,n=n+Math.imul(w,oe)|0,i=(i=i+Math.imul(w,se)|0)+Math.imul(x,oe)|0,o=o+Math.imul(x,se)|0,n=n+Math.imul(y,ce)|0,i=(i=i+Math.imul(y,ue)|0)+Math.imul(b,ce)|0,o=o+Math.imul(b,ue)|0,n=n+Math.imul(p,he)|0,i=(i=i+Math.imul(p,de)|0)+Math.imul(m,he)|0,o=o+Math.imul(m,de)|0;var Ae=(u+(n=n+Math.imul(h,pe)|0)|0)+((8191&(i=(i=i+Math.imul(h,me)|0)+Math.imul(d,pe)|0))<<13)|0;u=((o=o+Math.imul(d,me)|0)+(i>>>13)|0)+(Ae>>>26)|0,Ae&=67108863,n=Math.imul(_,H),i=(i=Math.imul(_,W))+Math.imul(q,H)|0,o=Math.imul(q,W),n=n+Math.imul(L,X)|0,i=(i=i+Math.imul(L,G)|0)+Math.imul(z,X)|0,o=o+Math.imul(z,G)|0,n=n+Math.imul(R,J)|0,i=(i=i+Math.imul(R,Y)|0)+Math.imul(B,J)|0,o=o+Math.imul(B,Y)|0,n=n+Math.imul(M,$)|0,i=(i=i+Math.imul(M,ee)|0)+Math.imul(I,$)|0,o=o+Math.imul(I,ee)|0,n=n+Math.imul(N,re)|0,i=(i=i+Math.imul(N,ne)|0)+Math.imul(T,re)|0,o=o+Math.imul(T,ne)|0,n=n+Math.imul(S,oe)|0,i=(i=i+Math.imul(S,se)|0)+Math.imul(E,oe)|0,o=o+Math.imul(E,se)|0,n=n+Math.imul(w,ce)|0,i=(i=i+Math.imul(w,ue)|0)+Math.imul(x,ce)|0,o=o+Math.imul(x,ue)|0,n=n+Math.imul(y,he)|0,i=(i=i+Math.imul(y,de)|0)+Math.imul(b,he)|0,o=o+Math.imul(b,de)|0;var Ne=(u+(n=n+Math.imul(p,pe)|0)|0)+((8191&(i=(i=i+Math.imul(p,me)|0)+Math.imul(m,pe)|0))<<13)|0;u=((o=o+Math.imul(m,me)|0)+(i>>>13)|0)+(Ne>>>26)|0,Ne&=67108863,n=Math.imul(_,X),i=(i=Math.imul(_,G))+Math.imul(q,X)|0,o=Math.imul(q,G),n=n+Math.imul(L,J)|0,i=(i=i+Math.imul(L,Y)|0)+Math.imul(z,J)|0,o=o+Math.imul(z,Y)|0,n=n+Math.imul(R,$)|0,i=(i=i+Math.imul(R,ee)|0)+Math.imul(B,$)|0,o=o+Math.imul(B,ee)|0,n=n+Math.imul(M,re)|0,i=(i=i+Math.imul(M,ne)|0)+Math.imul(I,re)|0,o=o+Math.imul(I,ne)|0,n=n+Math.imul(N,oe)|0,i=(i=i+Math.imul(N,se)|0)+Math.imul(T,oe)|0,o=o+Math.imul(T,se)|0,n=n+Math.imul(S,ce)|0,i=(i=i+Math.imul(S,ue)|0)+Math.imul(E,ce)|0,o=o+Math.imul(E,ue)|0,n=n+Math.imul(w,he)|0,i=(i=i+Math.imul(w,de)|0)+Math.imul(x,he)|0,o=o+Math.imul(x,de)|0;var Te=(u+(n=n+Math.imul(y,pe)|0)|0)+((8191&(i=(i=i+Math.imul(y,me)|0)+Math.imul(b,pe)|0))<<13)|0;u=((o=o+Math.imul(b,me)|0)+(i>>>13)|0)+(Te>>>26)|0,Te&=67108863,n=Math.imul(_,J),i=(i=Math.imul(_,Y))+Math.imul(q,J)|0,o=Math.imul(q,Y),n=n+Math.imul(L,$)|0,i=(i=i+Math.imul(L,ee)|0)+Math.imul(z,$)|0,o=o+Math.imul(z,ee)|0,n=n+Math.imul(R,re)|0,i=(i=i+Math.imul(R,ne)|0)+Math.imul(B,re)|0,o=o+Math.imul(B,ne)|0,n=n+Math.imul(M,oe)|0,i=(i=i+Math.imul(M,se)|0)+Math.imul(I,oe)|0,o=o+Math.imul(I,se)|0,n=n+Math.imul(N,ce)|0,i=(i=i+Math.imul(N,ue)|0)+Math.imul(T,ce)|0,o=o+Math.imul(T,ue)|0,n=n+Math.imul(S,he)|0,i=(i=i+Math.imul(S,de)|0)+Math.imul(E,he)|0,o=o+Math.imul(E,de)|0;var Pe=(u+(n=n+Math.imul(w,pe)|0)|0)+((8191&(i=(i=i+Math.imul(w,me)|0)+Math.imul(x,pe)|0))<<13)|0;u=((o=o+Math.imul(x,me)|0)+(i>>>13)|0)+(Pe>>>26)|0,Pe&=67108863,n=Math.imul(_,$),i=(i=Math.imul(_,ee))+Math.imul(q,$)|0,o=Math.imul(q,ee),n=n+Math.imul(L,re)|0,i=(i=i+Math.imul(L,ne)|0)+Math.imul(z,re)|0,o=o+Math.imul(z,ne)|0,n=n+Math.imul(R,oe)|0,i=(i=i+Math.imul(R,se)|0)+Math.imul(B,oe)|0,o=o+Math.imul(B,se)|0,n=n+Math.imul(M,ce)|0,i=(i=i+Math.imul(M,ue)|0)+Math.imul(I,ce)|0,o=o+Math.imul(I,ue)|0,n=n+Math.imul(N,he)|0,i=(i=i+Math.imul(N,de)|0)+Math.imul(T,he)|0,o=o+Math.imul(T,de)|0;var Me=(u+(n=n+Math.imul(S,pe)|0)|0)+((8191&(i=(i=i+Math.imul(S,me)|0)+Math.imul(E,pe)|0))<<13)|0;u=((o=o+Math.imul(E,me)|0)+(i>>>13)|0)+(Me>>>26)|0,Me&=67108863,n=Math.imul(_,re),i=(i=Math.imul(_,ne))+Math.imul(q,re)|0,o=Math.imul(q,ne),n=n+Math.imul(L,oe)|0,i=(i=i+Math.imul(L,se)|0)+Math.imul(z,oe)|0,o=o+Math.imul(z,se)|0,n=n+Math.imul(R,ce)|0,i=(i=i+Math.imul(R,ue)|0)+Math.imul(B,ce)|0,o=o+Math.imul(B,ue)|0,n=n+Math.imul(M,he)|0,i=(i=i+Math.imul(M,de)|0)+Math.imul(I,he)|0,o=o+Math.imul(I,de)|0;var Ie=(u+(n=n+Math.imul(N,pe)|0)|0)+((8191&(i=(i=i+Math.imul(N,me)|0)+Math.imul(T,pe)|0))<<13)|0;u=((o=o+Math.imul(T,me)|0)+(i>>>13)|0)+(Ie>>>26)|0,Ie&=67108863,n=Math.imul(_,oe),i=(i=Math.imul(_,se))+Math.imul(q,oe)|0,o=Math.imul(q,se),n=n+Math.imul(L,ce)|0,i=(i=i+Math.imul(L,ue)|0)+Math.imul(z,ce)|0,o=o+Math.imul(z,ue)|0,n=n+Math.imul(R,he)|0,i=(i=i+Math.imul(R,de)|0)+Math.imul(B,he)|0,o=o+Math.imul(B,de)|0;var Ce=(u+(n=n+Math.imul(M,pe)|0)|0)+((8191&(i=(i=i+Math.imul(M,me)|0)+Math.imul(I,pe)|0))<<13)|0;u=((o=o+Math.imul(I,me)|0)+(i>>>13)|0)+(Ce>>>26)|0,Ce&=67108863,n=Math.imul(_,ce),i=(i=Math.imul(_,ue))+Math.imul(q,ce)|0,o=Math.imul(q,ue),n=n+Math.imul(L,he)|0,i=(i=i+Math.imul(L,de)|0)+Math.imul(z,he)|0,o=o+Math.imul(z,de)|0;var Re=(u+(n=n+Math.imul(R,pe)|0)|0)+((8191&(i=(i=i+Math.imul(R,me)|0)+Math.imul(B,pe)|0))<<13)|0;u=((o=o+Math.imul(B,me)|0)+(i>>>13)|0)+(Re>>>26)|0,Re&=67108863,n=Math.imul(_,he),i=(i=Math.imul(_,de))+Math.imul(q,he)|0,o=Math.imul(q,de);var Be=(u+(n=n+Math.imul(L,pe)|0)|0)+((8191&(i=(i=i+Math.imul(L,me)|0)+Math.imul(z,pe)|0))<<13)|0;u=((o=o+Math.imul(z,me)|0)+(i>>>13)|0)+(Be>>>26)|0,Be&=67108863;var Oe=(u+(n=Math.imul(_,pe))|0)+((8191&(i=(i=Math.imul(_,me))+Math.imul(q,pe)|0))<<13)|0;return u=((o=Math.imul(q,me))+(i>>>13)|0)+(Oe>>>26)|0,Oe&=67108863,c[0]=ge,c[1]=ye,c[2]=be,c[3]=ve,c[4]=we,c[5]=xe,c[6]=ke,c[7]=Se,c[8]=Ee,c[9]=Ae,c[10]=Ne,c[11]=Te,c[12]=Pe,c[13]=Me,c[14]=Ie,c[15]=Ce,c[16]=Re,c[17]=Be,c[18]=Oe,0!==u&&(c[19]=u,r.length++),r};function m(e,t,r){return(new g).mulp(e,t,r)}function g(e,t){this.x=e,this.y=t}Math.imul||(p=f),o.prototype.mulTo=function(e,t){var r,n=this.length+e.length;return r=10===this.length&&10===e.length?p(this,e,t):n<63?f(this,e,t):n<1024?function(e,t,r){r.negative=t.negative^e.negative,r.length=e.length+t.length;for(var n=0,i=0,o=0;o<r.length-1;o++){var s=i;i=0;for(var a=67108863&n,c=Math.min(o,t.length-1),u=Math.max(0,o-e.length+1);u<=c;u++){var l=o-u,h=(0|e.words[l])*(0|t.words[u]),d=67108863&h;a=67108863&(d=d+a|0),i+=(s=(s=s+(h/67108864|0)|0)+(d>>>26)|0)>>>26,s&=67108863}r.words[o]=a,n=s,s=i}return 0!==n?r.words[o]=n:r.length--,r.strip()}(this,e,t):m(this,e,t),r},g.prototype.makeRBT=function(e){for(var t=new Array(e),r=o.prototype._countBits(e)-1,n=0;n<e;n++)t[n]=this.revBin(n,r,e);return t},g.prototype.revBin=function(e,t,r){if(0===e||e===r-1)return e;for(var n=0,i=0;i<t;i++)n|=(1&e)<<t-i-1,e>>=1;return n},g.prototype.permute=function(e,t,r,n,i,o){for(var s=0;s<o;s++)n[s]=t[e[s]],i[s]=r[e[s]]},g.prototype.transform=function(e,t,r,n,i,o){this.permute(o,e,t,r,n,i);for(var s=1;s<i;s<<=1)for(var a=s<<1,c=Math.cos(2*Math.PI/a),u=Math.sin(2*Math.PI/a),l=0;l<i;l+=a)for(var h=c,d=u,f=0;f<s;f++){var p=r[l+f],m=n[l+f],g=r[l+f+s],y=n[l+f+s],b=h*g-d*y;y=h*y+d*g,g=b,r[l+f]=p+g,n[l+f]=m+y,r[l+f+s]=p-g,n[l+f+s]=m-y,f!==a&&(b=c*h-u*d,d=c*d+u*h,h=b)}},g.prototype.guessLen13b=function(e,t){var r=1|Math.max(t,e),n=1&r,i=0;for(r=r/2|0;r;r>>>=1)i++;return 1<<i+1+n},g.prototype.conjugate=function(e,t,r){if(!(r<=1))for(var n=0;n<r/2;n++){var i=e[n];e[n]=e[r-n-1],e[r-n-1]=i,i=t[n],t[n]=-t[r-n-1],t[r-n-1]=-i}},g.prototype.normalize13b=function(e,t){for(var r=0,n=0;n<t/2;n++){var i=8192*Math.round(e[2*n+1]/t)+Math.round(e[2*n]/t)+r;e[n]=67108863&i,r=i<67108864?0:i/67108864|0}return e},g.prototype.convert13b=function(e,t,r,i){for(var o=0,s=0;s<t;s++)o+=0|e[s],r[2*s]=8191&o,o>>>=13,r[2*s+1]=8191&o,o>>>=13;for(s=2*t;s<i;++s)r[s]=0;n(0===o),n(0==(-8192&o))},g.prototype.stub=function(e){for(var t=new Array(e),r=0;r<e;r++)t[r]=0;return t},g.prototype.mulp=function(e,t,r){var n=2*this.guessLen13b(e.length,t.length),i=this.makeRBT(n),o=this.stub(n),s=new Array(n),a=new Array(n),c=new Array(n),u=new Array(n),l=new Array(n),h=new Array(n),d=r.words;d.length=n,this.convert13b(e.words,e.length,s,n),this.convert13b(t.words,t.length,u,n),this.transform(s,o,a,c,n,i),this.transform(u,o,l,h,n,i);for(var f=0;f<n;f++){var p=a[f]*l[f]-c[f]*h[f];c[f]=a[f]*h[f]+c[f]*l[f],a[f]=p}return this.conjugate(a,c,n),this.transform(a,c,d,o,n,i),this.conjugate(d,o,n),this.normalize13b(d,n),r.negative=e.negative^t.negative,r.length=e.length+t.length,r.strip()},o.prototype.mul=function(e){var t=new o(null);return t.words=new Array(this.length+e.length),this.mulTo(e,t)},o.prototype.mulf=function(e){var t=new o(null);return t.words=new Array(this.length+e.length),m(this,e,t)},o.prototype.imul=function(e){return this.clone().mulTo(e,this)},o.prototype.imuln=function(e){n("number"==typeof e),n(e<67108864);for(var t=0,r=0;r<this.length;r++){var i=(0|this.words[r])*e,o=(67108863&i)+(67108863&t);t>>=26,t+=i/67108864|0,t+=o>>>26,this.words[r]=67108863&o}return 0!==t&&(this.words[r]=t,this.length++),this},o.prototype.muln=function(e){return this.clone().imuln(e)},o.prototype.sqr=function(){return this.mul(this)},o.prototype.isqr=function(){return this.imul(this.clone())},o.prototype.pow=function(e){var t=function(e){for(var t=new Array(e.bitLength()),r=0;r<t.length;r++){var n=r/26|0,i=r%26;t[r]=(e.words[n]&1<<i)>>>i}return t}(e);if(0===t.length)return new o(1);for(var r=this,n=0;n<t.length&&0===t[n];n++,r=r.sqr());if(++n<t.length)for(var i=r.sqr();n<t.length;n++,i=i.sqr())0!==t[n]&&(r=r.mul(i));return r},o.prototype.iushln=function(e){n("number"==typeof e&&e>=0);var t,r=e%26,i=(e-r)/26,o=67108863>>>26-r<<26-r;if(0!==r){var s=0;for(t=0;t<this.length;t++){var a=this.words[t]&o,c=(0|this.words[t])-a<<r;this.words[t]=c|s,s=a>>>26-r}s&&(this.words[t]=s,this.length++)}if(0!==i){for(t=this.length-1;t>=0;t--)this.words[t+i]=this.words[t];for(t=0;t<i;t++)this.words[t]=0;this.length+=i}return this.strip()},o.prototype.ishln=function(e){return n(0===this.negative),this.iushln(e)},o.prototype.iushrn=function(e,t,r){var i;n("number"==typeof e&&e>=0),i=t?(t-t%26)/26:0;var o=e%26,s=Math.min((e-o)/26,this.length),a=67108863^67108863>>>o<<o,c=r;if(i-=s,i=Math.max(0,i),c){for(var u=0;u<s;u++)c.words[u]=this.words[u];c.length=s}if(0===s);else if(this.length>s)for(this.length-=s,u=0;u<this.length;u++)this.words[u]=this.words[u+s];else this.words[0]=0,this.length=1;var l=0;for(u=this.length-1;u>=0&&(0!==l||u>=i);u--){var h=0|this.words[u];this.words[u]=l<<26-o|h>>>o,l=h&a}return c&&0!==l&&(c.words[c.length++]=l),0===this.length&&(this.words[0]=0,this.length=1),this.strip()},o.prototype.ishrn=function(e,t,r){return n(0===this.negative),this.iushrn(e,t,r)},o.prototype.shln=function(e){return this.clone().ishln(e)},o.prototype.ushln=function(e){return this.clone().iushln(e)},o.prototype.shrn=function(e){return this.clone().ishrn(e)},o.prototype.ushrn=function(e){return this.clone().iushrn(e)},o.prototype.testn=function(e){n("number"==typeof e&&e>=0);var t=e%26,r=(e-t)/26,i=1<<t;return!(this.length<=r)&&!!(this.words[r]&i)},o.prototype.imaskn=function(e){n("number"==typeof e&&e>=0);var t=e%26,r=(e-t)/26;if(n(0===this.negative,"imaskn works only with positive numbers"),this.length<=r)return this;if(0!==t&&r++,this.length=Math.min(r,this.length),0!==t){var i=67108863^67108863>>>t<<t;this.words[this.length-1]&=i}return this.strip()},o.prototype.maskn=function(e){return this.clone().imaskn(e)},o.prototype.iaddn=function(e){return n("number"==typeof e),n(e<67108864),e<0?this.isubn(-e):0!==this.negative?1===this.length&&(0|this.words[0])<e?(this.words[0]=e-(0|this.words[0]),this.negative=0,this):(this.negative=0,this.isubn(e),this.negative=1,this):this._iaddn(e)},o.prototype._iaddn=function(e){this.words[0]+=e;for(var t=0;t<this.length&&this.words[t]>=67108864;t++)this.words[t]-=67108864,t===this.length-1?this.words[t+1]=1:this.words[t+1]++;return this.length=Math.max(this.length,t+1),this},o.prototype.isubn=function(e){if(n("number"==typeof e),n(e<67108864),e<0)return this.iaddn(-e);if(0!==this.negative)return this.negative=0,this.iaddn(e),this.negative=1,this;if(this.words[0]-=e,1===this.length&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var t=0;t<this.length&&this.words[t]<0;t++)this.words[t]+=67108864,this.words[t+1]-=1;return this.strip()},o.prototype.addn=function(e){return this.clone().iaddn(e)},o.prototype.subn=function(e){return this.clone().isubn(e)},o.prototype.iabs=function(){return this.negative=0,this},o.prototype.abs=function(){return this.clone().iabs()},o.prototype._ishlnsubmul=function(e,t,r){var i,o,s=e.length+r;this._expand(s);var a=0;for(i=0;i<e.length;i++){o=(0|this.words[i+r])+a;var c=(0|e.words[i])*t;a=((o-=67108863&c)>>26)-(c/67108864|0),this.words[i+r]=67108863&o}for(;i<this.length-r;i++)a=(o=(0|this.words[i+r])+a)>>26,this.words[i+r]=67108863&o;if(0===a)return this.strip();for(n(-1===a),a=0,i=0;i<this.length;i++)a=(o=-(0|this.words[i])+a)>>26,this.words[i]=67108863&o;return this.negative=1,this.strip()},o.prototype._wordDiv=function(e,t){var r=(this.length,e.length),n=this.clone(),i=e,s=0|i.words[i.length-1];0!==(r=26-this._countBits(s))&&(i=i.ushln(r),n.iushln(r),s=0|i.words[i.length-1]);var a,c=n.length-i.length;if("mod"!==t){(a=new o(null)).length=c+1,a.words=new Array(a.length);for(var u=0;u<a.length;u++)a.words[u]=0}var l=n.clone()._ishlnsubmul(i,1,c);0===l.negative&&(n=l,a&&(a.words[c]=1));for(var h=c-1;h>=0;h--){var d=67108864*(0|n.words[i.length+h])+(0|n.words[i.length+h-1]);for(d=Math.min(d/s|0,67108863),n._ishlnsubmul(i,d,h);0!==n.negative;)d--,n.negative=0,n._ishlnsubmul(i,1,h),n.isZero()||(n.negative^=1);a&&(a.words[h]=d)}return a&&a.strip(),n.strip(),"div"!==t&&0!==r&&n.iushrn(r),{div:a||null,mod:n}},o.prototype.divmod=function(e,t,r){return n(!e.isZero()),this.isZero()?{div:new o(0),mod:new o(0)}:0!==this.negative&&0===e.negative?(a=this.neg().divmod(e,t),"mod"!==t&&(i=a.div.neg()),"div"!==t&&(s=a.mod.neg(),r&&0!==s.negative&&s.iadd(e)),{div:i,mod:s}):0===this.negative&&0!==e.negative?(a=this.divmod(e.neg(),t),"mod"!==t&&(i=a.div.neg()),{div:i,mod:a.mod}):0!=(this.negative&e.negative)?(a=this.neg().divmod(e.neg(),t),"div"!==t&&(s=a.mod.neg(),r&&0!==s.negative&&s.isub(e)),{div:a.div,mod:s}):e.length>this.length||this.cmp(e)<0?{div:new o(0),mod:this}:1===e.length?"div"===t?{div:this.divn(e.words[0]),mod:null}:"mod"===t?{div:null,mod:new o(this.modn(e.words[0]))}:{div:this.divn(e.words[0]),mod:new o(this.modn(e.words[0]))}:this._wordDiv(e,t);var i,s,a},o.prototype.div=function(e){return this.divmod(e,"div",!1).div},o.prototype.mod=function(e){return this.divmod(e,"mod",!1).mod},o.prototype.umod=function(e){return this.divmod(e,"mod",!0).mod},o.prototype.divRound=function(e){var t=this.divmod(e);if(t.mod.isZero())return t.div;var r=0!==t.div.negative?t.mod.isub(e):t.mod,n=e.ushrn(1),i=e.andln(1),o=r.cmp(n);return o<0||1===i&&0===o?t.div:0!==t.div.negative?t.div.isubn(1):t.div.iaddn(1)},o.prototype.modn=function(e){n(e<=67108863);for(var t=(1<<26)%e,r=0,i=this.length-1;i>=0;i--)r=(t*r+(0|this.words[i]))%e;return r},o.prototype.idivn=function(e){n(e<=67108863);for(var t=0,r=this.length-1;r>=0;r--){var i=(0|this.words[r])+67108864*t;this.words[r]=i/e|0,t=i%e}return this.strip()},o.prototype.divn=function(e){return this.clone().idivn(e)},o.prototype.egcd=function(e){n(0===e.negative),n(!e.isZero());var t=this,r=e.clone();t=0!==t.negative?t.umod(e):t.clone();for(var i=new o(1),s=new o(0),a=new o(0),c=new o(1),u=0;t.isEven()&&r.isEven();)t.iushrn(1),r.iushrn(1),++u;for(var l=r.clone(),h=t.clone();!t.isZero();){for(var d=0,f=1;0==(t.words[0]&f)&&d<26;++d,f<<=1);if(d>0)for(t.iushrn(d);d-- >0;)(i.isOdd()||s.isOdd())&&(i.iadd(l),s.isub(h)),i.iushrn(1),s.iushrn(1);for(var p=0,m=1;0==(r.words[0]&m)&&p<26;++p,m<<=1);if(p>0)for(r.iushrn(p);p-- >0;)(a.isOdd()||c.isOdd())&&(a.iadd(l),c.isub(h)),a.iushrn(1),c.iushrn(1);t.cmp(r)>=0?(t.isub(r),i.isub(a),s.isub(c)):(r.isub(t),a.isub(i),c.isub(s))}return{a,b:c,gcd:r.iushln(u)}},o.prototype._invmp=function(e){n(0===e.negative),n(!e.isZero());var t=this,r=e.clone();t=0!==t.negative?t.umod(e):t.clone();for(var i,s=new o(1),a=new o(0),c=r.clone();t.cmpn(1)>0&&r.cmpn(1)>0;){for(var u=0,l=1;0==(t.words[0]&l)&&u<26;++u,l<<=1);if(u>0)for(t.iushrn(u);u-- >0;)s.isOdd()&&s.iadd(c),s.iushrn(1);for(var h=0,d=1;0==(r.words[0]&d)&&h<26;++h,d<<=1);if(h>0)for(r.iushrn(h);h-- >0;)a.isOdd()&&a.iadd(c),a.iushrn(1);t.cmp(r)>=0?(t.isub(r),s.isub(a)):(r.isub(t),a.isub(s))}return(i=0===t.cmpn(1)?s:a).cmpn(0)<0&&i.iadd(e),i},o.prototype.gcd=function(e){if(this.isZero())return e.abs();if(e.isZero())return this.abs();var t=this.clone(),r=e.clone();t.negative=0,r.negative=0;for(var n=0;t.isEven()&&r.isEven();n++)t.iushrn(1),r.iushrn(1);for(;;){for(;t.isEven();)t.iushrn(1);for(;r.isEven();)r.iushrn(1);var i=t.cmp(r);if(i<0){var o=t;t=r,r=o}else if(0===i||0===r.cmpn(1))break;t.isub(r)}return r.iushln(n)},o.prototype.invm=function(e){return this.egcd(e).a.umod(e)},o.prototype.isEven=function(){return 0==(1&this.words[0])},o.prototype.isOdd=function(){return 1==(1&this.words[0])},o.prototype.andln=function(e){return this.words[0]&e},o.prototype.bincn=function(e){n("number"==typeof e);var t=e%26,r=(e-t)/26,i=1<<t;if(this.length<=r)return this._expand(r+1),this.words[r]|=i,this;for(var o=i,s=r;0!==o&&s<this.length;s++){var a=0|this.words[s];o=(a+=o)>>>26,a&=67108863,this.words[s]=a}return 0!==o&&(this.words[s]=o,this.length++),this},o.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},o.prototype.cmpn=function(e){var t,r=e<0;if(0!==this.negative&&!r)return-1;if(0===this.negative&&r)return 1;if(this.strip(),this.length>1)t=1;else{r&&(e=-e),n(e<=67108863,"Number is too big");var i=0|this.words[0];t=i===e?0:i<e?-1:1}return 0!==this.negative?0|-t:t},o.prototype.cmp=function(e){if(0!==this.negative&&0===e.negative)return-1;if(0===this.negative&&0!==e.negative)return 1;var t=this.ucmp(e);return 0!==this.negative?0|-t:t},o.prototype.ucmp=function(e){if(this.length>e.length)return 1;if(this.length<e.length)return-1;for(var t=0,r=this.length-1;r>=0;r--){var n=0|this.words[r],i=0|e.words[r];if(n!==i){n<i?t=-1:n>i&&(t=1);break}}return t},o.prototype.gtn=function(e){return 1===this.cmpn(e)},o.prototype.gt=function(e){return 1===this.cmp(e)},o.prototype.gten=function(e){return this.cmpn(e)>=0},o.prototype.gte=function(e){return this.cmp(e)>=0},o.prototype.ltn=function(e){return-1===this.cmpn(e)},o.prototype.lt=function(e){return-1===this.cmp(e)},o.prototype.lten=function(e){return this.cmpn(e)<=0},o.prototype.lte=function(e){return this.cmp(e)<=0},o.prototype.eqn=function(e){return 0===this.cmpn(e)},o.prototype.eq=function(e){return 0===this.cmp(e)},o.red=function(e){return new S(e)},o.prototype.toRed=function(e){return n(!this.red,"Already a number in reduction context"),n(0===this.negative,"red works only with positives"),e.convertTo(this)._forceRed(e)},o.prototype.fromRed=function(){return n(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},o.prototype._forceRed=function(e){return this.red=e,this},o.prototype.forceRed=function(e){return n(!this.red,"Already a number in reduction context"),this._forceRed(e)},o.prototype.redAdd=function(e){return n(this.red,"redAdd works only with red numbers"),this.red.add(this,e)},o.prototype.redIAdd=function(e){return n(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,e)},o.prototype.redSub=function(e){return n(this.red,"redSub works only with red numbers"),this.red.sub(this,e)},o.prototype.redISub=function(e){return n(this.red,"redISub works only with red numbers"),this.red.isub(this,e)},o.prototype.redShl=function(e){return n(this.red,"redShl works only with red numbers"),this.red.shl(this,e)},o.prototype.redMul=function(e){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.mul(this,e)},o.prototype.redIMul=function(e){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.imul(this,e)},o.prototype.redSqr=function(){return n(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},o.prototype.redISqr=function(){return n(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},o.prototype.redSqrt=function(){return n(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},o.prototype.redInvm=function(){return n(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},o.prototype.redNeg=function(){return n(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},o.prototype.redPow=function(e){return n(this.red&&!e.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,e)};var y={k256:null,p224:null,p192:null,p25519:null};function b(e,t){this.name=e,this.p=new o(t,16),this.n=this.p.bitLength(),this.k=new o(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function v(){b.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function w(){b.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function x(){b.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function k(){b.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function S(e){if("string"==typeof e){var t=o._prime(e);this.m=t.p,this.prime=t}else n(e.gtn(1),"modulus must be greater than 1"),this.m=e,this.prime=null}function E(e){S.call(this,e),this.shift=this.m.bitLength(),this.shift%26!=0&&(this.shift+=26-this.shift%26),this.r=new o(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}b.prototype._tmp=function(){var e=new o(null);return e.words=new Array(Math.ceil(this.n/13)),e},b.prototype.ireduce=function(e){var t,r=e;do{this.split(r,this.tmp),t=(r=(r=this.imulK(r)).iadd(this.tmp)).bitLength()}while(t>this.n);var n=t<this.n?-1:r.ucmp(this.p);return 0===n?(r.words[0]=0,r.length=1):n>0?r.isub(this.p):void 0!==r.strip?r.strip():r._strip(),r},b.prototype.split=function(e,t){e.iushrn(this.n,0,t)},b.prototype.imulK=function(e){return e.imul(this.k)},i(v,b),v.prototype.split=function(e,t){for(var r=4194303,n=Math.min(e.length,9),i=0;i<n;i++)t.words[i]=e.words[i];if(t.length=n,e.length<=9)return e.words[0]=0,void(e.length=1);var o=e.words[9];for(t.words[t.length++]=o&r,i=10;i<e.length;i++){var s=0|e.words[i];e.words[i-10]=(s&r)<<4|o>>>22,o=s}o>>>=22,e.words[i-10]=o,0===o&&e.length>10?e.length-=10:e.length-=9},v.prototype.imulK=function(e){e.words[e.length]=0,e.words[e.length+1]=0,e.length+=2;for(var t=0,r=0;r<e.length;r++){var n=0|e.words[r];t+=977*n,e.words[r]=67108863&t,t=64*n+(t/67108864|0)}return 0===e.words[e.length-1]&&(e.length--,0===e.words[e.length-1]&&e.length--),e},i(w,b),i(x,b),i(k,b),k.prototype.imulK=function(e){for(var t=0,r=0;r<e.length;r++){var n=19*(0|e.words[r])+t,i=67108863&n;n>>>=26,e.words[r]=i,t=n}return 0!==t&&(e.words[e.length++]=t),e},o._prime=function(e){if(y[e])return y[e];var t;if("k256"===e)t=new v;else if("p224"===e)t=new w;else if("p192"===e)t=new x;else{if("p25519"!==e)throw new Error("Unknown prime "+e);t=new k}return y[e]=t,t},S.prototype._verify1=function(e){n(0===e.negative,"red works only with positives"),n(e.red,"red works only with red numbers")},S.prototype._verify2=function(e,t){n(0==(e.negative|t.negative),"red works only with positives"),n(e.red&&e.red===t.red,"red works only with red numbers")},S.prototype.imod=function(e){return this.prime?this.prime.ireduce(e)._forceRed(this):e.umod(this.m)._forceRed(this)},S.prototype.neg=function(e){return e.isZero()?e.clone():this.m.sub(e)._forceRed(this)},S.prototype.add=function(e,t){this._verify2(e,t);var r=e.add(t);return r.cmp(this.m)>=0&&r.isub(this.m),r._forceRed(this)},S.prototype.iadd=function(e,t){this._verify2(e,t);var r=e.iadd(t);return r.cmp(this.m)>=0&&r.isub(this.m),r},S.prototype.sub=function(e,t){this._verify2(e,t);var r=e.sub(t);return r.cmpn(0)<0&&r.iadd(this.m),r._forceRed(this)},S.prototype.isub=function(e,t){this._verify2(e,t);var r=e.isub(t);return r.cmpn(0)<0&&r.iadd(this.m),r},S.prototype.shl=function(e,t){return this._verify1(e),this.imod(e.ushln(t))},S.prototype.imul=function(e,t){return this._verify2(e,t),this.imod(e.imul(t))},S.prototype.mul=function(e,t){return this._verify2(e,t),this.imod(e.mul(t))},S.prototype.isqr=function(e){return this.imul(e,e.clone())},S.prototype.sqr=function(e){return this.mul(e,e)},S.prototype.sqrt=function(e){if(e.isZero())return e.clone();var t=this.m.andln(3);if(n(t%2==1),3===t){var r=this.m.add(new o(1)).iushrn(2);return this.pow(e,r)}for(var i=this.m.subn(1),s=0;!i.isZero()&&0===i.andln(1);)s++,i.iushrn(1);n(!i.isZero());var a=new o(1).toRed(this),c=a.redNeg(),u=this.m.subn(1).iushrn(1),l=this.m.bitLength();for(l=new o(2*l*l).toRed(this);0!==this.pow(l,u).cmp(c);)l.redIAdd(c);for(var h=this.pow(l,i),d=this.pow(e,i.addn(1).iushrn(1)),f=this.pow(e,i),p=s;0!==f.cmp(a);){for(var m=f,g=0;0!==m.cmp(a);g++)m=m.redSqr();n(g<p);var y=this.pow(h,new o(1).iushln(p-g-1));d=d.redMul(y),h=y.redSqr(),f=f.redMul(h),p=g}return d},S.prototype.invm=function(e){var t=e._invmp(this.m);return 0!==t.negative?(t.negative=0,this.imod(t).redNeg()):this.imod(t)},S.prototype.pow=function(e,t){if(t.isZero())return new o(1).toRed(this);if(0===t.cmpn(1))return e.clone();var r=new Array(16);r[0]=new o(1).toRed(this),r[1]=e;for(var n=2;n<r.length;n++)r[n]=this.mul(r[n-1],e);var i=r[0],s=0,a=0,c=t.bitLength()%26;for(0===c&&(c=26),n=t.length-1;n>=0;n--){for(var u=t.words[n],l=c-1;l>=0;l--){var h=u>>l&1;i!==r[0]&&(i=this.sqr(i)),0!==h||0!==s?(s<<=1,s|=h,(4===++a||0===n&&0===l)&&(i=this.mul(i,r[s]),a=0,s=0)):a=0}c=26}return i},S.prototype.convertTo=function(e){var t=e.umod(this.m);return t===e?t.clone():t},S.prototype.convertFrom=function(e){var t=e.clone();return t.red=null,t},o.mont=function(e){return new E(e)},i(E,S),E.prototype.convertTo=function(e){return this.imod(e.ushln(this.shift))},E.prototype.convertFrom=function(e){var t=this.imod(e.mul(this.rinv));return t.red=null,t},E.prototype.imul=function(e,t){if(e.isZero()||t.isZero())return e.words[0]=0,e.length=1,e;var r=e.imul(t),n=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),i=r.isub(n).iushrn(this.shift),o=i;return i.cmp(this.m)>=0?o=i.isub(this.m):i.cmpn(0)<0&&(o=i.iadd(this.m)),o._forceRed(this)},E.prototype.mul=function(e,t){if(e.isZero()||t.isZero())return new o(0)._forceRed(this);var r=e.mul(t),n=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),i=r.isub(n).iushrn(this.shift),s=i;return i.cmp(this.m)>=0?s=i.isub(this.m):i.cmpn(0)<0&&(s=i.iadd(this.m)),s._forceRed(this)},E.prototype.invm=function(e){return this.imod(e._invmp(this.m).mul(this.r2))._forceRed(this)}}(e=r.nmd(e),this)},8434:function(e,t,r){!function(e,t){"use strict";function n(e,t){if(!e)throw new Error(t||"Assertion failed")}function i(e,t){e.super_=t;var r=function(){};r.prototype=t.prototype,e.prototype=new r,e.prototype.constructor=e}function o(e,t,r){if(o.isBN(e))return e;this.negative=0,this.words=null,this.length=0,this.red=null,null!==e&&("le"!==t&&"be"!==t||(r=t,t=10),this._init(e||0,t||10,r||"be"))}var s;"object"==typeof e?e.exports=o:t.BN=o,o.BN=o,o.wordSize=26;try{s="undefined"!=typeof window&&void 0!==window.Buffer?window.Buffer:r(45179).Buffer}catch(A){}function a(e,t){var r=e.charCodeAt(t);return r>=65&&r<=70?r-55:r>=97&&r<=102?r-87:r-48&15}function c(e,t,r){var n=a(e,r);return r-1>=t&&(n|=a(e,r-1)<<4),n}function u(e,t,r,n){for(var i=0,o=Math.min(e.length,r),s=t;s<o;s++){var a=e.charCodeAt(s)-48;i*=n,i+=a>=49?a-49+10:a>=17?a-17+10:a}return i}o.isBN=function(e){return e instanceof o||null!==e&&"object"==typeof e&&e.constructor.wordSize===o.wordSize&&Array.isArray(e.words)},o.max=function(e,t){return e.cmp(t)>0?e:t},o.min=function(e,t){return e.cmp(t)<0?e:t},o.prototype._init=function(e,t,r){if("number"==typeof e)return this._initNumber(e,t,r);if("object"==typeof e)return this._initArray(e,t,r);"hex"===t&&(t=16),n(t===(0|t)&&t>=2&&t<=36);var i=0;"-"===(e=e.toString().replace(/\s+/g,""))[0]&&(i++,this.negative=1),i<e.length&&(16===t?this._parseHex(e,i,r):(this._parseBase(e,t,i),"le"===r&&this._initArray(this.toArray(),t,r)))},o.prototype._initNumber=function(e,t,r){e<0&&(this.negative=1,e=-e),e<67108864?(this.words=[67108863&e],this.length=1):e<4503599627370496?(this.words=[67108863&e,e/67108864&67108863],this.length=2):(n(e<9007199254740992),this.words=[67108863&e,e/67108864&67108863,1],this.length=3),"le"===r&&this._initArray(this.toArray(),t,r)},o.prototype._initArray=function(e,t,r){if(n("number"==typeof e.length),e.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(e.length/3),this.words=new Array(this.length);for(var i=0;i<this.length;i++)this.words[i]=0;var o,s,a=0;if("be"===r)for(i=e.length-1,o=0;i>=0;i-=3)s=e[i]|e[i-1]<<8|e[i-2]<<16,this.words[o]|=s<<a&67108863,this.words[o+1]=s>>>26-a&67108863,(a+=24)>=26&&(a-=26,o++);else if("le"===r)for(i=0,o=0;i<e.length;i+=3)s=e[i]|e[i+1]<<8|e[i+2]<<16,this.words[o]|=s<<a&67108863,this.words[o+1]=s>>>26-a&67108863,(a+=24)>=26&&(a-=26,o++);return this.strip()},o.prototype._parseHex=function(e,t,r){this.length=Math.ceil((e.length-t)/6),this.words=new Array(this.length);for(var n=0;n<this.length;n++)this.words[n]=0;var i,o=0,s=0;if("be"===r)for(n=e.length-1;n>=t;n-=2)i=c(e,t,n)<<o,this.words[s]|=67108863&i,o>=18?(o-=18,s+=1,this.words[s]|=i>>>26):o+=8;else for(n=(e.length-t)%2==0?t+1:t;n<e.length;n+=2)i=c(e,t,n)<<o,this.words[s]|=67108863&i,o>=18?(o-=18,s+=1,this.words[s]|=i>>>26):o+=8;this.strip()},o.prototype._parseBase=function(e,t,r){this.words=[0],this.length=1;for(var n=0,i=1;i<=67108863;i*=t)n++;n--,i=i/t|0;for(var o=e.length-r,s=o%n,a=Math.min(o,o-s)+r,c=0,l=r;l<a;l+=n)c=u(e,l,l+n,t),this.imuln(i),this.words[0]+c<67108864?this.words[0]+=c:this._iaddn(c);if(0!==s){var h=1;for(c=u(e,l,e.length,t),l=0;l<s;l++)h*=t;this.imuln(h),this.words[0]+c<67108864?this.words[0]+=c:this._iaddn(c)}this.strip()},o.prototype.copy=function(e){e.words=new Array(this.length);for(var t=0;t<this.length;t++)e.words[t]=this.words[t];e.length=this.length,e.negative=this.negative,e.red=this.red},o.prototype.clone=function(){var e=new o(null);return this.copy(e),e},o.prototype._expand=function(e){for(;this.length<e;)this.words[this.length++]=0;return this},o.prototype.strip=function(){for(;this.length>1&&0===this.words[this.length-1];)this.length--;return this._normSign()},o.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},o.prototype.inspect=function(){return(this.red?"<BN-R: ":"<BN: ")+this.toString(16)+">"};var l=["","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"],h=[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(e,t,r){r.negative=t.negative^e.negative;var n=e.length+t.length|0;r.length=n,n=n-1|0;var i=0|e.words[0],o=0|t.words[0],s=i*o,a=67108863&s,c=s/67108864|0;r.words[0]=a;for(var u=1;u<n;u++){for(var l=c>>>26,h=67108863&c,d=Math.min(u,t.length-1),f=Math.max(0,u-e.length+1);f<=d;f++){var p=u-f|0;l+=(s=(i=0|e.words[p])*(o=0|t.words[f])+h)/67108864|0,h=67108863&s}r.words[u]=0|h,c=0|l}return 0!==c?r.words[u]=0|c:r.length--,r.strip()}o.prototype.toString=function(e,t){var r;if(t=0|t||1,16===(e=e||10)||"hex"===e){r="";for(var i=0,o=0,s=0;s<this.length;s++){var a=this.words[s],c=(16777215&(a<<i|o)).toString(16);r=0!==(o=a>>>24-i&16777215)||s!==this.length-1?l[6-c.length]+c+r:c+r,(i+=2)>=26&&(i-=26,s--)}for(0!==o&&(r=o.toString(16)+r);r.length%t!=0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}if(e===(0|e)&&e>=2&&e<=36){var u=h[e],f=d[e];r="";var p=this.clone();for(p.negative=0;!p.isZero();){var m=p.modn(f).toString(e);r=(p=p.idivn(f)).isZero()?m+r:l[u-m.length]+m+r}for(this.isZero()&&(r="0"+r);r.length%t!=0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}n(!1,"Base should be between 2 and 36")},o.prototype.toNumber=function(){var e=this.words[0];return 2===this.length?e+=67108864*this.words[1]:3===this.length&&1===this.words[2]?e+=4503599627370496+67108864*this.words[1]:this.length>2&&n(!1,"Number can only safely store up to 53 bits"),0!==this.negative?-e:e},o.prototype.toJSON=function(){return this.toString(16)},o.prototype.toBuffer=function(e,t){return n(void 0!==s),this.toArrayLike(s,e,t)},o.prototype.toArray=function(e,t){return this.toArrayLike(Array,e,t)},o.prototype.toArrayLike=function(e,t,r){var i=this.byteLength(),o=r||Math.max(1,i);n(i<=o,"byte array longer than desired length"),n(o>0,"Requested array length <= 0"),this.strip();var s,a,c="le"===t,u=new e(o),l=this.clone();if(c){for(a=0;!l.isZero();a++)s=l.andln(255),l.iushrn(8),u[a]=s;for(;a<o;a++)u[a]=0}else{for(a=0;a<o-i;a++)u[a]=0;for(a=0;!l.isZero();a++)s=l.andln(255),l.iushrn(8),u[o-a-1]=s}return u},Math.clz32?o.prototype._countBits=function(e){return 32-Math.clz32(e)}:o.prototype._countBits=function(e){var t=e,r=0;return t>=4096&&(r+=13,t>>>=13),t>=64&&(r+=7,t>>>=7),t>=8&&(r+=4,t>>>=4),t>=2&&(r+=2,t>>>=2),r+t},o.prototype._zeroBits=function(e){if(0===e)return 26;var t=e,r=0;return 0==(8191&t)&&(r+=13,t>>>=13),0==(127&t)&&(r+=7,t>>>=7),0==(15&t)&&(r+=4,t>>>=4),0==(3&t)&&(r+=2,t>>>=2),0==(1&t)&&r++,r},o.prototype.bitLength=function(){var e=this.words[this.length-1],t=this._countBits(e);return 26*(this.length-1)+t},o.prototype.zeroBits=function(){if(this.isZero())return 0;for(var e=0,t=0;t<this.length;t++){var r=this._zeroBits(this.words[t]);if(e+=r,26!==r)break}return e},o.prototype.byteLength=function(){return Math.ceil(this.bitLength()/8)},o.prototype.toTwos=function(e){return 0!==this.negative?this.abs().inotn(e).iaddn(1):this.clone()},o.prototype.fromTwos=function(e){return this.testn(e-1)?this.notn(e).iaddn(1).ineg():this.clone()},o.prototype.isNeg=function(){return 0!==this.negative},o.prototype.neg=function(){return this.clone().ineg()},o.prototype.ineg=function(){return this.isZero()||(this.negative^=1),this},o.prototype.iuor=function(e){for(;this.length<e.length;)this.words[this.length++]=0;for(var t=0;t<e.length;t++)this.words[t]=this.words[t]|e.words[t];return this.strip()},o.prototype.ior=function(e){return n(0==(this.negative|e.negative)),this.iuor(e)},o.prototype.or=function(e){return this.length>e.length?this.clone().ior(e):e.clone().ior(this)},o.prototype.uor=function(e){return this.length>e.length?this.clone().iuor(e):e.clone().iuor(this)},o.prototype.iuand=function(e){var t;t=this.length>e.length?e:this;for(var r=0;r<t.length;r++)this.words[r]=this.words[r]&e.words[r];return this.length=t.length,this.strip()},o.prototype.iand=function(e){return n(0==(this.negative|e.negative)),this.iuand(e)},o.prototype.and=function(e){return this.length>e.length?this.clone().iand(e):e.clone().iand(this)},o.prototype.uand=function(e){return this.length>e.length?this.clone().iuand(e):e.clone().iuand(this)},o.prototype.iuxor=function(e){var t,r;this.length>e.length?(t=this,r=e):(t=e,r=this);for(var n=0;n<r.length;n++)this.words[n]=t.words[n]^r.words[n];if(this!==t)for(;n<t.length;n++)this.words[n]=t.words[n];return this.length=t.length,this.strip()},o.prototype.ixor=function(e){return n(0==(this.negative|e.negative)),this.iuxor(e)},o.prototype.xor=function(e){return this.length>e.length?this.clone().ixor(e):e.clone().ixor(this)},o.prototype.uxor=function(e){return this.length>e.length?this.clone().iuxor(e):e.clone().iuxor(this)},o.prototype.inotn=function(e){n("number"==typeof e&&e>=0);var t=0|Math.ceil(e/26),r=e%26;this._expand(t),r>0&&t--;for(var i=0;i<t;i++)this.words[i]=67108863&~this.words[i];return r>0&&(this.words[i]=~this.words[i]&67108863>>26-r),this.strip()},o.prototype.notn=function(e){return this.clone().inotn(e)},o.prototype.setn=function(e,t){n("number"==typeof e&&e>=0);var r=e/26|0,i=e%26;return this._expand(r+1),this.words[r]=t?this.words[r]|1<<i:this.words[r]&~(1<<i),this.strip()},o.prototype.iadd=function(e){var t,r,n;if(0!==this.negative&&0===e.negative)return this.negative=0,t=this.isub(e),this.negative^=1,this._normSign();if(0===this.negative&&0!==e.negative)return e.negative=0,t=this.isub(e),e.negative=1,t._normSign();this.length>e.length?(r=this,n=e):(r=e,n=this);for(var i=0,o=0;o<n.length;o++)t=(0|r.words[o])+(0|n.words[o])+i,this.words[o]=67108863&t,i=t>>>26;for(;0!==i&&o<r.length;o++)t=(0|r.words[o])+i,this.words[o]=67108863&t,i=t>>>26;if(this.length=r.length,0!==i)this.words[this.length]=i,this.length++;else if(r!==this)for(;o<r.length;o++)this.words[o]=r.words[o];return this},o.prototype.add=function(e){var t;return 0!==e.negative&&0===this.negative?(e.negative=0,t=this.sub(e),e.negative^=1,t):0===e.negative&&0!==this.negative?(this.negative=0,t=e.sub(this),this.negative=1,t):this.length>e.length?this.clone().iadd(e):e.clone().iadd(this)},o.prototype.isub=function(e){if(0!==e.negative){e.negative=0;var t=this.iadd(e);return e.negative=1,t._normSign()}if(0!==this.negative)return this.negative=0,this.iadd(e),this.negative=1,this._normSign();var r,n,i=this.cmp(e);if(0===i)return this.negative=0,this.length=1,this.words[0]=0,this;i>0?(r=this,n=e):(r=e,n=this);for(var o=0,s=0;s<n.length;s++)o=(t=(0|r.words[s])-(0|n.words[s])+o)>>26,this.words[s]=67108863&t;for(;0!==o&&s<r.length;s++)o=(t=(0|r.words[s])+o)>>26,this.words[s]=67108863&t;if(0===o&&s<r.length&&r!==this)for(;s<r.length;s++)this.words[s]=r.words[s];return this.length=Math.max(this.length,s),r!==this&&(this.negative=1),this.strip()},o.prototype.sub=function(e){return this.clone().isub(e)};var p=function(e,t,r){var n,i,o,s=e.words,a=t.words,c=r.words,u=0,l=0|s[0],h=8191&l,d=l>>>13,f=0|s[1],p=8191&f,m=f>>>13,g=0|s[2],y=8191&g,b=g>>>13,v=0|s[3],w=8191&v,x=v>>>13,k=0|s[4],S=8191&k,E=k>>>13,A=0|s[5],N=8191&A,T=A>>>13,P=0|s[6],M=8191&P,I=P>>>13,C=0|s[7],R=8191&C,B=C>>>13,O=0|s[8],L=8191&O,z=O>>>13,U=0|s[9],_=8191&U,q=U>>>13,D=0|a[0],V=8191&D,j=D>>>13,F=0|a[1],H=8191&F,W=F>>>13,K=0|a[2],X=8191&K,G=K>>>13,Z=0|a[3],J=8191&Z,Y=Z>>>13,Q=0|a[4],$=8191&Q,ee=Q>>>13,te=0|a[5],re=8191&te,ne=te>>>13,ie=0|a[6],oe=8191&ie,se=ie>>>13,ae=0|a[7],ce=8191&ae,ue=ae>>>13,le=0|a[8],he=8191&le,de=le>>>13,fe=0|a[9],pe=8191&fe,me=fe>>>13;r.negative=e.negative^t.negative,r.length=19;var ge=(u+(n=Math.imul(h,V))|0)+((8191&(i=(i=Math.imul(h,j))+Math.imul(d,V)|0))<<13)|0;u=((o=Math.imul(d,j))+(i>>>13)|0)+(ge>>>26)|0,ge&=67108863,n=Math.imul(p,V),i=(i=Math.imul(p,j))+Math.imul(m,V)|0,o=Math.imul(m,j);var ye=(u+(n=n+Math.imul(h,H)|0)|0)+((8191&(i=(i=i+Math.imul(h,W)|0)+Math.imul(d,H)|0))<<13)|0;u=((o=o+Math.imul(d,W)|0)+(i>>>13)|0)+(ye>>>26)|0,ye&=67108863,n=Math.imul(y,V),i=(i=Math.imul(y,j))+Math.imul(b,V)|0,o=Math.imul(b,j),n=n+Math.imul(p,H)|0,i=(i=i+Math.imul(p,W)|0)+Math.imul(m,H)|0,o=o+Math.imul(m,W)|0;var be=(u+(n=n+Math.imul(h,X)|0)|0)+((8191&(i=(i=i+Math.imul(h,G)|0)+Math.imul(d,X)|0))<<13)|0;u=((o=o+Math.imul(d,G)|0)+(i>>>13)|0)+(be>>>26)|0,be&=67108863,n=Math.imul(w,V),i=(i=Math.imul(w,j))+Math.imul(x,V)|0,o=Math.imul(x,j),n=n+Math.imul(y,H)|0,i=(i=i+Math.imul(y,W)|0)+Math.imul(b,H)|0,o=o+Math.imul(b,W)|0,n=n+Math.imul(p,X)|0,i=(i=i+Math.imul(p,G)|0)+Math.imul(m,X)|0,o=o+Math.imul(m,G)|0;var ve=(u+(n=n+Math.imul(h,J)|0)|0)+((8191&(i=(i=i+Math.imul(h,Y)|0)+Math.imul(d,J)|0))<<13)|0;u=((o=o+Math.imul(d,Y)|0)+(i>>>13)|0)+(ve>>>26)|0,ve&=67108863,n=Math.imul(S,V),i=(i=Math.imul(S,j))+Math.imul(E,V)|0,o=Math.imul(E,j),n=n+Math.imul(w,H)|0,i=(i=i+Math.imul(w,W)|0)+Math.imul(x,H)|0,o=o+Math.imul(x,W)|0,n=n+Math.imul(y,X)|0,i=(i=i+Math.imul(y,G)|0)+Math.imul(b,X)|0,o=o+Math.imul(b,G)|0,n=n+Math.imul(p,J)|0,i=(i=i+Math.imul(p,Y)|0)+Math.imul(m,J)|0,o=o+Math.imul(m,Y)|0;var we=(u+(n=n+Math.imul(h,$)|0)|0)+((8191&(i=(i=i+Math.imul(h,ee)|0)+Math.imul(d,$)|0))<<13)|0;u=((o=o+Math.imul(d,ee)|0)+(i>>>13)|0)+(we>>>26)|0,we&=67108863,n=Math.imul(N,V),i=(i=Math.imul(N,j))+Math.imul(T,V)|0,o=Math.imul(T,j),n=n+Math.imul(S,H)|0,i=(i=i+Math.imul(S,W)|0)+Math.imul(E,H)|0,o=o+Math.imul(E,W)|0,n=n+Math.imul(w,X)|0,i=(i=i+Math.imul(w,G)|0)+Math.imul(x,X)|0,o=o+Math.imul(x,G)|0,n=n+Math.imul(y,J)|0,i=(i=i+Math.imul(y,Y)|0)+Math.imul(b,J)|0,o=o+Math.imul(b,Y)|0,n=n+Math.imul(p,$)|0,i=(i=i+Math.imul(p,ee)|0)+Math.imul(m,$)|0,o=o+Math.imul(m,ee)|0;var xe=(u+(n=n+Math.imul(h,re)|0)|0)+((8191&(i=(i=i+Math.imul(h,ne)|0)+Math.imul(d,re)|0))<<13)|0;u=((o=o+Math.imul(d,ne)|0)+(i>>>13)|0)+(xe>>>26)|0,xe&=67108863,n=Math.imul(M,V),i=(i=Math.imul(M,j))+Math.imul(I,V)|0,o=Math.imul(I,j),n=n+Math.imul(N,H)|0,i=(i=i+Math.imul(N,W)|0)+Math.imul(T,H)|0,o=o+Math.imul(T,W)|0,n=n+Math.imul(S,X)|0,i=(i=i+Math.imul(S,G)|0)+Math.imul(E,X)|0,o=o+Math.imul(E,G)|0,n=n+Math.imul(w,J)|0,i=(i=i+Math.imul(w,Y)|0)+Math.imul(x,J)|0,o=o+Math.imul(x,Y)|0,n=n+Math.imul(y,$)|0,i=(i=i+Math.imul(y,ee)|0)+Math.imul(b,$)|0,o=o+Math.imul(b,ee)|0,n=n+Math.imul(p,re)|0,i=(i=i+Math.imul(p,ne)|0)+Math.imul(m,re)|0,o=o+Math.imul(m,ne)|0;var ke=(u+(n=n+Math.imul(h,oe)|0)|0)+((8191&(i=(i=i+Math.imul(h,se)|0)+Math.imul(d,oe)|0))<<13)|0;u=((o=o+Math.imul(d,se)|0)+(i>>>13)|0)+(ke>>>26)|0,ke&=67108863,n=Math.imul(R,V),i=(i=Math.imul(R,j))+Math.imul(B,V)|0,o=Math.imul(B,j),n=n+Math.imul(M,H)|0,i=(i=i+Math.imul(M,W)|0)+Math.imul(I,H)|0,o=o+Math.imul(I,W)|0,n=n+Math.imul(N,X)|0,i=(i=i+Math.imul(N,G)|0)+Math.imul(T,X)|0,o=o+Math.imul(T,G)|0,n=n+Math.imul(S,J)|0,i=(i=i+Math.imul(S,Y)|0)+Math.imul(E,J)|0,o=o+Math.imul(E,Y)|0,n=n+Math.imul(w,$)|0,i=(i=i+Math.imul(w,ee)|0)+Math.imul(x,$)|0,o=o+Math.imul(x,ee)|0,n=n+Math.imul(y,re)|0,i=(i=i+Math.imul(y,ne)|0)+Math.imul(b,re)|0,o=o+Math.imul(b,ne)|0,n=n+Math.imul(p,oe)|0,i=(i=i+Math.imul(p,se)|0)+Math.imul(m,oe)|0,o=o+Math.imul(m,se)|0;var Se=(u+(n=n+Math.imul(h,ce)|0)|0)+((8191&(i=(i=i+Math.imul(h,ue)|0)+Math.imul(d,ce)|0))<<13)|0;u=((o=o+Math.imul(d,ue)|0)+(i>>>13)|0)+(Se>>>26)|0,Se&=67108863,n=Math.imul(L,V),i=(i=Math.imul(L,j))+Math.imul(z,V)|0,o=Math.imul(z,j),n=n+Math.imul(R,H)|0,i=(i=i+Math.imul(R,W)|0)+Math.imul(B,H)|0,o=o+Math.imul(B,W)|0,n=n+Math.imul(M,X)|0,i=(i=i+Math.imul(M,G)|0)+Math.imul(I,X)|0,o=o+Math.imul(I,G)|0,n=n+Math.imul(N,J)|0,i=(i=i+Math.imul(N,Y)|0)+Math.imul(T,J)|0,o=o+Math.imul(T,Y)|0,n=n+Math.imul(S,$)|0,i=(i=i+Math.imul(S,ee)|0)+Math.imul(E,$)|0,o=o+Math.imul(E,ee)|0,n=n+Math.imul(w,re)|0,i=(i=i+Math.imul(w,ne)|0)+Math.imul(x,re)|0,o=o+Math.imul(x,ne)|0,n=n+Math.imul(y,oe)|0,i=(i=i+Math.imul(y,se)|0)+Math.imul(b,oe)|0,o=o+Math.imul(b,se)|0,n=n+Math.imul(p,ce)|0,i=(i=i+Math.imul(p,ue)|0)+Math.imul(m,ce)|0,o=o+Math.imul(m,ue)|0;var Ee=(u+(n=n+Math.imul(h,he)|0)|0)+((8191&(i=(i=i+Math.imul(h,de)|0)+Math.imul(d,he)|0))<<13)|0;u=((o=o+Math.imul(d,de)|0)+(i>>>13)|0)+(Ee>>>26)|0,Ee&=67108863,n=Math.imul(_,V),i=(i=Math.imul(_,j))+Math.imul(q,V)|0,o=Math.imul(q,j),n=n+Math.imul(L,H)|0,i=(i=i+Math.imul(L,W)|0)+Math.imul(z,H)|0,o=o+Math.imul(z,W)|0,n=n+Math.imul(R,X)|0,i=(i=i+Math.imul(R,G)|0)+Math.imul(B,X)|0,o=o+Math.imul(B,G)|0,n=n+Math.imul(M,J)|0,i=(i=i+Math.imul(M,Y)|0)+Math.imul(I,J)|0,o=o+Math.imul(I,Y)|0,n=n+Math.imul(N,$)|0,i=(i=i+Math.imul(N,ee)|0)+Math.imul(T,$)|0,o=o+Math.imul(T,ee)|0,n=n+Math.imul(S,re)|0,i=(i=i+Math.imul(S,ne)|0)+Math.imul(E,re)|0,o=o+Math.imul(E,ne)|0,n=n+Math.imul(w,oe)|0,i=(i=i+Math.imul(w,se)|0)+Math.imul(x,oe)|0,o=o+Math.imul(x,se)|0,n=n+Math.imul(y,ce)|0,i=(i=i+Math.imul(y,ue)|0)+Math.imul(b,ce)|0,o=o+Math.imul(b,ue)|0,n=n+Math.imul(p,he)|0,i=(i=i+Math.imul(p,de)|0)+Math.imul(m,he)|0,o=o+Math.imul(m,de)|0;var Ae=(u+(n=n+Math.imul(h,pe)|0)|0)+((8191&(i=(i=i+Math.imul(h,me)|0)+Math.imul(d,pe)|0))<<13)|0;u=((o=o+Math.imul(d,me)|0)+(i>>>13)|0)+(Ae>>>26)|0,Ae&=67108863,n=Math.imul(_,H),i=(i=Math.imul(_,W))+Math.imul(q,H)|0,o=Math.imul(q,W),n=n+Math.imul(L,X)|0,i=(i=i+Math.imul(L,G)|0)+Math.imul(z,X)|0,o=o+Math.imul(z,G)|0,n=n+Math.imul(R,J)|0,i=(i=i+Math.imul(R,Y)|0)+Math.imul(B,J)|0,o=o+Math.imul(B,Y)|0,n=n+Math.imul(M,$)|0,i=(i=i+Math.imul(M,ee)|0)+Math.imul(I,$)|0,o=o+Math.imul(I,ee)|0,n=n+Math.imul(N,re)|0,i=(i=i+Math.imul(N,ne)|0)+Math.imul(T,re)|0,o=o+Math.imul(T,ne)|0,n=n+Math.imul(S,oe)|0,i=(i=i+Math.imul(S,se)|0)+Math.imul(E,oe)|0,o=o+Math.imul(E,se)|0,n=n+Math.imul(w,ce)|0,i=(i=i+Math.imul(w,ue)|0)+Math.imul(x,ce)|0,o=o+Math.imul(x,ue)|0,n=n+Math.imul(y,he)|0,i=(i=i+Math.imul(y,de)|0)+Math.imul(b,he)|0,o=o+Math.imul(b,de)|0;var Ne=(u+(n=n+Math.imul(p,pe)|0)|0)+((8191&(i=(i=i+Math.imul(p,me)|0)+Math.imul(m,pe)|0))<<13)|0;u=((o=o+Math.imul(m,me)|0)+(i>>>13)|0)+(Ne>>>26)|0,Ne&=67108863,n=Math.imul(_,X),i=(i=Math.imul(_,G))+Math.imul(q,X)|0,o=Math.imul(q,G),n=n+Math.imul(L,J)|0,i=(i=i+Math.imul(L,Y)|0)+Math.imul(z,J)|0,o=o+Math.imul(z,Y)|0,n=n+Math.imul(R,$)|0,i=(i=i+Math.imul(R,ee)|0)+Math.imul(B,$)|0,o=o+Math.imul(B,ee)|0,n=n+Math.imul(M,re)|0,i=(i=i+Math.imul(M,ne)|0)+Math.imul(I,re)|0,o=o+Math.imul(I,ne)|0,n=n+Math.imul(N,oe)|0,i=(i=i+Math.imul(N,se)|0)+Math.imul(T,oe)|0,o=o+Math.imul(T,se)|0,n=n+Math.imul(S,ce)|0,i=(i=i+Math.imul(S,ue)|0)+Math.imul(E,ce)|0,o=o+Math.imul(E,ue)|0,n=n+Math.imul(w,he)|0,i=(i=i+Math.imul(w,de)|0)+Math.imul(x,he)|0,o=o+Math.imul(x,de)|0;var Te=(u+(n=n+Math.imul(y,pe)|0)|0)+((8191&(i=(i=i+Math.imul(y,me)|0)+Math.imul(b,pe)|0))<<13)|0;u=((o=o+Math.imul(b,me)|0)+(i>>>13)|0)+(Te>>>26)|0,Te&=67108863,n=Math.imul(_,J),i=(i=Math.imul(_,Y))+Math.imul(q,J)|0,o=Math.imul(q,Y),n=n+Math.imul(L,$)|0,i=(i=i+Math.imul(L,ee)|0)+Math.imul(z,$)|0,o=o+Math.imul(z,ee)|0,n=n+Math.imul(R,re)|0,i=(i=i+Math.imul(R,ne)|0)+Math.imul(B,re)|0,o=o+Math.imul(B,ne)|0,n=n+Math.imul(M,oe)|0,i=(i=i+Math.imul(M,se)|0)+Math.imul(I,oe)|0,o=o+Math.imul(I,se)|0,n=n+Math.imul(N,ce)|0,i=(i=i+Math.imul(N,ue)|0)+Math.imul(T,ce)|0,o=o+Math.imul(T,ue)|0,n=n+Math.imul(S,he)|0,i=(i=i+Math.imul(S,de)|0)+Math.imul(E,he)|0,o=o+Math.imul(E,de)|0;var Pe=(u+(n=n+Math.imul(w,pe)|0)|0)+((8191&(i=(i=i+Math.imul(w,me)|0)+Math.imul(x,pe)|0))<<13)|0;u=((o=o+Math.imul(x,me)|0)+(i>>>13)|0)+(Pe>>>26)|0,Pe&=67108863,n=Math.imul(_,$),i=(i=Math.imul(_,ee))+Math.imul(q,$)|0,o=Math.imul(q,ee),n=n+Math.imul(L,re)|0,i=(i=i+Math.imul(L,ne)|0)+Math.imul(z,re)|0,o=o+Math.imul(z,ne)|0,n=n+Math.imul(R,oe)|0,i=(i=i+Math.imul(R,se)|0)+Math.imul(B,oe)|0,o=o+Math.imul(B,se)|0,n=n+Math.imul(M,ce)|0,i=(i=i+Math.imul(M,ue)|0)+Math.imul(I,ce)|0,o=o+Math.imul(I,ue)|0,n=n+Math.imul(N,he)|0,i=(i=i+Math.imul(N,de)|0)+Math.imul(T,he)|0,o=o+Math.imul(T,de)|0;var Me=(u+(n=n+Math.imul(S,pe)|0)|0)+((8191&(i=(i=i+Math.imul(S,me)|0)+Math.imul(E,pe)|0))<<13)|0;u=((o=o+Math.imul(E,me)|0)+(i>>>13)|0)+(Me>>>26)|0,Me&=67108863,n=Math.imul(_,re),i=(i=Math.imul(_,ne))+Math.imul(q,re)|0,o=Math.imul(q,ne),n=n+Math.imul(L,oe)|0,i=(i=i+Math.imul(L,se)|0)+Math.imul(z,oe)|0,o=o+Math.imul(z,se)|0,n=n+Math.imul(R,ce)|0,i=(i=i+Math.imul(R,ue)|0)+Math.imul(B,ce)|0,o=o+Math.imul(B,ue)|0,n=n+Math.imul(M,he)|0,i=(i=i+Math.imul(M,de)|0)+Math.imul(I,he)|0,o=o+Math.imul(I,de)|0;var Ie=(u+(n=n+Math.imul(N,pe)|0)|0)+((8191&(i=(i=i+Math.imul(N,me)|0)+Math.imul(T,pe)|0))<<13)|0;u=((o=o+Math.imul(T,me)|0)+(i>>>13)|0)+(Ie>>>26)|0,Ie&=67108863,n=Math.imul(_,oe),i=(i=Math.imul(_,se))+Math.imul(q,oe)|0,o=Math.imul(q,se),n=n+Math.imul(L,ce)|0,i=(i=i+Math.imul(L,ue)|0)+Math.imul(z,ce)|0,o=o+Math.imul(z,ue)|0,n=n+Math.imul(R,he)|0,i=(i=i+Math.imul(R,de)|0)+Math.imul(B,he)|0,o=o+Math.imul(B,de)|0;var Ce=(u+(n=n+Math.imul(M,pe)|0)|0)+((8191&(i=(i=i+Math.imul(M,me)|0)+Math.imul(I,pe)|0))<<13)|0;u=((o=o+Math.imul(I,me)|0)+(i>>>13)|0)+(Ce>>>26)|0,Ce&=67108863,n=Math.imul(_,ce),i=(i=Math.imul(_,ue))+Math.imul(q,ce)|0,o=Math.imul(q,ue),n=n+Math.imul(L,he)|0,i=(i=i+Math.imul(L,de)|0)+Math.imul(z,he)|0,o=o+Math.imul(z,de)|0;var Re=(u+(n=n+Math.imul(R,pe)|0)|0)+((8191&(i=(i=i+Math.imul(R,me)|0)+Math.imul(B,pe)|0))<<13)|0;u=((o=o+Math.imul(B,me)|0)+(i>>>13)|0)+(Re>>>26)|0,Re&=67108863,n=Math.imul(_,he),i=(i=Math.imul(_,de))+Math.imul(q,he)|0,o=Math.imul(q,de);var Be=(u+(n=n+Math.imul(L,pe)|0)|0)+((8191&(i=(i=i+Math.imul(L,me)|0)+Math.imul(z,pe)|0))<<13)|0;u=((o=o+Math.imul(z,me)|0)+(i>>>13)|0)+(Be>>>26)|0,Be&=67108863;var Oe=(u+(n=Math.imul(_,pe))|0)+((8191&(i=(i=Math.imul(_,me))+Math.imul(q,pe)|0))<<13)|0;return u=((o=Math.imul(q,me))+(i>>>13)|0)+(Oe>>>26)|0,Oe&=67108863,c[0]=ge,c[1]=ye,c[2]=be,c[3]=ve,c[4]=we,c[5]=xe,c[6]=ke,c[7]=Se,c[8]=Ee,c[9]=Ae,c[10]=Ne,c[11]=Te,c[12]=Pe,c[13]=Me,c[14]=Ie,c[15]=Ce,c[16]=Re,c[17]=Be,c[18]=Oe,0!==u&&(c[19]=u,r.length++),r};function m(e,t,r){return(new g).mulp(e,t,r)}function g(e,t){this.x=e,this.y=t}Math.imul||(p=f),o.prototype.mulTo=function(e,t){var r,n=this.length+e.length;return r=10===this.length&&10===e.length?p(this,e,t):n<63?f(this,e,t):n<1024?function(e,t,r){r.negative=t.negative^e.negative,r.length=e.length+t.length;for(var n=0,i=0,o=0;o<r.length-1;o++){var s=i;i=0;for(var a=67108863&n,c=Math.min(o,t.length-1),u=Math.max(0,o-e.length+1);u<=c;u++){var l=o-u,h=(0|e.words[l])*(0|t.words[u]),d=67108863&h;a=67108863&(d=d+a|0),i+=(s=(s=s+(h/67108864|0)|0)+(d>>>26)|0)>>>26,s&=67108863}r.words[o]=a,n=s,s=i}return 0!==n?r.words[o]=n:r.length--,r.strip()}(this,e,t):m(this,e,t),r},g.prototype.makeRBT=function(e){for(var t=new Array(e),r=o.prototype._countBits(e)-1,n=0;n<e;n++)t[n]=this.revBin(n,r,e);return t},g.prototype.revBin=function(e,t,r){if(0===e||e===r-1)return e;for(var n=0,i=0;i<t;i++)n|=(1&e)<<t-i-1,e>>=1;return n},g.prototype.permute=function(e,t,r,n,i,o){for(var s=0;s<o;s++)n[s]=t[e[s]],i[s]=r[e[s]]},g.prototype.transform=function(e,t,r,n,i,o){this.permute(o,e,t,r,n,i);for(var s=1;s<i;s<<=1)for(var a=s<<1,c=Math.cos(2*Math.PI/a),u=Math.sin(2*Math.PI/a),l=0;l<i;l+=a)for(var h=c,d=u,f=0;f<s;f++){var p=r[l+f],m=n[l+f],g=r[l+f+s],y=n[l+f+s],b=h*g-d*y;y=h*y+d*g,g=b,r[l+f]=p+g,n[l+f]=m+y,r[l+f+s]=p-g,n[l+f+s]=m-y,f!==a&&(b=c*h-u*d,d=c*d+u*h,h=b)}},g.prototype.guessLen13b=function(e,t){var r=1|Math.max(t,e),n=1&r,i=0;for(r=r/2|0;r;r>>>=1)i++;return 1<<i+1+n},g.prototype.conjugate=function(e,t,r){if(!(r<=1))for(var n=0;n<r/2;n++){var i=e[n];e[n]=e[r-n-1],e[r-n-1]=i,i=t[n],t[n]=-t[r-n-1],t[r-n-1]=-i}},g.prototype.normalize13b=function(e,t){for(var r=0,n=0;n<t/2;n++){var i=8192*Math.round(e[2*n+1]/t)+Math.round(e[2*n]/t)+r;e[n]=67108863&i,r=i<67108864?0:i/67108864|0}return e},g.prototype.convert13b=function(e,t,r,i){for(var o=0,s=0;s<t;s++)o+=0|e[s],r[2*s]=8191&o,o>>>=13,r[2*s+1]=8191&o,o>>>=13;for(s=2*t;s<i;++s)r[s]=0;n(0===o),n(0==(-8192&o))},g.prototype.stub=function(e){for(var t=new Array(e),r=0;r<e;r++)t[r]=0;return t},g.prototype.mulp=function(e,t,r){var n=2*this.guessLen13b(e.length,t.length),i=this.makeRBT(n),o=this.stub(n),s=new Array(n),a=new Array(n),c=new Array(n),u=new Array(n),l=new Array(n),h=new Array(n),d=r.words;d.length=n,this.convert13b(e.words,e.length,s,n),this.convert13b(t.words,t.length,u,n),this.transform(s,o,a,c,n,i),this.transform(u,o,l,h,n,i);for(var f=0;f<n;f++){var p=a[f]*l[f]-c[f]*h[f];c[f]=a[f]*h[f]+c[f]*l[f],a[f]=p}return this.conjugate(a,c,n),this.transform(a,c,d,o,n,i),this.conjugate(d,o,n),this.normalize13b(d,n),r.negative=e.negative^t.negative,r.length=e.length+t.length,r.strip()},o.prototype.mul=function(e){var t=new o(null);return t.words=new Array(this.length+e.length),this.mulTo(e,t)},o.prototype.mulf=function(e){var t=new o(null);return t.words=new Array(this.length+e.length),m(this,e,t)},o.prototype.imul=function(e){return this.clone().mulTo(e,this)},o.prototype.imuln=function(e){n("number"==typeof e),n(e<67108864);for(var t=0,r=0;r<this.length;r++){var i=(0|this.words[r])*e,o=(67108863&i)+(67108863&t);t>>=26,t+=i/67108864|0,t+=o>>>26,this.words[r]=67108863&o}return 0!==t&&(this.words[r]=t,this.length++),this},o.prototype.muln=function(e){return this.clone().imuln(e)},o.prototype.sqr=function(){return this.mul(this)},o.prototype.isqr=function(){return this.imul(this.clone())},o.prototype.pow=function(e){var t=function(e){for(var t=new Array(e.bitLength()),r=0;r<t.length;r++){var n=r/26|0,i=r%26;t[r]=(e.words[n]&1<<i)>>>i}return t}(e);if(0===t.length)return new o(1);for(var r=this,n=0;n<t.length&&0===t[n];n++,r=r.sqr());if(++n<t.length)for(var i=r.sqr();n<t.length;n++,i=i.sqr())0!==t[n]&&(r=r.mul(i));return r},o.prototype.iushln=function(e){n("number"==typeof e&&e>=0);var t,r=e%26,i=(e-r)/26,o=67108863>>>26-r<<26-r;if(0!==r){var s=0;for(t=0;t<this.length;t++){var a=this.words[t]&o,c=(0|this.words[t])-a<<r;this.words[t]=c|s,s=a>>>26-r}s&&(this.words[t]=s,this.length++)}if(0!==i){for(t=this.length-1;t>=0;t--)this.words[t+i]=this.words[t];for(t=0;t<i;t++)this.words[t]=0;this.length+=i}return this.strip()},o.prototype.ishln=function(e){return n(0===this.negative),this.iushln(e)},o.prototype.iushrn=function(e,t,r){var i;n("number"==typeof e&&e>=0),i=t?(t-t%26)/26:0;var o=e%26,s=Math.min((e-o)/26,this.length),a=67108863^67108863>>>o<<o,c=r;if(i-=s,i=Math.max(0,i),c){for(var u=0;u<s;u++)c.words[u]=this.words[u];c.length=s}if(0===s);else if(this.length>s)for(this.length-=s,u=0;u<this.length;u++)this.words[u]=this.words[u+s];else this.words[0]=0,this.length=1;var l=0;for(u=this.length-1;u>=0&&(0!==l||u>=i);u--){var h=0|this.words[u];this.words[u]=l<<26-o|h>>>o,l=h&a}return c&&0!==l&&(c.words[c.length++]=l),0===this.length&&(this.words[0]=0,this.length=1),this.strip()},o.prototype.ishrn=function(e,t,r){return n(0===this.negative),this.iushrn(e,t,r)},o.prototype.shln=function(e){return this.clone().ishln(e)},o.prototype.ushln=function(e){return this.clone().iushln(e)},o.prototype.shrn=function(e){return this.clone().ishrn(e)},o.prototype.ushrn=function(e){return this.clone().iushrn(e)},o.prototype.testn=function(e){n("number"==typeof e&&e>=0);var t=e%26,r=(e-t)/26,i=1<<t;return!(this.length<=r)&&!!(this.words[r]&i)},o.prototype.imaskn=function(e){n("number"==typeof e&&e>=0);var t=e%26,r=(e-t)/26;if(n(0===this.negative,"imaskn works only with positive numbers"),this.length<=r)return this;if(0!==t&&r++,this.length=Math.min(r,this.length),0!==t){var i=67108863^67108863>>>t<<t;this.words[this.length-1]&=i}return this.strip()},o.prototype.maskn=function(e){return this.clone().imaskn(e)},o.prototype.iaddn=function(e){return n("number"==typeof e),n(e<67108864),e<0?this.isubn(-e):0!==this.negative?1===this.length&&(0|this.words[0])<e?(this.words[0]=e-(0|this.words[0]),this.negative=0,this):(this.negative=0,this.isubn(e),this.negative=1,this):this._iaddn(e)},o.prototype._iaddn=function(e){this.words[0]+=e;for(var t=0;t<this.length&&this.words[t]>=67108864;t++)this.words[t]-=67108864,t===this.length-1?this.words[t+1]=1:this.words[t+1]++;return this.length=Math.max(this.length,t+1),this},o.prototype.isubn=function(e){if(n("number"==typeof e),n(e<67108864),e<0)return this.iaddn(-e);if(0!==this.negative)return this.negative=0,this.iaddn(e),this.negative=1,this;if(this.words[0]-=e,1===this.length&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var t=0;t<this.length&&this.words[t]<0;t++)this.words[t]+=67108864,this.words[t+1]-=1;return this.strip()},o.prototype.addn=function(e){return this.clone().iaddn(e)},o.prototype.subn=function(e){return this.clone().isubn(e)},o.prototype.iabs=function(){return this.negative=0,this},o.prototype.abs=function(){return this.clone().iabs()},o.prototype._ishlnsubmul=function(e,t,r){var i,o,s=e.length+r;this._expand(s);var a=0;for(i=0;i<e.length;i++){o=(0|this.words[i+r])+a;var c=(0|e.words[i])*t;a=((o-=67108863&c)>>26)-(c/67108864|0),this.words[i+r]=67108863&o}for(;i<this.length-r;i++)a=(o=(0|this.words[i+r])+a)>>26,this.words[i+r]=67108863&o;if(0===a)return this.strip();for(n(-1===a),a=0,i=0;i<this.length;i++)a=(o=-(0|this.words[i])+a)>>26,this.words[i]=67108863&o;return this.negative=1,this.strip()},o.prototype._wordDiv=function(e,t){var r=(this.length,e.length),n=this.clone(),i=e,s=0|i.words[i.length-1];0!==(r=26-this._countBits(s))&&(i=i.ushln(r),n.iushln(r),s=0|i.words[i.length-1]);var a,c=n.length-i.length;if("mod"!==t){(a=new o(null)).length=c+1,a.words=new Array(a.length);for(var u=0;u<a.length;u++)a.words[u]=0}var l=n.clone()._ishlnsubmul(i,1,c);0===l.negative&&(n=l,a&&(a.words[c]=1));for(var h=c-1;h>=0;h--){var d=67108864*(0|n.words[i.length+h])+(0|n.words[i.length+h-1]);for(d=Math.min(d/s|0,67108863),n._ishlnsubmul(i,d,h);0!==n.negative;)d--,n.negative=0,n._ishlnsubmul(i,1,h),n.isZero()||(n.negative^=1);a&&(a.words[h]=d)}return a&&a.strip(),n.strip(),"div"!==t&&0!==r&&n.iushrn(r),{div:a||null,mod:n}},o.prototype.divmod=function(e,t,r){return n(!e.isZero()),this.isZero()?{div:new o(0),mod:new o(0)}:0!==this.negative&&0===e.negative?(a=this.neg().divmod(e,t),"mod"!==t&&(i=a.div.neg()),"div"!==t&&(s=a.mod.neg(),r&&0!==s.negative&&s.iadd(e)),{div:i,mod:s}):0===this.negative&&0!==e.negative?(a=this.divmod(e.neg(),t),"mod"!==t&&(i=a.div.neg()),{div:i,mod:a.mod}):0!=(this.negative&e.negative)?(a=this.neg().divmod(e.neg(),t),"div"!==t&&(s=a.mod.neg(),r&&0!==s.negative&&s.isub(e)),{div:a.div,mod:s}):e.length>this.length||this.cmp(e)<0?{div:new o(0),mod:this}:1===e.length?"div"===t?{div:this.divn(e.words[0]),mod:null}:"mod"===t?{div:null,mod:new o(this.modn(e.words[0]))}:{div:this.divn(e.words[0]),mod:new o(this.modn(e.words[0]))}:this._wordDiv(e,t);var i,s,a},o.prototype.div=function(e){return this.divmod(e,"div",!1).div},o.prototype.mod=function(e){return this.divmod(e,"mod",!1).mod},o.prototype.umod=function(e){return this.divmod(e,"mod",!0).mod},o.prototype.divRound=function(e){var t=this.divmod(e);if(t.mod.isZero())return t.div;var r=0!==t.div.negative?t.mod.isub(e):t.mod,n=e.ushrn(1),i=e.andln(1),o=r.cmp(n);return o<0||1===i&&0===o?t.div:0!==t.div.negative?t.div.isubn(1):t.div.iaddn(1)},o.prototype.modn=function(e){n(e<=67108863);for(var t=(1<<26)%e,r=0,i=this.length-1;i>=0;i--)r=(t*r+(0|this.words[i]))%e;return r},o.prototype.idivn=function(e){n(e<=67108863);for(var t=0,r=this.length-1;r>=0;r--){var i=(0|this.words[r])+67108864*t;this.words[r]=i/e|0,t=i%e}return this.strip()},o.prototype.divn=function(e){return this.clone().idivn(e)},o.prototype.egcd=function(e){n(0===e.negative),n(!e.isZero());var t=this,r=e.clone();t=0!==t.negative?t.umod(e):t.clone();for(var i=new o(1),s=new o(0),a=new o(0),c=new o(1),u=0;t.isEven()&&r.isEven();)t.iushrn(1),r.iushrn(1),++u;for(var l=r.clone(),h=t.clone();!t.isZero();){for(var d=0,f=1;0==(t.words[0]&f)&&d<26;++d,f<<=1);if(d>0)for(t.iushrn(d);d-- >0;)(i.isOdd()||s.isOdd())&&(i.iadd(l),s.isub(h)),i.iushrn(1),s.iushrn(1);for(var p=0,m=1;0==(r.words[0]&m)&&p<26;++p,m<<=1);if(p>0)for(r.iushrn(p);p-- >0;)(a.isOdd()||c.isOdd())&&(a.iadd(l),c.isub(h)),a.iushrn(1),c.iushrn(1);t.cmp(r)>=0?(t.isub(r),i.isub(a),s.isub(c)):(r.isub(t),a.isub(i),c.isub(s))}return{a,b:c,gcd:r.iushln(u)}},o.prototype._invmp=function(e){n(0===e.negative),n(!e.isZero());var t=this,r=e.clone();t=0!==t.negative?t.umod(e):t.clone();for(var i,s=new o(1),a=new o(0),c=r.clone();t.cmpn(1)>0&&r.cmpn(1)>0;){for(var u=0,l=1;0==(t.words[0]&l)&&u<26;++u,l<<=1);if(u>0)for(t.iushrn(u);u-- >0;)s.isOdd()&&s.iadd(c),s.iushrn(1);for(var h=0,d=1;0==(r.words[0]&d)&&h<26;++h,d<<=1);if(h>0)for(r.iushrn(h);h-- >0;)a.isOdd()&&a.iadd(c),a.iushrn(1);t.cmp(r)>=0?(t.isub(r),s.isub(a)):(r.isub(t),a.isub(s))}return(i=0===t.cmpn(1)?s:a).cmpn(0)<0&&i.iadd(e),i},o.prototype.gcd=function(e){if(this.isZero())return e.abs();if(e.isZero())return this.abs();var t=this.clone(),r=e.clone();t.negative=0,r.negative=0;for(var n=0;t.isEven()&&r.isEven();n++)t.iushrn(1),r.iushrn(1);for(;;){for(;t.isEven();)t.iushrn(1);for(;r.isEven();)r.iushrn(1);var i=t.cmp(r);if(i<0){var o=t;t=r,r=o}else if(0===i||0===r.cmpn(1))break;t.isub(r)}return r.iushln(n)},o.prototype.invm=function(e){return this.egcd(e).a.umod(e)},o.prototype.isEven=function(){return 0==(1&this.words[0])},o.prototype.isOdd=function(){return 1==(1&this.words[0])},o.prototype.andln=function(e){return this.words[0]&e},o.prototype.bincn=function(e){n("number"==typeof e);var t=e%26,r=(e-t)/26,i=1<<t;if(this.length<=r)return this._expand(r+1),this.words[r]|=i,this;for(var o=i,s=r;0!==o&&s<this.length;s++){var a=0|this.words[s];o=(a+=o)>>>26,a&=67108863,this.words[s]=a}return 0!==o&&(this.words[s]=o,this.length++),this},o.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},o.prototype.cmpn=function(e){var t,r=e<0;if(0!==this.negative&&!r)return-1;if(0===this.negative&&r)return 1;if(this.strip(),this.length>1)t=1;else{r&&(e=-e),n(e<=67108863,"Number is too big");var i=0|this.words[0];t=i===e?0:i<e?-1:1}return 0!==this.negative?0|-t:t},o.prototype.cmp=function(e){if(0!==this.negative&&0===e.negative)return-1;if(0===this.negative&&0!==e.negative)return 1;var t=this.ucmp(e);return 0!==this.negative?0|-t:t},o.prototype.ucmp=function(e){if(this.length>e.length)return 1;if(this.length<e.length)return-1;for(var t=0,r=this.length-1;r>=0;r--){var n=0|this.words[r],i=0|e.words[r];if(n!==i){n<i?t=-1:n>i&&(t=1);break}}return t},o.prototype.gtn=function(e){return 1===this.cmpn(e)},o.prototype.gt=function(e){return 1===this.cmp(e)},o.prototype.gten=function(e){return this.cmpn(e)>=0},o.prototype.gte=function(e){return this.cmp(e)>=0},o.prototype.ltn=function(e){return-1===this.cmpn(e)},o.prototype.lt=function(e){return-1===this.cmp(e)},o.prototype.lten=function(e){return this.cmpn(e)<=0},o.prototype.lte=function(e){return this.cmp(e)<=0},o.prototype.eqn=function(e){return 0===this.cmpn(e)},o.prototype.eq=function(e){return 0===this.cmp(e)},o.red=function(e){return new S(e)},o.prototype.toRed=function(e){return n(!this.red,"Already a number in reduction context"),n(0===this.negative,"red works only with positives"),e.convertTo(this)._forceRed(e)},o.prototype.fromRed=function(){return n(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},o.prototype._forceRed=function(e){return this.red=e,this},o.prototype.forceRed=function(e){return n(!this.red,"Already a number in reduction context"),this._forceRed(e)},o.prototype.redAdd=function(e){return n(this.red,"redAdd works only with red numbers"),this.red.add(this,e)},o.prototype.redIAdd=function(e){return n(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,e)},o.prototype.redSub=function(e){return n(this.red,"redSub works only with red numbers"),this.red.sub(this,e)},o.prototype.redISub=function(e){return n(this.red,"redISub works only with red numbers"),this.red.isub(this,e)},o.prototype.redShl=function(e){return n(this.red,"redShl works only with red numbers"),this.red.shl(this,e)},o.prototype.redMul=function(e){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.mul(this,e)},o.prototype.redIMul=function(e){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.imul(this,e)},o.prototype.redSqr=function(){return n(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},o.prototype.redISqr=function(){return n(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},o.prototype.redSqrt=function(){return n(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},o.prototype.redInvm=function(){return n(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},o.prototype.redNeg=function(){return n(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},o.prototype.redPow=function(e){return n(this.red&&!e.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,e)};var y={k256:null,p224:null,p192:null,p25519:null};function b(e,t){this.name=e,this.p=new o(t,16),this.n=this.p.bitLength(),this.k=new o(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function v(){b.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function w(){b.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function x(){b.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function k(){b.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function S(e){if("string"==typeof e){var t=o._prime(e);this.m=t.p,this.prime=t}else n(e.gtn(1),"modulus must be greater than 1"),this.m=e,this.prime=null}function E(e){S.call(this,e),this.shift=this.m.bitLength(),this.shift%26!=0&&(this.shift+=26-this.shift%26),this.r=new o(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}b.prototype._tmp=function(){var e=new o(null);return e.words=new Array(Math.ceil(this.n/13)),e},b.prototype.ireduce=function(e){var t,r=e;do{this.split(r,this.tmp),t=(r=(r=this.imulK(r)).iadd(this.tmp)).bitLength()}while(t>this.n);var n=t<this.n?-1:r.ucmp(this.p);return 0===n?(r.words[0]=0,r.length=1):n>0?r.isub(this.p):void 0!==r.strip?r.strip():r._strip(),r},b.prototype.split=function(e,t){e.iushrn(this.n,0,t)},b.prototype.imulK=function(e){return e.imul(this.k)},i(v,b),v.prototype.split=function(e,t){for(var r=4194303,n=Math.min(e.length,9),i=0;i<n;i++)t.words[i]=e.words[i];if(t.length=n,e.length<=9)return e.words[0]=0,void(e.length=1);var o=e.words[9];for(t.words[t.length++]=o&r,i=10;i<e.length;i++){var s=0|e.words[i];e.words[i-10]=(s&r)<<4|o>>>22,o=s}o>>>=22,e.words[i-10]=o,0===o&&e.length>10?e.length-=10:e.length-=9},v.prototype.imulK=function(e){e.words[e.length]=0,e.words[e.length+1]=0,e.length+=2;for(var t=0,r=0;r<e.length;r++){var n=0|e.words[r];t+=977*n,e.words[r]=67108863&t,t=64*n+(t/67108864|0)}return 0===e.words[e.length-1]&&(e.length--,0===e.words[e.length-1]&&e.length--),e},i(w,b),i(x,b),i(k,b),k.prototype.imulK=function(e){for(var t=0,r=0;r<e.length;r++){var n=19*(0|e.words[r])+t,i=67108863&n;n>>>=26,e.words[r]=i,t=n}return 0!==t&&(e.words[e.length++]=t),e},o._prime=function(e){if(y[e])return y[e];var t;if("k256"===e)t=new v;else if("p224"===e)t=new w;else if("p192"===e)t=new x;else{if("p25519"!==e)throw new Error("Unknown prime "+e);t=new k}return y[e]=t,t},S.prototype._verify1=function(e){n(0===e.negative,"red works only with positives"),n(e.red,"red works only with red numbers")},S.prototype._verify2=function(e,t){n(0==(e.negative|t.negative),"red works only with positives"),n(e.red&&e.red===t.red,"red works only with red numbers")},S.prototype.imod=function(e){return this.prime?this.prime.ireduce(e)._forceRed(this):e.umod(this.m)._forceRed(this)},S.prototype.neg=function(e){return e.isZero()?e.clone():this.m.sub(e)._forceRed(this)},S.prototype.add=function(e,t){this._verify2(e,t);var r=e.add(t);return r.cmp(this.m)>=0&&r.isub(this.m),r._forceRed(this)},S.prototype.iadd=function(e,t){this._verify2(e,t);var r=e.iadd(t);return r.cmp(this.m)>=0&&r.isub(this.m),r},S.prototype.sub=function(e,t){this._verify2(e,t);var r=e.sub(t);return r.cmpn(0)<0&&r.iadd(this.m),r._forceRed(this)},S.prototype.isub=function(e,t){this._verify2(e,t);var r=e.isub(t);return r.cmpn(0)<0&&r.iadd(this.m),r},S.prototype.shl=function(e,t){return this._verify1(e),this.imod(e.ushln(t))},S.prototype.imul=function(e,t){return this._verify2(e,t),this.imod(e.imul(t))},S.prototype.mul=function(e,t){return this._verify2(e,t),this.imod(e.mul(t))},S.prototype.isqr=function(e){return this.imul(e,e.clone())},S.prototype.sqr=function(e){return this.mul(e,e)},S.prototype.sqrt=function(e){if(e.isZero())return e.clone();var t=this.m.andln(3);if(n(t%2==1),3===t){var r=this.m.add(new o(1)).iushrn(2);return this.pow(e,r)}for(var i=this.m.subn(1),s=0;!i.isZero()&&0===i.andln(1);)s++,i.iushrn(1);n(!i.isZero());var a=new o(1).toRed(this),c=a.redNeg(),u=this.m.subn(1).iushrn(1),l=this.m.bitLength();for(l=new o(2*l*l).toRed(this);0!==this.pow(l,u).cmp(c);)l.redIAdd(c);for(var h=this.pow(l,i),d=this.pow(e,i.addn(1).iushrn(1)),f=this.pow(e,i),p=s;0!==f.cmp(a);){for(var m=f,g=0;0!==m.cmp(a);g++)m=m.redSqr();n(g<p);var y=this.pow(h,new o(1).iushln(p-g-1));d=d.redMul(y),h=y.redSqr(),f=f.redMul(h),p=g}return d},S.prototype.invm=function(e){var t=e._invmp(this.m);return 0!==t.negative?(t.negative=0,this.imod(t).redNeg()):this.imod(t)},S.prototype.pow=function(e,t){if(t.isZero())return new o(1).toRed(this);if(0===t.cmpn(1))return e.clone();var r=new Array(16);r[0]=new o(1).toRed(this),r[1]=e;for(var n=2;n<r.length;n++)r[n]=this.mul(r[n-1],e);var i=r[0],s=0,a=0,c=t.bitLength()%26;for(0===c&&(c=26),n=t.length-1;n>=0;n--){for(var u=t.words[n],l=c-1;l>=0;l--){var h=u>>l&1;i!==r[0]&&(i=this.sqr(i)),0!==h||0!==s?(s<<=1,s|=h,(4===++a||0===n&&0===l)&&(i=this.mul(i,r[s]),a=0,s=0)):a=0}c=26}return i},S.prototype.convertTo=function(e){var t=e.umod(this.m);return t===e?t.clone():t},S.prototype.convertFrom=function(e){var t=e.clone();return t.red=null,t},o.mont=function(e){return new E(e)},i(E,S),E.prototype.convertTo=function(e){return this.imod(e.ushln(this.shift))},E.prototype.convertFrom=function(e){var t=this.imod(e.mul(this.rinv));return t.red=null,t},E.prototype.imul=function(e,t){if(e.isZero()||t.isZero())return e.words[0]=0,e.length=1,e;var r=e.imul(t),n=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),i=r.isub(n).iushrn(this.shift),o=i;return i.cmp(this.m)>=0?o=i.isub(this.m):i.cmpn(0)<0&&(o=i.iadd(this.m)),o._forceRed(this)},E.prototype.mul=function(e,t){if(e.isZero()||t.isZero())return new o(0)._forceRed(this);var r=e.mul(t),n=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),i=r.isub(n).iushrn(this.shift),s=i;return i.cmp(this.m)>=0?s=i.isub(this.m):i.cmpn(0)<0&&(s=i.iadd(this.m)),s._forceRed(this)},E.prototype.invm=function(e){return this.imod(e._invmp(this.m).mul(this.r2))._forceRed(this)}}(e=r.nmd(e),this)},81647:(e,t,r)=>{"use strict";r.d(t,{c:()=>h});var n=r(71507);let i;const o=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),s=e=>{if(void 0===i){const t=void 0!==e.style.animationName,r=void 0!==e.style.webkitAnimationName;i=!t&&r?"-webkit-":""}return i},a=(e,t,r)=>{const n=t.startsWith("animation")?s(e):"";e.style.setProperty(n+t,r)},c=(e,t)=>{const r=t.startsWith("animation")?s(e):"";e.style.removeProperty(r+t)},u=[],l=(e=[],t)=>{if(void 0!==t){const r=Array.isArray(t)?t:[t];return[...e,...r]}return e},h=e=>{let t,r,i,h,d,f,p,m,g,y,b,v,w,x=[],k=[],S=[],E=!1,A={},N=[],T=[],P={},M=0,I=!1,C=!1,R=!0,B=!1,O=!0,L=!1;const z=e,U=[],_=[],q=[],D=[],V=[],j=[],F=[],H=[],W=[],K=[],X="function"==typeof AnimationEffect||"function"==typeof window.AnimationEffect,G="function"==typeof Element&&"function"==typeof Element.prototype.animate&&X,Z=()=>K,J=e=>{$(),e&&ee()},Y=(e,t)=>(((null==t?void 0:t.oneTimeCallback)?_:U).push({c:e,o:t}),w),Q=()=>(U.length=0,_.length=0,w),$=()=>{if(G)K.forEach((e=>{e.cancel()})),K.length=0;else{const e=q.slice();(0,n.r)((()=>{e.forEach((e=>{c(e,"animation-name"),c(e,"animation-duration"),c(e,"animation-timing-function"),c(e,"animation-iteration-count"),c(e,"animation-delay"),c(e,"animation-play-state"),c(e,"animation-fill-mode"),c(e,"animation-direction")}))}))}},ee=()=>{V.forEach((e=>{(null==e?void 0:e.parentNode)&&e.parentNode.removeChild(e)})),V.length=0},te=()=>void 0!==d?d:p?p.getFill():"both",re=()=>void 0!==g?g:void 0!==f?f:p?p.getDirection():"normal",ne=()=>I?"linear":void 0!==i?i:p?p.getEasing():"linear",ie=()=>C?0:void 0!==y?y:void 0!==r?r:p?p.getDuration():0,oe=()=>void 0!==h?h:p?p.getIterations():1,se=()=>void 0!==b?b:void 0!==t?t:p?p.getDelay():0,ae=e=>{G?Z().forEach((t=>{if(t.effect.setKeyframes)t.effect.setKeyframes(e);else{const r=new KeyframeEffect(t.effect.target,e,t.effect.getTiming());t.effect=r}})):ue()},ce=()=>{0!==M&&(M--,0===M&&((()=>{ye(),H.forEach((e=>e())),W.forEach((e=>e()));const e=R?1:0,t=N,r=T,n=P;q.forEach((e=>{const i=e.classList;t.forEach((e=>i.add(e))),r.forEach((e=>i.remove(e)));for(const t in n)n.hasOwnProperty(t)&&a(e,t,n[t])})),U.forEach((t=>t.c(e,w))),_.forEach((t=>t.c(e,w))),_.length=0,O=!0,R&&(B=!0),R=!0})(),p&&p.animationFinish()))},ue=(t=!0)=>{ee();const r=(e=>(e.forEach((e=>{for(const t in e)if(e.hasOwnProperty(t)){const r=e[t];if("easing"===t)e["animation-timing-function"]=r,delete e[t];else{const n=o(t);n!==t&&(e[n]=r,delete e[t])}}})),e))(x);q.forEach((i=>{if(r.length>0){const o=((e=[])=>e.map((e=>{const t=e.offset,r=[];for(const n in e)e.hasOwnProperty(n)&&"offset"!==n&&r.push(`${n}: ${e[n]};`);return`${100*t}% { ${r.join(" ")} }`})).join(" "))(r);v=void 0!==e?e:(e=>{let t=u.indexOf(e);return t<0&&(t=u.push(e)-1),`ion-animation-${t}`})(o);const c=((e,t,r)=>{const n=(e=>{const t=e.getRootNode();return t.head||t})(r),i=s(r),o=n.querySelector("#"+e);if(o)return o;const a=(r.ownerDocument||document).createElement("style");return a.id=e,a.textContent=`@${i}keyframes ${e} { ${t} } @${i}keyframes ${e}-alt { ${t} }`,n.appendChild(a),a})(v,o,i);V.push(c),a(i,"animation-duration",`${ie()}ms`),a(i,"animation-timing-function",ne()),a(i,"animation-delay",`${se()}ms`),a(i,"animation-fill-mode",te()),a(i,"animation-direction",re());const l=oe()===1/0?"infinite":oe().toString();a(i,"animation-iteration-count",l),a(i,"animation-play-state","paused"),t&&a(i,"animation-name",`${c.id}-alt`),(0,n.r)((()=>{a(i,"animation-name",c.id||null)}))}}))},le=(e=!0)=>{(()=>{j.forEach((e=>e())),F.forEach((e=>e()));const e=k,t=S,r=A;q.forEach((n=>{const i=n.classList;e.forEach((e=>i.add(e))),t.forEach((e=>i.remove(e)));for(const e in r)r.hasOwnProperty(e)&&a(n,e,r[e])}))})(),x.length>0&&(G?(q.forEach((e=>{const t=e.animate(x,{id:z,delay:se(),duration:ie(),easing:ne(),iterations:oe(),fill:te(),direction:re()});t.pause(),K.push(t)})),K.length>0&&(K[0].onfinish=()=>{ce()})):ue(e)),E=!0},he=e=>{if(e=Math.min(Math.max(e,0),.9999),G)K.forEach((t=>{t.currentTime=t.effect.getComputedTiming().delay+ie()*e,t.pause()}));else{const t=`-${ie()*e}ms`;q.forEach((e=>{x.length>0&&(a(e,"animation-delay",t),a(e,"animation-play-state","paused"))}))}},de=e=>{K.forEach((e=>{e.effect.updateTiming({delay:se(),duration:ie(),easing:ne(),iterations:oe(),fill:te(),direction:re()})})),void 0!==e&&he(e)},fe=(e=!0,t)=>{(0,n.r)((()=>{q.forEach((r=>{a(r,"animation-name",v||null),a(r,"animation-duration",`${ie()}ms`),a(r,"animation-timing-function",ne()),a(r,"animation-delay",void 0!==t?`-${t*ie()}ms`:`${se()}ms`),a(r,"animation-fill-mode",te()||null),a(r,"animation-direction",re()||null);const i=oe()===1/0?"infinite":oe().toString();a(r,"animation-iteration-count",i),e&&a(r,"animation-name",`${v}-alt`),(0,n.r)((()=>{a(r,"animation-name",v||null)}))}))}))},pe=(e=!1,t=!0,r)=>(e&&D.forEach((n=>{n.update(e,t,r)})),G?de(r):fe(t,r),w),me=()=>{E&&(G?K.forEach((e=>{e.pause()})):q.forEach((e=>{a(e,"animation-play-state","paused")})),L=!0)},ge=()=>{m=void 0,ce()},ye=()=>{m&&clearTimeout(m)},be=()=>{q.forEach((e=>{c(e,"animation-duration"),c(e,"animation-delay"),c(e,"animation-play-state")}))},ve=e=>new Promise((t=>{(null==e?void 0:e.sync)&&(C=!0,Y((()=>C=!1),{oneTimeCallback:!0})),E||le(),B&&(G?(he(0),de()):fe(),B=!1),O&&(M=D.length+1,O=!1),Y((()=>t()),{oneTimeCallback:!0}),D.forEach((e=>{e.play()})),G?(K.forEach((e=>{e.play()})),0!==x.length&&0!==q.length||ce()):(()=>{if(ye(),(0,n.r)((()=>{q.forEach((e=>{x.length>0&&a(e,"animation-play-state","running")}))})),0===x.length||0===q.length)ce();else{const e=se()||0,t=ie()||0,r=oe()||1;isFinite(r)&&(m=setTimeout(ge,e+t*r+100)),((e,t)=>{let r;const n={passive:!0},i=()=>{r&&r()},o=r=>{e===r.target&&(i(),t(r))};e&&(e.addEventListener("webkitAnimationEnd",o,n),e.addEventListener("animationend",o,n),r=()=>{e.removeEventListener("webkitAnimationEnd",o,n),e.removeEventListener("animationend",o,n)})})(q[0],(()=>{ye(),(0,n.r)((()=>{be(),(0,n.r)(ce)}))}))}})(),L=!1})),we=(e,t)=>{const r=x[0];return void 0===r||void 0!==r.offset&&0!==r.offset?x=[{offset:0,[e]:t},...x]:r[e]=t,w};return w={parentAnimation:p,elements:q,childAnimations:D,id:z,animationFinish:ce,from:we,to:(e,t)=>{const r=x[x.length-1];return void 0===r||void 0!==r.offset&&1!==r.offset?x=[...x,{offset:1,[e]:t}]:r[e]=t,w},fromTo:(e,t,r)=>we(e,t).to(e,r),parent:e=>(p=e,w),play:ve,pause:()=>(D.forEach((e=>{e.pause()})),me(),w),stop:()=>{D.forEach((e=>{e.stop()})),E&&($(),E=!1),I=!1,C=!1,O=!0,g=void 0,y=void 0,b=void 0,M=0,B=!1,R=!0,L=!1},destroy:e=>(D.forEach((t=>{t.destroy(e)})),J(e),q.length=0,D.length=0,x.length=0,Q(),E=!1,O=!0,w),keyframes:e=>{const t=x!==e;return x=e,t&&ae(x),w},addAnimation:e=>{if(null!=e)if(Array.isArray(e))for(const t of e)t.parent(w),D.push(t);else e.parent(w),D.push(e);return w},addElement:e=>{if(null!=e)if(1===e.nodeType)q.push(e);else if(e.length>=0)for(let t=0;t<e.length;t++)q.push(e[t]);else console.error("Invalid addElement value");return w},update:pe,fill:e=>(d=e,pe(!0),w),direction:e=>(f=e,pe(!0),w),iterations:e=>(h=e,pe(!0),w),duration:e=>(G||0!==e||(e=1),r=e,pe(!0),w),easing:e=>(i=e,pe(!0),w),delay:e=>(t=e,pe(!0),w),getWebAnimations:Z,getKeyframes:()=>x,getFill:te,getDirection:re,getDelay:se,getIterations:oe,getEasing:ne,getDuration:ie,afterAddRead:e=>(H.push(e),w),afterAddWrite:e=>(W.push(e),w),afterClearStyles:(e=[])=>{for(const t of e)P[t]="";return w},afterStyles:(e={})=>(P=e,w),afterRemoveClass:e=>(T=l(T,e),w),afterAddClass:e=>(N=l(N,e),w),beforeAddRead:e=>(j.push(e),w),beforeAddWrite:e=>(F.push(e),w),beforeClearStyles:(e=[])=>{for(const t of e)A[t]="";return w},beforeStyles:(e={})=>(A=e,w),beforeRemoveClass:e=>(S=l(S,e),w),beforeAddClass:e=>(k=l(k,e),w),onFinish:Y,isRunning:()=>0!==M&&!L,progressStart:(e=!1,t)=>(D.forEach((r=>{r.progressStart(e,t)})),me(),I=e,E||le(),pe(!1,!0,t),w),progressStep:e=>(D.forEach((t=>{t.progressStep(e)})),he(e),w),progressEnd:(e,t,r)=>(I=!1,D.forEach((n=>{n.progressEnd(e,t,r)})),void 0!==r&&(y=r),B=!1,R=!0,0===e?(g="reverse"===re()?"normal":"reverse","reverse"===g&&(R=!1),G?(pe(),he(1-t)):(b=(1-t)*ie()*-1,pe(!1,!1))):1===e&&(G?(pe(),he(t)):(b=t*ie()*-1,pe(!1,!1))),void 0!==e&&(Y((()=>{y=void 0,g=void 0,b=void 0}),{oneTimeCallback:!0}),p||ve()),w)}}},71507:(e,t,r)=>{"use strict";r.d(t,{a:()=>o,b:()=>s,h:()=>c,i:()=>i,r:()=>a});const n=["role","aria-activedescendant","aria-atomic","aria-autocomplete","aria-braillelabel","aria-brailleroledescription","aria-busy","aria-checked","aria-colcount","aria-colindex","aria-colindextext","aria-colspan","aria-controls","aria-current","aria-describedby","aria-description","aria-details","aria-disabled","aria-errormessage","aria-expanded","aria-flowto","aria-haspopup","aria-hidden","aria-invalid","aria-keyshortcuts","aria-label","aria-labelledby","aria-level","aria-live","aria-multiline","aria-multiselectable","aria-orientation","aria-owns","aria-placeholder","aria-posinset","aria-pressed","aria-readonly","aria-relevant","aria-required","aria-roledescription","aria-rowcount","aria-rowindex","aria-rowindextext","aria-rowspan","aria-selected","aria-setsize","aria-sort","aria-valuemax","aria-valuemin","aria-valuenow","aria-valuetext"],i=e=>((e,t=[])=>{const r={};return t.forEach((t=>{e.hasAttribute(t)&&(null!==e.getAttribute(t)&&(r[t]=e.getAttribute(t)),e.removeAttribute(t))})),r})(e,n),o=(e,t,r,n)=>{var i;if("undefined"!=typeof window){const o=window,s=null===(i=null==o?void 0:o.Ionic)||void 0===i?void 0:i.config;if(s){const i=s.get("_ael");if(i)return i(e,t,r,n);if(s._ael)return s._ael(e,t,r,n)}}return e.addEventListener(t,r,n)},s=(e,t,r,n)=>{var i;if("undefined"!=typeof window){const o=window,s=null===(i=null==o?void 0:o.Ionic)||void 0===i?void 0:i.config;if(s){const i=s.get("_rel");if(i)return i(e,t,r,n);if(s._rel)return s._rel(e,t,r,n)}}return e.removeEventListener(t,r,n)},a=e=>"function"==typeof __zone_symbol__requestAnimationFrame?__zone_symbol__requestAnimationFrame(e):"function"==typeof requestAnimationFrame?requestAnimationFrame(e):setTimeout(e),c=e=>!!e.shadowRoot&&!!e.attachShadow},76984:(e,t,r)=>{"use strict";r.d(t,{g:()=>n});r(22874),r(71507);const n=e=>{if(e.classList.contains("ion-page"))return e;const t=e.querySelector(":scope > .ion-page, :scope > ion-nav, :scope > ion-tabs");return t||e}},85413:(e,t,r)=>{"use strict";r.r(t),r.d(t,{iosTransitionAnimation:()=>h,shadow:()=>s});var n=r(81647),i=r(76984);const o=e=>document.querySelector(`${e}.ion-cloned-element`),s=e=>e.shadowRoot||e,a=e=>{const t="ION-TABS"===e.tagName?e:e.querySelector("ion-tabs"),r="ion-content ion-header:not(.header-collapse-condense-inactive) ion-title.title-large";if(null!=t){const e=t.querySelector("ion-tab:not(.tab-hidden), .ion-page:not(.ion-page-hidden)");return null!=e?e.querySelector(r):null}return e.querySelector(r)},c=(e,t)=>{const r="ION-TABS"===e.tagName?e:e.querySelector("ion-tabs");let n=[];if(null!=r){const e=r.querySelector("ion-tab:not(.tab-hidden), .ion-page:not(.ion-page-hidden)");null!=e&&(n=e.querySelectorAll("ion-buttons"))}else n=e.querySelectorAll("ion-buttons");for(const i of n){const e=i.closest("ion-header"),r=e&&!e.classList.contains("header-collapse-condense-inactive"),n=i.querySelector("ion-back-button"),o=i.classList.contains("buttons-collapse"),s="start"===i.slot||""===i.slot;if(null!==n&&s&&(o&&r&&t||!o))return n}return null},u=(e,t,r,i,a,c)=>{const u=t?`calc(100% - ${c.right+4}px)`:c.left-4+"px",l=t?"7px":"-7px",h=t?"-4px":"4px",d=t?"-4px":"4px",f=t?"right":"left",p=t?"left":"right",m=[{offset:0,opacity:0,transform:`translate3d(${l}, ${a.top-40}px, 0) scale(2.1)`},{offset:1,opacity:1,transform:`translate3d(${h}, ${c.top-46}px, 0) scale(1)`}],g=[{offset:0,opacity:1,transform:`translate3d(${h}, ${c.top-46}px, 0) scale(1)`},{offset:.6,opacity:0},{offset:1,opacity:0,transform:`translate3d(${l}, ${a.top-40}px, 0) scale(2.1)`}],y=r?g:m,b=[{offset:0,opacity:0,transform:`translate3d(${d}, ${c.top-41}px, 0) scale(0.6)`},{offset:1,opacity:1,transform:`translate3d(${d}, ${c.top-46}px, 0) scale(1)`}],v=[{offset:0,opacity:1,transform:`translate3d(${d}, ${c.top-46}px, 0) scale(1)`},{offset:.2,opacity:0,transform:`translate3d(${d}, ${c.top-41}px, 0) scale(0.6)`},{offset:1,opacity:0,transform:`translate3d(${d}, ${c.top-41}px, 0) scale(0.6)`}],w=r?v:b,x=(0,n.c)(),k=(0,n.c)(),S=o("ion-back-button"),E=s(S).querySelector(".button-text"),A=s(S).querySelector("ion-icon");S.text=i.text,S.mode=i.mode,S.icon=i.icon,S.color=i.color,S.disabled=i.disabled,S.style.setProperty("display","block"),S.style.setProperty("position","fixed"),k.addElement(A),x.addElement(E),x.beforeStyles({"transform-origin":`${f} center`}).beforeAddWrite((()=>{i.style.setProperty("display","none"),S.style.setProperty(f,u)})).afterAddWrite((()=>{i.style.setProperty("display",""),S.style.setProperty("display","none"),S.style.removeProperty(f)})).keyframes(y),k.beforeStyles({"transform-origin":`${p} center`}).keyframes(w),e.addAnimation([x,k])},l=(e,t,r,i,s,a)=>{const c=t?`calc(100% - ${s.right}px)`:`${s.left}px`,u=t?"-18px":"18px",l=t?"right":"left",h=[{offset:0,opacity:0,transform:`translate3d(${u}, ${a.top-4}px, 0) scale(0.49)`},{offset:.1,opacity:0},{offset:1,opacity:1,transform:`translate3d(0, ${s.top-2}px, 0) scale(1)`}],d=[{offset:0,opacity:.99,transform:`translate3d(0, ${s.top-2}px, 0) scale(1)`},{offset:.6,opacity:0},{offset:1,opacity:0,transform:`translate3d(${u}, ${a.top-4}px, 0) scale(0.5)`}],f=r?h:d,p=o("ion-title"),m=(0,n.c)();p.innerText=i.innerText,p.size=i.size,p.color=i.color,m.addElement(p),m.beforeStyles({"transform-origin":`${l} center`,height:"46px",display:"",position:"relative",[l]:c}).beforeAddWrite((()=>{i.style.setProperty("display","none")})).afterAddWrite((()=>{i.style.setProperty("display",""),p.style.setProperty("display","none")})).keyframes(f),e.addAnimation(m)},h=(e,t)=>{try{const r="cubic-bezier(0.32,0.72,0,1)",o="opacity",h="transform",d="0%",f=.8,p="rtl"===e.ownerDocument.dir,m=p?"-99.5%":"99.5%",g=p?"33%":"-33%",y=t.enteringEl,b=t.leavingEl,v="back"===t.direction,w=y.querySelector(":scope > ion-content"),x=y.querySelectorAll(":scope > ion-header > *:not(ion-toolbar), :scope > ion-footer > *"),k=y.querySelectorAll(":scope > ion-header > ion-toolbar"),S=(0,n.c)(),E=(0,n.c)();if(S.addElement(y).duration(t.duration||540).easing(t.easing||r).fill("both").beforeRemoveClass("ion-page-invisible"),b&&e){const t=(0,n.c)();t.addElement(e),S.addAnimation(t)}if(w||0!==k.length||0!==x.length?(E.addElement(w),E.addElement(x)):E.addElement(y.querySelector(":scope > .ion-page, :scope > ion-nav, :scope > ion-tabs")),S.addAnimation(E),v?E.beforeClearStyles([o]).fromTo("transform",`translateX(${g})`,`translateX(${d})`).fromTo(o,f,1):E.beforeClearStyles([o]).fromTo("transform",`translateX(${m})`,`translateX(${d})`),w){const e=s(w).querySelector(".transition-effect");if(e){const t=e.querySelector(".transition-cover"),r=e.querySelector(".transition-shadow"),i=(0,n.c)(),s=(0,n.c)(),a=(0,n.c)();i.addElement(e).beforeStyles({opacity:"1",display:"block"}).afterStyles({opacity:"",display:""}),s.addElement(t).beforeClearStyles([o]).fromTo(o,0,.1),a.addElement(r).beforeClearStyles([o]).fromTo(o,.03,.7),i.addAnimation([s,a]),E.addAnimation([i])}}const A=y.querySelector("ion-header.header-collapse-condense"),{forward:N,backward:T}=((e,t,r,n,i)=>{const o=c(n,r),s=a(i),h=a(n),d=c(i,r),f=null!==o&&null!==s&&!r,p=null!==h&&null!==d&&r;if(f){const n=s.getBoundingClientRect(),i=o.getBoundingClientRect();l(e,t,r,s,n,i),u(e,t,r,o,n,i)}else if(p){const n=h.getBoundingClientRect(),i=d.getBoundingClientRect();l(e,t,r,h,n,i),u(e,t,r,d,n,i)}return{forward:f,backward:p}})(S,p,v,y,b);if(k.forEach((e=>{const t=(0,n.c)();t.addElement(e),S.addAnimation(t);const r=(0,n.c)();r.addElement(e.querySelector("ion-title"));const i=(0,n.c)(),a=Array.from(e.querySelectorAll("ion-buttons,[menuToggle]")),c=e.closest("ion-header"),u=null==c?void 0:c.classList.contains("header-collapse-condense-inactive");let l;l=v?a.filter((e=>{const t=e.classList.contains("buttons-collapse");return t&&!u||!t})):a.filter((e=>!e.classList.contains("buttons-collapse"))),i.addElement(l);const h=(0,n.c)();h.addElement(e.querySelectorAll(":scope > *:not(ion-title):not(ion-buttons):not([menuToggle])"));const f=(0,n.c)();f.addElement(s(e).querySelector(".toolbar-background"));const y=(0,n.c)(),b=e.querySelector("ion-back-button");if(b&&y.addElement(b),t.addAnimation([r,i,h,f,y]),i.fromTo(o,.01,1),h.fromTo(o,.01,1),v)u||r.fromTo("transform",`translateX(${g})`,`translateX(${d})`).fromTo(o,.01,1),h.fromTo("transform",`translateX(${g})`,`translateX(${d})`),y.fromTo(o,.01,1);else{A||r.fromTo("transform",`translateX(${m})`,`translateX(${d})`).fromTo(o,.01,1),h.fromTo("transform",`translateX(${m})`,`translateX(${d})`),f.beforeClearStyles([o,"transform"]);if((null==c?void 0:c.translucent)?f.fromTo("transform",p?"translateX(-100%)":"translateX(100%)","translateX(0px)"):f.fromTo(o,.01,"var(--opacity)"),N||y.fromTo(o,.01,1),b&&!N){const e=(0,n.c)();e.addElement(s(b).querySelector(".button-text")).fromTo("transform",p?"translateX(-100px)":"translateX(100px)","translateX(0px)"),t.addAnimation(e)}}})),b){const e=(0,n.c)(),t=b.querySelector(":scope > ion-content"),r=b.querySelectorAll(":scope > ion-header > ion-toolbar"),a=b.querySelectorAll(":scope > ion-header > *:not(ion-toolbar), :scope > ion-footer > *");if(t||0!==r.length||0!==a.length?(e.addElement(t),e.addElement(a)):e.addElement(b.querySelector(":scope > .ion-page, :scope > ion-nav, :scope > ion-tabs")),S.addAnimation(e),v){e.beforeClearStyles([o]).fromTo("transform",`translateX(${d})`,p?"translateX(-100%)":"translateX(100%)");const t=(0,i.g)(b);S.afterAddWrite((()=>{"normal"===S.getDirection()&&t.style.setProperty("display","none")}))}else e.fromTo("transform",`translateX(${d})`,`translateX(${g})`).fromTo(o,1,f);if(t){const r=s(t).querySelector(".transition-effect");if(r){const t=r.querySelector(".transition-cover"),i=r.querySelector(".transition-shadow"),s=(0,n.c)(),a=(0,n.c)(),c=(0,n.c)();s.addElement(r).beforeStyles({opacity:"1",display:"block"}).afterStyles({opacity:"",display:""}),a.addElement(t).beforeClearStyles([o]).fromTo(o,.1,0),c.addElement(i).beforeClearStyles([o]).fromTo(o,.7,.03),s.addAnimation([a,c]),e.addAnimation([s])}}r.forEach((e=>{const t=(0,n.c)();t.addElement(e);const r=(0,n.c)();r.addElement(e.querySelector("ion-title"));const i=(0,n.c)(),a=e.querySelectorAll("ion-buttons,[menuToggle]"),c=e.closest("ion-header"),u=null==c?void 0:c.classList.contains("header-collapse-condense-inactive"),l=Array.from(a).filter((e=>{const t=e.classList.contains("buttons-collapse");return t&&!u||!t}));i.addElement(l);const f=(0,n.c)(),m=e.querySelectorAll(":scope > *:not(ion-title):not(ion-buttons):not([menuToggle])");m.length>0&&f.addElement(m);const y=(0,n.c)();y.addElement(s(e).querySelector(".toolbar-background"));const b=(0,n.c)(),w=e.querySelector("ion-back-button");if(w&&b.addElement(w),t.addAnimation([r,i,f,b,y]),S.addAnimation(t),b.fromTo(o,.99,0),i.fromTo(o,.99,0),f.fromTo(o,.99,0),v){u||r.fromTo("transform",`translateX(${d})`,p?"translateX(-100%)":"translateX(100%)").fromTo(o,.99,0),f.fromTo("transform",`translateX(${d})`,p?"translateX(-100%)":"translateX(100%)"),y.beforeClearStyles([o,"transform"]);if((null==c?void 0:c.translucent)?y.fromTo("transform","translateX(0px)",p?"translateX(-100%)":"translateX(100%)"):y.fromTo(o,"var(--opacity)",0),w&&!T){const e=(0,n.c)();e.addElement(s(w).querySelector(".button-text")).fromTo("transform",`translateX(${d})`,`translateX(${(p?-124:124)+"px"})`),t.addAnimation(e)}}else u||r.fromTo("transform",`translateX(${d})`,`translateX(${g})`).fromTo(o,.99,0).afterClearStyles([h,o]),f.fromTo("transform",`translateX(${d})`,`translateX(${g})`).afterClearStyles([h,o]),b.afterClearStyles([o]),r.afterClearStyles([o]),i.afterClearStyles([o])}))}return S}catch(r){throw r}}},82967:(e,t,r)=>{"use strict";r.r(t),r.d(t,{mdTransitionAnimation:()=>o});var n=r(81647),i=r(76984);const o=(e,t)=>{const r="back"===t.direction,o=t.enteringEl,s=t.leavingEl,a=(0,i.g)(o),c=a.querySelector("ion-toolbar"),u=(0,n.c)();if(u.addElement(a).fill("both").beforeRemoveClass("ion-page-invisible"),r?u.duration(t.duration||200).easing("cubic-bezier(0.47,0,0.745,0.715)"):u.duration(t.duration||280).easing("cubic-bezier(0.36,0.66,0.04,1)").fromTo("transform","translateY(40px)","translateY(0px)").fromTo("opacity",.01,1),c){const e=(0,n.c)();e.addElement(c),u.addAnimation(e)}if(s&&r){u.duration(t.duration||200).easing("cubic-bezier(0.47,0,0.745,0.715)");const e=(0,n.c)();e.addElement((0,i.g)(s)).onFinish((t=>{1===t&&e.elements.length>0&&e.elements[0].style.setProperty("display","none")})).fromTo("transform","translateY(0px)","translateY(40px)").fromTo("opacity",1,0),u.addAnimation(e)}return u}},45818:(e,t,r)=>{"use strict";var n={};r.r(n),r.d(n,{decode:()=>Ft,encode:()=>Dt});var i={};r.r(i),r.d(i,{AddressZero:()=>dr,EtherSymbol:()=>kr,HashZero:()=>xr,MaxInt256:()=>wr,MaxUint256:()=>br,MinInt256:()=>vr,NegativeOne:()=>fr,One:()=>mr,Two:()=>gr,WeiPerEther:()=>yr,Zero:()=>pr});var o={};r.r(o),r.d(o,{decode:()=>js,encode:()=>Fs});var s={};r.r(s),r.d(s,{AlchemyProvider:()=>nc,AlchemyWebSocketProvider:()=>rc,AnkrProvider:()=>ac,BaseProvider:()=>Ca,CloudflareProvider:()=>lc,EtherscanProvider:()=>vc,FallbackProvider:()=>Oc,Formatter:()=>na,InfuraProvider:()=>qc,InfuraWebSocketProvider:()=>_c,IpcProvider:()=>Lc,JsonRpcBatchProvider:()=>Dc,JsonRpcProvider:()=>Ha,JsonRpcSigner:()=>Va,NodesmithProvider:()=>jc,PocketProvider:()=>Wc,Provider:()=>qn,Resolver:()=>Pa,StaticJsonRpcProvider:()=>Qa,UrlJsonRpcProvider:()=>$a,Web3Provider:()=>Zc,WebSocketProvider:()=>Za,getDefaultProvider:()=>Yc,getNetwork:()=>Vs,isCommunityResourcable:()=>ia,isCommunityResource:()=>oa,showThrottleMessage:()=>aa});var a={};r.r(a),r.d(a,{AbiCoder:()=>en,ConstructorFragment:()=>wt,ErrorFragment:()=>St,EventFragment:()=>gt,FormatTypes:()=>ht,Fragment:()=>mt,FunctionFragment:()=>xt,HDNode:()=>Ko,Indexed:()=>Rn,Interface:()=>Ln,LogDescription:()=>Mn,Logger:()=>ee,ParamType:()=>ft,RLP:()=>n,SigningKey:()=>zi,SupportedAlgorithm:()=>ko,TransactionDescription:()=>In,TransactionTypes:()=>Di,UnicodeNormalizationForm:()=>Ar,Utf8ErrorFuncs:()=>Pr,Utf8ErrorReason:()=>Nr,_TypedDataEncoder:()=>Tn,_fetchData:()=>Js,_toEscapedUtf8String:()=>Rr,accessListify:()=>Zi,arrayify:()=>ae,base58:()=>xo,base64:()=>o,checkProperties:()=>Ye,checkResultErrors:()=>Mt,commify:()=>cu,computeAddress:()=>Wi,computeHmac:()=>To,computePublicKey:()=>_i,concat:()=>ce,deepCopy:()=>rt,defaultAbiCoder:()=>tn,defaultPath:()=>Wo,defineReadOnly:()=>Ge,dnsEncode:()=>ln,entropyToMnemonic:()=>Zo,fetchJson:()=>Ys,formatBytes32String:()=>zr,formatEther:()=>hu,formatUnits:()=>uu,getAccountPath:()=>Yo,getAddress:()=>Jt,getContractAddress:()=>$t,getCreate2Address:()=>er,getIcapAddress:()=>Qt,getJsonWalletAddress:()=>gs,getStatic:()=>Ze,hashMessage:()=>hn,hexConcat:()=>ge,hexDataLength:()=>pe,hexDataSlice:()=>me,hexStripZeros:()=>be,hexValue:()=>ye,hexZeroPad:()=>ve,hexlify:()=>fe,id:()=>rn,isAddress:()=>Yt,isBytes:()=>se,isBytesLike:()=>ie,isHexString:()=>he,isValidMnemonic:()=>Jo,isValidName:()=>cn,joinSignature:()=>xe,keccak256:()=>Lt,mnemonicToEntropy:()=>Go,mnemonicToSeed:()=>Xo,namehash:()=>un,nameprep:()=>Gr,parseBytes32String:()=>Ur,parseEther:()=>du,parseTransaction:()=>to,parseUnits:()=>lu,poll:()=>Qs,randomBytes:()=>ts,recoverAddress:()=>Ki,recoverPublicKey:()=>Ui,resolveProperties:()=>Je,ripemd160:()=>Eo,serializeTransaction:()=>$i,sha256:()=>Ao,sha512:()=>No,shallowCopy:()=>Qe,shuffled:()=>rs,solidityKeccak256:()=>iu,solidityPack:()=>nu,soliditySha256:()=>ou,splitSignature:()=>we,stripZeros:()=>ue,toUtf8Bytes:()=>Ir,toUtf8CodePoints:()=>Lr,toUtf8String:()=>Or,verifyMessage:()=>Rs,verifyTypedData:()=>Bs,zeroPad:()=>le});var c={};r.r(c),r.d(c,{BaseContract:()=>yo,BigNumber:()=>Pe,Contract:()=>bo,ContractFactory:()=>vo,FixedNumber:()=>Fe,Signer:()=>Hn,VoidSigner:()=>Wn,Wallet:()=>Cs,Wordlist:()=>Io,constants:()=>i,errors:()=>Q,getDefaultProvider:()=>Yc,logger:()=>pu,providers:()=>s,utils:()=>a,version:()=>fu,wordlists:()=>Oo});var u={};r.r(u),r.d(u,{assets:()=>aC,attestations:()=>HC,aura:()=>uC,author:()=>NO,authorship:()=>cC,babe:()=>lC,balances:()=>hC,beefy:()=>dC,bridges:()=>WC,chain:()=>TO,childstate:()=>PO,claims:()=>KC,collective:()=>fC,consensus:()=>pC,contracts:()=>mC,contractsAbi:()=>SO,crowdloan:()=>XC,cumulus:()=>GC,democracy:()=>gC,dev:()=>yC,elections:()=>bC,engine:()=>vC,eth:()=>EO,evm:()=>wC,extrinsics:()=>xC,genericAsset:()=>kC,gilt:()=>SC,grandpa:()=>EC,identity:()=>AC,imOnline:()=>NC,lottery:()=>TC,metadata:()=>nC,mmr:()=>PC,offchain:()=>MO,offences:()=>MC,parachains:()=>QC,payment:()=>CO,poll:()=>$C,proxy:()=>IC,purchase:()=>eR,recovery:()=>CC,rpc:()=>AO,runtime:()=>oC,scaleInfo:()=>sC,scheduler:()=>RC,session:()=>BC,society:()=>OC,staking:()=>LC,state:()=>RO,support:()=>zC,syncstate:()=>UC,system:()=>_C,treasury:()=>qC,txpayment:()=>DC,uniques:()=>VC,utility:()=>jC,vesting:()=>FC,xcm:()=>wO});var l={};r.r(l),r.d(l,{BitVec:()=>$R,Bool:()=>wB,Bytes:()=>lB,Data:()=>XL,GenericAccountId:()=>SL,GenericAccountIndex:()=>bL,GenericAddress:()=>VL,GenericBlock:()=>EL,GenericCall:()=>PL,GenericChainProperties:()=>CL,GenericConsensusEngineId:()=>zL,GenericEthereumAccountId:()=>fL,GenericEthereumLookupSource:()=>xL,GenericEvent:()=>jO,GenericEventData:()=>VO,GenericExtrinsic:()=>JO,GenericExtrinsicEra:()=>tL,GenericExtrinsicPayload:()=>nL,GenericExtrinsicPayloadUnknown:()=>iL,GenericExtrinsicPayloadV4:()=>cL,GenericExtrinsicSignatureV4:()=>hL,GenericExtrinsicUnknown:()=>oL,GenericExtrinsicV4:()=>WO,GenericImmortalEra:()=>$O,GenericLookupSource:()=>qL,GenericMortalEra:()=>eL,GenericMultiAddress:()=>VL,GenericSignerPayload:()=>aL,GenericVote:()=>WL,I128:()=>IB,I16:()=>TB,I256:()=>CB,I32:()=>PB,I64:()=>MB,I8:()=>NB,Null:()=>zR,StorageKey:()=>lz,Text:()=>mB,Type:()=>gB,U128:()=>zB,U16:()=>BB,U256:()=>UB,U32:()=>OB,U64:()=>LB,U8:()=>RB,USize:()=>_B,bool:()=>wB,i128:()=>IB,i16:()=>TB,i256:()=>CB,i32:()=>PB,i64:()=>MB,i8:()=>NB,u128:()=>zB,u16:()=>BB,u256:()=>UB,u32:()=>OB,u64:()=>LB,u8:()=>RB,usize:()=>_B});var h={};r.r(h),r.d(h,{accountId:()=>__,flags:()=>q_,hasIdentity:()=>W_,hasIdentityMulti:()=>K_,idAndIndex:()=>D_,idToIndex:()=>V_,identity:()=>H_,indexToId:()=>X_,indexes:()=>Z_,info:()=>Y_});var d={};r.r(d),r.d(d,{_getIds:()=>Q_,all:()=>$_,expand:()=>tq,get:()=>eq,getExpanded:()=>rq,listNodes:()=>nq});var f={};r.r(f),r.d(f,{account:()=>yq,all:()=>lq,votingBalance:()=>vq,votingBalances:()=>bq});var p={};r.r(p),r.d(p,{bounties:()=>kq});var m={};r.r(m),r.d(m,{bestNumber:()=>Eq,bestNumberFinalized:()=>Aq,bestNumberLag:()=>Nq,getBlock:()=>Cq,getBlockByNumber:()=>Rq,getHeader:()=>Iq,subscribeNewBlocks:()=>Bq,subscribeNewHeads:()=>Oq});var g={};r.r(g),r.d(g,{fees:()=>Lq});var y={};r.r(y),r.d(y,{hasProposals:()=>Qq,members:()=>Yq,prime:()=>nD,proposal:()=>$q,proposalCount:()=>eD,proposalHashes:()=>tD,proposals:()=>rD,votes:()=>Zq,votesOf:()=>Jq});var b={};r.r(b),r.d(b,{childKey:()=>iD,contributions:()=>uD,ownContributions:()=>dD});var v={};r.r(v),r.d(v,{_referendumInfo:()=>_D,_referendumVotes:()=>zD,_referendumsVotes:()=>UD,dispatchQueue:()=>mD,locks:()=>bD,nextExternal:()=>vD,preimage:()=>SD,preimages:()=>kD,proposals:()=>ND,referendumIds:()=>TD,referendums:()=>PD,referendumsActive:()=>MD,referendumsFinished:()=>ID,referendumsInfo:()=>qD,sqrtElectorate:()=>DD});var w={};r.r(w),r.d(w,{info:()=>WD});var x={};r.r(x),r.d(x,{receivedHeartbeats:()=>XD});var k={};r.r(k),r.d(k,{hasProposals:()=>ZD,members:()=>GD,prime:()=>eV,proposal:()=>JD,proposalCount:()=>YD,proposalHashes:()=>QD,proposals:()=>$D});var S={};r.r(S),r.d(S,{info:()=>iV,overview:()=>sV});var E={};r.r(E),r.d(E,{eraLength:()=>dV,eraProgress:()=>fV,indexes:()=>cV,info:()=>uV,progress:()=>hV,sessionProgress:()=>pV});var A={};r.r(A),r.d(A,{_members:()=>bV,candidates:()=>mV,info:()=>gV,member:()=>yV,members:()=>vV});var N={};r.r(N),r.d(N,{_eraExposure:()=>zV,_eraPrefs:()=>WV,_eraSlashes:()=>QV,_erasExposure:()=>_V,_erasPoints:()=>FV,_erasPrefs:()=>XV,_erasRewards:()=>JV,_erasSlashes:()=>ej,_ownExposures:()=>aj,_ownSlashes:()=>lj,_stakerExposures:()=>gj,_stakerPoints:()=>vj,_stakerPrefs:()=>xj,_stakerRewards:()=>Aj,_stakerRewardsEras:()=>Ej,_stakerSlashes:()=>Mj,account:()=>EV,accounts:()=>SV,currentPoints:()=>AV,electedInfo:()=>nj,eraExposure:()=>UV,eraPrefs:()=>KV,eraSlashes:()=>$V,erasExposure:()=>qV,erasHistoric:()=>DV,erasPoints:()=>HV,erasPrefs:()=>GV,erasRewards:()=>YV,erasSlashes:()=>tj,keys:()=>ij,keysMulti:()=>oj,nextElected:()=>Rj,overview:()=>sj,ownExposure:()=>cj,ownExposures:()=>uj,ownSlash:()=>hj,ownSlashes:()=>dj,query:()=>pj,queryMulti:()=>mj,stakerExposure:()=>bj,stakerExposures:()=>yj,stakerPoints:()=>wj,stakerPrefs:()=>kj,stakerRewards:()=>Nj,stakerRewardsMulti:()=>Pj,stakerRewardsMultiEras:()=>Tj,stakerSlashes:()=>Ij,stashes:()=>Cj,validators:()=>Bj,waitingInfo:()=>Lj});var T={};r.r(T),r.d(T,{hasProposals:()=>Uj,members:()=>zj,prime:()=>jj,proposal:()=>_j,proposalCount:()=>qj,proposalHashes:()=>Dj,proposals:()=>Vj});var P={};r.r(P),r.d(P,{proposals:()=>Fj});var M={};r.r(M),r.d(M,{events:()=>Hj,signingInfo:()=>Yj});var I={};r.r(I),r.d(I,{code:()=>FK,createLink:()=>VK,createNode:()=>DK,decode:()=>WK,encode:()=>HK,name:()=>jK,prepare:()=>_K,validate:()=>qK});var C={};r.r(C),r.d(C,{abortedError:()=>ZK,notFoundError:()=>GK});var R={};r.r(R),r.d(R,{code:()=>wX,decode:()=>kX,encode:()=>xX,name:()=>vX});var B=function(e,t){return B=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])},B(e,t)};function O(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}B(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}function L(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{c(n.next(e))}catch(t){o(t)}}function a(e){try{c(n.throw(e))}catch(t){o(t)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}c((n=n.apply(e,t||[])).next())}))}function z(e,t){var r,n,i,o,s={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function a(o){return function(a){return function(o){if(r)throw new TypeError("Generator is already executing.");for(;s;)try{if(r=1,n&&(i=2&o[0]?n.return:o[0]?n.throw||((i=n.return)&&i.call(n),0):n.next)&&!(i=i.call(n,o[1])).done)return i;switch(n=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return s.label++,{value:o[1],done:!1};case 5:s.label++,n=o[1],o=[0];continue;case 7:o=s.ops.pop(),s.trys.pop();continue;default:if(!(i=s.trys,(i=i.length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){s=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]<i[3])){s.label=o[1];break}if(6===o[0]&&s.label<i[1]){s.label=i[1],i=o;break}if(i&&s.label<i[2]){s.label=i[2],s.ops.push(o);break}i[2]&&s.ops.pop(),s.trys.pop();continue}o=t.call(e,s)}catch(a){o=[6,a],n=0}finally{r=i=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,a])}}}Object.create;function U(e){var t="function"==typeof Symbol&&Symbol.iterator,r=t&&e[t],n=0;if(r)return r.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function _(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,i,o=r.call(e),s=[];try{for(;(void 0===t||t-- >0)&&!(n=o.next()).done;)s.push(n.value)}catch(a){i={error:a}}finally{try{n&&!n.done&&(r=o.return)&&r.call(o)}finally{if(i)throw i.error}}return s}function q(e,t,r){if(r||2===arguments.length)for(var n,i=0,o=t.length;i<o;i++)!n&&i in t||(n||(n=Array.prototype.slice.call(t,0,i)),n[i]=t[i]);return e.concat(n||Array.prototype.slice.call(t))}function D(e){return this instanceof D?(this.v=e,this):new D(e)}function V(e,t,r){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var n,i=r.apply(e,t||[]),o=[];return n={},s("next"),s("throw"),s("return"),n[Symbol.asyncIterator]=function(){return this},n;function s(e){i[e]&&(n[e]=function(t){return new Promise((function(r,n){o.push([e,t,r,n])>1||a(e,t)}))})}function a(e,t){try{!function(e){e.value instanceof D?Promise.resolve(e.value.v).then(c,u):l(o[0][2],e)}(i[e](t))}catch(r){l(o[0][3],r)}}function c(e){a("next",e)}function u(e){a("throw",e)}function l(e,t){e(t),o.shift(),o.length&&a(o[0][0],o[0][1])}}function j(e){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var t,r=e[Symbol.asyncIterator];return r?r.call(e):(e=U(e),t={},n("next"),n("throw"),n("return"),t[Symbol.asyncIterator]=function(){return this},t);function n(r){t[r]=e[r]&&function(t){return new Promise((function(n,i){(function(e,t,r,n){Promise.resolve(n).then((function(t){e({value:t,done:r})}),t)})(n,i,(t=e[r](t)).done,t.value)}))}}}Object.create;var F=r(54269),H=r.n(F);let W=!1,K=!1;const X={debug:1,default:2,info:2,warning:3,error:4,off:5};let G=X.default,Z=null;const J=function(){try{const e=[];if(["NFD","NFC","NFKD","NFKC"].forEach((t=>{try{if("test"!=="test".normalize(t))throw new Error("bad normalize")}catch(r){e.push(t)}})),e.length)throw new Error("missing "+e.join(", "));if(String.fromCharCode(233).normalize("NFD")!==String.fromCharCode(101,769))throw new Error("broken implementation")}catch(e){return e.message}return null}();var Y,Q;!function(e){e.DEBUG="DEBUG",e.INFO="INFO",e.WARNING="WARNING",e.ERROR="ERROR",e.OFF="OFF"}(Y||(Y={})),function(e){e.UNKNOWN_ERROR="UNKNOWN_ERROR",e.NOT_IMPLEMENTED="NOT_IMPLEMENTED",e.UNSUPPORTED_OPERATION="UNSUPPORTED_OPERATION",e.NETWORK_ERROR="NETWORK_ERROR",e.SERVER_ERROR="SERVER_ERROR",e.TIMEOUT="TIMEOUT",e.BUFFER_OVERRUN="BUFFER_OVERRUN",e.NUMERIC_FAULT="NUMERIC_FAULT",e.MISSING_NEW="MISSING_NEW",e.INVALID_ARGUMENT="INVALID_ARGUMENT",e.MISSING_ARGUMENT="MISSING_ARGUMENT",e.UNEXPECTED_ARGUMENT="UNEXPECTED_ARGUMENT",e.CALL_EXCEPTION="CALL_EXCEPTION",e.INSUFFICIENT_FUNDS="INSUFFICIENT_FUNDS",e.NONCE_EXPIRED="NONCE_EXPIRED",e.REPLACEMENT_UNDERPRICED="REPLACEMENT_UNDERPRICED",e.UNPREDICTABLE_GAS_LIMIT="UNPREDICTABLE_GAS_LIMIT",e.TRANSACTION_REPLACED="TRANSACTION_REPLACED"}(Q||(Q={}));const $="0123456789abcdef";class ee{constructor(e){Object.defineProperty(this,"version",{enumerable:!0,value:e,writable:!1})}_log(e,t){const r=e.toLowerCase();null==X[r]&&this.throwArgumentError("invalid log level name","logLevel",e),G>X[r]||console.log.apply(console,t)}debug(...e){this._log(ee.levels.DEBUG,e)}info(...e){this._log(ee.levels.INFO,e)}warn(...e){this._log(ee.levels.WARNING,e)}makeError(e,t,r){if(K)return this.makeError("censored error",t,{});t||(t=ee.errors.UNKNOWN_ERROR),r||(r={});const n=[];Object.keys(r).forEach((e=>{const t=r[e];try{if(t instanceof Uint8Array){let r="";for(let e=0;e<t.length;e++)r+=$[t[e]>>4],r+=$[15&t[e]];n.push(e+"=Uint8Array(0x"+r+")")}else n.push(e+"="+JSON.stringify(t))}catch(s){n.push(e+"="+JSON.stringify(r[e].toString()))}})),n.push(`code=${t}`),n.push(`version=${this.version}`);const i=e;let o="";switch(t){case Q.NUMERIC_FAULT:{o="NUMERIC_FAULT";const t=e;switch(t){case"overflow":case"underflow":case"division-by-zero":o+="-"+t;break;case"negative-power":case"negative-width":o+="-unsupported";break;case"unbound-bitwise-result":o+="-unbound-result"}break}case Q.CALL_EXCEPTION:case Q.INSUFFICIENT_FUNDS:case Q.MISSING_NEW:case Q.NONCE_EXPIRED:case Q.REPLACEMENT_UNDERPRICED:case Q.TRANSACTION_REPLACED:case Q.UNPREDICTABLE_GAS_LIMIT:o=t}o&&(e+=" [ See: https://links.ethers.org/v5-errors-"+o+" ]"),n.length&&(e+=" ("+n.join(", ")+")");const s=new Error(e);return s.reason=i,s.code=t,Object.keys(r).forEach((function(e){s[e]=r[e]})),s}throwError(e,t,r){throw this.makeError(e,t,r)}throwArgumentError(e,t,r){return this.throwError(e,ee.errors.INVALID_ARGUMENT,{argument:t,value:r})}assert(e,t,r,n){e||this.throwError(t,r,n)}assertArgument(e,t,r,n){e||this.throwArgumentError(t,r,n)}checkNormalize(e){null==e&&(e="platform missing String.prototype.normalize"),J&&this.throwError("platform missing String.prototype.normalize",ee.errors.UNSUPPORTED_OPERATION,{operation:"String.prototype.normalize",form:J})}checkSafeUint53(e,t){"number"==typeof e&&(null==t&&(t="value not safe"),(e<0||e>=9007199254740991)&&this.throwError(t,ee.errors.NUMERIC_FAULT,{operation:"checkSafeInteger",fault:"out-of-safe-range",value:e}),e%1&&this.throwError(t,ee.errors.NUMERIC_FAULT,{operation:"checkSafeInteger",fault:"non-integer",value:e}))}checkArgumentCount(e,t,r){r=r?": "+r:"",e<t&&this.throwError("missing argument"+r,ee.errors.MISSING_ARGUMENT,{count:e,expectedCount:t}),e>t&&this.throwError("too many arguments"+r,ee.errors.UNEXPECTED_ARGUMENT,{count:e,expectedCount:t})}checkNew(e,t){e!==Object&&null!=e||this.throwError("missing new",ee.errors.MISSING_NEW,{name:t.name})}checkAbstract(e,t){e===t?this.throwError("cannot instantiate abstract class "+JSON.stringify(t.name)+" directly; use a sub-class",ee.errors.UNSUPPORTED_OPERATION,{name:e.name,operation:"new"}):e!==Object&&null!=e||this.throwError("missing new",ee.errors.MISSING_NEW,{name:t.name})}static globalLogger(){return Z||(Z=new ee("logger/5.6.0")),Z}static setCensorship(e,t){if(!e&&t&&this.globalLogger().throwError("cannot permanently disable censorship",ee.errors.UNSUPPORTED_OPERATION,{operation:"setCensorship"}),W){if(!e)return;this.globalLogger().throwError("error censorship permanent",ee.errors.UNSUPPORTED_OPERATION,{operation:"setCensorship"})}K=!!e,W=!!t}static setLogLevel(e){const t=X[e.toLowerCase()];null!=t?G=t:ee.globalLogger().warn("invalid log level - "+e)}static from(e){return new ee(e)}}ee.errors=Q,ee.levels=Y;const te=new ee("bytes/5.6.1");function re(e){return!!e.toHexString}function ne(e){return e.slice||(e.slice=function(){const t=Array.prototype.slice.call(arguments);return ne(new Uint8Array(Array.prototype.slice.apply(e,t)))}),e}function ie(e){return he(e)&&!(e.length%2)||se(e)}function oe(e){return"number"==typeof e&&e==e&&e%1==0}function se(e){if(null==e)return!1;if(e.constructor===Uint8Array)return!0;if("string"==typeof e)return!1;if(!oe(e.length)||e.length<0)return!1;for(let t=0;t<e.length;t++){const r=e[t];if(!oe(r)||r<0||r>=256)return!1}return!0}function ae(e,t){if(t||(t={}),"number"==typeof e){te.checkSafeUint53(e,"invalid arrayify value");const t=[];for(;e;)t.unshift(255&e),e=parseInt(String(e/256));return 0===t.length&&t.push(0),ne(new Uint8Array(t))}if(t.allowMissingPrefix&&"string"==typeof e&&"0x"!==e.substring(0,2)&&(e="0x"+e),re(e)&&(e=e.toHexString()),he(e)){let r=e.substring(2);r.length%2&&("left"===t.hexPad?r="0"+r:"right"===t.hexPad?r+="0":te.throwArgumentError("hex data is odd-length","value",e));const n=[];for(let e=0;e<r.length;e+=2)n.push(parseInt(r.substring(e,e+2),16));return ne(new Uint8Array(n))}return se(e)?ne(new Uint8Array(e)):te.throwArgumentError("invalid arrayify value","value",e)}function ce(e){const t=e.map((e=>ae(e))),r=t.reduce(((e,t)=>e+t.length),0),n=new Uint8Array(r);return t.reduce(((e,t)=>(n.set(t,e),e+t.length)),0),ne(n)}function ue(e){let t=ae(e);if(0===t.length)return t;let r=0;for(;r<t.length&&0===t[r];)r++;return r&&(t=t.slice(r)),t}function le(e,t){(e=ae(e)).length>t&&te.throwArgumentError("value out of range","value",arguments[0]);const r=new Uint8Array(t);return r.set(e,t-e.length),ne(r)}function he(e,t){return!("string"!=typeof e||!e.match(/^0x[0-9A-Fa-f]*$/))&&(!t||e.length===2+2*t)}const de="0123456789abcdef";function fe(e,t){if(t||(t={}),"number"==typeof e){te.checkSafeUint53(e,"invalid hexlify value");let t="";for(;e;)t=de[15&e]+t,e=Math.floor(e/16);return t.length?(t.length%2&&(t="0"+t),"0x"+t):"0x00"}if("bigint"==typeof e)return(e=e.toString(16)).length%2?"0x0"+e:"0x"+e;if(t.allowMissingPrefix&&"string"==typeof e&&"0x"!==e.substring(0,2)&&(e="0x"+e),re(e))return e.toHexString();if(he(e))return e.length%2&&("left"===t.hexPad?e="0x0"+e.substring(2):"right"===t.hexPad?e+="0":te.throwArgumentError("hex data is odd-length","value",e)),e.toLowerCase();if(se(e)){let t="0x";for(let r=0;r<e.length;r++){let n=e[r];t+=de[(240&n)>>4]+de[15&n]}return t}return te.throwArgumentError("invalid hexlify value","value",e)}function pe(e){if("string"!=typeof e)e=fe(e);else if(!he(e)||e.length%2)return null;return(e.length-2)/2}function me(e,t,r){return"string"!=typeof e?e=fe(e):(!he(e)||e.length%2)&&te.throwArgumentError("invalid hexData","value",e),t=2+2*t,null!=r?"0x"+e.substring(t,2+2*r):"0x"+e.substring(t)}function ge(e){let t="0x";return e.forEach((e=>{t+=fe(e).substring(2)})),t}function ye(e){const t=be(fe(e,{hexPad:"left"}));return"0x"===t?"0x0":t}function be(e){"string"!=typeof e&&(e=fe(e)),he(e)||te.throwArgumentError("invalid hex string","value",e),e=e.substring(2);let t=0;for(;t<e.length&&"0"===e[t];)t++;return"0x"+e.substring(t)}function ve(e,t){for("string"!=typeof e?e=fe(e):he(e)||te.throwArgumentError("invalid hex string","value",e),e.length>2*t+2&&te.throwArgumentError("value out of range","value",arguments[1]);e.length<2*t+2;)e="0x0"+e.substring(2);return e}function we(e){const t={r:"0x",s:"0x",_vs:"0x",recoveryParam:0,v:0,yParityAndS:"0x",compact:"0x"};if(ie(e)){let r=ae(e);64===r.length?(t.v=27+(r[32]>>7),r[32]&=127,t.r=fe(r.slice(0,32)),t.s=fe(r.slice(32,64))):65===r.length?(t.r=fe(r.slice(0,32)),t.s=fe(r.slice(32,64)),t.v=r[64]):te.throwArgumentError("invalid signature string","signature",e),t.v<27&&(0===t.v||1===t.v?t.v+=27:te.throwArgumentError("signature invalid v byte","signature",e)),t.recoveryParam=1-t.v%2,t.recoveryParam&&(r[32]|=128),t._vs=fe(r.slice(32,64))}else{if(t.r=e.r,t.s=e.s,t.v=e.v,t.recoveryParam=e.recoveryParam,t._vs=e._vs,null!=t._vs){const r=le(ae(t._vs),32);t._vs=fe(r);const n=r[0]>=128?1:0;null==t.recoveryParam?t.recoveryParam=n:t.recoveryParam!==n&&te.throwArgumentError("signature recoveryParam mismatch _vs","signature",e),r[0]&=127;const i=fe(r);null==t.s?t.s=i:t.s!==i&&te.throwArgumentError("signature v mismatch _vs","signature",e)}if(null==t.recoveryParam)null==t.v?te.throwArgumentError("signature missing v and recoveryParam","signature",e):0===t.v||1===t.v?t.recoveryParam=t.v:t.recoveryParam=1-t.v%2;else if(null==t.v)t.v=27+t.recoveryParam;else{const r=0===t.v||1===t.v?t.v:1-t.v%2;t.recoveryParam!==r&&te.throwArgumentError("signature recoveryParam mismatch v","signature",e)}null!=t.r&&he(t.r)?t.r=ve(t.r,32):te.throwArgumentError("signature missing or invalid r","signature",e),null!=t.s&&he(t.s)?t.s=ve(t.s,32):te.throwArgumentError("signature missing or invalid s","signature",e);const r=ae(t.s);r[0]>=128&&te.throwArgumentError("signature s out of range","signature",e),t.recoveryParam&&(r[0]|=128);const n=fe(r);t._vs&&(he(t._vs)||te.throwArgumentError("signature invalid _vs","signature",e),t._vs=ve(t._vs,32)),null==t._vs?t._vs=n:t._vs!==n&&te.throwArgumentError("signature _vs mismatch v and s","signature",e)}return t.yParityAndS=t._vs,t.compact=t.r+t.yParityAndS.substring(2),t}function xe(e){return fe(ce([(e=we(e)).r,e.s,e.recoveryParam?"0x1c":"0x1b"]))}const ke="bignumber/5.6.1";var Se=H().BN;const Ee=new ee(ke),Ae={},Ne=9007199254740991;let Te=!1;class Pe{constructor(e,t){e!==Ae&&Ee.throwError("cannot call constructor directly; use BigNumber.from",ee.errors.UNSUPPORTED_OPERATION,{operation:"new (BigNumber)"}),this._hex=t,this._isBigNumber=!0,Object.freeze(this)}fromTwos(e){return Ie(Ce(this).fromTwos(e))}toTwos(e){return Ie(Ce(this).toTwos(e))}abs(){return"-"===this._hex[0]?Pe.from(this._hex.substring(1)):this}add(e){return Ie(Ce(this).add(Ce(e)))}sub(e){return Ie(Ce(this).sub(Ce(e)))}div(e){return Pe.from(e).isZero()&&Re("division-by-zero","div"),Ie(Ce(this).div(Ce(e)))}mul(e){return Ie(Ce(this).mul(Ce(e)))}mod(e){const t=Ce(e);return t.isNeg()&&Re("division-by-zero","mod"),Ie(Ce(this).umod(t))}pow(e){const t=Ce(e);return t.isNeg()&&Re("negative-power","pow"),Ie(Ce(this).pow(t))}and(e){const t=Ce(e);return(this.isNegative()||t.isNeg())&&Re("unbound-bitwise-result","and"),Ie(Ce(this).and(t))}or(e){const t=Ce(e);return(this.isNegative()||t.isNeg())&&Re("unbound-bitwise-result","or"),Ie(Ce(this).or(t))}xor(e){const t=Ce(e);return(this.isNegative()||t.isNeg())&&Re("unbound-bitwise-result","xor"),Ie(Ce(this).xor(t))}mask(e){return(this.isNegative()||e<0)&&Re("negative-width","mask"),Ie(Ce(this).maskn(e))}shl(e){return(this.isNegative()||e<0)&&Re("negative-width","shl"),Ie(Ce(this).shln(e))}shr(e){return(this.isNegative()||e<0)&&Re("negative-width","shr"),Ie(Ce(this).shrn(e))}eq(e){return Ce(this).eq(Ce(e))}lt(e){return Ce(this).lt(Ce(e))}lte(e){return Ce(this).lte(Ce(e))}gt(e){return Ce(this).gt(Ce(e))}gte(e){return Ce(this).gte(Ce(e))}isNegative(){return"-"===this._hex[0]}isZero(){return Ce(this).isZero()}toNumber(){try{return Ce(this).toNumber()}catch(e){Re("overflow","toNumber",this.toString())}return null}toBigInt(){try{return BigInt(this.toString())}catch(e){}return Ee.throwError("this platform does not support BigInt",ee.errors.UNSUPPORTED_OPERATION,{value:this.toString()})}toString(){return arguments.length>0&&(10===arguments[0]?Te||(Te=!0,Ee.warn("BigNumber.toString does not accept any parameters; base-10 is assumed")):16===arguments[0]?Ee.throwError("BigNumber.toString does not accept any parameters; use bigNumber.toHexString()",ee.errors.UNEXPECTED_ARGUMENT,{}):Ee.throwError("BigNumber.toString does not accept parameters",ee.errors.UNEXPECTED_ARGUMENT,{})),Ce(this).toString(10)}toHexString(){return this._hex}toJSON(e){return{type:"BigNumber",hex:this.toHexString()}}static from(e){if(e instanceof Pe)return e;if("string"==typeof e)return e.match(/^-?0x[0-9a-f]+$/i)?new Pe(Ae,Me(e)):e.match(/^-?[0-9]+$/)?new Pe(Ae,Me(new Se(e))):Ee.throwArgumentError("invalid BigNumber string","value",e);if("number"==typeof e)return e%1&&Re("underflow","BigNumber.from",e),(e>=Ne||e<=-Ne)&&Re("overflow","BigNumber.from",e),Pe.from(String(e));const t=e;if("bigint"==typeof t)return Pe.from(t.toString());if(se(t))return Pe.from(fe(t));if(t)if(t.toHexString){const e=t.toHexString();if("string"==typeof e)return Pe.from(e)}else{let e=t._hex;if(null==e&&"BigNumber"===t.type&&(e=t.hex),"string"==typeof e&&(he(e)||"-"===e[0]&&he(e.substring(1))))return Pe.from(e)}return Ee.throwArgumentError("invalid BigNumber value","value",e)}static isBigNumber(e){return!(!e||!e._isBigNumber)}}function Me(e){if("string"!=typeof e)return Me(e.toString(16));if("-"===e[0])return"-"===(e=e.substring(1))[0]&&Ee.throwArgumentError("invalid hex","value",e),"0x00"===(e=Me(e))?e:"-"+e;if("0x"!==e.substring(0,2)&&(e="0x"+e),"0x"===e)return"0x00";for(e.length%2&&(e="0x0"+e.substring(2));e.length>4&&"0x00"===e.substring(0,4);)e="0x"+e.substring(4);return e}function Ie(e){return Pe.from(Me(e))}function Ce(e){const t=Pe.from(e).toHexString();return"-"===t[0]?new Se("-"+t.substring(3),16):new Se(t.substring(2),16)}function Re(e,t,r){const n={fault:e,operation:t};return null!=r&&(n.value=r),Ee.throwError(e,ee.errors.NUMERIC_FAULT,n)}const Be=new ee(ke),Oe={},Le=Pe.from(0),ze=Pe.from(-1);function Ue(e,t,r,n){const i={fault:t,operation:r};return void 0!==n&&(i.value=n),Be.throwError(e,ee.errors.NUMERIC_FAULT,i)}let _e="0";for(;_e.length<256;)_e+=_e;function qe(e){if("number"!=typeof e)try{e=Pe.from(e).toNumber()}catch(t){}return"number"==typeof e&&e>=0&&e<=256&&!(e%1)?"1"+_e.substring(0,e):Be.throwArgumentError("invalid decimal size","decimals",e)}function De(e,t){null==t&&(t=0);const r=qe(t),n=(e=Pe.from(e)).lt(Le);n&&(e=e.mul(ze));let i=e.mod(r).toString();for(;i.length<r.length-1;)i="0"+i;i=i.match(/^([0-9]*[1-9]|0)(0*)/)[1];const o=e.div(r).toString();return e=1===r.length?o:o+"."+i,n&&(e="-"+e),e}function Ve(e,t){null==t&&(t=0);const r=qe(t);"string"==typeof e&&e.match(/^-?[0-9.]+$/)||Be.throwArgumentError("invalid decimal value","value",e);const n="-"===e.substring(0,1);n&&(e=e.substring(1)),"."===e&&Be.throwArgumentError("missing value","value",e);const i=e.split(".");i.length>2&&Be.throwArgumentError("too many decimal points","value",e);let o=i[0],s=i[1];for(o||(o="0"),s||(s="0");"0"===s[s.length-1];)s=s.substring(0,s.length-1);for(s.length>r.length-1&&Ue("fractional component exceeds decimals","underflow","parseFixed"),""===s&&(s="0");s.length<r.length-1;)s+="0";const a=Pe.from(o),c=Pe.from(s);let u=a.mul(r).add(c);return n&&(u=u.mul(ze)),u}class je{constructor(e,t,r,n){e!==Oe&&Be.throwError("cannot use FixedFormat constructor; use FixedFormat.from",ee.errors.UNSUPPORTED_OPERATION,{operation:"new FixedFormat"}),this.signed=t,this.width=r,this.decimals=n,this.name=(t?"":"u")+"fixed"+String(r)+"x"+String(n),this._multiplier=qe(n),Object.freeze(this)}static from(e){if(e instanceof je)return e;"number"==typeof e&&(e=`fixed128x${e}`);let t=!0,r=128,n=18;if("string"==typeof e)if("fixed"===e);else if("ufixed"===e)t=!1;else{const i=e.match(/^(u?)fixed([0-9]+)x([0-9]+)$/);i||Be.throwArgumentError("invalid fixed format","format",e),t="u"!==i[1],r=parseInt(i[2]),n=parseInt(i[3])}else if(e){const i=(t,r,n)=>null==e[t]?n:(typeof e[t]!==r&&Be.throwArgumentError("invalid fixed format ("+t+" not "+r+")","format."+t,e[t]),e[t]);t=i("signed","boolean",t),r=i("width","number",r),n=i("decimals","number",n)}return r%8&&Be.throwArgumentError("invalid fixed format width (not byte aligned)","format.width",r),n>80&&Be.throwArgumentError("invalid fixed format (decimals too large)","format.decimals",n),new je(Oe,t,r,n)}}class Fe{constructor(e,t,r,n){e!==Oe&&Be.throwError("cannot use FixedNumber constructor; use FixedNumber.from",ee.errors.UNSUPPORTED_OPERATION,{operation:"new FixedFormat"}),this.format=n,this._hex=t,this._value=r,this._isFixedNumber=!0,Object.freeze(this)}_checkFormat(e){this.format.name!==e.format.name&&Be.throwArgumentError("incompatible format; use fixedNumber.toFormat","other",e)}addUnsafe(e){this._checkFormat(e);const t=Ve(this._value,this.format.decimals),r=Ve(e._value,e.format.decimals);return Fe.fromValue(t.add(r),this.format.decimals,this.format)}subUnsafe(e){this._checkFormat(e);const t=Ve(this._value,this.format.decimals),r=Ve(e._value,e.format.decimals);return Fe.fromValue(t.sub(r),this.format.decimals,this.format)}mulUnsafe(e){this._checkFormat(e);const t=Ve(this._value,this.format.decimals),r=Ve(e._value,e.format.decimals);return Fe.fromValue(t.mul(r).div(this.format._multiplier),this.format.decimals,this.format)}divUnsafe(e){this._checkFormat(e);const t=Ve(this._value,this.format.decimals),r=Ve(e._value,e.format.decimals);return Fe.fromValue(t.mul(this.format._multiplier).div(r),this.format.decimals,this.format)}floor(){const e=this.toString().split(".");1===e.length&&e.push("0");let t=Fe.from(e[0],this.format);const r=!e[1].match(/^(0*)$/);return this.isNegative()&&r&&(t=t.subUnsafe(He.toFormat(t.format))),t}ceiling(){const e=this.toString().split(".");1===e.length&&e.push("0");let t=Fe.from(e[0],this.format);const r=!e[1].match(/^(0*)$/);return!this.isNegative()&&r&&(t=t.addUnsafe(He.toFormat(t.format))),t}round(e){null==e&&(e=0);const t=this.toString().split(".");if(1===t.length&&t.push("0"),(e<0||e>80||e%1)&&Be.throwArgumentError("invalid decimal count","decimals",e),t[1].length<=e)return this;const r=Fe.from("1"+_e.substring(0,e),this.format),n=We.toFormat(this.format);return this.mulUnsafe(r).addUnsafe(n).floor().divUnsafe(r)}isZero(){return"0.0"===this._value||"0"===this._value}isNegative(){return"-"===this._value[0]}toString(){return this._value}toHexString(e){if(null==e)return this._hex;e%8&&Be.throwArgumentError("invalid byte width","width",e);return ve(Pe.from(this._hex).fromTwos(this.format.width).toTwos(e).toHexString(),e/8)}toUnsafeFloat(){return parseFloat(this.toString())}toFormat(e){return Fe.fromString(this._value,e)}static fromValue(e,t,r){return null!=r||null==t||function(e){return null!=e&&(Pe.isBigNumber(e)||"number"==typeof e&&e%1==0||"string"==typeof e&&!!e.match(/^-?[0-9]+$/)||he(e)||"bigint"==typeof e||se(e))}(t)||(r=t,t=null),null==t&&(t=0),null==r&&(r="fixed"),Fe.fromString(De(e,t),je.from(r))}static fromString(e,t){null==t&&(t="fixed");const r=je.from(t),n=Ve(e,r.decimals);!r.signed&&n.lt(Le)&&Ue("unsigned value cannot be negative","overflow","value",e);let i=null;r.signed?i=n.toTwos(r.width).toHexString():(i=n.toHexString(),i=ve(i,r.width/8));const o=De(n,r.decimals);return new Fe(Oe,i,o,r)}static fromBytes(e,t){null==t&&(t="fixed");const r=je.from(t);if(ae(e).length>r.width/8)throw new Error("overflow");let n=Pe.from(e);r.signed&&(n=n.fromTwos(r.width));const i=n.toTwos((r.signed?0:1)+r.width).toHexString(),o=De(n,r.decimals);return new Fe(Oe,i,o,r)}static from(e,t){if("string"==typeof e)return Fe.fromString(e,t);if(se(e))return Fe.fromBytes(e,t);try{return Fe.fromValue(e,0,t)}catch(r){if(r.code!==ee.errors.INVALID_ARGUMENT)throw r}return Be.throwArgumentError("invalid FixedNumber value","value",e)}static isFixedNumber(e){return!(!e||!e._isFixedNumber)}}const He=Fe.from(1),We=Fe.from("0.5");var Ke=function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{c(n.next(e))}catch(t){o(t)}}function a(e){try{c(n.throw(e))}catch(t){o(t)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}c((n=n.apply(e,t||[])).next())}))};const Xe=new ee("properties/5.6.0");function Ge(e,t,r){Object.defineProperty(e,t,{enumerable:!0,value:r,writable:!1})}function Ze(e,t){for(let r=0;r<32;r++){if(e[t])return e[t];if(!e.prototype||"object"!=typeof e.prototype)break;e=Object.getPrototypeOf(e.prototype).constructor}return null}function Je(e){return Ke(this,void 0,void 0,(function*(){const t=Object.keys(e).map((t=>{const r=e[t];return Promise.resolve(r).then((e=>({key:t,value:e})))}));return(yield Promise.all(t)).reduce(((e,t)=>(e[t.key]=t.value,e)),{})}))}function Ye(e,t){e&&"object"==typeof e||Xe.throwArgumentError("invalid object","object",e),Object.keys(e).forEach((r=>{t[r]||Xe.throwArgumentError("invalid object key - "+r,"transaction:"+r,e)}))}function Qe(e){const t={};for(const r in e)t[r]=e[r];return t}const $e={bigint:!0,boolean:!0,function:!0,number:!0,string:!0};function et(e){if(null==e||$e[typeof e])return!0;if(Array.isArray(e)||"object"==typeof e){if(!Object.isFrozen(e))return!1;const r=Object.keys(e);for(let n=0;n<r.length;n++){let i=null;try{i=e[r[n]]}catch(t){continue}if(!et(i))return!1}return!0}return Xe.throwArgumentError("Cannot deepCopy "+typeof e,"object",e)}function tt(e){if(et(e))return e;if(Array.isArray(e))return Object.freeze(e.map((e=>rt(e))));if("object"==typeof e){const t={};for(const r in e){const n=e[r];void 0!==n&&Ge(t,r,rt(n))}return t}return Xe.throwArgumentError("Cannot deepCopy "+typeof e,"object",e)}function rt(e){return tt(e)}class nt{constructor(e){for(const t in e)this[t]=rt(e[t])}}const it="abi/5.6.2",ot=new ee(it),st={};let at={calldata:!0,memory:!0,storage:!0},ct={calldata:!0,memory:!0};function ut(e,t){if("bytes"===e||"string"===e){if(at[t])return!0}else if("address"===e){if("payable"===t)return!0}else if((e.indexOf("[")>=0||"tuple"===e)&&ct[t])return!0;return(at[t]||"payable"===t)&&ot.throwArgumentError("invalid modifier","name",t),!1}function lt(e,t){for(let r in t)Ge(e,r,t[r])}const ht=Object.freeze({sighash:"sighash",minimal:"minimal",full:"full",json:"json"}),dt=new RegExp(/^(.*)\[([0-9]*)\]$/);class ft{constructor(e,t){e!==st&&ot.throwError("use fromString",ee.errors.UNSUPPORTED_OPERATION,{operation:"new ParamType()"}),lt(this,t);let r=this.type.match(dt);lt(this,r?{arrayLength:parseInt(r[2]||"-1"),arrayChildren:ft.fromObject({type:r[1],components:this.components}),baseType:"array"}:{arrayLength:null,arrayChildren:null,baseType:null!=this.components?"tuple":this.type}),this._isParamType=!0,Object.freeze(this)}format(e){if(e||(e=ht.sighash),ht[e]||ot.throwArgumentError("invalid format type","format",e),e===ht.json){let t={type:"tuple"===this.baseType?"tuple":this.type,name:this.name||void 0};return"boolean"==typeof this.indexed&&(t.indexed=this.indexed),this.components&&(t.components=this.components.map((t=>JSON.parse(t.format(e))))),JSON.stringify(t)}let t="";return"array"===this.baseType?(t+=this.arrayChildren.format(e),t+="["+(this.arrayLength<0?"":String(this.arrayLength))+"]"):"tuple"===this.baseType?(e!==ht.sighash&&(t+=this.type),t+="("+this.components.map((t=>t.format(e))).join(e===ht.full?", ":",")+")"):t+=this.type,e!==ht.sighash&&(!0===this.indexed&&(t+=" indexed"),e===ht.full&&this.name&&(t+=" "+this.name)),t}static from(e,t){return"string"==typeof e?ft.fromString(e,t):ft.fromObject(e)}static fromObject(e){return ft.isParamType(e)?e:new ft(st,{name:e.name||null,type:Et(e.type),indexed:null==e.indexed?null:!!e.indexed,components:e.components?e.components.map(ft.fromObject):null})}static fromString(e,t){return function(e){return ft.fromObject({name:e.name,type:e.type,indexed:e.indexed,components:e.components})}(function(e,t){let r=e;function n(t){ot.throwArgumentError(`unexpected character at position ${t}`,"param",e)}function i(e){let r={type:"",name:"",parent:e,state:{allowType:!0}};return t&&(r.indexed=!1),r}e=e.replace(/\s/g," ");let o={type:"",name:"",state:{allowType:!0}},s=o;for(let a=0;a<e.length;a++){let r=e[a];switch(r){case"(":s.state.allowType&&""===s.type?s.type="tuple":s.state.allowParams||n(a),s.state.allowType=!1,s.type=Et(s.type),s.components=[i(s)],s=s.components[0];break;case")":delete s.state,"indexed"===s.name&&(t||n(a),s.indexed=!0,s.name=""),ut(s.type,s.name)&&(s.name=""),s.type=Et(s.type);let e=s;s=s.parent,s||n(a),delete e.parent,s.state.allowParams=!1,s.state.allowName=!0,s.state.allowArray=!0;break;case",":delete s.state,"indexed"===s.name&&(t||n(a),s.indexed=!0,s.name=""),ut(s.type,s.name)&&(s.name=""),s.type=Et(s.type);let o=i(s.parent);s.parent.components.push(o),delete s.parent,s=o;break;case" ":s.state.allowType&&""!==s.type&&(s.type=Et(s.type),delete s.state.allowType,s.state.allowName=!0,s.state.allowParams=!0),s.state.allowName&&""!==s.name&&("indexed"===s.name?(t||n(a),s.indexed&&n(a),s.indexed=!0,s.name=""):ut(s.type,s.name)?s.name="":s.state.allowName=!1);break;case"[":s.state.allowArray||n(a),s.type+=r,s.state.allowArray=!1,s.state.allowName=!1,s.state.readArray=!0;break;case"]":s.state.readArray||n(a),s.type+=r,s.state.readArray=!1,s.state.allowArray=!0,s.state.allowName=!0;break;default:s.state.allowType?(s.type+=r,s.state.allowParams=!0,s.state.allowArray=!0):s.state.allowName?(s.name+=r,delete s.state.allowArray):s.state.readArray?s.type+=r:n(a)}}return s.parent&&ot.throwArgumentError("unexpected eof","param",e),delete o.state,"indexed"===s.name?(t||n(r.length-7),s.indexed&&n(r.length-7),s.indexed=!0,s.name=""):ut(s.type,s.name)&&(s.name=""),o.type=Et(o.type),o}(e,!!t))}static isParamType(e){return!(null==e||!e._isParamType)}}function pt(e,t){return function(e){e=e.trim();let t=[],r="",n=0;for(let i=0;i<e.length;i++){let o=e[i];","===o&&0===n?(t.push(r),r=""):(r+=o,"("===o?n++:")"===o&&(n--,-1===n&&ot.throwArgumentError("unbalanced parenthesis","value",e)))}r&&t.push(r);return t}(e).map((e=>ft.fromString(e,t)))}class mt{constructor(e,t){e!==st&&ot.throwError("use a static from method",ee.errors.UNSUPPORTED_OPERATION,{operation:"new Fragment()"}),lt(this,t),this._isFragment=!0,Object.freeze(this)}static from(e){return mt.isFragment(e)?e:"string"==typeof e?mt.fromString(e):mt.fromObject(e)}static fromObject(e){if(mt.isFragment(e))return e;switch(e.type){case"function":return xt.fromObject(e);case"event":return gt.fromObject(e);case"constructor":return wt.fromObject(e);case"error":return St.fromObject(e);case"fallback":case"receive":return null}return ot.throwArgumentError("invalid fragment object","value",e)}static fromString(e){return"event"===(e=(e=(e=e.replace(/\s/g," ")).replace(/\(/g," (").replace(/\)/g,") ").replace(/\s+/g," ")).trim()).split(" ")[0]?gt.fromString(e.substring(5).trim()):"function"===e.split(" ")[0]?xt.fromString(e.substring(8).trim()):"constructor"===e.split("(")[0].trim()?wt.fromString(e.trim()):"error"===e.split(" ")[0]?St.fromString(e.substring(5).trim()):ot.throwArgumentError("unsupported fragment","value",e)}static isFragment(e){return!(!e||!e._isFragment)}}class gt extends mt{format(e){if(e||(e=ht.sighash),ht[e]||ot.throwArgumentError("invalid format type","format",e),e===ht.json)return JSON.stringify({type:"event",anonymous:this.anonymous,name:this.name,inputs:this.inputs.map((t=>JSON.parse(t.format(e))))});let t="";return e!==ht.sighash&&(t+="event "),t+=this.name+"("+this.inputs.map((t=>t.format(e))).join(e===ht.full?", ":",")+") ",e!==ht.sighash&&this.anonymous&&(t+="anonymous "),t.trim()}static from(e){return"string"==typeof e?gt.fromString(e):gt.fromObject(e)}static fromObject(e){if(gt.isEventFragment(e))return e;"event"!==e.type&&ot.throwArgumentError("invalid event object","value",e);const t={name:Nt(e.name),anonymous:e.anonymous,inputs:e.inputs?e.inputs.map(ft.fromObject):[],type:"event"};return new gt(st,t)}static fromString(e){let t=e.match(Tt);t||ot.throwArgumentError("invalid event string","value",e);let r=!1;return t[3].split(" ").forEach((e=>{switch(e.trim()){case"anonymous":r=!0;break;case"":break;default:ot.warn("unknown modifier: "+e)}})),gt.fromObject({name:t[1].trim(),anonymous:r,inputs:pt(t[2],!0),type:"event"})}static isEventFragment(e){return e&&e._isFragment&&"event"===e.type}}function yt(e,t){t.gas=null;let r=e.split("@");return 1!==r.length?(r.length>2&&ot.throwArgumentError("invalid human-readable ABI signature","value",e),r[1].match(/^[0-9]+$/)||ot.throwArgumentError("invalid human-readable ABI signature gas","value",e),t.gas=Pe.from(r[1]),r[0]):e}function bt(e,t){t.constant=!1,t.payable=!1,t.stateMutability="nonpayable",e.split(" ").forEach((e=>{switch(e.trim()){case"constant":t.constant=!0;break;case"payable":t.payable=!0,t.stateMutability="payable";break;case"nonpayable":t.payable=!1,t.stateMutability="nonpayable";break;case"pure":t.constant=!0,t.stateMutability="pure";break;case"view":t.constant=!0,t.stateMutability="view";break;case"external":case"public":case"":break;default:console.log("unknown modifier: "+e)}}))}function vt(e){let t={constant:!1,payable:!0,stateMutability:"payable"};return null!=e.stateMutability?(t.stateMutability=e.stateMutability,t.constant="view"===t.stateMutability||"pure"===t.stateMutability,null!=e.constant&&!!e.constant!==t.constant&&ot.throwArgumentError("cannot have constant function with mutability "+t.stateMutability,"value",e),t.payable="payable"===t.stateMutability,null!=e.payable&&!!e.payable!==t.payable&&ot.throwArgumentError("cannot have payable function with mutability "+t.stateMutability,"value",e)):null!=e.payable?(t.payable=!!e.payable,null!=e.constant||t.payable||"constructor"===e.type||ot.throwArgumentError("unable to determine stateMutability","value",e),t.constant=!!e.constant,t.constant?t.stateMutability="view":t.stateMutability=t.payable?"payable":"nonpayable",t.payable&&t.constant&&ot.throwArgumentError("cannot have constant payable function","value",e)):null!=e.constant?(t.constant=!!e.constant,t.payable=!t.constant,t.stateMutability=t.constant?"view":"payable"):"constructor"!==e.type&&ot.throwArgumentError("unable to determine stateMutability","value",e),t}class wt extends mt{format(e){if(e||(e=ht.sighash),ht[e]||ot.throwArgumentError("invalid format type","format",e),e===ht.json)return JSON.stringify({type:"constructor",stateMutability:"nonpayable"!==this.stateMutability?this.stateMutability:void 0,payable:this.payable,gas:this.gas?this.gas.toNumber():void 0,inputs:this.inputs.map((t=>JSON.parse(t.format(e))))});e===ht.sighash&&ot.throwError("cannot format a constructor for sighash",ee.errors.UNSUPPORTED_OPERATION,{operation:"format(sighash)"});let t="constructor("+this.inputs.map((t=>t.format(e))).join(e===ht.full?", ":",")+") ";return this.stateMutability&&"nonpayable"!==this.stateMutability&&(t+=this.stateMutability+" "),t.trim()}static from(e){return"string"==typeof e?wt.fromString(e):wt.fromObject(e)}static fromObject(e){if(wt.isConstructorFragment(e))return e;"constructor"!==e.type&&ot.throwArgumentError("invalid constructor object","value",e);let t=vt(e);t.constant&&ot.throwArgumentError("constructor cannot be constant","value",e);const r={name:null,type:e.type,inputs:e.inputs?e.inputs.map(ft.fromObject):[],payable:t.payable,stateMutability:t.stateMutability,gas:e.gas?Pe.from(e.gas):null};return new wt(st,r)}static fromString(e){let t={type:"constructor"},r=(e=yt(e,t)).match(Tt);return r&&"constructor"===r[1].trim()||ot.throwArgumentError("invalid constructor string","value",e),t.inputs=pt(r[2].trim(),!1),bt(r[3].trim(),t),wt.fromObject(t)}static isConstructorFragment(e){return e&&e._isFragment&&"constructor"===e.type}}class xt extends wt{format(e){if(e||(e=ht.sighash),ht[e]||ot.throwArgumentError("invalid format type","format",e),e===ht.json)return JSON.stringify({type:"function",name:this.name,constant:this.constant,stateMutability:"nonpayable"!==this.stateMutability?this.stateMutability:void 0,payable:this.payable,gas:this.gas?this.gas.toNumber():void 0,inputs:this.inputs.map((t=>JSON.parse(t.format(e)))),outputs:this.outputs.map((t=>JSON.parse(t.format(e))))});let t="";return e!==ht.sighash&&(t+="function "),t+=this.name+"("+this.inputs.map((t=>t.format(e))).join(e===ht.full?", ":",")+") ",e!==ht.sighash&&(this.stateMutability?"nonpayable"!==this.stateMutability&&(t+=this.stateMutability+" "):this.constant&&(t+="view "),this.outputs&&this.outputs.length&&(t+="returns ("+this.outputs.map((t=>t.format(e))).join(", ")+") "),null!=this.gas&&(t+="@"+this.gas.toString()+" ")),t.trim()}static from(e){return"string"==typeof e?xt.fromString(e):xt.fromObject(e)}static fromObject(e){if(xt.isFunctionFragment(e))return e;"function"!==e.type&&ot.throwArgumentError("invalid function object","value",e);let t=vt(e);const r={type:e.type,name:Nt(e.name),constant:t.constant,inputs:e.inputs?e.inputs.map(ft.fromObject):[],outputs:e.outputs?e.outputs.map(ft.fromObject):[],payable:t.payable,stateMutability:t.stateMutability,gas:e.gas?Pe.from(e.gas):null};return new xt(st,r)}static fromString(e){let t={type:"function"},r=(e=yt(e,t)).split(" returns ");r.length>2&&ot.throwArgumentError("invalid function string","value",e);let n=r[0].match(Tt);if(n||ot.throwArgumentError("invalid function signature","value",e),t.name=n[1].trim(),t.name&&Nt(t.name),t.inputs=pt(n[2],!1),bt(n[3].trim(),t),r.length>1){let n=r[1].match(Tt);""==n[1].trim()&&""==n[3].trim()||ot.throwArgumentError("unexpected tokens","value",e),t.outputs=pt(n[2],!1)}else t.outputs=[];return xt.fromObject(t)}static isFunctionFragment(e){return e&&e._isFragment&&"function"===e.type}}function kt(e){const t=e.format();return"Error(string)"!==t&&"Panic(uint256)"!==t||ot.throwArgumentError(`cannot specify user defined ${t} error`,"fragment",e),e}class St extends mt{format(e){if(e||(e=ht.sighash),ht[e]||ot.throwArgumentError("invalid format type","format",e),e===ht.json)return JSON.stringify({type:"error",name:this.name,inputs:this.inputs.map((t=>JSON.parse(t.format(e))))});let t="";return e!==ht.sighash&&(t+="error "),t+=this.name+"("+this.inputs.map((t=>t.format(e))).join(e===ht.full?", ":",")+") ",t.trim()}static from(e){return"string"==typeof e?St.fromString(e):St.fromObject(e)}static fromObject(e){if(St.isErrorFragment(e))return e;"error"!==e.type&&ot.throwArgumentError("invalid error object","value",e);const t={type:e.type,name:Nt(e.name),inputs:e.inputs?e.inputs.map(ft.fromObject):[]};return kt(new St(st,t))}static fromString(e){let t={type:"error"},r=e.match(Tt);return r||ot.throwArgumentError("invalid error signature","value",e),t.name=r[1].trim(),t.name&&Nt(t.name),t.inputs=pt(r[2],!1),kt(St.fromObject(t))}static isErrorFragment(e){return e&&e._isFragment&&"error"===e.type}}function Et(e){return e.match(/^uint($|[^1-9])/)?e="uint256"+e.substring(4):e.match(/^int($|[^1-9])/)&&(e="int256"+e.substring(3)),e}const At=new RegExp("^[a-zA-Z$_][a-zA-Z0-9$_]*$");function Nt(e){return e&&e.match(At)||ot.throwArgumentError(`invalid identifier "${e}"`,"value",e),e}const Tt=new RegExp("^([^)(]*)\\((.*)\\)([^)(]*)$");const Pt=new ee(it);function Mt(e){const t=[],r=function(e,n){if(Array.isArray(n))for(let o in n){const s=e.slice();s.push(o);try{r(s,n[o])}catch(i){t.push({path:s,error:i})}}};return r([],e),t}class It{constructor(e,t,r,n){this.name=e,this.type=t,this.localName=r,this.dynamic=n}_throwError(e,t){Pt.throwArgumentError(e,this.localName,t)}}class Ct{constructor(e){Ge(this,"wordSize",e||32),this._data=[],this._dataLength=0,this._padding=new Uint8Array(e)}get data(){return ge(this._data)}get length(){return this._dataLength}_writeData(e){return this._data.push(e),this._dataLength+=e.length,e.length}appendWriter(e){return this._writeData(ce(e._data))}writeBytes(e){let t=ae(e);const r=t.length%this.wordSize;return r&&(t=ce([t,this._padding.slice(r)])),this._writeData(t)}_getValue(e){let t=ae(Pe.from(e));return t.length>this.wordSize&&Pt.throwError("value out-of-bounds",ee.errors.BUFFER_OVERRUN,{length:this.wordSize,offset:t.length}),t.length%this.wordSize&&(t=ce([this._padding.slice(t.length%this.wordSize),t])),t}writeValue(e){return this._writeData(this._getValue(e))}writeUpdatableValue(){const e=this._data.length;return this._data.push(this._padding),this._dataLength+=this.wordSize,t=>{this._data[e]=this._getValue(t)}}}class Rt{constructor(e,t,r,n){Ge(this,"_data",ae(e)),Ge(this,"wordSize",t||32),Ge(this,"_coerceFunc",r),Ge(this,"allowLoose",n),this._offset=0}get data(){return fe(this._data)}get consumed(){return this._offset}static coerce(e,t){let r=e.match("^u?int([0-9]+)$");return r&&parseInt(r[1])<=48&&(t=t.toNumber()),t}coerce(e,t){return this._coerceFunc?this._coerceFunc(e,t):Rt.coerce(e,t)}_peekBytes(e,t,r){let n=Math.ceil(t/this.wordSize)*this.wordSize;return this._offset+n>this._data.length&&(this.allowLoose&&r&&this._offset+t<=this._data.length?n=t:Pt.throwError("data out-of-bounds",ee.errors.BUFFER_OVERRUN,{length:this._data.length,offset:this._offset+n})),this._data.slice(this._offset,this._offset+n)}subReader(e){return new Rt(this._data.slice(this._offset+e),this.wordSize,this._coerceFunc,this.allowLoose)}readBytes(e,t){let r=this._peekBytes(0,e,!!t);return this._offset+=r.length,r.slice(0,e)}readValue(){return Pe.from(this.readBytes(this.wordSize))}}var Bt=r(83669),Ot=r.n(Bt);function Lt(e){return"0x"+Ot().keccak_256(ae(e))}const zt=new ee("rlp/5.6.0");function Ut(e){const t=[];for(;e;)t.unshift(255&e),e>>=8;return t}function _t(e,t,r){let n=0;for(let i=0;i<r;i++)n=256*n+e[t+i];return n}function qt(e){if(Array.isArray(e)){let t=[];if(e.forEach((function(e){t=t.concat(qt(e))})),t.length<=55)return t.unshift(192+t.length),t;const r=Ut(t.length);return r.unshift(247+r.length),r.concat(t)}ie(e)||zt.throwArgumentError("RLP object must be BytesLike","object",e);const t=Array.prototype.slice.call(ae(e));if(1===t.length&&t[0]<=127)return t;if(t.length<=55)return t.unshift(128+t.length),t;const r=Ut(t.length);return r.unshift(183+r.length),r.concat(t)}function Dt(e){return fe(qt(e))}function Vt(e,t,r,n){const i=[];for(;r<t+1+n;){const o=jt(e,r);i.push(o.result),(r+=o.consumed)>t+1+n&&zt.throwError("child data too short",ee.errors.BUFFER_OVERRUN,{})}return{consumed:1+n,result:i}}function jt(e,t){if(0===e.length&&zt.throwError("data too short",ee.errors.BUFFER_OVERRUN,{}),e[t]>=248){const r=e[t]-247;t+1+r>e.length&&zt.throwError("data short segment too short",ee.errors.BUFFER_OVERRUN,{});const n=_t(e,t+1,r);return t+1+r+n>e.length&&zt.throwError("data long segment too short",ee.errors.BUFFER_OVERRUN,{}),Vt(e,t,t+1+r,r+n)}if(e[t]>=192){const r=e[t]-192;return t+1+r>e.length&&zt.throwError("data array too short",ee.errors.BUFFER_OVERRUN,{}),Vt(e,t,t+1,r)}if(e[t]>=184){const r=e[t]-183;t+1+r>e.length&&zt.throwError("data array too short",ee.errors.BUFFER_OVERRUN,{});const n=_t(e,t+1,r);t+1+r+n>e.length&&zt.throwError("data array too short",ee.errors.BUFFER_OVERRUN,{});return{consumed:1+r+n,result:fe(e.slice(t+1+r,t+1+r+n))}}if(e[t]>=128){const r=e[t]-128;t+1+r>e.length&&zt.throwError("data too short",ee.errors.BUFFER_OVERRUN,{});return{consumed:1+r,result:fe(e.slice(t+1,t+1+r))}}return{consumed:1,result:fe(e[t])}}function Ft(e){const t=ae(e),r=jt(t,0);return r.consumed!==t.length&&zt.throwArgumentError("invalid rlp data","data",e),r.result}const Ht=new ee("address/5.6.0");function Wt(e){he(e,20)||Ht.throwArgumentError("invalid address","address",e);const t=(e=e.toLowerCase()).substring(2).split(""),r=new Uint8Array(40);for(let i=0;i<40;i++)r[i]=t[i].charCodeAt(0);const n=ae(Lt(r));for(let i=0;i<40;i+=2)n[i>>1]>>4>=8&&(t[i]=t[i].toUpperCase()),(15&n[i>>1])>=8&&(t[i+1]=t[i+1].toUpperCase());return"0x"+t.join("")}const Kt={};for(let d2=0;d2<10;d2++)Kt[String(d2)]=String(d2);for(let d2=0;d2<26;d2++)Kt[String.fromCharCode(65+d2)]=String(10+d2);const Xt=Math.floor((Gt=9007199254740991,Math.log10?Math.log10(Gt):Math.log(Gt)/Math.LN10));var Gt;function Zt(e){let t=(e=(e=e.toUpperCase()).substring(4)+e.substring(0,2)+"00").split("").map((e=>Kt[e])).join("");for(;t.length>=Xt;){let e=t.substring(0,Xt);t=parseInt(e,10)%97+t.substring(e.length)}let r=String(98-parseInt(t,10)%97);for(;r.length<2;)r="0"+r;return r}function Jt(e){let t=null;if("string"!=typeof e&&Ht.throwArgumentError("invalid address","address",e),e.match(/^(0x)?[0-9a-fA-F]{40}$/))"0x"!==e.substring(0,2)&&(e="0x"+e),t=Wt(e),e.match(/([A-F].*[a-f])|([a-f].*[A-F])/)&&t!==e&&Ht.throwArgumentError("bad address checksum","address",e);else if(e.match(/^XE[0-9]{2}[0-9A-Za-z]{30,31}$/)){for(e.substring(2,4)!==Zt(e)&&Ht.throwArgumentError("bad icap checksum","address",e),r=e.substring(4),t=new Se(r,36).toString(16);t.length<40;)t="0"+t;t=Wt("0x"+t)}else Ht.throwArgumentError("invalid address","address",e);var r;return t}function Yt(e){try{return Jt(e),!0}catch(t){}return!1}function Qt(e){let t=(r=Jt(e).substring(2),new Se(r,16).toString(36)).toUpperCase();for(var r;t.length<30;)t="0"+t;return"XE"+Zt("XE00"+t)+t}function $t(e){let t=null;try{t=Jt(e.from)}catch(r){Ht.throwArgumentError("missing from address","transaction",e)}return Jt(me(Lt(Dt([t,ue(ae(Pe.from(e.nonce).toHexString()))])),12))}function er(e,t,r){return 32!==pe(t)&&Ht.throwArgumentError("salt must be 32 bytes","salt",t),32!==pe(r)&&Ht.throwArgumentError("initCodeHash must be 32 bytes","initCodeHash",r),Jt(me(Lt(ce(["0xff",Jt(e),t,r])),12))}class tr extends It{constructor(e){super("address","address",e,!1)}defaultValue(){return"0x0000000000000000000000000000000000000000"}encode(e,t){try{t=Jt(t)}catch(r){this._throwError(r.message,t)}return e.writeValue(t)}decode(e){return Jt(ve(e.readValue().toHexString(),20))}}class rr extends It{constructor(e){super(e.name,e.type,void 0,e.dynamic),this.coder=e}defaultValue(){return this.coder.defaultValue()}encode(e,t){return this.coder.encode(e,t)}decode(e){return this.coder.decode(e)}}const nr=new ee(it);function ir(e,t,r){let n=null;if(Array.isArray(r))n=r;else if(r&&"object"==typeof r){let e={};n=t.map((t=>{const n=t.localName;return n||nr.throwError("cannot encode object for signature with missing names",ee.errors.INVALID_ARGUMENT,{argument:"values",coder:t,value:r}),e[n]&&nr.throwError("cannot encode object for signature with duplicate names",ee.errors.INVALID_ARGUMENT,{argument:"values",coder:t,value:r}),e[n]=!0,r[n]}))}else nr.throwArgumentError("invalid tuple value","tuple",r);t.length!==n.length&&nr.throwArgumentError("types/value length mismatch","tuple",r);let i=new Ct(e.wordSize),o=new Ct(e.wordSize),s=[];t.forEach(((e,t)=>{let r=n[t];if(e.dynamic){let t=o.length;e.encode(o,r);let n=i.writeUpdatableValue();s.push((e=>{n(e+t)}))}else e.encode(i,r)})),s.forEach((e=>{e(i.length)}));let a=e.appendWriter(i);return a+=e.appendWriter(o),a}function or(e,t){let r=[],n=e.subReader(0);t.forEach((t=>{let i=null;if(t.dynamic){let r=e.readValue(),s=n.subReader(r.toNumber());try{i=t.decode(s)}catch(o){if(o.code===ee.errors.BUFFER_OVERRUN)throw o;i=o,i.baseType=t.name,i.name=t.localName,i.type=t.type}}else try{i=t.decode(e)}catch(o){if(o.code===ee.errors.BUFFER_OVERRUN)throw o;i=o,i.baseType=t.name,i.name=t.localName,i.type=t.type}null!=i&&r.push(i)}));const i=t.reduce(((e,t)=>{const r=t.localName;return r&&(e[r]||(e[r]=0),e[r]++),e}),{});t.forEach(((e,t)=>{let n=e.localName;if(!n||1!==i[n])return;if("length"===n&&(n="_length"),null!=r[n])return;const o=r[t];o instanceof Error?Object.defineProperty(r,n,{enumerable:!0,get:()=>{throw o}}):r[n]=o}));for(let o=0;o<r.length;o++){const e=r[o];e instanceof Error&&Object.defineProperty(r,o,{enumerable:!0,get:()=>{throw e}})}return Object.freeze(r)}class sr extends It{constructor(e,t,r){super("array",e.type+"["+(t>=0?t:"")+"]",r,-1===t||e.dynamic),this.coder=e,this.length=t}defaultValue(){const e=this.coder.defaultValue(),t=[];for(let r=0;r<this.length;r++)t.push(e);return t}encode(e,t){Array.isArray(t)||this._throwError("expected array value",t);let r=this.length;-1===r&&(r=t.length,e.writeValue(t.length)),nr.checkArgumentCount(t.length,r,"coder array"+(this.localName?" "+this.localName:""));let n=[];for(let i=0;i<t.length;i++)n.push(this.coder);return ir(e,n,t)}decode(e){let t=this.length;-1===t&&(t=e.readValue().toNumber(),32*t>e._data.length&&nr.throwError("insufficient data length",ee.errors.BUFFER_OVERRUN,{length:e._data.length,count:t}));let r=[];for(let n=0;n<t;n++)r.push(new rr(this.coder));return e.coerce(this.name,or(e,r))}}class ar extends It{constructor(e){super("bool","bool",e,!1)}defaultValue(){return!1}encode(e,t){return e.writeValue(t?1:0)}decode(e){return e.coerce(this.type,!e.readValue().isZero())}}class cr extends It{constructor(e,t){super(e,e,t,!0)}defaultValue(){return"0x"}encode(e,t){t=ae(t);let r=e.writeValue(t.length);return r+=e.writeBytes(t),r}decode(e){return e.readBytes(e.readValue().toNumber(),!0)}}class ur extends cr{constructor(e){super("bytes",e)}decode(e){return e.coerce(this.name,fe(super.decode(e)))}}class lr extends It{constructor(e,t){let r="bytes"+String(e);super(r,r,t,!1),this.size=e}defaultValue(){return"0x0000000000000000000000000000000000000000000000000000000000000000".substring(0,2+2*this.size)}encode(e,t){let r=ae(t);return r.length!==this.size&&this._throwError("incorrect data length",t),e.writeBytes(r)}decode(e){return e.coerce(this.name,fe(e.readBytes(this.size)))}}class hr extends It{constructor(e){super("null","",e,!1)}defaultValue(){return null}encode(e,t){return null!=t&&this._throwError("not null",t),e.writeBytes([])}decode(e){return e.readBytes(0),e.coerce(this.name,null)}}const dr="0x0000000000000000000000000000000000000000",fr=Pe.from(-1),pr=Pe.from(0),mr=Pe.from(1),gr=Pe.from(2),yr=Pe.from("1000000000000000000"),br=Pe.from("0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff"),vr=Pe.from("-0x8000000000000000000000000000000000000000000000000000000000000000"),wr=Pe.from("0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff"),xr="0x0000000000000000000000000000000000000000000000000000000000000000",kr="\u039e";class Sr extends It{constructor(e,t,r){const n=(t?"int":"uint")+8*e;super(n,n,r,!1),this.size=e,this.signed=t}defaultValue(){return 0}encode(e,t){let r=Pe.from(t),n=br.mask(8*e.wordSize);if(this.signed){let e=n.mask(8*this.size-1);(r.gt(e)||r.lt(e.add(mr).mul(fr)))&&this._throwError("value out-of-bounds",t)}else(r.lt(pr)||r.gt(n.mask(8*this.size)))&&this._throwError("value out-of-bounds",t);return r=r.toTwos(8*this.size).mask(8*this.size),this.signed&&(r=r.fromTwos(8*this.size).toTwos(8*e.wordSize)),e.writeValue(r)}decode(e){let t=e.readValue().mask(8*this.size);return this.signed&&(t=t.fromTwos(8*this.size)),e.coerce(this.name,t)}}const Er=new ee("strings/5.6.0");var Ar,Nr;function Tr(e,t,r,n,i){if(e===Nr.BAD_PREFIX||e===Nr.UNEXPECTED_CONTINUE){let e=0;for(let n=t+1;n<r.length&&r[n]>>6==2;n++)e++;return e}return e===Nr.OVERRUN?r.length-t-1:0}!function(e){e.current="",e.NFC="NFC",e.NFD="NFD",e.NFKC="NFKC",e.NFKD="NFKD"}(Ar||(Ar={})),function(e){e.UNEXPECTED_CONTINUE="unexpected continuation byte",e.BAD_PREFIX="bad codepoint prefix",e.OVERRUN="string overrun",e.MISSING_CONTINUE="missing continuation byte",e.OUT_OF_RANGE="out of UTF-8 range",e.UTF16_SURROGATE="UTF-16 surrogate",e.OVERLONG="overlong representation"}(Nr||(Nr={}));const Pr=Object.freeze({error:function(e,t,r,n,i){return Er.throwArgumentError(`invalid codepoint at offset ${t}; ${e}`,"bytes",r)},ignore:Tr,replace:function(e,t,r,n,i){return e===Nr.OVERLONG?(n.push(i),0):(n.push(65533),Tr(e,t,r))}});function Mr(e,t){null==t&&(t=Pr.error),e=ae(e);const r=[];let n=0;for(;n<e.length;){const i=e[n++];if(i>>7==0){r.push(i);continue}let o=null,s=null;if(192==(224&i))o=1,s=127;else if(224==(240&i))o=2,s=2047;else{if(240!=(248&i)){n+=t(128==(192&i)?Nr.UNEXPECTED_CONTINUE:Nr.BAD_PREFIX,n-1,e,r);continue}o=3,s=65535}if(n-1+o>=e.length){n+=t(Nr.OVERRUN,n-1,e,r);continue}let a=i&(1<<8-o-1)-1;for(let c=0;c<o;c++){let i=e[n];if(128!=(192&i)){n+=t(Nr.MISSING_CONTINUE,n,e,r),a=null;break}a=a<<6|63&i,n++}null!==a&&(a>1114111?n+=t(Nr.OUT_OF_RANGE,n-1-o,e,r,a):a>=55296&&a<=57343?n+=t(Nr.UTF16_SURROGATE,n-1-o,e,r,a):a<=s?n+=t(Nr.OVERLONG,n-1-o,e,r,a):r.push(a))}return r}function Ir(e,t=Ar.current){t!=Ar.current&&(Er.checkNormalize(),e=e.normalize(t));let r=[];for(let n=0;n<e.length;n++){const t=e.charCodeAt(n);if(t<128)r.push(t);else if(t<2048)r.push(t>>6|192),r.push(63&t|128);else if(55296==(64512&t)){n++;const i=e.charCodeAt(n);if(n>=e.length||56320!=(64512&i))throw new Error("invalid utf-8 string");const o=65536+((1023&t)<<10)+(1023&i);r.push(o>>18|240),r.push(o>>12&63|128),r.push(o>>6&63|128),r.push(63&o|128)}else r.push(t>>12|224),r.push(t>>6&63|128),r.push(63&t|128)}return ae(r)}function Cr(e){const t="0000"+e.toString(16);return"\\u"+t.substring(t.length-4)}function Rr(e,t){return'"'+Mr(e,t).map((e=>{if(e<256){switch(e){case 8:return"\\b";case 9:return"\\t";case 10:return"\\n";case 13:return"\\r";case 34:return'\\"';case 92:return"\\\\"}if(e>=32&&e<127)return String.fromCharCode(e)}return e<=65535?Cr(e):Cr(55296+((e-=65536)>>10&1023))+Cr(56320+(1023&e))})).join("")+'"'}function Br(e){return e.map((e=>e<=65535?String.fromCharCode(e):(e-=65536,String.fromCharCode(55296+(e>>10&1023),56320+(1023&e))))).join("")}function Or(e,t){return Br(Mr(e,t))}function Lr(e,t=Ar.current){return Mr(Ir(e,t))}function zr(e){const t=Ir(e);if(t.length>31)throw new Error("bytes32 string must be less than 32 bytes");return fe(ce([t,xr]).slice(0,32))}function Ur(e){const t=ae(e);if(32!==t.length)throw new Error("invalid bytes32 - not 32 bytes long");if(0!==t[31])throw new Error("invalid bytes32 string - no null terminator");let r=31;for(;0===t[r-1];)r--;return Or(t.slice(0,r))}function _r(e,t){t||(t=function(e){return[parseInt(e,16)]});let r=0,n={};return e.split(",").forEach((e=>{let i=e.split(":");r+=parseInt(i[0],16),n[r]=t(i[1])})),n}function qr(e){let t=0;return e.split(",").map((e=>{let r=e.split("-");1===r.length?r[1]="0":""===r[1]&&(r[1]="1");let n=t+parseInt(r[0],16);return t=parseInt(r[1],16),{l:n,h:t}}))}function Dr(e,t){let r=0;for(let n=0;n<t.length;n++){let i=t[n];if(r+=i.l,e>=r&&e<=r+i.h&&(e-r)%(i.d||1)==0){if(i.e&&-1!==i.e.indexOf(e-r))continue;return i}}return null}const Vr=qr("221,13-1b,5f-,40-10,51-f,11-3,3-3,2-2,2-4,8,2,15,2d,28-8,88,48,27-,3-5,11-20,27-,8,28,3-5,12,18,b-a,1c-4,6-16,2-d,2-2,2,1b-4,17-9,8f-,10,f,1f-2,1c-34,33-14e,4,36-,13-,6-2,1a-f,4,9-,3-,17,8,2-2,5-,2,8-,3-,4-8,2-3,3,6-,16-6,2-,7-3,3-,17,8,3,3,3-,2,6-3,3-,4-a,5,2-6,10-b,4,8,2,4,17,8,3,6-,b,4,4-,2-e,2-4,b-10,4,9-,3-,17,8,3-,5-,9-2,3-,4-7,3-3,3,4-3,c-10,3,7-2,4,5-2,3,2,3-2,3-2,4-2,9,4-3,6-2,4,5-8,2-e,d-d,4,9,4,18,b,6-3,8,4,5-6,3-8,3-3,b-11,3,9,4,18,b,6-3,8,4,5-6,3-6,2,3-3,b-11,3,9,4,18,11-3,7-,4,5-8,2-7,3-3,b-11,3,13-2,19,a,2-,8-2,2-3,7,2,9-11,4-b,3b-3,1e-24,3,2-,3,2-,2-5,5,8,4,2,2-,3,e,4-,6,2,7-,b-,3-21,49,23-5,1c-3,9,25,10-,2-2f,23,6,3,8-2,5-5,1b-45,27-9,2a-,2-3,5b-4,45-4,53-5,8,40,2,5-,8,2,5-,28,2,5-,20,2,5-,8,2,5-,8,8,18,20,2,5-,8,28,14-5,1d-22,56-b,277-8,1e-2,52-e,e,8-a,18-8,15-b,e,4,3-b,5e-2,b-15,10,b-5,59-7,2b-555,9d-3,5b-5,17-,7-,27-,7-,9,2,2,2,20-,36,10,f-,7,14-,4,a,54-3,2-6,6-5,9-,1c-10,13-1d,1c-14,3c-,10-6,32-b,240-30,28-18,c-14,a0,115-,3,66-,b-76,5,5-,1d,24,2,5-2,2,8-,35-2,19,f-10,1d-3,311-37f,1b,5a-b,d7-19,d-3,41,57-,68-4,29-3,5f,29-37,2e-2,25-c,2c-2,4e-3,30,78-3,64-,20,19b7-49,51a7-59,48e-2,38-738,2ba5-5b,222f-,3c-94,8-b,6-4,1b,6,2,3,3,6d-20,16e-f,41-,37-7,2e-2,11-f,5-b,18-,b,14,5-3,6,88-,2,bf-2,7-,7-,7-,4-2,8,8-9,8-2ff,20,5-b,1c-b4,27-,27-cbb1,f7-9,28-2,b5-221,56,48,3-,2-,3-,5,d,2,5,3,42,5-,9,8,1d,5,6,2-2,8,153-3,123-3,33-27fd,a6da-5128,21f-5df,3-fffd,3-fffd,3-fffd,3-fffd,3-fffd,3-fffd,3-fffd,3-fffd,3-fffd,3-fffd,3-fffd,3,2-1d,61-ff7d"),jr="ad,34f,1806,180b,180c,180d,200b,200c,200d,2060,feff".split(",").map((e=>parseInt(e,16))),Fr=[{h:25,s:32,l:65},{h:30,s:32,e:[23],l:127},{h:54,s:1,e:[48],l:64,d:2},{h:14,s:1,l:57,d:2},{h:44,s:1,l:17,d:2},{h:10,s:1,e:[2,6,8],l:61,d:2},{h:16,s:1,l:68,d:2},{h:84,s:1,e:[18,24,66],l:19,d:2},{h:26,s:32,e:[17],l:435},{h:22,s:1,l:71,d:2},{h:15,s:80,l:40},{h:31,s:32,l:16},{h:32,s:1,l:80,d:2},{h:52,s:1,l:42,d:2},{h:12,s:1,l:55,d:2},{h:40,s:1,e:[38],l:15,d:2},{h:14,s:1,l:48,d:2},{h:37,s:48,l:49},{h:148,s:1,l:6351,d:2},{h:88,s:1,l:160,d:2},{h:15,s:16,l:704},{h:25,s:26,l:854},{h:25,s:32,l:55915},{h:37,s:40,l:1247},{h:25,s:-119711,l:53248},{h:25,s:-119763,l:52},{h:25,s:-119815,l:52},{h:25,s:-119867,e:[1,4,5,7,8,11,12,17],l:52},{h:25,s:-119919,l:52},{h:24,s:-119971,e:[2,7,8,17],l:52},{h:24,s:-120023,e:[2,7,13,15,16,17],l:52},{h:25,s:-120075,l:52},{h:25,s:-120127,l:52},{h:25,s:-120179,l:52},{h:25,s:-120231,l:52},{h:25,s:-120283,l:52},{h:25,s:-120335,l:52},{h:24,s:-119543,e:[17],l:56},{h:24,s:-119601,e:[17],l:58},{h:24,s:-119659,e:[17],l:58},{h:24,s:-119717,e:[17],l:58},{h:24,s:-119775,e:[17],l:58}],Hr=_r("b5:3bc,c3:ff,7:73,2:253,5:254,3:256,1:257,5:259,1:25b,3:260,1:263,2:269,1:268,5:26f,1:272,2:275,7:280,3:283,5:288,3:28a,1:28b,5:292,3f:195,1:1bf,29:19e,125:3b9,8b:3b2,1:3b8,1:3c5,3:3c6,1:3c0,1a:3ba,1:3c1,1:3c3,2:3b8,1:3b5,1bc9:3b9,1c:1f76,1:1f77,f:1f7a,1:1f7b,d:1f78,1:1f79,1:1f7c,1:1f7d,107:63,5:25b,4:68,1:68,1:68,3:69,1:69,1:6c,3:6e,4:70,1:71,1:72,1:72,1:72,7:7a,2:3c9,2:7a,2:6b,1:e5,1:62,1:63,3:65,1:66,2:6d,b:3b3,1:3c0,6:64,1b574:3b8,1a:3c3,20:3b8,1a:3c3,20:3b8,1a:3c3,20:3b8,1a:3c3,20:3b8,1a:3c3"),Wr=_r("179:1,2:1,2:1,5:1,2:1,a:4f,a:1,8:1,2:1,2:1,3:1,5:1,3:1,4:1,2:1,3:1,4:1,8:2,1:1,2:2,1:1,2:2,27:2,195:26,2:25,1:25,1:25,2:40,2:3f,1:3f,33:1,11:-6,1:-9,1ac7:-3a,6d:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,9:-8,1:-8,1:-8,1:-8,1:-8,1:-8,b:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,9:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,9:-8,1:-8,1:-8,1:-8,1:-8,1:-8,c:-8,2:-8,2:-8,2:-8,9:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,49:-8,1:-8,1:-4a,1:-4a,d:-56,1:-56,1:-56,1:-56,d:-8,1:-8,f:-8,1:-8,3:-7"),Kr=_r("df:00730073,51:00690307,19:02BC006E,a7:006A030C,18a:002003B9,16:03B903080301,20:03C503080301,1d7:05650582,190f:00680331,1:00740308,1:0077030A,1:0079030A,1:006102BE,b6:03C50313,2:03C503130300,2:03C503130301,2:03C503130342,2a:1F0003B9,1:1F0103B9,1:1F0203B9,1:1F0303B9,1:1F0403B9,1:1F0503B9,1:1F0603B9,1:1F0703B9,1:1F0003B9,1:1F0103B9,1:1F0203B9,1:1F0303B9,1:1F0403B9,1:1F0503B9,1:1F0603B9,1:1F0703B9,1:1F2003B9,1:1F2103B9,1:1F2203B9,1:1F2303B9,1:1F2403B9,1:1F2503B9,1:1F2603B9,1:1F2703B9,1:1F2003B9,1:1F2103B9,1:1F2203B9,1:1F2303B9,1:1F2403B9,1:1F2503B9,1:1F2603B9,1:1F2703B9,1:1F6003B9,1:1F6103B9,1:1F6203B9,1:1F6303B9,1:1F6403B9,1:1F6503B9,1:1F6603B9,1:1F6703B9,1:1F6003B9,1:1F6103B9,1:1F6203B9,1:1F6303B9,1:1F6403B9,1:1F6503B9,1:1F6603B9,1:1F6703B9,3:1F7003B9,1:03B103B9,1:03AC03B9,2:03B10342,1:03B1034203B9,5:03B103B9,6:1F7403B9,1:03B703B9,1:03AE03B9,2:03B70342,1:03B7034203B9,5:03B703B9,6:03B903080300,1:03B903080301,3:03B90342,1:03B903080342,b:03C503080300,1:03C503080301,1:03C10313,2:03C50342,1:03C503080342,b:1F7C03B9,1:03C903B9,1:03CE03B9,2:03C90342,1:03C9034203B9,5:03C903B9,ac:00720073,5b:00B00063,6:00B00066,d:006E006F,a:0073006D,1:00740065006C,1:0074006D,124f:006800700061,2:00610075,2:006F0076,b:00700061,1:006E0061,1:03BC0061,1:006D0061,1:006B0061,1:006B0062,1:006D0062,1:00670062,3:00700066,1:006E0066,1:03BC0066,4:0068007A,1:006B0068007A,1:006D0068007A,1:00670068007A,1:00740068007A,15:00700061,1:006B00700061,1:006D00700061,1:006700700061,8:00700076,1:006E0076,1:03BC0076,1:006D0076,1:006B0076,1:006D0076,1:00700077,1:006E0077,1:03BC0077,1:006D0077,1:006B0077,1:006D0077,1:006B03C9,1:006D03C9,2:00620071,3:00632215006B0067,1:0063006F002E,1:00640062,1:00670079,2:00680070,2:006B006B,1:006B006D,9:00700068,2:00700070006D,1:00700072,2:00730076,1:00770062,c723:00660066,1:00660069,1:0066006C,1:006600660069,1:00660066006C,1:00730074,1:00730074,d:05740576,1:05740565,1:0574056B,1:057E0576,1:0574056D",(function(e){if(e.length%4!=0)throw new Error("bad data");let t=[];for(let r=0;r<e.length;r+=4)t.push(parseInt(e.substring(r,r+4),16));return t})),Xr=qr("80-20,2a0-,39c,32,f71,18e,7f2-f,19-7,30-4,7-5,f81-b,5,a800-20ff,4d1-1f,110,fa-6,d174-7,2e84-,ffff-,ffff-,ffff-,ffff-,ffff-,ffff-,ffff-,ffff-,ffff-,ffff-,ffff-,ffff-,2,1f-5f,ff7f-20001");function Gr(e){if(e.match(/^[a-z0-9-]*$/i)&&e.length<=59)return e.toLowerCase();let t=Lr(e);var r;r=t.map((e=>{if(jr.indexOf(e)>=0)return[];if(e>=65024&&e<=65039)return[];let t=function(e){let t=Dr(e,Fr);if(t)return[e+t.s];let r=Hr[e];if(r)return r;let n=Wr[e];return n?[e+n[0]]:Kr[e]||null}(e);return t||[e]})),t=r.reduce(((e,t)=>(t.forEach((t=>{e.push(t)})),e)),[]),t=Lr(Br(t),Ar.NFKC),t.forEach((e=>{if(Dr(e,Xr))throw new Error("STRINGPREP_CONTAINS_PROHIBITED")})),t.forEach((e=>{if(Dr(e,Vr))throw new Error("STRINGPREP_CONTAINS_UNASSIGNED")}));let n=Br(t);if("-"===n.substring(0,1)||"--"===n.substring(2,4)||"-"===n.substring(n.length-1))throw new Error("invalid hyphen");if(n.length>63)throw new Error("too long");return n}class Zr extends cr{constructor(e){super("string",e)}defaultValue(){return""}encode(e,t){return super.encode(e,Ir(t))}decode(e){return Or(super.decode(e))}}class Jr extends It{constructor(e,t){let r=!1;const n=[];e.forEach((e=>{e.dynamic&&(r=!0),n.push(e.type)}));super("tuple","tuple("+n.join(",")+")",t,r),this.coders=e}defaultValue(){const e=[];this.coders.forEach((t=>{e.push(t.defaultValue())}));const t=this.coders.reduce(((e,t)=>{const r=t.localName;return r&&(e[r]||(e[r]=0),e[r]++),e}),{});return this.coders.forEach(((r,n)=>{let i=r.localName;i&&1===t[i]&&("length"===i&&(i="_length"),null==e[i]&&(e[i]=e[n]))})),Object.freeze(e)}encode(e,t){return ir(e,this.coders,t)}decode(e){return e.coerce(this.name,or(e,this.coders))}}const Yr=new ee(it),Qr=new RegExp(/^bytes([0-9]*)$/),$r=new RegExp(/^(u?int)([0-9]*)$/);class en{constructor(e){Ge(this,"coerceFunc",e||null)}_getCoder(e){switch(e.baseType){case"address":return new tr(e.name);case"bool":return new ar(e.name);case"string":return new Zr(e.name);case"bytes":return new ur(e.name);case"array":return new sr(this._getCoder(e.arrayChildren),e.arrayLength,e.name);case"tuple":return new Jr((e.components||[]).map((e=>this._getCoder(e))),e.name);case"":return new hr(e.name)}let t=e.type.match($r);if(t){let r=parseInt(t[2]||"256");return(0===r||r>256||r%8!=0)&&Yr.throwArgumentError("invalid "+t[1]+" bit length","param",e),new Sr(r/8,"int"===t[1],e.name)}if(t=e.type.match(Qr),t){let r=parseInt(t[1]);return(0===r||r>32)&&Yr.throwArgumentError("invalid bytes length","param",e),new lr(r,e.name)}return Yr.throwArgumentError("invalid type","type",e.type)}_getWordSize(){return 32}_getReader(e,t){return new Rt(e,this._getWordSize(),this.coerceFunc,t)}_getWriter(){return new Ct(this._getWordSize())}getDefaultValue(e){const t=e.map((e=>this._getCoder(ft.from(e))));return new Jr(t,"_").defaultValue()}encode(e,t){e.length!==t.length&&Yr.throwError("types/values length mismatch",ee.errors.INVALID_ARGUMENT,{count:{types:e.length,values:t.length},value:{types:e,values:t}});const r=e.map((e=>this._getCoder(ft.from(e)))),n=new Jr(r,"_"),i=this._getWriter();return n.encode(i,t),i.data}decode(e,t,r){const n=e.map((e=>this._getCoder(ft.from(e))));return new Jr(n,"_").decode(this._getReader(ae(t),r))}}const tn=new en;function rn(e){return Lt(Ir(e))}const nn="hash/5.6.0",on=new ee(nn),sn=new Uint8Array(32);sn.fill(0);const an=new RegExp("^((.*)\\.)?([^.]+)$");function cn(e){try{const t=e.split(".");for(let e=0;e<t.length;e++)if(0===Gr(t[e]).length)throw new Error("empty");return!0}catch(t){}return!1}function un(e){"string"!=typeof e&&on.throwArgumentError("invalid ENS name; not a string","name",e);let t=e,r=sn;for(;t.length;){const n=t.match(an);null!=n&&""!==n[2]||on.throwArgumentError("invalid ENS address; missing component","name",e);r=Lt(ce([r,Lt(Ir(Gr(n[3])))])),t=n[2]||""}return fe(r)}function ln(e){return fe(ce(e.split(".").map((e=>{const t=Ir("_"+Gr(e));return t[0]=t.length-1,t}))))+"00"}function hn(e){return"string"==typeof e&&(e=Ir(e)),Lt(ce([Ir("\x19Ethereum Signed Message:\n"),Ir(String(e.length)),e]))}var dn=function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{c(n.next(e))}catch(t){o(t)}}function a(e){try{c(n.throw(e))}catch(t){o(t)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}c((n=n.apply(e,t||[])).next())}))};const fn=new ee(nn),pn=new Uint8Array(32);pn.fill(0);const mn=Pe.from(-1),gn=Pe.from(0),yn=Pe.from(1),bn=Pe.from("0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff");const vn=ve(yn.toHexString(),32),wn=ve(gn.toHexString(),32),xn={name:"string",version:"string",chainId:"uint256",verifyingContract:"address",salt:"bytes32"},kn=["name","version","chainId","verifyingContract","salt"];function Sn(e){return function(t){return"string"!=typeof t&&fn.throwArgumentError(`invalid domain value for ${JSON.stringify(e)}`,`domain.${e}`,t),t}}const En={name:Sn("name"),version:Sn("version"),chainId:function(e){try{return Pe.from(e).toString()}catch(t){}return fn.throwArgumentError('invalid domain value for "chainId"',"domain.chainId",e)},verifyingContract:function(e){try{return Jt(e).toLowerCase()}catch(t){}return fn.throwArgumentError('invalid domain value "verifyingContract"',"domain.verifyingContract",e)},salt:function(e){try{const t=ae(e);if(32!==t.length)throw new Error("bad length");return fe(t)}catch(t){}return fn.throwArgumentError('invalid domain value "salt"',"domain.salt",e)}};function An(e){{const t=e.match(/^(u?)int(\d*)$/);if(t){const r=""===t[1],n=parseInt(t[2]||"256");(n%8!=0||n>256||t[2]&&t[2]!==String(n))&&fn.throwArgumentError("invalid numeric width","type",e);const i=bn.mask(r?n-1:n),o=r?i.add(yn).mul(mn):gn;return function(t){const r=Pe.from(t);return(r.lt(o)||r.gt(i))&&fn.throwArgumentError(`value out-of-bounds for ${e}`,"value",t),ve(r.toTwos(256).toHexString(),32)}}}{const t=e.match(/^bytes(\d+)$/);if(t){const r=parseInt(t[1]);return(0===r||r>32||t[1]!==String(r))&&fn.throwArgumentError("invalid bytes width","type",e),function(t){return ae(t).length!==r&&fn.throwArgumentError(`invalid length for ${e}`,"value",t),function(e){const t=ae(e),r=t.length%32;return r?ge([t,pn.slice(r)]):fe(t)}(t)}}}switch(e){case"address":return function(e){return ve(Jt(e),32)};case"bool":return function(e){return e?vn:wn};case"bytes":return function(e){return Lt(e)};case"string":return function(e){return rn(e)}}return null}function Nn(e,t){return`${e}(${t.map((({name:e,type:t})=>t+" "+e)).join(",")})`}class Tn{constructor(e){Ge(this,"types",Object.freeze(rt(e))),Ge(this,"_encoderCache",{}),Ge(this,"_types",{});const t={},r={},n={};Object.keys(e).forEach((e=>{t[e]={},r[e]=[],n[e]={}}));for(const o in e){const n={};e[o].forEach((i=>{n[i.name]&&fn.throwArgumentError(`duplicate variable name ${JSON.stringify(i.name)} in ${JSON.stringify(o)}`,"types",e),n[i.name]=!0;const s=i.type.match(/^([^\x5b]*)(\x5b|$)/)[1];s===o&&fn.throwArgumentError(`circular type reference to ${JSON.stringify(s)}`,"types",e);An(s)||(r[s]||fn.throwArgumentError(`unknown type ${JSON.stringify(s)}`,"types",e),r[s].push(o),t[o][s]=!0)}))}const i=Object.keys(r).filter((e=>0===r[e].length));0===i.length?fn.throwArgumentError("missing primary type","types",e):i.length>1&&fn.throwArgumentError(`ambiguous primary types or unused types: ${i.map((e=>JSON.stringify(e))).join(", ")}`,"types",e),Ge(this,"primaryType",i[0]),function i(o,s){s[o]&&fn.throwArgumentError(`circular type reference to ${JSON.stringify(o)}`,"types",e),s[o]=!0,Object.keys(t[o]).forEach((e=>{r[e]&&(i(e,s),Object.keys(s).forEach((t=>{n[t][e]=!0})))})),delete s[o]}(this.primaryType,{});for(const o in n){const t=Object.keys(n[o]);t.sort(),this._types[o]=Nn(o,e[o])+t.map((t=>Nn(t,e[t]))).join("")}}getEncoder(e){let t=this._encoderCache[e];return t||(t=this._encoderCache[e]=this._getEncoder(e)),t}_getEncoder(e){{const t=An(e);if(t)return t}const t=e.match(/^(.*)(\x5b(\d*)\x5d)$/);if(t){const e=t[1],r=this.getEncoder(e),n=parseInt(t[3]);return t=>{n>=0&&t.length!==n&&fn.throwArgumentError("array length mismatch; expected length ${ arrayLength }","value",t);let i=t.map(r);return this._types[e]&&(i=i.map(Lt)),Lt(ge(i))}}const r=this.types[e];if(r){const t=rn(this._types[e]);return e=>{const n=r.map((({name:t,type:r})=>{const n=this.getEncoder(r)(e[t]);return this._types[r]?Lt(n):n}));return n.unshift(t),ge(n)}}return fn.throwArgumentError(`unknown type: ${e}`,"type",e)}encodeType(e){const t=this._types[e];return t||fn.throwArgumentError(`unknown type: ${JSON.stringify(e)}`,"name",e),t}encodeData(e,t){return this.getEncoder(e)(t)}hashStruct(e,t){return Lt(this.encodeData(e,t))}encode(e){return this.encodeData(this.primaryType,e)}hash(e){return this.hashStruct(this.primaryType,e)}_visit(e,t,r){if(An(e))return r(e,t);const n=e.match(/^(.*)(\x5b(\d*)\x5d)$/);if(n){const e=n[1],i=parseInt(n[3]);return i>=0&&t.length!==i&&fn.throwArgumentError("array length mismatch; expected length ${ arrayLength }","value",t),t.map((t=>this._visit(e,t,r)))}const i=this.types[e];return i?i.reduce(((e,{name:n,type:i})=>(e[n]=this._visit(i,t[n],r),e)),{}):fn.throwArgumentError(`unknown type: ${e}`,"type",e)}visit(e,t){return this._visit(this.primaryType,e,t)}static from(e){return new Tn(e)}static getPrimaryType(e){return Tn.from(e).primaryType}static hashStruct(e,t,r){return Tn.from(t).hashStruct(e,r)}static hashDomain(e){const t=[];for(const r in e){const n=xn[r];n||fn.throwArgumentError(`invalid typed-data domain key: ${JSON.stringify(r)}`,"domain",e),t.push({name:r,type:n})}return t.sort(((e,t)=>kn.indexOf(e.name)-kn.indexOf(t.name))),Tn.hashStruct("EIP712Domain",{EIP712Domain:t},e)}static encode(e,t,r){return ge(["0x1901",Tn.hashDomain(e),Tn.from(t).hash(r)])}static hash(e,t,r){return Lt(Tn.encode(e,t,r))}static resolveNames(e,t,r,n){return dn(this,void 0,void 0,(function*(){e=Qe(e);const i={};e.verifyingContract&&!he(e.verifyingContract,20)&&(i[e.verifyingContract]="0x");const o=Tn.from(t);o.visit(r,((e,t)=>("address"!==e||he(t,20)||(i[t]="0x"),t)));for(const e in i)i[e]=yield n(e);return e.verifyingContract&&i[e.verifyingContract]&&(e.verifyingContract=i[e.verifyingContract]),r=o.visit(r,((e,t)=>"address"===e&&i[t]?i[t]:t)),{domain:e,value:r}}))}static getPayload(e,t,r){Tn.hashDomain(e);const n={},i=[];kn.forEach((t=>{const r=e[t];null!=r&&(n[t]=En[t](r),i.push({name:t,type:xn[t]}))}));const o=Tn.from(t),s=Qe(t);return s.EIP712Domain?fn.throwArgumentError("types must not contain EIP712Domain type","types.EIP712Domain",t):s.EIP712Domain=i,o.encode(r),{types:s,domain:n,primaryType:o.primaryType,message:o.visit(r,((e,t)=>{if(e.match(/^bytes(\d*)/))return fe(ae(t));if(e.match(/^u?int/))return Pe.from(t).toString();switch(e){case"address":return t.toLowerCase();case"bool":return!!t;case"string":return"string"!=typeof t&&fn.throwArgumentError("invalid string","value",t),t}return fn.throwArgumentError("unsupported type","type",e)}))}}}const Pn=new ee(it);class Mn extends nt{}class In extends nt{}class Cn extends nt{}class Rn extends nt{static isIndexed(e){return!(!e||!e._isIndexed)}}const Bn={"0x08c379a0":{signature:"Error(string)",name:"Error",inputs:["string"],reason:!0},"0x4e487b71":{signature:"Panic(uint256)",name:"Panic",inputs:["uint256"]}};function On(e,t){const r=new Error(`deferred error during ABI decoding triggered accessing ${e}`);return r.error=t,r}class Ln{constructor(e){let t=[];t="string"==typeof e?JSON.parse(e):e,Ge(this,"fragments",t.map((e=>mt.from(e))).filter((e=>null!=e))),Ge(this,"_abiCoder",Ze(new.target,"getAbiCoder")()),Ge(this,"functions",{}),Ge(this,"errors",{}),Ge(this,"events",{}),Ge(this,"structs",{}),this.fragments.forEach((e=>{let t=null;switch(e.type){case"constructor":return this.deploy?void Pn.warn("duplicate definition - constructor"):void Ge(this,"deploy",e);case"function":t=this.functions;break;case"event":t=this.events;break;case"error":t=this.errors;break;default:return}let r=e.format();t[r]?Pn.warn("duplicate definition - "+r):t[r]=e})),this.deploy||Ge(this,"deploy",wt.from({payable:!1,type:"constructor"})),Ge(this,"_isInterface",!0)}format(e){e||(e=ht.full),e===ht.sighash&&Pn.throwArgumentError("interface does not support formatting sighash","format",e);const t=this.fragments.map((t=>t.format(e)));return e===ht.json?JSON.stringify(t.map((e=>JSON.parse(e)))):t}static getAbiCoder(){return tn}static getAddress(e){return Jt(e)}static getSighash(e){return me(rn(e.format()),0,4)}static getEventTopic(e){return rn(e.format())}getFunction(e){if(he(e)){for(const t in this.functions)if(e===this.getSighash(t))return this.functions[t];Pn.throwArgumentError("no matching function","sighash",e)}if(-1===e.indexOf("(")){const t=e.trim(),r=Object.keys(this.functions).filter((e=>e.split("(")[0]===t));return 0===r.length?Pn.throwArgumentError("no matching function","name",t):r.length>1&&Pn.throwArgumentError("multiple matching functions","name",t),this.functions[r[0]]}const t=this.functions[xt.fromString(e).format()];return t||Pn.throwArgumentError("no matching function","signature",e),t}getEvent(e){if(he(e)){const t=e.toLowerCase();for(const e in this.events)if(t===this.getEventTopic(e))return this.events[e];Pn.throwArgumentError("no matching event","topichash",t)}if(-1===e.indexOf("(")){const t=e.trim(),r=Object.keys(this.events).filter((e=>e.split("(")[0]===t));return 0===r.length?Pn.throwArgumentError("no matching event","name",t):r.length>1&&Pn.throwArgumentError("multiple matching events","name",t),this.events[r[0]]}const t=this.events[gt.fromString(e).format()];return t||Pn.throwArgumentError("no matching event","signature",e),t}getError(e){if(he(e)){const t=Ze(this.constructor,"getSighash");for(const r in this.errors){if(e===t(this.errors[r]))return this.errors[r]}Pn.throwArgumentError("no matching error","sighash",e)}if(-1===e.indexOf("(")){const t=e.trim(),r=Object.keys(this.errors).filter((e=>e.split("(")[0]===t));return 0===r.length?Pn.throwArgumentError("no matching error","name",t):r.length>1&&Pn.throwArgumentError("multiple matching errors","name",t),this.errors[r[0]]}const t=this.errors[xt.fromString(e).format()];return t||Pn.throwArgumentError("no matching error","signature",e),t}getSighash(e){if("string"==typeof e)try{e=this.getFunction(e)}catch(t){try{e=this.getError(e)}catch(r){throw t}}return Ze(this.constructor,"getSighash")(e)}getEventTopic(e){return"string"==typeof e&&(e=this.getEvent(e)),Ze(this.constructor,"getEventTopic")(e)}_decodeParams(e,t){return this._abiCoder.decode(e,t)}_encodeParams(e,t){return this._abiCoder.encode(e,t)}encodeDeploy(e){return this._encodeParams(this.deploy.inputs,e||[])}decodeErrorResult(e,t){"string"==typeof e&&(e=this.getError(e));const r=ae(t);return fe(r.slice(0,4))!==this.getSighash(e)&&Pn.throwArgumentError(`data signature does not match error ${e.name}.`,"data",fe(r)),this._decodeParams(e.inputs,r.slice(4))}encodeErrorResult(e,t){return"string"==typeof e&&(e=this.getError(e)),fe(ce([this.getSighash(e),this._encodeParams(e.inputs,t||[])]))}decodeFunctionData(e,t){"string"==typeof e&&(e=this.getFunction(e));const r=ae(t);return fe(r.slice(0,4))!==this.getSighash(e)&&Pn.throwArgumentError(`data signature does not match function ${e.name}.`,"data",fe(r)),this._decodeParams(e.inputs,r.slice(4))}encodeFunctionData(e,t){return"string"==typeof e&&(e=this.getFunction(e)),fe(ce([this.getSighash(e),this._encodeParams(e.inputs,t||[])]))}decodeFunctionResult(e,t){"string"==typeof e&&(e=this.getFunction(e));let r=ae(t),n=null,i="",o=null,s=null,a=null;switch(r.length%this._abiCoder._getWordSize()){case 0:try{return this._abiCoder.decode(e.outputs,r)}catch(c){}break;case 4:{const e=fe(r.slice(0,4)),t=Bn[e];if(t)o=this._abiCoder.decode(t.inputs,r.slice(4)),s=t.name,a=t.signature,t.reason&&(n=o[0]),"Error"===s?i=`; VM Exception while processing transaction: reverted with reason string ${JSON.stringify(o[0])}`:"Panic"===s&&(i=`; VM Exception while processing transaction: reverted with panic code ${o[0]}`);else try{const t=this.getError(e);o=this._abiCoder.decode(t.inputs,r.slice(4)),s=t.name,a=t.format()}catch(c){}break}}return Pn.throwError("call revert exception"+i,ee.errors.CALL_EXCEPTION,{method:e.format(),data:fe(t),errorArgs:o,errorName:s,errorSignature:a,reason:n})}encodeFunctionResult(e,t){return"string"==typeof e&&(e=this.getFunction(e)),fe(this._abiCoder.encode(e.outputs,t||[]))}encodeFilterTopics(e,t){"string"==typeof e&&(e=this.getEvent(e)),t.length>e.inputs.length&&Pn.throwError("too many arguments for "+e.format(),ee.errors.UNEXPECTED_ARGUMENT,{argument:"values",value:t});let r=[];e.anonymous||r.push(this.getEventTopic(e));const n=(e,t)=>"string"===e.type?rn(t):"bytes"===e.type?Lt(fe(t)):("address"===e.type&&this._abiCoder.encode(["address"],[t]),ve(fe(t),32));for(t.forEach(((t,i)=>{let o=e.inputs[i];o.indexed?null==t?r.push(null):"array"===o.baseType||"tuple"===o.baseType?Pn.throwArgumentError("filtering with tuples or arrays not supported","contract."+o.name,t):Array.isArray(t)?r.push(t.map((e=>n(o,e)))):r.push(n(o,t)):null!=t&&Pn.throwArgumentError("cannot filter non-indexed parameters; must be null","contract."+o.name,t)}));r.length&&null===r[r.length-1];)r.pop();return r}encodeEventLog(e,t){"string"==typeof e&&(e=this.getEvent(e));const r=[],n=[],i=[];return e.anonymous||r.push(this.getEventTopic(e)),t.length!==e.inputs.length&&Pn.throwArgumentError("event arguments/values mismatch","values",t),e.inputs.forEach(((e,o)=>{const s=t[o];if(e.indexed)if("string"===e.type)r.push(rn(s));else if("bytes"===e.type)r.push(Lt(s));else{if("tuple"===e.baseType||"array"===e.baseType)throw new Error("not implemented");r.push(this._abiCoder.encode([e.type],[s]))}else n.push(e),i.push(s)})),{data:this._abiCoder.encode(n,i),topics:r}}decodeEventLog(e,t,r){if("string"==typeof e&&(e=this.getEvent(e)),null!=r&&!e.anonymous){let t=this.getEventTopic(e);he(r[0],32)&&r[0].toLowerCase()===t||Pn.throwError("fragment/topic mismatch",ee.errors.INVALID_ARGUMENT,{argument:"topics[0]",expected:t,value:r[0]}),r=r.slice(1)}let n=[],i=[],o=[];e.inputs.forEach(((e,t)=>{e.indexed?"string"===e.type||"bytes"===e.type||"tuple"===e.baseType||"array"===e.baseType?(n.push(ft.fromObject({type:"bytes32",name:e.name})),o.push(!0)):(n.push(e),o.push(!1)):(i.push(e),o.push(!1))}));let s=null!=r?this._abiCoder.decode(n,ce(r)):null,a=this._abiCoder.decode(i,t,!0),c=[],u=0,l=0;e.inputs.forEach(((e,t)=>{if(e.indexed)if(null==s)c[t]=new Rn({_isIndexed:!0,hash:null});else if(o[t])c[t]=new Rn({_isIndexed:!0,hash:s[l++]});else try{c[t]=s[l++]}catch(r){c[t]=r}else try{c[t]=a[u++]}catch(r){c[t]=r}if(e.name&&null==c[e.name]){const r=c[t];r instanceof Error?Object.defineProperty(c,e.name,{enumerable:!0,get:()=>{throw On(`property ${JSON.stringify(e.name)}`,r)}}):c[e.name]=r}}));for(let h=0;h<c.length;h++){const e=c[h];e instanceof Error&&Object.defineProperty(c,h,{enumerable:!0,get:()=>{throw On(`index ${h}`,e)}})}return Object.freeze(c)}parseTransaction(e){let t=this.getFunction(e.data.substring(0,10).toLowerCase());return t?new In({args:this._abiCoder.decode(t.inputs,"0x"+e.data.substring(10)),functionFragment:t,name:t.name,signature:t.format(),sighash:this.getSighash(t),value:Pe.from(e.value||"0")}):null}parseLog(e){let t=this.getEvent(e.topics[0]);return!t||t.anonymous?null:new Mn({eventFragment:t,name:t.name,signature:t.format(),topic:this.getEventTopic(t),args:this.decodeEventLog(t,e.data,e.topics)})}parseError(e){const t=fe(e);let r=this.getError(t.substring(0,10).toLowerCase());return r?new Cn({args:this._abiCoder.decode(r.inputs,"0x"+t.substring(10)),errorFragment:r,name:r.name,signature:r.format(),sighash:this.getSighash(r)}):null}static isInterface(e){return!(!e||!e._isInterface)}}var zn=function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{c(n.next(e))}catch(t){o(t)}}function a(e){try{c(n.throw(e))}catch(t){o(t)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}c((n=n.apply(e,t||[])).next())}))};const Un=new ee("abstract-provider/5.6.0");class _n extends nt{static isForkEvent(e){return!(!e||!e._isForkEvent)}}class qn{constructor(){Un.checkAbstract(new.target,qn),Ge(this,"_isProvider",!0)}getFeeData(){return zn(this,void 0,void 0,(function*(){const{block:e,gasPrice:t}=yield Je({block:this.getBlock("latest"),gasPrice:this.getGasPrice().catch((e=>null))});let r=null,n=null;return e&&e.baseFeePerGas&&(n=Pe.from("1500000000"),r=e.baseFeePerGas.mul(2).add(n)),{maxFeePerGas:r,maxPriorityFeePerGas:n,gasPrice:t}}))}addListener(e,t){return this.on(e,t)}removeListener(e,t){return this.off(e,t)}static isProvider(e){return!(!e||!e._isProvider)}}var Dn=function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{c(n.next(e))}catch(t){o(t)}}function a(e){try{c(n.throw(e))}catch(t){o(t)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}c((n=n.apply(e,t||[])).next())}))};const Vn=new ee("abstract-signer/5.6.1"),jn=["accessList","ccipReadEnabled","chainId","customData","data","from","gasLimit","gasPrice","maxFeePerGas","maxPriorityFeePerGas","nonce","to","type","value"],Fn=[ee.errors.INSUFFICIENT_FUNDS,ee.errors.NONCE_EXPIRED,ee.errors.REPLACEMENT_UNDERPRICED];class Hn{constructor(){Vn.checkAbstract(new.target,Hn),Ge(this,"_isSigner",!0)}getBalance(e){return Dn(this,void 0,void 0,(function*(){return this._checkProvider("getBalance"),yield this.provider.getBalance(this.getAddress(),e)}))}getTransactionCount(e){return Dn(this,void 0,void 0,(function*(){return this._checkProvider("getTransactionCount"),yield this.provider.getTransactionCount(this.getAddress(),e)}))}estimateGas(e){return Dn(this,void 0,void 0,(function*(){this._checkProvider("estimateGas");const t=yield Je(this.checkTransaction(e));return yield this.provider.estimateGas(t)}))}call(e,t){return Dn(this,void 0,void 0,(function*(){this._checkProvider("call");const r=yield Je(this.checkTransaction(e));return yield this.provider.call(r,t)}))}sendTransaction(e){return Dn(this,void 0,void 0,(function*(){this._checkProvider("sendTransaction");const t=yield this.populateTransaction(e),r=yield this.signTransaction(t);return yield this.provider.sendTransaction(r)}))}getChainId(){return Dn(this,void 0,void 0,(function*(){this._checkProvider("getChainId");return(yield this.provider.getNetwork()).chainId}))}getGasPrice(){return Dn(this,void 0,void 0,(function*(){return this._checkProvider("getGasPrice"),yield this.provider.getGasPrice()}))}getFeeData(){return Dn(this,void 0,void 0,(function*(){return this._checkProvider("getFeeData"),yield this.provider.getFeeData()}))}resolveName(e){return Dn(this,void 0,void 0,(function*(){return this._checkProvider("resolveName"),yield this.provider.resolveName(e)}))}checkTransaction(e){for(const r in e)-1===jn.indexOf(r)&&Vn.throwArgumentError("invalid transaction key: "+r,"transaction",e);const t=Qe(e);return null==t.from?t.from=this.getAddress():t.from=Promise.all([Promise.resolve(t.from),this.getAddress()]).then((t=>(t[0].toLowerCase()!==t[1].toLowerCase()&&Vn.throwArgumentError("from address mismatch","transaction",e),t[0]))),t}populateTransaction(e){return Dn(this,void 0,void 0,(function*(){const t=yield Je(this.checkTransaction(e));null!=t.to&&(t.to=Promise.resolve(t.to).then((e=>Dn(this,void 0,void 0,(function*(){if(null==e)return null;const t=yield this.resolveName(e);return null==t&&Vn.throwArgumentError("provided ENS name resolves to null","tx.to",e),t})))),t.to.catch((e=>{})));const r=null!=t.maxFeePerGas||null!=t.maxPriorityFeePerGas;if(null==t.gasPrice||2!==t.type&&!r?0!==t.type&&1!==t.type||!r||Vn.throwArgumentError("pre-eip-1559 transaction do not support maxFeePerGas/maxPriorityFeePerGas","transaction",e):Vn.throwArgumentError("eip-1559 transaction do not support gasPrice","transaction",e),2!==t.type&&null!=t.type||null==t.maxFeePerGas||null==t.maxPriorityFeePerGas)if(0===t.type||1===t.type)null==t.gasPrice&&(t.gasPrice=this.getGasPrice());else{const e=yield this.getFeeData();if(null==t.type)if(null!=e.maxFeePerGas&&null!=e.maxPriorityFeePerGas)if(t.type=2,null!=t.gasPrice){const e=t.gasPrice;delete t.gasPrice,t.maxFeePerGas=e,t.maxPriorityFeePerGas=e}else null==t.maxFeePerGas&&(t.maxFeePerGas=e.maxFeePerGas),null==t.maxPriorityFeePerGas&&(t.maxPriorityFeePerGas=e.maxPriorityFeePerGas);else null!=e.gasPrice?(r&&Vn.throwError("network does not support EIP-1559",ee.errors.UNSUPPORTED_OPERATION,{operation:"populateTransaction"}),null==t.gasPrice&&(t.gasPrice=e.gasPrice),t.type=0):Vn.throwError("failed to get consistent fee data",ee.errors.UNSUPPORTED_OPERATION,{operation:"signer.getFeeData"});else 2===t.type&&(null==t.maxFeePerGas&&(t.maxFeePerGas=e.maxFeePerGas),null==t.maxPriorityFeePerGas&&(t.maxPriorityFeePerGas=e.maxPriorityFeePerGas))}else t.type=2;return null==t.nonce&&(t.nonce=this.getTransactionCount("pending")),null==t.gasLimit&&(t.gasLimit=this.estimateGas(t).catch((e=>{if(Fn.indexOf(e.code)>=0)throw e;return Vn.throwError("cannot estimate gas; transaction may fail or may require manual gas limit",ee.errors.UNPREDICTABLE_GAS_LIMIT,{error:e,tx:t})}))),null==t.chainId?t.chainId=this.getChainId():t.chainId=Promise.all([Promise.resolve(t.chainId),this.getChainId()]).then((t=>(0!==t[1]&&t[0]!==t[1]&&Vn.throwArgumentError("chainId address mismatch","transaction",e),t[0]))),yield Je(t)}))}_checkProvider(e){this.provider||Vn.throwError("missing provider",ee.errors.UNSUPPORTED_OPERATION,{operation:e||"_checkProvider"})}static isSigner(e){return!(!e||!e._isSigner)}}class Wn extends Hn{constructor(e,t){super(),Ge(this,"address",e),Ge(this,"provider",t||null)}getAddress(){return Promise.resolve(this.address)}_fail(e,t){return Promise.resolve().then((()=>{Vn.throwError(e,ee.errors.UNSUPPORTED_OPERATION,{operation:t})}))}signMessage(e){return this._fail("VoidSigner cannot sign messages","signMessage")}signTransaction(e){return this._fail("VoidSigner cannot sign transactions","signTransaction")}_signTypedData(e,t,r){return this._fail("VoidSigner cannot sign typed data","signTypedData")}connect(e){return new Wn(this.address,e)}}var Kn=r(8434),Xn=r.n(Kn),Gn=r(34485),Zn=r.n(Gn);"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self&&self;function Jn(e,t,r){return r={path:t,exports:{},require:function(e,t){return function(){throw new Error("Dynamic requires are not currently supported by @rollup/plugin-commonjs")}(null==t&&r.path)}},e(r,r.exports),r.exports}var Yn=Qn;function Qn(e,t){if(!e)throw new Error(t||"Assertion failed")}Qn.equal=function(e,t,r){if(e!=t)throw new Error(r||"Assertion failed: "+e+" != "+t)};var $n=Jn((function(e,t){var r=t;function n(e){return 1===e.length?"0"+e:e}function i(e){for(var t="",r=0;r<e.length;r++)t+=n(e[r].toString(16));return t}r.toArray=function(e,t){if(Array.isArray(e))return e.slice();if(!e)return[];var r=[];if("string"!=typeof e){for(var n=0;n<e.length;n++)r[n]=0|e[n];return r}if("hex"===t){(e=e.replace(/[^a-z0-9]+/gi,"")).length%2!=0&&(e="0"+e);for(n=0;n<e.length;n+=2)r.push(parseInt(e[n]+e[n+1],16))}else for(n=0;n<e.length;n++){var i=e.charCodeAt(n),o=i>>8,s=255&i;o?r.push(o,s):r.push(s)}return r},r.zero2=n,r.toHex=i,r.encode=function(e,t){return"hex"===t?i(e):e}})),ei=Jn((function(e,t){var r=t;r.assert=Yn,r.toArray=$n.toArray,r.zero2=$n.zero2,r.toHex=$n.toHex,r.encode=$n.encode,r.getNAF=function(e,t,r){var n=new Array(Math.max(e.bitLength(),r)+1);n.fill(0);for(var i=1<<t+1,o=e.clone(),s=0;s<n.length;s++){var a,c=o.andln(i-1);o.isOdd()?(a=c>(i>>1)-1?(i>>1)-c:c,o.isubn(a)):a=0,n[s]=a,o.iushrn(1)}return n},r.getJSF=function(e,t){var r=[[],[]];e=e.clone(),t=t.clone();for(var n,i=0,o=0;e.cmpn(-i)>0||t.cmpn(-o)>0;){var s,a,c=e.andln(3)+i&3,u=t.andln(3)+o&3;3===c&&(c=-1),3===u&&(u=-1),s=0==(1&c)?0:3!==(n=e.andln(7)+i&7)&&5!==n||2!==u?c:-c,r[0].push(s),a=0==(1&u)?0:3!==(n=t.andln(7)+o&7)&&5!==n||2!==c?u:-u,r[1].push(a),2*i===s+1&&(i=1-i),2*o===a+1&&(o=1-o),e.iushrn(1),t.iushrn(1)}return r},r.cachedProperty=function(e,t,r){var n="_"+t;e.prototype[t]=function(){return void 0!==this[n]?this[n]:this[n]=r.call(this)}},r.parseBytes=function(e){return"string"==typeof e?r.toArray(e,"hex"):e},r.intFromLE=function(e){return new(Xn())(e,"hex","le")}})),ti=ei.getNAF,ri=ei.getJSF,ni=ei.assert;function ii(e,t){this.type=e,this.p=new(Xn())(t.p,16),this.red=t.prime?Xn().red(t.prime):Xn().mont(this.p),this.zero=new(Xn())(0).toRed(this.red),this.one=new(Xn())(1).toRed(this.red),this.two=new(Xn())(2).toRed(this.red),this.n=t.n&&new(Xn())(t.n,16),this.g=t.g&&this.pointFromJSON(t.g,t.gRed),this._wnafT1=new Array(4),this._wnafT2=new Array(4),this._wnafT3=new Array(4),this._wnafT4=new Array(4),this._bitLength=this.n?this.n.bitLength():0;var r=this.n&&this.p.div(this.n);!r||r.cmpn(100)>0?this.redN=null:(this._maxwellTrick=!0,this.redN=this.n.toRed(this.red))}var oi=ii;function si(e,t){this.curve=e,this.type=t,this.precomputed=null}ii.prototype.point=function(){throw new Error("Not implemented")},ii.prototype.validate=function(){throw new Error("Not implemented")},ii.prototype._fixedNafMul=function(e,t){ni(e.precomputed);var r=e._getDoubles(),n=ti(t,1,this._bitLength),i=(1<<r.step+1)-(r.step%2==0?2:1);i/=3;var o,s,a=[];for(o=0;o<n.length;o+=r.step){s=0;for(var c=o+r.step-1;c>=o;c--)s=(s<<1)+n[c];a.push(s)}for(var u=this.jpoint(null,null,null),l=this.jpoint(null,null,null),h=i;h>0;h--){for(o=0;o<a.length;o++)(s=a[o])===h?l=l.mixedAdd(r.points[o]):s===-h&&(l=l.mixedAdd(r.points[o].neg()));u=u.add(l)}return u.toP()},ii.prototype._wnafMul=function(e,t){var r=4,n=e._getNAFPoints(r);r=n.wnd;for(var i=n.points,o=ti(t,r,this._bitLength),s=this.jpoint(null,null,null),a=o.length-1;a>=0;a--){for(var c=0;a>=0&&0===o[a];a--)c++;if(a>=0&&c++,s=s.dblp(c),a<0)break;var u=o[a];ni(0!==u),s="affine"===e.type?u>0?s.mixedAdd(i[u-1>>1]):s.mixedAdd(i[-u-1>>1].neg()):u>0?s.add(i[u-1>>1]):s.add(i[-u-1>>1].neg())}return"affine"===e.type?s.toP():s},ii.prototype._wnafMulAdd=function(e,t,r,n,i){var o,s,a,c=this._wnafT1,u=this._wnafT2,l=this._wnafT3,h=0;for(o=0;o<n;o++){var d=(a=t[o])._getNAFPoints(e);c[o]=d.wnd,u[o]=d.points}for(o=n-1;o>=1;o-=2){var f=o-1,p=o;if(1===c[f]&&1===c[p]){var m=[t[f],null,null,t[p]];0===t[f].y.cmp(t[p].y)?(m[1]=t[f].add(t[p]),m[2]=t[f].toJ().mixedAdd(t[p].neg())):0===t[f].y.cmp(t[p].y.redNeg())?(m[1]=t[f].toJ().mixedAdd(t[p]),m[2]=t[f].add(t[p].neg())):(m[1]=t[f].toJ().mixedAdd(t[p]),m[2]=t[f].toJ().mixedAdd(t[p].neg()));var g=[-3,-1,-5,-7,0,7,5,1,3],y=ri(r[f],r[p]);for(h=Math.max(y[0].length,h),l[f]=new Array(h),l[p]=new Array(h),s=0;s<h;s++){var b=0|y[0][s],v=0|y[1][s];l[f][s]=g[3*(b+1)+(v+1)],l[p][s]=0,u[f]=m}}else l[f]=ti(r[f],c[f],this._bitLength),l[p]=ti(r[p],c[p],this._bitLength),h=Math.max(l[f].length,h),h=Math.max(l[p].length,h)}var w=this.jpoint(null,null,null),x=this._wnafT4;for(o=h;o>=0;o--){for(var k=0;o>=0;){var S=!0;for(s=0;s<n;s++)x[s]=0|l[s][o],0!==x[s]&&(S=!1);if(!S)break;k++,o--}if(o>=0&&k++,w=w.dblp(k),o<0)break;for(s=0;s<n;s++){var E=x[s];0!==E&&(E>0?a=u[s][E-1>>1]:E<0&&(a=u[s][-E-1>>1].neg()),w="affine"===a.type?w.mixedAdd(a):w.add(a))}}for(o=0;o<n;o++)u[o]=null;return i?w:w.toP()},ii.BasePoint=si,si.prototype.eq=function(){throw new Error("Not implemented")},si.prototype.validate=function(){return this.curve.validate(this)},ii.prototype.decodePoint=function(e,t){e=ei.toArray(e,t);var r=this.p.byteLength();if((4===e[0]||6===e[0]||7===e[0])&&e.length-1==2*r)return 6===e[0]?ni(e[e.length-1]%2==0):7===e[0]&&ni(e[e.length-1]%2==1),this.point(e.slice(1,1+r),e.slice(1+r,1+2*r));if((2===e[0]||3===e[0])&&e.length-1===r)return this.pointFromX(e.slice(1,1+r),3===e[0]);throw new Error("Unknown point format")},si.prototype.encodeCompressed=function(e){return this.encode(e,!0)},si.prototype._encode=function(e){var t=this.curve.p.byteLength(),r=this.getX().toArray("be",t);return e?[this.getY().isEven()?2:3].concat(r):[4].concat(r,this.getY().toArray("be",t))},si.prototype.encode=function(e,t){return ei.encode(this._encode(t),e)},si.prototype.precompute=function(e){if(this.precomputed)return this;var t={doubles:null,naf:null,beta:null};return t.naf=this._getNAFPoints(8),t.doubles=this._getDoubles(4,e),t.beta=this._getBeta(),this.precomputed=t,this},si.prototype._hasDoubles=function(e){if(!this.precomputed)return!1;var t=this.precomputed.doubles;return!!t&&t.points.length>=Math.ceil((e.bitLength()+1)/t.step)},si.prototype._getDoubles=function(e,t){if(this.precomputed&&this.precomputed.doubles)return this.precomputed.doubles;for(var r=[this],n=this,i=0;i<t;i+=e){for(var o=0;o<e;o++)n=n.dbl();r.push(n)}return{step:e,points:r}},si.prototype._getNAFPoints=function(e){if(this.precomputed&&this.precomputed.naf)return this.precomputed.naf;for(var t=[this],r=(1<<e)-1,n=1===r?null:this.dbl(),i=1;i<r;i++)t[i]=t[i-1].add(n);return{wnd:e,points:t}},si.prototype._getBeta=function(){return null},si.prototype.dblp=function(e){for(var t=this,r=0;r<e;r++)t=t.dbl();return t};var ai=Jn((function(e){"function"==typeof Object.create?e.exports=function(e,t){t&&(e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}))}:e.exports=function(e,t){if(t){e.super_=t;var r=function(){};r.prototype=t.prototype,e.prototype=new r,e.prototype.constructor=e}}})),ci=ei.assert;function ui(e){oi.call(this,"short",e),this.a=new(Xn())(e.a,16).toRed(this.red),this.b=new(Xn())(e.b,16).toRed(this.red),this.tinv=this.two.redInvm(),this.zeroA=0===this.a.fromRed().cmpn(0),this.threeA=0===this.a.fromRed().sub(this.p).cmpn(-3),this.endo=this._getEndomorphism(e),this._endoWnafT1=new Array(4),this._endoWnafT2=new Array(4)}ai(ui,oi);var li=ui;function hi(e,t,r,n){oi.BasePoint.call(this,e,"affine"),null===t&&null===r?(this.x=null,this.y=null,this.inf=!0):(this.x=new(Xn())(t,16),this.y=new(Xn())(r,16),n&&(this.x.forceRed(this.curve.red),this.y.forceRed(this.curve.red)),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.y.red||(this.y=this.y.toRed(this.curve.red)),this.inf=!1)}function di(e,t,r,n){oi.BasePoint.call(this,e,"jacobian"),null===t&&null===r&&null===n?(this.x=this.curve.one,this.y=this.curve.one,this.z=new(Xn())(0)):(this.x=new(Xn())(t,16),this.y=new(Xn())(r,16),this.z=new(Xn())(n,16)),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.y.red||(this.y=this.y.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)),this.zOne=this.z===this.curve.one}ui.prototype._getEndomorphism=function(e){if(this.zeroA&&this.g&&this.n&&1===this.p.modn(3)){var t,r;if(e.beta)t=new(Xn())(e.beta,16).toRed(this.red);else{var n=this._getEndoRoots(this.p);t=(t=n[0].cmp(n[1])<0?n[0]:n[1]).toRed(this.red)}if(e.lambda)r=new(Xn())(e.lambda,16);else{var i=this._getEndoRoots(this.n);0===this.g.mul(i[0]).x.cmp(this.g.x.redMul(t))?r=i[0]:(r=i[1],ci(0===this.g.mul(r).x.cmp(this.g.x.redMul(t))))}return{beta:t,lambda:r,basis:e.basis?e.basis.map((function(e){return{a:new(Xn())(e.a,16),b:new(Xn())(e.b,16)}})):this._getEndoBasis(r)}}},ui.prototype._getEndoRoots=function(e){var t=e===this.p?this.red:Xn().mont(e),r=new(Xn())(2).toRed(t).redInvm(),n=r.redNeg(),i=new(Xn())(3).toRed(t).redNeg().redSqrt().redMul(r);return[n.redAdd(i).fromRed(),n.redSub(i).fromRed()]},ui.prototype._getEndoBasis=function(e){for(var t,r,n,i,o,s,a,c,u,l=this.n.ushrn(Math.floor(this.n.bitLength()/2)),h=e,d=this.n.clone(),f=new(Xn())(1),p=new(Xn())(0),m=new(Xn())(0),g=new(Xn())(1),y=0;0!==h.cmpn(0);){var b=d.div(h);c=d.sub(b.mul(h)),u=m.sub(b.mul(f));var v=g.sub(b.mul(p));if(!n&&c.cmp(l)<0)t=a.neg(),r=f,n=c.neg(),i=u;else if(n&&2==++y)break;a=c,d=h,h=c,m=f,f=u,g=p,p=v}o=c.neg(),s=u;var w=n.sqr().add(i.sqr());return o.sqr().add(s.sqr()).cmp(w)>=0&&(o=t,s=r),n.negative&&(n=n.neg(),i=i.neg()),o.negative&&(o=o.neg(),s=s.neg()),[{a:n,b:i},{a:o,b:s}]},ui.prototype._endoSplit=function(e){var t=this.endo.basis,r=t[0],n=t[1],i=n.b.mul(e).divRound(this.n),o=r.b.neg().mul(e).divRound(this.n),s=i.mul(r.a),a=o.mul(n.a),c=i.mul(r.b),u=o.mul(n.b);return{k1:e.sub(s).sub(a),k2:c.add(u).neg()}},ui.prototype.pointFromX=function(e,t){(e=new(Xn())(e,16)).red||(e=e.toRed(this.red));var r=e.redSqr().redMul(e).redIAdd(e.redMul(this.a)).redIAdd(this.b),n=r.redSqrt();if(0!==n.redSqr().redSub(r).cmp(this.zero))throw new Error("invalid point");var i=n.fromRed().isOdd();return(t&&!i||!t&&i)&&(n=n.redNeg()),this.point(e,n)},ui.prototype.validate=function(e){if(e.inf)return!0;var t=e.x,r=e.y,n=this.a.redMul(t),i=t.redSqr().redMul(t).redIAdd(n).redIAdd(this.b);return 0===r.redSqr().redISub(i).cmpn(0)},ui.prototype._endoWnafMulAdd=function(e,t,r){for(var n=this._endoWnafT1,i=this._endoWnafT2,o=0;o<e.length;o++){var s=this._endoSplit(t[o]),a=e[o],c=a._getBeta();s.k1.negative&&(s.k1.ineg(),a=a.neg(!0)),s.k2.negative&&(s.k2.ineg(),c=c.neg(!0)),n[2*o]=a,n[2*o+1]=c,i[2*o]=s.k1,i[2*o+1]=s.k2}for(var u=this._wnafMulAdd(1,n,i,2*o,r),l=0;l<2*o;l++)n[l]=null,i[l]=null;return u},ai(hi,oi.BasePoint),ui.prototype.point=function(e,t,r){return new hi(this,e,t,r)},ui.prototype.pointFromJSON=function(e,t){return hi.fromJSON(this,e,t)},hi.prototype._getBeta=function(){if(this.curve.endo){var e=this.precomputed;if(e&&e.beta)return e.beta;var t=this.curve.point(this.x.redMul(this.curve.endo.beta),this.y);if(e){var r=this.curve,n=function(e){return r.point(e.x.redMul(r.endo.beta),e.y)};e.beta=t,t.precomputed={beta:null,naf:e.naf&&{wnd:e.naf.wnd,points:e.naf.points.map(n)},doubles:e.doubles&&{step:e.doubles.step,points:e.doubles.points.map(n)}}}return t}},hi.prototype.toJSON=function(){return this.precomputed?[this.x,this.y,this.precomputed&&{doubles:this.precomputed.doubles&&{step:this.precomputed.doubles.step,points:this.precomputed.doubles.points.slice(1)},naf:this.precomputed.naf&&{wnd:this.precomputed.naf.wnd,points:this.precomputed.naf.points.slice(1)}}]:[this.x,this.y]},hi.fromJSON=function(e,t,r){"string"==typeof t&&(t=JSON.parse(t));var n=e.point(t[0],t[1],r);if(!t[2])return n;function i(t){return e.point(t[0],t[1],r)}var o=t[2];return n.precomputed={beta:null,doubles:o.doubles&&{step:o.doubles.step,points:[n].concat(o.doubles.points.map(i))},naf:o.naf&&{wnd:o.naf.wnd,points:[n].concat(o.naf.points.map(i))}},n},hi.prototype.inspect=function(){return this.isInfinity()?"<EC Point Infinity>":"<EC Point x: "+this.x.fromRed().toString(16,2)+" y: "+this.y.fromRed().toString(16,2)+">"},hi.prototype.isInfinity=function(){return this.inf},hi.prototype.add=function(e){if(this.inf)return e;if(e.inf)return this;if(this.eq(e))return this.dbl();if(this.neg().eq(e))return this.curve.point(null,null);if(0===this.x.cmp(e.x))return this.curve.point(null,null);var t=this.y.redSub(e.y);0!==t.cmpn(0)&&(t=t.redMul(this.x.redSub(e.x).redInvm()));var r=t.redSqr().redISub(this.x).redISub(e.x),n=t.redMul(this.x.redSub(r)).redISub(this.y);return this.curve.point(r,n)},hi.prototype.dbl=function(){if(this.inf)return this;var e=this.y.redAdd(this.y);if(0===e.cmpn(0))return this.curve.point(null,null);var t=this.curve.a,r=this.x.redSqr(),n=e.redInvm(),i=r.redAdd(r).redIAdd(r).redIAdd(t).redMul(n),o=i.redSqr().redISub(this.x.redAdd(this.x)),s=i.redMul(this.x.redSub(o)).redISub(this.y);return this.curve.point(o,s)},hi.prototype.getX=function(){return this.x.fromRed()},hi.prototype.getY=function(){return this.y.fromRed()},hi.prototype.mul=function(e){return e=new(Xn())(e,16),this.isInfinity()?this:this._hasDoubles(e)?this.curve._fixedNafMul(this,e):this.curve.endo?this.curve._endoWnafMulAdd([this],[e]):this.curve._wnafMul(this,e)},hi.prototype.mulAdd=function(e,t,r){var n=[this,t],i=[e,r];return this.curve.endo?this.curve._endoWnafMulAdd(n,i):this.curve._wnafMulAdd(1,n,i,2)},hi.prototype.jmulAdd=function(e,t,r){var n=[this,t],i=[e,r];return this.curve.endo?this.curve._endoWnafMulAdd(n,i,!0):this.curve._wnafMulAdd(1,n,i,2,!0)},hi.prototype.eq=function(e){return this===e||this.inf===e.inf&&(this.inf||0===this.x.cmp(e.x)&&0===this.y.cmp(e.y))},hi.prototype.neg=function(e){if(this.inf)return this;var t=this.curve.point(this.x,this.y.redNeg());if(e&&this.precomputed){var r=this.precomputed,n=function(e){return e.neg()};t.precomputed={naf:r.naf&&{wnd:r.naf.wnd,points:r.naf.points.map(n)},doubles:r.doubles&&{step:r.doubles.step,points:r.doubles.points.map(n)}}}return t},hi.prototype.toJ=function(){return this.inf?this.curve.jpoint(null,null,null):this.curve.jpoint(this.x,this.y,this.curve.one)},ai(di,oi.BasePoint),ui.prototype.jpoint=function(e,t,r){return new di(this,e,t,r)},di.prototype.toP=function(){if(this.isInfinity())return this.curve.point(null,null);var e=this.z.redInvm(),t=e.redSqr(),r=this.x.redMul(t),n=this.y.redMul(t).redMul(e);return this.curve.point(r,n)},di.prototype.neg=function(){return this.curve.jpoint(this.x,this.y.redNeg(),this.z)},di.prototype.add=function(e){if(this.isInfinity())return e;if(e.isInfinity())return this;var t=e.z.redSqr(),r=this.z.redSqr(),n=this.x.redMul(t),i=e.x.redMul(r),o=this.y.redMul(t.redMul(e.z)),s=e.y.redMul(r.redMul(this.z)),a=n.redSub(i),c=o.redSub(s);if(0===a.cmpn(0))return 0!==c.cmpn(0)?this.curve.jpoint(null,null,null):this.dbl();var u=a.redSqr(),l=u.redMul(a),h=n.redMul(u),d=c.redSqr().redIAdd(l).redISub(h).redISub(h),f=c.redMul(h.redISub(d)).redISub(o.redMul(l)),p=this.z.redMul(e.z).redMul(a);return this.curve.jpoint(d,f,p)},di.prototype.mixedAdd=function(e){if(this.isInfinity())return e.toJ();if(e.isInfinity())return this;var t=this.z.redSqr(),r=this.x,n=e.x.redMul(t),i=this.y,o=e.y.redMul(t).redMul(this.z),s=r.redSub(n),a=i.redSub(o);if(0===s.cmpn(0))return 0!==a.cmpn(0)?this.curve.jpoint(null,null,null):this.dbl();var c=s.redSqr(),u=c.redMul(s),l=r.redMul(c),h=a.redSqr().redIAdd(u).redISub(l).redISub(l),d=a.redMul(l.redISub(h)).redISub(i.redMul(u)),f=this.z.redMul(s);return this.curve.jpoint(h,d,f)},di.prototype.dblp=function(e){if(0===e)return this;if(this.isInfinity())return this;if(!e)return this.dbl();var t;if(this.curve.zeroA||this.curve.threeA){var r=this;for(t=0;t<e;t++)r=r.dbl();return r}var n=this.curve.a,i=this.curve.tinv,o=this.x,s=this.y,a=this.z,c=a.redSqr().redSqr(),u=s.redAdd(s);for(t=0;t<e;t++){var l=o.redSqr(),h=u.redSqr(),d=h.redSqr(),f=l.redAdd(l).redIAdd(l).redIAdd(n.redMul(c)),p=o.redMul(h),m=f.redSqr().redISub(p.redAdd(p)),g=p.redISub(m),y=f.redMul(g);y=y.redIAdd(y).redISub(d);var b=u.redMul(a);t+1<e&&(c=c.redMul(d)),o=m,a=b,u=y}return this.curve.jpoint(o,u.redMul(i),a)},di.prototype.dbl=function(){return this.isInfinity()?this:this.curve.zeroA?this._zeroDbl():this.curve.threeA?this._threeDbl():this._dbl()},di.prototype._zeroDbl=function(){var e,t,r;if(this.zOne){var n=this.x.redSqr(),i=this.y.redSqr(),o=i.redSqr(),s=this.x.redAdd(i).redSqr().redISub(n).redISub(o);s=s.redIAdd(s);var a=n.redAdd(n).redIAdd(n),c=a.redSqr().redISub(s).redISub(s),u=o.redIAdd(o);u=(u=u.redIAdd(u)).redIAdd(u),e=c,t=a.redMul(s.redISub(c)).redISub(u),r=this.y.redAdd(this.y)}else{var l=this.x.redSqr(),h=this.y.redSqr(),d=h.redSqr(),f=this.x.redAdd(h).redSqr().redISub(l).redISub(d);f=f.redIAdd(f);var p=l.redAdd(l).redIAdd(l),m=p.redSqr(),g=d.redIAdd(d);g=(g=g.redIAdd(g)).redIAdd(g),e=m.redISub(f).redISub(f),t=p.redMul(f.redISub(e)).redISub(g),r=(r=this.y.redMul(this.z)).redIAdd(r)}return this.curve.jpoint(e,t,r)},di.prototype._threeDbl=function(){var e,t,r;if(this.zOne){var n=this.x.redSqr(),i=this.y.redSqr(),o=i.redSqr(),s=this.x.redAdd(i).redSqr().redISub(n).redISub(o);s=s.redIAdd(s);var a=n.redAdd(n).redIAdd(n).redIAdd(this.curve.a),c=a.redSqr().redISub(s).redISub(s);e=c;var u=o.redIAdd(o);u=(u=u.redIAdd(u)).redIAdd(u),t=a.redMul(s.redISub(c)).redISub(u),r=this.y.redAdd(this.y)}else{var l=this.z.redSqr(),h=this.y.redSqr(),d=this.x.redMul(h),f=this.x.redSub(l).redMul(this.x.redAdd(l));f=f.redAdd(f).redIAdd(f);var p=d.redIAdd(d),m=(p=p.redIAdd(p)).redAdd(p);e=f.redSqr().redISub(m),r=this.y.redAdd(this.z).redSqr().redISub(h).redISub(l);var g=h.redSqr();g=(g=(g=g.redIAdd(g)).redIAdd(g)).redIAdd(g),t=f.redMul(p.redISub(e)).redISub(g)}return this.curve.jpoint(e,t,r)},di.prototype._dbl=function(){var e=this.curve.a,t=this.x,r=this.y,n=this.z,i=n.redSqr().redSqr(),o=t.redSqr(),s=r.redSqr(),a=o.redAdd(o).redIAdd(o).redIAdd(e.redMul(i)),c=t.redAdd(t),u=(c=c.redIAdd(c)).redMul(s),l=a.redSqr().redISub(u.redAdd(u)),h=u.redISub(l),d=s.redSqr();d=(d=(d=d.redIAdd(d)).redIAdd(d)).redIAdd(d);var f=a.redMul(h).redISub(d),p=r.redAdd(r).redMul(n);return this.curve.jpoint(l,f,p)},di.prototype.trpl=function(){if(!this.curve.zeroA)return this.dbl().add(this);var e=this.x.redSqr(),t=this.y.redSqr(),r=this.z.redSqr(),n=t.redSqr(),i=e.redAdd(e).redIAdd(e),o=i.redSqr(),s=this.x.redAdd(t).redSqr().redISub(e).redISub(n),a=(s=(s=(s=s.redIAdd(s)).redAdd(s).redIAdd(s)).redISub(o)).redSqr(),c=n.redIAdd(n);c=(c=(c=c.redIAdd(c)).redIAdd(c)).redIAdd(c);var u=i.redIAdd(s).redSqr().redISub(o).redISub(a).redISub(c),l=t.redMul(u);l=(l=l.redIAdd(l)).redIAdd(l);var h=this.x.redMul(a).redISub(l);h=(h=h.redIAdd(h)).redIAdd(h);var d=this.y.redMul(u.redMul(c.redISub(u)).redISub(s.redMul(a)));d=(d=(d=d.redIAdd(d)).redIAdd(d)).redIAdd(d);var f=this.z.redAdd(s).redSqr().redISub(r).redISub(a);return this.curve.jpoint(h,d,f)},di.prototype.mul=function(e,t){return e=new(Xn())(e,t),this.curve._wnafMul(this,e)},di.prototype.eq=function(e){if("affine"===e.type)return this.eq(e.toJ());if(this===e)return!0;var t=this.z.redSqr(),r=e.z.redSqr();if(0!==this.x.redMul(r).redISub(e.x.redMul(t)).cmpn(0))return!1;var n=t.redMul(this.z),i=r.redMul(e.z);return 0===this.y.redMul(i).redISub(e.y.redMul(n)).cmpn(0)},di.prototype.eqXToP=function(e){var t=this.z.redSqr(),r=e.toRed(this.curve.red).redMul(t);if(0===this.x.cmp(r))return!0;for(var n=e.clone(),i=this.curve.redN.redMul(t);;){if(n.iadd(this.curve.n),n.cmp(this.curve.p)>=0)return!1;if(r.redIAdd(i),0===this.x.cmp(r))return!0}},di.prototype.inspect=function(){return this.isInfinity()?"<EC JPoint Infinity>":"<EC JPoint x: "+this.x.toString(16,2)+" y: "+this.y.toString(16,2)+" z: "+this.z.toString(16,2)+">"},di.prototype.isInfinity=function(){return 0===this.z.cmpn(0)};var fi=Jn((function(e,t){var r=t;r.base=oi,r.short=li,r.mont=null,r.edwards=null})),pi=Jn((function(e,t){var r,n=t,i=ei.assert;function o(e){"short"===e.type?this.curve=new fi.short(e):"edwards"===e.type?this.curve=new fi.edwards(e):this.curve=new fi.mont(e),this.g=this.curve.g,this.n=this.curve.n,this.hash=e.hash,i(this.g.validate(),"Invalid curve"),i(this.g.mul(this.n).isInfinity(),"Invalid curve, G*N != O")}function s(e,t){Object.defineProperty(n,e,{configurable:!0,enumerable:!0,get:function(){var r=new o(t);return Object.defineProperty(n,e,{configurable:!0,enumerable:!0,value:r}),r}})}n.PresetCurve=o,s("p192",{type:"short",prime:"p192",p:"ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff",a:"ffffffff ffffffff ffffffff fffffffe ffffffff fffffffc",b:"64210519 e59c80e7 0fa7e9ab 72243049 feb8deec c146b9b1",n:"ffffffff ffffffff ffffffff 99def836 146bc9b1 b4d22831",hash:Zn().sha256,gRed:!1,g:["188da80e b03090f6 7cbf20eb 43a18800 f4ff0afd 82ff1012","07192b95 ffc8da78 631011ed 6b24cdd5 73f977a1 1e794811"]}),s("p224",{type:"short",prime:"p224",p:"ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001",a:"ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff fffffffe",b:"b4050a85 0c04b3ab f5413256 5044b0b7 d7bfd8ba 270b3943 2355ffb4",n:"ffffffff ffffffff ffffffff ffff16a2 e0b8f03e 13dd2945 5c5c2a3d",hash:Zn().sha256,gRed:!1,g:["b70e0cbd 6bb4bf7f 321390b9 4a03c1d3 56c21122 343280d6 115c1d21","bd376388 b5f723fb 4c22dfe6 cd4375a0 5a074764 44d58199 85007e34"]}),s("p256",{type:"short",prime:null,p:"ffffffff 00000001 00000000 00000000 00000000 ffffffff ffffffff ffffffff",a:"ffffffff 00000001 00000000 00000000 00000000 ffffffff ffffffff fffffffc",b:"5ac635d8 aa3a93e7 b3ebbd55 769886bc 651d06b0 cc53b0f6 3bce3c3e 27d2604b",n:"ffffffff 00000000 ffffffff ffffffff bce6faad a7179e84 f3b9cac2 fc632551",hash:Zn().sha256,gRed:!1,g:["6b17d1f2 e12c4247 f8bce6e5 63a440f2 77037d81 2deb33a0 f4a13945 d898c296","4fe342e2 fe1a7f9b 8ee7eb4a 7c0f9e16 2bce3357 6b315ece cbb64068 37bf51f5"]}),s("p384",{type:"short",prime:null,p:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe ffffffff 00000000 00000000 ffffffff",a:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe ffffffff 00000000 00000000 fffffffc",b:"b3312fa7 e23ee7e4 988e056b e3f82d19 181d9c6e fe814112 0314088f 5013875a c656398d 8a2ed19d 2a85c8ed d3ec2aef",n:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff c7634d81 f4372ddf 581a0db2 48b0a77a ecec196a ccc52973",hash:Zn().sha384,gRed:!1,g:["aa87ca22 be8b0537 8eb1c71e f320ad74 6e1d3b62 8ba79b98 59f741e0 82542a38 5502f25d bf55296c 3a545e38 72760ab7","3617de4a 96262c6f 5d9e98bf 9292dc29 f8f41dbd 289a147c e9da3113 b5f0b8c0 0a60b1ce 1d7e819d 7a431d7c 90ea0e5f"]}),s("p521",{type:"short",prime:null,p:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff",a:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffc",b:"00000051 953eb961 8e1c9a1f 929a21a0 b68540ee a2da725b 99b315f3 b8b48991 8ef109e1 56193951 ec7e937b 1652c0bd 3bb1bf07 3573df88 3d2c34f1 ef451fd4 6b503f00",n:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffa 51868783 bf2f966b 7fcc0148 f709a5d0 3bb5c9b8 899c47ae bb6fb71e 91386409",hash:Zn().sha512,gRed:!1,g:["000000c6 858e06b7 0404e9cd 9e3ecb66 2395b442 9c648139 053fb521 f828af60 6b4d3dba a14b5e77 efe75928 fe1dc127 a2ffa8de 3348b3c1 856a429b f97e7e31 c2e5bd66","00000118 39296a78 9a3bc004 5c8a5fb4 2c7d1bd9 98f54449 579b4468 17afbd17 273e662c 97ee7299 5ef42640 c550b901 3fad0761 353c7086 a272c240 88be9476 9fd16650"]}),s("curve25519",{type:"mont",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"76d06",b:"1",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:Zn().sha256,gRed:!1,g:["9"]}),s("ed25519",{type:"edwards",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"-1",c:"1",d:"52036cee2b6ffe73 8cc740797779e898 00700a4d4141d8ab 75eb4dca135978a3",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:Zn().sha256,gRed:!1,g:["216936d3cd6e53fec0a4e231fdd6dc5c692cc7609525a7b2c9562d608f25d51a","6666666666666666666666666666666666666666666666666666666666666658"]});try{r=null.crash()}catch(a){r=void 0}s("secp256k1",{type:"short",prime:"k256",p:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f",a:"0",b:"7",n:"ffffffff ffffffff ffffffff fffffffe baaedce6 af48a03b bfd25e8c d0364141",h:"1",hash:Zn().sha256,beta:"7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee",lambda:"5363ad4cc05c30e0a5261c028812645a122e22ea20816678df02967c1b23bd72",basis:[{a:"3086d221a7d46bcde86c90e49284eb15",b:"-e4437ed6010e88286f547fa90abfe4c3"},{a:"114ca50f7a8e2f3f657c1108d9d44cfd8",b:"3086d221a7d46bcde86c90e49284eb15"}],gRed:!1,g:["79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798","483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8",r]})}));function mi(e){if(!(this instanceof mi))return new mi(e);this.hash=e.hash,this.predResist=!!e.predResist,this.outLen=this.hash.outSize,this.minEntropy=e.minEntropy||this.hash.hmacStrength,this._reseed=null,this.reseedInterval=null,this.K=null,this.V=null;var t=$n.toArray(e.entropy,e.entropyEnc||"hex"),r=$n.toArray(e.nonce,e.nonceEnc||"hex"),n=$n.toArray(e.pers,e.persEnc||"hex");Yn(t.length>=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._init(t,r,n)}var gi=mi;mi.prototype._init=function(e,t,r){var n=e.concat(t).concat(r);this.K=new Array(this.outLen/8),this.V=new Array(this.outLen/8);for(var i=0;i<this.V.length;i++)this.K[i]=0,this.V[i]=1;this._update(n),this._reseed=1,this.reseedInterval=281474976710656},mi.prototype._hmac=function(){return new(Zn().hmac)(this.hash,this.K)},mi.prototype._update=function(e){var t=this._hmac().update(this.V).update([0]);e&&(t=t.update(e)),this.K=t.digest(),this.V=this._hmac().update(this.V).digest(),e&&(this.K=this._hmac().update(this.V).update([1]).update(e).digest(),this.V=this._hmac().update(this.V).digest())},mi.prototype.reseed=function(e,t,r,n){"string"!=typeof t&&(n=r,r=t,t=null),e=$n.toArray(e,t),r=$n.toArray(r,n),Yn(e.length>=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._update(e.concat(r||[])),this._reseed=1},mi.prototype.generate=function(e,t,r,n){if(this._reseed>this.reseedInterval)throw new Error("Reseed is required");"string"!=typeof t&&(n=r,r=t,t=null),r&&(r=$n.toArray(r,n||"hex"),this._update(r));for(var i=[];i.length<e;)this.V=this._hmac().update(this.V).digest(),i=i.concat(this.V);var o=i.slice(0,e);return this._update(r),this._reseed++,$n.encode(o,t)};var yi=ei.assert;function bi(e,t){this.ec=e,this.priv=null,this.pub=null,t.priv&&this._importPrivate(t.priv,t.privEnc),t.pub&&this._importPublic(t.pub,t.pubEnc)}var vi=bi;bi.fromPublic=function(e,t,r){return t instanceof bi?t:new bi(e,{pub:t,pubEnc:r})},bi.fromPrivate=function(e,t,r){return t instanceof bi?t:new bi(e,{priv:t,privEnc:r})},bi.prototype.validate=function(){var e=this.getPublic();return e.isInfinity()?{result:!1,reason:"Invalid public key"}:e.validate()?e.mul(this.ec.curve.n).isInfinity()?{result:!0,reason:null}:{result:!1,reason:"Public key * N != O"}:{result:!1,reason:"Public key is not a point"}},bi.prototype.getPublic=function(e,t){return"string"==typeof e&&(t=e,e=null),this.pub||(this.pub=this.ec.g.mul(this.priv)),t?this.pub.encode(t,e):this.pub},bi.prototype.getPrivate=function(e){return"hex"===e?this.priv.toString(16,2):this.priv},bi.prototype._importPrivate=function(e,t){this.priv=new(Xn())(e,t||16),this.priv=this.priv.umod(this.ec.curve.n)},bi.prototype._importPublic=function(e,t){if(e.x||e.y)return"mont"===this.ec.curve.type?yi(e.x,"Need x coordinate"):"short"!==this.ec.curve.type&&"edwards"!==this.ec.curve.type||yi(e.x&&e.y,"Need both x and y coordinate"),void(this.pub=this.ec.curve.point(e.x,e.y));this.pub=this.ec.curve.decodePoint(e,t)},bi.prototype.derive=function(e){return e.validate()||yi(e.validate(),"public point not validated"),e.mul(this.priv).getX()},bi.prototype.sign=function(e,t,r){return this.ec.sign(e,this,t,r)},bi.prototype.verify=function(e,t){return this.ec.verify(e,t,this)},bi.prototype.inspect=function(){return"<Key priv: "+(this.priv&&this.priv.toString(16,2))+" pub: "+(this.pub&&this.pub.inspect())+" >"};var wi=ei.assert;function xi(e,t){if(e instanceof xi)return e;this._importDER(e,t)||(wi(e.r&&e.s,"Signature without r or s"),this.r=new(Xn())(e.r,16),this.s=new(Xn())(e.s,16),void 0===e.recoveryParam?this.recoveryParam=null:this.recoveryParam=e.recoveryParam)}var ki=xi;function Si(){this.place=0}function Ei(e,t){var r=e[t.place++];if(!(128&r))return r;var n=15&r;if(0===n||n>4)return!1;for(var i=0,o=0,s=t.place;o<n;o++,s++)i<<=8,i|=e[s],i>>>=0;return!(i<=127)&&(t.place=s,i)}function Ai(e){for(var t=0,r=e.length-1;!e[t]&&!(128&e[t+1])&&t<r;)t++;return 0===t?e:e.slice(t)}function Ni(e,t){if(t<128)e.push(t);else{var r=1+(Math.log(t)/Math.LN2>>>3);for(e.push(128|r);--r;)e.push(t>>>(r<<3)&255);e.push(t)}}xi.prototype._importDER=function(e,t){e=ei.toArray(e,t);var r=new Si;if(48!==e[r.place++])return!1;var n=Ei(e,r);if(!1===n)return!1;if(n+r.place!==e.length)return!1;if(2!==e[r.place++])return!1;var i=Ei(e,r);if(!1===i)return!1;var o=e.slice(r.place,i+r.place);if(r.place+=i,2!==e[r.place++])return!1;var s=Ei(e,r);if(!1===s)return!1;if(e.length!==s+r.place)return!1;var a=e.slice(r.place,s+r.place);if(0===o[0]){if(!(128&o[1]))return!1;o=o.slice(1)}if(0===a[0]){if(!(128&a[1]))return!1;a=a.slice(1)}return this.r=new(Xn())(o),this.s=new(Xn())(a),this.recoveryParam=null,!0},xi.prototype.toDER=function(e){var t=this.r.toArray(),r=this.s.toArray();for(128&t[0]&&(t=[0].concat(t)),128&r[0]&&(r=[0].concat(r)),t=Ai(t),r=Ai(r);!(r[0]||128&r[1]);)r=r.slice(1);var n=[2];Ni(n,t.length),(n=n.concat(t)).push(2),Ni(n,r.length);var i=n.concat(r),o=[48];return Ni(o,i.length),o=o.concat(i),ei.encode(o,e)};var Ti=function(){throw new Error("unsupported")},Pi=ei.assert;function Mi(e){if(!(this instanceof Mi))return new Mi(e);"string"==typeof e&&(Pi(Object.prototype.hasOwnProperty.call(pi,e),"Unknown curve "+e),e=pi[e]),e instanceof pi.PresetCurve&&(e={curve:e}),this.curve=e.curve.curve,this.n=this.curve.n,this.nh=this.n.ushrn(1),this.g=this.curve.g,this.g=e.curve.g,this.g.precompute(e.curve.n.bitLength()+1),this.hash=e.hash||e.curve.hash}var Ii=Mi;Mi.prototype.keyPair=function(e){return new vi(this,e)},Mi.prototype.keyFromPrivate=function(e,t){return vi.fromPrivate(this,e,t)},Mi.prototype.keyFromPublic=function(e,t){return vi.fromPublic(this,e,t)},Mi.prototype.genKeyPair=function(e){e||(e={});for(var t=new gi({hash:this.hash,pers:e.pers,persEnc:e.persEnc||"utf8",entropy:e.entropy||Ti(this.hash.hmacStrength),entropyEnc:e.entropy&&e.entropyEnc||"utf8",nonce:this.n.toArray()}),r=this.n.byteLength(),n=this.n.sub(new(Xn())(2));;){var i=new(Xn())(t.generate(r));if(!(i.cmp(n)>0))return i.iaddn(1),this.keyFromPrivate(i)}},Mi.prototype._truncateToN=function(e,t){var r=8*e.byteLength()-this.n.bitLength();return r>0&&(e=e.ushrn(r)),!t&&e.cmp(this.n)>=0?e.sub(this.n):e},Mi.prototype.sign=function(e,t,r,n){"object"==typeof r&&(n=r,r=null),n||(n={}),t=this.keyFromPrivate(t,r),e=this._truncateToN(new(Xn())(e,16));for(var i=this.n.byteLength(),o=t.getPrivate().toArray("be",i),s=e.toArray("be",i),a=new gi({hash:this.hash,entropy:o,nonce:s,pers:n.pers,persEnc:n.persEnc||"utf8"}),c=this.n.sub(new(Xn())(1)),u=0;;u++){var l=n.k?n.k(u):new(Xn())(a.generate(this.n.byteLength()));if(!((l=this._truncateToN(l,!0)).cmpn(1)<=0||l.cmp(c)>=0)){var h=this.g.mul(l);if(!h.isInfinity()){var d=h.getX(),f=d.umod(this.n);if(0!==f.cmpn(0)){var p=l.invm(this.n).mul(f.mul(t.getPrivate()).iadd(e));if(0!==(p=p.umod(this.n)).cmpn(0)){var m=(h.getY().isOdd()?1:0)|(0!==d.cmp(f)?2:0);return n.canonical&&p.cmp(this.nh)>0&&(p=this.n.sub(p),m^=1),new ki({r:f,s:p,recoveryParam:m})}}}}}},Mi.prototype.verify=function(e,t,r,n){e=this._truncateToN(new(Xn())(e,16)),r=this.keyFromPublic(r,n);var i=(t=new ki(t,"hex")).r,o=t.s;if(i.cmpn(1)<0||i.cmp(this.n)>=0)return!1;if(o.cmpn(1)<0||o.cmp(this.n)>=0)return!1;var s,a=o.invm(this.n),c=a.mul(e).umod(this.n),u=a.mul(i).umod(this.n);return this.curve._maxwellTrick?!(s=this.g.jmulAdd(c,r.getPublic(),u)).isInfinity()&&s.eqXToP(i):!(s=this.g.mulAdd(c,r.getPublic(),u)).isInfinity()&&0===s.getX().umod(this.n).cmp(i)},Mi.prototype.recoverPubKey=function(e,t,r,n){Pi((3&r)===r,"The recovery param is more than two bits"),t=new ki(t,n);var i=this.n,o=new(Xn())(e),s=t.r,a=t.s,c=1&r,u=r>>1;if(s.cmp(this.curve.p.umod(this.curve.n))>=0&&u)throw new Error("Unable to find sencond key candinate");s=u?this.curve.pointFromX(s.add(this.curve.n),c):this.curve.pointFromX(s,c);var l=t.r.invm(i),h=i.sub(o).mul(l).umod(i),d=a.mul(l).umod(i);return this.g.mulAdd(h,s,d)},Mi.prototype.getKeyRecoveryParam=function(e,t,r,n){if(null!==(t=new ki(t,n)).recoveryParam)return t.recoveryParam;for(var i=0;i<4;i++){var o;try{o=this.recoverPubKey(e,t,i)}catch(e){continue}if(o.eq(r))return i}throw new Error("Unable to find valid recovery factor")};var Ci=Jn((function(e,t){var r=t;r.version="6.5.4",r.utils=ei,r.rand=function(){throw new Error("unsupported")},r.curve=fi,r.curves=pi,r.ec=Ii,r.eddsa=null})),Ri=Ci.ec;const Bi=new ee("signing-key/5.6.1");let Oi=null;function Li(){return Oi||(Oi=new Ri("secp256k1")),Oi}class zi{constructor(e){Ge(this,"curve","secp256k1"),Ge(this,"privateKey",fe(e)),32!==pe(this.privateKey)&&Bi.throwArgumentError("invalid private key","privateKey","[[ REDACTED ]]");const t=Li().keyFromPrivate(ae(this.privateKey));Ge(this,"publicKey","0x"+t.getPublic(!1,"hex")),Ge(this,"compressedPublicKey","0x"+t.getPublic(!0,"hex")),Ge(this,"_isSigningKey",!0)}_addPoint(e){const t=Li().keyFromPublic(ae(this.publicKey)),r=Li().keyFromPublic(ae(e));return"0x"+t.pub.add(r.pub).encodeCompressed("hex")}signDigest(e){const t=Li().keyFromPrivate(ae(this.privateKey)),r=ae(e);32!==r.length&&Bi.throwArgumentError("bad digest length","digest",e);const n=t.sign(r,{canonical:!0});return we({recoveryParam:n.recoveryParam,r:ve("0x"+n.r.toString(16),32),s:ve("0x"+n.s.toString(16),32)})}computeSharedSecret(e){const t=Li().keyFromPrivate(ae(this.privateKey)),r=Li().keyFromPublic(ae(_i(e)));return ve("0x"+t.derive(r.getPublic()).toString(16),32)}static isSigningKey(e){return!(!e||!e._isSigningKey)}}function Ui(e,t){const r=we(t),n={r:ae(r.r),s:ae(r.s)};return"0x"+Li().recoverPubKey(ae(e),n,r.recoveryParam).encode("hex",!1)}function _i(e,t){const r=ae(e);if(32===r.length){const e=new zi(r);return t?"0x"+Li().keyFromPrivate(r).getPublic(!0,"hex"):e.publicKey}return 33===r.length?t?fe(r):"0x"+Li().keyFromPublic(r).getPublic(!1,"hex"):65===r.length?t?"0x"+Li().keyFromPublic(r).getPublic(!0,"hex"):fe(r):Bi.throwArgumentError("invalid public or private key","key","[REDACTED]")}const qi=new ee("transactions/5.6.0");var Di;function Vi(e){return"0x"===e?null:Jt(e)}function ji(e){return"0x"===e?pr:Pe.from(e)}!function(e){e[e.legacy=0]="legacy",e[e.eip2930=1]="eip2930",e[e.eip1559=2]="eip1559"}(Di||(Di={}));const Fi=[{name:"nonce",maxLength:32,numeric:!0},{name:"gasPrice",maxLength:32,numeric:!0},{name:"gasLimit",maxLength:32,numeric:!0},{name:"to",length:20},{name:"value",maxLength:32,numeric:!0},{name:"data"}],Hi={chainId:!0,data:!0,gasLimit:!0,gasPrice:!0,nonce:!0,to:!0,type:!0,value:!0};function Wi(e){return Jt(me(Lt(me(_i(e),1)),12))}function Ki(e,t){return Wi(Ui(ae(e),t))}function Xi(e,t){const r=ue(Pe.from(e).toHexString());return r.length>32&&qi.throwArgumentError("invalid length for "+t,"transaction:"+t,e),r}function Gi(e,t){return{address:Jt(e),storageKeys:(t||[]).map(((t,r)=>(32!==pe(t)&&qi.throwArgumentError("invalid access list storageKey",`accessList[${e}:${r}]`,t),t.toLowerCase())))}}function Zi(e){if(Array.isArray(e))return e.map(((e,t)=>Array.isArray(e)?(e.length>2&&qi.throwArgumentError("access list expected to be [ address, storageKeys[] ]",`value[${t}]`,e),Gi(e[0],e[1])):Gi(e.address,e.storageKeys)));const t=Object.keys(e).map((t=>{const r=e[t].reduce(((e,t)=>(e[t]=!0,e)),{});return Gi(t,Object.keys(r).sort())}));return t.sort(((e,t)=>e.address.localeCompare(t.address))),t}function Ji(e){return Zi(e).map((e=>[e.address,e.storageKeys]))}function Yi(e,t){if(null!=e.gasPrice){const t=Pe.from(e.gasPrice),r=Pe.from(e.maxFeePerGas||0);t.eq(r)||qi.throwArgumentError("mismatch EIP-1559 gasPrice != maxFeePerGas","tx",{gasPrice:t,maxFeePerGas:r})}const r=[Xi(e.chainId||0,"chainId"),Xi(e.nonce||0,"nonce"),Xi(e.maxPriorityFeePerGas||0,"maxPriorityFeePerGas"),Xi(e.maxFeePerGas||0,"maxFeePerGas"),Xi(e.gasLimit||0,"gasLimit"),null!=e.to?Jt(e.to):"0x",Xi(e.value||0,"value"),e.data||"0x",Ji(e.accessList||[])];if(t){const e=we(t);r.push(Xi(e.recoveryParam,"recoveryParam")),r.push(ue(e.r)),r.push(ue(e.s))}return ge(["0x02",Dt(r)])}function Qi(e,t){const r=[Xi(e.chainId||0,"chainId"),Xi(e.nonce||0,"nonce"),Xi(e.gasPrice||0,"gasPrice"),Xi(e.gasLimit||0,"gasLimit"),null!=e.to?Jt(e.to):"0x",Xi(e.value||0,"value"),e.data||"0x",Ji(e.accessList||[])];if(t){const e=we(t);r.push(Xi(e.recoveryParam,"recoveryParam")),r.push(ue(e.r)),r.push(ue(e.s))}return ge(["0x01",Dt(r)])}function $i(e,t){if(null==e.type||0===e.type)return null!=e.accessList&&qi.throwArgumentError("untyped transactions do not support accessList; include type: 1","transaction",e),function(e,t){Ye(e,Hi);const r=[];Fi.forEach((function(t){let n=e[t.name]||[];const i={};t.numeric&&(i.hexPad="left"),n=ae(fe(n,i)),t.length&&n.length!==t.length&&n.length>0&&qi.throwArgumentError("invalid length for "+t.name,"transaction:"+t.name,n),t.maxLength&&(n=ue(n),n.length>t.maxLength&&qi.throwArgumentError("invalid length for "+t.name,"transaction:"+t.name,n)),r.push(fe(n))}));let n=0;if(null!=e.chainId?(n=e.chainId,"number"!=typeof n&&qi.throwArgumentError("invalid transaction.chainId","transaction",e)):t&&!ie(t)&&t.v>28&&(n=Math.floor((t.v-35)/2)),0!==n&&(r.push(fe(n)),r.push("0x"),r.push("0x")),!t)return Dt(r);const i=we(t);let o=27+i.recoveryParam;return 0!==n?(r.pop(),r.pop(),r.pop(),o+=2*n+8,i.v>28&&i.v!==o&&qi.throwArgumentError("transaction.chainId/signature.v mismatch","signature",t)):i.v!==o&&qi.throwArgumentError("transaction.chainId/signature.v mismatch","signature",t),r.push(fe(o)),r.push(ue(ae(i.r))),r.push(ue(ae(i.s))),Dt(r)}(e,t);switch(e.type){case 1:return Qi(e,t);case 2:return Yi(e,t)}return qi.throwError(`unsupported transaction type: ${e.type}`,ee.errors.UNSUPPORTED_OPERATION,{operation:"serializeTransaction",transactionType:e.type})}function eo(e,t,r){try{const r=ji(t[0]).toNumber();if(0!==r&&1!==r)throw new Error("bad recid");e.v=r}catch(n){qi.throwArgumentError("invalid v for transaction type: 1","v",t[0])}e.r=ve(t[1],32),e.s=ve(t[2],32);try{const t=Lt(r(e));e.from=Ki(t,{r:e.r,s:e.s,recoveryParam:e.v})}catch(n){console.log(n)}}function to(e){const t=ae(e);if(t[0]>127)return function(e){const t=Ft(e);9!==t.length&&6!==t.length&&qi.throwArgumentError("invalid raw transaction","rawTransaction",e);const r={nonce:ji(t[0]).toNumber(),gasPrice:ji(t[1]),gasLimit:ji(t[2]),to:Vi(t[3]),value:ji(t[4]),data:t[5],chainId:0};if(6===t.length)return r;try{r.v=Pe.from(t[6]).toNumber()}catch(n){return console.log(n),r}if(r.r=ve(t[7],32),r.s=ve(t[8],32),Pe.from(r.r).isZero()&&Pe.from(r.s).isZero())r.chainId=r.v,r.v=0;else{r.chainId=Math.floor((r.v-35)/2),r.chainId<0&&(r.chainId=0);let i=r.v-27;const o=t.slice(0,6);0!==r.chainId&&(o.push(fe(r.chainId)),o.push("0x"),o.push("0x"),i-=2*r.chainId+8);const s=Lt(Dt(o));try{r.from=Ki(s,{r:fe(r.r),s:fe(r.s),recoveryParam:i})}catch(n){console.log(n)}r.hash=Lt(e)}return r.type=null,r}(t);switch(t[0]){case 1:return function(e){const t=Ft(e.slice(1));8!==t.length&&11!==t.length&&qi.throwArgumentError("invalid component count for transaction type: 1","payload",fe(e));const r={type:1,chainId:ji(t[0]).toNumber(),nonce:ji(t[1]).toNumber(),gasPrice:ji(t[2]),gasLimit:ji(t[3]),to:Vi(t[4]),value:ji(t[5]),data:t[6],accessList:Zi(t[7])};return 8===t.length||(r.hash=Lt(e),eo(r,t.slice(8),Qi)),r}(t);case 2:return function(e){const t=Ft(e.slice(1));9!==t.length&&12!==t.length&&qi.throwArgumentError("invalid component count for transaction type: 2","payload",fe(e));const r=ji(t[2]),n=ji(t[3]),i={type:2,chainId:ji(t[0]).toNumber(),nonce:ji(t[1]).toNumber(),maxPriorityFeePerGas:r,maxFeePerGas:n,gasPrice:null,gasLimit:ji(t[4]),to:Vi(t[5]),value:ji(t[6]),data:t[7],accessList:Zi(t[8])};return 9===t.length||(i.hash=Lt(e),eo(i,t.slice(9),Yi)),i}(t)}return qi.throwError(`unsupported transaction type: ${t[0]}`,ee.errors.UNSUPPORTED_OPERATION,{operation:"parseTransaction",transactionType:t[0]})}var ro=function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{c(n.next(e))}catch(t){o(t)}}function a(e){try{c(n.throw(e))}catch(t){o(t)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}c((n=n.apply(e,t||[])).next())}))};const no=new ee("contracts/5.6.1"),io={chainId:!0,data:!0,from:!0,gasLimit:!0,gasPrice:!0,nonce:!0,to:!0,value:!0,type:!0,accessList:!0,maxFeePerGas:!0,maxPriorityFeePerGas:!0,customData:!0,ccipReadEnabled:!0};function oo(e,t){return ro(this,void 0,void 0,(function*(){const r=yield t;"string"!=typeof r&&no.throwArgumentError("invalid address or ENS name","name",r);try{return Jt(r)}catch(i){}e||no.throwError("a provider or signer is needed to resolve ENS names",ee.errors.UNSUPPORTED_OPERATION,{operation:"resolveName"});const n=yield e.resolveName(r);return null==n&&no.throwArgumentError("resolver or addr is not configured for ENS name","name",r),n}))}function so(e,t,r){return ro(this,void 0,void 0,(function*(){return Array.isArray(r)?yield Promise.all(r.map(((r,n)=>so(e,Array.isArray(t)?t[n]:t[r.name],r)))):"address"===r.type?yield oo(e,t):"tuple"===r.type?yield so(e,t,r.components):"array"===r.baseType?Array.isArray(t)?yield Promise.all(t.map((t=>so(e,t,r.arrayChildren)))):Promise.reject(no.makeError("invalid value for array",ee.errors.INVALID_ARGUMENT,{argument:"value",value:t})):t}))}function ao(e,t,r){return ro(this,void 0,void 0,(function*(){let n={};r.length===t.inputs.length+1&&"object"==typeof r[r.length-1]&&(n=Qe(r.pop())),no.checkArgumentCount(r.length,t.inputs.length,"passed to contract"),e.signer?n.from?n.from=Je({override:oo(e.signer,n.from),signer:e.signer.getAddress()}).then((e=>ro(this,void 0,void 0,(function*(){return Jt(e.signer)!==e.override&&no.throwError("Contract with a Signer cannot override from",ee.errors.UNSUPPORTED_OPERATION,{operation:"overrides.from"}),e.override})))):n.from=e.signer.getAddress():n.from&&(n.from=oo(e.provider,n.from));const i=yield Je({args:so(e.signer||e.provider,r,t.inputs),address:e.resolvedAddress,overrides:Je(n)||{}}),o=e.interface.encodeFunctionData(t,i.args),s={data:o,to:i.address},a=i.overrides;if(null!=a.nonce&&(s.nonce=Pe.from(a.nonce).toNumber()),null!=a.gasLimit&&(s.gasLimit=Pe.from(a.gasLimit)),null!=a.gasPrice&&(s.gasPrice=Pe.from(a.gasPrice)),null!=a.maxFeePerGas&&(s.maxFeePerGas=Pe.from(a.maxFeePerGas)),null!=a.maxPriorityFeePerGas&&(s.maxPriorityFeePerGas=Pe.from(a.maxPriorityFeePerGas)),null!=a.from&&(s.from=a.from),null!=a.type&&(s.type=a.type),null!=a.accessList&&(s.accessList=Zi(a.accessList)),null==s.gasLimit&&null!=t.gas){let e=21e3;const r=ae(o);for(let t=0;t<r.length;t++)e+=4,r[t]&&(e+=64);s.gasLimit=Pe.from(t.gas).add(e)}if(a.value){const e=Pe.from(a.value);e.isZero()||t.payable||no.throwError("non-payable method cannot override value",ee.errors.UNSUPPORTED_OPERATION,{operation:"overrides.value",value:n.value}),s.value=e}a.customData&&(s.customData=Qe(a.customData)),a.ccipReadEnabled&&(s.ccipReadEnabled=!!a.ccipReadEnabled),delete n.nonce,delete n.gasLimit,delete n.gasPrice,delete n.from,delete n.value,delete n.type,delete n.accessList,delete n.maxFeePerGas,delete n.maxPriorityFeePerGas,delete n.customData,delete n.ccipReadEnabled;const c=Object.keys(n).filter((e=>null!=n[e]));return c.length&&no.throwError(`cannot override ${c.map((e=>JSON.stringify(e))).join(",")}`,ee.errors.UNSUPPORTED_OPERATION,{operation:"overrides",overrides:c}),s}))}function co(e,t){const r=t.wait.bind(t);t.wait=t=>r(t).then((t=>(t.events=t.logs.map((r=>{let n=rt(r),i=null;try{i=e.interface.parseLog(r)}catch(o){}return i&&(n.args=i.args,n.decode=(t,r)=>e.interface.decodeEventLog(i.eventFragment,t,r),n.event=i.name,n.eventSignature=i.signature),n.removeListener=()=>e.provider,n.getBlock=()=>e.provider.getBlock(t.blockHash),n.getTransaction=()=>e.provider.getTransaction(t.transactionHash),n.getTransactionReceipt=()=>Promise.resolve(t),n})),t)))}function uo(e,t,r){const n=e.signer||e.provider;return function(...i){return ro(this,void 0,void 0,(function*(){let o;if(i.length===t.inputs.length+1&&"object"==typeof i[i.length-1]){const e=Qe(i.pop());null!=e.blockTag&&(o=yield e.blockTag),delete e.blockTag,i.push(e)}null!=e.deployTransaction&&(yield e._deployed(o));const s=yield ao(e,t,i),a=yield n.call(s,o);try{let n=e.interface.decodeFunctionResult(t,a);return r&&1===t.outputs.length&&(n=n[0]),n}catch(c){throw c.code===ee.errors.CALL_EXCEPTION&&(c.address=e.address,c.args=i,c.transaction=s),c}}))}}function lo(e,t,r){return t.constant?uo(e,t,r):function(e,t){return function(...r){return ro(this,void 0,void 0,(function*(){e.signer||no.throwError("sending a transaction requires a signer",ee.errors.UNSUPPORTED_OPERATION,{operation:"sendTransaction"}),null!=e.deployTransaction&&(yield e._deployed());const n=yield ao(e,t,r),i=yield e.signer.sendTransaction(n);return co(e,i),i}))}}(e,t)}function ho(e){return!e.address||null!=e.topics&&0!==e.topics.length?(e.address||"*")+"@"+(e.topics?e.topics.map((e=>Array.isArray(e)?e.join("|"):e)).join(":"):""):"*"}class fo{constructor(e,t){Ge(this,"tag",e),Ge(this,"filter",t),this._listeners=[]}addListener(e,t){this._listeners.push({listener:e,once:t})}removeListener(e){let t=!1;this._listeners=this._listeners.filter((r=>!(!t&&r.listener===e)||(t=!0,!1)))}removeAllListeners(){this._listeners=[]}listeners(){return this._listeners.map((e=>e.listener))}listenerCount(){return this._listeners.length}run(e){const t=this.listenerCount();return this._listeners=this._listeners.filter((t=>{const r=e.slice();return setTimeout((()=>{t.listener.apply(this,r)}),0),!t.once})),t}prepareEvent(e){}getEmit(e){return[e]}}class po extends fo{constructor(){super("error",null)}}class mo extends fo{constructor(e,t,r,n){const i={address:e};let o=t.getEventTopic(r);n?(o!==n[0]&&no.throwArgumentError("topic mismatch","topics",n),i.topics=n.slice()):i.topics=[o],super(ho(i),i),Ge(this,"address",e),Ge(this,"interface",t),Ge(this,"fragment",r)}prepareEvent(e){super.prepareEvent(e),e.event=this.fragment.name,e.eventSignature=this.fragment.format(),e.decode=(e,t)=>this.interface.decodeEventLog(this.fragment,e,t);try{e.args=this.interface.decodeEventLog(this.fragment,e.data,e.topics)}catch(t){e.args=null,e.decodeError=t}}getEmit(e){const t=Mt(e.args);if(t.length)throw t[0].error;const r=(e.args||[]).slice();return r.push(e),r}}class go extends fo{constructor(e,t){super("*",{address:e}),Ge(this,"address",e),Ge(this,"interface",t)}prepareEvent(e){super.prepareEvent(e);try{const t=this.interface.parseLog(e);e.event=t.name,e.eventSignature=t.signature,e.decode=(e,r)=>this.interface.decodeEventLog(t.eventFragment,e,r),e.args=t.args}catch(t){}}}class yo{constructor(e,t,r){Ge(this,"interface",Ze(new.target,"getInterface")(t)),null==r?(Ge(this,"provider",null),Ge(this,"signer",null)):Hn.isSigner(r)?(Ge(this,"provider",r.provider||null),Ge(this,"signer",r)):qn.isProvider(r)?(Ge(this,"provider",r),Ge(this,"signer",null)):no.throwArgumentError("invalid signer or provider","signerOrProvider",r),Ge(this,"callStatic",{}),Ge(this,"estimateGas",{}),Ge(this,"functions",{}),Ge(this,"populateTransaction",{}),Ge(this,"filters",{});{const e={};Object.keys(this.interface.events).forEach((t=>{const r=this.interface.events[t];Ge(this.filters,t,((...e)=>({address:this.address,topics:this.interface.encodeFilterTopics(r,e)}))),e[r.name]||(e[r.name]=[]),e[r.name].push(t)})),Object.keys(e).forEach((t=>{const r=e[t];1===r.length?Ge(this.filters,t,this.filters[r[0]]):no.warn(`Duplicate definition of ${t} (${r.join(", ")})`)}))}if(Ge(this,"_runningEvents",{}),Ge(this,"_wrappedEmits",{}),null==e&&no.throwArgumentError("invalid contract address or ENS name","addressOrName",e),Ge(this,"address",e),this.provider)Ge(this,"resolvedAddress",oo(this.provider,e));else try{Ge(this,"resolvedAddress",Promise.resolve(Jt(e)))}catch(o){no.throwError("provider is required to use ENS name as contract address",ee.errors.UNSUPPORTED_OPERATION,{operation:"new Contract"})}this.resolvedAddress.catch((e=>{}));const n={},i={};Object.keys(this.interface.functions).forEach((e=>{const t=this.interface.functions[e];if(i[e])no.warn(`Duplicate ABI entry for ${JSON.stringify(e)}`);else{i[e]=!0;{const r=t.name;n[`%${r}`]||(n[`%${r}`]=[]),n[`%${r}`].push(e)}null==this[e]&&Ge(this,e,lo(this,t,!0)),null==this.functions[e]&&Ge(this.functions,e,lo(this,t,!1)),null==this.callStatic[e]&&Ge(this.callStatic,e,uo(this,t,!0)),null==this.populateTransaction[e]&&Ge(this.populateTransaction,e,function(e,t){return function(...r){return ao(e,t,r)}}(this,t)),null==this.estimateGas[e]&&Ge(this.estimateGas,e,function(e,t){const r=e.signer||e.provider;return function(...n){return ro(this,void 0,void 0,(function*(){r||no.throwError("estimate require a provider or signer",ee.errors.UNSUPPORTED_OPERATION,{operation:"estimateGas"});const i=yield ao(e,t,n);return yield r.estimateGas(i)}))}}(this,t))}})),Object.keys(n).forEach((e=>{const t=n[e];if(t.length>1)return;e=e.substring(1);const r=t[0];try{null==this[e]&&Ge(this,e,this[r])}catch(i){}null==this.functions[e]&&Ge(this.functions,e,this.functions[r]),null==this.callStatic[e]&&Ge(this.callStatic,e,this.callStatic[r]),null==this.populateTransaction[e]&&Ge(this.populateTransaction,e,this.populateTransaction[r]),null==this.estimateGas[e]&&Ge(this.estimateGas,e,this.estimateGas[r])}))}static getContractAddress(e){return $t(e)}static getInterface(e){return Ln.isInterface(e)?e:new Ln(e)}deployed(){return this._deployed()}_deployed(e){return this._deployedPromise||(this.deployTransaction?this._deployedPromise=this.deployTransaction.wait().then((()=>this)):this._deployedPromise=this.provider.getCode(this.address,e).then((e=>("0x"===e&&no.throwError("contract not deployed",ee.errors.UNSUPPORTED_OPERATION,{contractAddress:this.address,operation:"getDeployed"}),this)))),this._deployedPromise}fallback(e){this.signer||no.throwError("sending a transactions require a signer",ee.errors.UNSUPPORTED_OPERATION,{operation:"sendTransaction(fallback)"});const t=Qe(e||{});return["from","to"].forEach((function(e){null!=t[e]&&no.throwError("cannot override "+e,ee.errors.UNSUPPORTED_OPERATION,{operation:e})})),t.to=this.resolvedAddress,this.deployed().then((()=>this.signer.sendTransaction(t)))}connect(e){"string"==typeof e&&(e=new Wn(e,this.provider));const t=new this.constructor(this.address,this.interface,e);return this.deployTransaction&&Ge(t,"deployTransaction",this.deployTransaction),t}attach(e){return new this.constructor(e,this.interface,this.signer||this.provider)}static isIndexed(e){return Rn.isIndexed(e)}_normalizeRunningEvent(e){return this._runningEvents[e.tag]?this._runningEvents[e.tag]:e}_getRunningEvent(e){if("string"==typeof e){if("error"===e)return this._normalizeRunningEvent(new po);if("event"===e)return this._normalizeRunningEvent(new fo("event",null));if("*"===e)return this._normalizeRunningEvent(new go(this.address,this.interface));const t=this.interface.getEvent(e);return this._normalizeRunningEvent(new mo(this.address,this.interface,t))}if(e.topics&&e.topics.length>0){try{const t=e.topics[0];if("string"!=typeof t)throw new Error("invalid topic");const r=this.interface.getEvent(t);return this._normalizeRunningEvent(new mo(this.address,this.interface,r,e.topics))}catch(t){}const r={address:this.address,topics:e.topics};return this._normalizeRunningEvent(new fo(ho(r),r))}return this._normalizeRunningEvent(new go(this.address,this.interface))}_checkRunningEvents(e){if(0===e.listenerCount()){delete this._runningEvents[e.tag];const t=this._wrappedEmits[e.tag];t&&e.filter&&(this.provider.off(e.filter,t),delete this._wrappedEmits[e.tag])}}_wrapEvent(e,t,r){const n=rt(t);return n.removeListener=()=>{r&&(e.removeListener(r),this._checkRunningEvents(e))},n.getBlock=()=>this.provider.getBlock(t.blockHash),n.getTransaction=()=>this.provider.getTransaction(t.transactionHash),n.getTransactionReceipt=()=>this.provider.getTransactionReceipt(t.transactionHash),e.prepareEvent(n),n}_addEventListener(e,t,r){if(this.provider||no.throwError("events require a provider or a signer with a provider",ee.errors.UNSUPPORTED_OPERATION,{operation:"once"}),e.addListener(t,r),this._runningEvents[e.tag]=e,!this._wrappedEmits[e.tag]){const r=r=>{let n=this._wrapEvent(e,r,t);if(null==n.decodeError)try{const t=e.getEmit(n);this.emit(e.filter,...t)}catch(i){n.decodeError=i.error}null!=e.filter&&this.emit("event",n),null!=n.decodeError&&this.emit("error",n.decodeError,n)};this._wrappedEmits[e.tag]=r,null!=e.filter&&this.provider.on(e.filter,r)}}queryFilter(e,t,r){const n=this._getRunningEvent(e),i=Qe(n.filter);return"string"==typeof t&&he(t,32)?(null!=r&&no.throwArgumentError("cannot specify toBlock with blockhash","toBlock",r),i.blockHash=t):(i.fromBlock=null!=t?t:0,i.toBlock=null!=r?r:"latest"),this.provider.getLogs(i).then((e=>e.map((e=>this._wrapEvent(n,e,null)))))}on(e,t){return this._addEventListener(this._getRunningEvent(e),t,!1),this}once(e,t){return this._addEventListener(this._getRunningEvent(e),t,!0),this}emit(e,...t){if(!this.provider)return!1;const r=this._getRunningEvent(e),n=r.run(t)>0;return this._checkRunningEvents(r),n}listenerCount(e){return this.provider?null==e?Object.keys(this._runningEvents).reduce(((e,t)=>e+this._runningEvents[t].listenerCount()),0):this._getRunningEvent(e).listenerCount():0}listeners(e){if(!this.provider)return[];if(null==e){const e=[];for(let t in this._runningEvents)this._runningEvents[t].listeners().forEach((t=>{e.push(t)}));return e}return this._getRunningEvent(e).listeners()}removeAllListeners(e){if(!this.provider)return this;if(null==e){for(const e in this._runningEvents){const t=this._runningEvents[e];t.removeAllListeners(),this._checkRunningEvents(t)}return this}const t=this._getRunningEvent(e);return t.removeAllListeners(),this._checkRunningEvents(t),this}off(e,t){if(!this.provider)return this;const r=this._getRunningEvent(e);return r.removeListener(t),this._checkRunningEvents(r),this}removeListener(e,t){return this.off(e,t)}}class bo extends yo{}class vo{constructor(e,t,r){let n=null;n="string"==typeof t?t:se(t)?fe(t):t&&"string"==typeof t.object?t.object:"!","0x"!==n.substring(0,2)&&(n="0x"+n),(!he(n)||n.length%2)&&no.throwArgumentError("invalid bytecode","bytecode",t),r&&!Hn.isSigner(r)&&no.throwArgumentError("invalid signer","signer",r),Ge(this,"bytecode",n),Ge(this,"interface",Ze(new.target,"getInterface")(e)),Ge(this,"signer",r||null)}getDeployTransaction(...e){let t={};if(e.length===this.interface.deploy.inputs.length+1&&"object"==typeof e[e.length-1]){t=Qe(e.pop());for(const e in t)if(!io[e])throw new Error("unknown transaction override "+e)}if(["data","from","to"].forEach((e=>{null!=t[e]&&no.throwError("cannot override "+e,ee.errors.UNSUPPORTED_OPERATION,{operation:e})})),t.value){Pe.from(t.value).isZero()||this.interface.deploy.payable||no.throwError("non-payable constructor cannot override value",ee.errors.UNSUPPORTED_OPERATION,{operation:"overrides.value",value:t.value})}return no.checkArgumentCount(e.length,this.interface.deploy.inputs.length," in Contract constructor"),t.data=fe(ce([this.bytecode,this.interface.encodeDeploy(e)])),t}deploy(...e){return ro(this,void 0,void 0,(function*(){let t={};e.length===this.interface.deploy.inputs.length+1&&(t=e.pop()),no.checkArgumentCount(e.length,this.interface.deploy.inputs.length," in Contract constructor");const r=yield so(this.signer,e,this.interface.deploy.inputs);r.push(t);const n=this.getDeployTransaction(...r),i=yield this.signer.sendTransaction(n),o=Ze(this.constructor,"getContractAddress")(i),s=Ze(this.constructor,"getContract")(o,this.interface,this.signer);return co(s,i),Ge(s,"deployTransaction",i),s}))}attach(e){return this.constructor.getContract(e,this.interface,this.signer)}connect(e){return new this.constructor(this.interface,this.bytecode,e)}static fromSolidity(e,t){null==e&&no.throwError("missing compiler output",ee.errors.MISSING_ARGUMENT,{argument:"compilerOutput"}),"string"==typeof e&&(e=JSON.parse(e));const r=e.abi;let n=null;return e.bytecode?n=e.bytecode:e.evm&&e.evm.bytecode&&(n=e.evm.bytecode),new this(r,n,t)}static getInterface(e){return bo.getInterface(e)}static getContractAddress(e){return $t(e)}static getContract(e,t,r){return new bo(e,t,r)}}class wo{constructor(e){Ge(this,"alphabet",e),Ge(this,"base",e.length),Ge(this,"_alphabetMap",{}),Ge(this,"_leader",e.charAt(0));for(let t=0;t<e.length;t++)this._alphabetMap[e.charAt(t)]=t}encode(e){let t=ae(e);if(0===t.length)return"";let r=[0];for(let i=0;i<t.length;++i){let e=t[i];for(let t=0;t<r.length;++t)e+=r[t]<<8,r[t]=e%this.base,e=e/this.base|0;for(;e>0;)r.push(e%this.base),e=e/this.base|0}let n="";for(let i=0;0===t[i]&&i<t.length-1;++i)n+=this._leader;for(let i=r.length-1;i>=0;--i)n+=this.alphabet[r[i]];return n}decode(e){if("string"!=typeof e)throw new TypeError("Expected String");let t=[];if(0===e.length)return new Uint8Array(t);t.push(0);for(let r=0;r<e.length;r++){let n=this._alphabetMap[e[r]];if(void 0===n)throw new Error("Non-base"+this.base+" character");let i=n;for(let e=0;e<t.length;++e)i+=t[e]*this.base,t[e]=255&i,i>>=8;for(;i>0;)t.push(255&i),i>>=8}for(let r=0;e[r]===this._leader&&r<e.length-1;++r)t.push(0);return ae(new Uint8Array(t.reverse()))}}new wo("abcdefghijklmnopqrstuvwxyz234567");const xo=new wo("123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz");var ko;!function(e){e.sha256="sha256",e.sha512="sha512"}(ko||(ko={}));const So=new ee("sha2/5.6.0");function Eo(e){return"0x"+Zn().ripemd160().update(ae(e)).digest("hex")}function Ao(e){return"0x"+Zn().sha256().update(ae(e)).digest("hex")}function No(e){return"0x"+Zn().sha512().update(ae(e)).digest("hex")}function To(e,t,r){return ko[e]||So.throwError("unsupported algorithm "+e,ee.errors.UNSUPPORTED_OPERATION,{operation:"hmac",algorithm:e}),"0x"+Zn().hmac(Zn()[e],ae(t)).update(ae(r)).digest("hex")}function Po(e,t,r,n,i){let o;e=ae(e),t=ae(t);let s=1;const a=new Uint8Array(n),c=new Uint8Array(t.length+4);let u,l;c.set(t);for(let h=1;h<=s;h++){c[t.length]=h>>24&255,c[t.length+1]=h>>16&255,c[t.length+2]=h>>8&255,c[t.length+3]=255&h;let d=ae(To(i,e,c));o||(o=d.length,l=new Uint8Array(o),s=Math.ceil(n/o),u=n-(s-1)*o),l.set(d);for(let t=1;t<r;t++){d=ae(To(i,e,d));for(let e=0;e<o;e++)l[e]^=d[e]}const f=(h-1)*o,p=h===s?u:o;a.set(ae(l).slice(0,p),f)}return fe(a)}const Mo=new ee("wordlists/5.6.0");class Io{constructor(e){Mo.checkAbstract(new.target,Io),Ge(this,"locale",e)}split(e){return e.toLowerCase().split(/ +/g)}join(e){return e.join(" ")}static check(e){const t=[];for(let r=0;r<2048;r++){const n=e.getWord(r);if(r!==e.getWordIndex(n))return"0x";t.push(n)}return rn(t.join("\n")+"\n")}static register(e,t){t||(t=e.locale)}}let Co=null;function Ro(e){if(null==Co&&(Co="AbandonAbilityAbleAboutAboveAbsentAbsorbAbstractAbsurdAbuseAccessAccidentAccountAccuseAchieveAcidAcousticAcquireAcrossActActionActorActressActualAdaptAddAddictAddressAdjustAdmitAdultAdvanceAdviceAerobicAffairAffordAfraidAgainAgeAgentAgreeAheadAimAirAirportAisleAlarmAlbumAlcoholAlertAlienAllAlleyAllowAlmostAloneAlphaAlreadyAlsoAlterAlwaysAmateurAmazingAmongAmountAmusedAnalystAnchorAncientAngerAngleAngryAnimalAnkleAnnounceAnnualAnotherAnswerAntennaAntiqueAnxietyAnyApartApologyAppearAppleApproveAprilArchArcticAreaArenaArgueArmArmedArmorArmyAroundArrangeArrestArriveArrowArtArtefactArtistArtworkAskAspectAssaultAssetAssistAssumeAsthmaAthleteAtomAttackAttendAttitudeAttractAuctionAuditAugustAuntAuthorAutoAutumnAverageAvocadoAvoidAwakeAwareAwayAwesomeAwfulAwkwardAxisBabyBachelorBaconBadgeBagBalanceBalconyBallBambooBananaBannerBarBarelyBargainBarrelBaseBasicBasketBattleBeachBeanBeautyBecauseBecomeBeefBeforeBeginBehaveBehindBelieveBelowBeltBenchBenefitBestBetrayBetterBetweenBeyondBicycleBidBikeBindBiologyBirdBirthBitterBlackBladeBlameBlanketBlastBleakBlessBlindBloodBlossomBlouseBlueBlurBlushBoardBoatBodyBoilBombBoneBonusBookBoostBorderBoringBorrowBossBottomBounceBoxBoyBracketBrainBrandBrassBraveBreadBreezeBrickBridgeBriefBrightBringBriskBroccoliBrokenBronzeBroomBrotherBrownBrushBubbleBuddyBudgetBuffaloBuildBulbBulkBulletBundleBunkerBurdenBurgerBurstBusBusinessBusyButterBuyerBuzzCabbageCabinCableCactusCageCakeCallCalmCameraCampCanCanalCancelCandyCannonCanoeCanvasCanyonCapableCapitalCaptainCarCarbonCardCargoCarpetCarryCartCaseCashCasinoCastleCasualCatCatalogCatchCategoryCattleCaughtCauseCautionCaveCeilingCeleryCementCensusCenturyCerealCertainChairChalkChampionChangeChaosChapterChargeChaseChatCheapCheckCheeseChefCherryChestChickenChiefChildChimneyChoiceChooseChronicChuckleChunkChurnCigarCinnamonCircleCitizenCityCivilClaimClapClarifyClawClayCleanClerkCleverClickClientCliffClimbClinicClipClockClogCloseClothCloudClownClubClumpClusterClutchCoachCoastCoconutCodeCoffeeCoilCoinCollectColorColumnCombineComeComfortComicCommonCompanyConcertConductConfirmCongressConnectConsiderControlConvinceCookCoolCopperCopyCoralCoreCornCorrectCostCottonCouchCountryCoupleCourseCousinCoverCoyoteCrackCradleCraftCramCraneCrashCraterCrawlCrazyCreamCreditCreekCrewCricketCrimeCrispCriticCropCrossCrouchCrowdCrucialCruelCruiseCrumbleCrunchCrushCryCrystalCubeCultureCupCupboardCuriousCurrentCurtainCurveCushionCustomCuteCycleDadDamageDampDanceDangerDaringDashDaughterDawnDayDealDebateDebrisDecadeDecemberDecideDeclineDecorateDecreaseDeerDefenseDefineDefyDegreeDelayDeliverDemandDemiseDenialDentistDenyDepartDependDepositDepthDeputyDeriveDescribeDesertDesignDeskDespairDestroyDetailDetectDevelopDeviceDevoteDiagramDialDiamondDiaryDiceDieselDietDifferDigitalDignityDilemmaDinnerDinosaurDirectDirtDisagreeDiscoverDiseaseDishDismissDisorderDisplayDistanceDivertDivideDivorceDizzyDoctorDocumentDogDollDolphinDomainDonateDonkeyDonorDoorDoseDoubleDoveDraftDragonDramaDrasticDrawDreamDressDriftDrillDrinkDripDriveDropDrumDryDuckDumbDuneDuringDustDutchDutyDwarfDynamicEagerEagleEarlyEarnEarthEasilyEastEasyEchoEcologyEconomyEdgeEditEducateEffortEggEightEitherElbowElderElectricElegantElementElephantElevatorEliteElseEmbarkEmbodyEmbraceEmergeEmotionEmployEmpowerEmptyEnableEnactEndEndlessEndorseEnemyEnergyEnforceEngageEngineEnhanceEnjoyEnlistEnoughEnrichEnrollEnsureEnterEntireEntryEnvelopeEpisodeEqualEquipEraEraseErodeErosionErrorEruptEscapeEssayEssenceEstateEternalEthicsEvidenceEvilEvokeEvolveExactExampleExcessExchangeExciteExcludeExcuseExecuteExerciseExhaustExhibitExileExistExitExoticExpandExpectExpireExplainExposeExpressExtendExtraEyeEyebrowFabricFaceFacultyFadeFaintFaithFallFalseFameFamilyFamousFanFancyFantasyFarmFashionFatFatalFatherFatigueFaultFavoriteFeatureFebruaryFederalFeeFeedFeelFemaleFenceFestivalFetchFeverFewFiberFictionFieldFigureFileFilmFilterFinalFindFineFingerFinishFireFirmFirstFiscalFishFitFitnessFixFlagFlameFlashFlatFlavorFleeFlightFlipFloatFlockFloorFlowerFluidFlushFlyFoamFocusFogFoilFoldFollowFoodFootForceForestForgetForkFortuneForumForwardFossilFosterFoundFoxFragileFrameFrequentFreshFriendFringeFrogFrontFrostFrownFrozenFruitFuelFunFunnyFurnaceFuryFutureGadgetGainGalaxyGalleryGameGapGarageGarbageGardenGarlicGarmentGasGaspGateGatherGaugeGazeGeneralGeniusGenreGentleGenuineGestureGhostGiantGiftGiggleGingerGiraffeGirlGiveGladGlanceGlareGlassGlideGlimpseGlobeGloomGloryGloveGlowGlueGoatGoddessGoldGoodGooseGorillaGospelGossipGovernGownGrabGraceGrainGrantGrapeGrassGravityGreatGreenGridGriefGritGroceryGroupGrowGruntGuardGuessGuideGuiltGuitarGunGymHabitHairHalfHammerHamsterHandHappyHarborHardHarshHarvestHatHaveHawkHazardHeadHealthHeartHeavyHedgehogHeightHelloHelmetHelpHenHeroHiddenHighHillHintHipHireHistoryHobbyHockeyHoldHoleHolidayHollowHomeHoneyHoodHopeHornHorrorHorseHospitalHostHotelHourHoverHubHugeHumanHumbleHumorHundredHungryHuntHurdleHurryHurtHusbandHybridIceIconIdeaIdentifyIdleIgnoreIllIllegalIllnessImageImitateImmenseImmuneImpactImposeImproveImpulseInchIncludeIncomeIncreaseIndexIndicateIndoorIndustryInfantInflictInformInhaleInheritInitialInjectInjuryInmateInnerInnocentInputInquiryInsaneInsectInsideInspireInstallIntactInterestIntoInvestInviteInvolveIronIslandIsolateIssueItemIvoryJacketJaguarJarJazzJealousJeansJellyJewelJobJoinJokeJourneyJoyJudgeJuiceJumpJungleJuniorJunkJustKangarooKeenKeepKetchupKeyKickKidKidneyKindKingdomKissKitKitchenKiteKittenKiwiKneeKnifeKnockKnowLabLabelLaborLadderLadyLakeLampLanguageLaptopLargeLaterLatinLaughLaundryLavaLawLawnLawsuitLayerLazyLeaderLeafLearnLeaveLectureLeftLegLegalLegendLeisureLemonLendLengthLensLeopardLessonLetterLevelLiarLibertyLibraryLicenseLifeLiftLightLikeLimbLimitLinkLionLiquidListLittleLiveLizardLoadLoanLobsterLocalLockLogicLonelyLongLoopLotteryLoudLoungeLoveLoyalLuckyLuggageLumberLunarLunchLuxuryLyricsMachineMadMagicMagnetMaidMailMainMajorMakeMammalManManageMandateMangoMansionManualMapleMarbleMarchMarginMarineMarketMarriageMaskMassMasterMatchMaterialMathMatrixMatterMaximumMazeMeadowMeanMeasureMeatMechanicMedalMediaMelodyMeltMemberMemoryMentionMenuMercyMergeMeritMerryMeshMessageMetalMethodMiddleMidnightMilkMillionMimicMindMinimumMinorMinuteMiracleMirrorMiseryMissMistakeMixMixedMixtureMobileModelModifyMomMomentMonitorMonkeyMonsterMonthMoonMoralMoreMorningMosquitoMotherMotionMotorMountainMouseMoveMovieMuchMuffinMuleMultiplyMuscleMuseumMushroomMusicMustMutualMyselfMysteryMythNaiveNameNapkinNarrowNastyNationNatureNearNeckNeedNegativeNeglectNeitherNephewNerveNestNetNetworkNeutralNeverNewsNextNiceNightNobleNoiseNomineeNoodleNormalNorthNoseNotableNoteNothingNoticeNovelNowNuclearNumberNurseNutOakObeyObjectObligeObscureObserveObtainObviousOccurOceanOctoberOdorOffOfferOfficeOftenOilOkayOldOliveOlympicOmitOnceOneOnionOnlineOnlyOpenOperaOpinionOpposeOptionOrangeOrbitOrchardOrderOrdinaryOrganOrientOriginalOrphanOstrichOtherOutdoorOuterOutputOutsideOvalOvenOverOwnOwnerOxygenOysterOzonePactPaddlePagePairPalacePalmPandaPanelPanicPantherPaperParadeParentParkParrotPartyPassPatchPathPatientPatrolPatternPausePavePaymentPeacePeanutPearPeasantPelicanPenPenaltyPencilPeoplePepperPerfectPermitPersonPetPhonePhotoPhrasePhysicalPianoPicnicPicturePiecePigPigeonPillPilotPinkPioneerPipePistolPitchPizzaPlacePlanetPlasticPlatePlayPleasePledgePluckPlugPlungePoemPoetPointPolarPolePolicePondPonyPoolPopularPortionPositionPossiblePostPotatoPotteryPovertyPowderPowerPracticePraisePredictPreferPreparePresentPrettyPreventPricePridePrimaryPrintPriorityPrisonPrivatePrizeProblemProcessProduceProfitProgramProjectPromoteProofPropertyProsperProtectProudProvidePublicPuddingPullPulpPulsePumpkinPunchPupilPuppyPurchasePurityPurposePursePushPutPuzzlePyramidQualityQuantumQuarterQuestionQuickQuitQuizQuoteRabbitRaccoonRaceRackRadarRadioRailRainRaiseRallyRampRanchRandomRangeRapidRareRateRatherRavenRawRazorReadyRealReasonRebelRebuildRecallReceiveRecipeRecordRecycleReduceReflectReformRefuseRegionRegretRegularRejectRelaxReleaseReliefRelyRemainRememberRemindRemoveRenderRenewRentReopenRepairRepeatReplaceReportRequireRescueResembleResistResourceResponseResultRetireRetreatReturnReunionRevealReviewRewardRhythmRibRibbonRiceRichRideRidgeRifleRightRigidRingRiotRippleRiskRitualRivalRiverRoadRoastRobotRobustRocketRomanceRoofRookieRoomRoseRotateRoughRoundRouteRoyalRubberRudeRugRuleRunRunwayRuralSadSaddleSadnessSafeSailSaladSalmonSalonSaltSaluteSameSampleSandSatisfySatoshiSauceSausageSaveSayScaleScanScareScatterSceneSchemeSchoolScienceScissorsScorpionScoutScrapScreenScriptScrubSeaSearchSeasonSeatSecondSecretSectionSecuritySeedSeekSegmentSelectSellSeminarSeniorSenseSentenceSeriesServiceSessionSettleSetupSevenShadowShaftShallowShareShedShellSheriffShieldShiftShineShipShiverShockShoeShootShopShortShoulderShoveShrimpShrugShuffleShySiblingSickSideSiegeSightSignSilentSilkSillySilverSimilarSimpleSinceSingSirenSisterSituateSixSizeSkateSketchSkiSkillSkinSkirtSkullSlabSlamSleepSlenderSliceSlideSlightSlimSloganSlotSlowSlushSmallSmartSmileSmokeSmoothSnackSnakeSnapSniffSnowSoapSoccerSocialSockSodaSoftSolarSoldierSolidSolutionSolveSomeoneSongSoonSorrySortSoulSoundSoupSourceSouthSpaceSpareSpatialSpawnSpeakSpecialSpeedSpellSpendSphereSpiceSpiderSpikeSpinSpiritSplitSpoilSponsorSpoonSportSpotSpraySpreadSpringSpySquareSqueezeSquirrelStableStadiumStaffStageStairsStampStandStartStateStaySteakSteelStemStepStereoStickStillStingStockStomachStoneStoolStoryStoveStrategyStreetStrikeStrongStruggleStudentStuffStumbleStyleSubjectSubmitSubwaySuccessSuchSuddenSufferSugarSuggestSuitSummerSunSunnySunsetSuperSupplySupremeSureSurfaceSurgeSurpriseSurroundSurveySuspectSustainSwallowSwampSwapSwarmSwearSweetSwiftSwimSwingSwitchSwordSymbolSymptomSyrupSystemTableTackleTagTailTalentTalkTankTapeTargetTaskTasteTattooTaxiTeachTeamTellTenTenantTennisTentTermTestTextThankThatThemeThenTheoryThereTheyThingThisThoughtThreeThriveThrowThumbThunderTicketTideTigerTiltTimberTimeTinyTipTiredTissueTitleToastTobaccoTodayToddlerToeTogetherToiletTokenTomatoTomorrowToneTongueTonightToolToothTopTopicToppleTorchTornadoTortoiseTossTotalTouristTowardTowerTownToyTrackTradeTrafficTragicTrainTransferTrapTrashTravelTrayTreatTreeTrendTrialTribeTrickTriggerTrimTripTrophyTroubleTruckTrueTrulyTrumpetTrustTruthTryTubeTuitionTumbleTunaTunnelTurkeyTurnTurtleTwelveTwentyTwiceTwinTwistTwoTypeTypicalUglyUmbrellaUnableUnawareUncleUncoverUnderUndoUnfairUnfoldUnhappyUniformUniqueUnitUniverseUnknownUnlockUntilUnusualUnveilUpdateUpgradeUpholdUponUpperUpsetUrbanUrgeUsageUseUsedUsefulUselessUsualUtilityVacantVacuumVagueValidValleyValveVanVanishVaporVariousVastVaultVehicleVelvetVendorVentureVenueVerbVerifyVersionVeryVesselVeteranViableVibrantViciousVictoryVideoViewVillageVintageViolinVirtualVirusVisaVisitVisualVitalVividVocalVoiceVoidVolcanoVolumeVoteVoyageWageWagonWaitWalkWallWalnutWantWarfareWarmWarriorWashWaspWasteWaterWaveWayWealthWeaponWearWeaselWeatherWebWeddingWeekendWeirdWelcomeWestWetWhaleWhatWheatWheelWhenWhereWhipWhisperWideWidthWifeWildWillWinWindowWineWingWinkWinnerWinterWireWisdomWiseWishWitnessWolfWomanWonderWoodWoolWordWorkWorldWorryWorthWrapWreckWrestleWristWriteWrongYardYearYellowYouYoungYouthZebraZeroZoneZoo".replace(/([A-Z])/g," $1").toLowerCase().substring(1).split(" "),"0x3c8acc1e7b08d8e76f9fda015ef48dc8c710a73cb7e0f77b2c18a9b5a7adde60"!==Io.check(e)))throw Co=null,new Error("BIP39 Wordlist for en (English) FAILED")}const Bo=new class extends Io{constructor(){super("en")}getWord(e){return Ro(this),Co[e]}getWordIndex(e){return Ro(this),Co.indexOf(e)}};Io.register(Bo);const Oo={en:Bo},Lo=new ee("hdnode/5.6.1"),zo=Pe.from("0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141"),Uo=Ir("Bitcoin seed"),_o=2147483648;function qo(e){return(1<<e)-1<<8-e}function Do(e){return(1<<e)-1}function Vo(e){return ve(fe(e),32)}function jo(e){return xo.encode(ce([e,me(Ao(Ao(e)),0,4)]))}function Fo(e){if(null==e)return Oo.en;if("string"==typeof e){const t=Oo[e];return null==t&&Lo.throwArgumentError("unknown locale","wordlist",e),t}return e}const Ho={},Wo="m/44'/60'/0'/0/0";class Ko{constructor(e,t,r,n,i,o,s,a){if(e!==Ho)throw new Error("HDNode constructor cannot be called directly");if(t){const e=new zi(t);Ge(this,"privateKey",e.privateKey),Ge(this,"publicKey",e.compressedPublicKey)}else Ge(this,"privateKey",null),Ge(this,"publicKey",fe(r));Ge(this,"parentFingerprint",n),Ge(this,"fingerprint",me(Eo(Ao(this.publicKey)),0,4)),Ge(this,"address",Wi(this.publicKey)),Ge(this,"chainCode",i),Ge(this,"index",o),Ge(this,"depth",s),null==a?(Ge(this,"mnemonic",null),Ge(this,"path",null)):"string"==typeof a?(Ge(this,"mnemonic",null),Ge(this,"path",a)):(Ge(this,"mnemonic",a),Ge(this,"path",a.path))}get extendedKey(){if(this.depth>=256)throw new Error("Depth too large!");return jo(ce([null!=this.privateKey?"0x0488ADE4":"0x0488B21E",fe(this.depth),this.parentFingerprint,ve(fe(this.index),4),this.chainCode,null!=this.privateKey?ce(["0x00",this.privateKey]):this.publicKey]))}neuter(){return new Ko(Ho,null,this.publicKey,this.parentFingerprint,this.chainCode,this.index,this.depth,this.path)}_derive(e){if(e>4294967295)throw new Error("invalid index - "+String(e));let t=this.path;t&&(t+="/"+(2147483647&e));const r=new Uint8Array(37);if(e&_o){if(!this.privateKey)throw new Error("cannot derive child of neutered node");r.set(ae(this.privateKey),1),t&&(t+="'")}else r.set(ae(this.publicKey));for(let l=24;l>=0;l-=8)r[33+(l>>3)]=e>>24-l&255;const n=ae(To(ko.sha512,this.chainCode,r)),i=n.slice(0,32),o=n.slice(32);let s=null,a=null;if(this.privateKey)s=Vo(Pe.from(i).add(this.privateKey).mod(zo));else{a=new zi(fe(i))._addPoint(this.publicKey)}let c=t;const u=this.mnemonic;return u&&(c=Object.freeze({phrase:u.phrase,path:t,locale:u.locale||"en"})),new Ko(Ho,s,a,this.fingerprint,Vo(o),e,this.depth+1,c)}derivePath(e){const t=e.split("/");if(0===t.length||"m"===t[0]&&0!==this.depth)throw new Error("invalid path - "+e);"m"===t[0]&&t.shift();let r=this;for(let n=0;n<t.length;n++){const e=t[n];if(e.match(/^[0-9]+'$/)){const t=parseInt(e.substring(0,e.length-1));if(t>=_o)throw new Error("invalid path index - "+e);r=r._derive(_o+t)}else{if(!e.match(/^[0-9]+$/))throw new Error("invalid path component - "+e);{const t=parseInt(e);if(t>=_o)throw new Error("invalid path index - "+e);r=r._derive(t)}}}return r}static _fromSeed(e,t){const r=ae(e);if(r.length<16||r.length>64)throw new Error("invalid seed");const n=ae(To(ko.sha512,Uo,r));return new Ko(Ho,Vo(n.slice(0,32)),null,"0x00000000",Vo(n.slice(32)),0,0,t)}static fromMnemonic(e,t,r){return e=Zo(Go(e,r=Fo(r)),r),Ko._fromSeed(Xo(e,t),{phrase:e,path:"m",locale:r.locale})}static fromSeed(e){return Ko._fromSeed(e,null)}static fromExtendedKey(e){const t=xo.decode(e);82===t.length&&jo(t.slice(0,78))===e||Lo.throwArgumentError("invalid extended key","extendedKey","[REDACTED]");const r=t[4],n=fe(t.slice(5,9)),i=parseInt(fe(t.slice(9,13)).substring(2),16),o=fe(t.slice(13,45)),s=t.slice(45,78);switch(fe(t.slice(0,4))){case"0x0488b21e":case"0x043587cf":return new Ko(Ho,null,fe(s),n,o,i,r,null);case"0x0488ade4":case"0x04358394 ":if(0!==s[0])break;return new Ko(Ho,fe(s.slice(1)),null,n,o,i,r,null)}return Lo.throwArgumentError("invalid extended key","extendedKey","[REDACTED]")}}function Xo(e,t){t||(t="");const r=Ir("mnemonic"+t,Ar.NFKD);return Po(Ir(e,Ar.NFKD),r,2048,64,"sha512")}function Go(e,t){t=Fo(t),Lo.checkNormalize();const r=t.split(e);if(r.length%3!=0)throw new Error("invalid mnemonic");const n=ae(new Uint8Array(Math.ceil(11*r.length/8)));let i=0;for(let a=0;a<r.length;a++){let e=t.getWordIndex(r[a].normalize("NFKD"));if(-1===e)throw new Error("invalid mnemonic");for(let t=0;t<11;t++)e&1<<10-t&&(n[i>>3]|=1<<7-i%8),i++}const o=32*r.length/3,s=qo(r.length/3);if((ae(Ao(n.slice(0,o/8)))[0]&s)!==(n[n.length-1]&s))throw new Error("invalid checksum");return fe(n.slice(0,o/8))}function Zo(e,t){if(t=Fo(t),(e=ae(e)).length%4!=0||e.length<16||e.length>32)throw new Error("invalid entropy");const r=[0];let n=11;for(let s=0;s<e.length;s++)n>8?(r[r.length-1]<<=8,r[r.length-1]|=e[s],n-=8):(r[r.length-1]<<=n,r[r.length-1]|=e[s]>>8-n,r.push(e[s]&Do(8-n)),n+=3);const i=e.length/4,o=ae(Ao(e))[0]&qo(i);return r[r.length-1]<<=i,r[r.length-1]|=o>>8-i,t.join(r.map((e=>t.getWord(e))))}function Jo(e,t){try{return Go(e,t),!0}catch(r){}return!1}function Yo(e){return("number"!=typeof e||e<0||e>=_o||e%1)&&Lo.throwArgumentError("invalid account index","index",e),`m/44'/60'/${e}'/0/0`}const Qo=new ee("random/5.6.0");const $o=function(){if("undefined"!=typeof self)return self;if("undefined"!=typeof window)return window;if("undefined"!=typeof global)return global;throw new Error("unable to locate global object")}();let es=$o.crypto||$o.msCrypto;function ts(e){(e<=0||e>1024||e%1||e!=e)&&Qo.throwArgumentError("invalid length","length",e);const t=new Uint8Array(e);return es.getRandomValues(t),ae(t)}function rs(e){for(let t=(e=e.slice()).length-1;t>0;t--){const r=Math.floor(Math.random()*(t+1)),n=e[t];e[t]=e[r],e[r]=n}return e}es&&es.getRandomValues||(Qo.warn("WARNING: Missing strong random number source"),es={getRandomValues:function(e){return Qo.throwError("no secure random source avaialble",ee.errors.UNSUPPORTED_OPERATION,{operation:"crypto.getRandomValues"})}});var ns=r(8202),is=r.n(ns);const os="json-wallets/5.6.0";function ss(e){return"string"==typeof e&&"0x"!==e.substring(0,2)&&(e="0x"+e),ae(e)}function as(e,t){for(e=String(e);e.length<t;)e="0"+e;return e}function cs(e){return"string"==typeof e?Ir(e,Ar.NFKC):ae(e)}function us(e,t){let r=e;const n=t.toLowerCase().split("/");for(let i=0;i<n.length;i++){let e=null;for(const t in r)if(t.toLowerCase()===n[i]){e=r[t];break}if(null===e)return null;r=e}return r}function ls(e){const t=ae(e);t[6]=15&t[6]|64,t[8]=63&t[8]|128;const r=fe(t);return[r.substring(2,10),r.substring(10,14),r.substring(14,18),r.substring(18,22),r.substring(22,34)].join("-")}const hs=new ee(os);class ds extends nt{isCrowdsaleAccount(e){return!(!e||!e._isCrowdsaleAccount)}}function fs(e,t){const r=JSON.parse(e);t=cs(t);const n=Jt(us(r,"ethaddr")),i=ss(us(r,"encseed"));i&&i.length%16==0||hs.throwArgumentError("invalid encseed","json",e);const o=ae(Po(t,t,2e3,32,"sha256")).slice(0,16),s=i.slice(0,16),a=i.slice(16),c=new(is().ModeOfOperation.cbc)(o,s),u=is().padding.pkcs7.strip(ae(c.decrypt(a)));let l="";for(let d=0;d<u.length;d++)l+=String.fromCharCode(u[d]);const h=Lt(Ir(l));return new ds({_isCrowdsaleAccount:!0,address:n,privateKey:h})}function ps(e){let t=null;try{t=JSON.parse(e)}catch(r){return!1}return t.encseed&&t.ethaddr}function ms(e){let t=null;try{t=JSON.parse(e)}catch(r){return!1}return!(!t.version||parseInt(t.version)!==t.version||3!==parseInt(t.version))}function gs(e){if(ps(e))try{return Jt(JSON.parse(e).ethaddr)}catch(t){return null}if(ms(e))try{return Jt(JSON.parse(e).address)}catch(t){return null}return null}var ys=r(14689),bs=r.n(ys),vs=function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{c(n.next(e))}catch(t){o(t)}}function a(e){try{c(n.throw(e))}catch(t){o(t)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}c((n=n.apply(e,t||[])).next())}))};const ws=new ee(os);function xs(e){return null!=e&&e.mnemonic&&e.mnemonic.phrase}class ks extends nt{isKeystoreAccount(e){return!(!e||!e._isKeystoreAccount)}}function Ss(e,t){const r=ss(us(e,"crypto/ciphertext"));if(fe(Lt(ce([t.slice(16,32),r]))).substring(2)!==us(e,"crypto/mac").toLowerCase())throw new Error("invalid password");const n=function(e,t,r){if("aes-128-ctr"===us(e,"crypto/cipher")){const n=ss(us(e,"crypto/cipherparams/iv")),i=new(is().Counter)(n);return ae(new(is().ModeOfOperation.ctr)(t,i).decrypt(r))}return null}(e,t.slice(0,16),r);n||ws.throwError("unsupported cipher",ee.errors.UNSUPPORTED_OPERATION,{operation:"decrypt"});const i=t.slice(32,64),o=Wi(n);if(e.address){let t=e.address.toLowerCase();if("0x"!==t.substring(0,2)&&(t="0x"+t),Jt(t)!==o)throw new Error("address mismatch")}const s={_isKeystoreAccount:!0,address:o,privateKey:fe(n)};if("0.1"===us(e,"x-ethers/version")){const t=ss(us(e,"x-ethers/mnemonicCiphertext")),r=ss(us(e,"x-ethers/mnemonicCounter")),n=new(is().Counter)(r),o=new(is().ModeOfOperation.ctr)(i,n),c=us(e,"x-ethers/path")||Wo,u=us(e,"x-ethers/locale")||"en",l=ae(o.decrypt(t));try{const e=Zo(l,u),t=Ko.fromMnemonic(e,null,u).derivePath(c);if(t.privateKey!=s.privateKey)throw new Error("mnemonic mismatch");s.mnemonic=t.mnemonic}catch(a){if(a.code!==ee.errors.INVALID_ARGUMENT||"wordlist"!==a.argument)throw a}}return new ks(s)}function Es(e,t,r,n,i){return ae(Po(e,t,r,n,i))}function As(e,t,r,n,i){return Promise.resolve(Es(e,t,r,n,i))}function Ns(e,t,r,n,i){const o=cs(t),s=us(e,"crypto/kdf");if(s&&"string"==typeof s){const t=function(e,t){return ws.throwArgumentError("invalid key-derivation function parameters",e,t)};if("scrypt"===s.toLowerCase()){const r=ss(us(e,"crypto/kdfparams/salt")),a=parseInt(us(e,"crypto/kdfparams/n")),c=parseInt(us(e,"crypto/kdfparams/r")),u=parseInt(us(e,"crypto/kdfparams/p"));a&&c&&u||t("kdf",s),0!=(a&a-1)&&t("N",a);const l=parseInt(us(e,"crypto/kdfparams/dklen"));return 32!==l&&t("dklen",l),n(o,r,a,c,u,64,i)}if("pbkdf2"===s.toLowerCase()){const n=ss(us(e,"crypto/kdfparams/salt"));let i=null;const s=us(e,"crypto/kdfparams/prf");"hmac-sha256"===s?i="sha256":"hmac-sha512"===s?i="sha512":t("prf",s);const a=parseInt(us(e,"crypto/kdfparams/c")),c=parseInt(us(e,"crypto/kdfparams/dklen"));return 32!==c&&t("dklen",c),r(o,n,a,c,i)}}return ws.throwArgumentError("unsupported key-derivation function","kdf",s)}function Ts(e,t,r){if(ps(e)){r&&r(0);const n=fs(e,t);return r&&r(1),Promise.resolve(n)}return ms(e)?function(e,t,r){return vs(this,void 0,void 0,(function*(){const n=JSON.parse(e);return Ss(n,yield Ns(n,t,As,bs().scrypt,r))}))}(e,t,r):Promise.reject(new Error("invalid JSON wallet"))}function Ps(e,t){if(ps(e))return fs(e,t);if(ms(e))return function(e,t){const r=JSON.parse(e);return Ss(r,Ns(r,t,Es,bs().syncScrypt))}(e,t);throw new Error("invalid JSON wallet")}var Ms=function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{c(n.next(e))}catch(t){o(t)}}function a(e){try{c(n.throw(e))}catch(t){o(t)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}c((n=n.apply(e,t||[])).next())}))};const Is=new ee("wallet/5.6.1");class Cs extends Hn{constructor(e,t){if(super(),null!=(r=e)&&he(r.privateKey,32)&&null!=r.address){const t=new zi(e.privateKey);if(Ge(this,"_signingKey",(()=>t)),Ge(this,"address",Wi(this.publicKey)),this.address!==Jt(e.address)&&Is.throwArgumentError("privateKey/address mismatch","privateKey","[REDACTED]"),function(e){const t=e.mnemonic;return t&&t.phrase}(e)){const t=e.mnemonic;Ge(this,"_mnemonic",(()=>({phrase:t.phrase,path:t.path||Wo,locale:t.locale||"en"})));const r=this.mnemonic;Wi(Ko.fromMnemonic(r.phrase,null,r.locale).derivePath(r.path).privateKey)!==this.address&&Is.throwArgumentError("mnemonic/address mismatch","privateKey","[REDACTED]")}else Ge(this,"_mnemonic",(()=>null))}else{if(zi.isSigningKey(e))"secp256k1"!==e.curve&&Is.throwArgumentError("unsupported curve; must be secp256k1","privateKey","[REDACTED]"),Ge(this,"_signingKey",(()=>e));else{"string"==typeof e&&e.match(/^[0-9a-f]*$/i)&&64===e.length&&(e="0x"+e);const t=new zi(e);Ge(this,"_signingKey",(()=>t))}Ge(this,"_mnemonic",(()=>null)),Ge(this,"address",Wi(this.publicKey))}var r;t&&!qn.isProvider(t)&&Is.throwArgumentError("invalid provider","provider",t),Ge(this,"provider",t||null)}get mnemonic(){return this._mnemonic()}get privateKey(){return this._signingKey().privateKey}get publicKey(){return this._signingKey().publicKey}getAddress(){return Promise.resolve(this.address)}connect(e){return new Cs(this,e)}signTransaction(e){return Je(e).then((t=>{null!=t.from&&(Jt(t.from)!==this.address&&Is.throwArgumentError("transaction from address mismatch","transaction.from",e.from),delete t.from);const r=this._signingKey().signDigest(Lt($i(t)));return $i(t,r)}))}signMessage(e){return Ms(this,void 0,void 0,(function*(){return xe(this._signingKey().signDigest(hn(e)))}))}_signTypedData(e,t,r){return Ms(this,void 0,void 0,(function*(){const n=yield Tn.resolveNames(e,t,r,(e=>(null==this.provider&&Is.throwError("cannot resolve ENS names without a provider",ee.errors.UNSUPPORTED_OPERATION,{operation:"resolveName",value:e}),this.provider.resolveName(e))));return xe(this._signingKey().signDigest(Tn.hash(n.domain,t,n.value)))}))}encrypt(e,t,r){if("function"!=typeof t||r||(r=t,t={}),r&&"function"!=typeof r)throw new Error("invalid callback");return t||(t={}),function(e,t,r,n){try{if(Jt(e.address)!==Wi(e.privateKey))throw new Error("address/privateKey mismatch");if(xs(e)){const t=e.mnemonic;if(Ko.fromMnemonic(t.phrase,null,t.locale).derivePath(t.path||Wo).privateKey!=e.privateKey)throw new Error("mnemonic mismatch")}}catch(g){return Promise.reject(g)}"function"!=typeof r||n||(n=r,r={}),r||(r={});const i=ae(e.privateKey),o=cs(t);let s=null,a=null,c=null;if(xs(e)){const t=e.mnemonic;s=ae(Go(t.phrase,t.locale||"en")),a=t.path||Wo,c=t.locale||"en"}let u=r.client;u||(u="ethers.js");let l=null;l=r.salt?ae(r.salt):ts(32);let h=null;if(r.iv){if(h=ae(r.iv),16!==h.length)throw new Error("invalid iv")}else h=ts(16);let d=null;if(r.uuid){if(d=ae(r.uuid),16!==d.length)throw new Error("invalid uuid")}else d=ts(16);let f=1<<17,p=8,m=1;return r.scrypt&&(r.scrypt.N&&(f=r.scrypt.N),r.scrypt.r&&(p=r.scrypt.r),r.scrypt.p&&(m=r.scrypt.p)),bs().scrypt(o,l,f,p,m,64,n).then((t=>{const r=(t=ae(t)).slice(0,16),n=t.slice(16,32),o=t.slice(32,64),g=new(is().Counter)(h),y=ae(new(is().ModeOfOperation.ctr)(r,g).encrypt(i)),b=Lt(ce([n,y])),v={address:e.address.substring(2).toLowerCase(),id:ls(d),version:3,Crypto:{cipher:"aes-128-ctr",cipherparams:{iv:fe(h).substring(2)},ciphertext:fe(y).substring(2),kdf:"scrypt",kdfparams:{salt:fe(l).substring(2),n:f,dklen:32,p:m,r:p},mac:b.substring(2)}};if(s){const e=ts(16),t=new(is().Counter)(e),r=ae(new(is().ModeOfOperation.ctr)(o,t).encrypt(s)),n=new Date,i=n.getUTCFullYear()+"-"+as(n.getUTCMonth()+1,2)+"-"+as(n.getUTCDate(),2)+"T"+as(n.getUTCHours(),2)+"-"+as(n.getUTCMinutes(),2)+"-"+as(n.getUTCSeconds(),2)+".0Z";v["x-ethers"]={client:u,gethFilename:"UTC--"+i+"--"+v.address,mnemonicCounter:fe(e).substring(2),mnemonicCiphertext:fe(r).substring(2),path:a,locale:c,version:"0.1"}}return JSON.stringify(v)}))}(this,e,t,r)}static createRandom(e){let t=ts(16);e||(e={}),e.extraEntropy&&(t=ae(me(Lt(ce([t,e.extraEntropy])),0,16)));const r=Zo(t,e.locale);return Cs.fromMnemonic(r,e.path,e.locale)}static fromEncryptedJson(e,t,r){return Ts(e,t,r).then((e=>new Cs(e)))}static fromEncryptedJsonSync(e,t){return new Cs(Ps(e,t))}static fromMnemonic(e,t,r){return t||(t=Wo),new Cs(Ko.fromMnemonic(e,null,r).derivePath(t))}}function Rs(e,t){return Ki(hn(e),t)}function Bs(e,t,r,n){return Ki(Tn.hash(e,t,r),n)}const Os=new ee("networks/5.6.2");function Ls(e){const t=function(t,r){null==r&&(r={});const n=[];if(t.InfuraProvider&&"-"!==r.infura)try{n.push(new t.InfuraProvider(e,r.infura))}catch(i){}if(t.EtherscanProvider&&"-"!==r.etherscan)try{n.push(new t.EtherscanProvider(e,r.etherscan))}catch(i){}if(t.AlchemyProvider&&"-"!==r.alchemy)try{n.push(new t.AlchemyProvider(e,r.alchemy))}catch(i){}if(t.PocketProvider&&"-"!==r.pocket){const o=["goerli","ropsten","rinkeby"];try{const i=new t.PocketProvider(e,r.pocket);i.network&&-1===o.indexOf(i.network.name)&&n.push(i)}catch(i){}}if(t.CloudflareProvider&&"-"!==r.cloudflare)try{n.push(new t.CloudflareProvider(e))}catch(i){}if(t.AnkrProvider&&"-"!==r.ankr)try{n.push(new t.AnkrProvider(e,r.ankr))}catch(i){}if(0===n.length)return null;if(t.FallbackProvider){let i=1;return null!=r.quorum?i=r.quorum:"homestead"===e&&(i=2),new t.FallbackProvider(n,i)}return n[0]};return t.renetwork=function(e){return Ls(e)},t}function zs(e,t){const r=function(r,n){return r.JsonRpcProvider?new r.JsonRpcProvider(e,t):null};return r.renetwork=function(t){return zs(e,t)},r}const Us={chainId:1,ensAddress:"0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e",name:"homestead",_defaultProvider:Ls("homestead")},_s={chainId:3,ensAddress:"0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e",name:"ropsten",_defaultProvider:Ls("ropsten")},qs={chainId:63,name:"classicMordor",_defaultProvider:zs("https://www.ethercluster.com/mordor","classicMordor")},Ds={unspecified:{chainId:0,name:"unspecified"},homestead:Us,mainnet:Us,morden:{chainId:2,name:"morden"},ropsten:_s,testnet:_s,rinkeby:{chainId:4,ensAddress:"0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e",name:"rinkeby",_defaultProvider:Ls("rinkeby")},kovan:{chainId:42,name:"kovan",_defaultProvider:Ls("kovan")},goerli:{chainId:5,ensAddress:"0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e",name:"goerli",_defaultProvider:Ls("goerli")},kintsugi:{chainId:1337702,name:"kintsugi"},classic:{chainId:61,name:"classic",_defaultProvider:zs("https://www.ethercluster.com/etc","classic")},classicMorden:{chainId:62,name:"classicMorden"},classicMordor:qs,classicTestnet:qs,classicKotti:{chainId:6,name:"classicKotti",_defaultProvider:zs("https://www.ethercluster.com/kotti","classicKotti")},xdai:{chainId:100,name:"xdai"},matic:{chainId:137,name:"matic"},maticmum:{chainId:80001,name:"maticmum"},optimism:{chainId:10,name:"optimism"},"optimism-kovan":{chainId:69,name:"optimism-kovan"},"optimism-goerli":{chainId:420,name:"optimism-goerli"},arbitrum:{chainId:42161,name:"arbitrum"},"arbitrum-rinkeby":{chainId:421611,name:"arbitrum-rinkeby"},bnb:{chainId:56,name:"bnb"},bnbt:{chainId:97,name:"bnbt"}};function Vs(e){if(null==e)return null;if("number"==typeof e){for(const t in Ds){const r=Ds[t];if(r.chainId===e)return{name:r.name,chainId:r.chainId,ensAddress:r.ensAddress||null,_defaultProvider:r._defaultProvider||null}}return{chainId:e,name:"unknown"}}if("string"==typeof e){const t=Ds[e];return null==t?null:{name:t.name,chainId:t.chainId,ensAddress:t.ensAddress,_defaultProvider:t._defaultProvider||null}}const t=Ds[e.name];if(!t)return"number"!=typeof e.chainId&&Os.throwArgumentError("invalid network chainId","network",e),e;0!==e.chainId&&e.chainId!==t.chainId&&Os.throwArgumentError("network chainId mismatch","network",e);let r=e._defaultProvider||null;var n;return null==r&&t._defaultProvider&&(r=(n=t._defaultProvider)&&"function"==typeof n.renetwork?t._defaultProvider.renetwork(e):t._defaultProvider),{name:e.name,chainId:t.chainId,ensAddress:e.ensAddress||t.ensAddress||null,_defaultProvider:r}}function js(e){e=atob(e);const t=[];for(let r=0;r<e.length;r++)t.push(e.charCodeAt(r));return ae(t)}function Fs(e){e=ae(e);let t="";for(let r=0;r<e.length;r++)t+=String.fromCharCode(e[r]);return btoa(t)}var Hs=function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{c(n.next(e))}catch(t){o(t)}}function a(e){try{c(n.throw(e))}catch(t){o(t)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}c((n=n.apply(e,t||[])).next())}))};function Ws(e,t){return Hs(this,void 0,void 0,(function*(){null==t&&(t={});const r={method:t.method||"GET",headers:t.headers||{},body:t.body||void 0};!0!==t.skipFetchSetup&&(r.mode="cors",r.cache="no-cache",r.credentials="same-origin",r.redirect="follow",r.referrer="client");const n=yield fetch(e,r),i=yield n.arrayBuffer(),o={};return n.headers.forEach?n.headers.forEach(((e,t)=>{o[t.toLowerCase()]=e})):n.headers.keys().forEach((e=>{o[e.toLowerCase()]=n.headers.get(e)})),{headers:o,statusCode:n.status,statusMessage:n.statusText,body:ae(new Uint8Array(i))}}))}var Ks=function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{c(n.next(e))}catch(t){o(t)}}function a(e){try{c(n.throw(e))}catch(t){o(t)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}c((n=n.apply(e,t||[])).next())}))};const Xs=new ee("web/5.6.0");function Gs(e){return new Promise((t=>{setTimeout(t,e)}))}function Zs(e,t){if(null==e)return null;if("string"==typeof e)return e;if(ie(e)){if(t&&("text"===t.split("/")[0]||"application/json"===t.split(";")[0].trim()))try{return Or(e)}catch(r){}return fe(e)}return e}function Js(e,t,r){const n="object"==typeof e&&null!=e.throttleLimit?e.throttleLimit:12;Xs.assertArgument(n>0&&n%1==0,"invalid connection throttle limit","connection.throttleLimit",n);const i="object"==typeof e?e.throttleCallback:null,o="object"==typeof e&&"number"==typeof e.throttleSlotInterval?e.throttleSlotInterval:100;Xs.assertArgument(o>0&&o%1==0,"invalid connection throttle slot interval","connection.throttleSlotInterval",o);const s="object"==typeof e&&!!e.errorPassThrough,a={};let c=null;const u={method:"GET"};let l=!1,h=12e4;if("string"==typeof e)c=e;else if("object"==typeof e){if(null!=e&&null!=e.url||Xs.throwArgumentError("missing URL","connection.url",e),c=e.url,"number"==typeof e.timeout&&e.timeout>0&&(h=e.timeout),e.headers)for(const t in e.headers)a[t.toLowerCase()]={key:t,value:String(e.headers[t])},["if-none-match","if-modified-since"].indexOf(t.toLowerCase())>=0&&(l=!0);if(u.allowGzip=!!e.allowGzip,null!=e.user&&null!=e.password){"https:"!==c.substring(0,6)&&!0!==e.allowInsecureAuthentication&&Xs.throwError("basic authentication requires a secure https url",ee.errors.INVALID_ARGUMENT,{argument:"url",url:c,user:e.user,password:"[REDACTED]"});const t=e.user+":"+e.password;a.authorization={key:"Authorization",value:"Basic "+Fs(Ir(t))}}null!=e.skipFetchSetup&&(u.skipFetchSetup=!!e.skipFetchSetup)}const d=new RegExp("^data:([a-z0-9-]+/[a-z0-9-]+);base64,(.*)$","i"),f=c?c.match(d):null;if(f)try{const e={statusCode:200,statusMessage:"OK",headers:{"content-type":f[1]},body:js(f[2])};let t=e.body;return r&&(t=r(e.body,e)),Promise.resolve(t)}catch(y){Xs.throwError("processing response error",ee.errors.SERVER_ERROR,{body:Zs(f[1],f[2]),error:y,requestBody:null,requestMethod:"GET",url:c})}t&&(u.method="POST",u.body=t,null==a["content-type"]&&(a["content-type"]={key:"Content-Type",value:"application/octet-stream"}),null==a["content-length"]&&(a["content-length"]={key:"Content-Length",value:String(t.length)}));const p={};Object.keys(a).forEach((e=>{const t=a[e];p[t.key]=t.value})),u.headers=p;const m=function(){let e=null;return{promise:new Promise((function(t,r){h&&(e=setTimeout((()=>{null!=e&&(e=null,r(Xs.makeError("timeout",ee.errors.TIMEOUT,{requestBody:Zs(u.body,p["content-type"]),requestMethod:u.method,timeout:h,url:c})))}),h))})),cancel:function(){null!=e&&(clearTimeout(e),e=null)}}}(),g=function(){return Ks(this,void 0,void 0,(function*(){for(let e=0;e<n;e++){let t=null;try{if(t=yield Ws(c,u),e<n)if(301===t.statusCode||302===t.statusCode){const e=t.headers.location||"";if("GET"===u.method&&e.match(/^https:/)){c=t.headers.location;continue}}else if(429===t.statusCode){let r=!0;if(i&&(r=yield i(e,c)),r){let r=0;const n=t.headers["retry-after"];r="string"==typeof n&&n.match(/^[1-9][0-9]*$/)?1e3*parseInt(n):o*parseInt(String(Math.random()*Math.pow(2,e))),yield Gs(r);continue}}}catch(y){t=y.response,null==t&&(m.cancel(),Xs.throwError("missing response",ee.errors.SERVER_ERROR,{requestBody:Zs(u.body,p["content-type"]),requestMethod:u.method,serverError:y,url:c}))}let a=t.body;if(l&&304===t.statusCode?a=null:!s&&(t.statusCode<200||t.statusCode>=300)&&(m.cancel(),Xs.throwError("bad response",ee.errors.SERVER_ERROR,{status:t.statusCode,headers:t.headers,body:Zs(a,t.headers?t.headers["content-type"]:null),requestBody:Zs(u.body,p["content-type"]),requestMethod:u.method,url:c})),r)try{const e=yield r(a,t);return m.cancel(),e}catch(y){if(y.throttleRetry&&e<n){let t=!0;if(i&&(t=yield i(e,c)),t){const t=o*parseInt(String(Math.random()*Math.pow(2,e)));yield Gs(t);continue}}m.cancel(),Xs.throwError("processing response error",ee.errors.SERVER_ERROR,{body:Zs(a,t.headers?t.headers["content-type"]:null),error:y,requestBody:Zs(u.body,p["content-type"]),requestMethod:u.method,url:c})}return m.cancel(),a}return Xs.throwError("failed response",ee.errors.SERVER_ERROR,{requestBody:Zs(u.body,p["content-type"]),requestMethod:u.method,url:c})}))}();return Promise.race([m.promise,g])}function Ys(e,t,r){let n=null;if(null!=t){n=Ir(t);const r="string"==typeof e?{url:e}:Qe(e);if(r.headers){0!==Object.keys(r.headers).filter((e=>"content-type"===e.toLowerCase())).length||(r.headers=Qe(r.headers),r.headers["content-type"]="application/json")}else r.headers={"content-type":"application/json"};e=r}return Js(e,n,((e,t)=>{let n=null;if(null!=e)try{n=JSON.parse(Or(e))}catch(i){Xs.throwError("invalid JSON",ee.errors.SERVER_ERROR,{body:e,error:i})}return r&&(n=r(n,t)),n}))}function Qs(e,t){return t||(t={}),null==(t=Qe(t)).floor&&(t.floor=0),null==t.ceiling&&(t.ceiling=1e4),null==t.interval&&(t.interval=250),new Promise((function(r,n){let i=null,o=!1;const s=()=>!o&&(o=!0,i&&clearTimeout(i),!0);t.timeout&&(i=setTimeout((()=>{s()&&n(new Error("timeout"))}),t.timeout));const a=t.retryLimit;let c=0;!function i(){return e().then((function(e){if(void 0!==e)s()&&r(e);else if(t.oncePoll)t.oncePoll.once("poll",i);else if(t.onceBlock)t.onceBlock.once("block",i);else if(!o){if(c++,c>a)return void(s()&&n(new Error("retry limit reached")));let e=t.interval*parseInt(String(Math.random()*Math.pow(2,c)));e<t.floor&&(e=t.floor),e>t.ceiling&&(e=t.ceiling),setTimeout(i,e)}return null}),(function(e){s()&&n(e)}))}()}))}var $s=r(21273),ea=r.n($s);const ta="providers/5.6.6",ra=new ee(ta);class na{constructor(){this.formats=this.getDefaultFormats()}getDefaultFormats(){const e={},t=this.address.bind(this),r=this.bigNumber.bind(this),n=this.blockTag.bind(this),i=this.data.bind(this),o=this.hash.bind(this),s=this.hex.bind(this),a=this.number.bind(this),c=this.type.bind(this);return e.transaction={hash:o,type:c,accessList:na.allowNull(this.accessList.bind(this),null),blockHash:na.allowNull(o,null),blockNumber:na.allowNull(a,null),transactionIndex:na.allowNull(a,null),confirmations:na.allowNull(a,null),from:t,gasPrice:na.allowNull(r),maxPriorityFeePerGas:na.allowNull(r),maxFeePerGas:na.allowNull(r),gasLimit:r,to:na.allowNull(t,null),value:r,nonce:a,data:i,r:na.allowNull(this.uint256),s:na.allowNull(this.uint256),v:na.allowNull(a),creates:na.allowNull(t,null),raw:na.allowNull(i)},e.transactionRequest={from:na.allowNull(t),nonce:na.allowNull(a),gasLimit:na.allowNull(r),gasPrice:na.allowNull(r),maxPriorityFeePerGas:na.allowNull(r),maxFeePerGas:na.allowNull(r),to:na.allowNull(t),value:na.allowNull(r),data:na.allowNull((e=>this.data(e,!0))),type:na.allowNull(a),accessList:na.allowNull(this.accessList.bind(this),null)},e.receiptLog={transactionIndex:a,blockNumber:a,transactionHash:o,address:t,topics:na.arrayOf(o),data:i,logIndex:a,blockHash:o},e.receipt={to:na.allowNull(this.address,null),from:na.allowNull(this.address,null),contractAddress:na.allowNull(t,null),transactionIndex:a,root:na.allowNull(s),gasUsed:r,logsBloom:na.allowNull(i),blockHash:o,transactionHash:o,logs:na.arrayOf(this.receiptLog.bind(this)),blockNumber:a,confirmations:na.allowNull(a,null),cumulativeGasUsed:r,effectiveGasPrice:na.allowNull(r),status:na.allowNull(a),type:c},e.block={hash:na.allowNull(o),parentHash:o,number:a,timestamp:a,nonce:na.allowNull(s),difficulty:this.difficulty.bind(this),gasLimit:r,gasUsed:r,miner:na.allowNull(t),extraData:i,transactions:na.allowNull(na.arrayOf(o)),baseFeePerGas:na.allowNull(r)},e.blockWithTransactions=Qe(e.block),e.blockWithTransactions.transactions=na.allowNull(na.arrayOf(this.transactionResponse.bind(this))),e.filter={fromBlock:na.allowNull(n,void 0),toBlock:na.allowNull(n,void 0),blockHash:na.allowNull(o,void 0),address:na.allowNull(t,void 0),topics:na.allowNull(this.topics.bind(this),void 0)},e.filterLog={blockNumber:na.allowNull(a),blockHash:na.allowNull(o),transactionIndex:a,removed:na.allowNull(this.boolean.bind(this)),address:t,data:na.allowFalsish(i,"0x"),topics:na.arrayOf(o),transactionHash:o,logIndex:a},e}accessList(e){return Zi(e||[])}number(e){return"0x"===e?0:Pe.from(e).toNumber()}type(e){return"0x"===e||null==e?0:Pe.from(e).toNumber()}bigNumber(e){return Pe.from(e)}boolean(e){if("boolean"==typeof e)return e;if("string"==typeof e){if("true"===(e=e.toLowerCase()))return!0;if("false"===e)return!1}throw new Error("invalid boolean - "+e)}hex(e,t){return"string"==typeof e&&(t||"0x"===e.substring(0,2)||(e="0x"+e),he(e))?e.toLowerCase():ra.throwArgumentError("invalid hash","value",e)}data(e,t){const r=this.hex(e,t);if(r.length%2!=0)throw new Error("invalid data; odd-length - "+e);return r}address(e){return Jt(e)}callAddress(e){if(!he(e,32))return null;const t=Jt(me(e,12));return t===dr?null:t}contractAddress(e){return $t(e)}blockTag(e){if(null==e)return"latest";if("earliest"===e)return"0x0";if("latest"===e||"pending"===e)return e;if("number"==typeof e||he(e))return ye(e);throw new Error("invalid blockTag")}hash(e,t){const r=this.hex(e,t);return 32!==pe(r)?ra.throwArgumentError("invalid hash","value",e):r}difficulty(e){if(null==e)return null;const t=Pe.from(e);try{return t.toNumber()}catch(r){}return null}uint256(e){if(!he(e))throw new Error("invalid uint256");return ve(e,32)}_block(e,t){null!=e.author&&null==e.miner&&(e.miner=e.author);const r=null!=e._difficulty?e._difficulty:e.difficulty,n=na.check(t,e);return n._difficulty=null==r?null:Pe.from(r),n}block(e){return this._block(e,this.formats.block)}blockWithTransactions(e){return this._block(e,this.formats.blockWithTransactions)}transactionRequest(e){return na.check(this.formats.transactionRequest,e)}transactionResponse(e){null!=e.gas&&null==e.gasLimit&&(e.gasLimit=e.gas),e.to&&Pe.from(e.to).isZero()&&(e.to="0x0000000000000000000000000000000000000000"),null!=e.input&&null==e.data&&(e.data=e.input),null==e.to&&null==e.creates&&(e.creates=this.contractAddress(e)),1!==e.type&&2!==e.type||null!=e.accessList||(e.accessList=[]);const t=na.check(this.formats.transaction,e);if(null!=e.chainId){let r=e.chainId;he(r)&&(r=Pe.from(r).toNumber()),t.chainId=r}else{let r=e.networkId;null==r&&null==t.v&&(r=e.chainId),he(r)&&(r=Pe.from(r).toNumber()),"number"!=typeof r&&null!=t.v&&(r=(t.v-35)/2,r<0&&(r=0),r=parseInt(r)),"number"!=typeof r&&(r=0),t.chainId=r}return t.blockHash&&"x"===t.blockHash.replace(/0/g,"")&&(t.blockHash=null),t}transaction(e){return to(e)}receiptLog(e){return na.check(this.formats.receiptLog,e)}receipt(e){const t=na.check(this.formats.receipt,e);if(null!=t.root)if(t.root.length<=4){const e=Pe.from(t.root).toNumber();0===e||1===e?(null!=t.status&&t.status!==e&&ra.throwArgumentError("alt-root-status/status mismatch","value",{root:t.root,status:t.status}),t.status=e,delete t.root):ra.throwArgumentError("invalid alt-root-status","value.root",t.root)}else 66!==t.root.length&&ra.throwArgumentError("invalid root hash","value.root",t.root);return null!=t.status&&(t.byzantium=!0),t}topics(e){return Array.isArray(e)?e.map((e=>this.topics(e))):null!=e?this.hash(e,!0):null}filter(e){return na.check(this.formats.filter,e)}filterLog(e){return na.check(this.formats.filterLog,e)}static check(e,t){const r={};for(const i in e)try{const n=e[i](t[i]);void 0!==n&&(r[i]=n)}catch(n){throw n.checkKey=i,n.checkValue=t[i],n}return r}static allowNull(e,t){return function(r){return null==r?t:e(r)}}static allowFalsish(e,t){return function(r){return r?e(r):t}}static arrayOf(e){return function(t){if(!Array.isArray(t))throw new Error("not an array");const r=[];return t.forEach((function(t){r.push(e(t))})),r}}}function ia(e){return e&&"function"==typeof e.isCommunityResource}function oa(e){return ia(e)&&e.isCommunityResource()}let sa=!1;function aa(){sa||(sa=!0,console.log("========= NOTICE ========="),console.log("Request-Rate Exceeded (this message will not be repeated)"),console.log(""),console.log("The default API keys for each service are provided as a highly-throttled,"),console.log("community resource for low-traffic projects and early prototyping."),console.log(""),console.log("While your application will continue to function, we highly recommended"),console.log("signing up for your own API keys to improve performance, increase your"),console.log("request rate/limit and enable other perks, such as metrics and advanced APIs."),console.log(""),console.log("For more details: https://docs.ethers.io/api-keys/"),console.log("=========================="))}var ca=function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{c(n.next(e))}catch(t){o(t)}}function a(e){try{c(n.throw(e))}catch(t){o(t)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}c((n=n.apply(e,t||[])).next())}))};const ua=new ee(ta);function la(e){return null==e?"null":(32!==pe(e)&&ua.throwArgumentError("invalid topic","topic",e),e.toLowerCase())}function ha(e){for(e=e.slice();e.length>0&&null==e[e.length-1];)e.pop();return e.map((e=>{if(Array.isArray(e)){const t={};e.forEach((e=>{t[la(e)]=!0}));const r=Object.keys(t);return r.sort(),r.join("|")}return la(e)})).join("&")}function da(e){if("string"==typeof e){if(32===pe(e=e.toLowerCase()))return"tx:"+e;if(-1===e.indexOf(":"))return e}else{if(Array.isArray(e))return"filter:*:"+ha(e);if(_n.isForkEvent(e))throw ua.warn("not implemented"),new Error("not implemented");if(e&&"object"==typeof e)return"filter:"+(e.address||"*")+":"+ha(e.topics||[])}throw new Error("invalid event - "+e)}function fa(){return(new Date).getTime()}function pa(e){return new Promise((t=>{setTimeout(t,e)}))}const ma=["block","network","pending","poll"];class ga{constructor(e,t,r){Ge(this,"tag",e),Ge(this,"listener",t),Ge(this,"once",r),this._lastBlockNumber=-2,this._inflight=!1}get event(){switch(this.type){case"tx":return this.hash;case"filter":return this.filter}return this.tag}get type(){return this.tag.split(":")[0]}get hash(){const e=this.tag.split(":");return"tx"!==e[0]?null:e[1]}get filter(){const e=this.tag.split(":");if("filter"!==e[0])return null;const t=e[1],r=function(e){return""===e?[]:e.split(/&/g).map((e=>{if(""===e)return[];const t=e.split("|").map((e=>"null"===e?null:e));return 1===t.length?t[0]:t}))}(e[2]),n={};return r.length>0&&(n.topics=r),t&&"*"!==t&&(n.address=t),n}pollable(){return this.tag.indexOf(":")>=0||ma.indexOf(this.tag)>=0}}const ya={0:{symbol:"btc",p2pkh:0,p2sh:5,prefix:"bc"},2:{symbol:"ltc",p2pkh:48,p2sh:50,prefix:"ltc"},3:{symbol:"doge",p2pkh:30,p2sh:22},60:{symbol:"eth",ilk:"eth"},61:{symbol:"etc",ilk:"eth"},700:{symbol:"xdai",ilk:"eth"}};function ba(e){return ve(Pe.from(e).toHexString(),32)}function va(e){return xo.encode(ce([e,me(Ao(Ao(e)),0,4)]))}const wa=new RegExp("^(ipfs)://(.*)$","i"),xa=[new RegExp("^(https)://(.*)$","i"),new RegExp("^(data):(.*)$","i"),wa,new RegExp("^eip155:[0-9]+/(erc[0-9]+):(.*)$","i")];function ka(e,t){try{return Or(Sa(e,t))}catch(r){}return null}function Sa(e,t){if("0x"===e)return null;const r=Pe.from(me(e,t,t+32)).toNumber(),n=Pe.from(me(e,r,r+32)).toNumber();return me(e,r+32,r+32+n)}function Ea(e){return e.match(/^ipfs:\/\/ipfs\//i)?e=e.substring(12):e.match(/^ipfs:\/\//i)?e=e.substring(7):ua.throwArgumentError("unsupported IPFS format","link",e),`https://gateway.ipfs.io/ipfs/${e}`}function Aa(e){const t=ae(e);if(t.length>32)throw new Error("internal; should not happen");const r=new Uint8Array(32);return r.set(t,32-t.length),r}function Na(e){if(e.length%32==0)return e;const t=new Uint8Array(32*Math.ceil(e.length/32));return t.set(e),t}function Ta(e){const t=[];let r=0;for(let n=0;n<e.length;n++)t.push(null),r+=32;for(let n=0;n<e.length;n++){const i=ae(e[n]);t[n]=Aa(r),t.push(Aa(i.length)),t.push(Na(i)),r+=32+32*Math.ceil(i.length/32)}return ge(t)}class Pa{constructor(e,t,r,n){Ge(this,"provider",e),Ge(this,"name",r),Ge(this,"address",e.formatter.address(t)),Ge(this,"_resolvedAddress",n)}supportsWildcard(){return this._supportsEip2544||(this._supportsEip2544=this.provider.call({to:this.address,data:"0x01ffc9a79061b92300000000000000000000000000000000000000000000000000000000"}).then((e=>Pe.from(e).eq(1))).catch((e=>{if(e.code===ee.errors.CALL_EXCEPTION)return!1;throw this._supportsEip2544=null,e}))),this._supportsEip2544}_fetch(e,t){return ca(this,void 0,void 0,(function*(){const r={to:this.address,ccipReadEnabled:!0,data:ge([e,un(this.name),t||"0x"])};let n=!1;(yield this.supportsWildcard())&&(n=!0,r.data=ge(["0x9061b923",Ta([ln(this.name),r.data])]));try{let e=yield this.provider.call(r);return ae(e).length%32==4&&ua.throwError("resolver threw error",ee.errors.CALL_EXCEPTION,{transaction:r,data:e}),n&&(e=Sa(e,0)),e}catch(i){if(i.code===ee.errors.CALL_EXCEPTION)return null;throw i}}))}_fetchBytes(e,t){return ca(this,void 0,void 0,(function*(){const r=yield this._fetch(e,t);return null!=r?Sa(r,0):null}))}_getAddress(e,t){const r=ya[String(e)];if(null==r&&ua.throwError(`unsupported coin type: ${e}`,ee.errors.UNSUPPORTED_OPERATION,{operation:`getAddress(${e})`}),"eth"===r.ilk)return this.provider.formatter.address(t);const n=ae(t);if(null!=r.p2pkh){const e=t.match(/^0x76a9([0-9a-f][0-9a-f])([0-9a-f]*)88ac$/);if(e){const t=parseInt(e[1],16);if(e[2].length===2*t&&t>=1&&t<=75)return va(ce([[r.p2pkh],"0x"+e[2]]))}}if(null!=r.p2sh){const e=t.match(/^0xa9([0-9a-f][0-9a-f])([0-9a-f]*)87$/);if(e){const t=parseInt(e[1],16);if(e[2].length===2*t&&t>=1&&t<=75)return va(ce([[r.p2sh],"0x"+e[2]]))}}if(null!=r.prefix){const e=n[1];let t=n[0];if(0===t?20!==e&&32!==e&&(t=-1):t=-1,t>=0&&n.length===2+e&&e>=1&&e<=75){const e=ea().toWords(n.slice(2));return e.unshift(t),ea().encode(r.prefix,e)}}return null}getAddress(e){return ca(this,void 0,void 0,(function*(){if(null==e&&(e=60),60===e)try{const e=yield this._fetch("0x3b3b57de");return"0x"===e||e===xr?null:this.provider.formatter.callAddress(e)}catch(n){if(n.code===ee.errors.CALL_EXCEPTION)return null;throw n}const t=yield this._fetchBytes("0xf1cb7e06",ba(e));if(null==t||"0x"===t)return null;const r=this._getAddress(e,t);return null==r&&ua.throwError("invalid or unsupported coin data",ee.errors.UNSUPPORTED_OPERATION,{operation:`getAddress(${e})`,coinType:e,data:t}),r}))}getAvatar(){return ca(this,void 0,void 0,(function*(){const e=[{type:"name",content:this.name}];try{const t=yield this.getText("avatar");if(null==t)return null;for(let r=0;r<xa.length;r++){const n=t.match(xa[r]);if(null==n)continue;const i=n[1].toLowerCase();switch(i){case"https":return e.push({type:"url",content:t}),{linkage:e,url:t};case"data":return e.push({type:"data",content:t}),{linkage:e,url:t};case"ipfs":return e.push({type:"ipfs",content:t}),{linkage:e,url:Ea(t)};case"erc721":case"erc1155":{const r="erc721"===i?"0xc87b56dd":"0x0e89341c";e.push({type:i,content:t});const o=this._resolvedAddress||(yield this.getAddress()),s=(n[2]||"").split("/");if(2!==s.length)return null;const a=yield this.provider.formatter.address(s[0]),c=ve(Pe.from(s[1]).toHexString(),32);if("erc721"===i){const t=this.provider.formatter.callAddress(yield this.provider.call({to:a,data:ge(["0x6352211e",c])}));if(o!==t)return null;e.push({type:"owner",content:t})}else if("erc1155"===i){const t=Pe.from(yield this.provider.call({to:a,data:ge(["0x00fdd58e",ve(o,32),c])}));if(t.isZero())return null;e.push({type:"balance",content:t.toString()})}const u={to:this.provider.formatter.address(s[0]),data:ge([r,c])};let l=ka(yield this.provider.call(u),0);if(null==l)return null;e.push({type:"metadata-url-base",content:l}),"erc1155"===i&&(l=l.replace("{id}",c.substring(2)),e.push({type:"metadata-url-expanded",content:l})),l.match(/^ipfs:/i)&&(l=Ea(l)),e.push({type:"metadata-url",content:l});const h=yield Ys(l);if(!h)return null;e.push({type:"metadata",content:JSON.stringify(h)});let d=h.image;if("string"!=typeof d)return null;if(d.match(/^(https:\/\/|data:)/i));else{if(null==d.match(wa))return null;e.push({type:"url-ipfs",content:d}),d=Ea(d)}return e.push({type:"url",content:d}),{linkage:e,url:d}}}}}catch(t){}return null}))}getContentHash(){return ca(this,void 0,void 0,(function*(){const e=yield this._fetchBytes("0xbc1c58d1");if(null==e||"0x"===e)return null;const t=e.match(/^0xe3010170(([0-9a-f][0-9a-f])([0-9a-f][0-9a-f])([0-9a-f]*))$/);if(t){const e=parseInt(t[3],16);if(t[4].length===2*e)return"ipfs://"+xo.encode("0x"+t[1])}const r=e.match(/^0xe5010172(([0-9a-f][0-9a-f])([0-9a-f][0-9a-f])([0-9a-f]*))$/);if(r){const e=parseInt(r[3],16);if(r[4].length===2*e)return"ipns://"+xo.encode("0x"+r[1])}const n=e.match(/^0xe40101fa011b20([0-9a-f]*)$/);return n&&64===n[1].length?"bzz://"+n[1]:ua.throwError("invalid or unsupported content hash data",ee.errors.UNSUPPORTED_OPERATION,{operation:"getContentHash()",data:e})}))}getText(e){return ca(this,void 0,void 0,(function*(){let t=Ir(e);t=ce([ba(64),ba(t.length),t]),t.length%32!=0&&(t=ce([t,ve("0x",32-e.length%32)]));const r=yield this._fetchBytes("0x59d1d43c",fe(t));return null==r||"0x"===r?null:Or(r)}))}}let Ma=null,Ia=1;class Ca extends qn{constructor(e){if(super(),this._events=[],this._emitted={block:-2},this.disableCcipRead=!1,this.formatter=new.target.getFormatter(),Ge(this,"anyNetwork","any"===e),this.anyNetwork&&(e=this.detectNetwork()),e instanceof Promise)this._networkPromise=e,e.catch((e=>{})),this._ready().catch((e=>{}));else{const t=Ze(new.target,"getNetwork")(e);t?(Ge(this,"_network",t),this.emit("network",t,null)):ua.throwArgumentError("invalid network","network",e)}this._maxInternalBlockNumber=-1024,this._lastBlockNumber=-2,this._maxFilterBlockRange=10,this._pollingInterval=4e3,this._fastQueryDate=0}_ready(){return ca(this,void 0,void 0,(function*(){if(null==this._network){let t=null;if(this._networkPromise)try{t=yield this._networkPromise}catch(e){}null==t&&(t=yield this.detectNetwork()),t||ua.throwError("no network detected",ee.errors.UNKNOWN_ERROR,{}),null==this._network&&(this.anyNetwork?this._network=t:Ge(this,"_network",t),this.emit("network",t,null))}return this._network}))}get ready(){return Qs((()=>this._ready().then((e=>e),(e=>{if(e.code!==ee.errors.NETWORK_ERROR||"noNetwork"!==e.event)throw e}))))}static getFormatter(){return null==Ma&&(Ma=new na),Ma}static getNetwork(e){return Vs(null==e?"homestead":e)}ccipReadFetch(e,t,r){return ca(this,void 0,void 0,(function*(){if(this.disableCcipRead||0===r.length)return null;const n=e.to.toLowerCase(),i=t.toLowerCase(),o=[];for(let e=0;e<r.length;e++){const t=r[e],s=t.replace("{sender}",n).replace("{data}",i),a=t.indexOf("{data}")>=0?null:JSON.stringify({data:i,sender:n}),c=yield Ys({url:s,errorPassThrough:!0},a,((e,t)=>(e.status=t.statusCode,e)));if(c.data)return c.data;const u=c.message||"unknown error";if(c.status>=400&&c.status<500)return ua.throwError(`response not found during CCIP fetch: ${u}`,ee.errors.SERVER_ERROR,{url:t,errorMessage:u});o.push(u)}return ua.throwError(`error encountered during CCIP fetch: ${o.map((e=>JSON.stringify(e))).join(", ")}`,ee.errors.SERVER_ERROR,{urls:r,errorMessages:o})}))}_getInternalBlockNumber(e){return ca(this,void 0,void 0,(function*(){if(yield this._ready(),e>0)for(;this._internalBlockNumber;){const t=this._internalBlockNumber;try{const r=yield t;if(fa()-r.respTime<=e)return r.blockNumber;break}catch(n){if(this._internalBlockNumber===t)break}}const t=fa(),r=Je({blockNumber:this.perform("getBlockNumber",{}),networkError:this.getNetwork().then((e=>null),(e=>e))}).then((({blockNumber:e,networkError:n})=>{if(n)throw this._internalBlockNumber===r&&(this._internalBlockNumber=null),n;const i=fa();return(e=Pe.from(e).toNumber())<this._maxInternalBlockNumber&&(e=this._maxInternalBlockNumber),this._maxInternalBlockNumber=e,this._setFastBlockNumber(e),{blockNumber:e,reqTime:t,respTime:i}}));return this._internalBlockNumber=r,r.catch((e=>{this._internalBlockNumber===r&&(this._internalBlockNumber=null)})),(yield r).blockNumber}))}poll(){return ca(this,void 0,void 0,(function*(){const e=Ia++,t=[];let r=null;try{r=yield this._getInternalBlockNumber(100+this.pollingInterval/2)}catch(n){return void this.emit("error",n)}if(this._setFastBlockNumber(r),this.emit("poll",e,r),r!==this._lastBlockNumber){if(-2===this._emitted.block&&(this._emitted.block=r-1),Math.abs(this._emitted.block-r)>1e3)ua.warn(`network block skew detected; skipping block events (emitted=${this._emitted.block} blockNumber${r})`),this.emit("error",ua.makeError("network block skew detected",ee.errors.NETWORK_ERROR,{blockNumber:r,event:"blockSkew",previousBlockNumber:this._emitted.block})),this.emit("block",r);else for(let e=this._emitted.block+1;e<=r;e++)this.emit("block",e);this._emitted.block!==r&&(this._emitted.block=r,Object.keys(this._emitted).forEach((e=>{if("block"===e)return;const t=this._emitted[e];"pending"!==t&&r-t>12&&delete this._emitted[e]}))),-2===this._lastBlockNumber&&(this._lastBlockNumber=r-1),this._events.forEach((e=>{switch(e.type){case"tx":{const r=e.hash;let n=this.getTransactionReceipt(r).then((e=>e&&null!=e.blockNumber?(this._emitted["t:"+r]=e.blockNumber,this.emit(r,e),null):null)).catch((e=>{this.emit("error",e)}));t.push(n);break}case"filter":if(!e._inflight){e._inflight=!0;const n=e.filter;n.fromBlock=e._lastBlockNumber+1,n.toBlock=r,n.toBlock-this._maxFilterBlockRange>n.fromBlock&&(n.fromBlock=n.toBlock-this._maxFilterBlockRange);const i=this.getLogs(n).then((t=>{e._inflight=!1,0!==t.length&&t.forEach((t=>{t.blockNumber>e._lastBlockNumber&&(e._lastBlockNumber=t.blockNumber),this._emitted["b:"+t.blockHash]=t.blockNumber,this._emitted["t:"+t.transactionHash]=t.blockNumber,this.emit(n,t)}))})).catch((t=>{this.emit("error",t),e._inflight=!1}));t.push(i)}}})),this._lastBlockNumber=r,Promise.all(t).then((()=>{this.emit("didPoll",e)})).catch((e=>{this.emit("error",e)}))}else this.emit("didPoll",e)}))}resetEventsBlock(e){this._lastBlockNumber=e-1,this.polling&&this.poll()}get network(){return this._network}detectNetwork(){return ca(this,void 0,void 0,(function*(){return ua.throwError("provider does not support network detection",ee.errors.UNSUPPORTED_OPERATION,{operation:"provider.detectNetwork"})}))}getNetwork(){return ca(this,void 0,void 0,(function*(){const e=yield this._ready(),t=yield this.detectNetwork();if(e.chainId!==t.chainId){if(this.anyNetwork)return this._network=t,this._lastBlockNumber=-2,this._fastBlockNumber=null,this._fastBlockNumberPromise=null,this._fastQueryDate=0,this._emitted.block=-2,this._maxInternalBlockNumber=-1024,this._internalBlockNumber=null,this.emit("network",t,e),yield pa(0),this._network;const r=ua.makeError("underlying network changed",ee.errors.NETWORK_ERROR,{event:"changed",network:e,detectedNetwork:t});throw this.emit("error",r),r}return e}))}get blockNumber(){return this._getInternalBlockNumber(100+this.pollingInterval/2).then((e=>{this._setFastBlockNumber(e)}),(e=>{})),null!=this._fastBlockNumber?this._fastBlockNumber:-1}get polling(){return null!=this._poller}set polling(e){e&&!this._poller?(this._poller=setInterval((()=>{this.poll()}),this.pollingInterval),this._bootstrapPoll||(this._bootstrapPoll=setTimeout((()=>{this.poll(),this._bootstrapPoll=setTimeout((()=>{this._poller||this.poll(),this._bootstrapPoll=null}),this.pollingInterval)}),0))):!e&&this._poller&&(clearInterval(this._poller),this._poller=null)}get pollingInterval(){return this._pollingInterval}set pollingInterval(e){if("number"!=typeof e||e<=0||parseInt(String(e))!=e)throw new Error("invalid polling interval");this._pollingInterval=e,this._poller&&(clearInterval(this._poller),this._poller=setInterval((()=>{this.poll()}),this._pollingInterval))}_getFastBlockNumber(){const e=fa();return e-this._fastQueryDate>2*this._pollingInterval&&(this._fastQueryDate=e,this._fastBlockNumberPromise=this.getBlockNumber().then((e=>((null==this._fastBlockNumber||e>this._fastBlockNumber)&&(this._fastBlockNumber=e),this._fastBlockNumber)))),this._fastBlockNumberPromise}_setFastBlockNumber(e){null!=this._fastBlockNumber&&e<this._fastBlockNumber||(this._fastQueryDate=fa(),(null==this._fastBlockNumber||e>this._fastBlockNumber)&&(this._fastBlockNumber=e,this._fastBlockNumberPromise=Promise.resolve(e)))}waitForTransaction(e,t,r){return ca(this,void 0,void 0,(function*(){return this._waitForTransaction(e,null==t?1:t,r||0,null)}))}_waitForTransaction(e,t,r,n){return ca(this,void 0,void 0,(function*(){const i=yield this.getTransactionReceipt(e);return(i?i.confirmations:0)>=t?i:new Promise(((i,o)=>{const s=[];let a=!1;const c=function(){return!!a||(a=!0,s.forEach((e=>{e()})),!1)},u=e=>{e.confirmations<t||c()||i(e)};if(this.on(e,u),s.push((()=>{this.removeListener(e,u)})),n){let r=n.startBlock,i=null;const u=s=>ca(this,void 0,void 0,(function*(){a||(yield pa(1e3),this.getTransactionCount(n.from).then((l=>ca(this,void 0,void 0,(function*(){if(!a){if(l<=n.nonce)r=s;else{{const t=yield this.getTransaction(e);if(t&&null!=t.blockNumber)return}for(null==i&&(i=r-3,i<n.startBlock&&(i=n.startBlock));i<=s;){if(a)return;const r=yield this.getBlockWithTransactions(i);for(let i=0;i<r.transactions.length;i++){const s=r.transactions[i];if(s.hash===e)return;if(s.from===n.from&&s.nonce===n.nonce){if(a)return;const r=yield this.waitForTransaction(s.hash,t);if(c())return;let i="replaced";return s.data===n.data&&s.to===n.to&&s.value.eq(n.value)?i="repriced":"0x"===s.data&&s.from===s.to&&s.value.isZero()&&(i="cancelled"),void o(ua.makeError("transaction was replaced",ee.errors.TRANSACTION_REPLACED,{cancelled:"replaced"===i||"cancelled"===i,reason:i,replacement:this._wrapTransaction(s),hash:e,receipt:r}))}}i++}}a||this.once("block",u)}}))),(e=>{a||this.once("block",u)})))}));if(a)return;this.once("block",u),s.push((()=>{this.removeListener("block",u)}))}if("number"==typeof r&&r>0){const e=setTimeout((()=>{c()||o(ua.makeError("timeout exceeded",ee.errors.TIMEOUT,{timeout:r}))}),r);e.unref&&e.unref(),s.push((()=>{clearTimeout(e)}))}}))}))}getBlockNumber(){return ca(this,void 0,void 0,(function*(){return this._getInternalBlockNumber(0)}))}getGasPrice(){return ca(this,void 0,void 0,(function*(){yield this.getNetwork();const e=yield this.perform("getGasPrice",{});try{return Pe.from(e)}catch(t){return ua.throwError("bad result from backend",ee.errors.SERVER_ERROR,{method:"getGasPrice",result:e,error:t})}}))}getBalance(e,t){return ca(this,void 0,void 0,(function*(){yield this.getNetwork();const r=yield Je({address:this._getAddress(e),blockTag:this._getBlockTag(t)}),n=yield this.perform("getBalance",r);try{return Pe.from(n)}catch(i){return ua.throwError("bad result from backend",ee.errors.SERVER_ERROR,{method:"getBalance",params:r,result:n,error:i})}}))}getTransactionCount(e,t){return ca(this,void 0,void 0,(function*(){yield this.getNetwork();const r=yield Je({address:this._getAddress(e),blockTag:this._getBlockTag(t)}),n=yield this.perform("getTransactionCount",r);try{return Pe.from(n).toNumber()}catch(i){return ua.throwError("bad result from backend",ee.errors.SERVER_ERROR,{method:"getTransactionCount",params:r,result:n,error:i})}}))}getCode(e,t){return ca(this,void 0,void 0,(function*(){yield this.getNetwork();const r=yield Je({address:this._getAddress(e),blockTag:this._getBlockTag(t)}),n=yield this.perform("getCode",r);try{return fe(n)}catch(i){return ua.throwError("bad result from backend",ee.errors.SERVER_ERROR,{method:"getCode",params:r,result:n,error:i})}}))}getStorageAt(e,t,r){return ca(this,void 0,void 0,(function*(){yield this.getNetwork();const n=yield Je({address:this._getAddress(e),blockTag:this._getBlockTag(r),position:Promise.resolve(t).then((e=>ye(e)))}),i=yield this.perform("getStorageAt",n);try{return fe(i)}catch(o){return ua.throwError("bad result from backend",ee.errors.SERVER_ERROR,{method:"getStorageAt",params:n,result:i,error:o})}}))}_wrapTransaction(e,t,r){if(null!=t&&32!==pe(t))throw new Error("invalid response - sendTransaction");const n=e;return null!=t&&e.hash!==t&&ua.throwError("Transaction hash mismatch from Provider.sendTransaction.",ee.errors.UNKNOWN_ERROR,{expectedHash:e.hash,returnedHash:t}),n.wait=(t,n)=>ca(this,void 0,void 0,(function*(){let i;null==t&&(t=1),null==n&&(n=0),0!==t&&null!=r&&(i={data:e.data,from:e.from,nonce:e.nonce,to:e.to,value:e.value,startBlock:r});const o=yield this._waitForTransaction(e.hash,t,n,i);return null==o&&0===t?null:(this._emitted["t:"+e.hash]=o.blockNumber,0===o.status&&ua.throwError("transaction failed",ee.errors.CALL_EXCEPTION,{transactionHash:e.hash,transaction:e,receipt:o}),o)})),n}sendTransaction(e){return ca(this,void 0,void 0,(function*(){yield this.getNetwork();const t=yield Promise.resolve(e).then((e=>fe(e))),r=this.formatter.transaction(e);null==r.confirmations&&(r.confirmations=0);const n=yield this._getInternalBlockNumber(100+2*this.pollingInterval);try{const e=yield this.perform("sendTransaction",{signedTransaction:t});return this._wrapTransaction(r,e,n)}catch(i){throw i.transaction=r,i.transactionHash=r.hash,i}}))}_getTransactionRequest(e){return ca(this,void 0,void 0,(function*(){const t=yield e,r={};return["from","to"].forEach((e=>{null!=t[e]&&(r[e]=Promise.resolve(t[e]).then((e=>e?this._getAddress(e):null)))})),["gasLimit","gasPrice","maxFeePerGas","maxPriorityFeePerGas","value"].forEach((e=>{null!=t[e]&&(r[e]=Promise.resolve(t[e]).then((e=>e?Pe.from(e):null)))})),["type"].forEach((e=>{null!=t[e]&&(r[e]=Promise.resolve(t[e]).then((e=>null!=e?e:null)))})),t.accessList&&(r.accessList=this.formatter.accessList(t.accessList)),["data"].forEach((e=>{null!=t[e]&&(r[e]=Promise.resolve(t[e]).then((e=>e?fe(e):null)))})),this.formatter.transactionRequest(yield Je(r))}))}_getFilter(e){return ca(this,void 0,void 0,(function*(){e=yield e;const t={};return null!=e.address&&(t.address=this._getAddress(e.address)),["blockHash","topics"].forEach((r=>{null!=e[r]&&(t[r]=e[r])})),["fromBlock","toBlock"].forEach((r=>{null!=e[r]&&(t[r]=this._getBlockTag(e[r]))})),this.formatter.filter(yield Je(t))}))}_call(e,t,r){return ca(this,void 0,void 0,(function*(){r>=10&&ua.throwError("CCIP read exceeded maximum redirections",ee.errors.SERVER_ERROR,{redirects:r,transaction:e});const n=e.to,i=yield this.perform("call",{transaction:e,blockTag:t});if(r>=0&&"latest"===t&&null!=n&&"0x556f1830"===i.substring(0,10)&&pe(i)%32==4)try{const o=me(i,4),s=me(o,0,32);Pe.from(s).eq(n)||ua.throwError("CCIP Read sender did not match",ee.errors.CALL_EXCEPTION,{name:"OffchainLookup",signature:"OffchainLookup(address,string[],bytes,bytes4,bytes)",transaction:e,data:i});const a=[],c=Pe.from(me(o,32,64)).toNumber(),u=Pe.from(me(o,c,c+32)).toNumber(),l=me(o,c+32);for(let t=0;t<u;t++){const r=ka(l,32*t);null==r&&ua.throwError("CCIP Read contained corrupt URL string",ee.errors.CALL_EXCEPTION,{name:"OffchainLookup",signature:"OffchainLookup(address,string[],bytes,bytes4,bytes)",transaction:e,data:i}),a.push(r)}const h=Sa(o,64);Pe.from(me(o,100,128)).isZero()||ua.throwError("CCIP Read callback selector included junk",ee.errors.CALL_EXCEPTION,{name:"OffchainLookup",signature:"OffchainLookup(address,string[],bytes,bytes4,bytes)",transaction:e,data:i});const d=me(o,96,100),f=Sa(o,128),p=yield this.ccipReadFetch(e,h,a);null==p&&ua.throwError("CCIP Read disabled or provided no URLs",ee.errors.CALL_EXCEPTION,{name:"OffchainLookup",signature:"OffchainLookup(address,string[],bytes,bytes4,bytes)",transaction:e,data:i});const m={to:n,data:ge([d,Ta([p,f])])};return this._call(m,t,r+1)}catch(o){if(o.code===ee.errors.SERVER_ERROR)throw o}try{return fe(i)}catch(o){return ua.throwError("bad result from backend",ee.errors.SERVER_ERROR,{method:"call",params:{transaction:e,blockTag:t},result:i,error:o})}}))}call(e,t){return ca(this,void 0,void 0,(function*(){yield this.getNetwork();const r=yield Je({transaction:this._getTransactionRequest(e),blockTag:this._getBlockTag(t),ccipReadEnabled:Promise.resolve(e.ccipReadEnabled)});return this._call(r.transaction,r.blockTag,r.ccipReadEnabled?0:-1)}))}estimateGas(e){return ca(this,void 0,void 0,(function*(){yield this.getNetwork();const t=yield Je({transaction:this._getTransactionRequest(e)}),r=yield this.perform("estimateGas",t);try{return Pe.from(r)}catch(n){return ua.throwError("bad result from backend",ee.errors.SERVER_ERROR,{method:"estimateGas",params:t,result:r,error:n})}}))}_getAddress(e){return ca(this,void 0,void 0,(function*(){"string"!=typeof(e=yield e)&&ua.throwArgumentError("invalid address or ENS name","name",e);const t=yield this.resolveName(e);return null==t&&ua.throwError("ENS name not configured",ee.errors.UNSUPPORTED_OPERATION,{operation:`resolveName(${JSON.stringify(e)})`}),t}))}_getBlock(e,t){return ca(this,void 0,void 0,(function*(){yield this.getNetwork(),e=yield e;let r=-128;const n={includeTransactions:!!t};if(he(e,32))n.blockHash=e;else try{n.blockTag=yield this._getBlockTag(e),he(n.blockTag)&&(r=parseInt(n.blockTag.substring(2),16))}catch(i){ua.throwArgumentError("invalid block hash or block tag","blockHashOrBlockTag",e)}return Qs((()=>ca(this,void 0,void 0,(function*(){const e=yield this.perform("getBlock",n);if(null==e)return null!=n.blockHash&&null==this._emitted["b:"+n.blockHash]||null!=n.blockTag&&r>this._emitted.block?null:void 0;if(t){let t=null;for(let n=0;n<e.transactions.length;n++){const r=e.transactions[n];if(null==r.blockNumber)r.confirmations=0;else if(null==r.confirmations){null==t&&(t=yield this._getInternalBlockNumber(100+2*this.pollingInterval));let e=t-r.blockNumber+1;e<=0&&(e=1),r.confirmations=e}}const r=this.formatter.blockWithTransactions(e);return r.transactions=r.transactions.map((e=>this._wrapTransaction(e))),r}return this.formatter.block(e)}))),{oncePoll:this})}))}getBlock(e){return this._getBlock(e,!1)}getBlockWithTransactions(e){return this._getBlock(e,!0)}getTransaction(e){return ca(this,void 0,void 0,(function*(){yield this.getNetwork(),e=yield e;const t={transactionHash:this.formatter.hash(e,!0)};return Qs((()=>ca(this,void 0,void 0,(function*(){const r=yield this.perform("getTransaction",t);if(null==r)return null==this._emitted["t:"+e]?null:void 0;const n=this.formatter.transactionResponse(r);if(null==n.blockNumber)n.confirmations=0;else if(null==n.confirmations){let e=(yield this._getInternalBlockNumber(100+2*this.pollingInterval))-n.blockNumber+1;e<=0&&(e=1),n.confirmations=e}return this._wrapTransaction(n)}))),{oncePoll:this})}))}getTransactionReceipt(e){return ca(this,void 0,void 0,(function*(){yield this.getNetwork(),e=yield e;const t={transactionHash:this.formatter.hash(e,!0)};return Qs((()=>ca(this,void 0,void 0,(function*(){const r=yield this.perform("getTransactionReceipt",t);if(null==r)return null==this._emitted["t:"+e]?null:void 0;if(null==r.blockHash)return;const n=this.formatter.receipt(r);if(null==n.blockNumber)n.confirmations=0;else if(null==n.confirmations){let e=(yield this._getInternalBlockNumber(100+2*this.pollingInterval))-n.blockNumber+1;e<=0&&(e=1),n.confirmations=e}return n}))),{oncePoll:this})}))}getLogs(e){return ca(this,void 0,void 0,(function*(){yield this.getNetwork();const t=yield Je({filter:this._getFilter(e)}),r=yield this.perform("getLogs",t);return r.forEach((e=>{null==e.removed&&(e.removed=!1)})),na.arrayOf(this.formatter.filterLog.bind(this.formatter))(r)}))}getEtherPrice(){return ca(this,void 0,void 0,(function*(){return yield this.getNetwork(),this.perform("getEtherPrice",{})}))}_getBlockTag(e){return ca(this,void 0,void 0,(function*(){if("number"==typeof(e=yield e)&&e<0){e%1&&ua.throwArgumentError("invalid BlockTag","blockTag",e);let t=yield this._getInternalBlockNumber(100+2*this.pollingInterval);return t+=e,t<0&&(t=0),this.formatter.blockTag(t)}return this.formatter.blockTag(e)}))}getResolver(e){return ca(this,void 0,void 0,(function*(){let t=e;for(;;){if(""===t||"."===t)return null;if("eth"!==e&&"eth"===t)return null;const r=yield this._getResolver(t,"getResolver");if(null!=r){const n=new Pa(this,r,e);return t===e||(yield n.supportsWildcard())?n:null}t=t.split(".").slice(1).join(".")}}))}_getResolver(e,t){return ca(this,void 0,void 0,(function*(){null==t&&(t="ENS");const r=yield this.getNetwork();r.ensAddress||ua.throwError("network does not support ENS",ee.errors.UNSUPPORTED_OPERATION,{operation:t,network:r.name});try{const t=yield this.call({to:r.ensAddress,data:"0x0178b8bf"+un(e).substring(2)});return this.formatter.callAddress(t)}catch(n){}return null}))}resolveName(e){return ca(this,void 0,void 0,(function*(){e=yield e;try{return Promise.resolve(this.formatter.address(e))}catch(r){if(he(e))throw r}"string"!=typeof e&&ua.throwArgumentError("invalid ENS name","name",e);const t=yield this.getResolver(e);return t?yield t.getAddress():null}))}lookupAddress(e){return ca(this,void 0,void 0,(function*(){e=yield e;const t=(e=this.formatter.address(e)).substring(2).toLowerCase()+".addr.reverse",r=yield this._getResolver(t,"lookupAddress");if(null==r)return null;const n=ka(yield this.call({to:r,data:"0x691f3431"+un(t).substring(2)}),0);return(yield this.resolveName(n))!=e?null:n}))}getAvatar(e){return ca(this,void 0,void 0,(function*(){let t=null;if(he(e)){const r=this.formatter.address(e).substring(2).toLowerCase()+".addr.reverse",i=yield this._getResolver(r,"getAvatar");if(!i)return null;t=new Pa(this,i,r);try{const e=yield t.getAvatar();if(e)return e.url}catch(n){if(n.code!==ee.errors.CALL_EXCEPTION)throw n}try{const e=ka(yield this.call({to:i,data:"0x691f3431"+un(r).substring(2)}),0);t=yield this.getResolver(e)}catch(n){if(n.code!==ee.errors.CALL_EXCEPTION)throw n;return null}}else if(t=yield this.getResolver(e),!t)return null;const r=yield t.getAvatar();return null==r?null:r.url}))}perform(e,t){return ua.throwError(e+" not implemented",ee.errors.NOT_IMPLEMENTED,{operation:e})}_startEvent(e){this.polling=this._events.filter((e=>e.pollable())).length>0}_stopEvent(e){this.polling=this._events.filter((e=>e.pollable())).length>0}_addEventListener(e,t,r){const n=new ga(da(e),t,r);return this._events.push(n),this._startEvent(n),this}on(e,t){return this._addEventListener(e,t,!1)}once(e,t){return this._addEventListener(e,t,!0)}emit(e,...t){let r=!1,n=[],i=da(e);return this._events=this._events.filter((e=>e.tag!==i||(setTimeout((()=>{e.listener.apply(this,t)}),0),r=!0,!e.once||(n.push(e),!1)))),n.forEach((e=>{this._stopEvent(e)})),r}listenerCount(e){if(!e)return this._events.length;let t=da(e);return this._events.filter((e=>e.tag===t)).length}listeners(e){if(null==e)return this._events.map((e=>e.listener));let t=da(e);return this._events.filter((e=>e.tag===t)).map((e=>e.listener))}off(e,t){if(null==t)return this.removeAllListeners(e);const r=[];let n=!1,i=da(e);return this._events=this._events.filter((e=>e.tag!==i||e.listener!=t||(!!n||(n=!0,r.push(e),!1)))),r.forEach((e=>{this._stopEvent(e)})),this}removeAllListeners(e){let t=[];if(null==e)t=this._events,this._events=[];else{const r=da(e);this._events=this._events.filter((e=>e.tag!==r||(t.push(e),!1)))}return t.forEach((e=>{this._stopEvent(e)})),this}}var Ra=function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{c(n.next(e))}catch(t){o(t)}}function a(e){try{c(n.throw(e))}catch(t){o(t)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}c((n=n.apply(e,t||[])).next())}))};const Ba=new ee(ta),Oa=["call","estimateGas"];function La(e,t){if(null==e)return null;if("string"==typeof e.message&&e.message.match("reverted")){const r=he(e.data)?e.data:null;if(!t||r)return{message:e.message,data:r}}if("object"==typeof e){for(const r in e){const n=La(e[r],t);if(n)return n}return null}if("string"==typeof e)try{return La(JSON.parse(e),t)}catch(r){}return null}function za(e,t,r){const n=r.transaction||r.signedTransaction;if("call"===e){const e=La(t,!0);if(e)return e.data;Ba.throwError("missing revert data in call exception; Transaction reverted without a reason string",ee.errors.CALL_EXCEPTION,{data:"0x",transaction:n,error:t})}if("estimateGas"===e){let r=La(t.body,!1);null==r&&(r=La(t,!1)),r&&Ba.throwError("cannot estimate gas; transaction may fail or may require manual gas limit",ee.errors.UNPREDICTABLE_GAS_LIMIT,{reason:r.message,method:e,transaction:n,error:t})}let i=t.message;throw t.code===ee.errors.SERVER_ERROR&&t.error&&"string"==typeof t.error.message?i=t.error.message:"string"==typeof t.body?i=t.body:"string"==typeof t.responseText&&(i=t.responseText),i=(i||"").toLowerCase(),i.match(/insufficient funds|base fee exceeds gas limit/i)&&Ba.throwError("insufficient funds for intrinsic transaction cost",ee.errors.INSUFFICIENT_FUNDS,{error:t,method:e,transaction:n}),i.match(/nonce (is )?too low/i)&&Ba.throwError("nonce has already been used",ee.errors.NONCE_EXPIRED,{error:t,method:e,transaction:n}),i.match(/replacement transaction underpriced|transaction gas price.*too low/i)&&Ba.throwError("replacement fee too low",ee.errors.REPLACEMENT_UNDERPRICED,{error:t,method:e,transaction:n}),i.match(/only replay-protected/i)&&Ba.throwError("legacy pre-eip-155 transactions not supported",ee.errors.UNSUPPORTED_OPERATION,{error:t,method:e,transaction:n}),Oa.indexOf(e)>=0&&i.match(/gas required exceeds allowance|always failing transaction|execution reverted/)&&Ba.throwError("cannot estimate gas; transaction may fail or may require manual gas limit",ee.errors.UNPREDICTABLE_GAS_LIMIT,{error:t,method:e,transaction:n}),t}function Ua(e){return new Promise((function(t){setTimeout(t,e)}))}function _a(e){if(e.error){const t=new Error(e.error.message);throw t.code=e.error.code,t.data=e.error.data,t}return e.result}function qa(e){return e?e.toLowerCase():e}const Da={};class Va extends Hn{constructor(e,t,r){if(super(),e!==Da)throw new Error("do not call the JsonRpcSigner constructor directly; use provider.getSigner");Ge(this,"provider",t),null==r&&(r=0),"string"==typeof r?(Ge(this,"_address",this.provider.formatter.address(r)),Ge(this,"_index",null)):"number"==typeof r?(Ge(this,"_index",r),Ge(this,"_address",null)):Ba.throwArgumentError("invalid address or index","addressOrIndex",r)}connect(e){return Ba.throwError("cannot alter JSON-RPC Signer connection",ee.errors.UNSUPPORTED_OPERATION,{operation:"connect"})}connectUnchecked(){return new ja(Da,this.provider,this._address||this._index)}getAddress(){return this._address?Promise.resolve(this._address):this.provider.send("eth_accounts",[]).then((e=>(e.length<=this._index&&Ba.throwError("unknown account #"+this._index,ee.errors.UNSUPPORTED_OPERATION,{operation:"getAddress"}),this.provider.formatter.address(e[this._index]))))}sendUncheckedTransaction(e){e=Qe(e);const t=this.getAddress().then((e=>(e&&(e=e.toLowerCase()),e)));if(null==e.gasLimit){const r=Qe(e);r.from=t,e.gasLimit=this.provider.estimateGas(r)}return null!=e.to&&(e.to=Promise.resolve(e.to).then((e=>Ra(this,void 0,void 0,(function*(){if(null==e)return null;const t=yield this.provider.resolveName(e);return null==t&&Ba.throwArgumentError("provided ENS name resolves to null","tx.to",e),t}))))),Je({tx:Je(e),sender:t}).then((({tx:t,sender:r})=>{null!=t.from?t.from.toLowerCase()!==r&&Ba.throwArgumentError("from address mismatch","transaction",e):t.from=r;const n=this.provider.constructor.hexlifyTransaction(t,{from:!0});return this.provider.send("eth_sendTransaction",[n]).then((e=>e),(e=>za("sendTransaction",e,n)))}))}signTransaction(e){return Ba.throwError("signing transactions is unsupported",ee.errors.UNSUPPORTED_OPERATION,{operation:"signTransaction"})}sendTransaction(e){return Ra(this,void 0,void 0,(function*(){const t=yield this.provider._getInternalBlockNumber(100+2*this.provider.pollingInterval),r=yield this.sendUncheckedTransaction(e);try{return yield Qs((()=>Ra(this,void 0,void 0,(function*(){const e=yield this.provider.getTransaction(r);if(null!==e)return this.provider._wrapTransaction(e,r,t)}))),{oncePoll:this.provider})}catch(n){throw n.transactionHash=r,n}}))}signMessage(e){return Ra(this,void 0,void 0,(function*(){const t="string"==typeof e?Ir(e):e,r=yield this.getAddress();return yield this.provider.send("personal_sign",[fe(t),r.toLowerCase()])}))}_legacySignMessage(e){return Ra(this,void 0,void 0,(function*(){const t="string"==typeof e?Ir(e):e,r=yield this.getAddress();return yield this.provider.send("eth_sign",[r.toLowerCase(),fe(t)])}))}_signTypedData(e,t,r){return Ra(this,void 0,void 0,(function*(){const n=yield Tn.resolveNames(e,t,r,(e=>this.provider.resolveName(e))),i=yield this.getAddress();return yield this.provider.send("eth_signTypedData_v4",[i.toLowerCase(),JSON.stringify(Tn.getPayload(n.domain,t,n.value))])}))}unlock(e){return Ra(this,void 0,void 0,(function*(){const t=this.provider,r=yield this.getAddress();return t.send("personal_unlockAccount",[r.toLowerCase(),e,null])}))}}class ja extends Va{sendTransaction(e){return this.sendUncheckedTransaction(e).then((e=>({hash:e,nonce:null,gasLimit:null,gasPrice:null,data:null,value:null,chainId:null,confirmations:0,from:null,wait:t=>this.provider.waitForTransaction(e,t)})))}}const Fa={chainId:!0,data:!0,gasLimit:!0,gasPrice:!0,nonce:!0,to:!0,value:!0,type:!0,accessList:!0,maxFeePerGas:!0,maxPriorityFeePerGas:!0};class Ha extends Ca{constructor(e,t){let r=t;null==r&&(r=new Promise(((e,t)=>{setTimeout((()=>{this.detectNetwork().then((t=>{e(t)}),(e=>{t(e)}))}),0)}))),super(r),e||(e=Ze(this.constructor,"defaultUrl")()),Ge(this,"connection","string"==typeof e?Object.freeze({url:e}):Object.freeze(Qe(e))),this._nextId=42}get _cache(){return null==this._eventLoopCache&&(this._eventLoopCache={}),this._eventLoopCache}static defaultUrl(){return"http://localhost:8545"}detectNetwork(){return this._cache.detectNetwork||(this._cache.detectNetwork=this._uncachedDetectNetwork(),setTimeout((()=>{this._cache.detectNetwork=null}),0)),this._cache.detectNetwork}_uncachedDetectNetwork(){return Ra(this,void 0,void 0,(function*(){yield Ua(0);let e=null;try{e=yield this.send("eth_chainId",[])}catch(t){try{e=yield this.send("net_version",[])}catch(t){}}if(null!=e){const r=Ze(this.constructor,"getNetwork");try{return r(Pe.from(e).toNumber())}catch(t){return Ba.throwError("could not detect network",ee.errors.NETWORK_ERROR,{chainId:e,event:"invalidNetwork",serverError:t})}}return Ba.throwError("could not detect network",ee.errors.NETWORK_ERROR,{event:"noNetwork"})}))}getSigner(e){return new Va(Da,this,e)}getUncheckedSigner(e){return this.getSigner(e).connectUnchecked()}listAccounts(){return this.send("eth_accounts",[]).then((e=>e.map((e=>this.formatter.address(e)))))}send(e,t){const r={method:e,params:t,id:this._nextId++,jsonrpc:"2.0"};this.emit("debug",{action:"request",request:rt(r),provider:this});const n=["eth_chainId","eth_blockNumber"].indexOf(e)>=0;if(n&&this._cache[e])return this._cache[e];const i=Ys(this.connection,JSON.stringify(r),_a).then((e=>(this.emit("debug",{action:"response",request:r,response:e,provider:this}),e)),(e=>{throw this.emit("debug",{action:"response",error:e,request:r,provider:this}),e}));return n&&(this._cache[e]=i,setTimeout((()=>{this._cache[e]=null}),0)),i}prepareRequest(e,t){switch(e){case"getBlockNumber":return["eth_blockNumber",[]];case"getGasPrice":return["eth_gasPrice",[]];case"getBalance":return["eth_getBalance",[qa(t.address),t.blockTag]];case"getTransactionCount":return["eth_getTransactionCount",[qa(t.address),t.blockTag]];case"getCode":return["eth_getCode",[qa(t.address),t.blockTag]];case"getStorageAt":return["eth_getStorageAt",[qa(t.address),t.position,t.blockTag]];case"sendTransaction":return["eth_sendRawTransaction",[t.signedTransaction]];case"getBlock":return t.blockTag?["eth_getBlockByNumber",[t.blockTag,!!t.includeTransactions]]:t.blockHash?["eth_getBlockByHash",[t.blockHash,!!t.includeTransactions]]:null;case"getTransaction":return["eth_getTransactionByHash",[t.transactionHash]];case"getTransactionReceipt":return["eth_getTransactionReceipt",[t.transactionHash]];case"call":return["eth_call",[Ze(this.constructor,"hexlifyTransaction")(t.transaction,{from:!0}),t.blockTag]];case"estimateGas":return["eth_estimateGas",[Ze(this.constructor,"hexlifyTransaction")(t.transaction,{from:!0})]];case"getLogs":return t.filter&&null!=t.filter.address&&(t.filter.address=qa(t.filter.address)),["eth_getLogs",[t.filter]]}return null}perform(e,t){return Ra(this,void 0,void 0,(function*(){if("call"===e||"estimateGas"===e){const e=t.transaction;if(e&&null!=e.type&&Pe.from(e.type).isZero()&&null==e.maxFeePerGas&&null==e.maxPriorityFeePerGas){const r=yield this.getFeeData();null==r.maxFeePerGas&&null==r.maxPriorityFeePerGas&&((t=Qe(t)).transaction=Qe(e),delete t.transaction.type)}}const r=this.prepareRequest(e,t);null==r&&Ba.throwError(e+" not implemented",ee.errors.NOT_IMPLEMENTED,{operation:e});try{return yield this.send(r[0],r[1])}catch(n){return za(e,n,t)}}))}_startEvent(e){"pending"===e.tag&&this._startPending(),super._startEvent(e)}_startPending(){if(null!=this._pendingFilter)return;const e=this,t=this.send("eth_newPendingTransactionFilter",[]);this._pendingFilter=t,t.then((function(r){return function n(){e.send("eth_getFilterChanges",[r]).then((function(r){if(e._pendingFilter!=t)return null;let n=Promise.resolve();return r.forEach((function(t){e._emitted["t:"+t.toLowerCase()]="pending",n=n.then((function(){return e.getTransaction(t).then((function(t){return e.emit("pending",t),null}))}))})),n.then((function(){return Ua(1e3)}))})).then((function(){if(e._pendingFilter==t)return setTimeout((function(){n()}),0),null;e.send("eth_uninstallFilter",[r])})).catch((e=>{}))}(),r})).catch((e=>{}))}_stopEvent(e){"pending"===e.tag&&0===this.listenerCount("pending")&&(this._pendingFilter=null),super._stopEvent(e)}static hexlifyTransaction(e,t){const r=Qe(Fa);if(t)for(const i in t)t[i]&&(r[i]=!0);Ye(e,r);const n={};return["chainId","gasLimit","gasPrice","type","maxFeePerGas","maxPriorityFeePerGas","nonce","value"].forEach((function(t){if(null==e[t])return;const r=ye(Pe.from(e[t]));"gasLimit"===t&&(t="gas"),n[t]=r})),["from","to","data"].forEach((function(t){null!=e[t]&&(n[t]=fe(e[t]))})),e.accessList&&(n.accessList=Zi(e.accessList)),n}}let Wa=null;try{if(Wa=WebSocket,null==Wa)throw new Error("inject please")}catch(h2){const e=new ee(ta);Wa=function(){e.throwError("WebSockets not supported in this environment",ee.errors.UNSUPPORTED_OPERATION,{operation:"new WebSocket()"})}}var Ka=function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{c(n.next(e))}catch(t){o(t)}}function a(e){try{c(n.throw(e))}catch(t){o(t)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}c((n=n.apply(e,t||[])).next())}))};const Xa=new ee(ta);let Ga=1;class Za extends Ha{constructor(e,t){"any"===t&&Xa.throwError("WebSocketProvider does not support 'any' network yet",ee.errors.UNSUPPORTED_OPERATION,{operation:"network:any"}),super("string"==typeof e?e:"_websocket",t),this._pollingInterval=-1,this._wsReady=!1,Ge(this,"_websocket","string"==typeof e?new Wa(this.connection.url):e),Ge(this,"_requests",{}),Ge(this,"_subs",{}),Ge(this,"_subIds",{}),Ge(this,"_detectNetwork",super.detectNetwork()),this.websocket.onopen=()=>{this._wsReady=!0,Object.keys(this._requests).forEach((e=>{this.websocket.send(this._requests[e].payload)}))},this.websocket.onmessage=e=>{const t=e.data,r=JSON.parse(t);if(null!=r.id){const e=String(r.id),n=this._requests[e];if(delete this._requests[e],void 0!==r.result)n.callback(null,r.result),this.emit("debug",{action:"response",request:JSON.parse(n.payload),response:r.result,provider:this});else{let e=null;r.error?(e=new Error(r.error.message||"unknown error"),Ge(e,"code",r.error.code||null),Ge(e,"response",t)):e=new Error("unknown error"),n.callback(e,void 0),this.emit("debug",{action:"response",error:e,request:JSON.parse(n.payload),provider:this})}}else if("eth_subscription"===r.method){const e=this._subs[r.params.subscription];e&&e.processFunc(r.params.result)}else console.warn("this should not happen")};const r=setInterval((()=>{this.emit("poll")}),1e3);r.unref&&r.unref()}get websocket(){return this._websocket}detectNetwork(){return this._detectNetwork}get pollingInterval(){return 0}resetEventsBlock(e){Xa.throwError("cannot reset events block on WebSocketProvider",ee.errors.UNSUPPORTED_OPERATION,{operation:"resetEventBlock"})}set pollingInterval(e){Xa.throwError("cannot set polling interval on WebSocketProvider",ee.errors.UNSUPPORTED_OPERATION,{operation:"setPollingInterval"})}poll(){return Ka(this,void 0,void 0,(function*(){return null}))}set polling(e){e&&Xa.throwError("cannot set polling on WebSocketProvider",ee.errors.UNSUPPORTED_OPERATION,{operation:"setPolling"})}send(e,t){const r=Ga++;return new Promise(((n,i)=>{const o=JSON.stringify({method:e,params:t,id:r,jsonrpc:"2.0"});this.emit("debug",{action:"request",request:JSON.parse(o),provider:this}),this._requests[String(r)]={callback:function(e,t){return e?i(e):n(t)},payload:o},this._wsReady&&this.websocket.send(o)}))}static defaultUrl(){return"ws://localhost:8546"}_subscribe(e,t,r){return Ka(this,void 0,void 0,(function*(){let n=this._subIds[e];null==n&&(n=Promise.all(t).then((e=>this.send("eth_subscribe",e))),this._subIds[e]=n);const i=yield n;this._subs[i]={tag:e,processFunc:r}}))}_startEvent(e){switch(e.type){case"block":this._subscribe("block",["newHeads"],(e=>{const t=Pe.from(e.number).toNumber();this._emitted.block=t,this.emit("block",t)}));break;case"pending":this._subscribe("pending",["newPendingTransactions"],(e=>{this.emit("pending",e)}));break;case"filter":this._subscribe(e.tag,["logs",this._getFilter(e.filter)],(t=>{null==t.removed&&(t.removed=!1),this.emit(e.filter,this.formatter.filterLog(t))}));break;case"tx":{const t=e=>{const t=e.hash;this.getTransactionReceipt(t).then((e=>{e&&this.emit(t,e)}))};t(e),this._subscribe("tx",["newHeads"],(e=>{this._events.filter((e=>"tx"===e.type)).forEach(t)}));break}case"debug":case"poll":case"willPoll":case"didPoll":case"error":break;default:console.log("unhandled:",e)}}_stopEvent(e){let t=e.tag;if("tx"===e.type){if(this._events.filter((e=>"tx"===e.type)).length)return;t="tx"}else if(this.listenerCount(e.event))return;const r=this._subIds[t];r&&(delete this._subIds[t],r.then((e=>{this._subs[e]&&(delete this._subs[e],this.send("eth_unsubscribe",[e]))})))}destroy(){return Ka(this,void 0,void 0,(function*(){this.websocket.readyState===Wa.CONNECTING&&(yield new Promise((e=>{this.websocket.onopen=function(){e(!0)},this.websocket.onerror=function(){e(!1)}}))),this.websocket.close(1e3)}))}}var Ja=function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{c(n.next(e))}catch(t){o(t)}}function a(e){try{c(n.throw(e))}catch(t){o(t)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}c((n=n.apply(e,t||[])).next())}))};const Ya=new ee(ta);class Qa extends Ha{detectNetwork(){const e=Object.create(null,{detectNetwork:{get:()=>super.detectNetwork}});return Ja(this,void 0,void 0,(function*(){let t=this.network;return null==t&&(t=yield e.detectNetwork.call(this),t||Ya.throwError("no network detected",ee.errors.UNKNOWN_ERROR,{}),null==this._network&&(Ge(this,"_network",t),this.emit("network",t,null))),t}))}}class $a extends Qa{constructor(e,t){Ya.checkAbstract(new.target,$a),e=Ze(new.target,"getNetwork")(e),t=Ze(new.target,"getApiKey")(t);super(Ze(new.target,"getUrl")(e,t),e),"string"==typeof t?Ge(this,"apiKey",t):null!=t&&Object.keys(t).forEach((e=>{Ge(this,e,t[e])}))}_startPending(){Ya.warn("WARNING: API provider does not support pending filters")}isCommunityResource(){return!1}getSigner(e){return Ya.throwError("API provider does not support signing",ee.errors.UNSUPPORTED_OPERATION,{operation:"getSigner"})}listAccounts(){return Promise.resolve([])}static getApiKey(e){return e}static getUrl(e,t){return Ya.throwError("not implemented; sub-classes must override getUrl",ee.errors.NOT_IMPLEMENTED,{operation:"getUrl"})}}const ec=new ee(ta),tc="_gg7wSSi0KMBsdKnGVfHDueq6xMB9EkC";class rc extends Za{constructor(e,t){const r=new nc(e,t);super(r.connection.url.replace(/^http/i,"ws").replace(".alchemyapi.",".ws.alchemyapi."),r.network),Ge(this,"apiKey",r.apiKey)}isCommunityResource(){return this.apiKey===tc}}class nc extends $a{static getWebSocketProvider(e,t){return new rc(e,t)}static getApiKey(e){return null==e?tc:(e&&"string"!=typeof e&&ec.throwArgumentError("invalid apiKey","apiKey",e),e)}static getUrl(e,t){let r=null;switch(e.name){case"homestead":r="eth-mainnet.alchemyapi.io/v2/";break;case"ropsten":r="eth-ropsten.alchemyapi.io/v2/";break;case"rinkeby":r="eth-rinkeby.alchemyapi.io/v2/";break;case"goerli":r="eth-goerli.alchemyapi.io/v2/";break;case"kovan":r="eth-kovan.alchemyapi.io/v2/";break;case"matic":r="polygon-mainnet.g.alchemy.com/v2/";break;case"maticmum":r="polygon-mumbai.g.alchemy.com/v2/";break;case"arbitrum":r="arb-mainnet.g.alchemy.com/v2/";break;case"arbitrum-rinkeby":r="arb-rinkeby.g.alchemy.com/v2/";break;case"optimism":r="opt-mainnet.g.alchemy.com/v2/";break;case"optimism-kovan":r="opt-kovan.g.alchemy.com/v2/";break;default:ec.throwArgumentError("unsupported network","network",arguments[0])}return{allowGzip:!0,url:"https://"+r+t,throttleCallback:(e,r)=>(t===tc&&aa(),Promise.resolve(!0))}}isCommunityResource(){return this.apiKey===tc}}const ic=new ee(ta),oc="9f7d929b018cdffb338517efa06f58359e86ff1ffd350bc889738523659e7972";function sc(e){switch(e){case"homestead":return"rpc.ankr.com/eth/";case"ropsten":return"rpc.ankr.com/eth_ropsten/";case"rinkeby":return"rpc.ankr.com/eth_rinkeby/";case"goerli":return"rpc.ankr.com/eth_goerli/";case"matic":return"rpc.ankr.com/polygon/";case"arbitrum":return"rpc.ankr.com/arbitrum/"}return ic.throwArgumentError("unsupported network","name",e)}class ac extends $a{isCommunityResource(){return this.apiKey===oc}static getApiKey(e){return null==e?oc:e}static getUrl(e,t){null==t&&(t=oc);const r={allowGzip:!0,url:"https://"+sc(e.name)+t,throttleCallback:(e,r)=>(t.apiKey===oc&&aa(),Promise.resolve(!0))};return null!=t.projectSecret&&(r.user="",r.password=t.projectSecret),r}}var cc=function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{c(n.next(e))}catch(t){o(t)}}function a(e){try{c(n.throw(e))}catch(t){o(t)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}c((n=n.apply(e,t||[])).next())}))};const uc=new ee(ta);class lc extends $a{static getApiKey(e){return null!=e&&uc.throwArgumentError("apiKey not supported for cloudflare","apiKey",e),null}static getUrl(e,t){let r=null;if("homestead"===e.name)r="https://cloudflare-eth.com/";else uc.throwArgumentError("unsupported network","network",arguments[0]);return r}perform(e,t){const r=Object.create(null,{perform:{get:()=>super.perform}});return cc(this,void 0,void 0,(function*(){if("getBlockNumber"===e){return(yield r.perform.call(this,"getBlock",{blockTag:"latest"})).number}return r.perform.call(this,e,t)}))}}var hc=function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{c(n.next(e))}catch(t){o(t)}}function a(e){try{c(n.throw(e))}catch(t){o(t)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}c((n=n.apply(e,t||[])).next())}))};const dc=new ee(ta);function fc(e){const t={};for(let r in e){if(null==e[r])continue;let n=e[r];"type"===r&&0===n||(n={type:!0,gasLimit:!0,gasPrice:!0,maxFeePerGs:!0,maxPriorityFeePerGas:!0,nonce:!0,value:!0}[r]?ye(fe(n)):"accessList"===r?"["+Zi(n).map((e=>`{address:"${e.address}",storageKeys:["${e.storageKeys.join('","')}"]}`)).join(",")+"]":fe(n),t[r]=n)}return t}function pc(e){if(0==e.status&&("No records found"===e.message||"No transactions found"===e.message))return e.result;if(1!=e.status||"OK"!=e.message){const t=new Error("invalid response");throw t.result=JSON.stringify(e),(e.result||"").toLowerCase().indexOf("rate limit")>=0&&(t.throttleRetry=!0),t}return e.result}function mc(e){if(e&&0==e.status&&"NOTOK"==e.message&&(e.result||"").toLowerCase().indexOf("rate limit")>=0){const t=new Error("throttled response");throw t.result=JSON.stringify(e),t.throttleRetry=!0,t}if("2.0"!=e.jsonrpc){const t=new Error("invalid response");throw t.result=JSON.stringify(e),t}if(e.error){const t=new Error(e.error.message||"unknown error");throw e.error.code&&(t.code=e.error.code),e.error.data&&(t.data=e.error.data),t}return e.result}function gc(e){if("pending"===e)throw new Error("pending not supported");return"latest"===e?e:parseInt(e.substring(2),16)}const yc="9D13ZE7XSBTJ94N9BNJ2MA33VMAY2YPIRB";function bc(e,t,r){if("call"===e&&t.code===ee.errors.SERVER_ERROR){const e=t.error;if(e&&(e.message.match(/reverted/i)||e.message.match(/VM execution error/i))){let r=e.data;if(r&&(r="0x"+r.replace(/^.*0x/i,"")),he(r))return r;dc.throwError("missing revert data in call exception",ee.errors.CALL_EXCEPTION,{error:t,data:"0x"})}}let n=t.message;throw t.code===ee.errors.SERVER_ERROR&&(t.error&&"string"==typeof t.error.message?n=t.error.message:"string"==typeof t.body?n=t.body:"string"==typeof t.responseText&&(n=t.responseText)),n=(n||"").toLowerCase(),n.match(/insufficient funds/)&&dc.throwError("insufficient funds for intrinsic transaction cost",ee.errors.INSUFFICIENT_FUNDS,{error:t,method:e,transaction:r}),n.match(/same hash was already imported|transaction nonce is too low|nonce too low/)&&dc.throwError("nonce has already been used",ee.errors.NONCE_EXPIRED,{error:t,method:e,transaction:r}),n.match(/another transaction with same nonce/)&&dc.throwError("replacement fee too low",ee.errors.REPLACEMENT_UNDERPRICED,{error:t,method:e,transaction:r}),n.match(/execution failed due to an exception|execution reverted/)&&dc.throwError("cannot estimate gas; transaction may fail or may require manual gas limit",ee.errors.UNPREDICTABLE_GAS_LIMIT,{error:t,method:e,transaction:r}),t}class vc extends Ca{constructor(e,t){super(e),Ge(this,"baseUrl",this.getBaseUrl()),Ge(this,"apiKey",t||yc)}getBaseUrl(){switch(this.network?this.network.name:"invalid"){case"homestead":return"https://api.etherscan.io";case"ropsten":return"https://api-ropsten.etherscan.io";case"rinkeby":return"https://api-rinkeby.etherscan.io";case"kovan":return"https://api-kovan.etherscan.io";case"goerli":return"https://api-goerli.etherscan.io";case"optimism":return"https://api-optimistic.etherscan.io"}return dc.throwArgumentError("unsupported network","network",this.network.name)}getUrl(e,t){const r=Object.keys(t).reduce(((e,r)=>{const n=t[r];return null!=n&&(e+=`&${r}=${n}`),e}),""),n=this.apiKey?`&apikey=${this.apiKey}`:"";return`${this.baseUrl}/api?module=${e}${r}${n}`}getPostUrl(){return`${this.baseUrl}/api`}getPostData(e,t){return t.module=e,t.apikey=this.apiKey,t}fetch(e,t,r){return hc(this,void 0,void 0,(function*(){const n=r?this.getPostUrl():this.getUrl(e,t),i=r?this.getPostData(e,t):null,o="proxy"===e?mc:pc;this.emit("debug",{action:"request",request:n,provider:this});const s={url:n,throttleSlotInterval:1e3,throttleCallback:(e,t)=>(this.isCommunityResource()&&aa(),Promise.resolve(!0))};let a=null;i&&(s.headers={"content-type":"application/x-www-form-urlencoded; charset=UTF-8"},a=Object.keys(i).map((e=>`${e}=${i[e]}`)).join("&"));const c=yield Ys(s,a,o||mc);return this.emit("debug",{action:"response",request:n,response:rt(c),provider:this}),c}))}detectNetwork(){return hc(this,void 0,void 0,(function*(){return this.network}))}perform(e,t){const r=Object.create(null,{perform:{get:()=>super.perform}});return hc(this,void 0,void 0,(function*(){switch(e){case"getBlockNumber":return this.fetch("proxy",{action:"eth_blockNumber"});case"getGasPrice":return this.fetch("proxy",{action:"eth_gasPrice"});case"getBalance":return this.fetch("account",{action:"balance",address:t.address,tag:t.blockTag});case"getTransactionCount":return this.fetch("proxy",{action:"eth_getTransactionCount",address:t.address,tag:t.blockTag});case"getCode":return this.fetch("proxy",{action:"eth_getCode",address:t.address,tag:t.blockTag});case"getStorageAt":return this.fetch("proxy",{action:"eth_getStorageAt",address:t.address,position:t.position,tag:t.blockTag});case"sendTransaction":return this.fetch("proxy",{action:"eth_sendRawTransaction",hex:t.signedTransaction},!0).catch((e=>bc("sendTransaction",e,t.signedTransaction)));case"getBlock":if(t.blockTag)return this.fetch("proxy",{action:"eth_getBlockByNumber",tag:t.blockTag,boolean:t.includeTransactions?"true":"false"});throw new Error("getBlock by blockHash not implemented");case"getTransaction":return this.fetch("proxy",{action:"eth_getTransactionByHash",txhash:t.transactionHash});case"getTransactionReceipt":return this.fetch("proxy",{action:"eth_getTransactionReceipt",txhash:t.transactionHash});case"call":{if("latest"!==t.blockTag)throw new Error("EtherscanProvider does not support blockTag for call");const e=fc(t.transaction);e.module="proxy",e.action="eth_call";try{return yield this.fetch("proxy",e,!0)}catch(h2){return bc("call",h2,t.transaction)}}case"estimateGas":{const e=fc(t.transaction);e.module="proxy",e.action="eth_estimateGas";try{return yield this.fetch("proxy",e,!0)}catch(h2){return bc("estimateGas",h2,t.transaction)}}case"getLogs":{const e={action:"getLogs"};if(t.filter.fromBlock&&(e.fromBlock=gc(t.filter.fromBlock)),t.filter.toBlock&&(e.toBlock=gc(t.filter.toBlock)),t.filter.address&&(e.address=t.filter.address),t.filter.topics&&t.filter.topics.length>0&&(t.filter.topics.length>1&&dc.throwError("unsupported topic count",ee.errors.UNSUPPORTED_OPERATION,{topics:t.filter.topics}),1===t.filter.topics.length)){const r=t.filter.topics[0];"string"==typeof r&&66===r.length||dc.throwError("unsupported topic format",ee.errors.UNSUPPORTED_OPERATION,{topic0:r}),e.topic0=r}const r=yield this.fetch("logs",e);let n={};for(let t=0;t<r.length;t++){const e=r[t];if(null==e.blockHash){if(null==n[e.blockNumber]){const t=yield this.getBlock(e.blockNumber);t&&(n[e.blockNumber]=t.hash)}e.blockHash=n[e.blockNumber]}}return r}case"getEtherPrice":return"homestead"!==this.network.name?0:parseFloat((yield this.fetch("stats",{action:"ethprice"})).ethusd)}return r.perform.call(this,e,t)}))}getHistory(e,t,r){return hc(this,void 0,void 0,(function*(){const n={action:"txlist",address:yield this.resolveName(e),startblock:null==t?0:t,endblock:null==r?99999999:r,sort:"asc"};return(yield this.fetch("account",n)).map((e=>{["contractAddress","to"].forEach((function(t){""==e[t]&&delete e[t]})),null==e.creates&&null!=e.contractAddress&&(e.creates=e.contractAddress);const t=this.formatter.transactionResponse(e);return e.timeStamp&&(t.timestamp=parseInt(e.timeStamp)),t}))}))}isCommunityResource(){return this.apiKey===yc}}var wc=function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{c(n.next(e))}catch(t){o(t)}}function a(e){try{c(n.throw(e))}catch(t){o(t)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}c((n=n.apply(e,t||[])).next())}))};const xc=new ee(ta);function kc(){return(new Date).getTime()}function Sc(e){let t=null;for(let r=0;r<e.length;r++){const n=e[r];if(null==n)return null;t?t.name===n.name&&t.chainId===n.chainId&&(t.ensAddress===n.ensAddress||null==t.ensAddress&&null==n.ensAddress)||xc.throwArgumentError("provider mismatch","networks",e):t=n}return t}function Ec(e,t){e=e.slice().sort();const r=Math.floor(e.length/2);if(e.length%2)return e[r];const n=e[r-1],i=e[r];return null!=t&&Math.abs(n-i)>t?null:(n+i)/2}function Ac(e){if(null===e)return"null";if("number"==typeof e||"boolean"==typeof e)return JSON.stringify(e);if("string"==typeof e)return e;if(Pe.isBigNumber(e))return e.toString();if(Array.isArray(e))return JSON.stringify(e.map((e=>Ac(e))));if("object"==typeof e){const t=Object.keys(e);return t.sort(),"{"+t.map((t=>{let r=e[t];return r="function"==typeof r?"[function]":Ac(r),JSON.stringify(t)+":"+r})).join(",")+"}"}throw new Error("unknown value type: "+typeof e)}let Nc=1;function Tc(e){let t=null,r=null,n=new Promise((n=>{t=function(){r&&(clearTimeout(r),r=null),n()},r=setTimeout(t,e)}));return{cancel:t,getPromise:function(){return n},wait:e=>(n=n.then(e),n)}}const Pc=[ee.errors.CALL_EXCEPTION,ee.errors.INSUFFICIENT_FUNDS,ee.errors.NONCE_EXPIRED,ee.errors.REPLACEMENT_UNDERPRICED,ee.errors.UNPREDICTABLE_GAS_LIMIT],Mc=["address","args","errorArgs","errorSignature","method","transaction"];function Ic(e,t){const r={weight:e.weight};return Object.defineProperty(r,"provider",{get:()=>e.provider}),e.start&&(r.start=e.start),t&&(r.duration=t-e.start),e.done&&(e.error?r.error=e.error:r.result=e.result||null),r}function Cc(e,t,r){let n=Ac;switch(t){case"getBlockNumber":return function(t){const r=t.map((e=>e.result));let n=Ec(t.map((e=>e.result)),2);if(null!=n)return n=Math.ceil(n),r.indexOf(n+1)>=0&&n++,n>=e._highestBlockNumber&&(e._highestBlockNumber=n),e._highestBlockNumber};case"getGasPrice":return function(e){const t=e.map((e=>e.result));return t.sort(),t[Math.floor(t.length/2)]};case"getEtherPrice":return function(e){return Ec(e.map((e=>e.result)))};case"getBalance":case"getTransactionCount":case"getCode":case"getStorageAt":case"call":case"estimateGas":case"getLogs":break;case"getTransaction":case"getTransactionReceipt":n=function(e){return null==e?null:((e=Qe(e)).confirmations=-1,Ac(e))};break;case"getBlock":n=r.includeTransactions?function(e){return null==e?null:((e=Qe(e)).transactions=e.transactions.map((e=>((e=Qe(e)).confirmations=-1,e))),Ac(e))}:function(e){return null==e?null:Ac(e)};break;default:throw new Error("unknown method: "+t)}return function(e,t){return function(r){const n={};r.forEach((t=>{const r=e(t.result);n[r]||(n[r]={count:0,result:t.result}),n[r].count++}));const i=Object.keys(n);for(let e=0;e<i.length;e++){const r=n[i[e]];if(r.count>=t)return r.result}}}(n,e.quorum)}function Rc(e,t){return wc(this,void 0,void 0,(function*(){const r=e.provider;return null!=r.blockNumber&&r.blockNumber>=t||-1===t?r:Qs((()=>new Promise(((n,i)=>{setTimeout((function(){return r.blockNumber>=t?n(r):e.cancelled?n(null):n(void 0)}),0)}))),{oncePoll:r})}))}function Bc(e,t,r,n){return wc(this,void 0,void 0,(function*(){let i=e.provider;switch(r){case"getBlockNumber":case"getGasPrice":return i[r]();case"getEtherPrice":if(i.getEtherPrice)return i.getEtherPrice();break;case"getBalance":case"getTransactionCount":case"getCode":return n.blockTag&&he(n.blockTag)&&(i=yield Rc(e,t)),i[r](n.address,n.blockTag||"latest");case"getStorageAt":return n.blockTag&&he(n.blockTag)&&(i=yield Rc(e,t)),i.getStorageAt(n.address,n.position,n.blockTag||"latest");case"getBlock":return n.blockTag&&he(n.blockTag)&&(i=yield Rc(e,t)),i[n.includeTransactions?"getBlockWithTransactions":"getBlock"](n.blockTag||n.blockHash);case"call":case"estimateGas":return n.blockTag&&he(n.blockTag)&&(i=yield Rc(e,t)),i[r](n.transaction);case"getTransaction":case"getTransactionReceipt":return i[r](n.transactionHash);case"getLogs":{let r=n.filter;return(r.fromBlock&&he(r.fromBlock)||r.toBlock&&he(r.toBlock))&&(i=yield Rc(e,t)),i.getLogs(r)}}return xc.throwError("unknown method error",ee.errors.UNKNOWN_ERROR,{method:r,params:n})}))}class Oc extends Ca{constructor(e,t){0===e.length&&xc.throwArgumentError("missing providers","providers",e);const r=e.map(((e,t)=>{if(qn.isProvider(e)){const t=oa(e)?2e3:750,r=1;return Object.freeze({provider:e,weight:1,stallTimeout:t,priority:r})}const r=Qe(e);null==r.priority&&(r.priority=1),null==r.stallTimeout&&(r.stallTimeout=oa(e)?2e3:750),null==r.weight&&(r.weight=1);const n=r.weight;return(n%1||n>512||n<1)&&xc.throwArgumentError("invalid weight; must be integer in [1, 512]",`providers[${t}].weight`,n),Object.freeze(r)})),n=r.reduce(((e,t)=>e+t.weight),0);null==t?t=n/2:t>n&&xc.throwArgumentError("quorum will always fail; larger than total weight","quorum",t);let i=Sc(r.map((e=>e.provider.network)));null==i&&(i=new Promise(((e,t)=>{setTimeout((()=>{this.detectNetwork().then(e,t)}),0)}))),super(i),Ge(this,"providerConfigs",Object.freeze(r)),Ge(this,"quorum",t),this._highestBlockNumber=-1}detectNetwork(){return wc(this,void 0,void 0,(function*(){return Sc(yield Promise.all(this.providerConfigs.map((e=>e.provider.getNetwork()))))}))}perform(e,t){return wc(this,void 0,void 0,(function*(){if("sendTransaction"===e){const e=yield Promise.all(this.providerConfigs.map((e=>e.provider.sendTransaction(t.signedTransaction).then((e=>e.hash),(e=>e)))));for(let t=0;t<e.length;t++){const r=e[t];if("string"==typeof r)return r}throw e[0]}-1===this._highestBlockNumber&&"getBlockNumber"!==e&&(yield this.getBlockNumber());const r=Cc(this,e,t),n=rs(this.providerConfigs.map(Qe));n.sort(((e,t)=>e.priority-t.priority));const i=this._highestBlockNumber;let o=0,s=!0;for(;;){const a=kc();let c=n.filter((e=>e.runner&&a-e.start<e.stallTimeout)).reduce(((e,t)=>e+t.weight),0);for(;c<this.quorum&&o<n.length;){const r=n[o++],s=Nc++;r.start=kc(),r.staller=Tc(r.stallTimeout),r.staller.wait((()=>{r.staller=null})),r.runner=Bc(r,i,e,t).then((n=>{r.done=!0,r.result=n,this.listenerCount("debug")&&this.emit("debug",{action:"request",rid:s,backend:Ic(r,kc()),request:{method:e,params:rt(t)},provider:this})}),(n=>{r.done=!0,r.error=n,this.listenerCount("debug")&&this.emit("debug",{action:"request",rid:s,backend:Ic(r,kc()),request:{method:e,params:rt(t)},provider:this})})),this.listenerCount("debug")&&this.emit("debug",{action:"request",rid:s,backend:Ic(r,null),request:{method:e,params:rt(t)},provider:this}),c+=r.weight}const u=[];n.forEach((e=>{!e.done&&e.runner&&(u.push(e.runner),e.staller&&u.push(e.staller.getPromise()))})),u.length&&(yield Promise.race(u));const l=n.filter((e=>e.done&&null==e.error));if(l.length>=this.quorum){const e=r(l);if(void 0!==e)return n.forEach((e=>{e.staller&&e.staller.cancel(),e.cancelled=!0})),e;s||(yield Tc(100).getPromise()),s=!1}const h=n.reduce(((e,t)=>{if(!t.done||null==t.error)return e;const r=t.error.code;return Pc.indexOf(r)>=0&&(e[r]||(e[r]={error:t.error,weight:0}),e[r].weight+=t.weight),e}),{});if(Object.keys(h).forEach((e=>{const t=h[e];if(t.weight<this.quorum)return;n.forEach((e=>{e.staller&&e.staller.cancel(),e.cancelled=!0}));const r=t.error,i={};Mc.forEach((e=>{null!=r[e]&&(i[e]=r[e])})),xc.throwError(r.reason||r.message,e,i)})),0===n.filter((e=>!e.done)).length)break}return n.forEach((e=>{e.staller&&e.staller.cancel(),e.cancelled=!0})),xc.throwError("failed to meet quorum",ee.errors.SERVER_ERROR,{method:e,params:t,results:n.map((e=>Ic(e))),provider:this})}))}}const Lc=null,zc=new ee(ta),Uc="84842078b09946638c03157f83405213";class _c extends Za{constructor(e,t){const r=new qc(e,t),n=r.connection;n.password&&zc.throwError("INFURA WebSocket project secrets unsupported",ee.errors.UNSUPPORTED_OPERATION,{operation:"InfuraProvider.getWebSocketProvider()"});super(n.url.replace(/^http/i,"ws").replace("/v3/","/ws/v3/"),e),Ge(this,"apiKey",r.projectId),Ge(this,"projectId",r.projectId),Ge(this,"projectSecret",r.projectSecret)}isCommunityResource(){return this.projectId===Uc}}class qc extends $a{static getWebSocketProvider(e,t){return new _c(e,t)}static getApiKey(e){const t={apiKey:Uc,projectId:Uc,projectSecret:null};return null==e||("string"==typeof e?t.projectId=e:null!=e.projectSecret?(zc.assertArgument("string"==typeof e.projectId,"projectSecret requires a projectId","projectId",e.projectId),zc.assertArgument("string"==typeof e.projectSecret,"invalid projectSecret","projectSecret","[REDACTED]"),t.projectId=e.projectId,t.projectSecret=e.projectSecret):e.projectId&&(t.projectId=e.projectId),t.apiKey=t.projectId),t}static getUrl(e,t){let r=null;switch(e?e.name:"unknown"){case"homestead":r="mainnet.infura.io";break;case"ropsten":r="ropsten.infura.io";break;case"rinkeby":r="rinkeby.infura.io";break;case"kovan":r="kovan.infura.io";break;case"goerli":r="goerli.infura.io";break;case"matic":r="polygon-mainnet.infura.io";break;case"maticmum":r="polygon-mumbai.infura.io";break;case"optimism":r="optimism-mainnet.infura.io";break;case"optimism-kovan":r="optimism-kovan.infura.io";break;case"arbitrum":r="arbitrum-mainnet.infura.io";break;case"arbitrum-rinkeby":r="arbitrum-rinkeby.infura.io";break;default:zc.throwError("unsupported network",ee.errors.INVALID_ARGUMENT,{argument:"network",value:e})}const n={allowGzip:!0,url:"https://"+r+"/v3/"+t.projectId,throttleCallback:(e,r)=>(t.projectId===Uc&&aa(),Promise.resolve(!0))};return null!=t.projectSecret&&(n.user="",n.password=t.projectSecret),n}isCommunityResource(){return this.projectId===Uc}}class Dc extends Ha{send(e,t){const r={method:e,params:t,id:this._nextId++,jsonrpc:"2.0"};null==this._pendingBatch&&(this._pendingBatch=[]);const n={request:r,resolve:null,reject:null},i=new Promise(((e,t)=>{n.resolve=e,n.reject=t}));return this._pendingBatch.push(n),this._pendingBatchAggregator||(this._pendingBatchAggregator=setTimeout((()=>{const e=this._pendingBatch;this._pendingBatch=null,this._pendingBatchAggregator=null;const t=e.map((e=>e.request));return this.emit("debug",{action:"requestBatch",request:rt(t),provider:this}),Ys(this.connection,JSON.stringify(t)).then((r=>{this.emit("debug",{action:"response",request:t,response:r,provider:this}),e.forEach(((e,t)=>{const n=r[t];if(n.error){const t=new Error(n.error.message);t.code=n.error.code,t.data=n.error.data,e.reject(t)}else e.resolve(n.result)}))}),(r=>{this.emit("debug",{action:"response",error:r,request:t,provider:this}),e.forEach((e=>{e.reject(r)}))}))}),10)),i}}const Vc=new ee(ta);class jc extends $a{static getApiKey(e){return e&&"string"!=typeof e&&Vc.throwArgumentError("invalid apiKey","apiKey",e),e||"ETHERS_JS_SHARED"}static getUrl(e,t){Vc.warn("NodeSmith will be discontinued on 2019-12-20; please migrate to another platform.");let r=null;switch(e.name){case"homestead":r="https://ethereum.api.nodesmith.io/v1/mainnet/jsonrpc";break;case"ropsten":r="https://ethereum.api.nodesmith.io/v1/ropsten/jsonrpc";break;case"rinkeby":r="https://ethereum.api.nodesmith.io/v1/rinkeby/jsonrpc";break;case"goerli":r="https://ethereum.api.nodesmith.io/v1/goerli/jsonrpc";break;case"kovan":r="https://ethereum.api.nodesmith.io/v1/kovan/jsonrpc";break;default:Vc.throwArgumentError("unsupported network","network",arguments[0])}return r+"?apiKey="+t}}const Fc=new ee(ta),Hc={homestead:"6004bcd10040261633ade990",ropsten:"6004bd4d0040261633ade991",rinkeby:"6004bda20040261633ade994",goerli:"6004bd860040261633ade992"};class Wc extends $a{constructor(e,t){if(null==t){const r=Ze(new.target,"getNetwork")(e);if(r){const e=Hc[r.name];e&&(t={applicationId:e,loadBalancer:!0})}null==t&&Fc.throwError("unsupported network",ee.errors.INVALID_ARGUMENT,{argument:"network",value:e})}super(e,t)}static getApiKey(e){null==e&&Fc.throwArgumentError("PocketProvider.getApiKey does not support null apiKey","apiKey",e);const t={applicationId:null,loadBalancer:!1,applicationSecretKey:null};return"string"==typeof e?t.applicationId=e:null!=e.applicationSecretKey?(Fc.assertArgument("string"==typeof e.applicationId,"applicationSecretKey requires an applicationId","applicationId",e.applicationId),Fc.assertArgument("string"==typeof e.applicationSecretKey,"invalid applicationSecretKey","applicationSecretKey","[REDACTED]"),t.applicationId=e.applicationId,t.applicationSecretKey=e.applicationSecretKey,t.loadBalancer=!!e.loadBalancer):e.applicationId?(Fc.assertArgument("string"==typeof e.applicationId,"apiKey.applicationId must be a string","apiKey.applicationId",e.applicationId),t.applicationId=e.applicationId,t.loadBalancer=!!e.loadBalancer):Fc.throwArgumentError("unsupported PocketProvider apiKey","apiKey",e),t}static getUrl(e,t){let r=null;switch(e?e.name:"unknown"){case"homestead":r="eth-mainnet.gateway.pokt.network";break;case"ropsten":r="eth-ropsten.gateway.pokt.network";break;case"rinkeby":r="eth-rinkeby.gateway.pokt.network";break;case"goerli":r="eth-goerli.gateway.pokt.network";break;default:Fc.throwError("unsupported network",ee.errors.INVALID_ARGUMENT,{argument:"network",value:e})}let n=null;n=t.loadBalancer?`https://${r}/v1/lb/${t.applicationId}`:`https://${r}/v1/${t.applicationId}`;const i={url:n,headers:{}};return null!=t.applicationSecretKey&&(i.user="",i.password=t.applicationSecretKey),i}isCommunityResource(){return this.applicationId===Hc[this.network.name]}}const Kc=new ee(ta);let Xc=1;function Gc(e,t){const r="Web3LegacyFetcher";return function(e,n){const i={method:e,params:n,id:Xc++,jsonrpc:"2.0"};return new Promise(((e,n)=>{this.emit("debug",{action:"request",fetcher:r,request:rt(i),provider:this}),t(i,((t,o)=>{if(t)return this.emit("debug",{action:"response",fetcher:r,error:t,request:i,provider:this}),n(t);if(this.emit("debug",{action:"response",fetcher:r,request:i,response:o,provider:this}),o.error){const e=new Error(o.error.message);return e.code=o.error.code,e.data=o.error.data,n(e)}e(o.result)}))}))}}class Zc extends Ha{constructor(e,t){null==e&&Kc.throwArgumentError("missing provider","provider",e);let r=null,n=null,i=null;"function"==typeof e?(r="unknown:",n=e):(r=e.host||e.path||"",!r&&e.isMetaMask&&(r="metamask"),i=e,e.request?(""===r&&(r="eip-1193:"),n=function(e){return function(t,r){null==r&&(r=[]);const n={method:t,params:r};return this.emit("debug",{action:"request",fetcher:"Eip1193Fetcher",request:rt(n),provider:this}),e.request(n).then((e=>(this.emit("debug",{action:"response",fetcher:"Eip1193Fetcher",request:n,response:e,provider:this}),e)),(e=>{throw this.emit("debug",{action:"response",fetcher:"Eip1193Fetcher",request:n,error:e,provider:this}),e}))}}(e)):e.sendAsync?n=Gc(0,e.sendAsync.bind(e)):e.send?n=Gc(0,e.send.bind(e)):Kc.throwArgumentError("unsupported provider","provider",e),r||(r="unknown:")),super(r,t),Ge(this,"jsonRpcFetchFunc",n),Ge(this,"provider",i)}send(e,t){return this.jsonRpcFetchFunc(e,t)}}const Jc=new ee(ta);function Yc(e,t){if(null==e&&(e="homestead"),"string"==typeof e){const t=e.match(/^(ws|http)s?:/i);if(t)switch(t[1]){case"http":return new Ha(e);case"ws":return new Za(e);default:Jc.throwArgumentError("unsupported URL scheme","network",e)}}const r=Vs(e);return r&&r._defaultProvider||Jc.throwError("unsupported getDefaultProvider network",ee.errors.NETWORK_ERROR,{operation:"getDefaultProvider",network:e}),r._defaultProvider({FallbackProvider:Oc,AlchemyProvider:nc,AnkrProvider:ac,CloudflareProvider:lc,EtherscanProvider:vc,InfuraProvider:qc,JsonRpcProvider:Ha,NodesmithProvider:jc,PocketProvider:Wc,Web3Provider:Zc,IpcProvider:Lc},t)}const Qc=new RegExp("^bytes([0-9]+)$"),$c=new RegExp("^(u?int)([0-9]*)$"),eu=new RegExp("^(.*)\\[([0-9]*)\\]$"),tu=new ee("solidity/5.6.0");function ru(e,t,r){switch(e){case"address":return r?le(t,32):ae(t);case"string":return Ir(t);case"bytes":return ae(t);case"bool":return t=t?"0x01":"0x00",r?le(t,32):ae(t)}let n=e.match($c);if(n){let i=parseInt(n[2]||"256");return(n[2]&&String(i)!==n[2]||i%8!=0||0===i||i>256)&&tu.throwArgumentError("invalid number type","type",e),r&&(i=256),t=Pe.from(t).toTwos(i),le(t,i/8)}if(n=e.match(Qc),n){const i=parseInt(n[1]);return(String(i)!==n[1]||0===i||i>32)&&tu.throwArgumentError("invalid bytes type","type",e),ae(t).byteLength!==i&&tu.throwArgumentError(`invalid value for ${e}`,"value",t),r?ae((t+"0000000000000000000000000000000000000000000000000000000000000000").substring(0,66)):t}if(n=e.match(eu),n&&Array.isArray(t)){const r=n[1];parseInt(n[2]||String(t.length))!=t.length&&tu.throwArgumentError(`invalid array length for ${e}`,"value",t);const i=[];return t.forEach((function(e){i.push(ru(r,e,!0))})),ce(i)}return tu.throwArgumentError("invalid type","type",e)}function nu(e,t){e.length!=t.length&&tu.throwArgumentError("wrong number of values; expected ${ types.length }","values",t);const r=[];return e.forEach((function(e,n){r.push(ru(e,t[n]))})),fe(ce(r))}function iu(e,t){return Lt(nu(e,t))}function ou(e,t){return Ao(nu(e,t))}const su=new ee("units/5.6.0"),au=["wei","kwei","mwei","gwei","szabo","finney","ether"];function cu(e){const t=String(e).split(".");(t.length>2||!t[0].match(/^-?[0-9]*$/)||t[1]&&!t[1].match(/^[0-9]*$/)||"."===e||"-."===e)&&su.throwArgumentError("invalid value","value",e);let r=t[0],n="";for("-"===r.substring(0,1)&&(n="-",r=r.substring(1));"0"===r.substring(0,1);)r=r.substring(1);""===r&&(r="0");let i="";for(2===t.length&&(i="."+(t[1]||"0"));i.length>2&&"0"===i[i.length-1];)i=i.substring(0,i.length-1);const o=[];for(;r.length;){if(r.length<=3){o.unshift(r);break}{const e=r.length-3;o.unshift(r.substring(e)),r=r.substring(0,e)}}return n+o.join(",")+i}function uu(e,t){if("string"==typeof t){const e=au.indexOf(t);-1!==e&&(t=3*e)}return De(e,null!=t?t:18)}function lu(e,t){if("string"!=typeof e&&su.throwArgumentError("value must be a string","value",e),"string"==typeof t){const e=au.indexOf(t);-1!==e&&(t=3*e)}return Ve(e,null!=t?t:18)}function hu(e){return uu(e,18)}function du(e){return lu(e,18)}const fu="ethers/5.6.6",pu=new ee(fu);try{const e=window;null==e._ethers&&(e._ethers=c)}catch(h2){}var mu=r(10717),gu=r.n(mu),yu=r(48834),bu=r(62197),vu=r.n(bu),wu=r(17022),xu=r.n(wu),ku=r(83871),Su=r(96346);const Eu=e=>({decode:e.decode.bind(e),encode:e.encode.bind(e)});var Au=r(41528);const Nu=e=>t=>{const r=(0,Su.Ik)(e,t),{encode:n,decode:i}=Eu(r),o=r;return o.decode=(e,t)=>{const r=i(e,t);return(0,Au.oU)(Buffer.from(r))},o.encode=(t,r,i)=>{const o=(0,Au.k$)(t,e);return n(o,r,i)},o},Tu=e=>t=>{const r=(0,Su.Ik)(e,t),{encode:n,decode:i}=Eu(r),o=r;return o.decode=(e,t)=>{const r=i(e,t);return(0,Au.Q5)(Buffer.from(r))},o.encode=(t,r,i)=>{const o=(0,Au.zP)(t,e);return n(o,r,i)},o},Pu=Nu(8);Tu(8),Nu(16),Tu(16),Nu(24),Tu(24),Nu(32),Tu(32);new(r(6391))("1e+18");class Mu extends TypeError{constructor(e,t){let r;const{message:n,...i}=e,{path:o}=e;super(0===o.length?n:"At path: "+o.join(".")+" -- "+n),Object.assign(this,i),this.name=this.constructor.name,this.failures=()=>{var n;return null!=(n=r)?n:r=[e,...t()]}}}function Iu(e){return"object"==typeof e&&null!=e}function Cu(e){return"string"==typeof e?JSON.stringify(e):""+e}function Ru(e,t,r,n){if(!0===e)return;!1===e?e={}:"string"==typeof e&&(e={message:e});const{path:i,branch:o}=t,{type:s}=r,{refinement:a,message:c="Expected a value of type `"+s+"`"+(a?" with refinement `"+a+"`":"")+", but received: `"+Cu(n)+"`"}=e;return{value:n,type:s,refinement:a,key:i[i.length-1],path:i,branch:o,...e,message:c}}function*Bu(e,t,r,n){(function(e){return Iu(e)&&"function"==typeof e[Symbol.iterator]})(e)||(e=[e]);for(const i of e){const e=Ru(i,t,r,n);e&&(yield e)}}function*Ou(e,t,r={}){const{path:n=[],branch:i=[e],coerce:o=!1,mask:s=!1}=r,a={path:n,branch:i};if(o&&(e=t.coercer(e,a),s&&"type"!==t.type&&Iu(t.schema)&&Iu(e)&&!Array.isArray(e)))for(const u in e)void 0===t.schema[u]&&delete e[u];let c=!0;for(const u of t.validator(e,a))c=!1,yield[u,void 0];for(let[u,l,h]of t.entries(e,a)){const t=Ou(l,h,{path:void 0===u?n:[...n,u],branch:void 0===u?i:[...i,l],coerce:o,mask:s});for(const r of t)r[0]?(c=!1,yield[r[0],void 0]):o&&(l=r[1],void 0===u?e=l:e instanceof Map?e.set(u,l):e instanceof Set?e.add(l):Iu(e)&&(e[u]=l))}if(c)for(const u of t.refiner(e,a))c=!1,yield[u,void 0];c&&(yield[void 0,e])}class Lu{constructor(e){const{type:t,schema:r,validator:n,refiner:i,coercer:o=(e=>e),entries:s=function*(){}}=e;this.type=t,this.schema=r,this.entries=s,this.coercer=o,this.validator=n?(e,t)=>Bu(n(e,t),t,this,e):()=>[],this.refiner=i?(e,t)=>Bu(i(e,t),t,this,e):()=>[]}assert(e){return function(e,t){const r=_u(e,t);if(r[0])throw r[0]}(e,this)}create(e){return zu(e,this)}is(e){return Uu(e,this)}mask(e){return function(e,t){const r=_u(e,t,{coerce:!0,mask:!0});if(r[0])throw r[0];return r[1]}(e,this)}validate(e,t={}){return _u(e,this,t)}}function zu(e,t){const r=_u(e,t,{coerce:!0});if(r[0])throw r[0];return r[1]}function Uu(e,t){return!_u(e,t)[0]}function _u(e,t,r={}){const n=Ou(e,t,r),i=function(e){const{done:t,value:r}=e.next();return t?void 0:r}(n);if(i[0]){return[new Mu(i[0],(function*(){for(const e of n)e[0]&&(yield e[0])})),void 0]}return[void 0,i[1]]}function qu(e,t){return new Lu({type:e,schema:null,validator:t})}function Du(e){return new Lu({type:"array",schema:e,*entries(t){if(e&&Array.isArray(t))for(const[r,n]of t.entries())yield[r,n,e]},coercer:e=>Array.isArray(e)?e.slice():e,validator:e=>Array.isArray(e)||"Expected an array value, but received: "+Cu(e)})}function Vu(){return qu("boolean",(e=>"boolean"==typeof e))}function ju(e){return qu("instance",(t=>t instanceof e||"Expected a `"+e.name+"` instance, but received: "+Cu(t)))}function Fu(e){const t=Cu(e),r=typeof e;return new Lu({type:"literal",schema:"string"===r||"number"===r||"boolean"===r?e:null,validator:r=>r===e||"Expected the literal `"+t+"`, but received: "+Cu(r)})}function Hu(){return qu("never",(()=>!1))}function Wu(e){return new Lu({...e,validator:(t,r)=>null===t||e.validator(t,r),refiner:(t,r)=>null===t||e.refiner(t,r)})}function Ku(){return qu("number",(e=>"number"==typeof e&&!isNaN(e)||"Expected a number, but received: "+Cu(e)))}function Xu(e){return new Lu({...e,validator:(t,r)=>void 0===t||e.validator(t,r),refiner:(t,r)=>void 0===t||e.refiner(t,r)})}function Gu(e,t){return new Lu({type:"record",schema:null,*entries(r){if(Iu(r))for(const n in r){const i=r[n];yield[n,n,e],yield[n,i,t]}},validator:e=>Iu(e)||"Expected an object, but received: "+Cu(e)})}function Zu(){return qu("string",(e=>"string"==typeof e||"Expected a string, but received: "+Cu(e)))}function Ju(e){const t=Hu();return new Lu({type:"tuple",schema:null,*entries(r){if(Array.isArray(r)){const n=Math.max(e.length,r.length);for(let i=0;i<n;i++)yield[i,r[i],e[i]||t]}},validator:e=>Array.isArray(e)||"Expected an array, but received: "+Cu(e)})}function Yu(e){const t=Object.keys(e);return new Lu({type:"type",schema:e,*entries(r){if(Iu(r))for(const n of t)yield[n,r[n],e[n]]},validator:e=>Iu(e)||"Expected an object, but received: "+Cu(e)})}function Qu(e){const t=e.map((e=>e.type)).join(" | ");return new Lu({type:"union",schema:null,validator(r,n){const i=[];for(const t of e){const[...e]=Ou(r,t,n),[o]=e;if(!o[0])return[];for(const[t]of e)t&&i.push(t)}return["Expected the value to satisfy a union of `"+t+"`, but received: "+Cu(r),...i]}})}function $u(){return qu("unknown",(()=>!0))}function el(e,t,r){return new Lu({...e,coercer:(n,i)=>Uu(n,t)?e.coercer(r(n,i),i):e.coercer(n,i)})}var tl=r(50714),rl=r(87414),nl=r.n(rl),il=r(97637),ol=r.n(il);const sl=e=>yu.Buffer.isBuffer(e)?e:e instanceof Uint8Array?yu.Buffer.from(e.buffer,e.byteOffset,e.byteLength):yu.Buffer.from(e);var al="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function cl(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var ul={},ll={},hl=dl;function dl(e,t){if(!e)throw new Error(t||"Assertion failed")}dl.equal=function(e,t,r){if(e!=t)throw new Error(r||"Assertion failed: "+e+" != "+t)};var fl={exports:{}};"function"==typeof Object.create?fl.exports=function(e,t){t&&(e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}))}:fl.exports=function(e,t){if(t){e.super_=t;var r=function(){};r.prototype=t.prototype,e.prototype=new r,e.prototype.constructor=e}};var pl=hl,ml=fl.exports;function gl(e,t){return 55296==(64512&e.charCodeAt(t))&&(!(t<0||t+1>=e.length)&&56320==(64512&e.charCodeAt(t+1)))}function yl(e){return(e>>>24|e>>>8&65280|e<<8&16711680|(255&e)<<24)>>>0}function bl(e){return 1===e.length?"0"+e:e}function vl(e){return 7===e.length?"0"+e:6===e.length?"00"+e:5===e.length?"000"+e:4===e.length?"0000"+e:3===e.length?"00000"+e:2===e.length?"000000"+e:1===e.length?"0000000"+e:e}ll.inherits=ml,ll.toArray=function(e,t){if(Array.isArray(e))return e.slice();if(!e)return[];var r=[];if("string"==typeof e)if(t){if("hex"===t)for((e=e.replace(/[^a-z0-9]+/gi,"")).length%2!=0&&(e="0"+e),i=0;i<e.length;i+=2)r.push(parseInt(e[i]+e[i+1],16))}else for(var n=0,i=0;i<e.length;i++){var o=e.charCodeAt(i);o<128?r[n++]=o:o<2048?(r[n++]=o>>6|192,r[n++]=63&o|128):gl(e,i)?(o=65536+((1023&o)<<10)+(1023&e.charCodeAt(++i)),r[n++]=o>>18|240,r[n++]=o>>12&63|128,r[n++]=o>>6&63|128,r[n++]=63&o|128):(r[n++]=o>>12|224,r[n++]=o>>6&63|128,r[n++]=63&o|128)}else for(i=0;i<e.length;i++)r[i]=0|e[i];return r},ll.toHex=function(e){for(var t="",r=0;r<e.length;r++)t+=bl(e[r].toString(16));return t},ll.htonl=yl,ll.toHex32=function(e,t){for(var r="",n=0;n<e.length;n++){var i=e[n];"little"===t&&(i=yl(i)),r+=vl(i.toString(16))}return r},ll.zero2=bl,ll.zero8=vl,ll.join32=function(e,t,r,n){var i=r-t;pl(i%4==0);for(var o=new Array(i/4),s=0,a=t;s<o.length;s++,a+=4){var c;c="big"===n?e[a]<<24|e[a+1]<<16|e[a+2]<<8|e[a+3]:e[a+3]<<24|e[a+2]<<16|e[a+1]<<8|e[a],o[s]=c>>>0}return o},ll.split32=function(e,t){for(var r=new Array(4*e.length),n=0,i=0;n<e.length;n++,i+=4){var o=e[n];"big"===t?(r[i]=o>>>24,r[i+1]=o>>>16&255,r[i+2]=o>>>8&255,r[i+3]=255&o):(r[i+3]=o>>>24,r[i+2]=o>>>16&255,r[i+1]=o>>>8&255,r[i]=255&o)}return r},ll.rotr32=function(e,t){return e>>>t|e<<32-t},ll.rotl32=function(e,t){return e<<t|e>>>32-t},ll.sum32=function(e,t){return e+t>>>0},ll.sum32_3=function(e,t,r){return e+t+r>>>0},ll.sum32_4=function(e,t,r,n){return e+t+r+n>>>0},ll.sum32_5=function(e,t,r,n,i){return e+t+r+n+i>>>0},ll.sum64=function(e,t,r,n){var i=e[t],o=n+e[t+1]>>>0,s=(o<n?1:0)+r+i;e[t]=s>>>0,e[t+1]=o},ll.sum64_hi=function(e,t,r,n){return(t+n>>>0<t?1:0)+e+r>>>0},ll.sum64_lo=function(e,t,r,n){return t+n>>>0},ll.sum64_4_hi=function(e,t,r,n,i,o,s,a){var c=0,u=t;return c+=(u=u+n>>>0)<t?1:0,c+=(u=u+o>>>0)<o?1:0,e+r+i+s+(c+=(u=u+a>>>0)<a?1:0)>>>0},ll.sum64_4_lo=function(e,t,r,n,i,o,s,a){return t+n+o+a>>>0},ll.sum64_5_hi=function(e,t,r,n,i,o,s,a,c,u){var l=0,h=t;return l+=(h=h+n>>>0)<t?1:0,l+=(h=h+o>>>0)<o?1:0,l+=(h=h+a>>>0)<a?1:0,e+r+i+s+c+(l+=(h=h+u>>>0)<u?1:0)>>>0},ll.sum64_5_lo=function(e,t,r,n,i,o,s,a,c,u){return t+n+o+a+u>>>0},ll.rotr64_hi=function(e,t,r){return(t<<32-r|e>>>r)>>>0},ll.rotr64_lo=function(e,t,r){return(e<<32-r|t>>>r)>>>0},ll.shr64_hi=function(e,t,r){return e>>>r},ll.shr64_lo=function(e,t,r){return(e<<32-r|t>>>r)>>>0};var wl={},xl=ll,kl=hl;function Sl(){this.pending=null,this.pendingTotal=0,this.blockSize=this.constructor.blockSize,this.outSize=this.constructor.outSize,this.hmacStrength=this.constructor.hmacStrength,this.padLength=this.constructor.padLength/8,this.endian="big",this._delta8=this.blockSize/8,this._delta32=this.blockSize/32}wl.BlockHash=Sl,Sl.prototype.update=function(e,t){if(e=xl.toArray(e,t),this.pending?this.pending=this.pending.concat(e):this.pending=e,this.pendingTotal+=e.length,this.pending.length>=this._delta8){var r=(e=this.pending).length%this._delta8;this.pending=e.slice(e.length-r,e.length),0===this.pending.length&&(this.pending=null),e=xl.join32(e,0,e.length-r,this.endian);for(var n=0;n<e.length;n+=this._delta32)this._update(e,n,n+this._delta32)}return this},Sl.prototype.digest=function(e){return this.update(this._pad()),kl(null===this.pending),this._digest(e)},Sl.prototype._pad=function(){var e=this.pendingTotal,t=this._delta8,r=t-(e+this.padLength)%t,n=new Array(r+this.padLength);n[0]=128;for(var i=1;i<r;i++)n[i]=0;if(e<<=3,"big"===this.endian){for(var o=8;o<this.padLength;o++)n[i++]=0;n[i++]=0,n[i++]=0,n[i++]=0,n[i++]=0,n[i++]=e>>>24&255,n[i++]=e>>>16&255,n[i++]=e>>>8&255,n[i++]=255&e}else for(n[i++]=255&e,n[i++]=e>>>8&255,n[i++]=e>>>16&255,n[i++]=e>>>24&255,n[i++]=0,n[i++]=0,n[i++]=0,n[i++]=0,o=8;o<this.padLength;o++)n[i++]=0;return n};var El={},Al={},Nl=ll.rotr32;function Tl(e,t,r){return e&t^~e&r}function Pl(e,t,r){return e&t^e&r^t&r}function Ml(e,t,r){return e^t^r}Al.ft_1=function(e,t,r,n){return 0===e?Tl(t,r,n):1===e||3===e?Ml(t,r,n):2===e?Pl(t,r,n):void 0},Al.ch32=Tl,Al.maj32=Pl,Al.p32=Ml,Al.s0_256=function(e){return Nl(e,2)^Nl(e,13)^Nl(e,22)},Al.s1_256=function(e){return Nl(e,6)^Nl(e,11)^Nl(e,25)},Al.g0_256=function(e){return Nl(e,7)^Nl(e,18)^e>>>3},Al.g1_256=function(e){return Nl(e,17)^Nl(e,19)^e>>>10};var Il=ll,Cl=wl,Rl=Al,Bl=Il.rotl32,Ol=Il.sum32,Ll=Il.sum32_5,zl=Rl.ft_1,Ul=Cl.BlockHash,_l=[1518500249,1859775393,2400959708,3395469782];function ql(){if(!(this instanceof ql))return new ql;Ul.call(this),this.h=[1732584193,4023233417,2562383102,271733878,3285377520],this.W=new Array(80)}Il.inherits(ql,Ul);var Dl=ql;ql.blockSize=512,ql.outSize=160,ql.hmacStrength=80,ql.padLength=64,ql.prototype._update=function(e,t){for(var r=this.W,n=0;n<16;n++)r[n]=e[t+n];for(;n<r.length;n++)r[n]=Bl(r[n-3]^r[n-8]^r[n-14]^r[n-16],1);var i=this.h[0],o=this.h[1],s=this.h[2],a=this.h[3],c=this.h[4];for(n=0;n<r.length;n++){var u=~~(n/20),l=Ll(Bl(i,5),zl(u,o,s,a),c,r[n],_l[u]);c=a,a=s,s=Bl(o,30),o=i,i=l}this.h[0]=Ol(this.h[0],i),this.h[1]=Ol(this.h[1],o),this.h[2]=Ol(this.h[2],s),this.h[3]=Ol(this.h[3],a),this.h[4]=Ol(this.h[4],c)},ql.prototype._digest=function(e){return"hex"===e?Il.toHex32(this.h,"big"):Il.split32(this.h,"big")};var Vl=ll,jl=wl,Fl=Al,Hl=hl,Wl=Vl.sum32,Kl=Vl.sum32_4,Xl=Vl.sum32_5,Gl=Fl.ch32,Zl=Fl.maj32,Jl=Fl.s0_256,Yl=Fl.s1_256,Ql=Fl.g0_256,$l=Fl.g1_256,eh=jl.BlockHash,th=[1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298];function rh(){if(!(this instanceof rh))return new rh;eh.call(this),this.h=[1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225],this.k=th,this.W=new Array(64)}Vl.inherits(rh,eh);var nh=rh;rh.blockSize=512,rh.outSize=256,rh.hmacStrength=192,rh.padLength=64,rh.prototype._update=function(e,t){for(var r=this.W,n=0;n<16;n++)r[n]=e[t+n];for(;n<r.length;n++)r[n]=Kl($l(r[n-2]),r[n-7],Ql(r[n-15]),r[n-16]);var i=this.h[0],o=this.h[1],s=this.h[2],a=this.h[3],c=this.h[4],u=this.h[5],l=this.h[6],h=this.h[7];for(Hl(this.k.length===r.length),n=0;n<r.length;n++){var d=Xl(h,Yl(c),Gl(c,u,l),this.k[n],r[n]),f=Wl(Jl(i),Zl(i,o,s));h=l,l=u,u=c,c=Wl(a,d),a=s,s=o,o=i,i=Wl(d,f)}this.h[0]=Wl(this.h[0],i),this.h[1]=Wl(this.h[1],o),this.h[2]=Wl(this.h[2],s),this.h[3]=Wl(this.h[3],a),this.h[4]=Wl(this.h[4],c),this.h[5]=Wl(this.h[5],u),this.h[6]=Wl(this.h[6],l),this.h[7]=Wl(this.h[7],h)},rh.prototype._digest=function(e){return"hex"===e?Vl.toHex32(this.h,"big"):Vl.split32(this.h,"big")};var ih=ll,oh=nh;function sh(){if(!(this instanceof sh))return new sh;oh.call(this),this.h=[3238371032,914150663,812702999,4144912697,4290775857,1750603025,1694076839,3204075428]}ih.inherits(sh,oh);var ah=sh;sh.blockSize=512,sh.outSize=224,sh.hmacStrength=192,sh.padLength=64,sh.prototype._digest=function(e){return"hex"===e?ih.toHex32(this.h.slice(0,7),"big"):ih.split32(this.h.slice(0,7),"big")};var ch=ll,uh=wl,lh=hl,hh=ch.rotr64_hi,dh=ch.rotr64_lo,fh=ch.shr64_hi,ph=ch.shr64_lo,mh=ch.sum64,gh=ch.sum64_hi,yh=ch.sum64_lo,bh=ch.sum64_4_hi,vh=ch.sum64_4_lo,wh=ch.sum64_5_hi,xh=ch.sum64_5_lo,kh=uh.BlockHash,Sh=[1116352408,3609767458,1899447441,602891725,3049323471,3964484399,3921009573,2173295548,961987163,4081628472,1508970993,3053834265,2453635748,2937671579,2870763221,3664609560,3624381080,2734883394,310598401,1164996542,607225278,1323610764,1426881987,3590304994,1925078388,4068182383,2162078206,991336113,2614888103,633803317,3248222580,3479774868,3835390401,2666613458,4022224774,944711139,264347078,2341262773,604807628,2007800933,770255983,1495990901,1249150122,1856431235,1555081692,3175218132,1996064986,2198950837,2554220882,3999719339,2821834349,766784016,2952996808,2566594879,3210313671,3203337956,3336571891,1034457026,3584528711,2466948901,113926993,3758326383,338241895,168717936,666307205,1188179964,773529912,1546045734,1294757372,1522805485,1396182291,2643833823,1695183700,2343527390,1986661051,1014477480,2177026350,1206759142,2456956037,344077627,2730485921,1290863460,2820302411,3158454273,3259730800,3505952657,3345764771,106217008,3516065817,3606008344,3600352804,1432725776,4094571909,1467031594,275423344,851169720,430227734,3100823752,506948616,1363258195,659060556,3750685593,883997877,3785050280,958139571,3318307427,1322822218,3812723403,1537002063,2003034995,1747873779,3602036899,1955562222,1575990012,2024104815,1125592928,2227730452,2716904306,2361852424,442776044,2428436474,593698344,2756734187,3733110249,3204031479,2999351573,3329325298,3815920427,3391569614,3928383900,3515267271,566280711,3940187606,3454069534,4118630271,4000239992,116418474,1914138554,174292421,2731055270,289380356,3203993006,460393269,320620315,685471733,587496836,852142971,1086792851,1017036298,365543100,1126000580,2618297676,1288033470,3409855158,1501505948,4234509866,1607167915,987167468,1816402316,1246189591];function Eh(){if(!(this instanceof Eh))return new Eh;kh.call(this),this.h=[1779033703,4089235720,3144134277,2227873595,1013904242,4271175723,2773480762,1595750129,1359893119,2917565137,2600822924,725511199,528734635,4215389547,1541459225,327033209],this.k=Sh,this.W=new Array(160)}ch.inherits(Eh,kh);var Ah=Eh;function Nh(e,t,r,n,i){var o=e&r^~e&i;return o<0&&(o+=4294967296),o}function Th(e,t,r,n,i,o){var s=t&n^~t&o;return s<0&&(s+=4294967296),s}function Ph(e,t,r,n,i){var o=e&r^e&i^r&i;return o<0&&(o+=4294967296),o}function Mh(e,t,r,n,i,o){var s=t&n^t&o^n&o;return s<0&&(s+=4294967296),s}function Ih(e,t){var r=hh(e,t,28)^hh(t,e,2)^hh(t,e,7);return r<0&&(r+=4294967296),r}function Ch(e,t){var r=dh(e,t,28)^dh(t,e,2)^dh(t,e,7);return r<0&&(r+=4294967296),r}function Rh(e,t){var r=hh(e,t,14)^hh(e,t,18)^hh(t,e,9);return r<0&&(r+=4294967296),r}function Bh(e,t){var r=dh(e,t,14)^dh(e,t,18)^dh(t,e,9);return r<0&&(r+=4294967296),r}function Oh(e,t){var r=hh(e,t,1)^hh(e,t,8)^fh(e,t,7);return r<0&&(r+=4294967296),r}function Lh(e,t){var r=dh(e,t,1)^dh(e,t,8)^ph(e,t,7);return r<0&&(r+=4294967296),r}function zh(e,t){var r=hh(e,t,19)^hh(t,e,29)^fh(e,t,6);return r<0&&(r+=4294967296),r}function Uh(e,t){var r=dh(e,t,19)^dh(t,e,29)^ph(e,t,6);return r<0&&(r+=4294967296),r}Eh.blockSize=1024,Eh.outSize=512,Eh.hmacStrength=192,Eh.padLength=128,Eh.prototype._prepareBlock=function(e,t){for(var r=this.W,n=0;n<32;n++)r[n]=e[t+n];for(;n<r.length;n+=2){var i=zh(r[n-4],r[n-3]),o=Uh(r[n-4],r[n-3]),s=r[n-14],a=r[n-13],c=Oh(r[n-30],r[n-29]),u=Lh(r[n-30],r[n-29]),l=r[n-32],h=r[n-31];r[n]=bh(i,o,s,a,c,u,l,h),r[n+1]=vh(i,o,s,a,c,u,l,h)}},Eh.prototype._update=function(e,t){this._prepareBlock(e,t);var r=this.W,n=this.h[0],i=this.h[1],o=this.h[2],s=this.h[3],a=this.h[4],c=this.h[5],u=this.h[6],l=this.h[7],h=this.h[8],d=this.h[9],f=this.h[10],p=this.h[11],m=this.h[12],g=this.h[13],y=this.h[14],b=this.h[15];lh(this.k.length===r.length);for(var v=0;v<r.length;v+=2){var w=y,x=b,k=Rh(h,d),S=Bh(h,d),E=Nh(h,d,f,p,m),A=Th(h,d,f,p,m,g),N=this.k[v],T=this.k[v+1],P=r[v],M=r[v+1],I=wh(w,x,k,S,E,A,N,T,P,M),C=xh(w,x,k,S,E,A,N,T,P,M);w=Ih(n,i),x=Ch(n,i),k=Ph(n,i,o,s,a),S=Mh(n,i,o,s,a,c);var R=gh(w,x,k,S),B=yh(w,x,k,S);y=m,b=g,m=f,g=p,f=h,p=d,h=gh(u,l,I,C),d=yh(l,l,I,C),u=a,l=c,a=o,c=s,o=n,s=i,n=gh(I,C,R,B),i=yh(I,C,R,B)}mh(this.h,0,n,i),mh(this.h,2,o,s),mh(this.h,4,a,c),mh(this.h,6,u,l),mh(this.h,8,h,d),mh(this.h,10,f,p),mh(this.h,12,m,g),mh(this.h,14,y,b)},Eh.prototype._digest=function(e){return"hex"===e?ch.toHex32(this.h,"big"):ch.split32(this.h,"big")};var _h=ll,qh=Ah;function Dh(){if(!(this instanceof Dh))return new Dh;qh.call(this),this.h=[3418070365,3238371032,1654270250,914150663,2438529370,812702999,355462360,4144912697,1731405415,4290775857,2394180231,1750603025,3675008525,1694076839,1203062813,3204075428]}_h.inherits(Dh,qh);var Vh=Dh;Dh.blockSize=1024,Dh.outSize=384,Dh.hmacStrength=192,Dh.padLength=128,Dh.prototype._digest=function(e){return"hex"===e?_h.toHex32(this.h.slice(0,12),"big"):_h.split32(this.h.slice(0,12),"big")},El.sha1=Dl,El.sha224=ah,El.sha256=nh,El.sha384=Vh,El.sha512=Ah;var jh={},Fh=ll,Hh=wl,Wh=Fh.rotl32,Kh=Fh.sum32,Xh=Fh.sum32_3,Gh=Fh.sum32_4,Zh=Hh.BlockHash;function Jh(){if(!(this instanceof Jh))return new Jh;Zh.call(this),this.h=[1732584193,4023233417,2562383102,271733878,3285377520],this.endian="little"}function Yh(e,t,r,n){return e<=15?t^r^n:e<=31?t&r|~t&n:e<=47?(t|~r)^n:e<=63?t&n|r&~n:t^(r|~n)}function Qh(e){return e<=15?0:e<=31?1518500249:e<=47?1859775393:e<=63?2400959708:2840853838}function $h(e){return e<=15?1352829926:e<=31?1548603684:e<=47?1836072691:e<=63?2053994217:0}Fh.inherits(Jh,Zh),jh.ripemd160=Jh,Jh.blockSize=512,Jh.outSize=160,Jh.hmacStrength=192,Jh.padLength=64,Jh.prototype._update=function(e,t){for(var r=this.h[0],n=this.h[1],i=this.h[2],o=this.h[3],s=this.h[4],a=r,c=n,u=i,l=o,h=s,d=0;d<80;d++){var f=Kh(Wh(Gh(r,Yh(d,n,i,o),e[ed[d]+t],Qh(d)),rd[d]),s);r=s,s=o,o=Wh(i,10),i=n,n=f,f=Kh(Wh(Gh(a,Yh(79-d,c,u,l),e[td[d]+t],$h(d)),nd[d]),h),a=h,h=l,l=Wh(u,10),u=c,c=f}f=Xh(this.h[1],i,l),this.h[1]=Xh(this.h[2],o,h),this.h[2]=Xh(this.h[3],s,a),this.h[3]=Xh(this.h[4],r,c),this.h[4]=Xh(this.h[0],n,u),this.h[0]=f},Jh.prototype._digest=function(e){return"hex"===e?Fh.toHex32(this.h,"little"):Fh.split32(this.h,"little")};var ed=[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,7,4,13,1,10,6,15,3,12,0,9,5,2,14,11,8,3,10,14,4,9,15,8,1,2,7,0,6,13,11,5,12,1,9,11,10,0,8,12,4,13,3,7,15,14,5,6,2,4,0,5,9,7,12,2,10,14,1,3,8,11,6,15,13],td=[5,14,7,0,9,2,11,4,13,6,15,8,1,10,3,12,6,11,3,7,0,13,5,10,14,15,8,12,4,9,1,2,15,5,1,3,7,14,6,9,11,8,12,2,10,0,4,13,8,6,4,1,3,11,15,0,5,12,2,13,9,7,10,14,12,15,10,4,1,5,8,7,6,2,13,14,0,3,9,11],rd=[11,14,15,12,5,8,7,9,11,13,14,15,6,7,9,8,7,6,8,13,11,9,7,15,7,12,15,9,11,7,13,12,11,13,6,7,14,9,13,15,14,8,13,6,5,12,7,5,11,12,14,15,14,15,9,8,9,14,5,6,8,6,5,12,9,15,5,11,6,8,13,12,5,12,13,14,11,8,5,6],nd=[8,9,9,11,13,15,15,5,7,7,8,11,14,14,12,6,9,13,15,7,12,8,9,11,7,7,12,7,6,15,13,11,9,7,15,11,8,6,6,14,12,13,5,14,13,13,7,5,15,5,8,11,14,14,6,14,6,9,12,9,12,5,15,8,8,5,12,9,12,5,14,6,8,13,6,5,15,13,11,11],id=ll,od=hl;function sd(e,t,r){if(!(this instanceof sd))return new sd(e,t,r);this.Hash=e,this.blockSize=e.blockSize/8,this.outSize=e.outSize/8,this.inner=null,this.outer=null,this._init(id.toArray(t,r))}var ad=sd;sd.prototype._init=function(e){e.length>this.blockSize&&(e=(new this.Hash).update(e).digest()),od(e.length<=this.blockSize);for(var t=e.length;t<this.blockSize;t++)e.push(0);for(t=0;t<e.length;t++)e[t]^=54;for(this.inner=(new this.Hash).update(e),t=0;t<e.length;t++)e[t]^=106;this.outer=(new this.Hash).update(e)},sd.prototype.update=function(e,t){return this.inner.update(e,t),this},sd.prototype.digest=function(e){return this.outer.update(this.inner.digest()),this.outer.digest(e)},function(e){var t=e;t.utils=ll,t.common=wl,t.sha=El,t.ripemd=jh,t.hmac=ad,t.sha1=t.sha.sha1,t.sha256=t.sha.sha256,t.sha224=t.sha.sha224,t.sha384=t.sha.sha384,t.sha512=t.sha.sha512,t.ripemd160=t.ripemd.ripemd160}(ul);var cd=ul;let ud=!1,ld=!1;const hd={debug:1,default:2,info:2,warning:3,error:4,off:5};let dd=hd.default,fd=null;const pd=function(){try{const e=[];if(["NFD","NFC","NFKD","NFKC"].forEach((t=>{try{if("test"!=="test".normalize(t))throw new Error("bad normalize")}catch(h2){e.push(t)}})),e.length)throw new Error("missing "+e.join(", "));if(String.fromCharCode(233).normalize("NFD")!==String.fromCharCode(101,769))throw new Error("broken implementation")}catch(h2){return h2.message}return null}();var md,gd;!function(e){e.DEBUG="DEBUG",e.INFO="INFO",e.WARNING="WARNING",e.ERROR="ERROR",e.OFF="OFF"}(md||(md={})),function(e){e.UNKNOWN_ERROR="UNKNOWN_ERROR",e.NOT_IMPLEMENTED="NOT_IMPLEMENTED",e.UNSUPPORTED_OPERATION="UNSUPPORTED_OPERATION",e.NETWORK_ERROR="NETWORK_ERROR",e.SERVER_ERROR="SERVER_ERROR",e.TIMEOUT="TIMEOUT",e.BUFFER_OVERRUN="BUFFER_OVERRUN",e.NUMERIC_FAULT="NUMERIC_FAULT",e.MISSING_NEW="MISSING_NEW",e.INVALID_ARGUMENT="INVALID_ARGUMENT",e.MISSING_ARGUMENT="MISSING_ARGUMENT",e.UNEXPECTED_ARGUMENT="UNEXPECTED_ARGUMENT",e.CALL_EXCEPTION="CALL_EXCEPTION",e.INSUFFICIENT_FUNDS="INSUFFICIENT_FUNDS",e.NONCE_EXPIRED="NONCE_EXPIRED",e.REPLACEMENT_UNDERPRICED="REPLACEMENT_UNDERPRICED",e.UNPREDICTABLE_GAS_LIMIT="UNPREDICTABLE_GAS_LIMIT",e.TRANSACTION_REPLACED="TRANSACTION_REPLACED"}(gd||(gd={}));const yd="0123456789abcdef";class bd{constructor(e){Object.defineProperty(this,"version",{enumerable:!0,value:e,writable:!1})}_log(e,t){const r=e.toLowerCase();null==hd[r]&&this.throwArgumentError("invalid log level name","logLevel",e),dd>hd[r]||console.log.apply(console,t)}debug(...e){this._log(bd.levels.DEBUG,e)}info(...e){this._log(bd.levels.INFO,e)}warn(...e){this._log(bd.levels.WARNING,e)}makeError(e,t,r){if(ld)return this.makeError("censored error",t,{});t||(t=bd.errors.UNKNOWN_ERROR),r||(r={});const n=[];Object.keys(r).forEach((e=>{const t=r[e];try{if(t instanceof Uint8Array){let r="";for(let e=0;e<t.length;e++)r+=yd[t[e]>>4],r+=yd[15&t[e]];n.push(e+"=Uint8Array(0x"+r+")")}else n.push(e+"="+JSON.stringify(t))}catch(s){n.push(e+"="+JSON.stringify(r[e].toString()))}})),n.push(`code=${t}`),n.push(`version=${this.version}`);const i=e;let o="";switch(t){case gd.NUMERIC_FAULT:{o="NUMERIC_FAULT";const t=e;switch(t){case"overflow":case"underflow":case"division-by-zero":o+="-"+t;break;case"negative-power":case"negative-width":o+="-unsupported";break;case"unbound-bitwise-result":o+="-unbound-result"}break}case gd.CALL_EXCEPTION:case gd.INSUFFICIENT_FUNDS:case gd.MISSING_NEW:case gd.NONCE_EXPIRED:case gd.REPLACEMENT_UNDERPRICED:case gd.TRANSACTION_REPLACED:case gd.UNPREDICTABLE_GAS_LIMIT:o=t}o&&(e+=" [ See: https://links.ethers.org/v5-errors-"+o+" ]"),n.length&&(e+=" ("+n.join(", ")+")");const s=new Error(e);return s.reason=i,s.code=t,Object.keys(r).forEach((function(e){s[e]=r[e]})),s}throwError(e,t,r){throw this.makeError(e,t,r)}throwArgumentError(e,t,r){return this.throwError(e,bd.errors.INVALID_ARGUMENT,{argument:t,value:r})}assert(e,t,r,n){e||this.throwError(t,r,n)}assertArgument(e,t,r,n){e||this.throwArgumentError(t,r,n)}checkNormalize(e){pd&&this.throwError("platform missing String.prototype.normalize",bd.errors.UNSUPPORTED_OPERATION,{operation:"String.prototype.normalize",form:pd})}checkSafeUint53(e,t){"number"==typeof e&&(null==t&&(t="value not safe"),(e<0||e>=9007199254740991)&&this.throwError(t,bd.errors.NUMERIC_FAULT,{operation:"checkSafeInteger",fault:"out-of-safe-range",value:e}),e%1&&this.throwError(t,bd.errors.NUMERIC_FAULT,{operation:"checkSafeInteger",fault:"non-integer",value:e}))}checkArgumentCount(e,t,r){r=r?": "+r:"",e<t&&this.throwError("missing argument"+r,bd.errors.MISSING_ARGUMENT,{count:e,expectedCount:t}),e>t&&this.throwError("too many arguments"+r,bd.errors.UNEXPECTED_ARGUMENT,{count:e,expectedCount:t})}checkNew(e,t){e!==Object&&null!=e||this.throwError("missing new",bd.errors.MISSING_NEW,{name:t.name})}checkAbstract(e,t){e===t?this.throwError("cannot instantiate abstract class "+JSON.stringify(t.name)+" directly; use a sub-class",bd.errors.UNSUPPORTED_OPERATION,{name:e.name,operation:"new"}):e!==Object&&null!=e||this.throwError("missing new",bd.errors.MISSING_NEW,{name:t.name})}static globalLogger(){return fd||(fd=new bd("logger/5.6.0")),fd}static setCensorship(e,t){if(!e&&t&&this.globalLogger().throwError("cannot permanently disable censorship",bd.errors.UNSUPPORTED_OPERATION,{operation:"setCensorship"}),ud){if(!e)return;this.globalLogger().throwError("error censorship permanent",bd.errors.UNSUPPORTED_OPERATION,{operation:"setCensorship"})}ld=!!e,ud=!!t}static setLogLevel(e){const t=hd[e.toLowerCase()];null!=t?dd=t:bd.globalLogger().warn("invalid log level - "+e)}static from(e){return new bd(e)}}bd.errors=gd,bd.levels=md;const vd=new bd("bytes/5.6.0");function wd(e){return e.slice||(e.slice=function(){const t=Array.prototype.slice.call(arguments);return wd(new Uint8Array(Array.prototype.slice.apply(e,t)))}),e}function xd(e){return"number"==typeof e&&e==e&&e%1==0}function kd(e,t){if(t||(t={}),"number"==typeof e){vd.checkSafeUint53(e,"invalid arrayify value");const t=[];for(;e;)t.unshift(255&e),e=parseInt(String(e/256));return 0===t.length&&t.push(0),wd(new Uint8Array(t))}if(t.allowMissingPrefix&&"string"==typeof e&&"0x"!==e.substring(0,2)&&(e="0x"+e),function(e){return!!e.toHexString}(e)&&(e=e.toHexString()),function(e,t){if("string"!=typeof e||!e.match(/^0x[0-9A-Fa-f]*$/))return!1;if(t&&e.length!==2+2*t)return!1;return!0}(e)){let r=e.substring(2);r.length%2&&("left"===t.hexPad?r="0x0"+r.substring(2):"right"===t.hexPad?r+="0":vd.throwArgumentError("hex data is odd-length","value",e));const n=[];for(let e=0;e<r.length;e+=2)n.push(parseInt(r.substring(e,e+2),16));return wd(new Uint8Array(n))}return function(e){if(null==e)return!1;if(e.constructor===Uint8Array)return!0;if("string"==typeof e)return!1;if(!xd(e.length)||e.length<0)return!1;for(let t=0;t<e.length;t++){const r=e[t];if(!xd(r)||r<0||r>=256)return!1}return!0}(e)?wd(new Uint8Array(e)):vd.throwArgumentError("invalid arrayify value","value",e)}function Sd(e){return"0x"+cd.sha256().update(kd(e)).digest("hex")}new bd("sha2/5.6.0");class Ed{constructor(e){Object.assign(this,e)}encode(){return yu.Buffer.from((0,ku.serialize)(Ad,this))}static decode(e){return(0,ku.deserialize)(Ad,this,e)}static decodeUnchecked(e){return(0,ku.deserializeUnchecked)(Ad,this,e)}}const Ad=new Map;class Nd extends Ed{constructor(e){if(super({}),this._bn=void 0,function(e){return void 0!==e._bn}(e))this._bn=e._bn;else{if("string"==typeof e){const t=xu().decode(e);if(32!=t.length)throw new Error("Invalid public key input");this._bn=new(vu())(t)}else this._bn=new(vu())(e);if(this._bn.byteLength()>32)throw new Error("Invalid public key input")}}equals(e){return this._bn.eq(e._bn)}toBase58(){return xu().encode(this.toBytes())}toJSON(){return this.toBase58()}toBytes(){return this.toBuffer()}toBuffer(){const e=this._bn.toArrayLike(yu.Buffer);if(32===e.length)return e;const t=yu.Buffer.alloc(32);return e.copy(t,32-e.length),t}toString(){return this.toBase58()}static async createWithSeed(e,t,r){const n=yu.Buffer.concat([e.toBuffer(),yu.Buffer.from(t),r.toBuffer()]),i=Sd(new Uint8Array(n)).slice(2);return new Nd(yu.Buffer.from(i,"hex"))}static createProgramAddressSync(e,t){let r=yu.Buffer.alloc(0);e.forEach((function(e){if(e.length>32)throw new TypeError("Max seed length exceeded");r=yu.Buffer.concat([r,sl(e)])})),r=yu.Buffer.concat([r,t.toBuffer(),yu.Buffer.from("ProgramDerivedAddress")]);let n=Sd(new Uint8Array(r)).slice(2),i=new(vu())(n,16).toArray(void 0,32);if(Pd(i))throw new Error("Invalid seeds, address must fall off the curve");return new Nd(i)}static async createProgramAddress(e,t){return this.createProgramAddressSync(e,t)}static findProgramAddressSync(e,t){let r,n=255;for(;0!=n;){try{const i=e.concat(yu.Buffer.from([n]));r=this.createProgramAddressSync(i,t)}catch(i){if(i instanceof TypeError)throw i;n--;continue}return[r,n]}throw new Error("Unable to find a viable program address nonce")}static async findProgramAddress(e,t){return this.findProgramAddressSync(e,t)}static isOnCurve(e){return 1==Pd(new Nd(e).toBytes())}}Nd.default=new Nd("11111111111111111111111111111111"),Ad.set(Nd,{kind:"struct",fields:[["_bn","u256"]]});let Td=gu().lowlevel;function Pd(e){var t=[Td.gf(),Td.gf(),Td.gf(),Td.gf()],r=Td.gf(),n=Td.gf(),i=Td.gf(),o=Td.gf(),s=Td.gf(),a=Td.gf(),c=Td.gf();return Td.set25519(t[2],Md),Td.unpack25519(t[1],e),Td.S(i,t[1]),Td.M(o,i,Td.D),Td.Z(i,i,t[2]),Td.A(o,t[2],o),Td.S(s,o),Td.S(a,s),Td.M(c,a,s),Td.M(r,c,i),Td.M(r,r,o),Td.pow2523(r,r),Td.M(r,r,i),Td.M(r,r,o),Td.M(r,r,o),Td.M(t[0],r,o),Td.S(n,t[0]),Td.M(n,n,o),Cd(n,i)&&Td.M(t[0],t[0],Id),Td.S(n,t[0]),Td.M(n,n,o),Cd(n,i)?0:1}let Md=Td.gf([1]),Id=Td.gf([41136,18958,6951,50414,58488,44335,6150,12099,55207,15867,153,11085,57099,20417,9344,11139]);function Cd(e,t){var r=new Uint8Array(32),n=new Uint8Array(32);return Td.pack25519(r,e),Td.pack25519(n,t),Td.crypto_verify_32(r,0,n,0)}new Nd("BPFLoader1111111111111111111111111111111111");const Rd=1232,Bd=(e="publicKey")=>Su.Ik(32,e),Od=(e="string")=>{const t=Su.n_([Su.Jq("length"),Su.Jq("lengthPadding"),Su.Ik(Su.cv(Su.Jq(),-8),"chars")],e),r=t.decode.bind(t),n=t.encode.bind(t),i=t;return i.decode=(e,t)=>r(e,t).chars.toString(),i.encode=(e,t,r)=>{const i={chars:yu.Buffer.from(e,"utf8")};return n(i,t,r)},i.alloc=e=>Su.Jq().span+Su.Jq().span+yu.Buffer.from(e,"utf8").length,i};function Ld(e){let t=0,r=0;for(;;){let n=e.shift();if(t|=(127&n)<<7*r,r+=1,0==(128&n))break}return t}function zd(e,t){let r=t;for(;;){let t=127&r;if(r>>=7,0==r){e.push(t);break}t|=128,e.push(t)}}class Ud{constructor(e){this.header=void 0,this.accountKeys=void 0,this.recentBlockhash=void 0,this.instructions=void 0,this.indexToProgramIds=new Map,this.header=e.header,this.accountKeys=e.accountKeys.map((e=>new Nd(e))),this.recentBlockhash=e.recentBlockhash,this.instructions=e.instructions,this.instructions.forEach((e=>this.indexToProgramIds.set(e.programIdIndex,this.accountKeys[e.programIdIndex])))}isAccountSigner(e){return e<this.header.numRequiredSignatures}isAccountWritable(e){return e<this.header.numRequiredSignatures-this.header.numReadonlySignedAccounts||e>=this.header.numRequiredSignatures&&e<this.accountKeys.length-this.header.numReadonlyUnsignedAccounts}isProgramId(e){return this.indexToProgramIds.has(e)}programIds(){return[...this.indexToProgramIds.values()]}nonProgramIds(){return this.accountKeys.filter(((e,t)=>!this.isProgramId(t)))}serialize(){const e=this.accountKeys.length;let t=[];zd(t,e);const r=this.instructions.map((e=>{const{accounts:t,programIdIndex:r}=e,n=Array.from(xu().decode(e.data));let i=[];zd(i,t.length);let o=[];return zd(o,n.length),{programIdIndex:r,keyIndicesCount:yu.Buffer.from(i),keyIndices:t,dataLength:yu.Buffer.from(o),data:n}}));let n=[];zd(n,r.length);let i=yu.Buffer.alloc(Rd);yu.Buffer.from(n).copy(i);let o=n.length;r.forEach((e=>{const t=Su.n_([Su.u8("programIdIndex"),Su.Ik(e.keyIndicesCount.length,"keyIndicesCount"),Su.A9(Su.u8("keyIndex"),e.keyIndices.length,"keyIndices"),Su.Ik(e.dataLength.length,"dataLength"),Su.A9(Su.u8("userdatum"),e.data.length,"data")]).encode(e,i,o);o+=t})),i=i.slice(0,o);const s=Su.n_([Su.Ik(1,"numRequiredSignatures"),Su.Ik(1,"numReadonlySignedAccounts"),Su.Ik(1,"numReadonlyUnsignedAccounts"),Su.Ik(t.length,"keyCount"),Su.A9(Bd("key"),e,"keys"),Bd("recentBlockhash")]),a={numRequiredSignatures:yu.Buffer.from([this.header.numRequiredSignatures]),numReadonlySignedAccounts:yu.Buffer.from([this.header.numReadonlySignedAccounts]),numReadonlyUnsignedAccounts:yu.Buffer.from([this.header.numReadonlyUnsignedAccounts]),keyCount:yu.Buffer.from(t),keys:this.accountKeys.map((e=>sl(e.toBytes()))),recentBlockhash:xu().decode(this.recentBlockhash)};let c=yu.Buffer.alloc(2048);const u=s.encode(a,c);return i.copy(c,u),c.slice(0,u+i.length)}static from(e){let t=[...e];const r=t.shift(),n=t.shift(),i=t.shift(),o=Ld(t);let s=[];for(let h=0;h<o;h++){const e=t.slice(0,32);t=t.slice(32),s.push(xu().encode(yu.Buffer.from(e)))}const a=t.slice(0,32);t=t.slice(32);const c=Ld(t);let u=[];for(let h=0;h<c;h++){const e=t.shift(),r=Ld(t),n=t.slice(0,r);t=t.slice(r);const i=Ld(t),o=t.slice(0,i),s=xu().encode(yu.Buffer.from(o));t=t.slice(i),u.push({programIdIndex:e,accounts:n,data:s})}const l={header:{numRequiredSignatures:r,numReadonlySignedAccounts:n,numReadonlyUnsignedAccounts:i},recentBlockhash:xu().encode(yu.Buffer.from(a)),accountKeys:s,instructions:u};return new Ud(l)}}function _d(e,t){if(!e)throw new Error(t||"Assertion failed")}let qd;!function(e){e[e.BLOCKHEIGHT_EXCEEDED=0]="BLOCKHEIGHT_EXCEEDED",e[e.PROCESSED=1]="PROCESSED",e[e.TIMED_OUT=2]="TIMED_OUT"}(qd||(qd={}));const Dd=yu.Buffer.alloc(64).fill(0);class Vd{constructor(e){this.keys=void 0,this.programId=void 0,this.data=yu.Buffer.alloc(0),this.programId=e.programId,this.keys=e.keys,e.data&&(this.data=e.data)}toJSON(){return{keys:this.keys.map((({pubkey:e,isSigner:t,isWritable:r})=>({pubkey:e.toJSON(),isSigner:t,isWritable:r}))),programId:this.programId.toJSON(),data:[...this.data]}}}class jd{get signature(){return this.signatures.length>0?this.signatures[0].signature:null}constructor(e){if(this.signatures=[],this.feePayer=void 0,this.instructions=[],this.recentBlockhash=void 0,this.lastValidBlockHeight=void 0,this.nonceInfo=void 0,this._message=void 0,this._json=void 0,e)if(Object.prototype.hasOwnProperty.call(e,"lastValidBlockHeight")){const t=e;Object.assign(this,t),this.recentBlockhash=t.blockhash,this.lastValidBlockHeight=t.lastValidBlockHeight}else{const t=e;Object.assign(this,t),this.recentBlockhash=t.recentBlockhash}}toJSON(){return{recentBlockhash:this.recentBlockhash||null,feePayer:this.feePayer?this.feePayer.toJSON():null,nonceInfo:this.nonceInfo?{nonce:this.nonceInfo.nonce,nonceInstruction:this.nonceInfo.nonceInstruction.toJSON()}:null,instructions:this.instructions.map((e=>e.toJSON())),signers:this.signatures.map((({publicKey:e})=>e.toJSON()))}}add(...e){if(0===e.length)throw new Error("No instructions");return e.forEach((e=>{"instructions"in e?this.instructions=this.instructions.concat(e.instructions):"data"in e&&"programId"in e&&"keys"in e?this.instructions.push(e):this.instructions.push(new Vd(e))})),this}compileMessage(){if(this._message&&JSON.stringify(this.toJSON())===JSON.stringify(this._json))return this._message;const{nonceInfo:e}=this;e&&this.instructions[0]!=e.nonceInstruction&&(this.recentBlockhash=e.nonce,this.instructions.unshift(e.nonceInstruction));const{recentBlockhash:t}=this;if(!t)throw new Error("Transaction recentBlockhash required");let r;if(this.instructions.length<1&&console.warn("No instructions provided"),this.feePayer)r=this.feePayer;else{if(!(this.signatures.length>0&&this.signatures[0].publicKey))throw new Error("Transaction fee payer required");r=this.signatures[0].publicKey}for(let p=0;p<this.instructions.length;p++)if(void 0===this.instructions[p].programId)throw new Error(`Transaction instruction index ${p} has undefined program id`);const n=[],i=[];this.instructions.forEach((e=>{e.keys.forEach((e=>{i.push({...e})}));const t=e.programId.toString();n.includes(t)||n.push(t)})),n.forEach((e=>{i.push({pubkey:new Nd(e),isSigner:!1,isWritable:!1})})),i.sort((function(e,t){const r=e.pubkey.toBase58().localeCompare(t.pubkey.toBase58()),n=e.isSigner===t.isSigner?0:e.isSigner?-1:1,i=e.isWritable===t.isWritable?r:e.isWritable?-1:1;return n||i}));const o=[];i.forEach((e=>{const t=e.pubkey.toString(),r=o.findIndex((e=>e.pubkey.toString()===t));r>-1?o[r].isWritable=o[r].isWritable||e.isWritable:o.push(e)}));const s=o.findIndex((e=>e.pubkey.equals(r)));if(s>-1){const[e]=o.splice(s,1);e.isSigner=!0,e.isWritable=!0,o.unshift(e)}else o.unshift({pubkey:r,isSigner:!0,isWritable:!0});for(const p of this.signatures){const e=o.findIndex((e=>e.pubkey.equals(p.publicKey)));if(!(e>-1))throw new Error(`unknown signer: ${p.publicKey.toString()}`);o[e].isSigner||(o[e].isSigner=!0,console.warn("Transaction references a signature that is unnecessary, only the fee payer and instruction signer accounts should sign a transaction. This behavior is deprecated and will throw an error in the next major version release."))}let a=0,c=0,u=0;const l=[],h=[];o.forEach((({pubkey:e,isSigner:t,isWritable:r})=>{t?(l.push(e.toString()),a+=1,r||(c+=1)):(h.push(e.toString()),r||(u+=1))}));const d=l.concat(h),f=this.instructions.map((e=>{const{data:t,programId:r}=e;return{programIdIndex:d.indexOf(r.toString()),accounts:e.keys.map((e=>d.indexOf(e.pubkey.toString()))),data:xu().encode(t)}}));return f.forEach((e=>{_d(e.programIdIndex>=0),e.accounts.forEach((e=>_d(e>=0)))})),new Ud({header:{numRequiredSignatures:a,numReadonlySignedAccounts:c,numReadonlyUnsignedAccounts:u},accountKeys:d,recentBlockhash:t,instructions:f})}_compile(){const e=this.compileMessage(),t=e.accountKeys.slice(0,e.header.numRequiredSignatures);if(this.signatures.length===t.length){const r=this.signatures.every(((e,r)=>t[r].equals(e.publicKey)));if(r)return e}return this.signatures=t.map((e=>({signature:null,publicKey:e}))),e}serializeMessage(){return this._compile().serialize()}async getEstimatedFee(e){return(await e.getFeeForMessage(this.compileMessage())).value}setSigners(...e){if(0===e.length)throw new Error("No signers");const t=new Set;this.signatures=e.filter((e=>{const r=e.toString();return!t.has(r)&&(t.add(r),!0)})).map((e=>({signature:null,publicKey:e})))}sign(...e){if(0===e.length)throw new Error("No signers");const t=new Set,r=[];for(const i of e){const e=i.publicKey.toString();t.has(e)||(t.add(e),r.push(i))}this.signatures=r.map((e=>({signature:null,publicKey:e.publicKey})));const n=this._compile();this._partialSign(n,...r),this._verifySignatures(n.serialize(),!0)}partialSign(...e){if(0===e.length)throw new Error("No signers");const t=new Set,r=[];for(const i of e){const e=i.publicKey.toString();t.has(e)||(t.add(e),r.push(i))}const n=this._compile();this._partialSign(n,...r)}_partialSign(e,...t){const r=e.serialize();t.forEach((e=>{const t=gu().sign.detached(r,e.secretKey);this._addSignature(e.publicKey,sl(t))}))}addSignature(e,t){this._compile(),this._addSignature(e,t)}_addSignature(e,t){_d(64===t.length);const r=this.signatures.findIndex((t=>e.equals(t.publicKey)));if(r<0)throw new Error(`unknown signer: ${e.toString()}`);this.signatures[r].signature=yu.Buffer.from(t)}verifySignatures(){return this._verifySignatures(this.serializeMessage(),!0)}_verifySignatures(e,t){for(const{signature:r,publicKey:n}of this.signatures)if(null===r){if(t)return!1}else if(!gu().sign.detached.verify(e,r,n.toBuffer()))return!1;return!0}serialize(e){const{requireAllSignatures:t,verifySignatures:r}=Object.assign({requireAllSignatures:!0,verifySignatures:!0},e),n=this.serializeMessage();if(r&&!this._verifySignatures(n,t))throw new Error("Signature verification failed");return this._serialize(n)}_serialize(e){const{signatures:t}=this,r=[];zd(r,t.length);const n=r.length+64*t.length+e.length,i=yu.Buffer.alloc(n);return _d(t.length<256),yu.Buffer.from(r).copy(i,0),t.forEach((({signature:e},t)=>{null!==e&&(_d(64===e.length,"signature has invalid length"),yu.Buffer.from(e).copy(i,r.length+64*t))})),e.copy(i,r.length+64*t.length),_d(i.length<=Rd,`Transaction too large: ${i.length} > 1232`),i}get keys(){return _d(1===this.instructions.length),this.instructions[0].keys.map((e=>e.pubkey))}get programId(){return _d(1===this.instructions.length),this.instructions[0].programId}get data(){return _d(1===this.instructions.length),this.instructions[0].data}static from(e){let t=[...e];const r=Ld(t);let n=[];for(let i=0;i<r;i++){const e=t.slice(0,64);t=t.slice(64),n.push(xu().encode(yu.Buffer.from(e)))}return jd.populate(Ud.from(t),n)}static populate(e,t=[]){const r=new jd;return r.recentBlockhash=e.recentBlockhash,e.header.numRequiredSignatures>0&&(r.feePayer=e.accountKeys[0]),t.forEach(((t,n)=>{const i={signature:t==xu().encode(Dd)?null:xu().decode(t),publicKey:e.accountKeys[n]};r.signatures.push(i)})),e.instructions.forEach((t=>{const n=t.accounts.map((t=>{const n=e.accountKeys[t];return{pubkey:n,isSigner:r.signatures.some((e=>e.publicKey.toString()===n.toString()))||e.isAccountSigner(t),isWritable:e.isAccountWritable(t)}}));r.instructions.push(new Vd({keys:n,programId:e.accountKeys[t.programIdIndex],data:xu().decode(t.data)}))})),r._message=e,r._json=r.toJSON(),r}}const Fd=new Nd("SysvarC1ock11111111111111111111111111111111"),Hd=(new Nd("SysvarEpochSchedu1e111111111111111111111111"),new Nd("Sysvar1nstructions1111111111111111111111111"),new Nd("SysvarRecentB1ockHashes11111111111111111111")),Wd=new Nd("SysvarRent111111111111111111111111111111111"),Kd=(new Nd("SysvarRewards111111111111111111111111111111"),new Nd("SysvarS1otHashes111111111111111111111111111"),new Nd("SysvarS1otHistory11111111111111111111111111"),new Nd("SysvarStakeHistory1111111111111111111111111"));async function Xd(e,t,r,n){const i=n&&{skipPreflight:n.skipPreflight,preflightCommitment:n.preflightCommitment||n.commitment,maxRetries:n.maxRetries},o=await e.sendTransaction(t,r,i),s=null!=t.recentBlockhash&&null!=t.lastValidBlockHeight?(await e.confirmTransaction({signature:o,blockhash:t.recentBlockhash,lastValidBlockHeight:t.lastValidBlockHeight},n&&n.commitment)).value:(await e.confirmTransaction(o,n&&n.commitment)).value;if(s.err)throw new Error(`Transaction ${o} failed (${JSON.stringify(s)})`);return o}function Gd(e){return new Promise((t=>setTimeout(t,e)))}function Zd(e,t){const r=e.layout.span>=0?e.layout.span:function(e,t){let r=0;return e.layout.fields.forEach((e=>{e.span>=0?r+=e.span:"function"==typeof e.alloc&&(r+=e.alloc(t[e.property]))})),r}(e,t),n=yu.Buffer.alloc(r),i=Object.assign({instruction:e.index},t);return e.layout.encode(i,n),n}const Jd=Su._O("lamportsPerSignature"),Yd=Su.n_([Su.Jq("version"),Su.Jq("state"),Bd("authorizedPubkey"),Bd("nonce"),Su.n_([Jd],"feeCalculator")]),Qd=Yd.span;class $d{constructor(e){this.authorizedPubkey=void 0,this.nonce=void 0,this.feeCalculator=void 0,this.authorizedPubkey=e.authorizedPubkey,this.nonce=e.nonce,this.feeCalculator=e.feeCalculator}static fromAccountData(e){const t=Yd.decode(sl(e),0);return new $d({authorizedPubkey:new Nd(t.authorizedPubkey),nonce:new Nd(t.nonce).toString(),feeCalculator:t.feeCalculator})}}const ef=Object.freeze({Create:{index:0,layout:Su.n_([Su.Jq("instruction"),Su.gM("lamports"),Su.gM("space"),Bd("programId")])},Assign:{index:1,layout:Su.n_([Su.Jq("instruction"),Bd("programId")])},Transfer:{index:2,layout:Su.n_([Su.Jq("instruction"),Pu("lamports")])},CreateWithSeed:{index:3,layout:Su.n_([Su.Jq("instruction"),Bd("base"),Od("seed"),Su.gM("lamports"),Su.gM("space"),Bd("programId")])},AdvanceNonceAccount:{index:4,layout:Su.n_([Su.Jq("instruction")])},WithdrawNonceAccount:{index:5,layout:Su.n_([Su.Jq("instruction"),Su.gM("lamports")])},InitializeNonceAccount:{index:6,layout:Su.n_([Su.Jq("instruction"),Bd("authorized")])},AuthorizeNonceAccount:{index:7,layout:Su.n_([Su.Jq("instruction"),Bd("authorized")])},Allocate:{index:8,layout:Su.n_([Su.Jq("instruction"),Su.gM("space")])},AllocateWithSeed:{index:9,layout:Su.n_([Su.Jq("instruction"),Bd("base"),Od("seed"),Su.gM("space"),Bd("programId")])},AssignWithSeed:{index:10,layout:Su.n_([Su.Jq("instruction"),Bd("base"),Od("seed"),Bd("programId")])},TransferWithSeed:{index:11,layout:Su.n_([Su.Jq("instruction"),Pu("lamports"),Od("seed"),Bd("programId")])}});class tf{constructor(){}static createAccount(e){const t=Zd(ef.Create,{lamports:e.lamports,space:e.space,programId:sl(e.programId.toBuffer())});return new Vd({keys:[{pubkey:e.fromPubkey,isSigner:!0,isWritable:!0},{pubkey:e.newAccountPubkey,isSigner:!0,isWritable:!0}],programId:this.programId,data:t})}static transfer(e){let t,r;if("basePubkey"in e){t=Zd(ef.TransferWithSeed,{lamports:BigInt(e.lamports),seed:e.seed,programId:sl(e.programId.toBuffer())}),r=[{pubkey:e.fromPubkey,isSigner:!1,isWritable:!0},{pubkey:e.basePubkey,isSigner:!0,isWritable:!1},{pubkey:e.toPubkey,isSigner:!1,isWritable:!0}]}else{t=Zd(ef.Transfer,{lamports:BigInt(e.lamports)}),r=[{pubkey:e.fromPubkey,isSigner:!0,isWritable:!0},{pubkey:e.toPubkey,isSigner:!1,isWritable:!0}]}return new Vd({keys:r,programId:this.programId,data:t})}static assign(e){let t,r;if("basePubkey"in e){t=Zd(ef.AssignWithSeed,{base:sl(e.basePubkey.toBuffer()),seed:e.seed,programId:sl(e.programId.toBuffer())}),r=[{pubkey:e.accountPubkey,isSigner:!1,isWritable:!0},{pubkey:e.basePubkey,isSigner:!0,isWritable:!1}]}else{t=Zd(ef.Assign,{programId:sl(e.programId.toBuffer())}),r=[{pubkey:e.accountPubkey,isSigner:!0,isWritable:!0}]}return new Vd({keys:r,programId:this.programId,data:t})}static createAccountWithSeed(e){const t=Zd(ef.CreateWithSeed,{base:sl(e.basePubkey.toBuffer()),seed:e.seed,lamports:e.lamports,space:e.space,programId:sl(e.programId.toBuffer())});let r=[{pubkey:e.fromPubkey,isSigner:!0,isWritable:!0},{pubkey:e.newAccountPubkey,isSigner:!1,isWritable:!0}];return e.basePubkey!=e.fromPubkey&&r.push({pubkey:e.basePubkey,isSigner:!0,isWritable:!1}),new Vd({keys:r,programId:this.programId,data:t})}static createNonceAccount(e){const t=new jd;"basePubkey"in e&&"seed"in e?t.add(tf.createAccountWithSeed({fromPubkey:e.fromPubkey,newAccountPubkey:e.noncePubkey,basePubkey:e.basePubkey,seed:e.seed,lamports:e.lamports,space:Qd,programId:this.programId})):t.add(tf.createAccount({fromPubkey:e.fromPubkey,newAccountPubkey:e.noncePubkey,lamports:e.lamports,space:Qd,programId:this.programId}));const r={noncePubkey:e.noncePubkey,authorizedPubkey:e.authorizedPubkey};return t.add(this.nonceInitialize(r)),t}static nonceInitialize(e){const t=Zd(ef.InitializeNonceAccount,{authorized:sl(e.authorizedPubkey.toBuffer())}),r={keys:[{pubkey:e.noncePubkey,isSigner:!1,isWritable:!0},{pubkey:Hd,isSigner:!1,isWritable:!1},{pubkey:Wd,isSigner:!1,isWritable:!1}],programId:this.programId,data:t};return new Vd(r)}static nonceAdvance(e){const t=Zd(ef.AdvanceNonceAccount),r={keys:[{pubkey:e.noncePubkey,isSigner:!1,isWritable:!0},{pubkey:Hd,isSigner:!1,isWritable:!1},{pubkey:e.authorizedPubkey,isSigner:!0,isWritable:!1}],programId:this.programId,data:t};return new Vd(r)}static nonceWithdraw(e){const t=Zd(ef.WithdrawNonceAccount,{lamports:e.lamports});return new Vd({keys:[{pubkey:e.noncePubkey,isSigner:!1,isWritable:!0},{pubkey:e.toPubkey,isSigner:!1,isWritable:!0},{pubkey:Hd,isSigner:!1,isWritable:!1},{pubkey:Wd,isSigner:!1,isWritable:!1},{pubkey:e.authorizedPubkey,isSigner:!0,isWritable:!1}],programId:this.programId,data:t})}static nonceAuthorize(e){const t=Zd(ef.AuthorizeNonceAccount,{authorized:sl(e.newAuthorizedPubkey.toBuffer())});return new Vd({keys:[{pubkey:e.noncePubkey,isSigner:!1,isWritable:!0},{pubkey:e.authorizedPubkey,isSigner:!0,isWritable:!1}],programId:this.programId,data:t})}static allocate(e){let t,r;if("basePubkey"in e){t=Zd(ef.AllocateWithSeed,{base:sl(e.basePubkey.toBuffer()),seed:e.seed,space:e.space,programId:sl(e.programId.toBuffer())}),r=[{pubkey:e.accountPubkey,isSigner:!1,isWritable:!0},{pubkey:e.basePubkey,isSigner:!0,isWritable:!1}]}else{t=Zd(ef.Allocate,{space:e.space}),r=[{pubkey:e.accountPubkey,isSigner:!0,isWritable:!0}]}return new Vd({keys:r,programId:this.programId,data:t})}}tf.programId=new Nd("11111111111111111111111111111111");class rf{constructor(){}static getMinNumSignatures(e){return 2*(Math.ceil(e/rf.chunkSize)+1+1)}static async load(e,t,r,n,i){{const o=await e.getMinimumBalanceForRentExemption(i.length),s=await e.getAccountInfo(r.publicKey,"confirmed");let a=null;if(null!==s){if(s.executable)return console.error("Program load failed, account is already executable"),!1;s.data.length!==i.length&&(a=a||new jd,a.add(tf.allocate({accountPubkey:r.publicKey,space:i.length}))),s.owner.equals(n)||(a=a||new jd,a.add(tf.assign({accountPubkey:r.publicKey,programId:n}))),s.lamports<o&&(a=a||new jd,a.add(tf.transfer({fromPubkey:t.publicKey,toPubkey:r.publicKey,lamports:o-s.lamports})))}else a=(new jd).add(tf.createAccount({fromPubkey:t.publicKey,newAccountPubkey:r.publicKey,lamports:o>0?o:1,space:i.length,programId:n}));null!==a&&await Xd(e,a,[t,r],{commitment:"confirmed"})}const o=Su.n_([Su.Jq("instruction"),Su.Jq("offset"),Su.Jq("bytesLength"),Su.Jq("bytesLengthPadding"),Su.A9(Su.u8("byte"),Su.cv(Su.Jq(),-8),"bytes")]),s=rf.chunkSize;let a=0,c=i,u=[];for(;c.length>0;){const i=c.slice(0,s),l=yu.Buffer.alloc(s+16);o.encode({instruction:0,offset:a,bytes:i,bytesLength:0,bytesLengthPadding:0},l);const h=(new jd).add({keys:[{pubkey:r.publicKey,isSigner:!0,isWritable:!0}],programId:n,data:l});if(u.push(Xd(e,h,[t,r],{commitment:"confirmed"})),e._rpcEndpoint.includes("solana.com")){const e=4;await Gd(1e3/e)}a+=s,c=c.slice(s)}await Promise.all(u);{const i=Su.n_([Su.Jq("instruction")]),o=yu.Buffer.alloc(i.span);i.encode({instruction:1},o);const s=(new jd).add({keys:[{pubkey:r.publicKey,isSigner:!0,isWritable:!0},{pubkey:Wd,isSigner:!1,isWritable:!1}],programId:n,data:o});await Xd(e,s,[t,r],{commitment:"confirmed"})}return!0}}rf.chunkSize=932;new Nd("BPFLoader2111111111111111111111111111111111");const nf=Object.freeze({RequestUnits:{index:0,layout:Su.n_([Su.u8("instruction"),Su.Jq("units"),Su.Jq("additionalFee")])},RequestHeapFrame:{index:1,layout:Su.n_([Su.u8("instruction"),Su.Jq("bytes")])}});class of{constructor(){}static requestUnits(e){const t=Zd(nf.RequestUnits,e);return new Vd({keys:[],programId:this.programId,data:t})}static requestHeapFrame(e){const t=Zd(nf.RequestHeapFrame,e);return new Vd({keys:[],programId:this.programId,data:t})}}of.programId=new Nd("ComputeBudget111111111111111111111111111111");var sf={exports:{}};!function(e,t){var r="undefined"!=typeof self?self:al,n=function(){function e(){this.fetch=!1,this.DOMException=r.DOMException}return e.prototype=r,new e}();!function(e){!function(t){var r="URLSearchParams"in e,n="Symbol"in e&&"iterator"in Symbol,i="FileReader"in e&&"Blob"in e&&function(){try{return new Blob,!0}catch(e){return!1}}(),o="FormData"in e,s="ArrayBuffer"in e;if(s)var a=["[object Int8Array]","[object Uint8Array]","[object Uint8ClampedArray]","[object Int16Array]","[object Uint16Array]","[object Int32Array]","[object Uint32Array]","[object Float32Array]","[object Float64Array]"],c=ArrayBuffer.isView||function(e){return e&&a.indexOf(Object.prototype.toString.call(e))>-1};function u(e){if("string"!=typeof e&&(e=String(e)),/[^a-z0-9\-#$%&'*+.^_`|~]/i.test(e))throw new TypeError("Invalid character in header field name");return e.toLowerCase()}function l(e){return"string"!=typeof e&&(e=String(e)),e}function h(e){var t={next:function(){var t=e.shift();return{done:void 0===t,value:t}}};return n&&(t[Symbol.iterator]=function(){return t}),t}function d(e){this.map={},e instanceof d?e.forEach((function(e,t){this.append(t,e)}),this):Array.isArray(e)?e.forEach((function(e){this.append(e[0],e[1])}),this):e&&Object.getOwnPropertyNames(e).forEach((function(t){this.append(t,e[t])}),this)}function f(e){if(e.bodyUsed)return Promise.reject(new TypeError("Already read"));e.bodyUsed=!0}function p(e){return new Promise((function(t,r){e.onload=function(){t(e.result)},e.onerror=function(){r(e.error)}}))}function m(e){var t=new FileReader,r=p(t);return t.readAsArrayBuffer(e),r}function g(e){if(e.slice)return e.slice(0);var t=new Uint8Array(e.byteLength);return t.set(new Uint8Array(e)),t.buffer}function y(){return this.bodyUsed=!1,this._initBody=function(e){var t;this._bodyInit=e,e?"string"==typeof e?this._bodyText=e:i&&Blob.prototype.isPrototypeOf(e)?this._bodyBlob=e:o&&FormData.prototype.isPrototypeOf(e)?this._bodyFormData=e:r&&URLSearchParams.prototype.isPrototypeOf(e)?this._bodyText=e.toString():s&&i&&((t=e)&&DataView.prototype.isPrototypeOf(t))?(this._bodyArrayBuffer=g(e.buffer),this._bodyInit=new Blob([this._bodyArrayBuffer])):s&&(ArrayBuffer.prototype.isPrototypeOf(e)||c(e))?this._bodyArrayBuffer=g(e):this._bodyText=e=Object.prototype.toString.call(e):this._bodyText="",this.headers.get("content-type")||("string"==typeof e?this.headers.set("content-type","text/plain;charset=UTF-8"):this._bodyBlob&&this._bodyBlob.type?this.headers.set("content-type",this._bodyBlob.type):r&&URLSearchParams.prototype.isPrototypeOf(e)&&this.headers.set("content-type","application/x-www-form-urlencoded;charset=UTF-8"))},i&&(this.blob=function(){var e=f(this);if(e)return e;if(this._bodyBlob)return Promise.resolve(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(new Blob([this._bodyArrayBuffer]));if(this._bodyFormData)throw new Error("could not read FormData body as blob");return Promise.resolve(new Blob([this._bodyText]))},this.arrayBuffer=function(){return this._bodyArrayBuffer?f(this)||Promise.resolve(this._bodyArrayBuffer):this.blob().then(m)}),this.text=function(){var e=f(this);if(e)return e;if(this._bodyBlob)return function(e){var t=new FileReader,r=p(t);return t.readAsText(e),r}(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(function(e){for(var t=new Uint8Array(e),r=new Array(t.length),n=0;n<t.length;n++)r[n]=String.fromCharCode(t[n]);return r.join("")}(this._bodyArrayBuffer));if(this._bodyFormData)throw new Error("could not read FormData body as text");return Promise.resolve(this._bodyText)},o&&(this.formData=function(){return this.text().then(w)}),this.json=function(){return this.text().then(JSON.parse)},this}d.prototype.append=function(e,t){e=u(e),t=l(t);var r=this.map[e];this.map[e]=r?r+", "+t:t},d.prototype.delete=function(e){delete this.map[u(e)]},d.prototype.get=function(e){return e=u(e),this.has(e)?this.map[e]:null},d.prototype.has=function(e){return this.map.hasOwnProperty(u(e))},d.prototype.set=function(e,t){this.map[u(e)]=l(t)},d.prototype.forEach=function(e,t){for(var r in this.map)this.map.hasOwnProperty(r)&&e.call(t,this.map[r],r,this)},d.prototype.keys=function(){var e=[];return this.forEach((function(t,r){e.push(r)})),h(e)},d.prototype.values=function(){var e=[];return this.forEach((function(t){e.push(t)})),h(e)},d.prototype.entries=function(){var e=[];return this.forEach((function(t,r){e.push([r,t])})),h(e)},n&&(d.prototype[Symbol.iterator]=d.prototype.entries);var b=["DELETE","GET","HEAD","OPTIONS","POST","PUT"];function v(e,t){var r,n,i=(t=t||{}).body;if(e instanceof v){if(e.bodyUsed)throw new TypeError("Already read");this.url=e.url,this.credentials=e.credentials,t.headers||(this.headers=new d(e.headers)),this.method=e.method,this.mode=e.mode,this.signal=e.signal,i||null==e._bodyInit||(i=e._bodyInit,e.bodyUsed=!0)}else this.url=String(e);if(this.credentials=t.credentials||this.credentials||"same-origin",!t.headers&&this.headers||(this.headers=new d(t.headers)),this.method=(r=t.method||this.method||"GET",n=r.toUpperCase(),b.indexOf(n)>-1?n:r),this.mode=t.mode||this.mode||null,this.signal=t.signal||this.signal,this.referrer=null,("GET"===this.method||"HEAD"===this.method)&&i)throw new TypeError("Body not allowed for GET or HEAD requests");this._initBody(i)}function w(e){var t=new FormData;return e.trim().split("&").forEach((function(e){if(e){var r=e.split("="),n=r.shift().replace(/\+/g," "),i=r.join("=").replace(/\+/g," ");t.append(decodeURIComponent(n),decodeURIComponent(i))}})),t}function x(e,t){t||(t={}),this.type="default",this.status=void 0===t.status?200:t.status,this.ok=this.status>=200&&this.status<300,this.statusText="statusText"in t?t.statusText:"OK",this.headers=new d(t.headers),this.url=t.url||"",this._initBody(e)}v.prototype.clone=function(){return new v(this,{body:this._bodyInit})},y.call(v.prototype),y.call(x.prototype),x.prototype.clone=function(){return new x(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new d(this.headers),url:this.url})},x.error=function(){var e=new x(null,{status:0,statusText:""});return e.type="error",e};var k=[301,302,303,307,308];x.redirect=function(e,t){if(-1===k.indexOf(t))throw new RangeError("Invalid status code");return new x(null,{status:t,headers:{location:e}})},t.DOMException=e.DOMException;try{new t.DOMException}catch(E){t.DOMException=function(e,t){this.message=e,this.name=t;var r=Error(e);this.stack=r.stack},t.DOMException.prototype=Object.create(Error.prototype),t.DOMException.prototype.constructor=t.DOMException}function S(e,r){return new Promise((function(n,o){var s=new v(e,r);if(s.signal&&s.signal.aborted)return o(new t.DOMException("Aborted","AbortError"));var a=new XMLHttpRequest;function c(){a.abort()}a.onload=function(){var e,t,r={status:a.status,statusText:a.statusText,headers:(e=a.getAllResponseHeaders()||"",t=new d,e.replace(/\r?\n[\t ]+/g," ").split(/\r?\n/).forEach((function(e){var r=e.split(":"),n=r.shift().trim();if(n){var i=r.join(":").trim();t.append(n,i)}})),t)};r.url="responseURL"in a?a.responseURL:r.headers.get("X-Request-URL");var i="response"in a?a.response:a.responseText;n(new x(i,r))},a.onerror=function(){o(new TypeError("Network request failed"))},a.ontimeout=function(){o(new TypeError("Network request failed"))},a.onabort=function(){o(new t.DOMException("Aborted","AbortError"))},a.open(s.method,s.url,!0),"include"===s.credentials?a.withCredentials=!0:"omit"===s.credentials&&(a.withCredentials=!1),"responseType"in a&&i&&(a.responseType="blob"),s.headers.forEach((function(e,t){a.setRequestHeader(t,e)})),s.signal&&(s.signal.addEventListener("abort",c),a.onreadystatechange=function(){4===a.readyState&&s.signal.removeEventListener("abort",c)}),a.send(void 0===s._bodyInit?null:s._bodyInit)}))}S.polyfill=!0,e.fetch||(e.fetch=S,e.Headers=d,e.Request=v,e.Response=x),t.Headers=d,t.Request=v,t.Response=x,t.fetch=S,Object.defineProperty(t,"__esModule",{value:!0})}({})}(n),n.fetch.ponyfill=!0,delete n.fetch.polyfill;var i=n;(t=i.fetch).default=i.fetch,t.fetch=i.fetch,t.Headers=i.Headers,t.Request=i.Request,t.Response=i.Response,e.exports=t}(sf,sf.exports);var af=cl(sf.exports),cf=Object.prototype.toString,uf=Object.keys||function(e){var t=[];for(var r in e)t.push(r);return t};function lf(e,t){var r,n,i,o,s,a,c;if(!0===e)return"true";if(!1===e)return"false";switch(typeof e){case"object":if(null===e)return null;if(e.toJSON&&"function"==typeof e.toJSON)return lf(e.toJSON(),t);if("[object Array]"===(c=cf.call(e))){for(i="[",n=e.length-1,r=0;r<n;r++)i+=lf(e[r],!0)+",";return n>-1&&(i+=lf(e[r],!0)),i+"]"}if("[object Object]"===c){for(n=(o=uf(e).sort()).length,i="",r=0;r<n;)void 0!==(a=lf(e[s=o[r]],!1))&&(i&&(i+=","),i+=JSON.stringify(s)+":"+a),r++;return"{"+i+"}"}return JSON.stringify(e);case"function":case"undefined":return t?null:void 0;case"string":return JSON.stringify(e);default:return isFinite(e)?e:null}}var hf=function(e){var t=lf(e,!1);if(void 0!==t)return""+t};function df(e){let t=0;for(;e>1;)e/=2,t++;return t}class ff{constructor(e,t,r,n,i){this.slotsPerEpoch=void 0,this.leaderScheduleSlotOffset=void 0,this.warmup=void 0,this.firstNormalEpoch=void 0,this.firstNormalSlot=void 0,this.slotsPerEpoch=e,this.leaderScheduleSlotOffset=t,this.warmup=r,this.firstNormalEpoch=n,this.firstNormalSlot=i}getEpoch(e){return this.getEpochAndSlotIndex(e)[0]}getEpochAndSlotIndex(e){if(e<this.firstNormalSlot){const r=df(0===(t=e+32+1)?1:(t--,t|=t>>1,t|=t>>2,t|=t>>4,t|=t>>8,t|=t>>16,1+(t|=t>>32)))-df(32)-1;return[r,e-(this.getSlotsInEpoch(r)-32)]}{const t=e-this.firstNormalSlot,r=Math.floor(t/this.slotsPerEpoch);return[this.firstNormalEpoch+r,t%this.slotsPerEpoch]}var t}getFirstSlotInEpoch(e){return e<=this.firstNormalEpoch?32*(Math.pow(2,e)-1):(e-this.firstNormalEpoch)*this.slotsPerEpoch+this.firstNormalSlot}getLastSlotInEpoch(e){return this.getFirstSlotInEpoch(e)+this.getSlotsInEpoch(e)-1}getSlotsInEpoch(e){return e<this.firstNormalEpoch?Math.pow(2,e+df(32)):this.slotsPerEpoch}}class pf extends Error{constructor(e,t){super(e),this.logs=void 0,this.logs=t}}class mf extends Error{constructor(e){super(`Signature ${e} has expired: block height exceeded.`),this.signature=void 0,this.signature=e}}Object.defineProperty(mf.prototype,"name",{value:"TransactionExpiredBlockheightExceededError"});class gf extends Error{constructor(e,t){super(`Transaction was not confirmed in ${t.toFixed(2)} seconds. It is unknown if it succeeded or failed. Check signature ${e} using the Solana Explorer or CLI tools.`),this.signature=void 0,this.signature=e}}Object.defineProperty(gf.prototype,"name",{value:"TransactionExpiredTimeoutError"});const yf=el(ju(Nd),Zu(),(e=>new Nd(e))),bf=Ju([Zu(),Fu("base64")]),vf=el(ju(yu.Buffer),bf,(e=>yu.Buffer.from(e[0],"base64")));function wf(e){return Qu([Yu({jsonrpc:Fu("2.0"),id:Zu(),result:e}),Yu({jsonrpc:Fu("2.0"),id:Zu(),error:Yu({code:$u(),message:Zu(),data:Xu(qu("any",(()=>!0)))})})])}const xf=wf($u());function kf(e){return el(wf(e),xf,(t=>"error"in t?t:{...t,result:zu(t.result,e)}))}function Sf(e){return kf(Yu({context:Yu({slot:Ku()}),value:e}))}function Ef(e){return Yu({context:Yu({slot:Ku()}),value:e})}const Af=Yu({foundation:Ku(),foundationTerm:Ku(),initial:Ku(),taper:Ku(),terminal:Ku()}),Nf=kf(Du(Wu(Yu({epoch:Ku(),effectiveSlot:Ku(),amount:Ku(),postBalance:Ku()})))),Tf=Yu({epoch:Ku(),slotIndex:Ku(),slotsInEpoch:Ku(),absoluteSlot:Ku(),blockHeight:Xu(Ku()),transactionCount:Xu(Ku())}),Pf=Yu({slotsPerEpoch:Ku(),leaderScheduleSlotOffset:Ku(),warmup:Vu(),firstNormalEpoch:Ku(),firstNormalSlot:Ku()}),Mf=Gu(Zu(),Du(Ku())),If=Wu(Qu([Yu({}),Zu()])),Cf=Yu({err:If}),Rf=Fu("receivedSignature"),Bf=Yu({"solana-core":Zu(),"feature-set":Xu(Ku())}),Of=Sf(Yu({err:Wu(Qu([Yu({}),Zu()])),logs:Wu(Du(Zu())),accounts:Xu(Wu(Du(Wu(Yu({executable:Vu(),owner:Zu(),lamports:Ku(),data:Du(Zu()),rentEpoch:Xu(Ku())}))))),unitsConsumed:Xu(Ku())})),Lf=Sf(Yu({byIdentity:Gu(Zu(),Du(Ku())),range:Yu({firstSlot:Ku(),lastSlot:Ku()})}));const zf=kf(Af),Uf=kf(Tf),_f=kf(Pf),qf=kf(Mf),Df=kf(Ku()),Vf=Sf(Yu({total:Ku(),circulating:Ku(),nonCirculating:Ku(),nonCirculatingAccounts:Du(yf)})),jf=Yu({amount:Zu(),uiAmount:Wu(Ku()),decimals:Ku(),uiAmountString:Xu(Zu())}),Ff=Sf(Du(Yu({address:yf,amount:Zu(),uiAmount:Wu(Ku()),decimals:Ku(),uiAmountString:Xu(Zu())}))),Hf=Sf(Du(Yu({pubkey:yf,account:Yu({executable:Vu(),owner:yf,lamports:Ku(),data:vf,rentEpoch:Ku()})}))),Wf=Yu({program:Zu(),parsed:$u(),space:Ku()}),Kf=Sf(Du(Yu({pubkey:yf,account:Yu({executable:Vu(),owner:yf,lamports:Ku(),data:Wf,rentEpoch:Ku()})}))),Xf=Sf(Du(Yu({lamports:Ku(),address:yf}))),Gf=Yu({executable:Vu(),owner:yf,lamports:Ku(),data:vf,rentEpoch:Ku()}),Zf=Yu({pubkey:yf,account:Gf}),Jf=el(Qu([ju(yu.Buffer),Wf]),Qu([bf,Wf]),(e=>Array.isArray(e)?zu(e,vf):e)),Yf=Yu({executable:Vu(),owner:yf,lamports:Ku(),data:Jf,rentEpoch:Ku()}),Qf=Yu({pubkey:yf,account:Yf}),$f=Yu({state:Qu([Fu("active"),Fu("inactive"),Fu("activating"),Fu("deactivating")]),active:Ku(),inactive:Ku()}),ep=kf(Du(Yu({signature:Zu(),slot:Ku(),err:If,memo:Wu(Zu()),blockTime:Xu(Wu(Ku()))}))),tp=kf(Du(Yu({signature:Zu(),slot:Ku(),err:If,memo:Wu(Zu()),blockTime:Xu(Wu(Ku()))}))),rp=Yu({subscription:Ku(),result:Ef(Gf)}),np=Yu({pubkey:yf,account:Gf}),ip=Yu({subscription:Ku(),result:Ef(np)}),op=Yu({parent:Ku(),slot:Ku(),root:Ku()}),sp=Yu({subscription:Ku(),result:op}),ap=Qu([Yu({type:Qu([Fu("firstShredReceived"),Fu("completed"),Fu("optimisticConfirmation"),Fu("root")]),slot:Ku(),timestamp:Ku()}),Yu({type:Fu("createdBank"),parent:Ku(),slot:Ku(),timestamp:Ku()}),Yu({type:Fu("frozen"),slot:Ku(),timestamp:Ku(),stats:Yu({numTransactionEntries:Ku(),numSuccessfulTransactions:Ku(),numFailedTransactions:Ku(),maxTransactionsPerEntry:Ku()})}),Yu({type:Fu("dead"),slot:Ku(),timestamp:Ku(),err:Zu()})]),cp=Yu({subscription:Ku(),result:ap}),up=Yu({subscription:Ku(),result:Ef(Qu([Cf,Rf]))}),lp=Yu({subscription:Ku(),result:Ku()}),hp=Yu({pubkey:Zu(),gossip:Wu(Zu()),tpu:Wu(Zu()),rpc:Wu(Zu()),version:Wu(Zu())}),dp=Yu({votePubkey:Zu(),nodePubkey:Zu(),activatedStake:Ku(),epochVoteAccount:Vu(),epochCredits:Du(Ju([Ku(),Ku(),Ku()])),commission:Ku(),lastVote:Ku(),rootSlot:Wu(Ku())}),fp=kf(Yu({current:Du(dp),delinquent:Du(dp)})),pp=Qu([Fu("processed"),Fu("confirmed"),Fu("finalized")]),mp=Yu({slot:Ku(),confirmations:Wu(Ku()),err:If,confirmationStatus:Xu(pp)}),gp=Sf(Du(Wu(mp))),yp=kf(Ku()),bp=Yu({signatures:Du(Zu()),message:Yu({accountKeys:Du(Zu()),header:Yu({numRequiredSignatures:Ku(),numReadonlySignedAccounts:Ku(),numReadonlyUnsignedAccounts:Ku()}),instructions:Du(Yu({accounts:Du(Ku()),data:Zu(),programIdIndex:Ku()})),recentBlockhash:Zu()})}),vp=Yu({parsed:$u(),program:Zu(),programId:yf}),wp=Yu({accounts:Du(yf),data:Zu(),programId:yf}),xp=el(Qu([wp,vp]),Qu([Yu({parsed:$u(),program:Zu(),programId:Zu()}),Yu({accounts:Du(Zu()),data:Zu(),programId:Zu()})]),(e=>zu(e,"accounts"in e?wp:vp))),kp=Yu({signatures:Du(Zu()),message:Yu({accountKeys:Du(Yu({pubkey:yf,signer:Vu(),writable:Vu()})),instructions:Du(xp),recentBlockhash:Zu()})}),Sp=Yu({accountIndex:Ku(),mint:Zu(),owner:Xu(Zu()),uiTokenAmount:jf}),Ep=Yu({err:If,fee:Ku(),innerInstructions:Xu(Wu(Du(Yu({index:Ku(),instructions:Du(Yu({accounts:Du(Ku()),data:Zu(),programIdIndex:Ku()}))})))),preBalances:Du(Ku()),postBalances:Du(Ku()),logMessages:Xu(Wu(Du(Zu()))),preTokenBalances:Xu(Wu(Du(Sp))),postTokenBalances:Xu(Wu(Du(Sp)))}),Ap=Yu({err:If,fee:Ku(),innerInstructions:Xu(Wu(Du(Yu({index:Ku(),instructions:Du(xp)})))),preBalances:Du(Ku()),postBalances:Du(Ku()),logMessages:Xu(Wu(Du(Zu()))),preTokenBalances:Xu(Wu(Du(Sp))),postTokenBalances:Xu(Wu(Du(Sp)))}),Np=kf(Wu(Yu({blockhash:Zu(),previousBlockhash:Zu(),parentSlot:Ku(),transactions:Du(Yu({transaction:bp,meta:Wu(Ep)})),rewards:Xu(Du(Yu({pubkey:Zu(),lamports:Ku(),postBalance:Wu(Ku()),rewardType:Wu(Zu())}))),blockTime:Wu(Ku()),blockHeight:Wu(Ku())}))),Tp=kf(Wu(Yu({blockhash:Zu(),previousBlockhash:Zu(),parentSlot:Ku(),transactions:Du(Yu({transaction:bp,meta:Wu(Ep)})),rewards:Xu(Du(Yu({pubkey:Zu(),lamports:Ku(),postBalance:Wu(Ku()),rewardType:Wu(Zu())}))),blockTime:Wu(Ku())}))),Pp=kf(Wu(Yu({blockhash:Zu(),previousBlockhash:Zu(),parentSlot:Ku(),signatures:Du(Zu()),blockTime:Wu(Ku())}))),Mp=kf(Wu(Yu({slot:Ku(),meta:Ep,blockTime:Xu(Wu(Ku())),transaction:bp}))),Ip=kf(Wu(Yu({slot:Ku(),transaction:kp,meta:Wu(Ap),blockTime:Xu(Wu(Ku()))}))),Cp=Sf(Yu({blockhash:Zu(),feeCalculator:Yu({lamportsPerSignature:Ku()})})),Rp=Sf(Yu({blockhash:Zu(),lastValidBlockHeight:Ku()})),Bp=kf(Du(Yu({slot:Ku(),numTransactions:Ku(),numSlots:Ku(),samplePeriodSecs:Ku()}))),Op=Sf(Wu(Yu({feeCalculator:Yu({lamportsPerSignature:Ku()})}))),Lp=kf(Zu()),zp=kf(Zu()),Up=Yu({err:If,logs:Du(Zu()),signature:Zu()}),_p=Yu({result:Ef(Up),subscription:Ku()});class qp{constructor(e,t){this._commitment=void 0,this._confirmTransactionInitialTimeout=void 0,this._rpcEndpoint=void 0,this._rpcWsEndpoint=void 0,this._rpcClient=void 0,this._rpcRequest=void 0,this._rpcBatchRequest=void 0,this._rpcWebSocket=void 0,this._rpcWebSocketConnected=!1,this._rpcWebSocketHeartbeat=null,this._rpcWebSocketIdleTimeout=null,this._rpcWebSocketGeneration=0,this._disableBlockhashCaching=!1,this._pollingBlockhash=!1,this._blockhashInfo={latestBlockhash:null,lastFetch:0,transactionSignatures:[],simulatedSignatures:[]},this._nextClientSubscriptionId=0,this._subscriptionDisposeFunctionsByClientSubscriptionId={},this._subscriptionCallbacksByServerSubscriptionId={},this._subscriptionsByHash={},this._subscriptionsAutoDisposedByRpc=new Set;let r=new URL(e);r.protocol;let n,i,o,s,a;t&&"string"==typeof t?this._commitment=t:t&&(this._commitment=t.commitment,this._confirmTransactionInitialTimeout=t.confirmTransactionInitialTimeout,n=t.wsEndpoint,i=t.httpHeaders,o=t.fetch,s=t.fetchMiddleware,a=t.disableRetryOnRateLimit),this._rpcEndpoint=e,this._rpcWsEndpoint=n||function(e){let t=new URL(e);const r="https:"===t.protocol;return t.protocol=r?"wss:":"ws:",t.host="",""!==t.port&&(t.port=String(Number(t.port)+1)),t.toString()}(e),this._rpcClient=function(e,t,r,n,i,o){const s=n||af;let a;return i&&(a=async(e,t)=>{const r=await new Promise(((r,n)=>{try{i(e,t,((e,t)=>r([e,t])))}catch(h2){n(h2)}}));return await s(...r)}),new(nl())((async(t,n)=>{const i={method:"POST",body:t,agent:void 0,headers:Object.assign({"Content-Type":"application/json"},r||{})};try{let t,r=5,c=500;for(;t=a?await a(e,i):await s(e,i),429===t.status&&!0!==o&&(r-=1,0!==r);)console.log(`Server responded with ${t.status} ${t.statusText}. Retrying after ${c}ms delay...`),await Gd(c),c*=2;const u=await t.text();t.ok?n(null,u):n(new Error(`${t.status} ${t.statusText}: ${u}`))}catch(c){c instanceof Error&&n(c)}}),{})}(r.toString(),0,i,o,s,a),this._rpcRequest=function(e){return(t,r)=>new Promise(((n,i)=>{e.request(t,r,((e,t)=>{e?i(e):n(t)}))}))}(this._rpcClient),this._rpcBatchRequest=function(e){return t=>new Promise(((r,n)=>{0===t.length&&r([]);const i=t.map((t=>e.request(t.methodName,t.args)));e.request(i,((e,t)=>{e?n(e):r(t)}))}))}(this._rpcClient),this._rpcWebSocket=new tl.K(this._rpcWsEndpoint,{autoconnect:!1,max_reconnects:1/0}),this._rpcWebSocket.on("open",this._wsOnOpen.bind(this)),this._rpcWebSocket.on("error",this._wsOnError.bind(this)),this._rpcWebSocket.on("close",this._wsOnClose.bind(this)),this._rpcWebSocket.on("accountNotification",this._wsOnAccountNotification.bind(this)),this._rpcWebSocket.on("programNotification",this._wsOnProgramAccountNotification.bind(this)),this._rpcWebSocket.on("slotNotification",this._wsOnSlotNotification.bind(this)),this._rpcWebSocket.on("slotsUpdatesNotification",this._wsOnSlotUpdatesNotification.bind(this)),this._rpcWebSocket.on("signatureNotification",this._wsOnSignatureNotification.bind(this)),this._rpcWebSocket.on("rootNotification",this._wsOnRootNotification.bind(this)),this._rpcWebSocket.on("logsNotification",this._wsOnLogsNotification.bind(this))}get commitment(){return this._commitment}get rpcEndpoint(){return this._rpcEndpoint}async getBalanceAndContext(e,t){const r=this._buildArgs([e.toBase58()],t),n=zu(await this._rpcRequest("getBalance",r),Sf(Ku()));if("error"in n)throw new Error("failed to get balance for "+e.toBase58()+": "+n.error.message);return n.result}async getBalance(e,t){return await this.getBalanceAndContext(e,t).then((e=>e.value)).catch((t=>{throw new Error("failed to get balance of account "+e.toBase58()+": "+t)}))}async getBlockTime(e){const t=zu(await this._rpcRequest("getBlockTime",[e]),kf(Wu(Ku())));if("error"in t)throw new Error("failed to get block time for slot "+e+": "+t.error.message);return t.result}async getMinimumLedgerSlot(){const e=zu(await this._rpcRequest("minimumLedgerSlot",[]),kf(Ku()));if("error"in e)throw new Error("failed to get minimum ledger slot: "+e.error.message);return e.result}async getFirstAvailableBlock(){const e=zu(await this._rpcRequest("getFirstAvailableBlock",[]),Df);if("error"in e)throw new Error("failed to get first available block: "+e.error.message);return e.result}async getSupply(e){let t={};t="string"==typeof e?{commitment:e}:e?{...e,commitment:e&&e.commitment||this.commitment}:{commitment:this.commitment};const r=zu(await this._rpcRequest("getSupply",[t]),Vf);if("error"in r)throw new Error("failed to get supply: "+r.error.message);return r.result}async getTokenSupply(e,t){const r=this._buildArgs([e.toBase58()],t),n=zu(await this._rpcRequest("getTokenSupply",r),Sf(jf));if("error"in n)throw new Error("failed to get token supply: "+n.error.message);return n.result}async getTokenAccountBalance(e,t){const r=this._buildArgs([e.toBase58()],t),n=zu(await this._rpcRequest("getTokenAccountBalance",r),Sf(jf));if("error"in n)throw new Error("failed to get token account balance: "+n.error.message);return n.result}async getTokenAccountsByOwner(e,t,r){let n=[e.toBase58()];"mint"in t?n.push({mint:t.mint.toBase58()}):n.push({programId:t.programId.toBase58()});const i=this._buildArgs(n,r,"base64"),o=zu(await this._rpcRequest("getTokenAccountsByOwner",i),Hf);if("error"in o)throw new Error("failed to get token accounts owned by account "+e.toBase58()+": "+o.error.message);return o.result}async getParsedTokenAccountsByOwner(e,t,r){let n=[e.toBase58()];"mint"in t?n.push({mint:t.mint.toBase58()}):n.push({programId:t.programId.toBase58()});const i=this._buildArgs(n,r,"jsonParsed"),o=zu(await this._rpcRequest("getTokenAccountsByOwner",i),Kf);if("error"in o)throw new Error("failed to get token accounts owned by account "+e.toBase58()+": "+o.error.message);return o.result}async getLargestAccounts(e){const t={...e,commitment:e&&e.commitment||this.commitment},r=t.filter||t.commitment?[t]:[],n=zu(await this._rpcRequest("getLargestAccounts",r),Xf);if("error"in n)throw new Error("failed to get largest accounts: "+n.error.message);return n.result}async getTokenLargestAccounts(e,t){const r=this._buildArgs([e.toBase58()],t),n=zu(await this._rpcRequest("getTokenLargestAccounts",r),Ff);if("error"in n)throw new Error("failed to get token largest accounts: "+n.error.message);return n.result}async getAccountInfoAndContext(e,t){const r=this._buildArgs([e.toBase58()],t,"base64"),n=zu(await this._rpcRequest("getAccountInfo",r),Sf(Wu(Gf)));if("error"in n)throw new Error("failed to get info about account "+e.toBase58()+": "+n.error.message);return n.result}async getParsedAccountInfo(e,t){const r=this._buildArgs([e.toBase58()],t,"jsonParsed"),n=zu(await this._rpcRequest("getAccountInfo",r),Sf(Wu(Yf)));if("error"in n)throw new Error("failed to get info about account "+e.toBase58()+": "+n.error.message);return n.result}async getAccountInfo(e,t){try{return(await this.getAccountInfoAndContext(e,t)).value}catch(r){throw new Error("failed to get info about account "+e.toBase58()+": "+r)}}async getMultipleAccountsInfoAndContext(e,t){const r=e.map((e=>e.toBase58())),n=this._buildArgs([r],t,"base64"),i=zu(await this._rpcRequest("getMultipleAccounts",n),Sf(Du(Wu(Gf))));if("error"in i)throw new Error("failed to get info for accounts "+r+": "+i.error.message);return i.result}async getMultipleAccountsInfo(e,t){return(await this.getMultipleAccountsInfoAndContext(e,t)).value}async getStakeActivation(e,t,r){const n=this._buildArgs([e.toBase58()],t,void 0,void 0!==r?{epoch:r}:void 0),i=zu(await this._rpcRequest("getStakeActivation",n),kf($f));if("error"in i)throw new Error(`failed to get Stake Activation ${e.toBase58()}: ${i.error.message}`);return i.result}async getProgramAccounts(e,t){const r={};let n,i;t&&("string"==typeof t?n=t:(n=t.commitment,i=t.encoding,t.dataSlice&&(r.dataSlice=t.dataSlice),t.filters&&(r.filters=t.filters)));const o=this._buildArgs([e.toBase58()],n,i||"base64",r),s=zu(await this._rpcRequest("getProgramAccounts",o),kf(Du(Zf)));if("error"in s)throw new Error("failed to get accounts owned by program "+e.toBase58()+": "+s.error.message);return s.result}async getParsedProgramAccounts(e,t){const r={};let n;t&&("string"==typeof t?n=t:(n=t.commitment,t.filters&&(r.filters=t.filters)));const i=this._buildArgs([e.toBase58()],n,"jsonParsed",r),o=zu(await this._rpcRequest("getProgramAccounts",i),kf(Du(Qf)));if("error"in o)throw new Error("failed to get accounts owned by program "+e.toBase58()+": "+o.error.message);return o.result}async confirmTransaction(e,t){let r,n;if("string"==typeof e)r=e;else{r=e.signature}try{n=xu().decode(r)}catch(d){throw new Error("signature must be base58 encoded: "+r)}_d(64===n.length,"signature has invalid length");const i=t||this.commitment;let o,s,a=!1;const c=new Promise(((e,t)=>{try{s=this.onSignature(r,((t,r)=>{s=void 0;const n={context:r,value:t};a=!0,e({__type:qd.PROCESSED,response:n})}),i)}catch(d){t(d)}})),u=async()=>{try{return await this.getBlockHeight(t)}catch(e){return-1}},l=new Promise((t=>{if("string"==typeof e){let e=this._confirmTransactionInitialTimeout||6e4;switch(i){case"processed":case"recent":case"single":case"confirmed":case"singleGossip":e=this._confirmTransactionInitialTimeout||3e4}o=setTimeout((()=>t({__type:qd.TIMED_OUT,timeoutMs:e})),e)}else{let r=e;(async()=>{let e=await u();if(!a){for(;e<=r.lastValidBlockHeight;){if(await Gd(1e3),a)return;if(e=await u(),a)return}t({__type:qd.BLOCKHEIGHT_EXCEEDED})}})()}}));let h;try{const e=await Promise.race([c,l]);switch(e.__type){case qd.BLOCKHEIGHT_EXCEEDED:throw new mf(r);case qd.PROCESSED:h=e.response;break;case qd.TIMED_OUT:throw new gf(r,e.timeoutMs/1e3)}}finally{clearTimeout(o),s&&this.removeSignatureListener(s)}return h}async getClusterNodes(){const e=zu(await this._rpcRequest("getClusterNodes",[]),kf(Du(hp)));if("error"in e)throw new Error("failed to get cluster nodes: "+e.error.message);return e.result}async getVoteAccounts(e){const t=this._buildArgs([],e),r=zu(await this._rpcRequest("getVoteAccounts",t),fp);if("error"in r)throw new Error("failed to get vote accounts: "+r.error.message);return r.result}async getSlot(e){const t=this._buildArgs([],e),r=zu(await this._rpcRequest("getSlot",t),kf(Ku()));if("error"in r)throw new Error("failed to get slot: "+r.error.message);return r.result}async getSlotLeader(e){const t=this._buildArgs([],e),r=zu(await this._rpcRequest("getSlotLeader",t),kf(Zu()));if("error"in r)throw new Error("failed to get slot leader: "+r.error.message);return r.result}async getSlotLeaders(e,t){const r=[e,t],n=zu(await this._rpcRequest("getSlotLeaders",r),kf(Du(yf)));if("error"in n)throw new Error("failed to get slot leaders: "+n.error.message);return n.result}async getSignatureStatus(e,t){const{context:r,value:n}=await this.getSignatureStatuses([e],t);_d(1===n.length);return{context:r,value:n[0]}}async getSignatureStatuses(e,t){const r=[e];t&&r.push(t);const n=zu(await this._rpcRequest("getSignatureStatuses",r),gp);if("error"in n)throw new Error("failed to get signature status: "+n.error.message);return n.result}async getTransactionCount(e){const t=this._buildArgs([],e),r=zu(await this._rpcRequest("getTransactionCount",t),kf(Ku()));if("error"in r)throw new Error("failed to get transaction count: "+r.error.message);return r.result}async getTotalSupply(e){return(await this.getSupply({commitment:e,excludeNonCirculatingAccountsList:!0})).value.total}async getInflationGovernor(e){const t=this._buildArgs([],e),r=zu(await this._rpcRequest("getInflationGovernor",t),zf);if("error"in r)throw new Error("failed to get inflation: "+r.error.message);return r.result}async getInflationReward(e,t,r){const n=this._buildArgs([e.map((e=>e.toBase58()))],r,void 0,{epoch:t}),i=zu(await this._rpcRequest("getInflationReward",n),Nf);if("error"in i)throw new Error("failed to get inflation reward: "+i.error.message);return i.result}async getEpochInfo(e){const t=this._buildArgs([],e),r=zu(await this._rpcRequest("getEpochInfo",t),Uf);if("error"in r)throw new Error("failed to get epoch info: "+r.error.message);return r.result}async getEpochSchedule(){const e=zu(await this._rpcRequest("getEpochSchedule",[]),_f);if("error"in e)throw new Error("failed to get epoch schedule: "+e.error.message);const t=e.result;return new ff(t.slotsPerEpoch,t.leaderScheduleSlotOffset,t.warmup,t.firstNormalEpoch,t.firstNormalSlot)}async getLeaderSchedule(){const e=zu(await this._rpcRequest("getLeaderSchedule",[]),qf);if("error"in e)throw new Error("failed to get leader schedule: "+e.error.message);return e.result}async getMinimumBalanceForRentExemption(e,t){const r=this._buildArgs([e],t),n=zu(await this._rpcRequest("getMinimumBalanceForRentExemption",r),yp);return"error"in n?(console.warn("Unable to fetch minimum balance for rent exemption"),0):n.result}async getRecentBlockhashAndContext(e){const t=this._buildArgs([],e),r=zu(await this._rpcRequest("getRecentBlockhash",t),Cp);if("error"in r)throw new Error("failed to get recent blockhash: "+r.error.message);return r.result}async getRecentPerformanceSamples(e){const t=this._buildArgs(e?[e]:[]),r=zu(await this._rpcRequest("getRecentPerformanceSamples",t),Bp);if("error"in r)throw new Error("failed to get recent performance samples: "+r.error.message);return r.result}async getFeeCalculatorForBlockhash(e,t){const r=this._buildArgs([e],t),n=zu(await this._rpcRequest("getFeeCalculatorForBlockhash",r),Op);if("error"in n)throw new Error("failed to get fee calculator: "+n.error.message);const{context:i,value:o}=n.result;return{context:i,value:null!==o?o.feeCalculator:null}}async getFeeForMessage(e,t){const r=e.serialize().toString("base64"),n=this._buildArgs([r],t),i=zu(await this._rpcRequest("getFeeForMessage",n),Sf(Wu(Ku())));if("error"in i)throw new Error("failed to get slot: "+i.error.message);if(null===i.result)throw new Error("invalid blockhash");return i.result}async getRecentBlockhash(e){try{return(await this.getRecentBlockhashAndContext(e)).value}catch(t){throw new Error("failed to get recent blockhash: "+t)}}async getLatestBlockhash(e){try{return(await this.getLatestBlockhashAndContext(e)).value}catch(t){throw new Error("failed to get recent blockhash: "+t)}}async getLatestBlockhashAndContext(e){const t=this._buildArgs([],e),r=zu(await this._rpcRequest("getLatestBlockhash",t),Rp);if("error"in r)throw new Error("failed to get latest blockhash: "+r.error.message);return r.result}async getVersion(){const e=zu(await this._rpcRequest("getVersion",[]),kf(Bf));if("error"in e)throw new Error("failed to get version: "+e.error.message);return e.result}async getGenesisHash(){const e=zu(await this._rpcRequest("getGenesisHash",[]),kf(Zu()));if("error"in e)throw new Error("failed to get genesis hash: "+e.error.message);return e.result}async getBlock(e,t){const r=this._buildArgsAtLeastConfirmed([e],t&&t.commitment),n=zu(await this._rpcRequest("getBlock",r),Np);if("error"in n)throw new Error("failed to get confirmed block: "+n.error.message);const i=n.result;return i?{...i,transactions:i.transactions.map((({transaction:e,meta:t})=>{const r=new Ud(e.message);return{meta:t,transaction:{...e,message:r}}}))}:i}async getBlockHeight(e){const t=this._buildArgs([],e),r=zu(await this._rpcRequest("getBlockHeight",t),kf(Ku()));if("error"in r)throw new Error("failed to get block height information: "+r.error.message);return r.result}async getBlockProduction(e){let t,r;if("string"==typeof e)r=e;else if(e){const{commitment:n,...i}=e;r=n,t=i}const n=this._buildArgs([],r,"base64",t),i=zu(await this._rpcRequest("getBlockProduction",n),Lf);if("error"in i)throw new Error("failed to get block production information: "+i.error.message);return i.result}async getTransaction(e,t){const r=this._buildArgsAtLeastConfirmed([e],t&&t.commitment),n=zu(await this._rpcRequest("getTransaction",r),Mp);if("error"in n)throw new Error("failed to get transaction: "+n.error.message);const i=n.result;return i?{...i,transaction:{...i.transaction,message:new Ud(i.transaction.message)}}:i}async getParsedTransaction(e,t){const r=this._buildArgsAtLeastConfirmed([e],t,"jsonParsed"),n=zu(await this._rpcRequest("getTransaction",r),Ip);if("error"in n)throw new Error("failed to get transaction: "+n.error.message);return n.result}async getParsedTransactions(e,t){const r=e.map((e=>({methodName:"getTransaction",args:this._buildArgsAtLeastConfirmed([e],t,"jsonParsed")})));return(await this._rpcBatchRequest(r)).map((e=>{const t=zu(e,Ip);if("error"in t)throw new Error("failed to get transactions: "+t.error.message);return t.result}))}async getTransactions(e,t){const r=e.map((e=>({methodName:"getTransaction",args:this._buildArgsAtLeastConfirmed([e],t)})));return(await this._rpcBatchRequest(r)).map((e=>{const t=zu(e,Mp);if("error"in t)throw new Error("failed to get transactions: "+t.error.message);return t.result}))}async getConfirmedBlock(e,t){const r=this._buildArgsAtLeastConfirmed([e],t),n=zu(await this._rpcRequest("getConfirmedBlock",r),Tp);if("error"in n)throw new Error("failed to get confirmed block: "+n.error.message);const i=n.result;if(!i)throw new Error("Confirmed block "+e+" not found");const o={...i,transactions:i.transactions.map((({transaction:e,meta:t})=>{const r=new Ud(e.message);return{meta:t,transaction:{...e,message:r}}}))};return{...o,transactions:o.transactions.map((({transaction:e,meta:t})=>({meta:t,transaction:jd.populate(e.message,e.signatures)})))}}async getBlocks(e,t,r){const n=this._buildArgsAtLeastConfirmed(void 0!==t?[e,t]:[e],r),i=zu(await this._rpcRequest("getBlocks",n),kf(Du(Ku())));if("error"in i)throw new Error("failed to get blocks: "+i.error.message);return i.result}async getBlockSignatures(e,t){const r=this._buildArgsAtLeastConfirmed([e],t,void 0,{transactionDetails:"signatures",rewards:!1}),n=zu(await this._rpcRequest("getBlock",r),Pp);if("error"in n)throw new Error("failed to get block: "+n.error.message);const i=n.result;if(!i)throw new Error("Block "+e+" not found");return i}async getConfirmedBlockSignatures(e,t){const r=this._buildArgsAtLeastConfirmed([e],t,void 0,{transactionDetails:"signatures",rewards:!1}),n=zu(await this._rpcRequest("getConfirmedBlock",r),Pp);if("error"in n)throw new Error("failed to get confirmed block: "+n.error.message);const i=n.result;if(!i)throw new Error("Confirmed block "+e+" not found");return i}async getConfirmedTransaction(e,t){const r=this._buildArgsAtLeastConfirmed([e],t),n=zu(await this._rpcRequest("getConfirmedTransaction",r),Mp);if("error"in n)throw new Error("failed to get transaction: "+n.error.message);const i=n.result;if(!i)return i;const o=new Ud(i.transaction.message),s=i.transaction.signatures;return{...i,transaction:jd.populate(o,s)}}async getParsedConfirmedTransaction(e,t){const r=this._buildArgsAtLeastConfirmed([e],t,"jsonParsed"),n=zu(await this._rpcRequest("getConfirmedTransaction",r),Ip);if("error"in n)throw new Error("failed to get confirmed transaction: "+n.error.message);return n.result}async getParsedConfirmedTransactions(e,t){const r=e.map((e=>({methodName:"getConfirmedTransaction",args:this._buildArgsAtLeastConfirmed([e],t,"jsonParsed")})));return(await this._rpcBatchRequest(r)).map((e=>{const t=zu(e,Ip);if("error"in t)throw new Error("failed to get confirmed transactions: "+t.error.message);return t.result}))}async getConfirmedSignaturesForAddress(e,t,r){let n={},i=await this.getFirstAvailableBlock();for(;!("until"in n)&&!(--t<=0||t<i);)try{const e=await this.getConfirmedBlockSignatures(t,"finalized");e.signatures.length>0&&(n.until=e.signatures[e.signatures.length-1].toString())}catch(s){if(s instanceof Error&&s.message.includes("skipped"))continue;throw s}let o=await this.getSlot("finalized");for(;!("before"in n||++r>o);)try{const e=await this.getConfirmedBlockSignatures(r);e.signatures.length>0&&(n.before=e.signatures[e.signatures.length-1].toString())}catch(s){if(s instanceof Error&&s.message.includes("skipped"))continue;throw s}return(await this.getConfirmedSignaturesForAddress2(e,n)).map((e=>e.signature))}async getConfirmedSignaturesForAddress2(e,t,r){const n=this._buildArgsAtLeastConfirmed([e.toBase58()],r,void 0,t),i=zu(await this._rpcRequest("getConfirmedSignaturesForAddress2",n),ep);if("error"in i)throw new Error("failed to get confirmed signatures for address: "+i.error.message);return i.result}async getSignaturesForAddress(e,t,r){const n=this._buildArgsAtLeastConfirmed([e.toBase58()],r,void 0,t),i=zu(await this._rpcRequest("getSignaturesForAddress",n),tp);if("error"in i)throw new Error("failed to get signatures for address: "+i.error.message);return i.result}async getNonceAndContext(e,t){const{context:r,value:n}=await this.getAccountInfoAndContext(e,t);let i=null;return null!==n&&(i=$d.fromAccountData(n.data)),{context:r,value:i}}async getNonce(e,t){return await this.getNonceAndContext(e,t).then((e=>e.value)).catch((t=>{throw new Error("failed to get nonce for account "+e.toBase58()+": "+t)}))}async requestAirdrop(e,t){const r=zu(await this._rpcRequest("requestAirdrop",[e.toBase58(),t]),Lp);if("error"in r)throw new Error("airdrop to "+e.toBase58()+" failed: "+r.error.message);return r.result}async _blockhashWithExpiryBlockHeight(e){if(!e){for(;this._pollingBlockhash;)await Gd(100);const e=Date.now()-this._blockhashInfo.lastFetch>=3e4;if(null!==this._blockhashInfo.latestBlockhash&&!e)return this._blockhashInfo.latestBlockhash}return await this._pollNewBlockhash()}async _pollNewBlockhash(){this._pollingBlockhash=!0;try{const e=Date.now(),t=this._blockhashInfo.latestBlockhash,r=t?t.blockhash:null;for(let n=0;n<50;n++){const e=await this.getLatestBlockhash("finalized");if(r!==e.blockhash)return this._blockhashInfo={latestBlockhash:e,lastFetch:Date.now(),transactionSignatures:[],simulatedSignatures:[]},e;await Gd(200)}throw new Error(`Unable to obtain a new blockhash after ${Date.now()-e}ms`)}finally{this._pollingBlockhash=!1}}async simulateTransaction(e,t,r){let n;if(e instanceof jd){let t=e;n=new jd,n.feePayer=t.feePayer,n.instructions=e.instructions,n.nonceInfo=t.nonceInfo,n.signatures=t.signatures}else n=jd.populate(e),n._message=n._json=void 0;if(n.nonceInfo&&t)n.sign(...t);else{let e=this._disableBlockhashCaching;for(;;){const r=await this._blockhashWithExpiryBlockHeight(e);if(n.lastValidBlockHeight=r.lastValidBlockHeight,n.recentBlockhash=r.blockhash,!t)break;if(n.sign(...t),!n.signature)throw new Error("!signature");const i=n.signature.toString("base64");if(!this._blockhashInfo.simulatedSignatures.includes(i)&&!this._blockhashInfo.transactionSignatures.includes(i)){this._blockhashInfo.simulatedSignatures.push(i);break}e=!0}}const i=n._compile(),o=i.serialize(),s=n._serialize(o).toString("base64"),a={encoding:"base64",commitment:this.commitment};if(r){const e=(Array.isArray(r)?r:i.nonProgramIds()).map((e=>e.toBase58()));a.accounts={encoding:"base64",addresses:e}}t&&(a.sigVerify=!0);const c=[s,a],u=zu(await this._rpcRequest("simulateTransaction",c),Of);if("error"in u){let e;if("data"in u.error&&(e=u.error.data.logs,e&&Array.isArray(e))){const t="\n ",r=t+e.join(t);console.error(u.error.message,r)}throw new pf("failed to simulate transaction: "+u.error.message,e)}return u.result}async sendTransaction(e,t,r){if(e.nonceInfo)e.sign(...t);else{let r=this._disableBlockhashCaching;for(;;){const n=await this._blockhashWithExpiryBlockHeight(r);if(e.lastValidBlockHeight=n.lastValidBlockHeight,e.recentBlockhash=n.blockhash,e.sign(...t),!e.signature)throw new Error("!signature");const i=e.signature.toString("base64");if(!this._blockhashInfo.transactionSignatures.includes(i)){this._blockhashInfo.transactionSignatures.push(i);break}r=!0}}const n=e.serialize();return await this.sendRawTransaction(n,r)}async sendRawTransaction(e,t){const r=sl(e).toString("base64");return await this.sendEncodedTransaction(r,t)}async sendEncodedTransaction(e,t){const r={encoding:"base64"},n=t&&t.skipPreflight,i=t&&t.preflightCommitment||this.commitment;t&&t.maxRetries&&(r.maxRetries=t.maxRetries),n&&(r.skipPreflight=n),i&&(r.preflightCommitment=i);const o=[e,r],s=zu(await this._rpcRequest("sendTransaction",o),zp);if("error"in s){let e;throw"data"in s.error&&(e=s.error.data.logs),new pf("failed to send transaction: "+s.error.message,e)}return s.result}_wsOnOpen(){this._rpcWebSocketConnected=!0,this._rpcWebSocketHeartbeat=setInterval((()=>{this._rpcWebSocket.notify("ping").catch((()=>{}))}),5e3),this._updateSubscriptions()}_wsOnError(e){this._rpcWebSocketConnected=!1,console.error("ws error:",e.message)}_wsOnClose(e){this._rpcWebSocketConnected=!1,this._rpcWebSocketGeneration++,this._rpcWebSocketHeartbeat&&(clearInterval(this._rpcWebSocketHeartbeat),this._rpcWebSocketHeartbeat=null),1e3!==e?(this._subscriptionCallbacksByServerSubscriptionId={},Object.entries(this._subscriptionsByHash).forEach((([e,t])=>{this._subscriptionsByHash[e]={...t,state:"pending"}}))):this._updateSubscriptions()}async _updateSubscriptions(){if(0===Object.keys(this._subscriptionsByHash).length)return void(this._rpcWebSocketConnected&&(this._rpcWebSocketConnected=!1,this._rpcWebSocketIdleTimeout=setTimeout((()=>{this._rpcWebSocketIdleTimeout=null;try{this._rpcWebSocket.close()}catch(e){e instanceof Error&&console.log(`Error when closing socket connection: ${e.message}`)}}),500)));if(null!==this._rpcWebSocketIdleTimeout&&(clearTimeout(this._rpcWebSocketIdleTimeout),this._rpcWebSocketIdleTimeout=null,this._rpcWebSocketConnected=!0),!this._rpcWebSocketConnected)return void this._rpcWebSocket.connect();const e=this._rpcWebSocketGeneration,t=()=>e===this._rpcWebSocketGeneration;await Promise.all(Object.keys(this._subscriptionsByHash).map((async e=>{const r=this._subscriptionsByHash[e];if(void 0!==r)switch(r.state){case"pending":case"unsubscribed":if(0===r.callbacks.size)return delete this._subscriptionsByHash[e],"unsubscribed"===r.state&&delete this._subscriptionCallbacksByServerSubscriptionId[r.serverSubscriptionId],void(await this._updateSubscriptions());await(async()=>{const{args:n,method:i}=r;try{this._subscriptionsByHash[e]={...r,state:"subscribing"};const t=await this._rpcWebSocket.call(i,n);this._subscriptionsByHash[e]={...r,serverSubscriptionId:t,state:"subscribed"},this._subscriptionCallbacksByServerSubscriptionId[t]=r.callbacks,await this._updateSubscriptions()}catch(o){if(o instanceof Error&&console.error(`${i} error for argument`,n,o.message),!t())return;this._subscriptionsByHash[e]={...r,state:"pending"},await this._updateSubscriptions()}})();break;case"subscribed":0===r.callbacks.size&&await(async()=>{const{serverSubscriptionId:n,unsubscribeMethod:i}=r;if(this._subscriptionsAutoDisposedByRpc.has(n))this._subscriptionsAutoDisposedByRpc.delete(n);else{this._subscriptionsByHash[e]={...r,state:"unsubscribing"};try{await this._rpcWebSocket.call(i,[n])}catch(o){if(o instanceof Error&&console.error(`${i} error:`,o.message),!t())return;return this._subscriptionsByHash[e]={...r,state:"subscribed"},void(await this._updateSubscriptions())}}this._subscriptionsByHash[e]={...r,state:"unsubscribed"},await this._updateSubscriptions()})()}})))}_handleServerNotification(e,t){const r=this._subscriptionCallbacksByServerSubscriptionId[e];void 0!==r&&r.forEach((e=>{try{e(...t)}catch(r){console.error(r)}}))}_wsOnAccountNotification(e){const{result:t,subscription:r}=zu(e,rp);this._handleServerNotification(r,[t.value,t.context])}_makeSubscription(e,t){const r=this._nextClientSubscriptionId++,n=hf([e.method,t],!0),i=this._subscriptionsByHash[n];return void 0===i?this._subscriptionsByHash[n]={...e,args:t,callbacks:new Set([e.callback]),state:"pending"}:i.callbacks.add(e.callback),this._subscriptionDisposeFunctionsByClientSubscriptionId[r]=async()=>{delete this._subscriptionDisposeFunctionsByClientSubscriptionId[r];const t=this._subscriptionsByHash[n];_d(void 0!==t,`Could not find a \`Subscription\` when tearing down client subscription #${r}`),t.callbacks.delete(e.callback),await this._updateSubscriptions()},this._updateSubscriptions(),r}onAccountChange(e,t,r){const n=this._buildArgs([e.toBase58()],r||this._commitment||"finalized","base64");return this._makeSubscription({callback:t,method:"accountSubscribe",unsubscribeMethod:"accountUnsubscribe"},n)}async removeAccountChangeListener(e){await this._unsubscribeClientSubscription(e,"account change")}_wsOnProgramAccountNotification(e){const{result:t,subscription:r}=zu(e,ip);this._handleServerNotification(r,[{accountId:t.value.pubkey,accountInfo:t.value.account},t.context])}onProgramAccountChange(e,t,r,n){const i=this._buildArgs([e.toBase58()],r||this._commitment||"finalized","base64",n?{filters:n}:void 0);return this._makeSubscription({callback:t,method:"programSubscribe",unsubscribeMethod:"programUnsubscribe"},i)}async removeProgramAccountChangeListener(e){await this._unsubscribeClientSubscription(e,"program account change")}onLogs(e,t,r){const n=this._buildArgs(["object"==typeof e?{mentions:[e.toString()]}:e],r||this._commitment||"finalized");return this._makeSubscription({callback:t,method:"logsSubscribe",unsubscribeMethod:"logsUnsubscribe"},n)}async removeOnLogsListener(e){await this._unsubscribeClientSubscription(e,"logs")}_wsOnLogsNotification(e){const{result:t,subscription:r}=zu(e,_p);this._handleServerNotification(r,[t.value,t.context])}_wsOnSlotNotification(e){const{result:t,subscription:r}=zu(e,sp);this._handleServerNotification(r,[t])}onSlotChange(e){return this._makeSubscription({callback:e,method:"slotSubscribe",unsubscribeMethod:"slotUnsubscribe"},[])}async removeSlotChangeListener(e){await this._unsubscribeClientSubscription(e,"slot change")}_wsOnSlotUpdatesNotification(e){const{result:t,subscription:r}=zu(e,cp);this._handleServerNotification(r,[t])}onSlotUpdate(e){return this._makeSubscription({callback:e,method:"slotsUpdatesSubscribe",unsubscribeMethod:"slotsUpdatesUnsubscribe"},[])}async removeSlotUpdateListener(e){await this._unsubscribeClientSubscription(e,"slot update")}async _unsubscribeClientSubscription(e,t){const r=this._subscriptionDisposeFunctionsByClientSubscriptionId[e];r?await r():console.warn(`Ignored unsubscribe request because an active subscription with id \`${e}\` for '${t}' events could not be found.`)}_buildArgs(e,t,r,n){const i=t||this._commitment;if(i||r||n){let t={};r&&(t.encoding=r),i&&(t.commitment=i),n&&(t=Object.assign(t,n)),e.push(t)}return e}_buildArgsAtLeastConfirmed(e,t,r,n){const i=t||this._commitment;if(i&&!["confirmed","finalized"].includes(i))throw new Error("Using Connection with default commitment: `"+this._commitment+"`, but method requires at least `confirmed`");return this._buildArgs(e,t,r,n)}_wsOnSignatureNotification(e){const{result:t,subscription:r}=zu(e,up);"receivedSignature"!==t.value&&this._subscriptionsAutoDisposedByRpc.add(r),this._handleServerNotification(r,"receivedSignature"===t.value?[{type:"received"},t.context]:[{type:"status",result:t.value},t.context])}onSignature(e,t,r){const n=this._buildArgs([e],r||this._commitment||"finalized"),i=this._makeSubscription({callback:(e,r)=>{if("status"===e.type){t(e.result,r);try{this.removeSignatureListener(i)}catch(n){}}},method:"signatureSubscribe",unsubscribeMethod:"signatureUnsubscribe"},n);return i}onSignatureWithOptions(e,t,r){const{commitment:n,...i}={...r,commitment:r&&r.commitment||this._commitment||"finalized"},o=this._buildArgs([e],n,void 0,i),s=this._makeSubscription({callback:(e,r)=>{t(e,r);try{this.removeSignatureListener(s)}catch(n){}},method:"signatureSubscribe",unsubscribeMethod:"signatureUnsubscribe"},o);return s}async removeSignatureListener(e){await this._unsubscribeClientSubscription(e,"signature result")}_wsOnRootNotification(e){const{result:t,subscription:r}=zu(e,lp);this._handleServerNotification(r,[t])}onRootChange(e){return this._makeSubscription({callback:e,method:"rootSubscribe",unsubscribeMethod:"rootUnsubscribe"},[])}async removeRootChangeListener(e){await this._unsubscribeClientSubscription(e,"root change")}}class Dp{constructor(e){this._keypair=void 0,this._keypair=e||gu().sign.keyPair()}static generate(){return new Dp(gu().sign.keyPair())}static fromSecretKey(e,t){const r=gu().sign.keyPair.fromSecretKey(e);if(!t||!t.skipValidation){const e=(new TextEncoder).encode("@solana/web3.js-validation-v1"),t=gu().sign.detached(e,r.secretKey);if(!gu().sign.detached.verify(e,t,r.publicKey))throw new Error("provided secretKey is invalid")}return new Dp(r)}static fromSeed(e){return new Dp(gu().sign.keyPair.fromSeed(e))}get publicKey(){return new Nd(this._keypair.publicKey)}get secretKey(){return this._keypair.secretKey}}const Vp=Su.n_([Su.u8("numSignatures"),Su.u8("padding"),Su.KB("signatureOffset"),Su.KB("signatureInstructionIndex"),Su.KB("publicKeyOffset"),Su.KB("publicKeyInstructionIndex"),Su.KB("messageDataOffset"),Su.KB("messageDataSize"),Su.KB("messageInstructionIndex")]);class jp{constructor(){}static createInstructionWithPublicKey(e){const{publicKey:t,message:r,signature:n,instructionIndex:i}=e;_d(32===t.length,`Public Key must be 32 bytes but received ${t.length} bytes`),_d(64===n.length,`Signature must be 64 bytes but received ${n.length} bytes`);const o=Vp.span,s=o+t.length,a=s+n.length,c=yu.Buffer.alloc(a+r.length),u=null==i?65535:i;return Vp.encode({numSignatures:1,padding:0,signatureOffset:s,signatureInstructionIndex:u,publicKeyOffset:o,publicKeyInstructionIndex:u,messageDataOffset:a,messageDataSize:r.length,messageInstructionIndex:u},c),c.fill(t,o),c.fill(n,s),c.fill(r,a),new Vd({keys:[],programId:jp.programId,data:c})}static createInstructionWithPrivateKey(e){const{privateKey:t,message:r,instructionIndex:n}=e;_d(64===t.length,`Private key must be 64 bytes but received ${t.length} bytes`);try{const e=Dp.fromSecretKey(t),i=e.publicKey.toBytes(),o=gu().sign.detached(r,e.secretKey);return this.createInstructionWithPublicKey({publicKey:i,message:r,signature:o,instructionIndex:n})}catch(h2){throw new Error(`Error creating instruction; ${h2}`)}}}jp.programId=new Nd("Ed25519SigVerify111111111111111111111111111");const Fp=new Nd("StakeConfig11111111111111111111111111111111");class Hp{constructor(e,t,r){this.unixTimestamp=void 0,this.epoch=void 0,this.custodian=void 0,this.unixTimestamp=e,this.epoch=t,this.custodian=r}}Hp.default=new Hp(0,0,Nd.default);const Wp=Object.freeze({Initialize:{index:0,layout:Su.n_([Su.Jq("instruction"),((e="authorized")=>Su.n_([Bd("staker"),Bd("withdrawer")],e))(),((e="lockup")=>Su.n_([Su.gM("unixTimestamp"),Su.gM("epoch"),Bd("custodian")],e))()])},Authorize:{index:1,layout:Su.n_([Su.Jq("instruction"),Bd("newAuthorized"),Su.Jq("stakeAuthorizationType")])},Delegate:{index:2,layout:Su.n_([Su.Jq("instruction")])},Split:{index:3,layout:Su.n_([Su.Jq("instruction"),Su.gM("lamports")])},Withdraw:{index:4,layout:Su.n_([Su.Jq("instruction"),Su.gM("lamports")])},Deactivate:{index:5,layout:Su.n_([Su.Jq("instruction")])},Merge:{index:7,layout:Su.n_([Su.Jq("instruction")])},AuthorizeWithSeed:{index:8,layout:Su.n_([Su.Jq("instruction"),Bd("newAuthorized"),Su.Jq("stakeAuthorizationType"),Od("authoritySeed"),Bd("authorityOwner")])}});Object.freeze({Staker:{index:0},Withdrawer:{index:1}});class Kp{constructor(){}static initialize(e){const{stakePubkey:t,authorized:r,lockup:n}=e,i=n||Hp.default,o=Zd(Wp.Initialize,{authorized:{staker:sl(r.staker.toBuffer()),withdrawer:sl(r.withdrawer.toBuffer())},lockup:{unixTimestamp:i.unixTimestamp,epoch:i.epoch,custodian:sl(i.custodian.toBuffer())}}),s={keys:[{pubkey:t,isSigner:!1,isWritable:!0},{pubkey:Wd,isSigner:!1,isWritable:!1}],programId:this.programId,data:o};return new Vd(s)}static createAccountWithSeed(e){const t=new jd;t.add(tf.createAccountWithSeed({fromPubkey:e.fromPubkey,newAccountPubkey:e.stakePubkey,basePubkey:e.basePubkey,seed:e.seed,lamports:e.lamports,space:this.space,programId:this.programId}));const{stakePubkey:r,authorized:n,lockup:i}=e;return t.add(this.initialize({stakePubkey:r,authorized:n,lockup:i}))}static createAccount(e){const t=new jd;t.add(tf.createAccount({fromPubkey:e.fromPubkey,newAccountPubkey:e.stakePubkey,lamports:e.lamports,space:this.space,programId:this.programId}));const{stakePubkey:r,authorized:n,lockup:i}=e;return t.add(this.initialize({stakePubkey:r,authorized:n,lockup:i}))}static delegate(e){const{stakePubkey:t,authorizedPubkey:r,votePubkey:n}=e,i=Zd(Wp.Delegate);return(new jd).add({keys:[{pubkey:t,isSigner:!1,isWritable:!0},{pubkey:n,isSigner:!1,isWritable:!1},{pubkey:Fd,isSigner:!1,isWritable:!1},{pubkey:Kd,isSigner:!1,isWritable:!1},{pubkey:Fp,isSigner:!1,isWritable:!1},{pubkey:r,isSigner:!0,isWritable:!1}],programId:this.programId,data:i})}static authorize(e){const{stakePubkey:t,authorizedPubkey:r,newAuthorizedPubkey:n,stakeAuthorizationType:i,custodianPubkey:o}=e,s=Zd(Wp.Authorize,{newAuthorized:sl(n.toBuffer()),stakeAuthorizationType:i.index}),a=[{pubkey:t,isSigner:!1,isWritable:!0},{pubkey:Fd,isSigner:!1,isWritable:!0},{pubkey:r,isSigner:!0,isWritable:!1}];return o&&a.push({pubkey:o,isSigner:!1,isWritable:!1}),(new jd).add({keys:a,programId:this.programId,data:s})}static authorizeWithSeed(e){const{stakePubkey:t,authorityBase:r,authoritySeed:n,authorityOwner:i,newAuthorizedPubkey:o,stakeAuthorizationType:s,custodianPubkey:a}=e,c=Zd(Wp.AuthorizeWithSeed,{newAuthorized:sl(o.toBuffer()),stakeAuthorizationType:s.index,authoritySeed:n,authorityOwner:sl(i.toBuffer())}),u=[{pubkey:t,isSigner:!1,isWritable:!0},{pubkey:r,isSigner:!0,isWritable:!1},{pubkey:Fd,isSigner:!1,isWritable:!1}];return a&&u.push({pubkey:a,isSigner:!1,isWritable:!1}),(new jd).add({keys:u,programId:this.programId,data:c})}static splitInstruction(e){const{stakePubkey:t,authorizedPubkey:r,splitStakePubkey:n,lamports:i}=e,o=Zd(Wp.Split,{lamports:i});return new Vd({keys:[{pubkey:t,isSigner:!1,isWritable:!0},{pubkey:n,isSigner:!1,isWritable:!0},{pubkey:r,isSigner:!0,isWritable:!1}],programId:this.programId,data:o})}static split(e){const t=new jd;return t.add(tf.createAccount({fromPubkey:e.authorizedPubkey,newAccountPubkey:e.splitStakePubkey,lamports:0,space:this.space,programId:this.programId})),t.add(this.splitInstruction(e))}static splitWithSeed(e){const{stakePubkey:t,authorizedPubkey:r,splitStakePubkey:n,basePubkey:i,seed:o,lamports:s}=e,a=new jd;return a.add(tf.allocate({accountPubkey:n,basePubkey:i,seed:o,space:this.space,programId:this.programId})),a.add(this.splitInstruction({stakePubkey:t,authorizedPubkey:r,splitStakePubkey:n,lamports:s}))}static merge(e){const{stakePubkey:t,sourceStakePubKey:r,authorizedPubkey:n}=e,i=Zd(Wp.Merge);return(new jd).add({keys:[{pubkey:t,isSigner:!1,isWritable:!0},{pubkey:r,isSigner:!1,isWritable:!0},{pubkey:Fd,isSigner:!1,isWritable:!1},{pubkey:Kd,isSigner:!1,isWritable:!1},{pubkey:n,isSigner:!0,isWritable:!1}],programId:this.programId,data:i})}static withdraw(e){const{stakePubkey:t,authorizedPubkey:r,toPubkey:n,lamports:i,custodianPubkey:o}=e,s=Zd(Wp.Withdraw,{lamports:i}),a=[{pubkey:t,isSigner:!1,isWritable:!0},{pubkey:n,isSigner:!1,isWritable:!0},{pubkey:Fd,isSigner:!1,isWritable:!1},{pubkey:Kd,isSigner:!1,isWritable:!1},{pubkey:r,isSigner:!0,isWritable:!1}];return o&&a.push({pubkey:o,isSigner:!1,isWritable:!1}),(new jd).add({keys:a,programId:this.programId,data:s})}static deactivate(e){const{stakePubkey:t,authorizedPubkey:r}=e,n=Zd(Wp.Deactivate);return(new jd).add({keys:[{pubkey:t,isSigner:!1,isWritable:!0},{pubkey:Fd,isSigner:!1,isWritable:!1},{pubkey:r,isSigner:!0,isWritable:!1}],programId:this.programId,data:n})}}Kp.programId=new Nd("Stake11111111111111111111111111111111111111"),Kp.space=200;const{publicKeyCreate:Xp,ecdsaSign:Gp}=ol(),Zp=Su.n_([Su.u8("numSignatures"),Su.KB("signatureOffset"),Su.u8("signatureInstructionIndex"),Su.KB("ethAddressOffset"),Su.u8("ethAddressInstructionIndex"),Su.KB("messageDataOffset"),Su.KB("messageDataSize"),Su.u8("messageInstructionIndex"),Su.Ik(20,"ethAddress"),Su.Ik(64,"signature"),Su.u8("recoveryId")]);class Jp{constructor(){}static publicKeyToEthAddress(e){_d(64===e.length,`Public key must be 64 bytes but received ${e.length} bytes`);try{return yu.Buffer.from(Ot().keccak_256.update(sl(e)).digest()).slice(-20)}catch(h2){throw new Error(`Error constructing Ethereum address: ${h2}`)}}static createInstructionWithPublicKey(e){const{publicKey:t,message:r,signature:n,recoveryId:i,instructionIndex:o}=e;return Jp.createInstructionWithEthAddress({ethAddress:Jp.publicKeyToEthAddress(t),message:r,signature:n,recoveryId:i,instructionIndex:o})}static createInstructionWithEthAddress(e){const{ethAddress:t,message:r,signature:n,recoveryId:i,instructionIndex:o=0}=e;let s;s="string"==typeof t?t.startsWith("0x")?yu.Buffer.from(t.substr(2),"hex"):yu.Buffer.from(t,"hex"):t,_d(20===s.length,`Address must be 20 bytes but received ${s.length} bytes`);const a=12+s.length,c=a+n.length+1,u=yu.Buffer.alloc(Zp.span+r.length);return Zp.encode({numSignatures:1,signatureOffset:a,signatureInstructionIndex:o,ethAddressOffset:12,ethAddressInstructionIndex:o,messageDataOffset:c,messageDataSize:r.length,messageInstructionIndex:o,signature:sl(n),ethAddress:sl(s),recoveryId:i},u),u.fill(sl(r),Zp.span),new Vd({keys:[],programId:Jp.programId,data:u})}static createInstructionWithPrivateKey(e){const{privateKey:t,message:r,instructionIndex:n}=e;_d(32===t.length,`Private key must be 32 bytes but received ${t.length} bytes`);try{const e=sl(t),i=Xp(e,!1).slice(1),o=yu.Buffer.from(Ot().keccak_256.update(sl(r)).digest()),{signature:s,recid:a}=Gp(o,e);return this.createInstructionWithPublicKey({publicKey:i,message:r,signature:s,recoveryId:a,instructionIndex:n})}catch(h2){throw new Error(`Error creating instruction; ${h2}`)}}}Jp.programId=new Nd("KeccakSecp256k11111111111111111111111111111");new Nd("Va1idator1nfo111111111111111111111111111111"),Yu({name:Zu(),website:Xu(Zu()),details:Xu(Zu()),keybaseUsername:Xu(Zu())});new Nd("Vote111111111111111111111111111111111111111"),Su.n_([Bd("nodePubkey"),Bd("authorizedWithdrawer"),Su.u8("commission"),Su._O(),Su.A9(Su.n_([Su._O("slot"),Su.Jq("confirmationCount")]),Su.cv(Su.Jq(),-8),"votes"),Su.u8("rootSlotValid"),Su._O("rootSlot"),Su._O(),Su.A9(Su.n_([Su._O("epoch"),Bd("authorizedVoter")]),Su.cv(Su.Jq(),-8),"authorizedVoters"),Su.n_([Su.A9(Su.n_([Bd("authorizedPubkey"),Su._O("epochOfLastAuthorizedSwitch"),Su._O("targetEpoch")]),32,"buf"),Su._O("idx"),Su.u8("isEmpty")],"priorVoters"),Su._O(),Su.A9(Su.n_([Su._O("epoch"),Su._O("credits"),Su._O("prevCredits")]),Su.cv(Su.Jq(),-8),"epochCredits"),Su.n_([Su._O("slot"),Su._O("timestamp")],"lastTimestamp")]);const Yp=Object.freeze({InitializeAccount:{index:0,layout:Su.n_([Su.Jq("instruction"),((e="voteInit")=>Su.n_([Bd("nodePubkey"),Bd("authorizedVoter"),Bd("authorizedWithdrawer"),Su.u8("commission")],e))()])},Authorize:{index:1,layout:Su.n_([Su.Jq("instruction"),Bd("newAuthorized"),Su.Jq("voteAuthorizationType")])},Withdraw:{index:3,layout:Su.n_([Su.Jq("instruction"),Su.gM("lamports")])}});Object.freeze({Voter:{index:0},Withdrawer:{index:1}});class Qp{constructor(){}static initializeAccount(e){const{votePubkey:t,nodePubkey:r,voteInit:n}=e,i=Zd(Yp.InitializeAccount,{voteInit:{nodePubkey:sl(n.nodePubkey.toBuffer()),authorizedVoter:sl(n.authorizedVoter.toBuffer()),authorizedWithdrawer:sl(n.authorizedWithdrawer.toBuffer()),commission:n.commission}}),o={keys:[{pubkey:t,isSigner:!1,isWritable:!0},{pubkey:Wd,isSigner:!1,isWritable:!1},{pubkey:Fd,isSigner:!1,isWritable:!1},{pubkey:r,isSigner:!0,isWritable:!1}],programId:this.programId,data:i};return new Vd(o)}static createAccount(e){const t=new jd;return t.add(tf.createAccount({fromPubkey:e.fromPubkey,newAccountPubkey:e.votePubkey,lamports:e.lamports,space:this.space,programId:this.programId})),t.add(this.initializeAccount({votePubkey:e.votePubkey,nodePubkey:e.voteInit.nodePubkey,voteInit:e.voteInit}))}static authorize(e){const{votePubkey:t,authorizedPubkey:r,newAuthorizedPubkey:n,voteAuthorizationType:i}=e,o=Zd(Yp.Authorize,{newAuthorized:sl(n.toBuffer()),voteAuthorizationType:i.index}),s=[{pubkey:t,isSigner:!1,isWritable:!0},{pubkey:Fd,isSigner:!1,isWritable:!1},{pubkey:r,isSigner:!0,isWritable:!1}];return(new jd).add({keys:s,programId:this.programId,data:o})}static withdraw(e){const{votePubkey:t,authorizedWithdrawerPubkey:r,lamports:n,toPubkey:i}=e,o=Zd(Yp.Withdraw,{lamports:n}),s=[{pubkey:t,isSigner:!1,isWritable:!0},{pubkey:i,isSigner:!1,isWritable:!0},{pubkey:r,isSigner:!0,isWritable:!1}];return(new jd).add({keys:s,programId:this.programId,data:o})}}Qp.programId=new Nd("Vote111111111111111111111111111111111111111"),Qp.space=3731;const $p={http:{devnet:"http://api.devnet.solana.com",testnet:"http://api.testnet.solana.com","mainnet-beta":"http://api.mainnet-beta.solana.com/"},https:{devnet:"https://api.devnet.solana.com",testnet:"https://api.testnet.solana.com","mainnet-beta":"https://api.mainnet-beta.solana.com/"}};const em=(e,t)=>lu(e,t),tm=e=>L(void 0,void 0,void 0,(function*(){const t=yield fetch("https://api.coingecko.com/api/v3/simple/price?ids=bitcoin&vs_currencies=usd"),r=yield t.json();return(parseFloat(e)/r.bitcoin.usd).toString()})),rm=e=>L(void 0,void 0,void 0,(function*(){const t=yield fetch("https://api.coingecko.com/api/v3/simple/price?ids=ethereum&vs_currencies=usd"),r=yield t.json(),n=(parseFloat(e)/r.ethereum.usd).toString().slice(0,18);return em(n,"ether").toString()})),nm=[{name:"btc",displayName:"Bitcoin",symbol:"BTC",type:[{name:"mainnet",id:0}]},{name:"bsc",displayName:"BNB",symbol:"BNB",type:[{name:"mainnet",id:38},{name:"testnet",id:61}]},{name:"eth",symbol:"ETH",displayName:"Ethereum",type:[{name:"mainnet",id:1},{name:"ropsten",id:3},{name:"rinkeby",id:4}]},{name:"solana",symbol:"SOL",displayName:"Solana",type:[{name:"mainnet-beta",id:1},{name:"testnet",id:2},{name:"devnet",id:3}]},{name:"polkadot",symbol:"DOT",displayName:"Polkadot",type:[{name:"polkadot",id:0},{name:"kusama",id:2},{name:"westend",id:42}]}];class im extends class{constructor(e){if(this.provider=e,!e)throw new Error("Web3 is not supported. Not provider provided");this._provider=e}isConnected(){var e,t;return L(this,void 0,void 0,(function*(){return null!==(t=null===(e=this._provider)||void 0===e?void 0:e.isConnected())&&void 0!==t&&t}))}connect(){var e;return L(this,void 0,void 0,(function*(){yield null===(e=this._provider)||void 0===e?void 0:e.connect()}))}}{constructor(e){super(e)}requestPayment(e){return L(this,void 0,void 0,(function*(){const{to:t,symbol:r,chainId:n,amount:i}=e,o={from:yield this._accountValidation(t,r,i,n),to:t,value:yield this._getAmoountWithCurrencyConversion(i,r),chainId:n};console.log("[INFO] Sending payment transaction...",o);return yield this._provider.sendTransaction(o)}))}_accountValidation(e,t,r,n){return L(this,void 0,void 0,(function*(){if(!e)throw new Error("No payment destination address provided");yield this._provider.checkNetwork(t,n);let i=yield this._provider.getAccounts();if(!(i&&i.length||(console.log("[INFO] User is not logged with Crypto Wallet, requesting authentication..."),yield this._provider.connect(),i=yield this._provider.getAccounts(),i&&i.length)))throw new Error("User is not logged in to Crypto Wallet");if(i[0]===e)throw new Error("Payment address must be different to destination address");const o=yield this._provider.getBalance(i[0]);if(o&&parseFloat(o)<parseFloat(r))throw new Error("User does not have enough funds");return i[0]}))}_getAmoountWithCurrencyConversion(e,t){return L(this,void 0,void 0,(function*(){let r;switch(!0){case"ETH"===t:r=yield(n=e.toString(),L(void 0,void 0,void 0,(function*(){const e=yield fetch("https://api.coingecko.com/api/v3/simple/price?ids=ethereum&vs_currencies=usd"),t=yield e.json();return(parseFloat(n)/t.ethereum.usd).toString()})));break;case"BNB"===t:r=yield(e=>L(void 0,void 0,void 0,(function*(){const t=yield fetch("https://api.coingecko.com/api/v3/simple/price?ids=binancecoin&vs_currencies=usd"),r=yield t.json();return(parseFloat(e)/r.binancecoin.usd).toString()})))(null==e?void 0:e.toString());break;case"SOL"===t:r=yield(e=>L(void 0,void 0,void 0,(function*(){const t=yield fetch("https://api.coingecko.com/api/v3/simple/price?ids=solana&vs_currencies=usd"),r=yield t.json();return(parseFloat(e)/r.solana.usd).toString()})))(null==e?void 0:e.toString())}var n;return r}))}}class om{constructor(e,t){this.provider=e,this._web3Provider=e,this._walletProvider=new Zc(e,"any"),this._listenEvents(t||window)}isConnected(){var e;return L(this,void 0,void 0,(function*(){return!!(null===(e=this._walletProvider)||void 0===e?void 0:e.send)&&this._walletProvider.listAccounts().then((e=>e.length>0)).catch((()=>!1))}))}connect(){var e,t,r;return L(this,void 0,void 0,(function*(){if(!(yield this.isConnected()))try{yield null===(r=null===(t=null===(e=this._walletProvider)||void 0===e?void 0:e.send("eth_requestAccounts",[]))||void 0===t?void 0:t.then((()=>!0)))||void 0===r?void 0:r.catch((()=>!1)),console.log("[INFO] Wallet provider connected"),yield this.isConnected()}catch(h2){throw new Error("Wallet provider not connected")}}))}checkNetwork(e,t){var r;return L(this,void 0,void 0,(function*(){const n=nm.find((t=>t.symbol===e));if(!n)throw new Error("Unknown chain network");const{id:i=null}=n.type.find((e=>e.id===t))||n.type.find((e=>e.name.includes("mainnet")))||{};if(!i)throw new Error("Unknown network");t=i;if((yield this.getChainId())!==t&&(null===(r=this._web3Provider)||void 0===r?void 0:r.request))try{yield this._web3Provider.request({method:"wallet_switchEthereumChain",params:[{chainId:`0x${t}`}]})}catch(h2){const t=h2.message.includes("Unrecognized chain ID")?`${n.name.toUpperCase()} network not configured. Please install network and configure your wallet before try again.`:(null==h2?void 0:h2.message)||"Unknown error";throw new Error(t)}}))}getAccounts(e){return L(this,void 0,void 0,(function*(){return this._walletProvider.listAccounts()}))}getBalance(e){return L(this,void 0,void 0,(function*(){return(yield this._walletProvider.getBalance(e)).toString()}))}getChainId(){return L(this,void 0,void 0,(function*(){return(yield this._walletProvider.getNetwork()).chainId}))}sendTransaction(e,t){var r;return L(this,void 0,void 0,(function*(){if(!e.value)throw new Error("No value provided");const n=this._walletProvider.getSigner(),i=yield n.sendTransaction(Object.assign(Object.assign({},e),{value:em(null===(r=e.value)||void 0===r?void 0:r.toString(),"ether")}));t&&t(null,i.hash),console.log("[INFO] Transaction response:",i);const o=yield i.wait();return console.log("[INFO] Transaction receipt:",o),o}))}_listenEvents(e=window){this._walletProvider.on("network",((e,t)=>{console.log("[INFO] Network changed:",e,t)}))}}class sm{constructor(e,t){const r=new qp(function(e,t){const r=!1===t?"http":"https";if(!e)return $p[r].devnet;const n=$p[r][e];if(!n)throw new Error(`Unknown ${r} cluster: ${e}`);return n}("testnet"));this._web3Provider=e,this._walletProvider=r,this._listenEvents(t||window)}isConnected(){return L(this,void 0,void 0,(function*(){return!!this._web3Provider&&this._web3Provider.isConnected}))}connect(){return L(this,void 0,void 0,(function*(){yield this._web3Provider.connect(),yield this.isConnected()}))}checkNetwork(e,t){return L(this,void 0,void 0,(function*(){const r=nm.find((t=>t.symbol===e));if(!r)throw new Error("Unknown chain network");const{id:n=null}=r.type.find((e=>e.id===t))||r.type.find((e=>e.name.includes("mainnet")))||{};if(!n)throw new Error("Network is not correct. Switching to correct network")}))}getAccounts(e){var t;return L(this,void 0,void 0,(function*(){const e=this._publicKey;if(!e&&this._web3Provider&&!0!==this._web3Provider.isConnected&&(yield this._web3Provider.connect()),!e&&!this._web3Provider)throw new Error("No Solana Wallet connection available");if(!e)throw new Error("No public key available");const r=yield this._walletProvider.getAccountInfo(e);return console.log("[INFO] Solana Wallet account info:",r),r?[null===(t=null==r?void 0:r.owner)||void 0===t?void 0:t.toString()]:[]}))}getBalance(e){return L(this,void 0,void 0,(function*(){return(yield this._walletProvider.getBalance(new Nd(e))).toString()}))}getChainId(){return L(this,void 0,void 0,(function*(){throw new Error("getChainId() Not implemented")}))}sendTransaction(e,t){var r;return L(this,void 0,void 0,(function*(){if(!this._publicKey)throw new Error("No public key available");const{blockhash:t}=yield this._walletProvider.getRecentBlockhash(),n=new jd({feePayer:this._publicKey,recentBlockhash:t});var i;n.add(tf.transfer({fromPubkey:this._publicKey,toPubkey:new Nd(e.destAddr),lamports:(i=null===(r=null==e?void 0:e.value)||void 0===r?void 0:r.toString(),1e9*parseFloat(i))})),this._web3Provider.signTransaction(n);const o=yield this._walletProvider.sendRawTransaction(n.serialize());console.log(`[INFO] Transaction ID: ${o}`);const s=yield this._walletProvider.confirmTransaction(o);return console.log(`[INFO] Confirmation slot: ${s.context.slot}`),console.log("[INFO] Transaction response:",n),console.log("[INFO] Transaction receipt:",s),s}))}_listenEvents(e=window){this._web3Provider.on("connect",(e=>{this._publicKey=e,console.log("[INFO] Web3 provider connected:",e.toString())})),this._web3Provider.on("disconnect",(e=>{this._publicKey=void 0,console.log("[INFO] Web3 provider connected:",e.toString())}))}}new URL("file:///Users/dev-fazio/Nicolas%20Fazio/repos/test/cryptobtnwrapper/node_modules/@polkadot/x-global/packageInfo.js").pathname.substring(0,new URL("file:///Users/dev-fazio/Nicolas%20Fazio/repos/test/cryptobtnwrapper/node_modules/@polkadot/x-global/packageInfo.js").pathname.lastIndexOf("/")+1);const am="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:Function("return this");function cm(e,t){return void 0===am[e]?t:am[e]}const um={name:"@polkadot/x-textdecoder",path:new URL("file:///Users/dev-fazio/Nicolas%20Fazio/repos/test/cryptobtnwrapper/node_modules/@polkadot/x-textdecoder/packageInfo.js").pathname.substring(0,new URL("file:///Users/dev-fazio/Nicolas%20Fazio/repos/test/cryptobtnwrapper/node_modules/@polkadot/x-textdecoder/packageInfo.js").pathname.lastIndexOf("/")+1),type:"esm",version:"9.2.1"},lm=cm("TextDecoder",class{constructor(e){}decode(e){let t="";for(let r=0;r<e.length;r++)t+=String.fromCharCode(e[r]);return t}});const hm={name:"@polkadot/x-textencoder",path:new URL("file:///Users/dev-fazio/Nicolas%20Fazio/repos/test/cryptobtnwrapper/node_modules/@polkadot/x-textencoder/packageInfo.js").pathname.substring(0,new URL("file:///Users/dev-fazio/Nicolas%20Fazio/repos/test/cryptobtnwrapper/node_modules/@polkadot/x-textencoder/packageInfo.js").pathname.lastIndexOf("/")+1),type:"esm",version:"9.2.1"},dm=cm("TextEncoder",class{encode(e){const t=new Uint8Array(e.length);for(let r=0;r<e.length;r++)t[r]=e.charCodeAt(r);return t}}),fm=[um,hm],pm={name:"@polkadot/util",path:new URL("file:///Users/dev-fazio/Nicolas%20Fazio/repos/test/cryptobtnwrapper/node_modules/@polkadot/util/packageInfo.js").pathname.substring(0,new URL("file:///Users/dev-fazio/Nicolas%20Fazio/repos/test/cryptobtnwrapper/node_modules/@polkadot/util/packageInfo.js").pathname.lastIndexOf("/")+1),type:"esm",version:"9.2.1"};function mm(e){return"function"==typeof e}function gm(e){return null===e}function ym(e){return void 0===e}function bm(e,t){if(!e)throw new Error(mm(t)?t():t)}function vm(e,t){return bm(!ym(e)&&!gm(e),t),e}function wm(e,{name:t}){return[e,t]}function xm(e,{path:t,type:r}){let n;if(t&&t.length>=5){const e=t.indexOf("node_modules");n=-1===e?t:t.substring(e)}else n="<unknown>";return[`${`${r||""}`.padStart(3)} ${e}`,n]}function km(e,t){if(e)return e;if(mm(t))try{return t()||""}catch(h2){return""}return t||""}function Sm(e,t,r){console.warn(`${e}\nEither remove and explicitly install matching versions or dedupe using your package manager.\nThe following conflicting packages were found:\n${function(e,t){let r=0;for(let n=0;n<e.length;n++)r=Math.max(r,e[n].version.length);return e.map((e=>`\t${t(e.version.padEnd(r),e).join("\t")}`)).join("\n")}(t,r)}`)}function Em({name:e,path:t,type:r,version:n},i,o=[]){bm(e.startsWith("@polkadot"),(()=>`Invalid package descriptor ${e}`));const s=function(e){const t=am;return t.__polkadotjs||(t.__polkadotjs={}),t.__polkadotjs[e]||(t.__polkadotjs[e]=[]),t.__polkadotjs[e]}(e);if(s.push({path:km(t,i),type:r,version:n}),1!==s.length)Sm(`${e} has multiple versions, ensure that there is only one installed.`,s,xm);else{const t=o.filter((e=>e&&e.version!==n));t.length&&Sm(`${e} requires direct dependencies exactly matching version ${n}.`,t,wm)}}function Am(e,t){const r=Math.ceil(e.length/t),n=Array(r);for(let i=0;i<r;i++){const r=i*t;n[i]=e.slice(r,r+t)}return n}function Nm(e){let t=0;for(let i=0;i<e.length;i++)t+=e[i].length;const r=new Array(t);let n=-1;for(let i=0;i<e.length;i++){const t=e[i];for(let e=0;e<t.length;e++)r[++n]=t[e]}return r}Em(pm,null,fm);new URL("file:///Users/dev-fazio/Nicolas%20Fazio/repos/test/cryptobtnwrapper/node_modules/@polkadot/x-bigint/packageInfo.js").pathname.substring(0,new URL("file:///Users/dev-fazio/Nicolas%20Fazio/repos/test/cryptobtnwrapper/node_modules/@polkadot/x-bigint/packageInfo.js").pathname.lastIndexOf("/")+1);const Tm="function"==typeof am.BigInt&&"function"==typeof am.BigInt.asIntN?am.BigInt:()=>Number.NaN,Pm=Tm(0),Mm=Tm(1);Tm(1e6),Tm(1e9),Tm(Number.MAX_SAFE_INTEGER);function Im(e,...t){for(let n=0;n<t.length;n++){const i=t[n];if(i){const t=(r=i,Object.keys(r));for(let r=0;r<t.length;r++){const n=t[r];e[n]=i[n]}}}var r;return e}const Cm=Tm(256),Rm=Tm(65536);function Bm(e){const t=new DataView(e.buffer,e.byteOffset),r=e.length%2,n=e.length-r;let i=Tm(0);for(let o=0;o<n;o+=2)i=i*Rm+Tm(t.getUint16(o));return r&&(i=i*Cm+Tm(t.getUint8(n))),i}function Om(e,t={}){if(!e||!e.length)return Tm(0);const{isLe:r,isNegative:n}=Im({isLe:!0,isNegative:!1},t),i=r?e.reverse():e;return n?Bm(function(e){const t=new Uint8Array(e.length),r=new DataView(e.buffer,e.byteOffset),n=new DataView(t.buffer),i=e.length%2,o=e.length-i;for(let s=0;s<o;s+=2)n.setUint16(s,65535^r.getUint16(s));return i&&n.setUint8(o,255^r.getUint8(o)),t}(i))*-Mm-Mm:Bm(i)}const Lm=new Array(256),zm=new Array(65536),Um={},_m={};for(let d2=0;d2<256;d2++){const e=d2.toString(16).padStart(2,"0");Lm[d2]=e,Um[e]=d2}for(let d2=0;d2<256;d2++)for(let e=0;e<256;e++){const t=Lm[d2]+Lm[e],r=d2<<8|e;zm[r]=t,_m[t]=r}const qm=/^0x[\da-fA-F]+$/,Dm=/^[\da-fA-F]+$/;function Vm(e,t=-1,r){return"string"==typeof e&&("0x"===e||qm.test(e))&&(-1===t?r||e.length%2==0:e.length===2+Math.ceil(t/4))}function jm(e){if(!e||"0x"===e)return"";if(qm.test(e))return e.substring(2);if(Dm.test(e))return e;throw new Error(`Expected hex value to convert, found '${e}'`)}function Fm(e,t=-1){if(!e)return new Uint8Array;const r=jm(e).toLowerCase(),n=r.length/2,i=Math.ceil(-1===t?n:t/8),o=new Uint8Array(i),s=i>n?i-n:0,a=new DataView(o.buffer,s),c=(i-s)%2,u=i-s-c;for(let l=0;l<u;l+=2){const e=2*l;a.setUint16(l,_m[r.substring(e,e+4)])}return c&&a.setUint8(u,Um[r.substring(r.length-2)]),o}function Hm(e){return bu.isBN(e)}function Wm(e){return!!e&&"object"==typeof e}function Km(...e){return t=>(Wm(t)||mm(t))&&e.every((e=>mm(t[e])))}function Xm(...e){return t=>Wm(t)&&e.every((e=>mm(t[e])))}const Gm=Km("toBigInt"),Zm=Km("toBn");function Jm(e){return"bigint"==typeof e?e:e?Vm(e)?function(e,t={}){return e&&"0x"!==e?Om(Fm(e),Im({isLe:!1,isNegative:!1},t)):Tm(0)}(e.toString()):Hm(e)?Tm(e.toString()):Gm(e)?e.toBigInt():Zm(e)?Tm(e.toBn().toString()):Tm(e):Tm(0)}Tm(94906265);const Ym="function"==typeof Tm&&"function"==typeof Tm.asIntN,Qm="undefined"!=typeof Buffer,$m="object"==typeof process;function eg(e){return Qm&&Buffer.isBuffer(e)}function tg(e){return e instanceof Uint8Array}const rg=new dm;function ng(e){return e?rg.encode(e.toString()):new Uint8Array}function ig(e){return e?Array.isArray(e)||eg(e)?new Uint8Array(e):tg(e)?e:Vm(e)?Fm(e):ng(e):new Uint8Array}function og(...e){let t=0,r=0;const n=new Array(e.length);for(let o=0;o<e.length;o++)n[o]=ig(e[o]),t+=n[o].length;const i=new Uint8Array(t);for(let o=0;o<n.length;o++)i.set(n[o],r),r+=n[o].length;return i}function sg(e){for(let t=0;t<e.length;t++)if(e[t])return!1;return!0}function ag(e,t){const r=ig(e),n=ig(t);if(r.length===n.length){const e=new DataView(r.buffer,r.byteOffset),t=new DataView(n.buffer,n.byteOffset),i=r.length%4,o=r.length-i;for(let r=0;r<o;r+=4)if(e.getUint32(r)!==t.getUint32(r))return!1;for(let s=o;s<r.length;s++)if(r[s]!==n[s])return!1;return!0}return!1}function cg(e){return"boolean"==typeof e}function ug(e,t={}){const{isLe:r,isNegative:n}=Im({isLe:!0,isNegative:!1},cg(t)?{isLe:t}:t),i=new bu(e,r?"le":"be");return n&&e.length?i.fromTwos(8*e.length):i}function lg(e){const t=e.length%2,r=e.length-t,n=new DataView(e.buffer,e.byteOffset);let i="";for(let o=0;o<r;o+=2)i+=zm[n.getUint16(o)];return t&&(i+=Lm[n.getUint8(r)]),i}function hg(e,t=-1,r=!0){const n=Math.ceil(t/8);return`${r?"0x":""}${e&&e.length?n>0&&e.length>n?`${lg(e.subarray(0,n/2))}\u2026${lg(e.subarray(e.length-n/2))}`:lg(e):""}`}const dg=new lm("utf-8");function fg(e){return null!=e&&e.length?dg.decode(e):""}const pg=ig("\x19Ethereum Signed Message:\n"),mg=ig("<Bytes>"),gg=ig("</Bytes>"),yg=mg.length+gg.length;function bg(e,t){return e.length>=yg&&ag(e.subarray(0,mg.length),mg)&&ag(e.slice(-gg.length),gg)||t&&e.length>=pg.length&&ag(e.subarray(0,pg.length),pg)}const vg=Tm(256),wg=Tm(255);function xg(e,t){const r=Im({bitLength:-1,isLe:!0,isNegative:!1},t),n=Jm(e);if(n===Pm)return-1===r.bitLength?new Uint8Array:new Uint8Array(Math.ceil((r.bitLength||0)/8));const i=function(e,{isLe:t,isNegative:r}){const n=[];for(r&&(e=(e+Mm)*-Mm);e!==Pm;){const i=e%vg,o=Number(r?i^wg:i);t?n.push(o):n.unshift(o),e=(e-i)/vg}return Uint8Array.from(n)}(n,r);if(-1===r.bitLength)return i;const o=Math.ceil((r.bitLength||0)/8),s=new Uint8Array(o);return r.isNegative&&s.fill(255),s.set(i,r.isLe?0:o-i.length),s}const kg=new bu(0),Sg=new bu(1),Eg=new bu(2),Ag=(new bu(3),new bu(4),new bu(5),new bu(6),new bu(7),new bu(8),new bu(9),new bu(10),new bu(100)),Ng=(new bu(1e3),new bu(1e6)),Tg=new bu(1e9),Pg=Tg.mul(Tg),Mg=new bu(Number.MAX_SAFE_INTEGER);function Ig(e,t={}){if(!e||"0x"===e)return new bu(0);const{isLe:r,isNegative:n}=Im({isLe:!1,isNegative:!1},cg(t)?{isLe:t}:t),i=jm(e),o=new bu(i,16,r?"le":"be");return n?o.fromTwos(4*i.length):o}function Cg(e,t){bm(e.length>=1,"Must provide one or more BN arguments");let r=e[0];for(let n=1;n<e.length;n++)r=t(r,e[n]);return r}function Rg(...e){return Cg(e,bu.max)}function Bg(e){return"bigint"==typeof e}function Og(e){return e?bu.isBN(e)?e:Vm(e)?Ig(e.toString()):Bg(e)?new bu(e.toString()):Zm(e)?e.toBn():Gm(e)?new bu(e.toBigInt().toString()):new bu(e):new bu(0)}const Lg=new bu(94906265);function zg(e){const t=Og(e);if(bm(t.gte(kg),"square root of negative numbers is not supported"),t.lte(Mg))return new bu(Math.floor(Math.sqrt(t.toNumber())));let r=Lg.clone();for(;;){const e=t.div(r).iadd(r).ishrn(1);if(r.eq(e)||r.eq(e.sub(Sg)))return r;r=e}}function Ug(e){return"number"==typeof e}const _g={bitLength:-1,isLe:!0,isNegative:!1};function qg(e,t=_g,r){const{bitLength:n,isLe:i,isNegative:o}=Im({bitLength:-1,isLe:!0,isNegative:!1},Ug(t)?{bitLength:t,isLe:r}:t),s=Og(e),a=-1===n?Math.ceil(s.bitLength()/8):Math.ceil((n||0)/8);if(!e)return-1===n?new Uint8Array:new Uint8Array(a);const c=new Uint8Array(a),u=o?s.toTwos(8*a):s;return c.set(u.toArray(i?"le":"be",a),0),c}const Dg={bitLength:-1,isLe:!1,isNegative:!1};const Vg=Eg.pow(new bu(6)).isub(Sg),jg=Eg.pow(new bu(14)).isub(Sg),Fg=Eg.pow(new bu(30)).isub(Sg),Hg={bitLength:16},Wg={bitLength:32};function Kg(e){const t=Og(e);if(t.lte(Vg))return new Uint8Array([t.toNumber()<<2]);if(t.lte(jg))return qg(t.shln(2).iadd(Sg),Hg);if(t.lte(Fg))return qg(t.shln(2).iadd(Eg),Wg);const r=qg(t);let n=r.length;for(;0===r[n-1];)n--;return bm(n>=4,"Invalid length, previous checks match anything less than 2^30"),og([3+(n-4<<2)],r.subarray(0,n))}function Xg(e){return og(Kg(e.length),e)}function Gg(e){const t=ig(e),r=3&t[0];if(0===r)return[1,new bu(t[0]>>>2)];if(1===r)return[2,new bu(t[0]+256*t[1]>>>2)];if(2===r)return[4,new bu(t[0]+256*t[1]+65536*t[2]+16777216*t[3]>>>2)];const n=5+(t[0]>>>2);return[n,ug(t.subarray(1,n))]}function Zg(e){const[t,r]=Gg(e),n=t+r.toNumber();return[n,e.subarray(t,n)]}const Jg=new RegExp("(\\d+?)(?=(\\d{3})+(?!\\d)|$)","g");function Yg(e){const t=e[0].startsWith("-"),r=t?e.substring(1).match(Jg):e.match(Jg);return r?`${t?"-":""}${r.join(",")}`:e}const Qg=[{power:-24,text:"yocto",value:"y"},{power:-21,text:"zepto",value:"z"},{power:-18,text:"atto",value:"a"},{power:-15,text:"femto",value:"f"},{power:-12,text:"pico",value:"p"},{power:-9,text:"nano",value:"n"},{power:-6,text:"micro",value:"\xb5"},{power:-3,text:"milli",value:"m"},{power:0,text:"Unit",value:"-"},{power:3,text:"Kilo",value:"k"},{power:6,text:"Mill",value:"M"},{power:9,text:"Bill",value:"B"},{power:12,text:"Tril",value:"T"},{power:15,text:"Peta",value:"P"},{power:18,text:"Exa",value:"E"},{power:21,text:"Zeta",value:"Z"},{power:24,text:"Yotta",value:"Y"}];function $g(e){for(let t=0;t<Qg.length;t++)if(Qg[t].value===e)return Qg[t];return Qg[8]}function ey(e,t,r){if(r)return $g(r);const n=7+Math.ceil((e.length-t)/3);return Qg[n]||Qg[n<0?0:Qg.length-1]}const ty=Qg[8].text;let ry=0,ny=ty;const iy=function(e,t=!0,r=ry){let n=Og(e).toString();if(0===n.length||"0"===n)return"0";const{decimals:i=r,forceUnit:o,withSi:s=!0,withSiFull:a=!1,withUnit:c=!0}=cg(t)?{withSi:t}:t;let u="";n[0].startsWith("-")&&(u="-",n=n.substring(1));const[l,h,d]=function(e,t,r){const n=ey(e,t,r),i=e.length-(t+n.power);return[n,e.substring(0,i)||"0",`${`${new Array(1+(i<0?0-i:0)).join("0")}${e}`.substring(i<0?0:i)}0000`.substring(0,4)]}(n,i,o),f=function(e,t,r,n){const i=cg(n)?Qg[8].text:n;return t||r?"-"===e.value?n?` ${i}`:"":` ${r?`${e.text}${n?" ":""}`:e.value}${n?i:""}`:""}(l,s,a,c);return`${u}${Yg(h)}.${d}${f}`};function oy(e){return e.toString().padStart(2,"0")}function sy(e){return Yg(Og(e).toString())}function ay(e){return"string"==typeof e||e instanceof String}iy.calcSi=(e,t=ry)=>ey(e,t),iy.findSi=$g,iy.getDefaults=()=>({decimals:ry,unit:ny}),iy.getOptions=(e=ry)=>Qg.filter((({power:t})=>!(t<0)||e+t>=0)),iy.setDefaults=({decimals:e,unit:t})=>{ry=ym(e)?ry:Array.isArray(e)?e[0]:e,ny=ym(t)?ny:Array.isArray(t)?t[0]:t,Qg[8].text=ny};const cy=[9,10,13];function uy(e){return e<127&&(e>=32||cy.includes(e))}function ly(e){return uy(e.charCodeAt(0))}function hy(e){const t=ay(e);return e?t&&!Vm(e)?e.toString().split("").every(ly):ig(e).every(uy):t}const dy=Xm("toHex","toU8a"),fy=Xm("get");function py(e){return dy(e)&&fy(e.registry)}Xm("toBigInt","toBn","toNumber","unwrap");r(22263);function my(e,t){return Bg(t)?t.toString():t}function gy(e,t){return JSON.stringify(e,my,t)}Km("next"),Xm("catch","then");new Uint8Array([0,97,115,109]);function yy(e,t,r,n){const i=n?n(t):t.toString();let o;Object.defineProperty(e,i,{configurable:!0,enumerable:!0,get:function(){if(ym(o)){o=r(t);try{Object.defineProperty(this,i,{value:o})}catch{}}return o}})}function by(e,t,r,n){for(let i=0;i<t.length;i++)yy(e,t[i],r,n);return e}const vy={debug:"log",error:"error",log:"log",warn:"warn"};function wy(e){return Array.isArray(e)?e.map(wy):Hm(e)?e.toString():tg(e)||eg(e)?hg(ig(e)):function(e){if(e&&Wm(e)&&e.constructor===Object){const t={};for(const r of Object.keys(e))t[r]=wy(e[r]);return t}return e}(e)}function xy(e,t,r,n=-1){if(1===r.length&&mm(r[0])){const i=r[0]();return xy(e,t,Array.isArray(i)?i:[i],n)}var i;console[vy[e]](function(e){return`${e.getFullYear().toString()}-${oy(e.getMonth()+1)}-${oy(e.getDate())} ${oy(e.getHours())}:${oy(e.getMinutes())}:${oy(e.getSeconds())}`}(new Date),t,...r.map(wy).map((i=n,e=>{if(i<=0)return e;const t=`${e}`;return t.length<i?e:`${t.substring(0,i)} ...`})))}function ky(){}function Sy(e,t){return!!e&&("*"===e||t===e||e.endsWith("*")&&t.startsWith(e.slice(0,-1)))}function Ey(e,t){return!!e&&e.startsWith("-")&&(t===e.slice(1)||e.endsWith("*")&&t.startsWith(e.slice(1,-1)))}function Ay(e,t){let r=!1;for(const n of e)Sy(n,t)?r=!0:Ey(n,t)&&(r=!1);return r}function Ny(e){const t=`${e.toUpperCase()}:`.padStart(16),[r,n]=function(e){const t=($m?process:{}).env||{},r=parseInt(t.DEBUG_MAX||"-1",10);return[Ay((t.DEBUG||"").toLowerCase().split(","),e),isNaN(r)?-1:r]}(e.toLowerCase());return{debug:r?(...e)=>xy("debug",t,e,n):ky,error:(...e)=>xy("error",t,e),log:(...e)=>xy("log",t,e),noop:ky,warn:(...e)=>xy("warn",t,e)}}function Ty(){return"none"}function Py(e,{getInstanceId:t=Ty}={}){const r={},n=(...n)=>{const i=gy(n),o=t();return r[o]||(r[o]={}),ym(r[o][i])&&(r[o][i]=e(...n)),r[o][i]};return n.unmemoize=(...e)=>{const n=gy(e),i=t();r[i]&&!ym(r[i][n])&&delete r[i][n]},n}function My(e,t,r){!Object.prototype.hasOwnProperty.call(e,t)&&ym(e[t])&&Object.defineProperty(e,t,{enumerable:!0,get:()=>r(t)})}function Iy(e,t,r){for(let n=0;n<t.length;n++)My(e,t[n],(e=>r(e,n)))}function Cy(e){return t=>t.toString().replace(/[-_., ]+/g," ").trim().split(" ").map(((t,r)=>((t,r)=>e(t[0],r)+t.slice(1))(t.toUpperCase()===t?t.toLowerCase():t.replace(/^[A-Z0-9]{2,}[^a-z]/,(e=>e.slice(0,e.length-1).toLowerCase()+e.slice(-1).toUpperCase())),r))).join("")}const Ry=Cy(((e,t)=>t?e.toUpperCase():e.toLowerCase())),By=Cy((e=>e.toUpperCase()));function Oy(e){return t=>t?e(t[0])+t.slice(1):""}Oy((e=>e.toLowerCase())),Oy((e=>e.toUpperCase()));const Ly={name:"@polkadot/api-derive",path:new URL("file:///Users/dev-fazio/Nicolas%20Fazio/repos/test/cryptobtnwrapper/node_modules/@polkadot/api-derive/packageInfo.js").pathname.substring(0,new URL("file:///Users/dev-fazio/Nicolas%20Fazio/repos/test/cryptobtnwrapper/node_modules/@polkadot/api-derive/packageInfo.js").pathname.lastIndexOf("/")+1),type:"esm",version:"8.4.2"},zy={name:"@polkadot/rpc-core",path:new URL("file:///Users/dev-fazio/Nicolas%20Fazio/repos/test/cryptobtnwrapper/node_modules/@polkadot/rpc-core/packageInfo.js").pathname.substring(0,new URL("file:///Users/dev-fazio/Nicolas%20Fazio/repos/test/cryptobtnwrapper/node_modules/@polkadot/rpc-core/packageInfo.js").pathname.lastIndexOf("/")+1),type:"esm",version:"8.4.2"},Uy={name:"@polkadot/rpc-provider",path:new URL("file:///Users/dev-fazio/Nicolas%20Fazio/repos/test/cryptobtnwrapper/node_modules/@polkadot/rpc-provider/packageInfo.js").pathname.substring(0,new URL("file:///Users/dev-fazio/Nicolas%20Fazio/repos/test/cryptobtnwrapper/node_modules/@polkadot/rpc-provider/packageInfo.js").pathname.lastIndexOf("/")+1),type:"esm",version:"8.4.2"},_y={name:"@polkadot/types",path:new URL("file:///Users/dev-fazio/Nicolas%20Fazio/repos/test/cryptobtnwrapper/node_modules/@polkadot/types/packageInfo.js").pathname.substring(0,new URL("file:///Users/dev-fazio/Nicolas%20Fazio/repos/test/cryptobtnwrapper/node_modules/@polkadot/types/packageInfo.js").pathname.lastIndexOf("/")+1),type:"esm",version:"8.4.2"},qy={name:"@polkadot/types-known",path:new URL("file:///Users/dev-fazio/Nicolas%20Fazio/repos/test/cryptobtnwrapper/node_modules/@polkadot/types-known/packageInfo.js").pathname.substring(0,new URL("file:///Users/dev-fazio/Nicolas%20Fazio/repos/test/cryptobtnwrapper/node_modules/@polkadot/types-known/packageInfo.js").pathname.lastIndexOf("/")+1),type:"esm",version:"8.4.2"},Dy=[Ly,zy,Uy,_y,qy],Vy={name:"@polkadot/api",path:new URL("file:///Users/dev-fazio/Nicolas%20Fazio/repos/test/cryptobtnwrapper/node_modules/@polkadot/api/packageInfo.js").pathname.substring(0,new URL("file:///Users/dev-fazio/Nicolas%20Fazio/repos/test/cryptobtnwrapper/node_modules/@polkadot/api/packageInfo.js").pathname.lastIndexOf("/")+1),type:"esm",version:"8.4.2"};Em(Vy,null,Dy);const jy=[zy,_y];Em({name:"@polkadot/rpc-augment",path:new URL("file:///Users/dev-fazio/Nicolas%20Fazio/repos/test/cryptobtnwrapper/node_modules/@polkadot/rpc-augment/packageInfo.js").pathname.substring(0,new URL("file:///Users/dev-fazio/Nicolas%20Fazio/repos/test/cryptobtnwrapper/node_modules/@polkadot/rpc-augment/packageInfo.js").pathname.lastIndexOf("/")+1),type:"esm",version:"8.4.2"},null,jy);const Fy={name:"@polkadot/util-crypto",path:new URL("file:///Users/dev-fazio/Nicolas%20Fazio/repos/test/cryptobtnwrapper/node_modules/@polkadot/util-crypto/packageInfo.js").pathname.substring(0,new URL("file:///Users/dev-fazio/Nicolas%20Fazio/repos/test/cryptobtnwrapper/node_modules/@polkadot/util-crypto/packageInfo.js").pathname.lastIndexOf("/")+1),type:"esm",version:"9.2.1"},Hy=[pm,Fy];Em({name:"@polkadot/keyring",path:new URL("file:///Users/dev-fazio/Nicolas%20Fazio/repos/test/cryptobtnwrapper/node_modules/@polkadot/keyring/packageInfo.js").pathname.substring(0,new URL("file:///Users/dev-fazio/Nicolas%20Fazio/repos/test/cryptobtnwrapper/node_modules/@polkadot/keyring/packageInfo.js").pathname.lastIndexOf("/")+1),type:"esm",version:"9.2.1"},null,Hy);function Wy(e){return am.crypto.getRandomValues(e)}var Ky,Xy;Em(Fy,null,[{name:"@polkadot/networks",path:new URL("file:///Users/dev-fazio/Nicolas%20Fazio/repos/test/cryptobtnwrapper/node_modules/@polkadot/networks/packageInfo.js").pathname.substring(0,new URL("file:///Users/dev-fazio/Nicolas%20Fazio/repos/test/cryptobtnwrapper/node_modules/@polkadot/networks/packageInfo.js").pathname.lastIndexOf("/")+1),type:"esm",version:"9.2.1"},pm,{name:"@polkadot/x-randomvalues",path:new URL("file:///Users/dev-fazio/Nicolas%20Fazio/repos/test/cryptobtnwrapper/node_modules/@polkadot/x-randomvalues/packageInfo.js").pathname.substring(0,new URL("file:///Users/dev-fazio/Nicolas%20Fazio/repos/test/cryptobtnwrapper/node_modules/@polkadot/x-randomvalues/packageInfo.js").pathname.lastIndexOf("/")+1),type:"esm",version:"9.2.1"}]),Xy=Tm,void 0===am[Ky="BigInt"]&&(am[Ky]=Xy);var Gy=r(69314);const Zy=BigInt(0),Jy=BigInt(1),Yy=BigInt(2),Qy=BigInt(3),$y=BigInt(8),eb=Yy**BigInt(256),tb={a:Zy,b:BigInt(7),P:eb-Yy**BigInt(32)-BigInt(977),n:eb-BigInt("432420386565659656852420866394968145599"),h:Jy,Gx:BigInt("55066263022277343669578718895168534326250603453777594175500187360389116729240"),Gy:BigInt("32670510020758816978083085130507043184471273380659243275938904335757337482424"),beta:BigInt("0x7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee")};function rb(e){const{a:t,b:r}=tb,n=kb(e*e),i=kb(n*e);return kb(i+t*e+r)}const nb=tb.a===Zy;class ib{constructor(e,t,r){this.x=e,this.y=t,this.z=r}static fromAffine(e){if(!(e instanceof sb))throw new TypeError("JacobianPoint#fromAffine: expected Point");return new ib(e.x,e.y,Jy)}static toAffineBatch(e){const t=function(e,t=tb.P){const r=new Array(e.length),n=Eb(e.reduce(((e,n,i)=>n===Zy?e:(r[i]=e,kb(e*n,t))),Jy),t);return e.reduceRight(((e,n,i)=>n===Zy?e:(r[i]=kb(e*r[i],t),kb(e*n,t))),n),r}(e.map((e=>e.z)));return e.map(((e,r)=>e.toAffine(t[r])))}static normalizeZ(e){return ib.toAffineBatch(e).map(ib.fromAffine)}equals(e){if(!(e instanceof ib))throw new TypeError("JacobianPoint expected");const{x:t,y:r,z:n}=this,{x:i,y:o,z:s}=e,a=kb(n**Yy),c=kb(s**Yy),u=kb(t*c),l=kb(i*a),h=kb(kb(r*s)*c),d=kb(kb(o*n)*a);return u===l&&h===d}negate(){return new ib(this.x,kb(-this.y),this.z)}double(){const{x:e,y:t,z:r}=this,n=kb(e**Yy),i=kb(t**Yy),o=kb(i**Yy),s=kb(Yy*(kb((e+i)**Yy)-n-o)),a=kb(Qy*n),c=kb(a**Yy),u=kb(c-Yy*s),l=kb(a*(s-u)-$y*o),h=kb(Yy*t*r);return new ib(u,l,h)}add(e){if(!(e instanceof ib))throw new TypeError("JacobianPoint expected");const{x:t,y:r,z:n}=this,{x:i,y:o,z:s}=e;if(i===Zy||o===Zy)return this;if(t===Zy||r===Zy)return e;const a=kb(n**Yy),c=kb(s**Yy),u=kb(t*c),l=kb(i*a),h=kb(kb(r*s)*c),d=kb(kb(o*n)*a),f=kb(l-u),p=kb(d-h);if(f===Zy)return p===Zy?this.double():ib.ZERO;const m=kb(f**Yy),g=kb(f*m),y=kb(u*m),b=kb(p**Yy-g-Yy*y),v=kb(p*(y-b)-h*g),w=kb(n*s*f);return new ib(b,v,w)}subtract(e){return this.add(e.negate())}multiplyUnsafe(e){let t=xb(e);ib.BASE;const r=ib.ZERO;if(t===Zy)return r;if(t===Jy)return this;if(!nb){let e=r,n=this;for(;t>Zy;)t&Jy&&(e=e.add(n)),n=n.double(),t>>=Jy;return e}let{k1neg:n,k1:i,k2neg:o,k2:s}=Tb(t),a=r,c=r,u=this;for(;i>Zy||s>Zy;)i&Jy&&(a=a.add(u)),s&Jy&&(c=c.add(u)),u=u.double(),i>>=Jy,s>>=Jy;return n&&(a=a.negate()),o&&(c=c.negate()),c=new ib(kb(c.x*tb.beta),c.y,c.z),a.add(c)}precomputeWindow(e){const t=nb?128/e+1:256/e+1,r=[];let n=this,i=n;for(let o=0;o<t;o++){i=n,r.push(i);for(let t=1;t<2**(e-1);t++)i=i.add(n),r.push(i);n=i.double()}return r}wNAF(e,t){!t&&this.equals(ib.BASE)&&(t=sb.BASE);const r=t&&t._WINDOW_SIZE||1;if(256%r)throw new Error("Point#wNAF: Invalid precomputation window, must be power of 2");let n=t&&ob.get(t);n||(n=this.precomputeWindow(r),t&&1!==r&&(n=ib.normalizeZ(n),ob.set(t,n)));let i=ib.ZERO,o=ib.ZERO;const s=1+(nb?128/r:256/r),a=2**(r-1),c=BigInt(2**r-1),u=2**r,l=BigInt(r);for(let h=0;h<s;h++){const t=h*a;let r=Number(e&c);if(e>>=l,r>a&&(r-=u,e+=Jy),0===r){let e=n[t];h%2&&(e=e.negate()),o=o.add(e)}else{let e=n[t+Math.abs(r)-1];r<0&&(e=e.negate()),i=i.add(e)}}return{p:i,f:o}}multiply(e,t){let r,n,i=xb(e);if(nb){const{k1neg:e,k1:o,k2neg:s,k2:a}=Tb(i);let{p:c,f:u}=this.wNAF(o,t),{p:l,f:h}=this.wNAF(a,t);e&&(c=c.negate()),s&&(l=l.negate()),l=new ib(kb(l.x*tb.beta),l.y,l.z),r=c.add(l),n=u.add(h)}else{const{p:e,f:o}=this.wNAF(i,t);r=e,n=o}return ib.normalizeZ([r,n])[0]}toAffine(e=Eb(this.z)){const{x:t,y:r,z:n}=this,i=e,o=kb(i*i),s=kb(o*i),a=kb(t*o),c=kb(r*s);if(kb(n*i)!==Jy)throw new Error("invZ was invalid");return new sb(a,c)}}ib.BASE=new ib(tb.Gx,tb.Gy,Jy),ib.ZERO=new ib(Zy,Jy,Zy);const ob=new WeakMap;class sb{constructor(e,t){this.x=e,this.y=t}_setWindowSize(e){this._WINDOW_SIZE=e,ob.delete(this)}static fromCompressedHex(e){const t=32===e.length,r=vb(t?e:e.subarray(1));if(!Cb(r))throw new Error("Point is not on curve");let n=function(e){const{P:t}=tb,r=BigInt(6),n=BigInt(11),i=BigInt(22),o=BigInt(23),s=BigInt(44),a=BigInt(88),c=e*e*e%t,u=c*c*e%t,l=Sb(u,Qy)*u%t,h=Sb(l,Qy)*u%t,d=Sb(h,Yy)*c%t,f=Sb(d,n)*d%t,p=Sb(f,i)*f%t,m=Sb(p,s)*p%t,g=Sb(m,a)*m%t,y=Sb(g,s)*p%t,b=Sb(y,Qy)*u%t,v=Sb(b,o)*f%t,w=Sb(v,r)*c%t;return Sb(w,Yy)}(rb(r));const i=(n&Jy)===Jy;if(t)i&&(n=kb(-n));else{1==(1&e[0])!==i&&(n=kb(-n))}const o=new sb(r,n);return o.assertValidity(),o}static fromUncompressedHex(e){const t=vb(e.subarray(1,33)),r=vb(e.subarray(33,65)),n=new sb(t,r);return n.assertValidity(),n}static fromHex(e){const t=wb(e),r=t.length,n=t[0];if(32===r||33===r&&(2===n||3===n))return this.fromCompressedHex(t);if(65===r&&4===n)return this.fromUncompressedHex(t);throw new Error(`Point.fromHex: received invalid point. Expected 32-33 compressed bytes or 65 uncompressed bytes, not ${r}`)}static fromPrivateKey(e){return sb.BASE.multiply(Bb(e))}static fromSignature(e,t,r){const n=Pb(e=wb(e)),{r:i,s:o}=Ob(t);if(0!==r&&1!==r)throw new Error("Cannot recover signature: invalid recovery bit");if(n===Zy)throw new Error("Cannot recover signature: msgHash cannot be 0");const s=1&r?"03":"02",a=sb.fromHex(s+pb(i)),{n:c}=tb,u=Eb(i,c),l=kb(-n*u,c),h=kb(o*u,c),d=sb.BASE.multiplyAndAddUnsafe(a,l,h);if(!d)throw new Error("Cannot recover signature: point at infinify");return d.assertValidity(),d}toRawBytes(e=!1){return bb(this.toHex(e))}toHex(e=!1){const t=pb(this.x);if(e){return`${this.y&Jy?"03":"02"}${t}`}return`04${t}${pb(this.y)}`}toHexX(){return this.toHex(!0).slice(2)}toRawX(){return this.toRawBytes(!0).slice(1)}assertValidity(){const e="Point is not on elliptic curve",{x:t,y:r}=this;if(!Cb(t)||!Cb(r))throw new Error(e);const n=kb(r*r);if(kb(n-rb(t))!==Zy)throw new Error(e)}equals(e){return this.x===e.x&&this.y===e.y}negate(){return new sb(this.x,kb(-this.y))}double(){return ib.fromAffine(this).double().toAffine()}add(e){return ib.fromAffine(this).add(ib.fromAffine(e)).toAffine()}subtract(e){return this.add(e.negate())}multiply(e){return ib.fromAffine(this).multiply(e,this).toAffine()}multiplyAndAddUnsafe(e,t,r){const n=ib.fromAffine(this).multiply(t),i=ib.fromAffine(e).multiplyUnsafe(r),o=n.add(i);return o.equals(ib.ZERO)?void 0:o.toAffine()}}function ab(e){return Number.parseInt(e[0],16)>=8?"00"+e:e}function cb(e){if(e.length<2||2!==e[0])throw new Error(`Invalid signature integer tag: ${fb(e)}`);const t=e[1],r=e.subarray(2,t+2);if(!t||r.length!==t)throw new Error("Invalid signature integer: wrong length");if(0===r[0]&&r[1]<=127)throw new Error("Invalid signature integer: trailing length");return{data:vb(r),left:e.subarray(t+2)}}sb.BASE=new sb(tb.Gx,tb.Gy),sb.ZERO=new sb(Zy,Zy);class ub{constructor(e,t){this.r=e,this.s=t,this.assertValidity()}static fromCompact(e){const t=hb(e),r="Signature.fromCompact";if("string"!=typeof e&&!t)throw new TypeError(`${r}: Expected string or Uint8Array`);const n=t?fb(e):e;if(128!==n.length)throw new Error(`${r}: Expected 64-byte hex`);return new ub(yb(n.slice(0,64)),yb(n.slice(64,128)))}static fromDER(e){const t=hb(e);if("string"!=typeof e&&!t)throw new TypeError("Signature.fromDER: Expected string or Uint8Array");const{r,s:n}=function(e){if(e.length<2||48!=e[0])throw new Error(`Invalid signature tag: ${fb(e)}`);if(e[1]!==e.length-2)throw new Error("Invalid signature: incorrect length");const{data:t,left:r}=cb(e.subarray(2)),{data:n,left:i}=cb(r);if(i.length)throw new Error(`Invalid signature: left bytes after parsing: ${fb(i)}`);return{r:t,s:n}}(t?e:bb(e));return new ub(r,n)}static fromHex(e){return this.fromDER(e)}assertValidity(){const{r:e,s:t}=this;if(!Ib(e))throw new Error("Invalid Signature: r must be 0 < r < n");if(!Ib(t))throw new Error("Invalid Signature: s must be 0 < s < n")}hasHighS(){const e=tb.n>>Jy;return this.s>e}normalizeS(){return this.hasHighS()?new ub(this.r,tb.n-this.s):this}toDERRawBytes(e=!1){return bb(this.toDERHex(e))}toDERHex(e=!1){const t=ab(gb(this.s));if(e)return t;const r=ab(gb(this.r)),n=gb(r.length/2),i=gb(t.length/2);return`30${gb(r.length/2+t.length/2+4)}02${n}${r}02${i}${t}`}toRawBytes(){return this.toDERRawBytes()}toHex(){return this.toDERHex()}toCompactRawBytes(){return bb(this.toCompactHex())}toCompactHex(){return pb(this.r)+pb(this.s)}}function lb(...e){if(!e.every(hb))throw new Error("Uint8Array list expected");if(1===e.length)return e[0];const t=e.reduce(((e,t)=>e+t.length),0),r=new Uint8Array(t);for(let n=0,i=0;n<e.length;n++){const t=e[n];r.set(t,i),i+=t.length}return r}function hb(e){return e instanceof Uint8Array}const db=Array.from({length:256},((e,t)=>t.toString(16).padStart(2,"0")));function fb(e){if(!(e instanceof Uint8Array))throw new Error("Expected Uint8Array");let t="";for(let r=0;r<e.length;r++)t+=db[e[r]];return t}function pb(e){if(e>eb)throw new Error("Expected number < 2^256");return e.toString(16).padStart(64,"0")}function mb(e){return bb(pb(e))}function gb(e){const t=e.toString(16);return 1&t.length?`0${t}`:t}function yb(e){if("string"!=typeof e)throw new TypeError("hexToNumber: expected string, got "+typeof e);return BigInt(`0x${e}`)}function bb(e){if("string"!=typeof e)throw new TypeError("hexToBytes: expected string, got "+typeof e);if(e.length%2)throw new Error("hexToBytes: received invalid unpadded hex"+e.length);const t=new Uint8Array(e.length/2);for(let r=0;r<t.length;r++){const n=2*r,i=e.slice(n,n+2),o=Number.parseInt(i,16);if(Number.isNaN(o)||o<0)throw new Error("Invalid byte sequence");t[r]=o}return t}function vb(e){return yb(fb(e))}function wb(e){return e instanceof Uint8Array?Uint8Array.from(e):bb(e)}function xb(e){if("number"==typeof e&&Number.isSafeInteger(e)&&e>0)return BigInt(e);if("bigint"==typeof e&&Ib(e))return e;throw new TypeError("Expected valid private scalar: 0 < scalar < curve.n")}function kb(e,t=tb.P){const r=e%t;return r>=Zy?r:t+r}function Sb(e,t){const{P:r}=tb;let n=e;for(;t-- >Zy;)n*=n,n%=r;return n}function Eb(e,t=tb.P){if(e===Zy||t<=Zy)throw new Error(`invert: expected positive integers, got n=${e} mod=${t}`);let r=kb(e,t),n=t,i=Zy,o=Jy,s=Jy,a=Zy;for(;r!==Zy;){const e=n/r,t=n%r,c=i-s*e,u=o-a*e;n=r,r=t,i=s,o=a,s=c,a=u}if(n!==Jy)throw new Error("invert: does not exist");return kb(i,t)}const Ab=(e,t)=>(e+t/Yy)/t,Nb=Yy**BigInt(128);function Tb(e){const{n:t}=tb,r=BigInt("0x3086d221a7d46bcde86c90e49284eb15"),n=-Jy*BigInt("0xe4437ed6010e88286f547fa90abfe4c3"),i=BigInt("0x114ca50f7a8e2f3f657c1108d9d44cfd8"),o=r,s=Ab(o*e,t),a=Ab(-n*e,t);let c=kb(e-s*r-a*i,t),u=kb(-s*n-a*o,t);const l=c>Nb,h=u>Nb;if(l&&(c=t-c),h&&(u=t-u),c>Nb||u>Nb)throw new Error("splitScalarEndo: Endomorphism failed, k="+e);return{k1neg:l,k1:c,k2neg:h,k2:u}}function Pb(e){const{n:t}=tb,r=8*e.length-256;let n=vb(e);return r>0&&(n>>=BigInt(r)),n>=t&&(n-=t),n}class Mb{constructor(){this.v=new Uint8Array(32).fill(1),this.k=new Uint8Array(32).fill(0),this.counter=0}hmac(...e){return jb.hmacSha256(this.k,...e)}hmacSync(...e){if("function"!=typeof jb.hmacSha256Sync)throw new Error("utils.hmacSha256Sync is undefined, you need to set it");const t=jb.hmacSha256Sync(this.k,...e);if(t instanceof Promise)throw new Error("To use sync sign(), ensure utils.hmacSha256 is sync");return t}incr(){if(this.counter>=1e3)throw new Error("Tried 1,000 k values for sign(), all were invalid");this.counter+=1}async reseed(e=new Uint8Array){this.k=await this.hmac(this.v,Uint8Array.from([0]),e),this.v=await this.hmac(this.v),0!==e.length&&(this.k=await this.hmac(this.v,Uint8Array.from([1]),e),this.v=await this.hmac(this.v))}reseedSync(e=new Uint8Array){this.k=this.hmacSync(this.v,Uint8Array.from([0]),e),this.v=this.hmacSync(this.v),0!==e.length&&(this.k=this.hmacSync(this.v,Uint8Array.from([1]),e),this.v=this.hmacSync(this.v))}async generate(){return this.incr(),this.v=await this.hmac(this.v),this.v}generateSync(){return this.incr(),this.v=this.hmacSync(this.v),this.v}}function Ib(e){return Zy<e&&e<tb.n}function Cb(e){return Zy<e&&e<tb.P}function Rb(e,t,r){const n=vb(e);if(!Ib(n))return;const{n:i}=tb,o=sb.BASE.multiply(n),s=kb(o.x,i);if(s===Zy)return;const a=kb(Eb(n,i)*kb(t+r*s,i),i);if(a===Zy)return;const c=new ub(s,a);return{sig:c,recovery:(o.x===c.r?0:2)|Number(o.y&Jy)}}function Bb(e){let t;if("bigint"==typeof e)t=e;else if("number"==typeof e&&Number.isSafeInteger(e)&&e>0)t=BigInt(e);else if("string"==typeof e){if(64!==e.length)throw new Error("Expected 32 bytes of private key");t=yb(e)}else{if(!hb(e))throw new TypeError("Expected valid private key");if(32!==e.length)throw new Error("Expected 32 bytes of private key");t=vb(e)}if(!Ib(t))throw new Error("Expected private key: 0 < key < n");return t}function Ob(e){if(e instanceof ub)return e.assertValidity(),e;try{return ub.fromDER(e)}catch(h2){return ub.fromCompact(e)}}function Lb(e,t=!1){return sb.fromPrivateKey(e).toRawBytes(t)}function zb(e){return vb(e.length>32?e.slice(0,32):e)}function Ub(e){const t=zb(e),r=kb(t,tb.n);return _b(r<Zy?t:r)}function _b(e){if("bigint"!=typeof e)throw new Error("Expected bigint");return bb(pb(e))}function qb(e,t,r){if(null==e)throw new Error(`sign: expected valid message hash, not "${e}"`);const n=wb(e),i=Bb(t),o=[_b(i),Ub(n)];if(null!=r){!0===r&&(r=jb.randomBytes(32));const e=wb(r);if(32!==e.length)throw new Error("sign: Expected 32 bytes of extra data");o.push(e)}return{seed:lb(...o),m:zb(n),d:i}}function Db(e,t){let{sig:r,recovery:n}=e;const{canonical:i,der:o,recovered:s}=Object.assign({canonical:!0,der:!0},t);i&&r.hasHighS()&&(r=r.normalizeS(),n^=1);const a=o?r.toDERRawBytes():r.toCompactRawBytes();return s?[a,n]:a}sb.BASE._setWindowSize(8);const Vb={node:Gy,web:"object"==typeof self&&"crypto"in self?self.crypto:void 0},jb={isValidPrivateKey(e){try{return Bb(e),!0}catch(h2){return!1}},hashToPrivateKey:e=>{if((e=wb(e)).length<40||e.length>1024)throw new Error("Expected 40-1024 bytes of private key as per FIPS 186");const t=kb(vb(e),tb.n);if(t===Zy||t===Jy)throw new Error("Invalid private key");return mb(t)},randomBytes:(e=32)=>{if(Vb.web)return Vb.web.getRandomValues(new Uint8Array(e));if(Vb.node){const{randomBytes:t}=Vb.node;return Uint8Array.from(t(e))}throw new Error("The environment doesn't have randomBytes function")},randomPrivateKey:()=>jb.hashToPrivateKey(jb.randomBytes(40)),bytesToHex:fb,mod:kb,sha256:async e=>{if(Vb.web){const t=await Vb.web.subtle.digest("SHA-256",e.buffer);return new Uint8Array(t)}if(Vb.node){const{createHash:t}=Vb.node;return Uint8Array.from(t("sha256").update(e).digest())}throw new Error("The environment doesn't have sha256 function")},hmacSha256:async(e,...t)=>{if(Vb.web){const r=await Vb.web.subtle.importKey("raw",e,{name:"HMAC",hash:{name:"SHA-256"}},!1,["sign"]),n=lb(...t),i=await Vb.web.subtle.sign("HMAC",r,n);return new Uint8Array(i)}if(Vb.node){const{createHmac:r}=Vb.node,n=r("sha256",e);return t.forEach((e=>n.update(e))),Uint8Array.from(n.digest())}throw new Error("The environment doesn't have hmac-sha256 function")},sha256Sync:void 0,hmacSha256Sync:void 0,precompute(e=8,t=sb.BASE){const r=t===sb.BASE?t:new sb(t.x,t.y);return r._setWindowSize(e),r.multiply(Qy),r}},Fb={name:"@polkadot/wasm-bridge",path:new URL("file:///Users/dev-fazio/Nicolas%20Fazio/repos/test/cryptobtnwrapper/node_modules/@polkadot/wasm-bridge/packageInfo.js").pathname.substring(0,new URL("file:///Users/dev-fazio/Nicolas%20Fazio/repos/test/cryptobtnwrapper/node_modules/@polkadot/wasm-bridge/packageInfo.js").pathname.lastIndexOf("/")+1),type:"esm",version:"6.1.1"},Hb={name:"@polkadot/wasm-crypto-asmjs",path:new URL("file:///Users/dev-fazio/Nicolas%20Fazio/repos/test/cryptobtnwrapper/node_modules/@polkadot/wasm-crypto-asmjs/packageInfo.js").pathname.substring(0,new URL("file:///Users/dev-fazio/Nicolas%20Fazio/repos/test/cryptobtnwrapper/node_modules/@polkadot/wasm-crypto-asmjs/packageInfo.js").pathname.lastIndexOf("/")+1),type:"esm",version:"6.1.1"},Wb={name:"@polkadot/wasm-crypto-init",path:new URL("file:///Users/dev-fazio/Nicolas%20Fazio/repos/test/cryptobtnwrapper/node_modules/@polkadot/wasm-crypto-init/packageInfo.js").pathname.substring(0,new URL("file:///Users/dev-fazio/Nicolas%20Fazio/repos/test/cryptobtnwrapper/node_modules/@polkadot/wasm-crypto-init/packageInfo.js").pathname.lastIndexOf("/")+1),type:"esm",version:"6.1.1"},Kb={name:"@polkadot/wasm-crypto-wasm",path:new URL("file:///Users/dev-fazio/Nicolas%20Fazio/repos/test/cryptobtnwrapper/node_modules/@polkadot/wasm-crypto-wasm/packageInfo.js").pathname.substring(0,new URL("file:///Users/dev-fazio/Nicolas%20Fazio/repos/test/cryptobtnwrapper/node_modules/@polkadot/wasm-crypto-wasm/packageInfo.js").pathname.lastIndexOf("/")+1),type:"esm",version:"6.1.1"},Xb={name:"@polkadot/wasm-util",path:new URL("file:///Users/dev-fazio/Nicolas%20Fazio/repos/test/cryptobtnwrapper/node_modules/@polkadot/wasm-util/packageInfo.js").pathname.substring(0,new URL("file:///Users/dev-fazio/Nicolas%20Fazio/repos/test/cryptobtnwrapper/node_modules/@polkadot/wasm-util/packageInfo.js").pathname.lastIndexOf("/")+1),type:"esm",version:"6.1.1"},Gb=[Fb,Hb,Wb,Kb,Xb];Em({name:"@polkadot/wasm-crypto",path:new URL("file:///Users/dev-fazio/Nicolas%20Fazio/repos/test/cryptobtnwrapper/node_modules/@polkadot/wasm-crypto/packageInfo.js").pathname.substring(0,new URL("file:///Users/dev-fazio/Nicolas%20Fazio/repos/test/cryptobtnwrapper/node_modules/@polkadot/wasm-crypto/packageInfo.js").pathname.lastIndexOf("/")+1),type:"esm",version:"6.1.1"},null,Gb);Em(Fb,null,[]);const Zb={getRandomValues:Wy},Jb={crypto:Zb};class Yb{#e;constructor(e){this.#e=e}abort=()=>{throw new Error("abort")};__wbindgen_is_undefined=e=>void 0===this.#e.getObject(e);__wbindgen_throw=(e,t)=>{throw new Error(this.#e.getString(e,t))};__wbg_self_1b7a39e3a92c949c=()=>this.#e.addObject(Jb);__wbg_require_604837428532a733=(e,t)=>{throw new Error(`Unable to require ${this.#e.getString(e,t)}`)};__wbg_crypto_968f1772287e2df0=e=>this.#e.addObject(Zb);__wbg_getRandomValues_a3d34b4fee3c2869=e=>this.#e.addObject(Zb.getRandomValues);__wbg_getRandomValues_f5e14ab7ac8e995d=(e,t,r)=>{Zb.getRandomValues(this.#e.getU8a(t,r))};__wbg_randomFillSync_d5bd2d655fdf256a=(e,t,r)=>{throw new Error("randomFillsync is not available")};__wbindgen_object_drop_ref=e=>{this.#e.takeObject(e)}}Em(Kb,null,[]);Em(Xb,null,[Xb]);const Qb=Uint8Array,$b=Uint16Array,ev=Uint32Array,tv=new Qb([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),rv=new Qb([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,0,0,0]),nv=new Qb([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13,0,0]),iv=(e,t)=>{const r=new $b(31);for(let i=0;i<31;++i)r[i]=t+=1<<e[i-1];const n=new ev(r[30]);for(let i=1;i<30;++i)for(let e=r[i];e<r[i+1];++e)n[e]=e-r[i]<<5|i;return[r,n]},[ov,sv]=iv(rv,2);ov[28]=258,sv[258]=28;const[av]=iv(nv,0),cv=new $b(32768);for(let d2=0;d2<32768;++d2){let e=(43690&d2)>>>1|(21845&d2)<<1;e=(52428&e)>>>2|(13107&e)<<2,e=(61680&e)>>>4|(3855&e)<<4,cv[d2]=((65280&e)>>>8|(255&e)<<8)>>>1}const uv=(e,t,r)=>{const n=e.length;let i=0;const o=new $b(t);for(;i<n;++i)++o[e[i]-1];const s=new $b(t);for(i=0;i<t;++i)s[i]=s[i-1]+o[i-1]<<1;let a;if(r){a=new $b(1<<t);const r=15-t;for(i=0;i<n;++i)if(e[i]){const n=i<<4|e[i],o=t-e[i];let c=s[e[i]-1]++<<o;for(const e=c|(1<<o)-1;c<=e;++c)a[cv[c]>>>r]=n}}else for(a=new $b(n),i=0;i<n;++i)a[i]=cv[s[e[i]-1]++]>>>15-e[i];return a},lv=new Qb(288);for(let d2=0;d2<144;++d2)lv[d2]=8;for(let d2=144;d2<256;++d2)lv[d2]=9;for(let d2=256;d2<280;++d2)lv[d2]=7;for(let d2=280;d2<288;++d2)lv[d2]=8;const hv=new Qb(32);for(let d2=0;d2<32;++d2)hv[d2]=5;const dv=uv(lv,9,1),fv=uv(hv,5,1),pv=(e,t,r)=>{const n=t>>>3;return(e[n]|e[n+1]<<8)>>>(7&t)&r},mv=(e,t)=>{const r=t>>>3;return(e[r]|e[r+1]<<8|e[r+2]<<16)>>>(7&t)},gv=e=>{let t=e[0];for(let r=1;r<e.length;++r)e[r]>t&&(t=e[r]);return t},yv=(e,t,r)=>{const n=!r||r.i;r||(r={});const i=e.length,o=!t||!n;t||(t=new Qb(3*i));const s=e=>{let r=t.length;if(e>r){const n=new Qb(Math.max(r<<1,e));n.set(t),t=n}};let a=r.f||0,c=r.p||0,u=r.b||0,l=r.l,h=r.d,d=r.m,f=r.n;if(a&&!l)return t;const p=i<<3;do{if(!l){r.f=a=pv(e,c,1);const g=pv(e,c+1,3);if(c+=3,!g){const a=((m=c)>>>3)+(7&m&&1)+4,l=e[a-4]|e[a-3]<<8,h=a+l;if(h>i){if(n)throw"unexpected EOF";break}o&&s(u+l),t.set(e.subarray(a,h),u),r.b=u+=l,r.p=c=h<<3;continue}if(1==g)l=dv,h=fv,d=9,f=5;else{if(2!=g)throw"invalid block type";{const t=pv(e,c,31)+257,r=pv(e,c+10,15)+4,i=t+pv(e,c+5,31)+1;c+=14;const o=new Qb(i),s=new Qb(19);for(let n=0;n<r;++n)s[tv[n]]=pv(e,c+3*n,7);c+=3*r;const a=gv(s),u=(1<<a)-1;if(!n&&c+i*(a+7)>p)break;const m=uv(s,a,1);for(let n=0;n<i;){const t=m[pv(e,c,u)];c+=15&t;const r=t>>>4;if(r<16)o[n++]=r;else{let t=0,i=0;for(16==r?(i=3+pv(e,c,3),c+=2,t=o[n-1]):17==r?(i=3+pv(e,c,7),c+=3):18==r&&(i=11+pv(e,c,127),c+=7);i--;)o[n++]=t}}const g=o.subarray(0,t),y=o.subarray(t);d=gv(g),f=gv(y),l=uv(g,d,1),h=uv(y,f,1)}}if(c>p)throw"unexpected EOF"}o&&s(u+131072);const g=(1<<d)-1,y=(1<<f)-1,b=d+f+18;for(;n||c+b<p;){const r=l[mv(e,c)&g],n=r>>>4;if(c+=15&r,c>p)throw"unexpected EOF";if(!r)throw"invalid length/literal";if(n<256)t[u++]=n;else{if(256==n){l=void 0;break}{let r=n-254;if(n>264){const t=n-257,i=rv[t];r=pv(e,c,(1<<i)-1)+ov[t],c+=i}const i=h[mv(e,c)&y],a=i>>>4;if(!i)throw"invalid distance";c+=15&i;let l=av[a];if(a>3){const t=nv[a];l+=mv(e,c)&(1<<t)-1,c+=t}if(c>p)throw"unexpected EOF";o&&s(u+131072);const d=u+r;for(;u<d;u+=4)t[u]=t[u-l],t[u+1]=t[u+1-l],t[u+2]=t[u+2-l],t[u+3]=t[u+3-l];u=d}}}r.l=l,r.p=c,r.b=u,l&&(a=1,r.m=d,r.d=h,r.n=f)}while(!a);var m;return u==t.length?t:((e,t,r)=>{(null==t||t<0)&&(t=0),(null==r||r>e.length)&&(r=e.length);const n=new(e instanceof $b?$b:e instanceof ev?ev:Qb)(r-t);return n.set(e.subarray(t,r)),n})(t,0,u)};var bv=r(43562);const vv=function(e,t){return yv(((e=>{if(8!=(15&e[0])||e[0]>>>4>7||(e[0]<<8|e[1])%31)throw"invalid zlib data";if(32&e[1])throw"invalid zlib data: preset dictionaries not supported"})(e),e.subarray(2,-4)),t)}(function(e){const t=[];let r=0,n=0;for(let i=0;i<e.length&&"="!==e[i];i++)r=r<<6|"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".indexOf(e[i]),(n+=6)>=8&&t.push(r>>>(n-=8)&255);return Uint8Array.from(t)}(bv.bytes),new Uint8Array(bv.sizeUncompressed)),wv=function(e,t,r){return async n=>{const i={error:null,type:"none",wasm:null};try{bm("object"==typeof WebAssembly&&"function"==typeof WebAssembly.instantiate&&t&&t.length,"WebAssembly is not available in your environment");const e=await WebAssembly.instantiate(t,{wbg:n});i.wasm=e.instance.exports,i.type="wasm"}catch(h2){r?(i.wasm=r(n),i.type="asm"):(i.error=`FATAL: Unable to initialize @polkadot/wasm-${e}:: ${h2.message}`,console.error(i.error))}return i}}("crypto",vv,null),xv=new class{#t;#r;#n;#i;#o;#s;#a;#c;#u;#l;constructor(e){this.#n=e,this.#t=null,this.#r=null,this.#i=new Array(32).fill(void 0).concat(void 0,null,!0,!1),this.#o=this.#i.length,this.#l="none",this.#s=null,this.#a=null,this.#c=null,this.#u={...new Yb(this)}}get error(){return this.#a}get type(){return this.#l}get wbg(){return this.#u}get wasm(){return this.#s}async init(e){this.#c&&!e||(this.#c=(e||this.#n)(this.#u));const{error:t,type:r,wasm:n}=await this.#c;return this.#l=r,this.#s=n,this.#a=t,this.#s}getObject(e){return this.#i[e]}dropObject(e){e<36||(this.#i[e]=this.#o,this.#o=e)}takeObject(e){const t=this.getObject(e);return this.dropObject(e),t}addObject(e){this.#o===this.#i.length&&this.#i.push(this.#i.length+1);const t=this.#o;return this.#o=this.#i[t],this.#i[t]=e,t}getInt32(){return null!==this.#t&&this.#t.buffer===this.#s.memory.buffer||(this.#t=new Int32Array(this.#s.memory.buffer)),this.#t}getUint8(){return null!==this.#r&&this.#r.buffer===this.#s.memory.buffer||(this.#r=new Uint8Array(this.#s.memory.buffer)),this.#r}getU8a(e,t){return this.getUint8().subarray(e/1,e/1+t)}getString(e,t){return fg(this.getU8a(e,t))}allocU8a(e){const t=this.#s.__wbindgen_malloc(1*e.length);return this.getUint8().set(e,t/1),[t,e.length]}allocString(e){return this.allocU8a(ng(e))}resultU8a(){const e=this.getInt32()[2],t=this.getInt32()[3],r=this.getU8a(e,t).slice();return this.#s.__wbindgen_free(e,1*t),r}resultString(){return fg(this.resultU8a())}}(wv);function kv(e){return(...t)=>(bm(xv.wasm,"The WASM interface has not been initialized. Ensure that you wait for the initialization Promise with waitReady() from @polkadot/wasm-crypto (or cryptoWaitReady() from @polkadot/util-crypto) before attempting to use WASM-only interfaces."),e(xv.wasm,...t))}kv(((e,t)=>(e.ext_bip39_generate(8,t),xv.resultString())));const Sv=kv(((e,t)=>(e.ext_bip39_to_entropy(8,...xv.allocString(t)),xv.resultU8a()))),Ev=kv(((e,t,r)=>(e.ext_bip39_to_mini_secret(8,...xv.allocString(t),...xv.allocString(r)),xv.resultU8a()))),Av=kv(((e,t,r)=>(e.ext_bip39_to_seed(8,...xv.allocString(t),...xv.allocString(r)),xv.resultU8a()))),Nv=kv(((e,t)=>0!==e.ext_bip39_validate(...xv.allocString(t)))),Tv=kv(((e,t)=>(e.ext_ed_from_seed(8,...xv.allocU8a(t)),xv.resultU8a()))),Pv=kv(((e,t,r,n)=>(e.ext_ed_sign(8,...xv.allocU8a(t),...xv.allocU8a(r),...xv.allocU8a(n)),xv.resultU8a()))),Mv=kv(((e,t,r,n)=>0!==e.ext_ed_verify(...xv.allocU8a(t),...xv.allocU8a(r),...xv.allocU8a(n)))),Iv=kv(((e,t)=>(e.ext_secp_from_seed(8,...xv.allocU8a(t)),xv.resultU8a()))),Cv=kv(((e,t)=>(e.ext_secp_pub_compress(8,...xv.allocU8a(t)),xv.resultU8a()))),Rv=kv(((e,t)=>(e.ext_secp_pub_expand(8,...xv.allocU8a(t)),xv.resultU8a()))),Bv=kv(((e,t,r,n)=>(e.ext_secp_recover(8,...xv.allocU8a(t),...xv.allocU8a(r),n),xv.resultU8a()))),Ov=kv(((e,t,r)=>(e.ext_secp_sign(8,...xv.allocU8a(t),...xv.allocU8a(r)),xv.resultU8a()))),Lv=kv(((e,t,r)=>(e.ext_sr_derive_keypair_hard(8,...xv.allocU8a(t),...xv.allocU8a(r)),xv.resultU8a()))),zv=kv(((e,t,r)=>(e.ext_sr_derive_keypair_soft(8,...xv.allocU8a(t),...xv.allocU8a(r)),xv.resultU8a()))),Uv=(kv(((e,t,r)=>(e.ext_sr_derive_public_soft(8,...xv.allocU8a(t),...xv.allocU8a(r)),xv.resultU8a()))),kv(((e,t)=>(e.ext_sr_from_seed(8,...xv.allocU8a(t)),xv.resultU8a())))),_v=kv(((e,t,r,n)=>(e.ext_sr_sign(8,...xv.allocU8a(t),...xv.allocU8a(r),...xv.allocU8a(n)),xv.resultU8a()))),qv=kv(((e,t,r,n)=>0!==e.ext_sr_verify(...xv.allocU8a(t),...xv.allocU8a(r),...xv.allocU8a(n)))),Dv=(kv(((e,t,r)=>(e.ext_sr_agree(8,...xv.allocU8a(t),...xv.allocU8a(r)),xv.resultU8a()))),kv(((e,t,r,n,i)=>(e.ext_vrf_sign(8,...xv.allocU8a(t),...xv.allocU8a(r),...xv.allocU8a(n),...xv.allocU8a(i)),xv.resultU8a())))),Vv=kv(((e,t,r,n,i,o)=>0!==e.ext_vrf_verify(...xv.allocU8a(t),...xv.allocU8a(r),...xv.allocU8a(n),...xv.allocU8a(i),...xv.allocU8a(o)))),jv=kv(((e,t,r,n)=>(e.ext_blake2b(8,...xv.allocU8a(t),...xv.allocU8a(r),n),xv.resultU8a()))),Fv=kv(((e,t,r)=>(e.ext_hmac_sha256(8,...xv.allocU8a(t),...xv.allocU8a(r)),xv.resultU8a()))),Hv=kv(((e,t,r)=>(e.ext_hmac_sha512(8,...xv.allocU8a(t),...xv.allocU8a(r)),xv.resultU8a()))),Wv=kv(((e,t)=>(e.ext_keccak256(8,...xv.allocU8a(t)),xv.resultU8a()))),Kv=kv(((e,t)=>(e.ext_keccak512(8,...xv.allocU8a(t)),xv.resultU8a()))),Xv=kv(((e,t,r,n)=>(e.ext_pbkdf2(8,...xv.allocU8a(t),...xv.allocU8a(r),n),xv.resultU8a()))),Gv=kv(((e,t,r,n,i,o)=>(e.ext_scrypt(8,...xv.allocU8a(t),...xv.allocU8a(r),n,i,o),xv.resultU8a()))),Zv=kv(((e,t)=>(e.ext_sha256(8,...xv.allocU8a(t)),xv.resultU8a()))),Jv=kv(((e,t)=>(e.ext_sha512(8,...xv.allocU8a(t)),xv.resultU8a()))),Yv=kv(((e,t,r)=>(e.ext_twox(8,...xv.allocU8a(t),r),xv.resultU8a())));function Qv(){return!!xv.wasm}async function $v(){try{const e=await async function(e){return xv.init(e)}();return!!e}catch{return!1}}function ew(){return $v().then((()=>(bm(Qv(),"Unable to initialize @polkadot/util-crypto"),!0))).catch((()=>!1))}"object"==typeof self&&"crypto"in self&&self.crypto;const tw=e=>new Uint32Array(e.buffer,e.byteOffset,Math.floor(e.byteLength/4)),rw=e=>new DataView(e.buffer,e.byteOffset,e.byteLength),nw=(e,t)=>e<<32-t|e>>>t;if(!(68===new Uint8Array(new Uint32Array([287454020]).buffer)[0]))throw new Error("Non little-endian hardware is not supported");Array.from({length:256},((e,t)=>t.toString(16).padStart(2,"0")));(()=>{const e="undefined"!=typeof module&&"function"==typeof module.require&&module.require.bind(module);try{if(e){const{setImmediate:t}=e("timers");return()=>new Promise((e=>t(e)))}}catch(t){}})();function iw(e){if("string"==typeof e&&(e=function(e){if("string"!=typeof e)throw new TypeError("utf8ToBytes expected string, got "+typeof e);return(new TextEncoder).encode(e)}(e)),!(e instanceof Uint8Array))throw new TypeError(`Expected input type is Uint8Array (got ${typeof e})`);return e}function ow(e){if(!Number.isSafeInteger(e)||e<0)throw new Error(`Wrong positive integer: ${e}`)}function sw(e){if("function"!=typeof e||"function"!=typeof e.create)throw new Error("Hash should be wrapped by utils.wrapConstructor");ow(e.outputLen),ow(e.blockLen)}class aw{clone(){return this._cloneInto()}}function cw(e,t){if(void 0!==t&&("object"!=typeof t||(r=t,"[object Object]"!==Object.prototype.toString.call(r)||r.constructor!==Object)))throw new TypeError("Options should be object or undefined");var r;return Object.assign(e,t)}function uw(e){const t=t=>e().update(iw(t)).digest(),r=e();return t.outputLen=r.outputLen,t.blockLen=r.blockLen,t.create=()=>e(),t}function lw(e){const t=(t,r)=>e(r).update(iw(t)).digest(),r=e({});return t.outputLen=r.outputLen,t.blockLen=r.blockLen,t.create=t=>e(t),t}class hw extends aw{constructor(e,t){super(),this.finished=!1,this.destroyed=!1,sw(e);const r=iw(t);if(this.iHash=e.create(),!(this.iHash instanceof aw))throw new TypeError("Expected instance of class which extends utils.Hash");const n=this.blockLen=this.iHash.blockLen;this.outputLen=this.iHash.outputLen;const i=new Uint8Array(n);i.set(r.length>this.iHash.blockLen?e.create().update(r).digest():r);for(let o=0;o<i.length;o++)i[o]^=54;this.iHash.update(i),this.oHash=e.create();for(let o=0;o<i.length;o++)i[o]^=106;this.oHash.update(i),i.fill(0)}update(e){if(this.destroyed)throw new Error("instance is destroyed");return this.iHash.update(e),this}digestInto(e){if(this.destroyed)throw new Error("instance is destroyed");if(!(e instanceof Uint8Array)||e.length!==this.outputLen)throw new Error("HMAC: Invalid output buffer");if(this.finished)throw new Error("digest() was already called");this.finished=!0,this.iHash.digestInto(e),this.oHash.update(e),this.oHash.digestInto(e),this.destroy()}digest(){const e=new Uint8Array(this.oHash.outputLen);return this.digestInto(e),e}_cloneInto(e){e||(e=Object.create(Object.getPrototypeOf(this),{}));const{oHash:t,iHash:r,finished:n,destroyed:i,blockLen:o,outputLen:s}=this;return e.finished=n,e.destroyed=i,e.blockLen=o,e.outputLen=s,e.oHash=t._cloneInto(e.oHash),e.iHash=r._cloneInto(e.iHash),e}destroy(){this.destroyed=!0,this.oHash.destroy(),this.iHash.destroy()}}const dw=(e,t,r)=>new hw(e,t).update(r).digest();dw.create=(e,t)=>new hw(e,t);class fw extends aw{constructor(e,t,r,n){super(),this.blockLen=e,this.outputLen=t,this.padOffset=r,this.isLE=n,this.finished=!1,this.length=0,this.pos=0,this.destroyed=!1,this.buffer=new Uint8Array(e),this.view=rw(this.buffer)}update(e){if(this.destroyed)throw new Error("instance is destroyed");const{view:t,buffer:r,blockLen:n,finished:i}=this;if(i)throw new Error("digest() was already called");const o=(e=iw(e)).length;for(let s=0;s<o;){const i=Math.min(n-this.pos,o-s);if(i!==n)r.set(e.subarray(s,s+i),this.pos),this.pos+=i,s+=i,this.pos===n&&(this.process(t,0),this.pos=0);else{const t=rw(e);for(;n<=o-s;s+=n)this.process(t,s)}}return this.length+=e.length,this.roundClean(),this}digestInto(e){if(this.destroyed)throw new Error("instance is destroyed");if(!(e instanceof Uint8Array)||e.length<this.outputLen)throw new Error("_Sha2: Invalid output buffer");if(this.finished)throw new Error("digest() was already called");this.finished=!0;const{buffer:t,view:r,blockLen:n,isLE:i}=this;let{pos:o}=this;t[o++]=128,this.buffer.subarray(o).fill(0),this.padOffset>n-o&&(this.process(r,0),o=0);for(let a=o;a<n;a++)t[a]=0;!function(e,t,r,n){if("function"==typeof e.setBigUint64)return e.setBigUint64(t,r,n);const i=BigInt(32),o=BigInt(4294967295),s=Number(r>>i&o),a=Number(r&o),c=n?4:0,u=n?0:4;e.setUint32(t+c,s,n),e.setUint32(t+u,a,n)}(r,n-8,BigInt(8*this.length),i),this.process(r,0);const s=rw(e);this.get().forEach(((e,t)=>s.setUint32(4*t,e,i)))}digest(){const{buffer:e,outputLen:t}=this;this.digestInto(e);const r=e.slice(0,t);return this.destroy(),r}_cloneInto(e){e||(e=new this.constructor),e.set(...this.get());const{blockLen:t,buffer:r,length:n,finished:i,destroyed:o,pos:s}=this;return e.length=n,e.pos=s,e.finished=i,e.destroyed=o,n%t&&e.buffer.set(r),e}}const pw=(e,t,r)=>e&t^e&r^t&r,mw=new Uint32Array([1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298]),gw=new Uint32Array([1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225]),yw=new Uint32Array(64);class bw extends fw{constructor(){super(64,32,8,!1),this.A=0|gw[0],this.B=0|gw[1],this.C=0|gw[2],this.D=0|gw[3],this.E=0|gw[4],this.F=0|gw[5],this.G=0|gw[6],this.H=0|gw[7]}get(){const{A:e,B:t,C:r,D:n,E:i,F:o,G:s,H:a}=this;return[e,t,r,n,i,o,s,a]}set(e,t,r,n,i,o,s,a){this.A=0|e,this.B=0|t,this.C=0|r,this.D=0|n,this.E=0|i,this.F=0|o,this.G=0|s,this.H=0|a}process(e,t){for(let h=0;h<16;h++,t+=4)yw[h]=e.getUint32(t,!1);for(let h=16;h<64;h++){const e=yw[h-15],t=yw[h-2],r=nw(e,7)^nw(e,18)^e>>>3,n=nw(t,17)^nw(t,19)^t>>>10;yw[h]=n+yw[h-7]+r+yw[h-16]|0}let{A:r,B:n,C:i,D:o,E:s,F:a,G:c,H:u}=this;for(let h=0;h<64;h++){const e=u+(nw(s,6)^nw(s,11)^nw(s,25))+((l=s)&a^~l&c)+mw[h]+yw[h]|0,t=(nw(r,2)^nw(r,13)^nw(r,22))+pw(r,n,i)|0;u=c,c=a,a=s,s=o+e|0,o=i,i=n,n=r,r=e+t|0}var l;r=r+this.A|0,n=n+this.B|0,i=i+this.C|0,o=o+this.D|0,s=s+this.E|0,a=a+this.F|0,c=c+this.G|0,u=u+this.H|0,this.set(r,n,i,o,s,a,c,u)}roundClean(){yw.fill(0)}destroy(){this.set(0,0,0,0,0,0,0,0),this.buffer.fill(0)}}const vw=uw((()=>new bw)),ww=BigInt(2**32-1),xw=BigInt(32);function kw(e,t=!1){return t?{h:Number(e&ww),l:Number(e>>xw&ww)}:{h:0|Number(e>>xw&ww),l:0|Number(e&ww)}}function Sw(e,t=!1){let r=new Uint32Array(e.length),n=new Uint32Array(e.length);for(let i=0;i<e.length;i++){const{h:o,l:s}=kw(e[i],t);[r[i],n[i]]=[o,s]}return[r,n]}const Ew=(e,t,r)=>e>>>r,Aw=(e,t,r)=>e<<32-r|t>>>r,Nw=(e,t,r)=>e>>>r|t<<32-r,Tw=(e,t,r)=>e<<32-r|t>>>r,Pw=(e,t,r)=>e<<64-r|t>>>r-32,Mw=(e,t,r)=>e>>>r-32|t<<64-r,Iw=(e,t)=>t,Cw=(e,t)=>e;function Rw(e,t,r,n){const i=(t>>>0)+(n>>>0);return{h:e+r+(i/2**32|0)|0,l:0|i}}const Bw=(e,t,r)=>(e>>>0)+(t>>>0)+(r>>>0),Ow=(e,t,r,n)=>t+r+n+(e/2**32|0)|0,Lw=(e,t,r,n)=>(e>>>0)+(t>>>0)+(r>>>0)+(n>>>0),zw=(e,t,r,n,i)=>t+r+n+i+(e/2**32|0)|0,Uw=(e,t,r,n,i)=>(e>>>0)+(t>>>0)+(r>>>0)+(n>>>0)+(i>>>0),_w=(e,t,r,n,i,o)=>t+r+n+i+o+(e/2**32|0)|0,[qw,Dw]=Sw(["0x428a2f98d728ae22","0x7137449123ef65cd","0xb5c0fbcfec4d3b2f","0xe9b5dba58189dbbc","0x3956c25bf348b538","0x59f111f1b605d019","0x923f82a4af194f9b","0xab1c5ed5da6d8118","0xd807aa98a3030242","0x12835b0145706fbe","0x243185be4ee4b28c","0x550c7dc3d5ffb4e2","0x72be5d74f27b896f","0x80deb1fe3b1696b1","0x9bdc06a725c71235","0xc19bf174cf692694","0xe49b69c19ef14ad2","0xefbe4786384f25e3","0x0fc19dc68b8cd5b5","0x240ca1cc77ac9c65","0x2de92c6f592b0275","0x4a7484aa6ea6e483","0x5cb0a9dcbd41fbd4","0x76f988da831153b5","0x983e5152ee66dfab","0xa831c66d2db43210","0xb00327c898fb213f","0xbf597fc7beef0ee4","0xc6e00bf33da88fc2","0xd5a79147930aa725","0x06ca6351e003826f","0x142929670a0e6e70","0x27b70a8546d22ffc","0x2e1b21385c26c926","0x4d2c6dfc5ac42aed","0x53380d139d95b3df","0x650a73548baf63de","0x766a0abb3c77b2a8","0x81c2c92e47edaee6","0x92722c851482353b","0xa2bfe8a14cf10364","0xa81a664bbc423001","0xc24b8b70d0f89791","0xc76c51a30654be30","0xd192e819d6ef5218","0xd69906245565a910","0xf40e35855771202a","0x106aa07032bbd1b8","0x19a4c116b8d2d0c8","0x1e376c085141ab53","0x2748774cdf8eeb99","0x34b0bcb5e19b48a8","0x391c0cb3c5c95a63","0x4ed8aa4ae3418acb","0x5b9cca4f7763e373","0x682e6ff3d6b2b8a3","0x748f82ee5defb2fc","0x78a5636f43172f60","0x84c87814a1f0ab72","0x8cc702081a6439ec","0x90befffa23631e28","0xa4506cebde82bde9","0xbef9a3f7b2c67915","0xc67178f2e372532b","0xca273eceea26619c","0xd186b8c721c0c207","0xeada7dd6cde0eb1e","0xf57d4f7fee6ed178","0x06f067aa72176fba","0x0a637dc5a2c898a6","0x113f9804bef90dae","0x1b710b35131c471b","0x28db77f523047d84","0x32caab7b40c72493","0x3c9ebe0a15c9bebc","0x431d67c49c100d4c","0x4cc5d4becb3e42b6","0x597f299cfc657e2a","0x5fcb6fab3ad6faec","0x6c44198c4a475817"].map((e=>BigInt(e)))),Vw=new Uint32Array(80),jw=new Uint32Array(80);class Fw extends fw{constructor(){super(128,64,16,!1),this.Ah=1779033703,this.Al=-205731576,this.Bh=-1150833019,this.Bl=-2067093701,this.Ch=1013904242,this.Cl=-23791573,this.Dh=-1521486534,this.Dl=1595750129,this.Eh=1359893119,this.El=-1377402159,this.Fh=-1694144372,this.Fl=725511199,this.Gh=528734635,this.Gl=-79577749,this.Hh=1541459225,this.Hl=327033209}get(){const{Ah:e,Al:t,Bh:r,Bl:n,Ch:i,Cl:o,Dh:s,Dl:a,Eh:c,El:u,Fh:l,Fl:h,Gh:d,Gl:f,Hh:p,Hl:m}=this;return[e,t,r,n,i,o,s,a,c,u,l,h,d,f,p,m]}set(e,t,r,n,i,o,s,a,c,u,l,h,d,f,p,m){this.Ah=0|e,this.Al=0|t,this.Bh=0|r,this.Bl=0|n,this.Ch=0|i,this.Cl=0|o,this.Dh=0|s,this.Dl=0|a,this.Eh=0|c,this.El=0|u,this.Fh=0|l,this.Fl=0|h,this.Gh=0|d,this.Gl=0|f,this.Hh=0|p,this.Hl=0|m}process(e,t){for(let b=0;b<16;b++,t+=4)Vw[b]=e.getUint32(t),jw[b]=e.getUint32(t+=4);for(let b=16;b<80;b++){const e=0|Vw[b-15],t=0|jw[b-15],r=Nw(e,t,1)^Nw(e,t,8)^Ew(e,0,7),n=Tw(e,t,1)^Tw(e,t,8)^Aw(e,t,7),i=0|Vw[b-2],o=0|jw[b-2],s=Nw(i,o,19)^Pw(i,o,61)^Ew(i,0,6),a=Tw(i,o,19)^Mw(i,o,61)^Aw(i,o,6),c=Lw(n,a,jw[b-7],jw[b-16]),u=zw(c,r,s,Vw[b-7],Vw[b-16]);Vw[b]=0|u,jw[b]=0|c}let{Ah:r,Al:n,Bh:i,Bl:o,Ch:s,Cl:a,Dh:c,Dl:u,Eh:l,El:h,Fh:d,Fl:f,Gh:p,Gl:m,Hh:g,Hl:y}=this;for(let b=0;b<80;b++){const e=Nw(l,h,14)^Nw(l,h,18)^Pw(l,h,41),t=Tw(l,h,14)^Tw(l,h,18)^Mw(l,h,41),v=l&d^~l&p,w=Uw(y,t,h&f^~h&m,Dw[b],jw[b]),x=_w(w,g,e,v,qw[b],Vw[b]),k=0|w,S=Nw(r,n,28)^Pw(r,n,34)^Pw(r,n,39),E=Tw(r,n,28)^Mw(r,n,34)^Mw(r,n,39),A=r&i^r&s^i&s,N=n&o^n&a^o&a;g=0|p,y=0|m,p=0|d,m=0|f,d=0|l,f=0|h,({h:l,l:h}=Rw(0|c,0|u,0|x,0|k)),c=0|s,u=0|a,s=0|i,a=0|o,i=0|r,o=0|n;const T=Bw(k,E,N);r=Ow(T,x,S,A),n=0|T}({h:r,l:n}=Rw(0|this.Ah,0|this.Al,0|r,0|n)),({h:i,l:o}=Rw(0|this.Bh,0|this.Bl,0|i,0|o)),({h:s,l:a}=Rw(0|this.Ch,0|this.Cl,0|s,0|a)),({h:c,l:u}=Rw(0|this.Dh,0|this.Dl,0|c,0|u)),({h:l,l:h}=Rw(0|this.Eh,0|this.El,0|l,0|h)),({h:d,l:f}=Rw(0|this.Fh,0|this.Fl,0|d,0|f)),({h:p,l:m}=Rw(0|this.Gh,0|this.Gl,0|p,0|m)),({h:g,l:y}=Rw(0|this.Hh,0|this.Hl,0|g,0|y)),this.set(r,n,i,o,s,a,c,u,l,h,d,f,p,m,g,y)}roundClean(){Vw.fill(0),jw.fill(0)}destroy(){this.buffer.fill(0),this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0)}}class Hw extends Fw{constructor(){super(),this.Ah=573645204,this.Al=-64227540,this.Bh=-1621794909,this.Bl=-934517566,this.Ch=596883563,this.Cl=1867755857,this.Dh=-1774684391,this.Dl=1497426621,this.Eh=-1775747358,this.El=-1467023389,this.Fh=-1101128155,this.Fl=1401305490,this.Gh=721525244,this.Gl=746961066,this.Hh=246885852,this.Hl=-2117784414,this.outputLen=32}}class Ww extends Fw{constructor(){super(),this.Ah=-876896931,this.Al=-1056596264,this.Bh=1654270250,this.Bl=914150663,this.Ch=-1856437926,this.Cl=812702999,this.Dh=355462360,this.Dl=-150054599,this.Eh=1731405415,this.El=-4191439,this.Fh=-1900787065,this.Fl=1750603025,this.Gh=-619958771,this.Gl=1694076839,this.Hh=1203062813,this.Hl=-1090891868,this.outputLen=48}}const Kw=uw((()=>new Fw)),Xw=(uw((()=>new Hw)),uw((()=>new Ww)),{256:vw,512:Kw}),Gw={256:Fv,512:Hv};function Zw(e){return(t,r,n)=>Jw(t,r,e,n)}function Jw(e,t,r=256,n){const i=ig(e);return!Ym||!n&&Qv()?Gw[r](i,t):dw(Xw[r],i,t)}const Yw=Zw(256);Zw(512);jb.hmacSha256Sync=(e,...t)=>Yw(e,og(...t)),ew().catch((()=>{}));var Qw=r(73822);function $w({coder:e,ipfs:t},r){return(n,i)=>(r(n,i),e.decode(t&&i?n.substring(1):n))}function ex({coder:e,ipfs:t}){return(r,n)=>{const i=e.encode(ig(r));return t&&n?`${t}${i}`:i}}function tx(e){return(t,r)=>{try{return e(t,r)}catch(h2){return!1}}}function rx({chars:e,ipfs:t,type:r}){return(n,i)=>{bm(n&&"string"==typeof n,(()=>`Expected non-null, non-empty ${r} string input`)),t&&i&&bm(n[0]===t,(()=>`Expected ipfs-compatible ${r} to start with '${t}'`));for(let t=i?1:0;t<n.length;t++)bm(e.includes(n[t])||"="===n[t]&&(t===n.length-1||!e.includes(n[t+1])),(()=>`Invalid ${r} character "${n[t]}" (0x${n.charCodeAt(t).toString(16)}) at index ${t}`));return!0}}const nx={chars:"123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz",coder:Qw.Jq,ipfs:"z",type:"base58"},ix=rx(nx),ox=$w(nx,ix),sx=ex(nx),ax=(tx(ix),new Uint8Array([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,14,10,4,8,9,15,13,6,1,12,0,2,11,7,5,3,11,8,12,0,5,2,15,13,10,14,3,6,7,1,9,4,7,9,3,1,13,12,11,14,2,6,5,10,4,0,15,8,9,0,5,7,2,4,10,15,14,1,11,12,6,8,3,13,2,12,6,10,0,11,8,3,4,13,7,5,15,14,1,9,12,5,1,15,14,13,4,10,0,7,6,3,9,2,8,11,13,11,7,14,12,1,3,9,5,0,15,4,8,6,2,10,6,15,14,9,11,3,0,8,12,2,13,7,1,4,10,5,10,2,8,4,7,6,1,5,15,11,9,14,3,12,13,0,0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,14,10,4,8,9,15,13,6,1,12,0,2,11,7,5,3]));class cx extends aw{constructor(e,t,r={},n,i,o){if(super(),this.blockLen=e,this.outputLen=t,this.length=0,this.pos=0,this.finished=!1,this.destroyed=!1,ow(e),ow(t),ow(n),t<0||t>n)throw new Error("Blake2: outputLen bigger than keyLen");if(void 0!==r.key&&(r.key.length<1||r.key.length>n))throw new Error(`Key should be up 1..${n} byte long or undefined`);if(void 0!==r.salt&&r.salt.length!==i)throw new Error(`Salt should be ${i} byte long or undefined`);if(void 0!==r.personalization&&r.personalization.length!==o)throw new Error(`Personalization should be ${o} byte long or undefined`);this.buffer32=tw(this.buffer=new Uint8Array(e))}update(e){if(this.destroyed)throw new Error("instance is destroyed");const{finished:t,blockLen:r,buffer:n,buffer32:i}=this;if(t)throw new Error("digest() was already called");const o=(e=iw(e)).length;for(let s=0;s<o;){this.pos===r&&(this.compress(i,0,!1),this.pos=0);const t=Math.min(r-this.pos,o-s),a=e.byteOffset+s;if(t!==r||a%4||!(s+t<o))n.set(e.subarray(s,s+t),this.pos),this.pos+=t,this.length+=t,s+=t;else{const t=new Uint32Array(e.buffer,a,Math.floor((o-s)/4));for(let e=0;s+r<o;e+=i.length,s+=r)this.length+=r,this.compress(t,e,!1)}}return this}digestInto(e){if(this.destroyed)throw new Error("instance is destroyed");if(!(e instanceof Uint8Array)||e.length<this.outputLen)throw new Error("_Blake2: Invalid output buffer");const{finished:t,pos:r,buffer32:n}=this;if(t)throw new Error("digest() was already called");this.finished=!0,this.buffer.subarray(r).fill(0),this.compress(n,0,!0);const i=tw(e);this.get().forEach(((e,t)=>i[t]=e))}digest(){const{buffer:e,outputLen:t}=this;this.digestInto(e);const r=e.slice(0,t);return this.destroy(),r}_cloneInto(e){const{buffer:t,length:r,finished:n,destroyed:i,outputLen:o,pos:s}=this;return e||(e=new this.constructor({dkLen:o})),e.set(...this.get()),e.length=r,e.finished=n,e.destroyed=i,e.outputLen=o,e.buffer.set(t),e.pos=s,e}}const ux=new Uint32Array([4089235720,1779033703,2227873595,3144134277,4271175723,1013904242,1595750129,2773480762,2917565137,1359893119,725511199,2600822924,4215389547,528734635,327033209,1541459225]),lx=new Uint32Array(32);function hx(e,t,r,n,i,o){const s=i[o],a=i[o+1];let c=lx[2*e],u=lx[2*e+1],l=lx[2*t],h=lx[2*t+1],d=lx[2*r],f=lx[2*r+1],p=lx[2*n],m=lx[2*n+1],g=Bw(c,l,s);u=Ow(g,u,h,a),c=0|g,({Dh:m,Dl:p}={Dh:m^u,Dl:p^c}),({Dh:m,Dl:p}={Dh:Iw(0,p),Dl:Cw(m)}),({h:f,l:d}=Rw(f,d,m,p)),({Bh:h,Bl:l}={Bh:h^f,Bl:l^d}),({Bh:h,Bl:l}={Bh:Nw(h,l,24),Bl:Tw(h,l,24)}),lx[2*e]=c,lx[2*e+1]=u,lx[2*t]=l,lx[2*t+1]=h,lx[2*r]=d,lx[2*r+1]=f,lx[2*n]=p,lx[2*n+1]=m}function dx(e,t,r,n,i,o){const s=i[o],a=i[o+1];let c=lx[2*e],u=lx[2*e+1],l=lx[2*t],h=lx[2*t+1],d=lx[2*r],f=lx[2*r+1],p=lx[2*n],m=lx[2*n+1],g=Bw(c,l,s);u=Ow(g,u,h,a),c=0|g,({Dh:m,Dl:p}={Dh:m^u,Dl:p^c}),({Dh:m,Dl:p}={Dh:Nw(m,p,16),Dl:Tw(m,p,16)}),({h:f,l:d}=Rw(f,d,m,p)),({Bh:h,Bl:l}={Bh:h^f,Bl:l^d}),({Bh:h,Bl:l}={Bh:Pw(h,l,63),Bl:Mw(h,l,63)}),lx[2*e]=c,lx[2*e+1]=u,lx[2*t]=l,lx[2*t+1]=h,lx[2*r]=d,lx[2*r+1]=f,lx[2*n]=p,lx[2*n+1]=m}class fx extends cx{constructor(e={}){super(128,void 0===e.dkLen?64:e.dkLen,e,64,16,16),this.v0l=0|ux[0],this.v0h=0|ux[1],this.v1l=0|ux[2],this.v1h=0|ux[3],this.v2l=0|ux[4],this.v2h=0|ux[5],this.v3l=0|ux[6],this.v3h=0|ux[7],this.v4l=0|ux[8],this.v4h=0|ux[9],this.v5l=0|ux[10],this.v5h=0|ux[11],this.v6l=0|ux[12],this.v6h=0|ux[13],this.v7l=0|ux[14],this.v7h=0|ux[15];const t=e.key?e.key.length:0;if(this.v0l^=this.outputLen|t<<8|65536|1<<24,e.salt){const t=tw(iw(e.salt));this.v4l^=t[0],this.v4h^=t[1],this.v5l^=t[2],this.v5h^=t[3]}if(e.personalization){const t=tw(iw(e.personalization));this.v6l^=t[0],this.v6h^=t[1],this.v7l^=t[2],this.v7h^=t[3]}if(e.key){const t=new Uint8Array(this.blockLen);t.set(iw(e.key)),this.update(t)}}get(){let{v0l:e,v0h:t,v1l:r,v1h:n,v2l:i,v2h:o,v3l:s,v3h:a,v4l:c,v4h:u,v5l:l,v5h:h,v6l:d,v6h:f,v7l:p,v7h:m}=this;return[e,t,r,n,i,o,s,a,c,u,l,h,d,f,p,m]}set(e,t,r,n,i,o,s,a,c,u,l,h,d,f,p,m){this.v0l=0|e,this.v0h=0|t,this.v1l=0|r,this.v1h=0|n,this.v2l=0|i,this.v2h=0|o,this.v3l=0|s,this.v3h=0|a,this.v4l=0|c,this.v4h=0|u,this.v5l=0|l,this.v5h=0|h,this.v6l=0|d,this.v6h=0|f,this.v7l=0|p,this.v7h=0|m}compress(e,t,r){this.get().forEach(((e,t)=>lx[t]=e)),lx.set(ux,16);let{h:n,l:i}=kw(BigInt(this.length));lx[24]=ux[8]^i,lx[25]=ux[9]^n,r&&(lx[28]=~lx[28],lx[29]=~lx[29]);let o=0;const s=ax;for(let a=0;a<12;a++)hx(0,4,8,12,e,t+2*s[o++]),dx(0,4,8,12,e,t+2*s[o++]),hx(1,5,9,13,e,t+2*s[o++]),dx(1,5,9,13,e,t+2*s[o++]),hx(2,6,10,14,e,t+2*s[o++]),dx(2,6,10,14,e,t+2*s[o++]),hx(3,7,11,15,e,t+2*s[o++]),dx(3,7,11,15,e,t+2*s[o++]),hx(0,5,10,15,e,t+2*s[o++]),dx(0,5,10,15,e,t+2*s[o++]),hx(1,6,11,12,e,t+2*s[o++]),dx(1,6,11,12,e,t+2*s[o++]),hx(2,7,8,13,e,t+2*s[o++]),dx(2,7,8,13,e,t+2*s[o++]),hx(3,4,9,14,e,t+2*s[o++]),dx(3,4,9,14,e,t+2*s[o++]);this.v0l^=lx[0]^lx[16],this.v0h^=lx[1]^lx[17],this.v1l^=lx[2]^lx[18],this.v1h^=lx[3]^lx[19],this.v2l^=lx[4]^lx[20],this.v2h^=lx[5]^lx[21],this.v3l^=lx[6]^lx[22],this.v3h^=lx[7]^lx[23],this.v4l^=lx[8]^lx[24],this.v4h^=lx[9]^lx[25],this.v5l^=lx[10]^lx[26],this.v5h^=lx[11]^lx[27],this.v6l^=lx[12]^lx[28],this.v6h^=lx[13]^lx[29],this.v7l^=lx[14]^lx[30],this.v7h^=lx[15]^lx[31],lx.fill(0)}destroy(){this.destroyed=!0,this.buffer32.fill(0),this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0)}}const px=lw((e=>new fx(e)));function mx(e){return(...t)=>hg(e(...t))}function gx(e,t){return(r,n)=>t(r,e,n)}function yx(e,t){return(r,n=256,i)=>{const o=ig(r);return!Ym||!i&&Qv()?e[n](o):t[n](o)}}function bx(e,t=256,r,n){const i=Math.ceil(t/8),o=ig(e);return!Ym||!n&&Qv()?jv(o,ig(r),i):px(o,{dkLen:i,key:r||void 0})}mx(bx);const vx=ng("SS58PRE");function wx(e){return bx(og(vx,e),512)}const xx={acala:["0xfc41b9bd8ef8fe53d58c7ea67c794c7ec9a73daf05e6d54b14ff6342c99ba64c"],astar:["0x9eb76c5184c4ab8679d2d5d819fdf90b9c001403e9e17da2e14b6d8aec4029c6"],basilisk:["0xa85cfb9b9fd4d622a5b28289a02347af987d8f73fa3108450e2b4a11c1ce5755"],bifrost:["0x9f28c6a68e0fc9646eff64935684f6eeeece527e37bbe1f213d22caa1d9d6bed"],centrifuge:["0x67dddf2673b69e5f875f6f25277495834398eafd67f492e09f3f3345e003d1b5"],"dock-mainnet":["0x6bfe24dca2a3be10f22212678ac13a6446ec764103c0f3471c71609eac384aae","0xf73467c6544aa68df2ee546b135f955c46b90fa627e9b5d7935f41061bb8a5a9"],edgeware:["0x742a2ca70c2fda6cee4f8df98d64c4c670a052d9568058982dad9d5a7a135c5b"],equilibrium:["0x6f1a800de3daff7f5e037ddf66ab22ce03ab91874debeddb1086f5f7dbd48925"],genshiro:["0x9b8cefc0eb5c568b527998bdd76c184e2b76ae561be76e4667072230217ea243"],hydradx:["0xd2a620c27ec5cbc5621ff9a522689895074f7cca0d08e7134a7804e1a3ba86fc","0x10af6e84234477d84dc572bac0789813b254aa490767ed06fb9591191d1073f9","0x3d75507dd46301767e601265791da1d9cb47b6ebc94e87347b635e5bf58bd047","0x0ed32bfcab4a83517fac88f2aa7cbc2f88d3ab93be9a12b6188a036bf8a943c2"],karura:["0xbaf5aabe40646d11f0ee8abbdc64f4a4b7674925cba08e4a05ff9ebed6e2126b"],kulupu:["0xf7a99d3cb92853d00d5275c971c132c074636256583fee53b3bbe60d7b8769ba"],kusama:["0xb0a8d493285c2df73290dfb7e61f870f17b41801197a149ca93654499ea3dafe","0xe3777fa922cafbff200cadeaea1a76bd7898ad5b89f7848999058b50e715f636","0x3fd7b9eb6a00376e5be61f01abb429ffb0b104be05eaff4d458da48fcd425baf"],"nodle-chain":["0xa3d114c2b8d0627c1aa9b134eafcf7d05ca561fdc19fb388bb9457f81809fb23"],picasso:["0xe8e7f0f4c4f5a00720b4821dbfddefea7490bcf0b19009961cc46957984e2c1c"],polkadot:["0x91b171bb158e2d3848fa23a9f1c25182fb8e20313b2c1eb49219da7a70ce90c3"],polymesh:["0x6fbd74e5e1d0a61d52ccfe9d4adaed16dd3a7caa37c6bc4d0c2fa12e8b2f4063"],rococo:["0x6408de7737c59c238890533af25896a2c20608d8b380bb01029acb392781063e","0xaaf2cd1b74b5f726895921259421b534124726263982522174147046b8827897","0x037f5f3c8e67b314062025fc886fcd6238ea25a4a9b45dce8d246815c9ebe770","0xc196f81260cf1686172b47a79cf002120735d7cb0eb1474e8adce56618456fff","0xf6e9983c37baf68846fedafe21e56718790e39fb1c582abc408b81bc7b208f9a","0x5fce687da39305dfe682b117f0820b319348e8bb37eb16cf34acbf6a202de9d9","0xe7c3d5edde7db964317cd9b51a3a059d7cd99f81bdbce14990047354334c9779","0x1611e1dbf0405379b861e2e27daa90f480b2e6d3682414a80835a52e8cb8a215","0x343442f12fa715489a8714e79a7b264ea88c0d5b8c66b684a7788a516032f6b9","0x78bcd530c6b3a068bc17473cf5d2aff9c287102bed9af3ae3c41c33b9d6c6147","0x47381ee0697153d64404fc578392c8fd5cba9073391908f46c888498415647bd","0x19c0e4fa8ab75f5ac7865e0b8f74ff91eb9a100d336f423cd013a8befba40299"],sora:["0x7e4e32d0feafd4f9c9414b0be86373f9a1efa904809b683453a9af6856d38ad5"],stafi:["0x290a4149f09ea0e402c74c1c7e96ae4239588577fe78932f94f5404c68243d80"],statemine:["0x48239ef607d7928874027a43a67689209727dfb3d3dc5e5b03a39bdc2eda771a"],statemint:["0x68d56f15f85d3136970ec16946040bc1752654e906147f7e43e9d539d7c3de2f"],subsocial:["0x0bd72c1c305172e1275278aaeb3f161e02eccb7a819e63f62d47bd53a28189f8"],westend:["0xe143f23803ac50e8f6f8e62695d1ce9e4e1d68aa36c1cd2cfd15340213f3423e"],xxnetwork:["0x50dd5d206917bf10502c68fb4d18a59fc8aa31586f4e8856b493e43544aa82aa"]},kx={centrifuge:"polkadot",kusama:"polkadot",polkadot:"polkadot",sora:"polkadot",statemine:"polkadot",statemint:"polkadot",westmint:"polkadot"},Sx={acala:787,bifrost:788,centrifuge:747,"dock-mainnet":594,edgeware:523,equilibrium:99999997,genshiro:99999996,karura:686,kusama:434,"nodle-chain":1003,polkadot:354,polymesh:595,sora:617,statemine:434,statemint:354,xxnetwork:1955},Ex={"":!0,"cess-testnet":!0,"dock-testnet":!0,jupiter:!0,"mathchain-testnet":!0,subspace_testnet:!0,"zero-alphaville":!0},Ax=[0,2,42],Nx=["testnet"];const Tx=[{prefix:0,network:"polkadot",displayName:"Polkadot Relay Chain",symbols:["DOT"],decimals:[10],standardAccount:"*25519",website:"https://polkadot.network"},{prefix:1,network:"BareSr25519",displayName:"Bare 32-bit Schnorr/Ristretto (S/R 25519) public key.",symbols:[],decimals:[],standardAccount:"Sr25519",website:null},{prefix:2,network:"kusama",displayName:"Kusama Relay Chain",symbols:["KSM"],decimals:[12],standardAccount:"*25519",website:"https://kusama.network"},{prefix:3,network:"BareEd25519",displayName:"Bare 32-bit Ed25519 public key.",symbols:[],decimals:[],standardAccount:"Ed25519",website:null},{prefix:4,network:"katalchain",displayName:"Katal Chain",symbols:[],decimals:[],standardAccount:"*25519",website:null},{prefix:5,network:"astar",displayName:"Astar Network",symbols:["ASTR"],decimals:[18],standardAccount:"*25519",website:"https://astar.network"},{prefix:6,network:"bifrost",displayName:"Bifrost",symbols:["BNC"],decimals:[12],standardAccount:"*25519",website:"https://bifrost.finance/"},{prefix:7,network:"edgeware",displayName:"Edgeware",symbols:["EDG"],decimals:[18],standardAccount:"*25519",website:"https://edgewa.re"},{prefix:8,network:"karura",displayName:"Karura",symbols:["KAR"],decimals:[12],standardAccount:"*25519",website:"https://karura.network/"},{prefix:9,network:"reynolds",displayName:"Laminar Reynolds Canary",symbols:["REY"],decimals:[18],standardAccount:"*25519",website:"http://laminar.network/"},{prefix:10,network:"acala",displayName:"Acala",symbols:["ACA"],decimals:[12],standardAccount:"*25519",website:"https://acala.network/"},{prefix:11,network:"laminar",displayName:"Laminar",symbols:["LAMI"],decimals:[18],standardAccount:"*25519",website:"http://laminar.network/"},{prefix:12,network:"polymesh",displayName:"Polymesh",symbols:["POLYX"],decimals:[6],standardAccount:"*25519",website:"https://polymath.network/"},{prefix:13,network:"integritee",displayName:"Integritee",symbols:["TEER"],decimals:[12],standardAccount:"*25519",website:"https://integritee.network"},{prefix:14,network:"totem",displayName:"Totem",symbols:["TOTEM"],decimals:[0],standardAccount:"*25519",website:"https://totemaccounting.com"},{prefix:15,network:"synesthesia",displayName:"Synesthesia",symbols:["SYN"],decimals:[12],standardAccount:"*25519",website:"https://synesthesia.network/"},{prefix:16,network:"kulupu",displayName:"Kulupu",symbols:["KLP"],decimals:[12],standardAccount:"*25519",website:"https://kulupu.network/"},{prefix:17,network:"dark",displayName:"Dark Mainnet",symbols:[],decimals:[],standardAccount:"*25519",website:null},{prefix:18,network:"darwinia",displayName:"Darwinia Network",symbols:["RING","KTON"],decimals:[9,9],standardAccount:"*25519",website:"https://darwinia.network/"},{prefix:20,network:"stafi",displayName:"Stafi",symbols:["FIS"],decimals:[12],standardAccount:"*25519",website:"https://stafi.io"},{prefix:22,network:"dock-pos-mainnet",displayName:"Dock Mainnet",symbols:["DCK"],decimals:[6],standardAccount:"*25519",website:"https://dock.io"},{prefix:23,network:"shift",displayName:"ShiftNrg",symbols:[],decimals:[],standardAccount:"*25519",website:null},{prefix:24,network:"zero",displayName:"ZERO",symbols:["ZERO"],decimals:[18],standardAccount:"*25519",website:"https://zero.io"},{prefix:25,network:"zero-alphaville",displayName:"ZERO Alphaville",symbols:["ZERO"],decimals:[18],standardAccount:"*25519",website:"https://zero.io"},{prefix:26,network:"jupiter",displayName:"Jupiter",symbols:["jDOT"],decimals:[10],standardAccount:"*25519",website:"https://jupiter.patract.io"},{prefix:27,network:"kabocha",displayName:"Kabocha",symbols:["KAB"],decimals:[12],standardAccount:"*25519",website:"https://kabocha.network"},{prefix:28,network:"subsocial",displayName:"Subsocial",symbols:[],decimals:[],standardAccount:"*25519",website:null},{prefix:29,network:"cord",displayName:"CORD Network",symbols:["DHI","WAY"],decimals:[12,12],standardAccount:"*25519",website:"https://cord.network/"},{prefix:30,network:"phala",displayName:"Phala Network",symbols:["PHA"],decimals:[12],standardAccount:"*25519",website:"https://phala.network"},{prefix:31,network:"litentry",displayName:"Litentry Network",symbols:["LIT"],decimals:[12],standardAccount:"*25519",website:"https://litentry.com/"},{prefix:32,network:"robonomics",displayName:"Robonomics",symbols:["XRT"],decimals:[9],standardAccount:"*25519",website:"https://robonomics.network"},{prefix:33,network:"datahighway",displayName:"DataHighway",symbols:[],decimals:[],standardAccount:"*25519",website:null},{prefix:34,network:"ares",displayName:"Ares Protocol",symbols:["ARES"],decimals:[12],standardAccount:"*25519",website:"https://www.aresprotocol.com/"},{prefix:35,network:"vln",displayName:"Valiu Liquidity Network",symbols:["USDv"],decimals:[15],standardAccount:"*25519",website:"https://valiu.com/"},{prefix:36,network:"centrifuge",displayName:"Centrifuge Chain",symbols:["CFG"],decimals:[18],standardAccount:"*25519",website:"https://centrifuge.io/"},{prefix:37,network:"nodle",displayName:"Nodle Chain",symbols:["NODL"],decimals:[18],standardAccount:"*25519",website:"https://nodle.io/"},{prefix:38,network:"kilt",displayName:"KILT Spiritnet",symbols:["KILT"],decimals:[15],standardAccount:"*25519",website:"https://kilt.io/"},{prefix:39,network:"mathchain",displayName:"MathChain mainnet",symbols:["MATH"],decimals:[18],standardAccount:"*25519",website:"https://mathwallet.org"},{prefix:40,network:"mathchain-testnet",displayName:"MathChain testnet",symbols:["MATH"],decimals:[18],standardAccount:"*25519",website:"https://mathwallet.org"},{prefix:41,network:"poli",displayName:"Polimec Chain",symbols:[],decimals:[],standardAccount:"*25519",website:"https://polimec.io/"},{prefix:42,network:"substrate",displayName:"Substrate",symbols:[],decimals:[],standardAccount:"*25519",website:"https://substrate.io/"},{prefix:43,network:"BareSecp256k1",displayName:"Bare 32-bit ECDSA SECP-256k1 public key.",symbols:[],decimals:[],standardAccount:"secp256k1",website:null},{prefix:44,network:"chainx",displayName:"ChainX",symbols:["PCX"],decimals:[8],standardAccount:"*25519",website:"https://chainx.org/"},{prefix:45,network:"uniarts",displayName:"UniArts Network",symbols:["UART","UINK"],decimals:[12,12],standardAccount:"*25519",website:"https://uniarts.me"},{prefix:46,network:"reserved46",displayName:"This prefix is reserved.",symbols:[],decimals:[],standardAccount:null,website:null},{prefix:47,network:"reserved47",displayName:"This prefix is reserved.",symbols:[],decimals:[],standardAccount:null,website:null},{prefix:48,network:"neatcoin",displayName:"Neatcoin Mainnet",symbols:["NEAT"],decimals:[12],standardAccount:"*25519",website:"https://neatcoin.org"},{prefix:49,network:"picasso",displayName:"Picasso",symbols:["PICA"],decimals:[12],standardAccount:"*25519",website:"https://picasso.composable.finance"},{prefix:50,network:"composable",displayName:"Composable",symbols:["LAYR"],decimals:[12],standardAccount:"*25519",website:"https://composable.finance"},{prefix:51,network:"oak",displayName:"OAK Network",symbols:["OAK"],decimals:[10],standardAccount:"*25519",website:"https://oak.tech"},{prefix:52,network:"KICO",displayName:"KICO",symbols:["KICO"],decimals:[14],standardAccount:"*25519",website:"https://dico.io"},{prefix:53,network:"DICO",displayName:"DICO",symbols:["DICO"],decimals:[14],standardAccount:"*25519",website:"https://dico.io"},{prefix:55,network:"xxnetwork",displayName:"xx network",symbols:["XX"],decimals:[9],standardAccount:"*25519",website:"https://xx.network"},{prefix:63,network:"hydradx",displayName:"HydraDX",symbols:["HDX"],decimals:[12],standardAccount:"*25519",website:"https://hydradx.io"},{prefix:65,network:"aventus",displayName:"AvN Mainnet",symbols:["AVT"],decimals:[18],standardAccount:"*25519",website:"https://aventus.io"},{prefix:66,network:"crust",displayName:"Crust Network",symbols:["CRU"],decimals:[12],standardAccount:"*25519",website:"https://crust.network"},{prefix:67,network:"genshiro",displayName:"Genshiro Network",symbols:["GENS","EQD","LPT0"],decimals:[9,9,9],standardAccount:"*25519",website:"https://genshiro.equilibrium.io"},{prefix:68,network:"equilibrium",displayName:"Equilibrium Network",symbols:["EQ"],decimals:[9],standardAccount:"*25519",website:"https://equilibrium.io"},{prefix:69,network:"sora",displayName:"SORA Network",symbols:["XOR"],decimals:[18],standardAccount:"*25519",website:"https://sora.org"},{prefix:73,network:"zeitgeist",displayName:"Zeitgeist",symbols:["ZTG"],decimals:[10],standardAccount:"*25519",website:"https://zeitgeist.pm"},{prefix:77,network:"manta",displayName:"Manta network",symbols:["MANTA"],decimals:[18],standardAccount:"*25519",website:"https://manta.network"},{prefix:78,network:"calamari",displayName:"Calamari: Manta Canary Network",symbols:["KMA"],decimals:[12],standardAccount:"*25519",website:"https://manta.network"},{prefix:88,network:"polkadex",displayName:"Polkadex Mainnet",symbols:["PDEX"],decimals:[12],standardAccount:"*25519",website:"https://polkadex.trade"},{prefix:98,network:"polkasmith",displayName:"PolkaSmith Canary Network",symbols:["PKS"],decimals:[18],standardAccount:"*25519",website:"https://polkafoundry.com"},{prefix:99,network:"polkafoundry",displayName:"PolkaFoundry Network",symbols:["PKF"],decimals:[18],standardAccount:"*25519",website:"https://polkafoundry.com"},{prefix:101,network:"origintrail-parachain",displayName:"OriginTrail Parachain",symbols:["OTP"],decimals:[12],standardAccount:"*25519",website:"https://parachain.origintrail.io/"},{prefix:105,network:"pontem-network",displayName:"Pontem Network",symbols:["PONT"],decimals:[10],standardAccount:"*25519",website:"https://pontem.network"},{prefix:110,network:"heiko",displayName:"Heiko",symbols:["HKO"],decimals:[12],standardAccount:"*25519",website:"https://parallel.fi/"},{prefix:113,network:"integritee-incognito",displayName:"Integritee Incognito",symbols:[],decimals:[],standardAccount:"*25519",website:"https://integritee.network"},{prefix:128,network:"clover",displayName:"Clover Finance",symbols:["CLV"],decimals:[18],standardAccount:"*25519",website:"https://clover.finance"},{prefix:131,network:"litmus",displayName:"Litmus Network",symbols:["LIT"],decimals:[12],standardAccount:"*25519",website:"https://litentry.com/"},{prefix:136,network:"altair",displayName:"Altair",symbols:["AIR"],decimals:[18],standardAccount:"*25519",website:"https://centrifuge.io/"},{prefix:172,network:"parallel",displayName:"Parallel",symbols:["PARA"],decimals:[12],standardAccount:"*25519",website:"https://parallel.fi/"},{prefix:252,network:"social-network",displayName:"Social Network",symbols:["NET"],decimals:[18],standardAccount:"*25519",website:"https://social.network"},{prefix:255,network:"quartz_mainnet",displayName:"QUARTZ by UNIQUE",symbols:["QTZ"],decimals:[15],standardAccount:"*25519",website:"https://unique.network"},{prefix:268,network:"pioneer_network",displayName:"Pioneer Network by Bit.Country",symbols:["NEER"],decimals:[18],standardAccount:"*25519",website:"https://bit.country"},{prefix:420,network:"sora_kusama_para",displayName:"SORA Kusama Parachain",symbols:["XOR"],decimals:[18],standardAccount:"*25519",website:"https://sora.org"},{prefix:789,network:"geek",displayName:"GEEK Network",symbols:["GEEK"],decimals:[18],standardAccount:"*25519",website:"https://geek.gl"},{prefix:1110,network:"efinity",displayName:"Efinity",symbols:["EFI"],decimals:[18],standardAccount:"Sr25519",website:"https://efinity.io/"},{prefix:1284,network:"moonbeam",displayName:"Moonbeam",symbols:["GLMR"],decimals:[18],standardAccount:"secp256k1",website:"https://moonbeam.network"},{prefix:1285,network:"moonriver",displayName:"Moonriver",symbols:["MOVR"],decimals:[18],standardAccount:"secp256k1",website:"https://moonbeam.network"},{prefix:1328,network:"ajuna",displayName:"Ajuna Network",symbols:["AJUN"],decimals:[12],standardAccount:"*25519",website:"https://ajuna.io"},{prefix:1337,network:"bajun",displayName:"Bajun Network",symbols:["BAJU"],decimals:[12],standardAccount:"*25519",website:"https://ajuna.io"},{prefix:2007,network:"kapex",displayName:"Kapex",symbols:["KAPEX"],decimals:[12],standardAccount:"*25519",website:"https://totemaccounting.com"},{prefix:2032,network:"interlay",displayName:"Interlay",symbols:["INTR"],decimals:[10],standardAccount:"*25519",website:"https://interlay.io/"},{prefix:2092,network:"kintsugi",displayName:"Kintsugi",symbols:["KINT"],decimals:[12],standardAccount:"*25519",website:"https://interlay.io/"},{prefix:2254,network:"subspace_testnet",displayName:"Subspace testnet",symbols:["tSSC"],decimals:[18],standardAccount:"*25519",website:"https://subspace.network"},{prefix:6094,network:"subspace",displayName:"Subspace",symbols:["SSC"],decimals:[18],standardAccount:"*25519",website:"https://subspace.network"},{prefix:7391,network:"unique_mainnet",displayName:"Unique Network",symbols:["UNQ"],decimals:[18],standardAccount:"*25519",website:"https://unique.network"},{prefix:10041,network:"basilisk",displayName:"Basilisk",symbols:["BSX"],decimals:[12],standardAccount:"*25519",website:"https://bsx.fi"},{prefix:11330,network:"cess-testnet",displayName:"CESS Testnet",symbols:["TCESS"],decimals:[12],standardAccount:"*25519",website:"https://cess.cloud"},{prefix:11331,network:"cess",displayName:"CESS",symbols:["CESS"],decimals:[12],standardAccount:"*25519",website:"https://cess.cloud"},{prefix:11820,network:"contextfree",displayName:"Automata ContextFree",symbols:["CTX"],decimals:[18],standardAccount:"*25519",website:"https://ata.network"}].map((function(e){const t=e.network||"",r=t.replace(/_/g,"-").split("-"),n=e;return n.slip44=Sx[t],n.hasLedgerSupport=!!n.slip44,n.genesisHash=xx[t]||[],n.icon=kx[t]||"substrate",n.isTestnet=!!Ex[t]||Nx.includes(r[r.length-1]),n.isIgnored=n.isTestnet||!(e.standardAccount&&e.decimals&&e.decimals.length&&e.symbols&&e.symbols.length)&&42!==e.prefix,n})).filter((function(e){return!e.isIgnored&&!!e.network})).sort((function(e,t){const r=Ax.includes(e.prefix);return r===Ax.includes(t.prefix)?r?0:e.displayName.localeCompare(t.displayName):r?-1:1})),Px=Tx.filter((function({genesisHash:e,prefix:t}){return!!e.length||42===t}));const Mx={allowedDecodedLengths:[1,2,4,8,32,33],allowedEncodedLengths:[3,4,6,10,35,36,37,38],allowedPrefix:Tx.map((function({prefix:e}){return e})),prefix:42};function Ix(e,t,r=-1){if(bm(e,"Invalid empty address passed"),tg(e)||Vm(e))return ig(e);try{const n=ox(e);bm(Mx.allowedEncodedLengths.includes(n.length),"Invalid decoded address length");const[i,o,s,a]=function(e){const t=64&e[0]?2:1,r=1===t?e[0]:(63&e[0])<<2|e[1]>>6|(63&e[1])<<8,n=[34+t,35+t].includes(e.length),i=e.length-(n?2:1),o=wx(e.subarray(0,i));return[0==(128&e[0])&&![46,47].includes(e[0])&&(n?e[e.length-2]===o[0]&&e[e.length-1]===o[1]:e[e.length-1]===o[0]),i,t,r]}(n);return bm(t||i,"Invalid decoded address checksum"),bm([-1,a].includes(r),(()=>`Expected ss58Format ${r}, received ${a}`)),n.slice(s,o)}catch(h2){throw new Error(`Decoding ${e}: ${h2.message}`)}}const Cx={isLe:!1},Rx={isLe:!0},Bx={bitLength:32,isLe:!1},Ox={bitLength:32,isLe:!0},Lx={bitLength:256,isLe:!1},zx={bitLength:256,isLe:!0};ng("modlpy/utilisuba");ng("modlpy/utilisuba");const Ux=/^\d+$/;class _x{#h=new Uint8Array(32);#d=!1;static from(e){const t=new _x,[r,n]=e.startsWith("/")?[e.substring(1),!0]:[e,!1];return t.soft(Ux.test(r)?new bu(r,10):r),n?t.harden():t}get chainCode(){return this.#h}get isHard(){return this.#d}get isSoft(){return!this.#d}hard(e){return this.soft(e).harden()}harden(){return this.#d=!0,this}soft(e){return Ug(e)||Hm(e)||Bg(e)?this.soft(qg(e,zx)):Vm(e)?this.soft(Fm(e)):ay(e)?this.soft(Xg(ng(e))):e.length>32?this.soft(bx(e)):(this.#h.fill(0),this.#h.set(e,0),this)}soften(){return this.#d=!1,this}}const qx=/\/(\/?)([^/]+)/g;function Dx(e){const t=e.match(qx),r=[];let n="";if(t){n=t.join("");for(const e of t)r.push(_x.from(e.substring(1)))}return bm(n===e,(()=>`Re-constructed path "${n}" does not match input`)),{parts:t,path:r}}const Vx=/^(\w+( \w+)*)((\/\/?[^/]+)*)(\/\/\/(.*))?$/;const jx=Xg(ng("Secp256k1HDKD"));function Fx(e,t){if(bm(32===e.length,"Expected valid 32-byte private key as a seed"),!Ym||!t&&Qv()){const t=Iv(e),r=t.slice(32);return bm(!sg(r),"Invalid publicKey generated from WASM interface"),{publicKey:r,secretKey:t.slice(0,32)}}return{publicKey:Lb(e,!0),secretKey:e}}function Hx(e,t){return(r,{chainCode:n,isHard:i})=>(bm(i,"A soft key was found in the path and is not supported"),e(t(r.secretKey.subarray(0,32),n)))}const Wx=Hx(Fx,(function(e,t){return bm(tg(t)&&32===t.length,"Invalid chainCode passed to derive"),bx(og(jx,e,t),256)}));var Kx=r(42559);function Xx(e){return Kx.convertSecretKey(e)}function Gx(e){return vm(Kx.convertPublicKey(e),"Unable to convert publicKey to ed25519")}const Zx=Xg(ng("Ed25519HDKD"));function Jx(e=32){return Wy(new Uint8Array(e))}mx(Jx),new bu(9007199254740991);function Yx(e,t){if(!t&&Qv()){const t=Tv(e);return{publicKey:t.slice(32),secretKey:t.slice(0,64)}}return mu.sign.keyPair.fromSeed(e)}function Qx(e,t,r,n){const i=ig(e),o=ig(r),s=ig(t);return bm(32===o.length,(()=>`Invalid publicKey, received ${o.length}, expected 32`)),bm(64===s.length,(()=>`Invalid signature, received ${s.length} bytes, expected 64`)),!n&&Qv()?Mv(s,i,o):mu.sign.detached.verify(i,s,o)}const $x=Hx(Yx,(function(e,t){return bm(tg(t)&&32===t.length,"Invalid chainCode passed to derive"),bx(og(Zx,e,t))}));function ek(e){const t=ig(e);return bm(96===t.length,(()=>`Expected keypair with 96 bytes, found ${t.length}`)),{publicKey:t.slice(64,96),secretKey:t.slice(0,64)}}function tk(e){return(t,r)=>(bm(tg(r)&&32===r.length,"Invalid chainCode passed to derive"),ek(e(function({publicKey:e,secretKey:t}){return og(t,e).slice()}(t),r)))}const rk=tk(Lv),nk=tk(zv);const ik={ecdsa:Wx,ed25519:$x,ethereum:Wx,sr25519:function(e,{chainCode:t,isSoft:r}){return r?nk(e,t):rk(e,t)}};function ok(e,t,r){const n=ik[r];let i=e;for(const o of t)i=n(i,o);return i}function sk(e){const t=ig(e);return bm(32===t.length,(()=>`Expected a seed matching 32 bytes, found ${t.length}`)),ek(Uv(t))}function ak(e,t,r){const n=ig(r),i=ig(t);return bm(32===n.length,(()=>`Invalid publicKey, received ${n.length} bytes, expected 32`)),bm(64===i.length,(()=>`Invalid signature, received ${i.length} bytes, expected 64`)),qv(i,ig(e),n)}const ck=new Uint8Array;const uk=new Uint8Array;function lk(e,t=Mx.prefix){const r=Ix(e);bm(t>=0&&t<=16383&&![46,47].includes(t),"Out of range ss58Format specified"),bm(Mx.allowedDecodedLengths.includes(r.length),(()=>`Expected a valid key to convert, with length ${Mx.allowedDecodedLengths.join(", ")}`));const n=og(t<64?[t]:[(252&t)>>2|64,t>>8|(3&t)<<6],r);return sx(og(n,wx(n).subarray(0,[32,33].includes(r.length)?2:1)))}const[hk,dk,fk]=[[],[],[]],pk=BigInt(0),mk=BigInt(1),gk=BigInt(2),yk=BigInt(7),bk=BigInt(256),vk=BigInt(113);for(let d2=0,f2=mk,p2=1,m2=0;d2<24;d2++){[p2,m2]=[m2,(2*p2+3*m2)%5],hk.push(2*(5*m2+p2)),dk.push((d2+1)*(d2+2)/2%64);let e=pk;for(let t=0;t<7;t++)f2=(f2<<mk^(f2>>yk)*vk)%bk,f2&gk&&(e^=mk<<(mk<<BigInt(t))-mk);fk.push(e)}const[wk,xk]=Sw(fk,!0),kk=(e,t,r)=>r>32?((e,t,r)=>t<<r-32|e>>>64-r)(e,t,r):((e,t,r)=>e<<r|t>>>32-r)(e,t,r),Sk=(e,t,r)=>r>32?((e,t,r)=>e<<r-32|t>>>64-r)(e,t,r):((e,t,r)=>t<<r|e>>>32-r)(e,t,r);class Ek extends aw{constructor(e,t,r,n=!1,i=24){if(super(),this.blockLen=e,this.suffix=t,this.outputLen=r,this.enableXOF=n,this.rounds=i,this.pos=0,this.posOut=0,this.finished=!1,this.destroyed=!1,ow(r),0>=this.blockLen||this.blockLen>=200)throw new Error("Sha3 supports only keccak-f1600 function");this.state=new Uint8Array(200),this.state32=tw(this.state)}keccak(){!function(e,t=24){const r=new Uint32Array(10);for(let n=24-t;n<24;n++){for(let n=0;n<10;n++)r[n]=e[n]^e[n+10]^e[n+20]^e[n+30]^e[n+40];for(let n=0;n<10;n+=2){const t=(n+8)%10,i=(n+2)%10,o=r[i],s=r[i+1],a=kk(o,s,1)^r[t],c=Sk(o,s,1)^r[t+1];for(let r=0;r<50;r+=10)e[n+r]^=a,e[n+r+1]^=c}let t=e[2],i=e[3];for(let r=0;r<24;r++){const n=dk[r],o=kk(t,i,n),s=Sk(t,i,n),a=hk[r];t=e[a],i=e[a+1],e[a]=o,e[a+1]=s}for(let n=0;n<50;n+=10){for(let t=0;t<10;t++)r[t]=e[n+t];for(let t=0;t<10;t++)e[n+t]^=~r[(t+2)%10]&r[(t+4)%10]}e[0]^=wk[n],e[1]^=xk[n]}r.fill(0)}(this.state32,this.rounds),this.posOut=0,this.pos=0}update(e){if(this.destroyed)throw new Error("instance is destroyed");if(this.finished)throw new Error("digest() was already called");const{blockLen:t,state:r}=this,n=(e=iw(e)).length;for(let i=0;i<n;){const o=Math.min(t-this.pos,n-i);for(let t=0;t<o;t++)r[this.pos++]^=e[i++];this.pos===t&&this.keccak()}return this}finish(){if(this.finished)return;this.finished=!0;const{state:e,suffix:t,pos:r,blockLen:n}=this;e[r]^=t,0!=(128&t)&&r===n-1&&this.keccak(),e[n-1]^=128,this.keccak()}writeInto(e){if(this.destroyed)throw new Error("instance is destroyed");if(!(e instanceof Uint8Array))throw new Error("Keccak: invalid output buffer");this.finish();for(let t=0,r=e.length;t<r;){this.posOut>=this.blockLen&&this.keccak();const n=Math.min(this.blockLen-this.posOut,r-t);e.set(this.state.subarray(this.posOut,this.posOut+n),t),this.posOut+=n,t+=n}return e}xofInto(e){if(!this.enableXOF)throw new Error("XOF is not possible for this instance");return this.writeInto(e)}xof(e){return ow(e),this.xofInto(new Uint8Array(e))}digestInto(e){if(e.length<this.outputLen)throw new Error("Keccak: invalid output buffer");if(this.finished)throw new Error("digest() was already called");return this.finish(),this.writeInto(e),this.destroy(),e}digest(){return this.digestInto(new Uint8Array(this.outputLen))}destroy(){this.destroyed=!0,this.state.fill(0)}_cloneInto(e){const{blockLen:t,suffix:r,outputLen:n,rounds:i,enableXOF:o}=this;return e||(e=new Ek(t,r,n,o,i)),e.state32.set(this.state32),e.pos=this.pos,e.posOut=this.posOut,e.finished=this.finished,e.rounds=i,e.suffix=r,e.outputLen=n,e.enableXOF=o,e.destroyed=this.destroyed,e}}const Ak=(e,t,r)=>uw((()=>new Ek(t,e,r))),Nk=(Ak(6,144,28),Ak(6,136,32),Ak(6,104,48),Ak(6,72,64),Ak(1,144,28),Ak(1,136,32)),Tk=(Ak(1,104,48),Ak(1,72,64)),Pk=(e,t,r)=>lw(((n={})=>new Ek(t,e,void 0!==n.dkLen?n.dkLen:r,!0))),Mk=(Pk(31,168,16),Pk(31,136,32),yx({256:Wv,512:Kv},{256:Nk,512:Tk}));gx(256,Mk),gx(512,Mk),mx(Mk);function Ik(e,t,r){return"keccak"===e?Mk(t,void 0,r):bx(t,void 0,void 0,r)}Ny("setSS58Format");const Ck="abcdefghijklmnopqrstuvwxyz234567",Rk={chars:Ck,coder:Qw.P6.chain(Qw.P6.radix2(5),Qw.P6.alphabet(Ck),{decode:e=>e.split(""),encode:e=>e.join("")}),ipfs:"b",type:"base32"},Bk=rx(Rk),Ok=(tx(Bk),$w(Rk,Bk),ex(Rk),{chars:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",coder:Qw.US,type:"base64"}),Lk=rx(Ok),zk=(tx(Lk),$w(Ok,Lk)),Uk=ex(Ok);function _k(e,t){return 33===e.length?e:(bm(65===e.length,"Invalid publicKey provided"),!Ym||!t&&Qv()?Cv(e):sb.fromHex(e).toRawBytes(!0))}function qk(e,t){if(65===e.length)return e.subarray(1);if(bm(33===e.length,"Invalid publicKey provided"),!Ym||!t&&Qv())return Rv(e).subarray(1);const{x:r,y:n}=sb.fromHex(e);return og(qg(r,Lx),qg(n,Lx))}function Dk(e,t,r,n="blake2",i){const o=ig(t).subarray(0,64),s=ig(e),a=!Ym||!i&&Qv()?Bv(s,o,r):function(e,t,r,n=!1){return sb.fromSignature(e,t,r).toRawBytes(n)}(s,ub.fromCompact(o).toRawBytes(),r);return bm(a,"Unable to recover publicKey from signature"),"keccak"===n?qk(a,i):_k(a,i)}function Vk(e,{secretKey:t},r="blake2",n){bm(32===(null==t?void 0:t.length),"Expected valid secp256k1 secretKey, 32-bytes");const i=Ik(r,e,n);if(!Ym||!n&&Qv())return Ov(i,t);const[o,s]=function(e,t,r={}){const{seed:n,m:i,d:o}=qb(e,t,r.extraEntropy);let s;const a=new Mb;for(a.reseedSync(n);!(s=Rb(a.generateSync(),i,o));)a.reseedSync();return Db(s,r)}(i,t,{canonical:!0,recovered:!0}),{r:a,s:c}=ub.fromHex(o);return og(qg(a,Lx),qg(c,Lx),new Uint8Array([s||0]))}const jk="ffffffff ffffffff ffffffff fffffffe baaedce6 af48a03b bfd25e8c d0364141".replace(/ /g,""),Fk=Tm(`0x${jk}`),Hk=new bu(jk,"hex");function Wk(e,t,r){return bm(tg(e)&&32===e.length,"Expected seckey to be an Uint8Array with length 32"),bm(tg(t)&&32===t.length,"Expected tweak to be an Uint8Array with length 32"),!Ym||r?function(e,t){const r=new bu(t);return bm(r.cmp(Hk)<0,"Tweak parameter is out of range"),r.iadd(new bu(e)),r.cmp(Hk)>=0&&r.isub(Hk),bm(!r.isZero(),"Invalid resulting private key"),qg(r,Lx)}(e,t):function(e,t){let r=Om(t,Cx);return bm(r<Fk,"Tweak parameter is out of range"),r+=Om(e,Cx),r>=Fk&&(r-=Fk),bm(r!==Pm,"Invalid resulting private key"),xg(r,Lx)}(e,t)}function Kk(e){if(!e)return"0x";const t=ig(e);bm([20,32,33,65].includes(t.length),"Invalid address or publicKey passed");const r=hg(([33,65].includes((n=t).length)&&(n=Mk(qk(n))),n.slice(-20)),-1,!1);var n;const i=hg(Mk(r),-1,!1);let o="";for(let s=0;s<40;s++)o=`${o}${parseInt(i[s],16)>7?r[s].toUpperCase():r[s]}`;return`0x${o}`}function Xk(e){return!(!e||42!==e.length||!Vm(e))&&(!(!/^(0x)?[0-9a-f]{40}$/.test(e)&&!/^(0x)?[0-9A-F]{40}$/.test(e))||function(e){const t=e.replace("0x",""),r=hg(Mk(t.toLowerCase()),-1,!1);for(let o=0;o<40;o++)if(n=t[o],i=parseInt(r[o],16),n!==(i>7?n.toUpperCase():n.toLowerCase()))return!1;var n,i;return!0}(e))}const Gk=2147483648;const Zk=ng("Bitcoin seed");function Jk(e,t){return{chainCode:t,publicKey:Fx(e).publicKey,secretKey:e}}function Yk(e,t){const r=qg(t,Bx),n=t>=Gk?og(new Uint8Array(1),e.secretKey,r):og(e.publicKey,r);try{const t=Jw(e.chainCode,n,512);return Jk(Wk(e.secretKey,t.slice(0,32)),t.slice(32))}catch(i){return Yk(e,t+1)}}function Qk(e,t=""){const r=Jw(Zk,e,512);let n=Jk(r.slice(0,32),r.slice(32));if(!t||"m"===t||"M"===t||"m'"===t||"M'"===t)return n;bm(function(e){if(!e.startsWith("m/"))return!1;const t=e.split("/").slice(1);for(const r of t){const e=/^\d+'?$/.test(r)?parseInt(r.replace(/'$/,""),10):Number.NaN;if(isNaN(e)||e>=Gk||e<0)return!1}return!0}(t),"Invalid derivation path");const i=t.split("/").slice(1);for(const o of i)n=Yk(n,parseInt(o,10)+(o.length>1&&o.endsWith("'")?Gk:0));return n}function $k(e,t,r,n){sw(e);const i=cw({dkLen:32,asyncTick:10},n),{c:o,dkLen:s,asyncTick:a}=i;if(ow(o),ow(s),ow(a),o<1)throw new Error("PBKDF2: iterations (c) should be >= 1");const c=iw(t),u=iw(r),l=new Uint8Array(s),h=dw.create(e,c),d=h._cloneInto().update(u);return{c:o,dkLen:s,asyncTick:a,DK:l,PRF:h,PRFSalt:d}}function eS(e,t,r,n,i){return e.destroy(),t.destroy(),n&&n.destroy(),i.fill(0),r}function tS(e,t,r,n){const{c:i,dkLen:o,DK:s,PRF:a,PRFSalt:c}=$k(e,t,r,n);let u;const l=new Uint8Array(4),h=rw(l),d=new Uint8Array(a.outputLen);for(let f=1,p=0;p<o;f++,p+=a.outputLen){const e=s.subarray(p,p+a.outputLen);h.setInt32(0,f,!1),(u=c._cloneInto(u)).update(l).digestInto(d),e.set(d.subarray(0,e.length));for(let t=1;t<i;t++){a._cloneInto(u).update(d).digestInto(d);for(let t=0;t<e.length;t++)e[t]^=d[t]}}return eS(a,c,s,u,d)}function rS(e,t=Jx(),r=2048,n){const i=ig(e),o=ig(t);return{password:!Ym||!n&&Qv()?Xv(i,o,r):tS(Kw,i,o,{c:r,dkLen:64}),rounds:r,salt:t}}const nS=yx({256:Zv,512:Jv},{256:vw,512:Kw}),iS=gx(256,nS),oS=(gx(512,nS),"abandon|ability|able|about|above|absent|absorb|abstract|absurd|abuse|access|accident|account|accuse|achieve|acid|acoustic|acquire|across|act|action|actor|actress|actual|adapt|add|addict|address|adjust|admit|adult|advance|advice|aerobic|affair|afford|afraid|again|age|agent|agree|ahead|aim|air|airport|aisle|alarm|album|alcohol|alert|alien|all|alley|allow|almost|alone|alpha|already|also|alter|always|amateur|amazing|among|amount|amused|analyst|anchor|ancient|anger|angle|angry|animal|ankle|announce|annual|another|answer|antenna|antique|anxiety|any|apart|apology|appear|apple|approve|april|arch|arctic|area|arena|argue|arm|armed|armor|army|around|arrange|arrest|arrive|arrow|art|artefact|artist|artwork|ask|aspect|assault|asset|assist|assume|asthma|athlete|atom|attack|attend|attitude|attract|auction|audit|august|aunt|author|auto|autumn|average|avocado|avoid|awake|aware|away|awesome|awful|awkward|axis|baby|bachelor|bacon|badge|bag|balance|balcony|ball|bamboo|banana|banner|bar|barely|bargain|barrel|base|basic|basket|battle|beach|bean|beauty|because|become|beef|before|begin|behave|behind|believe|below|belt|bench|benefit|best|betray|better|between|beyond|bicycle|bid|bike|bind|biology|bird|birth|bitter|black|blade|blame|blanket|blast|bleak|bless|blind|blood|blossom|blouse|blue|blur|blush|board|boat|body|boil|bomb|bone|bonus|book|boost|border|boring|borrow|boss|bottom|bounce|box|boy|bracket|brain|brand|brass|brave|bread|breeze|brick|bridge|brief|bright|bring|brisk|broccoli|broken|bronze|broom|brother|brown|brush|bubble|buddy|budget|buffalo|build|bulb|bulk|bullet|bundle|bunker|burden|burger|burst|bus|business|busy|butter|buyer|buzz|cabbage|cabin|cable|cactus|cage|cake|call|calm|camera|camp|can|canal|cancel|candy|cannon|canoe|canvas|canyon|capable|capital|captain|car|carbon|card|cargo|carpet|carry|cart|case|cash|casino|castle|casual|cat|catalog|catch|category|cattle|caught|cause|caution|cave|ceiling|celery|cement|census|century|cereal|certain|chair|chalk|champion|change|chaos|chapter|charge|chase|chat|cheap|check|cheese|chef|cherry|chest|chicken|chief|child|chimney|choice|choose|chronic|chuckle|chunk|churn|cigar|cinnamon|circle|citizen|city|civil|claim|clap|clarify|claw|clay|clean|clerk|clever|click|client|cliff|climb|clinic|clip|clock|clog|close|cloth|cloud|clown|club|clump|cluster|clutch|coach|coast|coconut|code|coffee|coil|coin|collect|color|column|combine|come|comfort|comic|common|company|concert|conduct|confirm|congress|connect|consider|control|convince|cook|cool|copper|copy|coral|core|corn|correct|cost|cotton|couch|country|couple|course|cousin|cover|coyote|crack|cradle|craft|cram|crane|crash|crater|crawl|crazy|cream|credit|creek|crew|cricket|crime|crisp|critic|crop|cross|crouch|crowd|crucial|cruel|cruise|crumble|crunch|crush|cry|crystal|cube|culture|cup|cupboard|curious|current|curtain|curve|cushion|custom|cute|cycle|dad|damage|damp|dance|danger|daring|dash|daughter|dawn|day|deal|debate|debris|decade|december|decide|decline|decorate|decrease|deer|defense|define|defy|degree|delay|deliver|demand|demise|denial|dentist|deny|depart|depend|deposit|depth|deputy|derive|describe|desert|design|desk|despair|destroy|detail|detect|develop|device|devote|diagram|dial|diamond|diary|dice|diesel|diet|differ|digital|dignity|dilemma|dinner|dinosaur|direct|dirt|disagree|discover|disease|dish|dismiss|disorder|display|distance|divert|divide|divorce|dizzy|doctor|document|dog|doll|dolphin|domain|donate|donkey|donor|door|dose|double|dove|draft|dragon|drama|drastic|draw|dream|dress|drift|drill|drink|drip|drive|drop|drum|dry|duck|dumb|dune|during|dust|dutch|duty|dwarf|dynamic|eager|eagle|early|earn|earth|easily|east|easy|echo|ecology|economy|edge|edit|educate|effort|egg|eight|either|elbow|elder|electric|elegant|element|elephant|elevator|elite|else|embark|embody|embrace|emerge|emotion|employ|empower|empty|enable|enact|end|endless|endorse|enemy|energy|enforce|engage|engine|enhance|enjoy|enlist|enough|enrich|enroll|ensure|enter|entire|entry|envelope|episode|equal|equip|era|erase|erode|erosion|error|erupt|escape|essay|essence|estate|eternal|ethics|evidence|evil|evoke|evolve|exact|example|excess|exchange|excite|exclude|excuse|execute|exercise|exhaust|exhibit|exile|exist|exit|exotic|expand|expect|expire|explain|expose|express|extend|extra|eye|eyebrow|fabric|face|faculty|fade|faint|faith|fall|false|fame|family|famous|fan|fancy|fantasy|farm|fashion|fat|fatal|father|fatigue|fault|favorite|feature|february|federal|fee|feed|feel|female|fence|festival|fetch|fever|few|fiber|fiction|field|figure|file|film|filter|final|find|fine|finger|finish|fire|firm|first|fiscal|fish|fit|fitness|fix|flag|flame|flash|flat|flavor|flee|flight|flip|float|flock|floor|flower|fluid|flush|fly|foam|focus|fog|foil|fold|follow|food|foot|force|forest|forget|fork|fortune|forum|forward|fossil|foster|found|fox|fragile|frame|frequent|fresh|friend|fringe|frog|front|frost|frown|frozen|fruit|fuel|fun|funny|furnace|fury|future|gadget|gain|galaxy|gallery|game|gap|garage|garbage|garden|garlic|garment|gas|gasp|gate|gather|gauge|gaze|general|genius|genre|gentle|genuine|gesture|ghost|giant|gift|giggle|ginger|giraffe|girl|give|glad|glance|glare|glass|glide|glimpse|globe|gloom|glory|glove|glow|glue|goat|goddess|gold|good|goose|gorilla|gospel|gossip|govern|gown|grab|grace|grain|grant|grape|grass|gravity|great|green|grid|grief|grit|grocery|group|grow|grunt|guard|guess|guide|guilt|guitar|gun|gym|habit|hair|half|hammer|hamster|hand|happy|harbor|hard|harsh|harvest|hat|have|hawk|hazard|head|health|heart|heavy|hedgehog|height|hello|helmet|help|hen|hero|hidden|high|hill|hint|hip|hire|history|hobby|hockey|hold|hole|holiday|hollow|home|honey|hood|hope|horn|horror|horse|hospital|host|hotel|hour|hover|hub|huge|human|humble|humor|hundred|hungry|hunt|hurdle|hurry|hurt|husband|hybrid|ice|icon|idea|identify|idle|ignore|ill|illegal|illness|image|imitate|immense|immune|impact|impose|improve|impulse|inch|include|income|increase|index|indicate|indoor|industry|infant|inflict|inform|inhale|inherit|initial|inject|injury|inmate|inner|innocent|input|inquiry|insane|insect|inside|inspire|install|intact|interest|into|invest|invite|involve|iron|island|isolate|issue|item|ivory|jacket|jaguar|jar|jazz|jealous|jeans|jelly|jewel|job|join|joke|journey|joy|judge|juice|jump|jungle|junior|junk|just|kangaroo|keen|keep|ketchup|key|kick|kid|kidney|kind|kingdom|kiss|kit|kitchen|kite|kitten|kiwi|knee|knife|knock|know|lab|label|labor|ladder|lady|lake|lamp|language|laptop|large|later|latin|laugh|laundry|lava|law|lawn|lawsuit|layer|lazy|leader|leaf|learn|leave|lecture|left|leg|legal|legend|leisure|lemon|lend|length|lens|leopard|lesson|letter|level|liar|liberty|library|license|life|lift|light|like|limb|limit|link|lion|liquid|list|little|live|lizard|load|loan|lobster|local|lock|logic|lonely|long|loop|lottery|loud|lounge|love|loyal|lucky|luggage|lumber|lunar|lunch|luxury|lyrics|machine|mad|magic|magnet|maid|mail|main|major|make|mammal|man|manage|mandate|mango|mansion|manual|maple|marble|march|margin|marine|market|marriage|mask|mass|master|match|material|math|matrix|matter|maximum|maze|meadow|mean|measure|meat|mechanic|medal|media|melody|melt|member|memory|mention|menu|mercy|merge|merit|merry|mesh|message|metal|method|middle|midnight|milk|million|mimic|mind|minimum|minor|minute|miracle|mirror|misery|miss|mistake|mix|mixed|mixture|mobile|model|modify|mom|moment|monitor|monkey|monster|month|moon|moral|more|morning|mosquito|mother|motion|motor|mountain|mouse|move|movie|much|muffin|mule|multiply|muscle|museum|mushroom|music|must|mutual|myself|mystery|myth|naive|name|napkin|narrow|nasty|nation|nature|near|neck|need|negative|neglect|neither|nephew|nerve|nest|net|network|neutral|never|news|next|nice|night|noble|noise|nominee|noodle|normal|north|nose|notable|note|nothing|notice|novel|now|nuclear|number|nurse|nut|oak|obey|object|oblige|obscure|observe|obtain|obvious|occur|ocean|october|odor|off|offer|office|often|oil|okay|old|olive|olympic|omit|once|one|onion|online|only|open|opera|opinion|oppose|option|orange|orbit|orchard|order|ordinary|organ|orient|original|orphan|ostrich|other|outdoor|outer|output|outside|oval|oven|over|own|owner|oxygen|oyster|ozone|pact|paddle|page|pair|palace|palm|panda|panel|panic|panther|paper|parade|parent|park|parrot|party|pass|patch|path|patient|patrol|pattern|pause|pave|payment|peace|peanut|pear|peasant|pelican|pen|penalty|pencil|people|pepper|perfect|permit|person|pet|phone|photo|phrase|physical|piano|picnic|picture|piece|pig|pigeon|pill|pilot|pink|pioneer|pipe|pistol|pitch|pizza|place|planet|plastic|plate|play|please|pledge|pluck|plug|plunge|poem|poet|point|polar|pole|police|pond|pony|pool|popular|portion|position|possible|post|potato|pottery|poverty|powder|power|practice|praise|predict|prefer|prepare|present|pretty|prevent|price|pride|primary|print|priority|prison|private|prize|problem|process|produce|profit|program|project|promote|proof|property|prosper|protect|proud|provide|public|pudding|pull|pulp|pulse|pumpkin|punch|pupil|puppy|purchase|purity|purpose|purse|push|put|puzzle|pyramid|quality|quantum|quarter|question|quick|quit|quiz|quote|rabbit|raccoon|race|rack|radar|radio|rail|rain|raise|rally|ramp|ranch|random|range|rapid|rare|rate|rather|raven|raw|razor|ready|real|reason|rebel|rebuild|recall|receive|recipe|record|recycle|reduce|reflect|reform|refuse|region|regret|regular|reject|relax|release|relief|rely|remain|remember|remind|remove|render|renew|rent|reopen|repair|repeat|replace|report|require|rescue|resemble|resist|resource|response|result|retire|retreat|return|reunion|reveal|review|reward|rhythm|rib|ribbon|rice|rich|ride|ridge|rifle|right|rigid|ring|riot|ripple|risk|ritual|rival|river|road|roast|robot|robust|rocket|romance|roof|rookie|room|rose|rotate|rough|round|route|royal|rubber|rude|rug|rule|run|runway|rural|sad|saddle|sadness|safe|sail|salad|salmon|salon|salt|salute|same|sample|sand|satisfy|satoshi|sauce|sausage|save|say|scale|scan|scare|scatter|scene|scheme|school|science|scissors|scorpion|scout|scrap|screen|script|scrub|sea|search|season|seat|second|secret|section|security|seed|seek|segment|select|sell|seminar|senior|sense|sentence|series|service|session|settle|setup|seven|shadow|shaft|shallow|share|shed|shell|sheriff|shield|shift|shine|ship|shiver|shock|shoe|shoot|shop|short|shoulder|shove|shrimp|shrug|shuffle|shy|sibling|sick|side|siege|sight|sign|silent|silk|silly|silver|similar|simple|since|sing|siren|sister|situate|six|size|skate|sketch|ski|skill|skin|skirt|skull|slab|slam|sleep|slender|slice|slide|slight|slim|slogan|slot|slow|slush|small|smart|smile|smoke|smooth|snack|snake|snap|sniff|snow|soap|soccer|social|sock|soda|soft|solar|soldier|solid|solution|solve|someone|song|soon|sorry|sort|soul|sound|soup|source|south|space|spare|spatial|spawn|speak|special|speed|spell|spend|sphere|spice|spider|spike|spin|spirit|split|spoil|sponsor|spoon|sport|spot|spray|spread|spring|spy|square|squeeze|squirrel|stable|stadium|staff|stage|stairs|stamp|stand|start|state|stay|steak|steel|stem|step|stereo|stick|still|sting|stock|stomach|stone|stool|story|stove|strategy|street|strike|strong|struggle|student|stuff|stumble|style|subject|submit|subway|success|such|sudden|suffer|sugar|suggest|suit|summer|sun|sunny|sunset|super|supply|supreme|sure|surface|surge|surprise|surround|survey|suspect|sustain|swallow|swamp|swap|swarm|swear|sweet|swift|swim|swing|switch|sword|symbol|symptom|syrup|system|table|tackle|tag|tail|talent|talk|tank|tape|target|task|taste|tattoo|taxi|teach|team|tell|ten|tenant|tennis|tent|term|test|text|thank|that|theme|then|theory|there|they|thing|this|thought|three|thrive|throw|thumb|thunder|ticket|tide|tiger|tilt|timber|time|tiny|tip|tired|tissue|title|toast|tobacco|today|toddler|toe|together|toilet|token|tomato|tomorrow|tone|tongue|tonight|tool|tooth|top|topic|topple|torch|tornado|tortoise|toss|total|tourist|toward|tower|town|toy|track|trade|traffic|tragic|train|transfer|trap|trash|travel|tray|treat|tree|trend|trial|tribe|trick|trigger|trim|trip|trophy|trouble|truck|true|truly|trumpet|trust|truth|try|tube|tuition|tumble|tuna|tunnel|turkey|turn|turtle|twelve|twenty|twice|twin|twist|two|type|typical|ugly|umbrella|unable|unaware|uncle|uncover|under|undo|unfair|unfold|unhappy|uniform|unique|unit|universe|unknown|unlock|until|unusual|unveil|update|upgrade|uphold|upon|upper|upset|urban|urge|usage|use|used|useful|useless|usual|utility|vacant|vacuum|vague|valid|valley|valve|van|vanish|vapor|various|vast|vault|vehicle|velvet|vendor|venture|venue|verb|verify|version|very|vessel|veteran|viable|vibrant|vicious|victory|video|view|village|vintage|violin|virtual|virus|visa|visit|visual|vital|vivid|vocal|voice|void|volcano|volume|vote|voyage|wage|wagon|wait|walk|wall|walnut|want|warfare|warm|warrior|wash|wasp|waste|water|wave|way|wealth|weapon|wear|weasel|weather|web|wedding|weekend|weird|welcome|west|wet|whale|what|wheat|wheel|when|where|whip|whisper|wide|width|wife|wild|will|win|window|wine|wing|wink|winner|winter|wire|wisdom|wise|wish|witness|wolf|woman|wonder|wood|wool|word|work|world|worry|worth|wrap|wreck|wrestle|wrist|write|wrong|yard|year|yellow|you|young|youth|zebra|zero|zone|zoo".split("|")),sS="Invalid mnemonic",aS="Invalid entropy";function cS(e){return(e||"").normalize("NFKD")}function uS(e){return parseInt(e,2)}function lS(e){return e.map((e=>e.toString(2).padStart(8,"0"))).join("")}function hS(e){return lS(Array.from(iS(e))).slice(0,8*e.length/32)}function dS(e,t){return rS(ng(cS(e)),ng(`mnemonic${cS(t)}`)).password}function fS(e){var t;const r=cS(e).split(" ");bm(r.length%3==0,sS);const n=r.map((e=>{const t=oS.indexOf(e);return bm(-1!==t,sS),t.toString(2).padStart(11,"0")})).join(""),i=32*Math.floor(n.length/33),o=n.slice(0,i),s=n.slice(i),a=null===(t=o.match(/(.{1,8})/g))||void 0===t?void 0:t.map(uS);bm(a&&a.length%4==0&&a.length>=16&&a.length<=32,aS);const c=ig(a);return bm(hS(c)===s,"Invalid mnemonic checksum"),c}function pS(e,t){return!Ym||!t&&Qv()?Nv(e):function(e){try{fS(e)}catch(t){return!1}return!0}(e)}function mS(e,t="",r){if(bm(pS(e),"Invalid bip39 mnemonic specified"),!r&&Qv())return Ev(e,t);const n=function(e,t){return!Ym||!t&&Qv()?Sv(e):fS(e)}(e);return rS(n,ng(`mnemonic${t}`)).password.slice(0,32)}const gS=(e,t)=>e<<t|e>>>32-t;function yS(e,t,r,n,i,o){let s=e[t++]^r[n++],a=e[t++]^r[n++],c=e[t++]^r[n++],u=e[t++]^r[n++],l=e[t++]^r[n++],h=e[t++]^r[n++],d=e[t++]^r[n++],f=e[t++]^r[n++],p=e[t++]^r[n++],m=e[t++]^r[n++],g=e[t++]^r[n++],y=e[t++]^r[n++],b=e[t++]^r[n++],v=e[t++]^r[n++],w=e[t++]^r[n++],x=e[t++]^r[n++],k=s,S=a,E=c,A=u,N=l,T=h,P=d,M=f,I=p,C=m,R=g,B=y,O=b,L=v,z=w,U=x;for(let _=0;_<8;_+=2)N^=gS(k+O|0,7),I^=gS(N+k|0,9),O^=gS(I+N|0,13),k^=gS(O+I|0,18),C^=gS(T+S|0,7),L^=gS(C+T|0,9),S^=gS(L+C|0,13),T^=gS(S+L|0,18),z^=gS(R+P|0,7),E^=gS(z+R|0,9),P^=gS(E+z|0,13),R^=gS(P+E|0,18),A^=gS(U+B|0,7),M^=gS(A+U|0,9),B^=gS(M+A|0,13),U^=gS(B+M|0,18),S^=gS(k+A|0,7),E^=gS(S+k|0,9),A^=gS(E+S|0,13),k^=gS(A+E|0,18),P^=gS(T+N|0,7),M^=gS(P+T|0,9),N^=gS(M+P|0,13),T^=gS(N+M|0,18),B^=gS(R+C|0,7),I^=gS(B+R|0,9),C^=gS(I+B|0,13),R^=gS(C+I|0,18),O^=gS(U+z|0,7),L^=gS(O+U|0,9),z^=gS(L+O|0,13),U^=gS(z+L|0,18);i[o++]=s+k|0,i[o++]=a+S|0,i[o++]=c+E|0,i[o++]=u+A|0,i[o++]=l+N|0,i[o++]=h+T|0,i[o++]=d+P|0,i[o++]=f+M|0,i[o++]=p+I|0,i[o++]=m+C|0,i[o++]=g+R|0,i[o++]=y+B|0,i[o++]=b+O|0,i[o++]=v+L|0,i[o++]=w+z|0,i[o++]=x+U|0}function bS(e,t,r,n,i){let o=n+0,s=n+16*i;for(let a=0;a<16;a++)r[s+a]=e[t+16*(2*i-1)+a];for(let a=0;a<i;a++,o+=16,t+=16)yS(r,s,e,t,r,o),a>0&&(s+=16),yS(r,o,e,t+=16,r,s)}function vS(e,t,r){const n=cw({dkLen:32,asyncTick:10,maxmem:1073742848},r),{N:i,r:o,p:s,dkLen:a,asyncTick:c,maxmem:u,onProgress:l}=n;if(ow(i),ow(o),ow(s),ow(a),ow(c),ow(u),void 0!==l&&"function"!=typeof l)throw new Error("progressCb should be function");const h=128*o,d=h/4;if(i<=1||0!=(i&i-1)||i>=2**(h/8)||i>2**32)throw new Error("Scrypt: N must be larger than 1, a power of 2, less than 2^(128 * r / 8) and less than 2^32");if(s<0||s>137438953440/h)throw new Error("Scrypt: p must be a positive integer less than or equal to ((2^32 - 1) * 32) / (128 * r)");if(a<0||a>137438953440)throw new Error("Scrypt: dkLen should be positive integer less than or equal to (2^32 - 1) * 32");const f=h*(i+s);if(f>u)throw new Error(`Scrypt: parameters too large, ${f} (128 * r * (N + p)) > ${u} (maxmem)`);const p=tS(vw,e,t,{c:1,dkLen:h*s}),m=tw(p),g=tw(new Uint8Array(h*i)),y=tw(new Uint8Array(h));let b=()=>{};if(l){const e=2*i*s,t=Math.max(Math.floor(e/1e4),1);let r=0;b=()=>{r++,!l||r%t&&r!==e||l(r/e)}}return{N:i,r:o,p:s,dkLen:a,blockSize32:d,V:g,B32:m,B:p,tmp:y,blockMixCb:b,asyncTick:c}}function wS(e,t,r,n,i){const o=tS(vw,e,r,{c:1,dkLen:t});return r.fill(0),n.fill(0),i.fill(0),o}function xS(e,t,r){const{N:n,r:i,p:o,dkLen:s,blockSize32:a,V:c,B32:u,B:l,tmp:h,blockMixCb:d}=vS(e,t,r);for(let f=0;f<o;f++){const e=a*f;for(let t=0;t<a;t++)c[t]=u[e+t];for(let t=0,r=0;t<n-1;t++)bS(c,r,c,r+=a,i),d();bS(c,(n-1)*a,u,e,i),d();for(let t=0;t<n;t++){const t=u[e+a-16]%n;for(let r=0;r<a;r++)h[r]=u[e+r]^c[t*a+r];bS(h,0,u,e,i),d()}}return wS(e,s,l,c,h)}const kS={N:32768,p:1,r:8};function SS(e,t=Jx(),r=kS,n){const i=ig(e);return{params:r,password:!Ym||!n&&Qv()?Gv(i,t,Math.log2(r.N),r.r,r.p):xS(i,t,Im({dkLen:64},r)),salt:t}}const ES=["scrypt","xsalsa20-poly1305"],AS=["none"];function NS(e,t,r=ES){bm(e,"No encrypted data available to decode"),bm(t||!r.includes("xsalsa20-poly1305"),"Password required to decode encrypted data");let n=e;if(t){let i;if(r.includes("scrypt")){const{params:r,salt:n}=function(e){const t=e.subarray(0,32),r=ug(e.subarray(32,36),Rx).toNumber(),n=ug(e.subarray(36,40),Rx).toNumber(),i=ug(e.subarray(40,44),Rx).toNumber();return bm(r===kS.N&&n===kS.p&&i===kS.r,"Invalid injected scrypt params found"),{params:{N:r,p:n,r:i},salt:t}}(e);i=SS(t,n,r).password,e=e.subarray(44)}else i=ng(t);n=function(e,t,r){return mu.secretbox.open(e,t,r)||null}(e.subarray(24),e.subarray(0,24),function(e,t=-1,r=!1){const n=Math.ceil(t/8);if(-1===t||e.length===n)return e;if(e.length>n)return e.subarray(0,n);const i=new Uint8Array(n);return i.set(e,r?0:n-e.length),i}(i,256,!0))}return bm(n,"Unable to decode using the supplied passphrase"),n}const TS=e=>(t,r,n)=>function(e,t,r,n="blake2",i){const o=ig(t);bm(65===o.length,`Expected signature with 65 bytes, ${o.length} found instead`);const s=Dk(Ik(n,e),o,o[64],n,i),a=Ik(n,s,i),c=ig(r);return ag(s,c)||("keccak"===n?ag(a.slice(-20),c.slice(-20)):ag(a,c))}(t,r,n,e),PS=[["ecdsa",TS("blake2")],["ethereum",TS("keccak")]],MS=[["ed25519",Qx],["sr25519",ak],...PS],IS=["ed25519","sr25519","ecdsa"];function CS(e,{message:t,publicKey:r,signature:n},i=MS){return e.isValid=i.some((([i,o])=>{try{if(o(t,n,r))return e.crypto=i,!0}catch(h2){}return!1})),e}function RS(e,{message:t,publicKey:r,signature:n}){bm([0,1,2].includes(n[0]),(()=>`Unknown crypto type, expected signature prefix [0..2], found ${n[0]}`));const i=IS[n[0]]||"none";e.crypto=i;try{e.isValid={ecdsa:()=>CS(e,{message:t,publicKey:r,signature:n.subarray(1)},PS).isValid,ed25519:()=>Qx(t,n.subarray(1),r),none:()=>{throw Error("no verify for `none` crypto type")},sr25519:()=>ak(t,n.subarray(1),r)}[i]()}catch(h2){}return e}function BS(e,t,r){const n=ig(t);bm([64,65,66].includes(n.length),(()=>`Invalid signature length, expected [64..66] bytes, found ${n.length}`));const i=Ix(r),o={message:ig(e),publicKey:i,signature:n},s={crypto:"none",isValid:!1,isWrapped:bg(o.message,!0),publicKey:i},a=bg(o.message,!1),c=function(e){return[0,1,2].includes(e[0])&&[65,66].includes(e.length)?RS:CS}(n);return c(s,o),"none"!==s.crypto||s.isWrapped&&!a?s:(o.message=a?function(e){const t=ig(e);return bg(t,!1)?t.subarray(mg.length,t.length-gg.length):t}(o.message):function(e){const t=ig(e);return bg(t,!0)?t:og(mg,t,gg)}(o.message),c(s,o))}const OS=Tm("11400714785074694791"),LS=Tm("14029467366897019727"),zS=Tm("1609587929392839161"),US=Tm("9650029242287828579"),_S=Tm("2870177450012600261"),qS=Tm("0xffffffffffffffff"),DS=Tm(7),VS=Tm(11),jS=Tm(12),FS=Tm(16),HS=Tm(18),WS=Tm(23),KS=Tm(27),XS=Tm(29),GS=Tm(31),ZS=Tm(32),JS=Tm(33),YS=Tm(64),QS=Tm(256);function $S(e,t){const r=e&qS;return(r<<t|r>>YS-t)&qS}function eE(e,t,r){const n=new Array(r);let i=0;for(let s=0;s<r;s++,i+=2)n[s]=Tm(e[t+i]|e[t+1+i]<<8);let o=Pm;for(let s=r-1;s>=0;s--)o=(o<<FS)+n[s];return o}function tE(e,t){const{seed:r,u8a:n,u8asize:i,v1:o,v2:s,v3:a,v4:c}=function(e,t){if(t.length<32)return e.u8a.set(t),e.u8asize=t.length,e;const r=t.length-32;let n=0;if(r>=0){const i=e=>OS*$S(e+LS*eE(t,n,4),GS);do{e.v1=i(e.v1),n+=8,e.v2=i(e.v2),n+=8,e.v3=i(e.v3),n+=8,e.v4=i(e.v4),n+=8}while(n<=r)}return n<t.length&&(e.u8a.set(t.subarray(n,t.length)),e.u8asize=t.length-n),e}(function(e){const t=Tm(e);return{seed:t,u8a:new Uint8Array(32),u8asize:0,v1:t+OS+LS,v2:t+LS,v3:t,v4:t-OS}}(t),e);let u=0,l=qS&Tm(e.length)+(e.length>=32?(((($S(o,Mm)+$S(s,DS)+$S(a,jS)+$S(c,HS)^OS*$S(o*LS,GS))*OS+US^OS*$S(s*LS,GS))*OS+US^OS*$S(a*LS,GS))*OS+US^OS*$S(c*LS,GS))*OS+US:r+_S);for(;u<=i-8;)l=qS&US+OS*$S(l^OS*$S(LS*eE(n,u,4),GS),KS),u+=8;for(u+4<=i&&(l=qS&zS+LS*$S(l^OS*eE(n,u,2),WS),u+=4);u<i;)l=qS&OS*$S(l^_S*Tm(n[u++]),VS);return l=qS&LS*(l^l>>JS),l=qS&zS*(l^l>>XS),function(e){const t=new Uint8Array(8);for(let r=7;r>=0;r--)t[r]=Number(e%QS),e/=QS;return t}(qS&(l^l>>ZS))}function rE(e,t=64,r){const n=Math.ceil(t/64),i=ig(e);if(!Ym||!r&&Qv())return Yv(i,n);const o=new Uint8Array(8*n);for(let s=0;s<n;s++)o.set(tE(i,s).reverse(),8*s);return o}mx(rE);const nE=new Uint8Array([161,35,3,33,0]),iE=new Uint8Array([48,83,2,1,1,48,5,6,3,43,101,112,4,34,4,32]),oE=iE.length;function sE({publicKey:e,secretKey:t},r){bm(t,"Expected a valid secretKey to be passed to encode");const n=og(iE,t,nE,e);if(!r)return n;const{params:i,password:o,salt:s}=SS(r),{encrypted:a,nonce:c}=function(e,t,r=Jx(24)){return{encrypted:mu.secretbox(e,r,t),nonce:r}}(n,o.subarray(0,32));return og(function(e,{N:t,p:r,r:n}){return og(e,qg(t,Ox),qg(r,Ox),qg(n,Ox))}(s,i),c,a)}function aE(e,{address:t,meta:r},n,i){return Im(function(e,t,r){return{encoded:Uk(e),encoding:{content:t,type:r?ES:AS,version:"3"}}}(n,["pkcs8",e],i),{address:t,meta:r})}const cE=new Uint8Array,uE={ecdsa:Fx,ed25519:Yx,ethereum:Fx,sr25519:sk},lE={ecdsa:new Uint8Array([2]),ed25519:new Uint8Array([0]),ethereum:new Uint8Array([2]),sr25519:new Uint8Array([1])},hE={ecdsa:(e,t)=>Vk(e,t,"blake2"),ed25519:function(e,{publicKey:t,secretKey:r},n){bm(r,"Expected a valid secretKey");const i=ig(e);return!n&&Qv()?Pv(t,r.subarray(0,32),i):mu.sign.detached(i,r)},ethereum:(e,t)=>Vk(e,t,"keccak"),sr25519:function(e,{publicKey:t,secretKey:r}){return bm(32===(null==t?void 0:t.length),"Expected a valid publicKey, 32-bytes"),bm(64===(null==r?void 0:r.length),"Expected a valid secretKey, 64-bytes"),_v(t,r,ig(e))}},dE={ecdsa:e=>e.length>32?bx(e):e,ed25519:e=>e,ethereum:e=>20===e.length?e:Mk(qk(e)),sr25519:e=>e};function fE(e){return!e||sg(e)}function pE(e,t,r){return bx(og(t||"",r||"",e))}function mE({toSS58:e,type:t},{publicKey:r,secretKey:n},i={},o=null,s){const a=(e,i)=>{const a=function(e,t,r){const n=NS(t,e,Array.isArray(r)||ym(r)?r:[r]);bm(ag(n.subarray(0,iE.length),iE),"Invalid Pkcs8 header found in body");let i=n.subarray(oE,oE+64),o=oE+64,s=n.subarray(o,o+nE.length);ag(s,nE)||(o=oE+32,i=n.subarray(oE,o),s=n.subarray(o,o+nE.length),bm(ag(s,nE),"Invalid Pkcs8 divider found in body"));const a=o+nE.length;return{publicKey:n.subarray(a,a+32),secretKey:i}}(e,i||o,s);if(64===a.secretKey.length)r=a.publicKey,n=a.secretKey;else{const e=uE[t](a.secretKey);r=e.publicKey,n=e.secretKey}},c=e=>(fE(n)&&o&&a(e,o),o=sE({publicKey:r,secretKey:n},e),s=void 0,o),u=()=>{const n=dE[t](r);return"ethereum"===t?Kk(n):e(n)};return{get address(){return u()},get addressRaw(){const e=dE[t](r);return"ethereum"===t?e.slice(-20):e},get isLocked(){return fE(n)},get meta(){return i},get publicKey(){return r},get type(){return t},decodePkcs8:a,decryptMessage:(e,r)=>{bm(!fE(n),"Cannot encrypt with a locked key pair"),bm(!["ecdsa","ethereum"].includes(t),"Secp256k1 not supported yet");const i=ig(e);return o=i.slice(24,i.length),s=i.slice(0,24),a=Gx(ig(r)),c=Xx(n),mu.box.open(o,s,a,c)||null;var o,s,a,c},derive:(i,o)=>{bm("ethereum"!==t,"Unable to derive on this keypair"),bm(!fE(n),"Cannot derive on a locked keypair");const{path:s}=Dx(i),a=ok({publicKey:r,secretKey:n},s,t);return mE({toSS58:e,type:t},a,o,null)},encodePkcs8:e=>c(e),encryptMessage:(e,r,i)=>{bm(!fE(n),"Cannot encrypt with a locked key pair"),bm(!["ecdsa","ethereum"].includes(t),"Secp256k1 not supported yet");const{nonce:o,sealed:s}=function(e,t,r,n=Jx(24)){return{nonce:n,sealed:mu.box(e,n,r,t)}}(ig(e),Xx(n),Gx(ig(r)),i);return og(o,s)},lock:()=>{n=new Uint8Array},setMeta:e=>{i=Im({},i,e)},sign:(e,i={})=>(bm(!fE(n),"Cannot sign with a locked key pair"),og(i.withType?lE[t]:cE,hE[t](ig(e),{publicKey:r,secretKey:n}))),toJson:e=>{const n=["ecdsa","ethereum"].includes(t)?20===r.length?hg(r):hg(_k(r)):u();return aE(t,{address:n,meta:i},c(e),!!e)},unlock:e=>a(e),verify:(e,r,n)=>BS(e,r,dE[t](ig(n))).isValid,vrfSign:(e,i,o)=>{if(bm(!fE(n),"Cannot sign with a locked key pair"),"sr25519"===t)return function(e,{secretKey:t},r=ck,n=ck){return bm(64===(null==t?void 0:t.length),"Invalid secretKey, expected 64-bytes"),Dv(t,ig(r),ig(e),ig(n))}(e,{secretKey:n},i,o);const s=hE[t](ig(e),{publicKey:r,secretKey:n});return og(pE(s,i,o),s)},vrfVerify:(e,n,i,o,s)=>{if("sr25519"===t)return function(e,t,r,n=uk,i=uk){const o=ig(r),s=ig(t);return bm(32===o.length,"Invalid publicKey, expected 32-bytes"),bm(96===s.length,"Invalid vrfSign output, expected 96 bytes"),Vv(o,ig(n),ig(e),ig(i),s)}(e,n,r,o,s);return BS(e,og(lE[t],n.subarray(32)),dE[t](ig(i))).isValid&&ag(n.subarray(0,32),pE(n.subarray(32),o,s))}}}class gE{#f={};add(e){return this.#f[Ix(e.address).toString()]=e,e}all(){return Object.values(this.#f)}get(e){const t=this.#f[Ix(e).toString()];return bm(t,(()=>`Unable to retrieve keypair '${tg(e)||Vm(e)?hg(ig(e)):e}'`)),t}remove(e){delete this.#f[Ix(e).toString()]}}const yE={ecdsa:e=>Fx(e),ed25519:e=>Yx(e),ethereum:e=>Fx(e),sr25519:e=>sk(e)};function bE({publicKey:e}){return e}class vE{#p;#l;#m;decodeAddress=Ix;constructor(e={}){e.type=e.type||"ed25519",bm(["ecdsa","ethereum","ed25519","sr25519"].includes(e.type||"undefined"),(()=>`Expected a keyring type of either 'ed25519', 'sr25519', 'ethereum' or 'ecdsa', found '${e.type||"unknown"}`)),this.#p=new gE,this.#m=e.ss58Format,this.#l=e.type}get pairs(){return this.getPairs()}get publicKeys(){return this.getPublicKeys()}get type(){return this.#l}addPair(e){return this.#p.add(e)}addFromAddress(e,t={},r=null,n=this.type,i,o){const s=this.decodeAddress(e,i);return this.addPair(mE({toSS58:this.encodeAddress,type:n},{publicKey:s,secretKey:new Uint8Array},t,r,o))}addFromJson(e,t){return this.addPair(this.createFromJson(e,t))}addFromMnemonic(e,t={},r=this.type){return this.addFromUri(e,t,r)}addFromPair(e,t={},r=this.type){return this.addPair(this.createFromPair(e,t,r))}addFromSeed(e,t={},r=this.type){return this.addPair(mE({toSS58:this.encodeAddress,type:r},yE[r](e),t,null))}addFromUri(e,t={},r=this.type){return this.addPair(this.createFromUri(e,t,r))}createFromJson({address:e,encoded:t,encoding:{content:r,type:n,version:i},meta:o},s){bm("3"!==i||"pkcs8"===r[0],(()=>`Unable to decode non-pkcs8 type, [${r.join(",")}] found}`));const a="0"!==i&&Array.isArray(r)?r[1]:this.type,c=Array.isArray(n)?n:[n];bm(["ed25519","sr25519","ecdsa","ethereum"].includes(a),(()=>`Unknown crypto type ${a}`));const u=Vm(e)?Fm(e):this.decodeAddress(e,s),l=Vm(t)?Fm(t):zk(t);return mE({toSS58:this.encodeAddress,type:a},{publicKey:u,secretKey:new Uint8Array},o,l,c)}createFromPair(e,t={},r=this.type){return mE({toSS58:this.encodeAddress,type:r},e,t,null)}createFromUri(e,t={},r=this.type){const n=e.startsWith("//")?`bottom drive obey lake curtain smoke basket hold race lonely fit walk${e}`:e,{derivePath:i,password:o,path:s,phrase:a}=function(e){const t=e.match(Vx);bm(!gm(t),"Unable to match provided value to a secret URI");const[,r,,n,,,i]=t,{path:o}=Dx(n);return{derivePath:n,password:i,path:o,phrase:r}}(n);let c;const u=Vm(a,256);if(u)c=Fm(a);else{const e=a.split(" ");[12,15,18,21,24].includes(e.length)?c="ethereum"===r?function(e,t="",r,n=32){return bm(pS(e),"Invalid bip39 mnemonic specified"),bm([32,64].includes(n),(()=>`Invalid seed length ${n}, expected 32 or 64`)),32===n?!Ym||!r&&Qv()?Av(e,t):dS(e,t).subarray(0,32):dS(e,t)}(a,"",!1,64):mS(a,o):(bm(a.length<=32,"specified phrase is not a valid mnemonic and is invalid as a raw seed at > 32 bytes"),c=ng(a.padEnd(32)))}const l="ethereum"===r?u?yE[r](c):Qk(c,i.substring(1)):ok(yE[r](c),s,r);return mE({toSS58:this.encodeAddress,type:r},l,t,null)}encodeAddress=(e,t)=>"ethereum"===this.type?Kk(e):lk(e,ym(t)?this.#m:t);getPair(e){return this.#p.get(e)}getPairs(){return this.#p.all()}getPublicKeys(){return this.#p.all().map(bE)}removePair(e){this.#p.remove(e)}setSS58Format(e){this.#m=e}toJson(e,t){return this.#p.get(e).toJson(t)}}Fm("0xd43593c715fdd31c61141abd04a99fd6822c8558854ccde39a5684e7a56da27d"),Fm("0x98319d4ff8a9508c4bb0cf0b5a78d760a0b2082c02775e6e82370816fedfff48925a225d97aa00682d6a59b95b18780c10d7032336e88f3442b42361f4a66011"),Fm("0xbe5ddb1579b72e84524fc29e78609e3caf42e85aa118ebfe0b0ad404b5bdd25f"),Fm("0xe8da6c9d810e020f5e3c7f5af2dea314cbeaa0d72bc6421e92c0808a0c584a6046ab28e97c3ffc77fe12b5a4d37e8cd4afbfebbf2391ffc7cb07c0f38c023efd"),Fm("0x8eaf04151687736326c9fea17e25fc5287613693c912909cb226aa4794f26a48"),Fm("0x081ff694633e255136bdb456c20a5fc8fed21f8b964c11bb17ff534ce80ebd5941ae88f85d0c1bfc37be41c904e1dfc01de8c8067b0d6d5df25dd1ac0894a325"),Fm("0xfe65717dad0447d715f660a0a58411de509b42e6efb8375f562f58a554d5860e"),Fm("0xc006507cdfc267a21532394c49ca9b754ca71de21e15a1cdf807c7ceab6d0b6c3ed408d9d35311540dcd54931933e67cf1ea10d46f75408f82b789d9bd212fde"),Fm("0x90b5ab205c6974c9ea841be688864633dc9ca8a357843eeacf2314649965fe22"),Fm("0xa8f2d83016052e5d6d77b2f6fd5d59418922a09024cda701b3c34369ec43a7668faf12ff39cd4e5d92bb773972f41a7a5279ebc2ed92264bed8f47d344f8f18c"),Fm("0x306721211d5404bd9da88e0204360a1a9ab8b87c66c1bc2fcdd37f3c2222cc20"),Fm("0x20e05482ca4677e0edbc58ae9a3a59f6ed3b1a9484ba17e64d6fe8688b2b7b5d108c4487b9323b98b11fe36cb301b084e920f7b7895536809a6d62a451b25568"),Fm("0xe659a7a1628cdd93febc04a4e0646ea20e9f5f0ce097d9a05290d4a9e054df4e"),Fm("0x683576abfd5dc35273e4264c23095a1bf21c14517bece57c7f0cc5c0ed4ce06a3dbf386b7828f348abe15d76973a72009e6ef86a5c91db2990cb36bb657c6587"),Fm("0x1cbd2d43530a44705ad088af313e18f80b53ef16b36177cd4b77b846f2a5f07c"),Fm("0xb835c20f450079cf4f513900ae9faf8df06ad86c681884122c752a4b2bf74d4303e4f21bc6cc62bb4eeed5a9cce642c25e2d2ac1464093b50f6196d78e3a7426"),Fm("0x02509540919faacf9ab52146c9aa40db68172d83777250b28e4679176e49ccdd9f"),Fm("0x5fb92d6e98884f76de468fa3f6278f8807c48bebc13595d45af5bdc4da702133"),Fm("0x033bc19e36ff1673910575b6727a974a9abd80c9a875d41ab3e2648dbfb9e4b518"),Fm("0x8075991ce870b93a8870eca0c0f91913d12f47948ca0fd25b49c6fa7cdbeee8b"),Fm("0x0234637bdc0e89b5d46543bcbf8edff329d2702bc995e27e9af4b1ba009a3c2a5e"),Fm("0x0b6e18cafb6ed99687ec547bd28139cafdd2bffe70e6b688025de6b445aa5c5b"),Fm("0x02a00d60b2b408c2a14c5d70cdd2c205db8985ef737a7e55ad20ea32cc9e7c417c"),Fm("0x39539ab1876910bbf3a223d84a29e28f1cb4e2e456503e7e91ed39b2e7223d68"),Fm("0x025cdc005b752651cd3f728fb9192182acb3a9c89e19072cbd5b03f3ee1f1b3ffa"),Fm("0x7dce9bc8babb68fec1409be38c8e1a52650206a7ed90ff956ae8a6d15eeaaef4"),Fm("0x037964b6c9d546da4646ada28a99e34acaa1d14e7aba861a9055f9bd200c8abf74"),Fm("0xb9d2ea9a615f3165812e8d44de0d24da9bbd164b65c4f0573e1ce2c8dbd9c8df");const wE=new Uint8Array(32);lk(wE);function xE(e,t){if(!Object.prototype.hasOwnProperty.call(e,t))throw new TypeError("attempted to use private field on non-instance");return e}Em(Uy,null,[_y]);var kE=0;function SE(e){return"__private_"+kE+++"_"+e}new URL("file:///Users/dev-fazio/Nicolas%20Fazio/repos/test/cryptobtnwrapper/node_modules/@polkadot/x-fetch/packageInfo.js").pathname.substring(0,new URL("file:///Users/dev-fazio/Nicolas%20Fazio/repos/test/cryptobtnwrapper/node_modules/@polkadot/x-fetch/packageInfo.js").pathname.lastIndexOf("/")+1),am.fetch;const EE=-99999;function AE(e,t,r){Object.defineProperty(e,t,{configurable:!0,enumerable:!1,value:r})}class NE extends Error{constructor(e="",t=-99999,r){if(super(),AE(this,"message",String(e)),AE(this,"name",this.constructor.name),AE(this,"data",r),AE(this,"code",t),mm(Error.captureStackTrace))Error.captureStackTrace(this,this.constructor);else{const{stack:t}=new Error(e);t&&AE(this,"stack",t)}}static CODES={ASSERT:-90009,INVALID_JSONRPC:-99998,METHOD_NOT_FOUND:-32601,UNKNOWN:EE}}function TE(e){if(e){const{code:t,data:r,message:n}=e;throw new NE(`${t}: ${n}${function(e){if(ym(e))return"";const t=`: ${ay(e)?e.replace(/Error\("/g,"").replace(/\("/g,"(").replace(/"\)/g,")").replace(/\(/g,", ").replace(/\)/g,""):gy(e)}`;return t.length<=256?t:`${t.substring(0,255)}\u2026`}(r)}`,t,r)}}class PE{#g=0;decodeResponse(e){bm(e&&"2.0"===e.jsonrpc,"Invalid jsonrpc field in decoded object");const t=!ym(e.params)&&!ym(e.method);return bm(Ug(e.id)||t&&(Ug(e.params.subscription)||ay(e.params.subscription)),"Invalid id field in decoded object"),TE(e.error),bm(!ym(e.result)||t,"No result found in jsonrpc response"),t?(TE(e.params.error),e.params.result):e.result}encodeJson(e,t){const[r,n]=this.encodeObject(e,t);return[r,gy(n)]}encodeObject(e,t){const r=++this.#g;return[r,{id:r,jsonrpc:"2.0",method:e,params:t}]}}const ME="ws://127.0.0.1:9944";class IE{constructor(e){this.key=e,this.next=this.prev=this}}var CE=SE("data"),RE=SE("refs"),BE=SE("length"),OE=SE("head"),LE=SE("tail"),zE=SE("toHead");class UE{constructor(e=384){Object.defineProperty(this,zE,{value:_E}),this.capacity=void 0,Object.defineProperty(this,CE,{writable:!0,value:new Map}),Object.defineProperty(this,RE,{writable:!0,value:new Map}),Object.defineProperty(this,BE,{writable:!0,value:0}),Object.defineProperty(this,OE,{writable:!0,value:void 0}),Object.defineProperty(this,LE,{writable:!0,value:void 0}),this.capacity=e,xE(this,OE)[OE]=xE(this,LE)[LE]=new IE("<empty>")}get length(){return xE(this,BE)[BE]}get lengthData(){return xE(this,CE)[CE].size}get lengthRefs(){return xE(this,RE)[RE].size}entries(){const e=this.keys(),t=new Array(e.length);for(let r=0;r<e.length;r++){const n=e[r];t[r]=[n,xE(this,CE)[CE].get(n)]}return t}keys(){const e=[];if(xE(this,BE)[BE]){let t=xE(this,OE)[OE];for(;t!==xE(this,LE)[LE];)e.push(t.key),t=t.next;e.push(t.key)}return e}get(e){const t=xE(this,CE)[CE].get(e);return t?(xE(this,zE)[zE](e),t):null}set(e,t){if(xE(this,CE)[CE].has(e))xE(this,zE)[zE](e);else{const t=new IE(e);xE(this,RE)[RE].set(t.key,t),0===this.length?xE(this,OE)[OE]=xE(this,LE)[LE]=t:(xE(this,OE)[OE].prev=t,t.next=xE(this,OE)[OE],xE(this,OE)[OE]=t),xE(this,BE)[BE]===this.capacity?(xE(this,CE)[CE].delete(xE(this,LE)[LE].key),xE(this,RE)[RE].delete(xE(this,LE)[LE].key),xE(this,LE)[LE]=xE(this,LE)[LE].prev,xE(this,LE)[LE].next=xE(this,OE)[OE]):xE(this,BE)[BE]+=1}xE(this,CE)[CE].set(e,t)}}function _E(e){const t=xE(this,RE)[RE].get(e);t&&t!==xE(this,OE)[OE]&&(t.prev.next=t.next,t.next.prev=t.prev,t.next=xE(this,OE)[OE],xE(this,OE)[OE].prev=t,xE(this,OE)[OE]=t)}Ny("api-http");var qE=r(10161);new URL("file:///Users/dev-fazio/Nicolas%20Fazio/repos/test/cryptobtnwrapper/node_modules/@polkadot/x-ws/packageInfo.js").pathname.substring(0,new URL("file:///Users/dev-fazio/Nicolas%20Fazio/repos/test/cryptobtnwrapper/node_modules/@polkadot/x-ws/packageInfo.js").pathname.lastIndexOf("/")+1);const DE=am.WebSocket,VE={1e3:"Normal Closure",1001:"Going Away",1002:"Protocol Error",1003:"Unsupported Data",1004:"(For future)",1005:"No Status Received",1006:"Abnormal Closure",1007:"Invalid frame payload data",1008:"Policy Violation",1009:"Message too big",1010:"Missing Extension",1011:"Internal Error",1012:"Service Restart",1013:"Try Again Later",1014:"Bad Gateway",1015:"TLS Handshake"};const jE={chain_finalisedHead:"chain_finalizedHead",chain_subscribeFinalisedHeads:"chain_subscribeFinalizedHeads",chain_unsubscribeFinalisedHeads:"chain_unsubscribeFinalizedHeads"},FE=Ny("api-ws");function HE(e,t){Object.keys(e).forEach((r=>{t&&t(e[r]),delete e[r]}))}var WE=SE("callCache"),KE=SE("coder"),XE=SE("endpoints"),GE=SE("headers"),ZE=SE("eventemitter"),JE=SE("handlers"),YE=SE("isReadyPromise"),QE=SE("stats"),$E=SE("waitingForId"),eA=SE("autoConnectMs"),tA=SE("endpointIndex"),rA=SE("isConnected"),nA=SE("subscriptions"),iA=SE("timeoutId"),oA=SE("websocket"),sA=SE("timeout"),aA=SE("send"),cA=SE("emit"),uA=SE("onSocketClose"),lA=SE("onSocketError"),hA=SE("onSocketMessage"),dA=SE("onSocketMessageResult"),fA=SE("onSocketMessageSubscribe"),pA=SE("onSocketOpen"),mA=SE("resubscribe"),gA=SE("timeoutHandlers");class yA{constructor(e=ME,t=2500,r={},n){Object.defineProperty(this,aA,{value:bA}),Object.defineProperty(this,WE,{writable:!0,value:new UE}),Object.defineProperty(this,KE,{writable:!0,value:void 0}),Object.defineProperty(this,XE,{writable:!0,value:void 0}),Object.defineProperty(this,GE,{writable:!0,value:void 0}),Object.defineProperty(this,ZE,{writable:!0,value:void 0}),Object.defineProperty(this,JE,{writable:!0,value:{}}),Object.defineProperty(this,YE,{writable:!0,value:void 0}),Object.defineProperty(this,QE,{writable:!0,value:void 0}),Object.defineProperty(this,$E,{writable:!0,value:{}}),Object.defineProperty(this,eA,{writable:!0,value:void 0}),Object.defineProperty(this,tA,{writable:!0,value:void 0}),Object.defineProperty(this,rA,{writable:!0,value:!1}),Object.defineProperty(this,nA,{writable:!0,value:{}}),Object.defineProperty(this,iA,{writable:!0,value:null}),Object.defineProperty(this,oA,{writable:!0,value:void 0}),Object.defineProperty(this,sA,{writable:!0,value:void 0}),Object.defineProperty(this,cA,{writable:!0,value:(e,...t)=>{xE(this,ZE)[ZE].emit(e,...t)}}),Object.defineProperty(this,uA,{writable:!0,value:e=>{const t=new Error(`disconnected from ${xE(this,XE)[XE][xE(this,tA)[tA]]}: ${e.code}:: ${e.reason||function(e){return e>=0&&e<=999?"(Unused)":VE[e]||function(e){return e<=1999?"(For WebSocket standard)":e<=2999?"(For WebSocket extensions)":e<=3999?"(For libraries and frameworks)":e<=4999?"(For applications)":void 0}(e)||"(Unknown)"}(e.code)}`);xE(this,eA)[eA]>0&&FE.error(t.message),xE(this,rA)[rA]=!1,xE(this,oA)[oA]&&(xE(this,oA)[oA].onclose=null,xE(this,oA)[oA].onerror=null,xE(this,oA)[oA].onmessage=null,xE(this,oA)[oA].onopen=null,xE(this,oA)[oA]=null),xE(this,iA)[iA]&&(clearInterval(xE(this,iA)[iA]),xE(this,iA)[iA]=null),xE(this,cA)[cA]("disconnected"),HE(xE(this,JE)[JE],(e=>{try{e.callback(t,void 0)}catch(r){FE.error(r)}})),HE(xE(this,$E)[$E]),xE(this,eA)[eA]>0&&setTimeout((()=>{this.connectWithRetry().catch((()=>{}))}),xE(this,eA)[eA])}}),Object.defineProperty(this,lA,{writable:!0,value:e=>{FE.debug((()=>["socket error",e])),xE(this,cA)[cA]("error",e)}}),Object.defineProperty(this,hA,{writable:!0,value:e=>{FE.debug((()=>["received",e.data])),xE(this,QE)[QE].total.bytesRecv+=e.data.length;const t=JSON.parse(e.data);return ym(t.method)?xE(this,dA)[dA](t):xE(this,fA)[fA](t)}}),Object.defineProperty(this,dA,{writable:!0,value:e=>{const t=xE(this,JE)[JE][e.id];if(t){try{const{method:r,params:n,subscription:i}=t,o=xE(this,KE)[KE].decodeResponse(e);if(t.callback(null,o),i){const e=`${i.type}::${o}`;xE(this,nA)[nA][e]=Im({},i,{method:r,params:n}),xE(this,$E)[$E][e]&&xE(this,fA)[fA](xE(this,$E)[$E][e])}}catch(h2){t.callback(h2,void 0)}delete xE(this,JE)[JE][e.id]}else FE.debug((()=>`Unable to find handler for id=${e.id}`))}}),Object.defineProperty(this,fA,{writable:!0,value:e=>{const t=`${jE[e.method]||e.method||"invalid"}::${e.params.subscription}`,r=xE(this,nA)[nA][t];if(!r)return xE(this,$E)[$E][t]=e,void FE.debug((()=>`Unable to find handler for subscription=${t}`));delete xE(this,$E)[$E][t];try{const t=xE(this,KE)[KE].decodeResponse(e);r.callback(null,t)}catch(h2){r.callback(h2,void 0)}}}),Object.defineProperty(this,pA,{writable:!0,value:()=>(bm(!gm(xE(this,oA)[oA]),"WebSocket cannot be null in onOpen"),FE.debug((()=>["connected to",xE(this,XE)[XE][xE(this,tA)[tA]]])),xE(this,rA)[rA]=!0,xE(this,cA)[cA]("connected"),xE(this,mA)[mA](),!0)}),Object.defineProperty(this,mA,{writable:!0,value:()=>{const e=xE(this,nA)[nA];xE(this,nA)[nA]={},Promise.all(Object.keys(e).map((async t=>{const{callback:r,method:n,params:i,type:o}=e[t];if(!o.startsWith("author_"))try{await this.subscribe(o,n,i,r)}catch(h2){FE.error(h2)}}))).catch(FE.error)}}),Object.defineProperty(this,gA,{writable:!0,value:()=>{const e=Date.now(),t=Object.keys(xE(this,JE)[JE]);for(let r=0;r<t.length;r++){const n=xE(this,JE)[JE][t[r]];if(e-n.start>xE(this,sA)[sA]){try{n.callback(new Error(`No response received from RPC endpoint in ${xE(this,sA)[sA]/1e3}s`),void 0)}catch{}xE(this,QE)[QE].total.timeout++,delete xE(this,JE)[JE][t[r]]}}}});const i=Array.isArray(e)?e:[e];bm(0!==i.length,"WsProvider requires at least one Endpoint"),i.forEach((e=>{bm(/^(wss|ws):\/\//.test(e),(()=>`Endpoint should start with 'ws://', received '${e}'`))})),xE(this,ZE)[ZE]=new qE,xE(this,eA)[eA]=t||0,xE(this,KE)[KE]=new PE,xE(this,tA)[tA]=-1,xE(this,XE)[XE]=i,xE(this,GE)[GE]=r,xE(this,oA)[oA]=null,xE(this,QE)[QE]={active:{requests:0,subscriptions:0},total:{bytesRecv:0,bytesSent:0,cached:0,requests:0,subscriptions:0,timeout:0}},xE(this,sA)[sA]=n||6e4,t>0&&this.connectWithRetry().catch((()=>{})),xE(this,YE)[YE]=new Promise((e=>{xE(this,ZE)[ZE].once("connected",(()=>{e(this)}))}))}get hasSubscriptions(){return!0}get isConnected(){return xE(this,rA)[rA]}get isReady(){return xE(this,YE)[YE]}clone(){return new yA(xE(this,XE)[XE])}async connect(){try{xE(this,tA)[tA]=(xE(this,tA)[tA]+1)%xE(this,XE)[XE].length,xE(this,oA)[oA]=void 0!==am.WebSocket&&(e=am.WebSocket,(t=DE)&&(e===t||e.isPrototypeOf(t)))?new DE(xE(this,XE)[XE][xE(this,tA)[tA]]):new DE(xE(this,XE)[XE][xE(this,tA)[tA]],void 0,void 0,xE(this,GE)[GE],void 0,{fragmentOutgoingMessages:!0,fragmentationThreshold:1048576,maxReceivedFrameSize:25165824,maxReceivedMessageSize:25165824}),xE(this,oA)[oA].onclose=xE(this,uA)[uA],xE(this,oA)[oA].onerror=xE(this,lA)[lA],xE(this,oA)[oA].onmessage=xE(this,hA)[hA],xE(this,oA)[oA].onopen=xE(this,pA)[pA],xE(this,iA)[iA]=setInterval((()=>xE(this,gA)[gA]()),5e3)}catch(h2){throw FE.error(h2),xE(this,cA)[cA]("error",h2),h2}var e,t}async connectWithRetry(){if(xE(this,eA)[eA]>0)try{await this.connect()}catch(h2){setTimeout((()=>{this.connectWithRetry().catch((()=>{}))}),xE(this,eA)[eA])}}async disconnect(){xE(this,eA)[eA]=0;try{xE(this,oA)[oA]&&xE(this,oA)[oA].close(1e3)}catch(h2){throw FE.error(h2),xE(this,cA)[cA]("error",h2),h2}}get stats(){return{active:{requests:Object.keys(xE(this,JE)[JE]).length,subscriptions:Object.keys(xE(this,nA)[nA]).length},total:xE(this,QE)[QE].total}}on(e,t){return xE(this,ZE)[ZE].on(e,t),()=>{xE(this,ZE)[ZE].removeListener(e,t)}}send(e,t,r,n){xE(this,QE)[QE].total.requests++;const[i,o]=xE(this,KE)[KE].encodeJson(e,t);let s=r?xE(this,WE)[WE].get(o):null;return s?xE(this,QE)[QE].total.cached++:(s=xE(this,aA)[aA](i,o,e,t,n),r&&xE(this,WE)[WE].set(o,s)),s}subscribe(e,t,r,n){return xE(this,QE)[QE].total.subscriptions++,this.send(t,r,!1,{callback:n,type:e})}async unsubscribe(e,t,r){const n=`${e}::${r}`;if(ym(xE(this,nA)[nA][n]))return FE.debug((()=>`Unable to find active subscription=${n}`)),!1;delete xE(this,nA)[nA][n];try{return!(this.isConnected&&!gm(xE(this,oA)[oA]))||this.send(t,[r])}catch(h2){return!1}}}async function bA(e,t,r,n,i){return new Promise(((o,s)=>{try{bm(this.isConnected&&!gm(xE(this,oA)[oA]),"WebSocket is not connected");const a=(e,t)=>{e?s(e):o(t)};FE.debug((()=>["calling",r,t])),xE(this,JE)[JE][e]={callback:a,method:r,params:n,start:Date.now(),subscription:i},xE(this,QE)[QE].total.bytesSent+=t.length,xE(this,oA)[oA].send(t)}catch(h2){s(h2)}}))}function vA(e){return"function"==typeof e}function wA(e){var t=e((function(e){Error.call(e),e.stack=(new Error).stack}));return t.prototype=Object.create(Error.prototype),t.prototype.constructor=t,t}var xA=wA((function(e){return function(t){e(this),this.message=t?t.length+" errors occurred during unsubscription:\n"+t.map((function(e,t){return t+1+") "+e.toString()})).join("\n "):"",this.name="UnsubscriptionError",this.errors=t}}));function kA(e,t){if(e){var r=e.indexOf(t);0<=r&&e.splice(r,1)}}var SA=function(){function e(e){this.initialTeardown=e,this.closed=!1,this._parentage=null,this._finalizers=null}return e.prototype.unsubscribe=function(){var e,t,r,n,i;if(!this.closed){this.closed=!0;var o=this._parentage;if(o)if(this._parentage=null,Array.isArray(o))try{for(var s=U(o),a=s.next();!a.done;a=s.next()){a.value.remove(this)}}catch(f){e={error:f}}finally{try{a&&!a.done&&(t=s.return)&&t.call(s)}finally{if(e)throw e.error}}else o.remove(this);var c=this.initialTeardown;if(vA(c))try{c()}catch(p){i=p instanceof xA?p.errors:[p]}var u=this._finalizers;if(u){this._finalizers=null;try{for(var l=U(u),h=l.next();!h.done;h=l.next()){var d=h.value;try{NA(d)}catch(m){i=null!=i?i:[],m instanceof xA?i=q(q([],_(i)),_(m.errors)):i.push(m)}}}catch(g){r={error:g}}finally{try{h&&!h.done&&(n=l.return)&&n.call(l)}finally{if(r)throw r.error}}}if(i)throw new xA(i)}},e.prototype.add=function(t){var r;if(t&&t!==this)if(this.closed)NA(t);else{if(t instanceof e){if(t.closed||t._hasParent(this))return;t._addParent(this)}(this._finalizers=null!==(r=this._finalizers)&&void 0!==r?r:[]).push(t)}},e.prototype._hasParent=function(e){var t=this._parentage;return t===e||Array.isArray(t)&&t.includes(e)},e.prototype._addParent=function(e){var t=this._parentage;this._parentage=Array.isArray(t)?(t.push(e),t):t?[t,e]:e},e.prototype._removeParent=function(e){var t=this._parentage;t===e?this._parentage=null:Array.isArray(t)&&kA(t,e)},e.prototype.remove=function(t){var r=this._finalizers;r&&kA(r,t),t instanceof e&&t._removeParent(this)},e.EMPTY=function(){var t=new e;return t.closed=!0,t}(),e}(),EA=SA.EMPTY;function AA(e){return e instanceof SA||e&&"closed"in e&&vA(e.remove)&&vA(e.add)&&vA(e.unsubscribe)}function NA(e){vA(e)?e():e.unsubscribe()}var TA={onUnhandledError:null,onStoppedNotification:null,Promise:void 0,useDeprecatedSynchronousErrorHandling:!1,useDeprecatedNextContext:!1},PA={setTimeout:function(e,t){for(var r=[],n=2;n<arguments.length;n++)r[n-2]=arguments[n];var i=PA.delegate;return(null==i?void 0:i.setTimeout)?i.setTimeout.apply(i,q([e,t],_(r))):setTimeout.apply(void 0,q([e,t],_(r)))},clearTimeout:function(e){var t=PA.delegate;return((null==t?void 0:t.clearTimeout)||clearTimeout)(e)},delegate:void 0};function MA(e){PA.setTimeout((function(){var t=TA.onUnhandledError;if(!t)throw e;t(e)}))}function IA(){}var CA=RA("C",void 0,void 0);function RA(e,t,r){return{kind:e,value:t,error:r}}var BA=null;function OA(e){if(TA.useDeprecatedSynchronousErrorHandling){var t=!BA;if(t&&(BA={errorThrown:!1,error:null}),e(),t){var r=BA,n=r.errorThrown,i=r.error;if(BA=null,n)throw i}}else e()}var LA=function(e){function t(t){var r=e.call(this)||this;return r.isStopped=!1,t?(r.destination=t,AA(t)&&t.add(r)):r.destination=jA,r}return O(t,e),t.create=function(e,t,r){return new qA(e,t,r)},t.prototype.next=function(e){this.isStopped?VA(function(e){return RA("N",e,void 0)}(e),this):this._next(e)},t.prototype.error=function(e){this.isStopped?VA(RA("E",void 0,e),this):(this.isStopped=!0,this._error(e))},t.prototype.complete=function(){this.isStopped?VA(CA,this):(this.isStopped=!0,this._complete())},t.prototype.unsubscribe=function(){this.closed||(this.isStopped=!0,e.prototype.unsubscribe.call(this),this.destination=null)},t.prototype._next=function(e){this.destination.next(e)},t.prototype._error=function(e){try{this.destination.error(e)}finally{this.unsubscribe()}},t.prototype._complete=function(){try{this.destination.complete()}finally{this.unsubscribe()}},t}(SA),zA=Function.prototype.bind;function UA(e,t){return zA.call(e,t)}var _A=function(){function e(e){this.partialObserver=e}return e.prototype.next=function(e){var t=this.partialObserver;if(t.next)try{t.next(e)}catch(h2){DA(h2)}},e.prototype.error=function(e){var t=this.partialObserver;if(t.error)try{t.error(e)}catch(h2){DA(h2)}else DA(e)},e.prototype.complete=function(){var e=this.partialObserver;if(e.complete)try{e.complete()}catch(h2){DA(h2)}},e}(),qA=function(e){function t(t,r,n){var i,o,s=e.call(this)||this;vA(t)||!t?i={next:null!=t?t:void 0,error:null!=r?r:void 0,complete:null!=n?n:void 0}:s&&TA.useDeprecatedNextContext?((o=Object.create(t)).unsubscribe=function(){return s.unsubscribe()},i={next:t.next&&UA(t.next,o),error:t.error&&UA(t.error,o),complete:t.complete&&UA(t.complete,o)}):i=t;return s.destination=new _A(i),s}return O(t,e),t}(LA);function DA(e){var t;TA.useDeprecatedSynchronousErrorHandling?(t=e,TA.useDeprecatedSynchronousErrorHandling&&BA&&(BA.errorThrown=!0,BA.error=t)):MA(e)}function VA(e,t){var r=TA.onStoppedNotification;r&&PA.setTimeout((function(){return r(e,t)}))}var jA={closed:!0,next:IA,error:function(e){throw e},complete:IA},FA="function"==typeof Symbol&&Symbol.observable||"@@observable";function HA(e){return e}function WA(e){return 0===e.length?HA:1===e.length?e[0]:function(t){return e.reduce((function(e,t){return t(e)}),t)}}var KA=function(){function e(e){e&&(this._subscribe=e)}return e.prototype.lift=function(t){var r=new e;return r.source=this,r.operator=t,r},e.prototype.subscribe=function(e,t,r){var n,i=this,o=(n=e)&&n instanceof LA||function(e){return e&&vA(e.next)&&vA(e.error)&&vA(e.complete)}(n)&&AA(n)?e:new qA(e,t,r);return OA((function(){var e=i,t=e.operator,r=e.source;o.add(t?t.call(o,r):r?i._subscribe(o):i._trySubscribe(o))})),o},e.prototype._trySubscribe=function(e){try{return this._subscribe(e)}catch(t){e.error(t)}},e.prototype.forEach=function(e,t){var r=this;return new(t=XA(t))((function(t,n){var i=new qA({next:function(t){try{e(t)}catch(r){n(r),i.unsubscribe()}},error:n,complete:t});r.subscribe(i)}))},e.prototype._subscribe=function(e){var t;return null===(t=this.source)||void 0===t?void 0:t.subscribe(e)},e.prototype[FA]=function(){return this},e.prototype.pipe=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return WA(e)(this)},e.prototype.toPromise=function(e){var t=this;return new(e=XA(e))((function(e,r){var n;t.subscribe((function(e){return n=e}),(function(e){return r(e)}),(function(){return e(n)}))}))},e.create=function(t){return new e(t)},e}();function XA(e){var t;return null!==(t=null!=e?e:TA.Promise)&&void 0!==t?t:Promise}function GA(e){return vA(null==e?void 0:e.lift)}function ZA(e){return function(t){if(GA(t))return t.lift((function(t){try{return e(t,this)}catch(r){this.error(r)}}));throw new TypeError("Unable to lift unknown Observable type")}}function JA(e,t,r,n,i){return new YA(e,t,r,n,i)}var YA=function(e){function t(t,r,n,i,o,s){var a=e.call(this,t)||this;return a.onFinalize=o,a.shouldUnsubscribe=s,a._next=r?function(e){try{r(e)}catch(n){t.error(n)}}:e.prototype._next,a._error=i?function(e){try{i(e)}catch(e){t.error(e)}finally{this.unsubscribe()}}:e.prototype._error,a._complete=n?function(){try{n()}catch(e){t.error(e)}finally{this.unsubscribe()}}:e.prototype._complete,a}return O(t,e),t.prototype.unsubscribe=function(){var t;if(!this.shouldUnsubscribe||this.shouldUnsubscribe()){var r=this.closed;e.prototype.unsubscribe.call(this),!r&&(null===(t=this.onFinalize)||void 0===t||t.call(this))}},t}(LA);!function(e){function t(t,r){var n=e.call(this)||this;return n.source=t,n.subjectFactory=r,n._subject=null,n._refCount=0,n._connection=null,GA(t)&&(n.lift=t.lift),n}O(t,e),t.prototype._subscribe=function(e){return this.getSubject().subscribe(e)},t.prototype.getSubject=function(){var e=this._subject;return e&&!e.isStopped||(this._subject=this.subjectFactory()),this._subject},t.prototype._teardown=function(){this._refCount=0;var e=this._connection;this._subject=this._connection=null,null==e||e.unsubscribe()},t.prototype.connect=function(){var e=this,t=this._connection;if(!t){t=this._connection=new SA;var r=this.getSubject();t.add(this.source.subscribe(JA(r,void 0,(function(){e._teardown(),r.complete()}),(function(t){e._teardown(),r.error(t)}),(function(){return e._teardown()})))),t.closed&&(this._connection=null,t=SA.EMPTY)}return t},t.prototype.refCount=function(){return ZA((function(e,t){var r=null;e._refCount++;var n=JA(t,void 0,void 0,void 0,(function(){if(!e||e._refCount<=0||0<--e._refCount)r=null;else{var n=e._connection,i=r;r=null,!n||i&&n!==i||n.unsubscribe(),t.unsubscribe()}}));e.subscribe(n),n.closed||(r=e.connect())}))(this)}}(KA);var QA={now:function(){return(QA.delegate||performance).now()},delegate:void 0},$A={schedule:function(e){var t=requestAnimationFrame,r=cancelAnimationFrame,n=$A.delegate;n&&(t=n.requestAnimationFrame,r=n.cancelAnimationFrame);var i=t((function(t){r=void 0,e(t)}));return new SA((function(){return null==r?void 0:r(i)}))},requestAnimationFrame:function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var r=$A.delegate;return((null==r?void 0:r.requestAnimationFrame)||requestAnimationFrame).apply(void 0,q([],_(e)))},cancelAnimationFrame:function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var r=$A.delegate;return((null==r?void 0:r.cancelAnimationFrame)||cancelAnimationFrame).apply(void 0,q([],_(e)))},delegate:void 0};function eN(e){var t=$A.schedule;return new KA((function(r){var n=new SA,i=e||QA,o=i.now(),s=function(a){var c=i.now();r.next({timestamp:e?c:a,elapsed:c-o}),r.closed||n.add(t(s))};return n.add(t(s)),n}))}eN();var tN,rN=wA((function(e){return function(){e(this),this.name="ObjectUnsubscribedError",this.message="object unsubscribed"}})),nN=function(e){function t(){var t=e.call(this)||this;return t.closed=!1,t.currentObservers=null,t.observers=[],t.isStopped=!1,t.hasError=!1,t.thrownError=null,t}return O(t,e),t.prototype.lift=function(e){var t=new iN(this,this);return t.operator=e,t},t.prototype._throwIfClosed=function(){if(this.closed)throw new rN},t.prototype.next=function(e){var t=this;OA((function(){var r,n;if(t._throwIfClosed(),!t.isStopped){t.currentObservers||(t.currentObservers=Array.from(t.observers));try{for(var i=U(t.currentObservers),o=i.next();!o.done;o=i.next()){o.value.next(e)}}catch(s){r={error:s}}finally{try{o&&!o.done&&(n=i.return)&&n.call(i)}finally{if(r)throw r.error}}}}))},t.prototype.error=function(e){var t=this;OA((function(){if(t._throwIfClosed(),!t.isStopped){t.hasError=t.isStopped=!0,t.thrownError=e;for(var r=t.observers;r.length;)r.shift().error(e)}}))},t.prototype.complete=function(){var e=this;OA((function(){if(e._throwIfClosed(),!e.isStopped){e.isStopped=!0;for(var t=e.observers;t.length;)t.shift().complete()}}))},t.prototype.unsubscribe=function(){this.isStopped=this.closed=!0,this.observers=this.currentObservers=null},Object.defineProperty(t.prototype,"observed",{get:function(){var e;return(null===(e=this.observers)||void 0===e?void 0:e.length)>0},enumerable:!1,configurable:!0}),t.prototype._trySubscribe=function(t){return this._throwIfClosed(),e.prototype._trySubscribe.call(this,t)},t.prototype._subscribe=function(e){return this._throwIfClosed(),this._checkFinalizedStatuses(e),this._innerSubscribe(e)},t.prototype._innerSubscribe=function(e){var t=this,r=this,n=r.hasError,i=r.isStopped,o=r.observers;return n||i?EA:(this.currentObservers=null,o.push(e),new SA((function(){t.currentObservers=null,kA(o,e)})))},t.prototype._checkFinalizedStatuses=function(e){var t=this,r=t.hasError,n=t.thrownError,i=t.isStopped;r?e.error(n):i&&e.complete()},t.prototype.asObservable=function(){var e=new KA;return e.source=this,e},t.create=function(e,t){return new iN(e,t)},t}(KA),iN=function(e){function t(t,r){var n=e.call(this)||this;return n.destination=t,n.source=r,n}return O(t,e),t.prototype.next=function(e){var t,r;null===(r=null===(t=this.destination)||void 0===t?void 0:t.next)||void 0===r||r.call(t,e)},t.prototype.error=function(e){var t,r;null===(r=null===(t=this.destination)||void 0===t?void 0:t.error)||void 0===r||r.call(t,e)},t.prototype.complete=function(){var e,t;null===(t=null===(e=this.destination)||void 0===e?void 0:e.complete)||void 0===t||t.call(e)},t.prototype._subscribe=function(e){var t,r;return null!==(r=null===(t=this.source)||void 0===t?void 0:t.subscribe(e))&&void 0!==r?r:EA},t}(nN),oN=function(e){function t(t){var r=e.call(this)||this;return r._value=t,r}return O(t,e),Object.defineProperty(t.prototype,"value",{get:function(){return this.getValue()},enumerable:!1,configurable:!0}),t.prototype._subscribe=function(t){var r=e.prototype._subscribe.call(this,t);return!r.closed&&t.next(this._value),r},t.prototype.getValue=function(){var e=this,t=e.hasError,r=e.thrownError,n=e._value;if(t)throw r;return this._throwIfClosed(),n},t.prototype.next=function(t){e.prototype.next.call(this,this._value=t)},t}(nN),sN={now:function(){return(sN.delegate||Date).now()},delegate:void 0},aN=(function(e){function t(t,r,n){void 0===t&&(t=1/0),void 0===r&&(r=1/0),void 0===n&&(n=sN);var i=e.call(this)||this;return i._bufferSize=t,i._windowTime=r,i._timestampProvider=n,i._buffer=[],i._infiniteTimeWindow=!0,i._infiniteTimeWindow=r===1/0,i._bufferSize=Math.max(1,t),i._windowTime=Math.max(1,r),i}O(t,e),t.prototype.next=function(t){var r=this,n=r.isStopped,i=r._buffer,o=r._infiniteTimeWindow,s=r._timestampProvider,a=r._windowTime;n||(i.push(t),!o&&i.push(s.now()+a)),this._trimBuffer(),e.prototype.next.call(this,t)},t.prototype._subscribe=function(e){this._throwIfClosed(),this._trimBuffer();for(var t=this._innerSubscribe(e),r=this._infiniteTimeWindow,n=this._buffer.slice(),i=0;i<n.length&&!e.closed;i+=r?1:2)e.next(n[i]);return this._checkFinalizedStatuses(e),t},t.prototype._trimBuffer=function(){var e=this,t=e._bufferSize,r=e._timestampProvider,n=e._buffer,i=e._infiniteTimeWindow,o=(i?1:2)*t;if(t<1/0&&o<n.length&&n.splice(0,n.length-o),!i){for(var s=r.now(),a=0,c=1;c<n.length&&n[c]<=s;c+=2)a=c;a&&n.splice(0,a+1)}}}(nN),function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t._value=null,t._hasValue=!1,t._isComplete=!1,t}O(t,e),t.prototype._checkFinalizedStatuses=function(e){var t=this,r=t.hasError,n=t._hasValue,i=t._value,o=t.thrownError,s=t.isStopped,a=t._isComplete;r?e.error(o):(s||a)&&(n&&e.next(i),e.complete())},t.prototype.next=function(e){this.isStopped||(this._value=e,this._hasValue=!0)},t.prototype.complete=function(){var t=this,r=t._hasValue,n=t._value;t._isComplete||(this._isComplete=!0,r&&e.prototype.next.call(this,n),e.prototype.complete.call(this))}}(nN),function(e){function t(t,r){return e.call(this)||this}return O(t,e),t.prototype.schedule=function(e,t){return void 0===t&&(t=0),this},t}(SA)),cN={setInterval:function(e,t){for(var r=[],n=2;n<arguments.length;n++)r[n-2]=arguments[n];var i=cN.delegate;return(null==i?void 0:i.setInterval)?i.setInterval.apply(i,q([e,t],_(r))):setInterval.apply(void 0,q([e,t],_(r)))},clearInterval:function(e){var t=cN.delegate;return((null==t?void 0:t.clearInterval)||clearInterval)(e)},delegate:void 0},uN=function(e){function t(t,r){var n=e.call(this,t,r)||this;return n.scheduler=t,n.work=r,n.pending=!1,n}return O(t,e),t.prototype.schedule=function(e,t){if(void 0===t&&(t=0),this.closed)return this;this.state=e;var r=this.id,n=this.scheduler;return null!=r&&(this.id=this.recycleAsyncId(n,r,t)),this.pending=!0,this.delay=t,this.id=this.id||this.requestAsyncId(n,this.id,t),this},t.prototype.requestAsyncId=function(e,t,r){return void 0===r&&(r=0),cN.setInterval(e.flush.bind(e,this),r)},t.prototype.recycleAsyncId=function(e,t,r){if(void 0===r&&(r=0),null!=r&&this.delay===r&&!1===this.pending)return t;cN.clearInterval(t)},t.prototype.execute=function(e,t){if(this.closed)return new Error("executing a cancelled action");this.pending=!1;var r=this._execute(e,t);if(r)return r;!1===this.pending&&null!=this.id&&(this.id=this.recycleAsyncId(this.scheduler,this.id,null))},t.prototype._execute=function(e,t){var r,n=!1;try{this.work(e)}catch(i){n=!0,r=i||new Error("Scheduled action threw falsy error")}if(n)return this.unsubscribe(),r},t.prototype.unsubscribe=function(){if(!this.closed){var t=this.id,r=this.scheduler,n=r.actions;this.work=this.state=this.scheduler=null,this.pending=!1,kA(n,this),null!=t&&(this.id=this.recycleAsyncId(r,t,null)),this.delay=null,e.prototype.unsubscribe.call(this)}},t}(aN),lN=1,hN={};function dN(e){return e in hN&&(delete hN[e],!0)}var fN=function(e){var t=lN++;return hN[t]=!0,tN||(tN=Promise.resolve()),tN.then((function(){return dN(t)&&e()})),t},pN=function(e){dN(e)},mN={setImmediate:function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var r=mN.delegate;return((null==r?void 0:r.setImmediate)||fN).apply(void 0,q([],_(e)))},clearImmediate:function(e){var t=mN.delegate;return((null==t?void 0:t.clearImmediate)||pN)(e)},delegate:void 0},gN=function(e){function t(t,r){var n=e.call(this,t,r)||this;return n.scheduler=t,n.work=r,n}return O(t,e),t.prototype.requestAsyncId=function(t,r,n){return void 0===n&&(n=0),null!==n&&n>0?e.prototype.requestAsyncId.call(this,t,r,n):(t.actions.push(this),t._scheduled||(t._scheduled=mN.setImmediate(t.flush.bind(t,void 0))))},t.prototype.recycleAsyncId=function(t,r,n){if(void 0===n&&(n=0),null!=n&&n>0||null==n&&this.delay>0)return e.prototype.recycleAsyncId.call(this,t,r,n);t.actions.some((function(e){return e.id===r}))||(mN.clearImmediate(r),t._scheduled=void 0)},t}(uN),yN=function(){function e(t,r){void 0===r&&(r=e.now),this.schedulerActionCtor=t,this.now=r}return e.prototype.schedule=function(e,t,r){return void 0===t&&(t=0),new this.schedulerActionCtor(this,e).schedule(r,t)},e.now=sN.now,e}(),bN=function(e){function t(t,r){void 0===r&&(r=yN.now);var n=e.call(this,t,r)||this;return n.actions=[],n._active=!1,n._scheduled=void 0,n}return O(t,e),t.prototype.flush=function(e){var t=this.actions;if(this._active)t.push(e);else{var r;this._active=!0;do{if(r=e.execute(e.state,e.delay))break}while(e=t.shift());if(this._active=!1,r){for(;e=t.shift();)e.unsubscribe();throw r}}},t}(yN),vN=(new(function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return O(t,e),t.prototype.flush=function(e){this._active=!0;var t=this._scheduled;this._scheduled=void 0;var r,n=this.actions;e=e||n.shift();do{if(r=e.execute(e.state,e.delay))break}while((e=n[0])&&e.id===t&&n.shift());if(this._active=!1,r){for(;(e=n[0])&&e.id===t&&n.shift();)e.unsubscribe();throw r}},t}(bN))(gN),new bN(uN),function(e){function t(t,r){var n=e.call(this,t,r)||this;return n.scheduler=t,n.work=r,n}return O(t,e),t.prototype.schedule=function(t,r){return void 0===r&&(r=0),r>0?e.prototype.schedule.call(this,t,r):(this.delay=r,this.state=t,this.scheduler.flush(this),this)},t.prototype.execute=function(t,r){return r>0||this.closed?e.prototype.execute.call(this,t,r):this._execute(t,r)},t.prototype.requestAsyncId=function(t,r,n){return void 0===n&&(n=0),null!=n&&n>0||null==n&&this.delay>0?e.prototype.requestAsyncId.call(this,t,r,n):t.flush(this)},t}(uN)),wN=(new(function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return O(t,e),t}(bN))(vN),function(e){function t(t,r){var n=e.call(this,t,r)||this;return n.scheduler=t,n.work=r,n}return O(t,e),t.prototype.requestAsyncId=function(t,r,n){return void 0===n&&(n=0),null!==n&&n>0?e.prototype.requestAsyncId.call(this,t,r,n):(t.actions.push(this),t._scheduled||(t._scheduled=$A.requestAnimationFrame((function(){return t.flush(void 0)}))))},t.prototype.recycleAsyncId=function(t,r,n){if(void 0===n&&(n=0),null!=n&&n>0||null==n&&this.delay>0)return e.prototype.recycleAsyncId.call(this,t,r,n);t.actions.some((function(e){return e.id===r}))||($A.cancelAnimationFrame(r),t._scheduled=void 0)},t}(uN)),xN=(new(function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return O(t,e),t.prototype.flush=function(e){this._active=!0;var t=this._scheduled;this._scheduled=void 0;var r,n=this.actions;e=e||n.shift();do{if(r=e.execute(e.state,e.delay))break}while((e=n[0])&&e.id===t&&n.shift());if(this._active=!1,r){for(;(e=n[0])&&e.id===t&&n.shift();)e.unsubscribe();throw r}},t}(bN))(wN),function(e){function t(t,r){void 0===t&&(t=xN),void 0===r&&(r=1/0);var n=e.call(this,t,(function(){return n.frame}))||this;return n.maxFrames=r,n.frame=0,n.index=-1,n}O(t,e),t.prototype.flush=function(){for(var e,t,r=this.actions,n=this.maxFrames;(t=r[0])&&t.delay<=n&&(r.shift(),this.frame=t.delay,!(e=t.execute(t.state,t.delay))););if(e){for(;t=r.shift();)t.unsubscribe();throw e}},t.frameTimeFactor=10}(bN),function(e){function t(t,r,n){void 0===n&&(n=t.index+=1);var i=e.call(this,t,r)||this;return i.scheduler=t,i.work=r,i.index=n,i.active=!0,i.index=t.index=n,i}return O(t,e),t.prototype.schedule=function(r,n){if(void 0===n&&(n=0),Number.isFinite(n)){if(!this.id)return e.prototype.schedule.call(this,r,n);this.active=!1;var i=new t(this.scheduler,this.work);return this.add(i),i.schedule(r,n)}return SA.EMPTY},t.prototype.requestAsyncId=function(e,r,n){void 0===n&&(n=0),this.delay=e.frame+n;var i=e.actions;return i.push(this),i.sort(t.sortActions),!0},t.prototype.recycleAsyncId=function(e,t,r){void 0===r&&(r=0)},t.prototype._execute=function(t,r){if(!0===this.active)return e.prototype._execute.call(this,t,r)},t.sortActions=function(e,t){return e.delay===t.delay?e.index===t.index?0:e.index>t.index?1:-1:e.delay>t.delay?1:-1},t}(uN)),kN=new KA((function(e){return e.complete()}));function SN(e){return e[e.length-1]}function EN(e){return vA(SN(e))?e.pop():void 0}function AN(e){return(t=SN(e))&&vA(t.schedule)?e.pop():void 0;var t}var NN=function(e){return e&&"number"==typeof e.length&&"function"!=typeof e};function TN(e){return vA(null==e?void 0:e.then)}function PN(e){return vA(e[FA])}function MN(e){return Symbol.asyncIterator&&vA(null==e?void 0:e[Symbol.asyncIterator])}function IN(e){return new TypeError("You provided "+(null!==e&&"object"==typeof e?"an invalid object":"'"+e+"'")+" where a stream was expected. You can provide an Observable, Promise, ReadableStream, Array, AsyncIterable, or Iterable.")}var CN,RN="function"==typeof Symbol&&Symbol.iterator?Symbol.iterator:"@@iterator";function BN(e){return vA(null==e?void 0:e[RN])}function ON(e){return V(this,arguments,(function(){var t,r,n;return z(this,(function(i){switch(i.label){case 0:t=e.getReader(),i.label=1;case 1:i.trys.push([1,,9,10]),i.label=2;case 2:return[4,D(t.read())];case 3:return r=i.sent(),n=r.value,r.done?[4,D(void 0)]:[3,5];case 4:return[2,i.sent()];case 5:return[4,D(n)];case 6:return[4,i.sent()];case 7:return i.sent(),[3,2];case 8:return[3,10];case 9:return t.releaseLock(),[7];case 10:return[2]}}))}))}function LN(e){return vA(null==e?void 0:e.getReader)}function zN(e){if(e instanceof KA)return e;if(null!=e){if(PN(e))return n=e,new KA((function(e){var t=n[FA]();if(vA(t.subscribe))return t.subscribe(e);throw new TypeError("Provided object does not correctly implement Symbol.observable")}));if(NN(e))return function(e){return new KA((function(t){for(var r=0;r<e.length&&!t.closed;r++)t.next(e[r]);t.complete()}))}(e);if(TN(e))return r=e,new KA((function(e){r.then((function(t){e.closed||(e.next(t),e.complete())}),(function(t){return e.error(t)})).then(null,MA)}));if(MN(e))return UN(e);if(BN(e))return t=e,new KA((function(e){var r,n;try{for(var i=U(t),o=i.next();!o.done;o=i.next()){var s=o.value;if(e.next(s),e.closed)return}}catch(a){r={error:a}}finally{try{o&&!o.done&&(n=i.return)&&n.call(i)}finally{if(r)throw r.error}}e.complete()}));if(LN(e))return UN(ON(e))}var t,r,n;throw IN(e)}function UN(e){return new KA((function(t){(function(e,t){var r,n,i,o;return L(this,void 0,void 0,(function(){var s,a;return z(this,(function(c){switch(c.label){case 0:c.trys.push([0,5,6,11]),r=j(e),c.label=1;case 1:return[4,r.next()];case 2:if((n=c.sent()).done)return[3,4];if(s=n.value,t.next(s),t.closed)return[2];c.label=3;case 3:return[3,1];case 4:return[3,11];case 5:return a=c.sent(),i={error:a},[3,11];case 6:return c.trys.push([6,,9,10]),n&&!n.done&&(o=r.return)?[4,o.call(r)]:[3,8];case 7:c.sent(),c.label=8;case 8:return[3,10];case 9:if(i)throw i.error;return[7];case 10:return[7];case 11:return t.complete(),[2]}}))}))})(e,t).catch((function(e){return t.error(e)}))}))}function _N(e,t,r,n,i){void 0===n&&(n=0),void 0===i&&(i=!1);var o=t.schedule((function(){r(),i?e.add(this.schedule(null,n)):this.unsubscribe()}),n);if(e.add(o),!i)return o}function qN(e,t){return void 0===t&&(t=0),ZA((function(r,n){r.subscribe(JA(n,(function(r){return _N(n,e,(function(){return n.next(r)}),t)}),(function(){return _N(n,e,(function(){return n.complete()}),t)}),(function(r){return _N(n,e,(function(){return n.error(r)}),t)})))}))}function DN(e,t){return void 0===t&&(t=0),ZA((function(r,n){n.add(e.schedule((function(){return r.subscribe(n)}),t))}))}function VN(e,t){if(!e)throw new Error("Iterable cannot be null");return new KA((function(r){_N(r,t,(function(){var n=e[Symbol.asyncIterator]();_N(r,t,(function(){n.next().then((function(e){e.done?r.complete():r.next(e.value)}))}),0,!0)}))}))}function jN(e,t){if(null!=e){if(PN(e))return function(e,t){return zN(e).pipe(DN(t),qN(t))}(e,t);if(NN(e))return function(e,t){return new KA((function(r){var n=0;return t.schedule((function(){n===e.length?r.complete():(r.next(e[n++]),r.closed||this.schedule())}))}))}(e,t);if(TN(e))return function(e,t){return zN(e).pipe(DN(t),qN(t))}(e,t);if(MN(e))return VN(e,t);if(BN(e))return function(e,t){return new KA((function(r){var n;return _N(r,t,(function(){n=e[RN](),_N(r,t,(function(){var e,t,i;try{t=(e=n.next()).value,i=e.done}catch(o){return void r.error(o)}i?r.complete():r.next(t)}),0,!0)})),function(){return vA(null==n?void 0:n.return)&&n.return()}}))}(e,t);if(LN(e))return function(e,t){return VN(ON(e),t)}(e,t)}throw IN(e)}function FN(e,t){return t?jN(e,t):zN(e)}function HN(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var r=AN(e);return FN(e,r)}!function(e){e.NEXT="N",e.ERROR="E",e.COMPLETE="C"}(CN||(CN={}));!function(){function e(e,t,r){this.kind=e,this.value=t,this.error=r,this.hasValue="N"===e}e.prototype.observe=function(e){return function(e,t){var r,n,i,o=e,s=o.kind,a=o.value,c=o.error;if("string"!=typeof s)throw new TypeError('Invalid notification, missing "kind"');"N"===s?null===(r=t.next)||void 0===r||r.call(t,a):"E"===s?null===(n=t.error)||void 0===n||n.call(t,c):null===(i=t.complete)||void 0===i||i.call(t)}(this,e)},e.prototype.do=function(e,t,r){var n=this,i=n.kind,o=n.value,s=n.error;return"N"===i?null==e?void 0:e(o):"E"===i?null==t?void 0:t(s):null==r?void 0:r()},e.prototype.accept=function(e,t,r){var n;return vA(null===(n=e)||void 0===n?void 0:n.next)?this.observe(e):this.do(e,t,r)},e.prototype.toObservable=function(){var e=this,t=e.kind,r=e.value,n=e.error,i="N"===t?HN(r):"E"===t?function(e,t){var r=vA(e)?e:function(){return e},n=function(e){return e.error(r())};return new KA(t?function(e){return t.schedule(n,0,e)}:n)}((function(){return n})):"C"===t?kN:0;if(!i)throw new TypeError("Unexpected notification kind "+t);return i},e.createNext=function(t){return new e("N",t)},e.createError=function(t){return new e("E",void 0,t)},e.createComplete=function(){return e.completeNotification},e.completeNotification=new e("C")}();var WN=wA((function(e){return function(){e(this),this.name="EmptyError",this.message="no elements in sequence"}}));function KN(e,t){var r="object"==typeof t;return new Promise((function(n,i){var o=new qA({next:function(e){n(e),o.unsubscribe()},error:i,complete:function(){r?n(t.defaultValue):i(new WN)}});e.subscribe(o)}))}wA((function(e){return function(){e(this),this.name="ArgumentOutOfRangeError",this.message="argument out of range"}})),wA((function(e){return function(t){e(this),this.name="NotFoundError",this.message=t}})),wA((function(e){return function(t){e(this),this.name="SequenceError",this.message=t}}));wA((function(e){return function(t){void 0===t&&(t=null),e(this),this.message="Timeout has occurred",this.name="TimeoutError",this.info=t}}));function XN(e,t){return ZA((function(r,n){var i=0;r.subscribe(JA(n,(function(r){n.next(e.call(t,r,i++))})))}))}var GN=Array.isArray;function ZN(e){return XN((function(t){return function(e,t){return GN(t)?e.apply(void 0,q([],_(t))):e(t)}(e,t)}))}var JN=Array.isArray,YN=Object.getPrototypeOf,QN=Object.prototype,$N=Object.keys;function eT(e){if(1===e.length){var t=e[0];if(JN(t))return{args:t,keys:null};if((n=t)&&"object"==typeof n&&YN(n)===QN){var r=$N(t);return{args:r.map((function(e){return t[e]})),keys:r}}}var n;return{args:e,keys:null}}function tT(e,t){return e.reduce((function(e,r,n){return e[r]=t[n],e}),{})}function rT(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var r=AN(e),n=EN(e),i=eT(e),o=i.args,s=i.keys;if(0===o.length)return FN([],r);var a=new KA(nT(o,r,s?function(e){return tT(s,e)}:HA));return n?a.pipe(ZN(n)):a}function nT(e,t,r){return void 0===r&&(r=HA),function(n){iT(t,(function(){for(var i=e.length,o=new Array(i),s=i,a=i,c=function(i){iT(t,(function(){var c=FN(e[i],t),u=!1;c.subscribe(JA(n,(function(e){o[i]=e,u||(u=!0,a--),a||n.next(r(o.slice()))}),(function(){--s||n.complete()})))}),n)},u=0;u<i;u++)c(u)}),n)}}function iT(e,t,r){e?_N(r,e,t):t()}function oT(e,t,r){return void 0===r&&(r=1/0),vA(t)?oT((function(r,n){return XN((function(e,i){return t(r,e,n,i)}))(zN(e(r,n)))}),r):("number"==typeof t&&(r=t),ZA((function(t,n){return function(e,t,r,n,i,o,s,a){var c=[],u=0,l=0,h=!1,d=function(){!h||c.length||u||t.complete()},f=function(e){return u<n?p(e):c.push(e)},p=function(e){o&&t.next(e),u++;var a=!1;zN(r(e,l++)).subscribe(JA(t,(function(e){null==i||i(e),o?f(e):t.next(e)}),(function(){a=!0}),void 0,(function(){if(a)try{u--;for(var e=function(){var e=c.shift();s?_N(t,s,(function(){return p(e)})):p(e)};c.length&&u<n;)e();d()}catch(r){t.error(r)}})))};return e.subscribe(JA(t,f,(function(){h=!0,d()}))),function(){null==a||a()}}(t,n,e,r)})))}new KA(IA);Array.isArray;function sT(e,t){return ZA((function(r,n){var i=0;r.subscribe(JA(n,(function(r){return e.call(t,r,i++)&&n.next(r)})))}))}function aT(e){return ZA((function(t,r){var n,i=null,o=!1;i=t.subscribe(JA(r,void 0,void 0,(function(s){n=zN(e(s,aT(e)(t))),i?(i.unsubscribe(),i=null,n.subscribe(r)):o=!0}))),o&&(i.unsubscribe(),i=null,n.subscribe(r))}))}function cT(e,t,r,n,i){return function(o,s){var a=r,c=t,u=0;o.subscribe(JA(s,(function(t){var r=u++;c=a?e(c,t,r):(a=!0,t),n&&s.next(c)}),i&&function(){a&&s.next(c),s.complete()}))}}var uT=function(e,t){return e.push(t),e};function lT(){return ZA((function(e,t){(function(e,t){return ZA(cT(e,t,arguments.length>=2,!1,!0))})(uT,[])(e).subscribe(t)}))}function hT(e){return ZA((function(t,r){var n=!1;t.subscribe(JA(r,(function(e){n=!0,r.next(e)}),(function(){n||r.next(e),r.complete()})))}))}function dT(e){return e<=0?function(){return kN}:ZA((function(t,r){var n=0;t.subscribe(JA(r,(function(t){++n<=e&&(r.next(t),e<=n&&r.complete())})))}))}function fT(e){return void 0===e&&(e=pT),ZA((function(t,r){var n=!1;t.subscribe(JA(r,(function(e){n=!0,r.next(e)}),(function(){return n?r.complete():r.error(e())})))}))}function pT(){return new WN}function mT(e,t){var r=arguments.length>=2;return function(n){return n.pipe(e?sT((function(t,r){return e(t,r,n)})):HA,dT(1),r?hT(t):fT((function(){return new WN})))}}function gT(e,t){return ZA((function(r,n){var i=null,o=0,s=!1,a=function(){return s&&!i&&n.complete()};r.subscribe(JA(n,(function(r){null==i||i.unsubscribe();var s=0,c=o++;zN(e(r,c)).subscribe(i=JA(n,(function(e){return n.next(t?t(r,e,c,s++):e)}),(function(){i=null,a()})))}),(function(){s=!0,a()})))}))}function yT(e,t,r){var n=vA(e)||t||r?{next:e,error:t,complete:r}:e;return n?ZA((function(e,t){var r;null===(r=n.subscribe)||void 0===r||r.call(n);var i=!0;e.subscribe(JA(t,(function(e){var r;null===(r=n.next)||void 0===r||r.call(n,e),t.next(e)}),(function(){var e;i=!1,null===(e=n.complete)||void 0===e||e.call(n),t.complete()}),(function(e){var r;i=!1,null===(r=n.error)||void 0===r||r.call(n,e),t.error(e)}),(function(){var e,t;i&&(null===(e=n.unsubscribe)||void 0===e||e.call(n)),null===(t=n.finalize)||void 0===t||t.call(n)})))})):HA}function bT(e,t,r,n){yy(e,t,(()=>by({},r(t),(e=>n(t,e)))))}function vT(e){return"function"==typeof e}function wT(e){var t=e((function(e){Error.call(e),e.stack=(new Error).stack}));return t.prototype=Object.create(Error.prototype),t.prototype.constructor=t,t}Em(Ly,null,[]);var xT=wT((function(e){return function(t){e(this),this.message=t?t.length+" errors occurred during unsubscription:\n"+t.map((function(e,t){return t+1+") "+e.toString()})).join("\n "):"",this.name="UnsubscriptionError",this.errors=t}}));function kT(e,t){if(e){var r=e.indexOf(t);0<=r&&e.splice(r,1)}}var ST=function(){function e(e){this.initialTeardown=e,this.closed=!1,this._parentage=null,this._finalizers=null}return e.prototype.unsubscribe=function(){var e,t,r,n,i;if(!this.closed){this.closed=!0;var o=this._parentage;if(o)if(this._parentage=null,Array.isArray(o))try{for(var s=U(o),a=s.next();!a.done;a=s.next()){a.value.remove(this)}}catch(f){e={error:f}}finally{try{a&&!a.done&&(t=s.return)&&t.call(s)}finally{if(e)throw e.error}}else o.remove(this);var c=this.initialTeardown;if(vT(c))try{c()}catch(p){i=p instanceof xT?p.errors:[p]}var u=this._finalizers;if(u){this._finalizers=null;try{for(var l=U(u),h=l.next();!h.done;h=l.next()){var d=h.value;try{NT(d)}catch(m){i=null!=i?i:[],m instanceof xT?i=q(q([],_(i)),_(m.errors)):i.push(m)}}}catch(g){r={error:g}}finally{try{h&&!h.done&&(n=l.return)&&n.call(l)}finally{if(r)throw r.error}}}if(i)throw new xT(i)}},e.prototype.add=function(t){var r;if(t&&t!==this)if(this.closed)NT(t);else{if(t instanceof e){if(t.closed||t._hasParent(this))return;t._addParent(this)}(this._finalizers=null!==(r=this._finalizers)&&void 0!==r?r:[]).push(t)}},e.prototype._hasParent=function(e){var t=this._parentage;return t===e||Array.isArray(t)&&t.includes(e)},e.prototype._addParent=function(e){var t=this._parentage;this._parentage=Array.isArray(t)?(t.push(e),t):t?[t,e]:e},e.prototype._removeParent=function(e){var t=this._parentage;t===e?this._parentage=null:Array.isArray(t)&&kT(t,e)},e.prototype.remove=function(t){var r=this._finalizers;r&&kT(r,t),t instanceof e&&t._removeParent(this)},e.EMPTY=function(){var t=new e;return t.closed=!0,t}(),e}(),ET=ST.EMPTY;function AT(e){return e instanceof ST||e&&"closed"in e&&vT(e.remove)&&vT(e.add)&&vT(e.unsubscribe)}function NT(e){vT(e)?e():e.unsubscribe()}var TT={onUnhandledError:null,onStoppedNotification:null,Promise:void 0,useDeprecatedSynchronousErrorHandling:!1,useDeprecatedNextContext:!1},PT={setTimeout:function(e,t){for(var r=[],n=2;n<arguments.length;n++)r[n-2]=arguments[n];var i=PT.delegate;return(null==i?void 0:i.setTimeout)?i.setTimeout.apply(i,q([e,t],_(r))):setTimeout.apply(void 0,q([e,t],_(r)))},clearTimeout:function(e){var t=PT.delegate;return((null==t?void 0:t.clearTimeout)||clearTimeout)(e)},delegate:void 0};function MT(e){PT.setTimeout((function(){var t=TT.onUnhandledError;if(!t)throw e;t(e)}))}function IT(){}var CT=RT("C",void 0,void 0);function RT(e,t,r){return{kind:e,value:t,error:r}}var BT=null;function OT(e){if(TT.useDeprecatedSynchronousErrorHandling){var t=!BT;if(t&&(BT={errorThrown:!1,error:null}),e(),t){var r=BT,n=r.errorThrown,i=r.error;if(BT=null,n)throw i}}else e()}var LT=function(e){function t(t){var r=e.call(this)||this;return r.isStopped=!1,t?(r.destination=t,AT(t)&&t.add(r)):r.destination=jT,r}return O(t,e),t.create=function(e,t,r){return new qT(e,t,r)},t.prototype.next=function(e){this.isStopped?VT(function(e){return RT("N",e,void 0)}(e),this):this._next(e)},t.prototype.error=function(e){this.isStopped?VT(RT("E",void 0,e),this):(this.isStopped=!0,this._error(e))},t.prototype.complete=function(){this.isStopped?VT(CT,this):(this.isStopped=!0,this._complete())},t.prototype.unsubscribe=function(){this.closed||(this.isStopped=!0,e.prototype.unsubscribe.call(this),this.destination=null)},t.prototype._next=function(e){this.destination.next(e)},t.prototype._error=function(e){try{this.destination.error(e)}finally{this.unsubscribe()}},t.prototype._complete=function(){try{this.destination.complete()}finally{this.unsubscribe()}},t}(ST),zT=Function.prototype.bind;function UT(e,t){return zT.call(e,t)}var _T=function(){function e(e){this.partialObserver=e}return e.prototype.next=function(e){var t=this.partialObserver;if(t.next)try{t.next(e)}catch(h2){DT(h2)}},e.prototype.error=function(e){var t=this.partialObserver;if(t.error)try{t.error(e)}catch(h2){DT(h2)}else DT(e)},e.prototype.complete=function(){var e=this.partialObserver;if(e.complete)try{e.complete()}catch(h2){DT(h2)}},e}(),qT=function(e){function t(t,r,n){var i,o,s=e.call(this)||this;vT(t)||!t?i={next:null!=t?t:void 0,error:null!=r?r:void 0,complete:null!=n?n:void 0}:s&&TT.useDeprecatedNextContext?((o=Object.create(t)).unsubscribe=function(){return s.unsubscribe()},i={next:t.next&&UT(t.next,o),error:t.error&&UT(t.error,o),complete:t.complete&&UT(t.complete,o)}):i=t;return s.destination=new _T(i),s}return O(t,e),t}(LT);function DT(e){var t;TT.useDeprecatedSynchronousErrorHandling?(t=e,TT.useDeprecatedSynchronousErrorHandling&&BT&&(BT.errorThrown=!0,BT.error=t)):MT(e)}function VT(e,t){var r=TT.onStoppedNotification;r&&PT.setTimeout((function(){return r(e,t)}))}var jT={closed:!0,next:IT,error:function(e){throw e},complete:IT},FT="function"==typeof Symbol&&Symbol.observable||"@@observable";function HT(e){return e}function WT(e){return 0===e.length?HT:1===e.length?e[0]:function(t){return e.reduce((function(e,t){return t(e)}),t)}}var KT=function(){function e(e){e&&(this._subscribe=e)}return e.prototype.lift=function(t){var r=new e;return r.source=this,r.operator=t,r},e.prototype.subscribe=function(e,t,r){var n,i=this,o=(n=e)&&n instanceof LT||function(e){return e&&vT(e.next)&&vT(e.error)&&vT(e.complete)}(n)&&AT(n)?e:new qT(e,t,r);return OT((function(){var e=i,t=e.operator,r=e.source;o.add(t?t.call(o,r):r?i._subscribe(o):i._trySubscribe(o))})),o},e.prototype._trySubscribe=function(e){try{return this._subscribe(e)}catch(t){e.error(t)}},e.prototype.forEach=function(e,t){var r=this;return new(t=XT(t))((function(t,n){var i=new qT({next:function(t){try{e(t)}catch(r){n(r),i.unsubscribe()}},error:n,complete:t});r.subscribe(i)}))},e.prototype._subscribe=function(e){var t;return null===(t=this.source)||void 0===t?void 0:t.subscribe(e)},e.prototype[FT]=function(){return this},e.prototype.pipe=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return WT(e)(this)},e.prototype.toPromise=function(e){var t=this;return new(e=XT(e))((function(e,r){var n;t.subscribe((function(e){return n=e}),(function(e){return r(e)}),(function(){return e(n)}))}))},e.create=function(t){return new e(t)},e}();function XT(e){var t;return null!==(t=null!=e?e:TT.Promise)&&void 0!==t?t:Promise}function GT(e){return vT(null==e?void 0:e.lift)}function ZT(e){return function(t){if(GT(t))return t.lift((function(t){try{return e(t,this)}catch(r){this.error(r)}}));throw new TypeError("Unable to lift unknown Observable type")}}function JT(e,t,r,n,i){return new YT(e,t,r,n,i)}var YT=function(e){function t(t,r,n,i,o,s){var a=e.call(this,t)||this;return a.onFinalize=o,a.shouldUnsubscribe=s,a._next=r?function(e){try{r(e)}catch(n){t.error(n)}}:e.prototype._next,a._error=i?function(e){try{i(e)}catch(e){t.error(e)}finally{this.unsubscribe()}}:e.prototype._error,a._complete=n?function(){try{n()}catch(e){t.error(e)}finally{this.unsubscribe()}}:e.prototype._complete,a}return O(t,e),t.prototype.unsubscribe=function(){var t;if(!this.shouldUnsubscribe||this.shouldUnsubscribe()){var r=this.closed;e.prototype.unsubscribe.call(this),!r&&(null===(t=this.onFinalize)||void 0===t||t.call(this))}},t}(LT);!function(e){function t(t,r){var n=e.call(this)||this;return n.source=t,n.subjectFactory=r,n._subject=null,n._refCount=0,n._connection=null,GT(t)&&(n.lift=t.lift),n}O(t,e),t.prototype._subscribe=function(e){return this.getSubject().subscribe(e)},t.prototype.getSubject=function(){var e=this._subject;return e&&!e.isStopped||(this._subject=this.subjectFactory()),this._subject},t.prototype._teardown=function(){this._refCount=0;var e=this._connection;this._subject=this._connection=null,null==e||e.unsubscribe()},t.prototype.connect=function(){var e=this,t=this._connection;if(!t){t=this._connection=new ST;var r=this.getSubject();t.add(this.source.subscribe(JT(r,void 0,(function(){e._teardown(),r.complete()}),(function(t){e._teardown(),r.error(t)}),(function(){return e._teardown()})))),t.closed&&(this._connection=null,t=ST.EMPTY)}return t},t.prototype.refCount=function(){return ZT((function(e,t){var r=null;e._refCount++;var n=JT(t,void 0,void 0,void 0,(function(){if(!e||e._refCount<=0||0<--e._refCount)r=null;else{var n=e._connection,i=r;r=null,!n||i&&n!==i||n.unsubscribe(),t.unsubscribe()}}));e.subscribe(n),n.closed||(r=e.connect())}))(this)}}(KT);var QT={now:function(){return(QT.delegate||performance).now()},delegate:void 0},$T={schedule:function(e){var t=requestAnimationFrame,r=cancelAnimationFrame,n=$T.delegate;n&&(t=n.requestAnimationFrame,r=n.cancelAnimationFrame);var i=t((function(t){r=void 0,e(t)}));return new ST((function(){return null==r?void 0:r(i)}))},requestAnimationFrame:function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var r=$T.delegate;return((null==r?void 0:r.requestAnimationFrame)||requestAnimationFrame).apply(void 0,q([],_(e)))},cancelAnimationFrame:function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var r=$T.delegate;return((null==r?void 0:r.cancelAnimationFrame)||cancelAnimationFrame).apply(void 0,q([],_(e)))},delegate:void 0};function eP(e){var t=$T.schedule;return new KT((function(r){var n=new ST,i=e||QT,o=i.now(),s=function(a){var c=i.now();r.next({timestamp:e?c:a,elapsed:c-o}),r.closed||n.add(t(s))};return n.add(t(s)),n}))}eP();var tP,rP=wT((function(e){return function(){e(this),this.name="ObjectUnsubscribedError",this.message="object unsubscribed"}})),nP=function(e){function t(){var t=e.call(this)||this;return t.closed=!1,t.currentObservers=null,t.observers=[],t.isStopped=!1,t.hasError=!1,t.thrownError=null,t}return O(t,e),t.prototype.lift=function(e){var t=new iP(this,this);return t.operator=e,t},t.prototype._throwIfClosed=function(){if(this.closed)throw new rP},t.prototype.next=function(e){var t=this;OT((function(){var r,n;if(t._throwIfClosed(),!t.isStopped){t.currentObservers||(t.currentObservers=Array.from(t.observers));try{for(var i=U(t.currentObservers),o=i.next();!o.done;o=i.next()){o.value.next(e)}}catch(s){r={error:s}}finally{try{o&&!o.done&&(n=i.return)&&n.call(i)}finally{if(r)throw r.error}}}}))},t.prototype.error=function(e){var t=this;OT((function(){if(t._throwIfClosed(),!t.isStopped){t.hasError=t.isStopped=!0,t.thrownError=e;for(var r=t.observers;r.length;)r.shift().error(e)}}))},t.prototype.complete=function(){var e=this;OT((function(){if(e._throwIfClosed(),!e.isStopped){e.isStopped=!0;for(var t=e.observers;t.length;)t.shift().complete()}}))},t.prototype.unsubscribe=function(){this.isStopped=this.closed=!0,this.observers=this.currentObservers=null},Object.defineProperty(t.prototype,"observed",{get:function(){var e;return(null===(e=this.observers)||void 0===e?void 0:e.length)>0},enumerable:!1,configurable:!0}),t.prototype._trySubscribe=function(t){return this._throwIfClosed(),e.prototype._trySubscribe.call(this,t)},t.prototype._subscribe=function(e){return this._throwIfClosed(),this._checkFinalizedStatuses(e),this._innerSubscribe(e)},t.prototype._innerSubscribe=function(e){var t=this,r=this,n=r.hasError,i=r.isStopped,o=r.observers;return n||i?ET:(this.currentObservers=null,o.push(e),new ST((function(){t.currentObservers=null,kT(o,e)})))},t.prototype._checkFinalizedStatuses=function(e){var t=this,r=t.hasError,n=t.thrownError,i=t.isStopped;r?e.error(n):i&&e.complete()},t.prototype.asObservable=function(){var e=new KT;return e.source=this,e},t.create=function(e,t){return new iP(e,t)},t}(KT),iP=function(e){function t(t,r){var n=e.call(this)||this;return n.destination=t,n.source=r,n}return O(t,e),t.prototype.next=function(e){var t,r;null===(r=null===(t=this.destination)||void 0===t?void 0:t.next)||void 0===r||r.call(t,e)},t.prototype.error=function(e){var t,r;null===(r=null===(t=this.destination)||void 0===t?void 0:t.error)||void 0===r||r.call(t,e)},t.prototype.complete=function(){var e,t;null===(t=null===(e=this.destination)||void 0===e?void 0:e.complete)||void 0===t||t.call(e)},t.prototype._subscribe=function(e){var t,r;return null!==(r=null===(t=this.source)||void 0===t?void 0:t.subscribe(e))&&void 0!==r?r:ET},t}(nP),oP=function(e){function t(t){var r=e.call(this)||this;return r._value=t,r}return O(t,e),Object.defineProperty(t.prototype,"value",{get:function(){return this.getValue()},enumerable:!1,configurable:!0}),t.prototype._subscribe=function(t){var r=e.prototype._subscribe.call(this,t);return!r.closed&&t.next(this._value),r},t.prototype.getValue=function(){var e=this,t=e.hasError,r=e.thrownError,n=e._value;if(t)throw r;return this._throwIfClosed(),n},t.prototype.next=function(t){e.prototype.next.call(this,this._value=t)},t}(nP),sP={now:function(){return(sP.delegate||Date).now()},delegate:void 0},aP=(function(e){function t(t,r,n){void 0===t&&(t=1/0),void 0===r&&(r=1/0),void 0===n&&(n=sP);var i=e.call(this)||this;return i._bufferSize=t,i._windowTime=r,i._timestampProvider=n,i._buffer=[],i._infiniteTimeWindow=!0,i._infiniteTimeWindow=r===1/0,i._bufferSize=Math.max(1,t),i._windowTime=Math.max(1,r),i}O(t,e),t.prototype.next=function(t){var r=this,n=r.isStopped,i=r._buffer,o=r._infiniteTimeWindow,s=r._timestampProvider,a=r._windowTime;n||(i.push(t),!o&&i.push(s.now()+a)),this._trimBuffer(),e.prototype.next.call(this,t)},t.prototype._subscribe=function(e){this._throwIfClosed(),this._trimBuffer();for(var t=this._innerSubscribe(e),r=this._infiniteTimeWindow,n=this._buffer.slice(),i=0;i<n.length&&!e.closed;i+=r?1:2)e.next(n[i]);return this._checkFinalizedStatuses(e),t},t.prototype._trimBuffer=function(){var e=this,t=e._bufferSize,r=e._timestampProvider,n=e._buffer,i=e._infiniteTimeWindow,o=(i?1:2)*t;if(t<1/0&&o<n.length&&n.splice(0,n.length-o),!i){for(var s=r.now(),a=0,c=1;c<n.length&&n[c]<=s;c+=2)a=c;a&&n.splice(0,a+1)}}}(nP),function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t._value=null,t._hasValue=!1,t._isComplete=!1,t}O(t,e),t.prototype._checkFinalizedStatuses=function(e){var t=this,r=t.hasError,n=t._hasValue,i=t._value,o=t.thrownError,s=t.isStopped,a=t._isComplete;r?e.error(o):(s||a)&&(n&&e.next(i),e.complete())},t.prototype.next=function(e){this.isStopped||(this._value=e,this._hasValue=!0)},t.prototype.complete=function(){var t=this,r=t._hasValue,n=t._value;t._isComplete||(this._isComplete=!0,r&&e.prototype.next.call(this,n),e.prototype.complete.call(this))}}(nP),function(e){function t(t,r){return e.call(this)||this}return O(t,e),t.prototype.schedule=function(e,t){return void 0===t&&(t=0),this},t}(ST)),cP={setInterval:function(e,t){for(var r=[],n=2;n<arguments.length;n++)r[n-2]=arguments[n];var i=cP.delegate;return(null==i?void 0:i.setInterval)?i.setInterval.apply(i,q([e,t],_(r))):setInterval.apply(void 0,q([e,t],_(r)))},clearInterval:function(e){var t=cP.delegate;return((null==t?void 0:t.clearInterval)||clearInterval)(e)},delegate:void 0},uP=function(e){function t(t,r){var n=e.call(this,t,r)||this;return n.scheduler=t,n.work=r,n.pending=!1,n}return O(t,e),t.prototype.schedule=function(e,t){if(void 0===t&&(t=0),this.closed)return this;this.state=e;var r=this.id,n=this.scheduler;return null!=r&&(this.id=this.recycleAsyncId(n,r,t)),this.pending=!0,this.delay=t,this.id=this.id||this.requestAsyncId(n,this.id,t),this},t.prototype.requestAsyncId=function(e,t,r){return void 0===r&&(r=0),cP.setInterval(e.flush.bind(e,this),r)},t.prototype.recycleAsyncId=function(e,t,r){if(void 0===r&&(r=0),null!=r&&this.delay===r&&!1===this.pending)return t;cP.clearInterval(t)},t.prototype.execute=function(e,t){if(this.closed)return new Error("executing a cancelled action");this.pending=!1;var r=this._execute(e,t);if(r)return r;!1===this.pending&&null!=this.id&&(this.id=this.recycleAsyncId(this.scheduler,this.id,null))},t.prototype._execute=function(e,t){var r,n=!1;try{this.work(e)}catch(i){n=!0,r=i||new Error("Scheduled action threw falsy error")}if(n)return this.unsubscribe(),r},t.prototype.unsubscribe=function(){if(!this.closed){var t=this.id,r=this.scheduler,n=r.actions;this.work=this.state=this.scheduler=null,this.pending=!1,kT(n,this),null!=t&&(this.id=this.recycleAsyncId(r,t,null)),this.delay=null,e.prototype.unsubscribe.call(this)}},t}(aP),lP=1,hP={};function dP(e){return e in hP&&(delete hP[e],!0)}var fP=function(e){var t=lP++;return hP[t]=!0,tP||(tP=Promise.resolve()),tP.then((function(){return dP(t)&&e()})),t},pP=function(e){dP(e)},mP={setImmediate:function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var r=mP.delegate;return((null==r?void 0:r.setImmediate)||fP).apply(void 0,q([],_(e)))},clearImmediate:function(e){var t=mP.delegate;return((null==t?void 0:t.clearImmediate)||pP)(e)},delegate:void 0},gP=function(e){function t(t,r){var n=e.call(this,t,r)||this;return n.scheduler=t,n.work=r,n}return O(t,e),t.prototype.requestAsyncId=function(t,r,n){return void 0===n&&(n=0),null!==n&&n>0?e.prototype.requestAsyncId.call(this,t,r,n):(t.actions.push(this),t._scheduled||(t._scheduled=mP.setImmediate(t.flush.bind(t,void 0))))},t.prototype.recycleAsyncId=function(t,r,n){if(void 0===n&&(n=0),null!=n&&n>0||null==n&&this.delay>0)return e.prototype.recycleAsyncId.call(this,t,r,n);t.actions.some((function(e){return e.id===r}))||(mP.clearImmediate(r),t._scheduled=void 0)},t}(uP),yP=function(){function e(t,r){void 0===r&&(r=e.now),this.schedulerActionCtor=t,this.now=r}return e.prototype.schedule=function(e,t,r){return void 0===t&&(t=0),new this.schedulerActionCtor(this,e).schedule(r,t)},e.now=sP.now,e}(),bP=function(e){function t(t,r){void 0===r&&(r=yP.now);var n=e.call(this,t,r)||this;return n.actions=[],n._active=!1,n._scheduled=void 0,n}return O(t,e),t.prototype.flush=function(e){var t=this.actions;if(this._active)t.push(e);else{var r;this._active=!0;do{if(r=e.execute(e.state,e.delay))break}while(e=t.shift());if(this._active=!1,r){for(;e=t.shift();)e.unsubscribe();throw r}}},t}(yP),vP=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return O(t,e),t.prototype.flush=function(e){this._active=!0;var t=this._scheduled;this._scheduled=void 0;var r,n=this.actions;e=e||n.shift();do{if(r=e.execute(e.state,e.delay))break}while((e=n[0])&&e.id===t&&n.shift());if(this._active=!1,r){for(;(e=n[0])&&e.id===t&&n.shift();)e.unsubscribe();throw r}},t}(bP),wP=(new vP(gP),new bP(uP),function(e){function t(t,r){var n=e.call(this,t,r)||this;return n.scheduler=t,n.work=r,n}return O(t,e),t.prototype.schedule=function(t,r){return void 0===r&&(r=0),r>0?e.prototype.schedule.call(this,t,r):(this.delay=r,this.state=t,this.scheduler.flush(this),this)},t.prototype.execute=function(t,r){return r>0||this.closed?e.prototype.execute.call(this,t,r):this._execute(t,r)},t.prototype.requestAsyncId=function(t,r,n){return void 0===n&&(n=0),null!=n&&n>0||null==n&&this.delay>0?e.prototype.requestAsyncId.call(this,t,r,n):t.flush(this)},t}(uP)),xP=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return O(t,e),t}(bP),kP=(new xP(wP),function(e){function t(t,r){var n=e.call(this,t,r)||this;return n.scheduler=t,n.work=r,n}return O(t,e),t.prototype.requestAsyncId=function(t,r,n){return void 0===n&&(n=0),null!==n&&n>0?e.prototype.requestAsyncId.call(this,t,r,n):(t.actions.push(this),t._scheduled||(t._scheduled=$T.requestAnimationFrame((function(){return t.flush(void 0)}))))},t.prototype.recycleAsyncId=function(t,r,n){if(void 0===n&&(n=0),null!=n&&n>0||null==n&&this.delay>0)return e.prototype.recycleAsyncId.call(this,t,r,n);t.actions.some((function(e){return e.id===r}))||($T.cancelAnimationFrame(r),t._scheduled=void 0)},t}(uP)),SP=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return O(t,e),t.prototype.flush=function(e){this._active=!0;var t=this._scheduled;this._scheduled=void 0;var r,n=this.actions;e=e||n.shift();do{if(r=e.execute(e.state,e.delay))break}while((e=n[0])&&e.id===t&&n.shift());if(this._active=!1,r){for(;(e=n[0])&&e.id===t&&n.shift();)e.unsubscribe();throw r}},t}(bP),EP=(new SP(kP),function(e){function t(t,r){void 0===t&&(t=EP),void 0===r&&(r=1/0);var n=e.call(this,t,(function(){return n.frame}))||this;return n.maxFrames=r,n.frame=0,n.index=-1,n}O(t,e),t.prototype.flush=function(){for(var e,t,r=this.actions,n=this.maxFrames;(t=r[0])&&t.delay<=n&&(r.shift(),this.frame=t.delay,!(e=t.execute(t.state,t.delay))););if(e){for(;t=r.shift();)t.unsubscribe();throw e}},t.frameTimeFactor=10}(bP),function(e){function t(t,r,n){void 0===n&&(n=t.index+=1);var i=e.call(this,t,r)||this;return i.scheduler=t,i.work=r,i.index=n,i.active=!0,i.index=t.index=n,i}return O(t,e),t.prototype.schedule=function(r,n){if(void 0===n&&(n=0),Number.isFinite(n)){if(!this.id)return e.prototype.schedule.call(this,r,n);this.active=!1;var i=new t(this.scheduler,this.work);return this.add(i),i.schedule(r,n)}return ST.EMPTY},t.prototype.requestAsyncId=function(e,r,n){void 0===n&&(n=0),this.delay=e.frame+n;var i=e.actions;return i.push(this),i.sort(t.sortActions),!0},t.prototype.recycleAsyncId=function(e,t,r){void 0===r&&(r=0)},t.prototype._execute=function(t,r){if(!0===this.active)return e.prototype._execute.call(this,t,r)},t.sortActions=function(e,t){return e.delay===t.delay?e.index===t.index?0:e.index>t.index?1:-1:e.delay>t.delay?1:-1},t}(uP)),AP=new KT((function(e){return e.complete()}));function NP(e){return e[e.length-1]}function TP(e){return vT(NP(e))?e.pop():void 0}function PP(e){return(t=NP(e))&&vT(t.schedule)?e.pop():void 0;var t}var MP=function(e){return e&&"number"==typeof e.length&&"function"!=typeof e};function IP(e){return vT(null==e?void 0:e.then)}function CP(e){return vT(e[FT])}function RP(e){return Symbol.asyncIterator&&vT(null==e?void 0:e[Symbol.asyncIterator])}function BP(e){return new TypeError("You provided "+(null!==e&&"object"==typeof e?"an invalid object":"'"+e+"'")+" where a stream was expected. You can provide an Observable, Promise, ReadableStream, Array, AsyncIterable, or Iterable.")}var OP,LP="function"==typeof Symbol&&Symbol.iterator?Symbol.iterator:"@@iterator";function zP(e){return vT(null==e?void 0:e[LP])}function UP(e){return V(this,arguments,(function(){var t,r,n;return z(this,(function(i){switch(i.label){case 0:t=e.getReader(),i.label=1;case 1:i.trys.push([1,,9,10]),i.label=2;case 2:return[4,D(t.read())];case 3:return r=i.sent(),n=r.value,r.done?[4,D(void 0)]:[3,5];case 4:return[2,i.sent()];case 5:return[4,D(n)];case 6:return[4,i.sent()];case 7:return i.sent(),[3,2];case 8:return[3,10];case 9:return t.releaseLock(),[7];case 10:return[2]}}))}))}function _P(e){return vT(null==e?void 0:e.getReader)}function qP(e){if(e instanceof KT)return e;if(null!=e){if(CP(e))return n=e,new KT((function(e){var t=n[FT]();if(vT(t.subscribe))return t.subscribe(e);throw new TypeError("Provided object does not correctly implement Symbol.observable")}));if(MP(e))return function(e){return new KT((function(t){for(var r=0;r<e.length&&!t.closed;r++)t.next(e[r]);t.complete()}))}(e);if(IP(e))return r=e,new KT((function(e){r.then((function(t){e.closed||(e.next(t),e.complete())}),(function(t){return e.error(t)})).then(null,MT)}));if(RP(e))return DP(e);if(zP(e))return t=e,new KT((function(e){var r,n;try{for(var i=U(t),o=i.next();!o.done;o=i.next()){var s=o.value;if(e.next(s),e.closed)return}}catch(a){r={error:a}}finally{try{o&&!o.done&&(n=i.return)&&n.call(i)}finally{if(r)throw r.error}}e.complete()}));if(_P(e))return DP(UP(e))}var t,r,n;throw BP(e)}function DP(e){return new KT((function(t){(function(e,t){var r,n,i,o;return L(this,void 0,void 0,(function(){var s,a;return z(this,(function(c){switch(c.label){case 0:c.trys.push([0,5,6,11]),r=j(e),c.label=1;case 1:return[4,r.next()];case 2:if((n=c.sent()).done)return[3,4];if(s=n.value,t.next(s),t.closed)return[2];c.label=3;case 3:return[3,1];case 4:return[3,11];case 5:return a=c.sent(),i={error:a},[3,11];case 6:return c.trys.push([6,,9,10]),n&&!n.done&&(o=r.return)?[4,o.call(r)]:[3,8];case 7:c.sent(),c.label=8;case 8:return[3,10];case 9:if(i)throw i.error;return[7];case 10:return[7];case 11:return t.complete(),[2]}}))}))})(e,t).catch((function(e){return t.error(e)}))}))}function VP(e,t,r,n,i){void 0===n&&(n=0),void 0===i&&(i=!1);var o=t.schedule((function(){r(),i?e.add(this.schedule(null,n)):this.unsubscribe()}),n);if(e.add(o),!i)return o}function jP(e,t){return void 0===t&&(t=0),ZT((function(r,n){r.subscribe(JT(n,(function(r){return VP(n,e,(function(){return n.next(r)}),t)}),(function(){return VP(n,e,(function(){return n.complete()}),t)}),(function(r){return VP(n,e,(function(){return n.error(r)}),t)})))}))}function FP(e,t){return void 0===t&&(t=0),ZT((function(r,n){n.add(e.schedule((function(){return r.subscribe(n)}),t))}))}function HP(e,t){if(!e)throw new Error("Iterable cannot be null");return new KT((function(r){VP(r,t,(function(){var n=e[Symbol.asyncIterator]();VP(r,t,(function(){n.next().then((function(e){e.done?r.complete():r.next(e.value)}))}),0,!0)}))}))}function WP(e,t){if(null!=e){if(CP(e))return function(e,t){return qP(e).pipe(FP(t),jP(t))}(e,t);if(MP(e))return function(e,t){return new KT((function(r){var n=0;return t.schedule((function(){n===e.length?r.complete():(r.next(e[n++]),r.closed||this.schedule())}))}))}(e,t);if(IP(e))return function(e,t){return qP(e).pipe(FP(t),jP(t))}(e,t);if(RP(e))return HP(e,t);if(zP(e))return function(e,t){return new KT((function(r){var n;return VP(r,t,(function(){n=e[LP](),VP(r,t,(function(){var e,t,i;try{t=(e=n.next()).value,i=e.done}catch(o){return void r.error(o)}i?r.complete():r.next(t)}),0,!0)})),function(){return vT(null==n?void 0:n.return)&&n.return()}}))}(e,t);if(_P(e))return function(e,t){return HP(UP(e),t)}(e,t)}throw BP(e)}function KP(e,t){return t?WP(e,t):qP(e)}function XP(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var r=PP(e);return KP(e,r)}!function(e){e.NEXT="N",e.ERROR="E",e.COMPLETE="C"}(OP||(OP={}));!function(){function e(e,t,r){this.kind=e,this.value=t,this.error=r,this.hasValue="N"===e}e.prototype.observe=function(e){return function(e,t){var r,n,i,o=e,s=o.kind,a=o.value,c=o.error;if("string"!=typeof s)throw new TypeError('Invalid notification, missing "kind"');"N"===s?null===(r=t.next)||void 0===r||r.call(t,a):"E"===s?null===(n=t.error)||void 0===n||n.call(t,c):null===(i=t.complete)||void 0===i||i.call(t)}(this,e)},e.prototype.do=function(e,t,r){var n=this,i=n.kind,o=n.value,s=n.error;return"N"===i?null==e?void 0:e(o):"E"===i?null==t?void 0:t(s):null==r?void 0:r()},e.prototype.accept=function(e,t,r){var n;return vT(null===(n=e)||void 0===n?void 0:n.next)?this.observe(e):this.do(e,t,r)},e.prototype.toObservable=function(){var e=this,t=e.kind,r=e.value,n=e.error,i="N"===t?XP(r):"E"===t?function(e,t){var r=vT(e)?e:function(){return e},n=function(e){return e.error(r())};return new KT(t?function(e){return t.schedule(n,0,e)}:n)}((function(){return n})):"C"===t?AP:0;if(!i)throw new TypeError("Unexpected notification kind "+t);return i},e.createNext=function(t){return new e("N",t)},e.createError=function(t){return new e("E",void 0,t)},e.createComplete=function(){return e.completeNotification},e.completeNotification=new e("C")}();wT((function(e){return function(){e(this),this.name="EmptyError",this.message="no elements in sequence"}}));wT((function(e){return function(){e(this),this.name="ArgumentOutOfRangeError",this.message="argument out of range"}})),wT((function(e){return function(t){e(this),this.name="NotFoundError",this.message=t}})),wT((function(e){return function(t){e(this),this.name="SequenceError",this.message=t}}));wT((function(e){return function(t){void 0===t&&(t=null),e(this),this.message="Timeout has occurred",this.name="TimeoutError",this.info=t}}));function GP(e,t){return ZT((function(r,n){var i=0;r.subscribe(JT(n,(function(r){n.next(e.call(t,r,i++))})))}))}var ZP=Array.isArray;function JP(e){return GP((function(t){return function(e,t){return ZP(t)?e.apply(void 0,q([],_(t))):e(t)}(e,t)}))}var YP=Array.isArray,QP=Object.getPrototypeOf,$P=Object.prototype,eM=Object.keys;function tM(e){if(1===e.length){var t=e[0];if(YP(t))return{args:t,keys:null};if((n=t)&&"object"==typeof n&&QP(n)===$P){var r=eM(t);return{args:r.map((function(e){return t[e]})),keys:r}}}var n;return{args:e,keys:null}}function rM(e,t){return e.reduce((function(e,r,n){return e[r]=t[n],e}),{})}function nM(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var r=PP(e),n=TP(e),i=tM(e),o=i.args,s=i.keys;if(0===o.length)return KP([],r);var a=new KT(iM(o,r,s?function(e){return rM(s,e)}:HT));return n?a.pipe(JP(n)):a}function iM(e,t,r){return void 0===r&&(r=HT),function(n){oM(t,(function(){for(var i=e.length,o=new Array(i),s=i,a=i,c=function(i){oM(t,(function(){var c=KP(e[i],t),u=!1;c.subscribe(JT(n,(function(e){o[i]=e,u||(u=!0,a--),a||n.next(r(o.slice()))}),(function(){--s||n.complete()})))}),n)},u=0;u<i;u++)c(u)}),n)}}function oM(e,t,r){e?VP(r,e,t):t()}function sM(e,t,r){return void 0===r&&(r=1/0),vT(t)?sM((function(r,n){return GP((function(e,i){return t(r,e,n,i)}))(qP(e(r,n)))}),r):("number"==typeof t&&(r=t),ZT((function(t,n){return function(e,t,r,n,i,o,s,a){var c=[],u=0,l=0,h=!1,d=function(){!h||c.length||u||t.complete()},f=function(e){return u<n?p(e):c.push(e)},p=function(e){o&&t.next(e),u++;var a=!1;qP(r(e,l++)).subscribe(JT(t,(function(e){null==i||i(e),o?f(e):t.next(e)}),(function(){a=!0}),void 0,(function(){if(a)try{u--;for(var e=function(){var e=c.shift();s?VP(t,s,(function(){return p(e)})):p(e)};c.length&&u<n;)e();d()}catch(r){t.error(r)}})))};return e.subscribe(JT(t,f,(function(){h=!0,d()}))),function(){null==a||a()}}(t,n,e,r)})))}function aM(){return void 0===(e=1)&&(e=1/0),sM(HT,e);var e}function cM(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return aM()(KP(e,PP(e)))}new KT(IT);Array.isArray;function uM(e){return ZT((function(t,r){var n,i=null,o=!1;i=t.subscribe(JT(r,void 0,void 0,(function(s){n=qP(e(s,uM(e)(t))),i?(i.unsubscribe(),i=null,n.subscribe(r)):o=!0}))),o&&(i.unsubscribe(),i=null,n.subscribe(r))}))}function lM(e,t,r,n,i){return function(o,s){var a=r,c=t,u=0;o.subscribe(JT(s,(function(t){var r=u++;c=a?e(c,t,r):(a=!0,t),n&&s.next(c)}),i&&function(){a&&s.next(c),s.complete()}))}}var hM=function(e,t){return e.push(t),e};function dM(){return ZT((function(e,t){(function(e,t){return ZT(lM(e,t,arguments.length>=2,!1,!0))})(hM,[])(e).subscribe(t)}))}function fM(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var r=PP(e);return ZT((function(t,n){(r?cM(e,t,r):cM(e,t)).subscribe(n)}))}function pM(e,t){return ZT((function(r,n){var i=null,o=0,s=!1,a=function(){return s&&!i&&n.complete()};r.subscribe(JT(n,(function(r){null==i||i.unsubscribe();var s=0,c=o++;qP(e(r,c)).subscribe(i=JT(n,(function(e){return n.next(t?t(r,e,c,s++):e)}),(function(){i=null,a()})))}),(function(){s=!0,a()})))}))}function mM(e,t,r){var n=vT(e)||t||r?{next:e,error:t,complete:r}:e;return n?ZT((function(e,t){var r;null===(r=n.subscribe)||void 0===r||r.call(n);var i=!0;e.subscribe(JT(t,(function(e){var r;null===(r=n.next)||void 0===r||r.call(n,e),t.next(e)}),(function(){var e;i=!1,null===(e=n.complete)||void 0===e||e.call(n),t.complete()}),(function(e){var r;i=!1,null===(r=n.error)||void 0===r||r.call(n,e),t.error(e)}),(function(){var e,t;i&&(null===(e=n.unsubscribe)||void 0===e||e.call(n)),null===(t=n.finalize)||void 0===t||t.call(n)})))})):HT}function gM(e){return"function"==typeof e}function yM(e){var t=e((function(e){Error.call(e),e.stack=(new Error).stack}));return t.prototype=Object.create(Error.prototype),t.prototype.constructor=t,t}Em(zy,null,[Uy,_y]);var bM=yM((function(e){return function(t){e(this),this.message=t?t.length+" errors occurred during unsubscription:\n"+t.map((function(e,t){return t+1+") "+e.toString()})).join("\n "):"",this.name="UnsubscriptionError",this.errors=t}}));function vM(e,t){if(e){var r=e.indexOf(t);0<=r&&e.splice(r,1)}}var wM=function(){function e(e){this.initialTeardown=e,this.closed=!1,this._parentage=null,this._finalizers=null}return e.prototype.unsubscribe=function(){var e,t,r,n,i;if(!this.closed){this.closed=!0;var o=this._parentage;if(o)if(this._parentage=null,Array.isArray(o))try{for(var s=U(o),a=s.next();!a.done;a=s.next()){a.value.remove(this)}}catch(f){e={error:f}}finally{try{a&&!a.done&&(t=s.return)&&t.call(s)}finally{if(e)throw e.error}}else o.remove(this);var c=this.initialTeardown;if(gM(c))try{c()}catch(p){i=p instanceof bM?p.errors:[p]}var u=this._finalizers;if(u){this._finalizers=null;try{for(var l=U(u),h=l.next();!h.done;h=l.next()){var d=h.value;try{SM(d)}catch(m){i=null!=i?i:[],m instanceof bM?i=q(q([],_(i)),_(m.errors)):i.push(m)}}}catch(g){r={error:g}}finally{try{h&&!h.done&&(n=l.return)&&n.call(l)}finally{if(r)throw r.error}}}if(i)throw new bM(i)}},e.prototype.add=function(t){var r;if(t&&t!==this)if(this.closed)SM(t);else{if(t instanceof e){if(t.closed||t._hasParent(this))return;t._addParent(this)}(this._finalizers=null!==(r=this._finalizers)&&void 0!==r?r:[]).push(t)}},e.prototype._hasParent=function(e){var t=this._parentage;return t===e||Array.isArray(t)&&t.includes(e)},e.prototype._addParent=function(e){var t=this._parentage;this._parentage=Array.isArray(t)?(t.push(e),t):t?[t,e]:e},e.prototype._removeParent=function(e){var t=this._parentage;t===e?this._parentage=null:Array.isArray(t)&&vM(t,e)},e.prototype.remove=function(t){var r=this._finalizers;r&&vM(r,t),t instanceof e&&t._removeParent(this)},e.EMPTY=function(){var t=new e;return t.closed=!0,t}(),e}(),xM=wM.EMPTY;function kM(e){return e instanceof wM||e&&"closed"in e&&gM(e.remove)&&gM(e.add)&&gM(e.unsubscribe)}function SM(e){gM(e)?e():e.unsubscribe()}var EM={onUnhandledError:null,onStoppedNotification:null,Promise:void 0,useDeprecatedSynchronousErrorHandling:!1,useDeprecatedNextContext:!1},AM={setTimeout:function(e,t){for(var r=[],n=2;n<arguments.length;n++)r[n-2]=arguments[n];var i=AM.delegate;return(null==i?void 0:i.setTimeout)?i.setTimeout.apply(i,q([e,t],_(r))):setTimeout.apply(void 0,q([e,t],_(r)))},clearTimeout:function(e){var t=AM.delegate;return((null==t?void 0:t.clearTimeout)||clearTimeout)(e)},delegate:void 0};function NM(e){AM.setTimeout((function(){var t=EM.onUnhandledError;if(!t)throw e;t(e)}))}function TM(){}var PM=MM("C",void 0,void 0);function MM(e,t,r){return{kind:e,value:t,error:r}}var IM=null;function CM(e){if(EM.useDeprecatedSynchronousErrorHandling){var t=!IM;if(t&&(IM={errorThrown:!1,error:null}),e(),t){var r=IM,n=r.errorThrown,i=r.error;if(IM=null,n)throw i}}else e()}var RM=function(e){function t(t){var r=e.call(this)||this;return r.isStopped=!1,t?(r.destination=t,kM(t)&&t.add(r)):r.destination=qM,r}return O(t,e),t.create=function(e,t,r){return new zM(e,t,r)},t.prototype.next=function(e){this.isStopped?_M(function(e){return MM("N",e,void 0)}(e),this):this._next(e)},t.prototype.error=function(e){this.isStopped?_M(MM("E",void 0,e),this):(this.isStopped=!0,this._error(e))},t.prototype.complete=function(){this.isStopped?_M(PM,this):(this.isStopped=!0,this._complete())},t.prototype.unsubscribe=function(){this.closed||(this.isStopped=!0,e.prototype.unsubscribe.call(this),this.destination=null)},t.prototype._next=function(e){this.destination.next(e)},t.prototype._error=function(e){try{this.destination.error(e)}finally{this.unsubscribe()}},t.prototype._complete=function(){try{this.destination.complete()}finally{this.unsubscribe()}},t}(wM),BM=Function.prototype.bind;function OM(e,t){return BM.call(e,t)}var LM=function(){function e(e){this.partialObserver=e}return e.prototype.next=function(e){var t=this.partialObserver;if(t.next)try{t.next(e)}catch(h2){UM(h2)}},e.prototype.error=function(e){var t=this.partialObserver;if(t.error)try{t.error(e)}catch(h2){UM(h2)}else UM(e)},e.prototype.complete=function(){var e=this.partialObserver;if(e.complete)try{e.complete()}catch(h2){UM(h2)}},e}(),zM=function(e){function t(t,r,n){var i,o,s=e.call(this)||this;gM(t)||!t?i={next:null!=t?t:void 0,error:null!=r?r:void 0,complete:null!=n?n:void 0}:s&&EM.useDeprecatedNextContext?((o=Object.create(t)).unsubscribe=function(){return s.unsubscribe()},i={next:t.next&&OM(t.next,o),error:t.error&&OM(t.error,o),complete:t.complete&&OM(t.complete,o)}):i=t;return s.destination=new LM(i),s}return O(t,e),t}(RM);function UM(e){var t;EM.useDeprecatedSynchronousErrorHandling?(t=e,EM.useDeprecatedSynchronousErrorHandling&&IM&&(IM.errorThrown=!0,IM.error=t)):NM(e)}function _M(e,t){var r=EM.onStoppedNotification;r&&AM.setTimeout((function(){return r(e,t)}))}var qM={closed:!0,next:TM,error:function(e){throw e},complete:TM},DM="function"==typeof Symbol&&Symbol.observable||"@@observable";function VM(e){return e}function jM(e){return 0===e.length?VM:1===e.length?e[0]:function(t){return e.reduce((function(e,t){return t(e)}),t)}}var FM=function(){function e(e){e&&(this._subscribe=e)}return e.prototype.lift=function(t){var r=new e;return r.source=this,r.operator=t,r},e.prototype.subscribe=function(e,t,r){var n,i=this,o=(n=e)&&n instanceof RM||function(e){return e&&gM(e.next)&&gM(e.error)&&gM(e.complete)}(n)&&kM(n)?e:new zM(e,t,r);return CM((function(){var e=i,t=e.operator,r=e.source;o.add(t?t.call(o,r):r?i._subscribe(o):i._trySubscribe(o))})),o},e.prototype._trySubscribe=function(e){try{return this._subscribe(e)}catch(t){e.error(t)}},e.prototype.forEach=function(e,t){var r=this;return new(t=HM(t))((function(t,n){var i=new zM({next:function(t){try{e(t)}catch(r){n(r),i.unsubscribe()}},error:n,complete:t});r.subscribe(i)}))},e.prototype._subscribe=function(e){var t;return null===(t=this.source)||void 0===t?void 0:t.subscribe(e)},e.prototype[DM]=function(){return this},e.prototype.pipe=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return jM(e)(this)},e.prototype.toPromise=function(e){var t=this;return new(e=HM(e))((function(e,r){var n;t.subscribe((function(e){return n=e}),(function(e){return r(e)}),(function(){return e(n)}))}))},e.create=function(t){return new e(t)},e}();function HM(e){var t;return null!==(t=null!=e?e:EM.Promise)&&void 0!==t?t:Promise}function WM(e){return gM(null==e?void 0:e.lift)}function KM(e){return function(t){if(WM(t))return t.lift((function(t){try{return e(t,this)}catch(r){this.error(r)}}));throw new TypeError("Unable to lift unknown Observable type")}}function XM(e,t,r,n,i){return new GM(e,t,r,n,i)}var GM=function(e){function t(t,r,n,i,o,s){var a=e.call(this,t)||this;return a.onFinalize=o,a.shouldUnsubscribe=s,a._next=r?function(e){try{r(e)}catch(n){t.error(n)}}:e.prototype._next,a._error=i?function(e){try{i(e)}catch(e){t.error(e)}finally{this.unsubscribe()}}:e.prototype._error,a._complete=n?function(){try{n()}catch(e){t.error(e)}finally{this.unsubscribe()}}:e.prototype._complete,a}return O(t,e),t.prototype.unsubscribe=function(){var t;if(!this.shouldUnsubscribe||this.shouldUnsubscribe()){var r=this.closed;e.prototype.unsubscribe.call(this),!r&&(null===(t=this.onFinalize)||void 0===t||t.call(this))}},t}(RM);function ZM(){return KM((function(e,t){var r=null;e._refCount++;var n=XM(t,void 0,void 0,void 0,(function(){if(!e||e._refCount<=0||0<--e._refCount)r=null;else{var n=e._connection,i=r;r=null,!n||i&&n!==i||n.unsubscribe(),t.unsubscribe()}}));e.subscribe(n),n.closed||(r=e.connect())}))}var JM=function(e){function t(t,r){var n=e.call(this)||this;return n.source=t,n.subjectFactory=r,n._subject=null,n._refCount=0,n._connection=null,WM(t)&&(n.lift=t.lift),n}return O(t,e),t.prototype._subscribe=function(e){return this.getSubject().subscribe(e)},t.prototype.getSubject=function(){var e=this._subject;return e&&!e.isStopped||(this._subject=this.subjectFactory()),this._subject},t.prototype._teardown=function(){this._refCount=0;var e=this._connection;this._subject=this._connection=null,null==e||e.unsubscribe()},t.prototype.connect=function(){var e=this,t=this._connection;if(!t){t=this._connection=new wM;var r=this.getSubject();t.add(this.source.subscribe(XM(r,void 0,(function(){e._teardown(),r.complete()}),(function(t){e._teardown(),r.error(t)}),(function(){return e._teardown()})))),t.closed&&(this._connection=null,t=wM.EMPTY)}return t},t.prototype.refCount=function(){return ZM()(this)},t}(FM),YM={now:function(){return(YM.delegate||performance).now()},delegate:void 0},QM={schedule:function(e){var t=requestAnimationFrame,r=cancelAnimationFrame,n=QM.delegate;n&&(t=n.requestAnimationFrame,r=n.cancelAnimationFrame);var i=t((function(t){r=void 0,e(t)}));return new wM((function(){return null==r?void 0:r(i)}))},requestAnimationFrame:function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var r=QM.delegate;return((null==r?void 0:r.requestAnimationFrame)||requestAnimationFrame).apply(void 0,q([],_(e)))},cancelAnimationFrame:function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var r=QM.delegate;return((null==r?void 0:r.cancelAnimationFrame)||cancelAnimationFrame).apply(void 0,q([],_(e)))},delegate:void 0};function $M(e){var t=QM.schedule;return new FM((function(r){var n=new wM,i=e||YM,o=i.now(),s=function(a){var c=i.now();r.next({timestamp:e?c:a,elapsed:c-o}),r.closed||n.add(t(s))};return n.add(t(s)),n}))}$M();var eI,tI=yM((function(e){return function(){e(this),this.name="ObjectUnsubscribedError",this.message="object unsubscribed"}})),rI=function(e){function t(){var t=e.call(this)||this;return t.closed=!1,t.currentObservers=null,t.observers=[],t.isStopped=!1,t.hasError=!1,t.thrownError=null,t}return O(t,e),t.prototype.lift=function(e){var t=new nI(this,this);return t.operator=e,t},t.prototype._throwIfClosed=function(){if(this.closed)throw new tI},t.prototype.next=function(e){var t=this;CM((function(){var r,n;if(t._throwIfClosed(),!t.isStopped){t.currentObservers||(t.currentObservers=Array.from(t.observers));try{for(var i=U(t.currentObservers),o=i.next();!o.done;o=i.next()){o.value.next(e)}}catch(s){r={error:s}}finally{try{o&&!o.done&&(n=i.return)&&n.call(i)}finally{if(r)throw r.error}}}}))},t.prototype.error=function(e){var t=this;CM((function(){if(t._throwIfClosed(),!t.isStopped){t.hasError=t.isStopped=!0,t.thrownError=e;for(var r=t.observers;r.length;)r.shift().error(e)}}))},t.prototype.complete=function(){var e=this;CM((function(){if(e._throwIfClosed(),!e.isStopped){e.isStopped=!0;for(var t=e.observers;t.length;)t.shift().complete()}}))},t.prototype.unsubscribe=function(){this.isStopped=this.closed=!0,this.observers=this.currentObservers=null},Object.defineProperty(t.prototype,"observed",{get:function(){var e;return(null===(e=this.observers)||void 0===e?void 0:e.length)>0},enumerable:!1,configurable:!0}),t.prototype._trySubscribe=function(t){return this._throwIfClosed(),e.prototype._trySubscribe.call(this,t)},t.prototype._subscribe=function(e){return this._throwIfClosed(),this._checkFinalizedStatuses(e),this._innerSubscribe(e)},t.prototype._innerSubscribe=function(e){var t=this,r=this,n=r.hasError,i=r.isStopped,o=r.observers;return n||i?xM:(this.currentObservers=null,o.push(e),new wM((function(){t.currentObservers=null,vM(o,e)})))},t.prototype._checkFinalizedStatuses=function(e){var t=this,r=t.hasError,n=t.thrownError,i=t.isStopped;r?e.error(n):i&&e.complete()},t.prototype.asObservable=function(){var e=new FM;return e.source=this,e},t.create=function(e,t){return new nI(e,t)},t}(FM),nI=function(e){function t(t,r){var n=e.call(this)||this;return n.destination=t,n.source=r,n}return O(t,e),t.prototype.next=function(e){var t,r;null===(r=null===(t=this.destination)||void 0===t?void 0:t.next)||void 0===r||r.call(t,e)},t.prototype.error=function(e){var t,r;null===(r=null===(t=this.destination)||void 0===t?void 0:t.error)||void 0===r||r.call(t,e)},t.prototype.complete=function(){var e,t;null===(t=null===(e=this.destination)||void 0===e?void 0:e.complete)||void 0===t||t.call(e)},t.prototype._subscribe=function(e){var t,r;return null!==(r=null===(t=this.source)||void 0===t?void 0:t.subscribe(e))&&void 0!==r?r:xM},t}(rI),iI=(function(e){function t(t){var r=e.call(this)||this;return r._value=t,r}O(t,e),Object.defineProperty(t.prototype,"value",{get:function(){return this.getValue()},enumerable:!1,configurable:!0}),t.prototype._subscribe=function(t){var r=e.prototype._subscribe.call(this,t);return!r.closed&&t.next(this._value),r},t.prototype.getValue=function(){var e=this,t=e.hasError,r=e.thrownError,n=e._value;if(t)throw r;return this._throwIfClosed(),n},t.prototype.next=function(t){e.prototype.next.call(this,this._value=t)}}(rI),{now:function(){return(iI.delegate||Date).now()},delegate:void 0}),oI=function(e){function t(t,r,n){void 0===t&&(t=1/0),void 0===r&&(r=1/0),void 0===n&&(n=iI);var i=e.call(this)||this;return i._bufferSize=t,i._windowTime=r,i._timestampProvider=n,i._buffer=[],i._infiniteTimeWindow=!0,i._infiniteTimeWindow=r===1/0,i._bufferSize=Math.max(1,t),i._windowTime=Math.max(1,r),i}return O(t,e),t.prototype.next=function(t){var r=this,n=r.isStopped,i=r._buffer,o=r._infiniteTimeWindow,s=r._timestampProvider,a=r._windowTime;n||(i.push(t),!o&&i.push(s.now()+a)),this._trimBuffer(),e.prototype.next.call(this,t)},t.prototype._subscribe=function(e){this._throwIfClosed(),this._trimBuffer();for(var t=this._innerSubscribe(e),r=this._infiniteTimeWindow,n=this._buffer.slice(),i=0;i<n.length&&!e.closed;i+=r?1:2)e.next(n[i]);return this._checkFinalizedStatuses(e),t},t.prototype._trimBuffer=function(){var e=this,t=e._bufferSize,r=e._timestampProvider,n=e._buffer,i=e._infiniteTimeWindow,o=(i?1:2)*t;if(t<1/0&&o<n.length&&n.splice(0,n.length-o),!i){for(var s=r.now(),a=0,c=1;c<n.length&&n[c]<=s;c+=2)a=c;a&&n.splice(0,a+1)}},t}(rI),sI=(function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t._value=null,t._hasValue=!1,t._isComplete=!1,t}O(t,e),t.prototype._checkFinalizedStatuses=function(e){var t=this,r=t.hasError,n=t._hasValue,i=t._value,o=t.thrownError,s=t.isStopped,a=t._isComplete;r?e.error(o):(s||a)&&(n&&e.next(i),e.complete())},t.prototype.next=function(e){this.isStopped||(this._value=e,this._hasValue=!0)},t.prototype.complete=function(){var t=this,r=t._hasValue,n=t._value;t._isComplete||(this._isComplete=!0,r&&e.prototype.next.call(this,n),e.prototype.complete.call(this))}}(rI),function(e){function t(t,r){return e.call(this)||this}return O(t,e),t.prototype.schedule=function(e,t){return void 0===t&&(t=0),this},t}(wM)),aI={setInterval:function(e,t){for(var r=[],n=2;n<arguments.length;n++)r[n-2]=arguments[n];var i=aI.delegate;return(null==i?void 0:i.setInterval)?i.setInterval.apply(i,q([e,t],_(r))):setInterval.apply(void 0,q([e,t],_(r)))},clearInterval:function(e){var t=aI.delegate;return((null==t?void 0:t.clearInterval)||clearInterval)(e)},delegate:void 0},cI=function(e){function t(t,r){var n=e.call(this,t,r)||this;return n.scheduler=t,n.work=r,n.pending=!1,n}return O(t,e),t.prototype.schedule=function(e,t){if(void 0===t&&(t=0),this.closed)return this;this.state=e;var r=this.id,n=this.scheduler;return null!=r&&(this.id=this.recycleAsyncId(n,r,t)),this.pending=!0,this.delay=t,this.id=this.id||this.requestAsyncId(n,this.id,t),this},t.prototype.requestAsyncId=function(e,t,r){return void 0===r&&(r=0),aI.setInterval(e.flush.bind(e,this),r)},t.prototype.recycleAsyncId=function(e,t,r){if(void 0===r&&(r=0),null!=r&&this.delay===r&&!1===this.pending)return t;aI.clearInterval(t)},t.prototype.execute=function(e,t){if(this.closed)return new Error("executing a cancelled action");this.pending=!1;var r=this._execute(e,t);if(r)return r;!1===this.pending&&null!=this.id&&(this.id=this.recycleAsyncId(this.scheduler,this.id,null))},t.prototype._execute=function(e,t){var r,n=!1;try{this.work(e)}catch(i){n=!0,r=i||new Error("Scheduled action threw falsy error")}if(n)return this.unsubscribe(),r},t.prototype.unsubscribe=function(){if(!this.closed){var t=this.id,r=this.scheduler,n=r.actions;this.work=this.state=this.scheduler=null,this.pending=!1,vM(n,this),null!=t&&(this.id=this.recycleAsyncId(r,t,null)),this.delay=null,e.prototype.unsubscribe.call(this)}},t}(sI),uI=1,lI={};function hI(e){return e in lI&&(delete lI[e],!0)}var dI=function(e){var t=uI++;return lI[t]=!0,eI||(eI=Promise.resolve()),eI.then((function(){return hI(t)&&e()})),t},fI=function(e){hI(e)},pI={setImmediate:function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var r=pI.delegate;return((null==r?void 0:r.setImmediate)||dI).apply(void 0,q([],_(e)))},clearImmediate:function(e){var t=pI.delegate;return((null==t?void 0:t.clearImmediate)||fI)(e)},delegate:void 0},mI=function(e){function t(t,r){var n=e.call(this,t,r)||this;return n.scheduler=t,n.work=r,n}return O(t,e),t.prototype.requestAsyncId=function(t,r,n){return void 0===n&&(n=0),null!==n&&n>0?e.prototype.requestAsyncId.call(this,t,r,n):(t.actions.push(this),t._scheduled||(t._scheduled=pI.setImmediate(t.flush.bind(t,void 0))))},t.prototype.recycleAsyncId=function(t,r,n){if(void 0===n&&(n=0),null!=n&&n>0||null==n&&this.delay>0)return e.prototype.recycleAsyncId.call(this,t,r,n);t.actions.some((function(e){return e.id===r}))||(pI.clearImmediate(r),t._scheduled=void 0)},t}(cI),gI=function(){function e(t,r){void 0===r&&(r=e.now),this.schedulerActionCtor=t,this.now=r}return e.prototype.schedule=function(e,t,r){return void 0===t&&(t=0),new this.schedulerActionCtor(this,e).schedule(r,t)},e.now=iI.now,e}(),yI=function(e){function t(t,r){void 0===r&&(r=gI.now);var n=e.call(this,t,r)||this;return n.actions=[],n._active=!1,n._scheduled=void 0,n}return O(t,e),t.prototype.flush=function(e){var t=this.actions;if(this._active)t.push(e);else{var r;this._active=!0;do{if(r=e.execute(e.state,e.delay))break}while(e=t.shift());if(this._active=!1,r){for(;e=t.shift();)e.unsubscribe();throw r}}},t}(gI),bI=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return O(t,e),t.prototype.flush=function(e){this._active=!0;var t=this._scheduled;this._scheduled=void 0;var r,n=this.actions;e=e||n.shift();do{if(r=e.execute(e.state,e.delay))break}while((e=n[0])&&e.id===t&&n.shift());if(this._active=!1,r){for(;(e=n[0])&&e.id===t&&n.shift();)e.unsubscribe();throw r}},t}(yI),vI=new bI(mI),wI=(new yI(cI),function(e){function t(t,r){var n=e.call(this,t,r)||this;return n.scheduler=t,n.work=r,n}return O(t,e),t.prototype.schedule=function(t,r){return void 0===r&&(r=0),r>0?e.prototype.schedule.call(this,t,r):(this.delay=r,this.state=t,this.scheduler.flush(this),this)},t.prototype.execute=function(t,r){return r>0||this.closed?e.prototype.execute.call(this,t,r):this._execute(t,r)},t.prototype.requestAsyncId=function(t,r,n){return void 0===n&&(n=0),null!=n&&n>0||null==n&&this.delay>0?e.prototype.requestAsyncId.call(this,t,r,n):t.flush(this)},t}(cI)),xI=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return O(t,e),t}(yI),kI=(new xI(wI),function(e){function t(t,r){var n=e.call(this,t,r)||this;return n.scheduler=t,n.work=r,n}return O(t,e),t.prototype.requestAsyncId=function(t,r,n){return void 0===n&&(n=0),null!==n&&n>0?e.prototype.requestAsyncId.call(this,t,r,n):(t.actions.push(this),t._scheduled||(t._scheduled=QM.requestAnimationFrame((function(){return t.flush(void 0)}))))},t.prototype.recycleAsyncId=function(t,r,n){if(void 0===n&&(n=0),null!=n&&n>0||null==n&&this.delay>0)return e.prototype.recycleAsyncId.call(this,t,r,n);t.actions.some((function(e){return e.id===r}))||(QM.cancelAnimationFrame(r),t._scheduled=void 0)},t}(cI)),SI=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return O(t,e),t.prototype.flush=function(e){this._active=!0;var t=this._scheduled;this._scheduled=void 0;var r,n=this.actions;e=e||n.shift();do{if(r=e.execute(e.state,e.delay))break}while((e=n[0])&&e.id===t&&n.shift());if(this._active=!1,r){for(;(e=n[0])&&e.id===t&&n.shift();)e.unsubscribe();throw r}},t}(yI),EI=(new SI(kI),function(e){function t(t,r){void 0===t&&(t=EI),void 0===r&&(r=1/0);var n=e.call(this,t,(function(){return n.frame}))||this;return n.maxFrames=r,n.frame=0,n.index=-1,n}O(t,e),t.prototype.flush=function(){for(var e,t,r=this.actions,n=this.maxFrames;(t=r[0])&&t.delay<=n&&(r.shift(),this.frame=t.delay,!(e=t.execute(t.state,t.delay))););if(e){for(;t=r.shift();)t.unsubscribe();throw e}},t.frameTimeFactor=10}(yI),function(e){function t(t,r,n){void 0===n&&(n=t.index+=1);var i=e.call(this,t,r)||this;return i.scheduler=t,i.work=r,i.index=n,i.active=!0,i.index=t.index=n,i}return O(t,e),t.prototype.schedule=function(r,n){if(void 0===n&&(n=0),Number.isFinite(n)){if(!this.id)return e.prototype.schedule.call(this,r,n);this.active=!1;var i=new t(this.scheduler,this.work);return this.add(i),i.schedule(r,n)}return wM.EMPTY},t.prototype.requestAsyncId=function(e,r,n){void 0===n&&(n=0),this.delay=e.frame+n;var i=e.actions;return i.push(this),i.sort(t.sortActions),!0},t.prototype.recycleAsyncId=function(e,t,r){void 0===r&&(r=0)},t.prototype._execute=function(t,r){if(!0===this.active)return e.prototype._execute.call(this,t,r)},t.sortActions=function(e,t){return e.delay===t.delay?e.index===t.index?0:e.index>t.index?1:-1:e.delay>t.delay?1:-1},t}(cI)),AI=new FM((function(e){return e.complete()}));function NI(e){return e[e.length-1]}function TI(e){return(t=NI(e))&&gM(t.schedule)?e.pop():void 0;var t}var PI=function(e){return e&&"number"==typeof e.length&&"function"!=typeof e};function MI(e){return gM(null==e?void 0:e.then)}function II(e){return gM(e[DM])}function CI(e){return Symbol.asyncIterator&&gM(null==e?void 0:e[Symbol.asyncIterator])}function RI(e){return new TypeError("You provided "+(null!==e&&"object"==typeof e?"an invalid object":"'"+e+"'")+" where a stream was expected. You can provide an Observable, Promise, ReadableStream, Array, AsyncIterable, or Iterable.")}var BI,OI="function"==typeof Symbol&&Symbol.iterator?Symbol.iterator:"@@iterator";function LI(e){return gM(null==e?void 0:e[OI])}function zI(e){return V(this,arguments,(function(){var t,r,n;return z(this,(function(i){switch(i.label){case 0:t=e.getReader(),i.label=1;case 1:i.trys.push([1,,9,10]),i.label=2;case 2:return[4,D(t.read())];case 3:return r=i.sent(),n=r.value,r.done?[4,D(void 0)]:[3,5];case 4:return[2,i.sent()];case 5:return[4,D(n)];case 6:return[4,i.sent()];case 7:return i.sent(),[3,2];case 8:return[3,10];case 9:return t.releaseLock(),[7];case 10:return[2]}}))}))}function UI(e){return gM(null==e?void 0:e.getReader)}function _I(e){if(e instanceof FM)return e;if(null!=e){if(II(e))return n=e,new FM((function(e){var t=n[DM]();if(gM(t.subscribe))return t.subscribe(e);throw new TypeError("Provided object does not correctly implement Symbol.observable")}));if(PI(e))return function(e){return new FM((function(t){for(var r=0;r<e.length&&!t.closed;r++)t.next(e[r]);t.complete()}))}(e);if(MI(e))return r=e,new FM((function(e){r.then((function(t){e.closed||(e.next(t),e.complete())}),(function(t){return e.error(t)})).then(null,NM)}));if(CI(e))return qI(e);if(LI(e))return t=e,new FM((function(e){var r,n;try{for(var i=U(t),o=i.next();!o.done;o=i.next()){var s=o.value;if(e.next(s),e.closed)return}}catch(a){r={error:a}}finally{try{o&&!o.done&&(n=i.return)&&n.call(i)}finally{if(r)throw r.error}}e.complete()}));if(UI(e))return qI(zI(e))}var t,r,n;throw RI(e)}function qI(e){return new FM((function(t){(function(e,t){var r,n,i,o;return L(this,void 0,void 0,(function(){var s,a;return z(this,(function(c){switch(c.label){case 0:c.trys.push([0,5,6,11]),r=j(e),c.label=1;case 1:return[4,r.next()];case 2:if((n=c.sent()).done)return[3,4];if(s=n.value,t.next(s),t.closed)return[2];c.label=3;case 3:return[3,1];case 4:return[3,11];case 5:return a=c.sent(),i={error:a},[3,11];case 6:return c.trys.push([6,,9,10]),n&&!n.done&&(o=r.return)?[4,o.call(r)]:[3,8];case 7:c.sent(),c.label=8;case 8:return[3,10];case 9:if(i)throw i.error;return[7];case 10:return[7];case 11:return t.complete(),[2]}}))}))})(e,t).catch((function(e){return t.error(e)}))}))}function DI(e,t,r,n,i){void 0===n&&(n=0),void 0===i&&(i=!1);var o=t.schedule((function(){r(),i?e.add(this.schedule(null,n)):this.unsubscribe()}),n);if(e.add(o),!i)return o}function VI(e,t){return void 0===t&&(t=0),KM((function(r,n){r.subscribe(XM(n,(function(r){return DI(n,e,(function(){return n.next(r)}),t)}),(function(){return DI(n,e,(function(){return n.complete()}),t)}),(function(r){return DI(n,e,(function(){return n.error(r)}),t)})))}))}function jI(e,t){return void 0===t&&(t=0),KM((function(r,n){n.add(e.schedule((function(){return r.subscribe(n)}),t))}))}function FI(e,t){if(!e)throw new Error("Iterable cannot be null");return new FM((function(r){DI(r,t,(function(){var n=e[Symbol.asyncIterator]();DI(r,t,(function(){n.next().then((function(e){e.done?r.complete():r.next(e.value)}))}),0,!0)}))}))}function HI(e,t){if(null!=e){if(II(e))return function(e,t){return _I(e).pipe(jI(t),VI(t))}(e,t);if(PI(e))return function(e,t){return new FM((function(r){var n=0;return t.schedule((function(){n===e.length?r.complete():(r.next(e[n++]),r.closed||this.schedule())}))}))}(e,t);if(MI(e))return function(e,t){return _I(e).pipe(jI(t),VI(t))}(e,t);if(CI(e))return FI(e,t);if(LI(e))return function(e,t){return new FM((function(r){var n;return DI(r,t,(function(){n=e[OI](),DI(r,t,(function(){var e,t,i;try{t=(e=n.next()).value,i=e.done}catch(o){return void r.error(o)}i?r.complete():r.next(t)}),0,!0)})),function(){return gM(null==n?void 0:n.return)&&n.return()}}))}(e,t);if(UI(e))return function(e,t){return FI(zI(e),t)}(e,t)}throw RI(e)}function WI(e,t){return t?HI(e,t):_I(e)}!function(e){e.NEXT="N",e.ERROR="E",e.COMPLETE="C"}(BI||(BI={}));!function(){function e(e,t,r){this.kind=e,this.value=t,this.error=r,this.hasValue="N"===e}e.prototype.observe=function(e){return function(e,t){var r,n,i,o=e,s=o.kind,a=o.value,c=o.error;if("string"!=typeof s)throw new TypeError('Invalid notification, missing "kind"');"N"===s?null===(r=t.next)||void 0===r||r.call(t,a):"E"===s?null===(n=t.error)||void 0===n||n.call(t,c):null===(i=t.complete)||void 0===i||i.call(t)}(this,e)},e.prototype.do=function(e,t,r){var n=this,i=n.kind,o=n.value,s=n.error;return"N"===i?null==e?void 0:e(o):"E"===i?null==t?void 0:t(s):null==r?void 0:r()},e.prototype.accept=function(e,t,r){var n;return gM(null===(n=e)||void 0===n?void 0:n.next)?this.observe(e):this.do(e,t,r)},e.prototype.toObservable=function(){var e=this,t=e.kind,r=e.value,n=e.error,i="N"===t?function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var r=TI(e);return WI(e,r)}(r):"E"===t?function(e,t){var r=gM(e)?e:function(){return e},n=function(e){return e.error(r())};return new FM(t?function(e){return t.schedule(n,0,e)}:n)}((function(){return n})):"C"===t?AI:0;if(!i)throw new TypeError("Unexpected notification kind "+t);return i},e.createNext=function(t){return new e("N",t)},e.createError=function(t){return new e("E",void 0,t)},e.createComplete=function(){return e.completeNotification},e.completeNotification=new e("C")}();yM((function(e){return function(){e(this),this.name="EmptyError",this.message="no elements in sequence"}}));yM((function(e){return function(){e(this),this.name="ArgumentOutOfRangeError",this.message="argument out of range"}})),yM((function(e){return function(t){e(this),this.name="NotFoundError",this.message=t}})),yM((function(e){return function(t){e(this),this.name="SequenceError",this.message=t}}));yM((function(e){return function(t){void 0===t&&(t=null),e(this),this.message="Timeout has occurred",this.name="TimeoutError",this.info=t}}));Array.isArray;Array.isArray,Object.getPrototypeOf,Object.prototype,Object.keys;new FM(TM);Array.isArray;function KI(e){return KM((function(t,r){var n,i=null,o=!1;i=t.subscribe(XM(r,void 0,void 0,(function(s){n=_I(e(s,KI(e)(t))),i?(i.unsubscribe(),i=null,n.subscribe(r)):o=!0}))),o&&(i.unsubscribe(),i=null,n.subscribe(r))}))}var XI={connector:function(){return new rI}};function GI(e,t){void 0===t&&(t=XI);var r=t.connector;return KM((function(t,n){var i,o=r();WI(e((i=o,new FM((function(e){return i.subscribe(e)}))))).subscribe(n),n.add(t.subscribe(o))}))}function ZI(e,t){return e===t}function JI(e,t,r,n){r&&!gM(r)&&(n=r);var i=gM(r)?r:void 0;return function(r){return function(e,t){var r=gM(e)?e:function(){return e};return gM(t)?GI(t,{connector:r}):function(e){return new JM(e,r)}}(new oI(e,t,n),i)(r)}}const YI={name:"@polkadot/types-codec",path:new URL("file:///Users/dev-fazio/Nicolas%20Fazio/repos/test/cryptobtnwrapper/node_modules/@polkadot/types-codec/packageInfo.js").pathname.substring(0,new URL("file:///Users/dev-fazio/Nicolas%20Fazio/repos/test/cryptobtnwrapper/node_modules/@polkadot/types-codec/packageInfo.js").pathname.lastIndexOf("/")+1),type:"esm",version:"8.4.2"},QI={name:"@polkadot/types-create",path:new URL("file:///Users/dev-fazio/Nicolas%20Fazio/repos/test/cryptobtnwrapper/node_modules/@polkadot/types-create/packageInfo.js").pathname.substring(0,new URL("file:///Users/dev-fazio/Nicolas%20Fazio/repos/test/cryptobtnwrapper/node_modules/@polkadot/types-create/packageInfo.js").pathname.lastIndexOf("/")+1),type:"esm",version:"8.4.2"};Em(_y,null,[YI,QI]);const $I={ErrorMetadataV11:"ErrorMetadataV10",EventMetadataV11:"EventMetadataV10",ExtrinsicMetadataV11:{version:"u8",signedExtensions:"Vec<Text>"},FunctionArgumentMetadataV11:"FunctionArgumentMetadataV10",FunctionMetadataV11:"FunctionMetadataV10",MetadataV11:{modules:"Vec<ModuleMetadataV11>",extrinsic:"ExtrinsicMetadataV11"},ModuleConstantMetadataV11:"ModuleConstantMetadataV10",ModuleMetadataV11:{name:"Text",storage:"Option<StorageMetadataV11>",calls:"Option<Vec<FunctionMetadataV11>>",events:"Option<Vec<EventMetadataV11>>",constants:"Vec<ModuleConstantMetadataV11>",errors:"Vec<ErrorMetadataV11>"},StorageEntryModifierV11:"StorageEntryModifierV10",StorageEntryMetadataV11:{name:"Text",modifier:"StorageEntryModifierV11",type:"StorageEntryTypeV11",fallback:"Bytes",docs:"Vec<Text>"},StorageEntryTypeV11:{_enum:{Plain:"Type",Map:{hasher:"StorageHasherV11",key:"Type",value:"Type",linked:"bool"},DoubleMap:{hasher:"StorageHasherV11",key1:"Type",key2:"Type",value:"Type",key2Hasher:"StorageHasherV11"}}},StorageMetadataV11:{prefix:"Text",items:"Vec<StorageEntryMetadataV11>"},StorageHasherV11:{_enum:{Blake2_128:null,Blake2_256:null,Blake2_128Concat:null,Twox128:null,Twox256:null,Twox64Concat:null,Identity:null}}},eC={name:"Text",fields:"Vec<Si1Field>",index:"u8",docs:"Vec<Text>"},tC={Si1Field:{name:"Option<Text>",type:"Si1LookupTypeId",typeName:"Option<Text>",docs:"Vec<Text>"},Si1LookupTypeId:"Compact<u32>",Si1Path:"Si0Path",Si1Type:{path:"Si1Path",params:"Vec<Si1TypeParameter>",def:"Si1TypeDef",docs:"Vec<Text>"},Si1TypeDef:{_enum:{Composite:"Si1TypeDefComposite",Variant:"Si1TypeDefVariant",Sequence:"Si1TypeDefSequence",Array:"Si1TypeDefArray",Tuple:"Si1TypeDefTuple",Primitive:"Si1TypeDefPrimitive",Compact:"Si1TypeDefCompact",BitSequence:"Si1TypeDefBitSequence",HistoricMetaCompat:"Type"}},Si1TypeDefArray:{len:"u32",type:"Si1LookupTypeId"},Si1TypeDefBitSequence:{bitStoreType:"Si1LookupTypeId",bitOrderType:"Si1LookupTypeId"},Si1TypeDefCompact:{type:"Si1LookupTypeId"},Si1TypeDefComposite:{fields:"Vec<Si1Field>"},Si1TypeDefPrimitive:"Si0TypeDefPrimitive",Si1TypeDefSequence:{type:"Si1LookupTypeId"},Si1TypeDefTuple:"Vec<Si1LookupTypeId>",Si1TypeParameter:{name:"Text",type:"Option<Si1LookupTypeId>"},Si1TypeDefVariant:{variants:"Vec<Si1Variant>"},Si1Variant:eC},rC={PortableTypeV14:{id:"Si1LookupTypeId",type:"Si1Type"},ErrorMetadataV14:Im({},eC,{args:"Vec<Type>"}),EventMetadataV14:Im({},eC,{args:"Vec<Type>"}),FunctionArgumentMetadataV14:{name:"Text",type:"Type",typeName:"Option<Type>"},FunctionMetadataV14:Im({},eC,{args:"Vec<FunctionArgumentMetadataV14>"}),ExtrinsicMetadataV14:{type:"SiLookupTypeId",version:"u8",signedExtensions:"Vec<SignedExtensionMetadataV14>"},MetadataV14:{lookup:"PortableRegistry",pallets:"Vec<PalletMetadataV14>",extrinsic:"ExtrinsicMetadataV14",type:"SiLookupTypeId"},PalletCallMetadataV14:{type:"SiLookupTypeId"},PalletConstantMetadataV14:{name:"Text",type:"SiLookupTypeId",value:"Bytes",docs:"Vec<Text>"},PalletErrorMetadataV14:{type:"SiLookupTypeId"},PalletEventMetadataV14:{type:"SiLookupTypeId"},PalletMetadataV14:{name:"Text",storage:"Option<PalletStorageMetadataV14>",calls:"Option<PalletCallMetadataV14>",events:"Option<PalletEventMetadataV14>",constants:"Vec<PalletConstantMetadataV14>",errors:"Option<PalletErrorMetadataV14>",index:"u8"},PalletStorageMetadataV14:{prefix:"Text",items:"Vec<StorageEntryMetadataV14>"},SignedExtensionMetadataV14:{identifier:"Text",type:"SiLookupTypeId",additionalSigned:"SiLookupTypeId"},StorageEntryMetadataV14:{name:"Text",modifier:"StorageEntryModifierV14",type:"StorageEntryTypeV14",fallback:"Bytes",docs:"Vec<Text>"},StorageEntryModifierV14:"StorageEntryModifierV13",StorageEntryTypeV14:{_enum:{Plain:"SiLookupTypeId",Map:{hashers:"Vec<StorageHasherV14>",key:"SiLookupTypeId",value:"SiLookupTypeId"}}},StorageHasherV14:"StorageHasherV13"},nC={rpc:{},types:Im({},{ErrorMetadataV9:{name:"Text",docs:"Vec<Text>"},EventMetadataV9:{name:"Text",args:"Vec<Type>",docs:"Vec<Text>"},FunctionArgumentMetadataV9:{name:"Text",type:"Type"},FunctionMetadataV9:{name:"Text",args:"Vec<FunctionArgumentMetadataV9>",docs:"Vec<Text>"},MetadataV9:{modules:"Vec<ModuleMetadataV9>"},ModuleConstantMetadataV9:{name:"Text",type:"Type",value:"Bytes",docs:"Vec<Text>"},ModuleMetadataV9:{name:"Text",storage:"Option<StorageMetadataV9>",calls:"Option<Vec<FunctionMetadataV9>>",events:"Option<Vec<EventMetadataV9>>",constants:"Vec<ModuleConstantMetadataV9>",errors:"Vec<ErrorMetadataV9>"},StorageEntryMetadataV9:{name:"Text",modifier:"StorageEntryModifierV9",type:"StorageEntryTypeV9",fallback:"Bytes",docs:"Vec<Text>"},StorageEntryModifierV9:{_enum:["Optional","Default","Required"]},StorageEntryTypeV9:{_enum:{Plain:"Type",Map:{hasher:"StorageHasherV9",key:"Type",value:"Type",linked:"bool"},DoubleMap:{hasher:"StorageHasherV9",key1:"Type",key2:"Type",value:"Type",key2Hasher:"StorageHasherV9"}}},StorageHasherV9:{_enum:{Blake2_128:null,Blake2_256:null,Twox128:null,Twox256:null,Twox64Concat:null}},StorageMetadataV9:{prefix:"Text",items:"Vec<StorageEntryMetadataV9>"}},{ErrorMetadataV10:"ErrorMetadataV9",EventMetadataV10:"EventMetadataV9",FunctionArgumentMetadataV10:"FunctionArgumentMetadataV9",FunctionMetadataV10:"FunctionMetadataV9",MetadataV10:{modules:"Vec<ModuleMetadataV10>"},ModuleConstantMetadataV10:"ModuleConstantMetadataV9",ModuleMetadataV10:{name:"Text",storage:"Option<StorageMetadataV10>",calls:"Option<Vec<FunctionMetadataV10>>",events:"Option<Vec<EventMetadataV10>>",constants:"Vec<ModuleConstantMetadataV10>",errors:"Vec<ErrorMetadataV10>"},StorageEntryModifierV10:"StorageEntryModifierV9",StorageEntryMetadataV10:{name:"Text",modifier:"StorageEntryModifierV10",type:"StorageEntryTypeV10",fallback:"Bytes",docs:"Vec<Text>"},StorageEntryTypeV10:{_enum:{Plain:"Type",Map:{hasher:"StorageHasherV10",key:"Type",value:"Type",linked:"bool"},DoubleMap:{hasher:"StorageHasherV10",key1:"Type",key2:"Type",value:"Type",key2Hasher:"StorageHasherV10"}}},StorageMetadataV10:{prefix:"Text",items:"Vec<StorageEntryMetadataV10>"},StorageHasherV10:{_enum:{Blake2_128:null,Blake2_256:null,Blake2_128Concat:null,Twox128:null,Twox256:null,Twox64Concat:null}}},$I,{ErrorMetadataV12:"ErrorMetadataV11",EventMetadataV12:"EventMetadataV11",ExtrinsicMetadataV12:"ExtrinsicMetadataV11",FunctionArgumentMetadataV12:"FunctionArgumentMetadataV11",FunctionMetadataV12:"FunctionMetadataV11",MetadataV12:{modules:"Vec<ModuleMetadataV12>",extrinsic:"ExtrinsicMetadataV12"},ModuleConstantMetadataV12:"ModuleConstantMetadataV11",ModuleMetadataV12:{name:"Text",storage:"Option<StorageMetadataV12>",calls:"Option<Vec<FunctionMetadataV12>>",events:"Option<Vec<EventMetadataV12>>",constants:"Vec<ModuleConstantMetadataV12>",errors:"Vec<ErrorMetadataV12>",index:"u8"},StorageEntryModifierV12:"StorageEntryModifierV11",StorageEntryMetadataV12:"StorageEntryMetadataV11",StorageEntryTypeV12:"StorageEntryTypeV11",StorageMetadataV12:"StorageMetadataV11",StorageHasherV12:"StorageHasherV11"},{ErrorMetadataV13:"ErrorMetadataV12",EventMetadataV13:"EventMetadataV12",ExtrinsicMetadataV13:"ExtrinsicMetadataV12",FunctionArgumentMetadataV13:"FunctionArgumentMetadataV12",FunctionMetadataV13:"FunctionMetadataV12",MetadataV13:{modules:"Vec<ModuleMetadataV13>",extrinsic:"ExtrinsicMetadataV13"},ModuleConstantMetadataV13:"ModuleConstantMetadataV12",ModuleMetadataV13:{name:"Text",storage:"Option<StorageMetadataV13>",calls:"Option<Vec<FunctionMetadataV13>>",events:"Option<Vec<EventMetadataV13>>",constants:"Vec<ModuleConstantMetadataV13>",errors:"Vec<ErrorMetadataV13>",index:"u8"},StorageEntryModifierV13:"StorageEntryModifierV12",StorageEntryMetadataV13:{name:"Text",modifier:"StorageEntryModifierV13",type:"StorageEntryTypeV13",fallback:"Bytes",docs:"Vec<Text>"},StorageEntryTypeV13:{_enum:{Plain:"Type",Map:{hasher:"StorageHasherV13",key:"Type",value:"Type",linked:"bool"},DoubleMap:{hasher:"StorageHasherV13",key1:"Type",key2:"Type",value:"Type",key2Hasher:"StorageHasherV13"},NMap:{keyVec:"Vec<Type>",hashers:"Vec<StorageHasherV13>",value:"Type"}}},StorageMetadataV13:{prefix:"Text",items:"Vec<StorageEntryMetadataV13>"},StorageHasherV13:"StorageHasherV12"},rC,{ErrorMetadataLatest:"ErrorMetadataV14",EventMetadataLatest:"EventMetadataV14",ExtrinsicMetadataLatest:"ExtrinsicMetadataV14",FunctionArgumentMetadataLatest:"FunctionArgumentMetadataV14",FunctionMetadataLatest:"FunctionMetadataV14",MetadataLatest:"MetadataV14",PalletCallMetadataLatest:"PalletCallMetadataV14",PalletConstantMetadataLatest:"PalletConstantMetadataV14",PalletErrorMetadataLatest:"PalletErrorMetadataV14",PalletEventMetadataLatest:"PalletEventMetadataV14",PalletMetadataLatest:"PalletMetadataV14",PalletStorageMetadataLatest:"PalletStorageMetadataV14",PortableType:"PortableTypeV14",SignedExtensionMetadataLatest:"SignedExtensionMetadataV14",StorageEntryMetadataLatest:"StorageEntryMetadataV14",StorageEntryModifierLatest:"StorageEntryModifierV14",StorageEntryTypeLatest:"StorageEntryTypeV14",StorageHasher:"StorageHasherV14",MetadataAll:{_enum:{V0:"DoNotConstruct<MetadataV0>",V1:"DoNotConstruct<MetadataV1>",V2:"DoNotConstruct<MetadataV2>",V3:"DoNotConstruct<MetadataV3>",V4:"DoNotConstruct<MetadataV4>",V5:"DoNotConstruct<MetadataV5>",V6:"DoNotConstruct<MetadataV6>",V7:"DoNotConstruct<MetadataV7>",V8:"DoNotConstruct<MetadataV8>",V9:"MetadataV9",V10:"MetadataV10",V11:"MetadataV11",V12:"MetadataV12",V13:"MetadataV13",V14:"MetadataV14"}}})},iC={Council:"CollectiveOrigin",System:"SystemOrigin",TechnicalCommittee:"CollectiveOrigin",Xcm:"XcmOrigin",XcmPallet:"XcmOrigin",Authority:"AuthorityOrigin",GeneralCouncil:"CollectiveOrigin"},oC={rpc:{},types:Im({},{Fixed64:"Int<64, Fixed64>",FixedI64:"Int<64, FixedI64>",FixedU64:"UInt<64, FixedU64>",Fixed128:"Int<128, Fixed128>",FixedI128:"Int<128, FixedI128>",FixedU128:"UInt<128, FixedU128>",I32F32:"Int<64, I32F32>",U32F32:"UInt<64, U32F32>",PerU16:"UInt<16, PerU16>",Perbill:"UInt<32, Perbill>",Percent:"UInt<8, Percent>",Permill:"UInt<32, Permill>",Perquintill:"UInt<64, Perquintill>"},{AccountId:"AccountId32",AccountId20:"GenericEthereumAccountId",AccountId32:"GenericAccountId",AccountIdOf:"AccountId",AccountIndex:"GenericAccountIndex",Address:"MultiAddress",AssetId:"u32",Balance:"UInt<128, Balance>",BalanceOf:"Balance",Block:"GenericBlock",BlockNumber:"u32",BlockNumberFor:"BlockNumber",BlockNumberOf:"BlockNumber",Call:"GenericCall",CallHash:"Hash",CallHashOf:"CallHash",ChangesTrieConfiguration:{digestInterval:"u32",digestLevels:"u32"},ChangesTrieSignal:{_enum:{NewConfiguration:"Option<ChangesTrieConfiguration>"}},ConsensusEngineId:"GenericConsensusEngineId",CodecHash:"Hash",CrateVersion:{major:"u16",minor:"u8",patch:"u8"},Digest:{logs:"Vec<DigestItem>"},DigestItem:{_enum:{Other:"Bytes",AuthoritiesChange:"Vec<AuthorityId>",ChangesTrieRoot:"Hash",SealV0:"SealV0",Consensus:"Consensus",Seal:"Seal",PreRuntime:"PreRuntime",ChangesTrieSignal:"ChangesTrieSignal",RuntimeEnvironmentUpdated:"Null"}},ExtrinsicsWeight:{normal:"Weight",operational:"Weight"},H32:"[u8; 4; H32]",H64:"[u8; 8; H64]",H128:"[u8; 16; H128]",H160:"[u8; 20; H160]",H256:"[u8; 32; H256]",H512:"[u8; 64; H512]",H1024:"[u8; 128; H1024]",H2048:"[u8; 256; H2048]",Hash:"H256",Header:{parentHash:"Hash",number:"Compact<BlockNumber>",stateRoot:"Hash",extrinsicsRoot:"Hash",digest:"Digest"},HeaderPartial:{parentHash:"Hash",number:"BlockNumber"},IndicesLookupSource:"GenericLookupSource",Index:"u32",Justification:"(ConsensusEngineId, EncodedJustification)",EncodedJustification:"Bytes",Justifications:"Vec<Justification>",KeyValue:"(StorageKey, StorageData)",KeyTypeId:"u32",LockIdentifier:"[u8; 8]",LookupSource:"MultiAddress",LookupTarget:"AccountId",ModuleId:"LockIdentifier",MultiAddress:"GenericMultiAddress",MultiSigner:{_enum:{Ed25519:"[u8; 32]",Sr25519:"[u8; 32]",Ecdsa:"[u8; 33]"}},Moment:"UInt<64, Moment>",OpaqueCall:"Bytes",Origin:"DoNotConstruct<Origin>",OriginCaller:{_enum:{System:"SystemOrigin"}},PalletId:"LockIdentifier",PalletsOrigin:"OriginCaller",PalletVersion:{major:"u16",minor:"u8",patch:"u8"},Pays:{_enum:["Yes","No"]},Phantom:"Null",PhantomData:"Null",Releases:{_enum:["V1","V2","V3","V4","V5","V6","V7","V8","V9","V10"]},RuntimeDbWeight:{read:"Weight",write:"Weight"},SignedBlock:"SignedBlockWithJustifications",SignedBlockWithJustification:{block:"Block",justification:"Option<EncodedJustification>"},SignedBlockWithJustifications:{block:"Block",justifications:"Option<Justifications>"},Slot:"u64",StorageData:"Bytes",StorageProof:{trieNodes:"Vec<Bytes>"},TransactionPriority:"u64",TransactionInfo:{_alias:{dataSize:"size"},chunkRoot:"H256",contentHash:"H256",dataSize:"u32",blockChunks:"u32"},TransactionStorageProof:{chunk:"Vec<u8>",proof:"Vec<Vec<u8>>"},ValidatorId:"AccountId",ValidatorIdOf:"ValidatorId",Weight:"u64",WeightMultiplier:"Fixed64",PreRuntime:"(ConsensusEngineId, Bytes)",SealV0:"(u64, Signature)",Seal:"(ConsensusEngineId, Bytes)",Consensus:"(ConsensusEngineId, Bytes)"})},sC={rpc:{},types:Im({},{Si0Field:{name:"Option<Text>",type:"Si0LookupTypeId",typeName:"Option<Text>",docs:"Vec<Text>"},Si0LookupTypeId:"u32",Si0Path:"Vec<Text>",Si0Type:{path:"Si0Path",params:"Vec<Si0LookupTypeId>",def:"Si0TypeDef"},Si0TypeDef:{_enum:{Composite:"Si0TypeDefComposite",Variant:"Si0TypeDefVariant",Sequence:"Si0TypeDefSequence",Array:"Si0TypeDefArray",Tuple:"Si0TypeDefTuple",Primitive:"Si0TypeDefPrimitive",Compact:"Si0TypeDefCompact",Phantom:"Si0TypeDefPhantom",BitSequence:"Si0TypeDefBitSequence"}},Si0TypeDefArray:{len:"u32",type:"Si0LookupTypeId"},Si0TypeDefBitSequence:{bitStoreType:"Si0LookupTypeId",bitOrderType:"Si0LookupTypeId"},Si0TypeDefCompact:{type:"Si0LookupTypeId"},Si0TypeDefComposite:{fields:"Vec<Si0Field>"},Si0TypeDefPhantom:"Null",Si0TypeDefVariant:{variants:"Vec<Si0Variant>"},Si0TypeDefPrimitive:{_enum:["Bool","Char","Str","U8","U16","U32","U64","U128","U256","I8","I16","I32","I64","I128","I256"]},Si0TypeDefSequence:{type:"Si0LookupTypeId"},Si0TypeDefTuple:"Vec<Si0LookupTypeId>",Si0TypeParameter:{name:"Text",type:"Option<Si0LookupTypeId>"},Si0Variant:{name:"Text",fields:"Vec<Si0Field>",index:"Option<u8>",discriminant:"Option<u64>",docs:"Vec<Text>"}},tC,{SiField:"Si1Field",SiLookupTypeId:"Si1LookupTypeId",SiPath:"Si1Path",SiType:"Si1Type",SiTypeDef:"Si1TypeDef",SiTypeDefArray:"Si1TypeDefArray",SiTypeDefBitSequence:"Si1TypeDefBitSequence",SiTypeDefCompact:"Si1TypeDefCompact",SiTypeDefComposite:"Si1TypeDefComposite",SiTypeDefPrimitive:"Si1TypeDefPrimitive",SiTypeDefSequence:"Si1TypeDefSequence",SiTypeDefTuple:"Si1TypeDefTuple",SiTypeParameter:"Si1TypeParameter",SiTypeDefVariant:"Si1TypeDefVariant",SiVariant:"Si1Variant"})},aC={rpc:{},types:{AssetApprovalKey:{owner:"AccountId",delegate:"AccountId"},AssetApproval:{amount:"TAssetBalance",deposit:"TAssetDepositBalance"},AssetBalance:{balance:"TAssetBalance",isFrozen:"bool",isSufficient:"bool"},AssetDestroyWitness:{accounts:"Compact<u32>",sufficients:"Compact<u32>",approvals:"Compact<u32>"},AssetDetails:{owner:"AccountId",issuer:"AccountId",admin:"AccountId",freezer:"AccountId",supply:"TAssetBalance",deposit:"TAssetDepositBalance",minBalance:"TAssetBalance",isSufficient:"bool",accounts:"u32",sufficients:"u32",approvals:"u32",isFrozen:"bool"},AssetMetadata:{deposit:"TAssetDepositBalance",name:"Vec<u8>",symbol:"Vec<u8>",decimals:"u8",isFrozen:"bool"},TAssetBalance:"u64",TAssetDepositBalance:"BalanceOf"}},cC={rpc:{},types:{UncleEntryItem:{_enum:{InclusionHeight:"BlockNumber",Uncle:"(Hash, Option<AccountId>)"}}}},uC={rpc:{},types:{RawAuraPreDigest:{slotNumber:"u64"}}},lC={rpc:{epochAuthorship:{description:"Returns data about which slots (primary or secondary) can be claimed in the current epoch with the keys in the keystore",params:[],type:"HashMap<AuthorityId, EpochAuthorship>"}},types:{AllowedSlots:{_enum:["PrimarySlots","PrimaryAndSecondaryPlainSlots","PrimaryAndSecondaryVRFSlots"]},BabeAuthorityWeight:"u64",BabeEpochConfiguration:{c:"(u64, u64)",allowedSlots:"AllowedSlots"},BabeBlockWeight:"u32",BabeEquivocationProof:{offender:"AuthorityId",slotNumber:"SlotNumber",firstHeader:"Header",secondHeader:"Header"},BabeWeight:"u64",MaybeRandomness:"Option<Randomness>",MaybeVrf:"Option<VrfData>",EpochAuthorship:{primary:"Vec<u64>",secondary:"Vec<u64>",secondary_vrf:"Vec<u64>"},NextConfigDescriptor:{_enum:{V0:"Null",V1:"NextConfigDescriptorV1"}},NextConfigDescriptorV1:{c:"(u64, u64)",allowedSlots:"AllowedSlots"},Randomness:"Hash",RawBabePreDigest:{_enum:{Phantom:"Null",Primary:"RawBabePreDigestPrimary",SecondaryPlain:"RawBabePreDigestSecondaryPlain",SecondaryVRF:"RawBabePreDigestSecondaryVRF"}},RawBabePreDigestPrimary:{authorityIndex:"u32",slotNumber:"SlotNumber",vrfOutput:"VrfOutput",vrfProof:"VrfProof"},RawBabePreDigestSecondaryPlain:{authorityIndex:"u32",slotNumber:"SlotNumber"},RawBabePreDigestSecondaryVRF:{authorityIndex:"u32",slotNumber:"SlotNumber",vrfOutput:"VrfOutput",vrfProof:"VrfProof"},RawBabePreDigestTo159:{_enum:{Primary:"RawBabePreDigestPrimaryTo159",Secondary:"RawBabePreDigestSecondaryTo159"}},RawBabePreDigestPrimaryTo159:{authorityIndex:"u32",slotNumber:"SlotNumber",weight:"BabeBlockWeight",vrfOutput:"VrfOutput",vrfProof:"VrfProof"},RawBabePreDigestSecondaryTo159:{authorityIndex:"u32",slotNumber:"SlotNumber",weight:"BabeBlockWeight"},RawBabePreDigestCompat:{_enum:{Zero:"u32",One:"u32",Two:"u32",Three:"u32"}},SlotNumber:"u64",VrfData:"[u8; 32]",VrfOutput:"[u8; 32]",VrfProof:"[u8; 64]"}},hC={rpc:{},types:{AccountData:{free:"Balance",reserved:"Balance",miscFrozen:"Balance",feeFrozen:"Balance"},BalanceLockTo212:{id:"LockIdentifier",amount:"Balance",until:"BlockNumber",reasons:"WithdrawReasons"},BalanceLock:{id:"LockIdentifier",amount:"Balance",reasons:"Reasons"},BalanceStatus:{_enum:["Free","Reserved"]},Reasons:{_enum:["Fee","Misc","All"]},ReserveData:{id:"ReserveIdentifier",amount:"Balance"},ReserveIdentifier:"[u8; 8]",VestingSchedule:{offset:"Balance",perBlock:"Balance",startingBlock:"BlockNumber"},WithdrawReasons:{_set:{TransactionPayment:1,Transfer:2,Reserve:4,Fee:8,Tip:16}}}},dC={rpc:{subscribeJustifications:{description:"Returns the block most recently finalized by BEEFY, alongside side its justification.",params:[],pubsub:["justifications","subscribeJustifications","unsubscribeJustifications"],type:"BeefySignedCommitment"},getFinalizedHead:{description:"Returns hash of the latest BEEFY finalized block as seen by this client.",params:[],type:"H256"}},types:{BeefyCommitment:{payload:"BeefyPayload",blockNumber:"BlockNumber",validatorSetId:"ValidatorSetId"},BeefyId:"[u8; 33]",BeefySignedCommitment:{commitment:"BeefyCommitment",signatures:"Vec<Option<EcdsaSignature>>"},BeefyNextAuthoritySet:{id:"u64",len:"u32",root:"H256"},BeefyPayload:"MmrRootHash",MmrRootHash:"H256",ValidatorSetId:"u64"}},fC={rpc:{},types:{CollectiveOrigin:{_enum:{Members:"(MemberCount, MemberCount)",Member:"AccountId"}},MemberCount:"u32",ProposalIndex:"u32",VotesTo230:{index:"ProposalIndex",threshold:"MemberCount",ayes:"Vec<AccountId>",nays:"Vec<AccountId>"},Votes:{index:"ProposalIndex",threshold:"MemberCount",ayes:"Vec<AccountId>",nays:"Vec<AccountId>",end:"BlockNumber"}}},pC={rpc:{},types:{AuthorityId:"AccountId",RawVRFOutput:"[u8; 32]"}},mC={rpc:{call:{description:"Executes a call to a contract",params:[{name:"callRequest",type:"ContractCallRequest"},{name:"at",type:"BlockHash",isHistoric:!0,isOptional:!0}],type:"ContractExecResult"},instantiate:{description:"Instantiate a new contract",params:[{name:"request",type:"InstantiateRequest"},{name:"at",type:"BlockHash",isHstoric:!0,isOptional:!0}],type:"ContractInstantiateResult"},uploadCode:{endpoint:"contracts_upload_code",description:"Upload new code without instantiating a contract from it",params:[{name:"uploadRequest",type:"CodeUploadRequest"},{name:"at",type:"BlockHash",isHstoric:!0,isOptional:!0}],type:"CodeUploadResult"},getStorage:{description:"Returns the value under a specified storage key in a contract",params:[{name:"address",type:"AccountId"},{name:"key",type:"H256"},{name:"at",type:"BlockHash",isHistoric:!0,isOptional:!0}],type:"Option<Bytes>"},rentProjection:{description:"Returns the projected time a given contract will be able to sustain paying its rent",params:[{name:"address",type:"AccountId"},{name:"at",type:"BlockHash",isHistoric:!0,isOptional:!0}],type:"Option<BlockNumber>"}},types:{AliveContractInfo:{trieId:"TrieId",storageSize:"u32",pairCount:"u32",codeHash:"CodeHash",rentAllowance:"Balance",rentPaid:"Balance",deductBlock:"BlockNumber",lastWrite:"Option<BlockNumber>",_reserved:"Option<Null>"},CodeHash:"Hash",CodeSource:{_enum:{Upload:"Bytes",Existing:"Hash"}},CodeUploadRequest:{origin:"AccountId",code:"Bytes",storageDepositLimit:"Option<Balance>"},CodeUploadResult:{_enum:{Ok:"CodeUploadResultValue",Err:"Null"}},CodeUploadResultValue:{codeHash:"CodeHash",deposit:"Balance"},ContractCallRequest:{origin:"AccountId",dest:"AccountId",value:"Balance",gasLimit:"u64",storageDepositLimit:"Option<Balance>",inputData:"Bytes"},ContractExecResultSuccessTo255:{status:"u8",data:"Raw"},ContractExecResultTo255:{_enum:{Success:"ContractExecResultSuccessTo255",Error:"Null"}},ContractExecResultSuccessTo260:{flags:"ContractReturnFlags",data:"Bytes",gasConsumed:"u64"},ContractExecResultTo260:{_enum:{Success:"ContractExecResultSuccessTo260",Error:"Null"}},ContractExecResultErrModule:{index:"u8",error:"u8",message:"Option<Text>"},ContractExecResultErr:{_enum:{Other:"Text",CannotLookup:"Null",BadOrigin:"Null",Module:"ContractExecResultErrModule"}},ContractExecResultOk:{flags:"ContractReturnFlags",data:"Bytes"},ContractExecResultResult:{_enum:{Ok:"ContractExecResultOk",Err:"ContractExecResultErr"}},ContractExecResultTo267:{gasConsumed:"u64",debugMessage:"Text",result:"ContractExecResultResult"},ContractExecResult:{gasConsumed:"u64",gasRequired:"u64",storageDeposit:"StorageDeposit",debugMessage:"Text",result:"ContractExecResultResult"},ContractInfo:{_enum:{Alive:"AliveContractInfo",Tombstone:"TombstoneContractInfo"}},ContractCallFlags:{_set:{_bitLength:32,ForwardInput:1,CloneInput:2,TailCall:4,AllowReentry:8}},ContractReturnFlags:{_set:{_bitLength:32,Revert:1}},ContractStorageKey:"[u8; 32]",DeletedContract:{pairCount:"u32",trieId:"TrieId"},ExecReturnValue:{flags:"ContractReturnFlags",data:"Bytes"},Gas:"u64",HostFnWeightsTo264:{caller:"Weight",address:"Weight",gasLeft:"Weight",balance:"Weight",valueTransferred:"Weight",minimumBalance:"Weight",tombstoneDeposit:"Weight",rentAllowance:"Weight",blockNumber:"Weight",now:"Weight",weightToFee:"Weight",gas:"Weight",input:"Weight",inputPerByte:"Weight",return:"Weight",returnPerByte:"Weight",terminate:"Weight",restoreTo:"Weight",restoreToPerDelta:"Weight",random:"Weight",depositEvent:"Weight",depositEventPerTopic:"Weight",depositEventPerByte:"Weight",setRentAllowance:"Weight",setStorage:"Weight",setStoragePerByte:"Weight",clearStorage:"Weight",getStorage:"Weight",getStoragePerByte:"Weight",transfer:"Weight",call:"Weight",callTransferSurcharge:"Weight",callPerInputByte:"Weight",callPerOutputByte:"Weight",instantiate:"Weight",instantiatePerInputByte:"Weight",instantiatePerOutputByte:"Weight",hashSha2256:"Weight",hashSha2256PerByte:"Weight",hashKeccak256:"Weight",hashKeccak256PerByte:"Weight",hashBlake2256:"Weight",hashBlake2256PerByte:"Weight",hashBlake2128:"Weight",hashBlake2128PerByte:"Weight"},HostFnWeights:{caller:"Weight",address:"Weight",gasLeft:"Weight",balance:"Weight",valueTransferred:"Weight",minimumBalance:"Weight",tombstoneDeposit:"Weight",rentAllowance:"Weight",blockNumber:"Weight",now:"Weight",weightToFee:"Weight",gas:"Weight",input:"Weight",inputPerByte:"Weight",return:"Weight",returnPerByte:"Weight",terminate:"Weight",terminatePerCodeByte:"Weight",restoreTo:"Weight",restoreToPerCallerCodeByte:"Weight",restoreToPerTombstoneCodeByte:"Weight",restoreToPerDelta:"Weight",random:"Weight",depositEvent:"Weight",depositEventPerTopic:"Weight",depositEventPerByte:"Weight",setRentAllowance:"Weight",setStorage:"Weight",setStoragePerByte:"Weight",clearStorage:"Weight",getStorage:"Weight",getStoragePerByte:"Weight",transfer:"Weight",call:"Weight",callPerCodeByte:"Weight",callTransferSurcharge:"Weight",callPerInputByte:"Weight",callPerOutputByte:"Weight",instantiate:"Weight",instantiatePerCodeByte:"Weight",instantiatePerInputByte:"Weight",instantiatePerOutputByte:"Weight",instantiatePerSaltByte:"Weight",hashSha2256:"Weight",hashSha2256PerByte:"Weight",hashKeccak256:"Weight",hashKeccak256PerByte:"Weight",hashBlake2256:"Weight",hashBlake2256PerByte:"Weight",hashBlake2128:"Weight",hashBlake2128PerByte:"Weight",rentParams:"Weight"},InstantiateRequestV1:{origin:"AccountId",value:"Balance",gasLimit:"Gas",code:"Bytes",data:"Bytes",salt:"Bytes"},InstantiateRequestV2:{_fallback:"InstantiateRequestV1",origin:"AccountId",value:"Balance",gasLimit:"Gas",storageDepositLimit:"Option<Balance>",code:"Bytes",data:"Bytes",salt:"Bytes"},InstantiateRequest:{_fallback:"InstantiateRequestV2",origin:"AccountId",value:"Balance",gasLimit:"Gas",storageDepositLimit:"Option<Balance>",code:"CodeSource",data:"Bytes",salt:"Bytes"},ContractInstantiateResultTo267:{_enum:{Ok:"InstantiateReturnValueTo267",Err:"Null"}},ContractInstantiateResultTo299:{_enum:{Ok:"InstantiateReturnValue",Err:"Null"},_fallback:"ContractInstantiateResultTo267"},ContractInstantiateResult:{_fallback:"ContractInstantiateResultTo299",gasConsumed:"u64",gasRequired:"u64",storageDeposit:"StorageDeposit",debugMessage:"Text",result:"InstantiateReturnValue"},InstantiateReturnValueTo267:{result:"ExecReturnValue",accountId:"AccountId",rentProjection:"Option<RentProjection>"},InstantiateReturnValueOk:{result:"ExecReturnValue",accountId:"AccountId"},InstantiateReturnValue:{_enum:{Ok:"InstantiateReturnValueOk",Err:"DispatchError"}},InstructionWeights:{i64const:"u32",i64load:"u32",i64store:"u32",select:"u32",rIf:"u32",br:"u32",brIf:"u32",brIable:"u32",brIablePerEntry:"u32",call:"u32",callIndirect:"u32",callIndirectPerParam:"u32",localGet:"u32",localSet:"u32",local_tee:"u32",globalGet:"u32",globalSet:"u32",memoryCurrent:"u32",memoryGrow:"u32",i64clz:"u32",i64ctz:"u32",i64popcnt:"u32",i64eqz:"u32",i64extendsi32:"u32",i64extendui32:"u32",i32wrapi64:"u32",i64eq:"u32",i64ne:"u32",i64lts:"u32",i64ltu:"u32",i64gts:"u32",i64gtu:"u32",i64les:"u32",i64leu:"u32",i64ges:"u32",i64geu:"u32",i64add:"u32",i64sub:"u32",i64mul:"u32",i64divs:"u32",i64divu:"u32",i64rems:"u32",i64remu:"u32",i64and:"u32",i64or:"u32",i64xor:"u32",i64shl:"u32",i64shrs:"u32",i64shru:"u32",i64rotl:"u32",i64rotr:"u32"},LimitsTo264:{eventTopics:"u32",stackHeight:"u32",globals:"u32",parameters:"u32",memoryPages:"u32",tableSize:"u32",brTableSize:"u32",subjectLen:"u32",codeSize:"u32"},Limits:{eventTopics:"u32",stackHeight:"u32",globals:"u32",parameters:"u32",memoryPages:"u32",tableSize:"u32",brTableSize:"u32",subjectLen:"u32"},PrefabWasmModule:{scheduleVersion:"Compact<u32>",initial:"Compact<u32>",maximum:"Compact<u32>",refcount:"Compact<u64>",_reserved:"Option<Null>",code:"Bytes",originalCodeLen:"u32"},RentProjection:{_enum:{EvictionAt:"BlockNumber",NoEviction:"Null"}},ScheduleTo212:{version:"u32",putCodePerByteCost:"Gas",growMemCost:"Gas",regularOpCost:"Gas",returnDataPerByteCost:"Gas",eventDataPerByteCost:"Gas",eventPerTopicCost:"Gas",eventBaseCost:"Gas",sandboxDataReadCost:"Gas",sandboxDataWriteCost:"Gas",maxEventTopics:"u32",maxStackHeight:"u32",maxMemoryPages:"u32",enablePrintln:"bool",maxSubjectLen:"u32"},ScheduleTo258:{version:"u32",putCodePerByteCost:"Gas",growMemCost:"Gas",regularOpCost:"Gas",returnDataPerByteCost:"Gas",eventDataPerByteCost:"Gas",eventPerTopicCost:"Gas",eventBaseCost:"Gas",sandboxDataReadCost:"Gas",sandboxDataWriteCost:"Gas",transferCost:"Gas",maxEventTopics:"u32",maxStackHeight:"u32",maxMemoryPages:"u32",enablePrintln:"bool",maxSubjectLen:"u32"},ScheduleTo264:{version:"u32",enablePrintln:"bool",limits:"LimitsTo264",instructionWeights:"InstructionWeights",hostFnWeights:"HostFnWeightsTo264"},Schedule:{version:"u32",enablePrintln:"bool",limits:"Limits",instructionWeights:"InstructionWeights",hostFnWeights:"HostFnWeights"},SeedOf:"Hash",StorageDeposit:{_enum:{Refund:"Balance",Charge:"Balance"}},TombstoneContractInfo:"Hash",TrieId:"Bytes"}},gC={rpc:{},types:{AccountVote:{_enum:{Standard:"AccountVoteStandard",Split:"AccountVoteSplit"}},AccountVoteSplit:{aye:"Balance",nay:"Balance"},AccountVoteStandard:{vote:"Vote",balance:"Balance"},Conviction:{_enum:["None","Locked1x","Locked2x","Locked3x","Locked4x","Locked5x","Locked6x"]},Delegations:{votes:"Balance",capital:"Balance"},PreimageStatus:{_enum:{Missing:"BlockNumber",Available:"PreimageStatusAvailable"}},PreimageStatusAvailable:{data:"Bytes",provider:"AccountId",deposit:"Balance",since:"BlockNumber",expiry:"Option<BlockNumber>"},PriorLock:"(BlockNumber, Balance)",PropIndex:"u32",Proposal:"Call",ProxyState:{_enum:{Open:"AccountId",Active:"AccountId"}},ReferendumIndex:"u32",ReferendumInfoTo239:{end:"BlockNumber",proposalHash:"Hash",threshold:"VoteThreshold",delay:"BlockNumber"},ReferendumInfo:{_enum:{Ongoing:"ReferendumStatus",Finished:"ReferendumInfoFinished"}},ReferendumInfoFinished:{approved:"bool",end:"BlockNumber"},ReferendumStatus:{end:"BlockNumber",proposalHash:"Hash",threshold:"VoteThreshold",delay:"BlockNumber",tally:"Tally"},Tally:{ayes:"Balance",nays:"Balance",turnout:"Balance"},Voting:{_enum:{Direct:"VotingDirect",Delegating:"VotingDelegating"}},VotingDirect:{votes:"Vec<VotingDirectVote>",delegations:"Delegations",prior:"PriorLock"},VotingDirectVote:"(ReferendumIndex, AccountVote)",VotingDelegating:{balance:"Balance",target:"AccountId",conviction:"Conviction",delegations:"Delegations",prior:"PriorLock"}}},yC={rpc:{getBlockStats:{description:"Reexecute the specified `block_hash` and gather statistics while doing so",params:[{name:"at",type:"Hash",isHistoric:!0}],type:"Option<BlockStats>"}},types:{BlockStats:{witnessLen:"u64",witnessCompactLen:"u64",blockLen:"u64",blockNumExtrinsics:"u64"}}},bC={rpc:{},types:{ApprovalFlag:"u32",DefunctVoter:{who:"AccountId",voteCount:"Compact<u32>",candidateCount:"Compact<u32>"},Renouncing:{_enum:{Member:"Null",RunnerUp:"Null",Candidate:"Compact<u32>"}},SetIndex:"u32",Vote:"GenericVote",VoteIndex:"u32",VoterInfo:{lastActive:"VoteIndex",lastWin:"VoteIndex",pot:"Balance",stake:"Balance"},VoteThreshold:{_enum:["Super Majority Approve","Super Majority Against","Simple Majority"]}}},vC={rpc:{createBlock:{description:"Instructs the manual-seal authorship task to create a new block",params:[{name:"createEmpty",type:"bool"},{name:"finalize",type:"bool"},{name:"parentHash",type:"BlockHash",isOptional:!0}],type:"CreatedBlock"},finalizeBlock:{description:"Instructs the manual-seal authorship task to finalize a block",params:[{name:"hash",type:"BlockHash"},{name:"justification",type:"Justification",isOptional:!0}],type:"bool"}},types:{CreatedBlock:{hash:"BlockHash",aux:"ImportedAux"},ImportedAux:{headerOnly:"bool",clearJustificationRequests:"bool",needsJustification:"bool",badJustification:"bool",needsFinalityProof:"bool",isNewBest:"bool"}}},wC={rpc:{},types:{EvmAccount:{nonce:"u256",balance:"u256"},EvmLog:{address:"H160",topics:"Vec<H256>",data:"Bytes"},EvmVicinity:{gasPrice:"u256",origin:"H160"},ExitError:{_enum:{StackUnderflow:"Null",StackOverflow:"Null",InvalidJump:"Null",InvalidRange:"Null",DesignatedInvalid:"Null",CallTooDeep:"Null",CreateCollision:"Null",CreateContractLimit:"Null",OutOfOffset:"Null",OutOfGas:"Null",OutOfFund:"Null",PCUnderflow:"Null",CreateEmpty:"Null",Other:"Text"}},ExitFatal:{_enum:{NotSupported:"Null",UnhandledInterrupt:"Null",CallErrorAsFatal:"ExitError",Other:"Text"}},ExitReason:{_enum:{Succeed:"ExitSucceed",Error:"ExitError",Revert:"ExitRevert",Fatal:"ExitFatal"}},ExitRevert:{_enum:["Reverted"]},ExitSucceed:{_enum:["Stopped","Returned","Suicided"]}}},xC={rpc:{},types:{Extrinsic:"GenericExtrinsic",ExtrinsicEra:"GenericExtrinsicEra",ExtrinsicPayload:"GenericExtrinsicPayload",ExtrinsicSignature:"MultiSignature",ExtrinsicV4:"GenericExtrinsicV4",ExtrinsicPayloadV4:"GenericExtrinsicPayloadV4",ExtrinsicSignatureV4:"GenericExtrinsicSignatureV4",ExtrinsicUnknown:"GenericExtrinsicUnknown",ExtrinsicPayloadUnknown:"GenericExtrinsicPayloadUnknown",Era:"ExtrinsicEra",ImmortalEra:"GenericImmortalEra",MortalEra:"GenericMortalEra",AnySignature:"H512",MultiSignature:{_enum:{Ed25519:"Ed25519Signature",Sr25519:"Sr25519Signature",Ecdsa:"EcdsaSignature"}},Signature:"H512",SignerPayload:"GenericSignerPayload",EcdsaSignature:"[u8; 65]",Ed25519Signature:"H512",Sr25519Signature:"H512"}},kC={rpc:{},types:{AssetOptions:{initalIssuance:"Compact<Balance>",permissions:"PermissionLatest"},Owner:{_enum:{None:"Null",Address:"AccountId"}},PermissionsV1:{update:"Owner",mint:"Owner",burn:"Owner"},PermissionVersions:{_enum:{V1:"PermissionsV1"}},PermissionLatest:"PermissionsV1"}},SC={rpc:{},types:{ActiveGilt:{proportion:"Perquintill",amount:"Balance",who:"AccountId",expiry:"BlockNumber"},ActiveGiltsTotal:{frozen:"Balance",proportion:"Perquintill",index:"ActiveIndex",target:"Perquintill"},ActiveIndex:"u32",GiltBid:{amount:"Balance",who:"AccountId"}}},EC={rpc:{proveFinality:{description:"Prove finality for the given block number, returning the Justification for the last block in the set.",params:[{name:"blockNumber",type:"BlockNumber"}],type:"Option<EncodedFinalityProofs>"},roundState:{description:"Returns the state of the current best round state as well as the ongoing background rounds",params:[],type:"ReportedRoundStates"},subscribeJustifications:{description:"Subscribes to grandpa justifications",params:[],pubsub:["justifications","subscribeJustifications","unsubscribeJustifications"],type:"JustificationNotification"}},types:{AuthorityIndex:"u64",AuthorityList:"Vec<NextAuthority>",AuthoritySet:{currentAuthorities:"AuthorityList",setId:"u64",pendingStandardChanges:"ForkTreePendingChange",pendingForcedChanges:"Vec<PendingChange>",authoritySetChanges:"AuthoritySetChanges"},ForkTreePendingChange:{roots:"Vec<ForkTreePendingChangeNode>",bestFinalizedNumber:"Option<BlockNumber>"},ForkTreePendingChangeNode:{hash:"BlockHash",number:"BlockNumber",data:"PendingChange",children:"Vec<ForkTreePendingChangeNode>"},AuthoritySetChange:"(U64, BlockNumber)",AuthoritySetChanges:"Vec<AuthoritySetChange>",AuthorityWeight:"u64",DelayKind:{_enum:{Finalized:"Null",Best:"DelayKindBest"}},DelayKindBest:{medianLastFinalized:"BlockNumber"},EncodedFinalityProofs:"Bytes",GrandpaEquivocation:{_enum:{Prevote:"GrandpaEquivocationValue",Precommit:"GrandpaEquivocationValue"}},GrandpaEquivocationProof:{setId:"SetId",equivocation:"GrandpaEquivocation"},GrandpaEquivocationValue:{roundNumber:"u64",identity:"AuthorityId",first:"(GrandpaPrevote, AuthoritySignature)",second:"(GrandpaPrevote, AuthoritySignature)"},GrandpaPrevote:{targetHash:"Hash",targetNumber:"BlockNumber"},GrandpaCommit:{targetHash:"BlockHash",targetNumber:"BlockNumber",precommits:"Vec<GrandpaSignedPrecommit>"},GrandpaPrecommit:{targetHash:"BlockHash",targetNumber:"BlockNumber"},GrandpaSignedPrecommit:{precommit:"GrandpaPrecommit",signature:"AuthoritySignature",id:"AuthorityId"},GrandpaJustification:{round:"u64",commit:"GrandpaCommit",votesAncestries:"Vec<Header>"},JustificationNotification:"Bytes",KeyOwnerProof:"MembershipProof",NextAuthority:"(AuthorityId, AuthorityWeight)",PendingChange:{nextAuthorities:"AuthorityList",delay:"BlockNumber",canonHeight:"BlockNumber",canonHash:"BlockHash",delayKind:"DelayKind"},PendingPause:{scheduledAt:"BlockNumber",delay:"BlockNumber"},PendingResume:{scheduledAt:"BlockNumber",delay:"BlockNumber"},Precommits:{currentWeight:"u32",missing:"BTreeSet<AuthorityId>"},Prevotes:{currentWeight:"u32",missing:"BTreeSet<AuthorityId>"},ReportedRoundStates:{setId:"u32",best:"RoundState",background:"Vec<RoundState>"},RoundState:{round:"u32",totalWeight:"u32",thresholdWeight:"u32",prevotes:"Prevotes",precommits:"Precommits"},SetId:"u64",StoredPendingChange:{scheduledAt:"BlockNumber",delay:"BlockNumber",nextAuthorities:"AuthorityList"},StoredState:{_enum:{Live:"Null",PendingPause:"PendingPause",Paused:"Null",PendingResume:"PendingResume"}}}},AC={rpc:{},types:{IdentityFields:{_set:{_bitLength:64,Display:1,Legal:2,Web:4,Riot:8,Email:16,PgpFingerprint:32,Image:64,Twitter:128}},IdentityInfoAdditional:"(Data, Data)",IdentityInfoTo198:{additional:"Vec<IdentityInfoAdditional>",display:"Data",legal:"Data",web:"Data",riot:"Data",email:"Data",pgpFingerprint:"Option<H160>",image:"Data"},IdentityInfo:{_fallback:"IdentityInfoTo198",additional:"Vec<IdentityInfoAdditional>",display:"Data",legal:"Data",web:"Data",riot:"Data",email:"Data",pgpFingerprint:"Option<H160>",image:"Data",twitter:"Data"},IdentityJudgement:{_enum:{Unknown:"Null",FeePaid:"Balance",Reasonable:"Null",KnownGood:"Null",OutOfDate:"Null",LowQuality:"Null",Erroneous:"Null"}},RegistrationJudgement:"(RegistrarIndex, IdentityJudgement)",RegistrationTo198:{judgements:"Vec<RegistrationJudgement>",deposit:"Balance",info:"IdentityInfoTo198"},Registration:{_fallback:"RegistrationTo198",judgements:"Vec<RegistrationJudgement>",deposit:"Balance",info:"IdentityInfo"},RegistrarIndex:"u32",RegistrarInfo:{account:"AccountId",fee:"Balance",fields:"IdentityFields"}}},NC={rpc:{},types:{AuthIndex:"u32",AuthoritySignature:"Signature",Heartbeat:{blockNumber:"BlockNumber",networkState:"OpaqueNetworkState",sessionIndex:"SessionIndex",authorityIndex:"AuthIndex",validatorsLen:"u32"},HeartbeatTo244:{blockNumber:"BlockNumber",networkState:"OpaqueNetworkState",sessionIndex:"SessionIndex",authorityIndex:"AuthIndex"},OpaqueMultiaddr:"Bytes",OpaquePeerId:"Bytes",OpaqueNetworkState:{peerId:"OpaquePeerId",externalAddresses:"Vec<OpaqueMultiaddr>"}}},TC={rpc:{},types:{CallIndex:"(u8, u8)",LotteryConfig:{price:"Balance",start:"BlockNumber",length:"BlockNumber",delay:"BlockNumber",repeat:"bool"}}},PC={rpc:{generateProof:{description:"Generate MMR proof for given leaf index.",params:[{name:"leafIndex",type:"u64"},{name:"at",type:"BlockHash",isHistoric:!0,isOptional:!0}],type:"MmrLeafProof"}},types:{MmrLeafProof:{blockHash:"BlockHash",leaf:"Bytes",proof:"Bytes"}}},MC={rpc:{},types:{DeferredOffenceOf:"(Vec<OffenceDetails>, Vec<Perbill>, SessionIndex)",Kind:"[u8; 16]",OffenceDetails:{offender:"Offender",reporters:"Vec<Reporter>"},Offender:"IdentificationTuple",OpaqueTimeSlot:"Bytes",ReportIdOf:"Hash",Reporter:"AccountId"}},IC={rpc:{},types:{ProxyDefinition:{delegate:"AccountId",proxyType:"ProxyType",delay:"BlockNumber"},ProxyType:{_enum:["Any","NonTransfer","Governance","Staking"]},ProxyAnnouncement:{real:"AccountId",callHash:"Hash",height:"BlockNumber"}}},CC={rpc:{},types:{ActiveRecovery:{created:"BlockNumber",deposit:"Balance",friends:"Vec<AccountId>"},RecoveryConfig:{delayPeriod:"BlockNumber",deposit:"Balance",friends:"Vec<AccountId>",threshold:"u16"}}},RC={rpc:{},types:{Period:"(BlockNumber, u32)",Priority:"u8",SchedulePeriod:"Period",SchedulePriority:"Priority",Scheduled:{maybeId:"Option<Bytes>",priority:"SchedulePriority",call:"Call",maybePeriodic:"Option<SchedulePeriod>",origin:"PalletsOrigin"},ScheduledTo254:{maybeId:"Option<Bytes>",priority:"SchedulePriority",call:"Call",maybePeriodic:"Option<SchedulePeriod>"},TaskAddress:"(BlockNumber, u32)"}},BC={rpc:{},types:Im({},{BeefyKey:"[u8; 33]",Keys:"SessionKeys4",SessionKeys1:"(AccountId)",SessionKeys2:"(AccountId, AccountId)",SessionKeys3:"(AccountId, AccountId, AccountId)",SessionKeys4:"(AccountId, AccountId, AccountId, AccountId)",SessionKeys5:"(AccountId, AccountId, AccountId, AccountId, AccountId)",SessionKeys6:"(AccountId, AccountId, AccountId, AccountId, AccountId, AccountId)",SessionKeys6B:"(AccountId, AccountId, AccountId, AccountId, AccountId, BeefyKey)",SessionKeys7:"(AccountId, AccountId, AccountId, AccountId, AccountId, AccountId, AccountId)",SessionKeys7B:"(AccountId, AccountId, AccountId, AccountId, AccountId, AccountId, BeefyKey)",SessionKeys8:"(AccountId, AccountId, AccountId, AccountId, AccountId, AccountId, AccountId, AccountId)",SessionKeys8B:"(AccountId, AccountId, AccountId, AccountId, AccountId, AccountId, AccountId, BeefyKey)",SessionKeys9:"(AccountId, AccountId, AccountId, AccountId, AccountId, AccountId, AccountId, AccountId, AccountId)",SessionKeys9B:"(AccountId, AccountId, AccountId, AccountId, AccountId, AccountId, AccountId, AccountId, BeefyKey)",SessionKeys10:"(AccountId, AccountId, AccountId, AccountId, AccountId, AccountId, AccountId, AccountId, AccountId, AccountId)",SessionKeys10B:"(AccountId, AccountId, AccountId, AccountId, AccountId, AccountId, AccountId, AccountId, AccountId, BeefyKey)"},{FullIdentification:"Exposure",IdentificationTuple:"(ValidatorId, FullIdentification)",MembershipProof:{session:"SessionIndex",trieNodes:"Vec<Vec<u8>>",validatorCount:"ValidatorCount"},SessionIndex:"u32",ValidatorCount:"u32"})},OC={rpc:{},types:{Bid:{who:"AccountId",kind:"BidKind",value:"Balance"},BidKind:{_enum:{Deposit:"Balance",Vouch:"(AccountId, Balance)"}},SocietyJudgement:{_enum:["Rebid","Reject","Approve"]},SocietyVote:{_enum:["Skeptic","Reject","Approve"]},StrikeCount:"u32",VouchingStatus:{_enum:["Vouching","Banned"]}}},LC={rpc:{},types:Im({},{Points:"u32",EraPoints:{total:"Points",individual:"Vec<Points>"}},{CompactAssignments:"CompactAssignmentsWith16",CompactAssignmentsWith16:{votes1:"Vec<(NominatorIndexCompact, ValidatorIndexCompact)>",votes2:"Vec<(NominatorIndexCompact, CompactScoreCompact, ValidatorIndexCompact)>",votes3:"Vec<(NominatorIndexCompact, [CompactScoreCompact; 2], ValidatorIndexCompact)>",votes4:"Vec<(NominatorIndexCompact, [CompactScoreCompact; 3], ValidatorIndexCompact)>",votes5:"Vec<(NominatorIndexCompact, [CompactScoreCompact; 4], ValidatorIndexCompact)>",votes6:"Vec<(NominatorIndexCompact, [CompactScoreCompact; 5], ValidatorIndexCompact)>",votes7:"Vec<(NominatorIndexCompact, [CompactScoreCompact; 6], ValidatorIndexCompact)>",votes8:"Vec<(NominatorIndexCompact, [CompactScoreCompact; 7], ValidatorIndexCompact)>",votes9:"Vec<(NominatorIndexCompact, [CompactScoreCompact; 8], ValidatorIndexCompact)>",votes10:"Vec<(NominatorIndexCompact, [CompactScoreCompact; 9], ValidatorIndexCompact)>",votes11:"Vec<(NominatorIndexCompact, [CompactScoreCompact; 10], ValidatorIndexCompact)>",votes12:"Vec<(NominatorIndexCompact, [CompactScoreCompact; 11], ValidatorIndexCompact)>",votes13:"Vec<(NominatorIndexCompact, [CompactScoreCompact; 12], ValidatorIndexCompact)>",votes14:"Vec<(NominatorIndexCompact, [CompactScoreCompact; 13], ValidatorIndexCompact)>",votes15:"Vec<(NominatorIndexCompact, [CompactScoreCompact; 14], ValidatorIndexCompact)>",votes16:"Vec<(NominatorIndexCompact, [CompactScoreCompact; 15], ValidatorIndexCompact)>"},CompactAssignmentsWith24:{votes1:"Vec<(NominatorIndexCompact, ValidatorIndexCompact)>",votes2:"Vec<(NominatorIndexCompact, CompactScoreCompact, ValidatorIndexCompact)>",votes3:"Vec<(NominatorIndexCompact, [CompactScoreCompact; 2], ValidatorIndexCompact)>",votes4:"Vec<(NominatorIndexCompact, [CompactScoreCompact; 3], ValidatorIndexCompact)>",votes5:"Vec<(NominatorIndexCompact, [CompactScoreCompact; 4], ValidatorIndexCompact)>",votes6:"Vec<(NominatorIndexCompact, [CompactScoreCompact; 5], ValidatorIndexCompact)>",votes7:"Vec<(NominatorIndexCompact, [CompactScoreCompact; 6], ValidatorIndexCompact)>",votes8:"Vec<(NominatorIndexCompact, [CompactScoreCompact; 7], ValidatorIndexCompact)>",votes9:"Vec<(NominatorIndexCompact, [CompactScoreCompact; 8], ValidatorIndexCompact)>",votes10:"Vec<(NominatorIndexCompact, [CompactScoreCompact; 9], ValidatorIndexCompact)>",votes11:"Vec<(NominatorIndexCompact, [CompactScoreCompact; 10], ValidatorIndexCompact)>",votes12:"Vec<(NominatorIndexCompact, [CompactScoreCompact; 11], ValidatorIndexCompact)>",votes13:"Vec<(NominatorIndexCompact, [CompactScoreCompact; 12], ValidatorIndexCompact)>",votes14:"Vec<(NominatorIndexCompact, [CompactScoreCompact; 13], ValidatorIndexCompact)>",votes15:"Vec<(NominatorIndexCompact, [CompactScoreCompact; 14], ValidatorIndexCompact)>",votes16:"Vec<(NominatorIndexCompact, [CompactScoreCompact; 15], ValidatorIndexCompact)>",votes17:"Vec<(NominatorIndexCompact, [CompactScoreCompact; 16], ValidatorIndexCompact)>",votes18:"Vec<(NominatorIndexCompact, [CompactScoreCompact; 17], ValidatorIndexCompact)>",votes19:"Vec<(NominatorIndexCompact, [CompactScoreCompact; 18], ValidatorIndexCompact)>",votes20:"Vec<(NominatorIndexCompact, [CompactScoreCompact; 19], ValidatorIndexCompact)>",votes21:"Vec<(NominatorIndexCompact, [CompactScoreCompact; 20], ValidatorIndexCompact)>",votes22:"Vec<(NominatorIndexCompact, [CompactScoreCompact; 21], ValidatorIndexCompact)>",votes23:"Vec<(NominatorIndexCompact, [CompactScoreCompact; 22], ValidatorIndexCompact)>",votes24:"Vec<(NominatorIndexCompact, [CompactScoreCompact; 23], ValidatorIndexCompact)>"},CompactAssignmentsTo265:"CompactAssignmentsWith16",CompactAssignmentsTo257:{votes1:"Vec<(NominatorIndex, [CompactScore; 0], ValidatorIndex)>",votes2:"Vec<(NominatorIndex, [CompactScore; 1], ValidatorIndex)>",votes3:"Vec<(NominatorIndex, [CompactScore; 2], ValidatorIndex)>",votes4:"Vec<(NominatorIndex, [CompactScore; 3], ValidatorIndex)>",votes5:"Vec<(NominatorIndex, [CompactScore; 4], ValidatorIndex)>",votes6:"Vec<(NominatorIndex, [CompactScore; 5], ValidatorIndex)>",votes7:"Vec<(NominatorIndex, [CompactScore; 6], ValidatorIndex)>",votes8:"Vec<(NominatorIndex, [CompactScore; 7], ValidatorIndex)>",votes9:"Vec<(NominatorIndex, [CompactScore; 8], ValidatorIndex)>",votes10:"Vec<(NominatorIndex, [CompactScore; 9], ValidatorIndex)>",votes11:"Vec<(NominatorIndex, [CompactScore; 10], ValidatorIndex)>",votes12:"Vec<(NominatorIndex, [CompactScore; 11], ValidatorIndex)>",votes13:"Vec<(NominatorIndex, [CompactScore; 12], ValidatorIndex)>",votes14:"Vec<(NominatorIndex, [CompactScore; 13], ValidatorIndex)>",votes15:"Vec<(NominatorIndex, [CompactScore; 14], ValidatorIndex)>",votes16:"Vec<(NominatorIndex, [CompactScore; 15], ValidatorIndex)>"},CompactScore:"(ValidatorIndex, OffchainAccuracy)",CompactScoreCompact:"(ValidatorIndexCompact, OffchainAccuracyCompact)",ElectionCompute:{_enum:["OnChain","Signed","Unsigned"]},ElectionPhase:{_enum:{Off:null,Signed:null,Unsigned:"(bool, BlockNumber)",Emergency:null}},ElectionResult:{compute:"ElectionCompute",slotStake:"Balance",electedStashes:"Vec<AccountId>",exposures:"Vec<(AccountId, Exposure)>"},ElectionScore:"[u128; 3]",ElectionSize:{validators:"Compact<ValidatorIndex>",nominators:"Compact<NominatorIndex>"},ElectionStatus:{_enum:{Close:"Null",Open:"BlockNumber"}},ExtendedBalance:"u128",RawSolution:"RawSolutionWith16",RawSolutionWith16:{compact:"CompactAssignmentsWith16",score:"ElectionScore",round:"u32"},RawSolutionWith24:{compact:"CompactAssignmentsWith24",score:"ElectionScore",round:"u32"},RawSolutionTo265:"RawSolutionWith16",ReadySolution:{supports:"SolutionSupports",score:"ElectionScore",compute:"ElectionCompute"},RoundSnapshot:{voters:"Vec<(AccountId, VoteWeight, Vec<AccountId>)>",targets:"Vec<AccountId>"},SeatHolder:{who:"AccountId",stake:"Balance",deposit:"Balance"},SignedSubmission:{_fallback:"SignedSubmissionTo276",who:"AccountId",deposit:"Balance",solution:"RawSolution",reward:"Balance"},SignedSubmissionTo276:{who:"AccountId",deposit:"Balance",solution:"RawSolution"},SignedSubmissionOf:"SignedSubmission",SolutionOrSnapshotSize:{voters:"Compact<u32>",targets:"Compact<u32>"},SolutionSupport:{total:"ExtendedBalance",voters:"Vec<(AccountId, ExtendedBalance)>"},SolutionSupports:"Vec<(AccountId, SolutionSupport)>",Supports:"SolutionSupports",SubmissionIndicesOf:"BTreeMap<ElectionScore, u32>",Voter:{votes:"Vec<AccountId>",stake:"Balance",deposit:"Balance"},VoteWeight:"u64"},{ActiveEraInfo:{index:"EraIndex",start:"Option<Moment>"},EraIndex:"u32",EraRewardPoints:{total:"RewardPoint",individual:"BTreeMap<AccountId, RewardPoint>"},EraRewards:{total:"u32",rewards:"Vec<u32>"},Exposure:{total:"Compact<Balance>",own:"Compact<Balance>",others:"Vec<IndividualExposure>"},Forcing:{_enum:["NotForcing","ForceNew","ForceNone","ForceAlways"]},IndividualExposure:{who:"AccountId",value:"Compact<Balance>"},KeyType:"AccountId",MomentOf:"Moment",Nominations:{targets:"Vec<AccountId>",submittedIn:"EraIndex",suppressed:"bool"},NominatorIndex:"u32",NominatorIndexCompact:"Compact<NominatorIndex>",OffchainAccuracy:"PerU16",OffchainAccuracyCompact:"Compact<OffchainAccuracy>",PhragmenScore:"[u128; 3]",Points:"u32",RewardDestination:{_enum:{Staked:"Null",Stash:"Null",Controller:"Null",Account:"AccountId",None:"Null"}},RewardPoint:"u32",SlashJournalEntry:{who:"AccountId",amount:"Balance",ownSlash:"Balance"},SlashingSpansTo204:{spanIndex:"SpanIndex",lastStart:"EraIndex",prior:"Vec<EraIndex>"},SlashingSpans:{spanIndex:"SpanIndex",lastStart:"EraIndex",lastNonzeroSlash:"EraIndex",prior:"Vec<EraIndex>"},SpanIndex:"u32",SpanRecord:{slashed:"Balance",paidOut:"Balance"},StakingLedgerTo223:{stash:"AccountId",total:"Compact<Balance>",active:"Compact<Balance>",unlocking:"Vec<UnlockChunk>"},StakingLedgerTo240:{stash:"AccountId",total:"Compact<Balance>",active:"Compact<Balance>",unlocking:"Vec<UnlockChunk>",lastReward:"Option<EraIndex>"},StakingLedger:{stash:"AccountId",total:"Compact<Balance>",active:"Compact<Balance>",unlocking:"Vec<UnlockChunk>",claimedRewards:"Vec<EraIndex>"},UnappliedSlashOther:"(AccountId, Balance)",UnappliedSlash:{validator:"AccountId",own:"Balance",others:"Vec<UnappliedSlashOther>",reporters:"Vec<AccountId>",payout:"Balance"},UnlockChunk:{value:"Compact<Balance>",era:"Compact<BlockNumber>"},ValidatorIndex:"u16",ValidatorIndexCompact:"Compact<ValidatorIndex>",ValidatorPrefs:"ValidatorPrefsWithBlocked",ValidatorPrefsWithCommission:{commission:"Compact<Perbill>"},ValidatorPrefsWithBlocked:{commission:"Compact<Perbill>",blocked:"bool"},ValidatorPrefsTo196:{validatorPayment:"Compact<Balance>"},ValidatorPrefsTo145:{unstakeThreshold:"Compact<u32>",validatorPayment:"Compact<Balance>"}})},zC={rpc:{},types:{WeightToFeeCoefficient:{coeffInteger:"Balance",coeffFrac:"Perbill",negative:"bool",degree:"u8"}}},UC={rpc:{genSyncSpec:{endpoint:"sync_state_genSyncSpec",description:"Returns the json-serialized chainspec running the node, with a sync state.",params:[{name:"raw",type:"bool"}],type:"Json"}},types:{}},_C={rpc:{accountNextIndex:{alias:["account_nextIndex"],description:"Retrieves the next accountIndex as available on the node",params:[{name:"accountId",type:"AccountId"}],type:"Index"},dryRun:{alias:["system_dryRunAt"],description:"Dry run an extrinsic at a given block",params:[{name:"extrinsic",type:"Bytes"},{name:"at",type:"BlockHash",isHistoric:!0,isOptional:!0}],type:"ApplyExtrinsicResult"},name:{description:"Retrieves the node name",params:[],type:"Text"},version:{description:"Retrieves the version of the node",params:[],type:"Text"},chain:{description:"Retrieves the chain",params:[],type:"Text"},chainType:{description:"Retrieves the chain type",params:[],type:"ChainType"},properties:{description:"Get a custom set of properties as a JSON object, defined in the chain spec",params:[],type:"ChainProperties"},health:{description:"Return health status of the node",params:[],type:"Health"},localPeerId:{description:"Returns the base58-encoded PeerId of the node",params:[],type:"Text"},localListenAddresses:{description:"The addresses include a trailing /p2p/ with the local PeerId, and are thus suitable to be passed to addReservedPeer or as a bootnode address for example",params:[],type:"Vec<Text>"},peers:{description:"Returns the currently connected peers",params:[],type:"Vec<PeerInfo>"},networkState:{alias:["system_unstable_networkState"],description:"Returns current state of the network",params:[],type:"NetworkState"},addReservedPeer:{description:"Adds a reserved peer",params:[{name:"peer",type:"Text"}],type:"Text"},removeReservedPeer:{description:"Remove a reserved peer",params:[{name:"peerId",type:"Text"}],type:"Text"},reservedPeers:{description:"Returns the list of reserved peers",params:[],type:"Vec<Text>"},nodeRoles:{description:"Returns the roles the node is running as",params:[],type:"Vec<NodeRole>"},syncState:{description:"Returns the state of the syncing of the node",params:[],type:"SyncState"},addLogFilter:{description:"Adds the supplied directives to the current log filter",params:[{name:"directives",type:"Text"}],type:"Null"},resetLogFilter:{description:"Resets the log filter to Substrate defaults",params:[],type:"Null"}},types:{AccountInfo:"AccountInfoWithTripleRefCount",AccountInfoWithRefCountU8:{nonce:"Index",refcount:"u8",data:"AccountData"},AccountInfoWithRefCount:{_fallback:"AccountInfoWithRefCountU8",nonce:"Index",refcount:"RefCount",data:"AccountData"},AccountInfoWithDualRefCount:{_fallback:"AccountInfoWithRefCount",nonce:"Index",consumers:"RefCount",providers:"RefCount",data:"AccountData"},AccountInfoWithProviders:"AccountInfoWithDualRefCount",AccountInfoWithTripleRefCount:{_fallback:"AccountInfoWithDualRefCount",nonce:"Index",consumers:"RefCount",providers:"RefCount",sufficients:"RefCount",data:"AccountData"},ApplyExtrinsicResult:"Result<DispatchOutcome, TransactionValidityError>",ArithmeticError:{_enum:["Underflow","Overflow","DivisionByZero"]},BlockLength:{max:"PerDispatchClassU32"},BlockWeights:{baseBlock:"Weight",maxBlock:"Weight",perClass:"PerDispatchClassWeightsPerClass"},ChainProperties:"GenericChainProperties",ChainType:{_enum:{Development:"Null",Local:"Null",Live:"Null",Custom:"Text"}},ConsumedWeight:"PerDispatchClassWeight",DigestOf:"Digest",DispatchClass:{_enum:["Normal","Operational","Mandatory"]},DispatchError:{_enum:{Other:"Null",CannotLookup:"Null",BadOrigin:"Null",Module:"DispatchErrorModule",ConsumerRemaining:"Null",NoProviders:"Null",Token:"TokenError",Arithmetic:"ArithmeticError"}},DispatchErrorModule:{index:"u8",error:"u8"},DispatchErrorModuleU8a:{index:"u8",error:"[u8; 4]"},DispatchErrorTo198:{module:"Option<u8>",error:"u8"},DispatchInfo:{weight:"Weight",class:"DispatchClass",paysFee:"Pays"},DispatchInfoTo190:{weight:"Weight",class:"DispatchClass"},DispatchInfoTo244:{weight:"Weight",class:"DispatchClass",paysFee:"bool"},DispatchOutcome:"Result<(), DispatchError>",DispatchResult:"Result<(), DispatchError>",DispatchResultOf:"DispatchResult",DispatchResultTo198:"Result<(), Text>",Event:"GenericEvent",EventId:"[u8; 2]",EventIndex:"u32",EventRecord:{phase:"Phase",event:"Event",topics:"Vec<Hash>"},Health:{peers:"u64",isSyncing:"bool",shouldHavePeers:"bool"},InvalidTransaction:{_enum:{Call:"Null",Payment:"Null",Future:"Null",Stale:"Null",BadProof:"Null",AncientBirthBlock:"Null",ExhaustsResources:"Null",Custom:"u8",BadMandatory:"Null",MandatoryDispatch:"Null"}},Key:"Bytes",LastRuntimeUpgradeInfo:{specVersion:"Compact<u32>",specName:"Text"},NetworkState:{peerId:"Text",listenedAddresses:"Vec<Text>",externalAddresses:"Vec<Text>",connectedPeers:"HashMap<Text, Peer>",notConnectedPeers:"HashMap<Text, NotConnectedPeer>",averageDownloadPerSec:"u64",averageUploadPerSec:"u64",peerset:"NetworkStatePeerset"},NetworkStatePeerset:{messageQueue:"u64",nodes:"HashMap<Text, NetworkStatePeersetInfo>"},NetworkStatePeersetInfo:{connected:"bool",reputation:"i32"},NodeRole:{_enum:{Full:"Null",LightClient:"Null",Authority:"Null",UnknownRole:"u8"}},NotConnectedPeer:{knownAddresses:"Vec<Text>",latestPingTime:"Option<PeerPing>",versionString:"Option<Text>"},Peer:{enabled:"bool",endpoint:"PeerEndpoint",knownAddresses:"Vec<Text>",latestPingTime:"PeerPing",open:"bool",versionString:"Text"},PeerEndpoint:{listening:"PeerEndpointAddr"},PeerEndpointAddr:{_alias:{localAddr:"local_addr",sendBackAddr:"send_back_addr"},localAddr:"Text",sendBackAddr:"Text"},PeerPing:{nanos:"u64",secs:"u64"},PeerInfo:{peerId:"Text",roles:"Text",protocolVersion:"u32",bestHash:"Hash",bestNumber:"BlockNumber"},PerDispatchClassU32:{normal:"u32",operational:"u32",mandatory:"u32"},PerDispatchClassWeight:{normal:"Weight",operational:"Weight",mandatory:"Weight"},PerDispatchClassWeightsPerClass:{normal:"WeightPerClass",operational:"WeightPerClass",mandatory:"WeightPerClass"},Phase:{_enum:{ApplyExtrinsic:"u32",Finalization:"Null",Initialization:"Null"}},RawOrigin:{_enum:{Root:"Null",Signed:"AccountId",None:"Null"}},RefCount:"u32",RefCountTo259:"u8",SyncState:{startingBlock:"BlockNumber",currentBlock:"BlockNumber",highestBlock:"Option<BlockNumber>"},SystemOrigin:"RawOrigin",TokenError:{_enum:["NoFunds","WouldDie","BelowMinimum","CannotCreate","UnknownAsset","Frozen","Underflow","Overflow"]},TransactionValidityError:{_enum:{Invalid:"InvalidTransaction",Unknown:"UnknownTransaction"}},UnknownTransaction:{_enum:{CannotLookup:"Null",NoUnsignedValidator:"Null",Custom:"u8"}},WeightPerClass:{baseExtrinsic:"Weight",maxExtrinsic:"Option<Weight>",maxTotal:"Option<Weight>",reserved:"Option<Weight>"}}},qC={rpc:{},types:{Bounty:{proposer:"AccountId",value:"Balance",fee:"Balance",curatorDeposit:"Balance",bond:"Balance",status:"BountyStatus"},BountyIndex:"u32",BountyStatus:{_enum:{Proposed:"Null",Approved:"Null",Funded:"Null",CuratorProposed:"BountyStatusCuratorProposed",Active:"BountyStatusActive",PendingPayout:"BountyStatusPendingPayout"}},BountyStatusActive:{curator:"AccountId",updateDue:"BlockNumber"},BountyStatusCuratorProposed:{curator:"AccountId"},BountyStatusPendingPayout:{curator:"AccountId",beneficiary:"AccountId",unlockAt:"BlockNumber"},OpenTip:{reason:"Hash",who:"AccountId",finder:"AccountId",deposit:"Balance",closes:"Option<BlockNumber>",tips:"Vec<OpenTipTip>",findersFee:"bool"},OpenTipTo225:{reason:"Hash",who:"AccountId",finder:"Option<OpenTipFinderTo225>",closes:"Option<BlockNumber>",tips:"Vec<OpenTipTip>"},OpenTipFinderTo225:"(AccountId, Balance)",OpenTipTip:"(AccountId, Balance)",TreasuryProposal:{proposer:"AccountId",value:"Balance",beneficiary:"AccountId",bond:"Balance"}}},DC={rpc:{},types:{Multiplier:"Fixed128"}},VC={rpc:{},types:{ClassId:"u32",InstanceId:"u32",DepositBalance:"Balance",DepositBalanceOf:"Balance",ClassDetails:{owner:"AccountId",issuer:"AccountId",admin:"AccountId",freezer:"AccountId",totalDeposit:"DepositBalance",freeHolding:"bool",instances:"u32",instanceMetadatas:"u32",attributes:"u32",isFrozen:"bool"},DestroyWitness:{instances:"Compact<u32>",instanceMetadatas:"Compact<u32>",attributes:"Compact<u32>"},InstanceDetails:{owner:"AccountId",approved:"Option<AccountId>",isFrozen:"bool",deposit:"DepositBalance"},ClassMetadata:{deposit:"DepositBalance",data:"Vec<u8>",isFrozen:"bool"},InstanceMetadata:{deposit:"DepositBalance",data:"Vec<u8>",isFrozen:"bool"}}},jC={rpc:{},types:{Multisig:{when:"Timepoint",deposit:"Balance",depositor:"AccountId",approvals:"Vec<AccountId>"},Timepoint:{height:"BlockNumber",index:"u32"}}},FC={rpc:{},types:{VestingInfo:{locked:"Balance",perBlock:"Balance",startingBlock:"BlockNumber"}}},HC={rpc:{},types:{BlockAttestations:{receipt:"CandidateReceipt",valid:"Vec<AccountId>",invalid:"Vec<AccountId>"},IncludedBlocks:{actualNumber:"BlockNumber",session:"SessionIndex",randomSeed:"H256",activeParachains:"Vec<ParaId>",paraBlocks:"Vec<Hash>"},MoreAttestations:{}}},WC={rpc:{},types:{BridgedBlockHash:"H256",BridgedBlockNumber:"BlockNumber",BridgedHeader:"Header",BridgeMessageId:"(LaneId, MessageNonce)",CallOrigin:{_enum:{SourceRoot:"Null",TargetAccount:"(AccountId, MultiSigner, MultiSignature)",SourceAccount:"AccountId"}},ChainId:"[u8; 4]",DeliveredMessages:{begin:"MessageNonce",end:"MessageNonce",dispatchResults:"BitVec"},DispatchFeePayment:{_enum:["AtSourceChain","AtTargetChain"]},InboundLaneData:{relayers:"Vec<UnrewardedRelayer>",lastConfirmedNonce:"MessageNonce"},InboundRelayer:"AccountId",InitializationData:{header:"Header",authorityList:"AuthorityList",setId:"SetId",isHalted:"bool"},LaneId:"[u8; 4]",MessageData:{payload:"Bytes",fee:"Balance"},MessagesDeliveryProofOf:{bridgedHeaderHash:"BlockHash",storageProof:"Vec<Bytes>",lane:"LaneId"},MessageKey:{laneId:"LaneId",nonce:"MessageNonce"},MessageNonce:"u64",MessagesProofOf:{bridgedHeaderHash:"BridgedBlockHash",storageProof:"Vec<Bytes>",lane:"LaneId",noncesStart:"MessageNonce",noncesEnd:"MessageNonce"},OperatingMode:{_enum:["Normal","RejectingOutboundMessages","Halted"]},OutboundLaneData:{oldestUnprunedNonce:"MessageNonce",latestReceivedNonce:"MessageNonce",latestGeneratedNonce:"MessageNonce"},OutboundMessageFee:"Balance",OutboundPayload:{specVersion:"u32",weight:"Weight",origin:"CallOrigin",dispatchFeePayment:"DispatchFeePayment",call:"Bytes"},Parameter:"Null",RelayerId:"AccountId",UnrewardedRelayer:{relayer:"RelayerId",messages:"DeliveredMessages"},UnrewardedRelayersState:{unrewardedRelayer_Entries:"MessageNonce",messagesInOldestEntry:"MessageNonce",totalMessages:"MessageNonce"}}},KC={rpc:{},types:{StatementKind:{_enum:["Regular","Saft"]}}},XC={rpc:{},types:{FundIndex:"u32",LastContribution:{_enum:{Never:"Null",PreEnding:"u32",Ending:"BlockNumber"}},FundInfo:{depositor:"AccountId",verifier:"Option<MultiSigner>",deposit:"Balance",raised:"Balance",end:"BlockNumber",cap:"Balance",lastContribution:"LastContribution",firstPeriod:"LeasePeriod",lastPeriod:"LeasePeriod",trieIndex:"TrieIndex"},TrieIndex:"u32"}},GC={rpc:{},types:{ConfigData:{maxIndividual:"Weight"},MessageId:"[u8; 32]",OverweightIndex:"u64",PageCounter:"u32",PageIndexData:{beginUsed:"PageCounter",endUsed:"PageCounter",overweightCount:"OverweightIndex"}}},ZC={_enum:["ZeroZero","ZeroOne","ZeroTwo","ZeroThree","OneOne","OneTwo","OneThree","TwoTwo","TwoThree","ThreeThree"]},JC={_enum:["ZeroZero","ZeroOne","ZeroTwo","ZeroThree","ZeroFour","ZeroFive","ZeroSix","ZeroSeven","OneOne","OneTwo","OneThree","OneFour","OneFive","OneSix","OneSeven","TwoTwo","TwoThree","TwoFour","TwoFive","TwoSix","TwoSeven","ThreeThree","ThreeFour","ThreeFive","ThreeSix","ThreeSeven","FourFour","FourFive","FourSix","FourSeven","FiveFive","FiveSix","FiveSeven","SixSix","SixSeven","SevenSeven"]},YC=Im({},{Bidder:{_enum:{New:"NewBidder",Existing:"ParaId"}},IncomingParachain:{_enum:{Unset:"NewBidder",Fixed:"IncomingParachainFixed",Deploy:"IncomingParachainDeploy"}},IncomingParachainDeploy:{code:"ValidationCode",initialHeadData:"HeadData"},IncomingParachainFixed:{codeHash:"Hash",codeSize:"u32",initialHeadData:"HeadData"},NewBidder:{who:"AccountId",sub:"SubId"},SubId:"u32"},{AuctionIndex:"u32",LeasePeriod:"BlockNumber",LeasePeriodOf:"BlockNumber",SlotRange10:ZC,SlotRange:JC,WinningData10:`[WinningDataEntry; ${ZC._enum.length}]`,WinningData:`[WinningDataEntry; ${JC._enum.length}]`,WinningDataEntry:"Option<(AccountId, ParaId, BalanceOf)>",WinnersData10:"Vec<WinnersDataTuple10>",WinnersData:"Vec<WinnersDataTuple>",WinnersDataTuple10:"(AccountId, ParaId, BalanceOf, SlotRange10)",WinnersDataTuple:"(AccountId, ParaId, BalanceOf, SlotRange)"}),QC={rpc:{},types:Im({},{ServiceQuality:{_enum:["Ordered","Fast"]}},{DisputeLocation:{_enum:["Local","Remote"]},DisputeResult:{_enum:["Valid","Invalid"]},DisputeState:{validatorsFor:"BitVec",validatorsAgainst:"BitVec",start:"BlockNumber",concludedAt:"Option<BlockNumber>"},DisputeStatement:{_enum:{Valid:"ValidDisputeStatementKind",Invalid:"InvalidDisputeStatementKind"}},DisputeStatementSet:{candidateHash:"CandidateHash",session:"SessionIndex",statements:"Vec<(DisputeStatement, ParaValidatorIndex, ValidatorSignature)>"},ExplicitDisputeStatement:{valid:"bool",candidateHash:"CandidateHash",session:"SessionIndex"},InvalidDisputeStatementKind:{_enum:["Explicit"]},MultiDisputeStatementSet:"Vec<DisputeStatementSet>",ValidDisputeStatementKind:{_enum:{Explicit:"Null",BackingSeconded:"Hash",BackingValid:"Hash",ApprovalChecking:"Null"}}},{HrmpChannel:{maxCapacity:"u32",maxTotalSize:"u32",maxMessageSize:"u32",msgCount:"u32",totalSize:"u32",mqcHead:"Option<Hash>",senderDeposit:"Balance",recipientDeposit:"Balance"},HrmpChannelId:{sender:"u32",receiver:"u32"},HrmpOpenChannelRequest:{confirmed:"bool",age:"SessionIndex",senderDeposit:"Balance",maxMessageSize:"u32",maxCapacity:"u32",maxTotalSize:"u32"}},{ParachainProposal:{proposer:"AccountId",genesisHead:"HeadData",validators:"Vec<ValidatorId>",name:"Bytes",balance:"Balance"},RegisteredParachainInfo:{validators:"Vec<ValidatorId>",proposer:"AccountId"}},YC,{AbridgedCandidateReceipt:{parachainIndex:"ParaId",relayParent:"Hash",headData:"HeadData",collator:"CollatorId",signature:"CollatorSignature",povBlockHash:"Hash",commitments:"CandidateCommitments"},AbridgedHostConfiguration:{maxCodeSize:"u32",maxHeadDataSize:"u32",maxUpwardQueueCount:"u32",maxUpwardQueueSize:"u32",maxUpwardMessageSize:"u32",maxUpwardMessageNumPerCandidate:"u32",hrmpMaxMessageNumPerCandidate:"u32",validationUpgradeFrequency:"BlockNumber",validationUpgradeDelay:"BlockNumber"},AbridgedHrmpChannel:{maxCapacity:"u32",maxTotalSize:"u32",maxMessageSize:"u32",msgCount:"u32",totalSize:"u32",mqcHead:"Option<Hash>"},AssignmentId:"AccountId",AssignmentKind:{_enum:{Parachain:"Null",Parathread:"(CollatorId, u32)"}},AttestedCandidate:{candidate:"AbridgedCandidateReceipt",validityVotes:"Vec<ValidityAttestation>",validatorIndices:"BitVec"},AuthorityDiscoveryId:"AccountId",AvailabilityBitfield:"BitVec",AvailabilityBitfieldRecord:{bitfield:"AvailabilityBitfield",submittedTt:"BlockNumber"},BackedCandidate:{candidate:"CommittedCandidateReceipt",validityVotes:"Vec<ValidityAttestation>",validatorIndices:"BitVec"},BufferedSessionChange:{applyAt:"BlockNumber",validators:"Vec<ValidatorId>",queued:"Vec<ValidatorId>",sessionIndex:"SessionIndex"},CandidateCommitments:{upwardMessages:"Vec<UpwardMessage>",horizontalMessages:"Vec<OutboundHrmpMessage>",newValidationCode:"Option<ValidationCode>",headData:"HeadData",processedDownwardMessages:"u32",hrmpWatermark:"BlockNumber"},CandidateDescriptor:{paraId:"ParaId",relayParent:"RelayChainHash",collatorId:"CollatorId",persistedValidationDataHash:"Hash",povHash:"Hash",erasureRoot:"Hash",signature:"CollatorSignature",paraHead:"Hash",validationCodeHash:"ValidationCodeHash"},CandidateHash:"Hash",CandidateInfo:{who:"AccountId",deposit:"Balance"},CandidatePendingAvailability:{core:"CoreIndex",hash:"CandidateHash",descriptor:"CandidateDescriptor",availabilityVotes:"BitVec",backers:"BitVec",relayParentNumber:"BlockNumber",backedInNumber:"BlockNumber",backingGroup:"GroupIndex"},CandidateReceipt:{descriptor:"CandidateDescriptor",commitmentsHash:"Hash"},GlobalValidationData:{maxCodeSize:"u32",maxHeadDataSize:"u32",blockNumber:"BlockNumber"},CollatorId:"H256",CollatorSignature:"Signature",CommittedCandidateReceipt:{descriptor:"CandidateDescriptor",commitments:"CandidateCommitments"},CoreAssignment:{core:"CoreIndex",paraId:"ParaId",kind:"AssignmentKind",groupIdx:"GroupIndex"},CoreIndex:"u32",CoreOccupied:{_enum:{Parathread:"ParathreadEntry",Parachain:"Null"}},DoubleVoteReport:{identity:"ValidatorId",first:"(Statement, ValidatorSignature)",second:"(Statement, ValidatorSignature)",proof:"MembershipProof",signingContext:"SigningContext"},DownwardMessage:"Bytes",GroupIndex:"u32",GlobalValidationSchedule:{maxCodeSize:"u32",maxHeadDataSize:"u32",blockNumber:"BlockNumber"},HeadData:"Bytes",HostConfiguration:{maxCodeSize:"u32",maxHeadDataSize:"u32",maxUpwardQueueCount:"u32",maxUpwardQueueSize:"u32",maxUpwardMessageSize:"u32",maxUpwardMessageNumPerCandidate:"u32",hrmpMaxMessageNumPerCandidate:"u32",validationUpgradeFrequency:"BlockNumber",validationUpgradeDelay:"BlockNumber",maxPovSize:"u32",maxDownwardMessageSize:"u32",preferredDispatchableUpwardMessagesStepWeight:"Weight",hrmpMaxParachainOutboundChannels:"u32",hrmpMaxParathreadOutboundChannels:"u32",hrmpOpenRequestTtl:"u32",hrmpSenderDeposit:"Balance",hrmpRecipientDeposit:"Balance",hrmpChannelMaxCapacity:"u32",hrmpChannelMaxTotalSize:"u32",hrmpMaxParachainInboundChannels:"u32",hrmpMaxParathreadInboundChannels:"u32",hrmpChannelMaxMessageSize:"u32",codeRetentionPeriod:"BlockNumber",parathreadCores:"u32",parathreadRetries:"u32",groupRotationFrequency:"BlockNumber",chainAvailabilityPeriod:"BlockNumber",threadAvailabilityPeriod:"BlockNumber",schedulingLookahead:"u32",maxValidatorsPerCore:"Option<u32>",maxValidators:"Option<u32>",disputePeriod:"SessionIndex",disputePostConclusionAcceptancePeriod:"BlockNumber",disputeMaxSpamSlots:"u32",disputeConclusionByTimeOutPeriod:"BlockNumber",noShowSlots:"u32",nDelayTranches:"u32",zerothDelayTrancheWidth:"u32",neededApprovals:"u32",relayVrfModuloSamples:"u32"},InboundDownwardMessage:{pubSentAt:"BlockNumber",pubMsg:"DownwardMessage"},InboundHrmpMessage:{sentAt:"BlockNumber",data:"Bytes"},InboundHrmpMessages:"Vec<InboundHrmpMessage>",LocalValidationData:{parentHead:"HeadData",balance:"Balance",codeUpgradeAllowed:"Option<BlockNumber>"},MessageIngestionType:{downwardMessages:"Vec<InboundDownwardMessage>",horizontalMessages:"BTreeMap<ParaId, InboundHrmpMessages>"},MessageQueueChain:"RelayChainHash",OutboundHrmpMessage:{recipient:"u32",data:"Bytes"},ParachainDispatchOrigin:{_enum:["Signed","Parachain","Root"]},ParachainInherentData:{validationData:"PersistedValidationData",relayChainState:"StorageProof",downwardMessages:"Vec<InboundDownwardMessage>",horizontalMessages:"BTreeMap<ParaId, VecInboundHrmpMessage>"},ParachainsInherentData:{bitfields:"SignedAvailabilityBitfields",backedCandidates:"Vec<BackedCandidate>",disputes:"MultiDisputeStatementSet",parentHeader:"Header"},ParaGenesisArgs:{genesisHead:"Bytes",validationCode:"Bytes",parachain:"bool"},ParaId:"u32",ParaInfo:{manager:"AccountId",deposit:"Balance",locked:"bool"},ParaLifecycle:{_enum:["Onboarding","Parathread","Parachain","UpgradingToParachain","DowngradingToParathread","OutgoingParathread","OutgoingParachain"]},ParaPastCodeMeta:{upgradeTimes:"Vec<ReplacementTimes>",lastPruned:"Option<BlockNumber>"},ParaScheduling:{_enum:["Always","Dynamic"]},ParathreadClaim:"(ParaId, CollatorId)",ParathreadClaimQueue:{queue:"Vec<QueuedParathread>",nextCoreOffset:"u32"},ParathreadEntry:{claim:"ParathreadClaim",retries:"u32"},ParaValidatorIndex:"u32",PersistedValidationData:{parentHead:"HeadData",relayParentNumber:"RelayChainBlockNumber",relayParentStorageRoot:"Hash",maxPovSize:"u32"},QueuedParathread:{claim:"ParathreadEntry",coreOffset:"u32"},RelayBlockNumber:"u32",RelayChainBlockNumber:"RelayBlockNumber",RelayHash:"Hash",RelayChainHash:"RelayHash",Remark:"[u8; 32]",ReplacementTimes:{expectedAt:"BlockNumber",activatedAt:"BlockNumber"},Retriable:{_enum:{Never:"Null",WithRetries:"u32"}},Scheduling:{_enum:["Always","Dynamic"]},SessionInfo:{validators:"Vec<ValidatorId>",discoveryKeys:"Vec<AuthorityDiscoveryId>",assignmentKeys:"Vec<AssignmentId>",validatorGroups:"Vec<SessionInfoValidatorGroup>",nCores:"u32",zerothDelayTrancheWidth:"u32",relayVrfModuloSamples:"u32",nDelayTranches:"u32",noShowSlots:"u32",neededApprovals:"u32"},SessionInfoValidatorGroup:"Vec<ParaValidatorIndex>",SignedAvailabilityBitfield:{payload:"BitVec",validatorIndex:"ParaValidatorIndex",signature:"ValidatorSignature"},SignedAvailabilityBitfields:"Vec<SignedAvailabilityBitfield>",SigningContext:{sessionIndex:"SessionIndex",parentHash:"Hash"},Statement:{_enum:{Never:"Null",Candidate:"Hash",Valid:"Hash",Invalid:"Hash"}},TransientValidationData:{maxCodeSize:"u32",maxHeadDataSize:"u32",balance:"Balance",codeUpgradeAllowed:"Option<BlockNumber>",dmqLength:"u32"},UpgradeGoAhead:{_enum:["Abort","GoAhead"]},UpgradeRestriction:{_enum:["Present"]},UpwardMessage:"Bytes",ValidationFunctionParams:{maxCodeSize:"u32",relayChainHeight:"RelayChainBlockNumber",codeUpgradeAllowed:"Option<RelayChainBlockNumber>"},ValidationCode:"Bytes",ValidationCodeHash:"Hash",ValidationData:{persisted:"PersistedValidationData",transient:"TransientValidationData"},ValidationDataType:{validationData:"ValidationData",relayChainState:"Vec<Bytes>"},ValidatorSignature:"Signature",ValidityAttestation:{_enum:{Never:"Null",Implicit:"ValidatorSignature",Explicit:"ValidatorSignature"}},MessagingStateSnapshot:{relayDispatchQueueSize:"(u32, u32)",egressChannels:"Vec<MessagingStateSnapshotEgressEntry>"},MessagingStateSnapshotEgressEntry:"(ParaId, AbridgedHrmpChannel)",SystemInherentData:"ParachainInherentData",VecInboundHrmpMessage:"Vec<InboundHrmpMessage>"})},$C={rpc:{},types:{Approvals:"[bool; 4]"}},eR={rpc:{},types:{AccountStatus:{validity:"AccountValidity",freeBalance:"Balance",lockedBalance:"Balance",signature:"Vec<u8>",vat:"Permill"},AccountValidity:{_enum:["Invalid","Initiated","Pending","ValidLow","ValidHigh","Completed"]}}};let tR;Em(QI,null,[YI]),function(e){e[e.BTreeMap=0]="BTreeMap",e[e.BTreeSet=1]="BTreeSet",e[e.Compact=2]="Compact",e[e.DoNotConstruct=3]="DoNotConstruct",e[e.Enum=4]="Enum",e[e.HashMap=5]="HashMap",e[e.Int=6]="Int",e[e.Linkage=7]="Linkage",e[e.Null=8]="Null",e[e.Option=9]="Option",e[e.Plain=10]="Plain",e[e.Range=11]="Range",e[e.RangeInclusive=12]="RangeInclusive",e[e.Result=13]="Result",e[e.Set=14]="Set",e[e.Si=15]="Si",e[e.Struct=16]="Struct",e[e.Tuple=17]="Tuple",e[e.UInt=18]="UInt",e[e.Vec=19]="Vec",e[e.VecFixed=20]="VecFixed",e[e.WrapperKeepOpaque=21]="WrapperKeepOpaque",e[e.WrapperOpaque=22]="WrapperOpaque"}(tR||(tR={}));function rR(e){return mm(e.eq)}function nR(e,t){return!!Array.isArray(t)&&(e.length===t.length&&ym(e.find(((e,r)=>rR(e)?!e.eq(t[r]):e!==t[r]))))}Em(YI,null,[]);class iR extends Array{constructor(e,t,r){super(t.length);for(let n=0;n<t.length;n++)this[n]=t[n];this.registry=e,this.initialU8aLength=r}get encodedLength(){let e=Kg(this.length).length;for(let t=0;t<this.length;t++)e+=this[t].encodedLength;return e}get hash(){return this.registry.hash(this.toU8a())}get isEmpty(){return 0===this.length}get length(){return super.length}eq(e){return nR(this,e)}inspect(){return{inner:this.inspectInner(),outer:[Kg(this.length)]}}inspectInner(){const e=new Array(this.length);for(let t=0;t<this.length;t++)e[t]=this[t].inspect();return e}toArray(){return Array.from(this)}toHex(){return hg(this.toU8a())}toHuman(e){const t=new Array(this.length);for(let r=0;r<this.length;r++)t[r]=this[r].toHuman(e);return t}toJSON(){const e=new Array(this.length);for(let t=0;t<this.length;t++)e[t]=this[t].toJSON();return e}toString(){const e=new Array(this.length);for(let t=0;t<this.length;t++)e[t]=this[t].toString();return`[${e.join(", ")}]`}toU8a(e){const t=this.toU8aInner();return e?og(...t):og(Kg(this.length),...t)}toU8aInner(e){const t=new Array(this.length);for(let r=0;r<this.length;r++)t[r]=this[r].toU8a(e);return t}concat(e){return this.toArray().concat(e instanceof iR?e.toArray():e)}filter(e,t){return this.toArray().filter(e,t)}map(e,t){return this.toArray().map(e,t)}includes(e){return this.some((t=>t.eq(e)))}slice(e,t){return this.toArray().slice(e,t)}}const oR=new bu(1e4),sR=[["Perquintill",Pg],["Perbill",Tg],["Permill",Ng],["Percent",Ag]];class aR extends bu{#y;#b;constructor(e,t=0,r=64,n=!1){super(tg(t)?ug(t.subarray(0,r/8),{isLe:!0,isNegative:n}).toString():function(e,t){return Hm(e)?e.toString():Vm(e,-1,!0)?Ig(e,{isLe:!1,isNegative:t}).toString():(Ug(e)?bm(e<=Number.MAX_SAFE_INTEGER&&e>=Number.MIN_SAFE_INTEGER&&Math.floor(e)===e,"Number needs to be an integer <= Number.MAX_SAFE_INTEGER, i.e. 2 ^ 53 - 1"):ay(e)&&bm(!(e.includes(".")||e.includes(",")||e.includes("e")),"String should not contain decimal points or scientific notation"),Og(e).toString())}(t,n)),this.registry=e,this.#y=r,this.encodedLength=this.#y/8,this.#b=n;const i=this.gte(kg),o=r-(n&&i?1:0);bm(n||i,(()=>`${this.toRawType()}: Negative number passed to unsigned type`)),bm(super.bitLength()<=o,(()=>`${this.toRawType()}: Input too large. Found input with ${super.bitLength()} bits, expected ${o}`))}get hash(){return this.registry.hash(this.toU8a())}get isEmpty(){return this.isZero()}get isUnsigned(){return!this.#b}bitLength(){return this.#y}eq(e){return super.eq(Vm(e)?Ig(e.toString(),{isLe:!1,isNegative:this.#b}):Og(e))}inspect(){return{outer:[this.toU8a()]}}isMax(){return this.toU8a().filter((e=>255===e)).length===this.#y/8}toBigInt(){return BigInt(this.toString())}toBn(){return this}toHex(e=!1){return function(e,t=Dg,r){return e?hg(qg(e,Im({isLe:!1,isNegative:!1},Ug(t)?{bitLength:t,isLe:r}:t))):"0x00"}(this,{bitLength:this.bitLength(),isLe:e,isNegative:!this.isUnsigned})}toHuman(e){const t=this.toRawType();if("Balance"===t)return this.isMax()?"everything":iy(this,{decimals:this.registry.chainDecimals[0],withSi:!0,withUnit:this.registry.chainTokens[0]});const[,r]=sR.find((([e])=>e===t))||[];return r?function(e,t){return`${(e.mul(oR).div(t).toNumber()/100).toFixed(2)}%`}(this,r):sy(this)}toJSON(e=!1){return e||super.bitLength()>52?this.toHex():this.toNumber()}toRawType(){return this instanceof this.registry.createClassUnsafe("Balance")?"Balance":`${this.isUnsigned?"u":"i"}${this.bitLength()}`}toString(e){return super.toString(e)}toU8a(e){return qg(this,{bitLength:this.bitLength(),isLe:!0,isNegative:!this.isUnsigned})}}class cR{#v;#w;constructor(e,t,r){this.#v=e,this.#w=t,this.initialU8aLength=r}get encodedLength(){return this.toU8a().length}get hash(){return this.registry.hash(this.toU8a())}get inner(){return this.#w}get isEmpty(){return this.#w.isEmpty}get registry(){return this.#v}eq(e){return this.#w.eq(e)}inspect(){return this.#w.inspect()}toHex(e){return this.#w.toHex(e)}toHuman(e){return this.#w.toHuman(e)}toJSON(){return this.#w.toJSON()}toString(){return this.#w.toString()}toU8a(e){return this.#w.toU8a(e)}toRawType(){return"Base"}unwrap(){return this.#w}}function uR(e,t){return e.size===t.length&&!t.some((t=>{return r=t,!Array.isArray(r)||2!==r.length||function(e,t){return ym(e)||(rR(e)?!e.eq(t):e!==t)}(e.get(t[0]),t[1]);var r}))}function lR(e,t){return Array.isArray(t)?uR(e,t):t instanceof Map?uR(e,[...t.entries()]):!!Wm(t)&&uR(e,Object.entries(t))}function hR(e,t){return e.size===t.length&&!t.some((t=>!e.has(t)))}function dR(e,t,r,n){return`decodeU8a: failed at ${hg(r)}\u2026${n?` on ${n}`:""}${t?`: ${t}`:""}:: ${e.message}`}function fR(e,t){try{return new t(e).toRawType()}catch{return null}}function pR(e,t,r,n){const[i,o]=Array.isArray(r)?[r,[]]:[Object.values(r),Object.keys(r)],s=new Array(i.length);let a=0;for(let c=0;c<i.length;c++)try{const r=new i[c](e,t.subarray(a));a+=r.initialU8aLength||r.encodedLength,s[c]=n?[o[c],r]:r}catch(h2){throw new Error(dR(h2,fR(e,i[c]),t.subarray(a,a+16),o[c]))}return[s,a]}function mR(e,t,r,n,i){const o=new Array(i);let s=r;for(let a=0;a<i;a++)try{const r=new n(e,t.subarray(s));s+=r.initialU8aLength||r.encodedLength,o[a]=r}catch(h2){throw new Error(dR(h2,fR(e,n),t.subarray(s,s+16)))}return[o,s,s-r]}function gR(e,t){return ay(t)?e.createClassUnsafe(t):t}function yR(e,t){const r=Object.entries(t),n={};for(let i=0;i<r.length;i++)n[r[i][0]]=gR(e,r[i][1]);return n}const bR=["BTreeMap","BTreeSet","HashMap","Vec"],vR=bR.concat(["Compact","DoNotConstruct","Int","Linkage","Range","RangeInclusive","Result","Option","UInt","WrapperKeepOpaque","WrapperOpaque"]),wR=["<","(","[",'"',","," "],xR=[SR("<T::InherentOfflineReport as InherentOfflineReport>::Inherent","InherentOfflineReport",!1),SR("VecDeque<","Vec<",!1),e=>{for(let t=0;t<e.length;t++)if("<"===e[t]){const r=kR(e,t+1)-14;" as HasCompact"===e.substring(r,r+14)&&(e=`Compact<${e.substring(t+1,r)}>`)}return e},AR("Bounded",!0),AR("Weak",!1),function(){const e=/\s/g,t=/(T|Self)::/g,r=/<(T|Self)asTrait>::/g,n=/<Tas[a-z]+::Trait>::/g,i=/<LookupasStaticLookup>/g,o=/::Type/g;return s=>(e.lastIndex=0,t.lastIndex=0,r.lastIndex=0,n.lastIndex=0,i.lastIndex=0,o.lastIndex=0,s.replace(e,"").replace(t,"").replace(r,"").replace(n,"").replace(i,"Lookup").replace(o,""))}(),function(){const e=e=>`(${e},${e})`;return t=>ER(t,"PairOf<",e)}(),function(e){const t=e=>e;return r=>ER(r,e,t)}("Box<"),e=>{for(let t=0;t<e.length;t++)if("<"===e[t]&&!vR.find((r=>{const n=t-r.length;return n>=0&&e.substring(n,n+r.length)===r&&(0===n||wR.includes(e[n-1]))}))){const r=kR(e,t+1);e=`${e.substring(0,t)}${e.substring(r+1)}`}return e},SR("String","Text"),SR("Vec<u8>","Bytes"),SR("&\\[u8\\]","Bytes"),SR("&'static\\[u8\\]","Bytes"),SR("RawAddress","Address"),SR("Lookup::Source","LookupSource"),SR("Lookup::Target","LookupTarget"),SR("exec::StorageKey","ContractStorageKey"),function(){const e=/,\)/g,t=/\(([^,]+)\)/;return r=>(e.lastIndex=0,r.replace(e,")").r
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment