1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[418],{95840:(e,t)=>{"use strict";function r(e){if(!Number.isSafeInteger(e)||e<0)throw Error(`Wrong positive integer: ${e}`)}function n(e){if("boolean"!=typeof e)throw Error(`Expected boolean, not ${e}`)}function i(e){return e instanceof Uint8Array||null!=e&&"object"==typeof e&&"Uint8Array"===e.constructor.name}function o(e,...t){if(!i(e))throw Error("Expected Uint8Array");if(t.length>0&&!t.includes(e.length))throw Error(`Expected Uint8Array of length ${t}, not of length=${e.length}`)}function s(e){if("function"!=typeof e||"function"!=typeof e.create)throw Error("Hash should be wrapped by utils.wrapConstructor");r(e.outputLen),r(e.blockLen)}function a(e,t=!0){if(e.destroyed)throw Error("Hash instance has been destroyed");if(t&&e.finished)throw Error("Hash#digest() has already been called")}function c(e,t){o(e);let r=t.outputLen;if(e.length<r)throw Error(`digestInto() expects output buffer of length at least ${r}`)}Object.defineProperty(t,"__esModule",{value:!0}),t.output=t.exists=t.hash=t.bytes=t.bool=t.number=void 0,t.number=r,t.bool=n,t.bytes=o,t.hash=s,t.exists=a,t.output=c;let u={number:r,bool:n,bytes:o,hash:s,exists:a,output:c};t.default=u},61390:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.SHA2=void 0;let n=r(95840),i=r(89346);function o(e,t,r,n){if("function"==typeof e.setBigUint64)return e.setBigUint64(t,r,n);let i=BigInt(32),o=BigInt(0xffffffff),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)}class s extends i.Hash{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=(0,i.createView)(this.buffer)}update(e){(0,n.exists)(this);let{view:t,buffer:r,blockLen:o}=this,s=(e=(0,i.toBytes)(e)).length;for(let n=0;n<s;){let a=Math.min(o-this.pos,s-n);if(a===o){let t=(0,i.createView)(e);for(;o<=s-n;n+=o)this.process(t,n);continue}r.set(e.subarray(n,n+a),this.pos),this.pos+=a,n+=a,this.pos===o&&(this.process(t,0),this.pos=0)}return this.length+=e.length,this.roundClean(),this}digestInto(e){(0,n.exists)(this),(0,n.output)(e,this),this.finished=!0;let{buffer:t,view:r,blockLen:s,isLE:a}=this,{pos:c}=this;t[c++]=128,this.buffer.subarray(c).fill(0),this.padOffset>s-c&&(this.process(r,0),c=0);for(let e=c;e<s;e++)t[e]=0;o(r,s-8,BigInt(8*this.length),a),this.process(r,0);let u=(0,i.createView)(e),l=this.outputLen;if(l%4)throw Error("_sha2: outputLen should be aligned to 32bit");let d=l/4,f=this.get();if(d>f.length)throw Error("_sha2: outputLen bigger than state");for(let e=0;e<d;e++)u.setUint32(4*e,f[e],a)}digest(){let{buffer:e,outputLen:t}=this;this.digestInto(e);let r=e.slice(0,t);return this.destroy(),r}_cloneInto(e){e||(e=new this.constructor),e.set(...this.get());let{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}}t.SHA2=s},88500:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.crypto=void 0,t.crypto="object"==typeof globalThis&&"crypto"in globalThis?globalThis.crypto:void 0},95642:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.sha224=t.sha256=void 0;let n=r(61390),i=r(89346),o=(e,t,r)=>e&t^~e&r,s=(e,t,r)=>e&t^e&r^t&r,a=new Uint32Array([0x428a2f98,0x71374491,0xb5c0fbcf,0xe9b5dba5,0x3956c25b,0x59f111f1,0x923f82a4,0xab1c5ed5,0xd807aa98,0x12835b01,0x243185be,0x550c7dc3,0x72be5d74,0x80deb1fe,0x9bdc06a7,0xc19bf174,0xe49b69c1,0xefbe4786,0xfc19dc6,0x240ca1cc,0x2de92c6f,0x4a7484aa,0x5cb0a9dc,0x76f988da,0x983e5152,0xa831c66d,0xb00327c8,0xbf597fc7,0xc6e00bf3,0xd5a79147,0x6ca6351,0x14292967,0x27b70a85,0x2e1b2138,0x4d2c6dfc,0x53380d13,0x650a7354,0x766a0abb,0x81c2c92e,0x92722c85,0xa2bfe8a1,0xa81a664b,0xc24b8b70,0xc76c51a3,0xd192e819,0xd6990624,0xf40e3585,0x106aa070,0x19a4c116,0x1e376c08,0x2748774c,0x34b0bcb5,0x391c0cb3,0x4ed8aa4a,0x5b9cca4f,0x682e6ff3,0x748f82ee,0x78a5636f,0x84c87814,0x8cc70208,0x90befffa,0xa4506ceb,0xbef9a3f7,0xc67178f2]),c=new Uint32Array([0x6a09e66
17,0xbb67ae85,0x3c6ef372,0xa54ff53a,0x510e527f,0x9b05688c,0x1f83d9ab,0x5be0cd19]),u=new Uint32Array(64);class l extends n.SHA2{constructor(){super(64,32,8,!1),this.A=0|c[0],this.B=0|c[1],this.C=0|c[2],this.D=0|c[3],this.E=0|c[4],this.F=0|c[5],this.G=0|c[6],this.H=0|c[7]}get(){let{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 r=0;r<16;r++,t+=4)u[r]=e.getUint32(t,!1);for(let e=16;e<64;e++){let t=u[e-15],r=u[e-2],n=(0,i.rotr)(t,7)^(0,i.rotr)(t,18)^t>>>3,o=(0,i.rotr)(r,17)^(0,i.rotr)(r,19)^r>>>10;u[e]=o+u[e-7]+n+u[e-16]|0}let{A:r,B:n,C:c,D:l,E:d,F:f,G:h,H:p}=this;for(let e=0;e<64;e++){let t=p+((0,i.rotr)(d,6)^(0,i.rotr)(d,11)^(0,i.rotr)(d,25))+o(d,f,h)+a[e]+u[e]|0,y=((0,i.rotr)(r,2)^(0,i.rotr)(r,13)^(0,i.rotr)(r,22))+s(r,n,c)|0;p=h,h=f,f=d,d=l+t|0,l=c,c=n,n=r,r=t+y|0}r=r+this.A|0,n=n+this.B|0,c=c+this.C|0,l=l+this.D|0,d=d+this.E|0,f=f+this.F|0,h=h+this.G|0,p=p+this.H|0,this.set(r,n,c,l,d,f,h,p)}roundClean(){u.fill(0)}destroy(){this.set(0,0,0,0,0,0,0,0),this.buffer.fill(0)}}class d extends l{constructor(){super(),this.A=-0x3efa6128,this.B=0x367cd507,this.C=0x3070dd17,this.D=-0x8f1a6c7,this.E=-4191439,this.F=0x68581511,this.G=0x64f98fa7,this.H=-0x4105b05c,this.outputLen=28}}t.sha256=(0,i.wrapConstructor)(()=>new l),t.sha224=(0,i.wrapConstructor)(()=>new d)},89346:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.randomBytes=t.wrapXOFConstructorWithOpts=t.wrapConstructorWithOpts=t.wrapConstructor=t.checkOpts=t.Hash=t.concatBytes=t.toBytes=t.utf8ToBytes=t.asyncLoop=t.nextTick=t.hexToBytes=t.bytesToHex=t.isLE=t.rotr=t.createView=t.u32=t.u8=void 0;let n=r(88500),i=e=>new Uint8Array(e.buffer,e.byteOffset,e.byteLength);t.u8=i;let o=e=>new Uint32Array(e.buffer,e.byteOffset,Math.floor(e.byteLength/4));function s(e){return e instanceof Uint8Array||null!=e&&"object"==typeof e&&"Uint8Array"===e.constructor.name}t.u32=o;let a=e=>new DataView(e.buffer,e.byteOffset,e.byteLength);t.createView=a;let c=(e,t)=>e<<32-t|e>>>t;if(t.rotr=c,t.isLE=68===new Uint8Array(new Uint32Array([0x11223344]).buffer)[0],!t.isLE)throw Error("Non little-endian hardware is not supported");let u=Array.from({length:256},(e,t)=>t.toString(16).padStart(2,"0"));function l(e){if(!s(e))throw Error("Uint8Array expected");let t="";for(let r=0;r<e.length;r++)t+=u[e[r]];return t}t.bytesToHex=l;let d={_0:48,_9:57,_A:65,_F:70,_a:97,_f:102};function f(e){return e>=d._0&&e<=d._9?e-d._0:e>=d._A&&e<=d._F?e-(d._A-10):e>=d._a&&e<=d._f?e-(d._a-10):void 0}function h(e){if("string"!=typeof e)throw Error("hex string expected, got "+typeof e);let t=e.length,r=t/2;if(t%2)throw Error("padded hex string expected, got unpadded hex of length "+t);let n=new Uint8Array(r);for(let t=0,i=0;t<r;t++,i+=2){let r=f(e.charCodeAt(i)),o=f(e.charCodeAt(i+1));if(void 0===r||void 0===o)throw Error('hex string expected, got non-hex character "'+(e[i]+e[i+1])+'" at index '+i);n[t]=16*r+o}return n}t.hexToBytes=h;let p=async()=>{};async function y(e,r,n){let i=Date.now();for(let o=0;o<e;o++){n(o);let e=Date.now()-i;e>=0&&e<r||(await (0,t.nextTick)(),i+=e)}}function g(e){if("string"!=typeof e)throw Error(`utf8ToBytes expected string, got ${typeof e}`);return new Uint8Array(new TextEncoder().encode(e))}function m(e){if("string"==typeof e&&(e=g(e)),!s(e))throw Error(`expected Uint8Array, got ${typeof e}`);return e}function b(...e){let t=0;for(let r=0;r<e.length;r++){let n=e[r];if(!s(n))throw Error("Uint8Array expected");t+=n.length}let r=new Uint8Array(t);for(let t=0,n=0;t<e.length;t++){let i=e[t];r.set(i,n),n+=i.length}return r}t.nextTick=p,t.asyncLoop=y,t.utf8ToBytes=g,t.toBytes=m,t.concatBytes=b;class v{clone(){return this._cloneInto()}}t.Hash=v;let w={}.toString;function _(e,t){if(void 0!==t&&"[object Object]"!==w.call(t))throw Error("Options should be object or undefined");return Object.assign(e,t)}function E(e){let t=t=>e().update(m(t)).digest(),r=e();return t.outputLen=r.outputLen,t.blockLen=r.blockLen,t.create=()=>e(),t}function S(e){let t=(t,r)=>e(r).update(m(t)).digest(),r=e({});return t.outputLen=r.outputLen,t.blockLen=r.blockLen,t.create=t=>e(t),t}function x(e){let t=(t,r)=>e(r).update(m(t)).digest(),r=e({});return t.outputLen=r.outputLen,t.blockLen=r.blockLen,t.create=t=>e(t),t}function A(e=32){if(n.crypto&&"function"==typeof n.crypto.getRandomValues)return n.crypto.getRandomValues(new Uint8Array(e));throw Error("crypto.getRandomValues must be defined")}t.checkOpts=_,t.wrapConstructor=E,t.wrapConstructorWithOpts=S,t.wrapXOFConstructorWithOpts=x,t.randomBytes=A},11618:(e,t)=>{"use strict";function r(e){if(!Number.isSafeInteger(e)||e<0)throw Error("positive integer expected, got "+e)}function n(e){return e instanceof Uint8Array||ArrayBuffer.isView(e)&&"Uint8Array"===e.constructor.name}function i(e,...t){if(!n(e))throw Error("Uint8Array expected");if(t.length>0&&!t.includes(e.length))throw Error("Uint8Array expected of length "+t+", got length="+e.length)}function o(e){if("function"!=typeof e||"function"!=typeof e.create)throw Error("Hash should be wrapped by utils.wrapConstructor");r(e.outputLen),r(e.blockLen)}function s(e,t=!0){if(e.destroyed)throw Error("Hash instance has been destroyed");if(t&&e.finished)throw Error("Hash#digest() has already been called")}function a(e,t){i(e);let r=t.outputLen;if(e.length<r)throw Error("digestInto() expects output buffer of length at least "+r)}
1Object.defineProperty(t,"__esModule",{value:!0}),t.anumber=r,t.abytes=i,t.ahash=o,t.aexists=s,t.aoutput=a},95101:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.HashMD=void 0,t.setBigUint64=o,t.Chi=s,t.Maj=a;let n=r(11618),i=r(32912);function o(e,t,r,n){if("function"==typeof e.setBigUint64)return e.setBigUint64(t,r,n);let i=BigInt(32),o=BigInt(0xffffffff),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)}function s(e,t,r){return e&t^~e&r}function a(e,t,r){return e&t^e&r^t&r}class c extends i.Hash{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=(0,i.createView)(this.buffer)}update(e){(0,n.aexists)(this);let{view:t,buffer:r,blockLen:o}=this,s=(e=(0,i.toBytes)(e)).length;for(let n=0;n<s;){let a=Math.min(o-this.pos,s-n);if(a===o){let t=(0,i.createView)(e);for(;o<=s-n;n+=o)this.process(t,n);continue}r.set(e.subarray(n,n+a),this.pos),this.pos+=a,n+=a,this.pos===o&&(this.process(t,0),this.pos=0)}return this.length+=e.length,this.roundClean(),this}digestInto(e){(0,n.aexists)(this),(0,n.aoutput)(e,this),this.finished=!0;let{buffer:t,view:r,blockLen:s,isLE:a}=this,{pos:c}=this;t[c++]=128,this.buffer.subarray(c).fill(0),this.padOffset>s-c&&(this.process(r,0),c=0);for(let e=c;e<s;e++)t[e]=0;o(r,s-8,BigInt(8*this.length),a),this.process(r,0);let u=(0,i.createView)(e),l=this.outputLen;if(l%4)throw Error("_sha2: outputLen should be aligned to 32bit");let d=l/4,f=this.get();if(d>f.length)throw Error("_sha2: outputLen bigger than state");for(let e=0;e<d;e++)u.setUint32(4*e,f[e],a)}digest(){let{buffer:e,outputLen:t}=this;this.digestInto(e);let r=e.slice(0,t);return this.destroy(),r}_cloneInto(e){e||(e=new this.constructor),e.set(...this.get());let{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}}t.HashMD=c},60614:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.crypto=void 0,t.crypto="object"==typeof globalThis&&"crypto"in globalThis?globalThis.crypto:void 0},75444:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.sha224=t.sha256=t.SHA256=void 0;let n=r(95101),i=r(32912),o=new Uint32Array([0x428a2f98,0x71374491,0xb5c0fbcf,0xe9b5dba5,0x3956c25b,0x59f111f1,0x923f82a4,0xab1c5ed5,0xd807aa98,0x12835b01,0x243185be,0x550c7dc3,0x72be5d74,0x80deb1fe,0x9bdc06a7,0xc19bf174,0xe49b69c1,0xefbe4786,0xfc19dc6,0x240ca1cc,0x2de92c6f,0x4a7484aa,0x5cb0a9dc,0x76f988da,0x983e5152,0xa831c66d,0xb00327c8,0xbf597fc7,0xc6e00bf3,0xd5a79147,0x6ca6351,0x14292967,0x27b70a85,0x2e1b2138,0x4d2c6dfc,0x53380d13,0x650a7354,0x766a0abb,0x81c2c92e,0x92722c85,0xa2bfe8a1,0xa81a664b,0xc24b8b70,0xc76c51a3,0xd192e819,0xd6990624,0xf40e3585,0x106aa070,0x19a4c116,0x1e376c08,0x2748774c,0x34b0bcb5,0x391c0cb3,0x4ed8aa4a,0x5b9cca4f,0x682e6ff3,0x748f82ee,0x78a5636f,0x84c87814,0x8cc70208,0x90befffa,0xa4506ceb,0xbef9a3f7,0xc67178f2]),s=new Uint32Array([0x6a09e66
17,0xbb67ae85,0x3c6ef372,0xa54ff53a,0x510e527f,0x9b05688c,0x1f83d9ab,0x5be0cd19]),a=new Uint32Array(64);class c extends n.HashMD{constructor(){super(64,32,8,!1),this.A=0|s[0],this.B=0|s[1],this.C=0|s[2],this.D=0|s[3],this.E=0|s[4],this.F=0|s[5],this.G=0|s[6],this.H=0|s[7]}get(){let{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 r=0;r<16;r++,t+=4)a[r]=e.getUint32(t,!1);for(let e=16;e<64;e++){let t=a[e-15],r=a[e-2],n=(0,i.rotr)(t,7)^(0,i.rotr)(t,18)^t>>>3,o=(0,i.rotr)(r,17)^(0,i.rotr)(r,19)^r>>>10;a[e]=o+a[e-7]+n+a[e-16]|0}let{A:r,B:s,C:c,D:u,E:l,F:d,G:f,H:h}=this;for(let e=0;e<64;e++){let t=h+((0,i.rotr)(l,6)^(0,i.rotr)(l,11)^(0,i.rotr)(l,25))+(0,n.Chi)(l,d,f)+o[e]+a[e]|0,p=((0,i.rotr)(r,2)^(0,i.rotr)(r,13)^(0,i.rotr)(r,22))+(0,n.Maj)(r,s,c)|0;h=f,f=d,d=l,l=u+t|0,u=c,c=s,s=r,r=t+p|0}r=r+this.A|0,s=s+this.B|0,c=c+this.C|0,u=u+this.D|0,l=l+this.E|0,d=d+this.F|0,f=f+this.G|0,h=h+this.H|0,this.set(r,s,c,u,l,d,f,h)}roundClean(){a.fill(0)}destroy(){this.set(0,0,0,0,0,0,0,0),this.buffer.fill(0)}}t.SHA256=c;class u extends c{constructor(){super(),this.A=-0x3efa6128,this.B=0x367cd507,this.C=0x3070dd17,this.D=-0x8f1a6c7,this.E=-4191439,this.F=0x68581511,this.G=0x64f98fa7,this.H=-0x4105b05c,this.outputLen=28}}t.sha256=(0,i.wrapConstructor)(()=>new c),t.sha224=(0,i.wrapConstructor)(()=>new u)},32912:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Hash=t.nextTick=t.byteSwapIfBE=t.isLE=void 0,t.isBytes=o,t.u8=s,t.u32=a,t.createView=c,t.rotr=u,t.rotl=l,t.byteSwap=d,t.byteSwap32=f,t.bytesToHex=p,t.hexToBytes=m,t.asyncLoop=v,t.utf8ToBytes=w,t.toBytes=_,t.concatBytes=E,t.checkOpts=x,t.wrapConstructor=A,t.wrapConstructorWithOpts=I,t.wrapXOFConstructorWithOpts=O,t.randomBytes=T;let n=r(60614),i=r(11618);function o(e){return e instanceof Uint8Array||ArrayBuffer.isView(e)&&"Uint8Array"===e.constructor.name}function s(e){return new Uint8Array(e.buffer,e.byteOffset,e.byteLength)}function a(e){return new Uint32Array(e.buffer,e.byteOffset,Math.floor(e.byteLength/4))}function c(e){return new DataView(e.buffer,e.byteOffset,e.byteLength)}function u(e,t){return e<<32-t|e>>>t}function l(e,t){return e<<t|e>>>32-t>>>0}function d(e){return e<<24&0xff000000|e<<8&0xff0000|e>>>8&65280|e>>>24&255}function f(e){for(let t=0;t<e.length;t++)e[t]=d(e[t])}t.isLE=68===new Uint8Array(new Uint32Array([0x11223344]).buffer)[0],t.byteSwapIfBE=t.isLE?e=>e:e=>d(e);let h=Array.from({length:256},(e,t)=>t.toString(16).padStart(2,"0"));function p(e){(0,i.abytes)(e);let t="";for(let r=0;r<e.length;r++)t+=h[e[r]];return t}let y={_0:48,_9:57,A:65,F:70,a:97,f:102};function g(e){return e>=y._0&&e<=y._9?e-y._0:e>=y.A&&e<=y.F?e-(y.A-10):e>=y.a&&e<=y.f?e-(y.a-10):void 0}function m(e){if("string"!=typeof e)throw Error("hex string expected, got "+typeof e);let t=e.length,r=t/2;if(t%2)throw Error("hex string expected, got unpadded hex of length "+t);let n=new Uint8Array(r);for(let t=0,i=0;t<r;t++,i+=2){let r=g(e.charCodeAt(i)),o=g(e.charCodeAt(i+1));if(void 0===r||void 0===o)throw Error('hex string expected, got non-hex character "'+(e[i]+e[i+1])+'" at index '+i);n[t]=16*r+o}return n}let b=async()=>{};async function v(e,r,n){let i=Date.now();for(let o=0;o<e;o++){n(o);let e=Date.now()-i;e>=0&&e<r||(await (0,t.nextTick)(),i+=e)}}function w(e){if("string"!=typeof e)throw Error("utf8ToBytes expected string, got "+typeof e);return new Uint8Array(new TextEncoder().encode(e))}function _(e){return"string"==typeof e&&(e=w(e)),(0,i.abytes)(e),e}function E(...e){let t=0;for(let r=0;r<e.length;r++){let n=e[r];(0,i.abytes)(n),t+=n.length}let r=new Uint8Array(t);for(let t=0,n=0;t<e.length;t++){let i=e[t];r.set(i,n),n+=i.length}return r}t.nextTick=b;class S{clone(){return this._cloneInto()}}function x(e,t){if(void 0!==t&&"[object Object]"!==({}).toString.call(t))throw Error("Options should be object or undefined");return Object.assign(e,t)}function A(e){let t=t=>e().update(_(t)).digest(),r=e();return t.outputLen=r.outputLen,t.blockLen=r.blockLen,t.create=()=>e(),t}function I(e){let t=(t,r)=>e(r).update(_(t)).digest(),r=e({});return t.outputLen=r.outputLen,t.blockLen=r.blockLen,t.create=t=>e(t),t}function O(e){let t=(t,r)=>e(r).update(_(t)).digest(),r=e({});return t.outputLen=r.outputLen,t.blockLen=r.blockLen,t.create=t=>e(t),t}function T(e=32){if(n.crypto&&"function"==typeof n.crypto.getRandomValues)return n.crypto.getRandomValues(new Uint8Array(e));if(n.crypto&&"function"==typeof n.crypto.randomBytes)return n.crypto.randomBytes(e);throw Error("crypto.getRandomValues must be defined")}t.Hash=S},64157:(e,t)=>{"use strict";t.__esModule=!0,t.DecodeBuffer=t.EncodeBuffer=void 0;var r=function(){function e(){this.offset=0,this.buffer_size=256,this.buffer=new ArrayBuffer(this.buffer_size),this.view=new DataView(this.buffer)}return e.prototype.resize_if_necessary=function(e){if(this.buffer_size-this.offset<e){this.buffer_size=Math.max(2*this.buffer_size,this.buffer_size+e);var t=new ArrayBuffer(this.buffer_size);new Uint8Array(t).set(new Uint8Array(this.buffer)),this.buffer=t,this.view=new DataView(t)}},e.prototype.get_used_buffer=function(){return new Uint8Array(this.buffer).slice(0,this.offset)},e.prototype.store_value=function(e,t){var r=t.substring(1),n=parseInt(r)/8;this.resize_if_necessary(n);var i="f"===t[0]?"setFloat".concat(r):"i"===t[0]?"setInt".concat(r):"setUint".concat(r);this.view[i](this.offset,e,!0),this.offset+=n},e.prototype.store_bytes=function(e){this.resize_if_necessary(e.length),new Uint8Array(this.buffer).set(new Uint8Array(e),this.offset),this.offset+=e.length},e}();t.EncodeBuffer=r;var n=function(){function e(e){this.offset=0,this.buffer_size=e.length,this.buffer=new ArrayBuffer(e.length),new Uint8Array(this.buffer).set(e),this.view=new DataView(this.buffer)}return e.prototype.assert_enough_buffer=function(e){if(this.offset+e>this.buffer.byteLength)throw Error("Error in schema, the buffer is smaller than expected")},e.prototype.consume_value=function(e){var t=e.substring(1),r=parseInt(t)/8;this.assert_enough_buffer(r);var n="f"===e[0]?"getFloat".concat(t):"i"===e[0]?"getInt".concat(t):"getUint".concat(t),i=this.view[n](this.offset,!0);return this.offset+=r,i},e.prototype.consume_bytes=function(e){this.assert_enough_buffer(e);var t=this.buffer.slice(this.offset,this.offset+e);return this.offset+=e,t},e}();t.DecodeBuffer=n},31930:(e,t,r)=>{"use strict";
1t.__esModule=!0,t.BorshDeserializer=void 0;var n=r(95616),i=r(64157),o=function(){function e(e){this.buffer=new i.DecodeBuffer(e)}return e.prototype.decode=function(e){return this.decode_value(e)},e.prototype.decode_value=function(e){if("string"==typeof e){if(n.integers.includes(e))return this.decode_integer(e);if("string"===e)return this.decode_string();if("bool"===e)return this.decode_boolean()}if("object"==typeof e){if("option"in e)return this.decode_option(e);if("enum"in e)return this.decode_enum(e);if("array"in e)return this.decode_array(e);if("set"in e)return this.decode_set(e);if("map"in e)return this.decode_map(e);if("struct"in e)return this.decode_struct(e)}throw Error("Unsupported type: ".concat(e))},e.prototype.decode_integer=function(e){var t=parseInt(e.substring(1));return t<=32||"f64"==e?this.buffer.consume_value(e):this.decode_bigint(t,e.startsWith("i"))},e.prototype.decode_bigint=function(e,t){void 0===t&&(t=!1);var r=e/8,n=new Uint8Array(this.buffer.consume_bytes(r)),i=n.reduceRight(function(e,t){return e+t.toString(16).padStart(2,"0")},"");return t&&n[r-1]?BigInt.asIntN(e,BigInt("0x".concat(i))):BigInt("0x".concat(i))},e.prototype.decode_string=function(){var e=this.decode_integer("u32"),t=new Uint8Array(this.buffer.consume_bytes(e));return String.fromCharCode.apply(null,t)},e.prototype.decode_boolean=function(){return this.buffer.consume_value("u8")>0},e.prototype.decode_option=function(e){var t=this.buffer.consume_value("u8");if(1===t)return this.decode_value(e.option);if(0!==t)throw Error("Invalid option ".concat(t));return null},e.prototype.decode_enum=function(e){var t,r=this.buffer.consume_value("u8");if(r>e.enum.length)throw Error("Enum option ".concat(r," is not available"));var n=e.enum[r].struct,i=Object.keys(n)[0];return(t={})[i]=this.decode_value(n[i]),t},e.prototype.decode_array=function(e){for(var t=[],r=e.array.len?e.array.len:this.decode_integer("u32"),n=0;n<r;++n)t.push(this.decode_value(e.array.type));return t},e.prototype.decode_set=function(e){for(var t=this.decode_integer("u32"),r=new Set,n=0;n<t;++n)r.add(this.decode_value(e.set));return r},e.prototype.decode_map=function(e){for(var t=this.decode_integer("u32"),r=new Map,n=0;n<t;++n){var i=this.decode_value(e.map.key),o=this.decode_value(e.map.value);r.set(i,o)}return r},e.prototype.decode_struct=function(e){var t={};for(var r in e.struct)t[r]=this.decode_value(e.struct[r]);return t},e}();t.BorshDeserializer=o},33885:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);(!i||("get"in i?!t.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),o=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)"default"!==r&&Object.prototype.hasOwnProperty.call(e,r)&&n(t,e,r);return i(t,e),t};t.__esModule=!0,t.deserialize=t.serialize=void 0;var s=r(83671),a=r(31930),c=o(r(64900));function u(e,t,r){return void 0===r&&(r=!0),r&&c.validate_schema(e),new s.BorshSerializer(r).encode(t,e)}function l(e,t,r){return void 0===r&&(r=!0),r&&c.validate_schema(e),new a.BorshDeserializer(t).decode(e)}t.serialize=u,t.deserialize=l},83671:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);(!i||("get"in i?!t.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),o=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)"default"!==r&&Object.prototype.hasOwnProperty.call(e,r)&&n(t,e,r);return i(t,e),t};
1t.__esModule=!0,t.BorshSerializer=void 0;var s=r(95616),a=r(64157),c=o(r(64900)),u=function(){function e(e){this.encoded=new a.EncodeBuffer,this.fieldPath=["value"],this.checkTypes=e}return e.prototype.encode=function(e,t){return this.encode_value(e,t),this.encoded.get_used_buffer()},e.prototype.encode_value=function(e,t){if("string"==typeof t){if(s.integers.includes(t))return this.encode_integer(e,t);if("string"===t)return this.encode_string(e);if("bool"===t)return this.encode_boolean(e)}if("object"==typeof t){if("option"in t)return this.encode_option(e,t);if("enum"in t)return this.encode_enum(e,t);if("array"in t)return this.encode_array(e,t);if("set"in t)return this.encode_set(e,t);if("map"in t)return this.encode_map(e,t);if("struct"in t)return this.encode_struct(e,t)}},e.prototype.encode_integer=function(e,t){var r=parseInt(t.substring(1));r<=32||"f64"==t?(this.checkTypes&&c.expect_type(e,"number",this.fieldPath),this.encoded.store_value(e,t)):(this.checkTypes&&c.expect_bigint(e,this.fieldPath),this.encode_bigint(BigInt(e),r))},e.prototype.encode_bigint=function(e,t){for(var r=t/8,n=new Uint8Array(r),i=0;i<r;i++)n[i]=Number(e&BigInt(255)),e>>=BigInt(8);this.encoded.store_bytes(new Uint8Array(n))},e.prototype.encode_string=function(e){this.checkTypes&&c.expect_type(e,"string",this.fieldPath);var t=e;this.encoded.store_value(t.length,"u32");for(var r=0;r<t.length;r++)this.encoded.store_value(t.charCodeAt(r),"u8")},e.prototype.encode_boolean=function(e){this.checkTypes&&c.expect_type(e,"boolean",this.fieldPath),this.encoded.store_value(e?1:0,"u8")},e.prototype.encode_option=function(e,t){null==e?this.encoded.store_value(0,"u8"):(this.encoded.store_value(1,"u8"),this.encode_value(e,t.option))},e.prototype.encode_enum=function(e,t){this.checkTypes&&c.expect_enum(e,this.fieldPath);for(var r=Object.keys(e)[0],n=0;n<t.enum.length;n++){var i=t.enum[n];if(r===Object.keys(i.struct)[0])return this.encoded.store_value(n,"u8"),this.encode_struct(e,i)}throw Error("Enum key (".concat(r,") not found in enum schema: ").concat(JSON.stringify(t)," at ").concat(this.fieldPath.join(".")))},e.prototype.encode_array=function(e,t){if(c.isArrayLike(e))return this.encode_arraylike(e,t);if(e instanceof ArrayBuffer)return this.encode_buffer(e,t);throw Error("Expected Array-like not ".concat(typeof e,"(").concat(e,") at ").concat(this.fieldPath.join(".")))},e.prototype.encode_arraylike=function(e,t){t.array.len?c.expect_same_size(e.length,t.array.len,this.fieldPath):this.encoded.store_value(e.length,"u32");for(var r=0;r<e.length;r++)this.encode_value(e[r],t.array.type)},e.prototype.encode_buffer=function(e,t){t.array.len?c.expect_same_size(e.byteLength,t.array.len,this.fieldPath):this.encoded.store_value(e.byteLength,"u32"),this.encoded.store_bytes(new Uint8Array(e))},e.prototype.encode_set=function(e,t){this.checkTypes&&c.expect_type(e,"object",this.fieldPath);var r=e instanceof Set?Array.from(e.values()):Object.values(e);this.encoded.store_value(r.length,"u32");for(var n=0,i=r;n<i.length;n++){var o=i[n];this.encode_value(o,t.set)}},e.prototype.encode_map=function(e,t){this.checkTypes&&c.expect_type(e,"object",this.fieldPath);var r=e instanceof Map,n=r?Array.from(e.keys()):Object.keys(e);this.encoded.store_value(n.length,"u32");for(var i=0,o=n;i<o.length;i++){var s=o[i];this.encode_value(s,t.map.key),this.encode_value(r?e.get(s):e[s],t.map.value)}},e.prototype.encode_struct=function(e,t){this.checkTypes&&c.expect_type(e,"object",this.fieldPath);for(var r=0,n=Object.keys(t.struct);r<n.length;r++){var i=n[r];this.fieldPath.push(i),this.encode_value(e[i],t.struct[i]),this.fieldPath.pop()}},e}();t.BorshSerializer=u},95616:(e,t)=>{"use strict";t.__esModule=!0,t.integers=void 0,t.integers=["u8","u16","u32","u64","u128","i8","i16","i32","i64","i128","f32","f64"]},64900:function(e,t,r){"use strict";var n=this&&this.__extends||function(){var e=function(t,r){return(e=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])})(t,r)};return function(t,r){if("function"!=typeof r&&null!==r)throw TypeError("Class extends value "+String(r)+" is not a constructor or null");function n(){this.constructor=t}e(t,r),t.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}();t.__esModule=!0,t.validate_schema=t.ErrorSchema=t.expect_enum=t.expect_same_size=t.expect_bigint=t.expect_type=t.isArrayLike=void 0;var i=r(95616);function o(e){return Array.isArray(e)||!!e&&"object"==typeof e&&"length"in e&&"number"==typeof e.length&&(0===e.length||e.length>
10&&e.length-1 in e)}function s(e,t,r){if(typeof e!==t)throw Error("Expected ".concat(t," not ").concat(typeof e,"(").concat(e,") at ").concat(r.join(".")))}function a(e,t){var r=["number","string","bigint","boolean"].includes(typeof e),n="object"==typeof e&&null!==e&&"toString"in e;if(!r&&!n)throw Error("Expected bigint, number, boolean or string not ".concat(typeof e,"(").concat(e,") at ").concat(t.join(".")))}function c(e,t,r){if(e!==t)throw Error("Array length ".concat(e," does not match schema length ").concat(t," at ").concat(r.join(".")))}function u(e,t){if("object"!=typeof e||null===e)throw Error("Expected object not ".concat(typeof e,"(").concat(e,") at ").concat(t.join(".")))}t.isArrayLike=o,t.expect_type=s,t.expect_bigint=a,t.expect_same_size=c,t.expect_enum=u;var l=i.integers.concat(["bool","string"]),d=["option","enum","array","set","map","struct"],f=function(e){function t(t,r){var n="Invalid schema: ".concat(JSON.stringify(t)," expected ").concat(r);return e.call(this,n)||this}return n(t,e),t}(Error);function h(e){if(!("string"==typeof e&&l.includes(e))){if(e&&"object"==typeof e){var t=Object.keys(e);if(1===t.length&&d.includes(t[0])){var r=t[0];if("option"===r)return h(e[r]);if("enum"===r)return p(e[r]);if("array"===r)return y(e[r]);if("set"===r)return h(e[r]);if("map"===r)return g(e[r]);if("struct"===r)return m(e[r])}}throw new f(e,d.join(", ")+" or "+l.join(", "))}}function p(e){if(!Array.isArray(e))throw new f(e,"Array");for(var t=0,r=e;t<r.length;t++){var n=r[t];if("object"!=typeof n||!("struct"in n))throw Error('Missing "struct" key in enum schema');if("object"!=typeof n.struct||1!==Object.keys(n.struct).length)throw Error('The "struct" in each enum must have a single key');h({struct:n.struct})}}function y(e){if("object"!=typeof e)throw new f(e,"{ type, len? }");if(e.len&&"number"!=typeof e.len)throw Error("Invalid schema: ".concat(e));if("type"in e)return h(e.type);throw new f(e,"{ type, len? }")}function g(e){if("object"==typeof e&&"key"in e&&"value"in e)h(e.key),h(e.value);else throw new f(e,"{ key, value }")}function m(e){if("object"!=typeof e)throw new f(e,"object");for(var t in e)h(e[t])}t.ErrorSchema=f,t.validate_schema=h},18486:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Account=void 0;var n=r(74456);Object.defineProperty(t,"Account",{enumerable:!0,get:function(){return n.Account}})},53925:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.UrlAccountCreator=t.LocalAccountCreator=t.AccountCreator=void 0;var n=r(74456);Object.defineProperty(t,"AccountCreator",{enumerable:!0,get:function(){return n.AccountCreator}}),Object.defineProperty(t,"LocalAccountCreator",{enumerable:!0,get:function(){return n.LocalAccountCreator}}),Object.defineProperty(t,"UrlAccountCreator",{enumerable:!0,get:function(){return n.UrlAccountCreator}})},10161:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.MultisigStateStatus=t.MultisigDeleteRequestRejectionError=t.MULTISIG_CONFIRM_METHODS=t.MULTISIG_CHANGE_METHODS=t.MULTISIG_DEPOSIT=t.MULTISIG_GAS=t.MULTISIG_ALLOWANCE=t.MULTISIG_STORAGE_KEY=t.AccountMultisig=t.Account2FA=void 0;var n=r(74456);Object.defineProperty(t,"Account2FA",{enumerable:!0,get:function(){return n.Account2FA}}),Object.defineProperty(t,"AccountMultisig",{enumerable:!0,get:function(){return n.AccountMultisig}}),Object.defineProperty(t,"MULTISIG_STORAGE_KEY",{enumerable:!0,get:function(){return n.MULTISIG_STORAGE_KEY}}),Object.defineProperty(t,"MULTISIG_ALLOWANCE",{enumerable:!0,get:function(){return n.MULTISIG_ALLOWANCE}}),Object.defineProperty(t,"MULTISIG_GAS",{enumerable:!0,get:function(){return n.MULTISIG_GAS}}),Object.defineProperty(t,"MULTISIG_DEPOSIT",{enumerable:!0,get:function(){return n.MULTISIG_DEPOSIT}}),Object.defineProperty(t,"MULTISIG_CHANGE_METHODS",{enumerable:!0,get:function(){return n.MULTISIG_CHANGE_METHODS}}),Object.defineProperty(t,"MULTISIG_CONFIRM_METHODS",{enumerable:!0,get:function(){return n.MULTISIG_CONFIRM_METHODS}}),Object.defineProperty(t,"MultisigDeleteRequestRejectionError",{enumerable:!0,get:function(){return n.MultisigDeleteRequestRejectionError}}),Object.defineProperty(t,"MultisigStateStatus",{enumerable:!0,get:function(){return n.MultisigStateStatus}})},63974:(e,t,r)=>{"use strict";
1Object.defineProperty(t,"__esModule",{value:!0}),t.connect=void 0;let n=r(2489);async function i(e){return new n.Near(e)}t.connect=i},22392:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);(!i||("get"in i?!t.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),o=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)"default"!==r&&Object.prototype.hasOwnProperty.call(e,r)&&n(t,e,r);return i(t,e),t},s=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),t.keyStores=void 0,t.keyStores=o(r(44839)),s(r(91583),t),s(r(63974),t)},91583:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);(!i||("get"in i?!t.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),o=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)"default"!==r&&Object.prototype.hasOwnProperty.call(e,r)&&n(t,e,r);return i(t,e),t};Object.defineProperty(t,"__esModule",{value:!0}),t.WalletConnection=t.ConnectedWalletAccount=t.Near=t.KeyPair=t.Signer=t.InMemorySigner=t.Contract=t.Connection=t.Account=t.multisig=t.validators=t.transactions=t.utils=t.providers=t.accountCreator=void 0;let s=o(r(31952));t.providers=s;let a=o(r(31151));t.utils=a;let c=o(r(85221));t.transactions=c;let u=o(r(80196));t.validators=u;let l=r(18486);Object.defineProperty(t,"Account",{enumerable:!0,get:function(){return l.Account}});let d=o(r(10161));t.multisig=d;let f=o(r(53925));t.accountCreator=f;let h=r(55351);Object.defineProperty(t,"Connection",{enumerable:!0,get:function(){return h.Connection}});let p=r(1501);Object.defineProperty(t,"Signer",{enumerable:!0,get:function(){return p.Signer}}),Object.defineProperty(t,"InMemorySigner",{enumerable:!0,get:function(){return p.InMemorySigner}});let y=r(2421);Object.defineProperty(t,"Contract",{enumerable:!0,get:function(){return y.Contract}});let g=r(14697);Object.defineProperty(t,"KeyPair",{enumerable:!0,get:function(){return g.KeyPair}});let m=r(2489);Object.defineProperty(t,"Near",{enumerable:!0,get:function(){return m.Near}});let b=r(92572);Object.defineProperty(t,"ConnectedWalletAccount",{enumerable:!0,get:function(){return b.ConnectedWalletAccount}}),Object.defineProperty(t,"WalletConnection",{enumerable:!0,get:function(){return b.WalletConnection}})},55351:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Connection=void 0;var n=r(74456);Object.defineProperty(t,"Connection",{enumerable:!0,get:function(){return n.Connection}})},2421:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Contract=void 0;var n=r(74456);Object.defineProperty(t,"Contract",{enumerable:!0,get:function(){return n.Contract}})},44839:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.MergeKeyStore=t.BrowserLocalStorageKeyStore=t.InMemoryKeyStore=t.KeyStore=void 0;let n=r(92070);Object.defineProperty(t,"KeyStore",{enumerable:!0,get:function(){return n.KeyStore}});let i=r(47255);Object.defineProperty(t,"InMemoryKeyStore",{enumerable:!0,get:function(){return i.InMemoryKeyStore}});let o=r(33934);Object.defineProperty(t,"BrowserLocalStorageKeyStore",{enumerable:!0,get:function(){return o.BrowserLocalStorageKeyStore}});let s=r(94064);Object.defineProperty(t,"MergeKeyStore",{enumerable:!0,get:function(){return s.MergeKeyStore}})},33934:(e,t,r)=>{"use strict";
1Object.defineProperty(t,"__esModule",{value:!0}),t.BrowserLocalStorageKeyStore=void 0;var n=r(54431);Object.defineProperty(t,"BrowserLocalStorageKeyStore",{enumerable:!0,get:function(){return n.BrowserLocalStorageKeyStore}})},47255:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.InMemoryKeyStore=void 0;var n=r(67198);Object.defineProperty(t,"InMemoryKeyStore",{enumerable:!0,get:function(){return n.InMemoryKeyStore}})},92070:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.KeyStore=void 0;var n=r(67198);Object.defineProperty(t,"KeyStore",{enumerable:!0,get:function(){return n.KeyStore}})},94064:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.MergeKeyStore=void 0;var n=r(67198);Object.defineProperty(t,"MergeKeyStore",{enumerable:!0,get:function(){return n.MergeKeyStore}})},2489:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Near=void 0;var n=r(62837);Object.defineProperty(t,"Near",{enumerable:!0,get:function(){return n.Near}})},61634:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.FailoverRpcProvider=void 0;var n=r(34089);Object.defineProperty(t,"FailoverRpcProvider",{enumerable:!0,get:function(){return n.FailoverRpcProvider}})},31952:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ErrorContext=t.TypedError=t.getTransactionLastResult=t.FinalExecutionStatusBasic=t.FailoverRpcProvider=t.JsonRpcProvider=t.Provider=void 0;let n=r(65517);Object.defineProperty(t,"Provider",{enumerable:!0,get:function(){return n.Provider}}),Object.defineProperty(t,"getTransactionLastResult",{enumerable:!0,get:function(){return n.getTransactionLastResult}}),Object.defineProperty(t,"FinalExecutionStatusBasic",{enumerable:!0,get:function(){return n.FinalExecutionStatusBasic}});let i=r(37966);Object.defineProperty(t,"JsonRpcProvider",{enumerable:!0,get:function(){return i.JsonRpcProvider}}),Object.defineProperty(t,"TypedError",{enumerable:!0,get:function(){return i.TypedError}}),Object.defineProperty(t,"ErrorContext",{enumerable:!0,get:function(){return i.ErrorContext}});let o=r(61634);Object.defineProperty(t,"FailoverRpcProvider",{enumerable:!0,get:function(){return o.FailoverRpcProvider}})},37966:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.JsonRpcProvider=t.TypedError=t.ErrorContext=void 0;var n=r(39022);Object.defineProperty(t,"ErrorContext",{enumerable:!0,get:function(){return n.ErrorContext}}),Object.defineProperty(t,"TypedError",{enumerable:!0,get:function(){return n.TypedError}});var i=r(34089);Object.defineProperty(t,"JsonRpcProvider",{enumerable:!0,get:function(){return i.JsonRpcProvider}})},65517:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.FinalExecutionStatusBasic=t.ExecutionStatusBasic=t.IdType=t.Provider=t.getTransactionLastResult=void 0;var n=r(49722);Object.defineProperty(t,"getTransactionLastResult",{enumerable:!0,get:function(){return n.getTransactionLastResult}});var i=r(34089);Object.defineProperty(t,"Provider",{enumerable:!0,get:function(){return i.Provider}});var o=r(39022);Object.defineProperty(t,"IdType",{enumerable:!0,get:function(){return o.IdType}}),Object.defineProperty(t,"ExecutionStatusBasic",{enumerable:!0,get:function(){return o.ExecutionStatusBasic}}),Object.defineProperty(t,"FinalExecutionStatusBasic",{enumerable:!0,get:function(){return o.FinalExecutionStatusBasic}})},1501:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Signer=t.InMemorySigner=void 0;var n=r(56636);Object.defineProperty(t,"InMemorySigner",{enumerable:!0,get:function(){return n.InMemorySigner}}),Object.defineProperty(t,"Signer",{enumerable:!0,get:function(){return n.Signer}})},85221:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.transfer=t.stake=t.functionCallAccessKey=t.functionCall=t.fullAccessKey=t.deployContract=t.deleteKey=t.deleteAccount=t.createAccount=t.addKey=t.encodeTransaction=t.encodeDelegateAction=t.encodeSignedDelegate=t.Transaction=t.SignedTransaction=t.Signature=t.signTransaction=t.createTransaction=t.SCHEMA=t.Transfer=t.Stake=t.FunctionCallPermission=t.FunctionCall=t.FullAccessPermission=t.DeployContract=t.DeleteKey=t.DeleteAccount=t.CreateAccount=t.AddKey=t.AccessKeyPermission=t.AccessKey=t.Action=t.stringifyJsonOrBytes=void 0;var n=r(9626);Object.defineProperty(t,"stringifyJsonOrBytes",{enumerable:!0,get:function(){return n.stringifyJsonOrBytes}}),Object.defineProperty(t,"Action",{enumerable:!0,get:function(){return n.Action}}),Object.defineProperty(t,"AccessKey",{enumerable:!0,get:function(){return n.AccessKey}}),Object.defineProperty(t,"AccessKeyPermission",{enumerable:!0,get:function(){return n.AccessKeyPermission}}),Object.defineProperty(t,"AddKey",{enumerable:!0,get:function(){return n.AddKey}}),Object.defineProperty(t,"CreateAccount",{enumerable:!0,get:function(){return n.CreateAccount}}),Object.defineProperty(t,"DeleteAccount",{enumerable:!0,get:function(){return n.DeleteAccount}}),Object.defineProperty(t,"DeleteKey",{enumerable:!0,get:function(){return n.DeleteKey}}),Object.defineProperty(t,"DeployContract",{enumerable:!0,get:function(){return n.DeployContract}}),Object.defineProperty(t,"FullAccessPermission",{enumerable:!0,get:function(){return n.FullAccessPermission}}),Object.defineProperty(t,"FunctionCall",{enumerable:!0,get:function(){return n.FunctionCall}}),Object.defineProperty(t,"FunctionCallPermission",{enumerable:!0,get:function(){return n.FunctionCallPermission}}),Object.defineProperty(t,"Stake",{enumerable:!0,get:function(){return n.Stake}}),Object.defineProperty(t,"Transfer",{enumerable:!0,get:function(){return n.Transfer}}
1),Object.defineProperty(t,"SCHEMA",{enumerable:!0,get:function(){return n.SCHEMA}}),Object.defineProperty(t,"createTransaction",{enumerable:!0,get:function(){return n.createTransaction}}),Object.defineProperty(t,"signTransaction",{enumerable:!0,get:function(){return n.signTransaction}}),Object.defineProperty(t,"Signature",{enumerable:!0,get:function(){return n.Signature}}),Object.defineProperty(t,"SignedTransaction",{enumerable:!0,get:function(){return n.SignedTransaction}}),Object.defineProperty(t,"Transaction",{enumerable:!0,get:function(){return n.Transaction}}),Object.defineProperty(t,"encodeSignedDelegate",{enumerable:!0,get:function(){return n.encodeSignedDelegate}}),Object.defineProperty(t,"encodeDelegateAction",{enumerable:!0,get:function(){return n.encodeDelegateAction}}),Object.defineProperty(t,"encodeTransaction",{enumerable:!0,get:function(){return n.encodeTransaction}});let i=r(9626),o=(e,t)=>i.actionCreators.addKey(e,t);t.addKey=o;let s=()=>i.actionCreators.createAccount();t.createAccount=s;let a=e=>i.actionCreators.deleteAccount(e);t.deleteAccount=a;let c=e=>i.actionCreators.deleteKey(e);t.deleteKey=c;let u=e=>i.actionCreators.deployContract(e);t.deployContract=u;let l=()=>i.actionCreators.fullAccessKey();t.fullAccessKey=l;let d=(e,t,r,n,o,s)=>i.actionCreators.functionCall(e,t,r,n,o,s);t.functionCall=d;let f=(e,t,r)=>i.actionCreators.functionCallAccessKey(e,t,r);t.functionCallAccessKey=f;let h=(e,t)=>i.actionCreators.stake(e,t);t.stake=h;let p=e=>i.actionCreators.transfer(e);t.transfer=p},13637:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Enum=void 0;var n=r(39022);Object.defineProperty(t,"Enum",{enumerable:!0,get:function(){return n.Enum}})},72350:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.parseNearAmount=t.formatNearAmount=t.NEAR_NOMINATION_EXP=t.NEAR_NOMINATION=void 0;var n=r(49722);Object.defineProperty(t,"NEAR_NOMINATION",{enumerable:!0,get:function(){return n.NEAR_NOMINATION}}),Object.defineProperty(t,"NEAR_NOMINATION_EXP",{enumerable:!0,get:function(){return n.NEAR_NOMINATION_EXP}}),Object.defineProperty(t,"formatNearAmount",{enumerable:!0,get:function(){return n.formatNearAmount}}),Object.defineProperty(t,"parseNearAmount",{enumerable:!0,get:function(){return n.parseNearAmount}})},31151:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);(!i||("get"in i?!t.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),o=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)"default"!==r&&Object.prototype.hasOwnProperty.call(e,r)&&n(t,e,r);return i(t,e),t};Object.defineProperty(t,"__esModule",{value:!0}),t.Logger=t.rpc_errors=t.KeyPairEd25519=t.KeyPair=t.PublicKey=t.format=t.enums=t.serialize=t.key_pair=void 0;let s=o(r(14697));t.key_pair=s;let a=o(r(14297));t.serialize=a;let c=o(r(13637));t.enums=c;let u=o(r(72350));t.format=u;let l=o(r(90586));t.rpc_errors=l;let d=r(14697);Object.defineProperty(t,"PublicKey",{enumerable:!0,get:function(){return d.PublicKey}}),Object.defineProperty(t,"KeyPair",{enumerable:!0,get:function(){return d.KeyPair}}),Object.defineProperty(t,"KeyPairEd25519",{enumerable:!0,get:function(){return d.KeyPairEd25519}});let f=r(47093);Object.defineProperty(t,"Logger",{enumerable:!0,get:function(){return f.Logger}})},14697:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.PublicKey=t.KeyType=t.KeyPairEd25519=t.KeyPair=void 0;var n=r(67562);Object.defineProperty(t,"KeyPair",{enumerable:!0,get:function(){return n.KeyPair}}),Object.defineProperty(t,"KeyPairEd25519",{enumerable:!0,get:function(){return n.KeyPairEd25519}}),Object.defineProperty(t,"KeyType",{enumerable:!0,get:function(){return n.KeyType}}),Object.defineProperty(t,"PublicKey",{enumerable:!0,get:function(){return n.PublicKey}})},47093:(e,t,r)=>{"use strict";
1Object.defineProperty(t,"__esModule",{value:!0}),t.Logger=void 0;var n=r(49722);Object.defineProperty(t,"Logger",{enumerable:!0,get:function(){return n.Logger}})},90586:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ServerError=t.getErrorTypeFromErrorMessage=t.formatError=t.parseResultError=t.parseRpcError=void 0;var n=r(49722);Object.defineProperty(t,"parseRpcError",{enumerable:!0,get:function(){return n.parseRpcError}}),Object.defineProperty(t,"parseResultError",{enumerable:!0,get:function(){return n.parseResultError}}),Object.defineProperty(t,"formatError",{enumerable:!0,get:function(){return n.formatError}}),Object.defineProperty(t,"getErrorTypeFromErrorMessage",{enumerable:!0,get:function(){return n.getErrorTypeFromErrorMessage}}),Object.defineProperty(t,"ServerError",{enumerable:!0,get:function(){return n.ServerError}})},14297:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.base_decode=t.base_encode=t.deserialize=t.serialize=void 0;var n=r(33885);Object.defineProperty(t,"serialize",{enumerable:!0,get:function(){return n.serialize}}),Object.defineProperty(t,"deserialize",{enumerable:!0,get:function(){return n.deserialize}});var i=r(49722);Object.defineProperty(t,"base_encode",{enumerable:!0,get:function(){return i.baseEncode}}),Object.defineProperty(t,"base_decode",{enumerable:!0,get:function(){return i.baseDecode}})},80196:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.findSeatPrice=t.diffEpochValidators=void 0;var n=r(49722);Object.defineProperty(t,"diffEpochValidators",{enumerable:!0,get:function(){return n.diffEpochValidators}}),Object.defineProperty(t,"findSeatPrice",{enumerable:!0,get:function(){return n.findSeatPrice}})},92572:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.WalletConnection=t.ConnectedWalletAccount=void 0;var n=r(62837);Object.defineProperty(t,"ConnectedWalletAccount",{enumerable:!0,get:function(){return n.ConnectedWalletAccount}}),Object.defineProperty(t,"WalletConnection",{enumerable:!0,get:function(){return n.WalletConnection}})},95276:(e,t,r)=>{"use strict";let n=Symbol("SemVer ANY");class i{static get ANY(){return n}constructor(e,t){if(t=o(t),e instanceof i){if(!!t.loose===e.loose)return e;e=e.value}u("comparator",e=e.trim().split(/\s+/).join(" "),t),this.options=t,this.loose=!!t.loose,this.parse(e),this.semver===n?this.value="":this.value=this.operator+this.semver.version,u("comp",this)}parse(e){let t=this.options.loose?s[a.COMPARATORLOOSE]:s[a.COMPARATOR],r=e.match(t);if(!r)throw TypeError(`Invalid comparator: ${e}`);this.operator=void 0!==r[1]?r[1]:"","="===this.operator&&(this.operator=""),r[2]?this.semver=new l(r[2],this.options.loose):this.semver=n}toString(){return this.value}test(e){if(u("Comparator.test",e,this.options.loose),this.semver===n||e===n)return!0;if("string"==typeof e)try{e=new l(e,this.options)}catch(e){return!1}return c(e,this.operator,this.semver,this.options)}intersects(e,t){if(!(e instanceof i))throw TypeError("a Comparator is required");return""===this.operator?""===this.value||new d(e.value,t).test(this.value):""===e.operator?""===e.value||new d(this.value,t).test(e.semver):!((t=o(t)).includePrerelease&&("<0.0.0-0"===this.value||"<0.0.0-0"===e.value)||!t.includePrerelease&&(this.value.startsWith("<0.0.0")||e.value.startsWith("<0.0.0")))&&!!(this.operator.startsWith(">")&&e.operator.startsWith(">")||this.operator.startsWith("<")&&e.operator.startsWith("<")||this.semver.version===e.semver.version&&this.operator.includes("=")&&e.operator.includes("=")||c(this.semver,"<",e.semver,t)&&this.operator.startsWith(">")&&e.operator.startsWith("<")||c(this.semver,">",e.semver,t)&&this.operator.startsWith("<")&&e.operator.startsWith(">"))}}e.exports=i;let o=r(95151),{safeRe:s,t:a}=r(96960),c=r(96949),u=r(80200),l=r(33956),d=r(88357)},88357:(e,t,r)=>{"use strict";let n=/\s+/g;class i{constructor(e,t){if(t=s(t),e instanceof i){if(!!t.loose===e.loose&&!!t.includePrerelease===e.includePrerelease)return e;return new i(e.raw,t)}if(e instanceof a)return this.raw=e.value,this.set=[[e]],this.formatted=void 0,this;if(this.options=t,this.loose=!!t.loose,this.includePrerelease=!!t.includePrerelease,this.raw=e.trim().replace(n," "),this.set=this.raw.split("||").map(e=>this.parseRange(e.trim())).filter(e=>e.length),!this.set.length)throw TypeError(`Invalid SemVer Range: ${this.raw}`);
1if(this.set.length>1){let e=this.set[0];if(this.set=this.set.filter(e=>!m(e[0])),0===this.set.length)this.set=[e];else if(this.set.length>1){for(let e of this.set)if(1===e.length&&b(e[0])){this.set=[e];break}}}this.formatted=void 0}get range(){if(void 0===this.formatted){this.formatted="";for(let e=0;e<this.set.length;e++){e>0&&(this.formatted+="||");let t=this.set[e];for(let e=0;e<t.length;e++)e>0&&(this.formatted+=" "),this.formatted+=t[e].toString().trim()}}return this.formatted}format(){return this.range}toString(){return this.range}parseRange(e){let t=((this.options.includePrerelease&&y)|(this.options.loose&&g))+":"+e,r=o.get(t);if(r)return r;let n=this.options.loose,i=n?l[d.HYPHENRANGELOOSE]:l[d.HYPHENRANGE];c("hyphen replace",e=e.replace(i,M(this.options.includePrerelease))),c("comparator trim",e=e.replace(l[d.COMPARATORTRIM],f)),c("tilde trim",e=e.replace(l[d.TILDETRIM],h)),c("caret trim",e=e.replace(l[d.CARETTRIM],p));let s=e.split(" ").map(e=>w(e,this.options)).join(" ").split(/\s+/).map(e=>P(e,this.options));n&&(s=s.filter(e=>(c("loose invalid filter",e,this.options),!!e.match(l[d.COMPARATORLOOSE])))),c("range list",s);let u=new Map;for(let e of s.map(e=>new a(e,this.options))){if(m(e))return[e];u.set(e.value,e)}u.size>1&&u.has("")&&u.delete("");let b=[...u.values()];return o.set(t,b),b}intersects(e,t){if(!(e instanceof i))throw TypeError("a Range is required");return this.set.some(r=>v(r,t)&&e.set.some(e=>v(e,t)&&r.every(r=>e.every(e=>r.intersects(e,t)))))}test(e){if(!e)return!1;if("string"==typeof e)try{e=new u(e,this.options)}catch(e){return!1}for(let t=0;t<this.set.length;t++)if(N(this.set[t],e,this.options))return!0;return!1}}e.exports=i;let o=new(r(6560)),s=r(95151),a=r(95276),c=r(80200),u=r(33956),{safeRe:l,t:d,comparatorTrimReplace:f,tildeTrimReplace:h,c
1aretTrimReplace:p}=r(96960),{FLAG_INCLUDE_PRERELEASE:y,FLAG_LOOSE:g}=r(22390),m=e=>"<0.0.0-0"===e.value,b=e=>""===e.value,v=(e,t)=>{let r=!0,n=e.slice(),i=n.pop();for(;r&&n.length;)r=n.every(e=>i.intersects(e,t)),i=n.pop();return r},w=(e,t)=>(c("comp",e=e.replace(l[d.BUILD],""),t),c("caret",e=x(e,t)),c("tildes",e=E(e,t)),c("xrange",e=I(e,t)),c("stars",e=T(e,t)),e),_=e=>!e||"x"===e.toLowerCase()||"*"===e,E=(e,t)=>e.trim().split(/\s+/).map(e=>S(e,t)).join(" "),S=(e,t)=>{let r=t.loose?l[d.TILDELOOSE]:l[d.TILDE];return e.replace(r,(t,r,n,i,o)=>{let s;return c("tilde",e,t,r,n,i,o),_(r)?s="":_(n)?s=`>=${r}.0.0 <${+r+1}.0.0-0`:_(i)?s=`>=${r}.${n}.0 <${r}.${+n+1}.0-0`:o?(c("replaceTilde pr",o),s=`>=${r}.${n}.${i}-${o} <${r}.${+n+1}.0-0`):s=`>=${r}.${n}.${i} <${r}.${+n+1}.0-0`,c("tilde return",s),s})},x=(e,t)=>e.trim().split(/\s+/).map(e=>A(e,t)).join(" "),A=(e,t)=>{c("caret",e,t);let r=t.loose?l[d.CARETLOOSE]:l[d.CARET],n=t.includePrerelease?"-0":"";return e.replace(r,(t,r,i,o,s)=>{let a;return c("caret",e,t,r,i,o,s),_(r)?a="":_(i)?a=`>=${r}.0.0${n} <${+r+1}.0.0-0`:_(o)?a="0"===r?`>=${r}.${i}.0${n} <${r}.${+i+1}.0-0`:`>=${r}.${i}.0${n} <${+r+1}.0.0-0`:s?(c("replaceCaret pr",s),a="0"===r?"0"===i?`>=${r}.${i}.${o}-${s} <${r}.${i}.${+o+1}-0`:`>=${r}.${i}.${o}-${s} <${r}.${+i+1}.0-0`:`>=${r}.${i}.${o}-${s} <${+r+1}.0.0-0`):(c("no pr"),a="0"===r?"0"===i?`>=${r}.${i}.${o}${n} <${r}.${i}.${+o+1}-0`:`>=${r}.${i}.${o}${n} <${r}.${+i+1}.0-0`:`>=${r}.${i}.${o} <${+r+1}.0.0-0`),c("caret return",a),a})},I=(e,t)=>(c("replaceXRanges",e,t),e.split(/\s+/).map(e=>O(e,t)).join(" ")),O=(e,t)=>{e=e.trim();let r=t.loose?l[d.XRANGELOOSE]:l[d.XRANGE];return e.replace(r,(r,n,i,o,s,a)=>{c("xRange",e,r,n,i,o,s,a);let u=_(i),l=u||_(o),d=l||_(s),f=d;return"="===n&&f&&(n=""),a=t.includePrerelease?"-0":"",u?r=">"===n||"<"===n?"<0.0.0-0":"*":n&&f?(l&&(o=0),s=0,">"===n?(n=">=",l?(i=+i+1,o=0):o=+o+1,s=0):"<="===n&&(n="<",l?i=+i+1:o=+o+1),"<"===n&&(a="-0"),r=`${n+i}.${o}.${s}${a}`):l?r=`>=${i}.0.0${a} <${+i+1}.0.0-0`:d&&(r=`>=${i}.${o}.0${a} <${i}.${+o+1}.0-0`),c("xRange return",r),r})},T=(e,t)=>(c("replaceStars",e,t),e.trim().replace(l[d.STAR],"")),P=(e,t)=>(c("replaceGTE0",e,t),e.trim().replace(l[t.includePrerelease?d.GTE0PRE:d.GTE0],"")),M=e=>(t,r,n,i,o,s,a,c,u,l,d,f)=>(r=_(n)?"":_(i)?`>=${n}.0.0${e?"-0":""}`:_(o)?`>=${n}.${i}.0${e?"-0":""}`:s?`>=${r}`:`>=${r}${e?"-0":""}`,c=_(u)?"":_(l)?`<${+u+1}.0.0-0`:_(d)?`<${u}.${+l+1}.0-0`:f?`<=${u}.${l}.${d}-${f}`:e?`<${u}.${l}.${+d+1}-0`:`<=${c}`,`${r} ${c}`.trim()),N=(e,t,r)=>{for(let r=0;r<e.length;r++)if(!e[r].test(t))return!1;if(t.prerelease.length&&!r.includePrerelease){for(let r=0;r<e.length;r++)if(c(e[r].semver),e[r].semver!==a.ANY&&e[r].semver.prerelease.length>0){let n=e[r].semver;if(n.major===t.major&&n.minor===t.minor&&n.patch===t.patch)return!0}return!1}return!0}},33956:(e,t,r)=>{"use strict";let n=r(80200),{MAX_LENGTH:i,MAX_SAFE_INTEGER:o}=r(22390),{safeRe:s,t:a}=r(96960),c=r(95151),{compareIdentifiers:u}=r(28599);class l{constructor(e,t){if(t=c(t),e instanceof l){if(!!t.loose===e.loose&&!!t.includePrerelease===e.includePrerelease)return e;e=e.version}else if("string"!=typeof e)throw TypeError(`Invalid version. Must be a string. Got type "${typeof e}".`);if(e.length>i)throw TypeError(`version is longer than ${i} characters`);n("SemVer",e,t),this.options=t,this.loose=!!t.loose,this.includePrerelease=!!t.includePrerelease;let r=e.trim().match(t.loose?s[a.LOOSE]:s[a.FULL]);if(!r)throw TypeError(`Invalid Version: ${e}`);if(this.raw=e,this.major=+r[1],this.minor=+r[2],this.patch=+r[3],this.major>o||this.major<0)throw TypeError("Invalid major version");if(this.minor>o||this.minor<0)throw TypeError("Invalid minor version");if(this.patch>o||this.patch<0)throw TypeError("Invalid patch version");r[4]?this.prerelease=r[4].split(".").map(e=>{if(/^[0-9]+$/.test(e)){let t=+e;if(t>=0&&t<o)return t}return e}):this.prerelease=[],this.build=r[5]?r[5].split("."):[],this.format()}format(){return this.version=`${this.major}.${this.minor}.${this.patch}`,this.prerelease.length&&(this.version+=`-${this.prerelease.join(".")}`),this.version}toString(){return this.version}compare(e){if(n("SemVer.compare",this.version,this.options,e),!(e instanceof l)){if("string"==typeof e&&e===this.version)return 0;e=new l(e,this.options)}return e.version===this.version?0:this.compareMain(e)||this.comparePre(e)}compareMain(e){return(e instanceof l||(e=new l(e,this.options)),this.major<e.major)?-1:this.major>e.major?1:this.minor<e.minor?-1:this.minor>e.minor?1:this.patch<e.patch?-1:this.patch>e.patch?1:0}comparePre(e){if(e instanceof l||(e=new l(e,this.options)),this.prerelease.length&&!e.prerelease.length)return -1;if(!this.prerelease.length&&e.prerelease.length)return 1;if(!this.prerelease.length&&!e.prerelease.length)return 0;let t=0;do{let r=this.prerelease[t],i=e.prerelease[t];
1if(n("prerelease compare",t,r,i),void 0===r&&void 0===i)return 0;if(void 0===i)return 1;if(void 0===r)return -1;if(r===i)continue;else return u(r,i)}while(++t)}compareBuild(e){e instanceof l||(e=new l(e,this.options));let t=0;do{let r=this.build[t],i=e.build[t];if(n("build compare",t,r,i),void 0===r&&void 0===i)return 0;if(void 0===i)return 1;if(void 0===r)return -1;if(r===i)continue;else return u(r,i)}while(++t)}inc(e,t,r){if(e.startsWith("pre")){if(!t&&!1===r)throw Error("invalid increment argument: identifier is empty");if(t){let e=`-${t}`.match(this.options.loose?s[a.PRERELEASELOOSE]:s[a.PRERELEASE]);if(!e||e[1]!==t)throw Error(`invalid identifier: ${t}`)}}switch(e){case"premajor":this.prerelease.length=0,this.patch=0,this.minor=0,this.major++,this.inc("pre",t,r);break;case"preminor":this.prerelease.length=0,this.patch=0,this.minor++,this.inc("pre",t,r);break;case"prepatch":this.prerelease.length=0,this.inc("patch",t,r),this.inc("pre",t,r);break;case"prerelease":0===this.prerelease.length&&this.inc("patch",t,r),this.inc("pre",t,r);break;case"release":if(0===this.prerelease.length)throw Error(`version ${this.raw} is not a prerelease`);this.prerelease.length=0;break;case"major":(0!==this.minor||0!==this.patch||0===this.prerelease.length)&&this.major++,this.minor=0,this.patch=0,this.prerelease=[];break;case"minor":(0!==this.patch||0===this.prerelease.length)&&this.minor++,this.patch=0,this.prerelease=[];break;case"patch":0===this.prerelease.length&&this.patch++,this.prerelease=[];break;case"pre":{let e=Number(r)?1:0;if(0===this.prerelease.length)this.prerelease=[e];else{let n=this.prerelease.length;for(;--n>=0;)"number"==typeof this.prerelease[n]&&(this.prerelease[n]++,n=-2);
1if(-1===n){if(t===this.prerelease.join(".")&&!1===r)throw Error("invalid increment argument: identifier already exists");this.prerelease.push(e)}}if(t){let n=[t,e];!1===r&&(n=[t]),0===u(this.prerelease[0],t)?isNaN(this.prerelease[1])&&(this.prerelease=n):this.prerelease=n}break}default:throw Error(`invalid increment argument: ${e}`)}return this.raw=this.format(),this.build.length&&(this.raw+=`+${this.build.join(".")}`),this}}e.exports=l},7416:(e,t,r)=>{"use strict";let n=r(16946),i=(e,t)=>{let r=n(e.trim().replace(/^[=v]+/,""),t);return r?r.version:null};e.exports=i},96949:(e,t,r)=>{"use strict";let n=r(6505),i=r(68197),o=r(23472),s=r(43891),a=r(95871),c=r(66134),u=(e,t,r,u)=>{switch(t){case"===":return"object"==typeof e&&(e=e.version),"object"==typeof r&&(r=r.version),e===r;case"!==":return"object"==typeof e&&(e=e.version),"object"==typeof r&&(r=r.version),e!==r;case"":case"=":case"==":return n(e,r,u);case"!=":return i(e,r,u);case">":return o(e,r,u);case">=":return s(e,r,u);case"<":return a(e,r,u);case"<=":return c(e,r,u);default:throw TypeError(`Invalid operator: ${t}`)}};e.exports=u},34070:(e,t,r)=>{"use strict";let n=r(33956),i=r(16946),{safeRe:o,t:s}=r(96960),a=(e,t)=>{if(e instanceof n)return e;if("number"==typeof e&&(e=String(e)),"string"!=typeof e)return null;let r=null;if((t=t||{}).rtl){let n;let i=t.includePrerelease?o[s.COERCERTLFULL]:o[s.COERCERTL];for(;(n=i.exec(e))&&(!r||r.index+r[0].length!==e.length);)r&&n.index+n[0].length===r.index+r[0].length||(r=n),i.lastIndex=n.index+n[1].length+n[2].length;i.lastIndex=-1}else r=e.match(t.includePrerelease?o[s.COERCEFULL]:o[s.COERCE]);if(null===r)return null;let a=r[2],c=r[3]||"0",u=r[4]||"0",l=t.includePrerelease&&r[5]?`-${r[5]}`:"",d=t.includePrerelease&&r[6]?`+${r[6]}`:"";return i(`${a}.${c}.${u}${l}${d}`,t)};e.exports=a},49755:(e,t,r)=>{"use strict";let n=r(33956),i=(e,t,r)=>{let i=new n(e,r),o=new n(t,r);return i.compare(o)||i.compareBuild(o)};e.exports=i},23597:(e,t,r)=>{"use strict";let n=r(58810),i=(e,t)=>n(e,t,!0);e.exports=i},58810:(e,t,r)=>{"use strict";let n=r(33956),i=(e,t,r)=>new n(e,r).compare(new n(t,r));e.exports=i},60716:(e,t,r)=>{"use strict";let n=r(16946),i=(e,t)=>{let r=n(e,null,!0),i=n(t,null,!0),o=r.compare(i);if(0===o)return null;let s=o>0,a=s?r:i,c=s?i:r,u=!!a.prerelease.length;if(c.prerelease.length&&!u){if(!c.patch&&!c.minor)return"major";if(0===c.compareMain(a))return c.minor&&!c.patch?"minor":"patch"}let l=u?"pre":"";return r.major!==i.major?l+"major":r.minor!==i.minor?l+"minor":r.patch!==i.patch?l+"patch":"prerelease"};e.exports=i},6505:(e,t,r)=>{"use strict";let n=r(58810),i=(e,t,r)=>0===n(e,t,r);e.exports=i},23472:(e,t,r)=>{"use strict";let n=r(58810),i=(e,t,r)=>n(e,t,r)>0;e.exports=i},43891:(e,t,r)=>{"use strict";let n=r(58810),i=(e,t,r)=>n(e,t,r)>=0;e.exports=i},51861:(e,t,r)=>{"use strict";let n=r(33956),i=(e,t,r,i,o)=>{"string"==typeof r&&(o=i,i=r,r=void 0);try{return new n(e instanceof n?e.version:e,r).inc(t,i,o).version}catch(e){return null}};e.exports=i},95871:(e,t,r)=>{"use strict";let n=r(58810),i=(e,t,r)=>0>n(e,t,r);e.exports=i},66134:(e,t,r)=>{"use strict";let n=r(58810),i=(e,t,r)=>0>=n(e,t,r);e.exports=i},90100:(e,t,r)=>{"use strict";let n=r(33956),i=(e,t)=>new n(e,t).major;e.exports=i},95016:(e,t,r)=>{"use strict";let n=r(33956),i=(e,t)=>new n(e,t).minor;e.exports=i},68197:(e,t,r)=>{"use strict";let n=r(58810),i=(e,t,r)=>0!==n(e,t,r);e.exports=i},16946:(e,t,r)=>{"use strict";let n=r(33956),i=(e,t,r=!1)=>{if(e instanceof n)return e;try{return new n(e,t)}catch(e){if(!r)return null;throw e}};e.exports=i},18003:(e,t,r)=>{"use strict";let n=r(33956),i=(e,t)=>new n(e,t).patch;e.exports=i},18141:(e,t,r)=>{"use strict";let n=r(16946),i=(e,t)=>{let r=n(e,t);return r&&r.prerelease.length?r.prerelease:null};e.exports=i},72970:(e,t,r)=>{"use strict";let n=r(58810),i=(e,t,r)=>n(t,e,r);e.exports=i},96747:(e,t,r)=>{"use strict";let n=r(49755),i=(e,t)=>e.sort((e,r)=>n(r,e,t));e.exports=i},83596:(e,t,r)=>{"use strict";let n=r(88357),i=(e,t,r)=>{try{t=new n(t,r)}catch(e){return!1}return t.test(e)};e.exports=i},92507:(e,t,r)=>{"use strict";let n=r(49755),i=(e,t)=>e.sort((e,r)=>n(e,r,t));e.exports=i},51515:(e,t,r)=>{"use strict";let n=r(16946),i=(e,t)=>{let r=n(e,t);return r?r.version:null};e.exports=i},60235:(e,t,r)=>{"use strict";let n=r(96960),i=r(22390),o=r(33956),s=r(28599),a=r(16946),c=r(51515),u=r(7416),l=r(51861),d=r(60716),f=r(90100),h=r(95016),p=r(18003),y=r(18141),g=r(58810),m=r(72970),b=r(23597),v=r(49755),w=r(92507),_=r(96747),E=r(23472),S=r(95871),x=r(6505),A=r(68197),I=r(43891),O=r(66134),T=r(96949),P=r(34070),M=r(95276),N=r(88357),k=r(83596),C=r(56021),D=r(29201),j=r(80020),R=r(23393),L=r(63578),B=r(42839),U=r(25331),$=r(41638),K=r(39686),F=r(2559),z=r(29534);
1e.exports={parse:a,valid:c,clean:u,inc:l,diff:d,major:f,minor:h,patch:p,prerelease:y,compare:g,rcompare:m,compareLoose:b,compareBuild:v,sort:w,rsort:_,gt:E,lt:S,eq:x,neq:A,gte:I,lte:O,cmp:T,coerce:P,Comparator:M,Range:N,satisfies:k,toComparators:C,maxSatisfying:D,minSatisfying:j,minVersion:R,validRange:L,outside:B,gtr:U,ltr:$,intersects:K,simplifyRange:F,subset:z,SemVer:o,re:n.re,src:n.src,tokens:n.t,SEMVER_SPEC_VERSION:i.SEMVER_SPEC_VERSION,RELEASE_TYPES:i.RELEASE_TYPES,compareIdentifiers:s.compareIdentifiers,rcompareIdentifiers:s.rcompareIdentifiers}},22390:e=>{"use strict";let t="2.0.0",r=256,n=Number.MAX_SAFE_INTEGER||0x1fffffffffffff,i=16,o=250,s=["major","premajor","minor","preminor","patch","prepatch","prerelease"];e.exports={MAX_LENGTH:r,MAX_SAFE_COMPONENT_LENGTH:i,MAX_SAFE_BUILD_LENGTH:o,MAX_SAFE_INTEGER:n,RELEASE_TYPES:s,SEMVER_SPEC_VERSION:t,FLAG_INCLUDE_PRERELEASE:1,FLAG_LOOSE:2}},80200:(e,t,r)=>{"use strict";var n=r(2818);let i="object"==typeof n&&n.env&&n.env.NODE_DEBUG&&/\bsemver\b/i.test(n.env.NODE_DEBUG)?(...e)=>console.error("SEMVER",...e):()=>{};e.exports=i},28599:e=>{"use strict";let t=/^[0-9]+$/,r=(e,r)=>{if("number"==typeof e&&"number"==typeof r)return e===r?0:e<r?-1:1;let n=t.test(e),i=t.test(r);return n&&i&&(e=+e,r=+r),e===r?0:n&&!i?-1:i&&!n?1:e<r?-1:1},n=(e,t)=>r(t,e);e.exports={compareIdentifiers:r,rcompareIdentifiers:n}},6560:e=>{"use strict";class t{constructor(){this.max=1e3,this.map=new Map}get(e){let t=this.map.get(e);if(void 0!==t)return this.map.delete(e),this.map.set(e,t),t}delete(e){return this.map.delete(e)}set(e,t){if(!this.delete(e)&&void 0!==t){if(this.map.size>=this.max){let e=this.map.keys().next().value;this.delete(e)}this.map.set(e,t)}return this}}e.exports=t},95151:e=>{"use strict";let t=Object.freeze({loose:!0}),r=Object.freeze({}),n=e=>e?"object"!=typeof e?t:e:r;e.exports=n},96960:(e,t,r)=>{"use strict";let{MAX_SAFE_COMPONENT_LENGTH:n,MAX_SAFE_BUILD_LENGTH:i,MAX_LENGTH:o}=r(22390),s=r(80200),a=(t=e.exports={}).re=[],c=t.safeRe=[],u=t.src=[],l=t.safeSrc=[],d=t.t={},f=0,h="[a-zA-Z0-9-]",p=[["\\s",1],["\\d",o],[h,i]],y=e=>{for(let[t,r]of p)e=e.split(`${t}*`).join(`${t}{0,${r}}`).split(`${t}+`).join(`${t}{1,${r}}`);return e},g=(e,t,r)=>{let n=y(t),i=f++;s(e,i,t),d[e]=i,u[i]=t,l[i]=n,a[i]=new RegExp(t,r?"g":void 0),c[i]=new RegExp(n,r?"g":void 0)};g("NUMERICIDENTIFIER","0|[1-9]\\d*"),g("NUMERICIDENTIFIERLOOSE","\\d+"),g("NONNUMERICIDENTIFIER",`\\d*[a-zA-Z-]${h}*`),g("MAINVERSION",`(${u[d.NUMERICIDENTIFIER]})\\.(${u[d.NUMERICIDENTIFIER]})\\.(${u[d.NUMERICIDENTIFIER]})`),g("MAINVERSIONLOOSE",`(${u[d.NUMERICIDENTIFIERLOOSE]})\\.(${u[d.NUMERICIDENTIFIERLOOSE]})\\.(${u[d.NUMERICIDENTIFIERLOOSE]})`),g("PRERELEASEIDENTIFIER",`(?:${u[d.NONNUMERICIDENTIFIER]}|${u[d.NUMERICIDENTIFIER]})`),g("PRERELEASEIDENTIFIERLOOSE",`(?:${u[d.NONNUMERICIDENTIFIER]}|${u[d.NUMERICIDENTIFIERLOOSE]})`),g("PRERELEASE",`(?:-(${u[d.PRERELEASEIDENTIFIER]}(?:\\.${u[d.PRERELEASEIDENTIFIER]})*))`),g("PRERELEASELOOSE",`(?:-?(${u[d.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${u[d.PRERELEASEIDENTIFIERLOOSE]})*))`),g("BUILDIDENTIFIER",`${h}+`),g("BUILD",`(?:\\+(${u[d.BUILDIDENTIFIER]}(?:\\.${u[d.BUILDIDENTIFIER]})*))`),g("FULLPLAIN",`v?${u[d.MAINVERSION]}${u[d.PRERELEASE]}?${u[d.BUILD]}?`),g("FULL",`^${u[d.FULLPLAIN]}$`),g("LOOSEPLAIN",`[v=\\s]*${u[d.MAINVERSIONLOOSE]}${u[d.PRERELEASELOOSE]}?${u[d.BUILD]}?`),g("LOOSE",`^${u[d.LOOSEPLAIN]}$`),g("GTLT","((?:<|>)?=?)"),g("XRANGEIDENTIFIERLOOSE",`${u[d.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`),g("XRANGEIDENTIFIER",`${u[d.NUMERICIDENTIFIER]}|x|X|\\*`),g("XRANGEPLAIN",`[v=\\s]*(${u[d.XRANGEIDENTIFIER]})(?:\\.(${u[d.XRANGEIDENTIFIER]})(?:\\.(${u[d.XRANGEIDENTIFIER]})(?:${u[d.PRERELEASE]})?${u[d.BUILD]}?)?)?`),g("XRANGEPLAINLOOSE",`[v=\\s]*(${u[d.XRANGEIDENTIFIERLOOSE]})(?:\\.(${u[d.XRANGEIDENTIFIERLOOSE]})(?:\\.(${u[d.XRANGEIDENTIFIERLOOSE]})(?:${u[d.PRERELEASELOOSE]})?${u[d.BUILD]}?)?)?`),g("XRANGE",`^${u[d.GTLT]}\\s*${u[d.XRANGEPLAIN]}$`),g("XRANGELOOSE",`^${u[d.GTLT]}\\s*${u[d.XRANGEPLAINLOOSE]}$`),g("COERCEPLAIN",`(^|[^\\d])(\\d{1,${n}})(?:\\.(\\d{1,${n}}))?(?:\\.(\\d{1,${n}}))?`),g("COERCE",`${u[d.COERCEPLAIN]}(?:$|[^\\d])`),g("COERCEFULL",u[d.COERCEPLAIN]+`(?:${u[d.PRERELEASE]})?`+`(?:${u[d.BUILD]})?`+"(?:$|[^\\d])"),g("COERCERTL",u[d.COERCE],!0),g("COERCERTLFULL",u[d.COERCEFULL],!0),g("LONETILDE","(?:~>?)"),g("TILDETRIM",`(\\s*)${u[d.LONETILDE]}\\s+`,!0),t.tildeTrimReplace="$1~",g("TILDE",`^${u[d.LONETILDE]}${u[d.XRANGEPLAIN]}$`),g("TILDELOOSE",`^${u[d.LONETILDE]}${u[d.XRANGEPLAINLOOSE]}$`),g("LONECARET","(?:\\^)"),g("CARETTRIM",`(\\s*)${u[d.LONECARET]}
1\\s+`,!0),t.caretTrimReplace="$1^",g("CARET",`^${u[d.LONECARET]}${u[d.XRANGEPLAIN]}$`),g("CARETLOOSE",`^${u[d.LONECARET]}${u[d.XRANGEPLAINLOOSE]}$`),g("COMPARATORLOOSE",`^${u[d.GTLT]}\\s*(${u[d.LOOSEPLAIN]})$|^$`),g("COMPARATOR",`^${u[d.GTLT]}\\s*(${u[d.FULLPLAIN]})$|^$`),g("COMPARATORTRIM",`(\\s*)${u[d.GTLT]}\\s*(${u[d.LOOSEPLAIN]}|${u[d.XRANGEPLAIN]})`,!0),t.comparatorTrimReplace="$1$2$3",g("HYPHENRANGE",`^\\s*(${u[d.XRANGEPLAIN]})\\s+-\\s+(${u[d.XRANGEPLAIN]})\\s*$`),g("HYPHENRANGELOOSE",`^\\s*(${u[d.XRANGEPLAINLOOSE]})\\s+-\\s+(${u[d.XRANGEPLAINLOOSE]})\\s*$`),g("STAR","(<|>)?=?\\s*\\*"),g("GTE0","^\\s*>=\\s*0\\.0\\.0\\s*$"),g("GTE0PRE","^\\s*>=\\s*0\\.0\\.0-0\\s*$")},25331:(e,t,r)=>{"use strict";let n=r(42839),i=(e,t,r)=>n(e,t,">",r);e.exports=i},39686:(e,t,r)=>{"use strict";let n=r(88357),i=(e,t,r)=>(e=new n(e,r),t=new n(t,r),e.intersects(t,r));e.exports=i},41638:(e,t,r)=>{"use strict";let n=r(42839),i=(e,t,r)=>n(e,t,"<",r);e.exports=i},29201:(e,t,r)=>{"use strict";let n=r(33956),i=r(88357),o=(e,t,r)=>{let o=null,s=null,a=null;try{a=new i(t,r)}catch(e){return null}return e.forEach(e=>{a.test(e)&&(!o||-1===s.compare(e))&&(s=new n(o=e,r))}),o};e.exports=o},80020:(e,t,r)=>{"use strict";let n=r(33956),i=r(88357),o=(e,t,r)=>{let o=null,s=null,a=null;try{a=new i(t,r)}catch(e){return null}return e.forEach(e=>{a.test(e)&&(!o||1===s.compare(e))&&(s=new n(o=e,r))}),o};e.exports=o},23393:(e,t,r)=>{"use strict";let n=r(33956),i=r(88357),o=r(23472),s=(e,t)=>{e=new i(e,t);let r=new n("0.0.0");if(e.test(r)||(r=new n("0.0.0-0"),e.test(r)))return r;r=null;for(let t=0;t<e.set.length;++t){let i=e.set[t],s=null;i.forEach(e=>{let t=new n(e.semver.version);switch(e.operator){case">":0===t.prerelease.length?t.patch++:t.prerelease.push(0),t.raw=t.format();case"":case">=":(!s||o(t,s))&&(s=t);break;case"<":case"<=":break;default:throw Error(`Unexpected operation: ${e.operator}`)}}),s&&(!r||o(r,s))&&(r=s)}return r&&e.test(r)?r:null};e.exports=s},42839:(e,t,r)=>{"use strict";let n=r(33956),i=r(95276),{ANY:o}=i,s=r(88357),a=r(83596),c=r(23472),u=r(95871),l=r(66134),d=r(43891),f=(e,t,r,f)=>{let h,p,y,g,m;switch(e=new n(e,f),t=new s(t,f),r){case">":h=c,p=l,y=u,g=">",m=">=";break;case"<":h=u,p=d,y=c,g="<",m="<=";break;default:throw TypeError('Must provide a hilo val of "<" or ">"')}if(a(e,t,f))return!1;for(let r=0;r<t.set.length;++r){let n=t.set[r],s=null,a=null;if(n.forEach(e=>{e.semver===o&&(e=new i(">=0.0.0")),s=s||e,a=a||e,h(e.semver,s.semver,f)?s=e:y(e.semver,a.semver,f)&&(a=e)}),s.operator===g||s.operator===m||(!a.operator||a.operator===g)&&p(e,a.semver)||a.operator===m&&y(e,a.semver))return!1}return!0};e.exports=f},2559:(e,t,r)=>{"use strict";let n=r(83596),i=r(58810);e.exports=(e,t,r)=>{let o=[],s=null,a=null,c=e.sort((e,t)=>i(e,t,r));for(let e of c)n(e,t,r)?(a=e,s||(s=e)):(a&&o.push([s,a]),a=null,s=null);s&&o.push([s,null]);let u=[];for(let[e,t]of o)e===t?u.push(e):t||e!==c[0]?t?e===c[0]?u.push(`<=${t}`):u.push(`${e} - ${t}`):u.push(`>=${e}`):u.push("*");let l=u.join(" || "),d="string"==typeof t.raw?t.raw:String(t);return l.length<d.length?l:t}},29534:(e,t,r)=>{"use strict";let n=r(88357),i=r(95276),{ANY:o}=i,s=r(83596),a=r(58810),c=(e,t,r={})=>{if(e===t)return!0;e=new n(e,r),t=new n(t,r);let i=!1;e:for(let n of e.set){for(let e of t.set){let t=d(n,e,r);if(i=i||null!==t,t)continue e}if(i)return!1}return!0},u=[new i(">=0.0.0-0")],l=[new i(">=0.0.0")],d=(e,t,r)=>{let n,i,c,d,p,y,g;if(e===t)return!0;if(1===e.length&&e[0].semver===o){if(1===t.length&&t[0].semver===o)return!0;e=r.includePrerelease?u:l}if(1===t.length&&t[0].semver===o){if(r.includePrerelease)return!0;t=l}let m=new Set;for(let t of e)">"===t.operator||">="===t.operator?n=f(n,t,r):"<"===t.operator||"<="===t.operator?i=h(i,t,r):m.add(t.semver);if(m.size>1||n&&i&&((c=a(n.semver,i.semver,r))>0||0===c&&(">="!==n.operator||"<="!==i.operator)))return null;for(let e of m){if(n&&!s(e,String(n),r)||i&&!s(e,String(i),r))return null;for(let n of t)if(!s(e,String(n),r))return!1;return!0}let b=!!i&&!r.includePrerelease&&!!i.semver.prerelease.length&&i.semver,v=!!n&&!r.includePrerelease&&!!n.semver.prerelease.length&&n.semver;for(let e of(b&&1===b.prerelease.length&&"<"===i.operator&&0===b.prerelease[0]&&(b=!1),t)){if(g=g||">"===e.operator||">="===e.operator,y=y||"<"===e.operator||"<="===e.operator,n){if(v&&e.semver.prerelease&&e.semver.prerelease.length&&e.semver.major===v.major&&e.semver.minor===v.minor&&e.semver.patch===v.patch&&(v=!1),">"===e.operator||">="===e.operator){if((d=f(n,e,r))===e&&d!==n)return!1}else if(">="===n.operator&&!s(n.semver,String(e),r))return!1}if(i){if(b&&e.semver.prerelease&&e.semver.prerelease.length&&e.semver.major===b.major&&e.semver.minor===b.minor&&e.semver.patch===b.patch&&(b=!1),"<"===e.operator||"<="===e.operator){if((
1p=h(i,e,r))===e&&p!==i)return!1}else if("<="===i.operator&&!s(i.semver,String(e),r))return!1}if(!e.operator&&(i||n)&&0!==c)return!1}return(!n||!y||!!i||0===c)&&(!i||!g||!!n||0===c)&&!v&&!b},f=(e,t,r)=>{if(!e)return t;let n=a(e.semver,t.semver,r);return n>0?e:n<0?t:">"===t.operator&&">="===e.operator?t:e},h=(e,t,r)=>{if(!e)return t;let n=a(e.semver,t.semver,r);return n<0?e:n>0?t:"<"===t.operator&&"<="===e.operator?t:e};e.exports=c},56021:(e,t,r)=>{"use strict";let n=r(88357),i=(e,t)=>new n(e,t).set.map(e=>e.map(e=>e.value).join(" ").trim().split(" "));e.exports=i},63578:(e,t,r)=>{"use strict";let n=r(88357),i=(e,t)=>{try{return new n(e,t).range||"*"}catch(e){return null}};e.exports=i},90873:(e,t)=>{"use strict";function r(e){if(!Number.isSafeInteger(e)||e<0)throw Error(`Wrong positive integer: ${e}`)}function n(e){if("boolean"!=typeof e)throw Error(`Expected boolean, not ${e}`)}function i(e){return e instanceof Uint8Array||null!=e&&"object"==typeof e&&"Uint8Array"===e.constructor.name}function o(e,...t){if(!i(e))throw Error("Expected Uint8Array");if(t.length>0&&!t.includes(e.length))throw Error(`Expected Uint8Array of length ${t}, not of length=${e.length}`)}function s(e){if("function"!=typeof e||"function"!=typeof e.create)throw Error("Hash should be wrapped by utils.wrapConstructor");r(e.outputLen),r(e.blockLen)}function a(e,t=!0){if(e.destroyed)throw Error("Hash instance has been destroyed");if(t&&e.finished)throw Error("Hash#digest() has already been called")}function c(e,t){o(e);let r=t.outputLen;if(e.length<r)throw Error(`digestInto() expects output buffer of length at least ${r}`)}Object.defineProperty(t,"__esModule",{value:!0}),t.output=t.exists=t.hash=t.bytes=t.bool=t.number=void 0,t.number=r,t.bool=n,t.bytes=o,t.hash=s,t.exists=a,t.output=c;let u={number:r,bool:n,bytes:o,hash:s,exists:a,output:c};t.default=u},86439:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.SHA2=void 0;let n=r(90873),i=r(36383);function o(e,t,r,n){if("function"==typeof e.setBigUint64)return e.setBigUint64(t,r,n);let i=BigInt(32),o=BigInt(0xffffffff),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)}class s extends i.Hash{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=(0,i.createView)(this.buffer)}update(e){(0,n.exists)(this);let{view:t,buffer:r,blockLen:o}=this,s=(e=(0,i.toBytes)(e)).length;for(let n=0;n<s;){let a=Math.min(o-this.pos,s-n);if(a===o){let t=(0,i.createView)(e);for(;o<=s-n;n+=o)this.process(t,n);continue}r.set(e.subarray(n,n+a),this.pos),this.pos+=a,n+=a,this.pos===o&&(this.process(t,0),this.pos=0)}return this.length+=e.length,this.roundClean(),this}digestInto(e){(0,n.exists)(this),(0,n.output)(e,this),this.finished=!0;let{buffer:t,view:r,blockLen:s,isLE:a}=this,{pos:c}=this;t[c++]=128,this.buffer.subarray(c).fill(0),this.padOffset>s-c&&(this.process(r,0),c=0);for(let e=c;e<s;e++)t[e]=0;o(r,s-8,BigInt(8*this.length),a),this.process(r,0);let u=(0,i.createView)(e),l=this.outputLen;if(l%4)throw Error("_sha2: outputLen should be aligned to 32bit");let d=l/4,f=this.get();if(d>f.length)throw Error("_sha2: outputLen bigger than state");for(let e=0;e<d;e++)u.setUint32(4*e,f[e],a)}digest(){let{buffer:e,outputLen:t}=this;this.digestInto(e);let r=e.slice(0,t);return this.destroy(),r}_cloneInto(e){e||(e=new this.constructor),e.set(...this.get());let{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}}t.SHA2=s},20139:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.crypto=void 0,t.crypto="object"==typeof globalThis&&"crypto"in globalThis?globalThis.crypto:void 0},87349:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.sha224=t.sha256=void 0;let n=r(86439),i=r(36383),o=(e,t,r)=>e&t^~e&r,s=(e,t,r)=>e&t^e&r^t&r,a=new Uint32Array([0x428a2f98,0x71374491,0xb5c0fbcf,0xe9b5dba5,0x3956c25b,0x59f111f1,0x923f82a4,0xab1c5ed5,0xd807aa98,0x12835b01,0x243185be,0x550c7dc3,0x72be5d74,0x80deb1fe,0x9bdc06a7,0xc19bf174,0xe49b69c1,0xefbe4786,0xfc19dc6,0x240ca1cc,0x2de92c6f,0x4a7484aa,0x5cb0a9dc,0x76f988da,0x983e5152,0xa831c66d,0xb00327c8,0xbf597fc7,0xc6e00bf3,0xd5a79147,0x6ca6351,0x14292967,0x27b70a85,0x2e1b2138,0x4d2c6dfc,0x53380d13,0x650a7354,0x766a0abb,0x81c2c92e,0x92722c85,0xa2bfe8a1,0xa81a664b,0xc24b8b70,0xc
176c51a3,0xd192e819,0xd6990624,0xf40e3585,0x106aa070,0x19a4c116,0x1e376c08,0x2748774c,0x34b0bcb5,0x391c0cb3,0x4ed8aa4a,0x5b9cca4f,0x682e6ff3,0x748f82ee,0x78a5636f,0x84c87814,0x8cc70208,0x90befffa,0xa4506ceb,0xbef9a3f7,0xc67178f2]),c=new Uint32Array([0x6a09e667,0xbb67ae85,0x3c6ef372,0xa54ff53a,0x510e527f,0x9b05688c,0x1f83d9ab,0x5be0cd19]),u=new Uint32Array(64);class l extends n.SHA2{constructor(){super(64,32,8,!1),this.A=0|c[0],this.B=0|c[1],this.C=0|c[2],this.D=0|c[3],this.E=0|c[4],this.F=0|c[5],this.G=0|c[6],this.H=0|c[7]}get(){let{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 r=0;r<16;r++,t+=4)u[r]=e.getUint32(t,!1);for(let e=16;e<64;e++){let t=u[e-15],r=u[e-2],n=(0,i.rotr)(t,7)^(0,i.rotr)(t,18)^t>>>3,o=(0,i.rotr)(r,17)^(0,i.rotr)(r,19)^r>>>10;u[e]=o+u[e-7]+n+u[e-16]|0}let{A:r,B:n,C:c,D:l,E:d,F:f,G:h,H:p}=this;for(let e=0;e<64;e++){let t=p+((0,i.rotr)(d,6)^(0,i.rotr)(d,11)^(0,i.rotr)(d,25))+o(d,f,h)+a[e]+u[e]|0,y=((0,i.rotr)(r,2)^(0,i.rotr)(r,13)^(0,i.rotr)(r,22))+s(r,n,c)|0;p=h,h=f,f=d,d=l+t|0,l=c,c=n,n=r,r=t+y|0}r=r+this.A|0,n=n+this.B|0,c=c+this.C|0,l=l+this.D|0,d=d+this.E|0,f=f+this.F|0,h=h+this.G|0,p=p+this.H|0,this.set(r,n,c,l,d,f,h,p)}roundClean(){u.fill(0)}destroy(){this.set(0,0,0,0,0,0,0,0),this.buffer.fill(0)}}class d extends l{constructor(){super(),this.A=-0x3efa6128,this.B=0x367cd507,this.C=0x3070dd17,this.D=-0x8f1a6c7,this.E=-4191439,this.F=0x68581511,this.G=0x64f98fa7,this.H=-0x4105b05c,this.outputLen=28}}t.sha256=(0,i.wrapConstructor)(()=>new l),t.sha224=(0,i.wrapConstructor)(()=>new d)},36383:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.randomBytes=t.wrapXOFConstructorWithOpts=t.wrapConstructorWithOpts=t.wrapConstructor=t.checkOpts=t.Hash=t.concatBytes=t.toBytes=t.utf8ToBytes=t.asyncLoop=t.nextTick=t.hexToBytes=t.bytesToHex=t.isLE=t.rotr=t.createView=t.u32=t.u8=void 0;let n=r(20139),i=e=>new Uint8Array(e.buffer,e.byteOffset,e.byteLength);t.u8=i;let o=e=>new Uint32Array(e.buffer,e.byteOffset,Math.floor(e.byteLength/4));function s(e){return e instanceof Uint8Array||null!=e&&"object"==typeof e&&"Uint8Array"===e.constructor.name}t.u32=o;let a=e=>new DataView(e.buffer,e.byteOffset,e.byteLength);t.createView=a;let c=(e,t)=>e<<32-t|e>>>t;if(t.rotr=c,t.isLE=68===new Uint8Array(new Uint32Array([0x11223344]).buffer)[0],!t.isLE)throw Error("Non little-endian hardware is not supported");let u=Array.from({length:256},(e,t)=>t.toString(16).padStart(2,"0"));function l(e){if(!s(e))throw Error("Uint8Array expected");let t="";for(let r=0;r<e.length;r++)t+=u[e[r]];return t}t.bytesToHex=l;let d={_0:48,_9:57,_A:65,_F:70,_a:97,_f:102};function f(e){return e>=d._0&&e<=d._9?e-d._0:e>=d._A&&e<=d._F?e-(d._A-10):e>=d._a&&e<=d._f?e-(d._a-10):void 0}function h(e){if("string"!=typeof e)throw Error("hex string expected, got "+typeof e);let t=e.length,r=t/2;if(t%2)throw Error("padded hex string expected, got unpadded hex of length "+t);let n=new Uint8Array(r);for(let t=0,i=0;t<r;t++,i+=2){let r=f(e.charCodeAt(i)),o=f(e.charCodeAt(i+1));if(void 0===r||void 0===o)throw Error('hex string expected, got non-hex character "'+(e[i]+e[i+1])+'" at index '+i);n[t]=16*r+o}return n}t.hexToBytes=h;let p=async()=>{};async function y(e,r,n){let i=Date.now();for(let o=0;o<e;o++){n(o);let e=Date.now()-i;e>=0&&e<r||(await (0,t.nextTick)(),i+=e)}}function g(e){if("string"!=typeof e)throw Error(`utf8ToBytes expected string, got ${typeof e}`);return new Uint8Array(new TextEncoder().encode(e))}function m(e){if("string"==typeof e&&(e=g(e)),!s(e))throw Error(`expected Uint8Array, got ${typeof e}`);return e}function b(...e){let t=0;for(let r=0;r<e.length;r++){let n=e[r];if(!s(n))throw Error("Uint8Array expected");t+=n.length}let r=new Uint8Array(t);for(let t=0,n=0;t<e.length;t++){let i=e[t];r.set(i,n),n+=i.length}return r}t.nextTick=p,t.asyncLoop=y,t.utf8ToBytes=g,t.toBytes=m,t.concatBytes=b;class v{clone(){return this._cloneInto()}}t.Hash=v;let w={}.toString;function _(e,t){if(void 0!==t&&"[object Object]"!==w.call(t))throw Error("Options should be object or undefined");return Object.assign(e,t)}function E(e){let t=t=>e().update(m(t)).digest(),r=e();return t.outputLen=r.outputLen,t.blockLen=r.blockLen,t.create=()=>e(),t}function S(e){let t=(t,r)=>e(r).update(m(t)).digest(),r=e({});return t.outputLen=r.outputLen,t.blockLen=r.blockLen,t.create=t=>e(t),t}function x(e){let t=(t,r)=>e(r).update(m(t)).digest(),r=e({});return t.outputLen=r.outputLen,t.blockLen=r.blockLen,t.create=t=>e(t),t}function A(e=32){if(n.crypto&&"function"==typeof n.crypto.getRandomValues)return n.crypto.getRandomValues(new Uint8Array(e));throw Error("crypto.getRandomValues must be defined")}t.checkOpts=_,t.wrapConstructor=E,t.wrapConstructorWithOpts=S,t.wrapXOFConstructorWithOpts=x,t.randomBytes=A},21595:(e,t)=>{"use strict";function r(e){if(!Number.isSafeInteger(e)||e<0)throw Error("positive integer expected, got "+e)}function n(e){return e instanceof Uint8Array||ArrayBuffer.isView(e)&&"Uint8Array"===e.constructor.name}function i(e,...t){if(!n(e))throw Error("Uint8Array expected");if(t.length>0&&!t.includes(e.length))throw Error("Uint8Array expected of length "+t+", got length="+e.length)}function o(e){if("function"!=typeof e||"function"!=typeof e.create)throw Error("Hash should be wrapped by utils.wrapConstructor");r(e.outputLen),r(e.blockLen)}function s(e,t=!0){if(e.destroyed)throw Error("Hash instance has been destroyed");if(t&&e.finished)throw Error("Hash#digest() has already been called")}function a(e,t){i(e);let r=t.outputLen;if(e.length<r)throw Error("digestInto() expects output buffer of length at least "+r)}
1Object.defineProperty(t,"__esModule",{value:!0}),t.anumber=r,t.abytes=i,t.ahash=o,t.aexists=s,t.aoutput=a},81744:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.HashMD=void 0,t.setBigUint64=o,t.Chi=s,t.Maj=a;let n=r(21595),i=r(34725);function o(e,t,r,n){if("function"==typeof e.setBigUint64)return e.setBigUint64(t,r,n);let i=BigInt(32),o=BigInt(0xffffffff),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)}function s(e,t,r){return e&t^~e&r}function a(e,t,r){return e&t^e&r^t&r}class c extends i.Hash{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=(0,i.createView)(this.buffer)}update(e){(0,n.aexists)(this);let{view:t,buffer:r,blockLen:o}=this,s=(e=(0,i.toBytes)(e)).length;for(let n=0;n<s;){let a=Math.min(o-this.pos,s-n);if(a===o){let t=(0,i.createView)(e);for(;o<=s-n;n+=o)this.process(t,n);continue}r.set(e.subarray(n,n+a),this.pos),this.pos+=a,n+=a,this.pos===o&&(this.process(t,0),this.pos=0)}return this.length+=e.length,this.roundClean(),this}digestInto(e){(0,n.aexists)(this),(0,n.aoutput)(e,this),this.finished=!0;let{buffer:t,view:r,blockLen:s,isLE:a}=this,{pos:c}=this;t[c++]=128,this.buffer.subarray(c).fill(0),this.padOffset>s-c&&(this.process(r,0),c=0);for(let e=c;e<s;e++)t[e]=0;o(r,s-8,BigInt(8*this.length),a),this.process(r,0);let u=(0,i.createView)(e),l=this.outputLen;if(l%4)throw Error("_sha2: outputLen should be aligned to 32bit");let d=l/4,f=this.get();if(d>f.length)throw Error("_sha2: outputLen bigger than state");for(let e=0;e<d;e++)u.setUint32(4*e,f[e],a)}digest(){let{buffer:e,outputLen:t}=this;this.digestInto(e);let r=e.slice(0,t);return this.destroy(),r}_cloneInto(e){e||(e=new this.constructor),e.set(...this.get());let{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}}t.HashMD=c},45301:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.crypto=void 0,t.crypto="object"==typeof globalThis&&"crypto"in globalThis?globalThis.crypto:void 0},72551:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.sha224=t.sha256=t.SHA256=void 0;let n=r(81744),i=r(34725),o=new Uint32Array([0x428a2f98,0x71374491,0xb5c0fbcf,0xe9b5dba5,0x3956c25b,0x59f111f1,0x923f82a4,0xab1c5ed5,0xd807aa98,0x12835b01,0x243185be,0x550c7dc3,0x72be5d74,0x80deb1fe,0x9bdc06a7,0xc19bf174,0xe49b69c1,0xefbe4786,0xfc19dc6,0x240ca1cc,0x2de92c6f,0x4a7484aa,0x5cb0a9dc,0x76f988da,0x983e5152,0xa831c66d,0xb00327c8,0xbf597fc7,0xc6e00bf3,0xd5a79147,0x6ca6351,0x14292967,0x27b70a85,0x2e1b2138,0x4d2c6dfc,0x53380d13,0x650a7354,0x766a0abb,0x81c2c92e,0x92722c85,0xa2bfe8a1,0xa81a664b,0xc24b8b70,0xc76c51a3,0xd192e819,0xd6990624,0xf40e3585,0x106aa070,0x19a4c116,0x1e376c08,0x2748774c,0x34b0bcb5,0x391c0cb3,0x4ed8aa4a,0x5b9cca4f,0x682e6ff3,0x748f82ee,0x78a5636f,0x84c87814,0x8cc70208,0x90befffa,0xa4506ceb,0xbef9a3f7,0xc67178f2]),s=new Uint32Array([0x6a09e66
17,0xbb67ae85,0x3c6ef372,0xa54ff53a,0x510e527f,0x9b05688c,0x1f83d9ab,0x5be0cd19]),a=new Uint32Array(64);class c extends n.HashMD{constructor(){super(64,32,8,!1),this.A=0|s[0],this.B=0|s[1],this.C=0|s[2],this.D=0|s[3],this.E=0|s[4],this.F=0|s[5],this.G=0|s[6],this.H=0|s[7]}get(){let{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 r=0;r<16;r++,t+=4)a[r]=e.getUint32(t,!1);for(let e=16;e<64;e++){let t=a[e-15],r=a[e-2],n=(0,i.rotr)(t,7)^(0,i.rotr)(t,18)^t>>>3,o=(0,i.rotr)(r,17)^(0,i.rotr)(r,19)^r>>>10;a[e]=o+a[e-7]+n+a[e-16]|0}let{A:r,B:s,C:c,D:u,E:l,F:d,G:f,H:h}=this;for(let e=0;e<64;e++){let t=h+((0,i.rotr)(l,6)^(0,i.rotr)(l,11)^(0,i.rotr)(l,25))+(0,n.Chi)(l,d,f)+o[e]+a[e]|0,p=((0,i.rotr)(r,2)^(0,i.rotr)(r,13)^(0,i.rotr)(r,22))+(0,n.Maj)(r,s,c)|0;h=f,f=d,d=l,l=u+t|0,u=c,c=s,s=r,r=t+p|0}r=r+this.A|0,s=s+this.B|0,c=c+this.C|0,u=u+this.D|0,l=l+this.E|0,d=d+this.F|0,f=f+this.G|0,h=h+this.H|0,this.set(r,s,c,u,l,d,f,h)}roundClean(){a.fill(0)}destroy(){this.set(0,0,0,0,0,0,0,0),this.buffer.fill(0)}}t.SHA256=c;class u extends c{constructor(){super(),this.A=-0x3efa6128,this.B=0x367cd507,this.C=0x3070dd17,this.D=-0x8f1a6c7,this.E=-4191439,this.F=0x68581511,this.G=0x64f98fa7,this.H=-0x4105b05c,this.outputLen=28}}t.sha256=(0,i.wrapConstructor)(()=>new c),t.sha224=(0,i.wrapConstructor)(()=>new u)},34725:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Hash=t.nextTick=t.byteSwapIfBE=t.isLE=void 0,t.isBytes=o,t.u8=s,t.u32=a,t.createView=c,t.rotr=u,t.rotl=l,t.byteSwap=d,t.byteSwap32=f,t.bytesToHex=p,t.hexToBytes=m,t.asyncLoop=v,t.utf8ToBytes=w,t.toBytes=_,t.concatBytes=E,t.checkOpts=x,t.wrapConstructor=A,t.wrapConstructorWithOpts=I,t.wrapXOFConstructorWithOpts=O,t.randomBytes=T;let n=r(45301),i=r(21595);function o(e){return e instanceof Uint8Array||ArrayBuffer.isView(e)&&"Uint8Array"===e.constructor.name}function s(e){return new Uint8Array(e.buffer,e.byteOffset,e.byteLength)}function a(e){return new Uint32Array(e.buffer,e.byteOffset,Math.floor(e.byteLength/4))}function c(e){return new DataView(e.buffer,e.byteOffset,e.byteLength)}function u(e,t){return e<<32-t|e>>>t}function l(e,t){return e<<t|e>>>32-t>>>0}function d(e){return e<<24&0xff000000|e<<8&0xff0000|e>>>8&65280|e>>>24&255}function f(e){for(let t=0;t<e.length;t++)e[t]=d(e[t])}t.isLE=68===new Uint8Array(new Uint32Array([0x11223344]).buffer)[0],t.byteSwapIfBE=t.isLE?e=>e:e=>d(e);let h=Array.from({length:256},(e,t)=>t.toString(16).padStart(2,"0"));function p(e){(0,i.abytes)(e);let t="";for(let r=0;r<e.length;r++)t+=h[e[r]];return t}let y={_0:48,_9:57,A:65,F:70,a:97,f:102};function g(e){return e>=y._0&&e<=y._9?e-y._0:e>=y.A&&e<=y.F?e-(y.A-10):e>=y.a&&e<=y.f?e-(y.a-10):void 0}function m(e){if("string"!=typeof e)throw Error("hex string expected, got "+typeof e);let t=e.length,r=t/2;if(t%2)throw Error("hex string expected, got unpadded hex of length "+t);let n=new Uint8Array(r);for(let t=0,i=0;t<r;t++,i+=2){let r=g(e.charCodeAt(i)),o=g(e.charCodeAt(i+1));if(void 0===r||void 0===o)throw Error('hex string expected, got non-hex character "'+(e[i]+e[i+1])+'" at index '+i);n[t]=16*r+o}return n}let b=async()=>{};async function v(e,r,n){let i=Date.now();for(let o=0;o<e;o++){n(o);let e=Date.now()-i;e>=0&&e<r||(await (0,t.nextTick)(),i+=e)}}function w(e){if("string"!=typeof e)throw Error("utf8ToBytes expected string, got "+typeof e);return new Uint8Array(new TextEncoder().encode(e))}function _(e){return"string"==typeof e&&(e=w(e)),(0,i.abytes)(e),e}function E(...e){let t=0;for(let r=0;r<e.length;r++){let n=e[r];(0,i.abytes)(n),t+=n.length}let r=new Uint8Array(t);for(let t=0,n=0;t<e.length;t++){let i=e[t];r.set(i,n),n+=i.length}return r}t.nextTick=b;class S{clone(){return this._cloneInto()}}function x(e,t){if(void 0!==t&&"[object Object]"!==({}).toString.call(t))throw Error("Options should be object or undefined");return Object.assign(e,t)}function A(e){let t=t=>e().update(_(t)).digest(),r=e();return t.outputLen=r.outputLen,t.blockLen=r.blockLen,t.create=()=>e(),t}function I(e){let t=(t,r)=>e(r).update(_(t)).digest(),r=e({});return t.outputLen=r.outputLen,t.blockLen=r.blockLen,t.create=t=>e(t),t}function O(e){let t=(t,r)=>e(r).update(_(t)).digest(),r=e({});return t.outputLen=r.outputLen,t.blockLen=r.blockLen,t.create=t=>e(t),t}function T(e=32){if(n.crypto&&"function"==typeof n.crypto.getRandomValues)return n.crypto.getRandomValues(new Uint8Array(e));if(n.crypto&&"function"==typeof n.crypto.randomBytes)return n.crypto.randomBytes(e);throw Error("crypto.getRandomValues must be defined")}t.Hash=S},37742:(e,t)=>{"use strict";t.__esModule=!0,t.DecodeBuffer=t.EncodeBuffer=void 0;var r=function(){function e(){this.offset=0,this.buffer_size=256,this.buffer=new ArrayBuffer(this.buffer_size),this.view=new DataView(this.buffer)}return e.prototype.resize_if_necessary=function(e){if(this.buffer_size-this.offset<e){this.buffer_size=Math.max(2*this.buffer_size,this.buffer_size+e);var t=new ArrayBuffer(this.buffer_size);new Uint8Array(t).set(new Uint8Array(this.buffer)),this.buffer=t,this.view=new DataView(t)}},e.prototype.get_used_buffer=function(){return new Uint8Array(this.buffer).slice(0,this.offset)},e.prototype.store_value=function(e,t){var r=t.substring(1),n=parseInt(r)/8;this.resize_if_necessary(n);var i="f"===t[0]?"setFloat".concat(r):"i"===t[0]?"setInt".concat(r):"setUint".concat(r);this.view[i](this.offset,e,!0),this.offset+=n},e.prototype.store_bytes=function(e){this.resize_if_necessary(e.length),new Uint8Array(this.buffer).set(new Uint8Array(e),this.offset),this.offset+=e.length},e}();t.EncodeBuffer=r;var n=function(){function e(e){this.offset=0,this.buffer_size=e.length,this.buffer=new ArrayBuffer(e.length),new Uint8Array(this.buffer).set(e),this.view=new DataView(this.buffer)}return e.prototype.assert_enough_buffer=function(e){if(this.offset+e>this.buffer.byteLength)throw Error("Error in schema, the buffer is smaller than expected")},e.prototype.consume_value=function(e){var t=e.substring(1),r=parseInt(t)/8;this.assert_enough_buffer(r);var n="f"===e[0]?"getFloat".concat(t):"i"===e[0]?"getInt".concat(t):"getUint".concat(t),i=this.view[n](this.offset,!0);return this.offset+=r,i},e.prototype.consume_bytes=function(e){this.assert_enough_buffer(e);var t=this.buffer.slice(this.offset,this.offset+e);return this.offset+=e,t},e}();t.DecodeBuffer=n},78679:(e,t,r)=>{"use strict";
1t.__esModule=!0,t.BorshDeserializer=void 0;var n=r(89741),i=r(37742),o=function(){function e(e){this.buffer=new i.DecodeBuffer(e)}return e.prototype.decode=function(e){return this.decode_value(e)},e.prototype.decode_value=function(e){if("string"==typeof e){if(n.integers.includes(e))return this.decode_integer(e);if("string"===e)return this.decode_string();if("bool"===e)return this.decode_boolean()}if("object"==typeof e){if("option"in e)return this.decode_option(e);if("enum"in e)return this.decode_enum(e);if("array"in e)return this.decode_array(e);if("set"in e)return this.decode_set(e);if("map"in e)return this.decode_map(e);if("struct"in e)return this.decode_struct(e)}throw Error("Unsupported type: ".concat(e))},e.prototype.decode_integer=function(e){var t=parseInt(e.substring(1));return t<=32||"f64"==e?this.buffer.consume_value(e):this.decode_bigint(t,e.startsWith("i"))},e.prototype.decode_bigint=function(e,t){void 0===t&&(t=!1);var r=e/8,n=new Uint8Array(this.buffer.consume_bytes(r)),i=n.reduceRight(function(e,t){return e+t.toString(16).padStart(2,"0")},"");return t&&n[r-1]?BigInt.asIntN(e,BigInt("0x".concat(i))):BigInt("0x".concat(i))},e.prototype.decode_string=function(){var e=this.decode_integer("u32"),t=new Uint8Array(this.buffer.consume_bytes(e));return String.fromCharCode.apply(null,t)},e.prototype.decode_boolean=function(){return this.buffer.consume_value("u8")>0},e.prototype.decode_option=function(e){var t=this.buffer.consume_value("u8");if(1===t)return this.decode_value(e.option);if(0!==t)throw Error("Invalid option ".concat(t));return null},e.prototype.decode_enum=function(e){var t,r=this.buffer.consume_value("u8");if(r>e.enum.length)throw Error("Enum option ".concat(r," is not available"));var n=e.enum[r].struct,i=Object.keys(n)[0];return(t={})[i]=this.decode_value(n[i]),t},e.prototype.decode_array=function(e){for(var t=[],r=e.array.len?e.array.len:this.decode_integer("u32"),n=0;n<r;++n)t.push(this.decode_value(e.array.type));return t},e.prototype.decode_set=function(e){for(var t=this.decode_integer("u32"),r=new Set,n=0;n<t;++n)r.add(this.decode_value(e.set));return r},e.prototype.decode_map=function(e){for(var t=this.decode_integer("u32"),r=new Map,n=0;n<t;++n){var i=this.decode_value(e.map.key),o=this.decode_value(e.map.value);r.set(i,o)}return r},e.prototype.decode_struct=function(e){var t={};for(var r in e.struct)t[r]=this.decode_value(e.struct[r]);return t},e}();t.BorshDeserializer=o},68220:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);(!i||("get"in i?!t.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),o=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)"default"!==r&&Object.prototype.hasOwnProperty.call(e,r)&&n(t,e,r);return i(t,e),t};t.__esModule=!0,t.deserialize=t.serialize=void 0;var s=r(83514),a=r(78679),c=o(r(82841));function u(e,t,r){return void 0===r&&(r=!0),r&&c.validate_schema(e),new s.BorshSerializer(r).encode(t,e)}function l(e,t,r){return void 0===r&&(r=!0),r&&c.validate_schema(e),new a.BorshDeserializer(t).decode(e)}t.serialize=u,t.deserialize=l},83514:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);(!i||("get"in i?!t.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),o=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)"default"!==r&&Object.prototype.hasOwnProperty.call(e,r)&&n(t,e,r);return i(t,e),t};
1t.__esModule=!0,t.BorshSerializer=void 0;var s=r(89741),a=r(37742),c=o(r(82841)),u=function(){function e(e){this.encoded=new a.EncodeBuffer,this.fieldPath=["value"],this.checkTypes=e}return e.prototype.encode=function(e,t){return this.encode_value(e,t),this.encoded.get_used_buffer()},e.prototype.encode_value=function(e,t){if("string"==typeof t){if(s.integers.includes(t))return this.encode_integer(e,t);if("string"===t)return this.encode_string(e);if("bool"===t)return this.encode_boolean(e)}if("object"==typeof t){if("option"in t)return this.encode_option(e,t);if("enum"in t)return this.encode_enum(e,t);if("array"in t)return this.encode_array(e,t);if("set"in t)return this.encode_set(e,t);if("map"in t)return this.encode_map(e,t);if("struct"in t)return this.encode_struct(e,t)}},e.prototype.encode_integer=function(e,t){var r=parseInt(t.substring(1));r<=32||"f64"==t?(this.checkTypes&&c.expect_type(e,"number",this.fieldPath),this.encoded.store_value(e,t)):(this.checkTypes&&c.expect_bigint(e,this.fieldPath),this.encode_bigint(BigInt(e),r))},e.prototype.encode_bigint=function(e,t){for(var r=t/8,n=new Uint8Array(r),i=0;i<r;i++)n[i]=Number(e&BigInt(255)),e>>=BigInt(8);this.encoded.store_bytes(new Uint8Array(n))},e.prototype.encode_string=function(e){this.checkTypes&&c.expect_type(e,"string",this.fieldPath);var t=e;this.encoded.store_value(t.length,"u32");for(var r=0;r<t.length;r++)this.encoded.store_value(t.charCodeAt(r),"u8")},e.prototype.encode_boolean=function(e){this.checkTypes&&c.expect_type(e,"boolean",this.fieldPath),this.encoded.store_value(e?1:0,"u8")},e.prototype.encode_option=function(e,t){null==e?this.encoded.store_value(0,"u8"):(this.encoded.store_value(1,"u8"),this.encode_value(e,t.option))},e.prototype.encode_enum=function(e,t){this.checkTypes&&c.expect_enum(e,this.fieldPath);for(var r=Object.keys(e)[0],n=0;n<t.enum.length;n++){var i=t.enum[n];if(r===Object.keys(i.struct)[0])return this.encoded.store_value(n,"u8"),this.encode_struct(e,i)}throw Error("Enum key (".concat(r,") not found in enum schema: ").concat(JSON.stringify(t)," at ").concat(this.fieldPath.join(".")))},e.prototype.encode_array=function(e,t){if(c.isArrayLike(e))return this.encode_arraylike(e,t);if(e instanceof ArrayBuffer)return this.encode_buffer(e,t);throw Error("Expected Array-like not ".concat(typeof e,"(").concat(e,") at ").concat(this.fieldPath.join(".")))},e.prototype.encode_arraylike=function(e,t){t.array.len?c.expect_same_size(e.length,t.array.len,this.fieldPath):this.encoded.store_value(e.length,"u32");for(var r=0;r<e.length;r++)this.encode_value(e[r],t.array.type)},e.prototype.encode_buffer=function(e,t){t.array.len?c.expect_same_size(e.byteLength,t.array.len,this.fieldPath):this.encoded.store_value(e.byteLength,"u32"),this.encoded.store_bytes(new Uint8Array(e))},e.prototype.encode_set=function(e,t){this.checkTypes&&c.expect_type(e,"object",this.fieldPath);var r=e instanceof Set?Array.from(e.values()):Object.values(e);this.encoded.store_value(r.length,"u32");for(var n=0,i=r;n<i.length;n++){var o=i[n];this.encode_value(o,t.set)}},e.prototype.encode_map=function(e,t){this.checkTypes&&c.expect_type(e,"object",this.fieldPath);var r=e instanceof Map,n=r?Array.from(e.keys()):Object.keys(e);this.encoded.store_value(n.length,"u32");for(var i=0,o=n;i<o.length;i++){var s=o[i];this.encode_value(s,t.map.key),this.encode_value(r?e.get(s):e[s],t.map.value)}},e.prototype.encode_struct=function(e,t){this.checkTypes&&c.expect_type(e,"object",this.fieldPath);for(var r=0,n=Object.keys(t.struct);r<n.length;r++){var i=n[r];this.fieldPath.push(i),this.encode_value(e[i],t.struct[i]),this.fieldPath.pop()}},e}();t.BorshSerializer=u},89741:(e,t)=>{"use strict";t.__esModule=!0,t.integers=void 0,t.integers=["u8","u16","u32","u64","u128","i8","i16","i32","i64","i128","f32","f64"]},82841:function(e,t,r){"use strict";var n=this&&this.__extends||function(){var e=function(t,r){return(e=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])})(t,r)};return function(t,r){if("function"!=typeof r&&null!==r)throw TypeError("Class extends value "+String(r)+" is not a constructor or null");function n(){this.constructor=t}e(t,r),t.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}();t.__esModule=!0,t.validate_schema=t.ErrorSchema=t.expect_enum=t.expect_same_size=t.expect_bigint=t.expect_type=t.isArrayLike=void 0;var i=r(89741);function o(e){return Array.isArray(e)||!!e&&"object"==typeof e&&"length"in e&&"number"==typeof e.length&&(0===e.length||e.length>
10&&e.length-1 in e)}function s(e,t,r){if(typeof e!==t)throw Error("Expected ".concat(t," not ").concat(typeof e,"(").concat(e,") at ").concat(r.join(".")))}function a(e,t){var r=["number","string","bigint","boolean"].includes(typeof e),n="object"==typeof e&&null!==e&&"toString"in e;if(!r&&!n)throw Error("Expected bigint, number, boolean or string not ".concat(typeof e,"(").concat(e,") at ").concat(t.join(".")))}function c(e,t,r){if(e!==t)throw Error("Array length ".concat(e," does not match schema length ").concat(t," at ").concat(r.join(".")))}function u(e,t){if("object"!=typeof e||null===e)throw Error("Expected object not ".concat(typeof e,"(").concat(e,") at ").concat(t.join(".")))}t.isArrayLike=o,t.expect_type=s,t.expect_bigint=a,t.expect_same_size=c,t.expect_enum=u;var l=i.integers.concat(["bool","string"]),d=["option","enum","array","set","map","struct"],f=function(e){function t(t,r){var n="Invalid schema: ".concat(JSON.stringify(t)," expected ").concat(r);return e.call(this,n)||this}return n(t,e),t}(Error);function h(e){if(!("string"==typeof e&&l.includes(e))){if(e&&"object"==typeof e){var t=Object.keys(e);if(1===t.length&&d.includes(t[0])){var r=t[0];if("option"===r)return h(e[r]);if("enum"===r)return p(e[r]);if("array"===r)return y(e[r]);if("set"===r)return h(e[r]);if("map"===r)return g(e[r]);if("struct"===r)return m(e[r])}}throw new f(e,d.join(", ")+" or "+l.join(", "))}}function p(e){if(!Array.isArray(e))throw new f(e,"Array");for(var t=0,r=e;t<r.length;t++){var n=r[t];if("object"!=typeof n||!("struct"in n))throw Error('Missing "struct" key in enum schema');if("object"!=typeof n.struct||1!==Object.keys(n.struct).length)throw Error('The "struct" in each enum must have a single key');h({struct:n.struct})}}function y(e){if("object"!=typeof e)throw new f(e,"{ type, len? }");if(e.len&&"number"!=typeof e.len)throw Error("Invalid schema: ".concat(e));if("type"in e)return h(e.type);throw new f(e,"{ type, len? }")}function g(e){if("object"==typeof e&&"key"in e&&"value"in e)h(e.key),h(e.value);else throw new f(e,"{ key, value }")}function m(e){if("object"!=typeof e)throw new f(e,"object");for(var t in e)h(e[t])}t.ErrorSchema=f,t.validate_schema=h},87794:(e,t)=>{"use strict";function r(e){if(!Number.isSafeInteger(e)||e<0)throw Error(`Wrong positive integer: ${e}`)}function n(e){if("boolean"!=typeof e)throw Error(`Expected boolean, not ${e}`)}function i(e){return e instanceof Uint8Array||null!=e&&"object"==typeof e&&"Uint8Array"===e.constructor.name}function o(e,...t){if(!i(e))throw Error("Expected Uint8Array");if(t.length>0&&!t.includes(e.length))throw Error(`Expected Uint8Array of length ${t}, not of length=${e.length}`)}function s(e){if("function"!=typeof e||"function"!=typeof e.create)throw Error("Hash should be wrapped by utils.wrapConstructor");r(e.outputLen),r(e.blockLen)}function a(e,t=!0){if(e.destroyed)throw Error("Hash instance has been destroyed");if(t&&e.finished)throw Error("Hash#digest() has already been called")}function c(e,t){o(e);let r=t.outputLen;if(e.length<r)throw Error(`digestInto() expects output buffer of length at least ${r}`)}Object.defineProperty(t,"__esModule",{value:!0}),t.output=t.exists=t.hash=t.bytes=t.bool=t.number=void 0,t.number=r,t.bool=n,t.bytes=o,t.hash=s,t.exists=a,t.output=c;let u={number:r,bool:n,bytes:o,hash:s,exists:a,output:c};t.default=u},64636:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.SHA2=void 0;let n=r(87794),i=r(54400);function o(e,t,r,n){if("function"==typeof e.setBigUint64)return e.setBigUint64(t,r,n);let i=BigInt(32),o=BigInt(0xffffffff),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)}class s extends i.Hash{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=(0,i.createView)(this.buffer)}update(e){(0,n.exists)(this);let{view:t,buffer:r,blockLen:o}=this,s=(e=(0,i.toBytes)(e)).length;for(let n=0;n<s;){let a=Math.min(o-this.pos,s-n);if(a===o){let t=(0,i.createView)(e);for(;o<=s-n;n+=o)this.process(t,n);continue}r.set(e.subarray(n,n+a),this.pos),this.pos+=a,n+=a,this.pos===o&&(this.process(t,0),this.pos=0)}return this.length+=e.length,this.roundClean(),this}digestInto(e){(0,n.exists)(this),(0,n.output)(e,this),this.finished=!0;let{buffer:t,view:r,blockLen:s,isLE:a}=this,{pos:c}=this;t[c++]=128,this.buffer.subarray(c).fill(0),this.padOffset>s-c&&(this.process(r,0),c=0);for(let e=c;e<s;e++)t[e]=0;o(r,s-8,BigInt(8*this.length),a),this.process(r,0);let u=(0,i.createView)(e),l=this.outputLen;if(l%4)throw Error("_sha2: outputLen should be aligned to 32bit");let d=l/4,f=this.get();if(d>f.length)throw Error("_sha2: outputLen bigger than state");for(let e=0;e<d;e++)u.setUint32(4*e,f[e],a)}digest(){let{buffer:e,outputLen:t}=this;this.digestInto(e);let r=e.slice(0,t);return this.destroy(),r}_cloneInto(e){e||(e=new this.constructor),e.set(...this.get());let{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}}t.SHA2=s},34518:(e,t)=>{"use strict";
1Object.defineProperty(t,"__esModule",{value:!0}),t.crypto=void 0,t.crypto="object"==typeof globalThis&&"crypto"in globalThis?globalThis.crypto:void 0},23236:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.sha224=t.sha256=void 0;let n=r(64636),i=r(54400),o=(e,t,r)=>e&t^~e&r,s=(e,t,r)=>e&t^e&r^t&r,a=new Uint32Array([0x428a2f98,0x71374491,0xb5c0fbcf,0xe9b5dba5,0x3956c25b,0x59f111f1,0x923f82a4,0xab1c5ed5,0xd807aa98,0x12835b01,0x243185be,0x550c7dc3,0x72be5d74,0x80deb1fe,0x9bdc06a7,0xc19bf174,0xe49b69c1,0xefbe4786,0xfc19dc6,0x240ca1cc,0x2de92c6f,0x4a7484aa,0x5cb0a9dc,0x76f988da,0x983e5152,0xa831c66d,0xb00327c8,0xbf597fc7,0xc6e00bf3,0xd5a79147,0x6ca6351,0x14292967,0x27b70a85,0x2e1b2138,0x4d2c6dfc,0x53380d13,0x650a7354,0x766a0abb,0x81c2c92e,0x92722c85,0xa2bfe8a1,0xa81a664b,0xc24b8b70,0xc76c51a3,0xd192e819,0xd6990624,0xf40e3585,0x106aa070,0x19a4c116,0x1e376c08,0x2748774c,0x34b0bcb5,0x391c0cb3,0x4ed8aa4a,0x5b9cca4f,0x682e6ff3,0x748f82ee,0x78a5636f,0x84c87814,0x8cc70208,0x90befffa,0xa4506ceb,0xbef9a3f7,0xc67178f2]),c=new Uint32Array([0x6a09e66
17,0xbb67ae85,0x3c6ef372,0xa54ff53a,0x510e527f,0x9b05688c,0x1f83d9ab,0x5be0cd19]),u=new Uint32Array(64);class l extends n.SHA2{constructor(){super(64,32,8,!1),this.A=0|c[0],this.B=0|c[1],this.C=0|c[2],this.D=0|c[3],this.E=0|c[4],this.F=0|c[5],this.G=0|c[6],this.H=0|c[7]}get(){let{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 r=0;r<16;r++,t+=4)u[r]=e.getUint32(t,!1);for(let e=16;e<64;e++){let t=u[e-15],r=u[e-2],n=(0,i.rotr)(t,7)^(0,i.rotr)(t,18)^t>>>3,o=(0,i.rotr)(r,17)^(0,i.rotr)(r,19)^r>>>10;u[e]=o+u[e-7]+n+u[e-16]|0}let{A:r,B:n,C:c,D:l,E:d,F:f,G:h,H:p}=this;for(let e=0;e<64;e++){let t=p+((0,i.rotr)(d,6)^(0,i.rotr)(d,11)^(0,i.rotr)(d,25))+o(d,f,h)+a[e]+u[e]|0,y=((0,i.rotr)(r,2)^(0,i.rotr)(r,13)^(0,i.rotr)(r,22))+s(r,n,c)|0;p=h,h=f,f=d,d=l+t|0,l=c,c=n,n=r,r=t+y|0}r=r+this.A|0,n=n+this.B|0,c=c+this.C|0,l=l+this.D|0,d=d+this.E|0,f=f+this.F|0,h=h+this.G|0,p=p+this.H|0,this.set(r,n,c,l,d,f,h,p)}roundClean(){u.fill(0)}destroy(){this.set(0,0,0,0,0,0,0,0),this.buffer.fill(0)}}class d extends l{constructor(){super(),this.A=-0x3efa6128,this.B=0x367cd507,this.C=0x3070dd17,this.D=-0x8f1a6c7,this.E=-4191439,this.F=0x68581511,this.G=0x64f98fa7,this.H=-0x4105b05c,this.outputLen=28}}t.sha256=(0,i.wrapConstructor)(()=>new l),t.sha224=(0,i.wrapConstructor)(()=>new d)},54400:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.randomBytes=t.wrapXOFConstructorWithOpts=t.wrapConstructorWithOpts=t.wrapConstructor=t.checkOpts=t.Hash=t.concatBytes=t.toBytes=t.utf8ToBytes=t.asyncLoop=t.nextTick=t.hexToBytes=t.bytesToHex=t.isLE=t.rotr=t.createView=t.u32=t.u8=void 0;let n=r(34518),i=e=>new Uint8Array(e.buffer,e.byteOffset,e.byteLength);t.u8=i;let o=e=>new Uint32Array(e.buffer,e.byteOffset,Math.floor(e.byteLength/4));function s(e){return e instanceof Uint8Array||null!=e&&"object"==typeof e&&"Uint8Array"===e.constructor.name}t.u32=o;let a=e=>new DataView(e.buffer,e.byteOffset,e.byteLength);t.createView=a;let c=(e,t)=>e<<32-t|e>>>t;if(t.rotr=c,t.isLE=68===new Uint8Array(new Uint32Array([0x11223344]).buffer)[0],!t.isLE)throw Error("Non little-endian hardware is not supported");let u=Array.from({length:256},(e,t)=>t.toString(16).padStart(2,"0"));function l(e){if(!s(e))throw Error("Uint8Array expected");let t="";for(let r=0;r<e.length;r++)t+=u[e[r]];return t}t.bytesToHex=l;let d={_0:48,_9:57,_A:65,_F:70,_a:97,_f:102};function f(e){return e>=d._0&&e<=d._9?e-d._0:e>=d._A&&e<=d._F?e-(d._A-10):e>=d._a&&e<=d._f?e-(d._a-10):void 0}function h(e){if("string"!=typeof e)throw Error("hex string expected, got "+typeof e);let t=e.length,r=t/2;if(t%2)throw Error("padded hex string expected, got unpadded hex of length "+t);let n=new Uint8Array(r);for(let t=0,i=0;t<r;t++,i+=2){let r=f(e.charCodeAt(i)),o=f(e.charCodeAt(i+1));if(void 0===r||void 0===o)throw Error('hex string expected, got non-hex character "'+(e[i]+e[i+1])+'" at index '+i);n[t]=16*r+o}return n}t.hexToBytes=h;let p=async()=>{};async function y(e,r,n){let i=Date.now();for(let o=0;o<e;o++){n(o);let e=Date.now()-i;e>=0&&e<r||(await (0,t.nextTick)(),i+=e)}}function g(e){if("string"!=typeof e)throw Error(`utf8ToBytes expected string, got ${typeof e}`);return new Uint8Array(new TextEncoder().encode(e))}function m(e){if("string"==typeof e&&(e=g(e)),!s(e))throw Error(`expected Uint8Array, got ${typeof e}`);return e}function b(...e){let t=0;for(let r=0;r<e.length;r++){let n=e[r];if(!s(n))throw Error("Uint8Array expected");t+=n.length}let r=new Uint8Array(t);for(let t=0,n=0;t<e.length;t++){let i=e[t];r.set(i,n),n+=i.length}return r}t.nextTick=p,t.asyncLoop=y,t.utf8ToBytes=g,t.toBytes=m,t.concatBytes=b;class v{clone(){return this._cloneInto()}}t.Hash=v;let w={}.toString;function _(e,t){if(void 0!==t&&"[object Object]"!==w.call(t))throw Error("Options should be object or undefined");return Object.assign(e,t)}function E(e){let t=t=>e().update(m(t)).digest(),r=e();return t.outputLen=r.outputLen,t.blockLen=r.blockLen,t.create=()=>e(),t}function S(e){let t=(t,r)=>e(r).update(m(t)).digest(),r=e({});return t.outputLen=r.outputLen,t.blockLen=r.blockLen,t.create=t=>e(t),t}function x(e){let t=(t,r)=>e(r).update(m(t)).digest(),r=e({});return t.outputLen=r.outputLen,t.blockLen=r.blockLen,t.create=t=>e(t),t}function A(e=32){if(n.crypto&&"function"==typeof n.crypto.getRandomValues)return n.crypto.getRandomValues(new Uint8Array(e));throw Error("crypto.getRandomValues must be defined")}t.checkOpts=_,t.wrapConstructor=E,t.wrapConstructorWithOpts=S,t.wrapXOFConstructorWithOpts=x,t.randomBytes=A},639:(e,t)=>
1{"use strict";t.__esModule=!0,t.DecodeBuffer=t.EncodeBuffer=void 0;var r=function(){function e(){this.offset=0,this.buffer_size=256,this.buffer=new ArrayBuffer(this.buffer_size),this.view=new DataView(this.buffer)}return e.prototype.resize_if_necessary=function(e){if(this.buffer_size-this.offset<e){this.buffer_size=Math.max(2*this.buffer_size,this.buffer_size+e);var t=new ArrayBuffer(this.buffer_size);new Uint8Array(t).set(new Uint8Array(this.buffer)),this.buffer=t,this.view=new DataView(t)}},e.prototype.get_used_buffer=function(){return new Uint8Array(this.buffer).slice(0,this.offset)},e.prototype.store_value=function(e,t){var r=t.substring(1),n=parseInt(r)/8;this.resize_if_necessary(n);var i="f"===t[0]?"setFloat".concat(r):"i"===t[0]?"setInt".concat(r):"setUint".concat(r);this.view[i](this.offset,e,!0),this.offset+=n},e.prototype.store_bytes=function(e){this.resize_if_necessary(e.length),new Uint8Array(this.buffer).set(new Uint8Array(e),this.offset),this.offset+=e.length},e}();t.EncodeBuffer=r;var n=function(){function e(e){this.offset=0,this.buffer_size=e.length,this.buffer=new ArrayBuffer(e.length),new Uint8Array(this.buffer).set(e),this.view=new DataView(this.buffer)}return e.prototype.assert_enough_buffer=function(e){if(this.offset+e>this.buffer.byteLength)throw Error("Error in schema, the buffer is smaller than expected")},e.prototype.consume_value=function(e){var t=e.substring(1),r=parseInt(t)/8;this.assert_enough_buffer(r);var n="f"===e[0]?"getFloat".concat(t):"i"===e[0]?"getInt".concat(t):"getUint".concat(t),i=this.view[n](this.offset,!0);return this.offset+=r,i},e.prototype.consume_bytes=function(e){this.assert_enough_buffer(e);var t=this.buffer.slice(this.offset,this.offset+e);return this.offset+=e,t},e}();t.DecodeBuffer=n},37692:(e,t,r)=>{"use strict";t.__esModule=!0,t.BorshDeserializer=void 0;var n=r(80058),i=r(639),o=function(){function e(e){this.buffer=new i.DecodeBuffer(e)}return e.prototype.decode=function(e){return this.decode_value(e)},e.prototype.decode_value=function(e){if("string"==typeof e){if(n.integers.includes(e))return this.decode_integer(e);if("string"===e)return this.decode_string();if("bool"===e)return this.decode_boolean()}if("object"==typeof e){if("option"in e)return this.decode_option(e);if("enum"in e)return this.decode_enum(e);if("array"in e)return this.decode_array(e);if("set"in e)return this.decode_set(e);if("map"in e)return this.decode_map(e);if("struct"in e)return this.decode_struct(e)}throw Error("Unsupported type: ".concat(e))},e.prototype.decode_integer=function(e){var t=parseInt(e.substring(1));return t<=32||"f64"==e?this.buffer.consume_value(e):this.decode_bigint(t,e.startsWith("i"))},e.prototype.decode_bigint=function(e,t){void 0===t&&(t=!1);var r=e/8,n=new Uint8Array(this.buffer.consume_bytes(r)),i=n.reduceRight(function(e,t){return e+t.toString(16).padStart(2,"0")},"");return t&&n[r-1]?BigInt.asIntN(e,BigInt("0x".concat(i))):BigInt("0x".concat(i))},e.prototype.decode_string=function(){var e=this.decode_integer("u32"),t=new Uint8Array(this.buffer.consume_bytes(e));return String.fromCharCode.apply(null,t)},e.prototype.decode_boolean=function(){return this.buffer.consume_value("u8")>0},e.prototype.decode_option=function(e){var t=this.buffer.consume_value("u8");if(1===t)return this.decode_value(e.option);if(0!==t)throw Error("Invalid option ".concat(t));return null},e.prototype.decode_enum=function(e){var t,r=this.buffer.consume_value("u8");if(r>e.enum.length)throw Error("Enum option ".concat(r," is not available"));var n=e.enum[r].struct,i=Object.keys(n)[0];return(t={})[i]=this.decode_value(n[i]),t},e.prototype.decode_array=function(e){for(var t=[],r=e.array.len?e.array.len:this.decode_integer("u32"),n=0;n<r;++n)t.push(this.decode_value(e.array.type));return t},e.prototype.decode_set=function(e){for(var t=this.decode_integer("u32"),r=new Set,n=0;n<t;++n)r.add(this.decode_value(e.set));return r},e.prototype.decode_map=function(e){for(var t=this.decode_integer("u32"),r=new Map,n=0;n<t;++n){var i=this.decode_value(e.map.key),o=this.decode_value(e.map.value);r.set(i,o)}return r},e.prototype.decode_struct=function(e){var t={};for(var r in e.struct)t[r]=this.decode_value(e.struct[r]);return t},e}();
1t.BorshDeserializer=o},60175:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);(!i||("get"in i?!t.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),o=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)"default"!==r&&Object.prototype.hasOwnProperty.call(e,r)&&n(t,e,r);return i(t,e),t};t.__esModule=!0,t.deserialize=t.serialize=void 0;var s=r(24537),a=r(37692),c=o(r(87710));function u(e,t,r){return void 0===r&&(r=!0),r&&c.validate_schema(e),new s.BorshSerializer(r).encode(t,e)}function l(e,t,r){return void 0===r&&(r=!0),r&&c.validate_schema(e),new a.BorshDeserializer(t).decode(e)}t.serialize=u,t.deserialize=l},24537:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);(!i||("get"in i?!t.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),o=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)"default"!==r&&Object.prototype.hasOwnProperty.call(e,r)&&n(t,e,r);return i(t,e),t};t.__esModule=!0,t.BorshSerializer=void 0;var s=r(80058),a=r(639),c=o(r(87710)),u=function(){function e(e){this.encoded=new a.EncodeBuffer,this.fieldPath=["value"],this.checkTypes=e}return e.prototype.encode=function(e,t){return this.encode_value(e,t),this.encoded.get_used_buffer()},e.prototype.encode_value=function(e,t){if("string"==typeof t){if(s.integers.includes(t))return this.encode_integer(e,t);if("string"===t)return this.encode_string(e);if("bool"===t)return this.encode_boolean(e)}if("object"==typeof t){if("option"in t)return this.encode_option(e,t);if("enum"in t)return this.encode_enum(e,t);if("array"in t)return this.encode_array(e,t);if("set"in t)return this.encode_set(e,t);if("map"in t)return this.encode_map(e,t);if("struct"in t)return this.encode_struct(e,t)}},e.prototype.encode_integer=function(e,t){var r=parseInt(t.substring(1));r<=32||"f64"==t?(this.checkTypes&&c.expect_type(e,"number",this.fieldPath),this.encoded.store_value(e,t)):(this.checkTypes&&c.expect_bigint(e,this.fieldPath),this.encode_bigint(BigInt(e),r))},e.prototype.encode_bigint=function(e,t){for(var r=t/8,n=new Uint8Array(r),i=0;i<r;i++)n[i]=Number(e&BigInt(255)),e>>=BigInt(8);this.encoded.store_bytes(new Uint8Array(n))},e.prototype.encode_string=function(e){this.checkTypes&&c.expect_type(e,"string",this.fieldPath);var t=e;this.encoded.store_value(t.length,"u32");for(var r=0;r<t.length;r++)this.encoded.store_value(t.charCodeAt(r),"u8")},e.prototype.encode_boolean=function(e){this.checkTypes&&c.expect_type(e,"boolean",this.fieldPath),this.encoded.store_value(e?1:0,"u8")},e.prototype.encode_option=function(e,t){null==e?this.encoded.store_value(0,"u8"):(this.encoded.store_value(1,"u8"),this.encode_value(e,t.option))},e.prototype.encode_enum=function(e,t){this.checkTypes&&c.expect_enum(e,this.fieldPath);for(var r=Object.keys(e)[0],n=0;n<t.enum.length;n++){var i=t.enum[n];if(r===Object.keys(i.struct)[0])return this.encoded.store_value(n,"u8"),this.encode_struct(e,i)}throw Error("Enum key (".concat(r,") not found in enum schema: ").concat(JSON.stringify(t)," at ").concat(this.fieldPath.join(".")))},e.prototype.encode_array=function(e,t){if(c.isArrayLike(e))return this.encode_arraylike(e,t);if(e instanceof ArrayBuffer)return this.encode_buffer(e,t);throw Error("Expected Array-like not ".concat(typeof e,"(").concat(e,") at ").concat(this.fieldPath.join(".")))},e.prototype.encode_arraylike=function(e,t){t.array.len?c.expect_same_size(e.length,t.array.len,this.fieldPath):this.encoded.store_value(e.length,"u32");for(var r=0;r<e.length;r++)this.encode_value(e[r],t.array.type)},e.prototype.encode_buffer=function(e,t){t.array.len?c.expect_same_size(e.byteLength,t.array.len,this.fieldPath):this.encoded.store_value(e.byteLength,"u32"),this.encoded.store_bytes(new Uint8Array(e))},e.prototype.encode_set=function(e,t){this.checkTypes&&c.expect_type(e,"object",this.fieldPath);var r=e instanceof Set?Array.from(e.values()):Object.values(e);this.encoded.store_value(r.length,"u32");for(var n=0,i=r;n<i.length;n++){var o=i[n];this.encode_value(o,t.set)}},e.prototype.encode_map=function(e,t){this.checkTypes&&c.expect_type(e,"object",this.fieldPath);var r=e instanceof Map,n=r?Array.from(e.keys()):Object.keys(e);this.encoded.store_value(n.length,"u32");for(var i=0,o=n;i<o.length;i++){var s=o[i];this.encode_value(s,t.map.key),this.encode_value(r?e.get(s):e[s],t.map.value)}},e.prototype.encode_struct=function(e,t){this.checkTypes&&c.expect_type(e,"object",this.fieldPath);for(var r=0,n=Object.keys(t.struct);r<n.length;r++){var i=n[r];this.fieldPath.push(i),this.encode_value(e[i],t.struct[i]),this.fieldPath.pop()}},e}();
1t.BorshSerializer=u},80058:(e,t)=>{"use strict";t.__esModule=!0,t.integers=void 0,t.integers=["u8","u16","u32","u64","u128","i8","i16","i32","i64","i128","f32","f64"]},87710:function(e,t,r){"use strict";var n=this&&this.__extends||function(){var e=function(t,r){return(e=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])})(t,r)};return function(t,r){if("function"!=typeof r&&null!==r)throw TypeError("Class extends value "+String(r)+" is not a constructor or null");function n(){this.constructor=t}e(t,r),t.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}();t.__esModule=!0,t.validate_schema=t.ErrorSchema=t.expect_enum=t.expect_same_size=t.expect_bigint=t.expect_type=t.isArrayLike=void 0;var i=r(80058);function o(e){return Array.isArray(e)||!!e&&"object"==typeof e&&"length"in e&&"number"==typeof e.length&&(0===e.length||e.length>0&&e.length-1 in e)}function s(e,t,r){if(typeof e!==t)throw Error("Expected ".concat(t," not ").concat(typeof e,"(").concat(e,") at ").concat(r.join(".")))}function a(e,t){var r=["number","string","bigint","boolean"].includes(typeof e),n="object"==typeof e&&null!==e&&"toString"in e;if(!r&&!n)throw Error("Expected bigint, number, boolean or string not ".concat(typeof e,"(").concat(e,") at ").concat(t.join(".")))}function c(e,t,r){if(e!==t)throw Error("Array length ".concat(e," does not match schema length ").concat(t," at ").concat(r.join(".")))}function u(e,t){if("object"!=typeof e||null===e)throw Error("Expected object not ".concat(typeof e,"(").concat(e,") at ").concat(t.join(".")))}t.isArrayLike=o,t.expect_type=s,t.expect_bigint=a,t.expect_same_size=c,t.expect_enum=u;var l=i.integers.concat(["bool","string"]),d=["option","enum","array","set","map","struct"],f=function(e){function t(t,r){var n="Invalid schema: ".concat(JSON.stringify(t)," expected ").concat(r);return e.call(this,n)||this}return n(t,e),t}(Error);function h(e){if(!("string"==typeof e&&l.includes(e))){if(e&&"object"==typeof e){var t=Object.keys(e);if(1===t.length&&d.includes(t[0])){var r=t[0];if("option"===r)return h(e[r]);if("enum"===r)return p(e[r]);if("array"===r)return y(e[r]);if("set"===r)return h(e[r]);if("map"===r)return g(e[r]);if("struct"===r)return m(e[r])}}throw new f(e,d.join(", ")+" or "+l.join(", "))}}function p(e){if(!Array.isArray(e))throw new f(e,"Array");for(var t=0,r=e;t<r.length;t++){var n=r[t];if("object"!=typeof n||!("struct"in n))throw Error('Missing "struct" key in enum schema');if("object"!=typeof n.struct||1!==Object.keys(n.struct).length)throw Error('The "struct" in each enum must have a single key');h({struct:n.struct})}}function y(e){if("object"!=typeof e)throw new f(e,"{ type, len? }");if(e.len&&"number"!=typeof e.len)throw Error("Invalid schema: ".concat(e));if("type"in e)return h(e.type);throw new f(e,"{ type, len? }")}function g(e){if("object"==typeof e&&"key"in e&&"value"in e)h(e.key),h(e.value);else throw new f(e,"{ key, value }")}function m(e){if("object"!=typeof e)throw new f(e,"object");for(var t in e)h(e[t])}t.ErrorSchema=f,t.validate_schema=h},87653:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Assignable=void 0;class r{constructor(e){Object.keys(e).map(t=>{this[t]=e[t]})}}t.Assignable=r},90087:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ErrorContext=t.TypedError=t.ArgumentTypeError=t.PositionalArgsError=void 0;class r extends Error{constructor(){super("Contract method calls expect named arguments wrapped in object, e.g. { argName1: argValue1, argName2: argValue2 }")}}t.PositionalArgsError=r;class n extends Error{constructor(e,t,r){super(`Expected ${t} for '${e}' argument, but got '${JSON.stringify(r)}'`)}}t.ArgumentTypeError=n;class i extends Error{constructor(e,t,r){super(e),this.type=t||"UntypedError",this.context=r}}t.TypedError=i;class o{constructor(e){this.transactionHash=e}}t.ErrorContext=o},42896:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);
1(!i||("get"in i?!t.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),i(r(87653),t),i(r(90087),t),i(r(10514),t)},10514:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.FinalExecutionStatusBasic=t.ExecutionStatusBasic=t.IdType=void 0;var n=r(76636);Object.defineProperty(t,"IdType",{enumerable:!0,get:function(){return n.IdType}});var i=r(47133);Object.defineProperty(t,"ExecutionStatusBasic",{enumerable:!0,get:function(){return i.ExecutionStatusBasic}}),Object.defineProperty(t,"FinalExecutionStatusBasic",{enumerable:!0,get:function(){return i.FinalExecutionStatusBasic}})},76636:(e,t)=>{"use strict";var r;Object.defineProperty(t,"__esModule",{value:!0}),t.IdType=void 0,function(e){e.Transaction="transaction",e.Receipt="receipt"}(r=t.IdType||(t.IdType={}))},47133:(e,t)=>{"use strict";var r,n;Object.defineProperty(t,"__esModule",{value:!0}),t.FinalExecutionStatusBasic=t.ExecutionStatusBasic=void 0,function(e){e.Unknown="Unknown",e.Pending="Pending",e.Failure="Failure"}(r=t.ExecutionStatusBasic||(t.ExecutionStatusBasic={})),function(e){e.NotStarted="NotStarted",e.Started="Started",e.Failure="Failure"}(n=t.FinalExecutionStatusBasic||(t.FinalExecutionStatusBasic={}))},28797:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.DEFAULT_FUNCTION_CALL_GAS=void 0,t.DEFAULT_FUNCTION_CALL_GAS=BigInt("30000000000000")},56671:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.logWarning=void 0;let n=r(14831);function i(...e){let[t,...r]=e;n.Logger.warn(t,...r)}t.logWarning=i},74072:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.parseRpcError=t.parseResultError=t.getErrorTypeFromErrorMessage=t.formatError=t.ServerError=t.logWarning=void 0;var n=r(56671);Object.defineProperty(t,"logWarning",{enumerable:!0,get:function(){return n.logWarning}});var i=r(99839);Object.defineProperty(t,"ServerError",{enumerable:!0,get:function(){return i.ServerError}}),Object.defineProperty(t,"formatError",{enumerable:!0,get:function(){return i.formatError}}),Object.defineProperty(t,"getErrorTypeFromErrorMessage",{enumerable:!0,get:function(){return i.getErrorTypeFromErrorMessage}}),Object.defineProperty(t,"parseResultError",{enumerable:!0,get:function(){return i.parseResultError}}),Object.defineProperty(t,"parseRpcError",{enumerable:!0,get:function(){return i.parseRpcError}})},99839:function(e,t,r){"use strict";var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.getErrorTypeFromErrorMessage=t.formatError=t.parseResultError=t.parseRpcError=t.ServerError=void 0;let i=r(42896),o=n(r(2139)),s=r(22220),a=n(r(51539)),c=n(r(60332)),u={formatNear:()=>(e,t)=>(0,s.formatNearAmount)(t(e))};class l extends i.TypedError{}t.ServerError=l;class d extends l{}function f(e){let t={},r=y(e,c.default.schema,t,""),n=new l(p(r,t),r);return Object.assign(n,t),n}function h(e){let t=f(e.status.Failure),r=new d;return Object.assign(r,t),r.type=t.type,r.message=t.message,r.transaction_outcome=e.transaction_outcome,r}function p(e,t){return"string"==typeof a.default[e]?o.default.render(a.default[e],Object.assign(Object.assign({},t),u)):JSON.stringify(t)}function y(e,t,r,n){let i,o,s;for(let r in t){if(b(e[r]))return e[r];if(m(e[r]))i=e[r],o=t[r],s=r;else{if(!(m(e.kind)&&m(e.kind[r])))continue;i=e.kind[r],o=t[r],s=r}}if(!i||!o)return r.kind=e,n;for(let e of Object.keys(o.props))r[e]=i[e];return y(i,t,r,s)}function g(e,t){switch(!0){case/^account .*? does not exist while viewing$/.test(e):case/^Account .*? doesn't exist$/.test(e):return"AccountDoesNotExist";case/^access key .*? does not exist while viewing$/.test(e):return"AccessKeyDoesNotExist";case/wasm execution failed with error: FunctionCallError\(CompilationError\(CodeDoesNotExist/.test(e):case/wasm execution failed with error: CompilationError\(CodeDoesNotExist/.test(e):return"CodeDoesNotExist";case/wasm execution failed with error: FunctionCallError\(MethodResolveError\(MethodNotFound/.test(e):case/wasm execution failed with error: MethodResolveError\(MethodNotFound/.test(e):return"MethodNotFound";case/Transaction nonce \d+ must be larger than nonce of the used access key \d+/.test(e):return"InvalidNonce";default:return t}}function m(e){return"[object Object]"===Object.prototype.toString.call(e)}function b(e){return"[object String]"===Object.prototype.toString.call(e)}t.parseRpcError=f,t.parseResultError=h,t.formatError=p,t.getErrorTypeFromErrorMessage=g},22220:function(e,t,r){"use strict";var n=this&&this.__importDefault||function(e){return e&&e.__esMo
1dule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.baseDecode=t.baseEncode=t.parseNearAmount=t.formatNearAmount=t.NEAR_NOMINATION=t.NEAR_NOMINATION_EXP=void 0;let i=n(r(89631));t.NEAR_NOMINATION_EXP=24,t.NEAR_NOMINATION=BigInt(10)**BigInt(t.NEAR_NOMINATION_EXP);let o=[],s=BigInt(10);for(let e=0,r=BigInt(5);e<t.NEAR_NOMINATION_EXP;e++,r*=s)o[e]=r;function a(e,r=t.NEAR_NOMINATION_EXP){let n=BigInt(e);if(r!==t.NEAR_NOMINATION_EXP){let e=t.NEAR_NOMINATION_EXP-r-1;e>0&&(n+=o[e])}let i=(e=n.toString()).substring(0,e.length-t.NEAR_NOMINATION_EXP)||"0",s=e.substring(e.length-t.NEAR_NOMINATION_EXP).padStart(t.NEAR_NOMINATION_EXP,"0").substring(0,r);return l(`${f(i)}.${s}`)}function c(e){if(!e)return null;let r=(e=u(e)).split("."),n=r[0],i=r[1]||"";if(r.length>2||i.length>t.NEAR_NOMINATION_EXP)throw Error(`Cannot parse '${e}' as NEAR amount`);return d(n+i.padEnd(t.NEAR_NOMINATION_EXP,"0"))}function u(e){return e.replace(/,/g,"").trim()}function l(e){return e.replace(/\.?0*$/,"")}function d(e){return""===(e=e.replace(/^0+/,""))?"0":e}function f(e){let t=/(-?\d+)(\d{3})/;for(;t.test(e);)e=e.replace(t,"$1,$2");return e}function h(e){if("string"==typeof e){let t=[];for(let r=0;r<e.length;r++)t.push(e.charCodeAt(r));e=new Uint8Array(t)}return i.default.encode(e)}function p(e){return new Uint8Array(i.default.decode(e))}t.formatNearAmount=a,t.parseNearAmount=c,t.baseEncode=h,t.baseDecode=p},17236:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);(!i||("get"in i?!t.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),i(r(28797),t),i(r(74072),t),i(r(22220),t),i(r(8421),t),i(r(31105),t),i(r(92375),t),i(r(14831),t),i(r(61793),t)},39068:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ConsoleLogger=void 0;class r{constructor(e){this.logLevels=e,this.isLevelEnabled=e=>this.logLevels.includes(e)}print(e,t,...r){switch(e){case"error":case"fatal":return console.error(t,...r);case"warn":return console.warn(t,...r);case"log":return console.log(t,...r);case"debug":case"verbose":return console.debug(t,...r)}}verbose(e,...t){this.isLevelEnabled("verbose")&&this.print("verbose",e,...t)}debug(e,...t){this.isLevelEnabled("debug")&&this.print("debug",e,...t)}log(e,...t){this.isLevelEnabled("log")&&this.print("log",e,...t)}warn(e,...t){this.isLevelEnabled("warn")&&this.print("warn",e,...t)}error(e,...t){this.isLevelEnabled("error")&&this.print("error",e,...t)}fatal(e,...t){this.isLevelEnabled("fatal")&&this.print("fatal",e,...t)}}t.ConsoleLogger=r},14831:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Logger=void 0;var n=r(95253);Object.defineProperty(t,"Logger",{enumerable:!0,get:function(){return n.Logger}})},95253:(e,t,r)=>{"use strict";var n,i=r(2818);Object.defineProperty(t,"__esModule",{value:!0}),t.Logger=void 0;let o=r(39068),s=["verbose","debug","log","warn","error","fatal"],a="object"==typeof i&&i.env.NEAR_NO_LOGS?void 0:new o.ConsoleLogger(s);class c{static error(e,...t){var r;null===(r=this.instanceRef)||void 0===r||r.error(e,...t)}static log(e,...t){var r;null===(r=this.instanceRef)||void 0===r||r.log(e,...t)}static warn(e,...t){var r;null===(r=this.instanceRef)||void 0===r||r.warn(e,...t)}static debug(e,...t){var r,n;null===(n=null===(r=this.instanceRef)||void 0===r?void 0:r.debug)||void 0===n||n.call(r,e,...t)}static verbose(e,...t){var r,n;null===(n=null===(r=this.instanceRef)||void 0===r?void 0:r.verbose)||void 0===n||n.call(r,e,...t)}static fatal(e,...t){var r,n;null===(n=null===(r=this.instanceRef)||void 0===r?void 0:r.fatal)||void 0===n||n.call(r,e,...t)}}t.Logger=c,n=c,c.instanceRef=a,c.overrideLogger=e=>{n.instanceRef=e}},8421:(e,t,r)=>{"use strict";
1Object.defineProperty(t,"__esModule",{value:!0}),t.printTxOutcomeLogs=t.printTxOutcomeLogsAndFailures=void 0;let n=r(74072),i=r(14831);function o({contractId:e,outcome:t}){for(let r of[t.transaction_outcome,...t.receipts_outcome].reduce((e,t)=>{let r="object"==typeof t.outcome.status&&"object"==typeof t.outcome.status.Failure;return t.outcome.logs.length||r?e.concat({receiptIds:t.outcome.receipt_ids,logs:t.outcome.logs,failure:"object"==typeof t.outcome.status&&void 0!==t.outcome.status.Failure?(0,n.parseRpcError)(t.outcome.status.Failure):null}):e},[]))i.Logger.log(`Receipt${r.receiptIds.length>1?"s":""}: ${r.receiptIds.join(", ")}`),s({contractId:e,logs:r.logs,prefix:" "}),r.failure&&i.Logger.warn(` Failure [${e}]: ${r.failure}`)}function s({contractId:e,logs:t,prefix:r=""}){for(let n of t)i.Logger.log(`${r}Log [${e}]: ${n}`)}t.printTxOutcomeLogsAndFailures=o,t.printTxOutcomeLogs=s},31105:(e,t,r)=>{"use strict";var n=r(75927).Buffer;function i(e){if("object"==typeof e.status&&"string"==typeof e.status.SuccessValue){let t=n.from(e.status.SuccessValue,"base64").toString();try{return JSON.parse(t)}catch(e){return t}}return null}Object.defineProperty(t,"__esModule",{value:!0}),t.getTransactionLastResult=void 0,t.getTransactionLastResult=i},61793:(e,t)=>{"use strict";function r(e,t){return e<t?-1:e>t?1:0}Object.defineProperty(t,"__esModule",{value:!0}),t.sortBigIntAsc=void 0,t.sortBigIntAsc=r},92375:function(e,t,r){"use strict";var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.diffEpochValidators=t.findSeatPrice=void 0;let i=n(r(29905)),o=r(61793);function s(e,t,r,n){return n&&n<49?a(e,t):(r||((0,i.default)("findSeatPrice(validators, maxNumberOfSeats)")("`use `findSeatPrice(validators, maxNumberOfSeats, minimumStakeRatio)` instead"),r=[1,6250]),c(e,t,r))}function a(e,t){let r=e.map(e=>BigInt(e.stake)).sort(o.sortBigIntAsc),n=BigInt(t),i=r.reduce((e,t)=>e+t);if(i<n)throw Error("Stakes are below seats");let s=BigInt(1),a=i+BigInt(1);for(;s!==a-BigInt(1);){let e=(s+a)/BigInt(2),t=!1,i=BigInt(0);for(let o=0;o<r.length;++o)if((i+=r[o]/e)>=n){s=e,t=!0;break}t||(a=e)}return s}function c(e,t,r){if(2!=r.length)throw Error("minimumStakeRatio should have 2 elements");let n=e.map(e=>BigInt(e.stake)).sort(o.sortBigIntAsc),i=n.reduce((e,t)=>e+t);return e.length<t?i*BigInt(r[0])/BigInt(r[1]):n[0]+BigInt(1)}function u(e,t){let r=new Map;e.forEach(e=>r.set(e.account_id,e));let n=new Set(t.map(e=>e.account_id));return{newValidators:t.filter(e=>!r.has(e.account_id)),removedValidators:e.filter(e=>!n.has(e.account_id)),changedValidators:t.filter(e=>r.has(e.account_id)&&r.get(e.account_id).stake!=e.stake).map(e=>({current:r.get(e.account_id),next:e}))}}t.findSeatPrice=s,t.diffEpochValidators=u},87184:(e,t)=>{"use strict";function r(e){if(!Number.isSafeInteger(e)||e<0)throw Error("positive integer expected, got "+e)}function n(e){return e instanceof Uint8Array||ArrayBuffer.isView(e)&&"Uint8Array"===e.constructor.name}function i(e,...t){if(!n(e))throw Error("Uint8Array expected");if(t.length>0&&!t.includes(e.length))throw Error("Uint8Array expected of length "+t+", got length="+e.length)}function o(e){if("function"!=typeof e||"function"!=typeof e.create)throw Error("Hash should be wrapped by utils.wrapConstructor");r(e.outputLen),r(e.blockLen)}function s(e,t=!0){if(e.destroyed)throw Error("Hash instance has been destroyed");if(t&&e.finished)throw Error("Hash#digest() has already been called")}function a(e,t){i(e);let r=t.outputLen;if(e.length<r)throw Error("digestInto() expects output buffer of length at least "+r)}Object.defineProperty(t,"__esModule",{value:!0}),t.anumber=r,t.abytes=i,t.ahash=o,t.aexists=s,t.aoutput=a},28655:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.HashMD=void 0,t.setBigUint64=o,t.Chi=s,t.Maj=a;let n=r(87184),i=r(36690);function o(e,t,r,n){if("function"==typeof e.setBigUint64)return e.setBigUint64(t,r,n);let i=BigInt(32),o=BigInt(0xffffffff),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)}function s(e,t,r){return e&t^~e&r}function a(e,t,r){return e&t^e&r^t&r}class c extends i.Hash{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=(0,i.createView)(this.buffer)}update(e){(0,n.aexists)(this);let{view:t,buffer:r,blockLen:o}=this,s=(e=(0,i.toBytes)(e)).length;for(let n=0;n<s;){let a=Math.min(o-this.pos,s-n);if(a===o){let t=(0,i.createView)(e);for(;o<=s-n;n+=o)this.process(t,n);continue}r.set(e.subarray(n,n+a),this.pos),this.pos+=a,n+=a,this.pos===o&&(this.process(t,0),this.pos=0)}return this.length+=e.length,this.roundClean(),this}digestInto(e){(0,n.aexists)(this),(0,n.aoutput)(e,this),this.finished=!0;let{buffer:t,view:r,blockLen:s,isLE:a}=this,{pos:c}=this;t[c++]=128,this.buffer.subarray(c).fill(0),this.padOffset>s-c&&(this.process(r,0),c=0);for(let e=c;e<s;e++)t[e]=0;o(r,s-8,BigInt(8*this.length),a),this.process(r,0);let u=(0,i.createView)(e),l=this.outputLen;if(l%4)throw Error("_sha2: outputLen should be aligned to 32bit");let d=l/4,f=this.get();if(d>f.length)throw Error("_sha2: outputLen bigger than state");for(let e=0;e<d;e++)u.setUint32(4*e,f[e],a)}digest(){let{buffer:e,outputLen:t}=this;this.digestInto(e);let r=e.slice(0,t);return this.destroy(),r}_cloneInto(e){e||(e=new this.constructor),e.set(...this.get());let{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}}t.HashMD=c},50852:(e,t)=>
1{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.crypto=void 0,t.crypto="object"==typeof globalThis&&"crypto"in globalThis?globalThis.crypto:void 0},94986:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.sha224=t.sha256=t.SHA256=void 0;let n=r(28655),i=r(36690),o=new Uint32Array([0x428a2f98,0x71374491,0xb5c0fbcf,0xe9b5dba5,0x3956c25b,0x59f111f1,0x923f82a4,0xab1c5ed5,0xd807aa98,0x12835b01,0x243185be,0x550c7dc3,0x72be5d74,0x80deb1fe,0x9bdc06a7,0xc19bf174,0xe49b69c1,0xefbe4786,0xfc19dc6,0x240ca1cc,0x2de92c6f,0x4a7484aa,0x5cb0a9dc,0x76f988da,0x983e5152,0xa831c66d,0xb00327c8,0xbf597fc7,0xc6e00bf3,0xd5a79147,0x6ca6351,0x14292967,0x27b70a85,0x2e1b2138,0x4d2c6dfc,0x53380d13,0x650a7354,0x766a0abb,0x81c2c92e,0x92722c85,0xa2bfe8a1,0xa81a664b,0xc24b8b70,0xc76c51a3,0xd192e819,0xd6990624,0xf40e3585,0x106aa070,0x19a4c116,0x1e376c08,0x2748774c,0x34b0bcb5,0x391c0cb3,0x4ed8aa4a,0x5b9cca4f,0x682e6ff3,0x748f82ee,0x78a5636f,0x84c87814,0x8cc70208,0x90befffa,0xa4506ceb,0xbef9a3f7,0xc67178f2]),s=new Uint32Array([0x6a09e66
17,0xbb67ae85,0x3c6ef372,0xa54ff53a,0x510e527f,0x9b05688c,0x1f83d9ab,0x5be0cd19]),a=new Uint32Array(64);class c extends n.HashMD{constructor(){super(64,32,8,!1),this.A=0|s[0],this.B=0|s[1],this.C=0|s[2],this.D=0|s[3],this.E=0|s[4],this.F=0|s[5],this.G=0|s[6],this.H=0|s[7]}get(){let{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 r=0;r<16;r++,t+=4)a[r]=e.getUint32(t,!1);for(let e=16;e<64;e++){let t=a[e-15],r=a[e-2],n=(0,i.rotr)(t,7)^(0,i.rotr)(t,18)^t>>>3,o=(0,i.rotr)(r,17)^(0,i.rotr)(r,19)^r>>>10;a[e]=o+a[e-7]+n+a[e-16]|0}let{A:r,B:s,C:c,D:u,E:l,F:d,G:f,H:h}=this;for(let e=0;e<64;e++){let t=h+((0,i.rotr)(l,6)^(0,i.rotr)(l,11)^(0,i.rotr)(l,25))+(0,n.Chi)(l,d,f)+o[e]+a[e]|0,p=((0,i.rotr)(r,2)^(0,i.rotr)(r,13)^(0,i.rotr)(r,22))+(0,n.Maj)(r,s,c)|0;h=f,f=d,d=l,l=u+t|0,u=c,c=s,s=r,r=t+p|0}r=r+this.A|0,s=s+this.B|0,c=c+this.C|0,u=u+this.D|0,l=l+this.E|0,d=d+this.F|0,f=f+this.G|0,h=h+this.H|0,this.set(r,s,c,u,l,d,f,h)}roundClean(){a.fill(0)}destroy(){this.set(0,0,0,0,0,0,0,0),this.buffer.fill(0)}}t.SHA256=c;class u extends c{constructor(){super(),this.A=-0x3efa6128,this.B=0x367cd507,this.C=0x3070dd17,this.D=-0x8f1a6c7,this.E=-4191439,this.F=0x68581511,this.G=0x64f98fa7,this.H=-0x4105b05c,this.outputLen=28}}t.sha256=(0,i.wrapConstructor)(()=>new c),t.sha224=(0,i.wrapConstructor)(()=>new u)},36690:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Hash=t.nextTick=t.byteSwapIfBE=t.isLE=void 0,t.isBytes=o,t.u8=s,t.u32=a,t.createView=c,t.rotr=u,t.rotl=l,t.byteSwap=d,t.byteSwap32=f,t.bytesToHex=p,t.hexToBytes=m,t.asyncLoop=v,t.utf8ToBytes=w,t.toBytes=_,t.concatBytes=E,t.checkOpts=x,t.wrapConstructor=A,t.wrapConstructorWithOpts=I,t.wrapXOFConstructorWithOpts=O,t.randomBytes=T;let n=r(50852),i=r(87184);function o(e){return e instanceof Uint8Array||ArrayBuffer.isView(e)&&"Uint8Array"===e.constructor.name}function s(e){return new Uint8Array(e.buffer,e.byteOffset,e.byteLength)}function a(e){return new Uint32Array(e.buffer,e.byteOffset,Math.floor(e.byteLength/4))}function c(e){return new DataView(e.buffer,e.byteOffset,e.byteLength)}function u(e,t){return e<<32-t|e>>>t}function l(e,t){return e<<t|e>>>32-t>>>0}function d(e){return e<<24&0xff000000|e<<8&0xff0000|e>>>8&65280|e>>>24&255}function f(e){for(let t=0;t<e.length;t++)e[t]=d(e[t])}t.isLE=68===new Uint8Array(new Uint32Array([0x11223344]).buffer)[0],t.byteSwapIfBE=t.isLE?e=>e:e=>d(e);let h=Array.from({length:256},(e,t)=>t.toString(16).padStart(2,"0"));function p(e){(0,i.abytes)(e);let t="";for(let r=0;r<e.length;r++)t+=h[e[r]];return t}let y={_0:48,_9:57,A:65,F:70,a:97,f:102};function g(e){return e>=y._0&&e<=y._9?e-y._0:e>=y.A&&e<=y.F?e-(y.A-10):e>=y.a&&e<=y.f?e-(y.a-10):void 0}function m(e){if("string"!=typeof e)throw Error("hex string expected, got "+typeof e);let t=e.length,r=t/2;if(t%2)throw Error("hex string expected, got unpadded hex of length "+t);let n=new Uint8Array(r);for(let t=0,i=0;t<r;t++,i+=2){let r=g(e.charCodeAt(i)),o=g(e.charCodeAt(i+1));if(void 0===r||void 0===o)throw Error('hex string expected, got non-hex character "'+(e[i]+e[i+1])+'" at index '+i);n[t]=16*r+o}return n}let b=async()=>{};async function v(e,r,n){let i=Date.now();for(let o=0;o<e;o++){n(o);let e=Date.now()-i;e>=0&&e<r||(await (0,t.nextTick)(),i+=e)}}function w(e){if("string"!=typeof e)throw Error("utf8ToBytes expected string, got "+typeof e);return new Uint8Array(new TextEncoder().encode(e))}function _(e){return"string"==typeof e&&(e=w(e)),(0,i.abytes)(e),e}function E(...e){let t=0;for(let r=0;r<e.length;r++){let n=e[r];(0,i.abytes)(n),t+=n.length}let r=new Uint8Array(t);for(let t=0,n=0;t<e.length;t++){let i=e[t];r.set(i,n),n+=i.length}return r}t.nextTick=b;class S{clone(){return this._cloneInto()}}function x(e,t){if(void 0!==t&&"[object Object]"!==({}).toString.call(t))throw Error("Options should be object or undefined");return Object.assign(e,t)}function A(e){let t=t=>e().update(_(t)).digest(),r=e();return t.outputLen=r.outputLen,t.blockLen=r.blockLen,t.create=()=>e(),t}function I(e){let t=(t,r)=>e(r).update(_(t)).digest(),r=e({});return t.outputLen=r.outputLen,t.blockLen=r.blockLen,t.create=t=>e(t),t}function O(e){let t=(t,r)=>e(r).update(_(t)).digest(),r=e({});return t.outputLen=r.outputLen,t.blockLen=r.blockLen,t.create=t=>e(t),t}function T(e=32){if(n.crypto&&"function"==typeof n.crypto.getRandomValues)return n.crypto.getRandomValues(new Uint8Array(e));if(n.crypto&&"function"==typeof n.crypto.randomBytes)return n.crypto.randomBytes(e);throw Error("crypto.getRandomValues must be defined")}t.Hash=S},11341:(e,t,r)=>{var n,i=r(2818);!function(){"use strict";
1var t="input is invalid type",o="object"==typeof window,s=o?window:{};s.JS_SHA256_NO_WINDOW&&(o=!1);var a=!o&&"object"==typeof self,c=!s.JS_SHA256_NO_NODE_JS&&"object"==typeof i&&i.versions&&i.versions.node&&"renderer"!=i.type;c?s=r.g:a&&(s=self);var u=!s.JS_SHA256_NO_COMMON_JS&&e.exports,l=r.amdO,d=!s.JS_SHA256_NO_ARRAY_BUFFER&&"undefined"!=typeof ArrayBuffer,f="0123456789abcdef".split(""),h=[-0x80000000,8388608,32768,128],p=[24,16,8,0],y=[0x428a2f98,0x71374491,0xb5c0fbcf,0xe9b5dba5,0x3956c25b,0x59f111f1,0x923f82a4,0xab1c5ed5,0xd807aa98,0x12835b01,0x243185be,0x550c7dc3,0x72be5d74,0x80deb1fe,0x9bdc06a7,0xc19bf174,0xe49b69c1,0xefbe4786,0xfc19dc6,0x240ca1cc,0x2de92c6f,0x4a7484aa,0x5cb0a9dc,0x76f988da,0x983e5152,0xa831c66d,0xb00327c8,0xbf597fc7,0xc6e00bf3,0xd5a79147,0x6ca6351,0x14292967,0x27b70a85,0x2e1b2138,0x4d2c6dfc,0x53380d13,0x650a7354,0x766a0abb,0x81c2c92e,0x92722c85,0xa2bfe8a1,0xa81a664b,0xc24b8b70,0xc76c51a3,0xd192e819,0xd6990624,0xf40e3585,0x106aa070,0x19a4c116,0x1e376c08,0x2748774c,0x34b0bcb5,0x391c0cb3,0x4ed8aa4a,0x5b9cca4f,0x682e6ff3,0x748f82ee,0x78a5636f,0x84c87814,0x8cc70208,0x90befffa,0xa4506ceb,0xbef9a3f7,0xc67178f2],g=["hex","array","digest","arrayBuffer"],m=[];(s.JS_SHA256_NO_NODE_JS||!Array.isArray)&&(Array.isArray=function(e){return"[object Array]"===Object.prototype.toString.call(e)}),d&&(s.JS_SHA256_NO_ARRAY_BUFFER_IS_VIEW||!ArrayBuffer.isView)&&(ArrayBuffer.isView=function(e){return"object"==typeof e&&e.buffer&&e.buffer.constructor===ArrayBuffer});var b=function(e,t){return function(r){return new S(t,!0).update(r)[e]()}},v=function(e){var t=b("hex",e);c&&(t=w(t,e)),t.create=function(){return new S(e)},t.update=function(e){return t.create().update(e)};for(var r=0;r<g.length;++r){var n=g[r];t[n]=b(n,e)}return t},w=function(e,n){var i,o=r(81947),a=r(44774).Buffer,c=n?"sha224":"sha256";return i=a.from&&!s.JS_SHA256_NO_BUFFER_FROM?a.from:function(e){return new a(e)},function(r){if("string"==typeof r)return o.createHash(c).update(r,"utf8").digest("hex");if(null==r)throw Error(t);return r.constructor===ArrayBuffer&&(r=new Uint8Array(r)),Array.isArray(r)||ArrayBuffer.isView(r)||r.constructor===a?o.createHash(c).update(i(r)).digest("hex"):e(r)}},_=function(e,t){return function(r,n){return new x(r,t,!0).update(n)[e]()}},E=function(e){var t=_("hex",e);t.create=function(t){return new x(t,e)},t.update=function(e,r){return t.create(e).update(r)};for(var r=0;r<g.length;++r){var n=g[r];t[n]=_(n,e)}return t};function S(e,t){t?(m[0]=m[16]=m[1]=m[2]=m[3]=m[4]=m[5]=m[6]=m[7]=m[8]=m[9]=m[10]=m[11]=m[12]=m[13]=m[14]=m[15]=0,this.blocks=m):this.blocks=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],e?(this.h0=0xc1059ed8,this.h1=0x367cd507,this.h2=0x3070dd17,this.h3=0xf70e5939,this.h4=0xffc00b31,this.h5=0x68581511,this.h6=0x64f98fa7,this.h7=0xbefa4fa4):(this.h0=0x6a09e667,this.h1=0xbb67ae85,this.h2=0x3c6ef372,this.h3=0xa54ff53a,this.h4=0x510e527f,this.h5=0x9b05688c,this.h6=0x1f83d9ab,this.h7=0x5be0cd19),this.block=this.start=this.bytes=this.hBytes=0,this.finalized=this.hashed=!1,this.first=!0,this.is224=e}function x(e,r,n){var i,o=typeof e;if("string"===o){var s,a=[],c=e.length,u=0;for(i=0;i<c;++i)(s=e.charCodeAt(i))<128?a[u++]=s:(s<2048?a[u++]=192|s>>>6:(s<55296||s>=57344?a[u++]=224|s>>>12:(s=65536+((1023&s)<<10|1023&e.charCodeAt(++i)),a[u++]=240|s>>>18,a[u++]=128|s>>>12&63),a[u++]=128|s>>>6&63),a[u++]=128|63&s);e=a}else if("object"===o){if(null===e)throw Error(t);if(d&&e.constructor===ArrayBuffer)e=new Uint8Array(e);else if(!Array.isArray(e)&&(!d||!ArrayBuffer.isView(e)))throw Error(t)}else throw Error(t);e.length>64&&(e=new S(r,!0).update(e).array());var l=[],f=[];for(i=0;i<64;++i){var h=e[i]||0;l[i]=92^h,f[i]=54^h}S.call(this,r,n),this.update(f),this.oKeyPad=l,this.inner=!0,this.sharedMemory=n}S.prototype.update=function(e){if(!this.finalized){var r,n=typeof e;if("string"!==n){if("object"===n){if(null===e)throw Error(t);if(d&&e.constructor===ArrayBuffer)e=new Uint8Array(e);else if(!Array.isArray(e)&&(!d||!ArrayBuffer.isView(e)))throw Error(t)}else throw Error(t);r=!0}for(var i,o,s=0,a=e.length,c=this.blocks;s<a;){if(this.hashed&&(this.hashed=!1,c[0]=this.block,this.block=c[16]=c[1]=c[2]=c[3]=c[4]=c[5]=c[6]=c[7]=c[8]=c[9]=c[10]=c[11]=c[12]=c[13]=c[14]=c[15]=0),r)for(o=this.start;s<a&&o<64;++s)c[o>>>2]|=e[s]<<p[3&o++];else for(o=this.start;s<a&&o<64;++s)(i=e.charCodeAt(s))<128?c[o>>>2]|=i<<p[3&o++]:(i<2048?c[o>>>2]|=(192|i>>>6)<<p[3&o++]:(i<55296||i>
1=57344?c[o>>>2]|=(224|i>>>12)<<p[3&o++]:(i=65536+((1023&i)<<10|1023&e.charCodeAt(++s)),c[o>>>2]|=(240|i>>>18)<<p[3&o++],c[o>>>2]|=(128|i>>>12&63)<<p[3&o++]),c[o>>>2]|=(128|i>>>6&63)<<p[3&o++]),c[o>>>2]|=(128|63&i)<<p[3&o++]);this.lastByteIndex=o,this.bytes+=o-this.start,o>=64?(this.block=c[16],this.start=o-64,this.hash(),this.hashed=!0):this.start=o}return this.bytes>0xffffffff&&(this.hBytes+=this.bytes/0x100000000<<0,this.bytes=this.bytes%0x100000000),this}},S.prototype.finalize=function(){if(!this.finalized){this.finalized=!0;var e=this.blocks,t=this.lastByteIndex;e[16]=this.block,e[t>>>2]|=h[3&t],this.block=e[16],t>=56&&(this.hashed||this.hash(),e[0]=this.block,e[16]=e[1]=e[2]=e[3]=e[4]=e[5]=e[6]=e[7]=e[8]=e[9]=e[10]=e[11]=e[12]=e[13]=e[14]=e[15]=0),e[14]=this.hBytes<<3|this.bytes>>>29,e[15]=this.bytes<<3,this.hash()}},S.prototype.hash=function(){var e,t,r,n,i,o,s,a,c,u,l,d=this.h0,f=this.h1,h=this.h2,p=this.h3,g=this.h4,m=this.h5,b=this.h6,v=this.h7,w=this.blocks;for(e=16;e<64;++e)t=((i=w[e-15])>>>7|i<<25)^(i>>>18|i<<14)^i>>>3,r=((i=w[e-2])>>>17|i<<15)^(i>>>19|i<<13)^i>>>10,w[e]=w[e-16]+t+w[e-7]+r<<0;for(e=0,l=f&h;e<64;e+=4)this.first?(this.is224?(a=300032,v=(i=w[0]-0x543c9a5b)-0x8f1a6c7<<0,p=i+0x170e9b5<<0):(a=0x2a01a605,v=(i=w[0]-0xc881298)-0x5ab00ac6<<0,p=i+0x8909ae5<<0),this.first=!1):(t=(d>>>2|d<<30)^(d>>>13|d<<19)^(d>>>22|d<<10),r=(g>>>6|g<<26)^(g>>>11|g<<21)^(g>>>25|g<<7),n=(a=d&f)^d&h^l,i=v+r+(s=g&m^~g&b)+y[e]+w[e],o=t+n,v=p+i<<0,p=i+o<<0),t=(p>>>2|p<<30)^(p>>>13|p<<19)^(p>>>22|p<<10),r=(v>>>6|v<<26)^(v>>>11|v<<21)^(v>>>25|v<<7),n=(c=p&d)^p&f^a,i=b+r+(s=v&g^~v&m)+y[e+1]+w[e+1],o=t+n,b=h+i<<0,t=((h=i+o<<0)>>>2|h<<30)^(h>>>13|h<<19)^(h>>>22|h<<10),r=(b>>>6|b<<26)^(b>>>11|b<<21)^(b>>>25|b<<7),n=(u=h&p)^h&d^c,i=m+r+(s=b&v^~b&g)+y[e+2]+w[e+2],o=t+n,m=f+i<<0,t=((f=i+o<<0)>>>2|f<<30)^(f>>>13|f<<19)^(f>>>22|f<<10),r=(m>>>6|m<<26)^(m>>>11|m<<21)^(m>>>25|m<<7),n=(l=f&h)^f&p^u,i=g+r+(s=m&b^~m&v)+y[e+3]+w[e+3],o=t+n,g=d+i<<0,d=i+o<<0,this.chromeBugWorkAround=!0;this.h0=this.h0+d<<0,this.h1=this.h1+f<<0,this.h2=this.h2+h<<0,this.h3=this.h3+p<<0,this.h4=this.h4+g<<0,this.h5=this.h5+m<<0,this.h6=this.h6+b<<0,this.h7=this.h7+v<<0},S.prototype.hex=function(){this.finalize();var e=this.h0,t=this.h1,r=this.h2,n=this.h3,i=this.h4,o=this.h5,s=this.h6,a=this.h7,c=f[e>>>28&15]+f[e>>>24&15]+f[e>>>20&15]+f[e>>>16&15]+f[e>>>12&15]+f[e>>>8&15]+f[e>>>4&15]+f[15&e]+f[t>>>28&15]+f[t>>>24&15]+f[t>>>20&15]+f[t>>>16&15]+f[t>>>12&15]+f[t>>>8&15]+f[t>>>4&15]+f[15&t]+f[r>>>28&15]+f[r>>>24&15]+f[r>>>20&15]+f[r>>>16&15]+f[r>>>12&15]+f[r>>>8&15]+f[r>>>4&15]+f[15&r]+f[n>>>28&15]+f[n>>>24&15]+f[n>>>20&15]+f[n>>>16&15]+f[n>>>12&15]+f[n>>>8&15]+f[n>>>4&15]+f[15&n]+f[i>>>28&15]+f[i>>>24&15]+f[i>>>20&15]+f[i>>>16&15]+f[i>>>12&15]+f[i>>>8&15]+f[i>>>4&15]+f[15&i]+f[o>>>28&15]+f[o>>>24&15]+f[o>>>20&15]+f[o>>>16&15]+f[o>>>12&15]+f[o>>>8&15]+f[o>>>4&15]+f[15&o]+f[s>>>28&15]+f[s>>>24&15]+f[s>>>20&15]+f[s>>>16&15]+f[s>>>12&15]+f[s>>>8&15]+f[s>>>4&15]+f[15&s];return this.is224||(c+=f[a>>>28&15]+f[a>>>24&15]+f[a>>>20&15]+f[a>>>16&15]+f[a>>>12&15]+f[a>>>8&15]+f[a>>>4&15]+f[15&a]),c},S.prototype.toString=S.prototype.hex,S.prototype.digest=function(){this.finalize();var e=this.h0,t=this.h1,r=this.h2,n=this.h3,i=this.h4,o=this.h5,s=this.h6,a=this.h7,c=[e>>>24&255,e>>>16&255,e>>>8&255,255&e,t>>>24&255,t>>>16&255,t>>>8&255,255&t,r>>>24&255,r>>>16&255,r>>>8&255,255&r,n>>>24&255,n>>>16&255,n>>>8&255,255&n,i>>>24&255,i>>>16&255,i>>>8&255,255&i,o>>>24&255,o>>>16&255,o>>>8&255,255&o,s>>>24&255,s>>>16&255,s>>>8&255,255&s];return this.is224||c.push(a>>>24&255,a>>>16&255,a>>>8&255,255&a),c},S.prototype.array=S.prototype.digest,S.prototype.arrayBuffer=function(){this.finalize();var e=new ArrayBuffer(this.is224?28:32),t=new DataView(e);return t.setUint32(0,this.h0),t.setUint32(4,this.h1),t.setUint32(8,this.h2),t.setUint32(12,this.h3),t.setUint32(16,this.h4),t.setUint32(20,this.h5),t.setUint32(24,this.h6),this.is224||t.setUint32(28,this.h7),e},x.prototype=new S,x.prototype.finalize=function(){if(S.prototype.finalize.call(this),this.inner){this.inner=!1;var e=this.array();S.call(this,this.is224,this.sharedMemory),this.update(this.oKeyPad),this.update(e),S.prototype.finalize.call(this)}};var A=v();A.sha256=A,A.sha224=v(!0),A.sha256.hmac=E(),A.sha224.hmac=E(!0),u?e.exports=A:(s.sha256=A.sha256,s.sha224=A.sha224,l&&void 0!==(n=(function(){return A}).call(A,r,A,e))&&(e.exports=n))}()},48930:(e,t,r)=>{"use strict";
1Object.defineProperty(t,"__esModule",{value:!0}),t.wNAF=y,t.pippenger=g,t.precomputeMSMUnsafe=m,t.validateBasic=b;let n=r(58971),i=r(42128),o=BigInt(0),s=BigInt(1);function a(e,t){let r=t.negate();return e?r:t}function c(e,t){if(!Number.isSafeInteger(e)||e<=0||e>t)throw Error("invalid window size, expected [1.."+t+"], got W="+e)}function u(e,t){return c(e,t),{windows:Math.ceil(t/e)+1,windowSize:2**(e-1)}}function l(e,t){if(!Array.isArray(e))throw Error("array expected");e.forEach((e,r)=>{if(!(e instanceof t))throw Error("invalid point at index "+r)})}function d(e,t){if(!Array.isArray(e))throw Error("array of scalars expected");e.forEach((e,r)=>{if(!t.isValid(e))throw Error("invalid scalar at index "+r)})}let f=new WeakMap,h=new WeakMap;function p(e){return h.get(e)||1}function y(e,t){return{constTimeNegate:a,hasPrecomputes:e=>1!==p(e),unsafeLadder(t,r,n=e.ZERO){let i=t;for(;r>o;)r&s&&(n=n.add(i)),i=i.double(),r>>=s;return n},precomputeWindow(e,r){let{windows:n,windowSize:i}=u(r,t),o=[],s=e,a=s;for(let e=0;e<n;e++){a=s,o.push(a);for(let e=1;e<i;e++)a=a.add(s),o.push(a);s=a.double()}return o},wNAF(r,n,i){let{windows:o,windowSize:c}=u(r,t),l=e.ZERO,d=e.BASE,f=BigInt(2**r-1),h=2**r,p=BigInt(r);for(let e=0;e<o;e++){let t=e*c,r=Number(i&f);i>>=p,r>c&&(r-=h,i+=s);let o=t,u=t+Math.abs(r)-1,y=e%2!=0,g=r<0;0===r?d=d.add(a(y,n[o])):l=l.add(a(g,n[u]))}return{p:l,f:d}},wNAFUnsafe(r,n,i,a=e.ZERO){let{windows:c,windowSize:l}=u(r,t),d=BigInt(2**r-1),f=2**r,h=BigInt(r);for(let e=0;e<c;e++){let t=e*l;if(i===o)break;let r=Number(i&d);if(i>>=h,r>l&&(r-=f,i+=s),0===r)continue;let c=n[t+Math.abs(r)-1];r<0&&(c=c.negate()),a=a.add(c)}return a},getPrecomputes(e,t,r){let n=f.get(t);return n||(n=this.precomputeWindow(t,e),1!==e&&f.set(t,r(n))),n},wNAFCached(e,t,r){let n=p(e);return this.wNAF(n,this.getPrecomputes(n,e,r),t)},wNAFCachedUnsafe(e,t,r,n){let i=p(e);return 1===i?this.unsafeLadder(e,t,n):this.wNAFUnsafe(i,this.getPrecomputes(i,e,r),t,n)},setWindowSize(e,r){c(r,t),h.set(e,r),f.delete(e)}}}function g(e,t,r,n){if(l(r,e),d(n,t),r.length!==n.length)throw Error("arrays of points and scalars must have equal length");let o=e.ZERO,s=(0,i.bitLen)(BigInt(r.length)),a=s>12?s-3:s>4?s-2:s?2:1,c=(1<<a)-1,u=Array(c+1).fill(o),f=Math.floor((t.BITS-1)/a)*a,h=o;for(let e=f;e>=0;e-=a){u.fill(o);for(let t=0;t<n.length;t++){let i=Number(n[t]>>BigInt(e)&BigInt(c));u[i]=u[i].add(r[t])}let t=o;for(let e=u.length-1,r=o;e>0;e--)r=r.add(u[e]),t=t.add(r);if(h=h.add(t),0!==e)for(let e=0;e<a;e++)h=h.double()}return h}function m(e,t,r,n){c(n,t.BITS),l(r,e);let i=e.ZERO,o=2**n-1,s=Math.ceil(t.BITS/n),a=BigInt((1<<n)-1),u=r.map(e=>{let t=[];for(let r=0,n=e;r<o;r++)t.push(n),n=n.add(e);return t});return e=>{if(d(e,t),e.length>r.length)throw Error("array of scalars must be smaller than array of points");let o=i;for(let t=0;t<s;t++){if(o!==i)for(let e=0;e<n;e++)o=o.double();let r=BigInt(s*n-(t+1)*n);for(let t=0;t<e.length;t++){let n=Number(e[t]>>r&a);n&&(o=o.add(u[t][n-1]))}}return o}}function b(e){return(0,n.validateField)(e.Fp),(0,i.validateObject)(e,{n:"bigint",h:"bigint",Gx:"field",Gy:"field"},{nBitLength:"isSafeInteger",nByteLength:"isSafeInteger"}),Object.freeze({...(0,n.nLength)(e.n,e.nBitLength),...e,p:e.Fp.ORDER})}},91573:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.twistedEdwards=h;let n=r(48930),i=r(58971),o=r(42128),s=r(42128),a=BigInt(0),c=BigInt(1),u=BigInt(2),l=BigInt(8),d={zip215:!0};function f(e){let t=(0,n.validateBasic)(e);return o.validateObject(e,{hash:"function",a:"bigint",d:"bigint",randomBytes:"function"},{adjustScalarBytes:"function",domain:"function",uvRatio:"function",mapToCurve:"function"}),Object.freeze({...t})}function h(e){let t=f(e),{Fp:r,n:h,prehash:p,hash:y,randomBytes:g,nByteLength:m,h:b}=t,v=u<<BigInt(8*m)-c,w=r.create,_=(0,i.Field)(t.n,t.nBitLength),E=t.uvRatio||((e,t)=>{try{return{isValid:!0,value:r.sqrt(e*r.inv(t))}}catch(e){return{isValid:!1,value:a}}}),S=t.adjustScalarBytes||(e=>e),x=t.domain||((e,t,r)=>{if((0,s.abool)("phflag",r),t.length||r)throw Error("Contexts/pre-hash are not supported");return e});function A(e,t){o.aInRange("coordinate "+e,t,a,v)}function I(e){if(!(e instanceof P))throw Error("ExtendedPoint expected")}let O=(0,s.memoized)((e,t)=>{let{ex:n,ey:i,ez:o}=e,s=e.is0();null==t&&(t=s?l:r.inv(o));let u=w(n*t),d=w(i*t),f=w(o*t);if(s)return{x:a,y:c};
1if(f!==c)throw Error("invZ was invalid");return{x:u,y:d}}),T=(0,s.memoized)(e=>{let{a:r,d:n}=t;if(e.is0())throw Error("bad point: ZERO");let{ex:i,ey:o,ez:s,et:a}=e,c=w(i*i),u=w(o*o),l=w(s*s),d=w(l*l),f=w(c*r);if(w(l*w(f+u))!==w(d+w(n*w(c*u))))throw Error("bad point: equation left != right (1)");if(w(i*o)!==w(s*a))throw Error("bad point: equation left != right (2)");return!0});class P{constructor(e,t,r,n){this.ex=e,this.ey=t,this.ez=r,this.et=n,A("x",e),A("y",t),A("z",r),A("t",n),Object.freeze(this)}get x(){return this.toAffine().x}get y(){return this.toAffine().y}static fromAffine(e){if(e instanceof P)throw Error("extended point not allowed");let{x:t,y:r}=e||{};return A("x",t),A("y",r),new P(t,r,c,w(t*r))}static normalizeZ(e){let t=r.invertBatch(e.map(e=>e.ez));return e.map((e,r)=>e.toAffine(t[r])).map(P.fromAffine)}static msm(e,t){return(0,n.pippenger)(P,_,e,t)}_setWindowSize(e){k.setWindowSize(this,e)}assertValidity(){T(this)}equals(e){I(e);let{ex:t,ey:r,ez:n}=this,{ex:i,ey:o,ez:s}=e,a=w(t*s),c=w(i*n),u=w(r*s),l=w(o*n);return a===c&&u===l}is0(){return this.equals(P.ZERO)}negate(){return new P(w(-this.ex),this.ey,this.ez,w(-this.et))}double(){let{a:e}=t,{ex:r,ey:n,ez:i}=this,o=w(r*r),s=w(n*n),a=w(u*w(i*i)),c=w(e*o),l=r+n,d=w(w(l*l)-o-s),f=c+s,h=f-a,p=c-s,y=w(d*h),g=w(f*p),m=w(d*p);return new P(y,g,w(h*f),m)}add(e){I(e);let{a:r,d:n}=t,{ex:i,ey:o,ez:s,et:c}=this,{ex:l,ey:d,ez:f,et:h}=e;if(r===BigInt(-1)){let e=w((o-i)*(d+l)),t=w((o+i)*(d-l)),r=w(t-e);if(r===a)return this.double();let n=w(s*u*h),p=w(c*u*f),y=p+n,g=t+e,m=p-n,b=w(y*r),v=w(g*m),_=w(y*m);return new P(b,v,w(r*g),_)}let p=w(i*l),y=w(o*d),g=w(c*n*h),m=w(s*f),b=w((i+o)*(l+d)-p-y),v=m-g,_=m+g,E=w(y-r*p),S=w(b*v),x=w(_*E),A=w(b*E);return new P(S,x,w(v*_),A)}subtract(e){return this.add(e.negate())}wNAF(e){return k.wNAFCached(this,e,P.normalizeZ)}multiply(e){let t=e;o.aInRange("scalar",t,c,h);let{p:r,f:n}=this.wNAF(t);return P.normalizeZ([r,n])[0]}multiplyUnsafe(e,t=P.ZERO){let r=e;return(o.aInRange("scalar",r,a,h),r===a)?N:this.is0()||r===c?this:k.wNAFCachedUnsafe(this,r,P.normalizeZ,t)}isSmallOrder(){return this.multiplyUnsafe(b).is0()}isTorsionFree(){return k.unsafeLadder(this,h).is0()}toAffine(e){return O(this,e)}clearCofactor(){let{h:e}=t;return e===c?this:this.multiplyUnsafe(e)}static fromHex(e,n=!1){let{d:i,a:u}=t,l=r.BYTES;e=(0,s.ensureBytes)("pointHex",e,l),(0,s.abool)("zip215",n);let d=e.slice(),f=e[l-1];d[l-1]=-129&f;let h=o.bytesToNumberLE(d),p=n?v:r.ORDER;o.aInRange("pointHex.y",h,a,p);let y=w(h*h),{isValid:g,value:m}=E(w(y-c),w(i*y-u));if(!g)throw Error("Point.fromHex: invalid y coordinate");let b=(m&c)===c,_=(128&f)!=0;if(!n&&m===a&&_)throw Error("Point.fromHex: x=0 and x_0=1");return _!==b&&(m=w(-m)),P.fromAffine({x:m,y:h})}static fromPrivateKey(e){return j(e).point}toRawBytes(){let{x:e,y:t}=this.toAffine(),n=o.numberToBytesLE(t,r.BYTES);return n[n.length-1]|=e&c?128:0,n}toHex(){return o.bytesToHex(this.toRawBytes())}}P.BASE=new P(t.Gx,t.Gy,c,w(t.Gx*t.Gy)),P.ZERO=new P(a,c,c,a);let{BASE:M,ZERO:N}=P,k=(0,n.wNAF)(P,8*m);function C(e){return(0,i.mod)(e,h)}function D(e){return C(o.bytesToNumberLE(e))}function j(e){let t=r.BYTES;e=(0,s.ensureBytes)("private key",e,t);let n=(0,s.ensureBytes)("hashed private key",y(e),2*t),i=S(n.slice(0,t)),o=n.slice(t,2*t),a=D(i),c=M.multiply(a),u=c.toRawBytes();return{head:i,prefix:o,scalar:a,point:c,pointBytes:u}}function R(e){return j(e).pointBytes}function L(e=new Uint8Array,...t){return D(y(x(o.concatBytes(...t),(0,s.ensureBytes)("context",e),!!p)))}function B(e,t,n={}){e=(0,s.ensureBytes)("message",e),p&&(e=p(e));let{prefix:i,scalar:c,pointBytes:u}=j(t),l=L(n.context,i,e),d=M.multiply(l).toRawBytes(),f=C(l+L(n.context,d,u,e)*c);o.aInRange("signature.s",f,a,h);let y=o.concatBytes(d,o.numberToBytesLE(f,r.BYTES));return(0,s.ensureBytes)("result",y,2*r.BYTES)}let U=d;function $(e,t,n,i=U){let a,c,u;let{context:l,zip215:d}=i,f=r.BYTES;e=(0,s.ensureBytes)("signature",e,2*f),t=(0,s.ensureBytes)("message",t),n=(0,s.ensureBytes)("publicKey",n,f),void 0!==d&&(0,s.abool)("zip215",d),p&&(t=p(t));let h=o.bytesToNumberLE(e.slice(f,2*f));try{a=P.fromHex(n,d),c=P.fromHex(e.slice(0,f),d),u=M.multiplyUnsafe(h)}catch(e){return!1}if(!d&&a.isSmallOrder())return!1;let y=L(l,c.toRawBytes(),a.toRawBytes(),t);return c.add(a.multiplyUnsafe(y)).subtract(u).clearCofactor().equals(P.ZERO)}M._setWindowSize(8);let K={getExtendedPublicKey:j,randomPrivateKey:()=>g(r.BYTES),precompute:(e=8,t=P.BASE)=>(t._setWindowSize(e),t.multiply(BigInt(3)),t)};return{CURVE:t,getPublicKey:R,sign:B,verify:$,ExtendedPoint:P,utils:K}}},70121:(e,t,r)=>{"use strict";
1Object.defineProperty(t,"__esModule",{value:!0}),t.expand_message_xmd=u,t.expand_message_xof=l,t.hash_to_field=d,t.isogenyMap=f,t.createHasher=h;let n=r(58971),i=r(42128),o=i.bytesToNumberBE;function s(e,t){if(c(e),c(t),e<0||e>=1<<8*t)throw Error("invalid I2OSP input: "+e);let r=Array.from({length:t}).fill(0);for(let n=t-1;n>=0;n--)r[n]=255&e,e>>>=8;return new Uint8Array(r)}function a(e,t){let r=new Uint8Array(e.length);for(let n=0;n<e.length;n++)r[n]=e[n]^t[n];return r}function c(e){if(!Number.isSafeInteger(e))throw Error("number expected")}function u(e,t,r,n){(0,i.abytes)(e),(0,i.abytes)(t),c(r),t.length>255&&(t=n((0,i.concatBytes)((0,i.utf8ToBytes)("H2C-OVERSIZE-DST-"),t)));let{outputLen:o,blockLen:u}=n,l=Math.ceil(r/o);if(r>65535||l>255)throw Error("expand_message_xmd: invalid lenInBytes");let d=(0,i.concatBytes)(t,s(t.length,1)),f=s(0,u),h=s(r,2),p=Array(l),y=n((0,i.concatBytes)(f,e,h,s(0,1),d));p[0]=n((0,i.concatBytes)(y,s(1,1),d));for(let e=1;e<=l;e++){let t=[a(y,p[e-1]),s(e+1,1),d];p[e]=n((0,i.concatBytes)(...t))}return(0,i.concatBytes)(...p).slice(0,r)}function l(e,t,r,n,o){if((0,i.abytes)(e),(0,i.abytes)(t),c(r),t.length>255){let e=Math.ceil(2*n/8);t=o.create({dkLen:e}).update((0,i.utf8ToBytes)("H2C-OVERSIZE-DST-")).update(t).digest()}if(r>65535||t.length>255)throw Error("expand_message_xof: invalid lenInBytes");return o.create({dkLen:r}).update(e).update(s(r,2)).update(t).update(s(t.length,1)).digest()}function d(e,t,r){let s;(0,i.validateObject)(r,{DST:"stringOrUint8Array",p:"bigint",m:"isSafeInteger",k:"isSafeInteger",hash:"hash"});let{p:a,k:d,m:f,hash:h,expand:p,DST:y}=r;(0,i.abytes)(e),c(t);let g="string"==typeof y?(0,i.utf8ToBytes)(y):y,m=Math.ceil((a.toString(2).length+d)/8),b=t*f*m;if("xmd"===p)s=u(e,g,b,h);else if("xof"===p)s=l(e,g,b,d,h);else if("_internal_pass"===p)s=e;else throw Error('expand must be "xmd" or "xof"');let v=Array(t);for(let e=0;e<t;e++){let t=Array(f);for(let r=0;r<f;r++){let i=m*(r+e*f),c=s.subarray(i,i+m);t[r]=(0,n.mod)(o(c),a)}v[e]=t}return v}function f(e,t){let r=t.map(e=>Array.from(e).reverse());return(t,n)=>{let[i,o,s,a]=r.map(r=>r.reduce((r,n)=>e.add(e.mul(r,t),n)));return t=e.div(i,o),n=e.mul(n,e.div(s,a)),{x:t,y:n}}}function h(e,t,r){if("function"!=typeof t)throw Error("mapToCurve() must be defined");return{hashToCurve(n,i){let o=d(n,2,{...r,DST:r.DST,...i}),s=e.fromAffine(t(o[0])),a=e.fromAffine(t(o[1])),c=s.add(a).clearCofactor();return c.assertValidity(),c},encodeToCurve(n,i){let o=d(n,1,{...r,DST:r.encodeDST,...i}),s=e.fromAffine(t(o[0])).clearCofactor();return s.assertValidity(),s},mapToCurve(r){if(!Array.isArray(r))throw Error("mapToCurve: expected array of bigints");for(let e of r)if("bigint"!=typeof e)throw Error("mapToCurve: expected array of bigints");let n=e.fromAffine(t(r)).clearCofactor();return n.assertValidity(),n}}}},58971:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.isNegativeLE=void 0,t.mod=d,t.pow=f,t.pow2=h,t.invert=p,t.tonelliShanks=y,t.FpSqrt=g,t.validateField=v,t.FpPow=w,t.FpInvertBatch=_,t.FpDiv=E,t.FpLegendre=S,t.FpIsSquare=x,t.nLength=A,t.Field=I,t.FpSqrtOdd=O,t.FpSqrtEven=T,t.hashToPrivateScalar=P,t.getFieldBytesLength=M,t.getMinHashLength=N,t.mapHashToField=k;let n=r(42128),i=BigInt(0),o=BigInt(1),s=BigInt(2),a=BigInt(3),c=BigInt(4),u=BigInt(5),l=BigInt(8);function d(e,t){let r=e%t;return r>=i?r:t+r}function f(e,t,r){if(t<i)throw Error("invalid exponent, negatives unsupported");if(r<=i)throw Error("invalid modulus");if(r===o)return i;let n=o;for(;t>i;)t&o&&(n=n*e%r),e=e*e%r,t>>=o;return n}function h(e,t,r){let n=e;for(;t-- >i;)n*=n,n%=r;return n}function p(e,t){if(e===i)throw Error("invert: expected non-zero number");if(t<=i)throw Error("invert: expected positive modulus, got "+t);let r=d(e,t),n=t,s=i,a=o,c=o,u=i;for(;r!==i;){let e=n/r,t=n%r,i=s-c*e,o=a-u*e;n=r,r=t,s=c,a=u,c=i,u=o}if(n!==o)throw Error("invert: does not exist");return d(s,t)}function y(e){let t,r,n;let a=(e-o)/s;for(t=e-o,r=0;t%s===i;t/=s,r++);for(n=s;n<e&&f(n,a,e)!==e-o;n++)if(n>1e3)throw Error("Cannot find square root: likely non-prime P");if(1===r){let t=(e+o)/c;return function(e,r){let n=e.pow(r,t);if(!e.eql(e.sqr(n),r))throw Error("Cannot find square root");return n}}let u=(t+o)/s;return function(e,i){if(e.pow(i,a)===e.neg(e.ONE))throw Error("Cannot find square root");let s=r,c=e.pow(e.mul(e.ONE,n),t),l=e.pow(i,u),d=e.pow(i,t);for(;!e.eql(d,e.ONE);){if(e.eql(d,e.ZERO))return e.ZERO;let t=1;for(let r=e.sqr(d);t<s&&!e.eql(r,e.ONE);t++)r=e.sqr(r);let r=e.pow(c,o<<BigInt(s-t-1));c=e.sqr(r),l=e.mul(l,r),d=e.mul(d,c),s=t}return l}}function g(e){if(e%c===a){let t=(e+o)/c;return function(e,r){let n=e.pow(r,t);if(!e.eql(e.sqr(n),r))throw Error("Cannot find square root");return n}}if(e%l===u){let t=(e-u)/l;return function(e,r){let n=e.mul(r,s),i=e.pow(n,t),o=e.mul(r,i),a=e.mul(e.mul(o,s),i),c=e.mul(o,e.sub(a,e.ONE));if(!e.eql(e.sqr(c),r))throw Error("Cannot find square root");return c}}return y(e)}let m=(e,t)=>
1(d(e,t)&o)===o;t.isNegativeLE=m;let b=["create","isValid","is0","neg","inv","sqrt","sqr","eql","add","sub","mul","pow","div","addN","subN","mulN","sqrN"];function v(e){let t={ORDER:"bigint",MASK:"bigint",BYTES:"isSafeInteger",BITS:"isSafeInteger"},r=b.reduce((e,t)=>(e[t]="function",e),t);return(0,n.validateObject)(e,r)}function w(e,t,r){if(r<i)throw Error("invalid exponent, negatives unsupported");if(r===i)return e.ONE;if(r===o)return t;let n=e.ONE,s=t;for(;r>i;)r&o&&(n=e.mul(n,s)),s=e.sqr(s),r>>=o;return n}function _(e,t){let r=Array(t.length),n=t.reduce((t,n,i)=>e.is0(n)?t:(r[i]=t,e.mul(t,n)),e.ONE),i=e.inv(n);return t.reduceRight((t,n,i)=>e.is0(n)?t:(r[i]=e.mul(t,r[i]),e.mul(t,n)),i),r}function E(e,t,r){return e.mul(t,"bigint"==typeof r?p(r,e.ORDER):e.inv(r))}function S(e){let t=(e-o)/s;return(e,r)=>e.pow(r,t)}function x(e){let t=S(e.ORDER);return r=>{let n=t(e,r);return e.eql(n,e.ZERO)||e.eql(n,e.ONE)}}function A(e,t){let r=void 0!==t?t:e.toString(2).length,n=Math.ceil(r/8);return{nBitLength:r,nByteLength:n}}function I(e,t,r=!1,s={}){let a;if(e<=i)throw Error("invalid field: expected ORDER > 0, got "+e);let{nBitLength:c,nByteLength:u}=A(e,t);if(u>2048)throw Error("invalid field: expected ORDER of <= 2048 bytes");let l=Object.freeze({ORDER:e,isLE:r,BITS:c,BYTES:u,MASK:(0,n.bitMask)(c),ZERO:i,ONE:o,create:t=>d(t,e),isValid:t=>{if("bigint"!=typeof t)throw Error("invalid field element: expected bigint, got "+typeof t);return i<=t&&t<e},is0:e=>e===i,isOdd:e=>(e&o)===o,neg:t=>d(-t,e),eql:(e,t)=>e===t,sqr:t=>d(t*t,e),add:(t,r)=>d(t+r,e),sub:(t,r)=>d(t-r,e),mul:(t,r)=>d(t*r,e),pow:(e,t)=>w(l,e,t),div:(t,r)=>d(t*p(r,e),e),sqrN:e=>e*e,addN:(e,t)=>e+t,subN:(e,t)=>e-t,mulN:(e,t)=>e*t,inv:t=>p(t,e),sqrt:s.sqrt||(t=>(a||(a=g(e)),a(l,t))),invertBatch:e=>_(l,e),cmov:(e,t,r)=>r?t:e,toBytes:e=>r?(0,n.numberToBytesLE)(e,u):(0,n.numberToBytesBE)(e,u),fromBytes:e=>{if(e.length!==u)throw Error("Field.fromBytes: expected "+u+" bytes, got "+e.length);return r?(0,n.bytesToNumberLE)(e):(0,n.bytesToNumberBE)(e)}});return Object.freeze(l)}function O(e,t){if(!e.isOdd)throw Error("Field doesn't have isOdd");let r=e.sqrt(t);return e.isOdd(r)?r:e.neg(r)}function T(e,t){if(!e.isOdd)throw Error("Field doesn't have isOdd");let r=e.sqrt(t);return e.isOdd(r)?e.neg(r):r}function P(e,t,r=!1){let i=(e=(0,n.ensureBytes)("privateHash",e)).length,s=A(t).nByteLength+8;if(s<24||i<s||i>1024)throw Error("hashToPrivateScalar: expected "+s+"-1024 bytes of input, got "+i);return d(r?(0,n.bytesToNumberLE)(e):(0,n.bytesToNumberBE)(e),t-o)+o}function M(e){if("bigint"!=typeof e)throw Error("field order must be bigint");return Math.ceil(e.toString(2).length/8)}function N(e){let t=M(e);return t+Math.ceil(t/2)}function k(e,t,r=!1){let i=e.length,s=M(t),a=N(t);if(i<16||i<a||i>1024)throw Error("expected "+a+"-1024 bytes of input, got "+i);let c=d(r?(0,n.bytesToNumberLE)(e):(0,n.bytesToNumberBE)(e),t-o)+o;return r?(0,n.numberToBytesLE)(c,s):(0,n.numberToBytesBE)(c,s)}},41372:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.montgomery=c;let n=r(58971),i=r(42128),o=BigInt(0),s=BigInt(1);function a(e){return(0,i.validateObject)(e,{a:"bigint"},{montgomeryBits:"isSafeInteger",nByteLength:"isSafeInteger",adjustScalarBytes:"function",domain:"function",powPminus2:"function",Gu:"bigint"}),Object.freeze({...e})}function c(e){let t=a(e),{P:r}=t,c=e=>(0,n.mod)(e,r),u=t.montgomeryBits,l=Math.ceil(u/8),d=t.nByteLength,f=t.adjustScalarBytes||(e=>e),h=t.powPminus2||(e=>(0,n.pow)(e,r-BigInt(2),r));function p(e,t,r){let n=c(e*(t-r));return[t=c(t-n),r=c(r+n)]}let y=(t.a-BigInt(2))/BigInt(4);function g(e,t){let n;(0,i.aInRange)("u",e,o,r),(0,i.aInRange)("scalar",t,o,r);let a=t,l=e,d=s,f=o,g=e,m=s,b=o;for(let e=BigInt(u-1);e>=o;e--){let t=a>>e&s;b^=t,d=(n=p(b,d,g))[0],g=n[1],f=(n=p(b,f,m))[0],m=n[1],b=t;let r=d+f,i=c(r*r),o=d-f,u=c(o*o),h=i-u,v=g+m,w=c((g-m)*r),_=c(v*o),E=w+_,S=w-_;g=c(E*E),m=c(l*c(S*S)),d=c(i*u),f=c(h*(i+c(y*h)))}return d=(n=p(b,d,g))[0],g=n[1],f=(n=p(b,f,m))[0],m=n[1],c(d*h(f))}function m(e){return(0,i.numberToBytesLE)(c(e),l)}function b(e){let t=(0,i.ensureBytes)("u coordinate",e,l);return 32===d&&(t[31]&=127),(0,i.bytesToNumberLE)(t)}function v(e){let t=(0,i.ensureBytes)("scalar",e),r=t.length;if(r!==l&&r!==d)throw Error("invalid scalar, expected "+l+" or "+d+" bytes, got "+r);return(0,i.bytesToNumberLE)(f(t))}function w(e,t){let r=g(b(t),v(e));if(r===o)throw Error("invalid private or public key received");return m(r)}let _=m(t.Gu);function E(e){return w(e,_)}return{scalarMult:w,scalarMultBase:E,getSharedSecret:(e,t)=>w(e,t),getPublicKey:e=>E(e),utils:{randomPrivateKey:()=>t.randomBytes(t.nByteLength)},GuBytes:_}}},42128:(e,t)=>
1{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.notImplemented=t.bitMask=void 0,t.isBytes=o,t.abytes=s,t.abool=a,t.bytesToHex=u,t.numberToHexUnpadded=l,t.hexToNumber=d,t.hexToBytes=p,t.bytesToNumberBE=y,t.bytesToNumberLE=g,t.numberToBytesBE=m,t.numberToBytesLE=b,t.numberToVarBytesBE=v,t.ensureBytes=w,t.concatBytes=_,t.equalBytes=E,t.utf8ToBytes=S,t.inRange=A,t.aInRange=I,t.bitLen=O,t.bitGet=T,t.bitSet=P,t.createHmacDrbg=C,t.validateObject=j,t.memoized=L;let r=BigInt(0),n=BigInt(1),i=BigInt(2);function o(e){return e instanceof Uint8Array||ArrayBuffer.isView(e)&&"Uint8Array"===e.constructor.name}function s(e){if(!o(e))throw Error("Uint8Array expected")}function a(e,t){if("boolean"!=typeof t)throw Error(e+" boolean expected, got "+t)}let c=Array.from({length:256},(e,t)=>t.toString(16).padStart(2,"0"));function u(e){s(e);let t="";for(let r=0;r<e.length;r++)t+=c[e[r]];return t}function l(e){let t=e.toString(16);return 1&t.length?"0"+t:t}function d(e){if("string"!=typeof e)throw Error("hex string expected, got "+typeof e);return""===e?r:BigInt("0x"+e)}let f={_0:48,_9:57,A:65,F:70,a:97,f:102};function h(e){return e>=f._0&&e<=f._9?e-f._0:e>=f.A&&e<=f.F?e-(f.A-10):e>=f.a&&e<=f.f?e-(f.a-10):void 0}function p(e){if("string"!=typeof e)throw Error("hex string expected, got "+typeof e);let t=e.length,r=t/2;if(t%2)throw Error("hex string expected, got unpadded hex of length "+t);let n=new Uint8Array(r);for(let t=0,i=0;t<r;t++,i+=2){let r=h(e.charCodeAt(i)),o=h(e.charCodeAt(i+1));if(void 0===r||void 0===o)throw Error('hex string expected, got non-hex character "'+(e[i]+e[i+1])+'" at index '+i);n[t]=16*r+o}return n}function y(e){return d(u(e))}function g(e){return s(e),d(u(Uint8Array.from(e).reverse()))}function m(e,t){return p(e.toString(16).padStart(2*t,"0"))}function b(e,t){return m(e,t).reverse()}function v(e){return p(l(e))}function w(e,t,r){let n;if("string"==typeof t)try{n=p(t)}catch(t){throw Error(e+" must be hex string or Uint8Array, cause: "+t)}else if(o(t))n=Uint8Array.from(t);else throw Error(e+" must be hex string or Uint8Array");let i=n.length;if("number"==typeof r&&i!==r)throw Error(e+" of length "+r+" expected, got "+i);return n}function _(...e){let t=0;for(let r=0;r<e.length;r++){let n=e[r];s(n),t+=n.length}let r=new Uint8Array(t);for(let t=0,n=0;t<e.length;t++){let i=e[t];r.set(i,n),n+=i.length}return r}function E(e,t){if(e.length!==t.length)return!1;let r=0;for(let n=0;n<e.length;n++)r|=e[n]^t[n];return 0===r}function S(e){if("string"!=typeof e)throw Error("string expected");return new Uint8Array(new TextEncoder().encode(e))}let x=e=>"bigint"==typeof e&&r<=e;function A(e,t,r){return x(e)&&x(t)&&x(r)&&t<=e&&e<r}function I(e,t,r,n){if(!A(t,r,n))throw Error("expected valid "+e+": "+r+" <= n < "+n+", got "+t)}function O(e){let t;for(t=0;e>r;e>>=n,t+=1);return t}function T(e,t){return e>>BigInt(t)&n}function P(e,t,i){return e|(i?n:r)<<BigInt(t)}let M=e=>(i<<BigInt(e-1))-n;t.bitMask=M;let N=e=>new Uint8Array(e),k=e=>Uint8Array.from(e);function C(e,t,r){if("number"!=typeof e||e<2)throw Error("hashLen must be a number");if("number"!=typeof t||t<2)throw Error("qByteLen must be a number");if("function"!=typeof r)throw Error("hmacFn must be a function");let n=N(e),i=N(e),o=0,s=()=>{n.fill(1),i.fill(0),o=0},a=(...e)=>r(i,n,...e),c=(e=N())=>{i=a(k([0]),e),n=a(),0!==e.length&&(i=a(k([1]),e),n=a())},u=()=>{if(o++>=1e3)throw Error("drbg: tried 1000 values");let e=0,r=[];for(;e<t;){let t=(n=a()).slice();r.push(t),e+=n.length}return _(...r)};return(e,t)=>{let r;for(s(),c(e);!(r=t(u()));)c();return s(),r}}let D={bigint:e=>"bigint"==typeof e,function:e=>"function"==typeof e,boolean:e=>"boolean"==typeof e,string:e=>"string"==typeof e,stringOrUint8Array:e=>"string"==typeof e||o(e),isSafeInteger:e=>Number.isSafeInteger(e),array:e=>Array.isArray(e),field:(e,t)=>t.Fp.isValid(e),hash:e=>"function"==typeof e&&Number.isSafeInteger(e.outputLen)};function j(e,t,r={}){let n=(t,r,n)=>{let i=D[r];if("function"!=typeof i)throw Error("invalid validator function");let o=e[t];if((!n||void 0!==o)&&!i(o,e))throw Error("param "+String(t)+" is invali
1d. Expected "+r+", got "+o)};for(let[e,r]of Object.entries(t))n(e,r,!1);for(let[e,t]of Object.entries(r))n(e,t,!0);return e}let R=()=>{throw Error("not implemented")};function L(e){let t=new WeakMap;return(r,...n)=>{let i=t.get(r);if(void 0!==i)return i;let o=e(r,...n);return t.set(r,o),o}}t.notImplemented=R},80293:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.hash_to_ristretto255=t.hashToRistretto255=t.RistrettoPoint=t.encodeToCurve=t.hashToCurve=t.edwardsToMontgomery=t.x25519=t.ed25519ph=t.ed25519ctx=t.ed25519=t.ED25519_TORSION_SUBGROUP=void 0,t.edwardsToMontgomeryPub=A,t.edwardsToMontgomeryPriv=I;let n=r(8123),i=r(4954),o=r(48930),s=r(91573),a=r(70121),c=r(58971),u=r(41372),l=r(42128),d=BigInt("57896044618658097711785492504343953926634992332820282019728792003956564819949"),f=BigInt("19681161376707505956807079304988542015446066515923890162744021073123829784752"),h=BigInt(0),p=BigInt(1),y=BigInt(2),g=BigInt(3),m=BigInt(5),b=BigInt(8);function v(e){let t=BigInt(10),r=BigInt(20),n=BigInt(40),i=BigInt(80),o=d,s=e*e%o*e%o,a=(0,c.pow2)(s,y,o)*s%o,u=(0,c.pow2)(a,p,o)*e%o,l=(0,c.pow2)(u,m,o)*u%o,f=(0,c.pow2)(l,t,o)*l%o,h=(0,c.pow2)(f,r,o)*f%o,g=(0,c.pow2)(h,n,o)*h%o,b=(0,c.pow2)(g,i,o)*g%o,v=(0,c.pow2)(b,i,o)*g%o,w=(0,c.pow2)(v,t,o)*l%o;return{pow_p_5_8:(0,c.pow2)(w,y,o)*e%o,b2:s}}function w(e){return e[0]&=248,e[31]&=127,e[31]|=64,e}function _(e,t){let r=d,n=(0,c.mod)(t*t*t,r),i=v(e*(0,c.mod)(n*n*t,r)).pow_p_5_8,o=(0,c.mod)(e*n*i,r),s=(0,c.mod)(t*o*o,r),a=o,u=(0,c.mod)(o*f,r),l=s===e,h=s===(0,c.mod)(-e,r),p=s===(0,c.mod)(-e*f,r);return l&&(o=a),(h||p)&&(o=u),(0,c.isNegativeLE)(o,r)&&(o=(0,c.mod)(-o,r)),{isValid:l||h,value:o}}t.ED25519_TORSION_SUBGROUP=["0100000000000000000000000000000000000000000000000000000000000000","c7176a703d4dd84fba3c0b760d10670f2a2053fa2c39ccc64ec7fd7792ac037a","0000000000000000000000000000000000000000000000000000000000000080","26e8958fc2b227b045c3f489f2ef98f0d5dfac05d3c63339b13802886d53fc05","ecffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff7f","26e8958fc2b227b045c3f489f2ef98f0d5dfac05d3c63339b13802886d53fc85","0000000000000000000000000000000000000000000000000000000000000000","c7176a703d4dd84fba3c0b760d10670f2a2053fa2c39ccc64ec7fd7792ac03fa"];let E=(0,c.Field)(d,void 0,!0),S={a:BigInt(-1),d:BigInt("37095705934669439343138083508754565189542113879843219016388785533085940283555"),Fp:E,n:BigInt("7237005577332262213973186563042994240857116359379907606001950938285454250989"),h:b,Gx:BigInt("15112221349535400772501151409588531511454012693041857206046113283949847762202"),Gy:BigInt("46316835694926478169428394003475163141307993866256225615783033603165251855960"),hash:n.sha512,randomBytes:i.randomBytes,adjustScalarBytes:w,uvRatio:_};function x(e,t,r){if(t.length>255)throw Error("Context is too big");return(0,i.concatBytes)((0,i.utf8ToBytes)("SigEd25519 no Ed25519 collisions"),new Uint8Array([r?1:0,t.length]),t,e)}function A(e){let{y:r}=t.ed25519.ExtendedPoint.fromHex(e),n=BigInt(1);return E.toBytes(E.create((n+r)*E.inv(n-r)))}function I(e){let t=S.hash(e.subarray(0,32));return S.adjustScalarBytes(t).subarray(0,32)}t.ed25519=(0,s.twistedEdwards)(S),t.ed25519ctx=(0,s.twistedEdwards)({...S,domain:x}),t.ed25519ph=(0,s.twistedEdwards)(Object.assign({},S,{domain:x,prehash:n.sha512})),t.x25519=(0,u.montgomery)({P:d,a:BigInt(486662),montgomeryBits:255,nByteLength:32,Gu:BigInt(9),powPminus2:e=>{let t=d,{pow_p_5_8:r,b2:n}=v(e);return(0,c.mod)((0,c.pow2)(r,g,t)*n,t)},adjustScalarBytes:w,randomBytes:i.randomBytes}),t.edwardsToMontgomery=A;let O=(E.ORDER+g)/b,T=E.pow(y,O),P=E.sqrt(E.neg(E.ONE));function M(e){let t=(E.ORDER-m)/b,r=BigInt(486662),n=E.sqr(e);n=E.mul(n,y);let i=E.add(n,E.ONE),o=E.neg(r),s=E.sqr(i),a=E.mul(s,i),c=E.mul(n,r);c=E.mul(c,o),c=E.add(c,s),c=E.mul(c,o);let u=E.sqr(a);s=E.sqr(u),u=E.mul(u,a),u=E.mul(u,c),s=E.mul(s,u);let l=E.pow(s,t);l=E.mul(l,u);let d=E.mul(l,P);s=E.sqr(l),s=E.mul(s,a);let f=E.eql(s,c),h=E.cmov(d,l,f),g=E.mul(o,n),v=E.mul(l,e);v=E.mul(v,T);let w=E.mul(v,P),_=E.mul(c,n);s=E.sqr(v),s=E.mul(s,a);let S=E.eql(s,_),x=E.cmov(w,v,S);s=E.sqr(h),s=E.mul(s,a);let A=E.eql(s,c),I=E.cmov(g,o,A),O=E.cmov(x,h,A),M=E.isOdd(O);return{xMn:I,xMd:i,yMn:O=E.cmov(O,E.neg(O),A!==M),yMd:p}}let N=(0,c.FpSqrtEven)(E,E.neg(BigInt(486664)));function k(e){let{xMn:t,xMd:r,yMn:n,yMd:i}=M(e),o=E.mul(t,i);o=E.mul(o,N);let s=E.mul(r,n),a=E.sub(t,r),c=E.add(t,r),u=E.mul(s,c),l=E.eql(u,E.ZERO);o=E.cmov(o,E.ZERO,l),s=E.cmov(s,E.ONE,l),a=E.cmov(a,E.ONE,l),c=E.cmov(c,E.ONE,l);let d=E.invertBatch([s,c]);return{x:E.mul(o,d[0]),y:E.mul(a,d[1])}}let C=(0,a.createHasher)(t.ed25519.ExtendedPoint,e=>k(e[0]),{DST:"edwards25519_XMD:SHA-512_ELL2_RO_",encodeDST:"edwards25519_XMD:SHA-512_ELL2_NU_",p:E.ORDER,m:1,k:128,expand:"xmd",hash:n.sha512});function D(e){if(!(e instanceof q))throw Error("RistrettoPoint expected")}t.hashToCurve=C.hashToCurve,t.encodeToCurve=C.encodeToCurve;let j=f,R=BigInt("25063068953384623474111414158702152701244531502492656460079210482610430750235"),L=BigInt("54469307008909316920995813868745141605393597292927456921205312896311721017578"),B=BigInt("1159843021668779879193775521855586647937357759715417654439879720876111806838"),U=BigInt("40440834346308536858101042469323190826248399146238708352240133220865137265952"),$=e=>_(p,e),K=BigInt("0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff"),F=e=>t.ed25519.CURVE.Fp.create((0,l.bytesToNumberLE)(e)&K);function z(e){let{d:r}=t.ed25519.CURVE,n=t.ed25519.CURVE.Fp.ORDER,i=t.ed25519.CURVE.Fp.create,o=i(j*e*e),s=i((o+p)*B),a=BigInt(-1),u=i((a-r*o)*i(o+r)),{isValid:l,value:d}=_(s,u),f=i(d*e);(0,c.isNegativeLE)(f,n)||(f=i(-f)),l||(d=f),l||(a=o);let h=i(a*(o-p)*U-u),y=d*d,g=i((d+d)*u),m=i(h*R),b=i(p-y),v=i(p+y);return new t.ed25519.ExtendedPoint(i(g*v),i(b*m),i(m*v),i(g*b))}class q{constructor(e){this.ep=e}static fromAffine(e){return new q(t.ed25519.ExtendedPoint.fromAffine(e))}static hashToCurve(e){let t=z(F((e=(0,l.ensureBytes)("ristrettoHash",e,64)).slice(0,32))),r=z(F(e.slice(32,64)));return new q(t.add(r))}static fromHex(e){e=(0,l.ensureBytes)("ristrettoHex",e,32);let{a:r,d:n}=t.ed25519.CURVE,i=t.ed25519.CURVE.Fp.ORDER,o=t.ed25519.CURVE.Fp.create,s="RistrettoPoint.fromHex: the hex is not val
1id encoding of RistrettoPoint",a=F(e);if(!(0,l.equalBytes)((0,l.numberToBytesLE)(a,32),e)||(0,c.isNegativeLE)(a,i))throw Error(s);let u=o(a*a),d=o(p+r*u),f=o(p-r*u),y=o(d*d),g=o(f*f),m=o(r*n*y-g),{isValid:b,value:v}=$(o(m*g)),w=o(v*f),_=o(v*w*m),E=o((a+a)*w);(0,c.isNegativeLE)(E,i)&&(E=o(-E));let S=o(d*_),x=o(E*S);if(!b||(0,c.isNegativeLE)(x,i)||S===h)throw Error(s);return new q(new t.ed25519.ExtendedPoint(E,S,p,x))}static msm(e,r){let n=(0,c.Field)(t.ed25519.CURVE.n,t.ed25519.CURVE.nBitLength);return(0,o.pippenger)(q,n,e,r)}toRawBytes(){let e,{ex:r,ey:n,ez:i,et:o}=this.ep,s=t.ed25519.CURVE.Fp.ORDER,a=t.ed25519.CURVE.Fp.create,u=a(a(i+n)*a(i-n)),d=a(r*n),f=a(d*d),{value:h}=$(a(u*f)),p=a(h*u),y=a(h*d),g=a(p*y*o);if((0,c.isNegativeLE)(o*g,s)){let t=a(n*j),i=a(r*j);r=t,n=i,e=a(p*L)}else e=y;(0,c.isNegativeLE)(r*g,s)&&(n=a(-n));let m=a((i-n)*e);return(0,c.isNegativeLE)(m,s)&&(m=a(-m)),(0,l.numberToBytesLE)(m,32)}toHex(){return(0,l.bytesToHex)(this.toRawBytes())}toString(){return this.toHex()}equals(e){D(e);let{ex:r,ey:n}=this.ep,{ex:i,ey:o}=e.ep,s=t.ed25519.CURVE.Fp.create,a=s(r*o)===s(n*i),c=s(n*o)===s(r*i);return a||c}add(e){return D(e),new q(this.ep.add(e.ep))}subtract(e){return D(e),new q(this.ep.subtract(e.ep))}multiply(e){return new q(this.ep.multiply(e))}multiplyUnsafe(e){return new q(this.ep.multiplyUnsafe(e))}double(){return new q(this.ep.double())}negate(){return new q(this.ep.negate())}}t.RistrettoPoint=(q.BASE||(q.BASE=new q(t.ed25519.ExtendedPoint.BASE)),q.ZERO||(q.ZERO=new q(t.ed25519.ExtendedPoint.ZERO)),q);let V=(e,t)=>{let r=t.DST,o="string"==typeof r?(0,i.utf8ToBytes)(r):r,s=(0,a.expand_message_xmd)(e,o,64,n.sha512);return q.hashToCurve(s)};t.hashToRistretto255=V,t.hash_to_ristretto255=t.hashToRistretto255},40040:(e,t)=>{"use strict";function r(e){if(!Number.isSafeInteger(e)||e<0)throw Error("positive integer expected, got "+e)}function n(e){return e instanceof Uint8Array||ArrayBuffer.isView(e)&&"Uint8Array"===e.constructor.name}function i(e,...t){if(!n(e))throw Error("Uint8Array expected");if(t.length>0&&!t.includes(e.length))throw Error("Uint8Array expected of length "+t+", got length="+e.length)}function o(e){if("function"!=typeof e||"function"!=typeof e.create)throw Error("Hash should be wrapped by utils.wrapConstructor");r(e.outputLen),r(e.blockLen)}function s(e,t=!0){if(e.destroyed)throw Error("Hash instance has been destroyed");if(t&&e.finished)throw Error("Hash#digest() has already been called")}function a(e,t){i(e);let r=t.outputLen;if(e.length<r)throw Error("digestInto() expects output buffer of length at least "+r)}Object.defineProperty(t,"__esModule",{value:!0}),t.anumber=r,t.abytes=i,t.ahash=o,t.aexists=s,t.aoutput=a},1655:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.HashMD=void 0,t.setBigUint64=o,t.Chi=s,t.Maj=a;let n=r(40040),i=r(4954);function o(e,t,r,n){if("function"==typeof e.setBigUint64)return e.setBigUint64(t,r,n);let i=BigInt(32),o=BigInt(0xffffffff),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)}function s(e,t,r){return e&t^~e&r}function a(e,t,r){return e&t^e&r^t&r}class c extends i.Hash{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=(0,i.createView)(this.buffer)}update(e){(0,n.aexists)(this);let{view:t,buffer:r,blockLen:o}=this,s=(e=(0,i.toBytes)(e)).length;for(let n=0;n<s;){let a=Math.min(o-this.pos,s-n);if(a===o){let t=(0,i.createView)(e);for(;o<=s-n;n+=o)this.process(t,n);continue}r.set(e.subarray(n,n+a),this.pos),this.pos+=a,n+=a,this.pos===o&&(this.process(t,0),this.pos=0)}return this.length+=e.length,this.roundClean(),this}digestInto(e){(0,n.aexists)(this),(0,n.aoutput)(e,this),this.finished=!0;let{buffer:t,view:r,blockLen:s,isLE:a}=this,{pos:c}=this;t[c++]=128,this.buffer.subarray(c).fill(0),this.padOffset>s-c&&(this.process(r,0),c=0);for(let e=c;e<s;e++)t[e]=0;o(r,s-8,BigInt(8*this.length),a),this.process(r,0);let u=(0,i.createView)(e),l=this.outputLen;if(l%4)throw Error("_sha2: outputLen should be aligned to 32bit");let d=l/4,f=this.get();if(d>f.length)throw Error("_sha2: outputLen bigger than state");for(let e=0;e<d;e++)u.setUint32(4*e,f[e],a)}digest(){let{buffer:e,outputLen:t}=this;this.digestInto(e);let r=e.slice(0,t);return this.destroy(),r}_cloneInto(e){e||(e=new this.constructor),e.set(...this.get());let{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}}t.HashMD=c},13171:(e,t)=>{"use strict";
1Object.defineProperty(t,"__esModule",{value:!0}),t.add5L=t.add5H=t.add4H=t.add4L=t.add3H=t.add3L=t.rotlBL=t.rotlBH=t.rotlSL=t.rotlSH=t.rotr32L=t.rotr32H=t.rotrBL=t.rotrBH=t.rotrSL=t.rotrSH=t.shrSL=t.shrSH=t.toBig=void 0,t.fromBig=i,t.split=o,t.add=v;let r=BigInt(0x100000000-1),n=BigInt(32);function i(e,t=!1){return t?{h:Number(e&r),l:Number(e>>n&r)}:{h:0|Number(e>>n&r),l:0|Number(e&r)}}function o(e,t=!1){let r=new Uint32Array(e.length),n=new Uint32Array(e.length);for(let o=0;o<e.length;o++){let{h:s,l:a}=i(e[o],t);[r[o],n[o]]=[s,a]}return[r,n]}let s=(e,t)=>BigInt(e>>>0)<<n|BigInt(t>>>0);t.toBig=s;let a=(e,t,r)=>e>>>r;t.shrSH=a;let c=(e,t,r)=>e<<32-r|t>>>r;t.shrSL=c;let u=(e,t,r)=>e>>>r|t<<32-r;t.rotrSH=u;let l=(e,t,r)=>e<<32-r|t>>>r;t.rotrSL=l;let d=(e,t,r)=>e<<64-r|t>>>r-32;t.rotrBH=d;let f=(e,t,r)=>e>>>r-32|t<<64-r;t.rotrBL=f;let h=(e,t)=>t;t.rotr32H=h;let p=(e,t)=>e;t.rotr32L=p;let y=(e,t,r)=>e<<r|t>>>32-r;t.rotlSH=y;let g=(e,t,r)=>t<<r|e>>>32-r;t.rotlSL=g;let m=(e,t,r)=>t<<r-32|e>>>64-r;t.rotlBH=m;let b=(e,t,r)=>e<<r-32|t>>>64-r;function v(e,t,r,n){let i=(t>>>0)+(n>>>0);return{h:e+r+(i/0x100000000|0)|0,l:0|i}}t.rotlBL=b;let w=(e,t,r)=>(e>>>0)+(t>>>0)+(r>>>0);t.add3L=w;let _=(e,t,r,n)=>t+r+n+(e/0x100000000|0)|0;t.add3H=_;let E=(e,t,r,n)=>(e>>>0)+(t>>>0)+(r>>>0)+(n>>>0);t.add4L=E;let S=(e,t,r,n,i)=>t+r+n+i+(e/0x100000000|0)|0;t.add4H=S;let x=(e,t,r,n,i)=>(e>>>0)+(t>>>0)+(r>>>0)+(n>>>0)+(i>>>0);t.add5L=x;let A=(e,t,r,n,i,o)=>t+r+n+i+o+(e/0x100000000|0)|0;t.add5H=A;let I={fromBig:i,split:o,toBig:s,shrSH:a,shrSL:c,rotrSH:u,rotrSL:l,rotrBH:d,rotrBL:f,rotr32H:h,rotr32L:p,rotlSH:y,rotlSL:g,rotlBH:m,rotlBL:b,add:v,add3L:w,add3H:_,add4L:E,add4H:S,add5H:A,add5L:x};t.default=I},25308:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.crypto=void 0,t.crypto="object"==typeof globalThis&&"crypto"in globalThis?globalThis.crypto:void 0},8123:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.sha384=t.sha512_256=t.sha512_224=t.sha512=t.SHA384=t.SHA512_256=t.SHA512_224=t.SHA512=void 0;let n=r(1655),i=r(13171),o=r(4954),[s,a]=i.default.split(["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","0xf40e3585
15771202a","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))),c=new Uint32Array(80),u=new Uint32Array(80);class l extends n.HashMD{constructor(){super(128,64,16,!1),this.Ah=0x6a09e667,this.Al=-0xc4336f8,this.Bh=-0x4498517b,this.Bl=-0x7b3558c5,this.Ch=0x3c6ef372,this.Cl=-0x16b07d5,this.Dh=-0x5ab00ac6,this.Dl=0x5f1d36f1,this.Eh=0x510e527f,this.El=-0x52197d2f,this.Fh=-0x64fa9774,this.Fl=0x2b3e6c1f,this.Gh=0x1f83d9ab,this.Gl=-0x4be4295,this.Hh=0x5be0cd19,this.Hl=0x137e2179}get(){let{Ah:e,Al:t,Bh:r,Bl:n,Ch:i,Cl:o,Dh:s,Dl:a,Eh:c,El:u,Fh:l,Fl:d,Gh:f,Gl:h,Hh:p,Hl:y}=this;return[e,t,r,n,i,o,s,a,c,u,l,d,f,h,p,y]}set(e,t,r,n,i,o,s,a,c,u,l,d,f,h,p,y){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|d,this.Gh=0|f,this.Gl=0|h,this.Hh=0|p,this.Hl=0|y}process(e,t){for(let r=0;r<16;r++,t+=4)c[r]=e.getUint32(t),u[r]=e.getUint32(t+=4);for(let e=16;e<80;e++){let t=0|c[e-15],r=0|u[e-15],n=i.default.rotrSH(t,r,1)^i.default.rotrSH(t,r,8)^i.default.shrSH(t,r,7),o=i.default.rotrSL(t,r,1)^i.default.rotrSL(t,r,8)^i.default.shrSL(t,r,7),s=0|c[e-2],a=0|u[e-2],l=i.default.rotrSH(s,a,19)^i.default.rotrBH(s,a,61)^i.default.shrSH(s,a,6),d=i.default.rotrSL(s,a,19)^i.default.rotrBL(s,a,61)^i.default.shrSL(s,a,6),f=i.default.add4L(o,d,u[e-7],u[e-16]),h=i.default.add4H(f,n,l,c[e-7],c[e-16]);c[e]=0|h,u[e]=0|f}let{Ah:r,Al:n,Bh:o,Bl:l,Ch:d,Cl:f,Dh:h,Dl:p,Eh:y,El:g,Fh:m,Fl:b,Gh:v,Gl:w,Hh:_,Hl:E}=this;for(let e=0;e<80;e++){let t=i.default.rotrSH(y,g,14)^i.default.rotrSH(y,g,18)^i.default.rotrBH(y,g,41),S=i.default.rotrSL(y,g,14)^i.default.rotrSL(y,g,18)^i.default.rotrBL(y,g,41),x=y&m^~y&v,A=g&b^~g&w,I=i.default.add5L(E,S,A,a[e],u[e]),O=i.default.add5H(I,_,t,x,s[e],c[e]),T=0|I,P=i.default.rotrSH(r,n,28)^i.default.rotrBH(r,n,34)^i.default.rotrBH(r,n,39),M=i.default.rotrSL(r,n,28)^i.default.rotrBL(r,n,34)^i.default.rotrBL(r,n,39),N=r&o^r&d^o&d,k=n&l^n&f^l&f;_=0|v,E=0|w,v=0|m,w=0|b,m=0|y,b=0|g,({h:y,l:g}=i.default.add(0|h,0|p,0|O,0|T)),h=0|d,p=0|f,d=0|o,f=0|l,o=0|r,l=0|n;let C=i.default.add3L(T,M,k);r=i.default.add3H(C,O,P,N),n=0|C}({h:r,l:n}=i.default.add(0|this.Ah,0|this.Al,0|r,0|n)),({h:o,l:l}=i.default.add(0|this.Bh,0|this.Bl,0|o,0|l)),({h:d,l:f}=i.default.add(0|this.Ch,0|this.Cl,0|d,0|f)),({h:h,l:p}=i.default.add(0|this.Dh,0|this.Dl,0|h,0|p)),({h:y,l:g}=i.default.add(0|this.Eh,0|this.El,0|y,0|g)),({h:m,l:b}=i.default.add(0|this.Fh,0|this.Fl,0|m,0|b)),({h:v,l:w}=i.default.add(0|this.Gh,0|this.Gl,0|v,0|w)),({h:_,l:E}=i.default.add(0|this.Hh,0|this.Hl,0|_,0|E)),this.set(r,n,o,l,d,f,h,p,y,g,m,b,v,w,_,E)}roundClean(){c.fill(0),u.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)}}t.SHA512=l;class d extends l{constructor(){super(),this.Ah=-0x73c2c838,this.Al=0x19544da2,this.Bh=0x73e19966,this.Bl=-0x76232b2a,this.Ch=0x1dfab7ae,this.Cl=0x32ff9c82,this.Dh=0x679dd514,this.Dl=0x582f9fcf,this.Eh=0xf6d2b69,this.El=0x7bd44da8,this.Fh=0x77e36f73,this.Fl=0x4c48942,this.Gh=0x3f9d85a8,this.Gl=0x6a1d36c8,this.Hh=0x1112e6ad,this.Hl=-0x6e296d5f,this.outputLen=28}}t.SHA512_224=d;class f extends l{constructor(){super(),this.Ah=0x22312194,this.Al=-0x3d408d4,this.Bh=-0x60aaa05d,this.Bl=-0x37b39b3e,this.Ch=0x2393b86b,this.Cl=0x6f53b151,this.Dh=-0x69c788e7,this.Dl=0x5940eabd,this.Eh=-0x69d7c11e,this.El=-0x5771001d,this.Fh=-0x41a1e1db,this.Fl=0x53863992,this.Gh=0x2b0199fc,this.Gl=0x2c85b8aa,this.Hh=0xeb72ddc,this.Hl=-0x7e3ad35e,this.outputLen=32}}t.SHA512_256=f;class h extends l{constructor(){super(),this.Ah=-0x344462a3,this.Al=-0x3efa6128,this.Bh=0x629a292a,this.Bl=0x367cd507,this.Ch=-0x6ea6fea6,this.Cl=0x3070dd17,this.Dh=0x152fecd8,this.Dl=-0x8f1a6c7,this.Eh=0x67332667,this.El=-4191439,this.Fh=-0x714bb579,this.Fl=0x68581511,this.Gh=-0x24f3d1f3,this.Gl=0x64f98fa7,this.Hh=0x47b5481d,this.Hl=-0x4105b05c,this.outputLen=48}}t.SHA384=h,t.sha512=(0,o.wrapConstructor)(()=>new l),t.sha512_224=(0,o.wrapConstructor)(()=>new d),t.sha512_256=(0,o.wrapConstructor)(()=>new f),t.sha384=(0,o.wrapConstructor)(()=>new h)},4954:(e,t,r)=>{"use strict";
1Object.defineProperty(t,"__esModule",{value:!0}),t.Hash=t.nextTick=t.byteSwapIfBE=t.isLE=void 0,t.isBytes=o,t.u8=s,t.u32=a,t.createView=c,t.rotr=u,t.rotl=l,t.byteSwap=d,t.byteSwap32=f,t.bytesToHex=p,t.hexToBytes=m,t.asyncLoop=v,t.utf8ToBytes=w,t.toBytes=_,t.concatBytes=E,t.checkOpts=x,t.wrapConstructor=A,t.wrapConstructorWithOpts=I,t.wrapXOFConstructorWithOpts=O,t.randomBytes=T;let n=r(25308),i=r(40040);function o(e){return e instanceof Uint8Array||ArrayBuffer.isView(e)&&"Uint8Array"===e.constructor.name}function s(e){return new Uint8Array(e.buffer,e.byteOffset,e.byteLength)}function a(e){return new Uint32Array(e.buffer,e.byteOffset,Math.floor(e.byteLength/4))}function c(e){return new DataView(e.buffer,e.byteOffset,e.byteLength)}function u(e,t){return e<<32-t|e>>>t}function l(e,t){return e<<t|e>>>32-t>>>0}function d(e){return e<<24&0xff000000|e<<8&0xff0000|e>>>8&65280|e>>>24&255}function f(e){for(let t=0;t<e.length;t++)e[t]=d(e[t])}t.isLE=68===new Uint8Array(new Uint32Array([0x11223344]).buffer)[0],t.byteSwapIfBE=t.isLE?e=>e:e=>d(e);let h=Array.from({length:256},(e,t)=>t.toString(16).padStart(2,"0"));function p(e){(0,i.abytes)(e);let t="";for(let r=0;r<e.length;r++)t+=h[e[r]];return t}let y={_0:48,_9:57,A:65,F:70,a:97,f:102};function g(e){return e>=y._0&&e<=y._9?e-y._0:e>=y.A&&e<=y.F?e-(y.A-10):e>=y.a&&e<=y.f?e-(y.a-10):void 0}function m(e){if("string"!=typeof e)throw Error("hex string expected, got "+typeof e);let t=e.length,r=t/2;if(t%2)throw Error("hex string expected, got unpadded hex of length "+t);let n=new Uint8Array(r);for(let t=0,i=0;t<r;t++,i+=2){let r=g(e.charCodeAt(i)),o=g(e.charCodeAt(i+1));if(void 0===r||void 0===o)throw Error('hex string expected, got non-hex character "'+(e[i]+e[i+1])+'" at index '+i);n[t]=16*r+o}return n}let b=async()=>{};async function v(e,r,n){let i=Date.now();for(let o=0;o<e;o++){n(o);let e=Date.now()-i;e>=0&&e<r||(await (0,t.nextTick)(),i+=e)}}function w(e){if("string"!=typeof e)throw Error("utf8ToBytes expected string, got "+typeof e);return new Uint8Array(new TextEncoder().encode(e))}function _(e){return"string"==typeof e&&(e=w(e)),(0,i.abytes)(e),e}function E(...e){let t=0;for(let r=0;r<e.length;r++){let n=e[r];(0,i.abytes)(n),t+=n.length}let r=new Uint8Array(t);for(let t=0,n=0;t<e.length;t++){let i=e[t];r.set(i,n),n+=i.length}return r}t.nextTick=b;class S{clone(){return this._cloneInto()}}function x(e,t){if(void 0!==t&&"[object Object]"!==({}).toString.call(t))throw Error("Options should be object or undefined");return Object.assign(e,t)}function A(e){let t=t=>e().update(_(t)).digest(),r=e();return t.outputLen=r.outputLen,t.blockLen=r.blockLen,t.create=()=>e(),t}function I(e){let t=(t,r)=>e(r).update(_(t)).digest(),r=e({});return t.outputLen=r.outputLen,t.blockLen=r.blockLen,t.create=t=>e(t),t}function O(e){let t=(t,r)=>e(r).update(_(t)).digest(),r=e({});return t.outputLen=r.outputLen,t.blockLen=r.blockLen,t.create=t=>e(t),t}function T(e=32){if(n.crypto&&"function"==typeof n.crypto.getRandomValues)return n.crypto.getRandomValues(new Uint8Array(e));if(n.crypto&&"function"==typeof n.crypto.randomBytes)return n.crypto.randomBytes(e);throw Error("crypto.getRandomValues must be defined")}t.Hash=S},65289:(e,t)=>{"use strict";function r(e){return e instanceof Uint8Array||ArrayBuffer.isView(e)&&"Uint8Array"===e.constructor.name}function n(e,...t){if(!r(e))throw Error("Uint8Array expected");if(t.length>0&&!t.includes(e.length))throw Error("Uint8Array expected of length "+t+", got length="+e.length)}function i(e,t){return!!Array.isArray(t)&&(0===t.length||(e?t.every(e=>"string"==typeof e):t.every(e=>Number.isSafeInteger(e))))}function o(e){if("function"!=typeof e)throw Error("function expected");return!0}function s(e,t){if("string"!=typeof t)throw Error(`${e}: string expected`);return!0}function a(e){if(!Number.isSafeInteger(e))throw Error(`invalid integer: ${e}`)}function c(e){if(!Array.isArray(e))throw Error("array expected")}function u(e,t){if(!i(!0,t))throw Error(`${e}: array of strings expected`)}function l(e,t){if(!i(!1,t))throw Error(`${e}: array of numbers expected`)}function d(...e){let t=e=>e,r=(e,t)=>r=>e(t(r));return{encode:e.map(e=>e.encode).reduceRight(r,t),decode:e.map(e=>e.decode).reduce(r,t)}}function f(e){let t="string"==typeof e?e.split(""):e,r=t.length;u("alphabet",t);let n=new Map(t.map((e,t)=>[e,t]));return{encode:n=>(c(n),n.map(n=>{if(!Number.isSafeInteger(n)||n<0||n>=r)throw Error(`alphabet.encode: digit index outside alphabet "${n}". Allowed: ${e}`);return t[n]})),decode:t=>(c(t),t.map(t=>{s("alphabet.decode",t);let r=n.get(t);if(void 0===r)throw Error(`Unknown letter: "${t}". Allowed: ${e}`);return r}))}}function h(e=""){return s("join",e),{encode:t=>(u("join.decode",t),t.join(e)),decode:t=>(s("join.decode",t),t.split(e))}}function p(e,t="="){return a(e),s("padding",t),{encode(r){for(u("padding.encode",r);r.length*e%8;)r.push(t);return r},decode(r){u("padding.decode",r);let n=r.length;if(n*e%8)throw Error("padding: invalid, string should have whole number of bytes");for(;n>0&&r[n-1]===t;n--)if((n-1)*e%8==0)throw Error("padding: invalid, string has too much padding");return r.slice(0,n)}}}function y(e){return o(e),{encode:e=>e,decode:t=>e(t)}}
1function g(e,t,r){if(t<2)throw Error(`convertRadix: invalid from=${t}, base cannot be less than 2`);if(r<2)throw Error(`convertRadix: invalid to=${r}, base cannot be less than 2`);if(c(e),!e.length)return[];let n=0,i=[],o=Array.from(e,e=>{if(a(e),e<0||e>=t)throw Error(`invalid integer: ${e}`);return e}),s=o.length;for(;;){let e=0,a=!0;for(let i=n;i<s;i++){let s=o[i],c=t*e,u=c+s;if(!Number.isSafeInteger(u)||c/t!==e||u-s!==c)throw Error("convertRadix: carry overflow");let l=u/r;e=u%r;let d=Math.floor(l);if(o[i]=d,!Number.isSafeInteger(d)||d*r+e!==u)throw Error("convertRadix: carry overflow");a&&(d?a=!1:n=i)}if(i.push(e),a)break}for(let t=0;t<e.length-1&&0===e[t];t++)i.push(0);return i.reverse()}Object.defineProperty(t,"__esModule",{value:!0}),t.bytes=t.stringToBytes=t.str=t.bytesToString=t.hex=t.utf8=t.bech32m=t.bech32=t.base58check=t.createBase58check=t.base58xmr=t.base58xrp=t.base58flickr=t.base58=t.base64urlnopad=t.base64url=t.base64nopad=t.base64=t.base32crockford=t.base32hexnopad=t.base32hex=t.base32nopad=t.base32=t.base16=t.utils=void 0;let m=(e,t)=>0===t?e:m(t,e%t),b=(e,t)=>e+(t-m(e,t)),v=(()=>{let e=[];for(let t=0;t<40;t++)e.push(2**t);return e})();function w(e,t,r,n){if(c(e),t<=0||t>32)throw Error(`convertRadix2: wrong from=${t}`);if(r<=0||r>32)throw Error(`convertRadix2: wrong to=${r}`);if(b(t,r)>32)throw Error(`convertRadix2: carry overflow from=${t} to=${r} carryBits=${b(t,r)}`);let i=0,o=0,s=v[t],u=v[r]-1,l=[];for(let n of e){if(a(n),n>=s)throw Error(`convertRadix2: invalid data word=${n} from=${t}`);if(i=i<<t|n,o+t>32)throw Error(`convertRadix2: carry overflow pos=${o} from=${t}`);for(o+=t;o>=r;o-=r)l.push((i>>o-r&u)>>>0);let e=v[o];if(void 0===e)throw Error("invalid carry");i&=e-1}if(i=i<<r-o&u,!n&&o>=t)throw Error("Excess padding");if(!n&&i>0)throw Error(`Non-zero padding: ${i}`);return n&&o>0&&l.push(i>>>0),l}function _(e){a(e);let t=256;return{encode:n=>{if(!r(n))throw Error("radix.encode input should be Uint8Array");return g(Array.from(n),t,e)},decode:r=>(l("radix.decode",r),Uint8Array.from(g(r,e,t)))}}function E(e,t=!1){if(a(e),e<=0||e>32)throw Error("radix2: bits should be in (0..32]");if(b(8,e)>32||b(e,8)>32)throw Error("radix2: carry overflow");return{encode:n=>{if(!r(n))throw Error("radix2.encode input should be Uint8Array");return w(Array.from(n),8,e,!t)},decode:r=>(l("radix2.decode",r),Uint8Array.from(w(r,e,8,t)))}}function S(e){return o(e),function(...t){try{return e.apply(null,t)}catch(e){}}}function x(e,t){return a(e),o(t),{encode(n){if(!r(n))throw Error("checksum.encode: input should be Uint8Array");let i=t(n).slice(0,e),o=new Uint8Array(n.length+e);return o.set(n),o.set(i,n.length),o},decode(n){if(!r(n))throw Error("checksum.decode: input should be Uint8Array");let i=n.slice(0,-e),o=n.slice(-e),s=t(i).slice(0,e);for(let t=0;t<e;t++)if(s[t]!==o[t])throw Error("Invalid checksum");return i}}}t.utils={alphabet:f,chain:d,checksum:x,convertRadix:g,convertRadix2:w,radix:_,radix2:E,join:h,padding:p},t.base16=d(E(4),f("0123456789ABCDEF"),h("")),t.base32=d(E(5),f("ABCDEFGHIJKLMNOPQRSTUVWXYZ234567"),p(5),h("")),t.base32nopad=d(E(5),f("ABCDEFGHIJKLMNOPQRSTUVWXYZ234567"),h("")),t.base32hex=d(E(5),f("0123456789ABCDEFGHIJKLMNOPQRSTUV"),p(5),h("")),t.base32hexnopad=d(E(5),f("0123456789ABCDEFGHIJKLMNOPQRSTUV"),h("")),t.base32crockford=d(E(5),f("0123456789ABCDEFGHJKMNPQRSTVWXYZ"),h(""),y(e=>e.toUpperCase().replace(/O/g,"0").replace(/[IL]/g,"1")));let A="function"==typeof Uint8Array.from([]).toBase64&&"function"==typeof Uint8Array.fromBase64,I=(e,t)=>{s("base64",e);let r=t?/^[A-Za-z0-9=_-]+$/:/^[A-Za-z0-9=+/]+$/,n=t?"base64url":"base64";if(e.length>0&&!r.test(e))throw Error("invalid base64");return Uint8Array.fromBase64(e,{alphabet:n,lastChunkHandling:"strict"})};t.base64=A?{encode:e=>(n(e),e.toBase64()),decode:e=>I(e,!1)}:d(E(6),f("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"),p(6),h("")),t.base64nopad=d(E(6),f("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"),h("")),t.base64url=A?{encode:e=>(n(e),e.toBase64({alphabet:"base64url"})),decode:e=>I(e,!0)}:d(E(6),f("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_"),p(6),h("")),t.base64urlnopad=d(E(6),f("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_"),h(""));let O=e=>d(_(58),f(e),h(""));t.base58=O("123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"),t.base58flickr=O("123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ"),t.base58xrp=O("rpshnaf39wBUDNEGHJKLM4PQRST7VWXYZ2bcdeCg65jkm8oFqi1tuvAxyz");let T=[0,2,3,5,6,7,9,10,11];t.base58xmr={encode(e){let r="";for(let n=0;n<e.length;n+=8){let i=e.subarray(n,n+8);r+=t.base58.encode(i).padStart(T[i.length],"1")}return r},decode(e){let r=[];for(let n=0;n<e.length;n+=11){let i=e.slice(n,n+11),o=T.indexOf(i.length),s=t.base58.decode(i);for(let e=0;e<s.length-o;e++)if(0!==s[e])throw Error("base58xmr: wrong padding");r=r.concat(Array.from(s.slice(s.length-o)))}return Uint8Array.from(r)}};let P=e=>d(x(4,t=>e(e(t))),t.base58);t.createBase58check=P,t.base58check=t.createBase58check;
1let M=d(f("qpzry9x8gf2tvdw0s3jn54khce6mua7l"),h("")),N=[0x3b6a57b2,0x26508e6d,0x1ea119fa,0x3d4233dd,0x2a1462b3];function k(e){let t=e>>25,r=(0x1ffffff&e)<<5;for(let e=0;e<N.length;e++)(t>>e&1)==1&&(r^=N[e]);return r}function C(e,t,r=1){let n=e.length,i=1;for(let t=0;t<n;t++){let r=e.charCodeAt(t);if(r<33||r>126)throw Error(`Invalid prefix (${e})`);i=k(i)^r>>5}i=k(i);for(let t=0;t<n;t++)i=k(i)^31&e.charCodeAt(t);for(let e of t)i=k(i)^e;for(let e=0;e<6;e++)i=k(i);return i^=r,M.encode(w([i%v[30]],30,5,!1))}function D(e){let t="bech32"===e?1:0x2bc830a3,n=E(5),i=n.decode,o=n.encode,a=S(i);function c(e,n,i=90){s("bech32.encode prefix",e),r(n)&&(n=Array.from(n)),l("bech32.encode",n);let o=e.length;if(0===o)throw TypeError(`Invalid prefix length ${o}`);let a=o+7+n.length;if(!1!==i&&a>i)throw TypeError(`Length ${a} exceeds limit ${i}`);let u=e.toLowerCase(),d=C(u,n,t);return`${u}1${M.encode(n)}${d}`}function u(e,r=90){s("bech32.decode input",e);let n=e.length;if(n<8||!1!==r&&n>r)throw TypeError(`invalid string length: ${n} (${e}). Expected (8..${r})`);let i=e.toLowerCase();if(e!==i&&e!==e.toUpperCase())throw Error("String must be lowercase or uppercase");let o=i.lastIndexOf("1");if(0===o||-1===o)throw Error('Letter "1" must be present between prefix and data only');let a=i.slice(0,o),c=i.slice(o+1);if(c.length<6)throw Error("Data must be at least 6 characters long");let l=M.decode(c).slice(0,-6),d=C(a,l,t);if(!c.endsWith(d))throw Error(`Invalid checksum in ${e}: expected "${d}"`);return{prefix:a,words:l}}let d=S(u);function f(e){let{prefix:t,words:r}=u(e,!1);return{prefix:t,words:r,bytes:i(r)}}function h(e,t){return c(e,o(t))}return{encode:c,decode:u,encodeFromBytes:h,decodeToBytes:f,decodeUnsafe:d,fromWords:i,fromWordsUnsafe:a,toWords:o}}t.bech32=D("bech32"),t.bech32m=D("bech32m"),t.utf8={encode:e=>new TextDecoder().decode(e),decode:e=>new TextEncoder().encode(e)};let j="function"==typeof Uint8Array.from([]).toHex&&"function"==typeof Uint8Array.fromHex,R={encode:e=>(n(e),e.toHex()),decode:e=>(s("hex",e),Uint8Array.fromHex(e))};t.hex=j?R:d(E(4),f("0123456789abcdef"),h(""),y(e=>{if("string"!=typeof e||e.length%2!=0)throw TypeError(`hex.decode: expected string, got ${typeof e} with length ${e.length}`);return e.toLowerCase()}));let L={utf8:t.utf8,hex:t.hex,base16:t.base16,base32:t.base32,base64:t.base64,base64url:t.base64url,base58:t.base58,base58xmr:t.base58xmr},B="Invalid encoding type. Available types: utf8, hex, base16, base32, base64, base64url, base58, base58xmr",U=(e,t)=>{if("string"!=typeof e||!L.hasOwnProperty(e))throw TypeError(B);if(!r(t))throw TypeError("bytesToString() expects Uint8Array");return L[e].encode(t)};t.bytesToString=U,t.str=t.bytesToString;let $=(e,t)=>{if(!L.hasOwnProperty(e))throw TypeError(B);if("string"!=typeof t)throw TypeError("stringToBytes() expects string");return L[e].decode(t)};t.stringToBytes=$,t.bytes=t.stringToBytes},32253:(e,t,r)=>{"use strict";function n(){return(null===r.g||void 0===r.g?void 0:r.g.crypto)||(null===r.g||void 0===r.g?void 0:r.g.msCrypto)||{}}function i(){let e=n();return e.subtle||e.webkitSubtle}function o(){return!!n()&&!!i()}Object.defineProperty(t,"__esModule",{value:!0}),t.isBrowserCryptoAvailable=t.getSubtleCrypto=t.getBrowerCrypto=void 0,t.getBrowerCrypto=n,t.getSubtleCrypto=i,t.isBrowserCryptoAvailable=o},6263:(e,t,r)=>{"use strict";var n=r(2818);function i(){return"undefined"==typeof document&&"undefined"!=typeof navigator&&"ReactNative"===navigator.product}function o(){return void 0!==n&&void 0!==n.versions&&void 0!==n.versions.node}function s(){return!i()&&!o()}Object.defineProperty(t,"__esModule",{value:!0}),t.isBrowser=t.isNode=t.isReactNative=void 0,t.isReactNative=i,t.isNode=o,t.isBrowser=s},24144:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});let n=r(44092);n.__exportStar(r(32253),t),n.__exportStar(r(6263),t)},44092:(e,t,r)=>{"use strict";r.r(t),r.d(t,{__assign:()=>o,__asyncDelegator:()=>w,__asyncGenerator:()=>v,__asyncValues:()=>_,__await:()=>b,__awaiter:()=>l,__classPrivateFieldGet:()=>A,__classPrivateFieldSet:()=>I,__createBinding:()=>f,__decorate:()=>a,__exportStar:()=>h,__extends:()=>i,__generator:()=>d,__importDefault:()=>x,__importStar:()=>
1S,__makeTemplateObject:()=>E,__metadata:()=>u,__param:()=>c,__read:()=>y,__rest:()=>s,__spread:()=>g,__spreadArrays:()=>m,__values:()=>p});var n=function(e,t){return(n=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)};function i(e,t){function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}var o=function(){return(o=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var i in t=arguments[r])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e}).apply(this,arguments)};function s(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&0>t.indexOf(n)&&(r[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var i=0,n=Object.getOwnPropertySymbols(e);i<n.length;i++)0>t.indexOf(n[i])&&Object.prototype.propertyIsEnumerable.call(e,n[i])&&(r[n[i]]=e[n[i]]);return r}function a(e,t,r,n){var i,o=arguments.length,s=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,r,n);else for(var a=e.length-1;a>=0;a--)(i=e[a])&&(s=(o<3?i(s):o>3?i(t,r,s):i(t,r))||s);return o>3&&s&&Object.defineProperty(t,r,s),s}function c(e,t){return function(r,n){t(r,n,e)}}function u(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)}function l(e,t,r,n){function i(e){return e instanceof r?e:new r(function(t){t(e)})}return new(r||(r=Promise))(function(r,o){function s(e){try{c(n.next(e))}catch(e){o(e)}}function a(e){try{c(n.throw(e))}catch(e){o(e)}}function c(e){e.done?r(e.value):i(e.value).then(s,a)}c((n=n.apply(e,t||[])).next())})}function d(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(e){return function(t){return c([e,t])}}function c(o){if(r)throw 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=(i=s.trys).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(e){o=[6,e],n=0}finally{r=i=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}}function f(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}function h(e,t){for(var r in e)"default"===r||t.hasOwnProperty(r)||(t[r]=e[r])}function p(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 TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function y(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,i,o=r.call(e),s=[];try{for(;(void 0===t||t-- >0)&&!(n=o.next()).done;)s.push(n.value)}catch(e){i={error:e}}finally{try{n&&!n.done&&(r=o.return)&&r.call(o)}finally{if(i)throw i.error}}return s}function g(){for(var e=[],t=0;t<arguments.length;t++)e=e.concat(y(arguments[t]));return e}function m(){for(var e=0,t=0,r=arguments.length;t<r;t++)e+=arguments[t].length;for(var n=Array(e),i=0,t=0;t<r;t++)for(var o=arguments[t],s=0,a=o.length;s<a;s++,i++)n[i]=o[s];return n}function b(e){return this instanceof b?(this.v=e,this):new b(e)}function v(e,t,r){if(!Symbol.asyncIterator)throw 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{c(i[e](t))}catch(e){d(o[0][3],e)}}function c(e){e.value instanceof b?Promise.resolve(e.value.v).then(u,l):d(o[0][2],e)}function u(e){a("next",e)}function l(e){a("throw",e)}function d(e,t){e(t),o.shift(),o.length&&a(o[0][0],o[0][1])}}function w(e){var t,r;return t={},n("next"),n("throw",function(e){throw e}),n("return"),t[Symbol.iterator]=function(){return this},t;function n(n,i){t[n]=e[n]?function(t){return(r=!r)?{value:b(e[n](t)),done:"return"===n}:i?i(t):t}:i}}function _(e){if(!Symbol.asyncIterator)throw TypeError("Symbol.asyncIterator is not defined.");var t,r=e[Symbol.asyncIterator];return r?r.call(e):(e=p(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,o){i(n,o,(t=e[r](t)).done,t.value)})}}function i(e,t,r,n){Promise.resolve(n).then(function(t){e({value:t,done:r})},t)}}function E(e,t){return Object.defineProperty?Object.defineProperty(e,"raw",{value:t}):e.raw=t,e}
1function S(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}function x(e){return e&&e.__esModule?e:{default:e}}function A(e,t){if(!t.has(e))throw TypeError("attempted to get private field on non-instance");return t.get(e)}function I(e,t,r){if(!t.has(e))throw TypeError("attempted to set private field on non-instance");return t.set(e,r),r}},89571:(e,t,r)=>{"use strict";let n,i,o,s,a,c,u;r.d(t,{Ay:()=>w2});var l={};r.r(l),r.d(l,{identity:()=>sj});var d={};r.r(d),r.d(d,{base2:()=>sR});var f={};r.r(f),r.d(f,{base8:()=>sL});var h={};r.r(h),r.d(h,{base10:()=>sB});var p={};r.r(p),r.d(p,{base16:()=>sU,base16upper:()=>s$});var y={};r.r(y),r.d(y,{base32:()=>sK,base32hex:()=>sV,base32hexpad:()=>sG,base32hexpadupper:()=>sW,base32hexupper:()=>sH,base32pad:()=>sz,base32padupper:()=>sq,base32upper:()=>sF,base32z:()=>sJ});var g={};r.r(g),r.d(g,{base36:()=>sZ,base36upper:()=>sY});var m={};r.r(m),r.d(m,{base58btc:()=>sX,base58flickr:()=>sQ});var b={};r.r(b),r.d(b,{base64:()=>s0,base64pad:()=>s1,base64url:()=>s2,base64urlpad:()=>s5});var v={};r.r(v),r.d(v,{base256emoji:()=>s4});var w={};r.r(w),r.d(w,{sha256:()=>aA,sha512:()=>aI});var _={};r.r(_),r.d(_,{identity:()=>aM});var E={};r.r(E),r.d(E,{code:()=>ak,decode:()=>aD,encode:()=>aC,name:()=>aN});var S={};r.r(S),r.d(S,{code:()=>aB,decode:()=>a$,encode:()=>aU,name:()=>aL});var x=r(60429),A=r.n(x),I=r(99652);class O{}class T extends O{constructor(e){super()}}let P=I.FIVE_SECONDS,M={pulse:"heartbeat_pulse"};class N extends T{constructor(e){super(e),this.events=new x.EventEmitter,this.interval=P,this.interval=e?.interval||P}static async init(e){let t=new N(e);return await t.init(),t}async init(){await this.initialize()}stop(){clearInterval(this.intervalRef)}on(e,t){this.events.on(e,t)}once(e,t){this.events.once(e,t)}off(e,t){this.events.off(e,t)}removeListener(e,t){this.events.removeListener(e,t)}async initialize(){this.intervalRef=setInterval(()=>this.pulse(),(0,I.toMiliseconds)(this.interval))}pulse(){this.events.emit(M.pulse)}}let k=/"(?:_|\\u0{2}5[Ff]){2}(?:p|\\u0{2}70)(?:r|\\u0{2}72)(?:o|\\u0{2}6[Ff])(?:t|\\u0{2}74)(?:o|\\u0{2}6[Ff])(?:_|\\u0{2}5[Ff]){2}"\s*:/,C=/"(?:c|\\u0063)(?:o|\\u006[Ff])(?:n|\\u006[Ee])(?:s|\\u0073)(?:t|\\u0074)(?:r|\\u0072)(?:u|\\u0075)(?:c|\\u0063)(?:t|\\u0074)(?:o|\\u006[Ff])(?:r|\\u0072)"\s*:/,D=/^\s*["[{]|^\s*-?\d{1,16}(\.\d{1,17})?([Ee][+-]?\d+)?\s*$/;function j(e,t){if("__proto__"===e||"constructor"===e&&t&&"object"==typeof t&&"prototype"in t){R(e);return}return t}function R(e){console.warn(`[destr] Dropping "${e}" key to prevent prototype pollution.`)}function L(e,t={}){if("string"!=typeof e)return e;if('"'===e[0]&&'"'===e[e.length-1]&&-1===e.indexOf("\\"))return e.slice(1,-1);let r=e.trim();if(r.length<=9)switch(r.toLowerCase()){case"true":return!0;case"false":return!1;case"undefined":return;case"null":return null;case"nan":return Number.NaN;case"infinity":return Number.POSITIVE_INFINITY;case"-infinity":return Number.NEGATIVE_INFINITY}if(!D.test(e)){if(t.strict)throw SyntaxError("[destr] Invalid JSON");return e}try{if(k.test(e)||C.test(e)){if(t.strict)throw Error("[destr] Possible prototype pollution");return JSON.parse(e,j)}return JSON.parse(e)}catch(r){if(t.strict)throw r;return e}}var B=r(75927).Buffer;function U(e){return e&&"function"==typeof e.then?e:Promise.resolve(e)}function $(e,...t){try{return U(e(...t))}catch(e){return Promise.reject(e)}}function K(e){let t=typeof e;return null===e||"object"!==t&&"function"!==t}function F(e){let t=Object.getPrototypeOf(e);return!t||t.isPrototypeOf(Object)}function z(e){if(K(e))return String(e);if(F(e)||Array.isArray(e))return JSON.stringify(e);if("function"==typeof e.toJSON)return z(e.toJSON());throw Error("[unstorage] Cannot stringify value!")}let q="base64:";function V(e){return"string"==typeof e?e:q+W(e)}function H(e){return"string"==typeof e&&e.startsWith(q)?G(e.slice(q.length)):e}function G(e){return globalThis.Buffer?B.from(e,"base64"):Uint8Array.from(globalThis.atob(e),e=>e.codePointAt(0))}function W(e){return globalThis.Buffer?B.from(e).toString("base64"):globalThis.btoa(String.fromCodePoint(...e))}function J(e){return e&&e.split("?")[0]?.replace(/[/\\]/g,":").replace(/:+/g,":").replace(/^:|:$/g,"")||""}function Z(...e){return J(e.join(":"))}function Y(e){return(e=J(e))?e+":":""}function X(e,t){if(void 0===t)return!0;let r=0,n=e.indexOf(":");for(;n>-1;)r++,n=e.indexOf(":",n+1);return r<=t}function Q(e,t){return t?e.startsWith(t)&&"$"!==e[e.length-1]:"$"!==e[e.length-1]}let ee="memory",et=()=>{let e=new Map;return{name:ee,getInstance:()=>e,hasItem:t=>e.has(t),getItem:t=>e.get(t)??null,getItemRaw:t=>e.get(t)??null,setItem(t,r){e.set(t,r)},setItemRaw(t,r){e.set(t,r)},removeItem(t){e.delete(t)},getKeys:()=>[...e.keys()],clear(){e.clear()},dispose(){e.clear()}}};function er(e={}){let t={mounts:{"":e.driver||et()},mountpoints:[""],watching:!1,watchListeners:[],unwatch:{}}
1,r=e=>{for(let r of t.mountpoints)if(e.startsWith(r))return{base:r,relativeKey:e.slice(r.length),driver:t.mounts[r]};return{base:"",relativeKey:e,driver:t.mounts[""]}},n=(e,r)=>t.mountpoints.filter(t=>t.startsWith(e)||r&&e.startsWith(t)).map(r=>({relativeBase:e.length>r.length?e.slice(r.length):void 0,mountpoint:r,driver:t.mounts[r]})),i=(e,r)=>{if(t.watching)for(let n of(r=J(r),t.watchListeners))n(e,r)},o=async()=>{if(!t.watching)for(let e in t.watching=!0,t.mounts)t.unwatch[e]=await en(t.mounts[e],i,e)},s=async()=>{if(t.watching){for(let e in t.unwatch)await t.unwatch[e]();t.unwatch={},t.watching=!1}},a=(e,t,n)=>{let i=new Map,o=e=>{let t=i.get(e.base);return t||(t={driver:e.driver,base:e.base,items:[]},i.set(e.base,t)),t};for(let n of e){let e="string"==typeof n,i=J(e?n:n.key),s=e?void 0:n.value,a=e||!n.options?t:{...t,...n.options},c=r(i);o(c).items.push({key:i,value:s,relativeKey:c.relativeKey,options:a})}return Promise.all([...i.values()].map(e=>n(e))).then(e=>e.flat())},c={hasItem(e,t={}){let{relativeKey:n,driver:i}=r(e=J(e));return $(i.hasItem,n,t)},getItem(e,t={}){let{relativeKey:n,driver:i}=r(e=J(e));return $(i.getItem,n,t).then(e=>L(e))},getItems:(e,t={})=>a(e,t,e=>e.driver.getItems?$(e.driver.getItems,e.items.map(e=>({key:e.relativeKey,options:e.options})),t).then(t=>t.map(t=>({key:Z(e.base,t.key),value:L(t.value)}))):Promise.all(e.items.map(t=>$(e.driver.getItem,t.relativeKey,t.options).then(e=>({key:t.key,value:L(e)}))))),getItemRaw(e,t={}){let{relativeKey:n,driver:i}=r(e=J(e));return i.getItemRaw?$(i.getItemRaw,n,t):$(i.getItem,n,t).then(e=>H(e))},async setItem(e,t,n={}){if(void 0===t)return c.removeItem(e);let{relativeKey:o,driver:s}=r(e=J(e));s.setItem&&(await $(s.setItem,o,z(t),n),s.watch||i("update",e))},async setItems(e,t){await a(e,t,async e=>{if(e.driver.setItems)return $(e.driver.setItems,e.items.map(e=>({key:e.relativeKey,value:z(e.value),options:e.options})),t);e.driver.setItem&&await Promise.all(e.items.map(t=>$(e.driver.setItem,t.relativeKey,z(t.value),t.options)))})},async setItemRaw(e,t,n={}){if(void 0===t)return c.removeItem(e,n);let{relativeKey:o,driver:s}=r(e=J(e));if(s.setItemRaw)await $(s.setItemRaw,o,t,n);else{if(!s.setItem)return;await $(s.setItem,o,V(t),n)}s.watch||i("update",e)},async removeItem(e,t={}){"boolean"==typeof t&&(t={removeMeta:t});let{relativeKey:n,driver:o}=r(e=J(e));o.removeItem&&(await $(o.removeItem,n,t),(t.removeMeta||t.removeMata)&&await $(o.removeItem,n+"$",t),o.watch||i("remove",e))},async getMeta(e,t={}){"boolean"==typeof t&&(t={nativeOnly:t});let{relativeKey:n,driver:i}=r(e=J(e)),o=Object.create(null);if(i.getMeta&&Object.assign(o,await $(i.getMeta,n,t)),!t.nativeOnly){let e=await $(i.getItem,n+"$",t).then(e=>L(e));e&&"object"==typeof e&&("string"==typeof e.atime&&(e.atime=new Date(e.atime)),"string"==typeof e.mtime&&(e.mtime=new Date(e.mtime)),Object.assign(o,e))}return o},setMeta(e,t,r={}){return this.setItem(e+"$",t,r)},removeMeta(e,t={}){return this.removeItem(e+"$",t)},async getKeys(e,t={}){let r=n(e=Y(e),!0),i=[],o=[],s=!0;for(let e of r){for(let r of(e.driver.flags?.maxDepth||(s=!1),await $(e.driver.getKeys,e.relativeBase,t))){let t=e.mountpoint+J(r);i.some(e=>t.startsWith(e))||o.push(t)}i=[e.mountpoint,...i.filter(t=>!t.startsWith(e.mountpoint))]}let a=void 0!==t.maxDepth&&!s;return o.filter(r=>(!a||X(r,t.maxDepth))&&Q(r,e))},async clear(e,t={}){e=Y(e),await Promise.all(n(e,!1).map(async e=>e.driver.clear?$(e.driver.clear,e.relativeBase,t):e.driver.removeItem?Promise.all((await e.driver.getKeys(e.relativeBase||"",t)).map(r=>e.driver.removeItem(r,t))):void 0))},async dispose(){await Promise.all(Object.values(t.mounts).map(e=>ei(e)))},watch:async e=>(await o(),t.watchListeners.push(e),async()=>{t.watchListeners=t.watchListeners.filter(t=>t!==e),0===t.watchListeners.length&&await s()}),async unwatch(){t.watchListeners=[],await s()},mount(e,r){if((e=Y(e))&&t.mounts[e])throw Error(`already mounted at ${e}`);return e&&(t.mountpoints.push(e),t.mountpoints.sort((e,t)=>t.length-e.length)),t.mounts[e]=r,t.watching&&Promise.resolve(en(r,i,e)).then(r=>{t.unwatch[e]=r}).catch(console.error),c},async unmount(e,r=!0){(e=Y(e))&&t.mounts[e]&&(t.watching&&e in t.unwatch&&(t.unwatch[e]?.(),delete t.unwatch[e]),r&&await ei(t.mounts[e]),t.mountpoints=t.mountpoints.filter(t=>t!==e),delete t.mounts[e])},getMount(e=""){let t=r(e=J(e)+":");return{driver:t.driver,base:t.base}},getMounts:(e="",t={})=>n(e=J(e),t.parents).map(e=>({driver:e.driver,base:e.mountpoint})),keys:(e,t={})=>c.getKeys(e,t),get:(e,t={})=>c.getItem(e,t),set:(e,t,r={})=>c.setItem(e,t,r),has:(e,t={})=>c.hasItem(e,t),del:(e,t={})=>c.removeItem(e,t),remove:(e,t={})=>c.removeItem(e,t)};return c}function en(e,t,r){return e.watch?e.watch((e,n)=>t(e,r+n)):()=>{}}async function ei(e){"function"==typeof e.dispose&&await $(e.dispose)}function eo(e){return new Promise((t,r)=>{e.oncomplete=e.onsuccess=()=>t(e.result),e.onabort=e.onerror=()=>r(e.error)})}function es(e,t){let r;let n=()=>
1{if(r)return r;let n=indexedDB.open(e);return n.onupgradeneeded=()=>n.result.createObjectStore(t),(r=eo(n)).then(e=>{e.onclose=()=>r=void 0},()=>{}),r};return(e,r)=>n().then(n=>r(n.transaction(t,e).objectStore(t)))}function ea(){return n||(n=es("keyval-store","keyval")),n}function ec(e,t=ea()){return t("readonly",t=>eo(t.get(e)))}function eu(e,t,r=ea()){return r("readwrite",r=>(r.put(t,e),eo(r.transaction)))}function el(e,t=ea()){return t("readwrite",t=>(t.delete(e),eo(t.transaction)))}function ed(e=ea()){return e("readwrite",e=>(e.clear(),eo(e.transaction)))}function ef(e,t){return e.openCursor().onsuccess=function(){this.result&&(t(this.result),this.result.continue())},eo(e.transaction)}function eh(e=ea()){return e("readonly",e=>{if(e.getAllKeys)return eo(e.getAllKeys());let t=[];return ef(e,e=>t.push(e.key)).then(()=>t)})}let ep=e=>JSON.stringify(e,(e,t)=>"bigint"==typeof t?t.toString()+"n":t),ey=e=>{let t=/([\[:])?(\d{17,}|(?:[9](?:[1-9]07199254740991|0[1-9]7199254740991|00[8-9]199254740991|007[2-9]99254740991|007199[3-9]54740991|0071992[6-9]4740991|00719925[5-9]740991|007199254[8-9]40991|0071992547[5-9]0991|00719925474[1-9]991|00719925474099[2-9])))([,\}\]])/g;return JSON.parse(e.replace(t,'$1"$2n"$3'),(e,t)=>"string"==typeof t&&t.match(/^\d+n$/)?BigInt(t.substring(0,t.length-1)):t)};function eg(e){if("string"!=typeof e)throw Error(`Cannot safe json parse value of type ${typeof e}`);try{return ey(e)}catch(t){return e}}function em(e){return"string"==typeof e?e:ep(e)||""}let eb="idb-keyval";var ev=(e={})=>{let t;let r=e.base&&e.base.length>0?`${e.base}:`:"",n=e=>r+e;return e.dbName&&e.storeName&&(t=es(e.dbName,e.storeName)),{name:eb,options:e,hasItem:async e=>!(typeof await ec(n(e),t)>"u"),getItem:async e=>await ec(n(e),t)??null,setItem:(e,r)=>eu(n(e),r,t),removeItem:e=>el(n(e),t),getKeys:()=>eh(t),clear:()=>ed(t)}};let ew="WALLET_CONNECT_V2_INDEXED_DB",e_="keyvaluestorage";class eE{constructor(){this.indexedDb=er({driver:ev({dbName:ew,storeName:e_})})}async getKeys(){return this.indexedDb.getKeys()}async getEntries(){return(await this.indexedDb.getItems(await this.indexedDb.getKeys())).map(e=>[e.key,e.value])}async getItem(e){let t=await this.indexedDb.getItem(e);if(null!==t)return t}async setItem(e,t){await this.indexedDb.setItem(e,em(t))}async removeItem(e){await this.indexedDb.removeItem(e)}}var eS="u">typeof globalThis?globalThis:"u">typeof window?window:"u">typeof r.g?r.g:"u">typeof self?self:{},ex={exports:{}};function eA(e){var t;return[e[0],eg(null!=(t=e[1])?t:"")]}!function(){let e;function t(){}(e=t).prototype.getItem=function(e){return this.hasOwnProperty(e)?String(this[e]):null},e.prototype.setItem=function(e,t){this[e]=String(t)},e.prototype.removeItem=function(e){delete this[e]},e.prototype.clear=function(){let e=this;Object.keys(e).forEach(function(t){e[t]=void 0,delete e[t]})},e.prototype.key=function(e){return e=e||0,Object.keys(this)[e]},e.prototype.__defineGetter__("length",function(){return Object.keys(this).length}),"u">typeof eS&&eS.localStorage?ex.exports=eS.localStorage:"u">typeof window&&window.localStorage?ex.exports=window.localStorage:ex.exports=new t}();class eI{constructor(){this.localStorage=ex.exports}async getKeys(){return Object.keys(this.localStorage)}async getEntries(){return Object.entries(this.localStorage).map(eA)}async getItem(e){let t=this.localStorage.getItem(e);if(null!==t)return eg(t)}async setItem(e,t){this.localStorage.setItem(e,em(t))}async removeItem(e){this.localStorage.removeItem(e)}}let eO="wc_storage_version",eT=1,eP=async(e,t,r)=>{let n=eO,i=await t.getItem(n);if(i&&i>=eT){r(t);return}let o=await e.getKeys();if(!o.length){r(t);return}let s=[];for(;o.length;){let r=o.shift();if(!r)continue;let n=r.toLowerCase();if(n.includes("wc@")||n.includes("walletconnect")||n.includes("wc_")||n.includes("wallet_connect")){let n=await e.getItem(r);await t.setItem(r,n),s.push(r)}}await t.setItem(n,eT),r(t),eM(e,s)},eM=async(e,t)=>{t.length&&t.forEach(async t=>{await e.removeItem(t)})};class eN{constructor(){this.initialized=!1,this.setInitialized=e=>{this.storage=e,this.initialized=!0};let e=new eI;this.storage=e;try{let t=new eE;eP(e,t,this.setInitialized)}catch{this.initialized=!0}}async getKeys(){return await this.initialize(),this.storage.getKeys()}async getEntries(){return await this.initialize(),this.storage.getEntries()}async getItem(e){return await this.initialize(),this.storage.getItem(e)}async setItem(e,t){return await this.initialize(),this.storage.setItem(e,t)}async removeItem(e){return await this.initialize(),this.storage.removeItem(e)}async initialize(){this.initialized||await new Promise(e=>{let t=setInterval(()=>{this.initialized&&(clearInterval(t),e())},20)})}}var ek=r(28509),eC=r.n(ek);let eD={level:"info"},ej="custom_context",eR=1024e3;class eL{constructor(e){this.nodeValue=e,this.sizeInBytes=new TextEncoder().encode(this.nodeValue).length,this.next=null}get value(){return this.nodeValue}get size(){return this.sizeInBytes}}class eB{constructor(e){this.head=null,this.tail=null,this.lengthInNodes=0,this.maxSizeInBytes=e,this.sizeInBytes=0}append(e){let t=new eL(e);if(t.size>this.maxSizeInBytes)throw Error(`[LinkedList] Value too big to insert into list: ${e} with size ${t.size}`);for(;this.size+t.size>this.maxSizeInBytes;)this.shift();this.head?this.tail&&(this.tail.next=t):this.head=t,this.tail=t,this.lengthInNodes++,this.sizeInBytes+=t.size}shift(){if(!this.head)return;let e=this.head;this.head=this.head.next,this.head||(this.tail=null),this.lengthInNodes--,this.sizeInBytes-=e.size}toArray(){let e=[],t=this.head;for(;null!==t;)e.push(t.value),t=t.next;return e}get length(){return this.lengthInNodes}get size(){return this.sizeInBytes}toOrderedArray(){return Array.from(this)}[Symbol.iterator](){let e=this.head;return{next:()=>{if(!e)return{done:!0,value:null};let t=e.value;return e=e.next,{done:!1,value:t}}}}}class eU{constructor(e,t=eR){this.level=e??"error",this.levelValue=ek.levels.values[this.level],this.MAX_LOG_SIZE_IN_BYTES=t,this.logs=new eB(this.MAX_LOG_SIZE_IN_BYTES)}forwardToConsole(e,t){t===ek.levels.values.error?console.error(e):t===ek.levels.values.warn?console.warn(e):t===ek.levels.values.debug?console.debug(e):t===ek.levels.values.trace?console.trace(e):console.log(e)}appendToLogs(e){this.logs.append(em({timestamp:new Date().toISOString(),log:e}));let t="string"==typeof e?JSON.parse(e).level:e.level;t>=this.levelValue&&this.forwardToConsole(e,t)}getLogs(){return this.logs}clearLogs(){this.logs=new eB(this.MAX_LOG_SIZE_IN_BYTES)}getLogArray(){return Array.from(this.logs)}logsToBlob(e){let t=this.getLogArray();return t.push(em({extraMetadata:e})),new Blob(t,{type:"application/json"})}}class e${constructor(e,t=eR){this.baseChunkLogger=new eU(e,t)}write(e){this.baseChunkLogger.appendToLogs(e)}getLogs(){return this.baseChunkLogger.getLogs()}clearLogs(){this.baseChunkLogger.clearLogs()}getLogArray(){return this.baseChunkLogger.getLogArray()}logsToBlob(e){return this.baseChunkLogger.logsToBlob(e)}downloadLogsBlobInBrowser(e){let t=URL.createObjectURL(this.logsToBlob(e)),r=document.createElement("a");r.href=t,r.download=`walletconnect-logs-${new Date().toISOString()}.txt`,document.body.appendChild(r),r.click(),document.body.removeChild(r),URL.revokeObjectURL(t)}}class eK{constructor(e,t=eR){this.baseChunkLogger=new eU(e,t)}write(e){this.baseChunkLogger.appendToLogs(e)}getLogs(){return this.baseChunkLogger.getLogs()}clearLogs(){this.baseChunkLogger.clearLogs()}getLogArray(){return this.baseChunkLogger.getLogArray()}logsToBlob(e){return this.baseChunkLogger.logsToBlob(e)}}var eF=Object.defineProperty,ez=Object.defineProperties,eq=Object.getOwnPropertyDescriptors,eV=Object.getOwnPropertySymbols,eH=Object.prototype.hasOwnProperty,eG=Object.prototype.propertyIsEnumerable,eW=(e,t,r)=>t in e?eF(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,eJ=(e,t)=>
1{for(var r in t||(t={}))eH.call(t,r)&&eW(e,r,t[r]);if(eV)for(var r of eV(t))eG.call(t,r)&&eW(e,r,t[r]);return e},eZ=(e,t)=>ez(e,eq(t));function eY(e){return eZ(eJ({},e),{level:e?.level||eD.level})}function eX(e,t=ej){return e[t]||""}function eQ(e,t,r=ej){return e[r]=t,e}function e0(e,t=ej){return typeof e.bindings>"u"?eX(e,t):e.bindings().context||""}function e1(e,t,r=ej){let n=e0(e,r);return n.trim()?`${n}/${t}`:t}function e2(e,t,r=ej){let n=e1(e,t,r);return eQ(e.child({context:n}),n,r)}function e5(e){var t,r;let n=new e$(null==(t=e.opts)?void 0:t.level,e.maxSizeInBytes);return{logger:eC()(eZ(eJ({},e.opts),{level:"trace",browser:eZ(eJ({},null==(r=e.opts)?void 0:r.browser),{write:e=>n.write(e)})})),chunkLoggerController:n}}function e3(e){var t;let r=new eK(null==(t=e.opts)?void 0:t.level,e.maxSizeInBytes);return{logger:eC()(eZ(eJ({},e.opts),{level:"trace"}),r),chunkLoggerController:r}}function e8(e){return"u">typeof e.loggerOverride&&"string"!=typeof e.loggerOverride?{logger:e.loggerOverride,chunkLoggerController:null}:"u">typeof window?e5(e):e3(e)}var e6=Object.defineProperty,e4=(e,t,r)=>t in e?e6(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,e9=(e,t,r)=>e4(e,"symbol"!=typeof t?t+"":t,r);class e7 extends O{constructor(e){super(),this.opts=e,e9(this,"protocol","wc"),e9(this,"version",2)}}var te=Object.defineProperty,tt=(e,t,r)=>t in e?te(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,tr=(e,t,r)=>tt(e,"symbol"!=typeof t?t+"":t,r);class tn extends O{constructor(e,t){super(),this.core=e,this.logger=t,tr(this,"records",new Map)}}class ti{constructor(e,t){this.logger=e,this.core=t}}class to extends O{constructor(e,t){super(),this.relayer=e,this.logger=t}}class ts extends O{constructor(e){super()}}class ta{constructor(e,t,r,n){this.core=e,this.logger=t,this.name=r}}class tc extends O{constructor(e,t){super(),this.relayer=e,this.logger=t}}class tu extends O{constructor(e,t){super(),this.core=e,this.logger=t}}class tl{constructor(e,t,r){this.core=e,this.logger=t,this.store=r}}class td{constructor(e,t){this.projectId=e,this.logger=t}}class tf{constructor(e,t,r){this.core=e,this.logger=t,this.telemetryEnabled=r}}function th(e){return e instanceof Uint8Array||ArrayBuffer.isView(e)&&"Uint8Array"===e.constructor.name}function tp(e,...t){if(!th(e))throw Error("Uint8Array expected");if(t.length>0&&!t.includes(e.length))throw Error("Uint8Array expected of length "+t+", got length="+e.length)}function ty(e,t=!0){if(e.destroyed)throw Error("Hash instance has been destroyed");if(t&&e.finished)throw Error("Hash#digest() has already been called")}function tg(e,t){tp(e);let r=t.outputLen;if(e.length<r)throw Error("digestInto() expects output buffer of length at least "+r)}let tm="object"==typeof globalThis&&"crypto"in globalThis?globalThis.crypto:void 0,tb=e=>new DataView(e.buffer,e.byteOffset,e.byteLength);function tv(e){if("string"!=typeof e)throw Error("utf8ToBytes expected string, got "+typeof e);return new Uint8Array(new TextEncoder().encode(e))}function tw(e){return"string"==typeof e&&(e=tv(e)),tp(e),e}class t_{clone(){return this._cloneInto()}}function tE(e){let t=t=>e().update(tw(t)).digest(),r=e();return t.outputLen=r.outputLen,t.blockLen=r.blockLen,t.create=()=>e(),t}function tS(e=32){if(tm&&"function"==typeof tm.getRandomValues)return tm.getRandomValues(new Uint8Array(e));if(tm&&"function"==typeof tm.randomBytes)return tm.randomBytes(e);throw Error("crypto.getRandomValues must be defined")}function tx(e,t,r,n){if("function"==typeof e.setBigUint64)return e.setBigUint64(t,r,n);let i=BigInt(32),o=BigInt(0xffffffff),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)}class tA extends t_{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=tb(this.buffer)}update(e){ty(this);let{view:t,buffer:r,blockLen:n}=this,i=(e=tw(e)).length;for(let o=0;o<i;){let s=Math.min(n-this.pos,i-o);if(s===n){let t=tb(e);for(;n<=i-o;o+=n)this.process(t,o);continue}r.set(e.subarray(o,o+s),this.pos),this.pos+=s,o+=s,this.pos===n&&(this.process(t,0),this.pos=0)}return this.length+=e.length,this.roundClean(),this}digestInto(e){ty(this),tg(e,this),this.finished=!0;let{buffer:t,view:r,blockLen:n,isLE:i}=this,{pos:o}=this;t[o++]=128,this.buffer.subarray(o).fill(0),this.padOffset>n-o&&(this.process(r,0),o=0);for(let e=o;e<n;e++)t[e]=0;tx(r,n-8,BigInt(8*this.length),i),this.process(r,0);let s=tb(e),a=this.outputLen;if(a%4)throw Error("_sha2: outputLen should be aligned to 32bit");let c=a/4,u=this.get();if(c>u.length)throw Error("_sha2: outputLen bigger than state");for(let e=0;e<c;e++)s.setUint32(4*e,u[e],i)}digest(){let{buffer:e,outputLen:t}=this;this.digestInto(e);let r=e.slice(0,t);return this.destroy(),r}_cloneInto(e){e||(e=new this.constructor),e.set(...this.get());let{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}}let tI=BigInt(0x100000000-1),tO=BigInt(32);function tT(e,t=!1){return t?{h:Number(e&tI),l:Number(e>>tO&tI)}:{h:0|Number(e>>tO&tI),l:0|Number(e&tI)}}let tP={split:function(e,t=!1){let r=new Uint32Array(e.length),n=new Uint32Array(e.length);for(let i=0;i<e.length;i++){let{h:o,l:s}=tT(e[i],t);[r[i],n[i]]=[o,s]}return[r,n]},shrSH:(e,t,r)=>e>>>r,shrSL:(e,t,r)=>e<<32-r|t>>>r,rotrSH:(e,t,r)=>e>>>r|t<<32-r,rotrSL:(e,t,r)=>e<<32-r|t>>>r,rotrBH:(e,t,r)=>e<<64-r|t>>>r-32,rotrBL:(e,t,r)=>e>>>r-32|t<<64-r,add:function(e,t,r,n){let i=(t>>>0)+(n>>>0);return{h:e+r+(i/0x100000000|0)|0,l:0|i}},add3L:(e,t,r)=>(e>>>0)+(t>>>0)+(r>>>0),add3H:(e,t,r,n)=>t+r+n+(e/0x100000000|0)|0,add4L:(e,t,r,n)=>(e>>>0)+(t>>>0)+(r>>>0)+(n>>>0),add4H:(e,t,r,n,i)=>t+r+n+i+(e/0x100000000|0)|0,add5H:(e,t,r,n,i,o)=>t+r+n+i+o+(e/0x100000000|0)|0,add5L:(e,t,r,n,i)=>(e>>>0)+(t>>>0)+(r>>>0)+(n>>>0)+(i>>>0)},[tM,tN]=tP.split(["0x428a2f98d728ae22","0x7137449123ef65cd","0xb5c0fbcfec4d3b2f","0xe9b5dba58189dbbc","0x3956c25bf348b538","0x59f111f1b605d019","0x923f82a4af194f9b","0xab1c5ed5da6d8118","0xd807aa98a3030242","0x12835b0145706fbe","0x243185be4ee4b28c","0x550c7dc3d5ffb4e2","0x72be5d74f27b89
16f","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))),tk=new Uint32Array(80),tC=new Uint32Array(80);class tD extends tA{constructor(){super(128,64,16,!1),this.Ah=0x6a09e667,this.Al=-0xc4336f8,this.Bh=-0x4498517b,this.Bl=-0x7b3558c5,this.Ch=0x3c6ef372,this.Cl=-0x16b07d5,this.Dh=-0x5ab00ac6,this.Dl=0x5f1d36f1,this.Eh=0x510e527f,this.El=-0x52197d2f,this.Fh=-0x64fa9774,this.Fl=0x2b3e6c1f,this.Gh=0x1f83d9ab,this.Gl=-0x4be4295,this.Hh=0x5be0cd19,this.Hl=0x137e2179}get(){let{Ah:e,Al:t,Bh:r,Bl:n,Ch:i,Cl:o,Dh:s,Dl:a,Eh:c,El:u,Fh:l,Fl:d,Gh:f,Gl:h,Hh:p,Hl:y}=this;return[e,t,r,n,i,o,s,a,c,u,l,d,f,h,p,y]}set(e,t,r,n,i,o,s,a,c,u,l,d,f,h,p,y){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|d,this.Gh=0|f,this.Gl=0|h,this.Hh=0|p,this.Hl=0|y}process(e,t){for(let r=0;r<16;r++,t+=4)tk[r]=e.getUint32(t),tC[r]=e.getUint32(t+=4);for(let e=16;e<80;e++){let t=0|tk[e-15],r=0|tC[e-15],n=tP.rotrSH(t,r,1)^tP.rotrSH(t,r,8)^tP.shrSH(t,r,7),i=tP.rotrSL(t,r,1)^tP.rotrSL(t,r,8)^tP.shrSL(t,r,7),o=0|tk[e-2],s=0|tC[e-2],a=tP.rotrSH(o,s,19)^tP.rotrBH(o,s,61)^tP.shrSH(o,s,6),c=tP.rotrSL(o,s,19)^tP.rotrBL(o,s,61)^tP.shrSL(o,s,6),u=tP.add4L(i,c,tC[e-7],tC[e-16]),l=tP.add4H(u,n,a,tk[e-7],tk[e-16]);tk[e]=0|l,tC[e]=0|u}let{Ah:r,Al:n,Bh:i,Bl:o,Ch:s,Cl:a,Dh:c,Dl:u,Eh:l,El:d,Fh:f,Fl:h,Gh:p,Gl:y,Hh:g,Hl:m}=this;for(let e=0;e<80;e++){let t=tP.rotrSH(l,d,14)^tP.rotrSH(l,d,18)^tP.rotrBH(l,d,41),b=tP.rotrSL(l,d,14)^tP.rotrSL(l,d,18)^tP.rotrBL(l,d,41),v=l&f^~l&p,w=d&h^~d&y,_=tP.add5L(m,b,w,tN[e],tC[e]),E=tP.add5H(_,g,t,v,tM[e],tk[e]),S=0|_,x=tP.rotrSH(r,n,28)^tP.rotrBH(r,n,34)^tP.rotrBH(r,n,39),A=tP.rotrSL(r,n,28)^tP.rotrBL(r,n,34)^tP.rotrBL(r,n,39),I=r&i^r&s^i&s,O=n&o^n&a^o&a;g=0|p,m=0|y,p=0|f,y=0|h,f=0|l,h=0|d,({h:l,l:d}=tP.add(0|c,0|u,0|E,0|S)),c=0|s,u=0|a,s=0|i,a=0|o,i=0|r,o=0|n;let T=tP.add3L(S,A,O);r=tP.add3H(T,E,x,I),n=0|T}({h:r,l:n}=tP.add(0|this.Ah,0|this.Al,0|r,0|n)),({h:i,l:o}=tP.add(0|this.Bh,0|this.Bl,0|i,0|o)),({h:s,l:a}=tP.add(0|this.Ch,0|this.Cl,0|s,0|a)),({h:c,l:u}=tP.add(0|this.Dh,0|this.Dl,0|c,0|u)),({h:l,l:d}=tP.add(0|this.Eh,0|this.El,0|l,0|d)),({h:f,l:h}=tP.add(0|this.Fh,0|this.Fl,0|f,0|h)),({h:p,l:y}=tP.add(0|this.Gh,0|this.Gl,0|p,0|y)),({h:g,l:m}=tP.add(0|this.Hh,0|this.Hl,0|g,0|m)),this.set(r,n,i,o,s,a,c,u,l,d,f,h,p,y,g,m)}roundClean(){tk.fill(0),tC.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)}}let tj=tE(()=>new tD),tR=BigInt(0),tL=BigInt(1),tB=BigInt(2);function tU(e){return e instanceof Uint8Array||ArrayBuffer.isView(e)&&"Uint8Array"===e.constructor.name}function t$(e){if(!tU(e))throw Error("Uint8Array expected")}function tK(e,t){if("boolean"!=typeof t)throw Error(e+" boolean expected, got "+t)}let tF=Array.from({length:256},(e,t)=>t.toString(16).padStart(2,"0"));function tz(e){t$(e);let t="";for(let r=0;r<e.length;r++)t+=tF[e[r]];return t}function tq(e){if("string"!=typeof e)throw Error("hex string expected, got "+typeof e);return""===e?tR:BigInt("0x"+e)}let tV={_0:48,_9:57,A:65,F:70,a:97,f:102};function tH(e){return e>=tV._0&&e<=tV._9?e-tV._0:e>=tV.A&&e<=tV.F?e-(tV.A-10):e>=tV.a&&e<=tV.f?e-(tV.a-10):void 0}function tG(e){if("string"!=typeof e)throw Error("hex string expected, got "+typeof e);let t=e.length,r=t/2;if(t%2)throw Error("hex string expected, got unpadded hex of length "+t);let n=new Uint8Array(r);for(let t=0,i=0;t<r;t++,i+=2){let r=tH(e.charCodeAt(i)),o=tH(e.charCodeAt(i+1));if(void 0===r||void 0===o)throw Error('hex string expected, got non-hex character "'+(e[i]+e[i+1])+'" at index '+i);n[t]=16*r+o}return n}function tW(e){return tq(tz(e))}function tJ(e){return t$(e),tq(tz(Uint8Array.from(e).reverse()))}function tZ(e,t){return tG(e.toString(16).padStart(2*t,"0"))}function tY(e,t){return tZ(e,t).reverse()}function tX(e,t,r){let n;if("string"==typeof t)try{n=tG(t)}catch(t){throw Error(e+" must be hex string or Uint8Array, cause: "+t)}else if(tU(t))n=Uint8Array.from(t);else throw Error(e+" must be hex string or Uint8Array");let i=n.length;if("number"==typeof r&&i!==r)throw Error(e+" of length "+r+" expected, got "+i);return n}function tQ(...e){let t=0;for(let r=0;r<e.length;r++){let n=e[r];t$(n),t+=n.length}let r=new Uint8Array(t);for(let t=0,n=0;t<e.length;t++){let i=e[t];r.set(i,n),n+=i.length}return r}let t0=e=>"bigint"==typeof e&&tR<=e;function t1(e,t,r){return t0(e)&&t0(t)&&t0(r)&&t<=e&&e<r}function t2(e,t,r,n){if(!t1(t,r,n))throw Error("expected valid "+e+": "+r+" <= n < "+n+", got "+t)}function t5(e){let t;for(t=0;e>tR;e>>=tL,t+=1);return t}let t3=e=>(tB<<BigInt(e-1))-tL,t8={bigint:e=>"bigint"==typeof e,function:e=>"function"==typeof e,boolean:e=>"boolean"==typeof e,string:e=>"string"==typeof e,stringOrUint8Array:e=>"string"==typeof e||tU(e),isSafeInteger:e=>Number.isSafeInteger(e),array:e=>Array.isArray(e),field:(e,t)=>t.Fp.isValid(e),hash:e=>"function"==typeof e&&Number.isSafeInteger(e.outputLen)};function t6(e,t,r={}){let n=(t,r,n)=>{let i=t8[r];if("function"!=typeof i)throw Error("invalid validator function");let o=e[t];if(!(n&&void 0===o)&&!i(o,e))throw Error("param "+String(t)+" is invali
1d. Expected "+r+", got "+o)};for(let[e,r]of Object.entries(t))n(e,r,!1);for(let[e,t]of Object.entries(r))n(e,t,!0);return e}function t4(e){let t=new WeakMap;return(r,...n)=>{let i=t.get(r);if(void 0!==i)return i;let o=e(r,...n);return t.set(r,o),o}}let t9=BigInt(0),t7=BigInt(1),re=BigInt(2),rt=BigInt(3),rr=BigInt(4),rn=BigInt(5),ri=BigInt(8);function ro(e,t){let r=e%t;return r>=t9?r:t+r}function rs(e,t,r){if(t<t9)throw Error("invalid exponent, negatives unsupported");if(r<=t9)throw Error("invalid modulus");if(r===t7)return t9;let n=t7;for(;t>t9;)t&t7&&(n=n*e%r),e=e*e%r,t>>=t7;return n}function ra(e,t,r){let n=e;for(;t-- >t9;)n*=n,n%=r;return n}function rc(e,t){if(e===t9)throw Error("invert: expected non-zero number");if(t<=t9)throw Error("invert: expected positive modulus, got "+t);let r=ro(e,t),n=t,i=t9,o=t7;for(;r!==t9;){let e=n/r,t=n%r,s=i-o*e;n=r,r=t,i=o,o=s}if(n!==t7)throw Error("invert: does not exist");return ro(i,t)}function ru(e){let t,r,n;let i=(e-t7)/re;for(t=e-t7,r=0;t%re===t9;t/=re,r++);for(n=re;n<e&&rs(n,i,e)!==e-t7;n++)if(n>1e3)throw Error("Cannot find square root: likely non-prime P");if(1===r){let t=(e+t7)/rr;return function(e,r){let n=e.pow(r,t);if(!e.eql(e.sqr(n),r))throw Error("Cannot find square root");return n}}let o=(t+t7)/re;return function(e,s){if(e.pow(s,i)===e.neg(e.ONE))throw Error("Cannot find square root");let a=r,c=e.pow(e.mul(e.ONE,n),t),u=e.pow(s,o),l=e.pow(s,t);for(;!e.eql(l,e.ONE);){if(e.eql(l,e.ZERO))return e.ZERO;let t=1;for(let r=e.sqr(l);t<a&&!e.eql(r,e.ONE);t++)r=e.sqr(r);let r=e.pow(c,t7<<BigInt(a-t-1));c=e.sqr(r),u=e.mul(u,r),l=e.mul(l,c),a=t}return u}}function rl(e){if(e%rr===rt){let t=(e+t7)/rr;return function(e,r){let n=e.pow(r,t);if(!e.eql(e.sqr(n),r))throw Error("Cannot find square root");return n}}if(e%ri===rn){let t=(e-rn)/ri;return function(e,r){let n=e.mul(r,re),i=e.pow(n,t),o=e.mul(r,i),s=e.mul(e.mul(o,re),i),a=e.mul(o,e.sub(s,e.ONE));if(!e.eql(e.sqr(a),r))throw Error("Cannot find square root");return a}}return ru(e)}let rd=(e,t)=>(ro(e,t)&t7)===t7,rf=["create","isValid","is0","neg","inv","sqrt","sqr","eql","add","sub","mul","pow","div","addN","subN","mulN","sqrN"];function rh(e){let t={ORDER:"bigint",MASK:"bigint",BYTES:"isSafeInteger",BITS:"isSafeInteger"};return t6(e,rf.reduce((e,t)=>(e[t]="function",e),t))}function rp(e,t,r){if(r<t9)throw Error("invalid exponent, negatives unsupported");if(r===t9)return e.ONE;if(r===t7)return t;let n=e.ONE,i=t;for(;r>t9;)r&t7&&(n=e.mul(n,i)),i=e.sqr(i),r>>=t7;return n}function ry(e,t){let r=Array(t.length),n=t.reduce((t,n,i)=>e.is0(n)?t:(r[i]=t,e.mul(t,n)),e.ONE),i=e.inv(n);return t.reduceRight((t,n,i)=>e.is0(n)?t:(r[i]=e.mul(t,r[i]),e.mul(t,n)),i),r}function rg(e,t){let r=void 0!==t?t:e.toString(2).length,n=Math.ceil(r/8);return{nBitLength:r,nByteLength:n}}function rm(e,t,r=!1,n={}){let i;if(e<=t9)throw Error("invalid field: expected ORDER > 0, got "+e);let{nBitLength:o,nByteLength:s}=rg(e,t);if(s>2048)throw Error("invalid field: expected ORDER of <= 2048 bytes");let a=Object.freeze({ORDER:e,isLE:r,BITS:o,BYTES:s,MASK:t3(o),ZERO:t9,ONE:t7,create:t=>ro(t,e),isValid:t=>{if("bigint"!=typeof t)throw Error("invalid field element: expected bigint, got "+typeof t);return t9<=t&&t<e},is0:e=>e===t9,isOdd:e=>(e&t7)===t7,neg:t=>ro(-t,e),eql:(e,t)=>e===t,sqr:t=>ro(t*t,e),add:(t,r)=>ro(t+r,e),sub:(t,r)=>ro(t-r,e),mul:(t,r)=>ro(t*r,e),pow:(e,t)=>rp(a,e,t),div:(t,r)=>ro(t*rc(r,e),e),sqrN:e=>e*e,addN:(e,t)=>e+t,subN:(e,t)=>e-t,mulN:(e,t)=>e*t,inv:t=>rc(t,e),sqrt:n.sqrt||(t=>(i||(i=rl(e)),i(a,t))),invertBatch:e=>ry(a,e),cmov:(e,t,r)=>r?t:e,toBytes:e=>r?tY(e,s):tZ(e,s),fromBytes:e=>{if(e.length!==s)throw Error("Field.fromBytes: expected "+s+" bytes, got "+e.length);return r?tJ(e):tW(e)}});return Object.freeze(a)}let rb=BigInt(0),rv=BigInt(1);function rw(e,t){let r=t.negate();return e?r:t}function r_(e,t){if(!Number.isSafeInteger(e)||e<=0||e>t)throw Error("invalid window size, expected [1.."+t+"], got W="+e)}function rE(e,t){return r_(e,t),{windows:Math.ceil(t/e)+1,windowSize:2**(e-1)}}function rS(e,t){if(!Array.isArray(e))throw Error("array expected");e.forEach((e,r)=>{if(!(e instanceof t))throw Error("invalid point at index "+r)})}function rx(e,t){if(!Array.isArray(e))throw Error("array of scalars expected");e.forEach((e,r)=>{if(!t.isValid(e))throw Error("invalid scalar at index "+r)})}let rA=new WeakMap,rI=new WeakMap;function rO(e){return rI.get(e)||1}function rT(e,t){return{constTimeNegate:rw,hasPrecomputes:e=>1!==rO(e),unsafeLadder(t,r,n=e.ZERO){let i=t;for(;r>rb;)r&rv&&(n=n.add(i)),i=i.double(),r>>=rv;return n},precomputeWindow(e,r){let{windows:n,windowSize:i}=rE(r,t),o=[],s=e,a=s;for(let e=0;e<n;e++){a=s,o.push(a);for(let e=1;e<i;e++)a=a.add(s),o.push(a);s=a.double()}return o},wNAF(r,n,i){let{windows:o,windowSize:s}=rE(r,t),a=e.ZERO,c=e.BASE,u=BigInt(2**r-1),l=2**r,d=BigInt(r);for(let e=0;e<o;e++){let t=e*s,r=Number(i&u);i>>=d,r>s&&(r-=l,i+=rv);let o=t,f=t+Math.abs(r)-1,h=e%2!=0,p=r<0;0===r?c=c.add(rw(h,n[o])):a=a.add(rw(p,n[f]))}return{p:a,f:c}},wNAFUnsafe(r,n,i,o=e.ZERO){let{windows:s,windowSize:a}=rE(r,t),c=BigInt(2**r-1),u=2**r,l=BigInt(r);for(let e=0;e<s;e++){let t=e*a;if(i===rb)break;let r=Number(i&c);if(i>>=l,r>a&&(r-=u,i+=rv),0===r)continue;let s=n[t+Math.abs(r)-1];r<0&&(s=s.negate()),o=o.add(s)}return o},getPrecomputes(e,t,r){let n=rA.get(t);
1return n||(n=this.precomputeWindow(t,e),1!==e&&rA.set(t,r(n))),n},wNAFCached(e,t,r){let n=rO(e);return this.wNAF(n,this.getPrecomputes(n,e,r),t)},wNAFCachedUnsafe(e,t,r,n){let i=rO(e);return 1===i?this.unsafeLadder(e,t,n):this.wNAFUnsafe(i,this.getPrecomputes(i,e,r),t,n)},setWindowSize(e,r){r_(r,t),rI.set(e,r),rA.delete(e)}}}function rP(e,t,r,n){if(rS(r,e),rx(n,t),r.length!==n.length)throw Error("arrays of points and scalars must have equal length");let i=e.ZERO,o=t5(BigInt(r.length)),s=o>12?o-3:o>4?o-2:o?2:1,a=(1<<s)-1,c=Array(a+1).fill(i),u=Math.floor((t.BITS-1)/s)*s,l=i;for(let e=u;e>=0;e-=s){c.fill(i);for(let t=0;t<n.length;t++){let i=Number(n[t]>>BigInt(e)&BigInt(a));c[i]=c[i].add(r[t])}let t=i;for(let e=c.length-1,r=i;e>0;e--)r=r.add(c[e]),t=t.add(r);if(l=l.add(t),0!==e)for(let e=0;e<s;e++)l=l.double()}return l}function rM(e){return rh(e.Fp),t6(e,{n:"bigint",h:"bigint",Gx:"field",Gy:"field"},{nBitLength:"isSafeInteger",nByteLength:"isSafeInteger"}),Object.freeze({...rg(e.n,e.nBitLength),...e,p:e.Fp.ORDER})}let rN=BigInt(0),rk=BigInt(1),rC=BigInt(2),rD=BigInt(8),rj={zip215:!0};function rR(e){let t=rM(e);return t6(e,{hash:"function",a:"bigint",d:"bigint",randomBytes:"function"},{adjustScalarBytes:"function",domain:"function",uvRatio:"function",mapToCurve:"function"}),Object.freeze({...t})}function rL(e){let t=rR(e),{Fp:r,n:n,prehash:i,hash:o,randomBytes:s,nByteLength:a,h:c}=t,u=rC<<BigInt(8*a)-rk,l=r.create,d=rm(t.n,t.nBitLength),f=t.uvRatio||((e,t)=>{try{return{isValid:!0,value:r.sqrt(e*r.inv(t))}}catch{return{isValid:!1,value:rN}}}),h=t.adjustScalarBytes||(e=>e),p=t.domain||((e,t,r)=>{if(tK("phflag",r),t.length||r)throw Error("Contexts/pre-hash are not supported");return e});function y(e,t){t2("coordinate "+e,t,rN,u)}function g(e){if(!(e instanceof v))throw Error("ExtendedPoint expected")}let m=t4((e,t)=>{let{ex:n,ey:i,ez:o}=e,s=e.is0();null==t&&(t=s?rD:r.inv(o));let a=l(n*t),c=l(i*t),u=l(o*t);if(s)return{x:rN,y:rk};if(u!==rk)throw Error("invZ was invalid");return{x:a,y:c}}),b=t4(e=>{let{a:r,d:n}=t;if(e.is0())throw Error("bad point: ZERO");let{ex:i,ey:o,ez:s,et:a}=e,c=l(i*i),u=l(o*o),d=l(s*s),f=l(d*d),h=l(c*r);if(l(d*l(h+u))!==l(f+l(n*l(c*u))))throw Error("bad point: equation left != right (1)");if(l(i*o)!==l(s*a))throw Error("bad point: equation left != right (2)");return!0});class v{constructor(e,t,r,n){this.ex=e,this.ey=t,this.ez=r,this.et=n,y("x",e),y("y",t),y("z",r),y("t",n),Object.freeze(this)}get x(){return this.toAffine().x}get y(){return this.toAffine().y}static fromAffine(e){if(e instanceof v)throw Error("extended point not allowed");let{x:t,y:r}=e||{};return y("x",t),y("y",r),new v(t,r,rk,l(t*r))}static normalizeZ(e){let t=r.invertBatch(e.map(e=>e.ez));return e.map((e,r)=>e.toAffine(t[r])).map(v.fromAffine)}static msm(e,t){return rP(v,d,e,t)}_setWindowSize(e){E.setWindowSize(this,e)}assertValidity(){b(this)}equals(e){g(e);let{ex:t,ey:r,ez:n}=this,{ex:i,ey:o,ez:s}=e,a=l(t*s),c=l(i*n),u=l(r*s),d=l(o*n);return a===c&&u===d}is0(){return this.equals(v.ZERO)}negate(){return new v(l(-this.ex),this.ey,this.ez,l(-this.et))}double(){let{a:e}=t,{ex:r,ey:n,ez:i}=this,o=l(r*r),s=l(n*n),a=l(rC*l(i*i)),c=l(e*o),u=r+n,d=l(l(u*u)-o-s),f=c+s,h=f-a,p=c-s,y=l(d*h),g=l(f*p),m=l(d*p);return new v(y,g,l(h*f),m)}add(e){g(e);let{a:r,d:n}=t,{ex:i,ey:o,ez:s,et:a}=this,{ex:c,ey:u,ez:d,et:f}=e;if(r===BigInt(-1)){let e=l((o-i)*(u+c)),t=l((o+i)*(u-c)),r=l(t-e);if(r===rN)return this.double();let n=l(s*rC*f),h=l(a*rC*d),p=h+n,y=t+e,g=h-n,m=l(p*r),b=l(y*g),w=l(p*g);return new v(m,b,l(r*y),w)}let h=l(i*c),p=l(o*u),y=l(a*n*f),m=l(s*d),b=l((i+o)*(c+u)-h-p),w=m-y,_=m+y,E=l(p-r*h),S=l(b*w),x=l(_*E),A=l(b*E);return new v(S,x,l(w*_),A)}subtract(e){return this.add(e.negate())}wNAF(e){return E.wNAFCached(this,e,v.normalizeZ)}multiply(e){let t=e;t2("scalar",t,rk,n);let{p:r,f:i}=this.wNAF(t);return v.normalizeZ([r,i])[0]}multiplyUnsafe(e,t=v.ZERO){let r=e;return t2("scalar",r,rN,n),r===rN?_:this.is0()||r===rk?this:E.wNAFCachedUnsafe(this,r,v.normalizeZ,t)}isSmallOrder(){return this.multiplyUnsafe(c).is0()}isTorsionFree(){return E.unsafeLadder(this,n).is0()}toAffine(e){return m(this,e)}clearCofactor(){let{h:e}=t;return e===rk?this:this.multiplyUnsafe(e)}static fromHex(e,n=!1){let{d:i,a:o}=t,s=r.BYTES;e=tX("pointHex",e,s),tK("zip215",n);let a=e.slice(),c=e[s-1];a[s-1]=-129&c;let d=tJ(a);t2("pointHex.y",d,rN,n?u:r.ORDER);let h=l(d*d),{isValid:p,value:y}=f(l(h-rk),l(i*h-o));
1if(!p)throw Error("Point.fromHex: invalid y coordinate");let g=(y&rk)===rk,m=(128&c)!=0;if(!n&&y===rN&&m)throw Error("Point.fromHex: x=0 and x_0=1");return m!==g&&(y=l(-y)),v.fromAffine({x:y,y:d})}static fromPrivateKey(e){return A(e).point}toRawBytes(){let{x:e,y:t}=this.toAffine(),n=tY(t,r.BYTES);return n[n.length-1]|=e&rk?128:0,n}toHex(){return tz(this.toRawBytes())}}v.BASE=new v(t.Gx,t.Gy,rk,l(t.Gx*t.Gy)),v.ZERO=new v(rN,rk,rk,rN);let{BASE:w,ZERO:_}=v,E=rT(v,8*a);function S(e){return ro(e,n)}function x(e){return S(tJ(e))}function A(e){let t=r.BYTES;e=tX("private key",e,t);let n=tX("hashed private key",o(e),2*t),i=h(n.slice(0,t)),s=n.slice(t,2*t),a=x(i),c=w.multiply(a),u=c.toRawBytes();return{head:i,prefix:s,scalar:a,point:c,pointBytes:u}}function I(e){return A(e).pointBytes}function O(e=new Uint8Array,...t){return x(o(p(tQ(...t),tX("context",e),!!i)))}function T(e,t,o={}){e=tX("message",e),i&&(e=i(e));let{prefix:s,scalar:a,pointBytes:c}=A(t),u=O(o.context,s,e),l=w.multiply(u).toRawBytes(),d=S(u+O(o.context,l,c,e)*a);return t2("signature.s",d,rN,n),tX("result",tQ(l,tY(d,r.BYTES)),2*r.BYTES)}let P=rj;function M(e,t,n,o=P){let s,a,c;let{context:u,zip215:l}=o,d=r.BYTES;e=tX("signature",e,2*d),t=tX("message",t),n=tX("publicKey",n,d),void 0!==l&&tK("zip215",l),i&&(t=i(t));let f=tJ(e.slice(d,2*d));try{s=v.fromHex(n,l),a=v.fromHex(e.slice(0,d),l),c=w.multiplyUnsafe(f)}catch{return!1}if(!l&&s.isSmallOrder())return!1;let h=O(u,a.toRawBytes(),s.toRawBytes(),t);return a.add(s.multiplyUnsafe(h)).subtract(c).clearCofactor().equals(v.ZERO)}return w._setWindowSize(8),{CURVE:t,getPublicKey:I,sign:T,verify:M,ExtendedPoint:v,utils:{getExtendedPublicKey:A,randomPrivateKey:()=>s(r.BYTES),precompute:(e=8,t=v.BASE)=>(t._setWindowSize(e),t.multiply(BigInt(3)),t)}}}BigInt(0),BigInt(1);let rB=BigInt("57896044618658097711785492504343953926634992332820282019728792003956564819949"),rU=BigInt("19681161376707505956807079304988542015446066515923890162744021073123829784752");BigInt(0);let r$=BigInt(1),rK=BigInt(2);BigInt(3);let rF=BigInt(5),rz=BigInt(8);function rq(e){let t=BigInt(10),r=BigInt(20),n=BigInt(40),i=BigInt(80),o=rB,s=e*e%o*e%o,a=ra(s,rK,o)*s%o,c=ra(a,r$,o)*e%o,u=ra(c,rF,o)*c%o,l=ra(u,t,o)*u%o,d=ra(l,r,o)*l%o,f=ra(d,n,o)*d%o,h=ra(f,i,o)*f%o,p=ra(h,i,o)*f%o,y=ra(p,t,o)*u%o;return{pow_p_5_8:ra(y,rK,o)*e%o,b2:s}}function rV(e){return e[0]&=248,e[31]&=127,e[31]|=64,e}function rH(e,t){let r=rB,n=ro(t*t*t,r),i=rq(e*ro(n*n*t,r)).pow_p_5_8,o=ro(e*n*i,r),s=ro(t*o*o,r),a=o,c=ro(o*rU,r),u=s===e,l=s===ro(-e,r),d=s===ro(-e*rU,r);return u&&(o=a),(l||d)&&(o=c),rd(o,r)&&(o=ro(-o,r)),{isValid:u||l,value:o}}let rG=rm(rB,void 0,!0),rW=rL({a:BigInt(-1),d:BigInt("37095705934669439343138083508754565189542113879843219016388785533085940283555"),Fp:rG,n:BigInt("7237005577332262213973186563042994240857116359379907606001950938285454250989"),h:rz,Gx:BigInt("15112221349535400772501151409588531511454012693041857206046113283949847762202"),Gy:BigInt("46316835694926478169428394003475163141307993866256225615783033603165251855960"),hash:tj,randomBytes:tS,adjustScalarBytes:rV,uvRatio:rH}),rJ="EdDSA",rZ="JWT",rY=".",rX="base64url",rQ="utf8",r0="utf8",r1=":",r2="did",r5="key",r3="base58btc",r8="z",r6="K36",r4=32;function r9(e){return null!=globalThis.Buffer?new Uint8Array(e.buffer,e.byteOffset,e.byteLength):e}function r7(e=0){return null!=globalThis.Buffer&&null!=globalThis.Buffer.allocUnsafe?r9(globalThis.Buffer.allocUnsafe(e)):new Uint8Array(e)}function ne(e,t){t||(t=e.reduce((e,t)=>e+t.length,0));let r=r7(t),n=0;for(let t of e)r.set(t,n),n+=t.length;return r9(r)}var nt=function(e,t){if(e.length>=255)throw TypeError("Alphabet too long");for(var r=new Uint8Array(256),n=0;n<r.length;n++)r[n]=255;for(var i=0;i<e.length;i++){var o=e.charAt(i),s=o.charCodeAt(0);if(255!==r[s])throw TypeError(o+" is ambiguous");r[s]=i}var a=e.length,c=e.charAt(0),u=Math.log(a)/Math.log(256),l=Math.log(256)/Math.log(a);function d(e){if("string"!=typeof e)throw TypeError("Expected String");if(0===e.length)return new Uint8Array;var t=0;if(" "!==e[0]){for(var n=0,i=0;e[t]===c;)n++,t++;for(var o=(e.length-t)*u+1>>>0,s=new Uint8Array(o);e[t];){var l=r[e.charCodeAt(t)];if(255===l)return;for(var d=0,f=o-1;(0!==l||d<i)&&-1!==f;f--,d++)l+=a*s[f]>>>0,s[f]=l%256>>>0,l=l/256>>>0;if(0!==l)throw Error("Non-zero carry");i=d,t++}if(" "!==e[t]){for(var h=o-i;h!==o&&0===s[h];)h++;for(var p=new Uint8Array(n+(o-h)),y=n;h!==o;)p[y++]=s[h++];return p}}}function f(e){var r=d(e);if(r)return r;throw Error(`Non-${t} character`)}return{encode:function(t){if(t instanceof Uint8Array||(ArrayBuffer.isView(t)?t=new Uint8Array(t.buffer,t.byteOffset,t.byteLength):Array.isArray(t)&&(t=Uint8Array.from(t))),!(t instanceof Uint8Array))throw TypeError("Expected Uint8Array");if(0===t.length)return"";for(var r=0,n=0,i=0,o=t.length;i!==o&&0===t[i];)i++,r++;for(var s=(o-i)*l+1>>>0,u=new Uint8Array(s);i!==o;){for(var d=t[i],f=0,h=s-1;(0!==d||f<n)&&-1!==h;h--,f++)d+=256*u[h]>>>0,u[h]=d%a>>>0,d=d/a>>>0;if(0!==d)throw Error("Non-zero carry");n=f,i++}for(var p=s-n;p!==s&&0===u[p];)p++;for(var y=c.repeat(r);p<s;++p)y+=e.charAt(u[p]);return y},decodeUnsafe:d,decode:f}};let nr=e=>{if(e instanceof Uint8Array&&"Uint8Array"===e.constructor.name)return e;if(e instanceof ArrayBuffer)return new Uint8Array(e);if(ArrayBuffer.isView(e))return new Uint8Array(e.buffer,e.byteOffset,e.byteLength);throw Error("Unknown type, must be binary type")},nn=e=>new TextEncoder().encode(e),ni=e=>new TextDecoder().decode(e);class no{constructor(e,t,r){this.name=e,this.prefix=t,this.baseEncode=r}encode(e){if(e instanceof Uint8Array)return`${this.prefix}${this.baseEncode(e)}`;throw Error("Unknown type, must be binary type")}}class ns{constructor(e,t,r){if(this.name=e,this.prefix=t,void 0===t.codePointAt(0))throw Error("Invalid prefix character");this.prefixCodePoint=t.codePointAt(0),this.baseDecode=r}decode(e){if("string"==typeof e){if(e.codePointAt(0)!==this.prefixCodePoint)throw Error(`Unable to decode multibase string ${JSON.stringify(e)}, ${this.name}
1 decoder only supports inputs prefixed with ${this.prefix}`);return this.baseDecode(e.slice(this.prefix.length))}throw Error("Can only multibase decode strings")}or(e){return nc(this,e)}}class na{constructor(e){this.decoders=e}or(e){return nc(this,e)}decode(e){let t=e[0],r=this.decoders[t];if(r)return r.decode(e);throw RangeError(`Unable to decode multibase string ${JSON.stringify(e)}, only inputs prefixed with ${Object.keys(this.decoders)} are supported`)}}let nc=(e,t)=>new na({...e.decoders||{[e.prefix]:e},...t.decoders||{[t.prefix]:t}});class nu{constructor(e,t,r,n){this.name=e,this.prefix=t,this.baseEncode=r,this.baseDecode=n,this.encoder=new no(e,t,r),this.decoder=new ns(e,t,n)}encode(e){return this.encoder.encode(e)}decode(e){return this.decoder.decode(e)}}let nl=({name:e,prefix:t,encode:r,decode:n})=>new nu(e,t,r,n),nd=({prefix:e,name:t,alphabet:r})=>{let{encode:n,decode:i}=nt(r,t);return nl({prefix:e,name:t,encode:n,decode:e=>nr(i(e))})},nf=(e,t,r,n)=>{let i={};for(let e=0;e<t.length;++e)i[t[e]]=e;let o=e.length;for(;"="===e[o-1];)--o;let s=new Uint8Array(o*r/8|0),a=0,c=0,u=0;for(let t=0;t<o;++t){let o=i[e[t]];if(void 0===o)throw SyntaxError(`Non-${n} character`);c=c<<r|o,(a+=r)>=8&&(a-=8,s[u++]=255&c>>a)}if(a>=r||255&c<<8-a)throw SyntaxError("Unexpected end of data");return s},nh=(e,t,r)=>{let n="="===t[t.length-1],i=(1<<r)-1,o="",s=0,a=0;for(let n=0;n<e.length;++n)for(a=a<<8|e[n],s+=8;s>r;)s-=r,o+=t[i&a>>s];if(s&&(o+=t[i&a<<r-s]),n)for(;o.length*r&7;)o+="=";return o},np=({name:e,prefix:t,bitsPerChar:r,alphabet:n})=>nl({prefix:t,name:e,encode:e=>nh(e,n,r),decode:t=>nf(t,n,r,e)});var ny=Object.freeze({__proto__:null,identity:nl({prefix:"\0",name:"identity",encode:e=>ni(e),decode:e=>nn(e)})}),ng=Object.freeze({__proto__:null,base2:np({prefix:"0",name:"base2",alphabet:"01",bitsPerChar:1})}),nm=Object.freeze({__proto__:null,base8:np({prefix:"7",name:"base8",alphabet:"01234567",bitsPerChar:3})}),nb=Object.freeze({__proto__:null,base10:nd({prefix:"9",name:"base10",alphabet:"0123456789"})}),nv=Object.freeze({__proto__:null,base16:np({prefix:"f",name:"base16",alphabet:"0123456789abcdef",bitsPerChar:4}),base16upper:np({prefix:"F",name:"base16upper",alphabet:"0123456789ABCDEF",bitsPerChar:4})});let nw=np({prefix:"b",name:"base32",alphabet:"abcdefghijklmnopqrstuvwxyz234567",bitsPerChar:5}),n_=np({prefix:"B",name:"base32upper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567",bitsPerChar:5}),nE=np({prefix:"c",name:"base32pad",alphabet:"abcdefghijklmnopqrstuvwxyz234567=",bitsPerChar:5}),nS=np({prefix:"C",name:"base32padupper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567=",bitsPerChar:5}),nx=np({prefix:"v",name:"base32hex",alphabet:"0123456789abcdefghijklmnopqrstuv",bitsPerChar:5}),nA=np({prefix:"V",name:"base32hexupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV",bitsPerChar:5});var nI=Object.freeze({__proto__:null,base32:nw,base32upper:n_,base32pad:nE,base32padupper:nS,base32hex:nx,base32hexupper:nA,base32hexpad:np({prefix:"t",name:"base32hexpad",alphabet:"0123456789abcdefghijklmnopqrstuv=",bitsPerChar:5}),base32hexpadupper:np({prefix:"T",name:"base32hexpadupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV=",bitsPerChar:5}),base32z:np({prefix:"h",name:"base32z",alphabet:"ybndrfg8ejkmcpqxot1uwisza345h769",bitsPerChar:5})}),nO=Object.freeze({__proto__:null,base36:nd({prefix:"k",name:"base36",alphabet:"0123456789abcdefghijklmnopqrstuvwxyz"}),base36upper:nd({prefix:"K",name:"base36upper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"})}),nT=Object.freeze({__proto__:null,base58btc:nd({name:"base58btc",prefix:"z",alphabet:"123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"}),base58flickr:nd({name:"base58flickr",prefix:"Z",alphabet:"123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ"})});let nP=np({prefix:"m",name:"base64",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",bitsPerChar:6});var nM=Object.freeze({__proto__:null,base64:nP,base64pad:np({prefix:"M",name:"base64pad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",bitsPerChar:6}),base64url:np({prefix:"u",name:"base64url",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_",bitsPerChar:6}),base64urlpad:np({prefix:"U",name:"base64urlpad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_=",bitsPerChar:6})});let nN=Array.from("\uD83D\uDE80\uD83E\uDE90â\uD83D\uDEF0\uD83C\uDF0C\uD83C\uDF11\uD83C\uDF12\uD83C\uDF13\uD83C\uDF14\uD83C\uDF15\uD83C\uDF16\uD83C\uDF17\uD83C\uDF18\uD83C\uDF0D\uD83C\uDF0F\uD83C\uDF0E\uD83D\uDC09â\uD83D\uDCBB\uD83D\uDDA5\uD83D\uDCBE\uD83D\uDCBF\uD83D\uDE02â¤\uD83D\uDE0D\uD83E\uDD23\uD83D\uDE0A\uD83D\uDE4F\uD83D\uDC95\uD83D\uDE2D\uD83D\uDE18\uD83D\uDC4D\uD83D\uDE05\uD83D\uDC4F\uD83D\uDE01\uD83D\uDD25\uD83E\uDD70\uD83D\uDC94\uD83D\uDC96\uD83D\uDC99\uD83D\uDE22\uD83E\uDD14\uD83D\uDE06\uD83D\uDE44\uD83D\uDCAA\uD83D\uDE09âº\uD83D\uDC4C\uD83E\uDD17\uD83D\uDC9C\uD83D\uDE14\uD83D\uDE0E\uD83D\uDE07\uD83C\uDF39\uD83E\uDD26\uD83C\uDF89\uD83D\uDC9Eââ¨\uD83E\uDD37\uD83D\uDE31\uD83D\uDE0C\uD83C\uDF38\uD83D\uDE4C\uD83D\uDE0B\uD83D\uDC97\uD83D\uDC9A\uD83D\uDE0F\uD83D\uDC9B\uD83D\uDE42\uD83D\uDC93\uD83E\uDD29\uD83D\uDE04\uD83D\uDE00\uD83D\uDDA4\uD83D\uDE03\uD83D\uDCAF\uD83D\uDE48\uD83D\uDC47\uD83C\uDFB6\uD83D\uDE12\uD83E\uDD2Dâ£\uD83D\uDE1C\uD83D\uDC8B\uD83D\uDC40\uD83D\uDE2A\uD83D\uDE11\uD83D\uDCA5\uD83D\uDE4B\uD83D\uDE1E\uD83D\uDE29\uD83D\uDE21\uD83E\uDD2A\uD83D\uDC4A\uD83E\uDD73\uD83D\uDE25\uD83E\uDD24\uD83D\uDC49\uD83D\uDC83\uD83D\uDE33â\uD83D\uDE1A\uD83D\uDE1D\uD83D\uDE34\uD83C\uDF1F\uD83D\uDE2C\uD83D\uDE43\uD83C\uDF40\uD83C\uDF37\uD83D\uDE3B\uD83D\uDE13ââ
\uD83E\uDD7A\uD83C\uDF08\uD83D\uDE08\uD83E\uDD18\uD83D\uDCA6â\uD83D\uDE23\uD83C\uDFC3\uD83D\uDC90â¹\uD83C\uDF8A\uD83D\uDC98\uD83D\uDE20â\uD83D\uDE15\uD83C\uDF3A\uD83C\uDF82\uD83C\uDF3B\uD83D\uDE10\uD83D\uDD95\uD83D\uDC9D\uD83D\uDE4A\uD83D\uDE39\uD83D\uDDE3\uD83D\uDCAB\uD83D\uDC80\uD83D\uDC51\uD83C\uDFB5\uD83E\uDD1E\uD83D\uDE1B\uD83D\uDD34\uD83D\uDE24\uD83C\uDF3C\uD83D\uDE2Bâ½\uD83E\uDD19â\uD83C\uDFC6\uD83E\uDD2B\uD83D\uDC48\uD83D\uDE2E\uD83D\uDE46\uD83C\uDF7B\uD83C\uDF43\uD83D\uDC36\uD83D\uDC81\uD83D\uDE32\uD83C\uDF3F\uD83E\uDDE1\uD83C\uDF81â¡\uD83C\uDF1E\uD83C\uDF88ââ\uD83D\uDC4B\uD83D\uDE30\uD83E\uDD28\uD83D\uDE36\uD83E\uDD1D\uD83D\uDEB6\uD83D\uDCB0\uD83C\uDF53\uD83D\uDCA2\uD83E\uDD1F\uD83D\uDE41\uD83D\uDEA8\uD83D\uDCA8\uD83E\uDD2Câ\uD83C\uDF80\uD83C\uDF7A\uD83E\uDD13\uD83D\uDE19\uD83D\uDC9F\uD83C\uDF31\uD83D\uDE16\uD83D\uDC76\uD83E\uDD74â¶â¡â\uD83D\uDC8E\uD83D\uDCB8â¬\uD83D\uDE28\uD83C\uDF1A\uD83E\uDD8B\uD83D\uDE37\uD83D\uDD7Aâ \uD83D\uDE45\uD83D\uDE1F\uD83D\uDE35\uD83D\uDC4E\uD83E\uDD32\uD83E\uDD20\uD83E\uDD27\uD83D\uDCCC\uD83D\uDD35\uD83D\uDC85\uD83E\uDDD0\uD83D\uDC3E\uD83C\uDF52\uD83D\uDE17\uD83E\uDD11\uD83C\uDF0A\uD83E\uDD2F\uD83D\uDC37â\uD83D\uDCA7\uD83D\uDE2F\uD83D\uDC86\uD83D\uDC46\uD83C\uDFA4\uD83D\uDE47\uD83C\uDF51â\uD83C\uDF34\uD83D\uDCA3\uD83D\uDC38\uD83D\uDC8C\uD83D\uDCCD\uD83E\uDD40\uD83E\uDD22\uD83D\uDC45\uD83D\uDCA1\uD83D\uDCA9\uD83D\uDC50\uD83D\uDCF8\uD83D\uDC7B\uD83E\uDD10\uD83E\uDD2E\uD83C\uDFBC\uD83E\uDD75\uD83D\uDEA9\uD83C\uDF4E\uD83C\uDF4A\uD83D\uDC7C\uD83D\uDC8D\uD83D\uDCE3\uD83E\uDD42"),nk=nN.reduce((e,t,r)=>(e[r]=t,e),[]),nC=nN.reduce((e,t,r)=>(e[t.codePointAt(0)]=r,e),[]);var nD=Object.freeze({__proto__:null,base256emoji:nl({prefix:"\uD83D\uDE80",name:"base256emoji",encode:function(e){return e.reduce((e,t)=>
1e+=nk[t],"")},decode:function(e){let t=[];for(let r of e){let e=nC[r.codePointAt(0)];if(void 0===e)throw Error(`Non-base256emoji character: ${r}`);t.push(e)}return new Uint8Array(t)}})}),nj=128,nR=-128,nL=0x80000000;function nB(e,t,r){t=t||[],r=r||0;for(var n=r;e>=nL;)t[r++]=255&e|nj,e/=128;for(;e&nR;)t[r++]=255&e|nj,e>>>=7;return t[r]=0|e,nB.bytes=r-n+1,t}var nU=128,n$=127;function nK(e,t){var r,n=0,t=t||0,i=0,o=t,s=e.length;do{if(o>=s)throw nK.bytes=0,RangeError("Could not decode varint");r=e[o++],n+=i<28?(r&n$)<<i:(r&n$)*Math.pow(2,i),i+=7}while(r>=nU);return nK.bytes=o-t,n}var nF=128,nz=16384,nq=2097152,nV=0x10000000,nH=0x800000000,nG=0x40000000000,nW=0x2000000000000,nJ=0x100000000000000,nZ=0x8000000000000000,nY={encode:nB,encodingLength:function(e){return e<nF?1:e<nz?2:e<nq?3:e<nV?4:e<nH?5:e<nG?6:e<nW?7:e<nJ?8:e<nZ?9:10}};let nX=(e,t,r=0)=>(nY.encode(e,t,r),t),nQ=e=>nY.encodingLength(e),n0=(e,t)=>{let r=t.byteLength,n=nQ(e),i=n+nQ(r),o=new Uint8Array(i+r);return nX(e,o,0),nX(r,o,n),o.set(t,i),new n1(e,r,t,o)};class n1{constructor(e,t,r,n){this.code=e,this.size=t,this.digest=r,this.bytes=n}}let n2=({name:e,code:t,encode:r})=>new n5(e,t,r);class n5{constructor(e,t,r){this.name=e,this.code=t,this.encode=r}digest(e){if(e instanceof Uint8Array){let t=this.encode(e);return t instanceof Uint8Array?n0(this.code,t):t.then(e=>n0(this.code,e))}throw Error("Unknown type, must be binary type")}}let n3=e=>async t=>new Uint8Array(await crypto.subtle.digest(e,t));var n8=Object.freeze({__proto__:null,sha256:n2({name:"sha2-256",code:18,encode:n3("SHA-256")}),sha512:n2({name:"sha2-512",code:19,encode:n3("SHA-512")})});let n6=0,n4=nr,n9=e=>n0(n6,n4(e));var n7=Object.freeze({__proto__:null,identity:{code:n6,name:"identity",encode:n4,digest:n9}});new TextEncoder,new TextDecoder;let ie={...ny,...ng,...nm,...nb,...nv,...nI,...nO,...nT,...nM,...nD};function it(e,t,r,n){return{name:e,prefix:t,encoder:{name:e,prefix:t,encode:r},decoder:{decode:n}}}({...n8,...n7});let ir=it("utf8","u",e=>"u"+new TextDecoder("utf8").decode(e),e=>new TextEncoder().encode(e.substring(1))),ii=it("ascii","a",e=>{let t="a";for(let r=0;r<e.length;r++)t+=String.fromCharCode(e[r]);return t},e=>{let t=r7((e=e.substring(1)).length);for(let r=0;r<e.length;r++)t[r]=e.charCodeAt(r);return t}),io={utf8:ir,"utf-8":ir,hex:ie.base16,latin1:ii,ascii:ii,binary:ii,...ie};function is(e,t="utf8"){let r=io[t];if(!r)throw Error(`Unsupported encoding "${t}"`);return("utf8"===t||"utf-8"===t)&&null!=globalThis.Buffer&&null!=globalThis.Buffer.from?globalThis.Buffer.from(e.buffer,e.byteOffset,e.byteLength).toString("utf8"):r.encoder.encode(e).substring(1)}function ia(e,t="utf8"){let r=io[t];if(!r)throw Error(`Unsupported encoding "${t}"`);return("utf8"===t||"utf-8"===t)&&null!=globalThis.Buffer&&null!=globalThis.Buffer.from?r9(globalThis.Buffer.from(e,"utf-8")):r.decoder.decode(`${r.prefix}${e}`)}function ic(e){return eg(is(ia(e,rX),rQ))}function iu(e){return is(ia(em(e),rQ),rX)}function il(e){return[r2,r5,r8+is(ne([ia(r6,r3),e]),r3)].join(r1)}function id(e){return is(e,rX)}function ih(e){return ia(e,rX)}function ip(e){return ia([iu(e.header),iu(e.payload)].join(rY),r0)}function iy(e){return[iu(e.header),iu(e.payload),id(e.signature)].join(rY)}function ig(e){let t=e.split(rY),r=ic(t[0]);return{header:r,payload:ic(t[1]),signature:ih(t[2]),data:ia(t.slice(0,2).join(rY),r0)}}function im(e=tS(r4)){let t=rW.getPublicKey(e);return{secretKey:ne([e,t]),publicKey:t}}async function ib(e,t,r,n,i=(0,I.fromMiliseconds)(Date.now())){let o={alg:rJ,typ:rZ},s=il(n.publicKey),a=i+r,c={iss:s,sub:e,aud:t,iat:i,exp:a},u=ip({header:o,payload:c});return iy({header:o,payload:c,signature:rW.sign(u,n.secretKey.slice(0,32))})}var iv=r(2818),iw=function(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))},i_=function(){return function(e,t,r){this.name=e,this.version=t,this.os=r,this.type="browser"}}(),iE=function(){return function(e){this.version=e,this.type="node",this.name="node",this.os=iv.platform}}(),iS=function(){return function(e,t,r,n){this.name=e,this.version=t,this.os=r,this.bot=n,this.type="bot-device"}}(),ix=function(){return function(){this.type="bot",this.bot=!0,this.name="bot",this.version=null,this.os=null}}(),iA=function(){return function(){this.type="react-native",this.name="react-native",this.version=null,this.os=null}}(),iI=/(nuhk|curl|Googlebot|Yammybot|Openbot|Slurp|MSNBot|Ask\ Jeeves\/Teoma|ia_archiver)/,iO=3,iT=[["aol",/AOLShield\/([0-9\._]+)/],["edge",/Edge\/([0-9\._]+)/],["edge-ios",/EdgiOS\/([0-9\._]+)/],["yandexbrowser",/YaBrowser\/([0-9\._]+)/],["kakaotalk",/KAKAOTALK\s([0-9\.]+)/],["samsung",/SamsungBrowser\/([0-9\.]+)/],["silk",/\bSilk\/([0-9._-]+)\b/],["miui",/MiuiBrowser\/([0-9\.]+)$/],["beaker",/BeakerBrowser\/([0-9\.]+)/],["edge-chromium",/EdgA?\/([0-9\.]+)/],["chromium-webview",/(?!Chrom.*OPR)wv\).*Chrom(?:e|ium)\/([0-9\.]+)(:?\s|$)/],["chrome",/(?!Chrom.*OPR)Chrom(?:e|ium)\/([0-9\.]+)(:?\s|$)/],["phantomjs",/PhantomJS\/([0-9\.]+)(:?\s|$)/],["crios",/CriOS\/([0-9\.]+)(:?\s|$)/],["firefox",/Firefox\/([0-9\.]+)(?:\s|$)/],["fxios",/FxiOS\/([0-9\.]+)/],["opera-mini",/Opera Mini.*Version\/([0-9\.]+)/],["opera",/Opera\/([0-9\.]+)(?:\s|$)/],["opera",/OPR\/([0-9\.]+)(:?\s|$)/],["pie",/^Microsoft Pocket Internet Explorer\/(\d+\.\d+)$/],["pie",/^Mozilla\/\d\.\d+\s\(compatible;\s(?:MSP?IE|MSInternet Explorer) (\d+\.\d+);.*Windows CE.*\)$/],["netfront",/^Mozilla\/\d\.\d+.*NetFront\/(\d.\d)/],["ie",/Trident\/7\.0.*rv\:([0-9\.]+).*\).*Gecko$/],["ie",/MSIE\s([0-9\.]+);.*Trident\/[4-7].0/],["ie",/MSIE\s(7\.0)/],["bb10",/BB10;
1\sTouch.*Version\/([0-9\.]+)/],["android",/Android\s([0-9\.]+)/],["ios",/Version\/([0-9\._]+).*Mobile.*Safari.*/],["safari",/Version\/([0-9\._]+).*Safari/],["facebook",/FB[AS]V\/([0-9\.]+)/],["instagram",/Instagram\s([0-9\.]+)/],["ios-webview",/AppleWebKit\/([0-9\.]+).*Mobile/],["ios-webview",/AppleWebKit\/([0-9\.]+).*Gecko\)$/],["curl",/^curl\/([0-9\.]+)$/],["searchbot",/alexa|bot|crawl(er|ing)|facebookexternalhit|feedburner|google web preview|nagios|postrank|pingdom|slurp|spider|yahoo!|yandex/]],iP=[["iOS",/iP(hone|od|ad)/],["Android OS",/Android/],["BlackBerry OS",/BlackBerry|BB10/],["Windows Mobile",/IEMobile/],["Amazon OS",/Kindle/],["Windows 3.11",/Win16/],["Windows 95",/(Windows 95)|(Win95)|(Windows_95)/],["Windows 98",/(Windows 98)|(Win98)/],["Windows 2000",/(Windows NT 5.0)|(Windows 2000)/],["Windows XP",/(Windows NT 5.1)|(Windows XP)/],["Windows Server 2003",/(Windows NT 5.2)/],["Windows Vista",/(Windows NT 6.0)/],["Windows 7",/(Windows NT 6.1)/],["Windows 8",/(Windows NT 6.2)/],["Windows 8.1",/(Windows NT 6.3)/],["Windows 10",/(Windows NT 10.0)/],["Windows ME",/Windows ME/],["Windows CE",/Windows CE|WinCE|Microsoft Pocket Internet Explorer/],["Open BSD",/OpenBSD/],["Sun OS",/SunOS/],["Chrome OS",/CrOS/],["Linux",/(Linux)|(X11)/],["Mac OS",/(Mac_PowerPC)|(Macintosh)/],["QNX",/QNX/],["BeOS",/BeOS/],["OS/2",/OS\/2/]];function iM(e){return e?ik(e):"undefined"==typeof document&&"undefined"!=typeof navigator&&"ReactNative"===navigator.product?new iA:"undefined"!=typeof navigator?ik(navigator.userAgent):iD()}function iN(e){return""!==e&&iT.reduce(function(t,r){var n=r[0],i=r[1];if(t)return t;var o=i.exec(e);return!!o&&[n,o]},!1)}function ik(e){var t=iN(e);if(!t)return null;var r=t[0],n=t[1];if("searchbot"===r)return new ix;var i=n[1]&&n[1].split(".").join("_").split("_").slice(0,3);i?i.length<iO&&(i=iw(iw([],i,!0),ij(iO-i.length),!0)):i=[];var o=i.join("."),s=iC(e),a=iI.exec(e);return a&&a[1]?new iS(r,o,s,a[1]):new i_(r,o,s)}function iC(e){for(var t=0,r=iP.length;t<r;t++){var n=iP[t],i=n[0];if(n[1].exec(e))return i}return null}function iD(){return void 0!==iv&&iv.version?new iE(iv.version.slice(1)):null}function ij(e){for(var t=[],r=0;r<e;r++)t.push("0");return t}var iR=r(15208),iL=r(19973);let iB="2.30.6",iU={getDocsUrl:({docsBaseUrl:e,docsPath:t="",docsSlug:r})=>t?`${e??"https://viem.sh"}${t}${r?`#${r}`:""}`:void 0,version:`viem@${iB}`};class i$ extends Error{constructor(e,t={}){let r=t.cause instanceof i$?t.cause.details:t.cause?.message?t.cause.message:t.details,n=t.cause instanceof i$&&t.cause.docsPath||t.docsPath,i=iU.getDocsUrl?.({...t,docsPath:n});super([e||"An error occurred.","",...t.metaMessages?[...t.metaMessages,""]:[],...i?[`Docs: ${i}`]:[],...r?[`Details: ${r}`]:[],...iU.version?[`Version: ${iU.version}`]:[]].join("\n"),t.cause?{cause:t.cause}:void 0),Object.defineProperty(this,"details",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"docsPath",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"metaMessages",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"shortMessage",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"version",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"BaseError"}),this.details=r,this.docsPath=n,this.metaMessages=t.metaMessages,this.name=t.name??this.name,this.shortMessage=e,this.version=iB}walk(e){return iK(this,e)}}function iK(e,t){return t?.(e)?e:e&&"object"==typeof e&&"cause"in e&&void 0!==e.cause?iK(e.cause,t):t?null:e}function iF(e,{strict:t=!0}={}){return!!e&&"string"==typeof e&&(t?/^0x[0-9a-fA-F]*$/.test(e):e.startsWith("0x"))}class iz extends i${constructor({size:e,targetSize:t,type:r}){super(`${r.charAt(0).toUpperCase()}${r.slice(1).toLowerCase()} size (${e}) exceeds padding size (${t}).`,{name:"SizeExceedsPaddingSizeError"})}}function iq(e,{dir:t,size:r=32}={}){return"string"==typeof e?iV(e,{dir:t,size:r}):iH(e,{dir:t,size:r})}function iV(e,{dir:t,size:r=32}={}){if(null===r)return e;let n=e.replace("0x","");if(n.length>2*r)throw new iz({size:Math.ceil(n.length/2),targetSize:r,type:"hex"});return`0x${n["right"===t?"padEnd":"padStart"](2*r,"0")}`}function iH(e,{dir:t,size:r=32}={}){if(null===r)return e;if(e.length>r)throw new iz({size:e.length,targetSize:r,type:"bytes"});let n=new Uint8Array(r);for(let i=0;i<r;i++){let o="right"===t;n[o?i:r-i-1]=e[o?i:e.length-i-1]}return n}class iG extends i${constructor({max:e,min:t,signed:r,size:n,value:i}
vendor: 6,366 bytes, line 1
1){super(`Number "${i}" is not in safe ${n?`${8*n}-bit ${r?"signed":"unsigned"} `:""}integer range ${e?`(${t} to ${e})`:`(above ${t})`}`,{name:"IntegerOutOfRangeError"})}}class iW extends i${constructor({givenSize:e,maxSize:t}){super(`Size cannot exceed ${t} bytes. Given size: ${e} bytes.`,{name:"SizeOverflowError"})}}function iJ(e){return iF(e,{strict:!1})?Math.ceil((e.length-2)/2):e.length}function iZ(e,{size:t}){if(iJ(e)>t)throw new iW({givenSize:iJ(e),maxSize:t})}function iY(e,t={}){let{signed:r}=t;t.size&&iZ(e,{size:t.size});let n=BigInt(e);if(!r)return n;let i=(e.length-2)/2;return n<=(1n<<8n*BigInt(i)-1n)-1n?n:n-BigInt(`0x${"f".padStart(2*i,"f")}`)-1n}function iX(e,t={}){return Number(iY(e,t))}let iQ=Array.from({length:256},(e,t)=>t.toString(16).padStart(2,"0"));function i0(e,t={}){return"number"==typeof e||"bigint"==typeof e?i5(e,t):"string"==typeof e?i8(e,t):"boolean"==typeof e?i1(e,t):i2(e,t)}function i1(e,t={}){let r=`0x${Number(e)}`;return"number"==typeof t.size?(iZ(r,{size:t.size}),iq(r,{size:t.size})):r}function i2(e,t={}){let r="";for(let t=0;t<e.length;t++)r+=iQ[e[t]];let n=`0x${r}`;return"number"==typeof t.size?(iZ(n,{size:t.size}),iq(n,{dir:"right",size:t.size})):n}function i5(e,t={}){let r;let{signed:n,size:i}=t,o=BigInt(e);i?r=n?(1n<<8n*BigInt(i)-1n)-1n:2n**(8n*BigInt(i))-1n:"number"==typeof e&&(r=BigInt(Number.MAX_SAFE_INTEGER));let s="bigint"==typeof r&&n?-r-1n:0;if(r&&o>r||o<s){let t="bigint"==typeof e?"n":"";throw new iG({max:r?`${r}${t}`:void 0,min:`${s}${t}`,signed:n,size:i,value:`${e}${t}`})}let a=`0x${(n&&o<0?(1n<<BigInt(8*i))+BigInt(o):o).toString(16)}`;return i?iq(a,{size:i}):a}let i3=new TextEncoder;function i8(e,t={}){return i2(i3.encode(e),t)}let i6=new TextEncoder;function i4(e,t={}){return"number"==typeof e||"bigint"==typeof e?or(e,t):"boolean"==typeof e?i9(e,t):iF(e)?ot(e,t):on(e,t)}function i9(e,t={}){let r=new Uint8Array(1);return(r[0]=Number(e),"number"==typeof t.size)?(iZ(r,{size:t.size}),iq(r,{size:t.size})):r}let i7={zero:48,nine:57,A:65,F:70,a:97,f:102};function oe(e){return e>=i7.zero&&e<=i7.nine?e-i7.zero:e>=i7.A&&e<=i7.F?e-(i7.A-10):e>=i7.a&&e<=i7.f?e-(i7.a-10):void 0}function ot(e,t={}){let r=e;t.size&&(iZ(r,{size:t.size}),r=iq(r,{dir:"right",size:t.size}));let n=r.slice(2);n.length%2&&(n=`0${n}`);let i=n.length/2,o=new Uint8Array(i);for(let e=0,t=0;e<i;e++){let r=oe(n.charCodeAt(t++)),i=oe(n.charCodeAt(t++));if(void 0===r||void 0===i)throw new i$(`Invalid byte sequence ("${n[t-2]}${n[t-1]}" in "${n}").`);o[e]=16*r+i}return o}function or(e,t){return ot(i5(e,t))}function on(e,t={}){let r=i6.encode(e);return"number"==typeof t.size?(iZ(r,{size:t.size}),iq(r,{dir:"right",size:t.size})):r}var oi=r(62980),oo=r(43331);let os=BigInt(0),oa=BigInt(1),oc=BigInt(2),ou=BigInt(7),ol=BigInt(256),od=BigInt(113),of=[],oh=[],op=[];for(let e=0,t=oa,r=1,n=0;e<24;e++){[r,n]=[n,(2*r+3*n)%5],of.push(2*(5*n+r)),oh.push((e+1)*(e+2)/2%64);let i=os;for(let e=0;e<7;e++)(t=(t<<oa^(t>>ou)*od)%ol)&oc&&(i^=oa<<(oa<<BigInt(e))-oa);op.push(i)}let oy=(0,oi.lD)(op,!0),og=oy[0],om=oy[1],ob=(e,t,r)=>r>32?(0,oi.WM)(e,t,r):(0,oi.P5)(e,t,r),ov=(e,t,r)=>r>32?(0,oi.im)(e,t,r):(0,oi.B4)(e,t,r);function ow(e,t=24){let r=new Uint32Array(10);for(let n=24-t;n<24;n++){for(let t=0;t<10;t++)r[t]=e[t]^e[t+10]^e[t+20]^e[t+30]^e[t+40];for(let t=0;t<10;t+=2){let n=(t+8)%10,i=(t+2)%10,o=r[i],s=r[i+1],a=ob(o,s,1)^r[n],c=ov(o,s,1)^r[n+1];for(let r=0;r<50;r+=10)e[t+r]^=a,e[t+r+1]^=c}let t=e[2],i=e[3];for(let r=0;r<24;r++){let n=oh[r],o=ob(t,i,n),s=ov(t,i,n),a=of[r];t=e[a],i=e[a+1],e[a]=o,e[a+1]=s}for(let t=0;t<50;t+=10){for(let n=0;n<10;n++)r[n]=e[t+n];for(let n=0;n<10;n++)e[t+n]^=~r[(n+2)%10]&r[(n+4)%10]}e[0]^=og[n],e[1]^=om[n]}(0,oo.uH)(r)}class o_ extends oo.Vw{constructor(e,t,r,n=!1,i=24){if(super(),this.pos=0,this.posOut=0,this.finished=!1,this.destroyed=!1,this.enableXOF=!1,this.blockLen=e,this.suffix=t,this.outputLen=r,this.enableXOF=n,this.rounds=i,(0,oo.Fe)(r),!(0<e&&e<200))throw Error("only keccak-f1600 function is supported");this.state=new Uint8Array(200),this.state32=(0,oo.DH)(this.state)}clone(){return this._cloneInto()}keccak(){(0,oo.fd)(this.state32),ow(this.state32,this.rounds),(0,oo.fd)(this.state32),this.posOut=0,this.pos=0}update(e){(0,oo.CC)(this),e=(0,oo.ZJ)(e),(0,oo.DO)(e);let{blockLen:t,state:r}=this,n=e.length;for(let i=0;i<n;){let 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;let{state:e,suffix:t,pos:r,blockLen:n}=this;e[r]^=t,(128&t)!=0&&r===n-1&&this.keccak(),e[n-1]^=128,this.keccak()}writeInto(e){(0,oo.CC)(this,!1),(0,oo.DO)(e),this.finish();let t=this.state,{blockLen:r}=this;for(let n=0,i=e.length;n<i;){this.posOut>=r&&this.keccak();let o=Math.min(r-this.posOut,i-n);e.set(t.subarray(this.posOut,this.posOut+o),n),this.posOut+=o,n+=o}return e}xofInto(e){if(!this.enableXOF)throw Error("XOF is not possible for this instance");return this.writeInto(e)}xof(e){return(0,oo.Fe)(e),this.xofInto(new Uint8Array(e))}digestInto(e){if((0,oo.Ht)(e,this),this.finished)throw Error("digest() was already called");return this.writeInto(e),this.destroy(),e}digest(){return this.digestInto(new Uint8Array(this.outputLen))}destroy(){this.destroyed=!0,(0,oo.uH)(this.state)}_cloneInto(e){let{blockLen:t,suffix:r,outputLen:n,rounds:i,enableXOF:o}=this;return e||(e=new o_(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}}let oE=(a=1,c=136,u=32,(0,oo.qj)(()=>new o_(c,a,u)));function oS(e,t){let r=t||"hex",n=oE(iF(e,{strict:!1})?i4(e):e);return"bytes"===r?n:i0(n)}class ox extends Map{constructor(e){super(),Object.defineProperty(this,"maxSize",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.maxSize=e}get(e){let t=super.get(e);return super.has(e)&&void 0!==t&&(this.delete(e),super.set(e,t)),t}set(e,t){if(super.set(e,t),this.maxSize&&this.size>this.maxSize){let e=this.keys().next().value;e&&this.delete(e)}return this}}let oA=new ox(8192);function oI(e,t){if(oA.has(`${e}.${t}`))return oA.get(`${e}.${t}`);let r=t?`${t}${e.toLowerCase()}`:e.substring(2).toLowerCase(),n=oS(on(r),"bytes"),i=(t?r.substring(`${t}0x`.length):r).split("");for(let e=0;e<40;e+=2)n[e>>1]>>4>=8&&i[e]&&(i[e]=i[e].toUpperCase()),(15&n[e>>1])>
1=8&&i[e+1]&&(i[e+1]=i[e+1].toUpperCase());let o=`0x${i.join("")}`;return oA.set(`${e}.${t}`,o),o}function oO(e){let t=oS(`0x${e.substring(4)}`).substring(26);return oI(`0x${t}`)}async function oT({hash:e,signature:t}){let n=iF(e)?e:i0(e),{secp256k1:i}=await r.e(634).then(r.bind(r,66634)),o=(()=>{if("object"==typeof t&&"r"in t&&"s"in t){let{r:e,s:r,v:n,yParity:o}=t,s=oP(Number(o??n));return new i.Signature(iY(e),iY(r)).addRecoveryBit(s)}let e=iF(t)?t:i0(t);if(65!==iJ(e))throw Error("invalid signature length");let r=oP(iX(`0x${e.slice(130)}`));return i.Signature.fromCompact(e.substring(2,130)).addRecoveryBit(r)})().recoverPublicKey(n.substring(2)).toHex(!1);return`0x${o}`}function oP(e){if(0===e||1===e)return e;if(27===e)return 0;if(28===e)return 1;throw Error("Invalid yParityOrV value")}async function oM({hash:e,signature:t}){return oO(await oT({hash:e,signature:t}))}let oN=function(e){if(e.length>=255)throw TypeError("Alphabet too long");let t=new Uint8Array(256);for(let e=0;e<t.length;e++)t[e]=255;for(let r=0;r<e.length;r++){let n=e.charAt(r),i=n.charCodeAt(0);if(255!==t[i])throw TypeError(n+" is ambiguous");t[i]=r}let r=e.length,n=e.charAt(0),i=Math.log(r)/Math.log(256),o=Math.log(256)/Math.log(r);function s(e){if("string"!=typeof e)throw TypeError("Expected String");if(0===e.length)return new Uint8Array;let o=0,s=0,a=0;for(;e[o]===n;)s++,o++;let c=(e.length-o)*i+1>>>0,u=new Uint8Array(c);for(;o<e.length;){let n=e.charCodeAt(o);if(n>255)return;let i=t[n];if(255===i)return;let s=0;for(let e=c-1;(0!==i||s<a)&&-1!==e;e--,s++)i+=r*u[e]>>>0,u[e]=i%256>>>0,i=i/256>>>0;if(0!==i)throw Error("Non-zero carry");a=s,o++}let l=c-a;for(;l!==c&&0===u[l];)l++;let d=new Uint8Array(s+(c-l)),f=s;for(;l!==c;)d[f++]=u[l++];return d}function a(e){let t=s(e);if(t)return t;throw Error("Non-base"+r+" character")}return{encode:function(t){if(t instanceof Uint8Array||(ArrayBuffer.isView(t)?t=new Uint8Array(t.buffer,t.byteOffset,t.byteLength):Array.isArray(t)&&(t=Uint8Array.from(t))),!(t instanceof Uint8Array))throw TypeError("Expected Uint8Array");if(0===t.length)return"";let i=0,s=0,a=0,c=t.length;for(;a!==c&&0===t[a];)a++,i++;let u=(c-a)*o+1>>>0,l=new Uint8Array(u);for(;a!==c;){let e=t[a],n=0;for(let t=u-1;(0!==e||n<s)&&-1!==t;t--,n++)e+=256*l[t]>>>0,l[t]=e%r>>>0,e=e/r>>>0;if(0!==e)throw Error("Non-zero carry");s=n,a++}let d=u-s;for(;d!==u&&0===l[d];)d++;let f=n.repeat(i);for(;d<u;++d)f+=e.charAt(l[d]);return f},decodeUnsafe:s,decode:a}}("123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz");function ok(e){return`${e<0?"-":""}0x${Math.abs(e).toString(16).padStart(2,"0")}`}class oC{constructor(e,t){this.type=e,this.data=t}}class oD extends Error{constructor(e){super(e),Object.setPrototypeOf(this,Object.create(oD.prototype)),Object.defineProperty(this,"name",{configurable:!0,enumerable:!1,value:oD.name})}}let oj=0xffffffff;function oR(e,t,r){let n=r/0x100000000,i=r;e.setUint32(t,n),e.setUint32(t+4,i)}function oL(e,t,r){let n=Math.floor(r/0x100000000),i=r;e.setUint32(t,n),e.setUint32(t+4,i)}function oB(e,t){return 0x100000000*e.getInt32(t)+e.getUint32(t+4)}function oU(e,t){return 0x100000000*e.getUint32(t)+e.getUint32(t+4)}let o$=0xffffffff,oK=0x3ffffffff;function oF({sec:e,nsec:t}){if(e>=0&&t>=0&&e<=oK){if(0===t&&e<=o$){let t=new Uint8Array(4);return new DataView(t.buffer).setUint32(0,e),t}{let r=e/0x100000000,n=0xffffffff&e,i=new Uint8Array(8),o=new DataView(i.buffer);return o.setUint32(0,t<<2|3&r),o.setUint32(4,n),i}}{let r=new Uint8Array(12),n=new DataView(r.buffer);return n.setUint32(0,t),oL(n,4,e),r}}function oz(e){let t=e.getTime(),r=Math.floor(t/1e3),n=(t-1e3*r)*1e6,i=Math.floor(n/1e9);return{sec:r+i,nsec:n-1e9*i}}function oq(e){let t=new DataView(e.buffer,e.byteOffset,e.byteLength);switch(e.byteLength){case 4:return{sec:t.getUint32(0),nsec:0};case 8:{let e=t.getUint32(0);return{sec:(3&e)*0x100000000+t.getUint32(4),nsec:e>>>2}}case 12:return{sec:oB(t,4),nsec:t.getUint32(0)};default:throw new oD(`Unrecognized data size for timestamp (expected 4, 8, or 12): ${e.length}`)}}let oV={type:-1,encode:function(e){return e instanceof Date?oF(oz(e)):null},decode:function(e){let t=oq(e);return new Date(1e3*t.sec+t.nsec/1e6)}};class oH{constructor(){this.builtInEncoders=[],this.builtInDecoders=[],this.encoders=[],this.decoders=[],this.register(oV)}register({type:e,encode:t,decode:r}){if(e>=0)this.encoders[e]=t,this.decoders[e]=r;else{let n=-1-e;this.builtInEncoders[n]=t,this.builtInDecoders[n]=r}}tryToEncode(e,t){for(let r=0;r<this.builtInEncoders.length;r++){let n=this.builtInEncoders[r];if(null!=n){let i=n(e,t);if(null!=i)return new oC(-1-r,i)}}for(let r=0;r<this.encoders.length;r++){let n=this.encoders[r];if(null!=n){let i=n(e,t);if(null!=i)return new oC(r,i)}}return e instanceof oC?e:null}decode(e,t,r){let n=t<0?this.builtInDecoders[-1-t]:this.decoders[t];return n?n(e,t,r):new oC(t,e)}}function oG(e){let t=e.length,r=0,n=0;for(;n<t;){let i=e.charCodeAt(n++);
1if((0xffffff80&i)==0){r++;continue}if((0xfffff800&i)==0)r+=2;else{if(i>=55296&&i<=56319&&n<t){let t=e.charCodeAt(n);(64512&t)==56320&&(++n,i=((1023&i)<<10)+(1023&t)+65536)}(0xffff0000&i)==0?r+=3:r+=4}}return r}function oW(e,t,r){let n=e.length,i=r,o=0;for(;o<n;){let r=e.charCodeAt(o++);if((0xffffff80&r)==0){t[i++]=r;continue}if((0xfffff800&r)==0)t[i++]=r>>6&31|192;else{if(r>=55296&&r<=56319&&o<n){let t=e.charCodeAt(o);(64512&t)==56320&&(++o,r=((1023&r)<<10)+(1023&t)+65536)}(0xffff0000&r)==0?t[i++]=r>>12&15|224:(t[i++]=r>>18&7|240,t[i++]=r>>12&63|128),t[i++]=r>>6&63|128}t[i++]=63&r|128}}oH.defaultCodec=new oH;let oJ=new TextEncoder,oZ=50;function oY(e,t,r){oJ.encodeInto(e,t.subarray(r))}function oX(e,t,r){e.length>oZ?oY(e,t,r):oW(e,t,r)}let oQ=4096;function o0(e,t,r){let n=t,i=n+r,o=[],s="";for(;n<i;){let t=e[n++];if((128&t)==0)o.push(t);else if((224&t)==192){let r=63&e[n++];o.push((31&t)<<6|r)}else if((240&t)==224){let r=63&e[n++],i=63&e[n++];o.push((31&t)<<12|r<<6|i)}else if((248&t)==240){let r=(7&t)<<18|(63&e[n++])<<12|(63&e[n++])<<6|63&e[n++];r>65535&&(r-=65536,o.push(r>>>10&1023|55296),r=56320|1023&r),o.push(r)}else o.push(t);o.length>=oQ&&(s+=String.fromCharCode(...o),o.length=0)}return o.length>0&&(s+=String.fromCharCode(...o)),s}let o1=new TextDecoder,o2=200;function o5(e,t,r){let n=e.subarray(t,t+r);return o1.decode(n)}function o3(e,t,r){return r>o2?o5(e,t,r):o0(e,t,r)}function o8(e){return e instanceof ArrayBuffer||"undefined"!=typeof SharedArrayBuffer&&e instanceof SharedArrayBuffer}function o6(e){return e instanceof Uint8Array?e:ArrayBuffer.isView(e)?new Uint8Array(e.buffer,e.byteOffset,e.byteLength):o8(e)?new Uint8Array(e):Uint8Array.from(e)}let o4=16,o9=16;class o7{constructor(e=o4,t=o9){this.hit=0,this.miss=0,this.maxKeyLength=e,this.maxLengthPerKey=t,this.caches=[];for(let e=0;e<this.maxKeyLength;e++)this.caches.push([])}canBeCached(e){return e>0&&e<=this.maxKeyLength}find(e,t,r){let n=this.caches[r-1];t:for(let i of n){let n=i.bytes;for(let i=0;i<r;i++)if(n[i]!==e[t+i])continue t;return i.str}return null}store(e,t){let r=this.caches[e.length-1],n={bytes:e,str:t};r.length>=this.maxLengthPerKey?r[Math.random()*r.length|0]=n:r.push(n)}decode(e,t,r){let n=this.find(e,t,r);if(null!=n)return this.hit++,n;this.miss++;let i=o0(e,t,r),o=Uint8Array.prototype.slice.call(e,t,t+r);return this.store(o,i),i}}let se="array",st="map_key",sr="map_value",sn=e=>{if("string"==typeof e||"number"==typeof e)return e;throw new oD("The type of key must be string or number but "+typeof e)};class si{constructor(){this.stack=[],this.stackHeadPosition=-1}get length(){return this.stackHeadPosition+1}top(){return this.stack[this.stackHeadPosition]}pushArrayState(e){let t=this.getUninitializedStateFromPool();t.type=se,t.position=0,t.size=e,t.array=Array(e)}pushMapState(e){let t=this.getUninitializedStateFromPool();t.type=st,t.readCount=0,t.size=e,t.map={}}getUninitializedStateFromPool(){if(this.stackHeadPosition++,this.stackHeadPosition===this.stack.length){let e={type:void 0,size:0,array:void 0,position:0,readCount:0,map:void 0,key:null};this.stack.push(e)}return this.stack[this.stackHeadPosition]}release(e){if(this.stack[this.stackHeadPosition]!==e)throw Error("Invalid stack state. Released state is not on top of the stack.");if(e.type===se){let t=e;t.size=0,t.array=void 0,t.position=0,t.type=void 0}if(e.type===st||e.type===sr){let t=e;t.size=0,t.map=void 0,t.readCount=0,t.type=void 0}this.stackHeadPosition--}reset(){this.stack.length=0,this.stackHeadPosition=-1}}let so=-1,ss=new DataView(new ArrayBuffer(0)),sa=new Uint8Array(ss.buffer);try{ss.getInt8(0)}catch(e){if(!(e instanceof RangeError))throw Error("This module is not supported in the current JavaScript engine because DataView does not throw RangeError on out-of-bounds access")}let sc=RangeError("Insufficient data"),su=new o7;class sl{constructor(e){this.totalPos=0,this.pos=0,this.view=ss,this.bytes=sa,this.headByte=so,this.stack=new si,this.entered=!1,this.extensionCodec=e?.extensionCodec??oH.defaultCodec,this.context=e?.context,this.useBigInt64=e?.useBigInt64??!1,this.rawStrings=e?.rawStrings??!1,this.maxStrLength=e?.maxStrLength??oj,this.maxBinLength=e?.maxBinLength??oj,this.maxArrayLength=e?.maxArrayLength??oj,this.maxMapLength=e?.maxMapLength??oj,this.maxExtLength=e?.maxExtLength??oj,this.keyDecoder=e?.keyDecoder!==void 0?e.keyDecoder:su,this.mapKeyConverter=e?.mapKeyConverter??sn}clone(){return new sl({extensionCodec:this.extensionCodec,context:this.context,useBigInt64:this.useBigInt64,rawStrings:this.rawStrings,maxStrLength:this.maxStrLength,maxBinLength:this.maxBinLength,maxArrayLength:this.maxArrayLength,maxMapLength:this.maxMapLength,maxExtLength:this.maxExtLength,keyDecoder:this.keyDecoder})}reinitializeState(){this.totalPos=0,this.headByte=so,this.stack.reset()}setBuffer(e){let t=o6(e);this.bytes=t,this.view=new DataView(t.buffer,t.byteOffset,t.byteLength),this.pos=0}appendBuffer(e){if(this.headByte!==so||this.hasRemaining(1)){let t=this.bytes.subarray(this.pos),r=o6(e),n=new Uint8Array(t.length+r.length);n.set(t),n.set(r,t.length),this.setBuffer(n)}else this.setBuffer(e)}hasRemaining(e){return this.view.byteLength-this.pos>=e}createExtraByteError(e){let{view:t,pos:r}=this;return RangeError(`Extra ${t.byteLength-r} of ${t.byteLength} byte(s) found at buffer[${e}]`)}decode(e){if(this.entered)return this.clone().decode(e);try{this.entered=!0,this.reinitializeState(),this.setBuffer(e);let t=this.doDecodeSync();if(this.hasRemaining(1))throw this.createExtraByteError(this.pos);return t}finally{this.entered=!1}}*decodeMulti(e){if(this.entered){let t=this.clone();yield*t.decodeMulti(e);return}try{for(this.entered=!0,this.reinitializeState(),this.setBuffer(e);this.hasRemaining(1);)yield this.doDecodeSync()}finally{this.entered=!1}}async decodeAsync(e){if(this.entered)return this.clone().decodeAsync(e);try{let t;this.entered=!0;let r=!1;for await(let n of e){if(r)throw this.entered=!1,this.createExtraByteError(this.totalPos);this.appendBuffer(n);try{t=this.doDecodeSync(),r=!0}catch(e){if(!(e instanceof RangeError))throw e}this.totalPos+=this.pos}if(r){if(this.hasRemaining(1))throw this.createExtraByteError(this.totalPos);return t}let{headByte:n,pos:i,totalPos:o}=this;throw RangeError(`Insufficient data in parsing ${ok(n)} at ${o} (${i} in the current buffer)`)}finally{this.entered=!1}}decodeArrayStream(e){return this.decodeMultiAsync(e,!0)}decodeStream(e){return this.decodeMultiAsync(e,!1)}async *decodeMultiAsync(e,t){if(this.entered){let r=this.clone();yield*r.decodeMultiAsync(e,t);return}try{this.entered=!0;let r=t,n=-1;for await(let i of e){if(t&&0===n)throw this.createExtraByteError(this.totalPos);this.appendBuffer(i),r&&(n=this.readArraySize(),r=!1,this.complete());try{for(;yield this.doDecodeSync(),0!=--n;);}catch(e){if(!(e instanceof RangeError))throw e}this.totalPos+=this.pos}}finally{this.entered=!1}}doDecodeSync(){r:for(;;){let e;let t=this.readHeadByte();if(t>=224)e=t-256;else if(t<192){if(t<128)e=t;else if(t<144){let r=t-128;if(0!==r){this.pushMapState(r),this.complete();continue}e={}}else if(t<160){let r=t-144;if(0!==r){this.pushArrayState(r),this.complete();continue}e=[]}else{let r=t-160;e=this.decodeString(r,0)}}else if(192===t)e=null;else if(194===t)e=!1;else if(195===t)e=!0;else if(202===t)e=this.readF32();else if(203===t)e=this.readF64();else if(204===t)e=this.readU8();else if(205===t)e=this.readU16();else if(206===t)e=this.readU32();else if(207===t)e=this.useBigInt64?this.readU64AsBigInt():this.readU64();else if(208===t)e=this.readI8();else if(209===t)e=this.readI16();else if(210===t)e=this.readI32();else if(211===t)e=this.useBigInt64?this.readI64AsBigInt():this.readI64();else if(217===t){let t=this.lookU8();e=this.decodeString(t,1)}else if(218===t){let t=this.lookU16();e=this.decodeString(t,2)}else if(219===t){let t=this.lookU32();e=this.decodeString(t,4)}else if(220===t){let t=this.readU16();if(0!==t){this.pushArrayState(t),this.complete();continue}e=[]}else if(221===t){let t=this.readU32();if(0!==t){this.pushArrayState(t),this.complete();continue}e=[]}else if(222===t){let t=this.readU16();if(0!==t){this.pushMapState(t),this.complete();continue}e={}}else if(223===t){let t=this.readU32();if(0!==t){this.pushMapState(t),this.complete();continue}e={}}else if(196===t){let t=this.lookU8();e=this.decodeBinary(t,1)}else if(197===t){let t=this.lookU16();e=this.decodeBinary(t,2)}else if(198===t){let t=this.lookU32();e=this.decodeBinary(t,4)}else if(212===t)e=this.decodeExtension(1,0);else if(213===t)e=this.decodeExtension(2,0);else if(214===t)e=this.decodeExtension(4,0);else if(215===t)e=this.decodeExtension(8,0);else if(216===t)e=this.decodeExtension(16,0);else if(199===t){let t=this.lookU8();e=this.decodeExtension(t,1)}else if(200===t){let t=this.lookU16();e=this.decodeExtension(t,2)}else if(201===t){let t=this.lookU32();e=this.decodeExtension(t,4)}else throw new oD(`Unrecognized type byte: ${ok(t)}`);this.complete();let r=this.stack;for(;r.length>0;){let t=r.top();if(t.type===se){if(t.array[t.position]=e,t.position++,t.position===t.size)e=t.array,r.release(t);else continue r}else if(t.type===st){if("__proto__"===e)throw new oD("The key __proto__ is not allowed");t.key=this.mapKeyConverter(e),t.type=sr;continue r}else if(t.map[t.key]=e,t.readCount++,t.readCount===t.size)e=t.map,r.release(t);else{t.key=null,t.type=st;continue r}}return e}}readHeadByte(){return this.headByte===so&&(this.headByte=this.readU8()),this.headByte}complete(){this.headByte=so}readArraySize(){let e=this.readHeadByte();switch(e){case 220:return this.readU16();case 221:return this.readU32();default:if(e<160)return e-144;throw new oD(`Unrecognized array type byte: ${ok(e)}`)}}pushMapState(e){if(e>
1this.maxMapLength)throw new oD(`Max length exceeded: map length (${e}) > maxMapLengthLength (${this.maxMapLength})`);this.stack.pushMapState(e)}pushArrayState(e){if(e>this.maxArrayLength)throw new oD(`Max length exceeded: array length (${e}) > maxArrayLength (${this.maxArrayLength})`);this.stack.pushArrayState(e)}decodeString(e,t){return!this.rawStrings||this.stateIsMapKey()?this.decodeUtf8String(e,t):this.decodeBinary(e,t)}decodeUtf8String(e,t){let r;if(e>this.maxStrLength)throw new oD(`Max length exceeded: UTF-8 byte length (${e}) > maxStrLength (${this.maxStrLength})`);if(this.bytes.byteLength<this.pos+t+e)throw sc;let n=this.pos+t;return r=this.stateIsMapKey()&&this.keyDecoder?.canBeCached(e)?this.keyDecoder.decode(this.bytes,n,e):o3(this.bytes,n,e),this.pos+=t+e,r}stateIsMapKey(){return this.stack.length>0&&this.stack.top().type===st}decodeBinary(e,t){if(e>this.maxBinLength)throw new oD(`Max length exceeded: bin length (${e}) > maxBinLength (${this.maxBinLength})`);if(!this.hasRemaining(e+t))throw sc;let r=this.pos+t,n=this.bytes.subarray(r,r+e);return this.pos+=t+e,n}decodeExtension(e,t){if(e>
1this.maxExtLength)throw new oD(`Max length exceeded: ext length (${e}) > maxExtLength (${this.maxExtLength})`);let r=this.view.getInt8(this.pos+t),n=this.decodeBinary(e,t+1);return this.extensionCodec.decode(n,r,this.context)}lookU8(){return this.view.getUint8(this.pos)}lookU16(){return this.view.getUint16(this.pos)}lookU32(){return this.view.getUint32(this.pos)}readU8(){let e=this.view.getUint8(this.pos);return this.pos++,e}readI8(){let e=this.view.getInt8(this.pos);return this.pos++,e}readU16(){let e=this.view.getUint16(this.pos);return this.pos+=2,e}readI16(){let e=this.view.getInt16(this.pos);return this.pos+=2,e}readU32(){let e=this.view.getUint32(this.pos);return this.pos+=4,e}readI32(){let e=this.view.getInt32(this.pos);return this.pos+=4,e}readU64(){let e=oU(this.view,this.pos);return this.pos+=8,e}readI64(){let e=oB(this.view,this.pos);return this.pos+=8,e}readU64AsBigInt(){let e=this.view.getBigUint64(this.pos);return this.pos+=8,e}readI64AsBigInt(){let e=this.view.getBigInt64(this.pos);return this.pos+=8,e}readF32(){let e=this.view.getFloat32(this.pos);return this.pos+=4,e}readF64(){let e=this.view.getFloat64(this.pos);return this.pos+=8,e}}function sd(e,t){return new sl(t).decode(e)}let sf=100,sh=2048;class sp{constructor(e){this.entered=!1,this.extensionCodec=e?.extensionCodec??oH.defaultCodec,this.context=e?.context,this.useBigInt64=e?.useBigInt64??!1,this.maxDepth=e?.maxDepth??sf,this.initialBufferSize=e?.initialBufferSize??sh,this.sortKeys=e?.sortKeys??!1,this.forceFloat32=e?.forceFloat32??!1,this.ignoreUndefined=e?.ignoreUndefined??!1,this.forceIntegerToFloat=e?.forceIntegerToFloat??!1,this.pos=0,this.view=new DataView(new ArrayBuffer(this.initialBufferSize)),this.bytes=new Uint8Array(this.view.buffer)}clone(){return new sp({extensionCodec:this.extensionCodec,context:this.context,useBigInt64:this.useBigInt64,maxDepth:this.maxDepth,initialBufferSize:this.initialBufferSize,sortKeys:this.sortKeys,forceFloat32:this.forceFloat32,ignoreUndefined:this.ignoreUndefined,forceIntegerToFloat:this.forceIntegerToFloat})}reinitializeState(){this.pos=0}encodeSharedRef(e){if(this.entered)return this.clone().encodeSharedRef(e);try{return this.entered=!0,this.reinitializeState(),this.doEncode(e,1),this.bytes.subarray(0,this.pos)}finally{this.entered=!1}}encode(e){if(this.entered)return this.clone().encode(e);try{return this.entered=!0,this.reinitializeState(),this.doEncode(e,1),this.bytes.slice(0,this.pos)}finally{this.entered=!1}}doEncode(e,t){if(t>this.maxDepth)throw Error(`Too deep objects in depth ${t}`);null==e?this.encodeNil():"boolean"==typeof e?this.encodeBoolean(e):"number"==typeof e?this.forceIntegerToFloat?this.encodeNumberAsFloat(e):this.encodeNumber(e):"string"==typeof e?this.encodeString(e):this.useBigInt64&&"bigint"==typeof e?this.encodeBigInt64(e):this.encodeObject(e,t)}ensureBufferSizeToWrite(e){let t=this.pos+e;this.view.byteLength<t&&this.resizeBuffer(2*t)}resizeBuffer(e){let t=new ArrayBuffer(e),r=new Uint8Array(t),n=new DataView(t);r.set(this.bytes),this.view=n,this.bytes=r}encodeNil(){this.writeU8(192)}encodeBoolean(e){!1===e?this.writeU8(194):this.writeU8(195)}encodeNumber(e){!this.forceIntegerToFloat&&Number.isSafeInteger(e)?e>=0?e<128?this.writeU8(e):e<256?(this.writeU8(204),this.writeU8(e)):e<65536?(this.writeU8(205),this.writeU16(e)):e<0x100000000?(this.writeU8(206),this.writeU32(e)):this.useBigInt64?this.encodeNumberAsFloat(e):(this.writeU8(207),this.writeU64(e)):e>=-32?this.writeU8(224|e+32):e>=-128?(this.writeU8(208),this.writeI8(e)):e>=-32768?(this.writeU8(209),this.writeI16(e)):e>=-0x80000000?(this.writeU8(210),this.writeI32(e)):this.useBigInt64?this.encodeNumberAsFloat(e):(this.writeU8(211),this.writeI64(e)):this.encodeNumberAsFloat(e)}encodeNumberAsFloat(e){this.forceFloat32?(this.writeU8(202),this.writeF32(e)):(this.writeU8(203),this.writeF64(e))}encodeBigInt64(e){e>=BigInt(0)?(this.writeU8(207),this.writeBigUint64(e)):(this.writeU8(211),this.writeBigInt64(e))}writeStringHeader(e){if(e<32)this.writeU8(160+e);else if(e<256)this.writeU8(217),this.writeU8(e);else if(e<65536)this.writeU8(218),this.writeU16(e);else if(e<0x100000000)this.writeU8(219),this.writeU32(e);else throw Error(`Too long string: ${e} bytes in UTF-8`)}encodeString(e){let t=5,r=oG(e);this.ensureBufferSizeToWrite(t+r),this.writeStringHeader(r),oX(e,this.bytes,this.pos),this.pos+=r}encodeObject(e,t){let r=this.extensionCodec.tryToEncode(e,this.context);if(null!=r)this.encodeExtension(r);else if(Array.isArray(e))this.encodeArray(e,t);else if(ArrayBuffer.isView(e))this.encodeBinary(e);else if("object"==typeof e)this.encodeMap(e,t);else throw Error(`Unrecognized object: ${Object.prototype.toString.apply(e)}`)}encodeBinary(e){let t=e.byteLength;if(t<256)this.writeU8(196),this.writeU8(t);else if(t<65536)this.writeU8(197),this.writeU16(t);else if(t<0x100000000)this.writeU8(198),this.writeU32(t);else throw Error(`Too large binary: ${t}`);let r=o6(e);this.writeU8a(r)}encodeArray(e,t){let r=e.length;if(r<16)this.writeU8(144+r);else if(r<65536)this.writeU8(220),this.writeU16(r);else if(r<0x100000000)this.writeU8(221),this.writeU32(r);else throw Error(`Too large array: ${r}`);for(let r of e)this.doEncode(r,t+1)}countWithoutUndefined(e,t){let r=0;for(let n of t)void 0!==e[n]&&r++;return r}encodeMap(e,t){let r=Object.keys(e);this.sortKeys&&r.sort();let n=this.ignoreUndefined?this.countWithoutUndefined(e,r):r.length;if(n<16)this.writeU8(128+n);else if(n<65536)this.writeU8(222),this.writeU16(n);else if(n<0x100000000)this.writeU8(223),this.writeU32(n);else throw Error(`Too large map object: ${n}`);for(let n of r){let r=e[n];this.ignoreUndefined&&void 0===r||(this.encodeString(n),this.doEncode(r,t+1))}}encodeExtension(e){if("function"==typeof e.data){let t=e.data(this.pos+6),r=t.length;if(r>=0x100000000)throw Error(`Too large extension object: ${r}`);this.writeU8(201),this.writeU32(r),this.writeI8(e.type),this.writeU8a(t);return}let t=e.data.length;if(1===t)this.writeU8(212);else if(2===t)this.writeU8(213);else if(4===t)this.writeU8(214);else if(8===t)this.writeU8(215);else if(16===t)this.writeU8(216);else if(t<256)this.writeU8(199),this.writeU8(t);else if(t<65536)this.writeU8(200),this.writeU16(t);else if(t<0x100000000)this.writeU8(201),this.writeU32(t);else throw Error(`Too large extension object: ${t}`);this.writeI8(e.type),this.writeU8a(e.data)}writeU8(e){this.ensureBufferSizeToWrite(1),this.view.setUint8(this.pos,e),this.pos++}writeU8a(e){let t=e.length;this.ensureBufferSizeToWrite(t),this.bytes.set(e,this.pos),this.pos+=t}writeI8(e){this.ensureBufferSizeToWrite(1),this.view.setInt8(this.pos,e),this.pos++}writeU16(e){this.ensureBufferSizeToWrite(2),this.view.setUint16(this.pos,e),this.pos+=2}writeI16(e){this.ensureBufferSizeToWrite(2),this.view.setInt16(this.pos,e),this.pos+=2}writeU32(e){this.ensureBufferSizeToWrite(4),this.view.setUint32(this.pos,e),this.pos+=4}writeI32(e){this.ensureBufferSizeToWrite(4),this.view.setInt32(this.pos,e),this.pos+=4}writeF32(e){this.ensureBufferSizeToWrite(4),this.view.setFloat32(this.pos,e),this.pos+=4}writeF64(e){this.ensureBufferSizeToWrite(8),this.view.setFloat64(this.pos,e),this.pos+=8}writeU64(e){this.ensureBufferSizeToWrite(8),oR(this.view,this.pos,e),this.pos+=8}writeI64(e){this.ensureBufferSizeToWrite(8),oL(this.view,this.pos,e),this.pos+=8}writeBigUint64(e){this.ensureBufferSizeToWrite(8),this.view.setBigUint64(this.pos,e),this.pos+=8}writeBigInt64(e){this.ensureBufferSizeToWrite(8),this.view.setBigInt64(this.pos,e),this.pos+=8}}function sy(e,t){return new sp(t).encodeSharedRef(e)}var sg=r(63947);function sm(e){return null!=globalThis.Buffer?new Uint8Array(e.buffer,e.byteOffset,e.byteLength):e}
1function sb(e=0){return null!=globalThis.Buffer&&null!=globalThis.Buffer.allocUnsafe?sm(globalThis.Buffer.allocUnsafe(e)):new Uint8Array(e)}function sv(e,t){t||(t=e.reduce((e,t)=>e+t.length,0));let r=sb(t),n=0;for(let t of e)r.set(t,n),n+=t.length;return sm(r)}let sw=function(e,t){if(e.length>=255)throw TypeError("Alphabet too long");for(var r=new Uint8Array(256),n=0;n<r.length;n++)r[n]=255;for(var i=0;i<e.length;i++){var o=e.charAt(i),s=o.charCodeAt(0);if(255!==r[s])throw TypeError(o+" is ambiguous");r[s]=i}var a=e.length,c=e.charAt(0),u=Math.log(a)/Math.log(256),l=Math.log(256)/Math.log(a);function d(e){if("string"!=typeof e)throw TypeError("Expected String");if(0===e.length)return new Uint8Array;var t=0;if(" "!==e[0]){for(var n=0,i=0;e[t]===c;)n++,t++;for(var o=(e.length-t)*u+1>>>0,s=new Uint8Array(o);e[t];){var l=r[e.charCodeAt(t)];if(255===l)return;for(var d=0,f=o-1;(0!==l||d<i)&&-1!==f;f--,d++)l+=a*s[f]>>>0,s[f]=l%256>>>0,l=l/256>>>0;if(0!==l)throw Error("Non-zero carry");i=d,t++}if(" "!==e[t]){for(var h=o-i;h!==o&&0===s[h];)h++;for(var p=new Uint8Array(n+(o-h)),y=n;h!==o;)p[y++]=s[h++];return p}}}function f(e){var r=d(e);if(r)return r;throw Error(`Non-${t} character`)}return{encode:function(t){if(t instanceof Uint8Array||(ArrayBuffer.isView(t)?t=new Uint8Array(t.buffer,t.byteOffset,t.byteLength):Array.isArray(t)&&(t=Uint8Array.from(t))),!(t instanceof Uint8Array))throw TypeError("Expected Uint8Array");if(0===t.length)return"";for(var r=0,n=0,i=0,o=t.length;i!==o&&0===t[i];)i++,r++;for(var s=(o-i)*l+1>>>0,u=new Uint8Array(s);i!==o;){for(var d=t[i],f=0,h=s-1;(0!==d||f<n)&&-1!==h;h--,f++)d+=256*u[h]>>>0,u[h]=d%a>>>0,d=d/a>>>0;if(0!==d)throw Error("Non-zero carry");n=f,i++}for(var p=s-n;p!==s&&0===u[p];)p++;for(var y=c.repeat(r);p<s;++p)y+=e.charAt(u[p]);return y},decodeUnsafe:d,decode:f}};new Uint8Array(0);let s_=(e,t)=>{if(e===t)return!0;if(e.byteLength!==t.byteLength)return!1;for(let r=0;r<e.byteLength;r++)if(e[r]!==t[r])return!1;return!0},sE=e=>{if(e instanceof Uint8Array&&"Uint8Array"===e.constructor.name)return e;if(e instanceof ArrayBuffer)return new Uint8Array(e);if(ArrayBuffer.isView(e))return new Uint8Array(e.buffer,e.byteOffset,e.byteLength);throw Error("Unknown type, must be binary type")},sS=e=>new TextEncoder().encode(e),sx=e=>
1new TextDecoder().decode(e);class sA{constructor(e,t,r){this.name=e,this.prefix=t,this.baseEncode=r}encode(e){if(e instanceof Uint8Array)return`${this.prefix}${this.baseEncode(e)}`;throw Error("Unknown type, must be binary type")}}class sI{constructor(e,t,r){if(this.name=e,this.prefix=t,void 0===t.codePointAt(0))throw Error("Invalid prefix character");this.prefixCodePoint=t.codePointAt(0),this.baseDecode=r}decode(e){if("string"==typeof e){if(e.codePointAt(0)!==this.prefixCodePoint)throw Error(`Unable to decode multibase string ${JSON.stringify(e)}, ${this.name} decoder only supports inputs prefixed with ${this.prefix}`);return this.baseDecode(e.slice(this.prefix.length))}throw Error("Can only multibase decode strings")}or(e){return sT(this,e)}}class sO{constructor(e){this.decoders=e}or(e){return sT(this,e)}decode(e){let t=e[0],r=this.decoders[t];if(r)return r.decode(e);throw RangeError(`Unable to decode multibase string ${JSON.stringify(e)}, only inputs prefixed with ${Object.keys(this.decoders)} are supported`)}}let sT=(e,t)=>new sO({...e.decoders||{[e.prefix]:e},...t.decoders||{[t.prefix]:t}});class sP{constructor(e,t,r,n){this.name=e,this.prefix=t,this.baseEncode=r,this.baseDecode=n,this.encoder=new sA(e,t,r),this.decoder=new sI(e,t,n)}encode(e){return this.encoder.encode(e)}decode(e){return this.decoder.decode(e)}}let sM=({name:e,prefix:t,encode:r,decode:n})=>new sP(e,t,r,n),sN=({prefix:e,name:t,alphabet:r})=>{let{encode:n,decode:i}=sw(r,t);return sM({prefix:e,name:t,encode:n,decode:e=>sE(i(e))})},sk=(e,t,r,n)=>{let i={};for(let e=0;e<t.length;++e)i[t[e]]=e;let o=e.length;for(;"="===e[o-1];)--o;let s=new Uint8Array(o*r/8|0),a=0,c=0,u=0;for(let t=0;t<o;++t){let o=i[e[t]];if(void 0===o)throw SyntaxError(`Non-${n} character`);c=c<<r|o,(a+=r)>=8&&(a-=8,s[u++]=255&c>>a)}if(a>=r||255&c<<8-a)throw SyntaxError("Unexpected end of data");return s},sC=(e,t,r)=>{let n="="===t[t.length-1],i=(1<<r)-1,o="",s=0,a=0;for(let n=0;n<e.length;++n)for(a=a<<8|e[n],s+=8;s>r;)s-=r,o+=t[i&a>>s];if(s&&(o+=t[i&a<<r-s]),n)for(;o.length*r&7;)o+="=";return o},sD=({name:e,prefix:t,bitsPerChar:r,alphabet:n})=>sM({prefix:t,name:e,encode:e=>sC(e,n,r),decode:t=>sk(t,n,r,e)}),sj=sM({prefix:"\0",name:"identity",encode:e=>sx(e),decode:e=>sS(e)}),sR=sD({prefix:"0",name:"base2",alphabet:"01",bitsPerChar:1}),sL=sD({prefix:"7",name:"base8",alphabet:"01234567",bitsPerChar:3}),sB=sN({prefix:"9",name:"base10",alphabet:"0123456789"}),sU=sD({prefix:"f",name:"base16",alphabet:"0123456789abcdef",bitsPerChar:4}),s$=sD({prefix:"F",name:"base16upper",alphabet:"0123456789ABCDEF",bitsPerChar:4}),sK=sD({prefix:"b",name:"base32",alphabet:"abcdefghijklmnopqrstuvwxyz234567",bitsPerChar:5}),sF=sD({prefix:"B",name:"base32upper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567",bitsPerChar:5}),sz=sD({prefix:"c",name:"base32pad",alphabet:"abcdefghijklmnopqrstuvwxyz234567=",bitsPerChar:5}),sq=sD({prefix:"C",name:"base32padupper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567=",bitsPerChar:5}),sV=sD({prefix:"v",name:"base32hex",alphabet:"0123456789abcdefghijklmnopqrstuv",bitsPerChar:5}),sH=sD({prefix:"V",name:"base32hexupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV",bitsPerChar:5}),sG=sD({prefix:"t",name:"base32hexpad",alphabet:"0123456789abcdefghijklmnopqrstuv=",bitsPerChar:5}),sW=sD({prefix:"T",name:"base32hexpadupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV=",bitsPerChar:5}),sJ=sD({prefix:"h",name:"base32z",alphabet:"ybndrfg8ejkmcpqxot1uwisza345h769",bitsPerChar:5}),sZ=sN({prefix:"k",name:"base36",alphabet:"0123456789abcdefghijklmnopqrstuvwxyz"}),sY=sN({prefix:"K",name:"base36upper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"}),sX=sN({name:"base58btc",prefix:"z",alphabet:"123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"}),sQ=sN({name:"base58flickr",prefix:"Z",alphabet:"123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ"}),s0=sD({prefix:"m",name:"base64",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",bitsPerChar:6}),s1=sD({prefix:"M",name:"base64pad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",bitsPerChar:6}),s2=sD({prefix:"u",name:"base64url",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_",bitsPerChar:6}),s5=sD({prefix:"U",name:"base64urlpad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_=",bitsPerChar:6}),s3=Array.from("\uD83D\uDE80\uD83E\uDE90â\uD83D\uDEF0\uD83C\uDF0C\uD83C\uDF11\uD83C\uDF12\uD83C\uDF13\uD83C\uDF14\uD83C\uDF15\uD83C\uDF16\uD83C\uDF17\uD83C\uDF18\uD83C\uDF0D\uD83C\uDF0F\uD83C\uDF0E\uD83D\uDC09â\uD83D\uDCBB\uD83D\uDDA5\uD83D\uDCBE\uD83D\uDCBF\uD83D\uDE02â¤\uD83D\uDE0D\uD83E\uDD23\uD83D\uDE0A\uD83D\uDE4F\uD83D\uDC95\uD83D\uDE2D\uD83D\uDE18\uD83D\uDC4D\uD83D\uDE05\uD83D\uDC4F\uD83D\uDE01\uD83D\uDD25\uD83E\uDD70\uD83D\uDC94\uD83D\uDC96\uD83D\uDC99\uD83D\uDE22\uD83E\uDD14\uD83D\uDE06\uD83D\uDE44\uD83D\uDCAA\uD83D\uDE09âº\uD83D\uDC4C\uD83E\uDD17\uD83D\uDC9C\uD83D\uDE14\uD83D\uDE0E\uD83D\uDE07\uD83C\uDF39\uD83E\uDD26\uD83C\uDF89\uD83D\uDC9Eââ¨\uD83E\uDD37\uD83D\uDE31\uD83D\uDE0C\uD83C\uDF38\uD83D\uDE4C\uD83D\uDE0B\uD83D\uDC97\uD83D\uDC9A\uD83D\uDE0F\uD83D\uDC9B\uD83D\uDE42\uD83D\uDC93\uD83E\uDD29\uD83D\uDE04\uD83D\uDE00\uD83D\uDDA4\uD83D\uDE03\uD83D\uDCAF\uD83D\uDE48\uD83D\uDC47\uD83C\uDFB6\uD83D\uDE12\uD83E\uDD2Dâ£\uD83D\uDE1C\uD83D\uDC8B\uD83D\uDC40\uD83D\uDE2A\uD83D\uDE11\uD83D\uDCA5\uD83D\uDE4B\uD83D\uDE1E\uD83D\uDE29\uD83D\uDE21\uD83E\uDD2A\uD83D\uDC4A\uD83E\uDD73\uD83D\uDE25\uD83E\uDD24\uD83D\uDC49\uD83D\uDC83\uD83D\uDE33â\uD83D\uDE1A\uD83D\uDE1D\uD83D\uDE34\uD83C\uDF1F\uD83D\uDE2C\uD83D\uDE43\uD83C\uDF40\uD83C\uDF37\uD83D\uDE3B\uD83D\uDE13ââ
\uD83E\uDD7A\uD83C\uDF08\uD83D\uDE08\uD83E\uDD18\uD83D\uDCA6â\uD83D\uDE23\uD83C\uDFC3\uD83D\uDC90â¹\uD83C\uDF8A\uD83D\uDC98\uD83D\uDE20â\uD83D\uDE15\uD83C\uDF3A\uD83C\uDF82\uD83C\uDF3B\uD83D\uDE10\uD83D\uDD95\uD83D\uDC9D\uD83D\uDE4A\uD83D\uDE39\uD83D\uDDE3\uD83D\uDCAB\uD83D\uDC80\uD83D\uDC51\uD83C\uDFB5\uD83E\uDD1E\uD83D\uDE1B\uD83D\uDD34\uD83D\uDE24\uD83C\uDF3C\uD83D\uDE2Bâ½\uD83E\uDD19â\uD83C\uDFC6\uD83E\uDD2B\uD83D\uDC48\uD83D\uDE2E\uD83D\uDE46\uD83C\uDF7B\uD83C\uDF43\uD83D\uDC36\uD83D\uDC81\uD83D\uDE32\uD83C\uDF3F\uD83E\uDDE1\uD83C\uDF81â¡\uD83C\uDF1E\uD83C\uDF88ââ\uD83D\uDC4B\uD83D\uDE30\uD83E\uDD28\uD83D\uDE36\uD83E\uDD1D\uD83D\uDEB6\uD83D\uDCB0\uD83C\uDF53\uD83D\uDCA2\uD83E\uDD1F\uD83D\uDE41\uD83D\uDEA8\uD83D\uDCA8\uD83E\uDD2Câ\uD83C\uDF80\uD83C\uDF7A\uD83E\uDD13\uD83D\uDE19\uD83D\uDC9F\uD83C\uDF31\uD83D\uDE16\uD83D\uDC76\uD83E\uDD74â¶â¡â\uD83D\uDC8E\uD83D\uDCB8â¬\uD83D\uDE28\uD83C\uDF1A\uD83E\uDD8B\uD83D\uDE37\uD83D\uDD7Aâ \uD83D\uDE45\uD83D\uDE1F\uD83D\uDE35\uD83D\uDC4E\uD83E\uDD32\uD83E\uDD20\uD83E\uDD27\uD83D\uDCCC\uD83D\uDD35\uD83D\uDC85\uD83E\uDDD0\uD83D\uDC3E\uD83C\uDF52\uD83D\uDE17\uD83E\uDD11\uD83C\uDF0A\uD83E\uDD2F\uD83D\uDC37â\uD83D\uDCA7\uD83D\uDE2F\uD83D\uDC86\uD83D\uDC46\uD83C\uDFA4\uD83D\uDE47\uD83C\uDF51â\uD83C\uDF34\uD83D\uDCA3\uD83D\uDC38\uD83D\uDC8C\uD83D\uDCCD\uD83E\uDD40\uD83E\uDD22\uD83D\uDC45\uD83D\uDCA1\uD83D\uDCA9\uD83D\uDC50\uD83D\uDCF8\uD83D\uDC7B\uD83E\uDD10\uD83E\uDD2E\uD83C\uDFBC\uD83E\uDD75\uD83D\uDEA9\uD83C\uDF4E\uD83C\uDF4A\uD83D\uDC7C\uD83D\uDC8D\uD83D\uDCE3\uD83E\uDD42"),s8=s3.reduce((e,t,r)=>(e[r]=t,e),[]),s6=s3.reduce((e,t,r)=>(e[t.codePointAt(0)]=r,e),[]),s4=sM({prefix:"\uD83D\uDE80",name:"base256emoji",encode:function(e){return e.reduce((e,t)=>
1e+=s8[t],"")},decode:function(e){let t=[];for(let r of e){let e=s6[r.codePointAt(0)];if(void 0===e)throw Error(`Non-base256emoji character: ${r}`);t.push(e)}return new Uint8Array(t)}});var s9=128,s7=-128,ae=0x80000000;function at(e,t,r){t=t||[];for(var n=r=r||0;e>=ae;)t[r++]=255&e|s9,e/=128;for(;e&s7;)t[r++]=255&e|s9,e>>>=7;return t[r]=0|e,at.bytes=r-n+1,t}var ar=128,an=127;function ai(e,t){var r,n=0,t=t||0,i=0,o=t,s=e.length;do{if(o>=s)throw ai.bytes=0,RangeError("Could not decode varint");r=e[o++],n+=i<28?(r&an)<<i:(r&an)*Math.pow(2,i),i+=7}while(r>=ar);return ai.bytes=o-t,n}var ao=128,as=16384,aa=2097152,ac=0x10000000,au=0x800000000,al=0x40000000000,ad=0x2000000000000,af=0x100000000000000,ah=0x8000000000000000;let ap={encode:at,decode:ai,encodingLength:function(e){return e<ao?1:e<as?2:e<aa?3:e<ac?4:e<au?5:e<al?6:e<ad?7:e<af?8:e<ah?9:10}},ay=(e,t=0)=>[ap.decode(e,t),ap.decode.bytes],ag=(e,t,r=0)=>(ap.encode(e,t,r),t),am=e=>ap.encodingLength(e),ab=(e,t)=>{let r=t.byteLength,n=am(e),i=n+am(r),o=new Uint8Array(i+r);return ag(e,o,0),ag(r,o,n),o.set(t,i),new a_(e,r,t,o)},av=e=>{let t=sE(e),[r,n]=ay(t),[i,o]=ay(t.subarray(n)),s=t.subarray(n+o);if(s.byteLength!==i)throw Error("Incorrect length");return new a_(r,i,s,t)},aw=(e,t)=>e===t||e.code===t.code&&e.size===t.size&&s_(e.bytes,t.bytes);class a_{constructor(e,t,r,n){this.code=e,this.size=t,this.digest=r,this.bytes=n}}let aE=({name:e,code:t,encode:r})=>new aS(e,t,r);class aS{constructor(e,t,r){this.name=e,this.code=t,this.encode=r}digest(e){if(e instanceof Uint8Array){let t=this.encode(e);return t instanceof Uint8Array?ab(this.code,t):t.then(e=>ab(this.code,e))}throw Error("Unknown type, must be binary type")}}let ax=e=>async t=>new Uint8Array(await crypto.subtle.digest(e,t)),aA=aE({name:"sha2-256",code:18,encode:ax("SHA-256")}),aI=aE({name:"sha2-512",code:19,encode:ax("SHA-512")}),aO=0,aT=sE,aP=e=>ab(aO,aT(e)),aM={code:aO,name:"identity",encode:aT,digest:aP},aN="raw",ak=85,aC=e=>sE(e),aD=e=>sE(e),aj=new TextEncoder,aR=new TextDecoder,aL="json",aB=512,aU=e=>aj.encode(JSON.stringify(e)),a$=e=>JSON.parse(aR.decode(e));class aK{constructor(e,t,r,n){this.code=t,this.version=e,this.multihash=r,this.bytes=n,this.byteOffset=n.byteOffset,this.byteLength=n.byteLength,this.asCID=this,this._baseCache=new Map,Object.defineProperties(this,{byteOffset:aZ,byteLength:aZ,code:aJ,version:aJ,multihash:aJ,bytes:aJ,_baseCache:aZ,asCID:aZ})}toV0(){if(0===this.version)return this;{let{code:e,multihash:t}=this;if(e!==aV)throw Error("Cannot convert a non dag-pb CID to CIDv0");if(t.code!==aH)throw Error("Cannot convert non sha2-256 multihash CID to CIDv0");return aK.createV0(t)}}toV1(){switch(this.version){case 0:{let{code:e,digest:t}=this.multihash,r=ab(e,t);return aK.createV1(this.code,r)}case 1:return this;default:throw Error(`Can not convert CID version ${this.version} to version 0. This is a bug please report`)}}equals(e){return e&&this.code===e.code&&this.version===e.version&&aw(this.multihash,e.multihash)}toString(e){let{bytes:t,version:r,_baseCache:n}=this;return 0===r?az(t,n,e||sX.encoder):aq(t,n,e||sK.encoder)}toJSON(){return{code:this.code,version:this.version,hash:this.multihash.bytes}}get[Symbol.toStringTag](){return"CID"}[Symbol.for("nodejs.util.inspect.custom")](){return"CID("+this.toString()+")"}static isCID(e){return aX(/^0\.0/,aQ),!!(e&&(e[aW]||e.asCID===e))}get toBaseEncodedString(){throw Error("Deprecated, use .toString()")}get codec(){throw Error('"codec" property is deprecated, use integer "code" property instead')}get buffer(){throw Error("Deprecated .buffer property, use .bytes to get Uint8Array instead")}get multibaseName(){throw Error('"multibaseName" property is deprecated')}get prefix(){throw Error('"prefix" property is deprecated')}static asCID(e){if(e instanceof aK)return e;if(null!=e&&e.asCID===e){let{version:t,code:r,multihash:n,bytes:i}=e;return new aK(t,r,n,i||aG(t,r,n.bytes))}if(null==e||!0!==e[aW])return null;{let{version:t,multihash:r,code:n}=e,i=av(r);return aK.create(t,n,i)}}static create(e,t,r){if("number"!=typeof t)throw Error("String codecs are no longer supported");switch(e){case 0:if(t===aV)return new aK(e,t,r,r.bytes);throw Error(`Version 0 CID must use dag-pb (code: ${aV}) block encoding`);case 1:{let n=aG(e,t,r.bytes);return new aK(e,t,r,n)}default:throw Error("Invalid version")}}static createV0(e){return aK.create(0,aV,e)}static createV1(e,t){return aK.create(1,e,t)}static decode(e){let[t,r]=aK.decodeFirst(e);
1if(r.length)throw Error("Incorrect length");return t}static decodeFirst(e){let t=aK.inspectBytes(e),r=t.size-t.multihashSize,n=sE(e.subarray(r,r+t.multihashSize));if(n.byteLength!==t.multihashSize)throw Error("Incorrect length");let i=n.subarray(t.multihashSize-t.digestSize),o=new a_(t.multihashCode,t.digestSize,i,n);return[0===t.version?aK.createV0(o):aK.createV1(t.codec,o),e.subarray(t.size)]}static inspectBytes(e){let t=0,r=()=>{let[r,n]=ay(e.subarray(t));return t+=n,r},n=r(),i=aV;if(18===n?(n=0,t=0):1===n&&(i=r()),0!==n&&1!==n)throw RangeError(`Invalid CID version ${n}`);let o=t,s=r(),a=r(),c=t+a;return{version:n,codec:i,multihashCode:s,digestSize:a,multihashSize:c-o,size:c}}static parse(e,t){let[r,n]=aF(e,t),i=aK.decode(n);return i._baseCache.set(r,e),i}}let aF=(e,t)=>{switch(e[0]){case"Q":{let r=t||sX;return[sX.prefix,r.decode(`${sX.prefix}${e}`)]}case sX.prefix:{let r=t||sX;return[sX.prefix,r.decode(e)]}case sK.prefix:{let r=t||sK;return[sK.prefix,r.decode(e)]}default:if(null==t)throw Error("To parse non base32 or base58btc encoded CID multibase decoder must be provided");return[e[0],t.decode(e)]}},az=(e,t,r)=>{let{prefix:n}=r;if(n!==sX.prefix)throw Error(`Cannot string encode V0 in ${r.name} encoding`);let i=t.get(n);if(null!=i)return i;{let i=r.encode(e).slice(1);return t.set(n,i),i}},aq=(e,t,r)=>{let{prefix:n}=r,i=t.get(n);if(null!=i)return i;{let i=r.encode(e);return t.set(n,i),i}},aV=112,aH=18,aG=(e,t,r)=>{let n=am(e),i=n+am(t),o=new Uint8Array(i+r.byteLength);return ag(e,o,0),ag(t,o,n),o.set(r,i),o},aW=Symbol.for("@ipld/js-cid/CID"),aJ={writable:!1,configurable:!1,enumerable:!0},aZ={writable:!1,enumerable:!1,configurable:!1},aY="0.0.0-dev",aX=(e,t)=>{if(e.test(aY))console.warn(t);else throw Error(t)},aQ=`CID.isCID(v) is deprecated and will be removed in the next major release. 2Following code pattern: 3 4if (CID.isCID(value)) { 5 doSomethingWithCID(value) 6} 7 8Is replaced with: 9 10const cid = CID.asCID(value) 11if (cid) { 12 // Make sure to use cid instead of value 13 doSomethingWithCID(cid) 14} 15`,a0={...l,...d,...f,...h,...p,...y,...g,...m,...b,...v};function a1(e,t,r,n){return{name:e,prefix:t,encoder:{name:e,prefix:t,encode:r},decoder:{decode:n}}}({...w,..._});let a2=a1("utf8","u",e=>"u"+new TextDecoder("utf8").decode(e),e=>new TextEncoder().encode(e.substring(1))),a5=a1("ascii","a",e=>{let t="a";for(let r=0;r<e.length;r++)t+=String.fromCharCode(e[r]);return t},e=>{let t=sb((e=e.substring(1)).length);for(let r=0;r<e.length;r++)t[r]=e.charCodeAt(r);return t}),a3={utf8:a2,"utf-8":a2,hex:a0.base16,latin1:a5,ascii:a5,binary:a5,...a0};function a8(e,t="utf8"){let r=a3[t];if(!r)throw Error(`Unsupported encoding "${t}"`);return("utf8"===t||"utf-8"===t)&&null!=globalThis.Buffer&&null!=globalThis.Buffer.from?sm(globalThis.Buffer.from(e,"utf-8")):r.decoder.decode(`${r.prefix}${e}`)}function a6(e,t="utf8"){let r=a3[t];if(!r)throw Error(`Unsupported encoding "${t}"`);return("utf8"===t||"utf-8"===t)&&null!=globalThis.Buffer&&null!=globalThis.Buffer.from?globalThis.Buffer.from(e.buffer,e.byteOffset,e.byteLength).toString("utf8"):r.encoder.encode(e).substring(1)}function a4(e,t){let r=!0;return t.forEach(t=>{t in e||(r=!1)}),r}function a9(e,t){return Array.isArray(e)?e.length===t:Object.keys(e).length===t}function a7(e,t){return Array.isArray(e)?e.length>=t:Object.keys(e).length>=t}let ce={waku:{publish:"waku_publish",batchPublish:"waku_batchPublish",subscribe:"waku_subscribe",batchSubscribe:"waku_batchSubscribe",subscription:"waku_subscription",unsubscribe:"waku_unsubscribe",batchUnsubscribe:"waku_batchUnsubscribe",batchFetchMessages:"waku_batchFetchMessages"},irn:{publish:"irn_publish",batchPublish:"irn_batchPublish",subscribe:"irn_subscribe",batchSubscribe:"irn_batchSubscribe",subscription:"irn_subscription",unsubscribe:"irn_unsubscribe",batchUnsubscribe:"irn_batchUnsubscribe",batchFetchMessages:"irn_batchFetchMessages"},iridium:{publish:"iridium_publish",batchPublish:"iridium_batchPublish",subscribe:"iridium_subscribe",batchSubscribe:"iridium_batchSubscribe",subscription:"iridium_subscription",unsubscribe:"iridium_unsubscribe",batchUnsubscribe:"iridium_batchUnsubscribe",batchFetchMessages:"iridium_batchFetchMessages"}};
15var ct=r(17783),cr=r(2818),cn=r(75927).Buffer;let ci=":";function co(e){let[t,r]=e.split(ci);return{namespace:t,reference:r}}function cs(e){let{namespace:t,reference:r}=e;return[t,r].join(ci)}function ca(e){let[t,r,n]=e.split(ci);return{namespace:t,reference:r,address:n}}function cc(e,t){return e.includes(":")?[e]:t.chains||[]}var cu=Object.defineProperty,cl=Object.defineProperties,cd=Object.getOwnPropertyDescriptors,cf=Object.getOwnPropertySymbols,ch=Object.prototype.hasOwnProperty,cp=Object.prototype.propertyIsEnumerable,cy=(e,t,r)=>t in e?cu(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,cg=(e,t)=>{for(var r in t||(t={}))ch.call(t,r)&&cy(e,r,t[r]);if(cf)for(var r of cf(t))cp.call(t,r)&&cy(e,r,t[r]);return e},cm=(e,t)=>cl(e,cd(t));let cb="ReactNative",cv={reactNative:"react-native",node:"node",browser:"browser",unknown:"unknown"},cw=2,c_="js";function cE(){return"u">typeof cr&&"u">typeof cr.versions&&"u">typeof cr.versions.node}function cS(){return!(0,iR.getDocument)()&&!!(0,iR.getNavigator)()&&navigator.product===cb}function cx(){return cS()&&"u">typeof r.g&&"u">typeof(null==r.g?void 0:r.g.Platform)&&(null==r.g?void 0:r.g.Platform.OS)==="android"}function cA(){return cS()&&"u">typeof r.g&&"u">typeof(null==r.g?void 0:r.g.Platform)&&(null==r.g?void 0:r.g.Platform.OS)==="ios"}function cI(){return!cE()&&!!(0,iR.getNavigator)()&&!!(0,iR.getDocument)()}function cO(){return cS()?cv.reactNative:cE()?cv.node:cI()?cv.browser:cv.unknown}function cT(){var e;try{return cS()&&"u">typeof r.g&&"u">typeof(null==r.g?void 0:r.g.Application)?null==(e=r.g.Application)?void 0:e.applicationId:void 0}catch{return}}function cP(e,t){let r=new URLSearchParams(e);for(let e of Object.keys(t).sort())if(t.hasOwnProperty(e)){let n=t[e];void 0!==n&&r.set(e,n)}return r.toString()}function cM(e){var t,r;let n=cN();try{return null!=e&&e.url&&n.url&&new URL(e.url).host!==new URL(n.url).host&&(console.warn(`The configured WalletConnect 'metadata.url':${e.url} differs from the actual page url:${n.url}. This is probably unintended and can lead to issues.`),e.url=n.url),null!=(t=e?.icons)&&t.length&&e.icons.length>0&&(e.icons=e.icons.filter(e=>""!==e)),cm(cg(cg({},n),e),{url:e?.url||n.url,name:e?.name||n.name,description:e?.description||n.description,icons:null!=(r=e?.icons)&&r.length&&e.icons.length>0?e.icons:n.icons})}catch(t){return console.warn("Error populating app metadata",t),e||n}}function cN(){return(0,iL.g)()||{name:"",description:"",url:"",icons:[""]}}function ck(){if(cO()===cv.reactNative&&"u">typeof r.g&&"u">typeof(null==r.g?void 0:r.g.Platform)){let{OS:e,Version:t}=r.g.Platform;return[e,t].join("-")}let e=iM();if(null===e)return"unknown";let t=e.os?e.os.replace(" ","").toLowerCase():"unknown";return"browser"===e.type?[t,e.name,e.version].join("-"):[t,e.version].join("-")}function cC(){var e;let t=cO();return t===cv.browser?[t,(null==(e=(0,iR.getLocation)())?void 0:e.host)||"unknown"].join(":"):t}function cD(e,t,r){let n=ck(),i=cC();return[[e,t].join("-"),[c_,r].join("-"),n,i].join("/")}function cj({protocol:e,version:t,relayUrl:r,sdkVersion:n,auth:i,projectId:o,useOnCloseEvent:s,bundleId:a,packageName:c}){let u=r.split("?"),l={auth:i,ua:cD(e,t,n),projectId:o,useOnCloseEvent:s||void 0,packageName:c||void 0,bundleId:a||void 0},d=cP(u[1]||"",l);return u[0]+"?"+d}function cR(e,t){return e.filter(e=>t.includes(e)).length===e.length}function cL(e){return Object.fromEntries(e.entries())}function cB(e){return new Map(Object.entries(e))}function cU(e=I.FIVE_MINUTES,t){let r,n,i,o;let s=(0,I.toMiliseconds)(e||I.FIVE_MINUTES);return{resolve:e=>{i&&r&&(clearTimeout(i),r(e),o=Promise.resolve(e))},reject:e=>{i&&n&&(clearTimeout(i),n(e))},done:()=>new Promise((e,a)=>{if(o)return e(o);i=setTimeout(()=>{let e=Error(t);o=Promise.reject(e),a(e)},s),r=e,n=a})}}function c$(e,t,r){return new Promise(async(n,i)=>{let o=setTimeout(()=>i(Error(r)),t);try{let t=await e;n(t)}catch(e){i(e)}clearTimeout(o)})}function cK(e,t){if("string"==typeof t&&t.startsWith(`${e}:`))return t;if("topic"===e.toLowerCase()){if("string"!=typeof t)throw Error('Value must be "string" for expirer target type: topic');return`topic:${t}`}if("id"===e.toLowerCase()){if("number"!=typeof t)throw Error('Value must be "number" for expirer target type: id');return`id:${t}`}throw Error(`Unknown expirer target type: ${e}`)}function cF(e){return cK("topic",e)}function cz(e){return cK("id",e)}function cq(e){let[t,r]=e.split(":"),n={id:void 0,topic:void 0};if("topic"===t&&"string"==typeof r)n.topic=r;else if("id"===t&&Number.isInteger(Number(r)))n.id=Number(r);else throw Error(`Invalid target, expected id:number or topic:string, got ${t}:${r}`);return n}function cV(e,t){return(0,I.fromMiliseconds)((t||Date.now())+(0,I.toMiliseconds)(e))}function cH(e){return Date.now()>=(0,I.toMiliseconds)(e)}function cG(e,t){return`${e}${t?`:${t}`:""}`}function cW(e=[],t=[]){return[...new Set([...e,...t])]}async function cJ({id:e,topic:t,wcDeepLink:n}){var i;try{if(!n)return;let o="string"==typeof n?JSON.parse(n):n,s=o?.href;if("string"!=typeof s)return;let a=cZ(s,e,t),c=cO();if(c===cv.browser){if(!(null!=(i=(0,iR.getDocument)())&&i.hasFocus())){console.warn("Document does not have focus, skipping deeplink.");return}cY(a)}else c===cv.reactNative&&"u">typeof(null==r.g?void 0:r.g.Linking)&&await r.g.Linking.openURL(a)}catch(e){console.error(e)}}function cZ(e,t,r){let n=`requestId=${t}&sessionTopic=${r}`;e.endsWith("/")&&(e=e.slice(0,-1));let i=`${e}`;if(e.startsWith("https://t.me")){let t=e.includes("?")?"&startapp=":"?startapp=";i=`${i}${t}${c3(n,!0)}`}else i=`${i}/wc?${n}`;return i}function cY(e){let t="_self";c5()?t="_top":(c2()||e.startsWith("https://")||e.startsWith("http://"))&&(t="_blank"),window.open(e,t,"noreferrer noopener")}async function cX(e,t){let r="";try{if(cI()&&(r=localStorage.getItem(t)))return r;r=await e.getItem(t)}catch(e){console.error(e)}return r}function cQ(e,t){if(!e.includes(t))return null;let r=e.split(/([&,?,=])/),n=r.indexOf(t);return r[n+2]}function c0(){return"u">typeof crypto&&null!=crypto&&crypto.randomUUID?crypto.randomUUID():"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/gu,e=>{let t=16*Math.random()|0;return("x"===e?t:3&t|8).toString(16)})}function c1(){return"u">typeof cr&&"true"===cr.env.IS_VITEST}function c2(){return"u">typeof window&&(!!window.TelegramWebviewProxy||!!window.Telegram||!!window.TelegramWebviewProxyProto)}function c5(){try{return window.self!==window.top}catch{return!1}}function c3(e,t=!1){let r=cn.from(e).toString("base64");return t?r.replace(/[=]/g,""):r}function c8(e){return cn.from(e,"base64").toString("utf-8")}function c6(e){return new Promise(t=>setTimeout(t,e))}let c4=BigInt(0x100000000-1),c9=BigInt(32);function c7(e,t=!1){return t?{h:Number(e&c4),l:Number(e>>c9&c4)}:{h:0|Number(e>>c9&c4),l:0|Number(e&c4)}}function ue(e,t=!1){let r=e.length,n=new Uint32Array(r),i=new Uint32Array(r);for(let o=0;o<r;o++){let{h:r,l:s}=c7(e[o],t);[n[o],i[o]]=[r,s]}return[n,i]}let ut=(e,t,r)=>e>>>r,ur=(e,t,r)=>e<<32-r|t>>>r,un=(e,t,r)=>e>>>r|t<<32-r,ui=(e,t,r)=>e<<32-r|t>>>r,uo=(e,t,r)=>e<<64-r|t>>>r-32,us=(e,t,r)=>e>>>r-32|t<<64-r,ua=(e,t)=>t,uc=(e,t)=>e,uu=(e,t,r)=>e<<r|t>>>32-r,ul=(e,t,r)=>t<<r|e>>>32-r,ud=(e,t,r)=>t<<r-32|e>>>64-r,uf=(e,t,r)=>e<<r-32|t>>>64-r;function uh(e,t,r,n){let i=(t>>>0)+(n>>>0);return{h:e+r+(i/0x100000000|0)|0,l:0|i}}let up=(e,t,r)=>(e>>>0)+(t>>>0)+(r>>>0),uy=(e,t,r,n)=>t+r+n+(e/0x100000000|0)|0,ug=(e,t,r,n)=>(e>>>0)+(t>>>0)+(r>>>0)+(n>>>0),um=(e,t,r,n,i)=>t+r+n+i+(e/0x100000000|0)|0,ub=(e,t,r,n,i)=>(e>>>0)+(t>>>0)+(r>>>0)+(n>>>0)+(i>>>0),uv=(e,t,r,n,i,o)=>t+r+n+i+o+(e/0x100000000|0)|0,uw="object"==typeof globalThis&&"crypto"in globalThis?globalThis.crypto:void 0;function u_(e){return e instanceof Uint8Array||ArrayBuffer.isView(e)&&"Uint8Array"===e.constructor.name}function uE(e){if(!Number.isSafeInteger(e)||e<0)throw Error("positive integer expected, got "+e)}function uS(e,...t){if(!u_(e))throw Error("Uint8Array expected");if(t.length>0&&!t.includes(e.length))throw Error("Uint8Array expected of length "+t+", got length="+e.length)}function ux(e){if("function"!=typeof e||"function"!=typeof e.create)throw Error("Hash should be wrapped by utils.createHasher");uE(e.outputLen),uE(e.blockLen)}function uA(e,t=!0){if(e.destroyed)throw Error("Hash instance has been destroyed");if(t&&e.finished)throw Error("Hash#digest() has already been called")}function uI(e,t){uS(e);let r=t.outputLen;if(e.length<r)throw Error("digestInto() expects output buffer of length at least "+r)}function uO(e){return new Uint32Array(e.buffer,e.byteOffset,Math.floor(e.byteLength/4))}function uT(...e){for(let t=0;t<e.length;t++)e[t].fill(0)}function uP(e){return new DataView(e.buffer,e.byteOffset,e.byteLength)}function uM(e,t){return e<<32-t|e>>>t}let uN=68===new Uint8Array(new Uint32Array([0x11223344]).buffer)[0];function uk(e){return e<<24&0xff000000|e<<8&0xff0000|e>>>8&65280|e>>>24&255}let uC=uN?e=>e:e=>uk(e);function uD(e){for(let t=0;t<e.length;t++)e[t]=uk(e[t]);return e}let uj=uN?e=>e:uD;function uR(e){if("string"!=typeof e)throw Error("string expected");return new Uint8Array(new TextEncoder().encode(e))}function uL(e){return"string"==typeof e&&(e=uR(e)),uS(e),e}function uB(...e){let t=0;for(let r=0;r<e.length;r++){let n=e[r];uS(n),t+=n.length}let r=new Uint8Array(t);for(let t=0,n=0;t<e.length;t++){let i=e[t];r.set(i,n),n+=i.length}return r}class uU{}function u$(e){let t=t=>e().update(uL(t)).digest(),r=e();return t.outputLen=r.outputLen,t.blockLen=r.blockLen,t.create=()=>e(),t}function uK(e){let t=(t,r)=>e(r).update(uL(t)).digest(),r=e({});return t.outputLen=r.outputLen,t.blockLen=r.blockLen,t.create=t=>e(t),t}function uF(e=32){if(uw&&"function"==typeof uw.getRandomValues)return uw.getRandomValues(new Uint8Array(e));if(uw&&"function"==typeof uw.randomBytes)return Uint8Array.from(uw.randomBytes(e));throw Error("crypto.getRandomValues must be defined")}let uz=BigInt(0),uq=BigInt(1),uV=BigInt(2),uH=BigInt(7),uG=BigInt(256),uW=BigInt(113),uJ=[],uZ=[],uY=[];for(let e=0,t=uq,r=1,n=0;e<24;e++){[r,n]=[n,(2*r+3*n)%5],uJ.push(2*(5*n+r)),uZ.push((e+1)*(e+2)/2%64);let i=uz;for(let e=0;e<7;e++)(t=(t<<uq^(t>>
15uH)*uW)%uG)&uV&&(i^=uq<<(uq<<BigInt(e))-uq);uY.push(i)}let uX=ue(uY,!0),uQ=uX[0],u0=uX[1],u1=(e,t,r)=>r>32?ud(e,t,r):uu(e,t,r),u2=(e,t,r)=>r>32?uf(e,t,r):ul(e,t,r);function u5(e,t=24){let r=new Uint32Array(10);for(let n=24-t;n<24;n++){for(let t=0;t<10;t++)r[t]=e[t]^e[t+10]^e[t+20]^e[t+30]^e[t+40];for(let t=0;t<10;t+=2){let n=(t+8)%10,i=(t+2)%10,o=r[i],s=r[i+1],a=u1(o,s,1)^r[n],c=u2(o,s,1)^r[n+1];for(let r=0;r<50;r+=10)e[t+r]^=a,e[t+r+1]^=c}let t=e[2],i=e[3];for(let r=0;r<24;r++){let n=uZ[r],o=u1(t,i,n),s=u2(t,i,n),a=uJ[r];t=e[a],i=e[a+1],e[a]=o,e[a+1]=s}for(let t=0;t<50;t+=10){for(let n=0;n<10;n++)r[n]=e[t+n];for(let n=0;n<10;n++)e[t+n]^=~r[(n+2)%10]&r[(n+4)%10]}e[0]^=uQ[n],e[1]^=u0[n]}uT(r)}class u3 extends uU{constructor(e,t,r,n=!1,i=24){if(super(),this.pos=0,this.posOut=0,this.finished=!1,this.destroyed=!1,this.enableXOF=!1,this.blockLen=e,this.suffix=t,this.outputLen=r,this.enableXOF=n,this.rounds=i,uE(r),!(0<e&&e<200))throw Error("only keccak-f1600 function is supported");this.state=new Uint8Array(200),this.state32=uO(this.state)}clone(){return this._cloneInto()}keccak(){uj(this.state32),u5(this.state32,this.rounds),uj(this.state32),this.posOut=0,this.pos=0}update(e){uA(this),uS(e=uL(e));let{blockLen:t,state:r}=this,n=e.length;for(let i=0;i<n;){let 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;let{state:e,suffix:t,pos:r,blockLen:n}=this;e[r]^=t,(128&t)!=0&&r===n-1&&this.keccak(),e[n-1]^=128,this.keccak()}writeInto(e){uA(this,!1),uS(e),this.finish();let t=this.state,{blockLen:r}=this;for(let n=0,i=e.length;n<i;){this.posOut>=r&&this.keccak();let o=Math.min(r-this.posOut,i-n);e.set(t.subarray(this.posOut,this.posOut+o),n),this.posOut+=o,n+=o}return e}xofInto(e){if(!this.enableXOF)throw Error("XOF is not possible for this instance");return this.writeInto(e)}xof(e){return uE(e),this.xofInto(new Uint8Array(e))}digestInto(e){if(uI(e,this),this.finished)throw Error("digest() was already called");return this.writeInto(e),this.destroy(),e}digest(){return this.digestInto(new Uint8Array(this.outputLen))}destroy(){this.destroyed=!0,uT(this.state)}_cloneInto(e){let{blockLen:t,suffix:r,outputLen:n,rounds:i,enableXOF:o}=this;return e||(e=new u3(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}}let u8=(i=1,o=136,s=32,u$(()=>new u3(o,i,s)));function u6(e,t,r,n){if("function"==typeof e.setBigUint64)return e.setBigUint64(t,r,n);let i=BigInt(32),o=BigInt(0xffffffff),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)}function u4(e,t,r){return e&t^~e&r}function u9(e,t,r){return e&t^e&r^t&r}class u7 extends uU{constructor(e,t,r,n){super(),this.finished=!1,this.length=0,this.pos=0,this.destroyed=!1,this.blockLen=e,this.outputLen=t,this.padOffset=r,this.isLE=n,this.buffer=new Uint8Array(e),this.view=uP(this.buffer)}update(e){uA(this),uS(e=uL(e));let{view:t,buffer:r,blockLen:n}=this,i=e.length;for(let o=0;o<i;){let s=Math.min(n-this.pos,i-o);if(s===n){let t=uP(e);for(;n<=i-o;o+=n)this.process(t,o);continue}r.set(e.subarray(o,o+s),this.pos),this.pos+=s,o+=s,this.pos===n&&(this.process(t,0),this.pos=0)}return this.length+=e.length,this.roundClean(),this}digestInto(e){uA(this),uI(e,this),this.finished=!0;let{buffer:t,view:r,blockLen:n,isLE:i}=this,{pos:o}=this;t[o++]=128,uT(this.buffer.subarray(o)),this.padOffset>n-o&&(this.process(r,0),o=0);for(let e=o;e<n;e++)t[e]=0;u6(r,n-8,BigInt(8*this.length),i),this.process(r,0);let s=uP(e),a=this.outputLen;if(a%4)throw Error("_sha2: outputLen should be aligned to 32bit");let c=a/4,u=this.get();if(c>u.length)throw Error("_sha2: outputLen bigger than state");for(let e=0;e<c;e++)s.setUint32(4*e,u[e],i)}digest(){let{buffer:e,outputLen:t}=this;this.digestInto(e);let r=e.slice(0,t);return this.destroy(),r}_cloneInto(e){e||(e=new this.constructor),e.set(...this.get());let{blockLen:t,buffer:r,length:n,finished:i,destroyed:o,pos:s}=this;return e.destroyed=o,e.finished=i,e.length=n,e.pos=s,n%t&&e.buffer.set(r),e}clone(){return this._cloneInto()}}
vendor: 3,206 bytes, line 15
15let le=Uint32Array.from([0x6a09e667,0xbb67ae85,0x3c6ef372,0xa54ff53a,0x510e527f,0x9b05688c,0x1f83d9ab,0x5be0cd19]),lt=Uint32Array.from([0xcbbb9d5d,0xc1059ed8,0x629a292a,0x367cd507,0x9159015a,0x3070dd17,0x152fecd8,0xf70e5939,0x67332667,0xffc00b31,0x8eb44a87,0x68581511,0xdb0c2e0d,0x64f98fa7,0x47b5481d,0xbefa4fa4]),lr=Uint32Array.from([0x6a09e667,0xf3bcc908,0xbb67ae85,0x84caa73b,0x3c6ef372,0xfe94f82b,0xa54ff53a,0x5f1d36f1,0x510e527f,0xade682d1,0x9b05688c,0x2b3e6c1f,0x1f83d9ab,0xfb41bd6b,0x5be0cd19,0x137e2179]),ln=Uint32Array.from([0x428a2f98,0x71374491,0xb5c0fbcf,0xe9b5dba5,0x3956c25b,0x59f111f1,0x923f82a4,0xab1c5ed5,0xd807aa98,0x12835b01,0x243185be,0x550c7dc3,0x72be5d74,0x80deb1fe,0x9bdc06a7,0xc19bf174,0xe49b69c1,0xefbe4786,0xfc19dc6,0x240ca1cc,0x2de92c6f,0x4a7484aa,0x5cb0a9dc,0x76f988da,0x983e5152,0xa831c66d,0xb00327c8,0xbf597fc7,0xc6e00bf3,0xd5a79147,0x6ca6351,0x14292967,0x27b70a85,0x2e1b2138,0x4d2c6dfc,0x53380d13,0x650a7354,0x766a0abb,0x81c2c92e,0x92722c85,0xa2bfe8a1,0xa81a664b,0xc24b8b70,0xc76c51a3,0xd192e819,0xd6990624,0xf40e3585,0x106aa070,0x19a4c116,0x1e376c08,0x2748774c,0x34b0bcb5,0x391c0cb3,0x4ed8aa4a,0x5b9cca4f,0x682e6ff3,0x748f82ee,0x78a5636f,0x84c87814,0x8cc70208,0x90befffa,0xa4506ceb,0xbef9a3f7,0xc67178f2]),li=new Uint32Array(64);class lo extends u7{constructor(e=32){super(64,e,8,!1),this.A=0|le[0],this.B=0|le[1],this.C=0|le[2],this.D=0|le[3],this.E=0|le[4],this.F=0|le[5],this.G=0|le[6],this.H=0|le[7]}get(){let{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 r=0;r<16;r++,t+=4)li[r]=e.getUint32(t,!1);for(let e=16;e<64;e++){let t=li[e-15],r=li[e-2],n=uM(t,7)^uM(t,18)^t>>>3,i=uM(r,17)^uM(r,19)^r>>>10;li[e]=i+li[e-7]+n+li[e-16]|0}let{A:r,B:n,C:i,D:o,E:s,F:a,G:c,H:u}=this;for(let e=0;e<64;e++){let t=u+(uM(s,6)^uM(s,11)^uM(s,25))+u4(s,a,c)+ln[e]+li[e]|0,l=(uM(r,2)^uM(r,13)^uM(r,22))+u9(r,n,i)|0;u=c,c=a,a=s,s=o+t|0,o=i,i=n,n=r,r=t+l|0}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(){uT(li)}destroy(){this.set(0,0,0,0,0,0,0,0),uT(this.buffer)}}let ls=ue(["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","0xf40e3585
155771202a","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))),la=ls[0],lc=ls[1],lu=new Uint32Array(80),ll=new Uint32Array(80);class ld extends u7{constructor(e=64){super(128,e,16,!1),this.Ah=0|lr[0],this.Al=0|lr[1],this.Bh=0|lr[2],this.Bl=0|lr[3],this.Ch=0|lr[4],this.Cl=0|lr[5],this.Dh=0|lr[6],this.Dl=0|lr[7],this.Eh=0|lr[8],this.El=0|lr[9],this.Fh=0|lr[10],this.Fl=0|lr[11],this.Gh=0|lr[12],this.Gl=0|lr[13],this.Hh=0|lr[14],this.Hl=0|lr[15]}get(){let{Ah:e,Al:t,Bh:r,Bl:n,Ch:i,Cl:o,Dh:s,Dl:a,Eh:c,El:u,Fh:l,Fl:d,Gh:f,Gl:h,Hh:p,Hl:y}=this;return[e,t,r,n,i,o,s,a,c,u,l,d,f,h,p,y]}set(e,t,r,n,i,o,s,a,c,u,l,d,f,h,p,y){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|d,this.Gh=0|f,this.Gl=0|h,this.Hh=0|p,this.Hl=0|y}process(e,t){for(let r=0;r<16;r++,t+=4)lu[r]=e.getUint32(t),ll[r]=e.getUint32(t+=4);for(let e=16;e<80;e++){let t=0|lu[e-15],r=0|ll[e-15],n=un(t,r,1)^un(t,r,8)^ut(t,r,7),i=ui(t,r,1)^ui(t,r,8)^ur(t,r,7),o=0|lu[e-2],s=0|ll[e-2],a=un(o,s,19)^uo(o,s,61)^ut(o,s,6),c=ug(i,ui(o,s,19)^us(o,s,61)^ur(o,s,6),ll[e-7],ll[e-16]),u=um(c,n,a,lu[e-7],lu[e-16]);lu[e]=0|u,ll[e]=0|c}let{Ah:r,Al:n,Bh:i,Bl:o,Ch:s,Cl:a,Dh:c,Dl:u,Eh:l,El:d,Fh:f,Fl:h,Gh:p,Gl:y,Hh:g,Hl:m}=this;for(let e=0;e<80;e++){let t=un(l,d,14)^un(l,d,18)^uo(l,d,41),b=ui(l,d,14)^ui(l,d,18)^us(l,d,41),v=l&f^~l&p,w=ub(m,b,d&h^~d&y,lc[e],ll[e]),_=uv(w,g,t,v,la[e],lu[e]),E=0|w,S=un(r,n,28)^uo(r,n,34)^uo(r,n,39),x=ui(r,n,28)^us(r,n,34)^us(r,n,39),A=r&i^r&s^i&s,I=n&o^n&a^o&a;g=0|p,m=0|y,p=0|f,y=0|h,f=0|l,h=0|d,({h:l,l:d}=uh(0|c,0|u,0|_,0|E)),c=0|s,u=0|a,s=0|i,a=0|o,i=0|r,o=0|n;let O=up(E,x,I);r=uy(O,_,S,A),n=0|O}({h:r,l:n}=uh(0|this.Ah,0|this.Al,0|r,0|n)),({h:i,l:o}=uh(0|this.Bh,0|this.Bl,0|i,0|o)),({h:s,l:a}=uh(0|this.Ch,0|this.Cl,0|s,0|a)),({h:c,l:u}=uh(0|this.Dh,0|this.Dl,0|c,0|u)),({h:l,l:d}=uh(0|this.Eh,0|this.El,0|l,0|d)),({h:f,l:h}=uh(0|this.Fh,0|this.Fl,0|f,0|h)),({h:p,l:y}=uh(0|this.Gh,0|this.Gl,0|p,0|y)),({h:g,l:m}=uh(0|this.Hh,0|this.Hl,0|g,0|m)),this.set(r,n,i,o,s,a,c,u,l,d,f,h,p,y,g,m)}roundClean(){uT(lu,ll)}destroy(){uT(this.buffer),this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0)}}class lf extends ld{constructor(){super(48),this.Ah=0|lt[0],this.Al=0|lt[1],this.Bh=0|lt[2],this.Bl=0|lt[3],this.Ch=0|lt[4],this.Cl=0|lt[5],this.Dh=0|lt[6],this.Dl=0|lt[7],this.Eh=0|lt[8],this.El=0|lt[9],this.Fh=0|lt[10],this.Fl=0|lt[11],this.Gh=0|lt[12],this.Gl=0|lt[13],this.Hh=0|lt[14],this.Hl=0|lt[15]}}let lh=Uint32Array.from([0x22312194,0xfc2bf72c,0x9f555fa3,0xc84c64c2,0x2393b86b,0x6f53b151,0x96387719,0x5940eabd,0x96283ee2,0xa88effe3,0xbe5e1e25,0x53863992,0x2b0199fc,0x2c85b8aa,0xeb72ddc,0x81c52ca2]);class lp extends ld{constructor(){super(32),this.Ah=0|lh[0],this.Al=0|lh[1],this.Bh=0|lh[2],this.Bl=0|lh[3],this.Ch=0|lh[4],this.Cl=0|lh[5],this.Dh=0|lh[6],this.Dl=0|lh[7],this.Eh=0|lh[8],this.El=0|lh[9],this.Fh=0|lh[10],this.Fl=0|lh[11],this.Gh=0|lh[12],this.Gl=0|lh[13],this.Hh=0|lh[14],this.Hl=0|lh[15]}}let ly=u$(()=>new lo),lg=u$(()=>new ld),lm=u$(()=>new lf),lb=u$(()=>new lp),lv=Uint8Array.from([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,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]),lw=Uint32Array.from([0xf3bcc908,0x6a09e66
157,0x84caa73b,0xbb67ae85,0xfe94f82b,0x3c6ef372,0x5f1d36f1,0xa54ff53a,0xade682d1,0x510e527f,0x2b3e6c1f,0x9b05688c,0xfb41bd6b,0x1f83d9ab,0x137e2179,0x5be0cd19]),l_=new Uint32Array(32);function lE(e,t,r,n,i,o){let s=i[o],a=i[o+1],c=l_[2*e],u=l_[2*e+1],l=l_[2*t],d=l_[2*t+1],f=l_[2*r],h=l_[2*r+1],p=l_[2*n],y=l_[2*n+1],g=up(c,l,s);u=uy(g,u,d,a),c=0|g,({Dh:y,Dl:p}={Dh:y^u,Dl:p^c}),({Dh:y,Dl:p}={Dh:ua(y,p),Dl:uc(y)}),({h:h,l:f}=uh(h,f,y,p)),({Bh:d,Bl:l}={Bh:d^h,Bl:l^f}),({Bh:d,Bl:l}={Bh:un(d,l,24),Bl:ui(d,l,24)}),l_[2*e]=c,l_[2*e+1]=u,l_[2*t]=l,l_[2*t+1]=d,l_[2*r]=f,l_[2*r+1]=h,l_[2*n]=p,l_[2*n+1]=y}function lS(e,t,r,n,i,o){let s=i[o],a=i[o+1],c=l_[2*e],u=l_[2*e+1],l=l_[2*t],d=l_[2*t+1],f=l_[2*r],h=l_[2*r+1],p=l_[2*n],y=l_[2*n+1],g=up(c,l,s);u=uy(g,u,d,a),c=0|g,({Dh:y,Dl:p}={Dh:y^u,Dl:p^c}),({Dh:y,Dl:p}={Dh:un(y,p,16),Dl:ui(y,p,16)}),({h:h,l:f}=uh(h,f,y,p)),({Bh:d,Bl:l}={Bh:d^h,Bl:l^f}),({Bh:d,Bl:l}={Bh:uo(d,l,63),Bl:us(d,l,63)}),l_[2*e]=c,l_[2*e+1]=u,l_[2*t]=l,l_[2*t+1]=d,l_[2*r]=f,l_[2*r+1]=h,l_[2*n]=p,l_[2*n+1]=y}function lx(e,t={},r,n,i){if(uE(r),e<0||e>r)throw Error("outputLen bigger than keyLen");let{key:o,salt:s,personalization:a}=t;if(void 0!==o&&(o.length<1||o.length>r))throw Error("key length must be undefined or 1.."+r);if(void 0!==s&&s.length!==n)throw Error("salt must be undefined or "+n);if(void 0!==a&&a.length!==i)throw Error("personalization must be undefined or "+i)}class lA extends uU{constructor(e,t){super(),this.finished=!1,this.destroyed=!1,this.length=0,this.pos=0,uE(e),uE(t),this.blockLen=e,this.outputLen=t,this.buffer=new Uint8Array(e),this.buffer32=uO(this.buffer)}update(e){uA(this),uS(e=uL(e));let{blockLen:t,buffer:r,buffer32:n}=this,i=e.length,o=e.byteOffset,s=e.buffer;for(let a=0;a<i;){this.pos===t&&(uj(n),this.compress(n,0,!1),uj(n),this.pos=0);let c=Math.min(t-this.pos,i-a),u=o+a;if(c===t&&!(u%4)&&a+c<i){let e=new Uint32Array(s,u,Math.floor((i-a)/4));uj(e);for(let r=0;a+t<i;r+=n.length,a+=t)this.length+=t,this.compress(e,r,!1);uj(e);continue}r.set(e.subarray(a,a+c),this.pos),this.pos+=c,this.length+=c,a+=c}return this}digestInto(e){uA(this),uI(e,this);let{pos:t,buffer32:r}=this;this.finished=!0,uT(this.buffer.subarray(t)),uj(r),this.compress(r,0,!0),uj(r);let n=uO(e);this.get().forEach((e,t)=>n[t]=uC(e))}digest(){let{buffer:e,outputLen:t}=this;this.digestInto(e);let r=e.slice(0,t);return this.destroy(),r}_cloneInto(e){let{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.buffer.set(t),e.destroyed=i,e.finished=n,e.length=r,e.pos=s,e.outputLen=o,e}clone(){return this._cloneInto()}}class lI extends lA{constructor(e={}){let t=void 0===e.dkLen?64:e.dkLen;super(128,t),this.v0l=0|lw[0],this.v0h=0|lw[1],this.v1l=0|lw[2],this.v1h=0|lw[3],this.v2l=0|lw[4],this.v2h=0|lw[5],this.v3l=0|lw[6],this.v3h=0|lw[7],this.v4l=0|lw[8],this.v4h=0|lw[9],this.v5l=0|lw[10],this.v5h=0|lw[11],this.v6l=0|lw[12],this.v6h=0|lw[13],this.v7l=0|lw[14],this.v7h=0|lw[15],lx(t,e,64,16,16);let{key:r,personalization:n,salt:i}=e,o=0;if(void 0!==r&&(o=(r=uL(r)).length),this.v0l^=this.outputLen|o<<8|0x1010000,void 0!==i){let e=uO(i=uL(i));this.v4l^=uC(e[0]),this.v4h^=uC(e[1]),this.v5l^=uC(e[2]),this.v5h^=uC(e[3])}if(void 0!==n){let e=uO(n=uL(n));this.v6l^=uC(e[0]),this.v6h^=uC(e[1]),this.v7l^=uC(e[2]),this.v7h^=uC(e[3])}if(void 0!==r){let e=new Uint8Array(this.blockLen);e.set(r),this.update(e)}}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:d,v6l:f,v6h:h,v7l:p,v7h:y}=this;return[e,t,r,n,i,o,s,a,c,u,l,d,f,h,p,y]}set(e,t,r,n,i,o,s,a,c,u,l,d,f,h,p,y){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|d,this.v6l=0|f,this.v6h=0|h,this.v7l=0|p,this.v7h=0|y}compress(e,t,r){this.get().forEach((e,t)=>l_[t]=e),l_.set(lw,16);let{h:n,l:i}=c7(BigInt(this.length));l_[24]=lw[8]^i,l_[25]=lw[9]^n,r&&(l_[28]=~l_[28],l_[29]=~l_[29]);let o=0,s=lv;for(let r=0;r<12;r++)lE(0,4,8,12,e,t+2*s[o++]),lS(0,4,8,12,e,t+2*s[o++]),lE(1,5,9,13,e,t+2*s[o++]),lS(1,5,9,13,e,t+2*s[o++]),lE(2,6,10,14,e,t+2*s[o++]),lS(2,6,10,14,e,t+2*s[o++]),lE(3,7,11,15,e,t+2*s[o++]),lS(3,7,11,15,e,t+2*s[o++]),lE(0,5,10,15,e,t+2*s[o++]),lS(0,5,10,15,e,t+2*s[o++]),lE(1,6,11,12,e,t+2*s[o++]),lS(1,6,11,12,e,t+2*s[o++]),lE(2,7,8,13,e,t+2*s[o++]),lS(2,7,8,13,e,t+2*s[o++]),lE(3,4,9,14,e,t+2*s[o++]),lS(3,4,9,14,e,t+2*s[o++]);this.v0l^=l_[0]^l_[16],this.v0h^=l_[1]^l_[17],this.v1l^=l_[2]^l_[18],this.v1h^=l_[3]^l_[19],this.v2l^=l_[4]^l_[20],this.v2h^=l_[5]^l_[21],this.v3l^=l_[6]^l_[22],this.v3h^=l_[7]^l_[23],this.v4l^=l_[8]^l_[24],this.v4h^=l_[9]^l_[25],this.v5l^=l_[10]^l_[26],this.v5h^=l_[11]^l_[27],this.v6l^=l_[12]^l_[28],this.v6h^=l_[13]^l_[29],this.v7l^=l_[14]^l_[30],this.v7h^=l_[15]^l_[31],uT(l_)}destroy(){this.destroyed=!0,uT(this.buffer32),this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0)}}let lO=uK(e=>new lI(e)),lT="https://rpc.walletconnect.org/v1";function lP(e){let t=`�Ethereum Signed Message: 16${e.length}`,r=new TextEncoder().encode(t+e);return"0x"+cn.from(u8(r)).toString("hex")}async function lM(e,t,r,n,i,o){switch(r.t){case"eip191":return await lN(e,t,r.s);case"eip1271":return await lk(e,t,r.s,n,i,o);default:throw Error(`verifySignature failed: Attempted to verify CacaoSignature with unknown type: ${r.t}`)}}async function lN(e,t,r){return(await oM({hash:lP(t),signature:r})).toLowerCase()===e.toLowerCase()}async function lk(e,t,r,n,i,o){let s=co(n);if(!s.namespace||!s.reference)throw Error(`isValidEip1271Signature failed: chainId must be in CAIP-2 format, received: ${n}`);try{let s="0x1626ba7e",a="0000000000000000000000000000000000000000000000000000000000000040",c="0000000000000000000000000000000000000000000000000000000000000041",u=r.substring(2),l=lP(t).substring(2),d=s+l+a+c+u,f=await fetch(`${o||lT}/?chainId=${n}&projectId=${i}`,{method:"POST",body:JSON.stringify({id:lC(),jsonrpc:"2.0",method:"eth_call",params:[{to:e,data:d},"latest"]})}),{result:h}=await f.json();return!!h&&h.slice(0,s.length).toLowerCase()===s.toLowerCase()}catch(e){return console.error("isValidEip1271Signature: ",e),!1}}function lC(){return Date.now()+Math.floor(1e3*Math.random())}function lD(e){let t=atob(e),r=new Uint8Array(t.length);for(let e=0;e<t.length;e++)r[e]=t.charCodeAt(e);let n=r[0];if(0===n)throw Error("No signatures found");let i=1+64*n;
16if(r.length<i)throw Error("Transaction data too short for claimed signature count");if(r.length<100)throw Error("Transaction too short");let o=cn.from(e,"base64").slice(1,65);return oN.encode(o)}function lj(e){let t=new Uint8Array(cn.from(e,"base64")),r=Array.from("TransactionData::").map(e=>e.charCodeAt(0)),n=new Uint8Array(r.length+t.length);n.set(r),n.set(t,r.length);let i=lO(n,{dkLen:32});return oN.encode(i)}function lR(e){let t=new Uint8Array(ly(lL(e)));return oN.encode(t)}function lL(e){if(e instanceof Uint8Array)return e;if(Array.isArray(e))return new Uint8Array(e);if("object"==typeof e&&null!=e&&e.data)return new Uint8Array(Object.values(e.data));if("object"==typeof e&&e)return new Uint8Array(Object.values(e));throw Error("getNearUint8ArrayFromBytes: Unexpected result type from bytes array")}function lB(e){let t=sd(cn.from(e,"base64")).txn;if(!t)throw Error("Invalid signed transaction: missing 'txn' field");let r=sy(t),n=cn.from("TX"),i=lb(cn.concat([n,cn.from(r)]));return sg.RG.encode(i).replace(/=+$/,"")}function lU(e){let t=[],r=BigInt(e);for(;r>=BigInt(128);)t.push(Number(r&BigInt(127)|BigInt(128))),r>>=BigInt(7);return t.push(Number(r)),cn.from(t)}function l$(e){let t=cn.from(e.signed.bodyBytes,"base64"),r=cn.from(e.signed.authInfoBytes,"base64"),n=cn.from(e.signature.signature,"base64"),i=[];i.push(cn.from([10])),i.push(lU(t.length)),i.push(t),i.push(cn.from([18])),i.push(lU(r.length)),i.push(r),i.push(cn.from([26])),i.push(lU(n.length)),i.push(n);let o=ly(cn.concat(i));return cn.from(o).toString("hex").toUpperCase()}var lK=Object.defineProperty,lF=Object.defineProperties,lz=Object.getOwnPropertyDescriptors,lq=Object.getOwnPropertySymbols,lV=Object.prototype.hasOwnProperty,lH=Object.prototype.propertyIsEnumerable,lG=(e,t,r)=>t in e?lK(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,lW=(e,t)=>{for(var r in t||(t={}))lV.call(t,r)&&lG(e,r,t[r]);if(lq)for(var r of lq(t))lH.call(t,r)&&lG(e,r,t[r]);return e},lJ=(e,t)=>lF(e,lz(t));let lZ="did:pkh:",lY=e=>e?.split(":"),lX=e=>{let t=e&&lY(e);if(t)return e.includes(lZ)?t[3]:t[1]},lQ=e=>{let t=e&&lY(e);if(t)return t[2]+":"+t[3]},l0=e=>{let t=e&&lY(e);if(t)return t.pop()};async function l1(e){let{cacao:t,projectId:r}=e,{s:n,p:i}=t,o=l2(i,i.iss),s=l0(i.iss);return await lM(s,o,n,lQ(i.iss),r)}let l2=(e,t)=>{let r=`${e.domain} wants you to sign in with your Ethereum account:`,n=l0(t);if(!e.aud&&!e.uri)throw Error("Either `aud` or `uri` is required to construct the message");let i=e.statement||void 0,o=`URI: ${e.aud||e.uri}`,s=`Version: ${e.version}`,a=`Chain ID: ${lX(t)}`,c=`Nonce: ${e.nonce}`,u=`Issued At: ${e.iat}`,l=e.exp?`Expiration Time: ${e.exp}`:void 0,d=e.nbf?`Not Before: ${e.nbf}`:void 0,f=e.requestId?`Request ID: ${e.requestId}`:void 0,h=e.resources?`Resources:${e.resources.map(e=>` 17- ${e}`).join("")}`:void 0,p=dc(e.resources);return p&&(i=di(i,l7(p))),[r,n,"",i,"",o,s,a,c,u,l,d,f,h].filter(e=>null!=e).join(` 18`)};function l5(e){return cn.from(JSON.stringify(e)).toString("base64")}function l3(e){return JSON.parse(cn.from(e,"base64").toString("utf-8"))}function l8(e){if(!e)throw Error("No recap provided, value is undefined");if(!e.att)throw Error("No `att` property found");let t=Object.keys(e.att);if(!(null!=t&&t.length))throw Error("No resources found in `att` property");t.forEach(t=>{let r=e.att[t];if(Array.isArray(r)||"object"!=typeof r)throw Error(`Resource must be an object: ${t}`);if(!Object.keys(r).length)throw Error(`Resource object is empty: ${t}`);Object.keys(r).forEach(e=>{let t=r[e];if(!Array.isArray(t))throw Error(`Ability limits ${e} must be an array of objects, found: ${t}`);if(!t.length)throw Error(`Value of ${e} is empty array, must be an array with objects`);t.forEach(t=>{if("object"!=typeof t)throw Error(`Ability limits (${e}) must be an array of objects, found: ${t}`)})})})}function l6(e,t,r,n={}){return r?.sort((e,t)=>e.localeCompare(t)),{att:{[e]:l4(t,r,n)}}}function l4(e,t,r={}){return Object.assign({},...(t=t?.sort((e,t)=>e.localeCompare(t))).map(t=>({[`${e}/${t}`]:[r]})))}function l9(e){return l8(e),`urn:recap:${l5(e).replace(/=/g,"")}`}function l7(e){let t=l3(e.replace("urn:recap:",""));return l8(t),t}function de(e,t,r){return l9(l6(e,t,r))}function dt(e){return e&&e.includes("urn:recap:")}function dr(e,t){return l9(dn(l7(e),l7(t)))}function dn(e,t){l8(e),l8(t);let r=Object.keys(e.att).concat(Object.keys(t.att)).sort((e,t)=>
18e.localeCompare(t)),n={att:{}};return r.forEach(r=>{var i,o;Object.keys((null==(i=e.att)?void 0:i[r])||{}).concat(Object.keys((null==(o=t.att)?void 0:o[r])||{})).sort((e,t)=>e.localeCompare(t)).forEach(i=>{var o,s;n.att[r]=lJ(lW({},n.att[r]),{[i]:(null==(o=e.att[r])?void 0:o[i])||(null==(s=t.att[r])?void 0:s[i])})})}),n}function di(e="",t){l8(t);let r="I further authorize the stated URI to perform the following actions on my behalf: ";if(e.includes(r))return e;let n=[],i=0;Object.keys(t.att).forEach(e=>{let r=Object.keys(t.att[e]).map(e=>({ability:e.split("/")[0],action:e.split("/")[1]}));r.sort((e,t)=>e.action.localeCompare(t.action));let o={};r.forEach(e=>{o[e.ability]||(o[e.ability]=[]),o[e.ability].push(e.action)});let s=Object.keys(o).map(t=>(i++,`(${i}) '${t}': '${o[t].join("', '")}' for '${e}'.`));n.push(s.join(", ").replace(".,","."))});let o=n.join(" "),s=`${r}${o}`;return`${e?e+" ":""}${s}`}function ds(e){var t;let r=l7(e);l8(r);let n=null==(t=r.att)?void 0:t.eip155;return n?Object.keys(n).map(e=>e.split("/")[1]):[]}function da(e){let t=l7(e);l8(t);let r=[];return Object.values(t.att).forEach(e=>{Object.values(e).forEach(e=>{var t;null!=(t=e?.[0])&&t.chains&&r.push(e[0].chains)})}),[...new Set(r.flat())]}function dc(e){if(!e)return;let t=e?.[e.length-1];return dt(t)?t:void 0}function du(e){return e instanceof Uint8Array||ArrayBuffer.isView(e)&&"Uint8Array"===e.constructor.name}function dl(e){if("boolean"!=typeof e)throw Error(`boolean expected, not ${e}`)}function dd(e){if(!Number.isSafeInteger(e)||e<0)throw Error("positive integer expected, got "+e)}function df(e,...t){if(!du(e))throw Error("Uint8Array expected");if(t.length>0&&!t.includes(e.length))throw Error("Uint8Array expected of length "+t+", got length="+e.length)}function dh(e,t=!0){if(e.destroyed)throw Error("Hash instance has been destroyed");if(t&&e.finished)throw Error("Hash#digest() has already been called")}function dp(e,t){df(e);let r=t.outputLen;if(e.length<r)throw Error("digestInto() expects output buffer of length at least "+r)}function dy(e){return new Uint32Array(e.buffer,e.byteOffset,Math.floor(e.byteLength/4))}function dg(...e){for(let t=0;t<e.length;t++)e[t].fill(0)}function dm(e){return new DataView(e.buffer,e.byteOffset,e.byteLength)}let db=68===new Uint8Array(new Uint32Array([0x11223344]).buffer)[0];function dv(e){if("string"!=typeof e)throw Error("string expected");return new Uint8Array(new TextEncoder().encode(e))}function dw(e){if("string"==typeof e)e=dv(e);else if(du(e))e=dT(e);else throw Error("Uint8Array expected, got "+typeof e);return e}function d_(e,t){if(null==t||"object"!=typeof t)throw Error("options must be defined");return Object.assign(e,t)}function dE(e,t){if(e.length!==t.length)return!1;let r=0;for(let n=0;n<e.length;n++)r|=e[n]^t[n];return 0===r}let dS=(e,t)=>{function r(n,...i){if(df(n),!db)throw Error("Non little-endian hardware is not yet supported");if(void 0!==e.nonceLength){let t=i[0];if(!t)throw Error("nonce / iv required");e.varSizeNonce?df(t):df(t,e.nonceLength)}let o=e.tagLength;o&&void 0!==i[1]&&df(i[1]);let s=t(n,...i),a=(e,t)=>{if(void 0!==t){if(2!==e)throw Error("cipher output not supported");df(t)}},c=!1;return{encrypt(e,t){if(c)throw Error("cannot encrypt() twice with same key + nonce");return c=!0,df(e),a(s.encrypt.length,t),s.encrypt(e,t)},decrypt(e,t){if(df(e),o&&e.length<o)throw Error("invalid ciphertext length: smaller than tagLength="+o);return a(s.decrypt.length,t),s.decrypt(e,t)}}}return Object.assign(r,e),r};function dx(e,t,r=!0){if(void 0===t)return new Uint8Array(e);if(t.length!==e)throw Error("invalid output length, expected "+e+", got: "+t.length);if(r&&!dO(t))throw Error("invalid output, must be aligned");return t}function dA(e,t,r,n){if("function"==typeof e.setBigUint64)return e.setBigUint64(t,r,n);let i=BigInt(32),o=BigInt(0xffffffff),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)}function dI(e,t,r){dl(r);let n=new Uint8Array(16),i=dm(n);return dA(i,0,BigInt(t),r),dA(i,8,BigInt(e),r),n}function dO(e){return e.byteOffset%4==0}function dT(e){return Uint8Array.from(e)}let dP=e=>Uint8Array.from(e.split("").map(e=>e.charCodeAt(0))),dM=dP("expand 16-byte k"),dN=dP("expand 32-byte k"),dk=dy(dM),dC=dy(dN);function dD(e,t){return e<<t|e>>>32-t}function dj(e){return e.byteOffset%4==0}let dR=64,dL=16,dB=0x100000000-1,dU=new Uint32Array;function d$(e,t,r,n,i,o,s,a){let c=i.length,u=new Uint8Array(dR),l=dy(u),d=dj(i)&&dj(o),f=d?dy(i):dU,h=d?dy(o):dU;for(let p=0;p<c;s++){if(e(t,r,n,l,s,a),s>=dB)throw Error("arx: counter overflow");let y=Math.min(dR,c-p);if(d&&y===dR){let e=p/4;
18if(p%4!=0)throw Error("arx: invalid block position");for(let t=0,r;t<dL;t++)h[r=e+t]=f[r]^l[t];p+=dR;continue}for(let e=0,t;e<y;e++)o[t=p+e]=i[t]^u[e];p+=y}}function dK(e,t){let{allowShortKeys:r,extendNonceFn:n,counterLength:i,counterRight:o,rounds:s}=d_({allowShortKeys:!1,counterLength:8,counterRight:!1,rounds:20},t);if("function"!=typeof e)throw Error("core must be a function");return dd(i),dd(s),dl(o),dl(r),(t,a,c,u,l=0)=>{df(t),df(a),df(c);let d=c.length;if(void 0===u&&(u=new Uint8Array(d)),df(u),dd(l),l<0||l>=dB)throw Error("arx: counter overflow");if(u.length<d)throw Error(`arx: output (${u.length}) is shorter than data (${d})`);let f=[],h=t.length,p,y;if(32===h)f.push(p=dT(t)),y=dC;else if(16===h&&r)(p=new Uint8Array(32)).set(t),p.set(t,16),y=dk,f.push(p);else throw Error(`arx: invalid 32-byte key, got length=${h}`);dj(a)||f.push(a=dT(a));let g=dy(p);if(n){if(24!==a.length)throw Error("arx: extended nonce must be 24 bytes");n(y,g,dy(a.subarray(0,16)),g),a=a.subarray(16)}let m=16-i;if(m!==a.length)throw Error(`arx: nonce must be ${m} or 16 bytes`);if(12!==m){let e=new Uint8Array(12);e.set(a,o?0:12-a.length),a=e,f.push(a)}return d$(e,y,g,dy(a),c,u,l,s),dg(...f),u}}let dF=(e,t)=>255&e[t++]|(255&e[t++])<<8;class dz{constructor(e){this.blockLen=16,this.outputLen=16,this.buffer=new Uint8Array(16),this.r=new Uint16Array(10),this.h=new Uint16Array(10),this.pad=new Uint16Array(8),this.pos=0,this.finished=!1,df(e=dw(e),32);let t=dF(e,0),r=dF(e,2),n=dF(e,4),i=dF(e,6),o=dF(e,8),s=dF(e,10),a=dF(e,12),c=dF(e,14);this.r[0]=8191&t,this.r[1]=(t>>>13|r<<3)&8191,this.r[2]=(r>>>10|n<<6)&7939,this.r[3]=(n>>>7|i<<9)&8191,this.r[4]=(i>>>4|o<<12)&255,this.r[5]=o>>>1&8190,this.r[6]=(o>>>14|s<<2)&8191,this.r[7]=(s>>>11|a<<5)&8065,this.r[8]=(a>>>8|c<<8)&8191,this.r[9]=c>>>5&127;for(let t=0;t<8;t++)this.pad[t]=dF(e,16+2*t)}process(e,t,r=!1){let n=r?0:2048,{h:i,r:o}=this,s=o[0],a=o[1],c=o[2],u=o[3],l=o[4],d=o[5],f=o[6],h=o[7],p=o[8],y=o[9],g=dF(e,t+0),m=dF(e,t+2),b=dF(e,t+4),v=dF(e,t+6),w=dF(e,t+8),_=dF(e,t+10),E=dF(e,t+12),S=dF(e,t+14),x=i[0]+(8191&g),A=i[1]+((g>>>13|m<<3)&8191),I=i[2]+((m>>>10|b<<6)&8191),O=i[3]+((b>>>7|v<<9)&8191),T=i[4]+((v>>>4|w<<12)&8191),P=i[5]+(w>>>1&8191),M=i[6]+((w>>>14|_<<2)&8191),N=i[7]+((_>>>11|E<<5)&8191),k=i[8]+((E>>>8|S<<8)&8191),C=i[9]+(S>>>5|n),D=0,j=0+x*s+5*y*A+5*p*I+5*h*O+5*f*T;D=j>>>13,j&=8191,j+=5*d*P+5*l*M+5*u*N+5*c*k+5*a*C,D+=j>>>13,j&=8191;let R=D+x*a+A*s+5*y*I+5*p*O+5*h*T;D=R>>>13,R&=8191,R+=5*f*P+5*d*M+5*l*N+5*u*k+5*c*C,D+=R>>>13,R&=8191;let L=D+x*c+A*a+I*s+5*y*O+5*p*T;D=L>>>13,L&=8191,L+=5*h*P+5*f*M+5*d*N+5*l*k+5*u*C,D+=L>>>13,L&=8191;let B=D+x*u+A*c+I*a+O*s+5*y*T;D=B>>>13,B&=8191,B+=5*p*P+5*h*M+5*f*N+5*d*k+5*l*C,D+=B>>>13,B&=8191;let U=D+x*l+A*u+I*c+O*a+T*s;D=U>>>13,U&=8191,U+=5*y*P+5*p*M+5*h*N+5*f*k+5*d*C,D+=U>>>13,U&=8191;let $=D+x*d+A*l+I*u+O*c+T*a;D=$>>>13,$&=8191,$+=P*s+5*y*M+5*p*N+5*h*k+5*f*C,D+=$>>>13,$&=8191;let K=D+x*f+A*d+I*l+O*u+T*c;D=K>>>13,K&=8191,K+=P*a+M*s+5*y*N+5*p*k+5*h*C,D+=K>>>13,K&=8191;let F=D+x*h+A*f+I*d+O*l+T*u;D=F>>>13,F&=8191,F+=P*c+M*a+N*s+5*y*k+5*p*C,D+=F>>>13,F&=8191;let z=D+x*p+A*h+I*f+O*d+T*l;D=z>>>13,z&=8191,z+=P*u+M*c+N*a+k*s+5*y*C,D+=z>>>13,z&=8191;let q=D+x*y+A*p+I*h+O*f+T*d;D=q>>>13,q&=8191,q+=P*l+M*u+N*c+k*a+C*s,D+=q>>>13,q&=8191,j=8191&(D=(D=(D<<2)+D|0)+j|0),D>>>=13,R+=D,i[0]=j,i[1]=R,i[2]=L,i[3]=B,i[4]=U,i[5]=$,i[6]=K,i[7]=F,i[8]=z,i[9]=q}finalize(){let{h:e,pad:t}=this,r=new Uint16Array(10),n=e[1]>>>13;e[1]&=8191;for(let t=2;t<10;t++)e[t]+=n,n=e[t]>>>13,e[t]&=8191;e[0]+=5*n,n=e[0]>>>13,e[0]&=8191,e[1]+=n,n=e[1]>>>13,e[1]&=8191,e[2]+=n,r[0]=e[0]+5,n=r[0]>>>13,r[0]&=8191;for(let t=1;t<10;t++)r[t]=e[t]+n,n=r[t]>>>13,r[t]&=8191;r[9]-=8192;let i=(1^n)-1;for(let e=0;e<10;e++)r[e]&=i;i=~i;for(let t=0;t<10;t++)e[t]=e[t]&i|r[t];e[0]=(e[0]|e[1]<<13)&65535,e[1]=(e[1]>>>3|e[2]<<10)&65535,e[2]=(e[2]>>>6|e[3]<<7)&65535,e[3]=(e[3]>>>9|e[4]<<4)&65535,e[4]=(e[4]>>>12|e[5]<<1|e[6]<<14)&65535,e[5]=(e[6]>>>2|e[7]<<11)&65535,e[6]=(e[7]>>>5|e[8]<<8)&65535,e[7]=(e[8]>>>8|e[9]<<5)&65535;let o=e[0]+t[0];e[0]=65535&o;for(let r=1;r<8;r++)o=(e[r]+t[r]|0)+(o>>>16)|0,e[r]=65535&o;dg(r)}update(e){dh(this),df(e=dw(e));let{buffer:t,blockLen:r}=this,n=e.length;for(let i=0;i<n;){let o=Math.min(r-this.pos,n-i);if(o===r){for(;r<=n-i;i+=r)this.process(e,i);continue}t.set(e.subarray(i,i+o),this.pos),this.pos+=o,i+=o,this.pos===r&&(this.process(t,0,!1),this.pos=0)}return this}destroy(){dg(this.h,this.r,this.buffer,this.pad)}digestInto(e){dh(this),dp(e,this),this.finished=!0;let{buffer:t,h:r}=this,{pos:n}=this;if(n){for(t[n++]=1;n<16;n++)t[n]=0;this.process(t,0,!0)}this.finalize();let i=0;for(let t=0;t<8;t++)e[i++]=r[t]>>>0,e[i++]=r[t]>>>8;return e}digest(){let{buffer:e,outputLen:t}=this;this.digestInto(e);let r=e.slice(0,t);return this.destroy(),r}}let dq=function(e){let t=(t,r)=>e(r).update(dw(t)).digest(),r=e(new Uint8Array(32));return t.outputLen=r.outputLen,t.blockLen=r.blockLen,t.create=t=>e(t),t}(e=>
18new dz(e)),dV=dK(function(e,t,r,n,i,o=20){let s=e[0],a=e[1],c=e[2],u=e[3],l=t[0],d=t[1],f=t[2],h=t[3],p=t[4],y=t[5],g=t[6],m=t[7],b=i,v=r[0],w=r[1],_=r[2],E=s,S=a,x=c,A=u,I=l,O=d,T=f,P=h,M=p,N=y,k=g,C=m,D=b,j=v,R=w,L=_;for(let e=0;e<o;e+=2)M=M+(D=dD(D^(E=E+I|0),16))|0,E=E+(I=dD(I^M,12))|0,M=M+(D=dD(D^E,8))|0,I=dD(I^M,7),N=N+(j=dD(j^(S=S+O|0),16))|0,S=S+(O=dD(O^N,12))|0,N=N+(j=dD(j^S,8))|0,O=dD(O^N,7),k=k+(R=dD(R^(x=x+T|0),16))|0,x=x+(T=dD(T^k,12))|0,k=k+(R=dD(R^x,8))|0,T=dD(T^k,7),C=C+(L=dD(L^(A=A+P|0),16))|0,A=A+(P=dD(P^C,12))|0,C=C+(L=dD(L^A,8))|0,P=dD(P^C,7),k=k+(L=dD(L^(E=E+O|0),16))|0,E=E+(O=dD(O^k,12))|0,k=k+(L=dD(L^E,8))|0,O=dD(O^k,7),C=C+(D=dD(D^(S=S+T|0),16))|0,S=S+(T=dD(T^C,12))|0,C=C+(D=dD(D^S,8))|0,T=dD(T^C,7),M=M+(j=dD(j^(x=x+P|0),16))|0,x=x+(P=dD(P^M,12))|0,M=M+(j=dD(j^x,8))|0,P=dD(P^M,7),N=N+(R=dD(R^(A=A+I|0),16))|0,A=A+(I=dD(I^N,12))|0,N=N+(R=dD(R^A,8))|0,I=dD(I^N,7);let B=0;n[B++]=s+E|0,n[B++]=a+S|0,n[B++]=c+x|0,n[B++]=u+A|0,n[B++]=l+I|0,n[B++]=d+O|0,n[B++]=f+T|0,n[B++]=h+P|0,n[B++]=p+M|0,n[B++]=y+N|0,n[B++]=g+k|0,n[B++]=m+C|0,n[B++]=b+D|0,n[B++]=v+j|0,n[B++]=w+R|0,n[B++]=_+L|0},{counterRight:!1,counterLength:4,allowShortKeys:!1}),dH=new Uint8Array(16),dG=(e,t)=>{e.update(t);let r=t.length%16;r&&e.update(dH.subarray(r))},dW=new Uint8Array(32);function dJ(e,t,r,n,i){let o=e(t,r,dW),s=dq.create(o);i&&dG(s,i),dG(s,n);let a=dI(n.length,i?i.length:0,!0);s.update(a);let c=s.digest();return dg(o,a),c}let dZ=dS({blockSize:64,nonceLength:12,tagLength:16},(e=>(t,r,n)=>({encrypt(i,o){let s=i.length;(o=dx(s+16,o,!1)).set(i);let a=o.subarray(0,-16);e(t,r,a,a,1);let c=dJ(e,t,r,a,n);return o.set(c,s),dg(c),o},decrypt(i,o){o=dx(i.length-16,o,!1);let s=i.subarray(0,-16),a=i.subarray(-16),c=dJ(e,t,r,s,n);if(!dE(a,c))throw Error("invalid tag");return o.set(i.subarray(0,-16)),e(t,r,o,o,1),dg(c),o}}))(dV));class dY extends uU{constructor(e,t){super(),this.finished=!1,this.destroyed=!1,ux(e);let r=uL(t);if(this.iHash=e.create(),"function"!=typeof this.iHash.update)throw Error("Expected instance of class which extends utils.Hash");this.blockLen=this.iHash.blockLen,this.outputLen=this.iHash.outputLen;let n=this.blockLen,i=new Uint8Array(n);i.set(r.length>n?e.create().update(r).digest():r);for(let e=0;e<i.length;e++)i[e]^=54;this.iHash.update(i),this.oHash=e.create();for(let e=0;e<i.length;e++)i[e]^=106;this.oHash.update(i),uT(i)}update(e){return uA(this),this.iHash.update(e),this}digestInto(e){uA(this),uS(e,this.outputLen),this.finished=!0,this.iHash.digestInto(e),this.oHash.update(e),this.oHash.digestInto(e),this.destroy()}digest(){let e=new Uint8Array(this.oHash.outputLen);return this.digestInto(e),e}_cloneInto(e){e||(e=Object.create(Object.getPrototypeOf(this),{}));let{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}clone(){return this._cloneInto()}destroy(){this.destroyed=!0,this.oHash.destroy(),this.iHash.destroy()}}let dX=(e,t,r)=>new dY(e,t).update(r).digest();function dQ(e,t,r){return ux(e),void 0===r&&(r=new Uint8Array(e.outputLen)),dX(e,uL(r),uL(t))}dX.create=(e,t)=>new dY(e,t);let d0=Uint8Array.from([0]),d1=Uint8Array.of();function d2(e,t,r,n=32){ux(e),uE(n);let i=e.outputLen;if(n>255*i)throw Error("Length should be <= 255*HashLen");let o=Math.ceil(n/i);void 0===r&&(r=d1);let s=new Uint8Array(o*i),a=dX.create(e,t),c=a._cloneInto(),u=new Uint8Array(a.outputLen);for(let e=0;e<o;e++)d0[0]=e+1,c.update(0===e?d1:u).update(r).update(d0).digestInto(u),s.set(u,i*e),a._cloneInto(c);return a.destroy(),c.destroy(),uT(u,d0),s.slice(0,n)}let d5=(e,t,r,n,i)=>d2(e,dQ(e,t,r),n,i),d3=ly,d8=BigInt(0),d6=BigInt(1);function d4(e){return e instanceof Uint8Array||ArrayBuffer.isView(e)&&"Uint8Array"===e.constructor.name}function d9(e){if(!d4(e))throw Error("Uint8Array expected")}function d7(e,t){if("boolean"!=typeof t)throw Error(e+" boolean expected, got "+t)}function fe(e){let t=e.toString(16);return 1&t.length?"0"+t:t}function ft(e){if("string"!=typeof e)throw Error("hex string expected, got "+typeof e);return""===e?d8:BigInt("0x"+e)}let fr="function"==typeof Uint8Array.from([]).toHex&&"function"==typeof Uint8Array.fromHex,fn=Array.from({length:256},(e,t)=>t.toString(16).padStart(2,"0"));function fi(e){if(d9(e),fr)return e.toHex();let t="";for(let r=0;r<e.length;r++)t+=fn[e[r]];return t}let fo={_0:48,_9:57,A:65,F:70,a:97,f:102};function fs(e){return e>=fo._0&&e<=fo._9?e-fo._0:e>=fo.A&&e<=fo.F?e-(fo.A-10):e>=fo.a&&e<=fo.f?e-(fo.a-10):void 0}function fa(e){if("string"!=typeof e)throw Error("hex string expected, got "+typeof e);if(fr)return Uint8Array.fromHex(e);let t=e.length,r=t/2;if(t%2)throw Error("hex string expected, got unpadded hex of length "+t);let n=new Uint8Array(r);for(let t=0,i=0;t<r;t++,i+=2){let r=fs(e.charCodeAt(i)),o=fs(e.charCodeAt(i+1));if(void 0===r||void 0===o)throw Error('hex string expected, got non-hex character "'+(e[i]+e[i+1])+'" at index '+i);n[t]=16*r+o}return n}function fc(e){return ft(fi(e))}function fu(e){return d9(e),ft(fi(Uint8Array.from(e).reverse()))}function fl(e,t){return fa(e.toString(16).padStart(2*t,"0"))}function fd(e,t){return fl(e,t).reverse()}function ff(e,t,r){let n;if("string"==typeof t)try{n=fa(t)}catch(t){throw Error(e+" must be hex string or Uint8Array, cause: "+t)}else if(d4(t))n=Uint8Array.from(t);else throw Error(e+" must be hex string or Uint8Array");let i=n.length;if("number"==typeof r&&i!==r)throw Error(e+" of length "+r+" expected, got "+i);return n}function fh(...e){let t=0;for(let r=0;r<e.length;r++){let n=e[r];d9(n),t+=n.length}let r=new Uint8Array(t);for(let t=0,n=0;t<e.length;t++){let i=e[t];r.set(i,n),n+=i.length}return r}let fp=e=>"bigint"==typeof e&&d8<=e;function fy(e,t,r){return fp(e)&&fp(t)&&fp(r)&&t<=e&&e<r}function fg(e,t,r,n){if(!fy(t,r,n))throw Error("expected valid "+e+": "+r+" <= n < "+n+", got "+t)}function fm(e){let t;for(t=0;e>d8;e>>=d6,t+=1);return t}let fb=e=>(d6<<BigInt(e))-d6,fv=e=>new Uint8Array(e),fw=e=>Uint8Array.from(e);function f_(e,t,r){if("number"!=typeof e||e<2)throw Error("hashLen must be a number");if("number"!=typeof t||t<2)throw Error("qByteLen must be a number");if("function"!=typeof r)throw Error("hmacFn must be a function");let n=fv(e),i=fv(e),o=0,s=()=>{n.fill(1),i.fill(0),o=0},a=(...e)=>r(i,n,...e),c=(e=fv(0))=>{i=a(fw([0]),e),n=a(),0!==e.length&&(i=a(fw([1]),e),n=a())},u=()=>{if(o++>=1e3)throw Error("drbg: tried 1000 values");let e=0,r=[];for(;e<t;){let t=(n=a()).slice();r.push(t),e+=n.length}return fh(...r)};return(e,t)=>{let r;for(s(),c(e);!(r=t(u()));)c();return s(),r}}let fE={bigint:e=>"bigint"==typeof e,function:e=>"function"==typeof e,boolean:e=>"boolean"==typeof e,string:e=>"string"==typeof e,stringOrUint8Array:e=>"string"==typeof e||d4(e),isSafeInteger:e=>Number.isSafeInteger(e),array:e=>Array.isArray(e),field:(e,t)=>t.Fp.isValid(e),hash:e=>"function"==typeof e&&Number.isSafeInteger(e.outputLen)};function fS(e,t,r={}){let n=(t,r,n)=>{let i=fE[r];if("function"!=typeof i)throw Error("invalid validator function");let o=e[t];if(!(n&&void 0===o)&&!i(o,e))throw Error("param "+String(t)+" is invali
18d. Expected "+r+", got "+o)};for(let[e,r]of Object.entries(t))n(e,r,!1);for(let[e,t]of Object.entries(r))n(e,t,!0);return e}function fx(e){let t=new WeakMap;return(r,...n)=>{let i=t.get(r);if(void 0!==i)return i;let o=e(r,...n);return t.set(r,o),o}}let fA=BigInt(0),fI=BigInt(1),fO=BigInt(2),fT=BigInt(3),fP=BigInt(4),fM=BigInt(5),fN=BigInt(8);function fk(e,t){let r=e%t;return r>=fA?r:t+r}function fC(e,t,r){let n=e;for(;t-- >fA;)n*=n,n%=r;return n}function fD(e,t){if(e===fA)throw Error("invert: expected non-zero number");if(t<=fA)throw Error("invert: expected positive modulus, got "+t);let r=fk(e,t),n=t,i=fA,o=fI;for(;r!==fA;){let e=n/r,t=n%r,s=i-o*e;n=r,r=t,i=o,o=s}if(n!==fI)throw Error("invert: does not exist");return fk(i,t)}function fj(e,t){let r=(e.ORDER+fI)/fP,n=e.pow(t,r);if(!e.eql(e.sqr(n),t))throw Error("Cannot find square root");return n}function fR(e,t){let r=(e.ORDER-fM)/fN,n=e.mul(t,fO),i=e.pow(n,r),o=e.mul(t,i),s=e.mul(e.mul(o,fO),i),a=e.mul(o,e.sub(s,e.ONE));if(!e.eql(e.sqr(a),t))throw Error("Cannot find square root");return a}function fL(e){if(e<BigInt(3))throw Error("sqrt is not defined for small field");let t=e-fI,r=0;for(;t%fO===fA;)t/=fO,r++;let n=fO,i=fV(e);for(;1===fz(i,n);)if(n++>1e3)throw Error("Cannot find square root: probably non-prime P");if(1===r)return fj;let o=i.pow(n,t),s=(t+fI)/fO;return function(e,n){if(e.is0(n))return n;if(1!==fz(e,n))throw Error("Cannot find square root");let i=r,a=e.mul(e.ONE,o),c=e.pow(n,t),u=e.pow(n,s);for(;!e.eql(c,e.ONE);){if(e.is0(c))return e.ZERO;let t=1,r=e.sqr(c);for(;!e.eql(r,e.ONE);)if(t++,r=e.sqr(r),t===i)throw Error("Cannot find square root");let n=fI<<BigInt(i-t-1),o=e.pow(a,n);i=t,a=e.sqr(o),c=e.mul(c,a),u=e.mul(u,o)}return u}}function fB(e){return e%fP===fT?fj:e%fN===fM?fR:fL(e)}let fU=["create","isValid","is0","neg","inv","sqrt","sqr","eql","add","sub","mul","pow","div","addN","subN","mulN","sqrN"];function f$(e){let t={ORDER:"bigint",MASK:"bigint",BYTES:"isSafeInteger",BITS:"isSafeInteger"};return fS(e,fU.reduce((e,t)=>(e[t]="function",e),t))}function fK(e,t,r){if(r<fA)throw Error("invalid exponent, negatives unsupported");if(r===fA)return e.ONE;if(r===fI)return t;let n=e.ONE,i=t;for(;r>fA;)r&fI&&(n=e.mul(n,i)),i=e.sqr(i),r>>=fI;return n}function fF(e,t,r=!1){let n=Array(t.length).fill(r?e.ZERO:void 0),i=t.reduce((t,r,i)=>e.is0(r)?t:(n[i]=t,e.mul(t,r)),e.ONE),o=e.inv(i);return t.reduceRight((t,r,i)=>e.is0(r)?t:(n[i]=e.mul(t,n[i]),e.mul(t,r)),o),n}function fz(e,t){let r=(e.ORDER-fI)/fO,n=e.pow(t,r),i=e.eql(n,e.ONE),o=e.eql(n,e.ZERO),s=e.eql(n,e.neg(e.ONE));if(!i&&!o&&!s)throw Error("invalid Legendre symbol result");return i?1:o?0:-1}function fq(e,t){void 0!==t&&uE(t);let r=void 0!==t?t:e.toString(2).length,n=Math.ceil(r/8);return{nBitLength:r,nByteLength:n}}function fV(e,t,r=!1,n={}){let i;if(e<=fA)throw Error("invalid field: expected ORDER > 0, got "+e);let{nBitLength:o,nByteLength:s}=fq(e,t);if(s>2048)throw Error("invalid field: expected ORDER of <= 2048 bytes");let a=Object.freeze({ORDER:e,isLE:r,BITS:o,BYTES:s,MASK:fb(o),ZERO:fA,ONE:fI,create:t=>fk(t,e),isValid:t=>{if("bigint"!=typeof t)throw Error("invalid field element: expected bigint, got "+typeof t);return fA<=t&&t<e},is0:e=>e===fA,isOdd:e=>(e&fI)===fI,neg:t=>fk(-t,e),eql:(e,t)=>e===t,sqr:t=>fk(t*t,e),add:(t,r)=>fk(t+r,e),sub:(t,r)=>fk(t-r,e),mul:(t,r)=>fk(t*r,e),pow:(e,t)=>fK(a,e,t),div:(t,r)=>fk(t*fD(r,e),e),sqrN:e=>e*e,addN:(e,t)=>e+t,subN:(e,t)=>e-t,mulN:(e,t)=>e*t,inv:t=>fD(t,e),sqrt:n.sqrt||(t=>(i||(i=fB(e)),i(a,t))),toBytes:e=>r?fd(e,s):fl(e,s),fromBytes:e=>{if(e.length!==s)throw Error("Field.fromBytes: expected "+s+" bytes, got "+e.length);return r?fu(e):fc(e)},invertBatch:e=>fF(a,e),cmov:(e,t,r)=>r?t:e});return Object.freeze(a)}function fH(e){if("bigint"!=typeof e)throw Error("field order must be bigint");return Math.ceil(e.toString(2).length/8)}function fG(e){let t=fH(e);return t+Math.ceil(t/2)}function fW(e,t,r=!1){let n=e.length,i=fH(t),o=fG(t);if(n<16||n<o||n>1024)throw Error("expected "+o+"-1024 bytes of input, got "+n);let s=fk(r?fu(e):fc(e),t-fI)+fI;return r?fd(s,i):fl(s,i)}let fJ=BigInt(0),fZ=BigInt(1);function fY(e,t){let r=t.negate();return e?r:t}function fX(e,t){if(!Number.isSafeInteger(e)||e<=0||e>t)throw Error("invalid window size, expected [1.."+t+"], got W="+e)}function fQ(e,t){fX(e,t);let r=Math.ceil(t/e)+1,n=2**(e-1),i=2**e;return{windows:r,windowSize:n,mask:fb(e),maxNumber:i,shiftBy:BigInt(e)}}function f0(e,t,r){let{windowSize:n,mask:i,maxNumber:o,shiftBy:s}=r,a=Number(e&i),c=e>>s;a>n&&(a-=o,c+=fZ);let u=t*n;return{nextN:c,offset:u+Math.abs(a)-1,isZero:0===a,isNeg:a<0,isNegF:t%2!=0,offsetF:u}}function f1(e,t){if(!Array.isArray(e))throw Error("array expected");e.forEach((e,r)=>{if(!(e instanceof t))throw Error("invalid point at index "+r)})}function f2(e,t){if(!Array.isArray(e))throw Error("array of scalars expected");e.forEach((e,r)=>{if(!t.isValid(e))throw Error("invalid scalar at index "+r)})}let f5=new WeakMap,f3=new WeakMap;function f8(e){return f3.get(e)||1}function f6(e,t){return{constTimeNegate:fY,hasPrecomputes:e=>1!==f8(e),unsafeLadder(t,r,n=e.ZERO){let i=t;for(;r>fJ;)r&fZ&&(n=n.add(i)),i=i.double(),r>>=fZ;return n},precomputeWindow(e,r){let{windows:n,windowSize:i}=fQ(r,t),o=[],s=e,a=s;for(let e=0;e<n;e++){a=s,o.push(a);for(let e=1;e<i;e++)a=a.add(s),o.push(a);s=a.double()}return o},wNAF(r,n,i){let o=e.ZERO,s=e.BASE,a=fQ(r,t);for(let e=0;e<a.windows;e++){let{nextN:t,offset:r,isZero:c,isNeg:u,isNegF:l,offsetF:d}=f0(i,e,a);i=t,c?s=s.add(fY(l,n[d])):o=o.add(fY(u,n[r]))}return{p:o,f:s}},wNAFUnsafe(r,n,i,o=e.ZERO){let s=fQ(r,t);for(let e=0;e<s.windows&&i!==fJ;e++){let{nextN:t,offset:r,isZero:a,isNeg:c}=f0(i,e,s);if(i=t,!a){let e=n[r];o=o.add(c?e.negate():e)}}return o},getPrecomputes(e,t,r){let n=f5.get(t);
18return n||(n=this.precomputeWindow(t,e),1!==e&&f5.set(t,r(n))),n},wNAFCached(e,t,r){let n=f8(e);return this.wNAF(n,this.getPrecomputes(n,e,r),t)},wNAFCachedUnsafe(e,t,r,n){let i=f8(e);return 1===i?this.unsafeLadder(e,t,n):this.wNAFUnsafe(i,this.getPrecomputes(i,e,r),t,n)},setWindowSize(e,r){fX(r,t),f3.set(e,r),f5.delete(e)}}}function f4(e,t,r,n){f1(r,e),f2(n,t);let i=r.length,o=n.length;if(i!==o)throw Error("arrays of points and scalars must have equal length");let s=e.ZERO,a=fm(BigInt(i)),c=1;a>12?c=a-3:a>4?c=a-2:a>0&&(c=2);let u=fb(c),l=Array(Number(u)+1).fill(s),d=Math.floor((t.BITS-1)/c)*c,f=s;for(let e=d;e>=0;e-=c){l.fill(s);for(let t=0;t<o;t++){let i=Number(n[t]>>BigInt(e)&u);l[i]=l[i].add(r[t])}let t=s;for(let e=l.length-1,r=s;e>0;e--)r=r.add(l[e]),t=t.add(r);if(f=f.add(t),0!==e)for(let e=0;e<c;e++)f=f.double()}return f}function f9(e){return f$(e.Fp),fS(e,{n:"bigint",h:"bigint",Gx:"field",Gy:"field"},{nBitLength:"isSafeInteger",nByteLength:"isSafeInteger"}),Object.freeze({...fq(e.n,e.nBitLength),...e,p:e.Fp.ORDER})}BigInt(0),BigInt(1),BigInt(2),BigInt(8);let f7=BigInt(0),he=BigInt(1),ht=BigInt(2);function hr(e){return fS(e,{adjustScalarBytes:"function",powPminus2:"function"}),Object.freeze({...e})}function hn(e){let t=hr(e),{P:r,type:n,adjustScalarBytes:i,powPminus2:o}=t,s="x25519"===n;if(!s&&"x448"!==n)throw Error("invalid type");let a=s?255:448,c=s?32:56,u=BigInt(s?9:5),l=BigInt(s?121665:39081),d=s?ht**BigInt(254):ht**BigInt(447),f=d+(s?BigInt(8)*ht**BigInt(251)-he:BigInt(4)*ht**BigInt(445)-he)+he,h=e=>fk(e,r),p=y(u);function y(e){return fd(h(e),c)}function g(e){let t=ff("u coordinate",e,c);return s&&(t[31]&=127),h(fu(t))}function m(e){return fu(i(ff("scalar",e,c)))}function b(e,t){let r=_(g(t),m(e));if(r===f7)throw Error("invalid private or public key received");return y(r)}function v(e){return b(e,p)}function w(e,t,r){let n=h(e*(t-r));return{x_2:t=h(t-n),x_3:r=h(r+n)}}function _(e,t){fg("u",e,f7,r),fg("scalar",t,d,f);let n=t,i=e,s=he,c=f7,u=e,p=he,y=f7;for(let e=BigInt(a-1);e>=f7;e--){let t=n>>e&he;y^=t,({x_2:s,x_3:u}=w(y,s,u)),({x_2:c,x_3:p}=w(y,c,p)),y=t;let r=s+c,o=h(r*r),a=s-c,d=h(a*a),f=o-d,g=u+p,m=h((u-p)*r),b=h(g*a),v=m+b,_=m-b;u=h(v*v),p=h(i*h(_*_)),s=h(o*d),c=h(f*(o+h(l*f)))}return{x_2:s,x_3:u}=w(y,s,u),{x_2:c,x_3:p}=w(y,c,p),h(s*o(c))}return{scalarMult:b,scalarMultBase:v,getSharedSecret:(e,t)=>b(e,t),getPublicKey:e=>v(e),utils:{randomPrivateKey:()=>t.randomBytes(c)},GuBytes:p.slice()}}let hi=BigInt("57896044618658097711785492504343953926634992332820282019728792003956564819949");BigInt(0);let ho=BigInt(1),hs=BigInt(2),ha=BigInt(3),hc=BigInt(5);function hu(e){let t=BigInt(10),r=BigInt(20),n=BigInt(40),i=BigInt(80),o=hi,s=e*e%o*e%o,a=fC(s,hs,o)*s%o,c=fC(a,ho,o)*e%o,u=fC(c,hc,o)*c%o,l=fC(u,t,o)*u%o,d=fC(l,r,o)*l%o,f=fC(d,n,o)*d%o,h=fC(f,i,o)*f%o,p=fC(h,i,o)*f%o,y=fC(p,t,o)*u%o;return{pow_p_5_8:fC(y,hs,o)*e%o,b2:s}}BigInt(8);let hl=hn({P:hi,type:"x25519",powPminus2:e=>{let t=hi,{pow_p_5_8:r,b2:n}=hu(e);return fk(fC(r,ha,t)*n,t)},adjustScalarBytes:function(e){return e[0]&=248,e[31]&=127,e[31]|=64,e},randomBytes:uF});function hd(e){void 0!==e.lowS&&d7("lowS",e.lowS),void 0!==e.prehash&&d7("prehash",e.prehash)}function hf(e){let t=f9(e);fS(t,{a:"field",b:"field"},{allowInfinityPoint:"boolean",allowedPrivateKeyLengths:"array",clearCofactor:"function",fromBytes:"function",isTorsionFree:"function",toBytes:"function",wrapPrivateKey:"boolean"});let{endo:r,Fp:n,a:i}=t;if(r){if(!n.eql(i,n.ZERO))throw Error("invalid endo: CURVE.a must be 0");if("object"!=typeof r||"bigint"!=typeof r.beta||"function"!=typeof r.splitScalar)throw Error('invalid endo: expected "beta": bigint and "splitScalar": function')}return Object.freeze({...t})}class hh extends Error{constructor(e=""){super(e)}}let hp={Err:hh,_tlv:{encode:(e,t)=>{let{Err:r}=hp;if(e<0||e>256)throw new r("tlv.encode: wrong tag");if(1&t.length)throw new r("tlv.encode: unpadded data");let n=t.length/2,i=fe(n);if(i.length/2&128)throw new r("tlv.encode: long form length too big");let o=n>127?fe(i.length/2|128):"";return fe(e)+o+i+t},decode(e,t){let{Err:r}=hp,n=0;if(e<0||e>256)throw new r("tlv.encode: wrong tag");if(t.length<2||t[n++]!==e)throw new r("tlv.decode: wrong tlv");let i=t[n++],o=0;if(128&i){let e=127&i;if(!e)throw new r("tlv.decode(long): indefinite length not supported");if(e>4)throw new r("tlv.decode(long): byte length is too big");let s=t.subarray(n,n+e);
vendor: 4,317 bytes, line 18
18if(s.length!==e)throw new r("tlv.decode: length bytes not complete");if(0===s[0])throw new r("tlv.decode(long): zero leftmost byte");for(let e of s)o=o<<8|e;if(n+=e,o<128)throw new r("tlv.decode(long): not minimal encoding")}else o=i;let s=t.subarray(n,n+o);if(s.length!==o)throw new r("tlv.decode: wrong value length");return{v:s,l:t.subarray(n+o)}}},_int:{encode(e){let{Err:t}=hp;if(e<hg)throw new t("integer: negative integers are not allowed");let r=fe(e);if(8&Number.parseInt(r[0],16)&&(r="00"+r),1&r.length)throw new t("unexpected DER parsing assertion: unpadded hex");return r},decode(e){let{Err:t}=hp;if(128&e[0])throw new t("invalid signature integer: negative");if(0===e[0]&&!(128&e[1]))throw new t("invalid signature integer: unnecessary leading zero");return fc(e)}},toSig(e){let{Err:t,_int:r,_tlv:n}=hp,i=ff("signature",e),{v:o,l:s}=n.decode(48,i);if(s.length)throw new t("invalid signature: left bytes after parsing");let{v:a,l:c}=n.decode(2,o),{v:u,l}=n.decode(2,c);if(l.length)throw new t("invalid signature: left bytes after parsing");return{r:r.decode(a),s:r.decode(u)}},hexFromSig(e){let{_tlv:t,_int:r}=hp,n=t.encode(2,r.encode(e.r))+t.encode(2,r.encode(e.s));return t.encode(48,n)}};function hy(e,t){return fi(fl(e,t))}let hg=BigInt(0),hm=BigInt(1);BigInt(2);let hb=BigInt(3),hv=BigInt(4);function hw(e){let t=hf(e),{Fp:r}=t,n=fV(t.n,t.nBitLength),i=t.toBytes||((e,t,n)=>{let i=t.toAffine();return fh(Uint8Array.from([4]),r.toBytes(i.x),r.toBytes(i.y))}),o=t.fromBytes||(e=>{let t=e.subarray(1);return{x:r.fromBytes(t.subarray(0,r.BYTES)),y:r.fromBytes(t.subarray(r.BYTES,2*r.BYTES))}});function s(e){let{a:n,b:i}=t,o=r.sqr(e),s=r.mul(o,e);return r.add(r.add(s,r.mul(e,n)),i)}function a(e,t){let n=r.sqr(t),i=s(e);return r.eql(n,i)}if(!a(t.Gx,t.Gy))throw Error("bad curve params: generator point");let c=r.mul(r.pow(t.a,hb),hv),u=r.mul(r.sqr(t.b),BigInt(27));if(r.is0(r.add(c,u)))throw Error("bad curve params: a or b");function l(e){return fy(e,hm,t.n)}function d(e){let r;let{allowedPrivateKeyLengths:n,nByteLength:i,wrapPrivateKey:o,n:s}=t;if(n&&"bigint"!=typeof e){if(d4(e)&&(e=fi(e)),"string"!=typeof e||!n.includes(e.length))throw Error("invalid private key");e=e.padStart(2*i,"0")}try{r="bigint"==typeof e?e:fc(ff("private key",e,i))}catch{throw Error("invalid private key, expected hex or "+i+" bytes, got "+typeof e)}return o&&(r=fk(r,s)),fg("private key",r,hm,s),r}function f(e){if(!(e instanceof y))throw Error("ProjectivePoint expected")}let h=fx((e,t)=>{let{px:n,py:i,pz:o}=e;if(r.eql(o,r.ONE))return{x:n,y:i};let s=e.is0();null==t&&(t=s?r.ONE:r.inv(o));let a=r.mul(n,t),c=r.mul(i,t),u=r.mul(o,t);if(s)return{x:r.ZERO,y:r.ZERO};if(!r.eql(u,r.ONE))throw Error("invZ was invalid");return{x:a,y:c}}),p=fx(e=>{if(e.is0()){if(t.allowInfinityPoint&&!r.is0(e.py))return;throw Error("bad point: ZERO")}let{x:n,y:i}=e.toAffine();if(!r.isValid(n)||!r.isValid(i))throw Error("bad point: x or y not FE");if(!a(n,i))throw Error("bad point: equation left != right");if(!e.isTorsionFree())throw Error("bad point: not in prime-order subgroup");return!0});class y{constructor(e,t,n){if(null==e||!r.isValid(e))throw Error("x required");if(null==t||!r.isValid(t)||r.is0(t))throw Error("y required");if(null==n||!r.isValid(n))throw Error("z required");this.px=e,this.py=t,this.pz=n,Object.freeze(this)}static fromAffine(e){let{x:t,y:n}=e||{};if(!e||!r.isValid(t)||!r.isValid(n))throw Error("invalid affine point");if(e instanceof y)throw Error("projective point not allowed");let i=e=>r.eql(e,r.ZERO);return i(t)&&i(n)?y.ZERO:new y(t,n,r.ONE)}get x(){return this.toAffine().x}get y(){return this.toAffine().y}static normalizeZ(e){let t=fF(r,e.map(e=>e.pz));return e.map((e,r)=>e.toAffine(t[r])).map(y.fromAffine)}static fromHex(e){let t=y.fromAffine(o(ff("pointHex",e)));return t.assertValidity(),t}static fromPrivateKey(e){return y.BASE.multiply(d(e))}static msm(e,t){return f4(y,n,e,t)}_setWindowSize(e){b.setWindowSize(this,e)}assertValidity(){p(this)}hasEvenY(){let{y:e}=this.toAffine();if(r.isOdd)return!r.isOdd(e);throw Error("Field doesn't support isOdd")}equals(e){f(e);let{px:t,py:n,pz:i}=this,{px:o,py:s,pz:a}=e,c=r.eql(r.mul(t,a),r.mul(o,i)),u=r.eql(r.mul(n,a),r.mul(s,i));return c&&u}negate(){return new y(this.px,r.neg(this.py),this.pz)}double(){let{a:e,b:n}=t,i=r.mul(n,hb),{px:o,py:s,pz:a}
vendor: 4,305 bytes, line 18
18=this,c=r.ZERO,u=r.ZERO,l=r.ZERO,d=r.mul(o,o),f=r.mul(s,s),h=r.mul(a,a),p=r.mul(o,s);return p=r.add(p,p),l=r.mul(o,a),l=r.add(l,l),c=r.mul(e,l),u=r.mul(i,h),u=r.add(c,u),c=r.sub(f,u),u=r.add(f,u),u=r.mul(c,u),c=r.mul(p,c),l=r.mul(i,l),h=r.mul(e,h),p=r.sub(d,h),p=r.mul(e,p),p=r.add(p,l),l=r.add(d,d),d=r.add(l,d),d=r.add(d,h),d=r.mul(d,p),u=r.add(u,d),h=r.mul(s,a),h=r.add(h,h),d=r.mul(h,p),c=r.sub(c,d),l=r.mul(h,f),l=r.add(l,l),new y(c,u,l=r.add(l,l))}add(e){f(e);let{px:n,py:i,pz:o}=this,{px:s,py:a,pz:c}=e,u=r.ZERO,l=r.ZERO,d=r.ZERO,h=t.a,p=r.mul(t.b,hb),g=r.mul(n,s),m=r.mul(i,a),b=r.mul(o,c),v=r.add(n,i),w=r.add(s,a);v=r.mul(v,w),w=r.add(g,m),v=r.sub(v,w),w=r.add(n,o);let _=r.add(s,c);return w=r.mul(w,_),_=r.add(g,b),w=r.sub(w,_),_=r.add(i,o),u=r.add(a,c),_=r.mul(_,u),u=r.add(m,b),_=r.sub(_,u),d=r.mul(h,w),u=r.mul(p,b),d=r.add(u,d),u=r.sub(m,d),d=r.add(m,d),l=r.mul(u,d),m=r.add(g,g),m=r.add(m,g),b=r.mul(h,b),w=r.mul(p,w),m=r.add(m,b),b=r.sub(g,b),b=r.mul(h,b),w=r.add(w,b),g=r.mul(m,w),l=r.add(l,g),g=r.mul(_,w),u=r.mul(v,u),u=r.sub(u,g),g=r.mul(v,m),d=r.mul(_,d),new y(u,l,d=r.add(d,g))}subtract(e){return this.add(e.negate())}is0(){return this.equals(y.ZERO)}wNAF(e){return b.wNAFCached(this,e,y.normalizeZ)}multiplyUnsafe(e){let{endo:n,n:i}=t;fg("scalar",e,hg,i);let o=y.ZERO;if(e===hg)return o;if(this.is0()||e===hm)return this;if(!n||b.hasPrecomputes(this))return b.wNAFCachedUnsafe(this,e,y.normalizeZ);let{k1neg:s,k1:a,k2neg:c,k2:u}=n.splitScalar(e),l=o,d=o,f=this;for(;a>hg||u>hg;)a&hm&&(l=l.add(f)),u&hm&&(d=d.add(f)),f=f.double(),a>>=hm,u>>=hm;return s&&(l=l.negate()),c&&(d=d.negate()),d=new y(r.mul(d.px,n.beta),d.py,d.pz),l.add(d)}multiply(e){let n,i;let{endo:o,n:s}=t;if(fg("scalar",e,hm,s),o){let{k1neg:t,k1:s,k2neg:a,k2:c}=o.splitScalar(e),{p:u,f:l}=this.wNAF(s),{p:d,f:f}=this.wNAF(c);u=b.constTimeNegate(t,u),d=b.constTimeNegate(a,d),d=new y(r.mul(d.px,o.beta),d.py,d.pz),n=u.add(d),i=l.add(f)}else{let{p:t,f:r}=this.wNAF(e);n=t,i=r}return y.normalizeZ([n,i])[0]}multiplyAndAddUnsafe(e,t,r){let n=y.BASE,i=(e,t)=>t!==hg&&t!==hm&&e.equals(n)?e.multiply(t):e.multiplyUnsafe(t),o=i(this,t).add(i(e,r));return o.is0()?void 0:o}toAffine(e){return h(this,e)}isTorsionFree(){let{h:e,isTorsionFree:r}=t;if(e===hm)return!0;if(r)return r(y,this);throw Error("isTorsionFree() has not been declared for the elliptic curve")}clearCofactor(){let{h:e,clearCofactor:r}=t;return e===hm?this:r?r(y,this):this.multiplyUnsafe(t.h)}toRawBytes(e=!0){return d7("isCompressed",e),this.assertValidity(),i(y,this,e)}toHex(e=!0){return d7("isCompressed",e),fi(this.toRawBytes(e))}}y.BASE=new y(t.Gx,t.Gy,r.ONE),y.ZERO=new y(r.ZERO,r.ONE,r.ZERO);let{endo:g,nBitLength:m}=t,b=f6(y,g?Math.ceil(m/2):m);return{CURVE:t,ProjectivePoint:y,normPrivateKeyToScalar:d,weierstrassEquation:s,isWithinCurveOrder:l}}function h_(e){let t=f9(e);return fS(t,{hash:"hash",hmac:"function",randomBytes:"function"},{bits2int:"function",bits2int_modN:"function",lowS:"boolean"}),Object.freeze({lowS:!0,...t})}function hE(e){let t=h_(e),{Fp:r,n:n,nByteLength:i,nBitLength:o}=t,s=r.BYTES+1,a=2*r.BYTES+1;function c(e){return fk(e,n)}function u(e){return fD(e,n)}let{ProjectivePoint:l,normPrivateKeyToScalar:d,weierstrassEquation:f,isWithinCurveOrder:h}=hw({...t,toBytes(e,t,n){let i=t.toAffine(),o=r.toBytes(i.x),s=fh;return d7("isCompressed",n),n?s(Uint8Array.from([t.hasEvenY()?2:3]),o):s(Uint8Array.from([4]),o,r.toBytes(i.y))},fromBytes(e){let t=e.length,n=e[0],i=e.subarray(1);if(t===s&&(2===n||3===n)){let e;let t=fc(i);if(!fy(t,hm,r.ORDER))throw Error("Point is not on curve");let o=f(t);try{e=r.sqrt(o)}catch(e){throw Error("Point is not on curve"+(e instanceof Error?": "+e.message:""))}return(1&n)==1!=((e&hm)===hm)&&(e=r.neg(e)),{x:t,y:e}}if(t===a&&4===n)return{x:r.fromBytes(i.subarray(0,r.BYTES)),y:r.fromBytes(i.subarray(r.BYTES,2*r.BYTES))};throw Error("invalid Point, expected length of "+s+", or uncompressed "+a+", got "+t)}});function p(e){return e>n>>hm}function y(e){return p(e)?c(-e):e}let g=(e,t,r)=>fc(e.slice(t,r));class m{constructor(e,t,r){fg("r",e,hm,n),fg("s",t,hm,n),this.r=e,this.s=t,null!=r&&(this.recovery=r),Object.freeze(this)}static fromCompact(e){let t=i;return new m(g(e=ff("compactSignature",e,2*t),0,t),g(e,t,2*t))}static fromDER(e){let{r:t,s:r}=hp.toSig(ff("DER",e));return new m(t,r)}
18assertValidity(){}addRecoveryBit(e){return new m(this.r,this.s,e)}recoverPublicKey(e){let{r:n,s:i,recovery:o}=this,s=S(ff("msgHash",e));if(null==o||![0,1,2,3].includes(o))throw Error("recovery id invalid");let a=2===o||3===o?n+t.n:n;if(a>=r.ORDER)throw Error("recovery id 2 or 3 invalid");let d=(1&o)==0?"02":"03",f=l.fromHex(d+hy(a,r.BYTES)),h=u(a),p=c(-s*h),y=c(i*h),g=l.BASE.multiplyAndAddUnsafe(f,p,y);if(!g)throw Error("point at infinify");return g.assertValidity(),g}hasHighS(){return p(this.s)}normalizeS(){return this.hasHighS()?new m(this.r,c(-this.s),this.recovery):this}toDERRawBytes(){return fa(this.toDERHex())}toDERHex(){return hp.hexFromSig(this)}toCompactRawBytes(){return fa(this.toCompactHex())}toCompactHex(){let e=i;return hy(this.r,e)+hy(this.s,e)}}let b={isValidPrivateKey(e){try{return d(e),!0}catch{return!1}},normPrivateKeyToScalar:d,randomPrivateKey:()=>{let e=fG(t.n);return fW(t.randomBytes(e),t.n)},precompute:(e=8,t=l.BASE)=>(t._setWindowSize(e),t.multiply(BigInt(3)),t)};function v(e,t=!0){return l.fromPrivateKey(e).toRawBytes(t)}function w(e){if("bigint"==typeof e)return!1;if(e instanceof l)return!0;let n=ff("key",e).length,o=r.BYTES,s=o+1,a=2*o+1;if(!(t.allowedPrivateKeyLengths||i===s))return n===s||n===a}function _(e,t,r=!0){if(!0===w(e))throw Error("first arg must be private key");if(!1===w(t))throw Error("second arg must be public key");return l.fromHex(t).multiply(d(e)).toRawBytes(r)}let E=t.bits2int||function(e){if(e.length>8192)throw Error("input is too large");let t=fc(e),r=8*e.length-o;return r>0?t>>BigInt(r):t},S=t.bits2int_modN||function(e){return c(E(e))},x=fb(o);function A(e){return fg("num < 2^"+o,e,hg,x),fl(e,i)}function I(e,n,i=O){if(["recovered","canonical"].some(e=>e in i))throw Error("sign() legacy options not supported");let{hash:o,randomBytes:s}=t,{lowS:a,prehash:f,extraEntropy:g}=i;null==a&&(a=!0),e=ff("msgHash",e),hd(i),f&&(e=ff("prehashed msgHash",o(e)));let b=S(e),v=d(n),w=[A(v),A(b)];if(null!=g&&!1!==g){let e=!0===g?s(r.BYTES):g;w.push(ff("extraEntropy",e))}let _=fh(...w),x=b;return{seed:_,k2sig:function(e){let t=E(e);if(!h(t))return;let r=u(t),n=l.BASE.multiply(t).toAffine(),i=c(n.x);if(i===hg)return;let o=c(r*c(x+i*v));if(o===hg)return;let s=(n.x===i?0:2)|Number(n.y&hm),d=o;return a&&p(o)&&(d=y(o),s^=1),new m(i,d,s)}}}let O={lowS:t.lowS,prehash:!1},T={lowS:t.lowS,prehash:!1};function P(e,r,n=O){let{seed:i,k2sig:o}=I(e,r,n),s=t;return f_(s.hash.outputLen,s.nByteLength,s.hmac)(i,o)}function M(e,r,n,i=T){let o,s;let a=e;r=ff("msgHash",r),n=ff("publicKey",n);let{lowS:d,prehash:f,format:h}=i;if(hd(i),"strict"in i)throw Error("options.strict was renamed to lowS");if(void 0!==h&&"compact"!==h&&"der"!==h)throw Error("format must be compact or der");let p="string"==typeof a||d4(a),y=!p&&!h&&"object"==typeof a&&null!==a&&"bigint"==typeof a.r&&"bigint"==typeof a.s;if(!p&&!y)throw Error("invalid signature, expected Uint8Array, hex string or Signature instance");try{if(y&&(o=new m(a.r,a.s)),p){try{"compact"!==h&&(o=m.fromDER(a))}catch(e){if(!(e instanceof hp.Err))throw e}o||"der"===h||(o=m.fromCompact(a))}s=l.fromHex(n)}catch{return!1}if(!o||d&&o.hasHighS())return!1;f&&(r=t.hash(r));let{r:g,s:b}=o,v=S(r),w=u(b),_=c(v*w),E=c(g*w),x=l.BASE.multiplyAndAddUnsafe(s,_,E)?.toAffine();return!!x&&c(x.x)===g}return l.BASE._setWindowSize(8),{CURVE:t,getPublicKey:v,getSharedSecret:_,sign:P,verify:M,ProjectivePoint:l,Signature:m,utils:b}}function hS(e){return{hash:e,hmac:(t,...r)=>dX(e,t,uB(...r)),randomBytes:uF}}function hx(e,t){let r=t=>hE({...e,...hS(t)});return{...r(t),create:r}}let hA=fV(BigInt("0xffffffff00000001000000000000000000000000ffffffffffffffffffffffff")),hI=hx({a:hA.create(BigInt("-3")),b:BigInt("0x5ac635d8aa3a93e7b3ebbd55769886bc651d06b0cc53b0f63bce3c3e27d2604b"),Fp:hA,n:BigInt("0xffffffff00000000ffffffffffffffffbce6faada7179e84f3b9cac2fc632551"),Gx:BigInt("0x6b17d1f2e12c4247f8bce6e563a440f277037d812deb33a0f4a13945d898c296"),Gy:BigInt("0x4fe342e2fe1a7f9b8ee7eb4a7c0f9e162bce33576b315ececbb6406837bf51f5"),h:BigInt(1),lowS:!1},ly),hO=fV(BigInt("0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffeffffffff0000000000000000ffffffff"));hx({a:hO.create(BigInt("-3")),b:BigInt("0xb3312fa7e23ee7e4988e056be3f82d19181d9c6efe8141120314088f5013875ac656398d8a2ed19d2a85c8edd3ec2aef"),Fp:hO,n:BigInt("0xffffffffffffffffffffffffffffffffffffffffffffffffc7634d81f4372ddf581a0db248b0a77aecec196accc52973"),Gx:BigInt("0xaa87ca22be8b05378eb1c71ef320ad746e1d3b628ba79b9859f741e082542a385502f25dbf55296c3a545e3872760ab7"),Gy:BigInt("0x3617de4a96262c6f5d9e98bf9292dc29f8f41dbd289a147ce9da3113b5f0b8c00a60b1ce1d7e819d7a431d7c90ea0e5f"),h:BigInt(1),lowS:!1},lm);let hT=fV(BigInt("0x1ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff"));hx({a:hT.create(BigInt("-3")),b:BigInt("0x0051953eb9618e1c9a1f929a21a0b68540eea2da725b99b315f3b8b489918ef109e156193951ec7e937b1652c0bd3bb1bf073573df883d2c34f1ef451fd46b503f00"),Fp:hT,n:BigInt("0x01fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffa51868783bf2f966b7fcc0148f709a5d03bb5c9b8899c47aebb6fb71e91386409"),Gx:BigInt("0x00c6858e06b70404e9cd9e3ecb662395b4429c648139053fb521f828af606b4d3dbaa14b5e77efe75928fe1dc127a2ffa8de3348b3c1856a429bf97e7e31c2e5bd66"),Gy:BigInt("0x011839296a789a3bc0045c8a5fb42c7d1bd998f54449579b446817afbd17273e662c97ee72995ef42640c550b9013fad0761353c7086a272c24088be94769fd16650"),h:BigInt(1),lowS:!1,allowedPrivateKeyLengths:[130,131,132]},lg);let hP=hI,hM="base10",hN="base16",hk="base64pad",hC="base64url",hD="utf8",hj=0,hR=1,hL=2,hB=0,hU=1,h$=12,hK=32;function hF(){let e=hl.utils.randomPrivateKey(),t=hl.getPublicKey(e);return{privateKey:a6(e,hN),publicKey:a6(t,hN)}}function hz(){return a6(uF(hK),hN)}function hq(e,t){return a6(d5(d3,hl.getSharedSecret(a8(e,hN),a8(t,hN)),void 0,void 0,hK),hN)}function hV(e){return a6(d3(a8(e,hN)),hN)}function hH(e){return a6(d3(a8(e,hD)),hN)}function hG(e){return a8(`${e}`,hM)}function hW(e){return Number(a6(e,hM))}function hJ(e){return e.replace(/\+/g,"-").replace(/\//g,"_").replace(/=/g,"")}function hZ(e){let t=e.replace(/-/g,"+").replace(/_/g,"/"),r=(4-t.length%4)%4;return t+"=".repeat(r)}function hY(e){let t=hG("u">typeof e.type?e.type:hj);if(hW(t)===hR&&typeof e.senderPublicKey>"u")throw Error("Missing sender public key for type 1 envelope");let r="u">typeof e.senderPublicKey?a8(e.senderPublicKey,hN):void 0,n="u">typeof e.iv?a8(e.iv,hN):uF(h$),i=h1({type:t,sealed:dZ(a8(e.symKey,hN),n).encrypt
18(a8(e.message,hD)),iv:n,senderPublicKey:r});return e.encoding===hC?hJ(i):i}function hX(e){let t=a8(e.symKey,hN),{sealed:r,iv:n}=h2({encoded:e.encoded,encoding:e.encoding}),i=dZ(t,n).decrypt(r);if(null===i)throw Error("Failed to decrypt");return a6(i,hD)}function hQ(e,t){let r=hG(hL),n=uF(h$),i=h1({type:r,sealed:a8(e,hD),iv:n});return t===hC?hJ(i):i}function h0(e,t){let{sealed:r}=h2({encoded:e,encoding:t});return a6(r,hD)}function h1(e){if(hW(e.type)===hL)return a6(sv([e.type,e.sealed]),hk);if(hW(e.type)===hR){if(typeof e.senderPublicKey>"u")throw Error("Missing sender public key for type 1 envelope");return a6(sv([e.type,e.senderPublicKey,e.iv,e.sealed]),hk)}return a6(sv([e.type,e.iv,e.sealed]),hk)}function h2(e){let t=a8((e.encoding||hk)===hC?hZ(e.encoded):e.encoded,hk),r=t.slice(hB,hU),n=hU;if(hW(r)===hR){let e=n+hK,i=e+h$,o=t.slice(n,e),s=t.slice(e,i);return{type:r,sealed:t.slice(i),iv:s,senderPublicKey:o}}if(hW(r)===hL)return{type:r,sealed:t.slice(n),iv:uF(h$)};let i=n+h$,o=t.slice(n,i);return{type:r,sealed:t.slice(i),iv:o}}function h5(e,t){let r=h2({encoded:e,encoding:t?.encoding});return h3({type:hW(r.type),senderPublicKey:"u">typeof r.senderPublicKey?a6(r.senderPublicKey,hN):void 0,receiverPublicKey:t?.receiverPublicKey})}function h3(e){let t=e?.type||hj;if(t===hR){if(typeof e?.senderPublicKey>"u")throw Error("missing sender public key");if(typeof e?.receiverPublicKey>"u")throw Error("missing receiver public key")}return{type:t,senderPublicKey:e?.senderPublicKey,receiverPublicKey:e?.receiverPublicKey}}
18function h8(e){return e.type===hR&&"string"==typeof e.senderPublicKey&&"string"==typeof e.receiverPublicKey}function h6(e){return e.type===hL}function h4(e){let t=cn.from(e.x,"base64"),r=cn.from(e.y,"base64");return sv([new Uint8Array([4]),t,r])}function h9(e,t){let[r,n,i]=e.split("."),o=cn.from(hZ(i),"base64");if(64!==o.length)throw Error("Invalid signature length");let s=o.slice(0,32),a=o.slice(32,64),c=d3(`${r}.${n}`),u=h4(t);if(!hP.verify(sv([s,a]),c,u))throw Error("Invalid signature");return ig(e).payload}let h7="irn";function pe(e){return e?.relay||{protocol:h7}}function pt(e){let t=ce[e];if(typeof t>"u")throw Error(`Relay Protocol not supported: ${e}`);return t}function pr(e,t="-"){let r={},n="relay"+t;return Object.keys(e).forEach(t=>{if(t.startsWith(n)){let i=t.replace(n,""),o=e[t];r[i]=o}}),r}function pn(e){if(!e.includes("wc:")){let t=c8(e);null!=t&&t.includes("wc:")&&(e=t)}let t=(e=(e=e.includes("wc://")?e.replace("wc://",""):e).includes("wc:")?e.replace("wc:",""):e).indexOf(":"),r=-1!==e.indexOf("?")?e.indexOf("?"):void 0,n=e.substring(0,t),i=e.substring(t+1,r).split("@"),o=new URLSearchParams("u">typeof r?e.substring(r):""),s={};o.forEach((e,t)=>{s[t]=e});let a="string"==typeof s.methods?s.methods.split(","):void 0;return{protocol:n,topic:pi(i[0]),version:parseInt(i[1],10),symKey:s.symKey,relay:pr(s),methods:a,expiryTimestamp:s.expiryTimestamp?parseInt(s.expiryTimestamp,10):void 0}}function pi(e){return e.startsWith("//")?e.substring(2):e}function po(e,t="-"){let r="relay",n={};return Object.keys(e).forEach(i=>{let o=i,s=r+t+o;e[o]&&(n[s]=e[o])}),n}function ps(e){let t=new URLSearchParams,r=po(e.relay);Object.keys(r).sort().forEach(e=>{t.set(e,r[e])}),t.set("symKey",e.symKey),e.expiryTimestamp&&t.set("expiryTimestamp",e.expiryTimestamp.toString()),e.methods&&t.set("methods",e.methods.join(","));let n=t.toString();return`${e.protocol}:${e.topic}@${e.version}?${n}`}function pa(e,t,r){return`${e}?wc_ev=${r}&topic=${t}`}var pc=Object.defineProperty,pu=Object.defineProperties,pl=Object.getOwnPropertyDescriptors,pd=Object.getOwnPropertySymbols,pf=Object.prototype.hasOwnProperty,ph=Object.prototype.propertyIsEnumerable,pp=(e,t,r)=>t in e?pc(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,py=(e,t)=>{for(var r in t||(t={}))pf.call(t,r)&&pp(e,r,t[r]);if(pd)for(var r of pd(t))ph.call(t,r)&&pp(e,r,t[r]);return e},pg=(e,t)=>
18pu(e,pl(t));function pm(e){let t=[];return e.forEach(e=>{let[r,n]=e.split(":");t.push(`${r}:${n}`)}),t}function pb(e){let t=[];return Object.values(e).forEach(e=>{t.push(...pm(e.accounts))}),t}function pv(e,t){let r=[];return Object.values(e).forEach(e=>{pm(e.accounts).includes(t)&&r.push(...e.methods)}),r}function pw(e,t){let r=[];return Object.values(e).forEach(e=>{pm(e.accounts).includes(t)&&r.push(...e.events)}),r}function p_(e){return e.includes(":")}function pE(e){return p_(e)?e.split(":")[0]:e}function pS(e){var t,r,n;let i={};if(!pk(e))return i;for(let[o,s]of Object.entries(e)){let e=p_(o)?[o]:s.chains,a=s.methods||[],c=s.events||[],u=pE(o);i[u]=pg(py({},i[u]),{chains:cW(e,null==(t=i[u])?void 0:t.chains),methods:cW(a,null==(r=i[u])?void 0:r.methods),events:cW(c,null==(n=i[u])?void 0:n.events)})}return i}function px(e){let t={};return e?.forEach(e=>{var r;let[n,i]=e.split(":");t[n]||(t[n]={accounts:[],chains:[],events:[],methods:[]}),t[n].accounts.push(e),null==(r=t[n].chains)||r.push(`${n}:${i}`)}),t}function pA(e,t){let r=px(t=t.map(e=>e.replace("did:pkh:","")));for(let[t,n]of Object.entries(r))n.methods?n.methods=cW(n.methods,e):n.methods=e,n.events=["chainChanged","accountsChanged"];return r}function pI(e,t){var r,n,i,o,s,a;let c=pS(e),u=pS(t),l={};for(let e of Object.keys(c).concat(Object.keys(u)))l[e]={chains:cW(null==(r=c[e])?void 0:r.chains,null==(n=u[e])?void 0:n.chains),methods:cW(null==(i=c[e])?void 0:i.methods,null==(o=u[e])?void 0:o.methods),events:cW(null==(s=c[e])?void 0:s.events,null==(a=u[e])?void 0:a.events)};return l}let pO={INVALID_METHOD:{message:"Invalid method.",code:1001},INVALID_EVENT:{message:"Invalid event.",code:1002},INVALID_UPDATE_REQUEST:{message:"Invalid update request.",code:1003},INVALID_EXTEND_REQUEST:{message:"Invalid extend request.",code:1004},INVALID_SESSION_SETTLE_REQUEST:{message:"Invalid session settle request.",code:1005},UNAUTHORIZED_METHOD:{message:"Unauthorized method.",code:3001},UNAUTHORIZED_EVENT:{message:"Unauthorized event.",code:3002},UNAUTHORIZED_UPDATE_REQUEST:{message:"Unauthorized update request.",code:3003},UNAUTHORIZED_EXTEND_REQUEST:{message:"Unauthorized extend request.",code:3004},USER_REJECTED:{message:"User rejected.",code:5e3},USER_REJECTED_CHAINS:{message:"User rejected chains.",code:5001},USER_REJECTED_METHODS:{message:"User rejected methods.",code:5002},USER_REJECTED_EVENTS:{message:"User rejected events.",code:5003},UNSUPPORTED_CHAINS:{message:"Unsupported chains.",code:5100},UNSUPPORTED_METHODS:{message:"Unsupported methods.",code:5101},UNSUPPORTED_EVENTS:{message:"Unsupported events.",code:5102},UNSUPPORTED_ACCOUNTS:{message:"Unsupported accounts.",code:5103},UNSUPPORTED_NAMESPACE_KEY:{message:"Unsupported namespace key.",code:5104},USER_DISCONNECTED:{message:"User disconnected.",code:6e3},SESSION_SETTLEMENT_FAILED:{message:"Session settlement failed.",code:7e3},WC_METHOD_UNSUPPORTED:{message:"Unsupported wc_ method.",code:10001}},pT={NOT_INITIALIZED:{message:"Not initialized.",code:1},NO_MATCHING_KEY:{message:"No matching key.",code:2},RESTORE_WILL_OVERRIDE:{message:"Restore will override.",code:3},RESUBSCRIBED:{message:"Resubscribed.",code:4},MISSING_OR_INVALID:{message:"Missing or invalid.",code:5},EXPIRED:{message:"Expired.",code:6},UNKNOWN_TYPE:{message:"Unknown type.",code:7},MISMATCHED_TOPIC:{message:"Mismatched topic.",code:8},NON_CONFORMING_NAMESPACES:{message:"Non conforming namespaces.",code:9}};function pP(e,t){let{message:r,code:n}=pT[e];return{message:t?`${r} ${t}`:r,code:n}}function pM(e,t){let{message:r,code:n}=pO[e];return{message:t?`${r} ${t}`:r,code:n}}function pN(e,t){return!!Array.isArray(e)&&(!("u">typeof t)||!e.length||e.every(t))}function pk(e){return Object.getPrototypeOf(e)===Object.prototype&&Object.keys(e).length}function pC(e){return typeof e>"u"}function pD(e,t){return!!(t&&pC(e))||"string"==typeof e&&!!e.trim().length}function pj(e,t){return!!(t&&pC(e))||"number"==typeof e&&!isNaN(e)}function pR(e,t){let{requiredNamespaces:r}=t,n=Object.keys(e.namespaces),i=Object.keys(r),o=!0;return!!cR(i,n)&&(n.forEach(t=>{let{accounts:n,methods:i,events:s}=e.namespaces[t],a=pm(n),c=r[t];cR(cc(t,c),a)&&cR(c.methods,i)&&cR(c.events,s)||(o=!1)}),o)}function pL(e){return!!(pD(e,!1)&&e.includes(":"))&&2===e.split(":").length}function pB(e){if(pD(e,!1)&&e.includes(":")){let t=e.split(":");if(3===t.length){let e=t[0]+":"+t[1];return!!t[2]&&pL(e)}}return!1}function pU(e){function t(e){try{return"u">typeof new URL(e)}catch{return!1}}try{if(pD(e,!1)){if(t(e))return!0;let r=c8(e);return t(r)}}catch{}return!1}function p$(e){var t;return null==(t=e?.proposer)?void 0:t.publicKey}
18function pK(e){return e?.topic}function pF(e,t){let r=null;return pD(e?.publicKey,!1)||(r=pP("MISSING_OR_INVALID",`${t} controller public key should be a string`)),r}function pz(e){let t=!0;return pN(e)?e.length&&(t=e.every(e=>pD(e,!1))):t=!1,t}function pq(e,t,r){let n=null;return pN(t)&&t.length?t.forEach(e=>{n||pL(e)||(n=pM("UNSUPPORTED_CHAINS",`${r}, chain ${e} should be a string and conform to "namespace:chainId" format`))}):pL(e)||(n=pM("UNSUPPORTED_CHAINS",`${r}, chains must be defined as "namespace:chainId" e.g. "eip155:1": {...} in the namespace key OR as an array of CAIP-2 chainIds e.g. eip155: { chains: ["eip155:1", "eip155:5"] }`)),n}function pV(e,t,r){let n=null;return Object.entries(e).forEach(([e,i])=>{if(n)return;let o=pq(e,cc(e,i),`${t} ${r}`);o&&(n=o)}),n}function pH(e,t){let r=null;return pN(e)?e.forEach(e=>{r||pB(e)||(r=pM("UNSUPPORTED_ACCOUNTS",`${t}, account ${e} should be a string and conform to "namespace:chainId:address" format`))}):r=pM("UNSUPPORTED_ACCOUNTS",`${t}, accounts should be an array of strings conforming to "namespace:chainId:address" format`),r}function pG(e,t){let r=null;return Object.values(e).forEach(e=>{if(r)return;let n=pH(e?.accounts,`${t} namespace`);n&&(r=n)}),r}function pW(e,t){let r=null;return pz(e?.methods)?pz(e?.events)||(r=pM("UNSUPPORTED_EVENTS",`${t}, events should be an array of strings or empty array for no events`)):r=pM("UNSUPPORTED_METHODS",`${t}, methods should be an array of strings or empty array for no methods`),r}function pJ(e,t){let r=null;return Object.values(e).forEach(e=>{if(r)return;let n=pW(e,`${t}, namespace`);n&&(r=n)}),r}function pZ(e,t,r){let n=null;if(e&&pk(e)){let i=pJ(e,t);i&&(n=i);let o=pV(e,t,r);o&&(n=o)}else n=pP("MISSING_OR_INVALID",`${t}, ${r} should be an object with data`);return n}function pY(e,t){let r=null;if(e&&pk(e)){let n=pJ(e,t);n&&(r=n);let i=pG(e,t);i&&(r=i)}else r=pP("MISSING_OR_INVALID",`${t}, namespaces should be an object with data`);return r}function pX(e){return pD(e.protocol,!0)}function pQ(e,t){let r=!1;return t&&!e?r=!0:e&&pN(e)&&e.length&&e.forEach(e=>{r=pX(e)}),r}function p0(e){return"number"==typeof e}function p1(e){return"u">typeof e}function p2(e){return!(!e||"object"!=typeof e||!e.code||!pj(e.code,!1)||!e.message||!pD(e.message,!1))}function p5(e){return!(pC(e)||!pD(e.method,!1))}function p3(e){return!(pC(e)||pC(e.result)&&pC(e.error)||!pj(e.id,!1)||!pD(e.jsonrpc,!1))}function p8(e){return!(pC(e)||!pD(e.name,!1))}function p6(e,t){return!(!pL(t)||!pb(e).includes(t))}function p4(e,t,r){return!!pD(r,!1)&&pv(e,t).includes(r)}function p9(e,t,r){return!!pD(r,!1)&&pw(e,t).includes(r)}function p7(e,t,r){let n=null,i=ye(e),o=yr(t),s=Object.keys(i),a=Object.keys(o),c=yt(Object.keys(e)),u=yt(Object.keys(t)),l=c.filter(e=>!u.includes(e));return l.length&&(n=pP("NON_CONFORMING_NAMESPACES",`${r} namespaces keys don't satisfy requiredNamespaces. 19 Required: ${l.toString()} 20 Received: ${Object.keys(t).toString()}`)),cR(s,a)||(n=pP("NON_CONFORMING_NAMESPACES",`${r} namespaces chains don't satisfy required namespaces. 21 Required: ${s.toString()} 22 Approved: ${a.toString()}`)),Object.keys(t).forEach(e=>{if(!e.includes(":")||n)return;let i=pm(t[e].accounts);i.includes(e)||(n=pP("NON_CONFORMING_NAMESPACES",`${r} namespaces accounts don't satisfy namespace accounts for ${e} 23 Required: ${e} 24 Approved: ${i.toString()}`))}),s.forEach(e=>{n||(cR(i[e].methods,o[e].methods)?cR(i[e].events,o[e].events)||(n=pP("NON_CONFORMING_NAMESPACES",`${r} namespaces events don't satisfy namespace events for ${e}`)):n=pP("NON_CONFORMING_NAMESPACES",`${r} namespaces methods don't satisfy namespace methods for ${e}`))}),n}function ye(e){let t={};return Object.keys(e).forEach(r=>{var n;r.includes(":")?t[r]=e[r]:null==(n=e[r].chains)||n.forEach(n=>{t[n]={methods:e[r].methods,events:e[r].events}})}),t}function yt(e){return[...new Set(e.map(e=>e.includes(":")?e.split(":")[0]:e))]}function yr(e){let t={};return Object.keys(e).forEach(r=>{if(r.includes(":"))t[r]=e[r];else{let n=pm(e[r].accounts);n?.forEach(n=>{t[n]={accounts:e[r].accounts.filter(e=>e.includes(`${n}:`)),methods:e[r].methods,events:e[r].events}})}}),t}function yn(e,t){return pj(e,!1)&&e<=t.max&&e>=t.min}function yi(){let e=cO();return new Promise(t=>{switch(e){case cv.browser:t(yo());break;case cv.reactNative:t(ys());break;case cv.node:t(ya());break;default:t(!0)}})}function yo(){return cI()&&navigator?.onLine}async function ys(){if(cS()&&"u">typeof r.g&&null!=r.g&&r.g.NetInfo){let e=await (null==r.g?void 0:r.g.NetInfo.fetch());return e?.isConnected}return!0}function ya(){return!0}function yc(e){switch(cO()){case cv.browser:yu(e);break;case cv.reactNative:yl(e);case cv.node:}}function yu(e){!cS()&&cI()&&(window.addEventListener("online",()=>e(!0)),window.addEventListener("offline",()=>e(!1)))}function yl(e){cS()&&"u">typeof r.g&&null!=r.g&&r.g.NetInfo&&r.g?.NetInfo.addEventListener(t=>e(t?.isConnected))}function yd(){var e;
24return!(cI()&&(0,iR.getDocument)())||(null==(e=(0,iR.getDocument)())?void 0:e.visibilityState)==="visible"}let yf={};class yh{static get(e){return yf[e]}static set(e,t){yf[e]=t}static delete(e){delete yf[e]}}function yp(e){let t=oN.decode(e);if(t.length<33)throw Error("Too short to contain a public key");return t.slice(1,33)}function yy({publicKey:e,signature:t,payload:r}){var n;let i=ym(r.method),o=128|parseInt((null==(n=r.version)?void 0:n.toString())||"4"),s=yv(r.address),a="00"===r.era?new Uint8Array([0]):ym(r.era);if(1!==a.length&&2!==a.length)throw Error("Invalid era length");let c=parseInt(r.nonce,16),u=new Uint8Array([255&c,c>>8&255]),l=new Uint8Array([0,...e,s,...t,...a,...u,...y_(BigInt(`0x${yb(r.tip)}`)),...i]);return new Uint8Array([...yw(l.length+1),o,...l])}function yg(e){let t=ym(e),r=(0,ct.blake2b)(t,void 0,32);return"0x"+cn.from(r).toString("hex")}function ym(e){return new Uint8Array(e.replace(/^0x/,"").match(/.{1,2}/g).map(e=>parseInt(e,16)))}function yb(e){return e.startsWith("0x")?e.slice(2):e}function yv(e){let t=oN.decode(e)[0];return 42===t?0:60===t?2:1}function yw(e){if(e<64)return new Uint8Array([e<<2]);if(e<16384){let t=e<<2|1;return new Uint8Array([255&t,t>>8&255])}if(e<0x40000000){let t=e<<2|2;return new Uint8Array([255&t,t>>8&255,t>>16&255,t>>24&255])}throw Error("Compact encoding > 2^30 not supported")}function y_(e){if(e<BigInt(1)<<BigInt(6))return new Uint8Array([Number(e<<BigInt(2))]);if(e<BigInt(1)<<BigInt(14)){let t=e<<BigInt(2)|BigInt(1);return new Uint8Array([Number(t&BigInt(255)),Number(t>>BigInt(8)&BigInt(255))])}if(e<BigInt(1)<<BigInt(30)){let t=e<<BigInt(2)|BigInt(2);return new Uint8Array([Number(t&BigInt(255)),Number(t>>BigInt(8)&BigInt(255)),Number(t>>BigInt(16)&BigInt(255)),Number(t>>BigInt(24)&BigInt(255))])}throw Error("BigInt compact encoding not supported > 2^30")}function yE(e){let t=Uint8Array.from(cn.from(e.signature,"hex")),r=yy({publicKey:yp(e.transaction.address),signature:t,payload:e.transaction});return yg(cn.from(r).toString("hex"))}let yS="INTERNAL_ERROR",yx="SERVER_ERROR",yA=[-32700,-32600,-32601,-32602,-32603],yI={PARSE_ERROR:{code:-32700,message:"Parse error"},INVALID_REQUEST:{code:-32600,message:"Invalid Request"},METHOD_NOT_FOUND:{code:-32601,message:"Method not found"},INVALID_PARAMS:{code:-32602,message:"Invalid params"},[yS]:{code:-32603,message:"Internal error"},[yx]:{code:-32e3,message:"Server error"}},yO=yx;function yT(e){return yA.includes(e)}function yP(e){return Object.keys(yI).includes(e)?yI[e]:yI[yO]}function yM(e){return Object.values(yI).find(t=>t.code===e)||yI[yO]}function yN(e,t,r){return e.message.includes("getaddrinfo ENOTFOUND")||e.message.includes("connect ECONNREFUSED")?Error(`Unavailable ${r} RPC url at ${t}`):e}var yk=r(24144);
24function yC(e=3){return Date.now()*Math.pow(10,e)+Math.floor(Math.random()*Math.pow(10,e))}function yD(e=6){return BigInt(yC(e))}function yj(e,t,r){return{id:r||yC(),jsonrpc:"2.0",method:e,params:t}}function yR(e,t){return{id:e,jsonrpc:"2.0",result:t}}function yL(e,t,r){return{id:e,jsonrpc:"2.0",error:yB(t,r)}}function yB(e,t){return void 0===e?yP(yS):("string"==typeof e&&(e=Object.assign(Object.assign({},yP(yx)),{message:e})),void 0!==t&&(e.data=t),yT(e.code)&&(e=yM(e.code)),e)}class yU{}class y$ extends yU{constructor(){super()}}class yK extends y${constructor(e){super()}}let yF="^wss?:";function yz(e){let t=e.match(RegExp(/^\w+:/,"gi"));if(t&&t.length)return t[0]}function yq(e,t){let r=yz(e);return void 0!==r&&new RegExp(t).test(r)}function yV(e){return yq(e,yF)}function yH(e){return RegExp("wss?://localhost(:d{2,5})?").test(e)}function yG(e){return"object"==typeof e&&"id"in e&&"jsonrpc"in e&&"2.0"===e.jsonrpc}function yW(e){return yG(e)&&"method"in e}function yJ(e){return yG(e)&&(yZ(e)||yY(e))}function yZ(e){return"result"in e}function yY(e){return"error"in e}class yX extends yK{constructor(e){super(e),this.events=new x.EventEmitter,this.hasRegisteredEventListeners=!1,this.connection=this.setConnection(e),this.connection.connected&&this.registerEventListeners()}async connect(e=this.connection){await this.open(e)}async disconnect(){await this.close()}on(e,t){this.events.on(e,t)}once(e,t){this.events.once(e,t)}off(e,t){this.events.off(e,t)}removeListener(e,t){this.events.removeListener(e,t)}async request(e,t){return this.requestStrict(yj(e.method,e.params||[],e.id||yD().toString()),t)}async requestStrict(e,t){return new Promise(async(r,n)=>{if(!this.connection.connected)try{await this.open()}catch(e){n(e)}this.events.on(`${e.id}`,e=>{yY(e)?n(e.error):r(e.result)});try{await this.connection.send(e,t)}catch(e){n(e)}})}setConnection(e=this.connection){return e}onPayload(e){this.events.emit("payload",e),yJ(e)?this.events.emit(`${e.id}`,e):this.events.emit("message",{type:e.method,data:e.params})}onClose(e){e&&3e3===e.code&&this.events.emit("error",Error(`WebSocket connection closed abnormally with code: ${e.code} ${e.reason?`(${e.reason})`:""}`)),this.events.emit("disconnect")}async open(e=this.connection){this.connection===e&&this.connection.connected||(this.connection.connected&&this.close(),"string"==typeof e&&(await this.connection.open(e),e=this.connection),this.connection=this.setConnection(e),await this.connection.open(),this.registerEventListeners(),this.events.emit("connect"))}async close(){await this.connection.close()}registerEventListeners(){this.hasRegisteredEventListeners||(this.connection.on("payload",e=>this.onPayload(e)),this.connection.on("close",e=>this.onClose(e)),this.connection.on("error",e=>this.events.emit("error",e)),this.connection.on("register_error",e=>this.onClose()),this.hasRegisteredEventListeners=!0)}}let yQ=()=>"u">typeof WebSocket||"u">typeof r.g&&"u">typeof r.g.WebSocket||"u">typeof window&&"u">typeof window.WebSocket||"u">typeof self&&"u">typeof self.WebSocket,y0=e=>e.split("?")[0],y1=10,y2="u">typeof WebSocket?WebSocket:"u">typeof r.g&&"u">typeof r.g.WebSocket?r.g.WebSocket:"u">typeof window&&"u">typeof window.WebSocket?window.WebSocket:"u">typeof self&&"u">typeof self.WebSocket?self.WebSocket:r(66735);class y5{constructor(e){if(this.url=e,this.events=new x.EventEmitter,this.registering=!1,!yV(e))throw Error(`Provided URL is not compatible with WebSocket connection: ${e}`);this.url=e}get connected(){return"u">typeof this.socket}get connecting(){return this.registering}on(e,t){this.events.on(e,t)}once(e,t){this.events.once(e,t)}off(e,t){this.events.off(e,t)}removeListener(e,t){this.events.removeListener(e,t)}async open(e=this.url){await this.register(e)}async close(){return new Promise((e,t)=>{if(typeof this.socket>"u"){t(Error("Connection already closed"));return}this.socket.onclose=t=>{this.onClose(t),e()},this.socket.close()})}async send(e){typeof this.socket>"u"&&(this.socket=await this.register());try{this.socket.send(em(e))}catch(t){this.onError(e.id,t)}}register(e=this.url){if(!yV(e))throw Error(`Provided URL is not compatible with WebSocket connection: ${e}`);if(this.registering){let e=this.events.getMaxListeners();return(this.events.listenerCount("register_error")>=e||this.events.listenerCount("open")>=e)&&this.events.setMaxListeners(e+1),new Promise((e,t)=>
24{this.events.once("register_error",e=>{this.resetMaxListeners(),t(e)}),this.events.once("open",()=>{if(this.resetMaxListeners(),typeof this.socket>"u")return t(Error("WebSocket connection is missing or invalid"));e(this.socket)})})}return this.url=e,this.registering=!0,new Promise((t,r)=>{let n=(0,yk.isReactNative)()?void 0:{rejectUnauthorized:!yH(e)},i=new y2(e,[],n);yQ()?i.onerror=e=>{let t=e;r(this.emitError(t.error))}:i.on("error",e=>{r(this.emitError(e))}),i.onopen=()=>{this.onOpen(i),t(i)}})}onOpen(e){e.onmessage=e=>this.onPayload(e),e.onclose=e=>this.onClose(e),this.socket=e,this.registering=!1,this.events.emit("open")}onClose(e){this.socket=void 0,this.registering=!1,this.events.emit("close",e)}onPayload(e){if(typeof e.data>"u")return;let t="string"==typeof e.data?eg(e.data):e.data;this.events.emit("payload",t)}onError(e,t){let r=this.parseError(t),n=yL(e,r.message||r.toString());this.events.emit("payload",n)}parseError(e,t=this.url){return yN(e,y0(t),"WS")}resetMaxListeners(){this.events.getMaxListeners()>y1&&this.events.setMaxListeners(y1)}emitError(e){let t=this.parseError(Error(e?.message||`WebSocket connection failed for host: ${y0(this.url)}`));return this.events.emit("register_error",t),t}}var y3=r(75927).Buffer,y8=r(2818);let y6="wc",y4=2,y9="core",y7=`${y6}@2:${y9}:`,ge={logger:"error"},gt={database:":memory:"},gr="crypto",gn="client_ed25519_seed",gi=I.ONE_DAY,go="keychain",gs="0.3",ga="messages",gc="0.3",gu=I.SIX_HOURS,gl="publisher",gd="irn",gf="error",gh="wss://relay.walletconnect.org",gp="relayer",gy={message:"relayer_message",message_ack:"relayer_message_ack",connect:"relayer_connect",disconnect:"relayer_disconnect",error:"relayer_error",connection_stalled:"relayer_connection_stalled",publish:"relayer_publish"},gg="_subscription",gm={payload:"payload",connect:"connect",disconnect:"disconnect",error:"error"},gb=.1,gv="2.21.2",gw={link_mode:"link_mode",relay:"relay"},g_={inbound:"inbound",outbound:"outbound"},gE="0.3",gS="WALLETCONNECT_CLIENT_ID",gx="WALLETCONNECT_LINK_MODE_APPS",gA={created:"subscription_created",deleted:"subscription_deleted",sync:"subscription_sync",resubscribed:"subscription_resubscribed"},gI="subscription",gO="0.3",gT=(I.FIVE_SECONDS,"pairing"),gP="0.3",gM={wc_pairingDelete:{req:{ttl:I.ONE_DAY,prompt:!1,tag:1e3},res:{ttl:I.ONE_DAY,prompt:!1,tag:1001}},wc_pairingPing:{req:{ttl:I.THIRTY_SECONDS,prompt:!1,tag:1002},res:{ttl:I.THIRTY_SECONDS,prompt:!1,tag:1003}},unregistered_method:{req:{ttl:I.ONE_DAY,prompt:!1,tag:0},res:{ttl:I.ONE_DAY,prompt:!1,tag:0}}},gN={create:"pairing_create",expire:"pairing_expire",delete:"pairing_delete",ping:"pairing_ping"},gk={created:"history_created",updated:"history_updated",deleted:"history_deleted",sync:"history_sync"},gC="history",gD="0.3",gj="expirer",gR={created:"expirer_created",deleted:"expirer_deleted",expired:"expirer_expired",sync:"expirer_sync"},gL="0.3",gB="verify-api",gU="https://verify.walletconnect.org",g$=gU,gK=`${g$}/v3`,gF=["https://verify.walletconnect.com",gU],gz="echo",gq="https://echo.walletconnect.com",gV={pairing_started:"pairing_started",pairing_uri_validation_success:"pairing_uri_validation_success",pairing_uri_not_expired:"pairing_uri_not_expired",store_new_pairing:"store_new_pairing",subscribing_pairing_topic:"subscribing_pairing_topic",subscribe_pairing_topic_success:"subscribe_pairing_topic_success",existing_pairing:"existing_pairing",pairing_not_expired:"pairing_not_expired",emit_inactive_pairing:"emit_inactive_pairing",emit_session_proposal:"emit_session_proposal"},gH={no_internet_connection:"no_internet_connection",malformed_pairing_uri:"malformed_pairing_uri",active_pairing_already_exists:"active_pairing_already_exists",subscribe_pairing_topic_failure:"subscribe_pairing_topic_failure",pairing_expired:"pairing_expired",proposal_listener_not_found:"proposal_listener_not_found"},gG={session_approve_started:"session_approve_started",session_namespaces_validation_success:"session_namespaces_validation_success",subscribing_session_topic:"subscribing_session_topic",subscribe_session_topic_success:"subscribe_session_topic_success",publishing_session_approve:"publishing_session_approve",session_approve_publish_success:"session_approve_publish_success",store_session:"store_session",publishing_session_settle:"publishing_session_settle",session_settle_publish_success:"session_settle_publish_success"},gW={no_internet_connection:"no_internet_connection",proposal_expired:"proposal_expired",subscribe_session_topic_failure:"subscribe_session_topic_failure",session_approve_publish_failure:"session_approve_publish_failure",session_settle_publish_failure:"session_settle_publish_failure",session_approve_namespace_validation_failure:"session_approve_namespace_validation_failure",proposal_not_found:"proposal_not_found"},gJ={authenticated_session_approve_started:"authenticated_session_approve_started",create_authenticated_session_topic:"create_authenticated_session_topic",cacaos_verified:"cacaos_verified",store_authenticated_session:"store_authenticated_session",subscribing_authenticated_session_topic:"subscribing_authenticated_session_topic",subscribe_authenticated_session_topic_success:"subscribe_authenticated_session_topic_success",publishing_authenticated_session_approve:"publishing_authenticated_session_approve"}
24,gZ={no_internet_connection:"no_internet_connection",invalid_cacao:"invalid_cacao",subscribe_authenticated_session_topic_failure:"subscribe_authenticated_session_topic_failure",authenticated_session_approve_publish_failure:"authenticated_session_approve_publish_failure",authenticated_session_pending_request_not_found:"authenticated_session_pending_request_not_found"},gY=.1,gX="event-client",gQ=86400,g0="https://pulse.walletconnect.org/batch";var g1=function(e,t){if(e.length>=255)throw TypeError("Alphabet too long");for(var r=new Uint8Array(256),n=0;n<r.length;n++)r[n]=255;for(var i=0;i<e.length;i++){var o=e.charAt(i),s=o.charCodeAt(0);if(255!==r[s])throw TypeError(o+" is ambiguous");r[s]=i}var a=e.length,c=e.charAt(0),u=Math.log(a)/Math.log(256),l=Math.log(256)/Math.log(a);function d(e){if("string"!=typeof e)throw TypeError("Expected String");if(0===e.length)return new Uint8Array;var t=0;if(" "!==e[0]){for(var n=0,i=0;e[t]===c;)n++,t++;for(var o=(e.length-t)*u+1>>>0,s=new Uint8Array(o);e[t];){var l=r[e.charCodeAt(t)];if(255===l)return;for(var d=0,f=o-1;(0!==l||d<i)&&-1!==f;f--,d++)l+=a*s[f]>>>0,s[f]=l%256>>>0,l=l/256>>>0;if(0!==l)throw Error("Non-zero carry");i=d,t++}if(" "!==e[t]){for(var h=o-i;h!==o&&0===s[h];)h++;for(var p=new Uint8Array(n+(o-h)),y=n;h!==o;)p[y++]=s[h++];return p}}}function f(e){var r=d(e);if(r)return r;throw Error(`Non-${t} character`)}return{encode:function(t){if(t instanceof Uint8Array||(ArrayBuffer.isView(t)?t=new Uint8Array(t.buffer,t.byteOffset,t.byteLength):Array.isArray(t)&&(t=Uint8Array.from(t))),!(t instanceof Uint8Array))throw TypeError("Expected Uint8Array");if(0===t.length)return"";for(var r=0,n=0,i=0,o=t.length;i!==o&&0===t[i];)i++,r++;for(var s=(o-i)*l+1>>>0,u=new Uint8Array(s);i!==o;){for(var d=t[i],f=0,h=s-1;(0!==d||f<n)&&-1!==h;h--,f++)d+=256*u[h]>>>0,u[h]=d%a>>>0,d=d/a>>>0;if(0!==d)throw Error("Non-zero carry");n=f,i++}for(var p=s-n;p!==s&&0===u[p];)p++;for(var y=c.repeat(r);p<s;++p)y+=e.charAt(u[p]);return y},decodeUnsafe:d,decode:f}};let g2=e=>{if(e instanceof Uint8Array&&"Uint8Array"===e.constructor.name)return e;if(e instanceof ArrayBuffer)return new Uint8Array(e);if(ArrayBuffer.isView(e))return new Uint8Array(e.buffer,e.byteOffset,e.byteLength);throw Error("Unknown type, must be binary type")},g5=e=>new TextEncoder().encode(e),g3=e=>new TextDecoder().decode(e);class g8{constructor(e,t,r){this.name=e,this.prefix=t,this.baseEncode=r}encode(e){if(e instanceof Uint8Array)return`${this.prefix}${this.baseEncode(e)}`;throw Error("Unknown type, must be binary type")}}class g6{constructor(e,t,r){if(this.name=e,this.prefix=t,void 0===t.codePointAt(0))throw Error("Invalid prefix character");this.prefixCodePoint=t.codePointAt(0),this.baseDecode=r}decode(e){if("string"==typeof e){if(e.codePointAt(0)!==this.prefixCodePoint)throw Error(`Unable to decode multibase string ${JSON.stringify(e)}, ${this.name} decoder only supports inputs prefixed with ${this.prefix}`);return this.baseDecode(e.slice(this.prefix.length))}throw Error("Can only multibase decode strings")}or(e){return g9(this,e)}}class g4{constructor(e){this.decoders=e}or(e){return g9(this,e)}decode(e){let t=e[0],r=this.decoders[t];if(r)return r.decode(e);throw RangeError(`Unable to decode multibase string ${JSON.stringify(e)}, only inputs prefixed with ${Object.keys(this.decoders)} are supported`)}}let g9=(e,t)=>new g4({...e.decoders||{[e.prefix]:e},...t.decoders||{[t.prefix]:t}});class g7{constructor(e,t,r,n){this.name=e,this.prefix=t,this.baseEncode=r,this.baseDecode=n,this.encoder=new g8(e,t,r),this.decoder=new g6(e,t,n)}encode(e){return this.encoder.encode(e)}decode(e){return this.decoder.decode(e)}}let me=({name:e,prefix:t,encode:r,decode:n})=>new g7(e,t,r,n),mt=({prefix:e,name:t,alphabet:r})=>{let{encode:n,decode:i}=g1(r,t);return me({prefix:e,name:t,encode:n,decode:e=>g2(i(e))})},mr=(e,t,r,n)=>{let i={};for(let e=0;e<t.length;++e)i[t[e]]=e;let o=e.length;for(;"="===e[o-1];)--o;let s=new Uint8Array(o*r/8|0),a=0,c=0,u=0;for(let t=0;t<o;++t){let o=i[e[t]];if(void 0===o)throw SyntaxError(`Non-${n} character`);c=c<<r|o,(a+=r)>=8&&(a-=8,s[u++]=255&c>>a)}if(a>=r||255&c<<8-a)throw SyntaxError("Unexpected end of data");return s},mn=(e,t,r)=>{let n="="===t[t.length-1],i=(1<<r)-1,o="",s=0,a=0;for(let n=0;n<e.length;++n)for(a=a<<8|e[n],s+=8;s>r;)s-=r,o+=t[i&a>>s];if(s&&(o+=t[i&a<<r-s]),n)for(;o.length*r&7;)o+="=";return o},mi=({name:e,prefix:t,bitsPerChar:r,alphabet:n})=>me({prefix:t,name:e,encode:e=>mn(e,n,r),decode:t=>mr(t,n,r,e)});var mo=Object.freeze({__proto__:null,identity:me({prefix:"\0",name:"identity",encode:e=>g3(e),decode:e=>g5(e)})}),ms=Object.freeze({__proto__:null,base2:mi({prefix:"0",name:"base2",alphabet:"01",bitsPerChar:1})}),ma=Object.freeze({__proto__:null,base8:mi({prefix:"7",name:"base8",alphabet:"01234567",bitsPerChar:3})}),mc=Object.freeze({__proto__:null,base10:mt({prefix:"9",name:"base10",alphabet:"0123456789"})}),mu=Object.freeze({__proto__:null,base16:mi({prefix:"f",name:"base16",alphabet:"0123456789abcdef",bitsPerChar:4}),base16upper:mi({prefix:"F",name:"base16upper",alphabet:"0123456789ABCDEF",bitsPerChar:4})});let ml=mi({prefix:"b",name:"base32",alphabet:"abcdefghijklmnopqrstuvwxyz234567",bitsPerChar:5}),md=mi({prefix:"B",name:"base32upper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567",bitsPerChar:5}),mf=mi({prefix:"c",name:"base32pad",alphabet:"abcdefghijklmnopqrstuvwxyz234567=",bitsPerChar:5}),mh=mi({prefix:"C",name:"base32padupper",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567=",bitsPerChar:5}),mp=mi({prefix:"v",name:"base32hex",alphabet:"0123456789abcdefghijklmnopqrstuv",bitsPerChar:5}),my=mi({prefix:"V",name:"base32hexupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV",bitsPerChar:5});var mg=Object.freeze({__proto__:null,base32:ml,base32upper:md,base32pad:mf,base32padupper:mh,base32hex:mp,base32hexupper:my,base32hexpad:mi({prefix:"t",name:"base32hexpad",alphabet:"0123456789abcdefghijklmnopqrstuv=",bitsPerChar:5}),base32hexpadupper:mi({prefix:"T",name:"base32hexpadupper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUV=",bitsPerChar:5}),base32z:mi({prefix:"h",name:"base32z",alphabet:"ybndrfg8ejkmcpqxot1uwisza345h769",bitsPerChar:5})}),mm=Object.freeze({__proto__:null,base36:mt({prefix:"k",name:"base36",alphabet:"0123456789abcdefghijklmnopqrstuvwxyz"}),base36upper:mt({prefix:"K",name:"base36upper",alphabet:"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"})}),mb=Object.freeze({__proto__:null,base58btc:mt({name:"base58btc",prefix:"z",alphabet:"123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz"}),base58flickr:mt({name:"base58flickr",prefix:"Z",alphabet:"123456789abcdefghijkmnopqrstuvwxyzABCDEFGHJKLMNPQRSTUVWXYZ"})});let mv=mi({prefix:"m",name:"base64",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789
24+/",bitsPerChar:6});var mw=Object.freeze({__proto__:null,base64:mv,base64pad:mi({prefix:"M",name:"base64pad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",bitsPerChar:6}),base64url:mi({prefix:"u",name:"base64url",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_",bitsPerChar:6}),base64urlpad:mi({prefix:"U",name:"base64urlpad",alphabet:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_=",bitsPerChar:6})});let m_=Array.from("\uD83D\uDE80\uD83E\uDE90â\uD83D\uDEF0\uD83C\uDF0C\uD83C\uDF11\uD83C\uDF12\uD83C\uDF13\uD83C\uDF14\uD83C\uDF15\uD83C\uDF16\uD83C\uDF17\uD83C\uDF18\uD83C\uDF0D\uD83C\uDF0F\uD83C\uDF0E\uD83D\uDC09â\uD83D\uDCBB\uD83D\uDDA5\uD83D\uDCBE\uD83D\uDCBF\uD83D\uDE02â¤\uD83D\uDE0D\uD83E\uDD23\uD83D\uDE0A\uD83D\uDE4F\uD83D\uDC95\uD83D\uDE2D\uD83D\uDE18\uD83D\uDC4D\uD83D\uDE05\uD83D\uDC4F\uD83D\uDE01\uD83D\uDD25\uD83E\uDD70\uD83D\uDC94\uD83D\uDC96\uD83D\uDC99\uD83D\uDE22\uD83E\uDD14\uD83D\uDE06\uD83D\uDE44\uD83D\uDCAA\uD83D\uDE09âº\uD83D\uDC4C\uD83E\uDD17\uD83D\uDC9C\uD83D\uDE14\uD83D\uDE0E\uD83D\uDE07\uD83C\uDF39\uD83E\uDD26\uD83C\uDF89\uD83D\uDC9Eââ¨\uD83E\uDD37\uD83D\uDE31\uD83D\uDE0C\uD83C\uDF38\uD83D\uDE4C\uD83D\uDE0B\uD83D\uDC97\uD83D\uDC9A\uD83D\uDE0F\uD83D\uDC9B\uD83D\uDE42\uD83D\uDC93\uD83E\uDD29\uD83D\uDE04\uD83D\uDE00\uD83D\uDDA4\uD83D\uDE03\uD83D\uDCAF\uD83D\uDE48\uD83D\uDC47\uD83C\uDFB6\uD83D\uDE12\uD83E\uDD2Dâ£\uD83D\uDE1C\uD83D\uDC8B\uD83D\uDC40\uD83D\uDE2A\uD83D\uDE11\uD83D\uDCA5\uD83D\uDE4B\uD83D\uDE1E\uD83D\uDE29\uD83D\uDE21\uD83E\uDD2A\uD83D\uDC4A\uD83E\uDD73\uD83D\uDE25\uD83E\uDD24\uD83D\uDC49\uD83D\uDC83\uD83D\uDE33â\uD83D\uDE1A\uD83D\uDE1D\uD83D\uDE34\uD83C\uDF1F\uD83D\uDE2C\uD83D\uDE43\uD83C\uDF40\uD83C\uDF37\uD83D\uDE3B\uD83D\uDE13ââ
\uD83E\uDD7A\uD83C\uDF08\uD83D\uDE08\uD83E\uDD18\uD83D\uDCA6â\uD83D\uDE23\uD83C\uDFC3\uD83D\uDC90â¹\uD83C\uDF8A\uD83D\uDC98\uD83D\uDE20â\uD83D\uDE15\uD83C\uDF3A\uD83C\uDF82\uD83C\uDF3B\uD83D\uDE10\uD83D\uDD95\uD83D\uDC9D\uD83D\uDE4A\uD83D\uDE39\uD83D\uDDE3\uD83D\uDCAB\uD83D\uDC80\uD83D\uDC51\uD83C\uDFB5\uD83E\uDD1E\uD83D\uDE1B\uD83D\uDD34\uD83D\uDE24\uD83C\uDF3C\uD83D\uDE2Bâ½\uD83E\uDD19â\uD83C\uDFC6\uD83E\uDD2B\uD83D\uDC48\uD83D\uDE2E\uD83D\uDE46\uD83C\uDF7B\uD83C\uDF43\uD83D\uDC36\uD83D\uDC81\uD83D\uDE32\uD83C\uDF3F\uD83E\uDDE1\uD83C\uDF81â¡\uD83C\uDF1E\uD83C\uDF88ââ\uD83D\uDC4B\uD83D\uDE30\uD83E\uDD28\uD83D\uDE36\uD83E\uDD1D\uD83D\uDEB6\uD83D\uDCB0\uD83C\uDF53\uD83D\uDCA2\uD83E\uDD1F\uD83D\uDE41\uD83D\uDEA8\uD83D\uDCA8\uD83E\uDD2Câ\uD83C\uDF80\uD83C\uDF7A\uD83E\uDD13\uD83D\uDE19\uD83D\uDC9F\uD83C\uDF31\uD83D\uDE16\uD83D\uDC76\uD83E\uDD74â¶â¡â\uD83D\uDC8E\uD83D\uDCB8â¬\uD83D\uDE28\uD83C\uDF1A\uD83E\uDD8B\uD83D\uDE37\uD83D\uDD7Aâ \uD83D\uDE45\uD83D\uDE1F\uD83D\uDE35\uD83D\uDC4E\uD83E\uDD32\uD83E\uDD20\uD83E\uDD27\uD83D\uDCCC\uD83D\uDD35\uD83D\uDC85\uD83E\uDDD0\uD83D\uDC3E\uD83C\uDF52\uD83D\uDE17\uD83E\uDD11\uD83C\uDF0A\uD83E\uDD2F\uD83D\uDC37â\uD83D\uDCA7\uD83D\uDE2F\uD83D\uDC86\uD83D\uDC46\uD83C\uDFA4\uD83D\uDE47\uD83C\uDF51â\uD83C\uDF34\uD83D\uDCA3\uD83D\uDC38\uD83D\uDC8C\uD83D\uDCCD\uD83E\uDD40\uD83E\uDD22\uD83D\uDC45\uD83D\uDCA1\uD83D\uDCA9\uD83D\uDC50\uD83D\uDCF8\uD83D\uDC7B\uD83E\uDD10\uD83E\uDD2E\uD83C\uDFBC\uD83E\uDD75\uD83D\uDEA9\uD83C\uDF4E\uD83C\uDF4A\uD83D\uDC7C\uD83D\uDC8D\uD83D\uDCE3\uD83E\uDD42"),mE=m_.reduce((e,t,r)=>(e[r]=t,e),[]),mS=m_.reduce((e,t,r)=>(e[t.codePointAt(0)]=r,e),[]);var mx=Object.freeze({__proto__:null,base256emoji:me({prefix:"\uD83D\uDE80",name:"base256emoji",encode:function(e){return e.reduce((e,t)=>e+=mE[t],"")},decode:function(e){let t=[];for(let r of e){let e=mS[r.codePointAt(0)];if(void 0===e)throw Error(`Non-base256emoji character: ${r}`);t.push(e)}return new Uint8Array(t)}})}),mA=128,mI=-128,mO=0x80000000;function mT(e,t,r){t=t||[],r=r||0;for(var n=r;e>=mO;)t[r++]=255&e|mA,e/=128;for(;e&mI;)t[r++]=255&e|mA,e>>>=7;return t[r]=0|e,mT.bytes=r-n+1,t}var mP=128,mM=127;function mN(e,t){var r,n=0,t=t||0,i=0,o=t,s=e.length;do{if(o>=s)throw mN.bytes=0,RangeError("Could not decode varint");r=e[o++],n+=i<28?(r&mM)<<i:(r&mM)*Math.pow(2,i),i+=7}while(r>=mP);return mN.bytes=o-t,n}var mk=128,mC=16384,mD=2097152,mj=0x10000000,mR=0x800000000,mL=0x40000000000,mB=0x2000000000000,mU=0x100000000000000,m$=0x8000000000000000,mK={encode:mT,encodingLength:function(e){return e<mk?1:e<mC?2:e<mD?3:e<mj?4:e<mR?5:e<mL?6:e<mB?7:e<mU?8:e<m$?9:10}};let mF=(e,t,r=0)=>(mK.encode(e,t,r),t),mz=e=>mK.encodingLength(e),mq=(e,t)=>
24{let r=t.byteLength,n=mz(e),i=n+mz(r),o=new Uint8Array(i+r);return mF(e,o,0),mF(r,o,n),o.set(t,i),new mV(e,r,t,o)};class mV{constructor(e,t,r,n){this.code=e,this.size=t,this.digest=r,this.bytes=n}}let mH=({name:e,code:t,encode:r})=>new mG(e,t,r);class mG{constructor(e,t,r){this.name=e,this.code=t,this.encode=r}digest(e){if(e instanceof Uint8Array){let t=this.encode(e);return t instanceof Uint8Array?mq(this.code,t):t.then(e=>mq(this.code,e))}throw Error("Unknown type, must be binary type")}}let mW=e=>async t=>new Uint8Array(await crypto.subtle.digest(e,t));var mJ=Object.freeze({__proto__:null,sha256:mH({name:"sha2-256",code:18,encode:mW("SHA-256")}),sha512:mH({name:"sha2-512",code:19,encode:mW("SHA-512")})});let mZ=0,mY=g2,mX=e=>mq(mZ,mY(e));var mQ=Object.freeze({__proto__:null,identity:{code:mZ,name:"identity",encode:mY,digest:mX}});new TextEncoder,new TextDecoder;let m0={...mo,...ms,...ma,...mc,...mu,...mg,...mm,...mb,...mw,...mx};function m1(e){return null!=globalThis.Buffer?new Uint8Array(e.buffer,e.byteOffset,e.byteLength):e}function m2(e=0){return null!=globalThis.Buffer&&null!=globalThis.Buffer.allocUnsafe?m1(globalThis.Buffer.allocUnsafe(e)):new Uint8Array(e)}function m5(e,t,r,n){return{name:e,prefix:t,encoder:{name:e,prefix:t,encode:r},decoder:{decode:n}}}({...mJ,...mQ});let m3=m5("utf8","u",e=>"u"+new TextDecoder("utf8").decode(e),e=>new TextEncoder().encode(e.substring(1))),m8=m5("ascii","a",e=>{let t="a";for(let r=0;r<e.length;r++)t+=String.fromCharCode(e[r]);return t},e=>{let t=m2((e=e.substring(1)).length);for(let r=0;r<e.length;r++)t[r]=e.charCodeAt(r);return t}),m6={utf8:m3,"utf-8":m3,hex:m0.base16,latin1:m8,ascii:m8,binary:m8,...m0};function m4(e,t="utf8"){let r=m6[t];if(!r)throw Error(`Unsupported encoding "${t}"`);return("utf8"===t||"utf-8"===t)&&null!=globalThis.Buffer&&null!=globalThis.Buffer.from?m1(globalThis.Buffer.from(e,"utf-8")):r.decoder.decode(`${r.prefix}${e}`)}var m9=Object.defineProperty,m7=(e,t,r)=>t in e?m9(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,be=(e,t,r)=>m7(e,"symbol"!=typeof t?t+"":t,r);class bt{constructor(e,t){this.core=e,this.logger=t,be(this,"keychain",new Map),be(this,"name",go),be(this,"version",gs),be(this,"initialized",!1),be(this,"storagePrefix",y7),be(this,"init",async()=>{if(!this.initialized){let e=await this.getKeyChain();"u">typeof e&&(this.keychain=e),this.initialized=!0}}),be(this,"has",e=>(this.isInitialized(),this.keychain.has(e))),be(this,"set",async(e,t)=>{this.isInitialized(),this.keychain.set(e,t),await this.persist()}),be(this,"get",e=>{this.isInitialized();let t=this.keychain.get(e);if(typeof t>"u"){let{message:t}=pP("NO_MATCHING_KEY",`${this.name}: ${e}`);throw Error(t)}return t}),be(this,"del",async e=>{this.isInitialized(),this.keychain.delete(e),await this.persist()}),this.core=e,this.logger=e2(t,this.name)}get context(){return e0(this.logger)}get storageKey(){return this.storagePrefix+this.version+this.core.customStoragePrefix+"//"+this.name}async setKeyChain(e){await this.core.storage.setItem(this.storageKey,cL(e))}async getKeyChain(){let e=await this.core.storage.getItem(this.storageKey);return"u">typeof e?cB(e):void 0}async persist(){await this.setKeyChain(this.keychain)}isInitialized(){if(!this.initialized){let{message:e}=pP("NOT_INITIALIZED",this.name);throw Error(e)}}}var br=Object.defineProperty,bn=(e,t,r)=>t in e?br(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,bi=(e,t,r)=>bn(e,"symbol"!=typeof t?t+"":t,r);class bo{constructor(e,t,r){this.core=e,this.logger=t,bi(this,"name",gr),bi(this,"keychain"),bi(this,"randomSessionIdentifier",hz()),bi(this,"initialized",!1),bi(this,"init",async()=>{this.initialized||(await this.keychain.init(),this.initialized=!0)}),bi(this,"hasKeys",e=>(this.isInitialized(),this.keychain.has(e))),bi(this,"getClientId",async()=>(this.isInitialized(),il(im(await this.getClientSeed()).publicKey))),bi(this,"generateKeyPair",()=>{this.isInitialized();let e=hF();return this.setPrivateKey(e.publicKey,e.privateKey)}),bi(this,"signJWT",async e=>{this.isInitialized();let t=im(await this.getClientSeed()),r=this.randomSessionIdentifier,n=gi;return await ib(r,e,n,t)}
24),bi(this,"generateSharedKey",(e,t,r)=>{this.isInitialized();let n=hq(this.getPrivateKey(e),t);return this.setSymKey(n,r)}),bi(this,"setSymKey",async(e,t)=>{this.isInitialized();let r=t||hV(e);return await this.keychain.set(r,e),r}),bi(this,"deleteKeyPair",async e=>{this.isInitialized(),await this.keychain.del(e)}),bi(this,"deleteSymKey",async e=>{this.isInitialized(),await this.keychain.del(e)}),bi(this,"encode",async(e,t,r)=>{this.isInitialized();let n=h3(r),i=em(t);if(h6(n))return hQ(i,r?.encoding);if(h8(n)){let t=n.senderPublicKey,r=n.receiverPublicKey;e=await this.generateSharedKey(t,r)}let o=this.getSymKey(e),{type:s,senderPublicKey:a}=n;return hY({type:s,symKey:o,message:i,senderPublicKey:a,encoding:r?.encoding})}),bi(this,"decode",async(e,t,r)=>{this.isInitialized();let n=h5(t,r);if(h6(n))return eg(h0(t,r?.encoding));if(h8(n)){let t=n.receiverPublicKey,r=n.senderPublicKey;e=await this.generateSharedKey(t,r)}try{let n=this.getSymKey(e),i=hX({symKey:n,encoded:t,encoding:r?.encoding});return eg(i)}catch(t){this.logger.error(`Failed to decode message from topic: '${e}', clientId: '${await this.getClientId()}'`),this.logger.error(t)}}),bi(this,"getPayloadType",(e,t=hk)=>hW(h2({encoded:e,encoding:t}).type)),bi(this,"getPayloadSenderPublicKey",(e,t=hk)=>{let r=h2({encoded:e,encoding:t});return r.senderPublicKey?a6(r.senderPublicKey,hN):void 0}),this.core=e,this.logger=e2(t,this.name),this.keychain=r||new bt(this.core,this.logger)}get context(){return e0(this.logger)}async setPrivateKey(e,t){return await this.keychain.set(e,t),e}getPrivateKey(e){return this.keychain.get(e)}async getClientSeed(){let e="";try{e=this.keychain.get(gn)}catch{e=hz(),await this.keychain.set(gn,e)}return m4(e,"base16")}getSymKey(e){return this.keychain.get(e)}isInitialized(){if(!this.initialized){let{message:e}=pP("NOT_INITIALIZED",this.name);throw Error(e)}}}var bs=Object.defineProperty,ba=Object.defineProperties,bc=Object.getOwnPropertyDescriptors,bu=Object.getOwnPropertySymbols,bl=Object.prototype.hasOwnProperty,bd=Object.prototype.propertyIsEnumerable,bf=(e,t,r)=>t in e?bs(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,bh=(e,t)=>{for(var r in t||(t={}))bl.call(t,r)&&bf(e,r,t[r]);if(bu)for(var r of bu(t))bd.call(t,r)&&bf(e,r,t[r]);return e},bp=(e,t)=>ba(e,bc(t)),by=(e,t,r)=>bf(e,"symbol"!=typeof t?t+"":t,r);class bg extends ti{constructor(e,t){super(e,t),this.logger=e,this.core=t,by(this,"messages",new Map),by(this,"messagesWithoutClientAck",new Map),by(this,"name",ga),by(this,"version",gc),by(this,"initialized",!1),by(this,"storagePrefix",y7),by(this,"init",async()=>{if(!this.initialized){this.logger.trace("Initialized");try{let e=await this.getRelayerMessages();"u">typeof e&&(this.messages=e);let t=await this.getRelayerMessagesWithoutClientAck();"u">typeof t&&(this.messagesWithoutClientAck=t),this.logger.debug(`Successfully Restored records for ${this.name}`),this.logger.trace({type:"method",method:"restore",size:this.messages.size})}catch(e){this.logger.debug(`Failed to Restore records for ${this.name}`),this.logger.error(e)}finally{this.initialized=!0}}}),by(this,"set",async(e,t,r)=>{this.isInitialized();let n=hH(t),i=this.messages.get(e);if(typeof i>"u"&&(i={}),"u">typeof i[n])return n;if(i[n]=t,this.messages.set(e,i),r===g_.inbound){let r=this.messagesWithoutClientAck.get(e)||{};this.messagesWithoutClientAck.set(e,bp(bh({},r),{[n]:t}))}return await this.persist(),n}),by(this,"get",e=>{this.isInitialized();let t=this.messages.get(e);return typeof t>"u"&&(t={}),t}),by(this,"getWithoutAck",e=>{this.isInitialized();let t={};for(let r of e){let e=this.messagesWithoutClientAck.get(r)||{};t[r]=Object.values(e)}return t}),by(this,"has",(e,t)=>(this.isInitialized(),"u">typeof this.get(e)[hH(t)])),by(this,"ack",async(e,t)=>{this.isInitialized();let r=this.messagesWithoutClientAck.get(e);if(typeof r>"u")return;let n=hH(t);delete r[n],0===Object.keys(r).length?this.messagesWithoutClientAck.delete(e):this.messagesWithoutClientAck.set(e,r),await this.persist()}),by(this,"del",async e=>{this.isInitialized(),this.messages.delete(e),this.messagesWithoutClientAck.delete(e),await this.persist()}),this.logger=e2(e,this.name),this.core=t}
24get context(){return e0(this.logger)}get storageKey(){return this.storagePrefix+this.version+this.core.customStoragePrefix+"//"+this.name}get storageKeyWithoutClientAck(){return this.storagePrefix+this.version+this.core.customStoragePrefix+"//"+this.name+"_withoutClientAck"}async setRelayerMessages(e){await this.core.storage.setItem(this.storageKey,cL(e))}async setRelayerMessagesWithoutClientAck(e){await this.core.storage.setItem(this.storageKeyWithoutClientAck,cL(e))}async getRelayerMessages(){let e=await this.core.storage.getItem(this.storageKey);return"u">typeof e?cB(e):void 0}async getRelayerMessagesWithoutClientAck(){let e=await this.core.storage.getItem(this.storageKeyWithoutClientAck);return"u">typeof e?cB(e):void 0}async persist(){await this.setRelayerMessages(this.messages),await this.setRelayerMessagesWithoutClientAck(this.messagesWithoutClientAck)}isInitialized(){if(!this.initialized){let{message:e}=pP("NOT_INITIALIZED",this.name);throw Error(e)}}}var bm=Object.defineProperty,bb=Object.defineProperties,bv=Object.getOwnPropertyDescriptors,bw=Object.getOwnPropertySymbols,b_=Object.prototype.hasOwnProperty,bE=Object.prototype.propertyIsEnumerable,bS=(e,t,r)=>t in e?bm(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,bx=(e,t)=>{for(var r in t||(t={}))b_.call(t,r)&&bS(e,r,t[r]);if(bw)for(var r of bw(t))bE.call(t,r)&&bS(e,r,t[r]);return e},bA=(e,t)=>bb(e,bv(t)),bI=(e,t,r)=>bS(e,"symbol"!=typeof t?t+"":t,r);class bO extends to{constructor(e,t){super(e,t),this.relayer=e,this.logger=t,bI(this,"events",new x.EventEmitter),bI(this,"name",gl),bI(this,"queue",new Map),bI(this,"publishTimeout",(0,I.toMiliseconds)(I.ONE_MINUTE)),bI(this,"initialPublishTimeout",(0,I.toMiliseconds)(15*I.ONE_SECOND)),bI(this,"needsTransportRestart",!1),bI(this,"publish",async(e,t,r)=>{var n;this.logger.debug("Publishing Payload"),this.logger.trace({type:"method",method:"publish",params:{topic:e,message:t,opts:r}});let i=r?.ttl||gu,o=pe(r),s=r?.prompt||!1,a=r?.tag||0,c=r?.id||yD().toString(),u={topic:e,message:t,opts:{ttl:i,relay:o,prompt:s,tag:a,id:c,attestation:r?.attestation,tvf:r?.tvf}},l=`Failed to publish payload, please try again. id:${c} tag:${a}`;try{let n=new Promise(async n=>{let o=({id:e})=>{u.opts.id===e&&(this.removeRequestFromQueue(e),this.relayer.events.removeListener(gy.publish,o),n(u))};this.relayer.events.on(gy.publish,o);let l=c$(new Promise((n,o)=>{this.rpcPublish({topic:e,message:t,ttl:i,prompt:s,tag:a,id:c,attestation:r?.attestation,tvf:r?.tvf}).then(n).catch(e=>{this.logger.warn(e,e?.message),o(e)})}),this.initialPublishTimeout,`Failed initial publish, retrying.... id:${c} tag:${a}`);try{await l,this.events.removeListener(gy.publish,o)}catch(e){this.queue.set(c,bA(bx({},u),{attempt:1})),this.logger.warn(e,e?.message)}});this.logger.trace({type:"method",method:"publish",params:{id:c,topic:e,message:t,opts:r}}),await c$(n,this.publishTimeout,l)}catch(e){if(this.logger.debug("Failed to Publish Payload"),this.logger.error(e),null!=(n=r?.internal)&&n.throwOnFailedPublish)throw e}finally{this.queue.delete(c)}}),bI(this,"on",(e,t)=>{this.events.on(e,t)}),bI(this,"once",(e,t)=>{this.events.once(e,t)}),bI(this,"off",(e,t)=>{this.events.off(e,t)}),bI(this,"removeListener",(e,t)=>{this.events.removeListener(e,t)}),this.relayer=e,this.logger=e2(t,this.name),this.registerEventListeners()}get context(){return e0(this.logger)}async rpcPublish(e){var t,r,n,i;let{topic:o,message:s,ttl:a=gu,prompt:c,tag:u,id:l,attestation:d,tvf:f}=e,h={method:pt(pe().protocol).publish,params:bx({topic:o,message:s,ttl:a,prompt:c,tag:u,attestation:d},f),id:l};pC(null==(t=h.params)?void 0:t.prompt)&&(null==(r=h.params)||delete r.prompt),pC(null==(n=h.params)?void 0:n.tag)&&(null==(i=h.params)||delete i.tag),this.logger.debug("Outgoing Relay Payload"),this.logger.trace({type:"message",direction:"outgoing",request:h});let p=await this.relayer.request(h);return this.relayer.events.emit(gy.publish,e),this.logger.debug("Successfully Published Payload"),p}removeRequestFromQueue(e){this.queue.delete(e)}checkQueue(){this.queue.forEach(async(e,t)=>{let r=e.attempt+1;this.queue.set(t,bA(bx({},e),{attempt:r}));let{topic:n,message:i,opts:o,attestation:s}=e;this.logger.warn({},`Publisher: queue->publishing: ${e.opts.id}, tag: ${e.opts.tag}, attempt: ${r}`),await this.rpcPublish(bA(bx({},e),{topic:n,message:i,ttl:o.ttl,prompt:o.prompt,tag:o.tag,id:o.id,attestation:s,tvf:o.tvf})),this.logger.warn({},`Publisher: queue->published: ${e.opts.id}`)})}registerEventListeners(){this.relayer.core.heartbeat.on(M.pulse,()=>{if(this.needsTransportRestart){this.needsTransportRestart=!1,this.relayer.events.emit(gy.connection_stalled);return}this.checkQueue()}),this.relayer.on(gy.message_ack,e=>{this.removeRequestFromQueue(e.id.toString())})}}var bT=Object.defineProperty,bP=(e,t,r)=>t in e?bT(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,bM=(e,t,r)=>bP(e,"symbol"!=typeof t?t+"":t,r);class bN{constructor(){bM(this,"map",new Map),bM(this,"set",(e,t)=>{let r=this.get(e);this.exists(e,t)||this.map.set(e,[...r,t])}),bM(this,"get",e=>this.map.get(e)||[]),bM(this,"exists",(e,t)=>this.get(e).includes(t)),bM(this,"delete",(e,t)=>{if(typeof t>"u"){this.map.delete(e);return}if(!this.map.has(e))return;let r=this.get(e);if(!this.exists(e,t))return;let n=r.filter(e=>e!==t);if(!n.length){this.map.delete(e);return}this.map.set(e,n)}),bM(this,"clear",()=>{this.map.clear()})}
24get topics(){return Array.from(this.map.keys())}}var bk=Object.defineProperty,bC=Object.defineProperties,bD=Object.getOwnPropertyDescriptors,bj=Object.getOwnPropertySymbols,bR=Object.prototype.hasOwnProperty,bL=Object.prototype.propertyIsEnumerable,bB=(e,t,r)=>t in e?bk(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,bU=(e,t)=>{for(var r in t||(t={}))bR.call(t,r)&&bB(e,r,t[r]);if(bj)for(var r of bj(t))bL.call(t,r)&&bB(e,r,t[r]);return e},b$=(e,t)=>bC(e,bD(t)),bK=(e,t,r)=>bB(e,"symbol"!=typeof t?t+"":t,r);class bF extends tc{constructor(e,t){super(e,t),this.relayer=e,this.logger=t,bK(this,"subscriptions",new Map),bK(this,"topicMap",new bN),bK(this,"events",new x.EventEmitter),bK(this,"name",gI),bK(this,"version",gO),bK(this,"pending",new Map),bK(this,"cached",[]),bK(this,"initialized",!1),bK(this,"storagePrefix",y7),bK(this,"subscribeTimeout",(0,I.toMiliseconds)(I.ONE_MINUTE)),bK(this,"initialSubscribeTimeout",(0,I.toMiliseconds)(15*I.ONE_SECOND)),bK(this,"clientId"),bK(this,"batchSubscribeTopicsLimit",500),bK(this,"init",async()=>{this.initialized||(this.logger.trace("Initialized"),this.registerEventListeners(),await this.restore()),this.initialized=!0}),bK(this,"subscribe",async(e,t)=>{this.isInitialized(),this.logger.debug("Subscribing Topic"),this.logger.trace({type:"method",method:"subscribe",params:{topic:e,opts:t}});try{let r=pe(t),n={topic:e,relay:r,transportType:t?.transportType};this.pending.set(e,n);let i=await this.rpcSubscribe(e,r,t);return"string"==typeof i&&(this.onSubscribe(i,n),this.logger.debug("Successfully Subscribed Topic"),this.logger.trace({type:"method",method:"subscribe",params:{topic:e,opts:t}})),i}catch(e){throw this.logger.debug("Failed to Subscribe Topic"),this.logger.error(e),e}}),bK(this,"unsubscribe",async(e,t)=>{this.isInitialized(),"u">typeof t?.id?await this.unsubscribeById(e,t.id,t):await this.unsubscribeByTopic(e,t)}),bK(this,"isSubscribed",e=>new Promise(t=>{t(this.topicMap.topics.includes(e))})),bK(this,"isKnownTopic",e=>new Promise(t=>{t(this.topicMap.topics.includes(e)||this.pending.has(e)||this.cached.some(t=>t.topic===e))})),bK(this,"on",(e,t)=>{this.events.on(e,t)}),bK(this,"once",(e,t)=>{this.events.once(e,t)}),bK(this,"off",(e,t)=>{this.events.off(e,t)}),bK(this,"removeListener",(e,t)=>{this.events.removeListener(e,t)}),bK(this,"start",async()=>{await this.onConnect()}),bK(this,"stop",async()=>{await this.onDisconnect()}),bK(this,"restart",async()=>{await this.restore(),await this.onRestart()}),bK(this,"checkPending",async()=>{if(0===this.pending.size&&(!this.initialized||!this.relayer.connected))return;let e=[];this.pending.forEach(t=>{e.push(t)}),await this.batchSubscribe(e)}),bK(this,"registerEventListeners",()=>{this.relayer.core.heartbeat.on(M.pulse,async()=>{await this.checkPending()}),this.events.on(gA.created,async e=>{let t=gA.created;this.logger.info(`Emitting ${t}`),this.logger.debug({type:"event",event:t,data:e}),await this.persist()}),this.events.on(gA.deleted,async e=>{let t=gA.deleted;this.logger.info(`Emitting ${t}`),this.logger.debug({type:"event",event:t,data:e}),await this.persist()})}),this.relayer=e,this.logger=e2(t,this.name),this.clientId=""}get context(){return e0(this.logger)}get storageKey(){return this.storagePrefix+this.version+this.relayer.core.customStoragePrefix+"//"+this.name}get length(){return this.subscriptions.size}get ids(){return Array.from(this.subscriptions.keys())}get values(){return Array.from(this.subscriptions.values())}get topics(){return this.topicMap.topics}get hasAnyTopics(){return this.topicMap.topics.length>0||this.pending.size>0||this.cached.length>0||this.subscriptions.size>0}hasSubscription(e,t){let r=!1;try{r=this.getSubscription(e).topic===t}catch{}return r}reset(){this.cached=[],this.initialized=!0}onDisable(){this.values.length>0&&(this.cached=this.values),this.subscriptions.clear(),this.topicMap.clear()}async unsubscribeByTopic(e,t){let r=this.topicMap.get(e);await Promise.all(r.map(async r=>await this.unsubscribeById(e,r,t)))}async unsubscribeById(e,t,r){this.logger.debug("Unsubscribing Topic"),this.logger.trace({type:"method",method:"unsubscribe",params:{topic:e,id:t,opts:r}});try{let n=pe(r);await this.restartToComplete({topic:e,id:t,relay:n}),await this.rpcUnsubscribe(e,t,n);let i=pM("USER_DISCONNECTED",`${this.name}, ${e}`);await this.onUnsubscribe(e,t,i),this.logger.debug("Successfully Unsubscribed Topic"),this.logger.trace({type:"method",method:"unsubscribe",params:{topic:e,id:t,opts:r}})}catch(e){throw this.logger.debug("Failed to Unsubscribe Topic"),this.logger.error(e),e}}async rpcSubscribe(e,t,r){var n;r&&r?.transportType!==gw.relay||await this.restartToComplete({topic:e,id:e,relay:t});let i={method:pt(t.protocol).subscribe,params:{topic:e}};this.logger.debug("Outgoing Relay Payload"),this.logger.trace({type:"payload",direction:"outgoing",request:i});let o=null==(n=r?.internal)?void 0:n.throwOnFailedPublish;
24try{let t=await this.getSubscriptionId(e);if(r?.transportType===gw.link_mode)return setTimeout(()=>{(this.relayer.connected||this.relayer.connecting)&&this.relayer.request(i).catch(e=>this.logger.warn(e))},(0,I.toMiliseconds)(I.ONE_SECOND)),t;let n=new Promise(async t=>{let r=n=>{n.topic===e&&(this.events.removeListener(gA.created,r),t(n.id))};this.events.on(gA.created,r);try{let n=await c$(new Promise((e,t)=>{this.relayer.request(i).catch(e=>{this.logger.warn(e,e?.message),t(e)}).then(e)}),this.initialSubscribeTimeout,`Subscribing to ${e} failed, please try again`);this.events.removeListener(gA.created,r),t(n)}catch{}}),s=await c$(n,this.subscribeTimeout,`Subscribing to ${e} failed, please try again`);if(!s&&o)throw Error(`Subscribing to ${e} failed, please try again`);return s?t:null}catch(e){if(this.logger.debug("Outgoing Relay Subscribe Payload stalled"),this.relayer.events.emit(gy.connection_stalled),o)throw e}return null}async rpcBatchSubscribe(e){if(!e.length)return;let t={method:pt(e[0].relay.protocol).batchSubscribe,params:{topics:e.map(e=>e.topic)}};this.logger.debug("Outgoing Relay Payload"),this.logger.trace({type:"payload",direction:"outgoing",request:t});try{await await c$(new Promise(e=>{this.relayer.request(t).catch(e=>this.logger.warn(e)).then(e)}),this.subscribeTimeout,"rpcBatchSubscribe failed, please try again")}catch{this.relayer.events.emit(gy.connection_stalled)}}async rpcBatchFetchMessages(e){let t;if(!e.length)return;let r={method:pt(e[0].relay.protocol).batchFetchMessages,params:{topics:e.map(e=>e.topic)}};this.logger.debug("Outgoing Relay Payload"),this.logger.trace({type:"payload",direction:"outgoing",request:r});try{t=await await c$(new Promise((e,t)=>{this.relayer.request(r).catch(e=>{this.logger.warn(e),t(e)}).then(e)}),this.subscribeTimeout,"rpcBatchFetchMessages failed, please try again")}catch{this.relayer.events.emit(gy.connection_stalled)}return t}rpcUnsubscribe(e,t,r){let n={method:pt(r.protocol).unsubscribe,params:{topic:e,id:t}};return this.logger.debug("Outgoing Relay Payload"),this.logger.trace({type:"payload",direction:"outgoing",request:n}),this.relayer.request(n)}onSubscribe(e,t){this.setSubscription(e,b$(bU({},t),{id:e})),this.pending.delete(t.topic)}onBatchSubscribe(e){e.length&&e.forEach(e=>{this.setSubscription(e.id,bU({},e)),this.pending.delete(e.topic)})}async onUnsubscribe(e,t,r){this.events.removeAllListeners(t),this.hasSubscription(t,e)&&this.deleteSubscription(t,r),await this.relayer.messages.del(e)}async setRelayerSubscriptions(e){await this.relayer.core.storage.setItem(this.storageKey,e)}async getRelayerSubscriptions(){return await this.relayer.core.storage.getItem(this.storageKey)}setSubscription(e,t){this.logger.debug("Setting subscription"),this.logger.trace({type:"method",method:"setSubscription",id:e,subscription:t}),this.addSubscription(e,t)}addSubscription(e,t){this.subscriptions.set(e,bU({},t)),this.topicMap.set(t.topic,e),this.events.emit(gA.created,t)}getSubscription(e){this.logger.debug("Getting subscription"),this.logger.trace({type:"method",method:"getSubscription",id:e});let t=this.subscriptions.get(e);if(!t){let{message:t}=pP("NO_MATCHING_KEY",`${this.name}: ${e}`);throw Error(t)}return t}deleteSubscription(e,t){this.logger.debug("Deleting subscription"),this.logger.trace({type:"method",method:"deleteSubscription",id:e,reason:t});let r=this.getSubscription(e);this.subscriptions.delete(e),this.topicMap.delete(r.topic,e),this.events.emit(gA.deleted,b$(bU({},r),{reason:t}))}async persist(){await this.setRelayerSubscriptions(this.values),this.events.emit(gA.sync)}async onRestart(){if(this.cached.length){let e=[...this.cached],t=Math.ceil(this.cached.length/this.batchSubscribeTopicsLimit);for(let r=0;r<t;r++){let t=e.splice(0,this.batchSubscribeTopicsLimit);await this.batchSubscribe(t)}}this.events.emit(gA.resubscribed)}async restore(){try{let e=await this.getRelayerSubscriptions();if(typeof e>"u"||!e.length)return;if(this.subscriptions.size){let{message:e}=pP("RESTORE_WILL_OVERRIDE",this.name);throw this.logger.error(e),this.logger.error(`${this.name}: ${JSON.stringify(this.values)}`),Error(e)}this.cached=e,this.logger.debug(`Successfully Restored subscriptions for ${this.name}`),this.logger.trace({type:"method",method:"restore",subscriptions:this.values})}catch(e){this.logger.debug(`Failed to Restore subscriptions for ${this.name}`),this.logger.error(e)}}async batchSubscribe(e){e.length&&(await this.rpcBatchSubscribe(e),this.onBatchSubscribe(await Promise.all(e.map(async e=>b$(bU({}
24,e),{id:await this.getSubscriptionId(e.topic)})))))}async batchFetchMessages(e){if(!e.length)return;this.logger.trace(`Fetching batch messages for ${e.length} subscriptions`);let t=await this.rpcBatchFetchMessages(e);t&&t.messages&&(await c6((0,I.toMiliseconds)(I.ONE_SECOND)),await this.relayer.handleBatchMessageEvents(t.messages))}async onConnect(){await this.restart(),this.reset()}onDisconnect(){this.onDisable()}isInitialized(){if(!this.initialized){let{message:e}=pP("NOT_INITIALIZED",this.name);throw Error(e)}}async restartToComplete(e){this.relayer.connected||this.relayer.connecting||(this.cached.push(e),await this.relayer.transportOpen())}async getClientId(){return this.clientId||(this.clientId=await this.relayer.core.crypto.getClientId()),this.clientId}async getSubscriptionId(e){return hH(e+await this.getClientId())}}var bz=Object.defineProperty,bq=Object.getOwnPropertySymbols,bV=Object.prototype.hasOwnProperty,bH=Object.prototype.propertyIsEnumerable,bG=(e,t,r)=>t in e?bz(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,bW=(e,t)=>{for(var r in t||(t={}))bV.call(t,r)&&bG(e,r,t[r]);if(bq)for(var r of bq(t))bH.call(t,r)&&bG(e,r,t[r]);return e},bJ=(e,t,r)=>bG(e,"symbol"!=typeof t?t+"":t,r);class bZ extends ts{constructor(e){super(e),bJ(this,"protocol","wc"),bJ(this,"version",2),bJ(this,"core"),bJ(this,"logger"),bJ(this,"events",new x.EventEmitter),bJ(this,"provider"),bJ(this,"messages"),bJ(this,"subscriber"),bJ(this,"publisher"),bJ(this,"name",gp),bJ(this,"transportExplicitlyClosed",!1),bJ(this,"initialized",!1),bJ(this,"connectionAttemptInProgress",!1),bJ(this,"relayUrl"),bJ(this,"projectId"),bJ(this,"packageName"),bJ(this,"bundleId"),bJ(this,"hasExperiencedNetworkDisruption",!1),bJ(this,"pingTimeout"),bJ(this,"heartBeatTimeout",(0,I.toMiliseconds)(I.THIRTY_SECONDS+I.FIVE_SECONDS)),bJ(this,"reconnectTimeout"),bJ(this,"connectPromise"),bJ(this,"reconnectInProgress",!1),bJ(this,"requestsInFlight",[]),bJ(this,"connectTimeout",(0,I.toMiliseconds)(15*I.ONE_SECOND)),bJ(this,"request",async e=>{var t,r;this.logger.debug("Publishing Request Payload");let n=e.id||yD().toString();await this.toEstablishConnection();try{this.logger.trace({id:n,method:e.method,topic:null==(t=e.params)?void 0:t.topic},"relayer.request - publishing...");let i=`${n}:${(null==(r=e.params)?void 0:r.tag)||""}`;this.requestsInFlight.push(i);let o=await this.provider.request(e);return this.requestsInFlight=this.requestsInFlight.filter(e=>e!==i),o}catch(e){throw this.logger.debug(`Failed to Publish Request: ${n}`),e}}),bJ(this,"resetPingTimeout",()=>{cE()&&(clearTimeout(this.pingTimeout),this.pingTimeout=setTimeout(()=>{var e,t,r,n;try{this.logger.debug({},"pingTimeout: Connection stalled, terminating..."),null==(n=null==(r=null==(t=null==(e=this.provider)?void 0:e.connection)?void 0:t.socket)?void 0:r.terminate)||n.call(r)}catch(e){this.logger.warn(e,e?.message)}},this.heartBeatTimeout))}),bJ(this,"onPayloadHandler",e=>{this.onProviderPayload(e),this.resetPingTimeout()}),bJ(this,"onConnectHandler",()=>{this.logger.warn({},"Relayer connected \uD83D\uDEDC"),this.startPingTimeout(),this.events.emit(gy.connect)}),bJ(this,"onDisconnectHandler",()=>{this.logger.warn({},"Relayer disconnected \uD83D\uDED1"),this.requestsInFlight=[],this.onProviderDisconnect()}),bJ(this,"onProviderErrorHandler",e=>{this.logger.fatal(`Fatal socket error: ${e.message}`),this.events.emit(gy.error,e),this.logger.fatal("Fatal socket error received, closing transport"),this.transportClose()}),bJ(this,"registerProviderListeners",()=>{this.provider.on(gm.payload,this.onPayloadHandler),this.provider.on(gm.connect,this.onConnectHandler),this.provider.on(gm.disconnect,this.onDisconnectHandler),this.provider.on(gm.error,this.onProviderErrorHandler)}),this.core=e.core,this.logger="u">typeof e.logger&&"string"!=typeof e.logger?e2(e.logger,this.name):eC()(eY({level:e.logger||gf})),this.messages=new bg(this.logger,e.core),this.subscriber=new bF(this,this.logger),this.publisher=new bO(this,this.logger),this.relayUrl=e?.relayUrl||gh,this.projectId=e.projectId,cx()?this.packageName=cT():cA()&&(this.bundleId=cT()
24),this.provider={}}async init(){if(this.logger.trace("Initialized"),this.registerEventListeners(),await Promise.all([this.messages.init(),this.subscriber.init()]),this.initialized=!0,this.subscriber.hasAnyTopics)try{await this.transportOpen()}catch(e){this.logger.warn(e,e?.message)}}get context(){return e0(this.logger)}get connected(){var e,t,r;return(null==(r=null==(t=null==(e=this.provider)?void 0:e.connection)?void 0:t.socket)?void 0:r.readyState)===1}get connecting(){var e,t,r;return(null==(r=null==(t=null==(e=this.provider)?void 0:e.connection)?void 0:t.socket)?void 0:r.readyState)===0||void 0!==this.connectPromise}async publish(e,t,r){this.isInitialized(),await this.publisher.publish(e,t,r),await this.recordMessageEvent({topic:e,message:t,publishedAt:Date.now(),transportType:gw.relay},g_.outbound)}async subscribe(e,t){var r,n,i;this.isInitialized(),null!=t&&t.transportType&&t?.transportType!=="relay"||await this.toEstablishConnection();let o=typeof(null==(r=t?.internal)?void 0:r.throwOnFailedPublish)>"u"||(null==(n=t?.
24internal)?void 0:n.throwOnFailedPublish),s=(null==(i=this.subscriber.topicMap.get(e))?void 0:i[0])||"",a,c=t=>{t.topic===e&&(this.subscriber.off(gA.created,c),a())};return await Promise.all([new Promise(e=>{a=e,this.subscriber.on(gA.created,c)}),new Promise(async(r,n)=>{s=await this.subscriber.subscribe(e,bW({internal:{throwOnFailedPublish:o}},t)).catch(e=>{o&&n(e)})||s,r()})]),s}async unsubscribe(e,t){this.isInitialized(),await this.subscriber.unsubscribe(e,t)}on(e,t){this.events.on(e,t)}once(e,t){this.events.once(e,t)}off(e,t){this.events.off(e,t)}removeListener(e,t){this.events.removeListener(e,t)}async transportDisconnect(){this.provider.disconnect&&(this.hasExperiencedNetworkDisruption||this.connected)?await c$(this.provider.disconnect(),2e3,"provider.disconnect()").catch(()=>this.onProviderDisconnect()):this.onProviderDisconnect()}async transportClose(){this.transportExplicitlyClosed=!0,await this.transportDisconnect()}async transportOpen(e){if(!this.subscriber.hasAnyTopics){this.logger.warn("Starting WS connection skipped because the client has no topics to work with.");return}if(this.connectPromise?(this.logger.debug({},"Waiting for existing connection attempt to resolve..."),await this.connectPromise,this.logger.debug({},"Existing connection attempt resolved")):(this.connectPromise=new Promise(async(t,r)=>{await this.connect(e).then(t).catch(r).finally(()=>{this.connectPromise=void 0})}),await this.connectPromise),!this.connected)throw Error(`Couldn't establish socket connection to the relay server: ${this.relayUrl}`)}async restartTransport(e){this.logger.debug({},"Restarting transport..."),this.connectionAttemptInProgress||(this.relayUrl=e||this.relayUrl,await this.confirmOnlineStateOrThrow(),await this.transportClose(),await this.transportOpen())}async confirmOnlineStateOrThrow(){if(!await yi())throw Error("No internet connection detected. Please restart your network and try again.")}async handleBatchMessageEvents(e){if(e?.length===0){this.logger.trace("Batch message events is empty. Ignoring...");return}let t=e.sort((e,t)=>e.publishedAt-t.publishedAt);for(let e of(this.logger.debug(`Batch of ${t.length} message events sorted`),t))try{await this.onMessageEvent(e)}catch(e){this.logger.warn(e,"Error while processing batch message event: "+e?.message)}this.logger.trace(`Batch of ${t.length} message events processed`)}async onLinkMessageEvent(e,t){let{topic:r}=e;if(!t.sessionExists){let e={topic:r,expiry:cV(I.FIVE_MINUTES),relay:{protocol:"irn"},active:!1};await this.core.pairing.pairings.set(r,e)}this.events.emit(gy.message,e),await this.recordMessageEvent(e,g_.inbound)}async connect(e){await this.confirmOnlineStateOrThrow(),e&&e!==this.relayUrl&&(this.relayUrl=e,await this.transportDisconnect()),this.connectionAttemptInProgress=!0,this.transportExplicitlyClosed=!1;let t=1;for(;t<6;){try{if(this.transportExplicitlyClosed)break;this.logger.debug({},`Connecting to ${this.relayUrl}, attempt: ${t}...`),await this.createProvider(),await new Promise(async(e,t)=>{let r=()=>{t(Error("Connection interrupted while trying to subscribe"))};this.provider.once(gm.disconnect,r),await c$(new Promise((e,t)=>{this.provider.connect().then(e).catch(t)}),this.connectTimeout,`Socket stalled when trying to connect to ${this.relayUrl}`).catch(e=>{t(e)}).finally(()=>{this.provider.off(gm.disconnect,r),clearTimeout(this.reconnectTimeout)}),await new Promise(async(e,t)=>{let r=()=>{t(Error("Connection interrupted while trying to subscribe"))};this.provider.once(gm.disconnect,r),await this.subscriber.start().then(e).catch(t).finally(()=>{this.provider.off(gm.disconnect,r)})}),this.hasExperiencedNetworkDisruption=!1,e()})}catch(t){await this.subscriber.stop();let e=t;this.logger.warn({},e.message),this.hasExperiencedNetworkDisruption=!0}finally{this.connectionAttemptInProgress=!1}if(this.connected){this.logger.debug({},`Connected to ${this.relayUrl} successfully on attempt: ${t}`);break}await new Promise(e=>setTimeout(e,(0,I.toMiliseconds)(1*t))),t++}}startPingTimeout(){var e,t,r,n,i;if(cE())try{null!=(t=null==(e=this.provider)?void 0:e.connection)&&t.socket&&(null==(i=null==(n=null==(r=this.provider)?void 0:r.connection)?void 0:n.socket)||i.on("ping",()=>{this.resetPingTimeout()})),this.resetPingTimeout()}catch(e){this.logger.warn(e,e?.message)}}async createProvider(){this.provider.connection&&this.unregisterProviderListeners();let e=await this.core.crypto.signJWT(this.relayUrl);this.provider=new yX(new y5(cj({sdkVersion:gv,protocol:this.protocol,version:this.version,relayUrl:this.relayUrl,projectId:this.projectId,auth:e,useOnCloseEvent:!0,bundleId:this.bundleId,packageName:this.packageName}))),this.registerProviderListeners()}async recordMessageEvent(e,t){let{topic:r,message:n}=e;await this.messages.set(r,n,t)}async shouldIgnoreMessageEvent(e){let{topic:t,message:r}=e;if(!r||0===r.length)return this.logger.warn(`Ignoring invalid/empty message: ${r}`),!0;if(!await this.subscriber.isKnownTopic(t))return this.logger.warn(`Ignoring message for unknown topic ${t}`),!0;let n=this.messages.has(t,r);return n&&this.logger.warn(`Ignoring duplicate message: ${r}`),n}async onProviderPayload(e){if(this.logger.debug("Incoming Relay Payload"),this.logger.trace({type:"payload",direction:"incoming",payload:e}),yW(e)){if(!e.method.endsWith(gg))return;let t=e.params,{topic:r,message:n,publishedAt:i,attestation:o}=t.data,s={topic:r,message:n,publishedAt:i,transportType:gw.relay,attestation:o};this.logger.debug("Emitting Relayer Payload"),this.logger.trace(bW({type:"event",event:t.id}
24,s)),this.events.emit(t.id,s),await this.acknowledgePayload(e),await this.onMessageEvent(s)}else yJ(e)&&this.events.emit(gy.message_ack,e)}async onMessageEvent(e){await this.shouldIgnoreMessageEvent(e)||(await this.recordMessageEvent(e,g_.inbound),this.events.emit(gy.message,e))}async acknowledgePayload(e){let t=yR(e.id,!0);await this.provider.connection.send(t)}unregisterProviderListeners(){this.provider.off(gm.payload,this.onPayloadHandler),this.provider.off(gm.connect,this.onConnectHandler),this.provider.off(gm.disconnect,this.onDisconnectHandler),this.provider.off(gm.error,this.onProviderErrorHandler),clearTimeout(this.pingTimeout)}async registerEventListeners(){let e=await yi();yc(async t=>{e!==t&&(e=t,t?await this.transportOpen().catch(e=>this.logger.error(e,e?.message)):(this.hasExperiencedNetworkDisruption=!0,await this.transportDisconnect(),this.transportExplicitlyClosed=!1))}),this.core.heartbeat.on(M.pulse,async()=>{if(!this.transportExplicitlyClosed&&!this.connected&&yd())try{await this.confirmOnlineStateOrThrow(),await this.transportOpen()}catch(e){this.logger.warn(e,e?.message)}})}async onProviderDisconnect(){clearTimeout(this.pingTimeout),this.events.emit(gy.disconnect),this.connectionAttemptInProgress=!1,!this.reconnectInProgress&&(this.reconnectInProgress=!0,await this.subscriber.stop(),this.subscriber.hasAnyTopics&&(this.transportExplicitlyClosed||(this.reconnectTimeout=setTimeout(async()=>{await this.transportOpen().catch(e=>this.logger.error(e,e?.message)),this.reconnectTimeout=void 0,this.reconnectInProgress=!1},(0,I.toMiliseconds)(gb)))))}isInitialized(){if(!this.initialized){let{message:e}=pP("NOT_INITIALIZED",this.name);throw Error(e)}}async toEstablishConnection(){if(await this.confirmOnlineStateOrThrow(),!this.connected){if(this.connectPromise){await this.connectPromise;return}await this.connect()}}}function bY(e,t){return e===t||Number.isNaN(e)&&Number.isNaN(t)}function bX(e){return Object.getOwnPropertySymbols(e).filter(t=>Object.prototype.propertyIsEnumerable.call(e,t))}function bQ(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":Object.prototype.toString.call(e)}let b0="[object RegExp]",b1="[object String]",b2="[object Number]",b5="[object Boolean]",b3="[object Arguments]",b8="[object Symbol]",b6="[object Date]",b4="[object Map]",b9="[object Set]",b7="[object Array]",ve="[object Function]",vt="[object ArrayBuffer]",vr="[object Object]",vn="[object Error]",vi="[object DataView]",vo="[object Uint8Array]",vs="[object Uint8ClampedArray]",va="[object Uint16Array]",vc="[object Uint32Array]",vu="[object BigUint64Array]",vl="[object Int8Array]",vd="[object Int16Array]",vf="[object Int32Array]",vh="[object BigInt64Array]",vp="[object Float32Array]",vy="[object Float64Array]";function vg(e){if(!e||"object"!=typeof e)return!1;let t=Object.getPrototypeOf(e);return(null===t||t===Object.prototype||null===Object.getPrototypeOf(t))&&"[object Object]"===Object.prototype.toString.call(e)}function vm(e,t,r){return vb(e,t,void 0,void 0,void 0,void 0,r)}function vb(e,t,r,n,i,o,s){let a=s(e,t,r,n,i,o);if(void 0!==a)return a;if(typeof e==typeof t)switch(typeof e){case"bigint":case"string":case"boolean":case"symbol":case"undefined":case"function":return e===t;case"number":return e===t||Object.is(e,t)}return vv(e,t,o,s)}function vv(e,t,r,n){if(Object.is(e,t))return!0;let i=bQ(e),o=bQ(t);if(i===b3&&(i=vr),o===b3&&(o=vr),i!==o)return!1;switch(i){case b1:return e.toString()===t.toString();case b2:return bY(e.valueOf(),t.valueOf());case b5:case b6:case b8:return Object.is(e.valueOf(),t.valueOf());case b0:return e.source===t.source&&e.flags===t.flags;case ve:return e===t}let s=(r=r??new Map).get(e),a=r.get(t);if(null!=s&&null!=a)return s===t;r.set(e,t),r.set(t,e);try{switch(i){case b4:if(e.size!==t.size)return!1;for(let[i,o]of e.entries())if(!t.has(i)||!vb(o,t.get(i),i,e,t,r,n))return!1;return!0;case b9:{if(e.size!==t.size)return!1;let i=Array.from(e.values()),o=Array.from(t.values());for(let s=0;s<i.length;s++){let a=i[s],c=o.findIndex(i=>vb(a,i,void 0,e,t,r,n));if(-1===c)return!1;o.splice(c,1)}return!0}case b7:case vo:case vs:case va:case vc:case vu:case vl:case vd:case vf:case vh:case vp:case vy:if("u">typeof y3&&y3.isBuffer(e)!==y3.isBuffer(t)||e.length!==t.length)return!1;for(let i=0;i<e.length;i++)if(!vb(e[i],t[i],i,e,t,r,n))return!1;return!0;case vt:return e.byteLength===t.byteLength&&vv(new Uint8Array(e),new Uint8Array(t),r,n);case vi:return e.byteLength===t.byteLength&&e.byteOffset===t.byteOffset&&vv(new Uint8Array(e),new Uint8Array(t),r,n);case vn:return e.name===t.name&&e.message===t.message;case vr:{if(!(vv(e.constructor,t.constructor,r,n)||vg(e)&&vg(t)))return!1;let i=[...Object.keys(e),...bX(e)],o=[...Object.keys(t),...bX(t)];if(i.length!==o.length)return!1;for(let o=0;o<i.length;o++){let s=i[o],a=e[s];if(!Object.hasOwn(t,s))return!1;let c=t[s];if(!vb(a,c,s,e,t,r,n))return!1}return!0}default:return!1}}finally{r.delete(e),r.delete(t)}}function vw(){}function v_(e,t){return vm(e,t,vw)}var vE=Object.defineProperty,vS=Object.getOwnPropertySymbols,vx=Object.prototype.hasOwnProperty,vA=Object.prototype.propertyIsEnumerable,vI=(e,t,r)=>t in e?vE(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,vO=(e,t)=>{for(var r in t||(t={}))vx.call(t,r)&&vI(e,r,t[r]);if(vS)for(var r of vS(t))vA.call(t,r)&&vI(e,r,t[r]);return e},vT=(e,t,r)=>vI(e,"symbol"!=typeof t?t+"":t,r);class vP extends ta{constructor(e,t,r,n=y7,i){super(e,t,r,n),this.core=e,this.logger=t,this.name=r,vT(this,"map",new Map),vT(this,"version",gE),vT(this,"cac
24hed",[]),vT(this,"initialized",!1),vT(this,"getKey"),vT(this,"storagePrefix",y7),vT(this,"recentlyDeleted",[]),vT(this,"recentlyDeletedLimit",200),vT(this,"init",async()=>{this.initialized||(this.logger.trace("Initialized"),await this.restore(),this.cached.forEach(e=>{this.getKey&&null!==e&&!pC(e)?this.map.set(this.getKey(e),e):p$(e)?this.map.set(e.id,e):pK(e)&&this.map.set(e.topic,e)}),this.cached=[],this.initialized=!0)}),vT(this,"set",async(e,t)=>{this.isInitialized(),this.map.has(e)?await this.update(e,t):(this.logger.debug("Setting value"),this.logger.trace({type:"method",method:"set",key:e,value:t}),this.map.set(e,t),await this.persist())}),vT(this,"get",e=>(this.isInitialized(),this.logger.debug("Getting value"),this.logger.trace({type:"method",method:"get",key:e}),this.getData(e))),vT(this,"getAll",e=>(this.isInitialized(),e?this.values.filter(t=>Object.keys(e).every(r=>v_(t[r],e[r]))):this.values)),vT(this,"update",async(e,t)=>{this.isInitialized(),this.logger.debug("Updating value"),this.logger.trace({type:"method",method:"update",key:e,update:t});let r=vO(vO({},this.getData(e)),t);this.map.set(e,r),await this.persist()}),vT(this,"delete",async(e,t)=>{this.isInitialized(),this.map.has(e)&&(this.logger.debug("Deleting value"),this.logger.trace({type:"method",method:"delete",key:e,reason:t}),this.map.delete(e),this.addToRecentlyDeleted(e),await this.persist())}),this.logger=e2(t,this.name),this.storagePrefix=n,this.getKey=i}get context(){return e0(this.logger)}get storageKey(){return this.storagePrefix+this.version+this.core.customStoragePrefix+"//"+this.name}get length(){return this.map.size}get keys(){return Array.from(this.map.keys())}get values(){return Array.from(this.map.values())}addToRecentlyDeleted(e){this.recentlyDeleted.push(e),this.recentlyDeleted.length>=this.recentlyDeletedLimit&&this.recentlyDeleted.splice(0,this.recentlyDeletedLimit/2)}async setDataStore(e){await this.core.storage.setItem(this.storageKey,e)}async getDataStore(){return await this.core.storage.getItem(this.storageKey)}getData(e){let t=this.map.get(e);if(!t){if(this.recentlyDeleted.includes(e)){let{message:t}=pP("MISSING_OR_INVALID",`Record was recently deleted - ${this.name}: ${e}`);throw this.logger.error(t),Error(t)}let{message:t}=pP("NO_MATCHING_KEY",`${this.name}: ${e}`);throw this.logger.error(t),Error(t)}return t}async persist(){await this.setDataStore(this.values)}async restore(){try{let e=await this.getDataStore();if(typeof e>"u"||!e.length)return;if(this.map.size){let{message:e}=pP("RESTORE_WILL_OVERRIDE",this.name);throw this.logger.error(e),Error(e)}this.cached=e,this.logger.debug(`Successfully Restored value for ${this.name}`),this.logger.trace({type:"method",method:"restore",value:this.values})}catch(e){this.logger.debug(`Failed to Restore value for ${this.name}`),this.logger.error(e)}}isInitialized(){if(!this.initialized){let{message:e}=pP("NOT_INITIALIZED",this.name);throw Error(e)}}}var vM=Object.defineProperty,vN=(e,t,r)=>t in e?vM(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,vk=(e,t,r)=>vN(e,"symbol"!=typeof t?t+"":t,r);class vC{constructor(e,t){this.core=e,this.logger=t,vk(this,"name",gT),vk(this,"version",gP),vk(this,"events",new(A())),vk(this,"pairings"),vk(this,"initialized",!1),vk(this,"storagePrefix",y7),vk(this,"ignoredPayloadTypes",[hR]),vk(this,"registeredMethods",[]),vk(this,"init",async()=>{this.initialized||(await this.pairings.init(),await this.cleanup(),this.registerRelayerEvents(),this.registerExpirerEvents(),this.initialized=!0,this.logger.trace("Initialized"))}),vk(this,"register",({methods:e})=>{this.isInitialized(),this.registeredMethods=[...new Set([...this.registeredMethods,...e])]}),vk(this,"create",async e=>{this.isInitialized();let t=hz(),r=await this.core.crypto.setSymKey(t),n=cV(I.FIVE_MINUTES),i={protocol:gd},o={topic:r,expiry:n,relay:i,active:!1,methods:e?.methods},s=ps({protocol:this.core.protocol,version:this.core.version,topic:r,symKey:t,relay:i,expiryTimestamp:n,methods:e?.methods});return this.events.emit(gN.create,o),this.core.expirer.set(r,n),await this.pairings.set(r,o),await this.core.relayer.subscribe(r,{transportType:e?.transportType}),{topic:r,uri:s}}),vk(this,"pair",async e=>{let t;this.isInitialized();let r=this.core.eventClient.createEvent({properties:{topic:e?.uri,trace:[gV.pairing_started]}});this.isValidPair(e,r);let{topic:n,symKey:i,relay:o,expiryTimestamp:s,methods:a}
24=pn(e.uri);if(r.props.properties.topic=n,r.addTrace(gV.pairing_uri_validation_success),r.addTrace(gV.pairing_uri_not_expired),this.pairings.keys.includes(n)){if(t=this.pairings.get(n),r.addTrace(gV.existing_pairing),t.active)throw r.setError(gH.active_pairing_already_exists),Error(`Pairing already exists: ${n}. Please try again with a new connection URI.`);r.addTrace(gV.pairing_not_expired)}let c=s||cV(I.FIVE_MINUTES),u={topic:n,relay:o,expiry:c,active:!1,methods:a};this.core.expirer.set(n,c),await this.pairings.set(n,u),r.addTrace(gV.store_new_pairing),e.activatePairing&&await this.activate({topic:n}),this.events.emit(gN.create,u),r.addTrace(gV.emit_inactive_pairing),this.core.crypto.keychain.has(n)||await this.core.crypto.setSymKey(i,n),r.addTrace(gV.subscribing_pairing_topic);try{await this.core.relayer.confirmOnlineStateOrThrow()}catch{r.setError(gH.no_internet_connection)}try{await this.core.relayer.subscribe(n,{relay:o})}catch(e){throw r.setError(gH.subscribe_pairing_topic_failure),e}return r.addTrace(gV.subscribe_pairing_topic_success),u}),vk(this,"activate",async({topic:e})=>{this.isInitialized();let t=cV(I.FIVE_MINUTES);this.core.expirer.set(e,t),await this.pairings.update(e,{active:!0,expiry:t})}),vk(this,"ping",async e=>{this.isInitialized(),await this.isValidPing(e),this.logger.warn("ping() is deprecated and will be removed in the next major release.");let{topic:t}=e;if(this.pairings.keys.includes(t)){let e=await this.sendRequest(t,"wc_pairingPing",{}),{done:r,resolve:n,reject:i}=cU();this.events.once(cG("pairing_ping",e),({error:e})=>{e?i(e):n()}),await r()}}),vk(this,"updateExpiry",async({topic:e,expiry:t})=>{this.isInitialized(),await this.pairings.update(e,{expiry:t})}),vk(this,"updateMetadata",async({topic:e,metadata:t})=>{this.isInitialized(),await this.pairings.update(e,{peerMetadata:t})}),vk(this,"getPairings",()=>(this.isInitialized(),this.pairings.values)),vk(this,"disconnect",async e=>{this.isInitialized(),await this.isValidDisconnect(e);let{topic:t}=e;this.pairings.keys.includes(t)&&(await this.sendRequest(t,"wc_pairingDelete",pM("USER_DISCONNECTED")),await this.deletePairing(t))}),vk(this,"formatUriFromPairing",e=>{this.isInitialized();let{topic:t,relay:r,expiry:n,methods:i}=e,o=this.core.crypto.keychain.get(t);return ps({protocol:this.core.protocol,version:this.core.version,topic:t,symKey:o,relay:r,expiryTimestamp:n,methods:i})}),vk(this,"sendRequest",async(e,t,r)=>{let n=yj(t,r),i=await this.core.crypto.encode(e,n),o=gM[t].req;return this.core.history.set(e,n),this.core.relayer.publish(e,i,o),n.id}),vk(this,"sendResult",async(e,t,r)=>{let n=yR(e,r),i=await this.core.crypto.encode(t,n),o=gM[(await this.core.history.get(t,e)).request.method].res;await this.core.relayer.publish(t,i,o),await this.core.history.resolve(n)}),vk(this,"sendError",async(e,t,r)=>{let n=yL(e,r),i=await this.core.crypto.encode(t,n),o=(await this.core.history.get(t,e)).request.method,s=gM[o]?gM[o].res:gM.unregistered_method.res;await this.core.relayer.publish(t,i,s),await this.core.history.resolve(n)}),vk(this,"deletePairing",async(e,t)=>{await this.core.relayer.unsubscribe(e),await Promise.all([this.pairings.delete(e,pM("USER_DISCONNECTED")),this.core.crypto.deleteSymKey(e),t?Promise.resolve():this.core.expirer.del(e)])}),vk(this,"cleanup",async()=>{let e=this.pairings.getAll().filter(e=>cH(e.expiry));await Promise.all(e.map(e=>this.deletePairing(e.topic)))}),vk(this,"onRelayEventRequest",async e=>{let{topic:t,payload:r}=e;switch(r.method){case"wc_pairingPing":return await this.onPairingPingRequest(t,r);case"wc_pairingDelete":return await this.onPairingDeleteRequest(t,r);default:return await this.onUnknownRpcMethodRequest(t,r)}}),vk(this,"onRelayEventResponse",async e=>{let{topic:t,payload:r}=e,n=(await this.core.history.get(t,r.id)).request.method;return"wc_pairingPing"===n?this.onPairingPingResponse(t,r):this.onUnknownRpcMethodResponse(n)}),vk(this,"onPairingPingRequest",async(e,t)=>{let{id:r}=t;try{this.isValidPing({topic:e}),await this.sendResult(r,e,!0),this.events.emit(gN.ping,{id:r,topic:e})}catch(t){await this.sendError(r,e,t),this.logger.error(t)}}),vk(this,"onPairingPingResponse",(e,t)=>{let{id:r}=t;setTimeout(()=>{yZ(t)?this.events.emit(cG("pairing_ping",r),{}):yY(t)&&this.events.emit(cG("pairing_ping",r),{error:t.error})},500)}),vk(this,"onPairingDeleteRequest",async(e,t)=>{let{id:r}=t;try{this.isValidDisconnect({topic:e}),await this.deletePairing(e),this.events.emit(gN.delete,{id:r,topic:e})}catch(t){await this.sendError(r,e,t),this.logger.error(t)}}),vk(this,"onUnknownRpcMethodRequest",async(e,t)=>{let{id:r,method:n}=t;try{if(this.registeredMethods.includes(n))return;let t=pM("WC_METHOD_UNSUPPORTED",n);await this.sendError(r,e,t),this.logger.error(t)}catch(t){await this.sendError(r,e,t),this.logger.error(t)}}),vk(this,"onUnknownRpcMethodResponse",e=>{this.registeredMethods.includes(e)||this.logger.error(pM("WC_METHOD_UNSUPPORTED",e))}),vk(this,"isValidPair",(e,t)=>{var r;if(!p1(e)){let{message:r}=pP("MISSING_OR_INVALID",`pair() params: ${e}`);throw t.setError(gH.malformed_pairing_uri),Error(r)}if(!pU(e.uri)){let{message:r}=pP("MISSING_OR_INVALID",`pair() uri: ${e.uri}`);throw t.setError(gH.malformed_pairing_uri),Error(r)}let n=pn(e?.uri);if(!(null!=(r=n?.relay)&&r.protocol)){let{message:e}=pP("MISSING_OR_INVALID","pair() uri#relay-protocol");throw t.setError(gH.malformed_pairing_uri),Error(e)}if(!(null!=n&&n.symKey)){let{message:e}=pP("MISSING_OR_INVALID","pair() uri#symKey");throw t.setError(gH.malformed_pairing_uri),Error(e)}if(null!=n&&n.expiryTimestamp&&(0,I.toMiliseconds)(n?.expiryTimestamp)<Date.now()){t.setError(gH.pairing_expired);let{message:e}=pP("EXPIRED","pair() URI has expired. Please try again with a new connection URI.");throw Error(e)}}),vk(this,"isValidPing",async e=>{if(!p1(e)){let{message:t}=pP("MISSING_OR_INVALID",`ping() params: ${e}`);throw Error(t)}let{topic:t}=e;await this.isValidPairingTopic(t)}
24),vk(this,"isValidDisconnect",async e=>{if(!p1(e)){let{message:t}=pP("MISSING_OR_INVALID",`disconnect() params: ${e}`);throw Error(t)}let{topic:t}=e;await this.isValidPairingTopic(t)}),vk(this,"isValidPairingTopic",async e=>{if(!pD(e,!1)){let{message:t}=pP("MISSING_OR_INVALID",`pairing topic should be a string: ${e}`);throw Error(t)}if(!this.pairings.keys.includes(e)){let{message:t}=pP("NO_MATCHING_KEY",`pairing topic doesn't exist: ${e}`);throw Error(t)}if(cH(this.pairings.get(e).expiry)){await this.deletePairing(e);let{message:t}=pP("EXPIRED",`pairing topic: ${e}`);throw Error(t)}}),this.core=e,this.logger=e2(t,this.name),this.pairings=new vP(this.core,this.logger,this.name,this.storagePrefix)}get context(){return e0(this.logger)}isInitialized(){if(!this.initialized){let{message:e}=pP("NOT_INITIALIZED",this.name);throw Error(e)}}registerRelayerEvents(){this.core.relayer.on(gy.message,async e=>{let{topic:t,message:r,transportType:n}=e;if(this.pairings.keys.includes(t)&&n!==gw.link_mode&&!this.ignoredPayloadTypes.includes(this.core.crypto.getPayloadType(r)))try{let e=await this.core.crypto.decode(t,r);yW(e)?(this.core.history.set(t,e),await this.onRelayEventRequest({topic:t,payload:e})):yJ(e)&&(await this.core.history.resolve(e),await this.onRelayEventResponse({topic:t,payload:e}),this.core.history.delete(t,e.id)),await this.core.relayer.messages.ack(t,r)}catch(e){this.logger.error(e)}})}registerExpirerEvents(){this.core.expirer.on(gR.expired,async e=>{let{topic:t}=cq(e.target);t&&this.pairings.keys.includes(t)&&(await this.deletePairing(t,!0),this.events.emit(gN.expire,{topic:t}))})}}var vD=Object.defineProperty,vj=(e,t,r)=>t in e?vD(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,vR=(e,t,r)=>vj(e,"symbol"!=typeof t?t+"":t,r);class vL extends tn{constructor(e,t){super(e,t),this.core=e,this.logger=t,vR(this,"records",new Map),vR(this,"events",new x.EventEmitter),vR(this,"name",gC),vR(this,"version",gD),vR(this,"cached",[]),vR(this,"initialized",!1),vR(this,"storagePrefix",y7),vR(this,"init",async()=>{this.initialized||(this.logger.trace("Initialized"),await this.restore(),this.cached.forEach(e=>this.records.set(e.id,e)),this.cached=[],this.registerEventListeners(),this.initialized=!0)}),vR(this,"set",(e,t,r)=>{if(this.isInitialized(),this.logger.debug("Setting JSON-RPC request history record"),this.logger.trace({type:"method",method:"set",topic:e,request:t,chainId:r}),this.records.has(t.id))return;let n={id:t.id,topic:e,request:{method:t.method,params:t.params||null},chainId:r,expiry:cV(I.THIRTY_DAYS)};this.records.set(n.id,n),this.persist(),this.events.emit(gk.created,n)}),vR(this,"resolve",async e=>{if(this.isInitialized(),this.logger.debug("Updating JSON-RPC response history record"),this.logger.trace({type:"method",method:"update",response:e}),!this.records.has(e.id))return;let t=await this.getRecord(e.id);typeof t.response>"u"&&(t.response=yY(e)?{error:e.error}:{result:e.result},this.records.set(t.id,t),this.persist(),this.events.emit(gk.updated,t))}),vR(this,"get",async(e,t)=>(this.isInitialized(),this.logger.debug("Getting record"),this.logger.trace({type:"method",method:"get",topic:e,id:t}),await this.getRecord(t))),vR(this,"delete",(e,t)=>{this.isInitialized(),this.logger.debug("Deleting record"),this.logger.trace({type:"method",method:"delete",id:t}),this.values.forEach(r=>{r.topic!==e||"u">typeof t&&r.id!==t||(this.records.delete(r.id),this.events.emit(gk.deleted,r))}),this.persist()}),vR(this,"exists",async(e,t)=>(this.isInitialized(),!!this.records.has(t)&&(await this.getRecord(t)).topic===e)),vR(this,"on",(e,t)=>{this.events.on(e,t)}),vR(this,"once",(e,t)=>{this.events.once(e,t)}),vR(this,"off",(e,t)=>{this.events.off(e,t)}),vR(this,"removeListener",(e,t)=>{this.events.removeListener(e,t)}),this.logger=e2(t,this.name)}get context(){return e0(this.logger)}get storageKey(){return this.storagePrefix+this.version+this.core.customStoragePrefix+"//"+this.name}get size(){return this.records.size}get keys(){return Array.from(this.records.keys())}get values(){return Array.from(this.records.values())}get pending(){let e=[];
24return this.values.forEach(t=>{if("u">typeof t.response)return;let r={topic:t.topic,request:yj(t.request.method,t.request.params,t.id),chainId:t.chainId};return e.push(r)}),e}async setJsonRpcRecords(e){await this.core.storage.setItem(this.storageKey,e)}async getJsonRpcRecords(){return await this.core.storage.getItem(this.storageKey)}getRecord(e){this.isInitialized();let t=this.records.get(e);if(!t){let{message:t}=pP("NO_MATCHING_KEY",`${this.name}: ${e}`);throw Error(t)}return t}async persist(){await this.setJsonRpcRecords(this.values),this.events.emit(gk.sync)}async restore(){try{let e=await this.getJsonRpcRecords();if(typeof e>"u"||!e.length)return;if(this.records.size){let{message:e}=pP("RESTORE_WILL_OVERRIDE",this.name);throw this.logger.error(e),Error(e)}this.cached=e,this.logger.debug(`Successfully Restored records for ${this.name}`),this.logger.trace({type:"method",method:"restore",records:this.values})}catch(e){this.logger.debug(`Failed to Restore records for ${this.name}`),this.logger.error(e)}}registerEventListeners(){this.events.on(gk.created,e=>{let t=gk.created;this.logger.info(`Emitting ${t}`),this.logger.debug({type:"event",event:t,record:e})}),this.events.on(gk.updated,e=>{let t=gk.updated;this.logger.info(`Emitting ${t}`),this.logger.debug({type:"event",event:t,record:e})}),this.events.on(gk.deleted,e=>{let t=gk.deleted;this.logger.info(`Emitting ${t}`),this.logger.debug({type:"event",event:t,record:e})}),this.core.heartbeat.on(M.pulse,()=>{this.cleanup()})}cleanup(){try{this.isInitialized();let e=!1;this.records.forEach(t=>{(0,I.toMiliseconds)(t.expiry||0)-Date.now()<=0&&(this.logger.info(`Deleting expired history log: ${t.id}`),this.records.delete(t.id),this.events.emit(gk.deleted,t,!1),e=!0)}),e&&this.persist()}catch(e){this.logger.warn(e)}}isInitialized(){if(!this.initialized){let{message:e}=pP("NOT_INITIALIZED",this.name);throw Error(e)}}}var vB=Object.defineProperty,vU=(e,t,r)=>t in e?vB(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,v$=(e,t,r)=>vU(e,"symbol"!=typeof t?t+"":t,r);class vK extends tu{constructor(e,t){super(e,t),this.core=e,this.logger=t,v$(this,"expirations",new Map),v$(this,"events",new x.EventEmitter),v$(this,"name",gj),v$(this,"version",gL),v$(this,"cached",[]),v$(this,"initialized",!1),v$(this,"storagePrefix",y7),v$(this,"init",async()=>{this.initialized||(this.logger.trace("Initialized"),await this.restore(),this.cached.forEach(e=>this.expirations.set(e.target,e)),this.cached=[],this.registerEventListeners(),this.initialized=!0)}),v$(this,"has",e=>{try{let t=this.formatTarget(e);return"u">typeof this.getExpiration(t)}catch{return!1}}),v$(this,"set",(e,t)=>{this.isInitialized();let r=this.formatTarget(e),n={target:r,expiry:t};this.expirations.set(r,n),this.checkExpiry(r,n),this.events.emit(gR.created,{target:r,expiration:n})}),v$(this,"get",e=>{this.isInitialized();let t=this.formatTarget(e);return this.getExpiration(t)}),v$(this,"del",e=>{if(this.isInitialized(),this.has(e)){let t=this.formatTarget(e),r=this.getExpiration(t);this.expirations.delete(t),this.events.emit(gR.deleted,{target:t,expiration:r})}}),v$(this,"on",(e,t)=>{this.events.on(e,t)}),v$(this,"once",(e,t)=>{this.events.once(e,t)}),v$(this,"off",(e,t)=>{this.events.off(e,t)}),v$(this,"removeListener",(e,t)=>{this.events.removeListener(e,t)}),this.logger=e2(t,this.name)}get context(){return e0(this.logger)}get storageKey(){return this.storagePrefix+this.version+this.core.customStoragePrefix+"//"+this.name}get length(){return this.expirations.size}get keys(){return Array.from(this.expirations.keys())}get values(){return Array.from(this.expirations.values())}formatTarget(e){if("string"==typeof e)return cF(e);if("number"==typeof e)return cz(e);let{message:t}=pP("UNKNOWN_TYPE",`Target type: ${typeof e}`);throw Error(t)}async setExpirations(e){await this.core.storage.setItem(this.storageKey,e)}async getExpirations(){return await this.core.storage.getItem(this.storageKey)}async persist(){await this.setExpirations(this.values),this.events.emit(gR.sync)}async restore(){try{let e=await this.getExpirations();if(typeof e>"u"||!e.length)return;if(this.expirations.size){let{message:e}=pP("RESTORE_WILL_OVERRIDE",this.name);throw this.logger.error(e),Error(e)}this.cached=e,this.logger.debug(`Successfully Restored expirations for ${this.name}`),this.logger.trace({type:"method",method:"restore",expirations:this.values})}catch(e){this.logger.debug(`Failed to Restore expirations for ${this.name}`),this.logger.error(e)}}getExpiration(e){let t=this.expirations.get(e);if(!t){let{message:t}=pP("NO_MATCHING_KEY",`${this.name}: ${e}`);throw this.logger.warn(t),Error(t)}return t}checkExpiry(e,t){let{expiry:r}=t;(0,I.toMiliseconds)(r)-Date.now()<=0&&this.expire(e,t)}expire(e,t){this.expirations.delete(e),this.events.emit(gR.expired,{target:e,expiration:t})}checkExpirations(){this.core.relayer.connected&&this.expirations.forEach((e,t)=>this.checkExpiry(t,e))}registerEventListeners(){this.core.heartbeat.on(M.pulse,()=>this.checkExpirations()),this.events.on(gR.created,e=>{let t=gR.created;this.logger.info(`Emitting ${t}`),this.logger.debug({type:"event",event:t,data:e}),this.persist()}),this.events.on(gR.expired,e=>{let t=gR.expired;this.logger.info(`Emitting ${t}`),this.logger.debug({type:"event",event:t,data:e}),this.persist()}),this.events.on(gR.deleted,e=>{let t=gR.deleted;this.logger.info(`Emitting ${t}`),this.logger.debug({type:"event",event:t,data:e}),this.persist()})}isInitialized(){if(!this.initialized){let{message:e}=pP("NOT_INITIALIZED",this.name);throw Error(e)}}}var vF=Object.defineProperty,vz=(e,t,r)=>t in e?vF(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,vq=(e,t,r)=>vz(e,"symbol"!=typeof t?t+"":t,r);class vV extends tl{constructor(e,t,r){super(e,t,r),this.core=e,this.logger=t,this.store=r,vq(this,"name",gB),vq(this,"abortController"),vq(this,"isDevEnv"),vq(this,"verifyUrlV3",gK),vq(this,"storagePrefix",y7),vq(this,"version",y4),vq(this,"publicKey"),vq(this,"fetchPromise"),vq(this,"init",async()=>{var e;this.isDevEnv||(this.publicKey=await this.store.getItem(this.storeKey),this.publicKey&&(0,I.toMiliseconds)(null==(e=this.publicKey)?void 0:e.expiresAt)<Date.now()&&(this.logger.debug("verify v2 public key expired"),await this.removePublicKey()))}),vq(this,"register",async e=>{if(!cI()||this.isDevEnv)return;let t=window.location.origin,{id:r,decryptedId:n}=e,i=`${this.verifyUrlV3}/attestation?projectId=${this.core.projectId}&origin=${t}&id=${r}&decryptedId=${n}`;try{let e=(0,iR.getDocument)(),t=this.startAbortTimer(5*I.ONE_SECOND),n=await new Promise((n,o)=>{let s=()=>{window.removeEventListener("message",c),e.body.removeChild(a),o("attestation aborted")};this.abortController.signal.addEventListener("abort",s);let a=e.createElement("iframe");a.src=i,a.style.display="none",a.addEventListener("error",s,{signal:this.abortController.signal});let c=i=>{if(i.data&&"string"==typeof i.data)try{let o=JSON.parse(i.data);if("verify_attestation"===o.type){if(ig(o.attestation).payload.id!==r)return;clearInterval(t),e.body.removeChild(a),this.abortController.signal.removeEventListener("abort",s),window.removeEventListener("message",c),n(null===o.attestation?"":o.attestation)}}catch(e){this.logger.warn(e)}};e.body.appendChild(a),window.addEventListener("message",c,{signal:this.abortController.signal})});return this.logger.debug("jwt attestation",n),n}catch(e){this.logger.warn(e)}return""}),vq(this,"resolve",async e=>{if(this.isDevEnv)return"";let{attestationId:t,hash:r,encryptedId:n}=e;if(""===t){this.logger.debug("resolve: attestationId is empty, skipping");return}if(t){if(ig(t).payload.id!==n)return;let e=await this.isValidJwtAttestation(t);
24if(e){if(!e.isVerified){this.logger.warn("resolve: jwt attestation: origin url not verified");return}return e}}if(!r)return;let i=this.getVerifyUrl(e?.verifyUrl);return this.fetchAttestation(r,i)}),vq(this,"fetchAttestation",async(e,t)=>{this.logger.debug(`resolving attestation: ${e} from url: ${t}`);let r=this.startAbortTimer(5*I.ONE_SECOND),n=await fetch(`${t}/attestation/${e}?v2Supported=true`,{signal:this.abortController.signal});return clearTimeout(r),200===n.status?await n.json():void 0}),vq(this,"getVerifyUrl",e=>{let t=e||g$;return gF.includes(t)||(this.logger.info(`verify url: ${t}, not included in trusted list, assigning default: ${g$}`),t=g$),t}),vq(this,"fetchPublicKey",async()=>{try{this.logger.debug(`fetching public key from: ${this.verifyUrlV3}`);let e=this.startAbortTimer(I.FIVE_SECONDS),t=await fetch(`${this.verifyUrlV3}/public-key`,{signal:this.abortController.signal});return clearTimeout(e),await t.json()}catch(e){this.logger.warn(e)}}),vq(this,"persistPublicKey",async e=>{this.logger.debug("persisting public key to local storage",e),await this.store.setItem(this.storeKey,e),this.publicKey=e}),vq(this,"removePublicKey",async()=>{this.logger.debug("removing verify v2 public key from storage"),await this.store.removeItem(this.storeKey),this.publicKey=void 0}),vq(this,"isValidJwtAttestation",async e=>{let t=await this.getPublicKey();try{if(t)return this.validateAttestation(e,t)}catch(e){this.logger.error(e),this.logger.warn("error validating attestation")}let r=await this.fetchAndPersistPublicKey();try{if(r)return this.validateAttestation(e,r)}catch(e){this.logger.error(e),this.logger.warn("error validating attestation")}}),vq(this,"getPublicKey",async()=>this.publicKey?this.publicKey:await this.fetchAndPersistPublicKey()),vq(this,"fetchAndPersistPublicKey",async()=>{if(this.fetchPromise)return await this.fetchPromise,this.publicKey;this.fetchPromise=new Promise(async e=>{let t=await this.fetchPublicKey();t&&(await this.persistPublicKey(t),e(t))});let e=await this.fetchPromise;return this.fetchPromise=void 0,e}),vq(this,"validateAttestation",(e,t)=>{let r=h9(e,t.publicKey),n={hasExpired:(0,I.toMiliseconds)(r.exp)<Date.now(),payload:r};if(n.hasExpired)throw this.logger.warn("resolve: jwt attestation expired"),Error("JWT attestation expired");return{origin:n.payload.origin,isScam:n.payload.isScam,isVerified:n.payload.isVerified}}),this.logger=e2(t,this.name),this.abortController=new AbortController,this.isDevEnv=c1(),this.init()}get storeKey(){return this.storagePrefix+this.version+this.core.customStoragePrefix+"//verify:public:key"}get context(){return e0(this.logger)}startAbortTimer(e){return this.abortController=new AbortController,setTimeout(()=>this.abortController.abort(),(0,I.toMiliseconds)(e))}}var vH=Object.defineProperty,vG=(e,t,r)=>t in e?vH(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,vW=(e,t,r)=>vG(e,"symbol"!=typeof t?t+"":t,r);class vJ extends td{constructor(e,t){super(e,t),this.projectId=e,this.logger=t,vW(this,"context",gz),vW(this,"registerDeviceToken",async e=>{let{clientId:t,token:r,notificationType:n,enableEncrypted:i=!1}=e,o=`${gq}/${this.projectId}/clients`;await fetch(o,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({client_id:t,type:n,token:r,always_raw:i})})}),this.logger=e2(t,this.context)}}var vZ=Object.defineProperty,vY=Object.getOwnPropertySymbols,vX=Object.prototype.hasOwnProperty,vQ=Object.prototype.propertyIsEnumerable,v0=(e,t,r)=>t in e?vZ(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,v1=(e,t)=>{for(var r in t||(t={}))vX.call(t,r)&&v0(e,r,t[r]);if(vY)for(var r of vY(t))vQ.call(t,r)&&v0(e,r,t[r]);return e},v2=(e,t,r)=>v0(e,"symbol"!=typeof t?t+"":t,r);class v5 extends tf{constructor(e,t,r=!0){super(e,t,r),this.core=e,this.logger=t,v2(this,"context",gX),v2(this,"storagePrefix",y7),v2(this,"storageVersion",gY),v2(this,"events",new Map),v2(this,"shouldPersist",!1),v2(this,"init",async()=>{if(!c1())try{let e={eventId:c0(),timestamp:Date.now(),domain:this.getAppDomain(),props:{event:"INIT",type:"",properties:{client_id:await this.core.crypto.getClientId(),user_agent:cD(this.core.relayer.protocol,this.core.relayer.version,gv)}}};await this.sendEvent([e])}catch(e){this.logger.warn(e)}}),v2(this,"createEvent",e=>{let{event:t="ERROR",type:r="",properties:{topic:n,trace:i}}=e,o=c0(),s=this.core.projectId||"",a=v1({eventId:o,timestamp:Date.now(),props:{event:t,type:r,properties:{topic:n,trace:i}},bundleId:s,domain:this.getAppDomain()},this.setMethods(o));return this.telemetryEnabled&&(this.events.set(o,a),this.shouldPersist=!0),a}),v2(this,"getEvent",e=>{let{eventId:t,topic:r}=e;if(t)return this.events.get(t);let n=Array.from(this.events.values()).find(e=>e.props.properties.topic===r);if(n)return v1(v1({},n),this.setMethods(n.eventId))}),v2(this,"deleteEvent",e=>{let{eventId:t}=e;this.events.delete(t),this.shouldPersist=!0}),v2(this,"setEventListeners",()=>{this.core.heartbeat.on(M.pulse,async()=>
24{this.shouldPersist&&await this.persist(),this.events.forEach(e=>{(0,I.fromMiliseconds)(Date.now())-(0,I.fromMiliseconds)(e.timestamp)>gQ&&(this.events.delete(e.eventId),this.shouldPersist=!0)})})}),v2(this,"setMethods",e=>({addTrace:t=>this.addTrace(e,t),setError:t=>this.setError(e,t)})),v2(this,"addTrace",(e,t)=>{let r=this.events.get(e);r&&(r.props.properties.trace.push(t),this.events.set(e,r),this.shouldPersist=!0)}),v2(this,"setError",(e,t)=>{let r=this.events.get(e);r&&(r.props.type=t,r.timestamp=Date.now(),this.events.set(e,r),this.shouldPersist=!0)}),v2(this,"persist",async()=>{await this.core.storage.setItem(this.storageKey,Array.from(this.events.values())),this.shouldPersist=!1}),v2(this,"restore",async()=>{try{let e=await this.core.storage.getItem(this.storageKey)||[];if(!e.length)return;e.forEach(e=>{this.events.set(e.eventId,v1(v1({},e),this.setMethods(e.eventId)))})}catch(e){this.logger.warn(e)}}),v2(this,"submit",async()=>{if(!this.telemetryEnabled||0===this.events.size)return;let e=[];for(let[t,r]of this.events)r.props.type&&e.push(r);if(0!==e.length)try{if((await this.sendEvent(e)).ok)for(let t of e)this.events.delete(t.eventId),this.shouldPersist=!0}catch(e){this.logger.warn(e)}}),v2(this,"sendEvent",async e=>{let t=this.getAppDomain()?"":"&sp=desktop";return await fetch(`${g0}?projectId=${this.core.projectId}&st=events_sdk&sv=js-${gv}${t}`,{method:"POST",body:JSON.stringify(e)})}),v2(this,"getAppDomain",()=>cN().url),this.logger=e2(t,this.context),this.telemetryEnabled=r,r?this.restore().then(async()=>{await this.submit(),this.setEventListeners()}):this.persist()}get storageKey(){return this.storagePrefix+this.storageVersion+this.core.customStoragePrefix+"//"+this.context}}var v3=Object.defineProperty,v8=Object.getOwnPropertySymbols,v6=Object.prototype.hasOwnProperty,v4=Object.prototype.propertyIsEnumerable,v9=(e,t,r)=>t in e?v3(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,v7=(e,t)=>{for(var r in t||(t={}))v6.call(t,r)&&v9(e,r,t[r]);if(v8)for(var r of v8(t))v4.call(t,r)&&v9(e,r,t[r]);return e},we=(e,t,r)=>v9(e,"symbol"!=typeof t?t+"":t,r);class wt extends e7{constructor(e){var t;super(e),we(this,"protocol",y6),we(this,"version",y4),we(this,"name",y9),we(this,"relayUrl"),we(this,"projectId"),we(this,"customStoragePrefix"),we(this,"events",new x.EventEmitter),we(this,"logger"),we(this,"heartbeat"),we(this,"relayer"),we(this,"crypto"),we(this,"storage"),we(this,"history"),we(this,"expirer"),we(this,"pairing"),we(this,"verify"),we(this,"echoClient"),we(this,"linkModeSupportedApps"),we(this,"eventClient"),we(this,"initialized",!1),we(this,"logChunkController"),we(this,"on",(e,t)=>this.events.on(e,t)),we(this,"once",(e,t)=>this.events.once(e,t)),we(this,"off",(e,t)=>this.events.off(e,t)),we(this,"removeListener",(e,t)=>this.events.removeListener(e,t)),we(this,"dispatchEnvelope",({topic:e,message:t,sessionExists:r})=>{if(!e||!t)return;let n={topic:e,message:t,publishedAt:Date.now(),transportType:gw.link_mode};this.relayer.onLinkMessageEvent(n,{sessionExists:r})});let r=this.getGlobalCore(e?.customStoragePrefix);if(r)try{return this.customStoragePrefix=r.customStoragePrefix,this.logger=r.logger,this.heartbeat=r.heartbeat,this.crypto=r.crypto,this.history=r.history,this.expirer=r.expirer,this.storage=r.storage,this.relayer=r.relayer,this.pairing=r.pairing,this.verify=r.verify,this.echoClient=r.echoClient,this.linkModeSupportedApps=r.linkModeSupportedApps,this.eventClient=r.eventClient,this.initialized=r.initialized,this.logChunkController=r.logChunkController,r}catch(e){console.warn("Failed to copy global core",e)}this.projectId=e?.projectId,this.relayUrl=e?.relayUrl||gh,this.customStoragePrefix=null!=e&&e.customStoragePrefix?`:${e.customStoragePrefix}`:"";let{logger:n,chunkLoggerController:i}=e8({opts:eY({level:"string"==typeof e?.logger&&e.logger?e.logger:ge.logger,name:y9}),maxSizeInBytes:e?.maxLogBlobSizeInBytes,loggerOverride:e?.logger});this.logChunkController=i,null!=(t=this.logChunkController)&&t.downloadLogsBlobInBrowser&&(window.downloadLogsBlobInBrowser=async()=>{var e,t;null!=(e=this.logChunkController)&&e.downloadLogsBlobInBrowser&&(null==(t=this.logChunkController)||t.downloadLogsBlobInBrowser({clientId:await this.crypto.getClientId()}))}),this.logger=e2(n,this.name),this.heartbeat=new N,this.crypto=new bo(this,this.logger,e?.keychain),this.history=new vL(this,this.logger),this.expirer=new vK(this,this.logger),this.storage=null!=e&&e.storage?e.storage:new eN(v7(v7({},gt),e?.storageOptions)),this.relayer=new bZ({core:this,logger:this.logger,relayUrl:this.relayUrl,projectId:this.projectId}),this.pairing=new vC(this,this.logger),this.verify=new vV(this,this.logger,this.storage),this.echoClient=new vJ(this.projectId||"",this.logger),this.linkModeSupportedApps=[],this.eventClient=new v5(this,this.logger,e?.telemetryEnabled),this.setGlobalCore(this)}static async init(e){let t=new wt(e);await t.initialize();let r=await t.crypto.getClientId();return await t.storage.setItem(gS,r),t}get context(){return e0(this.logger)}async start(){this.initialized||await this.initialize()}async getLogsBlob(){var e;return null==(e=this.logChunkController)?void 0:e.logsToBlob({clientId:await this.crypto.getClientId()})}async addLinkModeSupportedApp(e){this.linkModeSupportedApps.includes(e)||(this.linkModeSupportedApps.push(e),await this.storage.setItem(gx,this.linkModeSupportedApps))}async initialize(){this.logger.trace("Initialized");try{await this.crypto.init(),await this.history.init(),await this.expirer.init(),await this.relayer.init(),await this.heartbeat.init(
24),await this.pairing.init(),this.linkModeSupportedApps=await this.storage.getItem(gx)||[],this.initialized=!0,this.logger.info("Core Initialization Success")}catch(e){throw this.logger.warn(`Core Initialization Failure at epoch ${Date.now()}`,e),this.logger.error(e.message),e}}getGlobalCore(e=""){try{if(this.isGlobalCoreDisabled())return;let t=`_walletConnectCore_${e}`,r=`${t}_count`;return globalThis[r]=(globalThis[r]||0)+1,globalThis[r]>1&&console.warn(`WalletConnect Core is already initialized. This is probably a mistake and can lead to unexpected behavior. Init() was called ${globalThis[r]} times.`),globalThis[t]}catch(e){console.warn("Failed to get global WalletConnect core",e);return}}setGlobalCore(e){var t;try{if(this.isGlobalCoreDisabled())return;let r=`_walletConnectCore_${(null==(t=e.opts)?void 0:t.customStoragePrefix)||""}`;globalThis[r]=e}catch(e){console.warn("Failed to set global WalletConnect core",e)}}isGlobalCoreDisabled(){try{return"u">typeof y8&&"true"===y8.env.DISABLE_GLOBAL_CORE}catch{return!0}}}let wr=wt;var wn=Object.defineProperty,wi=(e,t,r)=>t in e?wn(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,wo=(e,t,r)=>wi(e,"symbol"!=typeof t?t+"":t,r);class ws{constructor(e){this.opts=e,wo(this,"protocol","wc"),wo(this,"version",2)}}class wa{constructor(e){this.client=e}}let wc="wc",wu=2,wl="client",wd=`${wc}@${wu}:${wl}:`,wf={name:wl,logger:"error"},wh="WALLETCONNECT_DEEPLINK_CHOICE",wp="proposal",wy="Proposal expired",wg="session",wm=I.SEVEN_DAYS,wb="engine",wv={wc_sessionPropose:{req:{ttl:I.FIVE_MINUTES,prompt:!0,tag:1100},res:{ttl:I.FIVE_MINUTES,prompt:!1,tag:1101},reject:{ttl:I.FIVE_MINUTES,prompt:!1,tag:1120},autoReject:{ttl:I.FIVE_MINUTES,prompt:!1,tag:1121}},wc_sessionSettle:{req:{ttl:I.FIVE_MINUTES,prompt:!1,tag:1102},res:{ttl:I.FIVE_MINUTES,prompt:!1,tag:1103}},wc_sessionUpdate:{req:{ttl:I.ONE_DAY,prompt:!1,tag:1104},res:{ttl:I.ONE_DAY,prompt:!1,tag:1105}},wc_sessionExtend:{req:{ttl:I.ONE_DAY,prompt:!1,tag:1106},res:{ttl:I.ONE_DAY,prompt:!1,tag:1107}},wc_sessionRequest:{req:{ttl:I.FIVE_MINUTES,prompt:!0,tag:1108},res:{ttl:I.FIVE_MINUTES,prompt:!1,tag:1109}},wc_sessionEvent:{req:{ttl:I.FIVE_MINUTES,prompt:!0,tag:1110},res:{ttl:I.FIVE_MINUTES,prompt:!1,tag:1111}},wc_sessionDelete:{req:{ttl:I.ONE_DAY,prompt:!1,tag:1112},res:{ttl:I.ONE_DAY,prompt:!1,tag:1113}},wc_sessionPing:{req:{ttl:I.ONE_DAY,prompt:!1,tag:1114},res:{ttl:I.ONE_DAY,prompt:!1,tag:1115}},wc_sessionAuthenticate:{req:{ttl:I.ONE_HOUR,prompt:!0,tag:1116},res:{ttl:I.ONE_HOUR,prompt:!1,tag:1117},reject:{ttl:I.FIVE_MINUTES,prompt:!1,tag:1118},autoReject:{ttl:I.FIVE_MINUTES,prompt:!1,tag:1119}}},ww={min:I.FIVE_MINUTES,max:I.SEVEN_DAYS},w_={idle:"IDLE",active:"ACTIVE"},wE={eth_sendTransaction:{key:""},eth_sendRawTransaction:{key:""},wallet_sendCalls:{key:""},solana_signTransaction:{key:"signature"},solana_signAllTransactions:{key:"transactions"},solana_signAndSendTransaction:{key:"signature"},sui_signAndExecuteTransaction:{key:"digest"},sui_signTransaction:{key:""},hedera_signAndExecuteTransaction:{key:"transactionId"},hedera_executeTransaction:{key:"transactionId"},near_signTransaction:{key:""},near_signTransactions:{key:""},tron_signTransaction:{key:"txID"},xrpl_signTransaction:{key:""},xrpl_signTransactionFor:{key:""},algo_signTxn:{key:""},sendTransfer:{key:"txid"},stacks_stxTransfer:{key:"txId"},polkadot_signTransaction:{key:""},cosmos_signDirect:{key:""}},wS="request",wx=["wc_sessionPropose","wc_sessionRequest","wc_authRequest","wc_sessionAuthenticate"],wA="wc",wI="auth",wO="authKeys",wT="pairingTopics",wP="requests",wM=`${wA}@1.5:${wI}:`,wN=`${wM}:PUB_KEY`;var wk=Object.defineProperty,wC=Object.defineProperties,wD=Object.getOwnPropertyDescriptors,wj=Object.getOwnPropertySymbols,wR=Object.prototype.hasOwnProperty,wL=Object.prototype.propertyIsEnumerable,wB=(e,t,r)=>t in e?wk(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,wU=(e,t)=>{for(var r in t||(t={}))wR.call(t,r)&&wB(e,r,t[r]);if(wj)for(var r of wj(t))wL.call(t,r)&&wB(e,r,t[r]);return e},w$=(e,t)=>wC(e,wD(t)),wK=(e,t,r)=>wB(e,"symbol"!=typeof t?t+"":t,r);class wF extends wa{constructor(e){super(e),wK(this,"name",wb),wK(this,"events",new(A())),wK(this,"initialized",!1),wK(this,"requestQueue",{state:w_.idle,queue:[]}),wK(this,"sessionRequestQueue",{state:w_.idle,queue:[]}),wK(this,"requestQueueDelay",I.ONE_SECOND),wK(this,"expectedPairingMethodMap",new Map),wK(this,"recentlyDeletedMap",new Map),wK(this,"recentlyDeletedLimit",200),wK(this,"relayMessageCache",[]),wK(this,"pendingSessions",new Map),wK(this,"init",async()=>{this.initialized||(await this.cleanup(),this.registerRelayerEvents(),this.registerExpirerEvents(),this.registerPairingEvents(),await this.registerLinkModeListeners(),this.client.core.pairing.register({methods:Object.keys(wv)}),this.initialized=!0,setTimeout(async()=>{await this.processPendingMessageEvents(),this.sessionRequestQueue.queue=this.getPendingSessionRequests(),this.processSessionRequestQueue()},(0,I.toMiliseconds)(this.requestQueueDelay)))}),wK(this,"connect",async e=>{this.isInitialized(),await this.confirmOnlineStateOrThrow();let t=w$(wU({},e),{requiredNamespaces:e.requiredNamespaces||{},optionalNamespaces:e.optionalNamespaces||{}});await this.isValidConnect(t),t.optionalNamespaces=pI(t.requiredNamespaces,t.optionalNamespaces),t.requiredNamespaces={};let{pairingTopic:r,requiredNamespaces:n,optionalNamespaces:i,sessionProperties:o,scopedProperties:s,relays:a}=t,c=r,u,l=!1;try{if(c){let e=this.client.core.pairing.pairings.get(c);this.client.logger.warn("connect() with existing pairing topic is deprecated and will be removed in the next major release."),l=e.active}}catch(e){throw this.client.logger.error(`connect() -> pairing.get(${c}) failed`),e}if(!c||!l){let{topic:e,uri:t}=await this.client.core.pairing.create();c=e,u=t}if(!c){let{message:e}=pP("NO_MATCHING_KEY",`connect() pairing topic: ${c}`);throw Error(e)}let d=await this.client.core.crypto.generateKeyPair(),f=wv.wc_sessionPropose.req.ttl||I.FIVE_MINUTES,h=cV(f),p=w$(wU(wU({requiredNamespaces:n,optionalNamespaces:i,relays:a??[{protocol:gd}],proposer:{publicKey:d,metadata:this.client.metadata},expiryTimestamp:h,pairingTopic:c},o&&{sessionProperties:o}),s&&{scopedProperties:s}),{id:yC()}),y=cG("session_connect",p.id),{reject:g,resolve:m,done:b}=cU(f,wy),v=({id:e})=>{e===p.id&&(this.client.events.off("proposal_expire",v),this.pendingSessions.delete(p.id),this.events.emit(y,{error:{message:wy,code:0}}))};return this.client.events.on("proposal_expire",v),this.events.once(y,({error:e,session:t})=>{this.client.events.off("proposal_expire",v),e?g(e):t&&m(t)}),await this.sendRequest({topic:c,method:"wc_sessionPropose",params:p,throwOnFailedPublish:!0,clientRpcId:p.id}),await this.setProposal(p.id,p),{uri:u,approval:b}}),wK(this,"pair",async e=>{this.isInitialized(),await this.confirmOnlineStateOrThrow();try{return await this.client.core.pairing.pair(e)}catch(e){throw this.client.logger.error("pair() failed"),e}}),wK(this,"approve",async e=>{var t,r,n;let i=this.client.core.eventClient.createEvent({properties:{topic:null==(t=e?.id)?void 0:t.toString(),trace:[gG.session_approve_started]}});try{this.isInitialized(),await this.confirmOnlineStateOrThrow()}catch(e){throw i.setError(gW.no_internet_connection),e}try{await this.isValidProposalId(e?.id)}catch(t){throw this.client.logger.error(`approve() -> proposal.get(${e?.id}) failed`),i.setError(gW.proposal_not_found),t}try{await this.isValidApprove(e)}catch(e){throw this.client.logger.error("approve() -> isValidApprove() failed"),i.setError(gW.session_approve_namespace_validation_failure),e}let{id:o,relayProtocol:s,namespaces:a,sessionProperties:c,scopedProperties:u,sessionConfig:l}=e,d=this.client.proposal.get(o);this.client.core.eventClient.deleteEvent({eventId:i.eventId});let{pairingTopic:f,proposer:h,requiredNamespaces:p,optionalNamespaces:y}=d,g=null==(r=this.client.core.eventClient)?void 0:r.getEvent({topic:f});g||(g=null==(n=this.client.core.eventClient)?void 0:n.createEvent({type:gG.session_approve_started,properties:{topic:f,trace:[gG.session_approve_started,gG.session_namespaces_validation_success]}}));let m=await this.client.core.crypto.generateKeyPair(),b=h.publicKey,v=await this.client.core.crypto.generateSharedKey(m,b),w=wU(wU(wU({relay:{protocol:s??"irn"},namespaces:a,controller:{publicKey:m,metadata:this.client.metadata},expiry:cV(wm)},c&&{sessionProperties:c}),u&&{scopedProperties:u}),l&&{sessionConfig:l}),_=gw.relay;g.addTrace(gG.subscribing_session_topic);try{await this.client.core.relayer.subscribe(v,{transportType:_})}catch(e){throw g.setError(gW.subscribe_session_topic_failure),e}g.addTrace(gG.subscribe_session_topic_success);let E=w$(wU({},w),{topic:v,requiredNamespaces:p,optionalNamespaces:y,pairingTopic:f,acknowledged:!1,self:w.controller,peer:{publicKey:h.publicKey,metadata:h.metadata},controller:m,transportType:gw.relay});await this.client.session.set(v,E),g.addTrace(gG.store_session);try{g.addTrace(gG.publishing_session_settle),await this.sendRequest({topic:v,method:"wc_sessionSettle",params:w,throwOnFailedPublish:!0}).catch(e=>{throw g?.setError(gW.session_settle_publish_failure),e}),g.addTrace(gG.session_settle_publish_success),g.addTrace(gG.publishing_session_approve),await this.sendResult({id:o,topic:f,result:{relay:{protocol:s??"irn"},responderPublicKey:m},throwOnFailedPublish:!0}).catch(e=>{throw g?.setError(gW.session_approve_publish_failure),e}),g.addTrace(gG.session_approve_publish_success)}catch(e){throw this.client.logger.error(e),this.client.session.delete(v,pM("USER_DISCONNECTED")),await this.client.core.relayer.unsubscribe(v),e}return this.client.core.eventClient.deleteEvent({eventId:g.eventId}),await this.client.core.pairing.updateMetadata({topic:f,metadata:h.metadata}),await this.client.proposal.delete(o,pM("USER_DISCONNECTED")),await this.client.core.pairing.activate({topic:f}),await this.setExpiry(v,cV(wm)),{topic:v,acknowledged:()=>Promise.resolve(this.client.session.get(v))}}),wK(this,"reject",async e=>{let t;this.isInitialized(),await this.confirmOnlineStateOrThrow();try{await this.isValidReject(e)}catch(e){throw this.client.logger.error("reject() -> isValidReject() failed"),e}let{id:r,reason:n}=e;try{t=this.client.proposal.get(r).pairingTopic}catch(e){throw this.client.logger.error(`reject() -> proposal.get(${r}) failed`),e}
vendor: 4,971 bytes, line 24
24t&&(await this.sendError({id:r,topic:t,error:n,rpcOpts:wv.wc_sessionPropose.reject}),await this.client.proposal.delete(r,pM("USER_DISCONNECTED")))}),wK(this,"update",async e=>{this.isInitialized(),await this.confirmOnlineStateOrThrow();try{await this.isValidUpdate(e)}catch(e){throw this.client.logger.error("update() -> isValidUpdate() failed"),e}let{topic:t,namespaces:r}=e,{done:n,resolve:i,reject:o}=cU(),s=yC(),a=yD().toString(),c=this.client.session.get(t).namespaces;return this.events.once(cG("session_update",s),({error:e})=>{e?o(e):i()}),await this.client.session.update(t,{namespaces:r}),await this.sendRequest({topic:t,method:"wc_sessionUpdate",params:{namespaces:r},throwOnFailedPublish:!0,clientRpcId:s,relayRpcId:a}).catch(e=>{this.client.logger.error(e),this.client.session.update(t,{namespaces:c}),o(e)}),{acknowledged:n}}),wK(this,"extend",async e=>{this.isInitialized(),await this.confirmOnlineStateOrThrow();try{await this.isValidExtend(e)}catch(e){throw this.client.logger.error("extend() -> isValidExtend() failed"),e}let{topic:t}=e,r=yC(),{done:n,resolve:i,reject:o}=cU();return this.events.once(cG("session_extend",r),({error:e})=>{e?o(e):i()}),await this.setExpiry(t,cV(wm)),this.sendRequest({topic:t,method:"wc_sessionExtend",params:{},clientRpcId:r,throwOnFailedPublish:!0}).catch(e=>{o(e)}),{acknowledged:n}}),wK(this,"request",async e=>{this.isInitialized();try{await this.isValidRequest(e)}catch(e){throw this.client.logger.error("request() -> isValidRequest() failed"),e}let{chainId:t,request:r,topic:n,expiry:i=wv.wc_sessionRequest.req.ttl}=e,o=this.client.session.get(n);o?.transportType===gw.relay&&await this.confirmOnlineStateOrThrow();let s=yC(),a=yD().toString(),{done:c,resolve:u,reject:l}=cU(i,"Request expired. Please try again.");this.events.once(cG("session_request",s),({error:e,result:t})=>{e?l(e):u(t)});let d="wc_sessionRequest",f=this.getAppLinkIfEnabled(o.peer.metadata,o.transportType);if(f)return await this.sendRequest({clientRpcId:s,relayRpcId:a,topic:n,method:d,params:{request:w$(wU({},r),{expiryTimestamp:cV(i)}),chainId:t},expiry:i,throwOnFailedPublish:!0,appLink:f}).catch(e=>l(e)),this.client.events.emit("session_request_sent",{topic:n,request:r,chainId:t,id:s}),await c();let h={request:w$(wU({},r),{expiryTimestamp:cV(i)}),chainId:t};return await Promise.all([new Promise(async e=>{await this.sendRequest({clientRpcId:s,relayRpcId:a,topic:n,method:d,params:h,expiry:i,throwOnFailedPublish:!0,tvf:this.getTVFParams(s,h)}).catch(e=>l(e)),this.client.events.emit("session_request_sent",{topic:n,request:r,chainId:t,id:s}),e()}),new Promise(async e=>{var t;if(!(null!=(t=o.sessionConfig)&&t.disableDeepLink)){let e=await cX(this.client.core.storage,wh);await cJ({id:s,topic:n,wcDeepLink:e})}e()}),c()]).then(e=>e[2])}),wK(this,"respond",async e=>{this.isInitialized(),await this.isValidRespond(e);let{topic:t,response:r}=e,{id:n}=r,i=this.client.session.get(t);i.transportType===gw.relay&&await this.confirmOnlineStateOrThrow();let o=this.getAppLinkIfEnabled(i.peer.metadata,i.transportType);yZ(r)?await this.sendResult({id:n,topic:t,result:r.result,throwOnFailedPublish:!0,appLink:o}):yY(r)&&await this.sendError({id:n,topic:t,error:r.error,appLink:o}),this.cleanupAfterResponse(e)}),wK(this,"ping",async e=>{this.isInitialized(),await this.confirmOnlineStateOrThrow();try{await this.isValidPing(e)}catch(e){throw this.client.logger.error("ping() -> isValidPing() failed"),e}let{topic:t}=e;if(this.client.session.keys.includes(t)){let e=yC(),r=yD().toString(),{done:n,resolve:i,reject:o}=cU();this.events.once(cG("session_ping",e),({error:e})=>{e?o(e):i()}),await Promise.all([this.sendRequest({topic:t,method:"wc_sessionPing",params:{},throwOnFailedPublish:!0,clientRpcId:e,relayRpcId:r}),n()])}else this.client.core.pairing.pairings.keys.includes(t)&&(this.client.logger.warn("ping() on pairing topic is deprecated and will be removed in the next major release."),await this.client.core.pairing.ping({topic:t}))}),wK(this,"emit",async e=>{this.isInitialized(),await this.confirmOnlineStateOrThrow(),await this.isValidEmit(e);let{topic:t,event:r,chainId:n}=e,i=yD().toString(),o=yC();await this.sendRequest({topic:t,method:"wc_sessionEvent",params:{event:r,chainId:n},throwOnFailedPublish:!0,relayRpcId:i,clientRpcId:o})}),wK(this,"disconnect",async e=>{this.isInitialized(),await this.confirmOnlineStateOrThrow(),await this.isValidDisconnect(e);let{topic:t}=e;if(this.client.session.keys.includes(t))await this.sendRequest({topic:t,method:"wc_sessionDelete",params:pM("USER_DISCONNECTED"),throwOnFailedPublish:!0}),await this.deleteSession({topic:t,emitEvent:!1});else if(this.client.core.pairing.pairings.keys.includes(t))await this.client.core.pairing.disconnect({topic:t});else{let{message:e}=pP("MISMATCHED_TOPIC",`Session or pairing topic not found: ${t}`);throw Error(e)}}),wK(this,"find",e=>(this.isInitialized(),this.client.session.getAll().filter(t=>pR(t,e)))),wK(this,"getPendingSessionRequests",()=>
24this.client.pendingRequest.getAll()),wK(this,"authenticate",async(e,t)=>{var r;let n;this.isInitialized(),this.isValidAuthenticate(e);let i=t&&this.client.core.linkModeSupportedApps.includes(t)&&(null==(r=this.client.metadata.redirect)?void 0:r.linkMode),o=i?gw.link_mode:gw.relay;o===gw.relay&&await this.confirmOnlineStateOrThrow();let{chains:s,statement:a="",uri:c,domain:u,nonce:l,type:d,exp:f,nbf:h,methods:p=[],expiry:y}=e,g=[...e.resources||[]],{topic:m,uri:b}=await this.client.core.pairing.create({methods:["wc_sessionAuthenticate"],transportType:o});this.client.logger.info({message:"Generated new pairing",pairing:{topic:m,uri:b}});let v=await this.client.core.crypto.generateKeyPair(),w=hV(v);if(await Promise.all([this.client.auth.authKeys.set(wN,{responseTopic:w,publicKey:v}),this.client.auth.pairingTopics.set(w,{topic:w,pairingTopic:m})]),await this.client.core.relayer.subscribe(w,{transportType:o}),this.client.logger.info(`sending request to new pairing topic: ${m}`),p.length>0){let{namespace:e}=co(s[0]),t=de(e,"request",p);dc(g)&&(t=dr(t,g.pop())),g.push(t)}let _=y&&y>wv.wc_sessionAuthenticate.req.ttl?y:wv.wc_sessionAuthenticate.req.ttl,E={authPayload:{type:d??"caip122",chains:s,statement:a,aud:c,domain:u,version:"1",nonce:l,iat:new Date().toISOString(),exp:f,nbf:h,resources:g},requester:{publicKey:v,metadata:this.client.metadata},expiryTimestamp:cV(_)},S={requiredNamespaces:{},optionalNamespaces:{eip155:{chains:s,methods:[...new Set(["personal_sign",...p])],events:["chainChanged","accountsChanged"]}},relays:[{protocol:"irn"}],pairingTopic:m,proposer:{publicKey:v,metadata:this.client.metadata},expiryTimestamp:cV(wv.wc_sessionPropose.req.ttl),id:yC()},{done:x,resolve:A,reject:I}=cU(_,"Request expired"),O=yC(),T=cG("session_connect",S.id),P=cG("session_request",O),M=async({error:e,session:t})=>{this.events.off(P,N),e?I(e):t&&A({session:t})},N=async e=>{var r,n,i;let s;if(await this.deletePendingAuthRequest(O,{message:"fulfilled",code:0}),e.error){let t=pM("WC_METHOD_UNSUPPORTED","wc_sessionAuthenticate");return e.error.code===t.code?void 0:(this.events.off(T,M),I(e.error.message))}await this.deleteProposal(S.id),this.events.off(T,M);let{cacaos:a,responder:c}=e.result,u=[],l=[];for(let e of a){await l1({cacao:e,projectId:this.client.core.projectId})||(this.client.logger.error(e,"Signature verification failed"),I(pM("SESSION_SETTLEMENT_FAILED","Signature verification failed")));let{p:t}=e,r=dc(t.resources),n=[lQ(t.iss)],i=l0(t.iss);if(r){let e=ds(r),t=da(r);u.push(...e),n.push(...t)}for(let e of n)l.push(`${e}:${i}`)}let d=await this.client.core.crypto.generateSharedKey(v,c.publicKey);u.length>0&&(s={topic:d,acknowledged:!0,self:{publicKey:v,metadata:this.client.metadata},peer:c,controller:c.publicKey,expiry:cV(wm),requiredNamespaces:{},optionalNamespaces:{},relay:{protocol:"irn"},pairingTopic:m,namespaces:pA([...new Set(u)],[...new Set(l)]),transportType:o},await this.client.core.relayer.subscribe(d,{transportType:o}),await this.client.session.set(d,s),m&&await this.client.core.pairing.updateMetadata({topic:m,metadata:c.metadata}),s=this.client.session.get(d)),null!=(r=this.client.metadata.redirect)&&r.linkMode&&null!=(n=c.metadata.redirect)&&n.linkMode&&null!=(i=c.metadata.redirect)&&i.universal&&t&&(this.client.core.addLinkModeSupportedApp(c.metadata.redirect.universal),this.client.session.update(d,{transportType:gw.link_mode})),A({auths:a,session:s})};this.events.once(T,M),this.events.once(P,N);try{if(i){let e=yj("wc_sessionAuthenticate",E,O);this.client.core.history.set(m,e);let r=await this.client.core.crypto.encode("",e,{type:hL,encoding:hC});n=pa(t,m,r)}else await Promise.all([this.sendRequest({topic:m,method:"wc_sessionAuthenticate",params:E,expiry:e.expiry,throwOnFailedPublish:!0,clientRpcId:O}),this.sendRequest({topic:m,method:"wc_sessionPropose",params:S,expiry:wv.wc_sessionPropose.req.ttl,throwOnFailedPublish:!0,clientRpcId:S.id})])}catch(e){throw this.events.off(T,M),this.events.off(P,N),e}return await this.setProposal(S.id,S),await this.setAuthRequest(O,{request:w$(wU({},E),{verifyContext:{}}),pairingTopic:m,transportType:o}),{uri:n??b,response:x}}),wK(this,"approveSessionAuthenticate",async e=>{let t;let{id:r,auths:n}=e,i=this.client.core.eventClient.createEvent({properties:{topic:r.toString(),trace:[gJ.authenticated_session_approve_started]}});try{this.isInitialized()}catch(e){throw i.setError(gZ.no_internet_connection),e}let o=this.getPendingAuthRequest(r);if(!o)throw i.setError(gZ.authenticated_session_pending_request_not_found),Error(`Could not find pending auth request with id ${r}`);let s=o.transportType||gw.relay;s===gw.relay&&await this.confirmOnlineStateOrThrow();let a=o.requester.publicKey,c=await this.client.core.crypto.generateKeyPair(),u=hV(a),l={type:hR,receiverPublicKey:a,senderPublicKey:c},d=[],f=[];for(let e of n){if(!await l1({cacao:e,projectId:this.client.core.projectId})){i.setError(gZ.invalid_cacao);let e=pM("SESSION_SETTLEMENT_FAILED","Signature verification failed");
24throw await this.sendError({id:r,topic:u,error:e,encodeOpts:l}),Error(e.message)}i.addTrace(gJ.cacaos_verified);let{p:t}=e,n=dc(t.resources),o=[lQ(t.iss)],s=l0(t.iss);if(n){let e=ds(n),t=da(n);d.push(...e),o.push(...t)}for(let e of o)f.push(`${e}:${s}`)}let h=await this.client.core.crypto.generateSharedKey(c,a);if(i.addTrace(gJ.create_authenticated_session_topic),d?.length>0){t={topic:h,acknowledged:!0,self:{publicKey:c,metadata:this.client.metadata},peer:{publicKey:a,metadata:o.requester.metadata},controller:a,expiry:cV(wm),authentication:n,requiredNamespaces:{},optionalNamespaces:{},relay:{protocol:"irn"},pairingTopic:o.pairingTopic,namespaces:pA([...new Set(d)],[...new Set(f)]),transportType:s},i.addTrace(gJ.subscribing_authenticated_session_topic);try{await this.client.core.relayer.subscribe(h,{transportType:s})}catch(e){throw i.setError(gZ.subscribe_authenticated_session_topic_failure),e}i.addTrace(gJ.subscribe_authenticated_session_topic_success),await this.client.session.set(h,t),i.addTrace(gJ.store_authenticated_session),await this.client.core.pairing.updateMetadata({topic:o.pairingTopic,metadata:o.requester.metadata})}i.addTrace(gJ.publishing_authenticated_session_approve);try{await this.sendResult({topic:u,id:r,result:{cacaos:n,responder:{publicKey:c,metadata:this.client.metadata}},encodeOpts:l,throwOnFailedPublish:!0,appLink:this.getAppLinkIfEnabled(o.requester.metadata,s)})}catch(e){throw i.setError(gZ.authenticated_session_approve_publish_failure),e}return await this.client.auth.requests.delete(r,{message:"fulfilled",code:0}),await this.client.core.pairing.activate({topic:o.pairingTopic}),this.client.core.eventClient.deleteEvent({eventId:i.eventId}),{session:t}}),wK(this,"rejectSessionAuthenticate",async e=>{this.isInitialized();let{id:t,reason:r}=e,n=this.getPendingAuthRequest(t);if(!n)throw Error(`Could not find pending auth request with id ${t}`);n.transportType===gw.relay&&await this.confirmOnlineStateOrThrow();let i=n.requester.publicKey,o=await this.client.core.crypto.generateKeyPair(),s=hV(i),a={type:hR,receiverPublicKey:i,senderPublicKey:o};await this.sendError({id:t,topic:s,error:r,encodeOpts:a,rpcOpts:wv.wc_sessionAuthenticate.reject,appLink:this.getAppLinkIfEnabled(n.requester.metadata,n.transportType)}),await this.client.auth.requests.delete(t,{message:"rejected",code:0}),await this.client.proposal.delete(t,pM("USER_DISCONNECTED"))}),wK(this,"formatAuthMessage",e=>{this.isInitialized();let{request:t,iss:r}=e;return l2(t,r)}),wK(this,"processRelayMessageCache",()=>{setTimeout(async()=>{if(0!==this.relayMessageCache.length)for(;this.relayMessageCache.length>0;)try{let e=this.relayMessageCache.shift();e&&await this.onRelayMessage(e)}catch(e){this.client.logger.error(e)}},50)}),wK(this,"cleanupDuplicatePairings",async e=>{if(e.pairingTopic)try{let t=this.client.core.pairing.pairings.get(e.pairingTopic),r=this.client.core.pairing.pairings.getAll().filter(r=>{var n,i;return(null==(n=r.peerMetadata)?void 0:n.url)&&(null==(i=r.peerMetadata)?void 0:i.url)===e.peer.metadata.url&&r.topic&&r.topic!==t.topic});if(0===r.length)return;this.client.logger.info(`Cleaning up ${r.length} duplicate pairing(s)`),await Promise.all(r.map(e=>this.client.core.pairing.disconnect({topic:e.topic}))),this.client.logger.info("Duplicate pairings clean up finished")}catch(e){this.client.logger.error(e)}}),wK(this,"deleteSession",async e=>{var t;let{topic:r,expirerHasDeleted:n=!1,emitEvent:i=!0,id:o=0}=e,{self:s}=this.client.session.get(r);await this.client.core.relayer.unsubscribe(r),await this.client.session.delete(r,pM("USER_DISCONNECTED")),this.addToRecentlyDeleted(r,"session"),this.client.core.crypto.keychain.has(s.publicKey)&&await this.client.core.crypto.deleteKeyPair(s.publicKey),this.client.core.crypto.keychain.has(r)&&await this.client.core.crypto.deleteSymKey(r),n||this.client.core.expirer.del(r),this.client.core.storage.removeItem(wh).catch(e=>this.client.logger.warn(e)),this.getPendingSessionRequests().forEach(e=>{e.topic===r&&this.deletePendingSessionRequest(e.id,pM("USER_DISCONNECTED"))}),r===(null==(t=this.sessionRequestQueue.queue[0])?void 0:t.topic)&&(this.sessionRequestQueue.state=w_.idle),i&&this.client.events.emit("session_delete",{id:o,topic:r})}),wK(this,"deleteProposal",async(e,t)=>{if(t)try{let t=this.client.proposal.get(e),r=this.client.core.eventClient.getEvent({topic:t.pairingTopic});r?.setError(gW.proposal_expired)}catch{}await Promise.all([this.client.proposal.delete(e,pM("USER_DISCONNECTED")),t?Promise.resolve():this.client.core.expirer.del(e)]),this.addToRecentlyDeleted(e,"proposal")}),wK(this,"deletePendingSessionRequest",async(e,t,r=!1)=>
24{await Promise.all([this.client.pendingRequest.delete(e,t),r?Promise.resolve():this.client.core.expirer.del(e)]),this.addToRecentlyDeleted(e,"request"),this.sessionRequestQueue.queue=this.sessionRequestQueue.queue.filter(t=>t.id!==e),r&&(this.sessionRequestQueue.state=w_.idle,this.client.events.emit("session_request_expire",{id:e}))}),wK(this,"deletePendingAuthRequest",async(e,t,r=!1)=>{await Promise.all([this.client.auth.requests.delete(e,t),r?Promise.resolve():this.client.core.expirer.del(e)])}),wK(this,"setExpiry",async(e,t)=>{this.client.session.keys.includes(e)&&(this.client.core.expirer.set(e,t),await this.client.session.update(e,{expiry:t}))}),wK(this,"setProposal",async(e,t)=>{this.client.core.expirer.set(e,cV(wv.wc_sessionPropose.req.ttl)),await this.client.proposal.set(e,t)}),wK(this,"setAuthRequest",async(e,t)=>{let{request:r,pairingTopic:n,transportType:i=gw.relay}=t;this.client.core.expirer.set(e,r.expiryTimestamp),await this.client.auth.requests.set(e,{authPayload:r.authPayload,requester:r.requester,expiryTimestamp:r.expiryTimestamp,id:e,pairingTopic:n,verifyContext:r.verifyContext,transportType:i})}),wK(this,"setPendingSessionRequest",async e=>{let{id:t,topic:r,params:n,verifyContext:i}=e,o=n.request.expiryTimestamp||cV(wv.wc_sessionRequest.req.ttl);this.client.core.expirer.set(t,o),await this.client.pendingRequest.set(t,{id:t,topic:r,params:n,verifyContext:i})}),wK(this,"sendRequest",async e=>{let t,n;let{topic:i,method:o,params:s,expiry:a,relayRpcId:c,clientRpcId:u,throwOnFailedPublish:l,appLink:d,tvf:f}=e,h=yj(o,s,u),p=!!d;try{let e=p?hC:hk;t=await this.client.core.crypto.encode(i,h,{encoding:e})}catch(e){throw await this.cleanup(),this.client.logger.error(`sendRequest() -> core.crypto.encode() for topic ${i} failed`),e}if(wx.includes(o)){let e=hH(JSON.stringify(h)),r=hH(t);n=await this.client.core.verify.register({id:r,decryptedId:e})}let y=wv[o].req;if(y.attestation=n,a&&(y.ttl=a),c&&(y.id=c),this.client.core.history.set(i,h),p){let e=pa(d,i,t);await r.g.Linking.openURL(e,this.client.name)}else{let e=wv[o].req;a&&(e.ttl=a),c&&(e.id=c),e.tvf=w$(wU({},f),{correlationId:h.id}),l?(e.internal=w$(wU({},e.internal),{throwOnFailedPublish:!0}),await this.client.core.relayer.publish(i,t,e)):this.client.core.relayer.publish(i,t,e).catch(e=>this.client.logger.error(e))}return h.id}),wK(this,"sendResult",async e=>{let t,n,i;let{id:o,topic:s,result:a,throwOnFailedPublish:c,encodeOpts:u,appLink:l}=e,d=yR(o,a),f=l&&"u">typeof(null==r.g?void 0:r.g.Linking);try{let e=f?hC:hk;t=await this.client.core.crypto.encode(s,d,w$(wU({},u||{}),{encoding:e}))}catch(e){throw await this.cleanup(),this.client.logger.error(`sendResult() -> core.crypto.encode() for topic ${s} failed`),e}try{let e=(n=await this.client.core.history.get(s,o)).request;try{i=this.getTVFParams(o,e.params,a)}catch(e){this.client.logger.warn("sendResult() -> getTVFParams() failed",e)}}catch(e){throw this.client.logger.error(`sendResult() -> history.get(${s}, ${o}) failed`),e}if(f){let e=pa(l,s,t);await r.g.Linking.openURL(e,this.client.name)}else{let e=wv[n.request.method].res;e.tvf=w$(wU({},i),{correlationId:o}),c?(e.internal=w$(wU({},e.internal),{throwOnFailedPublish:!0}),await this.client.core.relayer.publish(s,t,e)):this.client.core.relayer.publish(s,t,e).catch(e=>this.client.logger.error(e))}await this.client.core.history.resolve(d)}),wK(this,"sendError",async e=>{let t,n;let{id:i,topic:o,error:s,encodeOpts:a,rpcOpts:c,appLink:u}=e,l=yL(i,s),d=u&&"u">typeof(null==r.g?void 0:r.g.Linking);try{let e=d?hC:hk;t=await this.client.core.crypto.encode(o,l,w$(wU({},a||{}),{encoding:e}))}catch(e){throw await this.cleanup(),this.client.logger.error(`sendError() -> core.crypto.encode() for topic ${o} failed`),e}try{n=await this.client.core.history.get(o,i)}catch(e){throw this.client.logger.error(`sendError() -> history.get(${o}, ${i}) failed`),e}if(d){let e=pa(u,o,t);await r.g.Linking.openURL(e,this.client.name)}else{let e=n.request.method,r=c||wv[e].res;this.client.core.relayer.publish(o,t,r)}await this.client.core.history.resolve(l)}),wK(this,"cleanup",async()=>{let e=[],t=[];
vendor: 1,320 bytes, line 24
24this.client.session.getAll().forEach(t=>{let r=!1;cH(t.expiry)&&(r=!0),this.client.core.crypto.keychain.has(t.topic)||(r=!0),r&&e.push(t.topic)}),this.client.proposal.getAll().forEach(e=>{cH(e.expiryTimestamp)&&t.push(e.id)}),await Promise.all([...e.map(e=>this.deleteSession({topic:e})),...t.map(e=>this.deleteProposal(e))])}),wK(this,"onProviderMessageEvent",async e=>{!this.initialized||this.relayMessageCache.length>0?this.relayMessageCache.push(e):await this.onRelayMessage(e)}),wK(this,"onRelayEventRequest",async e=>{this.requestQueue.queue.push(e),await this.processRequestsQueue()}),wK(this,"processRequestsQueue",async()=>{if(this.requestQueue.state===w_.active){this.client.logger.info("Request queue already active, skipping...");return}for(this.client.logger.info(`Request queue starting with ${this.requestQueue.queue.length} requests`);this.requestQueue.queue.length>0;){this.requestQueue.state=w_.active;let e=this.requestQueue.queue.shift();if(e)try{await this.processRequest(e)}catch(e){this.client.logger.warn(e)}}this.requestQueue.state=w_.idle}),wK(this,"processRequest",async e=>{let{topic:t,payload:r,attestation:n,transportType:i,encryptedId:o}=e,s=r.method;if(!this.shouldIgnorePairingRequest({topic:t,requestMethod:s}))switch(s){case"wc_sessionPropose":return await this.onSessionProposeRequest
24({topic:t,payload:r,attestation:n,encryptedId:o});case"wc_sessionSettle":return await this.onSessionSettleRequest(t,r);case"wc_sessionUpdate":return await this.onSessionUpdateRequest(t,r);case"wc_sessionExtend":return await this.onSessionExtendRequest(t,r);case"wc_sessionPing":return await this.onSessionPingRequest(t,r);case"wc_sessionDelete":return await this.onSessionDeleteRequest(t,r);case"wc_sessionRequest":return await this.onSessionRequest({topic:t,payload:r,attestation:n,encryptedId:o,transportType:i});case"wc_sessionEvent":return await this.onSessionEventRequest(t,r);case"wc_sessionAuthenticate":return await this.onSessionAuthenticateRequest({topic:t,payload:r,attestation:n,encryptedId:o,transportType:i});default:return this.client.logger.info(`Unsupported request method ${s}`)}}),wK(this,"onRelayEventResponse",async e=>{let{topic:t,payload:r,transportType:n}=e,i=(await this.client.core.history.get(t,r.id)).request.method;switch(i){case"wc_sessionPropose":return this.onSessionProposeResponse(t,r,n);case"wc_sessionSettle":return this.onSessionSettleResponse(t,r);case"wc_sessionUpdate":return this.onSessionUpdateResponse(t,r);case"wc_sessionExtend":return this.onSessionExtendResponse(t,r);case"wc_sessionPing":return this.onSessionPingResponse(t,r);case"wc_sessionRequest":return this.onSessionRequestResponse(t,r);case"wc_sessionAuthenticate":return this.onSessionAuthenticateResponse(t,r);default:return this.client.logger.info(`Unsupported response method ${i}`)}}),wK(this,"onRelayEventUnknownPayload",e=>{let{topic:t}=e,{message:r}=pP("MISSING_OR_INVALID",`Decoded payload on topic ${t} is not identifiable as a JSON-RPC request or a response.`);throw Error(r)}),wK(this,"shouldIgnorePairingRequest",e=>{let{topic:t,requestMethod:r}=e,n=this.expectedPairingMethodMap.get(t);return!(!n||n.includes(r))&&!!(n.includes("wc_sessionAuthenticate")&&this.client.events.listenerCount("session_authenticate")>0)}),wK(this,"onSessionProposeRequest",async e=>{let{topic:t,payload:r,attestation:n,encryptedId:i}=e,{params:o,id:s}=r;try{let e=this.client.core.eventClient.getEvent({topic:t});0===this.client.events.listenerCount("session_proposal")&&(console.warn("No listener for session_proposal event"),e?.setError(gH.proposal_listener_not_found)),this.isValidConnect(wU({},r.params));let a=o.expiryTimestamp||cV(wv.wc_sessionPropose.req.ttl),c=wU({id:s,pairingTopic:t,expiryTimestamp:a},o);await this.setProposal(s,c);let u=await this.getVerifyContext({attestationId:n,hash:hH(JSON.stringify(r)),encryptedId:i,metadata:c.proposer.metadata});e?.addTrace(gV.emit_session_proposal),this.client.events.emit("session_proposal",{id:s,params:c,verifyContext:u})}catch(e){await this.sendError({id:s,topic:t,error:e,rpcOpts:wv.wc_sessionPropose.autoReject}),this.client.logger.error(e)}}),wK(this,"onSessionProposeResponse",async(e,t,r)=>{let{id:n}=t;if(yZ(t)){let{result:i}=t;this.client.logger.trace({type:"method",method:"onSessionProposeResponse",result:i});let o=this.client.proposal.get(n);this.client.logger.trace({type:"method",method:"onSessionProposeResponse",proposal:o});let s=o.proposer.publicKey;this.client.logger.trace({type:"method",method:"onSessionProposeResponse",selfPublicKey:s});let a=i.responderPublicKey;this.client.logger.trace({type:"method",method:"onSessionProposeResponse",peerPublicKey:a});let c=await this.client.core.crypto.generateSharedKey(s,a);this.pendingSessions.set(n,{sessionTopic:c,pairingTopic:e,proposalId:n,publicKey:s});let u=await this.client.core.relayer.subscribe(c,{transportType:r});this.client.logger.trace({type:"method",method:"onSessionProposeResponse",subscriptionId:u}),await this.client.core.pairing.activate({topic:e})}else if(yY(t)){await this.client.proposal.delete(n,pM("USER_DISCONNECTED"));let e=cG("session_connect",n);if(0===this.events.listenerCount(e))throw Error(`emitting ${e} without any listeners, 954`);this.events.emit(e,{error:t.error})}}),wK(this,"onSessionSettleRequest",async(e,t)=>{let{id:r,params:n}=t;try{this.isValidSessionSettleRequest(n);let{relay:r,controller:i,expiry:o,namespaces:s,sessionProperties:a,scopedProperties:c,sessionConfig:u}=t.params,l=[...this.pendingSessions.values()].find(t=>t.sessionTopic===e);if(!l)return this.client.logger.error(`Pending session not found for topic ${e}`);let d=this.client.proposal.get(l.proposalId),f=w$(wU(wU(wU({topic:e,relay:r,expiry:o,namespaces:s,acknowledged:!0,pairingTopic:l.pairingTopic,requiredNamespaces:d.requiredNamespaces,optionalNamespaces:d.optionalNamespaces,controller:i.publicKey,self:{publicKey:l.publicKey,metadata:this.client.metadata},peer:{publicKey:i.publicKey,metadata:i.metadata}},a&&{sessionProperties:a}),c&&{scopedProperties:c}),u&&{sessionConfig:u}),{transportType:gw.relay});await this.client.session.set(f.topic,f),await this.setExpiry(f.topic,f.expiry),await this.client.core.pairing.updateMetadata({topic:l.pairingTopic,metadata:f.peer.metadata}),this.client.events.emit("session_connect",{session:f}),this.events.emit(cG("session_connect",l.proposalId),{session:f}),this.pendingSessions.delete(l.proposalId),this.deleteProposal(l.proposalId,!1),this.cleanupDupl
24icatePairings(f),await this.sendResult({id:t.id,topic:e,result:!0,throwOnFailedPublish:!0})}catch(t){await this.sendError({id:r,topic:e,error:t}),this.client.logger.error(t)}}),wK(this,"onSessionSettleResponse",async(e,t)=>{let{id:r}=t;yZ(t)?(await this.client.session.update(e,{acknowledged:!0}),this.events.emit(cG("session_approve",r),{})):yY(t)&&(await this.client.session.delete(e,pM("USER_DISCONNECTED")),this.events.emit(cG("session_approve",r),{error:t.error}))}),wK(this,"onSessionUpdateRequest",async(e,t)=>{let{params:r,id:n}=t;try{let t=`${e}_session_update`,i=yh.get(t);if(i&&this.isRequestOutOfSync(i,n)){this.client.logger.warn(`Discarding out of sync request - ${n}`),this.sendError({id:n,topic:e,error:pM("INVALID_UPDATE_REQUEST")});return}this.isValidUpdate(wU({topic:e},r));try{yh.set(t,n),await this.client.session.update(e,{namespaces:r.namespaces}),await this.sendResult({id:n,topic:e,result:!0,throwOnFailedPublish:!0})}catch(e){throw yh.delete(t),e}this.client.events.emit("session_update",{id:n,topic:e,params:r})}catch(t){await this.sendError({id:n,topic:e,error:t}),this.client.logger.error(t)}}),wK(this,"isRequestOutOfSync",(e,t)=>t.toString().slice(0,-3)<e.toString().slice(0,-3)),wK(this,"onSessionUpdateResponse",(e,t)=>{let{id:r}=t,n=cG("session_update",r);if(0===this.events.listenerCount(n))throw Error(`emitting ${n} without any listeners`);yZ(t)?this.events.emit(cG("session_update",r),{}):yY(t)&&this.events.emit(cG("session_update",r),{error:t.error})}),wK(this,"onSessionExtendRequest",async(e,t)=>{let{id:r}=t;try{this.isValidExtend({topic:e}),await this.setExpiry(e,cV(wm)),await this.sendResult({id:r,topic:e,result:!0,throwOnFailedPublish:!0}),this.client.events.emit("session_extend",{id:r,topic:e})}catch(t){await this.sendError({id:r,topic:e,error:t}),this.client.logger.error(t)}}),wK(this,"onSessionExtendResponse",(e,t)=>{let{id:r}=t,n=cG("session_extend",r);if(0===this.events.listenerCount(n))throw Error(`emitting ${n} without any listeners`);yZ(t)?this.events.emit(cG("session_extend",r),{}):yY(t)&&this.events.emit(cG("session_extend",r),{error:t.error})}),wK(this,"onSessionPingRequest",async(e,t)=>{let{id:r}=t;try{this.isValidPing({topic:e}),await this.sendResult({id:r,topic:e,result:!0,throwOnFailedPublish:!0}),this.client.events.emit("session_ping",{id:r,topic:e})}catch(t){await this.sendError({id:r,topic:e,error:t}),this.client.logger.error(t)}}),wK(this,"onSessionPingResponse",(e,t)=>{let{id:r}=t,n=cG("session_ping",r);setTimeout(()=>{if(0===this.events.listenerCount(n))throw Error(`emitting ${n} without any listeners 2176`);yZ(t)?this.events.emit(cG("session_ping",r),{}):yY(t)&&this.events.emit(cG("session_ping",r),{error:t.error})},500)}),wK(this,"onSessionDeleteRequest",async(e,t)=>{let{id:r}=t;try{this.isValidDisconnect({topic:e,reason:t.params}),Promise.all([new Promise(t=>{this.client.core.relayer.once(gy.publish,async()=>{t(await this.deleteSession({topic:e,id:r}))})}),this.sendResult({id:r,topic:e,result:!0,throwOnFailedPublish:!0}),this.cleanupPendingSentRequestsForTopic({topic:e,error:pM("USER_DISCONNECTED")})]).catch(e=>this.client.logger.error(e))}catch(e){this.client.logger.error(e)}}),wK(this,"onSessionRequest",async e=>{var t,r,n;let{topic:i,payload:o,attestation:s,encryptedId:a,transportType:c}=e,{id:u,params:l}=o;try{await this.isValidRequest(wU({topic:i},l));let e=this.client.session.get(i),o=await this.getVerifyContext({attestationId:s,hash:hH(JSON.stringify(yj("wc_sessionRequest",l,u))),encryptedId:a,metadata:e.peer.metadata,transportType:c}),d={id:u,topic:i,params:l,verifyContext:o};await this.setPendingSessionRequest(d),c===gw.link_mode&&null!=(t=e.peer.metadata.redirect)&&t.universal&&this.client.core.addLinkModeSupportedApp(null==(r=e.peer.metadata.redirect)?void 0:r.universal),null!=(n=this.client.signConfig)&&n.disableRequestQueue?this.emitSessionRequest(d):(this.addSessionRequestToSessionRequestQueue(d),this.processSessionRequestQueue())}catch(e){await this.sendError({id:u,topic:i,error:e}),this.client.logger.error(e)}}),wK(this,"onSessionRequestResponse",(e,t)=>{let{id:r}=t,n=cG("session_request",r);if(0===this.events.listenerCount(n))throw Error(`emitting ${n} without any listeners`);yZ(t)?this.events.emit(cG("session_request",r),{result:t.result}):yY(t)&&this.events.emit(cG("session_request",r),{error:t.error})}),wK(this,"onSessionEventRequest",async(e,t)=>{let{id:r,params:n}=t;try{let t=`${e}_session_event_${n.event.name}`,i=yh.get(t);if(i&&this.isRequestOutOfSync(i,r)){this.client.logger.info(`Discarding out of sync request - ${r}`);return}this.isValidEmit(wU({topic:e},n)),this.client.events.emit("session_event",{id:r,topic:e,params:n}),yh.set(t,r)}
24catch(t){await this.sendError({id:r,topic:e,error:t}),this.client.logger.error(t)}}),wK(this,"onSessionAuthenticateResponse",(e,t)=>{let{id:r}=t;this.client.logger.trace({type:"method",method:"onSessionAuthenticateResponse",topic:e,payload:t}),yZ(t)?this.events.emit(cG("session_request",r),{result:t.result}):yY(t)&&this.events.emit(cG("session_request",r),{error:t.error})}),wK(this,"onSessionAuthenticateRequest",async e=>{var t;let{topic:r,payload:n,attestation:i,encryptedId:o,transportType:s}=e;try{let{requester:e,authPayload:a,expiryTimestamp:c}=n.params,u=await this.getVerifyContext({attestationId:i,hash:hH(JSON.stringify(n)),encryptedId:o,metadata:e.metadata,transportType:s}),l={requester:e,pairingTopic:r,id:n.id,authPayload:a,verifyContext:u,expiryTimestamp:c};await this.setAuthRequest(n.id,{request:l,pairingTopic:r,transportType:s}),s===gw.link_mode&&null!=(t=e.metadata.redirect)&&t.universal&&this.client.core.addLinkModeSupportedApp(e.metadata.redirect.universal),this.client.events.emit("session_authenticate",{topic:r,params:n.params,id:n.id,verifyContext:u})}catch(a){this.client.logger.error(a);let e=n.params.requester.publicKey,t=await this.client.core.crypto.generateKeyPair(),i=this.getAppLinkIfEnabled(n.params.requester.metadata,s),o={type:hR,receiverPublicKey:e,senderPublicKey:t};await this.sendError({id:n.id,topic:r,error:a,encodeOpts:o,rpcOpts:wv.wc_sessionAuthenticate.autoReject,appLink:i})}}),wK(this,"addSessionRequestToSessionRequestQueue",e=>{this.sessionRequestQueue.queue.push(e)}),wK(this,"cleanupAfterResponse",e=>{this.deletePendingSessionRequest(e.response.id,{message:"fulfilled",code:0}),setTimeout(()=>{this.sessionRequestQueue.state=w_.idle,this.processSessionRequestQueue()},(0,I.toMiliseconds)(this.requestQueueDelay))}),wK(this,"cleanupPendingSentRequestsForTopic",({topic:e,error:t})=>{let r=this.client.core.history.pending;r.length>0&&r.filter(t=>t.topic===e&&"wc_sessionRequest"===t.request.method).forEach(e=>{let r=cG("session_request",e.request.id);if(0===this.events.listenerCount(r))throw Error(`emitting ${r} without any listeners`);this.events.emit(cG("session_request",e.request.id),{error:t})})}),wK(this,"processSessionRequestQueue",()=>{if(this.sessionRequestQueue.state===w_.active){this.client.logger.info("session request queue is already active.");return}let e=this.sessionRequestQueue.queue[0];if(!e){this.client.logger.info("session request queue is empty.");return}try{this.sessionRequestQueue.state=w_.active,this.emitSessionRequest(e)}catch(e){this.client.logger.error(e)}}),wK(this,"emitSessionRequest",e=>{this.client.events.emit("session_request",e)}),wK(this,"onPairingCreated",e=>{if(e.methods&&this.expectedPairingMethodMap.set(e.topic,e.methods),e.active)return;let t=this.client.proposal.getAll().find(t=>t.pairingTopic===e.topic);
24t&&this.onSessionProposeRequest({topic:e.topic,payload:yj("wc_sessionPropose",w$(wU({},t),{requiredNamespaces:t.requiredNamespaces,optionalNamespaces:t.optionalNamespaces,relays:t.relays,proposer:t.proposer,sessionProperties:t.sessionProperties,scopedProperties:t.scopedProperties}),t.id)})}),wK(this,"isValidConnect",async e=>{if(!p1(e)){let{message:t}=pP("MISSING_OR_INVALID",`connect() params: ${JSON.stringify(e)}`);throw Error(t)}let{pairingTopic:t,requiredNamespaces:r,optionalNamespaces:n,sessionProperties:i,scopedProperties:o,relays:s}=e;if(pC(t)||await this.isValidPairingTopic(t),!pQ(s,!0)){let{message:e}=pP("MISSING_OR_INVALID",`connect() relays: ${s}`);throw Error(e)}if(!pC(r)&&0!==pk(r)){let e="requiredNamespaces are deprecated and are automatically assigned to optionalNamespaces";["fatal","error","silent"].includes(this.client.logger.level)?console.warn(e):this.client.logger.warn(e),this.validateNamespaces(r,"requiredNamespaces")}if(pC(n)||0===pk(n)||this.validateNamespaces(n,"optionalNamespaces"),pC(i)||this.validateSessionProps(i,"sessionProperties"),!pC(o)){this.validateSessionProps(o,"scopedProperties");let e=Object.keys(r||{}).concat(Object.keys(n||{}));if(!Object.keys(o).every(t=>e.includes(t)))throw Error(`Scoped properties must be a subset of required/optional namespaces, received: ${JSON.stringify(o)}, required/optional namespaces: ${JSON.stringify(e)}`)}}),wK(this,"validateNamespaces",(e,t)=>{let r=pZ(e,"connect()",t);if(r)throw Error(r.message)}),wK(this,"isValidApprove",async e=>{if(!p1(e))throw Error(pP("MISSING_OR_INVALID",`approve() params: ${e}`).message);let{id:t,namespaces:r,relayProtocol:n,sessionProperties:i,scopedProperties:o}=e;this.checkRecentlyDeleted(t),await this.isValidProposalId(t);let s=this.client.proposal.get(t),a=pY(r,"approve()");if(a)throw Error(a.message);let c=p7(s.requiredNamespaces,r,"approve()");if(c)throw Error(c.message);if(!pD(n,!0)){let{message:e}=pP("MISSING_OR_INVALID",`approve() relayProtocol: ${n}`);throw Error(e)}if(pC(i)||this.validateSessionProps(i,"sessionProperties"),!pC(o)){this.validateSessionProps(o,"scopedProperties");let e=new Set(Object.keys(r));if(!Object.keys(o).every(t=>e.has(t)))throw Error(`Scoped properties must be a subset of approved namespaces, received: ${JSON.stringify(o)}, approved namespaces: ${Array.from(e).join(", ")}`)}}),wK(this,"isValidReject",async e=>{if(!p1(e)){let{message:t}=pP("MISSING_OR_INVALID",`reject() params: ${e}`);throw Error(t)}let{id:t,reason:r}=e;if(this.checkRecentlyDeleted(t),await this.isValidProposalId(t),!p2(r)){let{message:e}=pP("MISSING_OR_INVALID",`reject() reason: ${JSON.stringify(r)}`);throw Error(e)}}),wK(this,"isValidSessionSettleRequest",e=>{if(!p1(e)){let{message:t}=pP("MISSING_OR_INVALID",`onSessionSettleRequest() params: ${e}`);throw Error(t)}
24let{relay:t,controller:r,namespaces:n,expiry:i}=e;if(!pX(t)){let{message:e}=pP("MISSING_OR_INVALID","onSessionSettleRequest() relay protocol should be a string");throw Error(e)}let o=pF(r,"onSessionSettleRequest()");if(o)throw Error(o.message);let s=pY(n,"onSessionSettleRequest()");if(s)throw Error(s.message);if(cH(i)){let{message:e}=pP("EXPIRED","onSessionSettleRequest()");throw Error(e)}}),wK(this,"isValidUpdate",async e=>{if(!p1(e)){let{message:t}=pP("MISSING_OR_INVALID",`update() params: ${e}`);throw Error(t)}let{topic:t,namespaces:r}=e;this.checkRecentlyDeleted(t),await this.isValidSessionTopic(t);let n=this.client.session.get(t),i=pY(r,"update()");if(i)throw Error(i.message);let o=p7(n.requiredNamespaces,r,"update()");if(o)throw Error(o.message)}),wK(this,"isValidExtend",async e=>{if(!p1(e)){let{message:t}=pP("MISSING_OR_INVALID",`extend() params: ${e}`);throw Error(t)}let{topic:t}=e;this.checkRecentlyDeleted(t),await this.isValidSessionTopic(t)}),wK(this,"isValidRequest",async e=>{if(!p1(e)){let{message:t}=pP("MISSING_OR_INVALID",`request() params: ${e}`);throw Error(t)}let{topic:t,request:r,chainId:n,expiry:i}=e;this.checkRecentlyDeleted(t),await this.isValidSessionTopic(t);let{namespaces:o}=this.client.session.get(t);if(!p6(o,n)){let{message:e}=pP("MISSING_OR_INVALID",`request() chainId: ${n}`);throw Error(e)}if(!p5(r)){let{message:e}=pP("MISSING_OR_INVALID",`request() ${JSON.stringify(r)}`);throw Error(e)}if(!p4(o,n,r.method)){let{message:e}=pP("MISSING_OR_INVALID",`request() method: ${r.method}`);throw Error(e)}if(i&&!yn(i,ww)){let{message:e}=pP("MISSING_OR_INVALID",`request() expiry: ${i}. Expiry must be a number (in seconds) between ${ww.min} and ${ww.max}`);throw Error(e)}}),wK(this,"isValidRespond",async e=>{var t;if(!p1(e)){let{message:t}=pP("MISSING_OR_INVALID",`respond() params: ${e}`);throw Error(t)}let{topic:r,response:n}=e;try{await this.isValidSessionTopic(r)}catch(r){throw null!=(t=e?.response)&&t.id&&this.cleanupAfterResponse(e),r}if(!p3(n)){let{message:e}=pP("MISSING_OR_INVALID",`respond() response: ${JSON.stringify(n)}`);throw Error(e)}}),wK(this,"isValidPing",async e=>{if(!p1(e)){let{message:t}=pP("MISSING_OR_INVALID",`ping() params: ${e}`);throw Error(t)}let{topic:t}=e;await this.isValidSessionOrPairingTopic(t)}),wK(this,"isValidEmit",async e=>{if(!p1(e)){let{message:t}=pP("MISSING_OR_INVALID",`emit() params: ${e}`);throw Error(t)}let{topic:t,event:r,chainId:n}=e;await this.isValidSessionTopic(t);let{namespaces:i}=this.client.session.get(t);if(!p6(i,n)){let{message:e}=pP("MISSING_OR_INVALID",`emit() chainId: ${n}`);throw Error(e)}if(!p8(r)||!p9(i,n,r.name)){let{message:e}=pP("MISSING_OR_INVALID",`emit() event: ${JSON.stringify(r)}`);throw Error(e)}}),wK(this,"isValidDisconnect",async e=>{if(!p1(e)){let{message:t}=pP("MISSING_OR_INVALID",`disconnect() params: ${e}`);throw Error(t)}let{topic:t}=e;await this.isValidSessionOrPairingTopic(t)}),wK(this,"isValidAuthenticate",e=>{let{chains:t,uri:r,domain:n,nonce:i}=e;if(!Array.isArray(t)||0===t.length)throw Error("chains is required and must be a non-empty array");if(!pD(r,!1))throw Error("uri is required parameter");if(!pD(n,!1))throw Error("domain is required parameter");if(!pD(i,!1))throw Error("nonce is required parameter");if([...new Set(t.map(e=>co(e).namespace))].length>1)throw Error("Multi-namespace requests are not supported. Please request single namespace only.");let{namespace:o}=co(t[0]);if("eip155"!==o)throw Error("Only eip155 namespace is supported for authenticated sessions. Please use .connect() for non-eip155 chains.")}),wK(this,"getVerifyContext",async e=>{let{attestationId:t,hash:r,encryptedId:n,metadata:i,transportType:o}=e,s={verified:{verifyUrl:i.verifyUrl||g$,validation:"UNKNOWN",origin:i.url||""}};try{if(o===gw.link_mode){let e=this.getAppLinkIfEnabled(i,o);return s.verified.validation=e&&new URL(e).origin===new URL(i.url).origin?"VALID":"INVALID",s}let e=await this.client.core.verify.resolve({attestationId:t,hash:r,encryptedId:n,verifyUrl:i.verifyUrl});e&&(s.verified.origin=e.origin,s.verified.isScam=e.isScam,s.verified.validation=e.origin===new URL(i.url).origin?"VALID":"INVALID")}catch(e){this.client.logger.warn(e)}return this.client.logger.debug(`Verify context: ${JSON.stringify(s)}`),s}),wK(this,"validateSessionProps",(e,t)=>{Object.values(e).forEach((r,n)=>{if(null==r){let{message:i}=pP("MISSING_OR_INVALID",`${t} must contain an existing value for each key. Received: ${r} for key ${Object.keys(e)[n]}`);throw Error(i)}})}),wK(this,"getPendingAuthRequest",e=>{let t=this.client.auth.requests.get(e);return"object"==typeof t?t:void 0}),wK(this,"addToRecentlyDeleted",(e,t)=>{if(this.recentlyDeletedMap.set(e,t),this.recentlyDeletedMap.size>=this.recentlyDeletedLimit){let e=0,t=this.recentlyDeletedLimit/2;
24for(let r of this.recentlyDeletedMap.keys()){if(e++>=t)break;this.recentlyDeletedMap.delete(r)}}}),wK(this,"checkRecentlyDeleted",e=>{let t=this.recentlyDeletedMap.get(e);if(t){let{message:r}=pP("MISSING_OR_INVALID",`Record was recently deleted - ${t}: ${e}`);throw Error(r)}}),wK(this,"isLinkModeEnabled",(e,t)=>{var n,i,o,s,a,c,u,l,d;return!!e&&t===gw.link_mode&&(null==(i=null==(n=this.client.metadata)?void 0:n.redirect)?void 0:i.linkMode)===!0&&(null==(s=null==(o=this.client.metadata)?void 0:o.redirect)?void 0:s.universal)!==void 0&&(null==(c=null==(a=this.client.metadata)?void 0:a.redirect)?void 0:c.universal)!==""&&(null==(u=e?.redirect)?void 0:u.universal)!==void 0&&(null==(l=e?.redirect)?void 0:l.universal)!==""&&(null==(d=e?.redirect)?void 0:d.linkMode)===!0&&this.client.core.linkModeSupportedApps.includes(e.redirect.universal)&&"u">typeof(null==r.g?void 0:r.g.Linking)}),wK(this,"getAppLinkIfEnabled",(e,t)=>{var r;return this.isLinkModeEnabled(e,t)?null==(r=e?.redirect)?void 0:r.universal:void 0}),wK(this,"handleLinkModeMessage",({url:e})=>{if(!e||!e.includes("wc_ev")||!e.includes("topic"))return;let t=cQ(e,"topic")||"",r=decodeURIComponent(cQ(e,"wc_ev")||""),n=this.client.session.keys.includes(t);n&&this.client.session.update(t,{transportType:gw.link_mode}),this.client.core.dispatchEnvelope({topic:t,message:r,sessionExists:n})}),wK(this,"registerLinkModeListeners",async()=>{var e;if(c1()||cS()&&null!=(e=this.client.metadata.redirect)&&e.linkMode){let e=null==r.g?void 0:r.g.Linking;if("u">typeof e){e.addEventListener("url",this.handleLinkModeMessage,this.client.name);let t=await e.getInitialURL();t&&setTimeout(()=>{this.handleLinkModeMessage({url:t})},50)}}}),wK(this,"getTVFParams",(e,t,r)=>{var n,i;let o={correlationId:e,rpcMethods:[t.request.method],chainId:t.chainId};try{let e=this.extractTxHashesFromResult(t.request,r);o.txHashes=e,o.contractAddresses=this.isValidContractData(t.request.params)?[null==(i=null==(n=t.request.params)?void 0:n[0])?void 0:i.to]:[]}catch(e){this.client.logger.warn("Error getting TVF params",e)}return o}),wK(this,"isValidContractData",e=>{var t;if(!e)return!1;try{let r=e?.data||(null==(t=e?.[0])?void 0:t.data);if(!r.startsWith("0x"))return!1;let n=r.slice(2);return!!/^[0-9a-fA-F]*$/.test(n)&&n.length%2==0}catch{}return!1}),wK(this,"extractTxHashesFromResult",(e,t)=>{var r;try{if(!t)return[];let n=e.method,i=wE[n];if("sui_signTransaction"===n)return[lj(t.transactionBytes)];if("near_signTransaction"===n)return[lR(t)];if("near_signTransactions"===n)return t.map(e=>lR(e));if("xrpl_signTransactionFor"===n||"xrpl_signTransaction"===n)return[null==(r=t.tx_json)?void 0:r.hash];if("polkadot_signTransaction"===n)return[yE({transaction:e.params.transactionPayload,signature:t.signature})];if("algo_signTxn"===n)return pN(t)?t.map(e=>lB(e)):[lB(t)];if("cosmos_signDirect"===n)return[l$(t)];if("string"==typeof t)return[t];let o=t[i.key];if(pN(o))return"solana_signAllTransactions"===n?o.map(e=>lD(e)):o;if("string"==typeof o)return[o]}catch(e){this.client.logger.warn("Error extracting tx hashes from result",e)}return[]})}async processPendingMessageEvents(){try{let e=this.client.session.keys,t=this.client.core.relayer.messages.getWithoutAck(e);for(let[e,r]of Object.entries(t))for(let t of r)try{await this.onProviderMessageEvent({topic:e,message:t,publishedAt:Date.now()})}catch{this.client.logger.warn(`Error processing pending message event for topic: ${e}, message: ${t}`)}}catch(e){this.client.logger.warn("processPendingMessageEvents failed",e)}}isInitialized(){if(!this.initialized){let{message:e}=pP("NOT_INITIALIZED",this.name);throw Error(e)}}async confirmOnlineStateOrThrow(){await this.client.core.relayer.confirmOnlineStateOrThrow()}registerRelayerEvents(){this.client.core.relayer.on(gy.message,e=>{this.onProviderMessageEvent(e)})}async onRelayMessage(e){let{topic:t,message:r,attestation:n,transportType:i}=e,{publicKey:o}=this.client.auth.authKeys.keys.includes(wN)?this.client.auth.authKeys.get(wN):{responseTopic:void 0,publicKey:void 0};try{let e=await this.client.core.crypto.decode(t,r,{receiverPublicKey:o,encoding:i===gw.link_mode?hC:hk});yW(e)?(this.client.core.history.set(t,e),await this.onRelayEventRequest({topic:t,payload:e,attestation:n,transportType:i,encryptedId:hH(r)})):yJ(e)?(await this.client.core.history.resolve(e),await this.onRelayEventResponse({topic:t,payload:e,transportType:i}),this.client.core.history.delete(t,e.id)):await this.onRelayEventUnknownPayload({topic:t,payload:e,transportType:i}),await this.client.core.relayer.messages.ack(t,r)}catch(e){this.client.logger.error(e)}}registerExpirerEvents(){this.client.core.expirer.on(gR.expired,async e=>
24{let{topic:t,id:r}=cq(e.target);return r&&this.client.pendingRequest.keys.includes(r)?await this.deletePendingSessionRequest(r,pP("EXPIRED"),!0):r&&this.client.auth.requests.keys.includes(r)?await this.deletePendingAuthRequest(r,pP("EXPIRED"),!0):void(t?this.client.session.keys.includes(t)&&(await this.deleteSession({topic:t,expirerHasDeleted:!0}),this.client.events.emit("session_expire",{topic:t})):r&&(await this.deleteProposal(r,!0),this.client.events.emit("proposal_expire",{id:r})))})}registerPairingEvents(){this.client.core.pairing.events.on(gN.create,e=>this.onPairingCreated(e)),this.client.core.pairing.events.on(gN.delete,e=>{this.addToRecentlyDeleted(e.topic,"pairing")})}isValidPairingTopic(e){if(!pD(e,!1)){let{message:t}=pP("MISSING_OR_INVALID",`pairing topic should be a string: ${e}`);throw Error(t)}if(!this.client.core.pairing.pairings.keys.includes(e)){let{message:t}=pP("NO_MATCHING_KEY",`pairing topic doesn't exist: ${e}`);throw Error(t)}if(cH(this.client.core.pairing.pairings.get(e).expiry)){let{message:t}=pP("EXPIRED",`pairing topic: ${e}`);throw Error(t)}}async isValidSessionTopic(e){if(!pD(e,!1)){let{message:t}=pP("MISSING_OR_INVALID",`session topic should be a string: ${e}`);throw Error(t)}if(this.checkRecentlyDeleted(e),!this.client.session.keys.includes(e)){let{message:t}=pP("NO_MATCHING_KEY",`session topic doesn't exist: ${e}`);throw Error(t)}if(cH(this.client.session.get(e).expiry)){await this.deleteSession({topic:e});let{message:t}=pP("EXPIRED",`session topic: ${e}`);throw Error(t)}if(!this.client.core.crypto.keychain.has(e)){let{message:t}=pP("MISSING_OR_INVALID",`session topic does not exist in keychain: ${e}`);throw await this.deleteSession({topic:e}),Error(t)}}async isValidSessionOrPairingTopic(e){if(this.checkRecentlyDeleted(e),this.client.session.keys.includes(e))await this.isValidSessionTopic(e);else if(this.client.core.pairing.pairings.keys.includes(e))this.isValidPairingTopic(e);else if(pD(e,!1)){let{message:t}=pP("NO_MATCHING_KEY",`session or pairing topic doesn't exist: ${e}`);throw Error(t)}else{let{message:t}=pP("MISSING_OR_INVALID",`session or pairing topic should be a string: ${e}`);throw Error(t)}}async isValidProposalId(e){if(!p0(e)){let{message:t}=pP("MISSING_OR_INVALID",`proposal id should be a number: ${e}`);throw Error(t)}if(!this.client.proposal.keys.includes(e)){let{message:t}=pP("NO_MATCHING_KEY",`proposal id doesn't exist: ${e}`);throw Error(t)}if(cH(this.client.proposal.get(e).expiryTimestamp)){await this.deleteProposal(e);let{message:t}=pP("EXPIRED",`proposal id: ${e}`);throw Error(t)}}}class wz extends vP{constructor(e,t){super(e,t,wp,wd),this.core=e,this.logger=t}}class wq extends vP{constructor(e,t){super(e,t,wg,wd),this.core=e,this.logger=t}}class wV extends vP{constructor(e,t){super(e,t,wS,wd,e=>e.id),this.core=e,this.logger=t}}class wH extends vP{constructor(e,t){super(e,t,wO,wM,()=>wN),this.core=e,this.logger=t}}class wG extends vP{constructor(e,t){super(e,t,wT,wM),this.core=e,this.logger=t}}class wW extends vP{constructor(e,t){super(e,t,wP,wM,e=>e.id),this.core=e,this.logger=t}}var wJ=Object.defineProperty,wZ=(e,t,r)=>t in e?wJ(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,wY=(e,t,r)=>wZ(e,"symbol"!=typeof t?t+"":t,r);class wX{constructor(e,t){this.core=e,this.logger=t,wY(this,"authKeys"),wY(this,"pairingTopics"),wY(this,"requests"),this.authKeys=new wH(this.core,this.logger),this.pairingTopics=new wG(this.core,this.logger),this.requests=new wW(this.core,this.logger)}
24async init(){await this.authKeys.init(),await this.pairingTopics.init(),await this.requests.init()}}var wQ=Object.defineProperty,w0=(e,t,r)=>t in e?wQ(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,w1=(e,t,r)=>w0(e,"symbol"!=typeof t?t+"":t,r);class w2 extends ws{constructor(e){super(e),w1(this,"protocol",wc),w1(this,"version",wu),w1(this,"name",wf.name),w1(this,"metadata"),w1(this,"core"),w1(this,"logger"),w1(this,"events",new x.EventEmitter),w1(this,"engine"),w1(this,"session"),w1(this,"proposal"),w1(this,"pendingRequest"),w1(this,"auth"),w1(this,"signConfig"),w1(this,"on",(e,t)=>this.events.on(e,t)),w1(this,"once",(e,t)=>this.events.once(e,t)),w1(this,"off",(e,t)=>this.events.off(e,t)),w1(this,"removeListener",(e,t)=>this.events.removeListener(e,t)),w1(this,"removeAllListeners",e=>this.events.removeAllListeners(e)),w1(this,"connect",async e=>{try{return await this.engine.connect(e)}catch(e){throw this.logger.error(e.message),e}}),w1(this,"pair",async e=>{try{return await this.engine.pair(e)}catch(e){throw this.logger.error(e.message),e}}),w1(this,"approve",async e=>{try{return await this.engine.approve(e)}catch(e){throw this.logger.error(e.message),e}}),w1(this,"reject",async e=>{try{return await this.engine.reject(e)}catch(e){throw this.logger.error(e.message),e}}),w1(this,"update",async e=>{try{return await this.engine.update(e)}catch(e){throw this.logger.error(e.message),e}}),w1(this,"extend",async e=>{try{return await this.engine.extend(e)}catch(e){throw this.logger.error(e.message),e}}),w1(this,"request",async e=>{try{return await this.engine.request(e)}catch(e){throw this.logger.error(e.message),e}}),w1(this,"respond",async e=>{try{return await this.engine.respond(e)}catch(e){throw this.logger.error(e.message),e}}),w1(this,"ping",async e=>{try{return await this.engine.ping(e)}catch(e){throw this.logger.error(e.message),e}}),w1(this,"emit",async e=>{try{return await this.engine.emit(e)}catch(e){throw this.logger.error(e.message),e}}),w1(this,"disconnect",async e=>{try{return await this.engine.disconnect(e)}catch(e){throw this.logger.error(e.message),e}}),w1(this,"find",e=>{try{return this.engine.find(e)}catch(e){throw this.logger.error(e.message),e}}),w1(this,"getPendingSessionRequests",()=>{try{return this.engine.getPendingSessionRequests()}catch(e){throw this.logger.error(e.message),e}}),w1(this,"authenticate",async(e,t)=>{try{return await this.engine.authenticate(e,t)}catch(e){throw this.logger.error(e.message),e}}),w1(this,"formatAuthMessage",e=>{try{return this.engine.formatAuthMessage(e)}catch(e){throw this.logger.error(e.message),e}}),w1(this,"approveSessionAuthenticate",async e=>{try{return await this.engine.approveSessionAuthenticate(e)}catch(e){throw this.logger.error(e.message),e}}),w1(this,"rejectSessionAuthenticate",async e=>{try{return await this.engine.rejectSessionAuthenticate(e)}catch(e){throw this.logger.error(e.message),e}}),this.name=e?.name||wf.name,this.metadata=cM(e?.metadata),this.signConfig=e?.signConfig;let t="u">typeof e?.logger&&"string"!=typeof e?.logger?e.logger:eC()(eY({level:e?.logger||wf.logger}));this.core=e?.core||new wr(e),this.logger=e2(t,this.name),this.session=new wq(this.core,this.logger),this.proposal=new wz(this.core,this.logger),this.pendingRequest=new wV(this.core,this.logger),this.engine=new wF(this),this.auth=new wX(this.core,this.logger)}static async init(e){let t=new w2(e);return await t.initialize(),t}get context(){return e0(this.logger)}get pairing(){return this.core.pairing.pairings}async initialize(){this.logger.trace("Initialized");try{await this.core.start(),await this.session.init(),await this.proposal.init(),await this.pendingRequest.init(),await this.auth.init(),await this.engine.init(),this.logger.info("SignClient Initialization Success"),setTimeout(()=>{this.engine.processRelayMessageCache()},(0,I.toMiliseconds)(I.ONE_SECOND))}catch(e){throw this.logger.info("SignClient Initialization Failure"),this.logger.error(e.message),e}}}},41842:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});let n=r(65656);n.__exportStar(r(91302),t),n.__exportStar(r(30099),t)},91302:(e,t)=>
24{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ONE_THOUSAND=t.ONE_HUNDRED=void 0,t.ONE_HUNDRED=100,t.ONE_THOUSAND=1e3},30099:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ONE_YEAR=t.FOUR_WEEKS=t.THREE_WEEKS=t.TWO_WEEKS=t.ONE_WEEK=t.THIRTY_DAYS=t.SEVEN_DAYS=t.FIVE_DAYS=t.THREE_DAYS=t.ONE_DAY=t.TWENTY_FOUR_HOURS=t.TWELVE_HOURS=t.SIX_HOURS=t.THREE_HOURS=t.ONE_HOUR=t.SIXTY_MINUTES=t.THIRTY_MINUTES=t.TEN_MINUTES=t.FIVE_MINUTES=t.ONE_MINUTE=t.SIXTY_SECONDS=t.THIRTY_SECONDS=t.TEN_SECONDS=t.FIVE_SECONDS=t.ONE_SECOND=void 0,t.ONE_SECOND=1,t.FIVE_SECONDS=5,t.TEN_SECONDS=10,t.THIRTY_SECONDS=30,t.SIXTY_SECONDS=60,t.ONE_MINUTE=t.SIXTY_SECONDS,t.FIVE_MINUTES=5*t.ONE_MINUTE,t.TEN_MINUTES=10*t.ONE_MINUTE,t.THIRTY_MINUTES=30*t.ONE_MINUTE,t.SIXTY_MINUTES=60*t.ONE_MINUTE,t.ONE_HOUR=t.SIXTY_MINUTES,t.THREE_HOURS=3*t.ONE_HOUR,t.SIX_HOURS=6*t.ONE_HOUR,t.TWELVE_HOURS=12*t.ONE_HOUR,t.TWENTY_FOUR_HOURS=24*t.ONE_HOUR,t.ONE_DAY=t.TWENTY_FOUR_HOURS,t.THREE_DAYS=3*t.ONE_DAY,t.FIVE_DAYS=5*t.ONE_DAY,t.SEVEN_DAYS=7*t.ONE_DAY,t.THIRTY_DAYS=30*t.ONE_DAY,t.ONE_WEEK=t.SEVEN_DAYS,t.TWO_WEEKS=2*t.ONE_WEEK,t.THREE_WEEKS=3*t.ONE_WEEK,t.FOUR_WEEKS=4*t.ONE_WEEK,t.ONE_YEAR=365*t.ONE_DAY},99652:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});let n=r(65656);n.__exportStar(r(67590),t),n.__exportStar(r(28895),t),n.__exportStar(r(36858),t),n.__exportStar(r(41842),t)},36858:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),r(65656).__exportStar(r(80233),t)},80233:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.IWatch=void 0;class r{}t.IWatch=r},36801:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.fromMiliseconds=t.toMiliseconds=void 0;let n=r(41842);function i(e){return e*n.ONE_THOUSAND}function o(e){return Math.floor(e/n.ONE_THOUSAND)}t.toMiliseconds=i,t.fromMiliseconds=o},71825:(e,t)=>{"use strict";function r(e){return new Promise(t=>{setTimeout(()=>{t(!0)},e)})}Object.defineProperty(t,"__esModule",{value:!0}),t.delay=void 0,t.delay=r},67590:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});let n=r(65656);n.__exportStar(r(71825),t),n.__exportStar(r(36801),t)},28895:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Watch=void 0;class r{constructor(){this.timestamps=new Map}start(e){if(this.timestamps.has(e))throw Error(`Watch already started for label: ${e}`);this.timestamps.set(e,{started:Date.now()})}stop(e){let t=this.get(e);if(void 0!==t.elapsed)throw Error(`Watch already stopped for label: ${e}`);let r=Date.now()-t.started;this.timestamps.set(e,{started:t.started,elapsed:r})}get(e){let t=this.timestamps.get(e);if(void 0===t)throw Error(`No timestamp found for label: ${e}`);return t}elapsed(e){let t=this.get(e);return t.elapsed||Date.now()-t.started}}t.Watch=r,t.default=r},65656:(e,t,r)=>{"use strict";r.r(t),r.d(t,{__assign:()=>o,__asyncDelegator:()=>w,__asyncGenerator:()=>v,__asyncValues:()=>_,__await:()=>b,__awaiter:()=>l,__classPrivateFieldGet:()=>A,__classPrivateFieldSet:()=>I,__createBinding:()=>f,__decorate:()=>a,__exportStar:()=>h,__extends:()=>i,__generator:()=>d,__importDefault:()=>x,__importStar:()=>
24S,__makeTemplateObject:()=>E,__metadata:()=>u,__param:()=>c,__read:()=>y,__rest:()=>s,__spread:()=>g,__spreadArrays:()=>m,__values:()=>p});var n=function(e,t){return(n=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)};function i(e,t){function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}var o=function(){return(o=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var i in t=arguments[r])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e}).apply(this,arguments)};function s(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&0>t.indexOf(n)&&(r[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var i=0,n=Object.getOwnPropertySymbols(e);i<n.length;i++)0>t.indexOf(n[i])&&Object.prototype.propertyIsEnumerable.call(e,n[i])&&(r[n[i]]=e[n[i]]);return r}function a(e,t,r,n){var i,o=arguments.length,s=o<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,r,n);else for(var a=e.length-1;a>=0;a--)(i=e[a])&&(s=(o<3?i(s):o>3?i(t,r,s):i(t,r))||s);return o>3&&s&&Object.defineProperty(t,r,s),s}function c(e,t){return function(r,n){t(r,n,e)}}function u(e,t){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(e,t)}function l(e,t,r,n){function i(e){return e instanceof r?e:new r(function(t){t(e)})}return new(r||(r=Promise))(function(r,o){function s(e){try{c(n.next(e))}catch(e){o(e)}}function a(e){try{c(n.throw(e))}catch(e){o(e)}}function c(e){e.done?r(e.value):i(e.value).then(s,a)}c((n=n.apply(e,t||[])).next())})}function d(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(e){return function(t){return c([e,t])}}function c(o){if(r)throw 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=(i=s.trys).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(e){o=[6,e],n=0}finally{r=i=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}}function f(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}function h(e,t){for(var r in e)"default"===r||t.hasOwnProperty(r)||(t[r]=e[r])}function p(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 TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function y(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,i,o=r.call(e),s=[];try{for(;(void 0===t||t-- >0)&&!(n=o.next()).done;)s.push(n.value)}catch(e){i={error:e}}finally{try{n&&!n.done&&(r=o.return)&&r.call(o)}finally{if(i)throw i.error}}return s}function g(){for(var e=[],t=0;t<arguments.length;t++)e=e.concat(y(arguments[t]));return e}function m(){for(var e=0,t=0,r=arguments.length;t<r;t++)e+=arguments[t].length;for(var n=Array(e),i=0,t=0;t<r;t++)for(var o=arguments[t],s=0,a=o.length;s<a;s++,i++)n[i]=o[s];return n}function b(e){return this instanceof b?(this.v=e,this):new b(e)}function v(e,t,r){if(!Symbol.asyncIterator)throw 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{c(i[e](t))}catch(e){d(o[0][3],e)}}function c(e){e.value instanceof b?Promise.resolve(e.value.v).then(u,l):d(o[0][2],e)}function u(e){a("next",e)}function l(e){a("throw",e)}function d(e,t){e(t),o.shift(),o.length&&a(o[0][0],o[0][1])}}function w(e){var t,r;return t={},n("next"),n("throw",function(e){throw e}),n("return"),t[Symbol.iterator]=function(){return this},t;function n(n,i){t[n]=e[n]?function(t){return(r=!r)?{value:b(e[n](t)),done:"return"===n}:i?i(t):t}:i}}function _(e){if(!Symbol.asyncIterator)throw TypeError("Symbol.asyncIterator is not defined.");var t,r=e[Symbol.asyncIterator];return r?r.call(e):(e=p(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,o){i(n,o,(t=e[r](t)).done,t.value)})}}function i(e,t,r,n){Promise.resolve(n).then(function(t){e({value:t,done:r})},t)}}function E(e,t){return Object.defineProperty?Object.defineProperty(e,"raw",{value:t}):e.raw=t,e}
24function S(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)Object.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t.default=e,t}function x(e){return e&&e.__esModule?e:{default:e}}function A(e,t){if(!t.has(e))throw TypeError("attempted to get private field on non-instance");return t.get(e)}function I(e,t,r){if(!t.has(e))throw TypeError("attempted to set private field on non-instance");return t.set(e,r),r}},15208:(e,t)=>{"use strict";function r(e){let t;return"undefined"!=typeof window&&void 0!==window[e]&&(t=window[e]),t}function n(e){let t=r(e);if(!t)throw Error(`${e} is not defined in Window`);return t}function i(){return n("document")}function o(){return r("document")}function s(){return n("navigator")}function a(){return r("navigator")}function c(){return n("location")}function u(){return r("location")}function l(){return n("crypto")}function d(){return r("crypto")}function f(){return n("localStorage")}function h(){return r("localStorage")}Object.defineProperty(t,"__esModule",{value:!0}),t.getLocalStorage=t.getLocalStorageOrThrow=t.getCrypto=t.getCryptoOrThrow=t.getLocation=t.getLocationOrThrow=t.getNavigator=t.getNavigatorOrThrow=t.getDocument=t.getDocumentOrThrow=t.getFromWindowOrThrow=t.getFromWindow=void 0,t.getFromWindow=r,t.getFromWindowOrThrow=n,t.getDocumentOrThrow=i,t.getDocument=o,t.getNavigatorOrThrow=s,t.getNavigator=a,t.getLocationOrThrow=c,t.getLocation=u,t.getCryptoOrThrow=l,t.getCrypto=d,t.getLocalStorageOrThrow=f,t.getLocalStorage=h},19973:(e,t,r)=>{"use strict";var n;n={value:!0},t.g=void 0;let i=r(15208);function o(){let e,t;try{e=i.getDocumentOrThrow(),t=i.getLocationOrThrow()}catch(e){return null}function r(){let r=e.getElementsByTagName("link"),n=[];for(let e=0;e<r.length;e++){let i=r[e],o=i.getAttribute("rel");if(o&&o.toLowerCase().indexOf("icon")>-1){let e=i.getAttribute("href");if(e){if(-1===e.toLowerCase().indexOf("https:")&&-1===e.toLowerCase().indexOf("http:")&&0!==e.indexOf("//")){let r=t.protocol+"//"+t.host;if(0===e.indexOf("/"))r+=e;else{let n=t.pathname.split("/");n.pop(),r+=n.join("/")+"/"+e}n.push(r)}else if(0===e.indexOf("//")){let r=t.protocol+e;n.push(r)}else n.push(e)}}}return n}function n(...t){let r=e.getElementsByTagName("meta");for(let e=0;e<r.length;e++){let n=r[e],i=["itemprop","property","name"].map(e=>n.getAttribute(e)).filter(e=>!!e&&t.includes(e));if(i.length&&i){let e=n.getAttribute("content");if(e)return e}}return""}function o(){return n("description","og:description","twitter:description","keywords")}let s=function(){let t=n("name","og:site_name","og:title","twitter:title");return t||(t=e.title),t}();return{description:o(),url:t.origin,icons:r(),name:s}}t.g=o},30254:(e,t)=>{"use strict";function r(e,t){return{validate:e,compare:t}}function n(e){return e%4==0&&(e%100!=0||e%400==0)}Object.defineProperty(t,"__esModule",{value:!0}),t.formatNames=t.fastFormats=t.fullFormats=void 0,t.fullFormats={date:r(s,a),time:r(u,l),"date-time":r(f,h),duration:/^P(?!$)((\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+S)?)?|(\d+W)?)$/,uri:g,"uri-reference":/^(?:[a-z][a-z0-9+\-.]*:)?(?:\/?\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:]|%[0-9a-f]{2})*@)?(?:\[(?:(?:(?:(?:[0-9a-f]{1,4}:){6}|::(?:[0-9a-f]{1,4}:){5}|(?:[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){4}|(?:(?:[0-9a-f]{1,4}:){0,1}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){3}|(?:(?:[0-9a-f]{1,4}:){0,2}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){2}|(?:(?:[0-9a-f]{1,4}:){0,3}[0-9a-f]{1,4})?::[0-9a-f]{1,4}:|(?:(?:[0-9a-f]{1,4}:){0,4}[0-9a-f]{1,4})?::)(?:[0-9a-f]{1,4}:[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?))|(?:(?:[0-9a-f]{1,4}:){0,5}[0-9a-f]{1,4})?::[0-9a-f]{1,4}|(?:(?:[0-9a-f]{1,4}:){0,6}[0-9a-f]{1,4})?::)|[Vv][0-9a-f]+\.[a-z0-9\-._~!$&'()*+,;=:]+)\]|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)|(?:[a-z0-9\-._~!$&'"()*+,;=]|%[0-9a-f]{2})*)(?::\d*)?(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*|\/(?:(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*)?|(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*)?(?:\?(?:[a-z0-9\-._~!$&'"()*+,;=:@/?]|%[0-9a-f]{2})*)?(?:#(?:[a-z0-9\-._~!$&'"()*+,;=:@/?]|%[0-9a-f]{2})*)?$/i,"uri-template":/^(?:(?:[^\x00-\x20"'<>%\\^`{|}]|%[0-9a-f]{2})|\{[+#./;?&=,!@|]?(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\*)?(?:,(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\*)?)*\})*$/i,url:/^(?:https?|ftp):\/\/(?:\S+(?::\S*)?@)?(?:(?!(?:10|127)(?:\.\d{1,3}){3})(?!(?:169\.254|192\.168)(?:\.\d{1,3}){2})(?!172\.(?:1[6-9]|2\d|3[0-1])(?:\.\d{1,3}){2})(?:[1-9]\d?|1\d\d|2[01]\d|22[0-3])(?:\.(?:1?\d{1,2}|2[0-4]\d|25[0-5])){2}(?:\.(?:[1-9]\d?|1\d\d|2[0-4]\d|25[0-4]))|(?:(?:[a-z0-9\u{00a1}-\u{ffff}]+-)*[a-z0-9\u{00a1}-\u{ffff}]+)(?:\.(?:[a-z0-9\u{00a1}-\u{ffff}]+-)*[a-z0-9\u{00a1}-\u{ffff}]+)*(?:\.(?:[a-z\u{00a1}-\u{ffff}]{2,})))(?::\d{2,5})?(?:\/[^\s]*)?$/iu,email:/^[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*@(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?$/i,hostname:/^(?=.{1,253}\.?$)[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\.[a-z0-9](?:[-0-9a-z]{0,61}[0-9a-z])?)*\.?$/i,ipv4:/^(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)$/,ipv6:/^((([0-9a-f]{1,4}:){7}([0-9a-f]{1,4}|:))|(([0-9a-f]{1,4}:){6}(:[0-9a-f]{1,4}|((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9a-f]{1,4}:){5}(((:[0-9a-f]{1,4}){1,2})|:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9a-f]{1,4}:){4}(((:[0-9a-f]{1,4}){1,3})|((:[0-9a-f]{1,4})?:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){3}(((:[0-9a-f]{1,4}){1,4})|((:[0-9a-f]{1,4}){0,2}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){2}(((:[0-9a-f]{1,4}){1,5})|((:[0-9a-f]{1,4}){0,3}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9a-f]{1,4}:){1}(((:[0-9a-f]{1,4}){1,6})|((:[0-9a-f]{1,4}){0,4}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(:(((:[0-9a-f]{1,4}){1,7})|((:[0-9a-f]{1,4}){0,5}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))$/i,regex:A,uuid:/^(?:urn:uuid:)?[0-9a-f]{8}-(?:[0-9a-f]{4}-){3}[0-9a-f]{12}$/i,"json-pointer":/^(?:\/(?:[^~/]|~0|~1)*)*$/,"json-pointer-uri-fragment":/^#(?:\/(?:[a-z0-9_\-.!$&'()*+,;:=@]|%[0-9a-f]{2}|~0|~1)*)*$/i,"relative-json-pointer":/^(?:0|[1-9][0-9]*)(?:#|(?:\/(?:[^~/]|~0|~1)*)*)$/,byte:b,int32:{type:"number",validate:_},int64:{type:"number",validate:E},float:{type:"number",validate:S}
24,double:{type:"number",validate:S},password:!0,binary:!0},t.fastFormats={...t.fullFormats,date:r(/^\d\d\d\d-[0-1]\d-[0-3]\d$/,a),time:r(/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)?$/i,l),"date-time":r(/^\d\d\d\d-[0-1]\d-[0-3]\d[t\s](?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)$/i,h),uri:/^(?:[a-z][a-z0-9+\-.]*:)(?:\/?\/)?[^\s]*$/i,"uri-reference":/^(?:(?:[a-z][a-z0-9+\-.]*:)?\/?\/)?(?:[^\\\s#][^\s#]*)?(?:#[^\\\s]*)?$/i,email:/^[a-z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\.[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?)*$/i},t.formatNames=Object.keys(t.fullFormats);let i=/^(\d\d\d\d)-(\d\d)-(\d\d)$/,o=[0,31,28,31,30,31,30,31,31,30,31,30,31];function s(e){let t=i.exec(e);if(!t)return!1;let r=+t[1],s=+t[2],a=+t[3];return s>=1&&s<=12&&a>=1&&a<=(2===s&&n(r)?29:o[s])}function a(e,t){if(e&&t)return e>t?1:e<t?-1:0}let c=/^(\d\d):(\d\d):(\d\d)(\.\d+)?(z|[+-]\d\d(?::?\d\d)?)?$/i;function u(e,t){let r=c.exec(e);if(!r)return!1;let n=+r[1],i=+r[2],o=+r[3],s=r[5];return(n<=23&&i<=59&&o<=59||23===n&&59===i&&60===o)&&(!t||""!==s)}function l(e,t){if(!(e&&t))return;let r=c.exec(e),n=c.exec(t);if(r&&n)return(e=r[1]+r[2]+r[3]+(r[4]||""))>(t=n[1]+n[2]+n[3]+(n[4]||""))?1:e<t?-1:0}let d=/t|\s/i;function f(e){let t=e.split(d);return 2===t.length&&s(t[0])&&u(t[1],!0)}function h(e,t){if(!(e&&t))return;let[r,n]=e.split(d),[i,o]=t.split(d),s=a(r,i);if(void 0!==s)return s||l(n,o)}let p=/\/|:/,y=/^(?:[a-z][a-z0-9+\-.]*:)(?:\/?\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:]|%[0-9a-f]{2})*@)?(?:\[(?:(?:(?:(?:[0-9a-f]{1,4}:){6}|::(?:[0-9a-f]{1,4}:){5}|(?:[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){4}|(?:(?:[0-9a-f]{1,4}:){0,1}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){3}|(?:(?:[0-9a-f]{1,4}:){0,2}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){2}|(?:(?:[0-9a-f]{1,4}:){0,3}[0-9a-f]{1,4})?::[0-9a-f]{1,4}:|(?:(?:[0-9a-f]{1,4}:){0,4}[0-9a-f]{1,4})?::)(?:[0-9a-f]{1,4}:[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?))|(?:(?:[0-9a-f]{1,4}:){0,5}[0-9a-f]{1,4})?::[0-9a-f]{1,4}|(?:(?:[0-9a-f]{1,4}:){0,6}[0-9a-f]{1,4})?::)|[Vv][0-9a-f]+\.[a-z0-9\-._~!$&'()*+,;=:]+)\]|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)|(?:[a-z0-9\-._~!$&'()*+,;=]|%[0-9a-f]{2})*)(?::\d*)?(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*|\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*)?|(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*)(?:\?(?:[a-z0-9\-._~!$&'()*+,;=:@/?]|%[0-9a-f]{2})*)?(?:#(?:[a-z0-9\-._~!$&'()*+,;=:@/?]|%[0-9a-f]{2})*)?$/i;function g(e){return p.test(e)&&y.test(e)}let m=/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/gm;function b(e){return m.lastIndex=0,m.test(e)}let v=-0x80000000,w=0x80000000-1;function _(e){return Number.isInteger(e)&&e<=w&&e>=v}function E(e){return Number.isInteger(e)}function S(){return!0}let x=/[^\\]\\Z/;function A(e){if(x.test(e))return!1;try{return new RegExp(e),!0}catch(e){return!1}}},82946:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});let n=r(30254),i=r(37865),o=r(99991),s=new o.Name("fullFormats"),a=new o.Name("fastFormats"),c=(e,t={keywords:!0})=>{if(Array.isArray(t))return u(e,t,n.fullFormats,s),e;let[r,o]="fast"===t.mode?[n.fastFormats,a]:[n.fullFormats,s];return u(e,t.formats||n.formatNames,r,o),t.keywords&&i.default(e),e};function u(e,t,r,n){var i,s;for(let a of(null!==(i=(s=e.opts.code).formats)&&void 0!==i||(s.formats=o._`require("ajv-formats/dist/formats").${n}`),t))e.addFormat(a,r[a])}c.get=(e,t="full")=>{let r=("fast"===t?n.fastFormats:n.fullFormats)[e];if(!r)throw Error(`Unknown format "${e}"`);return r},e.exports=t=c,Object.defineProperty(t,"__esModule",{value:!0}),t.default=c},37865:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.formatLimitDefinition=void 0;let n=r(13884),i=r(99991),o=i.operators,s={formatMaximum:{okStr:"<=",ok:o.LTE,fail:o.GT},formatMinimum:{okStr:">=",ok:o.GTE,fail:o.LT},formatExclusiveMaximum:{okStr:"<",ok:o.LT,fail:o.GTE},formatExclusiveMinimum:{okStr:">",ok:o.GT,fail:o.LTE}},a={message:({keyword:e,schemaCode:t})=>i.str`should be ${s[e].okStr} ${t}`,params:({keyword:e,schemaCode:t})=>i._`{comparison: ${s[e].okStr}, limit: ${t}}`};t.formatLimitDefinition={keyword:Object.keys(s),type:"string",schemaType:"string",$data:!0,error:a,code(e){let{gen:t,data:r,schemaCode:o,keyword:a,it:c}=e,{opts:u,self:l}=c;if(!u.validateFormats)return;let d=new n.KeywordCxt(c,l.RULES.all.format.definition,"format");function f(){let r=t.scopeValue("formats",{ref:l.formats,code:u.code.formats}),n=t.const("fmt",i._`${r}[${d.schemaCode}]`);e.fail$data(i.or(i._`typeof ${n} != "object"`,i._`${n} instanceof RegExp`,i._`typeof ${n}
24.compare != "function"`,p(n)))}function h(){let r=d.schema,n=l.formats[r];if(!n||!0===n)return;if("object"!=typeof n||n instanceof RegExp||"function"!=typeof n.compare)throw Error(`"${a}": format "${r}" does not define "compare" function`);let o=t.scopeValue("formats",{key:r,ref:n,code:u.code.formats?i._`${u.code.formats}${i.getProperty(r)}`:void 0});e.fail$data(p(o))}function p(e){return i._`${e}.compare(${r}, ${o}) ${s[a].fail} 0`}d.$data?f():h()},dependencies:["format"]};let c=e=>(e.addKeyword(t.formatLimitDefinition),e);t.default=c},13884:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.MissingRefError=t.ValidationError=t.CodeGen=t.Name=t.nil=t.stringify=t.str=t._=t.KeywordCxt=t.Ajv=void 0;let n=r(52850),i=r(19274),o=r(62309),s=r(5754),a=["/properties"],c="http://json-schema.org/draft-07/schema";class u extends n.default{_addVocabularies(){super._addVocabularies(),i.default.forEach(e=>this.addVocabulary(e)),this.opts.discriminator&&this.addKeyword(o.default)}_addDefaultMetaSchema(){if(super._addDefaultMetaSchema(),!this.opts.meta)return;let e=this.opts.$data?this.$dataMetaSchema(s,a):s;this.addMetaSchema(e,c,!1),this.refs["http://json-schema.org/schema"]=c}defaultMeta(){return this.opts.defaultMeta=super.defaultMeta()||(this.getSchema(c)?c:void 0)}}t.Ajv=u,e.exports=t=u,e.exports.Ajv=u,Object.defineProperty(t,"__esModule",{value:!0}),t.default=u;var l=r(47594);Object.defineProperty(t,"KeywordCxt",{enumerable:!0,get:function(){return l.KeywordCxt}});var d=r(99991);Object.defineProperty(t,"_",{enumerable:!0,get:function(){return d._}}),Object.defineProperty(t,"str",{enumerable:!0,get:function(){return d.str}}),Object.defineProperty(t,"stringify",{enumerable:!0,get:function(){return d.stringify}}),Object.defineProperty(t,"nil",{enumerable:!0,get:function(){return d.nil}}),Object.defineProperty(t,"Name",{enumerable:!0,get:function(){return d.Name}}),Object.defineProperty(t,"CodeGen",{enumerable:!0,get:function(){return d.CodeGen}});var f=r(4450);Object.defineProperty(t,"ValidationError",{enumerable:!0,get:function(){return f.default}});var h=r(4481);Object.defineProperty(t,"MissingRefError",{enumerable:!0,get:function(){return h.default}})},37192:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.regexpCode=t.getEsmExportName=t.getProperty=t.safeStringify=t.stringify=t.strConcat=t.addCodeArg=t.str=t._=t.nil=t._Code=t.Name=t.IDENTIFIER=t._CodeOrName=void 0;class r{}t._CodeOrName=r,t.IDENTIFIER=/^[a-z$_][a-z$_0-9]*$/i;class n extends r{constructor(e){if(super(),!t.IDENTIFIER.test(e))throw Error("CodeGen: name must be a valid identifier");this.str=e}toString(){return this.str}emptyStr(){return!1}get names(){return{[this.str]:1}}}t.Name=n;class i extends r{constructor(e){super(),this._items="string"==typeof e?[e]:e}toString(){return this.str}emptyStr(){if(this._items.length>1)return!1;let e=this._items[0];return""===e||'""'===e}get str(){var e;return null!==(e=this._str)&&void 0!==e?e:this._str=this._items.reduce((e,t)=>`${e}${t}`,"")}get names(){var e;return null!==(e=this._names)&&void 0!==e?e:this._names=this._items.reduce((e,t)=>(t instanceof n&&(e[t.str]=(e[t.str]||0)+1),e),{})}}function o(e,...t){let r=[e[0]],n=0;for(;n<t.length;)c(r,t[n]),r.push(e[++n]);return new i(r)}t._Code=i,t.nil=new i(""),t._=o;let s=new i("+");function a(e,...t){let r=[p(e[0])],n=0;for(;n<t.length;)r.push(s),c(r,t[n]),r.push(s,p(e[++n]));return u(r),new i(r)}function c(e,t){t instanceof i?e.push(...t._items):t instanceof n?e.push(t):e.push(f(t))}function u(e){let t=1;for(;t<e.length-1;){if(e[t]===s){let r=l(e[t-1],e[t+1]);if(void 0!==r){e.splice(t-1,3,r);continue}e[t++]="+"}t++}}function l(e,t){return'""'===t?e:'""'===e?t:"string"==typeof e?t instanceof n||'"'!==e[e.length-1]?void 0:"string"!=typeof t?`${e.slice(0,-1)}${t}"`:'"'===t[0]?e.slice(0,-1)+t.slice(1):void 0:"string"!=typeof t||'"'!==t[0]||e instanceof n?void 0:`"${e}${t.slice(1)}`}function d(e,t){return t.emptyStr()?e:e.emptyStr()?t:a`${e}${t}`}function f(e){return"number"==typeof e||"boolean"==typeof e||null===e?e:p(Array.isArray(e)?e.join(","):e)}function h(e){return new i(p(e))}function p(e){return JSON.stringify(e).replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")}function y(e){return"string"==typeof e&&t.IDENTIFIER.test(e)?new i(`.${e}`):o`[${e}]`}function g(e){if("string"==typeof e&&t.IDENTIFIER.test(e))return new i(`${e}`);
vendor: 8,032 bytes, line 24
24throw Error(`CodeGen: invalid export name: ${e}, use explicit $id name mapping`)}function m(e){return new i(e.toString())}t.str=a,t.addCodeArg=c,t.strConcat=d,t.stringify=h,t.safeStringify=p,t.getProperty=y,t.getEsmExportName=g,t.regexpCode=m},99991:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.or=t.and=t.not=t.CodeGen=t.operators=t.varKinds=t.ValueScopeName=t.ValueScope=t.Scope=t.Name=t.regexpCode=t.stringify=t.getProperty=t.nil=t.strConcat=t.str=t._=void 0;let n=r(37192),i=r(19823);var o=r(37192);Object.defineProperty(t,"_",{enumerable:!0,get:function(){return o._}}),Object.defineProperty(t,"str",{enumerable:!0,get:function(){return o.str}}),Object.defineProperty(t,"strConcat",{enumerable:!0,get:function(){return o.strConcat}}),Object.defineProperty(t,"nil",{enumerable:!0,get:function(){return o.nil}}),Object.defineProperty(t,"getProperty",{enumerable:!0,get:function(){return o.getProperty}}),Object.defineProperty(t,"stringify",{enumerable:!0,get:function(){return o.stringify}}),Object.defineProperty(t,"regexpCode",{enumerable:!0,get:function(){return o.regexpCode}}),Object.defineProperty(t,"Name",{enumerable:!0,get:function(){return o.Name}});var s=r(19823);Object.defineProperty(t,"Scope",{enumerable:!0,get:function(){return s.Scope}}),Object.defineProperty(t,"ValueScope",{enumerable:!0,get:function(){return s.ValueScope}}),Object.defineProperty(t,"ValueScopeName",{enumerable:!0,get:function(){return s.ValueScopeName}}),Object.defineProperty(t,"varKinds",{enumerable:!0,get:function(){return s.varKinds}}),t.operators={GT:new n._Code(">"),GTE:new n._Code(">="),LT:new n._Code("<"),LTE:new n._Code("<="),EQ:new n._Code("==="),NEQ:new n._Code("!=="),NOT:new n._Code("!"),OR:new n._Code("||"),AND:new n._Code("&&"),ADD:new n._Code("+")};class a{optimizeNodes(){return this}optimizeNames(e,t){return this}}class c extends a{constructor(e,t,r){super(),this.varKind=e,this.name=t,this.rhs=r}render({es5:e,_n:t}){let r=e?i.varKinds.var:this.varKind,n=void 0===this.rhs?"":` = ${this.rhs}`;return`${r} ${this.name}${n};`+t}optimizeNames(e,t){if(e[this.name.str])return this.rhs&&(this.rhs=k(this.rhs,e,t)),this}get names(){return this.rhs instanceof n._CodeOrName?this.rhs.names:{}}}class u extends a{constructor(e,t,r){super(),this.lhs=e,this.rhs=t,this.sideEffects=r}render({_n:e}){return`${this.lhs} = ${this.rhs};`+e}optimizeNames(e,t){if(!(this.lhs instanceof n.Name)||e[this.lhs.str]||this.sideEffects)return this.rhs=k(this.rhs,e,t),this}get names(){return N(this.lhs instanceof n.Name?{}:{...this.lhs.names},this.rhs)}}class l extends u{constructor(e,t,r,n){super(e,r,n),this.op=t}render({_n:e}){return`${this.lhs} ${this.op}= ${this.rhs};`+e}}class d extends a{constructor(e){super(),this.label=e,this.names={}}render({_n:e}){return`${this.label}:`+e}}class f extends a{constructor(e){super(),this.label=e,this.names={}}render({_n:e}){let t=this.label?` ${this.label}`:"";return`break${t};`+e}}class h extends a{constructor(e){super(),this.error=e}render({_n:e}){return`throw ${this.error};`+e}get names(){return this.error.names}}class p extends a{constructor(e){super(),this.code=e}render({_n:e}){return`${this.code};`+e}optimizeNodes(){return`${this.code}`?this:void 0}optimizeNames(e,t){return this.code=k(this.code,e,t),this}get names(){return this.code instanceof n._CodeOrName?this.code.names:{}}}class y extends a{constructor(e=[]){super(),this.nodes=e}render(e){return this.nodes.reduce((t,r)=>t+r.render(e),"")}optimizeNodes(){let{nodes:e}=this,t=e.length;for(;t--;){let r=e[t].optimizeNodes();Array.isArray(r)?e.splice(t,1,...r):r?e[t]=r:e.splice(t,1)}return e.length>0?this:void 0}optimizeNames(e,t){let{nodes:r}=this,n=r.length;for(;n--;){let i=r[n];i.optimizeNames(e,t)||(C(e,i.names),r.splice(n,1))}return r.length>0?this:void 0}get names(){return this.nodes.reduce((e,t)=>M(e,t.names),{})}}class g extends y{render(e){return"{"+e._n+super.render(e)+"}"+e._n}}class m extends y{}class b extends g{}b.kind="else";class v extends g{constructor(e,t){super(t),this.condition=e}render(e){let t=`if(${this.condition})`+super.render(e);return this.else&&(t+="else "+this.else.render(e)),t}optimizeNodes(){super.optimizeNodes();let e=this.condition;if(!0===e)return this.nodes;let t=this.else;if(t){let e=t.optimizeNodes();t=this.else=Array.isArray(e)?new b(e):e}return t?!1===e?t instanceof v?t:t.nodes:this.nodes.length?this:new v(D(e),t instanceof v?[t]:t.nodes):!1!==e&&this.nodes.length?this:void 0}optimizeNames(e,t){var r;if(this.else=null===(r=this.else)||void 0===r?void 0:r.optimizeNames(e,t),super.optimizeNames(e,t)||this.else)return this.condition=k(this.condition,e,t),this}get names(){let e=super.names;return N(e,this.condition),this.else&&M(e,this.else.names),e}}v.kind="if";class w extends g{}w.kind="for";class _ extends w{constructor(e){super(),this.iteration=e}render(e){return`for(${this.iteration})`+super.render(e)}optimizeNames(e,t){if(super.optimizeNames(e,t))return this.iteration=k(this.iteration,e,t),this}get names(){return M(super.names,this.iteration.names)}}class E extends w{constructor(e,t,r,n){super(),this.varKind=e,this.name=t,this.from=r,this.to=n}render(e){let t=e.es5?i.varKinds.var:this.varKind,{name:r,from:n,to:o}=this;return`for(${t} ${r}=${n}; ${r}<${o}; ${r}++)`+super.render(e)}get names(){let e=N(super.names,this.from);return N(e,this.to)}}class S extends w{constructor(e,t,r,n){super(),this.loop=e,this.varKind=t,this.name=r,this.iterable=n}render(e){return`for(${this.varKind} ${this.name} ${this.loop} ${this.iterable})`+super.render(e)}optimizeNames(e,t){if(super.optimizeNames(e,t))return this.iterable=k(this.iterable,e,t),this}get names(){return M(super.names,this.iterable.names)}}class x extends g{constructor(e,t,r){super(),this.name=e,this.args=t,this.async=r}render(e){let t=this.async?"async ":"";return`${t}function ${this.name}(${this.args})`+super.render(e)}}x.kind="func";class A extends y{render(e){return"return "+super.render(e)}}A.kind="return";class I extends g{render(e){let t="try"+super.render(e);return this.catch&&(t+=this.catch.render(e)),this.finally&&(t+=this.finally.render(e)),t}optimizeNodes(){var e,t;return super.optimizeNodes(),null===(e=this.catch)||void 0===e||e.optimizeNodes(),null===(t=this.finally)||void 0===t||t.optimizeNodes(),this}optimizeNames(e,t){var r,n;return super.optimizeNames(e,t),null===(r=this.catch)||void 0===r||r.optimizeNames(e,t),null===(n=this.finally)||void 0===n||n.optimizeNames(e,t),this}get names(){let e=super.names;return this.catch&&M(e,this.catch.names),this.finally&&M(e,this.finally.names),e}}class O extends g{constructor(e){super(),this.error=e}render(e){return`catch(${this.error})`+super.render(e)}}O.kind="catch";class T extends g{render(e){return"finally"+super.render(e)}}T.kind="finally";class P{constructor(e,t={}){this._values={},this._blockStarts=[],this._constants={},this.opts={...t,_n:t.lines?"\n":""},this._extScope=e,this._scope=new i.Scope({parent:e}),this._nodes=[new m]}toString(){return this._root.render(this.opts)}name(e){return this._scope.name(e)}scopeName(e){return this._extScope.name(e)}scopeValue(e,t){let r=this._extScope.value(e,t);return(this._values[r.prefix]||(this._values[r.prefix]=new Set)).add(r),r}getScopeValue(e,t){return this._extScope.getValue(e,t)}scopeRefs(e){return this._extScope.scopeRefs(e,this._values)}scopeCode(){return this._extScope.scopeCode(this._values)}_def(e,t,r,n){let i=this._scope.toName(t);return void 0!==r&&n&&(this._constants[i.str]=r),this._leafNode(new c(e,i,r)),i}const(e,t,r){return this._def(i.varKinds.const,e,t,r)}let(e,t,r){return this._def(i.varKinds.let,e,t,r)}var(e,t,r){return this._def(i.varKinds.var,e,t,r)}assign(e,t,r){return this._leafNode(new u(e,t,r))}add(e,r){return this._leafNode(new l(e,t.operators.ADD,r))}code(e){return"function"==typeof e?e():e!==n.nil&&this._leafNode(new p(e)),this}object(...e){let t=["{"];for(let[r,i]of e)t.length>1&&t.push(","),t.push(r),(r!==i||this.opts.es5)&&(t.push(":"),(0,n.addCodeArg)(t,i));return t.push("}"),new n._Code(t)}
24if(e,t,r){if(this._blockNode(new v(e)),t&&r)this.code(t).else().code(r).endIf();else if(t)this.code(t).endIf();else if(r)throw Error('CodeGen: "else" body without "then" body');return this}elseIf(e){return this._elseNode(new v(e))}else(){return this._elseNode(new b)}endIf(){return this._endBlockNode(v,b)}_for(e,t){return this._blockNode(e),t&&this.code(t).endFor(),this}for(e,t){return this._for(new _(e),t)}forRange(e,t,r,n,o=this.opts.es5?i.varKinds.var:i.varKinds.let){let s=this._scope.toName(e);return this._for(new E(o,s,t,r),()=>n(s))}forOf(e,t,r,o=i.varKinds.const){let s=this._scope.toName(e);if(this.opts.es5){let e=t instanceof n.Name?t:this.var("_arr",t);return this.forRange("_i",0,(0,n._)`${e}.length`,t=>{this.var(s,(0,n._)`${e}[${t}]`),r(s)})}return this._for(new S("of",o,s,t),()=>r(s))}forIn(e,t,r,o=this.opts.es5?i.varKinds.var:i.varKinds.const){if(this.opts.ownProperties)return this.forOf(e,(0,n._)`Object.keys(${t})`,r);let s=this._scope.toName(e);return this._for(new S("in",o,s,t),()=>r(s))}endFor(){return this._endBlockNode(w)}label(e){return this._leafNode(new d(e))}break(e){return this._leafNode(new f(e))}return(e){let t=new A;if(this._blockNode(t),this.code(e),1!==t.nodes.length)throw Error('CodeGen: "return" should have one node');return this._endBlockNode(A)}try(e,t,r){if(!t&&!r)throw Error('CodeGen: "try" without "catch" and "finally"');let n=new I;if(this._blockNode(n),this.code(e),t){let e=this.name("e");this._currNode=n.catch=new O(e),t(e)}return r&&(this._currNode=n.finally=new T,this.code(r)),this._endBlockNode(O,T)}throw(e){return this._leafNode(new h(e))}block(e,t){return this._blockStarts.push(this._nodes.length),e&&this.code(e).endBlock(t),this}endBlock(e){let t=this._blockStarts.pop();if(void 0===t)throw Error("CodeGen: not in self-balancing block");let r=this._nodes.length-t;if(r<0||void 0!==e&&r!==e)throw Error(`CodeGen: wrong number of nodes: ${r} vs ${e} expected`);return this._nodes.length=t,this}func(e,t=n.nil,r,i){return this._blockNode(new x(e,t,r)),i&&this.code(i).endFunc(),this}endFunc(){return this._endBlockNode(x)}optimize(e=1){for(;e-- >0;)this._root.optimizeNodes(),this._root.optimizeNames(this._root.names,this._constants)}_leafNode(e){return this._currNode.nodes.push(e),this}_blockNode(e){this._currNode.nodes.push(e),this._nodes.push(e)}_endBlockNode(e,t){let r=this._currNode;if(r instanceof e||t&&r instanceof t)return this._nodes.pop(),this;throw Error(`CodeGen: not in block "${t?`${e.kind}/${t.kind}`:e.kind}"`)}_elseNode(e){let t=this._currNode;if(!(t instanceof v))throw Error('CodeGen: "else" without "if"');return this._currNode=t.else=e,this}get _root(){return this._nodes[0]}get _currNode(){let e=this._nodes;return e[e.length-1]}set _currNode(e){let t=this._nodes;t[t.length-1]=e}}function M(e,t){for(let r in t)e[r]=(e[r]||0)+(t[r]||0);return e}function N(e,t){return t instanceof n._CodeOrName?M(e,t.names):e}function k(e,t,r){if(e instanceof n.Name)return i(e);if(!o(e))return e;return new n._Code(e._items.reduce((e,t)=>(t instanceof n.Name&&(t=i(t)),t instanceof n._Code?e.push(...t._items):e.push(t),e),[]));function i(e){let n=r[e.str];return void 0===n||1!==t[e.str]?e:(delete t[e.str],n)}function o(e){return e instanceof n._Code&&e._items.some(e=>e instanceof n.Name&&1===t[e.str]&&void 0!==r[e.str])}}function C(e,t){for(let r in t)e[r]=(e[r]||0)-(t[r]||0)}function D(e){return"boolean"==typeof e||"number"==typeof e||null===e?!e:(0,n._)`!${$(e)}`}t.CodeGen=P,t.not=D;let j=U(t.operators.AND);function R(...e){return e.reduce(j)}t.and=R;let L=U(t.operators.OR);function B(...e){return e.reduce(L)}function U(e){return(t,r)=>t===n.nil?r:r===n.nil?t:(0,n._)`${$(t)} ${e} ${$(r)}`}function $(e){return e instanceof n.Name?e:(0,n._)`(${e})`}t.or=B},19823:(e,t,r)=>{"use strict";var n;Object.defineProperty(t,"__esModule",{value:!0}),t.ValueScope=t.ValueScopeName=t.Scope=t.varKinds=t.UsedValueState=void 0;let i=r(37192);class o extends Error{constructor(e){super(`CodeGen: "code" for ${e} not defined`),this.value=e.value}}!function(e){e[e.Started=0]="Started",e[e.Completed=1]="Completed"}(n||(t.UsedValueState=n={})),t.varKinds={const:new i.Name("const"),let:new i.Name("let"),var:new i.Name("var")};class s{constructor({prefixes:e,parent:t}={}){this._names={},this._prefixes=e,this._parent=t}toName(e){return e instanceof i.Name?e:this.name(e)}name(e){return new i.Name(this._newName(e))}_newName(e){let t=this._names[e]||this._nameGroup(e);return`${e}${t.index++}`}_nameGroup(e){var t,r;if((null===(r=null===(t=this._parent)||void 0===t?void 0:t._prefixes)||void 0===r?void 0:r.has(e))||this._prefixes&&!this._prefixes.has(e))throw Error(`CodeGen: prefix "${e}" is not allowed in this scope`);return this._names[e]={prefix:e,index:0}}}t.Scope=s;class a extends i.Name{constructor(e,t){super(t),this.prefix=e}setValue(e,{property:t,itemIndex:r}){this.value=e,this.scopePath=(0,i._)`.${new i.Name(t)}[${r}]`}}t.ValueScopeName=a;let c=(0,i._)`\n`;class u extends s{constructor(e){super(e),this._values={},this._scope=e.scope,this.opts={...e,_n:e.lines?c:i.nil}}get(){return this._scope}name(e){return new a(e,this._newName(e))}value(e,t){var r;if(void 0===t.ref)throw Error("CodeGen: ref must be passed in value");let n=this.toName(e),{prefix:i}=n,o=null!==(r=t.key)&&void 0!==r?r:t.ref,s=this._values[i];if(s){let e=s.get(o);if(e)return e}else s=this._values[i]=new Map;s.set(o,n);let a=this._scope[i]||(this._scope[i]=[]),c=a.length;return a[c]=t.ref,n.setValue(t,{property:i,itemIndex:c}),n}getValue(e,t){let r=this._values[e];if(r)return r.get(t)}scopeRefs(e,t=this._values){return this._reduceValues(t,t=>{if(void 0===t.scopePath)throw Error(`CodeGen: name "${t}" has no value`);return(0,i._)`${e}${t.scopePath}`})}scopeCode(e=this._values,t,r){return this._reduceValues(e,e=>{if(void 0===e.value)throw Error(`CodeGen: name "${e}" has no value`);return e.value.code},t,r)}_reduceValues(e,r,s={},a){let c=i.nil;for(let u in e){let l=e[u];if(!l)continue;let d=s[u]=s[u]||new Map;
24l.forEach(e=>{if(d.has(e))return;d.set(e,n.Started);let s=r(e);if(s){let r=this.opts.es5?t.varKinds.var:t.varKinds.const;c=(0,i._)`${c}${r} ${e} = ${s};${this.opts._n}`}else if(s=null==a?void 0:a(e))c=(0,i._)`${c}${s}${this.opts._n}`;else throw new o(e);d.set(e,n.Completed)})}return c}}t.ValueScope=u},8492:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.extendErrors=t.resetErrorsCount=t.reportExtraError=t.reportError=t.keyword$DataError=t.keywordError=void 0;let n=r(99991),i=r(35191),o=r(52841);function s(e,r=t.keywordError,i,o){let{it:a}=e,{gen:c,compositeRule:u,allErrors:f}=a,p=h(e,r,i);(null!=o?o:u||f)?l(c,p):d(a,(0,n._)`[${p}]`)}function a(e,r=t.keywordError,n){let{it:i}=e,{gen:s,compositeRule:c,allErrors:u}=i;l(s,h(e,r,n)),c||u||d(i,o.default.vErrors)}function c(e,t){e.assign(o.default.errors,t),e.if((0,n._)`${o.default.vErrors} !== null`,()=>e.if(t,()=>e.assign((0,n._)`${o.default.vErrors}.length`,t),()=>e.assign(o.default.vErrors,null)))}function u({gen:e,keyword:t,schemaValue:r,data:i,errsCount:s,it:a}){if(void 0===s)throw Error("ajv implementation error");let c=e.name("err");e.forRange("i",s,o.default.errors,s=>{e.const(c,(0,n._)`${o.default.vErrors}[${s}]`),e.if((0,n._)`${c}.instancePath === undefined`,()=>e.assign((0,n._)`${c}.instancePath`,(0,n.strConcat)(o.default.instancePath,a.errorPath))),e.assign((0,n._)`${c}.schemaPath`,(0,n.str)`${a.errSchemaPath}/${t}`),a.opts.verbose&&(e.assign((0,n._)`${c}.schema`,r),e.assign((0,n._)`${c}.data`,i))})}function l(e,t){let r=e.const("err",t);e.if((0,n._)`${o.default.vErrors} === null`,()=>e.assign(o.default.vErrors,(0,n._)`[${r}]`),(0,n._)`${o.default.vErrors}.push(${r})`),e.code((0,n._)`${o.default.errors}++`)}function d(e,t){let{gen:r,validateName:i,schemaEnv:o}=e;o.$async?r.throw((0,n._)`new ${e.ValidationError}(${t})`):(r.assign((0,n._)`${i}.errors`,t),r.return(!1))}t.keywordError={message:({keyword:e})=>(0,n.str)`must pass "${e}" keyword validation`},t.keyword$DataError={message:({keyword:e,schemaType:t})=>t?(0,n.str)`"${e}" keyword must be ${t} ($data)`:(0,n.str)`"${e}" keyword is invalid ($data)`},t.reportError=s,t.reportExtraError=a,t.resetErrorsCount=c,t.extendErrors=u;let f={keyword:new n.Name("keyword"),schemaPath:new n.Name("schemaPath"),params:new n.Name("params"),propertyName:new n.Name("propertyName"),message:new n.Name("message"),schema:new n.Name("schema"),parentSchema:new n.Name("parentSchema")};function h(e,t,r){let{createErrors:i}=e.it;return!1===i?(0,n._)`{}`:p(e,t,r)}function p(e,t,r={}){let{gen:n,it:i}=e,o=[y(i,r),g(e,r)];return m(e,t,o),n.object(...o)}function y({errorPath:e},{instancePath:t}){let r=t?(0,n.str)`${e}${(0,i.getErrorPath)(t,i.Type.Str)}`:e;return[o.default.instancePath,(0,n.strConcat)(o.default.instancePath,r)]}function g({keyword:e,it:{errSchemaPath:t}},{schemaPath:r,parentSchema:o}){let s=o?t:(0,n.str)`${t}/${e}`;return r&&(s=(0,n.str)`${s}${(0,i.getErrorPath)(r,i.Type.Str)}`),[f.schemaPath,s]}function m(e,{params:t,message:r},i){let{keyword:s,data:a,schemaValue:c,it:u}=e,{opts:l,propertyName:d,topSchemaRef:h,schemaPath:p}=u;i.push([f.keyword,s],[f.params,"function"==typeof t?t(e):t||(0,n._)`{}`]),l.messages&&i.push([f.message,"function"==typeof r?r(e):r]),l.verbose&&i.push([f.schema,c],[f.parentSchema,(0,n._)`${h}${p}`],[o.default.data,a]),d&&i.push([f.propertyName,d])}},71853:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.resolveSchema=t.getCompilingSchema=t.resolveRef=t.compileSchema=t.SchemaEnv=void 0;let n=r(99991),i=r(4450),o=r(52841),s=r(26997),a=r(35191),c=r(47594);class u{constructor(e){var t;let r;this.refs={},this.dynamicAnchors={},"object"==typeof e.schema&&(r=e.schema),this.schema=e.schema,this.schemaId=e.schemaId,this.root=e.root||this,this.baseId=null!==(t=e.baseId)&&void 0!==t?t:(0,s.normalizeId)(null==r?void 0:r[e.schemaId||"$id"]),this.schemaPath=e.schemaPath,this.localRefs=e.localRefs,this.meta=e.meta,this.$async=null==r?void 0:r.$async,this.refs={}}}function l(e){let t,r;let a=h.call(this,e);if(a)return a;let u=(0,s.getFullPath)(this.opts.uriResolver,e.root.baseId),{es5:l,lines:d}=this.opts.code,{ownProperties:f}=this.opts,p=new n.CodeGen(this.scope,{es5:l,lines:d,ownProperties:f});e.$async&&(t=p.scopeValue("Error",{ref:i.default,code:(0,n._)`require("ajv/dist/runtime/validation_error").default`}));let y=p.scopeName("validate");e.validateName=y;let g={gen:p,allErrors:this.opts.allErrors,data:o.default.data,parentData:o.default.parentData,parentDataProperty:o.default.parentDataProperty,dataNames:[o.default.data],dataPathArr:[n.nil],dataLevel:0,dataTypes:[],definedProperties:new Set,topSchemaRef:p.scopeValue("schema",!0===this.opts.code.source?{ref:e.schema,code:(0,n.stringify)(e.schema)}:{ref:e.schema}),validateName:y,ValidationError:t,schema:e.schema,schemaEnv:e,rootId:u,baseId:e.baseId||u,schemaPath:n.nil,errSchemaPath:e.schemaPath||(this.opts.jtd?"":"#"),errorPath:(0,n._)`""`,opts:this.opts,self:this};try{this._compilations.add(e),(0,c.validateFunctionCode)(g),p.optimize(this.opts.code.optimize);let t=p.toString();r=`${p.scopeRefs(o.default.scope)}return ${t}`,this.opts.code.process&&(r=this.opts.code.process(r,e));let i=Function(`${o.default.self}`,`${o.default.scope}`,r)(this,this.scope.get());if(this.scope.value(y,{ref:i}
24),i.errors=null,i.schema=e.schema,i.schemaEnv=e,e.$async&&(i.$async=!0),!0===this.opts.code.source&&(i.source={validateName:y,validateCode:t,scopeValues:p._values}),this.opts.unevaluated){let{props:e,items:t}=g;i.evaluated={props:e instanceof n.Name?void 0:e,items:t instanceof n.Name?void 0:t,dynamicProps:e instanceof n.Name,dynamicItems:t instanceof n.Name},i.source&&(i.source.evaluated=(0,n.stringify)(i.evaluated))}return e.validate=i,e}catch(t){throw delete e.validate,delete e.validateName,r&&this.logger.error("Error compiling schema, function code:",r),t}finally{this._compilations.delete(e)}}function d(e,t,r){var n;r=(0,s.resolveUrl)(this.opts.uriResolver,t,r);let i=e.refs[r];if(i)return i;let o=y.call(this,e,r);if(void 0===o){let i=null===(n=e.localRefs)||void 0===n?void 0:n[r],{schemaId:s}=this.opts;i&&(o=new u({schema:i,schemaId:s,root:e,baseId:t}))}if(void 0!==o)return e.refs[r]=f.call(this,o)}function f(e){return(0,s.inlineRef)(e.schema,this.opts.inlineRefs)?e.schema:e.validate?e:l.call(this,e)}function h(e){for(let t of this._compilations)if(p(t,e))return t}function p(e,t){return e.schema===t.schema&&e.root===t.root&&e.baseId===t.baseId}function y(e,t){let r;for(;"string"==typeof(r=this.refs[t]);)t=r;return r||this.schemas[t]||g.call(this,e,t)}function g(e,t){let r=this.opts.uriResolver.parse(t),n=(0,s._getFullPath)(this.opts.uriResolver,r),i=(0,s.getFullPath)(this.opts.uriResolver,e.baseId,void 0);if(Object.keys(e.schema).length>0&&n===i)return b.call(this,r,e);let o=(0,s.normalizeId)(n),a=this.refs[o]||this.schemas[o];if("string"==typeof a){let t=g.call(this,e,a);if("object"!=typeof(null==t?void 0:t.schema))return;return b.call(this,r,t)}if("object"==typeof(null==a?void 0:a.schema)){if(a.validate||l.call(this,a),o===(0,s.normalizeId)(t)){let{schema:t}=a,{schemaId:r}=this.opts,n=t[r];return n&&(i=(0,s.resolveUrl)(this.opts.uriResolver,i,n)),new u({schema:t,schemaId:r,root:e,baseId:i})}return b.call(this,r,a)}}t.SchemaEnv=u,t.compileSchema=l,t.resolveRef=d,t.getCompilingSchema=h,t.resolveSchema=g;let m=new Set(["properties","patternProperties","enum","dependencies","definitions"]);function b(e,{baseId:t,schema:r,root:n}){var i;let o;if((null===(i=e.fragment)||void 0===i?void 0:i[0])!=="/")return;for(let n of e.fragment.slice(1).split("/")){if("boolean"==typeof r)return;let e=r[(0,a.unescapeFragment)(n)];if(void 0===e)return;let i="object"==typeof(r=e)&&r[this.opts.schemaId];!m.has(n)&&i&&(t=(0,s.resolveUrl)(this.opts.uriResolver,t,i))}if("boolean"!=typeof r&&r.$ref&&!(0,a.schemaHasRulesButRef)(r,this.RULES)){let e=(0,s.resolveUrl)(this.opts.uriResolver,t,r.$ref);o=g.call(this,n,e)}let{schemaId:c}=this.opts;if((o=o||new u({schema:r,schemaId:c,root:n,baseId:t})).schema!==o.root.schema)return o}},52841:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});let n=r(99991),i={data:new n.Name("data"),valCxt:new n.Name("valCxt"),instancePath:new n.Name("instancePath"),parentData:new n.Name("parentData"),parentDataProperty:new n.Name("parentDataProperty"),rootData:new n.Name("rootData"),dynamicAnchors:new n.Name("dynamicAnchors"),vErrors:new n.Name("vErrors"),errors:new n.Name("errors"),this:new n.Name("this"),self:new n.Name("self"),scope:new n.Name("scope"),json:new n.Name("json"),jsonPos:new n.Name("jsonPos"),jsonLen:new n.Name("jsonLen"),jsonPart:new n.Name("jsonPart")};t.default=i},4481:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});let n=r(26997);
24class i extends Error{constructor(e,t,r,i){super(i||`can't resolve reference ${r} from id ${t}`),this.missingRef=(0,n.resolveUrl)(e,t,r),this.missingSchema=(0,n.normalizeId)((0,n.getFullPath)(e,this.missingRef))}}t.default=i},26997:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getSchemaRefs=t.resolveUrl=t.normalizeId=t._getFullPath=t.getFullPath=t.inlineRef=void 0;let n=r(35191),i=r(85979),o=r(69272),s=new Set(["type","format","pattern","maxLength","minLength","maxProperties","minProperties","maxItems","minItems","maximum","minimum","uniqueItems","multipleOf","required","enum","const"]);function a(e,t=!0){return"boolean"==typeof e||(!0===t?!u(e):!!t&&l(e)<=t)}t.inlineRef=a;let c=new Set(["$ref","$recursiveRef","$recursiveAnchor","$dynamicRef","$dynamicAnchor"]);function u(e){for(let t in e){if(c.has(t))return!0;let r=e[t];if(Array.isArray(r)&&r.some(u)||"object"==typeof r&&u(r))return!0}return!1}function l(e){let t=0;for(let r in e)if("$ref"===r||(t++,!s.has(r)&&("object"==typeof e[r]&&(0,n.eachItem)(e[r],e=>t+=l(e)),t===1/0)))return 1/0;return t}function d(e,t="",r){!1!==r&&(t=p(t));let n=e.parse(t);return f(e,n)}function f(e,t){return e.serialize(t).split("#")[0]+"#"}t.getFullPath=d,t._getFullPath=f;let h=/#\/?$/;function p(e){return e?e.replace(h,""):""}function y(e,t,r){return r=p(r),e.resolve(t,r)}t.normalizeId=p,t.resolveUrl=y;let g=/^[a-z_][-a-z0-9._]*$/i;function m(e,t){if("boolean"==typeof e)return{};let{schemaId:r,uriResolver:n}=this.opts,s=p(e[r]||t),a={"":s},c=d(n,s,!1),u={},l=new Set;return o(e,{allKeys:!0},(e,t,n,i)=>{if(void 0===i)return;let o=c+t,s=a[i];function d(t){let r=this.opts.uriResolver.resolve;if(t=p(s?r(s,t):t),l.has(t))throw h(t);l.add(t);let n=this.refs[t];return"string"==typeof n&&(n=this.refs[n]),"object"==typeof n?f(e,n.schema,t):t!==p(o)&&("#"===t[0]?(f(e,u[t],t),u[t]=e):this.refs[t]=o),t}function y(e){if("string"==typeof e){if(!g.test(e))throw Error(`invalid anchor "${e}"`);d.call(this,`#${e}`)}}"string"==typeof e[r]&&(s=d.call(this,e[r])),y.call(this,e.$anchor),y.call(this,e.$dynamicAnchor),a[t]=s}),u;function f(e,t,r){if(void 0!==t&&!i(e,t))throw h(r)}function h(e){return Error(`reference "${e}" resolves to more than one schema`)}}t.getSchemaRefs=m},33402:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getRules=t.isJSONType=void 0;let r=new Set(["string","number","integer","boolean","null","object","array"]);function n(e){return"string"==typeof e&&r.has(e)}function i(){let e={number:{type:"number",rules:[]},string:{type:"string",rules:[]},array:{type:"array",rules:[]},object:{type:"object",rules:[]}};return{types:{...e,integer:!0,boolean:!0,null:!0},rules:[{rules:[]},e.number,e.string,e.array,e.object],post:{rules:[]},all:{},keywords:{}}}t.isJSONType=n,t.getRules=i},35191:(e,t,r)=>{"use strict";var n;Object.defineProperty(t,"__esModule",{value:!0}),t.checkStrictMode=t.getErrorPath=t.Type=t.useFunc=t.setEvaluated=t.evaluatedPropsToName=t.mergeEvaluated=t.eachItem=t.unescapeJsonPointer=t.escapeJsonPointer=t.escapeFragment=t.unescapeFragment=t.schemaRefOrVal=t.schemaHasRulesButRef=t.schemaHasRules=t.checkUnknownRules=t.alwaysValidSchema=t.toHash=void 0;let i=r(99991),o=r(37192);function s(e){let t={};for(let r of e)t[r]=!0;return t}function a(e,t){return"boolean"==typeof t?t:0===Object.keys(t).length||(c(e,t),!u(t,e.self.RULES.all))}function c(e,t=e.schema){let{opts:r,self:n}=e;if(!r.strictSchema||"boolean"==typeof t)return;let i=n.RULES.keywords;for(let r in t)i[r]||S(e,`unknown keyword: "${r}"`)}function u(e,t){if("boolean"==typeof e)return!e;for(let r in e)if(t[r])return!0;return!1}function l(e,t){if("boolean"==typeof e)return!e;for(let r in e)if("$ref"!==r&&t.all[r])return!0;return!1}function d({topSchemaRef:e,schemaPath:t},r,n,o){if(!o){if("number"==typeof r||"boolean"==typeof r)return r;if("string"==typeof r)return(0,i._)`${r}`}return(0,i._)`${e}${t}${(0,i.getProperty)(n)}`}function f(e){return y(decodeURIComponent(e))}function h(e){return encodeURIComponent(p(e))}function p(e){return"number"==typeof e?`${e}`:e.replace(/~/g,"~0").replace(/\//g,"~1")}function y(e){return e.replace(/~1/g,"/").replace(/~0/g,"~")}function g(e,t){if(Array.isArray(e))for(let r of e)t(r);else t(e)}function m({mergeNames:e,mergeToName:t,mergeValues:r,resultToName:n}){return(o,s,a,c)=>{let u=void 0===a?s:a instanceof i.Name?(s instanceof i.Name?e(o,s,a):t(o,s,a),a):s instanceof i.Name?(t(o,a,s),s):r(s,a);return c!==i.Name||u instanceof i.Name?u:n(o,u)}}function b(e,t){if(!0===t)return e.var("props",!0);let r=e.var("props",(0,i._)`{}`);return void 0!==t&&v(e,r,t),r}function v(e,t,r){Object.keys(r).forEach(r=>e.assign((0,i._)`${t}${(0,i.getProperty)(r)}`,!0))}t.toHash=s,t.alwaysValidSchema=a,t.checkUnknownRules=c,t.schemaHasRules=u,t.schemaHasRulesButRef=l,t.schemaRefOrVal=d,t.unescapeFragment=f,t.escapeFragment=h,t.escapeJsonPointer=p,t.unescapeJsonPointer=y,t.eachItem=g,t.mergeEvaluated={props:m({mergeNames:(e,t,r)=>e.if((0,i._)`${r} !== true && ${t} !== undefined`,()=>{e.if((0,i._)`${t} === true`,()=>e.assign(r,!0),()=>e.assign(r,(0,i._)`${r} || {}`).code((0,i._)`Object.assign(${r}, ${t})`))}),mergeToName:(e,t,r)=>e.if((0,i._)`${r} !== true`,()=>{!0===t?e.assign(r,!0):(e.assign(r,(0,i._)`${r} || {}`),v(e,r,t))}),mergeValues:(e,t)=>!0===e||{...e,...t},resultToName:b}),items:m({mergeNames:(e,t,r)=>e.if((0,i._)`${r} !== true && ${t} !== undefined`,()=>e.assign(r,(0,i._)`${t} === true ? true : ${r} > ${t} ? ${r} : ${t}`)),mergeToName:(e,t,r)=>e.if((0,i._)`${r} !== true`,()=>e.assign(r,!0===t||(0,i._)`${r} > ${t} ? ${r} : ${t}`)),mergeValues:(e,t)=>!0===e||Math.max(e,t),resultToName:(e,t)=>
24e.var("items",t)})},t.evaluatedPropsToName=b,t.setEvaluated=v;let w={};function _(e,t){return e.scopeValue("func",{ref:t,code:w[t.code]||(w[t.code]=new o._Code(t.code))})}function E(e,t,r){if(e instanceof i.Name){let o=t===n.Num;return r?o?(0,i._)`"[" + ${e} + "]"`:(0,i._)`"['" + ${e} + "']"`:o?(0,i._)`"/" + ${e}`:(0,i._)`"/" + ${e}.replace(/~/g, "~0").replace(/\\//g, "~1")`}return r?(0,i.getProperty)(e).toString():"/"+p(e)}function S(e,t,r=e.opts.strictSchema){if(r){if(t=`strict mode: ${t}`,!0===r)throw Error(t);e.self.logger.warn(t)}}t.useFunc=_,function(e){e[e.Num=0]="Num",e[e.Str=1]="Str"}(n||(t.Type=n={})),t.getErrorPath=E,t.checkStrictMode=S},13011:(e,t)=>{"use strict";function r({schema:e,self:t},r){let i=t.RULES.types[r];return i&&!0!==i&&n(e,i)}function n(e,t){return t.rules.some(t=>i(e,t))}function i(e,t){var r;return void 0!==e[t.keyword]||(null===(r=t.definition.implements)||void 0===r?void 0:r.some(t=>void 0!==e[t]))}Object.defineProperty(t,"__esModule",{value:!0}),t.shouldUseRule=t.shouldUseGroup=t.schemaHasRulesForType=void 0,t.schemaHasRulesForType=r,t.shouldUseGroup=n,t.shouldUseRule=i},77593:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.boolOrEmptySchema=t.topBoolOrEmptySchema=void 0;let n=r(8492),i=r(99991),o=r(52841),s={message:"boolean schema is false"};function a(e){let{gen:t,schema:r,validateName:n}=e;!1===r?u(e,!1):"object"==typeof r&&!0===r.$async?t.return(o.default.data):(t.assign((0,i._)`${n}.errors`,null),t.return(!0))}function c(e,t){let{gen:r,schema:n}=e;!1===n?(r.var(t,!1),u(e)):r.var(t,!0)}function u(e,t){let{gen:r,data:i}=e,o={gen:r,keyword:"false schema",data:i,schema:!1,schemaCode:!1,schemaValue:!1,params:{},it:e};(0,n.reportError)(o,s,void 0,t)}t.topBoolOrEmptySchema=a,t.boolOrEmptySchema=c},71894:(e,t,r)=>{"use strict";var n;Object.defineProperty(t,"__esModule",{value:!0}),t.reportTypeError=t.checkDataTypes=t.checkDataType=t.coerceAndCheckDataType=t.getJSONTypes=t.getSchemaTypes=t.DataType=void 0;let i=r(33402),o=r(13011),s=r(8492),a=r(99991),c=r(35191);function u(e){let t=l(e.type);if(t.includes("null")){if(!1===e.nullable)throw Error("type: null contradicts nullable: false")}else{if(!t.length&&void 0!==e.nullable)throw Error('"nullable" cannot be used without "type"');!0===e.nullable&&t.push("null")}return t}function l(e){let t=Array.isArray(e)?e:e?[e]:[];if(t.every(i.isJSONType))return t;throw Error("type must be JSONType or JSONType[]: "+t.join(","))}function d(e,t){let{gen:r,data:i,opts:s}=e,a=h(t,s.coerceTypes),c=t.length>0&&!(0===a.length&&1===t.length&&(0,o.schemaHasRulesForType)(e,t[0]));if(c){let o=m(t,i,s.strictNumbers,n.Wrong);r.if(o,()=>{a.length?p(e,t,a):v(e)})}return c}!function(e){e[e.Correct=0]="Correct",e[e.Wrong=1]="Wrong"}(n||(t.DataType=n={})),t.getSchemaTypes=u,t.getJSONTypes=l,t.coerceAndCheckDataType=d;let f=new Set(["string","number","integer","boolean","null"]);function h(e,t){return t?e.filter(e=>f.has(e)||"array"===t&&"array"===e):[]}function p(e,t,r){let{gen:n,data:i,opts:o}=e,s=n.let("dataType",(0,a._)`typeof ${i}`),c=n.let("coerced",(0,a._)`undefined`);for(let e of("array"===o.coerceTypes&&n.if((0,a._)`${s} == 'object' && Array.isArray(${i}) && ${i}.length == 1`,()=>n.assign(i,(0,a._)`${i}[0]`).assign(s,(0,a._)`typeof ${i}`).if(m(t,i,o.strictNumbers),()=>n.assign(c,i))),n.if((0,a._)`${c} !== undefined`),r))(f.has(e)||"array"===e&&"array"===o.coerceTypes)&&u(e);function u(e){switch(e){case"string":n.elseIf((0,a._)`${s} == "number" || ${s} == "boolean"`).assign(c,(0,a._)`"" + ${i}`).elseIf((0,a._)`${i} === null`).assign(c,(0,a._)`""`);return;case"number":n.elseIf((0,a._)`${s} == "boolean" || ${i} === null 25 || (${s} == "string" && ${i} && ${i} == +${i})`).assign(c,(0,a._)`+${i}`);return;case"integer":n.elseIf((0,a._)`${s} === "boolean" || ${i} === null 26 || (${s} === "string" && ${i} && ${i} == +${i} && !(${i} % 1))`).assign(c,(0,a._)`+${i}`);return;case"boolean":n.elseIf((0,a._)`${i} === "false" || ${i} === 0 || ${i} === null`).assign(c,!1).elseIf((0,a._)`${i} === "true" || ${i} === 1`).assign(c,!0);return;case"null":n.elseIf((0,a._)`${i} === "" || ${i} === 0 || ${i} === false`),n.assign(c,null);return;case"array":n.elseIf((0,a._)`${s} === "string" || ${s}
26 === "number" 27 || ${s} === "boolean" || ${i} === null`).assign(c,(0,a._)`[${i}]`)}}n.else(),v(e),n.endIf(),n.if((0,a._)`${c} !== undefined`,()=>{n.assign(i,c),y(e,c)})}function y({gen:e,parentData:t,parentDataProperty:r},n){e.if((0,a._)`${t} !== undefined`,()=>e.assign((0,a._)`${t}[${r}]`,n))}function g(e,t,r,i=n.Correct){let o;let s=i===n.Correct?a.operators.EQ:a.operators.NEQ;switch(e){case"null":return(0,a._)`${t} ${s} null`;case"array":o=(0,a._)`Array.isArray(${t})`;break;case"object":o=(0,a._)`${t} && typeof ${t} == "object" && !Array.isArray(${t})`;break;case"integer":o=c((0,a._)`!(${t} % 1) && !isNaN(${t})`);break;case"number":o=c();break;default:return(0,a._)`typeof ${t} ${s} ${e}`}return i===n.Correct?o:(0,a.not)(o);function c(e=a.nil){return(0,a.and)((0,a._)`typeof ${t} == "number"`,e,r?(0,a._)`isFinite(${t})`:a.nil)}}function m(e,t,r,n){let i;if(1===e.length)return g(e[0],t,r,n);let o=(0,c.toHash)(e);if(o.array&&o.object){let e=(0,a._)`typeof ${t} != "object"`;i=o.null?e:(0,a._)`!${t} || ${e}`,delete o.null,delete o.array,delete o.object}else i=a.nil;for(let e in o.number&&delete o.integer,o)i=(0,a.and)(i,g(e,t,r,n));return i}t.checkDataType=g,t.checkDataTypes=m;let b={message:({schema:e})=>`must be ${e}`,params:({schema:e,schemaValue:t})=>"string"==typeof e?(0,a._)`{type: ${e}}`:(0,a._)`{type: ${t}}`};function v(e){let t=w(e);(0,s.reportError)(t,b)}function w(e){let{gen:t,data:r,schema:n}=e,i=(0,c.schemaRefOrVal)(e,n,"type");return{gen:t,keyword:"type",data:r,schema:n.type,schemaCode:i,schemaValue:i,parentSchema:n,params:{},it:e}}t.reportTypeError=v},33972:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.assignDefaults=void 0;let n=r(99991),i=r(35191);function o(e,t){let{properties:r,items:n}=e.schema;if("object"===t&&r)for(let t in r)s(e,t,r[t].default);else"array"===t&&Array.isArray(n)&&n.forEach((t,r)=>s(e,r,t.default))}function s(e,t,r){let{gen:o,compositeRule:s,data:a,opts:c}=e;if(void 0===r)return;let u=(0,n._)`${a}${(0,n.getProperty)(t)}`;if(s){(0,i.checkStrictMode)(e,`default is ignored for: ${u}`);return}let l=(0,n._)`${u} === undefined`;"empty"===c.useDefaults&&(l=(0,n._)`${l} || ${u} === null || ${u} === ""`),o.if(l,(0,n._)`${u} = ${(0,n.stringify)(r)}`)}t.assignDefaults=o},47594:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getData=t.KeywordCxt=t.validateFunctionCode=void 0;let n=r(77593),i=r(71894),o=r(13011),s=r(71894),a=r(33972),c=r(77249),u=r(88407),l=r(99991),d=r(52841),f=r(26997),h=r(35191),p=r(8492);function y(e){if(x(e)&&(I(e),S(e))){v(e);return}g(e,()=>(0,n.topBoolOrEmptySchema)(e))}function g({gen:e,validateName:t,schema:r,schemaEnv:n,opts:i},o){i.code.es5?e.func(t,(0,l._)`${d.default.data}, ${d.default.valCxt}`,n.$async,()=>{e.code((0,l._)`"use strict"; ${_(r,i)}`),b(e,i),e.code(o)}):e.func(t,(0,l._)`${d.default.data}, ${m(i)}`,n.$async,()=>e.code(_(r,i)).code(o))}function m(e){return(0,l._)`{${d.default.instancePath}="", ${d.default.parentData}, ${d.default.parentDataProperty}, ${d.default.rootData}=${d.default.data}${e.dynamicRef?(0,l._)`, ${d.default.dynamicAnchors}={}`:l.nil}}={}`}
27function b(e,t){e.if(d.default.valCxt,()=>{e.var(d.default.instancePath,(0,l._)`${d.default.valCxt}.${d.default.instancePath}`),e.var(d.default.parentData,(0,l._)`${d.default.valCxt}.${d.default.parentData}`),e.var(d.default.parentDataProperty,(0,l._)`${d.default.valCxt}.${d.default.parentDataProperty}`),e.var(d.default.rootData,(0,l._)`${d.default.valCxt}.${d.default.rootData}`),t.dynamicRef&&e.var(d.default.dynamicAnchors,(0,l._)`${d.default.valCxt}.${d.default.dynamicAnchors}`)},()=>{e.var(d.default.instancePath,(0,l._)`""`),e.var(d.default.parentData,(0,l._)`undefined`),e.var(d.default.parentDataProperty,(0,l._)`undefined`),e.var(d.default.rootData,d.default.data),t.dynamicRef&&e.var(d.default.dynamicAnchors,(0,l._)`{}`)})}function v(e){let{schema:t,opts:r,gen:n}=e;g(e,()=>{r.$comment&&t.$comment&&k(e),P(e),n.let(d.default.vErrors,null),n.let(d.default.errors,0),r.unevaluated&&w(e),O(e),C(e)})}function w(e){let{gen:t,validateName:r}=e;e.evaluated=t.const("evaluated",(0,l._)`${r}.evaluated`),t.if((0,l._)`${e.evaluated}.dynamicProps`,()=>t.assign((0,l._)`${e.evaluated}.props`,(0,l._)`undefined`)),t.if((0,l._)`${e.evaluated}.dynamicItems`,()=>t.assign((0,l._)`${e.evaluated}.items`,(0,l._)`undefined`))}function _(e,t){let r="object"==typeof e&&e[t.schemaId];return r&&(t.code.source||t.code.process)?(0,l._)`/*# sourceURL=${r} */`:l.nil}function E(e,t){if(x(e)&&(I(e),S(e))){A(e,t);return}(0,n.boolOrEmptySchema)(e,t)}function S({schema:e,self:t}){if("boolean"==typeof e)return!e;for(let r in e)if(t.RULES.all[r])return!0;return!1}function x(e){return"boolean"!=typeof e.schema}function A(e,t){let{schema:r,gen:n,opts:i}=e;i.$comment&&r.$comment&&k(e),M(e),N(e);let o=n.const("_errs",d.default.errors);O(e,o),n.var(t,(0,l._)`${o} === ${d.default.errors}`)}function I(e){(0,h.checkUnknownRules)(e),T(e)}function O(e,t){if(e.opts.jtd)return j(e,[],!1,t);let r=(0,i.getSchemaTypes)(e.schema),n=(0,i.coerceAndCheckDataType)(e,r);j(e,r,!n,t)}function T(e){let{schema:t,errSchemaPath:r,opts:n,self:i}=e;t.$ref&&n.ignoreKeywordsWithRef&&(0,h.schemaHasRulesButRef)(t,i.RULES)&&i.logger.warn(`$ref: keywords ignored in schema at path "${r}"`)}function P(e){let{schema:t,opts:r}=e;void 0!==t.default&&r.useDefaults&&r.strictSchema&&(0,h.checkStrictMode)(e,"default is ignored in the schema root")}function M(e){let t=e.schema[e.opts.schemaId];t&&(e.baseId=(0,f.resolveUrl)(e.opts.uriResolver,e.baseId,t))}function N(e){if(e.schema.$async&&!e.schemaEnv.$async)throw Error("async schema in sync schema")}function k({gen:e,schemaEnv:t,schema:r,errSchemaPath:n,opts:i}){let o=r.$comment;if(!0===i.$comment)e.code((0,l._)`${d.default.self}.logger.log(${o})`);else if("function"==typeof i.$comment){let r=(0,l.str)`${n}/$comment`,i=e.scopeValue("root",{ref:t.root});e.code((0,l._)`${d.default.self}.opts.$comment(${o}, ${r}, ${i}.schema)`)}}function C(e){let{gen:t,schemaEnv:r,validateName:n,ValidationError:i,opts:o}=e;r.$async?t.if((0,l._)`${d.default.errors} === 0`,()=>t.return(d.default.data),()=>t.throw((0,l._)`new ${i}(${d.default.vErrors})`)):(t.assign((0,l._)`${n}.errors`,d.default.vErrors),o.unevaluated&&D(e),t.return((0,l._)`${d.default.errors} === 0`))}function D({gen:e,evaluated:t,props:r,items:n}){r instanceof l.Name&&e.assign((0,l._)`${t}.props`,r),n instanceof l.Name&&e.assign((0,l._)`${t}.items`,n)}function j(e,t,r,n){let{gen:i,schema:a,data:c,allErrors:u,opts:f,self:p}=e,{RULES:y}=p;if(a.$ref&&(f.ignoreKeywordsWithRef||!(0,h.schemaHasRulesButRef)(a,y))){i.block(()=>H(e,"$ref",y.all.$ref.definition));return}function g(h){(0,o.shouldUseGroup)(a,h)&&(h.type?(i.if((0,s.checkDataType)(h.type,c,f.strictNumbers)),R(e,h),1===t.length&&t[0]===h.type&&r&&(i.else(),(0,s.reportTypeError)(e)),i.endIf()):R(e,h),u||i.if((0,l._)`${d.default.errors} === ${n||0}`))}f.jtd||L(e,t),i.block(()=>{for(let e of y.rules)g(e);g(y.post)})}function R(e,t){let{gen:r,schema:n,opts:{useDefaults:i}}=e;i&&(0,a.assignDefaults)(e,t.type),r.block(()=>{for(let r of t.rules)(0,o.shouldUseRule)(n,r)&&H(e,r.keyword,r.definition,t.type)})}function L(e,t){!e.schemaEnv.meta&&e.opts.strictTypes&&(B(e,t),e.opts.allowUnionTypes||U(e,t),$(e,e.dataTypes))}function B(e,t){if(t.length){if(!e.dataTypes.length){e.dataTypes=t;return}t.forEach(t=>{F(e.dataTypes,t)||q(e,`type "${t}" not allowed by context "${e.dataTypes.join(",")}"`)}),z(e,t)}}function U(e,t){t.length>1&&!(2===t.length&&t.includes("null"))&&q(e,"use allowUnionTypes to allow union type keyword")}function $(e,t){let r=e.self.RULES.all;for(let n in r){let i=r[n];if("object"==typeof i&&(0,o.shouldUseRule)(e.schema,i)){let{type:r}=i.definition;r.length&&!r.some(e=>K(t,e))&&q(e,`missing type "${r.join(",")}" for keyword "${n}"`)}}}function K(e,t){return e.includes(t)||"number"===t&&e.includes("integer")}function F(e,t){return e.includes(t)||"integer"===t&&e.includes("number")}function z(e,t){let r=[];for(let n of e.dataTypes)F(t,n)?r.push(n):t.includes("integer")&&"number"===n&&r.push("integer");e.dataTypes=r}function q(e,t){let r=e.schemaEnv.baseId+e.errSchemaPath;t+=` at "${r}
27" (strictTypes)`,(0,h.checkStrictMode)(e,t,e.opts.strictTypes)}t.validateFunctionCode=y;class V{constructor(e,t,r){if((0,c.validateKeywordUsage)(e,t,r),this.gen=e.gen,this.allErrors=e.allErrors,this.keyword=r,this.data=e.data,this.schema=e.schema[r],this.$data=t.$data&&e.opts.$data&&this.schema&&this.schema.$data,this.schemaValue=(0,h.schemaRefOrVal)(e,this.schema,r,this.$data),this.schemaType=t.schemaType,this.parentSchema=e.schema,this.params={},this.it=e,this.def=t,this.$data)this.schemaCode=e.gen.const("vSchema",J(this.$data,e));else if(this.schemaCode=this.schemaValue,!(0,c.validSchemaType)(this.schema,t.schemaType,t.allowUndefined))throw Error(`${r} value must be ${JSON.stringify(t.schemaType)}`);("code"in t?t.trackErrors:!1!==t.errors)&&(this.errsCount=e.gen.const("_errs",d.default.errors))}result(e,t,r){this.failResult((0,l.not)(e),t,r)}failResult(e,t,r){this.gen.if(e),r?r():this.error(),t?(this.gen.else(),t(),this.allErrors&&this.gen.endIf()):this.allErrors?this.gen.endIf():this.gen.else()}pass(e,t){this.failResult((0,l.not)(e),void 0,t)}fail(e){if(void 0===e){this.error(),this.allErrors||this.gen.if(!1);return}this.gen.if(e),this.error(),this.allErrors?this.gen.endIf():this.gen.else()}fail$data(e){if(!this.$data)return this.fail(e);let{schemaCode:t}=this;this.fail((0,l._)`${t} !== undefined && (${(0,l.or)(this.invalid$data(),e)})`)}error(e,t,r){if(t){this.setParams(t),this._error(e,r),this.setParams({});return}this._error(e,r)}_error(e,t){(e?p.reportExtraError:p.reportError)(this,this.def.error,t)}$dataError(){(0,p.reportError)(this,this.def.$dataError||p.keyword$DataError)}reset(){if(void 0===this.errsCount)throw Error('add "trackErrors" to keyword definition');(0,p.resetErrorsCount)(this.gen,this.errsCount)}ok(e){this.allErrors||this.gen.if(e)}setParams(e,t){t?Object.assign(this.params,e):this.params=e}block$data(e,t,r=l.nil){this.gen.block(()=>{this.check$data(e,r),t()})}check$data(e=l.nil,t=l.nil){if(!this.$data)return;let{gen:r,schemaCode:n,schemaType:i,def:o}=this;r.if((0,l.or)((0,l._)`${n} === undefined`,t)),e!==l.nil&&r.assign(e,!0),(i.length||o.validateSchema)&&(r.elseIf(this.invalid$data()),this.$dataError(),e!==l.nil&&r.assign(e,!1)),r.else()}invalid$data(){let{gen:e,schemaCode:t,schemaType:r,def:n,it:i}=this;return(0,l.or)(o(),a());function o(){if(r.length){if(!(t instanceof l.Name))throw Error("ajv implementation error");let e=Array.isArray(r)?r:[r];return(0,l._)`${(0,s.checkDataTypes)(e,t,i.opts.strictNumbers,s.DataType.Wrong)}`}return l.nil}function a(){if(n.validateSchema){let r=e.scopeValue("validate$data",{ref:n.validateSchema});return(0,l._)`!${r}(${t})`}return l.nil}}subschema(e,t){let r=(0,u.getSubschema)(this.it,e);(0,u.extendSubschemaData)(r,this.it,e),(0,u.extendSubschemaMode)(r,e);let n={...this.it,...r,items:void 0,props:void 0};return E(n,t),n}mergeEvaluated(e,t){let{it:r,gen:n}=this;r.opts.unevaluated&&(!0!==r.props&&void 0!==e.props&&(r.props=h.mergeEvaluated.props(n,e.props,r.props,t)),!0!==r.items&&void 0!==e.items&&(r.items=h.mergeEvaluated.items(n,e.items,r.items,t)))}mergeValidEvaluated(e,t){let{it:r,gen:n}=this;if(r.opts.unevaluated&&(!0!==r.props||!0!==r.items))return n.if(t,()=>this.mergeEvaluated(e,l.Name)),!0}}function H(e,t,r,n){let i=new V(e,r,t);"code"in r?r.code(i,n):i.$data&&r.validate?(0,c.funcKeywordCode)(i,r):"macro"in r?(0,c.macroKeywordCode)(i,r):(r.compile||r.validate)&&(0,c.funcKeywordCode)(i,r)}t.KeywordCxt=V;let G=/^\/(?:[^~]|~0|~1)*$/,W=/^([0-9]+)(#|\/(?:[^~]|~0|~1)*)?$/;function J(e,{dataLevel:t,dataNames:r,dataPathArr:n}){let i,o;if(""===e)return d.default.rootData;if("/"===e[0]){if(!G.test(e))throw Error(`Invalid JSON-pointer: ${e}`);i=e,o=d.default.rootData}else{let s=W.exec(e);if(!s)throw Error(`Invalid JSON-pointer: ${e}`);let c=+s[1];if("#"===(i=s[2])){if(c>=t)throw Error(a("property/index",c));return n[t-c]}if(c>t)throw Error(a("data",c));if(o=r[t-c],!i)return o}let s=o;for(let e of i.split("/"))e&&(o=(0,l._)`${o}${(0,l.getProperty)((0,h.unescapeJsonPointer)(e))}`,s=(0,l._)`${s} && ${o}`);return s;function a(e,r){return`Cannot access ${e} ${r} levels up, current level is ${t}`}}t.getData=J},77249:(e,t,r)=>{"use strict";
27Object.defineProperty(t,"__esModule",{value:!0}),t.validateKeywordUsage=t.validSchemaType=t.funcKeywordCode=t.macroKeywordCode=void 0;let n=r(99991),i=r(52841),o=r(94399),s=r(8492);function a(e,t){let{gen:r,keyword:i,schema:o,parentSchema:s,it:a}=e,c=t.macro.call(a.self,o,s,a),u=f(r,i,c);!1!==a.opts.validateSchema&&a.self.validateSchema(c,!0);let l=r.name("valid");e.subschema({schema:c,schemaPath:n.nil,errSchemaPath:`${a.errSchemaPath}/${i}`,topSchemaRef:u,compositeRule:!0},l),e.pass(l,()=>e.error(!0))}function c(e,t){var r;let{gen:s,keyword:a,schema:c,parentSchema:h,$data:p,it:y}=e;d(y,t);let g=f(s,a,!p&&t.compile?t.compile.call(y.self,c,h,y):t.validate),m=s.let("valid");function b(){if(!1===t.errors)_(),t.modifying&&u(e),E(()=>e.error());else{let r=t.async?v():w();t.modifying&&u(e),E(()=>l(e,r))}}function v(){let e=s.let("ruleErrs",null);return s.try(()=>_((0,n._)`await `),t=>s.assign(m,!1).if((0,n._)`${t} instanceof ${y.ValidationError}`,()=>s.assign(e,(0,n._)`${t}.errors`),()=>s.throw(t))),e}function w(){let e=(0,n._)`${g}.errors`;return s.assign(e,null),_(n.nil),e}function _(r=t.async?(0,n._)`await `:n.nil){let a=y.opts.passContext?i.default.this:i.default.self,c=!("compile"in t&&!p||!1===t.schema);s.assign(m,(0,n._)`${r}${(0,o.callValidateCode)(e,g,a,c)}`,t.modifying)}function E(e){var r;s.if((0,n.not)(null!==(r=t.valid)&&void 0!==r?r:m),e)}e.block$data(m,b),e.ok(null!==(r=t.valid)&&void 0!==r?r:m)}function u(e){let{gen:t,data:r,it:i}=e;t.if(i.parentData,()=>t.assign(r,(0,n._)`${i.parentData}[${i.parentDataProperty}]`))}function l(e,t){let{gen:r}=e;r.if((0,n._)`Array.isArray(${t})`,()=>{r.assign(i.default.vErrors,(0,n._)`${i.default.vErrors} === null ? ${t} : ${i.default.vErrors}.concat(${t})`).assign(i.default.errors,(0,n._)`${i.default.vErrors}.length`),(0,s.extendErrors)(e)},()=>e.error())}function d({schemaEnv:e},t){if(t.async&&!e.$async)throw Error("async keyword in sync schema")}function f(e,t,r){if(void 0===r)throw Error(`keyword "${t}" failed to compile`);return e.scopeValue("keyword","function"==typeof r?{ref:r}:{ref:r,code:(0,n.stringify)(r)})}function h(e,t,r=!1){return!t.length||t.some(t=>"array"===t?Array.isArray(e):"object"===t?e&&"object"==typeof e&&!Array.isArray(e):typeof e==t||r&&void 0===e)}function p({schema:e,opts:t,self:r,errSchemaPath:n},i,o){if(Array.isArray(i.keyword)?!i.keyword.includes(o):i.keyword!==o)throw Error("ajv implementation error");let s=i.dependencies;if(null==s?void 0:s.some(t=>!Object.prototype.hasOwnProperty.call(e,t)))throw Error(`parent schema must have dependencies of ${o}: ${s.join(",")}`);if(i.validateSchema&&!i.validateSchema(e[o])){let e=`keyword "${o}" value is invalid at path "${n}": `+r.errorsText(i.validateSchema.errors);if("log"===t.validateSchema)r.logger.error(e);else throw Error(e)}}t.macroKeywordCode=a,t.funcKeywordCode=c,t.validSchemaType=h,t.validateKeywordUsage=p},88407:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.extendSubschemaMode=t.extendSubschemaData=t.getSubschema=void 0;let n=r(99991),i=r(35191);function o(e,{keyword:t,schemaProp:r,schema:o,schemaPath:s,errSchemaPath:a,topSchemaRef:c}){if(void 0!==t&&void 0!==o)throw Error('both "keyword" and "schema" passed, only one allowed');if(void 0!==t){let o=e.schema[t];return void 0===r?{schema:o,schemaPath:(0,n._)`${e.schemaPath}${(0,n.getProperty)(t)}`,errSchemaPath:`${e.errSchemaPath}/${t}`}:{schema:o[r],schemaPath:(0,n._)`${e.schemaPath}${(0,n.getProperty)(t)}${(0,n.getProperty)(r)}`,errSchemaPath:`${e.errSchemaPath}/${t}/${(0,i.escapeFragment)(r)}`}}if(void 0!==o){if(void 0===s||void 0===a||void 0===c)throw Error('"schemaPath", "errSchemaPath" and "topSchemaRef" are required with "schema"');return{schema:o,schemaPath:s,topSchemaRef:c,errSchemaPath:a}}throw Error('either "keyword" or "schema" must be passed')}function s(e,t,{dataProp:r,dataPropType:o,data:s,dataTypes:a,propertyName:c}){if(void 0!==s&&void 0!==r)throw Error('both "data" and "dataProp" passed, only one allowed');let{gen:u}=t;if(void 0!==r){let{errorPath:s,dataPathArr:a,opts:c}=t;l(u.let("data",(0,n._)`${t.data}${(0,n.getProperty)(r)}`,!0)),e.errorPath=(0,n.str)`${s}${(0,i.getErrorPath)(r,o,c.jsPropertySyntax)}`,e.parentDataProperty=(0,n._)`${r}`,e.dataPathArr=[...a,e.parentDataProperty]}function l(r){e.data=r,e.dataLevel=t.dataLevel+1,e.dataTypes=[],t.definedProperties=new Set,e.parentData=t.data,e.dataNames=[...t.dataNames,r]}void 0!==s&&(l(s instanceof n.Name?s:u.let("data",s,!0)),void 0!==c&&(e.propertyName=c)),a&&(e.dataTypes=a)}function a(e,{jtdDiscriminator:t,jtdMetadata:r,compositeRule:n,createErrors:i,allErrors:o}){void 0!==n&&(e.compositeRule=n),void 0!==i&&(e.createErrors=i),void 0!==o&&(e.allErrors=o),e.jtdDiscriminator=t,e.jtdMetadata=r}t.getSubschema=o,t.extendSubschemaData=s,t.extendSubschemaMode=a},52850:(e,t,r)=>{"use strict";
27Object.defineProperty(t,"__esModule",{value:!0}),t.CodeGen=t.Name=t.nil=t.stringify=t.str=t._=t.KeywordCxt=void 0;var n=r(47594);Object.defineProperty(t,"KeywordCxt",{enumerable:!0,get:function(){return n.KeywordCxt}});var i=r(99991);Object.defineProperty(t,"_",{enumerable:!0,get:function(){return i._}}),Object.defineProperty(t,"str",{enumerable:!0,get:function(){return i.str}}),Object.defineProperty(t,"stringify",{enumerable:!0,get:function(){return i.stringify}}),Object.defineProperty(t,"nil",{enumerable:!0,get:function(){return i.nil}}),Object.defineProperty(t,"Name",{enumerable:!0,get:function(){return i.Name}}),Object.defineProperty(t,"CodeGen",{enumerable:!0,get:function(){return i.CodeGen}});let o=r(4450),s=r(4481),a=r(33402),c=r(71853),u=r(99991),l=r(26997),d=r(71894),f=r(35191),h=r(59832),p=r(36698),y=(e,t)=>new RegExp(e,t);y.code="new RegExp";let g=["removeAdditional","useDefaults","coerceTypes"],m=new Set(["validate","serialize","parse","wrapper","root","schema","keyword","pattern","formats","validate$data","func","obj","Error"]),b={errorDataPath:"",format:"`validateFormats: false` can be used instead.",nullable:'"nullable" keyword is supported by default.',jsonPointers:"Deprecated jsPropertySyntax can be used instead.",extendRefs:"Deprecated
27ignoreKeywordsWithRef can be used instead.",missingRefs:"Pass empty schema with $id that should be ignored to ajv.addSchema.",processCode:"Use option `code: {process: (code, schemaEnv: object) => string}`",sourceCode:"Use option `code: {source: true}`",strictDefaults:"It is default now, see option `strict`.",strictKeywords:"It is default now, see option `strict`.",uniqueItems:'"uniqueItems" keyword is always validated.',unknownFormats:"Disable strict mode or pass `true` to `ajv.addFormat` (or `formats` option).",cache:"Map is used as cache, schema object as key.",serialize:"Map is used as cache, schema object as key.",ajvErrors:"It is default now."},v={ignoreKeywordsWithRef:"",jsPropertySyntax:"",unicode:'"minLength"/"maxLength" account for unicode characters by default.'},w=200;function _(e){var t,r,n,i,o,s,a,c,u,l,d,f,h,g,m,b,v,_,E,S,x,A,I,O,T;let P=e.strict,M=null===(t=e.code)||void 0===t?void 0:t.optimize,N=!0===M||void 0===M?1:M||0,k=null!==(n=null===(r=e.code)||void 0===r?void 0:r.regExp)&&void 0!==n?n:y,C=null!==(i=e.uriResolver)&&void 0!==i?i:p.default;return{strictSchema:null===(s=null!==(o=e.strictSchema)&&void 0!==o?o:P)||void 0===s||s,strictNumbers:null===(c=null!==(a=e.strictNumbers)&&void 0!==a?a:P)||void 0===c||c,strictTypes:null!==(l=null!==(u=e.strictTypes)&&void 0!==u?u:P)&&void 0!==l?l:"log",strictTuples:null!==(f=null!==(d=e.strictTuples)&&void 0!==d?d:P)&&void 0!==f?f:"log",strictRequired:null!==(g=null!==(h=e.strictRequired)&&void 0!==h?h:P)&&void 0!==g&&g,code:e.code?{...e.code,optimize:N,regExp:k}:{optimize:N,regExp:k},loopRequired:null!==(m=e.loopRequired)&&void 0!==m?m:w,loopEnum:null!==(b=e.loopEnum)&&void 0!==b?b:w,meta:null===(v=e.meta)||void 0===v||v,messages:null===(_=e.messages)||void 0===_||_,inlineRefs:null===(E=e.inlineRefs)||void 0===E||E,schemaId:null!==(S=e.schemaId)&&void 0!==S?S:"$id",addUsedSchema:null===(x=e.addUsedSchema)||void 0===x||x,validateSchema:null===(A=e.validateSchema)||void 0===A||A,validateFormats:null===(I=e.validateFormats)||void 0===I||I,unicodeRegExp:null===(O=e.unicodeRegExp)||void 0===O||O,int32range:null===(T=e.int32range)||void 0===T||T,uriResolver:C}}class E{constructor(e={}){this.schemas={},this.refs={},this.formats={},this._compilations=new Set,this._loading={},this._cache=new Map,e=this.opts={...e,..._(e)};let{es5:t,lines:r}=this.opts.code;this.scope=new u.ValueScope({scope:{},prefixes:m,es5:t,lines:r}),this.logger=M(e.logger);let n=e.validateFormats;e.validateFormats=!1,this.RULES=(0,a.getRules)(),S.call(this,b,e,"NOT SUPPORTED"),S.call(this,v,e,"DEPRECATED","warn"),this._metaOpts=T.call(this),e.formats&&I.call(this),this._addVocabularies(),this._addDefaultMetaSchema(),e.keywords&&O.call(this,e.keywords),"object"==typeof e.meta&&this.addMetaSchema(e.meta),A.call(this),e.validateFormats=n}_addVocabularies(){this.addKeyword("$async")}_addDefaultMetaSchema(){let{$data:e,meta:t,schemaId:r}=this.opts,n=h;"id"===r&&((n={...h}).id=n.$id,delete n.$id),t&&e&&this.addMetaSchema(n,n[r],!1)}defaultMeta(){let{meta:e,schemaId:t}=this.opts;return this.opts.defaultMeta="object"==typeof e?e[t]||e:void 0}validate(e,t){let r;if("string"==typeof e){if(!(r=this.getSchema(e)))throw Error(`no schema with key or ref "${e}"`)}else r=this.compile(e);let n=r(t);return"$async"in r||(this.errors=r.errors),n}compile(e,t){let r=this._addSchema(e,t);return r.validate||this._compileSchemaEnv(r)}compileAsync(e,t){if("function"!=typeof this.opts.loadSchema)throw Error("options.loadSchema should be a function");let{loadSchema:r}=this.opts;return n.call(this,e,t);async function n(e,t){await i.call(this,e.$schema);let r=this._addSchema(e,t);return r.validate||o.call(this,r)}async function i(e){e&&!this.getSchema(e)&&await n.call(this,{$ref:e},!0)}async function o(e){try{return this._compileSchemaEnv(e)}catch(t){if(!(t instanceof s.default))throw t;return a.call(this,t),await c.call(this,t.missingSchema),o.call(this,e)}}function a({missingSchema:e,missingRef:t}){if(this.refs[e])throw Error(`AnySchema ${e} is loaded but ${t} cannot be resolved`)}async function c(e){let r=await u.call(this,e);this.refs[e]||await i.call(this,r.$schema),this.refs[e]||this.addSchema(r,e,t)}async function u(e){let t=this._loading[e];if(t)return t;try{return await (this._loading[e]=r(e))}finally{delete this._loading[e]}}}addSchema(e,t,r,n=this.opts.validateSchema){let i;
27if(Array.isArray(e)){for(let t of e)this.addSchema(t,void 0,r,n);return this}if("object"==typeof e){let{schemaId:t}=this.opts;if(void 0!==(i=e[t])&&"string"!=typeof i)throw Error(`schema ${t} must be string`)}return t=(0,l.normalizeId)(t||i),this._checkUnique(t),this.schemas[t]=this._addSchema(e,r,t,n,!0),this}addMetaSchema(e,t,r=this.opts.validateSchema){return this.addSchema(e,t,!0,r),this}validateSchema(e,t){let r;if("boolean"==typeof e)return!0;if(void 0!==(r=e.$schema)&&"string"!=typeof r)throw Error("$schema must be a string");if(!(r=r||this.opts.defaultMeta||this.defaultMeta()))return this.logger.warn("meta-schema not available"),this.errors=null,!0;let n=this.validate(r,e);if(!n&&t){let e="schema is invalid: "+this.errorsText();if("log"===this.opts.validateSchema)this.logger.error(e);else throw Error(e)}return n}getSchema(e){let t;for(;"string"==typeof(t=x.call(this,e));)e=t;if(void 0===t){let{schemaId:r}=this.opts,n=new c.SchemaEnv({schema:{},schemaId:r});if(!(t=c.resolveSchema.call(this,n,e)))return;this.refs[e]=t}return t.validate||this._compileSchemaEnv(t)}removeSchema(e){if(e instanceof RegExp)return this._removeAllSchemas(this.schemas,e),this._removeAllSchemas(this.refs,e),this;switch(typeof e){case"undefined":return this._removeAllSchemas(this.schemas),this._removeAllSchemas(this.refs),this._cache.clear(),this;case"string":{let t=x.call(this,e);return"object"==typeof t&&this._cache.delete(t.schema),delete this.schemas[e],delete this.refs[e],this}case"object":{let t=e;this._cache.delete(t);let r=e[this.opts.schemaId];return r&&(r=(0,l.normalizeId)(r),delete this.schemas[r],delete this.refs[r]),this}default:throw Error("ajv.removeSchema: invalid parameter")}}addVocabulary(e){for(let t of e)this.addKeyword(t);return this}addKeyword(e,t){let r;if("string"==typeof e)r=e,"object"==typeof t&&(this.logger.warn("these parameters are deprecated, see docs for addKeyword"),t.keyword=r);else if("object"==typeof e&&void 0===t){if(Array.isArray(r=(t=e).keyword)&&!r.length)throw Error("addKeywords: keyword must be string or non-empty array")}else throw Error("invalid addKeywords parameters");if(k.call(this,r,t),!t)return(0,f.eachItem)(r,e=>C.call(this,e)),this;j.call(this,t);let n={...t,type:(0,d.getJSONTypes)(t.type),schemaType:(0,d.getJSONTypes)(t.schemaType)};return(0,f.eachItem)(r,0===n.type.length?e=>C.call(this,e,n):e=>n.type.forEach(t=>C.call(this,e,n,t))),this}getKeyword(e){let t=this.RULES.all[e];return"object"==typeof t?t.definition:!!t}removeKeyword(e){let{RULES:t}=this;for(let r of(delete t.keywords[e],delete t.all[e],t.rules)){let t=r.rules.findIndex(t=>t.keyword===e);t>=0&&r.rules.splice(t,1)}return this}addFormat(e,t){return"string"==typeof t&&(t=new RegExp(t)),this.formats[e]=t,this}errorsText(e=this.errors,{separator:t=", ",dataVar:r="data"}={}){return e&&0!==e.length?e.map(e=>`${r}${e.instancePath} ${e.message}`).reduce((e,r)=>e+t+r):"No errors"}$dataMetaSchema(e,t){let r=this.RULES.all;for(let n of(e=JSON.parse(JSON.stringify(e)),t)){let t=n.split("/").slice(1),i=e;for(let e of t)i=i[e];for(let e in r){let t=r[e];if("object"!=typeof t)continue;let{$data:n}=t.definition,o=i[e];n&&o&&(i[e]=L(o))}}return e}_removeAllSchemas(e,t){for(let r in e){let n=e[r];(!t||t.test(r))&&("string"==typeof n?delete e[r]:n&&!n.meta&&(this._cache.delete(n.schema),delete e[r]))}}_addSchema(e,t,r,n=this.opts.validateSchema,i=this.opts.addUsedSchema){let o;let{schemaId:s}=this.opts;if("object"==typeof e)o=e[s];else{if(this.opts.jtd)throw Error("schema must be object");if("boolean"!=typeof e)throw Error("schema must be object or boolean")}let a=this._cache.get(e);if(void 0!==a)return a;r=(0,l.normalizeId)(o||r);let u=l.getSchemaRefs.call(this,e,r);return a=new c.SchemaEnv({schema:e,schemaId:s,meta:t,baseId:r,localRefs:u}),this._cache.set(a.schema,a),i&&!r.startsWith("#")&&(r&&this._checkUnique(r),this.refs[r]=a),n&&this.validateSchema(e,!0),a}_checkUnique(e){if(this.schemas[e]||this.refs[e])throw Error(`schema with key or id "${e}" already exists`)}_compileSchemaEnv(e){if(e.meta?this._compileMetaSchema(e):c.compileSchema.call(this,e),!e.validate)throw Error("ajv implementation error");return e.validate}_compileMetaSchema(e){let t=this.opts;this.opts=this._metaOpts;try{c.compileSchema.call(this,e)}finally{this.opts=t}}}function S(e,t,r,n="error"){for(let i in e){let o=i;o in t&&this.logger[n](`${r}: option ${i}. ${e[o]}`)}}function x(e){return e=(0,l.normalizeId)(e),this.schemas[e]||this.refs[e]}function A(){let e=this.opts.schemas;if(e){if(Array.isArray(e))this.addSchema(e);else for(let t in e)this.addSchema(e[t],t)}}function I(){for(let e in this.opts.formats){let t=this.opts.formats[e];t&&this.addFormat(e,t)}}function O(e){if(Array.isArray(e)){this.addVocabulary(e);return}for(let t in this.logger.warn("keywords option as map is deprecated, pass array"),e){let r=e[t];r.keyword||(r.keyword=t),this.addKeyword(r)}}function T(){let e={...this.opts};for(let t of g)delete e[t];return e}E.ValidationError=o.default,E.MissingRefError=s.default,t.default=E;let P={log(){},warn(){},error(){}};function M(e){if(!1===e)return P;if(void 0===e)return console;if(e.log&&e.warn&&e.error)return e;throw Error("logger must implement log, warn and error methods")}let N=/^[a-z_$][a-z0-9_$:-]*$/i;function k(e,t){let{RULES:r}=this;if((0,f.eachItem)(e,e=>{if(r.keywords[e])throw Error(`Keyword ${e} is already defined`);if(!N.test(e))throw Error(`Keyword ${e}
27 has invalid name`)}),t&&t.$data&&!("code"in t||"validate"in t))throw Error('$data keyword must have "code" or "validate" function')}function C(e,t,r){var n;let i=null==t?void 0:t.post;if(r&&i)throw Error('keyword with "post" flag cannot have "type"');let{RULES:o}=this,s=i?o.post:o.rules.find(({type:e})=>e===r);if(s||(s={type:r,rules:[]},o.rules.push(s)),o.keywords[e]=!0,!t)return;let a={keyword:e,definition:{...t,type:(0,d.getJSONTypes)(t.type),schemaType:(0,d.getJSONTypes)(t.schemaType)}};t.before?D.call(this,s,a,t.before):s.rules.push(a),o.all[e]=a,null===(n=t.implements)||void 0===n||n.forEach(e=>this.addKeyword(e))}function D(e,t,r){let n=e.rules.findIndex(e=>e.keyword===r);n>=0?e.rules.splice(n,0,t):(e.rules.push(t),this.logger.warn(`rule ${r} is not defined`))}function j(e){let{metaSchema:t}=e;void 0!==t&&(e.$data&&this.opts.$data&&(t=L(t)),e.validateSchema=this.compile(t,!0))}let R={$ref:"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#"};function L(e){return{anyOf:[e,R]}}},69152:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});let n=r(85979);n.code='require("ajv/dist/runtime/equal").default',t.default=n},26849:(e,t)=>{"use strict";function r(e){let t;let r=e.length,n=0,i=0;for(;i<r;)n++,(t=e.charCodeAt(i++))>=55296&&t<=56319&&i<r&&(64512&(t=e.charCodeAt(i)))==56320&&i++;return n}Object.defineProperty(t,"__esModule",{value:!0}),t.default=r,r.code='require("ajv/dist/runtime/ucs2length").default'},36698:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});let n=r(99648);n.code='require("ajv/dist/runtime/uri").default',t.default=n},4450:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});class r extends Error{constructor(e){super("validation failed"),this.errors=e,this.ajv=this.validation=!0}}t.default=r},37439:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.validateAdditionalItems=void 0;let n=r(99991),i=r(35191),o={keyword:"additionalItems",type:"array",schemaType:["boolean","object"],before:"uniqueItems",error:{message:({params:{len:e}})=>(0,n.str)`must NOT have more than ${e} items`,params:({params:{len:e}})=>(0,n._)`{limit: ${e}}`},code(e){let{parentSchema:t,it:r}=e,{items:n}=t;if(!Array.isArray(n)){(0,i.checkStrictMode)(r,'"additionalItems" is ignored when "items" is not an array of schemas');return}s(e,n)}};function s(e,t){let{gen:r,schema:o,data:s,keyword:a,it:c}=e;c.items=!0;let u=r.const("len",(0,n._)`${s}.length`);if(!1===o)e.setParams({len:t.length}),e.pass((0,n._)`${u} <= ${t.length}`);else if("object"==typeof o&&!(0,i.alwaysValidSchema)(c,o)){let i=r.var("valid",(0,n._)`${u} <= ${t.length}`);r.if((0,n.not)(i),()=>l(i)),e.ok(i)}function l(o){r.forRange("i",t.length,u,t=>{e.subschema({keyword:a,dataProp:t,dataPropType:i.Type.Num},o),c.allErrors||r.if((0,n.not)(o),()=>r.break())})}}t.validateAdditionalItems=s,t.default=o},89940:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});let n=r(94399),i=r(99991),o=r(52841),s=r(35191),a={keyword:"additionalProperties",type:["object"],schemaType:["boolean","object"],allowUndefined:!0,trackErrors:!0,error:{message:"must NOT have additional properties",params:({params:e})=>(0,i._)`{additionalProperty: ${e.additionalProperty}}`},code(e){let{gen:t,schema:r,parentSchema:a,data:c,errsCount:u,it:l}=e;if(!u)throw Error("ajv implementation error");let{allErrors:d,opts:f}=l;if(l.props=!0,"all"!==f.removeAdditional&&(0,s.alwaysValidSchema)(l,r))return;let h=(0,n.allSchemaProperties)(a.properties),p=(0,n.allSchemaProperties)(a.patternProperties);function y(r){let o;if(h.length>8){let e=(0,s.schemaRefOrVal)(l,a.properties,"properties");o=(0,n.isOwnProperty)(t,e,r)}else o=h.length?(0,i.or)(...h.map(e=>(0,i._)`${r} === ${e}`)):i.nil;return p.length&&(o=(0,i.or)(o,...p.map(t=>(0,i._)`${(0,n.usePattern)(e,t)}.test(${r})`))),(0,i.not)(o)}function g(e){t.code((0,i._)`delete ${c}[${e}]`)}function m(n){if("all"===f.removeAdditional||f.removeAdditional&&!1===r){g(n);return}if(!1===r){e.setParams({additionalProperty:n}),e.error(),d||t.break();return}if("object"==typeof r&&!(0,s.alwaysValidSchema)(l,r)){let r=t.name("valid");"failing"===f.removeAdditional?(b(n,r,!1),t.if((0,i.not)(r),()=>{e.reset(),g(n)})):(b(n,r),d||t.if((0,i.not)(r),()=>t.break()))}}function b(t,r,n){let i={keyword:"additionalProperties",dataProp:t,dataPropType:s.Type.Str};!1===n&&Object.assign(i,{compositeRule:!0,createErrors:!1,allErrors:!1}),e.subschema(i,r)}(function(){t.forIn("key",c,e=>{h.length||p.length?t.if(y(e),()=>m(e)):m(e)})})(),e.ok((0,i._)`${u} === ${o.default.errors}`)}};t.default=a},65702:(e,t,r)=>{"use strict";
27Object.defineProperty(t,"__esModule",{value:!0});let n=r(35191),i={keyword:"allOf",schemaType:"array",code(e){let{gen:t,schema:r,it:i}=e;if(!Array.isArray(r))throw Error("ajv implementation error");let o=t.name("valid");r.forEach((t,r)=>{if((0,n.alwaysValidSchema)(i,t))return;let s=e.subschema({keyword:"allOf",schemaProp:r},o);e.ok(o),e.mergeEvaluated(s)})}};t.default=i},77139:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});let n={keyword:"anyOf",schemaType:"array",trackErrors:!0,code:r(94399).validateUnion,error:{message:"must match a schema in anyOf"}};t.default=n},97753:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});let n=r(99991),i=r(35191),o={keyword:"contains",type:"array",schemaType:["object","boolean"],before:"uniqueItems",trackErrors:!0,error:{message:({params:{min:e,max:t}})=>void 0===t?(0,n.str)`must contain at least ${e} valid item(s)`:(0,n.str)`must contain at least ${e} and no more than ${t} valid item(s)`,params:({params:{min:e,max:t}})=>void 0===t?(0,n._)`{minContains: ${e}}`:(0,n._)`{minContains: ${e}, maxContains: ${t}}`},code(e){let t,r;let{gen:o,schema:s,parentSchema:a,data:c,it:u}=e,{minContains:l,maxContains:d}=a;u.opts.next?(t=void 0===l?1:l,r=d):t=1;let f=o.const("len",(0,n._)`${c}.length`);if(e.setParams({min:t,max:r}),void 0===r&&0===t){(0,i.checkStrictMode)(u,'"minContains" == 0 without "maxContains": "contains" keyword ignored');return}if(void 0!==r&&t>r){(0,i.checkStrictMode)(u,'"minContains" > "maxContains" is always invalid'),e.fail();return}if((0,i.alwaysValidSchema)(u,s)){let i=(0,n._)`${f} >= ${t}`;void 0!==r&&(i=(0,n._)`${i} && ${f} <= ${r}`),e.pass(i);return}u.items=!0;let h=o.name("valid");function p(){let e=o.name("_valid"),t=o.let("count",0);y(e,()=>o.if(e,()=>g(t)))}function y(t,r){o.forRange("i",0,f,n=>{e.subschema({keyword:"contains",dataProp:n,dataPropType:i.Type.Num,compositeRule:!0},t),r()})}function g(e){o.code((0,n._)`${e}++`),void 0===r?o.if((0,n._)`${e} >= ${t}`,()=>o.assign(h,!0).break()):(o.if((0,n._)`${e} > ${r}`,()=>o.assign(h,!1).break()),1===t?o.assign(h,!0):o.if((0,n._)`${e} >= ${t}`,()=>o.assign(h,!0)))}void 0===r&&1===t?y(h,()=>o.if(h,()=>o.break())):0===t?(o.let(h,!0),void 0!==r&&o.if((0,n._)`${c}.length > 0`,p)):(o.let(h,!1),p()),e.result(h,()=>e.reset())}};t.default=o},66073:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.validateSchemaDeps=t.validatePropertyDeps=t.error=void 0;let n=r(99991),i=r(35191),o=r(94399);t.error={message:({params:{property:e,depsCount:t,deps:r}})=>{let i=1===t?"property":"properties";return(0,n.str)`must have ${i} ${r} when property ${e} is present`},params:({params:{property:e,depsCount:t,deps:r,missingProperty:i}})=>(0,n._)`{property: ${e}, 28 missingProperty: ${i}, 29 depsCount: ${t}, 30 deps: ${r}}`};let s={keyword:"dependencies",type:"object",schemaType:"object",error:t.error,code(e){let[t,r]=a(e);c(e,t),u(e,r)}};function a({schema:e}){let t={},r={};for(let n in e)"__proto__"!==n&&((Array.isArray(e[n])?t:r)[n]=e[n]);return[t,r]}function c(e,t=e.schema){let{gen:r,data:i,it:s}=e;if(0===Object.keys(t).length)return;let a=r.let("missing");for(let c in t){let u=t[c];if(0===u.length)continue;let l=(0,o.propertyInData)(r,i,c,s.opts.ownProperties);e.setParams({property:c,depsCount:u.length,deps:u.join(", ")}),s.allErrors?r.if(l,()=>{for(let t of u)(0,o.checkReportMissingProp)(e,t)}):(r.if((0,n._)`${l} && (${(0,o.checkMissingProp)(e,u,a)})`),(0,o.reportMissingProp)(e,a),r.else())}}function u(e,t=e.schema){let{gen:r,data:n,keyword:s,it:a}=e,c=r.name("valid");for(let u in t)(0,i.alwaysValidSchema)(a,t[u])||(r.if((0,o.propertyInData)(r,n,u,a.opts.ownProperties),()=>{let t=e.subschema({keyword:s,schemaProp:u},c);e.mergeValidEvaluated(t,c)},()=>r.var(c,!0)),e.ok(c))}t.validatePropertyDeps=c,t.validateSchemaDeps=u,t.default=s},98507:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});let n=r(99991),i=r(35191),o={keyword:"if",schemaType:["object","boolean"],trackErrors:!0,error:{message:({params:e})=>(0,n.str)`must match "${e.ifClause}" schema`,params:({params:e})=>(0,n._)`{failingKeyword: ${e.ifClause}}`},code(e){let{gen:t,parentSchema:r,it:o}=e;void 0===r.then&&void 0===r.else&&(0,i.checkStrictMode)(o,'"if" without "then" and "else" is ignored');let a=s(o,"then"),c=s(o,"else");if(!a&&!c)return;let u=t.let("valid",!0),l=t.name("_valid");if(d(),e.reset(),a&&c){let r=t.let("ifClause");e.setParams({ifClause:r}),t.if(l,f("then",r),f("else",r))}else a?t.if(l,f("then")):t.if((0,n.not)(l),f("else"));function d(){let t=e.subschema({keyword:"if",compositeRule:!0,createErrors:!1,allErrors:!1},l);e.mergeEvaluated(t)}function f(r,i){return()=>{let o=e.subschema({keyword:r},l);t.assign(u,l),e.mergeValidEvaluated(o,u),i?t.assign(i,(0,n._)`${r}`):e.setParams({ifClause:r})}}e.pass(u,()=>e.error(!0))}};function s(e,t){let r=e.schema[t];return void 0!==r&&!(0,i.alwaysValidSchema)(e,r)}t.default=o},8092:(e,t,r)=>{"use strict";
30Object.defineProperty(t,"__esModule",{value:!0});let n=r(37439),i=r(84128),o=r(45108),s=r(95876),a=r(97753),c=r(66073),u=r(41915),l=r(89940),d=r(35833),f=r(40643),h=r(10425),p=r(77139),y=r(26653),g=r(65702),m=r(98507),b=r(44466);function v(e=!1){let t=[h.default,p.default,y.default,g.default,m.default,b.default,u.default,l.default,c.default,d.default,f.default];return e?t.push(i.default,s.default):t.push(n.default,o.default),t.push(a.default),t}t.default=v},45108:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.validateTuple=void 0;let n=r(99991),i=r(35191),o=r(94399),s={keyword:"items",type:"array",schemaType:["object","array","boolean"],before:"uniqueItems",code(e){let{schema:t,it:r}=e;if(Array.isArray(t))return a(e,"additionalItems",t);r.items=!0,(0,i.alwaysValidSchema)(r,t)||e.ok((0,o.validateArray)(e))}};function a(e,t,r=e.schema){let{gen:o,parentSchema:s,data:c,keyword:u,it:l}=e;h(s),l.opts.unevaluated&&r.length&&!0!==l.items&&(l.items=i.mergeEvaluated.items(o,r.length,l.items));let d=o.name("valid"),f=o.const("len",(0,n._)`${c}.length`);function h(e){let{opts:n,errSchemaPath:o}=l,s=r.length,a=s===e.minItems&&(s===e.maxItems||!1===e[t]);if(n.strictTuples&&!a){let e=`"${u}" is ${s}-tuple, but minItems or maxItems/${t} are not specified or different at path "${o}"`;(0,i.checkStrictMode)(l,e,n.strictTuples)}}r.forEach((t,r)=>{(0,i.alwaysValidSchema)(l,t)||(o.if((0,n._)`${f} > ${r}`,()=>e.subschema({keyword:u,schemaProp:r,dataProp:r},d)),e.ok(d))})}t.validateTuple=a,t.default=s},95876:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});let n=r(99991),i=r(35191),o=r(94399),s=r(37439),a={keyword:"items",type:"array",schemaType:["object","boolean"],before:"uniqueItems",error:{message:({params:{len:e}})=>(0,n.str)`must NOT have more than ${e} items`,params:({params:{len:e}})=>(0,n._)`{limit: ${e}}`},code(e){let{schema:t,parentSchema:r,it:n}=e,{prefixItems:a}=r;n.items=!0,(0,i.alwaysValidSchema)(n,t)||(a?(0,s.validateAdditionalItems)(e,a):e.ok((0,o.validateArray)(e)))}};t.default=a},10425:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});let n=r(35191),i={keyword:"not",schemaType:["object","boolean"],trackErrors:!0,code(e){let{gen:t,schema:r,it:i}=e;if((0,n.alwaysValidSchema)(i,r)){e.fail();return}let o=t.name("valid");e.subschema({keyword:"not",compositeRule:!0,createErrors:!1,allErrors:!1},o),e.failResult(o,()=>e.reset(),()=>e.error())},error:{message:"must NOT be valid"}};t.default=i},26653:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});let n=r(99991),i=r(35191),o={keyword:"oneOf",schemaType:"array",trackErrors:!0,error:{message:"must match exactly one schema in oneOf",params:({params:e})=>(0,n._)`{passingSchemas: ${e.passing}}`},code(e){let{gen:t,schema:r,parentSchema:o,it:s}=e;if(!Array.isArray(r))throw Error("ajv implementation error");if(s.opts.discriminator&&o.discriminator)return;let a=r,c=t.let("valid",!1),u=t.let("passing",null),l=t.name("_valid");function d(){a.forEach((r,o)=>{let a;(0,i.alwaysValidSchema)(s,r)?t.var(l,!0):a=e.subschema({keyword:"oneOf",schemaProp:o,compositeRule:!0},l),o>0&&t.if((0,n._)`${l} && ${c}`).assign(c,!1).assign(u,(0,n._)`[${u}, ${o}]`).else(),t.if(l,()=>{t.assign(c,!0),t.assign(u,o),a&&e.mergeEvaluated(a,n.Name)})})}e.setParams({passing:u}),t.block(d),e.result(c,()=>e.reset(),()=>e.error(!0))}};t.default=o},40643:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});let n=r(94399),i=r(99991),o=r(35191),s=r(35191),a={keyword:"patternProperties",type:"object",schemaType:"object",code(e){let{gen:t,schema:r,data:a,parentSchema:c,it:u}=e,{opts:l}=u,d=(0,n.allSchemaProperties)(r),f=d.filter(e=>(0,o.alwaysValidSchema)(u,r[e]));if(0===d.length||f.length===d.length&&(!u.opts.unevaluated||!0===u.props))return;let h=l.strictSchema&&!l.allowMatchingProperties&&c.properties,p=t.name("valid");!0===u.props||u.props instanceof i.Name||(u.props=(0,s.evaluatedPropsToName)(t,u.props));let{props:y}=u;function g(e){for(let t in h)new RegExp(e).test(t)&&(0,o.checkStrictMode)(u,`property ${t} matches pattern ${e} (use allowMatchingProperties)`)}function m(r){t.forIn("key",a,o=>{t.if((0,i._)`${(0,n.usePattern)(e,r)}.test(${o})`,()=>{let n=f.includes(r);n||e.subschema({keyword:"patternProperties",schemaProp:r,dataProp:o,dataPropType:s.Type.Str},p),u.opts.unevaluated&&!0!==y?t.assign((0,i._)`${y}[${o}]`,!0):n||u.allErrors||t.if((0,i.not)(p),()=>t.break())})})}!function(){for(let e of d)h&&g(e),u.allErrors?m(e):(t.var(p,!0),m(e),t.if(p))}()}};t.default=a},84128:(e,t,r)=>{"use strict";
30Object.defineProperty(t,"__esModule",{value:!0});let n=r(45108),i={keyword:"prefixItems",type:"array",schemaType:["array"],before:"uniqueItems",code:e=>(0,n.validateTuple)(e,"items")};t.default=i},35833:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});let n=r(47594),i=r(94399),o=r(35191),s=r(89940),a={keyword:"properties",type:"object",schemaType:"object",code(e){let{gen:t,schema:r,parentSchema:a,data:c,it:u}=e;"all"===u.opts.removeAdditional&&void 0===a.additionalProperties&&s.default.code(new n.KeywordCxt(u,s.default,"additionalProperties"));let l=(0,i.allSchemaProperties)(r);for(let e of l)u.definedProperties.add(e);u.opts.unevaluated&&l.length&&!0!==u.props&&(u.props=o.mergeEvaluated.props(t,(0,o.toHash)(l),u.props));let d=l.filter(e=>!(0,o.alwaysValidSchema)(u,r[e]));if(0===d.length)return;let f=t.name("valid");for(let r of d)h(r)?p(r):(t.if((0,i.propertyInData)(t,c,r,u.opts.ownProperties)),p(r),u.allErrors||t.else().var(f,!0),t.endIf()),e.it.definedProperties.add(r),e.ok(f);function h(e){return u.opts.useDefaults&&!u.compositeRule&&void 0!==r[e].default}function p(t){e.subschema({keyword:"properties",schemaProp:t,dataProp:t},f)}}};t.default=a},41915:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});let n=r(99991),i=r(35191),o={keyword:"propertyNames",type:"object",schemaType:["object","boolean"],error:{message:"property name must be valid",params:({params:e})=>(0,n._)`{propertyName: ${e.propertyName}}`}
30,code(e){let{gen:t,schema:r,data:o,it:s}=e;if((0,i.alwaysValidSchema)(s,r))return;let a=t.name("valid");t.forIn("key",o,r=>{e.setParams({propertyName:r}),e.subschema({keyword:"propertyNames",data:r,dataTypes:["string"],propertyName:r,compositeRule:!0},a),t.if((0,n.not)(a),()=>{e.error(!0),s.allErrors||t.break()})}),e.ok(a)}};t.default=o},44466:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});let n=r(35191),i={keyword:["then","else"],schemaType:["object","boolean"],code({keyword:e,parentSchema:t,it:r}){void 0===t.if&&(0,n.checkStrictMode)(r,`"${e}" without "if" is ignored`)}};t.default=i},94399:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.validateUnion=t.validateArray=t.usePattern=t.callValidateCode=t.schemaProperties=t.allSchemaProperties=t.noPropertyInData=t.propertyInData=t.isOwnProperty=t.hasPropFunc=t.reportMissingProp=t.checkMissingProp=t.checkReportMissingProp=void 0;let n=r(99991),i=r(35191),o=r(52841),s=r(35191);function a(e,t){let{gen:r,data:i,it:o}=e;r.if(h(r,i,t,o.opts.ownProperties),()=>{e.setParams({missingProperty:(0,n._)`${t}`},!0),e.error()})}function c({gen:e,data:t,it:{opts:r}},i,o){return(0,n.or)(...i.map(i=>(0,n.and)(h(e,t,i,r.ownProperties),(0,n._)`${o} = ${i}`)))}function u(e,t){e.setParams({missingProperty:t},!0),e.error()}function l(e){return e.scopeValue("func",{ref:Object.prototype.hasOwnProperty,code:(0,n._)`Object.prototype.hasOwnProperty`})}function d(e,t,r){return(0,n._)`${l(e)}.call(${t}, ${r})`}function f(e,t,r,i){let o=(0,n._)`${t}${(0,n.getProperty)(r)} !== undefined`;return i?(0,n._)`${o} && ${d(e,t,r)}`:o}function h(e,t,r,i){let o=(0,n._)`${t}${(0,n.getProperty)(r)} === undefined`;return i?(0,n.or)(o,(0,n.not)(d(e,t,r))):o}function p(e){return e?Object.keys(e).filter(e=>"__proto__"!==e):[]}function y(e,t){return p(t).filter(r=>!(0,i.alwaysValidSchema)(e,t[r]))}function g({schemaCode:e,data:t,it:{gen:r,topSchemaRef:i,schemaPath:s,errorPath:a},it:c},u,l,d){let f=d?(0,n._)`${e}, ${t}, ${i}${s}`:t,h=[[o.default.instancePath,(0,n.strConcat)(o.default.instancePath,a)],[o.default.parentData,c.parentData],[o.default.parentDataProperty,c.parentDataProperty],[o.default.rootData,o.default.rootData]];c.opts.dynamicRef&&h.push([o.default.dynamicAnchors,o.default.dynamicAnchors]);let p=(0,n._)`${f}, ${r.object(...h)}`;return l!==n.nil?(0,n._)`${u}.call(${l}, ${p})`:(0,n._)`${u}(${p})`}t.checkReportMissingProp=a,t.checkMissingProp=c,t.reportMissingProp=u,t.hasPropFunc=l,t.isOwnProperty=d,t.propertyInData=f,t.noPropertyInData=h,t.allSchemaProperties=p,t.schemaProperties=y,t.callValidateCode=g;let m=(0,n._)`new RegExp`;function b({gen:e,it:{opts:t}},r){let i=t.unicodeRegExp?"u":"",{regExp:o}=t.code,a=o(r,i);return e.scopeValue("pattern",{key:a.toString(),ref:a,code:(0,n._)`${"new RegExp"===o.code?m:(0,s.useFunc)(e,o)}(${r}, ${i})`})}function v(e){let{gen:t,data:r,keyword:o,it:s}=e,a=t.name("valid");if(s.allErrors){let e=t.let("valid",!0);return c(()=>t.assign(e,!1)),e}return t.var(a,!0),c(()=>t.break()),a;function c(s){let c=t.const("len",(0,n._)`${r}.length`);t.forRange("i",0,c,r=>{e.subschema({keyword:o,dataProp:r,dataPropType:i.Type.Num},a),t.if((0,n.not)(a),s)})}}function w(e){let{gen:t,schema:r,keyword:o,it:s}=e;if(!Array.isArray(r))throw Error("ajv implementation error");if(r.some(e=>(0,i.alwaysValidSchema)(s,e))&&!s.opts.unevaluated)return;let a=t.let("valid",!1),c=t.name("_valid");t.block(()=>r.forEach((r,i)=>{let s=e.subschema({keyword:o,schemaProp:i,compositeRule:!0},c);t.assign(a,(0,n._)`${a} || ${c}`),e.mergeValidEvaluated(s,c)||t.if((0,n.not)(a))})),e.result(a,()=>e.reset(),()=>e.error(!0))}t.usePattern=b,t.validateArray=v,t.validateUnion=w},19063:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});let r={keyword:"id",code(){throw Error('NOT SUPPORTED: keyword "id", use "$id" for schema ID')}};t.default=r},13978:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});let n=r(19063),i=r(70679),o=["$schema","$id","$defs","$vocabulary",{keyword:"$comment"},"definitions",n.default,i.default];t.default=o},70679:(e,t,r)=>{"use strict";
30Object.defineProperty(t,"__esModule",{value:!0}),t.callRef=t.getValidate=void 0;let n=r(4481),i=r(94399),o=r(99991),s=r(52841),a=r(71853),c=r(35191),u={keyword:"$ref",schemaType:"string",code(e){let{gen:t,schema:r,it:i}=e,{baseId:s,schemaEnv:c,validateName:u,opts:f,self:h}=i,{root:p}=c;if(("#"===r||"#/"===r)&&s===p.baseId)return g();let y=a.resolveRef.call(h,p,s,r);if(void 0===y)throw new n.default(i.opts.uriResolver,s,r);if(y instanceof a.SchemaEnv)return m(y);return b(y);function g(){if(c===p)return d(e,u,c,c.$async);let r=t.scopeValue("root",{ref:p});return d(e,(0,o._)`${r}.validate`,p,p.$async)}function m(t){let r=l(e,t);d(e,r,t,t.$async)}function b(n){let i=t.scopeValue("schema",!0===f.code.source?{ref:n,code:(0,o.stringify)(n)}:{ref:n}),s=t.name("valid"),a=e.subschema({schema:n,dataTypes:[],schemaPath:o.nil,topSchemaRef:i,errSchemaPath:r},s);e.mergeEvaluated(a),e.ok(s)}}};function l(e,t){let{gen:r}=e;return t.validate?r.scopeValue("validate",{ref:t.validate}):(0,o._)`${r.scopeValue("wrapper",{ref:t})}.validate`}function d(e,t,r,n){let{gen:a,it:u}=e,{allErrors:l,schemaEnv:d,opts:f}=u,h=f.passContext?s.default.this:o.nil;function p(){if(!d.$async)throw Error("async schema referenced by sync schema");let r=a.let("valid");a.try(()=>{a.code((0,o._)`await ${(0,i.callValidateCode)(e,t,h)}`),m(t),l||a.assign(r,!0)},e=>{a.if((0,o._)`!(${e} instanceof ${u.ValidationError})`,()=>a.throw(e)),g(e),l||a.assign(r,!1)}),e.ok(r)}function y(){e.result((0,i.callValidateCode)(e,t,h),()=>m(t),()=>g(t))}function g(e){let t=(0,o._)`${e}.errors`;a.assign(s.default.vErrors,(0,o._)`${s.default.vErrors} === null ? ${t} : ${s.default.vErrors}.concat(${t})`),a.assign(s.default.errors,(0,o._)`${s.default.vErrors}.length`)}function m(e){var t;if(!u.opts.unevaluated)return;let n=null===(t=null==r?void 0:r.validate)||void 0===t?void 0:t.evaluated;if(!0!==u.props){if(n&&!n.dynamicProps)void 0!==n.props&&(u.props=c.mergeEvaluated.props(a,n.props,u.props));else{let t=a.var("props",(0,o._)`${e}.evaluated.props`);u.props=c.mergeEvaluated.props(a,t,u.props,o.Name)}}if(!0!==u.items){if(n&&!n.dynamicItems)void 0!==n.items&&(u.items=c.mergeEvaluated.items(a,n.items,u.items));else{let t=a.var("items",(0,o._)`${e}.evaluated.items`);u.items=c.mergeEvaluated.items(a,t,u.items,o.Name)}}}n?p():y()}t.getValidate=l,t.callRef=d,t.default=u},62309:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});let n=r(99991),i=r(27080),o=r(71853),s=r(4481),a=r(35191),c={keyword:"discriminator",type:"object",schemaType:"object",error:{message:({params:{discrError:e,tagName:t}})=>e===i.DiscrError.Tag?`tag "${t}" must be string`:`value of tag "${t}" must be in oneOf`,params:({params:{discrError:e,tag:t,tagName:r}})=>(0,n._)`{error: ${e}, tag: ${r}, tagValue: ${t}}`},code(e){let{gen:t,data:r,schema:c,parentSchema:u,it:l}=e,{oneOf:d}=u;if(!l.opts.discriminator)throw Error("discriminator: requires discriminator option");let f=c.propertyName;if("string"!=typeof f)throw Error("discriminator: requires propertyName");if(c.mapping)throw Error("discriminator: mapping is not supported");if(!d)throw Error("discriminator: requires oneOf keyword");let h=t.let("valid",!1),p=t.const("tag",(0,n._)`${r}${(0,n.getProperty)(f)}`);function y(){let r=m();for(let e in t.if(!1),r)t.elseIf((0,n._)`${p} === ${e}`),t.assign(h,g(r[e]));t.else(),e.error(!1,{discrError:i.DiscrError.Mapping,tag:p,tagName:f}),t.endIf()}function g(r){let i=t.name("valid"),o=e.subschema({keyword:"oneOf",schemaProp:r},i);return e.mergeEvaluated(o,n.Name),i}function m(){var e;let t={},r=i(u),n=!0;for(let t=0;t<d.length;t++){let u=d[t];if((null==u?void 0:u.$ref)&&!(0,a.schemaHasRulesButRef)(u,l.self.RULES)){let e=u.$ref;if((u=o.resolveRef.call(l.self,l.schemaEnv.root,l.baseId,e))instanceof o.SchemaEnv&&(u=u.schema),void 0===u)throw new s.default(l.opts.uriResolver,l.baseId,e)}let h=null===(e=null==u?void 0:u.properties)||void 0===e?void 0:e[f];if("object"!=typeof h)throw Error(`discriminator: oneOf subschemas (or referenced schemas) must have "properties/${f}"`);n=n&&(r||i(u)),c(h,t)}if(!n)throw Error(`discriminator: "${f}" must be required`);return t;function i({required:e}){return Array.isArray(e)&&e.includes(f)}function c(e,t){if(e.const)h(e.const,t);else if(e.enum)for(let r of e.enum)h(r,t);else throw Error(`discriminator: "properties/${f}" must have "const" or "enum"`)}function h(e,r){if("string"!=typeof e||e in t)throw Error(`discriminator: "${f}" values must be unique strings`);t[e]=r}}
30t.if((0,n._)`typeof ${p} == "string"`,()=>y(),()=>e.error(!1,{discrError:i.DiscrError.Tag,tag:p,tagName:f})),e.ok(h)}};t.default=c},27080:(e,t)=>{"use strict";var r;Object.defineProperty(t,"__esModule",{value:!0}),t.DiscrError=void 0,function(e){e.Tag="tag",e.Mapping="mapping"}(r||(t.DiscrError=r={}))},19274:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});let n=r(13978),i=r(88550),o=r(8092),s=r(47974),a=r(39759),c=[n.default,i.default,(0,o.default)(),s.default,a.metadataVocabulary,a.contentVocabulary];t.default=c},31693:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});let n=r(99991),i={keyword:"format",type:["number","string"],schemaType:"string",$data:!0,error:{message:({schemaCode:e})=>(0,n.str)`must match format "${e}"`,params:({schemaCode:e})=>(0,n._)`{format: ${e}}`},code(e,t){let{gen:r,data:i,$data:o,schema:s,schemaCode:a,it:c}=e,{opts:u,errSchemaPath:l,schemaEnv:d,self:f}=c;function h(){let o=r.scopeValue("formats",{ref:f.formats,code:u.code.formats}),s=r.const("fDef",(0,n._)`${o}[${a}]`),c=r.let("fType"),l=r.let("format");function h(){return!1===u.strictSchema?n.nil:(0,n._)`${a} && !${l}`}function p(){let e=d.$async?(0,n._)`(${s}.async ? await ${l}(${i}) : ${l}(${i}))`:(0,n._)`${l}(${i})`,r=(0,n._)`(typeof ${l} == "function" ? ${e} : ${l}.test(${i}))`;return(0,n._)`${l} && ${l} !== true && ${c} === ${t} && !${r}`}r.if((0,n._)`typeof ${s} == "object" && !(${s} instanceof RegExp)`,()=>r.assign(c,(0,n._)`${s}.type || "string"`).assign(l,(0,n._)`${s}.validate`),()=>r.assign(c,(0,n._)`"string"`).assign(l,s)),e.fail$data((0,n.or)(h(),p()))}function p(){let o=f.formats[s];if(!o){p();return}if(!0===o)return;let[a,c,h]=y(o);function p(){if(!1===u.strictSchema){f.logger.warn(e());return}throw Error(e());function e(){return`unknown format "${s}" ignored in schema at path "${l}"`}}function y(e){let t=e instanceof RegExp?(0,n.regexpCode)(e):u.code.formats?(0,n._)`${u.code.formats}${(0,n.getProperty)(s)}`:void 0,i=r.scopeValue("formats",{key:s,ref:e,code:t});return"object"!=typeof e||e instanceof RegExp?["string",e,i]:[e.type||"string",e.validate,(0,n._)`${i}.validate`]}function g(){if("object"==typeof o&&!(o instanceof RegExp)&&o.async){if(!d.$async)throw Error("async format in sync schema");return(0,n._)`await ${h}(${i})`}return"function"==typeof c?(0,n._)`${h}(${i})`:(0,n._)`${h}.test(${i})`}a===t&&e.pass(g())}u.validateFormats&&(o?h():p())}};t.default=i},47974:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});let n=[r(31693).default];t.default=n},39759:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.contentVocabulary=t.metadataVocabulary=void 0,t.metadataVocabulary=["title","description","default","deprecated","readOnly","writeOnly","examples"],t.contentVocabulary=["contentMediaType","contentEncoding","contentSchema"]},81437:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});let n=r(99991),i=r(35191),o=r(69152),s={keyword:"const",$data:!0,error:{message:"must be equal to constant",params:({schemaCode:e})=>(0,n._)`{allowedValue: ${e}}`},code(e){let{gen:t,data:r,$data:s,schemaCode:a,schema:c}=e;s||c&&"object"==typeof c?e.fail$data((0,n._)`!${(0,i.useFunc)(t,o.default)}(${r}, ${a})`):e.fail((0,n._)`${c} !== ${r}`)}};t.default=s},10899:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});let n=r(99991),i=r(35191),o=r(69152),s={keyword:"enum",schemaType:"array",$data:!0,error:{message:"must be equal to one of the allowed values",params:({schemaCode:e})=>(0,n._)`{allowedValues: ${e}}`},code(e){let t,r;let{gen:s,data:a,$data:c,schema:u,schemaCode:l,it:d}=e;if(!c&&0===u.length)throw Error("enum must have non-empty array");let f=u.length>=d.opts.loopEnum,h=()=>null!=t?t:t=(0,i.useFunc)(s,o.default);if(f||c)r=s.let("valid"),e.block$data(r,p);else{if(!Array.isArray(u))throw Error("ajv implementation error");let e=s.const("vSchema",l);r=(0,n.or)(...u.map((t,r)=>y(e,r)))}function p(){s.assign(r,!1),s.forOf("v",l,e=>s.if((0,n._)`${h()}(${a}, ${e})`,()=>s.assign(r,!0).break()))}function y(e,t){let r=u[t];return"object"==typeof r&&null!==r?(0,n._)`${h()}(${a}, ${e}[${t}])`:(0,n._)`${a} === ${r}`}e.pass(r)}};t.default=s},88550:(e,t,r)=>{"use strict";
30Object.defineProperty(t,"__esModule",{value:!0});let n=r(73896),i=r(94251),o=r(86285),s=r(60344),a=r(7776),c=r(62423),u=r(34795),l=r(43799),d=r(81437),f=r(10899),h=[n.default,i.default,o.default,s.default,a.default,c.default,u.default,l.default,{keyword:"type",schemaType:["string","array"]},{keyword:"nullable",schemaType:"boolean"},d.default,f.default];t.default=h},34795:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});let n=r(99991),i={keyword:["maxItems","minItems"],type:"array",schemaType:"number",$data:!0,error:{message({keyword:e,schemaCode:t}){let r="maxItems"===e?"more":"fewer";return(0,n.str)`must NOT have ${r} than ${t} items`},params:({schemaCode:e})=>(0,n._)`{limit: ${e}}`},code(e){let{keyword:t,data:r,schemaCode:i}=e,o="maxItems"===t?n.operators.GT:n.operators.LT;e.fail$data((0,n._)`${r}.length ${o} ${i}`)}};t.default=i},86285:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});let n=r(99991),i=r(35191),o=r(26849),s={keyword:["maxLength","minLength"],type:"string",schemaType:"number",$data:!0,error:{message({keyword:e,schemaCode:t}){let r="maxLength"===e?"more":"fewer";return(0,n.str)`must NOT have ${r} than ${t} characters`},params:({schemaCode:e})=>(0,n._)`{limit: ${e}}`},code(e){let{keyword:t,data:r,schemaCode:s,it:a}=e,c="maxLength"===t?n.operators.GT:n.operators.LT,u=!1===a.opts.unicode?(0,n._)`${r}.length`:(0,n._)`${(0,i.useFunc)(e.gen,o.default)}(${r})`;e.fail$data((0,n._)`${u} ${c} ${s}`)}};t.default=s},73896:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});let n=r(99991),i=n.operators,o={maximum:{okStr:"<=",ok:i.LTE,fail:i.GT},minimum:{okStr:">=",ok:i.GTE,fail:i.LT},exclusiveMaximum:{okStr:"<",ok:i.LT,fail:i.GTE},exclusiveMinimum:{okStr:">",ok:i.GT,fail:i.LTE}},s={message:({keyword:e,schemaCode:t})=>(0,n.str)`must be ${o[e].okStr} ${t}`,params:({keyword:e,schemaCode:t})=>(0,n._)`{comparison: ${o[e].okStr}, limit: ${t}}`},a={keyword:Object.keys(o),type:"number",schemaType:"number",$data:!0,error:s,code(e){let{keyword:t,data:r,schemaCode:i}=e;e.fail$data((0,n._)`${r} ${o[t].fail} ${i} || isNaN(${r})`)}};t.default=a},7776:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});let n=r(99991),i={keyword:["maxProperties","minProperties"],type:"object",schemaType:"number",$data:!0,error:{message({keyword:e,schemaCode:t}){let r="maxProperties"===e?"more":"fewer";return(0,n.str)`must NOT have ${r} than ${t} properties`},params:({schemaCode:e})=>(0,n._)`{limit: ${e}}`},code(e){let{keyword:t,data:r,schemaCode:i}=e,o="maxProperties"===t?n.operators.GT:n.operators.LT;e.fail$data((0,n._)`Object.keys(${r}).length ${o} ${i}`)}};t.default=i},94251:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});let n=r(99991),i={keyword:"multipleOf",type:"number",schemaType:"number",$data:!0,error:{message:({schemaCode:e})=>(0,n.str)`must be multiple of ${e}`,params:({schemaCode:e})=>(0,n._)`{multipleOf: ${e}}`},code(e){let{gen:t,data:r,schemaCode:i,it:o}=e,s=o.opts.multipleOfPrecision,a=t.let("res"),c=s?(0,n._)`Math.abs(Math.round(${a}) - ${a}) > 1e-${s}`:(0,n._)`${a} !== parseInt(${a})`;e.fail$data((0,n._)`(${i} === 0 || (${a} = ${r}/${i}, ${c}))`)}};t.default=i},60344:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});let n=r(94399),i=r(35191),o=r(99991),s={keyword:"pattern",type:"string",schemaType:"string",$data:!0,error:{message:({schemaCode:e})=>(0,o.str)`must match pattern "${e}"`,params:({schemaCode:e})=>(0,o._)`{pattern: ${e}}`},code(e){let{gen:t,data:r,$data:s,schema:a,schemaCode:c,it:u}=e,l=u.opts.unicodeRegExp?"u":"";if(s){let{regExp:n}=u.opts.code,s="new RegExp"===n.code?(0,o._)`new RegExp`:(0,i.useFunc)(t,n),a=t.let("valid");t.try(()=>t.assign(a,(0,o._)`${s}(${c}, ${l}).test(${r})`),()=>t.assign(a,!1)),e.fail$data((0,o._)`!${a}`)}else{let t=(0,n.usePattern)(e,a);e.fail$data((0,o._)`!${t}.test(${r})`)}}};t.default=s},62423:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});let n=r(94399),i=r(99991),o=r(35191),s={keyword:"required",type:"object",schemaType:"array",$data:!0,error:{message:({params:{missingProperty:e}})=>(0,i.str)`must have required property '${e}'`,params:({params:{missingProperty:e}})=>(0,i._)`{missingProperty: ${e}}`}
30,code(e){let{gen:t,schema:r,schemaCode:s,data:a,$data:c,it:u}=e,{opts:l}=u;if(!c&&0===r.length)return;let d=r.length>=l.loopRequired;if(u.allErrors?f():h(),l.strictRequired){let t=e.parentSchema.properties,{definedProperties:n}=e.it;for(let e of r)if((null==t?void 0:t[e])===void 0&&!n.has(e)){let t=u.schemaEnv.baseId+u.errSchemaPath,r=`required property "${e}" is not defined at "${t}" (strictRequired)`;(0,o.checkStrictMode)(u,r,u.opts.strictRequired)}}function f(){if(d||c)e.block$data(i.nil,p);else for(let t of r)(0,n.checkReportMissingProp)(e,t)}function h(){let i=t.let("missing");if(d||c){let r=t.let("valid",!0);e.block$data(r,()=>y(i,r)),e.ok(r)}else t.if((0,n.checkMissingProp)(e,r,i)),(0,n.reportMissingProp)(e,i),t.else()}function p(){t.forOf("prop",s,r=>{e.setParams({missingProperty:r}),t.if((0,n.noPropertyInData)(t,a,r,l.ownProperties),()=>e.error())})}function y(r,o){e.setParams({missingProperty:r}),t.forOf(r,s,()=>{t.assign(o,(0,n.propertyInData)(t,a,r,l.ownProperties)),t.if((0,i.not)(o),()=>{e.error(),t.break()})},i.nil)}}};t.default=s},43799:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});let n=r(71894),i=r(99991),o=r(35191),s=r(69152),a={keyword:"uniqueItems",type:"array",schemaType:"boolean",$data:!0,error:{message:({params:{i:e,j:t}})=>(0,i.str)`must NOT have duplicate items (items ## ${t} and ${e} are identical)`,params:({params:{i:e,j:t}})=>(0,i._)`{i: ${e}, j: ${t}}`},code(e){let{gen:t,data:r,$data:a,schema:c,parentSchema:u,schemaCode:l,it:d}=e;if(!a&&!c)return;let f=t.let("valid"),h=u.items?(0,n.getSchemaTypes)(u.items):[];function p(){let n=t.let("i",(0,i._)`${r}.length`),o=t.let("j");e.setParams({i:n,j:o}),t.assign(f,!0),t.if((0,i._)`${n} > 1`,()=>(y()?g:m)(n,o))}function y(){return h.length>0&&!h.some(e=>"object"===e||"array"===e)}function g(o,s){let a=t.name("item"),c=(0,n.checkDataTypes)(h,a,d.opts.strictNumbers,n.DataType.Wrong),u=t.const("indices",(0,i._)`{}`);t.for((0,i._)`;${o}--;`,()=>{t.let(a,(0,i._)`${r}[${o}]`),t.if(c,(0,i._)`continue`),h.length>1&&t.if((0,i._)`typeof ${a} == "string"`,(0,i._)`${a} += "_"`),t.if((0,i._)`typeof ${u}[${a}] == "number"`,()=>{t.assign(s,(0,i._)`${u}[${a}]`),e.error(),t.assign(f,!1).break()}).code((0,i._)`${u}[${a}] = ${o}`)})}function m(n,a){let c=(0,o.useFunc)(t,s.default),u=t.name("outer");t.label(u).for((0,i._)`;${n}--;`,()=>t.for((0,i._)`${a} = ${n}; ${a}--;`,()=>t.if((0,i._)`${c}(${r}[${n}], ${r}[${a}])`,()=>{e.error(),t.assign(f,!1).break(u)})))}e.block$data(f,p,(0,i._)`${l} === false`),e.ok(f)}};t.default=a},69272:e=>{"use strict";var t=e.exports=function(e,t,n){"function"==typeof t&&(n=t,t={});var i="function"==typeof(n=t.cb||n)?n:n.pre||function(){};r(t,i,n.post||function(){},e,"",e)};function r(e,i,o,s,a,c,u,l,d,f){if(s&&"object"==typeof s&&!Array.isArray(s)){for(var h in i(s,a,c,u,l,d,f),s){var p=s[h];if(Array.isArray(p)){if(h in t.arrayKeywords)for(var y=0;y<p.length;y++)r(e,i,o,p[y],a+"/"+h+"/"+y,c,a,h,s,y)}else if(h in t.propsKeywords){if(p&&"object"==typeof p)for(var g in p)r(e,i,o,p[g],a+"/"+h+"/"+n(g),c,a,h,s,g)}else(h in t.keywords||e.allKeys&&!(h in t.skipKeywords))&&r(e,i,o,p,a+"/"+h,c,a,h,s)}o(s,a,c,u,l,d,f)}}function n(e){return e.replace(/~/g,"~0").replace(/\//g,"~1")}t.keywords={additionalItems:!0,items:!0,contains:!0,additionalProperties:!0,propertyNames:!0,not:!0,if:!0,then:!0,else:!0},t.arrayKeywords={items:!0,allOf:!0,anyOf:!0,oneOf:!0},t.propsKeywords={$defs:!0,definitions:!0,properties:!0,patternProperties:!0,dependencies:!0},t.skipKeywords={default:!0,enum:!0,const:!0,required:!0,maximum:!0,minimum:!0,exclusiveMaximum:!0,exclusiveMinimum:!0,multipleOf:!0,maxLength:!0,minLength:!0,pattern:!0,format:!0,maxItems:!0,minItems:!0,uniqueItems:!0,maxProperties:!0,minProperties:!0}},54201:(e,t,r)=>{var n=r(62903).Buffer;e.exports=function(e){for(var t={},r=e.length,i=e.charAt(0),o=0;o<e.length;o++){var s=e.charAt(o);if(void 0!==t[s])throw TypeError(s+" is ambiguous");t[s]=o}function a(e){if(0===e.length)return n.allocUnsafe(0);for(var o=[0],s=0;s<e.length;s++){var a=t[e[s]];if(void 0===a)return;for(var c=0,u=a;c<o.length;++c)u+=o[c]*r,o[c]=255&u,u>>=8;for(;u>0;)o.push(255&u),u>>=8}for(var l=0;e[l]===i&&l<e.length-1;++l)o.push(0);return n.from(o.reverse())}function c(e){var t=a(e);if(t)return t;throw Error("Non-base"+r+" character")}return{encode:function(t){if(0===t.length)return"";for(var n=[0],i=0;i<t.length;++i){for(var o=0,s=t[i];o<n.length;++o)s+=n[o]<<8,n[o]=s%r,s=s/r|0;for(;s>0;)n.push(s%r),s=s/r|0}for(var a="",c=0;0===t[c]&&c<t.length-1;++c)a+=e[0];for(var u=n.length-1;u>=0;--u)a+=e[n[u]];return a},decodeUnsafe:a,decode:c}}},3836:(e,t)=>{"use strict";t.byteLength=u,t.toByteArray=d,t.fromByteArray=p;for(var r=[],n=[],i="undefined"!=typeof Uint8Array?Uint8Array:Array,o="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789
30+/",s=0,a=o.length;s<a;++s)r[s]=o[s],n[o.charCodeAt(s)]=s;function c(e){var t=e.length;if(t%4>0)throw Error("Invalid string. Length must be a multiple of 4");var r=e.indexOf("=");-1===r&&(r=t);var n=r===t?0:4-r%4;return[r,n]}function u(e){var t=c(e),r=t[0],n=t[1];return(r+n)*3/4-n}function l(e,t,r){return(t+r)*3/4-r}function d(e){var t,r,o=c(e),s=o[0],a=o[1],u=new i(l(e,s,a)),d=0,f=a>0?s-4:s;for(r=0;r<f;r+=4)t=n[e.charCodeAt(r)]<<18|n[e.charCodeAt(r+1)]<<12|n[e.charCodeAt(r+2)]<<6|n[e.charCodeAt(r+3)],u[d++]=t>>16&255,u[d++]=t>>8&255,u[d++]=255&t;return 2===a&&(t=n[e.charCodeAt(r)]<<2|n[e.charCodeAt(r+1)]>>4,u[d++]=255&t),1===a&&(t=n[e.charCodeAt(r)]<<10|n[e.charCodeAt(r+1)]<<4|n[e.charCodeAt(r+2)]>>2,u[d++]=t>>8&255,u[d++]=255&t),u}function f(e){return r[e>>18&63]+r[e>>12&63]+r[e>>6&63]+r[63&e]}function h(e,t,r){for(var n=[],i=t;i<r;i+=3)n.push(f((e[i]<<16&0xff0000)+(e[i+1]<<8&65280)+(255&e[i+2])));return n.join("")}function p(e){for(var t,n=e.length,i=n%3,o=[],s=16383,a=0,c=n-i;a<c;a+=s)o.push(h(e,a,a+s>c?c:a+s));return 1===i?o.push(r[(t=e[n-1])>>2]+r[t<<4&63]+"=="):2===i&&o.push(r[(t=(e[n-2]<<8)+e[n-1])>>10]+r[t>>4&63]+r[t<<2&63]+"="),o.join("")}n["-".charCodeAt(0)]=62,n["_".charCodeAt(0)]=63},73830:(e,t,r)=>{let n=r(86561);function i(e,t,r){let n=e[t]+e[r],i=e[t+1]+e[r+1];n>=0x100000000&&i++,e[t]=n,e[t+1]=i}function o(e,t,r,n){let i=e[t]+r;r<0&&(i+=0x100000000);let o=e[t+1]+n;i>=0x100000000&&o++,e[t]=i,e[t+1]=o}function s(e,t){return e[t]^e[t+1]<<8^e[t+2]<<16^e[t+3]<<24}function a(e,t,r,n,s,a){let c=d[s],u=d[s+1],f=d[a],h=d[a+1];i(l,e,t),o(l,e,c,u);let p=l[n]^l[e],y=l[n+1]^l[e+1];l[n]=y,l[n+1]=p,i(l,r,n),p=l[t]^l[r],y=l[t+1]^l[r+1],l[t]=p>>>24^y<<8,l[t+1]=y>>>24^p<<8,i(l,e,t),o(l,e,f,h),p=l[n]^l[e],y=l[n+1]^l[e+1],l[n]=p>>>16^y<<16,l[n+1]=y>>>16^p<<16,i(l,r,n),p=l[t]^l[r],y=l[t+1]^l[r+1],l[t]=y>>>31^p<<1,l[t+1]=p>>>31^y<<1}let c=new Uint32Array([0xf3bcc908,0x6a09e667,0x84caa73b,0xbb67ae85,0xfe94f82b,0x3c6ef372,0x5f1d36f1,0xa54ff53a,0xade682d1,0x510e527f,0x2b3e6c1f,0x9b05688c,0xfb41bd6b,0x1f83d9ab,0x137e2179,0x5be0cd19]),u=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].map(function(e){return 2*e})),l=new Uint32Array(32),d=new Uint32Array(32);function f(e,t){let r=0;for(r=0;r<16;r++)l[r]=e.h[r],l[r+16]=c[r];for(l[24]=l[24]^e.t,l[25]=l[25]^e.t/0x100000000,t&&(l[28]=~l[28],l[29]=~l[29]),r=0;r<32;r++)d[r]=s(e.b,4*r);for(r=0;r<12;r++)a(0,8,16,24,u[16*r+0],u[16*r+1]),a(2,10,18,26,u[16*r+2],u[16*r+3]),a(4,12,20,28,u[16*r+4],u[16*r+5]),a(6,14,22,30,u[16*r+6],u[16*r+7]),a(0,10,20,30,u[16*r+8],u[16*r+9]),a(2,12,22,24,u[16*r+10],u[16*r+11]),a(4,14,16,26,u[16*r+12],u[16*r+13]),a(6,8,18,28,u[16*r+14],u[16*r+15]);for(r=0;r<16;r++)e.h[r]=e.h[r]^l[r]^l[r+16]}let h=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]);function p(e,t,r,n){if(0===e||e>64)throw Error("Illegal output length, expected 0 < length <= 64");if(t&&t.length>64)throw Error("Illegal key, expected Uint8Array with 0 < length <= 64");if(r&&16!==r.length)throw Error("Illegal salt, expected Uint8Array with length is 16");if(n&&16!==n.length)throw Error("Illegal personal, expected Uint8Array with length is 16");let i={b:new Uint8Array(128),h:new Uint32Array(16),t:0,c:0,outlen:e};h.fill(0),h[0]=e,t&&(h[1]=t.length),h[2]=1,h[3]=1,r&&h.set(r,32),n&&h.set(n,48);for(let e=0;e<16;e++)i.h[e]=c[e]^s(h,4*e);return t&&(y(i,t),i.c=128),i}function y(e,t){for(let r=0;r<t.length;r++)128===e.c&&(e.t+=e.c,f(e,!1),e.c=0),e.b[e.c++]=t[r]}function g(e){for(e.t+=e.c;e.c<128;)e.b[e.c++]=0;f(e,!0);let t=new Uint8Array(e.outlen);for(let r=0;r<e.outlen;r++)t[r]=e.h[r>>2]>>8*(3&r);return t}function m(e,t,r,i,o){r=r||64,e=n.normalizeInput(e),i&&(i=n.normalizeInput(i)),o&&(o=n.normalizeInput(o));let s=p(r,t,i,o);return y(s,e),g(s)}function b(e,t,r,i,o){let s=m(e,t,r,i,o);return n.toHex(s)}e.exports={blake2b:m,blake2bHex:b,blake2bInit:p,blake2bUpdate:y,blake2bFinal:g}},21681:(e,t,r)=>{let n=r(86561);function i(e,t){return e[t]^e[t+1]<<8^e[t+2]<<16^e[t+3]<<24}function o(e,t,r,n,i,o){u[e]=u[e]+u[t]+i,u[n]=s(u[n]^u[e],16),u[r]=u[r]+u[n],u[t]=s(u[t]^u[r],12),u[e]=u[e]+u[t]+o,u[n]=s(u[n]^u[e],8),u[r]=u[r]+u[n],u[t]=s(u[t]^u[r],7)}function s(e,t){return e>>>t^e<<32-t}
30let a=new Uint32Array([0x6a09e667,0xbb67ae85,0x3c6ef372,0xa54ff53a,0x510e527f,0x9b05688c,0x1f83d9ab,0x5be0cd19]),c=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]),u=new Uint32Array(16),l=new Uint32Array(16);function d(e,t){let r=0;for(r=0;r<8;r++)u[r]=e.h[r],u[r+8]=a[r];for(u[12]^=e.t,u[13]^=e.t/0x100000000,t&&(u[14]=~u[14]),r=0;r<16;r++)l[r]=i(e.b,4*r);for(r=0;r<10;r++)o(0,4,8,12,l[c[16*r+0]],l[c[16*r+1]]),o(1,5,9,13,l[c[16*r+2]],l[c[16*r+3]]),o(2,6,10,14,l[c[16*r+4]],l[c[16*r+5]]),o(3,7,11,15,l[c[16*r+6]],l[c[16*r+7]]),o(0,5,10,15,l[c[16*r+8]],l[c[16*r+9]]),o(1,6,11,12,l[c[16*r+10]],l[c[16*r+11]]),o(2,7,8,13,l[c[16*r+12]],l[c[16*r+13]]),o(3,4,9,14,l[c[16*r+14]],l[c[16*r+15]]);for(r=0;r<8;r++)e.h[r]^=u[r]^u[r+8]}function f(e,t){if(!(e>0&&e<=32))throw Error("Incorrect output length, should be in [1, 32]");let r=t?t.length:0;if(t&&!(r>0&&r<=32))throw Error("Incorrect key length, should be in [1, 32]");let n={h:new Uint32Array(a),b:new Uint8Array(64),c:0,t:0,outlen:e};return n.h[0]^=0x1010000^r<<8^e,r>0&&(h(n,t),n.c=64),n}function h(e,t){for(let r=0;r<t.length;r++)64===e.c&&(e.t+=e.c,d(e,!1),e.c=0),e.b[e.c++]=t[r]}function p(e){for(e.t+=e.c;e.c<64;)e.b[e.c++]=0;d(e,!0);let t=new Uint8Array(e.outlen);for(let r=0;r<e.outlen;r++)t[r]=e.h[r>>2]>>8*(3&r)&255;return t}function y(e,t,r){r=r||32,e=n.normalizeInput(e);let i=f(r,t);return h(i,e),p(i)}function g(e,t,r){let i=y(e,t,r);return n.toHex(i)}e.exports={blake2s:y,blake2sHex:g,blake2sInit:f,blake2sUpdate:h,blake2sFinal:p}},17783:(e,t,r)=>{let n=r(73830),i=r(21681);e.exports={blake2b:n.blake2b,blake2bHex:n.blake2bHex,blake2bInit:n.blake2bInit,blake2bUpdate:n.blake2bUpdate,blake2bFinal:n.blake2bFinal,blake2s:i.blake2s,blake2sHex:i.blake2sHex,blake2sInit:i.blake2sInit,blake2sUpdate:i.blake2sUpdate,blake2sFinal:i.blake2sFinal}},86561:e=>{let t="Input must be an string, Buffer or Uint8Array";function r(e){let r;if(e instanceof Uint8Array)r=e;else if("string"==typeof e)r=new TextEncoder().encode(e);else throw Error(t);return r}function n(e){return Array.prototype.map.call(e,function(e){return(e<16?"0":"")+e.toString(16)}).join("")}function i(e){return(0x100000000+e).toString(16).substring(1)}function o(e,t,r){let n="\n"+e+" = ";for(let o=0;o<t.length;o+=2){if(32===r)n+=i(t[o]).toUpperCase(),n+=" ",n+=i(t[o+1]).toUpperCase();else if(64===r)n+=i(t[o+1]).toUpperCase(),n+=i(t[o]).toUpperCase();else throw Error("Invalid size "+r);o%6==4?n+="\n"+Array(e.length+4).join(" "):o<t.length-2&&(n+=" ")}console.log(n)}function s(e,t,r){let n=new Date().getTime(),i=new Uint8Array(t);for(let e=0;e<t;e++)i[e]=e%256;let o=new Date().getTime();console.log("Generated random input in "+(o-n)+"ms"),n=o;for(let o=0;o<r;o++){let r=e(i),o=new Date().getTime(),s=o-n;n=o,console.log("Hashed in "+s+"ms: "+r.substring(0,20)+"..."),console.log(Math.round(t/1048576/(s/1e3)*100)/100+" MB PER SECOND")}}e.exports={normalizeInput:r,toHex:n,debugPrint:o,testSpeed:s}},5852:function(e,t,r){!function(e,t){"use strict";function n(e,t){if(!e)throw 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"))}"object"==typeof e?e.exports=o:t.BN=o,o.BN=o,o.wordSize=26;try{d="undefined"!=typeof window&&void 0!==window.Buffer?window.Buffer:r(47790).Buffer}catch(e){}function s(e,t){var r=e.charCodeAt(t);return r>=48&&r<=57?r-48:r>=65&&r<=70?r-55:r>=97&&r<=102?r-87:void n(!1,"Invalid character in "+e)}function a(e,t,r){var n=s(e,r);return r-1>=t&&(n|=s(e,r-1)<<4),n}function c(e,t,r,i){for(var o=0,s=0,a=Math.min(e.length,r),c=t;c<a;c++){var u=e.charCodeAt(c)-48;o*=i,s=u>=49?u-49+10:u>=17?u-17+10:u,n(u>=0&&s<i,"Invalid character"),o+=s}return o}function u(e,t){e.words=t.words,e.length=t.length,e.negative=t.negative,e.red=t.red}if(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 0>e.cmp(t)?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<0x4000000?(this.words=[0x3ffffff&e],this.length=1):e<0x10000000000000?(this.words=[0x3ffffff&e,e/0x4000000&0x3ffffff],this.length=2):(n(e<0x20000000000000),this.words=[0x3ffffff&e,e/0x4000000&0x3ffffff,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=Array(this.length);for(var i,o,s=0;s<this.length;s++)this.words[s]=0;var a=0;if("be"===r)for(s=e.length-1,i=0;s>=0;s-=3)o=e[s]|e[s-1]<<8|e[s-2]<<16,this.words[i]|=o<<a&0x3ffffff,this.words[i+1]=o>>>
vendor: 7,492 bytes, line 30
3026-a&0x3ffffff,(a+=24)>=26&&(a-=26,i++);else if("le"===r)for(s=0,i=0;s<e.length;s+=3)o=e[s]|e[s+1]<<8|e[s+2]<<16,this.words[i]|=o<<a&0x3ffffff,this.words[i+1]=o>>>26-a&0x3ffffff,(a+=24)>=26&&(a-=26,i++);return this._strip()},o.prototype._parseHex=function(e,t,r){this.length=Math.ceil((e.length-t)/6),this.words=Array(this.length);for(var n,i=0;i<this.length;i++)this.words[i]=0;var o=0,s=0;if("be"===r)for(i=e.length-1;i>=t;i-=2)n=a(e,t,i)<<o,this.words[s]|=0x3ffffff&n,o>=18?(o-=18,s+=1,this.words[s]|=n>>>26):o+=8;else for(i=(e.length-t)%2==0?t+1:t;i<e.length;i+=2)n=a(e,t,i)<<o,this.words[s]|=0x3ffffff&n,o>=18?(o-=18,s+=1,this.words[s]|=n>>>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<=0x3ffffff;i*=t)n++;n--,i=i/t|0;for(var o=e.length-r,s=o%n,a=Math.min(o,o-s)+r,u=0,l=r;l<a;l+=n)u=c(e,l,l+n,t),this.imuln(i),this.words[0]+u<0x4000000?this.words[0]+=u:this._iaddn(u);if(0!==s){var d=1;for(u=c(e,l,e.length,t),l=0;l<s;l++)d*=t;this.imuln(d),this.words[0]+u<0x4000000?this.words[0]+=u:this._iaddn(u)}this._strip()},o.prototype.copy=function(e){e.words=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._move=function(e){u(e,this)},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},"undefined"!=typeof Symbol&&"function"==typeof Symbol.for)try{o.prototype[Symbol.for("nodejs.util.inspect.custom")]=l}catch(e){o.prototype.inspect=l}else o.prototype.inspect=l;function l(){return(this.red?"<BN-R: ":"<BN: ")+this.toString(16)+">"}var d,f=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000","000000000000000","0000000000000000","00000000000000000","000000000000000000","0000000000000000000","00000000000000000000","000000000000000000000","0000000000000000000000","00000000000000000000000","000000000000000000000000","0000000000000000000000000"],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],p=[0,0,0x2000000,0x290d741,0x1000000,0x2e90edd,0x39aa400,0x267bf47,0x1000000,0x290d741,1e7,0x12959c3,0x222c000,0x3bd7765,7529536,0xadcea1,0x1000000,0x1704f61,0x206fc40,0x2cddcf9,64e6,4084101,5153632,6436343,7962624,9765625,0xb54ba0,0xdaf26b,0x1069c00,0x138f9ad,243e5,0x1b4d89f,0x2000000,0x25528a1,0x2b54a20,0x3216b93,0x39aa400];o.prototype.toString=function(e,t){if(t=0|t||1,16===(e=e||10)||"hex"===e){r="";for(var r,i=0,o=0,s=0;s<this.length;s++){var a=this.words[s],c=((a<<i|o)&0xffffff).toString(16);o=a>>>24-i&0xffffff,(i+=2)>=26&&(i-=26,s--),r=0!==o||s!==this.length-1?f[6-c.length]+c+r:c+r}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],l=p[e];r="";var d=this.clone();for(d.negative=0;!d.isZero();){var y=d.modrn(l).toString(e);r=(d=d.idivn(l)).isZero()?y+r:f[u-y.length]+y+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+=0x4000000*this.words[1]:3===this.length&&1===this.words[2]?e+=0x10000000000000+0x4000000*this.words[1]:this.length>2&&n(!1,"Number can only safely store up to 53 bits"),0!==this.negative?-e:e},o.prototype.toJSON=function(){return this.toString(16,2)},d&&(o.prototype.toBuffer=function(e,t){return this.toArrayLike(d,e,t)}),o.prototype.toArray=function(e,t){return this.toArrayLike(Array,e,t)};var y=function(e,t){return e.allocUnsafe?e.allocUnsafe(t):new e(t)};function g(e){for(var t=Array(e.bitLength()),r=0;r<t.length;r++){var n=r/26|0,i=r%26;t[r]=e.words[n]>>>i&1}return t}function m(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=0x3ffffff&s,c=s/0x4000000|0;r.words[0]=a;for(var u=1;u<n;u++){for(var l=c>>>26,d=0x3ffffff&c,f=Math.min(u,t.length-1),h=Math.max(0,u-e.length+1);h<=f;h++){var p=u-h|0;l+=(s=(i=0|e.words[p])*(o=0|t.words[h])+d)/0x4000000|0,d=0x3ffffff&s}r.words[u]=0|d,c=0|l}return 0!==c?r.words[u]=0|c:r.length--,r._strip()}o.prototype.toArrayLike=function(e,t,r){this._strip();var i=this.byteLength(),o=r||Math.max(1,i);n(i<=o,"byte array longer than desired length"),n(o>0,"Requested array length <= 0");var s=y(e,o);return this["_toArrayLike"+("le"===t?"LE":"BE")](s,i),s},o.prototype._toArrayLikeLE=function(e,t){for(var r=0,n=0,i=0,o=0;i<this.length;i++){var s=this.words[i]<<o|n;e[r++]=255&s,r<e.length&&(e[r++]=s>>8&255),r<e.length&&(e[r++]=s>>16&255),6===o?(r<e.length&&(e[r++]=s>>24&255),n=0,o=0):(n=s>>>24,o+=2)}if(r<e.length)for(e[r++]=n;r<e.length;)e[r++]=0},o.prototype._toArrayLikeBE=function(e,t){for(var r=e.length-1,n=0,i=0,o=0;i<this.length;i++){var s=this.words[i]<<o|n;e[r--]=255&s,r>=0&&(e[r--]=s>>8&255),r>=0&&(e[r--]=s>>16&255),6===o?(r>=0&&(e[r--]=s>>24&255),n=0,o=0):(n=s>>>24,o+=2)}if(r>=0)for(e[r--]=n;r>=0;)e[r--]=0},Math.clz32?o.prototype._countBits=function(e){return 32-Math.clz32(e)}:o.prototype._countBits=function(e){var t=e,r=0;return t>=4096&&(r+=13,t>>>=13),t>=64&&(r+=7,t>>>=7),t>=8&&(r+=4,t>>>=4),t>=2&&(r+=2,t>>>=2),r+t},o.prototype._zeroBits=function(e){if(0===e)return 26;var t=e,r=0;return(8191&t)==0&&(r+=13,t>>>=13),(127&t)==0&&(r+=7,t>>>=7),(15&t)==0&&(r+=4,t>>>=4),(3&t)==0&&(r+=2,t>>>=2),(1&t)==0&&r++,r},o.prototype.bitLength=function(){var e=this.words[this.length-1],t=this._countBits(e);return(this.length-1)*26+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((this.negative|e.negative)==0),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((this.negative|e.negative)==0),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){this.length>e.length?(t=this,r=e):(t=e,r=this);for(var t,r,n=0;n<r.length;
vendor: 16,617 bytes, line 30
30n++)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((this.negative|e.negative)==0),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]=0x3ffffff&~this.words[i];return r>0&&(this.words[i]=~this.words[i]&0x3ffffff>>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),t?this.words[r]=this.words[r]|1<<i:this.words[r]=this.words[r]&~(1<<i),this._strip()},o.prototype.iadd=function(e){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 t,r,n,i=0,o=0;o<n.length;o++)t=(0|r.words[o])+(0|n.words[o])+i,this.words[o]=0x3ffffff&t,i=t>>>26;for(;0!==i&&o<r.length;o++)t=(0|r.words[o])+i,this.words[o]=0x3ffffff&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,r,n=this.iadd(e);return e.negative=1,n._normSign()}if(0!==this.negative)return this.negative=0,this.iadd(e),this.negative=1,this._normSign();var i=this.cmp(e);if(0===i)return this.negative=0,this.length=1,this.words[0]=0,this;i>0?(t=this,r=e):(t=e,r=this);for(var o=0,s=0;s<r.length;s++)o=(n=(0|t.words[s])-(0|r.words[s])+o)>>26,this.words[s]=0x3ffffff&n;for(;0!==o&&s<t.length;s++)o=(n=(0|t.words[s])+o)>>26,this.words[s]=0x3ffffff&n;if(0===o&&s<t.length&&t!==this)for(;s<t.length;s++)this.words[s]=t.words[s];return this.length=Math.max(this.length,s),t!==this&&(this.negative=1),this._strip()},o.prototype.sub=function(e){return this.clone().isub(e)};var b=function(e,t,r){var n,i,o,s=e.words,a=t.words,c=r.words,u=0,l=0|s[0],d=8191&l,f=l>>>13,h=0|s[1],p=8191&h,y=h>>>13,g=0|s[2],m=8191&g,b=g>>>13,v=0|s[3],w=8191&v,_=v>>>13,E=0|s[4],S=8191&E,x=E>>>13,A=0|s[5],I=8191&A,O=A>>>13,T=0|s[6],P=8191&T,M=T>>>13,N=0|s[7],k=8191&N,C=N>>>13,D=0|s[8],j=8191&D,R=D>>>13,L=0|s[9],B=8191&L,U=L>>>13,$=0|a[0],K=8191&$,F=$>>>13,z=0|a[1],q=8191&z,V=z>>>13,H=0|a[2],G=8191&H,W=H>>>13,J=0|a[3],Z=8191&J,Y=J>>>13,X=0|a[4],Q=8191&X,ee=X>>>13,et=0|a[5],er=8191&et,en=et>>>13,ei=0|a[6],eo=8191&ei,es=ei>>>13,ea=0|a[7],ec=8191&ea,eu=ea>>>13,el=0|a[8],ed=8191&el,ef=el>>>13,eh=0|a[9],ep=8191&eh,ey=eh>>>13;r.negative=e.negative^t.negative,r.length=19;var eg=(u+(n=Math.imul(d,K))|0)+((8191&(i=(i=Math.imul(d,F))+Math.imul(f,K)|0))<<13)|0;u=((o=Math.imul(f,F))+(i>>>13)|0)+(eg>>>26)|0,eg&=0x3ffffff,n=Math.imul(p,K),i=(i=Math.imul(p,F))+Math.imul(y,K)|0,o=Math.imul(y,F);var em=(u+(n=n+Math.imul(d,q)|0)|0)+((8191&(i=(i=i+Math.imul(d,V)|0)+Math.imul(f,q)|0))<<13)|0;u=((o=o+Math.imul(f,V)|0)+(i>>>13)|0)+(em>>>26)|0,em&=0x3ffffff,n=Math.imul(m,K),i=(i=Math.imul(m,F))+Math.imul(b,K)|0,o=Math.imul(b,F),n=n+Math.imul(p,q)|0,i=(i=i+Math.imul(p,V)|0)+Math.imul(y,q)|0,o=o+Math.imul(y,V)|0;var eb=(u+(n=n+Math.imul(d,G)|0)|0)+((8191&(i=(i=i+Math.imul(d,W)|0)+Math.imul(f,G)|0))<<13)|0;u=((o=o+Math.imul(f,W)|0)+(i>>>13)|0)+(eb>>>26)|0,eb&=0x3ffffff,n=Math.imul(w,K),i=(i=Math.imul(w,F))+Math.imul(_,K)|0,o=Math.imul(_,F),n=n+Math.imul(m,q)|0,i=(i=i+Math.imul(m,V)|0)+Math.imul(b,q)|0,o=o+Math.imul(b,V)|0,n=n+Math.imul(p,G)|0,i=(i=i+Math.imul(p,W)|0)+Math.imul(y,G)|0,o=o+Math.imul(y,W)|0;var ev=(u+(n=n+Math.imul(d,Z)|0)|0)+((8191&(i=(i=i+Math.imul(d,Y)|0)+Math.imul(f,Z)|0))<<13)|0;u=((o=o+Math.imul(f,Y)|0)+(i>>>13)|0)+(ev>>>26)|0,ev&=0x3ffffff,n=Math.imul(S,K),i=(i=Math.imul(S,F))+Math.imul(x,K)|0,o=Math.imul(x,F),n=n+Math.imul(w,q)|0,i=(i=i+Math.imul(w,V)|0)+Math.imul(_,q)|0,o=o+Math.imul(_,V)|0,n=n+Math.imul(m,G)|0,i=(i=i+Math.imul(m,W)|0)+Math.imul(b,G)|0,o=o+Math.imul(b,W)|0,n=n+Math.imul(p,Z)|0,i=(i=i+Math.imul(p,Y)|0)+Math.imul(y,Z)|0,o=o+Math.imul(y,Y)|0;var ew=(u+(n=n+Math.imul(d,Q)|0)|0)+((8191&(i=(i=i+Math.imul(d,ee)|0)+Math.imul(f,Q)|0))<<13)|0;u=((o=o+Math.imul(f,ee)|0)+(i>>>13)|0)+(ew>>>26)|0,ew&=0x3ffffff,n=Math.imul(I,K),i=(i=Math.imul(I,F))+Math.imul(O,K)|0,o=Math.imul(O,F),n=n+Math.imul(S,q)|0,i=(i=i+Math.imul(S,V)|0)+Math.imul(x,q)|0,o=o+Math.imul(x,V)|0,n=n+Math.imul(w,G)|0,i=(i=i+Math.imul(w,W)|0)+Math.imul(_,G)|0,o=o+Math.imul(_,W)|0,n=n+Math.imul(m,Z)|0,i=(i=i+Math.imul(m,Y)|0)+Math.imul(b,Z)|0,o=o+Math.imul(b,Y)|0,n=n+Math.imul(p,Q)|0,i=(i=i+Math.imul(p,ee)|0)+Math.imul(y,Q)|0,o=o+Math.imul(y,ee)|0;var e_=(u+(n=n+Math.imul(d,er)|0)|0)+((8191&(i=(i=i+Math.imul(d,en)|0)+Math.imul(f,er)|0))<<13)|0;u=((o=o+Math.imul(f,en)|0)+(i>>>13)|0)+(e_>>>26)|0,e_&=0x3ffffff,n=Math.imul(P,K),i=(i=Math.imul(P,F))+Math.imul(M,K)|0,o=Math.imul(M,F),n=n+Math.imul(I,q)|0,i=(i=i+Math.imul(I,V)|0)+Math.imul(O,q)|0,o=o+Math.imul(O,V)|0,n=n+Math.imul(S,G)|0,i=(i=i+Math.imul(S,W)|0)+Math.imul(x,G)|0,o=o+Math.imul(x,W)|0,n=n+Math.imul(w,Z)|0,i=(i=i+Math.imul(w,Y)|0)+Math.imul(_,Z)|0,o=o+Math.imul(_,Y)|0,n=n+Math.imul(m,Q)|0,i=(i=i+Math.imul(m,ee)|0)+Math.imul(b,Q)|0,o=o+Math.imul(b,ee)|0,n=n+Math.imul(p,er)|0,i=(i=i+Math.imul(p,en)|0)+Math.imul(y,er)|0,o=o+Math.imul(y,en)|0;var eE=(u+(n=n+Math.imul(d,eo)|0)|0)+((8191&(i=(i=i+Math.imul(d,es)|0)+Math.imul(f,eo)|0))<<13)|0;u=((o=o+Math.imul(f,es)|0)+(i>>>13)|0)+(eE>>>26)|0,eE&=0x3ffffff,n=Math.imul(k,K),i=(i=Math.imul(k,F))+Math.imul(C,K)|0,o=Math.imul(C,F),n=n+Math.imul(P,q)|0,i=(i=i+Math.imul(P,V)|0)+Math.imul(M,q)|0,o=o+Math.imul(M,V)|0,n=n+Math.imul(I,G)|0,i=(i=i+Math.imul(I,W)|0)+Math.imul(O,G)|0,o=o+Math.imul(O,W)|0,n=n+Math.imul(S,Z)|0,i=(i=i+Math.imul(S,Y)|0)+Math.imul(x,Z)|0,o=o+Math.imul(x,Y)|0,n=n+Math.imul(w,Q)|0,i=(i=i+Math.imul(w,ee)|0)+Math.imul(_,Q)|0,o=o+Math.imul(_,ee)|0,n=n+Math.imul(m,er)|0,i=(i=i+Math.imul(m,en)|0)+Math.imul(b,er)|0,o=o+Math.imul(b,en)|0,n=n+Math.imul(p,eo)|0,i=(i=i+Math.imul(p,es)|0)+Math.imul(y,eo)|0,o=o+Math.imul(y,es)|0;var eS=(u+(n=n+Math.imul(d,ec)|0)|0)+((8191&(i=(i=i+Math.imul(d,eu)|0)+Math.imul(f,ec)|0))<<13)|0;u=((o=o+Math.imul(f,eu)|0)+(i>>>13)|0)+(eS>>>26)|0,eS&=0x3ffffff,n=Math.imul(j,K),i=(i=Math.imul(j,F))+Math.imul(R,K)|0,o=Math.imul(R,F),n=n+Math.imul(k,q)|0,i=(i=i+Math.imul(k,V)|0)+Math.imul(C,q)|0,o=o+Math.imul(C,V)|0,n=n+Math.imul(P,G)|0,i=(i=i+Math.imul(P,W)|0)+Math.imul(M,G)|0,o=o+Math.imul(M,W)|0,n=n+Math.imul(I,Z)|0,i=(i=i+Math.imul(I,Y)|0)+Math.imul(O,Z)|0,o=o+Math.imul(O,Y)|0,n=n+Math.imul(S,Q)|0,i=(i=i+Math.imul(S,ee)|0)+Math.imul(x,Q)|0,o=o+Math.imul(x,ee)|0,n=n+Math.imul(w,er)|0,i=(i=i+Math.imul(w,en)|0)+Math.imul(_,er)|0,o=o+Math.imul(_,en)|0,n=n+Math.imul(m,eo)|0,i=(i=i+Math.imul(m,es)|0)+Math.imul(b,eo)|0,o=o+Math.imul(b,es)|0,n=n+Math.imul(p,ec)|0,i=(i=i+Math.imul(p,eu)|0)+Math.imul(y,ec)|0,o=o+Math.imul(y,eu)|0;var ex=(u+(n=n+Math.imul(d,ed)|0)|0)+((8191&(i=(i=i+Math.imul(d,ef)|0)+Math.imul(f,ed)|0))<<13)|0;u=((o=o+Math.imul(f,ef)|0)+(i>>>13)|0)+(ex>>>26)|0,ex&=0x3ffffff,n=Math.imul(B,K),i=(i=Math.imul(B,F))+Math.imul(U,K)|0,o=Math.imul(U,F),n=n+Math.imul(j,q)|0,i=(i=i+Math.imul(j,V)|0)+Math.imul(R,q)|0,o=o+Math.imul(R,V)|0,n=n+Math.imul(k,G)|0,i=(i=i+Math.imul(k,W)|0)+Math.imul(C,G)|0,o=o+Math.imul(C,W)|0,n=n+Math.imul(P,Z)|0,i=(i=i+Math.imul(P,Y)|0)+Math.imul(M,Z)|0,o=o+Math.imul(M,Y)|0,n=n+Math.imul(I,Q)|0,i=(i=i+Math.imul(I,ee)|0)+Math.imul(O,Q)|0,o=o+Math.imul(O,ee)|0,n=n+Math.imul(S,er)|0,i=(i=i+Math.imul(S,en)|0)+Math.imul(x,er)|0,o=o+Math.imul(x,en)|0,n=n+Math.imul(w,eo)|0,i=(i=i+Math.imul(w,es)|0)+Math.imul(_,eo)|0,o=o+Math.imul(_,es)|0,n=n+Math.imul(m,ec)|0,i=(i=i+Math.imul(m,eu)|0)+Math.imul(b,ec)|0,o=o+Math.imul(b,eu)|0,n=n+Math.imul(p,ed)|0,i=(i=i+Math.imul(p,ef)|0)+Math.imul(y,ed)|0,o=o+Math.imul(y,ef)|0;var eA=(u+(n=n+Math.imul(d,ep)|0)|0)+((8191&(i=(i=i+Math.imul(d,ey)|0)+Math.imul(f,ep)|0))<<13)|0;u=((o=o+Math.imul(f,ey)|0)+(i>>>13)|0)+(eA>>>26)|0,eA&=0x3ffffff,n=Math.imul(B,q),i=(i=Math.imul(B,V))+Math.imul(U,q)|0,o=Math.imul(U,V),n=n+Math.imul(j,G)|0,i=(i=i+Math.imul(j,W)|0)+Math.imul(R,G)|0,o=o+Math.imul(R,W)|0,n=n+Math.imul(k,Z)|0,i=(i=i+Math.imul(k,Y)|0)+Math.imul(C,Z)|0,o=o+Math.imul(C,Y)|0,n=n+Math.imul(P,Q)|0,i=(i=i+Math.imul(P,ee)|0)+Math.imul(M,Q)|0,o=o+Math.imul(M,ee)|0,n=n+Math.imul(I,er)|0,i=(i=i+Math.imul(I,en)|0)+Math.imul(O,er)|0,o=o+Math.imul(O,en)|0,n=n+Math.imul(S,eo)|0,i=(i=i+Math.imul(S,es)|0)+Math.imul(x,eo)|0,o=o+Math.imul(x,es)|0,n=n+Math.imul(w,ec)|0,i=(i=i+Math.imul(w,eu)|0)+Math.imul(_,ec)|0,o=o+Math.imul(_,eu)|0,n=n+Math.imul(m,ed)|0,i=(i=i+Math.imul(m,ef)|0)+Math.imul(b,ed)|0,o=o+Math.imul(b,ef)|0;var eI=(u+(n=n+Math.imul(p,ep)|0)|0)+((8191&(i=(i=i+Math.imul(p,ey)|0)+Math.imul(y,ep)|0))<<13)|0;u=((o=o+Math.imul(y,ey)|0)+(i>>>13)|0)+(eI>>>26)|0,eI&=0x3ffffff,n=Math.imul(B,G),i=(i=Math.imul(B,W))+Math.imul(U,G)|0,o=Math.imul(U,W),n=n+Math.imul(j,Z)|0,i=(i=i+Math.imul(j,Y)|0)+Math.imul(R,Z)|0,o=o+Math.imul(R,Y)|0,n=n+Math.imul(k,Q)|0,i=(i=i+Math.imul(k,ee)|0)+Math.imul(C,Q)|0,o=o+Math.imul(C,ee)|0,n=n+Math.imul(P,er)|0,i=(i=i+Math.imul(P,en)|0)+Math.imul(M,er)|0,o=o+Math.imul(M,en)|0,n=n+Math.imul(I,eo)|0,i=(i=i+Math.imul(I,es)|0)+Math.imul(O,eo)|0,o=o+Math.imul(O,es)|0,n=n+Math.imul(S,ec)|0,i=(i=i+Math.imul(S,eu)|0)+Math.imul(x,ec)|0,o=o+Math.imul(x,eu)|0,n=n+Math.imul(w,ed)|0,i=(i=i+Math.imul(w,ef)|0)+Math.imul(_,ed)|0,o=o+Math.imul(_,ef)|0;var eO=(u+(n=n+Math.imul(m,ep)|0)|0)+((8191&(i=(i=i+Math.imul(m,ey)|0)+Math.imul(b,ep)|0))<<13)|0;u=((o=o+Math.imul(b,ey)|0)+(i>>>13)|0)+(eO>>>26)|0,eO&=0x3ffffff,n=Math.imul(B,Z),i=(i=Math.imul(B,Y))+Math.imul(U,Z)|0,o=Math.imul(U,Y),n=n+Math.imul(j,Q)|0,i=(i=i+Math.imul(j,ee)|0)+Math.imul(R,Q)|0,o=o+Math.imul(R,ee)|0,n=n+Math.imul(k,er)|0,i=(i=i+Math.imul(k,en)|0)+Math.imul(C,er)|0,o=o+Math.imul(C,en)|0,n=n+Math.imul(P,eo)|0,i=(i=i+Math.imul(P,es)|0)+Math.imul(M,eo)|0,o=o+Math.imul(M,es)|0,n=n+Math.imul(I,ec)|0,i=(i=i+Math.imul(I,eu)|0)+Math.imul(O,ec)|0,o=o+Math.imul(O,eu)|0,n=n+Math.imul(S,ed)|0,i=(i=i+Math.imul(S,ef)|0)+Math.imul(x,ed)|0,o=o+Math.imul(x,ef)|0;var eT=(u+(n=n+Math.imul(w,ep)|0)|0)+((8191&(i=(i=i+Math.imul(w,ey)|0)+Math.imul(_,ep)|0))<<13)|0;u=((o=o+Math.imul(_,ey)|0)+(i>>>13)|0)+(eT>>>26)|0,eT&=0x3ffffff,n=Math.imul(B,Q),i=(i=Math.imul(B,ee))+Math.imul(U,Q)|0,o=Math.imul(U,ee),n=n+Math.imul(j,er)|0,i=(i=i+Math.imul(j,en)|0)+Math.imul(R,er)|0,o=o+Math.imul(R,en)|0,n=n+Math.imul(k,eo)|0,i=(i=i+Math.imul(k,es)|0)+Math.imul(C,eo)|0,o=o+Math.imul(C,es)|0,n=n+Math.imul(P,ec)|0,i=(i=i+Math.imul(P,eu)|0)+Math.imul(M,ec)|0,o=o+Math.imul(M,eu)|0,n=n+Math.imul(I,ed)|0,i=(i=i+Math.imul(I,ef)|0)+Math.imul(O,ed)|0,o=o+Math.imul(O,ef)|0;var eP=(u+(n=n+Math.imul(S,ep)|0)|0)+((8191&(i=(i=i+Math.imul(S,ey)|0)+Math.imul(x,ep)|0))<<13)|0;u=((o=o+Math.imul(x,ey)|0)+(i>>>13)|0)+(eP>>>26)|0,eP&=0x3ffffff,n=Math.imul(B,er),i=(i=Math.imul(B,en))+Math.imul(U,er)|0,o=Math.imul(U,en),n=n+Math.imul(j,eo)|0,i=(i=i+Math.imul(j,es)|0)+Math.imul(R,eo)|0,o=o+Math.imul(R,es)|0,n=n+Math.imul(k,ec)|0,i=(i=i+Math.imul(k,eu)|0)+Math.imul(C,ec)|0,o=o+Math.imul(C,eu)|0,n=n+Math.imul(P,ed)|0,i=(i=i+Math.imul(P,ef)|0)+Math.imul(M,ed)|0,o=o+Math.imul(M,ef)|0;var eM=(u+(n=n+Math.imul(I,ep)|0)|0)+((8191&(i=(i=i+Math.imul(I,ey)|0)+Math.imul(O,ep)|0))<<13)|0;u=((o=o+Math.imul(O,ey)|0)+(i>>>13)|0)+(eM>>>26)|0,eM&=0x3ffffff,n=Math.imul(B,eo),i=(i=Math.imul(B,es))+Math.imul(U,eo)|0,o=Math.imul(U,es),n=n+Math.imul(j,ec)|0,i=(i=i+Math.imul(j,eu)|0)+Math.imul(R,ec)|0,o=o+Math.imul(R,eu)|0,n=n+Math.imul(k,ed)|0,i=(i=i+Math.imul(k,ef)|0)+Math.imul(C,ed)|0,o=o+Math.imul(C,ef)|0;var eN=(u+(n=n+Math.imul(P,ep)|0)|0)+((8191&(i=(i=i+Math.imul(P,ey)|0)+Math.imul(M,ep)|0))<<13)|0;u=((o=o+Math.imul(M,ey)|0)+(i>>>13)|0)+(eN>>>26)|0,eN&=0x3ffffff,n=Math.imul(B,ec),i=(i=Math.imul(B,eu))+Math.imul(U,ec)|0,o=Math.imul(U,eu),n=n+Math.imul(j,ed)|0,i=(i=i+Math.imul(j,ef)|0)+Math.imul(R,ed)|0,o=o+Math.imul(R,ef)|0;var ek=(u+(n=n+Math.imul(k,ep)|0)|0)+((8191&(i=(i=i+Math.imul(k,ey)|0)+Math.imul(C,ep)|0))<<13)|0;u=((o=o+Math.imul(C,ey)|0)+(i>>>13)|0)+(ek>>>26)|0,ek&=0x3ffffff,n=Math.imul(B,ed),i=(i=Math.imul(B,ef))+Math.imul(U,ed)|0,o=Math.imul(U,ef);var eC=(u+(n=n+Math.imul(j,ep)|0)|0)+((8191&(i=(i=i+Math.imul(j,ey)|0)+Math.imul(R,ep)|0))<<13)|0;u=((o=o+Math.imul(R,ey)|0)+(i>>>13)|0)+(eC>>>26)|0,eC&=0x3ffffff;var eD=(u+(n=Math.imul(B,ep))|0)+((8191&(i=(i=Math.imul(B,ey))+Math.imul(U,ep)|0))<<13)|0;return u=((o=Math.imul(U,ey))+(i>>>13)|0)+(eD>>>26)|0,eD&=0x3ffffff,c[0]=eg,c[1]=em,c[2]=eb,c[3]=ev,c[4]=ew,c[5]=e_,c[6]=eE,c[7]=eS,c[8]=ex,c[9]=eA,c[10]=eI,c[11]=eO,c[12]=eT,c[13]=eP,c[14]=eM,c[15]=eN,c[16]=ek,c[17]=eC,c[18]=eD,0!==u&&(c[19]=u,r.length++),r};function v(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=0x3ffffff&n,c=Math.min(o,t.length-1),u=Math.max(0,o-e.length+1);u<=c;u++){var l=o-u,d=(0|e.words[l])*(0|t.words[u]),f=0x3ffffff&d;s=s+(d/0x4000000|0)|0,a=0x3ffffff&(f=f+a|0),i+=(s=s+(f>>>26)|0)>>>26,s&=0x3ffffff}r.words[o]=a,n=s,s=i}return 0!==n?r.words[o]=n:r.length--,r._strip()}function w(e,t,r){return v(e,t,r)}function _(e,t){this.x=e,this.y=t}Math.imul||(b=m),o.prototype.mulTo=function(e,t){var r=this.length+e.length;return 10===this.length&&10===e.length?b(this,e,t):r<63?m(this,e,t):r<1024?v(this,e,t):w(this,e,t)},_.prototype.makeRBT=function(e){for(var t=Array(e),r=o.prototype._countBits(e)-1,n=0;n<e;n++)t[n]=this.revBin(n,r,e);return t},_.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},_.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]]},_.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 d=c,f=u,h=0;h<s;h++){var p=r[l+h],y=n[l+h],g=r[l+h+s],m=n[l+h+s],b=d*g-f*m;m=d*m+f*g,g=b,r[l+h]=p+g,n[l+h]=y+m,r[l+h+s]=p-g,n[l+h+s]=y-m,h!==a&&(b=c*d-u*f,f=c*f+u*d,d=b)}},_.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},_.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}},_.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]=0x3ffffff&i,r=i<0x4000000?0:i/0x4000000|0}return e},_.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((-8192&o)==0)},_.prototype.stub=function(e){for(var t=Array(e),r=0;r<e;r++)t[r]=0;return t},_.prototype.mulp=function(e,t,r){var n=2*this.guessLen13b(e.length,t.length),i=this.makeRBT(n),o=this.stub(n),s=Array(n),a=Array(n),c=Array(n),u=Array(n),l=Array(n),d=Array(n),f=r.words;f.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,d,n,i);for(var h=0;h<n;h++){var p=a[h]*l[h]-c[h]*d[h];c[h]=a[h]*d[h]+c[h]*l[h],a[h]=p}return this.conjugate(a,c,n),this.transform(a,c,f,o,n,i),this.conjugate(f,o,n),this.normalize13b(f,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=Array(this.length+e.length),this.mulTo(e,t)},o.prototype.mulf=function(e){var t=new o(null);return t.words=Array(this.length+e.length),w(this,e,t)},o.prototype.imul=function(e){return this.clone().mulTo(e,this)},o.prototype.imuln=function(e){var t=e<0;t&&(e=-e),n("number"==typeof e),n(e<0x4000000);for(var r=0,i=0;i<this.length;i++){var o=(0|this.words[i])*e,s=(0x3ffffff&o)+(0x3ffffff&r);r>>=26,r+=(o/0x4000000|0)+(s>>>26),this.words[i]=0x3ffffff&s}return 0!==r&&(this.words[i]=r,this.length++),t?this.ineg():this},o.prototype.muln=function(e){return this.clone().imuln(e)},o.prototype.sqr=function(){return this.mul(this)},o.prototype.isqr=function(){return this.imul(this.clone())},o.prototype.pow=function(e){var t=g(e);
vendor: 13,848 bytes, line 30
30if(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=0x3ffffff>>>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){n("number"==typeof e&&e>=0),i=t?(t-t%26)/26:0;var i,o=e%26,s=Math.min((e-o)/26,this.length),a=0x3ffffff^0x3ffffff>>>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 d=0|this.words[u];this.words[u]=l<<26-o|d>>>o,l=d&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=0x3ffffff^0x3ffffff>>>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<0x4000000),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.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]>=0x4000000;t++)this.words[t]-=0x4000000,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<0x4000000),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]+=0x4000000,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;o-=0x3ffffff&c,a=(o>>26)-(c/0x4000000|0),this.words[i+r]=0x3ffffff&o}for(;i<this.length-r;i++)a=(o=(0|this.words[i+r])+a)>>26,this.words[i+r]=0x3ffffff&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]=0x3ffffff&o;return this.negative=1,this._strip()},o.prototype._wordDiv=function(e,t){var r,n=this.length-e.length,i=this.clone(),s=e,a=0|s.words[s.length-1];0!=(n=26-this._countBits(a))&&(s=s.ushln(n),i.iushln(n),a=0|s.words[s.length-1]);var c=i.length-s.length;if("mod"!==t){(r=new o(null)).length=c+1,r.words=Array(r.length);for(var u=0;u<r.length;u++)r.words[u]=0}var l=i.clone()._ishlnsubmul(s,1,c);0===l.negative&&(i=l,r&&(r.words[c]=1));for(var d=c-1;d>=0;d--){var f=(0|i.words[s.length+d])*0x4000000+(0|i.words[s.length+d-1]);for(f=Math.min(f/a|0,0x3ffffff),i._ishlnsubmul(s,f,d);0!==i.negative;)f--,i.negative=0,i._ishlnsubmul(s,1,d),i.isZero()||(i.negative^=1);r&&(r.words[d]=f)}return r&&r._strip(),i._strip(),"div"!==t&&0!==n&&i.iushrn(n),{div:r||null,mod:i}},o.prototype.divmod=function(e,t,r){var i,s,a;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}):(this.negative&e.negative)!=0?(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||0>this.cmp(e)?{div:new o(0),mod:this}:1===e.length?"div"===t?{div:this.divn(e.words[0]),mod:null}:"mod"===t?{div:null,mod:new o(this.modrn(e.words[0]))}:{div:this.divn(e.words[0]),mod:new o(this.modrn(e.words[0]))}:this._wordDiv(e,t)},o.prototype.div=function(e){return this.divmod(e,"div",!1).div},o.prototype.mod=function(e){return this.divmod(e,"mod",!1).mod},o.prototype.umod=function(e){return this.divmod(e,"mod",!0).mod},o.prototype.divRound=function(e){var t=this.divmod(e);if(t.mod.isZero())return t.div;var r=0!==t.div.negative?t.mod.isub(e):t.mod,n=e.ushrn(1),i=e.andln(1),o=r.cmp(n);return o<0||1===i&&0===o?t.div:0!==t.div.negative?t.div.isubn(1):t.div.iaddn(1)},o.prototype.modrn=function(e){var t=e<0;t&&(e=-e),n(e<=0x3ffffff);for(var r=0x4000000%e,i=0,o=this.length-1;o>=0;o--)i=(r*i+(0|this.words[o]))%e;return t?-i:i},o.prototype.modn=function(e){return this.modrn(e)},o.prototype.idivn=function(e){var t=e<0;t&&(e=-e),n(e<=0x3ffffff);for(var r=0,i=this.length-1;i>=0;i--){var o=(0|this.words[i])+0x4000000*r;this.words[i]=o/e|0,r=o%e}return this._strip(),t?this.ineg():this},o.prototype.divn=function(e){return this.clone().idivn(e)},o.prototype.egcd=function(e){n(0===e.negative),n(!e.isZero());var t=this,r=e.clone();t=0!==t.negative?t.umod(e):t.clone();for(var i=new o(1),s=new o(0),a=new o(0),c=new o(1),u=0;t.isEven()&&r.isEven();)t.iushrn(1),r.iushrn(1),++u;for(var l=r.clone(),d=t.clone();!t.isZero();){for(var f=0,h=1;(t.words[0]&h)==0&&f<26;++f,h<<=1);if(f>0)for(t.iushrn(f);f-- >0;)(i.isOdd()||s.isOdd())&&(i.iadd(l),s.isub(d)),i.iushrn(1),s.iushrn(1);for(var p=0,y=1;(r.words[0]&y)==0&&p<26;++p,y<<=1);if(p>0)for(r.iushrn(p);p-- >0;)(a.isOdd()||c.isOdd())&&(a.iadd(l),c.isub(d)),a.iushrn(1),c.iushrn(1);t.cmp(r)>=0?(t.isub(r),i.isub(a),s.isub(c)):(r.isub(t),a.isub(i),c.isub(s))}return{a:a,b:c,gcd:r.iushln(u)}},o.prototype._invmp=function(e){n(0===e.negative),n(!e.isZero());var t,r=this,i=e.clone();r=0!==r.negative?r.umod(e):r.clone();for(var s=new o(1),a=new o(0),c=i.clone();r.cmpn(1)>0&&i.cmpn(1)>0;){for(var u=0,l=1;(r.words[0]&l)==0&&u<26;++u,l<<=1);if(u>0)for(r.iushrn(u);u-- >0;)s.isOdd()&&s.iadd(c),s.iushrn(1);for(var d=0,f=1;(i.words[0]&f)==0&&d<26;++d,f<<=1);if(d>0)for(i.iushrn(d);d-- >0;)a.isOdd()&&a.iadd(c),a.iushrn(1);r.cmp(i)>=0?(r.isub(i),s.isub(a)):(i.isub(r),a.isub(s))}return 0>(t=0===r.cmpn(1)?s:a).cmpn(0)&&t.iadd(e),t},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(1&this.words[0])==0},o.prototype.isOdd=function(){return(1&this.words[0])==1},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];a+=o,o=a>>>26,a&=0x3ffffff,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<=0x3ffffff,"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 0>=this.cmpn(e)},o.prototype.lte=function(e){return 0>=this.cmp(e)},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 T(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 E={k256:null,p224:null,p192:null,p25519:null};function S(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 x(){S.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function A(){S.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function I(){S.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function O(){S.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function T(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 P(e){T.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)}S.prototype._tmp=function(){var e=new o(null);return e.words=Array(Math.ceil(this.n/13)),e},S.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},S.prototype.split=function(e,t){e.iushrn(this.n,0,t)},S.prototype.imulK=function(e){return e.imul(this.k)},i(x,S),x.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){e.words[0]=0,e.length=1;return}var o=e.words[9];for(i=10,t.words[t.length++]=o&r;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},x.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]=0x3ffffff&t,t=64*n+(t/0x4000000|0)}return 0===e.words[e.length-1]&&(e.length--,0===e.words[e.length-1]&&e.length--),e},i(A,S),i(I,S),i(O,S),O.prototype.imulK=function(e){for(var t=0,r=0;r<e.length;
30r++){var n=(0|e.words[r])*19+t,i=0x3ffffff&n;n>>>=26,e.words[r]=i,t=n}return 0!==t&&(e.words[e.length++]=t),e},o._prime=function(e){var t;if(E[e])return E[e];if("k256"===e)t=new x;else if("p224"===e)t=new A;else if("p192"===e)t=new I;else if("p25519"===e)t=new O;else throw Error("Unknown prime "+e);return E[e]=t,t},T.prototype._verify1=function(e){n(0===e.negative,"red works only with positives"),n(e.red,"red works only with red numbers")},T.prototype._verify2=function(e,t){n((e.negative|t.negative)==0,"red works only with positives"),n(e.red&&e.red===t.red,"red works only with red numbers")},T.prototype.imod=function(e){return this.prime?this.prime.ireduce(e)._forceRed(this):(u(e,e.umod(this.m)._forceRed(this)),e)},T.prototype.neg=function(e){return e.isZero()?e.clone():this.m.sub(e)._forceRed(this)},T.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)},T.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},T.prototype.sub=function(e,t){this._verify2(e,t);var r=e.sub(t);return 0>r.cmpn(0)&&r.iadd(this.m),r._forceRed(this)},T.prototype.isub=function(e,t){this._verify2(e,t);var r=e.isub(t);return 0>r.cmpn(0)&&r.iadd(this.m),r},T.prototype.shl=function(e,t){return this._verify1(e),this.imod(e.ushln(t))},T.prototype.imul=function(e,t){return this._verify2(e,t),this.imod(e.imul(t))},T.prototype.mul=function(e,t){return this._verify2(e,t),this.imod(e.mul(t))},T.prototype.isqr=function(e){return this.imul(e,e.clone())},T.prototype.sqr=function(e){return this.mul(e,e)},T.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 d=this.pow(l,i),f=this.pow(e,i.addn(1).iushrn(1)),h=this.pow(e,i),p=s;0!==h.cmp(a);){for(var y=h,g=0;0!==y.cmp(a);g++)y=y.redSqr();n(g<p);var m=this.pow(d,new o(1).iushln(p-g-1));f=f.redMul(m),d=m.redSqr(),h=h.redMul(d),p=g}return f},T.prototype.invm=function(e){var t=e._invmp(this.m);return 0!==t.negative?(t.negative=0,this.imod(t).redNeg()):this.imod(t)},T.prototype.pow=function(e,t){if(t.isZero())return new o(1).toRed(this);if(0===t.cmpn(1))return e.clone();var r=4,n=Array(16);n[0]=new o(1).toRed(this),n[1]=e;for(var i=2;i<n.length;i++)n[i]=this.mul(n[i-1],e);var s=n[0],a=0,c=0,u=t.bitLength()%26;for(0===u&&(u=26),i=t.length-1;i>=0;i--){for(var l=t.words[i],d=u-1;d>=0;d--){var f=l>>d&1;if(s!==n[0]&&(s=this.sqr(s)),0===f&&0===a){c=0;continue}a<<=1,a|=f,(++c===r||0===i&&0===d)&&(s=this.mul(s,n[a]),c=0,a=0)}u=26}return s},T.prototype.convertTo=function(e){var t=e.umod(this.m);return t===e?t.clone():t},T.prototype.convertFrom=function(e){var t=e.clone();return t.red=null,t},o.mont=function(e){return new P(e)},i(P,T),P.prototype.convertTo=function(e){return this.imod(e.ushln(this.shift))},P.prototype.convertFrom=function(e){var t=this.imod(e.mul(this.rinv));return t.red=null,t},P.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):0>i.cmpn(0)&&(o=i.iadd(this.m)),o._forceRed(this)},P.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):0>i.cmpn(0)&&(s=i.iadd(this.m)),s._forceRed(this)},P.prototype.invm=function(e){return this.imod(e._invmp(this.m).mul(this.r2))._forceRed(this)}}(e=r.nmd(e),this)},56502:(e,t)=>{"use strict";t.__esModule=!0,t.DecodeBuffer=t.EncodeBuffer=void 0;var r=function(){function e(){this.offset=0,this.buffer_size=256,this.buffer=new ArrayBuffer(this.buffer_size),this.view=new DataView(this.buffer)}return e.prototype.resize_if_necessary=function(e){if(this.buffer_size-this.offset<e){this.buffer_size=Math.max(2*this.buffer_size,this.buffer_size+e);var t=new ArrayBuffer(this.buffer_size);new Uint8Array(t).set(new Uint8Array(this.buffer)),this.buffer=t,this.view=new DataView(t)}},e.prototype.get_used_buffer=function(){return new Uint8Array(this.buffer).slice(0,this.offset)},e.prototype.store_value=function(e,t){var r=t.substring(1),n=parseInt(r)/8;this.resize_if_necessary(n);var i="f"===t[0]?"setFloat".concat(r):"i"===t[0]?"setInt".concat(r):"setUint".concat(r);this.view[i](this.offset,e,!0),this.offset+=n},e.prototype.store_bytes=function(e){this.resize_if_necessary(e.length),new Uint8Array(this.buffer).set(new Uint8Array(e),this.offset),this.offset+=e.length},e}();t.EncodeBuffer=r;var n=function(){function e(e){this.offset=0,this.buffer_size=e.length,this.buffer=new ArrayBuffer(e.length),new Uint8Array(this.buffer).set(e),this.view=new DataView(this.buffer)}return e.prototype.assert_enough_buffer=function(e){if(this.offset+e>this.buffer.byteLength)throw Error("Error in schema, the buffer is smaller than expected")},e.prototype.consume_value=function(e){var t=e.substring(1),r=parseInt(t)/8;this.assert_enough_buffer(r);var n="f"===e[0]?"getFloat".concat(t):"i"===e[0]?"getInt".concat(t):"getUint".concat(t),i=this.view[n](this.offset,!0);return this.offset+=r,i},e.prototype.consume_bytes=function(e){this.assert_enough_buffer(e);var t=this.buffer.slice(this.offset,this.offset+e);return this.offset+=e,t},e}();t.DecodeBuffer=n},70959:(e,t,r)=>{"use strict";
30t.__esModule=!0,t.BorshDeserializer=void 0;var n=r(85813),i=r(56502),o=function(){function e(e){this.buffer=new i.DecodeBuffer(e)}return e.prototype.decode=function(e){return this.decode_value(e)},e.prototype.decode_value=function(e){if("string"==typeof e){if(n.integers.includes(e))return this.decode_integer(e);if("string"===e)return this.decode_string();if("bool"===e)return this.decode_boolean()}if("object"==typeof e){if("option"in e)return this.decode_option(e);if("enum"in e)return this.decode_enum(e);if("array"in e)return this.decode_array(e);if("set"in e)return this.decode_set(e);if("map"in e)return this.decode_map(e);if("struct"in e)return this.decode_struct(e)}throw Error("Unsupported type: ".concat(e))},e.prototype.decode_integer=function(e){var t=parseInt(e.substring(1));return t<=32||"f64"==e?this.buffer.consume_value(e):this.decode_bigint(t,e.startsWith("i"))},e.prototype.decode_bigint=function(e,t){void 0===t&&(t=!1);var r=e/8,n=new Uint8Array(this.buffer.consume_bytes(r)),i=n.reduceRight(function(e,t){return e+t.toString(16).padStart(2,"0")},"");return t&&n[r-1]?BigInt.asIntN(e,BigInt("0x".concat(i))):BigInt("0x".concat(i))},e.prototype.decode_string=function(){for(var e=this.decode_integer("u32"),t=new Uint8Array(this.buffer.consume_bytes(e)),r=[],n=0;n<e;++n){var i=t[n];if(i<128)r.push(i);else if(i<224)r.push((31&i)<<6|63&t[++n]);else if(i<240)r.push((15&i)<<12|(63&t[++n])<<6|63&t[++n]);else{var o=(7&i)<<18|(63&t[++n])<<12|(63&t[++n])<<6|63&t[++n];r.push(o)}}return String.fromCodePoint.apply(String,r)},e.prototype.decode_boolean=function(){return this.buffer.consume_value("u8")>0},e.prototype.decode_option=function(e){var t=this.buffer.consume_value("u8");if(1===t)return this.decode_value(e.option);if(0!==t)throw Error("Invalid option ".concat(t));return null},e.prototype.decode_enum=function(e){var t,r=this.buffer.consume_value("u8");if(r>e.enum.length)throw Error("Enum option ".concat(r," is not available"));var n=e.enum[r].struct,i=Object.keys(n)[0];return(t={})[i]=this.decode_value(n[i]),t},e.prototype.decode_array=function(e){for(var t=[],r=e.array.len?e.array.len:this.decode_integer("u32"),n=0;n<r;++n)t.push(this.decode_value(e.array.type));return t},e.prototype.decode_set=function(e){for(var t=this.decode_integer("u32"),r=new Set,n=0;n<t;++n)r.add(this.decode_value(e.set));return r},e.prototype.decode_map=function(e){for(var t=this.decode_integer("u32"),r=new Map,n=0;n<t;++n){var i=this.decode_value(e.map.key),o=this.decode_value(e.map.value);r.set(i,o)}return r},e.prototype.decode_struct=function(e){var t={};for(var r in e.struct)t[r]=this.decode_value(e.struct[r]);return t},e}();t.BorshDeserializer=o},61796:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);(!i||("get"in i?!t.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),o=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)"default"!==r&&Object.prototype.hasOwnProperty.call(e,r)&&n(t,e,r);return i(t,e),t};t.__esModule=!0,t.deserialize=t.serialize=void 0;var s=r(56530),a=r(70959),c=o(r(31025));function u(e,t,r){return void 0===r&&(r=!0),r&&c.validate_schema(e),new s.BorshSerializer(r).encode(t,e)}function l(e,t,r){return void 0===r&&(r=!0),r&&c.validate_schema(e),new a.BorshDeserializer(t).decode(e)}t.serialize=u,t.deserialize=l},56530:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);(!i||("get"in i?!t.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}
30),o=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)"default"!==r&&Object.prototype.hasOwnProperty.call(e,r)&&n(t,e,r);return i(t,e),t};t.__esModule=!0,t.BorshSerializer=void 0;var s=r(85813),a=r(56502),c=o(r(31025)),u=function(){function e(e){this.encoded=new a.EncodeBuffer,this.fieldPath=["value"],this.checkTypes=e}return e.prototype.encode=function(e,t){return this.encode_value(e,t),this.encoded.get_used_buffer()},e.prototype.encode_value=function(e,t){if("string"==typeof t){if(s.integers.includes(t))return this.encode_integer(e,t);if("string"===t)return this.encode_string(e);if("bool"===t)return this.encode_boolean(e)}if("object"==typeof t){if("option"in t)return this.encode_option(e,t);if("enum"in t)return this.encode_enum(e,t);if("array"in t)return this.encode_array(e,t);if("set"in t)return this.encode_set(e,t);if("map"in t)return this.encode_map(e,t);if("struct"in t)return this.encode_struct(e,t)}},e.prototype.encode_integer=function(e,t){var r=parseInt(t.substring(1));r<=32||"f64"==t?(this.checkTypes&&c.expect_type(e,"number",this.fieldPath),this.encoded.store_value(e,t)):(this.checkTypes&&c.expect_bigint(e,this.fieldPath),this.encode_bigint(BigInt(e),r))},e.prototype.encode_bigint=function(e,t){for(var r=t/8,n=new Uint8Array(r),i=0;i<r;i++)n[i]=Number(e&BigInt(255)),e>>=BigInt(8);this.encoded.store_bytes(new Uint8Array(n))},e.prototype.encode_string=function(e){this.checkTypes&&c.expect_type(e,"string",this.fieldPath);for(var t=e,r=[],n=0;n<t.length;n++){var i=t.charCodeAt(n);i<128?r.push(i):i<2048?r.push(192|i>>6,128|63&i):i<55296||i>=57344?r.push(224|i>>12,128|i>>6&63,128|63&i):(n++,i=65536+((1023&i)<<10|1023&t.charCodeAt(n)),r.push(240|i>>18,128|i>>12&63,128|i>>6&63,128|63&i))}this.encoded.store_value(r.length,"u32"),this.encoded.store_bytes(new Uint8Array(r))},e.prototype.encode_boolean=function(e){this.checkTypes&&c.expect_type(e,"boolean",this.fieldPath),this.encoded.store_value(e?1:0,"u8")},e.prototype.encode_option=function(e,t){null==e?this.encoded.store_value(0,"u8"):(this.encoded.store_value(1,"u8"),this.encode_value(e,t.option))},e.prototype.encode_enum=function(e,t){this.checkTypes&&c.expect_enum(e,this.fieldPath);for(var r=Object.keys(e)[0],n=0;n<t.enum.length;n++){var i=t.enum[n];if(r===Object.keys(i.struct)[0])return this.encoded.store_value(n,"u8"),this.encode_struct(e,i)}throw Error("Enum key (".concat(r,") not found in enum schema: ").concat(JSON.stringify(t)," at ").concat(this.fieldPath.join(".")))},e.prototype.encode_array=function(e,t){if(c.isArrayLike(e))return this.encode_arraylike(e,t);if(e instanceof ArrayBuffer)return this.encode_buffer(e,t);throw Error("Expected Array-like not ".concat(typeof e,"(").concat(e,") at ").concat(this.fieldPath.join(".")))},e.prototype.encode_arraylike=function(e,t){t.array.len?c.expect_same_size(e.length,t.array.len,this.fieldPath):this.encoded.store_value(e.length,"u32");for(var r=0;r<e.length;r++)this.encode_value(e[r],t.array.type)},e.prototype.encode_buffer=function(e,t){t.array.len?c.expect_same_size(e.byteLength,t.array.len,this.fieldPath):this.encoded.store_value(e.byteLength,"u32"),this.encoded.store_bytes(new Uint8Array(e))},e.prototype.encode_set=function(e,t){this.checkTypes&&c.expect_type(e,"object",this.fieldPath);var r=e instanceof Set?Array.from(e.values()):Object.values(e);this.encoded.store_value(r.length,"u32");for(var n=0,i=r;n<i.length;n++){var o=i[n];this.encode_value(o,t.set)}},e.prototype.encode_map=function(e,t){this.checkTypes&&c.expect_type(e,"object",this.fieldPath);var r=e instanceof Map,n=r?Array.from(e.keys()):Object.keys(e);this.encoded.store_value(n.length,"u32");for(var i=0,o=n;i<o.length;i++){var s=o[i];this.encode_value(s,t.map.key),this.encode_value(r?e.get(s):e[s],t.map.value)}},e.prototype.encode_struct=function(e,t){this.checkTypes&&c.expect_type(e,"object",this.fieldPath);for(var r=0,n=Object.keys(t.struct);r<n.length;r++){var i=n[r];this.fieldPath.push(i),this.encode_value(e[i],t.struct[i]),this.fieldPath.pop()}},e}();t.BorshSerializer=u},85813:(e,t)=>{"use strict";t.__esModule=!0,t.integers=void 0,t.integers=["u8","u16","u32","u64","u128","i8","i16","i32","i64","i128","f32","f64"]},31025:function(e,t,r){"use strict";var n=this&&this.__extends||function(){var e=function(t,r){return(e=Object.setPrototypeOf||({__proto__:[]}
30)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])})(t,r)};return function(t,r){if("function"!=typeof r&&null!==r)throw TypeError("Class extends value "+String(r)+" is not a constructor or null");function n(){this.constructor=t}e(t,r),t.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}();t.__esModule=!0,t.validate_schema=t.ErrorSchema=t.expect_enum=t.expect_same_size=t.expect_bigint=t.expect_type=t.isArrayLike=void 0;var i=r(85813);function o(e){return Array.isArray(e)||!!e&&"object"==typeof e&&"length"in e&&"number"==typeof e.length&&(0===e.length||e.length>0&&e.length-1 in e)}function s(e,t,r){if(typeof e!==t)throw Error("Expected ".concat(t," not ").concat(typeof e,"(").concat(e,") at ").concat(r.join(".")))}function a(e,t){var r=["number","string","bigint","boolean"].includes(typeof e),n="object"==typeof e&&null!==e&&"toString"in e;if(!r&&!n)throw Error("Expected bigint, number, boolean or string not ".concat(typeof e,"(").concat(e,") at ").concat(t.join(".")))}function c(e,t,r){if(e!==t)throw Error("Array length ".concat(e," does not match schema length ").concat(t," at ").concat(r.join(".")))}function u(e,t){if("object"!=typeof e||null===e)throw Error("Expected object not ".concat(typeof e,"(").concat(e,") at ").concat(t.join(".")))}t.isArrayLike=o,t.expect_type=s,t.expect_bigint=a,t.expect_same_size=c,t.expect_enum=u;var l=i.integers.concat(["bool","string"]),d=["option","enum","array","set","map","struct"],f=function(e){function t(t,r){var n="Invalid schema: ".concat(JSON.stringify(t)," expected ").concat(r);return e.call(this,n)||this}return n(t,e),t}(Error);function h(e){if(!("string"==typeof e&&l.includes(e))){if(e&&"object"==typeof e){var t=Object.keys(e);if(1===t.length&&d.includes(t[0])){var r=t[0];if("option"===r)return h(e[r]);if("enum"===r)return p(e[r]);if("array"===r)return y(e[r]);if("set"===r)return h(e[r]);if("map"===r)return g(e[r]);if("struct"===r)return m(e[r])}}throw new f(e,d.join(", ")+" or "+l.join(", "))}}function p(e){if(!Array.isArray(e))throw new f(e,"Array");for(var t=0,r=e;t<r.length;t++){var n=r[t];if("object"!=typeof n||!("struct"in n))throw Error('Missing "struct" key in enum schema');if("object"!=typeof n.struct||1!==Object.keys(n.struct).length)throw Error('The "struct" in each enum must have a single key');h({struct:n.struct})}}function y(e){if("object"!=typeof e)throw new f(e,"{ type, len? }");if(e.len&&"number"!=typeof e.len)throw Error("Invalid schema: ".concat(e));if("type"in e)return h(e.type);throw new f(e,"{ type, len? }")}function g(e){if("object"==typeof e&&"key"in e&&"value"in e)h(e.key),h(e.value);else throw new f(e,"{ key, value }")}function m(e){if("object"!=typeof e)throw new f(e,"object");for(var t in e)h(e[t])}t.ErrorSchema=f,t.validate_schema=h},53607:(e,t,r)=>{var n;function i(e){this.rand=e}if(e.exports=function(e){return n||(n=new i(null)),n.generate(e)},e.exports.Rand=i,i.prototype.generate=function(e){return this._rand(e)},i.prototype._rand=function(e){if(this.rand.getBytes)return this.rand.getBytes(e);for(var t=new Uint8Array(e),r=0;r<t.length;r++)t[r]=this.rand.getByte();return t},"object"==typeof self)self.crypto&&self.crypto.getRandomValues?i.prototype._rand=function(e){var t=new Uint8Array(e);return self.crypto.getRandomValues(t),t}:self.msCrypto&&self.msCrypto.getRandomValues?i.prototype._rand=function(e){var t=new Uint8Array(e);return self.msCrypto.getRandomValues(t),t}:"object"==typeof window&&(i.prototype._rand=function(){throw Error("Not implemented yet")});else try{var o=r(73776);if("function"!=typeof o.randomBytes)throw Error("Not supported");i.prototype._rand=function(e){return o.randomBytes(e)}}catch(e){}},89631:(e,t,r)=>{var n=r(54201),i="123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz";e.exports=n(i)},75927:(e,t,r)=>{"use strict";let n=r(3836),i=r(84981),o="function"==typeof Symbol&&"function"==typeof Symbol.for?Symbol.for("nodejs.util.inspect.custom"):null;t.Buffer=u,t.SlowBuffer=w,t.INSPECT_MAX_BYTES=50;let s=0x7fffffff;function a(){try{let e=new Uint8Array(1),t={foo:function(){return 42}};return Object.setPrototypeOf(t,Uint8Array.prototype),Object.setPrototypeOf(e,t),42===e.foo()}catch(e){return!1}}function c(e){if(e>
vendor: 20,912 bytes, line 30
30s)throw RangeError('The value "'+e+'" is invalid for option "size"');let t=new Uint8Array(e);return Object.setPrototypeOf(t,u.prototype),t}function u(e,t,r){if("number"==typeof e){if("string"==typeof t)throw TypeError('The "string" argument must be of type string. Received type number');return h(e)}return l(e,t,r)}function l(e,t,r){if("string"==typeof e)return p(e,t);if(ArrayBuffer.isView(e))return g(e);if(null==e)throw TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e);if(es(e,ArrayBuffer)||e&&es(e.buffer,ArrayBuffer)||"undefined"!=typeof SharedArrayBuffer&&(es(e,SharedArrayBuffer)||e&&es(e.buffer,SharedArrayBuffer)))return m(e,t,r);if("number"==typeof e)throw TypeError('The "value" argument must not be of type number. Received type number');let n=e.valueOf&&e.valueOf();if(null!=n&&n!==e)return u.from(n,t,r);let i=b(e);if(i)return i;if("undefined"!=typeof Symbol&&null!=Symbol.toPrimitive&&"function"==typeof e[Symbol.toPrimitive])return u.from(e[Symbol.toPrimitive]("string"),t,r);throw TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e)}function d(e){if("number"!=typeof e)throw TypeError('"size" argument must be of type number');if(e<0)throw RangeError('The value "'+e+'" is invalid for option "size"')}function f(e,t,r){return(d(e),e<=0)?c(e):void 0!==t?"string"==typeof r?c(e).fill(t,r):c(e).fill(t):c(e)}function h(e){return d(e),c(e<0?0:0|v(e))}function p(e,t){if(("string"!=typeof t||""===t)&&(t="utf8"),!u.isEncoding(t))throw TypeError("Unknown encoding: "+t);let r=0|_(e,t),n=c(r),i=n.write(e,t);return i!==r&&(n=n.slice(0,i)),n}function y(e){let t=e.length<0?0:0|v(e.length),r=c(t);for(let n=0;n<t;n+=1)r[n]=255&e[n];return r}function g(e){if(es(e,Uint8Array)){let t=new Uint8Array(e);return m(t.buffer,t.byteOffset,t.byteLength)}return y(e)}function m(e,t,r){let n;if(t<0||e.byteLength<t)throw RangeError('"offset" is outside of buffer bounds');if(e.byteLength<t+(r||0))throw RangeError('"length" is outside of buffer bounds');return Object.setPrototypeOf(n=void 0===t&&void 0===r?new Uint8Array(e):void 0===r?new Uint8Array(e,t):new Uint8Array(e,t,r),u.prototype),n}function b(e){if(u.isBuffer(e)){let t=0|v(e.length),r=c(t);return 0===r.length||e.copy(r,0,0,t),r}return void 0!==e.length?"number"!=typeof e.length||ea(e.length)?c(0):y(e):"Buffer"===e.type&&Array.isArray(e.data)?y(e.data):void 0}function v(e){if(e>=s)throw RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+s.toString(16)+" bytes");return 0|e}function w(e){return+e!=e&&(e=0),u.alloc(+e)}function _(e,t){if(u.isBuffer(e))return e.length;if(ArrayBuffer.isView(e)||es(e,ArrayBuffer))return e.byteLength;if("string"!=typeof e)throw TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof e);let r=e.length,n=arguments.length>2&&!0===arguments[2];if(!n&&0===r)return 0;let i=!1;for(;;)switch(t){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":return et(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return ei(e).length;default:if(i)return n?-1:et(e).length;t=(""+t).toLowerCase(),i=!0}}function E(e,t,r){let n=!1;if((void 0===t||t<0)&&(t=0),t>this.length||((void 0===r||r>this.length)&&(r=this.length),r<=0||(r>>>=0)<=(t>>>=0)))return"";for(e||(e="utf8");;)switch(e){case"hex":return L(this,t,r);case"utf8":case"utf-8":return k(this,t,r);case"ascii":return j(this,t,r);case"latin1":case"binary":return R(this,t,r);case"base64":return N(this,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return B(this,t,r);default:if(n)throw TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),n=!0}}function S(e,t,r){let n=e[t];e[t]=e[r],e[r]=n}function x(e,t,r,n,i){if(0===e.length)return -1;if("string"==typeof r?(n=r,r=0):r>0x7fffffff?r=0x7fffffff:r<-0x80000000&&(r=-0x80000000),ea(r=+r)&&(r=i?0:e.length-1),r<0&&(r=e.length+r),r>=e.length){if(i)return -1;r=e.length-1}else if(r<0){if(!i)return -1;r=0}if("string"==typeof t&&(t=u.from(t,n)),u.isBuffer(t))return 0===t.length?-1:A(e,t,r,n,i);if("number"==typeof t)return(t&=255,"function"==typeof Uint8Array.prototype.indexOf)?i?Uint8Array.prototype.indexOf.call(e,t,r):Uint8Array.prototype.lastIndexOf.call(e,t,r):A(e,[t],r,n,i);throw TypeError("val must be string, number or Buffer")}function A(e,t,r,n,i){let o,s=1,a=e.length,c=t.length;if(void 0!==n&&("ucs2"===(n=String(n).toLowerCase())||"ucs-2"===n||"utf16le"===n||"utf-16le"===n)){if(e.length<2||t.length<2)return -1;s=2,a/=2,c/=2,r/=2}function u(e,t){return 1===s?e[t]:e.readUInt16BE(t*s)}if(i){let n=-1;for(o=r;o<a;o++)if(u(e,o)===u(t,-1===n?0:o-n)){if(-1===n&&(n=o),o-n+1===c)return n*s}else -1!==n&&(o-=o-n),n=-1}else for(r+c>a&&(r=a-c),o=r;o>=0;o--){let r=!0;for(let n=0;n<c;n++)if(u(e,o+n)!==u(t,n)){r=!1;break}if(r)return o}return -1}function I(e,t,r,n){let i;r=Number(r)||0;let o=e.length-r;n?(n=Number(n))>o&&(n=o):n=o;let s=t.length;for(n>s/2&&(n=s/2),i=0;i<n;++i){let n=parseInt(t.substr(2*i,2),16);if(ea(n))break;e[r+i]=n}return i}function O(e,t,r,n){return eo(et(t,e.length-r),e,r,n)}function T(e,t,r,n){return eo(er(t),e,r,n)}function P(e,t,r,n){return eo(ei(t),e,r,n)}function M(e,t,r,n){return eo(en(t,e.length-r),e,r,n)}function N(e,t,r){return 0===t&&r===e.length?n.fromByteArray(e):n.fromByteArray(e.slice(t,r))}function k(e,t,r){r=Math.min(e.length,r);let n=[],i=t;for(;i<r;){let t=e[i],o=null,s=t>239?4:t>223?3:t>191?2:1;if(i+s<=r){let r,n,a,c;switch(s){case 1:t<128&&(o=t);break;case 2:(192&(r=e[i+1]))==128&&(c=(31&t)<<6|63&r)>127&&(o=c);break;case 3:r=e[i+1],n=e[i+2],(192&r)==128&&(192&n)==128&&(c=(15&t)<<12|(63&r)<<6|63&n)>2047&&(c<55296||c>57343)&&(o=c);break;case 4:r=e[i+1],n=e[i+2],a=e[i+3],(192&r)==128&&(192&n)==128&&(192&a)==128&&(c=(15&t)<<18|(63&r)<<12|(63&n)<<6|63&a)>65535&&c<1114112&&(o=c)}}null===o?(o=65533,s=1):o>65535&&(o-=65536,n.push(o>>>10&1023|55296),o=56320|1023&o),n.push(o),i+=s}return D(n)}t.kMaxLength=s,u.TYPED_ARRAY_SUPPORT=a(),u.TYPED_ARRAY_SUPPORT||"undefined"==typeof console||"function"!=typeof console.error||console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support."),Object.defineProperty(u.prototype,"parent",{enumerable:!0,get:function(){if(u.isBuffer(this))return this.buffer}}),Object.defineProperty(u.prototype,"offset",{enumerable:!0,get:function(){if(u.isBuffer(this))return this.byteOffset}}),u.poolSize=8192,u.from=function(e,t,r){return l(e,t,r)},Object.setPrototypeOf(u.prototype,Uint8Array.prototype),Object.setPrototypeOf(u,Uint8Array),u.alloc=function(e,t,r){return f(e,t,r)},u.allocUnsafe=function(e){return h(e)},u.allocUnsafeSlow=function(e){return h(e)},u.isBuffer=function(e){return null!=e&&!0===e._isBuffer&&e!==u.prototype},u.compare=function(e,t){if(es(e,Uint8Array)&&(e=u.from(e,e.offset,e.byteLength)),es(t,Uint8Array)&&(t=u.from(t,t.offset,t.byteLength)),!u.isBuffer(e)||!u.isBuffer(t))throw TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(e===t)return 0;let r=e.length,n=t.length;for(let i=0,o=Math.min(r,n);i<o;++i)if(e[i]!==t[i]){r=e[i],n=t[i];break}return r<n?-1:n<r?1:0},u.isEncoding=function(e){switch(String(e).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},u.concat=function(e,t){let r;if(!Array.isArray(e))throw TypeError('"list" argument must be an Array of Buffers');if(0===e.length)return u.alloc(0);if(void 0===t)for(r=0,t=0;r<e.length;++r)t+=e[r].length;let n=u.allocUnsafe(t),i=0;for(r=0;r<e.length;++r){let t=e[r];if(es(t,Uint8Array))i+t.length>n.length?(u.isBuffer(t)||(t=u.from(t)),t.copy(n,i)):Uint8Array.prototype.set.call(n,t,i);else if(u.isBuffer(t))t.copy(n,i);else throw TypeError('"list" argument must be an Array of Buffers');i+=t.length}return n},u.byteLength=_,u.prototype._isBuffer=!0,u.prototype.swap16=function(){let e=this.length;if(e%2!=0)throw RangeError("Buffer size must be a multiple of 16-bits");for(let t=0;t<e;t+=2)S(this,t,t+1);return this},u.prototype.swap32=function(){let e=this.length;if(e%4!=0)throw RangeError("Buffer size must be a multiple of 32-bits");for(let t=0;t<e;t+=4)S(this,t,t+3),S(this,t+1,t+2);return this},u.prototype.swap64=function(){let e=this.length;if(e%8!=0)throw RangeError("Buffer size must be a multiple of 64-bits");for(let t=0;t<e;t+=8)S(this,t,t+7),S(this,t+1,t+6),S(this,t+2,t+5),S(this,t+3,t+4);return this},u.prototype.toString=function(){let e=this.length;return 0===e?"":0==arguments.length?k(this,0,e):E.apply(this,arguments)},u.prototype.toLocaleString=u.prototype.toString,u.prototype.equals=function(e){if(!u.isBuffer(e))throw TypeError("Argument must be a Buffer");return this===e||0===u.compare(this,e)},u.prototype.inspect=function(){let e="",r=t.INSPECT_MAX_BYTES;return e=this.toString("hex",0,r).replace(/(.{2})/g,"$1 ").trim(),this.length>r&&(e+=" ... "),"<Buffer "+e+">"},o&&(u.prototype[o]=u.prototype.inspect),u.prototype.compare=function(e,t,r,n,i){if(es(e,Uint8Array)&&(e=u.from(e,e.offset,e.byteLength)),!u.isBuffer(e))throw TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof e);if(void 0===t&&(t=0),void 0===r&&(r=e?e.length:0),void 0===n&&(n=0),void 0===i&&(i=this.length),t<0||r>e.length||n<0||i>this.length)throw RangeError("out of range index");if(n>=i&&t>=r)return 0;if(n>=i)return -1;if(t>=r)return 1;if(t>>>=0,r>>>=0,n>>>=0,i>>>=0,this===e)return 0;let o=i-n,s=r-t,a=Math.min(o,s),c=this.slice(n,i),l=e.slice(t,r);for(let e=0;e<a;++e)if(c[e]!==l[e]){o=c[e],s=l[e];break}return o<s?-1:s<o?1:0},u.prototype.includes=function(e,t,r){return -1!==this.indexOf(e,t,r)},u.prototype.indexOf=function(e,t,r){return x(this,e,t,r,!0)},u.prototype.lastIndexOf=function(e,t,r){return x(this,e,t,r,!1)},u.prototype.write=function(e,t,r,n){if(void 0===t)n="utf8",r=this.length,t=0;else if(void 0===r&&"string"==typeof t)n=t,r=this.length,t=0;else if(isFinite(t))t>>>=0,isFinite(r)?(r>>>=0,void 0===n&&(n="utf8")):(n=r,r=void 0);else throw Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");let i=this.length-t;if((void 0===r||r>i)&&(r=i),e.length>0&&(r<0||t<0)||t>this.length)throw RangeError("Attempt to write outside buffer bounds");n||(n="utf8");let o=!1;for(;;)switch(n){case"hex":return I(this,e,t,r);case"utf8":case"utf-8":return O(this,e,t,r);case"ascii":case"latin1":case"binary":return T(this,e,t,r);case"base64":return P(this,e,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return M(this,e,t,r);default:if(o)throw TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),o=!0}},u.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};let C=4096;function D(e){let t=e.length;if(t<=C)return String.fromCharCode.apply(String,e);let r="",n=0;for(;n<t;)r+=String.fromCharCode.apply(String,e.slice(n,n+=C));return r}function j(e,t,r){let n="";r=Math.min(e.length,r);for(let i=t;i<r;++i)n+=String.fromCharCode(127&e[i]);return n}function R(e,t,r){let n="";r=Math.min(e.length,r);for(let i=t;i<r;++i)n+=String.fromCharCode(e[i]);return n}function L(e,t,r){let n=e.length;(!t||t<0)&&(t=0),(!r||r<0||r>n)&&(r=n);let i="";for(let n=t;n<r;++n)i+=ec[e[n]];return i}function B(e,t,r){let n=e.slice(t,r),i="";for(let e=0;e<n.length-1;e+=2)i+=String.fromCharCode(n[e]+256*n[e+1]);return i}function U(e,t,r){if(e%1!=0||e<0)throw RangeError("offset is not uint");if(e+t>r)throw RangeError("Trying to access beyond buffer length")}function $(e,t,r,n,i,o){if(!u.isBuffer(e))throw TypeError('"buffer" argument must be a Buffer instance');if(t>i||t<o)throw RangeError('"value" argument is out of bounds');if(r+n>e.length)throw RangeError("Index out of range")}function K(e,t,r,n,i){Z(t,n,i,e,r,7);let o=Number(t&BigInt(0xffffffff));e[r++]=o,o>>=8,e[r++]=o,o>>=8,e[r++]=o,o>>=8,e[r++]=o;let s=Number(t>>BigInt(32)&BigInt(0xffffffff));return e[r++]=s,s>>=8,e[r++]=s,s>>=8,e[r++]=s,s>>=8,e[r++]=s,r}function F(e,t,r,n,i){Z(t,n,i,e,r,7);let o=Number(t&BigInt(0xffffffff));e[r+7]=o,o>>=8,e[r+6]=o,o>>=8,e[r+5]=o,o>>=8,e[r+4]=o;let s=Number(t>>BigInt(32)&BigInt(0xffffffff));return e[r+3]=s,s>>=8,e[r+2]=s,s>>=8,e[r+1]=s,s>>=8,e[r]=s,r+8}function z(e,t,r,n,i,o){if(r+n>e.length||r<0)throw RangeError("Index out of range")}function q(e,t,r,n,o){return t=+t,r>>>=0,o||z(e,t,r,4,34028234663852886e22,-34028234663852886e22),i.write(e,t,r,n,23,4),r+4}function V(e,t,r,n,o){return t=+t,r>>>=0,o||z(e,t,r,8,17976931348623157e292,-17976931348623157e292),i.write(e,t,r,n,52,8),r+8}u.prototype.slice=function(e,t){let r=this.length;e=~~e,t=void 0===t?r:~~t,e<0?(e+=r)<0&&(e=0):e>r&&(e=r),t<0?(t+=r)<0&&(t=0):t>r&&(t=r),t<e&&(t=e);let n=this.subarray(e,t);return Object.setPrototypeOf(n,u.prototype),n},u.prototype.readUintLE=u.prototype.readUIntLE=function(e,t,r){e>>>=0,t>>>=0,r||U(e,t,this.length);let n=this[e],i=1,o=0;for(;++o<t&&(i*=256);)n+=this[e+o]*i;return n},u.prototype.readUintBE=u.prototype.readUIntBE=function(e,t,r){e>>>=0,t>>>=0,r||U(e,t,this.length);let n=this[e+--t],i=1;for(;t>0&&(i*=256);)n+=this[e+--t]*i;return n},u.prototype.readUint8=u.prototype.readUInt8=function(e,t){return e>>>=0,t||U(e,1,this.length),this[e]},u.prototype.readUint16LE=u.prototype.readUInt16LE=function(e,t){return e>>>=0,t||U(e,2,this.length),this[e]|this[e+1]<<8},u.prototype.readUint16BE=u.prototype.readUInt16BE=function(e,t){return e>>>=0,t||U(e,2,this.length),this[e]<<8|this[e+1]},u.prototype.readUint32LE=u.prototype.readUInt32LE=function(e,t){return e>>>=0,t||U(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+0x1000000*this[e+3]},u.prototype.readUint32BE=u.prototype.readUInt32BE=function(e,t){return e>>>=0,t||U(e,4,this.length),0x1000000*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},u.prototype.readBigUInt64LE=eu(function(e){Y(e>>>=0,"offset");let t=this[e],r=this[e+7];(void 0===t||void 0===r)&&X(e,this.length-8);let n=t+256*this[++e]+65536*this[++e]+0x1000000*this[++e],i=this[++e]+256*this[++e]+65536*this[++e]+0x1000000*r;return BigInt(n)+(BigInt(i)<<BigInt(32))}),u.prototype.readBigUInt64BE=eu(function(e){Y(e>>>=0,"offset");let t=this[e],r=this[e+7];(void 0===t||void 0===r)&&X(e,this.length-8);let n=0x1000000*t+65536*this[++e]+256*this[++e]+this[++e],i=0x1000000*this[++e]+65536*this[++e]+256*this[++e]+r;return(BigInt(n)<<BigInt(32))+BigInt(i)}),u.prototype.readIntLE=function(e,t,r){e>>>=0,t>>>=0,r||U(e,t,this.length);let n=this[e],i=1,o=0;for(;++o<t&&(i*=256);)n+=this[e+o]*i;return n>=(i*=128)&&(n-=Math.pow(2,8*t)),n},u.prototype.readIntBE=function(e,t,r){e>>>=0,t>>>=0,r||U(e,t,this.length);let n=t,i=1,o=this[e+--n];for(;n>0&&(i*=256);)o+=this[e+--n]*i;return o>=(i*=128)&&(o-=Math.pow(2,8*t)),o},u.prototype.readInt8=function(e,t){return(e>>>=0,t||U(e,1,this.length),128&this[e])?-((255-this[e]+1)*1):this[e]},u.prototype.readInt16LE=function(e,t){e>>>=0,t||U(e,2,this.length);let r=this[e]|this[e+1]<<8;return 32768&r?0xffff0000|r:r},u.prototype.readInt16BE=function(e,t){e>>>=0,t||U(e,2,this.length);let r=this[e+1]|this[e]<<8;return 32768&r?0xffff0000|r:r},u.prototype.readInt32LE=function(e,t){return e>>>=0,t||U(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},u.prototype.readInt32BE=function(e,t){return e>>>=0,t||U(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},u.prototype.readBigInt64LE=eu(function(e){Y(e>>>=0,"offset");let t=this[e],r=this[e+7];return(void 0===t||void 0===r)&&X(e,this.length-8),(BigInt(this[e+4]+256*this[e+5]+65536*this[e+6]+(r<<24))<<BigInt(32))+BigInt(t+256*this[++e]+65536*this[++e]+0x1000000*this[++e])}),u.prototype.readBigInt64BE=eu(function(e){Y(e>>>=0,"offset");let t=this[e],r=this[e+7];return(void 0===t||void 0===r)&&X(e,this.length-8),(BigInt((t<<24)+65536*this[++e]+256*this[++e]+this[++e])<<BigInt(32))+BigInt(0x1000000*this[++e]+65536*this[++e]+256*this[++e]+r)}),u.prototype.readFloatLE=function(e,t){return e>>>=0,t||U(e,4,this.length),i.read(this,e,!0,23,4)},u.prototype.readFloatBE=function(e,t){return e>>>=0,t||U(e,4,this.length),i.read(this,e,!1,23,4)},u.prototype.readDoubleLE=function(e,t){return e>>>=0,t||U(e,8,this.length),i.read(this,e,!0,52,8)},u.prototype.readDoubleBE=function(e,t){return e>>>=0,t||U(e,8,this.length),i.read(this,e,!1,52,8)},u.prototype.writeUintLE=u.prototype.writeUIntLE=function(e,t,r,n){if(e=+e,t>>>=0,r>>>=0,!n){let n=Math.pow(2,8*r)-1;$(this,e,t,r,n,0)}let i=1,o=0;for(this[t]=255&e;++o<r&&(i*=256);)this[t+o]=e/i&255;return t+r},u.prototype.writeUintBE=u.prototype.writeUIntBE=function(e,t,r,n){if(e=+e,t>>>=0,r>>>=0,!n){let n=Math.pow(2,8*r)-1;$(this,e,t,r,n,0)}let i=r-1,o=1;for(this[t+i]=255&e;--i>=0&&(o*=256);)this[t+i]=e/o&255;return t+r},u.prototype.writeUint8=u.prototype.writeUInt8=function(e,t,r){return e=+e,t>>>=0,r||$(this,e,t,1,255,0),this[t]=255&e,t+1},u.prototype.writeUint16LE=u.prototype.writeUInt16LE=function(e,t,r){return e=+e,t>>>=0,r||$(this,e,t,2,65535,0),this[t]=255&e,this[t+1]=e>>>8,t+2},u.prototype.writeUint16BE=u.prototype.writeUInt16BE=function(e,t,r){return e=+e,t>>>=0,r||$(this,e,t,2,65535,0),this[t]=e>>>8,this[t+1]=255&e,t+2},u.prototype.writeUint32LE=u.prototype.writeUInt32LE=function(e,t,r){return e=+e,t>>>=0,r||$(this,e,t,4,0xffffffff,0),this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=255&e,t+4},u.prototype.writeUint32BE=u.prototype.writeUInt32BE=function(e,t,r){return e=+e,t>>>=0,r||$(this,e,t,4,0xffffffff,0),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},u.prototype.writeBigUInt64LE=eu(function(e,t=0){return K(this,e,t,BigInt(0),BigInt("0xffffffffffffffff"))}),u.prototype.writeBigUInt64BE=eu(function(e,t=0){return F(this,e,t,BigInt(0),BigInt("0xffffffffffffffff"))}),u.prototype.writeIntLE=function(e,t,r,n){if(e=+e,t>>>=0,!n){let n=Math.pow(2,8*r-1);$(this,e,t,r,n-1,-n)}let i=0,o=1,s=0;for(this[t]=255&e;++i<r&&(o*=256);)e<0&&0===s&&0!==this[t+i-1]&&(s=1),this[t+i]=(e/o>>0)-s&255;return t+r},u.prototype.writeIntBE=function(e,t,r,n){if(e=+e,t>>>=0,!n){let n=Math.pow(2,8*r-1);$(this,e,t,r,n-1,-n)}let i=r-1,o=1,s=0;for(this[t+i]=255&e;--i>=0&&(o*=256);)e<0&&0===s&&0!==this[t+i+1]&&(s=1),this[t+i]=(e/o>>0)-s&255;return t+r},u.prototype.writeInt8=function(e,t,r){return e=+e,t>>>=0,r||$(this,e,t,1,127,-128),e<0&&(e=255+e+1),this[t]=255&e,t+1},u.prototype.writeInt16LE=function(e,t,r){return e=+e,t>>>=0,r||$(this,e,t,2,32767,-32768),this[t]=255&e,this[t+1]=e>>>8,t+2},u.prototype.writeInt16BE=function(e,t,r){return e=+e,t>>>=0,r||$(this,e,t,2,32767,-32768),this[t]=e>>>8,this[t+1]=255&e,t+2},u.prototype.writeInt32LE=function(e,t,r){return e=+e,t>>>=0,r||$(this,e,t,4,0x7fffffff,-0x80000000),this[t]=255&e,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24,t+4},u.prototype.writeInt32BE=function(e,t,r){return e=+e,t>>>=0,r||$(this,e,t,4,0x7fffffff,-0x80000000),e<0&&(e=0xffffffff+e+1),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},u.prototype.writeBigInt64LE=eu(function(e,t=0){return K(this,e,t,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))}),u.prototype.writeBigInt64BE=eu(function(e,t=0){return F(this,e,t,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))}),u.prototype.writeFloatLE=function(e,t,r){return q(this,e,t,!0,r)},u.prototype.writeFloatBE=function(e,t,r){return q(this,e,t,!1,r)},u.prototype.writeDoubleLE=function(e,t,r){return V(this,e,t,!0,r)},u.prototype.writeDoubleBE=function(e,t,r){return V(this,e,t,!1,r)},u.prototype.copy=function(e,t,r,n){if(!u.isBuffer(e))throw TypeError("argument should be a Buffer");if(r||(r=0),n||0===n||(n=this.length),t>=e.length&&(t=e.length),t||(t=0),n>0&&n<r&&(n=r),n===r||0===e.length||0===this.length)return 0;if(t<0)throw RangeError("targetStart out of bounds");if(r<0||r>=this.length)throw RangeError("Index out of range");if(n<0)throw RangeError("sourceEnd out of bounds");n>this.length&&(n=this.length),e.length-t<n-r&&(n=e.length-t+r);let i=n-r;return this===e&&"function"==typeof Uint8Array.prototype.copyWithin?this.copyWithin(t,r,n):Uint8Array.prototype.set.call(e,this.subarray(r,n),t),i},u.prototype.fill=function(e,t,r,n){let i;if("string"==typeof e){if("string"==typeof t?(n=t,t=0,r=this.length):"string"==typeof r&&(n=r,r=this.length),void 0!==n&&"string"!=typeof n)throw TypeError("encoding must be a string");if("string"==typeof n&&!u.isEncoding(n))throw TypeError("Unknown encoding: "+n);if(1===e.length){let t=e.charCodeAt(0);("utf8"===n&&t<128||"latin1"===n)&&(e=t)}}else"number"==typeof e?e&=255:"boolean"==typeof e&&(e=Number(e));if(t<0||this.length<t||this.length<r)throw RangeError("Out of range index");if(r<=t)return this;if(t>>>=0,r=void 0===r?this.length:r>>>0,e||(e=0),"number"==typeof e)for(i=t;i<r;++i)this[i]=e;else{let o=u.isBuffer(e)?e:u.from(e,n),s=o.length;
30if(0===s)throw TypeError('The value "'+e+'" is invalid for argument "value"');for(i=0;i<r-t;++i)this[i+t]=o[i%s]}return this};let H={};function G(e,t,r){H[e]=class extends r{constructor(){super(),Object.defineProperty(this,"message",{value:t.apply(this,arguments),writable:!0,configurable:!0}),this.name=`${this.name} [${e}]`,this.stack,delete this.name}get code(){return e}set code(e){Object.defineProperty(this,"code",{configurable:!0,enumerable:!0,value:e,writable:!0})}toString(){return`${this.name} [${e}]: ${this.message}`}}}function W(e){let t="",r=e.length,n="-"===e[0]?1:0;for(;r>=n+4;r-=3)t=`_${e.slice(r-3,r)}${t}`;return`${e.slice(0,r)}${t}`}function J(e,t,r){Y(t,"offset"),(void 0===e[t]||void 0===e[t+r])&&X(t,e.length-(r+1))}function Z(e,t,r,n,i,o){if(e>r||e<t){let n;let i="bigint"==typeof t?"n":"";throw n=o>3?0===t||t===BigInt(0)?`>= 0${i} and < 2${i} ** ${(o+1)*8}${i}`:`>= -(2${i} ** ${(o+1)*8-1}${i}) and < 2 ** ${(o+1)*8-1}${i}`:`>= ${t}${i} and <= ${r}${i}`,new H.ERR_OUT_OF_RANGE("value",n,e)}J(n,i,o)}function Y(e,t){if("number"!=typeof e)throw new H.ERR_INVALID_ARG_TYPE(t,"number",e)}function X(e,t,r){if(Math.floor(e)!==e)throw Y(e,r),new H.ERR_OUT_OF_RANGE(r||"offset","an integer",e);if(t<0)throw new H.ERR_BUFFER_OUT_OF_BOUNDS;throw new H.ERR_OUT_OF_RANGE(r||"offset",`>= ${r?1:0} and <= ${t}`,e)}G("ERR_BUFFER_OUT_OF_BOUNDS",function(e){return e?`${e} is outside of buffer bounds`:"Attempt to access memory outside buffer bounds"},RangeError),G("ERR_INVALID_ARG_TYPE",function(e,t){return`The "${e}" argument must be of type number. Received type ${typeof t}`},TypeError),G("ERR_OUT_OF_RANGE",function(e,t,r){let n=`The value of "${e}" is out of range.`,i=r;return Number.isInteger(r)&&Math.abs(r)>0x100000000?i=W(String(r)):"bigint"==typeof r&&(i=String(r),(r>BigInt(2)**BigInt(32)||r<-(BigInt(2)**BigInt(32)))&&(i=W(i)),i+="n"),n+=` It must be ${t}. Received ${i}`},RangeError);let Q=/[^+/0-9A-Za-z-_]/g;function ee(e){if((e=(e=e.split("=")[0]).trim().replace(Q,"")).length<2)return"";for(;e.length%4!=0;)e+="=";return e}function et(e,t){let r;t=t||1/0;let n=e.length,i=null,o=[];for(let s=0;s<n;++s){if((r=e.charCodeAt(s))>55295&&r<57344){if(!i){if(r>56319||s+1===n){(t-=3)>-1&&o.push(239,191,189);continue}i=r;continue}if(r<56320){(t-=3)>-1&&o.push(239,191,189),i=r;continue}r=(i-55296<<10|r-56320)+65536}else i&&(t-=3)>-1&&o.push(239,191,189);if(i=null,r<128){if((t-=1)<0)break;o.push(r)}else if(r<2048){if((t-=2)<0)break;o.push(r>>6|192,63&r|128)}else if(r<65536){if((t-=3)<0)break;o.push(r>>12|224,r>>6&63|128,63&r|128)}else if(r<1114112){if((t-=4)<0)break;o.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}else throw Error("Invalid code point")}return o}function er(e){let t=[];for(let r=0;r<e.length;++r)t.push(255&e.charCodeAt(r));return t}function en(e,t){let r,n;let i=[];for(let o=0;o<e.length&&!((t-=2)<0);++o)n=(r=e.charCodeAt(o))>>8,i.push(r%256),i.push(n);return i}function ei(e){return n.toByteArray(ee(e))}function eo(e,t,r,n){let i;for(i=0;i<n&&!(i+r>=t.length)&&!(i>=e.length);++i)t[i+r]=e[i];return i}function es(e,t){return e instanceof t||null!=e&&null!=e.constructor&&null!=e.constructor.name&&e.constructor.name===t.name}function ea(e){return e!=e}let ec=function(){let e="0123456789abcdef",t=Array(256);for(let r=0;r<16;++r){let n=16*r;for(let i=0;i<16;++i)t[n+i]=e[r]+e[i]}return t}();function eu(e){return"undefined"==typeof BigInt?el:e}function el(){throw Error("BigInt not supported")}},34885:e=>{var t={utf8:{stringToBytes:function(e){return t.bin.stringToBytes(unescape(encodeURIComponent(e)))},bytesToString:function(e){return decodeURIComponent(escape(t.bin.bytesToString(e)))}},bin:{stringToBytes:function(e){for(var t=[],r=0;r<e.length;r++)t.push(255&e.charCodeAt(r));return t},bytesToString:function(e){for(var t=[],r=0;r<e.length;r++)t.push(String.fromCharCode(e[r]));return t.join("")}}};e.exports=t},21079:(e,t,r)=>{"use strict";var n=r(9018),i={"text/plain":"Text","text/html":"Url",default:"Text"},o="Copy to clipboard: #{key}, Enter";function s(e){var t=(/mac os x/i.test(navigator.userAgent)?"â":"Ctrl")+"+C";return e.replace(/#{\s*key\s*}/g,t)}function a(e,t){var r,a,c,u,l,d,f=!1;t||(t={}),r=t.debug||!1;try{if(c=n(),u=document.createRange(),l=document.getSelection(),(d=document.createElement("span")).textContent=e,d.ariaHidden="true",d.style.all="unset",d.style.position="fixed",d.style.top=0,d.style.clip="rect(0, 0, 0, 0)",d.style.whiteSpace="pre",d.style.webkitUserSelect="text",d.style.MozUserSelect="text",d.style.msUserSelect="text",d.style.userSelect="text",d.addEventListener("copy",function(n){if(n.stopPropagation(),t.format){if(n.preventDefault(),void 0===n.clipboardData){r&&console.warn("unable to use e.clipboardData"),r&&console.warn("trying IE specific stuff"),window.clipboardData.clearData();var o=i[t.format]||i.default;window.clipboardData.setData(o,e)}else n.clipboardData.clearData(),n.clipboardData.setData(t.format,e)}t.onCopy&&(n.preventDefault(),t.onCopy(n.clipboardData))}),document.body.appendChild(d),u.selectNodeContents(d),l.addRange(u),!document.execCommand("copy"))throw Error("copy command was unsuccessful");f=!0}catch(n){r&&console.error("unable to copy using execCommand: ",n
30),r&&console.warn("trying IE specific stuff");try{window.clipboardData.setData(t.format||"text",e),t.onCopy&&t.onCopy(window.clipboardData),f=!0}catch(n){r&&console.error("unable to copy using clipboardData: ",n),r&&console.error("falling back to prompt"),a=s("message"in t?t.message:o),window.prompt(a,e)}}finally{l&&("function"==typeof l.removeRange?l.removeRange(u):l.removeAllRanges()),d&&document.body.removeChild(d),c()}return f}e.exports=a},47505:e=>{!function(){var t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",r={rotl:function(e,t){return e<<t|e>>>32-t},rotr:function(e,t){return e<<32-t|e>>>t},endian:function(e){if(e.constructor==Number)return 0xff00ff&r.rotl(e,8)|0xff00ff00&r.rotl(e,24);for(var t=0;t<e.length;t++)e[t]=r.endian(e[t]);return e},randomBytes:function(e){for(var t=[];e>0;e--)t.push(Math.floor(256*Math.random()));return t},bytesToWords:function(e){for(var t=[],r=0,n=0;r<e.length;r++,n+=8)t[n>>>5]|=e[r]<<24-n%32;return t},wordsToBytes:function(e){for(var t=[],r=0;r<32*e.length;r+=8)t.push(e[r>>>5]>>>24-r%32&255);return t},bytesToHex:function(e){for(var t=[],r=0;r<e.length;r++)t.push((e[r]>>>4).toString(16)),t.push((15&e[r]).toString(16));return t.join("")},hexToBytes:function(e){for(var t=[],r=0;r<e.length;r+=2)t.push(parseInt(e.substr(r,2),16));return t},bytesToBase64:function(e){for(var r=[],n=0;n<e.length;n+=3)for(var i=e[n]<<16|e[n+1]<<8|e[n+2],o=0;o<4;o++)8*n+6*o<=8*e.length?r.push(t.charAt(i>>>6*(3-o)&63)):r.push("=");return r.join("")},base64ToBytes:function(e){e=e.replace(/[^A-Z0-9+\/]/ig,"");for(var r=[],n=0,i=0;n<e.length;i=++n%4)0!=i&&r.push((t.indexOf(e.charAt(n-1))&Math.pow(2,-2*i+8)-1)<<2*i|t.indexOf(e.charAt(n))>>>6-2*i);return r}};e.exports=r}()},11466:e=>{"use strict";var t="%[a-f0-9]{2}",r=RegExp("("+t+")|([^%]+?)","gi"),n=RegExp("("+t+")+","gi");function i(e,t){try{return[decodeURIComponent(e.join(""))]}catch(e){}if(1===e.length)return e;t=t||1;var r=e.slice(0,t),n=e.slice(t);return Array.prototype.concat.call([],i(r),i(n))}function o(e){try{return decodeURIComponent(e)}catch(o){for(var t=e.match(r)||[],n=1;n<t.length;n++)t=(e=i(t,n).join("")).match(r)||[];return e}}function s(e){for(var t={"%FE%FF":"��","%FF%FE":"��"},r=n.exec(e);r;){try{t[r[0]]=decodeURIComponent(r[0])}catch(e){var i=o(r[0]);i!==r[0]&&(t[r[0]]=i)}r=n.exec(e)}t["%C2"]="�";for(var s=Object.keys(t),a=0;a<s.length;a++){var c=s[a];e=e.replace(RegExp(c,"g"),t[c])}return e}e.exports=function(e){if("string"!=typeof e)throw TypeError("Expected `encodedURI` to be of type `string`, got `"+typeof e+"`");try{return e=e.replace(/\+/g," "),decodeURIComponent(e)}catch(t){return s(e)}}},29905:e=>{"use strict";function t(e){if(!e)throw TypeError("argument namespace is required");function t(e){}return t._file=void 0,t._ignored=!0,t._namespace=e,t._traced=!1,t._warned=Object.create(null),t.function=r,t.property=n,t}function r(e,t){if("function"!=typeof e)throw TypeError("argument fn must be a function");return e}function n(e,t,r){if(!e||"object"!=typeof e&&"function"!=typeof e)throw TypeError("argument obj must be object");var n=Object.getOwnPropertyDescriptor(e,t);if(!n)throw TypeError("must call property on owner object");if(!n.configurable)throw TypeError("property must be configurable")}e.exports=t},45130:e=>{"use strict";var t={single_source_shortest_paths:function(e,r,n){var i,o,s,a,c,u,l,d={},f={};f[r]=0;var h=t.PriorityQueue.make();for(h.push(r,0);!h.empty();)for(s in o=(i=h.pop()).value,a=i.cost,c=e[o]||{})c.hasOwnProperty(s)&&(u=a+c[s],l=f[s],(void 0===f[s]||l>u)&&(f[s]=u,h.push(s,u),d[s]=o));if(void 0!==n&&void 0===f[n])throw Error(["Could not find a path from ",r," to ",n,"."].join(""));return d},extract_shortest_path_from_predecessor_list:function(e,t){for(var r,n=[],i=t;i;)n.push(i),r=e[i],i=e[i];return n.reverse(),n},find_path:function(e,r,n){var i=t.single_source_shortest_paths(e,r,n);return t.extract_shortest_path_from_predecessor_list(i,n)},PriorityQueue:{make:function(e){var r,n=t.PriorityQueue,i={};for(r in e=e||{},n)n.hasOwnProperty(r)&&(i[r]=n[r]);return i.queue=[],i.sorter=e.sorter||n.default_sorter,i},default_sorter:function(e,t){return e.cost-t.cost},push:function(e,t){var r={value:e,cost:t};this.queue.push(r),this.queue.sort(this.sorter)},pop:function(){return this.queue.shift()},empty:function(){return 0===this.queue.length}}};e.exports=t},71423:(e,t,r)=>{"use strict";var n=t;n.version=r(14537).rE,n.utils=r(71929),n.rand=r(53607),n.curve=r(34560),n.curves=r(18728),n.ec=r(28691),n.eddsa=r(79324)},69021:(e,t,r)=>{"use strict";var n=r(67874),i=r(71929),o=i.getNAF,s=i.getJSF,a=i.assert;function c(e,t){this.type=e,this.p=new n(t.p,16),this.red=t.prime?n.red(t.prime):n.mont(this.p),this.zero=new n(0).toRed(this.red),this.one=new n(1).toRed(this.red),this.two=new n(2).toRed(this.red),this.n=t.n&&new n(t.n,16),this.g=t.g&&this.pointFromJSON(t.g,t.gRed),this._wnafT1=[,,,,],this._wnafT2=[,,,,],this._wnafT3=[,,,,],this._wnafT4=[,,,,],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))}
vendor: 11,490 bytes, line 30
30function u(e,t){this.curve=e,this.type=t,this.precomputed=null}e.exports=c,c.prototype.point=function(){throw Error("Not implemented")},c.prototype.validate=function(){throw Error("Not implemented")},c.prototype._fixedNafMul=function(e,t){a(e.precomputed);var r,n,i=e._getDoubles(),s=o(t,1,this._bitLength),c=(1<<i.step+1)-(i.step%2==0?2:1);c/=3;var u=[];for(r=0;r<s.length;r+=i.step){n=0;for(var l=r+i.step-1;l>=r;l--)n=(n<<1)+s[l];u.push(n)}for(var d=this.jpoint(null,null,null),f=this.jpoint(null,null,null),h=c;h>0;h--){for(r=0;r<u.length;r++)(n=u[r])===h?f=f.mixedAdd(i.points[r]):n===-h&&(f=f.mixedAdd(i.points[r].neg()));d=d.add(f)}return d.toP()},c.prototype._wnafMul=function(e,t){var r=4,n=e._getNAFPoints(r);r=n.wnd;for(var i=n.points,s=o(t,r,this._bitLength),c=this.jpoint(null,null,null),u=s.length-1;u>=0;u--){for(var l=0;u>=0&&0===s[u];u--)l++;if(u>=0&&l++,c=c.dblp(l),u<0)break;var d=s[u];a(0!==d),c="affine"===e.type?d>0?c.mixedAdd(i[d-1>>1]):c.mixedAdd(i[-d-1>>1].neg()):d>0?c.add(i[d-1>>1]):c.add(i[-d-1>>1].neg())}return"affine"===e.type?c.toP():c},c.prototype._wnafMulAdd=function(e,t,r,n,i){var a,c,u,l=this._wnafT1,d=this._wnafT2,f=this._wnafT3,h=0;for(a=0;a<n;a++){var p=(u=t[a])._getNAFPoints(e);l[a]=p.wnd,d[a]=p.points}for(a=n-1;a>=1;a-=2){var y=a-1,g=a;if(1!==l[y]||1!==l[g]){f[y]=o(r[y],l[y],this._bitLength),f[g]=o(r[g],l[g],this._bitLength),h=Math.max(f[y].length,h),h=Math.max(f[g].length,h);continue}var m=[t[y],null,null,t[g]];0===t[y].y.cmp(t[g].y)?(m[1]=t[y].add(t[g]),m[2]=t[y].toJ().mixedAdd(t[g].neg())):0===t[y].y.cmp(t[g].y.redNeg())?(m[1]=t[y].toJ().mixedAdd(t[g]),m[2]=t[y].add(t[g].neg())):(m[1]=t[y].toJ().mixedAdd(t[g]),m[2]=t[y].toJ().mixedAdd(t[g].neg()));var b=[-3,-1,-5,-7,0,7,5,1,3],v=s(r[y],r[g]);for(c=0,h=Math.max(v[0].length,h),f[y]=Array(h),f[g]=Array(h);c<h;c++){var w=0|v[0][c],_=0|v[1][c];f[y][c]=b[(w+1)*3+(_+1)],f[g][c]=0,d[y]=m}}var E=this.jpoint(null,null,null),S=this._wnafT4;for(a=h;a>=0;a--){for(var x=0;a>=0;){var A=!0;for(c=0;c<n;c++)S[c]=0|f[c][a],0!==S[c]&&(A=!1);if(!A)break;x++,a--}if(a>=0&&x++,E=E.dblp(x),a<0)break;for(c=0;c<n;c++){var I=S[c];0!==I&&(I>0?u=d[c][I-1>>1]:I<0&&(u=d[c][-I-1>>1].neg()),E="affine"===u.type?E.mixedAdd(u):E.add(u))}}for(a=0;a<n;a++)d[a]=null;return i?E:E.toP()},c.BasePoint=u,u.prototype.eq=function(){throw Error("Not implemented")},u.prototype.validate=function(){return this.curve.validate(this)},c.prototype.decodePoint=function(e,t){e=i.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]?a(e[e.length-1]%2==0):7===e[0]&&a(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 Error("Unknown point format")},u.prototype.encodeCompressed=function(e){return this.encode(e,!0)},u.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))},u.prototype.encode=function(e,t){return i.encode(this._encode(t),e)},u.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},u.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)},u.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}},u.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}},u.prototype._getBeta=function(){return null},u.prototype.dblp=function(e){for(var t=this,r=0;r<e;r++)t=t.dbl();return t}},53824:(e,t,r)=>{"use strict";var n=r(71929),i=r(67874),o=r(54448),s=r(69021),a=n.assert;function c(e){this.twisted=(0|e.a)!=1,this.mOneA=this.twisted&&(0|e.a)==-1,this.extended=this.mOneA,s.call(this,"edwards",e),this.a=new i(e.a,16).umod(this.red.m),this.a=this.a.toRed(this.red),this.c=new i(e.c,16).toRed(this.red),this.c2=this.c.redSqr(),this.d=new i(e.d,16).toRed(this.red),this.dd=this.d.redAdd(this.d),a(!this.twisted||0===this.c.fromRed().cmpn(1)),this.oneC=(0|e.c)==1}function u(e,t,r,n,o){s.BasePoint.call(this,e,"projective"),null===t&&null===r&&null===n?(this.x=this.curve.zero,this.y=this.curve.one,this.z=this.curve.one,this.t=this.curve.zero,this.zOne=!0):(this.x=new i(t,16),this.y=new i(r,16),this.z=n?new i(n,16):this.curve.one,this.t=o&&new i(o,16),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.y.red||(this.y=this.y.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)),this.t&&!this.t.red&&(this.t=this.t.toRed(this.curve.red)),this.zOne=this.z===this.curve.one,!this.curve.extended||this.t||(this.t=this.x.redMul(this.y),this.zOne||(this.t=this.t.redMul(this.z.redInvm()))))}o(c,s),e.exports=c,c.prototype._mulA=function(e){return this.mOneA?e.redNeg():this.a.redMul(e)},c.prototype._mulC=function(e){return this.oneC?e:this.c.redMul(e)},c.prototype.jpoint=function(e,t,r,n){return this.point(e,t,r,n)},c.prototype.pointFromX=function(e,t){(e=new i(e,16)).red||(e=e.toRed(this.red));var r=e.redSqr(),n=this.c2.redSub(this.a.redMul(r)),o=this.one.redSub(this.c2.redMul(this.d).redMul(r)),s=n.redMul(o.redInvm()),a=s.redSqrt();if(0!==a.redSqr().redSub(s).cmp(this.zero))throw Error("invalid point");var c=a.fromRed().isOdd();return(t&&!c||!t&&c)&&(a=a.redNeg()),this.point(e,a)},c.prototype.pointFromY=function(e,t){(e=new i(e,16)).red||(e=e.toRed(this.red));var r=e.redSqr(),n=r.redSub(this.c2),o=r.redMul(this.d).redMul(this.c2).redSub(this.a),s=n.redMul(o.redInvm());if(0===s.cmp(this.zero)){if(!t)return this.point(this.zero,e);throw Error("invalid point")}var a=s.redSqrt();if(0!==a.redSqr().redSub(s).cmp(this.zero))throw Error("invalid point");return a.fromRed().isOdd()!==t&&(a=a.redNeg()),this.point(a,e)},c.prototype.validate=function(e){if(e.isInfinity())return!0;e.normalize();var t=e.x.redSqr(),r=e.y.redSqr(),n=t.redMul(this.a).redAdd(r),i=this.c2.redMul(this.one.redAdd(this.d.redMul(t).redMul(r)));return 0===n.cmp(i)},o(u,s.BasePoint),c.prototype.pointFromJSON=function(e){return u.fromJSON(this,e)},c.prototype.point=function(e,t,r,n){return new u(this,e,t,r,n)},u.fromJSON=function(e,t){return new u(e,t[0],t[1],t[2])},u.prototype.inspect=function(){return this.isInfinity()?"<EC Point Infinity>":"<EC Point x: "+this.x.fromRed().toString(16,2)+" y: "+this.y.fromRed().toString(16,2)+" z: "+this.z.fromRed().toString(16,2)+">"},u.prototype.isInfinity=function(){return 0===this.x.cmpn(0)&&(0===this.y.cmp(this.z)||this.zOne&&0===this.y.cmp(this.curve.c))},u.prototype._extDbl=function(){var e=this.x.redSqr(),t=this.y.redSqr(),r=this.z.redSqr();r=r.redIAdd(r);var n=this.curve._mulA(e),i=this.x.redAdd(this.y).redSqr().redISub(e).redISub(t),o=n.redAdd(t),s=o.redSub(r),a=n.redSub(t),c=i.redMul(s),u=o.redMul(a),l=i.redMul(a),d=s.redMul(o);return this.curve.point(c,u,d,l)},u.prototype._projDbl=function(){var e,t,r,n,i,o,s=this.x.redAdd(this.y).redSqr(),a=this.x.redSqr(),c=this.y.redSqr();if(this.curve.twisted){var u=(n=this.curve._mulA(a)).redAdd(c);this.zOne?(e=s.redSub(a).redSub(c).redMul(u.redSub(this.curve.two)),t=u.redMul(n.redSub(c)),r=u.redSqr().redSub(u).redSub(u)):(i=this.z.redSqr(),o=u.redSub(i).redISub(i),e=s.redSub(a).redISub(c).redMul(o),t=u.redMul(n.redSub(c)),r=u.redMul(o))}else n=a.redAdd(c),i=this.curve._mulC(this.z).redSqr(),o=n.redSub(i).redSub(i),e=this.curve._mulC(s.redISub(n)).redMul(o),t=this.curve._mulC(n).redMul(a.redISub(c)),r=n.redMul(o);return this.curve.point(e,t,r)},u.prototype.dbl=function(){return this.isInfinity()?this:this.curve.extended?this._extDbl():this._projDbl()},u.prototype._extAdd=function(e){var t=this.y.redSub(this.x).redMul(e.y.redSub(e.x)),r=this.y.redAdd(this.x).redMul(e.y.redAdd(e.x)),n=this.t.redMul(this.curve.dd).redMul(e.t),i=this.z.redMul(e.z.redAdd(e.z)),o=r.redSub(t),s=i.redSub(n),a=i.redAdd(n),c=r.redAdd(t),u=o.redMul(s),l=a.redMul(c),d=o.redMul(c),f=s.redMul(a);return this.curve.point(u,l,f,d)},u.prototype._projAdd=function(e){var t,r,n=this.z.redMul(e.z),i=n.redSqr(),o=this.x.redMul(e.x),s=this.y.redMul(e.y),a=this.curve.d.redMul(o).redMul(s),c=i.redSub(a),u=i.redAdd(a),l=this.x.redAdd(this.y).redMul(e.x.redAdd(e.y)).redISub(o).redISub(s),d=n.redMul(c).redMul(l);return this.curve.twisted?(t=n.redMul(u).redMul(s.redSub(this.curve._mulA(o))),r=c.redMul(u)):(t=n.redMul(u).redMul(s.redSub(o)),r=this.curve._mulC(c).redMul(u)),this.curve.point(d,t,r)},u.prototype.add=function(e){return this.isInfinity()?e:e.isInfinity()?this:this.curve.extended?this._extAdd(e):this._projAdd(e)},u.prototype.mul=function(e){return this._hasDoubles(e)?this.curve._fixedNafMul(this,e):this.curve._wnafMul(this,e)},u.prototype.mulAdd=function(e,t,r){return this.curve._wnafMulAdd(1,[this,t],[e,r],2,!1)},u.prototype.jmulAdd=function(e,t,r){return this.curve._wnafMulAdd(1,[this,t],[e,r],2,!0)},u.prototype.normalize=function(){if(this.zOne)return this;var e=this.z.redInvm();return this.x=this.x.redMul(e),this.y=this.y.redMul(e),this.t&&(this.t=this.t.redMul(e)),this.z=this.curve.one,this.zOne=!0,this},u.prototype.neg=function(){return this.curve.point(this.x.redNeg(),this.y,this.z,this.t&&this.t.redNeg())},u.prototype.getX=function(){return this.normalize(),this.x.fromRed()},u.prototype.getY=function(){return this.normalize(),this.y.fromRed()},u.prototype.eq=function(e){return this===e||0===this.getX().cmp(e.getX())&&0===this.getY().cmp(e.getY())},u.prototype.eqXToP=function(e){var t=e.toRed(this.curve.red).redMul(this.z);if(0===this.x.cmp(t))return!0;for(var r=e.clone(),n=this.curve.redN.redMul(this.z);;){if(r.iadd(this.curve.n),r.cmp(this.curve.p)>=0)return!1;if(t.redIAdd(n),0===this.x.cmp(t))return!0}},u.prototype.toP=u.prototype.normalize,u.prototype.mixedAdd=u.prototype.add},34560:(e,t,r)=>{"use strict";var n=t;n.base=r(69021),n.short=r(78458),n.mont=r(9482),n.edwards=r(53824)},9482:(e,t,r)=>{"use strict";var n=r(67874),i=r(54448),o=r(69021),s=r(71929);function a(e){o.call(this,"mont",e),this.a=new n(e.a,16).toRed(this.red),this.b=new n(e.b,16).toRed(this.red),this.i4=new n(4).toRed(this.red).redInvm(),this.two=new n(2).toRed(this.red),this.a24=this.i4.redMul(this.a.redAdd(this.two))}function c(e,t,r){o.BasePoint.call(this,e,"projective"),null===t&&null===r?(this.x=this.curve.one,this.z=this.curve.zero):(this.x=new n(t,16),this.z=new n(r,16),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)))}i(a,o),e.exports=a,a.prototype.validate=function(e){var t=e.normalize().x,r=t.redSqr(),n=r.redMul(t).redAdd(r.redMul(this.a)).redAdd(t);return 0===n.redSqrt().redSqr().cmp(n)},i(c,o.BasePoint),a.prototype.decodePoint=function(e,t){return this.point(s.toArray(e,t),1)},a.prototype.point=function(e,t){return new c(this,e,t)},a.prototype.pointFromJSON=function(e){return c.fromJSON(this,e)},c.prototype.precompute=function(){},c.prototype._encode=function(){return this.getX().toArray("be",this.curve.p.byteLength())},c.fromJSON=function(e,t){return new c(e,t[0],t[1]||e.one)},c.prototype.inspect=function(){return this.isInfinity()?"<EC Point Infinity>
30":"<EC Point x: "+this.x.fromRed().toString(16,2)+" z: "+this.z.fromRed().toString(16,2)+">"},c.prototype.isInfinity=function(){return 0===this.z.cmpn(0)},c.prototype.dbl=function(){var e=this.x.redAdd(this.z).redSqr(),t=this.x.redSub(this.z).redSqr(),r=e.redSub(t),n=e.redMul(t),i=r.redMul(t.redAdd(this.curve.a24.redMul(r)));return this.curve.point(n,i)},c.prototype.add=function(){throw Error("Not supported on Montgomery curve")},c.prototype.diffAdd=function(e,t){var r=this.x.redAdd(this.z),n=this.x.redSub(this.z),i=e.x.redAdd(e.z),o=e.x.redSub(e.z).redMul(r),s=i.redMul(n),a=t.z.redMul(o.redAdd(s).redSqr()),c=t.x.redMul(o.redISub(s).redSqr());return this.curve.point(a,c)},c.prototype.mul=function(e){for(var t=e.clone(),r=this,n=this.curve.point(null,null),i=this,o=[];0!==t.cmpn(0);t.iushrn(1))o.push(t.andln(1));for(var s=o.length-1;s>=0;s--)0===o[s]?(r=r.diffAdd(n,i),n=n.dbl()):(n=r.diffAdd(n,i),r=r.dbl());return n},c.prototype.mulAdd=function(){throw Error("Not supported on Montgomery curve")},c.prototype.jumlAdd=function(){throw Error("Not supported on Montgomery curve")},c.prototype.eq=function(e){return 0===this.getX().cmp(e.getX())},c.prototype.normalize=function(){return this.x=this.x.redMul(this.z.redInvm()),this.z=this.curve.one,this},c.prototype.getX=function(){return this.normalize(),this.x.fromRed()}},78458:(e,t,r)=>{"use strict";var n=r(71929),i=r(67874),o=r(54448),s=r(69021),a=n.assert;function c(e){s.call(this,"short",e),this.a=new i(e.a,16).toRed(this.red),this.b=new i(e.b,16).toRed(this.red),this.tinv=this.two.redInvm(),this.zeroA=0===this.a.fromRed().cmpn(0),this.threeA=0===this.a.fromRed().sub(this.p).cmpn(-3),this.endo=this._getEndomorphism(e),this._endoWnafT1=[,,,,],this._endoWnafT2=[,,,,]}function u(e,t,r,n){s.BasePoint.call(this,e,"affine"),null===t&&null===r?(this.x=null,this.y=null,this.inf=!0):(this.x=new i(t,16),this.y=new i(r,16),n&&(this.x.forceRed(this.curve.red),this.y.forceRed(this.curve.red)),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.y.red||(this.y=this.y.toRed(this.curve.red)),this.inf=!1)}function l(e,t,r,n){s.BasePoint.call(this,e,"jacobian"),null===t&&null===r&&null===n?(this.x=this.curve.one,this.y=this.curve.one,this.z=new i(0)):(this.x=new i(t,16),this.y=new i(r,16),this.z=new i(n,16)),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.y.red||(this.y=this.y.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)),this.zOne=this.z===this.curve.one}o(c,s),e.exports=c,c.prototype._getEndomorphism=function(e){if(this.zeroA&&this.g&&this.n&&1===this.p.modn(3)){if(e.beta)t=new i(e.beta,16).toRed(this.red);else{var t,r,n,o=this._getEndoRoots(this.p);t=(t=0>o[0].cmp(o[1])?o[0]:o[1]).toRed(this.red)}if(e.lambda)r=new i(e.lambda,16);else{var s=this._getEndoRoots(this.n);0===this.g.mul(s[0]).x.cmp(this.g.x.redMul(t))?r=s[0]:(r=s[1],a(0===this.g.mul(r).x.cmp(this.g.x.redMul(t))))}return n=e.basis?e.basis.map(function(e){return{a:new i(e.a,16),b:new i(e.b,16)}}):this._getEndoBasis(r),{beta:t,lambda:r,basis:n}}},c.prototype._getEndoRoots=function(e){var t=e===this.p?this.red:i.mont(e),r=new i(2).toRed(t).redInvm(),n=r.redNeg(),o=new i(3).toRed(t).redNeg().redSqrt().redMul(r);return[n.redAdd(o).fromRed(),n.redSub(o).fromRed()]},c.prototype._getEndoBasis=function(e){for(var t,r,n,o,s,a,c,u,l,d=this.n.ushrn(Math.floor(this.n.bitLength()/2)),f=e,h=this.n.clone(),p=new i(1),y=new i(0),g=new i(0),m=new i(1),b=0;0!==f.cmpn(0);){var v=h.div(f);u=h.sub(v.mul(f)),l=g.sub(v.mul(p));var w=m.sub(v.mul(y));if(!n&&0>u.cmp(d))t=c.neg(),r=p,n=u.neg(),o=l;else if(n&&2==++b)break;c=u,h=f,f=u,g=p,p=l,m=y,y=w}s=u.neg(),a=l;var _=n.sqr().add(o.sqr());return s.sqr().add(a.sqr()).cmp(_)>=0&&(s=t,a=r),n.negative&&(n=n.neg(),o=o.neg()),s.negative&&(s=s.neg(),a=a.neg()),[{a:n,b:o},{a:s,b:a}]},c.prototype._endoSplit=function(e){var t=this.endo.basis,r=t[0],n=t[1],i=n.b.mul(e).divRound(this.n),o=r.b.neg().mul(e).divRound(this.n),s=i.mul(r.a),a=o.mul(n.a),c=i.mul(r.b),u=o.mul(n.b);return{k1:e.sub(s).sub(a),k2:c.add(u).neg()}},c.prototype.pointFromX=function(e,t){(e=new i(e,16)).red||(e=e.toRed(this.red));var r=e.redSqr().redMul(e).redIAdd(e.redMul(this.a)).redIAdd(this.b),n=r.redSqrt();if(0!==n.redSqr().redSub(r).cmp(this.zero))throw Error("invalid point");var o=n.fromRed().isOdd();return(t&&!o||!t&&o)&&(n=n.redNeg()),this.point(e,n)},c.prototype.validate=function(e){if(e.inf)return!0;var t=e.x,r=e.y,n=this.a.redMul(t),i=t.redSqr().redMul(t).redIAdd(n).redIAdd(this.b);return 0===r.redSqr().redISub(i).cmpn(0)},c.prototype._endoWnafMulAdd=function(e,t,r){for(var n=this._endoWnafT1,i=this._endoWnafT2,o=0;o<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},o(u,s.BasePoint),c.prototype.point=function(e,t,r){return new u(this,e,t,r)},c.prototype.pointFromJSON=function(e,t){return u.fromJSON(this,e,t)},u.prototype._getBeta=function(){if(this.curve.endo){var e=this.prec
vendor: 8,222 bytes, line 30
30omputed;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}},u.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]},u.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},u.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)+">"},u.prototype.isInfinity=function(){return this.inf},u.prototype.add=function(e){if(this.inf)return e;if(e.inf)return this;if(this.eq(e))return this.dbl();if(this.neg().eq(e)||0===this.x.cmp(e.x))return this.curve.point(null,null);var t=this.y.redSub(e.y);0!==t.cmpn(0)&&(t=t.redMul(this.x.redSub(e.x).redInvm()));var r=t.redSqr().redISub(this.x).redISub(e.x),n=t.redMul(this.x.redSub(r)).redISub(this.y);return this.curve.point(r,n)},u.prototype.dbl=function(){if(this.inf)return this;var e=this.y.redAdd(this.y);if(0===e.cmpn(0))return this.curve.point(null,null);var t=this.curve.a,r=this.x.redSqr(),n=e.redInvm(),i=r.redAdd(r).redIAdd(r).redIAdd(t).redMul(n),o=i.redSqr().redISub(this.x.redAdd(this.x)),s=i.redMul(this.x.redSub(o)).redISub(this.y);return this.curve.point(o,s)},u.prototype.getX=function(){return this.x.fromRed()},u.prototype.getY=function(){return this.y.fromRed()},u.prototype.mul=function(e){return(e=new i(e,16),this.isInfinity())?this:this._hasDoubles(e)?this.curve._fixedNafMul(this,e):this.curve.endo?this.curve._endoWnafMulAdd([this],[e]):this.curve._wnafMul(this,e)},u.prototype.mulAdd=function(e,t,r){var n=[this,t],i=[e,r];return this.curve.endo?this.curve._endoWnafMulAdd(n,i):this.curve._wnafMulAdd(1,n,i,2)},u.prototype.jmulAdd=function(e,t,r){var n=[this,t],i=[e,r];return this.curve.endo?this.curve._endoWnafMulAdd(n,i,!0):this.curve._wnafMulAdd(1,n,i,2,!0)},u.prototype.eq=function(e){return this===e||this.inf===e.inf&&(this.inf||0===this.x.cmp(e.x)&&0===this.y.cmp(e.y))},u.prototype.neg=function(e){if(this.inf)return this;var t=this.curve.point(this.x,this.y.redNeg());if(e&&this.precomputed){var r=this.precomputed,n=function(e){return e.neg()};t.precomputed={naf:r.naf&&{wnd:r.naf.wnd,points:r.naf.points.map(n)},doubles:r.doubles&&{step:r.doubles.step,points:r.doubles.points.map(n)}}}return t},u.prototype.toJ=function(){return this.inf?this.curve.jpoint(null,null,null):this.curve.jpoint(this.x,this.y,this.curve.one)},o(l,s.BasePoint),c.prototype.jpoint=function(e,t,r){return new l(this,e,t,r)},l.prototype.toP=function(){if(this.isInfinity())return this.curve.point(null,null);var e=this.z.redInvm(),t=e.redSqr(),r=this.x.redMul(t),n=this.y.redMul(t).redMul(e);return this.curve.point(r,n)},l.prototype.neg=function(){return this.curve.jpoint(this.x,this.y.redNeg(),this.z)},l.prototype.add=function(e){if(this.isInfinity())return e;if(e.isInfinity())return this;var t=e.z.redSqr(),r=this.z.redSqr(),n=this.x.redMul(t),i=e.x.redMul(r),o=this.y.redMul(t.redMul(e.z)),s=e.y.redMul(r.redMul(this.z)),a=n.redSub(i),c=o.redSub(s);if(0===a.cmpn(0))return 0!==c.cmpn(0)?this.curve.jpoint(null,null,null):this.dbl();var u=a.redSqr(),l=u.redMul(a),d=n.redMul(u),f=c.redSqr().redIAdd(l).redISub(d).redISub(d),h=c.redMul(d.redISub(f)).redISub(o.redMul(l)),p=this.z.redMul(e.z).redMul(a);return this.curve.jpoint(f,h,p)},l.prototype.mixedAdd=function(e){if(this.isInfinity())return e.toJ();if(e.isInfinity())return this;var t=this.z.redSqr(),r=this.x,n=e.x.redMul(t),i=this.y,o=e.y.redMul(t).redMul(this.z),s=r.redSub(n),a=i.redSub(o);if(0===s.cmpn(0))return 0!==a.cmpn(0)?this.curve.jpoint(null,null,null):this.dbl();var c=s.redSqr(),u=c.redMul(s),l=r.redMul(c),d=a.redSqr().redIAdd(u).redISub(l).redISub(l),f=a.redMul(l.redISub(d)).redISub(i.redMul(u)),h=this.z.redMul(s);return this.curve.jpoint(d,f,h)},l.prototype.dblp=function(e){if(0===e||this.isInfinity())return this;if(!e)return this.dbl();if(this.curve.zeroA||this.curve.threeA){var t,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(),d=u.redSqr(),f=d.redSqr(),h=l.redAdd(l).redIAdd(l).redIAdd(n.redMul(c)),p=o.redMul(d),y=h.redSqr().redISub(p.redAdd(p)),g=p.redISub(y),m=h.redMul(g);m=m.redIAdd(m).redISub(f);var b=u.redMul(a);t+1<e&&(c=c.redMul(f)),o=y,a=b,u=m}return this.curve.jpoint(o,u.redMul(i),a)},l.prototype.dbl=function(){return this.isInfinity()?this:this.curve.zeroA?this._zeroDbl():this.curve.threeA?this._threeDbl():this._dbl()},l.prototype._zeroDbl=function(){if(this.zOne){var e,t,r,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(),d=this.y.redSqr(),f=d.redSqr(),h=this.x.redAdd(d).redSqr().redISub(l).redISub(f);h=h.redIAdd(h);var p=l.redAdd(l).redIAdd(l),y=p.redSqr(),g=f.redIAdd(f);g=(g=g.redIAdd(g)).redIAdd(g),e=y.redISub(h).redISub(h),t=p.redMul(h.redISub(e)).redISub(g),r=(r=this.y.redMul(this.z)).redIAdd(r)}return this.curve.jpoint(e,t,r)},l.prototype._threeDbl=function(){if(this.zOne){var e,t,r,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(),d=this.y.redSqr(),f=this.x.redMul(d),h=this.x.redSub(l).redMul(this.x.redAdd(l));h=h.redAdd(h).redIAdd(h);var p=f.redIAdd(f),y=(p=p.redIAdd(p)).redAdd(p);e=h.redSqr().redISub(y),r=this.y.redAdd(this.z).redSqr().redISub(d).redISub(l);var g=d.redSqr();g=(g=(g=g.redIAdd(g)).redIAdd(g)).redIAdd(g),t=h.redMul(p.redISub(e)).redISub(g)}return this.curve.jpoint(e,t,r)},l.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)),d=u.redISub(l),f=s.redSqr();f=(f=(f=f.redIAdd(f)).redIAdd(f)).redIAdd(f);var h=a.redMul(d).redISub(f),p=r.redAdd(r).redMul(n);return this.curve.jpoint(l,h,p)},l.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 d=this.x.redMul(a).redISub(l);d=(d=d.redIAdd(d)).redIAdd(d);var f=this.y.redMul(u.redMul(c.redISub(u)).redISub(s.redMul(a)));f=(f=(f=f.redIAdd(f)).redIAdd(f)).redIAdd(f);var h=this.z.redAdd(s).redSqr().redISub(r).redISub(a);return this.curve.jpoint(d,f,h)},l.prototype.mul=function(e,t){return e=new i(e,t),this.curve._wnafMul(this,e)},l.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)}
vendor: 5,346 bytes, line 30
30,l.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}},l.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)+">"},l.prototype.isInfinity=function(){return 0===this.z.cmpn(0)}},18728:(e,t,r)=>{"use strict";var n,i=t,o=r(67432),s=r(34560),a=r(71929).assert;function c(e){"short"===e.type?this.curve=new s.short(e):"edwards"===e.type?this.curve=new s.edwards(e):this.curve=new s.mont(e),this.g=this.curve.g,this.n=this.curve.n,this.hash=e.hash,a(this.g.validate(),"Invalid curve"),a(this.g.mul(this.n).isInfinity(),"Invalid curve, G*N != O")}function u(e,t){Object.defineProperty(i,e,{configurable:!0,enumerable:!0,get:function(){var r=new c(t);return Object.defineProperty(i,e,{configurable:!0,enumerable:!0,value:r}),r}})}i.PresetCurve=c,u("p192",{type:"short",prime:"p192",p:"ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff",a:"ffffffff ffffffff ffffffff fffffffe ffffffff fffffffc",b:"64210519 e59c80e7 0fa7e9ab 72243049 feb8deec c146b9b1",n:"ffffffff ffffffff ffffffff 99def836 146bc9b1 b4d22831",hash:o.sha256,gRed:!1,g:["188da80e b03090f6 7cbf20eb 43a18800 f4ff0afd 82ff1012","07192b95 ffc8da78 631011ed 6b24cdd5 73f977a1 1e794811"]}),u("p224",{type:"short",prime:"p224",p:"ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001",a:"ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff fffffffe",b:"b4050a85 0c04b3ab f5413256 5044b0b7 d7bfd8ba 270b3943 2355ffb4",n:"ffffffff ffffffff ffffffff ffff16a2 e0b8f03e 13dd2945 5c5c2a3d",hash:o.sha256,gRed:!1,g:["b70e0cbd 6bb4bf7f 321390b9 4a03c1d3 56c21122 343280d6 115c1d21","bd376388 b5f723fb 4c22dfe6 cd4375a0 5a074764 44d58199 85007e34"]}),u("p256",{type:"short",prime:null,p:"ffffffff 00000001 00000000 00000000 00000000 ffffffff ffffffff ffffffff",a:"ffffffff 00000001 00000000 00000000 00000000 ffffffff ffffffff fffffffc",b:"5ac635d8 aa3a93e7 b3ebbd55 769886bc 651d06b0 cc53b0f6 3bce3c3e 27d2604b",n:"ffffffff 00000000 ffffffff ffffffff bce6faad a7179e84 f3b9cac2 fc632551",hash:o.sha256,gRed:!1,g:["6b17d1f2 e12c4247 f8bce6e5 63a440f2 77037d81 2deb33a0 f4a13945 d898c296","4fe342e2 fe1a7f9b 8ee7eb4a 7c0f9e16 2bce3357 6b315ece cbb64068 37bf51f5"]}),u("p384",{type:"short",prime:null,p:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe ffffffff 00000000 00000000 ffffffff",a:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe ffffffff 00000000 00000000 fffffffc",b:"b3312fa7 e23ee7e4 988e056b e3f82d19 181d9c6e fe814112 0314088f 5013875a c656398d 8a2ed19d 2a85c8ed d3ec2aef",n:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff c7634d81 f4372ddf 581a0db2 48b0a77a ecec196a ccc52973",hash:o.sha384,gRed:!1,g:["aa87ca22 be8b0537 8eb1c71e f320ad74 6e1d3b62 8ba79b98 59f741e0 82542a38 5502f25d bf55296c 3a545e38 72760ab7","3617de4a 96262c6f 5d9e98bf 9292dc29 f8f41dbd 289a147c e9da3113 b5f0b8c0 0a60b1ce 1d7e819d 7a431d7c 90ea0e5f"]}),u("p521",{type:"short",prime:null,p:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff",a:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffc",b:"00000051 953eb961 8e1c9a1f 929a21a0 b68540ee a2da725b 99b315f3 b8b48991 8ef109e1 56193951 ec7e937b 1652c0bd 3bb1bf07 3573df88 3d2c34f1 ef451fd4 6b503f00",n:"000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffa 51868783 bf2f966b 7fcc0148 f709a5d0 3bb5c9b8 899c47ae bb6fb71e 91386409",hash:o.sha512,gRed:!1,g:["000000c6 858e06b7 0404e9cd 9e3ecb66 2395b442 9c648139 053fb521 f828af60 6b4d3dba a14b5e77 efe75928 fe1dc127 a2ffa8de 3348b3c1 856a429b f97e7e31 c2e5bd66","00000118 39296a78 9a3bc004 5c8a5fb4 2c7d1bd9 98f54449 579b4468 17afbd17 273e662c 97ee7299 5ef42640 c550b901 3fad0761 353c7086 a272c240 88be9476 9fd16650"]}),u("curve25519",{type:"mont",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"76d06",b:"1",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:o.sha256,gRed:!1,g:["9"]}),u("ed25519",{type:"edwards",prime:"p25519",p:"7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed",a:"-1",c:"1",d:"52036cee2b6ffe73 8cc740797779e898 00700a4d4141d8ab 75eb4dca135978a3",n:"1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed",hash:o.sha256,gRed:!1,g:["216936d3cd6e53fec0a4e231fdd6dc5c692cc7609525a7b2c9562d608f25d51a","6666666666666666666666666666666666666666666666666666666666666658"]});try{n=r(84929)}catch(e){n=void 0}u("secp256k1",{type:"short",prime:"k256",p:"ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f",a:"0",b:"7",n:"ffffffff ffffffff ffffffff fffffffe baaedce6 af48a03b bfd25e8c d0364141",h:"1",hash:o.sha256,beta:"7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee",lambda:"5363ad4cc05c30e0a5261c028812645a122e22ea20816678df02967c1b23bd72",basis:[{a:"3086d221a7d46bcde86c90e49284eb15",b:"-e4437ed6010e88286f547fa90abfe4c3"}
vendor: 10,653 bytes, line 30
30,{a:"114ca50f7a8e2f3f657c1108d9d44cfd8",b:"3086d221a7d46bcde86c90e49284eb15"}],gRed:!1,g:["79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798","483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8",n]})},28691:(e,t,r)=>{"use strict";var n=r(67874),i=r(16205),o=r(71929),s=r(18728),a=r(53607),c=o.assert,u=r(77020),l=r(23621);function d(e){if(!(this instanceof d))return new d(e);"string"==typeof e&&(c(Object.prototype.hasOwnProperty.call(s,e),"Unknown curve "+e),e=s[e]),e instanceof s.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}e.exports=d,d.prototype.keyPair=function(e){return new u(this,e)},d.prototype.keyFromPrivate=function(e,t){return u.fromPrivate(this,e,t)},d.prototype.keyFromPublic=function(e,t){return u.fromPublic(this,e,t)},d.prototype.genKeyPair=function(e){e||(e={});for(var t=new i({hash:this.hash,pers:e.pers,persEnc:e.persEnc||"utf8",entropy:e.entropy||a(this.hash.hmacStrength),entropyEnc:e.entropy&&e.entropyEnc||"utf8",nonce:this.n.toArray()}),r=this.n.byteLength(),o=this.n.sub(new n(2));;){var s=new n(t.generate(r));if(!(s.cmp(o)>0))return s.iaddn(1),this.keyFromPrivate(s)}},d.prototype._truncateToN=function(e,t,r){if(n.isBN(e)||"number"==typeof e)i=(e=new n(e,16)).byteLength();else if("object"==typeof e)i=e.length,e=new n(e,16);else{var i,o=e.toString();i=o.length+1>>>1,e=new n(o,16)}"number"!=typeof r&&(r=8*i);var s=r-this.n.bitLength();return(s>0&&(e=e.ushrn(s)),!t&&e.cmp(this.n)>=0)?e.sub(this.n):e},d.prototype.sign=function(e,t,r,o){if("object"==typeof r&&(o=r,r=null),o||(o={}),"string"!=typeof e&&"number"!=typeof e&&!n.isBN(e)){c("object"==typeof e&&e&&"number"==typeof e.length,"Expected message to be an array-like, a hex string, or a BN instance"),c(e.length>>>0===e.length);for(var s=0;s<e.length;s++)c((255&e[s])===e[s])}t=this.keyFromPrivate(t,r),c(!(e=this._truncateToN(e,!1,o.msgBitLength)).isNeg(),"Can not sign a negative message");var a=this.n.byteLength(),u=t.getPrivate().toArray("be",a),d=e.toArray("be",a);c(new n(d).eq(e),"Can not sign message");for(var f=new i({hash:this.hash,entropy:u,nonce:d,pers:o.pers,persEnc:o.persEnc||"utf8"}),h=this.n.sub(new n(1)),p=0;;p++){var y=o.k?o.k(p):new n(f.generate(this.n.byteLength()));if(!(0>=(y=this._truncateToN(y,!0)).cmpn(1)||y.cmp(h)>=0)){var g=this.g.mul(y);if(!g.isInfinity()){var m=g.getX(),b=m.umod(this.n);if(0!==b.cmpn(0)){var v=y.invm(this.n).mul(b.mul(t.getPrivate()).iadd(e));if(0!==(v=v.umod(this.n)).cmpn(0)){var w=(g.getY().isOdd()?1:0)|(0!==m.cmp(b)?2:0);return o.canonical&&v.cmp(this.nh)>0&&(v=this.n.sub(v),w^=1),new l({r:b,s:v,recoveryParam:w})}}}}}},d.prototype.verify=function(e,t,r,n,i){i||(i={}),e=this._truncateToN(e,!1,i.msgBitLength),r=this.keyFromPublic(r,n);var o,s=(t=new l(t,"hex")).r,a=t.s;if(0>s.cmpn(1)||s.cmp(this.n)>=0||0>a.cmpn(1)||a.cmp(this.n)>=0)return!1;var c=a.invm(this.n),u=c.mul(e).umod(this.n),d=c.mul(s).umod(this.n);return this.curve._maxwellTrick?!(o=this.g.jmulAdd(u,r.getPublic(),d)).isInfinity()&&o.eqXToP(s):!(o=this.g.mulAdd(u,r.getPublic(),d)).isInfinity()&&0===o.getX().umod(this.n).cmp(s)},d.prototype.recoverPubKey=function(e,t,r,i){c((3&r)===r,"The recovery param is more than two bits"),t=new l(t,i);var o=this.n,s=new n(e),a=t.r,u=t.s,d=1&r,f=r>>1;if(a.cmp(this.curve.p.umod(this.curve.n))>=0&&f)throw Error("Unable to find sencond key candinate");a=f?this.curve.pointFromX(a.add(this.curve.n),d):this.curve.pointFromX(a,d);var h=t.r.invm(o),p=o.sub(s).mul(h).umod(o),y=u.mul(h).umod(o);return this.g.mulAdd(p,a,y)},d.prototype.getKeyRecoveryParam=function(e,t,r,n){if(null!==(t=new l(t,n)).recoveryParam)return t.recoveryParam;for(var i,o=0;o<4;o++){try{i=this.recoverPubKey(e,t,o)}catch(e){continue}if(i.eq(r))return o}throw Error("Unable to find valid recovery factor")}},77020:(e,t,r)=>{"use strict";var n=r(67874),i=r(71929).assert;function o(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)}e.exports=o,o.fromPublic=function(e,t,r){return t instanceof o?t:new o(e,{pub:t,pubEnc:r})},o.fromPrivate=function(e,t,r){return t instanceof o?t:new o(e,{priv:t,privEnc:r})},o.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"}},o.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},o.prototype.getPrivate=function(e){return"hex"===e?this.priv.toString(16,2):this.priv},o.prototype._importPrivate=function(e,t){this.priv=new n(e,t||16),this.priv=this.priv.umod(this.ec.curve.n)},o.prototype._importPublic=function(e,t){if(e.x||e.y){"mont"===this.ec.curve.type?i(e.x,"Need x coordinate"):("short"===this.ec.curve.type||"edwards"===this.ec.curve.type)&&i(e.x&&e.y,"Need both x and y coordinate"),this.pub=this.ec.curve.point(e.x,e.y);return}this.pub=this.ec.curve.decodePoint(e,t)},o.prototype.derive=function(e){return e.validate()||i(e.validate(),"public point not validated"),e.mul(this.priv).getX()},o.prototype.sign=function(e,t,r){return this.ec.sign(e,this,t,r)},o.prototype.verify=function(e,t,r){return this.ec.verify(e,t,this,void 0,r)},o.prototype.inspect=function(){return"<Key priv: "+(this.priv&&this.priv.toString(16,2))+" pub: "+(this.pub&&this.pub.inspect())+" >"}},23621:(e,t,r)=>{"use strict";var n=r(67874),i=r(71929),o=i.assert;function s(e,t){if(e instanceof s)return e;this._importDER(e,t)||(o(e.r&&e.s,"Signature without r or s"),this.r=new n(e.r,16),this.s=new n(e.s,16),void 0===e.recoveryParam?this.recoveryParam=null:this.recoveryParam=e.recoveryParam)}function a(){this.place=0}function c(e,t){var r=e[t.place++];if(!(128&r))return r;var n=15&r;if(0===n||n>4||0===e[t.place])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 u(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 l(e,t){if(t<128){e.push(t);return}var r=1+(Math.log(t)/Math.LN2>>>3);for(e.push(128|r);--r;)e.push(t>>>(r<<3)&255);e.push(t)}e.exports=s,s.prototype._importDER=function(e,t){e=i.toArray(e,t);var r=new a;if(48!==e[r.place++])return!1;var o=c(e,r);if(!1===o||o+r.place!==e.length||2!==e[r.place++])return!1;var s=c(e,r);if(!1===s||(128&e[r.place])!=0)return!1;var u=e.slice(r.place,s+r.place);if(r.place+=s,2!==e[r.place++])return!1;var l=c(e,r);if(!1===l||e.length!==l+r.place||(128&e[r.place])!=0)return!1;var d=e.slice(r.place,l+r.place);if(0===u[0]){if(!(128&u[1]))return!1;u=u.slice(1)}if(0===d[0]){if(!(128&d[1]))return!1;d=d.slice(1)}return this.r=new n(u),this.s=new n(d),this.recoveryParam=null,!0},s.prototype.toDER=function(e){var t=this.r.toArray(),r=this.s.toArray();for(128&t[0]&&(t=[0].concat(t)),128&r[0]&&(r=[0].concat(r)),t=u(t),r=u(r);!r[0]&&!(128&r[1]);)r=r.slice(1);var n=[2];l(n,t.length),(n=n.concat(t)).push(2),l(n,r.length);var o=n.concat(r),s=[48];return l(s,o.length),s=s.concat(o),i.encode(s,e)}},79324:(e,t,r)=>{"use strict";var n=r(67432),i=r(18728),o=r(71929),s=o.assert,a=o.parseBytes,c=r(623),u=r(72562);function l(e){if(s("ed25519"===e,"only tested with ed25519 so far"),!(this instanceof l))return new l(e);e=i[e].curve,this.curve=e,this.g=e.g,this.g.precompute(e.n.bitLength()+1),this.pointClass=e.point().constructor,this.encodingLength=Math.ceil(e.n.bitLength()/8),this.hash=n.sha512}e.exports=l,l.prototype.sign=function(e,t){e=a(e);var r=this.keyFromSecret(t),n=this.hashInt(r.messagePrefix(),e),i=this.g.mul(n),o=this.encodePoint(i),s=this.hashInt(o,r.pubBytes(),e).mul(r.priv()),c=n.add(s).umod(this.curve.n);return this.makeSignature({R:i,S:c,Rencoded:o})},l.prototype.verify=function(e,t,r){if(e=a(e),(t=this.makeSignature(t)).S().gte(t.eddsa.curve.n)||t.S().isNeg())return!1;var n=this.keyFromPublic(r),i=this.hashInt(t.Rencoded(),n.pubBytes(),e),o=this.g.mul(t.S());return t.R().add(n.pub().mul(i)).eq(o)},l.prototype.hashInt=function(){for(var e=this.hash(),t=0;t<arguments.length;t++)e.update(arguments[t]);return o.intFromLE(e.digest()).umod(this.curve.n)},l.prototype.keyFromPublic=function(e){return c.fromPublic(this,e)},l.prototype.keyFromSecret=function(e){return c.fromSecret(this,e)},l.prototype.makeSignature=function(e){return e instanceof u?e:new u(this,e)},l.prototype.encodePoint=function(e){var t=e.getY().toArray("le",this.encodingLength);return t[this.encodingLength-1]|=e.getX().isOdd()?128:0,t},l.prototype.decodePoint=function(e){var t=(e=o.parseBytes(e)).length-1,r=e.slice(0,t).concat(-129&e[t]),n=(128&e[t])!=0,i=o.intFromLE(r);return this.curve.pointFromY(i,n)},l.prototype.encodeInt=function(e){return e.toArray("le",this.encodingLength)},l.prototype.decodeInt=function(e){return o.intFromLE(e)},l.prototype.isPoint=function(e){return e instanceof this.pointClass}},623:(e,t,r)=>{"use strict";var n=r(71929),i=n.assert,o=n.parseBytes,s=n.cachedProperty;function a(e,t){this.eddsa=e,this._secret=o(t.secret),e.isPoint(t.pub)?this._pub=t.pub:this._pubBytes=o(t.pub)}a.fromPublic=function(e,t){return t instanceof a?t:new a(e,{pub:t})},a.fromSecret=function(e,t){return t instanceof a?t:new a(e,{secret:t})},a.prototype.secret=function(){return this._secret},s(a,"pubBytes",function(){return this.eddsa.encodePoint(this.pub())}),s(a,"pub",function(){return this._pubBytes?this.eddsa.decodePoint(this._pubBytes):this.eddsa.g.mul(this.priv())}),s(a,"privBytes",function(){var e=this.eddsa,t=this.hash(),r=e.encodingLength-1,n=t.slice(0,e.encodingLength);return n[0]&=248,n[r]&=127,n[r]|=64,n}),s(a,"priv",function(){return this.eddsa.decodeInt(this.privBytes())}),s(a,"hash",function(){return this.eddsa.hash().update(this.secret()).digest()}),s(a,"messagePrefix",function(){return this.hash().slice(this.eddsa.encodingLength)}),a.prototype.sign=function(e){return i(this._secret,"KeyPair can only verify"),this.eddsa.sign(e,this)},a.prototype.verify=function(e,t){return this.eddsa.verify(e,t,this)},a.prototype.getSecret=function(e){return i(this._secret,"KeyPair is public only"),n.encode(this.secret(),e)},a.prototype.getPublic=function(e){return n.encode(this.pubBytes(),e)},e.exports=a},72562:(e,t,r)=>{"use strict";var n=r(67874),i=r(71929),o=i.assert,s=i.cachedProperty,a=i.parseBytes;function c(e,t){this.eddsa=e,"object"!=typeof t&&(t=a(t)),Array.isArray(t)&&(o(t.length===2*e.encodingLength,"Signature has invali
30d size"),t={R:t.slice(0,e.encodingLength),S:t.slice(e.encodingLength)}),o(t.R&&t.S,"Signature without R or S"),e.isPoint(t.R)&&(this._R=t.R),t.S instanceof n&&(this._S=t.S),this._Rencoded=Array.isArray(t.R)?t.R:t.Rencoded,this._Sencoded=Array.isArray(t.S)?t.S:t.Sencoded}s(c,"S",function(){return this.eddsa.decodeInt(this.Sencoded())}),s(c,"R",function(){return this.eddsa.decodePoint(this.Rencoded())}),s(c,"Rencoded",function(){return this.eddsa.encodePoint(this.R())}),s(c,"Sencoded",function(){return this.eddsa.encodeInt(this.S())}),c.prototype.toBytes=function(){return this.Rencoded().concat(this.Sencoded())},c.prototype.toHex=function(){return i.encode(this.toBytes(),"hex").toUpperCase()},e.exports=c},84929:e=>
vendor: 26,139 bytes, line 30
30{e.exports={doubles:{step:4,points:[["e60fce93b59e9ec53011aabc21c23e97b2a31369b87a5ae9c44ee89e2a6dec0a","f7e3507399e595929db99f34f57937101296891e44d23f0be1f32cce69616821"],["8282263212c609d9ea2a6e3e172de238d8c39cabd5ac1ca10646e23fd5f51508","11f8a8098557dfe45e8256e830b60ace62d613ac2f7b17bed31b6eaff6e26caf"],["175e159f728b865a72f99cc6c6fc846de0b93833fd2222ed73fce5b551e5b739","d3506e0d9e3c79eba4ef97a51ff71f5eacb5955add24345c6efa6ffee9fed695"],["363d90d447b00c9c99ceac05b6262ee053441c7e55552ffe526bad8f83ff4640","4e273adfc732221953b445397f3363145b9a89008199ecb62003c7f3bee9de9"],["8b4b5f165df3c2be8c6244b5b745638843e4a781a15bcd1b69f79a55dffdf80c","4aad0a6f68d308b4b3fbd7813ab0da04f9e336546162ee56b3eff0c65fd4fd36"],["723cbaa6e5db996d6bf771c00bd548c7b700dbffa6c0e77bcb6115925232fcda","96e867b5595cc498a921137488824d6e2660a0653779494801dc069d9eb39f5f"],["eebfa4d493bebf98ba5feec812c2d3b50947961237a919839a533eca0e7dd7fa","5d9a8ca3970ef0f269ee7edaf178089d9ae4cdc3a711f712ddfd4fdae1de8999"],["100f44da696e71672791d0a09b7bde459f1215a29b3c03bfefd7835b39a48db0","cdd9e13192a00b772ec8f3300c090666b7ff4a18ff5195ac0fbd5cd62bc65a09"],["e1031be262c7ed1b1dc9227a4a04c017a77f8d4464f3b3852c8acde6e534fd2d","9d7061928940405e6bb6a4176597535af292dd419e1ced79a44f18f29456a00d"],["feea6cae46d55b530ac2839f143bd7ec5cf8b266a41d6af52d5e688d9094696d","e57c6b6c97dce1bab06e4e12bf3ecd5c981c8957cc41442d3155debf18090088"],["da67a91d91049cdcb367be4be6ffca3cfeed657d808583de33fa978bc1ec6cb1","9bacaa35481642bc41f463f7ec9780e5dec7adc508f740a17e9ea8e27a68be1d"],["53904faa0b334cdda6e000935ef22151ec08d0f7bb11069f57545ccc1a37b7c0","5bc087d0bc80106d88c9eccac20d3c1c13999981e14434699dcb096b022771c8"],["8e7bcd0bd35983a7719cca7764ca906779b53a043a9b8bcaeff959f43ad86047","10b7770b2a3da4b3940310420ca9514579e88e2e47fd68b3ea10047e8460372a"],["385eed34c1cdff21e6d0818689b81bde71a7f4f18397e6690a841e1599c43862","283bebc3e8ea23f56701de19e9ebf4576b304eec2086dc8cc0458fe5542e5453"],["6f9d9b803ecf191637c73a4413dfa180fddf84a5947fbc9c606ed86c3fac3a7","7c80c68e603059ba69b8e2a30e45c4d47ea4dd2f5c281002d86890603a842160"],["3322d401243c4e2582a2147c104d6ecbf774d163db0f5e5313b7e0e742d0e6bd","56e70797e9664ef5bfb019bc4ddaf9b72805f63ea2873af624f3a2e96c28b2a0"],["85672c7d2de0b7da2bd1770d89665868741b3f9af7643397721d74d28134ab83","7c481b9b5b43b2eb6374049bfa62c2e5e77f17fcc5298f44c8e3094f790313a6"],["948bf809b1988a46b06c9f1919413b10f9226c60f668832ffd959af60c82a0a","53a562856dcb6646dc6b74c5d1c3418c6d4dff08c97cd2bed4cb7f88d8c8e589"],["6260ce7f461801c34f067ce0f02873a8f1b0e44dfc69752accecd819f38fd8e8","bc2da82b6fa5b571a7f09049776a1ef7ecd292238051c198c1a84e95b2b4ae17"],["e5037de0afc1d8d43d8348414bbf4103043ec8f575bfdc432953cc8d2037fa2d","4571534baa94d3b5f9f98d09fb990bddbd5f5b03ec481f10e0e5dc841d755bda"],["e06372b0f4a207adf5ea905e8f1771b4e7e8dbd1c6a6c5b725866a0ae4fce725","7a908974bce18cfe12a27bb2ad5a488cd7484a7787104870b27034f94eee31dd"],["213c7a715cd5d45358d0bbf9dc0ce02204b10bdde2a3f58540ad6908d0559754","4b6dad0b5ae462507013ad06245ba190bb4850f5f36a7eeddff2c27534b458f2"],["4e7c272a7af4b34e8dbb9352a5419a87e2838c70adc62cddf0cc3a3b08fbd53c","17749c766c9d0b18e16fd09f6def681b530b9614bff7dd33e0b3941817dcaae6"],["fea74e3dbe778b1b10f238ad61686aa5c76e3db2be43057632427e2840fb27b6","6e0568db9b0b13297cf674deccb6af93126b596b973f7b77701d3db7f23cb96f"],["76e64113f677cf0e10a2570d599968d31544e179b760432952c02a4417bdde39","c90ddf8dee4e95cf577066d70681f0d35e2a33d2b56d2032b4b1752d1901ac01"],["c738c56b03b2abe1e8281baa743f8f9a8f7cc643df26cbee3ab150242bcbb891","893fb578951ad2537f718f2eacbfbbbb82314eef7880cfe917e735d9699a84c3"],["d895626548b65b81e264c7637c972877d1d72e5f3a925014372e9f6588f6c14b","febfaa38f2bc7eae728ec60818c340eb03428d632bb067e179363ed75d7d991f"],["b8da94032a957518eb0f6433571e8761ceffc73693e84edd49150a564f676e03","2804dfa44805a1e4d7c99cc9762808b092cc584d95ff3b511488e4e74efdf6e7"],["e80fea14441fb33a7d8adab9475d7fab2019effb5156a792f1a11778e3c0df5d","eed1de7f638e00771e89768ca3ca94472d155e80af322ea9fcb4291b6ac9ec78"],["a301697bdfcd704313ba48e51d567543f2a182031efd6915ddc07bbcc4e16070","7370f91cfb67e4f5081809fa25d40f9b1735dbf7c0a11a130c0d1a041e177ea1"],["90ad85b389d6b936463f9d0512678de208cc330b11307fffab7ac63e3fb04ed4","e507a3620a38261affdcbd9427222b839aefabe1582894d991d4d48cb6ef150"],["8f68b9d2f63b5f339239c1ad981f162ee88c5678723ea3351b7b444c9ec4c0da","662a9f2dba063986de1d90c2b6be215dbbea2cfe95510bfdf23cbf79501fff82"],["e4f3fb0176af85d65ff99ff9198c36091f48e86503681e3e6686fd5053231e11","1e63633ad0ef4f1c1661a6d0ea02b7286cc7e74ec951d1c9822c38576feb73bc"],["8c00fa9b18ebf331eb961537a45a4266c7034f2f0d4e1d0716fb6eae20eae29e","efa47267fea521a1a9dc343a3736c974c2fadafa81e36c54e7d2a4c66702414b"],["e7a26ce69dd4829f3e10cec0a9e98ed3143d084f308b92c0997fddfc60cb3e41","2a758e300fa7984b471b006a1aafbb18d0a6b2c0420e83e20e8a9421cf2cfd51"],["b6459e0ee3662ec8d23540c223bcbdc571cbcb967d79424f3cf29eb3de6b80ef","67c876d06f3e06de1dadf16e5661db3c4b3ae6d48e35b2ff30bf0b61a71ba45"],["d68a80c8280bb840793234aa118f06231d6f1fc67e73c5a5deda0f5b496943e8","db8ba9fff4b586d00c4b1f9177b0e28b5b0e7b8f7845295a294c84266b133120"],["324aed7df65c804252dc0270907a30b09612aeb973449cea4095980fc28d3d5d","648a365774b61f2ff130c0c35aec1f4f19213b0c7e332843967224af96ab7c84"],["4df9c14919cde61f6d51dfdbe5fee5dceec4143ba8d1ca888e8bd373fd054c96","35ec51092d8728050974c23a1d85d4b5d506cdc288490192ebac06cad10d5d"],["9c3919a84a474870faed8a9c1cc66021523489054d7f0308cbfc99c8ac1f98cd","ddb84f0f4a4ddd57584f044bf260e641905326f76c64c8e6be7e5e03d4fc599d"],["6057170b1dd12fdf8de05f281d8e06bb91e1493a8b91d4cc5a21382120a959e5","9a1af0b26a6a4807add9a2daf71df262465152bc3ee24c65e899be932385a2a8"],["a576df8e23a08411421439a4518da31880cef0fba7d4df12b1a6973eecb94266","40a6bf20e76640b2c92b97afe58cd82c432e10a7f514d9f3ee8be11ae1b28ec8"],["7778a78c28dec3e30a05fe9629de8c38bb30d1f5cf9a3a208f763889be58ad71","34626d9ab5a5b22ff7098e12f2ff580087b38411ff24ac563b513fc1fd9f43ac"],["928955ee637a84463729fd30e7afd2ed5f96274e5ad7e5cb09eda9c06d903ac","c25621003d3f42a827b78a13093a95eeac3d26efa8a8d83fc5180e935bcd091f"],["85d0fef3ec6db109399064f3a0e3b2855645b4a907ad354527aae75163d82751","1f03648413a38c0be29d496e582cf5663e8751e96877331582c237a24eb1f962"],["ff2b0dce97eece97c1c9b6041798b85dfdfb6d8882da20308f5404824526087e","493d13fef524ba188af4c4dc54d07936c7b7ed6fb90e2ceb2c951e01f0c29907"],["827fbbe4b1e880ea9ed2b2e6301b212b57f1ee148cd6dd28780e5e2cf856e241","c60f9c923c727b0b71bef2c67d1d12687ff7a63186903166d605b68baec293ec"],["eaa649f21f51bdbae7be4ae34ce6e5217a58fdce7f47f9aa7f3b58fa2120e2b3","be3279ed5bbbb03ac69a80f89879aa5a01a6b965f13f7e59d47a5305ba5ad93d"],["e4a42d43c5cf169d9391df6decf42ee541b6d8f0c9a137401e23632dda34d24f","4d9f92e716d1c73526fc99ccfb8ad34ce886eedfa8d8e4f13a7f7131deba9414"],["1ec80fef360cbdd954160fadab352b6b92b53576a88fea4947173b9d4300bf19","aeefe93756b5340d2f3a4958a7abbf5e0146e77f6295a07b671cdc1cc107cefd"],["146a778c04670c2f91b00af4680dfa8bce3490717d58ba889ddb5928366642be","b318e0ec3354028add669827f9d4b2870aaa971d2f7e5ed1d0b297483d83efd0"],["fa50c0f61d22e5f07e3acebb1aa07b128d0012209a28b9776d76a8793180eef9","6b84c6922397eba9b72cd2872281a68a5e683293a57a213b38cd8d7d3f4f2811"],["da1d61d0ca721a11b1a5bf6b7d88e8421a288ab5d5bba5220e53d32b5f067ec2","8157f55a7c99306c79c0766161c91e2966a73899d279b48a655fba0f1ad836f1"],["a8e282ff0c9706907215ff98e8fd416615311de0446f1e062a73b0610d064e13","7f97355b8db81c09abfb7f3c5b2515888b679a3e50dd6bd6cef7c73111f4cc0c"],["174a53b9c9a285872d39e56e6913cab15d59b1fa512508c022f382de8319497c","ccc9dc37abfc9c1657b4155f2c47f9e6646b3a1d8cb9854383da13ac079afa73"],["959396981943785c3d3e57edf5018cdbe039e730e4918b3d884fdff09475b7ba","2e7e552888c331dd8ba0386a4b9cd6849c653f64c8709385e9b8abf87524f2fd"],["d2a63a50ae401e56d645a1153b109a8fcca0a43d561fba2dbb51340c9d82b151","e82d86fb6443fcb7565aee58b2948220a70f750af484ca52d4142174dcf89405"],["64587e2335471eb890ee7896d7cfdc866bacbdbd3839317b3436f9b45617e073","d99fcdd5bf6902e2ae96dd6447c299a185b90a39133aeab358299e5e9faf6589"],["8481bde0e4e4d885b3a546d3e549de042f0aa6cea250e7fd358d6c86dd45e458","38ee7b8cba5404dd84a25bf39cecb2ca900a79c42b262e556d64b1b59779057e"],["13464a57a78102aa62b6979ae817f4637ffcfed3c4b1ce30bcd6303f6caf666b","69be159004614580ef7e433453ccb0ca48f300a81d0942e13f495a907f6ecc27"],["bc4a9df5b713fe2e9aef430bcc1dc97a0cd9ccede2f28588cada3a0d2d83f366","d3a81ca6e785c06383937adf4b798caa6e8a9fbfa547b16d758d666581f33c1"],["8c28a97bf8298bc0d23d8c749452a32e694b65e30a9472a3954ab30fe5324caa","40a30463a3305193378fedf31f7cc0eb7ae784f0451cb9459e71dc73cbef9482"],["8ea9666139527a8c1dd94ce4f071fd23c8b350c5a4bb33748c4ba111faccae0","620efabbc8ee2782e24e7c0cfb95c5d735b783be9cf0f8e955af34a30e62b945"],["dd3625faef5ba06074669716bbd3788d89bdde815959968092f76cc4eb9a9787","7a188fa3520e30d461da2501045731ca941461982883395937f68d00c644a573"],["f710d79d9eb962297e4f6232b40e8f7feb2bc63814614d692c12de752408221e","ea98e67232d3b3295d3b535532115ccac8612c721851617526ae47a9c77bfc82"]]},naf:{wnd:7,points:[["f9308a019258c31049344f85f89d5229b531c845836f99b08601f113bce036f9","388f7b0f632de8140fe337e62a37f3566500a99934c2231b6cb9fd7584b8e672"],["2f8bde4d1a07209355b4a7250a5c5128e88b84bddc619ab7cba8d569b240efe4","d8ac222636e5e3d6d4dba9dda6c9c426f788271bab0d6840dca87d3aa6ac62d6"],["5cbdf0646e5db4eaa398f365f2ea7a0e3d419b7e0330e39ce92bddedcac4f9bc","6aebca40ba255960a3178d6d861a54dba813d0b813fde7b5a5082628087264da"],["acd484e2f0c7f65309ad178a9f559abde09796974c57e714c35f110dfc27ccbe","cc338921b0a7d9fd64380971763b61e9add888a4375f8e0f05cc262ac64f9c37"],["774ae7f858a9411e5ef4246b70c65aac5649980be5c17891bbec17895da008cb","d984a032eb6b5e190243dd56d7b7b365372db1e2dff9d6a8301d74c9c953c61b"],["f28773c2d975288bc7d1d205c3748651b075fbc6610e58cddeeddf8f19405aa8","ab0902e8d880a89758212eb65cdaf473a1a06da521fa91f29b5cb52db03ed81"],["d7924d4f7d43ea965a465ae3095ff41131e5946f3c85f79e44adbcf8e27e080e","581e2872a86c72a683842ec228cc6defea40af2bd896d3a5c504dc9ff6a26b58"],["defdea4cdb677750a420fee807eacf21eb9898ae79b9768766e4faa04a2d4a34","4211ab0694635168e997b0ead2a93daeced1f4a04a95c0f6cfb199f69e56eb77"],["2b4ea0a797a443d293ef5cff444f4979f06acfebd7e86d277475656138385b6c","85e89bc037945d93b343083b5a1c86131a01f60c50269763b570c854e5c09b7a"],["352bbf4a4cdd12564f93fa332ce333301d9ad40271f8107181340aef25be59d5","321eb4075348f534d59c18259dda3e1f4a1b3b2e71b1039c67bd3d8bcf81998c"],["2fa2104d6b38d11b0230010559879124e42ab8dfeff5ff29dc9cdadd4ecacc3f","2de1068295dd865b64569335bd5dd80181d70ecfc882648423ba76b532b7d67"],["9248279b09b4d68dab21a9b066edda83263c3d84e09572e269ca0cd7f5453714","73016f7bf234aade5d1aa71bdea2b1ff3fc0de2a887912ffe54a32ce97cb3402"],["daed4f2be3a8bf278e70132fb0beb7522f570e144bf615c07e996d443dee8729","a69dce4a7d6c98e8d4a1aca87ef8d7003f83c230f3afa726ab40e52290be1c55"],["c44d12c7065d812e8acf28d7cbb19f9011ecd9e9fdf281b0e6a3b5e87d22e7db","2119a460ce326cdc76c45926c982fdac0e106e861edf61c5a039063f0e0e6482"],["6a245bf6dc698504c89a20cfded60853152b695336c28063b61c65cbd269e6b4","e022cf42c2bd4a708b3f5126f16a24ad8b33ba48d0423b6efd5e6348100d8a82"],["1697ffa6fd9de627c077e3d2fe541084ce13300b0bec1146f95ae57f0d0bd6a5","b9c398f186806f5d27561506e4557433a2cf15009e498ae7adee9d63d01b2396"],["605bdb019981718b986d0f07e834cb0d9deb8360ffb7f61df982345ef27a7479","2972d2de4f8d20681a78d93ec96fe23c26bfae84fb14db43b01e1e9056b8c49"],["62d14dab4150bf497402fdc45a215e10dcb01c354959b10cfe31c7e9d87ff33d","80fc06bd8cc5b01098088a1950eed0db01aa132967ab472235f5642483b25eaf"],["80c60ad0040f27dade5b4b06c408e56b2c50e9f56b9b8b425e555c2f86308b6f","1c38303f1cc5c30f26e66bad7fe72f70a65eed4cbe7024eb1aa01f56430bd57a"],["7a9375ad6167ad54aa74c6348cc54d344cc5dc9487d847049d5eabb0fa03c8fb","d0e3fa9eca8726909559e0d79269046bdc59ea10c70ce2b02d499ec224dc7f7"],["d528ecd9b696b54c907a9ed045447a79bb408ec39b68df504bb51f459bc3ffc9","eecf41253136e5f99966f21881fd656ebc4345405c520dbc063465b521409933"],["49370a4b5f43412ea25f514e8ecdad05266115e4a7ecb1387231808f8b45963","758f3f41afd6ed428b3081b0512fd62a54c3f3afbb5b6764b653052a12949c9a"],["77f230936ee88cbbd73df930d64702ef881d811e0e1498e2f1c13eb1fc345d74","958ef42a7886b6400a08266e9ba1b37896c95330d97077cbbe8eb3c7671c60d6"],["f2dac991cc4ce4b9ea44887e5c7c0bce58c80074ab9d4dbaeb28531b7739f530","e0dedc9b3b2f8dad4da1f32dec2531df9eb5fbeb0598e4fd1a117dba703a3c37"],["463b3d9f662621fb1b4be8fbbe2520125a216cdfc9dae3debcba4850c690d45b","5ed430d78c296c3543114306dd8622d7c622e27c970a1de31cb377b01af7307e"],["f16f804244e46e2a09232d4aff3b59976b98fac14328a2d1a32496b49998f247","cedabd9b82203f7e13d206fcdf4e33d92a6c53c26e5cce26d6579962c4e31df6"],["caf754272dc84563b0352b7a14311af55d245315ace27c65369e15f7151d41d1","cb474660ef35f5f2a41b643fa5e460575f4fa9b7962232a5c32f908318a04476"],["2600ca4b282cb986f85d0f1709979d8b44a09c07cb86d7c124497bc86f082120","4119b88753c15bd6a693b03fcddbb45d5ac6be74ab5f0ef44b0be9475a7e4b40"],["7635ca72d7e8432c338ec53cd12220bc01c48685e24f7dc8c602a7746998e435","91b649609489d613d1d5e590f78e6d74ecfc061d57048bad9e76f302c5b9c61"],["754e3239f325570cdbbf4a87deee8a66b7f2b33479d468fbc1a50743bf56cc18","673fb86e5bda30fb3cd0ed304ea49a023ee33d0197a695d0c5d98093c536683"],["e3e6bd1071a1e96aff57859c82d570f0330800661d1c952f9fe2694691d9b9e8","59c9e0bba394e76f40c0aa58379a3cb6a5a2283993e90c4167002af4920e37f5"],["186b483d056a033826ae73d88f732985c4ccb1f32ba35f4b4cc47fdcf04aa6eb","3b952d32c67cf77e2e17446e204180ab21fb8090895138b4a4a797f86e80888b"],["df9d70a6b9876ce544c98561f4be4f725442e6d2b737d9c91a8321724ce0963f","55eb2dafd84d6ccd5f862b785dc39d4ab157222720ef9da217b8c45cf2ba2417"],["5edd5cc23c51e87a497ca815d5dce0f8ab52554f849ed8995de64c5f34ce7143","efae9c8dbc14130661e8cec030c89ad0c13c66c0d17a2905cdc706ab7399a868"],["290798c2b6476830da12fe02287e9e777aa3fba1c355b17a722d362f84614fba","e38da76dcd440621988d00bcf79af25d5b29c094db2a23146d003afd41943e7a"],["af3c423a95d9f5b3054754efa150ac39cd29552fe360257362dfdecef4053b45","f98a3fd831eb2b749a93b0e6f35cfb40c8cd5aa667a15581bc2feded498fd9c6"],["766dbb24d134e745cccaa28c99bf274906bb66b26dcf98df8d2fed50d884249a","744b1152eacbe5e38dcc887980da38b897584a65fa06cedd2c924f97cbac5996"],["59dbf46f8c94759ba21277c33784f41645f7b44f6c596a58ce92e666191abe3e","c534ad44175fbc300f4ea6ce648309a042ce739a7919798cd85e216c4a307f6e"],["f13ada95103c4537305e691e74e9a4a8dd647e711a95e73cb62dc6018cfd87b8","e13817b44ee14de663bf4bc808341f326949e21a6a75c2570778419bdaf5733d"],["7754b4fa0e8aced06d4167a2c59cca4cda1869c06ebadfb6488550015a88522c","30e93e864e669d82224b967c3020b8fa8d1e4e350b6cbcc537a48b57841163a2"],["948dcadf5990e048aa3874d46abef9d701858f95de8041d2a6828c99e2262519","e491a42537f6e597d5d28a3224b1bc25df9154efbd2ef1d2cbba2cae5347d57e"],["7962414450c76c1689c7b48f8202ec37fb224cf5ac0bfa1570328a8a3d7c77ab","100b610ec4ffb4760d5c1fc133ef6f6b12507a051f04ac5760afa5b29db83437"],["3514087834964b54b15b160644d915485a16977225b8847bb0dd085137ec47ca","ef0afbb2056205448e1652c48e8127fc6039e77c15c2378b7e7d15a0de293311"],["d3cc30ad6b483e4bc79ce2c9dd8bc54993e947eb8df787b442943d3f7b527eaf","8b378a22d827278d89c5e9be8f9508ae3c2ad46290358630afb34db04eede0a4"],["1624d84780732860ce1c78fcbfefe08b2b29823db913f6493975ba0ff4847610","68651cf9b6da903e0914448c6cd9d4ca896878f5282be4c8cc06e2a404078575"],["733ce80da955a8a26902c95633e62a985192474b5af207da6df7b4fd5fc61cd4","f5435a2bd2badf7d485a4d8b8db9fcce3e1ef8e0201e4578c54673bc1dc5ea1d"],["15d9441254945064cf1a1c33bbd3b49f8966c5092171e699ef258dfab81c045c","d56eb30b69463e7234f5137b73b84177434800bacebfc685fc37bbe9efe4070d"],["a1d0fcf2ec9de675b612136e5ce70d271c21417c9d2b8aaaac138599d0717940","edd77f50bcb5a3cab2e90737309667f2641462a54070f3d519212d39c197a629"],["e22fbe15c0af8ccc5780c0735f84dbe9a790badee8245c06c7ca37331cb36980","a855babad5cd60c88b430a69f53a1a7a38289154964799be43d06d77d31da06"],["311091dd9860e8e20ee13473c1155f5f69635e394704eaa74009452246cfa9b3","66db656f87d1f04fffd1f04788c06830871ec5a64feee685bd80f0b1286d8374"],["34c1fd04d301be89b31c0442d3e6ac24883928b45a9340781867d4232ec2dbdf","9414685e97b1b5954bd46f730174136d57f1ceeb487443dc5321857ba73abee"],["f219ea5d6b54701c1c14de5b557eb42a8d13f3abbcd08affcc2a5e6b049b8d63","4cb95957e83d40b0f73af4544cccf6b1f4b08d3c07b27fb8d8c2962a400766d1"],["d7b8740f74a8fbaab1f683db8f45de26543a5490bca627087236912469a0b448","fa77968128d9c92ee1010f337ad4717eff15db5ed3c049b3411e0315eaa4593b"],["32d31c222f8f6f0ef86f7c98d3a3335ead5bcd32abdd94289fe4d3091aa824bf","5f3032f5892156e39ccd3d7915b9e1da2e6dac9e6f26e961118d14b8462e1661"],["7461f371914ab32671045a155d9831ea8793d77cd59592c4340f86cbc18347b5","8ec0ba238b96bec0cbdddcae0aa442542eee1ff50c986ea6b39847b3cc092ff6"],["ee079adb1df1860074356a25aa38206a6d716b2c3e67453d287698bad7b2b2d6","8dc2412aafe3be5c4c5f37e0ecc5f9f6a446989af04c4e25ebaac479ec1c8c1e"],["16ec93e447ec83f0467b18302ee620f7e65de331874c9dc72bfd8616ba9da6b5","5e4631150e62fb40d0e8c2a7ca5804a39d58186a50e497139626778e25b0674d"],["eaa5f980c245f6f038978290afa70b6bd8855897f98b6aa485b96065d537bd99","f65f5d3e292c2e0819a528391c994624d784869d7e6ea67fb18041024edc07dc"],["78c9407544ac132692ee1910a02439958ae04877151342ea96c4b6b35a49f51","f3e0319169eb9b85d5404795539a5e68fa1fbd583c064d2462b675f194a3ddb4"],["494f4be219a1a77016dcd838431aea0001cdc8ae7a6fc688726578d9702857a5","42242a969283a5f339ba7f075e36ba2af925ce30d767ed6e55f4b031880d562c"],["a598a8030da6d86c6bc7f2f5144ea549d28211ea58faa70ebf4c1e665c1fe9b5","204b5d6f84822c307e4b4a7140737aec23fc63b65b35f86a10026dbd2d864e6b"],["c41916365abb2b5d09192f5f2dbeafec208f020f12570a184dbadc3e58595997","4f14351d0087efa49d245b328984989d5caf9450f34bfc0ed16e96b58fa9913"],["841d6063a586fa475a724604da03bc5b92a2e0d2e0a36acfe4c73a5514742881","73867f59c0659e81904f9a1c7543698e62562d6744c169ce7a36de01a8d6154"],["5e95bb399a6971d376026947f89bde2f282b33810928be4ded112ac4d70e20d5","39f23f366809085beebfc71181313775a99c9aed7d8ba38b161384c746012865"],["36e4641a53948fd476c39f8a99fd974e5ec07564b5315d8bf99471bca0ef2f66","d2424b1b1abe4eb8164227b085c9aa9456ea13493fd563e06fd51cf5694c78fc"],["336581ea7bfbbb290c191a2f507a41cf5643842170e914faeab27c2c579f726","ead12168595fe1be99252129b6e56b3391f7ab1410cd1e0ef3dcdcabd2fda224"],["8ab89816dadfd6b6a1f2634fcf00ec8403781025ed6890c4849742706bd43ede","6fdcef09f2f6d0a044e654aef624136f503d459c3e89845858a47a9129cdd24e"],["1e33f1a746c9c5778133344d9299fcaa20b0938e8acff2544bb40284b8c5fb94","60660257dd11b3aa9c8ed618d24edff2306d320f1d03010e33a7d2057f3b3b6"],["85b7c1dcb3cec1b7ee7f30ded79dd20a0ed1f4cc18cbcfcfa410361fd8f08f31","3d98a9cdd026dd43f39048f25a8847f4fcafad1895d7a633c6fed3c35e999511"],["29df9fbd8d9e46509275f4b125d6d45d7fbe9a3b878a7af872a2800661ac5f51","b4c4fe99c775a606e2d8862179139ffda61dc861c019e55cd2876eb2a27d84b"],["a0b1cae06b0a847a3fea6e671aaf8adfdfe58ca2f768105c8082b2e449fce252","ae434102edde0958ec4b19d917a6a28e6b72da1834aff0e650f049503a296cf2"],["4e8ceafb9b3e9a136dc7ff67e840295b499dfb3b2133e4ba113f2e4c0e121e5","cf2174118c8b6d7a4b48f6d534ce5c79422c086a63460502b827ce62a326683c"],["d24a44e047e19b6f5afb81c7ca2f69080a5076689a010919f42725c2b789a33b","6fb8d5591b466f8fc63db50f1c0f1c69013f996887b8244d2cdec417afea8fa3"],["ea01606a7a6c9cdd249fdfcfacb99584001edd28abbab77b5104e98e8e3b35d4","322af4908c7312b0cfbfe369f7a7b3cdb7d4494bc2823700cfd652188a3ea98d"],["af8addbf2b661c8a6c6328655eb96651252007d8c5ea31be4ad196de8ce2131f","6749e67c029b85f52a034eafd096836b2520818680e26ac8f3dfbcdb71749700"],["e3ae1974566ca06cc516d47e0fb165a674a3dabcfca15e722f0e3450f45889","2aeabe7e4531510116217f07bf4d07300de97e4874f81f533420a72eeb0bd6a4"],["591ee355313d99721cf6993ffed1e3e301993ff3ed258802075ea8ced397e246","b0ea558a113c30bea60fc4775460c7901ff0b053d25ca2bdeee98f1a4be5d196"],["11396d55fda54c49f19aa97318d8da61fa8584e47b084945077cf03255b52984","998c74a8cd45ac01289d5833a7beb4744ff536b01b257be4c5767bea93ea57a4"],["3c5d2a1ba39c5a1790000738c9e0c40b8dcdfd5468754b6405540157e017aa7a","b2284279995a34e2f9d4de7396fc18b80f9b8b9fdd270f6661f79ca4c81bd257"],["cc8704b8a60a0defa3a99a7299f2e9c3fbc395afb04ac078425ef8a1793cc030","bdd46039feed17881d1e0862db347f8cf395b74fc4bcdc4e940b74e3ac1f1b13"],["c533e4f7ea8555aacd9777ac5cad29b97dd4defccc53ee7ea204119b2889b197","6f0a256bc5efdf429a2fb6242f1a43a2d9b925bb4a4b3a26bb8e0f45eb596096"],["c14f8f2ccb27d6f109f6d08d03cc96a69ba8c34eec07bbcf566d48e33da6593","c359d6923bb398f7fd4473e16fe1c28475b740dd098075e6c0e8649113dc3a38"],["a6cbc3046bc6a450bac24789fa17115a4c9739ed75f8f21ce441f72e0b90e6ef","21ae7f4680e889bb130619e2c0f95a360ceb573c70603139862afd617fa9b9f"],["347d6d9a02c48927ebfb86c1359b1caf130a3c0267d11ce6344b39f99d43cc38","60ea7f61a353524d1c987f6ecec92f086d565ab687870cb12689ff1e31c74448"],["da6545d2181db8d983f7dcb375ef5866d47c67b1bf31c8cf855ef7437b72656a","49b96715ab6878a79e78f07ce5680c5d6673051b4935bd897fea824b77dc208a"],["c40747cc9d012cb1a13b8148309c6de7ec25d6945d657146b9d5994b8feb1111","5ca560753be2a12fc6de6caf2cb489565db936156b9514e1bb5e83037e0fa2d4"],["4e42c8ec82c99798ccf3a610be870e78338c7f713348bd34c8203ef4037f3502","7571d74ee5e0fb92a7a8b33a07783341a5492144cc54bcc40a94473693606437"],["3775ab7089bc6af823aba2e1af70b236d251cadb0c86743287522a1b3b0dedea","be52d107bcfa09d8bcb9736a828cfa7fac8db17bf7a76a2c42ad961409018cf7"],["cee31cbf7e34ec379d94fb814d3d775ad954595d1314ba8846959e3e82f74e26","8fd64a14c06b589c26b947ae2bcf6bfa0149ef0be14ed4d80f448a01c43b1c6d"],["b4f9eaea09b6917619f6ea6a4eb5464efddb58fd45b1ebefcdc1a01d08b47986","39e5c9925b5a54b07433a4f18c61726f8bb131c012ca542eb24a8ac07200682a"],["d4263dfc3d2df923a0179a48966d30ce84e2515afc3dccc1b77907792ebcc60e","62dfaf07a0f78feb30e30d6295853ce189e127760ad6cf7fae164e122a208d54"],["48457524820fa65a4f8d35eb6930857c0032acc0a4a2de422233eeda897612c4","25a748ab367979d98733c38a1fa1c2e7dc6cc07db2d60a9ae7a76aaa49bd0f77"],["dfeeef1881101f2cb11644f3a2afdfc2045e19919152923f367a1767c11cceda","ecfb7056cf1de042f9420bab396793c0c390bde74b4bbdff16a83ae09a9a7517"],["6d7ef6b17543f8373c573f44e1f389835d89bcbc6062ced36c82df83b8fae859","cd450ec335438986dfefa10c57fea9bcc521a0959b2d80bbf74b190dca712d10"],["e75605d59102a5a2684500d3b991f2e3f3c88b93225547035af25af66e04541f","f5c54754a8f71ee540b9b48728473e314f729ac5308b06938360990e2bfad125"],["eb98660f4c4dfaa06a2be453d5020bc99a0c2e60abe388457dd43fefb1ed620c","6cb9a8876d9cb8520609af3add26cd20a0a7cd8a9411131ce85f44100099223e"],["13e87b027d8514d35939f2e6892b19922154596941888336dc3563e3b8dba942","fef5a3c68059a6dec5d624114bf1e91aac2b9da568d6abeb2570d55646b8adf1"],["ee163026e9fd6fe017c38f06a5be6fc125424b371ce2708e7bf4491691e5764a","1acb250f255dd61c43d94ccc670d0f58f49ae3fa15b96623e5430da0ad6c62b2"],["b268f5ef9ad51e4d78de3a750c2dc89b1e626d43505867999932e5db33af3d80","5f310d4b3c99b9ebb19f77d41c1dee018cf0d34fd4191614003e945a1216e423"],["ff07f3118a9df035e9fad85eb6c7bfe42b02f01ca99ceea3bf7ffdba93c4750d","438136d603e858a3a5c440c38eccbaddc1d2942114e2eddd4740d098ced1f0d8"],["8d8b9855c7c052a34146fd20ffb658bea4b9f69e0d825ebec16e8c3ce2b526a1","cdb559eedc2d79f926baf44fb84ea4d44bcf50fee51d7ceb30e2e7f463036758"],["52db0b5384dfbf05bfa9d472d7ae26dfe4b851ceca91b1eba54263180da32b63","c3b997d050ee5d423ebaf66a6db9f57b3180c902875679de924b69d84a7b375"],["e62f9490d3d51da6395efd24e80919cc7d0f29c3f3fa48c6fff543becbd43352","6d89ad7ba4876b0b22c2ca280c682862f342c8591f1daf5170e07bfd9ccafa7d"],["7f30ea2476b399b4957509c88f77d0191afa2ff5cb7b14fd6d8e7d65aaab1193","ca5ef7d4b231c94c3b15389a5f6311e9daff7bb67b103e9880ef4bff637acaec"],["5098ff1e1d9f14fb46a210fada6c903fef0fb7b4a1dd1d9ac60a0361800b7a00","9731141d81fc8f8084d37c6e7542006b3ee1b40d60dfe5362a5b132fd17ddc0"],["32b78c7de9ee512a72895be6b9cbefa6e2f3c4ccce445c96b9f2c81e2778ad58","ee1849f513df71e32efc3896ee28260c73bb80547ae2275ba497237794c8753c"],["e2cb74fddc8e9fbcd076eef2a7c72b0ce37d50f08269dfc074b581550547a4f7","d3aa2ed71c9dd2247a62df062736eb0baddea9e36122d2be8641abcb005cc4a4"],["8438447566d4d7bedadc299496ab357426009a35f235cb141be0d99cd10ae3a8","c4e1020916980a4da5d01ac5e6ad330734ef0d7906631c4f2390426b2edd791f"],["4162d488b89402039b584c6fc6c308870587d9c46f660b878ab65c82c711d67e","67163e903236289f776f22c25fb8a3afc1732f2b84b4e95dbda47ae5a0852649"],["3fad3fa84caf0f34f0f89bfd2dcf54fc175d767aec3e50684f3ba4a4bf5f683d","cd1bc7cb6cc407bb2f0ca647c718a730cf71872e7d0d2a53fa20efcdfe61826"],["674f2600a3007a00568c1a7ce05d0816c1fb84bf1370798f1c69532faeb1a86b","299d21f9413f33b3edf43b257004580b70db57da0b182259e09eecc69e0d38a5"],["d32f4da54ade74abb81b815ad1fb3b263d82d6c692714bcff87d29bd5ee9f08f","f9429e738b8e53b968e99016c059707782e14f4535359d582fc416910b3eea87"],["30e4e670435385556e593657135845d36fbb6931f72b08cb1ed954f1e3ce3ff6","462f9bce619898638499350113bbc9b10a878d35da70740dc695a559eb88db7b"],["be2062003c51cc3004682904330e4dee7f3dcd10b01e580bf1971b04d4cad297","62188bc49d61e5428573d48a74e1c655b1c61090905682a0d5558ed72dccb9bc"],["93144423ace3451ed29e0fb9ac2af211cb6e84a601df5993c419859fff5df04a","7c10dfb164c3425f5c71a3f9d7992038f1065224f72bb9d1d902a6d13037b47c"],["b015f8044f5fcbdcf21ca26d6c34fb8197829205c7b7d2a7cb66418c157b112c","ab8c1e086d04e813744a655b2df8d5f83b3cdc6faa3088c1d3aea1454e3a1d5f"],["d5e9e1da649d97d89e4868117a465a3a4f8a18de57a140d36b3f2af341a21b52","4cb04437f391ed73111a13cc1d4dd0db1693465c2240480d8955e8592f27447a"],["d3ae41047dd7ca065dbf8ed77b992439983005cd72e16d6f996a5316d36966bb","bd1aeb21ad22ebb22a10f0303417c6d964f8cdd7df0aca614b10dc14d125ac46"],["463e2763d885f958fc66cdd22800f0a487197d0a82e377b49f80af87c897b065","bfefacdb0e5d0fd7df3a311a94de062b26b80c61fbc97508b79992671ef7ca7f"],["7985fdfd127c0567c6f53ec1bb63ec3158e597c40bfe747c83cddfc910641917","603c12daf3d9862ef2b25fe1de289aed24ed291e0ec6708703a5bd567f32ed03"],["74a1ad6b5f76e39db2dd249410eac7f99e74c59cb83d2d0ed5ff1543da7703e9","cc6157ef18c9c63cd6193d83631bbea0093e0968942e8c33d5737fd790e0db08"],["30682a50703375f602d416664ba19b7fc9bab42c72747463a71d0896b22f6da3","553e04f6b018b4fa6c8f39e7f311d3176290d0e0f19ca73f17714d9977a22ff8"],["9e2158f0d7c0d5f26c3791efefa79597654e7a2b2464f52b1ee6c1347769ef57","712fcdd1b9053f09003a3481fa7762e9ffd7c8ef35a38509e2fbf2629008373"],["176e26989a43c9cfeba4029c202538c28172e566e3c4fce7322857f3be327d66","ed8cc9d04b29eb877d270b4878dc43c19aefd31f4eee09ee7b47834c1fa4b1c3"],["75d46efea3771e6e68abb89a13ad747ecf1892393dfc4f1b7004788c50374da8","9852390a99507679fd0b86fd2b39a868d7efc22151346e1a3ca4726586a6bed8"],["809a20c67d64900ffb698c4c825f6d5f2310fb0451c869345b7319f645605721","9e994980d9917e22b76b061927fa04143d096ccc54963e6a5ebfa5f3f8e286c1"],["1b38903a43f7f114ed4500b4eac7083fdefece1cf29c63528d563446f972c180","4036edc931a60ae889353f77fd53de4a2708b26b6f5da72ad3394119daf408f9"]]}}},
3071929:(e,t,r)=>{"use strict";var n=t,i=r(67874),o=r(45067),s=r(5897);function a(e,t,r){var n=Array(Math.max(e.bitLength(),r)+1);for(s=0;s<n.length;s+=1)n[s]=0;var i=1<<t+1,o=e.clone();for(s=0;s<n.length;s++){var s,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}function c(e,t){var r=[[],[]];e=e.clone(),t=t.clone();for(var n=0,i=0;e.cmpn(-n)>0||t.cmpn(-i)>0;){var o,s,a,c=e.andln(3)+n&3,u=t.andln(3)+i&3;3===c&&(c=-1),3===u&&(u=-1),s=(1&c)==0?0:(3==(o=e.andln(7)+n&7)||5===o)&&2===u?-c:c,r[0].push(s),a=(1&u)==0?0:(3==(o=t.andln(7)+i&7)||5===o)&&2===c?-u:u,r[1].push(a),2*n===s+1&&(n=1-n),2*i===a+1&&(i=1-i),e.iushrn(1),t.iushrn(1)}return r}function u(e,t,r){var n="_"+t;e.prototype[t]=function(){return void 0!==this[n]?this[n]:this[n]=r.call(this)}}function l(e){return"string"==typeof e?n.toArray(e,"hex"):e}function d(e){return new i(e,"hex","le")}n.assert=o,n.toArray=s.toArray,n.zero2=s.zero2,n.toHex=s.toHex,n.encode=s.encode,n.getNAF=a,n.getJSF=c,n.cachedProperty=u,n.parseBytes=l,n.intFromLE=d},67874:function(e,t,r){!function(e,t){"use strict";function n(e,t){if(!e)throw 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"))}
vendor: 4,124 bytes, line 30
30"object"==typeof e?e.exports=o:t.BN=o,o.BN=o,o.wordSize=26;try{u="undefined"!=typeof window&&void 0!==window.Buffer?window.Buffer:r(79368).Buffer}catch(e){}function s(e,t){var r=e.charCodeAt(t);return r>=65&&r<=70?r-55:r>=97&&r<=102?r-87:r-48&15}function a(e,t,r){var n=s(e,r);return r-1>=t&&(n|=s(e,r-1)<<4),n}function c(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,a>=49?i+=a-49+10:a>=17?i+=a-17+10:i+=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 0>e.cmp(t)?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<0x4000000?(this.words=[0x3ffffff&e],this.length=1):e<0x10000000000000?(this.words=[0x3ffffff&e,e/0x4000000&0x3ffffff],this.length=2):(n(e<0x20000000000000),this.words=[0x3ffffff&e,e/0x4000000&0x3ffffff,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=Array(this.length);for(var i,o,s=0;s<this.length;s++)this.words[s]=0;var a=0;if("be"===r)for(s=e.length-1,i=0;s>=0;s-=3)o=e[s]|e[s-1]<<8|e[s-2]<<16,this.words[i]|=o<<a&0x3ffffff,this.words[i+1]=o>>>26-a&0x3ffffff,(a+=24)>=26&&(a-=26,i++);else if("le"===r)for(s=0,i=0;s<e.length;s+=3)o=e[s]|e[s+1]<<8|e[s+2]<<16,this.words[i]|=o<<a&0x3ffffff,this.words[i+1]=o>>>26-a&0x3ffffff,(a+=24)>=26&&(a-=26,i++);return this.strip()},o.prototype._parseHex=function(e,t,r){this.length=Math.ceil((e.length-t)/6),this.words=Array(this.length);for(var n,i=0;i<this.length;i++)this.words[i]=0;var o=0,s=0;if("be"===r)for(i=e.length-1;i>=t;i-=2)n=a(e,t,i)<<o,this.words[s]|=0x3ffffff&n,o>=18?(o-=18,s+=1,this.words[s]|=n>>>26):o+=8;else for(i=(e.length-t)%2==0?t+1:t;i<e.length;i+=2)n=a(e,t,i)<<o,this.words[s]|=0x3ffffff&n,o>=18?(o-=18,s+=1,this.words[s]|=n>>>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<=0x3ffffff;i*=t)n++;n--,i=i/t|0;for(var o=e.length-r,s=o%n,a=Math.min(o,o-s)+r,u=0,l=r;l<a;l+=n)u=c(e,l,l+n,t),this.imuln(i),this.words[0]+u<0x4000000?this.words[0]+=u:this._iaddn(u);if(0!==s){var d=1;for(u=c(e,l,e.length,t),l=0;l<s;l++)d*=t;this.imuln(d),this.words[0]+u<0x4000000?this.words[0]+=u:this._iaddn(u)}this.strip()},o.prototype.copy=function(e){e.words=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 u,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"],d=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5],f=[0,0,0x2000000,0x290d741,0x1000000,0x2e90edd,0x39aa400,0x267bf47,0x1000000,0x290d741,1e7,0x12959c3,0x222c000,0x3bd7765,7529536,0xadcea1,0x1000000,
vendor: 15,812 bytes, line 30
300x1704f61,0x206fc40,0x2cddcf9,64e6,4084101,5153632,6436343,7962624,9765625,0xb54ba0,0xdaf26b,0x1069c00,0x138f9ad,243e5,0x1b4d89f,0x2000000,0x25528a1,0x2b54a20,0x3216b93,0x39aa400];function h(e){for(var t=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}function p(e,t,r){r.negative=t.negative^e.negative;var n=e.length+t.length|0;r.length=n,n=n-1|0;var i=0|e.words[0],o=0|t.words[0],s=i*o,a=0x3ffffff&s,c=s/0x4000000|0;r.words[0]=a;for(var u=1;u<n;u++){for(var l=c>>>26,d=0x3ffffff&c,f=Math.min(u,t.length-1),h=Math.max(0,u-e.length+1);h<=f;h++){var p=u-h|0;l+=(s=(i=0|e.words[p])*(o=0|t.words[h])+d)/0x4000000|0,d=0x3ffffff&s}r.words[u]=0|d,c=0|l}return 0!==c?r.words[u]=0|c:r.length--,r.strip()}o.prototype.toString=function(e,t){if(t=0|t||1,16===(e=e||10)||"hex"===e){r="";for(var r,i=0,o=0,s=0;s<this.length;s++){var a=this.words[s],c=((a<<i|o)&0xffffff).toString(16);o=a>>>24-i&0xffffff,(i+=2)>=26&&(i-=26,s--),r=0!==o||s!==this.length-1?l[6-c.length]+c+r:c+r}for(0!==o&&(r=o.toString(16)+r);r.length%t!=0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}if(e===(0|e)&&e>=2&&e<=36){var u=d[e],h=f[e];r="";var p=this.clone();for(p.negative=0;!p.isZero();){var y=p.modn(h).toString(e);r=(p=p.idivn(h)).isZero()?y+r:l[u-y.length]+y+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+=0x4000000*this.words[1]:3===this.length&&1===this.words[2]?e+=0x10000000000000+0x4000000*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!==u),this.toArrayLike(u,e,t)},o.prototype.toArray=function(e,t){return this.toArrayLike(Array,e,t)},o.prototype.toArrayLike=function(e,t,r){var i,o,s=this.byteLength(),a=r||Math.max(1,s);n(s<=a,"byte array longer than desired length"),n(a>0,"Requested array length <= 0"),this.strip();var c="le"===t,u=new e(a),l=this.clone();if(c){for(o=0;!l.isZero();o++)i=l.andln(255),l.iushrn(8),u[o]=i;for(;o<a;o++)u[o]=0}else{for(o=0;o<a-s;o++)u[o]=0;for(o=0;!l.isZero();o++)i=l.andln(255),l.iushrn(8),u[a-o-1]=i}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(8191&t)==0&&(r+=13,t>>>=13),(127&t)==0&&(r+=7,t>>>=7),(15&t)==0&&(r+=4,t>>>=4),(3&t)==0&&(r+=2,t>>>=2),(1&t)==0&&r++,r},o.prototype.bitLength=function(){var e=this.words[this.length-1],t=this._countBits(e);return(this.length-1)*26+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((this.negative|e.negative)==0),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((this.negative|e.negative)==0),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){this.length>e.length?(t=this,r=e):(t=e,r=this);for(var t,r,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((this.negative|e.negative)==0),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]=0x3ffffff&~this.words[i];return r>0&&(this.words[i]=~this.words[i]&0x3ffffff>>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),t?this.words[r]=this.words[r]|1<<i:this.words[r]=this.words[r]&~(1<<i),this.strip()},o.prototype.iadd=function(e){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 t,r,n,i=0,o=0;o<n.length;o++)t=(0|r.words[o])+(0|n.words[o])+i,this.words[o]=0x3ffffff&t,i=t>>>26;for(;0!==i&&o<r.length;o++)t=(0|r.words[o])+i,this.words[o]=0x3ffffff&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,r,n=this.iadd(e);return e.negative=1,n._normSign()}if(0!==this.negative)return this.negative=0,this.iadd(e),this.negative=1,this._normSign();var i=this.cmp(e);if(0===i)return this.negative=0,this.length=1,this.words[0]=0,this;i>0?(t=this,r=e):(t=e,r=this);for(var o=0,s=0;s<r.length;s++)o=(n=(0|t.words[s])-(0|r.words[s])+o)>>26,this.words[s]=0x3ffffff&n;for(;0!==o&&s<t.length;s++)o=(n=(0|t.words[s])+o)>>26,this.words[s]=0x3ffffff&n;if(0===o&&s<t.length&&t!==this)for(;s<t.length;s++)this.words[s]=t.words[s];return this.length=Math.max(this.length,s),t!==this&&(this.negative=1),this.strip()},o.prototype.sub=function(e){return this.clone().isub(e)};var y=function(e,t,r){var n,i,o,s=e.words,a=t.words,c=r.words,u=0,l=0|s[0],d=8191&l,f=l>>>13,h=0|s[1],p=8191&h,y=h>>>13,g=0|s[2],m=8191&g,b=g>>>13,v=0|s[3],w=8191&v,_=v>>>13,E=0|s[4],S=8191&E,x=E>>>13,A=0|s[5],I=8191&A,O=A>>>13,T=0|s[6],P=8191&T,M=T>>>13,N=0|s[7],k=8191&N,C=N>>>13,D=0|s[8],j=8191&D,R=D>>>13,L=0|s[9],B=8191&L,U=L>>>13,$=0|a[0],K=8191&$,F=$>>>13,z=0|a[1],q=8191&z,V=z>>>13,H=0|a[2],G=8191&H,W=H>>>13,J=0|a[3],Z=8191&J,Y=J>>>13,X=0|a[4],Q=8191&X,ee=X>>>13,et=0|a[5],er=8191&et,en=et>>>13,ei=0|a[6],eo=8191&ei,es=ei>>>13,ea=0|a[7],ec=8191&ea,eu=ea>>>13,el=0|a[8],ed=8191&el,ef=el>>>13,eh=0|a[9],ep=8191&eh,ey=eh>>>13;r.negative=e.negative^t.negative,r.length=19;var eg=(u+(n=Math.imul(d,K))|0)+((8191&(i=(i=Math.imul(d,F))+Math.imul(f,K)|0))<<13)|0;u=((o=Math.imul(f,F))+(i>>>13)|0)+(eg>>>26)|0,eg&=0x3ffffff,n=Math.imul(p,K),i=(i=Math.imul(p,F))+Math.imul(y,K)|0,o=Math.imul(y,F);var em=(u+(n=n+Math.imul(d,q)|0)|0)+((8191&(i=(i=i+Math.imul(d,V)|0)+Math.imul(f,q)|0))<<13)|0;u=((o=o+Math.imul(f,V)|0)+(i>>>13)|0)+(em>>>26)|0,em&=0x3ffffff,n=Math.imul(m,K),i=(i=Math.imul(m,F))+Math.imul(b,K)|0,o=Math.imul(b,F),n=n+Math.imul(p,q)|0,i=(i=i+Math.imul(p,V)|0)+Math.imul(y,q)|0,o=o+Math.imul(y,V)|0;var eb=(u+(n=n+Math.imul(d,G)|0)|0)+((8191&(i=(i=i+Math.imul(d,W)|0)+Math.imul(f,G)|0))<<13)|0;u=((o=o+Math.imul(f,W)|0)+(i>>>13)|0)+(eb>>>26)|0,eb&=0x3ffffff,n=Math.imul(w,K),i=(i=Math.imul(w,F))+Math.imul(_,K)|0,o=Math.imul(_,F),n=n+Math.imul(m,q)|0,i=(i=i+Math.imul(m,V)|0)+Math.imul(b,q)|0,o=o+Math.imul(b,V)|0,n=n+Math.imul(p,G)|0,i=(i=i+Math.imul(p,W)|0)+Math.imul(y,G)|0,o=o+Math.imul(y,W)|0;var ev=(u+(n=n+Math.imul(d,Z)|0)|0)+((8191&(i=(i=i+Math.imul(d,Y)|0)+Math.imul(f,Z)|0))<<13)|0;u=((o=o+Math.imul(f,Y)|0)+(i>>>13)|0)+(ev>>>26)|0,ev&=0x3ffffff,n=Math.imul(S,K),i=(i=Math.imul(S,F))+Math.imul(x,K)|0,o=Math.imul(x,F),n=n+Math.imul(w,q)|0,i=(i=i+Math.imul(w,V)|0)+Math.imul(_,q)|0,o=o+Math.imul(_,V)|0,n=n+Math.imul(m,G)|0,i=(i=i+Math.imul(m,W)|0)+Math.imul(b,G)|0,o=o+Math.imul(b,W)|0,n=n+Math.imul(p,Z)|0,i=(i=i+Math.imul(p,Y)|0)+Math.imul(y,Z)|0,o=o+Math.imul(y,Y)|0;var ew=(u+(n=n+Math.imul(d,Q)|0)|0)+((8191&(i=(i=i+Math.imul(d,ee)|0)+Math.imul(f,Q)|0))<<13)|0;u=((o=o+Math.imul(f,ee)|0)+(i>>>13)|0)+(ew>>>26)|0,ew&=0x3ffffff,n=Math.imul(I,K),i=(i=Math.imul(I,F))+Math.imul(O,K)|0,o=Math.imul(O,F),n=n+Math.imul(S,q)|0,i=(i=i+Math.imul(S,V)|0)+Math.imul(x,q)|0,o=o+Math.imul(x,V)|0,n=n+Math.imul(w,G)|0,i=(i=i+Math.imul(w,W)|0)+Math.imul(_,G)|0,o=o+Math.imul(_,W)|0,n=n+Math.imul(m,Z)|0,i=(i=i+Math.imul(m,Y)|0)+Math.imul(b,Z)|0,o=o+Math.imul(b,Y)|0,n=n+Math.imul(p,Q)|0,i=(i=i+Math.imul(p,ee)|0)+Math.imul(y,Q)|0,o=o+Math.imul(y,ee)|0;var e_=(u+(n=n+Math.imul(d,er)|0)|0)+((8191&(i=(i=i+Math.imul(d,en)|0)+Math.imul(f,er)|0))<<13)|0;u=((o=o+Math.imul(f,en)|0)+(i>>>13)|0)+(e_>>>26)|0,e_&=0x3ffffff,n=Math.imul(P,K),i=(i=Math.imul(P,F))+Math.imul(M,K)|0,o=Math.imul(M,F),n=n+Math.imul(I,q)|0,i=(i=i+Math.imul(I,V)|0)+Math.imul(O,q)|0,o=o+Math.imul(O,V)|0,n=n+Math.imul(S,G)|0,i=(i=i+Math.imul(S,W)|0)+Math.imul(x,G)|0,o=o+Math.imul(x,W)|0,n=n+Math.imul(w,Z)|0,i=(i=i+Math.imul(w,Y)|0)+Math.imul(_,Z)|0,o=o+Math.imul(_,Y)|0,n=n+Math.imul(m,Q)|0,i=(i=i+Math.imul(m,ee)|0)+Math.imul(b,Q)|0,o=o+Math.imul(b,ee)|0,n=n+Math.imul(p,er)|0,i=(i=i+Math.imul(p,en)|0)+Math.imul(y,er)|0,o=o+Math.imul(y,en)|0;var eE=(u+(n=n+Math.imul(d,eo)|0)|0)+((8191&(i=(i=i+Math.imul(d,es)|0)+Math.imul(f,eo)|0))<<13)|0;u=((o=o+Math.imul(f,es)|0)+(i>>>13)|0)+(eE>>>26)|0,eE&=0x3ffffff,n=Math.imul(k,K),i=(i=Math.imul(k,F))+Math.imul(C,K)|0,o=Math.imul(C,F),n=n+Math.imul(P,q)|0,i=(i=i+Math.imul(P,V)|0)+Math.imul(M,q)|0,o=o+Math.imul(M,V)|0,n=n+Math.imul(I,G)|0,i=(i=i+Math.imul(I,W)|0)+Math.imul(O,G)|0,o=o+Math.imul(O,W)|0,n=n+Math.imul(S,Z)|0,i=(i=i+Math.imul(S,Y)|0)+Math.imul(x,Z)|0,o=o+Math.imul(x,Y)|0,n=n+Math.imul(w,Q)|0,i=(i=i+Math.imul(w,ee)|0)+Math.imul(_,Q)|0,o=o+Math.imul(_,ee)|0,n=n+Math.imul(m,er)|0,i=(i=i+Math.imul(m,en)|0)+Math.imul(b,er)|0,o=o+Math.imul(b,en)|0,n=n+Math.imul(p,eo)|0,i=(i=i+Math.imul(p,es)|0)+Math.imul(y,eo)|0,o=o+Math.imul(y,es)|0;var eS=(u+(n=n+Math.imul(d,ec)|0)|0)+((8191&(i=(i=i+Math.imul(d,eu)|0)+Math.imul(f,ec)|0))<<13)|0;u=((o=o+Math.imul(f,eu)|0)+(i>>>13)|0)+(eS>>>26)|0,eS&=0x3ffffff,n=Math.imul(j,K),i=(i=Math.imul(j,F))+Math.imul(R,K)|0,o=Math.imul(R,F),n=n+Math.imul(k,q)|0,i=(i=i+Math.imul(k,V)|0)+Math.imul(C,q)|0,o=o+Math.imul(C,V)|0,n=n+Math.imul(P,G)|0,i=(i=i+Math.imul(P,W)|0)+Math.imul(M,G)|0,o=o+Math.imul(M,W)|0,n=n+Math.imul(I,Z)|0,i=(i=i+Math.imul(I,Y)|0)+Math.imul(O,Z)|0,o=o+Math.imul(O,Y)|0,n=n+Math.imul(S,Q)|0,i=(i=i+Math.imul(S,ee)|0)+Math.imul(x,Q)|0,o=o+Math.imul(x,ee)|0,n=n+Math.imul(w,er)|0,i=(i=i+Math.imul(w,en)|0)+Math.imul(_,er)|0,o=o+Math.imul(_,en)|0,n=n+Math.imul(m,eo)|0,i=(i=i+Math.imul(m,es)|0)+Math.imul(b,eo)|0,o=o+Math.imul(b,es)|0,n=n+Math.imul(p,ec)|0,i=(i=i+Math.imul(p,eu)|0)+Math.imul(y,ec)|0,o=o+Math.imul(y,eu)|0;var ex=(u+(n=n+Math.imul(d,ed)|0)|0)+((8191&(i=(i=i+Math.imul(d,ef)|0)+Math.imul(f,ed)|0))<<13)|0;u=((o=o+Math.imul(f,ef)|0)+(i>>>13)|0)+(ex>>>26)|0,ex&=0x3ffffff,n=Math.imul(B,K),i=(i=Math.imul(B,F))+Math.imul(U,K)|0,o=Math.imul(U,F),n=n+Math.imul(j,q)|0,i=(i=i+Math.imul(j,V)|0)+Math.imul(R,q)|0,o=o+Math.imul(R,V)|0,n=n+Math.imul(k,G)|0,i=(i=i+Math.imul(k,W)|0)+Math.imul(C,G)|0,o=o+Math.imul(C,W)|0,n=n+Math.imul(P,Z)|0,i=(i=i+Math.imul(P,Y)|0)+Math.imul(M,Z)|0,o=o+Math.imul(M,Y)|0,n=n+Math.imul(I,Q)|0,i=(i=i+Math.imul(I,ee)|0)+Math.imul(O,Q)|0,o=o+Math.imul(O,ee)|0,n=n+Math.imul(S,er)|0,i=(i=i+Math.imul(S,en)|0)+Math.imul(x,er)|0,o=o+Math.imul(x,en)|0,n=n+Math.imul(w,eo)|0,i=(i=i+Math.imul(w,es)|0)+Math.imul(_,eo)|0,o=o+Math.imul(_,es)|0,n=n+Math.imul(m,ec)|0,i=(i=i+Math.imul(m,eu)|0)+Math.imul(b,ec)|0,o=o+Math.imul(b,eu)|0,n=n+Math.imul(p,ed)|0,i=(i=i+Math.imul(p,ef)|0)+Math.imul(y,ed)|0,o=o+Math.imul(y,ef)|0;var eA=(u+(n=n+Math.imul(d,ep)|0)|0)+((8191&(i=(i=i+Math.imul(d,ey)|0)+Math.imul(f,ep)|0))<<13)|0;u=((o=o+Math.imul(f,ey)|0)+(i>>>13)|0)+(eA>>>26)|0,eA&=0x3ffffff,n=Math.imul(B,q),i=(i=Math.imul(B,V))+Math.imul(U,q)|0,o=Math.imul(U,V),n=n+Math.imul(j,G)|0,i=(i=i+Math.imul(j,W)|0)+Math.imul(R,G)|0,o=o+Math.imul(R,W)|0,n=n+Math.imul(k,Z)|0,i=(i=i+Math.imul(k,Y)|0)+Math.imul(C,Z)|0,o=o+Math.imul(C,Y)|0,n=n+Math.imul(P,Q)|0,i=(i=i+Math.imul(P,ee)|0)+Math.imul(M,Q)|0,o=o+Math.imul(M,ee)|0,n=n+Math.imul(I,er)|0,i=(i=i+Math.imul(I,en)|0)+Math.imul(O,er)|0,o=o+Math.imul(O,en)|0,n=n+Math.imul(S,eo)|0,i=(i=i+Math.imul(S,es)|0)+Math.imul(x,eo)|0,o=o+Math.imul(x,es)|0,n=n+Math.imul(w,ec)|0,i=(i=i+Math.imul(w,eu)|0)+Math.imul(_,ec)|0,o=o+Math.imul(_,eu)|0,n=n+Math.imul(m,ed)|0,i=(i=i+Math.imul(m,ef)|0)+Math.imul(b,ed)|0,o=o+Math.imul(b,ef)|0;var eI=(u+(n=n+Math.imul(p,ep)|0)|0)+((8191&(i=(i=i+Math.imul(p,ey)|0)+Math.imul(y,ep)|0))<<13)|0;u=((o=o+Math.imul(y,ey)|0)+(i>>>13)|0)+(eI>>>26)|0,eI&=0x3ffffff,n=Math.imul(B,G),i=(i=Math.imul(B,W))+Math.imul(U,G)|0,o=Math.imul(U,W),n=n+Math.imul(j,Z)|0,i=(i=i+Math.imul(j,Y)|0)+Math.imul(R,Z)|0,o=o+Math.imul(R,Y)|0,n=n+Math.imul(k,Q)|0,i=(i=i+Math.imul(k,ee)|0)+Math.imul(C,Q)|0,o=o+Math.imul(C,ee)|0,n=n+Math.imul(P,er)|0,i=(i=i+Math.imul(P,en)|0)+Math.imul(M,er)|0,o=o+Math.imul(M,en)|0,n=n+Math.imul(I,eo)|0,i=(i=i+Math.imul(I,es)|0)+Math.imul(O,eo)|0,o=o+Math.imul(O,es)|0,n=n+Math.imul(S,ec)|0,i=(i=i+Math.imul(S,eu)|0)+Math.imul(x,ec)|0,o=o+Math.imul(x,eu)|0,n=n+Math.imul(w,ed)|0,i=(i=i+Math.imul(w,ef)|0)+Math.imul(_,ed)|0,o=o+Math.imul(_,ef)|0;var eO=(u+(n=n+Math.imul(m,ep)|0)|0)+((8191&(i=(i=i+Math.imul(m,ey)|0)+Math.imul(b,ep)|0))<<13)|0;u=((o=o+Math.imul(b,ey)|0)+(i>>>13)|0)+(eO>>>26)|0,eO&=0x3ffffff,n=Math.imul(B,Z),i=(i=Math.imul(B,Y))+Math.imul(U,Z)|0,o=Math.imul(U,Y),n=n+Math.imul(j,Q)|0,i=(i=i+Math.imul(j,ee)|0)+Math.imul(R,Q)|0,o=o+Math.imul(R,ee)|0,n=n+Math.imul(k,er)|0,i=(i=i+Math.imul(k,en)|0)+Math.imul(C,er)|0,o=o+Math.imul(C,en)|0,n=n+Math.imul(P,eo)|0,i=(i=i+Math.imul(P,es)|0)+Math.imul(M,eo)|0,o=o+Math.imul(M,es)|0,n=n+Math.imul(I,ec)|0,i=(i=i+Math.imul(I,eu)|0)+Math.imul(O,ec)|0,o=o+Math.imul(O,eu)|0,n=n+Math.imul(S,ed)|0,i=(i=i+Math.imul(S,ef)|0)+Math.imul(x,ed)|0,o=o+Math.imul(x,ef)|0;var eT=(u+(n=n+Math.imul(w,ep)|0)|0)+((8191&(i=(i=i+Math.imul(w,ey)|0)+Math.imul(_,ep)|0))<<13)|0;u=((o=o+Math.imul(_,ey)|0)+(i>>>13)|0)+(eT>>>26)|0,eT&=0x3ffffff,n=Math.imul(B,Q),i=(i=Math.imul(B,ee))+Math.imul(U,Q)|0,o=Math.imul(U,ee),n=n+Math.imul(j,er)|0,i=(i=i+Math.imul(j,en)|0)+Math.imul(R,er)|0,o=o+Math.imul(R,en)|0,n=n+Math.imul(k,eo)|0,i=(i=i+Math.imul(k,es)|0)+Math.imul(C,eo)|0,o=o+Math.imul(C,es)|0,n=n+Math.imul(P,ec)|0,i=(i=i+Math.imul(P,eu)|0)+Math.imul(M,ec)|0,o=o+Math.imul(M,eu)|0,n=n+Math.imul(I,ed)|0,i=(i=i+Math.imul(I,ef)|0)+Math.imul(O,ed)|0,o=o+Math.imul(O,ef)|0;var eP=(u+(n=n+Math.imul(S,ep)|0)|0)+((8191&(i=(i=i+Math.imul(S,ey)|0)+Math.imul(x,ep)|0))<<13)|0;u=((o=o+Math.imul(x,ey)|0)+(i>>>13)|0)+(eP>>>
vendor: 18,978 bytes, line 30
3026)|0,eP&=0x3ffffff,n=Math.imul(B,er),i=(i=Math.imul(B,en))+Math.imul(U,er)|0,o=Math.imul(U,en),n=n+Math.imul(j,eo)|0,i=(i=i+Math.imul(j,es)|0)+Math.imul(R,eo)|0,o=o+Math.imul(R,es)|0,n=n+Math.imul(k,ec)|0,i=(i=i+Math.imul(k,eu)|0)+Math.imul(C,ec)|0,o=o+Math.imul(C,eu)|0,n=n+Math.imul(P,ed)|0,i=(i=i+Math.imul(P,ef)|0)+Math.imul(M,ed)|0,o=o+Math.imul(M,ef)|0;var eM=(u+(n=n+Math.imul(I,ep)|0)|0)+((8191&(i=(i=i+Math.imul(I,ey)|0)+Math.imul(O,ep)|0))<<13)|0;u=((o=o+Math.imul(O,ey)|0)+(i>>>13)|0)+(eM>>>26)|0,eM&=0x3ffffff,n=Math.imul(B,eo),i=(i=Math.imul(B,es))+Math.imul(U,eo)|0,o=Math.imul(U,es),n=n+Math.imul(j,ec)|0,i=(i=i+Math.imul(j,eu)|0)+Math.imul(R,ec)|0,o=o+Math.imul(R,eu)|0,n=n+Math.imul(k,ed)|0,i=(i=i+Math.imul(k,ef)|0)+Math.imul(C,ed)|0,o=o+Math.imul(C,ef)|0;var eN=(u+(n=n+Math.imul(P,ep)|0)|0)+((8191&(i=(i=i+Math.imul(P,ey)|0)+Math.imul(M,ep)|0))<<13)|0;u=((o=o+Math.imul(M,ey)|0)+(i>>>13)|0)+(eN>>>26)|0,eN&=0x3ffffff,n=Math.imul(B,ec),i=(i=Math.imul(B,eu))+Math.imul(U,ec)|0,o=Math.imul(U,eu),n=n+Math.imul(j,ed)|0,i=(i=i+Math.imul(j,ef)|0)+Math.imul(R,ed)|0,o=o+Math.imul(R,ef)|0;var ek=(u+(n=n+Math.imul(k,ep)|0)|0)+((8191&(i=(i=i+Math.imul(k,ey)|0)+Math.imul(C,ep)|0))<<13)|0;u=((o=o+Math.imul(C,ey)|0)+(i>>>13)|0)+(ek>>>26)|0,ek&=0x3ffffff,n=Math.imul(B,ed),i=(i=Math.imul(B,ef))+Math.imul(U,ed)|0,o=Math.imul(U,ef);var eC=(u+(n=n+Math.imul(j,ep)|0)|0)+((8191&(i=(i=i+Math.imul(j,ey)|0)+Math.imul(R,ep)|0))<<13)|0;u=((o=o+Math.imul(R,ey)|0)+(i>>>13)|0)+(eC>>>26)|0,eC&=0x3ffffff;var eD=(u+(n=Math.imul(B,ep))|0)+((8191&(i=(i=Math.imul(B,ey))+Math.imul(U,ep)|0))<<13)|0;return u=((o=Math.imul(U,ey))+(i>>>13)|0)+(eD>>>26)|0,eD&=0x3ffffff,c[0]=eg,c[1]=em,c[2]=eb,c[3]=ev,c[4]=ew,c[5]=e_,c[6]=eE,c[7]=eS,c[8]=ex,c[9]=eA,c[10]=eI,c[11]=eO,c[12]=eT,c[13]=eP,c[14]=eM,c[15]=eN,c[16]=ek,c[17]=eC,c[18]=eD,0!==u&&(c[19]=u,r.length++),r};function g(e,t,r){r.negative=t.negative^e.negative,r.length=e.length+t.length;for(var n=0,i=0,o=0;o<r.length-1;o++){var s=i;i=0;for(var a=0x3ffffff&n,c=Math.min(o,t.length-1),u=Math.max(0,o-e.length+1);u<=c;u++){var l=o-u,d=(0|e.words[l])*(0|t.words[u]),f=0x3ffffff&d;s=s+(d/0x4000000|0)|0,a=0x3ffffff&(f=f+a|0),i+=(s=s+(f>>>26)|0)>>>26,s&=0x3ffffff}r.words[o]=a,n=s,s=i}return 0!==n?r.words[o]=n:r.length--,r.strip()}function m(e,t,r){return new b().mulp(e,t,r)}function b(e,t){this.x=e,this.y=t}Math.imul||(y=p),o.prototype.mulTo=function(e,t){var r=this.length+e.length;return 10===this.length&&10===e.length?y(this,e,t):r<63?p(this,e,t):r<1024?g(this,e,t):m(this,e,t)},b.prototype.makeRBT=function(e){for(var t=Array(e),r=o.prototype._countBits(e)-1,n=0;n<e;n++)t[n]=this.revBin(n,r,e);return t},b.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},b.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]]},b.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 d=c,f=u,h=0;h<s;h++){var p=r[l+h],y=n[l+h],g=r[l+h+s],m=n[l+h+s],b=d*g-f*m;m=d*m+f*g,g=b,r[l+h]=p+g,n[l+h]=y+m,r[l+h+s]=p-g,n[l+h+s]=y-m,h!==a&&(b=c*d-u*f,f=c*f+u*d,d=b)}},b.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},b.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}},b.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]=0x3ffffff&i,r=i<0x4000000?0:i/0x4000000|0}return e},b.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((-8192&o)==0)},b.prototype.stub=function(e){for(var t=Array(e),r=0;r<e;r++)t[r]=0;return t},b.prototype.mulp=function(e,t,r){var n=2*this.guessLen13b(e.length,t.length),i=this.makeRBT(n),o=this.stub(n),s=Array(n),a=Array(n),c=Array(n),u=Array(n),l=Array(n),d=Array(n),f=r.words;f.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,d,n,i);for(var h=0;h<n;h++){var p=a[h]*l[h]-c[h]*d[h];c[h]=a[h]*d[h]+c[h]*l[h],a[h]=p}return this.conjugate(a,c,n),this.transform(a,c,f,o,n,i),this.conjugate(f,o,n),this.normalize13b(f,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=Array(this.length+e.length),this.mulTo(e,t)},o.prototype.mulf=function(e){var t=new o(null);return t.words=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<0x4000000);for(var t=0,r=0;r<this.length;r++){var i=(0|this.words[r])*e,o=(0x3ffffff&i)+(0x3ffffff&t);t>>=26,t+=(i/0x4000000|0)+(o>>>26),this.words[r]=0x3ffffff&o}return 0!==t&&(this.words[r]=t,this.length++),this.length=0===e?1: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=h(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=0x3ffffff>>>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){n("number"==typeof e&&e>=0),i=t?(t-t%26)/26:0;var i,o=e%26,s=Math.min((e-o)/26,this.length),a=0x3ffffff^0x3ffffff>>>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 d=0|this.words[u];this.words[u]=l<<26-o|d>>>o,l=d&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=0x3ffffff^0x3ffffff>>>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<0x4000000),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.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]>=0x4000000;t++)this.words[t]-=0x4000000,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<0x4000000),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]+=0x4000000,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;o-=0x3ffffff&c,a=(o>>26)-(c/0x4000000|0),this.words[i+r]=0x3ffffff&o}for(;i<this.length-r;i++)a=(o=(0|this.words[i+r])+a)>>26,this.words[i+r]=0x3ffffff&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]=0x3ffffff&o;return this.negative=1,this.strip()},o.prototype._wordDiv=function(e,t){var r,n=this.length-e.length,i=this.clone(),s=e,a=0|s.words[s.length-1];0!=(n=26-this._countBits(a))&&(s=s.ushln(n),i.iushln(n),a=0|s.words[s.length-1]);var c=i.length-s.length;if("mod"!==t){(r=new o(null)).length=c+1,r.words=Array(r.length);for(var u=0;u<r.length;u++)r.words[u]=0}var l=i.clone()._ishlnsubmul(s,1,c);0===l.negative&&(i=l,r&&(r.words[c]=1));for(var d=c-1;d>=0;d--){var f=(0|i.words[s.length+d])*0x4000000+(0|i.words[s.length+d-1]);for(f=Math.min(f/a|0,0x3ffffff),i._ishlnsubmul(s,f,d);0!==i.negative;)f--,i.negative=0,i._ishlnsubmul(s,1,d),i.isZero()||(i.negative^=1);r&&(r.words[d]=f)}return r&&r.strip(),i.strip(),"div"!==t&&0!==n&&i.iushrn(n),{div:r||null,mod:i}},o.prototype.divmod=function(e,t,r){var i,s,a;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}):(this.negative&e.negative)!=0?(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||0>this.cmp(e)?{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)},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<=0x3ffffff);for(var t=0x4000000%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<=0x3ffffff);for(var t=0,r=this.length-1;r>=0;r--){var i=(0|this.words[r])+0x4000000*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(),d=t.clone();!t.isZero();){for(var f=0,h=1;(t.words[0]&h)==0&&f<26;++f,h<<=1);if(f>0)for(t.iushrn(f);f-- >0;)(i.isOdd()||s.isOdd())&&(i.iadd(l),s.isub(d)),i.iushrn(1),s.iushrn(1);for(var p=0,y=1;(r.words[0]&y)==0&&p<26;++p,y<<=1);if(p>0)for(r.iushrn(p);p-- >0;)(a.isOdd()||c.isOdd())&&(a.iadd(l),c.isub(d)),a.iushrn(1),c.iushrn(1);t.cmp(r)>=0?(t.isub(r),i.isub(a),s.isub(c)):(r.isub(t),a.isub(i),c.isub(s))}return{a:a,b:c,gcd:r.iushln(u)}},o.prototype._invmp=function(e){n(0===e.negative),n(!e.isZero());var t,r=this,i=e.clone();r=0!==r.negative?r.umod(e):r.clone();for(var s=new o(1),a=new o(0),c=i.clone();r.cmpn(1)>0&&i.cmpn(1)>0;){for(var u=0,l=1;(r.words[0]&l)==0&&u<26;++u,l<<=1);if(u>0)for(r.iushrn(u);u-- >0;)s.isOdd()&&s.iadd(c),s.iushrn(1);for(var d=0,f=1;(i.words[0]&f)==0&&d<26;++d,f<<=1);if(d>0)for(i.iushrn(d);d-- >0;)a.isOdd()&&a.iadd(c),a.iushrn(1);r.cmp(i)>=0?(r.isub(i),s.isub(a)):(i.isub(r),a.isub(s))}return 0>(t=0===r.cmpn(1)?s:a).cmpn(0)&&t.iadd(e),t},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(1&this.words[0])==0},o.prototype.isOdd=function(){return(1&this.words[0])==1},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];a+=o,o=a>>>26,a&=0x3ffffff,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<=0x3ffffff,"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 0>=this.cmpn(e)},o.prototype.lte=function(e){return 0>=this.cmp(e)},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 A(e)},o.prototype.toRed=function(e){return n(!this.red,"Already a number in reduction context"),n(0===this.negative,"red works only with positives"),e.convertTo(this)._forceRed(e)},o.prototype.fromRed=function(){return n(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},o.prototype._forceRed=function(e){return this.red=e,this},o.prototype.forceRed=function(e){return n(!this.red,"Already a number in reduction context"),this._forceRed(e)},o.prototype.redAdd=function(e){return n(this.red,"redAdd works only with red numbers"),this.red.add(this,e)},o.prototype.redIAdd=function(e){return n(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,e)},o.prototype.redSub=function(e){return n(this.red,"redSub works only with red numbers"),this.red.sub(this,e)},o.prototype.redISub=function(e){return n(this.red,"redISub works only with red numbers"),this.red.isub(this,e)},o.prototype.redShl=function(e){return n(this.red,"redShl works only with red numbers"),this.red.shl(this,e)},o.prototype.redMul=function(e){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.mul(this,e)},o.prototype.redIMul=function(e){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.imul(this,e)},o.prototype.redSqr=function(){return n(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},o.prototype.redISqr=function(){return n(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},o.prototype.redSqrt=function(){return n(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},o.prototype.redInvm=function(){return n(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},o.prototype.redNeg=function(){return n(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},o.prototype.redPow=function(e){return n(this.red&&!e.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,e)};var v={k256:null,p224:null,p192:null,p25519:null};function w(e,t){this.name=e,this.p=new o(t,16),this.n=this.p.bitLength(),this.k=new o(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function _(){w.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function E(){w.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function S(){w.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function x(){w.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function A(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 I(e){A.call(this,e),this.shift=this.m.bitLength(),this.shift%26!=0&&(this.shift+=26-this.shift%26),this.r=new o(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}w.prototype._tmp=function(){var e=new o(null);return e.words=Array(Math.ceil(this.n/13)),e},w.prototype.ireduce=function(e){var t,r=e;do this.split(r,this.tmp),t=(r=(r=this.imulK(r)).iadd(this.tmp)).bitLength();while(t>this.n);var n=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},w.prototype.split=function(e,t){e.iushrn(this.n,0,t)},w.prototype.imulK=function(e){return e.imul(this.k)},i(_,w),_.prototype.split=function(e,t){for(var r=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){e.words[0]=0,e.length=1;return}var o=e.words[9];for(i=10,t.words[t.length++]=o&r;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},_.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]=0x3ffffff&t,t=64*n+(t/0x4000000|0)}return 0===e.words[e.length-1]&&(e.length--,0===e.words[e.length-1]&&e.length--),e},i(E,w),i(S,w),i(x,w),x.prototype.imulK=function(e){for(var t=0,r=0;r<e.length;
30r++){var n=(0|e.words[r])*19+t,i=0x3ffffff&n;n>>>=26,e.words[r]=i,t=n}return 0!==t&&(e.words[e.length++]=t),e},o._prime=function(e){var t;if(v[e])return v[e];if("k256"===e)t=new _;else if("p224"===e)t=new E;else if("p192"===e)t=new S;else if("p25519"===e)t=new x;else throw Error("Unknown prime "+e);return v[e]=t,t},A.prototype._verify1=function(e){n(0===e.negative,"red works only with positives"),n(e.red,"red works only with red numbers")},A.prototype._verify2=function(e,t){n((e.negative|t.negative)==0,"red works only with positives"),n(e.red&&e.red===t.red,"red works only with red numbers")},A.prototype.imod=function(e){return this.prime?this.prime.ireduce(e)._forceRed(this):e.umod(this.m)._forceRed(this)},A.prototype.neg=function(e){return e.isZero()?e.clone():this.m.sub(e)._forceRed(this)},A.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)},A.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},A.prototype.sub=function(e,t){this._verify2(e,t);var r=e.sub(t);return 0>r.cmpn(0)&&r.iadd(this.m),r._forceRed(this)},A.prototype.isub=function(e,t){this._verify2(e,t);var r=e.isub(t);return 0>r.cmpn(0)&&r.iadd(this.m),r},A.prototype.shl=function(e,t){return this._verify1(e),this.imod(e.ushln(t))},A.prototype.imul=function(e,t){return this._verify2(e,t),this.imod(e.imul(t))},A.prototype.mul=function(e,t){return this._verify2(e,t),this.imod(e.mul(t))},A.prototype.isqr=function(e){return this.imul(e,e.clone())},A.prototype.sqr=function(e){return this.mul(e,e)},A.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 d=this.pow(l,i),f=this.pow(e,i.addn(1).iushrn(1)),h=this.pow(e,i),p=s;0!==h.cmp(a);){for(var y=h,g=0;0!==y.cmp(a);g++)y=y.redSqr();n(g<p);var m=this.pow(d,new o(1).iushln(p-g-1));f=f.redMul(m),d=m.redSqr(),h=h.redMul(d),p=g}return f},A.prototype.invm=function(e){var t=e._invmp(this.m);return 0!==t.negative?(t.negative=0,this.imod(t).redNeg()):this.imod(t)},A.prototype.pow=function(e,t){if(t.isZero())return new o(1).toRed(this);if(0===t.cmpn(1))return e.clone();var r=4,n=Array(16);n[0]=new o(1).toRed(this),n[1]=e;for(var i=2;i<n.length;i++)n[i]=this.mul(n[i-1],e);var s=n[0],a=0,c=0,u=t.bitLength()%26;for(0===u&&(u=26),i=t.length-1;i>=0;i--){for(var l=t.words[i],d=u-1;d>=0;d--){var f=l>>d&1;if(s!==n[0]&&(s=this.sqr(s)),0===f&&0===a){c=0;continue}a<<=1,a|=f,(++c===r||0===i&&0===d)&&(s=this.mul(s,n[a]),c=0,a=0)}u=26}return s},A.prototype.convertTo=function(e){var t=e.umod(this.m);return t===e?t.clone():t},A.prototype.convertFrom=function(e){var t=e.clone();return t.red=null,t},o.mont=function(e){return new I(e)},i(I,A),I.prototype.convertTo=function(e){return this.imod(e.ushln(this.shift))},I.prototype.convertFrom=function(e){var t=this.imod(e.mul(this.rinv));return t.red=null,t},I.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):0>i.cmpn(0)&&(o=i.iadd(this.m)),o._forceRed(this)},I.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):0>i.cmpn(0)&&(s=i.iadd(this.m)),s._forceRed(this)},I.prototype.invm=function(e){return this.imod(e._invmp(this.m).mul(this.r2))._forceRed(this)}}(e=r.nmd(e),this)},60429:e=>{"use strict";var t,r="object"==typeof Reflect?Reflect:null,n=r&&"function"==typeof r.apply?r.apply:function(e,t,r){return Function.prototype.apply.call(e,t,r)};function i(e){console&&console.warn&&console.warn(e)}t=r&&"function"==typeof r.ownKeys?r.ownKeys:Object.getOwnPropertySymbols?function(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))}:function(e){return Object.getOwnPropertyNames(e)};var o=Number.isNaN||function(e){return e!=e};function s(){s.init.call(this)}e.exports=s,e.exports.once=b,s.EventEmitter=s,s.prototype._events=void 0,s.prototype._eventsCount=0,s.prototype._maxListeners=void 0;var a=10;function c(e){if("function"!=typeof e)throw TypeError('The "listener" argument must be of type Function. Received type '+typeof e)}function u(e){return void 0===e._maxListeners?s.defaultMaxListeners:e._maxListeners}function l(e,t,r,n){if(c(r),void 0===(s=e._events)?(s=e._events=Object.create(null),e._eventsCount=0):(void 0!==s.newListener&&(e.emit("newListener",t,r.listener?r.listener:r),s=e._events),a=s[t]),void 0===a)a=s[t]=r,++e._eventsCount;else if("function"==typeof a?a=s[t]=n?[r,a]:[a,r]:n?a.unshift(r):a.push(r),(o=u(e))>0&&a.length>o&&!a.warned){a.warned=!0;var o,s,a,l=Error("Possible EventEmitter memory leak detected. "+a.length+" "+String(t)+" listeners added. Use emitter.setMaxListeners() to increase limit");l.name="MaxListenersExceededWarning",l.emitter=e,l.type=t,l.count=a.length,i(l)}return e}function d(){if(!this.fired)return(this.target.removeListener(this.type,this.wrapFn),this.fired=!0,0==arguments.length)?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function f(e,t,r){var n={fired:!1,wrapFn:void 0,target:e,type:t,listener:r},i=d.bind(n);return i.listener=r,n.wrapFn=i,i}function h(e,t,r){var n=e._events;if(void 0===n)return[];var i=n[t];return void 0===i?[]:"function"==typeof i?r?[i.listener||i]:[i]:r?m(i):y(i,i.length)}function p(e){var t=this._events;if(void 0!==t){var r=t[e];if("function"==typeof r)return 1;if(void 0!==r)return r.length}return 0}function y(e,t){for(var r=Array(t),n=0;n<t;++n)r[n]=e[n];return r}function g(e,t){for(;t+1<e.length;t++)e[t]=e[t+1];e.pop()}function m(e){for(var t=Array(e.length),r=0;r<t.length;++r)t[r]=e[r].listener||e[r];return t}function b(e,t){return new Promise(function(r,n){function i(r){e.removeListener(t,o),n(r)}function o(){"function"==typeof e.removeListener&&e.removeListener("error",i),r([].slice.call(arguments))}w(e,t,o,{once:!0}),"error"!==t&&v(e,i,{once:!0})})}function v(e,t,r){"function"==typeof e.on&&w(e,"error",t,r)}function w(e,t,r,n){if("function"==typeof e.on)n.once?e.once(t,r):e.on(t,r);else if("function"==typeof e.addEventListener)e.addEventListener(t,function i(o){n.once&&e.removeEventListener(t,i),r(o)});else throw TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof e)}Object.defineProperty(s,"defaultMaxListeners",{enumerable:!0,get:function(){return a}
30,set:function(e){if("number"!=typeof e||e<0||o(e))throw RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+e+".");a=e}}),s.init=function(){(void 0===this._events||this._events===Object.getPrototypeOf(this)._events)&&(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},s.prototype.setMaxListeners=function(e){if("number"!=typeof e||e<0||o(e))throw RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+e+".");return this._maxListeners=e,this},s.prototype.getMaxListeners=function(){return u(this)},s.prototype.emit=function(e){for(var t=[],r=1;r<arguments.length;r++)t.push(arguments[r]);var i="error"===e,o=this._events;if(void 0!==o)i=i&&void 0===o.error;else if(!i)return!1;if(i){if(t.length>0&&(s=t[0]),s instanceof Error)throw s;var s,a=Error("Unhandled error."+(s?" ("+s.message+")":""));throw a.context=s,a}var c=o[e];if(void 0===c)return!1;if("function"==typeof c)n(c,this,t);else for(var u=c.length,l=y(c,u),r=0;r<u;++r)n(l[r],this,t);return!0},s.prototype.addListener=function(e,t){return l(this,e,t,!1)},s.prototype.on=s.prototype.addListener,s.prototype.prependListener=function(e,t){return l(this,e,t,!0)},s.prototype.once=function(e,t){return c(t),this.on(e,f(this,e,t)),this},s.prototype.prependOnceListener=function(e,t){return c(t),this.prependListener(e,f(this,e,t)),this},s.prototype.removeListener=function(e,t){var r,n,i,o,s;if(c(t),void 0===(n=this._events)||void 0===(r=n[e]))return this;if(r===t||r.listener===t)0==--this._eventsCount?this._events=Object.create(null):(delete n[e],n.removeListener&&this.emit("removeListener",e,r.listener||t));else if("function"!=typeof r){for(i=-1,o=r.length-1;o>=0;o--)if(r[o]===t||r[o].listener===t){s=r[o].listener,i=o;break}if(i<0)return this;0===i?r.shift():g(r,i),1===r.length&&(n[e]=r[0]),void 0!==n.removeListener&&this.emit("removeListener",e,s||t)}return this},s.prototype.off=s.prototype.removeListener,s.prototype.removeAllListeners=function(e){var t,r,n;if(void 0===(r=this._events))return this;if(void 0===r.removeListener)return 0==arguments.length?(this._events=Object.create(null),this._eventsCount=0):void 0!==r[e]&&(0==--this._eventsCount?this._events=Object.create(null):delete r[e]),this;if(0==arguments.length){var i,o=Object.keys(r);for(n=0;n<o.length;++n)"removeListener"!==(i=o[n])&&this.removeAllListeners(i);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if("function"==typeof(t=r[e]))this.removeListener(e,t);else if(void 0!==t)for(n=t.length-1;n>=0;n--)this.removeListener(e,t[n]);return this},s.prototype.listeners=function(e){return h(this,e,!0)},s.prototype.rawListeners=function(e){return h(this,e,!1)},s.listenerCount=function(e,t){return"function"==typeof e.listenerCount?e.listenerCount(t):p.call(e,t)},s.prototype.listenerCount=p,s.prototype.eventNames=function(){return this._eventsCount>0?t(this._events):[]}},67918:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){function i(e){return e instanceof r?e:new r(function(t){t(e)})}return new(r||(r=Promise))(function(r,o){function s(e){try{c(n.next(e))}catch(e){o(e)}}function a(e){try{c(n.throw(e))}catch(e){o(e)}}function c(e){e.done?r(e.value):i(e.value).then(s,a)}c((n=n.apply(e,t||[])).next())})},i=this&&this.__generator||function(e,t){var r,n,i,o,s={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function a(e){return function(t){return c([e,t])}}function c(o){if(r)throw 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=(i=s.trys).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(e){o=[6,e],n=0}finally{r=i=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}};
30Object.defineProperty(t,"__esModule",{value:!0});var o=r(65392),s=r(71141);function a(e,t){return void 0===t&&(t={}),n(this,void 0,void 0,function(){return i(this,function(r){switch(r.label){case 0:return[4,new c(e,o.getSanitizedOptions(t)).execute()];case 1:return[2,r.sent()]}})})}t.backOff=a;var c=function(){function e(e,t){this.request=e,this.options=t,this.attemptNumber=0}return e.prototype.execute=function(){return n(this,void 0,void 0,function(){var e;return i(this,function(t){switch(t.label){case 0:if(this.attemptLimitReached)return[3,7];t.label=1;case 1:return t.trys.push([1,4,,6]),[4,this.applyDelay()];case 2:return t.sent(),[4,this.request()];case 3:return[2,t.sent()];case 4:return e=t.sent(),this.attemptNumber++,[4,this.options.retry(e,this.attemptNumber)];case 5:if(!t.sent()||this.attemptLimitReached)throw e;return[3,6];case 6:return[3,0];case 7:throw Error("Something went wrong.")}})})},Object.defineProperty(e.prototype,"attemptLimitReached",{get:function(){return this.attemptNumber>=this.options.numOfAttempts},enumerable:!0,configurable:!0}),e.prototype.applyDelay=function(){return n(this,void 0,void 0,function(){return i(this,function(e){switch(e.label){case 0:return[4,s.DelayFactory(this.options,this.attemptNumber).apply()];case 1:return e.sent(),[2]}})})},e}()},98824:function(e,t,r){"use strict";var n=this&&this.__extends||function(){var e=function(t,r){return(e=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(t,r)};return function(t,r){function n(){this.constructor=t}e(t,r),t.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}();Object.defineProperty(t,"__esModule",{value:!0});var i=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return n(t,e),t}(r(16928).Delay);t.AlwaysDelay=i},16928:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(27159),i=function(){function e(e){this.options=e,this.attempt=0}return e.prototype.apply=function(){var e=this;return new Promise(function(t){return setTimeout(t,e.jitteredDelay)})},e.prototype.setAttemptNumber=function(e){this.attempt=e},Object.defineProperty(e.prototype,"jitteredDelay",{get:function(){return n.JitterFactory(this.options)(this.delay)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"delay",{get:function(){return Math.min(this.options.startingDelay*Math.pow(this.options.timeMultiple,this.numOfDelayedAttempts),this.options.maxDelay)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"numOfDelayedAttempts",{get:function(){return this.attempt},enumerable:!0,configurable:!0}),e}();t.Delay=i},71141:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(2930),i=r(98824);function o(e,t){var r=s(e);return r.setAttemptNumber(t),r}function s(e){return e.delayFirstAttempt?new i.AlwaysDelay(e):new n.SkipFirstDelay(e)}t.DelayFactory=o},2930:function(e,t,r){"use strict";var n=this&&this.__extends||function(){var e=function(t,r){return(e=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(t,r)};return function(t,r){function n(){this.constructor=t}e(t,r),t.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),i=this&&this.__awaiter||function(e,t,r,n){function i(e){return e instanceof r?e:new r(function(t){t(e)})}return new(r||(r=Promise))(function(r,o){function s(e){try{c(n.next(e))}catch(e){o(e)}}function a(e){try{c(n.throw(e))}catch(e){o(e)}}function c(e){e.done?r(e.value):i(e.value).then(s,a)}c((n=n.apply(e,t||[])).next())})},o=this&&this.__generator||function(e,t){var r,n,i,o,s={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function a(e){return function(t){return c([e,t])}}function c(o){if(r)throw 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=(i=s.trys).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(e){o=[6,e],n=0}finally{r=i=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}};
30Object.defineProperty(t,"__esModule",{value:!0});var s=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return n(t,e),t.prototype.apply=function(){return i(this,void 0,void 0,function(){return o(this,function(t){return[2,!!this.isFirstAttempt||e.prototype.apply.call(this)]})})},Object.defineProperty(t.prototype,"isFirstAttempt",{get:function(){return 0===this.attempt},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"numOfDelayedAttempts",{get:function(){return this.attempt-1},enumerable:!0,configurable:!0}),t}(r(16928).Delay);t.SkipFirstDelay=s},54208:(e,t)=>{"use strict";function r(e){return Math.round(Math.random()*e)}Object.defineProperty(t,"__esModule",{value:!0}),t.fullJitter=r},27159:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(54208),i=r(56316);function o(e){return"full"===e.jitter?n.fullJitter:i.noJitter}t.JitterFactory=o},56316:(e,t)=>{"use strict";function r(e){return e}Object.defineProperty(t,"__esModule",{value:!0}),t.noJitter=r},65392:function(e,t){"use strict";var r=this&&this.__assign||function(){return(r=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var i in t=arguments[r])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e}).apply(this,arguments)};Object.defineProperty(t,"__esModule",{value:!0});var n={delayFirstAttempt:!1,jitter:"none",maxDelay:1/0,numOfAttempts:10,retry:function(){return!0},startingDelay:100,timeMultiple:2};function i(e){var t=r(r({},n),e);return t.numOfAttempts<1&&(t.numOfAttempts=1),t}t.getSanitizedOptions=i},85979:e=>{"use strict";e.exports=function e(t,r){if(t===r)return!0;if(t&&r&&"object"==typeof t&&"object"==typeof r){if(t.constructor!==r.constructor)return!1;if(Array.isArray(t)){if((n=t.length)!=r.length)return!1;for(i=n;0!=i--;)if(!e(t[i],r[i]))return!1;return!0}if(t.constructor===RegExp)return t.source===r.source&&t.flags===r.flags;if(t.valueOf!==Object.prototype.valueOf)return t.valueOf()===r.valueOf();if(t.toString!==Object.prototype.toString)return t.toString()===r.toString();if((n=(o=Object.keys(t)).length)!==Object.keys(r).length)return!1;for(i=n;0!=i--;)if(!Object.prototype.hasOwnProperty.call(r,o[i]))return!1;for(i=n;0!=i--;){var n,i,o,s=o[i];if(!e(t[s],r[s]))return!1}return!0}return t!=t&&r!=r}},98287:e=>{"use strict";e.exports=function(e,t){for(var r={},n=Object.keys(e),i=Array.isArray(t),o=0;o<n.length;o++){var s=n[o],a=e[s];(i?-1!==t.indexOf(s):t(s,a,e))&&(r[s]=a)}return r}},88167:(e,t,r)=>{for(var n=r(53964),i=r(23905),o=/[\{\[]/,s=/[\}\]]/,a=["do","if","in","for","let","new","try","var","case","else","enum","eval","null","this","true","void","with","await","break","catch","class","const","false","super","throw","while","yield","delete","export","import","public","return","static","switch","typeof","default","extends","finally","package","private","continue","debugger","function","arguments","interface","protected","implements","instanceof","NaN","undefined"],c={},u=0;u<a.length;u++)c[a[u]]=!0;var l=function(e){return i(e)&&!c.hasOwnProperty(e)},d={s:function(e){return""+e},d:function(e){return""+Number(e)},o:function(e){return JSON.stringify(e)}},f=function(){var e=[],t=0,r={},a=function(r){for(var n="";n.length<2*t;)n+=" ";e.push(n+r)},c=function(e){if(s.test(e.trim()[0])&&o.test(e[e.length-1])){t--,a(e),t++;return}if(o.test(e[e.length-1])){a(e),t++;return}if(s.test(e.trim()[0])){t--,a(e);return}a(e)},u=function(e){if(!e)return u;if(1==arguments.length&&e.indexOf("\n")>-1)for(var t=e.trim().split("\n"),r=0;r<t.length;r++)c(t[r].trim());else c(n.format.apply(n,arguments));return u};return u.scope={},u.formats=d,u.sym=function(e){return e&&l(e)||(e="tmp"),r[e]||(r[e]=0),e+(r[e]++||"")},u.property=function(e,t){return(1==arguments.length&&(t=e,e=""),i(t+=""))?e?e+"."+t:t:e?e+"["+JSON.stringify(t)+"]":JSON.stringify(t)},u.toString=function(){return e.join("\n")},u.toFunction=function(e){e||(e={});var t="return ("+u.toString()+")";Object.keys(u.scope).forEach(function(t){e[t]||(e[t]=u.scope[t])});var r=Object.keys(e).map(function(e){return e}),n=r.map(function(t){return e[t]});return Function.apply(null,r.concat(t)).apply(null,n)},arguments.length&&u.apply(null,arguments),u};f.formats=d,e.exports=f},84792:(e,t,r)=>{var n=r(23905),i=function(e,t){return n(t)?e+"."+t:e+"["+JSON.stringify(t)+"]"};i.valid=n,i.property=function(e){return n(e)?e:JSON.stringify(e)},e.exports=i},67432:(e,t,r)=>{var n=t;n.utils=r(5362),n.common=r(34372),n.sha=r(97729),n.ripemd=r(17394),n.hmac=r(57690),n.sha1=n.sha.sha1,n.sha256=n.sha.sha256,n.sha224=n.sha.sha224,n.sha384=n.sha.sha384,n.sha512=n.sha.sha512,n.ripemd160=n.ripemd.ripemd160},34372:(e,t,r)=>{"use strict";var n=r(5362),i=r(45067);function o(){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}
vendor: 9,620 bytes, line 30
30t.BlockHash=o,o.prototype.update=function(e,t){if(e=n.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=n.join32(e,0,e.length-r,this.endian);for(var i=0;i<e.length;i+=this._delta32)this._update(e,i,i+this._delta32)}return this},o.prototype.digest=function(e){return this.update(this._pad()),i(null===this.pending),this._digest(e)},o.prototype._pad=function(){var e=this.pendingTotal,t=this._delta8,r=t-(e+this.padLength)%t,n=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(o=8,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<this.padLength;o++)n[i++]=0;return n}},57690:(e,t,r)=>{"use strict";var n=r(5362),i=r(45067);function o(e,t,r){if(!(this instanceof o))return new o(e,t,r);this.Hash=e,this.blockSize=e.blockSize/8,this.outSize=e.outSize/8,this.inner=null,this.outer=null,this._init(n.toArray(t,r))}e.exports=o,o.prototype._init=function(e){e.length>this.blockSize&&(e=new this.Hash().update(e).digest()),i(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(t=0,this.inner=new this.Hash().update(e);t<e.length;t++)e[t]^=106;this.outer=new this.Hash().update(e)},o.prototype.update=function(e,t){return this.inner.update(e,t),this},o.prototype.digest=function(e){return this.outer.update(this.inner.digest()),this.outer.digest(e)}},17394:(e,t,r)=>{"use strict";var n=r(5362),i=r(34372),o=n.rotl32,s=n.sum32,a=n.sum32_3,c=n.sum32_4,u=i.BlockHash;function l(){if(!(this instanceof l))return new l;u.call(this),this.h=[0x67452301,0xefcdab89,0x98badcfe,0x10325476,0xc3d2e1f0],this.endian="little"}function d(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 f(e){return e<=15?0:e<=31?0x5a827999:e<=47?0x6ed9eba1:e<=63?0x8f1bbcdc:0xa953fd4e}function h(e){return e<=15?0x50a28be6:e<=31?0x5c4dd124:e<=47?0x6d703ef3:e<=63?0x7a6d76e9:0}n.inherits(l,u),t.ripemd160=l,l.blockSize=512,l.outSize=160,l.hmacStrength=192,l.padLength=64,l.prototype._update=function(e,t){for(var r=this.h[0],n=this.h[1],i=this.h[2],u=this.h[3],l=this.h[4],b=r,v=n,w=i,_=u,E=l,S=0;S<80;S++){var x=s(o(c(r,d(S,n,i,u),e[p[S]+t],f(S)),g[S]),l);r=l,l=u,u=o(i,10),i=n,n=x,x=s(o(c(b,d(79-S,v,w,_),e[y[S]+t],h(S)),m[S]),E),b=E,E=_,_=o(w,10),w=v,v=x}x=a(this.h[1],i,_),this.h[1]=a(this.h[2],u,E),this.h[2]=a(this.h[3],l,b),this.h[3]=a(this.h[4],r,v),this.h[4]=a(this.h[0],n,w),this.h[0]=x},l.prototype._digest=function(e){return"hex"===e?n.toHex32(this.h,"little"):n.split32(this.h,"little")};var p=[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],y=[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],g=[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],m=[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]},97729:(e,t,r)=>{"use strict";t.sha1=r(61573),t.sha224=r(35994),t.sha256=r(12171),t.sha384=r(4859),t.sha512=r(48122)},61573:(e,t,r)=>{"use strict";var n=r(5362),i=r(34372),o=r(69359),s=n.rotl32,a=n.sum32,c=n.sum32_5,u=o.ft_1,l=i.BlockHash,d=[0x5a827999,0x6ed9eba1,0x8f1bbcdc,0xca62c1d6];function f(){if(!(this instanceof f))return new f;l.call(this),this.h=[0x67452301,0xefcdab89,0x98badcfe,0x10325476,0xc3d2e1f0],this.W=Array(80)}n.inherits(f,l),e.exports=f,f.blockSize=512,f.outSize=160,f.hmacStrength=80,f.padLength=64,f.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]=s(r[n-3]^r[n-8]^r[n-14]^r[n-16],1);var i=this.h[0],o=this.h[1],l=this.h[2],f=this.h[3],h=this.h[4];for(n=0;n<r.length;n++){var p=~~(n/20),y=c(s(i,5),u(p,o,l,f),h,r[n],d[p]);h=f,f=l,l=s(o,30),o=i,i=y}this.h[0]=a(this.h[0],i),this.h[1]=a(this.h[1],o),this.h[2]=a(this.h[2],l),this.h[3]=a(this.h[3],f),this.h[4]=a(this.h[4],h)},f.prototype._digest=function(e){return"hex"===e?n.toHex32(this.h,"big"):n.split32(this.h,"big")}},35994:(e,t,r)=>{"use strict";var n=r(5362),i=r(12171);function o(){if(!(this instanceof o))return new o;i.call(this),this.h=[0xc1059ed8,0x367cd507,0x3070dd17,0xf70e5939,0xffc00b31,0x68581511,0x64f98fa7,0xbefa4fa4]}n.inherits(o,i),e.exports=o,o.blockSize=512,o.outSize=224,o.hmacStrength=192,o.padLength=64,o.prototype._digest=function(e){return"hex"===e?n.toHex32(this.h.slice(0,7),"big"):n.split32(this.h.slice(0,7),"big")}},12171:(e,t,r)=>{"use strict";var n=r(5362),i=r(34372),o=r(69359),s=r(45067),a=n.sum32,c=n.sum32_4,u=n.sum32_5,l=o.ch32,d=o.maj32,f=o.s0_256,h=o.s1_256,p=o.g0_256,y=o.g1_256,g=i.BlockHash,m=[0x428a2f98,0x71374491,0xb5c0fbcf,0xe9b5dba5,0x3956c25b,0x59f111f1,0x923f82a4,0xab1c5ed5,0xd807aa98,0x12835b01,0x243185be,0x550c7dc3,0x72be5d74,0x80deb1fe,0x9bdc06a7,0xc19bf174,0xe49b69c1,0xefbe4786,0xfc19dc6,0x240ca1cc,0x2de92c6f,0x4a7484aa,0x5cb0a9dc,0x76f988da,0x983e5152,0xa831c66d,0xb00327c8,0xbf597fc7,0xc6e00bf3,0xd5a79147,0x6ca6351,0x14292967,0x27b70a85,0x2e1b2138,0x4d2c6dfc,0x53380d13,0x650a7354,0x766a0abb,0x81c2c92e,0x92722c85,0xa2bfe8a1,0xa81a664b,0xc24b8b70,0xc76c51a3,0xd192e819,0xd6990624,0xf40e3585,0x106aa070,0x19a4c116,0x1e376c08,0x2748774c,0x34b0bcb5,0x391c0cb3,0x4ed8aa4a,0x5b9cca4f,0x682e6ff3,0x748f82ee,0x78a5636f,0x84c87814,0x8cc70208,0x90befffa,0xa4506ceb,0xbef9a3f7,0xc67178f2];function b(){if(!(this instanceof b))return new b;g.call(this),this.h=[0x6a09e667,0xbb67ae85,0x3c6ef372,0xa54ff53a,0x510e527f,0x9b05688c,0x1f83d9ab,0x5be0cd19],this.k=m,this.W=Array(64)}n.inherits(b,g),e.exports=b,b.blockSize=512,b.outSize=256,b.hmacStrength=192,b.padLength=64,b.prototype._update=function(e,t){for(var r=this.W,n=0;n<16;n++)r[n]=e[t+n];for(;n<r.length;n++)r[n]=c(y(r[n-2]),r[n-7],p(r[n-15]),r[n-16]);var i=this.h[0],o=this.h[1],g=this.h[2],m=this.h[3],b=this.h[4],v=this.h[5],w=this.h[6],_=this.h[7];for(s(this.k.length===r.length),n=0;n<r.length;n++){var E=u(_,h(b),l(b,v,w),this.k[n],r[n]),S=a(f(i),d(i,o,g));_=w,w=v,v=b,b=a(m,E),m=g,g=o,o=i,i=a(E,S)}this.h[0]=a(this.h[0],i),this.h[1]=a(this.h[1],o),this.h[2]=a(this.h[2],g),this.h[3]=a(this.h[3],m),this.h[4]=a(this.h[4],b),this.h[5]=a(this.h[5],v),this.h[6]=a(this.h[6],w),this.h[7]=a(this.h[7],_)},b.prototype._digest=function(e){return"hex"===e?n.toHex32(this.h,"big"):n.split32(this.h,"big")}},4859:(e,t,r)=>{"use strict";var n=r(5362),i=r(48122);function o(){if(!(this instanceof o))return new o;i.call(this),this.h=[0xcbbb9d5d,0xc1059ed8,0x629a292a,0x367cd507,0x9159015a,0x3070dd17,0x152fecd8,0xf70e5939,0x67332667,0xffc00b31,0x8eb44a87,0x68581511,0xdb0c2e0d,0x64f98fa7,0x47b5481d,0xbefa4fa4]}n.inherits(o,i),e.exports=o,o.blockSize=1024,o.outSize=384,o.hmacStrength=192,o.padLength=128,o.prototype._digest=function(e){return"hex"===e?n.toHex32(this.h.slice(0,12),"big"):n.split32(this.h.slice(0,12),"big")}},48122:(e,t,r)=>{"use strict";var n=r(5362),i=r(34372),o=r(45067),s=n.rotr64_hi,a=n.rotr64_lo,c=n.shr64_hi,u=n.shr64_lo,l=n.sum64,d=n.sum64_hi,f=n.sum64_lo,h=n.sum64_4_hi,p=n.sum64_4_lo,y=n.sum64_5_hi,g=n.sum64_5_lo,m=i.BlockHash,b=[0x428a2f98,0xd728ae22,0x71374491,0x23ef65cd,0xb5c0fbcf,0xec4d3b2f,0xe9b5dba5,0x8189dbbc,0x3956c25b,0xf348b538,0x59f111f1,0xb605d019,0x923f82a4,0xaf194f9b,0xab1c5ed5,0xda6d8118,0xd807aa98,0xa3030242,0x12835b01,0x45706fbe,0x243185be,0x4ee4b28c,0x550c7dc3,0xd5ffb4e2,0x72be5d74,0xf27b896f,0x80deb1fe,0x3b1696b1,0x9bdc06a7,0x25c71235,0xc19bf174,0xcf692694,0xe49b69c1,0x9ef14ad2,0xefbe4786,0x384f25e3,0xfc19dc6,0x8b8cd5b5,0x240ca1cc,0x77ac9c65,0x2de92c6f,0x592b0275,0x4a7484aa,0x6ea6e483,0x5cb0a9dc,0xbd41fbd4,0x76f988da,0x831153b5,0x983e5152,0xee66dfab,0xa831c66d,0x2db43210,0xb00327c8,0x98fb213f,0xbf597fc7,0xbeef0ee4,0xc6e00bf3,0x3da88fc2,0xd5a79147,0x930aa725,0x6ca6351,0xe003826f,0x14292967,0xa0e6e70,0x27b70a85,0x46d22ffc,0x2e1b2138,0x5c26c926,0x4d2c6dfc,0x5ac42aed,0x53380d13,0x9d95b3df,0x650a7354,0x8baf63de,0x766a0abb,0x3c77b2a8,0x81c2c92e,0x47edaee6,0x92722c85,0x1482353b,0xa2bfe8a1,0x4cf10364,0xa81a664b,0xbc423001,0xc24b8b70,0xd0f89791,0xc76c51a3,0x654be30,0xd192e819,0xd6ef5218,0xd6990624,0x5565a910,0xf40e3585,0x5771202a,0x106aa070,0x32bbd1b8,0x19a4c116,0xb8d2d0c8,0x1e376c08,0x5141ab53,0x2748774c,0xdf8eeb99,0x34b0bcb5,0xe19b48a8,0x391c0cb3,0xc5c95a63,0x4ed8aa4a,0xe3418acb,0x5b9cca4f,0x7763e373,0x682e6ff3,0xd6b2b8a3,0x748f82ee,0x5defb2fc,0x78a5636f,0x43172f60,0x84c87814,0xa1f0ab72,0x8cc70208,0x1a6439ec,0x90befffa,0x23631e28,0xa4506ceb,0xde82bde9,0xbef9a3f7,0xb2c67915,0xc67178f2,0xe372532b,0xca273ece,0xea26619c,0xd186b8c7,0x21c0c207,0xeada7dd6,0xcde0eb1e,0xf57d4f7f,0xee6ed178,0x6f067aa,0x72176fba,0xa637dc5,0xa2c898a6,0x113f9804,0xbef90dae,0x1b710b35,0x131c471b,0x28db77f5,0x23047d84,0x32caab7b,0x40c72493,0x3c9ebe0a,0x15c9bebc,0x431d67c4,0x9c100d4c,0x4cc5d4be,0xcb3e42b6,0x597f299c,0xfc657e2a,0x5fcb6fab,0x3ad6faec,0x6c44198c,0x4a475817];function v(){if(!(this instanceof v))return new v;
30m.call(this),this.h=[0x6a09e667,0xf3bcc908,0xbb67ae85,0x84caa73b,0x3c6ef372,0xfe94f82b,0xa54ff53a,0x5f1d36f1,0x510e527f,0xade682d1,0x9b05688c,0x2b3e6c1f,0x1f83d9ab,0xfb41bd6b,0x5be0cd19,0x137e2179],this.k=b,this.W=Array(160)}function w(e,t,r,n,i){var o=e&r^~e&i;return o<0&&(o+=0x100000000),o}function _(e,t,r,n,i,o){var s=t&n^~t&o;return s<0&&(s+=0x100000000),s}function E(e,t,r,n,i){var o=e&r^e&i^r&i;return o<0&&(o+=0x100000000),o}function S(e,t,r,n,i,o){var s=t&n^t&o^n&o;return s<0&&(s+=0x100000000),s}function x(e,t){var r=s(e,t,28)^s(t,e,2)^s(t,e,7);return r<0&&(r+=0x100000000),r}function A(e,t){var r=a(e,t,28)^a(t,e,2)^a(t,e,7);return r<0&&(r+=0x100000000),r}function I(e,t){var r=s(e,t,14)^s(e,t,18)^s(t,e,9);return r<0&&(r+=0x100000000),r}function O(e,t){var r=a(e,t,14)^a(e,t,18)^a(t,e,9);return r<0&&(r+=0x100000000),r}function T(e,t){var r=s(e,t,1)^s(e,t,8)^c(e,t,7);return r<0&&(r+=0x100000000),r}function P(e,t){var r=a(e,t,1)^a(e,t,8)^u(e,t,7);return r<0&&(r+=0x100000000),r}function M(e,t){var r=s(e,t,19)^s(t,e,29)^c(e,t,6);return r<0&&(r+=0x100000000),r}function N(e,t){var r=a(e,t,19)^a(t,e,29)^u(e,t,6);return r<0&&(r+=0x100000000),r}n.inherits(v,m),e.exports=v,v.blockSize=1024,v.outSize=512,v.hmacStrength=192,v.padLength=128,v.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=M(r[n-4],r[n-3]),o=N(r[n-4],r[n-3]),s=r[n-14],a=r[n-13],c=T(r[n-30],r[n-29]),u=P(r[n-30],r[n-29]),l=r[n-32],d=r[n-31];r[n]=h(i,o,s,a,c,u,l,d),r[n+1]=p(i,o,s,a,c,u,l,d)}},v.prototype._update=function(e,t){this._prepareBlock(e,t);var r=this.W,n=this.h[0],i=this.h[1],s=this.h[2],a=this.h[3],c=this.h[4],u=this.h[5],h=this.h[6],p=this.h[7],m=this.h[8],b=this.h[9],v=this.h[10],T=this.h[11],P=this.h[12],M=this.h[13],N=this.h[14],k=this.h[15];o(this.k.length===r.length);for(var C=0;C<r.length;C+=2){var D=N,j=k,R=I(m,b),L=O(m,b),B=w(m,b,v,T,P,M),U=_(m,b,v,T,P,M),$=this.k[C],K=this.k[C+1],F=r[C],z=r[C+1],q=y(D,j,R,L,B,U,$,K,F,z),V=g(D,j,R,L,B,U,$,K,F,z);D=x(n,i);var H=d(D,j=A(n,i),R=E(n,i,s,a,c,u),L=S(n,i,s,a,c,u)),G=f(D,j,R,L);N=P,k=M,P=v,M=T,v=m,T=b,m=d(h,p,q,V),b=f(p,p,q,V),h=c,p=u,c=s,u=a,s=n,a=i,n=d(q,V,H,G),i=f(q,V,H,G)}l(this.h,0,n,i),l(this.h,2,s,a),l(this.h,4,c,u),l(this.h,6,h,p),l(this.h,8,m,b),l(this.h,10,v,T),l(this.h,12,P,M),l(this.h,14,N,k)},v.prototype._digest=function(e){return"hex"===e?n.toHex32(this.h,"big"):n.split32(this.h,"big")}},69359:(e,t,r)=>{"use strict";var n=r(5362).rotr32;function i(e,t,r,n){return 0===e?o(t,r,n):1===e||3===e?a(t,r,n):2===e?s(t,r,n):void 0}function o(e,t,r){return e&t^~e&r}function s(e,t,r){return e&t^e&r^t&r}function a(e,t,r){return e^t^r}function c(e){return n(e,2)^n(e,13)^n(e,22)}function u(e){return n(e,6)^n(e,11)^n(e,25)}function l(e){return n(e,7)^n(e,18)^e>>>3}function d(e){return n(e,17)^n(e,19)^e>>>10}t.ft_1=i,t.ch32=o,t.maj32=s,t.p32=a,t.s0_256=c,t.s1_256=u,t.g0_256=l,t.g1_256=d},5362:(e,t,r)=>{"use strict";var n=r(45067),i=r(54448);function o(e,t){return(64512&e.charCodeAt(t))==55296&&!(t<0)&&!(t+1>=e.length)&&(64512&e.charCodeAt(t+1))==56320}function s(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]+/ig,"")).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 s=e.charCodeAt(i);s<128?r[n++]=s:(s<2048?r[n++]=s>>6|192:(o(e,i)?(s=65536+((1023&s)<<10)+(1023&e.charCodeAt(++i)),r[n++]=s>>18|240,r[n++]=s>>12&63|128):r[n++]=s>>12|224,r[n++]=s>>6&63|128),r[n++]=63&s|128)}}else for(i=0;i<e.length;i++)r[i]=0|e[i];return r}function a(e){for(var t="",r=0;r<e.length;r++)t+=l(e[r].toString(16));return t}function c(e){return(e>>>24|e>>>8&65280|e<<8&0xff0000|(255&e)<<24)>>>0}function u(e,t){for(var r="",n=0;n<e.length;n++){var i=e[n];"little"===t&&(i=c(i)),r+=d(i.toString(16))}return r}function l(e){return 1===e.length?"0"+e:e}function d(e){if(7===e.length)return"0"+e;if(6===e.length)return"00"+e;if(5===e.length)return"000"+e;if(4===e.length)return"0000"+e;if(3===e.length)return"00000"+e;if(2===e.length)return"000000"+e;if(1===e.length)return"0000000"+e;else return e}
30function f(e,t,r,i){var o,s=r-t;n(s%4==0);for(var a=Array(s/4),c=0,u=t;c<a.length;c++,u+=4)o="big"===i?e[u]<<24|e[u+1]<<16|e[u+2]<<8|e[u+3]:e[u+3]<<24|e[u+2]<<16|e[u+1]<<8|e[u],a[c]=o>>>0;return a}function h(e,t){for(var r=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}function p(e,t){return e>>>t|e<<32-t}function y(e,t){return e<<t|e>>>32-t}function g(e,t){return e+t>>>0}function m(e,t,r){return e+t+r>>>0}function b(e,t,r,n){return e+t+r+n>>>0}function v(e,t,r,n,i){return e+t+r+n+i>>>0}function w(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}function _(e,t,r,n){return(t+n>>>0<t?1:0)+e+r>>>0}function E(e,t,r,n){return t+n>>>0}function S(e,t,r,n,i,o,s,a){var c,u=t;return e+r+i+s+(c=0+((u=u+n>>>0)<t?1:0)+((u=u+o>>>0)<o?1:0)+((u=u+a>>>0)<a?1:0))>>>0}function x(e,t,r,n,i,o,s,a){return t+n+o+a>>>0}function A(e,t,r,n,i,o,s,a,c,u){var l,d=t;return e+r+i+s+c+(l=0+((d=d+n>>>0)<t?1:0)+((d=d+o>>>0)<o?1:0)+((d=d+a>>>0)<a?1:0)+((d=d+u>>>0)<u?1:0))>>>0}function I(e,t,r,n,i,o,s,a,c,u){return t+n+o+a+u>>>0}function O(e,t,r){return(t<<32-r|e>>>r)>>>0}function T(e,t,r){return(e<<32-r|t>>>r)>>>0}function P(e,t,r){return e>>>r}function M(e,t,r){return(e<<32-r|t>>>r)>>>0}t.inherits=i,t.toArray=s,t.toHex=a,t.htonl=c,t.toHex32=u,t.zero2=l,t.zero8=d,t.join32=f,t.split32=h,t.rotr32=p,t.rotl32=y,t.sum32=g,t.sum32_3=m,t.sum32_4=b,t.sum32_5=v,t.sum64=w,t.sum64_hi=_,t.sum64_lo=E,t.sum64_4_hi=S,t.sum64_4_lo=x,t.sum64_5_hi=A,t.sum64_5_lo=I,t.rotr64_hi=O,t.rotr64_lo=T,t.shr64_hi=P,t.shr64_lo=M},16205:(e,t,r)=>{"use strict";var n=r(67432),i=r(5897),o=r(45067);function s(e){if(!(this instanceof s))return new s(e);this.hash=e.hash,this.predResist=!!e.predResist,this.outLen=this.hash.outSize,this.minEntropy=e.minEntropy||this.hash.hmacStrength,this._reseed=null,this.reseedInterval=null,this.K=null,this.V=null;var t=i.toArray(e.entropy,e.entropyEnc||"hex"),r=i.toArray(e.nonce,e.nonceEnc||"hex"),n=i.toArray(e.pers,e.persEnc||"hex");o(t.length>=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._init(t,r,n)}e.exports=s,s.prototype._init=function(e,t,r){var n=e.concat(t).concat(r);this.K=Array(this.outLen/8),this.V=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=0x1000000000000},s.prototype._hmac=function(){return new n.hmac(this.hash,this.K)},s.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())},s.prototype.reseed=function(e,t,r,n){"string"!=typeof t&&(n=r,r=t,t=null),e=i.toArray(e,t),r=i.toArray(r,n),o(e.length>=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._update(e.concat(r||[])),this._reseed=1},s.prototype.generate=function(e,t,r,n){if(this._reseed>this.reseedInterval)throw Error("Reseed is required");"string"!=typeof t&&(n=r,r=t,t=null),r&&(r=i.toArray(r,n||"hex"),this._update(r));for(var o=[];o.length<e;)this.V=this._hmac().update(this.V).digest(),o=o.concat(this.V);var s=o.slice(0,e);return this._update(r),this._reseed++,i.encode(s,t)}},81981:(e,t,r)=>{"use strict";var n=r(91905)("http-errors"),i=r(17690),o=r(69407),s=r(45248),a=r(97807);function c(e){return Number(String(e).charAt(0)+"00")}function u(){for(var e,t,r=500,i={},s=0;s<arguments.length;s++){var a=arguments[s];if(a instanceof Error){r=(e=a).status||e.statusCode||r;continue}switch(typeof a){case"string":t=a;break;case"number":r=a,0!==s&&n("non-first-argument status code; replace with createError("+a+", ...)");break;case"object":i=a}}"number"==typeof r&&(r<400||r>=600)&&n("non-error status code; use only 4xx or 5xx status codes"),("number"!=typeof r||!o[r]&&(r<400||r>=600))&&(r=500);var l=u[r]||u[c(r)];for(var d in e||Error.captureStackTrace(e=l?new l(t):Error(t||o[r]),u),l&&e instanceof l&&e.status===r||(e.expose=r<500,e.status=e.statusCode=r),i)"status"!==d&&"statusCode"!==d&&(e[d]=i[d]);return e}function l(){function e(){throw TypeError("cannot construct abstract class")}return s(e,Error),e}function d(e,t,r){var n=t.match(/Error$/)?t:t+"Error";function a(e){var t=null!=e?e:o[r],s=Error(t);return Error.captureStackTrace(s,a),i(s,a.prototype),Object.defineProperty(s,"message",{enumerable:!0,configurable:!0,value:t,writable:!0}
30),Object.defineProperty(s,"name",{enumerable:!1,configurable:!0,value:n,writable:!0}),s}return s(a,e),h(a,n),a.prototype.status=r,a.prototype.statusCode=r,a.prototype.expose=!0,a}function f(e,t,r){var n=t.match(/Error$/)?t:t+"Error";function a(e){var t=null!=e?e:o[r],s=Error(t);return Error.captureStackTrace(s,a),i(s,a.prototype),Object.defineProperty(s,"message",{enumerable:!0,configurable:!0,value:t,writable:!0}),Object.defineProperty(s,"name",{enumerable:!1,configurable:!0,value:n,writable:!0}),s}return s(a,e),h(a,n),a.prototype.status=r,a.prototype.statusCode=r,a.prototype.expose=!1,a}function h(e,t){var r=Object.getOwnPropertyDescriptor(e,"name");r&&r.configurable&&(r.value=t,Object.defineProperty(e,"name",r))}function p(e,t,r){t.forEach(function(t){var n,i=a(o[t]);switch(c(t)){case 400:n=d(r,i,t);break;case 500:n=f(r,i,t)}n&&(e[t]=n,e[i]=n)}),e["I'mateapot"]=n.function(e.ImATeapot,'"I\'mateapot"; use "ImATeapot" instead')}e.exports=u,e.exports.HttpError=l(),p(e.exports,o.codes,e.exports.HttpError)},91905:e=>{"use strict";function t(e){if(!e)throw TypeError("argument namespace is required");function t(e){}return t._file=void 0,t._ignored=!0,t._namespace=e,t._traced=!1,t._warned=Object.create(null),t.function=r,t.property=n,t}function r(e,t){if("function"!=typeof e)throw TypeError("argument fn must be a function");return e}function n(e,t,r){if(!e||"object"!=typeof e&&"function"!=typeof e)throw TypeError("argument obj must be object");var n=Object.getOwnPropertyDescriptor(e,t);if(!n)throw TypeError("must call property on owner object");if(!n.configurable)throw TypeError("property must be configurable")}e.exports=t},45248:e=>{"function"==typeof Object.create?e.exports=function(e,t){e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}})}:e.exports=function(e,t){e.super_=t;var r=function(){};r.prototype=t.prototype,e.prototype=new r,e.prototype.constructor=e}},84981:(e,t)=>{t.read=function(e,t,r,n,i){var o,s,a=8*i-n-1,c=(1<<a)-1,u=c>>1,l=-7,d=r?i-1:0,f=r?-1:1,h=e[t+d];for(d+=f,o=h&(1<<-l)-1,h>>=-l,l+=a;l>0;o=256*o+e[t+d],d+=f,l-=8);for(s=o&(1<<-l)-1,o>>=-l,l+=n;l>0;s=256*s+e[t+d],d+=f,l-=8);if(0===o)o=1-u;else{if(o===c)return s?NaN:1/0*(h?-1:1);s+=Math.pow(2,n),o-=u}return(h?-1:1)*s*Math.pow(2,o-n)},t.write=function(e,t,r,n,i,o){var s,a,c,u=8*o-i-1,l=(1<<u)-1,d=l>>1,f=23===i?5960464477539062e-23:0,h=n?0:o-1,p=n?1:-1,y=t<0||0===t&&1/t<0?1:0;for(isNaN(t=Math.abs(t))||t===1/0?(a=isNaN(t)?1:0,s=l):(s=Math.floor(Math.log(t)/Math.LN2),t*(c=Math.pow(2,-s))<1&&(s--,c*=2),s+d>=1?t+=f/c:t+=f*Math.pow(2,1-d),t*c>=2&&(s++,c/=2),s+d>=l?(a=0,s=l):s+d>=1?(a=(t*c-1)*Math.pow(2,i),s+=d):(a=t*Math.pow(2,d-1)*Math.pow(2,i),s=0));i>=8;e[r+h]=255&a,h+=p,a/=256,i-=8);for(s=s<<i|a,u+=i;u>0;e[r+h]=255&s,h+=p,s/=256,u-=8);e[r+h-p]|=128*y}},54448: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}}},36152:e=>{"use strict";e.exports=i,e.exports.isMobile=i,e.exports.default=i;let t=/(android|bb\d+|meego).+mobile|armv7l|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series[46]0|samsungbrowser.*mobile|symbian|treo|up\.(browser|link)|vodafone|wap|windows (ce|phone)|xda|xiino/i,r=/CrOS/,n=/android|ipad|playbook|silk/i;function i(e){e||(e={});let i=e.ua;if(i||"undefined"==typeof navigator||(i=navigator.userAgent),i&&i.headers&&"string"==typeof i.headers["user-agent"]&&(i=i.headers["user-agent"]),"string"!=typeof i)return!1;let o=t.test(i)&&!r.test(i)||!!e.tablet&&n.test(i);return!o&&e.tablet&&e.featureDetect&&navigator&&navigator.maxTouchPoints>1&&-1!==i.indexOf("Macintosh")&&-1!==i.indexOf("Safari")&&(o=!0),o}},25787:e=>{var t=/^\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}$/,r=/\/\d{1,3}(?=%|$)/,n=/\//,i=/%.*$/,o=/([^0-9a-f:/%])/i,s=/([0-9a-f]{5,}|:{3,}|[^:]:$|^:[^:]|\/$)/i;function a(e){if(!t.test(e))return!1;var r=e.split(".");if(4!==r.length||"0"===r[0][0]&&r[0].length>1||"0"===r[1][0]&&r[1].length>1||"0"===r[2][0]&&r[2].length>1||"0"===r[3][0]&&r[3].length>1)return!1;var n=Number(r[0]),i=Number(r[1]),o=Number(r[2]),s=Number(r[3]);return n>=0&&n<256&&i>=0&&i<256&&o>=0&&o<256&&s>=0&&s<256}function c(e){var t=e.replace(r,""),c=e.length!==t.length;if(c||!c&&n.test(e))return!1;var u=t.replace(i,""),l=u.lastIndexOf(":");if(-1===l)return!1;var d=a(u.substring(l+1))?u.substring(0,l+1)+"1234:5678":u;if(o.test(d)||s.test(d))return!1;var f=d.split("::");if(f.length>2)return!1;if(2===f.length){var h=""===f[0]?[]:f[0].split(":"),p=""===f[1]?[]:f[1].split(":");if(8-(h.length+p.length)<=0)return!1}else if(8!==d.split(":").length)return!1;return!0}function u(e){return a(e)||c(e)}e.exports=function(e){if(e||(e={}),4===e.version)return a;
30if(6===e.version)return c;if(null==e.version)return u;throw Error("Unknown version: "+e.version)},e.exports.__all_regexes__=[t,r,n,i,o,s]},86688:(e,t,r)=>{var n=r(25787),i=/\s/,o=/^[a-zA-Z0-9.-]+$/,s=/^([a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9-]{0,61}[a-zA-Z0-9])$/,a=/^\+[0-9][0-9 ]{5,27}[0-9]$/,c=/ {2}/,u=/ /g;t["date-time"]=/^\d{4}-(?:0[0-9]{1}|1[0-2]{1})-[0-9]{2}[tT ]\d{2}:\d{2}:\d{2}(?:\.\d+|)([zZ]|[+-]\d{2}:\d{2})$/,t.date=/^\d{4}-(?:0[0-9]{1}|1[0-2]{1})-[0-9]{2}$/,t.time=/^\d{2}:\d{2}:\d{2}$/,t.email=function(e){return -1!==e.indexOf("@")&&!i.test(e)},t["ip-address"]=t.ipv4=n({version:4}),t.ipv6=n({version:6}),t.uri=/^[a-zA-Z][a-zA-Z0-9+\-.]*:[^\s]*$/,t.color=/(#?([0-9A-Fa-f]{3,6})\b)|(aqua)|(black)|(blue)|(fuchsia)|(gray)|(green)|(lime)|(maroon)|(navy)|(olive)|(orange)|(purple)|(red)|(silver)|(teal)|(white)|(yellow)|(rgb\(\s*\b([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\b\s*,\s*\b([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\b\s*,\s*\b([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\b\s*\))|(rgb\(\s*(\d?\d%|100%)+\s*,\s*(\d?\d%|100%)+\s*,\s*(\d?\d%|100%)+\s*\))/,t.hostname=function(e){if(!o.test(e))return!1;for(var t=e.split("."),r=0;r<t.length;r++)if(!s.test(t[r]))return!1;return!0},t.alpha=/^[a-zA-Z]+$/,t.alphanumeric=/^[a-zA-Z0-9]+$/,t.style=/.:\s*[^;]/g,t.phone=function(e){if(!a.test(e)||c.test(e))return!1;var t=e.substring(1).replace(u,"").length;return t>=7&&t<=15},t["utc-millisec"]=/^[0-9]{1,15}\.?[0-9]{0,15}$/},5344:(e,t,r)=>{var n=r(84792),i=r(88167),o=r(99981),s=r(63512),a=r(86688),c=function(e,t,r){var n=function(e){return e&&e.id===r?e:"object"==typeof e&&e?Object.keys(e).reduce(function(t,r){return t||n(e[r])},null):null},i=n(e);if(i)return i;r=(r=r.replace(/^#/,"")).replace(/\/$/,"");try{return o.get(e,decodeURI(r))}catch(e){var s,a=r.indexOf("#");if(0!==a){if(-1===a)s=t[r];else{s=t[r.slice(0,a)];var c=r.slice(a).replace(/^#/,"");try{return o.get(s,c)}catch(e){}}}else s=t[r];return s||null}},u={};u.any=function(){return"true"},u.null=function(e){return e+" === null"},u.boolean=function(e){return"typeof "+e+' === "boolean"'},u.array=function(e){return"Array.isArray("+e+")"},u.object=function(e){return"typeof "+e+' === "object" && '+e+" && !Array.isArray("+e+")"},u.number=function(e){return"typeof "+e+' === "number" && isFinite('+e+")"},u.integer=function(e){return"typeof "+e+' === "number" && (Math.floor('+e+") === "+e+" || "+e+" > 9007199254740992 || "+e+" < -9007199254740992)"},u.string=function(e){return"typeof "+e+' === "string"'};var l=function(e,t){t=Math.min(-1===t?e.length:t,e.length);for(var r=[],n=0;n<t;n++)r.push("object"==typeof e[n]?JSON.stringify(e[n]):e[n]);for(var n=1;n<r.length;n++)if(r.indexOf(r[n])!==n)return!1;return!0},d=function(e,t){var r,n=(0|t)!==t?Math.pow(10,t.toString().split(".").pop().length):1;return!(r=n>1?((0|e)!==e?Math.pow(10,e.toString().split(".").pop().length):1)>n||Math.round(n*e)%(n*t):e%t)},f=function(e,t,r){return r>-1&&t.length>r||e.test(t)},h=function(e,t,r,o,p){var y=p?s(a,p.formats):a,g={unique:l,formats:y,isMultipleOf:d,testLimitedRegex:f},m=!!p&&!!p.verbose,b=!!p&&void 0!==p.greedy&&p.greedy,v={},w=[],_=function(e){var t=e+(v[e]=(v[e]||0)+1);return w.push(t),t},E=function(e){var t=JSON.stringify(e);try{for(var r=/\[([^\[\]"]+)\]/;r.test(t);)t=t.replace(r,n);return t}catch(t){return JSON.stringify(e)}function n(e,t){if(-1===w.indexOf(t))throw Error("Unreplaceable");return'." + '+t+' + "'}},S={},x=function(e){if(S[e])return S[e];var t=_("pattern");return g[t]=new RegExp(e),S[e]=t,t},A=["i","j","k","l","m","n","o","p","q","r","s","t","u","v","x","y","z"],I=function(){var e=A.shift();return A.push(e+e[0]),w.push(e),e},O=function(e,i,o,s,l){var d=i.properties,f=i.type,v=!1;Array.isArray(i.items)&&(d={},i.items.forEach(function(e,t){d[t]=e}),f="array",v=!0);var w=0,S=function(t,r,n){T("errors++"),!0===o&&(T("if (validate.errors === null) validate.errors = []"),m?T("validate.errors.push({field:%s,message:%s,value:%s,type:%s,schemaPath:%s})",E(r||e),JSON.stringify(t),n||e,JSON.stringify(f),JSON.stringify(l)):T("validate.errors.push({field:%s,message:%s})",E(r||e),JSON.stringify(t)))};!0===i.required?(w++,T("if (%s === undefined) {",e),S("is required"),T("} else {")):(w++,T("if (%s !== undefined) {",e));var A=[].concat(f).map(function(t){if(t&&!u.hasOwnProperty(t))throw Error("Unknown type: "+t);return u[t||"any"](e)}).join(" || ")||"true";if("true"!==A&&(w++,T("if (!(%s)) {",A),S("is the wrong type"),T("} else {")),v){if(!1===i.additionalItems)T("if (%s.length > %d) {",e,i.items.length),S("has additional items"),T("}");else if(i.additionalItems){var P=I();T("for (var %s = %d; %s < %s.length; %s++) {",P,i.items.length,P,e,P),O(e+"["+P+"]",i.additionalItems,o,s,l.concat("additionalItems")),T("}")}}if(i.format&&y[i.format]){"string"!==f&&a[i.format]&&T("if (%s) {",u.string(e));var M=_("format");g[M]=y[i.format],"function"==typeof g[M]?T("if (!%s(%s)) {",M,e):T("if (!testLimitedRegex(%s, %s, %d)) {",M,e,void 0===i.maxLength?-1:i.maxLength),S("must be "+i.format+" format"),T("}"),"string"!==f&&a[i.format]&&T("}")}if(Array.isArray(i.required)){var M=_("missing");T("var %s = 0",M);var N=function(t){var r=n(e,t);T("if (%s === undefined) {",r),S("is required",r),T("%s++",M),T("}")};T("if ((%s)) {","object"!==f?u.object(e):"true"),i.required.map(N),T("}"),!b&&(T("if (%s === 0) {",M),w++)}if(i.uniqueItems&&("array"!==f&&T("if (%s) {",u.array(e)),T("if (!(unique(%s, %d))) {",e,i.maxItems||-1),S("must be unique"),T("}"),"array"!==f&&T("}")),i.enum){var k=i.enum.some(function(e){return"object"==typeof e})?function(t){return"JSON.stringify("+e+") !== JSON.stringify("+JSON.stringify(t)+")"}:function(t){return e+" !== "+JSON.stringify(t)};T("if (%s) {",i.enum.map(k).join(" && ")||"false"),S("must be an enum value"),T("}")}if(i.dependencies&&("object"!==f&&T("if (%s) {",u.object(e)),Object.keys(i.dependencies).forEac
30h(function(t){var r=i.dependencies[t];"string"==typeof r&&(r=[r]);var a=function(t){return n(e,t)+" !== undefined"};Array.isArray(r)&&(T("if (%s !== undefined && !(%s)) {",n(e,t),r.map(a).join(" && ")||"true"),S("dependencies not set"),T("}")),"object"==typeof r&&(T("if (%s !== undefined) {",n(e,t)),O(e,r,o,s,l.concat(["dependencies",t])),T("}"))}),"object"!==f&&T("}")),i.additionalProperties||!1===i.additionalProperties){"object"!==f&&T("if (%s) {",u.object(e));var P=I(),C=_("keys"),D=function(e){return C+"["+P+"] !== "+JSON.stringify(e)},j=function(e){return"!"+x(e)+".test("+C+"["+P+"])"},R=Object.keys(d||{}).map(D).concat(Object.keys(i.patternProperties||{}).map(j)).join(" && ")||"true";T("var %s = Object.keys(%s)",C,e)("for (var %s = 0; %s < %s.length; %s++) {",P,P,C,P)("if (%s) {",R),!1===i.additionalProperties?(s&&T("delete %s",e+"["+C+"["+P+"]]"),S("has additional properties",null,JSON.stringify(e+".")+" + "+C+"["+P+"]")):O(e+"["+C+"["+P+"]]",i.additionalProperties,o,s,l.concat(["additionalProperties"])),T("}")("}"),"object"!==f&&T("}")}if(i.$ref){var L=c(r,p&&p.schemas||{},i.$ref);if(L){var B=t[i.$ref];B||(t[i.$ref]=function(e){return B(e)},B=h(L,t,r,!1,p));var M=_("ref");g[M]=B,T("if (!(%s(%s))) {",M,e),S("referenced schema does not match"),T("}")}}if(i.not){var U=_("prev");T("var %s = errors",U),O(e,i.not,!1,s,l.concat("not")),T("if (%s === errors) {",U),S("negative schema matches"),T("} else {")("errors = %s",U)("}")}if(i.items&&!v){"array"!==f&&T("if (%s) {",u.array(e));var P=I();T("for (var %s = 0; %s < %s.length; %s++) {",P,P,e,P),O(e+"["+P+"]",i.items,o,s,l.concat("items")),T("}"),"array"!==f&&T("}")}if(i.patternProperties){"object"!==f&&T("if (%s) {",u.object(e));var C=_("keys"),P=I();T("var %s = Object.keys(%s)",C,e)("for (var %s = 0; %s < %s.length; %s++) {",P,P,C,P),Object.keys(i.patternProperties).forEach(function(t){var r=x(t);T("if (%s.test(%s)) {",r,C+"["+P+"]"),O(e+"["+C+"["+P+"]]",i.patternProperties[t],o,s,l.concat(["patternProperties",t])),T("}")}),T("}"),"object"!==f&&T("}")}if(i.pattern){var $=x(i.pattern);"string"!==f&&T("if (%s) {",u.string(e)),T("if (!(testLimitedRegex(%s, %s, %d))) {",$,e,void 0===i.maxLength?-1:i.maxLength),S("pattern mismatch"),T("}"),"string"!==f&&T("}")}if(i.allOf&&i.allOf.forEach(function(t,r){O(e,t,o,s,l.concat(["allOf",r]))}),i.anyOf&&i.anyOf.length){var U=_("prev");i.anyOf.forEach(function(t,r){0===r?T("var %s = errors",U):T("if (errors !== %s) {",U)("errors = %s",U),O(e,t,!1,!1,l)}),i.anyOf.forEach(function(e,t){t&&T("}")}),T("if (%s !== errors) {",U),S("no schemas match"),T("}")}if(i.oneOf&&i.oneOf.length){var U=_("prev"),K=_("passes");T("var %s = errors",U)("var %s = 0",K),i.oneOf.forEach(function(t,r){O(e,t,!1,!1,l),T("if (%s === errors) {",U)("%s++",K)("} else {")("errors = %s",U)("}")}),T("if (%s !== 1) {",K),S("no (or more than one) schemas match"),T("}")}for(void 0!==i.multipleOf&&("number"!==f&&"integer"!==f&&T("if (%s) {",u.number(e)),T("if (!isMultipleOf(%s, %d)) {",e,i.multipleOf),S("has a remainder"),T("}"),"number"!==f&&"integer"!==f&&T("}")),void 0!==i.maxProperties&&("object"!==f&&T("if (%s) {",u.object(e)),T("if (Object.keys(%s).length > %d) {",e,i.maxProperties),S("has more properties than allowed"),T("}"),"object"!==f&&T("}")),void 0!==i.minProperties&&("object"!==f&&T("if (%s) {",u.object(e)),T("if (Object.keys(%s).length < %d) {",e,i.minProperties),S("has less properties than allowed"),T("}"),"object"!==f&&T("}")),void 0!==i.maxItems&&("array"!==f&&T("if (%s) {",u.array(e)),T("if (%s.length > %d) {",e,i.maxItems),S("has more items than allowed"),T("}"),"array"!==f&&T("}")),void 0!==i.minItems&&("array"!==f&&T("if (%s) {",u.array(e)),T("if (%s.length < %d) {",e,i.minItems),S("has less items than allowed"),T("}"),"array"!==f&&T("}")),void 0!==i.maxLength&&("string"!==f&&T("if (%s) {",u.string(e)),T("if (%s.length > %d) {",e,i.maxLength),S("has longer length than allowed"),T("}"),"string"!==f&&T("}")),void 0!==i.minLength&&("string"!==f&&T("if (%s) {",u.string(e)),T("if (%s.length < %d) {",e,i.minLength),S("has less length than allowed"),T("}"),"string"!==f&&T("}")),void 0!==i.minimum&&("number"!==f&&"integer"!==f&&T("if (%s) {",u.number(e)),T("if (%s %s %d) {",e,i.exclusiveMinimum?"<=":"<",i.minimum),S("is less than minimum"),T("}"),"number"!==f&&"integer"!==f&&T("}")),void 0!==i.maximum&&("number"!==f&&"integer"!==f&&T("if (%s) {",u.number(e)),T("if (%s %s %d) {",e,i.exclusiveMaximum?">=":">",i.maximum),S("is more than maximum"),T("}"),"number"!==f&&"integer"!==f&&T("}
30")),d&&Object.keys(d).forEach(function(t){Array.isArray(f)&&-1!==f.indexOf("null")&&T("if (%s !== null) {",e),O(n(e,t),d[t],o,s,l.concat(v?t:["properties",t])),Array.isArray(f)&&-1!==f.indexOf("null")&&T("}")});w--;)T("}")},T=i("function validate(data) {")("if (data === undefined) data = null")("validate.errors = null")("var errors = 0");return O("data",e,o,p&&p.filter,[]),T("return errors === 0")("}"),(T=T.toFunction(g)).errors=null,Object.defineProperty&&Object.defineProperty(T,"error",{get:function(){return T.errors?T.errors.map(function(e){return e.field+" "+e.message}).join("\n"):""}}),T.toJSON=function(){return e},T};e.exports=function(e,t){return"string"==typeof e&&(e=JSON.parse(e)),h(e,{},e,!0,t)},e.exports.filter=function(t,r){var n=e.exports(t,s(r,{filter:!0}));return function(e){return n(e),e}}},23905:e=>{"use strict";function t(e
vendor: 10,939 bytes, line 30
30){return/^[$A-Z\_a-z\xaa\xb5\xba\xc0-\xd6\xd8-\xf6\xf8-\u02c1\u02c6-\u02d1\u02e0-\u02e4\u02ec\u02ee\u0370-\u0374\u0376\u0377\u037a-\u037d\u0386\u0388-\u038a\u038c\u038e-\u03a1\u03a3-\u03f5\u03f7-\u0481\u048a-\u0527\u0531-\u0556\u0559\u0561-\u0587\u05d0-\u05ea\u05f0-\u05f2\u0620-\u064a\u066e\u066f\u0671-\u06d3\u06d5\u06e5\u06e6\u06ee\u06ef\u06fa-\u06fc\u06ff\u0710\u0712-\u072f\u074d-\u07a5\u07b1\u07ca-\u07ea\u07f4\u07f5\u07fa\u0800-\u0815\u081a\u0824\u0828\u0840-\u0858\u08a0\u08a2-\u08ac\u0904-\u0939\u093d\u0950\u0958-\u0961\u0971-\u0977\u0979-\u097f\u0985-\u098c\u098f\u0990\u0993-\u09a8\u09aa-\u09b0\u09b2\u09b6-\u09b9\u09bd\u09ce\u09dc\u09dd\u09df-\u09e1\u09f0\u09f1\u0a05-\u0a0a\u0a0f\u0a10\u0a13-\u0a28\u0a2a-\u0a30\u0a32\u0a33\u0a35\u0a36\u0a38\u0a39\u0a59-\u0a5c\u0a5e\u0a72-\u0a74\u0a85-\u0a8d\u0a8f-\u0a91\u0a93-\u0aa8\u0aaa-\u0ab0\u0ab2\u0ab3\u0ab5-\u0ab9\u0abd\u0ad0\u0ae0\u0ae1\u0b05-\u0b0c\u0b0f\u0b10\u0b13-\u0b28\u0b2a-\u0b30\u0b32\u0b33\u0b35-\u0b39\u0b3d\u0b5c\u0b5d\u0b5f-\u0b61\u0b71\u0b83\u0b85-\u0b8a\u0b8e-\u0b90\u0b92-\u0b95\u0b99\u0b9a\u0b9c\u0b9e\u0b9f\u0ba3\u0ba4\u0ba8-\u0baa\u0bae-\u0bb9\u0bd0\u0c05-\u0c0c\u0c0e-\u0c10\u0c12-\u0c28\u0c2a-\u0c33\u0c35-\u0c39\u0c3d\u0c58\u0c59\u0c60\u0c61\u0c85-\u0c8c\u0c8e-\u0c90\u0c92-\u0ca8\u0caa-\u0cb3\u0cb5-\u0cb9\u0cbd\u0cde\u0ce0\u0ce1\u0cf1\u0cf2\u0d05-\u0d0c\u0d0e-\u0d10\u0d12-\u0d3a\u0d3d\u0d4e\u0d60\u0d61\u0d7a-\u0d7f\u0d85-\u0d96\u0d9a-\u0db1\u0db3-\u0dbb\u0dbd\u0dc0-\u0dc6\u0e01-\u0e30\u0e32\u0e33\u0e40-\u0e46\u0e81\u0e82\u0e84\u0e87\u0e88\u0e8a\u0e8d\u0e94-\u0e97\u0e99-\u0e9f\u0ea1-\u0ea3\u0ea5\u0ea7\u0eaa\u0eab\u0ead-\u0eb0\u0eb2\u0eb3\u0ebd\u0ec0-\u0ec4\u0ec6\u0edc-\u0edf\u0f00\u0f40-\u0f47\u0f49-\u0f6c\u0f88-\u0f8c\u1000-\u102a\u103f\u1050-\u1055\u105a-\u105d\u1061\u1065\u1066\u106e-\u1070\u1075-\u1081\u108e\u10a0-\u10c5\u10c7\u10cd\u10d0-\u10fa\u10fc-\u1248\u124a-\u124d\u1250-\u1256\u1258\u125a-\u125d\u1260-\u1288\u128a-\u128d\u1290-\u12b0\u12b2-\u12b5\u12b8-\u12be\u12c0\u12c2-\u12c5\u12c8-\u12d6\u12d8-\u1310\u1312-\u1315\u1318-\u135a\u1380-\u138f\u13a0-\u13f4\u1401-\u166c\u166f-\u167f\u1681-\u169a\u16a0-\u16ea\u16ee-\u16f0\u1700-\u170c\u170e-\u1711\u1720-\u1731\u1740-\u1751\u1760-\u176c\u176e-\u1770\u1780-\u17b3\u17d7\u17dc\u1820-\u1877\u1880-\u18a8\u18aa\u18b0-\u18f5\u1900-\u191c\u1950-\u196d\u1970-\u1974\u1980-\u19ab\u19c1-\u19c7\u1a00-\u1a16\u1a20-\u1a54\u1aa7\u1b05-\u1b33\u1b45-\u1b4b\u1b83-\u1ba0\u1bae\u1baf\u1bba-\u1be5\u1c00-\u1c23\u1c4d-\u1c4f\u1c5a-\u1c7d\u1ce9-\u1cec\u1cee-\u1cf1\u1cf5\u1cf6\u1d00-\u1dbf\u1e00-\u1f15\u1f18-\u1f1d\u1f20-\u1f45\u1f48-\u1f4d\u1f50-\u1f57\u1f59\u1f5b\u1f5d\u1f5f-\u1f7d\u1f80-\u1fb4\u1fb6-\u1fbc\u1fbe\u1fc2-\u1fc4\u1fc6-\u1fcc\u1fd0-\u1fd3\u1fd6-\u1fdb\u1fe0-\u1fec\u1ff2-\u1ff4\u1ff6-\u1ffc\u2071\u207f\u2090-\u209c\u2102\u2107\u210a-\u2113\u2115\u2119-\u211d\u2124\u2126\u2128\u212a-\u212d\u212f-\u2139\u213c-\u213f\u2145-\u2149\u214e\u2160-\u2188\u2c00-\u2c2e\u2c30-\u2c5e\u2c60-\u2ce4\u2ceb-\u2cee\u2cf2\u2cf3\u2d00-\u2d25\u2d27\u2d2d\u2d30-\u2d67\u2d6f\u2d80-\u2d96\u2da0-\u2da6\u2da8-\u2dae\u2db0-\u2db6\u2db8-\u2dbe\u2dc0-\u2dc6\u2dc8-\u2dce\u2dd0-\u2dd6\u2dd8-\u2dde\u2e2f\u3005-\u3007\u3021-\u3029\u3031-\u3035\u3038-\u303c\u3041-\u3096\u309d-\u309f\u30a1-\u30fa\u30fc-\u30ff\u3105-\u312d\u3131-\u318e\u31a0-\u31ba\u31f0-\u31ff\u3400-\u4db5\u4e00-\u9fcc\ua000-\ua48c\ua4d0-\ua4fd\ua500-\ua60c\ua610-\ua61f\ua62a\ua62b\ua640-\ua66e\ua67f-\ua697\ua6a0-\ua6ef\ua717-\ua71f\ua722-\ua788\ua78b-\ua78e\ua790-\ua793\ua7a0-\ua7aa\ua7f8-\ua801\ua803-\ua805\ua807-\ua80a\ua80c-\ua822\ua840-\ua873\ua882-\ua8b3\ua8f2-\ua8f7\ua8fb\ua90a-\ua925\ua930-\ua946\ua960-\ua97c\ua984-\ua9b2\ua9cf\uaa00-\uaa28\uaa40-\uaa42\uaa44-\uaa4b\uaa60-\uaa76\uaa7a\uaa80-\uaaaf\uaab1\uaab5\uaab6\uaab9-\uaabd\uaac0\uaac2\uaadb-\uaadd\uaae0-\uaaea\uaaf2-\uaaf4\uab01-\uab06\uab09-\uab0e\uab11-\uab16\uab20-\uab26\uab28-\uab2e\uabc0-\uabe2\uac00-\ud7a3\ud7b0-\ud7c6\ud7cb-\ud7fb\uf900-\ufa6d\ufa70-\ufad9\ufb00-\ufb06\ufb13-\ufb17\ufb1d\ufb1f-\ufb28\ufb2a-\ufb36\ufb38-\ufb3c\ufb3e\ufb40\ufb41\ufb43\ufb44\ufb46-\ufbb1\ufbd3-\ufd3d\ufd50-\ufd8f\ufd92-\ufdc7\ufdf0-\ufdfb\ufe70-\ufe74\ufe76-\ufefc\uff21-\uff3a\uff41-\uff5a\uff66-\uffbe\uffc2-\uffc7\uffca-\uffcf\uffd2-\uffd7\uffda-\uffdc][$A-Z\_a-z\xaa\xb5\xba\xc0-\xd6\xd8-\xf6\xf8-\u02c1\u02c6-\u02d1\u02e0-\u02e4\u02ec\u02ee\u0370-\u0374\u0376\u0377\u037a-\u037d\u0386\u0388-\u038a\u038c\u038e-\u03a1\u03a3-\u03f5\u03f7-\u0481\u048a-\u0527\u0531-\u0556\u0559\u0561-\u0587\u05d0-\u05ea\u05f0-\u05f2\u0620-\u064a\u066e\u066f\u0671-\u06d3\u06d5\u06e5\u06e6\u06ee\u06ef\u06fa-\u06fc\u06ff\u0710\u0712-\u072f\u074d-\u07a5\u07b1\u07ca-\u07ea\u07f4\u07f5\u07fa\u0800-\u0815\u081a\u0824\u0828\u0840-\u0858\u08a0\u08a2-\u08ac\u0904-\u0939\u093d\u0950\u0958-\u0961\u0971-\u0977\u0979-\u097f\u0985-\u098c\u098f\u0990\u0993-\u09a8\u09aa-\u09b0\u09b2\u09b6-\u09b9\u09bd\u09ce\u09dc\u09dd\u09df-\u09e1\u09f0\u09f1\u0a05-\u0a0a\u0a0f\u0a10\u0a13-\u0a28\u0a2a-\u0a30\u0a32\u0a33\u0a35\u0a36\u0a38\u0a39\u0a59-\u0a5c\u0a5e\u0a72-\u0a74\u0a85-\u0a8d\u0a8f-\u0a91\u0a93-\u0aa8\u0aaa-\u0ab0\u0ab2\u0ab3\u0ab5-\u0ab9\u0abd\u0ad0\u0ae0\u0ae1\u0b05-\u0b0c\u0b0f\u0b10\u0b13-\u0b28\u0b2a-\u0b30\u0b32\u0b33\u0b35-\u0b39\u0b3d\u0b5c\u0b5d\u0b5f-\u0b61\u0b71\u0b83\u0b85-\u0b8a\u0b8e-\u0b90\u0b92-\u0b95\u0b99\u0b9a\u0b9c\u0b9e\u0b9f\u0ba3\u0ba4\u0ba8-\u0baa\u0bae-\u0bb9\u0bd0\u0c05-\u0c0c\u0c0e-\u0c10\u0c12-\u0c28\u0c2a-\u0c33\u0c35-\u0c39\u0c3d\u0c58\u0c59\u0c60\u0c61\u0c85-\u0c8c\u0c8e-\u0c90\u0c92-\u0ca8\u0caa-\u0cb3\u0cb5-\u0cb9\u0cbd\u0cde\u0ce0\u0ce1\u0cf1\u0cf2\u0d05-\u0d0c\u0d0e-\u0d10\u0d12-\u0d3a\u0d3d\u0d4e\u0d60\u0d61\u0d7a-\u0d7f\u0d85-\u0d96\u0d9a-\u0db1\u0db3-\u0dbb\u0dbd\u0dc0-\u0dc6\u0e01-\u0e30\u0e32\u0e33\u0e40-\u0e46\u0e81\u0e82\u0e84\u0e87\u0e88\u0e8a\u0e8d\u0e94-\u0e97\u0e99-\u0e9f\u0ea1-\u0ea3\u0ea5\u0ea7\u0eaa\u0eab\u0ead-\u0eb0\u0eb2\u0eb3\u0ebd\u0ec0-\u0ec4\u0ec6\u0edc-\u0edf\u0f00\u0f40-\u0f47\u0f49-\u0f6c\u0f88-\u0f8c\u1000-\u102a\u103f\u1050-\u1055\u105a-\u105d\u1061\u1065\u1066\u106e-\u1070\u1075-\u1081\u108e\u10a0-\u10c5\u10c7\u10cd\u10d0-\u10fa\u10fc-\u1248\u124a-\u124d\u1250-\u1256\u1258\u125a-\u125d\u1260-\u1288\u128a-\u128d\u1290-\u12b0\u12b2-\u12b5\u12b8-\u12be\u12c0\u12c2-\u12c5\u12c8-\u12d6\u12d8-\u1310\u1312-\u1315\u1318-\u135a\u1380-\u138f\u13a0-\u13f4\u1401-\u166c\u166f-\u167f\u1681-\u169a\u16a0-\u16ea\u16ee-\u16f0\u1700-\u170c\u170e-\u1711\u1720-\u1731\u1740-\u1751\u1760-\u176c\u176e-\u1770\u1780-\u17b3\u17d7\u17dc\u1820-\u1877\u1880-\u18a8\u18aa\u18b0-\u18f5\u1900-\u191c\u1950-\u196d\u1970-\u1974\u1980-\u19ab\u19c1-\u19c7\u1a00-\u1a16\u1a20-\u1a54\u1aa7\u1b05-\u1b33\u1b45-\u1b4b\u1b83-\u1ba0\u1bae\u1baf\u1bba-\u1be5\u1c00-\u1c23\u1c4d-\u1c4f\u1c5a-\u1c7d\u1ce9-\u1cec\u1cee-\u1cf1\u1cf5\u1cf6\u1d00-\u1dbf\u1e00-\u1f15\u1f18-\u1f1d\u1f20-\u1f45\u1f48-\u1f4d\u1f50-\u1f57\u1f59\u1f5b\u1f5d\u1f5f-\u1f7d\u1f80-\u1fb4\u1fb6-\u1fbc\u1fbe\u1fc2-\u1fc4\u1fc6-\u1fcc\u1fd0-\u1fd3\u1fd6-\u1fdb\u1fe0-\u1fec\u1ff2-\u1ff4\u1ff6-\u1ffc\u2071\u207f\u2090-\u209c\u2102\u2107\u210a-\u2113\u2115\u2119-\u211d\u2124\u2126\u2128\u212a-\u212d\u212f-\u2139\u213c-\u213f\u2145-\u2149\u214e\u2160-\u2188\u2c00-\u2c2e\u2c30-\u2c5e\u2c60-\u2ce4\u2ceb-\u2cee\u2cf2\u2cf3\u2d00-\u2d25\u2d27\u2d2d\u2d30-\u2d67\u2d6f\u2d80-\u2d96\u2da0-\u2da6\u2da8-\u2dae\u2db0-\u2db6\u2db8-\u2dbe\u2dc0-\u2dc6\u2dc8-\u2dce\u2dd0-\u2dd6\u2dd8-\u2dde\u2e2f\u3005-\u3007\u3021-\u3029\u3031-\u3035\u3038-\u303c\u3041-\u3096\u309d-\u309f\u30a1-\u30fa\u30fc-\u30ff\u3105-\u312d\u3131-\u318e\u31a0-\u31ba\u31f0-\u31ff\u3400-\u4db5\u4e00-\u9fcc\ua000-\ua48c\ua4d0-\ua4fd\ua500-\ua60c\ua610-\ua61f\ua62a\ua62b\ua640-\ua66e\ua67f-\ua697\ua6a0-\ua6ef\ua717-\ua71f\ua722-\ua788\ua78b-\ua78e\ua790-\ua793\ua7a0-\ua7aa\ua7f8-\ua801\ua803-\ua805\ua807-\ua80a\ua80c-\ua822\ua840-\ua873\ua882-\ua8b3\ua8f2-\ua8f7\ua8fb\ua90a-\ua925\ua930-\ua946\ua960-\ua97c\ua984-\ua9b2\ua9cf\uaa00-\uaa28\uaa40-\uaa42\uaa44-\uaa4b\uaa60-\uaa76\uaa7a\uaa80-\uaaaf\uaab1\uaab5\uaab6\uaab9-\uaabd\uaac0\uaac2\uaadb-\uaadd\uaae0-\uaaea\uaaf2-\uaaf4\uab01-\uab06\uab09-\uab0e\uab11-\uab16\uab20-\uab26\uab28-\uab2e\uabc0-\uabe2\uac00-\ud7a3\ud7b0-\ud7c6\ud7cb-\ud7fb\uf900-\ufa6d\ufa70-\ufad9\ufb00-\ufb06\ufb13-\ufb17\ufb1d\ufb1f-\ufb28\ufb2a-\ufb36\ufb38-\ufb3c\ufb3e\ufb40\ufb41\ufb43\ufb44\ufb46-\ufbb1\ufbd3-\ufd3d\ufd50-\ufd8f\ufd92-\ufdc7\ufdf0-\ufdfb\ufe70-\ufe74\ufe76-\ufefc\uff21-\uff3a\uff41-\uff5a\uff66-\uffbe\uffc2-\uffc7\uffca-\uffcf\uffd2-\uffd7\uffda-\uffdc0-9\u0300-\u036f\u0483-\u0487\u0591-\u05bd\u05bf\u05c1\u05c2\u05c4\u05c5\u05c7\u0610-\u061a\u064b-\u0669\u0670\u06d6-\u06dc\u06df-\u06e4\u06e7\u06e8\u06ea-\u06ed\u06f0-\u06f9\u0711\u0730-\u074a\u07a6-\u07b0\u07c0-\u07c9\u07eb-\u07f3\u0816-\u0819\u081b-\u0823\u0825-\u0827\u0829-\u082d\u0859-\u085b\u08e4-\u08fe\u0900-\u0903\u093a-\u093c\u093e-\u094f\u0951-\u0957\u0962\u0963\u0966-\u096f\u0981-\u0983\u09bc\u09be-\u09c4\u09c7\u09c8\u09cb-\u09cd\u09d7\u09e2\u09e3\u09e6-\u09ef\u0a01-\u0a03\u0a3c\u0a3e-\u0a42\u0a47\u0a48\u0a4b-\u0a4d\u0a51\u0a66-\u0a71\u0a75\u0a81-\u0a83\u0abc\u0abe-\u0ac5\u0ac7-\u0ac9\u0acb-\u0acd\u0ae2\u0ae3\u0ae6-\u0aef\u0b01-\u0b03\u0b3c\u0b3e-\u0b44\u0b47\u0b48\u0b4b-\u0b4d\u0b56\u0b57\u0b62\u0b63\u0b66-\u0b6f\u0b82\u0bbe-\u0bc2\u0bc6-\u0bc8\u0bca-\u0bcd\u0bd7\u0be6-\u0bef\u0c01-\u0c03\u0c3e-\u0c44\u0c46-\u0c48\u0c4a-\u0c4d\u0c55\u0c56\u0c62\u0c63\u0c66-\u0c6f\u0c82\u0c83\u0cbc\u0cbe-\u0cc4\u0cc6-\u0cc8\u0cca-\u0ccd\u0cd5\u0cd6\u0ce2\u0ce3\u0ce6-\u0cef\u0d02\u0d03\u0d3e-\u0d44\u0d46-\u0d48\u0d4a-\u0d4d\u0d57\u0d62\u0d63\u0d66-\u0d6f\u0d82\u0d83\u0dca\u0dcf-\u0dd4\u0dd6\u0dd8-\u0ddf\u0df2\u0df3\u0e31\u0e34-\u0e3a\u0e47-\u0e4e\u0e50-\u0e59\u0eb1\u0eb4-\u0eb9\u0ebb\u0ebc\u0ec8-\u0ecd\u0ed0-\u0ed9\u0f18\u0f19\u0f20-\u0f29\u0f35\u0f37\u0f39\u0f3e\u0f3f\u0f71-\u0f84\u0f86\u0f87\u0f8d-\u0f97\u0f99-\u0fbc\u0fc6\u102b-\u103e\u1040-\u1049\u1056-\u1059\u105e-\u1060\u1062-\u1064\u1067-\u106d\u1071-\u1074\u1082-\u108d\u108f-\u109d\u135d-\u135f\u1712-\u1714\u1732-\u1734\u1752\u1753\u1772\u1773\u17b4-\u17d3\u17dd\u17e0-\u17e9\u180b-\u180d\u1810-\u1819\u18a9\u1920-\u192b\u1930-\u193b\u1946-\u194f\u19b0-\u19c0\u19c8\u19c9\u19d0-\u19d9\u1a17-\u1a1b\u1a55-\u1a5e\u1a60-\u1a7c\u1a7f-\u1a89\u1a90-\u1a99\u1b00-\u1b04\u1b34-\u1b44\u1b50-\u1b59\u1b6b-\u1b73\u1b80-\u1b82\u1ba1-\u1bad\u1bb0-\u1bb9\u1be6-\u1bf3\u1c24-\u1c37\u1c40-\u1c49\u1c50-\u1c59\u1cd0-\u1cd2\u1cd4-\u1ce8\u1ced\u1cf2-\u1cf4\u1dc0-\u1de6\u1dfc-\u1dff\u200c\u200d\u203f\u2040\u2054\u20d0-\u20dc\u20e1\u20e5-\u20f0\u2cef-\u2cf1\u2d7f\u2de0-\u2dff\u302a-\u302f\u3099\u309a\ua620-\ua629\ua66f\ua674-\ua67d\ua69f\ua6f0\ua6f1\ua802\ua806\ua80b\ua823-\ua827\ua880\ua881\ua8b4-\ua8c4\ua8d0-\ua8d9\ua8e0-\ua8f1\ua900-\ua909\ua926-\ua92d\ua947-\ua953\ua980-\ua983\ua9b3-\ua9c0\ua9d0-\ua9d9\uaa29-\uaa36\uaa43\uaa4c\uaa4d\uaa50-\uaa59\uaa7b\uaab0\uaab2-\uaab4\uaab7\uaab8\uaabe\uaabf\uaac1\uaaeb-\uaaef\uaaf5\uaaf6\uabe3-\uabea\uabec\uabed\uabf0-\uabf9\ufb1e\ufe00-\ufe0f\ufe20-\ufe26\ufe33\ufe34\ufe4d-\ufe4f\uff10-\uff19\uff3f]*$/.test(
vendor: 2,459 bytes, line 30
30e)}e.exports=t},7316:(module,exports,__webpack_require__)=>{var __WEBPACK_AMD_DEFINE_RESULT__,process=__webpack_require__(2818);!function(){"use strict";var ERROR="input is invalid type",WINDOW="object"==typeof window,root=WINDOW?window:{};root.JS_SHA256_NO_WINDOW&&(WINDOW=!1);var WEB_WORKER=!WINDOW&&"object"==typeof self,NODE_JS=!root.JS_SHA256_NO_NODE_JS&&"object"==typeof process&&process.versions&&process.versions.node;NODE_JS?root=__webpack_require__.g:WEB_WORKER&&(root=self);var COMMON_JS=!root.JS_SHA256_NO_COMMON_JS&&module.exports,AMD=__webpack_require__.amdO,ARRAY_BUFFER=!root.JS_SHA256_NO_ARRAY_BUFFER&&"undefined"!=typeof ArrayBuffer,HEX_CHARS="0123456789abcdef".split(""),EXTRA=[-0x80000000,8388608,32768,128],SHIFT=[24,16,8,0],K=[0x428a2f98,0x71374491,0xb5c0fbcf,0xe9b5dba5,0x3956c25b,0x59f111f1,0x923f82a4,0xab1c5ed5,0xd807aa98,0x12835b01,0x243185be,0x550c7dc3,0x72be5d74,0x80deb1fe,0x9bdc06a7,0xc19bf174,0xe49b69c1,0xefbe4786,0xfc19dc6,0x240ca1cc,0x2de92c6f,0x4a7484aa,0x5cb0a9dc,0x76f988da,0x983e5152,0xa831c66d,0xb00327c8,0xbf597fc7,0xc6e00bf3,0xd5a79147,0x6ca6351,0x14292967,0x27b70a85,0x2e1b2138,0x4d2c6dfc,0x53380d13,0x650a7354,0x766a0abb,0x81c2c92e,0x92722c85,0xa2bfe8a1,0xa81a664b,0xc24b8b70,0xc76c51a3,0xd192e819,0xd6990624,0xf40e3585,0x106aa070,0x19a4c116,0x1e376c08,0x2748774c,0x34b0bcb5,0x391c0cb3,0x4ed8aa4a,0x5b9cca4f,0x682e6ff3,0x748f82ee,0x78a5636f,0x84c87814,0x8cc70208,0x90befffa,0xa4506ceb,0xbef9a3f7,0xc67178f2],OUTPUT_TYPES=["hex","array","digest","arrayBuffer"],blocks=[];(root.JS_SHA256_NO_NODE_JS||!Array.isArray)&&(Array.isArray=function(e){return"[object Array]"===Object.prototype.toString.call(e)}),ARRAY_BUFFER&&(root.JS_SHA256_NO_ARRAY_BUFFER_IS_VIEW||!ArrayBuffer.isView)&&(ArrayBuffer.isView=function(e){return"object"==typeof e&&e.buffer&&e.buffer.constructor===ArrayBuffer});var createOutputMethod=function(e,t){return function(r){return new Sha256(t,!0).update(r)[e]()}},createMethod=function(e){var t=createOutputMethod("hex",e);NODE_JS&&(t=nodeWrap(t,e)),t.create=function(){return new Sha256(e)},t.update=function(e){return t.create().update(e)};for(var r=0;r<OUTPUT_TYPES.length;++r){var n=OUTPUT_TYPES[r];t[n]=createOutputMethod(n,e)}return t},nodeWrap=function(method,is224){var crypto=eval("require('crypto')"),Buffer=eval("require('buffer').Buffer"),algorithm=is224?"sha224":"sha256",nodeMethod=function(e){if("string"==typeof e)return crypto.createHash(algorithm).update(e,"utf8").digest("hex");
30if(null==e)throw Error(ERROR);return e.constructor===ArrayBuffer&&(e=new Uint8Array(e)),Array.isArray(e)||ArrayBuffer.isView(e)||e.constructor===Buffer?crypto.createHash(algorithm).update(new Buffer(e)).digest("hex"):method(e)};return nodeMethod},createHmacOutputMethod=function(e,t){return function(r,n){return new HmacSha256(r,t,!0).update(n)[e]()}},createHmacMethod=function(e){var t=createHmacOutputMethod("hex",e);t.create=function(t){return new HmacSha256(t,e)},t.update=function(e,r){return t.create(e).update(r)};for(var r=0;r<OUTPUT_TYPES.length;++r){var n=OUTPUT_TYPES[r];t[n]=createHmacOutputMethod(n,e)}return t};function Sha256(e,t){t?(blocks[0]=blocks[16]=blocks[1]=blocks[2]=blocks[3]=blocks[4]=blocks[5]=blocks[6]=blocks[7]=blocks[8]=blocks[9]=blocks[10]=blocks[11]=blocks[12]=blocks[13]=blocks[14]=blocks[15]=0,this.blocks=blocks):this.blocks=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],e?(this.h0=0xc1059ed8,this.h1=0x367cd507,this.h2=0x3070dd17,this.h3=0xf70e5939,this.h4=0xffc00b31,this.h5=0x68581511,this.h6=0x64f98fa7,this.h7=0xbefa4fa4):(this.h0=0x6a09e667,this.h1=0xbb67ae85,this.h2=0x3c6ef372,this.h3=0xa54ff53a,this.h4=0x510e527f,this.h5=0x9b05688c,this.h6=0x1f83d9ab,this.h7=0x5be0cd19),this.block=this.start=this.bytes=this.hBytes=0,this.finalized=this.hashed=!1,this.first=!0,this.is224=e}function HmacSha256(e,t,r){var n,i=typeof e;if("string"===i){var o,s=[],a=e.length,c=0;for(n=0;n<a;++n)(o=e.charCodeAt(n))<128?s[c++]=o:(o<2048?s[c++]=192|o>>6:(o<55296||o>=57344?s[c++]=224|o>>12:(o=65536+((1023&o)<<10|1023&e.charCodeAt(++n)),s[c++]=240|o>>18,s[c++]=128|o>>12&63),s[c++]=128|o>>6&63),s[c++]=128|63&o);e=s}else if("object"===i){if(null===e)throw Error(ERROR);if(ARRAY_BUFFER&&e.constructor===ArrayBuffer)e=new Uint8Array(e);else if(!Array.isArray(e)&&(!ARRAY_BUFFER||!ArrayBuffer.isView(e)))throw Error(ERROR)}else throw Error(ERROR);e.length>64&&(e=new Sha256(t,!0).update(e).array());var u=[],l=[];for(n=0;n<64;++n){var d=e[n]||0;u[n]=92^d,l[n]=54^d}Sha256.call(this,t,r),this.update(l),this.oKeyPad=u,this.inner=!0,this.sharedMemory=r}Sha256.prototype.update=function(e){if(!this.finalized){var t,r=typeof e;if("string"!==r){if("object"===r){if(null===e)throw Error(ERROR);if(ARRAY_BUFFER&&e.constructor===ArrayBuffer)e=new Uint8Array(e);else if(!Array.isArray(e)&&(!ARRAY_BUFFER||!ArrayBuffer.isView(e)))throw Error(ERROR)}else throw Error(ERROR);t=!0}for(var n,i,o=0,s=e.length,a=this.blocks;o<s;){if(this.hashed&&(this.hashed=!1,a[0]=this.block,a[16]=a[1]=a[2]=a[3]=a[4]=a[5]=a[6]=a[7]=a[8]=a[9]=a[10]=a[11]=a[12]=a[13]=a[14]=a[15]=0),t)for(i=this.start;o<s&&i<64;++o)a[i>>2]|=e[o]<<SHIFT[3&i++];else for(i=this.start;o<s&&i<64;++o)(n=e.charCodeAt(o))<128?a[i>>2]|=n<<SHIFT[3&i++]:(n<2048?a[i>>2]|=(192|n>>6)<<SHIFT[3&i++]:(n<55296||n>=57344?a[i>>2]|=(224|n>>12)<<SHIFT[3&i++]:(n=65536+((1023&n)<<10|1023&e.charCodeAt(++o)),a[i>>2]|=(240|n>>18)<<SHIFT[3&i++],a[i>>2]|=(128|n>>12&63)<<SHIFT[3&i++]),a[i>>2]|=(128|n>>6&63)<<SHIFT[3&i++]),a[i>>2]|=(128|63&n)<<SHIFT[3&i++]);this.lastByteIndex=i,this.bytes+=i-this.start,i>=64?(this.block=a[16],this.start=i-64,this.hash(),this.hashed=!0):this.start=i}return this.bytes>0xffffffff&&(this.hBytes+=this.bytes/0x100000000<<0,this.bytes=this.bytes%0x100000000),this}},Sha256.prototype.finalize=function(){if(!this.finalized){this.finalized=!0;var e=this.blocks,t=this.lastByteIndex;e[16]=this.block,e[t>>2]|=EXTRA[3&t],this.block=e[16],t>=56&&(this.hashed||this.hash(),e[0]=this.block,e[16]=e[1]=e[2]=e[3]=e[4]=e[5]=e[6]=e[7]=e[8]=e[9]=e[10]=e[11]=e[12]=e[13]=e[14]=e[15]=0),e[14]=this.hBytes<<3|this.bytes>>>29,e[15]=this.bytes<<3,this.hash()}},Sha256.prototype.hash=function(){var e,t,r,n,i,o,s,a,c,u,l,d=this.h0,f=this.h1,h=this.h2,p=this.h3,y=this.h4,g=this.h5,m=this.h6,b=this.h7,v=this.blocks;for(e=16;e<64;++e)t=((i=v[e-15])>>>7|i<<25)^(i>>>18|i<<14)^i>>>3,r=((i=v[e-2])>>>17|i<<15)^(i>>>19|i<<13)^i>>>10,v[e]=v[e-16]+t+v[e-7]+r<<0;for(e=0,l=f&h;e<64;e+=4)this.first?(this.is224?(a=300032,b=(i=v[0]-0x543c9a5b)-0x8f1a6c7<<0,p=i+0x170e9b5<<0):(a=0x2a01a605,b=(i=v[0]-0xc881298)-0x5ab00ac6<<0,p=i+0x8909ae5<<0),this.first=!1):(t=(d>>>2|d<<30)^(d>>>13|d<<19)^(d>>>22|d<<10),r=(y>>>6|y<<26)^(y>>>11|y<<21)^(y>>>25|y<<7),n=(a=d&f)^d&h^l,i=b+r+(s=y&g^~y&m)+K[e]+v[e],o=t+n,b=p+i<<0,p=i+o<<0),t=(p>>>2|p<<30)^(p>>>13|p<<19)^(p>>>22|p<<10),r=(b>>>6|b<<26)^(b>>>11|b<<21)^(b>>>25|b<<7),n=(c=p&d)^p&f^a,i=m+r+(s=b&y^~b&g)+K[e+1]+v[e+1],o=t+n,m=h+i<<0,t=((h=i+o<<0)>>>2|h<<30)^(h>>>13|h<<19)^(h>>>22|h<<10),r=(m>>>6|m<<26)^(m>>>11|m<<21)^(m>>>25|m<<7),n=(u=h&p)^h&d^c,i=g+r+(s=m&b^~m&y)+K[e+2]+v[e+2],o=t+n,g=f+i<<0,t=((f=i+o<<0)>>>2|f<<30)^(f>>>13|f<<19)^(f>>>22|f<<10),r=(g>>>6|g<<26)^(g>>>11|g<<21)^(g>>>25|g<<7),n=(l=f&h)^f&p^u,i=y+r+(s=g&m^~g&b)+K[e+3]+v[e+3],o=t+n,y=d+i<<0,d=i+o<<0;this.h0=this.h0+d<<0,this.h1=this.h1+f<<0,this.h2=this.h2+h<<0,this.h3=this.h3+p<<0,this.h4=this.h4+y<<0,this.h5=this.h5+g<<0,this.h6=this.h6+m<<0,this.h7=this.h7+b<<0},Sha256.prototype.hex=function(){this.finalize();var e=this.h0,t=this.h1,r=this.h2,n=this.h3,i=this.h4,o=this.h5,s=this.h6,a=this.h7,c=HEX_CHARS[e>>28&15]+HEX_CHARS[e>>24&15]+HEX_CHARS[e>>20&15]+HEX_CHARS[e>>16&15]+HEX_CHARS[e>>12&15]+HEX_CHARS[e>>8&15]+HEX_CHARS[e>>4&15]+HEX_CHARS[15&e]+HEX_CHARS[t>>28&15]+HEX_CHARS[t>>24&15]+HEX_CHARS[t>>20&15]+HEX_CHARS[t>>16&15]+HEX_CHARS[t>>12&15]+HEX_CHARS[t>>8&15]+HEX_CHARS[t>>4&15]+HEX_CHARS[15&t]+HEX_CHARS[r>>28&15]+HEX_CHARS[r>>24&15]+HEX_CHARS[r>>20&15]+HEX_CHARS[r>>16&15]+HEX_CHARS[r>>12&15]+HEX_CHARS[r>>8&15]+HEX_CHARS[r>>4&15]+HEX_CHARS[15&r]+HEX_CHARS[n>>28&15]+HEX_CHARS[n>>24&15]+HEX_CHARS[n>>20&15]+HEX_CHARS[n>>16&15]+HEX_CHARS[n>>12&15]+HEX_CHARS[n>>8&15]+HEX_CHARS[n>>4&15]+HEX_CHARS[15&n]+HEX_CHARS[i>>28&15]+HEX_CHARS[i>>24&15]+HEX_CHARS[i>>20&15]+HEX_CHARS[i>>16&15]+HEX_CHARS[i>>12&15]+HEX_CHARS[i>>8&15]+HEX_CHARS[i>>4&15]+HEX_CHARS[15&i]+HEX_CHARS[o>>28&15]+HEX_CHARS[o>>24&15]+HEX_CHARS[o>>20&15]+HEX_CHARS[o>>16&15]+HEX_CHARS[o>>12&15]+HEX_CHARS[o>>8&15]+HEX_CHARS[o>>4&15]+HEX_CHARS[15&o]+HEX_CHARS[s>>28&15]+HEX_CHARS[s>>24&15]+HEX_CHARS[s>>20&15]+HEX_CHARS[s>>16&15]+HEX_CHARS[s>>12&15]+HEX_CHARS[s>>8&15]+HEX_CHARS[s>>4&15]+HEX_CHARS[15&s];return this.is224||(c+=HEX_CHARS[a>>28&15]+HEX_CHARS[a>>24&15]+HEX_CHARS[a>>20&15]+HEX_CHARS[a>>16&15]+HEX_CHARS[a>>12&15]+HEX_CHARS[a>>8&15]+HEX_CHARS[a>>4&15]+HEX_CHARS[15&a]),c},Sha256.prototype.toString=Sha256.prototype.hex,Sha256.prototype.digest=function(){this.finalize();var e=this.h0,t=this.h1,r=this.h2,n=this.h3,i=this.h4,o=this.h5,s=this.h6,a=this.h7,c=[e>>24&255,e>>16&255,e>>8&255,255&e,t>>24&255,t>>16&255,t>>8&255,255&t,r>>24&255,r>>16&255,r>>8&255,255&r,n>>24&255,n>>16&255,n>>8&255,255&n,i>>24&255,i>>16&255,i>>8&255,255&i,o>>24&255,o>>16&255,o>>8&255,255&o,s>>24&255,s>>16&255,s>>8&255,255&s];return this.is224||c.push(a>>24&255,a>>16&255,a>>8&255,255&a),c},Sha256.prototype.array=Sha256.prototype.digest,Sha256.prototype.arrayBuffer=function(){this.finalize();var e=new ArrayBuffer(this.is224?28:32),t=new DataView(e);return t.setUint32(0,this.h0),t.setUint32(4,this.h1),t.setUint32(8,this.h2),t.setUint32(12,this.h3),t.setUint32(16,this.h4),t.setUint32(20,this.h5),t.setUint32(24,this.h6),this.is224||t.setUint32(28,this.h7),e},HmacSha256.prototype=new Sha256,HmacSha256.prototype.finalize=function(){if(Sha256.prototype.finalize.call(this),this.inner){this.inner=!1;var e=this.array();Sha256.call(this,this.is224,this.sharedMemory),this.update(this.oKeyPad),this.update(e),Sha256.prototype.finalize.call(this)}};var exports=createMethod();exports.sha256=exports,exports.sha224=createMethod(!0),exports.sha256.hmac=createHmacMethod(),exports.sha224.hmac=createHmacMethod(!0),COMMON_JS?module.exports=exports:(root.sha256=exports.sha256,root.sha224=exports.sha224,AMD&&void 0!==(__WEBPACK_AMD_DEFINE_RESULT__=(function(){return exports}).call(exports,__webpack_require__,exports,module))&&(module.exports=__WEBPACK_AMD_DEFINE_RESULT__))}()},99981:(e,t)=>
30{var r=/~/,n=/~[01]/g;function i(e){switch(e){case"~1":return"/";case"~0":return"~"}throw Error("Invalid tilde escape: "+e)}function o(e){return r.test(e)?e.replace(n,i):e}function s(e,t,r){for(var n,i,s=1,a=t.length;s<a;){if("constructor"===t[s]||"prototype"===t[s]||"__proto__"===t[s])return e;if(n=o(t[s++]),i=a>s,void 0===e[n]&&(Array.isArray(e)&&"-"===n&&(n=e.length),i&&(""!==t[s]&&t[s]<1/0||"-"===t[s]?e[n]=[]:e[n]={})),!i)break;e=e[n]}var c=e[n];return void 0===r?delete e[n]:e[n]=r,c}function a(e){if("string"==typeof e){if(""===(e=e.split("/"))[0])return e}else if(Array.isArray(e)){for(let t of e)if("string"!=typeof t&&"number"!=typeof t)throw Error("Invalid JSON pointer. Must be of type string or number.");return e}throw Error("Invalid JSON pointer.")}function c(e,t){if("object"!=typeof e)throw Error("Invalid input object.");var r=(t=a(t)).length;if(1===r)return e;for(var n=1;n<r;){if(e=e[o(t[n++])],r===n)return e;if("object"!=typeof e||null===e)return}}function u(e,t,r){if("object"!=typeof e)throw Error("Invalid input object.");if(0===(t=a(t)).length)throw Error("Invalid JSON pointer for set.");return s(e,t,r)}function l(e){var t=a(e);return{get:function(e){return c(e,t)},set:function(e,r){return u(e,t,r)}}}t.get=c,t.set=u,t.compile=l},76677:function(e,t){!function(e,r){r(t)}(0,function(e){let t=Symbol("newer"),r=Symbol("older");class n{constructor(e,t){"number"!=typeof e&&(t=e,e=0),this.size=0,this.limit=e,this.oldest=this.newest=void 0,this._keymap=new Map,t&&(this.assign(t),e<1&&(this.limit=this.size))}_markEntryAsUsed(e){e!==this.newest&&(e[t]&&(e===this.oldest&&(this.oldest=e[t]),e[t][r]=e[r]),e[r]&&(e[r][t]=e[t]),e[t]=void 0,e[r]=this.newest,this.newest&&(this.newest[t]=e),this.newest=e)}assign(e){let n,o=this.limit||Number.MAX_VALUE;this._keymap.clear();let s=e[Symbol.iterator]();for(let e=s.next();!e.done;e=s.next()){let s=new i(e.value[0],e.value[1]);if(this._keymap.set(s.key,s),n?(n[t]=s,s[r]=n):this.oldest=s,n=s,0==o--)throw Error("overflow")}this.newest=n,this.size=this._keymap.size}get(e){var t=this._keymap.get(e);return t?(this._markEntryAsUsed(t),t.value):void 0}set(e,n){var o=this._keymap.get(e);return o?(o.value=n,this._markEntryAsUsed(o)):(this._keymap.set(e,o=new i(e,n)),this.newest?(this.newest[t]=o,o[r]=this.newest):this.oldest=o,this.newest=o,++this.size,this.size>this.limit&&this.shift()),this}shift(){var e=this.oldest;if(e)return this.oldest[t]?(this.oldest=this.oldest[t],this.oldest[r]=void 0):(this.oldest=void 0,this.newest=void 0),e[t]=e[r]=void 0,this._keymap.delete(e.key),--this.size,[e.key,e.value]}find(e){let t=this._keymap.get(e);return t?t.value:void 0}has(e){return this._keymap.has(e)}delete(e){var n=this._keymap.get(e);return n?(this._keymap.delete(n.key),n[t]&&n[r]?(n[r][t]=n[t],n[t][r]=n[r]):n[t]?(n[t][r]=void 0,this.oldest=n[t]):n[r]?(n[r][t]=void 0,this.newest=n[r]):this.oldest=this.newest=void 0,this.size--,n.value):void 0}clear(){this.oldest=this.newest=void 0,this.size=0,this._keymap.clear()}keys(){return new s(this.oldest)}values(){return new a(this.oldest)}entries(){return this}[Symbol.iterator](){return new o(this.oldest)}forEach(e,r){"object"!=typeof r&&(r=this);let n=this.oldest;for(;n;)e.call(r,n.value,n.key,this),n=n[t]}toJSON(){for(var e=Array(this.size),r=0,n=this.oldest;n;)e[r++]={key:n.key,value:n.value},n=n[t];return e}toString(){for(var e="",r=this.oldest;r;)e+=String(r.key)+":"+r.value,(r=r[t])&&(e+=" < ");return e}}function i(e,n){this.key=e,this.value=n,this[t]=void 0,this[r]=void 0}function o(e){this.entry=e}function s(e){this.entry=e}function a(e){this.entry=e}e.LRUMap=n,o.prototype[Symbol.iterator]=function(){return this},o.prototype.next=function(){let e=this.entry;return e?(this.entry=e[t],{done:!1,value:[e.key,e.value]}):{done:!0,value:void 0}},s.prototype[Symbol.iterator]=function(){return this},s.prototype.next=function(){let e=this.entry;return e?(this.entry=e[t],{done:!1,value:e.key}):{done:!0,value:void 0}},a.prototype[Symbol.iterator]=function(){return this},a.prototype.next=function(){let e=this.entry;return e?(this.entry=e[t],{done:!1,value:e.value}):{done:!0,value:void 0}}})},45067:e=>{function t(e,t){if(!e)throw Error(t||"Assertion failed")}e.exports=t,t.equal=function(e,t,r){if(e!=t)throw Error(r||"Assertion failed: "+e+" != "+t)}},5897:(e,t)=>{"use strict";var r=t;function n(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]+/ig,"")).length%2!=0&&(e="0"+e);for(var n=0;n<e.length;n+=2)r.push(parseInt(e[n]+e[n+1],16))}else for(var 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}function i(e){return 1===e.length?"0"+e:e}function o(e){for(var t="",r=0;r<e.length;r++)t+=i(e[r].toString(16));return t}r.toArray=n,r.zero2=i,r.toHex=o,r.encode=function(e,t){return"hex"===t?o(e):e}},2139:function(e){!function(t,r){e.exports=r()}(0,function(){"use strict";var e=Object.prototype.toString,t=Array.isArray||function(t){return"[object Array]"===e.call(t)};function r(e){return"function"==typeof e}function n(e){return t(e)?"array":typeof e}function i(e){return e.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g,"\\$&")}function o(e,t){return null!=e&&"object"==typeof e&&t in e}function s(e,t){return null!=e&&"object"!=typeof e&&e.hasOwnProperty&&e.hasOwnProperty(t)}var a=RegExp.prototype.test;function c(e,t){return a.call(e,t)}var u=/\S/;function l(e){return!c(u,e)}var d={"&":"&","<":"<",">":">",'"':""","'":"'","/":"/","`":"`","=":"="};function f(e){return String(e).replace(/[&<>"'`=\/]/g,function(e){return d[e]})}var h=/\s*/,p=/\s+/,y=/\s*=/,g=/\s*\}/,m=/#|\^|\/|>|\{|&|=|!/;function b(e,r){if(!e)return[];var n,o,s,a,c,u,d,f,b,E=!1,S=[],A=[],I=[],O=!1,T=!1,P="",M=0;function N(){if(O&&!T)for(;I.length;)delete A[I.pop()];else I=[];O=!1,T=!1}function k(e){if("string"==typeof e&&(e=e.split(p,2)),!t(e)||2!==e.length)throw Error("Invalid tags: "+e);n=RegExp(i(e[0])+"\\s*"),o=RegExp("\\s*"+i(e[1])),s=RegExp("\\s*"+i("}"+e[1]))}k(r||x.tags);for(var C=new _(e);!C.eos();){if(a=C.pos,u=C.scanUntil(n))for(var D=0,j=u.length;D<j;++D)l(d=u.charAt(D))?(I.push(A.length),P+=d):(T=!0,E=!0,P+=" "),A.push(["text",d,a,a+1]),a+=1,"\n"===d&&(N(),P="",M=0,E=!1);if(!C.scan(n))break;if(O=!0,c=C.scan(m)||"name",C.scan(h),"="===c?(u=C.scanUntil(y),C.scan(y),C.scanUntil(o)):"{"===c?(u=C.scanUntil(s),C.scan(g),C.scanUntil(o),c="&"):u=C.scanUntil(o),!C.scan(o))throw Error("Unclosed tag at "+C.pos);if(f=">"==c?[c,u,a,C.pos,P,M,E]:[c,u,a,C.pos],M++,A.push(f),"#"===c||"^"===c)S.push(f);else if("/"===c){if(!(b=S.pop()))throw Error('Unopened section "'+u+'" at '+a);if(b[1]!==u)throw Error('Unclosed section "'+b[1]+'" at '+a)}else"name"===c||"{"===c||"&"===c?T=!0:"="===c&&k(u)}if(N(),b=S.pop())throw Error('Unclosed section "'+b[1]+'" at '+C.pos);return w(v(A))}function v(e){for(var t,r,n=[],i=0,o=e.length;i<o;++i)(t=e[i])&&("text"===t[0]&&r&&"text"===r[0]?(r[1]+=t[1],r[3]=t[3]):(n.push(t),r=t));return n}function w(e){for(var t,r=[],n=r,i=[],o=0,s=e.length;o<s;++o)switch((t=e[o])[0]){case"#":case"^":n.push(t),i.push(t),n=t[4]=[];break;case"/":i.pop()[5]=t[2],n=i.length>0?i[i.length-1][4]:r;break;default:n.push(t)}return r}function _(e){this.string=e,this.tail=e,this.pos=0}function E(e,t){this.view=e,this.cache={".":this.view},this.parent=t}function S(){this.templateCache={_cache:{},set:function(e,t){this._cache[e]=t},get:function(e){return this._cache[e]},clear:function(){this._cache={}}}}_.prototype.eos=function(){return""===this.tail},_.prototype.scan=function(e){var t=this.tail.match(e);if(!t||0!==t.index)return"";var r=t[0];return this.tail=this.tail.substring(r.length),this.pos+=r.length,r},_.prototype.scanUntil=function(e){var t,r=this.tail.search(e);switch(r){case -1:t=this.tail,this.tail="";break;case 0:t="";break;default:t=this.tail.substring(0,r),this.tail=this.tail.substring(r)}return this.pos+=t.length,t},E.prototype.push=function(e){return new E(e,this)},E.prototype.lookup=function(e){var t=this.cache;if(t.hasOwnProperty(e))n=t[e];else{for(var n,i,a,c,u=this,l=!1;u;){if(e.indexOf(".")>0)for(i=u.view,a=e.split("."),c=0;null!=i&&c<a.length;)c===a.length-1&&(l=o(i,a[c])||s(i,a[c])),i=i[a[c++]];else i=u.view[e],l=o(u.view,e);if(l){n=i;break}u=u.parent}t[e]=n}return r(n)&&(n=n.call(this.view)),n},S.prototype.clearCache=function(){void 0!==this.templateCache&&this.templateCache.clear()},S.prototype.parse=function(e,t){var r=this.templateCache,n=e+":"+(t||x.tags).join(":"),i=void 0!==r,o=i?r.get(n):void 0;return void 0==o&&(o=b(e,t),i&&r.set(n,o)),o},S.prototype.render=function(e,t,r,n){var i=this.parse(e,n),o=t instanceof E?t:new E(t,void 0);return this.renderTokens(i,o,r,e,n)},S.prototype.renderTokens=function(e,t,r,n,i){for(var o,s,a,c="",u=0,l=e.length;u<l;++u)a=void 0,"#"===(s=(o=e[u])[0])?a=this.renderSection(o,t,r,n):"^"===s?a=this.renderInverted(o,t,r,n):">"===s?a=this.renderPartial(o,t,r,i):"&"===s?a=this.unescapedValue(o,t):"name"===s?a=this.escapedValue(o,t):"text"===s&&(a=this.rawValue(o)),void 0!==a&&(c+=a);return c},S.prototype.renderSection=function(e,n,i,o){var s=this,a="",c=n.lookup(e[1]);function u(e){return s.render(e,n,i)}
30if(c){if(t(c))for(var l=0,d=c.length;l<d;++l)a+=this.renderTokens(e[4],n.push(c[l]),i,o);else if("object"==typeof c||"string"==typeof c||"number"==typeof c)a+=this.renderTokens(e[4],n.push(c),i,o);else if(r(c)){if("string"!=typeof o)throw Error("Cannot use higher-order sections without the original template");null!=(c=c.call(n.view,o.slice(e[3],e[5]),u))&&(a+=c)}else a+=this.renderTokens(e[4],n,i,o);return a}},S.prototype.renderInverted=function(e,r,n,i){var o=r.lookup(e[1]);if(!o||t(o)&&0===o.length)return this.renderTokens(e[4],r,n,i)},S.prototype.indentPartial=function(e,t,r){for(var n=t.replace(/[^ \t]/g,""),i=e.split("\n"),o=0;o<i.length;o++)i[o].length&&(o>0||!r)&&(i[o]=n+i[o]);return i.join("\n")},S.prototype.renderPartial=function(e,t,n,i){if(n){var o=r(n)?n(e[1]):n[e[1]];if(null!=o){var s=e[6],a=e[5],c=e[4],u=o;return 0==a&&c&&(u=this.indentPartial(o,c,s)),this.renderTokens(this.parse(u,i),t,n,u)}}},S.prototype.unescapedValue=function(e,t){var r=t.lookup(e[1]);if(null!=r)return r},S.prototype.escapedValue=function(e,t){var r=t.lookup(e[1]);if(null!=r)return x.escape(r)},S.prototype.rawValue=function(e){return e[1]};var x={name:"mustache.js",version:"4.0.0",tags:["{{","}}"],clearCache:void 0,escape:void 0,parse:void 0,render:void 0,Scanner:void 0,Context:void 0,Writer:void 0,set templateCache(cache){A.templateCache=cache},get templateCache(){return A.templateCache}},A=new S;return x.clearCache=function(){return A.clearCache()},x.parse=function(e,t){return A.parse(e,t)},x.render=function(e,t,r,i){if("string"!=typeof e)throw TypeError('Invalid template! Template should be a "string" but "'+n(e)+'" was given as the first argument for mustache#render(template, view, partials)');return A.render(e,t,r,i)},x.escape=f,x.Scanner=_,x.Context=E,x.Writer=S,x})},37600:(e,t)=>{"use strict";var r,n,i;Object.defineProperty(t,"__esModule",{value:!0}),t.AbiSerializationType=t.AbiFunctionModifier=t.AbiFunctionKind=t.SCHEMA_VERSION=void 0,t.SCHEMA_VERSION="0.4.0",function(e){e.View="view",e.Call="call"}(r=t.AbiFunctionKind||(t.AbiFunctionKind={})),function(e){e.Init="init",e.Private="private",e.Payable="payable"}(n=t.AbiFunctionModifier||(t.AbiFunctionModifier={})),function(e){e.Json="json",e.Borsh="borsh"}(i=t.AbiSerializationType||(t.AbiSerializationType={}))},11059:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Account=void 0;var n=r(1525);Object.defineProperty(t,"Account",{enumerable:!0,get:function(){return n.Account}})},96200:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.UrlAccountCreator=t.LocalAccountCreator=t.AccountCreator=void 0;var n=r(1525);Object.defineProperty(t,"AccountCreator",{enumerable:!0,get:function(){return n.AccountCreator}}),Object.defineProperty(t,"LocalAccountCreator",{enumerable:!0,get:function(){return n.LocalAccountCreator}}),Object.defineProperty(t,"UrlAccountCreator",{enumerable:!0,get:function(){return n.UrlAccountCreator}})},57882:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.MultisigStateStatus=t.MultisigDeleteRequestRejectionError=t.MULTISIG_CONFIRM_METHODS=t.MULTISIG_CHANGE_METHODS=t.MULTISIG_DEPOSIT=t.MULTISIG_GAS=t.MULTISIG_ALLOWANCE=t.MULTISIG_STORAGE_KEY=t.AccountMultisig=t.Account2FA=void 0;var n=r(1525);Object.defineProperty(t,"Account2FA",{enumerable:!0,get:function(){return n.Account2FA}}),Object.defineProperty(t,"AccountMultisig",{enumerable:!0,get:function(){return n.AccountMultisig}}),Object.defineProperty(t,"MULTISIG_STORAGE_KEY",{enumerable:!0,get:function(){return n.MULTISIG_STORAGE_KEY}}),Object.defineProperty(t,"MULTISIG_ALLOWANCE",{enumerable:!0,get:function(){return n.MULTISIG_ALLOWANCE}}),Object.defineProperty(t,"MULTISIG_GAS",{enumerable:!0,get:function(){return n.MULTISIG_GAS}}),Object.defineProperty(t,"MULTISIG_DEPOSIT",{enumerable:!0,get:function(){return n.MULTISIG_DEPOSIT}}),Object.defineProperty(t,"MULTISIG_CHANGE_METHODS",{enumerable:!0,get:function(){return n.MULTISIG_CHANGE_METHODS}}),Object.defineProperty(t,"MULTISIG_CONFIRM_METHODS",{enumerable:!0,get:function(){return n.MULTISIG_CONFIRM_METHODS}}),Object.defineProperty(t,"MultisigDeleteRequestRejectionError",{enumerable:!0,get:function(){return n.MultisigDeleteRequestRejectionError}}),Object.defineProperty(t,"MultisigStateStatus",{enumerable:!0,get:function(){return n.MultisigStateStatus}})},3267:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){function i(e){return e instanceof r?e:new r(function(t){t(e)})}return new(r||(r=Promise))(function(r,o){function s(e){try{c(n.next(e))}catch(e){o(e)}}function a(e){try{c(n.throw(e))}catch(e){o(e)}}function c(e){e.done?r(e.value):i(e.value).then(s,a)}c((n=n.apply(e,t||[])).next())})};
30Object.defineProperty(t,"__esModule",{value:!0}),t.connect=void 0;let i=r(49614);function o(e){return n(this,void 0,void 0,function*(){return new i.Near(e)})}t.connect=o},40689:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);(!i||("get"in i?!t.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),o=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)"default"!==r&&Object.prototype.hasOwnProperty.call(e,r)&&n(t,e,r);return i(t,e),t},s=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),t.keyStores=void 0,t.keyStores=o(r(38040)),s(r(39220),t),s(r(3267),t)},39220:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);(!i||("get"in i?!t.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),o=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)"default"!==r&&Object.prototype.hasOwnProperty.call(e,r)&&n(t,e,r);return i(t,e),t};Object.defineProperty(t,"__esModule",{value:!0}),t.WalletConnection=t.ConnectedWalletAccount=t.Near=t.KeyPair=t.Signer=t.InMemorySigner=t.Contract=t.Connection=t.Account=t.multisig=t.validators=t.transactions=t.utils=t.providers=t.accountCreator=void 0;let s=o(r(329));t.providers=s;let a=o(r(51582));t.utils=a;let c=o(r(12356));t.transactions=c;let u=o(r(85279));t.validators=u;let l=r(11059);Object.defineProperty(t,"Account",{enumerable:!0,get:function(){return l.Account}});let d=o(r(57882));t.multisig=d;let f=o(r(96200));t.accountCreator=f;let h=r(28516);Object.defineProperty(t,"Connection",{enumerable:!0,get:function(){return h.Connection}});let p=r(47134);Object.defineProperty(t,"Signer",{enumerable:!0,get:function(){return p.Signer}}),Object.defineProperty(t,"InMemorySigner",{enumerable:!0,get:function(){return p.InMemorySigner}});let y=r(6266);Object.defineProperty(t,"Contract",{enumerable:!0,get:function(){return y.Contract}});let g=r(5526);Object.defineProperty(t,"KeyPair",{enumerable:!0,get:function(){return g.KeyPair}});let m=r(49614);Object.defineProperty(t,"Near",{enumerable:!0,get:function(){return m.Near}});let b=r(24859);Object.defineProperty(t,"ConnectedWalletAccount",{enumerable:!0,get:function(){return b.ConnectedWalletAccount}}),Object.defineProperty(t,"WalletConnection",{enumerable:!0,get:function(){return b.WalletConnection}})},28516:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Connection=void 0;var n=r(1525);Object.defineProperty(t,"Connection",{enumerable:!0,get:function(){return n.Connection}})},6266:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Contract=void 0;var n=r(1525);Object.defineProperty(t,"Contract",{enumerable:!0,get:function(){return n.Contract}})},38040:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.MergeKeyStore=t.BrowserLocalStorageKeyStore=t.InMemoryKeyStore=t.KeyStore=void 0;let n=r(715);Object.defineProperty(t,"KeyStore",{enumerable:!0,get:function(){return n.KeyStore}});let i=r(54756);Object.defineProperty(t,"InMemoryKeyStore",{enumerable:!0,get:function(){return i.InMemoryKeyStore}});let o=r(7505);Object.defineProperty(t,"BrowserLocalStorageKeyStore",{enumerable:!0,get:function(){return o.BrowserLocalStorageKeyStore}});let s=r(1191);Object.defineProperty(t,"MergeKeyStore",{enumerable:!0,get:function(){return s.MergeKeyStore}})},7505:(e,t,r)=>{"use strict";
30Object.defineProperty(t,"__esModule",{value:!0}),t.BrowserLocalStorageKeyStore=void 0;var n=r(23461);Object.defineProperty(t,"BrowserLocalStorageKeyStore",{enumerable:!0,get:function(){return n.BrowserLocalStorageKeyStore}})},54756:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.InMemoryKeyStore=void 0;var n=r(46572);Object.defineProperty(t,"InMemoryKeyStore",{enumerable:!0,get:function(){return n.InMemoryKeyStore}})},715:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.KeyStore=void 0;var n=r(46572);Object.defineProperty(t,"KeyStore",{enumerable:!0,get:function(){return n.KeyStore}})},1191:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.MergeKeyStore=void 0;var n=r(46572);Object.defineProperty(t,"MergeKeyStore",{enumerable:!0,get:function(){return n.MergeKeyStore}})},49614:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Near=void 0;var n=r(41134);Object.defineProperty(t,"Near",{enumerable:!0,get:function(){return n.Near}})},329:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ErrorContext=t.TypedError=t.getTransactionLastResult=t.FinalExecutionStatusBasic=t.JsonRpcProvider=t.Provider=void 0;let n=r(59034);Object.defineProperty(t,"Provider",{enumerable:!0,get:function(){return n.Provider}}),Object.defineProperty(t,"getTransactionLastResult",{enumerable:!0,get:function(){return n.getTransactionLastResult}}),Object.defineProperty(t,"FinalExecutionStatusBasic",{enumerable:!0,get:function(){return n.FinalExecutionStatusBasic}});let i=r(1507);Object.defineProperty(t,"JsonRpcProvider",{enumerable:!0,get:function(){return i.JsonRpcProvider}}),Object.defineProperty(t,"TypedError",{enumerable:!0,get:function(){return i.TypedError}}),Object.defineProperty(t,"ErrorContext",{enumerable:!0,get:function(){return i.ErrorContext}})},1507:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.JsonRpcProvider=t.TypedError=t.ErrorContext=void 0;var n=r(21404);Object.defineProperty(t,"ErrorContext",{enumerable:!0,get:function(){return n.ErrorContext}}),Object.defineProperty(t,"TypedError",{enumerable:!0,get:function(){return n.TypedError}});var i=r(50823);Object.defineProperty(t,"JsonRpcProvider",{enumerable:!0,get:function(){return i.JsonRpcProvider}})},59034:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.FinalExecutionStatusBasic=t.ExecutionStatusBasic=t.IdType=t.Provider=t.getTransactionLastResult=void 0;var n=r(54520);Object.defineProperty(t,"getTransactionLastResult",{enumerable:!0,get:function(){return n.getTransactionLastResult}});var i=r(50823);Object.defineProperty(t,"Provider",{enumerable:!0,get:function(){return i.Provider}});var o=r(21404);Object.defineProperty(t,"IdType",{enumerable:!0,get:function(){return o.IdType}}),Object.defineProperty(t,"ExecutionStatusBasic",{enumerable:!0,get:function(){return o.ExecutionStatusBasic}}),Object.defineProperty(t,"FinalExecutionStatusBasic",{enumerable:!0,get:function(){return o.FinalExecutionStatusBasic}})},47134:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Signer=t.InMemorySigner=void 0;var n=r(2970);Object.defineProperty(t,"InMemorySigner",{enumerable:!0,get:function(){return n.InMemorySigner}}),Object.defineProperty(t,"Signer",{enumerable:!0,get:function(){return n.Signer}})},12356:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.transfer=t.stake=t.functionCallAccessKey=t.functionCall=t.fullAccessKey=t.deployContract=t.deleteKey=t.deleteAccount=t.createAccount=t.addKey=t.encodeDelegateAction=t.encodeSignedDelegate=t.Transaction=t.SignedTransaction=t.Signature=t.signTransaction=t.createTransaction=t.SCHEMA=t.Transfer=t.Stake=t.FunctionCallPermission=t.FunctionCall=t.FullAccessPermission=t.DeployContract=t.DeleteKey=t.DeleteAccount=t.CreateAccount=t.AddKey=t.AccessKeyPermission=t.AccessKey=t.Action=t.stringifyJsonOrBytes=void 0;var n=r(10588);Object.defineProperty(t,"stringifyJsonOrBytes",{enumerable:!0,get:function(){return n.stringifyJsonOrBytes}}),Object.defineProperty(t,"Action",{enumerable:!0,get:function(){return n.Action}}),Object.defineProperty(t,"AccessKey",{enumerable:!0,get:function(){return n.AccessKey}}),Object.defineProperty(t,"AccessKeyPermission",{enumerable:!0,get:function(){return n.AccessKeyPermission}}),Object.defineProperty(t,"AddKey",{enumerable:!0,get:function(){return n.AddKey}}),Object.defineProperty(t,"CreateAccount",{enumerable:!0,get:function(){return n.CreateAccount}}),Object.defineProperty(t,"DeleteAccount",{enumerable:!0,get:function(){return n.DeleteAccount}}),Object.defineProperty(t,"DeleteKey",{enumerable:!0,get:function(){return n.DeleteKey}}),Object.defineProperty(t,"DeployContract",{enumerable:!0,get:function(){return n.DeployContract}}),Object.defineProperty(t,"FullAccessPermission",{enumerable:!0,get:function(){return n.FullAccessPermission}}),Object.defineProperty(t,"FunctionCall",{enumerable:!0,get:function(){return n.FunctionCall}}),Object.defineProperty(t,"FunctionCallPermission",{enumerable:!0,get:function(){return n.FunctionCallPermission}}),Object.defineProperty(t,"Stake",{enumerable:!0,get:function(){return n.Stake}}),Object.defineProperty(t,"Transfer",{enumerable:!0,get:function(){return n.Transfer}}
30),Object.defineProperty(t,"SCHEMA",{enumerable:!0,get:function(){return n.SCHEMA}}),Object.defineProperty(t,"createTransaction",{enumerable:!0,get:function(){return n.createTransaction}}),Object.defineProperty(t,"signTransaction",{enumerable:!0,get:function(){return n.signTransaction}}),Object.defineProperty(t,"Signature",{enumerable:!0,get:function(){return n.Signature}}),Object.defineProperty(t,"SignedTransaction",{enumerable:!0,get:function(){return n.SignedTransaction}}),Object.defineProperty(t,"Transaction",{enumerable:!0,get:function(){return n.Transaction}}),Object.defineProperty(t,"encodeSignedDelegate",{enumerable:!0,get:function(){return n.encodeSignedDelegate}}),Object.defineProperty(t,"encodeDelegateAction",{enumerable:!0,get:function(){return n.encodeDelegateAction}});let i=r(10588),o=(e,t)=>i.actionCreators.addKey(e,t);t.addKey=o;let s=()=>i.actionCreators.createAccount();t.createAccount=s;let a=e=>i.actionCreators.deleteAccount(e);t.deleteAccount=a;let c=e=>i.actionCreators.deleteKey(e);t.deleteKey=c;let u=e=>i.actionCreators.deployContract(e);t.deployContract=u;let l=()=>i.actionCreators.fullAccessKey();t.fullAccessKey=l;let d=(e,t,r,n,o,s)=>i.actionCreators.functionCall(e,t,r,n,o,s);t.functionCall=d;let f=(e,t,r)=>i.actionCreators.functionCallAccessKey(e,t,r);t.functionCallAccessKey=f;let h=(e,t)=>i.actionCreators.stake(e,t);t.stake=h;let p=e=>i.actionCreators.transfer(e);t.transfer=p},92432:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Enum=t.Assignable=void 0;var n=r(21404);Object.defineProperty(t,"Assignable",{enumerable:!0,get:function(){return n.Assignable}});class i{constructor(e){if(1!==Object.keys(e).length)throw Error("Enum can only take single value");Object.keys(e).map(t=>{this[t]=e[t],this.enum=t})}}t.Enum=i},4441:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.logWarning=t.TypedError=t.PositionalArgsError=t.ErrorContext=t.ArgumentTypeError=t.UnsupportedSerializationError=t.UnknownArgumentError=t.ConflictingOptions=t.ArgumentSchemaError=void 0;var n=r(1525);Object.defineProperty(t,"ArgumentSchemaError",{enumerable:!0,get:function(){return n.ArgumentSchemaError}}),Object.defineProperty(t,"ConflictingOptions",{enumerable:!0,get:function(){return n.ConflictingOptions}}),Object.defineProperty(t,"UnknownArgumentError",{enumerable:!0,get:function(){return n.UnknownArgumentError}}),Object.defineProperty(t,"UnsupportedSerializationError",{enumerable:!0,get:function(){return n.UnsupportedSerializationError}});var i=r(21404);Object.defineProperty(t,"ArgumentTypeError",{enumerable:!0,get:function(){return i.ArgumentTypeError}}),Object.defineProperty(t,"ErrorContext",{enumerable:!0,get:function(){return i.ErrorContext}}),Object.defineProperty(t,"PositionalArgsError",{enumerable:!0,get:function(){return i.PositionalArgsError}}),Object.defineProperty(t,"TypedError",{enumerable:!0,get:function(){return i.TypedError}});var o=r(54520);Object.defineProperty(t,"logWarning",{enumerable:!0,get:function(){return o.logWarning}})},34405:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.parseNearAmount=t.formatNearAmount=t.NEAR_NOMINATION_EXP=t.NEAR_NOMINATION=void 0;var n=r(54520);Object.defineProperty(t,"NEAR_NOMINATION",{enumerable:!0,get:function(){return n.NEAR_NOMINATION}}),Object.defineProperty(t,"NEAR_NOMINATION_EXP",{enumerable:!0,get:function(){return n.NEAR_NOMINATION_EXP}}),Object.defineProperty(t,"formatNearAmount",{enumerable:!0,get:function(){return n.formatNearAmount}}),Object.defineProperty(t,"parseNearAmount",{enumerable:!0,get:function(){return n.parseNearAmount}})},51582:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);(!i||("get"in i?!t.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}
30),o=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)"default"!==r&&Object.prototype.hasOwnProperty.call(e,r)&&n(t,e,r);return i(t,e),t};Object.defineProperty(t,"__esModule",{value:!0}),t.Logger=t.logWarning=t.rpc_errors=t.KeyPairEd25519=t.KeyPair=t.PublicKey=t.format=t.enums=t.web=t.serialize=t.key_pair=void 0;let s=o(r(5526));t.key_pair=s;let a=o(r(36796));t.serialize=a;let c=o(r(21188));t.web=c;let u=o(r(92432));t.enums=u;let l=o(r(34405));t.format=l;let d=o(r(25901));t.rpc_errors=d;let f=r(5526);Object.defineProperty(t,"PublicKey",{enumerable:!0,get:function(){return f.PublicKey}}),Object.defineProperty(t,"KeyPair",{enumerable:!0,get:function(){return f.KeyPair}}),Object.defineProperty(t,"KeyPairEd25519",{enumerable:!0,get:function(){return f.KeyPairEd25519}});let h=r(4441);Object.defineProperty(t,"logWarning",{enumerable:!0,get:function(){return h.logWarning}});let p=r(97054);Object.defineProperty(t,"Logger",{enumerable:!0,get:function(){return p.Logger}})},5526:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.PublicKey=t.KeyType=t.KeyPairEd25519=t.KeyPair=void 0;var n=r(10708);Object.defineProperty(t,"KeyPair",{enumerable:!0,get:function(){return n.KeyPair}}),Object.defineProperty(t,"KeyPairEd25519",{enumerable:!0,get:function(){return n.KeyPairEd25519}}),Object.defineProperty(t,"KeyType",{enumerable:!0,get:function(){return n.KeyType}}),Object.defineProperty(t,"PublicKey",{enumerable:!0,get:function(){return n.PublicKey}})},97054:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Logger=void 0;var n=r(54520);Object.defineProperty(t,"Logger",{enumerable:!0,get:function(){return n.Logger}})},25901:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ServerError=t.getErrorTypeFromErrorMessage=t.formatError=t.parseResultError=t.parseRpcError=void 0;var n=r(54520);Object.defineProperty(t,"parseRpcError",{enumerable:!0,get:function(){return n.parseRpcError}}),Object.defineProperty(t,"parseResultError",{enumerable:!0,get:function(){return n.parseResultError}}),Object.defineProperty(t,"formatError",{enumerable:!0,get:function(){return n.formatError}}),Object.defineProperty(t,"getErrorTypeFromErrorMessage",{enumerable:!0,get:function(){return n.getErrorTypeFromErrorMessage}}),Object.defineProperty(t,"ServerError",{enumerable:!0,get:function(){return n.ServerError}})},36796:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.base_decode=t.base_encode=t.deserialize=t.serialize=void 0;var n=r(30443);Object.defineProperty(t,"serialize",{enumerable:!0,get:function(){return n.serialize}}),Object.defineProperty(t,"deserialize",{enumerable:!0,get:function(){return n.deserialize}});var i=r(54520);Object.defineProperty(t,"base_encode",{enumerable:!0,get:function(){return i.baseEncode}}),Object.defineProperty(t,"base_decode",{enumerable:!0,get:function(){return i.baseDecode}})},21188:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.fetchJson=void 0;var n=r(50823);Object.defineProperty(t,"fetchJson",{enumerable:!0,get:function(){return n.fetchJson}})},85279:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.findSeatPrice=t.diffEpochValidators=void 0;var n=r(54520);Object.defineProperty(t,"diffEpochValidators",{enumerable:!0,get:function(){return n.diffEpochValidators}}),Object.defineProperty(t,"findSeatPrice",{enumerable:!0,get:function(){return n.findSeatPrice}})},24859:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.WalletConnection=t.ConnectedWalletAccount=void 0;var n=r(41134);Object.defineProperty(t,"ConnectedWalletAccount",{enumerable:!0,get:function(){return n.ConnectedWalletAccount}}),Object.defineProperty(t,"WalletConnection",{enumerable:!0,get:function(){return n.WalletConnection}})},48078:function(e,t,r){"use strict";var n=r(75927).Buffer,i=this&&this.__awaiter||function(e,t,r,n){function i(e){return e instanceof r?e:new r(function(t){t(e)})}return new(r||(r=Promise))(function(r,o){function s(e){try{c(n.next(e))}catch(e){o(e)}}function a(e){try{c(n.throw(e))}catch(e){o(e)}}function c(e){e.done?r(e.value):i(e.value).then(s,a)}c((n=n.apply(e,t||[])).next())})}
30,o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.Account=void 0;let s=r(10708),a=r(50823),c=r(10588),u=r(21404),l=r(54520),d=o(r(5852)),{addKey:f,createAccount:h,deleteAccount:p,deleteKey:y,deployContract:g,fullAccessKey:m,functionCall:b,functionCallAccessKey:v,stake:w,transfer:_}=c.actionCreators,E=12,S=500,x=1.5;function A(e){return JSON.parse(n.from(e).toString())}function I(e){return n.from(JSON.stringify(e))}class O{constructor(e,t){this.accessKeyByPublicKeyCache={},this.connection=e,this.accountId=t}state(){return i(this,void 0,void 0,function*(){return this.connection.provider.query({request_type:"view_account",account_id:this.accountId,finality:"optimistic"})})}signTransaction(e,t){return i(this,void 0,void 0,function*(){let r=yield this.findAccessKey(e,t);if(!r)throw new u.TypedError(`Can not sign transactions for account ${this.accountId} on network ${this.connection.networkId}, no matching key pair exists for this account`,"KeyNotFound");let{accessKey:n}=r,i=(yield this.connection.provider.block({finality:"final"})).header.hash,o=n.nonce.add(new d.default(1));return yield(0,c.signTransaction)(e,o,t,(0,l.baseDecode)(i),this.connection.signer,this.accountId,this.connection.networkId)})}signAndSendTransaction({receiverId:e,actions:t,returnError:r}){return i(this,void 0,void 0,function*(){let n,o;let s=yield(0,a.exponentialBackoff)(S,E,x,()=>i(this,void 0,void 0,function*(){[n,o]=yield this.signTransaction(e,t);let r=o.transaction.publicKey;try{return yield this.connection.provider.sendTransaction(o)}catch(t){if("InvalidNonce"===t.type)return l.Logger.warn(`Retrying transaction ${e}:${(0,l.baseEncode)(n)} with new nonce.`),delete this.accessKeyByPublicKeyCache[r.toString()],null;if("Expired"===t.type)return l.Logger.warn(`Retrying transaction ${e}:${(0,l.baseEncode)(n)} due to expired block hash`),null;throw t.context=new u.ErrorContext((0,l.baseEncode)(n)),t}}));if(!s)throw new u.TypedError("nonce retries exceeded for transaction. This usually means there are too many parallel requests with the same access key.","RetriesExceeded");if((0,l.printTxOutcomeLogsAndFailures)({contractId:o.transaction.receiverId,outcome:s}),!r&&"object"==typeof s.status&&"object"==typeof s.status.Failure&&null!==s.status.Failure){if(s.status.Failure.error_message&&s.status.Failure.error_type)throw new u.TypedError(`Transaction ${s.transaction_outcome.id} failed. ${s.status.Failure.error_message}`,s.status.Failure.error_type);throw(0,l.parseResultError)(s)}return s})}findAccessKey(e,t){return i(this,void 0,void 0,function*(){let e=yield this.connection.signer.getPublicKey(this.accountId,this.connection.networkId);if(!e)throw new u.TypedError(`no matching key pair found in ${this.connection.signer}`,"PublicKeyNotFound");let t=this.accessKeyByPublicKeyCache[e.toString()];if(void 0!==t)return{publicKey:e,accessKey:t};try{let t=yield this.connection.provider.query({request_type:"view_access_key",account_id:this.accountId,public_key:e.toString(),finality:"optimistic"}),r=Object.assign(Object.assign({},t),{nonce:new d.default(t.nonce)});if(this.accessKeyByPublicKeyCache[e.toString()])return{publicKey:e,accessKey:this.accessKeyByPublicKeyCache[e.toString()]};return this.accessKeyByPublicKeyCache[e.toString()]=r,{publicKey:e,accessKey:r}}catch(e){if("AccessKeyDoesNotExist"==e.type)return null;throw e}})}createAndDeployContract(e,t,r,n){return i(this,void 0,void 0,function*(){let i=m();return yield this.signAndSendTransaction({receiverId:e,actions:[h(),_(n),f(s.PublicKey.from(t),i),g(r)]}),new O(this.connection,e)})}sendMoney(e,t){return i(this,void 0,void 0,function*(){return this.signAndSendTransaction({receiverId:e,actions:[_(t)]})})}createAccount(e,t,r){return i(this,void 0,void 0,function*(){let n=m();return this.signAndSendTransaction({receiverId:e,actions:[h(),_(r),f(s.PublicKey.from(t),n)]})})}deleteAccount(e){return i(this,void 0,void 0,function*(){return l.Logger.log("Deleting an account does not automatically transfer NFTs and FTs to the beneficiary address. Ensure to transfer assets before deleting."),this.signAndSendTransaction({receiverId:this.accountId,actions:[p(e)]})})}deployContract(e){return i(this,void 0,void 0,function*(){return this.signAndSendTransaction({receiverId:this.accountId,actions:[g(e)]})})}encodeJSContractArgs(e,t,r){return n.concat([n.from(e),n.from([0]),n.from(t),n.from([0]),n.from(r)])}functionCall({contractId:e,methodName:t,args:r={},gas:n=l.DEFAULT_FUNCTION_CALL_GAS,attachedDeposit:o,walletMeta:s,walletCallbackUrl:a,stringify:u,jsContract:d}){return i(this,void 0,void 0,function*(){let i;return this.validateArgs(r),i=d?["call_js_contract",this.encodeJSContractArgs(e,t,JSON.stringify(r)),n,o,null,!0]:[t,r,n,o,void 0===u?c.stringifyJsonOrBytes:u,!1],this.signAndSendTransaction({receiverId:d?this.connection.jsvmAccountId:e,actions:[b.apply(void 0,i)],walletMeta:s,walletCallbackUrl:a})})}addKey(e,t,r,n){return i(this,void 0,void 0,function*(){let i;return r||(r=[]),Array.isArray(r)||(r=[r]),i=t?v(t,r,n):m(),this.signAndSendTransaction({receiverId:this.accountId,actions:[f(s.PublicKey.from(e),i)]})})}deleteKey(e){return i(this,void 0,void 0,function*(){return this.signAndSendTransaction({receiverId:this.accountId,actions:[y(s.PublicKey.from(e))]})})}stake(e,t){return i(this,void 0,void 0,function*(){return this.signAndSendTransaction({receiverId:this.accountId,actions:[w(t,s.PublicKey.from(e))]})})}signedDelegate({actions:e,blockHeightTtl:t,receiverId:r}){return i(this,void 0,void 0,function*(){let{provider:n,signer:o}=this.connection,{header:s}=yield n.block({finality:"final"}),{accessKey:a,publicKey:u}=yield this.findAccessKey(null,null),l=(0,c.buildDelegateAction)({actions:e,max
30BlockHeight:new d.default(s.height).add(new d.default(t)),nonce:new d.default(a.nonce).add(new d.default(1)),publicKey:u,receiverId:r,senderId:this.accountId}),{signedDelegateAction:f}=yield(0,c.signDelegateAction)({delegateAction:l,signer:{sign:e=>i(this,void 0,void 0,function*(){let{signature:t}=yield o.signMessage(e,l.senderId,this.connection.networkId);return t})}});return f})}validateArgs(e){if((void 0===e.byteLength||e.byteLength!==e.length)&&(Array.isArray(e)||"object"!=typeof e))throw new u.PositionalArgsError}viewFunction({contractId:e,methodName:t,args:r={},parse:o=A,stringify:s=I,jsContract:a=!1,blockQuery:c={finality:"optimistic"}}){return i(this,void 0,void 0,function*(){let i;this.validateArgs(r),i=a?this.encodeJSContractArgs(e,t,Object.keys(r).length>0?JSON.stringify(r):""):s(r);let u=yield this.connection.provider.query(Object.assign(Object.assign({request_type:"call_function"},c),{account_id:a?this.connection.jsvmAccountId:e,method_name:a?"view_js_contract":t,args_base64:i.toString("base64")}));return u.logs&&(0,l.printTxOutcomeLogs)({contractId:e,logs:u.logs}),u.result&&u.result.length>0&&o(n.from(u.result))})}viewState(e,t={finality:"optimistic"}){return i(this,void 0,void 0,function*(){let{values:r}=yield this.connection.provider.query(Object.assign(Object.assign({request_type:"view_state"},t),{account_id:this.accountId,prefix_base64:n.from(e).toString("base64")}));return r.map(({key:e,value:t})=>({key:n.from(e,"base64"),value:n.from(t,"base64")}))})}getAccessKeys(){var e;return i(this,void 0,void 0,function*(){let t=yield this.connection.provider.query({request_type:"view_access_key_list",account_id:this.accountId,finality:"optimistic"});return null===(e=null==t?void 0:t.keys)||void 0===e?void 0:e.map(e=>Object.assign(Object.assign({},e),{access_key:Object.assign(Object.assign({},e.access_key),{nonce:new d.default(e.access_key.nonce)})}))})}getAccountDetails(){return i(this,void 0,void 0,function*(){return{authorizedApps:(yield this.getAccessKeys()).filter(e=>"FullAccess"!==e.access_key.permission).map(e=>{let t=e.access_key.permission;return{contractId:t.FunctionCall.receiver_id,amount:t.FunctionCall.allowance,publicKey:e.public_key}})}})}getAccountBalance(){return i(this,void 0,void 0,function*(){let e=yield this.connection.provider.experimental_protocolConfig({finality:"final"}),t=yield this.state(),r=new d.default(e.runtime_config.storage_amount_per_byte),n=new d.default(t.storage_usage).mul(r),i=new d.default(t.locked),o=new d.default(t.amount).add(i),s=o.sub(d.default.max(i,n));return{total:o.toString(),stateStaked:n.toString(),staked:i.toString(),available:s.toString()}})}getActiveDelegatedStakeBalance(){return i(this,void 0,void 0,function*(){let e=yield this.connection.provider.block({finality:"final"}),t=e.header.hash,r=e.header.epoch_id,{current_validators:n,next_validators:i,current_proposals:o}=yield this.connection.provider.validators(r),s=new Set;[...n,...i,...o].forEach(e=>s.add(e.account_id));let a=[...s],c=a.map(e=>this.viewFunction({contractId:e,methodName:"get_account_total_balance",args:{account_id:this.accountId},blockQuery:{blockId:t}})),u=yield Promise.allSettled(c);if(u.some(e=>"rejected"===e.status&&"TimeoutError"===e.reason.type))throw Error("Failed to get delegated stake balance");let l=u.reduce((e,t,r)=>{let n=a[r];if("fulfilled"===t.status){let r=new d.default(t.value);if(!r.isZero())return Object.assign(Object.assign({},e),{stakedValidators:[...e.stakedValidators,{validatorId:n,amount:r.toString()}],total:e.total.add(r)})}return"rejected"===t.status?Object.assign(Object.assign({},e),{failedValidators:[...e.failedValidators,{validatorId:n,error:t.reason}]}):e},{stakedValidators:[],failedValidators:[],total:new d.default(0)});return Object.assign(Object.assign({},l),{total:l.total.toString()})})}}t.Account=O},45822:function(e,t,r){"use strict";var n=r(75927).Buffer,i=this&&this.__awaiter||function(e,t,r,n){function i(e){return e instanceof r?e:new r(function(t){t(e)})}return new(r||(r=Promise))(function(r,o){function s(e){try{c(n.next(e))}catch(e){o(e)}}function a(e){try{c(n.throw(e))}catch(e){o(e)}}function c(e){e.done?r(e.value):i(e.value).then(s,a)}c((n=n.apply(e,t||[])).next())})}
30,o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.Account2FA=void 0;let s=r(10708),a=r(21404),c=r(50823),u=r(10588),l=r(54520),d=o(r(5852)),f=r(40425),h=r(96072),p=r(91544),{addKey:y,deleteKey:g,deployContract:m,fullAccessKey:b,functionCall:v,functionCallAccessKey:w}=u.actionCreators;class _ extends f.AccountMultisig{constructor(e,t,r){super(e,t,r),this.helperUrl="https://helper.testnet.near.org",this.helperUrl=r.helperUrl||this.helperUrl,this.storage=r.storage,this.sendCode=r.sendCode||this.sendCodeDefault,this.getCode=r.getCode||this.getCodeDefault,this.verifyCode=r.verifyCode||this.verifyCodeDefault,this.onConfirmResult=r.onConfirmResult}signAndSendTransaction({receiverId:e,actions:t}){let r=Object.create(null,{signAndSendTransaction:{get:()=>super.signAndSendTransaction}});return i(this,void 0,void 0,function*(){yield r.signAndSendTransaction.call(this,{receiverId:e,actions:t}),yield this.sendCode();let n=yield this.promptAndVerify();return this.onConfirmResult&&(yield this.onConfirmResult(n)),n})}deployMultisig(e){let t=Object.create(null,{signAndSendTransactionWithAccount:{get:()=>super.signAndSendTransactionWithAccount}});return i(this,void 0,void 0,function*(){let{accountId:r}=this,i=(yield this.getRecoveryMethods()).data.filter(({kind:e,publicKey:t})=>("phrase"===e||"ledger"===e)&&null!==t).map(e=>e.publicKey),o=(yield this.getAccessKeys()).filter(({public_key:e,access_key:{permission:t}})=>"FullAccess"===t&&!i.includes(e)).map(e=>e.public_key).map(E),s=E((yield this.postSignedJson("/2fa/getAccessKey",{accountId:r})).publicKey),c=n.from(JSON.stringify({num_confirmations:2})),u=[...o.map(e=>g(e)),...o.map(e=>y(e,w(r,h.MULTISIG_CHANGE_METHODS,null))),y(s,w(r,h.MULTISIG_CONFIRM_METHODS,null)),m(e)],d=u.concat(v("new",c,h.MULTISIG_GAS,h.MULTISIG_DEPOSIT));l.Logger.log("deploying multisig contract for",r);let{stateStatus:f}=yield this.checkMultisigCodeAndStateStatus(e);switch(f){case p.MultisigStateStatus.STATE_NOT_INITIALIZED:return yield t.signAndSendTransactionWithAccount.call(this,r,d);case p.MultisigStateStatus.VALID_STATE:return yield t.signAndSendTransactionWithAccount.call(this,r,u);case p.MultisigStateStatus.INVALID_STATE:throw new a.TypedError(`Can not deploy a contract to account ${this.accountId} on network ${this.connection.networkId}, the account has existing state.`,"ContractHasExistingState");default:throw new a.TypedError(`Can not deploy a contract to account ${this.accountId} on network ${this.connection.networkId}, the account state could not be verified.`,"ContractStateUnknown")}})}disableWithFAK({contractBytes:e,cleanupContractBytes:t}){return i(this,void 0,void 0,function*(){let r=[];t&&(yield this.deleteAllRequests().catch(e=>e),r=yield this.get2faDisableCleanupActions(t));let n=[...r,...yield this.get2faDisableKeyConversionActions(),m(e)],i=yield this.findAccessKey(this.accountId,n);if(i&&i.accessKey&&"FullAccess"!==i.accessKey.permission)throw new a.TypedError("No full access key found in keystore. Unable to bypass multisig","NoFAKFound");return this.signAndSendTransactionWithAccount(this.accountId,n)})}get2faDisableCleanupActions(e){return i(this,void 0,void 0,function*(){let t=yield this.viewState("").catch(e=>{let t=e.cause&&e.cause.name;if("NO_CONTRACT_CODE"==t)return[];throw"TOO_LARGE_CONTRACT_STATE"==t?new a.TypedError(`Can not deploy a contract to account ${this.accountId} on network ${this.connection.networkId}, the account has existing state.`,"ContractHasExistingState"):e}),r=t.map(({key:e})=>e.toString("base64"));return t.length?[m(e),v("clean",{keys:r},h.MULTISIG_GAS,new d.default("0"))]:[]})}get2faDisableKeyConversionActions(){return i(this,void 0,void 0,function*(){let{accountId:e}=this,t=(yield this.getAccessKeys()).filter(({access_key:e})=>"FullAccess"!==e.permission).filter(({access_key:t})=>{let r=t.permission.FunctionCall;return r.receiver_id===e&&4===r.method_names.length&&r.method_names.includes("add_request_and_confirm")});return[g(s.PublicKey.from((yield this.postSignedJson("/2fa/getAccessKey",{accountId:e})).publicKey)),...t.map(({public_key:e})=>g(s.PublicKey.from(e))),...t.map(({public_key:e})=>y(s.PublicKey.from(e),b()))]})}disable(e,t){return i(this,void 0,void 0,function*(){let r;let{stateStatus:n}=yield this.checkMultisigCodeAndStateStatus();if(n!==p.MultisigStateStatus.VALID_STATE&&n!==p.MultisigStateStatus.STATE_NOT_INITIALIZED)throw new a.TypedError(`Can not deploy a contract to account ${this.accountId} on network ${this.connection.networkId}, the account state could not be verified.`,"ContractStateUnknown");yield this.deleteAllRequests().catch(e=>r=e);let i=[...yield this.get2faDisableCleanupActions(t).catch(e=>{if("ContractHasExistingState"===e.type)throw r||e;throw e}),...yield this.get2faDisableKeyConversionActions(),m(e)];return l.Logger.log("disabling 2fa for",this.accountId),yield this.signAndSendTransaction({receiverId:this.accountId,actions:i})})}sendCodeDefault(){return i(this,void 0,void 0,function*(){let{accountId:e}=this,{requestId:t}
30=this.getRequest(),r=yield this.get2faMethod();return yield this.postSignedJson("/2fa/send",{accountId:e,method:r,requestId:t}),t})}getCodeDefault(){return i(this,void 0,void 0,function*(){throw Error('There is no getCode callback provided. Please provide your own in AccountMultisig constructor options. It has a parameter method where method.kind is "email" or "phone".')})}promptAndVerify(){return i(this,void 0,void 0,function*(){let e=yield this.get2faMethod(),t=yield this.getCode(e);try{return yield this.verifyCode(t)}catch(e){if(l.Logger.warn("Error validating security code:",e),e.toString().includes("invalid 2fa code provided")||e.toString().includes("2fa code not valid"))return yield this.promptAndVerify();throw e}})}verifyCodeDefault(e){return i(this,void 0,void 0,function*(){let{accountId:t}=this,r=this.getRequest();if(!r)throw Error("no request pending");let{requestId:n}=r;return yield this.postSignedJson("/2fa/verify",{accountId:t,securityCode:e,requestId:n})})}getRecoveryMethods(){return i(this,void 0,void 0,function*(){let{accountId:e}=this;return{accountId:e,data:yield this.postSignedJson("/account/recoveryMethods",{accountId:e})}})}get2faMethod(){return i(this,void 0,void 0,function*(){let{data:e}=yield this.getRecoveryMethods();if(e&&e.length&&(e=e.find(e=>0===e.kind.indexOf("2fa-"))),!e)return null;let{kind:t,detail:r}=e;return{kind:t,detail:r}})}signatureFor(){return i(this,void 0,void 0,function*(){let{accountId:e}=this,t=(yield this.connection.provider.block({finality:"final"})).header.height.toString(),r=yield this.connection.signer.signMessage(n.from(t),e,this.connection.networkId);return{blockNumber:t,blockNumberSignature:n.from(r.signature).toString("base64")}})}postSignedJson(e,t){return i(this,void 0,void 0,function*(){return yield(0,c.fetchJson)(this.helperUrl+e,JSON.stringify(Object.assign(Object.assign({},t),(yield this.signatureFor()))))})}}t.Account2FA=_;let E=e=>s.PublicKey.from(e)},47485:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){function i(e){return e instanceof r?e:new r(function(t){t(e)})}return new(r||(r=Promise))(function(r,o){function s(e){try{c(n.next(e))}catch(e){o(e)}}function a(e){try{c(n.throw(e))}catch(e){o(e)}}function c(e){e.done?r(e.value):i(e.value).then(s,a)}c((n=n.apply(e,t||[])).next())})};Object.defineProperty(t,"__esModule",{value:!0}),t.UrlAccountCreator=t.LocalAccountCreator=t.AccountCreator=void 0;let i=r(50823);class o{}t.AccountCreator=o;class s extends o{constructor(e,t){super(),this.masterAccount=e,this.initialBalance=t}createAccount(e,t){return n(this,void 0,void 0,function*(){yield this.masterAccount.createAccount(e,t,this.initialBalance)})}}t.LocalAccountCreator=s;class a extends o{constructor(e,t){super(),this.connection=e,this.helperUrl=t}createAccount(e,t){return n(this,void 0,void 0,function*(){yield(0,i.fetchJson)(`${this.helperUrl}/account`,JSON.stringify({newAccountId:e,newAccountPublicKey:t.toString()}))})}}t.UrlAccountCreator=a},40425:function(e,t,r){"use strict";var n,i=r(75927).Buffer,o=this&&this.__awaiter||function(e,t,r,n){function i(e){return e instanceof r?e:new r(function(t){t(e)})}return new(r||(r=Promise))(function(r,o){function s(e){try{c(n.next(e))}catch(e){o(e)}}function a(e){try{c(n.throw(e))}catch(e){o(e)}}function c(e){e.done?r(e.value):i(e.value).then(s,a)}c((n=n.apply(e,t||[])).next())})};Object.defineProperty(t,"__esModule",{value:!0}),t.AccountMultisig=void 0;let s=r(10588),a=r(54520),c=r(48078),u=r(96072),l=r(91544),{deployContract:d,functionCall:f}=s.actionCreators;!function(e){e[e.INVALID_CODE=0]="INVALID_CODE",e[e.VALID_CODE=1]="VALID_CODE",e[e.UNKNOWN_CODE=2]="UNKNOWN_CODE"}(n||(n={}));let h={[u.MULTISIG_STORAGE_KEY]:null};class p extends c.Account{constructor(e,t,r){super(e,t),this.storage=r.storage,this.onAddRequestResult=r.onAddRequestResult}signAndSendTransactionWithAccount(e,t){let r=Object.create(null,{signAndSendTransaction:{get:()=>super.signAndSendTransaction}});return o(this,void 0,void 0,function*(){return r.signAndSendTransaction.call(this,{receiverId:e,actions:t})})}signAndSendTransaction({receiverId:e,actions:t}){let r=Object.create(null,{signAndSendTransaction:{get:()=>super.signAndSendTransaction}});return o(this,void 0,void 0,function*(){let n;let{accountId:o}=this,s=i.from(JSON.stringify({request:{receiver_id:e,actions:g(t,o,e)}}));try{n=yield r.signAndSendTransaction.call(this,{receiverId:o,actions:[f("add_request_and_confirm",s,u.MULTISIG_GAS,u.MULTISIG_DEPOSIT)]})}catch(r){if(r.toString().includes("Account has too many active requests. Confirm or delete some"))return yield this.deleteUnconfirmedRequests(),yield this.signAndSendTransaction({receiverId:e,actions:t});throw r}if(!n.status)throw Error("Request failed");let a=Object.assign({},n.status);if(!a.SuccessValue||"string"!=typeof a.SuccessValue)throw Error("Request failed");
30return this.setRequest({accountId:o,actions:t,requestId:parseInt(i.from(a.SuccessValue,"base64").toString("ascii"),10)}),this.onAddRequestResult&&(yield this.onAddRequestResult(n)),this.deleteUnconfirmedRequests(),n})}checkMultisigCodeAndStateStatus(e){let t=Object.create(null,{signAndSendTransaction:{get:()=>super.signAndSendTransaction}});return o(this,void 0,void 0,function*(){let r=0xffffffff,i=e?n.UNKNOWN_CODE:n.VALID_CODE;try{return e?yield t.signAndSendTransaction.call(this,{receiverId:this.accountId,actions:[d(e),f("delete_request",{request_id:r},u.MULTISIG_GAS,u.MULTISIG_DEPOSIT)]}):yield this.deleteRequest(r),{codeStatus:n.VALID_CODE,stateStatus:l.MultisigStateStatus.VALID_STATE}}catch(e){if(new RegExp(l.MultisigDeleteRequestRejectionError.CANNOT_DESERIALIZE_STATE).test(e&&e.kind&&e.kind.ExecutionError))return{codeStatus:i,stateStatus:l.MultisigStateStatus.INVALID_STATE};if(new RegExp(l.MultisigDeleteRequestRejectionError.MULTISIG_NOT_INITIALIZED).test(e&&e.kind&&e.kind.ExecutionError))return{codeStatus:i,stateStatus:l.MultisigStateStatus.STATE_NOT_INITIALIZED};if(new RegExp(l.MultisigDeleteRequestRejectionError.NO_SUCH_REQUEST).test(e&&e.kind&&e.kind.ExecutionError))return{codeStatus:i,stateStatus:l.MultisigStateStatus.VALID_STATE};if(new RegExp(l.MultisigDeleteRequestRejectionError.METHOD_NOT_FOUND).test(e&&e.message))return{codeStatus:n.INVALID_CODE,stateStatus:l.MultisigStateStatus.UNKNOWN_STATE};throw e}})}deleteRequest(e){return super.signAndSendTransaction({receiverId:this.accountId,actions:[f("delete_request",{request_id:e},u.MULTISIG_GAS,u.MULTISIG_DEPOSIT)]})}deleteAllRequests(){return o(this,void 0,void 0,function*(){let e=yield this.getRequestIds();e.length&&(yield Promise.all(e.map(e=>this.deleteRequest(e))))})}deleteUnconfirmedRequests(){let e=Object.create(null,{signAndSendTransaction:{get:()=>super.signAndSendTransaction}});return o(this,void 0,void 0,function*(){let t=yield this.getRequestIds(),{requestId:r}=this.getRequest();for(let n of t)if(n!=r)try{yield e.signAndSendTransaction.call(this,{receiverId:this.accountId,actions:[f("delete_request",{request_id:n},u.MULTISIG_GAS,u.MULTISIG_DEPOSIT)]})}catch(e){a.Logger.warn("Attempt to delete an earlier request before 15 minutes failed. Will try again.")}})}getRequestIds(){return o(this,void 0,void 0,function*(){return this.viewFunction({contractId:this.accountId,methodName:"list_request_ids"})})}getRequest(){return this.storage?JSON.parse(this.storage.getItem(u.MULTISIG_STORAGE_KEY)||"{}"):h[u.MULTISIG_STORAGE_KEY]}setRequest(e){if(this.storage)return this.storage.setItem(u.MULTISIG_STORAGE_KEY,JSON.stringify(e));h[u.MULTISIG_STORAGE_KEY]=e}}t.AccountMultisig=p;let y=e=>e.toString().replace("ed25519:",""),g=(e,t,r)=>e.map(e=>{let n=e.enum,{gas:o,publicKey:s,methodName:a,args:c,deposit:l,accessKey:d,code:f}=e[n],h={type:n[0].toUpperCase()+n.substr(1),gas:o&&o.toString()||void 0,public_key:s&&y(s)||void 0,method_name:a,args:c&&i.from(c).toString("base64")||void 0,code:f&&i.from(f).toString("base64")||void 0,amount:l&&l.toString()||void 0,deposit:l&&l.toString()||"0",permission:void 0};if(d&&(r===t&&"fullAccess"!==d.permission.enum&&(h.permission={receiver_id:t,allowance:u.MULTISIG_ALLOWANCE.toString(),method_names:u.MULTISIG_CHANGE_METHODS}),"functionCall"===d.permission.enum)){let{receiverId:e,methodNames:t,allowance:r}=d.permission.functionCall;h.permission={receiver_id:e,allowance:r&&r.toString()||void 0,method_names:t}}return h})},30463:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Connection=void 0;let n=r(2970),i=r(50823);function o(e){switch(e.type){case void 0:return e;case"JsonRpcProvider":return new i.JsonRpcProvider(Object.assign({},e.args));default:throw Error(`Unknown provider type ${e.type}`)}}function s(e){switch(e.type){case void 0:return e;case"InMemorySigner":return new n.InMemorySigner(e.keyStore);default:throw Error(`Unknown signer type ${e.type}`)}}class a{constructor(e,t,r,n){this.networkId=e,this.provider=t,this.signer=r,this.jsvmAccountId=n}static fromConfig(e){let t=o(e.provider),r=s(e.signer);return new a(e.networkId,t,r,e.jsvmAccountId)}}t.Connection=a},96072:function(e,t,r){"use strict";var n=this&&this.__importDefault||function(e){return e&&e.__esMo
30dule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.MULTISIG_CONFIRM_METHODS=t.MULTISIG_CHANGE_METHODS=t.MULTISIG_DEPOSIT=t.MULTISIG_GAS=t.MULTISIG_ALLOWANCE=t.MULTISIG_STORAGE_KEY=void 0;let i=r(54520),o=n(r(5852));t.MULTISIG_STORAGE_KEY="__multisigRequest",t.MULTISIG_ALLOWANCE=new o.default((0,i.parseNearAmount)("1")),t.MULTISIG_GAS=new o.default("100000000000000"),t.MULTISIG_DEPOSIT=new o.default("0"),t.MULTISIG_CHANGE_METHODS=["add_request","add_request_and_confirm","delete_request","confirm"],t.MULTISIG_CONFIRM_METHODS=["confirm"]},61917:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){function i(e){return e instanceof r?e:new r(function(t){t(e)})}return new(r||(r=Promise))(function(r,o){function s(e){try{c(n.next(e))}catch(e){o(e)}}function a(e){try{c(n.throw(e))}catch(e){o(e)}}function c(e){e.done?r(e.value):i(e.value).then(s,a)}c((n=n.apply(e,t||[])).next())})},i=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.Contract=void 0;let o=r(54520),s=r(21404),a=r(51032),c=i(r(11259)),u=i(r(82946)),l=i(r(5852)),d=i(r(29905)),f=r(75185),h=r(836);function p(e,t){return({[e]:(...e)=>t(...e)})[e]}function y(e,t,r,n){var i;if(!b(e))return;if(t.params&&t.params.serialization_type!==f.AbiSerializationType.Json)throw new h.UnsupportedSerializationError(t.name,t.params.serialization_type);if(t.result&&t.result.serialization_type!==f.AbiSerializationType.Json)throw new h.UnsupportedSerializationError(t.name,t.result.serialization_type);let o=(null===(i=t.params)||void 0===i?void 0:i.args)||[];for(let t of o){let i=e[t.name],o=t.type_schema;o.definitions=n.body.root_schema.definitions;let s=r.compile(o);if(!s(i))throw new h.ArgumentSchemaError(t.name,s.errors)}for(let t of Object.keys(e))if(!o.find(e=>e.name===t))throw new h.UnknownArgumentError(t,o.map(e=>e.name))}function g(){let e=new c.default({strictSchema:!1,formats:{uint32:!0,uint64:!0}});return(0,u.default)(e),e}let m=e=>e&&void 0!==e.byteLength&&e.byteLength===e.length,b=e=>"[object Object]"===Object.prototype.toString.call(e);class v{constructor(e,t,r){this.account=e,this.contractId=t,this.lve=new a.LocalViewExecution(e);let{viewMethods:i=[],changeMethods:c=[],abi:u,useLocalViewExecution:l}=r,v=i.map(e=>({name:e,abi:null})),w=c.map(e=>({name:e,abi:null}));if(u){if(v.length>0||w.length>0)throw new h.ConflictingOptions;v=u.body.functions.filter(e=>e.kind===f.AbiFunctionKind.View).map(e=>({name:e.name,abi:e})),w=u.body.functions.filter(e=>e.kind===f.AbiFunctionKind.Call).map(e=>({name:e.name,abi:e}))}let _=g();v.forEach(({name:e,abi:t})=>{Object.defineProperty(this,e,{writable:!1,enumerable:!0,value:p(e,(r={},i={},...a)=>n(this,void 0,void 0,function*(){if(a.length||!(b(r)||m(r))||!b(i))throw new s.PositionalArgsError;if(t&&y(r,t,_,u),l)try{return yield this.lve.viewFunction(Object.assign({contractId:this.contractId,methodName:e,args:r},i))}catch(e){o.Logger.warn(`Local view execution failed with: "${e.message}"`),o.Logger.warn("Fallback to normal RPC call")}return this.account.viewFunction(Object.assign({contractId:this.contractId,methodName:e,args:r},i))}))})}
30),w.forEach(({name:e,abi:t})=>{Object.defineProperty(this,e,{writable:!1,enumerable:!0,value:p(e,(...r)=>n(this,void 0,void 0,function*(){if(r.length&&(r.length>3||!(b(r[0])||m(r[0]))))throw new s.PositionalArgsError;return(r.length>1||!(r[0]&&r[0].args))&&((0,d.default)("contract.methodName(args, gas, amount)")("use `contract.methodName({ args, gas?, amount?, callbackUrl?, meta? })` instead"),r[0]={args:r[0],gas:r[1],amount:r[2]}),t&&y(r[0].args,t,_,u),this._changeMethod(Object.assign({methodName:e},r[0]))}))})})}_changeMethod({args:e,methodName:t,gas:r,amount:i,meta:s,callbackUrl:a}){return n(this,void 0,void 0,function*(){w({gas:r,amount:i});let n=yield this.account.functionCall({contractId:this.contractId,methodName:t,args:e,gas:r,attachedDeposit:i,walletMeta:s,walletCallbackUrl:a});return(0,o.getTransactionLastResult)(n)})}}function w(e){let t="number, decimal string or BN";for(let r of Object.keys(e)){let n=e[r];if(n&&!l.default.isBN(n)&&isNaN(n))throw new s.ArgumentTypeError(r,t,n)}}t.Contract=v},836:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ConflictingOptions=t.ArgumentSchemaError=t.UnknownArgumentError=t.UnsupportedSerializationError=void 0;class r extends Error{constructor(e,t){super(`Contract method '${e}' is using an unsupported serialization type ${t}`)}}t.UnsupportedSerializationError=r;class n extends Error{constructor(e,t){super(`Unrecognized argument '${e}', expected '${JSON.stringify(t)}'`)}}t.UnknownArgumentError=n;class i extends Error{constructor(e,t){super(`Argument '${e}' does not conform to the specified ABI schema: '${JSON.stringify(t)}'`)}}t.ArgumentSchemaError=i;class o extends Error{constructor(){super("Conflicting contract method options have been passed. You can either specify ABI or a list of view/call methods.")}}t.ConflictingOptions=o},1525:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.MultisigStateStatus=t.MultisigDeleteRequestRejectionError=t.UnsupportedSerializationError=t.UnknownArgumentError=t.ConflictingOptions=t.ArgumentSchemaError=t.Contract=t.MULTISIG_CONFIRM_METHODS=t.MULTISIG_CHANGE_METHODS=t.MULTISIG_DEPOSIT=t.MULTISIG_GAS=t.MULTISIG_ALLOWANCE=t.MULTISIG_STORAGE_KEY=t.Connection=t.AccountMultisig=t.UrlAccountCreator=t.LocalAccountCreator=t.AccountCreator=t.Account2FA=t.Account=void 0;var n=r(48078);Object.defineProperty(t,"Account",{enumerable:!0,get:function(){return n.Account}});var i=r(45822);Object.defineProperty(t,"Account2FA",{enumerable:!0,get:function(){return i.Account2FA}});var o=r(47485);Object.defineProperty(t,"AccountCreator",{enumerable:!0,get:function(){return o.AccountCreator}}),Object.defineProperty(t,"LocalAccountCreator",{enumerable:!0,get:function(){return o.LocalAccountCreator}}),Object.defineProperty(t,"UrlAccountCreator",{enumerable:!0,get:function(){return o.UrlAccountCreator}});var s=r(40425);Object.defineProperty(t,"AccountMultisig",{enumerable:!0,get:function(){return s.AccountMultisig}});var a=r(30463);Object.defineProperty(t,"Connection",{enumerable:!0,get:function(){return a.Connection}});var c=r(96072);Object.defineProperty(t,"MULTISIG_STORAGE_KEY",{enumerable:!0,get:function(){return c.MULTISIG_STORAGE_KEY}}),Object.defineProperty(t,"MULTISIG_ALLOWANCE",{enumerable:!0,get:function(){return c.MULTISIG_ALLOWANCE}}),Object.defineProperty(t,"MULTISIG_GAS",{enumerable:!0,get:function(){return c.MULTISIG_GAS}}),Object.defineProperty(t,"MULTISIG_DEPOSIT",{enumerable:!0,get:function(){return c.MULTISIG_DEPOSIT}}),Object.defineProperty(t,"MULTISIG_CHANGE_METHODS",{enumerable:!0,get:function(){return c.MULTISIG_CHANGE_METHODS}}),Object.defineProperty(t,"MULTISIG_CONFIRM_METHODS",{enumerable:!0,get:function(){return c.MULTISIG_CONFIRM_METHODS}});var u=r(61917);Object.defineProperty(t,"Contract",{enumerable:!0,get:function(){return u.Contract}});var l=r(836);Object.defineProperty(t,"ArgumentSchemaError",{enumerable:!0,get:function(){return l.ArgumentSchemaError}}),Object.defineProperty(t,"ConflictingOptions",{enumerable:!0,get:function(){return l.ConflictingOptions}}),Object.defineProperty(t,"UnknownArgumentError",{enumerable:!0,get:function(){return l.UnknownArgumentError}}),Object.defineProperty(t,"UnsupportedSerializationError",{enumerable:!0,get:function(){return l.UnsupportedSerializationError}});var d=r(91544);Object.defineProperty(t,"MultisigDeleteRequestRejectionError",{enumerable:!0,get:function(){return d.MultisigDeleteRequestRejectionError}}),Object.defineProperty(t,"MultisigStateStatus",{enumerable:!0,get:function(){return d.MultisigStateStatus}})},51032:function(e,t,r){"use strict";var n=r(75927).Buffer,i=this&&this.__awaiter||function(e,t,r,n){function i(e){return e instanceof r?e:new r(function(t){t(e)})}return new(r||(r=Promise))(function(r,o){function s(e){try{c(n.next(e))}catch(e){o(e)}}function a(e){try{c(n.throw(e))}catch(e){o(e)}}function c(e){e.done?r(e.value):i(e.value).then(s,a)}c((n=n.apply(e,t||[])).next())})},o=this&&this.__rest||function(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&0>t.indexOf(n)&&(r[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var i=0,n=Object.getOwnPropertySymbols(e);i<n.length;i++)0>t.indexOf(n[i])&&Object.prototype.propertyIsEnumerable.call(e,n[i])&&(r[n[i]]=e[n[i]]);return r};
30Object.defineProperty(t,"__esModule",{value:!0}),t.LocalViewExecution=void 0;let s=r(54520),a=r(51677),c=r(3220);class u{constructor(e){this.account=e,this.storage=new a.Storage}fetchContractCode(e,t){return i(this,void 0,void 0,function*(){return(yield this.account.connection.provider.query(Object.assign({request_type:"view_code",account_id:e},t))).code_base64})}fetchContractState(e){return i(this,void 0,void 0,function*(){return this.account.viewState("",e)})}fetch(e,t){return i(this,void 0,void 0,function*(){let r=yield this.account.connection.provider.block(t),n=r.header.hash,i=r.header.height;return{blockHash:n,blockHeight:i,blockTimestamp:r.header.timestamp,contractCode:yield this.fetchContractCode(e,t),contractState:yield this.fetchContractState(t)}})}loadOrFetch(e,t){return i(this,void 0,void 0,function*(){let r=this.storage.load(t);if(r)return r;let n=yield this.fetch(e,t),{blockHash:i}=n,s=o(n,["blockHash"]);return this.storage.save(i,s),s})}viewFunction(e){var{contractId:t,methodName:r,args:a={},blockQuery:u={finality:"optimistic"}}=e;return o(e,["contractId","methodName","args","blockQuery"]),i(this,void 0,void 0,function*(){let e=JSON.stringify(a),{contractCode:i,contractState:o,blockHeight:l,blockTimestamp:d}=yield this.loadOrFetch(t,u),f=new c.Runtime({contractId:t,contractCode:i,contractState:o,blockHeight:l,blockTimestamp:d,methodArgs:e}),{result:h,logs:p}=yield f.execute(r);return p&&(0,s.printTxOutcomeLogs)({contractId:t,logs:p}),JSON.parse(n.from(h).toString())})}}t.LocalViewExecution=u},3220:function(e,t,r){"use strict";var n=r(75927).Buffer,i=this&&this.__awaiter||function(e,t,r,n){function i(e){return e instanceof r?e:new r(function(t){t(e)})}return new(r||(r=Promise))(function(r,o){function s(e){try{c(n.next(e))}catch(e){o(e)}}function a(e){try{c(n.throw(e))}catch(e){o(e)}}function c(e){e.done?r(e.value):i(e.value).then(s,a)}c((n=n.apply(e,t||[])).next())})},o=this&&this.__rest||function(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&0>t.indexOf(n)&&(r[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var i=0,n=Object.getOwnPropertySymbols(e);i<n.length;i++)0>t.indexOf(n[i])&&Object.prototype.propertyIsEnumerable.call(e,n[i])&&(r[n[i]]=e[n[i]]);return r};Object.defineProperty(t,"__esModule",{value:!0}),t.Runtime=void 0;let s=r(74496),a=e=>()=>{throw Error("method not implemented: "+e)},c=e=>()=>{throw Error("method not available for view calls: "+e)};class u{constructor(e){var{contractCode:t}=e,r=o(e,["contractCode"]);this.context=r,this.wasm=this.prepareWASM(n.from(t,"base64")),this.memory=new WebAssembly.Memory({initial:1024,maximum:2048}),this.registers={},this.logs=[],this.result=n.from([])}readUTF16CStr(e){let t=[],r=new Uint16Array(this.memory.buffer),i=Number(e)/2;for(;0!=r[i];)t.push(r[i]),i++;return n.from(Uint16Array.from(t).buffer).toString("ucs2")}readUTF8CStr(e,t){let r=[],i=new Uint8Array(this.memory.buffer),o=Number(t);for(let t=0;t<e&&0!=i[o];t++)r.push(i[o]),o++;return n.from(r).toString("utf8")}storageRead(e,t){let r=n.from(new Uint8Array(this.memory.buffer,Number(t),Number(e))),i=this.context.contractState.filter(e=>0===n.compare(e.key,r)).map(e=>e.value);return 0===i.length?null:i.length>1?i:i[0]}prepareWASM(e){let t=[];if("\0asm"!==e.subarray(0,4).toString("utf8"))throw Error("Invalid magic number");let r=e.readUInt32LE(4);if(1!=r)throw Error("Invalid version: "+r);let i=8;function o(){let t,r=0,n=0;do r|=(127&(t=e[i++]))<<n,n+=7;while(128&t);return r}function s(){let t=1&e[i++];return{initial:o(),max:t?o():null}}function a(){let t=o(),r=e.subarray(i,i+t);return i+=t,r.toString("utf8")}function c(e){let t=[];do{let r=127&e;0!=(e>>=7)&&(r|=128),t.push(r)}while(0!==e);return n.from(t)}function u(e){let t=n.from(e,"utf8");return n.concat([c(t.length),t])}t.push(e.subarray(0,i));do{let r=i,l=e.readUInt8(i);i++;let d=o(),f=i+d;if(5==l)t.push(n.from([5,1,0]));else if(2==l){let r=[],l=o();for(let t=0;t<l;t++){let t=i;a(),a();let n=e.readUInt8(i);i++;let c=!1;switch(n){case 0:o();break;case 1:i++,s();break;case 2:s(),c=!0;break;case 3:i++,i++;break;default:throw Error("Invalid import kind: "+n)}c||r.push(e.subarray(t,i))}let d=n.concat([u("env"),u("memory"),n.from([2]),n.from([0]),c(1)]);r.push(d);let f=n.concat([c(r.length),...r]);t.push(n.concat([n.from([2]),c(f.length),f]))}else if(7==l){let r=[],s=o();for(let t=0;t<s;t++){let t=i;a();let n=e.readUInt8(i);i++,o(),2!==n&&r.push(e.subarray(t,i))}let u=n.concat([c(r.length),...r]);t.push(n.concat([n.from([7]),c(u.length),u]))}else t.push(e.subarray(r,f));i=f}while(i<e.length);return n.concat(t)}getRegisterLength(e){return BigInt(this.registers[e.toString()]?this.registers[e.toString()].length:Number.MAX_SAFE_INTEGER)}readFromRegister(e,t){new Uint8Array(this.memory.buffer).set(this.registers[e.toString()]||n.from([]),Number(t))}getCurrentAccountId(e){this.registers[e.toString()]=n.from(this.context.contractId)}inputMethodArgs(e){this.registers[e.toString()]=n.from(this.context.methodArgs)}getBlockHeight(){return BigInt(this.context.blockHeight)}getBlockTimestamp(){return BigInt(this.context.blockTimestamp)}sha256(e,t,r){let n=new Uint8Array(this.memory.buffer,Number(t),Number(e)),i=(0,s.createHash)("sha256");i.update(n),this.registers[r.toString()]=i.digest()}returnValue(e,t){this.result=n.from(new Uint8Array(this.memory.buffer,Number(t),Number(e)))}panic(e){throw Error("panic: "+e)}abort(e,t,r,n){let i=this.readUTF16CStr(e),o=this.readUTF16CStr(t),s=`${i} ${o}:${r}:${n}`;if(!i||!o)throw Error("abort: String encoding is bad UTF-16 sequence.");throw Error("abort: "+s)}appendToLog(e,t){this.logs.push(this.readUTF8CStr(e,t))}readStorage(e,t,r){let n=this.storageRead(e,t);return null==n?BigInt(0):(this.registers[r]=n,BigInt(1))}hasStorageKey(e,t){return null==this.storageRead(e,t)?BigInt(0):BigInt(1)}getHostImports(){return{register_len:this.getRegisterLength.bind(this),read_register:this.readFromRegister.bind(this),current_account_id:this.getCurrentAccountId.bind(this),input:this.inputMethodArgs.bind(this),block_index:this.getBlockHeight.bind(this),block_timestamp:this.getBlockTimestamp.bind(this),sha256:this.sha256.bind(this),value_return:this.returnValue.bind(this),abort:this.abort.bind(this),log_utf8:this.appendToLog.bind(this),log_utf16:this.appendToLog.bind(this),storage_read:this.readStorage.bind(this),storage_has_key:this.hasStorageKey.bind(this),panic:()=>this.panic("explicit guest panic"),panic_utf8:(e,t)=>
30this.panic(this.readUTF8CStr(e,t)),epoch_height:a("epoch_height"),storage_usage:a("storage_usage"),account_balance:a("account_balance"),account_locked_balance:a("account_locked_balance"),random_seed:a("random_seed"),ripemd160:a("ripemd160"),keccak256:a("keccak256"),keccak512:a("keccak512"),ecrecover:a("ecrecover"),validator_stake:a("validator_stake"),validator_total_stake:a("validator_total_stake"),write_register:c("write_register"),signer_account_id:c("signer_account_id"),signer_account_pk:c("signer_account_pk"),predecessor_account_id:c("predecessor_account_id"),attached_deposit:c("attached_deposit"),prepaid_gas:c("prepaid_gas"),used_gas:c("used_gas"),promise_create:c("promise_create"),promise_then:c("promise_then"),promise_and:c("promise_and"),promise_batch_create:c("promise_batch_create"),promise_batch_then:c("promise_batch_then"),promise_batch_action_create_account:c("promise_batch_action_create_account"),promise_batch_action_deploy_contract:c("promise_batch_action_deploy_contract"),promise_batch_action_function_call:c("promise_batch_action_function_call"),promise_batch_action_function_call_weight:c("promise_batch_action_function_call_weight"),promise_batch_action_transfer:c("promise_batch_action_transfer"),promise_batch_action_stake:c("promise_batch_action_stake"),promise_batch_action_add_key_with_full_access:c("promise_batch_action_add_key_with_full_access"),promise_batch_action_add_key_with_function_call:c("promise_batch_action_add_key_with_function_call"),promise_batch_action_delete_key:c("promise_batch_action_delete_key"),promise_batch_action_delete_account:c("promise_batch_action_delete_account"),promise_results_count:c("promise_results_count"),promise_result:c("promise_result"),promise_return:c("promise_return"),storage_write:c("storage_write"),storage_remove:c("storage_remove")}}execute(e){return i(this,void 0,void 0,function*(){let t=yield WebAssembly.compile(this.wasm),r=(yield WebAssembly.instantiate(t,{env:Object.assign(Object.assign({},this.getHostImports()),{memory:this.memory})})).exports[e];if(void 0==r)throw Error(`Contract method '${e}' does not exists in contract ${this.context.contractId} for block id ${this.context.blockHeight}`);return r(),{result:this.result,logs:this.logs}})}}t.Runtime=u},51677:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Storage=void 0;let n=r(76677);class i{constructor(e={max:i.MAX_ELEMENTS}){this.cache=new n.LRUMap(e.max),this.blockHeights=new Map}load(e){if(!("blockId"in e))return;let t=e.blockId;return 44==t.toString().length&&(t=this.blockHeights.get(t.toString())),this.cache.get(t)}save(e,{blockHeight:t,blockTimestamp:r,contractCode:n,contractState:i}){this.blockHeights.set(e,t),this.cache.set(t,{blockHeight:t,blockTimestamp:r,contractCode:n,contractState:i})}}t.Storage=i,i.MAX_ELEMENTS=100},91544:(e,t)=>{"use strict";var r,n;Object.defineProperty(t,"__esModule",{value:!0}),t.MultisigStateStatus=t.MultisigDeleteRequestRejectionError=void 0,function(e){e.CANNOT_DESERIALIZE_STATE="Cannot deserialize the contract state",e.MULTISIG_NOT_INITIALIZED="Smart contract panicked: Multisig contract should be initialized before usage",e.NO_SUCH_REQUEST="Smart contract panicked: panicked at 'No such request: either wrong number or already confirmed'",e.REQUEST_COOLDOWN_ERROR="Request cannot be deleted immediately after creation.",e.METHOD_NOT_FOUND="Contract method is not found"}(r=t.MultisigDeleteRequestRejectionError||(t.MultisigDeleteRequestRejectionError={})),function(e){e[e.INVALID_STATE=0]="INVALID_STATE",e[e.STATE_NOT_INITIALIZED=1]="STATE_NOT_INITIALIZED",e[e.VALID_STATE=2]="VALID_STATE",e[e.UNKNOWN_STATE=3]="UNKNOWN_STATE"}(n=t.MultisigStateStatus||(t.MultisigStateStatus={}))},64029:(e,t)=>{"use strict";var r,n;Object.defineProperty(t,"__esModule",{value:!0}),t.KeySize=t.KeyType=void 0,function(e){e[e.ED25519=0]="ED25519"}(r=t.KeyType||(t.KeyType={})),function(e){e[e.SECRET_KEY=32]="SECRET_KEY"}(n=t.KeySize||(t.KeySize={}))},10708:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.PublicKey=t.KeyPairEd25519=t.KeyPair=t.KeyType=void 0;var n=r(64029);Object.defineProperty(t,"KeyType",{enumerable:!0,get:function(){return n.KeyType}});var i=r(41272);Object.defineProperty(t,"KeyPair",{enumerable:!0,get:function(){return i.KeyPair}});var o=r(91394);Object.defineProperty(t,"KeyPairEd25519",{enumerable:!0,get:function(){return o.KeyPairEd25519}});var s=r(55269);Object.defineProperty(t,"PublicKey",{enumerable:!0,get:function(){return s.PublicKey}})},41272:(e,t,r)=>{"use strict";
30Object.defineProperty(t,"__esModule",{value:!0}),t.KeyPair=void 0;let n=r(93560),i=r(91394);class o extends n.KeyPairBase{static fromRandom(e){if("ED25519"===e.toUpperCase())return i.KeyPairEd25519.fromRandom();throw Error(`Unknown curve ${e}`)}static fromString(e){let t=e.split(":");if(1===t.length)return new i.KeyPairEd25519(t[0]);if(2===t.length){if("ED25519"===t[0].toUpperCase())return new i.KeyPairEd25519(t[1]);throw Error(`Unknown curve: ${t[0]}`)}throw Error("Invalid encoded key format, must be <curve>:<encoded key>")}}t.KeyPair=o},93560:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.KeyPairBase=void 0;class r{}t.KeyPairBase=r},91394:function(e,t,r){"use strict";var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.KeyPairEd25519=void 0;let i=r(54520),o=r(58610),s=n(r(52815)),a=r(64029),c=r(93560),u=r(55269);class l extends c.KeyPairBase{constructor(e){super();let t=new Uint8Array((0,i.baseDecode)(e).slice(0,a.KeySize.SECRET_KEY)),r=o.ed25519.getPublicKey(t);this.publicKey=new u.PublicKey({keyType:a.KeyType.ED25519,data:r}),this.secretKey=(0,i.baseEncode)(t),this.extendedSecretKey=e}static fromRandom(){let e=(0,s.default)(a.KeySize.SECRET_KEY),t=o.ed25519.getPublicKey(new Uint8Array(e)),r=new Uint8Array([...e,...t]);return new l((0,i.baseEncode)(r))}sign(e){return{signature:o.ed25519.sign(e,(0,i.baseDecode)(this.secretKey)),publicKey:this.publicKey}}verify(e,t){return this.publicKey.verify(e,t)}toString(){return`ed25519:${this.extendedSecretKey}`}getPublicKey(){return this.publicKey}}t.KeyPairEd25519=l},55269:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.PublicKey=void 0;let n=r(21404),i=r(54520),o=r(58610),s=r(64029);function a(e){if(e===s.KeyType.ED25519)return"ed25519";throw Error(`Unknown key type ${e}`)}function c(e){if("ed25519"===e.toLowerCase())return s.KeyType.ED25519;throw Error(`Unknown key type ${e}`)}class u extends n.Assignable{static from(e){return"string"==typeof e?u.fromString(e):e}static fromString(e){let t;let r=e.split(":"),n=s.KeyType.ED25519;if(1===r.length)t=r[0];else if(2===r.length)t=r[1],n=c(r[0]);else throw Error("Invalid encoded key format, must be <curve>:<encoded key>");let o=(0,i.baseDecode)(t);if(o.length!==s.KeySize.SECRET_KEY)throw Error(`Invalid public key size (${o.length}), must be ${s.KeySize.SECRET_KEY}`);return new u({keyType:n,data:o})}toString(){return`${a(this.keyType)}:${(0,i.baseEncode)(this.data)}`}verify(e,t){if(this.keyType===s.KeyType.ED25519)return o.ed25519.verify(t,e,this.data);throw Error(`Unknown key type ${this.keyType}`)}}t.PublicKey=u},97177:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){function i(e){return e instanceof r?e:new r(function(t){t(e)})}return new(r||(r=Promise))(function(r,o){function s(e){try{c(n.next(e))}catch(e){o(e)}}function a(e){try{c(n.throw(e))}catch(e){o(e)}}function c(e){e.done?r(e.value):i(e.value).then(s,a)}c((n=n.apply(e,t||[])).next())})};Object.defineProperty(t,"__esModule",{value:!0}),t.BrowserLocalStorageKeyStore=void 0;let i=r(10708),o=r(46572),s="near-api-js:keystore:";class a extends o.KeyStore{constructor(e=window.localStorage,t=s){super(),this.localStorage=e,this.prefix=t}setKey(e,t,r){return n(this,void 0,void 0,function*(){this.localStorage.setItem(this.storageKeyForSecretKey(e,t),r.toString())})}getKey(e,t){return n(this,void 0,void 0,function*(){let r=this.localStorage.getItem(this.storageKeyForSecretKey(e,t));return r?i.KeyPair.fromString(r):null})}removeKey(e,t){return n(this,void 0,void 0,function*(){this.localStorage.removeItem(this.storageKeyForSecretKey(e,t))})}clear(){return n(this,void 0,void 0,function*(){for(let e of this.storageKeys())e.startsWith(this.prefix)&&this.localStorage.removeItem(e)})}getNetworks(){return n(this,void 0,void 0,function*(){let e=new Set;for(let t of this.storageKeys())if(t.startsWith(this.prefix)){let r=t.substring(this.prefix.length).split(":");e.add(r[1])}return Array.from(e.values())})}getAccounts(e){return n(this,void 0,void 0,function*(){let t=[];for(let r of this.storageKeys())if(r.startsWith(this.prefix)){let n=r.substring(this.prefix.length).split(":");n[1]===e&&t.push(n[0])}return t})}storageKeyForSecretKey(e,t){return`${this.prefix}${t}:${e}`}*storageKeys(){for(let e=0;e<this.localStorage.length;e++)yield this.localStorage.key(e)}}t.BrowserLocalStorageKeyStore=a},23461:(e,t,r)=>{"use strict";
30Object.defineProperty(t,"__esModule",{value:!0}),t.BrowserLocalStorageKeyStore=void 0;var n=r(97177);Object.defineProperty(t,"BrowserLocalStorageKeyStore",{enumerable:!0,get:function(){return n.BrowserLocalStorageKeyStore}})},47909:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){function i(e){return e instanceof r?e:new r(function(t){t(e)})}return new(r||(r=Promise))(function(r,o){function s(e){try{c(n.next(e))}catch(e){o(e)}}function a(e){try{c(n.throw(e))}catch(e){o(e)}}function c(e){e.done?r(e.value):i(e.value).then(s,a)}c((n=n.apply(e,t||[])).next())})};Object.defineProperty(t,"__esModule",{value:!0}),t.InMemoryKeyStore=void 0;let i=r(10708),o=r(51088);class s extends o.KeyStore{constructor(){super(),this.keys={}}setKey(e,t,r){return n(this,void 0,void 0,function*(){this.keys[`${t}:${e}`]=r.toString()})}getKey(e,t){return n(this,void 0,void 0,function*(){let r=this.keys[`${t}:${e}`];return r?i.KeyPair.fromString(r):null})}removeKey(e,t){return n(this,void 0,void 0,function*(){delete this.keys[`${t}:${e}`]})}clear(){return n(this,void 0,void 0,function*(){this.keys={}})}getNetworks(){return n(this,void 0,void 0,function*(){let e=new Set;return Object.keys(this.keys).forEach(t=>{let r=t.split(":");e.add(r[1])}),Array.from(e.values())})}getAccounts(e){return n(this,void 0,void 0,function*(){let t=[];return Object.keys(this.keys).forEach(r=>{let n=r.split(":");n[n.length-1]===e&&t.push(n.slice(0,n.length-1).join(":"))}),t})}toString(){return"InMemoryKeyStore"}}t.InMemoryKeyStore=s},46572:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.MergeKeyStore=t.KeyStore=t.InMemoryKeyStore=void 0;var n=r(47909);Object.defineProperty(t,"InMemoryKeyStore",{enumerable:!0,get:function(){return n.InMemoryKeyStore}});var i=r(51088);Object.defineProperty(t,"KeyStore",{enumerable:!0,get:function(){return i.KeyStore}});var o=r(17310);Object.defineProperty(t,"MergeKeyStore",{enumerable:!0,get:function(){return o.MergeKeyStore}})},51088:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.KeyStore=void 0;class r{}t.KeyStore=r},17310:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){function i(e){return e instanceof r?e:new r(function(t){t(e)})}return new(r||(r=Promise))(function(r,o){function s(e){try{c(n.next(e))}catch(e){o(e)}}function a(e){try{c(n.throw(e))}catch(e){o(e)}}function c(e){e.done?r(e.value):i(e.value).then(s,a)}c((n=n.apply(e,t||[])).next())})};Object.defineProperty(t,"__esModule",{value:!0}),t.MergeKeyStore=void 0;let i=r(51088);class o extends i.KeyStore{constructor(e,t={writeKeyStoreIndex:0}){super(),this.options=t,this.keyStores=e}setKey(e,t,r){return n(this,void 0,void 0,function*(){yield this.keyStores[this.options.writeKeyStoreIndex].setKey(e,t,r)})}getKey(e,t){return n(this,void 0,void 0,function*(){for(let r of this.keyStores){let n=yield r.getKey(e,t);if(n)return n}return null})}removeKey(e,t){return n(this,void 0,void 0,function*(){for(let r of this.keyStores)yield r.removeKey(e,t)})}clear(){return n(this,void 0,void 0,function*(){for(let e of this.keyStores)yield e.clear()})}getNetworks(){return n(this,void 0,void 0,function*(){let e=new Set;for(let t of this.keyStores)for(let r of yield t.getNetworks())e.add(r);return Array.from(e)})}getAccounts(e){return n(this,void 0,void 0,function*(){let t=new Set;for(let r of this.keyStores)for(let n of yield r.getAccounts(e))t.add(n);return Array.from(t)})}toString(){return`MergeKeyStore(${this.keyStores.join(", ")})`}}
30t.MergeKeyStore=o},44389:function(e,t){"use strict";var r=this&&this.__awaiter||function(e,t,r,n){function i(e){return e instanceof r?e:new r(function(t){t(e)})}return new(r||(r=Promise))(function(r,o){function s(e){try{c(n.next(e))}catch(e){o(e)}}function a(e){try{c(n.throw(e))}catch(e){o(e)}}function c(e){e.done?r(e.value):i(e.value).then(s,a)}c((n=n.apply(e,t||[])).next())})};function n(e,t,n,o){return r(this,void 0,void 0,function*(){let r=e;for(let e=0;e<t;e++){let e=yield o();if(e)return e;yield i(r),r*=n}return null})}function i(e){return new Promise(t=>setTimeout(t,e))}Object.defineProperty(t,"__esModule",{value:!0}),t.exponentialBackoff=void 0,t.exponentialBackoff=n},31027:function(e,t,r){"use strict";var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});let i=n(r(50412)),o=n(r(31493)),s=n(r(19102)),a=new o.default.Agent({keepAlive:!0}),c=new s.default.Agent({keepAlive:!0});function u(e){return"http:"===e.protocol?a:c}function l(e,t){return(0,i.default)(e,Object.assign({agent:u(new URL(e.toString()))},t))}t.default=l},53634:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);(!i||("get"in i?!t.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),o=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)"default"!==r&&Object.prototype.hasOwnProperty.call(e,r)&&n(t,e,r);return i(t,e),t},s=this&&this.__awaiter||function(e,t,r,n){function i(e){return e instanceof r?e:new r(function(t){t(e)})}return new(r||(r=Promise))(function(r,o){function s(e){try{c(n.next(e))}catch(e){o(e)}}function a(e){try{c(n.throw(e))}catch(e){o(e)}}function c(e){e.done?r(e.value):i(e.value).then(s,a)}c((n=n.apply(e,t||[])).next())})},a=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.fetchJson=void 0;let c=r(21404),u=r(54520),l=a(r(81981)),d=r(44389),f=1e3,h=1.5,p=10;function y(e,t){return s(this,void 0,void 0,function*(){let n={url:null};"string"==typeof e?n.url=e:n=e;let i=yield(0,d.exponentialBackoff)(f,p,h,()=>s(this,void 0,void 0,function*(){var e;try{let i=yield(null!==(e=r.g.fetch)&&void 0!==e?e:(yield Promise.resolve().then(()=>o(r(31027)))).default)(n.url,{method:t?"POST":"GET",body:t||void 0,headers:Object.assign(Object.assign({},n.headers),{"Content-Type":"application/json"})});if(!i.ok){if(503===i.status)return u.Logger.warn(`Retrying HTTP request for ${n.url} as it's not available now`),null;if(408===i.status)return u.Logger.warn(`Retrying HTTP request for ${n.url} as the previous connection was unused for some time`),null;throw(0,l.default)(i.status,(yield i.text()))}return i}catch(e){if(e.toString().includes("FetchError")||e.toString().includes("Failed to fetch"))return u.Logger.warn(`Retrying HTTP request for ${n.url} because of error: ${e}`),null;throw e}}));if(!i)throw new c.TypedError(`Exceeded ${p} attempts for ${n.url}.`,"RetriesExceeded");return yield i.json()})}t.fetchJson=y},50823:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.fetchJson=t.Provider=t.JsonRpcProvider=t.exponentialBackoff=void 0;var n=r(44389);Object.defineProperty(t,"exponentialBackoff",{enumerable:!0,get:function(){return n.exponentialBackoff}});var i=r(24181);Object.defineProperty(t,"JsonRpcProvider",{enumerable:!0,get:function(){return i.JsonRpcProvider}});var o=r(13144);Object.defineProperty(t,"Provider",{enumerable:!0,get:function(){return o.Provider}});var s=r(53634);Object.defineProperty(t,"fetchJson",{enumerable:!0,get:function(){return s.fetchJson}})},24181:function(e,t,r){"use strict";var n=r(75927).Buffer,i=this&&this.__awaiter||function(e,t,r,n){function i(e){return e instanceof r?e:new r(function(t){t(e)})}return new(r||(r=Promise))(function(r,o){function s(e){try{c(n.next(e))}catch(e){o(e)}}function a(e){try{c(n.throw(e))}catch(e){o(e)}}function c(e){e.done?r(e.value):i(e.value).then(s,a)}c((n=n.apply(e,t||[])).next())})},o=this&&this.__rest||function(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&0>t.indexOf(n)&&(r[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var i=0,n=Object.getOwnPropertySymbols(e);i<n.length;i++)0>t.indexOf(n[i])&&Object.prototype.propertyIsEnumerable.call(e,n[i])&&(r[n[i]]=e[n[i]]);return r};
30Object.defineProperty(t,"__esModule",{value:!0}),t.JsonRpcProvider=void 0;let s=r(54520),a=r(21404),c=r(10588),u=r(44389),l=r(13144),d=r(53634),f=12,h=500,p=1.5,y=123;class g extends l.Provider{constructor(e){super(),this.connection=e||{url:""}}status(){return i(this,void 0,void 0,function*(){return this.sendJsonRpc("status",[])})}sendTransaction(e){return i(this,void 0,void 0,function*(){let t=(0,c.encodeTransaction)(e);return this.sendJsonRpc("broadcast_tx_commit",[n.from(t).toString("base64")])})}sendTransactionAsync(e){return i(this,void 0,void 0,function*(){let t=(0,c.encodeTransaction)(e);return this.sendJsonRpc("broadcast_tx_async",[n.from(t).toString("base64")])})}txStatus(e,t){return i(this,void 0,void 0,function*(){return"string"==typeof e?this.txStatusString(e,t):this.txStatusUint8Array(e,t)})}txStatusUint8Array(e,t){return i(this,void 0,void 0,function*(){return this.sendJsonRpc("tx",[(0,s.baseEncode)(e),t])})}txStatusString(e,t){return i(this,void 0,void 0,function*(){return this.sendJsonRpc("tx",[e,t])})}txStatusReceipts(e,t){return i(this,void 0,void 0,function*(){return"string"==typeof e?this.sendJsonRpc("EXPERIMENTAL_tx_status",[e,t]):this.sendJsonRpc("EXPERIMENTAL_tx_status",[(0,s.baseEncode)(e),t])})}query(...e){return i(this,void 0,void 0,function*(){let t;if(1===e.length){let r=e[0],{block_id:n,blockId:i}=r,s=o(r,["block_id","blockId"]);t=yield this.sendJsonRpc("query",Object.assign(Object.assign({},s),{block_id:n||i}))}else{let[r,n]=e;t=yield this.sendJsonRpc("query",[r,n])}if(t&&t.error)throw new a.TypedError(`Querying failed: ${t.error}. 31${JSON.stringify(t,null,2)}`,(0,s.getErrorTypeFromErrorMessage)(t.error,t.error.name));return t})}block(e){return i(this,void 0,void 0,function*(){let{finality:t}=e,{blockId:r}=e;return this.sendJsonRpc("block",{block_id:r,finality:t})})}blockChanges(e){return i(this,void 0,void 0,function*(){let{finality:t}=e,{blockId:r}=e;return this.sendJsonRpc("EXPERIMENTAL_changes_in_block",{block_id:r,finality:t})})}chunk(e){return i(this,void 0,void 0,function*(){return this.sendJsonRpc("chunk",[e])})}validators(e){return i(this,void 0,void 0,function*(){return this.sendJsonRpc("validators",[e])})}experimental_protocolConfig(e){return i(this,void 0,void 0,function*(){let t=e,{blockId:r}=t,n=o(t,["blockId"]);return yield this.sendJsonRpc("EXPERIMENTAL_protocol_config",Object.assign(Object.assign({},n),{block_id:r}))})}lightClientProof(e){return i(this,void 0,void 0,function*(){return yield this.sendJsonRpc("EXPERIMENTAL_light_client_proof",e)})}nextLightClientBlock(e){return i(this,void 0,void 0,function*(){return yield this.sendJsonRpc("next_light_client_block",e)})}accessKeyChanges(e,t){return i(this,void 0,void 0,function*(){let{finality:r}=t,{blockId:n}=t;return this.sendJsonRpc("EXPERIMENTAL_changes",{changes_type:"all_access_key_changes",account_ids:e,block_id:n,finality:r})})}singleAccessKeyChanges(e,t){return i(this,void 0,void 0,function*(){let{finality:r}=t,{blockId:n}=t;return this.sendJsonRpc("EXPERIMENTAL_changes",{changes_type:"single_access_key_changes",keys:e,block_id:n,finality:r})})}accountChanges(e,t){return i(this,void 0,void 0,function*(){let{finality:r}=t,{blockId:n}=t;return this.sendJsonRpc("EXPERIMENTAL_changes",{changes_type:"account_changes",account_ids:e,block_id:n,finality:r})})}contractStateChanges(e,t,r=""){return i(this,void 0,void 0,function*(){let{finality:n}=t,{blockId:i}=t;return this.sendJsonRpc("EXPERIMENTAL_changes",{changes_type:"data_changes",account_ids:e,key_prefix_base64:r,block_id:i,finality:n})})}contractCodeChanges(e,t){return i(this,void 0,void 0,function*(){let{finality:r}=t,{blockId:n}=t;return this.sendJsonRpc("EXPERIMENTAL_changes",{changes_type:"contract_code_changes",account_ids:e,block_id:n,finality:r})})}gasPrice(e){return i(this,void 0,void 0,function*(){return yield this.sendJsonRpc("gas_price",[e])})}sendJsonRpc(e,t){return i(this,void 0,void 0,function*(){let{result:r}=yield(0,u.exponentialBackoff)(h,f,p,()=>i(this,void 0,void 0,function*(){var r;try{let n={method:e,params:t,id:y++,jsonrpc:"2.0"},i=yield(0,d.fetchJson)(this.connection,JSON.stringify(n));if(i.error){if("object"==typeof i.error.data){if("string"==typeof i.error.data.error_message&&"string"==typeof i.error.data.error_type)throw new a.TypedError(i.error.data.error_message,i.error.data.error_type);throw(0,s.parseRpcError)(i.error.data)}{let e=`[${i.error.code}] ${i.error.message}: ${i.error.data}`;if("Timeout"===i.error.data||e.includes("Timeout error")||e.includes("query has timed out"))throw new a.TypedError(e,"TimeoutError");let r=(0,s.getErrorTypeFromErrorMessage)(i.error.data,"");if(r)throw new a.TypedError((0,s.formatError)(r,t),r);
31throw new a.TypedError(e,i.error.name)}}if("string"==typeof(null===(r=i.result)||void 0===r?void 0:r.error)){let e=(0,s.getErrorTypeFromErrorMessage)(i.result.error,"");if(e)throw new s.ServerError((0,s.formatError)(e,t),e)}return i}catch(r){if("TimeoutError"===r.type)return s.Logger.warn(`Retrying request to ${e} as it has timed out`,t),null;throw r}}));if(void 0===r)throw new a.TypedError(`Exceeded ${f} attempts for request to ${e}.`,"RetriesExceeded");return r})}}t.JsonRpcProvider=g},13144:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Provider=void 0;class r{}t.Provider=r},46744:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){function i(e){return e instanceof r?e:new r(function(t){t(e)})}return new(r||(r=Promise))(function(r,o){function s(e){try{c(n.next(e))}catch(e){o(e)}}function a(e){try{c(n.throw(e))}catch(e){o(e)}}function c(e){e.done?r(e.value):i(e.value).then(s,a)}c((n=n.apply(e,t||[])).next())})};Object.defineProperty(t,"__esModule",{value:!0}),t.InMemorySigner=void 0;let i=r(10708),o=r(46572),s=r(62782),a=r(82548);class c extends a.Signer{constructor(e){super(),this.keyStore=e}static fromKeyPair(e,t,r){return n(this,void 0,void 0,function*(){let n=new o.InMemoryKeyStore;return yield n.setKey(e,t,r),new c(n)})}createKey(e,t){return n(this,void 0,void 0,function*(){let r=i.KeyPair.fromRandom("ed25519");return yield this.keyStore.setKey(t,e,r),r.getPublicKey()})}getPublicKey(e,t){return n(this,void 0,void 0,function*(){let r=yield this.keyStore.getKey(t,e);return null===r?null:r.getPublicKey()})}signMessage(e,t,r){return n(this,void 0,void 0,function*(){let n=new Uint8Array((0,s.sha256)(e));if(!t)throw Error("InMemorySigner requires provided account id");let i=yield this.keyStore.getKey(r,t);if(null===i)throw Error(`Key for ${t} not found in ${r}`);return i.sign(n)})}toString(){return`InMemorySigner(${this.keyStore})`}}t.InMemorySigner=c},2970:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Signer=t.InMemorySigner=void 0;var n=r(46744);Object.defineProperty(t,"InMemorySigner",{enumerable:!0,get:function(){return n.InMemorySigner}});var i=r(82548);Object.defineProperty(t,"Signer",{enumerable:!0,get:function(){return i.Signer}})},82548:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Signer=void 0;class r{}t.Signer=r},18550:function(e,t,r){"use strict";var n=r(75927).Buffer,i=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.actionCreators=t.stringifyJsonOrBytes=void 0;let o=i(r(5852)),s=r(48351);function a(){return new s.AccessKey({nonce:0,permission:new s.AccessKeyPermission({fullAccess:new s.FullAccessPermission({})})})}function c(e,t,r){return new s.AccessKey({nonce:0,permission:new s.AccessKeyPermission({functionCall:new s.FunctionCallPermission({receiverId:e,allowance:r,methodNames:t})})})}function u(){return new s.Action({createAccount:new s.CreateAccount({})})}function l(e){return new s.Action({deployContract:new s.DeployContract({code:e})})}function d(e){return void 0!==e.byteLength&&e.byteLength===e.length?e:n.from(JSON.stringify(e))}function f(e,t,r=new o.default(0),n=new o.default(0),i=d,a=!1){return new s.Action(a?{functionCall:new s.FunctionCall({methodName:e,args:t,gas:r,deposit:n})}:{functionCall:new s.FunctionCall({methodName:e,args:i(t),gas:r,deposit:n})})}function h(e=new o.default(0)){return new s.Action({transfer:new s.Transfer({deposit:e})})}function p(e=new o.default(0),t){return new s.Action({stake:new s.Stake({stake:e,publicKey:t})})}function y(e,t){return new s.Action({addKey:new s.AddKey({publicKey:e,accessKey:t})})}function g(e){return new s.Action({deleteKey:new s.DeleteKey({publicKey:e})})}function m(e){return new s.Action({deleteAccount:new s.DeleteAccount({beneficiaryId:e})})}function b({delegateAction:e,signature:t}){return new s.Action({signedDelegate:new s.SignedDelegate({delegateAction:e,signature:t})})}t.stringifyJsonOrBytes=d,t.actionCreators={addKey:y,createAccount:u,deleteAccount:m,deleteKey:g,deployContract:l,fullAccessKey:a,functionCall:f,functionCallAccessKey:c,signedDelegate:b,stake:p,transfer:h}},48351:(e,t,r)=>{"use strict";
31Object.defineProperty(t,"__esModule",{value:!0}),t.Action=t.SignedDelegate=t.DeleteAccount=t.DeleteKey=t.AddKey=t.Stake=t.Transfer=t.FunctionCall=t.DeployContract=t.CreateAccount=t.IAction=t.AccessKey=t.AccessKeyPermission=t.FullAccessPermission=t.FunctionCallPermission=void 0;let n=r(21404);class i{constructor(e){if(1!==Object.keys(e).length)throw Error("Enum can only take single value");Object.keys(e).map(t=>{this[t]=e[t],this.enum=t})}}class o extends n.Assignable{}t.FunctionCallPermission=o;class s extends n.Assignable{}t.FullAccessPermission=s;class a extends i{}t.AccessKeyPermission=a;class c extends n.Assignable{}t.AccessKey=c;class u extends n.Assignable{}t.IAction=u;class l extends u{}t.CreateAccount=l;class d extends u{}t.DeployContract=d;class f extends u{}t.FunctionCall=f;class h extends u{}t.Transfer=h;class p extends u{}t.Stake=p;class y extends u{}t.AddKey=y;class g extends u{}t.DeleteKey=g;class m extends u{}t.DeleteAccount=m;class b extends u{}t.SignedDelegate=b;class v extends i{}t.Action=v},57475:function(e,t,r){"use strict";var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.createTransaction=void 0;let i=n(r(5852)),o=r(33515);function s(e,t,r,n,s,a){return new o.Transaction({signerId:e,publicKey:t,nonce:new i.default(n),receiverId:r,actions:s,blockHash:a})}t.createTransaction=s},69083:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.buildDelegateAction=t.DelegateAction=void 0;let n=r(21404),{addKey:i,createAccount:o,deleteAccount:s,deleteKey:a,deployContract:c,functionCall:u,stake:l,transfer:d}=r(18550).actionCreators;class f extends n.Assignable{}function h({actions:e,maxBlockHeight:t,nonce:r,publicKey:n,receiverId:h,senderId:p}){return new f({senderId:p,receiverId:h,actions:e.map(e=>{if(!e.type&&!e.params)return e;switch(e.type){case"AddKey":{let{publicKey:t,accessKey:r}=e.params;return i(t,r)}case"CreateAccount":return o(e.params.createAccount);case"DeleteAccount":return s(e.params.deleteAccount);case"DeleteKey":return a(e.params.publicKey);case"DeployContract":return c(e.params.code);case"FunctionCall":{let{methodName:t,args:r,gas:n,deposit:i}=e.params;return u(t,r,n,i)}case"Stake":return l(e.params.stake,e.params.publicKey);case"Transfer":{let{deposit:t}=e.params;return d(t)}}throw Error("Unrecognized action")}),nonce:r,maxBlockHeight:t,publicKey:n})}t.DelegateAction=f,t.buildDelegateAction=h},10588:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);(!i||("get"in i?!t.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),i(r(18550),t),i(r(48351),t),i(r(57475),t),i(r(69083),t),i(r(33515),t),i(r(2425),t),i(r(946),t)},11276:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.DelegateActionPrefix=void 0;let n=r(21404),i=0x40000000,o={MetaTransactions:366};class s extends n.Assignable{}class a extends s{constructor(e){super({prefix:i+e})}}class c extends a{constructor(){super(o.MetaTransactions)}}t.DelegateActionPrefix=c},33515:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.SCHEMA=t.SignedTransaction=t.Transaction=t.decodeSignedTransaction=t.decodeTransaction=t.encodeTransaction=t.encodeSignedDelegate=t.encodeDelegateAction=void 0;let n=r(21404),i=r(30443),o=r(11276);function s(e){return new Uint8Array([...(0,i.serialize)(t.SCHEMA.DelegateActionPrefix,new o.DelegateActionPrefix),...(0,i.serialize)(t.SCHEMA.DelegateAction,e)])}function a(e){return(0,i.serialize)(t.SCHEMA.SignedDelegate,e)}function c(e){let r=e instanceof f?t.SCHEMA.SignedTransaction:t.SCHEMA.Transaction;return(0,i.serialize)(r,e)}function u(e){return new d((0,i.deserialize)(t.SCHEMA.Transaction,e))}function l(e){return new f((0,i.deserialize)(t.SCHEMA.SignedTransaction,e))}t.encodeDelegateAction=s,t.encodeSignedDelegate=a,t.encodeTransaction=c,t.decodeTransaction=u,t.decodeSignedTransaction=l;class d extends n.Assignable{encode(){return c(this)}static decode(e){return u(e)}}t.Transaction=d;class f extends n.Assignable{encode(){return c(this)}static decode(e){return l(e)}}t.SignedTransaction=f,t.SCHEMA=new class{constructor(){this.Signature={struct:{keyType:"u8",data:{array:{type:"u8",len:64}}}},this.PublicKey={struct:{keyType:"u8",data:{array:{type:"u8",len:32}}}},this.FunctionCallPermission={struct:{allowance:{option:"u128"},receiverId:"string",methodNames:{array:{type:"string"}}}},this.FullAccessPermission={struct:{}},this.AccessKeyPermission={enum:[{struct:{functionCall:this.FunctionCallPermission}},{struct:{fullAccess:this.FullAccessPermission}}]},this.AccessKey={struct:{nonce:"u64",permission:this.AccessKeyPermission}},this.CreateAccount={struct:{}},this.DeployContract={struct:{code:{array:{type:"u8"}}}},this.FunctionCall={struct:{methodName:"string",args:{array:{type:"u8"}},gas:"u64",deposit:"u128"}},this.Transfer={struct:{deposit:"u128"}},this.Stake={struct:{stake:"u128",publicKey:this.PublicKey}},this.AddKey={struct:{publicKey:this.PublicKey,accessKey:this.AccessKey}},this.DeleteKey={struct:{publicKey:this.PublicKey}},this.DeleteAccount={struct:{beneficiaryId:"string"}},this.DelegateActionPrefix={struct:{prefix:"u32"}},this.ClassicActions={enum:[{struct:{createAccount:this.CreateAccount}},{struct:{deployContract:this.DeployContract}},{struct:{functionCall:this.FunctionCall}},{struct:{transfer:this.Transfer}},{struct:{stake:this.Stake}},{struct:{addKey:this.AddKey}},{struct:{deleteKey:this.DeleteKey}},{struct:{deleteAccount:this.DeleteAccount}}]},this.DelegateAction={struct:{senderId:"string",receiverId:"string",actions:{array:{type:this.ClassicActions}},nonce:"u64",maxBlockHeight:"u64",publicKey:this.PublicKey}},this.SignedDelegate={struct:{delegateAction:this.DelegateAction,signature:this.Signature}},this.Action={enum:[{struct:{createAccount:this.CreateAccount}},{struct:{deployContract:this.DeployContract}},{struct:{functionCall:this.FunctionCall}},{struct:{transfer:this.Transfer}},{struct:{stake:this.Stake}},{struct:{addKey:this.AddKey}},{struct:{deleteKey:this.DeleteKey}},{struct:{deleteAccount:this.DeleteAccount}},{struct:{signedDelegate:this.SignedDelegate}}]},this.Transaction={struct:{signerId:"string",publicKey:this.PublicKey,nonce:"u64",receiverId:"string",blockHash:{array:{type:"u8",len:32}},actions:{array:{type:this.Action}}}},this.SignedTransaction={struct:{transaction:this.Transaction,signature:this.Signature}}}}},2425:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){function i(e){return e instanceof r?e:new r(function(t){t(e)})}return new(r||(r=Promise))(function(r,o){function s(e){try{c(n.next(e))}catch(e){o(e)}}function a(e){try{c(n.throw(e))}catch(e){o(e)}}function c(e){e.done?r(e.value):i(e.value).then(s,a)}c((n=n.apply(e,t||[])).next())})};
31Object.defineProperty(t,"__esModule",{value:!0}),t.signDelegateAction=t.signTransaction=void 0;let i=r(62782),o=r(48351),s=r(57475),a=r(33515),c=r(946);function u(e,t,r,o){return n(this,void 0,void 0,function*(){let n=(0,a.encodeTransaction)(e),s=new Uint8Array((0,i.sha256)(n)),u=yield t.signMessage(n,r,o);return[s,new a.SignedTransaction({transaction:e,signature:new c.Signature({keyType:e.publicKey.keyType,data:u.signature})})]})}function l(...e){return n(this,void 0,void 0,function*(){if(e[0].constructor===a.Transaction){let[t,r,n,i]=e;return u(t,r,n,i)}{let[t,r,n,i,o,a,c]=e,l=yield o.getPublicKey(a,c);return u((0,s.createTransaction)(a,l,t,r,n,i),o,a,c)}})}function d({delegateAction:e,signer:t}){return n(this,void 0,void 0,function*(){let r=(0,a.encodeDelegateAction)(e),n=yield t.sign(r),s=new o.SignedDelegate({delegateAction:e,signature:new c.Signature({keyType:e.publicKey.keyType,data:n})});return{hash:new Uint8Array((0,i.sha256)(r)),signedDelegateAction:s}})}t.signTransaction=l,t.signDelegateAction=d},946:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Signature=void 0;let n=r(21404);class i extends n.Assignable{}t.Signature=i},45281:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Assignable=void 0;class r{constructor(e){Object.keys(e).map(t=>{this[t]=e[t]})}}t.Assignable=r},75523:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ErrorContext=t.TypedError=t.ArgumentTypeError=t.PositionalArgsError=void 0;class r extends Error{constructor(){super("Contract method calls expect named arguments wrapped in object, e.g. { argName1: argValue1, argName2: argValue2 }")}}t.PositionalArgsError=r;class n extends Error{constructor(e,t,r){super(`Expected ${t} for '${e}' argument, but got '${JSON.stringify(r)}'`)}}t.ArgumentTypeError=n;class i extends Error{constructor(e,t,r){super(e),this.type=t||"UntypedError",this.context=r}}t.TypedError=i;class o{constructor(e){this.transactionHash=e}}t.ErrorContext=o},21404:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);(!i||("get"in i?!t.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),i(r(45281),t),i(r(75523),t),i(r(44222),t)},44222:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.FinalExecutionStatusBasic=t.ExecutionStatusBasic=t.IdType=void 0;var n=r(7592);Object.defineProperty(t,"IdType",{enumerable:!0,get:function(){return n.IdType}});var i=r(36937);Object.defineProperty(t,"ExecutionStatusBasic",{enumerable:!0,get:function(){return i.ExecutionStatusBasic}}),Object.defineProperty(t,"FinalExecutionStatusBasic",{enumerable:!0,get:function(){return i.FinalExecutionStatusBasic}})},7592:(e,t)=>{"use strict";var r;Object.defineProperty(t,"__esModule",{value:!0}),t.IdType=void 0,function(e){e.Transaction="transaction",e.Receipt="receipt"}(r=t.IdType||(t.IdType={}))},36937:(e,t)=>{"use strict";var r,n;Object.defineProperty(t,"__esModule",{value:!0}),t.FinalExecutionStatusBasic=t.ExecutionStatusBasic=void 0,function(e){e.Unknown="Unknown",e.Pending="Pending",e.Failure="Failure"}(r=t.ExecutionStatusBasic||(t.ExecutionStatusBasic={})),function(e){e.NotStarted="NotStarted",e.Started="Started",e.Failure="Failure"}(n=t.FinalExecutionStatusBasic||(t.FinalExecutionStatusBasic={}))},40785:function(e,t,r){"use strict";var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.DEFAULT_FUNCTION_CALL_GAS=void 0;let i=n(r(5852));t.DEFAULT_FUNCTION_CALL_GAS=new i.default("30000000000000")},69763:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.logWarning=void 0;let n=r(24699);function i(...e){let[t,...r]=e;n.Logger.warn(t,...r)}t.logWarning=i},58908:(e,t,r)=>{"use strict";
31Object.defineProperty(t,"__esModule",{value:!0}),t.parseRpcError=t.parseResultError=t.getErrorTypeFromErrorMessage=t.formatError=t.ServerError=t.logWarning=void 0;var n=r(69763);Object.defineProperty(t,"logWarning",{enumerable:!0,get:function(){return n.logWarning}});var i=r(4219);Object.defineProperty(t,"ServerError",{enumerable:!0,get:function(){return i.ServerError}}),Object.defineProperty(t,"formatError",{enumerable:!0,get:function(){return i.formatError}}),Object.defineProperty(t,"getErrorTypeFromErrorMessage",{enumerable:!0,get:function(){return i.getErrorTypeFromErrorMessage}}),Object.defineProperty(t,"parseResultError",{enumerable:!0,get:function(){return i.parseResultError}}),Object.defineProperty(t,"parseRpcError",{enumerable:!0,get:function(){return i.parseRpcError}})},4219:function(e,t,r){"use strict";var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.getErrorTypeFromErrorMessage=t.formatError=t.parseResultError=t.parseRpcError=t.ServerError=void 0;let i=r(21404),o=n(r(2139)),s=r(39379),a=n(r(35495)),c=n(r(42728)),u={formatNear:()=>(e,t)=>(0,s.formatNearAmount)(t(e))};class l extends i.TypedError{}t.ServerError=l;class d extends l{}function f(e){let t={},r=y(e,c.default.schema,t,""),n=new l(p(r,t),r);return Object.assign(n,t),n}function h(e){let t=f(e.status.Failure),r=new d;return Object.assign(r,t),r.type=t.type,r.message=t.message,r.transaction_outcome=e.transaction_outcome,r}function p(e,t){return"string"==typeof a.default[e]?o.default.render(a.default[e],Object.assign(Object.assign({},t),u)):JSON.stringify(t)}function y(e,t,r,n){let i,o,s;for(let r in t){if(b(e[r]))return e[r];if(m(e[r]))i=e[r],o=t[r],s=r;else{if(!(m(e.kind)&&m(e.kind[r])))continue;i=e.kind[r],o=t[r],s=r}}if(!i||!o)return r.kind=e,n;for(let e of Object.keys(o.props))r[e]=i[e];return y(i,t,r,s)}function g(e,t){switch(!0){case/^account .*? does not exist while viewing$/.test(e):case/^Account .*? doesn't exist$/.test(e):return"AccountDoesNotExist";case/^access key .*? does not exist while viewing$/.test(e):return"AccessKeyDoesNotExist";case/wasm execution failed with error: FunctionCallError\(CompilationError\(CodeDoesNotExist/.test(e):case/wasm execution failed with error: CompilationError\(CodeDoesNotExist/.test(e):return"CodeDoesNotExist";case/wasm execution failed with error: FunctionCallError\(MethodResolveError\(MethodNotFound/.test(e):case/wasm execution failed with error: MethodResolveError\(MethodNotFound/.test(e):return"MethodNotFound";case/Transaction nonce \d+ must be larger than nonce of the used access key \d+/.test(e):return"InvalidNonce";default:return t}}function m(e){return"[object Object]"===Object.prototype.toString.call(e)}function b(e){return"[object String]"===Object.prototype.toString.call(e)}t.parseRpcError=f,t.parseResultError=h,t.formatError=p,t.getErrorTypeFromErrorMessage=g},39379:function(e,t,r){"use strict";var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.baseDecode=t.baseEncode=t.parseNearAmount=t.formatNearAmount=t.NEAR_NOMINATION=t.NEAR_NOMINATION_EXP=void 0;let i=n(r(5852)),o=n(r(89631));t.NEAR_NOMINATION_EXP=24,t.NEAR_NOMINATION=new i.default("10",10).pow(new i.default(t.NEAR_NOMINATION_EXP,10));let s=[],a=new i.default(10);for(let e=0,r=new i.default(5);e<t.NEAR_NOMINATION_EXP;e++,r=r.mul(a))s[e]=r;function c(e,r=t.NEAR_NOMINATION_EXP){let n=new i.default(e,10);if(r!==t.NEAR_NOMINATION_EXP){let e=t.NEAR_NOMINATION_EXP-r-1;e>0&&n.iadd(s[e])}let o=(e=n.toString()).substring(0,e.length-t.NEAR_NOMINATION_EXP)||"0",a=e.substring(e.length-t.NEAR_NOMINATION_EXP).padStart(t.NEAR_NOMINATION_EXP,"0").substring(0,r);return d(`${h(o)}.${a}`)}function u(e){if(!e)return null;let r=(e=l(e)).split("."),n=r[0],i=r[1]||"";if(r.length>2||i.length>t.NEAR_NOMINATION_EXP)throw Error(`Cannot parse '${e}' as NEAR amount`);return f(n+i.padEnd(t.NEAR_NOMINATION_EXP,"0"))}function l(e){return e.replace(/,/g,"").trim()}function d(e){return e.replace(/\.?0*$/,"")}function f(e){return""===(e=e.replace(/^0+/,""))?"0":e}function h(e){let t=/(-?\d+)(\d{3})/;for(;t.test(e);)e=e.replace(t,"$1,$2");return e}function p(e){if("string"==typeof e){let t=[];for(let r=0;r<e.length;r++)t.push(e.charCodeAt(r));e=new Uint8Array(t)}return o.default.encode(e)}function y(e){return new Uint8Array(o.default.decode(e))}t.formatNearAmount=c,t.parseNearAmount=u,t.baseEncode=p,t.baseDecode=y},54520:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);
31(!i||("get"in i?!t.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),i(r(40785),t),i(r(58908),t),i(r(39379),t),i(r(77633),t),i(r(95125),t),i(r(34515),t),i(r(24699),t)},74896:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ConsoleLogger=void 0;class r{constructor(e){this.logLevels=e,this.isLevelEnabled=e=>this.logLevels.includes(e)}print(e,t,...r){switch(e){case"error":case"fatal":return console.error(t,...r);case"warn":return console.warn(t,...r);case"log":return console.log(t,...r);case"debug":case"verbose":return console.debug(t,...r)}}verbose(e,...t){this.isLevelEnabled("verbose")&&this.print("verbose",e,...t)}debug(e,...t){this.isLevelEnabled("debug")&&this.print("debug",e,...t)}log(e,...t){this.isLevelEnabled("log")&&this.print("log",e,...t)}warn(e,...t){this.isLevelEnabled("warn")&&this.print("warn",e,...t)}error(e,...t){this.isLevelEnabled("error")&&this.print("error",e,...t)}fatal(e,...t){this.isLevelEnabled("fatal")&&this.print("fatal",e,...t)}}t.ConsoleLogger=r},24699:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Logger=void 0;var n=r(72377);Object.defineProperty(t,"Logger",{enumerable:!0,get:function(){return n.Logger}})},72377:(e,t,r)=>{"use strict";var n,i=r(2818);Object.defineProperty(t,"__esModule",{value:!0}),t.Logger=void 0;let o=r(74896),s=["verbose","debug","log","warn","error","fatal"],a="object"==typeof i&&i.env.NEAR_NO_LOGS?void 0:new o.ConsoleLogger(s);class c{static error(e,...t){var r;null===(r=this.instanceRef)||void 0===r||r.error(e,...t)}static log(e,...t){var r;null===(r=this.instanceRef)||void 0===r||r.log(e,...t)}static warn(e,...t){var r;null===(r=this.instanceRef)||void 0===r||r.warn(e,...t)}static debug(e,...t){var r,n;null===(n=null===(r=this.instanceRef)||void 0===r?void 0:r.debug)||void 0===n||n.call(r,e,...t)}static verbose(e,...t){var r,n;null===(n=null===(r=this.instanceRef)||void 0===r?void 0:r.verbose)||void 0===n||n.call(r,e,...t)}static fatal(e,...t){var r,n;null===(n=null===(r=this.instanceRef)||void 0===r?void 0:r.fatal)||void 0===n||n.call(r,e,...t)}}t.Logger=c,n=c,c.instanceRef=a,c.overrideLogger=e=>{n.instanceRef=e}},77633:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.printTxOutcomeLogs=t.printTxOutcomeLogsAndFailures=void 0;let n=r(58908),i=r(24699);function o({contractId:e,outcome:t}){for(let r of[t.transaction_outcome,...t.receipts_outcome].reduce((e,t)=>{let r="object"==typeof t.outcome.status&&"object"==typeof t.outcome.status.Failure;return t.outcome.logs.length||r?e.concat({receiptIds:t.outcome.receipt_ids,logs:t.outcome.logs,failure:"object"==typeof t.outcome.status&&void 0!==t.outcome.status.Failure?(0,n.parseRpcError)(t.outcome.status.Failure):null}):e},[]))i.Logger.log(`Receipt${r.receiptIds.length>1?"s":""}: ${r.receiptIds.join(", ")}`),s({contractId:e,logs:r.logs,prefix:" "}),r.failure&&i.Logger.warn(` Failure [${e}]: ${r.failure}`)}function s({contractId:e,logs:t,prefix:r=""}){for(let n of t)i.Logger.log(`${r}Log [${e}]: ${n}`)}t.printTxOutcomeLogsAndFailures=o,t.printTxOutcomeLogs=s},95125:(e,t,r)=>{"use strict";var n=r(75927).Buffer;function i(e){if("object"==typeof e.status&&"string"==typeof e.status.SuccessValue){let t=n.from(e.status.SuccessValue,"base64").toString();try{return JSON.parse(t)}catch(e){return t}}return null}Object.defineProperty(t,"__esModule",{value:!0}),t.getTransactionLastResult=void 0,t.getTransactionLastResult=i},34515:function(e,t,r){"use strict";var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.diffEpochValidators=t.findSeatPrice=void 0;let i=n(r(5852)),o=n(r(29905));function s(e,t,r,n){return n&&n<49?a(e,t):(r||((0,o.default)("findSeatPrice(validators, maxNumberOfSeats)")("`use `findSeatPrice(validators, maxNumberOfSeats, minimumStakeRatio)` instead"),r=[1,6250]),c(e,t,r))}function a(e,t){let r=e.map(e=>new i.default(e.stake,10)).sort((e,t)=>
31e.cmp(t)),n=new i.default(t),o=r.reduce((e,t)=>e.add(t));if(o.lt(n))throw Error("Stakes are below seats");let s=new i.default(1),a=o.add(new i.default(1));for(;!s.eq(a.sub(new i.default(1)));){let e=s.add(a).div(new i.default(2)),t=!1,o=new i.default(0);for(let i=0;i<r.length;++i)if((o=o.add(r[i].div(e))).gte(n)){s=e,t=!0;break}t||(a=e)}return s}function c(e,t,r){if(2!=r.length)throw Error("minimumStakeRatio should have 2 elements");let n=e.map(e=>new i.default(e.stake,10)).sort((e,t)=>e.cmp(t)),o=n.reduce((e,t)=>e.add(t));return e.length<t?o.mul(new i.default(r[0])).div(new i.default(r[1])):n[0].add(new i.default(1))}function u(e,t){let r=new Map;e.forEach(e=>r.set(e.account_id,e));let n=new Set(t.map(e=>e.account_id));return{newValidators:t.filter(e=>!r.has(e.account_id)),removedValidators:e.filter(e=>!n.has(e.account_id)),changedValidators:t.filter(e=>r.has(e.account_id)&&r.get(e.account_id).stake!=e.stake).map(e=>({current:r.get(e.account_id),next:e}))}}t.findSeatPrice=s,t.diffEpochValidators=u},41134:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.WalletConnection=t.ConnectedWalletAccount=t.Near=void 0;var n=r(66624);Object.defineProperty(t,"Near",{enumerable:!0,get:function(){return n.Near}});var i=r(75351);Object.defineProperty(t,"ConnectedWalletAccount",{enumerable:!0,get:function(){return i.ConnectedWalletAccount}}),Object.defineProperty(t,"WalletConnection",{enumerable:!0,get:function(){return i.WalletConnection}})},66624:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){function i(e){return e instanceof r?e:new r(function(t){t(e)})}return new(r||(r=Promise))(function(r,o){function s(e){try{c(n.next(e))}catch(e){o(e)}}function a(e){try{c(n.throw(e))}catch(e){o(e)}}function c(e){e.done?r(e.value):i(e.value).then(s,a)}c((n=n.apply(e,t||[])).next())})},i=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.Near=void 0;let o=r(1525),s=i(r(5852));class a{constructor(e){var t;if(this.config=e,this.connection=o.Connection.fromConfig({networkId:e.networkId,provider:{type:"JsonRpcProvider",args:{url:e.nodeUrl,headers:e.headers}},signer:e.signer||{type:"InMemorySigner",keyStore:e.keyStore||(null===(t=e.deps)||void 0===t?void 0:t.keyStore)},jsvmAccountId:e.jsvmAccountId||`jsvm.${e.networkId}`}),e.masterAccount){let t=new s.default(e.initialBalance?e.initialBalance:"500000000000000000000000000");this.accountCreator=new o.LocalAccountCreator(new o.Account(this.connection,e.masterAccount),t)}else e.helperUrl?this.accountCreator=new o.UrlAccountCreator(this.connection,e.helperUrl):this.accountCreator=null}account(e){return n(this,void 0,void 0,function*(){return new o.Account(this.connection,e)})}createAccount(e,t){return n(this,void 0,void 0,function*(){if(!this.accountCreator)throw Error("Must specify account creator, either via masterAccount or helperUrl configuration settings.");return yield this.accountCreator.createAccount(e,t),new o.Account(this.connection,e)})}}t.Near=a},75351:function(e,t,r){"use strict";var n=r(75927).Buffer,i=this&&this.__awaiter||function(e,t,r,n){function i(e){return e instanceof r?e:new r(function(t){t(e)})}return new(r||(r=Promise))(function(r,o){function s(e){try{c(n.next(e))}catch(e){o(e)}}function a(e){try{c(n.throw(e))}catch(e){o(e)}}function c(e){e.done?r(e.value):i(e.value).then(s,a)}c((n=n.apply(e,t||[])).next())})},o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.ConnectedWalletAccount=t.WalletConnection=void 0;let s=r(1525),a=r(10708),c=r(54520),u=r(10588),l=o(r(5852)),d=r(30443),f="/login/",h="add_request_and_confirm",p="_wallet_auth_key",y="pending_key";class g{constructor(e,t){if("string"!=typeof t)throw Error("Please define a clear appKeyPrefix for this WalletConnection instance as the second argument to the constructor");if("undefined"==typeof window)return new Proxy(this,{get:(e,t)=>"isSignedIn"===t?()=>!1:"getAccountId"===t?()=>"":e[t]&&"function"==typeof e[t]?()=>{throw Error("No window found in context, please ensure you are using WalletConnection on the browser")}:e[t]});this._near=e;let r=t+p,n=JSON.parse(window.localStorage.getItem(r));this._networkId=e.config.networkId,this._walletBaseUrl=e.config.walletUrl,t=t||e.config.contractName||"default",this._keyStore=e.connection.signer.keyStore,this._authData=n||{allKeys:[]},this._authDataKey=r,this.isSignedIn()||(this._completeSignInPromise=this._completeSignInWithAccessKey())}isSignedIn(){return!!this._authData.accountId}isSignedInAsync(){return i(this,void 0,void 0,function*(){return this._completeSignInPromise&&(yield this._completeSignInPromise),this.isSignedIn()})}getAccountId(){return this._authData.accountId||""}requestSignInUrl({contractId:e,methodNames:t,successUrl:r,failureUrl:n}){return i(this,void 0,void 0,function*(){let i=new URL(window.location.href),o=new URL(this._walletBaseUrl+f);if(o.searchParams.set("success_url",r||i.href),o.searchParams.set("failure_url",n||i.href),e){let t=yield this._near.account(e);yield t.state(),o.searchParams.set("contract_id",e);let r=a.KeyPair.fromRandom("ed25519");o.searchParams.set("public_key",r.getPublicKey().toString()),yield this._keyStore.setKey(this._networkId,y+r.getPublicKey(),r)}
31return t&&t.forEach(e=>{o.searchParams.append("methodNames",e)}),o.toString()})}requestSignIn(e){return i(this,void 0,void 0,function*(){let t=yield this.requestSignInUrl(e);window.location.assign(t)})}requestSignTransactionsUrl({transactions:e,meta:t,callbackUrl:r}){let i=new URL(window.location.href),o=new URL("sign",this._walletBaseUrl);return o.searchParams.set("transactions",e.map(e=>(0,d.serialize)(u.SCHEMA.Transaction,e)).map(e=>n.from(e).toString("base64")).join(",")),o.searchParams.set("callbackUrl",r||i.href),t&&o.searchParams.set("meta",t),o.toString()}requestSignTransactions(e){let t=this.requestSignTransactionsUrl(e);window.location.assign(t)}_completeSignInWithAccessKey(){return i(this,void 0,void 0,function*(){let e=new URL(window.location.href),t=e.searchParams.get("public_key")||"",r=(e.searchParams.get("all_keys")||"").split(","),n=e.searchParams.get("account_id")||"";if(n){let e={accountId:n,allKeys:r};window.localStorage.setItem(this._authDataKey,JSON.stringify(e)),t&&(yield this._moveKeyFromTempToPermanent(n,t)),this._authData=e}e.searchParams.delete("public_key"),e.searchParams.delete("all_keys"),e.searchParams.delete("account_id"),e.searchParams.delete("meta"),e.searchParams.delete("transactionHashes"),window.history.replaceState({},document.title,e.toString())})}_moveKeyFromTempToPermanent(e,t){return i(this,void 0,void 0,function*(){let r=yield this._keyStore.getKey(this._networkId,y+t);yield this._keyStore.setKey(this._networkId,e,r),yield this._keyStore.removeKey(this._networkId,y+t)})}signOut(){this._authData={},window.localStorage.removeItem(this._authDataKey)}account(){return this._connectedAccount||(this._connectedAccount=new m(this,this._near.connection,this._authData.accountId)),this._connectedAccount}}t.WalletConnection=g;class m extends s.Account{constructor(e,t,r){super(t,r),this.walletConnection=e}signAndSendTransaction({receiverId:e,actions:t,walletMeta:r,walletCallbackUrl:n=window.location.href}){let o=Object.create(null,{signAndSendTransaction:{get:()=>super.signAndSendTransaction}});return i(this,void 0,void 0,function*(){let i=yield this.connection.signer.getPublicKey(this.accountId,this.connection.networkId),s=yield this.accessKeyForTransaction(e,t,i);if(!s)throw Error(`Cannot find matching key for transaction sent to ${e}`);if(i&&i.toString()===s.public_key)try{return yield o.signAndSendTransaction.call(this,{receiverId:e,actions:t})}catch(r){if("NotEnoughAllowance"===r.type)s=yield this.accessKeyForTransaction(e,t);else throw r}let d=yield this.connection.provider.block({finality:"final"}),f=(0,c.baseDecode)(d.header.hash),h=a.PublicKey.from(s.public_key),p=s.access_key.nonce.add(new l.default(1)),y=(0,u.createTransaction)(this.accountId,h,e,p,t,f);return yield this.walletConnection.requestSignTransactions({transactions:[y],meta:r,callbackUrl:n}),new Promise((e,t)=>{setTimeout(()=>{t(Error("Failed to redirect to sign transaction"))},1e3)})})}accessKeyMatchesTransaction(e,t,r){return i(this,void 0,void 0,function*(){let{access_key:{permission:n}}=e;if("FullAccess"===n)return!0;if(n.FunctionCall){let{receiver_id:e,method_names:i}=n.FunctionCall;if(e===this.accountId&&i.includes(h))return!0;if(e===t){if(1!==r.length)return!1;let[{functionCall:e}]=r;return e&&(!e.deposit||"0"===e.deposit.toString())&&(0===i.length||i.includes(e.methodName))}}return!1})}accessKeyForTransaction(e,t,r){return i(this,void 0,void 0,function*(){let n=yield this.getAccessKeys();if(r){let i=n.find(e=>e.public_key.toString()===r.toString());if(i&&(yield this.accessKeyMatchesTransaction(i,e,t)))return i}let i=this.walletConnection._authData.allKeys;for(let r of n)if(-1!==i.indexOf(r.public_key)&&(yield this.accessKeyMatchesTransaction(r,e,t)))return r;return null})}}t.ConnectedWalletAccount=m},36615:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.validateBasic=t.wNAF=void 0;let n=r(17046),i=r(49997),o=BigInt(0),s=BigInt(1);function a(e,t){let r=(e,t)=>{let r=t.negate();return e?r:t},n=e=>({windows:Math.ceil(t/e)+1,windowSize:2**(e-1)});return{constTimeNegate:r,unsafeLadder(t,r){let n=e.ZERO,i=t;
31for(;r>o;)r&s&&(n=n.add(i)),i=i.double(),r>>=s;return n},precomputeWindow(e,t){let{windows:r,windowSize:i}=n(t),o=[],s=e,a=s;for(let e=0;e<r;e++){a=s,o.push(a);for(let e=1;e<i;e++)a=a.add(s),o.push(a);s=a.double()}return o},wNAF(t,i,o){let{windows:a,windowSize:c}=n(t),u=e.ZERO,l=e.BASE,d=BigInt(2**t-1),f=2**t,h=BigInt(t);for(let e=0;e<a;e++){let t=e*c,n=Number(o&d);o>>=h,n>c&&(n-=f,o+=s);let a=t,p=t+Math.abs(n)-1,y=e%2!=0,g=n<0;0===n?l=l.add(r(y,i[a])):u=u.add(r(g,i[p]))}return{p:u,f:l}},wNAFCached(e,t,r,n){let i=e._WINDOW_SIZE||1,o=t.get(e);return o||(o=this.precomputeWindow(e,i),1!==i&&t.set(e,n(o))),this.wNAF(i,o,r)}}}function c(e){return(0,n.validateField)(e.Fp),(0,i.validateObject)(e,{n:"bigint",h:"bigint",Gx:"field",Gy:"field"},{nBitLength:"isSafeInteger",nByteLength:"isSafeInteger"}),Object.freeze({...(0,n.nLength)(e.n,e.nBitLength),...e,p:e.Fp.ORDER})}t.wNAF=a,t.validateBasic=c},24352:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.twistedEdwards=void 0;let n=r(17046),i=r(49997),o=r(49997),s=r(36615),a=BigInt(0),c=BigInt(1),u=BigInt(2),l=BigInt(8),d={zip215:!0};function f(e){let t=(0,s.validateBasic)(e);return i.validateObject(e,{hash:"function",a:"bigint",d:"bigint",randomBytes:"function"},{adjustScalarBytes:"function",domain:"function",uvRatio:"function",mapToCurve:"function"}),Object.freeze({...t})}function h(e){let t=f(e),{Fp:r,n:h,prehash:p,hash:y,randomBytes:g,nByteLength:m,h:b}=t,v=u<<BigInt(8*m)-c,w=r.create,_=t.uvRatio||((e,t)=>{try{return{isValid:!0,value:r.sqrt(e*r.inv(t))}}catch(e){return{isValid:!1,value:a}}}),E=t.adjustScalarBytes||(e=>e),S=t.domain||((e,t,r)=>{if(t.length||r)throw Error("Contexts/pre-hash are not supported");return e}),x=e=>"bigint"==typeof e&&a<e,A=(e,t)=>x(e)&&x(t)&&e<t,I=e=>e===a||A(e,v);function O(e,t){if(A(e,t))return e;throw Error(`Expected valid scalar < ${t}, got ${typeof e} ${e}`)}function T(e){return e===a?e:O(e,h)}let P=new Map;function M(e){if(!(e instanceof N))throw Error("ExtendedPoint expected")}class N{constructor(e,t,r,n){if(this.ex=e,this.ey=t,this.ez=r,this.et=n,!I(e))throw Error("x required");if(!I(t))throw Error("y required");if(!I(r))throw Error("z required");if(!I(n))throw Error("t required")}get x(){return this.toAffine().x}get y(){return this.toAffine().y}static fromAffine(e){if(e instanceof N)throw Error("extended point not allowed");let{x:t,y:r}=e||{};if(!I(t)||!I(r))throw Error("invalid affine point");return new N(t,r,c,w(t*r))}static normalizeZ(e){let t=r.invertBatch(e.map(e=>e.ez));return e.map((e,r)=>e.toAffine(t[r])).map(N.fromAffine)}_setWindowSize(e){this._WINDOW_SIZE=e,P.delete(this)}assertValidity(){let{a:e,d:r}=t;if(this.is0())throw Error("bad point: ZERO");let{ex:n,ey:i,ez:o,et:s}=this,a=w(n*n),c=w(i*i),u=w(o*o),l=w(u*u),d=w(a*e);if(w(u*w(d+c))!==w(l+w(r*w(a*c))))throw Error("bad point: equation left != right (1)");if(w(n*i)!==w(o*s))throw Error("bad point: equation left != right (2)")}equals(e){M(e);let{ex:t,ey:r,ez:n}=this,{ex:i,ey:o,ez:s}=e,a=w(t*s),c=w(i*n),u=w(r*s),l=w(o*n);return a===c&&u===l}is0(){return this.equals(N.ZERO)}negate(){return new N(w(-this.ex),this.ey,this.ez,w(-this.et))}double(){let{a:e}=t,{ex:r,ey:n,ez:i}=this,o=w(r*r),s=w(n*n),a=w(u*w(i*i)),c=w(e*o),l=r+n,d=w(w(l*l)-o-s),f=c+s,h=f-a,p=c-s,y=w(d*h),g=w(f*p),m=w(d*p);return new N(y,g,w(h*f),m)}add(e){M(e);let{a:r,d:n}=t,{ex:i,ey:o,ez:s,et:c}=this,{ex:l,ey:d,ez:f,et:h}=e;if(r===BigInt(-1)){let e=w((o-i)*(d+l)),t=w((o+i)*(d-l)),r=w(t-e);if(r===a)return this.double();let n=w(s*u*h),p=w(c*u*f),y=p+n,g=t+e,m=p-n,b=w(y*r),v=w(g*m),_=w(y*m);return new N(b,v,w(r*g),_)}let p=w(i*l),y=w(o*d),g=w(c*n*h),m=w(s*f),b=w((i+o)*(l+d)-p-y),v=m-g,_=m+g,E=w(y-r*p),S=w(b*v),x=w(_*E),A=w(b*E);return new N(S,x,w(v*_),A)}subtract(e){return this.add(e.negate())}wNAF(e){return D.wNAFCached(this,P,e,N.normalizeZ)}multiply(e){let{p:t,f:r}=this.wNAF(O(e,h));return N.normalizeZ([t,r])[0]}multiplyUnsafe(e){let t=T(e);return t===a?C:this.equals(C)||t===c?this:this.equals(k)?this.wNAF(t).p:D.unsafeLadder(this,t)}isSmallOrder(){return this.multiplyUnsafe(b).is0()}isTorsionFree(){return D.unsafeLadder(this,h).is0()}toAffine(e){let{ex:t,ey:n,ez:i}=this,o=this.is0();null==e&&(e=o?l:r.inv(i));let s=w(t*e),u=w(n*e),d=w(i*e);if(o)return{x:a,y:c};
31if(d!==c)throw Error("invZ was invalid");return{x:s,y:u}}clearCofactor(){let{h:e}=t;return e===c?this:this.multiplyUnsafe(e)}static fromHex(e,n=!1){let{d:s,a:u}=t,l=r.BYTES,d=(e=(0,o.ensureBytes)("pointHex",e,l)).slice(),f=e[l-1];d[l-1]=-129&f;let h=i.bytesToNumberLE(d);h===a||(n?O(h,v):O(h,r.ORDER));let p=w(h*h),{isValid:y,value:g}=_(w(p-c),w(s*p-u));if(!y)throw Error("Point.fromHex: invalid y coordinate");let m=(g&c)===c,b=(128&f)!=0;if(!n&&g===a&&b)throw Error("Point.fromHex: x=0 and x_0=1");return b!==m&&(g=w(-g)),N.fromAffine({x:g,y:h})}static fromPrivateKey(e){return L(e).point}toRawBytes(){let{x:e,y:t}=this.toAffine(),n=i.numberToBytesLE(t,r.BYTES);return n[n.length-1]|=e&c?128:0,n}toHex(){return i.bytesToHex(this.toRawBytes())}}N.BASE=new N(t.Gx,t.Gy,c,w(t.Gx*t.Gy)),N.ZERO=new N(a,c,c,a);let{BASE:k,ZERO:C}=N,D=(0,s.wNAF)(N,8*m);function j(e){return(0,n.mod)(e,h)}function R(e){return j(i.bytesToNumberLE(e))}function L(e){let t=m;e=(0,o.ensureBytes)("private key",e,t);let r=(0,o.ensureBytes)("hashed private key",y(e),2*t),n=E(r.slice(0,t)),i=r.slice(t,2*t),s=R(n),a=k.multiply(s),c=a.toRawBytes();return{head:n,prefix:i,scalar:s,point:a,pointBytes:c}}function B(e){return L(e).pointBytes}function U(e=new Uint8Array,...t){return R(y(S(i.concatBytes(...t),(0,o.ensureBytes)("context",e),!!p)))}function $(e,t,n={}){e=(0,o.ensureBytes)("message",e),p&&(e=p(e));let{prefix:s,scalar:a,pointBytes:c}=L(t),u=U(n.context,s,e),l=k.multiply(u).toRawBytes(),d=j(u+U(n.context,l,c,e)*a);T(d);let f=i.concatBytes(l,i.numberToBytesLE(d,r.BYTES));return(0,o.ensureBytes)("result",f,2*m)}let K=d;function F(e,t,n,s=K){let a,c,u;let{context:l,zip215:d}=s,f=r.BYTES;e=(0,o.ensureBytes)("signature",e,2*f),t=(0,o.ensureBytes)("message",t),p&&(t=p(t));let h=i.bytesToNumberLE(e.slice(f,2*f));try{a=N.fromHex(n,d),c=N.fromHex(e.slice(0,f),d),u=k.multiplyUnsafe(h)}catch(e){return!1}if(!d&&a.isSmallOrder())return!1;let y=U(l,c.toRawBytes(),a.toRawBytes(),t);return c.add(a.multiplyUnsafe(y)).subtract(u).clearCofactor().equals(N.ZERO)}k._setWindowSize(8);let z={getExtendedPublicKey:L,randomPrivateKey:()=>g(r.BYTES),precompute:(e=8,t=N.BASE)=>(t._setWindowSize(e),t.multiply(BigInt(3)),t)};return{CURVE:t,getPublicKey:B,sign:$,verify:F,ExtendedPoint:N,utils:z}}t.twistedEdwards=h},66016:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createHasher=t.isogenyMap=t.hash_to_field=t.expand_message_xof=t.expand_message_xmd=void 0;let n=r(17046),i=r(49997);function o(e){if(e instanceof Uint8Array)return e;if("string"==typeof e)return(0,i.utf8ToBytes)(e);throw Error("DST must be Uint8Array or string")}let s=i.bytesToNumberBE;function a(e,t){if(e<0||e>=1<<8*t)throw Error(`bad I2OSP call: value=${e} length=${t}`);let r=Array.from({length:t}).fill(0);for(let n=t-1;n>=0;n--)r[n]=255&e,e>>>=8;return new Uint8Array(r)}function c(e,t){let r=new Uint8Array(e.length);for(let n=0;n<e.length;n++)r[n]=e[n]^t[n];return r}function u(e){if(!(e instanceof Uint8Array))throw Error("Uint8Array expected")}function l(e){if(!Number.isSafeInteger(e))throw Error("number expected")}function d(e,t,r,n){u(e),u(t),l(r),t.length>255&&(t=n((0,i.concatBytes)((0,i.utf8ToBytes)("H2C-OVERSIZE-DST-"),t)));let{outputLen:o,blockLen:s}=n,d=Math.ceil(r/o);if(d>255)throw Error("Invalid xmd length");let f=(0,i.concatBytes)(t,a(t.length,1)),h=a(0,s),p=a(r,2),y=Array(d),g=n((0,i.concatBytes)(h,e,p,a(0,1),f));y[0]=n((0,i.concatBytes)(g,a(1,1),f));for(let e=1;e<=d;e++){let t=[c(g,y[e-1]),a(e+1,1),f];y[e]=n((0,i.concatBytes)(...t))}return(0,i.concatBytes)(...y).slice(0,r)}function f(e,t,r,n,o){if(u(e),u(t),l(r),t.length>255){let e=Math.ceil(2*n/8);t=o.create({dkLen:e}).update((0,i.utf8ToBytes)("H2C-OVERSIZE-DST-")).update(t).digest()}if(r>65535||t.length>255)throw Error("expand_message_xof: invalid lenInBytes");return o.create({dkLen:r}).update(e).update(a(r,2)).update(t).update(a(t.length,1)).digest()}function h(e,t,r){let a;(0,i.validateObject)(r,{DST:"stringOrUint8Array",p:"bigint",m:"isSafeInteger",k:"isSafeInteger",hash:"hash"});let{p:c,k:h,m:p,hash:y,expand:g,DST:m}=r;u(e),l(t);let b=o(m),v=Math.ceil((c.toString(2).length+h)/8),w=t*p*v;if("xmd"===g)a=d(e,b,w,y);else if("xof"===g)a=f(e,b,w,h,y);else if("_internal_pass"===g)a=e;else throw Error('expand must be "xmd" or "xof"');let _=Array(t);for(let e=0;e<t;e++){let t=Array(p);for(let r=0;r<p;r++){let i=v*(r+e*p),o=a.subarray(i,i+v);t[r]=(0,n.mod)(s(o),c)}_[e]=t}return _}function p(e,t){let r=t.map(e=>Array.from(e).reverse());return(t,n)=>{let[i,o,s,a]=r.map(r=>r.reduce((r,n)=>e.add(e.mul(r,t),n)));return t=e.div(i,o),n=e.mul(n,e.div(s,a)),{x:t,y:n}}}function y(e,t,r){if("function"!=typeof t)throw Error("mapToCurve() must be defined");return{hashToCurve(n,i){let o=h(n,2,{...r,DST:r.DST,...i}),s=e.fromAffine(t(o[0])),a=e.fromAffine(t(o[1])),c=s.add(a).clearCofactor();return c.assertValidity(),c},encodeToCurve(n,i){let o=h(n,1,{...r,DST:r.encodeDST,...i}),s=e.fromAffine(t(o[0])).clearCofactor();return s.assertValidity(),s}}}t.expand_message_xmd=d,t.expand_message_xof=f,t.hash_to_field=h,t.isogenyMap=p,t.createHasher=y},17046:(e,t,r)=>{"use strict";
31Object.defineProperty(t,"__esModule",{value:!0}),t.mapHashToField=t.getMinHashLength=t.getFieldBytesLength=t.hashToPrivateScalar=t.FpSqrtEven=t.FpSqrtOdd=t.Field=t.nLength=t.FpIsSquare=t.FpDiv=t.FpInvertBatch=t.FpPow=t.validateField=t.isNegativeLE=t.FpSqrt=t.tonelliShanks=t.invert=t.pow2=t.pow=t.mod=void 0;let n=r(49997),i=BigInt(0),o=BigInt(1),s=BigInt(2),a=BigInt(3),c=BigInt(4),u=BigInt(5),l=BigInt(8);function d(e,t){let r=e%t;return r>=i?r:t+r}function f(e,t,r){if(r<=i||t<i)throw Error("Expected power/modulo > 0");if(r===o)return i;let n=o;for(;t>i;)t&o&&(n=n*e%r),e=e*e%r,t>>=o;return n}function h(e,t,r){let n=e;for(;t-- >i;)n*=n,n%=r;return n}function p(e,t){if(e===i||t<=i)throw Error(`invert: expected positive integers, got n=${e} mod=${t}`);let r=d(e,t),n=t,s=i,a=o,c=o,u=i;for(;r!==i;){let e=n/r,t=n%r,i=s-c*e,o=a-u*e;n=r,r=t,s=c,a=u,c=i,u=o}if(n!==o)throw Error("invert: does not exist");return d(s,t)}function y(e){let t,r,n;let a=(e-o)/s;for(t=e-o,r=0;t%s===i;t/=s,r++);for(n=s;n<e&&f(n,a,e)!==e-o;n++);if(1===r){let t=(e+o)/c;return function(e,r){let n=e.pow(r,t);if(!e.eql(e.sqr(n),r))throw Error("Cannot find square root");return n}}let u=(t+o)/s;return function(e,i){if(e.pow(i,a)===e.neg(e.ONE))throw Error("Cannot find square root");let s=r,c=e.pow(e.mul(e.ONE,n),t),l=e.pow(i,u),d=e.pow(i,t);for(;!e.eql(d,e.ONE);){if(e.eql(d,e.ZERO))return e.ZERO;let t=1;for(let r=e.sqr(d);t<s&&!e.eql(r,e.ONE);t++)r=e.sqr(r);let r=e.pow(c,o<<BigInt(s-t-1));c=e.sqr(r),l=e.mul(l,r),d=e.mul(d,c),s=t}return l}}function g(e){if(e%c===a){let t=(e+o)/c;return function(e,r){let n=e.pow(r,t);if(!e.eql(e.sqr(n),r))throw Error("Cannot find square root");return n}}if(e%l===u){let t=(e-u)/l;return function(e,r){let n=e.mul(r,s),i=e.pow(n,t),o=e.mul(r,i),a=e.mul(e.mul(o,s),i),c=e.mul(o,e.sub(a,e.ONE));if(!e.eql(e.sqr(c),r))throw Error("Cannot find square root");return c}}return y(e)}BigInt(9),BigInt(16),t.mod=d,t.pow=f,t.pow2=h,t.invert=p,t.tonelliShanks=y,t.FpSqrt=g;let m=(e,t)=>(d(e,t)&o)===o;t.isNegativeLE=m;let b=["create","isValid","is0","neg","inv","sqrt","sqr","eql","add","sub","mul","pow","div","addN","subN","mulN","sqrN"];function v(e){let t={ORDER:"bigint",MASK:"bigint",BYTES:"isSafeInteger",BITS:"isSafeInteger"},r=b.reduce((e,t)=>(e[t]="function",e),t);return(0,n.validateObject)(e,r)}function w(e,t,r){if(r<i)throw Error("Expected power > 0");if(r===i)return e.ONE;if(r===o)return t;let n=e.ONE,s=t;for(;r>i;)r&o&&(n=e.mul(n,s)),s=e.sqr(s),r>>=o;return n}function _(e,t){let r=Array(t.length),n=t.reduce((t,n,i)=>e.is0(n)?t:(r[i]=t,e.mul(t,n)),e.ONE),i=e.inv(n);return t.reduceRight((t,n,i)=>e.is0(n)?t:(r[i]=e.mul(t,r[i]),e.mul(t,n)),i),r}function E(e,t,r){return e.mul(t,"bigint"==typeof r?p(r,e.ORDER):e.inv(r))}function S(e){let t=(e.ORDER-o)/s;return r=>{let n=e.pow(r,t);return e.eql(n,e.ZERO)||e.eql(n,e.ONE)}}function x(e,t){let r=void 0!==t?t:e.toString(2).length,n=Math.ceil(r/8);return{nBitLength:r,nByteLength:n}}function A(e,t,r=!1,s={}){if(e<=i)throw Error(`Expected Field ORDER > 0, got ${e}`);let{nBitLength:a,nByteLength:c}=x(e,t);if(c>2048)throw Error("Field lengths over 2048 bytes are not supported");let u=g(e),l=Object.freeze({ORDER:e,BITS:a,BYTES:c,MASK:(0,n.bitMask)(a),ZERO:i,ONE:o,create:t=>d(t,e),isValid:t=>{if("bigint"!=typeof t)throw Error(`Invalid field element: expected bigint, got ${typeof t}`);return i<=t&&t<e},is0:e=>e===i,isOdd:e=>(e&o)===o,neg:t=>d(-t,e),eql:(e,t)=>e===t,sqr:t=>d(t*t,e),add:(t,r)=>d(t+r,e),sub:(t,r)=>d(t-r,e),mul:(t,r)=>d(t*r,e),pow:(e,t)=>w(l,e,t),div:(t,r)=>d(t*p(r,e),e),sqrN:e=>e*e,addN:(e,t)=>e+t,subN:(e,t)=>e-t,mulN:(e,t)=>e*t,inv:t=>p(t,e),sqrt:s.sqrt||(e=>u(l,e)),invertBatch:e=>_(l,e),cmov:(e,t,r)=>r?t:e,toBytes:e=>r?(0,n.numberToBytesLE)(e,c):(0,n.numberToBytesBE)(e,c),fromBytes:e=>{if(e.length!==c)throw Error(`Fp.fromBytes: expected ${c}, got ${e.length}`);return r?(0,n.bytesToNumberLE)(e):(0,n.bytesToNumberBE)(e)}});return Object.freeze(l)}function I(e,t){if(!e.isOdd)throw Error("Field doesn't have isOdd");let r=e.sqrt(t);return e.isOdd(r)?r:e.neg(r)}function O(e,t){if(!e.isOdd)throw Error("Field doesn't have isOdd");let r=e.sqrt(t);return e.isOdd(r)?e.neg(r):r}function T(e,t,r=!1){let i=(e=(0,n.ensureBytes)("privateHash",e)).length,s=x(t).nByteLength+8;if(s<24||i<s||i>1024)throw Error(`hashToPrivateScalar: expected ${s}-1024 bytes of input, got ${i}`);return d(r?(0,n.bytesToNumberLE)(e):(0,n.bytesToNumberBE)(e),t-o)+o}function P(e){if("bigint"!=typeof e)throw Error("field order must be bigint");return Math.ceil(e.toString(2).length/8)}function M(e){let t=P(e);return t+Math.ceil(t/2)}function N(e,t,r=!1){let i=e.length,s=P(t),a=M(t);if(i<16||i<a||i>1024)throw Error(`expected ${a}-1024 bytes of input, got ${i}`);let c=d(r?(0,n.bytesToNumberBE)(e):(0,n.bytesToNumberLE)(e),t-o)+o;return r?(0,n.numberToBytesLE)(c,s):(0,n.numberToBytesBE)(c,s)}t.validateField=v,t.FpPow=w,t.FpInvertBatch=_,t.FpDiv=E,t.FpIsSquare=S,t.nLength=x,t.Field=A,t.FpSqrtOdd=I,t.FpSqrtEven=O,t.hashToPrivateScalar=T,t.getFieldBytesLength=P,t.getMinHashLength=M,t.mapHashToField=N},15975:(e,t,r)=>{"use strict";
31Object.defineProperty(t,"__esModule",{value:!0}),t.montgomery=void 0;let n=r(17046),i=r(49997),o=BigInt(0),s=BigInt(1);function a(e){return(0,i.validateObject)(e,{a:"bigint"},{montgomeryBits:"isSafeInteger",nByteLength:"isSafeInteger",adjustScalarBytes:"function",domain:"function",powPminus2:"function",Gu:"bigint"}),Object.freeze({...e})}function c(e){let t=a(e),{P:r}=t,c=e=>(0,n.mod)(e,r),u=t.montgomeryBits,l=Math.ceil(u/8),d=t.nByteLength,f=t.adjustScalarBytes||(e=>e),h=t.powPminus2||(e=>(0,n.pow)(e,r-BigInt(2),r));function p(e,t,r){let n=c(e*(t-r));return[t=c(t-n),r=c(r+n)]}function y(e){if("bigint"==typeof e&&o<=e&&e<r)return e;throw Error("Expected valid scalar 0 < scalar < CURVE.P")}let g=(t.a-BigInt(2))/BigInt(4);function m(e,t){let r;let n=y(e),i=y(t),a=n,l=s,d=o,f=n,m=s,b=o;for(let e=BigInt(u-1);e>=o;e--){let t=i>>e&s;b^=t,l=(r=p(b,l,f))[0],f=r[1],d=(r=p(b,d,m))[0],m=r[1],b=t;let n=l+d,o=c(n*n),u=l-d,h=c(u*u),y=o-h,v=f+m,w=c((f-m)*n),_=c(v*u),E=w+_,S=w-_;f=c(E*E),m=c(a*c(S*S)),l=c(o*h),d=c(y*(o+c(g*y)))}return l=(r=p(b,l,f))[0],f=r[1],d=(r=p(b,d,m))[0],m=r[1],c(l*h(d))}function b(e){return(0,i.numberToBytesLE)(c(e),l)}function v(e){let t=(0,i.ensureBytes)("u coordinate",e,l);return d===l&&(t[d-1]&=127),(0,i.bytesToNumberLE)(t)}function w(e){let t=(0,i.ensureBytes)("scalar",e);if(t.length!==l&&t.length!==d)throw Error(`Expected ${l} or ${d} bytes, got ${t.length}`);return(0,i.bytesToNumberLE)(f(t))}function _(e,t){let r=m(v(t),w(e));if(r===o)throw Error("Invalid private or public key received");return b(r)}let E=b(t.Gu);function S(e){return _(e,E)}return{scalarMult:_,scalarMultBase:S,getSharedSecret:(e,t)=>_(e,t),getPublicKey:e=>S(e),utils:{randomPrivateKey:()=>t.randomBytes(t.nByteLength)},GuBytes:E}}t.montgomery=c},49997:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.validateObject=t.createHmacDrbg=t.bitMask=t.bitSet=t.bitGet=t.bitLen=t.utf8ToBytes=t.equalBytes=t.concatBytes=t.ensureBytes=t.numberToVarBytesBE=t.numberToBytesLE=t.numberToBytesBE=t.bytesToNumberLE=t.bytesToNumberBE=t.hexToBytes=t.hexToNumber=t.numberToHexUnpadded=t.bytesToHex=void 0;let r=BigInt(0),n=BigInt(1),i=BigInt(2),o=e=>e instanceof Uint8Array,s=Array.from({length:256},(e,t)=>t.toString(16).padStart(2,"0"));function a(e){if(!o(e))throw Error("Uint8Array expected");let t="";for(let r=0;r<e.length;r++)t+=s[e[r]];return t}function c(e){let t=e.toString(16);return 1&t.length?`0${t}`:t}function u(e){if("string"!=typeof e)throw Error("hex string expected, got "+typeof e);return BigInt(""===e?"0":`0x${e}`)}function l(e){if("string"!=typeof e)throw Error("hex string expected, got "+typeof e);let t=e.length;if(t%2)throw Error("padded hex string expected, got unpadded hex of length "+t);let r=new Uint8Array(t/2);for(let t=0;t<r.length;t++){let n=2*t,i=Number.parseInt(e.slice(n,n+2),16);if(Number.isNaN(i)||i<0)throw Error("Invalid byte sequence");r[t]=i}return r}function d(e){return u(a(e))}function f(e){if(!o(e))throw Error("Uint8Array expected");return u(a(Uint8Array.from(e).reverse()))}function h(e,t){return l(e.toString(16).padStart(2*t,"0"))}function p(e,t){return h(e,t).reverse()}function y(e){return l(c(e))}function g(e,t,r){let n;if("string"==typeof t)try{n=l(t)}catch(r){throw Error(`${e} must be valid hex string, got "${t}". Cause: ${r}`)}else if(o(t))n=Uint8Array.from(t);else throw Error(`${e} must be hex string or Uint8Array`);let i=n.length;if("number"==typeof r&&i!==r)throw Error(`${e} expected ${r} bytes, got ${i}`);return n}function m(...e){let t=new Uint8Array(e.reduce((e,t)=>e+t.length,0)),r=0;return e.forEach(e=>{if(!o(e))throw Error("Uint8Array expected");t.set(e,r),r+=e.length}),t}function b(e,t){if(e.length!==t.length)return!1;for(let r=0;r<e.length;r++)if(e[r]!==t[r])return!1;return!0}function v(e){if("string"!=typeof e)throw Error(`utf8ToBytes expected string, got ${typeof e}`);return new Uint8Array(new TextEncoder().encode(e))}function w(e){let t;for(t=0;e>r;e>>=n,t+=1);return t}function _(e,t){return e>>BigInt(t)&n}t.bytesToHex=a,t.numberToHexUnpadded=c,t.hexToNumber=u,t.hexToBytes=l,t.bytesToNumberBE=d,t.bytesToNumberLE=f,t.numberToBytesBE=h,t.numberToBytesLE=p,t.numberToVarBytesBE=y,t.ensureBytes=g,t.concatBytes=m,t.equalBytes=b,t.utf8ToBytes=v,t.bitLen=w,t.bitGet=_;let E=(e,t,i)=>e|(i?n:r)<<BigInt(t);t.bitSet=E;let S=e=>(i<<BigInt(e-1))-n;t.bitMask=S;let x=e=>new Uint8Array(e),A=e=>Uint8Array.from(e);function I(e,t,r){if("number"!=typeof e||e<2)throw Error("hashLen must be a number");if("number"!=typeof t||t<2)throw Error("qByteLen must be a number");if("function"!=typeof r)throw Error("hmacFn must be a function");let n=x(e),i=x(e),o=0,s=()=>{n.fill(1),i.fill(0),o=0},a=(...e)=>r(i,n,...e),c=(e=x())=>{i=a(A([0]),e),n=a(),0!==e.length&&(i=a(A([1]),e),n=a())},u=()=>{if(o++>=1e3)throw Error("drbg: tried 1000 values");let e=0,r=[];for(;e<t;){let t=(n=a()).slice();r.push(t),e+=n.length}return m(...r)};return(e,t)=>{let r;for(s(),c(e);!(r=t(u()));)c();return s(),r}}t.createHmacDrbg=I;let O={bigint:e=>"bigint"==typeof e,function:e=>"function"==typeof e,boolean:e=>"boolean"==typeof e,string:e=>"string"==typeof e,stringOrUint8Array:e=>"string"==typeof e||e instanceof Uint8Array,isSafeInteger:e=>Number.isSafeInteger(e),array:e=>Array.isArray(e),field:(e,t)=>t.Fp.isValid(e),hash:e=>"function"==typeof e&&Number.isSafeInteger(e.outputLen)};function T(e,t,r={}){let n=(t,r,n)=>{let i=O[r];if("function"!=typeof i)throw Error(`Invalid validator "${r}", expected function`);let o=e[t];if((!n||void 0!==o)&&!i(o,e))throw Error(`Invalid param ${String(t)}=${o} (${typeof o}), expected ${r}`)};for(let[e,r]of Object.entries(t))n(e,r,!1);for(let[e,t]of Object.entries(r))n(e,t,!0);return e}t.validateObject=T},58610:(e,t,r)=>{"use strict";
31Object.defineProperty(t,"__esModule",{value:!0}),t.hash_to_ristretto255=t.hashToRistretto255=t.RistrettoPoint=t.encodeToCurve=t.hashToCurve=t.edwardsToMontgomeryPriv=t.edwardsToMontgomery=t.edwardsToMontgomeryPub=t.x25519=t.ed25519ph=t.ed25519ctx=t.ed25519=t.ED25519_TORSION_SUBGROUP=void 0;let n=r(12204),i=r(90651),o=r(24352),s=r(15975),a=r(17046),c=r(49997),u=r(66016),l=BigInt("57896044618658097711785492504343953926634992332820282019728792003956564819949"),d=BigInt("19681161376707505956807079304988542015446066515923890162744021073123829784752"),f=BigInt(0),h=BigInt(1),p=BigInt(2),y=BigInt(5),g=BigInt(10),m=BigInt(20),b=BigInt(40),v=BigInt(80);function w(e){let t=l,r=e*e%t*e%t,n=(0,a.pow2)(r,p,t)*r%t,i=(0,a.pow2)(n,h,t)*e%t,o=(0,a.pow2)(i,y,t)*i%t,s=(0,a.pow2)(o,g,t)*o%t,c=(0,a.pow2)(s,m,t)*s%t,u=(0,a.pow2)(c,b,t)*c%t,d=(0,a.pow2)(u,v,t)*u%t,f=(0,a.pow2)(d,v,t)*u%t,w=(0,a.pow2)(f,g,t)*o%t;return{pow_p_5_8:(0,a.pow2)(w,p,t)*e%t,b2:r}}function _(e){return e[0]&=248,e[31]&=127,e[31]|=64,e}function E(e,t){let r=l,n=(0,a.mod)(t*t*t,r),i=w(e*(0,a.mod)(n*n*t,r)).pow_p_5_8,o=(0,a.mod)(e*n*i,r),s=(0,a.mod)(t*o*o,r),c=o,u=(0,a.mod)(o*d,r),f=s===e,h=s===(0,a.mod)(-e,r),p=s===(0,a.mod)(-e*d,r);return f&&(o=c),(h||p)&&(o=u),(0,a.isNegativeLE)(o,r)&&(o=(0,a.mod)(-o,r)),{isValid:f||h,value:o}}t.ED25519_TORSION_SUBGROUP=["0100000000000000000000000000000000000000000000000000000000000000","c7176a703d4dd84fba3c0b760d10670f2a2053fa2c39ccc64ec7fd7792ac037a","0000000000000000000000000000000000000000000000000000000000000080","26e8958fc2b227b045c3f489f2ef98f0d5dfac05d3c63339b13802886d53fc05","ecffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff7f","26e8958fc2b227b045c3f489f2ef98f0d5dfac05d3c63339b13802886d53fc85","0000000000000000000000000000000000000000000000000000000000000000","c7176a703d4dd84fba3c0b760d10670f2a2053fa2c39ccc64ec7fd7792ac03fa"];let S=(0,a.Field)(l,void 0,!0),x={a:BigInt(-1),d:BigInt("37095705934669439343138083508754565189542113879843219016388785533085940283555"),Fp:S,n:BigInt("7237005577332262213973186563042994240857116359379907606001950938285454250989"),h:BigInt(8),Gx:BigInt("15112221349535400772501151409588531511454012693041857206046113283949847762202"),Gy:BigInt("46316835694926478169428394003475163141307993866256225615783033603165251855960"),hash:n.sha512,randomBytes:i.randomBytes,adjustScalarBytes:_,uvRatio:E};function A(e,t,r){if(t.length>255)throw Error("Context is too big");return(0,i.concatBytes)((0,i.utf8ToBytes)("SigEd25519 no Ed25519 collisions"),new Uint8Array([r?1:0,t.length]),t,e)}function I(e){let{y:r}=t.ed25519.ExtendedPoint.fromHex(e),n=BigInt(1);return S.toBytes(S.create((n+r)*S.inv(n-r)))}function O(e){let t=x.hash(e.subarray(0,32));return x.adjustScalarBytes(t).subarray(0,32)}t.ed25519=(0,o.twistedEdwards)(x),t.ed25519ctx=(0,o.twistedEdwards)({...x,domain:A}),t.ed25519ph=(0,o.twistedEdwards)({...x,domain:A,prehash:n.sha512}),t.x25519=(0,s.montgomery)({P:l,a:BigInt(486662),montgomeryBits:255,nByteLength:32,Gu:BigInt(9),powPminus2:e=>{let t=l,{pow_p_5_8:r,b2:n}=w(e);return(0,a.mod)((0,a.pow2)(r,BigInt(3),t)*n,t)},adjustScalarBytes:_,randomBytes:i.randomBytes}),t.edwardsToMontgomeryPub=I,t.edwardsToMontgomery=I,t.edwardsToMontgomeryPriv=O;let T=(S.ORDER+BigInt(3))/BigInt(8),P=S.pow(p,T),M=S.sqrt(S.neg(S.ONE)),N=(S.ORDER-BigInt(5))/BigInt(8),k=BigInt(486662);function C(e){let t=S.sqr(e);t=S.mul(t,p);let r=S.add(t,S.ONE),n=S.neg(k),i=S.sqr(r),o=S.mul(i,r),s=S.mul(t,k);s=S.mul(s,n),s=S.add(s,i),s=S.mul(s,n);let a=S.sqr(o);i=S.sqr(a),a=S.mul(a,o),a=S.mul(a,s),i=S.mul(i,a);let c=S.pow(i,N);c=S.mul(c,a);let u=S.mul(c,M);i=S.sqr(c),i=S.mul(i,o);let l=S.eql(i,s),d=S.cmov(u,c,l),f=S.mul(n,t),y=S.mul(c,e);y=S.mul(y,P);let g=S.mul(y,M),m=S.mul(s,t);i=S.sqr(y),i=S.mul(i,o);let b=S.eql(i,m),v=S.cmov(g,y,b);i=S.sqr(d),i=S.mul(i,o);let w=S.eql(i,s),_=S.cmov(f,n,w),E=S.cmov(v,d,w),x=S.isOdd(E);return{xMn:_,xMd:r,yMn:E=S.cmov(E,S.neg(E),w!==x),yMd:h}}let D=(0,a.FpSqrtEven)(S,S.neg(BigInt(486664)));function j(e){let{xMn:t,xMd:r,yMn:n,yMd:i}=C(e),o=S.mul(t,i);o=S.mul(o,D);let s=S.mul(r,n),a=S.sub(t,r),c=S.add(t,r),u=S.mul(s,c),l=S.eql(u,S.ZERO);o=S.cmov(o,S.ZERO,l),s=S.cmov(s,S.ONE,l),a=S.cmov(a,S.ONE,l),c=S.cmov(c,S.ONE,l);let d=S.invertBatch([s,c]);return{x:S.mul(o,d[0]),y:S.mul(a,d[1])}}let R=(0,u.createHasher)(t.ed25519.ExtendedPoint,e=>j(e[0]),{DST:"edwards25519_XMD:SHA-512_ELL2_RO_",encodeDST:"edwards25519_XMD:SHA-512_ELL2_NU_",p:S.ORDER,m:1,k:128,expand:"xmd",hash:n.sha512});function L(e){if(!(e instanceof G))throw Error("RistrettoPoint expected")}t.hashToCurve=R.hashToCurve,t.encodeToCurve=R.encodeToCurve;let B=d,U=BigInt("25063068953384623474111414158702152701244531502492656460079210482610430750235"),$=BigInt("54469307008909316920995813868745141605393597292927456921205312896311721017578"),K=BigInt("1159843021668779879193775521855586647937357759715417654439879720876111806838"),F=BigInt("40440834346308536858101042469323190826248399146238708352240133220865137265952"),z=e=>E(h,e),q=BigInt("0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff"),V=e=>t.ed25519.CURVE.Fp.create((0,c.bytesToNumberLE)(e)&q);function H(e){let{d:r}=t.ed25519.CURVE,n=t.ed25519.CURVE.Fp.ORDER,i=t.ed25519.CURVE.Fp.create,o=i(B*e*e),s=i((o+h)*K),c=BigInt(-1),u=i((c-r*o)*i(o+r)),{isValid:l,value:d}=E(s,u),f=i(d*e);(0,a.isNegativeLE)(f,n)||(f=i(-f)),l||(d=f),l||(c=o);
31let p=i(c*(o-h)*F-u),y=d*d,g=i((d+d)*u),m=i(p*U),b=i(h-y),v=i(h+y);return new t.ed25519.ExtendedPoint(i(g*v),i(b*m),i(m*v),i(g*b))}class G{constructor(e){this.ep=e}static fromAffine(e){return new G(t.ed25519.ExtendedPoint.fromAffine(e))}static hashToCurve(e){let t=H(V((e=(0,c.ensureBytes)("ristrettoHash",e,64)).slice(0,32))),r=H(V(e.slice(32,64)));return new G(t.add(r))}static fromHex(e){e=(0,c.ensureBytes)("ristrettoHex",e,32);let{a:r,d:n}=t.ed25519.CURVE,i=t.ed25519.CURVE.Fp.ORDER,o=t.ed25519.CURVE.Fp.create,s="RistrettoPoint.fromHex: the hex is not valid encoding of RistrettoPoint",u=V(e);if(!(0,c.equalBytes)((0,c.numberToBytesLE)(u,32),e)||(0,a.isNegativeLE)(u,i))throw Error(s);let l=o(u*u),d=o(h+r*l),p=o(h-r*l),y=o(d*d),g=o(p*p),m=o(r*n*y-g),{isValid:b,value:v}=z(o(m*g)),w=o(v*p),_=o(v*w*m),E=o((u+u)*w);(0,a.isNegativeLE)(E,i)&&(E=o(-E));let S=o(d*_),x=o(E*S);if(!b||(0,a.isNegativeLE)(x,i)||S===f)throw Error(s);return new G(new t.ed25519.ExtendedPoint(E,S,h,x))}toRawBytes(){let e,{ex:r,ey:n,ez:i,et:o}=this.ep,s=t.ed25519.CURVE.Fp.ORDER,u=t.ed25519.CURVE.Fp.create,l=u(u(i+n)*u(i-n)),d=u(r*n),f=u(d*d),{value:h}=z(u(l*f)),p=u(h*l),y=u(h*d),g=u(p*y*o);if((0,a.isNegativeLE)(o*g,s)){let t=u(n*B),i=u(r*B);r=t,n=i,e=u(p*$)}else e=y;(0,a.isNegativeLE)(r*g,s)&&(n=u(-n));let m=u((i-n)*e);return(0,a.isNegativeLE)(m,s)&&(m=u(-m)),(0,c.numberToBytesLE)(m,32)}toHex(){return(0,c.bytesToHex)(this.toRawBytes())}toString(){return this.toHex()}equals(e){L(e);let{ex:r,ey:n}=this.ep,{ex:i,ey:o}=e.ep,s=t.ed25519.CURVE.Fp.create,a=s(r*o)===s(n*i),c=s(n*o)===s(r*i);return a||c}add(e){return L(e),new G(this.ep.add(e.ep))}subtract(e){return L(e),new G(this.ep.subtract(e.ep))}multiply(e){return new G(this.ep.multiply(e))}multiplyUnsafe(e){return new G(this.ep.multiplyUnsafe(e))}}t.RistrettoPoint=(G.BASE||(G.BASE=new G(t.ed25519.ExtendedPoint.BASE)),G.ZERO||(G.ZERO=new G(t.ed25519.ExtendedPoint.ZERO)),G);let W=(e,t)=>{let r=t.DST,o="string"==typeof r?(0,i.utf8ToBytes)(r):r,s=(0,u.expand_message_xmd)(e,o,64,n.sha512);return G.hashToCurve(s)};t.hashToRistretto255=W,t.hash_to_ristretto255=t.hashToRistretto255},43381:(e,t)=>{"use strict";function r(e){if(!Number.isSafeInteger(e)||e<0)throw Error(`Wrong positive integer: ${e}`)}function n(e){if("boolean"!=typeof e)throw Error(`Expected boolean, not ${e}`)}function i(e,...t){if(!(e instanceof Uint8Array))throw Error("Expected Uint8Array");if(t.length>0&&!t.includes(e.length))throw Error(`Expected Uint8Array of length ${t}, not of length=${e.length}`)}function o(e){if("function"!=typeof e||"function"!=typeof e.create)throw Error("Hash should be wrapped by utils.wrapConstructor");r(e.outputLen),r(e.blockLen)}function s(e,t=!0){if(e.destroyed)throw Error("Hash instance has been destroyed");if(t&&e.finished)throw Error("Hash#digest() has already been called")}function a(e,t){i(e);let r=t.outputLen;if(e.length<r)throw Error(`digestInto() expects output buffer of length at least ${r}`)}Object.defineProperty(t,"__esModule",{value:!0}),t.output=t.exists=t.hash=t.bytes=t.bool=t.number=void 0,t.number=r,t.bool=n,t.bytes=i,t.hash=o,t.exists=s,t.output=a;let c={number:r,bool:n,bytes:i,hash:o,exists:s,output:a};t.default=c},97539:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.SHA2=void 0;let n=r(43381),i=r(90651);function o(e,t,r,n){if("function"==typeof e.setBigUint64)return e.setBigUint64(t,r,n);let i=BigInt(32),o=BigInt(0xffffffff),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)}class s extends i.Hash{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=(0,i.createView)(this.buffer)}update(e){(0,n.exists)(this);let{view:t,buffer:r,blockLen:o}=this,s=(e=(0,i.toBytes)(e)).length;for(let n=0;n<s;){let a=Math.min(o-this.pos,s-n);if(a===o){let t=(0,i.createView)(e);for(;o<=s-n;n+=o)this.process(t,n);continue}r.set(e.subarray(n,n+a),this.pos),this.pos+=a,n+=a,this.pos===o&&(this.process(t,0),this.pos=0)}return this.length+=e.length,this.roundClean(),this}digestInto(e){(0,n.exists)(this),(0,n.output)(e,this),this.finished=!0;let{buffer:t,view:r,blockLen:s,isLE:a}=this,{pos:c}=this;t[c++]=128,this.buffer.subarray(c).fill(0),this.padOffset>s-c&&(this.process(r,0),c=0);for(let e=c;e<s;e++)t[e]=0;o(r,s-8,BigInt(8*this.length),a),this.process(r,0);let u=(0,i.createView)(e),l=this.outputLen;if(l%4)throw Error("_sha2: outputLen should be aligned to 32bit");let d=l/4,f=this.get();if(d>f.length)throw Error("_sha2: outputLen bigger than state");for(let e=0;e<d;e++)u.setUint32(4*e,f[e],a)}digest(){let{buffer:e,outputLen:t}=this;this.digestInto(e);let r=e.slice(0,t);return this.destroy(),r}_cloneInto(e){e||(e=new this.constructor),e.set(...this.get());let{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}}t.SHA2=s},73704:(e,t)=>
31{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.add5L=t.add5H=t.add4H=t.add4L=t.add3H=t.add3L=t.add=t.rotlBL=t.rotlBH=t.rotlSL=t.rotlSH=t.rotr32L=t.rotr32H=t.rotrBL=t.rotrBH=t.rotrSL=t.rotrSH=t.shrSL=t.shrSH=t.toBig=t.split=t.fromBig=void 0;let r=BigInt(0x100000000-1),n=BigInt(32);function i(e,t=!1){return t?{h:Number(e&r),l:Number(e>>n&r)}:{h:0|Number(e>>n&r),l:0|Number(e&r)}}function o(e,t=!1){let r=new Uint32Array(e.length),n=new Uint32Array(e.length);for(let o=0;o<e.length;o++){let{h:s,l:a}=i(e[o],t);[r[o],n[o]]=[s,a]}return[r,n]}t.fromBig=i,t.split=o;let s=(e,t)=>BigInt(e>>>0)<<n|BigInt(t>>>0);t.toBig=s;let a=(e,t,r)=>e>>>r;t.shrSH=a;let c=(e,t,r)=>e<<32-r|t>>>r;t.shrSL=c;let u=(e,t,r)=>e>>>r|t<<32-r;t.rotrSH=u;let l=(e,t,r)=>e<<32-r|t>>>r;t.rotrSL=l;let d=(e,t,r)=>e<<64-r|t>>>r-32;t.rotrBH=d;let f=(e,t,r)=>e>>>r-32|t<<64-r;t.rotrBL=f;let h=(e,t)=>t;t.rotr32H=h;let p=(e,t)=>e;t.rotr32L=p;let y=(e,t,r)=>e<<r|t>>>32-r;t.rotlSH=y;let g=(e,t,r)=>t<<r|e>>>32-r;t.rotlSL=g;let m=(e,t,r)=>t<<r-32|e>>>64-r;t.rotlBH=m;let b=(e,t,r)=>e<<r-32|t>>>64-r;function v(e,t,r,n){let i=(t>>>0)+(n>>>0);return{h:e+r+(i/0x100000000|0)|0,l:0|i}}t.rotlBL=b,t.add=v;let w=(e,t,r)=>(e>>>0)+(t>>>0)+(r>>>0);t.add3L=w;let _=(e,t,r,n)=>t+r+n+(e/0x100000000|0)|0;t.add3H=_;let E=(e,t,r,n)=>(e>>>0)+(t>>>0)+(r>>>0)+(n>>>0);t.add4L=E;let S=(e,t,r,n,i)=>t+r+n+i+(e/0x100000000|0)|0;t.add4H=S;let x=(e,t,r,n,i)=>(e>>>0)+(t>>>0)+(r>>>0)+(n>>>0)+(i>>>0);t.add5L=x;let A=(e,t,r,n,i,o)=>t+r+n+i+o+(e/0x100000000|0)|0;t.add5H=A;let I={fromBig:i,split:o,toBig:s,shrSH:a,shrSL:c,rotrSH:u,rotrSL:l,rotrBH:d,rotrBL:f,rotr32H:h,rotr32L:p,rotlSH:y,rotlSL:g,rotlBH:m,rotlBL:b,add:v,add3L:w,add3H:_,add4L:E,add4H:S,add5H:A,add5L:x};t.default=I},13495:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.crypto=void 0,t.crypto="object"==typeof globalThis&&"crypto"in globalThis?globalThis.crypto:void 0},12204:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.sha384=t.sha512_256=t.sha512_224=t.sha512=t.SHA512=void 0;let n=r(97539),i=r(73704),o=r(90651),[s,a]=i.default.split(["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","0xf40e3585
315771202a","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))),c=new Uint32Array(80),u=new Uint32Array(80);class l extends n.SHA2{constructor(){super(128,64,16,!1),this.Ah=0x6a09e667,this.Al=-0xc4336f8,this.Bh=-0x4498517b,this.Bl=-0x7b3558c5,this.Ch=0x3c6ef372,this.Cl=-0x16b07d5,this.Dh=-0x5ab00ac6,this.Dl=0x5f1d36f1,this.Eh=0x510e527f,this.El=-0x52197d2f,this.Fh=-0x64fa9774,this.Fl=0x2b3e6c1f,this.Gh=0x1f83d9ab,this.Gl=-0x4be4295,this.Hh=0x5be0cd19,this.Hl=0x137e2179}get(){let{Ah:e,Al:t,Bh:r,Bl:n,Ch:i,Cl:o,Dh:s,Dl:a,Eh:c,El:u,Fh:l,Fl:d,Gh:f,Gl:h,Hh:p,Hl:y}=this;return[e,t,r,n,i,o,s,a,c,u,l,d,f,h,p,y]}set(e,t,r,n,i,o,s,a,c,u,l,d,f,h,p,y){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|d,this.Gh=0|f,this.Gl=0|h,this.Hh=0|p,this.Hl=0|y}process(e,t){for(let r=0;r<16;r++,t+=4)c[r]=e.getUint32(t),u[r]=e.getUint32(t+=4);for(let e=16;e<80;e++){let t=0|c[e-15],r=0|u[e-15],n=i.default.rotrSH(t,r,1)^i.default.rotrSH(t,r,8)^i.default.shrSH(t,r,7),o=i.default.rotrSL(t,r,1)^i.default.rotrSL(t,r,8)^i.default.shrSL(t,r,7),s=0|c[e-2],a=0|u[e-2],l=i.default.rotrSH(s,a,19)^i.default.rotrBH(s,a,61)^i.default.shrSH(s,a,6),d=i.default.rotrSL(s,a,19)^i.default.rotrBL(s,a,61)^i.default.shrSL(s,a,6),f=i.default.add4L(o,d,u[e-7],u[e-16]),h=i.default.add4H(f,n,l,c[e-7],c[e-16]);c[e]=0|h,u[e]=0|f}let{Ah:r,Al:n,Bh:o,Bl:l,Ch:d,Cl:f,Dh:h,Dl:p,Eh:y,El:g,Fh:m,Fl:b,Gh:v,Gl:w,Hh:_,Hl:E}=this;for(let e=0;e<80;e++){let t=i.default.rotrSH(y,g,14)^i.default.rotrSH(y,g,18)^i.default.rotrBH(y,g,41),S=i.default.rotrSL(y,g,14)^i.default.rotrSL(y,g,18)^i.default.rotrBL(y,g,41),x=y&m^~y&v,A=g&b^~g&w,I=i.default.add5L(E,S,A,a[e],u[e]),O=i.default.add5H(I,_,t,x,s[e],c[e]),T=0|I,P=i.default.rotrSH(r,n,28)^i.default.rotrBH(r,n,34)^i.default.rotrBH(r,n,39),M=i.default.rotrSL(r,n,28)^i.default.rotrBL(r,n,34)^i.default.rotrBL(r,n,39),N=r&o^r&d^o&d,k=n&l^n&f^l&f;_=0|v,E=0|w,v=0|m,w=0|b,m=0|y,b=0|g,({h:y,l:g}=i.default.add(0|h,0|p,0|O,0|T)),h=0|d,p=0|f,d=0|o,f=0|l,o=0|r,l=0|n;let C=i.default.add3L(T,M,k);r=i.default.add3H(C,O,P,N),n=0|C}({h:r,l:n}=i.default.add(0|this.Ah,0|this.Al,0|r,0|n)),({h:o,l:l}=i.default.add(0|this.Bh,0|this.Bl,0|o,0|l)),({h:d,l:f}=i.default.add(0|this.Ch,0|this.Cl,0|d,0|f)),({h:h,l:p}=i.default.add(0|this.Dh,0|this.Dl,0|h,0|p)),({h:y,l:g}=i.default.add(0|this.Eh,0|this.El,0|y,0|g)),({h:m,l:b}=i.default.add(0|this.Fh,0|this.Fl,0|m,0|b)),({h:v,l:w}=i.default.add(0|this.Gh,0|this.Gl,0|v,0|w)),({h:_,l:E}=i.default.add(0|this.Hh,0|this.Hl,0|_,0|E)),this.set(r,n,o,l,d,f,h,p,y,g,m,b,v,w,_,E)}roundClean(){c.fill(0),u.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)}}t.SHA512=l;class d extends l{constructor(){super(),this.Ah=-0x73c2c838,this.Al=0x19544da2,this.Bh=0x73e19966,this.Bl=-0x76232b2a,this.Ch=0x1dfab7ae,this.Cl=0x32ff9c82,this.Dh=0x679dd514,this.Dl=0x582f9fcf,this.Eh=0xf6d2b69,this.El=0x7bd44da8,this.Fh=0x77e36f73,this.Fl=0x4c48942,this.Gh=0x3f9d85a8,this.Gl=0x6a1d36c8,this.Hh=0x1112e6ad,this.Hl=-0x6e296d5f,this.outputLen=28}}class f extends l{constructor(){super(),this.Ah=0x22312194,this.Al=-0x3d408d4,this.Bh=-0x60aaa05d,this.Bl=-0x37b39b3e,this.Ch=0x2393b86b,this.Cl=0x6f53b151,this.Dh=-0x69c788e7,this.Dl=0x5940eabd,this.Eh=-0x69d7c11e,this.El=-0x5771001d,this.Fh=-0x41a1e1db,this.Fl=0x53863992,this.Gh=0x2b0199fc,this.Gl=0x2c85b8aa,this.Hh=0xeb72ddc,this.Hl=-0x7e3ad35e,this.outputLen=32}}class h extends l{constructor(){super(),this.Ah=-0x344462a3,this.Al=-0x3efa6128,this.Bh=0x629a292a,this.Bl=0x367cd507,this.Ch=-0x6ea6fea6,this.Cl=0x3070dd17,this.Dh=0x152fecd8,this.Dl=-0x8f1a6c7,this.Eh=0x67332667,this.El=-4191439,this.Fh=-0x714bb579,this.Fl=0x68581511,this.Gh=-0x24f3d1f3,this.Gl=0x64f98fa7,this.Hh=0x47b5481d,this.Hl=-0x4105b05c,this.outputLen=48}}t.sha512=(0,o.wrapConstructor)(()=>new l),t.sha512_224=(0,o.wrapConstructor)(()=>new d),t.sha512_256=(0,o.wrapConstructor)(()=>new f),t.sha384=(0,o.wrapConstructor)(()=>new h)},90651:(e,t,r)=>{"use strict";
31Object.defineProperty(t,"__esModule",{value:!0}),t.randomBytes=t.wrapXOFConstructorWithOpts=t.wrapConstructorWithOpts=t.wrapConstructor=t.checkOpts=t.Hash=t.concatBytes=t.toBytes=t.utf8ToBytes=t.asyncLoop=t.nextTick=t.hexToBytes=t.bytesToHex=t.isLE=t.rotr=t.createView=t.u32=t.u8=void 0;let n=r(13495),i=e=>e instanceof Uint8Array,o=e=>new Uint8Array(e.buffer,e.byteOffset,e.byteLength);t.u8=o;let s=e=>new Uint32Array(e.buffer,e.byteOffset,Math.floor(e.byteLength/4));t.u32=s;let a=e=>new DataView(e.buffer,e.byteOffset,e.byteLength);t.createView=a;let c=(e,t)=>e<<32-t|e>>>t;if(t.rotr=c,t.isLE=68===new Uint8Array(new Uint32Array([0x11223344]).buffer)[0],!t.isLE)throw Error("Non little-endian hardware is not supported");let u=Array.from({length:256},(e,t)=>t.toString(16).padStart(2,"0"));function l(e){if(!i(e))throw Error("Uint8Array expected");let t="";for(let r=0;r<e.length;r++)t+=u[e[r]];return t}function d(e){if("string"!=typeof e)throw Error("hex string expected, got "+typeof e);let t=e.length;if(t%2)throw Error("padded hex string expected, got unpadded hex of length "+t);let r=new Uint8Array(t/2);for(let t=0;t<r.length;t++){let n=2*t,i=Number.parseInt(e.slice(n,n+2),16);if(Number.isNaN(i)||i<0)throw Error("Invalid byte sequence");r[t]=i}return r}t.bytesToHex=l,t.hexToBytes=d;let f=async()=>{};async function h(e,r,n){let i=Date.now();for(let o=0;o<e;o++){n(o);let e=Date.now()-i;e>=0&&e<r||(await (0,t.nextTick)(),i+=e)}}function p(e){if("string"!=typeof e)throw Error(`utf8ToBytes expected string, got ${typeof e}`);return new Uint8Array(new TextEncoder().encode(e))}function y(e){if("string"==typeof e&&(e=p(e)),!i(e))throw Error(`expected Uint8Array, got ${typeof e}`);return e}function g(...e){let t=new Uint8Array(e.reduce((e,t)=>e+t.length,0)),r=0;return e.forEach(e=>{if(!i(e))throw Error("Uint8Array expected");t.set(e,r),r+=e.length}),t}t.nextTick=f,t.asyncLoop=h,t.utf8ToBytes=p,t.toBytes=y,t.concatBytes=g;class m{clone(){return this._cloneInto()}}t.Hash=m;let b={}.toString;function v(e,t){if(void 0!==t&&"[object Object]"!==b.call(t))throw Error("Options should be object or undefined");return Object.assign(e,t)}function w(e){let t=t=>e().update(y(t)).digest(),r=e();return t.outputLen=r.outputLen,t.blockLen=r.blockLen,t.create=()=>e(),t}function _(e){let t=(t,r)=>e(r).update(y(t)).digest(),r=e({});return t.outputLen=r.outputLen,t.blockLen=r.blockLen,t.create=t=>e(t),t}function E(e){let t=(t,r)=>e(r).update(y(t)).digest(),r=e({});return t.outputLen=r.outputLen,t.blockLen=r.blockLen,t.create=t=>e(t),t}function S(e=32){if(n.crypto&&"function"==typeof n.crypto.getRandomValues)return n.crypto.getRandomValues(new Uint8Array(e));throw Error("crypto.getRandomValues must be defined")}t.checkOpts=v,t.wrapConstructor=w,t.wrapConstructorWithOpts=_,t.wrapXOFConstructorWithOpts=E,t.randomBytes=S},77060:(e,t)=>{"use strict";function r(e){if(!Number.isSafeInteger(e)||e<0)throw Error(`Wrong positive integer: ${e}`)}function n(e){if("boolean"!=typeof e)throw Error(`Expected boolean, not ${e}`)}function i(e){return e instanceof Uint8Array||null!=e&&"object"==typeof e&&"Uint8Array"===e.constructor.name}function o(e,...t){if(!i(e))throw Error("Expected Uint8Array");if(t.length>0&&!t.includes(e.length))throw Error(`Expected Uint8Array of length ${t}, not of length=${e.length}`)}function s(e){if("function"!=typeof e||"function"!=typeof e.create)throw Error("Hash should be wrapped by utils.wrapConstructor");r(e.outputLen),r(e.blockLen)}function a(e,t=!0){if(e.destroyed)throw Error("Hash instance has been destroyed");if(t&&e.finished)throw Error("Hash#digest() has already been called")}function c(e,t){o(e);let r=t.outputLen;if(e.length<r)throw Error(`digestInto() expects output buffer of length at least ${r}`)}Object.defineProperty(t,"__esModule",{value:!0}),t.output=t.exists=t.hash=t.bytes=t.bool=t.number=void 0,t.number=r,t.bool=n,t.bytes=o,t.hash=s,t.exists=a,t.output=c;let u={number:r,bool:n,bytes:o,hash:s,exists:a,output:c};t.default=u},73666:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.SHA2=void 0;let n=r(77060),i=r(198);function o(e,t,r,n){if("function"==typeof e.setBigUint64)return e.setBigUint64(t,r,n);let i=BigInt(32),o=BigInt(0xffffffff),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)}class s extends i.Hash{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=(0,i.createView)(this.buffer)}update(e){(0,n.exists)(this);let{view:t,buffer:r,blockLen:o}=this,s=(e=(0,i.toBytes)(e)).length;for(let n=0;n<s;){let a=Math.min(o-this.pos,s-n);if(a===o){let t=(0,i.createView)(e);for(;o<=s-n;n+=o)this.process(t,n);continue}r.set(e.subarray(n,n+a),this.pos),this.pos+=a,n+=a,this.pos===o&&(this.process(t,0),this.pos=0)}return this.length+=e.length,this.roundClean(),this}digestInto(e){(0,n.exists)(this),(0,n.output)(e,this),this.finished=!0;let{buffer:t,view:r,blockLen:s,isLE:a}=this,{pos:c}=this;t[c++]=128,this.buffer.subarray(c).fill(0),this.padOffset>s-c&&(this.process(r,0),c=0);for(let e=c;e<s;e++)t[e]=0;o(r,s-8,BigInt(8*this.length),a),this.process(r,0);let u=(0,i.createView)(e),l=this.outputLen;if(l%4)throw Error("_sha2: outputLen should be aligned to 32bit");let d=l/4,f=this.get();if(d>f.length)throw Error("_sha2: outputLen bigger than state");for(let e=0;e<d;e++)u.setUint32(4*e,f[e],a)}digest(){let{buffer:e,outputLen:t}=this;this.digestInto(e);let r=e.slice(0,t);return this.destroy(),r}_cloneInto(e){e||(e=new this.constructor),e.set(...this.get());let{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}}t.SHA2=s},6056:(e,t)=>{"use strict";
31Object.defineProperty(t,"__esModule",{value:!0}),t.crypto=void 0,t.crypto="object"==typeof globalThis&&"crypto"in globalThis?globalThis.crypto:void 0},62782:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.sha224=t.sha256=void 0;let n=r(73666),i=r(198),o=(e,t,r)=>e&t^~e&r,s=(e,t,r)=>e&t^e&r^t&r,a=new Uint32Array([0x428a2f98,0x71374491,0xb5c0fbcf,0xe9b5dba5,0x3956c25b,0x59f111f1,0x923f82a4,0xab1c5ed5,0xd807aa98,0x12835b01,0x243185be,0x550c7dc3,0x72be5d74,0x80deb1fe,0x9bdc06a7,0xc19bf174,0xe49b69c1,0xefbe4786,0xfc19dc6,0x240ca1cc,0x2de92c6f,0x4a7484aa,0x5cb0a9dc,0x76f988da,0x983e5152,0xa831c66d,0xb00327c8,0xbf597fc7,0xc6e00bf3,0xd5a79147,0x6ca6351,0x14292967,0x27b70a85,0x2e1b2138,0x4d2c6dfc,0x53380d13,0x650a7354,0x766a0abb,0x81c2c92e,0x92722c85,0xa2bfe8a1,0xa81a664b,0xc24b8b70,0xc76c51a3,0xd192e819,0xd6990624,0xf40e3585,0x106aa070,0x19a4c116,0x1e376c08,0x2748774c,0x34b0bcb5,0x391c0cb3,0x4ed8aa4a,0x5b9cca4f,0x682e6ff3,0x748f82ee,0x78a5636f,0x84c87814,0x8cc70208,0x90befffa,0xa4506ceb,0xbef9a3f7,0xc67178f2]),c=new Uint32Array([0x6a09e66
317,0xbb67ae85,0x3c6ef372,0xa54ff53a,0x510e527f,0x9b05688c,0x1f83d9ab,0x5be0cd19]),u=new Uint32Array(64);class l extends n.SHA2{constructor(){super(64,32,8,!1),this.A=0|c[0],this.B=0|c[1],this.C=0|c[2],this.D=0|c[3],this.E=0|c[4],this.F=0|c[5],this.G=0|c[6],this.H=0|c[7]}get(){let{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 r=0;r<16;r++,t+=4)u[r]=e.getUint32(t,!1);for(let e=16;e<64;e++){let t=u[e-15],r=u[e-2],n=(0,i.rotr)(t,7)^(0,i.rotr)(t,18)^t>>>3,o=(0,i.rotr)(r,17)^(0,i.rotr)(r,19)^r>>>10;u[e]=o+u[e-7]+n+u[e-16]|0}let{A:r,B:n,C:c,D:l,E:d,F:f,G:h,H:p}=this;for(let e=0;e<64;e++){let t=p+((0,i.rotr)(d,6)^(0,i.rotr)(d,11)^(0,i.rotr)(d,25))+o(d,f,h)+a[e]+u[e]|0,y=((0,i.rotr)(r,2)^(0,i.rotr)(r,13)^(0,i.rotr)(r,22))+s(r,n,c)|0;p=h,h=f,f=d,d=l+t|0,l=c,c=n,n=r,r=t+y|0}r=r+this.A|0,n=n+this.B|0,c=c+this.C|0,l=l+this.D|0,d=d+this.E|0,f=f+this.F|0,h=h+this.G|0,p=p+this.H|0,this.set(r,n,c,l,d,f,h,p)}roundClean(){u.fill(0)}destroy(){this.set(0,0,0,0,0,0,0,0),this.buffer.fill(0)}}class d extends l{constructor(){super(),this.A=-0x3efa6128,this.B=0x367cd507,this.C=0x3070dd17,this.D=-0x8f1a6c7,this.E=-4191439,this.F=0x68581511,this.G=0x64f98fa7,this.H=-0x4105b05c,this.outputLen=28}}t.sha256=(0,i.wrapConstructor)(()=>new l),t.sha224=(0,i.wrapConstructor)(()=>new d)},198:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.randomBytes=t.wrapXOFConstructorWithOpts=t.wrapConstructorWithOpts=t.wrapConstructor=t.checkOpts=t.Hash=t.concatBytes=t.toBytes=t.utf8ToBytes=t.asyncLoop=t.nextTick=t.hexToBytes=t.bytesToHex=t.isLE=t.rotr=t.createView=t.u32=t.u8=void 0;let n=r(6056),i=e=>new Uint8Array(e.buffer,e.byteOffset,e.byteLength);t.u8=i;let o=e=>new Uint32Array(e.buffer,e.byteOffset,Math.floor(e.byteLength/4));function s(e){return e instanceof Uint8Array||null!=e&&"object"==typeof e&&"Uint8Array"===e.constructor.name}t.u32=o;let a=e=>new DataView(e.buffer,e.byteOffset,e.byteLength);t.createView=a;let c=(e,t)=>e<<32-t|e>>>t;if(t.rotr=c,t.isLE=68===new Uint8Array(new Uint32Array([0x11223344]).buffer)[0],!t.isLE)throw Error("Non little-endian hardware is not supported");let u=Array.from({length:256},(e,t)=>t.toString(16).padStart(2,"0"));function l(e){if(!s(e))throw Error("Uint8Array expected");let t="";for(let r=0;r<e.length;r++)t+=u[e[r]];return t}t.bytesToHex=l;let d={_0:48,_9:57,_A:65,_F:70,_a:97,_f:102};function f(e){return e>=d._0&&e<=d._9?e-d._0:e>=d._A&&e<=d._F?e-(d._A-10):e>=d._a&&e<=d._f?e-(d._a-10):void 0}function h(e){if("string"!=typeof e)throw Error("hex string expected, got "+typeof e);let t=e.length,r=t/2;if(t%2)throw Error("padded hex string expected, got unpadded hex of length "+t);let n=new Uint8Array(r);for(let t=0,i=0;t<r;t++,i+=2){let r=f(e.charCodeAt(i)),o=f(e.charCodeAt(i+1));if(void 0===r||void 0===o)throw Error('hex string expected, got non-hex character "'+(e[i]+e[i+1])+'" at index '+i);n[t]=16*r+o}return n}t.hexToBytes=h;let p=async()=>{};async function y(e,r,n){let i=Date.now();for(let o=0;o<e;o++){n(o);let e=Date.now()-i;e>=0&&e<r||(await (0,t.nextTick)(),i+=e)}}function g(e){if("string"!=typeof e)throw Error(`utf8ToBytes expected string, got ${typeof e}`);return new Uint8Array(new TextEncoder().encode(e))}function m(e){if("string"==typeof e&&(e=g(e)),!s(e))throw Error(`expected Uint8Array, got ${typeof e}`);return e}function b(...e){let t=0;for(let r=0;r<e.length;r++){let n=e[r];if(!s(n))throw Error("Uint8Array expected");t+=n.length}let r=new Uint8Array(t);for(let t=0,n=0;t<e.length;t++){let i=e[t];r.set(i,n),n+=i.length}return r}t.nextTick=p,t.asyncLoop=y,t.utf8ToBytes=g,t.toBytes=m,t.concatBytes=b;class v{clone(){return this._cloneInto()}}t.Hash=v;let w={}.toString;function _(e,t){if(void 0!==t&&"[object Object]"!==w.call(t))throw Error("Options should be object or undefined");return Object.assign(e,t)}function E(e){let t=t=>e().update(m(t)).digest(),r=e();return t.outputLen=r.outputLen,t.blockLen=r.blockLen,t.create=()=>e(),t}function S(e){let t=(t,r)=>e(r).update(m(t)).digest(),r=e({});return t.outputLen=r.outputLen,t.blockLen=r.blockLen,t.create=t=>e(t),t}function x(e){let t=(t,r)=>e(r).update(m(t)).digest(),r=e({});return t.outputLen=r.outputLen,t.blockLen=r.blockLen,t.create=t=>e(t),t}function A(e=32){if(n.crypto&&"function"==typeof n.crypto.getRandomValues)return n.crypto.getRandomValues(new Uint8Array(e));throw Error("crypto.getRandomValues must be defined")}t.checkOpts=_,t.wrapConstructor=E,t.wrapConstructorWithOpts=S,t.wrapXOFConstructorWithOpts=x,t.randomBytes=A},11259:(e,t,r)=>{"use strict";
31Object.defineProperty(t,"__esModule",{value:!0}),t.MissingRefError=t.ValidationError=t.CodeGen=t.Name=t.nil=t.stringify=t.str=t._=t.KeywordCxt=void 0;let n=r(50179),i=r(28113),o=r(71724),s=r(5825),a=["/properties"],c="http://json-schema.org/draft-07/schema";class u extends n.default{_addVocabularies(){super._addVocabularies(),i.default.forEach(e=>this.addVocabulary(e)),this.opts.discriminator&&this.addKeyword(o.default)}_addDefaultMetaSchema(){if(super._addDefaultMetaSchema(),!this.opts.meta)return;let e=this.opts.$data?this.$dataMetaSchema(s,a):s;this.addMetaSchema(e,c,!1),this.refs["http://json-schema.org/schema"]=c}defaultMeta(){return this.opts.defaultMeta=super.defaultMeta()||(this.getSchema(c)?c:void 0)}}e.exports=t=u,Object.defineProperty(t,"__esModule",{value:!0}),t.default=u;var l=r(31843);Object.defineProperty(t,"KeywordCxt",{enumerable:!0,get:function(){return l.KeywordCxt}});var d=r(20012);Object.defineProperty(t,"_",{enumerable:!0,get:function(){return d._}}),Object.defineProperty(t,"str",{enumerable:!0,get:function(){return d.str}}),Object.defineProperty(t,"stringify",{enumerable:!0,get:function(){return d.stringify}}),Object.defineProperty(t,"nil",{enumerable:!0,get:function(){return d.nil}}),Object.defineProperty(t,"Name",{enumerable:!0,get:function(){return d.Name}}),Object.defineProperty(t,"CodeGen",{enumerable:!0,get:function(){return d.CodeGen}});var f=r(25575);Object.defineProperty(t,"ValidationError",{enumerable:!0,get:function(){return f.default}});var h=r(40326);Object.defineProperty(t,"MissingRefError",{enumerable:!0,get:function(){return h.default}})},31345:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.regexpCode=t.getEsmExportName=t.getProperty=t.safeStringify=t.stringify=t.strConcat=t.addCodeArg=t.str=t._=t.nil=t._Code=t.Name=t.IDENTIFIER=t._CodeOrName=void 0;class r{}t._CodeOrName=r,t.IDENTIFIER=/^[a-z$_][a-z$_0-9]*$/i;class n extends r{constructor(e){if(super(),!t.IDENTIFIER.test(e))throw Error("CodeGen: name must be a valid identifier");this.str=e}toString(){return this.str}emptyStr(){return!1}get names(){return{[this.str]:1}}}t.Name=n;class i extends r{constructor(e){super(),this._items="string"==typeof e?[e]:e}toString(){return this.str}emptyStr(){if(this._items.length>1)return!1;let e=this._items[0];return""===e||'""'===e}get str(){var e;return null!==(e=this._str)&&void 0!==e?e:this._str=this._items.reduce((e,t)=>`${e}${t}`,"")}get names(){var e;return null!==(e=this._names)&&void 0!==e?e:this._names=this._items.reduce((e,t)=>(t instanceof n&&(e[t.str]=(e[t.str]||0)+1),e),{})}}function o(e,...t){let r=[e[0]],n=0;for(;n<t.length;)c(r,t[n]),r.push(e[++n]);return new i(r)}t._Code=i,t.nil=new i(""),t._=o;let s=new i("+");function a(e,...t){let r=[p(e[0])],n=0;for(;n<t.length;)r.push(s),c(r,t[n]),r.push(s,p(e[++n]));return u(r),new i(r)}function c(e,t){t instanceof i?e.push(...t._items):t instanceof n?e.push(t):e.push(f(t))}function u(e){let t=1;for(;t<e.length-1;){if(e[t]===s){let r=l(e[t-1],e[t+1]);if(void 0!==r){e.splice(t-1,3,r);continue}e[t++]="+"}t++}}function l(e,t){return'""'===t?e:'""'===e?t:"string"==typeof e?t instanceof n||'"'!==e[e.length-1]?void 0:"string"!=typeof t?`${e.slice(0,-1)}${t}"`:'"'===t[0]?e.slice(0,-1)+t.slice(1):void 0:"string"!=typeof t||'"'!==t[0]||e instanceof n?void 0:`"${e}${t.slice(1)}`}function d(e,t){return t.emptyStr()?e:e.emptyStr()?t:a`${e}${t}`}function f(e){return"number"==typeof e||"boolean"==typeof e||null===e?e:p(Array.isArray(e)?e.join(","):e)}function h(e){return new i(p(e))}function p(e){return JSON.stringify(e).replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")}function y(e){return"string"==typeof e&&t.IDENTIFIER.test(e)?new i(`.${e}`):o`[${e}]`}function g(e){if("string"==typeof e&&t.IDENTIFIER.test(e))return new i(`${e}`);throw Error(`CodeGen: invalid export name: ${e}, use explicit $id name mapping`)}function m(e){return new i(e.toString())}t.str=a,t.addCodeArg=c,t.strConcat=d,t.stringify=h,t.safeStringify=p,t.getProperty=y,t.getEsmExportName=g,t.regexpCode=m},20012:(e,t,r)=>{"use strict";
vendor: 7,759 bytes, line 31
31Object.defineProperty(t,"__esModule",{value:!0}),t.or=t.and=t.not=t.CodeGen=t.operators=t.varKinds=t.ValueScopeName=t.ValueScope=t.Scope=t.Name=t.regexpCode=t.stringify=t.getProperty=t.nil=t.strConcat=t.str=t._=void 0;let n=r(31345),i=r(60228);var o=r(31345);Object.defineProperty(t,"_",{enumerable:!0,get:function(){return o._}}),Object.defineProperty(t,"str",{enumerable:!0,get:function(){return o.str}}),Object.defineProperty(t,"strConcat",{enumerable:!0,get:function(){return o.strConcat}}),Object.defineProperty(t,"nil",{enumerable:!0,get:function(){return o.nil}}),Object.defineProperty(t,"getProperty",{enumerable:!0,get:function(){return o.getProperty}}),Object.defineProperty(t,"stringify",{enumerable:!0,get:function(){return o.stringify}}),Object.defineProperty(t,"regexpCode",{enumerable:!0,get:function(){return o.regexpCode}}),Object.defineProperty(t,"Name",{enumerable:!0,get:function(){return o.Name}});var s=r(60228);Object.defineProperty(t,"Scope",{enumerable:!0,get:function(){return s.Scope}}),Object.defineProperty(t,"ValueScope",{enumerable:!0,get:function(){return s.ValueScope}}),Object.defineProperty(t,"ValueScopeName",{enumerable:!0,get:function(){return s.ValueScopeName}}),Object.defineProperty(t,"varKinds",{enumerable:!0,get:function(){return s.varKinds}}),t.operators={GT:new n._Code(">"),GTE:new n._Code(">="),LT:new n._Code("<"),LTE:new n._Code("<="),EQ:new n._Code("==="),NEQ:new n._Code("!=="),NOT:new n._Code("!"),OR:new n._Code("||"),AND:new n._Code("&&"),ADD:new n._Code("+")};class a{optimizeNodes(){return this}optimizeNames(e,t){return this}}class c extends a{constructor(e,t,r){super(),this.varKind=e,this.name=t,this.rhs=r}render({es5:e,_n:t}){let r=e?i.varKinds.var:this.varKind,n=void 0===this.rhs?"":` = ${this.rhs}`;return`${r} ${this.name}${n};`+t}optimizeNames(e,t){if(e[this.name.str])return this.rhs&&(this.rhs=k(this.rhs,e,t)),this}get names(){return this.rhs instanceof n._CodeOrName?this.rhs.names:{}}}class u extends a{constructor(e,t,r){super(),this.lhs=e,this.rhs=t,this.sideEffects=r}render({_n:e}){return`${this.lhs} = ${this.rhs};`+e}optimizeNames(e,t){if(!(this.lhs instanceof n.Name)||e[this.lhs.str]||this.sideEffects)return this.rhs=k(this.rhs,e,t),this}get names(){return N(this.lhs instanceof n.Name?{}:{...this.lhs.names},this.rhs)}}class l extends u{constructor(e,t,r,n){super(e,r,n),this.op=t}render({_n:e}){return`${this.lhs} ${this.op}= ${this.rhs};`+e}}class d extends a{constructor(e){super(),this.label=e,this.names={}}render({_n:e}){return`${this.label}:`+e}}class f extends a{constructor(e){super(),this.label=e,this.names={}}render({_n:e}){let t=this.label?` ${this.label}`:"";return`break${t};`+e}}class h extends a{constructor(e){super(),this.error=e}render({_n:e}){return`throw ${this.error};`+e}get names(){return this.error.names}}class p extends a{constructor(e){super(),this.code=e}render({_n:e}){return`${this.code};`+e}optimizeNodes(){return`${this.code}`?this:void 0}optimizeNames(e,t){return this.code=k(this.code,e,t),this}get names(){return this.code instanceof n._CodeOrName?this.code.names:{}}}class y extends a{constructor(e=[]){super(),this.nodes=e}render(e){return this.nodes.reduce((t,r)=>t+r.render(e),"")}optimizeNodes(){let{nodes:e}=this,t=e.length;for(;t--;){let r=e[t].optimizeNodes();Array.isArray(r)?e.splice(t,1,...r):r?e[t]=r:e.splice(t,1)}return e.length>0?this:void 0}optimizeNames(e,t){let{nodes:r}=this,n=r.length;for(;n--;){let i=r[n];i.optimizeNames(e,t)||(C(e,i.names),r.splice(n,1))}return r.length>0?this:void 0}get names(){return this.nodes.reduce((e,t)=>M(e,t.names),{})}}class g extends y{render(e){return"{"+e._n+super.render(e)+"}"+e._n}}class m extends y{}class b extends g{}b.kind="else";class v extends g{constructor(e,t){super(t),this.condition=e}render(e){let t=`if(${this.condition})`+super.render(e);return this.else&&(t+="else "+this.else.render(e)),t}optimizeNodes(){super.optimizeNodes();let e=this.condition;if(!0===e)return this.nodes;let t=this.else;if(t){let e=t.optimizeNodes();t=this.else=Array.isArray(e)?new b(e):e}return t?!1===e?t instanceof v?t:t.nodes:this.nodes.length?this:new v(D(e),t instanceof v?[t]:t.nodes):!1!==e&&this.nodes.length?this:void 0}optimizeNames(e,t){var r;if(this.else=null===(r=this.else)||void 0===r?void 0:r.optimizeNames(e,t),super.optimizeNames(e,t)||this.else)return this.condition=k(this.condition,e,t),this}get names(){let e=super.names;return N(e,this.condition),this.else&&M(e,this.else.names),e}}v.kind="if";class w extends g{}w.kind="for";class _ extends w{constructor(e){super(),this.iteration=e}render(e){return`for(${this.iteration})`+super.render(e)}optimizeNames(e,t){if(super.optimizeNames(e,t))return this.iteration=k(this.iteration,e,t),this}get names(){return M(super.names,this.iteration.names)}}class E extends w{constructor(e,t,r,n){super(),this.varKind=e,this.name=t,this.from=r,this.to=n}render(e){let t=e.es5?i.varKinds.var:this.varKind,{name:r,from:n,to:o}=this;return`for(${t} ${r}=${n}; ${r}<${o}; ${r}++)`+super.render(e)}get names(){let e=N(super.names,this.from);return N(e,this.to)}}class S extends w{constructor(e,t,r,n){super(),this.loop=e,this.varKind=t,this.name=r,this.iterable=n}render(e){return`for(${this.varKind} ${this.name} ${this.loop} ${this.iterable})`+super.render(e)}optimizeNames(e,t){if(super.optimizeNames(e,t))return this.iterable=k(this.iterable,e,t),this}get names(){return M(super.names,this.iterable.names)}}class x extends g{constructor(e,t,r){super(),this.name=e,this.args=t,this.async=r}render(e){let t=this.async?"async ":"";return`${t}function ${this.name}(${this.args})`+super.render(e)}}x.kind="func";class A extends y{render(e){return"return "+super.render(e)}}A.kind="return";class I extends g{render(e){let t="try"+super.render(e);return this.catch&&(t+=this.catch.render(e)),this.finally&&(t+=this.finally.render(e)),t}optimizeNodes(){var e,t;return super.optimizeNodes(),null===(e=this.catch)||void 0===e||e.optimizeNodes(),null===(t=this.finally)||void 0===t||t.optimizeNodes(),this}optimizeNames(e,t){var r,n;return super.optimizeNames(e,t),null===(r=this.catch)||void 0===r||r.optimizeNames(e,t),null===(n=this.finally)||void 0===n||n.optimizeNames(e,t),this}get names(){let e=super.names;return this.catch&&M(e,this.catch.names),this.finally&&M(e,this.finally.names),e}}class O extends g{constructor(e){super(),this.error=e}render(e){return`catch(${this.error})`+super.render(e)}}O.kind="catch";class T extends g{render(e){return"finally"+super.render(e)}}T.kind="finally";class P{constructor(e,t={}){this._values={},this._blockStarts=[],this._constants={},this.opts={...t,_n:t.lines?"\n":""},this._extScope=e,this._scope=new i.Scope({parent:e}),this._nodes=[new m]}toString(){return this._root.render(this.opts)}name(e){return this._scope.name(e)}scopeName(e){return this._extScope.name(e)}scopeValue(e,t){let r=this._extScope.value(e,t);return(this._values[r.prefix]||(this._values[r.prefix]=new Set)).add(r),r}getScopeValue(e,t){return this._extScope.getValue(e,t)}scopeRefs(e){return this._extScope.scopeRefs(e,this._values)}scopeCode(){return this._extScope.scopeCode(this._values)}_def(e,t,r,n){let i=this._scope.toName(t);return void 0!==r&&n&&(this._constants[i.str]=r),this._leafNode(new c(e,i,r)),i}const(e,t,r){return this._def(i.varKinds.const,e,t,r)}let(e,t,r){return this._def(i.varKinds.let,e,t,r)}var(e,t,r){return this._def(i.varKinds.var,e,t,r)}assign(e,t,r){return this._leafNode(new u(e,t,r))}add(e,r){return this._leafNode(new l(e,t.operators.ADD,r))}code(e){return"function"==typeof e?e():e!==n.nil&&this._leafNode(new p(e)),this}object(...e){let t=["{"];for(let[r,i]of e)t.length>1&&t.push(","),t.push(r),(r!==i||this.opts.es5)&&(t.push(":"),(0,n.addCodeArg)(t,i));return t.push("}"),new n._Code(t)}
31if(e,t,r){if(this._blockNode(new v(e)),t&&r)this.code(t).else().code(r).endIf();else if(t)this.code(t).endIf();else if(r)throw Error('CodeGen: "else" body without "then" body');return this}elseIf(e){return this._elseNode(new v(e))}else(){return this._elseNode(new b)}endIf(){return this._endBlockNode(v,b)}_for(e,t){return this._blockNode(e),t&&this.code(t).endFor(),this}for(e,t){return this._for(new _(e),t)}forRange(e,t,r,n,o=this.opts.es5?i.varKinds.var:i.varKinds.let){let s=this._scope.toName(e);return this._for(new E(o,s,t,r),()=>n(s))}forOf(e,t,r,o=i.varKinds.const){let s=this._scope.toName(e);if(this.opts.es5){let e=t instanceof n.Name?t:this.var("_arr",t);return this.forRange("_i",0,(0,n._)`${e}.length`,t=>{this.var(s,(0,n._)`${e}[${t}]`),r(s)})}return this._for(new S("of",o,s,t),()=>r(s))}forIn(e,t,r,o=this.opts.es5?i.varKinds.var:i.varKinds.const){if(this.opts.ownProperties)return this.forOf(e,(0,n._)`Object.keys(${t})`,r);let s=this._scope.toName(e);return this._for(new S("in",o,s,t),()=>r(s))}endFor(){return this._endBlockNode(w)}label(e){return this._leafNode(new d(e))}break(e){return this._leafNode(new f(e))}return(e){let t=new A;if(this._blockNode(t),this.code(e),1!==t.nodes.length)throw Error('CodeGen: "return" should have one node');return this._endBlockNode(A)}try(e,t,r){if(!t&&!r)throw Error('CodeGen: "try" without "catch" and "finally"');let n=new I;if(this._blockNode(n),this.code(e),t){let e=this.name("e");this._currNode=n.catch=new O(e),t(e)}return r&&(this._currNode=n.finally=new T,this.code(r)),this._endBlockNode(O,T)}throw(e){return this._leafNode(new h(e))}block(e,t){return this._blockStarts.push(this._nodes.length),e&&this.code(e).endBlock(t),this}endBlock(e){let t=this._blockStarts.pop();if(void 0===t)throw Error("CodeGen: not in self-balancing block");let r=this._nodes.length-t;if(r<0||void 0!==e&&r!==e)throw Error(`CodeGen: wrong number of nodes: ${r} vs ${e} expected`);return this._nodes.length=t,this}func(e,t=n.nil,r,i){return this._blockNode(new x(e,t,r)),i&&this.code(i).endFunc(),this}endFunc(){return this._endBlockNode(x)}optimize(e=1){for(;e-- >0;)this._root.optimizeNodes(),this._root.optimizeNames(this._root.names,this._constants)}_leafNode(e){return this._currNode.nodes.push(e),this}_blockNode(e){this._currNode.nodes.push(e),this._nodes.push(e)}_endBlockNode(e,t){let r=this._currNode;if(r instanceof e||t&&r instanceof t)return this._nodes.pop(),this;throw Error(`CodeGen: not in block "${t?`${e.kind}/${t.kind}`:e.kind}"`)}_elseNode(e){let t=this._currNode;if(!(t instanceof v))throw Error('CodeGen: "else" without "if"');return this._currNode=t.else=e,this}get _root(){return this._nodes[0]}get _currNode(){let e=this._nodes;return e[e.length-1]}set _currNode(e){let t=this._nodes;t[t.length-1]=e}}function M(e,t){for(let r in t)e[r]=(e[r]||0)+(t[r]||0);return e}function N(e,t){return t instanceof n._CodeOrName?M(e,t.names):e}function k(e,t,r){if(e instanceof n.Name)return i(e);if(!o(e))return e;return new n._Code(e._items.reduce((e,t)=>(t instanceof n.Name&&(t=i(t)),t instanceof n._Code?e.push(...t._items):e.push(t),e),[]));function i(e){let n=r[e.str];return void 0===n||1!==t[e.str]?e:(delete t[e.str],n)}function o(e){return e instanceof n._Code&&e._items.some(e=>e instanceof n.Name&&1===t[e.str]&&void 0!==r[e.str])}}function C(e,t){for(let r in t)e[r]=(e[r]||0)-(t[r]||0)}function D(e){return"boolean"==typeof e||"number"==typeof e||null===e?!e:(0,n._)`!${$(e)}`}t.CodeGen=P,t.not=D;let j=U(t.operators.AND);function R(...e){return e.reduce(j)}t.and=R;let L=U(t.operators.OR);function B(...e){return e.reduce(L)}function U(e){return(t,r)=>t===n.nil?r:r===n.nil?t:(0,n._)`${$(t)} ${e} ${$(r)}`}function $(e){return e instanceof n.Name?e:(0,n._)`(${e})`}t.or=B},60228:(e,t,r)=>{"use strict";var n;Object.defineProperty(t,"__esModule",{value:!0}),t.ValueScope=t.ValueScopeName=t.Scope=t.varKinds=t.UsedValueState=void 0;let i=r(31345);class o extends Error{constructor(e){super(`CodeGen: "code" for ${e} not defined`),this.value=e.value}}!function(e){e[e.Started=0]="Started",e[e.Completed=1]="Completed"}(n=t.UsedValueState||(t.UsedValueState={})),t.varKinds={const:new i.Name("const"),let:new i.Name("let"),var:new i.Name("var")};class s{constructor({prefixes:e,parent:t}={}){this._names={},this._prefixes=e,this._parent=t}toName(e){return e instanceof i.Name?e:this.name(e)}name(e){return new i.Name(this._newName(e))}_newName(e){let t=this._names[e]||this._nameGroup(e);return`${e}${t.index++}`}_nameGroup(e){var t,r;if((null===(r=null===(t=this._parent)||void 0===t?void 0:t._prefixes)||void 0===r?void 0:r.has(e))||this._prefixes&&!this._prefixes.has(e))throw Error(`CodeGen: prefix "${e}" is not allowed in this scope`);return this._names[e]={prefix:e,index:0}}}t.Scope=s;class a extends i.Name{constructor(e,t){super(t),this.prefix=e}setValue(e,{property:t,itemIndex:r}){this.value=e,this.scopePath=(0,i._)`.${new i.Name(t)}[${r}]`}}t.ValueScopeName=a;let c=(0,i._)`\n`;class u extends s{constructor(e){super(e),this._values={},this._scope=e.scope,this.opts={...e,_n:e.lines?c:i.nil}}get(){return this._scope}name(e){return new a(e,this._newName(e))}value(e,t){var r;if(void 0===t.ref)throw Error("CodeGen: ref must be passed in value");let n=this.toName(e),{prefix:i}=n,o=null!==(r=t.key)&&void 0!==r?r:t.ref,s=this._values[i];if(s){let e=s.get(o);if(e)return e}else s=this._values[i]=new Map;s.set(o,n);let a=this._scope[i]||(this._scope[i]=[]),c=a.length;return a[c]=t.ref,n.setValue(t,{property:i,itemIndex:c}),n}getValue(e,t){let r=this._values[e];if(r)return r.get(t)}scopeRefs(e,t=this._values){return this._reduceValues(t,t=>{if(void 0===t.scopePath)throw Error(`CodeGen: name "${t}" has no value`);return(0,i._)`${e}${t.scopePath}`})}scopeCode(e=this._values,t,r){return this._reduceValues(e,e=>{if(void 0===e.value)throw Error(`CodeGen: name "${e}" has no value`);return e.value.code},t,r)}_reduceValues(e,r,s={},a){let c=i.nil;for(let u in e){let l=e[u];if(!l)continue;let d=s[u]=s[u]||new Map;
31l.forEach(e=>{if(d.has(e))return;d.set(e,n.Started);let s=r(e);if(s){let r=this.opts.es5?t.varKinds.var:t.varKinds.const;c=(0,i._)`${c}${r} ${e} = ${s};${this.opts._n}`}else if(s=null==a?void 0:a(e))c=(0,i._)`${c}${s}${this.opts._n}`;else throw new o(e);d.set(e,n.Completed)})}return c}}t.ValueScope=u},75701:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.extendErrors=t.resetErrorsCount=t.reportExtraError=t.reportError=t.keyword$DataError=t.keywordError=void 0;let n=r(20012),i=r(67146),o=r(78566);function s(e,r=t.keywordError,i,o){let{it:a}=e,{gen:c,compositeRule:u,allErrors:f}=a,p=h(e,r,i);(null!=o?o:u||f)?l(c,p):d(a,(0,n._)`[${p}]`)}function a(e,r=t.keywordError,n){let{it:i}=e,{gen:s,compositeRule:c,allErrors:u}=i;l(s,h(e,r,n)),c||u||d(i,o.default.vErrors)}function c(e,t){e.assign(o.default.errors,t),e.if((0,n._)`${o.default.vErrors} !== null`,()=>e.if(t,()=>e.assign((0,n._)`${o.default.vErrors}.length`,t),()=>e.assign(o.default.vErrors,null)))}function u({gen:e,keyword:t,schemaValue:r,data:i,errsCount:s,it:a}){if(void 0===s)throw Error("ajv implementation error");let c=e.name("err");e.forRange("i",s,o.default.errors,s=>{e.const(c,(0,n._)`${o.default.vErrors}[${s}]`),e.if((0,n._)`${c}.instancePath === undefined`,()=>e.assign((0,n._)`${c}.instancePath`,(0,n.strConcat)(o.default.instancePath,a.errorPath))),e.assign((0,n._)`${c}.schemaPath`,(0,n.str)`${a.errSchemaPath}/${t}`),a.opts.verbose&&(e.assign((0,n._)`${c}.schema`,r),e.assign((0,n._)`${c}.data`,i))})}function l(e,t){let r=e.const("err",t);e.if((0,n._)`${o.default.vErrors} === null`,()=>e.assign(o.default.vErrors,(0,n._)`[${r}]`),(0,n._)`${o.default.vErrors}.push(${r})`),e.code((0,n._)`${o.default.errors}++`)}function d(e,t){let{gen:r,validateName:i,schemaEnv:o}=e;o.$async?r.throw((0,n._)`new ${e.ValidationError}(${t})`):(r.assign((0,n._)`${i}.errors`,t),r.return(!1))}t.keywordError={message:({keyword:e})=>(0,n.str)`must pass "${e}" keyword validation`},t.keyword$DataError={message:({keyword:e,schemaType:t})=>t?(0,n.str)`"${e}" keyword must be ${t} ($data)`:(0,n.str)`"${e}" keyword is invalid ($data)`},t.reportError=s,t.reportExtraError=a,t.resetErrorsCount=c,t.extendErrors=u;let f={keyword:new n.Name("keyword"),schemaPath:new n.Name("schemaPath"),params:new n.Name("params"),propertyName:new n.Name("propertyName"),message:new n.Name("message"),schema:new n.Name("schema"),parentSchema:new n.Name("parentSchema")};function h(e,t,r){let{createErrors:i}=e.it;return!1===i?(0,n._)`{}`:p(e,t,r)}function p(e,t,r={}){let{gen:n,it:i}=e,o=[y(i,r),g(e,r)];return m(e,t,o),n.object(...o)}function y({errorPath:e},{instancePath:t}){let r=t?(0,n.str)`${e}${(0,i.getErrorPath)(t,i.Type.Str)}`:e;return[o.default.instancePath,(0,n.strConcat)(o.default.instancePath,r)]}function g({keyword:e,it:{errSchemaPath:t}},{schemaPath:r,parentSchema:o}){let s=o?t:(0,n.str)`${t}/${e}`;return r&&(s=(0,n.str)`${s}${(0,i.getErrorPath)(r,i.Type.Str)}`),[f.schemaPath,s]}function m(e,{params:t,message:r},i){let{keyword:s,data:a,schemaValue:c,it:u}=e,{opts:l,propertyName:d,topSchemaRef:h,schemaPath:p}=u;i.push([f.keyword,s],[f.params,"function"==typeof t?t(e):t||(0,n._)`{}`]),l.messages&&i.push([f.message,"function"==typeof r?r(e):r]),l.verbose&&i.push([f.schema,c],[f.parentSchema,(0,n._)`${h}${p}`],[o.default.data,a]),d&&i.push([f.propertyName,d])}},96138:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.resolveSchema=t.getCompilingSchema=t.resolveRef=t.compileSchema=t.SchemaEnv=void 0;let n=r(20012),i=r(25575),o=r(78566),s=r(66250),a=r(67146),c=r(31843);class u{constructor(e){var t;let r;this.refs={},this.dynamicAnchors={},"object"==typeof e.schema&&(r=e.schema),this.schema=e.schema,this.schemaId=e.schemaId,this.root=e.root||this,this.baseId=null!==(t=e.baseId)&&void 0!==t?t:(0,s.normalizeId)(null==r?void 0:r[e.schemaId||"$id"]),this.schemaPath=e.schemaPath,this.localRefs=e.localRefs,this.meta=e.meta,this.$async=null==r?void 0:r.$async,this.refs={}}}function l(e){let t,r;let a=h.call(this,e);if(a)return a;let u=(0,s.getFullPath)(this.opts.uriResolver,e.root.baseId),{es5:l,lines:d}=this.opts.code,{ownProperties:f}=this.opts,p=new n.CodeGen(this.scope,{es5:l,lines:d,ownProperties:f});e.$async&&(t=p.scopeValue("Error",{ref:i.default,code:(0,n._)`require("ajv/dist/runtime/validation_error").default`}));let y=p.scopeName("validate");e.validateName=y;let g={gen:p,allErrors:this.opts.allErrors,data:o.default.data,parentData:o.default.parentData,parentDataProperty:o.default.parentDataProperty,dataNames:[o.default.data],dataPathArr:[n.nil],dataLevel:0,dataTypes:[],definedProperties:new Set,topSchemaRef:p.scopeValue("schema",!0===this.opts.code.source?{ref:e.schema,code:(0,n.stringify)(e.schema)}:{ref:e.schema}),validateName:y,ValidationError:t,schema:e.schema,schemaEnv:e,rootId:u,baseId:e.baseId||u,schemaPath:n.nil,errSchemaPath:e.schemaPath||(this.opts.jtd?"":"#"),errorPath:(0,n._)`""`,opts:this.opts,self:this};try{this._compilations.add(e),(0,c.validateFunctionCode)(g),p.optimize(this.opts.code.optimize);let t=p.toString();r=`${p.scopeRefs(o.default.scope)}return ${t}`,this.opts.code.process&&(r=this.opts.code.process(r,e));let i=Function(`${o.default.self}`,`${o.default.scope}`,r)(this,this.scope.get());if(this.scope.value(y,{ref:i}
31),i.errors=null,i.schema=e.schema,i.schemaEnv=e,e.$async&&(i.$async=!0),!0===this.opts.code.source&&(i.source={validateName:y,validateCode:t,scopeValues:p._values}),this.opts.unevaluated){let{props:e,items:t}=g;i.evaluated={props:e instanceof n.Name?void 0:e,items:t instanceof n.Name?void 0:t,dynamicProps:e instanceof n.Name,dynamicItems:t instanceof n.Name},i.source&&(i.source.evaluated=(0,n.stringify)(i.evaluated))}return e.validate=i,e}catch(t){throw delete e.validate,delete e.validateName,r&&this.logger.error("Error compiling schema, function code:",r),t}finally{this._compilations.delete(e)}}function d(e,t,r){var n;r=(0,s.resolveUrl)(this.opts.uriResolver,t,r);let i=e.refs[r];if(i)return i;let o=y.call(this,e,r);if(void 0===o){let i=null===(n=e.localRefs)||void 0===n?void 0:n[r],{schemaId:s}=this.opts;i&&(o=new u({schema:i,schemaId:s,root:e,baseId:t}))}if(void 0!==o)return e.refs[r]=f.call(this,o)}function f(e){return(0,s.inlineRef)(e.schema,this.opts.inlineRefs)?e.schema:e.validate?e:l.call(this,e)}function h(e){for(let t of this._compilations)if(p(t,e))return t}function p(e,t){return e.schema===t.schema&&e.root===t.root&&e.baseId===t.baseId}function y(e,t){let r;for(;"string"==typeof(r=this.refs[t]);)t=r;return r||this.schemas[t]||g.call(this,e,t)}function g(e,t){let r=this.opts.uriResolver.parse(t),n=(0,s._getFullPath)(this.opts.uriResolver,r),i=(0,s.getFullPath)(this.opts.uriResolver,e.baseId,void 0);if(Object.keys(e.schema).length>0&&n===i)return b.call(this,r,e);let o=(0,s.normalizeId)(n),a=this.refs[o]||this.schemas[o];if("string"==typeof a){let t=g.call(this,e,a);if("object"!=typeof(null==t?void 0:t.schema))return;return b.call(this,r,t)}if("object"==typeof(null==a?void 0:a.schema)){if(a.validate||l.call(this,a),o===(0,s.normalizeId)(t)){let{schema:t}=a,{schemaId:r}=this.opts,n=t[r];return n&&(i=(0,s.resolveUrl)(this.opts.uriResolver,i,n)),new u({schema:t,schemaId:r,root:e,baseId:i})}return b.call(this,r,a)}}t.SchemaEnv=u,t.compileSchema=l,t.resolveRef=d,t.getCompilingSchema=h,t.resolveSchema=g;let m=new Set(["properties","patternProperties","enum","dependencies","definitions"]);function b(e,{baseId:t,schema:r,root:n}){var i;let o;if((null===(i=e.fragment)||void 0===i?void 0:i[0])!=="/")return;for(let n of e.fragment.slice(1).split("/")){if("boolean"==typeof r)return;let e=r[(0,a.unescapeFragment)(n)];if(void 0===e)return;let i="object"==typeof(r=e)&&r[this.opts.schemaId];!m.has(n)&&i&&(t=(0,s.resolveUrl)(this.opts.uriResolver,t,i))}if("boolean"!=typeof r&&r.$ref&&!(0,a.schemaHasRulesButRef)(r,this.RULES)){let e=(0,s.resolveUrl)(this.opts.uriResolver,t,r.$ref);o=g.call(this,n,e)}let{schemaId:c}=this.opts;if((o=o||new u({schema:r,schemaId:c,root:n,baseId:t})).schema!==o.root.schema)return o}},78566:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});let n=r(20012),i={data:new n.Name("data"),valCxt:new n.Name("valCxt"),instancePath:new n.Name("instancePath"),parentData:new n.Name("parentData"),parentDataProperty:new n.Name("parentDataProperty"),rootData:new n.Name("rootData"),dynamicAnchors:new n.Name("dynamicAnchors"),vErrors:new n.Name("vErrors"),errors:new n.Name("errors"),this:new n.Name("this"),self:new n.Name("self"),scope:new n.Name("scope"),json:new n.Name("json"),jsonPos:new n.Name("jsonPos"),jsonLen:new n.Name("jsonLen"),jsonPart:new n.Name("jsonPart")};t.default=i},40326:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});let n=r(66250);
31class i extends Error{constructor(e,t,r,i){super(i||`can't resolve reference ${r} from id ${t}`),this.missingRef=(0,n.resolveUrl)(e,t,r),this.missingSchema=(0,n.normalizeId)((0,n.getFullPath)(e,this.missingRef))}}t.default=i},66250:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getSchemaRefs=t.resolveUrl=t.normalizeId=t._getFullPath=t.getFullPath=t.inlineRef=void 0;let n=r(67146),i=r(85979),o=r(67787),s=new Set(["type","format","pattern","maxLength","minLength","maxProperties","minProperties","maxItems","minItems","maximum","minimum","uniqueItems","multipleOf","required","enum","const"]);function a(e,t=!0){return"boolean"==typeof e||(!0===t?!u(e):!!t&&l(e)<=t)}t.inlineRef=a;let c=new Set(["$ref","$recursiveRef","$recursiveAnchor","$dynamicRef","$dynamicAnchor"]);function u(e){for(let t in e){if(c.has(t))return!0;let r=e[t];if(Array.isArray(r)&&r.some(u)||"object"==typeof r&&u(r))return!0}return!1}function l(e){let t=0;for(let r in e)if("$ref"===r||(t++,!s.has(r)&&("object"==typeof e[r]&&(0,n.eachItem)(e[r],e=>t+=l(e)),t===1/0)))return 1/0;return t}function d(e,t="",r){!1!==r&&(t=p(t));let n=e.parse(t);return f(e,n)}function f(e,t){return e.serialize(t).split("#")[0]+"#"}t.getFullPath=d,t._getFullPath=f;let h=/#\/?$/;function p(e){return e?e.replace(h,""):""}function y(e,t,r){return r=p(r),e.resolve(t,r)}t.normalizeId=p,t.resolveUrl=y;let g=/^[a-z_][-a-z0-9._]*$/i;function m(e,t){if("boolean"==typeof e)return{};let{schemaId:r,uriResolver:n}=this.opts,s=p(e[r]||t),a={"":s},c=d(n,s,!1),u={},l=new Set;return o(e,{allKeys:!0},(e,t,n,i)=>{if(void 0===i)return;let o=c+t,s=a[i];function d(t){let r=this.opts.uriResolver.resolve;if(t=p(s?r(s,t):t),l.has(t))throw h(t);l.add(t);let n=this.refs[t];return"string"==typeof n&&(n=this.refs[n]),"object"==typeof n?f(e,n.schema,t):t!==p(o)&&("#"===t[0]?(f(e,u[t],t),u[t]=e):this.refs[t]=o),t}function y(e){if("string"==typeof e){if(!g.test(e))throw Error(`invalid anchor "${e}"`);d.call(this,`#${e}`)}}"string"==typeof e[r]&&(s=d.call(this,e[r])),y.call(this,e.$anchor),y.call(this,e.$dynamicAnchor),a[t]=s}),u;function f(e,t,r){if(void 0!==t&&!i(e,t))throw h(r)}function h(e){return Error(`reference "${e}" resolves to more than one schema`)}}t.getSchemaRefs=m},26285:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getRules=t.isJSONType=void 0;let r=new Set(["string","number","integer","boolean","null","object","array"]);function n(e){return"string"==typeof e&&r.has(e)}function i(){let e={number:{type:"number",rules:[]},string:{type:"string",rules:[]},array:{type:"array",rules:[]},object:{type:"object",rules:[]}};return{types:{...e,integer:!0,boolean:!0,null:!0},rules:[{rules:[]},e.number,e.string,e.array,e.object],post:{rules:[]},all:{},keywords:{}}}t.isJSONType=n,t.getRules=i},67146:(e,t,r)=>{"use strict";var n;Object.defineProperty(t,"__esModule",{value:!0}),t.checkStrictMode=t.getErrorPath=t.Type=t.useFunc=t.setEvaluated=t.evaluatedPropsToName=t.mergeEvaluated=t.eachItem=t.unescapeJsonPointer=t.escapeJsonPointer=t.escapeFragment=t.unescapeFragment=t.schemaRefOrVal=t.schemaHasRulesButRef=t.schemaHasRules=t.checkUnknownRules=t.alwaysValidSchema=t.toHash=void 0;let i=r(20012),o=r(31345);function s(e){let t={};for(let r of e)t[r]=!0;return t}function a(e,t){return"boolean"==typeof t?t:0===Object.keys(t).length||(c(e,t),!u(t,e.self.RULES.all))}function c(e,t=e.schema){let{opts:r,self:n}=e;if(!r.strictSchema||"boolean"==typeof t)return;let i=n.RULES.keywords;for(let r in t)i[r]||S(e,`unknown keyword: "${r}"`)}function u(e,t){if("boolean"==typeof e)return!e;for(let r in e)if(t[r])return!0;return!1}function l(e,t){if("boolean"==typeof e)return!e;for(let r in e)if("$ref"!==r&&t.all[r])return!0;return!1}function d({topSchemaRef:e,schemaPath:t},r,n,o){if(!o){if("number"==typeof r||"boolean"==typeof r)return r;if("string"==typeof r)return(0,i._)`${r}`}return(0,i._)`${e}${t}${(0,i.getProperty)(n)}`}function f(e){return y(decodeURIComponent(e))}function h(e){return encodeURIComponent(p(e))}function p(e){return"number"==typeof e?`${e}`:e.replace(/~/g,"~0").replace(/\//g,"~1")}function y(e){return e.replace(/~1/g,"/").replace(/~0/g,"~")}function g(e,t){if(Array.isArray(e))for(let r of e)t(r);else t(e)}function m({mergeNames:e,mergeToName:t,mergeValues:r,resultToName:n}){return(o,s,a,c)=>{let u=void 0===a?s:a instanceof i.Name?(s instanceof i.Name?e(o,s,a):t(o,s,a),a):s instanceof i.Name?(t(o,a,s),s):r(s,a);return c!==i.Name||u instanceof i.Name?u:n(o,u)}}function b(e,t){if(!0===t)return e.var("props",!0);let r=e.var("props",(0,i._)`{}`);return void 0!==t&&v(e,r,t),r}function v(e,t,r){Object.keys(r).forEach(r=>e.assign((0,i._)`${t}${(0,i.getProperty)(r)}`,!0))}t.toHash=s,t.alwaysValidSchema=a,t.checkUnknownRules=c,t.schemaHasRules=u,t.schemaHasRulesButRef=l,t.schemaRefOrVal=d,t.unescapeFragment=f,t.escapeFragment=h,t.escapeJsonPointer=p,t.unescapeJsonPointer=y,t.eachItem=g,t.mergeEvaluated={props:m({mergeNames:(e,t,r)=>e.if((0,i._)`${r} !== true && ${t} !== undefined`,()=>{e.if((0,i._)`${t} === true`,()=>e.assign(r,!0),()=>e.assign(r,(0,i._)`${r} || {}`).code((0,i._)`Object.assign(${r}, ${t})`))}),mergeToName:(e,t,r)=>e.if((0,i._)`${r} !== true`,()=>{!0===t?e.assign(r,!0):(e.assign(r,(0,i._)`${r} || {}`),v(e,r,t))}),mergeValues:(e,t)=>!0===e||{...e,...t},resultToName:b}),items:m({mergeNames:(e,t,r)=>e.if((0,i._)`${r} !== true && ${t} !== undefined`,()=>e.assign(r,(0,i._)`${t} === true ? true : ${r} > ${t} ? ${r} : ${t}`)),mergeToName:(e,t,r)=>e.if((0,i._)`${r} !== true`,()=>e.assign(r,!0===t||(0,i._)`${r} > ${t} ? ${r} : ${t}`)),mergeValues:(e,t)=>!0===e||Math.max(e,t),resultToName:(e,t)=>
31e.var("items",t)})},t.evaluatedPropsToName=b,t.setEvaluated=v;let w={};function _(e,t){return e.scopeValue("func",{ref:t,code:w[t.code]||(w[t.code]=new o._Code(t.code))})}function E(e,t,r){if(e instanceof i.Name){let o=t===n.Num;return r?o?(0,i._)`"[" + ${e} + "]"`:(0,i._)`"['" + ${e} + "']"`:o?(0,i._)`"/" + ${e}`:(0,i._)`"/" + ${e}.replace(/~/g, "~0").replace(/\\//g, "~1")`}return r?(0,i.getProperty)(e).toString():"/"+p(e)}function S(e,t,r=e.opts.strictSchema){if(r){if(t=`strict mode: ${t}`,!0===r)throw Error(t);e.self.logger.warn(t)}}t.useFunc=_,function(e){e[e.Num=0]="Num",e[e.Str=1]="Str"}(n=t.Type||(t.Type={})),t.getErrorPath=E,t.checkStrictMode=S},30422:(e,t)=>{"use strict";function r({schema:e,self:t},r){let i=t.RULES.types[r];return i&&!0!==i&&n(e,i)}function n(e,t){return t.rules.some(t=>i(e,t))}function i(e,t){var r;return void 0!==e[t.keyword]||(null===(r=t.definition.implements)||void 0===r?void 0:r.some(t=>void 0!==e[t]))}Object.defineProperty(t,"__esModule",{value:!0}),t.shouldUseRule=t.shouldUseGroup=t.schemaHasRulesForType=void 0,t.schemaHasRulesForType=r,t.shouldUseGroup=n,t.shouldUseRule=i},65654:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.boolOrEmptySchema=t.topBoolOrEmptySchema=void 0;let n=r(75701),i=r(20012),o=r(78566),s={message:"boolean schema is false"};function a(e){let{gen:t,schema:r,validateName:n}=e;!1===r?u(e,!1):"object"==typeof r&&!0===r.$async?t.return(o.default.data):(t.assign((0,i._)`${n}.errors`,null),t.return(!0))}function c(e,t){let{gen:r,schema:n}=e;!1===n?(r.var(t,!1),u(e)):r.var(t,!0)}function u(e,t){let{gen:r,data:i}=e,o={gen:r,keyword:"false schema",data:i,schema:!1,schemaCode:!1,schemaValue:!1,params:{},it:e};(0,n.reportError)(o,s,void 0,t)}t.topBoolOrEmptySchema=a,t.boolOrEmptySchema=c},14233:(e,t,r)=>{"use strict";var n;Object.defineProperty(t,"__esModule",{value:!0}),t.reportTypeError=t.checkDataTypes=t.checkDataType=t.coerceAndCheckDataType=t.getJSONTypes=t.getSchemaTypes=t.DataType=void 0;let i=r(26285),o=r(30422),s=r(75701),a=r(20012),c=r(67146);function u(e){let t=l(e.type);if(t.includes("null")){if(!1===e.nullable)throw Error("type: null contradicts nullable: false")}else{if(!t.length&&void 0!==e.nullable)throw Error('"nullable" cannot be used without "type"');!0===e.nullable&&t.push("null")}return t}function l(e){let t=Array.isArray(e)?e:e?[e]:[];if(t.every(i.isJSONType))return t;throw Error("type must be JSONType or JSONType[]: "+t.join(","))}function d(e,t){let{gen:r,data:i,opts:s}=e,a=h(t,s.coerceTypes),c=t.length>0&&!(0===a.length&&1===t.length&&(0,o.schemaHasRulesForType)(e,t[0]));if(c){let o=m(t,i,s.strictNumbers,n.Wrong);r.if(o,()=>{a.length?p(e,t,a):v(e)})}return c}!function(e){e[e.Correct=0]="Correct",e[e.Wrong=1]="Wrong"}(n=t.DataType||(t.DataType={})),t.getSchemaTypes=u,t.getJSONTypes=l,t.coerceAndCheckDataType=d;let f=new Set(["string","number","integer","boolean","null"]);function h(e,t){return t?e.filter(e=>f.has(e)||"array"===t&&"array"===e):[]}function p(e,t,r){let{gen:n,data:i,opts:o}=e,s=n.let("dataType",(0,a._)`typeof ${i}`),c=n.let("coerced",(0,a._)`undefined`);for(let e of("array"===o.coerceTypes&&n.if((0,a._)`${s} == 'object' && Array.isArray(${i}) && ${i}.length == 1`,()=>n.assign(i,(0,a._)`${i}[0]`).assign(s,(0,a._)`typeof ${i}`).if(m(t,i,o.strictNumbers),()=>n.assign(c,i))),n.if((0,a._)`${c} !== undefined`),r))(f.has(e)||"array"===e&&"array"===o.coerceTypes)&&u(e);function u(e){switch(e){case"string":n.elseIf((0,a._)`${s} == "number" || ${s} == "boolean"`).assign(c,(0,a._)`"" + ${i}`).elseIf((0,a._)`${i} === null`).assign(c,(0,a._)`""`);return;case"number":n.elseIf((0,a._)`${s} == "boolean" || ${i} === null 32 || (${s} == "string" && ${i} && ${i} == +${i})`).assign(c,(0,a._)`+${i}`);return;case"integer":n.elseIf((0,a._)`${s} === "boolean" || ${i} === null 33 || (${s} === "string" && ${i} && ${i} == +${i} && !(${i} % 1))`).assign(c,(0,a._)`+${i}`);return;case"boolean":n.elseIf((0,a._)`${i} === "false" || ${i} === 0 || ${i} === null`).assign(c,!1).elseIf((0,a._)`${i} === "true" || ${i} === 1`).assign(c,!0);return;case"null":n.elseIf((0,a._)`${i} === "" || ${i} === 0 || ${i} === false`),n.assign(c,null);return;case"array":n.elseIf((0,a._)`${s} === "string" || ${s}
33 === "number" 34 || ${s} === "boolean" || ${i} === null`).assign(c,(0,a._)`[${i}]`)}}n.else(),v(e),n.endIf(),n.if((0,a._)`${c} !== undefined`,()=>{n.assign(i,c),y(e,c)})}function y({gen:e,parentData:t,parentDataProperty:r},n){e.if((0,a._)`${t} !== undefined`,()=>e.assign((0,a._)`${t}[${r}]`,n))}function g(e,t,r,i=n.Correct){let o;let s=i===n.Correct?a.operators.EQ:a.operators.NEQ;switch(e){case"null":return(0,a._)`${t} ${s} null`;case"array":o=(0,a._)`Array.isArray(${t})`;break;case"object":o=(0,a._)`${t} && typeof ${t} == "object" && !Array.isArray(${t})`;break;case"integer":o=c((0,a._)`!(${t} % 1) && !isNaN(${t})`);break;case"number":o=c();break;default:return(0,a._)`typeof ${t} ${s} ${e}`}return i===n.Correct?o:(0,a.not)(o);function c(e=a.nil){return(0,a.and)((0,a._)`typeof ${t} == "number"`,e,r?(0,a._)`isFinite(${t})`:a.nil)}}function m(e,t,r,n){let i;if(1===e.length)return g(e[0],t,r,n);let o=(0,c.toHash)(e);if(o.array&&o.object){let e=(0,a._)`typeof ${t} != "object"`;i=o.null?e:(0,a._)`!${t} || ${e}`,delete o.null,delete o.array,delete o.object}else i=a.nil;for(let e in o.number&&delete o.integer,o)i=(0,a.and)(i,g(e,t,r,n));return i}t.checkDataType=g,t.checkDataTypes=m;let b={message:({schema:e})=>`must be ${e}`,params:({schema:e,schemaValue:t})=>"string"==typeof e?(0,a._)`{type: ${e}}`:(0,a._)`{type: ${t}}`};function v(e){let t=w(e);(0,s.reportError)(t,b)}function w(e){let{gen:t,data:r,schema:n}=e,i=(0,c.schemaRefOrVal)(e,n,"type");return{gen:t,keyword:"type",data:r,schema:n.type,schemaCode:i,schemaValue:i,parentSchema:n,params:{},it:e}}t.reportTypeError=v},93047:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.assignDefaults=void 0;let n=r(20012),i=r(67146);function o(e,t){let{properties:r,items:n}=e.schema;if("object"===t&&r)for(let t in r)s(e,t,r[t].default);else"array"===t&&Array.isArray(n)&&n.forEach((t,r)=>s(e,r,t.default))}function s(e,t,r){let{gen:o,compositeRule:s,data:a,opts:c}=e;if(void 0===r)return;let u=(0,n._)`${a}${(0,n.getProperty)(t)}`;if(s){(0,i.checkStrictMode)(e,`default is ignored for: ${u}`);return}let l=(0,n._)`${u} === undefined`;"empty"===c.useDefaults&&(l=(0,n._)`${l} || ${u} === null || ${u} === ""`),o.if(l,(0,n._)`${u} = ${(0,n.stringify)(r)}`)}t.assignDefaults=o},31843:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getData=t.KeywordCxt=t.validateFunctionCode=void 0;let n=r(65654),i=r(14233),o=r(30422),s=r(14233),a=r(93047),c=r(8440),u=r(97030),l=r(20012),d=r(78566),f=r(66250),h=r(67146),p=r(75701);function y(e){if(x(e)&&(I(e),S(e))){v(e);return}g(e,()=>(0,n.topBoolOrEmptySchema)(e))}function g({gen:e,validateName:t,schema:r,schemaEnv:n,opts:i},o){i.code.es5?e.func(t,(0,l._)`${d.default.data}, ${d.default.valCxt}`,n.$async,()=>{e.code((0,l._)`"use strict"; ${_(r,i)}`),b(e,i),e.code(o)}):e.func(t,(0,l._)`${d.default.data}, ${m(i)}`,n.$async,()=>e.code(_(r,i)).code(o))}function m(e){return(0,l._)`{${d.default.instancePath}="", ${d.default.parentData}, ${d.default.parentDataProperty}, ${d.default.rootData}=${d.default.data}${e.dynamicRef?(0,l._)`, ${d.default.dynamicAnchors}={}`:l.nil}}={}`}
34function b(e,t){e.if(d.default.valCxt,()=>{e.var(d.default.instancePath,(0,l._)`${d.default.valCxt}.${d.default.instancePath}`),e.var(d.default.parentData,(0,l._)`${d.default.valCxt}.${d.default.parentData}`),e.var(d.default.parentDataProperty,(0,l._)`${d.default.valCxt}.${d.default.parentDataProperty}`),e.var(d.default.rootData,(0,l._)`${d.default.valCxt}.${d.default.rootData}`),t.dynamicRef&&e.var(d.default.dynamicAnchors,(0,l._)`${d.default.valCxt}.${d.default.dynamicAnchors}`)},()=>{e.var(d.default.instancePath,(0,l._)`""`),e.var(d.default.parentData,(0,l._)`undefined`),e.var(d.default.parentDataProperty,(0,l._)`undefined`),e.var(d.default.rootData,d.default.data),t.dynamicRef&&e.var(d.default.dynamicAnchors,(0,l._)`{}`)})}function v(e){let{schema:t,opts:r,gen:n}=e;g(e,()=>{r.$comment&&t.$comment&&k(e),P(e),n.let(d.default.vErrors,null),n.let(d.default.errors,0),r.unevaluated&&w(e),O(e),C(e)})}function w(e){let{gen:t,validateName:r}=e;e.evaluated=t.const("evaluated",(0,l._)`${r}.evaluated`),t.if((0,l._)`${e.evaluated}.dynamicProps`,()=>t.assign((0,l._)`${e.evaluated}.props`,(0,l._)`undefined`)),t.if((0,l._)`${e.evaluated}.dynamicItems`,()=>t.assign((0,l._)`${e.evaluated}.items`,(0,l._)`undefined`))}function _(e,t){let r="object"==typeof e&&e[t.schemaId];return r&&(t.code.source||t.code.process)?(0,l._)`/*# sourceURL=${r} */`:l.nil}function E(e,t){if(x(e)&&(I(e),S(e))){A(e,t);return}(0,n.boolOrEmptySchema)(e,t)}function S({schema:e,self:t}){if("boolean"==typeof e)return!e;for(let r in e)if(t.RULES.all[r])return!0;return!1}function x(e){return"boolean"!=typeof e.schema}function A(e,t){let{schema:r,gen:n,opts:i}=e;i.$comment&&r.$comment&&k(e),M(e),N(e);let o=n.const("_errs",d.default.errors);O(e,o),n.var(t,(0,l._)`${o} === ${d.default.errors}`)}function I(e){(0,h.checkUnknownRules)(e),T(e)}function O(e,t){if(e.opts.jtd)return j(e,[],!1,t);let r=(0,i.getSchemaTypes)(e.schema),n=(0,i.coerceAndCheckDataType)(e,r);j(e,r,!n,t)}function T(e){let{schema:t,errSchemaPath:r,opts:n,self:i}=e;t.$ref&&n.ignoreKeywordsWithRef&&(0,h.schemaHasRulesButRef)(t,i.RULES)&&i.logger.warn(`$ref: keywords ignored in schema at path "${r}"`)}function P(e){let{schema:t,opts:r}=e;void 0!==t.default&&r.useDefaults&&r.strictSchema&&(0,h.checkStrictMode)(e,"default is ignored in the schema root")}function M(e){let t=e.schema[e.opts.schemaId];t&&(e.baseId=(0,f.resolveUrl)(e.opts.uriResolver,e.baseId,t))}function N(e){if(e.schema.$async&&!e.schemaEnv.$async)throw Error("async schema in sync schema")}function k({gen:e,schemaEnv:t,schema:r,errSchemaPath:n,opts:i}){let o=r.$comment;if(!0===i.$comment)e.code((0,l._)`${d.default.self}.logger.log(${o})`);else if("function"==typeof i.$comment){let r=(0,l.str)`${n}/$comment`,i=e.scopeValue("root",{ref:t.root});e.code((0,l._)`${d.default.self}.opts.$comment(${o}, ${r}, ${i}.schema)`)}}function C(e){let{gen:t,schemaEnv:r,validateName:n,ValidationError:i,opts:o}=e;r.$async?t.if((0,l._)`${d.default.errors} === 0`,()=>t.return(d.default.data),()=>t.throw((0,l._)`new ${i}(${d.default.vErrors})`)):(t.assign((0,l._)`${n}.errors`,d.default.vErrors),o.unevaluated&&D(e),t.return((0,l._)`${d.default.errors} === 0`))}function D({gen:e,evaluated:t,props:r,items:n}){r instanceof l.Name&&e.assign((0,l._)`${t}.props`,r),n instanceof l.Name&&e.assign((0,l._)`${t}.items`,n)}function j(e,t,r,n){let{gen:i,schema:a,data:c,allErrors:u,opts:f,self:p}=e,{RULES:y}=p;if(a.$ref&&(f.ignoreKeywordsWithRef||!(0,h.schemaHasRulesButRef)(a,y))){i.block(()=>V(e,"$ref",y.all.$ref.definition));return}function g(h){(0,o.shouldUseGroup)(a,h)&&(h.type?(i.if((0,s.checkDataType)(h.type,c,f.strictNumbers)),R(e,h),1===t.length&&t[0]===h.type&&r&&(i.else(),(0,s.reportTypeError)(e)),i.endIf()):R(e,h),u||i.if((0,l._)`${d.default.errors} === ${n||0}`))}f.jtd||L(e,t),i.block(()=>{for(let e of y.rules)g(e);g(y.post)})}function R(e,t){let{gen:r,schema:n,opts:{useDefaults:i}}=e;i&&(0,a.assignDefaults)(e,t.type),r.block(()=>{for(let r of t.rules)(0,o.shouldUseRule)(n,r)&&V(e,r.keyword,r.definition,t.type)})}function L(e,t){!e.schemaEnv.meta&&e.opts.strictTypes&&(B(e,t),e.opts.allowUnionTypes||U(e,t),$(e,e.dataTypes))}function B(e,t){if(t.length){if(!e.dataTypes.length){e.dataTypes=t;return}t.forEach(t=>{F(e.dataTypes,t)||z(e,`type "${t}" not allowed by context "${e.dataTypes.join(",")}"`)}),e.dataTypes=e.dataTypes.filter(e=>F(t,e))}}function U(e,t){t.length>1&&!(2===t.length&&t.includes("null"))&&z(e,"use allowUnionTypes to allow union type keyword")}function $(e,t){let r=e.self.RULES.all;for(let n in r){let i=r[n];if("object"==typeof i&&(0,o.shouldUseRule)(e.schema,i)){let{type:r}=i.definition;r.length&&!r.some(e=>K(t,e))&&z(e,`missing type "${r.join(",")}" for keyword "${n}"`)}}}function K(e,t){return e.includes(t)||"number"===t&&e.includes("integer")}function F(e,t){return e.includes(t)||"integer"===t&&e.includes("number")}function z(e,t){let r=e.schemaEnv.baseId+e.errSchemaPath;t+=` at "${r}
34" (strictTypes)`,(0,h.checkStrictMode)(e,t,e.opts.strictTypes)}t.validateFunctionCode=y;class q{constructor(e,t,r){if((0,c.validateKeywordUsage)(e,t,r),this.gen=e.gen,this.allErrors=e.allErrors,this.keyword=r,this.data=e.data,this.schema=e.schema[r],this.$data=t.$data&&e.opts.$data&&this.schema&&this.schema.$data,this.schemaValue=(0,h.schemaRefOrVal)(e,this.schema,r,this.$data),this.schemaType=t.schemaType,this.parentSchema=e.schema,this.params={},this.it=e,this.def=t,this.$data)this.schemaCode=e.gen.const("vSchema",W(this.$data,e));else if(this.schemaCode=this.schemaValue,!(0,c.validSchemaType)(this.schema,t.schemaType,t.allowUndefined))throw Error(`${r} value must be ${JSON.stringify(t.schemaType)}`);("code"in t?t.trackErrors:!1!==t.errors)&&(this.errsCount=e.gen.const("_errs",d.default.errors))}result(e,t,r){this.failResult((0,l.not)(e),t,r)}failResult(e,t,r){this.gen.if(e),r?r():this.error(),t?(this.gen.else(),t(),this.allErrors&&this.gen.endIf()):this.allErrors?this.gen.endIf():this.gen.else()}pass(e,t){this.failResult((0,l.not)(e),void 0,t)}fail(e){if(void 0===e){this.error(),this.allErrors||this.gen.if(!1);return}this.gen.if(e),this.error(),this.allErrors?this.gen.endIf():this.gen.else()}fail$data(e){if(!this.$data)return this.fail(e);let{schemaCode:t}=this;this.fail((0,l._)`${t} !== undefined && (${(0,l.or)(this.invalid$data(),e)})`)}error(e,t,r){if(t){this.setParams(t),this._error(e,r),this.setParams({});return}this._error(e,r)}_error(e,t){(e?p.reportExtraError:p.reportError)(this,this.def.error,t)}$dataError(){(0,p.reportError)(this,this.def.$dataError||p.keyword$DataError)}reset(){if(void 0===this.errsCount)throw Error('add "trackErrors" to keyword definition');(0,p.resetErrorsCount)(this.gen,this.errsCount)}ok(e){this.allErrors||this.gen.if(e)}setParams(e,t){t?Object.assign(this.params,e):this.params=e}block$data(e,t,r=l.nil){this.gen.block(()=>{this.check$data(e,r),t()})}check$data(e=l.nil,t=l.nil){if(!this.$data)return;let{gen:r,schemaCode:n,schemaType:i,def:o}=this;r.if((0,l.or)((0,l._)`${n} === undefined`,t)),e!==l.nil&&r.assign(e,!0),(i.length||o.validateSchema)&&(r.elseIf(this.invalid$data()),this.$dataError(),e!==l.nil&&r.assign(e,!1)),r.else()}invalid$data(){let{gen:e,schemaCode:t,schemaType:r,def:n,it:i}=this;return(0,l.or)(o(),a());function o(){if(r.length){if(!(t instanceof l.Name))throw Error("ajv implementation error");let e=Array.isArray(r)?r:[r];return(0,l._)`${(0,s.checkDataTypes)(e,t,i.opts.strictNumbers,s.DataType.Wrong)}`}return l.nil}function a(){if(n.validateSchema){let r=e.scopeValue("validate$data",{ref:n.validateSchema});return(0,l._)`!${r}(${t})`}return l.nil}}subschema(e,t){let r=(0,u.getSubschema)(this.it,e);(0,u.extendSubschemaData)(r,this.it,e),(0,u.extendSubschemaMode)(r,e);let n={...this.it,...r,items:void 0,props:void 0};return E(n,t),n}mergeEvaluated(e,t){let{it:r,gen:n}=this;r.opts.unevaluated&&(!0!==r.props&&void 0!==e.props&&(r.props=h.mergeEvaluated.props(n,e.props,r.props,t)),!0!==r.items&&void 0!==e.items&&(r.items=h.mergeEvaluated.items(n,e.items,r.items,t)))}mergeValidEvaluated(e,t){let{it:r,gen:n}=this;if(r.opts.unevaluated&&(!0!==r.props||!0!==r.items))return n.if(t,()=>this.mergeEvaluated(e,l.Name)),!0}}function V(e,t,r,n){let i=new q(e,r,t);"code"in r?r.code(i,n):i.$data&&r.validate?(0,c.funcKeywordCode)(i,r):"macro"in r?(0,c.macroKeywordCode)(i,r):(r.compile||r.validate)&&(0,c.funcKeywordCode)(i,r)}t.KeywordCxt=q;let H=/^\/(?:[^~]|~0|~1)*$/,G=/^([0-9]+)(#|\/(?:[^~]|~0|~1)*)?$/;function W(e,{dataLevel:t,dataNames:r,dataPathArr:n}){let i,o;if(""===e)return d.default.rootData;if("/"===e[0]){if(!H.test(e))throw Error(`Invalid JSON-pointer: ${e}`);i=e,o=d.default.rootData}else{let s=G.exec(e);if(!s)throw Error(`Invalid JSON-pointer: ${e}`);let c=+s[1];if("#"===(i=s[2])){if(c>=t)throw Error(a("property/index",c));return n[t-c]}if(c>t)throw Error(a("data",c));if(o=r[t-c],!i)return o}let s=o;for(let e of i.split("/"))e&&(o=(0,l._)`${o}${(0,l.getProperty)((0,h.unescapeJsonPointer)(e))}`,s=(0,l._)`${s} && ${o}`);return s;function a(e,r){return`Cannot access ${e} ${r} levels up, current level is ${t}`}}t.getData=W},8440:(e,t,r)=>{"use strict";
34Object.defineProperty(t,"__esModule",{value:!0}),t.validateKeywordUsage=t.validSchemaType=t.funcKeywordCode=t.macroKeywordCode=void 0;let n=r(20012),i=r(78566),o=r(98684),s=r(75701);function a(e,t){let{gen:r,keyword:i,schema:o,parentSchema:s,it:a}=e,c=t.macro.call(a.self,o,s,a),u=f(r,i,c);!1!==a.opts.validateSchema&&a.self.validateSchema(c,!0);let l=r.name("valid");e.subschema({schema:c,schemaPath:n.nil,errSchemaPath:`${a.errSchemaPath}/${i}`,topSchemaRef:u,compositeRule:!0},l),e.pass(l,()=>e.error(!0))}function c(e,t){var r;let{gen:s,keyword:a,schema:c,parentSchema:h,$data:p,it:y}=e;d(y,t);let g=f(s,a,!p&&t.compile?t.compile.call(y.self,c,h,y):t.validate),m=s.let("valid");function b(){if(!1===t.errors)_(),t.modifying&&u(e),E(()=>e.error());else{let r=t.async?v():w();t.modifying&&u(e),E(()=>l(e,r))}}function v(){let e=s.let("ruleErrs",null);return s.try(()=>_((0,n._)`await `),t=>s.assign(m,!1).if((0,n._)`${t} instanceof ${y.ValidationError}`,()=>s.assign(e,(0,n._)`${t}.errors`),()=>s.throw(t))),e}function w(){let e=(0,n._)`${g}.errors`;return s.assign(e,null),_(n.nil),e}function _(r=t.async?(0,n._)`await `:n.nil){let a=y.opts.passContext?i.default.this:i.default.self,c=!("compile"in t&&!p||!1===t.schema);s.assign(m,(0,n._)`${r}${(0,o.callValidateCode)(e,g,a,c)}`,t.modifying)}function E(e){var r;s.if((0,n.not)(null!==(r=t.valid)&&void 0!==r?r:m),e)}e.block$data(m,b),e.ok(null!==(r=t.valid)&&void 0!==r?r:m)}function u(e){let{gen:t,data:r,it:i}=e;t.if(i.parentData,()=>t.assign(r,(0,n._)`${i.parentData}[${i.parentDataProperty}]`))}function l(e,t){let{gen:r}=e;r.if((0,n._)`Array.isArray(${t})`,()=>{r.assign(i.default.vErrors,(0,n._)`${i.default.vErrors} === null ? ${t} : ${i.default.vErrors}.concat(${t})`).assign(i.default.errors,(0,n._)`${i.default.vErrors}.length`),(0,s.extendErrors)(e)},()=>e.error())}function d({schemaEnv:e},t){if(t.async&&!e.$async)throw Error("async keyword in sync schema")}function f(e,t,r){if(void 0===r)throw Error(`keyword "${t}" failed to compile`);return e.scopeValue("keyword","function"==typeof r?{ref:r}:{ref:r,code:(0,n.stringify)(r)})}function h(e,t,r=!1){return!t.length||t.some(t=>"array"===t?Array.isArray(e):"object"===t?e&&"object"==typeof e&&!Array.isArray(e):typeof e==t||r&&void 0===e)}function p({schema:e,opts:t,self:r,errSchemaPath:n},i,o){if(Array.isArray(i.keyword)?!i.keyword.includes(o):i.keyword!==o)throw Error("ajv implementation error");let s=i.dependencies;if(null==s?void 0:s.some(t=>!Object.prototype.hasOwnProperty.call(e,t)))throw Error(`parent schema must have dependencies of ${o}: ${s.join(",")}`);if(i.validateSchema&&!i.validateSchema(e[o])){let e=`keyword "${o}" value is invalid at path "${n}": `+r.errorsText(i.validateSchema.errors);if("log"===t.validateSchema)r.logger.error(e);else throw Error(e)}}t.macroKeywordCode=a,t.funcKeywordCode=c,t.validSchemaType=h,t.validateKeywordUsage=p},97030:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.extendSubschemaMode=t.extendSubschemaData=t.getSubschema=void 0;let n=r(20012),i=r(67146);function o(e,{keyword:t,schemaProp:r,schema:o,schemaPath:s,errSchemaPath:a,topSchemaRef:c}){if(void 0!==t&&void 0!==o)throw Error('both "keyword" and "schema" passed, only one allowed');if(void 0!==t){let o=e.schema[t];return void 0===r?{schema:o,schemaPath:(0,n._)`${e.schemaPath}${(0,n.getProperty)(t)}`,errSchemaPath:`${e.errSchemaPath}/${t}`}:{schema:o[r],schemaPath:(0,n._)`${e.schemaPath}${(0,n.getProperty)(t)}${(0,n.getProperty)(r)}`,errSchemaPath:`${e.errSchemaPath}/${t}/${(0,i.escapeFragment)(r)}`}}if(void 0!==o){if(void 0===s||void 0===a||void 0===c)throw Error('"schemaPath", "errSchemaPath" and "topSchemaRef" are required with "schema"');return{schema:o,schemaPath:s,topSchemaRef:c,errSchemaPath:a}}throw Error('either "keyword" or "schema" must be passed')}function s(e,t,{dataProp:r,dataPropType:o,data:s,dataTypes:a,propertyName:c}){if(void 0!==s&&void 0!==r)throw Error('both "data" and "dataProp" passed, only one allowed');let{gen:u}=t;if(void 0!==r){let{errorPath:s,dataPathArr:a,opts:c}=t;l(u.let("data",(0,n._)`${t.data}${(0,n.getProperty)(r)}`,!0)),e.errorPath=(0,n.str)`${s}${(0,i.getErrorPath)(r,o,c.jsPropertySyntax)}`,e.parentDataProperty=(0,n._)`${r}`,e.dataPathArr=[...a,e.parentDataProperty]}function l(r){e.data=r,e.dataLevel=t.dataLevel+1,e.dataTypes=[],t.definedProperties=new Set,e.parentData=t.data,e.dataNames=[...t.dataNames,r]}void 0!==s&&(l(s instanceof n.Name?s:u.let("data",s,!0)),void 0!==c&&(e.propertyName=c)),a&&(e.dataTypes=a)}function a(e,{jtdDiscriminator:t,jtdMetadata:r,compositeRule:n,createErrors:i,allErrors:o}){void 0!==n&&(e.compositeRule=n),void 0!==i&&(e.createErrors=i),void 0!==o&&(e.allErrors=o),e.jtdDiscriminator=t,e.jtdMetadata=r}t.getSubschema=o,t.extendSubschemaData=s,t.extendSubschemaMode=a},50179:(e,t,r)=>{"use strict";
34Object.defineProperty(t,"__esModule",{value:!0}),t.CodeGen=t.Name=t.nil=t.stringify=t.str=t._=t.KeywordCxt=void 0;var n=r(31843);Object.defineProperty(t,"KeywordCxt",{enumerable:!0,get:function(){return n.KeywordCxt}});var i=r(20012);Object.defineProperty(t,"_",{enumerable:!0,get:function(){return i._}}),Object.defineProperty(t,"str",{enumerable:!0,get:function(){return i.str}}),Object.defineProperty(t,"stringify",{enumerable:!0,get:function(){return i.stringify}}),Object.defineProperty(t,"nil",{enumerable:!0,get:function(){return i.nil}}),Object.defineProperty(t,"Name",{enumerable:!0,get:function(){return i.Name}}),Object.defineProperty(t,"CodeGen",{enumerable:!0,get:function(){return i.CodeGen}});let o=r(25575),s=r(40326),a=r(26285),c=r(96138),u=r(20012),l=r(66250),d=r(14233),f=r(67146),h=r(16091),p=r(8113),y=(e,t)=>new RegExp(e,t);y.code="new RegExp";let g=["removeAdditional","useDefaults","coerceTypes"],m=new Set(["validate","serialize","parse","wrapper","root","schema","keyword","pattern","formats","validate$data","func","obj","Error"]),b={errorDataPath:"",format:"`validateFormats: false` can be used instead.",nullable:'"nullable" keyword is supported by default.',jsonPointers:"Deprecated jsPropertySyntax can be used instead.",extendRefs:"Deprecated
34ignoreKeywordsWithRef can be used instead.",missingRefs:"Pass empty schema with $id that should be ignored to ajv.addSchema.",processCode:"Use option `code: {process: (code, schemaEnv: object) => string}`",sourceCode:"Use option `code: {source: true}`",strictDefaults:"It is default now, see option `strict`.",strictKeywords:"It is default now, see option `strict`.",uniqueItems:'"uniqueItems" keyword is always validated.',unknownFormats:"Disable strict mode or pass `true` to `ajv.addFormat` (or `formats` option).",cache:"Map is used as cache, schema object as key.",serialize:"Map is used as cache, schema object as key.",ajvErrors:"It is default now."},v={ignoreKeywordsWithRef:"",jsPropertySyntax:"",unicode:'"minLength"/"maxLength" account for unicode characters by default.'},w=200;function _(e){var t,r,n,i,o,s,a,c,u,l,d,f,h,g,m,b,v,_,E,S,x,A,I,O,T;let P=e.strict,M=null===(t=e.code)||void 0===t?void 0:t.optimize,N=!0===M||void 0===M?1:M||0,k=null!==(n=null===(r=e.code)||void 0===r?void 0:r.regExp)&&void 0!==n?n:y,C=null!==(i=e.uriResolver)&&void 0!==i?i:p.default;return{strictSchema:null===(s=null!==(o=e.strictSchema)&&void 0!==o?o:P)||void 0===s||s,strictNumbers:null===(c=null!==(a=e.strictNumbers)&&void 0!==a?a:P)||void 0===c||c,strictTypes:null!==(l=null!==(u=e.strictTypes)&&void 0!==u?u:P)&&void 0!==l?l:"log",strictTuples:null!==(f=null!==(d=e.strictTuples)&&void 0!==d?d:P)&&void 0!==f?f:"log",strictRequired:null!==(g=null!==(h=e.strictRequired)&&void 0!==h?h:P)&&void 0!==g&&g,code:e.code?{...e.code,optimize:N,regExp:k}:{optimize:N,regExp:k},loopRequired:null!==(m=e.loopRequired)&&void 0!==m?m:w,loopEnum:null!==(b=e.loopEnum)&&void 0!==b?b:w,meta:null===(v=e.meta)||void 0===v||v,messages:null===(_=e.messages)||void 0===_||_,inlineRefs:null===(E=e.inlineRefs)||void 0===E||E,schemaId:null!==(S=e.schemaId)&&void 0!==S?S:"$id",addUsedSchema:null===(x=e.addUsedSchema)||void 0===x||x,validateSchema:null===(A=e.validateSchema)||void 0===A||A,validateFormats:null===(I=e.validateFormats)||void 0===I||I,unicodeRegExp:null===(O=e.unicodeRegExp)||void 0===O||O,int32range:null===(T=e.int32range)||void 0===T||T,uriResolver:C}}class E{constructor(e={}){this.schemas={},this.refs={},this.formats={},this._compilations=new Set,this._loading={},this._cache=new Map,e=this.opts={...e,..._(e)};let{es5:t,lines:r}=this.opts.code;this.scope=new u.ValueScope({scope:{},prefixes:m,es5:t,lines:r}),this.logger=M(e.logger);let n=e.validateFormats;e.validateFormats=!1,this.RULES=(0,a.getRules)(),S.call(this,b,e,"NOT SUPPORTED"),S.call(this,v,e,"DEPRECATED","warn"),this._metaOpts=T.call(this),e.formats&&I.call(this),this._addVocabularies(),this._addDefaultMetaSchema(),e.keywords&&O.call(this,e.keywords),"object"==typeof e.meta&&this.addMetaSchema(e.meta),A.call(this),e.validateFormats=n}_addVocabularies(){this.addKeyword("$async")}_addDefaultMetaSchema(){let{$data:e,meta:t,schemaId:r}=this.opts,n=h;"id"===r&&((n={...h}).id=n.$id,delete n.$id),t&&e&&this.addMetaSchema(n,n[r],!1)}defaultMeta(){let{meta:e,schemaId:t}=this.opts;return this.opts.defaultMeta="object"==typeof e?e[t]||e:void 0}validate(e,t){let r;if("string"==typeof e){if(!(r=this.getSchema(e)))throw Error(`no schema with key or ref "${e}"`)}else r=this.compile(e);let n=r(t);return"$async"in r||(this.errors=r.errors),n}compile(e,t){let r=this._addSchema(e,t);return r.validate||this._compileSchemaEnv(r)}compileAsync(e,t){if("function"!=typeof this.opts.loadSchema)throw Error("options.loadSchema should be a function");let{loadSchema:r}=this.opts;return n.call(this,e,t);async function n(e,t){await i.call(this,e.$schema);let r=this._addSchema(e,t);return r.validate||o.call(this,r)}async function i(e){e&&!this.getSchema(e)&&await n.call(this,{$ref:e},!0)}async function o(e){try{return this._compileSchemaEnv(e)}catch(t){if(!(t instanceof s.default))throw t;return a.call(this,t),await c.call(this,t.missingSchema),o.call(this,e)}}function a({missingSchema:e,missingRef:t}){if(this.refs[e])throw Error(`AnySchema ${e} is loaded but ${t} cannot be resolved`)}async function c(e){let r=await u.call(this,e);this.refs[e]||await i.call(this,r.$schema),this.refs[e]||this.addSchema(r,e,t)}async function u(e){let t=this._loading[e];if(t)return t;try{return await (this._loading[e]=r(e))}finally{delete this._loading[e]}}}addSchema(e,t,r,n=this.opts.validateSchema){let i;
34if(Array.isArray(e)){for(let t of e)this.addSchema(t,void 0,r,n);return this}if("object"==typeof e){let{schemaId:t}=this.opts;if(void 0!==(i=e[t])&&"string"!=typeof i)throw Error(`schema ${t} must be string`)}return t=(0,l.normalizeId)(t||i),this._checkUnique(t),this.schemas[t]=this._addSchema(e,r,t,n,!0),this}addMetaSchema(e,t,r=this.opts.validateSchema){return this.addSchema(e,t,!0,r),this}validateSchema(e,t){let r;if("boolean"==typeof e)return!0;if(void 0!==(r=e.$schema)&&"string"!=typeof r)throw Error("$schema must be a string");if(!(r=r||this.opts.defaultMeta||this.defaultMeta()))return this.logger.warn("meta-schema not available"),this.errors=null,!0;let n=this.validate(r,e);if(!n&&t){let e="schema is invalid: "+this.errorsText();if("log"===this.opts.validateSchema)this.logger.error(e);else throw Error(e)}return n}getSchema(e){let t;for(;"string"==typeof(t=x.call(this,e));)e=t;if(void 0===t){let{schemaId:r}=this.opts,n=new c.SchemaEnv({schema:{},schemaId:r});if(!(t=c.resolveSchema.call(this,n,e)))return;this.refs[e]=t}return t.validate||this._compileSchemaEnv(t)}removeSchema(e){if(e instanceof RegExp)return this._removeAllSchemas(this.schemas,e),this._removeAllSchemas(this.refs,e),this;switch(typeof e){case"undefined":return this._removeAllSchemas(this.schemas),this._removeAllSchemas(this.refs),this._cache.clear(),this;case"string":{let t=x.call(this,e);return"object"==typeof t&&this._cache.delete(t.schema),delete this.schemas[e],delete this.refs[e],this}case"object":{let t=e;this._cache.delete(t);let r=e[this.opts.schemaId];return r&&(r=(0,l.normalizeId)(r),delete this.schemas[r],delete this.refs[r]),this}default:throw Error("ajv.removeSchema: invalid parameter")}}addVocabulary(e){for(let t of e)this.addKeyword(t);return this}addKeyword(e,t){let r;if("string"==typeof e)r=e,"object"==typeof t&&(this.logger.warn("these parameters are deprecated, see docs for addKeyword"),t.keyword=r);else if("object"==typeof e&&void 0===t){if(Array.isArray(r=(t=e).keyword)&&!r.length)throw Error("addKeywords: keyword must be string or non-empty array")}else throw Error("invalid addKeywords parameters");if(k.call(this,r,t),!t)return(0,f.eachItem)(r,e=>C.call(this,e)),this;j.call(this,t);let n={...t,type:(0,d.getJSONTypes)(t.type),schemaType:(0,d.getJSONTypes)(t.schemaType)};return(0,f.eachItem)(r,0===n.type.length?e=>C.call(this,e,n):e=>n.type.forEach(t=>C.call(this,e,n,t))),this}getKeyword(e){let t=this.RULES.all[e];return"object"==typeof t?t.definition:!!t}removeKeyword(e){let{RULES:t}=this;for(let r of(delete t.keywords[e],delete t.all[e],t.rules)){let t=r.rules.findIndex(t=>t.keyword===e);t>=0&&r.rules.splice(t,1)}return this}addFormat(e,t){return"string"==typeof t&&(t=new RegExp(t)),this.formats[e]=t,this}errorsText(e=this.errors,{separator:t=", ",dataVar:r="data"}={}){return e&&0!==e.length?e.map(e=>`${r}${e.instancePath} ${e.message}`).reduce((e,r)=>e+t+r):"No errors"}$dataMetaSchema(e,t){let r=this.RULES.all;for(let n of(e=JSON.parse(JSON.stringify(e)),t)){let t=n.split("/").slice(1),i=e;for(let e of t)i=i[e];for(let e in r){let t=r[e];if("object"!=typeof t)continue;let{$data:n}=t.definition,o=i[e];n&&o&&(i[e]=L(o))}}return e}_removeAllSchemas(e,t){for(let r in e){let n=e[r];(!t||t.test(r))&&("string"==typeof n?delete e[r]:n&&!n.meta&&(this._cache.delete(n.schema),delete e[r]))}}_addSchema(e,t,r,n=this.opts.validateSchema,i=this.opts.addUsedSchema){let o;let{schemaId:s}=this.opts;if("object"==typeof e)o=e[s];else{if(this.opts.jtd)throw Error("schema must be object");if("boolean"!=typeof e)throw Error("schema must be object or boolean")}let a=this._cache.get(e);if(void 0!==a)return a;r=(0,l.normalizeId)(o||r);let u=l.getSchemaRefs.call(this,e,r);return a=new c.SchemaEnv({schema:e,schemaId:s,meta:t,baseId:r,localRefs:u}),this._cache.set(a.schema,a),i&&!r.startsWith("#")&&(r&&this._checkUnique(r),this.refs[r]=a),n&&this.validateSchema(e,!0),a}_checkUnique(e){if(this.schemas[e]||this.refs[e])throw Error(`schema with key or id "${e}" already exists`)}_compileSchemaEnv(e){if(e.meta?this._compileMetaSchema(e):c.compileSchema.call(this,e),!e.validate)throw Error("ajv implementation error");return e.validate}_compileMetaSchema(e){let t=this.opts;this.opts=this._metaOpts;try{c.compileSchema.call(this,e)}finally{this.opts=t}}}function S(e,t,r,n="error"){for(let i in e){let o=i;o in t&&this.logger[n](`${r}: option ${i}. ${e[o]}`)}}function x(e){return e=(0,l.normalizeId)(e),this.schemas[e]||this.refs[e]}function A(){let e=this.opts.schemas;if(e){if(Array.isArray(e))this.addSchema(e);else for(let t in e)this.addSchema(e[t],t)}}function I(){for(let e in this.opts.formats){let t=this.opts.formats[e];t&&this.addFormat(e,t)}}function O(e){if(Array.isArray(e)){this.addVocabulary(e);return}for(let t in this.logger.warn("keywords option as map is deprecated, pass array"),e){let r=e[t];r.keyword||(r.keyword=t),this.addKeyword(r)}}function T(){let e={...this.opts};for(let t of g)delete e[t];return e}t.default=E,E.ValidationError=o.default,E.MissingRefError=s.default;let P={log(){},warn(){},error(){}};function M(e){if(!1===e)return P;if(void 0===e)return console;if(e.log&&e.warn&&e.error)return e;throw Error("logger must implement log, warn and error methods")}let N=/^[a-z_$][a-z0-9_$:-]*$/i;function k(e,t){let{RULES:r}=this;if((0,f.eachItem)(e,e=>{if(r.keywords[e])throw Error(`Keyword ${e} is already defined`);if(!N.test(e))throw Error(`Keyword ${e}
34 has invalid name`)}),t&&t.$data&&!("code"in t||"validate"in t))throw Error('$data keyword must have "code" or "validate" function')}function C(e,t,r){var n;let i=null==t?void 0:t.post;if(r&&i)throw Error('keyword with "post" flag cannot have "type"');let{RULES:o}=this,s=i?o.post:o.rules.find(({type:e})=>e===r);if(s||(s={type:r,rules:[]},o.rules.push(s)),o.keywords[e]=!0,!t)return;let a={keyword:e,definition:{...t,type:(0,d.getJSONTypes)(t.type),schemaType:(0,d.getJSONTypes)(t.schemaType)}};t.before?D.call(this,s,a,t.before):s.rules.push(a),o.all[e]=a,null===(n=t.implements)||void 0===n||n.forEach(e=>this.addKeyword(e))}function D(e,t,r){let n=e.rules.findIndex(e=>e.keyword===r);n>=0?e.rules.splice(n,0,t):(e.rules.push(t),this.logger.warn(`rule ${r} is not defined`))}function j(e){let{metaSchema:t}=e;void 0!==t&&(e.$data&&this.opts.$data&&(t=L(t)),e.validateSchema=this.compile(t,!0))}let R={$ref:"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#"};function L(e){return{anyOf:[e,R]}}},70659:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});let n=r(85979);n.code='require("ajv/dist/runtime/equal").default',t.default=n},44548:(e,t)=>{"use strict";function r(e){let t;let r=e.length,n=0,i=0;for(;i<r;)n++,(t=e.charCodeAt(i++))>=55296&&t<=56319&&i<r&&(64512&(t=e.charCodeAt(i)))==56320&&i++;return n}Object.defineProperty(t,"__esModule",{value:!0}),t.default=r,r.code='require("ajv/dist/runtime/ucs2length").default'},8113:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});let n=r(88073);n.code='require("ajv/dist/runtime/uri").default',t.default=n},25575:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});class r extends Error{constructor(e){super("validation failed"),this.errors=e,this.ajv=this.validation=!0}}t.default=r},9064:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.validateAdditionalItems=void 0;let n=r(20012),i=r(67146),o={keyword:"additionalItems",type:"array",schemaType:["boolean","object"],before:"uniqueItems",error:{message:({params:{len:e}})=>(0,n.str)`must NOT have more than ${e} items`,params:({params:{len:e}})=>(0,n._)`{limit: ${e}}`},code(e){let{parentSchema:t,it:r}=e,{items:n}=t;if(!Array.isArray(n)){(0,i.checkStrictMode)(r,'"additionalItems" is ignored when "items" is not an array of schemas');return}s(e,n)}};function s(e,t){let{gen:r,schema:o,data:s,keyword:a,it:c}=e;c.items=!0;let u=r.const("len",(0,n._)`${s}.length`);if(!1===o)e.setParams({len:t.length}),e.pass((0,n._)`${u} <= ${t.length}`);else if("object"==typeof o&&!(0,i.alwaysValidSchema)(c,o)){let i=r.var("valid",(0,n._)`${u} <= ${t.length}`);r.if((0,n.not)(i),()=>l(i)),e.ok(i)}function l(o){r.forRange("i",t.length,u,t=>{e.subschema({keyword:a,dataProp:t,dataPropType:i.Type.Num},o),c.allErrors||r.if((0,n.not)(o),()=>r.break())})}}t.validateAdditionalItems=s,t.default=o},49421:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});let n=r(98684),i=r(20012),o=r(78566),s=r(67146),a={keyword:"additionalProperties",type:["object"],schemaType:["boolean","object"],allowUndefined:!0,trackErrors:!0,error:{message:"must NOT have additional properties",params:({params:e})=>(0,i._)`{additionalProperty: ${e.additionalProperty}}`},code(e){let{gen:t,schema:r,parentSchema:a,data:c,errsCount:u,it:l}=e;if(!u)throw Error("ajv implementation error");let{allErrors:d,opts:f}=l;if(l.props=!0,"all"!==f.removeAdditional&&(0,s.alwaysValidSchema)(l,r))return;let h=(0,n.allSchemaProperties)(a.properties),p=(0,n.allSchemaProperties)(a.patternProperties);function y(r){let o;if(h.length>8){let e=(0,s.schemaRefOrVal)(l,a.properties,"properties");o=(0,n.isOwnProperty)(t,e,r)}else o=h.length?(0,i.or)(...h.map(e=>(0,i._)`${r} === ${e}`)):i.nil;return p.length&&(o=(0,i.or)(o,...p.map(t=>(0,i._)`${(0,n.usePattern)(e,t)}.test(${r})`))),(0,i.not)(o)}function g(e){t.code((0,i._)`delete ${c}[${e}]`)}function m(n){if("all"===f.removeAdditional||f.removeAdditional&&!1===r){g(n);return}if(!1===r){e.setParams({additionalProperty:n}),e.error(),d||t.break();return}if("object"==typeof r&&!(0,s.alwaysValidSchema)(l,r)){let r=t.name("valid");"failing"===f.removeAdditional?(b(n,r,!1),t.if((0,i.not)(r),()=>{e.reset(),g(n)})):(b(n,r),d||t.if((0,i.not)(r),()=>t.break()))}}function b(t,r,n){let i={keyword:"additionalProperties",dataProp:t,dataPropType:s.Type.Str};!1===n&&Object.assign(i,{compositeRule:!0,createErrors:!1,allErrors:!1}),e.subschema(i,r)}(function(){t.forIn("key",c,e=>{h.length||p.length?t.if(y(e),()=>m(e)):m(e)})})(),e.ok((0,i._)`${u} === ${o.default.errors}`)}};t.default=a},3077:(e,t,r)=>{"use strict";
34Object.defineProperty(t,"__esModule",{value:!0});let n=r(67146),i={keyword:"allOf",schemaType:"array",code(e){let{gen:t,schema:r,it:i}=e;if(!Array.isArray(r))throw Error("ajv implementation error");let o=t.name("valid");r.forEach((t,r)=>{if((0,n.alwaysValidSchema)(i,t))return;let s=e.subschema({keyword:"allOf",schemaProp:r},o);e.ok(o),e.mergeEvaluated(s)})}};t.default=i},62464:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});let n={keyword:"anyOf",schemaType:"array",trackErrors:!0,code:r(98684).validateUnion,error:{message:"must match a schema in anyOf"}};t.default=n},39148:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});let n=r(20012),i=r(67146),o={keyword:"contains",type:"array",schemaType:["object","boolean"],before:"uniqueItems",trackErrors:!0,error:{message:({params:{min:e,max:t}})=>void 0===t?(0,n.str)`must contain at least ${e} valid item(s)`:(0,n.str)`must contain at least ${e} and no more than ${t} valid item(s)`,params:({params:{min:e,max:t}})=>void 0===t?(0,n._)`{minContains: ${e}}`:(0,n._)`{minContains: ${e}, maxContains: ${t}}`},code(e){let t,r;let{gen:o,schema:s,parentSchema:a,data:c,it:u}=e,{minContains:l,maxContains:d}=a;u.opts.next?(t=void 0===l?1:l,r=d):t=1;let f=o.const("len",(0,n._)`${c}.length`);if(e.setParams({min:t,max:r}),void 0===r&&0===t){(0,i.checkStrictMode)(u,'"minContains" == 0 without "maxContains": "contains" keyword ignored');return}if(void 0!==r&&t>r){(0,i.checkStrictMode)(u,'"minContains" > "maxContains" is always invalid'),e.fail();return}if((0,i.alwaysValidSchema)(u,s)){let i=(0,n._)`${f} >= ${t}`;void 0!==r&&(i=(0,n._)`${i} && ${f} <= ${r}`),e.pass(i);return}u.items=!0;let h=o.name("valid");function p(){let e=o.name("_valid"),t=o.let("count",0);y(e,()=>o.if(e,()=>g(t)))}function y(t,r){o.forRange("i",0,f,n=>{e.subschema({keyword:"contains",dataProp:n,dataPropType:i.Type.Num,compositeRule:!0},t),r()})}function g(e){o.code((0,n._)`${e}++`),void 0===r?o.if((0,n._)`${e} >= ${t}`,()=>o.assign(h,!0).break()):(o.if((0,n._)`${e} > ${r}`,()=>o.assign(h,!1).break()),1===t?o.assign(h,!0):o.if((0,n._)`${e} >= ${t}`,()=>o.assign(h,!0)))}void 0===r&&1===t?y(h,()=>o.if(h,()=>o.break())):0===t?(o.let(h,!0),void 0!==r&&o.if((0,n._)`${c}.length > 0`,p)):(o.let(h,!1),p()),e.result(h,()=>e.reset())}};t.default=o},64600:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.validateSchemaDeps=t.validatePropertyDeps=t.error=void 0;let n=r(20012),i=r(67146),o=r(98684);t.error={message:({params:{property:e,depsCount:t,deps:r}})=>{let i=1===t?"property":"properties";return(0,n.str)`must have ${i} ${r} when property ${e} is present`},params:({params:{property:e,depsCount:t,deps:r,missingProperty:i}})=>(0,n._)`{property: ${e}, 35 missingProperty: ${i}, 36 depsCount: ${t}, 37 deps: ${r}}`};let s={keyword:"dependencies",type:"object",schemaType:"object",error:t.error,code(e){let[t,r]=a(e);c(e,t),u(e,r)}};function a({schema:e}){let t={},r={};for(let n in e)"__proto__"!==n&&((Array.isArray(e[n])?t:r)[n]=e[n]);return[t,r]}function c(e,t=e.schema){let{gen:r,data:i,it:s}=e;if(0===Object.keys(t).length)return;let a=r.let("missing");for(let c in t){let u=t[c];if(0===u.length)continue;let l=(0,o.propertyInData)(r,i,c,s.opts.ownProperties);e.setParams({property:c,depsCount:u.length,deps:u.join(", ")}),s.allErrors?r.if(l,()=>{for(let t of u)(0,o.checkReportMissingProp)(e,t)}):(r.if((0,n._)`${l} && (${(0,o.checkMissingProp)(e,u,a)})`),(0,o.reportMissingProp)(e,a),r.else())}}function u(e,t=e.schema){let{gen:r,data:n,keyword:s,it:a}=e,c=r.name("valid");for(let u in t)(0,i.alwaysValidSchema)(a,t[u])||(r.if((0,o.propertyInData)(r,n,u,a.opts.ownProperties),()=>{let t=e.subschema({keyword:s,schemaProp:u},c);e.mergeValidEvaluated(t,c)},()=>r.var(c,!0)),e.ok(c))}t.validatePropertyDeps=c,t.validateSchemaDeps=u,t.default=s},42774:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});let n=r(20012),i=r(67146),o={keyword:"if",schemaType:["object","boolean"],trackErrors:!0,error:{message:({params:e})=>(0,n.str)`must match "${e.ifClause}" schema`,params:({params:e})=>(0,n._)`{failingKeyword: ${e.ifClause}}`},code(e){let{gen:t,parentSchema:r,it:o}=e;void 0===r.then&&void 0===r.else&&(0,i.checkStrictMode)(o,'"if" without "then" and "else" is ignored');let a=s(o,"then"),c=s(o,"else");if(!a&&!c)return;let u=t.let("valid",!0),l=t.name("_valid");if(d(),e.reset(),a&&c){let r=t.let("ifClause");e.setParams({ifClause:r}),t.if(l,f("then",r),f("else",r))}else a?t.if(l,f("then")):t.if((0,n.not)(l),f("else"));function d(){let t=e.subschema({keyword:"if",compositeRule:!0,createErrors:!1,allErrors:!1},l);e.mergeEvaluated(t)}function f(r,i){return()=>{let o=e.subschema({keyword:r},l);t.assign(u,l),e.mergeValidEvaluated(o,u),i?t.assign(i,(0,n._)`${r}`):e.setParams({ifClause:r})}}e.pass(u,()=>e.error(!0))}};function s(e,t){let r=e.schema[t];return void 0!==r&&!(0,i.alwaysValidSchema)(e,r)}t.default=o},48083:(e,t,r)=>{"use strict";
37Object.defineProperty(t,"__esModule",{value:!0});let n=r(9064),i=r(23379),o=r(55191),s=r(7447),a=r(39148),c=r(64600),u=r(59056),l=r(49421),d=r(90588),f=r(11396),h=r(80074),p=r(62464),y=r(16698),g=r(3077),m=r(42774),b=r(5171);function v(e=!1){let t=[h.default,p.default,y.default,g.default,m.default,b.default,u.default,l.default,c.default,d.default,f.default];return e?t.push(i.default,s.default):t.push(n.default,o.default),t.push(a.default),t}t.default=v},55191:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.validateTuple=void 0;let n=r(20012),i=r(67146),o=r(98684),s={keyword:"items",type:"array",schemaType:["object","array","boolean"],before:"uniqueItems",code(e){let{schema:t,it:r}=e;if(Array.isArray(t))return a(e,"additionalItems",t);r.items=!0,(0,i.alwaysValidSchema)(r,t)||e.ok((0,o.validateArray)(e))}};function a(e,t,r=e.schema){let{gen:o,parentSchema:s,data:c,keyword:u,it:l}=e;h(s),l.opts.unevaluated&&r.length&&!0!==l.items&&(l.items=i.mergeEvaluated.items(o,r.length,l.items));let d=o.name("valid"),f=o.const("len",(0,n._)`${c}.length`);function h(e){let{opts:n,errSchemaPath:o}=l,s=r.length,a=s===e.minItems&&(s===e.maxItems||!1===e[t]);if(n.strictTuples&&!a){let e=`"${u}" is ${s}-tuple, but minItems or maxItems/${t} are not specified or different at path "${o}"`;(0,i.checkStrictMode)(l,e,n.strictTuples)}}r.forEach((t,r)=>{(0,i.alwaysValidSchema)(l,t)||(o.if((0,n._)`${f} > ${r}`,()=>e.subschema({keyword:u,schemaProp:r,dataProp:r},d)),e.ok(d))})}t.validateTuple=a,t.default=s},7447:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});let n=r(20012),i=r(67146),o=r(98684),s=r(9064),a={keyword:"items",type:"array",schemaType:["object","boolean"],before:"uniqueItems",error:{message:({params:{len:e}})=>(0,n.str)`must NOT have more than ${e} items`,params:({params:{len:e}})=>(0,n._)`{limit: ${e}}`},code(e){let{schema:t,parentSchema:r,it:n}=e,{prefixItems:a}=r;n.items=!0,(0,i.alwaysValidSchema)(n,t)||(a?(0,s.validateAdditionalItems)(e,a):e.ok((0,o.validateArray)(e)))}};t.default=a},80074:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});let n=r(67146),i={keyword:"not",schemaType:["object","boolean"],trackErrors:!0,code(e){let{gen:t,schema:r,it:i}=e;if((0,n.alwaysValidSchema)(i,r)){e.fail();return}let o=t.name("valid");e.subschema({keyword:"not",compositeRule:!0,createErrors:!1,allErrors:!1},o),e.failResult(o,()=>e.reset(),()=>e.error())},error:{message:"must NOT be valid"}};t.default=i},16698:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});let n=r(20012),i=r(67146),o={keyword:"oneOf",schemaType:"array",trackErrors:!0,error:{message:"must match exactly one schema in oneOf",params:({params:e})=>(0,n._)`{passingSchemas: ${e.passing}}`},code(e){let{gen:t,schema:r,parentSchema:o,it:s}=e;if(!Array.isArray(r))throw Error("ajv implementation error");if(s.opts.discriminator&&o.discriminator)return;let a=r,c=t.let("valid",!1),u=t.let("passing",null),l=t.name("_valid");function d(){a.forEach((r,o)=>{let a;(0,i.alwaysValidSchema)(s,r)?t.var(l,!0):a=e.subschema({keyword:"oneOf",schemaProp:o,compositeRule:!0},l),o>0&&t.if((0,n._)`${l} && ${c}`).assign(c,!1).assign(u,(0,n._)`[${u}, ${o}]`).else(),t.if(l,()=>{t.assign(c,!0),t.assign(u,o),a&&e.mergeEvaluated(a,n.Name)})})}e.setParams({passing:u}),t.block(d),e.result(c,()=>e.reset(),()=>e.error(!0))}};t.default=o},11396:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});let n=r(98684),i=r(20012),o=r(67146),s=r(67146),a={keyword:"patternProperties",type:"object",schemaType:"object",code(e){let{gen:t,schema:r,data:a,parentSchema:c,it:u}=e,{opts:l}=u,d=(0,n.allSchemaProperties)(r),f=d.filter(e=>(0,o.alwaysValidSchema)(u,r[e]));if(0===d.length||f.length===d.length&&(!u.opts.unevaluated||!0===u.props))return;let h=l.strictSchema&&!l.allowMatchingProperties&&c.properties,p=t.name("valid");!0===u.props||u.props instanceof i.Name||(u.props=(0,s.evaluatedPropsToName)(t,u.props));let{props:y}=u;function g(e){for(let t in h)new RegExp(e).test(t)&&(0,o.checkStrictMode)(u,`property ${t} matches pattern ${e} (use allowMatchingProperties)`)}function m(r){t.forIn("key",a,o=>{t.if((0,i._)`${(0,n.usePattern)(e,r)}.test(${o})`,()=>{let n=f.includes(r);n||e.subschema({keyword:"patternProperties",schemaProp:r,dataProp:o,dataPropType:s.Type.Str},p),u.opts.unevaluated&&!0!==y?t.assign((0,i._)`${y}[${o}]`,!0):n||u.allErrors||t.if((0,i.not)(p),()=>t.break())})})}!function(){for(let e of d)h&&g(e),u.allErrors?m(e):(t.var(p,!0),m(e),t.if(p))}()}};t.default=a},23379:(e,t,r)=>{"use strict";
37Object.defineProperty(t,"__esModule",{value:!0});let n=r(55191),i={keyword:"prefixItems",type:"array",schemaType:["array"],before:"uniqueItems",code:e=>(0,n.validateTuple)(e,"items")};t.default=i},90588:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});let n=r(31843),i=r(98684),o=r(67146),s=r(49421),a={keyword:"properties",type:"object",schemaType:"object",code(e){let{gen:t,schema:r,parentSchema:a,data:c,it:u}=e;"all"===u.opts.removeAdditional&&void 0===a.additionalProperties&&s.default.code(new n.KeywordCxt(u,s.default,"additionalProperties"));let l=(0,i.allSchemaProperties)(r);for(let e of l)u.definedProperties.add(e);u.opts.unevaluated&&l.length&&!0!==u.props&&(u.props=o.mergeEvaluated.props(t,(0,o.toHash)(l),u.props));let d=l.filter(e=>!(0,o.alwaysValidSchema)(u,r[e]));if(0===d.length)return;let f=t.name("valid");for(let r of d)h(r)?p(r):(t.if((0,i.propertyInData)(t,c,r,u.opts.ownProperties)),p(r),u.allErrors||t.else().var(f,!0),t.endIf()),e.it.definedProperties.add(r),e.ok(f);function h(e){return u.opts.useDefaults&&!u.compositeRule&&void 0!==r[e].default}function p(t){e.subschema({keyword:"properties",schemaProp:t,dataProp:t},f)}}};t.default=a},59056:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});let n=r(20012),i=r(67146),o={keyword:"propertyNames",type:"object",schemaType:["object","boolean"],error:{message:"property name must be valid",params:({params:e})=>(0,n._)`{propertyName: ${e.propertyName}}`}
37,code(e){let{gen:t,schema:r,data:o,it:s}=e;if((0,i.alwaysValidSchema)(s,r))return;let a=t.name("valid");t.forIn("key",o,r=>{e.setParams({propertyName:r}),e.subschema({keyword:"propertyNames",data:r,dataTypes:["string"],propertyName:r,compositeRule:!0},a),t.if((0,n.not)(a),()=>{e.error(!0),s.allErrors||t.break()})}),e.ok(a)}};t.default=o},5171:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});let n=r(67146),i={keyword:["then","else"],schemaType:["object","boolean"],code({keyword:e,parentSchema:t,it:r}){void 0===t.if&&(0,n.checkStrictMode)(r,`"${e}" without "if" is ignored`)}};t.default=i},98684:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.validateUnion=t.validateArray=t.usePattern=t.callValidateCode=t.schemaProperties=t.allSchemaProperties=t.noPropertyInData=t.propertyInData=t.isOwnProperty=t.hasPropFunc=t.reportMissingProp=t.checkMissingProp=t.checkReportMissingProp=void 0;let n=r(20012),i=r(67146),o=r(78566),s=r(67146);function a(e,t){let{gen:r,data:i,it:o}=e;r.if(h(r,i,t,o.opts.ownProperties),()=>{e.setParams({missingProperty:(0,n._)`${t}`},!0),e.error()})}function c({gen:e,data:t,it:{opts:r}},i,o){return(0,n.or)(...i.map(i=>(0,n.and)(h(e,t,i,r.ownProperties),(0,n._)`${o} = ${i}`)))}function u(e,t){e.setParams({missingProperty:t},!0),e.error()}function l(e){return e.scopeValue("func",{ref:Object.prototype.hasOwnProperty,code:(0,n._)`Object.prototype.hasOwnProperty`})}function d(e,t,r){return(0,n._)`${l(e)}.call(${t}, ${r})`}function f(e,t,r,i){let o=(0,n._)`${t}${(0,n.getProperty)(r)} !== undefined`;return i?(0,n._)`${o} && ${d(e,t,r)}`:o}function h(e,t,r,i){let o=(0,n._)`${t}${(0,n.getProperty)(r)} === undefined`;return i?(0,n.or)(o,(0,n.not)(d(e,t,r))):o}function p(e){return e?Object.keys(e).filter(e=>"__proto__"!==e):[]}function y(e,t){return p(t).filter(r=>!(0,i.alwaysValidSchema)(e,t[r]))}function g({schemaCode:e,data:t,it:{gen:r,topSchemaRef:i,schemaPath:s,errorPath:a},it:c},u,l,d){let f=d?(0,n._)`${e}, ${t}, ${i}${s}`:t,h=[[o.default.instancePath,(0,n.strConcat)(o.default.instancePath,a)],[o.default.parentData,c.parentData],[o.default.parentDataProperty,c.parentDataProperty],[o.default.rootData,o.default.rootData]];c.opts.dynamicRef&&h.push([o.default.dynamicAnchors,o.default.dynamicAnchors]);let p=(0,n._)`${f}, ${r.object(...h)}`;return l!==n.nil?(0,n._)`${u}.call(${l}, ${p})`:(0,n._)`${u}(${p})`}t.checkReportMissingProp=a,t.checkMissingProp=c,t.reportMissingProp=u,t.hasPropFunc=l,t.isOwnProperty=d,t.propertyInData=f,t.noPropertyInData=h,t.allSchemaProperties=p,t.schemaProperties=y,t.callValidateCode=g;let m=(0,n._)`new RegExp`;function b({gen:e,it:{opts:t}},r){let i=t.unicodeRegExp?"u":"",{regExp:o}=t.code,a=o(r,i);return e.scopeValue("pattern",{key:a.toString(),ref:a,code:(0,n._)`${"new RegExp"===o.code?m:(0,s.useFunc)(e,o)}(${r}, ${i})`})}function v(e){let{gen:t,data:r,keyword:o,it:s}=e,a=t.name("valid");if(s.allErrors){let e=t.let("valid",!0);return c(()=>t.assign(e,!1)),e}return t.var(a,!0),c(()=>t.break()),a;function c(s){let c=t.const("len",(0,n._)`${r}.length`);t.forRange("i",0,c,r=>{e.subschema({keyword:o,dataProp:r,dataPropType:i.Type.Num},a),t.if((0,n.not)(a),s)})}}function w(e){let{gen:t,schema:r,keyword:o,it:s}=e;if(!Array.isArray(r))throw Error("ajv implementation error");if(r.some(e=>(0,i.alwaysValidSchema)(s,e))&&!s.opts.unevaluated)return;let a=t.let("valid",!1),c=t.name("_valid");t.block(()=>r.forEach((r,i)=>{let s=e.subschema({keyword:o,schemaProp:i,compositeRule:!0},c);t.assign(a,(0,n._)`${a} || ${c}`),e.mergeValidEvaluated(s,c)||t.if((0,n.not)(a))})),e.result(a,()=>e.reset(),()=>e.error(!0))}t.usePattern=b,t.validateArray=v,t.validateUnion=w},15950:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});let r={keyword:"id",code(){throw Error('NOT SUPPORTED: keyword "id", use "$id" for schema ID')}};t.default=r},35841:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});let n=r(15950),i=r(99204),o=["$schema","$id","$defs","$vocabulary",{keyword:"$comment"},"definitions",n.default,i.default];t.default=o},99204:(e,t,r)=>{"use strict";
37Object.defineProperty(t,"__esModule",{value:!0}),t.callRef=t.getValidate=void 0;let n=r(40326),i=r(98684),o=r(20012),s=r(78566),a=r(96138),c=r(67146),u={keyword:"$ref",schemaType:"string",code(e){let{gen:t,schema:r,it:i}=e,{baseId:s,schemaEnv:c,validateName:u,opts:f,self:h}=i,{root:p}=c;if(("#"===r||"#/"===r)&&s===p.baseId)return g();let y=a.resolveRef.call(h,p,s,r);if(void 0===y)throw new n.default(i.opts.uriResolver,s,r);if(y instanceof a.SchemaEnv)return m(y);return b(y);function g(){if(c===p)return d(e,u,c,c.$async);let r=t.scopeValue("root",{ref:p});return d(e,(0,o._)`${r}.validate`,p,p.$async)}function m(t){let r=l(e,t);d(e,r,t,t.$async)}function b(n){let i=t.scopeValue("schema",!0===f.code.source?{ref:n,code:(0,o.stringify)(n)}:{ref:n}),s=t.name("valid"),a=e.subschema({schema:n,dataTypes:[],schemaPath:o.nil,topSchemaRef:i,errSchemaPath:r},s);e.mergeEvaluated(a),e.ok(s)}}};function l(e,t){let{gen:r}=e;return t.validate?r.scopeValue("validate",{ref:t.validate}):(0,o._)`${r.scopeValue("wrapper",{ref:t})}.validate`}function d(e,t,r,n){let{gen:a,it:u}=e,{allErrors:l,schemaEnv:d,opts:f}=u,h=f.passContext?s.default.this:o.nil;function p(){if(!d.$async)throw Error("async schema referenced by sync schema");let r=a.let("valid");a.try(()=>{a.code((0,o._)`await ${(0,i.callValidateCode)(e,t,h)}`),m(t),l||a.assign(r,!0)},e=>{a.if((0,o._)`!(${e} instanceof ${u.ValidationError})`,()=>a.throw(e)),g(e),l||a.assign(r,!1)}),e.ok(r)}function y(){e.result((0,i.callValidateCode)(e,t,h),()=>m(t),()=>g(t))}function g(e){let t=(0,o._)`${e}.errors`;a.assign(s.default.vErrors,(0,o._)`${s.default.vErrors} === null ? ${t} : ${s.default.vErrors}.concat(${t})`),a.assign(s.default.errors,(0,o._)`${s.default.vErrors}.length`)}function m(e){var t;if(!u.opts.unevaluated)return;let n=null===(t=null==r?void 0:r.validate)||void 0===t?void 0:t.evaluated;if(!0!==u.props){if(n&&!n.dynamicProps)void 0!==n.props&&(u.props=c.mergeEvaluated.props(a,n.props,u.props));else{let t=a.var("props",(0,o._)`${e}.evaluated.props`);u.props=c.mergeEvaluated.props(a,t,u.props,o.Name)}}if(!0!==u.items){if(n&&!n.dynamicItems)void 0!==n.items&&(u.items=c.mergeEvaluated.items(a,n.items,u.items));else{let t=a.var("items",(0,o._)`${e}.evaluated.items`);u.items=c.mergeEvaluated.items(a,t,u.items,o.Name)}}}n?p():y()}t.getValidate=l,t.callRef=d,t.default=u},71724:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});let n=r(20012),i=r(61149),o=r(96138),s=r(67146),a={keyword:"discriminator",type:"object",schemaType:"object",error:{message:({params:{discrError:e,tagName:t}})=>e===i.DiscrError.Tag?`tag "${t}" must be string`:`value of tag "${t}" must be in oneOf`,params:({params:{discrError:e,tag:t,tagName:r}})=>(0,n._)`{error: ${e}, tag: ${r}, tagValue: ${t}}`},code(e){let{gen:t,data:r,schema:a,parentSchema:c,it:u}=e,{oneOf:l}=c;if(!u.opts.discriminator)throw Error("discriminator: requires discriminator option");let d=a.propertyName;if("string"!=typeof d)throw Error("discriminator: requires propertyName");if(a.mapping)throw Error("discriminator: mapping is not supported");if(!l)throw Error("discriminator: requires oneOf keyword");let f=t.let("valid",!1),h=t.const("tag",(0,n._)`${r}${(0,n.getProperty)(d)}`);function p(){let r=g();for(let e in t.if(!1),r)t.elseIf((0,n._)`${h} === ${e}`),t.assign(f,y(r[e]));t.else(),e.error(!1,{discrError:i.DiscrError.Mapping,tag:h,tagName:d}),t.endIf()}function y(r){let i=t.name("valid"),o=e.subschema({keyword:"oneOf",schemaProp:r},i);return e.mergeEvaluated(o,n.Name),i}function g(){var e;let t={},r=i(c),n=!0;for(let t=0;t<l.length;t++){let c=l[t];(null==c?void 0:c.$ref)&&!(0,s.schemaHasRulesButRef)(c,u.self.RULES)&&(c=o.resolveRef.call(u.self,u.schemaEnv.root,u.baseId,null==c?void 0:c.$ref))instanceof o.SchemaEnv&&(c=c.schema);let f=null===(e=null==c?void 0:c.properties)||void 0===e?void 0:e[d];if("object"!=typeof f)throw Error(`discriminator: oneOf subschemas (or referenced schemas) must have "properties/${d}"`);n=n&&(r||i(c)),a(f,t)}if(!n)throw Error(`discriminator: "${d}" must be required`);return t;function i({required:e}){return Array.isArray(e)&&e.includes(d)}function a(e,t){if(e.const)f(e.const,t);else if(e.enum)for(let r of e.enum)f(r,t);else throw Error(`discriminator: "properties/${d}" must have "const" or "enum"`)}function f(e,r){if("string"!=typeof e||e in t)throw Error(`discriminator: "${d}" values must be unique strings`);t[e]=r}}
37t.if((0,n._)`typeof ${h} == "string"`,()=>p(),()=>e.error(!1,{discrError:i.DiscrError.Tag,tag:h,tagName:d})),e.ok(f)}};t.default=a},61149:(e,t)=>{"use strict";var r;Object.defineProperty(t,"__esModule",{value:!0}),t.DiscrError=void 0,function(e){e.Tag="tag",e.Mapping="mapping"}(r=t.DiscrError||(t.DiscrError={}))},28113:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});let n=r(35841),i=r(95749),o=r(48083),s=r(28109),a=r(1224),c=[n.default,i.default,(0,o.default)(),s.default,a.metadataVocabulary,a.contentVocabulary];t.default=c},57792:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});let n=r(20012),i={keyword:"format",type:["number","string"],schemaType:"string",$data:!0,error:{message:({schemaCode:e})=>(0,n.str)`must match format "${e}"`,params:({schemaCode:e})=>(0,n._)`{format: ${e}}`},code(e,t){let{gen:r,data:i,$data:o,schema:s,schemaCode:a,it:c}=e,{opts:u,errSchemaPath:l,schemaEnv:d,self:f}=c;function h(){let o=r.scopeValue("formats",{ref:f.formats,code:u.code.formats}),s=r.const("fDef",(0,n._)`${o}[${a}]`),c=r.let("fType"),l=r.let("format");function h(){return!1===u.strictSchema?n.nil:(0,n._)`${a} && !${l}`}function p(){let e=d.$async?(0,n._)`(${s}.async ? await ${l}(${i}) : ${l}(${i}))`:(0,n._)`${l}(${i})`,r=(0,n._)`(typeof ${l} == "function" ? ${e} : ${l}.test(${i}))`;return(0,n._)`${l} && ${l} !== true && ${c} === ${t} && !${r}`}r.if((0,n._)`typeof ${s} == "object" && !(${s} instanceof RegExp)`,()=>r.assign(c,(0,n._)`${s}.type || "string"`).assign(l,(0,n._)`${s}.validate`),()=>r.assign(c,(0,n._)`"string"`).assign(l,s)),e.fail$data((0,n.or)(h(),p()))}function p(){let o=f.formats[s];if(!o){p();return}if(!0===o)return;let[a,c,h]=y(o);function p(){if(!1===u.strictSchema){f.logger.warn(e());return}throw Error(e());function e(){return`unknown format "${s}" ignored in schema at path "${l}"`}}function y(e){let t=e instanceof RegExp?(0,n.regexpCode)(e):u.code.formats?(0,n._)`${u.code.formats}${(0,n.getProperty)(s)}`:void 0,i=r.scopeValue("formats",{key:s,ref:e,code:t});return"object"!=typeof e||e instanceof RegExp?["string",e,i]:[e.type||"string",e.validate,(0,n._)`${i}.validate`]}function g(){if("object"==typeof o&&!(o instanceof RegExp)&&o.async){if(!d.$async)throw Error("async format in sync schema");return(0,n._)`await ${h}(${i})`}return"function"==typeof c?(0,n._)`${h}(${i})`:(0,n._)`${h}.test(${i})`}a===t&&e.pass(g())}u.validateFormats&&(o?h():p())}};t.default=i},28109:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});let n=[r(57792).default];t.default=n},1224:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.contentVocabulary=t.metadataVocabulary=void 0,t.metadataVocabulary=["title","description","default","deprecated","readOnly","writeOnly","examples"],t.contentVocabulary=["contentMediaType","contentEncoding","contentSchema"]},18606:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});let n=r(20012),i=r(67146),o=r(70659),s={keyword:"const",$data:!0,error:{message:"must be equal to constant",params:({schemaCode:e})=>(0,n._)`{allowedValue: ${e}}`},code(e){let{gen:t,data:r,$data:s,schemaCode:a,schema:c}=e;s||c&&"object"==typeof c?e.fail$data((0,n._)`!${(0,i.useFunc)(t,o.default)}(${r}, ${a})`):e.fail((0,n._)`${c} !== ${r}`)}};t.default=s},23634:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});let n=r(20012),i=r(67146),o=r(70659),s={keyword:"enum",schemaType:"array",$data:!0,error:{message:"must be equal to one of the allowed values",params:({schemaCode:e})=>(0,n._)`{allowedValues: ${e}}`},code(e){let t,r;let{gen:s,data:a,$data:c,schema:u,schemaCode:l,it:d}=e;if(!c&&0===u.length)throw Error("enum must have non-empty array");let f=u.length>=d.opts.loopEnum,h=()=>null!=t?t:t=(0,i.useFunc)(s,o.default);if(f||c)r=s.let("valid"),e.block$data(r,p);else{if(!Array.isArray(u))throw Error("ajv implementation error");let e=s.const("vSchema",l);r=(0,n.or)(...u.map((t,r)=>y(e,r)))}function p(){s.assign(r,!1),s.forOf("v",l,e=>s.if((0,n._)`${h()}(${a}, ${e})`,()=>s.assign(r,!0).break()))}function y(e,t){let r=u[t];return"object"==typeof r&&null!==r?(0,n._)`${h()}(${a}, ${e}[${t}])`:(0,n._)`${a} === ${r}`}e.pass(r)}};t.default=s},95749:(e,t,r)=>{"use strict";
37Object.defineProperty(t,"__esModule",{value:!0});let n=r(43387),i=r(41102),o=r(25218),s=r(8703),a=r(48759),c=r(52386),u=r(47418),l=r(87320),d=r(18606),f=r(23634),h=[n.default,i.default,o.default,s.default,a.default,c.default,u.default,l.default,{keyword:"type",schemaType:["string","array"]},{keyword:"nullable",schemaType:"boolean"},d.default,f.default];t.default=h},47418:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});let n=r(20012),i={keyword:["maxItems","minItems"],type:"array",schemaType:"number",$data:!0,error:{message({keyword:e,schemaCode:t}){let r="maxItems"===e?"more":"fewer";return(0,n.str)`must NOT have ${r} than ${t} items`},params:({schemaCode:e})=>(0,n._)`{limit: ${e}}`},code(e){let{keyword:t,data:r,schemaCode:i}=e,o="maxItems"===t?n.operators.GT:n.operators.LT;e.fail$data((0,n._)`${r}.length ${o} ${i}`)}};t.default=i},25218:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});let n=r(20012),i=r(67146),o=r(44548),s={keyword:["maxLength","minLength"],type:"string",schemaType:"number",$data:!0,error:{message({keyword:e,schemaCode:t}){let r="maxLength"===e?"more":"fewer";return(0,n.str)`must NOT have ${r} than ${t} characters`},params:({schemaCode:e})=>(0,n._)`{limit: ${e}}`},code(e){let{keyword:t,data:r,schemaCode:s,it:a}=e,c="maxLength"===t?n.operators.GT:n.operators.LT,u=!1===a.opts.unicode?(0,n._)`${r}.length`:(0,n._)`${(0,i.useFunc)(e.gen,o.default)}(${r})`;e.fail$data((0,n._)`${u} ${c} ${s}`)}};t.default=s},43387:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});let n=r(20012),i=n.operators,o={maximum:{okStr:"<=",ok:i.LTE,fail:i.GT},minimum:{okStr:">=",ok:i.GTE,fail:i.LT},exclusiveMaximum:{okStr:"<",ok:i.LT,fail:i.GTE},exclusiveMinimum:{okStr:">",ok:i.GT,fail:i.LTE}},s={message:({keyword:e,schemaCode:t})=>(0,n.str)`must be ${o[e].okStr} ${t}`,params:({keyword:e,schemaCode:t})=>(0,n._)`{comparison: ${o[e].okStr}, limit: ${t}}`},a={keyword:Object.keys(o),type:"number",schemaType:"number",$data:!0,error:s,code(e){let{keyword:t,data:r,schemaCode:i}=e;e.fail$data((0,n._)`${r} ${o[t].fail} ${i} || isNaN(${r})`)}};t.default=a},48759:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});let n=r(20012),i={keyword:["maxProperties","minProperties"],type:"object",schemaType:"number",$data:!0,error:{message({keyword:e,schemaCode:t}){let r="maxProperties"===e?"more":"fewer";return(0,n.str)`must NOT have ${r} than ${t} properties`},params:({schemaCode:e})=>(0,n._)`{limit: ${e}}`},code(e){let{keyword:t,data:r,schemaCode:i}=e,o="maxProperties"===t?n.operators.GT:n.operators.LT;e.fail$data((0,n._)`Object.keys(${r}).length ${o} ${i}`)}};t.default=i},41102:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});let n=r(20012),i={keyword:"multipleOf",type:"number",schemaType:"number",$data:!0,error:{message:({schemaCode:e})=>(0,n.str)`must be multiple of ${e}`,params:({schemaCode:e})=>(0,n._)`{multipleOf: ${e}}`},code(e){let{gen:t,data:r,schemaCode:i,it:o}=e,s=o.opts.multipleOfPrecision,a=t.let("res"),c=s?(0,n._)`Math.abs(Math.round(${a}) - ${a}) > 1e-${s}`:(0,n._)`${a} !== parseInt(${a})`;e.fail$data((0,n._)`(${i} === 0 || (${a} = ${r}/${i}, ${c}))`)}};t.default=i},8703:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});let n=r(98684),i=r(20012),o={keyword:"pattern",type:"string",schemaType:"string",$data:!0,error:{message:({schemaCode:e})=>(0,i.str)`must match pattern "${e}"`,params:({schemaCode:e})=>(0,i._)`{pattern: ${e}}`},code(e){let{data:t,$data:r,schema:o,schemaCode:s,it:a}=e,c=a.opts.unicodeRegExp?"u":"",u=r?(0,i._)`(new RegExp(${s}, ${c}))`:(0,n.usePattern)(e,o);e.fail$data((0,i._)`!${u}.test(${t})`)}};t.default=o},52386:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});let n=r(98684),i=r(20012),o=r(67146),s={keyword:"required",type:"object",schemaType:"array",$data:!0,error:{message:({params:{missingProperty:e}})=>(0,i.str)`must have required property '${e}'`,params:({params:{missingProperty:e}})=>(0,i._)`{missingProperty: ${e}}`},code(e){let{gen:t,schema:r,schemaCode:s,data:a,$data:c,it:u}=e,{opts:l}=u;if(!c&&0===r.length)return;let d=r.length>=l.loopRequired;if(u.allErrors?f():h(),l.strictRequired){let t=e.parentSchema.properties,{definedProperties:n}=e.it;for(let e of r)if((null==t?void 0:t[e])===void 0&&!n.has(e)){let t=u.schemaEnv.baseId+u.errSchemaPath,r=`required property "${e}" is not defined at "${t}" (strictRequired)`;(0,o.checkStrictMode)(u,r,u.opts.strictRequired)}}function f(){if(d||c)e.block$data(i.nil,p);else for(let t of r)(0,n.checkReportMissingProp)(e,t)}function h(){let i=t.let("missing");if(d||c){let r=t.let("valid",!0);e.block$data(r,()=>y(i,r)),e.ok(r)}
37else t.if((0,n.checkMissingProp)(e,r,i)),(0,n.reportMissingProp)(e,i),t.else()}function p(){t.forOf("prop",s,r=>{e.setParams({missingProperty:r}),t.if((0,n.noPropertyInData)(t,a,r,l.ownProperties),()=>e.error())})}function y(r,o){e.setParams({missingProperty:r}),t.forOf(r,s,()=>{t.assign(o,(0,n.propertyInData)(t,a,r,l.ownProperties)),t.if((0,i.not)(o),()=>{e.error(),t.break()})},i.nil)}}};t.default=s},87320:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0});let n=r(14233),i=r(20012),o=r(67146),s=r(70659),a={keyword:"uniqueItems",type:"array",schemaType:"boolean",$data:!0,error:{message:({params:{i:e,j:t}})=>(0,i.str)`must NOT have duplicate items (items ## ${t} and ${e} are identical)`,params:({params:{i:e,j:t}})=>(0,i._)`{i: ${e}, j: ${t}}`},code(e){let{gen:t,data:r,$data:a,schema:c,parentSchema:u,schemaCode:l,it:d}=e;if(!a&&!c)return;let f=t.let("valid"),h=u.items?(0,n.getSchemaTypes)(u.items):[];function p(){let n=t.let("i",(0,i._)`${r}.length`),o=t.let("j");e.setParams({i:n,j:o}),t.assign(f,!0),t.if((0,i._)`${n} > 1`,()=>(y()?g:m)(n,o))}function y(){return h.length>0&&!h.some(e=>"object"===e||"array"===e)}function g(o,s){let a=t.name("item"),c=(0,n.checkDataTypes)(h,a,d.opts.strictNumbers,n.DataType.Wrong),u=t.const("indices",(0,i._)`{}`);t.for((0,i._)`;${o}--;`,()=>{t.let(a,(0,i._)`${r}[${o}]`),t.if(c,(0,i._)`continue`),h.length>1&&t.if((0,i._)`typeof ${a} == "string"`,(0,i._)`${a} += "_"`),t.if((0,i._)`typeof ${u}[${a}] == "number"`,()=>{t.assign(s,(0,i._)`${u}[${a}]`),e.error(),t.assign(f,!1).break()}).code((0,i._)`${u}[${a}] = ${o}`)})}function m(n,a){let c=(0,o.useFunc)(t,s.default),u=t.name("outer");t.label(u).for((0,i._)`;${n}--;`,()=>t.for((0,i._)`${a} = ${n}; ${a}--;`,()=>t.if((0,i._)`${c}(${r}[${n}], ${r}[${a}])`,()=>{e.error(),t.assign(f,!1).break(u)})))}e.block$data(f,p,(0,i._)`${l} === false`),e.ok(f)}};t.default=a},16587:(e,t)=>{"use strict";t.__esModule=!0,t.DecodeBuffer=t.EncodeBuffer=void 0;var r=function(){function e(){this.offset=0,this.buffer_size=256,this.buffer=new ArrayBuffer(this.buffer_size),this.view=new DataView(this.buffer)}return e.prototype.resize_if_necessary=function(e){if(this.buffer_size-this.offset<e){this.buffer_size=Math.max(2*this.buffer_size,this.buffer_size+e);var t=new ArrayBuffer(this.buffer_size);new Uint8Array(t).set(new Uint8Array(this.buffer)),this.buffer=t,this.view=new DataView(t)}},e.prototype.get_used_buffer=function(){return new Uint8Array(this.buffer).slice(0,this.offset)},e.prototype.store_value=function(e,t){var r=t.substring(1),n=parseInt(r)/8;this.resize_if_necessary(n);var i="f"===t[0]?"setFloat".concat(r):"i"===t[0]?"setInt".concat(r):"setUint".concat(r);this.view[i](this.offset,e,!0),this.offset+=n},e.prototype.store_bytes=function(e){this.resize_if_necessary(e.length),new Uint8Array(this.buffer).set(new Uint8Array(e),this.offset),this.offset+=e.length},e}();t.EncodeBuffer=r;var n=function(){function e(e){this.offset=0,this.buffer_size=e.length,this.buffer=new ArrayBuffer(e.length),new Uint8Array(this.buffer).set(e),this.view=new DataView(this.buffer)}return e.prototype.assert_enough_buffer=function(e){if(this.offset+e>this.buffer.byteLength)throw Error("Error in schema, the buffer is smaller than expected")},e.prototype.consume_value=function(e){var t=e.substring(1),r=parseInt(t)/8;this.assert_enough_buffer(r);var n="f"===e[0]?"getFloat".concat(t):"i"===e[0]?"getInt".concat(t):"getUint".concat(t),i=this.view[n](this.offset,!0);return this.offset+=r,i},e.prototype.consume_bytes=function(e){this.assert_enough_buffer(e);var t=this.buffer.slice(this.offset,this.offset+e);return this.offset+=e,t},e}();t.DecodeBuffer=n},94104:(e,t,r)=>{"use strict";t.__esModule=!0,t.BorshDeserializer=void 0;var n=r(25310),i=r(16587),o=function(){function e(e){this.buffer=new i.DecodeBuffer(e)}return e.prototype.decode=function(e){return this.decode_value(e)},e.prototype.decode_value=function(e){if("string"==typeof e){if(n.integers.includes(e))return this.decode_integer(e);if("string"===e)return this.decode_string();if("bool"===e)return this.decode_boolean()}if("object"==typeof e){if("option"in e)return this.decode_option(e);if("enum"in e)return this.decode_enum(e);
37if("array"in e)return this.decode_array(e);if("set"in e)return this.decode_set(e);if("map"in e)return this.decode_map(e);if("struct"in e)return this.decode_struct(e)}throw Error("Unsupported type: ".concat(e))},e.prototype.decode_integer=function(e){var t=parseInt(e.substring(1));return t<=32||"f64"==e?this.buffer.consume_value(e):this.decode_bigint(t,e.startsWith("i"))},e.prototype.decode_bigint=function(e,t){void 0===t&&(t=!1);var r=e/8,n=new Uint8Array(this.buffer.consume_bytes(r)),i=n.reduceRight(function(e,t){return e+t.toString(16).padStart(2,"0")},"");return t&&n[r-1]?BigInt.asIntN(e,BigInt("0x".concat(i))):BigInt("0x".concat(i))},e.prototype.decode_string=function(){var e=this.decode_integer("u32"),t=new Uint8Array(this.buffer.consume_bytes(e));return String.fromCharCode.apply(null,t)},e.prototype.decode_boolean=function(){return this.buffer.consume_value("u8")>0},e.prototype.decode_option=function(e){var t=this.buffer.consume_value("u8");if(1===t)return this.decode_value(e.option);if(0!==t)throw Error("Invalid option ".concat(t));return null},e.prototype.decode_enum=function(e){var t,r=this.buffer.consume_value("u8");if(r>e.enum.length)throw Error("Enum option ".concat(r," is not available"));var n=e.enum[r].struct,i=Object.keys(n)[0];return(t={})[i]=this.decode_value(n[i]),t},e.prototype.decode_array=function(e){for(var t=[],r=e.array.len?e.array.len:this.decode_integer("u32"),n=0;n<r;++n)t.push(this.decode_value(e.array.type));return t},e.prototype.decode_set=function(e){for(var t=this.decode_integer("u32"),r=new Set,n=0;n<t;++n)r.add(this.decode_value(e.set));return r},e.prototype.decode_map=function(e){for(var t=this.decode_integer("u32"),r=new Map,n=0;n<t;++n){var i=this.decode_value(e.map.key),o=this.decode_value(e.map.value);r.set(i,o)}return r},e.prototype.decode_struct=function(e){var t={};for(var r in e.struct)t[r]=this.decode_value(e.struct[r]);return t},e}();t.BorshDeserializer=o},30443:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);(!i||("get"in i?!t.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),o=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)"default"!==r&&Object.prototype.hasOwnProperty.call(e,r)&&n(t,e,r);return i(t,e),t};t.__esModule=!0,t.deserialize=t.serialize=void 0;var s=r(2229),a=r(94104),c=o(r(51930));function u(e,t,r){return void 0===r&&(r=!0),r&&c.validate_schema(e),new s.BorshSerializer(r).encode(t,e)}function l(e,t,r){return void 0===r&&(r=!0),r&&c.validate_schema(e),new a.BorshDeserializer(t).decode(e)}t.serialize=u,t.deserialize=l},2229:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);(!i||("get"in i?!t.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),o=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)"default"!==r&&Object.prototype.hasOwnProperty.call(e,r)&&n(t,e,r);return i(t,e),t};t.__esModule=!0,t.BorshSerializer=void 0;var s=r(25310),a=r(16587),c=o(r(51930)),u=function(){function e(e){this.encoded=new a.EncodeBuffer,this.fieldPath=["value"],this.checkTypes=e}return e.prototype.encode=function(e,t){return this.encode_value(e,t),this.encoded.get_used_buffer()},e.prototype.encode_value=function(e,t){if("string"==typeof t){if(s.integers.includes(t))return this.encode_integer(e,t);if("string"===t)return this.encode_string(e);if("bool"===t)return this.encode_boolean(e)}if("object"==typeof t){if("option"in t)return this.encode_option(e,t);if("enum"in t)return this.encode_enum(e,t);if("array"in t)return this.encode_array(e,t);if("set"in t)return this.encode_set(e,t);if("map"in t)return this.encode_map(e,t);if("struct"in t)return this.encode_struct(e,t)}},e.prototype.encode_integer=function(e,t){var r=parseInt(t.substring(1));r<=32||"f64"==t?(this.checkTypes&&c.expect_type(e,"number",this.fieldPath),this.encoded.store_value(e,t)):(this.checkTypes&&c.expect_bigint(e,this.fieldPath),this.encode_bigint(BigInt(e),r))},e.prototype.encode_bigint=function(e,t){for(var r=t/8,n=new Uint8Array(r),i=0;i<r;i++)n[i]=Number(e&BigInt(255)),e>>
37=BigInt(8);this.encoded.store_bytes(new Uint8Array(n))},e.prototype.encode_string=function(e){this.checkTypes&&c.expect_type(e,"string",this.fieldPath);var t=e;this.encoded.store_value(t.length,"u32");for(var r=0;r<t.length;r++)this.encoded.store_value(t.charCodeAt(r),"u8")},e.prototype.encode_boolean=function(e){this.checkTypes&&c.expect_type(e,"boolean",this.fieldPath),this.encoded.store_value(e?1:0,"u8")},e.prototype.encode_option=function(e,t){null==e?this.encoded.store_value(0,"u8"):(this.encoded.store_value(1,"u8"),this.encode_value(e,t.option))},e.prototype.encode_enum=function(e,t){this.checkTypes&&c.expect_enum(e,this.fieldPath);for(var r=Object.keys(e)[0],n=0;n<t.enum.length;n++){var i=t.enum[n];if(r===Object.keys(i.struct)[0])return this.encoded.store_value(n,"u8"),this.encode_struct(e,i)}throw Error("Enum key (".concat(r,") not found in enum schema: ").concat(JSON.stringify(t)," at ").concat(this.fieldPath.join(".")))},e.prototype.encode_array=function(e,t){if(c.isArrayLike(e))return this.encode_arraylike(e,t);if(e instanceof ArrayBuffer)return this.encode_buffer(e,t);throw Error("Expected Array-like not ".concat(typeof e,"(").concat(e,") at ").concat(this.fieldPath.join(".")))},e.prototype.encode_arraylike=function(e,t){t.array.len?c.expect_same_size(e.length,t.array.len,this.fieldPath):this.encoded.store_value(e.length,"u32");for(var r=0;r<e.length;r++)this.encode_value(e[r],t.array.type)},e.prototype.encode_buffer=function(e,t){t.array.len?c.expect_same_size(e.byteLength,t.array.len,this.fieldPath):this.encoded.store_value(e.byteLength,"u32"),this.encoded.store_bytes(new Uint8Array(e))},e.prototype.encode_set=function(e,t){this.checkTypes&&c.expect_type(e,"object",this.fieldPath);var r=e instanceof Set?Array.from(e.values()):Object.values(e);this.encoded.store_value(r.length,"u32");for(var n=0,i=r;n<i.length;n++){var o=i[n];this.encode_value(o,t.set)}},e.prototype.encode_map=function(e,t){this.checkTypes&&c.expect_type(e,"object",this.fieldPath);var r=e instanceof Map,n=r?Array.from(e.keys()):Object.keys(e);this.encoded.store_value(n.length,"u32");for(var i=0,o=n;i<o.length;i++){var s=o[i];this.encode_value(s,t.map.key),this.encode_value(r?e.get(s):e[s],t.map.value)}},e.prototype.encode_struct=function(e,t){this.checkTypes&&c.expect_type(e,"object",this.fieldPath);for(var r=0,n=Object.keys(t.struct);r<n.length;r++){var i=n[r];this.fieldPath.push(i),this.encode_value(e[i],t.struct[i]),this.fieldPath.pop()}},e}();t.BorshSerializer=u},25310:(e,t)=>{"use strict";t.__esModule=!0,t.integers=void 0,t.integers=["u8","u16","u32","u64","u128","i8","i16","i32","i64","i128","f32","f64"]},51930:function(e,t,r){"use strict";var n=this&&this.__extends||function(){var e=function(t,r){return(e=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])})(t,r)};return function(t,r){if("function"!=typeof r&&null!==r)throw TypeError("Class extends value "+String(r)+" is not a constructor or null");function n(){this.constructor=t}e(t,r),t.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}();t.__esModule=!0,t.validate_schema=t.ErrorSchema=t.expect_enum=t.expect_same_size=t.expect_bigint=t.expect_type=t.isArrayLike=void 0;var i=r(25310);function o(e){return Array.isArray(e)||!!e&&"object"==typeof e&&"length"in e&&"number"==typeof e.length&&(0===e.length||e.length>0&&e.length-1 in e)}function s(e,t,r){if(typeof e!==t)throw Error("Expected ".concat(t," not ").concat(typeof e,"(").concat(e,") at ").concat(r.join(".")))}function a(e,t){var r=["number","string","bigint","boolean"].includes(typeof e),n="object"==typeof e&&null!==e&&"toString"in e;if(!r&&!n)throw Error("Expected bigint, number, boolean or string not ".concat(typeof e,"(").concat(e,") at ").concat(t.join(".")))}function c(e,t,r){if(e!==t)throw Error("Array length ".concat(e," does not match schema length ").concat(t," at ").concat(r.join(".")))}function u(e,t){if("object"!=typeof e||null===e)throw Error("Expected object not ".concat(typeof e,"(").concat(e,") at ").concat(t.join(".")))}t.isArrayLike=o,t.expect_type=s,t.expect_bigint=a,t.expect_same_size=c,t.expect_enum=u;var l=i.integers.concat(["bool","string"]),d=["option","enum","array","set","map","struct"],f=function(e){function t(t,r){var n="Invalid schema: ".concat(JSON.stringify(t)," expected ").concat(r);return e.call(this,n)||this}return n(t,e),t}(Error);function h(e){if(!("string"==typeof e&&l.includes(e))){if(e&&"object"==typeof e){var t=Object.keys(e);if(1===t.length&&d.includes(t[0])){var r=t[0];if("option"===r)return h(e[r]);if("enum"===r)return p(e[r]);if("array"===r)return y(e[r]);if("set"===r)return h(e[r]);if("map"===r)return g(e[r]);if("struct"===r)return m(e[r])}}throw new f(e,d.join(", ")+" or "+l.join(", "))}}function p(e){if(!Array.isArray(e))throw new f(e,"Array");for(var t=0,r=e;t<r.length;t++){var n=r[t];if("object"!=typeof n||!("struct"in n))throw Error('Missing "struct" key in enum schema');if("object"!=typeof n.struct||1!==Object.keys(n.struct).length)throw Error('The "struct" in each enum must have a single key');h({struct:n.struct})}}function y(e){if("object"!=typeof e)throw new f(e,"{ type, len? }");if(e.len&&"number"!=typeof e.len)throw Error("Invalid schema: ".concat(e));if("type"in e)return h(e.type);throw new f(e,"{ type, len? }")}function g(e){if("object"==typeof e&&"key"in e&&"value"in e)h(e.key),h(e.value);else throw new f(e,"{ key, value }")}function m(e){if("object"!=typeof e)throw new f(e,"object");for(var t in e)h(e[t])}t.ErrorSchema=f,t.validate_schema=h},67787:e=>{"use strict";var t=e.exports=function(e,t,n){"function"==typeof t&&(n=t,t={});var i="function"==typeof(n=t.cb||n)?n:n.pre||function(){};r(t,i,n.post||function(){},e,"",e)};function r(e,i,o,s,a,c,u,l,d,f){if(s&&"object"==typeof s&&!Array.isArray(s)){for(var h in i(s,a,c,u,l,d,f),s){var p=s[h];if(Array.isArray(p)){if(h in t.arrayKeywords)for(var y=0;y<p.length;y++)r(e,i,o,p[y],a+"/"+h+"/"+y,c,a,h,s,y)}else if(h in t.propsKeywords){if(p&&"object"==typeof p)for(var g in p)r(e,i,o,p[g],a+"/"+h+"/"+n(g),c,a,h,s,g)}else(h in t.keywords||e.allKeys&&!(h in t.skipKeywords))&&r(e,i,o,p,a+"/"+h,c,a,h,s)}o(s,a,c,u,l,d,f)}}function n(e){return e.replace(/~/g,"~0").replace(/\//g,"~1")}t.keywords={additionalItems:!0,items:!0,contains:!0,additionalProperties:!0,propertyNames:!0,not:!0,if:!0,then:!0,else:!0},t.arrayKeywords={items:!0,allOf:!0,anyOf:!0,oneOf:!0},t.propsKeywords={$defs:!0,definitions:!0,properties:!0,patternProperties:!0,dependencies:!0},t.skipKeywords={default:!0,enum:!0,const:!0,required:!0,maximum:!0,minimum:!0,exclusiveMaximum:!0,exclusiveMinimum:!0,multipleOf:!0,maxLength:!0,minLength:!0,pattern:!0,format:!0,maxItems:!0,minItems:!0,uniqueItems:!0,maxProperties:!0,minProperties:!0}},75185:(e,t)=>{"use strict";var r,n,i;
37Object.defineProperty(t,"__esModule",{value:!0}),t.AbiSerializationType=t.AbiFunctionModifier=t.AbiFunctionKind=t.SCHEMA_VERSION=void 0,t.SCHEMA_VERSION="0.3.0",function(e){e.View="view",e.Call="call"}(r=t.AbiFunctionKind||(t.AbiFunctionKind={})),function(e){e.Init="init",e.Private="private",e.Payable="payable"}(n=t.AbiFunctionModifier||(t.AbiFunctionModifier={})),function(e){e.Json="json",e.Borsh="borsh"}(i=t.AbiSerializationType||(t.AbiSerializationType={}))},19102:(e,t,r)=>{var n="/";!function(){var t={528:function(e,t,r){var n=r(685),i=r(310),o=e.exports;for(var s in n)n.hasOwnProperty(s)&&(o[s]=n[s]);function a(e){if("string"==typeof e&&(e=i.parse(e)),e.protocol||(e.protocol="https:"),"https:"!==e.protocol)throw Error('Protocol "'+e.protocol+'" not supported. Expected "https:"');return e}o.request=function(e,t){return e=a(e),n.request.call(this,e,t)},o.get=function(e,t){return e=a(e),n.get.call(this,e,t)}},685:function(e){"use strict";e.exports=r(31493)},310:function(e){"use strict";e.exports=r(76679)}},i={};function o(e){var r=i[e];if(void 0!==r)return r.exports;var n=i[e]={exports:{}},s=!0;try{t[e](n,n.exports,o),s=!1}finally{s&&delete i[e]}return n.exports}o.ab=n+"/";var s=o(528);e.exports=s}()},76679:(e,t,r)=>{var n="/";!function(){var t={452:function(e){"use strict";e.exports=r(86979)}},i={};function o(e){var r=i[e];if(void 0!==r)return r.exports;var n=i[e]={exports:{}},s=!0;try{t[e](n,n.exports,o),s=!1}finally{s&&delete i[e]}return n.exports}o.ab=n+"/";var s={};!function(){var e,t=s,r=(e=o(452))&&"object"==typeof e&&"default"in e?e.default:e,n=/https?|ftp|gopher|file/;function i(e){"string"==typeof e&&(e=v(e));var t=function(e,t,r){var n=e.auth,i=e.hostname,o=e.protocol||"",s=e.pathname||"",a=e.hash||"",c=e.query||"",u=!1;n=n?encodeURIComponent(n).replace(/%3A/i,":")+"@":"",e.host?u=n+e.host:i&&(u=n+(~i.indexOf(":")?"["+i+"]":i),e.port&&(u+=":"+e.port)),c&&"object"==typeof c&&(c=t.encode(c));var l=e.search||c&&"?"+c||"";return o&&":"!==o.substr(-1)&&(o+=":"),e.slashes||(!o||r.test(o))&&!1!==u?(u="//"+(u||""),s&&"/"!==s[0]&&(s="/"+s)):u||(u=""),a&&"#"!==a[0]&&(a="#"+a),l&&"?"!==l[0]&&(l="?"+l),{protocol:o,host:u,pathname:s=s.replace(/[?#]/g,encodeURIComponent),search:l=l.replace("#","%23"),hash:a}}(e,r,n);return""+t.protocol+t.host+t.pathname+t.search+t.hash}var a="http://",c="w.w",u=a+c,l=/^([a-z0-9.+-]*:\/\/\/)([a-z0-9.+-]:\/*)?/i,d=/https?|ftp|gopher|file/;function f(e,t){var r="string"==typeof e?v(e):e;e="object"==typeof e?i(e):e;var n=v(t),o="";r.protocol&&!r.slashes&&(o=r.protocol,e=e.replace(r.protocol,""),o+="/"===t[0]||"/"===e[0]?"/":""),o&&n.protocol&&(o="",n.slashes||(o=n.protocol,t=t.replace(n.protocol,"")));var s=e.match(l);s&&!n.protocol&&(e=e.substr((o=s[1]+(s[2]||"")).length),/^\/\/[^/]/.test(t)&&(o=o.slice(0,-1)));var c=new URL(e,u+"/"),f=new URL(t,c).toString().replace(u,""),h=n.protocol||r.protocol;return h+=r.slashes||n.slashes?"//":"",!o&&h?f=f.replace(a,h):o&&(f=f.replace(a,"")),d.test(f)||~t.indexOf(".")||"/"===e.slice(-1)||"/"===t.slice(-1)||"/"!==f.slice(-1)||(f=f.slice(0,-1)),o&&(f=o+("/"===f[0]?f.substr(1):f)),f}function h(){}h.prototype.parse=v,h.prototype.format=i,h.prototype.resolve=f,h.prototype.resolveObject=f;var p=/^https?|ftp|gopher|file/,y=/^(.*?)([#?].*)/,g=/^([a-z0-9.+-]*:)(\/{0,3})(.*)/i,m=/^([a-z0-9.+-]*:)?\/\/\/*/i,b=/^([a-z0-9.+-]*:)(\/{0,2})\[(.*)\]$/i;function v(e,t,n){if(void 0===t&&(t=!1),void 0===n&&(n=!1),e&&"object"==typeof e&&e instanceof h)return e;var o=(e=e.trim()).match(y);e=o?o[1].replace(/\\/g,"/")+o[2]:e.replace(/\\/g,"/"),b.test(e)&&"/"!==e.slice(-1)&&(e+="/");var s=!/(^javascript)/.test(e)&&e.match(g),a=m.test(e),l="";s&&(p.test(s[1])||(l=s[1].toLowerCase(),e=""+s[2]+s[3]),s[2]||(a=!1,p.test(s[1])?(l=s[1],e=""+s[3]):e="//"+s[3]),3!==s[2].length&&1!==s[2].length||(l=s[1],e="/"+s[3]));var d,f=(o?o[1]:e).match(/^https?:\/\/[^/]+(:[0-9]+)(?=\/|$)/),v=f&&f[1],w=new h,_="",E="";try{d=new URL(e)}catch(t){_=t,l||n||!/^\/\//.test(e)||/^\/\/.+[@.]/.test(e)||(E="/",e=e.substr(1));try{d=new URL(e,u)}catch(e){return w.protocol=l,w.href=l,w}}w.slashes=a&&!E,w.host=d.host===c?"":d.host,w.hostname=d.hostname===c?"":d.hostname.replace(/(\[|\])/g,""),w.protocol=_?l||null:d.protocol,w.search=d.search.replace(/\\/g,"%5C"),w.hash=d.hash.replace(/\\/g,"%5C");var S=e.split("#");!w.search&&~S[0].indexOf("?")&&(w.search="?"),w.hash||""!==S[1]||(w.hash="#"),w.query=t?r.decode(d.search.substr(1)):w.search.substr(1),w.pathname=E+(s?function(e){return e.replace(/['^|`]/g,function(e){return"%"+e.charCodeAt().toString(16).toUpperCase()}).replace(/((?:%[0-9A-F]{2})+)/g,function(e,t){try{return decodeURIComponent(t).split("").map(function(e){var t=e.charCodeAt();return t>256||/^[a-z0-9]$/i.test(e)?e:"%"+t.toString(16).toUpperCase()}).join("")}catch(e){return t}})}(d.pathname):d.pathname),"about:"===w.protocol&&"blank"===w.pathname&&(w.protocol="",w.pathname=""),_&&"/"!==e[0]&&(w.pathname=w.pathname.substr(1)),l&&!p.test(l)&&"/"!==e.slice(-1)&&"/"===w.pathname&&(w.pathname=""),w.path=w.pathname+w.search,w.auth=[d.username,d.password].map(decodeURIComponent).filter(
37Boolean).join(":"),w.port=d.port,v&&!w.host.endsWith(v)&&(w.host+=v,w.port=v.slice(1)),w.href=E?""+w.pathname+w.search+w.hash:i(w);var x=/^(file)/.test(w.href)?["host","hostname"]:[];return Object.keys(w).forEach(function(e){~x.indexOf(e)||(w[e]=w[e]||null)}),w}t.parse=v,t.format=i,t.resolve=f,t.resolveObject=function(e,t){return v(f(e,t))},t.Url=h}(),e.exports=s}()},86979:e=>{var t="/";!function(){"use strict";var r={815:function(e){function t(e,t){return Object.prototype.hasOwnProperty.call(e,t)}e.exports=function(e,n,i,o){n=n||"&",i=i||"=";var s={};if("string"!=typeof e||0===e.length)return s;var a=/\+/g;e=e.split(n);var c=1e3;o&&"number"==typeof o.maxKeys&&(c=o.maxKeys);var u=e.length;c>0&&u>c&&(u=c);for(var l=0;l<u;++l){var d,f,h,p,y=e[l].replace(a,"%20"),g=y.indexOf(i);g>=0?(d=y.substr(0,g),f=y.substr(g+1)):(d=y,f=""),h=decodeURIComponent(d),p=decodeURIComponent(f),t(s,h)?r(s[h])?s[h].push(p):s[h]=[s[h],p]:s[h]=p}return s};var r=Array.isArray||function(e){return"[object Array]"===Object.prototype.toString.call(e)}},577:function(e){var t=function(e){switch(typeof e){case"string":return e;case"boolean":return e?"true":"false";case"number":return isFinite(e)?e:"";default:return""}};e.exports=function(e,o,s,a){return(o=o||"&",s=s||"=",null===e&&(e=void 0),"object"==typeof e)?n(i(e),function(i){var a=encodeURIComponent(t(i))+s;return r(e[i])?n(e[i],function(e){return a+encodeURIComponent(t(e))}).join(o):a+encodeURIComponent(t(e[i]))}).join(o):a?encodeURIComponent(t(a))+s+encodeURIComponent(t(e)):""};var r=Array.isArray||function(e){return"[object Array]"===Object.prototype.toString.call(e)};function n(e,t){if(e.map)return e.map(t);for(var r=[],n=0;n<e.length;n++)r.push(t(e[n],n));return r}var i=Object.keys||function(e){var t=[];for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.push(r);return t}}},n={};function i(e){var t=n[e];if(void 0!==t)return t.exports;var o=n[e]={exports:{}},s=!0;try{r[e](o,o.exports,i),s=!1}finally{s&&delete n[e]}return o.exports}i.ab=t+"/";var o={};!function(){var e=o;e.decode=e.parse=i(815),e.encode=e.stringify=i(577)}(),e.exports=o}()},83979:(e,t,r)=>{var n="/",i=r(2818);!function(){var t={782: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}}},646:function(e){"use strict";let t={};function r(e,r,n){function i(e,t,n){return"string"==typeof r?r:r(e,t,n)}n||(n=Error);class o extends n{constructor(e,t,r){super(i(e,t,r))}}o.prototype.name=n.name,o.prototype.code=e,t[e]=o}function n(e,t){if(!Array.isArray(e))return`of ${t} ${String(e)}`;{let r=e.length;return(e=e.map(e=>String(e)),r>2)?`one of ${t} ${e.slice(0,r-1).join(", ")}, or `+e[r-1]:2===r?`one of ${t} ${e[0]} or ${e[1]}`:`of ${t} ${e[0]}`}}function i(e,t,r){return e.substr(!r||r<0?0:+r,t.length)===t}function o(e,t,r){return(void 0===r||r>e.length)&&(r=e.length),e.substring(r-t.length,r)===t}function s(e,t,r){return"number"!=typeof r&&(r=0),!(r+t.length>e.length)&&-1!==e.indexOf(t,r)}r("ERR_INVALID_OPT_VALUE",function(e,t){return'The value "'+t+'" is invalid for option "'+e+'"'},TypeError),r("ERR_INVALID_ARG_TYPE",function(e,t,r){let a,c;if("string"==typeof t&&i(t,"not ")?(a="must not be",t=t.replace(/^not /,"")):a="must be",o(e," argument"))c=`The ${e} ${a} ${n(t,"type")}`;else{let r=s(e,".")?"property":"argument";c=`The "${e}" ${r} ${a} ${n(t,"type")}`}return c+`. Received type ${typeof r}`},TypeError),r("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF"),r("ERR_METHOD_NOT_IMPLEMENTED",function(e){return"The "+e+" method is not implemented"}),r("ERR_STREAM_PREMATURE_CLOSE","Premature close"),r("ERR_STREAM_DESTROYED",function(e){return"Cannot call "+e+" after a stream was destroyed"}),r("ERR_MULTIPLE_CALLBACK","Callback called multiple times"),r("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable"),r("ERR_STREAM_WRITE_AFTER_END","write after end"),r("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError),r("ERR_UNKNOWN_ENCODING",function(e){return"Unknown encoding: "+e},TypeError),r("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event"),e.exports.q=t},403:function(e,t,r){"use strict";var n=Object.keys||function(e){var t=[];for(var r in e)t.push(r);return t};e.exports=l;var o=r(709),s=r(337);r(782)(l,o);for(var a=n(s.prototype),c=0;c<a.length;c++){var u=a[c];l.prototype[u]||(l.prototype[u]=s.prototype[u])}function l(e){if(!(this instanceof l))return new l(e);o.call(this,e),s.call(this,e),this.allowHalfOpen=!0,e&&(!1===e.readable&&(this.readable=!1),!1===e.writable&&(this.writable=!1),!1===e.allowHalfOpen&&(this.allowHalfOpen=!1,this.once("end",d)))}function d(){this._writableState.ended||i.nextTick(f,this)}function f(e){e.end()}Object.defineProperty(l.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),Object.defineProperty(l.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}}),Object.defineProperty(l.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}}),Object.defineProperty(l.prototype,"destroyed",{enumerable:!1,get:function(){return void 0!==this._readableState&&void 0!==this._writableState&&this._readableState.destroyed&&this._writableState.destroyed},set:function(e){void 0!==this._readableState&&void 0!==this._writableState&&(this._readableState.destroyed=e,this._writableState.destroyed=e)}})},889:function(e,t,r){"use strict";e.exports=i;var n=r(170);function i(e){if(!(this instanceof i))return new i(e);n.call(this,e)}r(782)(i,n),i.prototype._transform=function(e,t,r){r(null,e)}},709:function(e,t,n){"use strict";e.exports=P,P.ReadableState=T,n(361).EventEmitter;var o,s,a,c,u,l=function(e,t){return e.listeners(t).length},d=n(678),f=n(300).Buffer,h=r.g.Uint8Array||function(){};function p(e){return f.from(e)}function y(e){return f.isBuffer(e)||e instanceof h}var g=n(837);s=g&&g.debuglog?g.debuglog("stream"):function(){};var m=n(379),b=n(25),v=n(776).getHighWaterMark,w=n(646).q,_=w.ERR_INVALID_ARG_TYPE,E=w.ERR_STREAM_PUSH_AFTER_EOF,S=w.ERR_METHOD_NOT_IMPLEMENT
vendor: 26,831 bytes, line 37
37ED,x=w.ERR_STREAM_UNSHIFT_AFTER_END_EVENT;n(782)(P,d);var A=b.errorOrDestroy,I=["error","close","destroy","pause","resume"];function O(e,t,r){if("function"==typeof e.prependListener)return e.prependListener(t,r);e._events&&e._events[t]?Array.isArray(e._events[t])?e._events[t].unshift(r):e._events[t]=[r,e._events[t]]:e.on(t,r)}function T(e,t,r){o=o||n(403),e=e||{},"boolean"!=typeof r&&(r=t instanceof o),this.objectMode=!!e.objectMode,r&&(this.objectMode=this.objectMode||!!e.readableObjectMode),this.highWaterMark=v(this,e,"readableHighWaterMark",r),this.buffer=new m,this.length=0,this.pipes=null,this.pipesCount=0,this.flowing=null,this.ended=!1,this.endEmitted=!1,this.reading=!1,this.sync=!0,this.needReadable=!1,this.emittedReadable=!1,this.readableListening=!1,this.resumeScheduled=!1,this.paused=!0,this.emitClose=!1!==e.emitClose,this.autoDestroy=!!e.autoDestroy,this.destroyed=!1,this.defaultEncoding=e.defaultEncoding||"utf8",this.awaitDrain=0,this.readingMore=!1,this.decoder=null,this.encoding=null,e.encoding&&(a||(a=n(704).s),this.decoder=new a(e.encoding),this.encoding=e.encoding)}function P(e){if(o=o||n(403),!(this instanceof P))return new P(e);var t=this instanceof o;this._readableState=new T(e,this,t),this.readable=!0,e&&("function"==typeof e.read&&(this._read=e.read),"function"==typeof e.destroy&&(this._destroy=e.destroy)),d.call(this)}function M(e,t,r,n,i){s("readableAddChunk",t);var o,a=e._readableState;if(null===t)a.reading=!1,R(e,a);else if(i||(o=k(a,t)),o)A(e,o);else if(a.objectMode||t&&t.length>0){if("string"==typeof t||a.objectMode||Object.getPrototypeOf(t)===f.prototype||(t=p(t)),n)a.endEmitted?A(e,new x):N(e,a,t,!0);else if(a.ended)A(e,new E);else{if(a.destroyed)return!1;a.reading=!1,a.decoder&&!r?(t=a.decoder.write(t),a.objectMode||0!==t.length?N(e,a,t,!1):U(e,a)):N(e,a,t,!1)}}else n||(a.reading=!1,U(e,a));return!a.ended&&(a.length<a.highWaterMark||0===a.length)}function N(e,t,r,n){t.flowing&&0===t.length&&!t.sync?(t.awaitDrain=0,e.emit("data",r)):(t.length+=t.objectMode?1:r.length,n?t.buffer.unshift(r):t.buffer.push(r),t.needReadable&&L(e)),U(e,t)}function k(e,t){var r;return y(t)||"string"==typeof t||void 0===t||e.objectMode||(r=new _("chunk",["string","Buffer","Uint8Array"],t)),r}Object.defineProperty(P.prototype,"destroyed",{enumerable:!1,get:function(){return void 0!==this._readableState&&this._readableState.destroyed},set:function(e){this._readableState&&(this._readableState.destroyed=e)}}),P.prototype.destroy=b.destroy,P.prototype._undestroy=b.undestroy,P.prototype._destroy=function(e,t){t(e)},P.prototype.push=function(e,t){var r,n=this._readableState;return n.objectMode?r=!0:"string"==typeof e&&((t=t||n.defaultEncoding)!==n.encoding&&(e=f.from(e,t),t=""),r=!0),M(this,e,t,!1,r)},P.prototype.unshift=function(e){return M(this,e,null,!0,!1)},P.prototype.isPaused=function(){return!1===this._readableState.flowing},P.prototype.setEncoding=function(e){a||(a=n(704).s);var t=new a(e);this._readableState.decoder=t,this._readableState.encoding=this._readableState.decoder.encoding;for(var r=this._readableState.buffer.head,i="";null!==r;)i+=t.write(r.data),r=r.next;return this._readableState.buffer.clear(),""!==i&&this._readableState.buffer.push(i),this._readableState.length=i.length,this};var C=0x40000000;function D(e){return e>=C?e=C:(e--,e|=e>>>1,e|=e>>>2,e|=e>>>4,e|=e>>>8,e|=e>>>16,e++),e}function j(e,t){return e<=0||0===t.length&&t.ended?0:t.objectMode?1:e!=e?t.flowing&&t.length?t.buffer.head.data.length:t.length:(e>t.highWaterMark&&(t.highWaterMark=D(e)),e<=t.length)?e:t.ended?t.length:(t.needReadable=!0,0)}function R(e,t){if(s("onEofChunk"),!t.ended){if(t.decoder){var r=t.decoder.end();r&&r.length&&(t.buffer.push(r),t.length+=t.objectMode?1:r.length)}t.ended=!0,t.sync?L(e):(t.needReadable=!1,t.emittedReadable||(t.emittedReadable=!0,B(e)))}}function L(e){var t=e._readableState;s("emitReadable",t.needReadable,t.emittedReadable),t.needReadable=!1,t.emittedReadable||(s("emitReadable",t.flowing),t.emittedReadable=!0,i.nextTick(B,e))}function B(e){var t=e._readableState;s("emitReadable_",t.destroyed,t.length,t.ended),!t.destroyed&&(t.length||t.ended)&&(e.emit("readable"),t.emittedReadable=!1),t.needReadable=!t.flowing&&!t.ended&&t.length<=t.highWaterMark,H(e)}function U(e,t){t.readingMore||(t.readingMore=!0,i.nextTick($,e,t))}function $(e,t){for(;!t.reading&&!t.ended&&(t.length<t.highWaterMark||t.flowing&&0===t.length);){var r=t.length;if(s("maybeReadMore read 0"),e.read(0),r===t.length)break}t.readingMore=!1}function K(e){return function(){var t=e._readableState;s("pipeOnDrain",t.awaitDrain),t.awaitDrain&&t.awaitDrain--,0===t.awaitDrain&&l(e,"data")&&(t.flowing=!0,H(e))}}function F(e){var t=e._readableState;t.readableListening=e.listenerCount("readable")>0,t.resumeScheduled&&!t.paused?t.flowing=!0:e.listenerCount("data")>0&&e.resume()}function z(e){s("readable nexttick read 0"),e.read(0)}function q(e,t){t.resumeScheduled||(t.resumeScheduled=!0,i.nextTick(V,e,t))}function V(e,t){s("resume",t.reading),t.reading||e.read(0),t.resumeScheduled=!1,e.emit("resume"),H(e),t.flowing&&!t.reading&&e.read(0)}function H(e){var t=e._readableState;for(s("flow",t.flowing);t.flowing&&null!==e.read(););}function G(e,t){var r;return 0===t.length?null:(t.objectMode?r=t.buffer.shift():!e||e>=t.length?(r=t.decoder?t.buffer.join(""):1===t.buffer.length?t.buffer.first():t.buffer.concat(t.length),t.buffer.clear()):r=t.buffer.consume(e,t.decoder),r)}function W(e){var t=e._readableState;s("endReadable",t.endEmitted),t.endEmitted||(t.ended=!0,i.nextTick(J,t,e))}function J(e,t){if(s("endReadableNT",e.endEmitted,e.length),!e.endEmitted&&0===e.length&&(e.endEmitted=!0,t.readable=!1,t.emit("end"),e.autoDestroy)){var r=t._writableState;(!r||r.autoDestroy&&r.finished)&&t.destroy()}}function Z(e,t){for(var r=0,n=e.length;r<n;r++)if(e[r]===t)return r;return -1}P.prototype.read=function(e){s("read",e),e=parseInt(e,10);var t,r=this._readableState,n=e;if(0!==e&&(r.emittedReadable=!1),0===e&&r.needReadable&&((0!==r.highWaterMark?r.length>=r.highWaterMark:r.length>0)||r.ended))return s("read: emitReadable",r.length,r.ended),0===r.length&&r.ended?W(this):L(this),null;if(0===(e=j(e,r))&&r.ended)return 0===r.length&&W(this),null;var i=r.needReadable;return s("need readable",i),(0===r.length||r.length-e<r.highWaterMark)&&s("length less than watermark",i=!0),r.ended||r.reading?s("reading or ended",i=!1):i&&(s("do read"),r.reading=!0,r.sync=!0,0===r.length&&(r.needReadable=!0),this._read(r.highWaterMark),r.sync=!1,r.reading||(e=j(n,r))),null===(t=e>0?G(e,r):null)?(r.needReadable=r.length<=r.highWaterMark,e=0):(r.length-=e,r.awaitDrain=0),0===r.length&&(r.ended||(r.needReadable=!0),n!==e&&r.ended&&W(this)),null!==t&&this.emit("data",t),t},P.prototype._read=function(e){A(this,new S("_read()"))},P.prototype.pipe=function(e,t){var r=this,n=this._readableState;switch(n.pipesCount){case 0:n.pipes=e;break;case 1:n.pipes=[n.pipes,e];break;default:n.pipes.push(e)}n.pipesCount+=1,s("pipe count=%d opts=%j",n.pipesCount,t);var o=t&&!1===t.end||e===i.stdout||e===i.stderr?m:c;function a(e,t){s("onunpipe"),e===r&&t&&!1===t.hasUnpiped&&(t.hasUnpiped=!0,f())}function c(){s("onend"),e.end()}n.endEmitted?i.nextTick(o):r.once("end",o),e.on("unpipe",a);var u=K(r);e.on("drain",u);var d=!1;function f(){s("cleanup"),e.removeListener("close",y),e.removeListener("finish",g),e.removeListener("drain",u),e.removeListener("error",p),e.removeListener("unpipe",a),r.removeListener("end",c),r.removeListener("end",m),r.removeListener("data",h),d=!0,n.awaitDrain&&(!e._writableState||e._writableState.needDrain)&&u()}function h(t){s("ondata");var i=e.write(t);s("dest.write",i),!1===i&&((1===n.pipesCount&&n.pipes===e||n.pipesCount>1&&-1!==Z(n.pipes,e))&&!d&&(s("false write response, pause",n.awaitDrain),n.awaitDrain++),r.pause())}function p(t){s("onerror",t),m(),e.removeListener("error",p),0===l(e,"error")&&A(e,t)}function y(){e.removeListener("finish",g),m()}function g(){s("onfinish"),e.removeListener("close",y),m()}function m(){s("unpipe"),r.unpipe(e)}return r.on("data",h),O(e,"error",p),e.once("close",y),e.once("finish",g),e.emit("pipe",r),n.flowing||(s("pipe resume"),r.resume()),e},P.prototype.unpipe=function(e){var t=this._readableState,r={hasUnpiped:!1};if(0===t.pipesCount)return this;if(1===t.pipesCount)return e&&e!==t.pipes||(e||(e=t.pipes),t.pipes=null,t.pipesCount=0,t.flowing=!1,e&&e.emit("unpipe",this,r)),this;if(!e){var n=t.pipes,i=t.pipesCount;t.pipes=null,t.pipesCount=0,t.flowing=!1;for(var o=0;o<i;o++)n[o].emit("unpipe",this,{hasUnpiped:!1});return this}var s=Z(t.pipes,e);return -1===s||(t.pipes.splice(s,1),t.pipesCount-=1,1===t.pipesCount&&(t.pipes=t.pipes[0]),e.emit("unpipe",this,r)),this},P.prototype.on=function(e,t){var r=d.prototype.on.call(this,e,t),n=this._readableState;return"data"===e?(n.readableListening=this.listenerCount("readable")>0,!1!==n.flowing&&this.resume()):"readable"!==e||n.endEmitted||n.readableListening||(n.readableListening=n.needReadable=!0,n.flowing=!1,n.emittedReadable=!1,s("on readable",n.length,n.reading),n.length?L(this):n.reading||i.nextTick(z,this)),r},P.prototype.addListener=P.prototype.on,P.prototype.removeListener=function(e,t){var r=d.prototype.removeListener.call(this,e,t);return"readable"===e&&i.nextTick(F,this),r},P.prototype.removeAllListeners=function(e){var t=d.prototype.removeAllListeners.apply(this,arguments);return("readable"===e||void 0===e)&&i.nextTick(F,this),t},P.prototype.resume=function(){var e=this._readableState;return e.flowing||(s("resume"),e.flowing=!e.readableListening,q(this,e)),e.paused=!1,this},P.prototype.pause=function(){return s("call pause flowing=%j",this._readableState.flowing),!1!==this._readableState.flowing&&(s("pause"),this._readableState.flowing=!1,this.emit("pause")),this._readableState.paused=!0,this},P.prototype.wrap=function(e){var t=this,r=this._readableState,n=!1;for(var i in e.on("end",function(){if(s("wrapped end"),r.decoder&&!r.ended){var e=r.decoder.end();e&&e.length&&t.push(e)}t.push(null)}),e.on("data",function(i){s("wrapped data"),r.decoder&&(i=r.decoder.write(i)),(!r.objectMode||null!=i)&&(r.objectMode||i&&i.length)&&(t.push(i)||(n=!0,e.pause()))}),e)void 0===this[i]&&"function"==typeof e[i]&&(this[i]=function(t){return function(){return e[t].apply(e,arguments)}}(i));for(var o=0;o<I.length;o++)e.on(I[o],this.emit.bind(this,I[o]));return this._read=function(t){s("wrapped _read",t),n&&(n=!1,e.resume())},this},"function"==typeof Symbol&&(P.prototype[Symbol.asyncIterator]=function(){return void 0===c&&(c=n(871)),c(this)}),Object.defineProperty(P.prototype,"readableHighWaterMark",{enumerable:!1,get:function(){return this._readableState.highWaterMark}}),Object.defineProperty(P.prototype,"readableBuffer",{enumerable:!1,get:function(){return this._readableState&&this._readableState.buffer}}),Object.defineProperty(P.prototype,"readableFlowing",{enumerable:!1,get:function(){return this._readableState.flowing},set:function(e){this._readableState&&(this._readableState.flowing=e)}}),P._fromList=G,Object.defineProperty(P.prototype,"readableLength",{enumerable:!1,get:function(){return this._readableState.length}}),"function"==typeof Symbol&&(P.from=function(e,t){return void 0===u&&(u=n(727)),u(P,e,t)})},170:function(e,t,r){"use strict";e.exports=l;var n=r(646).q,i=n.ERR_METHOD_NOT_IMPLEMENTED,o=n.ERR_MULTIPLE_CALLBACK,s=n.ERR_TRANSFORM_ALREADY_TRANSFORMING,a=n.ERR_TRANSFORM_WITH_LENGTH_0,c=r(403);function u(e,t){var r=this._transformState;r.transforming=!1;var n=r.writecb;if(null===n)return this.emit("error",new o);r.writechunk=null,r.writecb=null,null!=t&&this.push(t),n(e);var i=this._readableState;i.reading=!1,(i.needReadable||i.length<i.highWaterMark)&&this._read(i.highWaterMark)}function l(e){if(!(this instanceof l))return new l(e);c.call(this,e),this._transformState={afterTransform:u.bind(this),needTransform:!1,transforming:!1,writecb:null,writechunk:null,writeencoding:null},this._readableState.needReadable=!0,this._readableState.sync=!1,e&&("function"==typeof e.transform&&(this._transform=e.transform),"function"==typeof e.flush&&(this._flush=e.flush)),this.on("prefinish",d)}function d(){var e=this;"function"!=typeof this._flush||this._readableState.destroyed?f(this,null,null):this._flush(function(t,r){f(e,t,r)})}function f(e,t,r){if(t)return e.emit("error",t);if(null!=r&&e.push(r),e._writableState.length)throw new a;if(e._transformState.transforming)throw new s;return e.push(null)}r(782)(l,c),l.prototype.push=function(e,t){return this._transformState.needTransform=!1,c.prototype.push.call(this,e,t)},l.prototype._transform=function(e,t,r){r(new i("_transform()"))},l.prototype._write=function(e,t,r){var n=this._transformState;if(n.writecb=r,n.writechunk=e,n.writeencoding=t,!n.transforming){var i=this._readableState;(n.needTransform||i.needReadable||i.length<i.highWaterMark)&&this._read(i.highWaterMark)}},l.prototype._read=function(e){var t=this._transformState;null===t.writechunk||t.transforming?t.needTransform=!0:(t.transforming=!0,this._transform(t.writechunk,t.writeencoding,t.afterTransform))},l.prototype._destroy=function(e,t){c.prototype._destroy.call(this,e,function(e){t(e)})}},337:function(e,t,n){"use strict";function o(e){var t=this;this.next=null,this.entry=null,this.finish=function(){V(t,e)}}e.exports=T,T.WritableState=O;var s,a,c={deprecate:n(769)},u=n(678),l=n(300).Buffer,d=r.g.Uint8Array||function(){};function f(e){return l.from(e)}function h(e){return l.isBuffer(e)||e instanceof d}var p=n(25),y=n(776).getHighWaterMark,g=n(646).q,m=g.ERR_INVALID_ARG_TYPE,b=g.ERR_METHOD_NOT_IMPLEMENTED,v=g.ERR_MULTIPLE_CALLBACK,w=g.ERR_STREAM_CANNOT_PIPE,_=g.ERR_STREAM_DESTROYED,E=g.ERR_STREAM_NULL_VALUES,S=g.ERR_STREAM_WRITE_AFTER_END,x=g.ERR_UNKNOWN_ENCODING,A=p.errorOrDestroy;function I(){}function O(e,t,r){s=s||n(403),e=e||{},"boolean"!=typeof r&&(r=t instanceof s),this.objectMode=!!e.objectMode,r&&(this.objectMode=this.objectMode||!!e.writableObjectMode),this.highWaterMark=y(this,e,"writableHighWaterMark",r),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;var i=!1===e.decodeStrings;this.decodeStrings=!i,this.defaultEncoding=e.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(e){R(t,e)},this.writecb=null,this.writelen=0,this.bufferedRequest=null,this.lastBufferedRequest=null,this.pendingcb=0,this.prefinished=!1,this.errorEmitted=!1,this.emitClose=!1!==e.emitClose,this.autoDestroy=!!e.autoDestroy,this.bufferedRequestCount=0,this.corkedRequestsFree=new o(this)}function T(e){var t=this instanceof(s=s||n(403));if(!t&&!a.call(T,this))return new T(e);this._writableState=new O(e,this,t),this.writable=!0,e&&("function"==typeof e.write&&(this._write=e.write),"function"==typeof e.writev&&(this._writev=e.writev),"function"==typeof e.destroy&&(this._destroy=e.destroy),"function"==typeof e.final&&(this._final=e.final)),u.call(this)}function P(e,t){var r=new S;A(e,r),i.nextTick(t,r)}function M(e,t,r,n){var o;return null===r?o=new E:"string"==typeof r||t.objectMode||(o=new m("chunk",["string","Buffer"],r)),!o||(A(e,o),i.nextTick(n,o),!1)}function N(e,t,r){return e.objectMode||!1===e.decodeStrings||"string"!=typeof t||(t=l.from(t,r)),t}function k(e,t,r,n,i,o){if(!r){var s=N(t,n,i);n!==s&&(r=!0,i="buffer",n=s)}var a=t.objectMode?1:n.length;t.length+=a;var c=t.length<t.highWaterMark;if(c||(t.needDrain=!0),t.writing||t.corked){var u=t.lastBufferedRequest;t.lastBufferedRequest={chunk:n,encoding:i,isBuf:r,callback:o,next:null},u?u.next=t.lastBufferedRequest:t.bufferedRequest=t.lastBufferedRequest,t.bufferedRequestCount+=1}else C(e,t,!1,a,n,i,o);return c}function C(e,t,r,n,i,o,s){t.writelen=n,t.writecb=s,t.writing=!0,t.sync=!0,t.destroyed?t.onwrite(new _("write")):r?e._writev(i,t.onwrite):e._write(i,o,t.onwrite),t.sync=!1}function D(e,t,r,n,o){--t.pendingcb,r?(i.nextTick(o,n),i.nextTick(z,e,t),e._writableState.errorEmitted=!0,A(e,n)):(o(n),e._writableState.errorEmitted=!0,A(e,n),z(e,t))}function j(e){e.writing=!1,e.writecb=null,e.length-=e.writelen,e.writelen=0}function R(e,t){var r=e._writableState,n=r.sync,o=r.writecb;if("function"!=typeof o)throw new v;if(j(r),t)D(e,r,n,t,o);else{var s=$(r)||e.destroyed;s||r.corked||r.bufferProcessing||!r.bufferedRequest||U(e,r),n?i.nextTick(L,e,r,s,o):L(e,r,s,o)}}function L(e,t,r,n){r||B(e,t),t.pendingcb--,n(),z(e,t)}function B(e,t){0===t.length&&t.needDrain&&(t.needDrain=!1,e.emit("drain"))}function U(e,t){t.bufferProcessing=!0;var r=t.bufferedRequest;if(e._writev&&r&&r.next){var n=Array(t.bufferedRequestCount),i=t.corkedRequestsFree;i.entry=r;for(var s=0,a=!0;r;)n[s]=r,r.isBuf||(a=!1),r=r.next,s+=1;n.allBuffers=a,C(e,t,!0,t.length,n,"",i.finish),t.pendingcb++,t.lastBufferedRequest=null,i.next?(t.corkedRequestsFree=i.next,i.next=null):t.corkedRequestsFree=new o(t),t.bufferedRequestCount=0}else{for(;r;){var c=r.chunk,u=r.encoding,l=r.callback,d=t.objectMode?1:c.length;if(C(e,t,!1,d,c,u,l),r=r.next,t.bufferedRequestCount--,t.writing)break}null===r&&(t.lastBufferedRequest=null)}t.bufferedRequest=r,t.bufferProcessing=!1}function $(e){return e.ending&&0===e.length&&null===e.bufferedRequest&&!e.finished&&!e.writing}function K(e,t){e._final(function(r){t.pendingcb--,r&&A(e,r),t.prefinished=!0,e.emit("prefinish"),z(e,t)})}function F(e,t){t.prefinished||t.finalCalled||("function"!=typeof e._final||t.destroyed?(t.prefinished=!0,e.emit("prefinish")):(t.pendingcb++,t.finalCalled=!0,i.nextTick(K,e,t)))}function z(e,t){var r=$(t);if(r&&(F(e,t),0===t.pendingcb&&(t.finished=!0,e.emit("finish"),t.autoDestroy))){var n=e._readableState;(!n||n.autoDestroy&&n.endEmitted)&&e.destroy()}return r}function q(e,t,r){t.ending=!0,z(e,t),r&&(t.finished?i.nextTick(r):e.once("finish",r)),t.ended=!0,e.writable=!1}function V(e,t,r){var n=e.entry;for(e.entry=null;n;){var i=n.callback;t.pendingcb--,i(r),n=n.next}t.corkedRequestsFree.next=e}n(782)(T,u),O.prototype.getBuffer=function(){for(var e=this.bufferedRequest,t=[];e;)t.push(e),e=e.next;return t},function(){try{Object.defineProperty(O.prototype,"buffer",{get:c.deprecate(function(){return this.getBuffer()},"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.","DEP0003")})}catch(e){}}(),"function"==typeof Symbol&&Symbol.hasInstance&&"function"==typeof Function.prototype[Symbol.hasInstance]?(a=Function.prototype[Symbol.hasInstance],Object.defineProperty(T,Symbol.hasInstance,{value:function(e){return!!a.call(this,e)||this===T&&e&&e._writableState instanceof O}})):a=function(e){return e instanceof this},T.prototype.pipe=function(){A(this,new w)},T.prototype.write=function(e,t,r){var n=this._writableState,i=!1,o=!n.objectMode&&h(e);return o&&!l.isBuffer(e)&&(e=f(e)),"function"==typeof t&&(r=t,t=null),o?t="buffer":t||(t=n.defaultEncoding),"function"!=typeof r&&(r=I),n.ending?P(this,r):(o||M(this,n,e,r))&&(n.pendingcb++,i=k(this,n,o,e,t,r)),i},T.prototype.cork=function(){this._writableState.corked++},T.prototype.uncork=function(){var e=this._writableState;!e.corked||(e.corked--,e.writing||e.corked||e.bufferProcessing||!e.bufferedRequest||U(this,e))},T.prototype.setDefaultEncoding=function(e){if("string"==typeof e&&(e=e.toLowerCase()),!(["hex","utf8","utf-8","ascii","binary","base64","ucs2","ucs-2","utf16le","utf-16le","raw"].indexOf((e+"").toLowerCase())>-1))throw new x(e);return this._writableState.defaultEncoding=e,this},Object.defineProperty(T.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}}),Object.defineProperty(T.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),T.prototype._write=function(e,t,r){r(new b("_write()"))},T.prototype._writev=null,T.prototype.end=function(e,t,r){var n=this._writableState;return"function"==typeof e?(r=e,e=null,t=null):"function"==typeof t&&(r=t,t=null),null!=e&&this.write(e,t),n.corked&&(n.corked=1,this.uncork()),n.ending||q(this,n,r),this},Object.defineProperty(T.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}}),Object.defineProperty(T.prototype,"destroyed",{enumerable:!1,get:function(){return void 0!==this._writableState&&this._writableState.destroyed},set:function(e){this._writableState&&(this._writableState.destroyed=e)}}),T.prototype.destroy=p.destroy,T.prototype._undestroy=p.undestroy,T.prototype._destroy=function(e,t){t(e)}},871:function(e,t,r){"use strict";function n(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var o,s=r(698),a=Symbol("lastResolve"),c=Symbol("lastReject"),u=Symbol("error"),l=Symbol("ended"),d=Symbol("lastPromise"),f=Symbol("handlePromise"),h=Symbol("stream");function p(e,t){return{value:e,done:t}}function y(e){var t=e[a];if(null!==t){var r=e[h].read();null!==r&&(e[d]=null,e[a]=null,e[c]=null,t(p(r,!1)))}}function g(e){i.nextTick(y,e)}function m(e,t){return function(r,n){e.then(function(){if(t[l]){r(p(void 0,!0));return}t[f](r,n)},n)}}var b=Object.getPrototypeOf(function(){}),v=Object.setPrototypeOf((n(o={get stream(){return this[h]},next:function(){var e,t=this,r=this[u];if(null!==r)return Promise.reject(r);if(this[l])return Promise.resolve(p(void 0,!0));if(this[h].destroyed)return new Promise(function(e,r){i.nextTick(function(){t[u]?r(t[u]):e(p(void 0,!0))})});var n=this[d];if(n)e=new Promise(m(n,this));else{var o=this[h].read();if(null!==o)return Promise.resolve(p(o,!1));e=new Promise(this[f])}return this[d]=e,e}},Symbol.asyncIterator,function(){return this}),n(o,"return",function(){var e=this;return new Promise(function(t,r){e[h].destroy(null,function(e){if(e){r(e);return}t(p(void 0,!0))})})}),o),b),w=function(e){var t,r=Object.create(v,(n(t={},h,{value:e,writable:!0}),n(t,a,{value:null,writable:!0}),n(t,c,{value:null,writable:!0}),n(t,u,{value:null,writable:!0}),n(t,l,{value:e._readableState.endEmitted,writable:!0}),n(t,f,{value:function(e,t){var n=r[h].read();n?(r[d]=null,r[a]=null,r[c]=null,e(p(n,!1))):(r[a]=e,r[c]=t)},writable:!0}),t));return r[d]=null,s(e,function(e){if(e&&"ERR_STREAM_PREMATURE_CLOSE"!==e.code){var t=r[c];null!==t&&(r[d]=null,r[a]=null,r[c]=null,t(e)),r[u]=e;return}var n=r[a];null!==n&&(r[d]=null,r[a]=null,r[c]=null,n(p(void 0,!0))),r[l]=!0}),e.on("readable",g.bind(null,r)),r};e.exports=w},379:function(e,t,r){"use strict";function n(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,n)}return r}function i(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?n(Object(r),!0).forEach(function(t){o(e,t,r[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):n(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}function o(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function s(e,t){if(!(e instanceof t))throw TypeError("Cannot call a class as a function")}function a(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)}}function c(e,t,r){return t&&a(e.prototype,t),r&&a(e,r),e}var u=r(300).Buffer,l=r(837).inspect,d=l&&l.custom||"inspect";function f(e,t,r){u.prototype.copy.call(e,t,r)}e.exports=function(){function e(){s(this,e),this.head=null,this.tail=null,this.length=0}return c(e,[{key:"push",value:function(e){var t={data:e,next:null};this.length>0?this.tail.next=t:this.head=t,this.tail=t,++this.length}},{key:"unshift",value:function(e){var t={data:e,next:this.head};0===this.length&&(this.tail=t),this.head=t,++this.length}},{key:"shift",value:function(){if(0!==this.length){var e=this.head.data;return 1===this.length?this.head=this.tail=null:this.head=this.head.next,--this.length,e}}},{key:"clear",value:function(){this.head=this.tail=null,this.length=0}},{key:"join",value:function(e){if(0===this.length)return"";for(var t=this.head,r=""+t.data;t=t.next;)r+=e+t.data;return r}},{key:"concat",value:function(e){if(0===this.length)return u.alloc(0);for(var t=u.allocUnsafe(e>>>0),r=this.head,n=0;r;)f(r.data,t,n),n+=r.data.length,r=r.next;return t}},{key:"consume",value:function(e,t){var r;return e<this.head.data.length?(r=this.head.data.slice(0,e),this.head.data=this.head.data.slice(e)):r=e===this.head.data.length?this.shift():t?this._getString(e):this._getBuffer(e),r}},{key:"first",value:function(){return this.head.data}},{key:"_getString",value:function(e){var t=this.head,r=1,n=t.data;for(e-=n.length;t=t.next;){var i=t.data,o=e>i.length?i.length:e;if(o===i.length?n+=i:n+=i.slice(0,e),0==(e-=o)){o===i.length?(++r,t.next?this.head=t.next:this.head=this.tail=null):(this.head=t,t.data=i.slice(o));break}++r}return this.length-=r,n}},{key:"_getBuffer",value:function(e){var t=u.allocUnsafe(e),r=this.head,n=1;for(r.data.copy(t),e-=r.data.length;r=r.next;){var i=r.data,o=e>i.length?i.length:e;if(i.copy(t,t.length-e,0,o),0==(e-=o)){o===i.length?(++n,r.next?this.head=r.next:this.head=this.tail=null):(this.head=r,r.data=i.slice(o));break}++n}return this.length-=n,t}},{key:d,value:function(e,t){return l(this,i({},t,{depth:0,customInspect:!1}))}}]),e}()},25:function(e){"use strict";function t(e,t){var o=this,a=this._readableState&&this._readableState.destroyed,c=this._writableState&&this._writableState.destroyed;return a||c?t?t(e):e&&(this._writableState?this._writableState.errorEmitted||(this._writableState.errorEmitted=!0,i.nextTick(s,this,e)):i.nextTick(s,this,e)):(this._readableState&&(this._readableState.destroyed=!0),this._writableState&&(this._writableState.destroyed=!0),this._destroy(e||null,function(e){!t&&e?o._writableState?o._writableState.errorEmitted?i.nextTick(n,o):(o._writableState.errorEmitted=!0,i.nextTick(r,o,e)):i.nextTick(r,o,e):t?(i.nextTick(n,o),t(e)):i.nextTick(n,o)})),this}function r(e,t){s(e,t),n(e)}function n(e){(!e._writableState||e._writableState.emitClose)&&(!e._readableState||e._readableState.emitClose)&&e.emit("close")}function o(){this._readableState&&(this._readableState.destroyed=!1,this._readableState.reading=!1,this._readableState.ended=!1,this._readableState.endEmitted=!1),this._writableState&&(this._writableState.destroyed=!1,this._writableState.ended=!1,this._writableState.ending=!1,this._writableState.finalCalled=!1,this._writableState.prefinished=!1,this._writableState.finished=!1,this._writableState.errorEmitted=!1)}function s(e,t){e.emit("error",t)}function a(e,t){var r=e._readableState,n=e._writableState;r&&r.autoDestroy||n&&n.autoDestroy?e.destroy(t):e.emit("error",t)}e.exports={destroy:t,undestroy:o,errorOrDestroy:a}},698:function(e,t,r){"use strict";
37var n=r(646).q.ERR_STREAM_PREMATURE_CLOSE;function i(e){var t=!1;return function(){if(!t){t=!0;for(var r=arguments.length,n=Array(r),i=0;i<r;i++)n[i]=arguments[i];e.apply(this,n)}}}function o(){}function s(e){return e.setHeader&&"function"==typeof e.abort}function a(e,t,r){if("function"==typeof t)return a(e,null,t);t||(t={}),r=i(r||o);var c=t.readable||!1!==t.readable&&e.readable,u=t.writable||!1!==t.writable&&e.writable,l=function(){e.writable||f()},d=e._writableState&&e._writableState.finished,f=function(){u=!1,d=!0,c||r.call(e)},h=e._readableState&&e._readableState.endEmitted,p=function(){c=!1,h=!0,u||r.call(e)},y=function(t){r.call(e,t)},g=function(){var t;return c&&!h?(e._readableState&&e._readableState.ended||(t=new n),r.call(e,t)):u&&!d?(e._writableState&&e._writableState.ended||(t=new n),r.call(e,t)):void 0},m=function(){e.req.on("finish",f)};return s(e)?(e.on("complete",f),e.on("abort",g),e.req?m():e.on("request",m)):u&&!e._writableState&&(e.on("end",l),e.on("close",l)),e.on("end",p),e.on("finish",f),!1!==t.error&&e.on("error",y),e.on("close",g),function(){e.removeListener("complete",f),e.removeListener("abort",g),e.removeListener("request",m),e.req&&e.req.removeListener("finish",f),e.removeListener("end",l),e.removeListener("close",l),e.removeListener("finish",f),e.removeListener("end",p),e.removeListener("error",y),e.removeListener("close",g)}}e.exports=a},727:function(e,t,r){"use strict";function n(e,t,r,n,i,o,s){try{var a=e[o](s),c=a.value}catch(e){r(e);return}a.done?t(c):Promise.resolve(c).then(n,i)}function i(e){return function(){var t=this,r=arguments;return new Promise(function(i,o){var s=e.apply(t,r);function a(e){n(s,i,o,a,c,"next",e)}function c(e){n(s,i,o,a,c,"throw",e)}a(void 0)})}}function o(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,n)}return r}function s(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?o(Object(r),!0).forEach(function(t){a(e,t,r[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):o(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}function a(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var c=r(646).q.ERR_INVALID_ARG_TYPE;function u(e,t,r){if(t&&"function"==typeof t.next)n=t;else if(t&&t[Symbol.asyncIterator])n=t[Symbol.asyncIterator]();else if(t&&t[Symbol.iterator])n=t[Symbol.iterator]();else throw new c("iterable",["Iterable"],t);var n,o=new e(s({objectMode:!0},r)),a=!1;function u(){return l.apply(this,arguments)}function l(){return(l=i(function*(){try{var e=yield n.next(),t=e.value;e.done?o.push(null):o.push((yield t))?u():a=!1}catch(e){o.destroy(e)}})).apply(this,arguments)}return o._read=function(){a||(a=!0,u())},o}e.exports=u},442:function(e,t,r){"use strict";function n(e){var t=!1;return function(){t||(t=!0,e.apply(void 0,arguments))}}var i,o=r(646).q,s=o.ERR_MISSING_ARGS,a=o.ERR_STREAM_DESTROYED;function c(e){if(e)throw e}function u(e){return e.setHeader&&"function"==typeof e.abort}function l(e,t,o,s){s=n(s);var c=!1;e.on("close",function(){c=!0}),void 0===i&&(i=r(698)),i(e,{readable:t,writable:o},function(e){if(e)return s(e);c=!0,s()});var l=!1;return function(t){if(!c&&!l){if(l=!0,u(e))return e.abort();if("function"==typeof e.destroy)return e.destroy();s(t||new a("pipe"))}}}function d(e){e()}function f(e,t){return e.pipe(t)}function h(e){return e.length&&"function"==typeof e[e.length-1]?e.pop():c}function p(){for(var e,t=arguments.length,r=Array(t),n=0;n<t;n++)r[n]=arguments[n];var i=h(r);if(Array.isArray(r[0])&&(r=r[0]),r.length<2)throw new s("streams");var o=r.map(function(t,n){var s=n<r.length-1;return l(t,s,n>0,function(t){e||(e=t),t&&o.forEach(d),s||(o.forEach(d),i(e))})});return r.reduce(f)}e.exports=p},776:function(e,t,r){"use strict";var n=r(646).q.ERR_INVALID_OPT_VALUE;function i(e,t,r){return null!=e.highWaterMark?e.highWaterMark:t?e[r]:null}function o(e,t,r,o){var s=i(t,o,r);if(null!=s){if(!(isFinite(s)&&Math.floor(s)===s)||s<0)throw new n(o?r:"highWaterMark",s);return Math.floor(s)}return e.objectMode?16:16384}e.exports={getHighWaterMark:o}},678:function(e,t,r){e.exports=r(781)},55:function(e,t,r){var n=r(300),i=n.Buffer;function o(e,t){for(var r in e)t[r]=e[r]}function s(e,t,r){return i(e,t,r)}i.from&&i.alloc&&i.allocUnsafe&&i.allocUnsafeSlow?e.exports=n:(o(n,t),t.Buffer=s),s.prototype=Object.create(i.prototype),o(i,s),s.from=function(e,t,r){if("number"==typeof e)throw TypeError("Argument must not be a number");return i(e,t,r)},s.alloc=function(e,t,r){if("number"!=typeof e)throw TypeError("Argument must be a number");var n=i(e);return void 0!==t?"string"==typeof r?n.fill(t,r):n.fill(t):n.fill(0),n},s.allocUnsafe=function(e){if("number"!=typeof e)throw TypeError("Argument must be a number");return i(e)},s.allocUnsafeSlow=function(e){if("number"!=typeof e)throw TypeError("Argument must be a number");return n.SlowBuffer(e)}},173:function(e,t,r){e.exports=i;var n=r(361).EventEmitter;function i(){n.call(this)}r(782)(i,n),i.Readable=r(709),i.Writable=r(337),i.Duplex=r(403),i.Transform=r(170),i.PassThrough=r(889),i.finished=r(698),i.pipeline=r(442),i.Stream=i,i.prototype.pipe=function(e,t){var r=this;function i(t){e.writable&&!1===e.write(t)&&r.pause&&r.pause()}function o(){r.readable&&r.resume&&r.resume()}r.on("data",i),e.on("drain",o),e._isStdio||t&&!1===t.end||(r.on("end",a),r.on("close",c));var s=!1;function a(){s||(s=!0,e.end())}function c(){s||(s=!0,"function"==typeof e.destroy&&e.destroy())}function u(e){if(l(),0===n.listenerCount(this,"error"))throw e}function l(){r.removeListener("data",i),e.removeListener("drain",o),r.removeListener("end",a),r.removeListener("close",c),r.removeListener("error",u),e.removeListener("error",u),r.removeListener("end",l),r.removeListener("close",l),e.removeListener("close",l)}return r.on("error",u),e.on("error",u),r.on("end",l),r.on("close",l),e.on("close",l),e.emit("pipe",r),e}},704:function(e,t,r){"use strict";var n=r(55).Buffer,i=n.isEncoding||function(e){switch((e=""+e)&&e.toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":case"raw":return!0;default:return!1}};function o(e){var t;if(!e)return"utf8";for(;;)switch(e){case"utf8":case"utf-8":return"utf8";case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return"utf16le";
37case"latin1":case"binary":return"latin1";case"base64":case"ascii":case"hex":return e;default:if(t)return;e=(""+e).toLowerCase(),t=!0}}function s(e){var t=o(e);if("string"!=typeof t&&(n.isEncoding===i||!i(e)))throw Error("Unknown encoding: "+e);return t||e}function a(e){var t;switch(this.encoding=s(e),this.encoding){case"utf16le":this.text=p,this.end=y,t=4;break;case"utf8":this.fillLast=d,t=4;break;case"base64":this.text=g,this.end=m,t=3;break;default:this.write=b,this.end=v;return}this.lastNeed=0,this.lastTotal=0,this.lastChar=n.allocUnsafe(t)}function c(e){return e<=127?0:e>>5==6?2:e>>4==14?3:e>>3==30?4:e>>6==2?-1:-2}function u(e,t,r){var n=t.length-1;if(n<r)return 0;var i=c(t[n]);return i>=0?(i>0&&(e.lastNeed=i-1),i):--n<r||-2===i?0:(i=c(t[n]))>=0?(i>0&&(e.lastNeed=i-2),i):--n<r||-2===i?0:(i=c(t[n]))>=0?(i>0&&(2===i?i=0:e.lastNeed=i-3),i):0}function l(e,t,r){if((192&t[0])!=128)return e.lastNeed=0,"�";if(e.lastNeed>1&&t.length>1){if((192&t[1])!=128)return e.lastNeed=1,"�";if(e.lastNeed>2&&t.length>2&&(192&t[2])!=128)return e.lastNeed=2,"�"}}function d(e){var t=this.lastTotal-this.lastNeed,r=l(this,e,t);return void 0!==r?r:this.lastNeed<=e.length?(e.copy(this.lastChar,t,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal)):void(e.copy(this.lastChar,t,0,e.length),this.lastNeed-=e.length)}function f(e,t){var r=u(this,e,t);if(!this.lastNeed)return e.toString("utf8",t);this.lastTotal=r;var n=e.length-(r-this.lastNeed);return e.copy(this.lastChar,0,n),e.toString("utf8",t,n)}function h(e){var t=e&&e.length?this.write(e):"";return this.lastNeed?t+"�":t}function p(e,t){if((e.length-t)%2==0){var r=e.toString("utf16le",t);if(r){var n=r.charCodeAt(r.length-1);if(n>=55296&&n<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=e[e.length-2],this.lastChar[1]=e[e.length-1],r.slice(0,-1)}return r}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=e[e.length-1],e.toString("utf16le",t,e.length-1)}function y(e){var t=e&&e.length?this.write(e):"";if(this.lastNeed){var r=this.lastTotal-this.lastNeed;return t+this.lastChar.toString("utf16le",0,r)}return t}function g(e,t){var r=(e.length-t)%3;return 0===r?e.toString("base64",t):(this.lastNeed=3-r,this.lastTotal=3,1===r?this.lastChar[0]=e[e.length-1]:(this.lastChar[0]=e[e.length-2],this.lastChar[1]=e[e.length-1]),e.toString("base64",t,e.length-r))}function m(e){var t=e&&e.length?this.write(e):"";return this.lastNeed?t+this.lastChar.toString("base64",0,3-this.lastNeed):t}function b(e){return e.toString(this.encoding)}function v(e){return e&&e.length?this.write(e):""}t.s=a,a.prototype.write=function(e){var t,r;if(0===e.length)return"";if(this.lastNeed){if(void 0===(t=this.fillLast(e)))return"";r=this.lastNeed,this.lastNeed=0}else r=0;return r<e.length?t?t+this.text(e,r):this.text(e,r):t||""},a.prototype.end=h,a.prototype.text=f,a.prototype.fillLast=function(e){if(this.lastNeed<=e.length)return e.copy(this.lastChar,this.lastTotal-this.lastNeed,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);e.copy(this.lastChar,this.lastTotal-this.lastNeed,0,e.length),this.lastNeed-=e.length}},769:function(e){function t(e,t){if(n("noDeprecation"))return e;var r=!1;return function(){if(!r){if(n("throwDeprecation"))throw Error(t);n("traceDeprecation")?console.trace(t):console.warn(t),r=!0}return e.apply(this,arguments)}}function n(e){try{if(!r.g.localStorage)return!1}catch(e){return!1}var t=r.g.localStorage[e];return null!=t&&"true"===String(t).toLowerCase()}e.exports=t},300:function(e){"use strict";e.exports=r(75927)},361:function(e){"use strict";e.exports=r(60429)},781:function(e){"use strict";e.exports=r(60429).EventEmitter},837:function(e){"use strict";e.exports=r(53964)}},o={};function s(e){var r=o[e];if(void 0!==r)return r.exports;var n=o[e]={exports:{}},i=!0;try{t[e](n,n.exports,s),i=!1}finally{i&&delete o[e]}return n.exports}s.ab=n+"/";var a=s(173);e.exports=a}()},31493:(e,t,r)=>{var n="/",i=r(2818),o=r(75927).Buffer;!function(){var t={523:function(e){e.exports={100:"Continue",101:"Switching Protocols",102:"Processing",200:"OK",201:"Created",202:"Accepted",203:"Non-Authoritative Information",204:"No Content",205:"Reset Content",206:"Parti
37al Content",207:"Multi-Status",208:"Already Reported",226:"IM Used",300:"Multiple Choices",301:"Moved Permanently",302:"Found",303:"See Other",304:"Not Modified",305:"Use Proxy",307:"Temporary Redirect",308:"Permanent Redirect",400:"Bad Request",401:"Unauthorized",402:"Payment Required",403:"Forbidden",404:"Not Found",405:"Method Not Allowed",406:"Not Acceptable",407:"Proxy Authentication Required",408:"Request Timeout",409:"Conflict",410:"Gone",411:"Length Required",412:"Precondition Failed",413:"Payload Too Large",414:"URI Too Long",415:"Unsupported Media Type",416:"Range Not Satisfiable",417:"Expectation Failed",418:"I'm a teapot",421:"Misdirected Request",422:"Unprocessable Entity",423:"Locked",424:"Failed Dependency",425:"Unordered Collection",426:"Upgrade Required",428:"Precondition Required",429:"Too Many Requests",431:"Request Header Fields Too Large",451:"Unavailable For Legal Reasons",500:"Internal Server Error",501:"Not Implemented",502:"Bad Gateway",503:"Service Unavailable",504:"Gateway Timeout",505:"HTTP Version Not Supported",506:"Variant Also Negotiates",507:"Insufficient Storage",508:"Loop Detected",509:"Bandwidth Limit Exceeded",510:"Not Extended",511:"Network Authentication Required"}},782: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}}},646:function(e){"use strict";let t={};function r(e,r,n){function i(e,t,n){return"string"==typeof r?r:r(e,t,n)}n||(n=Error);class o extends n{constructor(e,t,r){super(i(e,t,r))}}o.prototype.name=n.name,o.prototype.code=e,t[e]=o}function n(e,t){if(!Array.isArray(e))return`of ${t} ${String(e)}`;{let r=e.length;return(e=e.map(e=>String(e)),r>2)?`one of ${t} ${e.slice(0,r-1).join(", ")}, or `+e[r-1]:2===r?`one of ${t} ${e[0]} or ${e[1]}`:`of ${t} ${e[0]}`}}function i(e,t,r){return e.substr(!r||r<0?0:+r,t.length)===t}function o(e,t,r){return(void 0===r||r>e.length)&&(r=e.length),e.substring(r-t.length,r)===t}function s(e,t,r){return"number"!=typeof r&&(r=0),!(r+t.length>e.length)&&-1!==e.indexOf(t,r)}r("ERR_INVALID_OPT_VALUE",function(e,t){return'The value "'+t+'" is invalid for option "'+e+'"'},TypeError),r("ERR_INVALID_ARG_TYPE",function(e,t,r){let a,c;if("string"==typeof t&&i(t,"not ")?(a="must not be",t=t.replace(/^not /,"")):a="must be",o(e," argument"))c=`The ${e} ${a} ${n(t,"type")}`;else{let r=s(e,".")?"property":"argument";c=`The "${e}" ${r} ${a} ${n(t,"type")}`}return c+`. Received type ${typeof r}`},TypeError),r("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF"),r("ERR_METHOD_NOT_IMPLEMENTED",function(e){return"The "+e+" method is not implemented"}),r("ERR_STREAM_PREMATURE_CLOSE","Premature close"),r("ERR_STREAM_DESTROYED",function(e){return"Cannot call "+e+" after a stream was destroyed"}),r("ERR_MULTIPLE_CALLBACK","Callback called multiple times"),r("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable"),r("ERR_STREAM_WRITE_AFTER_END","write after end"),r("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError),r("ERR_UNKNOWN_ENCODING",function(e){return"Unknown encoding: "+e},TypeError),r("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event"),e.exports.q=t},403:function(e,t,r){"use strict";var n=Object.keys||function(e){var t=[];for(var r in e)t.push(r);return t};e.exports=l;var o=r(709),s=r(337);r(782)(l,o);for(var a=n(s.prototype),c=0;c<a.length;c++){var u=a[c];l.prototype[u]||(l.prototype[u]=s.prototype[u])}function l(e){if(!(this instanceof l))return new l(e);o.call(this,e),s.call(this,e),this.allowHalfOpen=!0,e&&(!1===e.readable&&(this.readable=!1),!1===e.writable&&(this.writable=!1),!1===e.allowHalfOpen&&(this.allowHalfOpen=!1,this.once("end",d)))}function d(){this._writableState.ended||i.nextTick(f,this)}function f(e){e.end()}Object.defineProperty(l.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),Object.defineProperty(l.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}}),Object.defineProperty(l.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}}),Object.defineProperty(l.prototype,"destroyed",{enumerable:!1,get:function(){return void 0!==this._readableState&&void 0!==this._writableState&&this._readableState.destroyed&&this._writableState.destroyed},set:function(e){void 0!==this._readableState&&void 0!==this._writableState&&(this._readableState.destroyed=e,this._writableState.destroyed=e)}})},889:function(e,t,r){"use strict";e.exports=i;var n=r(170);function i(e){if(!(this instanceof i))return new i(e);n.call(this,e)}r(782)(i,n),i.prototype._transform=function(e,t,r){r(null,e)}},709:function(e,t,n){"use strict";e.exports=P,P.ReadableState=T,n(361).EventEmitter;var o,s,a,c,u,l=function(e,t){return e.listeners(t).length},d=n(678),f=n(300).Buffer,h=r.g.Uint8Array||function(){};function p(e){return f.from(e)}function y(e){return f.isBuffer(e)||e instanceof h}var g=n(837);s=g&&g.debuglog?g.debuglog("stream"):function(){};var m=n(379),b=n(25),v=n(776).getHighWaterMark,w=n(646).q,_=w.ERR_INVALID_ARG_TYPE,E=w.ERR_STREAM_PUSH_AFTER_EOF,S=w.ERR_METHOD_NOT_IMPLEMENT
vendor: 26,831 bytes, line 37
37ED,x=w.ERR_STREAM_UNSHIFT_AFTER_END_EVENT;n(782)(P,d);var A=b.errorOrDestroy,I=["error","close","destroy","pause","resume"];function O(e,t,r){if("function"==typeof e.prependListener)return e.prependListener(t,r);e._events&&e._events[t]?Array.isArray(e._events[t])?e._events[t].unshift(r):e._events[t]=[r,e._events[t]]:e.on(t,r)}function T(e,t,r){o=o||n(403),e=e||{},"boolean"!=typeof r&&(r=t instanceof o),this.objectMode=!!e.objectMode,r&&(this.objectMode=this.objectMode||!!e.readableObjectMode),this.highWaterMark=v(this,e,"readableHighWaterMark",r),this.buffer=new m,this.length=0,this.pipes=null,this.pipesCount=0,this.flowing=null,this.ended=!1,this.endEmitted=!1,this.reading=!1,this.sync=!0,this.needReadable=!1,this.emittedReadable=!1,this.readableListening=!1,this.resumeScheduled=!1,this.paused=!0,this.emitClose=!1!==e.emitClose,this.autoDestroy=!!e.autoDestroy,this.destroyed=!1,this.defaultEncoding=e.defaultEncoding||"utf8",this.awaitDrain=0,this.readingMore=!1,this.decoder=null,this.encoding=null,e.encoding&&(a||(a=n(704).s),this.decoder=new a(e.encoding),this.encoding=e.encoding)}function P(e){if(o=o||n(403),!(this instanceof P))return new P(e);var t=this instanceof o;this._readableState=new T(e,this,t),this.readable=!0,e&&("function"==typeof e.read&&(this._read=e.read),"function"==typeof e.destroy&&(this._destroy=e.destroy)),d.call(this)}function M(e,t,r,n,i){s("readableAddChunk",t);var o,a=e._readableState;if(null===t)a.reading=!1,R(e,a);else if(i||(o=k(a,t)),o)A(e,o);else if(a.objectMode||t&&t.length>0){if("string"==typeof t||a.objectMode||Object.getPrototypeOf(t)===f.prototype||(t=p(t)),n)a.endEmitted?A(e,new x):N(e,a,t,!0);else if(a.ended)A(e,new E);else{if(a.destroyed)return!1;a.reading=!1,a.decoder&&!r?(t=a.decoder.write(t),a.objectMode||0!==t.length?N(e,a,t,!1):U(e,a)):N(e,a,t,!1)}}else n||(a.reading=!1,U(e,a));return!a.ended&&(a.length<a.highWaterMark||0===a.length)}function N(e,t,r,n){t.flowing&&0===t.length&&!t.sync?(t.awaitDrain=0,e.emit("data",r)):(t.length+=t.objectMode?1:r.length,n?t.buffer.unshift(r):t.buffer.push(r),t.needReadable&&L(e)),U(e,t)}function k(e,t){var r;return y(t)||"string"==typeof t||void 0===t||e.objectMode||(r=new _("chunk",["string","Buffer","Uint8Array"],t)),r}Object.defineProperty(P.prototype,"destroyed",{enumerable:!1,get:function(){return void 0!==this._readableState&&this._readableState.destroyed},set:function(e){this._readableState&&(this._readableState.destroyed=e)}}),P.prototype.destroy=b.destroy,P.prototype._undestroy=b.undestroy,P.prototype._destroy=function(e,t){t(e)},P.prototype.push=function(e,t){var r,n=this._readableState;return n.objectMode?r=!0:"string"==typeof e&&((t=t||n.defaultEncoding)!==n.encoding&&(e=f.from(e,t),t=""),r=!0),M(this,e,t,!1,r)},P.prototype.unshift=function(e){return M(this,e,null,!0,!1)},P.prototype.isPaused=function(){return!1===this._readableState.flowing},P.prototype.setEncoding=function(e){a||(a=n(704).s);var t=new a(e);this._readableState.decoder=t,this._readableState.encoding=this._readableState.decoder.encoding;for(var r=this._readableState.buffer.head,i="";null!==r;)i+=t.write(r.data),r=r.next;return this._readableState.buffer.clear(),""!==i&&this._readableState.buffer.push(i),this._readableState.length=i.length,this};var C=0x40000000;function D(e){return e>=C?e=C:(e--,e|=e>>>1,e|=e>>>2,e|=e>>>4,e|=e>>>8,e|=e>>>16,e++),e}function j(e,t){return e<=0||0===t.length&&t.ended?0:t.objectMode?1:e!=e?t.flowing&&t.length?t.buffer.head.data.length:t.length:(e>t.highWaterMark&&(t.highWaterMark=D(e)),e<=t.length)?e:t.ended?t.length:(t.needReadable=!0,0)}function R(e,t){if(s("onEofChunk"),!t.ended){if(t.decoder){var r=t.decoder.end();r&&r.length&&(t.buffer.push(r),t.length+=t.objectMode?1:r.length)}t.ended=!0,t.sync?L(e):(t.needReadable=!1,t.emittedReadable||(t.emittedReadable=!0,B(e)))}}function L(e){var t=e._readableState;s("emitReadable",t.needReadable,t.emittedReadable),t.needReadable=!1,t.emittedReadable||(s("emitReadable",t.flowing),t.emittedReadable=!0,i.nextTick(B,e))}function B(e){var t=e._readableState;s("emitReadable_",t.destroyed,t.length,t.ended),!t.destroyed&&(t.length||t.ended)&&(e.emit("readable"),t.emittedReadable=!1),t.needReadable=!t.flowing&&!t.ended&&t.length<=t.highWaterMark,H(e)}function U(e,t){t.readingMore||(t.readingMore=!0,i.nextTick($,e,t))}function $(e,t){for(;!t.reading&&!t.ended&&(t.length<t.highWaterMark||t.flowing&&0===t.length);){var r=t.length;if(s("maybeReadMore read 0"),e.read(0),r===t.length)break}t.readingMore=!1}function K(e){return function(){var t=e._readableState;s("pipeOnDrain",t.awaitDrain),t.awaitDrain&&t.awaitDrain--,0===t.awaitDrain&&l(e,"data")&&(t.flowing=!0,H(e))}}function F(e){var t=e._readableState;t.readableListening=e.listenerCount("readable")>0,t.resumeScheduled&&!t.paused?t.flowing=!0:e.listenerCount("data")>0&&e.resume()}function z(e){s("readable nexttick read 0"),e.read(0)}function q(e,t){t.resumeScheduled||(t.resumeScheduled=!0,i.nextTick(V,e,t))}function V(e,t){s("resume",t.reading),t.reading||e.read(0),t.resumeScheduled=!1,e.emit("resume"),H(e),t.flowing&&!t.reading&&e.read(0)}function H(e){var t=e._readableState;for(s("flow",t.flowing);t.flowing&&null!==e.read(););}function G(e,t){var r;return 0===t.length?null:(t.objectMode?r=t.buffer.shift():!e||e>=t.length?(r=t.decoder?t.buffer.join(""):1===t.buffer.length?t.buffer.first():t.buffer.concat(t.length),t.buffer.clear()):r=t.buffer.consume(e,t.decoder),r)}function W(e){var t=e._readableState;s("endReadable",t.endEmitted),t.endEmitted||(t.ended=!0,i.nextTick(J,t,e))}function J(e,t){if(s("endReadableNT",e.endEmitted,e.length),!e.endEmitted&&0===e.length&&(e.endEmitted=!0,t.readable=!1,t.emit("end"),e.autoDestroy)){var r=t._writableState;(!r||r.autoDestroy&&r.finished)&&t.destroy()}}function Z(e,t){for(var r=0,n=e.length;r<n;r++)if(e[r]===t)return r;return -1}P.prototype.read=function(e){s("read",e),e=parseInt(e,10);var t,r=this._readableState,n=e;if(0!==e&&(r.emittedReadable=!1),0===e&&r.needReadable&&((0!==r.highWaterMark?r.length>=r.highWaterMark:r.length>0)||r.ended))return s("read: emitReadable",r.length,r.ended),0===r.length&&r.ended?W(this):L(this),null;if(0===(e=j(e,r))&&r.ended)return 0===r.length&&W(this),null;var i=r.needReadable;return s("need readable",i),(0===r.length||r.length-e<r.highWaterMark)&&s("length less than watermark",i=!0),r.ended||r.reading?s("reading or ended",i=!1):i&&(s("do read"),r.reading=!0,r.sync=!0,0===r.length&&(r.needReadable=!0),this._read(r.highWaterMark),r.sync=!1,r.reading||(e=j(n,r))),null===(t=e>0?G(e,r):null)?(r.needReadable=r.length<=r.highWaterMark,e=0):(r.length-=e,r.awaitDrain=0),0===r.length&&(r.ended||(r.needReadable=!0),n!==e&&r.ended&&W(this)),null!==t&&this.emit("data",t),t},P.prototype._read=function(e){A(this,new S("_read()"))},P.prototype.pipe=function(e,t){var r=this,n=this._readableState;switch(n.pipesCount){case 0:n.pipes=e;break;case 1:n.pipes=[n.pipes,e];break;default:n.pipes.push(e)}n.pipesCount+=1,s("pipe count=%d opts=%j",n.pipesCount,t);var o=t&&!1===t.end||e===i.stdout||e===i.stderr?m:c;function a(e,t){s("onunpipe"),e===r&&t&&!1===t.hasUnpiped&&(t.hasUnpiped=!0,f())}function c(){s("onend"),e.end()}n.endEmitted?i.nextTick(o):r.once("end",o),e.on("unpipe",a);var u=K(r);e.on("drain",u);var d=!1;function f(){s("cleanup"),e.removeListener("close",y),e.removeListener("finish",g),e.removeListener("drain",u),e.removeListener("error",p),e.removeListener("unpipe",a),r.removeListener("end",c),r.removeListener("end",m),r.removeListener("data",h),d=!0,n.awaitDrain&&(!e._writableState||e._writableState.needDrain)&&u()}function h(t){s("ondata");var i=e.write(t);s("dest.write",i),!1===i&&((1===n.pipesCount&&n.pipes===e||n.pipesCount>1&&-1!==Z(n.pipes,e))&&!d&&(s("false write response, pause",n.awaitDrain),n.awaitDrain++),r.pause())}function p(t){s("onerror",t),m(),e.removeListener("error",p),0===l(e,"error")&&A(e,t)}function y(){e.removeListener("finish",g),m()}function g(){s("onfinish"),e.removeListener("close",y),m()}function m(){s("unpipe"),r.unpipe(e)}return r.on("data",h),O(e,"error",p),e.once("close",y),e.once("finish",g),e.emit("pipe",r),n.flowing||(s("pipe resume"),r.resume()),e},P.prototype.unpipe=function(e){var t=this._readableState,r={hasUnpiped:!1};if(0===t.pipesCount)return this;if(1===t.pipesCount)return e&&e!==t.pipes||(e||(e=t.pipes),t.pipes=null,t.pipesCount=0,t.flowing=!1,e&&e.emit("unpipe",this,r)),this;if(!e){var n=t.pipes,i=t.pipesCount;t.pipes=null,t.pipesCount=0,t.flowing=!1;for(var o=0;o<i;o++)n[o].emit("unpipe",this,{hasUnpiped:!1});return this}var s=Z(t.pipes,e);return -1===s||(t.pipes.splice(s,1),t.pipesCount-=1,1===t.pipesCount&&(t.pipes=t.pipes[0]),e.emit("unpipe",this,r)),this},P.prototype.on=function(e,t){var r=d.prototype.on.call(this,e,t),n=this._readableState;return"data"===e?(n.readableListening=this.listenerCount("readable")>0,!1!==n.flowing&&this.resume()):"readable"!==e||n.endEmitted||n.readableListening||(n.readableListening=n.needReadable=!0,n.flowing=!1,n.emittedReadable=!1,s("on readable",n.length,n.reading),n.length?L(this):n.reading||i.nextTick(z,this)),r},P.prototype.addListener=P.prototype.on,P.prototype.removeListener=function(e,t){var r=d.prototype.removeListener.call(this,e,t);return"readable"===e&&i.nextTick(F,this),r},P.prototype.removeAllListeners=function(e){var t=d.prototype.removeAllListeners.apply(this,arguments);return("readable"===e||void 0===e)&&i.nextTick(F,this),t},P.prototype.resume=function(){var e=this._readableState;return e.flowing||(s("resume"),e.flowing=!e.readableListening,q(this,e)),e.paused=!1,this},P.prototype.pause=function(){return s("call pause flowing=%j",this._readableState.flowing),!1!==this._readableState.flowing&&(s("pause"),this._readableState.flowing=!1,this.emit("pause")),this._readableState.paused=!0,this},P.prototype.wrap=function(e){var t=this,r=this._readableState,n=!1;for(var i in e.on("end",function(){if(s("wrapped end"),r.decoder&&!r.ended){var e=r.decoder.end();e&&e.length&&t.push(e)}t.push(null)}),e.on("data",function(i){s("wrapped data"),r.decoder&&(i=r.decoder.write(i)),(!r.objectMode||null!=i)&&(r.objectMode||i&&i.length)&&(t.push(i)||(n=!0,e.pause()))}),e)void 0===this[i]&&"function"==typeof e[i]&&(this[i]=function(t){return function(){return e[t].apply(e,arguments)}}(i));for(var o=0;o<I.length;o++)e.on(I[o],this.emit.bind(this,I[o]));return this._read=function(t){s("wrapped _read",t),n&&(n=!1,e.resume())},this},"function"==typeof Symbol&&(P.prototype[Symbol.asyncIterator]=function(){return void 0===c&&(c=n(871)),c(this)}),Object.defineProperty(P.prototype,"readableHighWaterMark",{enumerable:!1,get:function(){return this._readableState.highWaterMark}}),Object.defineProperty(P.prototype,"readableBuffer",{enumerable:!1,get:function(){return this._readableState&&this._readableState.buffer}}),Object.defineProperty(P.prototype,"readableFlowing",{enumerable:!1,get:function(){return this._readableState.flowing},set:function(e){this._readableState&&(this._readableState.flowing=e)}}),P._fromList=G,Object.defineProperty(P.prototype,"readableLength",{enumerable:!1,get:function(){return this._readableState.length}}),"function"==typeof Symbol&&(P.from=function(e,t){return void 0===u&&(u=n(727)),u(P,e,t)})},170:function(e,t,r){"use strict";e.exports=l;var n=r(646).q,i=n.ERR_METHOD_NOT_IMPLEMENTED,o=n.ERR_MULTIPLE_CALLBACK,s=n.ERR_TRANSFORM_ALREADY_TRANSFORMING,a=n.ERR_TRANSFORM_WITH_LENGTH_0,c=r(403);function u(e,t){var r=this._transformState;r.transforming=!1;var n=r.writecb;if(null===n)return this.emit("error",new o);r.writechunk=null,r.writecb=null,null!=t&&this.push(t),n(e);var i=this._readableState;i.reading=!1,(i.needReadable||i.length<i.highWaterMark)&&this._read(i.highWaterMark)}function l(e){if(!(this instanceof l))return new l(e);c.call(this,e),this._transformState={afterTransform:u.bind(this),needTransform:!1,transforming:!1,writecb:null,writechunk:null,writeencoding:null},this._readableState.needReadable=!0,this._readableState.sync=!1,e&&("function"==typeof e.transform&&(this._transform=e.transform),"function"==typeof e.flush&&(this._flush=e.flush)),this.on("prefinish",d)}function d(){var e=this;"function"!=typeof this._flush||this._readableState.destroyed?f(this,null,null):this._flush(function(t,r){f(e,t,r)})}function f(e,t,r){if(t)return e.emit("error",t);if(null!=r&&e.push(r),e._writableState.length)throw new a;if(e._transformState.transforming)throw new s;return e.push(null)}r(782)(l,c),l.prototype.push=function(e,t){return this._transformState.needTransform=!1,c.prototype.push.call(this,e,t)},l.prototype._transform=function(e,t,r){r(new i("_transform()"))},l.prototype._write=function(e,t,r){var n=this._transformState;if(n.writecb=r,n.writechunk=e,n.writeencoding=t,!n.transforming){var i=this._readableState;(n.needTransform||i.needReadable||i.length<i.highWaterMark)&&this._read(i.highWaterMark)}},l.prototype._read=function(e){var t=this._transformState;null===t.writechunk||t.transforming?t.needTransform=!0:(t.transforming=!0,this._transform(t.writechunk,t.writeencoding,t.afterTransform))},l.prototype._destroy=function(e,t){c.prototype._destroy.call(this,e,function(e){t(e)})}},337:function(e,t,n){"use strict";function o(e){var t=this;this.next=null,this.entry=null,this.finish=function(){V(t,e)}}e.exports=T,T.WritableState=O;var s,a,c={deprecate:n(769)},u=n(678),l=n(300).Buffer,d=r.g.Uint8Array||function(){};function f(e){return l.from(e)}function h(e){return l.isBuffer(e)||e instanceof d}var p=n(25),y=n(776).getHighWaterMark,g=n(646).q,m=g.ERR_INVALID_ARG_TYPE,b=g.ERR_METHOD_NOT_IMPLEMENTED,v=g.ERR_MULTIPLE_CALLBACK,w=g.ERR_STREAM_CANNOT_PIPE,_=g.ERR_STREAM_DESTROYED,E=g.ERR_STREAM_NULL_VALUES,S=g.ERR_STREAM_WRITE_AFTER_END,x=g.ERR_UNKNOWN_ENCODING,A=p.errorOrDestroy;function I(){}function O(e,t,r){s=s||n(403),e=e||{},"boolean"!=typeof r&&(r=t instanceof s),this.objectMode=!!e.objectMode,r&&(this.objectMode=this.objectMode||!!e.writableObjectMode),this.highWaterMark=y(this,e,"writableHighWaterMark",r),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;var i=!1===e.decodeStrings;this.decodeStrings=!i,this.defaultEncoding=e.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(e){R(t,e)},this.writecb=null,this.writelen=0,this.bufferedRequest=null,this.lastBufferedRequest=null,this.pendingcb=0,this.prefinished=!1,this.errorEmitted=!1,this.emitClose=!1!==e.emitClose,this.autoDestroy=!!e.autoDestroy,this.bufferedRequestCount=0,this.corkedRequestsFree=new o(this)}function T(e){var t=this instanceof(s=s||n(403));if(!t&&!a.call(T,this))return new T(e);this._writableState=new O(e,this,t),this.writable=!0,e&&("function"==typeof e.write&&(this._write=e.write),"function"==typeof e.writev&&(this._writev=e.writev),"function"==typeof e.destroy&&(this._destroy=e.destroy),"function"==typeof e.final&&(this._final=e.final)),u.call(this)}function P(e,t){var r=new S;A(e,r),i.nextTick(t,r)}function M(e,t,r,n){var o;return null===r?o=new E:"string"==typeof r||t.objectMode||(o=new m("chunk",["string","Buffer"],r)),!o||(A(e,o),i.nextTick(n,o),!1)}function N(e,t,r){return e.objectMode||!1===e.decodeStrings||"string"!=typeof t||(t=l.from(t,r)),t}function k(e,t,r,n,i,o){if(!r){var s=N(t,n,i);n!==s&&(r=!0,i="buffer",n=s)}var a=t.objectMode?1:n.length;t.length+=a;var c=t.length<t.highWaterMark;if(c||(t.needDrain=!0),t.writing||t.corked){var u=t.lastBufferedRequest;t.lastBufferedRequest={chunk:n,encoding:i,isBuf:r,callback:o,next:null},u?u.next=t.lastBufferedRequest:t.bufferedRequest=t.lastBufferedRequest,t.bufferedRequestCount+=1}else C(e,t,!1,a,n,i,o);return c}function C(e,t,r,n,i,o,s){t.writelen=n,t.writecb=s,t.writing=!0,t.sync=!0,t.destroyed?t.onwrite(new _("write")):r?e._writev(i,t.onwrite):e._write(i,o,t.onwrite),t.sync=!1}function D(e,t,r,n,o){--t.pendingcb,r?(i.nextTick(o,n),i.nextTick(z,e,t),e._writableState.errorEmitted=!0,A(e,n)):(o(n),e._writableState.errorEmitted=!0,A(e,n),z(e,t))}function j(e){e.writing=!1,e.writecb=null,e.length-=e.writelen,e.writelen=0}function R(e,t){var r=e._writableState,n=r.sync,o=r.writecb;if("function"!=typeof o)throw new v;if(j(r),t)D(e,r,n,t,o);else{var s=$(r)||e.destroyed;s||r.corked||r.bufferProcessing||!r.bufferedRequest||U(e,r),n?i.nextTick(L,e,r,s,o):L(e,r,s,o)}}function L(e,t,r,n){r||B(e,t),t.pendingcb--,n(),z(e,t)}function B(e,t){0===t.length&&t.needDrain&&(t.needDrain=!1,e.emit("drain"))}function U(e,t){t.bufferProcessing=!0;var r=t.bufferedRequest;if(e._writev&&r&&r.next){var n=Array(t.bufferedRequestCount),i=t.corkedRequestsFree;i.entry=r;for(var s=0,a=!0;r;)n[s]=r,r.isBuf||(a=!1),r=r.next,s+=1;n.allBuffers=a,C(e,t,!0,t.length,n,"",i.finish),t.pendingcb++,t.lastBufferedRequest=null,i.next?(t.corkedRequestsFree=i.next,i.next=null):t.corkedRequestsFree=new o(t),t.bufferedRequestCount=0}else{for(;r;){var c=r.chunk,u=r.encoding,l=r.callback,d=t.objectMode?1:c.length;if(C(e,t,!1,d,c,u,l),r=r.next,t.bufferedRequestCount--,t.writing)break}null===r&&(t.lastBufferedRequest=null)}t.bufferedRequest=r,t.bufferProcessing=!1}function $(e){return e.ending&&0===e.length&&null===e.bufferedRequest&&!e.finished&&!e.writing}function K(e,t){e._final(function(r){t.pendingcb--,r&&A(e,r),t.prefinished=!0,e.emit("prefinish"),z(e,t)})}function F(e,t){t.prefinished||t.finalCalled||("function"!=typeof e._final||t.destroyed?(t.prefinished=!0,e.emit("prefinish")):(t.pendingcb++,t.finalCalled=!0,i.nextTick(K,e,t)))}function z(e,t){var r=$(t);if(r&&(F(e,t),0===t.pendingcb&&(t.finished=!0,e.emit("finish"),t.autoDestroy))){var n=e._readableState;(!n||n.autoDestroy&&n.endEmitted)&&e.destroy()}return r}function q(e,t,r){t.ending=!0,z(e,t),r&&(t.finished?i.nextTick(r):e.once("finish",r)),t.ended=!0,e.writable=!1}function V(e,t,r){var n=e.entry;for(e.entry=null;n;){var i=n.callback;t.pendingcb--,i(r),n=n.next}t.corkedRequestsFree.next=e}n(782)(T,u),O.prototype.getBuffer=function(){for(var e=this.bufferedRequest,t=[];e;)t.push(e),e=e.next;return t},function(){try{Object.defineProperty(O.prototype,"buffer",{get:c.deprecate(function(){return this.getBuffer()},"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.","DEP0003")})}catch(e){}}(),"function"==typeof Symbol&&Symbol.hasInstance&&"function"==typeof Function.prototype[Symbol.hasInstance]?(a=Function.prototype[Symbol.hasInstance],Object.defineProperty(T,Symbol.hasInstance,{value:function(e){return!!a.call(this,e)||this===T&&e&&e._writableState instanceof O}})):a=function(e){return e instanceof this},T.prototype.pipe=function(){A(this,new w)},T.prototype.write=function(e,t,r){var n=this._writableState,i=!1,o=!n.objectMode&&h(e);return o&&!l.isBuffer(e)&&(e=f(e)),"function"==typeof t&&(r=t,t=null),o?t="buffer":t||(t=n.defaultEncoding),"function"!=typeof r&&(r=I),n.ending?P(this,r):(o||M(this,n,e,r))&&(n.pendingcb++,i=k(this,n,o,e,t,r)),i},T.prototype.cork=function(){this._writableState.corked++},T.prototype.uncork=function(){var e=this._writableState;!e.corked||(e.corked--,e.writing||e.corked||e.bufferProcessing||!e.bufferedRequest||U(this,e))},T.prototype.setDefaultEncoding=function(e){if("string"==typeof e&&(e=e.toLowerCase()),!(["hex","utf8","utf-8","ascii","binary","base64","ucs2","ucs-2","utf16le","utf-16le","raw"].indexOf((e+"").toLowerCase())>-1))throw new x(e);return this._writableState.defaultEncoding=e,this},Object.defineProperty(T.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}}),Object.defineProperty(T.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),T.prototype._write=function(e,t,r){r(new b("_write()"))},T.prototype._writev=null,T.prototype.end=function(e,t,r){var n=this._writableState;return"function"==typeof e?(r=e,e=null,t=null):"function"==typeof t&&(r=t,t=null),null!=e&&this.write(e,t),n.corked&&(n.corked=1,this.uncork()),n.ending||q(this,n,r),this},Object.defineProperty(T.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}}),Object.defineProperty(T.prototype,"destroyed",{enumerable:!1,get:function(){return void 0!==this._writableState&&this._writableState.destroyed},set:function(e){this._writableState&&(this._writableState.destroyed=e)}}),T.prototype.destroy=p.destroy,T.prototype._undestroy=p.undestroy,T.prototype._destroy=function(e,t){t(e)}},871:function(e,t,r){"use strict";function n(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var o,s=r(698),a=Symbol("lastResolve"),c=Symbol("lastReject"),u=Symbol("error"),l=Symbol("ended"),d=Symbol("lastPromise"),f=Symbol("handlePromise"),h=Symbol("stream");function p(e,t){return{value:e,done:t}}function y(e){var t=e[a];if(null!==t){var r=e[h].read();null!==r&&(e[d]=null,e[a]=null,e[c]=null,t(p(r,!1)))}}function g(e){i.nextTick(y,e)}function m(e,t){return function(r,n){e.then(function(){if(t[l]){r(p(void 0,!0));return}t[f](r,n)},n)}}var b=Object.getPrototypeOf(function(){}),v=Object.setPrototypeOf((n(o={get stream(){return this[h]},next:function(){var e,t=this,r=this[u];if(null!==r)return Promise.reject(r);if(this[l])return Promise.resolve(p(void 0,!0));if(this[h].destroyed)return new Promise(function(e,r){i.nextTick(function(){t[u]?r(t[u]):e(p(void 0,!0))})});var n=this[d];if(n)e=new Promise(m(n,this));else{var o=this[h].read();if(null!==o)return Promise.resolve(p(o,!1));e=new Promise(this[f])}return this[d]=e,e}},Symbol.asyncIterator,function(){return this}),n(o,"return",function(){var e=this;return new Promise(function(t,r){e[h].destroy(null,function(e){if(e){r(e);return}t(p(void 0,!0))})})}),o),b),w=function(e){var t,r=Object.create(v,(n(t={},h,{value:e,writable:!0}),n(t,a,{value:null,writable:!0}),n(t,c,{value:null,writable:!0}),n(t,u,{value:null,writable:!0}),n(t,l,{value:e._readableState.endEmitted,writable:!0}),n(t,f,{value:function(e,t){var n=r[h].read();n?(r[d]=null,r[a]=null,r[c]=null,e(p(n,!1))):(r[a]=e,r[c]=t)},writable:!0}),t));return r[d]=null,s(e,function(e){if(e&&"ERR_STREAM_PREMATURE_CLOSE"!==e.code){var t=r[c];null!==t&&(r[d]=null,r[a]=null,r[c]=null,t(e)),r[u]=e;return}var n=r[a];null!==n&&(r[d]=null,r[a]=null,r[c]=null,n(p(void 0,!0))),r[l]=!0}),e.on("readable",g.bind(null,r)),r};e.exports=w},379:function(e,t,r){"use strict";function n(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,n)}return r}function i(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?n(Object(r),!0).forEach(function(t){o(e,t,r[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):n(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}function o(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function s(e,t){if(!(e instanceof t))throw TypeError("Cannot call a class as a function")}function a(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)}}function c(e,t,r){return t&&a(e.prototype,t),r&&a(e,r),e}var u=r(300).Buffer,l=r(837).inspect,d=l&&l.custom||"inspect";function f(e,t,r){u.prototype.copy.call(e,t,r)}e.exports=function(){function e(){s(this,e),this.head=null,this.tail=null,this.length=0}return c(e,[{key:"push",value:function(e){var t={data:e,next:null};this.length>0?this.tail.next=t:this.head=t,this.tail=t,++this.length}},{key:"unshift",value:function(e){var t={data:e,next:this.head};0===this.length&&(this.tail=t),this.head=t,++this.length}},{key:"shift",value:function(){if(0!==this.length){var e=this.head.data;return 1===this.length?this.head=this.tail=null:this.head=this.head.next,--this.length,e}}},{key:"clear",value:function(){this.head=this.tail=null,this.length=0}},{key:"join",value:function(e){if(0===this.length)return"";for(var t=this.head,r=""+t.data;t=t.next;)r+=e+t.data;return r}},{key:"concat",value:function(e){if(0===this.length)return u.alloc(0);for(var t=u.allocUnsafe(e>>>0),r=this.head,n=0;r;)f(r.data,t,n),n+=r.data.length,r=r.next;return t}},{key:"consume",value:function(e,t){var r;return e<this.head.data.length?(r=this.head.data.slice(0,e),this.head.data=this.head.data.slice(e)):r=e===this.head.data.length?this.shift():t?this._getString(e):this._getBuffer(e),r}},{key:"first",value:function(){return this.head.data}},{key:"_getString",value:function(e){var t=this.head,r=1,n=t.data;for(e-=n.length;t=t.next;){var i=t.data,o=e>i.length?i.length:e;if(o===i.length?n+=i:n+=i.slice(0,e),0==(e-=o)){o===i.length?(++r,t.next?this.head=t.next:this.head=this.tail=null):(this.head=t,t.data=i.slice(o));break}++r}return this.length-=r,n}},{key:"_getBuffer",value:function(e){var t=u.allocUnsafe(e),r=this.head,n=1;for(r.data.copy(t),e-=r.data.length;r=r.next;){var i=r.data,o=e>i.length?i.length:e;if(i.copy(t,t.length-e,0,o),0==(e-=o)){o===i.length?(++n,r.next?this.head=r.next:this.head=this.tail=null):(this.head=r,r.data=i.slice(o));break}++n}return this.length-=n,t}},{key:d,value:function(e,t){return l(this,i({},t,{depth:0,customInspect:!1}))}}]),e}()},25:function(e){"use strict";function t(e,t){var o=this,a=this._readableState&&this._readableState.destroyed,c=this._writableState&&this._writableState.destroyed;return a||c?t?t(e):e&&(this._writableState?this._writableState.errorEmitted||(this._writableState.errorEmitted=!0,i.nextTick(s,this,e)):i.nextTick(s,this,e)):(this._readableState&&(this._readableState.destroyed=!0),this._writableState&&(this._writableState.destroyed=!0),this._destroy(e||null,function(e){!t&&e?o._writableState?o._writableState.errorEmitted?i.nextTick(n,o):(o._writableState.errorEmitted=!0,i.nextTick(r,o,e)):i.nextTick(r,o,e):t?(i.nextTick(n,o),t(e)):i.nextTick(n,o)})),this}function r(e,t){s(e,t),n(e)}function n(e){(!e._writableState||e._writableState.emitClose)&&(!e._readableState||e._readableState.emitClose)&&e.emit("close")}function o(){this._readableState&&(this._readableState.destroyed=!1,this._readableState.reading=!1,this._readableState.ended=!1,this._readableState.endEmitted=!1),this._writableState&&(this._writableState.destroyed=!1,this._writableState.ended=!1,this._writableState.ending=!1,this._writableState.finalCalled=!1,this._writableState.prefinished=!1,this._writableState.finished=!1,this._writableState.errorEmitted=!1)}function s(e,t){e.emit("error",t)}function a(e,t){var r=e._readableState,n=e._writableState;r&&r.autoDestroy||n&&n.autoDestroy?e.destroy(t):e.emit("error",t)}e.exports={destroy:t,undestroy:o,errorOrDestroy:a}},698:function(e,t,r){"use strict";
37var n=r(646).q.ERR_STREAM_PREMATURE_CLOSE;function i(e){var t=!1;return function(){if(!t){t=!0;for(var r=arguments.length,n=Array(r),i=0;i<r;i++)n[i]=arguments[i];e.apply(this,n)}}}function o(){}function s(e){return e.setHeader&&"function"==typeof e.abort}function a(e,t,r){if("function"==typeof t)return a(e,null,t);t||(t={}),r=i(r||o);var c=t.readable||!1!==t.readable&&e.readable,u=t.writable||!1!==t.writable&&e.writable,l=function(){e.writable||f()},d=e._writableState&&e._writableState.finished,f=function(){u=!1,d=!0,c||r.call(e)},h=e._readableState&&e._readableState.endEmitted,p=function(){c=!1,h=!0,u||r.call(e)},y=function(t){r.call(e,t)},g=function(){var t;return c&&!h?(e._readableState&&e._readableState.ended||(t=new n),r.call(e,t)):u&&!d?(e._writableState&&e._writableState.ended||(t=new n),r.call(e,t)):void 0},m=function(){e.req.on("finish",f)};return s(e)?(e.on("complete",f),e.on("abort",g),e.req?m():e.on("request",m)):u&&!e._writableState&&(e.on("end",l),e.on("close",l)),e.on("end",p),e.on("finish",f),!1!==t.error&&e.on("error",y),e.on("close",g),function(){e.removeListener("complete",f),e.removeListener("abort",g),e.removeListener("request",m),e.req&&e.req.removeListener("finish",f),e.removeListener("end",l),e.removeListener("close",l),e.removeListener("finish",f),e.removeListener("end",p),e.removeListener("error",y),e.removeListener("close",g)}}e.exports=a},727:function(e,t,r){"use strict";function n(e,t,r,n,i,o,s){try{var a=e[o](s),c=a.value}catch(e){r(e);return}a.done?t(c):Promise.resolve(c).then(n,i)}function i(e){return function(){var t=this,r=arguments;return new Promise(function(i,o){var s=e.apply(t,r);function a(e){n(s,i,o,a,c,"next",e)}function c(e){n(s,i,o,a,c,"throw",e)}a(void 0)})}}function o(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,n)}return r}function s(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?o(Object(r),!0).forEach(function(t){a(e,t,r[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):o(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}function a(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var c=r(646).q.ERR_INVALID_ARG_TYPE;function u(e,t,r){if(t&&"function"==typeof t.next)n=t;else if(t&&t[Symbol.asyncIterator])n=t[Symbol.asyncIterator]();else if(t&&t[Symbol.iterator])n=t[Symbol.iterator]();else throw new c("iterable",["Iterable"],t);var n,o=new e(s({objectMode:!0},r)),a=!1;function u(){return l.apply(this,arguments)}function l(){return(l=i(function*(){try{var e=yield n.next(),t=e.value;e.done?o.push(null):o.push((yield t))?u():a=!1}catch(e){o.destroy(e)}})).apply(this,arguments)}return o._read=function(){a||(a=!0,u())},o}e.exports=u},442:function(e,t,r){"use strict";function n(e){var t=!1;return function(){t||(t=!0,e.apply(void 0,arguments))}}var i,o=r(646).q,s=o.ERR_MISSING_ARGS,a=o.ERR_STREAM_DESTROYED;function c(e){if(e)throw e}function u(e){return e.setHeader&&"function"==typeof e.abort}function l(e,t,o,s){s=n(s);var c=!1;e.on("close",function(){c=!0}),void 0===i&&(i=r(698)),i(e,{readable:t,writable:o},function(e){if(e)return s(e);c=!0,s()});var l=!1;return function(t){if(!c&&!l){if(l=!0,u(e))return e.abort();if("function"==typeof e.destroy)return e.destroy();s(t||new a("pipe"))}}}function d(e){e()}function f(e,t){return e.pipe(t)}function h(e){return e.length&&"function"==typeof e[e.length-1]?e.pop():c}function p(){for(var e,t=arguments.length,r=Array(t),n=0;n<t;n++)r[n]=arguments[n];var i=h(r);if(Array.isArray(r[0])&&(r=r[0]),r.length<2)throw new s("streams");var o=r.map(function(t,n){var s=n<r.length-1;return l(t,s,n>0,function(t){e||(e=t),t&&o.forEach(d),s||(o.forEach(d),i(e))})});return r.reduce(f)}e.exports=p},776:function(e,t,r){"use strict";var n=r(646).q.ERR_INVALID_OPT_VALUE;function i(e,t,r){return null!=e.highWaterMark?e.highWaterMark:t?e[r]:null}function o(e,t,r,o){var s=i(t,o,r);if(null!=s){if(!(isFinite(s)&&Math.floor(s)===s)||s<0)throw new n(o?r:"highWaterMark",s);return Math.floor(s)}return e.objectMode?16:16384}e.exports={getHighWaterMark:o}},678:function(e,t,r){e.exports=r(781)},726:function(e,t,r){var n=r(781);"disable"===i.env.READABLE_STREAM&&n?(e.exports=n.Readable,Object.assign(e.exports,n),e.exports.Stream=n):((t=e.exp
37orts=r(709)).Stream=n||t,t.Readable=t,t.Writable=r(337),t.Duplex=r(403),t.Transform=r(170),t.PassThrough=r(889),t.finished=r(698),t.pipeline=r(442))},55:function(e,t,r){var n=r(300),i=n.Buffer;function o(e,t){for(var r in e)t[r]=e[r]}function s(e,t,r){return i(e,t,r)}i.from&&i.alloc&&i.allocUnsafe&&i.allocUnsafeSlow?e.exports=n:(o(n,t),t.Buffer=s),s.prototype=Object.create(i.prototype),o(i,s),s.from=function(e,t,r){if("number"==typeof e)throw TypeError("Argument must not be a number");return i(e,t,r)},s.alloc=function(e,t,r){if("number"!=typeof e)throw TypeError("Argument must be a number");var n=i(e);return void 0!==t?"string"==typeof r?n.fill(t,r):n.fill(t):n.fill(0),n},s.allocUnsafe=function(e){if("number"!=typeof e)throw TypeError("Argument must be a number");return i(e)},s.allocUnsafeSlow=function(e){if("number"!=typeof e)throw TypeError("Argument must be a number");return n.SlowBuffer(e)}},813:function(e,t,n){var i=n(450),o=n(254),s=n(911),a=n(523),c=n(310),u=t;u.request=function(e,t){e="string"==typeof e?c.parse(e):s(e);var n=-1===r.g.location.protocol.search(/^https?:$/)?"http:":"",o=e.protocol||n,a=e.hostname||e.host,u=e.port,l=e.path||"/";a&&-1!==a.indexOf(":")&&(a="["+a+"]"),e.url=(a?o+"//"+a:"")+(u?":"+u:"")+l,e.method=(e.method||"GET").toUpperCase(),e.headers=e.headers||{};var d=new i(e);return t&&d.on("response",t),d},u.get=function(e,t){var r=u.request(e,t);return r.end(),r},u.ClientRequest=i,u.IncomingMessage=o.IncomingMessage,u.Agent=function(){},u.Agent.defaultMaxSockets=4,u.globalAgent=new u.Agent,u.STATUS_CODES=a,u.METHODS=["CHECKOUT","CONNECT","COPY","DELETE","GET","HEAD","LOCK","M-SEARCH","MERGE","MKACTIVITY","MKCOL","MOVE","NOTIFY","OPTIONS","PATCH","POST","PROPFIND","PROPPATCH","PURGE","PUT","REPORT","SEARCH","SUBSCRIBE","TRACE","UNLOCK","UNSUBSCRIBE"]},301:function(e,t){var n;function i(){if(void 0!==n)return n;if(r.g.XMLHttpRequest){n=new r.g.XMLHttpRequest;try{n.open("GET",r.g.XDomainRequest?"/":"https://example.com")}catch(e){n=null}}else n=null;return n}function o(e){var t=i();if(!t)return!1;try{return t.responseType=e,t.responseType===e}catch(e){}return!1}function s(e){return"function"==typeof e}t.fetch=s(r.g.fetch)&&s(r.g.ReadableStream),t.writableStream=s(r.g.WritableStream),t.abortController=s(r.g.AbortController),t.arraybuffer=t.fetch||o("arraybuffer"),t.msstream=!t.fetch&&o("ms-stream"),t.mozchunkedarraybuffer=!t.fetch&&o("moz-chunked-arraybuffer"),t.overrideMimeType=t.fetch||!!i()&&s(i().overrideMimeType),n=null},450:function(e,t,n){var s=n(301),a=n(782),c=n(254),u=n(726),l=c.IncomingMessage,d=c.readyStates;function f(e,t){return s.fetch&&t?"fetch":s.mozchunkedarraybuffer?"moz-chunked-arraybuffer":s.msstream?"ms-stream":s.arraybuffer&&e?"arraybuffer":"text"}var h=e.exports=function(e){var t,r=this;u.Writable.call(r),r._opts=e,r._body=[],r._headers={},e.auth&&r.setHeader("Authorization","Basic "+o.from(e.auth).toString("base64")),Object.keys(e.headers).forEach(function(t){r.setHeader(t,e.headers[t])});var n=!0;if("disable-fetch"===e.mode||"requestTimeout"in e&&!s.abortController)n=!1,t=!0;else if("prefer-streaming"===e.mode)t=!1;else if("allow-wrong-content-type"===e.mode)t=!s.overrideMimeType;else if(e.mode&&"default"!==e.mode&&"prefer-fast"!==e.mode)throw Error("Invalid value for opts.mode");else t=!0;r._mode=f(t,n),r._fetchTimer=null,r.on("finish",function(){r._onFinish()})};function p(e){try{var t=e.status;return null!==t&&0!==t}catch(e){return!1}}a(h,u.Writable),h.prototype.setHeader=function(e,t){var r=this,n=e.toLowerCase();-1===y.indexOf(n)&&(r._headers[n]={name:e,value:t})},h.prototype.getHeader=function(e){var t=this._headers[e.toLowerCase()];return t?t.value:null},h.prototype.removeHeader=function(e){var t=this;delete t._headers[e.toLowerCase()]},h.prototype._onFinish=function(){var e=this;if(!e._destroyed){var t=e._opts,n=e._headers,o=null;"GET"!==t.method&&"HEAD"!==t.method&&(o=new Blob(e._body,{type:(n["content-type"]||{}).value||""}));var a=[];if(Object.keys(n).forEach(function(e){var t=n[e].name,r=n[e].value;Array.isArray(r)?r.forEach(function(e){a.push([t,e])}):a.push([t,r])}),"fetch"===e._mode){var c=null;if(s.abortController){var u=new AbortController;c=u.signal,e._fetchAbortController=u,"requestTimeout"in t&&0!==t.requestTimeout&&(e._fetchTimer=r.g.setTimeout(function(){e.emit("requestTimeout"),e._fetchAbortController&&e._fetchAbortController.abort()},t.requestTimeout))}r.g.fetch(e._opts.url,{method:e._opts.method,headers:a,body:o||void 0,mode:"cors",credentials:t.withCredentials?"include":"same-origin",signal:c}).then(function(t){e._fetchResponse=t,e._connect()},function(t){r.g.clearTimeout(e._fetchTimer),e._destroyed||e.emit("error",t)})}else{var l=e._xhr=new r.g.XMLHttpRequest;try{l.open(e._opts.method,e._opts.url,!0)}catch(t){i.nextTick(function(){e.emit("error",t)});return}"responseType"in l&&(l.responseType=e._mode),"withCredentials"in l&&(l.withCredentials=!!t.withCredentials),"text"===e._mode&&"overrideMimeType"in l&&l.overrideMimeType("text/plain;
37 charset=x-user-defined"),"requestTimeout"in t&&(l.timeout=t.requestTimeout,l.ontimeout=function(){e.emit("requestTimeout")}),a.forEach(function(e){l.setRequestHeader(e[0],e[1])}),e._response=null,l.onreadystatechange=function(){switch(l.readyState){case d.LOADING:case d.DONE:e._onXHRProgress()}},"moz-chunked-arraybuffer"===e._mode&&(l.onprogress=function(){e._onXHRProgress()}),l.onerror=function(){e._destroyed||e.emit("error",Error("XHR error"))};try{l.send(o)}catch(t){i.nextTick(function(){e.emit("error",t)});return}}}},h.prototype._onXHRProgress=function(){var e=this;p(e._xhr)&&!e._destroyed&&(e._response||e._connect(),e._response._onXHRProgress())},h.prototype._connect=function(){var e=this;e._destroyed||(e._response=new l(e._xhr,e._fetchResponse,e._mode,e._fetchTimer),e._response.on("error",function(t){e.emit("error",t)}),e.emit("response",e._response))},h.prototype._write=function(e,t,r){var n=this;n._body.push(e),r()},h.prototype.abort=h.prototype.destroy=function(){var e=this;e._destroyed=!0,r.g.clearTimeout(e._fetchTimer),e._response&&(e._response._destroyed=!0),e._xhr?e._xhr.abort():e._fetchAbortController&&e._fetchAbortController.abort()},h.prototype.end=function(e,t,r){var n=this;"function"==typeof e&&(r=e,e=void 0),u.Writable.prototype.end.call(n,e,t,r)},h.prototype.flushHeaders=function(){},h.prototype.setTimeout=function(){},h.prototype.setNoDelay=function(){},h.prototype.setSocketKeepAlive=function(){};var y=["accept-charset","accept-encoding","access-control-request-headers","access-control-request-method","connection","content-length","cookie","cookie2","date","dnt","expect","host","keep-alive","origin","referer","te","trailer","transfer-encoding","upgrade","via"]},254:function(e,t,n){var s=n(301),a=n(782),c=n(726),u=t.readyStates={UNSENT:0,OPENED:1,HEADERS_RECEIVED:2,LOADING:3,DONE:4},l=t.IncomingMessage=function(e,t,n,a){var u=this;if(c.Readable.call(u),u._mode=n,u.headers={},u.rawHeaders=[],u.trailers={},u.rawTrailers=[],u.on("end",function(){i.nextTick(function(){u.emit("close")})}),"fetch"===n){if(u._fetchResponse=t,u.url=t.url,u.statusCode=t.status,u.statusMessage=t.statusText,t.headers.forEach(function(e,t){u.headers[t.toLowerCase()]=e,u.rawHeaders.push(t,e)}),s.writableStream){var l=new WritableStream({write:function(e){return new Promise(function(t,r){u._destroyed?r():u.push(o.from(e))?t():u._resumeFetch=t})},close:function(){r.g.clearTimeout(a),u._destroyed||u.push(null)},abort:function(e){u._destroyed||u.emit("error",e)}});try{t.body.pipeTo(l).catch(function(e){r.g.clearTimeout(a),u._destroyed||u.emit("error",e)});return}catch(e){}}var d=t.body.getReader();function f(){d.read().then(function(e){if(!u._destroyed){if(e.done){r.g.clearTimeout(a),u.push(null);return}u.push(o.from(e.value)),f()}}).catch(function(e){r.g.clearTimeout(a),u._destroyed||u.emit("error",e)})}f()}else if(u._xhr=e,u._pos=0,u.url=e.responseURL,u.statusCode=e.status,u.statusMessage=e.statusText,e.getAllResponseHeaders().split(/\r?\n/).forEach(function(e){var t=e.match(/^([^:]+):\s*(.*)/);if(t){var r=t[1].toLowerCase();"set-cookie"===r?(void 0===u.headers[r]&&(u.headers[r]=[]),u.headers[r].push(t[2])):void 0!==u.headers[r]?u.headers[r]+=", "+t[2]:u.headers[r]=t[2],u.rawHeaders.push(t[1],t[2])}}),u._charset="x-user-defined",!s.overrideMimeType){var h=u.rawHeaders["mime-type"];if(h){var p=h.match(/;\s*charset=([^;])(;|$)/);p&&(u._charset=p[1].toLowerCase())}u._charset||(u._charset="utf-8")}};a(l,c.Readable),l.prototype._read=function(){var e=this,t=e._resumeFetch;t&&(e._resumeFetch=null,t())},l.prototype._onXHRProgress=function(){var e=this,t=e._xhr,n=null;switch(e._mode){case"text":if((n=t.responseText).length>e._pos){var i=n.substr(e._pos);if("x-user-defined"===e._charset){for(var s=o.alloc(i.length),a=0;a<i.length;a++)s[a]=255&i.charCodeAt(a);e.push(s)}else e.push(i,e._charset);e._pos=n.length}break;case"arraybuffer":if(t.readyState!==u.DONE||!t.response)break;n=t.response,e.push(o.from(new Uint8Array(n)));break;case"moz-chunked-arraybuffer":if(n=t.response,t.readyState!==u.LOADING||!n)break;e.push(o.from(new Uint8Array(n)));break;case"ms-stream":if(n=t.response,t.readyState!==u.LOADING)break;var c=new r.g.MSStreamReader;c.onprogress=function(){c.result.byteLength>e._pos&&(e.push(o.from(new Uint8Array(c.result.slice(e._pos)))),e._pos=c.result.byteLength)},c.onload=function(){e.push(null)},c.readAsArrayBuffer(n)}e._xhr.readyState===u.DONE&&"ms-stream"!==e._mode&&e.push(null)}},704:function(e,t,r){"use strict";var n=r(55).Buffer,i=n.isEncoding||function(e){switch((e=""+e)&&e.toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":case"raw":return!0;default:return!1}};function o(e){var t;if(!e)return"utf8";for(;;)switch(e){case"utf8":case"utf-8":return"utf8";case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return"utf16le";
37case"latin1":case"binary":return"latin1";case"base64":case"ascii":case"hex":return e;default:if(t)return;e=(""+e).toLowerCase(),t=!0}}function s(e){var t=o(e);if("string"!=typeof t&&(n.isEncoding===i||!i(e)))throw Error("Unknown encoding: "+e);return t||e}function a(e){var t;switch(this.encoding=s(e),this.encoding){case"utf16le":this.text=p,this.end=y,t=4;break;case"utf8":this.fillLast=d,t=4;break;case"base64":this.text=g,this.end=m,t=3;break;default:this.write=b,this.end=v;return}this.lastNeed=0,this.lastTotal=0,this.lastChar=n.allocUnsafe(t)}function c(e){return e<=127?0:e>>5==6?2:e>>4==14?3:e>>3==30?4:e>>6==2?-1:-2}function u(e,t,r){var n=t.length-1;if(n<r)return 0;var i=c(t[n]);return i>=0?(i>0&&(e.lastNeed=i-1),i):--n<r||-2===i?0:(i=c(t[n]))>=0?(i>0&&(e.lastNeed=i-2),i):--n<r||-2===i?0:(i=c(t[n]))>=0?(i>0&&(2===i?i=0:e.lastNeed=i-3),i):0}function l(e,t,r){if((192&t[0])!=128)return e.lastNeed=0,"�";if(e.lastNeed>1&&t.length>1){if((192&t[1])!=128)return e.lastNeed=1,"�";if(e.lastNeed>2&&t.length>2&&(192&t[2])!=128)return e.lastNeed=2,"�"}}function d(e){var t=this.lastTotal-this.lastNeed,r=l(this,e,t);return void 0!==r?r:this.lastNeed<=e.length?(e.copy(this.lastChar,t,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal)):void(e.copy(this.lastChar,t,0,e.length),this.lastNeed-=e.length)}function f(e,t){var r=u(this,e,t);if(!this.lastNeed)return e.toString("utf8",t);this.lastTotal=r;var n=e.length-(r-this.lastNeed);return e.copy(this.lastChar,0,n),e.toString("utf8",t,n)}function h(e){var t=e&&e.length?this.write(e):"";return this.lastNeed?t+"�":t}function p(e,t){if((e.length-t)%2==0){var r=e.toString("utf16le",t);if(r){var n=r.charCodeAt(r.length-1);if(n>=55296&&n<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=e[e.length-2],this.lastChar[1]=e[e.length-1],r.slice(0,-1)}return r}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=e[e.length-1],e.toString("utf16le",t,e.length-1)}function y(e){var t=e&&e.length?this.write(e):"";if(this.lastNeed){var r=this.lastTotal-this.lastNeed;return t+this.lastChar.toString("utf16le",0,r)}return t}function g(e,t){var r=(e.length-t)%3;return 0===r?e.toString("base64",t):(this.lastNeed=3-r,this.lastTotal=3,1===r?this.lastChar[0]=e[e.length-1]:(this.lastChar[0]=e[e.length-2],this.lastChar[1]=e[e.length-1]),e.toString("base64",t,e.length-r))}function m(e){var t=e&&e.length?this.write(e):"";return this.lastNeed?t+this.lastChar.toString("base64",0,3-this.lastNeed):t}function b(e){return e.toString(this.encoding)}function v(e){return e&&e.length?this.write(e):""}t.s=a,a.prototype.write=function(e){var t,r;if(0===e.length)return"";if(this.lastNeed){if(void 0===(t=this.fillLast(e)))return"";r=this.lastNeed,this.lastNeed=0}else r=0;return r<e.length?t?t+this.text(e,r):this.text(e,r):t||""},a.prototype.end=h,a.prototype.text=f,a.prototype.fillLast=function(e){if(this.lastNeed<=e.length)return e.copy(this.lastChar,this.lastTotal-this.lastNeed,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);e.copy(this.lastChar,this.lastTotal-this.lastNeed,0,e.length),this.lastNeed-=e.length}},769:function(e){function t(e,t){if(n("noDeprecation"))return e;var r=!1;return function(){if(!r){if(n("throwDeprecation"))throw Error(t);n("traceDeprecation")?console.trace(t):console.warn(t),r=!0}return e.apply(this,arguments)}}function n(e){try{if(!r.g.localStorage)return!1}catch(e){return!1}var t=r.g.localStorage[e];return null!=t&&"true"===String(t).toLowerCase()}e.exports=t},911:function(e){e.exports=r;var t=Object.prototype.hasOwnProperty;function r(){for(var e={},r=0;r<arguments.length;r++){var n=arguments[r];for(var i in n)t.call(n,i)&&(e[i]=n[i])}return e}},300:function(e){"use strict";e.exports=r(75927)},361:function(e){"use strict";e.exports=r(60429)},781:function(e){"use strict";e.exports=r(83979)},310:function(e){"use strict";e.exports=r(76679)},837:function(e){"use strict";e.exports=r(53964)}},s={};function a(e){var r=s[e];if(void 0!==r)return r.exports;var n=s[e]={exports:{}},i=!0;try{t[e](n,n.exports,a),i=!1}finally{i&&delete s[e]}return n.exports}a.ab=n+"/";var c=a(813);e.exports=c}()},53964:(e,t,r)=>{var n="/",i=r(75927).Buffer,o=r(2818);!function(){var t={992:function(e){e.exports=function(e,r,n){if(e.filter)return e.filter(r,n);if(null==e||"function"!=typeof r)throw TypeError();for(var i=[],o=0;o<e.length;o++)if(t.call(e,o)){var s=e[o];r.call(n,s,o,e)&&i.push(s)}return i};var t=Object.prototype.hasOwnProperty},256:function(e,t,r){"use strict";var n=r(192),i=r(139),o=i(n("String.prototype.indexOf"));e.exports=function(e,t){var r=n(e,!!t);return"function"==typeof r&&o(e,".prototype.")>-1?i(r):r}},139:function(e,t,r){"use strict";var n=r(212),i=r(192),o=i("%Function.prototype.apply%"),s=i("%Function.prototype.call%"),a=i("%Reflect.apply%",!0)||n.call(s,o),c=i("%Object.getOwnPropertyDescriptor%",!0),u=i("%Object.defineProperty%",!0),l=i("%Math.max%");if(u)try{u({},"a",{value:1})}catch(e){u=null}e.exports=function(e){var t=a(n,s,arguments);return c&&u&&c(t,"length").configurable&&u(t,"length",{value:1+l(0,e.length-(arguments.length-1))}),t};var d=function(){return a(n,o,arguments)};u?u(e.exports,"apply",{value:d}):e.exports.apply=d},181:function(e){"use strict";e.exports=EvalError},545:function(e){"use strict";e.exports=Error},22:function(e){"use strict";e.exports=RangeError},803:function(e){"use strict";e.exports=ReferenceError},182:function(e){"use strict";e.exports=SyntaxError},202:function(e){"use strict";e.exports=TypeError},284:function(e){"use strict";e.exports=URIError},144:function(e){var t=Object.prototype.hasOwnProperty,r=Object.prototype.toString;e.exports=function(e,n,i){if("[object Function]"!==r.call(n))throw TypeError("iterator must be a function");var o=e.length;if(o===+o)for(var s=0;s<o;s++)n.call(i,e[s],s,e);else for(var a in e)t.call(e,a)&&n.call(i,e[a],a,e)}},136:function(e){"use strict";var t="Function.prototype.bind called on incompatible ",r=Object.prototype.toString,n=Math.max,i="[object Function]",o=function(e,t){for(var r=[],n=0;n<e.length;n+=1)r[n]=e[n];for(var i=0;i<t.length;i+=1)r[i+e.length]=t[i];return r},s=function(e,t){for(var r=[],n=t||0,i=0;n<e.length;n+=1,i+=1)r[i]=e[n];return r},a=function(e,t){for(var r="",n=0;n<e.length;n+=1)r+=e[n],n+1<e.length&&(r+=t);return r};e.exports=function(e){var c,u=this;if("function"!=typeof u||r.apply(u)!==i)throw TypeError(t+u);
vendor: 2,383 bytes, line 37
37for(var l=s(arguments,1),d=function(){if(this instanceof c){var t=u.apply(this,o(l,arguments));return Object(t)===t?t:this}return u.apply(e,o(l,arguments))},f=n(0,u.length-l.length),h=[],p=0;p<f;p++)h[p]="$"+p;if(c=Function("binder","return function ("+a(h,",")+"){ return binder.apply(this,arguments); }")(d),u.prototype){var y=function(){};y.prototype=u.prototype,c.prototype=new y,y.prototype=null}return c}},212:function(e,t,r){"use strict";var n=r(136);e.exports=Function.prototype.bind||n},192:function(e,t,r){"use strict";var n,i=r(545),o=r(181),s=r(22),a=r(803),c=r(182),u=r(202),l=r(284),d=Function,f=function(e){try{return d('"use strict"; return ('+e+").constructor;")()}catch(e){}},h=Object.getOwnPropertyDescriptor;if(h)try{h({},"")}catch(e){h=null}var p=function(){throw new u},y=h?function(){try{return arguments.callee,p}catch(e){try{return h(arguments,"callee").get}catch(e){return p}}}():p,g=r(115)(),m=r(14)(),b=Object.getPrototypeOf||(m?function(e){return e.__proto__}:null),v={},w="undefined"!=typeof Uint8Array&&b?b(Uint8Array):n,_={__proto__:null,"%AggregateError%":"undefined"==typeof AggregateError?n:AggregateError,"%Array%":Array,"%ArrayBuffer%":"undefined"==typeof ArrayBuffer?n:ArrayBuffer,"%ArrayIteratorPrototype%":g&&b?b([][Symbol.iterator]()):n,"%AsyncFromSyncIteratorPrototype%":n,"%AsyncFunction%":v,"%AsyncGenerator%":v,"%AsyncGeneratorFunction%":v,"%AsyncIteratorPrototype%":v,"%Atomics%":"undefined"==typeof Atomics?n:Atomics,"%BigInt%":"undefined"==typeof BigInt?n:BigInt,"%BigInt64Array%":"undefined"==typeof BigInt64Array?n:BigInt64Array,"%BigUint64Array%":"undefined"==typeof BigUint64Array?n:BigUint64Array,"%Boolean%":Boolean,"%DataView%":"undefined"==typeof DataView?n:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":i,"%eval%":eval,"%EvalError%":o,"%Float32Array%":"undefined"==typeof Float32Array?n:Float32Array,"%Float64Array%":"undefined"==typeof Float64Array?n:Float64Array,"%FinalizationRegistry%":"undefined"==typeof FinalizationRegistry?n:FinalizationRegistry,"%Function%":d,"%GeneratorFunction%":v,"%Int8Array%":"undefined"==typeof Int8Array?n:Int8Array,"%Int16Array%":"undefined"==typeof Int16Array?n:Int16Array,"%Int32Array%":"undefined"==typeof Int32Array?n:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%
37IteratorPrototype%":g&&b?b(b([][Symbol.iterator]())):n,"%JSON%":"object"==typeof JSON?JSON:n,"%Map%":"undefined"==typeof Map?n:Map,"%MapIteratorPrototype%":"undefined"!=typeof Map&&g&&b?b((new Map)[Symbol.iterator]()):n,"%Math%":Math,"%Number%":Number,"%Object%":Object,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":"undefined"==typeof Promise?n:Promise,"%Proxy%":"undefined"==typeof Proxy?n:Proxy,"%RangeError%":s,"%ReferenceError%":a,"%Reflect%":"undefined"==typeof Reflect?n:Reflect,"%RegExp%":RegExp,"%Set%":"undefined"==typeof Set?n:Set,"%SetIteratorPrototype%":"undefined"!=typeof Set&&g&&b?b((new Set)[Symbol.iterator]()):n,"%SharedArrayBuffer%":"undefined"==typeof SharedArrayBuffer?n:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":g&&b?b(""[Symbol.iterator]()):n,"%Symbol%":g?Symbol:n,"%SyntaxError%":c,"%ThrowTypeError%":y,"%TypedArray%":w,"%TypeError%":u,"%Uint8Array%":"undefined"==typeof Uint8Array?n:Uint8Array,"%Uint8ClampedArray%":"undefined"==typeof Uint8ClampedArray?n:Uint8ClampedArray,"%Uint16Array%":"undefined"==typeof Uint16Array?n:Uint16Array,"%Uint32Array%":"undefined"==typeof Uint32Array?n:Uint32Array,"%URIError%":l,"%WeakMap%":"undefined"==typeof WeakMap?n:WeakMap,"%WeakRef%":"undefined"==typeof WeakRef?n:WeakRef,"%WeakSet%":"undefined"==typeof WeakSet?n:WeakSet};if(b)try{null.error}catch(e){var E=b(b(e));_["%Error.prototype%"]=E}var S=function e(t){var r;if("%AsyncFunction%"===t)r=f("async function () {}");else if("%GeneratorFunction%"===t)r=f("function* () {}");else if("%AsyncGeneratorFunction%"===t)r=f("async function* () {}");else if("%AsyncGenerator%"===t){var n=e("%AsyncGeneratorFunction%");n&&(r=n.prototype)}else if("%AsyncIteratorPrototype%"===t){var i=e("%AsyncGenerator%");i&&b&&(r=b(i.prototype))}return _[t]=r,r},x={__proto__:null,"%ArrayBufferPrototype%":["ArrayBuffer","prototype"],"%ArrayPrototype%":["Array","prototype"],"%ArrayProto_entries%":["Array","prototype","entries"],"%ArrayProto_forEach%":["Array","prototype","forEach"],"%ArrayProto_keys%":["Array","prototype","keys"],"%ArrayProto_values%":["Array","prototype","values"],"%AsyncFunctionPrototype%":["AsyncFunction","prototype"],"%AsyncGenerator%":["AsyncGeneratorFunction","prototype"],"%AsyncGeneratorPrototype%":["AsyncGeneratorFunction","prototype","prototype"],"%BooleanPrototype%":["Boolean","prototype"],"%DataViewPrototype%":["DataView","prototype"],"%DatePrototype%":["Date","prototype"],"%ErrorPrototype%":["Error","prototype"],"%EvalErrorPrototype%":["EvalError","prototype"],"%Float32ArrayPrototype%":["Float32Array","prototype"],"%Float64ArrayPrototype%":["Float64Array","prototype"],"%FunctionPrototype%":["Function","prototype"],"%Generator%":["GeneratorFunction","prototype"],"%GeneratorPrototype%":["GeneratorFunction","prototype","prototype"],"%Int8ArrayPrototype%":["Int8Array","prototype"],"%Int16ArrayPrototype%":["Int16Array","prototype"],"%Int32ArrayPrototype%":["Int32Array","prototype"],"%JSONParse%":["JSON","parse"],"%JSONStringify%":["JSON","stringify"],"%MapPrototype%":["Map","prototype"],"%NumberPrototype%":["Number","prototype"],"%ObjectPrototype%":["Object","prototype"],"%ObjProto_toString%":["Object","prototype","toString"],"%ObjProto_valueOf%":["Object","prototype","valueOf"],"%PromisePrototype%":["Promise","prototype"],"%PromiseProto_then%":["Promise","prototype","then"],"%Promise_all%":["Promise","all"],"%Promise_reject%":["Promise","reject"],"%Promise_resolve%":["Promise","resolve"],"%RangeErrorPrototype%":["RangeError","prototype"],"%ReferenceErrorPrototype%":["ReferenceError","prototype"],"%RegExpPrototype%":["RegExp","prototype"],"%SetPrototype%":["Set","prototype"],"%SharedArrayBufferPrototype%":["SharedArrayBuffer","prototype"],"%StringPrototype%":["String","prototype"],"%SymbolPrototype%":["Symbol","prototype"],"%SyntaxErrorPrototype%":["SyntaxError","prototype"],"%TypedArrayPrototype%":["TypedArray","prototype"],"%TypeErrorPrototype%":["TypeError","prototype"],"%Uint8ArrayPrototype%":["Uint8Array","prototype"],"%Uint8ClampedArrayPrototype%":["Uint8ClampedArray","prototype"],"%Uint16ArrayPrototype%":["Uint16Array","prototype"],"%Uint32ArrayPrototype%":["Uint32Array","prototype"],"%URIErrorPrototype%":["URIError","prototype"],"%WeakMapPrototype%":["WeakMap","prototype"],"%WeakSetPrototype%":["WeakSet","prototype"]},A=r(212),I=r(270),O=A.call(Function.call,Array.prototype.concat),T=A.call(Function.apply,Array.prototype.splice),P=A.call(Function.call,String.prototype.replace),M=A.call(Function.call,String.prototype.slice),N=A.call(Function.call,RegExp.prototype.exec),k=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,C=/\\(\\)?/g,D=function(e){var t=M(e,0,1),r=M(e,-1);if("%"===t&&"%"!==r)throw new c("invalid intrinsic syntax, expected closing `%`");if("%"===r&&"%"!==t)throw new c("invalid intrinsic syntax, expected opening `%`");var n=[];return P(e,k,function(e,t,r,i){n[n.length]=r?P(i,C,"$1"):t||e}),n},j=function(e,t){var r,n=e;if(I(x,n)&&(n="%"+(r=x[n])[0]+"%"),I(_,n)){var i=_[n];if(i===v&&(i=S(n)),void 0===i&&!t)throw new u("intrinsic "+e+" exists, but is not available. Please file an issue!");return{alias:r,name:n,value:i}}throw new c("intrinsic "+e+" does not exist!")};e.exports=function(e,t){if("string"!=typeof e||0===e.length)throw new u("intrinsic name must be a non-empty string");if(arguments.length>1&&"boolean"!=typeof t)throw new u('"allowMissing" argument must be a boolean');if(null===N(/^%?[^%]*%?$/,e))throw new c("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var r=D(e),n=r.length>0?r[0]:"",i=j("%"+n+"%",t),o=i.name,s=i.value,a=!1,l=i.alias;l&&(n=l[0],T(r,O([0,1],l)));for(var d=1,f=!0;d<r.length;d+=1){var p=r[d],y=M(p,0,1),g=M(p,-1);if(('"'===y||"'"===y||"`"===y||'"'===g||"'"===g||"`"===g)&&y!==g)throw new c("property names with quotes must have matching quotes");if("constructor"!==p&&f||(a=!0),n+="."+p,I(_,o="%"+n+"%"))s=_[o];else if(null!=s){if(!(p in s)){if(!t)throw new u("base intrinsic for "+e+" exists, but the property is not available.");return}if(h&&d+1>=r.length){var m=h(s,p);s=(f=!!m)&&"get"in m&&!("originalValue"in m.get)?m.get:s[p]}else f=I(s,p),s=s[p];f&&!a&&(_[o]=s)}}return s}},14:function(e){"use strict";var t={__proto__:null,foo:{}},r=Object;e.exports=function(){return({__proto__:t}).foo===t.foo&&!(t instanceof r)}},942:function(e,t,r){"use strict";var n="undefined"!=typeof Symbol&&Symbol,i=r(773);e.exports=function(){return"function"==typeof n&&"function"==typeof Symbol&&"symbol"==typeof n("foo")&&"symbol"==typeof Symbol("bar")&&i()}},773:function(e){"use strict";e.exports=function(){if("function"!=typeof Symbol||"function"!=typeof Object.getOwnPropertySymbols)return!1;if("symbol"==typeof Symbol.iterator)return!0;var e={},t=Symbol("test"),r=Object(t);if("string"==typeof t||"[object Symbol]"!==Object.prototype.toString.call(t)||"[object Symbol]"!==Object.prototype.toString.call(r))return!1;var n=42;for(t in e[t]=n,e)return!1;if("function"==typeof Object.keys&&0!==Object.keys(e).length||"function"==typeof Object.getOwnPropertyNames&&0!==Object.getOwnPropertyNames(e).length)return!1;var i=Object.getOwnPropertySymbols(e);if(1!==i.length||i[0]!==t||!Object.prototype.propertyIsEnumerable.call(e,t))return!1;if("function"==typeof Object.getOwnPropertyDescriptor){var o=Object.getOwnPropertyDescriptor(e,t);if(o.value!==n||!0!==o.enumerable)return!1}return!0}},115:function(e,t,r){"use strict";var n="undefined"!=typeof Symbol&&Symbol,i=r(832);e.exports=function(){return"function"==typeof n&&"function"==typeof Symbol&&"symbol"==typeof n("foo")&&"symbol"==typeof Symbol("bar")&&i()}},832:function(e){"use strict";e.exports=function(){if("function"!=typeof Symbol||"function"!=typeof Object.getOwnPropertySymbols)return!1;if("symbol"==typeof Symbol.iterator)return!0;var e={},t=Symbol("test"),r=Object(t);if("string"==typeof t||"[object Symbol]"!==Object.prototype.toString.call(t)||"[object Symbol]"!==Object.prototype.toString.call(r))return!1;var n=42;for(t in e[t]=n,e)return!1;if("function"==typeof Object.keys&&0!==Object.keys(e).length||"function"==typeof Object.getOwnPropertyNames&&0!==Object.getOwnPropertyNames(e).length)return!1;var i=Object.getOwnPropertySymbols(e);if(1!==i.length||i[0]!==t||!Object.prototype.propertyIsEnumerable.call(e,t))return!1;if("function"==typeof Object.getOwnPropertyDescriptor){var o=Object.getOwnPropertyDescriptor(e,t);if(o.value!==n||!0!==o.enumerable)return!1}return!0}},270:function(e,t,r){"use strict";var n=Function.prototype.call,i=Object.prototype.hasOwnProperty,o=r(212);e.exports=o.call(n,i)},782: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}}},157:function(e){"use strict";var t="function"==typeof Symbol&&"symbol"==typeof Symbol.toStringTag,r=Object.prototype.toString,n=function(e){return(!t||!e||"object"!=typeof e||!(Symbol.toStringTag in e))&&"[object Arguments]"===r.call(e)},i=function(e){return!!n(e)||null!==e&&"object"==typeof e&&"number"==typeof e.length&&e.length>=0&&"[object Array]"!==r.call(e)&&"[object Function]"===r.call(e.callee)},o=function(){return n(arguments)}();n.isLegacyArguments=i,e.exports=o?n:i},391:function(e){"use strict";var t=Object.prototype.toString,r=Function.prototype.toString,n=/^\s*(?:function)?\*/,i="function"==typeof Symbol&&"symbol"==typeof Symbol.toStringTag,o=Object.getPrototypeOf,s=function(){if(!i)return!1;try{return Function("return function*() {}")()}catch(e){}}(),a=s?o(s):{};e.exports=function(e){return"function"==typeof e&&(!!n.test(r.call(e))||(i?o(e)===a:"[object GeneratorFunction]"===t.call(e)))}},994:function(e,t,n){"use strict";var i=n(144),o=n(349),s=n(256),a=s("Object.prototype.toString"),c=n(942)()&&"symbol"==typeof Symbol.toStringTag,u=o(),l=s("Array.prototype.indexOf",!0)||function(e,t){for(var r=0;r<e.length;r+=1)if(e[r]===t)return r;return -1},d=s("String.prototype.slice"),f={},h=n(24),p=Object.getPrototypeOf;c&&h&&p&&i(u,function(e){var t=new r.g[e];
37if(!(Symbol.toStringTag in t))throw EvalError("this engine has support for Symbol.toStringTag, but "+e+" does not have the property! Please report this.");var n=p(t),i=h(n,Symbol.toStringTag);i||(i=h(p(n),Symbol.toStringTag)),f[e]=i.get});var y=function(e){var t=!1;return i(f,function(r,n){if(!t)try{t=r.call(e)===n}catch(e){}}),t};e.exports=function(e){return!!e&&"object"==typeof e&&(c?!!h&&y(e):l(u,d(a(e),8,-1))>-1)}},369:function(e){e.exports=function(e){return e instanceof i}},584:function(e,t,r){"use strict";var n=r(157),i=r(391),o=r(490),s=r(994);function a(e){return e.call.bind(e)}var c="undefined"!=typeof BigInt,u="undefined"!=typeof Symbol,l=a(Object.prototype.toString),d=a(Number.prototype.valueOf),f=a(String.prototype.valueOf),h=a(Boolean.prototype.valueOf);if(c)var p=a(BigInt.prototype.valueOf);if(u)var y=a(Symbol.prototype.valueOf);function g(e,t){if("object"!=typeof e)return!1;try{return t(e),!0}catch(e){return!1}}function m(e){return"undefined"!=typeof Promise&&e instanceof Promise||null!==e&&"object"==typeof e&&"function"==typeof e.then&&"function"==typeof e.catch}function b(e){return"undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(e):s(e)||K(e)}function v(e){return"Uint8Array"===o(e)}function w(e){return"Uint8ClampedArray"===o(e)}function _(e){return"Uint16Array"===o(e)}function E(e){return"Uint32Array"===o(e)}function S(e){return"Int8Array"===o(e)}function x(e){return"Int16Array"===o(e)}function A(e){return"Int32Array"===o(e)}function I(e){return"Float32Array"===o(e)}function O(e){return"Float64Array"===o(e)}function T(e){return"BigInt64Array"===o(e)}function P(e){return"BigUint64Array"===o(e)}function M(e){return"[object Map]"===l(e)}function N(e){return"undefined"!=typeof Map&&(M.working?M(e):e instanceof Map)}function k(e){return"[object Set]"===l(e)}function C(e){return"undefined"!=typeof Set&&(k.working?k(e):e instanceof Set)}function D(e){return"[object WeakMap]"===l(e)}function j(e){return"undefined"!=typeof WeakMap&&(D.working?D(e):e instanceof WeakMap)}function R(e){return"[object WeakSet]"===l(e)}function L(e){return R(e)}function B(e){return"[object ArrayBuffer]"===l(e)}function U(e){return"undefined"!=typeof ArrayBuffer&&(B.working?B(e):e instanceof ArrayBuffer)}function $(e){return"[object DataView]"===l(e)}function K(e){return"undefined"!=typeof DataView&&($.working?$(e):e instanceof DataView)}t.isArgumentsObject=n,t.isGeneratorFunction=i,t.isTypedArray=s,t.isPromise=m,t.isArrayBufferView=b,t.isUint8Array=v,t.isUint8ClampedArray=w,t.isUint16Array=_,t.isUint32Array=E,t.isInt8Array=S,t.isInt16Array=x,t.isInt32Array=A,t.isFloat32Array=I,t.isFloat64Array=O,t.isBigInt64Array=T,t.isBigUint64Array=P,M.working="undefined"!=typeof Map&&M(new Map),t.isMap=N,k.working="undefined"!=typeof Set&&k(new Set),t.isSet=C,D.working="undefined"!=typeof WeakMap&&D(new WeakMap),t.isWeakMap=j,R.working="undefined"!=typeof WeakSet&&R(new WeakSet),t.isWeakSet=L,B.working="undefined"!=typeof ArrayBuffer&&B(new ArrayBuffer),t.isArrayBuffer=U,$.working="undefined"!=typeof ArrayBuffer&&"undefined"!=typeof DataView&&$(new DataView(new ArrayBuffer(1),0,1)),t.isDataView=K;var F="undefined"!=typeof SharedArrayBuffer?SharedArrayBuffer:void 0;function z(e){return"[object SharedArrayBuffer]"===l(e)}function q(e){return void 0!==F&&(void 0===z.working&&(z.working=z(new F)),z.working?z(e):e instanceof F)}function V(e){return"[object AsyncFunction]"===l(e)}function H(e){return"[object Map Iterator]"===l(e)}function G(e){return"[object Set Iterator]"===l(e)}function W(e){return"[object Generator]"===l(e)}function J(e){return"[object WebAssembly.Module]"===l(e)}function Z(e){return g(e,d)}function Y(e){return g(e,f)}function X(e){return g(e,h)}function Q(e){return c&&g(e,p)}function ee(e){return u&&g(e,y)}function et(e){return Z(e)||Y(e)||X(e)||Q(e)||ee(e)}function er(e){return"undefined"!=typeof Uint8Array&&(U(e)||q(e))}t.isSharedArrayBuffer=q,t.isAsyncFunction=V,t.isMapIterator=H,t.isSetIterator=G,t.isGeneratorObject=W,t.isWebAssemblyCompiledModule=J,t.isNumberObject=Z,t.isStringObject=Y,t.isBooleanObject=X,t.isBigIntObject=Q,t.isSymbolObject=ee,t.isBoxedPrimitive=et,t.isAnyArrayBuffer=er,["isProxy","isExternal","isModuleNamespaceObject"].forEach(function(e){Object.defineProperty(t,e,{enumerable:!1,value:function(){throw Error(e+" is not supported in userland")}})})},177:function(e,t,r){var n=Object.getOwnPropertyDescriptors||function(e){for(var t=Object.keys(e),r={},n=0;n<t.length;n++)r[t[n]]=Object.getOwnPropertyDescriptor(e,t[n]);return r},i=/%[sdj%]/g;t.format=function(e){if(!x(e)){for(var t=[],r=0;r<arguments.length;r++)t.push(u(arguments[r]));return t.join(" ")}for(var r=1,n=arguments,o=n.length,s=String(e).replace(i,function(e){if("%%"===e)return"%";if(r>=o)return e;switch(e){case"%s":return String(n[r++]);case"%d":return Number(n[r++]);case"%j":try{return JSON.stringify(n[r++])}catch(e){return"[Circular]"}default:return e}}),a=n[r];r<o;a=n[++r])_(a)||!T(a)?s+=" "+a:s+=" "+u(a);return s},t.deprecate=function(e,r){if(void 0!==o&&!0===o.noDeprecation)return e;if(void 0===o)return function(){return t.deprecate(e,r).apply(this,arguments)};var n=!1;
vendor: 4,911 bytes, line 37
37return function(){if(!n){if(o.throwDeprecation)throw Error(r);o.traceDeprecation?console.trace(r):console.error(r),n=!0}return e.apply(this,arguments)}};var s={},a=/^$/;if(o.env.NODE_DEBUG){var c=o.env.NODE_DEBUG;a=RegExp("^"+(c=c.replace(/[|\\{}()[\]^$+?.]/g,"\\$&").replace(/\*/g,".*").replace(/,/g,"$|^").toUpperCase())+"$","i")}function u(e,r){var n={seen:[],stylize:d};return arguments.length>=3&&(n.depth=arguments[2]),arguments.length>=4&&(n.colors=arguments[3]),w(r)?n.showHidden=r:r&&t._extend(n,r),I(n.showHidden)&&(n.showHidden=!1),I(n.depth)&&(n.depth=2),I(n.colors)&&(n.colors=!1),I(n.customInspect)&&(n.customInspect=!0),n.colors&&(n.stylize=l),h(n,e,n.depth)}function l(e,t){var r=u.styles[t];return r?"\x1b["+u.colors[r][0]+"m"+e+"\x1b["+u.colors[r][1]+"m":e}function d(e,t){return e}function f(e){var t={};return e.forEach(function(e,r){t[e]=!0}),t}function h(e,r,n){if(e.customInspect&&r&&N(r.inspect)&&r.inspect!==t.inspect&&!(r.constructor&&r.constructor.prototype===r)){var i,o=r.inspect(n,e);return x(o)||(o=h(e,o,n)),o}var s=p(e,r);if(s)return s;var a=Object.keys(r),c=f(a);if(e.showHidden&&(a=Object.getOwnPropertyNames(r)),M(r)&&(a.indexOf("message")>=0||a.indexOf("description")>=0))return y(r);if(0===a.length){if(N(r)){var u=r.name?": "+r.name:"";return e.stylize("[Function"+u+"]","special")}if(O(r))return e.stylize(RegExp.prototype.toString.call(r),"regexp");if(P(r))return e.stylize(Date.prototype.toString.call(r),"date");if(M(r))return y(r)}var l="",d=!1,w=["{","}"];return(v(r)&&(d=!0,w=["[","]"]),N(r)&&(l=" [Function"+(r.name?": "+r.name:"")+"]"),O(r)&&(l=" "+RegExp.prototype.toString.call(r)),P(r)&&(l=" "+Date.prototype.toUTCString.call(r)),M(r)&&(l=" "+y(r)),0!==a.length||d&&0!=r.length)?n<0?O(r)?e.stylize(RegExp.prototype.toString.call(r),"regexp"):e.stylize("[Object]","special"):(e.seen.push(r),i=d?g(e,r,n,c,a):a.map(function(t){return m(e,r,n,c,t,d)}),e.seen.pop(),b(i,l,w)):w[0]+l+w[1]}function p(e,t){if(I(t))return e.stylize("undefined","undefined");if(x(t)){var r="'"+JSON.stringify(t).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return e.stylize(r,"string")}return S(t)?e.stylize(""+t,"number"):w(t)?e.stylize(""+t,"boolean"):_(t)?e.stylize("null","null"):void 0}function y(e){return"["+Error.prototype.toString.call(e)+"]"}function g(e,t,r,n,i){for(var o=[],s=0,a=t.length;s<a;++s)L(t,String(s))?o.push(m(e,t,r,n,String(s),!0)):o.push("");return i.forEach(function(i){i.match(/^\d+$/)||o.push(m(e,t,r,n,i,!0))}),o}function m(e,t,r,n,i,o){var s,a,c;if((c=Object.getOwnPropertyDescriptor(t,i)||{value:t[i]}).get?a=c.set?e.stylize("[Getter/Setter]","special"):e.stylize("[Getter]","special"):c.set&&(a=e.stylize("[Setter]","special")),L(n,i)||(s="["+i+"]"),!a&&(0>e.seen.indexOf(c.value)?(a=_(r)?h(e,c.value,null):h(e,c.value,r-1)).indexOf("\n")>-1&&(a=o?a.split("\n").map(function(e){return" "+e}).join("\n").substr(2):"\n"+a.split("\n").map(function(e){return" "+e}).join("\n")):a=e.stylize("[Circular]","special")),I(s)){if(o&&i.match(/^\d+$/))return a;(s=JSON.stringify(""+i)).match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)?(s=s.substr(1,s.length-2),s=e.stylize(s,"name")):(s=s.replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'"),s=e.stylize(s,"string"))}return s+": "+a}function b(e,t,r){var n=0;return e.reduce(function(e,t){return n++,t.indexOf("\n")>=0&&n++,e+t.replace(/\u001b\[\d\d?m/g,"").length+1},0)>60?r[0]+(""===t?"":t+"\n ")+" "+e.join(",\n ")+" "+r[1]:r[0]+t+" "+e.join(", ")+" "+r[1]}function v(e){return Array.isArray(e)}function w(e){return"boolean"==typeof e}function _(e){return null===e}function E(e){return null==e}function S(e){return"number"==typeof e}function x(e){return"string"==typeof e}function A(e){return"symbol"==typeof e}function I(e){return void 0===e}function O(e){return T(e)&&"[object RegExp]"===C(e)}function T(e){return"object"==typeof e&&null!==e}function P(e){return T(e)&&"[object Date]"===C(e)}function M(e){return T(e)&&("[object Error]"===C(e)||e instanceof Error)}function N(e){return"function"==typeof e}function k(e){return null===e||"boolean"==typeof e||"number"==typeof e||"string"==typeof e||"symbol"==typeof e||void 0===e}function C(e){return Object.prototype.toString.call(e)}function D(e){return e<10?"0"+e.toString(10):e.toString(10)}t.debuglog=function(e){if(!s[e=e.toUpperCase()]){if(a.test(e)){var r=o.pid;s[e]=function(){var n=t.format.apply(t,arguments);console.error("%s %d: %s",e,r,n)}}else s[e]=function(){}}return s[e]},t.inspect=u,u.colors={bold:[1,22],italic:[3,23],underline:[4,24],inverse:[7,27],white:[37,39],grey:[90,39],black:[30,39],blue:[34,39],cyan:[36,39],green:[32,39],magenta:[35,39],red:[31,39],yellow:[33,39]},u.styles={special:"cyan",number:"yellow",boolean:"yellow",undefined:"grey",null:"bold",string:"green",date:"magenta",regexp:"red"},t.types=r(584),t.isArray=v,t.isBoolean=w,t.isNull=_,t.isNullOrUndefined=E,t.isNumber=S,t.isString=x,t.isSymbol
37=A,t.isUndefined=I,t.isRegExp=O,t.types.isRegExp=O,t.isObject=T,t.isDate=P,t.types.isDate=P,t.isError=M,t.types.isNativeError=M,t.isFunction=N,t.isPrimitive=k,t.isBuffer=r(369);var j=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function R(){var e=new Date,t=[D(e.getHours()),D(e.getMinutes()),D(e.getSeconds())].join(":");return[e.getDate(),j[e.getMonth()],t].join(" ")}function L(e,t){return Object.prototype.hasOwnProperty.call(e,t)}t.log=function(){console.log("%s - %s",R(),t.format.apply(t,arguments))},t.inherits=r(782),t._extend=function(e,t){if(!t||!T(t))return e;for(var r=Object.keys(t),n=r.length;n--;)e[r[n]]=t[r[n]];return e};var B="undefined"!=typeof Symbol?Symbol("util.promisify.custom"):void 0;function U(e,t){if(!e){var r=Error("Promise was rejected with a falsy value");r.reason=e,e=r}return t(e)}function $(e){if("function"!=typeof e)throw TypeError('The "original" argument must be of type Function');function t(){for(var t=[],r=0;r<arguments.length;r++)t.push(arguments[r]);var n=t.pop();if("function"!=typeof n)throw TypeError("The last argument must be of type Function");var i=this,s=function(){return n.apply(i,arguments)};e.apply(this,t).then(function(e){o.nextTick(s.bind(null,null,e))},function(e){o.nextTick(U.bind(null,e,s))})}return Object.setPrototypeOf(t,Object.getPrototypeOf(e)),Object.defineProperties(t,n(e)),t}t.promisify=function(e){if("function"!=typeof e)throw TypeError('The "original" argument must be of type Function');if(B&&e[B]){var t=e[B];if("function"!=typeof t)throw TypeError('The "util.promisify.custom" argument must be of type Function');return Object.defineProperty(t,B,{value:t,enumerable:!1,writable:!1,configurable:!0}),t}function t(){for(var t,r,n=new Promise(function(e,n){t=e,r=n}),i=[],o=0;o<arguments.length;o++)i.push(arguments[o]);i.push(function(e,n){e?r(e):t(n)});try{e.apply(this,i)}catch(e){r(e)}return n}return Object.setPrototypeOf(t,Object.getPrototypeOf(e)),B&&Object.defineProperty(t,B,{value:t,enumerable:!1,writable:!1,configurable:!0}),Object.defineProperties(t,n(e))},t.promisify.custom=B,t.callbackify=$},490:function(e,t,n){"use strict";var i=n(144),o=n(349),s=n(256),a=s("Object.prototype.toString"),c=n(942)()&&"symbol"==typeof Symbol.toStringTag,u=o(),l=s("String.prototype.slice"),d={},f=n(24),h=Object.getPrototypeOf;c&&f&&h&&i(u,function(e){if("function"==typeof r.g[e]){var t=new r.g[e];if(!(Symbol.toStringTag in t))throw EvalError("this engine has support for Symbol.toStringTag, but "+e+" does not have the property! Please report this.");var n=h(t),i=f(n,Symbol.toStringTag);i||(i=f(h(n),Symbol.toStringTag)),d[e]=i.get}});var p=function(e){var t=!1;return i(d,function(r,n){if(!t)try{var i=r.call(e);i===n&&(t=i)}catch(e){}}),t},y=n(994);e.exports=function(e){return!!y(e)&&(c?p(e):l(a(e),8,-1))}},349:function(e,t,n){"use strict";var i=n(992);e.exports=function(){return i(["BigInt64Array","BigUint64Array","Float32Array","Float64Array","Int16Array","Int32Array","Int8Array","Uint16Array","Uint32Array","Uint8Array","Uint8ClampedArray"],function(e){return"function"==typeof r.g[e]})}},24:function(e,t,r){"use strict";var n=r(192)("%Object.getOwnPropertyDescriptor%",!0);if(n)try{n([],"length")}catch(e){n=null}e.exports=n}},s={};function a(e){var r=s[e];if(void 0!==r)return r.exports;var n=s[e]={exports:{}},i=!0;try{t[e](n,n.exports,a),i=!1}finally{i&&delete s[e]}return n.exports}a.ab=n+"/";var c=a(177);e.exports=c}()},69844:module=>{var __dirname="/";!function(){var __webpack_modules__={950:function(__unused_webpack_module,exports){var indexOf=function(e,t){if(e.indexOf)return e.indexOf(t);for(var r=0;r<e.length;r++)if(e[r]===t)return r;return -1},Object_keys=function(e){if(Object.keys)return Object.keys(e);var t=[];for(var r in e)t.push(r);return t},forEach=function(e,t){if(e.forEach)return e.forEach(t);for(var r=0;r<e.length;r++)t(e[r],r,e)},defineProp=function(){try{return Object.defineProperty({},"_",{}),function(e,t,r){Object.defineProperty(e,t,{writable:!0,enumerable:!1,configurable:!0,value:r})}}catch(e){return function(e,t,r){e[t]=r}}}(),globals=["Array","Boolean","Date","Error","EvalError","Function","Infinity","JSON","Math","NaN","Number","Object","RangeError","ReferenceError","RegExp","String","SyntaxError","TypeError","URIError","decode
37URI","decodeURIComponent","encodeURI","encodeURIComponent","escape","eval","isFinite","isNaN","parseFloat","parseInt","undefined","unescape"];function Context(){}Context.prototype={};var Script=exports.Script=function(e){if(!(this instanceof Script))return new Script(e);this.code=e};Script.prototype.runInContext=function(e){if(!(e instanceof Context))throw TypeError("needs a 'context' argument.");var t=document.createElement("iframe");t.style||(t.style={}),t.style.display="none",document.body.appendChild(t);var r=t.contentWindow,n=r.eval,i=r.execScript;!n&&i&&(i.call(r,"null"),n=r.eval),forEach(Object_keys(e),function(t){r[t]=e[t]}),forEach(globals,function(t){e[t]&&(r[t]=e[t])});var o=Object_keys(r),s=n.call(r,this.code);return forEach(Object_keys(r),function(t){(t in e||-1===indexOf(o,t))&&(e[t]=r[t])}),forEach(globals,function(t){t in e||defineProp(e,t,r[t])}),document.body.removeChild(t),s},Script.prototype.runInThisContext=function(){return eval(this.code)},Script.prototype.runInNewContext=function(e){var t=Script.createContext(e),r=this.runInContext(t);return e&&forEach(Object_keys(t),function(r){e[r]=t[r]}),r},forEach(Object_keys(Script.prototype),function(e){exports[e]=Script[e]=function(t){var r=Script(t);return r[e].apply(r,[].slice.call(arguments,1))}}),exports.isContext=function(e){return e instanceof Context},exports.createScript=function(e){return exports.Script(e)},exports.createContext=Script.createContext=function(e){var t=new Context;return"object"==typeof e&&forEach(Object_keys(e),function(r){t[r]=e[r]}),t}}};"undefined"!=typeof __nccwpck_require__&&(__nccwpck_require__.ab=__dirname+"/");var __nested_webpack_exports__={};__webpack_modules__[950](0,__nested_webpack_exports__),module.exports=__nested_webpack_exports__}()},50412:(e,t)=>{"use strict";var r=function(){if("undefined"!=typeof self)return self;if("undefined"!=typeof window)return window;if(void 0!==r)return r;throw Error("unable to locate global object")}();e.exports=t=r.fetch,r.fetch&&(t.default=r.fetch.bind(r)),t.Headers=r.Headers,t.Request=r.Request,t.Response=r.Response},79995:(e,t,r)=>{let n=r(47685),i=r(77245),o=r(16383),s=r(40934);function a(e,t,r,o,s){let a=[].slice.call(arguments,1),c=a.length,u="function"==typeof a[c-1];if(!u&&!n())throw Error("Callback required as last argument");if(u){if(c<2)throw Error("Too few arguments provided");2===c?(s=r,r=t,t=o=void 0):3===c&&(t.getContext&&void 0===s?(s=o,o=void 0):(s=o,o=r,r=t,t=void 0))}else{if(c<1)throw Error("Too few arguments provided");return 1===c?(r=t,t=o=void 0):2!==c||t.getContext||(o=r,r=t,t=void 0),new Promise(function(n,s){try{let s=i.create(r,o);n(e(s,t,o))}catch(e){s(e)}})}try{let n=i.create(r,o);s(null,e(n,t,o))}catch(e){s(e)}}t.create=i.create,t.toCanvas=a.bind(null,o.render),t.toDataURL=a.bind(null,o.renderToDataURL),t.toString=a.bind(null,function(e,t,r){return s.render(e,r)})},47685:e=>{e.exports=function(){return"function"==typeof Promise&&Promise.prototype&&Promise.prototype.then}},863:(e,t,r)=>{let n=r(56880).getSymbolSize;t.getRowColCoords=function(e){if(1===e)return[];let t=Math.floor(e/7)+2,r=n(e),i=145===r?26:2*Math.ceil((r-13)/(2*t-2)),o=[r-7];for(let e=1;e<t-1;e++)o[e]=o[e-1]-i;return o.push(6),o.reverse()},t.getPositions=function(e){let r=[],n=t.getRowColCoords(e),i=n.length;for(let e=0;e<i;e++)for(let t=0;t<i;t++)(0!==e||0!==t)&&(0!==e||t!==i-1)&&(e!==i-1||0!==t)&&r.push([n[e],n[t]]);return r}},22115:(e,t,r)=>{let n=r(71932),i=["0","1","2","3","4","5","6","7","8","9","A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z"," ","$","%","*","+","-",".","/",":"];function o(e){this.mode=n.ALPHANUMERIC,this.data=e}o.getBitsLength=function(e){return 11*Math.floor(e/2)+e%2*6},o.prototype.getLength=function(){return this.data.length},o.prototype.getBitsLength=function(){return o.getBitsLength(this.data.length)},o.prototype.write=function(e){let t;for(t=0;t+2<=this.data.length;t+=2){let r=45*i.indexOf(this.data[t]);r+=i.indexOf(this.data[t+1]),e.put(r,11)}this.data.length%2&&e.put(i.indexOf(this.data[t]),6)},e.exports=o},48071:e=>{function t(){this.buffer=[],this.length=0}t.prototype={get:function(e){let t=Math.floor(e/8);return(this.buffer[t]>>>7-e%8&1)==1},put:function(e,t){for(let r=0;r<t;r++)this.putBit((e>>>t-r-1&1)==1)},getLengthInBits:function(){return this.length},putBit:function(e){let t=Math.floor(this.length/8);this.buffer.length<=t&&this.buffer.push(0),e&&(this.buffer[t]|=128>>>this.length%8),this.length++}},e.exports=t},53972:e=>{function t(e){if(!e||e<1)throw Error("BitMatrix size must be defined and greater than 0");this.size=e,this.data=new Uint8Array(e*e),this.reservedBit=new Uint8Array(e*e)}t.prototype.set=function(e,t,r,n){let i=e*this.size+t;this.data[i]=r,n&&(this.reservedBit[i]=!0)},t.prototype.get=function(e,t){return this.data[e*this.size+t]},t.prototype.xor=function(e,t,r){this.data[e*this.size+t]^=r},t.prototype.isReserved=function(e,t){return this.reservedBit[e*this.size+t]},e.exports=t},85688:(e,t,r)=>{let n=r(71932);function i(e){this.mode=n.BYTE,"string"==typeof e?this.data=new TextEncoder().encode(e):this.data=new Uint8Array(e)}i.getBitsLength=function(e){return 8*e},i.prototype.getLength=function(){return this.data.length},i.prototype.getBitsLength=function(){return i.getBitsLength(this.data.length)},i.prototype.write=function(e){for(let t=0,r=this.data.length;t<r;t++)e.put(this.data[t],8)},e.exports=i},93684:(e,t,r)=>{let n=r(20865),i=[1,1,1,1,1,1,1,1,1,1,2,2,1,2,2,4,1,2,4,4,2,4,4,4,2,4,6,5,2,4,6,6,2,5,8,8,4,5,8,8,4,5,8,11,4,8,10,11,4,9,12,16,4,9,16,16,6,10,12,18,6,10,17,16,6,11,16,19,6,13,18,21,7,14,21,25,8,16,20,25,8,17,23,25,9,17,23,34,9,18,25,30,10,20,27,32,12,21,29,35,12,23,34,37,12,25,34,40,13,26,35,42,14,28,38,45,15,29,40,48,16,31,43,51,17,33,45,54,18,35,48,57,19,37,51,60,19,38,53,63,20,40,56,66,21,43,59,70,22,45,62,74,24,47,65,77,25,49,68,81],o=[7,10,13,17,10,16,22,28,15,26,36,44,20,36,52,64,26,48,72,88,36,64,96,112,40,72,108,130,48,88,132,156,60,110,160,
37192,72,130,192,224,80,150,224,264,96,176,260,308,104,198,288,352,120,216,320,384,132,240,360,432,144,280,408,480,168,308,448,532,180,338,504,588,196,364,546,650,224,416,600,700,224,442,644,750,252,476,690,816,270,504,750,900,300,560,810,960,312,588,870,1050,336,644,952,1110,360,700,1020,1200,390,728,1050,1260,420,784,1140,1350,450,812,1200,1440,480,868,1290,1530,510,924,1350,1620,540,980,1440,1710,570,1036,1530,1800,570,1064,1590,1890,600,1120,1680,1980,630,1204,1770,2100,660,1260,1860,2220,720,1316,1950,2310,750,1372,2040,2430];t.getBlocksCount=function(e,t){switch(t){case n.L:return i[(e-1)*4+0];case n.M:return i[(e-1)*4+1];case n.Q:return i[(e-1)*4+2];case n.H:return i[(e-1)*4+3];default:return}},t.getTotalCodewordsCount=function(e,t){switch(t){case n.L:return o[(e-1)*4+0];case n.M:return o[(e-1)*4+1];case n.Q:return o[(e-1)*4+2];case n.H:return o[(e-1)*4+3];default:return}}},20865:(e,t)=>{function r(e){if("string"!=typeof e)throw Error("Param is not a string");switch(e.toLowerCase()){case"l":case"low":return t.L;case"m":case"medium":return t.M;case"q":case"quartile":return t.Q;case"h":case"high":return t.H;default:throw Error("Unknown EC Level: "+e)}}t.L={bit:1},t.M={bit:0},t.Q={bit:3},t.H={bit:2},t.isValid=function(e){return e&&void 0!==e.bit&&e.bit>=0&&e.bit<4},t.from=function(e,n){if(t.isValid(e))return e;try{return r(e)}catch(e){return n}}},87428:(e,t,r)=>{let n=r(56880).getSymbolSize,i=7;t.getPositions=function(e){let t=n(e);return[[0,0],[t-i,0],[0,t-i]]}},73335:(e,t,r)=>{let n=r(56880),i=1335,o=21522,s=n.getBCHDigit(i);t.getEncodedBits=function(e,t){let r=e.bit<<3|t,a=r<<10;for(;n.getBCHDigit(a)-s>=0;)a^=i<<n.getBCHDigit(a)-s;return(r<<10|a)^o}},3455:(e,t)=>{let r=new Uint8Array(512),n=new Uint8Array(256);!function(){let e=1;for(let t=0;t<255;t++)r[t]=e,n[e]=t,256&(e<<=1)&&(e^=285);for(let e=255;e<512;e++)r[e]=r[e-255]}(),t.log=function(e){if(e<1)throw Error("log("+e+")");return n[e]},t.exp=function(e){return r[e]},t.mul=function(e,t){return 0===e||0===t?0:r[n[e]+n[t]]}},47873:(e,t,r)=>{let n=r(71932),i=r(56880);function o(e){this.mode=n.KANJI,this.data=e}o.getBitsLength=function(e){return 13*e},o.prototype.getLength=function(){return this.data.length},o.prototype.getBitsLength=function(){return o.getBitsLength(this.data.length)},o.prototype.write=function(e){let t;for(t=0;t<this.data.length;t++){let r=i.toSJIS(this.data[t]);if(r>=33088&&r<=40956)r-=33088;else if(r>=57408&&r<=60351)r-=49472;else throw Error("Invalid SJIS character: "+this.data[t]+"\nMake sure your charset is UTF-8");r=(r>>>8&255)*192+(255&r),e.put(r,13)}},e.exports=o},69616:(e,t)=>{t.Patterns={PATTERN000:0,PATTERN001:1,PATTERN010:2,PATTERN011:3,PATTERN100:4,PATTERN101:5,PATTERN110:6,PATTERN111:7};let r={N1:3,N2:3,N3:40,N4:10};function n(e,r,n){switch(e){case t.Patterns.PATTERN000:return(r+n)%2==0;case t.Patterns.PATTERN001:return r%2==0;case t.Patterns.PATTERN010:return n%3==0;case t.Patterns.PATTERN011:return(r+n)%3==0;case t.Patterns.PATTERN100:return(Math.floor(r/2)+Math.floor(n/3))%2==0;case t.Patterns.PATTERN101:return r*n%2+r*n%3==0;case t.Patterns.PATTERN110:return(r*n%2+r*n%3)%2==0;case t.Patterns.PATTERN111:return(r*n%3+(r+n)%2)%2==0;default:throw Error("bad maskPattern:"+e)}}t.isValid=function(e){return null!=e&&""!==e&&!isNaN(e)&&e>=0&&e<=7},t.from=function(e){return t.isValid(e)?parseInt(e,10):void 0},t.getPenaltyN1=function(e){let t=e.size,n=0,i=0,o=0,s=null,a=null;for(let c=0;c<t;c++){i=o=0,s=a=null;for(let u=0;u<t;u++){let t=e.get(c,u);t===s?i++:(i>=5&&(n+=r.N1+(i-5)),s=t,i=1),(t=e.get(u,c))===a?o++:(o>=5&&(n+=r.N1+(o-5)),a=t,o=1)}i>=5&&(n+=r.N1+(i-5)),o>=5&&(n+=r.N1+(o-5))}return n},t.getPenaltyN2=function(e){let t=e.size,n=0;for(let r=0;r<t-1;r++)for(let i=0;i<t-1;i++){let t=e.get(r,i)+e.get(r,i+1)+e.get(r+1,i)+e.get(r+1,i+1);(4===t||0===t)&&n++}return n*r.N2},t.getPenaltyN3=function(e){let t=e.size,n=0,i=0,o=0;for(let r=0;r<t;r++){i=o=0;for(let s=0;s<t;s++)i=i<<1&2047|e.get(r,s),s>=10&&(1488===i||93===i)&&n++,o=o<<1&2047|e.get(s,r),s>=10&&(1488===o||93===o)&&n++}return n*r.N3},t.getPenaltyN4=function(e){let t=0,n=e.data.length;for(let r=0;r<n;r++)t+=e.data[r];return Math.abs(Math.ceil(100*t/n/5)-10)*r.N4}
vendor: 10,481 bytes, line 37
37,t.applyMask=function(e,t){let r=t.size;for(let i=0;i<r;i++)for(let o=0;o<r;o++)t.isReserved(o,i)||t.xor(o,i,n(e,o,i))},t.getBestMask=function(e,r){let n=Object.keys(t.Patterns).length,i=0,o=1/0;for(let s=0;s<n;s++){r(s),t.applyMask(s,e);let n=t.getPenaltyN1(e)+t.getPenaltyN2(e)+t.getPenaltyN3(e)+t.getPenaltyN4(e);t.applyMask(s,e),n<o&&(o=n,i=s)}return i}},71932:(e,t,r)=>{let n=r(35040),i=r(26734);function o(e){if("string"!=typeof e)throw Error("Param is not a string");switch(e.toLowerCase()){case"numeric":return t.NUMERIC;case"alphanumeric":return t.ALPHANUMERIC;case"kanji":return t.KANJI;case"byte":return t.BYTE;default:throw Error("Unknown mode: "+e)}}t.NUMERIC={id:"Numeric",bit:1,ccBits:[10,12,14]},t.ALPHANUMERIC={id:"Alphanumeric",bit:2,ccBits:[9,11,13]},t.BYTE={id:"Byte",bit:4,ccBits:[8,16,16]},t.KANJI={id:"Kanji",bit:8,ccBits:[8,10,12]},t.MIXED={bit:-1},t.getCharCountIndicator=function(e,t){if(!e.ccBits)throw Error("Invalid mode: "+e);if(!n.isValid(t))throw Error("Invalid version: "+t);return t>=1&&t<10?e.ccBits[0]:t<27?e.ccBits[1]:e.ccBits[2]},t.getBestModeForData=function(e){return i.testNumeric(e)?t.NUMERIC:i.testAlphanumeric(e)?t.ALPHANUMERIC:i.testKanji(e)?t.KANJI:t.BYTE},t.toString=function(e){if(e&&e.id)return e.id;throw Error("Invalid mode")},t.isValid=function(e){return e&&e.bit&&e.ccBits},t.from=function(e,r){if(t.isValid(e))return e;try{return o(e)}catch(e){return r}}},53773:(e,t,r)=>{let n=r(71932);function i(e){this.mode=n.NUMERIC,this.data=e.toString()}i.getBitsLength=function(e){return 10*Math.floor(e/3)+(e%3?e%3*3+1:0)},i.prototype.getLength=function(){return this.data.length},i.prototype.getBitsLength=function(){return i.getBitsLength(this.data.length)},i.prototype.write=function(e){let t,r,n;for(t=0;t+3<=this.data.length;t+=3)n=parseInt(r=this.data.substr(t,3),10),e.put(n,10);let i=this.data.length-t;i>0&&(n=parseInt(r=this.data.substr(t),10),e.put(n,3*i+1))},e.exports=i},90177:(e,t,r)=>{let n=r(3455);t.mul=function(e,t){let r=new Uint8Array(e.length+t.length-1);for(let i=0;i<e.length;i++)for(let o=0;o<t.length;o++)r[i+o]^=n.mul(e[i],t[o]);return r},t.mod=function(e,t){let r=new Uint8Array(e);for(;r.length-t.length>=0;){let e=r[0];for(let i=0;i<t.length;i++)r[i]^=n.mul(t[i],e);let i=0;for(;i<r.length&&0===r[i];)i++;r=r.slice(i)}return r},t.generateECPolynomial=function(e){let r=new Uint8Array([1]);for(let i=0;i<e;i++)r=t.mul(r,new Uint8Array([1,n.exp(i)]));return r}},77245:(e,t,r)=>{let n=r(56880),i=r(20865),o=r(48071),s=r(53972),a=r(863),c=r(87428),u=r(69616),l=r(93684),d=r(78928),f=r(54557),h=r(73335),p=r(71932),y=r(28181);function g(e,t){let r=e.size,n=c.getPositions(t);for(let t=0;t<n.length;t++){let i=n[t][0],o=n[t][1];for(let t=-1;t<=7;t++)if(!(i+t<=-1)&&!(r<=i+t))for(let n=-1;n<=7;n++)o+n<=-1||r<=o+n||(t>=0&&t<=6&&(0===n||6===n)||n>=0&&n<=6&&(0===t||6===t)||t>=2&&t<=4&&n>=2&&n<=4?e.set(i+t,o+n,!0,!0):e.set(i+t,o+n,!1,!0))}}function m(e){let t=e.size;for(let r=8;r<t-8;r++){let t=r%2==0;e.set(r,6,t,!0),e.set(6,r,t,!0)}}function b(e,t){let r=a.getPositions(t);for(let t=0;t<r.length;t++){let n=r[t][0],i=r[t][1];for(let t=-2;t<=2;t++)for(let r=-2;r<=2;r++)-2===t||2===t||-2===r||2===r||0===t&&0===r?e.set(n+t,i+r,!0,!0):e.set(n+t,i+r,!1,!0)}}function v(e,t){let r,n,i;let o=e.size,s=f.getEncodedBits(t);for(let t=0;t<18;t++)r=Math.floor(t/3),n=t%3+o-8-3,i=(s>>t&1)==1,e.set(r,n,i,!0),e.set(n,r,i,!0)}function w(e,t,r){let n,i;let o=e.size,s=h.getEncodedBits(t,r);for(n=0;n<15;n++)i=(s>>n&1)==1,n<6?e.set(n,8,i,!0):n<8?e.set(n+1,8,i,!0):e.set(o-15+n,8,i,!0),n<8?e.set(8,o-n-1,i,!0):n<9?e.set(8,15-n-1+1,i,!0):e.set(8,15-n-1,i,!0);e.set(o-8,8,1,!0)}function _(e,t){let r=e.size,n=-1,i=r-1,o=7,s=0;for(let a=r-1;a>0;a-=2)for(6===a&&a--;;){for(let r=0;r<2;r++)if(!e.isReserved(i,a-r)){let n=!1;s<t.length&&(n=(t[s]>>>o&1)==1),e.set(i,a-r,n),-1==--o&&(s++,o=7)}if((i+=n)<0||r<=i){i-=n,n=-n;break}}}function E(e,t,r){let i=new o;r.forEach(function(t){i.put(t.mode.bit,4),i.put(t.getLength(),p.getCharCountIndicator(t.mode,e)),t.write(i)});let s=(n.getSymbolTotalCodewords(e)-l.getTotalCodewordsCount(e,t))*8;for(i.getLengthInBits()+4<=s&&i.put(0,4);i.getLengthInBits()%8!=0;)i.putBit(0);let a=(s-i.getLengthInBits())/8;for(let e=0;e<a;e++)i.put(e%2?17:236,8);return S(i,e,t)}function S(e,t,r){let i,o;let s=n.getSymbolTotalCodewords(t),a=s-l.getTotalCodewordsCount(t,r),c=l.getBlocksCount(t,r),u=s%c,f=c-u,h=Math.floor(s/c),p=Math.floor(a/c),y=p+1,g=h-p,m=new d(g),b=0,v=Array(c),w=Array(c),_=0,E=new Uint8Array(e.buffer);for(let e=0;e<c;e++){let t=e<f?p:y;v[e]=E.slice(b,b+t),w[e]=m.encode(v[e]),b+=t,_=Math.max(_,t)}let S=new Uint8Array(s),x=0;for(i=0;i<_;i++)for(o=0;o<c;o++)i<v[o].length&&(S[x++]=v[o][i]);for(i=0;i<g;i++)for(o=0;o<c;o++)S[x++]=w[o][i];return S}function x(e,t,r,i){let o;if(Array.isArray(e))o=y.fromArray(e);else if("string"==typeof e){let n=t;if(!n){let t=y.rawSplit(e);n=f.getBestVersionForData(t,r)}o=y.fromString(e,n||40)}else throw Error("Invalid data");let a=f.getBestVersionForData(o,r);if(!a)throw Error("The amount of data is too big to be stored in a QR Code");if(t){if(t<a)throw Error("\nThe chosen QR Code version cannot contain this amount of data.\nMinimum version required to store current data is: "+a+".\n")}else t=a;let c=E(t,r,o),l=new s(n.getSymbolSize(t));return g(l,t),m(l),b(l,t),w(l,r,0),t>=7&&v(l,t),_(l,c),isNaN(i)&&(i=u.getBestMask(l,w.bind(null,l,r))),u.applyMask(i,l),w(l,r,i),{modules:l,version:t,errorCorrectionLevel:r,maskPattern:i,segments:o}}t.create=function(e,t){let r,o;if(void 0===e||""===e)throw Error("No input text");let s=i.M;return void 0!==t&&(s=i.from(t.errorCorrectionLevel,i.M),r=f.from(t.version),o=u.from(t.maskPattern),t.toSJISFunc&&n.setToSJISFunction(t.toSJISFunc)),x(e,r,s,o)}},78928:(e,t,r)=>{let n=r(90177);function i(e){this.genPoly=void 0,this.degree=e,this.degree&&this.initialize(this.degree)}i.prototype.initialize=function(e){this.degree=e,this.genPoly=n.generateECPolynomial(this.degree)},i.prototype.encode=function(e){if(!this.genPoly)throw Error("Encoder not initialized");let t=new Uint8Array(e.length+this.degree);t.set(e);let r=n.mod(t,this.genPoly),i=this.degree-r.length;if(i>0){let e=new Uint8Array(this.degree);return e.set(r,i),e}return r},e.exports=i},26734:(e,t)=>{let r="[0-9]+",n="[A-Z $%*+\\-./:]+",i="(?:[u3000-u303F]|[u3040-u309F]|[u30A0-u30FF]|[uFF00-uFFEF]|[u4E00-u9FAF]|[u2605-u2606]|[u2190-u2195]|u203B|[u2010u2015u2018u2019u2025u2026u201Cu201Du2225u2260]|[u0391-u0451]|[u00A7u00A8u00B1u00B4u00D7u00F7])+",o="(?:(?![A-Z0-9 $%*+\\-./:]|"+(i=i.replace(/u/g,"\\u"))+")(?:.|[\r\n]))+";t.KANJI=RegExp(i,"g"),t.BYTE_KANJI=RegExp("[^A-Z0-9 $%*+\\-./:]+","g"),t.BYTE=RegExp(o,"g"),t.NUMERIC=RegExp(r,"g"),t.ALPHANUMERIC=RegExp(n,"g");let s=RegExp("^"+i+"$"),a=RegExp("^"+r+"$"),c=RegExp("^[A-Z0-9 $%*+\\-./:]+$");t.testKanji=function(e){return s.test(e)},t.testNumeric=function(e){return a.test(e)},t.testAlphanumeric=function(e){return c.test(e)}},28181:(e,t,r)=>{let n=r(71932),i=r(53773),o=r(22115),s=r(85688),a=r(47873),c=r(26734),u=r(56880),l=r(45130);function d(e){return unescape(encodeURIComponent(e)).length}function f(e,t,r){let n;let i=[];for(;null!==(n=e.exec(r));)i.push({data:n[0],index:n.index,mode:t,length:n[0].length});return i}function h(e){let t,r;let i=f(c.NUMERIC,n.NUMERIC,e),o=f(c.ALPHANUMERIC,n.ALPHANUMERIC,e);return u.isKanjiModeEnabled()?(t=f(c.BYTE,n.BYTE,e),r=f(c.KANJI,n.KANJI,e)):(t=f(c.BYTE_KANJI,n.BYTE,e),r=[]),i.concat(o,t,r).sort(function(e,t){return e.index-t.index}).map(function(e){return{data:e.data,mode:e.mode,length:e.length}})}function p(e,t){switch(t){case n.NUMERIC:return i.getBitsLength(e);case n.ALPHANUMERIC:return o.getBitsLength(e);case n.KANJI:return a.getBitsLength(e);case n.BYTE:return s.getBitsLength(e)}}function y(e){return e.reduce(function(e,t){let r=e.length-1>=0?e[e.length-1]:null;return r&&r.mode===t.mode?e[e.length-1].data+=t.data:e.push(t),e},[])}function g(e){let t=[];for(let r=0;r<e.length;r++){let i=e[r];switch(i.mode){case n.NUMERIC:t.push([i,{data:i.data,mode:n.ALPHANUMERIC,length:i.length},{data:i.data,mode:n.BYTE,length:i.length}]);break;case n.ALPHANUMERIC:t.push([i,{data:i.data,mode:n.BYTE,length:i.length}]);break;case n.KANJI:t.push([i,{data:i.data,mode:n.BYTE,length:d(i.data)}]);break;case n.BYTE:t.push([{data:i.data,mode:n.BYTE,length:d(i.data)}])}}return t}function m(e,t){let r={},i={start:{}},o=["start"];for(let s=0;s<e.length;s++){let a=e[s],c=[];for(let e=0;e<a.length;e++){let u=a[e],l=""+s+e;c.push(l),r[l]={node:u,lastCount:0},i[l]={};for(let e=0;e<o.length;e++){let s=o[e];r[s]&&r[s].node.mode===u.mode?(i[s][l]=p(r[s].lastCount+u.length,u.mode)-p(r[s].lastCount,u.mode),r[s].lastCount+=u.length):(r[s]&&(r[s].lastCount=u.length),i[s][l]=p(u.length,u.mode)+4+n.getCharCountIndicator(u.mode,t))}}o=c}for(let e=0;e<o.length;e++)i[o[e]].end=0;return{map:i,table:r}}function b(e,t){let r;let c=n.getBestModeForData(e);if((r=n.from(t,c))!==n.BYTE&&r.bit<c.bit)throw Error('"'+e+'" cannot be encoded with mode '+n.toString(r)+".\n Suggested mode is: "+n.toString(c));switch(r!==n.KANJI||u.isKanjiModeEnabled()||(r=n.BYTE),r){case n.NUMERIC:return new i(e);case n.ALPHANUMERIC:return new o(e);case n.KANJI:return new a(e);case n.BYTE:return new s(e)}}t.fromArray=function(e){return e.reduce(function(e,t){return"string"==typeof t?e.push(b(t,null)):t.data&&e.push(b(t.data,t.mode)),e},[])},t.fromString=function(e,r){let n=m(g(h(e,u.isKanjiModeEnabled())),r),i=l.find_path(n.map,"start","end"),o=[];for(let e=1;e<i.length-1;e++)o.push(n.table[i[e]].node);return t.fromArray(y(o))},t.rawSplit=function(e){return t.fromArray(h(e,u.isKanjiModeEnabled()))}},56880:(e,t)=>{let r;let n=[0,26,44,70,100,134,172,196,242,292,346,404,466,532,581,655,733,815,901,991,1085,1156,1258,1364,1474,1588,1706,1828,1921,2051,2185,2323,2465,2611,2761,2876,3034,3196,3362,3532,3706];t.getSymbolSize=function(e){if(!e)throw Error('"version" cannot be null or undefined');if(e<1||e>40)throw Error('"version" should be in range from 1 to 40');return 4*e+17},t.getSymbolTotalCodewords=function(e){return n[e]},t.getBCHDigit=function(e){let t=0;for(;0!==e;)t++,e>>>=1;return t},t.setToSJISFunction=function(e){if("function"!=typeof e)throw Error('"toSJISFunc" is not a valid function.');r=e},t.isKanjiModeEnabled=function(){return void 0!==r},t.toSJIS=function(e){return r(e)}},35040:(e,t)=>{t.isValid=function(e){return!isNaN(e)&&e>=1&&e<=40}},54557:(e,t,r)=>{let n=r(56880),i=r(93684),o=r(20865),s=r(71932),a=r(35040),c=7973,u=n.getBCHDigit
37(c);function l(e,r,n){for(let i=1;i<=40;i++)if(r<=t.getCapacity(i,n,e))return i}function d(e,t){return s.getCharCountIndicator(e,t)+4}function f(e,t){let r=0;return e.forEach(function(e){let n=d(e.mode,t);r+=n+e.getBitsLength()}),r}function h(e,r){for(let n=1;n<=40;n++)if(f(e,n)<=t.getCapacity(n,r,s.MIXED))return n}t.from=function(e,t){return a.isValid(e)?parseInt(e,10):t},t.getCapacity=function(e,t,r){if(!a.isValid(e))throw Error("Invalid QR Code version");void 0===r&&(r=s.BYTE);let o=(n.getSymbolTotalCodewords(e)-i.getTotalCodewordsCount(e,t))*8;if(r===s.MIXED)return o;let c=o-d(r,e);switch(r){case s.NUMERIC:return Math.floor(c/10*3);case s.ALPHANUMERIC:return Math.floor(c/11*2);case s.KANJI:return Math.floor(c/13);case s.BYTE:default:return Math.floor(c/8)}},t.getBestVersionForData=function(e,t){let r;let n=o.from(t,o.M);if(Array.isArray(e)){if(e.length>1)return h(e,n);if(0===e.length)return 1;r=e[0]}else r=e;return l(r.mode,r.getLength(),n)},t.getEncodedBits=function(e){if(!a.isValid(e)||e<7)throw Error("Invalid QR Code version");let t=e<<12;for(;n.getBCHDigit(t)-u>=0;)t^=c<<n.getBCHDigit(t)-u;return e<<12|t}},16383:(e,t,r)=>{let n=r(62172);function i(e,t,r){e.clearRect(0,0,t.width,t.height),t.style||(t.style={}),t.height=r,t.width=r,t.style.height=r+"px",t.style.width=r+"px"}function o(){try{return document.createElement("canvas")}catch(e){throw Error("You need to specify a canvas element")}}t.render=function(e,t,r){let s=r,a=t;void 0!==s||t&&t.getContext||(s=t,t=void 0),t||(a=o()),s=n.getOptions(s);let c=n.getImageWidth(e.modules.size,s),u=a.getContext("2d"),l=u.createImageData(c,c);return n.qrToImageData(l.data,e,s),i(u,a,c),u.putImageData(l,0,0),a},t.renderToDataURL=function(e,r,n){let i=n;void 0!==i||r&&r.getContext||(i=r,r=void 0),i||(i={});let o=t.render(e,r,i),s=i.type||"image/png",a=i.rendererOpts||{};return o.toDataURL(s,a.quality)}},40934:(e,t,r)=>{let n=r(62172);function i(e,t){let r=e.a/255,n=t+'="'+e.hex+'"';return r<1?n+" "+t+'-opacity="'+r.toFixed(2).slice(1)+'"':n}function o(e,t,r){let n=e+t;return void 0!==r&&(n+=" "+r),n}function s(e,t,r){let n="",i=0,s=!1,a=0;for(let c=0;c<e.length;c++){let u=Math.floor(c%t),l=Math.floor(c/t);u||s||(s=!0),e[c]?(a++,c>0&&u>0&&e[c-1]||(n+=s?o("M",u+r,.5+l+r):o("m",i,0),i=0,s=!1),u+1<t&&e[c+1]||(n+=o("h",a),a=0)):i++}return n}t.render=function(e,t,r){let o=n.getOptions(t),a=e.modules.size,c=e.modules.data,u=a+2*o.margin,l=o.color.light.a?"<path "+i(o.color.light,"fill")+' d="M0 0h'+u+"v"+u+'H0z"/>':"",d="<path "+i(o.color.dark,"stroke")+' d="'+s(c,a,o.margin)+'"/>',f='viewBox="0 0 '+u+" "+u+'"',h='<svg xmlns="http://www.w3.org/2000/svg" '+(o.width?'width="'+o.width+'" height="'+o.width+'" ':"")+f+' shape-rendering="crispEdges">'+l+d+"</svg>\n";return"function"==typeof r&&r(null,h),h}},62172:(e,t)=>{function r(e){if("number"==typeof e&&(e=e.toString()),"string"!=typeof e)throw Error("Color should be defined as hex string");let t=e.slice().replace("#","").split("");if(t.length<3||5===t.length||t.length>8)throw Error("Invalid hex color: "+e);(3===t.length||4===t.length)&&(t=Array.prototype.concat.apply([],t.map(function(e){return[e,e]}))),6===t.length&&t.push("F","F");let r=parseInt(t.join(""),16);return{r:r>>24&255,g:r>>16&255,b:r>>8&255,a:255&r,hex:"#"+t.slice(0,6).join("")}}t.getOptions=function(e){e||(e={}),e.color||(e.color={});let t=void 0===e.margin||null===e.margin||e.margin<0?4:e.margin,n=e.width&&e.width>=21?e.width:void 0,i=e.scale||4;return{width:n,scale:n?4:i,margin:t,color:{dark:r(e.color.dark||"#000000ff"),light:r(e.color.light||"#ffffffff")},type:e.type,rendererOpts:e.rendererOpts||{}}},t.getScale=function(e,t){return t.width&&t.width>=e+2*t.margin?t.width/(e+2*t.margin):t.scale},t.getImageWidth=function(e,r){let n=t.getScale(e,r);return Math.floor((e+2*r.margin)*n)},t.qrToImageData=function(e,r,n){let i=r.modules.size,o=r.modules.data,s=t.getScale(i,n),a=Math.floor((i+2*n.margin)*s),c=n.margin*s,u=[n.color.light,n.color.dark];for(let t=0;t<a;t++)for(let r=0;r<a;r++){let l=(t*a+r)*4,d=n.color.light;t>=c&&r>=c&&t<a-c&&r<a-c&&(d=u[o[Math.floor((t-c)/s)*i+Math.floor((r-c)/s)]?1:0]),e[l++]=d.r,e[l++
37]=d.g,e[l++]=d.b,e[l]=d.a}}},65155:(e,t,r)=>{"use strict";let n=r(72434),i=r(11466),o=r(93200),s=r(98287),a=e=>null==e,c=Symbol("encodeFragmentIdentifier");function u(e){switch(e.arrayFormat){case"index":return t=>(r,n)=>{let i=r.length;return void 0===n||e.skipNull&&null===n||e.skipEmptyString&&""===n?r:null===n?[...r,[f(t,e),"[",i,"]"].join("")]:[...r,[f(t,e),"[",f(i,e),"]=",f(n,e)].join("")]};case"bracket":return t=>(r,n)=>void 0===n||e.skipNull&&null===n||e.skipEmptyString&&""===n?r:null===n?[...r,[f(t,e),"[]"].join("")]:[...r,[f(t,e),"[]=",f(n,e)].join("")];case"colon-list-separator":return t=>(r,n)=>void 0===n||e.skipNull&&null===n||e.skipEmptyString&&""===n?r:null===n?[...r,[f(t,e),":list="].join("")]:[...r,[f(t,e),":list=",f(n,e)].join("")];case"comma":case"separator":case"bracket-separator":{let t="bracket-separator"===e.arrayFormat?"[]=":"=";return r=>(n,i)=>void 0===i||e.skipNull&&null===i||e.skipEmptyString&&""===i?n:(i=null===i?"":i,0===n.length)?[[f(r,e),t,f(i,e)].join("")]:[[n,f(i,e)].join(e.arrayFormatSeparator)]}default:return t=>(r,n)=>void 0===n||e.skipNull&&null===n||e.skipEmptyString&&""===n?r:null===n?[...r,f(t,e)]:[...r,[f(t,e),"=",f(n,e)].join("")]}}function l(e){let t;switch(e.arrayFormat){case"index":return(e,r,n)=>{if(t=/\[(\d*)\]$/.exec(e),e=e.replace(/\[\d*\]$/,""),!t){n[e]=r;return}void 0===n[e]&&(n[e]={}),n[e][t[1]]=r};case"bracket":return(e,r,n)=>{if(t=/(\[\])$/.exec(e),e=e.replace(/\[\]$/,""),!t){n[e]=r;return}if(void 0===n[e]){n[e]=[r];return}n[e]=[].concat(n[e],r)};case"colon-list-separator":return(e,r,n)=>{if(t=/(:list)$/.exec(e),e=e.replace(/:list$/,""),!t){n[e]=r;return}if(void 0===n[e]){n[e]=[r];return}n[e]=[].concat(n[e],r)};case"comma":case"separator":return(t,r,n)=>{let i="string"==typeof r&&r.includes(e.arrayFormatSeparator),o="string"==typeof r&&!i&&h(r,e).includes(e.arrayFormatSeparator);r=o?h(r,e):r;let s=i||o?r.split(e.arrayFormatSeparator).map(t=>h(t,e)):null===r?r:h(r,e);n[t]=s};case"bracket-separator":return(t,r,n)=>{let i=/(\[\])$/.test(t);if(t=t.replace(/\[\]$/,""),!i){n[t]=r?h(r,e):r;return}let o=null===r?[]:r.split(e.arrayFormatSeparator).map(t=>h(t,e));if(void 0===n[t]){n[t]=o;return}n[t]=[].concat(n[t],o)};default:return(e,t,r)=>{if(void 0===r[e]){r[e]=t;return}r[e]=[].concat(r[e],t)}}}function d(e){if("string"!=typeof e||1!==e.length)throw TypeError("arrayFormatSeparator must be single character string")}function f(e,t){return t.encode?t.strict?n(e):encodeURIComponent(e):e}function h(e,t){return t.decode?i(e):e}function p(e){return Array.isArray(e)?e.sort():"object"==typeof e?p(Object.keys(e)).sort((e,t)=>Number(e)-Number(t)).map(t=>e[t]):e}function y(e){let t=e.indexOf("#");return -1!==t&&(e=e.slice(0,t)),e}function g(e){let t="",r=e.indexOf("#");return -1!==r&&(t=e.slice(r)),t}function m(e){let t=(e=y(e)).indexOf("?");return -1===t?"":e.slice(t+1)}function b(e,t){return t.parseNumbers&&!Number.isNaN(Number(e))&&"string"==typeof e&&""!==e.trim()?e=Number(e):t.parseBooleans&&null!==e&&("true"===e.toLowerCase()||"false"===e.toLowerCase())&&(e="true"===e.toLowerCase()),e}function v(e,t){d((t=Object.assign({decode:!0,sort:!0,arrayFormat:"none",arrayFormatSeparator:",",parseNumbers:!1,parseBooleans:!1},t)).arrayFormatSeparator);let r=l(t),n=Object.create(null);if("string"!=typeof e||!(e=e.trim().replace(/^[?#&]/,"")))return n;for(let i of e.split("&")){if(""===i)continue;let[e,s]=o(t.decode?i.replace(/\+/g," "):i,"=");s=void 0===s?null:["comma","separator","bracket-separator"].includes(t.arrayFormat)?s:h(s,t),r(h(e,t),s,n)}for(let e of Object.keys(n)){let r=n[e];if("object"==typeof r&&null!==r)for(let e of Object.keys(r))r[e]=b(r[e],t);else n[e]=b(r,t)}return!1===t.sort?n:(!0===t.sort?Object.keys(n).sort():Object.keys(n).sort(t.sort)).reduce((e,t)=>{let r=n[t];return r&&"object"==typeof r&&!Array.isArray(r)?e[t]=p(r):e[t]=r,e},Object.create(null))}t.extract=m,t.parse=v,t.stringify=(e,t)=>{if(!e)return"";d((t=Object.assign({encode:!0,strict:!0,arrayFormat:"none",arrayFormatSeparator:","},t)).arrayFormatSeparator);let r=r=>t.skipNull&&a(e[r])||t.skipEmptyString&&""===e[r],n=u(t),i={};for(let t of Object.keys(e))r(t)||(i[t]=e[t]);let o=Object.keys(i);return!1!==t.sort&&o.sort(t.sort),o.map(r=>{let i=e[r];return void 0===i?"":null===i?f(r,t):Array.isArray(i)?0===i.length&&"bracket-separator"===t.arrayFormat?f(r,t)+"[]":i.reduce(n(r),[]).join("&"):f(r,t)+"="+f(i,t)}).filter(e=>e.length>0).join("&")},t.parseUrl=(e,t)=>
37{t=Object.assign({decode:!0},t);let[r,n]=o(e,"#");return Object.assign({url:r.split("?")[0]||"",query:v(m(e),t)},t&&t.parseFragmentIdentifier&&n?{fragmentIdentifier:h(n,t)}:{})},t.stringifyUrl=(e,r)=>{r=Object.assign({encode:!0,strict:!0,[c]:!0},r);let n=y(e.url).split("?")[0]||"",i=t.extract(e.url),o=Object.assign(t.parse(i,{sort:!1}),e.query),s=t.stringify(o,r);s&&(s=`?${s}`);let a=g(e.url);return e.fragmentIdentifier&&(a=`#${r[c]?f(e.fragmentIdentifier,r):e.fragmentIdentifier}`),`${n}${s}${a}`},t.pick=(e,r,n)=>{n=Object.assign({parseFragmentIdentifier:!0,[c]:!1},n);let{url:i,query:o,fragmentIdentifier:a}=t.parseUrl(e,n);return t.stringifyUrl({url:i,query:s(o,r),fragmentIdentifier:a},n)},t.exclude=(e,r,n)=>{let i=Array.isArray(r)?e=>!r.includes(e):(e,t)=>!r(e,t);return t.pick(e,i,n)}},56617:e=>{"use strict";function t(e){try{return JSON.stringify(e)}catch(e){return'"[Circular]"'}}function r(e,r,n){var i=n&&n.stringify||t,o=1;if("object"==typeof e&&null!==e){var s=r.length+o;if(1===s)return e;var a=Array(s);a[0]=i(e);for(var c=1;c<s;c++)a[c]=i(r[c]);return a.join(" ")}if("string"!=typeof e)return e;var u=r.length;if(0===u)return e;for(var l="",d=1-o,f=-1,h=e&&e.length||0,p=0;p<h;){if(37===e.charCodeAt(p)&&p+1<h){switch(f=f>-1?f:0,e.charCodeAt(p+1)){case 100:case 102:if(d>=u||null==r[d])break;f<p&&(l+=e.slice(f,p)),l+=Number(r[d]),f=p+2,p++;break;case 105:if(d>=u||null==r[d])break;f<p&&(l+=e.slice(f,p)),l+=Math.floor(Number(r[d])),f=p+2,p++;break;case 79:case 111:case 106:if(d>=u||void 0===r[d])break;f<p&&(l+=e.slice(f,p));var y=typeof r[d];if("string"===y){l+="'"+r[d]+"'",f=p+2,p++;break}if("function"===y){l+=r[d].name||"<anonymous>",f=p+2,p++;break}l+=i(r[d]),f=p+2,p++;break;case 115:if(d>=u)break;f<p&&(l+=e.slice(f,p)),l+=String(r[d]),f=p+2,p++;break;case 37:f<p&&(l+=e.slice(f,p)),l+="%",f=p+2,p++,d--}++d}++p}return -1===f?e:(f<h&&(l+=e.slice(f)),l)}e.exports=r},52815:(e,t,r)=>{"use strict";var n=r(2818),i=65536,o=0xffffffff;function s(){throw Error("Secure random number generation is not supported by this browser.\nUse Chrome, Firefox or Internet Explorer 11")}var a=r(62903).Buffer,c=r.g.crypto||r.g.msCrypto;function u(e,t){if(e>o)throw RangeError("requested too many random bytes");var r=a.allocUnsafe(e);if(e>0){if(e>i)for(var s=0;s<e;s+=i)c.getRandomValues(r.slice(s,s+i));else c.getRandomValues(r)}return"function"==typeof t?n.nextTick(function(){t(null,r)}):r}c&&c.getRandomValues?e.exports=u:e.exports=s},43804:(e,t,r)=>{"use strict";r.d(t,{t:()=>i});var n=r(6476),i=function(e){function t(t){var r=e.call(this)||this;return r._value=t,r}return(0,n.C6)(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}(r(47525).B)},47525:(e,t,r)=>{"use strict";r.d(t,{B:()=>b});var n=r(6476),i=r(64019),o=r(45160),s=function(){return"function"==typeof Symbol&&Symbol.observable||"@@observable"}();function a(e){return e}function c(e){return 0===e.length?a:1===e.length?e[0]:function(t){return e.reduce(function(e,t){return t(e)},t)}}var u=r(36564),l=r(80195),d=r(65110),f=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=this,o=y(e)?e:new i.Ms(e,t,r);return(0,d.Y)(function(){var e=n,t=e.operator,r=e.source;o.add(t?t.call(o,r):r?n._subscribe(o):n._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=h(t))(function(t,n){var o=new i.Ms({next:function(t){try{e(t)}catch(e){n(e),o.unsubscribe()}},error:n,complete:t});r.subscribe(o)})},e.prototype._subscribe=function(e){var t;return null===(t=this.source)||void 0===t?void 0:t.subscribe(e)},e.prototype[s]=function(){return this},e.prototype.pipe=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return c(e)(this)},e.prototype.toPromise=function(e){var t=this;return new(e=h(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 h(e){var t;return null!==(t=null!=e?e:u.$.Promise)&&void 0!==t?t:Promise}function p(e){return e&&(0,l.T)(e.next)&&(0,l.T)(e.error)&&(0,l.T)(e.complete)}function y(e){return e&&e instanceof i.vU||p(e)&&(0,o.Uv)(e)}var g=(0,r(12985).L)(function(e){return function(){e(this),this.name="ObjectUnsubscribedError",this.message="object unsubscribed"}}),m=r(62238),b=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(0,n.C6)(t,e),t.prototype.lift=function(e){var t=new v(this,this);return t.operator=e,t},t.prototype._throwIfClosed=function(){if(this.closed)throw new g},t.prototype.next=function(e){var t=this;(0,d.Y)(function(){var r,i;if(t._throwIfClosed(),!t.isStopped){t.currentObservers||(t.currentObservers=Array.from(t.observers));try{for(var o=(0,n.Ju)(t.currentObservers),s=o.next();!s.done;s=o.next())s.value.next(e)}catch(e){r={error:e}}finally{try{s&&!s.done&&(i=o.return)&&i.call(o)}finally{if(r)throw r.error}}}})},t.prototype.error=function(e){var t=this;(0,d.Y)(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;(0,d.Y)(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}
37,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,s=r.observers;return n||i?o.Kn:(this.currentObservers=null,s.push(e),new o.yU(function(){t.currentObservers=null,(0,m.o)(s,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 f;return e.source=this,e},t.create=function(e,t){return new v(e,t)},t}(f),v=function(e){function t(t,r){var n=e.call(this)||this;return n.destination=t,n.source=r,n}return(0,n.C6)(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:o.Kn},t}(b)},64019:(e,t,r)=>{"use strict";r.d(t,{Ms:()=>v,vU:()=>y});var n=r(6476),i=r(80195),o=r(45160),s=r(36564),a={setTimeout:function(e,t){for(var r=[],i=2;i<arguments.length;i++)r[i-2]=arguments[i];var o=a.delegate;return(null==o?void 0:o.setTimeout)?o.setTimeout.apply(o,(0,n.fX)([e,t],(0,n.zs)(r))):setTimeout.apply(void 0,(0,n.fX)([e,t],(0,n.zs)(r)))},clearTimeout:function(e){var t=a.delegate;return((null==t?void 0:t.clearTimeout)||clearTimeout)(e)},delegate:void 0};function c(e){a.setTimeout(function(){var t=s.$.onUnhandledError;if(t)t(e);else throw e})}function u(){}var l=function(){return h("C",void 0,void 0)}();function d(e){return h("E",void 0,e)}function f(e){return h("N",e,void 0)}function h(e,t,r){return{kind:e,value:t,error:r}}var p=r(65110),y=function(e){function t(t){var r=e.call(this)||this;return r.isStopped=!1,t?(r.destination=t,(0,o.Uv)(t)&&t.add(r)):r.destination=E,r}return(0,n.C6)(t,e),t.create=function(e,t,r){return new v(e,t,r)},t.prototype.next=function(e){this.isStopped?_(f(e),this):this._next(e)},t.prototype.error=function(e){this.isStopped?_(d(e),this):(this.isStopped=!0,this._error(e))},t.prototype.complete=function(){this.isStopped?_(l,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}(o.yU),g=Function.prototype.bind;function m(e,t){return g.call(e,t)}var b=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(e){w(e)}},e.prototype.error=function(e){var t=this.partialObserver;if(t.error)try{t.error(e)}catch(e){w(e)}else w(e)},e.prototype.complete=function(){var e=this.partialObserver;if(e.complete)try{e.complete()}catch(e){w(e)}},e}(),v=function(e){function t(t,r,n){var o,a,c=e.call(this)||this;return(0,i.T)(t)||!t?o={next:null!=t?t:void 0,error:null!=r?r:void 0,complete:null!=n?n:void 0}:c&&s.$.useDeprecatedNextContext?((a=Object.create(t)).unsubscribe=function(){return c.unsubscribe()},o={next:t.next&&m(t.next,a),error:t.error&&m(t.error,a),complete:t.complete&&m(t.complete,a)}):o=t,c.destination=new b(o),c}return(0,n.C6)(t,e),t}(y);function w(e){s.$.useDeprecatedSynchronousErrorHandling?(0,p.l)(e):c(e)}function _(e,t){var r=s.$.onStoppedNotification;r&&a.setTimeout(function(){return r(e,t)})}var E={closed:!0,next:u,error:function(e){throw e},complete:u}},45160:(e,t,r)=>{"use strict";r.d(t,{Kn:()=>c,yU:()=>a,Uv:()=>u});var n=r(6476),i=r(80195),o=(0,r(12985).L)(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}}),s=r(62238),a=function(){function e(e){this.initialTeardown=e,this.closed=!1,this._parentage=null,this._finalizers=null}return e.prototype.unsubscribe=function(){if(!this.closed){this.closed=!0;var e,t,r,s,a,c=this._parentage;if(c){if(this._parentage=null,Array.isArray(c))try{for(var u=(0,n.Ju)(c),d=u.next();!d.done;d=u.next())d.value.remove(this)}catch(t){e={error:t}}finally{try{d&&!d.done&&(t=u.return)&&t.call(u)}finally{if(e)throw e.error}}else c.remove(this)}var f=this.initialTeardown;
37if((0,i.T)(f))try{f()}catch(e){a=e instanceof o?e.errors:[e]}var h=this._finalizers;if(h){this._finalizers=null;try{for(var p=(0,n.Ju)(h),y=p.next();!y.done;y=p.next()){var g=y.value;try{l(g)}catch(e){a=null!=a?a:[],e instanceof o?a=(0,n.fX)((0,n.fX)([],(0,n.zs)(a)),(0,n.zs)(e.errors)):a.push(e)}}}catch(e){r={error:e}}finally{try{y&&!y.done&&(s=p.return)&&s.call(p)}finally{if(r)throw r.error}}}if(a)throw new o(a)}},e.prototype.add=function(t){var r;if(t&&t!==this){if(this.closed)l(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)&&(0,s.o)(t,e)},e.prototype.remove=function(t){var r=this._finalizers;r&&(0,s.o)(r,t),t instanceof e&&t._removeParent(this)},e.EMPTY=function(){var t=new e;return t.closed=!0,t}(),e}(),c=a.EMPTY;function u(e){return e instanceof a||e&&"closed"in e&&(0,i.T)(e.remove)&&(0,i.T)(e.add)&&(0,i.T)(e.unsubscribe)}function l(e){(0,i.T)(e)?e():e.unsubscribe()}},36564:(e,t,r)=>{"use strict";r.d(t,{$:()=>n});var n={onUnhandledError:null,onStoppedNotification:null,Promise:void 0,useDeprecatedSynchronousErrorHandling:!1,useDeprecatedNextContext:!1}},48635:(e,t,r)=>{"use strict";r.d(t,{S:()=>l});var n=r(80195);function i(e){return(0,n.T)(null==e?void 0:e.lift)}function o(e){return function(t){if(i(t))return t.lift(function(t){try{return e(t,this)}catch(e){this.error(e)}});throw TypeError("Unable to lift unknown Observable type")}}var s=r(6476);function a(e,t,r,n,i){return new c(e,t,r,n,i)}var c=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(e){t.error(e)}}: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(0,s.C6)(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}(r(64019).vU);function u(e,t,r,n,i){return function(o,s){var c=r,u=t,l=0;o.subscribe(a(s,function(t){var r=l++;u=c?e(u,t,r):(c=!0,t),n&&s.next(u)},i&&function(){c&&s.next(u),s.complete()}))}}function l(e,t){return o(u(e,t,arguments.length>=2,!0))}},62238:(e,t,r)=>{"use strict";function n(e,t){if(e){var r=e.indexOf(t);0<=r&&e.splice(r,1)}}r.d(t,{o:()=>n})},12985:(e,t,r)=>{"use strict";function n(e){var t=e(function(e){Error.call(e),e.stack=Error().stack});return t.prototype=Object.create(Error.prototype),t.prototype.constructor=t,t}r.d(t,{L:()=>n})},65110:(e,t,r)=>{"use strict";r.d(t,{Y:()=>o,l:()=>s});var n=r(36564),i=null;function o(e){if(n.$.useDeprecatedSynchronousErrorHandling){var t=!i;if(t&&(i={errorThrown:!1,error:null}),e(),t){var r=i,o=r.errorThrown,s=r.error;if(i=null,o)throw s}}else e()}function s(e){n.$.useDeprecatedSynchronousErrorHandling&&i&&(i.errorThrown=!0,i.error=e)}},80195:(e,t,r)=>{"use strict";function n(e){return"function"==typeof e}r.d(t,{T:()=>n})},62903:(e,t,r)=>{var n=r(75927),i=n.Buffer;function o(e,t){for(var r in e)t[r]=e[r]}function s(e,t,r){return i(e,t,r)}i.from&&i.alloc&&i.allocUnsafe&&i.allocUnsafeSlow?e.exports=n:(o(n,t),t.Buffer=s),s.prototype=Object.create(i.prototype),o(i,s),s.from=function(e,t,r){if("number"==typeof e)throw TypeError("Argument must not be a number");return i(e,t,r)},s.alloc=function(e,t,r){if("number"!=typeof e)throw TypeError("Argument must be a number");var n=i(e);return void 0!==t?"string"==typeof r?n.fill(t,r):n.fill(t):n.fill(0),n},s.allocUnsafe=function(e){if("number"!=typeof e)throw TypeError("Argument must be a number");return i(e)},s.allocUnsafeSlow=function(e){if("number"!=typeof e)throw TypeError("Argument must be a number");return n.SlowBuffer(e)}},22265:(e,t,r)=>{e.exports=r(69109)(r(95493))},95493:(e,t,r)=>{let n=new(r(71423)).ec("secp256k1"),i=n.curve,o=i.n.constructor;function s(e,t){let r=new o(t);if(r.cmp(i.p)>=0)return null;let s=(r=r.toRed(i.red)).redSqr().redIMul(r).redIAdd(i.b).redSqrt();3===e!==s.isOdd()&&(s=s.redNeg());let a=r.redSqr().redIMul(r);return s.redSqr().redISub(a.redIAdd(i.b)).isZero()?n.keyPair({pub:{x:r,y:s}}):null}function a(e,t,r){let s=new o(t),a=new o(r);if(s.cmp(i.p)>=0||a.cmp(i.p)>=0||(s=s.toRed(i.red),a=a.toRed(i.red),(6===e||7===e)&&a.isOdd()!==(7===e)))return null;
37let c=s.redSqr().redIMul(s);return a.redSqr().redISub(c.redIAdd(i.b)).isZero()?n.keyPair({pub:{x:s,y:a}}):null}function c(e){let t=e[0];switch(t){case 2:case 3:if(33!==e.length)return null;return s(t,e.subarray(1,33));case 4:case 6:case 7:if(65!==e.length)return null;return a(t,e.subarray(1,33),e.subarray(33,65));default:return null}}function u(e,t){let r=t.encode(null,33===e.length);for(let t=0;t<e.length;++t)e[t]=r[t]}e.exports={contextRandomize:()=>0,privateKeyVerify(e){let t=new o(e);return 0>t.cmp(i.n)&&!t.isZero()?0:1},privateKeyNegate(e){let t=new o(e),r=i.n.sub(t).umod(i.n).toArrayLike(Uint8Array,"be",32);return e.set(r),0},privateKeyTweakAdd(e,t){let r=new o(t);if(r.cmp(i.n)>=0||(r.iadd(new o(e)),r.cmp(i.n)>=0&&r.isub(i.n),r.isZero()))return 1;let n=r.toArrayLike(Uint8Array,"be",32);return e.set(n),0},privateKeyTweakMul(e,t){let r=new o(t);if(r.cmp(i.n)>=0||r.isZero())return 1;r.imul(new o(e)),r.cmp(i.n)>=0&&(r=r.umod(i.n));let n=r.toArrayLike(Uint8Array,"be",32);return e.set(n),0},publicKeyVerify:e=>null===c(e)?1:0,publicKeyCreate(e,t){let r=new o(t);return r.cmp(i.n)>=0||r.isZero()?1:(u(e,n.keyFromPrivate(t).getPublic()),0)},publicKeyConvert(e,t){let r=c(t);return null===r?1:(u(e,r.getPublic()),0)},publicKeyNegate(e,t){let r=c(t);if(null===r)return 1;let n=r.getPublic();return n.y=n.y.redNeg(),u(e,n),0},publicKeyCombine(e,t){let r=Array(t.length);for(let e=0;e<t.length;++e)if(r[e]=c(t[e]),null===r[e])return 1;let n=r[0].getPublic();for(let e=1;e<r.length;++e)n=n.add(r[e].pub);return n.isInfinity()?2:(u(e,n),0)},publicKeyTweakAdd(e,t,r){let n=c(t);if(null===n)return 1;if((r=new o(r)).cmp(i.n)>=0)return 2;let s=n.getPublic().add(i.g.mul(r));return s.isInfinity()?2:(u(e,s),0)},publicKeyTweakMul(e,t,r){let n=c(t);return null===n?1:(r=new o(r)).cmp(i.n)>=0||r.isZero()?2:(u(e,n.getPublic().mul(r)),0)},signatureNormalize(e){let t=new o(e.subarray(0,32)),r=new o(e.subarray(32,64));return t.cmp(i.n)>=0||r.cmp(i.n)>=0?1:(1===r.cmp(n.nh)&&e.set(i.n.sub(r).toArrayLike(Uint8Array,"be",32),32),0)},signatureExport(e,t){let r=t.subarray(0,32),n=t.subarray(32,64);if(new o(r).cmp(i.n)>=0||new o(n).cmp(i.n)>=0)return 1;let{output:s}=e,a=s.subarray(4,37);a[0]=0,a.set(r,1);let c=33,u=0;for(;c>1&&0===a[u]&&!(128&a[u+1]);--c,++u);if(128&(a=a.subarray(u))[0]||c>1&&0===a[0]&&!(128&a[1]))return 1;let l=s.subarray(39,72);l[0]=0,l.set(n,1);let d=33,f=0;for(;d>1&&0===l[f]&&!(128&l[f+1]);--d,++f);return 128&(l=l.subarray(f))[0]||d>1&&0===l[0]&&!(128&l[1])?1:(e.outputlen=6+c+d,s[0]=48,s[1]=e.outputlen-2,s[2]=2,s[3]=a.length,s.set(a,4),s[4+c]=2,s[5+c]=l.length,s.set(l,6+c),0)},signatureImport(e,t){if(t.length<8||t.length>72||48!==t[0]||t[1]!==t.length-2||2!==t[2])return 1;let r=t[3];if(0===r||5+r>=t.length||2!==t[4+r])return 1;let n=t[5+r];if(0===n||6+r+n!==t.length||128&t[4]||r>1&&0===t[4]&&!(128&t[5])||128&t[r+6]||n>1&&0===t[r+6]&&!(128&t[r+7]))return 1;let s=t.subarray(4,4+r);if(33===s.length&&0===s[0]&&(s=s.subarray(1)),s.length>32)return 1;let a=t.subarray(6+r);if(33===a.length&&0===a[0]&&(a=a.slice(1)),a.length>32)throw Error("S length is too long");let c=new o(s);c.cmp(i.n)>=0&&(c=new o(0));let u=new o(t.subarray(6+r));return u.cmp(i.n)>=0&&(u=new o(0)),e.set(c.toArrayLike(Uint8Array,"be",32),0),e.set(u.toArrayLike(Uint8Array,"be",32),32),0},ecdsaSign(e,t,r,s,a){let c;if(a){let e=a;a=n=>{let i=e(t,r,null,s,n);if(!(i instanceof Uint8Array&&32===i.length))throw Error("This is the way");return new o(i)}}let u=new o(r);if(u.cmp(i.n)>=0||u.isZero())return 1;try{c=n.sign(t,r,{canonical:!0,k:a,pers:s})}catch(e){return 1}return e.signature.set(c.r.toArrayLike(Uint8Array,"be",32),0),e.signature.set(c.s.toArrayLike(Uint8Array,"be",32),32),e.recid=c.recoveryParam,0},ecdsaVerify(e,t,r){let s={r:e.subarray(0,32),s:e.subarray(32,64)},a=new o(s.r),u=new o(s.s);if(a.cmp(i.n)>=0||u.cmp(i.n)>=0)return 1;if(1===u.cmp(n.nh)||a.isZero()||u.isZero())return 3;let l=c(r);if(null===l)return 2;let d=l.getPublic();return n.verify(t,s,d)?0:3},ecdsaRecover(e,t,r,s){let a;let c={r:t.slice(0,32),s:t.slice(32,64)},l=new o(c.r),d=new o(c.s);if(l.cmp(i.n)>=0||d.cmp(i.n)>=0)return 1;if(l.isZero()||d.isZero())return 2;try{a=n.recoverPubKey(s,c,r)}catch(e){return 2}return u(e,a),0},ecdh(e,t,r,s,a,u,l){let d=c(t);if(null===d)return 1;let f=new o(r);if(f.cmp(i.n)>=0||f.isZero())return 2;let h=d.getPublic().mul(f);if(void 0===a){let t=h.encode(null,!0),r=n.hash().update(t).digest();for(let t=0;t<32;++t)e[t]=r[t]}else{u||(u=new Uint8Array(32));let t=h.getX().toArray("be",32);for(let e=0;e<32;++e)u[e]=t[e];l||(l=new Uint8Array(32));let r=h.getY().toArray("be",32);for(let e=0;e<32;++e)l[e]=r[e];let n=a(u,l,s);if(!(n instanceof Uint8Array&&n.length===e.length))return 2;e.set(n)}return 0}}},69109:e=>{let t={IMPOSSIBLE_CASE:"Impossible case. Please create issue.",TWEAK_ADD:"The tweak was out of range or the resulted private key is invali
37d",TWEAK_MUL:"The tweak was out of range or equal to zero",CONTEXT_RANDOMIZE_UNKNOW:"Unknow error on context randomization",SECKEY_INVALID:"Private Key is invalid",PUBKEY_PARSE:"Public Key could not be parsed",PUBKEY_SERIALIZE:"Public Key serialization error",PUBKEY_COMBINE:"The sum of the public keys is not valid",SIG_PARSE:"Signature could not be parsed",SIGN:"The nonce generation function failed, or the private key was invalid",RECOVER:"Public key could not be recover",ECDH:"Scalar was invalid (zero or overflow)"};function r(e,t){if(!e)throw Error(t)}function n(e,t,n){if(r(t instanceof Uint8Array,`Expected ${e} to be an Uint8Array`),void 0!==n){if(Array.isArray(n)){let i=n.join(", "),o=`Expected ${e} to be an Uint8Array with length [${i}]`;r(n.includes(t.length),o)}else{let i=`Expected ${e} to be an Uint8Array with length ${n}`;r(t.length===n,i)}}}function i(e){r("Boolean"===s(e),"Expected compressed to be a Boolean")}function o(e=e=>new Uint8Array(e),t){return"function"==typeof e&&(e=e(t)),n("output",e,t),e}function s(e){return Object.prototype.toString.call(e).slice(8,-1)}e.exports=e=>({contextRandomize(i){if(r(null===i||i instanceof Uint8Array,"Expected seed to be an Uint8Array or null"),null!==i&&n("seed",i,32),1===e.contextRandomize(i))throw Error(t.CONTEXT_RANDOMIZE_UNKNOW)},privateKeyVerify:t=>(n("private key",t,32),0===e.privateKeyVerify(t)),privateKeyNegate(r){switch(n("private key",r,32),e.privateKeyNegate(r)){case 0:return r;case 1:throw Error(t.IMPOSSIBLE_CASE)}},privateKeyTweakAdd(r,i){switch(n("private key",r,32),n("tweak",i,32),e.privateKeyTweakAdd(r,i)){case 0:return r;case 1:throw Error(t.TWEAK_ADD)}},privateKeyTweakMul(r,i){switch(n("private key",r,32),n("tweak",i,32),e.privateKeyTweakMul(r,i)){case 0:return r;case 1:throw Error(t.TWEAK_MUL)}},publicKeyVerify:t=>(n("public key",t,[33,65]),0===e.publicKeyVerify(t)),publicKeyCreate(r,s=!0,a){switch(n("private key",r,32),i(s),a=o(a,s?33:65),e.publicKeyCreate(a,r)){case 0:return a;case 1:throw Error(t.SECKEY_INVALID);case 2:throw Error(t.PUBKEY_SERIALIZE)}},publicKeyConvert(r,s=!0,a){switch(n("public key",r,[33,65]),i(s),a=o(a,s?33:65),e.publicKeyConvert(a,r)){case 0:return a;case 1:throw Error(t.PUBKEY_PARSE);case 2:throw Error(t.PUBKEY_SERIALIZE)}},publicKeyNegate(r,s=!0,a){switch(n("public key",r,[33,65]),i(s),a=o(a,s?33:65),e.publicKeyNegate(a,r)){case 0:return a;case 1:throw Error(t.PUBKEY_PARSE);case 2:throw Error(t.IMPOSSIBLE_CASE);case 3:throw Error(t.PUBKEY_SERIALIZE)}},publicKeyCombine(s,a=!0,c){for(let e of(r(Array.isArray(s),"Expected public keys to be an Array"),r(s.length>0,"Expected public keys array will have more than zero items"),s))n("public key",e,[33,65]);switch(i(a),c=o(c,a?33:65),e.publicKeyCombine(c,s)){case 0:return c;case 1:throw Error(t.PUBKEY_PARSE);case 2:throw Error(t.PUBKEY_COMBINE);case 3:throw Error(t.PUBKEY_SERIALIZE)}},publicKeyTweakAdd(r,s,a=!0,c){switch(n("public key",r,[33,65]),n("tweak",s,32),i(a),c=o(c,a?33:65),e.publicKeyTweakAdd(c,r,s)){case 0:return c;case 1:throw Error(t.PUBKEY_PARSE);case 2:throw Error(t.TWEAK_ADD)}},publicKeyTweakMul(r,s,a=!0,c){switch(n("public key",r,[33,65]),n("tweak",s,32),i(a),c=o(c,a?33:65),e.publicKeyTweakMul(c,r,s)){case 0:return c;case 1:throw Error(t.PUBKEY_PARSE);case 2:throw Error(t.TWEAK_MUL)}},signatureNormalize(r){switch(n("signature",r,64),e.signatureNormalize(r)){case 0:return r;case 1:throw Error(t.SIG_PARSE)}},signatureExport(r,i){n("signature",r,64);let s={output:i=o(i,72),outputlen:72};switch(e.signatureExport(s,r)){case 0:return i.slice(0,s.outputlen);case 1:throw Error(t.SIG_PARSE);case 2:throw Error(t.IMPOSSIBLE_CASE)}},signatureImport(r,i){switch(n("signature",r),i=o(i,64),e.signatureImport(i,r)){case 0:return i;case 1:throw Error(t.SIG_PARSE);case 2:throw Error(t.IMPOSSIBLE_CASE)}},ecdsaSign(i,a,c={},u){n("message",i,32),n("private key",a,32),r("Object"===s(c),"Expected options to be an Object"),void 0!==c.data&&n("options.data",c.data),void 0!==c.noncefn&&r("Function"===s(c.noncefn),"Expected options.noncefn to be a Function");let l={signature:u=o(u,64),recid:null};switch(e.ecdsaSign(l,i,a,c.data,c.noncefn)){case 0:return l;case 1:throw Error(t.SIGN);case 2:throw Error(t.IMPOSSIBLE_CASE)}},ecdsaVerify(r,i,o){switch(n("signature",r,64),n("message",i,32),n("public key",o,[33,65]),e.ecdsaVerify(r,i,o)){case 0:return!0;case 3:return!1;case 1:throw Error(t.SIG_PARSE);case 2:throw Error(t.PUBKEY_PARSE)}},ecdsaRecover(a,c,u,l=!0,d){switch(n("signature",a,64),r("Number"===s(c)&&c>=0&&c<=3,"Expected recovery id to be a Number within interval [0, 3]"),n("message",u,32),i(l),d=o(d,l?33:65),e.ecdsaRecover(d,a,c,u)){case 0:return d;case 1:throw Error(t.SIG_PARSE);case 2:throw Error(t.RECOVER);case 3:throw Error(t.IMPOSSIBLE_CASE)}},ecdh(i,a,c={},u){switch(n("public key",i,[33,65]),n("private key",a,32),r("Object"===s(c),"Expected options to be an Object"),void 0!==c.data&&n("options.data",c.data),void 0!==c.hashfn?(r("Function"===s(c.hashfn),"Expected options.hashfn to be a Function"),void 0!==c.xbuf&&n("options.xbuf",c.xbuf,32),void 0!==c.ybuf&&n("options.ybuf",c.ybuf,32),n("output",u)):u=o(u,32),e.ecdh(u,i,a,c.data,c.hashfn,c.xbuf,c.ybuf)){case 0:return u;case 1:throw Error(t.PUBKEY_PARSE);case 2:throw Error(t.ECDH)}}})},17690:e=>{"use strict";function t(e,t){return e.__proto__=t,e}function r(e,t){for(var r in t)e.hasOwnProperty(r)||(e[r]=t[r]);return e}
37e.exports=Object.setPrototypeOf||(({__proto__:[]})instanceof Array?t:r)},7533:(e,t,r)=>{var n=r(75927).Buffer;!function(){var t=r(47505),i=r(34885).utf8,o=r(34885).bin,s=function(e){e.constructor==String?e=i.stringToBytes(e):void 0!==n&&"function"==typeof n.isBuffer&&n.isBuffer(e)?e=Array.prototype.slice.call(e,0):Array.isArray(e)||(e=e.toString());var r=t.bytesToWords(e),o=8*e.length,s=[],a=0x67452301,c=-0x10325477,u=-0x67452302,l=0x10325476,d=-0x3c2d1e10;r[o>>5]|=128<<24-o%32,r[(o+64>>>9<<4)+15]=o;for(var f=0;f<r.length;f+=16){for(var h=a,p=c,y=u,g=l,m=d,b=0;b<80;b++){if(b<16)s[b]=r[f+b];else{var v=s[b-3]^s[b-8]^s[b-14]^s[b-16];s[b]=v<<1|v>>>31}var w=(a<<5|a>>>27)+d+(s[b]>>>0)+(b<20?(c&u|~c&l)+0x5a827999:b<40?(c^u^l)+0x6ed9eba1:b<60?(c&u|c&l|u&l)-0x70e44324:(c^u^l)-0x359d3e2a);d=l,l=u,u=c<<30|c>>>2,c=a,a=w}a+=h,c+=p,u+=y,l+=g,d+=m}return[a,c,u,l,d]},a=function(e,r){var n=t.wordsToBytes(s(e));return r&&r.asBytes?n:r&&r.asString?o.bytesToString(n):t.bytesToHex(n)};a._blocksize=16,a._digestsize=20,e.exports=a}()},93200:e=>{"use strict";e.exports=(e,t)=>{if(!("string"==typeof e&&"string"==typeof t))throw TypeError("Expected the arguments to be of type `string`");if(""===t)return[e];let r=e.indexOf(t);return -1===r?[e]:[e.slice(0,r),e.slice(r+t.length)]}},69407:(e,t,r)=>{"use strict";var n=r(81315);function i(e,t){var r=[];return Object.keys(t).forEach(function(n){var i=t[n],o=Number(n);e[o]=i,e[i]=o,e[i.toLowerCase()]=o,r.push(o)}),r}function o(e){if("number"==typeof e){if(!o[e])throw Error("invalid status code: "+e);return e}if("string"!=typeof e)throw TypeError("code must be a number or string");var t=parseInt(e,10);if(!isNaN(t)){if(!o[t])throw Error("invalid status code: "+t);return t}if(!(t=o[e.toLowerCase()]))throw Error('invalid status message: "'+e+'"');return t}e.exports=o,o.STATUS_CODES=n,o.codes=i(o,n),o.redirect={300:!0,301:!0,302:!0,303:!0,305:!0,307:!0,308:!0},o.empty={204:!0,205:!0,304:!0},o.retry={502:!0,503:!0,504:!0}},72434:e=>{"use strict";e.exports=e=>encodeURIComponent(e).replace(/[!'()*]/g,e=>`%${e.charCodeAt(0).toString(16).toUpperCase()}`)},24623:(e,t,r)=>{"use strict";var n=r(90841).Buffer,i=n.isEncoding||function(e){switch((e=""+e)&&e.toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":case"raw":return!0;default:return!1}};function o(e){var t;if(!e)return"utf8";for(;;)switch(e){case"utf8":case"utf-8":return"utf8";case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return"utf16le";case"latin1":case"binary":return"latin1";case"base64":case"ascii":case"hex":return e;default:if(t)return;e=(""+e).toLowerCase(),t=!0}}function s(e){var t=o(e);if("string"!=typeof t&&(n.isEncoding===i||!i(e)))throw Error("Unknown encoding: "+e);return t||e}function a(e){var t;switch(this.encoding=s(e),this.encoding){case"utf16le":this.text=p,this.end=y,t=4;break;case"utf8":this.fillLast=d,t=4;break;case"base64":this.text=g,this.end=m,t=3;break;default:this.write=b,this.end=v;return}this.lastNeed=0,this.lastTotal=0,this.lastChar=n.allocUnsafe(t)}function c(e){return e<=127?0:e>>5==6?2:e>>4==14?3:e>>3==30?4:e>>6==2?-1:-2}function u(e,t,r){var n=t.length-1;if(n<r)return 0;var i=c(t[n]);return i>=0?(i>0&&(e.lastNeed=i-1),i):--n<r||-2===i?0:(i=c(t[n]))>=0?(i>0&&(e.lastNeed=i-2),i):--n<r||-2===i?0:(i=c(t[n]))>=0?(i>0&&(2===i?i=0:e.lastNeed=i-3),i):0}function l(e,t,r){if((192&t[0])!=128)return e.lastNeed=0,"�";if(e.lastNeed>1&&t.length>1){if((192&t[1])!=128)return e.lastNeed=1,"�";if(e.lastNeed>2&&t.length>2&&(192&t[2])!=128)return e.lastNeed=2,"�"}}function d(e){var t=this.lastTotal-this.lastNeed,r=l(this,e,t);return void 0!==r?r:this.lastNeed<=e.length?(e.copy(this.lastChar,t,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal)):void(e.copy(this.lastChar,t,0,e.length),this.lastNeed-=e.length)}function f(e,t){var r=u(this,e,t);if(!this.lastNeed)return e.toString("utf8",t);this.lastTotal=r;var n=e.length-(r-this.lastNeed);return e.copy(this.lastChar,0,n),e.toString("utf8",t,n)}function h(e){var t=e&&e.length?this.write(e):"";return this.lastNeed?t+"�":t}function p(e,t){if((e.length-t)%2==0){var r=e.toString("utf16le",t);if(r){var n=r.charCodeAt(r.length-1);if(n>=55296&&n<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=e[e.length-2],this.lastChar[1]=e[e.length-1],r.slice(0,-1)}return r}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=e[e.length-1],e.toString("utf16le",t,e.length-1)}function y(e){var t=e&&e.length?this.write(e):"";if(this.lastNeed){var r=this.lastTotal-this.lastNeed;return t+this.lastChar.toString("utf16le",0,r)}return t}function g(e,t){var r=(e.length-t)%3;return 0===r?e.toString("base64",t):(this.lastNeed=3-r,this.lastTotal=3,1===r?this.lastChar[0]=e[e.length-1]:(this.lastChar[0]=e[e.length-2],this.lastChar[1]=e[e.length-1]),e.toString("base64",t,e.length-r))}function m(e){var t=e&&e.length?this.write(e):"";return this.lastNeed?t+this.lastChar.toString("base64",0,3-this.lastNeed):t}function b(e){return e.toString(this.encoding)}function v(e){return e&&e.length?this.write(e):""}t.StringDecoder=a,a.prototype.write=function(e){var t,r;if(0===e.length)return"";if(this.lastNeed){if(void 0===(t=this.fillLast(e)))return"";r=this.lastNeed,this.lastNeed=0}else r=0;return r<e.length?t?t+this.text(e,r):this.text(e,r):t||""},a.prototype.end=h,a.prototype.text=f,a.prototype.fillLast=function(e){if(this.lastNeed<=e.length)return e.copy(this.lastChar,this.lastTotal-this.lastNeed,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);e.copy(this.lastChar,this.lastTotal-this.lastNeed,0,e.length),this.lastNeed-=e.length}},90841:(e,t,r)=>{var n=r(75927),i=n.Buffer;function o(e,t){for(var r in e)t[r]=e[r]}function s(e,t,r){return i(e,t,r)}i.from&&i.alloc&&i.allocUnsafe&&i.allocUnsafeSlow?e.exports=n:(o(n,t),t.Buffer=s),o(i,s),s.from=function(e,t,r){if("number"==typeof e)throw TypeError("Argument must not be a number");return i(e,t,r)},s.alloc=function(e,t,r){if("number"!=typeof e)throw TypeError("Argument must be a number");var n=i(e);return void 0!==t?"string"==typeof r?n.fill(t,r):n.fill(t):n.fill(0),n},s.allocUnsafe=function(e){if("number"!=typeof e)throw TypeError("Argument must be a number");return i(e)},s.allocUnsafeSlow=function(e){if("number"!=typeof e)throw TypeError("Argument must be a number");return n.SlowBuffer(e)}},9018:e=>{e.exports=function(){var e=document.getSelection();if(!e.rangeCount)return function(){};for(var t=document.activeElement,r=[],n=0;n<e.rangeCount;n++)r.push(e.getRangeAt(n));switch(t.tagName.toUpperCase()){case"INPUT":case"TEXTAREA":t.blur();break;default:t=null}return e.removeAllRanges(),function(){"Caret"===e.type&&e.removeAllRanges(),e.rangeCount||r.forEach(function(t){e.addRange(t)}
37),t&&t.focus()}}},97807:e=>{e.exports=t;function t(e){return e.split(" ").map(function(e){return e.slice(0,1).toUpperCase()+e.slice(1)}).join("").replace(/[^ _0-9a-z]/gi,"")}},88073:function(e,t){!function(e,r){r(t)}(0,function(e){"use strict";function t(){for(var e=arguments.length,t=Array(e),r=0;r<e;r++)t[r]=arguments[r];if(!(t.length>1))return t[0];t[0]=t[0].slice(0,-1);for(var n=t.length-1,i=1;i<n;++i)t[i]=t[i].slice(1,-1);return t[n]=t[n].slice(1),t.join("")}function r(e){return"(?:"+e+")"}function n(e){return void 0===e?"undefined":null===e?"null":Object.prototype.toString.call(e).split(" ").pop().split("]").shift().toLowerCase()}function i(e){return e.toUpperCase()}function o(e){return null!=e?e instanceof Array?e:"number"!=typeof e.length||e.split||e.setInterval||e.call?[e]:Array.prototype.slice.call(e):[]}function s(e,t){var r=e;if(t)for(var n in t)r[n]=t[n];return r}function a(e){var n="[A-Za-z]",i="[0-9]",o=t(i,"[A-Fa-f]"),s=r(r("%[EFef]"+o+"%"+o+o+"%"+o+o)+"|"+r("%[89A-Fa-f]"+o+"%"+o+o)+"|"+r("%"+o+o)),a="[\\!\\$\\&\\'\\(\\)\\*\\+\\,\\;\\=]",c=t("[\\:\\/\\?\\#\\[\\]\\@]",a),u=e?"[\\xA0-\\u200D\\u2010-\\u2029\\u202F-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF]":"[]",l=e?"[\\uE000-\\uF8FF]":"[]",d=t(n,i,"[\\-\\.\\_\\~]",u),f=r(n+t(n,i,"[\\+\\-\\.]")+"*"),h=r(r(s+"|"+t(d,a,"[\\:]"))+"*"),p=(r(r("25[0-5]")+"|"+r("2[0-4]"+i)+"|"+r("1"+i+i)+"|"+r("[1-9]"+i)+"|"+i),r(r("25[0-5]")+"|"+r("2[0-4]"+i)+"|"+r("1"+i+i)+"|"+r("0?[1-9]"+i)+"|0?0?"+i)),y=r(p+"\\."+p+"\\."+p+"\\."+p),g=r(o+"{1,4}"),m=r(r(g+"\\:"+g)+"|"+y),b=r(r(g+"\\:")+"{6}"+m),v=r("\\:\\:"+r(g+"\\:")+"{5}"+m),w=r(r(g)+"?\\:\\:"+r(g+"\\:")+"{4}"+m),_=r(r(r(g+"\\:")+"{0,1}"+g)+"?\\:\\:"+r(g+"\\:")+"{3}"+m),E=r(r(r(g+"\\:")+"{0,2}"+g)+"?\\:\\:"+r(g+"\\:")+"{2}"+m),S=r(r(r(g+"\\:")+"{0,3}"+g)+"?\\:\\:"+g+"\\:"+m),x=r(r(r(g+"\\:")+"{0,4}"+g)+"?\\:\\:"+m),A=r(r(r(g+"\\:")+"{0,5}"+g)+"?\\:\\:"+g),I=r(r(r(g+"\\:")+"{0,6}"+g)+"?\\:\\:"),O=r([b,v,w,_,E,S,x,A,I].join("|")),T=r(r(d+"|"+s)+"+"),P=(r(O+"\\%25"+T),r(O+r("\\%25|\\%(?!"+o+"{2})")+T)),M=r("[vV]"+o+"+\\."+t(d,a,"[\\:]")+"+"),N=r("\\["+r(P+"|"+O+"|"+M)+"\\]"),k=r(r(s+"|"+t(d,a))+"*"),C=r(N+"|"+y+"(?!"+k+")|"+k),D=r(i+"*"),j=r(r(h+"@")+"?"+C+r("\\:"+D)+"?"),R=r(s+"|"+t(d,a,"[\\:\\@]")),L=r(R+"*"),B=r(R+"+"),U=r(r(s+"|"+t(d,a,"[\\@]"))+"+"),$=r(r("\\/"+L)+"*"),K=r("\\/"+r(B+$)+"?"),F=r(U+$),z=r(B+$),q="(?!"+R+")",V=(r($+"|"+K+"|"+F+"|"+z+"|"+q),r(r(R+"|"+t("[\\/\\?]",l))+"*")),H=r(r(R+"|[\\/\\?]")+"*"),G=r(r("\\/\\/"+j+$)+"|"+K+"|"+z+"|"+q),W=r(f+"\\:"+G+r("\\?"+V)+"?"+r("\\#"+H)+"?"),J=r(r("\\/\\/"+j+$)+"|"+K+"|"+F+"|"+q),Z=r(J+r("\\?"+V)+"?"+r("\\#"+H)+"?");return r(W+"|"+Z),r(f+"\\:"+G+r("\\?"+V)+"?"),r(r("\\/\\/("+r("("+h+")@")+"?("+C+")"+r("\\:("+D+")")+"?)")+"?("+$+"|"+K+"|"+z+"|"+q+")"),r("\\?("+V+")"),r("\\#("+H+")"),r(r("\\/\\/("+r("("+h+")@")+"?("+C+")"+r("\\:("+D+")")+"?)")+"?("+$+"|"+K+"|"+F+"|"+q+")"),r("\\?("+V+")"),r("\\#("+H+")"),r(r("\\/\\/("+r("("+h+")@")+"?("+C+")"+r("\\:("+D+")")+"?)")+"?("+$+"|"+K+"|"+z+"|"+q+")"),r("\\?("+V+")"),r("\\#("+H+")"),r("("+h+")@"),r("\\:("+D+")"),{NOT_SCHEME:RegExp(t("[^]",n,i,"[\\+\\-\\.]"),"g"),NOT_USERINFO:RegExp(t("[^\\%\\:]",d,a),"g"),NOT_HOST:RegExp(t("[^\\%\\[\\]\\:]",d,a),"g"),NOT_PATH:RegExp(t("[^\\%\\/\\:\\@]",d,a),"g"),NOT_PATH_NOSCHEME:RegExp(t("[^\\%\\/\\@]",d,a),"g"),NOT_QUERY:RegExp(t("[^\\%]",d,a,"[\\:\\@\\/\\?]",l),"g"),NOT_FRAGMENT:RegExp(t("[^\\%]",d,a,"[\\:\\@\\/\\?]"),"g"),ESCAPE:RegExp(t("[^]",d,a),"g"),UNRESERVED:RegExp(d,"g"),OTHER_CHARS:RegExp(t("[^\\%]",d,c),"g"),PCT_ENCODED:RegExp(s,"g"),IPV4ADDRESS:RegExp("^("+y+")$"),IPV6ADDRESS:RegExp("^\\[?("+O+")"+r(r("\\%25|\\%(?!"+o+"{2})")+"("+T+")")+"?\\]?$")}}var c=a(!1),u=a(!0),l=function(){function e(e,t){var r=[],n=!0,i=!1,o=void 0;try{for(var s,a=e[Symbol.iterator]();!(n=(s=a.next()).done)&&(r.push(s.value),!t||r.length!==t);n=!0);}catch(e){i=!0,o=e}finally{try{!n&&a.return&&a.return()}finally{if(i)throw o}}return r}return function(t,r){if(Array.isArray(t))return t;if(Symbol.iterator in Object(t))return e(t,r);throw TypeError("Invalid attempt to destructure non-iterable instance")}}(),d=0x7fffffff,f=36,h=1,p=26,y=38,g=700,m=72,b=128,v="-",w=/^xn--/,_=/[^\0-\x7E]/,E=/[\x2E\u3002\uFF0E\uFF61]/g,S={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >
37= 0x80 (not a basic code point)","invalid-input":"Invalid input"},x=35,A=Math.floor,I=String.fromCharCode;function O(e){throw RangeError(S[e])}function T(e,t){for(var r=[],n=e.length;n--;)r[n]=t(e[n]);return r}function P(e,t){var r=e.split("@"),n="";return r.length>1&&(n=r[0]+"@",e=r[1]),n+T((e=e.replace(E,".")).split("."),t).join(".")}function M(e){for(var t=[],r=0,n=e.length;r<n;){var i=e.charCodeAt(r++);if(i>=55296&&i<=56319&&r<n){var o=e.charCodeAt(r++);(64512&o)==56320?t.push(((1023&i)<<10)+(1023&o)+65536):(t.push(i),r--)}else t.push(i)}return t}var N=function(e){return e-48<10?e-22:e-65<26?e-65:e-97<26?e-97:f},k=function(e,t){return e+22+75*(e<26)-((0!=t)<<5)},C=function(e,t,r){var n=0;for(e=r?A(e/g):e>>1,e+=A(e/t);e>x*p>>1;n+=f)e=A(e/x);return A(n+(x+1)*e/(e+y))},D=function(e){var t=[],r=e.length,n=0,i=b,o=m,s=e.lastIndexOf(v);s<0&&(s=0);for(var a=0;a<s;++a)e.charCodeAt(a)>=128&&O("not-basic"),t.push(e.charCodeAt(a));for(var c=s>0?s+1:0;c<r;){for(var u=n,l=1,y=f;;y+=f){c>=r&&O("invalid-input");var g=N(e.charCodeAt(c++));(g>=f||g>A((d-n)/l))&&O("overflow"),n+=g*l;var w=y<=o?h:y>=o+p?p:y-o;if(g<w)break;var _=f-w;l>A(d/_)&&O("overflow"),l*=_}var E=t.length+1;o=C(n-u,E,0==u),A(n/E)>d-i&&O("overflow"),i+=A(n/E),n%=E,t.splice(n++,0,i)}return String.fromCodePoint.apply(String,t)},j=function(e){var t=[],r=(e=M(e)).length,n=b,i=0,o=m,s=!0,a=!1,c=void 0;try{for(var u,l=e[Symbol.iterator]();!(s=(u=l.next()).done);s=!0){var y=u.value;y<128&&t.push(I(y))}}catch(e){a=!0,c=e}finally{try{!s&&l.return&&l.return()}finally{if(a)throw c}}var g=t.length,w=g;for(g&&t.push(v);w<r;){var _=d,E=!0,S=!1,x=void 0;try{for(var T,P=e[Symbol.iterator]();!(E=(T=P.next()).done);E=!0){var N=T.value;N>=n&&N<_&&(_=N)}}catch(e){S=!0,x=e}finally{try{!E&&P.return&&P.return()}finally{if(S)throw x}}var D=w+1;_-n>A((d-i)/D)&&O("overflow"),i+=(_-n)*D,n=_;var j=!0,R=!1,L=void 0;try{for(var B,U=e[Symbol.iterator]();!(j=(B=U.next()).done);j=!0){var $=B.value;if($<n&&++i>d&&O("overflow"),$==n){for(var K=i,F=f;;F+=f){var z=F<=o?h:F>=o+p?p:F-o;if(K<z)break;var q=K-z,V=f-z;t.push(I(k(z+q%V,0))),K=A(q/V)}t.push(I(k(K,0))),o=C(i,D,w==g),i=0,++w}}}catch(e){R=!0,L=e}finally{try{!j&&U.return&&U.return()}finally{if(R)throw L}}++i,++n}return t.join("")},R={toASCII:function(e){return P(e,function(e){return _.test(e)?"xn--"+j(e):e})},toUnicode:function(e){return P(e,function(e){return w.test(e)?D(e.slice(4).toLowerCase()):e})}},L={};function B(e){var t=e.charCodeAt(0);return t<16?"%0"+t.toString(16).toUpperCase():t<128?"%"+t.toString(16).toUpperCase():t<2048?"%"+(t>>6|192).toString(16).toUpperCase()+"%"+(63&t|128).toString(16).toUpperCase():"%"+(t>>12|224).toString(16).toUpperCase()+"%"+(t>>6&63|128).toString(16).toUpperCase()+"%"+(63&t|128).toString(16).toUpperCase()}function U(e){for(var t="",r=0,n=e.length;r<n;){var i=parseInt(e.substr(r+1,2),16);i<128?(t+=String.fromCharCode(i),r+=3):i>=194&&i<224?(n-r>=6?t+=String.fromCharCode((31&i)<<6|63&parseInt(e.substr(r+4,2),16)):t+=e.substr(r,6),r+=6):i>=224?(n-r>=9?t+=String.fromCharCode((15&i)<<12|(63&parseInt(e.substr(r+4,2),16))<<6|63&parseInt(e.substr(r+7,2),16)):t+=e.substr(r,9),r+=9):(t+=e.substr(r,3),r+=3)}return t}function $(e,t){function r(e){var r=U(e);return r.match(t.UNRESERVED)?r:e}return e.scheme&&(e.scheme=String(e.scheme).replace(t.PCT_ENCODED,r).toLowerCase().replace(t.NOT_SCHEME,"")),void 0!==e.userinfo&&(e.userinfo=String(e.userinfo).replace(t.PCT_ENCODED,r).replace(t.NOT_USERINFO,B).replace(t.PCT_ENCODED,i)),void 0!==e.host&&(e.host=String(e.host).replace(t.PCT_ENCODED,r).toLowerCase().replace(t.NOT_HOST,B).replace(t.PCT_ENCODED,i)),void 0!==e.path&&(e.path=String(e.path).replace(t.PCT_ENCODED,r).replace(e.scheme?t.NOT_PATH:t.NOT_PATH_NOSCHEME,B).replace(t.PCT_ENCODED,i)),void 0!==e.query&&(e.query=String(e.query).replace(t.PCT_ENCODED,r).replace(t.NOT_QUERY,B).replace(t.PCT_ENCODED,i)),void 0!==e.fragment&&(e.fragment=String(e.fragment).replace(t.PCT_ENCODED,r).replace(t.NOT_FRAGMENT,B).replace(t.PCT_ENCODED,i)),e}function K(e){return e.replace(/^0*(.*)/,"$1")||"0"}function F(e,t){var r=l(e.match(t.IPV4ADDRESS)||[],2)[1];return r?r.split(".").map(K).join("."):e}function z(e,t){var r=l(e.match(t.IPV6ADDRESS)||[],3),n=r[1],i=r[2];if(!n)return e;for(var o=l(n.toLowerCase().split("::").reverse(),2),s=o[0],a=o[1],c=a?a.split(":").map(K):[],u=s.split(":").map(K),d=t.IPV4ADDRESS.test(u[u.length-1]),f=d?7:8,h=u.length-f,p=Array(f),y=0;y<f;++y)p[y]=c[y]||u[h+y]||"";d&&(p[f-1]=F(p[f-1],t));var g=p.reduce(function(e,t,r){if(!t||"0"===t){var n=e[e.length-1];n&&n.index+n.length===r?n.length++:e.push({index:r,length:1})}return e},[]).sort(function(e,t){return t.length-e.length}
vendor: 9,213 bytes, line 37
37)[0],m=void 0;if(g&&g.length>1){var b=p.slice(0,g.index),v=p.slice(g.index+g.length);m=b.join(":")+"::"+v.join(":")}else m=p.join(":");return i&&(m+="%"+i),m}var q=/^(?:([^:\/?#]+):)?(?:\/\/((?:([^\/?#@]*)@)?(\[[^\/?#\]]+\]|[^\/?#:]*)(?:\:(\d*))?))?([^?#]*)(?:\?([^#]*))?(?:#((?:.|\n|\r)*))?/i,V=void 0==="".match(/(){0}/)[1];function H(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r={},n=!1!==t.iri?u:c;"suffix"===t.reference&&(e=(t.scheme?t.scheme+":":"")+"//"+e);var i=e.match(q);if(i){V?(r.scheme=i[1],r.userinfo=i[3],r.host=i[4],r.port=parseInt(i[5],10),r.path=i[6]||"",r.query=i[7],r.fragment=i[8],isNaN(r.port)&&(r.port=i[5])):(r.scheme=i[1]||void 0,r.userinfo=-1!==e.indexOf("@")?i[3]:void 0,r.host=-1!==e.indexOf("//")?i[4]:void 0,r.port=parseInt(i[5],10),r.path=i[6]||"",r.query=-1!==e.indexOf("?")?i[7]:void 0,r.fragment=-1!==e.indexOf("#")?i[8]:void 0,isNaN(r.port)&&(r.port=e.match(/\/\/(?:.|\n)*\:(?:\/|\?|\#|$)/)?i[4]:void 0)),r.host&&(r.host=z(F(r.host,n),n)),void 0!==r.scheme||void 0!==r.userinfo||void 0!==r.host||void 0!==r.port||r.path||void 0!==r.query?void 0===r.scheme?r.reference="relative":void 0===r.fragment?r.reference="absolute":r.reference="uri":r.reference="same-document",t.reference&&"suffix"!==t.reference&&t.reference!==r.reference&&(r.error=r.error||"URI is not a "+t.reference+" reference.");var o=L[(t.scheme||r.scheme||"").toLowerCase()];if(t.unicodeSupport||o&&o.unicodeSupport)$(r,n);else{if(r.host&&(t.domainHost||o&&o.domainHost))try{r.host=R.toASCII(r.host.replace(n.PCT_ENCODED,U).toLowerCase())}catch(e){r.error=r.error||"Host's domain name can not be converted to ASCII via punycode: "+e}$(r,c)}o&&o.parse&&o.parse(r,t)}else r.error=r.error||"URI can not be parsed.";return r}function G(e,t){var r=!1!==t.iri?u:c,n=[];return void 0!==e.userinfo&&(n.push(e.userinfo),n.push("@")),void 0!==e.host&&n.push(z(F(String(e.host),r),r).replace(r.IPV6ADDRESS,function(e,t,r){return"["+t+(r?"%25"+r:"")+"]"})),("number"==typeof e.port||"string"==typeof e.port)&&(n.push(":"),n.push(String(e.port))),n.length?n.join(""):void 0}var W=/^\.\.?\//,J=/^\/\.(\/|$)/,Z=/^\/\.\.(\/|$)/,Y=/^\/?(?:.|\n)*?(?=\/|$)/;function X(e){for(var t=[];e.length;)if(e.match(W))e=e.replace(W,"");else if(e.match(J))e=e.replace(J,"/");else if(e.match(Z))e=e.replace(Z,"/"),t.pop();else if("."===e||".."===e)e="";else{var r=e.match(Y);if(r){var n=r[0];e=e.slice(n.length),t.push(n)}else throw Error("Unexpected dot segment condition")}return t.join("")}function Q(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=t.iri?u:c,n=[],i=L[(t.scheme||e.scheme||"").toLowerCase()];if(i&&i.serialize&&i.serialize(e,t),e.host){if(r.IPV6ADDRESS.test(e.host));else if(t.domainHost||i&&i.domainHost)try{e.host=t.iri?R.toUnicode(e.host):R.toASCII(e.host.replace(r.PCT_ENCODED,U).toLowerCase())}catch(r){e.error=e.error||"Host's domain name can not be converted to "+(t.iri?"Unicode":"ASCII")+" via punycode: "+r}}$(e,r),"suffix"!==t.reference&&e.scheme&&(n.push(e.scheme),n.push(":"));var o=G(e,t);if(void 0!==o&&("suffix"!==t.reference&&n.push("//"),n.push(o),e.path&&"/"!==e.path.charAt(0)&&n.push("/")),void 0!==e.path){var s=e.path;t.absolutePath||i&&i.absolutePath||(s=X(s)),void 0===o&&(s=s.replace(/^\/\//,"/%2F")),n.push(s)}return void 0!==e.query&&(n.push("?"),n.push(e.query)),void 0!==e.fragment&&(n.push("#"),n.push(e.fragment)),n.join("")}function ee(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},n=arguments[3],i={};return n||(e=H(Q(e,r),r),t=H(Q(t,r),r)),!(r=r||{}).tolerant&&t.scheme?(i.scheme=t.scheme,i.userinfo=t.userinfo,i.host=t.host,i.port=t.port,i.path=X(t.path||""),i.query=t.query):(void 0!==t.userinfo||void 0!==t.host||void 0!==t.port?(i.userinfo=t.userinfo,i.host=t.host,i.port=t.port,i.path=X(t.path||""),i.query=t.query):(t.path?("/"===t.path.charAt(0)?i.path=X(t.path):(void 0===e.userinfo&&void 0===e.host&&void 0===e.port||e.path?e.path?i.path=e.path.slice(0,e.path.lastIndexOf("/")+1)+t.path:i.path=t.path:i.path="/"+t.path,i.path=X(i.path)),i.query=t.query):(i.path=e.path,void 0!==t.query?i.query=t.query:i.query=e.query),i.userinfo=e.userinfo,i.host=e.host,i.port=e.port),i.scheme=e.scheme),i.fragment=t.fragment,i}function et(e,t,r){var n=s({scheme:"null"},r);return Q(ee(H(e,n),H(t,n),n,!0),n)}function er(e,t){return"string"==typeof e?e=Q(H(e,t),t):"object"===n(e)&&(e=H(Q(e,t),t)),e}function en(e,t,r){return"string"==typeof e?e=Q(H(e,r),r):"object"===n(e)&&(e=Q(e,r)),"string"==typeof t?t=Q(H(t,r),r):"object"===n(t)&&(t=Q(t,r)),e===t}function ei(e,t){return e&&e.toString().replace(t&&t.iri?u.ESCAPE:c.ESCAPE,B)}function eo(e,t){return e&&e.toString().replace(t&&t.iri?u.PCT_ENCODED:c.PCT_ENCODED,U)}var es={scheme:"http",domainHost:!0,parse:function(e,t){return e.host||(e.error=e.error||"HTTP URIs must have a host."),e},serialize:function(e,t){var r="https"===String(e.scheme).toLowerCase();return(e.port===(r?443:80)||""===e.port)&&(e.port=void 0),e.path||(e.path="/"),e}},ea={scheme:"https",domainHost:es.domainHost,parse:es.parse,serialize:es.serialize};function ec(e){return"boolean"==typeof e.secure?e.secure:"wss"===String(e.scheme).toLowerCase()}var eu={scheme:"ws",domainHost:!0,parse:function(e,t){var r=e;return r.secure=ec(r),r.resourceName=(r.path||"/")+(r.query?"?"+r.query:""),r.path=void 0,r.query=void 0,r},serialize:function(e,t){if((e.port===(ec(e)?443:80)||""===e.port)&&(e.port=void 0),"boolean"==typeof e.secure&&(e.scheme=e.secure?"wss":"ws",e.secure=void 0),e.resourceName){var r=l(e.resourceName.split("?"),2),n=r[0],i=r[1];e.path=n&&"/"!==n?n:void 0,e.query=i,e.resourceName=void 0}return e.fragment=void 0,e}},el={scheme:"wss",domainHost:eu.domainHost,parse:eu.parse,serialize:eu.serialize},ed={},ef="[A-Za-z0-9\\-\\.\\_\\~\\xA0-\\u200D\\u2010-\\u2029\\u202F-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF]",eh="[0-9A-Fa-f]",ep=r(r("%[EFef]"+eh+"%"+eh+eh+"%"+eh+eh)+"|"+r("%[89A-Fa-f]"+eh+"%"+eh+eh)+"|"+r("%"+eh+eh)),ey="[A-Za-z0-9\\!\\$\\%\\'\\*\\+\\-\\^\\_\\`\\{\\|\\}\\~]",eg=t("[\\!\\$\\%\\'\\(\\)\\*\\+\\,\\-\\.0-9\\<\\>A-Z\\x5E-\\x7E]",'[\\"\\\\]'),em="[\\!\\$\\'\\(\\)\\*\\+\\,\\;\\:\\@]",eb=RegExp(ef,"g"),ev=RegExp(ep,"g"),ew=RegExp(t("[^]",ey,"[\\.]",'[\\"]',eg),"g"),e_=RegExp(t("[^]",ef,em),"g"),eE=e_;function eS(e){var t=U(e);return t.match(eb)?t:e}var ex={scheme:"mailto",parse:function(e,t){var r=e,n=r.to=r.path?r.path.split(","):[];if(r.path=void 0,r.query){for(var i=!1,o={},s=r.query.split("&"),a=0,c=s.length;a<c;++a){var u=s[a].split("=");switch(u[0]){case"to":for(var l=u[1].split(","),d=0,f=l.length;d<f;++d)n.push(l[d]);break;case"subject":r.subject=eo(u[1],t);break;case"body":r.body=eo(u[1],t);break;default:i=!0,o[eo(u[0],t)]=eo(u[1],t)}}i&&(r.headers=o)}r.query=void 0;for(var h=0,p=n.length;h<p;++h){var y=n[h].split("@");if(y[0]=eo(y[0]),t.unicodeSupport)y[1]=eo(y[1],t).toLowerCase();else try{y[1]=R.toASCII(eo(y[1],t).toLowerCase())}catch(e){r.error=r.error||"Email address's domain name can not be converted to ASCII via punycode: "+e}n[h]=y.join("@")}return r},serialize:function(e,t){var r=e,n=o(e.to);if(n){for(var s=0,a=n.length;s<a;++s){var c=String(n[s]),u=c.lastIndexOf("@"),l=c.slice(0,u).replace(ev,eS).replace(ev,i).replace(ew,B),d=c.slice(u+1);try{d=t.iri?R.toUnicode(d):R.toASCII(eo(d,t).toLowerCase())}catch(e){r.error=r.error||"Email address's domain name can not be converted to "+(t.iri?"Unicode":"ASCII")+" via punycode: "+e}n[s]=l+"@"+d}r.path=n.join(",")}var f=e.headers=e.headers||{};e.subject&&(f.subject=e.subject),e.body&&(f.body=e.body);var h=[];for(var p in f)f[p]!==ed[p]&&h.push(p.replace(ev,eS).replace(ev,i).replace(e_,B)+"="+f[p].replace(ev,eS).replace(ev,i).replace(eE,B));return h.length&&(r.query=h.join("&")),r}},eA=/^([^\:]+)\:(.*)/,eI={scheme:"urn",parse:function(e,t){var r=e.path&&e.path.match(eA),n=e;if(r){var i=t.scheme||n.scheme||"urn",o=r[1].toLowerCase(),s=r[2],a=L[i+":"+(t.nid||o)];n.nid=o,n.nss=s,n.path=void 0,a&&(n=a.parse(n,t))}else n.error=n.error||"URN can not be parsed.";return n},serialize:function(e,t){var r=t.scheme||e.scheme||"urn",n=e.nid,i=L[r+":"+(t.nid||n)];i&&(e=i.serialize(e,t));var o=e,s=e.nss;return o.path=(n||t.nid)+":"+s,o}},eO=/^[0-9A-Fa-f]{8}(?:\-[0-9A-Fa-f]{4}){3}\-[0-9A-Fa-f]{12}$/,eT={scheme:"urn:uuid",parse:function(e,t){var r=e;return r.uuid=r.nss,r.nss=void 0,t.tolerant||r.uuid&&r.uuid.match(eO)||(r.error=r.error||"UUID is not valid."),r},serialize:function(e,t){var r=e;return r.nss=(e.uuid||"").toLowerCase(),r}};L[es.scheme]=es,L[ea.scheme]=ea,L[eu.scheme]=eu,L[el.scheme]=el,L[ex.scheme]=ex,L[eI.scheme]=eI,L[eT.scheme]=eT,e.SCHEMES=L,e.pctEncChar=B,e.pctDecChars=U,e.parse=H,e.removeDotSegments=X,e.serialize=Q,e.resolveComponents=ee,e.resolve=et,e.normalize=er,e.equal=en,e.escapeComponent=ei,e.unescapeComponent=eo,Object.defineProperty(e,"__esModule",{value:!0})})},66735:e=>{"use strict";e.exports=function(){throw Error("ws does not work in the browser. Browser clients must use the native WebSocket object")}},63512:e=>{e.exports=r;var t=Object.prototype.hasOwnProperty;function r(){for(var e={},r=0;r<arguments.length;r++){var n=arguments[r];for(var i in n)t.call(n,i)&&(e[i]=n[i])}return e}},56615:()=>{},32886:(e,t,r)=>{"use strict";var n=r(75927).Buffer;
37Object.defineProperty(t,"__esModule",{value:!0}),t.Account=void 0;let i=r(67562),o=r(34089),s=r(9626),a=r(39022),c=r(49722),u=r(75164),{addKey:l,createAccount:d,deleteAccount:f,deleteKey:h,deployContract:p,fullAccessKey:y,functionCall:g,functionCallAccessKey:m,stake:b,transfer:v}=s.actionCreators,w=12,_=500,E=1.5;class S{connection;accountId;constructor(e,t){this.connection=e,this.accountId=t}getConnection(){return this.connection}async state(){return this.connection.provider.query({request_type:"view_account",account_id:this.accountId,finality:"optimistic"})}async signTransaction(e,t){let r=await this.findAccessKey(e,t);if(!r)throw new a.TypedError(`Can not sign transactions for account ${this.accountId} on network ${this.connection.networkId}, no matching key pair exists for this account`,"KeyNotFound");let{accessKey:n}=r,i=(await this.connection.provider.block({finality:"final"})).header.hash,o=n.nonce+1n;return await (0,s.signTransaction)(e,o,t,(0,c.baseDecode)(i),this.connection.signer,this.accountId,this.connection.networkId)}async signAndSendTransaction({receiverId:e,actions:t,returnError:r}){let n,i;let s=await (0,o.exponentialBackoff)(_,w,E,async()=>{[n,i]=await this.signTransaction(e,t);let r=i.transaction.publicKey;try{return await this.connection.provider.sendTransaction(i)}catch(t){if("InvalidNonce"===t.type)return c.Logger.warn(`Retrying transaction ${e}:${(0,c.baseEncode)(n)} with new nonce.`),delete this.accessKeyByPublicKeyCache[r.toString()],null;if("Expired"===t.type)return c.Logger.warn(`Retrying transaction ${e}:${(0,c.baseEncode)(n)} due to expired block hash`),null;throw t.context=new a.ErrorContext((0,c.baseEncode)(n)),t}});if(!s)throw new a.TypedError("nonce retries exceeded for transaction. This usually means there are too many parallel requests with the same access key.","RetriesExceeded");if((0,c.printTxOutcomeLogsAndFailures)({contractId:i.transaction.receiverId,outcome:s}),!r&&"object"==typeof s.status&&"object"==typeof s.status.Failure&&null!==s.status.Failure){if(s.status.Failure.error_message&&s.status.Failure.error_type)throw new a.TypedError(`Transaction ${s.transaction_outcome.id} failed. ${s.status.Failure.error_message}`,s.status.Failure.error_type);throw(0,c.parseResultError)(s)}return s}accessKeyByPublicKeyCache={};async findAccessKey(e,t){let r=await this.connection.signer.getPublicKey(this.accountId,this.connection.networkId);if(!r)throw new a.TypedError(`no matching key pair found in ${this.connection.signer}`,"PublicKeyNotFound");let n=this.accessKeyByPublicKeyCache[r.toString()];if(void 0!==n)return{publicKey:r,accessKey:n};try{let e=await this.connection.provider.query({request_type:"view_access_key",account_id:this.accountId,public_key:r.toString(),finality:"optimistic"}),t={...e,nonce:BigInt(e.nonce||0)};if(this.accessKeyByPublicKeyCache[r.toString()])return{publicKey:r,accessKey:this.accessKeyByPublicKeyCache[r.toString()]};return this.accessKeyByPublicKeyCache[r.toString()]=t,{publicKey:r,accessKey:t}}catch(e){if("AccessKeyDoesNotExist"==e.type)return null;throw e}}async createAndDeployContract(e,t,r,n){let o=y();return await this.signAndSendTransaction({receiverId:e,actions:[d(),v(n),l(i.PublicKey.from(t),o),p(r)]}),new S(this.connection,e)}async sendMoney(e,t){return this.signAndSendTransaction({receiverId:e,actions:[v(t)]})}async createAccount(e,t,r){let n=y();return this.signAndSendTransaction({receiverId:e,actions:[d(),v(r),l(i.PublicKey.from(t),n)]})}async deleteAccount(e){return c.Logger.log("Deleting an account does not automatically transfer NFTs and FTs to the beneficiary address. Ensure to transfer assets before deleting."),this.signAndSendTransaction({receiverId:this.accountId,actions:[f(e)]})}async deployContract(e){return this.signAndSendTransaction({receiverId:this.accountId,actions:[p(e)]})}encodeJSContractArgs(e,t,r){return n.concat([n.from(e),n.from([0]),n.from(t),n.from([0]),n.from(r)])}async functionCall({contractId:e,methodName:t,args:r={},gas:n=c.DEFAULT_FUNCTION_CALL_GAS,attachedDeposit:i,walletMeta:o,walletCallbackUrl:a,stringify:u,jsContract:l}){let d;return this.validateArgs(r),d=l?["call_js_contract",this.encodeJSContractArgs(e,t,JSON.stringify(r)),n,i,null,!0]:[t,r,n,i,void 0===u?s.stringifyJsonOrBytes:u,!1],this.signAndSendTransaction({receiverId:l?this.connection.jsvmAccountId:e,actions:[g.apply(void 0,d)],walletMeta:o,walletCallbackUrl:a})}async addKey(e,t,r,n){let o;return r||(r=[]),Array.isArray(r)||(r=[r]),o=t?m(t,r,n):y(),this.signAndSendTransaction({receiverId:this.accountId,actions:[l(i.PublicKey.from(e),o)]})}async deleteKey(e){return this.signAndSendTransaction({receiverId:this.accountId,actions:[h(i.PublicKey.from(e))]})}async stake(e,t){return this.signAndSendTransaction({receiverId:this.accountId,actions:[b(t,i.PublicKey.from(e))]})}async signedDelegate({actions:e,blockHeightTtl:t,receiverId:r}){let{provider:n,signer:i}=this.connection,{header:o}=await n.block({finality:"final"}),{accessKey:a,publicKey:c}=await this.findAccessKey(null,null),u=(0,s.buildDelegateAction)({actions:e,max
37BlockHeight:BigInt(o.height)+BigInt(t),nonce:BigInt(a.nonce)+1n,publicKey:c,receiverId:r,senderId:this.accountId}),{signedDelegateAction:l}=await (0,s.signDelegateAction)({delegateAction:u,signer:{sign:async e=>{let{signature:t}=await i.signMessage(e,u.senderId,this.connection.networkId);return t}}});return l}validateArgs(e){if((void 0===e.byteLength||e.byteLength!==e.length)&&(Array.isArray(e)||"object"!=typeof e))throw new a.PositionalArgsError}async viewFunction(e){return await (0,u.viewFunction)(this.connection,e)}async viewState(e,t={finality:"optimistic"}){return await (0,u.viewState)(this.connection,this.accountId,e,t)}async getAccessKeys(){let e=await this.connection.provider.query({request_type:"view_access_key_list",account_id:this.accountId,finality:"optimistic"});return e?.keys?.map(e=>({...e,access_key:{...e.access_key,nonce:BigInt(e.access_key.nonce)}}))}async getAccountDetails(){return{authorizedApps:(await this.getAccessKeys()).filter(e=>"FullAccess"!==e.access_key.permission).map(e=>{let t=e.access_key.permission;return{contractId:t.FunctionCall.receiver_id,amount:t.FunctionCall.allowance,publicKey:e.public_key}})}}async getAccountBalance(){let e=await this.connection.provider.experimental_protocolConfig({finality:"final"}),t=await this.state(),r=BigInt(e.runtime_config.storage_amount_per_byte),n=BigInt(t.storage_usage)*r,i=BigInt(t.locked),o=BigInt(t.amount)+i,s=o-(i>n?i:n);return{total:o.toString(),stateStaked:n.toString(),staked:i.toString(),available:s.toString()}}async getActiveDelegatedStakeBalance(){let e=await this.connection.provider.block({finality:"final"}),t=e.header.hash,r=e.header.epoch_id,{current_validators:n,next_validators:i,current_proposals:o}=await this.connection.provider.validators(r),s=new Set;[...n,...i,...o].forEach(e=>s.add(e.account_id));let a=[...s],c=a.map(e=>this.viewFunction({contractId:e,methodName:"get_account_total_balance",args:{account_id:this.accountId},blockQuery:{blockId:t}})),u=await Promise.allSettled(c);if(u.some(e=>"rejected"===e.status&&"TimeoutError"===e.reason.type))throw Error("Failed to get delegated stake balance");let l=u.reduce((e,t,r)=>{let n=a[r];if("fulfilled"===t.status){let r=BigInt(t.value);if(0n!==r)return{...e,stakedValidators:[...e.stakedValidators,{validatorId:n,amount:r.toString()}],total:e.total+r}}return"rejected"===t.status?{...e,failedValidators:[...e.failedValidators,{validatorId:n,error:t.reason}]}:e},{stakedValidators:[],failedValidators:[],total:0n});return{...l,total:l.total.toString()}}}t.Account=S},58118:(e,t,r)=>{"use strict";var n=r(75927).Buffer;Object.defineProperty(t,"__esModule",{value:!0}),t.Account2FA=void 0;let i=r(67562),o=r(39022),s=r(9626),a=r(49722),c=r(29529),u=r(82512),l=r(78600),{addKey:d,deleteKey:f,deployContract:h,fullAccessKey:p,functionCall:y,functionCallAccessKey:g}=s.actionCreators;class m extends c.AccountMultisig{sendCode;getCode;verifyCode;onConfirmResult;helperUrl="https://helper.testnet.near.org";constructor(e,t,r){super(e,t,r),this.helperUrl=r.helperUrl||this.helperUrl,this.storage=r.storage,this.sendCode=r.sendCode||this.sendCodeDefault,this.getCode=r.getCode||this.getCodeDefault,this.verifyCode=r.verifyCode||this.verifyCodeDefault,this.onConfirmResult=r.onConfirmResult}async signAndSendTransaction({receiverId:e,actions:t}){await super.signAndSendTransaction({receiverId:e,actions:t}),await this.sendCode();let r=await this.promptAndVerify();return this.onConfirmResult&&await this.onConfirmResult(r),r}async deployMultisig(e){let{accountId:t}=this,r=(await this.getRecoveryMethods()).data.filter(({kind:e,publicKey:t})=>("phrase"===e||"ledger"===e)&&null!==t).map(e=>e.publicKey),i=(await this.getAccessKeys()).filter(({public_key:e,access_key:{permission:t}})=>"FullAccess"===t&&!r.includes(e)).map(e=>e.public_key).map(b),s=b((await this.postSignedJson("/2fa/getAccessKey",{accountId:t})).publicKey),c=n.from(JSON.stringify({num_confirmations:2})),p=[...i.map(e=>f(e)),...i.map(e=>d(e,g(t,u.MULTISIG_CHANGE_METHODS,null))),d(s,g(t,u.MULTISIG_CONFIRM_METHODS,null)),h(e)],m=p.concat(y("new",c,u.MULTISIG_GAS,u.MULTISIG_DEPOSIT));a.Logger.log("deploying multisig contract for",t);let{stateStatus:v}=await this.checkMultisigCodeAndStateStatus(e);switch(v){case l.MultisigStateStatus.STATE_NOT_INITIALIZED:return await super.signAndSendTransactionWithAccount(t,m);case l.MultisigStateStatus.VALID_STATE:return await super.signAndSendTransactionWithAccount(t,p);case l.MultisigStateStatus.INVALID_STATE:throw new o.TypedError(`Can not deploy a contract to account ${this.accountId} on network ${this.connection.networkId}, the account has existing state.`,"ContractHasExistingState");default:throw new o.TypedError(`Can not deploy a contract to account ${this.accountId} on network ${this.connection.networkId}, the account state could not be verified.`,"ContractStateUnknown")}}async disableWithFAK({contractBytes:e,cleanupContractBytes:t}){let r=[];t&&(await this.deleteAllRequests().catch(e=>e),r=await this.get2faDisableCleanupActions(t));let n=[...r,...await this.get2faDisableKeyConversionActions(),h(e)],i=await this.findAccessKey(this.accountId,n);if(i&&i.accessKey&&"FullAccess"!==i.accessKey.permission)throw new o.TypedError("No full access key found in keystore. Unable to bypass multisig","NoFAKFound");return this.signAndSendTransactionWithAccount(this.accountId,n)}async get2faDisableCleanupActions(e){let t=await this.viewState("").catch(e=>{let t=e.cause&&e.cause.name;if("NO_CONTRACT_CODE"==t)return[];throw"TOO_LARGE_CONTRACT_STATE"==t?new o.TypedError(`Can not deploy a contract to account ${this.accountId} on network ${this.connection.networkId}, the account has existing state.`,"ContractHasExistingState"):e}),r=t.map(({key:e})=>e.toString("base64"));return t.length?[h(e),y("clean",{keys:r},u.MULTISIG_GAS,0n)]:[]}async get2faDisableKeyConversionActions(){let{accountId:e}=this,t=(await this.getAccessKeys()).filter(({access_key:e})=>"FullAccess"!==e.permission).filter(({access_key:t})=>{let r=t.permission.FunctionCall;return r.receiver_id===e&&4===r.method_names.length&&r.method_names.includes("add_request_and_confirm")});return[f(i.PublicKey.from((await this.postSignedJson("/2fa/getAccessKey",{accountId:e})).publicKey)),...t.map(({public_key:e})=>f(i.PublicKey.from(e))),...t.map(({public_key:e})=>d(i.PublicKey.from(e),p()))]}async disable(e,t){let r;let{stateStatus:n}=await this.checkMultisigCodeAndStateStatus();if(n!==l.MultisigStateStatus.VALID_STATE&&n!==l.MultisigStateStatus.STATE_NOT_INITIALIZED)throw new o.TypedError(`Can not deploy a contract to account ${this.accountId} on network ${this.connection.networkId}, the account state could not be verified.`,"ContractStateUnknown");await this.deleteAllRequests().catch(e=>r=e);let i=[...await this.get2faDisableCleanupActions(t).catch(e=>{if("ContractHasExistingState"===e.type)throw r||e;throw e}),...await this.get2faDisableKeyConversionActions(),h(e)];return a.Logger.log("disabling 2fa for",this.accountId),await this.signAndSendTransaction({receiverId:this.accountId,actions:i})}async sendCodeDefault(){let{accountId:e}=this,{requestId:t}
37=this.getRequest(),r=await this.get2faMethod();return await this.postSignedJson("/2fa/send",{accountId:e,method:r,requestId:t}),t}async getCodeDefault(){throw Error('There is no getCode callback provided. Please provide your own in AccountMultisig constructor options. It has a parameter method where method.kind is "email" or "phone".')}async promptAndVerify(){let e=await this.get2faMethod(),t=await this.getCode(e);try{return await this.verifyCode(t)}catch(e){if(a.Logger.warn("Error validating security code:",e),e.toString().includes("invalid 2fa code provided")||e.toString().includes("2fa code not valid"))return await this.promptAndVerify();throw e}}async verifyCodeDefault(e){let{accountId:t}=this,r=this.getRequest();if(!r)throw Error("no request pending");let{requestId:n}=r;return await this.postSignedJson("/2fa/verify",{accountId:t,securityCode:e,requestId:n})}async getRecoveryMethods(){let{accountId:e}=this;return{accountId:e,data:await this.postSignedJson("/account/recoveryMethods",{accountId:e})}}async get2faMethod(){let{data:e}=await this.getRecoveryMethods();if(e&&e.length&&(e=e.find(e=>0===e.kind.indexOf("2fa-"))),!e)return null;let{kind:t,detail:r}=e;return{kind:t,detail:r}}async signatureFor(){let{accountId:e}=this,t=(await this.connection.provider.block({finality:"final"})).header.height.toString(),r=await this.connection.signer.signMessage(n.from(t),e,this.connection.networkId);return{blockNumber:t,blockNumberSignature:n.from(r.signature).toString("base64")}}async postSignedJson(e,t){return await fetch(this.helperUrl+e,{body:JSON.stringify({...t,...await this.signatureFor()}),method:"POST"})}}t.Account2FA=m;let b=e=>i.PublicKey.from(e)},53135:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.UrlAccountCreator=t.LocalAccountCreator=t.AccountCreator=void 0;class r{}t.AccountCreator=r;class n extends r{masterAccount;initialBalance;constructor(e,t){super(),this.masterAccount=e,this.initialBalance=t}async createAccount(e,t){await this.masterAccount.createAccount(e,t,this.initialBalance)}}t.LocalAccountCreator=n;class i extends r{connection;helperUrl;constructor(e,t){super(),this.connection=e,this.helperUrl=t}async createAccount(e,t){await fetch(`${this.helperUrl}/account`,{body:JSON.stringify({newAccountId:e,newAccountPublicKey:t.toString()}),method:"POST"})}}t.UrlAccountCreator=i},29529:(e,t,r)=>{"use strict";var n,i=r(75927).Buffer;Object.defineProperty(t,"__esModule",{value:!0}),t.AccountMultisig=void 0;let o=r(9626),s=r(49722),a=r(32886),c=r(82512),u=r(78600),{deployContract:l,functionCall:d}=o.actionCreators;!function(e){e[e.INVALID_CODE=0]="INVALID_CODE",e[e.VALID_CODE=1]="VALID_CODE",e[e.UNKNOWN_CODE=2]="UNKNOWN_CODE"}(n||(n={}));let f={[c.MULTISIG_STORAGE_KEY]:null};class h extends a.Account{storage;onAddRequestResult;constructor(e,t,r){super(e,t),this.storage=r.storage,this.onAddRequestResult=r.onAddRequestResult}async signAndSendTransactionWithAccount(e,t){return super.signAndSendTransaction({receiverId:e,actions:t})}async signAndSendTransaction({receiverId:e,actions:t}){let r;let{accountId:n}=this,o=i.from(JSON.stringify({request:{receiver_id:e,actions:y(t,n,e)}}));try{r=await super.signAndSendTransaction({receiverId:n,actions:[d("add_request_and_confirm",o,c.MULTISIG_GAS,c.MULTISIG_DEPOSIT)]})}catch(r){if(r.toString().includes("Account has too many active requests. Confirm or delete some"))return await this.deleteUnconfirmedRequests(),await this.signAndSendTransaction({receiverId:e,actions:t});throw r}if(!r.status)throw Error("Request failed");let s={...r.status};if(!s.SuccessValue||"string"!=typeof s.SuccessValue)throw Error("Request failed");return this.setRequest({accountId:n,actions:t,requestId:parseInt(i.from(s.SuccessValue,"base64").toString("ascii"),10)}),this.onAddRequestResult&&await this.onAddRequestResult(r),this.deleteUnconfirmedRequests(),r}async checkMultisigCodeAndStateStatus(e){let t=0xffffffff,r=e?n.UNKNOWN_CODE:n.VALID_CODE;try{return e?await super.signAndSendTransaction({receiverId:this.accountId,actions:[l(e),d("delete_request",{request_id:t},c.MULTISIG_GAS,c.MULTISIG_DEPOSIT)]}):await this.deleteRequest(t),{codeStatus:n.VALID_CODE,stateStatus:u.MultisigStateStatus.VALID_STATE}}catch(e){if(new RegExp(u.MultisigDeleteRequestRejectionError.CANNOT_DESERIALIZE_STATE).test(e&&e.kind&&e.kind.ExecutionError))return{codeStatus:r,stateStatus:u.MultisigStateStatus.INVALID_STATE};if(new RegExp(u.MultisigDeleteRequestRejectionError.MULTISIG_NOT_INITIALIZED).test(e&&e.kind&&e.kind.ExecutionError))return{codeStatus:r,stateStatus:u.MultisigStateStatus.STATE_NOT_INITIALIZED};if(new RegExp(u.MultisigDeleteRequestRejectionError.NO_SUCH_REQUEST).test(e&&e.kind&&e.kind.ExecutionError))return{codeStatus:r,stateStatus:u.MultisigStateStatus.VALID_STATE};if(new RegExp(u.MultisigDeleteRequestRejectionError.METHOD_NOT_FOUND).test(e&&e.message))return{codeStatus:n.INVALID_CODE,stateStatus:u.MultisigStateStatus.UNKNOWN_STATE};throw e}}deleteRequest(e){return super.signAndSendTransaction({receiverId:this.accountId,actions:[d("delete_request",{request_id:e},c.MULTISIG_GAS,c.MULTISIG_DEPOSIT)]})}async deleteAllRequests(){let e=await this.getRequestIds();e.length&&await Promise.all(e.map(e=>this.deleteRequest(e)))}async deleteUnconfirmedRequests(){let e=await this.getRequestIds(),{requestId:t}
37=this.getRequest();for(let r of e)if(r!=t)try{await super.signAndSendTransaction({receiverId:this.accountId,actions:[d("delete_request",{request_id:r},c.MULTISIG_GAS,c.MULTISIG_DEPOSIT)]})}catch(e){s.Logger.warn("Attempt to delete an earlier request before 15 minutes failed. Will try again.")}}async getRequestIds(){return this.viewFunction({contractId:this.accountId,methodName:"list_request_ids"})}getRequest(){return this.storage?JSON.parse(this.storage.getItem(c.MULTISIG_STORAGE_KEY)||"{}"):f[c.MULTISIG_STORAGE_KEY]}setRequest(e){if(this.storage)return this.storage.setItem(c.MULTISIG_STORAGE_KEY,JSON.stringify(e));f[c.MULTISIG_STORAGE_KEY]=e}}t.AccountMultisig=h;let p=e=>e.toString().replace("ed25519:",""),y=(e,t,r)=>e.map(e=>{let n=e.enum,{gas:o,publicKey:s,methodName:a,args:u,deposit:l,accessKey:d,code:f}=e[n],h={type:n[0].toUpperCase()+n.substr(1),gas:o&&o.toString()||void 0,public_key:s&&p(s)||void 0,method_name:a,args:u&&i.from(u).toString("base64")||void 0,code:f&&i.from(f).toString("base64")||void 0,amount:l&&l.toString()||void 0,deposit:l&&l.toString()||"0",permission:void 0};if(d&&(r===t&&"fullAccess"!==d.permission.enum&&(h.permission={receiver_id:t,allowance:c.MULTISIG_ALLOWANCE.toString(),method_names:c.MULTISIG_CHANGE_METHODS}),"functionCall"===d.permission.enum)){let{receiverId:e,methodNames:t,allowance:r}=d.permission.functionCall;h.permission={receiver_id:e,allowance:r&&r.toString()||void 0,method_names:t}}return h})},98643:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Connection=void 0;let n=r(56636),i=r(34089);function o(e){switch(e.type){case void 0:return e;case"JsonRpcProvider":return new i.JsonRpcProvider({...e.args});case"FailoverRpcProvider":{let t=(e?.args||[]).map(e=>new i.JsonRpcProvider(e));return new i.FailoverRpcProvider(t)}default:throw Error(`Unknown provider type ${e.type}`)}}function s(e){switch(e.type){case void 0:return e;case"InMemorySigner":return new n.InMemorySigner(e.keyStore);default:throw Error(`Unknown signer type ${e.type}`)}}class a{networkId;provider;signer;jsvmAccountId;constructor(e,t,r,n){this.networkId=e,this.provider=t,this.signer=r,this.jsvmAccountId=n}getConnection(){return this}static fromConfig(e){let t=o(e.provider),r=s(e.signer);return new a(e.networkId,t,r,e.jsvmAccountId)}}t.Connection=a},82512:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.MULTISIG_CONFIRM_METHODS=t.MULTISIG_CHANGE_METHODS=t.MULTISIG_DEPOSIT=t.MULTISIG_GAS=t.MULTISIG_ALLOWANCE=t.MULTISIG_STORAGE_KEY=void 0;let n=r(49722);t.MULTISIG_STORAGE_KEY="__multisigRequest",t.MULTISIG_ALLOWANCE=BigInt((0,n.parseNearAmount)("1")),t.MULTISIG_GAS=100000000000000n,t.MULTISIG_DEPOSIT=0n,t.MULTISIG_CHANGE_METHODS=["add_request","add_request_and_confirm","delete_request","confirm"],t.MULTISIG_CONFIRM_METHODS=["confirm"]},249:function(e,t,r){"use strict";var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.Contract=void 0;let i=r(49722),o=r(39022),s=r(13626),a=n(r(5344)),c=n(r(29905)),u=r(37600),l=r(32886),d=r(36534),f=r(75164);function h(e,t){return({[e]:(...e)=>t(...e)})[e]}function p(e,t,r){if(!g(e))return;if(t.params&&t.params.serialization_type!==u.AbiSerializationType.Json)throw new d.UnsupportedSerializationError(t.name,t.params.serialization_type);if(t.result&&t.result.serialization_type!==u.AbiSerializationType.Json)throw new d.UnsupportedSerializationError(t.name,t.result.serialization_type);let n=t.params?.args||[];for(let t of n){let n=e[t.name],i=t.type_schema;i.definitions=r.body.root_schema.definitions;let o=(0,a.default)(i);if(!o(n))throw new d.ArgumentSchemaError(t.name,o.errors)}for(let t of Object.keys(e))if(!n.find(e=>e.name===t))throw new d.UnknownArgumentError(t,n.map(e=>e.name))}let y=e=>e&&void 0!==e.byteLength&&e.byteLength===e.length,g=e=>"[object Object]"===Object.prototype.toString.call(e);class m{account;connection;contractId;lve;constructor(e,t,r){this.connection=e.getConnection(),e instanceof l.Account&&((0,c.default)("new Contract(account, contractId, options)")("use `new Contract(connection, contractId, options)` instead"),this.account=e),this.contractId=t,this.lve=new s.LocalViewExecution(e);let{viewMethods:n=[],changeMethods:a=[],abi:m,useLocalViewExecution:b}=r,v=n.map(e=>({name:e,abi:null})),w=a.map(e=>({name:e,abi:null}));if(m){if(v.length>0||w.length>0)throw new d.ConflictingOptions;v=m.body.functions.filter(e=>e.kind===u.AbiFunctionKind.View).map(e=>({name:e.name,abi:e})),w=m.body.functions.filter(e=>e.kind===u.AbiFunctionKind.Call).map(e=>({name:e.name,abi:e}))}v.forEach(({name:e,abi:t})=>{Object.defineProperty(this,e,{writable:!1,enumerable:!0,value:h(e,async(r={},n={},...s)=>{if(s.length||!(g(r)||y(r))||!g(n))throw new o.PositionalArgsError;if(t&&p(r,t,m),b)try{return await this.lve.viewFunction({contractId:this.contractId,methodName:e,args:r,...n})}
37catch(e){i.Logger.warn(`Local view execution failed with: "${e.message}"`),i.Logger.warn("Fallback to normal RPC call")}return this.account?this.account.viewFunction({contractId:this.contractId,methodName:e,args:r,...n}):(0,f.viewFunction)(this.connection,{contractId:this.contractId,methodName:e,args:r,...n})})})}),w.forEach(({name:e,abi:t})=>{Object.defineProperty(this,e,{writable:!1,enumerable:!0,value:h(e,async(...r)=>{if(r.length&&(r.length>3||!(g(r[0])||y(r[0]))))throw new o.PositionalArgsError;return(r.length>1||!(r[0]&&r[0].args))&&((0,c.default)("contract.methodName(args, gas, amount)")("use `contract.methodName({ signerAccount, args, gas?, amount?, callbackUrl?, meta? })` instead"),r[0]={args:r[0],gas:r[1],amount:r[2]}),t&&p(r[0].args,t,m),this._changeMethod({methodName:e,...r[0]})})})})}async _changeMethod({signerAccount:e,args:t,methodName:r,gas:n,amount:o,meta:s,callbackUrl:a}){b({gas:n,amount:o});let c=this.account||e;if(!c)throw Error("signerAccount must be specified");let u=await c.functionCall({contractId:this.contractId,methodName:r,args:t,gas:n,attachedDeposit:o,walletMeta:s,walletCallbackUrl:a});return(0,i.getTransactionLastResult)(u)}}function b(e){let t="number, decimal string or BigInt";for(let r of Object.keys(e)){let n=e[r];if(n&&"bigint"!=typeof n&&isNaN(n))throw new o.ArgumentTypeError(r,t,n)}}t.Contract=m},36534:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ConflictingOptions=t.ArgumentSchemaError=t.UnknownArgumentError=t.UnsupportedSerializationError=void 0;class r extends Error{constructor(e,t){super(`Contract method '${e}' is using an unsupported serialization type ${t}`)}}t.UnsupportedSerializationError=r;class n extends Error{constructor(e,t){super(`Unrecognized argument '${e}', expected '${JSON.stringify(t)}'`)}}t.UnknownArgumentError=n;class i extends Error{constructor(e,t){super(`Argument '${e}' does not conform to the specified ABI schema: '${JSON.stringify(t)}'`)}}t.ArgumentSchemaError=i;class o extends Error{constructor(){super("Conflicting contract method options have been passed. You can either specify ABI or a list of view/call methods.")}}t.ConflictingOptions=o},74456:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.MultisigStateStatus=t.MultisigDeleteRequestRejectionError=t.UnsupportedSerializationError=t.UnknownArgumentError=t.ConflictingOptions=t.ArgumentSchemaError=t.Contract=t.MULTISIG_CONFIRM_METHODS=t.MULTISIG_CHANGE_METHODS=t.MULTISIG_DEPOSIT=t.MULTISIG_GAS=t.MULTISIG_ALLOWANCE=t.MULTISIG_STORAGE_KEY=t.Connection=t.AccountMultisig=t.UrlAccountCreator=t.LocalAccountCreator=t.AccountCreator=t.Account2FA=t.Account=void 0;var n=r(32886);Object.defineProperty(t,"Account",{enumerable:!0,get:function(){return n.Account}});var i=r(58118);Object.defineProperty(t,"Account2FA",{enumerable:!0,get:function(){return i.Account2FA}});var o=r(53135);Object.defineProperty(t,"AccountCreator",{enumerable:!0,get:function(){return o.AccountCreator}}),Object.defineProperty(t,"LocalAccountCreator",{enumerable:!0,get:function(){return o.LocalAccountCreator}}),Object.defineProperty(t,"UrlAccountCreator",{enumerable:!0,get:function(){return o.UrlAccountCreator}});var s=r(29529);Object.defineProperty(t,"AccountMultisig",{enumerable:!0,get:function(){return s.AccountMultisig}});var a=r(98643);Object.defineProperty(t,"Connection",{enumerable:!0,get:function(){return a.Connection}});var c=r(82512);Object.defineProperty(t,"MULTISIG_STORAGE_KEY",{enumerable:!0,get:function(){return c.MULTISIG_STORAGE_KEY}}),Object.defineProperty(t,"MULTISIG_ALLOWANCE",{enumerable:!0,get:function(){return c.MULTISIG_ALLOWANCE}}),Object.defineProperty(t,"MULTISIG_GAS",{enumerable:!0,get:function(){return c.MULTISIG_GAS}}),Object.defineProperty(t,"MULTISIG_DEPOSIT",{enumerable:!0,get:function(){return c.MULTISIG_DEPOSIT}}),Object.defineProperty(t,"MULTISIG_CHANGE_METHODS",{enumerable:!0,get:function(){return c.MULTISIG_CHANGE_METHODS}}),Object.defineProperty(t,"MULTISIG_CONFIRM_METHODS",{enumerable:!0,get:function(){return c.MULTISIG_CONFIRM_METHODS}});var u=r(249);Object.defineProperty(t,"Contract",{enumerable:!0,get:function(){return u.Contract}});var l=r(36534);Object.defineProperty(t,"ArgumentSchemaError",{enumerable:!0,get:function(){return l.ArgumentSchemaError}}),Object.defineProperty(t,"ConflictingOptions",{enumerable:!0,get:function(){return l.ConflictingOptions}}),Object.defineProperty(t,"UnknownArgumentError",{enumerable:!0,get:function(){return l.UnknownArgumentError}}),Object.defineProperty(t,"UnsupportedSerializationError",{enumerable:!0,get:function(){return l.UnsupportedSerializationError}});var d=r(78600);Object.defineProperty(t,"MultisigDeleteRequestRejectionError",{enumerable:!0,get:function(){return d.MultisigDeleteRequestRejectionError}}),Object.defineProperty(t,"MultisigStateStatus",{enumerable:!0,get:function(){return d.MultisigStateStatus}})},13626:(e,t,r)=>{"use strict";var n=r(75927).Buffer;
37Object.defineProperty(t,"__esModule",{value:!0}),t.LocalViewExecution=void 0;let i=r(49722),o=r(98273),s=r(13462),a=r(75164);class c{connection;storage;constructor(e){this.connection=e.getConnection(),this.storage=new o.Storage}async fetchContractCode(e,t){return(await this.connection.provider.query({request_type:"view_code",account_id:e,...t})).code_base64}async fetchContractState(e,t){return(0,a.viewState)(this.connection,e,"",t)}async fetch(e,t){let r=await this.connection.provider.block(t),n=r.header.hash,i=r.header.height;return{blockHash:n,blockHeight:i,blockTimestamp:r.header.timestamp,contractCode:await this.fetchContractCode(e,t),contractState:await this.fetchContractState(e,t)}}async loadOrFetch(e,t){let r=this.storage.load(t);if(r)return r;let{blockHash:n,...i}=await this.fetch(e,t);return this.storage.save(n,i),i}async viewFunction({contractId:e,methodName:t,args:r={},blockQuery:o={finality:"optimistic"}}){let a=JSON.stringify(r),{contractCode:c,contractState:u,blockHeight:l,blockTimestamp:d}=await this.loadOrFetch(e,o),f=new s.Runtime({contractId:e,contractCode:c,contractState:u,blockHeight:l,blockTimestamp:d,methodArgs:a}),{result:h,logs:p}=await f.execute(t);return p&&(0,i.printTxOutcomeLogs)({contractId:e,logs:p}),JSON.parse(n.from(h).toString())}}t.LocalViewExecution=c},13462:(e,t,r)=>{"use strict";var n=r(75927).Buffer;Object.defineProperty(t,"__esModule",{value:!0}),t.Runtime=void 0;let i=r(75444),o=e=>()=>{throw Error("method not implemented: "+e)},s=e=>()=>{throw Error("method not available for view calls: "+e)};class a{context;wasm;memory;registers;logs;result;constructor({contractCode:e,...t}){this.context=t,this.wasm=this.prepareWASM(n.from(e,"base64")),this.memory=new WebAssembly.Memory({initial:1024,maximum:2048}),this.registers={},this.logs=[],this.result=n.from([])}readUTF16CStr(e){let t=[],r=new Uint16Array(this.memory.buffer),i=Number(e)/2;for(;0!=r[i];)t.push(r[i]),i++;return n.from(Uint16Array.from(t).buffer).toString("ucs2")}readUTF8CStr(e,t){let r=[],i=new Uint8Array(this.memory.buffer),o=Number(t);for(let t=0;t<e&&0!=i[o];t++)r.push(i[o]),o++;return n.from(r).toString("utf8")}storageRead(e,t){let r=n.from(new Uint8Array(this.memory.buffer,Number(t),Number(e))),i=this.context.contractState.filter(e=>0===n.compare(e.key,r)).map(e=>e.value);return 0===i.length?null:i.length>1?i:i[0]}prepareWASM(e){let t=[];if("\0asm"!==e.subarray(0,4).toString("utf8"))throw Error("Invalid magic number");let r=e.readUInt32LE(4);if(1!=r)throw Error("Invalid version: "+r);let i=8;function o(){let t,r=0,n=0;do r|=(127&(t=e[i++]))<<n,n+=7;while(128&t);return r}function s(){let t=1&e[i++];return{initial:o(),max:t?o():null}}function a(){let t=o(),r=e.subarray(i,i+t);return i+=t,r.toString("utf8")}function c(e){let t=[];do{let r=127&e;0!=(e>>=7)&&(r|=128),t.push(r)}while(0!==e);return n.from(t)}function u(e){let t=n.from(e,"utf8");return n.concat([c(t.length),t])}t.push(e.subarray(0,i));do{let r=i,l=e.readUInt8(i);i++;let d=o(),f=i+d;if(5==l)t.push(n.from([5,1,0]));else if(2==l){let r=[],l=o();for(let t=0;t<l;t++){let t=i;a(),a();let n=e.readUInt8(i);i++;let c=!1;switch(n){case 0:o();break;case 1:i++,s();break;case 2:s(),c=!0;break;case 3:i++,i++;break;default:throw Error("Invalid import kind: "+n)}c||r.push(e.subarray(t,i))}let d=n.concat([u("env"),u("memory"),n.from([2]),n.from([0]),c(1)]);r.push(d);let f=n.concat([c(r.length),...r]);t.push(n.concat([n.from([2]),c(f.length),f]))}else if(7==l){let r=[],s=o();for(let t=0;t<s;t++){let t=i;a();let n=e.readUInt8(i);i++,o(),2!==n&&r.push(e.subarray(t,i))}let u=n.concat([c(r.length),...r]);t.push(n.concat([n.from([7]),c(u.length),u]))}else t.push(e.subarray(r,f));i=f}while(i<e.length);return n.concat(t)}getRegisterLength(e){return BigInt(this.registers[e.toString()]?this.registers[e.toString()].length:Number.MAX_SAFE_INTEGER)}readFromRegister(e,t){new Uint8Array(this.memory.buffer).set(this.registers[e.toString()]||n.from([]),Number(t))}getCurrentAccountId(e){this.registers[e.toString()]=n.from(this.context.contractId)}inputMethodArgs(e){this.registers[e.toString()]=n.from(this.context.methodArgs)}getBlockHeight(){return BigInt(this.context.blockHeight)}getBlockTimestamp(){return BigInt(this.context.blockTimestamp)}sha256(e,t,r){let n=new Uint8Array(this.memory.buffer,Number(t),Number(e));this.registers[r.toString()]=(0,i.sha256)(n)}returnValue(e,t){this.result=n.from(new Uint8Array(this.memory.buffer,Number(t),Number(e)))}panic(e){throw Error("panic: "+e)}abort(e,t,r,n){let i=this.readUTF16CStr(e),o=this.readUTF16CStr(t),s=`${i} ${o}:${r}:${n}`;if(!i||!o)throw Error("abort: String encoding is bad UTF-16 sequence.");throw Error("abort: "+s)}appendToLog(e,t){this.logs.push(this.readUTF8CStr(e,t))}readStorage(e,t,r){let n=this.storageRead(e,t);return null==n?0n:(this.registers[r]=n,1n)}hasStorageKey(e,t){return null==this.storageRead(e,t)?0n:1n}getHostImports(){return{register_len:this.getRegisterLength.bind(this),read_register:this.readFromRegister.bind(this),current_account_id:this.getCurrentAccountId.bind(this),input:this.inputMethodArgs.bind(this),block_index:this.getBlockHeight.bind(this),block_timestamp:this.getBlockTimestamp.bind(this),sha256:this.sha256.bind(this),value_return:this.returnValue.bind(this),abort:this.abort.bind(this),log_utf8:this.appendToLog.bind(this),log_utf16:this.appendToLog.bind(this),storage_read:this.readStorage.bind(this),storage_has_key:this.hasStorageKey.bind(this),panic:()=>this.panic("explicit guest panic"),panic_utf8:(e,t)=>
37this.panic(this.readUTF8CStr(e,t)),epoch_height:o("epoch_height"),storage_usage:o("storage_usage"),account_balance:o("account_balance"),account_locked_balance:o("account_locked_balance"),random_seed:o("random_seed"),ripemd160:o("ripemd160"),keccak256:o("keccak256"),keccak512:o("keccak512"),ecrecover:o("ecrecover"),validator_stake:o("validator_stake"),validator_total_stake:o("validator_total_stake"),write_register:s("write_register"),signer_account_id:s("signer_account_id"),signer_account_pk:s("signer_account_pk"),predecessor_account_id:s("predecessor_account_id"),attached_deposit:s("attached_deposit"),prepaid_gas:s("prepaid_gas"),used_gas:s("used_gas"),promise_create:s("promise_create"),promise_then:s("promise_then"),promise_and:s("promise_and"),promise_batch_create:s("promise_batch_create"),promise_batch_then:s("promise_batch_then"),promise_batch_action_create_account:s("promise_batch_action_create_account"),promise_batch_action_deploy_contract:s("promise_batch_action_deploy_contract"),promise_batch_action_function_call:s("promise_batch_action_function_call"),promise_batch_action_function_call_weight:s("promise_batch_action_function_call_weight"),promise_batch_action_transfer:s("promise_batch_action_transfer"),promise_batch_action_stake:s("promise_batch_action_stake"),promise_batch_action_add_key_with_full_access:s("promise_batch_action_add_key_with_full_access"),promise_batch_action_add_key_with_function_call:s("promise_batch_action_add_key_with_function_call"),promise_batch_action_delete_key:s("promise_batch_action_delete_key"),promise_batch_action_delete_account:s("promise_batch_action_delete_account"),promise_results_count:s("promise_results_count"),promise_result:s("promise_result"),promise_return:s("promise_return"),storage_write:s("storage_write"),storage_remove:s("storage_remove")}}async execute(e){let t=await WebAssembly.compile(this.wasm),r=(await WebAssembly.instantiate(t,{env:{...this.getHostImports(),memory:this.memory}})).exports[e];if(void 0==r)throw Error(`Contract method '${e}' does not exists in contract ${this.context.contractId} for block id ${this.context.blockHeight}`);return r(),{result:this.result,logs:this.logs}}}t.Runtime=a},98273:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Storage=void 0;let n=r(76677);class i{cache;static MAX_ELEMENTS=100;blockHeights;constructor(e={max:i.MAX_ELEMENTS}){this.cache=new n.LRUMap(e.max),this.blockHeights=new Map}load(e){if(!("blockId"in e))return;let t=e.blockId;return 44==t.toString().length&&(t=this.blockHeights.get(t.toString())),this.cache.get(t)}save(e,{blockHeight:t,blockTimestamp:r,contractCode:n,contractState:i}){this.blockHeights.set(e,t),this.cache.set(t,{blockHeight:t,blockTimestamp:r,contractCode:n,contractState:i})}}t.Storage=i},78600:(e,t)=>{"use strict";var r,n;Object.defineProperty(t,"__esModule",{value:!0}),t.MultisigStateStatus=t.MultisigDeleteRequestRejectionError=void 0,function(e){e.CANNOT_DESERIALIZE_STATE="Cannot deserialize the contract state",e.MULTISIG_NOT_INITIALIZED="Smart contract panicked: Multisig contract should be initialized before usage",e.NO_SUCH_REQUEST="Smart contract panicked: panicked at 'No such request: either wrong number or already confirmed'",e.REQUEST_COOLDOWN_ERROR="Request cannot be deleted immediately after creation.",e.METHOD_NOT_FOUND="Contract method is not found"}(r||(t.MultisigDeleteRequestRejectionError=r={})),function(e){e[e.INVALID_STATE=0]="INVALID_STATE",e[e.STATE_NOT_INITIALIZED=1]="STATE_NOT_INITIALIZED",e[e.VALID_STATE=2]="VALID_STATE",e[e.UNKNOWN_STATE=3]="UNKNOWN_STATE"}(n||(t.MultisigStateStatus=n={}))},75164:(e,t,r)=>{"use strict";var n=r(75927).Buffer;Object.defineProperty(t,"__esModule",{value:!0}),t.viewFunction=t.viewState=t.encodeJSContractArgs=t.validateArgs=void 0;let i=r(39022),o=r(49722);function s(e){return JSON.parse(n.from(e).toString())}function a(e){return n.from(JSON.stringify(e))}function c(e){if((void 0===e.byteLength||e.byteLength!==e.length)&&(Array.isArray(e)||"object"!=typeof e))throw new i.PositionalArgsError}function u(e,t,r){return n.concat([n.from(e),n.from([0]),n.from(t),n.from([0]),n.from(r)])}async function l(e,t,r,i={finality:"optimistic"}){let{values:o}=await e.provider.query({request_type:"view_state",...i,account_id:t,prefix_base64:n.from(r).toString("base64")});return o.map(({key:e,value:t})=>({key:n.from(e,"base64"),value:n.from(t,"base64")}))}async function d(e,{contractId:t,methodName:r,args:i={},parse:l=s,stringify:d=a,jsContract:f=!1,blockQuery:h={finality:"optimistic"}}){let p;c(i),p=f?u(t,r,Object.keys(i).length>0?JSON.stringify(i):""):d(i);let y=await e.provider.query({request_type:"call_function",...h,account_id:f?e.jsvmAccountId:t,method_name:f?"view_js_contract":r,args_base64:p.toString("base64")});return y.logs&&(0,o.printTxOutcomeLogs)({contractId:t,logs:y.logs}),y.result&&y.result.length>0&&l(n.from(y.result))}t.validateArgs=c,t.encodeJSContractArgs=u,t.viewState=l,t.viewFunction=d},96181:(e,t)=>{"use strict";var r;
37Object.defineProperty(t,"__esModule",{value:!0}),t.KeySize=t.KeyType=void 0,function(e){e[e.ED25519=0]="ED25519",e[e.SECP256K1=1]="SECP256K1"}(r||(t.KeyType=r={})),t.KeySize={SECRET_KEY:32,ED25519_PUBLIC_KEY:32,SECP256k1_PUBLIC_KEY:64}},67562:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.PublicKey=t.KeyPairSecp256k1=t.KeyPairEd25519=t.KeyPair=t.KeyType=void 0;var n=r(96181);Object.defineProperty(t,"KeyType",{enumerable:!0,get:function(){return n.KeyType}});var i=r(65196);Object.defineProperty(t,"KeyPair",{enumerable:!0,get:function(){return i.KeyPair}});var o=r(5718);Object.defineProperty(t,"KeyPairEd25519",{enumerable:!0,get:function(){return o.KeyPairEd25519}});var s=r(52553);Object.defineProperty(t,"KeyPairSecp256k1",{enumerable:!0,get:function(){return s.KeyPairSecp256k1}});var a=r(22751);Object.defineProperty(t,"PublicKey",{enumerable:!0,get:function(){return a.PublicKey}})},65196:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.KeyPair=void 0;let n=r(75982),i=r(5718),o=r(52553);class s extends n.KeyPairBase{static fromRandom(e){switch(e.toUpperCase()){case"ED25519":return i.KeyPairEd25519.fromRandom();case"SECP256K1":return o.KeyPairSecp256k1.fromRandom();default:throw Error(`Unknown curve ${e}`)}}static fromString(e){let t=e.split(":");if(2===t.length)switch(t[0].toUpperCase()){case"ED25519":return new i.KeyPairEd25519(t[1]);case"SECP256K1":return new o.KeyPairSecp256k1(t[1]);default:throw Error(`Unknown curve: ${t[0]}`)}else throw Error("Invalid encoded key format, must be <curve>:<encoded key>")}}t.KeyPair=s},75982:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.KeyPairBase=void 0;class r{}t.KeyPairBase=r},5718:function(e,t,r){"use strict";var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.KeyPairEd25519=void 0;let i=r(49722),o=r(80293),s=n(r(52815)),a=r(96181),c=r(75982),u=r(22751);class l extends c.KeyPairBase{publicKey;secretKey;extendedSecretKey;constructor(e){super();let t=new Uint8Array((0,i.baseDecode)(e).slice(0,a.KeySize.SECRET_KEY)),r=o.ed25519.getPublicKey(new Uint8Array(t));this.publicKey=new u.PublicKey({keyType:a.KeyType.ED25519,data:r}),this.secretKey=(0,i.baseEncode)(t),this.extendedSecretKey=e}static fromRandom(){let e=(0,s.default)(a.KeySize.SECRET_KEY),t=o.ed25519.getPublicKey(new Uint8Array(e)),r=new Uint8Array([...e,...t]);return new l((0,i.baseEncode)(r))}sign(e){return{signature:o.ed25519.sign(e,(0,i.baseDecode)(this.secretKey)),publicKey:this.publicKey}}verify(e,t){return this.publicKey.verify(e,t)}toString(){return`ed25519:${this.extendedSecretKey}`}getPublicKey(){return this.publicKey}}t.KeyPairEd25519=l},52553:function(e,t,r){"use strict";var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.KeyPairSecp256k1=void 0;let i=r(49722),o=n(r(52815)),s=n(r(22265)),a=r(96181),c=r(75982),u=r(22751);class l extends c.KeyPairBase{publicKey;secretKey;extendedSecretKey;constructor(e){super();let t=new Uint8Array((0,i.baseDecode)(e).slice(0,a.KeySize.SECRET_KEY)),r=s.default.publicKeyCreate(new Uint8Array(t),!1),n=r.subarray(1,r.length);this.publicKey=new u.PublicKey({keyType:a.KeyType.SECP256K1,data:n}),this.secretKey=(0,i.baseEncode)(t),this.extendedSecretKey=e}static fromRandom(){let e=(0,o.default)(a.KeySize.SECRET_KEY),t=s.default.publicKeyCreate(new Uint8Array(e),!1),r=new Uint8Array([...e,...t.subarray(1,t.length)]);return new l((0,i.baseEncode)(r))}sign(e){let{signature:t,recid:r}=s.default.ecdsaSign(e,(0,i.baseDecode)(this.secretKey));return{signature:new Uint8Array([...t,r]),publicKey:this.publicKey}}verify(e,t){return this.publicKey.verify(e,t)}toString(){return`secp256k1:${this.extendedSecretKey}`}getPublicKey(){return this.publicKey}}t.KeyPairSecp256k1=l},22751:function(e,t,r){"use strict";var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.PublicKey=void 0;let i=r(49722),o=r(80293),s=n(r(22265)),a=r(96181);
37function c(e){switch(e){case a.KeyType.ED25519:return"ed25519";case a.KeyType.SECP256K1:return"secp256k1";default:throw Error(`Unknown key type ${e}`)}}function u(e){switch(e.toLowerCase()){case"ed25519":return a.KeyType.ED25519;case"secp256k1":return a.KeyType.SECP256K1;default:throw Error(`Unknown key type ${e}`)}}function l(e){switch(e){case a.KeyType.ED25519:return"ed25519Key";case a.KeyType.SECP256K1:return"secp256k1Key";default:throw Error(`unknown type ${e}`)}}class d{constructor(e){if(1!==Object.keys(e).length)throw Error("Enum can only take single value");Object.keys(e).map(t=>{this[t]=e[t]})}}class f extends d{enum;ed25519Key;secp256k1Key;constructor(e){let t=l(e.keyType);super({[t]:e}),this[t]=e,this.enum=t}static from(e){return"string"==typeof e?f.fromString(e):e}static fromString(e){let t,r;let n=e.split(":");if(1===n.length)t=n[0];else if(2===n.length)t=n[1],r=u(n[0]);else throw Error("Invalid encoded key format, must be <curve>:<encoded key>");let o=(0,i.baseDecode)(t);r||(r=o.length===a.KeySize.SECP256k1_PUBLIC_KEY?a.KeyType.SECP256K1:a.KeyType.ED25519);let s=r===a.KeyType.ED25519?a.KeySize.ED25519_PUBLIC_KEY:a.KeySize.SECP256k1_PUBLIC_KEY;if(o.length!==s)throw Error(`Invalid public key size (${o.length}), must be ${s}`);return new f({keyType:r,data:o})}toString(){let e=(0,i.baseEncode)(this.data);return`${c(this.keyType)}:${e}`}verify(e,t){let r=this.keyType,n=this.data;switch(r){case a.KeyType.ED25519:return o.ed25519.verify(t,e,n);case a.KeyType.SECP256K1:return s.default.ecdsaVerify(t.subarray(0,64),e,new Uint8Array([4,...n]));default:throw Error(`Unknown key type: ${r}`)}}get keyPair(){return this.ed25519Key||this.secp256k1Key}get keyType(){return this.keyPair.keyType}get data(){return this.keyPair.data}}t.PublicKey=f},15591:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.BrowserLocalStorageKeyStore=void 0;let n=r(67562),i=r(67198),o="near-api-js:keystore:";class s extends i.KeyStore{localStorage;prefix;constructor(e=window.localStorage,t=o){super(),this.localStorage=e,this.prefix=t}async setKey(e,t,r){this.localStorage.setItem(this.storageKeyForSecretKey(e,t),r.toString())}async getKey(e,t){let r=this.localStorage.getItem(this.storageKeyForSecretKey(e,t));return r?n.KeyPair.fromString(r):null}async removeKey(e,t){this.localStorage.removeItem(this.storageKeyForSecretKey(e,t))}async clear(){for(let e of this.storageKeys())e.startsWith(this.prefix)&&this.localStorage.removeItem(e)}async getNetworks(){let e=new Set;for(let t of this.storageKeys())if(t.startsWith(this.prefix)){let r=t.substring(this.prefix.length).split(":");e.add(r[1])}return Array.from(e.values())}async getAccounts(e){let t=[];for(let r of this.storageKeys())if(r.startsWith(this.prefix)){let n=r.substring(this.prefix.length).split(":");n[1]===e&&t.push(n[0])}return t}storageKeyForSecretKey(e,t){return`${this.prefix}${t}:${e}`}*storageKeys(){for(let e=0;e<this.localStorage.length;e++)yield this.localStorage.key(e)}}t.BrowserLocalStorageKeyStore=s},54431:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.MultiContractBrowserLocalStorageKeyStore=t.BrowserLocalStorageKeyStore=void 0;var n=r(15591);Object.defineProperty(t,"BrowserLocalStorageKeyStore",{enumerable:!0,get:function(){return n.BrowserLocalStorageKeyStore}});var i=r(69782);Object.defineProperty(t,"MultiContractBrowserLocalStorageKeyStore",{enumerable:!0,get:function(){return i.MultiContractBrowserLocalStorageKeyStore}})},69782:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.MultiContractBrowserLocalStorageKeyStore=void 0;let n=r(67562),i=r(67198),o="near-api-js:keystore:";class s extends i.MultiContractKeyStore{localStorage;prefix;constructor(e=window.localStorage,t=o){super(),this.localStorage=e,this.prefix=t||o}async setKey(e,t,r,n){this.localStorage.setItem(this.storageKeyForSecretKey(e,t,n),r.toString())}async getKey(e,t,r){let i=this.localStorage.getItem(this.storageKeyForSecretKey(e,t,r));return i?n.KeyPair.fromString(i):null}async removeKey(e,t,r){this.localStorage.removeItem(this.storageKeyForSecretKey(e,t,r))}async clear(){for(let e of this.storageKeys())e.startsWith(this.prefix)&&this.localStorage.removeItem(e)}async getNetworks(){let e=new Set;for(let t of this.storageKeys())if(t.startsWith(this.prefix)){let r=t.substring(this.prefix.length).split(":");e.add(r[1])}return Array.from(e.values())}async getAccounts(e){let t=[];for(let r of this.storageKeys())if(r.startsWith(this.prefix)){let n=r.substring(this.prefix.length).split(":");n[1]===e&&t.push(n[0])}return t}async getContracts(e,t){let r=[];for(let n of this.storageKeys())if(n.startsWith(this.prefix)){let i=n.substring(this.prefix.length).split(":");i[1]===e&&i[0]===t&&r.push(i[2])}return r}storageKeyForSecretKey(e,t,r){return`${this.prefix}${t}:${e}:${r}`}*storageKeys(){for(let e=0;e<this.localStorage.length;e++)yield this.localStorage.key(e)}}t.MultiContractBrowserLocalStorageKeyStore=s},88141:(e,t,r)=>{"use strict";
37Object.defineProperty(t,"__esModule",{value:!0}),t.InMemoryKeyStore=void 0;let n=r(67562),i=r(31468);class o extends i.KeyStore{keys;constructor(){super(),this.keys={}}async setKey(e,t,r){this.keys[`${t}:${e}`]=r.toString()}async getKey(e,t){let r=this.keys[`${t}:${e}`];return r?n.KeyPair.fromString(r):null}async removeKey(e,t){delete this.keys[`${t}:${e}`]}async clear(){this.keys={}}async getNetworks(){let e=new Set;return Object.keys(this.keys).forEach(t=>{let r=t.split(":");e.add(r[1])}),Array.from(e.values())}async getAccounts(e){let t=[];return Object.keys(this.keys).forEach(r=>{let n=r.split(":");n[n.length-1]===e&&t.push(n.slice(0,n.length-1).join(":"))}),t}toString(){return"InMemoryKeyStore"}}t.InMemoryKeyStore=o},67198:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.MultiContractKeyStore=t.MergeKeyStore=t.KeyStore=t.InMemoryKeyStore=void 0;var n=r(88141);Object.defineProperty(t,"InMemoryKeyStore",{enumerable:!0,get:function(){return n.InMemoryKeyStore}});var i=r(31468);Object.defineProperty(t,"KeyStore",{enumerable:!0,get:function(){return i.KeyStore}});var o=r(72716);Object.defineProperty(t,"MergeKeyStore",{enumerable:!0,get:function(){return o.MergeKeyStore}});var s=r(26741);Object.defineProperty(t,"MultiContractKeyStore",{enumerable:!0,get:function(){return s.MultiContractKeyStore}})},31468:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.KeyStore=void 0;class r{}t.KeyStore=r},72716:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.MergeKeyStore=void 0;let n=r(31468);class i extends n.KeyStore{options;keyStores;constructor(e,t={writeKeyStoreIndex:0}){super(),this.options=t,this.keyStores=e}async setKey(e,t,r){await this.keyStores[this.options.writeKeyStoreIndex].setKey(e,t,r)}async getKey(e,t){for(let r of this.keyStores){let n=await r.getKey(e,t);if(n)return n}return null}async removeKey(e,t){for(let r of this.keyStores)await r.removeKey(e,t)}async clear(){for(let e of this.keyStores)await e.clear()}async getNetworks(){let e=new Set;for(let t of this.keyStores)for(let r of(await t.getNetworks()))e.add(r);return Array.from(e)}async getAccounts(e){let t=new Set;for(let r of this.keyStores)for(let n of(await r.getAccounts(e)))t.add(n);return Array.from(t)}toString(){return`MergeKeyStore(${this.keyStores.join(", ")})`}}
37t.MergeKeyStore=i},26741:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.MultiContractKeyStore=void 0;class r{}t.MultiContractKeyStore=r},95227:(e,t)=>{"use strict";async function r(e,t,r,i){let o=e;for(let e=0;e<t;e++){let e=await i();if(e)return e;await n(o),o*=r}return null}function n(e){return new Promise(t=>setTimeout(t,e))}Object.defineProperty(t,"__esModule",{value:!0}),t.exponentialBackoff=void 0,t.exponentialBackoff=r},94407:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.FailoverRpcProvider=void 0;let n=r(49722),i=r(39022),o=r(89714);class s extends o.Provider{providers;currentProviderIndex;constructor(e){if(super(),0===e.length)throw Error("At least one provider must be specified");this.providers=e,this.currentProviderIndex=0}switchToNextProvider(){1!==this.providers.length&&(this.providers.length-1<=this.currentProviderIndex?this.currentProviderIndex=0:this.currentProviderIndex+=1,n.Logger.debug(`Switched to provider at the index ${this.currentProviderIndex}`))}get currentProvider(){let e=this.providers[this.currentProviderIndex];if(!e)throw Error(`Provider wasn't found at index ${this.currentProviderIndex}`);return e}async withBackoff(e){for(let t=0;t<this.providers.length;t++)try{let t=await e(this.currentProvider);if(t)return t}catch(e){console.error(e),this.switchToNextProvider()}throw new i.TypedError(`Exceeded ${this.providers.length} providers to execute request`,"RetriesExceeded")}async status(){return this.withBackoff(e=>e.status())}async sendTransactionUntil(e,t){return this.withBackoff(r=>r.sendTransactionUntil(e,t))}async sendTransaction(e){return this.withBackoff(t=>t.sendTransaction(e))}async sendTransactionAsync(e){return this.withBackoff(t=>t.sendTransactionAsync(e))}async txStatus(e,t,r){return this.withBackoff(n=>n.txStatus(e,t,r))}async txStatusReceipts(e,t,r){return this.withBackoff(n=>n.txStatusReceipts(e,t,r))}async query(e,t){return t?this.withBackoff(r=>r.query(e,t)):this.withBackoff(t=>t.query(e))}async block(e){return this.withBackoff(t=>t.block(e))}async blockChanges(e){return this.withBackoff(t=>t.blockChanges(e))}async chunk(e){return this.withBackoff(t=>t.chunk(e))}async validators(e){return this.withBackoff(t=>t.validators(e))}async experimental_protocolConfig(e){return this.withBackoff(t=>t.experimental_protocolConfig(e))}async lightClientProof(e){return this.withBackoff(t=>t.lightClientProof(e))}async nextLightClientBlock(e){return this.withBackoff(t=>t.nextLightClientBlock(e))}async accessKeyChanges(e,t){return this.withBackoff(r=>r.accessKeyChanges(e,t))}async singleAccessKeyChanges(e,t){return this.withBackoff(r=>r.singleAccessKeyChanges(e,t))}async accountChanges(e,t){return this.withBackoff(r=>r.accountChanges(e,t))}async contractStateChanges(e,t,r=""){return this.withBackoff(n=>n.contractStateChanges(e,t,r))}async contractCodeChanges(e,t){return this.withBackoff(r=>r.contractCodeChanges(e,t))}async gasPrice(e){return this.withBackoff(t=>t.gasPrice(e))}}t.FailoverRpcProvider=s},98516:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.fetchJsonRpc=t.ProviderError=t.retryConfig=void 0;let n=r(39022),i=r(67918),o=1.5,s=10,a=0;function c(e=s,t=o,r=a){return{numOfAttempts:e,timeMultiple:t,startingDelay:r,retry:e=>!!([503,500,408].includes(e.cause)||e.toString().includes("FetchError")||e.toString().includes("Failed to fetch"))}}t.retryConfig=c;class u extends Error{cause;constructor(e,t){super(e,t),t.cause&&(this.cause=t.cause)}}async function l(e,t,r,o){let a=await (0,i.backOff)(async()=>{let n=await fetch(e,{method:"POST",body:JSON.stringify(t),headers:{...r,"Content-Type":"application/json"}}),{ok:i,status:o}=n;if(500===o)throw new u("Internal server error",{cause:o});if(408===o)throw new u("Timeout error",{cause:o});if(400===o)throw new u("Request validation error",{cause:o});if(503===o)throw new u(`${e} unavailable`,{cause:o});if(!i)throw new u(await n.text(),{cause:o});return n},o);if(!a)throw new n.TypedError(`Exceeded ${s} attempts for ${e}.`,"RetriesExceeded");return await a.json()}t.ProviderError=u,t.fetchJsonRpc=l},34089:(e,t,r)=>{"use strict";
37Object.defineProperty(t,"__esModule",{value:!0}),t.Provider=t.FailoverRpcProvider=t.JsonRpcProvider=t.exponentialBackoff=void 0;var n=r(95227);Object.defineProperty(t,"exponentialBackoff",{enumerable:!0,get:function(){return n.exponentialBackoff}});var i=r(78907);Object.defineProperty(t,"JsonRpcProvider",{enumerable:!0,get:function(){return i.JsonRpcProvider}});var o=r(94407);Object.defineProperty(t,"FailoverRpcProvider",{enumerable:!0,get:function(){return o.FailoverRpcProvider}});var s=r(89714);Object.defineProperty(t,"Provider",{enumerable:!0,get:function(){return s.Provider}})},78907:(e,t,r)=>{"use strict";var n=r(75927).Buffer;Object.defineProperty(t,"__esModule",{value:!0}),t.JsonRpcProvider=void 0;let i=r(49722),o=r(39022),s=r(9626),a=r(89714),c=r(98516),u=12,l=500,d=1.5,f=123;class h extends a.Provider{connection;options;constructor(e,t){super(),this.connection=e||{url:""};let r={retries:u,wait:l,backoff:d};this.options=Object.assign({},r,t)}async status(){return this.sendJsonRpc("status",[])}async sendTransactionUntil(e,t){let r=(0,s.encodeTransaction)(e);return this.sendJsonRpc("send_tx",{signed_tx_base64:n.from(r).toString("base64"),wait_until:t})}async sendTransaction(e){return this.sendTransactionUntil(e,"EXECUTED_OPTIMISTIC")}async sendTransactionAsync(e){return this.sendTransactionUntil(e,"NONE")}async txStatus(e,t,r="EXECUTED_OPTIMISTIC"){return"string"==typeof e?this.txStatusString(e,t,r):this.txStatusUint8Array(e,t,r)}async txStatusUint8Array(e,t,r){return this.sendJsonRpc("tx",{tx_hash:(0,i.baseEncode)(e),sender_account_id:t,wait_until:r})}async txStatusString(e,t,r){return this.sendJsonRpc("tx",{tx_hash:e,sender_account_id:t,wait_until:r})}async txStatusReceipts(e,t,r="EXECUTED_OPTIMISTIC"){return"string"==typeof e?this.sendJsonRpc("EXPERIMENTAL_tx_status",{tx_hash:e,sender_account_id:t,wait_until:r}):this.sendJsonRpc("EXPERIMENTAL_tx_status",{tx_hash:(0,i.baseEncode)(e),sender_account_id:t,wait_until:r})}async query(...e){let t;if(1===e.length){let{block_id:r,blockId:n,...i}=e[0];t=await this.sendJsonRpc("query",{...i,block_id:r||n})}else{let[r,n]=e;t=await this.sendJsonRpc("query",[r,n])}if(t&&t.error)throw new o.TypedError(`Querying failed: ${t.error}. 38${JSON.stringify(t,null,2)}`,(0,i.getErrorTypeFromErrorMessage)(t.error,t.error.name));return t}async block(e){let{finality:t}=e,{blockId:r}=e;return this.sendJsonRpc("block",{block_id:r,finality:t})}async blockChanges(e){let{finality:t}=e,{blockId:r}=e;return this.sendJsonRpc("EXPERIMENTAL_changes_in_block",{block_id:r,finality:t})}async chunk(e){return this.sendJsonRpc("chunk",[e])}async validators(e){return this.sendJsonRpc("validators",[e])}async experimental_protocolConfig(e){let{blockId:t,...r}=e;return await this.sendJsonRpc("EXPERIMENTAL_protocol_config",{...r,block_id:t})}async lightClientProof(e){return await this.sendJsonRpc("EXPERIMENTAL_light_client_proof",e)}async nextLightClientBlock(e){return await this.sendJsonRpc("next_light_client_block",e)}async accessKeyChanges(e,t){let{finality:r}=t,{blockId:n}=t;return this.sendJsonRpc("EXPERIMENTAL_changes",{changes_type:"all_access_key_changes",account_ids:e,block_id:n,finality:r})}async singleAccessKeyChanges(e,t){let{finality:r}=t,{blockId:n}=t;return this.sendJsonRpc("EXPERIMENTAL_changes",{changes_type:"single_access_key_changes",keys:e,block_id:n,finality:r})}async accountChanges(e,t){let{finality:r}=t,{blockId:n}=t;return this.sendJsonRpc("EXPERIMENTAL_changes",{changes_type:"account_changes",account_ids:e,block_id:n,finality:r})}async contractStateChanges(e,t,r=""){let{finality:n}=t,{blockId:i}=t;return this.sendJsonRpc("EXPERIMENTAL_changes",{changes_type:"data_changes",account_ids:e,key_prefix_base64:r,block_id:i,finality:n})}async contractCodeChanges(e,t){let{finality:r}=t,{blockId:n}=t;return this.sendJsonRpc("EXPERIMENTAL_changes",{changes_type:"contract_code_changes",account_ids:e,block_id:n,finality:r})}async gasPrice(e){return await this.sendJsonRpc("gas_price",[e])}async sendJsonRpc(e,t){let r={method:e,params:t,id:f++,jsonrpc:"2.0"},n=await (0,c.fetchJsonRpc)(this.connection.url,r,this.connection.headers,(0,c.retryConfig)(this.options.retries,this.options.backoff,this.options.wait));if(n.error){if("object"==typeof n.error.data){if("string"==typeof n.error.data.error_message&&"string"==typeof n.error.data.error_type)throw new o.TypedError(n.error.data.error_message,n.error.data.error_type);throw(0,i.parseRpcError)(n.error.data)}{let e=`[${n.error.code}] ${n.error.message}: ${n.error.data}`,r=(0,i.getErrorTypeFromErrorMessage)(n.error.data,"");if(r)throw new o.TypedError((0,i.formatError)(r,t),r);
38throw new o.TypedError(e,n.error.name)}}if("string"==typeof n.result?.error){let e=(0,i.getErrorTypeFromErrorMessage)(n.result.error,"");if(e)throw new i.ServerError((0,i.formatError)(e,t),e)}let{result:s}=n;if(void 0===s)throw new o.TypedError(`Exceeded ${this.options.retries} attempts for request to ${e}.`,"RetriesExceeded");return s}}t.JsonRpcProvider=h},89714:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Provider=void 0;class r{}t.Provider=r},29360:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.InMemorySigner=void 0;let n=r(67562),i=r(67198),o=r(95642),s=r(35316);class a extends s.Signer{keyStore;constructor(e){super(),this.keyStore=e}static async fromKeyPair(e,t,r){let n=new i.InMemoryKeyStore;return await n.setKey(e,t,r),new a(n)}async createKey(e,t,r){let i=r===n.KeyType.SECP256K1?n.KeyPair.fromRandom("secp256k1"):n.KeyPair.fromRandom("ed25519");return await this.keyStore.setKey(t,e,i),i.getPublicKey()}async getPublicKey(e,t){let r=await this.keyStore.getKey(t,e);return null===r?null:r.getPublicKey()}async signMessage(e,t,r){let n=new Uint8Array((0,o.sha256)(e));if(!t)throw Error("InMemorySigner requires provided account id");let i=await this.keyStore.getKey(r,t);if(null===i)throw Error(`Key for ${t} not found in ${r}`);return i.sign(n)}toString(){return`InMemorySigner(${this.keyStore})`}}t.InMemorySigner=a},56636:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Signer=t.InMemorySigner=void 0;var n=r(29360);Object.defineProperty(t,"InMemorySigner",{enumerable:!0,get:function(){return n.InMemorySigner}});var i=r(35316);Object.defineProperty(t,"Signer",{enumerable:!0,get:function(){return i.Signer}})},35316:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Signer=void 0;class r{}t.Signer=r},67932:(e,t,r)=>{"use strict";var n=r(75927).Buffer;Object.defineProperty(t,"__esModule",{value:!0}),t.actionCreators=t.stringifyJsonOrBytes=void 0;let i=r(48907);function o(){return new i.AccessKey({nonce:0n,permission:new i.AccessKeyPermission({fullAccess:new i.FullAccessPermission})})}function s(e,t,r){return new i.AccessKey({nonce:0n,permission:new i.AccessKeyPermission({functionCall:new i.FunctionCallPermission({receiverId:e,allowance:r,methodNames:t})})})}function a(){return new i.Action({createAccount:new i.CreateAccount})}function c(e){return new i.Action({deployContract:new i.DeployContract({code:e})})}function u(e){return void 0!==e.byteLength&&e.byteLength===e.length?e:n.from(JSON.stringify(e))}function l(e,t,r=0n,n=0n,o=u,s=!1){return new i.Action(s?{functionCall:new i.FunctionCall({methodName:e,args:t,gas:r,deposit:n})}:{functionCall:new i.FunctionCall({methodName:e,args:o(t),gas:r,deposit:n})})}function d(e=0n){return new i.Action({transfer:new i.Transfer({deposit:e})})}function f(e=0n,t){return new i.Action({stake:new i.Stake({stake:e,publicKey:t})})}function h(e,t){return new i.Action({addKey:new i.AddKey({publicKey:e,accessKey:t})})}function p(e){return new i.Action({deleteKey:new i.DeleteKey({publicKey:e})})}function y(e){return new i.Action({deleteAccount:new i.DeleteAccount({beneficiaryId:e})})}function g({delegateAction:e,signature:t}){return new i.Action({signedDelegate:new i.SignedDelegate({delegateAction:e,signature:t})})}t.stringifyJsonOrBytes=u,t.actionCreators={addKey:h,createAccount:a,deleteAccount:y,deleteKey:p,deployContract:c,fullAccessKey:o,functionCall:l,functionCallAccessKey:s,signedDelegate:g,stake:f,transfer:d}},48907:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Action=t.SignedDelegate=t.DeleteAccount=t.DeleteKey=t.AddKey=t.Stake=t.Transfer=t.FunctionCall=t.DeployContract=t.CreateAccount=t.AccessKey=t.AccessKeyPermission=t.FullAccessPermission=t.FunctionCallPermission=void 0;let n=r(39022);class i{allowance;receiverId;methodNames;constructor({allowance:e,receiverId:t,methodNames:r}){this.allowance=e,this.receiverId=t,this.methodNames=r}}t.FunctionCallPermission=i;class o{}t.FullAccessPermission=o;class s extends n.Enum{enum;functionCall;fullAccess;constructor(e){for(let[t,r]of(super(e),Object.entries(e||{})))this[t]=r,this.enum=t}}t.AccessKeyPermission=s;class a{nonce;permission;constructor({nonce:e,permission:t}){this.nonce=e,this.permission=t}}t.AccessKey=a;class c{}t.CreateAccount=c;class u{code;constructor({code:e}
38){this.code=e}}t.DeployContract=u;class l{methodName;args;gas;deposit;constructor({methodName:e,args:t,gas:r,deposit:n}){this.methodName=e,this.args=t,this.gas=r,this.deposit=n}}t.FunctionCall=l;class d{deposit;constructor({deposit:e}){this.deposit=e}}t.Transfer=d;class f{stake;publicKey;constructor({stake:e,publicKey:t}){this.stake=e,this.publicKey=t}}t.Stake=f;class h{publicKey;accessKey;constructor({publicKey:e,accessKey:t}){this.publicKey=e,this.accessKey=t}}t.AddKey=h;class p{publicKey;constructor({publicKey:e}){this.publicKey=e}}t.DeleteKey=p;class y{beneficiaryId;constructor({beneficiaryId:e}){this.beneficiaryId=e}}t.DeleteAccount=y;class g{delegateAction;signature;constructor({delegateAction:e,signature:t}){this.delegateAction=e,this.signature=t}}t.SignedDelegate=g;class m extends n.Enum{enum;createAccount;deployContract;functionCall;transfer;stake;addKey;deleteKey;deleteAccount;signedDelegate;constructor(e){for(let[t,r]of(super(e),Object.entries(e||{})))this[t]=r,this.enum=t}}t.Action=m},63117:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createTransaction=void 0;let n=r(11629);function i(e,t,r,i,o,s){let a="bigint"==typeof i?i:BigInt(i);return new n.Transaction({signerId:e,publicKey:t,nonce:a,receiverId:r,actions:o,blockHash:s})}t.createTransaction=i},4645:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.buildDelegateAction=t.DelegateAction=void 0;let{addKey:n,createAccount:i,deleteAccount:o,deleteKey:s,deployContract:a,functionCall:c,stake:u,transfer:l}=r(67932).actionCreators;class d{senderId;receiverId;actions;nonce;maxBlockHeight;publicKey;constructor({senderId:e,receiverId:t,actions:r,nonce:n,maxBlockHeight:i,publicKey:o}){this.senderId=e,this.receiverId=t,this.actions=r,this.nonce=n,this.maxBlockHeight=i,this.publicKey=o}}function f({actions:e,maxBlockHeight:t,nonce:r,publicKey:f,receiverId:h,senderId:p}){return new d({senderId:p,receiverId:h,actions:e.map(e=>{if(!e.type&&!e.params)return e;switch(e.type){case"AddKey":{let{publicKey:t,accessKey:r}=e.params;return n(t,r)}case"CreateAccount":return i(e.params.createAccount);case"DeleteAccount":return o(e.params.deleteAccount);case"DeleteKey":return s(e.params.publicKey);case"DeployContract":return a(e.params.code);case"FunctionCall":{let{methodName:t,args:r,gas:n,deposit:i}=e.params;return c(t,r,n,i)}case"Stake":return u(e.params.stake,e.params.publicKey);case"Transfer":{let{deposit:t}=e.params;return l(t)}}throw Error("Unrecognized action")}),nonce:r,maxBlockHeight:t,publicKey:f})}t.DelegateAction=d,t.buildDelegateAction=f},9626:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);(!i||("get"in i?!t.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),i(r(67932),t),i(r(48907),t),i(r(63117),t),i(r(4645),t),i(r(11629),t),i(r(48595),t),i(r(49684),t)},12372:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.DelegateActionPrefix=void 0;let r=0x40000000,n={MetaTransactions:366};class i{prefix;constructor({prefix:e}){this.prefix=e}}class o extends i{constructor(e){super({prefix:r+e})}}class s extends o{constructor(){super(n.MetaTransactions)}}t.DelegateActionPrefix=s},11629:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.SCHEMA=t.SignedTransaction=t.Transaction=t.decodeSignedTransaction=t.decodeTransaction=t.encodeTransaction=t.encodeSignedDelegate=t.encodeDelegateAction=void 0;let n=r(33885),i=r(12372);function o(e){return new Uint8Array([...(0,n.serialize)(t.SCHEMA.DelegateActionPrefix,new i.DelegateActionPrefix),...(0,n.serialize)(t.SCHEMA.DelegateAction,e)])}function s(e){return(0,n.serialize)(t.SCHEMA.SignedDelegate,e)}function a(e){let r=e instanceof d?t.SCHEMA.SignedTransaction:t.SCHEMA.Transaction;return(0,n.serialize)(r,e)}function c(e){return new l((0,n.deserialize)(t.SCHEMA.Transaction,e))}function u(e){return new d((0,n.deserialize)(t.SCHEMA.SignedTransaction,e))}t.encodeDelegateAction=o,t.encodeSignedDelegate=s,t.encodeTransaction=a,t.decodeTransaction=c,t.decodeSignedTransaction=u;class l{signerId;publicKey;nonce;receiverId;actions;blockHash;constructor({signerId:e,publicKey:t,nonce:r,receiverId:n,actions:i,blockHash:o}){this.signerId=e,this.publicKey=t,this.nonce=r,this.receiverId=n,this.actions=i,this.blockHash=o}encode(){return a(this)}static decode(e){return c(e)}}t.Transaction=l;class d{transaction;signature;constructor({transaction:e,signature:t}){this.transaction=e,this.signature=t}encode(){return a(this)}static decode(e){return u(e)}}t.SignedTransaction=d,t.SCHEMA=new class{Ed25519Signature={struct:{data:{array:{type:"u8",len:64}}}};Secp256k1Signature={struct:{data:{array:{type:"u8",len:65}}}};Signature={enum:[{struct:{ed25519Signature:this.Ed25519Signature}},{struct:{secp256k1Signature:this.Secp256k1Signature}}]};Ed25519Data={struct:{data:{array:{type:"u8",len:32}}}};Secp256k1Data={struct:{data:{array:{type:"u8",len:64}}}};PublicKey={enum:[{struct:{ed25519Key:this.Ed25519Data}},{struct:{secp256k1Key:this.Secp256k1Data}}]};FunctionCallPermission={struct:{allowance:{option:"u128"},receiverId:"string",methodNames:{array:{type:"string"}}}};FullAccessPermission={struct:{}};AccessKeyPermission={enum:[{struct:{functionCall:this.FunctionCallPermission}},{struct:{fullAccess:this.FullAccessPermission}}]};AccessKey={struct:{nonce:"u64",permission:this.AccessKeyPermission}};CreateAccount={struct:{}};DeployContract={struct:{code:{array:{type:"u8"}}}};FunctionCall={struct:{methodName:"string",args:{array:{type:"u8"}},gas:"u64",deposit:"u128"}};Transfer={struct:{deposit:"u128"}};Stake={struct:{stake:"u128",publicKey:this.PublicKey}};AddKey={struct:{publicKey:this.PublicKey,accessKey:this.AccessKey}};DeleteKey={struct:{publicKey:this.PublicKey}};DeleteAccount={struct:{beneficiaryId:"string"}};DelegateActionPrefix={struct:{prefix:"u32"}};ClassicActions={enum:[{struct:{createAccount:this.CreateAccount}},{struct:{deployContract:this.DeployContract}},{struct:{functionCall:this.FunctionCall}},{struct:{transfer:this.Transfer}},{struct:{stake:this.Stake}},{struct:{addKey:this.AddKey}},{struct:{deleteKey:this.DeleteKey}},{struct:{deleteAccount:this.DeleteAccount}}]};DelegateAction={struct:{senderId:"string",receiverId:"string",actions:{array:{type:this.ClassicActions}},nonce:"u64",maxBlockHeight:"u64",publicKey:this.PublicKey}};SignedDelegate={struct:{delegateAction:this.DelegateAction,signature:this.Signature}};Action={enum:[{struct:{createAccount:this.CreateAccount}},{struct:{deployContract:this.DeployContract}},{struct:{functionCall:this.FunctionCall}},{struct:{transfer:this.Transfer}},{struct:{stake:this.Stake}},{struct:{addKey:this.AddKey}},{struct:{deleteKey:this.DeleteKey}},{struct:{deleteAccount:this.DeleteAccount}},{struct:{signedDelegate:this.SignedDelegate}}]};Transaction={struct:{signerId:"string",publicKey:this.PublicKey,nonce:"u64",receiverId:"string",blockHash:{array:{type:"u8",len:32}},actions:{array:{type:this.Action}}}};SignedTransaction={struct:{transaction:this.Transaction,signature:this.Signature}}}},48595:(e,t,r)=>{"use strict";
38Object.defineProperty(t,"__esModule",{value:!0}),t.signDelegateAction=t.signTransaction=void 0;let n=r(75444),i=r(48907),o=r(63117),s=r(11629),a=r(49684),c=r(67562);async function u(e,t,r,i){let o=(0,s.encodeTransaction)(e),u=new Uint8Array((0,n.sha256)(o)),l=await t.signMessage(o,r,i),d=e.publicKey.ed25519Key?c.KeyType.ED25519:c.KeyType.SECP256K1;return[u,new s.SignedTransaction({transaction:e,signature:new a.Signature({keyType:d,data:l.signature})})]}async function l(...e){if(e[0].constructor===s.Transaction){let[t,r,n,i]=e;return u(t,r,n,i)}{let[t,r,n,i,s,a,c]=e,l=await s.getPublicKey(a,c);return u((0,o.createTransaction)(a,l,t,r,n,i),s,a,c)}}async function d({delegateAction:e,signer:t}){let r=(0,s.encodeDelegateAction)(e),o=await t.sign(r),u=e.publicKey.ed25519Key?c.KeyType.ED25519:c.KeyType.SECP256K1,l=new i.SignedDelegate({delegateAction:e,signature:new a.Signature({keyType:u,data:o})});return{hash:new Uint8Array((0,n.sha256)(r)),signedDelegateAction:l}}t.signTransaction=l,t.signDelegateAction=d},49684:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Signature=void 0;let n=r(67562),i=r(39022);function o(e){switch(e){case n.KeyType.ED25519:return"ed25519Signature";case n.KeyType.SECP256K1:return"secp256k1Signature";default:throw Error(`unknown type ${e}`)}}class s extends i.Enum{enum;ed25519Signature;secp256k1Signature;constructor(e){let t=o(e.keyType);super({[t]:e}),this[t]=e,this.enum=t}get signature(){return this.ed25519Signature||this.secp256k1Signature}get signatureType(){return this.signature.keyType}get data(){return this.signature.data}}t.Signature=s},3495:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Assignable=void 0;class r{constructor(e){Object.keys(e).map(t=>{this[t]=e[t]})}}t.Assignable=r},67891:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Enum=void 0;class r{constructor(e){if(1!==Object.keys(e).length)throw Error("Enum can only take single value");Object.keys(e).map(t=>{this[t]=e[t]})}}t.Enum=r},72789:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ErrorContext=t.TypedError=t.ArgumentTypeError=t.PositionalArgsError=void 0;class r extends Error{constructor(){super("Contract method calls expect named arguments wrapped in object, e.g. { argName1: argValue1, argName2: argValue2 }")}}t.PositionalArgsError=r;class n extends Error{constructor(e,t,r){super(`Expected ${t} for '${e}' argument, but got '${JSON.stringify(r)}'`)}}t.ArgumentTypeError=n;class i extends Error{type;context;constructor(e,t,r){super(e),this.type=t||"UntypedError",this.context=r}}t.TypedError=i;class o{transactionHash;constructor(e){this.transactionHash=e}}t.ErrorContext=o},39022:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);(!i||("get"in i?!t.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),i(r(3495),t),i(r(67891),t),i(r(72789),t),i(r(58322),t)},58322:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.FinalExecutionStatusBasic=t.ExecutionStatusBasic=t.IdType=void 0;var n=r(68190);Object.defineProperty(t,"IdType",{enumerable:!0,get:function(){return n.IdType}});var i=r(98977);Object.defineProperty(t,"ExecutionStatusBasic",{enumerable:!0,get:function(){return i.ExecutionStatusBasic}}),Object.defineProperty(t,"FinalExecutionStatusBasic",{enumerable:!0,get:function(){return i.FinalExecutionStatusBasic}})},68190:(e,t)=>{"use strict";var r;Object.defineProperty(t,"__esModule",{value:!0}),t.IdType=void 0,function(e){e.Transaction="transaction",e.Receipt="receipt"}(r||(t.IdType=r={}))},98977:(e,t)=>{"use strict";var r,n;Object.defineProperty(t,"__esModule",{value:!0}),t.FinalExecutionStatusBasic=t.ExecutionStatusBasic=void 0,function(e){e.Unknown="Unknown",e.Pending="Pending",e.Failure="Failure"}(r||(t.ExecutionStatusBasic=r={})),function(e){e.NotStarted="NotStarted",e.Started="Started",e.Failure="Failure"}(n||(t.FinalExecutionStatusBasic=n={}))},77605:(e,t)=>{"use strict";
38Object.defineProperty(t,"__esModule",{value:!0}),t.DEFAULT_FUNCTION_CALL_GAS=void 0,t.DEFAULT_FUNCTION_CALL_GAS=30000000000000n},8395:function(e,t,r){"use strict";var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.ErrorMessages=void 0;let i=n(r(67352));t.ErrorMessages=i.default},32056:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.parseRpcError=t.parseResultError=t.getErrorTypeFromErrorMessage=t.formatError=t.ServerError=t.ErrorMessages=void 0;var n=r(8395);Object.defineProperty(t,"ErrorMessages",{enumerable:!0,get:function(){return n.ErrorMessages}});var i=r(83359);Object.defineProperty(t,"ServerError",{enumerable:!0,get:function(){return i.ServerError}}),Object.defineProperty(t,"formatError",{enumerable:!0,get:function(){return i.formatError}}),Object.defineProperty(t,"getErrorTypeFromErrorMessage",{enumerable:!0,get:function(){return i.getErrorTypeFromErrorMessage}}),Object.defineProperty(t,"parseResultError",{enumerable:!0,get:function(){return i.parseResultError}}),Object.defineProperty(t,"parseRpcError",{enumerable:!0,get:function(){return i.parseRpcError}})},83359:function(e,t,r){"use strict";var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.getErrorTypeFromErrorMessage=t.formatError=t.parseResultError=t.parseRpcError=t.ServerError=void 0;let i=r(39022),o=n(r(2139)),s=r(73829),a=r(8395),c=n(r(18403)),u={formatNear:()=>(e,t)=>(0,s.formatNearAmount)(t(e))};class l extends i.TypedError{}t.ServerError=l;class d extends l{transaction_outcome}function f(e){let t={},r=y(e,c.default.schema,t,""),n=new l(p(r,t),r);return Object.assign(n,t),n}function h(e){let t=f(e.status.Failure),r=new d;return Object.assign(r,t),r.type=t.type,r.message=t.message,r.transaction_outcome=e.transaction_outcome,r}function p(e,t){return"string"==typeof a.ErrorMessages[e]?o.default.render(a.ErrorMessages[e],{...t,...u}):JSON.stringify(t)}function y(e,t,r,n){let i,o,s;for(let r in t){if(b(e[r]))return e[r];if(m(e[r]))i=e[r],o=t[r],s=r;else{if(!(m(e.kind)&&m(e.kind[r])))continue;i=e.kind[r],o=t[r],s=r}}if(!i||!o)return r.kind=e,n;for(let e of Object.keys(o.props))r[e]=i[e];return y(i,t,r,s)}function g(e,t){switch(!0){case/^account .*? does not exist while viewing$/.test(e):case/^Account .*? doesn't exist$/.test(e):return"AccountDoesNotExist";case/^access key .*? does not exist while viewing$/.test(e):return"AccessKeyDoesNotExist";case/wasm execution failed with error: FunctionCallError\(CompilationError\(CodeDoesNotExist/.test(e):case/wasm execution failed with error: CompilationError\(CodeDoesNotExist/.test(e):return"CodeDoesNotExist";case/wasm execution failed with error: FunctionCallError\(MethodResolveError\(MethodNotFound/.test(e):case/wasm execution failed with error: MethodResolveError\(MethodNotFound/.test(e):return"MethodNotFound";case/Transaction nonce \d+ must be larger than nonce of the used access key \d+/.test(e):return"InvalidNonce";default:return t}}function m(e){return"[object Object]"===Object.prototype.toString.call(e)}function b(e){return"[object String]"===Object.prototype.toString.call(e)}t.parseRpcError=f,t.parseResultError=h,t.formatError=p,t.getErrorTypeFromErrorMessage=g},73829:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.baseDecode=t.baseEncode=t.parseNearAmount=t.formatNearAmount=t.NEAR_NOMINATION=t.NEAR_NOMINATION_EXP=void 0;let n=r(65289);t.NEAR_NOMINATION_EXP=24,t.NEAR_NOMINATION=10n**BigInt(t.NEAR_NOMINATION_EXP);let i=[],o=10n;for(let e=0,r=5n;e<t.NEAR_NOMINATION_EXP;e++,r*=o)i[e]=r;function s(e,r=t.NEAR_NOMINATION_EXP){let n=BigInt(e);if(r!==t.NEAR_NOMINATION_EXP){let e=t.NEAR_NOMINATION_EXP-r-1;e>0&&(n+=i[e])}let o=(e=n.toString()).substring(0,e.length-t.NEAR_NOMINATION_EXP)||"0",a=e.substring(e.length-t.NEAR_NOMINATION_EXP).padStart(t.NEAR_NOMINATION_EXP,"0").substring(0,r);return u(`${d(o)}.${a}`)}function a(e){if(!e)return null;let r=(e=c(e)).split("."),n=r[0],i=r[1]||"";if(r.length>2||i.length>t.NEAR_NOMINATION_EXP)throw Error(`Cannot parse '${e}' as NEAR amount`);return l(n+i.padEnd(t.NEAR_NOMINATION_EXP,"0"))}function c(e){return e.replace(/,/g,"").trim()}function u(e){return e.replace(/\.?0*$/,"")}function l(e){return""===(e=e.replace(/^0+/,""))?"0":e}function d(e){let t=/(-?\d+)(\d{3})/;for(;t.test(e);)e=e.replace(t,"$1,$2");return e}function f(e){if("string"==typeof e){let t=[];for(let r=0;r<e.length;r++)t.push(e.charCodeAt(r));e=new Uint8Array(t)}return n.base58.encode(e)}function h(e){return n.base58.decode(e)}t.formatNearAmount=s,t.parseNearAmount=a,t.baseEncode=f,t.baseDecode=h},49722:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);
38(!i||("get"in i?!t.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),i(r(77605),t),i(r(32056),t),i(r(73829),t),i(r(32589),t),i(r(24759),t),i(r(40525),t),i(r(3161),t),i(r(93477),t)},76202:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ConsoleLogger=void 0;class r{logLevels;constructor(e){this.logLevels=e}isLevelEnabled=e=>this.logLevels.includes(e);print(e,t,...r){switch(e){case"error":case"fatal":return console.error(t,...r);case"warn":return console.warn(t,...r);case"log":return console.log(t,...r);case"debug":case"verbose":return console.debug(t,...r)}}verbose(e,...t){this.isLevelEnabled("verbose")&&this.print("verbose",e,...t)}debug(e,...t){this.isLevelEnabled("debug")&&this.print("debug",e,...t)}log(e,...t){this.isLevelEnabled("log")&&this.print("log",e,...t)}warn(e,...t){this.isLevelEnabled("warn")&&this.print("warn",e,...t)}error(e,...t){this.isLevelEnabled("error")&&this.print("error",e,...t)}fatal(e,...t){this.isLevelEnabled("fatal")&&this.print("fatal",e,...t)}}t.ConsoleLogger=r},3161:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Logger=t.ConsoleLogger=void 0;var n=r(76202);Object.defineProperty(t,"ConsoleLogger",{enumerable:!0,get:function(){return n.ConsoleLogger}});var i=r(10945);Object.defineProperty(t,"Logger",{enumerable:!0,get:function(){return i.Logger}})},10945:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Logger=void 0;let n=r(76202),i=["verbose","debug","log","warn","error","fatal"],o=new n.ConsoleLogger(i);class s{static instanceRef=o;static overrideLogger=e=>{this.instanceRef=e};static error(e,...t){this.instanceRef?.error(e,...t)}static log(e,...t){this.instanceRef?.log(e,...t)}static warn(e,...t){this.instanceRef?.warn(e,...t)}static debug(e,...t){this.instanceRef?.debug?.(e,...t)}static verbose(e,...t){this.instanceRef?.verbose?.(e,...t)}static fatal(e,...t){this.instanceRef?.fatal?.(e,...t)}}t.Logger=s},32589:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.printTxOutcomeLogs=t.printTxOutcomeLogsAndFailures=void 0;let n=r(32056),i=r(3161);function o({contractId:e,outcome:t}){for(let r of[t.transaction_outcome,...t.receipts_outcome].reduce((e,t)=>{let r="object"==typeof t.outcome.status&&"object"==typeof t.outcome.status.Failure;return t.outcome.logs.length||r?e.concat({receiptIds:t.outcome.receipt_ids,logs:t.outcome.logs,failure:"object"==typeof t.outcome.status&&void 0!==t.outcome.status.Failure?(0,n.parseRpcError)(t.outcome.status.Failure):null}):e},[]))i.Logger.log(`Receipt${r.receiptIds.length>1?"s":""}: ${r.receiptIds.join(", ")}`),s({contractId:e,logs:r.logs,prefix:" "}),r.failure&&i.Logger.warn(` Failure [${e}]: ${r.failure}`)}function s({contractId:e,logs:t,prefix:r=""}){for(let n of t)i.Logger.log(`${r}Log [${e}]: ${n}`)}t.printTxOutcomeLogsAndFailures=o,t.printTxOutcomeLogs=s},24759:(e,t,r)=>{"use strict";var n=r(75927).Buffer;function i(e){if("object"==typeof e.status&&"string"==typeof e.status.SuccessValue){let t=n.from(e.status.SuccessValue,"base64").toString();try{return JSON.parse(t)}catch(e){return t}}return null}Object.defineProperty(t,"__esModule",{value:!0}),t.getTransactionLastResult=void 0,t.getTransactionLastResult=i},93477:(e,t)=>{"use strict";function r(e,t){return e<t?-1:e>t?1:0}Object.defineProperty(t,"__esModule",{value:!0}),t.sortBigIntAsc=void 0,t.sortBigIntAsc=r},40525:function(e,t,r){"use strict";var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.diffEpochValidators=t.findSeatPrice=void 0;let i=n(r(29905)),o=r(93477);function s(e,t,r,n){return n&&n<49?a(e,t):(r||((0,i.default)("findSeatPrice(validators, maxNumberOfSeats)")("`use `findSeatPrice(validators, maxNumberOfSeats, minimumStakeRatio)` instead"),r=[1,6250]),c(e,t,r))}function a(e,t){let r=e.map(e=>BigInt(e.stake)).sort(o.sortBigIntAsc),n=BigInt(t),i=r.reduce((e,t)=>
38e+t);if(i<n)throw Error("Stakes are below seats");let s=1n,a=i+1n;for(;s!==a-1n;){let e=(s+a)/2n,t=!1,i=0n;for(let o=0;o<r.length;++o)if((i+=r[o]/e)>=n){s=e,t=!0;break}t||(a=e)}return s}function c(e,t,r){if(2!=r.length)throw Error("minimumStakeRatio should have 2 elements");let n=e.map(e=>BigInt(e.stake)).sort(o.sortBigIntAsc),i=n.reduce((e,t)=>e+t);return e.length<t?i*BigInt(r[0])/BigInt(r[1]):n[0]+1n}function u(e,t){let r=new Map;e.forEach(e=>r.set(e.account_id,e));let n=new Set(t.map(e=>e.account_id));return{newValidators:t.filter(e=>!r.has(e.account_id)),removedValidators:e.filter(e=>!n.has(e.account_id)),changedValidators:t.filter(e=>r.has(e.account_id)&&r.get(e.account_id).stake!=e.stake).map(e=>({current:r.get(e.account_id),next:e}))}}t.findSeatPrice=s,t.diffEpochValidators=u},62837:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.WalletConnection=t.ConnectedWalletAccount=t.Near=void 0;var n=r(16183);Object.defineProperty(t,"Near",{enumerable:!0,get:function(){return n.Near}});var i=r(23570);Object.defineProperty(t,"ConnectedWalletAccount",{enumerable:!0,get:function(){return i.ConnectedWalletAccount}}),Object.defineProperty(t,"WalletConnection",{enumerable:!0,get:function(){return i.WalletConnection}})},16183:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Near=void 0;let n=r(46850);class i{config;connection;accountCreator;constructor(e){if(this.config=e,this.connection=n.Connection.fromConfig({networkId:e.networkId,provider:e.provider||{type:"JsonRpcProvider",args:{url:e.nodeUrl,headers:e.headers}},signer:e.signer||{type:"InMemorySigner",keyStore:e.keyStore||e.deps?.keyStore},jsvmAccountId:e.jsvmAccountId||`jsvm.${e.networkId}`}),e.masterAccount){let t=e.initialBalance?BigInt(e.initialBalance):0x19d971e4fe8401e74000000n;this.accountCreator=new n.LocalAccountCreator(new n.Account(this.connection,e.masterAccount),t)}else e.helperUrl?this.accountCreator=new n.UrlAccountCreator(this.connection,e.helperUrl):this.accountCreator=null}async account(e){return new n.Account(this.connection,e)}async createAccount(e,t){if(!this.accountCreator)throw Error("Must specify account creator, either via masterAccount or helperUrl configuration settings.");return await this.accountCreator.createAccount(e,t),new n.Account(this.connection,e)}}t.Near=i},23570:(e,t,r)=>{"use strict";var n=r(75927).Buffer;Object.defineProperty(t,"__esModule",{value:!0}),t.ConnectedWalletAccount=t.WalletConnection=void 0;let i=r(46850),o=r(475),s=r(26497),a=r(99923),c=r(68220),u="/login/",l="add_request_and_confirm",d="_wallet_auth_key",f="pending_key";class h{_walletBaseUrl;_authDataKey;_keyStore;_authData;_networkId;_near;_connectedAccount;_completeSignInPromise;constructor(e,t){if("string"!=typeof t)throw Error("Please define a clear appKeyPrefix for this WalletConnection instance as the second argument to the constructor");if("undefined"==typeof window)return new Proxy(this,{get:(e,t)=>"isSignedIn"===t?()=>!1:"getAccountId"===t?()=>"":e[t]&&"function"==typeof e[t]?()=>{throw Error("No window found in context, please ensure you are using WalletConnection on the browser")}:e[t]});this._near=e;let r=t+d,n=JSON.parse(window.localStorage.getItem(r));this._networkId=e.config.networkId,this._walletBaseUrl=e.config.walletUrl,t=t||e.config.contractName||"default",this._keyStore=e.connection.signer.keyStore,this._authData=n||{allKeys:[]},this._authDataKey=r,this.isSignedIn()||(this._completeSignInPromise=this._completeSignInWithAccessKey())}isSignedIn(){return!!this._authData.accountId}async isSignedInAsync(){return this._completeSignInPromise&&await this._completeSignInPromise,this.isSignedIn()}getAccountId(){return this._authData.accountId||""}async requestSignInUrl({contractId:e,methodNames:t,successUrl:r,failureUrl:n,keyType:i="ed25519"}){let s=new URL(window.location.href),a=new URL(this._walletBaseUrl+u);if(a.searchParams.set("success_url",r||s.href),a.searchParams.set("failure_url",n||s.href),e){let t=await this._near.account(e);await t.state(),a.searchParams.set("contract_id",e);let r=o.KeyPair.fromRandom(i);a.searchParams.set("public_key",r.getPublicKey().toString()),await this._keyStore.setKey(this._networkId,f+r.getPublicKey(),r)}
38return t&&t.forEach(e=>{a.searchParams.append("methodNames",e)}),a.toString()}async requestSignIn(e){let t=await this.requestSignInUrl(e);window.location.assign(t)}requestSignTransactionsUrl({transactions:e,meta:t,callbackUrl:r}){let i=new URL(window.location.href),o=new URL("sign",this._walletBaseUrl);return o.searchParams.set("transactions",e.map(e=>(0,c.serialize)(a.SCHEMA.Transaction,e)).map(e=>n.from(e).toString("base64")).join(",")),o.searchParams.set("callbackUrl",r||i.href),t&&o.searchParams.set("meta",t),o.toString()}requestSignTransactions(e){let t=this.requestSignTransactionsUrl(e);window.location.assign(t)}async _completeSignInWithAccessKey(){let e=new URL(window.location.href),t=e.searchParams.get("public_key")||"",r=(e.searchParams.get("all_keys")||"").split(","),n=e.searchParams.get("account_id")||"";if(n){let e={accountId:n,allKeys:r};window.localStorage.setItem(this._authDataKey,JSON.stringify(e)),t&&await this._moveKeyFromTempToPermanent(n,t),this._authData=e}e.searchParams.delete("public_key"),e.searchParams.delete("all_keys"),e.searchParams.delete("account_id"),e.searchParams.delete("meta"),e.searchParams.delete("transactionHashes"),window.history.replaceState({},document.title,e.toString())}async _moveKeyFromTempToPermanent(e,t){let r=await this._keyStore.getKey(this._networkId,f+t);await this._keyStore.setKey(this._networkId,e,r),await this._keyStore.removeKey(this._networkId,f+t)}signOut(){this._authData={},window.localStorage.removeItem(this._authDataKey)}account(){return this._connectedAccount||(this._connectedAccount=new p(this,this._near.connection,this._authData.accountId)),this._connectedAccount}}t.WalletConnection=h;class p extends i.Account{walletConnection;constructor(e,t,r){super(t,r),this.walletConnection=e}async signAndSendTransaction({receiverId:e,actions:t,walletMeta:r,walletCallbackUrl:n=window.location.href}){let i=await this.connection.signer.getPublicKey(this.accountId,this.connection.networkId),c=await this.accessKeyForTransaction(e,t,i);if(!c)throw Error(`Cannot find matching key for transaction sent to ${e}`);if(i&&i.toString()===c.public_key)try{return await super.signAndSendTransaction({receiverId:e,actions:t})}catch(r){if("NotEnoughAllowance"===r.type)c=await this.accessKeyForTransaction(e,t);else throw r}let u=await this.connection.provider.block({finality:"final"}),l=(0,s.baseDecode)(u.header.hash),d=o.PublicKey.from(c.public_key),f=c.access_key.nonce+1n,h=(0,a.createTransaction)(this.accountId,d,e,f,t,l);return await this.walletConnection.requestSignTransactions({transactions:[h],meta:r,callbackUrl:n}),new Promise((e,t)=>{setTimeout(()=>{t(Error("Failed to redirect to sign transaction"))},1e3)})}async accessKeyMatchesTransaction(e,t,r){let{access_key:{permission:n}}=e;if("FullAccess"===n)return!0;if(n.FunctionCall){let{receiver_id:e,method_names:i}=n.FunctionCall;if(e===this.accountId&&i.includes(l))return!0;if(e===t){if(1!==r.length)return!1;let[{functionCall:e}]=r;return e&&(!e.deposit||"0"===e.deposit.toString())&&(0===i.length||i.includes(e.methodName))}}return!1}async accessKeyForTransaction(e,t,r){let n=await this.getAccessKeys();if(r){let i=n.find(e=>e.public_key.toString()===r.toString());if(i&&await this.accessKeyMatchesTransaction(i,e,t))return i}let i=this.walletConnection._authData.allKeys;for(let r of n)if(-1!==i.indexOf(r.public_key)&&await this.accessKeyMatchesTransaction(r,e,t))return r;return null}}t.ConnectedWalletAccount=p},84427:(e,t,r)=>{"use strict";var n=r(75927).Buffer;Object.defineProperty(t,"__esModule",{value:!0}),t.Account=void 0;let i=r(475),o=r(30006),s=r(99923),a=r(6141),c=r(26497),u=r(64637),{addKey:l,createAccount:d,deleteAccount:f,deleteKey:h,deployContract:p,fullAccessKey:y,functionCall:g,functionCallAccessKey:m,stake:b,transfer:v}=s.actionCreators,w=12,_=500,E=1.5;class S{connection;accountId;constructor(e,t){this.connection=e,this.accountId=t}getConnection(){return this.connection}async state(){return this.connection.provider.query({request_type:"view_account",account_id:this.accountId,finality:"optimistic"})}async signTransaction(e,t){let r=await this.findAccessKey(e,t);if(!r)throw new a.TypedError(`Can not sign transactions for account ${this.accountId} on network ${this.connection.networkId}, no matching key pair exists for this account`,"KeyNotFound");let{accessKey:n}=r,i=(await this.connection.provider.block({finality:"final"})).header.hash,o=n.nonce+1n;return await (0,s.signTransaction)(e,o,t,(0,c.baseDecode)(i),this.connection.signer,this.accountId,this.connection.networkId)}async signAndSendTransaction({receiverId:e,actions:t,returnError:r}){let n,i;let s=await (0,o.exponentialBackoff)(_,w,E,async()=>{[n,i]=await this.signTransaction(e,t);let r=i.transaction.publicKey;try{return await this.connection.provider.sendTransaction(i)}
38catch(t){if("InvalidNonce"===t.type)return c.Logger.warn(`Retrying transaction ${e}:${(0,c.baseEncode)(n)} with new nonce.`),delete this.accessKeyByPublicKeyCache[r.toString()],null;if("Expired"===t.type)return c.Logger.warn(`Retrying transaction ${e}:${(0,c.baseEncode)(n)} due to expired block hash`),null;throw t.context=new a.ErrorContext((0,c.baseEncode)(n)),t}});if(!s)throw new a.TypedError("nonce retries exceeded for transaction. This usually means there are too many parallel requests with the same access key.","RetriesExceeded");if((0,c.printTxOutcomeLogsAndFailures)({contractId:i.transaction.receiverId,outcome:s}),!r&&"object"==typeof s.status&&"object"==typeof s.status.Failure&&null!==s.status.Failure){if(s.status.Failure.error_message&&s.status.Failure.error_type)throw new a.TypedError(`Transaction ${s.transaction_outcome.id} failed. ${s.status.Failure.error_message}`,s.status.Failure.error_type);throw(0,c.parseResultError)(s)}return s}accessKeyByPublicKeyCache={};async findAccessKey(e,t){let r=await this.connection.signer.getPublicKey(this.accountId,this.connection.networkId);if(!r)throw new a.TypedError(`no matching key pair found in ${this.connection.signer}`,"PublicKeyNotFound");let n=this.accessKeyByPublicKeyCache[r.toString()];if(void 0!==n)return{publicKey:r,accessKey:n};try{let e=await this.connection.provider.query({request_type:"view_access_key",account_id:this.accountId,public_key:r.toString(),finality:"optimistic"}),t={...e,nonce:BigInt(e.nonce||0)};if(this.accessKeyByPublicKeyCache[r.toString()])return{publicKey:r,accessKey:this.accessKeyByPublicKeyCache[r.toString()]};return this.accessKeyByPublicKeyCache[r.toString()]=t,{publicKey:r,accessKey:t}}catch(e){if("AccessKeyDoesNotExist"==e.type)return null;throw e}}async createAndDeployContract(e,t,r,n){let o=y();return await this.signAndSendTransaction({receiverId:e,actions:[d(),v(n),l(i.PublicKey.from(t),o),p(r)]}),new S(this.connection,e)}async sendMoney(e,t){return this.signAndSendTransaction({receiverId:e,actions:[v(t)]})}async createAccount(e,t,r){let n=y();return this.signAndSendTransaction({receiverId:e,actions:[d(),v(r),l(i.PublicKey.from(t),n)]})}async deleteAccount(e){return c.Logger.log("Deleting an account does not automatically transfer NFTs and FTs to the beneficiary address. Ensure to transfer assets before deleting."),this.signAndSendTransaction({receiverId:this.accountId,actions:[f(e)]})}async deployContract(e){return this.signAndSendTransaction({receiverId:this.accountId,actions:[p(e)]})}encodeJSContractArgs(e,t,r){return n.concat([n.from(e),n.from([0]),n.from(t),n.from([0]),n.from(r)])}async functionCall({contractId:e,methodName:t,args:r={},gas:n=c.DEFAULT_FUNCTION_CALL_GAS,attachedDeposit:i,walletMeta:o,walletCallbackUrl:a,stringify:u,jsContract:l}){let d;return this.validateArgs(r),d=l?["call_js_contract",this.encodeJSContractArgs(e,t,JSON.stringify(r)),n,i,null,!0]:[t,r,n,i,void 0===u?s.stringifyJsonOrBytes:u,!1],this.signAndSendTransaction({receiverId:l?this.connection.jsvmAccountId:e,actions:[g.apply(void 0,d)],walletMeta:o,walletCallbackUrl:a})}async addKey(e,t,r,n){let o;return r||(r=[]),Array.isArray(r)||(r=[r]),o=t?m(t,r,n):y(),this.signAndSendTransaction({receiverId:this.accountId,actions:[l(i.PublicKey.from(e),o)]})}async deleteKey(e){return this.signAndSendTransaction({receiverId:this.accountId,actions:[h(i.PublicKey.from(e))]})}async stake(e,t){return this.signAndSendTransaction({receiverId:this.accountId,actions:[b(t,i.PublicKey.from(e))]})}async signedDelegate({actions:e,blockHeightTtl:t,receiverId:r}){let{provider:n,signer:i}=this.connection,{header:o}=await n.block({finality:"final"}),{accessKey:a,publicKey:c}=await this.findAccessKey(null,null),u=(0,s.buildDelegateAction)({actions:e,maxBlockHeight:BigInt(o.height)+BigInt(t),nonce:BigInt(a.nonce)+1n,publicKey:c,receiverId:r,senderId:this.accountId}),{signedDelegateAction:l}=await (0,s.signDelegateAction)({delegateAction:u,signer:{sign:async e=>{let{signature:t}=await i.signMessage(e,u.senderId,this.connection.networkId);return t}}});return l}validateArgs(e){if((void 0===e.byteLength||e.byteLength!==e.length)&&(Array.isArray(e)||"object"!=typeof e))throw new a.PositionalArgsError}async viewFunction(e){return await (0,u.viewFunction)(this.connection,e)}async viewState(e,t={finality:"optimistic"}){return await (0,u.viewState)(this.connection,this.accountId,e,t)}async getAccessKeys(){let e=await this.connection.provider.query({request_type:"view_access_key_list",account_id:this.accountId,finality:"optimistic"});return e?.keys?.map(e=>({...e,access_key:{...e.access_key,nonce:BigInt(e.access_key.nonce)}}))}async getAccountDetails(){return{authorizedApps:(await this.getAccessKeys()).filter(e=>"FullAccess"!==e.access_key.permission).map(e=>{let t=e.access_key.permission;return{contractId:t.FunctionCall.receiver_id,amount:t.FunctionCall.allowance,publicKey:e.public_key}})}}async getAccountBalance(){let e=await this.connection.provider.experimental_protocolConfig({finality:"final"}),t=await this.state(),r=BigInt(e.runtime_config.storage_amount_per_byte),n=BigInt(t.storage_usage)*r,i=BigInt(t.locked),o=BigInt(t.amount)+i,s=o-(i>n?i:n);return{total:o.toString(),stateStaked:n.toString(),staked:i.toString(),available:s.toString()}}async getActiveDelegatedStakeBalance(){let e=await this.connection.provider.block({finality:"final"}
38),t=e.header.hash,r=e.header.epoch_id,{current_validators:n,next_validators:i,current_proposals:o}=await this.connection.provider.validators(r),s=new Set;[...n,...i,...o].forEach(e=>s.add(e.account_id));let a=[...s],c=a.map(e=>this.viewFunction({contractId:e,methodName:"get_account_total_balance",args:{account_id:this.accountId},blockQuery:{blockId:t}})),u=await Promise.allSettled(c);if(u.some(e=>"rejected"===e.status&&"TimeoutError"===e.reason.type))throw Error("Failed to get delegated stake balance");let l=u.reduce((e,t,r)=>{let n=a[r];if("fulfilled"===t.status){let r=BigInt(t.value);if(0n!==r)return{...e,stakedValidators:[...e.stakedValidators,{validatorId:n,amount:r.toString()}],total:e.total+r}}return"rejected"===t.status?{...e,failedValidators:[...e.failedValidators,{validatorId:n,error:t.reason}]}:e},{stakedValidators:[],failedValidators:[],total:0n});return{...l,total:l.total.toString()}}}t.Account=S},99575:(e,t,r)=>{"use strict";var n=r(75927).Buffer;Object.defineProperty(t,"__esModule",{value:!0}),t.Account2FA=void 0;let i=r(475),o=r(6141),s=r(99923),a=r(26497),c=r(1690),u=r(88813),l=r(56097),{addKey:d,deleteKey:f,deployContract:h,fullAccessKey:p,functionCall:y,functionCallAccessKey:g}=s.actionCreators;class m extends c.AccountMultisig{sendCode;getCode;verifyCode;onConfirmResult;helperUrl="https://helper.testnet.near.org";constructor(e,t,r){super(e,t,r),this.helperUrl=r.helperUrl||this.helperUrl,this.storage=r.storage,this.sendCode=r.sendCode||this.sendCodeDefault,this.getCode=r.getCode||this.getCodeDefault,this.verifyCode=r.verifyCode||this.verifyCodeDefault,this.onConfirmResult=r.onConfirmResult}async signAndSendTransaction({receiverId:e,actions:t}){await super.signAndSendTransaction({receiverId:e,actions:t}),await this.sendCode();let r=await this.promptAndVerify();return this.onConfirmResult&&await this.onConfirmResult(r),r}async deployMultisig(e){let{accountId:t}=this,r=(await this.getRecoveryMethods()).data.filter(({kind:e,publicKey:t})=>("phrase"===e||"ledger"===e)&&null!==t).map(e=>e.publicKey),i=(await this.getAccessKeys()).filter(({public_key:e,access_key:{permission:t}})=>"FullAccess"===t&&!r.includes(e)).map(e=>e.public_key).map(b),s=b((await this.postSignedJson("/2fa/getAccessKey",{accountId:t})).publicKey),c=n.from(JSON.stringify({num_confirmations:2})),p=[...i.map(e=>f(e)),...i.map(e=>d(e,g(t,u.MULTISIG_CHANGE_METHODS,null))),d(s,g(t,u.MULTISIG_CONFIRM_METHODS,null)),h(e)],m=p.concat(y("new",c,u.MULTISIG_GAS,u.MULTISIG_DEPOSIT));a.Logger.log("deploying multisig contract for",t);let{stateStatus:v}=await this.checkMultisigCodeAndStateStatus(e);switch(v){case l.MultisigStateStatus.STATE_NOT_INITIALIZED:return await super.signAndSendTransactionWithAccount(t,m);case l.MultisigStateStatus.VALID_STATE:return await super.signAndSendTransactionWithAccount(t,p);case l.MultisigStateStatus.INVALID_STATE:throw new o.TypedError(`Can not deploy a contract to account ${this.accountId} on network ${this.connection.networkId}, the account has existing state.`,"ContractHasExistingState");default:throw new o.TypedError(`Can not deploy a contract to account ${this.accountId} on network ${this.connection.networkId}, the account state could not be verified.`,"ContractStateUnknown")}}async disableWithFAK({contractBytes:e,cleanupContractBytes:t}){let r=[];t&&(await this.deleteAllRequests().catch(e=>e),r=await this.get2faDisableCleanupActions(t));let n=[...r,...await this.get2faDisableKeyConversionActions(),h(e)],i=await this.findAccessKey(this.accountId,n);if(i&&i.accessKey&&"FullAccess"!==i.accessKey.permission)throw new o.TypedError("No full access key found in keystore. Unable to bypass multisig","NoFAKFound");return this.signAndSendTransactionWithAccount(this.accountId,n)}async get2faDisableCleanupActions(e){let t=await this.viewState("").catch(e=>{let t=e.cause&&e.cause.name;if("NO_CONTRACT_CODE"==t)return[];throw"TOO_LARGE_CONTRACT_STATE"==t?new o.TypedError(`Can not deploy a contract to account ${this.accountId} on network ${this.connection.networkId}, the account has existing state.`,"ContractHasExistingState"):e}),r=t.map(({key:e})=>e.toString("base64"));return t.length?[h(e),y("clean",{keys:r},u.MULTISIG_GAS,0n)]:[]}async get2faDisableKeyConversionActions(){let{accountId:e}=this,t=(await this.getAccessKeys()).filter(({access_key:e})=>"FullAccess"!==e.permission).filter(({access_key:t})=>{let r=t.permission.FunctionCall;return r.receiver_id===e&&4===r.method_names.length&&r.method_names.includes("add_request_and_confirm")});return[f(i.PublicKey.from((await this.postSignedJson("/2fa/getAccessKey",{accountId:e})).publicKey)),...t.map(({public_key:e})=>f(i.PublicKey.from(e))),...t.map(({public_key:e})=>d(i.PublicKey.from(e),p()))]}async disable(e,t){let r;let{stateStatus:n}=await this.checkMultisigCodeAndStateStatus();if(n!==l.MultisigStateStatus.VALID_STATE&&n!==l.MultisigStateStatus.STATE_NOT_INITIALIZED)throw new o.TypedError(`Can not deploy a contract to account ${this.accountId} on network ${this.connection.networkId}, the account state could not be verified.`,"ContractStateUnknown");await this.deleteAllRequests().catch(e=>r=e);let i=[...await this.get2faDisableCleanupActions(t).catch(e=>{if("ContractHasExistingState"===e.type)throw r||e;throw e}),...await this.get2faDisableKeyConversionActions(),h(e)];return a.Logger.log("disabling 2fa for",this.accountId),await this.signAndSendTransaction({receiverId:this.accountId,actions:i})}async sendCodeDefault(){let{accountId:e}=this,{requestId:t}
38=this.getRequest(),r=await this.get2faMethod();return await this.postSignedJson("/2fa/send",{accountId:e,method:r,requestId:t}),t}async getCodeDefault(){throw Error('There is no getCode callback provided. Please provide your own in AccountMultisig constructor options. It has a parameter method where method.kind is "email" or "phone".')}async promptAndVerify(){let e=await this.get2faMethod(),t=await this.getCode(e);try{return await this.verifyCode(t)}catch(e){if(a.Logger.warn("Error validating security code:",e),e.toString().includes("invalid 2fa code provided")||e.toString().includes("2fa code not valid"))return await this.promptAndVerify();throw e}}async verifyCodeDefault(e){let{accountId:t}=this,r=this.getRequest();if(!r)throw Error("no request pending");let{requestId:n}=r;return await this.postSignedJson("/2fa/verify",{accountId:t,securityCode:e,requestId:n})}async getRecoveryMethods(){let{accountId:e}=this;return{accountId:e,data:await this.postSignedJson("/account/recoveryMethods",{accountId:e})}}async get2faMethod(){let{data:e}=await this.getRecoveryMethods();if(e&&e.length&&(e=e.find(e=>0===e.kind.indexOf("2fa-"))),!e)return null;let{kind:t,detail:r}=e;return{kind:t,detail:r}}async signatureFor(){let{accountId:e}=this,t=(await this.connection.provider.block({finality:"final"})).header.height.toString(),r=await this.connection.signer.signMessage(n.from(t),e,this.connection.networkId);return{blockNumber:t,blockNumberSignature:n.from(r.signature).toString("base64")}}async postSignedJson(e,t){return await fetch(this.helperUrl+e,{body:JSON.stringify({...t,...await this.signatureFor()}),method:"POST"})}}t.Account2FA=m;let b=e=>i.PublicKey.from(e)},86866:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.UrlAccountCreator=t.LocalAccountCreator=t.AccountCreator=void 0;class r{}t.AccountCreator=r;class n extends r{masterAccount;initialBalance;constructor(e,t){super(),this.masterAccount=e,this.initialBalance=t}async createAccount(e,t){await this.masterAccount.createAccount(e,t,this.initialBalance)}}t.LocalAccountCreator=n;class i extends r{connection;helperUrl;constructor(e,t){super(),this.connection=e,this.helperUrl=t}async createAccount(e,t){await fetch(`${this.helperUrl}/account`,{body:JSON.stringify({newAccountId:e,newAccountPublicKey:t.toString()}),method:"POST"})}}t.UrlAccountCreator=i},1690:(e,t,r)=>{"use strict";var n,i=r(75927).Buffer;Object.defineProperty(t,"__esModule",{value:!0}),t.AccountMultisig=void 0;let o=r(99923),s=r(26497),a=r(84427),c=r(88813),u=r(56097),{deployContract:l,functionCall:d}=o.actionCreators;!function(e){e[e.INVALID_CODE=0]="INVALID_CODE",e[e.VALID_CODE=1]="VALID_CODE",e[e.UNKNOWN_CODE=2]="UNKNOWN_CODE"}(n||(n={}));let f={[c.MULTISIG_STORAGE_KEY]:null};class h extends a.Account{storage;onAddRequestResult;constructor(e,t,r){super(e,t),this.storage=r.storage,this.onAddRequestResult=r.onAddRequestResult}async signAndSendTransactionWithAccount(e,t){return super.signAndSendTransaction({receiverId:e,actions:t})}async signAndSendTransaction({receiverId:e,actions:t}){let r;let{accountId:n}=this,o=i.from(JSON.stringify({request:{receiver_id:e,actions:y(t,n,e)}}));try{r=await super.signAndSendTransaction({receiverId:n,actions:[d("add_request_and_confirm",o,c.MULTISIG_GAS,c.MULTISIG_DEPOSIT)]})}catch(r){if(r.toString().includes("Account has too many active requests. Confirm or delete some"))return await this.deleteUnconfirmedRequests(),await this.signAndSendTransaction({receiverId:e,actions:t});throw r}if(!r.status)throw Error("Request failed");let s={...r.status};if(!s.SuccessValue||"string"!=typeof s.SuccessValue)throw Error("Request failed");return this.setRequest({accountId:n,actions:t,requestId:parseInt(i.from(s.SuccessValue,"base64").toString("ascii"),10)}),this.onAddRequestResult&&await this.onAddRequestResult(r),this.deleteUnconfirmedRequests(),r}async checkMultisigCodeAndStateStatus(e){let t=0xffffffff,r=e?n.UNKNOWN_CODE:n.VALID_CODE;try{return e?await super.signAndSendTransaction({receiverId:this.accountId,actions:[l(e),d("delete_request",{request_id:t},c.MULTISIG_GAS,c.MULTISIG_DEPOSIT)]}):await this.deleteRequest(t),{codeStatus:n.VALID_CODE,stateStatus:u.MultisigStateStatus.VALID_STATE}}catch(e){if(new RegExp(u.MultisigDeleteRequestRejectionError.CANNOT_DESERIALIZE_STATE).test(e&&e.kind&&e.kind.ExecutionError))return{codeStatus:r,stateStatus:u.MultisigStateStatus.INVALID_STATE};if(new RegExp(u.MultisigDeleteRequestRejectionError.MULTISIG_NOT_INITIALIZED).test(e&&e.kind&&e.kind.ExecutionError))return{codeStatus:r,stateStatus:u.MultisigStateStatus.STATE_NOT_INITIALIZED};if(new RegExp(u.MultisigDeleteRequestRejectionError.NO_SUCH_REQUEST).test(e&&e.kind&&e.kind.ExecutionError))return{codeStatus:r,stateStatus:u.MultisigStateStatus.VALID_STATE};if(new RegExp(u.MultisigDeleteRequestRejectionError.METHOD_NOT_FOUND).test(e&&e.message))return{codeStatus:n.INVALID_CODE,stateStatus:u.MultisigStateStatus.UNKNOWN_STATE};throw e}}deleteRequest(e){return super.signAndSendTransaction({receiverId:this.accountId,actions:[d("delete_request",{request_id:e},c.MULTISIG_GAS,c.MULTISIG_DEPOSIT)]})}async deleteAllRequests(){let e=await this.getRequestIds();e.length&&await Promise.all(e.map(e=>this.deleteRequest(e)))}async deleteUnconfirmedRequests(){let e=await this.getRequestIds(),{requestId:t}
38=this.getRequest();for(let r of e)if(r!=t)try{await super.signAndSendTransaction({receiverId:this.accountId,actions:[d("delete_request",{request_id:r},c.MULTISIG_GAS,c.MULTISIG_DEPOSIT)]})}catch(e){s.Logger.warn("Attempt to delete an earlier request before 15 minutes failed. Will try again.")}}async getRequestIds(){return this.viewFunction({contractId:this.accountId,methodName:"list_request_ids"})}getRequest(){return this.storage?JSON.parse(this.storage.getItem(c.MULTISIG_STORAGE_KEY)||"{}"):f[c.MULTISIG_STORAGE_KEY]}setRequest(e){if(this.storage)return this.storage.setItem(c.MULTISIG_STORAGE_KEY,JSON.stringify(e));f[c.MULTISIG_STORAGE_KEY]=e}}t.AccountMultisig=h;let p=e=>e.toString().replace("ed25519:",""),y=(e,t,r)=>e.map(e=>{let n=e.enum,{gas:o,publicKey:s,methodName:a,args:u,deposit:l,accessKey:d,code:f}=e[n],h={type:n[0].toUpperCase()+n.substr(1),gas:o&&o.toString()||void 0,public_key:s&&p(s)||void 0,method_name:a,args:u&&i.from(u).toString("base64")||void 0,code:f&&i.from(f).toString("base64")||void 0,amount:l&&l.toString()||void 0,deposit:l&&l.toString()||"0",permission:void 0};if(d&&(r===t&&"fullAccess"!==d.permission.enum&&(h.permission={receiver_id:t,allowance:c.MULTISIG_ALLOWANCE.toString(),method_names:c.MULTISIG_CHANGE_METHODS}),"functionCall"===d.permission.enum)){let{receiverId:e,methodNames:t,allowance:r}=d.permission.functionCall;h.permission={receiver_id:e,allowance:r&&r.toString()||void 0,method_names:t}}return h})},21360:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Connection=void 0;let n=r(48095),i=r(30006);function o(e){switch(e.type){case void 0:return e;case"JsonRpcProvider":return new i.JsonRpcProvider({...e.args});case"FailoverRpcProvider":{let t=(e?.args||[]).map(e=>new i.JsonRpcProvider(e));return new i.FailoverRpcProvider(t)}default:throw Error(`Unknown provider type ${e.type}`)}}function s(e){switch(e.type){case void 0:return e;case"InMemorySigner":return new n.InMemorySigner(e.keyStore);default:throw Error(`Unknown signer type ${e.type}`)}}class a{networkId;provider;signer;jsvmAccountId;constructor(e,t,r,n){this.networkId=e,this.provider=t,this.signer=r,this.jsvmAccountId=n}getConnection(){return this}static fromConfig(e){let t=o(e.provider),r=s(e.signer);return new a(e.networkId,t,r,e.jsvmAccountId)}}t.Connection=a},88813:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.MULTISIG_CONFIRM_METHODS=t.MULTISIG_CHANGE_METHODS=t.MULTISIG_DEPOSIT=t.MULTISIG_GAS=t.MULTISIG_ALLOWANCE=t.MULTISIG_STORAGE_KEY=void 0;let n=r(26497);t.MULTISIG_STORAGE_KEY="__multisigRequest",t.MULTISIG_ALLOWANCE=BigInt((0,n.parseNearAmount)("1")),t.MULTISIG_GAS=100000000000000n,t.MULTISIG_DEPOSIT=0n,t.MULTISIG_CHANGE_METHODS=["add_request","add_request_and_confirm","delete_request","confirm"],t.MULTISIG_CONFIRM_METHODS=["confirm"]},44118:function(e,t,r){"use strict";var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.Contract=void 0;let i=r(26497),o=r(6141),s=r(54669),a=n(r(5344)),c=n(r(29905)),u=r(37600),l=r(84427),d=r(7977),f=r(64637);function h(e,t){return({[e]:(...e)=>t(...e)})[e]}function p(e,t,r){if(!g(e))return;if(t.params&&t.params.serialization_type!==u.AbiSerializationType.Json)throw new d.UnsupportedSerializationError(t.name,t.params.serialization_type);if(t.result&&t.result.serialization_type!==u.AbiSerializationType.Json)throw new d.UnsupportedSerializationError(t.name,t.result.serialization_type);let n=t.params?.args||[];for(let t of n){let n=e[t.name],i=t.type_schema;i.definitions=r.body.root_schema.definitions;let o=(0,a.default)(i);if(!o(n))throw new d.ArgumentSchemaError(t.name,o.errors)}for(let t of Object.keys(e))if(!n.find(e=>e.name===t))throw new d.UnknownArgumentError(t,n.map(e=>e.name))}let y=e=>e&&void 0!==e.byteLength&&e.byteLength===e.length,g=e=>"[object Object]"===Object.prototype.toString.call(e);class m{account;connection;contractId;lve;constructor(e,t,r){this.connection=e.getConnection(),e instanceof l.Account&&((0,c.default)("new Contract(account, contractId, options)")("use `new Contract(connection, contractId, options)` instead"),this.account=e),this.contractId=t,this.lve=new s.LocalViewExecution(e);let{viewMethods:n=[],changeMethods:a=[],abi:m,useLocalViewExecution:b}=r,v=n.map(e=>({name:e,abi:null})),w=a.map(e=>({name:e,abi:null}));if(m){if(v.length>0||w.length>0)throw new d.ConflictingOptions;v=m.body.functions.filter(e=>e.kind===u.AbiFunctionKind.View).map(e=>({name:e.name,abi:e})),w=m.body.functions.filter(e=>e.kind===u.AbiFunctionKind.Call).map(e=>({name:e.name,abi:e}))}v.forEach(({name:e,abi:t})=>{Object.defineProperty(this,e,{writable:!1,enumerable:!0,value:h(e,async(r={},n={},...s)=>{if(s.length||!(g(r)||y(r))||!g(n))throw new o.PositionalArgsError;if(t&&p(r,t,m),b)try{return await this.lve.viewFunction({contractId:this.contractId,methodName:e,args:r,...n})}
38catch(e){i.Logger.warn(`Local view execution failed with: "${e.message}"`),i.Logger.warn("Fallback to normal RPC call")}return this.account?this.account.viewFunction({contractId:this.contractId,methodName:e,args:r,...n}):(0,f.viewFunction)(this.connection,{contractId:this.contractId,methodName:e,args:r,...n})})})}),w.forEach(({name:e,abi:t})=>{Object.defineProperty(this,e,{writable:!1,enumerable:!0,value:h(e,async(...r)=>{if(r.length&&(r.length>3||!(g(r[0])||y(r[0]))))throw new o.PositionalArgsError;return(r.length>1||!(r[0]&&r[0].args))&&((0,c.default)("contract.methodName(args, gas, amount)")("use `contract.methodName({ signerAccount, args, gas?, amount?, callbackUrl?, meta? })` instead"),r[0]={args:r[0],gas:r[1],amount:r[2]}),t&&p(r[0].args,t,m),this._changeMethod({methodName:e,...r[0]})})})})}async _changeMethod({signerAccount:e,args:t,methodName:r,gas:n,amount:o,meta:s,callbackUrl:a}){b({gas:n,amount:o});let c=this.account||e;if(!c)throw Error("signerAccount must be specified");let u=await c.functionCall({contractId:this.contractId,methodName:r,args:t,gas:n,attachedDeposit:o,walletMeta:s,walletCallbackUrl:a});return(0,i.getTransactionLastResult)(u)}}function b(e){let t="number, decimal string or BigInt";for(let r of Object.keys(e)){let n=e[r];if(n&&"bigint"!=typeof n&&isNaN(n))throw new o.ArgumentTypeError(r,t,n)}}t.Contract=m},7977:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ConflictingOptions=t.ArgumentSchemaError=t.UnknownArgumentError=t.UnsupportedSerializationError=void 0;class r extends Error{constructor(e,t){super(`Contract method '${e}' is using an unsupported serialization type ${t}`)}}t.UnsupportedSerializationError=r;class n extends Error{constructor(e,t){super(`Unrecognized argument '${e}', expected '${JSON.stringify(t)}'`)}}t.UnknownArgumentError=n;class i extends Error{constructor(e,t){super(`Argument '${e}' does not conform to the specified ABI schema: '${JSON.stringify(t)}'`)}}t.ArgumentSchemaError=i;class o extends Error{constructor(){super("Conflicting contract method options have been passed. You can either specify ABI or a list of view/call methods.")}}t.ConflictingOptions=o},46850:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.MultisigStateStatus=t.MultisigDeleteRequestRejectionError=t.UnsupportedSerializationError=t.UnknownArgumentError=t.ConflictingOptions=t.ArgumentSchemaError=t.Contract=t.MULTISIG_CONFIRM_METHODS=t.MULTISIG_CHANGE_METHODS=t.MULTISIG_DEPOSIT=t.MULTISIG_GAS=t.MULTISIG_ALLOWANCE=t.MULTISIG_STORAGE_KEY=t.Connection=t.AccountMultisig=t.UrlAccountCreator=t.LocalAccountCreator=t.AccountCreator=t.Account2FA=t.Account=void 0;var n=r(84427);Object.defineProperty(t,"Account",{enumerable:!0,get:function(){return n.Account}});var i=r(99575);Object.defineProperty(t,"Account2FA",{enumerable:!0,get:function(){return i.Account2FA}});var o=r(86866);Object.defineProperty(t,"AccountCreator",{enumerable:!0,get:function(){return o.AccountCreator}}),Object.defineProperty(t,"LocalAccountCreator",{enumerable:!0,get:function(){return o.LocalAccountCreator}}),Object.defineProperty(t,"UrlAccountCreator",{enumerable:!0,get:function(){return o.UrlAccountCreator}});var s=r(1690);Object.defineProperty(t,"AccountMultisig",{enumerable:!0,get:function(){return s.AccountMultisig}});var a=r(21360);Object.defineProperty(t,"Connection",{enumerable:!0,get:function(){return a.Connection}});var c=r(88813);Object.defineProperty(t,"MULTISIG_STORAGE_KEY",{enumerable:!0,get:function(){return c.MULTISIG_STORAGE_KEY}}),Object.defineProperty(t,"MULTISIG_ALLOWANCE",{enumerable:!0,get:function(){return c.MULTISIG_ALLOWANCE}}),Object.defineProperty(t,"MULTISIG_GAS",{enumerable:!0,get:function(){return c.MULTISIG_GAS}}),Object.defineProperty(t,"MULTISIG_DEPOSIT",{enumerable:!0,get:function(){return c.MULTISIG_DEPOSIT}}),Object.defineProperty(t,"MULTISIG_CHANGE_METHODS",{enumerable:!0,get:function(){return c.MULTISIG_CHANGE_METHODS}}),Object.defineProperty(t,"MULTISIG_CONFIRM_METHODS",{enumerable:!0,get:function(){return c.MULTISIG_CONFIRM_METHODS}});var u=r(44118);Object.defineProperty(t,"Contract",{enumerable:!0,get:function(){return u.Contract}});var l=r(7977);Object.defineProperty(t,"ArgumentSchemaError",{enumerable:!0,get:function(){return l.ArgumentSchemaError}}),Object.defineProperty(t,"ConflictingOptions",{enumerable:!0,get:function(){return l.ConflictingOptions}}),Object.defineProperty(t,"UnknownArgumentError",{enumerable:!0,get:function(){return l.UnknownArgumentError}}),Object.defineProperty(t,"UnsupportedSerializationError",{enumerable:!0,get:function(){return l.UnsupportedSerializationError}});var d=r(56097);Object.defineProperty(t,"MultisigDeleteRequestRejectionError",{enumerable:!0,get:function(){return d.MultisigDeleteRequestRejectionError}}),Object.defineProperty(t,"MultisigStateStatus",{enumerable:!0,get:function(){return d.MultisigStateStatus}})},54669:(e,t,r)=>{"use strict";var n=r(75927).Buffer;
38Object.defineProperty(t,"__esModule",{value:!0}),t.LocalViewExecution=void 0;let i=r(26497),o=r(41410),s=r(49013),a=r(64637);class c{connection;storage;constructor(e){this.connection=e.getConnection(),this.storage=new o.Storage}async fetchContractCode(e,t){return(await this.connection.provider.query({request_type:"view_code",account_id:e,...t})).code_base64}async fetchContractState(e,t){return(0,a.viewState)(this.connection,e,"",t)}async fetch(e,t){let r=await this.connection.provider.block(t),n=r.header.hash,i=r.header.height;return{blockHash:n,blockHeight:i,blockTimestamp:r.header.timestamp,contractCode:await this.fetchContractCode(e,t),contractState:await this.fetchContractState(e,t)}}async loadOrFetch(e,t){let r=this.storage.load(t);if(r)return r;let{blockHash:n,...i}=await this.fetch(e,t);return this.storage.save(n,i),i}async viewFunction({contractId:e,methodName:t,args:r={},blockQuery:o={finality:"optimistic"}}){let a=JSON.stringify(r),{contractCode:c,contractState:u,blockHeight:l,blockTimestamp:d}=await this.loadOrFetch(e,o),f=new s.Runtime({contractId:e,contractCode:c,contractState:u,blockHeight:l,blockTimestamp:d,methodArgs:a}),{result:h,logs:p}=await f.execute(t);return p&&(0,i.printTxOutcomeLogs)({contractId:e,logs:p}),JSON.parse(n.from(h).toString())}}t.LocalViewExecution=c},49013:(e,t,r)=>{"use strict";var n=r(75927).Buffer;Object.defineProperty(t,"__esModule",{value:!0}),t.Runtime=void 0;let i=r(72551),o=e=>()=>{throw Error("method not implemented: "+e)},s=e=>()=>{throw Error("method not available for view calls: "+e)};class a{context;wasm;memory;registers;logs;result;constructor({contractCode:e,...t}){this.context=t,this.wasm=this.prepareWASM(n.from(e,"base64")),this.memory=new WebAssembly.Memory({initial:1024,maximum:2048}),this.registers={},this.logs=[],this.result=n.from([])}readUTF16CStr(e){let t=[],r=new Uint16Array(this.memory.buffer),i=Number(e)/2;for(;0!=r[i];)t.push(r[i]),i++;return n.from(Uint16Array.from(t).buffer).toString("ucs2")}readUTF8CStr(e,t){let r=[],i=new Uint8Array(this.memory.buffer),o=Number(t);for(let t=0;t<e&&0!=i[o];t++)r.push(i[o]),o++;return n.from(r).toString("utf8")}storageRead(e,t){let r=n.from(new Uint8Array(this.memory.buffer,Number(t),Number(e))),i=this.context.contractState.filter(e=>0===n.compare(e.key,r)).map(e=>e.value);return 0===i.length?null:i.length>1?i:i[0]}prepareWASM(e){let t=[];if("\0asm"!==e.subarray(0,4).toString("utf8"))throw Error("Invalid magic number");let r=e.readUInt32LE(4);if(1!=r)throw Error("Invalid version: "+r);let i=8;function o(){let t,r=0,n=0;do r|=(127&(t=e[i++]))<<n,n+=7;while(128&t);return r}function s(){let t=1&e[i++];return{initial:o(),max:t?o():null}}function a(){let t=o(),r=e.subarray(i,i+t);return i+=t,r.toString("utf8")}function c(e){let t=[];do{let r=127&e;0!=(e>>=7)&&(r|=128),t.push(r)}while(0!==e);return n.from(t)}function u(e){let t=n.from(e,"utf8");return n.concat([c(t.length),t])}t.push(e.subarray(0,i));do{let r=i,l=e.readUInt8(i);i++;let d=o(),f=i+d;if(5==l)t.push(n.from([5,1,0]));else if(2==l){let r=[],l=o();for(let t=0;t<l;t++){let t=i;a(),a();let n=e.readUInt8(i);i++;let c=!1;switch(n){case 0:o();break;case 1:i++,s();break;case 2:s(),c=!0;break;case 3:i++,i++;break;default:throw Error("Invalid import kind: "+n)}c||r.push(e.subarray(t,i))}let d=n.concat([u("env"),u("memory"),n.from([2]),n.from([0]),c(1)]);r.push(d);let f=n.concat([c(r.length),...r]);t.push(n.concat([n.from([2]),c(f.length),f]))}else if(7==l){let r=[],s=o();for(let t=0;t<s;t++){let t=i;a();let n=e.readUInt8(i);i++,o(),2!==n&&r.push(e.subarray(t,i))}let u=n.concat([c(r.length),...r]);t.push(n.concat([n.from([7]),c(u.length),u]))}else t.push(e.subarray(r,f));i=f}while(i<e.length);return n.concat(t)}getRegisterLength(e){return BigInt(this.registers[e.toString()]?this.registers[e.toString()].length:Number.MAX_SAFE_INTEGER)}readFromRegister(e,t){new Uint8Array(this.memory.buffer).set(this.registers[e.toString()]||n.from([]),Number(t))}getCurrentAccountId(e){this.registers[e.toString()]=n.from(this.context.contractId)}inputMethodArgs(e){this.registers[e.toString()]=n.from(this.context.methodArgs)}getBlockHeight(){return BigInt(this.context.blockHeight)}getBlockTimestamp(){return BigInt(this.context.blockTimestamp)}sha256(e,t,r){let n=new Uint8Array(this.memory.buffer,Number(t),Number(e));this.registers[r.toString()]=(0,i.sha256)(n)}returnValue(e,t){this.result=n.from(new Uint8Array(this.memory.buffer,Number(t),Number(e)))}panic(e){throw Error("panic: "+e)}abort(e,t,r,n){let i=this.readUTF16CStr(e),o=this.readUTF16CStr(t),s=`${i} ${o}:${r}:${n}`;if(!i||!o)throw Error("abort: String encoding is bad UTF-16 sequence.");throw Error("abort: "+s)}appendToLog(e,t){this.logs.push(this.readUTF8CStr(e,t))}readStorage(e,t,r){let n=this.storageRead(e,t);return null==n?0n:(this.registers[r]=n,1n)}hasStorageKey(e,t){return null==this.storageRead(e,t)?0n:1n}getHostImports(){return{register_len:this.getRegisterLength.bind(this),read_register:this.readFromRegister.bind(this),current_account_id:this.getCurrentAccountId.bind(this),input:this.inputMethodArgs.bind(this),block_index:this.getBlockHeight.bind(this),block_timestamp:this.getBlockTimestamp.bind(this),sha256:this.sha256.bind(this),value_return:this.returnValue.bind(this),abort:this.abort.bind(this),log_utf8:this.appendToLog.bind(this),log_utf16:this.appendToLog.bind(this),storage_read:this.readStorage.bind(this),storage_has_key:this.hasStorageKey.bind(this),panic:()=>this.panic("explicit guest panic"),panic_utf8:(e,t)=>
38this.panic(this.readUTF8CStr(e,t)),epoch_height:o("epoch_height"),storage_usage:o("storage_usage"),account_balance:o("account_balance"),account_locked_balance:o("account_locked_balance"),random_seed:o("random_seed"),ripemd160:o("ripemd160"),keccak256:o("keccak256"),keccak512:o("keccak512"),ecrecover:o("ecrecover"),validator_stake:o("validator_stake"),validator_total_stake:o("validator_total_stake"),write_register:s("write_register"),signer_account_id:s("signer_account_id"),signer_account_pk:s("signer_account_pk"),predecessor_account_id:s("predecessor_account_id"),attached_deposit:s("attached_deposit"),prepaid_gas:s("prepaid_gas"),used_gas:s("used_gas"),promise_create:s("promise_create"),promise_then:s("promise_then"),promise_and:s("promise_and"),promise_batch_create:s("promise_batch_create"),promise_batch_then:s("promise_batch_then"),promise_batch_action_create_account:s("promise_batch_action_create_account"),promise_batch_action_deploy_contract:s("promise_batch_action_deploy_contract"),promise_batch_action_function_call:s("promise_batch_action_function_call"),promise_batch_action_function_call_weight:s("promise_batch_action_function_call_weight"),promise_batch_action_transfer:s("promise_batch_action_transfer"),promise_batch_action_stake:s("promise_batch_action_stake"),promise_batch_action_add_key_with_full_access:s("promise_batch_action_add_key_with_full_access"),promise_batch_action_add_key_with_function_call:s("promise_batch_action_add_key_with_function_call"),promise_batch_action_delete_key:s("promise_batch_action_delete_key"),promise_batch_action_delete_account:s("promise_batch_action_delete_account"),promise_results_count:s("promise_results_count"),promise_result:s("promise_result"),promise_return:s("promise_return"),storage_write:s("storage_write"),storage_remove:s("storage_remove")}}async execute(e){let t=await WebAssembly.compile(this.wasm),r=(await WebAssembly.instantiate(t,{env:{...this.getHostImports(),memory:this.memory}})).exports[e];if(void 0==r)throw Error(`Contract method '${e}' does not exists in contract ${this.context.contractId} for block id ${this.context.blockHeight}`);return r(),{result:this.result,logs:this.logs}}}t.Runtime=a},41410:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Storage=void 0;let n=r(76677);class i{cache;static MAX_ELEMENTS=100;blockHeights;constructor(e={max:i.MAX_ELEMENTS}){this.cache=new n.LRUMap(e.max),this.blockHeights=new Map}load(e){if(!("blockId"in e))return;let t=e.blockId;return 44==t.toString().length&&(t=this.blockHeights.get(t.toString())),this.cache.get(t)}save(e,{blockHeight:t,blockTimestamp:r,contractCode:n,contractState:i}){this.blockHeights.set(e,t),this.cache.set(t,{blockHeight:t,blockTimestamp:r,contractCode:n,contractState:i})}}t.Storage=i},56097:(e,t)=>{"use strict";var r,n;Object.defineProperty(t,"__esModule",{value:!0}),t.MultisigStateStatus=t.MultisigDeleteRequestRejectionError=void 0,function(e){e.CANNOT_DESERIALIZE_STATE="Cannot deserialize the contract state",e.MULTISIG_NOT_INITIALIZED="Smart contract panicked: Multisig contract should be initialized before usage",e.NO_SUCH_REQUEST="Smart contract panicked: panicked at 'No such request: either wrong number or already confirmed'",e.REQUEST_COOLDOWN_ERROR="Request cannot be deleted immediately after creation.",e.METHOD_NOT_FOUND="Contract method is not found"}(r||(t.MultisigDeleteRequestRejectionError=r={})),function(e){e[e.INVALID_STATE=0]="INVALID_STATE",e[e.STATE_NOT_INITIALIZED=1]="STATE_NOT_INITIALIZED",e[e.VALID_STATE=2]="VALID_STATE",e[e.UNKNOWN_STATE=3]="UNKNOWN_STATE"}(n||(t.MultisigStateStatus=n={}))},64637:(e,t,r)=>{"use strict";var n=r(75927).Buffer;Object.defineProperty(t,"__esModule",{value:!0}),t.viewFunction=t.viewState=t.encodeJSContractArgs=t.validateArgs=void 0;let i=r(6141),o=r(26497);function s(e){return JSON.parse(n.from(e).toString())}function a(e){return n.from(JSON.stringify(e))}function c(e){if((void 0===e.byteLength||e.byteLength!==e.length)&&(Array.isArray(e)||"object"!=typeof e))throw new i.PositionalArgsError}function u(e,t,r){return n.concat([n.from(e),n.from([0]),n.from(t),n.from([0]),n.from(r)])}async function l(e,t,r,i={finality:"optimistic"}){let{values:o}=await e.provider.query({request_type:"view_state",...i,account_id:t,prefix_base64:n.from(r).toString("base64")});return o.map(({key:e,value:t})=>({key:n.from(e,"base64"),value:n.from(t,"base64")}))}async function d(e,{contractId:t,methodName:r,args:i={},parse:l=s,stringify:d=a,jsContract:f=!1,blockQuery:h={finality:"optimistic"}}){let p;c(i),p=f?u(t,r,Object.keys(i).length>0?JSON.stringify(i):""):d(i);let y=await e.provider.query({request_type:"call_function",...h,account_id:f?e.jsvmAccountId:t,method_name:f?"view_js_contract":r,args_base64:p.toString("base64")});return y.logs&&(0,o.printTxOutcomeLogs)({contractId:t,logs:y.logs}),y.result&&y.result.length>0&&l(n.from(y.result))}t.validateArgs=c,t.encodeJSContractArgs=u,t.viewState=l,t.viewFunction=d},10048:(e,t)=>
38{"use strict";var r;Object.defineProperty(t,"__esModule",{value:!0}),t.KeySize=t.KeyType=void 0,function(e){e[e.ED25519=0]="ED25519",e[e.SECP256K1=1]="SECP256K1"}(r||(t.KeyType=r={})),t.KeySize={SECRET_KEY:32,ED25519_PUBLIC_KEY:32,SECP256k1_PUBLIC_KEY:64}},475:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.PublicKey=t.KeyPairSecp256k1=t.KeyPairEd25519=t.KeyPair=t.KeyType=void 0;var n=r(10048);Object.defineProperty(t,"KeyType",{enumerable:!0,get:function(){return n.KeyType}});var i=r(93271);Object.defineProperty(t,"KeyPair",{enumerable:!0,get:function(){return i.KeyPair}});var o=r(83977);Object.defineProperty(t,"KeyPairEd25519",{enumerable:!0,get:function(){return o.KeyPairEd25519}});var s=r(5634);Object.defineProperty(t,"KeyPairSecp256k1",{enumerable:!0,get:function(){return s.KeyPairSecp256k1}});var a=r(6696);Object.defineProperty(t,"PublicKey",{enumerable:!0,get:function(){return a.PublicKey}})},93271:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.KeyPair=void 0;let n=r(29655),i=r(83977),o=r(5634);class s extends n.KeyPairBase{static fromRandom(e){switch(e.toUpperCase()){case"ED25519":return i.KeyPairEd25519.fromRandom();case"SECP256K1":return o.KeyPairSecp256k1.fromRandom();default:throw Error(`Unknown curve ${e}`)}}static fromString(e){let t=e.split(":");if(2===t.length)switch(t[0].toUpperCase()){case"ED25519":return new i.KeyPairEd25519(t[1]);case"SECP256K1":return new o.KeyPairSecp256k1(t[1]);default:throw Error(`Unknown curve: ${t[0]}`)}else throw Error("Invalid encoded key format, must be <curve>:<encoded key>")}}t.KeyPair=s},29655:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.KeyPairBase=void 0;class r{}t.KeyPairBase=r},83977:function(e,t,r){"use strict";var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.KeyPairEd25519=void 0;let i=r(26497),o=r(80293),s=n(r(52815)),a=r(10048),c=r(29655),u=r(6696);class l extends c.KeyPairBase{publicKey;secretKey;extendedSecretKey;constructor(e){super();let t=new Uint8Array((0,i.baseDecode)(e).slice(0,a.KeySize.SECRET_KEY)),r=o.ed25519.getPublicKey(new Uint8Array(t));this.publicKey=new u.PublicKey({keyType:a.KeyType.ED25519,data:r}),this.secretKey=(0,i.baseEncode)(t),this.extendedSecretKey=e}static fromRandom(){let e=(0,s.default)(a.KeySize.SECRET_KEY),t=o.ed25519.getPublicKey(new Uint8Array(e)),r=new Uint8Array([...e,...t]);return new l((0,i.baseEncode)(r))}sign(e){return{signature:o.ed25519.sign(e,(0,i.baseDecode)(this.secretKey)),publicKey:this.publicKey}}verify(e,t){return this.publicKey.verify(e,t)}toString(){return`ed25519:${this.extendedSecretKey}`}getPublicKey(){return this.publicKey}}t.KeyPairEd25519=l},5634:function(e,t,r){"use strict";var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.KeyPairSecp256k1=void 0;let i=r(26497),o=n(r(52815)),s=n(r(22265)),a=r(10048),c=r(29655),u=r(6696);class l extends c.KeyPairBase{publicKey;secretKey;extendedSecretKey;constructor(e){super();let t=new Uint8Array((0,i.baseDecode)(e).slice(0,a.KeySize.SECRET_KEY)),r=s.default.publicKeyCreate(new Uint8Array(t),!1),n=r.subarray(1,r.length);this.publicKey=new u.PublicKey({keyType:a.KeyType.SECP256K1,data:n}),this.secretKey=(0,i.baseEncode)(t),this.extendedSecretKey=e}static fromRandom(){let e=(0,o.default)(a.KeySize.SECRET_KEY),t=s.default.publicKeyCreate(new Uint8Array(e),!1),r=new Uint8Array([...e,...t.subarray(1,t.length)]);return new l((0,i.baseEncode)(r))}sign(e){let{signature:t,recid:r}=s.default.ecdsaSign(e,(0,i.baseDecode)(this.secretKey));return{signature:new Uint8Array([...t,r]),publicKey:this.publicKey}}verify(e,t){return this.publicKey.verify(e,t)}toString(){return`secp256k1:${this.extendedSecretKey}`}getPublicKey(){return this.publicKey}}t.KeyPairSecp256k1=l},6696:function(e,t,r){"use strict";var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.PublicKey=void 0;let i=r(26497),o=r(80293),s=n(r(22265)),a=r(10048);
38function c(e){switch(e){case a.KeyType.ED25519:return"ed25519";case a.KeyType.SECP256K1:return"secp256k1";default:throw Error(`Unknown key type ${e}`)}}function u(e){switch(e.toLowerCase()){case"ed25519":return a.KeyType.ED25519;case"secp256k1":return a.KeyType.SECP256K1;default:throw Error(`Unknown key type ${e}`)}}function l(e){switch(e){case a.KeyType.ED25519:return"ed25519Key";case a.KeyType.SECP256K1:return"secp256k1Key";default:throw Error(`unknown type ${e}`)}}class d{constructor(e){if(1!==Object.keys(e).length)throw Error("Enum can only take single value");Object.keys(e).map(t=>{this[t]=e[t]})}}class f extends d{enum;ed25519Key;secp256k1Key;constructor(e){let t=l(e.keyType);super({[t]:e}),this[t]=e,this.enum=t}static from(e){return"string"==typeof e?f.fromString(e):e}static fromString(e){let t,r;let n=e.split(":");if(1===n.length)t=n[0];else if(2===n.length)t=n[1],r=u(n[0]);else throw Error("Invalid encoded key format, must be <curve>:<encoded key>");let o=(0,i.baseDecode)(t);r||(r=o.length===a.KeySize.SECP256k1_PUBLIC_KEY?a.KeyType.SECP256K1:a.KeyType.ED25519);let s=r===a.KeyType.ED25519?a.KeySize.ED25519_PUBLIC_KEY:a.KeySize.SECP256k1_PUBLIC_KEY;if(o.length!==s)throw Error(`Invalid public key size (${o.length}), must be ${s}`);return new f({keyType:r,data:o})}toString(){let e=(0,i.baseEncode)(this.data);return`${c(this.keyType)}:${e}`}verify(e,t){let r=this.keyType,n=this.data;switch(r){case a.KeyType.ED25519:return o.ed25519.verify(t,e,n);case a.KeyType.SECP256K1:return s.default.ecdsaVerify(t.subarray(0,64),e,new Uint8Array([4,...n]));default:throw Error(`Unknown key type: ${r}`)}}get keyPair(){return this.ed25519Key||this.secp256k1Key}get keyType(){return this.keyPair.keyType}get data(){return this.keyPair.data}}t.PublicKey=f},33926:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.InMemoryKeyStore=void 0;let n=r(475),i=r(63433);class o extends i.KeyStore{keys;constructor(){super(),this.keys={}}async setKey(e,t,r){this.keys[`${t}:${e}`]=r.toString()}async getKey(e,t){let r=this.keys[`${t}:${e}`];return r?n.KeyPair.fromString(r):null}async removeKey(e,t){delete this.keys[`${t}:${e}`]}async clear(){this.keys={}}async getNetworks(){let e=new Set;return Object.keys(this.keys).forEach(t=>{let r=t.split(":");e.add(r[1])}),Array.from(e.values())}async getAccounts(e){let t=[];return Object.keys(this.keys).forEach(r=>{let n=r.split(":");n[n.length-1]===e&&t.push(n.slice(0,n.length-1).join(":"))}),t}toString(){return"InMemoryKeyStore"}}t.InMemoryKeyStore=o},44749:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.MultiContractKeyStore=t.MergeKeyStore=t.KeyStore=t.InMemoryKeyStore=void 0;var n=r(33926);Object.defineProperty(t,"InMemoryKeyStore",{enumerable:!0,get:function(){return n.InMemoryKeyStore}});var i=r(63433);Object.defineProperty(t,"KeyStore",{enumerable:!0,get:function(){return i.KeyStore}});var o=r(46667);Object.defineProperty(t,"MergeKeyStore",{enumerable:!0,get:function(){return o.MergeKeyStore}});var s=r(59410);Object.defineProperty(t,"MultiContractKeyStore",{enumerable:!0,get:function(){return s.MultiContractKeyStore}})},63433:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.KeyStore=void 0;class r{}t.KeyStore=r},46667:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.MergeKeyStore=void 0;let n=r(63433);class i extends n.KeyStore{options;keyStores;constructor(e,t={writeKeyStoreIndex:0}){super(),this.options=t,this.keyStores=e}async setKey(e,t,r){await this.keyStores[this.options.writeKeyStoreIndex].setKey(e,t,r)}async getKey(e,t){for(let r of this.keyStores){let n=await r.getKey(e,t);if(n)return n}return null}async removeKey(e,t){for(let r of this.keyStores)await r.removeKey(e,t)}async clear(){for(let e of this.keyStores)await e.clear()}async getNetworks(){let e=new Set;for(let t of this.keyStores)for(let r of(await t.getNetworks()))e.add(r);return Array.from(e)}async getAccounts(e){let t=new Set;for(let r of this.keyStores)for(let n of(await r.getAccounts(e)))t.add(n);return Array.from(t)}toString(){return`MergeKeyStore(${this.keyStores.join(", ")})`}}
38t.MergeKeyStore=i},59410:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.MultiContractKeyStore=void 0;class r{}t.MultiContractKeyStore=r},2500:(e,t)=>{"use strict";async function r(e,t,r,i){let o=e;for(let e=0;e<t;e++){let e=await i();if(e)return e;await n(o),o*=r}return null}function n(e){return new Promise(t=>setTimeout(t,e))}Object.defineProperty(t,"__esModule",{value:!0}),t.exponentialBackoff=void 0,t.exponentialBackoff=r},68152:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.FailoverRpcProvider=void 0;let n=r(26497),i=r(6141),o=r(16003);class s extends o.Provider{providers;currentProviderIndex;constructor(e){if(super(),0===e.length)throw Error("At least one provider must be specified");this.providers=e,this.currentProviderIndex=0}switchToNextProvider(){1!==this.providers.length&&(this.providers.length-1<=this.currentProviderIndex?this.currentProviderIndex=0:this.currentProviderIndex+=1,n.Logger.debug(`Switched to provider at the index ${this.currentProviderIndex}`))}get currentProvider(){let e=this.providers[this.currentProviderIndex];if(!e)throw Error(`Provider wasn't found at index ${this.currentProviderIndex}`);return e}async withBackoff(e){for(let t=0;t<this.providers.length;t++)try{let t=await e(this.currentProvider);if(t)return t}catch(e){console.error(e),this.switchToNextProvider()}throw new i.TypedError(`Exceeded ${this.providers.length} providers to execute request`,"RetriesExceeded")}async status(){return this.withBackoff(e=>e.status())}async sendTransactionUntil(e,t){return this.withBackoff(r=>r.sendTransactionUntil(e,t))}async sendTransaction(e){return this.withBackoff(t=>t.sendTransaction(e))}async sendTransactionAsync(e){return this.withBackoff(t=>t.sendTransactionAsync(e))}async txStatus(e,t,r){return this.withBackoff(n=>n.txStatus(e,t,r))}async txStatusReceipts(e,t,r){return this.withBackoff(n=>n.txStatusReceipts(e,t,r))}async query(e,t){return t?this.withBackoff(r=>r.query(e,t)):this.withBackoff(t=>t.query(e))}async block(e){return this.withBackoff(t=>t.block(e))}async blockChanges(e){return this.withBackoff(t=>t.blockChanges(e))}async chunk(e){return this.withBackoff(t=>t.chunk(e))}async validators(e){return this.withBackoff(t=>t.validators(e))}async experimental_protocolConfig(e){return this.withBackoff(t=>t.experimental_protocolConfig(e))}async lightClientProof(e){return this.withBackoff(t=>t.lightClientProof(e))}async nextLightClientBlock(e){return this.withBackoff(t=>t.nextLightClientBlock(e))}async accessKeyChanges(e,t){return this.withBackoff(r=>r.accessKeyChanges(e,t))}async singleAccessKeyChanges(e,t){return this.withBackoff(r=>r.singleAccessKeyChanges(e,t))}async accountChanges(e,t){return this.withBackoff(r=>r.accountChanges(e,t))}async contractStateChanges(e,t,r=""){return this.withBackoff(n=>n.contractStateChanges(e,t,r))}async contractCodeChanges(e,t){return this.withBackoff(r=>r.contractCodeChanges(e,t))}async gasPrice(e){return this.withBackoff(t=>t.gasPrice(e))}}t.FailoverRpcProvider=s},1413:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.fetchJsonRpc=t.ProviderError=t.retryConfig=void 0;let n=r(6141),i=r(67918),o=1.5,s=10,a=0;function c(e=s,t=o,r=a){return{numOfAttempts:e,timeMultiple:t,startingDelay:r,retry:e=>!!([503,500,408].includes(e.cause)||e.toString().includes("FetchError")||e.toString().includes("Failed to fetch"))}}t.retryConfig=c;class u extends Error{cause;constructor(e,t){super(e,t),t.cause&&(this.cause=t.cause)}}async function l(e,t,r,o){let a=await (0,i.backOff)(async()=>{let n=await fetch(e,{method:"POST",body:JSON.stringify(t),headers:{...r,"Content-Type":"application/json"}}),{ok:i,status:o}=n;if(500===o)throw new u("Internal server error",{cause:o});if(408===o)throw new u("Timeout error",{cause:o});if(400===o)throw new u("Request validation error",{cause:o});if(503===o)throw new u(`${e} unavailable`,{cause:o});if(!i)throw new u(await n.text(),{cause:o});return n},o);if(!a)throw new n.TypedError(`Exceeded ${s} attempts for ${e}.`,"RetriesExceeded");return await a.json()}t.ProviderError=u,t.fetchJsonRpc=l},30006:(e,t,r)=>{"use strict";
38Object.defineProperty(t,"__esModule",{value:!0}),t.Provider=t.FailoverRpcProvider=t.JsonRpcProvider=t.exponentialBackoff=void 0;var n=r(2500);Object.defineProperty(t,"exponentialBackoff",{enumerable:!0,get:function(){return n.exponentialBackoff}});var i=r(68764);Object.defineProperty(t,"JsonRpcProvider",{enumerable:!0,get:function(){return i.JsonRpcProvider}});var o=r(68152);Object.defineProperty(t,"FailoverRpcProvider",{enumerable:!0,get:function(){return o.FailoverRpcProvider}});var s=r(16003);Object.defineProperty(t,"Provider",{enumerable:!0,get:function(){return s.Provider}})},68764:(e,t,r)=>{"use strict";var n=r(75927).Buffer;Object.defineProperty(t,"__esModule",{value:!0}),t.JsonRpcProvider=void 0;let i=r(26497),o=r(6141),s=r(99923),a=r(16003),c=r(1413),u=12,l=500,d=1.5,f=123;class h extends a.Provider{connection;options;constructor(e,t){super(),this.connection=e||{url:""};let r={retries:u,wait:l,backoff:d};this.options=Object.assign({},r,t)}async status(){return this.sendJsonRpc("status",[])}async sendTransactionUntil(e,t){let r=(0,s.encodeTransaction)(e);return this.sendJsonRpc("send_tx",{signed_tx_base64:n.from(r).toString("base64"),wait_until:t})}async sendTransaction(e){return this.sendTransactionUntil(e,"EXECUTED_OPTIMISTIC")}async sendTransactionAsync(e){return this.sendTransactionUntil(e,"NONE")}async txStatus(e,t,r="EXECUTED_OPTIMISTIC"){return"string"==typeof e?this.txStatusString(e,t,r):this.txStatusUint8Array(e,t,r)}async txStatusUint8Array(e,t,r){return this.sendJsonRpc("tx",{tx_hash:(0,i.baseEncode)(e),sender_account_id:t,wait_until:r})}async txStatusString(e,t,r){return this.sendJsonRpc("tx",{tx_hash:e,sender_account_id:t,wait_until:r})}async txStatusReceipts(e,t,r="EXECUTED_OPTIMISTIC"){return"string"==typeof e?this.sendJsonRpc("EXPERIMENTAL_tx_status",{tx_hash:e,sender_account_id:t,wait_until:r}):this.sendJsonRpc("EXPERIMENTAL_tx_status",{tx_hash:(0,i.baseEncode)(e),sender_account_id:t,wait_until:r})}async query(...e){let t;if(1===e.length){let{block_id:r,blockId:n,...i}=e[0];t=await this.sendJsonRpc("query",{...i,block_id:r||n})}else{let[r,n]=e;t=await this.sendJsonRpc("query",[r,n])}if(t&&t.error)throw new o.TypedError(`Querying failed: ${t.error}. 39${JSON.stringify(t,null,2)}`,(0,i.getErrorTypeFromErrorMessage)(t.error,t.error.name));return t}async block(e){let{finality:t}=e,{blockId:r}=e;return this.sendJsonRpc("block",{block_id:r,finality:t})}async blockChanges(e){let{finality:t}=e,{blockId:r}=e;return this.sendJsonRpc("EXPERIMENTAL_changes_in_block",{block_id:r,finality:t})}async chunk(e){return this.sendJsonRpc("chunk",[e])}async validators(e){return this.sendJsonRpc("validators",[e])}async experimental_protocolConfig(e){let{blockId:t,...r}=e;return await this.sendJsonRpc("EXPERIMENTAL_protocol_config",{...r,block_id:t})}async lightClientProof(e){return await this.sendJsonRpc("EXPERIMENTAL_light_client_proof",e)}async nextLightClientBlock(e){return await this.sendJsonRpc("next_light_client_block",e)}async accessKeyChanges(e,t){let{finality:r}=t,{blockId:n}=t;return this.sendJsonRpc("EXPERIMENTAL_changes",{changes_type:"all_access_key_changes",account_ids:e,block_id:n,finality:r})}async singleAccessKeyChanges(e,t){let{finality:r}=t,{blockId:n}=t;return this.sendJsonRpc("EXPERIMENTAL_changes",{changes_type:"single_access_key_changes",keys:e,block_id:n,finality:r})}async accountChanges(e,t){let{finality:r}=t,{blockId:n}=t;return this.sendJsonRpc("EXPERIMENTAL_changes",{changes_type:"account_changes",account_ids:e,block_id:n,finality:r})}async contractStateChanges(e,t,r=""){let{finality:n}=t,{blockId:i}=t;return this.sendJsonRpc("EXPERIMENTAL_changes",{changes_type:"data_changes",account_ids:e,key_prefix_base64:r,block_id:i,finality:n})}async contractCodeChanges(e,t){let{finality:r}=t,{blockId:n}=t;return this.sendJsonRpc("EXPERIMENTAL_changes",{changes_type:"contract_code_changes",account_ids:e,block_id:n,finality:r})}async gasPrice(e){return await this.sendJsonRpc("gas_price",[e])}async sendJsonRpc(e,t){let r={method:e,params:t,id:f++,jsonrpc:"2.0"},n=await (0,c.fetchJsonRpc)(this.connection.url,r,this.connection.headers,(0,c.retryConfig)(this.options.retries,this.options.backoff,this.options.wait));if(n.error){if("object"==typeof n.error.data){if("string"==typeof n.error.data.error_message&&"string"==typeof n.error.data.error_type)throw new o.TypedError(n.error.data.error_message,n.error.data.error_type);throw(0,i.parseRpcError)(n.error.data)}{let e=`[${n.error.code}] ${n.error.message}: ${n.error.data}`,r=(0,i.getErrorTypeFromErrorMessage)(n.error.data,"");if(r)throw new o.TypedError((0,i.formatError)(r,t),r);
39throw new o.TypedError(e,n.error.name)}}if("string"==typeof n.result?.error){let e=(0,i.getErrorTypeFromErrorMessage)(n.result.error,"");if(e)throw new i.ServerError((0,i.formatError)(e,t),e)}let{result:s}=n;if(void 0===s)throw new o.TypedError(`Exceeded ${this.options.retries} attempts for request to ${e}.`,"RetriesExceeded");return s}}t.JsonRpcProvider=h},16003:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Provider=void 0;class r{}t.Provider=r},28985:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.InMemorySigner=void 0;let n=r(475),i=r(44749),o=r(87349),s=r(33633);class a extends s.Signer{keyStore;constructor(e){super(),this.keyStore=e}static async fromKeyPair(e,t,r){let n=new i.InMemoryKeyStore;return await n.setKey(e,t,r),new a(n)}async createKey(e,t,r){let i=r===n.KeyType.SECP256K1?n.KeyPair.fromRandom("secp256k1"):n.KeyPair.fromRandom("ed25519");return await this.keyStore.setKey(t,e,i),i.getPublicKey()}async getPublicKey(e,t){let r=await this.keyStore.getKey(t,e);return null===r?null:r.getPublicKey()}async signMessage(e,t,r){let n=new Uint8Array((0,o.sha256)(e));if(!t)throw Error("InMemorySigner requires provided account id");let i=await this.keyStore.getKey(r,t);if(null===i)throw Error(`Key for ${t} not found in ${r}`);return i.sign(n)}toString(){return`InMemorySigner(${this.keyStore})`}}t.InMemorySigner=a},48095:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Signer=t.InMemorySigner=void 0;var n=r(28985);Object.defineProperty(t,"InMemorySigner",{enumerable:!0,get:function(){return n.InMemorySigner}});var i=r(33633);Object.defineProperty(t,"Signer",{enumerable:!0,get:function(){return i.Signer}})},33633:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Signer=void 0;class r{}t.Signer=r},48869:(e,t,r)=>{"use strict";var n=r(75927).Buffer;Object.defineProperty(t,"__esModule",{value:!0}),t.actionCreators=t.stringifyJsonOrBytes=void 0;let i=r(4322);function o(){return new i.AccessKey({nonce:0n,permission:new i.AccessKeyPermission({fullAccess:new i.FullAccessPermission})})}function s(e,t,r){return new i.AccessKey({nonce:0n,permission:new i.AccessKeyPermission({functionCall:new i.FunctionCallPermission({receiverId:e,allowance:r,methodNames:t})})})}function a(){return new i.Action({createAccount:new i.CreateAccount})}function c(e){return new i.Action({deployContract:new i.DeployContract({code:e})})}function u(e){return void 0!==e.byteLength&&e.byteLength===e.length?e:n.from(JSON.stringify(e))}function l(e,t,r=0n,n=0n,o=u,s=!1){return new i.Action(s?{functionCall:new i.FunctionCall({methodName:e,args:t,gas:r,deposit:n})}:{functionCall:new i.FunctionCall({methodName:e,args:o(t),gas:r,deposit:n})})}function d(e=0n){return new i.Action({transfer:new i.Transfer({deposit:e})})}function f(e=0n,t){return new i.Action({stake:new i.Stake({stake:e,publicKey:t})})}function h(e,t){return new i.Action({addKey:new i.AddKey({publicKey:e,accessKey:t})})}function p(e){return new i.Action({deleteKey:new i.DeleteKey({publicKey:e})})}function y(e){return new i.Action({deleteAccount:new i.DeleteAccount({beneficiaryId:e})})}function g({delegateAction:e,signature:t}){return new i.Action({signedDelegate:new i.SignedDelegate({delegateAction:e,signature:t})})}t.stringifyJsonOrBytes=u,t.actionCreators={addKey:h,createAccount:a,deleteAccount:y,deleteKey:p,deployContract:c,fullAccessKey:o,functionCall:l,functionCallAccessKey:s,signedDelegate:g,stake:f,transfer:d}},4322:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Action=t.SignedDelegate=t.DeleteAccount=t.DeleteKey=t.AddKey=t.Stake=t.Transfer=t.FunctionCall=t.DeployContract=t.CreateAccount=t.AccessKey=t.AccessKeyPermission=t.FullAccessPermission=t.FunctionCallPermission=void 0;let n=r(6141);class i{allowance;receiverId;methodNames;constructor({allowance:e,receiverId:t,methodNames:r}){this.allowance=e,this.receiverId=t,this.methodNames=r}}t.FunctionCallPermission=i;class o{}t.FullAccessPermission=o;class s extends n.Enum{enum;functionCall;fullAccess;constructor(e){for(let[t,r]of(super(e),Object.entries(e||{})))this[t]=r,this.enum=t}}t.AccessKeyPermission=s;class a{nonce;permission;constructor({nonce:e,permission:t}){this.nonce=e,this.permission=t}}t.AccessKey=a;class c{}t.CreateAccount=c;class u{code;constructor({code:e}
39){this.code=e}}t.DeployContract=u;class l{methodName;args;gas;deposit;constructor({methodName:e,args:t,gas:r,deposit:n}){this.methodName=e,this.args=t,this.gas=r,this.deposit=n}}t.FunctionCall=l;class d{deposit;constructor({deposit:e}){this.deposit=e}}t.Transfer=d;class f{stake;publicKey;constructor({stake:e,publicKey:t}){this.stake=e,this.publicKey=t}}t.Stake=f;class h{publicKey;accessKey;constructor({publicKey:e,accessKey:t}){this.publicKey=e,this.accessKey=t}}t.AddKey=h;class p{publicKey;constructor({publicKey:e}){this.publicKey=e}}t.DeleteKey=p;class y{beneficiaryId;constructor({beneficiaryId:e}){this.beneficiaryId=e}}t.DeleteAccount=y;class g{delegateAction;signature;constructor({delegateAction:e,signature:t}){this.delegateAction=e,this.signature=t}}t.SignedDelegate=g;class m extends n.Enum{enum;createAccount;deployContract;functionCall;transfer;stake;addKey;deleteKey;deleteAccount;signedDelegate;constructor(e){for(let[t,r]of(super(e),Object.entries(e||{})))this[t]=r,this.enum=t}}t.Action=m},62350:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createTransaction=void 0;let n=r(52470);function i(e,t,r,i,o,s){let a="bigint"==typeof i?i:BigInt(i);return new n.Transaction({signerId:e,publicKey:t,nonce:a,receiverId:r,actions:o,blockHash:s})}t.createTransaction=i},42742:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.buildDelegateAction=t.DelegateAction=void 0;let{addKey:n,createAccount:i,deleteAccount:o,deleteKey:s,deployContract:a,functionCall:c,stake:u,transfer:l}=r(48869).actionCreators;class d{senderId;receiverId;actions;nonce;maxBlockHeight;publicKey;constructor({senderId:e,receiverId:t,actions:r,nonce:n,maxBlockHeight:i,publicKey:o}){this.senderId=e,this.receiverId=t,this.actions=r,this.nonce=n,this.maxBlockHeight=i,this.publicKey=o}}function f({actions:e,maxBlockHeight:t,nonce:r,publicKey:f,receiverId:h,senderId:p}){return new d({senderId:p,receiverId:h,actions:e.map(e=>{if(!e.type&&!e.params)return e;switch(e.type){case"AddKey":{let{publicKey:t,accessKey:r}=e.params;return n(t,r)}case"CreateAccount":return i(e.params.createAccount);case"DeleteAccount":return o(e.params.deleteAccount);case"DeleteKey":return s(e.params.publicKey);case"DeployContract":return a(e.params.code);case"FunctionCall":{let{methodName:t,args:r,gas:n,deposit:i}=e.params;return c(t,r,n,i)}case"Stake":return u(e.params.stake,e.params.publicKey);case"Transfer":{let{deposit:t}=e.params;return l(t)}}throw Error("Unrecognized action")}),nonce:r,maxBlockHeight:t,publicKey:f})}t.DelegateAction=d,t.buildDelegateAction=f},99923:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);(!i||("get"in i?!t.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),i(r(48869),t),i(r(4322),t),i(r(62350),t),i(r(42742),t),i(r(52470),t),i(r(13380),t),i(r(71337),t)},34787:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.DelegateActionPrefix=void 0;let r=0x40000000,n={MetaTransactions:366};class i{prefix;constructor({prefix:e}){this.prefix=e}}class o extends i{constructor(e){super({prefix:r+e})}}class s extends o{constructor(){super(n.MetaTransactions)}}t.DelegateActionPrefix=s},52470:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.SCHEMA=t.SignedTransaction=t.Transaction=t.decodeSignedTransaction=t.decodeTransaction=t.encodeTransaction=t.encodeSignedDelegate=t.encodeDelegateAction=void 0;let n=r(68220),i=r(34787);function o(e){return new Uint8Array([...(0,n.serialize)(t.SCHEMA.DelegateActionPrefix,new i.DelegateActionPrefix),...(0,n.serialize)(t.SCHEMA.DelegateAction,e)])}function s(e){return(0,n.serialize)(t.SCHEMA.SignedDelegate,e)}function a(e){let r=e instanceof d?t.SCHEMA.SignedTransaction:t.SCHEMA.Transaction;return(0,n.serialize)(r,e)}function c(e){return new l((0,n.deserialize)(t.SCHEMA.Transaction,e))}function u(e){return new d((0,n.deserialize)(t.SCHEMA.SignedTransaction,e))}t.encodeDelegateAction=o,t.encodeSignedDelegate=s,t.encodeTransaction=a,t.decodeTransaction=c,t.decodeSignedTransaction=u;class l{signerId;publicKey;nonce;receiverId;actions;blockHash;constructor({signerId:e,publicKey:t,nonce:r,receiverId:n,actions:i,blockHash:o}){this.signerId=e,this.publicKey=t,this.nonce=r,this.receiverId=n,this.actions=i,this.blockHash=o}encode(){return a(this)}static decode(e){return c(e)}}t.Transaction=l;class d{transaction;signature;constructor({transaction:e,signature:t}){this.transaction=e,this.signature=t}encode(){return a(this)}static decode(e){return u(e)}}t.SignedTransaction=d,t.SCHEMA=new class{Ed25519Signature={struct:{data:{array:{type:"u8",len:64}}}};Secp256k1Signature={struct:{data:{array:{type:"u8",len:65}}}};Signature={enum:[{struct:{ed25519Signature:this.Ed25519Signature}},{struct:{secp256k1Signature:this.Secp256k1Signature}}]};Ed25519Data={struct:{data:{array:{type:"u8",len:32}}}};Secp256k1Data={struct:{data:{array:{type:"u8",len:64}}}};PublicKey={enum:[{struct:{ed25519Key:this.Ed25519Data}},{struct:{secp256k1Key:this.Secp256k1Data}}]};FunctionCallPermission={struct:{allowance:{option:"u128"},receiverId:"string",methodNames:{array:{type:"string"}}}};FullAccessPermission={struct:{}};AccessKeyPermission={enum:[{struct:{functionCall:this.FunctionCallPermission}},{struct:{fullAccess:this.FullAccessPermission}}]};AccessKey={struct:{nonce:"u64",permission:this.AccessKeyPermission}};CreateAccount={struct:{}};DeployContract={struct:{code:{array:{type:"u8"}}}};FunctionCall={struct:{methodName:"string",args:{array:{type:"u8"}},gas:"u64",deposit:"u128"}};Transfer={struct:{deposit:"u128"}};Stake={struct:{stake:"u128",publicKey:this.PublicKey}};AddKey={struct:{publicKey:this.PublicKey,accessKey:this.AccessKey}};DeleteKey={struct:{publicKey:this.PublicKey}};DeleteAccount={struct:{beneficiaryId:"string"}};DelegateActionPrefix={struct:{prefix:"u32"}};ClassicActions={enum:[{struct:{createAccount:this.CreateAccount}},{struct:{deployContract:this.DeployContract}},{struct:{functionCall:this.FunctionCall}},{struct:{transfer:this.Transfer}},{struct:{stake:this.Stake}},{struct:{addKey:this.AddKey}},{struct:{deleteKey:this.DeleteKey}},{struct:{deleteAccount:this.DeleteAccount}}]};DelegateAction={struct:{senderId:"string",receiverId:"string",actions:{array:{type:this.ClassicActions}},nonce:"u64",maxBlockHeight:"u64",publicKey:this.PublicKey}};SignedDelegate={struct:{delegateAction:this.DelegateAction,signature:this.Signature}};Action={enum:[{struct:{createAccount:this.CreateAccount}},{struct:{deployContract:this.DeployContract}},{struct:{functionCall:this.FunctionCall}},{struct:{transfer:this.Transfer}},{struct:{stake:this.Stake}},{struct:{addKey:this.AddKey}},{struct:{deleteKey:this.DeleteKey}},{struct:{deleteAccount:this.DeleteAccount}},{struct:{signedDelegate:this.SignedDelegate}}]};Transaction={struct:{signerId:"string",publicKey:this.PublicKey,nonce:"u64",receiverId:"string",blockHash:{array:{type:"u8",len:32}},actions:{array:{type:this.Action}}}};SignedTransaction={struct:{transaction:this.Transaction,signature:this.Signature}}}},13380:(e,t,r)=>{"use strict";
39Object.defineProperty(t,"__esModule",{value:!0}),t.signDelegateAction=t.signTransaction=void 0;let n=r(72551),i=r(4322),o=r(62350),s=r(52470),a=r(71337),c=r(475);async function u(e,t,r,i){let o=(0,s.encodeTransaction)(e),u=new Uint8Array((0,n.sha256)(o)),l=await t.signMessage(o,r,i),d=e.publicKey.ed25519Key?c.KeyType.ED25519:c.KeyType.SECP256K1;return[u,new s.SignedTransaction({transaction:e,signature:new a.Signature({keyType:d,data:l.signature})})]}async function l(...e){if(e[0].constructor===s.Transaction){let[t,r,n,i]=e;return u(t,r,n,i)}{let[t,r,n,i,s,a,c]=e,l=await s.getPublicKey(a,c);return u((0,o.createTransaction)(a,l,t,r,n,i),s,a,c)}}async function d({delegateAction:e,signer:t}){let r=(0,s.encodeDelegateAction)(e),o=await t.sign(r),u=e.publicKey.ed25519Key?c.KeyType.ED25519:c.KeyType.SECP256K1,l=new i.SignedDelegate({delegateAction:e,signature:new a.Signature({keyType:u,data:o})});return{hash:new Uint8Array((0,n.sha256)(r)),signedDelegateAction:l}}t.signTransaction=l,t.signDelegateAction=d},71337:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Signature=void 0;let n=r(475),i=r(6141);function o(e){switch(e){case n.KeyType.ED25519:return"ed25519Signature";case n.KeyType.SECP256K1:return"secp256k1Signature";default:throw Error(`unknown type ${e}`)}}class s extends i.Enum{enum;ed25519Signature;secp256k1Signature;constructor(e){let t=o(e.keyType);super({[t]:e}),this[t]=e,this.enum=t}get signature(){return this.ed25519Signature||this.secp256k1Signature}get signatureType(){return this.signature.keyType}get data(){return this.signature.data}}t.Signature=s},36362:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Assignable=void 0;class r{constructor(e){Object.keys(e).map(t=>{this[t]=e[t]})}}t.Assignable=r},83926:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Enum=void 0;class r{constructor(e){if(1!==Object.keys(e).length)throw Error("Enum can only take single value");Object.keys(e).map(t=>{this[t]=e[t]})}}t.Enum=r},68756:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ErrorContext=t.TypedError=t.ArgumentTypeError=t.PositionalArgsError=void 0;class r extends Error{constructor(){super("Contract method calls expect named arguments wrapped in object, e.g. { argName1: argValue1, argName2: argValue2 }")}}t.PositionalArgsError=r;class n extends Error{constructor(e,t,r){super(`Expected ${t} for '${e}' argument, but got '${JSON.stringify(r)}'`)}}t.ArgumentTypeError=n;class i extends Error{type;context;constructor(e,t,r){super(e),this.type=t||"UntypedError",this.context=r}}t.TypedError=i;class o{transactionHash;constructor(e){this.transactionHash=e}}t.ErrorContext=o},6141:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);(!i||("get"in i?!t.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),i(r(36362),t),i(r(83926),t),i(r(68756),t),i(r(43527),t)},43527:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.FinalExecutionStatusBasic=t.ExecutionStatusBasic=t.IdType=void 0;var n=r(50225);Object.defineProperty(t,"IdType",{enumerable:!0,get:function(){return n.IdType}});var i=r(19650);Object.defineProperty(t,"ExecutionStatusBasic",{enumerable:!0,get:function(){return i.ExecutionStatusBasic}}),Object.defineProperty(t,"FinalExecutionStatusBasic",{enumerable:!0,get:function(){return i.FinalExecutionStatusBasic}})},50225:(e,t)=>{"use strict";var r;Object.defineProperty(t,"__esModule",{value:!0}),t.IdType=void 0,function(e){e.Transaction="transaction",e.Receipt="receipt"}(r||(t.IdType=r={}))},19650:(e,t)=>{"use strict";var r,n;Object.defineProperty(t,"__esModule",{value:!0}),t.FinalExecutionStatusBasic=t.ExecutionStatusBasic=void 0,function(e){e.Unknown="Unknown",e.Pending="Pending",e.Failure="Failure"}(r||(t.ExecutionStatusBasic=r={})),function(e){e.NotStarted="NotStarted",e.Started="Started",e.Failure="Failure"}(n||(t.FinalExecutionStatusBasic=n={}))},39618:(e,t)=>{"use strict";
39Object.defineProperty(t,"__esModule",{value:!0}),t.DEFAULT_FUNCTION_CALL_GAS=void 0,t.DEFAULT_FUNCTION_CALL_GAS=30000000000000n},94936:function(e,t,r){"use strict";var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.ErrorMessages=void 0;let i=n(r(69379));t.ErrorMessages=i.default},97633:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.parseRpcError=t.parseResultError=t.getErrorTypeFromErrorMessage=t.formatError=t.ServerError=t.ErrorMessages=void 0;var n=r(94936);Object.defineProperty(t,"ErrorMessages",{enumerable:!0,get:function(){return n.ErrorMessages}});var i=r(76012);Object.defineProperty(t,"ServerError",{enumerable:!0,get:function(){return i.ServerError}}),Object.defineProperty(t,"formatError",{enumerable:!0,get:function(){return i.formatError}}),Object.defineProperty(t,"getErrorTypeFromErrorMessage",{enumerable:!0,get:function(){return i.getErrorTypeFromErrorMessage}}),Object.defineProperty(t,"parseResultError",{enumerable:!0,get:function(){return i.parseResultError}}),Object.defineProperty(t,"parseRpcError",{enumerable:!0,get:function(){return i.parseRpcError}})},76012:function(e,t,r){"use strict";var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.getErrorTypeFromErrorMessage=t.formatError=t.parseResultError=t.parseRpcError=t.ServerError=void 0;let i=r(6141),o=n(r(2139)),s=r(85676),a=r(94936),c=n(r(9052)),u={formatNear:()=>(e,t)=>(0,s.formatNearAmount)(t(e))};class l extends i.TypedError{}t.ServerError=l;class d extends l{transaction_outcome}function f(e){let t={},r=y(e,c.default.schema,t,""),n=new l(p(r,t),r);return Object.assign(n,t),n}function h(e){let t=f(e.status.Failure),r=new d;return Object.assign(r,t),r.type=t.type,r.message=t.message,r.transaction_outcome=e.transaction_outcome,r}function p(e,t){return"string"==typeof a.ErrorMessages[e]?o.default.render(a.ErrorMessages[e],{...t,...u}):JSON.stringify(t)}function y(e,t,r,n){let i,o,s;for(let r in t){if(b(e[r]))return e[r];if(m(e[r]))i=e[r],o=t[r],s=r;else{if(!(m(e.kind)&&m(e.kind[r])))continue;i=e.kind[r],o=t[r],s=r}}if(!i||!o)return r.kind=e,n;for(let e of Object.keys(o.props))r[e]=i[e];return y(i,t,r,s)}function g(e,t){switch(!0){case/^account .*? does not exist while viewing$/.test(e):case/^Account .*? doesn't exist$/.test(e):return"AccountDoesNotExist";case/^access key .*? does not exist while viewing$/.test(e):return"AccessKeyDoesNotExist";case/wasm execution failed with error: FunctionCallError\(CompilationError\(CodeDoesNotExist/.test(e):case/wasm execution failed with error: CompilationError\(CodeDoesNotExist/.test(e):return"CodeDoesNotExist";case/wasm execution failed with error: FunctionCallError\(MethodResolveError\(MethodNotFound/.test(e):case/wasm execution failed with error: MethodResolveError\(MethodNotFound/.test(e):return"MethodNotFound";case/Transaction nonce \d+ must be larger than nonce of the used access key \d+/.test(e):return"InvalidNonce";default:return t}}function m(e){return"[object Object]"===Object.prototype.toString.call(e)}function b(e){return"[object String]"===Object.prototype.toString.call(e)}t.parseRpcError=f,t.parseResultError=h,t.formatError=p,t.getErrorTypeFromErrorMessage=g},85676:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.baseDecode=t.baseEncode=t.parseNearAmount=t.formatNearAmount=t.NEAR_NOMINATION=t.NEAR_NOMINATION_EXP=void 0;let n=r(65289);t.NEAR_NOMINATION_EXP=24,t.NEAR_NOMINATION=10n**BigInt(t.NEAR_NOMINATION_EXP);let i=[],o=10n;for(let e=0,r=5n;e<t.NEAR_NOMINATION_EXP;e++,r*=o)i[e]=r;function s(e,r=t.NEAR_NOMINATION_EXP){let n=BigInt(e);if(r!==t.NEAR_NOMINATION_EXP){let e=t.NEAR_NOMINATION_EXP-r-1;e>0&&(n+=i[e])}let o=(e=n.toString()).substring(0,e.length-t.NEAR_NOMINATION_EXP)||"0",a=e.substring(e.length-t.NEAR_NOMINATION_EXP).padStart(t.NEAR_NOMINATION_EXP,"0").substring(0,r);return u(`${d(o)}.${a}`)}function a(e){if(!e)return null;let r=(e=c(e)).split("."),n=r[0],i=r[1]||"";if(r.length>2||i.length>t.NEAR_NOMINATION_EXP)throw Error(`Cannot parse '${e}' as NEAR amount`);return l(n+i.padEnd(t.NEAR_NOMINATION_EXP,"0"))}function c(e){return e.replace(/,/g,"").trim()}function u(e){return e.replace(/\.?0*$/,"")}function l(e){return""===(e=e.replace(/^0+/,""))?"0":e}function d(e){let t=/(-?\d+)(\d{3})/;for(;t.test(e);)e=e.replace(t,"$1,$2");return e}function f(e){if("string"==typeof e){let t=[];for(let r=0;r<e.length;r++)t.push(e.charCodeAt(r));e=new Uint8Array(t)}return n.base58.encode(e)}function h(e){return n.base58.decode(e)}t.formatNearAmount=s,t.parseNearAmount=a,t.baseEncode=f,t.baseDecode=h},26497:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);
39(!i||("get"in i?!t.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),i(r(39618),t),i(r(97633),t),i(r(85676),t),i(r(52054),t),i(r(86762),t),i(r(43264),t),i(r(49232),t),i(r(94890),t)},29969:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ConsoleLogger=void 0;class r{logLevels;constructor(e){this.logLevels=e}isLevelEnabled=e=>this.logLevels.includes(e);print(e,t,...r){switch(e){case"error":case"fatal":return console.error(t,...r);case"warn":return console.warn(t,...r);case"log":return console.log(t,...r);case"debug":case"verbose":return console.debug(t,...r)}}verbose(e,...t){this.isLevelEnabled("verbose")&&this.print("verbose",e,...t)}debug(e,...t){this.isLevelEnabled("debug")&&this.print("debug",e,...t)}log(e,...t){this.isLevelEnabled("log")&&this.print("log",e,...t)}warn(e,...t){this.isLevelEnabled("warn")&&this.print("warn",e,...t)}error(e,...t){this.isLevelEnabled("error")&&this.print("error",e,...t)}fatal(e,...t){this.isLevelEnabled("fatal")&&this.print("fatal",e,...t)}}t.ConsoleLogger=r},49232:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Logger=t.ConsoleLogger=void 0;var n=r(29969);Object.defineProperty(t,"ConsoleLogger",{enumerable:!0,get:function(){return n.ConsoleLogger}});var i=r(6038);Object.defineProperty(t,"Logger",{enumerable:!0,get:function(){return i.Logger}})},6038:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Logger=void 0;let n=r(29969),i=["verbose","debug","log","warn","error","fatal"],o=new n.ConsoleLogger(i);class s{static instanceRef=o;static overrideLogger=e=>{this.instanceRef=e};static error(e,...t){this.instanceRef?.error(e,...t)}static log(e,...t){this.instanceRef?.log(e,...t)}static warn(e,...t){this.instanceRef?.warn(e,...t)}static debug(e,...t){this.instanceRef?.debug?.(e,...t)}static verbose(e,...t){this.instanceRef?.verbose?.(e,...t)}static fatal(e,...t){this.instanceRef?.fatal?.(e,...t)}}t.Logger=s},52054:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.printTxOutcomeLogs=t.printTxOutcomeLogsAndFailures=void 0;let n=r(97633),i=r(49232);function o({contractId:e,outcome:t}){for(let r of[t.transaction_outcome,...t.receipts_outcome].reduce((e,t)=>{let r="object"==typeof t.outcome.status&&"object"==typeof t.outcome.status.Failure;return t.outcome.logs.length||r?e.concat({receiptIds:t.outcome.receipt_ids,logs:t.outcome.logs,failure:"object"==typeof t.outcome.status&&void 0!==t.outcome.status.Failure?(0,n.parseRpcError)(t.outcome.status.Failure):null}):e},[]))i.Logger.log(`Receipt${r.receiptIds.length>1?"s":""}: ${r.receiptIds.join(", ")}`),s({contractId:e,logs:r.logs,prefix:" "}),r.failure&&i.Logger.warn(` Failure [${e}]: ${r.failure}`)}function s({contractId:e,logs:t,prefix:r=""}){for(let n of t)i.Logger.log(`${r}Log [${e}]: ${n}`)}t.printTxOutcomeLogsAndFailures=o,t.printTxOutcomeLogs=s},86762:(e,t,r)=>{"use strict";var n=r(75927).Buffer;function i(e){if("object"==typeof e.status&&"string"==typeof e.status.SuccessValue){let t=n.from(e.status.SuccessValue,"base64").toString();try{return JSON.parse(t)}catch(e){return t}}return null}Object.defineProperty(t,"__esModule",{value:!0}),t.getTransactionLastResult=void 0,t.getTransactionLastResult=i},94890:(e,t)=>{"use strict";function r(e,t){return e<t?-1:e>t?1:0}Object.defineProperty(t,"__esModule",{value:!0}),t.sortBigIntAsc=void 0,t.sortBigIntAsc=r},43264:function(e,t,r){"use strict";var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.diffEpochValidators=t.findSeatPrice=void 0;let i=n(r(29905)),o=r(94890);function s(e,t,r,n){return n&&n<49?a(e,t):(r||((0,i.default)("findSeatPrice(validators, maxNumberOfSeats)")("`use `findSeatPrice(validators, maxNumberOfSeats, minimumStakeRatio)` instead"),r=[1,6250]),c(e,t,r))}function a(e,t){let r=e.map(e=>BigInt(e.stake)).sort(o.sortBigIntAsc),n=BigInt(t),i=r.reduce((e,t)=>
39e+t);if(i<n)throw Error("Stakes are below seats");let s=1n,a=i+1n;for(;s!==a-1n;){let e=(s+a)/2n,t=!1,i=0n;for(let o=0;o<r.length;++o)if((i+=r[o]/e)>=n){s=e,t=!0;break}t||(a=e)}return s}function c(e,t,r){if(2!=r.length)throw Error("minimumStakeRatio should have 2 elements");let n=e.map(e=>BigInt(e.stake)).sort(o.sortBigIntAsc),i=n.reduce((e,t)=>e+t);return e.length<t?i*BigInt(r[0])/BigInt(r[1]):n[0]+1n}function u(e,t){let r=new Map;e.forEach(e=>r.set(e.account_id,e));let n=new Set(t.map(e=>e.account_id));return{newValidators:t.filter(e=>!r.has(e.account_id)),removedValidators:e.filter(e=>!n.has(e.account_id)),changedValidators:t.filter(e=>r.has(e.account_id)&&r.get(e.account_id).stake!=e.stake).map(e=>({current:r.get(e.account_id),next:e}))}}t.findSeatPrice=s,t.diffEpochValidators=u},26685:(e,t,r)=>{"use strict";var n=r(75927).Buffer;Object.defineProperty(t,"__esModule",{value:!0}),t.createAction=t.parseArgs=void 0;let i=r(75092),o=r(14100),s=e=>{if("FullAccess"===e)return o.actionCreators.fullAccessKey();let{receiverId:t,methodNames:r=[]}=e,n=e.allowance?BigInt(e.allowance):void 0;return o.actionCreators.functionCallAccessKey(t,r,n)},a=e=>"string"==typeof e?n.from(e,"base64"):e;t.parseArgs=a;let c=e=>{switch(e.type){case"CreateAccount":return o.actionCreators.createAccount();case"DeployContract":{let{code:t}=e.params;return o.actionCreators.deployContract(t)}case"FunctionCall":{let{methodName:r,args:n,gas:i,deposit:s}=e.params;return o.actionCreators.functionCall(r,(0,t.parseArgs)(n),BigInt(i),BigInt(s))}case"Transfer":{let{deposit:t}=e.params;return o.actionCreators.transfer(BigInt(t))}case"Stake":{let{stake:t,publicKey:r}=e.params;return o.actionCreators.stake(BigInt(t),i.PublicKey.from(r))}case"AddKey":{let{publicKey:t,accessKey:r}=e.params;return o.actionCreators.addKey(i.PublicKey.from(t),s(r.permission))}case"DeleteKey":{let{publicKey:t}=e.params;return o.actionCreators.deleteKey(i.PublicKey.from(t))}case"DeleteAccount":{let{beneficiaryId:t}=e.params;return o.actionCreators.deleteAccount(t)}default:throw Error("Invalid action type")}};t.createAction=c},66958:function(e,t,r){"use strict";var n=r(75927).Buffer,i=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r),Object.defineProperty(e,n,{enumerable:!0,get:function(){return t[r]}})}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),o=this&&this.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),s=this&&this.__importStar||function(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var r in e)"default"!==r&&Object.prototype.hasOwnProperty.call(e,r)&&i(t,e,r);return o(t,e),t},a=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.verifySignature=t.authPayloadSchema=t.AuthPayload=void 0;let c=s(r(61796)),u=a(r(11341)),l=r(75092);class d{constructor({message:e,nonce:t,recipient:r,callbackUrl:n}){this.tag=0x8000019d,this.message=e,this.nonce=t,this.recipient=r,n&&(this.callbackUrl=n)}}function f(e,r){let i=new d(e),o=c.serialize(t.authPayloadSchema,i),s=Uint8Array.from(u.default.sha256.array(o)),a=new Uint8Array(n.from(r.signature,"base64"));return l.PublicKey.from(r.publicKey).verify(s,a)}t.AuthPayload=d,t.authPayloadSchema={struct:{tag:"u32",message:"string",nonce:{array:{type:"u8",len:32}},recipient:"string",callbackUrl:{option:"string"}}},t.verifySignature=f},45041:function(e,t,r){"use strict";var n=r(75927).Buffer,i=this&&this.__awaiter||function(e,t,r,n){function i(e){return e instanceof r?e:new r(function(t){t(e)})}return new(r||(r=Promise))(function(r,o){function s(e){try{c(n.next(e))}catch(e){o(e)}}function a(e){try{c(n.throw(e))}catch(e){o(e)}}function c(e){e.done?r(e.value):i(e.value).then(s,a)}c((n=n.apply(e,t||[])).next())})},o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.createRequest=t.computeRequestId=t.deleteRequest=t.getResponse=t.getRequest=t.proxyApi=void 0;let s=o(r(7533)),a=o(r(39523)),c=r(17236),u=r(42312);t.proxyApi="https://h4n.app";let l=(e,r)=>i(void 0,void 0,void 0,function*(){let i=yield fetch(`${t.proxyApi}/${e}/request`,{signal:r,headers:{"content-type":"application/json"},method:"GET"});if(!1===i.ok)throw Error((yield i.text()));let{data:o}=yield i.json();return JSON.parse(n.from((0,c.baseDecode)(o)).toString("utf8"))});t.getRequest=l;let d=e=>i(void 0,void 0,void 0,function*(){var r;let n=yield fetch(`${t.proxyApi}/${e}/response`,{headers:{"content-type":"application/json"},method:"GET"});if(!1===n.ok)throw Error((yield n.text()));let{data:i}=yield n.json();return Object.assign({type:"here",public_key:"",account_id:"",payload:"",status:-1,path:""},null!==(r=JSON.parse(i))&&void 0!==r?r:{})});t.getResponse=d;let f=e=>i(void 0,void 0,void 0,function*(){let r=yield fetch(`${t.proxyApi}/${e}`,{headers:{"content-type":"application/json"},method:"DELETE"});if(!1===r.ok)throw Error((yield r.text()))});t.deleteRequest=f;let h=e=>i(void 0,void 0,void 0,function*(){let t=(0,c.baseEncode)(JSON.stringify(Object.assign(Object.assign({},e),{_id:(0,a.default)()}))),r=(0,s.default)(t);return{requestId:n.from(r,"hex").toString("base64").replaceAll("/","_").replaceAll("-","+").slice(0,13),query:t}});t.computeRequestId=h;let p=(e,r)=>i(void 0,void 0,void 0,function*(){let{query:n,requestId:i}=yield(0,t.computeRequestId)(e),o=yield fetch(`${t.proxyApi}/${i}/request`,{method:"POST",body:JSON.stringify({topic_id:(0,u.getDeviceId)(),data:n}),headers:{"content-type":"application/json"},signal:r});if(!1===o.ok)throw Error((yield o.text()));return i});t.createRequest=p},57804:(e,t)=>
39{"use strict";Object.defineProperty(t,"__esModule",{value:!0})},42312:function(e,t,r){"use strict";var n=r(75927).Buffer,i=this&&this.__awaiter||function(e,t,r,n){function i(e){return e instanceof r?e:new r(function(t){t(e)})}return new(r||(r=Promise))(function(r,o){function s(e){try{c(n.next(e))}catch(e){o(e)}}function a(e){try{c(n.throw(e))}catch(e){o(e)}}function c(e){e.done?r(e.value):i(e.value).then(s,a)}c((n=n.apply(e,t||[])).next())})},o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.isValidAccessKey=t.internalThrow=t.getPublicKeys=t.serializeActions=t.isMobile=t.getDeviceId=void 0;let s=o(r(39523)),a=r(27762),c=()=>{let e=(null==window?void 0:window.localStorage.getItem("herewallet-topic"))||(0,s.default)();return null==window||window.localStorage.setItem("herewallet-topic",e),e};t.getDeviceId=c;let u=()=>(null==window?void 0:window.matchMedia("(any-pointer:coarse)").matches)||!1;t.isMobile=u;let l=e=>e.map(e=>{if("FunctionCall"!==e.type)return e;let{args:t,deposit:r,gas:i,methodName:o}=e.params;return ArrayBuffer.isView(t)&&(t=n.from(t.buffer,t.byteOffset,t.byteLength)),t instanceof n&&(t=t.toString("base64")),{type:e.type,params:{args:t,deposit:r,gas:i,methodName:o}}});t.serializeActions=l;let d=(e,t)=>i(void 0,void 0,void 0,function*(){let r=yield fetch(e,{method:"POST",body:JSON.stringify({jsonrpc:"2.0",id:"dontcare",method:"query",params:{request_type:"view_access_key_list",finality:"final",account_id:t}}),headers:{"content-type":"application/json"}});return!1===r.ok?[]:(yield r.json()).result.keys});t.getPublicKeys=d;let f=(e,t,r)=>{if(e instanceof a.HereProviderError)throw e;let n={payload:e instanceof Error?e.message:"UNKNOWN",status:a.HereProviderStatus.FAILED,type:(null==r?void 0:r.type)||"web",account_id:(null==r?void 0:r.id)||""};throw t.onFailed(n),e};t.internalThrow=f;let h=(e,t,r)=>{let{permission:n}=t.access_key;if("FullAccess"===n)return!0;if(n.FunctionCall){let{receiver_id:t,method_names:i}=n.FunctionCall;if(t===e&&i.includes("add_request_and_confirm"))return!0;if(t===r.receiverId)return 1===r.actions.length&&r.actions.every(e=>"FunctionCall"===e.type&&(!e.params.deposit||"0"===e.params.deposit.toString())&&(0===i.length||i.includes(e.params.methodName)))}return!1};t.isValidAccessKey=h},39102:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.waitInjectedHereWallet=void 0,t.waitInjectedHereWallet=new Promise(e=>{if("undefined"==typeof window||(null==window?void 0:window.self)===(null==window?void 0:window.top))return e(null);let t=r=>{"here-wallet-injected"===r.data.type&&(null==window||window.parent.postMessage("here-sdk-init","*"),null==window||window.removeEventListener("message",t),e({ethAddress:r.data.ethAddress,accountId:r.data.accountId,publicKey:r.data.publicKey,telegramId:r.data.telegramId,network:r.data.network||"mainnet"}))};null==window||window.addEventListener("message",t),setTimeout(()=>e(null),2e3)})},66567:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r),Object.defineProperty(e,n,{enumerable:!0,get:function(){return t[r]}})}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),t.HereWallet=void 0;var o=r(47980);Object.defineProperty(t,"HereWallet",{enumerable:!0,get:function(){return o.HereWallet}}),i(r(39102),t),i(r(45041),t),i(r(66958),t),i(r(26685),t),i(r(57804),t),i(r(42312),t),i(r(2237),t),i(r(56426),t),i(r(7070),t),i(r(20512),t),i(r(58608),t),i(r(53780),t),i(r(58796),t),i(r(27762),t)},2237:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){function i(e){return e instanceof r?e:new r(function(t){t(e)})}return new(r||(r=Promise))(function(r,o){function s(e){try{c(n.next(e))}catch(e){o(e)}}function a(e){try{c(n.throw(e))}catch(e){o(e)}}function c(e){e.done?r(e.value):i(e.value).then(s,a)}c((n=n.apply(e,t||[])).next())})};
39Object.defineProperty(t,"__esModule",{value:!0}),t.HereKeyStore=void 0;let i=r(75092),o=r(56426);class s{constructor(e=new o.StateStorage){this.storage=e}setActiveAccount(e,t){return n(this,void 0,void 0,function*(){let r=yield this.storage.getState(e);r.activeAccount=t,this.storage.setState(e,r)})}setKey(e,t,r){return n(this,void 0,void 0,function*(){let n=yield this.storage.getState(e);n.accounts[t]=r.toString(),this.storage.setState(e,n)})}getAccounts(e){return n(this,void 0,void 0,function*(){return Object.keys((yield this.storage.getState(e)).accounts)})}getActiveAccount(e){return n(this,void 0,void 0,function*(){return(yield this.storage.getState(e)).activeAccount})}getKey(e,t){return n(this,void 0,void 0,function*(){let r=(yield this.storage.getState(e)).accounts[t];if(null==r)throw Error(`For ${t} in ${e} network key not found`);return i.KeyPair.fromString(r)})}removeKey(e,t){return n(this,void 0,void 0,function*(){let r=yield this.storage.getState(e);r.activeAccount===t&&(r.activeAccount=null),delete r.accounts[t],this.storage.setState(e,r)})}getNetworks(){return n(this,void 0,void 0,function*(){return Object.keys((yield this.storage.getFullState()).accounts)})}clear(){return n(this,void 0,void 0,function*(){yield this.storage.clear()})}}t.HereKeyStore=s},56426:function(e,t){"use strict";var r=this&&this.__awaiter||function(e,t,r,n){function i(e){return e instanceof r?e:new r(function(t){t(e)})}return new(r||(r=Promise))(function(r,o){function s(e){try{c(n.next(e))}catch(e){o(e)}}function a(e){try{c(n.throw(e))}catch(e){o(e)}}function c(e){e.done?r(e.value):i(e.value).then(s,a)}c((n=n.apply(e,t||[])).next())})};Object.defineProperty(t,"__esModule",{value:!0}),t.StateStorage=void 0;let n={getItem:e=>null,setItem(e,t){},removeItem(e){}};class i{constructor(){this.dataKey="herewallet:keystore",this.storage="undefined"!=typeof window?window.localStorage:n}setState(e,t){return r(this,void 0,void 0,function*(){let r=yield this.getFullState();r[e]=t,this.storage.setItem(this.dataKey,JSON.stringify(r))})}getFullState(){return r(this,void 0,void 0,function*(){try{return JSON.parse(this.storage.getItem(this.dataKey))||{}}catch(e){return{}}})}getState(e){return r(this,void 0,void 0,function*(){return(yield this.getFullState())[e]||{activeAccount:null,accounts:{}}})}clear(){return r(this,void 0,void 0,function*(){this.storage.removeItem(this.dataKey)})}}t.StateStorage=i},7070:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){function i(e){return e instanceof r?e:new r(function(t){t(e)})}return new(r||(r=Promise))(function(r,o){function s(e){try{c(n.next(e))}catch(e){o(e)}}function a(e){try{c(n.throw(e))}catch(e){o(e)}}function c(e){e.done?r(e.value):i(e.value).then(s,a)}c((n=n.apply(e,t||[])).next())})},i=this&&this.__rest||function(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&0>t.indexOf(n)&&(r[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var i=0,n=Object.getOwnPropertySymbols(e);i<n.length;i++)0>t.indexOf(n[i])&&Object.prototype.propertyIsEnumerable.call(e,n[i])&&(r[n[i]]=e[n[i]]);return r};Object.defineProperty(t,"__esModule",{value:!0}),t.HereStrategy=t.getRequest=t.proxyApi=t.deleteRequest=t.getResponse=t.createRequest=void 0;let o=r(27762),s=r(45041);Object.defineProperty(t,"createRequest",{enumerable:!0,get:function(){return s.createRequest}}),Object.defineProperty(t,"getResponse",{enumerable:!0,get:function(){return s.getResponse}}),Object.defineProperty(t,"deleteRequest",{enumerable:!0,get:function(){return s.deleteRequest}}),Object.defineProperty(t,"proxyApi",{enumerable:!0,get:function(){return s.proxyApi}}),Object.defineProperty(t,"getRequest",{enumerable:!0,get:function(){return s.getRequest}});class a{connect(e){return n(this,void 0,void 0,function*(){this.wallet=e})}onInitialized(){return n(this,void 0,void 0,function*(){})}onRequested(e,t,r){return n(this,void 0,void 0,function*(){})}onApproving(e){return n(this,void 0,void 0,function*(){})}onSuccess(e){return n(this,void 0,void 0,function*(){})}onFailed(e){return n(this,void 0,void 0,function*(){})}request(e){return n(this,void 0,void 0,function*(){let{request:t,disableCleanupRequest:r,id:a,signal:c}=e;return i(e,["request","disableCleanupRequest","id","signal"]),null!=a?t=yield(0,s.getRequest)(a,c):a=yield(0,s.createRequest)(t,c),new Promise((e,i)=>{let u=null,l=()=>n(this,void 0,void 0,function*(){clearInterval(u=-1),!0!==r&&(yield(0,s.deleteRequest)(a))}),d=t=>{switch(t.status){case o.HereProviderStatus.APPROVING:this.onApproving(t);return;case o.HereProviderStatus.FAILED:l(),i(new o.HereProviderError(t.payload)),this.onFailed(t);return;case o.HereProviderStatus.SUCCESS:l(),e(t),this.onSuccess(t);return}},f=e=>{var r;d({type:(null===(r=t.selector)||void 0===r?void 0:r.type)||"web",status:o.HereProviderStatus.FAILED,payload:e})};this.onRequested(a,t,f),null==c||c.addEventListener("abort",()=>f());let h=()=>{-1!==u&&(u=setTimeout(()=>n(this,void 0,void 0,function*(){var e;try{let e=yield(0,s.getResponse)(a);if(-1===u)return;d(e),h()}catch(a){let r=o.HereProviderStatus.FAILED,n=a instanceof Error?a:void 0,s=null==n?void 0:n.message;l(),i(new o.HereProviderError(s,n)),this.onFailed({type:(null===(e=t.selector)||void 0===e?void 0:e.type)||"web",status:r,payload:s})}}),3e3))};h()})})}}t.HereStrategy=a},20512:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){function i(e){return e instanceof r?e:new r(function(t){t(e)})}return new(r||(r=Promise))(function(r,o){function s(e){try{c(n.next(e))}catch(e){o(e)}}function a(e){try{c(n.throw(e))}catch(e){o(e)}}function c(e){e.done?r(e.value):i(e.value).then(s,a)}c((n=n.apply(e,t||[])).next())})}
39,i=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.InjectedStrategy=void 0;let o=i(r(39523)),s=r(75092),a=r(27762),c=r(39102),u=r(7070);class l extends u.HereStrategy{connect(e){return n(this,void 0,void 0,function*(){if("undefined"==typeof window)return Promise.resolve();this.wallet=e;let t=yield c.waitInjectedHereWallet;null!=t&&(yield this.wallet.authStorage.setKey(t.network,t.accountId,s.KeyPairEd25519.fromRandom()),yield this.wallet.authStorage.setActiveAccount(t.network,t.accountId))})}request(e){return n(this,void 0,void 0,function*(){return"undefined"==typeof window?Promise.reject("SSR"):window.hotExtension?yield window.hotExtension.request("near:hereConnect",e.request):new Promise(t=>{let r=(0,o.default)(),n=e=>{if(e.data.id===r&&(e.data.status===a.HereProviderStatus.SUCCESS||e.data.status===a.HereProviderStatus.FAILED))return null==window||window.removeEventListener("message",n),t(e.data)};null==window||window.parent.postMessage(Object.assign(Object.assign({$here:!0},e.request),{id:r}),"*"),null==window||window.addEventListener("message",n)})})}}t.InjectedStrategy=l},58608:function(e,t,r){"use strict";var n=r(75927).Buffer,i=this&&this.__awaiter||function(e,t,r,n){function i(e){return e instanceof r?e:new r(function(t){t(e)})}return new(r||(r=Promise))(function(r,o){function s(e){try{c(n.next(e))}catch(e){o(e)}}function a(e){try{c(n.throw(e))}catch(e){o(e)}}function c(e){e.done?r(e.value):i(e.value).then(s,a)}c((n=n.apply(e,t||[])).next())})};Object.defineProperty(t,"__esModule",{value:!0}),t.TelegramAppStrategy=void 0;let o=r(75092),s=r(17236),a=r(27762),c=r(45041),u=r(7070),l=r(42312);class d extends u.HereStrategy{constructor(e="herewalletbot/app",t="herewalletbot/app"){super(),this.appId=e,this.walletId=t}connect(e){var t,r,c,l,d,f;return i(this,void 0,void 0,function*(){if("undefined"==typeof window)return;this.wallet=e;let i=(null===(c=null===(r=null===(t=null==window?void 0:window.Telegram)||void 0===t?void 0:t.WebApp)||void 0===r?void 0:r.initDataUnsafe)||void 0===c?void 0:c.start_param)||"";if(null===(f=null===(l=null==window?void 0:window.Telegram)||void 0===l?void 0:(d=l.WebApp).ready)||void 0===f||f.call(d),i.startsWith("hot")){let e=i.split("-").pop()||"";e=n.from((0,s.baseDecode)(e)).toString("utf8");let t=localStorage.getItem(`__telegramPendings:${e}`);if(null==t)return;let r=yield(0,u.getResponse)(e);if(r.status!==a.HereProviderStatus.SUCCESS){localStorage.removeItem(`__telegramPendings:${e}`);return}"sign"===r.type&&(yield this.wallet.authStorage.setKey("mainnet",r.account_id,o.KeyPairEd25519.fromRandom()),yield this.wallet.authStorage.setActiveAccount("mainnet",r.account_id));try{let n=JSON.parse(t);n.privateKey&&(yield this.wallet.authStorage.setKey("mainnet",r.account_id,o.KeyPair.fromString(n.privateKey)),yield this.wallet.authStorage.setActiveAccount("mainnet",r.account_id));let i=new URL(location.origin+(n.callbackUrl||""));i.searchParams.set("payload",r.result),localStorage.removeItem(`__telegramPendings:${e}`),location.assign(i.toString())}catch(n){let t=new URL(location.href);t.searchParams.set("payload",r.result),localStorage.removeItem(`__telegramPendings:${e}`),location.assign(t.toString())}}})}request(e){var t;return i(this,void 0,void 0,function*(){if("undefined"==typeof window)return;e.request.telegramApp=this.appId,e.request.callbackUrl="";let{requestId:r,query:n}=yield(0,c.computeRequestId)(e.request),i=yield fetch(`${c.proxyApi}/${r}/request`,{method:"POST",body:JSON.stringify({topic_id:(0,l.getDeviceId)(),data:n}),headers:{"content-type":"application/json"},signal:e.signal});if(!1===i.ok)throw Error((yield i.text()));localStorage.setItem(`__telegramPendings:${r}`,JSON.stringify({callbackUrl:e.callbackUrl,privateKey:null===(t=e.accessKey)||void 0===t?void 0:t.toString()})),this.onRequested(r)})}onRequested(e){var t,r,n,o;return i(this,void 0,void 0,function*(){"undefined"!=typeof window&&(e=(0,s.baseEncode)(e),null===(r=null===(t=null==window?void 0:window.Telegram)||void 0===t?void 0:t.WebApp)||void 0===r||r.openTelegramLink(`https://t.me/${this.walletId}?startapp=h4n-${e}`),null===(o=null===(n=null==window?void 0:window.Telegram)||void 0===n?void 0:n.WebApp)||void 0===o||o.close())})}}t.TelegramAppStrategy=d},53780:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){function i(e){return e instanceof r?e:new r(function(t){t(e)})}return new(r||(r=Promise))(function(r,o){function s(e){try{c(n.next(e))}catch(e){o(e)}}function a(e){try{c(n.throw(e))}catch(e){o(e)}}function c(e){e.done?r(e.value):i(e.value).then(s,a)}c((n=n.apply(e,t||[])).next())})};
39Object.defineProperty(t,"__esModule",{value:!0}),t.WidgetStrategy=t.defaultUrl=void 0;let i=r(7070),o=e=>{let t=document.createElement("iframe");return t.src=e,t.allow="usb",t.style.border="none",t.style.zIndex="10000",t.style.position="fixed",t.style.display="none",t.style.top="0",t.style.left="0",t.style.width="100%",t.style.height="100%",document.body.appendChild(t),t};t.defaultUrl="https://my.herewallet.app/connector/index.html";class s extends i.HereStrategy{constructor(e={widget:t.defaultUrl,lazy:!1}){super(),this.options={lazy:"object"==typeof e&&(e.lazy||!1),widget:"string"==typeof e?e:e.widget||t.defaultUrl},this.options.lazy||this.initIframe()}initIframe(){return null==s.connector&&(s.connector=o(this.options.widget),s.connector.addEventListener("load",()=>{s.isLoaded=!0})),s.connector}onRequested(e,t,r){return n(this,void 0,void 0,function*(){let n=this.initIframe();n.style.display="block";let i=()=>{var r,n,o;null===(r=s.connector)||void 0===r||r.removeEventListener("load",i),null===(o=null===(n=s.connector)||void 0===n?void 0:n.contentWindow)||void 0===o||o.postMessage(JSON.stringify({type:"request",payload:{id:e,request:t}}),new URL(this.options.widget).origin)};s.isLoaded?i():n.addEventListener("load",i),this.messageHandler=e=>{try{if(e.origin!==new URL(this.options.widget).origin)return;"reject"===JSON.parse(e.data).type&&r()}catch(e){}},null==window||window.addEventListener("message",this.messageHandler)})}postMessage(e){var t;let r=this.initIframe(),n=JSON.stringify(e),i=new URL(this.options.widget).origin;null===(t=r.contentWindow)||void 0===t||t.postMessage(n,i)}onApproving(){return n(this,void 0,void 0,function*(){this.postMessage({type:"approving"})})}onSuccess(e){return n(this,void 0,void 0,function*(){console.log(e),this.postMessage({type:"result",payload:{request:e}}),this.close()})}onFailed(e){return n(this,void 0,void 0,function*(){this.postMessage({type:"result",payload:{request:e}}),this.close()})}close(){this.messageHandler&&(null==window||window.removeEventListener("message",this.messageHandler),this.messageHandler=void 0),s.connector&&(s.connector.style.display="none")}}t.WidgetStrategy=s,s.isLoaded=!1},58796:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){function i(e){return e instanceof r?e:new r(function(t){t(e)})}return new(r||(r=Promise))(function(r,o){function s(e){try{c(n.next(e))}catch(e){o(e)}}function a(e){try{c(n.throw(e))}catch(e){o(e)}}function c(e){e.done?r(e.value):i(e.value).then(s,a)}c((n=n.apply(e,t||[])).next())})};Object.defineProperty(t,"__esModule",{value:!0}),t.WindowStrategy=void 0;let i=r(7070);class o extends i.HereStrategy{constructor(e="https://my.herewallet.app"){super(),this.endpoint=e,this.signWindow=null}onInitialized(){return n(this,void 0,void 0,function*(){if(this.signWindow)return;let e=window.innerWidth/2-210,t=window.innerHeight/2-350;this.signWindow=window.open(`${this.endpoint}/loading`,"_blank",`popup=1,width=420,height=700,top=${t},left=${e}`)})}onRequested(e,t,r){return n(this,void 0,void 0,function*(){null!=this.signWindow&&(this.unloadHandler=()=>{var e;return null===(e=this.signWindow)||void 0===e?void 0:e.close()},window.addEventListener("beforeunload",this.unloadHandler),this.signWindow.location=`${this.endpoint}/request/${e}`,this.timerHandler=setInterval(()=>{var e;(null===(e=this.signWindow)||void 0===e?void 0:e.closed)&&r("CLOSED")},1e3))})}close(){var e;clearInterval(this.timerHandler),null===(e=this.signWindow)||void 0===e||e.close(),this.signWindow=null,this.unloadHandler&&window.removeEventListener("beforeunload",this.unloadHandler)}onFailed(){return n(this,void 0,void 0,function*(){this.close()})}onSuccess(){return n(this,void 0,void 0,function*(){this.close()})}}t.WindowStrategy=o},470:function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){function i(e){return e instanceof r?e:new r(function(t){t(e)})}return new(r||(r=Promise))(function(r,o){function s(e){try{c(n.next(e))}catch(e){o(e)}}function a(e){try{c(n.throw(e))}catch(e){o(e)}}function c(e){e.done?r(e.value):i(e.value).then(s,a)}c((n=n.apply(e,t||[])).next())})}
39,i=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.hereWalletProvider=void 0;let o=i(r(39523)),s=r(39102),a={},c=(e,t)=>new Promise((r,n)=>{let i=(0,o.default)();null==window||window.parent.postMessage({type:e,id:i,args:t},"*"),a[i]={resolve:r,reject:n}}),u={on(){},isHereWallet:!0,isConnected:()=>!0,request:e=>c("ethereum",e)};function l(){return n(this,void 0,void 0,function*(){"undefined"!=typeof window&&null!=(yield s.waitInjectedHereWallet)&&(null==window||window.dispatchEvent(new CustomEvent("eip6963:announceProvider",{detail:Object.freeze({provider:u,info:{uuid:(0,o.default)(),name:"HERE Wallet",icon:"data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNTUwIiBoZWlnaHQ9IjU1MCIgdmlld0JveD0iMCAwIDU1MCA1NTAiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+CjxyZWN0IHdpZHRoPSI1NTAiIGhlaWdodD0iNTUwIiByeD0iMTIwIiBmaWxsPSIjRjNFQkVBIj48L3JlY3Q+CjxwYXRoIGZpbGwtcnVsZT0iZXZlbm9kZCIgY2xpcC1ydWxlPSJldmVub2RkIiBkPSJNMjcyLjA0NiAxODMuNTM4TDI5My43ODggMTQzTDMyMi4yODggMjM4LjVMMjc5LjU1OCAyMTkuMTgyTDI3Mi4wNDYgMTgzLjUzOFpNMTE4LjI4OCAyMjZMOTYuMTg0IDI2NS44NTdMMTYzLjc2OSAyOTguOTJMMjU2Ljc4OCAyOTIuNUwxMTguMjg4IDIyNlpNMTA1Ljk2OSAzMDEuMTU4TDg0IDM0MC44MDNMMjE4LjkzNyA0MDcuNzkxTDQ0My44MDcgMzk0LjE0MUw0NjUuNzc2IDM1NC40OTZMMjQwLjkwNiAzNjguMTQ3TDEwNS45NjkgMzAxLjE1OFoiIGZpbGw9IiMy
39QzMwMzQiPjwvcGF0aD4KPHBhdGggZD0iTTQ2NS43ODggMzU0LjVMMjQwLjk4MiAzNjguMTUzTDEwNC44ODcgMzAxLjAwNUwyNTIuMjU5IDI5Mi4wODhMMTE4LjI4OCAyMjZMMTg0LjA3NiAxNzAuMjgyTDMyMC41NDcgMjM3LjM5N0wyOTMuNzg5IDE0My4wMDFMNDI0LjE5NSAyMDYuOTQ5TDQ2NS43ODggMzU0LjVaIiBmaWxsPSIjRkRCRjFDIj48L3BhdGg+Cjwvc3ZnPg==",rdns:"app.herewallet.my"}})})))})}t.hereWalletProvider=u,"undefined"!=typeof window&&(null==window||window.addEventListener("message",e=>{var t,r;if("ethereum"===e.data.type){if(e.data.isSuccess)return null===(t=a[e.data.id])||void 0===t?void 0:t.resolve(e.data.result);null===(r=a[e.data.id])||void 0===r||r.reject(e.data.result)}}),null==window||window.addEventListener("eip6963:requestProvider",()=>l()),l())},27762:(e,t)=>{"use strict";var r;Object.defineProperty(t,"__esModule",{value:!0}),t.HereProviderError=t.HereProviderStatus=void 0,function(e){e[e.APPROVING=1]="APPROVING",e[e.FAILED=2]="FAILED",e[e.SUCCESS=3]="SUCCESS"}(r=t.HereProviderStatus||(t.HereProviderStatus={}));class n extends Error{constructor(e,t){super(null!=e?e:null==t?void 0:t.message),this.payload=e,this.parentError=t}}t.HereProviderError=n},47980:function(e,t,r){"use strict";var n=r(75927).Buffer,i=this&&this.__awaiter||function(e,t,r,n){function i(e){return e instanceof r?e:new r(function(t){t(e)})}return new(r||(r=Promise))(function(r,o){function s(e){try{c(n.next(e))}catch(e){o(e)}}function a(e){try{c(n.throw(e))}catch(e){o(e)}}function c(e){e.done?r(e.value):i(e.value).then(s,a)}c((n=n.apply(e,t||[])).next())})},o=this&&this.__rest||function(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&0>t.indexOf(n)&&(r[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var i=0,n=Object.getOwnPropertySymbols(e);i<n.length;i++)0>t.indexOf(n[i])&&Object.prototype.propertyIsEnumerable.call(e,n[i])&&(r[n[i]]=e[n[i]]);return r},s=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.HereWallet=void 0;let a=r(87685),c=r(66962),u=r(76975),l=r(75092),d=r(74496),f=r(11341),h=s(r(5852)),p=r(26685),y=r(66958),g=r(42312),m=r(2237),b=r(53780),v=r(27762),w=r(58608),_=r(20512),E=r(39102),S=r(470);class x extends Error{}class A{constructor({injected:e,nodeUrl:t,networkId:r="mainnet",authStorage:n,defaultStrategy:i}={}){this.authStorage=n,this.strategy=i,Object.defineProperty(this,"ethAddress",{get:()=>null==e?void 0:e.ethAddress}),Object.defineProperty(this,"telegramId",{get:()=>null==e?void 0:e.telegramId}),Object.defineProperty(this,"ethProvider",{get:()=>(null==e?void 0:e.ethAddress)?S.hereWalletProvider:null});let o=new c.InMemorySigner(this.authStorage),s=new u.JsonRpcProvider({url:null!=t?t:`https://rpc.${r}.near.org`});this.connection=a.Connection.fromConfig({jsvmAccountId:`jsvm.${r}`,provider:s,networkId:r,signer:o})}static connect(e={}){var t;return i(this,void 0,void 0,function*(){if(null==e.authStorage&&(e.authStorage=new m.HereKeyStore),e.defaultStrategy){let t=new A(e);return yield t.strategy.connect(t),t}if("undefined"!=typeof window){if(window.hotExtension)return e.defaultStrategy=new _.InjectedStrategy,new A(e);if(window!==parent){let t=yield E.waitInjectedHereWallet;if(null!=t){e.defaultStrategy=new _.InjectedStrategy;let r=new A(Object.assign(Object.assign({},e),{injected:t}));return yield r.strategy.connect(r),r}}if((null===(t=window.Telegram)||void 0===t?void 0:t.WebApp)!=null){e.defaultStrategy=new w.TelegramAppStrategy(e.botId,e.walletId);let t=new A(e);return yield t.strategy.connect(t),t}}e.defaultStrategy=new b.WidgetStrategy;let r=new A(e);return yield r.strategy.connect(r),r})}get rpc(){return this.connection.provider}get signer(){return this.connection.signer}get networkId(){return this.connection.networkId}account(e){return i(this,void 0,void 0,function*(){let t=null!=e?e:yield this.authStorage.getActiveAccount(this.networkId);if(null==t)throw new x("Wallet not signed in");return new a.Account(this.connection,t)})}isSignedIn(){return i(this,void 0,void 0,function*(){return null!=(yield this.authStorage.getActiveAccount(this.networkId))})}signOut(){return i(this,void 0,void 0,function*(){let e=yield this.authStorage.getActiveAccount(this.networkId);if(null==e)throw Error("Wallet not signed in");let t=yield this.authStorage.getKey(this.networkId,e);if(null!=t){let r=t.getPublicKey().toString();yield this.silentSignAndSendTransaction({receiverId:e,actions:[{type:"DeleteKey",params:{publicKey:r}}]}).catch(()=>{})}yield this.authStorage.removeKey(this.networkId,e)})}getHereBalance(e){return i(this,void 0,void 0,function*(){let t=yield this.account(e),r="mainnet"===this.networkId?"here.storage.near":"here.storage.testnet",n=yield t.viewFunction({args:{account_id:t.accountId},methodName:"ft_balance_of",contractId:r}).catch(()=>"0");return new h.default(n)})}getAvailableBalance(e){return i(this,void 0,void 0,function*(){let t=yield this.account(e),r=yield t.getAccountBalance(),n=yield this.getHereBalance();return new h.default(r.available).add(new h.default(n))})}getAccounts(){return i(this,void 0,void 0,function*(){return yield this.authStorage.getAccounts(this.networkId)})}getAccountId(){return i(this,void 0,void 0,function*(){let e=yield this.authStorage.getActiveAccount(this.networkId);if(null==e)throw Error("Wallet not signed in");return e})}switchAccount(e){return i(this,void 0,void 0,function*(){if(null==(yield this.authStorage.getKey(this.networkId,e)))throw Error(`Account ${e} not signed in`);yield this.authStorage.setActiveAccount(this.networkId,e)})}signIn({contractId:e,allowance:t,methodNames:r=[],strategy:n=this.strategy,signal:o,callbackUrl:s,selector:a}={}){return i(this,void 0,void 0,function*(){if(null==e){let{accountId:e}=yield this.authenticate({strategy:n,signal:o,selector:a});return yield this.authStorage.setKey(this.networkId,e,l.KeyPairEd25519.fromRandom()),yield this.authStorage.setActiveAccount(this.networkId,e),e}yield n.onInitialized();try{let i=l.KeyPair.fromRandom("ed25519"),c={receiverId:e,methodNames:r,allowance:t},u=yield n.request({signal:o,accessKey:i,callbackUrl:s,request:{type:"call",network:this.networkId,selector:a||{},transactions:[{actions:[{type:"AddKey",params:{publicKey:i.getPublicKey().toString(),accessKey:{permission:c}}}]}]}});if(null==u.account_id)throw Error("Transaction is failed");return yield this.authStorage.setKey(this.networkId,u.account_id,i),yield this.authStorage.setActiveAccount(this.networkId,u.account_id),u.account_id}catch(e){throw(0,g.internalThrow)(e,n,a),e}})}silentSignAndSendTransaction({actions:e,receiverId:t,signerId:r}){return i(this,void 0,void 0,function*(){let n=yield this.account(r),i=yield this.authStorage.getKey(this.networkId,n.accountId).catch(()=>null);if(null==i)throw new x;let o=i.getPublicKey(),s=yield n.getAccessKeys(),a={receiverId:t,actions:e};if(!1===s.some(e=>e.public_key===o.toString()&&(0,g.isValidAccessKey)(n.accountId,e,a)))throw new x;return yield n.signAndSendTransaction({actions:e.map(e=>(0,p.createAction)(e)),receiverId:null!=t?t:n.accountId})})}signAndSendTransaction(e){return i(this,void 0,void 0,function*(){let{signerId:t,receiverId:r,actions:n,callbackUrl:i,strategy:o=this.strategy,signal:s,selector:a}=e;yield o.onInitialized();try{let e=yield this.silentSignAndSendTransaction({receiverId:r,actions:n,signerId:t}),i={type:"web",status:v.HereProviderStatus.SUCCESS,payload:null==e?void 0:e.transaction_outcome.id};return o.onSuccess(i),e}catch(c){try{if(!(c instanceof x)&&(null==c?void 0:c.type)!=="NotEnoughAllowance")throw(0,g.internalThrow)(c,o,a),c;let u=yield this.getAccountId().catch(()=>void 0),l=yield o.request({signal:s,callbackUrl:i,request:{type:"call",network:this.networkId,transactions:[{actions:(0,g.serializeActions)(n),receiverId:r,signerId:t}
39],selector:e.selector||{id:t||u}}});if(null==l.payload||null==l.account_id)throw Error("Transaction not found, but maybe executed");return yield this.rpc.txStatus(l.payload,l.account_id,"INCLUDED")}catch(e){throw(0,g.internalThrow)(e,o,a),e}}})}verifyMessageNEP0413(e,t){return i(this,void 0,void 0,function*(){if(!(0,y.verifySignature)(e,t))throw Error("Incorrect signature");let r=yield this.account(t.accountId);if(!(yield r.getAccessKeys()).some(e=>e.public_key===t.publicKey&&"FullAccess"===e.access_key.permission))throw Error("Signer public key is not full access");return!0})}authenticate(e={}){var t,r,n;return i(this,void 0,void 0,function*(){let i={nonce:null!==(t=e.nonce)&&void 0!==t?t:(0,d.randomBytes)(32),recipient:null!==(r=e.recipient)&&void 0!==r?r:null==window?void 0:window.location.host,message:null!==(n=e.message)&&void 0!==n?n:"Authenticate"},o=yield this.signMessage(Object.assign(Object.assign({},i),e));return yield this.verifyMessageNEP0413(i,o),o})}signMessage(e){return i(this,void 0,void 0,function*(){let{strategy:t=this.strategy,signal:r,selector:n,callbackUrl:i}=e;if(yield t.onInitialized(),"receiver"in e)return yield this.legacySignMessage(e);let o=yield this.getAccountId().catch(()=>void 0),s=yield t.request({signal:r,callbackUrl:i,request:{type:"sign",message:e.message,recipient:e.recipient,nonce:Array.from(e.nonce),network:this.networkId,selector:n||{id:o}}});if((null==s?void 0:s.payload)==null)throw Error("Signature not found");let{publicKey:a,signature:c,accountId:u}=JSON.parse(s.payload);return{publicKey:a,signature:c,accountId:u}})}legacySignMessage(e){var{receiver:t,message:r,nonce:s}=e,a=o(e,["receiver","message","nonce"]);return i(this,void 0,void 0,function*(){if(null==s){let e=new Uint8Array(32);s=[...crypto.getRandomValues(e)]}let{strategy:e=this.strategy,callbackUrl:i,selector:o,signal:c}=a,u=yield this.getAccountId().catch(()=>void 0),d=yield e.request({signal:c,callbackUrl:i,request:{type:"sign",network:this.networkId,selector:o||{id:u},message:r,receiver:t,nonce:s}});if((null==d?void 0:d.payload)==null)throw Error("Signature not found");try{let{publicKey:e,signature:i,accountId:o}=JSON.parse(d.payload),a=new Uint8Array(n.from(i,"base64")),c=JSON.stringify({message:r,receiver:t,nonce:s}),u=new Uint8Array(f.sha256.digest("NEP0413:"+c)),h=l.PublicKey.from(e).verify(u,a);if(!1===h)throw Error();let p=yield this.account(o),y=yield p.getAccessKeys(),g=e.toString(),m=y.some(e=>e.public_key===g&&"FullAccess"===e.access_key.permission);if(!1===m)throw Error();return{signature:new Uint8Array(n.from(i,"base64")),publicKey:l.PublicKey.from(e),message:"NEP0413:"+c,receiver:t,accountId:o,nonce:s}}catch(e){throw Error("Signature not correct")}})}signAndSendTransactions(e){var{transactions:t}=e,r=o(e,["transactions"]);return i(this,void 0,void 0,function*(){let{strategy:e=this.strategy,selector:n,callbackUrl:i,signal:o}=r;yield e.onInitialized();let s=[];try{for(let e of t){let t=yield this.silentSignAndSendTransaction(e);s.push(t)}let r=s.map(e=>e.transaction_outcome.id).join(","),n={type:"web",status:v.HereProviderStatus.SUCCESS,payload:r};return e.onSuccess(n),s}catch(r){try{if(!(r instanceof x)&&(null==r?void 0:r.type)!=="NotEnoughAllowance")throw(0,g.internalThrow)(r,e,n),r;let a=yield this.getAccountId().catch(()=>void 0),c=t.slice(s.length),u=yield e.request({signal:o,callbackUrl:i,request:{type:"call",network:this.networkId,selector:n||{id:c[0].signerId||a},transactions:c.map(e=>Object.assign(Object.assign({},e),{actions:(0,g.serializeActions)(e.actions)}))}});if(null==u.payload||null==u.account_id)throw Error("Transaction not found, but maybe executed");let l=u.payload.split(",").map(e=>this.rpc.txStatus(e,u.account_id,"INCLUDED"));return yield Promise.all(l)}catch(t){throw(0,g.internalThrow)(t,e,n),t}}})}}t.HereWallet=A},70004:(e,t,r)=>{"use strict";var n=r(75927).Buffer;Object.defineProperty(t,"__esModule",{value:!0}),t.Account=void 0;let i=r(75092),o=r(76975),s=r(14100),a=r(20557),c=r(97553),u=r(17822),{addKey:l,createAccount:d,deleteAccount:f,deleteKey:h,deployContract:p,fullAccessKey:y,functionCall:g,functionCallAccessKey:m,stake:b,transfer:v}=s.actionCreators,w=12,_=500,E=1.5;class S{connection;accountId;constructor(e,t){this.connection=e,this.accountId=t}getConnection(){return this.connection}async state(){return this.connection.provider.query({request_type:"view_account",account_id:this.accountId,finality:"optimistic"})}async signTransaction(e,t){let r=await this.findAccessKey(e,t);if(!r)throw new a.TypedError(`Can not sign transactions for account ${this.accountId} on network ${this.connection.networkId}, no matching key pair exists for this account`,"KeyNotFound");let{accessKey:n}=r,i=(await this.connection.provider.block({finality:"final"})).header.hash,o=n.nonce+1n;return await (0,s.signTransaction)(e,o,t,(0,c.baseDecode)(i),this.connection.signer,this.accountId,this.connection.networkId)}async signAndSendTransaction({receiverId:e,actions:t,returnError:r}){let n,i;let s=await (0,o.exponentialBackoff)(_,w,E,async()=>{[n,i]=await this.signTransaction(e,t);let r=i.transaction.publicKey;try{return await this.connection.provider.sendTransaction(i)}
39catch(t){if("InvalidNonce"===t.type)return c.Logger.warn(`Retrying transaction ${e}:${(0,c.baseEncode)(n)} with new nonce.`),delete this.accessKeyByPublicKeyCache[r.toString()],null;if("Expired"===t.type)return c.Logger.warn(`Retrying transaction ${e}:${(0,c.baseEncode)(n)} due to expired block hash`),null;throw t.context=new a.ErrorContext((0,c.baseEncode)(n)),t}});if(!s)throw new a.TypedError("nonce retries exceeded for transaction. This usually means there are too many parallel requests with the same access key.","RetriesExceeded");if((0,c.printTxOutcomeLogsAndFailures)({contractId:i.transaction.receiverId,outcome:s}),!r&&"object"==typeof s.status&&"object"==typeof s.status.Failure&&null!==s.status.Failure){if(s.status.Failure.error_message&&s.status.Failure.error_type)throw new a.TypedError(`Transaction ${s.transaction_outcome.id} failed. ${s.status.Failure.error_message}`,s.status.Failure.error_type);throw(0,c.parseResultError)(s)}return s}accessKeyByPublicKeyCache={};async findAccessKey(e,t){let r=await this.connection.signer.getPublicKey(this.accountId,this.connection.networkId);if(!r)throw new a.TypedError(`no matching key pair found in ${this.connection.signer}`,"PublicKeyNotFound");let n=this.accessKeyByPublicKeyCache[r.toString()];if(void 0!==n)return{publicKey:r,accessKey:n};try{let e=await this.connection.provider.query({request_type:"view_access_key",account_id:this.accountId,public_key:r.toString(),finality:"optimistic"}),t={...e,nonce:BigInt(e.nonce||0)};if(this.accessKeyByPublicKeyCache[r.toString()])return{publicKey:r,accessKey:this.accessKeyByPublicKeyCache[r.toString()]};return this.accessKeyByPublicKeyCache[r.toString()]=t,{publicKey:r,accessKey:t}}catch(e){if("AccessKeyDoesNotExist"==e.type)return null;throw e}}async createAndDeployContract(e,t,r,n){let o=y();return await this.signAndSendTransaction({receiverId:e,actions:[d(),v(n),l(i.PublicKey.from(t),o),p(r)]}),new S(this.connection,e)}async sendMoney(e,t){return this.signAndSendTransaction({receiverId:e,actions:[v(t)]})}async createAccount(e,t,r){let n=y();return this.signAndSendTransaction({receiverId:e,actions:[d(),v(r),l(i.PublicKey.from(t),n)]})}async deleteAccount(e){return c.Logger.log("Deleting an account does not automatically transfer NFTs and FTs to the beneficiary address. Ensure to transfer assets before deleting."),this.signAndSendTransaction({receiverId:this.accountId,actions:[f(e)]})}async deployContract(e){return this.signAndSendTransaction({receiverId:this.accountId,actions:[p(e)]})}encodeJSContractArgs(e,t,r){return n.concat([n.from(e),n.from([0]),n.from(t),n.from([0]),n.from(r)])}async functionCall({contractId:e,methodName:t,args:r={},gas:n=c.DEFAULT_FUNCTION_CALL_GAS,attachedDeposit:i,walletMeta:o,walletCallbackUrl:a,stringify:u,jsContract:l}){let d;return this.validateArgs(r),d=l?["call_js_contract",this.encodeJSContractArgs(e,t,JSON.stringify(r)),n,i,null,!0]:[t,r,n,i,void 0===u?s.stringifyJsonOrBytes:u,!1],this.signAndSendTransaction({receiverId:l?this.connection.jsvmAccountId:e,actions:[g.apply(void 0,d)],walletMeta:o,walletCallbackUrl:a})}async addKey(e,t,r,n){let o;return r||(r=[]),Array.isArray(r)||(r=[r]),o=t?m(t,r,n):y(),this.signAndSendTransaction({receiverId:this.accountId,actions:[l(i.PublicKey.from(e),o)]})}async deleteKey(e){return this.signAndSendTransaction({receiverId:this.accountId,actions:[h(i.PublicKey.from(e))]})}async stake(e,t){return this.signAndSendTransaction({receiverId:this.accountId,actions:[b(t,i.PublicKey.from(e))]})}async signedDelegate({actions:e,blockHeightTtl:t,receiverId:r}){let{provider:n,signer:i}=this.connection,{header:o}=await n.block({finality:"final"}),{accessKey:a,publicKey:c}=await this.findAccessKey(null,null),u=(0,s.buildDelegateAction)({actions:e,maxBlockHeight:BigInt(o.height)+BigInt(t),nonce:BigInt(a.nonce)+1n,publicKey:c,receiverId:r,senderId:this.accountId}),{signedDelegateAction:l}=await (0,s.signDelegateAction)({delegateAction:u,signer:{sign:async e=>{let{signature:t}=await i.signMessage(e,u.senderId,this.connection.networkId);return t}}});return l}validateArgs(e){if((void 0===e.byteLength||e.byteLength!==e.length)&&(Array.isArray(e)||"object"!=typeof e))throw new a.PositionalArgsError}async viewFunction(e){return await (0,u.viewFunction)(this.connection,e)}async viewState(e,t={finality:"optimistic"}){return await (0,u.viewState)(this.connection,this.accountId,e,t)}async getAccessKeys(){let e=await this.connection.provider.query({request_type:"view_access_key_list",account_id:this.accountId,finality:"optimistic"});return e?.keys?.map(e=>({...e,access_key:{...e.access_key,nonce:BigInt(e.access_key.nonce)}}))}async getAccountDetails(){return{authorizedApps:(await this.getAccessKeys()).filter(e=>"FullAccess"!==e.access_key.permission).map(e=>{let t=e.access_key.permission;return{contractId:t.FunctionCall.receiver_id,amount:t.FunctionCall.allowance,publicKey:e.public_key}})}}async getAccountBalance(){let e=await this.connection.provider.experimental_protocolConfig({finality:"final"}),t=await this.state(),r=BigInt(e.runtime_config.storage_amount_per_byte),n=BigInt(t.storage_usage)*r,i=BigInt(t.locked),o=BigInt(t.amount)+i,s=o-(i>n?i:n);return{total:o.toString(),stateStaked:n.toString(),staked:i.toString(),available:s.toString()}}async getActiveDelegatedStakeBalance(){let e=await this.connection.provider.block({finality:"final"}
39),t=e.header.hash,r=e.header.epoch_id,{current_validators:n,next_validators:i,current_proposals:o}=await this.connection.provider.validators(r),s=new Set;[...n,...i,...o].forEach(e=>s.add(e.account_id));let a=[...s],c=a.map(e=>this.viewFunction({contractId:e,methodName:"get_account_total_balance",args:{account_id:this.accountId},blockQuery:{blockId:t}})),u=await Promise.allSettled(c);if(u.some(e=>"rejected"===e.status&&"TimeoutError"===e.reason.type))throw Error("Failed to get delegated stake balance");let l=u.reduce((e,t,r)=>{let n=a[r];if("fulfilled"===t.status){let r=BigInt(t.value);if(0n!==r)return{...e,stakedValidators:[...e.stakedValidators,{validatorId:n,amount:r.toString()}],total:e.total+r}}return"rejected"===t.status?{...e,failedValidators:[...e.failedValidators,{validatorId:n,error:t.reason}]}:e},{stakedValidators:[],failedValidators:[],total:0n});return{...l,total:l.total.toString()}}}t.Account=S},96440:(e,t,r)=>{"use strict";var n=r(75927).Buffer;Object.defineProperty(t,"__esModule",{value:!0}),t.Account2FA=void 0;let i=r(75092),o=r(20557),s=r(14100),a=r(97553),c=r(67895),u=r(11206),l=r(71722),{addKey:d,deleteKey:f,deployContract:h,fullAccessKey:p,functionCall:y,functionCallAccessKey:g}=s.actionCreators;class m extends c.AccountMultisig{sendCode;getCode;verifyCode;onConfirmResult;helperUrl="https://helper.testnet.near.org";constructor(e,t,r){super(e,t,r),this.helperUrl=r.helperUrl||this.helperUrl,this.storage=r.storage,this.sendCode=r.sendCode||this.sendCodeDefault,this.getCode=r.getCode||this.getCodeDefault,this.verifyCode=r.verifyCode||this.verifyCodeDefault,this.onConfirmResult=r.onConfirmResult}async signAndSendTransaction({receiverId:e,actions:t}){await super.signAndSendTransaction({receiverId:e,actions:t}),await this.sendCode();let r=await this.promptAndVerify();return this.onConfirmResult&&await this.onConfirmResult(r),r}async deployMultisig(e){let{accountId:t}=this,r=(await this.getRecoveryMethods()).data.filter(({kind:e,publicKey:t})=>("phrase"===e||"ledger"===e)&&null!==t).map(e=>e.publicKey),i=(await this.getAccessKeys()).filter(({public_key:e,access_key:{permission:t}})=>"FullAccess"===t&&!r.includes(e)).map(e=>e.public_key).map(b),s=b((await this.postSignedJson("/2fa/getAccessKey",{accountId:t})).publicKey),c=n.from(JSON.stringify({num_confirmations:2})),p=[...i.map(e=>f(e)),...i.map(e=>d(e,g(t,u.MULTISIG_CHANGE_METHODS,null))),d(s,g(t,u.MULTISIG_CONFIRM_METHODS,null)),h(e)],m=p.concat(y("new",c,u.MULTISIG_GAS,u.MULTISIG_DEPOSIT));a.Logger.log("deploying multisig contract for",t);let{stateStatus:v}=await this.checkMultisigCodeAndStateStatus(e);switch(v){case l.MultisigStateStatus.STATE_NOT_INITIALIZED:return await super.signAndSendTransactionWithAccount(t,m);case l.MultisigStateStatus.VALID_STATE:return await super.signAndSendTransactionWithAccount(t,p);case l.MultisigStateStatus.INVALID_STATE:throw new o.TypedError(`Can not deploy a contract to account ${this.accountId} on network ${this.connection.networkId}, the account has existing state.`,"ContractHasExistingState");default:throw new o.TypedError(`Can not deploy a contract to account ${this.accountId} on network ${this.connection.networkId}, the account state could not be verified.`,"ContractStateUnknown")}}async disableWithFAK({contractBytes:e,cleanupContractBytes:t}){let r=[];t&&(await this.deleteAllRequests().catch(e=>e),r=await this.get2faDisableCleanupActions(t));let n=[...r,...await this.get2faDisableKeyConversionActions(),h(e)],i=await this.findAccessKey(this.accountId,n);if(i&&i.accessKey&&"FullAccess"!==i.accessKey.permission)throw new o.TypedError("No full access key found in keystore. Unable to bypass multisig","NoFAKFound");return this.signAndSendTransactionWithAccount(this.accountId,n)}async get2faDisableCleanupActions(e){let t=await this.viewState("").catch(e=>{let t=e.cause&&e.cause.name;if("NO_CONTRACT_CODE"==t)return[];throw"TOO_LARGE_CONTRACT_STATE"==t?new o.TypedError(`Can not deploy a contract to account ${this.accountId} on network ${this.connection.networkId}, the account has existing state.`,"ContractHasExistingState"):e}),r=t.map(({key:e})=>e.toString("base64"));return t.length?[h(e),y("clean",{keys:r},u.MULTISIG_GAS,0n)]:[]}async get2faDisableKeyConversionActions(){let{accountId:e}=this,t=(await this.getAccessKeys()).filter(({access_key:e})=>"FullAccess"!==e.permission).filter(({access_key:t})=>{let r=t.permission.FunctionCall;return r.receiver_id===e&&4===r.method_names.length&&r.method_names.includes("add_request_and_confirm")});return[f(i.PublicKey.from((await this.postSignedJson("/2fa/getAccessKey",{accountId:e})).publicKey)),...t.map(({public_key:e})=>f(i.PublicKey.from(e))),...t.map(({public_key:e})=>d(i.PublicKey.from(e),p()))]}async disable(e,t){let r;let{stateStatus:n}=await this.checkMultisigCodeAndStateStatus();if(n!==l.MultisigStateStatus.VALID_STATE&&n!==l.MultisigStateStatus.STATE_NOT_INITIALIZED)throw new o.TypedError(`Can not deploy a contract to account ${this.accountId} on network ${this.connection.networkId}, the account state could not be verified.`,"ContractStateUnknown");await this.deleteAllRequests().catch(e=>r=e);let i=[...await this.get2faDisableCleanupActions(t).catch(e=>{if("ContractHasExistingState"===e.type)throw r||e;throw e}),...await this.get2faDisableKeyConversionActions(),h(e)];return a.Logger.log("disabling 2fa for",this.accountId),await this.signAndSendTransaction({receiverId:this.accountId,actions:i})}async sendCodeDefault(){let{accountId:e}=this,{requestId:t}
39=this.getRequest(),r=await this.get2faMethod();return await this.postSignedJson("/2fa/send",{accountId:e,method:r,requestId:t}),t}async getCodeDefault(){throw Error('There is no getCode callback provided. Please provide your own in AccountMultisig constructor options. It has a parameter method where method.kind is "email" or "phone".')}async promptAndVerify(){let e=await this.get2faMethod(),t=await this.getCode(e);try{return await this.verifyCode(t)}catch(e){if(a.Logger.warn("Error validating security code:",e),e.toString().includes("invalid 2fa code provided")||e.toString().includes("2fa code not valid"))return await this.promptAndVerify();throw e}}async verifyCodeDefault(e){let{accountId:t}=this,r=this.getRequest();if(!r)throw Error("no request pending");let{requestId:n}=r;return await this.postSignedJson("/2fa/verify",{accountId:t,securityCode:e,requestId:n})}async getRecoveryMethods(){let{accountId:e}=this;return{accountId:e,data:await this.postSignedJson("/account/recoveryMethods",{accountId:e})}}async get2faMethod(){let{data:e}=await this.getRecoveryMethods();if(e&&e.length&&(e=e.find(e=>0===e.kind.indexOf("2fa-"))),!e)return null;let{kind:t,detail:r}=e;return{kind:t,detail:r}}async signatureFor(){let{accountId:e}=this,t=(await this.connection.provider.block({finality:"final"})).header.height.toString(),r=await this.connection.signer.signMessage(n.from(t),e,this.connection.networkId);return{blockNumber:t,blockNumberSignature:n.from(r.signature).toString("base64")}}async postSignedJson(e,t){return await fetch(this.helperUrl+e,{body:JSON.stringify({...t,...await this.signatureFor()}),method:"POST"})}}t.Account2FA=m;let b=e=>i.PublicKey.from(e)},67457:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.UrlAccountCreator=t.LocalAccountCreator=t.AccountCreator=void 0;class r{}t.AccountCreator=r;class n extends r{masterAccount;initialBalance;constructor(e,t){super(),this.masterAccount=e,this.initialBalance=t}async createAccount(e,t){await this.masterAccount.createAccount(e,t,this.initialBalance)}}t.LocalAccountCreator=n;class i extends r{connection;helperUrl;constructor(e,t){super(),this.connection=e,this.helperUrl=t}async createAccount(e,t){await fetch(`${this.helperUrl}/account`,{body:JSON.stringify({newAccountId:e,newAccountPublicKey:t.toString()}),method:"POST"})}}t.UrlAccountCreator=i},67895:(e,t,r)=>{"use strict";var n,i=r(75927).Buffer;Object.defineProperty(t,"__esModule",{value:!0}),t.AccountMultisig=void 0;let o=r(14100),s=r(97553),a=r(70004),c=r(11206),u=r(71722),{deployContract:l,functionCall:d}=o.actionCreators;!function(e){e[e.INVALID_CODE=0]="INVALID_CODE",e[e.VALID_CODE=1]="VALID_CODE",e[e.UNKNOWN_CODE=2]="UNKNOWN_CODE"}(n||(n={}));let f={[c.MULTISIG_STORAGE_KEY]:null};class h extends a.Account{storage;onAddRequestResult;constructor(e,t,r){super(e,t),this.storage=r.storage,this.onAddRequestResult=r.onAddRequestResult}async signAndSendTransactionWithAccount(e,t){return super.signAndSendTransaction({receiverId:e,actions:t})}async signAndSendTransaction({receiverId:e,actions:t}){let r;let{accountId:n}=this,o=i.from(JSON.stringify({request:{receiver_id:e,actions:y(t,n,e)}}));try{r=await super.signAndSendTransaction({receiverId:n,actions:[d("add_request_and_confirm",o,c.MULTISIG_GAS,c.MULTISIG_DEPOSIT)]})}catch(r){if(r.toString().includes("Account has too many active requests. Confirm or delete some"))return await this.deleteUnconfirmedRequests(),await this.signAndSendTransaction({receiverId:e,actions:t});throw r}if(!r.status)throw Error("Request failed");let s={...r.status};if(!s.SuccessValue||"string"!=typeof s.SuccessValue)throw Error("Request failed");return this.setRequest({accountId:n,actions:t,requestId:parseInt(i.from(s.SuccessValue,"base64").toString("ascii"),10)}),this.onAddRequestResult&&await this.onAddRequestResult(r),this.deleteUnconfirmedRequests(),r}async checkMultisigCodeAndStateStatus(e){let t=0xffffffff,r=e?n.UNKNOWN_CODE:n.VALID_CODE;try{return e?await super.signAndSendTransaction({receiverId:this.accountId,actions:[l(e),d("delete_request",{request_id:t},c.MULTISIG_GAS,c.MULTISIG_DEPOSIT)]}):await this.deleteRequest(t),{codeStatus:n.VALID_CODE,stateStatus:u.MultisigStateStatus.VALID_STATE}}catch(e){if(new RegExp(u.MultisigDeleteRequestRejectionError.CANNOT_DESERIALIZE_STATE).test(e&&e.kind&&e.kind.ExecutionError))return{codeStatus:r,stateStatus:u.MultisigStateStatus.INVALID_STATE};if(new RegExp(u.MultisigDeleteRequestRejectionError.MULTISIG_NOT_INITIALIZED).test(e&&e.kind&&e.kind.ExecutionError))return{codeStatus:r,stateStatus:u.MultisigStateStatus.STATE_NOT_INITIALIZED};if(new RegExp(u.MultisigDeleteRequestRejectionError.NO_SUCH_REQUEST).test(e&&e.kind&&e.kind.ExecutionError))return{codeStatus:r,stateStatus:u.MultisigStateStatus.VALID_STATE};if(new RegExp(u.MultisigDeleteRequestRejectionError.METHOD_NOT_FOUND).test(e&&e.message))return{codeStatus:n.INVALID_CODE,stateStatus:u.MultisigStateStatus.UNKNOWN_STATE};throw e}}deleteRequest(e){return super.signAndSendTransaction({receiverId:this.accountId,actions:[d("delete_request",{request_id:e},c.MULTISIG_GAS,c.MULTISIG_DEPOSIT)]})}async deleteAllRequests(){let e=await this.getRequestIds();e.length&&await Promise.all(e.map(e=>this.deleteRequest(e)))}async deleteUnconfirmedRequests(){let e=await this.getRequestIds(),{requestId:t}
39=this.getRequest();for(let r of e)if(r!=t)try{await super.signAndSendTransaction({receiverId:this.accountId,actions:[d("delete_request",{request_id:r},c.MULTISIG_GAS,c.MULTISIG_DEPOSIT)]})}catch(e){s.Logger.warn("Attempt to delete an earlier request before 15 minutes failed. Will try again.")}}async getRequestIds(){return this.viewFunction({contractId:this.accountId,methodName:"list_request_ids"})}getRequest(){return this.storage?JSON.parse(this.storage.getItem(c.MULTISIG_STORAGE_KEY)||"{}"):f[c.MULTISIG_STORAGE_KEY]}setRequest(e){if(this.storage)return this.storage.setItem(c.MULTISIG_STORAGE_KEY,JSON.stringify(e));f[c.MULTISIG_STORAGE_KEY]=e}}t.AccountMultisig=h;let p=e=>e.toString().replace("ed25519:",""),y=(e,t,r)=>e.map(e=>{let n=e.enum,{gas:o,publicKey:s,methodName:a,args:u,deposit:l,accessKey:d,code:f}=e[n],h={type:n[0].toUpperCase()+n.substr(1),gas:o&&o.toString()||void 0,public_key:s&&p(s)||void 0,method_name:a,args:u&&i.from(u).toString("base64")||void 0,code:f&&i.from(f).toString("base64")||void 0,amount:l&&l.toString()||void 0,deposit:l&&l.toString()||"0",permission:void 0};if(d&&(r===t&&"fullAccess"!==d.permission.enum&&(h.permission={receiver_id:t,allowance:c.MULTISIG_ALLOWANCE.toString(),method_names:c.MULTISIG_CHANGE_METHODS}),"functionCall"===d.permission.enum)){let{receiverId:e,methodNames:t,allowance:r}=d.permission.functionCall;h.permission={receiver_id:e,allowance:r&&r.toString()||void 0,method_names:t}}return h})},34457:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Connection=void 0;let n=r(66962),i=r(76975);function o(e){switch(e.type){case void 0:return e;case"JsonRpcProvider":return new i.JsonRpcProvider({...e.args});case"FailoverRpcProvider":{let t=(e?.args||[]).map(e=>new i.JsonRpcProvider(e));return new i.FailoverRpcProvider(t)}default:throw Error(`Unknown provider type ${e.type}`)}}function s(e){switch(e.type){case void 0:return e;case"InMemorySigner":return new n.InMemorySigner(e.keyStore);default:throw Error(`Unknown signer type ${e.type}`)}}class a{networkId;provider;signer;jsvmAccountId;constructor(e,t,r,n){this.networkId=e,this.provider=t,this.signer=r,this.jsvmAccountId=n}getConnection(){return this}static fromConfig(e){let t=o(e.provider),r=s(e.signer);return new a(e.networkId,t,r,e.jsvmAccountId)}}t.Connection=a},11206:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.MULTISIG_CONFIRM_METHODS=t.MULTISIG_CHANGE_METHODS=t.MULTISIG_DEPOSIT=t.MULTISIG_GAS=t.MULTISIG_ALLOWANCE=t.MULTISIG_STORAGE_KEY=void 0;let n=r(97553);t.MULTISIG_STORAGE_KEY="__multisigRequest",t.MULTISIG_ALLOWANCE=BigInt((0,n.parseNearAmount)("1")),t.MULTISIG_GAS=100000000000000n,t.MULTISIG_DEPOSIT=0n,t.MULTISIG_CHANGE_METHODS=["add_request","add_request_and_confirm","delete_request","confirm"],t.MULTISIG_CONFIRM_METHODS=["confirm"]},86983:function(e,t,r){"use strict";var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.Contract=void 0;let i=r(97553),o=r(20557),s=r(85360),a=n(r(5344)),c=n(r(29905)),u=r(37600),l=r(70004),d=r(29388),f=r(17822);function h(e,t){return({[e]:(...e)=>t(...e)})[e]}function p(e,t,r){if(!g(e))return;if(t.params&&t.params.serialization_type!==u.AbiSerializationType.Json)throw new d.UnsupportedSerializationError(t.name,t.params.serialization_type);if(t.result&&t.result.serialization_type!==u.AbiSerializationType.Json)throw new d.UnsupportedSerializationError(t.name,t.result.serialization_type);let n=t.params?.args||[];for(let t of n){let n=e[t.name],i=t.type_schema;i.definitions=r.body.root_schema.definitions;let o=(0,a.default)(i);if(!o(n))throw new d.ArgumentSchemaError(t.name,o.errors)}for(let t of Object.keys(e))if(!n.find(e=>e.name===t))throw new d.UnknownArgumentError(t,n.map(e=>e.name))}let y=e=>e&&void 0!==e.byteLength&&e.byteLength===e.length,g=e=>"[object Object]"===Object.prototype.toString.call(e);class m{account;connection;contractId;lve;constructor(e,t,r){this.connection=e.getConnection(),e instanceof l.Account&&((0,c.default)("new Contract(account, contractId, options)")("use `new Contract(connection, contractId, options)` instead"),this.account=e),this.contractId=t,this.lve=new s.LocalViewExecution(e);let{viewMethods:n=[],changeMethods:a=[],abi:m,useLocalViewExecution:b}=r,v=n.map(e=>({name:e,abi:null})),w=a.map(e=>({name:e,abi:null}));if(m){if(v.length>0||w.length>0)throw new d.ConflictingOptions;v=m.body.functions.filter(e=>e.kind===u.AbiFunctionKind.View).map(e=>({name:e.name,abi:e})),w=m.body.functions.filter(e=>e.kind===u.AbiFunctionKind.Call).map(e=>({name:e.name,abi:e}))}v.forEach(({name:e,abi:t})=>{Object.defineProperty(this,e,{writable:!1,enumerable:!0,value:h(e,async(r={},n={},...s)=>{if(s.length||!(g(r)||y(r))||!g(n))throw new o.PositionalArgsError;if(t&&p(r,t,m),b)try{return await this.lve.viewFunction({contractId:this.contractId,methodName:e,args:r,...n})}
39catch(e){i.Logger.warn(`Local view execution failed with: "${e.message}"`),i.Logger.warn("Fallback to normal RPC call")}return this.account?this.account.viewFunction({contractId:this.contractId,methodName:e,args:r,...n}):(0,f.viewFunction)(this.connection,{contractId:this.contractId,methodName:e,args:r,...n})})})}),w.forEach(({name:e,abi:t})=>{Object.defineProperty(this,e,{writable:!1,enumerable:!0,value:h(e,async(...r)=>{if(r.length&&(r.length>3||!(g(r[0])||y(r[0]))))throw new o.PositionalArgsError;return(r.length>1||!(r[0]&&r[0].args))&&((0,c.default)("contract.methodName(args, gas, amount)")("use `contract.methodName({ signerAccount, args, gas?, amount?, callbackUrl?, meta? })` instead"),r[0]={args:r[0],gas:r[1],amount:r[2]}),t&&p(r[0].args,t,m),this._changeMethod({methodName:e,...r[0]})})})})}async _changeMethod({signerAccount:e,args:t,methodName:r,gas:n,amount:o,meta:s,callbackUrl:a}){b({gas:n,amount:o});let c=this.account||e;if(!c)throw Error("signerAccount must be specified");let u=await c.functionCall({contractId:this.contractId,methodName:r,args:t,gas:n,attachedDeposit:o,walletMeta:s,walletCallbackUrl:a});return(0,i.getTransactionLastResult)(u)}}function b(e){let t="number, decimal string or BigInt";for(let r of Object.keys(e)){let n=e[r];if(n&&"bigint"!=typeof n&&isNaN(n))throw new o.ArgumentTypeError(r,t,n)}}t.Contract=m},29388:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ConflictingOptions=t.ArgumentSchemaError=t.UnknownArgumentError=t.UnsupportedSerializationError=void 0;class r extends Error{constructor(e,t){super(`Contract method '${e}' is using an unsupported serialization type ${t}`)}}t.UnsupportedSerializationError=r;class n extends Error{constructor(e,t){super(`Unrecognized argument '${e}', expected '${JSON.stringify(t)}'`)}}t.UnknownArgumentError=n;class i extends Error{constructor(e,t){super(`Argument '${e}' does not conform to the specified ABI schema: '${JSON.stringify(t)}'`)}}t.ArgumentSchemaError=i;class o extends Error{constructor(){super("Conflicting contract method options have been passed. You can either specify ABI or a list of view/call methods.")}}t.ConflictingOptions=o},87685:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.MultisigStateStatus=t.MultisigDeleteRequestRejectionError=t.UnsupportedSerializationError=t.UnknownArgumentError=t.ConflictingOptions=t.ArgumentSchemaError=t.Contract=t.MULTISIG_CONFIRM_METHODS=t.MULTISIG_CHANGE_METHODS=t.MULTISIG_DEPOSIT=t.MULTISIG_GAS=t.MULTISIG_ALLOWANCE=t.MULTISIG_STORAGE_KEY=t.Connection=t.AccountMultisig=t.UrlAccountCreator=t.LocalAccountCreator=t.AccountCreator=t.Account2FA=t.Account=void 0;var n=r(70004);Object.defineProperty(t,"Account",{enumerable:!0,get:function(){return n.Account}});var i=r(96440);Object.defineProperty(t,"Account2FA",{enumerable:!0,get:function(){return i.Account2FA}});var o=r(67457);Object.defineProperty(t,"AccountCreator",{enumerable:!0,get:function(){return o.AccountCreator}}),Object.defineProperty(t,"LocalAccountCreator",{enumerable:!0,get:function(){return o.LocalAccountCreator}}),Object.defineProperty(t,"UrlAccountCreator",{enumerable:!0,get:function(){return o.UrlAccountCreator}});var s=r(67895);Object.defineProperty(t,"AccountMultisig",{enumerable:!0,get:function(){return s.AccountMultisig}});var a=r(34457);Object.defineProperty(t,"Connection",{enumerable:!0,get:function(){return a.Connection}});var c=r(11206);Object.defineProperty(t,"MULTISIG_STORAGE_KEY",{enumerable:!0,get:function(){return c.MULTISIG_STORAGE_KEY}}),Object.defineProperty(t,"MULTISIG_ALLOWANCE",{enumerable:!0,get:function(){return c.MULTISIG_ALLOWANCE}}),Object.defineProperty(t,"MULTISIG_GAS",{enumerable:!0,get:function(){return c.MULTISIG_GAS}}),Object.defineProperty(t,"MULTISIG_DEPOSIT",{enumerable:!0,get:function(){return c.MULTISIG_DEPOSIT}}),Object.defineProperty(t,"MULTISIG_CHANGE_METHODS",{enumerable:!0,get:function(){return c.MULTISIG_CHANGE_METHODS}}),Object.defineProperty(t,"MULTISIG_CONFIRM_METHODS",{enumerable:!0,get:function(){return c.MULTISIG_CONFIRM_METHODS}});var u=r(86983);Object.defineProperty(t,"Contract",{enumerable:!0,get:function(){return u.Contract}});var l=r(29388);Object.defineProperty(t,"ArgumentSchemaError",{enumerable:!0,get:function(){return l.ArgumentSchemaError}}),Object.defineProperty(t,"ConflictingOptions",{enumerable:!0,get:function(){return l.ConflictingOptions}}),Object.defineProperty(t,"UnknownArgumentError",{enumerable:!0,get:function(){return l.UnknownArgumentError}}),Object.defineProperty(t,"UnsupportedSerializationError",{enumerable:!0,get:function(){return l.UnsupportedSerializationError}});var d=r(71722);Object.defineProperty(t,"MultisigDeleteRequestRejectionError",{enumerable:!0,get:function(){return d.MultisigDeleteRequestRejectionError}}),Object.defineProperty(t,"MultisigStateStatus",{enumerable:!0,get:function(){return d.MultisigStateStatus}})},85360:(e,t,r)=>{"use strict";var n=r(75927).Buffer;
39Object.defineProperty(t,"__esModule",{value:!0}),t.LocalViewExecution=void 0;let i=r(97553),o=r(10635),s=r(80160),a=r(17822);class c{connection;storage;constructor(e){this.connection=e.getConnection(),this.storage=new o.Storage}async fetchContractCode(e,t){return(await this.connection.provider.query({request_type:"view_code",account_id:e,...t})).code_base64}async fetchContractState(e,t){return(0,a.viewState)(this.connection,e,"",t)}async fetch(e,t){let r=await this.connection.provider.block(t),n=r.header.hash,i=r.header.height;return{blockHash:n,blockHeight:i,blockTimestamp:r.header.timestamp,contractCode:await this.fetchContractCode(e,t),contractState:await this.fetchContractState(e,t)}}async loadOrFetch(e,t){let r=this.storage.load(t);if(r)return r;let{blockHash:n,...i}=await this.fetch(e,t);return this.storage.save(n,i),i}async viewFunction({contractId:e,methodName:t,args:r={},blockQuery:o={finality:"optimistic"}}){let a=JSON.stringify(r),{contractCode:c,contractState:u,blockHeight:l,blockTimestamp:d}=await this.loadOrFetch(e,o),f=new s.Runtime({contractId:e,contractCode:c,contractState:u,blockHeight:l,blockTimestamp:d,methodArgs:a}),{result:h,logs:p}=await f.execute(t);return p&&(0,i.printTxOutcomeLogs)({contractId:e,logs:p}),JSON.parse(n.from(h).toString())}}t.LocalViewExecution=c},80160:(e,t,r)=>{"use strict";var n=r(75927).Buffer;Object.defineProperty(t,"__esModule",{value:!0}),t.Runtime=void 0;let i=r(94986),o=e=>()=>{throw Error("method not implemented: "+e)},s=e=>()=>{throw Error("method not available for view calls: "+e)};class a{context;wasm;memory;registers;logs;result;constructor({contractCode:e,...t}){this.context=t,this.wasm=this.prepareWASM(n.from(e,"base64")),this.memory=new WebAssembly.Memory({initial:1024,maximum:2048}),this.registers={},this.logs=[],this.result=n.from([])}readUTF16CStr(e){let t=[],r=new Uint16Array(this.memory.buffer),i=Number(e)/2;for(;0!=r[i];)t.push(r[i]),i++;return n.from(Uint16Array.from(t).buffer).toString("ucs2")}readUTF8CStr(e,t){let r=[],i=new Uint8Array(this.memory.buffer),o=Number(t);for(let t=0;t<e&&0!=i[o];t++)r.push(i[o]),o++;return n.from(r).toString("utf8")}storageRead(e,t){let r=n.from(new Uint8Array(this.memory.buffer,Number(t),Number(e))),i=this.context.contractState.filter(e=>0===n.compare(e.key,r)).map(e=>e.value);return 0===i.length?null:i.length>1?i:i[0]}prepareWASM(e){let t=[];if("\0asm"!==e.subarray(0,4).toString("utf8"))throw Error("Invalid magic number");let r=e.readUInt32LE(4);if(1!=r)throw Error("Invalid version: "+r);let i=8;function o(){let t,r=0,n=0;do r|=(127&(t=e[i++]))<<n,n+=7;while(128&t);return r}function s(){let t=1&e[i++];return{initial:o(),max:t?o():null}}function a(){let t=o(),r=e.subarray(i,i+t);return i+=t,r.toString("utf8")}function c(e){let t=[];do{let r=127&e;0!=(e>>=7)&&(r|=128),t.push(r)}while(0!==e);return n.from(t)}function u(e){let t=n.from(e,"utf8");return n.concat([c(t.length),t])}t.push(e.subarray(0,i));do{let r=i,l=e.readUInt8(i);i++;let d=o(),f=i+d;if(5==l)t.push(n.from([5,1,0]));else if(2==l){let r=[],l=o();for(let t=0;t<l;t++){let t=i;a(),a();let n=e.readUInt8(i);i++;let c=!1;switch(n){case 0:o();break;case 1:i++,s();break;case 2:s(),c=!0;break;case 3:i++,i++;break;default:throw Error("Invalid import kind: "+n)}c||r.push(e.subarray(t,i))}let d=n.concat([u("env"),u("memory"),n.from([2]),n.from([0]),c(1)]);r.push(d);let f=n.concat([c(r.length),...r]);t.push(n.concat([n.from([2]),c(f.length),f]))}else if(7==l){let r=[],s=o();for(let t=0;t<s;t++){let t=i;a();let n=e.readUInt8(i);i++,o(),2!==n&&r.push(e.subarray(t,i))}let u=n.concat([c(r.length),...r]);t.push(n.concat([n.from([7]),c(u.length),u]))}else t.push(e.subarray(r,f));i=f}while(i<e.length);return n.concat(t)}getRegisterLength(e){return BigInt(this.registers[e.toString()]?this.registers[e.toString()].length:Number.MAX_SAFE_INTEGER)}readFromRegister(e,t){new Uint8Array(this.memory.buffer).set(this.registers[e.toString()]||n.from([]),Number(t))}getCurrentAccountId(e){this.registers[e.toString()]=n.from(this.context.contractId)}inputMethodArgs(e){this.registers[e.toString()]=n.from(this.context.methodArgs)}getBlockHeight(){return BigInt(this.context.blockHeight)}getBlockTimestamp(){return BigInt(this.context.blockTimestamp)}sha256(e,t,r){let n=new Uint8Array(this.memory.buffer,Number(t),Number(e));this.registers[r.toString()]=(0,i.sha256)(n)}returnValue(e,t){this.result=n.from(new Uint8Array(this.memory.buffer,Number(t),Number(e)))}panic(e){throw Error("panic: "+e)}abort(e,t,r,n){let i=this.readUTF16CStr(e),o=this.readUTF16CStr(t),s=`${i} ${o}:${r}:${n}`;if(!i||!o)throw Error("abort: String encoding is bad UTF-16 sequence.");throw Error("abort: "+s)}appendToLog(e,t){this.logs.push(this.readUTF8CStr(e,t))}readStorage(e,t,r){let n=this.storageRead(e,t);return null==n?0n:(this.registers[r]=n,1n)}hasStorageKey(e,t){return null==this.storageRead(e,t)?0n:1n}getHostImports(){return{register_len:this.getRegisterLength.bind(this),read_register:this.readFromRegister.bind(this),current_account_id:this.getCurrentAccountId.bind(this),input:this.inputMethodArgs.bind(this),block_index:this.getBlockHeight.bind(this),block_timestamp:this.getBlockTimestamp.bind(this),sha256:this.sha256.bind(this),value_return:this.returnValue.bind(this),abort:this.abort.bind(this),log_utf8:this.appendToLog.bind(this),log_utf16:this.appendToLog.bind(this),storage_read:this.readStorage.bind(this),storage_has_key:this.hasStorageKey.bind(this),panic:()=>this.panic("explicit guest panic"),panic_utf8:(e,t)=>
39this.panic(this.readUTF8CStr(e,t)),epoch_height:o("epoch_height"),storage_usage:o("storage_usage"),account_balance:o("account_balance"),account_locked_balance:o("account_locked_balance"),random_seed:o("random_seed"),ripemd160:o("ripemd160"),keccak256:o("keccak256"),keccak512:o("keccak512"),ecrecover:o("ecrecover"),validator_stake:o("validator_stake"),validator_total_stake:o("validator_total_stake"),write_register:s("write_register"),signer_account_id:s("signer_account_id"),signer_account_pk:s("signer_account_pk"),predecessor_account_id:s("predecessor_account_id"),attached_deposit:s("attached_deposit"),prepaid_gas:s("prepaid_gas"),used_gas:s("used_gas"),promise_create:s("promise_create"),promise_then:s("promise_then"),promise_and:s("promise_and"),promise_batch_create:s("promise_batch_create"),promise_batch_then:s("promise_batch_then"),promise_batch_action_create_account:s("promise_batch_action_create_account"),promise_batch_action_deploy_contract:s("promise_batch_action_deploy_contract"),promise_batch_action_function_call:s("promise_batch_action_function_call"),promise_batch_action_function_call_weight:s("promise_batch_action_function_call_weight"),promise_batch_action_transfer:s("promise_batch_action_transfer"),promise_batch_action_stake:s("promise_batch_action_stake"),promise_batch_action_add_key_with_full_access:s("promise_batch_action_add_key_with_full_access"),promise_batch_action_add_key_with_function_call:s("promise_batch_action_add_key_with_function_call"),promise_batch_action_delete_key:s("promise_batch_action_delete_key"),promise_batch_action_delete_account:s("promise_batch_action_delete_account"),promise_results_count:s("promise_results_count"),promise_result:s("promise_result"),promise_return:s("promise_return"),storage_write:s("storage_write"),storage_remove:s("storage_remove")}}async execute(e){let t=await WebAssembly.compile(this.wasm),r=(await WebAssembly.instantiate(t,{env:{...this.getHostImports(),memory:this.memory}})).exports[e];if(void 0==r)throw Error(`Contract method '${e}' does not exists in contract ${this.context.contractId} for block id ${this.context.blockHeight}`);return r(),{result:this.result,logs:this.logs}}}t.Runtime=a},10635:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Storage=void 0;let n=r(76677);class i{cache;static MAX_ELEMENTS=100;blockHeights;constructor(e={max:i.MAX_ELEMENTS}){this.cache=new n.LRUMap(e.max),this.blockHeights=new Map}load(e){if(!("blockId"in e))return;let t=e.blockId;return 44==t.toString().length&&(t=this.blockHeights.get(t.toString())),this.cache.get(t)}save(e,{blockHeight:t,blockTimestamp:r,contractCode:n,contractState:i}){this.blockHeights.set(e,t),this.cache.set(t,{blockHeight:t,blockTimestamp:r,contractCode:n,contractState:i})}}t.Storage=i},71722:(e,t)=>{"use strict";var r,n;Object.defineProperty(t,"__esModule",{value:!0}),t.MultisigStateStatus=t.MultisigDeleteRequestRejectionError=void 0,function(e){e.CANNOT_DESERIALIZE_STATE="Cannot deserialize the contract state",e.MULTISIG_NOT_INITIALIZED="Smart contract panicked: Multisig contract should be initialized before usage",e.NO_SUCH_REQUEST="Smart contract panicked: panicked at 'No such request: either wrong number or already confirmed'",e.REQUEST_COOLDOWN_ERROR="Request cannot be deleted immediately after creation.",e.METHOD_NOT_FOUND="Contract method is not found"}(r||(t.MultisigDeleteRequestRejectionError=r={})),function(e){e[e.INVALID_STATE=0]="INVALID_STATE",e[e.STATE_NOT_INITIALIZED=1]="STATE_NOT_INITIALIZED",e[e.VALID_STATE=2]="VALID_STATE",e[e.UNKNOWN_STATE=3]="UNKNOWN_STATE"}(n||(t.MultisigStateStatus=n={}))},17822:(e,t,r)=>{"use strict";var n=r(75927).Buffer;Object.defineProperty(t,"__esModule",{value:!0}),t.viewFunction=t.viewState=t.encodeJSContractArgs=t.validateArgs=void 0;let i=r(20557),o=r(97553);function s(e){return JSON.parse(n.from(e).toString())}function a(e){return n.from(JSON.stringify(e))}function c(e){if((void 0===e.byteLength||e.byteLength!==e.length)&&(Array.isArray(e)||"object"!=typeof e))throw new i.PositionalArgsError}function u(e,t,r){return n.concat([n.from(e),n.from([0]),n.from(t),n.from([0]),n.from(r)])}async function l(e,t,r,i={finality:"optimistic"}){let{values:o}=await e.provider.query({request_type:"view_state",...i,account_id:t,prefix_base64:n.from(r).toString("base64")});return o.map(({key:e,value:t})=>({key:n.from(e,"base64"),value:n.from(t,"base64")}))}async function d(e,{contractId:t,methodName:r,args:i={},parse:l=s,stringify:d=a,jsContract:f=!1,blockQuery:h={finality:"optimistic"}}){let p;c(i),p=f?u(t,r,Object.keys(i).length>0?JSON.stringify(i):""):d(i);let y=await e.provider.query({request_type:"call_function",...h,account_id:f?e.jsvmAccountId:t,method_name:f?"view_js_contract":r,args_base64:p.toString("base64")});return y.logs&&(0,o.printTxOutcomeLogs)({contractId:t,logs:y.logs}),y.result&&y.result.length>0&&l(n.from(y.result))}t.validateArgs=c,t.encodeJSContractArgs=u,t.viewState=l,t.viewFunction=d},95930:(e,t)=>{"use strict";
39Object.defineProperty(t,"__esModule",{value:!0}),t.Assignable=void 0;class r{constructor(e){Object.keys(e).map(t=>{this[t]=e[t]})}}t.Assignable=r},5990:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Enum=void 0;class r{constructor(e){if(1!==Object.keys(e).length)throw Error("Enum can only take single value");Object.keys(e).map(t=>{this[t]=e[t]})}}t.Enum=r},35780:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ErrorContext=t.TypedError=t.ArgumentTypeError=t.PositionalArgsError=void 0;class r extends Error{constructor(){super("Contract method calls expect named arguments wrapped in object, e.g. { argName1: argValue1, argName2: argValue2 }")}}t.PositionalArgsError=r;class n extends Error{constructor(e,t,r){super(`Expected ${t} for '${e}' argument, but got '${JSON.stringify(r)}'`)}}t.ArgumentTypeError=n;class i extends Error{type;context;constructor(e,t,r){super(e),this.type=t||"UntypedError",this.context=r}}t.TypedError=i;class o{transactionHash;constructor(e){this.transactionHash=e}}t.ErrorContext=o},20557:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);(!i||("get"in i?!t.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),i(r(95930),t),i(r(5990),t),i(r(35780),t),i(r(38359),t)},38359:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.FinalExecutionStatusBasic=t.ExecutionStatusBasic=t.IdType=void 0;var n=r(87329);Object.defineProperty(t,"IdType",{enumerable:!0,get:function(){return n.IdType}});var i=r(1426);Object.defineProperty(t,"ExecutionStatusBasic",{enumerable:!0,get:function(){return i.ExecutionStatusBasic}}),Object.defineProperty(t,"FinalExecutionStatusBasic",{enumerable:!0,get:function(){return i.FinalExecutionStatusBasic}})},87329:(e,t)=>{"use strict";var r;Object.defineProperty(t,"__esModule",{value:!0}),t.IdType=void 0,function(e){e.Transaction="transaction",e.Receipt="receipt"}(r||(t.IdType=r={}))},1426:(e,t)=>{"use strict";var r,n;Object.defineProperty(t,"__esModule",{value:!0}),t.FinalExecutionStatusBasic=t.ExecutionStatusBasic=void 0,function(e){e.Unknown="Unknown",e.Pending="Pending",e.Failure="Failure"}(r||(t.ExecutionStatusBasic=r={})),function(e){e.NotStarted="NotStarted",e.Started="Started",e.Failure="Failure"}(n||(t.FinalExecutionStatusBasic=n={}))},21362:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.DEFAULT_FUNCTION_CALL_GAS=void 0,t.DEFAULT_FUNCTION_CALL_GAS=30000000000000n},77096:function(e,t,r){"use strict";var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.ErrorMessages=void 0;let i=n(r(30789));t.ErrorMessages=i.default},31089:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.parseRpcError=t.parseResultError=t.getErrorTypeFromErrorMessage=t.formatError=t.ServerError=t.ErrorMessages=void 0;var n=r(77096);Object.defineProperty(t,"ErrorMessages",{enumerable:!0,get:function(){return n.ErrorMessages}});var i=r(48988);Object.defineProperty(t,"ServerError",{enumerable:!0,get:function(){return i.ServerError}}),Object.defineProperty(t,"formatError",{enumerable:!0,get:function(){return i.formatError}}),Object.defineProperty(t,"getErrorTypeFromErrorMessage",{enumerable:!0,get:function(){return i.getErrorTypeFromErrorMessage}}),Object.defineProperty(t,"parseResultError",{enumerable:!0,get:function(){return i.parseResultError}}),Object.defineProperty(t,"parseRpcError",{enumerable:!0,get:function(){return i.parseRpcError}})},48988:function(e,t,r){"use strict";var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.getErrorTypeFromErrorMessage=t.formatError=t.parseResultError=t.parseRpcError=t.ServerError=void 0;let i=r(20557),o=n(r(2139)),s=r(25148),a=r(77096),c=n(r(16450)),u={formatNear:()=>(e,t)=>(0,s.formatNearAmount)(t(e))};class l extends i.TypedError{}t.ServerError=l;class d extends l{transaction_outcome}function f(e){let t={},r=y(e,c.default.schema,t,""),n=new l(p(r,t),r);return Object.assign(n,t),n}function h(e){let t=f(e.status.Failure),r=new d;return Object.assign(r,t),r.type=t.type,r.message=t.message,r.transaction_outcome=e.transaction_outcome,r}function p(e,t){return"string"==typeof a.ErrorMessages[e]?o.default.render(a.ErrorMessages[e],{...t,...u}):JSON.stringify(t)}function y(e,t,r,n){let i,o,s;for(let r in t){if(b(e[r]))return e[r];if(m(e[r]))i=e[r],o=t[r],s=r;else{if(!(m(e.kind)&&m(e.kind[r])))continue;i=e.kind[r],o=t[r],s=r}}if(!i||!o)return r.kind=e,n;for(let e of Object.keys(o.props))r[e]=i[e];return y(i,t,r,s)}function g(e,t){switch(!0){case/^account .*? does not exist while viewing$/.test(e):case/^Account .*? doesn't exist$/.test(e):return"AccountDoesNotExist";case/^access key .*? does not exist while viewing$/.test(e):return"AccessKeyDoesNotExist";case/wasm execution failed with error: FunctionCallError\(CompilationError\(CodeDoesNotExist/.test(e):case/wasm execution failed with error: CompilationError\(CodeDoesNotExist/.test(e):return"CodeDoesNotExist";case/wasm execution failed with error: FunctionCallError\(MethodResolveError\(MethodNotFound/.test(e):case/wasm execution failed with error: MethodResolveError\(MethodNotFound/.test(e):return"MethodNotFound";case/Transaction nonce \d+ must be larger than nonce of the used access key \d+/.test(e):return"InvalidNonce";default:return t}}function m(e){return"[object Object]"===Object.prototype.toString.call(e)}function b(e){return"[object String]"===Object.prototype.toString.call(e)}t.parseRpcError=f,t.parseResultError=h,t.formatError=p,t.getErrorTypeFromErrorMessage=g},25148:(e,t,r)=>{"use strict";
39Object.defineProperty(t,"__esModule",{value:!0}),t.baseDecode=t.baseEncode=t.parseNearAmount=t.formatNearAmount=t.NEAR_NOMINATION=t.NEAR_NOMINATION_EXP=void 0;let n=r(65289);t.NEAR_NOMINATION_EXP=24,t.NEAR_NOMINATION=10n**BigInt(t.NEAR_NOMINATION_EXP);let i=[],o=10n;for(let e=0,r=5n;e<t.NEAR_NOMINATION_EXP;e++,r*=o)i[e]=r;function s(e,r=t.NEAR_NOMINATION_EXP){let n=BigInt(e);if(r!==t.NEAR_NOMINATION_EXP){let e=t.NEAR_NOMINATION_EXP-r-1;e>0&&(n+=i[e])}let o=(e=n.toString()).substring(0,e.length-t.NEAR_NOMINATION_EXP)||"0",a=e.substring(e.length-t.NEAR_NOMINATION_EXP).padStart(t.NEAR_NOMINATION_EXP,"0").substring(0,r);return u(`${d(o)}.${a}`)}function a(e){if(!e)return null;let r=(e=c(e)).split("."),n=r[0],i=r[1]||"";if(r.length>2||i.length>t.NEAR_NOMINATION_EXP)throw Error(`Cannot parse '${e}' as NEAR amount`);return l(n+i.padEnd(t.NEAR_NOMINATION_EXP,"0"))}function c(e){return e.replace(/,/g,"").trim()}function u(e){return e.replace(/\.?0*$/,"")}function l(e){return""===(e=e.replace(/^0+/,""))?"0":e}function d(e){let t=/(-?\d+)(\d{3})/;for(;t.test(e);)e=e.replace(t,"$1,$2");return e}function f(e){if("string"==typeof e){let t=[];for(let r=0;r<e.length;r++)t.push(e.charCodeAt(r));e=new Uint8Array(t)}return n.base58.encode(e)}function h(e){return n.base58.decode(e)}t.formatNearAmount=s,t.parseNearAmount=a,t.baseEncode=f,t.baseDecode=h},97553:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);(!i||("get"in i?!t.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),i(r(21362),t),i(r(31089),t),i(r(25148),t),i(r(17062),t),i(r(250),t),i(r(20848),t),i(r(40800),t),i(r(42906),t)},29409:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ConsoleLogger=void 0;class r{logLevels;constructor(e){this.logLevels=e}isLevelEnabled=e=>this.logLevels.includes(e);print(e,t,...r){switch(e){case"error":case"fatal":return console.error(t,...r);case"warn":return console.warn(t,...r);case"log":return console.log(t,...r);case"debug":case"verbose":return console.debug(t,...r)}}verbose(e,...t){this.isLevelEnabled("verbose")&&this.print("verbose",e,...t)}debug(e,...t){this.isLevelEnabled("debug")&&this.print("debug",e,...t)}log(e,...t){this.isLevelEnabled("log")&&this.print("log",e,...t)}warn(e,...t){this.isLevelEnabled("warn")&&this.print("warn",e,...t)}error(e,...t){this.isLevelEnabled("error")&&this.print("error",e,...t)}fatal(e,...t){this.isLevelEnabled("fatal")&&this.print("fatal",e,...t)}}t.ConsoleLogger=r},40800:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Logger=t.ConsoleLogger=void 0;var n=r(29409);Object.defineProperty(t,"ConsoleLogger",{enumerable:!0,get:function(){return n.ConsoleLogger}});var i=r(10630);Object.defineProperty(t,"Logger",{enumerable:!0,get:function(){return i.Logger}})},10630:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Logger=void 0;let n=r(29409),i=["verbose","debug","log","warn","error","fatal"],o=new n.ConsoleLogger(i);class s{static instanceRef=o;static overrideLogger=e=>{this.instanceRef=e};static error(e,...t){this.instanceRef?.error(e,...t)}static log(e,...t){this.instanceRef?.log(e,...t)}static warn(e,...t){this.instanceRef?.warn(e,...t)}static debug(e,...t){this.instanceRef?.debug?.(e,...t)}static verbose(e,...t){this.instanceRef?.verbose?.(e,...t)}static fatal(e,...t){this.instanceRef?.fatal?.(e,...t)}}t.Logger=s},17062:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.printTxOutcomeLogs=t.printTxOutcomeLogsAndFailures=void 0;let n=r(31089),i=r(40800);function o({contractId:e,outcome:t}){for(let r of[t.transaction_outcome,...t.receipts_outcome].reduce((e,t)=>{let r="object"==typeof t.outcome.status&&"object"==typeof t.outcome.status.Failure;return t.outcome.logs.length||r?e.concat({receiptIds:t.outcome.re
39ceipt_ids,logs:t.outcome.logs,failure:"object"==typeof t.outcome.status&&void 0!==t.outcome.status.Failure?(0,n.parseRpcError)(t.outcome.status.Failure):null}):e},[]))i.Logger.log(`Receipt${r.receiptIds.length>1?"s":""}: ${r.receiptIds.join(", ")}`),s({contractId:e,logs:r.logs,prefix:" "}),r.failure&&i.Logger.warn(` Failure [${e}]: ${r.failure}`)}function s({contractId:e,logs:t,prefix:r=""}){for(let n of t)i.Logger.log(`${r}Log [${e}]: ${n}`)}t.printTxOutcomeLogsAndFailures=o,t.printTxOutcomeLogs=s},250:(e,t,r)=>{"use strict";var n=r(75927).Buffer;function i(e){if("object"==typeof e.status&&"string"==typeof e.status.SuccessValue){let t=n.from(e.status.SuccessValue,"base64").toString();try{return JSON.parse(t)}catch(e){return t}}return null}Object.defineProperty(t,"__esModule",{value:!0}),t.getTransactionLastResult=void 0,t.getTransactionLastResult=i},42906:(e,t)=>{"use strict";function r(e,t){return e<t?-1:e>t?1:0}Object.defineProperty(t,"__esModule",{value:!0}),t.sortBigIntAsc=void 0,t.sortBigIntAsc=r},20848:function(e,t,r){"use strict";var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.diffEpochValidators=t.findSeatPrice=void 0;let i=n(r(29905)),o=r(42906);function s(e,t,r,n){return n&&n<49?a(e,t):(r||((0,i.default)("findSeatPrice(validators, maxNumberOfSeats)")("`use `findSeatPrice(validators, maxNumberOfSeats, minimumStakeRatio)` instead"),r=[1,6250]),c(e,t,r))}function a(e,t){let r=e.map(e=>BigInt(e.stake)).sort(o.sortBigIntAsc),n=BigInt(t),i=r.reduce((e,t)=>e+t);if(i<n)throw Error("Stakes are below seats");let s=1n,a=i+1n;for(;s!==a-1n;){let e=(s+a)/2n,t=!1,i=0n;for(let o=0;o<r.length;++o)if((i+=r[o]/e)>=n){s=e,t=!0;break}t||(a=e)}return s}function c(e,t,r){if(2!=r.length)throw Error("minimumStakeRatio should have 2 elements");let n=e.map(e=>BigInt(e.stake)).sort(o.sortBigIntAsc),i=n.reduce((e,t)=>e+t);return e.length<t?i*BigInt(r[0])/BigInt(r[1]):n[0]+1n}function u(e,t){let r=new Map;e.forEach(e=>r.set(e.account_id,e));let n=new Set(t.map(e=>e.account_id));return{newValidators:t.filter(e=>!r.has(e.account_id)),removedValidators:e.filter(e=>!n.has(e.account_id)),changedValidators:t.filter(e=>r.has(e.account_id)&&r.get(e.account_id).stake!=e.stake).map(e=>({current:r.get(e.account_id),next:e}))}}t.findSeatPrice=s,t.diffEpochValidators=u},3715:(e,t)=>{"use strict";var r;Object.defineProperty(t,"__esModule",{value:!0}),t.KeySize=t.KeyType=void 0,function(e){e[e.ED25519=0]="ED25519",e[e.SECP256K1=1]="SECP256K1"}(r||(t.KeyType=r={})),t.KeySize={SECRET_KEY:32,ED25519_PUBLIC_KEY:32,SECP256k1_PUBLIC_KEY:64}},75092:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.PublicKey=t.KeyPairSecp256k1=t.KeyPairEd25519=t.KeyPair=t.KeyType=void 0;var n=r(3715);Object.defineProperty(t,"KeyType",{enumerable:!0,get:function(){return n.KeyType}});var i=r(72194);Object.defineProperty(t,"KeyPair",{enumerable:!0,get:function(){return i.KeyPair}});var o=r(19516);Object.defineProperty(t,"KeyPairEd25519",{enumerable:!0,get:function(){return o.KeyPairEd25519}});var s=r(30663);Object.defineProperty(t,"KeyPairSecp256k1",{enumerable:!0,get:function(){return s.KeyPairSecp256k1}});var a=r(28265);Object.defineProperty(t,"PublicKey",{enumerable:!0,get:function(){return a.PublicKey}})},72194:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.KeyPair=void 0;let n=r(60668),i=r(19516),o=r(30663);class s extends n.KeyPairBase{static fromRandom(e){switch(e.toUpperCase()){case"ED25519":return i.KeyPairEd25519.fromRandom();case"SECP256K1":return o.KeyPairSecp256k1.fromRandom();default:throw Error(`Unknown curve ${e}`)}}static fromString(e){let t=e.split(":");if(2===t.length)switch(t[0].toUpperCase()){case"ED25519":return new i.KeyPairEd25519(t[1]);case"SECP256K1":return new o.KeyPairSecp256k1(t[1]);default:throw Error(`Unknown curve: ${t[0]}`)}else throw Error("Invalid encoded key format, must be <curve>:<encoded key>")}}t.KeyPair=s},60668:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.KeyPairBase=void 0;class r{}t.KeyPairBase=r},19516:function(e,t,r){"use strict";var n=this&&this.__importDefault||function(e){return e&&e.__esMo
39dule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.KeyPairEd25519=void 0;let i=r(97152),o=r(80293),s=n(r(52815)),a=r(3715),c=r(60668),u=r(28265);class l extends c.KeyPairBase{publicKey;secretKey;extendedSecretKey;constructor(e){super();let t=new Uint8Array((0,i.baseDecode)(e).slice(0,a.KeySize.SECRET_KEY)),r=o.ed25519.getPublicKey(new Uint8Array(t));this.publicKey=new u.PublicKey({keyType:a.KeyType.ED25519,data:r}),this.secretKey=(0,i.baseEncode)(t),this.extendedSecretKey=e}static fromRandom(){let e=(0,s.default)(a.KeySize.SECRET_KEY),t=o.ed25519.getPublicKey(new Uint8Array(e)),r=new Uint8Array([...e,...t]);return new l((0,i.baseEncode)(r))}sign(e){return{signature:o.ed25519.sign(e,(0,i.baseDecode)(this.secretKey)),publicKey:this.publicKey}}verify(e,t){return this.publicKey.verify(e,t)}toString(){return`ed25519:${this.extendedSecretKey}`}getPublicKey(){return this.publicKey}}t.KeyPairEd25519=l},30663:function(e,t,r){"use strict";var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.KeyPairSecp256k1=void 0;let i=r(97152),o=n(r(52815)),s=n(r(22265)),a=r(3715),c=r(60668),u=r(28265);class l extends c.KeyPairBase{publicKey;secretKey;extendedSecretKey;constructor(e){super();let t=new Uint8Array((0,i.baseDecode)(e).slice(0,a.KeySize.SECRET_KEY)),r=s.default.publicKeyCreate(new Uint8Array(t),!1),n=r.subarray(1,r.length);this.publicKey=new u.PublicKey({keyType:a.KeyType.SECP256K1,data:n}),this.secretKey=(0,i.baseEncode)(t),this.extendedSecretKey=e}static fromRandom(){let e=(0,o.default)(a.KeySize.SECRET_KEY),t=s.default.publicKeyCreate(new Uint8Array(e),!1),r=new Uint8Array([...e,...t.subarray(1,t.length)]);return new l((0,i.baseEncode)(r))}sign(e){let{signature:t,recid:r}=s.default.ecdsaSign(e,(0,i.baseDecode)(this.secretKey));return{signature:new Uint8Array([...t,r]),publicKey:this.publicKey}}verify(e,t){return this.publicKey.verify(e,t)}toString(){return`secp256k1:${this.extendedSecretKey}`}getPublicKey(){return this.publicKey}}t.KeyPairSecp256k1=l},28265:function(e,t,r){"use strict";var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.PublicKey=void 0;let i=r(97152),o=r(80293),s=n(r(22265)),a=r(3715);function c(e){switch(e){case a.KeyType.ED25519:return"ed25519";case a.KeyType.SECP256K1:return"secp256k1";default:throw Error(`Unknown key type ${e}`)}}function u(e){switch(e.toLowerCase()){case"ed25519":return a.KeyType.ED25519;case"secp256k1":return a.KeyType.SECP256K1;default:throw Error(`Unknown key type ${e}`)}}function l(e){switch(e){case a.KeyType.ED25519:return"ed25519Key";case a.KeyType.SECP256K1:return"secp256k1Key";default:throw Error(`unknown type ${e}`)}}class d{constructor(e){if(1!==Object.keys(e).length)throw Error("Enum can only take single value");Object.keys(e).map(t=>{this[t]=e[t]})}}class f extends d{enum;ed25519Key;secp256k1Key;constructor(e){let t=l(e.keyType);super({[t]:e}),this[t]=e,this.enum=t}static from(e){return"string"==typeof e?f.fromString(e):e}static fromString(e){let t,r;let n=e.split(":");if(1===n.length)t=n[0];else if(2===n.length)t=n[1],r=u(n[0]);else throw Error("Invalid encoded key format, must be <curve>:<encoded key>");let o=(0,i.baseDecode)(t);r||(r=o.length===a.KeySize.SECP256k1_PUBLIC_KEY?a.KeyType.SECP256K1:a.KeyType.ED25519);let s=r===a.KeyType.ED25519?a.KeySize.ED25519_PUBLIC_KEY:a.KeySize.SECP256k1_PUBLIC_KEY;if(o.length!==s)throw Error(`Invalid public key size (${o.length}), must be ${s}`);return new f({keyType:r,data:o})}toString(){let e=(0,i.baseEncode)(this.data);return`${c(this.keyType)}:${e}`}verify(e,t){let r=this.keyType,n=this.data;switch(r){case a.KeyType.ED25519:return o.ed25519.verify(t,e,n);case a.KeyType.SECP256K1:return s.default.ecdsaVerify(t.subarray(0,64),e,new Uint8Array([4,...n]));default:throw Error(`Unknown key type: ${r}`)}}get keyPair(){return this.ed25519Key||this.secp256k1Key}get keyType(){return this.keyPair.keyType}get data(){return this.keyPair.data}}t.PublicKey=f},78913:(e,t)=>{"use strict";
39Object.defineProperty(t,"__esModule",{value:!0}),t.Assignable=void 0;class r{constructor(e){Object.keys(e).map(t=>{this[t]=e[t]})}}t.Assignable=r},70141:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Enum=void 0;class r{constructor(e){if(1!==Object.keys(e).length)throw Error("Enum can only take single value");Object.keys(e).map(t=>{this[t]=e[t]})}}t.Enum=r},91519:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ErrorContext=t.TypedError=t.ArgumentTypeError=t.PositionalArgsError=void 0;class r extends Error{constructor(){super("Contract method calls expect named arguments wrapped in object, e.g. { argName1: argValue1, argName2: argValue2 }")}}t.PositionalArgsError=r;class n extends Error{constructor(e,t,r){super(`Expected ${t} for '${e}' argument, but got '${JSON.stringify(r)}'`)}}t.ArgumentTypeError=n;class i extends Error{type;context;constructor(e,t,r){super(e),this.type=t||"UntypedError",this.context=r}}t.TypedError=i;class o{transactionHash;constructor(e){this.transactionHash=e}}t.ErrorContext=o},81132:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);(!i||("get"in i?!t.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),i(r(78913),t),i(r(70141),t),i(r(91519),t),i(r(23856),t)},23856:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.FinalExecutionStatusBasic=t.ExecutionStatusBasic=t.IdType=void 0;var n=r(5876);Object.defineProperty(t,"IdType",{enumerable:!0,get:function(){return n.IdType}});var i=r(85291);Object.defineProperty(t,"ExecutionStatusBasic",{enumerable:!0,get:function(){return i.ExecutionStatusBasic}}),Object.defineProperty(t,"FinalExecutionStatusBasic",{enumerable:!0,get:function(){return i.FinalExecutionStatusBasic}})},5876:(e,t)=>{"use strict";var r;Object.defineProperty(t,"__esModule",{value:!0}),t.IdType=void 0,function(e){e.Transaction="transaction",e.Receipt="receipt"}(r||(t.IdType=r={}))},85291:(e,t)=>{"use strict";var r,n;Object.defineProperty(t,"__esModule",{value:!0}),t.FinalExecutionStatusBasic=t.ExecutionStatusBasic=void 0,function(e){e.Unknown="Unknown",e.Pending="Pending",e.Failure="Failure"}(r||(t.ExecutionStatusBasic=r={})),function(e){e.NotStarted="NotStarted",e.Started="Started",e.Failure="Failure"}(n||(t.FinalExecutionStatusBasic=n={}))},29695:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.DEFAULT_FUNCTION_CALL_GAS=void 0,t.DEFAULT_FUNCTION_CALL_GAS=30000000000000n},38673:function(e,t,r){"use strict";var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.ErrorMessages=void 0;let i=n(r(61930));t.ErrorMessages=i.default},48090:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.parseRpcError=t.parseResultError=t.getErrorTypeFromErrorMessage=t.formatError=t.ServerError=t.ErrorMessages=void 0;var n=r(38673);Object.defineProperty(t,"ErrorMessages",{enumerable:!0,get:function(){return n.ErrorMessages}});var i=r(26169);Object.defineProperty(t,"ServerError",{enumerable:!0,get:function(){return i.ServerError}}),Object.defineProperty(t,"formatError",{enumerable:!0,get:function(){return i.formatError}}),Object.defineProperty(t,"getErrorTypeFromErrorMessage",{enumerable:!0,get:function(){return i.getErrorTypeFromErrorMessage}}),Object.defineProperty(t,"parseResultError",{enumerable:!0,get:function(){return i.parseResultError}}),Object.defineProperty(t,"parseRpcError",{enumerable:!0,get:function(){return i.parseRpcError}})},26169:function(e,t,r){"use strict";var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.getErrorTypeFromErrorMessage=t.formatError=t.parseResultError=t.parseRpcError=t.ServerError=void 0;let i=r(81132),o=n(r(2139)),s=r(40863),a=r(38673),c=n(r(16001)),u={formatNear:()=>(e,t)=>(0,s.formatNearAmount)(t(e))};class l extends i.TypedError{}t.ServerError=l;class d extends l{transaction_outcome}function f(e){let t={},r=y(e,c.default.schema,t,""),n=new l(p(r,t),r);return Object.assign(n,t),n}function h(e){let t=f(e.status.Failure),r=new d;return Object.assign(r,t),r.type=t.type,r.message=t.message,r.transaction_outcome=e.transaction_outcome,r}function p(e,t){return"string"==typeof a.ErrorMessages[e]?o.default.render(a.ErrorMessages[e],{...t,...u}):JSON.stringify(t)}function y(e,t,r,n){let i,o,s;for(let r in t){if(b(e[r]))return e[r];if(m(e[r]))i=e[r],o=t[r],s=r;else{if(!(m(e.kind)&&m(e.kind[r])))continue;i=e.kind[r],o=t[r],s=r}}if(!i||!o)return r.kind=e,n;for(let e of Object.keys(o.props))r[e]=i[e];return y(i,t,r,s)}function g(e,t){switch(!0){case/^account .*? does not exist while viewing$/.test(e):case/^Account .*? doesn't exist$/.test(e):return"AccountDoesNotExist";case/^access key .*? does not exist while viewing$/.test(e):return"AccessKeyDoesNotExist";case/wasm execution failed with error: FunctionCallError\(CompilationError\(CodeDoesNotExist/.test(e):case/wasm execution failed with error: CompilationError\(CodeDoesNotExist/.test(e):return"CodeDoesNotExist";case/wasm execution failed with error: FunctionCallError\(MethodResolveError\(MethodNotFound/.test(e):case/wasm execution failed with error: MethodResolveError\(MethodNotFound/.test(e):return"MethodNotFound";case/Transaction nonce \d+ must be larger than nonce of the used access key \d+/.test(e):return"InvalidNonce";default:return t}}function m(e){return"[object Object]"===Object.prototype.toString.call(e)}function b(e){return"[object String]"===Object.prototype.toString.call(e)}t.parseRpcError=f,t.parseResultError=h,t.formatError=p,t.getErrorTypeFromErrorMessage=g},40863:(e,t,r)=>{"use strict";
39Object.defineProperty(t,"__esModule",{value:!0}),t.baseDecode=t.baseEncode=t.parseNearAmount=t.formatNearAmount=t.NEAR_NOMINATION=t.NEAR_NOMINATION_EXP=void 0;let n=r(65289);t.NEAR_NOMINATION_EXP=24,t.NEAR_NOMINATION=10n**BigInt(t.NEAR_NOMINATION_EXP);let i=[],o=10n;for(let e=0,r=5n;e<t.NEAR_NOMINATION_EXP;e++,r*=o)i[e]=r;function s(e,r=t.NEAR_NOMINATION_EXP){let n=BigInt(e);if(r!==t.NEAR_NOMINATION_EXP){let e=t.NEAR_NOMINATION_EXP-r-1;e>0&&(n+=i[e])}let o=(e=n.toString()).substring(0,e.length-t.NEAR_NOMINATION_EXP)||"0",a=e.substring(e.length-t.NEAR_NOMINATION_EXP).padStart(t.NEAR_NOMINATION_EXP,"0").substring(0,r);return u(`${d(o)}.${a}`)}function a(e){if(!e)return null;let r=(e=c(e)).split("."),n=r[0],i=r[1]||"";if(r.length>2||i.length>t.NEAR_NOMINATION_EXP)throw Error(`Cannot parse '${e}' as NEAR amount`);return l(n+i.padEnd(t.NEAR_NOMINATION_EXP,"0"))}function c(e){return e.replace(/,/g,"").trim()}function u(e){return e.replace(/\.?0*$/,"")}function l(e){return""===(e=e.replace(/^0+/,""))?"0":e}function d(e){let t=/(-?\d+)(\d{3})/;for(;t.test(e);)e=e.replace(t,"$1,$2");return e}function f(e){if("string"==typeof e){let t=[];for(let r=0;r<e.length;r++)t.push(e.charCodeAt(r));e=new Uint8Array(t)}return n.base58.encode(e)}function h(e){return n.base58.decode(e)}t.formatNearAmount=s,t.parseNearAmount=a,t.baseEncode=f,t.baseDecode=h},97152:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);(!i||("get"in i?!t.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),i(r(29695),t),i(r(48090),t),i(r(40863),t),i(r(48835),t),i(r(90365),t),i(r(58155),t),i(r(4615),t),i(r(48411),t)},52344:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ConsoleLogger=void 0;class r{logLevels;constructor(e){this.logLevels=e}isLevelEnabled=e=>this.logLevels.includes(e);print(e,t,...r){switch(e){case"error":case"fatal":return console.error(t,...r);case"warn":return console.warn(t,...r);case"log":return console.log(t,...r);case"debug":case"verbose":return console.debug(t,...r)}}verbose(e,...t){this.isLevelEnabled("verbose")&&this.print("verbose",e,...t)}debug(e,...t){this.isLevelEnabled("debug")&&this.print("debug",e,...t)}log(e,...t){this.isLevelEnabled("log")&&this.print("log",e,...t)}warn(e,...t){this.isLevelEnabled("warn")&&this.print("warn",e,...t)}error(e,...t){this.isLevelEnabled("error")&&this.print("error",e,...t)}fatal(e,...t){this.isLevelEnabled("fatal")&&this.print("fatal",e,...t)}}t.ConsoleLogger=r},4615:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Logger=t.ConsoleLogger=void 0;var n=r(52344);Object.defineProperty(t,"ConsoleLogger",{enumerable:!0,get:function(){return n.ConsoleLogger}});var i=r(98159);Object.defineProperty(t,"Logger",{enumerable:!0,get:function(){return i.Logger}})},98159:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Logger=void 0;let n=r(52344),i=["verbose","debug","log","warn","error","fatal"],o=new n.ConsoleLogger(i);class s{static instanceRef=o;static overrideLogger=e=>{this.instanceRef=e};static error(e,...t){this.instanceRef?.error(e,...t)}static log(e,...t){this.instanceRef?.log(e,...t)}static warn(e,...t){this.instanceRef?.warn(e,...t)}static debug(e,...t){this.instanceRef?.debug?.(e,...t)}static verbose(e,...t){this.instanceRef?.verbose?.(e,...t)}static fatal(e,...t){this.instanceRef?.fatal?.(e,...t)}}t.Logger=s},48835:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.printTxOutcomeLogs=t.printTxOutcomeLogsAndFailures=void 0;let n=r(48090),i=r(4615);function o({contractId:e,outcome:t}){for(let r of[t.transaction_outcome,...t.receipts_outcome].reduce((e,t)=>{let r="object"==typeof t.outcome.status&&"object"==typeof t.outcome.status.Failure;return t.outcome.logs.length||r?e.concat({receiptIds:t.outcome.re
39ceipt_ids,logs:t.outcome.logs,failure:"object"==typeof t.outcome.status&&void 0!==t.outcome.status.Failure?(0,n.parseRpcError)(t.outcome.status.Failure):null}):e},[]))i.Logger.log(`Receipt${r.receiptIds.length>1?"s":""}: ${r.receiptIds.join(", ")}`),s({contractId:e,logs:r.logs,prefix:" "}),r.failure&&i.Logger.warn(` Failure [${e}]: ${r.failure}`)}function s({contractId:e,logs:t,prefix:r=""}){for(let n of t)i.Logger.log(`${r}Log [${e}]: ${n}`)}t.printTxOutcomeLogsAndFailures=o,t.printTxOutcomeLogs=s},90365:(e,t,r)=>{"use strict";var n=r(75927).Buffer;function i(e){if("object"==typeof e.status&&"string"==typeof e.status.SuccessValue){let t=n.from(e.status.SuccessValue,"base64").toString();try{return JSON.parse(t)}catch(e){return t}}return null}Object.defineProperty(t,"__esModule",{value:!0}),t.getTransactionLastResult=void 0,t.getTransactionLastResult=i},48411:(e,t)=>{"use strict";function r(e,t){return e<t?-1:e>t?1:0}Object.defineProperty(t,"__esModule",{value:!0}),t.sortBigIntAsc=void 0,t.sortBigIntAsc=r},58155:function(e,t,r){"use strict";var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.diffEpochValidators=t.findSeatPrice=void 0;let i=n(r(29905)),o=r(48411);function s(e,t,r,n){return n&&n<49?a(e,t):(r||((0,i.default)("findSeatPrice(validators, maxNumberOfSeats)")("`use `findSeatPrice(validators, maxNumberOfSeats, minimumStakeRatio)` instead"),r=[1,6250]),c(e,t,r))}function a(e,t){let r=e.map(e=>BigInt(e.stake)).sort(o.sortBigIntAsc),n=BigInt(t),i=r.reduce((e,t)=>e+t);if(i<n)throw Error("Stakes are below seats");let s=1n,a=i+1n;for(;s!==a-1n;){let e=(s+a)/2n,t=!1,i=0n;for(let o=0;o<r.length;++o)if((i+=r[o]/e)>=n){s=e,t=!0;break}t||(a=e)}return s}function c(e,t,r){if(2!=r.length)throw Error("minimumStakeRatio should have 2 elements");let n=e.map(e=>BigInt(e.stake)).sort(o.sortBigIntAsc),i=n.reduce((e,t)=>e+t);return e.length<t?i*BigInt(r[0])/BigInt(r[1]):n[0]+1n}function u(e,t){let r=new Map;e.forEach(e=>r.set(e.account_id,e));let n=new Set(t.map(e=>e.account_id));return{newValidators:t.filter(e=>!r.has(e.account_id)),removedValidators:e.filter(e=>!n.has(e.account_id)),changedValidators:t.filter(e=>r.has(e.account_id)&&r.get(e.account_id).stake!=e.stake).map(e=>({current:r.get(e.account_id),next:e}))}}t.findSeatPrice=s,t.diffEpochValidators=u},34727:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.InMemoryKeyStore=void 0;let n=r(75092),i=r(14106);class o extends i.KeyStore{keys;constructor(){super(),this.keys={}}async setKey(e,t,r){this.keys[`${t}:${e}`]=r.toString()}async getKey(e,t){let r=this.keys[`${t}:${e}`];return r?n.KeyPair.fromString(r):null}async removeKey(e,t){delete this.keys[`${t}:${e}`]}async clear(){this.keys={}}async getNetworks(){let e=new Set;return Object.keys(this.keys).forEach(t=>{let r=t.split(":");e.add(r[1])}),Array.from(e.values())}async getAccounts(e){let t=[];return Object.keys(this.keys).forEach(r=>{let n=r.split(":");n[n.length-1]===e&&t.push(n.slice(0,n.length-1).join(":"))}),t}toString(){return"InMemoryKeyStore"}}t.InMemoryKeyStore=o},22516:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.MultiContractKeyStore=t.MergeKeyStore=t.KeyStore=t.InMemoryKeyStore=void 0;var n=r(34727);Object.defineProperty(t,"InMemoryKeyStore",{enumerable:!0,get:function(){return n.InMemoryKeyStore}});var i=r(14106);Object.defineProperty(t,"KeyStore",{enumerable:!0,get:function(){return i.KeyStore}});var o=r(51142);Object.defineProperty(t,"MergeKeyStore",{enumerable:!0,get:function(){return o.MergeKeyStore}});var s=r(17227);Object.defineProperty(t,"MultiContractKeyStore",{enumerable:!0,get:function(){return s.MultiContractKeyStore}})},14106:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.KeyStore=void 0;class r{}t.KeyStore=r},51142:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.MergeKeyStore=void 0;let n=r(14106);class i extends n.KeyStore{options;keyStores;constructor(e,t={writeKeyStoreIndex:0}){super(),this.options=t,this.keyStores=e}async setKey(e,t,r){await this.keyStores[this.options.writeKeyStoreIndex].setKey(e,t,r)}async getKey(e,t){for(let r of this.keyStores){let n=await r.getKey(e,t);if(n)return n}return null}async removeKey(e,t){for(let r of this.keyStores)await r.removeKey(e,t)}async clear(){for(let e of this.keyStores)await e.clear()}async getNetworks(){let e=new Set;for(let t of this.keyStores)for(let r of(await t.getNetworks()))e.add(r);return Array.from(e)}async getAccounts(e){let t=new Set;for(let r of this.keyStores)for(let n of(await r.getAccounts(e)))t.add(n);return Array.from(t)}toString(){return`MergeKeyStore(${this.keyStores.join(", ")})`}}
39t.MergeKeyStore=i},17227:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.MultiContractKeyStore=void 0;class r{}t.MultiContractKeyStore=r},85009:(e,t)=>{"use strict";async function r(e,t,r,i){let o=e;for(let e=0;e<t;e++){let e=await i();if(e)return e;await n(o),o*=r}return null}function n(e){return new Promise(t=>setTimeout(t,e))}Object.defineProperty(t,"__esModule",{value:!0}),t.exponentialBackoff=void 0,t.exponentialBackoff=r},91609:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.FailoverRpcProvider=void 0;let n=r(77743),i=r(35339),o=r(82080);class s extends o.Provider{providers;currentProviderIndex;constructor(e){if(super(),0===e.length)throw Error("At least one provider must be specified");this.providers=e,this.currentProviderIndex=0}switchToNextProvider(){1!==this.providers.length&&(this.providers.length-1<=this.currentProviderIndex?this.currentProviderIndex=0:this.currentProviderIndex+=1,n.Logger.debug(`Switched to provider at the index ${this.currentProviderIndex}`))}get currentProvider(){let e=this.providers[this.currentProviderIndex];if(!e)throw Error(`Provider wasn't found at index ${this.currentProviderIndex}`);return e}async withBackoff(e){for(let t=0;t<this.providers.length;t++)try{let t=await e(this.currentProvider);if(t)return t}catch(e){console.error(e),this.switchToNextProvider()}throw new i.TypedError(`Exceeded ${this.providers.length} providers to execute request`,"RetriesExceeded")}async status(){return this.withBackoff(e=>e.status())}async sendTransactionUntil(e,t){return this.withBackoff(r=>r.sendTransactionUntil(e,t))}async sendTransaction(e){return this.withBackoff(t=>t.sendTransaction(e))}async sendTransactionAsync(e){return this.withBackoff(t=>t.sendTransactionAsync(e))}async txStatus(e,t,r){return this.withBackoff(n=>n.txStatus(e,t,r))}async txStatusReceipts(e,t,r){return this.withBackoff(n=>n.txStatusReceipts(e,t,r))}async query(e,t){return t?this.withBackoff(r=>r.query(e,t)):this.withBackoff(t=>t.query(e))}async block(e){return this.withBackoff(t=>t.block(e))}async blockChanges(e){return this.withBackoff(t=>t.blockChanges(e))}async chunk(e){return this.withBackoff(t=>t.chunk(e))}async validators(e){return this.withBackoff(t=>t.validators(e))}async experimental_protocolConfig(e){return this.withBackoff(t=>t.experimental_protocolConfig(e))}async lightClientProof(e){return this.withBackoff(t=>t.lightClientProof(e))}async nextLightClientBlock(e){return this.withBackoff(t=>t.nextLightClientBlock(e))}async accessKeyChanges(e,t){return this.withBackoff(r=>r.accessKeyChanges(e,t))}async singleAccessKeyChanges(e,t){return this.withBackoff(r=>r.singleAccessKeyChanges(e,t))}async accountChanges(e,t){return this.withBackoff(r=>r.accountChanges(e,t))}async contractStateChanges(e,t,r=""){return this.withBackoff(n=>n.contractStateChanges(e,t,r))}async contractCodeChanges(e,t){return this.withBackoff(r=>r.contractCodeChanges(e,t))}async gasPrice(e){return this.withBackoff(t=>t.gasPrice(e))}}t.FailoverRpcProvider=s},53022:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.fetchJsonRpc=t.ProviderError=t.retryConfig=void 0;let n=r(35339),i=r(67918),o=1.5,s=10,a=0;function c(e=s,t=o,r=a){return{numOfAttempts:e,timeMultiple:t,startingDelay:r,retry:e=>!!([503,500,408].includes(e.cause)||e.toString().includes("FetchError")||e.toString().includes("Failed to fetch"))}}t.retryConfig=c;class u extends Error{cause;constructor(e,t){super(e,t),t.cause&&(this.cause=t.cause)}}async function l(e,t,r,o){let a=await (0,i.backOff)(async()=>{let n=await fetch(e,{method:"POST",body:JSON.stringify(t),headers:{...r,"Content-Type":"application/json"}}),{ok:i,status:o}=n;if(500===o)throw new u("Internal server error",{cause:o});if(408===o)throw new u("Timeout error",{cause:o});if(400===o)throw new u("Request validation error",{cause:o});if(503===o)throw new u(`${e} unavailable`,{cause:o});if(!i)throw new u(await n.text(),{cause:o});return n},o);if(!a)throw new n.TypedError(`Exceeded ${s} attempts for ${e}.`,"RetriesExceeded");return await a.json()}t.ProviderError=u,t.fetchJsonRpc=l},76975:(e,t,r)=>{"use strict";
39Object.defineProperty(t,"__esModule",{value:!0}),t.Provider=t.FailoverRpcProvider=t.JsonRpcProvider=t.exponentialBackoff=void 0;var n=r(85009);Object.defineProperty(t,"exponentialBackoff",{enumerable:!0,get:function(){return n.exponentialBackoff}});var i=r(9853);Object.defineProperty(t,"JsonRpcProvider",{enumerable:!0,get:function(){return i.JsonRpcProvider}});var o=r(91609);Object.defineProperty(t,"FailoverRpcProvider",{enumerable:!0,get:function(){return o.FailoverRpcProvider}});var s=r(82080);Object.defineProperty(t,"Provider",{enumerable:!0,get:function(){return s.Provider}})},9853:(e,t,r)=>{"use strict";var n=r(75927).Buffer;Object.defineProperty(t,"__esModule",{value:!0}),t.JsonRpcProvider=void 0;let i=r(77743),o=r(35339),s=r(14100),a=r(82080),c=r(53022),u=12,l=500,d=1.5,f=123;class h extends a.Provider{connection;options;constructor(e,t){super(),this.connection=e||{url:""};let r={retries:u,wait:l,backoff:d};this.options=Object.assign({},r,t)}async status(){return this.sendJsonRpc("status",[])}async sendTransactionUntil(e,t){let r=(0,s.encodeTransaction)(e);return this.sendJsonRpc("send_tx",{signed_tx_base64:n.from(r).toString("base64"),wait_until:t})}async sendTransaction(e){return this.sendTransactionUntil(e,"EXECUTED_OPTIMISTIC")}async sendTransactionAsync(e){return this.sendTransactionUntil(e,"NONE")}async txStatus(e,t,r="EXECUTED_OPTIMISTIC"){return"string"==typeof e?this.txStatusString(e,t,r):this.txStatusUint8Array(e,t,r)}async txStatusUint8Array(e,t,r){return this.sendJsonRpc("tx",{tx_hash:(0,i.baseEncode)(e),sender_account_id:t,wait_until:r})}async txStatusString(e,t,r){return this.sendJsonRpc("tx",{tx_hash:e,sender_account_id:t,wait_until:r})}async txStatusReceipts(e,t,r="EXECUTED_OPTIMISTIC"){return"string"==typeof e?this.sendJsonRpc("EXPERIMENTAL_tx_status",{tx_hash:e,sender_account_id:t,wait_until:r}):this.sendJsonRpc("EXPERIMENTAL_tx_status",{tx_hash:(0,i.baseEncode)(e),sender_account_id:t,wait_until:r})}async query(...e){let t;if(1===e.length){let{block_id:r,blockId:n,...i}=e[0];t=await this.sendJsonRpc("query",{...i,block_id:r||n})}else{let[r,n]=e;t=await this.sendJsonRpc("query",[r,n])}if(t&&t.error)throw new o.TypedError(`Querying failed: ${t.error}. 40${JSON.stringify(t,null,2)}`,(0,i.getErrorTypeFromErrorMessage)(t.error,t.error.name));return t}async block(e){let{finality:t}=e,{blockId:r}=e;return this.sendJsonRpc("block",{block_id:r,finality:t})}async blockChanges(e){let{finality:t}=e,{blockId:r}=e;return this.sendJsonRpc("EXPERIMENTAL_changes_in_block",{block_id:r,finality:t})}async chunk(e){return this.sendJsonRpc("chunk",[e])}async validators(e){return this.sendJsonRpc("validators",[e])}async experimental_protocolConfig(e){let{blockId:t,...r}=e;return await this.sendJsonRpc("EXPERIMENTAL_protocol_config",{...r,block_id:t})}async lightClientProof(e){return await this.sendJsonRpc("EXPERIMENTAL_light_client_proof",e)}async nextLightClientBlock(e){return await this.sendJsonRpc("next_light_client_block",e)}async accessKeyChanges(e,t){let{finality:r}=t,{blockId:n}=t;return this.sendJsonRpc("EXPERIMENTAL_changes",{changes_type:"all_access_key_changes",account_ids:e,block_id:n,finality:r})}async singleAccessKeyChanges(e,t){let{finality:r}=t,{blockId:n}=t;return this.sendJsonRpc("EXPERIMENTAL_changes",{changes_type:"single_access_key_changes",keys:e,block_id:n,finality:r})}async accountChanges(e,t){let{finality:r}=t,{blockId:n}=t;return this.sendJsonRpc("EXPERIMENTAL_changes",{changes_type:"account_changes",account_ids:e,block_id:n,finality:r})}async contractStateChanges(e,t,r=""){let{finality:n}=t,{blockId:i}=t;return this.sendJsonRpc("EXPERIMENTAL_changes",{changes_type:"data_changes",account_ids:e,key_prefix_base64:r,block_id:i,finality:n})}async contractCodeChanges(e,t){let{finality:r}=t,{blockId:n}=t;return this.sendJsonRpc("EXPERIMENTAL_changes",{changes_type:"contract_code_changes",account_ids:e,block_id:n,finality:r})}async gasPrice(e){return await this.sendJsonRpc("gas_price",[e])}async sendJsonRpc(e,t){let r={method:e,params:t,id:f++,jsonrpc:"2.0"},n=await (0,c.fetchJsonRpc)(this.connection.url,r,this.connection.headers,(0,c.retryConfig)(this.options.retries,this.options.backoff,this.options.wait));if(n.error){if("object"==typeof n.error.data){if("string"==typeof n.error.data.error_message&&"string"==typeof n.error.data.error_type)throw new o.TypedError(n.error.data.error_message,n.error.data.error_type);throw(0,i.parseRpcError)(n.error.data)}{let e=`[${n.error.code}] ${n.error.message}: ${n.error.data}`,r=(0,i.getErrorTypeFromErrorMessage)(n.error.data,"");if(r)throw new o.TypedError((0,i.formatError)(r,t),r);
40throw new o.TypedError(e,n.error.name)}}if("string"==typeof n.result?.error){let e=(0,i.getErrorTypeFromErrorMessage)(n.result.error,"");if(e)throw new i.ServerError((0,i.formatError)(e,t),e)}let{result:s}=n;if(void 0===s)throw new o.TypedError(`Exceeded ${this.options.retries} attempts for request to ${e}.`,"RetriesExceeded");return s}}t.JsonRpcProvider=h},82080:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Provider=void 0;class r{}t.Provider=r},71380:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Assignable=void 0;class r{constructor(e){Object.keys(e).map(t=>{this[t]=e[t]})}}t.Assignable=r},19664:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Enum=void 0;class r{constructor(e){if(1!==Object.keys(e).length)throw Error("Enum can only take single value");Object.keys(e).map(t=>{this[t]=e[t]})}}t.Enum=r},41334:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ErrorContext=t.TypedError=t.ArgumentTypeError=t.PositionalArgsError=void 0;class r extends Error{constructor(){super("Contract method calls expect named arguments wrapped in object, e.g. { argName1: argValue1, argName2: argValue2 }")}}t.PositionalArgsError=r;class n extends Error{constructor(e,t,r){super(`Expected ${t} for '${e}' argument, but got '${JSON.stringify(r)}'`)}}t.ArgumentTypeError=n;class i extends Error{type;context;constructor(e,t,r){super(e),this.type=t||"UntypedError",this.context=r}}t.TypedError=i;class o{transactionHash;constructor(e){this.transactionHash=e}}t.ErrorContext=o},35339:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);(!i||("get"in i?!t.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),i(r(71380),t),i(r(19664),t),i(r(41334),t),i(r(74517),t)},74517:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.FinalExecutionStatusBasic=t.ExecutionStatusBasic=t.IdType=void 0;var n=r(97215);Object.defineProperty(t,"IdType",{enumerable:!0,get:function(){return n.IdType}});var i=r(40780);Object.defineProperty(t,"ExecutionStatusBasic",{enumerable:!0,get:function(){return i.ExecutionStatusBasic}}),Object.defineProperty(t,"FinalExecutionStatusBasic",{enumerable:!0,get:function(){return i.FinalExecutionStatusBasic}})},97215:(e,t)=>{"use strict";var r;Object.defineProperty(t,"__esModule",{value:!0}),t.IdType=void 0,function(e){e.Transaction="transaction",e.Receipt="receipt"}(r||(t.IdType=r={}))},40780:(e,t)=>{"use strict";var r,n;Object.defineProperty(t,"__esModule",{value:!0}),t.FinalExecutionStatusBasic=t.ExecutionStatusBasic=void 0,function(e){e.Unknown="Unknown",e.Pending="Pending",e.Failure="Failure"}(r||(t.ExecutionStatusBasic=r={})),function(e){e.NotStarted="NotStarted",e.Started="Started",e.Failure="Failure"}(n||(t.FinalExecutionStatusBasic=n={}))},97988:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.DEFAULT_FUNCTION_CALL_GAS=void 0,t.DEFAULT_FUNCTION_CALL_GAS=30000000000000n},11542:function(e,t,r){"use strict";var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.ErrorMessages=void 0;let i=n(r(39197));t.ErrorMessages=i.default},17035:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.parseRpcError=t.parseResultError=t.getErrorTypeFromErrorMessage=t.formatError=t.ServerError=t.ErrorMessages=void 0;var n=r(11542);Object.defineProperty(t,"ErrorMessages",{enumerable:!0,get:function(){return n.ErrorMessages}});var i=r(70750);Object.defineProperty(t,"ServerError",{enumerable:!0,get:function(){return i.ServerError}}),Object.defineProperty(t,"formatError",{enumerable:!0,get:function(){return i.formatError}}),Object.defineProperty(t,"getErrorTypeFromErrorMessage",{enumerable:!0,get:function(){return i.getErrorTypeFromErrorMessage}}),Object.defineProperty(t,"parseResultError",{enumerable:!0,get:function(){return i.parseResultError}}),Object.defineProperty(t,"parseRpcError",{enumerable:!0,get:function(){return i.parseRpcError}})},70750:function(e,t,r){"use strict";var n=this&&this.__importDefault||function(e){return e&&e.__esMo
40dule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.getErrorTypeFromErrorMessage=t.formatError=t.parseResultError=t.parseRpcError=t.ServerError=void 0;let i=r(35339),o=n(r(2139)),s=r(29606),a=r(11542),c=n(r(86810)),u={formatNear:()=>(e,t)=>(0,s.formatNearAmount)(t(e))};class l extends i.TypedError{}t.ServerError=l;class d extends l{transaction_outcome}function f(e){let t={},r=y(e,c.default.schema,t,""),n=new l(p(r,t),r);return Object.assign(n,t),n}function h(e){let t=f(e.status.Failure),r=new d;return Object.assign(r,t),r.type=t.type,r.message=t.message,r.transaction_outcome=e.transaction_outcome,r}function p(e,t){return"string"==typeof a.ErrorMessages[e]?o.default.render(a.ErrorMessages[e],{...t,...u}):JSON.stringify(t)}function y(e,t,r,n){let i,o,s;for(let r in t){if(b(e[r]))return e[r];if(m(e[r]))i=e[r],o=t[r],s=r;else{if(!(m(e.kind)&&m(e.kind[r])))continue;i=e.kind[r],o=t[r],s=r}}if(!i||!o)return r.kind=e,n;for(let e of Object.keys(o.props))r[e]=i[e];return y(i,t,r,s)}function g(e,t){switch(!0){case/^account .*? does not exist while viewing$/.test(e):case/^Account .*? doesn't exist$/.test(e):return"AccountDoesNotExist";case/^access key .*? does not exist while viewing$/.test(e):return"AccessKeyDoesNotExist";case/wasm execution failed with error: FunctionCallError\(CompilationError\(CodeDoesNotExist/.test(e):case/wasm execution failed with error: CompilationError\(CodeDoesNotExist/.test(e):return"CodeDoesNotExist";case/wasm execution failed with error: FunctionCallError\(MethodResolveError\(MethodNotFound/.test(e):case/wasm execution failed with error: MethodResolveError\(MethodNotFound/.test(e):return"MethodNotFound";case/Transaction nonce \d+ must be larger than nonce of the used access key \d+/.test(e):return"InvalidNonce";default:return t}}function m(e){return"[object Object]"===Object.prototype.toString.call(e)}function b(e){return"[object String]"===Object.prototype.toString.call(e)}t.parseRpcError=f,t.parseResultError=h,t.formatError=p,t.getErrorTypeFromErrorMessage=g},29606:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.baseDecode=t.baseEncode=t.parseNearAmount=t.formatNearAmount=t.NEAR_NOMINATION=t.NEAR_NOMINATION_EXP=void 0;let n=r(65289);t.NEAR_NOMINATION_EXP=24,t.NEAR_NOMINATION=10n**BigInt(t.NEAR_NOMINATION_EXP);let i=[],o=10n;for(let e=0,r=5n;e<t.NEAR_NOMINATION_EXP;e++,r*=o)i[e]=r;function s(e,r=t.NEAR_NOMINATION_EXP){let n=BigInt(e);if(r!==t.NEAR_NOMINATION_EXP){let e=t.NEAR_NOMINATION_EXP-r-1;e>0&&(n+=i[e])}let o=(e=n.toString()).substring(0,e.length-t.NEAR_NOMINATION_EXP)||"0",a=e.substring(e.length-t.NEAR_NOMINATION_EXP).padStart(t.NEAR_NOMINATION_EXP,"0").substring(0,r);return u(`${d(o)}.${a}`)}function a(e){if(!e)return null;let r=(e=c(e)).split("."),n=r[0],i=r[1]||"";if(r.length>2||i.length>t.NEAR_NOMINATION_EXP)throw Error(`Cannot parse '${e}' as NEAR amount`);return l(n+i.padEnd(t.NEAR_NOMINATION_EXP,"0"))}function c(e){return e.replace(/,/g,"").trim()}function u(e){return e.replace(/\.?0*$/,"")}function l(e){return""===(e=e.replace(/^0+/,""))?"0":e}function d(e){let t=/(-?\d+)(\d{3})/;for(;t.test(e);)e=e.replace(t,"$1,$2");return e}function f(e){if("string"==typeof e){let t=[];for(let r=0;r<e.length;r++)t.push(e.charCodeAt(r));e=new Uint8Array(t)}return n.base58.encode(e)}function h(e){return n.base58.decode(e)}t.formatNearAmount=s,t.parseNearAmount=a,t.baseEncode=f,t.baseDecode=h},77743:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);(!i||("get"in i?!t.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),i(r(97988),t),i(r(17035),t),i(r(29606),t),i(r(11892),t),i(r(56352),t),i(r(99462),t),i(r(9342),t),i(r(27328),t)},87959:(e,t)=>{"use strict";
40Object.defineProperty(t,"__esModule",{value:!0}),t.ConsoleLogger=void 0;class r{logLevels;constructor(e){this.logLevels=e}isLevelEnabled=e=>this.logLevels.includes(e);print(e,t,...r){switch(e){case"error":case"fatal":return console.error(t,...r);case"warn":return console.warn(t,...r);case"log":return console.log(t,...r);case"debug":case"verbose":return console.debug(t,...r)}}verbose(e,...t){this.isLevelEnabled("verbose")&&this.print("verbose",e,...t)}debug(e,...t){this.isLevelEnabled("debug")&&this.print("debug",e,...t)}log(e,...t){this.isLevelEnabled("log")&&this.print("log",e,...t)}warn(e,...t){this.isLevelEnabled("warn")&&this.print("warn",e,...t)}error(e,...t){this.isLevelEnabled("error")&&this.print("error",e,...t)}fatal(e,...t){this.isLevelEnabled("fatal")&&this.print("fatal",e,...t)}}t.ConsoleLogger=r},9342:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Logger=t.ConsoleLogger=void 0;var n=r(87959);Object.defineProperty(t,"ConsoleLogger",{enumerable:!0,get:function(){return n.ConsoleLogger}});var i=r(83868);Object.defineProperty(t,"Logger",{enumerable:!0,get:function(){return i.Logger}})},83868:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Logger=void 0;let n=r(87959),i=["verbose","debug","log","warn","error","fatal"],o=new n.ConsoleLogger(i);class s{static instanceRef=o;static overrideLogger=e=>{this.instanceRef=e};static error(e,...t){this.instanceRef?.error(e,...t)}static log(e,...t){this.instanceRef?.log(e,...t)}static warn(e,...t){this.instanceRef?.warn(e,...t)}static debug(e,...t){this.instanceRef?.debug?.(e,...t)}static verbose(e,...t){this.instanceRef?.verbose?.(e,...t)}static fatal(e,...t){this.instanceRef?.fatal?.(e,...t)}}t.Logger=s},11892:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.printTxOutcomeLogs=t.printTxOutcomeLogsAndFailures=void 0;let n=r(17035),i=r(9342);function o({contractId:e,outcome:t}){for(let r of[t.transaction_outcome,...t.receipts_outcome].reduce((e,t)=>{let r="object"==typeof t.outcome.status&&"object"==typeof t.outcome.status.Failure;return t.outcome.logs.length||r?e.concat({receiptIds:t.outcome.receipt_ids,logs:t.outcome.logs,failure:"object"==typeof t.outcome.status&&void 0!==t.outcome.status.Failure?(0,n.parseRpcError)(t.outcome.status.Failure):null}):e},[]))i.Logger.log(`Receipt${r.receiptIds.length>1?"s":""}: ${r.receiptIds.join(", ")}`),s({contractId:e,logs:r.logs,prefix:" "}),r.failure&&i.Logger.warn(` Failure [${e}]: ${r.failure}`)}function s({contractId:e,logs:t,prefix:r=""}){for(let n of t)i.Logger.log(`${r}Log [${e}]: ${n}`)}t.printTxOutcomeLogsAndFailures=o,t.printTxOutcomeLogs=s},56352:(e,t,r)=>{"use strict";var n=r(75927).Buffer;function i(e){if("object"==typeof e.status&&"string"==typeof e.status.SuccessValue){let t=n.from(e.status.SuccessValue,"base64").toString();try{return JSON.parse(t)}catch(e){return t}}return null}Object.defineProperty(t,"__esModule",{value:!0}),t.getTransactionLastResult=void 0,t.getTransactionLastResult=i},27328:(e,t)=>{"use strict";function r(e,t){return e<t?-1:e>t?1:0}Object.defineProperty(t,"__esModule",{value:!0}),t.sortBigIntAsc=void 0,t.sortBigIntAsc=r},99462:function(e,t,r){"use strict";var n=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),t.diffEpochValidators=t.findSeatPrice=void 0;let i=n(r(29905)),o=r(27328);function s(e,t,r,n){return n&&n<49?a(e,t):(r||((0,i.default)("findSeatPrice(validators, maxNumberOfSeats)")("`use `findSeatPrice(validators, maxNumberOfSeats, minimumStakeRatio)` instead"),r=[1,6250]),c(e,t,r))}function a(e,t){let r=e.map(e=>BigInt(e.stake)).sort(o.sortBigIntAsc),n=BigInt(t),i=r.reduce((e,t)=>e+t);if(i<n)throw Error("Stakes are below seats");let s=1n,a=i+1n;for(;s!==a-1n;){let e=(s+a)/2n,t=!1,i=0n;for(let o=0;o<r.length;++o)if((i+=r[o]/e)>=n){s=e,t=!0;break}t||(a=e)}return s}function c(e,t,r){if(2!=r.length)throw Error("minimumStakeRatio should have 2 elements");let n=e.map(e=>BigInt(e.stake)).sort(o.sortBigIntAsc),i=n.reduce((e,t)=>e+t);return e.length<t?i*BigInt(r[0])/BigInt(r[1]):n[0]+1n}function u(e,t){let r=new Map;
40e.forEach(e=>r.set(e.account_id,e));let n=new Set(t.map(e=>e.account_id));return{newValidators:t.filter(e=>!r.has(e.account_id)),removedValidators:e.filter(e=>!n.has(e.account_id)),changedValidators:t.filter(e=>r.has(e.account_id)&&r.get(e.account_id).stake!=e.stake).map(e=>({current:r.get(e.account_id),next:e}))}}t.findSeatPrice=s,t.diffEpochValidators=u},67530:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.InMemorySigner=void 0;let n=r(75092),i=r(22516),o=r(23236),s=r(29738);class a extends s.Signer{keyStore;constructor(e){super(),this.keyStore=e}static async fromKeyPair(e,t,r){let n=new i.InMemoryKeyStore;return await n.setKey(e,t,r),new a(n)}async createKey(e,t,r){let i=r===n.KeyType.SECP256K1?n.KeyPair.fromRandom("secp256k1"):n.KeyPair.fromRandom("ed25519");return await this.keyStore.setKey(t,e,i),i.getPublicKey()}async getPublicKey(e,t){let r=await this.keyStore.getKey(t,e);return null===r?null:r.getPublicKey()}async signMessage(e,t,r){let n=new Uint8Array((0,o.sha256)(e));if(!t)throw Error("InMemorySigner requires provided account id");let i=await this.keyStore.getKey(r,t);if(null===i)throw Error(`Key for ${t} not found in ${r}`);return i.sign(n)}toString(){return`InMemorySigner(${this.keyStore})`}}t.InMemorySigner=a},66962:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Signer=t.InMemorySigner=void 0;var n=r(67530);Object.defineProperty(t,"InMemorySigner",{enumerable:!0,get:function(){return n.InMemorySigner}});var i=r(29738);Object.defineProperty(t,"Signer",{enumerable:!0,get:function(){return i.Signer}})},29738:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Signer=void 0;class r{}t.Signer=r},58326:(e,t,r)=>{"use strict";var n=r(75927).Buffer;Object.defineProperty(t,"__esModule",{value:!0}),t.actionCreators=t.stringifyJsonOrBytes=void 0;let i=r(23593);function o(){return new i.AccessKey({nonce:0n,permission:new i.AccessKeyPermission({fullAccess:new i.FullAccessPermission})})}function s(e,t,r){return new i.AccessKey({nonce:0n,permission:new i.AccessKeyPermission({functionCall:new i.FunctionCallPermission({receiverId:e,allowance:r,methodNames:t})})})}function a(){return new i.Action({createAccount:new i.CreateAccount})}function c(e){return new i.Action({deployContract:new i.DeployContract({code:e})})}function u(e){return void 0!==e.byteLength&&e.byteLength===e.length?e:n.from(JSON.stringify(e))}function l(e,t,r=0n,n=0n,o=u,s=!1){return new i.Action(s?{functionCall:new i.FunctionCall({methodName:e,args:t,gas:r,deposit:n})}:{functionCall:new i.FunctionCall({methodName:e,args:o(t),gas:r,deposit:n})})}function d(e=0n){return new i.Action({transfer:new i.Transfer({deposit:e})})}function f(e=0n,t){return new i.Action({stake:new i.Stake({stake:e,publicKey:t})})}function h(e,t){return new i.Action({addKey:new i.AddKey({publicKey:e,accessKey:t})})}function p(e){return new i.Action({deleteKey:new i.DeleteKey({publicKey:e})})}function y(e){return new i.Action({deleteAccount:new i.DeleteAccount({beneficiaryId:e})})}function g({delegateAction:e,signature:t}){return new i.Action({signedDelegate:new i.SignedDelegate({delegateAction:e,signature:t})})}t.stringifyJsonOrBytes=u,t.actionCreators={addKey:h,createAccount:a,deleteAccount:y,deleteKey:p,deployContract:c,fullAccessKey:o,functionCall:l,functionCallAccessKey:s,signedDelegate:g,stake:f,transfer:d}},23593:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Action=t.SignedDelegate=t.DeleteAccount=t.DeleteKey=t.AddKey=t.Stake=t.Transfer=t.FunctionCall=t.DeployContract=t.CreateAccount=t.AccessKey=t.AccessKeyPermission=t.FullAccessPermission=t.FunctionCallPermission=void 0;let n=r(36236);class i{allowance;receiverId;methodNames;constructor({allowance:e,receiverId:t,methodNames:r}){this.allowance=e,this.receiverId=t,this.methodNames=r}}t.FunctionCallPermission=i;class o{}t.FullAccessPermission=o;class s extends n.Enum{enum;functionCall;fullAccess;constructor(e){for(let[t,r]of(super(e),Object.entries(e||{})))this[t]=r,this.enum=t}}t.AccessKeyPermission=s;class a{nonce;permission;constructor({nonce:e,permission:t}){this.nonce=e,this.permission=t}}t.AccessKey=a;class c{}t.CreateAccount=c;class u{code;constructor({code:e}
40){this.code=e}}t.DeployContract=u;class l{methodName;args;gas;deposit;constructor({methodName:e,args:t,gas:r,deposit:n}){this.methodName=e,this.args=t,this.gas=r,this.deposit=n}}t.FunctionCall=l;class d{deposit;constructor({deposit:e}){this.deposit=e}}t.Transfer=d;class f{stake;publicKey;constructor({stake:e,publicKey:t}){this.stake=e,this.publicKey=t}}t.Stake=f;class h{publicKey;accessKey;constructor({publicKey:e,accessKey:t}){this.publicKey=e,this.accessKey=t}}t.AddKey=h;class p{publicKey;constructor({publicKey:e}){this.publicKey=e}}t.DeleteKey=p;class y{beneficiaryId;constructor({beneficiaryId:e}){this.beneficiaryId=e}}t.DeleteAccount=y;class g{delegateAction;signature;constructor({delegateAction:e,signature:t}){this.delegateAction=e,this.signature=t}}t.SignedDelegate=g;class m extends n.Enum{enum;createAccount;deployContract;functionCall;transfer;stake;addKey;deleteKey;deleteAccount;signedDelegate;constructor(e){for(let[t,r]of(super(e),Object.entries(e||{})))this[t]=r,this.enum=t}}t.Action=m},42691:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.createTransaction=void 0;let n=r(5575);function i(e,t,r,i,o,s){let a="bigint"==typeof i?i:BigInt(i);return new n.Transaction({signerId:e,publicKey:t,nonce:a,receiverId:r,actions:o,blockHash:s})}t.createTransaction=i},17627:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.buildDelegateAction=t.DelegateAction=void 0;let{addKey:n,createAccount:i,deleteAccount:o,deleteKey:s,deployContract:a,functionCall:c,stake:u,transfer:l}=r(58326).actionCreators;class d{senderId;receiverId;actions;nonce;maxBlockHeight;publicKey;constructor({senderId:e,receiverId:t,actions:r,nonce:n,maxBlockHeight:i,publicKey:o}){this.senderId=e,this.receiverId=t,this.actions=r,this.nonce=n,this.maxBlockHeight=i,this.publicKey=o}}function f({actions:e,maxBlockHeight:t,nonce:r,publicKey:f,receiverId:h,senderId:p}){return new d({senderId:p,receiverId:h,actions:e.map(e=>{if(!e.type&&!e.params)return e;switch(e.type){case"AddKey":{let{publicKey:t,accessKey:r}=e.params;return n(t,r)}case"CreateAccount":return i(e.params.createAccount);case"DeleteAccount":return o(e.params.deleteAccount);case"DeleteKey":return s(e.params.publicKey);case"DeployContract":return a(e.params.code);case"FunctionCall":{let{methodName:t,args:r,gas:n,deposit:i}=e.params;return c(t,r,n,i)}case"Stake":return u(e.params.stake,e.params.publicKey);case"Transfer":{let{deposit:t}=e.params;return l(t)}}throw Error("Unrecognized action")}),nonce:r,maxBlockHeight:t,publicKey:f})}t.DelegateAction=d,t.buildDelegateAction=f},14100:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);(!i||("get"in i?!t.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),i(r(58326),t),i(r(23593),t),i(r(42691),t),i(r(17627),t),i(r(5575),t),i(r(88329),t),i(r(60554),t)},18358:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.DelegateActionPrefix=void 0;let r=0x40000000,n={MetaTransactions:366};class i{prefix;constructor({prefix:e}){this.prefix=e}}class o extends i{constructor(e){super({prefix:r+e})}}class s extends o{constructor(){super(n.MetaTransactions)}}t.DelegateActionPrefix=s},5575:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.SCHEMA=t.SignedTransaction=t.Transaction=t.decodeSignedTransaction=t.decodeTransaction=t.encodeTransaction=t.encodeSignedDelegate=t.encodeDelegateAction=void 0;let n=r(60175),i=r(18358);function o(e){return new Uint8Array([...(0,n.serialize)(t.SCHEMA.DelegateActionPrefix,new i.DelegateActionPrefix),...(0,n.serialize)(t.SCHEMA.DelegateAction,e)])}function s(e){return(0,n.serialize)(t.SCHEMA.SignedDelegate,e)}function a(e){let r=e instanceof d?t.SCHEMA.SignedTransaction:t.SCHEMA.Transaction;return(0,n.serialize)(r,e)}function c(e){return new l((0,n.deserialize)(t.SCHEMA.Transaction,e))}function u(e){return new d((0,n.deserialize)(t.SCHEMA.SignedTransaction,e))}t.encodeDelegateAction=o,t.encodeSignedDelegate=s,t.encodeTransaction=a,t.decodeTransaction=c,t.decodeSignedTransaction=u;class l{signerId;publicKey;nonce;receiverId;actions;blockHash;constructor({signerId:e,publicKey:t,nonce:r,receiverId:n,actions:i,blockHash:o}){this.signerId=e,this.publicKey=t,this.nonce=r,this.receiverId=n,this.actions=i,this.blockHash=o}encode(){return a(this)}static decode(e){return c(e)}}t.Transaction=l;class d{transaction;signature;constructor({transaction:e,signature:t}){this.transaction=e,this.signature=t}encode(){return a(this)}static decode(e){return u(e)}}t.SignedTransaction=d,t.SCHEMA=new class{Ed25519Signature={struct:{data:{array:{type:"u8",len:64}}}};Secp256k1Signature={struct:{data:{array:{type:"u8",len:65}}}};Signature={enum:[{struct:{ed25519Signature:this.Ed25519Signature}},{struct:{secp256k1Signature:this.Secp256k1Signature}}]};Ed25519Data={struct:{data:{array:{type:"u8",len:32}}}};Secp256k1Data={struct:{data:{array:{type:"u8",len:64}}}};PublicKey={enum:[{struct:{ed25519Key:this.Ed25519Data}},{struct:{secp256k1Key:this.Secp256k1Data}}]};FunctionCallPermission={struct:{allowance:{option:"u128"},receiverId:"string",methodNames:{array:{type:"string"}}}};FullAccessPermission={struct:{}};AccessKeyPermission={enum:[{struct:{functionCall:this.FunctionCallPermission}},{struct:{fullAccess:this.FullAccessPermission}}]};AccessKey={struct:{nonce:"u64",permission:this.AccessKeyPermission}};CreateAccount={struct:{}};DeployContract={struct:{code:{array:{type:"u8"}}}};FunctionCall={struct:{methodName:"string",args:{array:{type:"u8"}},gas:"u64",deposit:"u128"}};Transfer={struct:{deposit:"u128"}};Stake={struct:{stake:"u128",publicKey:this.PublicKey}};AddKey={struct:{publicKey:this.PublicKey,accessKey:this.AccessKey}};DeleteKey={struct:{publicKey:this.PublicKey}};DeleteAccount={struct:{beneficiaryId:"string"}};DelegateActionPrefix={struct:{prefix:"u32"}};ClassicActions={enum:[{struct:{createAccount:this.CreateAccount}},{struct:{deployContract:this.DeployContract}},{struct:{functionCall:this.FunctionCall}},{struct:{transfer:this.Transfer}},{struct:{stake:this.Stake}},{struct:{addKey:this.AddKey}},{struct:{deleteKey:this.DeleteKey}},{struct:{deleteAccount:this.DeleteAccount}}]};DelegateAction={struct:{senderId:"string",receiverId:"string",actions:{array:{type:this.ClassicActions}},nonce:"u64",maxBlockHeight:"u64",publicKey:this.PublicKey}};SignedDelegate={struct:{delegateAction:this.DelegateAction,signature:this.Signature}};Action={enum:[{struct:{createAccount:this.CreateAccount}},{struct:{deployContract:this.DeployContract}},{struct:{functionCall:this.FunctionCall}},{struct:{transfer:this.Transfer}},{struct:{stake:this.Stake}},{struct:{addKey:this.AddKey}},{struct:{deleteKey:this.DeleteKey}},{struct:{deleteAccount:this.DeleteAccount}},{struct:{signedDelegate:this.SignedDelegate}}]};Transaction={struct:{signerId:"string",publicKey:this.PublicKey,nonce:"u64",receiverId:"string",blockHash:{array:{type:"u8",len:32}},actions:{array:{type:this.Action}}}};SignedTransaction={struct:{transaction:this.Transaction,signature:this.Signature}}}},88329:(e,t,r)=>{"use strict";
40Object.defineProperty(t,"__esModule",{value:!0}),t.signDelegateAction=t.signTransaction=void 0;let n=r(94986),i=r(23593),o=r(42691),s=r(5575),a=r(60554),c=r(75092);async function u(e,t,r,i){let o=(0,s.encodeTransaction)(e),u=new Uint8Array((0,n.sha256)(o)),l=await t.signMessage(o,r,i),d=e.publicKey.ed25519Key?c.KeyType.ED25519:c.KeyType.SECP256K1;return[u,new s.SignedTransaction({transaction:e,signature:new a.Signature({keyType:d,data:l.signature})})]}async function l(...e){if(e[0].constructor===s.Transaction){let[t,r,n,i]=e;return u(t,r,n,i)}{let[t,r,n,i,s,a,c]=e,l=await s.getPublicKey(a,c);return u((0,o.createTransaction)(a,l,t,r,n,i),s,a,c)}}async function d({delegateAction:e,signer:t}){let r=(0,s.encodeDelegateAction)(e),o=await t.sign(r),u=e.publicKey.ed25519Key?c.KeyType.ED25519:c.KeyType.SECP256K1,l=new i.SignedDelegate({delegateAction:e,signature:new a.Signature({keyType:u,data:o})});return{hash:new Uint8Array((0,n.sha256)(r)),signedDelegateAction:l}}t.signTransaction=l,t.signDelegateAction=d},60554:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Signature=void 0;let n=r(75092),i=r(36236);function o(e){switch(e){case n.KeyType.ED25519:return"ed25519Signature";case n.KeyType.SECP256K1:return"secp256k1Signature";default:throw Error(`unknown type ${e}`)}}class s extends i.Enum{enum;ed25519Signature;secp256k1Signature;constructor(e){let t=o(e.keyType);super({[t]:e}),this[t]=e,this.enum=t}get signature(){return this.ed25519Signature||this.secp256k1Signature}get signatureType(){return this.signature.keyType}get data(){return this.signature.data}}t.Signature=s},20065:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Assignable=void 0;class r{constructor(e){Object.keys(e).map(t=>{this[t]=e[t]})}}t.Assignable=r},80765:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.Enum=void 0;class r{constructor(e){if(1!==Object.keys(e).length)throw Error("Enum can only take single value");Object.keys(e).map(t=>{this[t]=e[t]})}}t.Enum=r},4767:(e,t)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.ErrorContext=t.TypedError=t.ArgumentTypeError=t.PositionalArgsError=void 0;class r extends Error{constructor(){super("Contract method calls expect named arguments wrapped in object, e.g. { argName1: argValue1, argName2: argValue2 }")}}t.PositionalArgsError=r;class n extends Error{constructor(e,t,r){super(`Expected ${t} for '${e}' argument, but got '${JSON.stringify(r)}'`)}}t.ArgumentTypeError=n;class i extends Error{type;context;constructor(e,t,r){super(e),this.type=t||"UntypedError",this.context=r}}t.TypedError=i;class o{transactionHash;constructor(e){this.transactionHash=e}}t.ErrorContext=o},36236:function(e,t,r){"use strict";var n=this&&this.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r);var i=Object.getOwnPropertyDescriptor(t,r);(!i||("get"in i?!t.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return t[r]}}),Object.defineProperty(e,n,i)}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),i=this&&this.__exportStar||function(e,t){for(var r in e)"default"===r||Object.prototype.hasOwnProperty.call(t,r)||n(t,e,r)};Object.defineProperty(t,"__esModule",{value:!0}),i(r(20065),t),i(r(80765),t),i(r(4767),t),i(r(20464),t)},20464:(e,t,r)=>{"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.FinalExecutionStatusBasic=t.ExecutionStatusBasic=t.IdType=void 0;var n=r(13812);Object.defineProperty(t,"IdType",{enumerable:!0,get:function(){return n.IdType}});var i=r(83723);Object.defineProperty(t,"ExecutionStatusBasic",{enumerable:!0,get:function(){return i.ExecutionStatusBasic}}),Object.defineProperty(t,"FinalExecutionStatusBasic",{enumerable:!0,get:function(){return i.FinalExecutionStatusBasic}})},13812:(e,t)=>{"use strict";var r;Object.defineProperty(t,"__esModule",{value:!0}),t.IdType=void 0,function(e){e.Transaction="transaction",e.Receipt="receipt"}(r||(t.IdType=r={}))},83723:(e,t)=>{"use strict";var r,n;Object.defineProperty(t,"__esModule",{value:!0}),t.FinalExecutionStatusBasic=t.ExecutionStatusBasic=void 0,function(e){e.Unknown="Unknown",e.Pending="Pending",e.Failure="Failure"}(r||(t.ExecutionStatusBasic=r={})),function(e){e.NotStarted="NotStarted",e.Started="Started",e.Failure="Failure"}(n||(t.FinalExecutionStatusBasic=n={}))},99648:(e,t,r)=>{"use strict";let{normalizeIPv6:n,removeDotSegments:i,recomposeAuthority:o,normalizeComponentEncoding:s,isIPv4:a,nonSimpleDomain:c}=r(11013),{SCHEMES:u,getSchemeHandler:l}=r(31064);function d(e,t,r,n){let o={};return n||(e=p(f(e,r),r),t=p(f(t,r),r)),!(r=r||{}).tolerant&&t.scheme?(o.scheme=t.scheme,o.userinfo=t.userinfo,o.host=t.host,o.port=t.port,o.path=i(t.path||""),o.query=t.query):(void 0!==t.userinfo||void 0!==t.host||void 0!==t.port?(o.userinfo=t.userinfo,o.host=t.host,o.port=t.port,o.path=i(t.path||""),o.query=t.query):(t.path?("/"===t.path[0]?o.path=i(t.path):(void 0===e.userinfo&&void 0===e.host&&void 0===e.port||e.path?e.path?o.path=e.path.slice(0,e.path.lastIndexOf("/")+1)+t.path:o.path=t.path:o.path="/"+t.path,o.path=i(o.path)),o.query=t.query):(o.path=e.path,void 0!==t.query?o.query=t.query:o.query=e.query),o.userinfo=e.userinfo,o.host=e.host,o.port=e.port),o.scheme=e.scheme),o.fragment=t.fragment,o}function f(e,t){let r={host:e.host,scheme:e.scheme,userinfo:e.userinfo,port:e.port,path:e.path,query:e.query,nid:e.nid,nss:e.nss,uuid:e.uuid,fragment:e.fragment,reference:e.reference,resourceName:e.resourceName,secure:e.secure,error:""},n=Object.assign({},t),s=[],a=l(n.scheme||r.scheme);
40a&&a.serialize&&a.serialize(r,n),void 0!==r.path&&(n.skipEscape?r.path=unescape(r.path):(r.path=escape(r.path),void 0!==r.scheme&&(r.path=r.path.split("%3A").join(":")))),"suffix"!==n.reference&&r.scheme&&s.push(r.scheme,":");let c=o(r);if(void 0!==c&&("suffix"!==n.reference&&s.push("//"),s.push(c),r.path&&"/"!==r.path[0]&&s.push("/")),void 0!==r.path){let e=r.path;n.absolutePath||a&&a.absolutePath||(e=i(e)),void 0===c&&"/"===e[0]&&"/"===e[1]&&(e="/%2F"+e.slice(2)),s.push(e)}return void 0!==r.query&&s.push("?",r.query),void 0!==r.fragment&&s.push("#",r.fragment),s.join("")}let h=/^(?:([^#/:?]+):)?(?:\/\/((?:([^#/?@]*)@)?(\[[^#/?\]]+\]|[^#/:?]*)(?::(\d*))?))?([^#?]*)(?:\?([^#]*))?(?:#((?:.|[\n\r])*))?/u;function p(e,t){let r=Object.assign({},t),i={scheme:void 0,userinfo:void 0,host:"",port:void 0,path:"",query:void 0,fragment:void 0},o=!1;"suffix"===r.reference&&(e=r.scheme?r.scheme+":"+e:"//"+e);let s=e.match(h);if(s){if(i.scheme=s[1],i.userinfo=s[3],i.host=s[4],i.port=parseInt(s[5],10),i.path=s[6]||"",i.query=s[7],i.fragment=s[8],isNaN(i.port)&&(i.port=s[5]),i.host){if(!1===a(i.host)){let e=n(i.host);i.host=e.host.toLowerCase(),o=e.isIPV6}else o=!0}void 0!==i.scheme||void 0!==i.userinfo||void 0!==i.host||void 0!==i.port||void 0!==i.query||i.path?void 0===i.scheme?i.reference="relative":void 0===i.fragment?i.reference="absolute":i.reference="uri":i.reference="same-document",r.reference&&"suffix"!==r.reference&&r.reference!==i.reference&&(i.error=i.error||"URI is not a "+r.reference+" reference.");let t=l(r.scheme||i.scheme);if(!r.unicodeSupport&&(!t||!t.unicodeSupport)&&i.host&&(r.domainHost||t&&t.domainHost)&&!1===o&&c(i.host))try{i.host=URL.domainToASCII(i.host.toLowerCase())}catch(e){i.error=i.error||"Host's domain name can not be converted to ASCII: "+e}(!t||t&&!t.skipNormalize)&&(-1!==e.indexOf("%")&&(void 0!==i.scheme&&(i.scheme=unescape(i.scheme)),void 0!==i.host&&(i.host=unescape(i.host))),i.path&&(i.path=escape(unescape(i.path))),i.fragment&&(i.fragment=encodeURI(decodeURIComponent(i.fragment)))),t&&t.parse&&t.parse(i,r)}else i.error=i.error||"URI can not be parsed.";return i}let y={SCHEMES:u,normalize:function(e,t){return"string"==typeof e?e=f(p(e,t),t):"object"==typeof e&&(e=p(f(e,t),t)),e},resolve:function(e,t,r){let n=r?Object.assign({scheme:"null"},r):{scheme:"null"},i=d(p(e,n),p(t,n),n,!0);return n.skipEscape=!0,f(i,n)},resolveComponent:d,equal:function(e,t,r){return"string"==typeof e?e=f(s(p(e=unescape(e),r),!0),{...r,skipEscape:!0}):"object"==typeof e&&(e=f(s(e,!0),{...r,skipEscape:!0})),"string"==typeof t?t=f(s(p(t=unescape(t),r),!0),{...r,skipEscape:!0}):"object"==typeof t&&(t=f(s(t,!0),{...r,skipEscape:!0})),e.toLowerCase()===t.toLowerCase()},serialize:f,parse:p};e.exports=y,e.exports.default=y,e.exports.fastUri=y},31064:(e,t,r)=>{"use strict";let{isUUID:n}=r(11013),i=/([\da-z][\d\-a-z]{0,31}):((?:[\w!$'()*+,\-.:;=@]|%[\da-f]{2})+)/iu,o=["http","https","ws","wss","urn","urn:uuid"];function s(e){return -1!==o.indexOf(e)}function a(e){return!0===e.secure||!1!==e.secure&&!!e.scheme&&3===e.scheme.length&&("w"===e.scheme[0]||"W"===e.scheme[0])&&("s"===e.scheme[1]||"S"===e.scheme[1])&&("s"===e.scheme[2]||"S"===e.scheme[2])}function c(e){return e.host||(e.error=e.error||"HTTP URIs must have a host."),e}function u(e){let t="https"===String(e.scheme).toLowerCase();return(e.port===(t?443:80)||""===e.port)&&(e.port=void 0),e.path||(e.path="/"),e}function l(e){return e.secure=a(e),e.resourceName=(e.path||"/")+(e.query?"?"+e.query:""),e.path=void 0,e.query=void 0,e}function d(e){if((e.port===(a(e)?443:80)||""===e.port)&&(e.port=void 0),"boolean"==typeof e.secure&&(e.scheme=e.secure?"wss":"ws",e.secure=void 0),e.resourceName){let[t,r]=e.resourceName.split("?");e.path=t&&"/"!==t?t:void 0,e.query=r,e.resourceName=void 0}return e.fragment=void 0,e}function f(e,t){if(!e.path)return e.error="URN can not be parsed",e;let r=e.path.match(i);if(r){let n=t.scheme||e.scheme||"urn";e.nid=r[1].toLowerCase(),e.nss=r[2];let i=_(`${n}:${t.nid||e.nid}`);e.path=void 0,i&&(e=i.parse(e,t))}else e.error=e.error||"URN can not be parsed.";return e}function h(e,t){if(void 0===e.nid)throw Error("URN without nid cannot be serialized");let r=t.scheme||e.scheme||"urn",n=e.nid.toLowerCase(),i=_(`${r}:${t.nid||n}`);
40i&&(e=i.serialize(e,t));let o=e,s=e.nss;return o.path=`${n||t.nid}:${s}`,t.skipEscape=!0,o}function p(e,t){let r=e;return r.uuid=r.nss,r.nss=void 0,t.tolerant||r.uuid&&n(r.uuid)||(r.error=r.error||"UUID is not valid."),r}function y(e){let t=e;return t.nss=(e.uuid||"").toLowerCase(),t}let g={scheme:"http",domainHost:!0,parse:c,serialize:u},m={scheme:"https",domainHost:g.domainHost,parse:c,serialize:u},b={scheme:"ws",domainHost:!0,parse:l,serialize:d},v={scheme:"wss",domainHost:b.domainHost,parse:b.parse,serialize:b.serialize},w={http:g,https:m,ws:b,wss:v,urn:{scheme:"urn",parse:f,serialize:h,skipNormalize:!0},"urn:uuid":{scheme:"urn:uuid",parse:p,serialize:y,skipNormalize:!0}};function _(e){return e&&(w[e]||w[e.toLowerCase()])||void 0}Object.setPrototypeOf(w,null),e.exports={wsIsSecure:a,SCHEMES:w,isValidSchemeName:s,getSchemeHandler:_}},11013:e=>{"use strict";let t=RegExp.prototype.test.bind(/^[\da-f]{8}-[\da-f]{4}-[\da-f]{4}-[\da-f]{4}-[\da-f]{12}$/iu),r=RegExp.prototype.test.bind(/^(?:(?:25[0-5]|2[0-4]\d|1\d{2}|[1-9]\d|\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d{2}|[1-9]\d|\d)$/u);function n(e){let t="",r=0,n=0;for(n=0;n<e.length;n++)if(48!==(r=e[n].charCodeAt(0))){if(!(r>=48&&r<=57||r>=65&&r<=70||r>=97&&r<=102))return"";t+=e[n];break}for(n+=1;n<e.length;n++){if(!((r=e[n].charCodeAt(0))>=48&&r<=57||r>=65&&r<=70||r>=97&&r<=102))return"";t+=e[n]}return t}let i=RegExp.prototype.test.bind(/[^!"$&'()*+,\-.;=_`a-z{}~]/u);function o(e){return e.length=0,!0}function s(e,t,r){if(e.length){let i=n(e);if(""===i)return r.error=!0,!1;t.push(i),e.length=0}return!0}function a(e){let t=0,r={error:!1,address:"",zone:""},i=[],a=[],c=!1,u=!1,l=s;for(let n=0;n<e.length;n++){let s=e[n];if("["!==s&&"]"!==s){if(":"===s){if(!0===c&&(u=!0),!l(a,i,r))break;if(++t>7){r.error=!0;break}n>0&&":"===e[n-1]&&(c=!0),i.push(":");continue}if("%"===s){if(!l(a,i,r))break;l=o}else{a.push(s);continue}}}return a.length&&(l===o?r.zone=a.join(""):u?i.push(a.join("")):i.push(n(a))),r.address=i.join(""),r}function c(e){if(2>u(e,":"))return{host:e,isIPV6:!1};let t=a(e);if(t.error)return{host:e,isIPV6:!1};{let e=t.address,r=t.address;return t.zone&&(e+="%"+t.zone,r+="%25"+t.zone),{host:e,isIPV6:!0,escapedHost:r}}}function u(e,t){let r=0;for(let n=0;n<e.length;n++)e[n]===t&&r++;return r}function l(e){let t=e,r=[],n=-1,i=0;for(;i=t.length;){if(1===i){if("."===t)break;if("/"===t){r.push("/");break}r.push(t);break}if(2===i){if("."===t[0]){if("."===t[1])break;if("/"===t[1]){t=t.slice(2);continue}}else if("/"===t[0]&&("."===t[1]||"/"===t[1])){r.push("/");break}}else if(3===i&&"/.."===t){0!==r.length&&r.pop(),r.push("/");break}if("."===t[0]){if("."===t[1]){if("/"===t[2]){t=t.slice(3);continue}}else if("/"===t[1]){t=t.slice(2);continue}}else if("/"===t[0]&&"."===t[1]){if("/"===t[2]){t=t.slice(2);continue}if("."===t[2]&&"/"===t[3]){t=t.slice(3),0!==r.length&&r.pop();continue}}if(-1===(n=t.indexOf("/",1))){r.push(t);break}r.push(t.slice(0,n)),t=t.slice(n)}return r.join("")}function d(e,t){let r=!0!==t?escape:unescape;return void 0!==e.scheme&&(e.scheme=r(e.scheme)),void 0!==e.userinfo&&(e.userinfo=r(e.userinfo)),void 0!==e.host&&(e.host=r(e.host)),void 0!==e.path&&(e.path=r(e.path)),void 0!==e.query&&(e.query=r(e.query)),void 0!==e.fragment&&(e.fragment=r(e.fragment)),e}function f(e){let t=[];if(void 0!==e.userinfo&&(t.push(e.userinfo),t.push("@")),void 0!==e.host){let n=unescape(e.host);if(!r(n)){let t=c(n);n=!0===t.isIPV6?`[${t.escapedHost}]`:e.host}t.push(n)}return("number"==typeof e.port||"string"==typeof e.port)&&(t.push(":"),t.push(String(e.port))),t.length?t.join(""):void 0}e.exports={nonSimpleDomain:i,recomposeAuthority:f,normalizeComponentEncoding:d,removeDotSegments:l,isIPv4:r,isUUID:t,normalizeIPv6:c,stringArrayToHexStripped:n}},28509:(e,t,r)=>{"use strict";let n=r(56617);e.exports=a;let i=x().console||{},o={mapHttpRequest:m,mapHttpResponse:m,wrapRequestSerializer:b,wrapResponseSerializer:b,wrapErrorSerializer:b,req:m,res:m,err:y};function s(e,t){return Array.isArray(e)?e.filter(function(e){return"!stdSerializers.err"!==e}):!0===e&&Object.keys(t)}function a(e){(e=e||{}).browser=e.browser||{};let t=e.browser.transmit;if(t&&"function"!=typeof t.send)throw Error("pino: transmit option must have a send function");let r=e.browser.write||i;e.browser.write&&(e.browser.asObject=!0);let n=e.serializers||{},o=s(e.browser.serialize,n),u=e.browser.serialize;Array.isArray(e.browser.serialize)&&e.browser.serialize.indexOf("!stdSerializers.err")>-1&&(u=!1);let l=["error","fatal","warn","info","debug","trace"];"function"==typeof r&&(r.error=r.fatal=r.warn=r.info=r.debug=r.trace=r),!1===e.enabled&&(e.level="silent");let h=e.level||"info",y=Object.create(r);y.log||(y.log=v),Object.defineProperty(y,"levelVal",{get:b}
40),Object.defineProperty(y,"level",{get:w,set:_});let m={transmit:t,serialize:o,asObject:e.browser.asObject,levels:l,timestamp:g(e)};function b(){return"silent"===this.level?1/0:this.levels.values[this.level]}function w(){return this._level}function _(e){if("silent"!==e&&!this.levels.values[e])throw Error("unknown level "+e);this._level=e,c(m,y,"error","log"),c(m,y,"fatal","error"),c(m,y,"warn","error"),c(m,y,"info","log"),c(m,y,"debug","log"),c(m,y,"trace","log")}function E(r,i){if(!r)throw Error("missing bindings for child Pino");i=i||{},o&&r.serializers&&(i.serializers=r.serializers);let s=i.serializers;if(o&&s){var a=Object.assign({},n,s),c=!0===e.browser.serialize?Object.keys(a):o;delete r.serializers,d([r],c,a,this._stdErrSerialize)}function u(e){this._childLevel=(0|e._childLevel)+1,this.error=f(e,r,"error"),this.fatal=f(e,r,"fatal"),this.warn=f(e,r,"warn"),this.info=f(e,r,"info"),this.debug=f(e,r,"debug"),this.trace=f(e,r,"trace"),a&&(this.serializers=a,this._serialize=c),t&&(this._logEvent=p([].concat(e._logEvent.bindings,r)))}return u.prototype=this,new u(this)}return y.levels=a.levels,y.level=h,y.setMaxListeners=y.getMaxListeners=y.emit=y.addListener=y.on=y.prependListener=y.once=y.prependOnceListener=y.removeListener=y.removeAllListeners=y.listeners=y.listenerCount=y.eventNames=y.write=y.flush=v,y.serializers=n,y._serialize=o,y._stdErrSerialize=u,y.child=E,t&&(y._logEvent=p()),y}function c(e,t,r,n){let o=Object.getPrototypeOf(t);t[r]=t.levelVal>t.levels.values[r]?v:o[r]?o[r]:i[r]||i[n]||v,u(e,t,r)}function u(e,t,r){(e.transmit||t[r]!==v)&&(t[r]=function(n){return function(){let o=e.timestamp(),s=Array(arguments.length),c=Object.getPrototypeOf&&Object.getPrototypeOf(this)===i?i:this;for(var u=0;u<s.length;u++)s[u]=arguments[u];if(e.serialize&&!e.asObject&&d(s,this._serialize,this.serializers,this._stdErrSerialize),e.asObject?n.call(c,l(this,r,s,o)):n.apply(c,s),e.transmit){let n=e.transmit.level||t.level,i=a.levels.values[n],c=a.levels.values[r];if(c<i)return;h(this,{ts:o,methodLevel:r,methodValue:c,transmitLevel:n,transmitValue:a.levels.values[e.transmit.level||t.level],send:e.transmit.send,val:t.levelVal},s)}}}(t[r]))}function l(e,t,r,i){e._serialize&&d(r,e._serialize,e.serializers,e._stdErrSerialize);let o=r.slice(),s=o[0],c={};i&&(c.time=i),c.level=a.levels.values[t];let u=(0|e._childLevel)+1;if(u<1&&(u=1),null!==s&&"object"==typeof s){for(;u--&&"object"==typeof o[0];)Object.assign(c,o.shift());s=o.length?n(o.shift(),o):void 0}else"string"==typeof s&&(s=n(o.shift(),o));return void 0!==s&&(c.msg=s),c}function d(e,t,r,n){for(let i in e)if(n&&e[i]instanceof Error)e[i]=a.stdSerializers.err(e[i]);else if("object"==typeof e[i]&&!Array.isArray(e[i]))for(let n in e[i])t&&t.indexOf(n)>-1&&n in r&&(e[i][n]=r[n](e[i][n]))}function f(e,t,r){return function(){let n=Array(1+arguments.length);n[0]=t;for(var i=1;i<n.length;i++)n[i]=arguments[i-1];return e[r].apply(this,n)}}function h(e,t,r){let n=t.send,i=t.ts,o=t.methodLevel,s=t.methodValue,a=t.val,c=e._logEvent.bindings;d(r,e._serialize||Object.keys(e.serializers),e.serializers,void 0===e._stdErrSerialize||e._stdErrSerialize),e._logEvent.ts=i,e._logEvent.messages=r.filter(function(e){return -1===c.indexOf(e)}),e._logEvent.level.label=o,e._logEvent.level.value=s,n(o,e._logEvent,a),e._logEvent=p(c)}function p(e){return{ts:0,messages:[],bindings:e||[],level:{label:"",value:0}}}function y(e){let t={type:e.constructor.name,msg:e.message,stack:e.stack};for(let r in e)void 0===t[r]&&(t[r]=e[r]);return t}function g(e){return"function"==typeof e.timestamp?e.timestamp:!1===e.timestamp?w:_}function m(){return{}}function b(e){return e}function v(){}function w(){return!1}function _(){return Date.now()}function E(){return Math.round(Date.now()/1e3)}function S(){return new Date(Date.now()).toISOString()}function x(){function e(e){return void 0!==e&&e}try{if("undefined"!=typeof globalThis)return globalThis;return Object.defineProperty(Object.prototype,"globalThis",{get:function(){return delete Object.prototype.globalThis,this.globalThis=this},configurable:!0}),globalThis}catch(t){return e(self)||e(window)||e(this)||{}}}a.levels={values:{fatal:60,error:50,warn:40,info:30,debug:20,trace:10},labels:{10:"trace",20:"debug",30:"info",40:"warn",50:"error",60:"fatal"}},a.stdSerializers=o,a.stdTimeFunctions=Object.assign({},{nullTime:w,epochTime:_,unixTime:E,isoTime:S})},87404:(e,t,r)=>{"use strict";r.d(t,{g:()=>ed});var n=r(7490);async function i(e,t,r,n){let i=e;for(let e=0;e<t;e++){let e=await n();if(e)return e;await o(i),i*=r}return null}function o(e){return new Promise(t=>setTimeout(t,e))}var s=r(73403),a=r(40972),c=r(90546);let{addKey:u,createAccount:l,deleteAccount:d,deleteKey:f,deployContract:h,functionCall:p,stake:y,transfer:g,deployGlobalContract:m,useGlobalContract:b}=s.m;class v{senderId;receiverId;actions;nonce;maxBlockHeight;publicKey;constructor({senderId:e,receiverId:t,actions:r,nonce:n,maxBlockHeight:i,publicKey:o}){this.senderId=e,this.receiverId=t,this.actions=r,this.nonce=n,this.maxBlockHeight=i,this.publicKey=o}}
40function w({actions:e,maxBlockHeight:t,nonce:r,publicKey:n,receiverId:i,senderId:o}){return new v({senderId:o,receiverId:i,actions:e.map(e=>{if(!e.type&&!e.params)return e;switch(e.type){case"AddKey":{let{publicKey:t,accessKey:r}=e.params;return u(t,r)}case"CreateAccount":return l(e.params.createAccount);case"DeleteAccount":return d(e.params.deleteAccount);case"DeleteKey":return f(e.params.publicKey);case"DeployContract":return h(e.params.code);case"FunctionCall":{let{methodName:t,args:r,gas:n,deposit:i}=e.params;return p(t,r,n,i)}case"Stake":return y(e.params.stake,e.params.publicKey);case"Transfer":{let{deposit:t}=e.params;return g(t)}case"DeployGlobalContract":{let{code:t,deployMode:r}=e.params;return m(t,r instanceof c.eo?r:new c.eo(r))}case"UseGlobalContract":{let{identifier:t}=e.params;return b(t instanceof c.vC?t:new c.vC(t))}}throw Error("Unrecognized action")}),nonce:r,maxBlockHeight:t,publicKey:n})}var _=r(16658),E=r(15363),S=r(27868);class x{}class A extends x{keys;constructor(){super(),this.keys={}}async setKey(e,t,r){this.keys[`${t}:${e}`]=r.toString()}async getKey(e,t){let r=this.keys[`${t}:${e}`];return r?S.a.fromString(r):null}async removeKey(e,t){delete this.keys[`${t}:${e}`]}async clear(){this.keys={}}async getNetworks(){let e=new Set;return Object.keys(this.keys).forEach(t=>{let r=t.split(":");e.add(r[1])}),Array.from(e.values())}async getAccounts(e){let t=[];return Object.keys(this.keys).forEach(r=>{let n=r.split(":");n[n.length-1]===e&&t.push(n.slice(0,n.length-1).join(":"))}),t}toString(){return"InMemoryKeyStore"}}var I=r(91132),O=r(81587);class T{keyStore;constructor(e){this.keyStore=e}static async fromKeyPair(e,t,r){let n=new A;return await n.setKey(e,t,r),new T(n)}async createKey(e,t,r){let n=r===I._.SECP256K1?S.a.fromRandom("secp256k1"):S.a.fromRandom("ed25519");return await this.keyStore.setKey(t,e,n),n.getPublicKey()}async getPublicKey(e,t){let r=await this.keyStore.getKey(t,e);return null===r?null:r.getPublicKey()}async signMessage(e,t,r){let n=new Uint8Array((0,O.sc)(e));if(!t)throw Error("InMemorySigner requires provided account id");let i=await this.keyStore.getKey(r,t);if(null===i)throw Error(`Key for ${t} not found in ${r}`);return i.sign(n)}toString(){return`InMemorySigner(${this.keyStore})`}}var P=r(54338),M=r(75658),N=r(29905);function k(e){switch(e.type){case void 0:return e;case"JsonRpcProvider":return new P.F({...e.args});case"FailoverRpcProvider":{let t=(e?.args||[]).map(e=>new P.F(e));return new M.X(t)}default:throw Error(`Unknown provider type ${e.type}`)}}function C(e){switch(e.type){case void 0:return e;case"InMemorySigner":return new T(e.keyStore);default:throw Error(`Unknown signer type ${e.type}`)}}class D{networkId;provider;signer;constructor(e,t,r){N("new Connection(networkId, provider, signer)")("`Connection` is no longer used anywhere, please switch to constructing `Account` without it - use `new Account(accountId, provider, signer)`"),this.networkId=e,this.provider=t,this.signer=r}getConnection(){return this}static fromConfig(e){let t=k(e.provider),r=C(e.signer);return new D(e.networkId,t,r)}}var j=r(75927).Buffer;function R(e){return JSON.parse(j.from(e).toString())}function L(e){return j.from(JSON.stringify(e))}function B(e){if((void 0===e.byteLength||e.byteLength!==e.length)&&(Array.isArray(e)||"object"!=typeof e))throw new _.ee}async function U(e,t,r,n={finality:"optimistic"}){N("viewState()")("It will be removed in the next major release");let{values:i}=await e.provider.query({request_type:"view_state",...n,account_id:t,prefix_base64:j.from(r).toString("base64")});return i.map(({key:e,value:t})=>({key:j.from(e,"base64"),value:j.from(t,"base64")}))}async function $(e,{contractId:t,methodName:r,args:n={},parse:i=R,stringify:o=L,blockQuery:s={finality:"optimistic"}}){N("viewFunction()")("It will be removed in the next major release"),B(n);let a=o(n),c=await e.provider.query({request_type:"call_function",...s,account_id:t,method_name:r,args_base64:a.toString("base64")});return c.logs&&(0,E.Nl)({contractId:t,logs:c.logs}),c.result&&c.result.length>0&&i(j.from(c.result))}let K=24;function F(e,t,r=t){let n=(e=G(e)).substring(0,e.length-t)||"0",i=e.substring(e.length-t).substring(0,t).padStart(t,"0");return i=i.substring(0,r),V(`${n}.${i}`)}function z(e,t){let r=(e=q(e)).split(".");if(r.length>2)throw Error(`Cannot parse amount '${e}' as it contains more than a single dot`);let n=r[0],i=r[1]||"";if(i.length>K)throw Error(`Cannot parse amount '${e}' as it exceeds maximum decimal precision of ${K}`);return H(n+i.substring(0,t).padEnd(t,"0"))}function q(e){return e.replace(/,/g,".").trim()}function V(e){return e.replace(/\.?0*$/,"")}function H(e){return""===(e=e.replace(/^0+/,""))?"0":e}function G(e){return BigInt(e).toString()}class W{metadata;constructor(e){this.metadata=e}toUnits(e){return BigInt(z(e.toString(),this.metadata.decimals))}toDecimal(e,t){return F(e,this.metadata.decimals,t)}}class J extends W{constructor(e){super(e)}async transfer({from:e,receiverId:t,amount:r}){return e.signAndSendTransaction({receiverId:t,actions:[{transfer:{deposit:r.toString()}}]})}async getBalance(e){let{balance:{available:t}}=await e.getState();return t}}
40let Z=new J({name:"NEAR",decimals:24,symbol:"NEAR",icon:"data:image/svg+xml,%3Csvg%20width%3D%2232%22%20height%3D%2232%22%20viewBox%3D%220%200%2032%2032%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Ccircle%20cx%3D%2216%22%20cy%3D%2216%22%20r%3D%2216%22%20fill%3D%22white%22%3E%3C%2Fcircle%3E%3Cg%20clip-path%3D%22url(%23clip0000000003)%22%3E%3Cpath%20d%3D%22M20.8422%208.84471L17.4978%2013.776C17.4501%2013.847%2017.43%2013.9328%2017.4411%2014.0174C17.4522%2014.102%2017.4938%2014.1798%2017.5582%2014.2363C17.6225%2014.2928%2017.7053%2014.3243%2017.7913%2014.3249C17.8772%2014.3254%2017.9604%2014.2951%2018.0256%2014.2395L21.3178%2011.4036C21.3371%2011.3865%2021.361%2011.3753%2021.3866%2011.3714C21.4122%2011.3675%2021.4383%2011.3711%2021.4619%2011.3818C21.4855%2011.3924%2021.5054%2011.4096%2021.5193%2011.4314C21.5331%2011.4531%2021.5403%2011.4783%2021.54%2011.504V20.3824C21.54%2020.4095%2021.5316%2020.4361%2021.5158%2020.4583C21.5001%2020.4806%2021.4779%2020.4975%2021.4522%2020.5068C21.4265%2020.516%2021.3985%2020.5172%2021.3721%2020.5102C21.3456%2020.5031%2021.322%2020.4882%2021.3044%2020.4673L11.3533%208.63726C11.1933%208.44956%2010.994%208.29873%2010.7693%208.19525C10.5446%208.09178%2010.2999%208.03815%2010.0522%208.03809H9.70444C9.2524%208.03809%208.81887%208.21642%208.49922%208.53386C8.17957%208.8513%208%209.28185%208%209.73078V22.2351C8%2022.684%208.17957%2023.1145%208.49922%2023.432C8.81887%2023.7494%209.2524%2023.9277%209.70444%2023.9277V23.9277C9.99591%2023.9278%2010.2825%2023.8537%2010.537%2023.7125C10.7914%2023.5713%2011.0051%2023.3677%2011.1578%2023.1211L14.5022%2018.1898C14.5499%2018.1188%2014.57%2018.033%2014.5589%2017.9484C14.5478%2017.8638%2014.5062%2017.7861%2014.4418%2017.7295C14.3775%2017.673%2014.2947%2017.6415%2014.2087%2017.641C14.1228%2017.6404%2014.0396%2017.6707%2013.9744%2017.7264L10.6822%2020.5622C10.6629%2020.5794%2010.639%2020.5906%2010.6134%2020.5944C10.5878%2020.5983%2010.5617%2020.5947%2010.5381%2020.5841C10.5145%2020.5734%2010.4946%2020.5562%2010.4807%2020.5345C10.4669%2020.5128%2010.4597%2020.4875%2010.46%2020.4618V11.5813C10.46%2011.5541%2010.4684%2011.5276%2010.4842%2011.5053C10.4999%2011.483%2010.5221%2011.4661%2010.5478%2011.4568C10.5735%2011.4476%2010.6015%2011.4464%2010.6279%2011.4534C10.6544%2011.4605%2010.678%2011.4755%2010.6956%2011.4963L20.6456%2023.3286C20.8056%2023.5163%2021.0049%2023.6671%2021.2296%2023.7706C21.4543%2023.874%2021.699%2023.9277%2021.9467%2023.9277H22.2944C22.5184%2023.9279%2022.7401%2023.8842%2022.947%2023.7992C23.154%2023.7142%2023.342%2023.5895%2023.5004%2023.4324C23.6588%2023.2752%2023.7844%2023.0885%2023.8702%2022.8831C23.9559%2022.6776%2024%2022.4574%2024%2022.2351V9.73078C24%209.28185%2023.8204%208.8513%2023.5008%208.53386C23.1811%208.21642%2022.7476%208.03809%2022.2956%208.03809C22.0041%208.03801%2021.7175%208.11211%2021.4631%208.25332C21.2086%208.39453%2020.9949%208.59814%2020.8422%208.84471V8.84471Z%22%20fill%3D%22black%22%3E%3C%2Fpath%3E%3C%2Fg%3E%3Cdefs%3E%3CclipPath%20id%3D%22clip00033%22%3E%3Crect%20width%3D%2216%22%20height%3D%2216%22%20fill%3D%22black%22%20transform%3D%22translate(8%207.9834)%22%3E%3C%2Frect%3E%3C%2FclipPath%3E%3C%2Fdefs%3E%3C%2Fsvg%3E"});var Y=r(75927).Buffer;let{addKey:X,createAccount:Q,deleteAccount:ee,deleteKey:et,deployContract:er,deployGlobalContract:en,fullAccessKey:ei,functionCall:eo,functionCallAccessKey:es,transfer:ea,useGlobalContract:ec}=s.m,eu="optimistic",el="EXECUTED_OPTIMISTIC";class ed{accountId;provider;signer;constructor(e,t,r){this.accountId=e,this.provider=t,this.signer=r}setSigner(e){this.signer=e}getSigner(){return this.signer}async getState(){let e=await this.provider.experimental_protocolConfig({finality:eu}),t=await this.provider.viewAccount(this.accountId,{finality:eu}),r=BigInt(e.runtime_config.storage_amount_per_byte),n=BigInt(t.storage_usage)*r,i=BigInt(t.locked),o=BigInt(t.amount)+i,s=o-(i>n?i:n);return{balance:{total:o,usedOnStorage:n,locked:i,available:s},storageUsage:t.storage_usage,codeHash:t.code_hash}}async getAccessKey(e){return this.provider.viewAccessKey(this.accountId,e,{finality:eu})}async getAccessKeyList(){return this.provider.viewAccessKeyList(this.accountId,{finality:eu})}async getContractCode(){return this.provider.viewContractCode(this.accountId,{finality:eu})}async getContractState(e){return this.provider.viewContractState(this.accountId,e,{finality:eu})}async createTransaction(e,t,r){if(!r)throw Error("Please provide a public key");let i=n.J.from(r),o=await this.getAccessKey(i),s=(await this.provider.viewBlock({finality:eu})).header.hash,c=BigInt(o.nonce)+1n;return(0,a.z)(this.accountId,i,e,c+1n,t,(0,E.KN)(s))}async createSignedTransaction(e,t){if(!this.signer)throw Error("Please set a signer");let r=await this.createTransaction(e,t,await this.signer.getPublicKey()),[,n]=await this.signer.signTransaction(r);return n}
40async createMetaTransaction(e,t,r=200,i){if(!i)throw Error("Please provide a public key");let o=n.J.from(i),s=BigInt((await this.getAccessKey(o)).nonce)+1n,{header:a}=await this.provider.viewBlock({finality:eu}),c=BigInt(a.height)+BigInt(r);return w({receiverId:e,senderId:this.accountId,actions:t,publicKey:o,nonce:s,maxBlockHeight:c})}async createSignedMetaTransaction(e,t,r=200){if(!this.signer)throw Error("Please set a signer");let n=await this.createMetaTransaction(e,t,r,await this.signer.getPublicKey());return this.signer.signDelegateAction(n)}async signAndSendTransaction({receiverId:e,actions:t,waitUntil:r=el,throwOnFailure:n=!0}){let i=await this.createSignedTransaction(e,t),o=await this.provider.sendTransactionUntil(i,r);if(n&&"object"==typeof o.status&&"object"==typeof o.status.Failure&&null!==o.status.Failure)throw(0,E.Dj)(o);return o}async signAndSendTransactions({transactions:e,waitUntil:t=el,throwOnFailure:r=!0}){if(!this.signer)throw Error("Please set a signer");return await Promise.all(e.map(async({receiverId:e,actions:n})=>this.signAndSendTransaction({receiverId:e,actions:n,waitUntil:t,throwOnFailure:r})))}async createAccount(e,t,r="0"){if(e.endsWith(this.accountId))return this.createSubAccount(e,t,r);let n=e.split(".");if(2!=n.length)throw Error("newAccountId needs to be of the form <string>.<tla>");let i=n[1];return this.signAndSendTransaction({receiverId:i,actions:[eo("create_account",{new_account_id:e,new_public_key:t.toString()},BigInt("60000000000000"),BigInt(r))]})}async createSubAccount(e,t,r="0"){if(!this.signer)throw Error("Please set a signer");let i=e.includes(".")?e:`${e}.${this.accountId}`;if(i.length>64)throw Error("Accounts cannot exceed 64 characters");if(!i.endsWith(this.accountId))throw Error(`New account must end up with ${this.accountId}`);let o=[Q(),ea(BigInt(r)),X(n.J.from(t),ei())];return this.signAndSendTransaction({receiverId:i,actions:o})}async deleteAccount(e){return this.signAndSendTransaction({receiverId:this.accountId,actions:[ee(e)]})}async deployContract(e){return this.signAndSendTransaction({receiverId:this.accountId,actions:[er(e)]})}async deployGlobalContract(e,t){let r=new c.eo("codeHash"===t?{CodeHash:null}:{AccountId:null});return this.signAndSendTransaction({receiverId:this.accountId,actions:[en(e,r)]})}async useGlobalContract(e){let t=new c.vC("accountId"in e?{AccountId:e.accountId}:{CodeHash:"string"==typeof e.codeHash?Y.from(e.codeHash,"hex"):e.codeHash});return this.signAndSendTransaction({receiverId:this.accountId,actions:[ec(t)]})}async addFunctionCallAccessKey({publicKey:e,contractId:t,methodNames:r=[],allowance:i=Z.toUnits("0.25")}){return this.signAndSendTransaction({receiverId:this.accountId,actions:[X(n.J.from(e),es(t,r,BigInt(i)))]})}async addFullAccessKey(e){return this.signAndSendTransaction({receiverId:this.accountId,actions:[X(n.J.from(e),ei())]})}async deleteKey(e){return this.signAndSendTransaction({receiverId:this.accountId,actions:[et(n.J.from(e))]})}async callFunction(e){let t=await this.callFunctionRaw(e);return(0,E.g9)(t)}async callFunctionRaw({contractId:e,methodName:t,args:r={},deposit:n="0",gas:i=E.I0,waitUntil:o=el}){return await this.signAndSendTransaction({receiverId:e,actions:[eo(t,r,BigInt(i),BigInt(n))],waitUntil:o})}async signNep413Message({message:e,recipient:t,nonce:r,callbackUrl:n}){if(!this.signer)throw Error("Please set a signer");return this.signer.signNep413Message(e,this.accountId,t,r,n)}async getBalance(e=Z){return e.getBalance(this)}async transfer({receiverId:e,amount:t,token:r=Z}){return r.transfer({from:this,receiverId:e,amount:t})}async signedDelegate({actions:e,blockHeightTtl:t,receiverId:r}){N("Account.signedDelegate()")("It will be removed in the next major release, please switch to Account.createSignedMetaTransaction()");let{header:n}=await this.provider.viewBlock({finality:eu});if(!this.signer)throw Error("Please set a signer");let i=await this.signer.getPublicKey(),o=await this.getAccessKey(i),s=w({actions:e,maxBlockHeight:BigInt(n.height)+BigInt(t),nonce:BigInt(o.nonce)+1n,publicKey:i,receiverId:r,senderId:this.accountId}),[,a]=await this.signer.signDelegateAction(s);return a}getConnection(){return new D("",this.provider,new T(new A))}validateArgs(e){if((void 0===e.byteLength||e.byteLength!==e.length)&&(Array.isArray(e)||"object"!=typeof e))throw new _.ee}async functionCall({contractId:e,methodName:t,args:r={},gas:n=E.I0,attachedDeposit:i,walletMeta:o,walletCallbackUrl:a,stringify:c}
40){N("Account.functionCall()")("It will be removed in the next major release, please switch to Account.callFunction()"),this.validateArgs(r);let u=[t,r,n,i,void 0===c?s.I:c,!1];return this.signAndSendTransactionLegacy({receiverId:e,actions:[eo.apply(void 0,u)],walletMeta:o,walletCallbackUrl:a})}async getTransactionStatus(e){return N("Account.getTransactionStatus()")("It will be removed in the next major release, please switch to Provider.viewTransactionStatus()"),this.provider.viewTransactionStatus(e,this.accountId,"EXECUTED_OPTIMISTIC")}async signTransaction(e,t,r){N("Account.signTransaction()")("It will be removed in the next major release, please switch to Account.createSignedTransaction()");let n=r?.signer||this.signer;if(!n)throw Error("Please set a signer");let i=await n.getPublicKey(),o=await this.getAccessKey(i),s=(await this.provider.viewBlock({finality:eu})).header.hash,c=BigInt(o.nonce)+1n,u=(0,a.z)(this.accountId,i,e,c+1n,t,(0,E.KN)(s));return n.signTransaction(u)}async createAndDeployContract(e,t,r,i){N("Account.createAndDeployContract()")("It will be removed in the next major release");let o=ei();return await this.signAndSendTransactionLegacy({receiverId:e,actions:[Q(),ea(i),X(n.J.from(t),o),er(r)]}),new ed(e,this.provider)}async sendMoney(e,t){return N("Account.sendMoney()")("It will be removed in the next major release, please switch to Account.transfer()"),this.signAndSendTransactionLegacy({receiverId:e,actions:[ea(t)]})}async signAndSendTransactionLegacy({receiverId:e,actions:t,returnError:r},n){let o,s;N("Account.signAndSendTransactionLegacy()")("It will be removed in the next major release, please switch to Account.signAndSendTransaction()");let a=12,c=500,u=1.5,l=await i(c,a,u,async()=>{[o,s]=await this.signTransaction(e,t,n);try{return await this.provider.sendTransaction(s)}catch(t){if("InvalidNonce"===t.type)return E.Vy.warn(`Retrying transaction ${e}:${(0,E.aP)(o)} with new nonce.`),null;if("Expired"===t.type)return E.Vy.warn(`Retrying transaction ${e}:${(0,E.aP)(o)} due to expired block hash`),null;throw t.context=new _.Ir((0,E.aP)(o)),t}});if(!l)throw new _.TI("nonce retries exceeded for transaction. This usually means there are too many parallel requests with the same access key.","RetriesExceeded");if((0,E.rg)({contractId:s.transaction.receiverId,outcome:l}),!r&&"object"==typeof l.status&&"object"==typeof l.status.Failure&&null!==l.status.Failure){if(l.status.Failure.error_message&&l.status.Failure.error_type)throw new _.TI(`Transaction ${l.transaction_outcome.id} failed. ${l.status.Failure.error_message}`,l.status.Failure.error_type);throw(0,E.Dj)(l)}return l}accessKeyByPublicKeyCache={};async findAccessKey(e,t){if(N("Account.findAccessKey()")("It will be removed in the next major release"),!this.signer)throw Error("Please set a signer");let r=await this.signer.getPublicKey();if(!r)throw new _.TI(`no matching key pair found in ${this.signer.constructor.name}`,"PublicKeyNotFound");let n=this.accessKeyByPublicKeyCache[r.toString()];if(void 0!==n)return{publicKey:r,accessKey:n};try{let e=await this.provider.query({request_type:"view_access_key",account_id:this.accountId,public_key:r.toString(),finality:eu}),t={...e,nonce:BigInt(e.nonce||0)};if(this.accessKeyByPublicKeyCache[r.toString()])return{publicKey:r,accessKey:this.accessKeyByPublicKeyCache[r.toString()]};return this.accessKeyByPublicKeyCache[r.toString()]=t,{publicKey:r,accessKey:t}}catch(e){if("AccessKeyDoesNotExist"==e.type)return null;throw e}}async addKey(e,t,r,i){let o;return N("Account.addKey()")("It will be removed in the next major release, please switch to either Account.addFullAccessKey(), or Account.addFunctionAccessKey()"),r||(r=[]),Array.isArray(r)||(r=[r]),o=t?es(t,r,i):ei(),this.signAndSendTransactionLegacy({receiverId:this.accountId,actions:[X(n.J.from(e),o)]})}async viewFunction(e){return N("Account.viewFunction()")("It will be removed in the next major release, please switch to either Provider.callFunction()"),await $(this.getConnection(),e)}async viewState(e,t={finality:eu}){return N("Account.viewState()")("It will be removed in the next major release, please switch to either Account.getContractState()"),await U(this.getConnection(),this.accountId,e,t)}async getAccessKeys(){N("Account.getAccessKeys()")("It will be removed in the next major release, please switch to either Account.getAccessKeyList()");let e=await this.provider.query({request_type:"view_access_key_list",account_id:this.accountId,finality:eu});return e?.keys?.map(e=>({...e,access_key:{...e.access_key,nonce:BigInt(e.access_key.nonce)}}))}async getAccountDetails(){return{authorizedApps:(await this.getAccessKeys()).filter(e=>"FullAccess"!==e.access_key.permission).map(e=>{let t=e.access_key.permission;return{contractId:t.FunctionCall.receiver_id,amount:t.FunctionCall.allowance,publicKey:e.public_key}})}}async state(){return N("Account.state()")("It will be removed in the next major release, please switch to either Account.getState()"),this.provider.query({request_type:"view_account",account_id:this.accountId,finality:"optimistic"})}async getAccountBalance(){N("Account.getAccountBalance()")("It will be removed in the next major release, please switch to either Account.getState()");let e=await this.provider.experimental_protocolConfig({finality:eu}),t=await this.state(),r=BigInt(e.runtime_config.storage_amount_per_byte),n=BigInt(t.storage_usage)*r,i=BigInt(t.locked),o=BigInt(t.amount)+i,s=o-(i>n?i:n);return{total:o.toString(),stateStaked:n.toString(),staked:i.toString(),available:s.toString()}}async getActiveDelegatedStakeBalance(){N("Account.getActiveDelegatedStakeBalance()")("It will be removed in the next major release");let e=await this.provider.block({finality:eu}
40),t=e.header.hash,r=e.header.epoch_id,{current_validators:n,next_validators:i,current_proposals:o}=await this.provider.validators(r),s=new Set;[...n,...i,...o].forEach(e=>s.add(e.account_id));let a=[...s],c=a.map(e=>this.viewFunction({contractId:e,methodName:"get_account_total_balance",args:{account_id:this.accountId},blockQuery:{blockId:t}})),u=await Promise.allSettled(c);if(u.some(e=>"rejected"===e.status&&"TimeoutError"===e.reason.type))throw Error("Failed to get delegated stake balance");let l=u.reduce((e,t,r)=>{let n=a[r];if("fulfilled"===t.status){let r=BigInt(t.value);if(0n!==r)return{...e,stakedValidators:[...e.stakedValidators,{validatorId:n,amount:r.toString()}],total:e.total+r}}return"rejected"===t.status?{...e,failedValidators:[...e.failedValidators,{validatorId:n,error:t.reason}]}:e},{stakedValidators:[],failedValidators:[],total:0n});return{...l,total:l.total.toString()}}}},91132:(e,t,r)=>{"use strict";r.d(t,{_:()=>n,b:()=>i});var n=(e=>(e[e.ED25519=0]="ED25519",e[e.SECP256K1=1]="SECP256K1",e))(n||{});let i={SECRET_KEY:32,ED25519_PUBLIC_KEY:32,SECP256k1_PUBLIC_KEY:64}},27868:(e,t,r)=>{"use strict";r.d(t,{a:()=>d});var n=r(21457),i=r(59217),o=r(15363),s=r(43331),a=r(22265),c=r(91132),u=r(7490);class l extends n.R{publicKey;secretKey;extendedSecretKey;constructor(e){super();let t=new Uint8Array((0,o.KN)(e).slice(0,c.b.SECRET_KEY)),r=a.publicKeyCreate(new Uint8Array(t),!1),n=r.subarray(1,r.length);this.publicKey=new u.J({keyType:c._.SECP256K1,data:n}),this.secretKey=(0,o.aP)(t),this.extendedSecretKey=e}static fromRandom(){let e=(0,s.po)(c.b.SECRET_KEY),t=a.publicKeyCreate(new Uint8Array(e),!1),r=new Uint8Array([...e,...t.subarray(1,t.length)]);return new l((0,o.aP)(r))}sign(e){let{signature:t,recid:r}=a.ecdsaSign(e,(0,o.KN)(this.secretKey));return{signature:new Uint8Array([...t,r]),publicKey:this.publicKey}}verify(e,t){return this.publicKey.verify(e,t)}toString(){return`secp256k1:${this.extendedSecretKey}`}getPublicKey(){return this.publicKey}}class d extends n.R{static fromRandom(e){switch(e.toUpperCase()){case"ED25519":return i.X.fromRandom();case"SECP256K1":return l.fromRandom();default:throw Error(`Unknown curve ${e}`)}}static fromString(e){let t=e.split(":");if(2===t.length)switch(t[0].toUpperCase()){case"ED25519":return new i.X(t[1]);case"SECP256K1":return new l(t[1]);default:throw Error(`Unknown curve: ${t[0]}`)}else throw Error("Invalid encoded key format, must be <curve>:<encoded key>")}}},21457:(e,t,r)=>{"use strict";r.d(t,{R:()=>n});class n{}},59217:(e,t,r)=>{"use strict";r.d(t,{X:()=>u});var n=r(15363),i=r(17078),o=r(43331),s=r(91132),a=r(21457),c=r(7490);class u extends a.R{publicKey;secretKey;extendedSecretKey;constructor(e){super();let t=new Uint8Array((0,n.KN)(e).slice(0,s.b.SECRET_KEY)),r=i.ev.getPublicKey(new Uint8Array(t));this.publicKey=new c.J({keyType:s._.ED25519,data:r}),this.secretKey=(0,n.aP)(t),this.extendedSecretKey=e}static fromRandom(){let e=(0,o.po)(s.b.SECRET_KEY),t=i.ev.getPublicKey(new Uint8Array(e)),r=new Uint8Array([...e,...t]);return new u((0,n.aP)(r))}sign(e){return{signature:i.ev.sign(e,(0,n.KN)(this.secretKey)),publicKey:this.publicKey}}verify(e,t){return this.publicKey.verify(e,t)}toString(){return`ed25519:${this.extendedSecretKey}`}getPublicKey(){return this.publicKey}}},7490:(e,t,r)=>{"use strict";r.d(t,{J:()=>d});var n=r(15363),i=r(17078),o=r(22265),s=r(91132);function a(e){switch(e){case s._.ED25519:return"ed25519";case s._.SECP256K1:return"secp256k1";default:throw Error(`Unknown key type ${e}`)}}function c(e){switch(e.toLowerCase()){case"ed25519":return s._.ED25519;case"secp256k1":return s._.SECP256K1;default:throw Error(`Unknown key type ${e}`)}}function u(e){switch(e){case s._.ED25519:return"ed25519Key";case s._.SECP256K1:return"secp256k1Key";default:throw Error(`unknown type ${e}`)}}class l{constructor(e){if(1!==Object.keys(e).length)throw Error("Enum can only take single value");Object.keys(e).map(t=>{this[t]=e[t]})}}class d extends l{enum;ed25519Key;secp256k1Key;constructor(e){let t=u(e.keyType);super({[t]:e}),this[t]=e,this.enum=t}static from(e){return"string"==typeof e?d.fromString(e):e}static fromString(e){let t,r;let i=e.split(":");if(1===i.length)t=i[0];else if(2===i.length)t=i[1],r=c(i[0]);else throw Error("Invalid encoded key format, must be <curve>:<encoded key>");let o=(0,n.KN)(t);
40r||(r=o.length===s.b.SECP256k1_PUBLIC_KEY?s._.SECP256K1:s._.ED25519);let a=r===s._.ED25519?s.b.ED25519_PUBLIC_KEY:s.b.SECP256k1_PUBLIC_KEY;if(o.length!==a)throw Error(`Invalid public key size (${o.length}), must be ${a}`);return new d({keyType:r,data:o})}toString(){let e=(0,n.aP)(this.data);return`${a(this.keyType)}:${e}`}verify(e,t){let r=this.keyType,n=this.data;switch(r){case s._.ED25519:return i.ev.verify(t,e,n);case s._.SECP256K1:return o.ecdsaVerify(t.subarray(0,64),e,new Uint8Array([4,...n]));default:throw Error(`Unknown key type: ${r}`)}}get keyPair(){return this.ed25519Key||this.secp256k1Key}get keyType(){return this.keyPair.keyType}get data(){return this.keyPair.data}}},16436:(e,t,r)=>{"use strict";r.d(t,{R:()=>k});class n{}r(2139);var i=r(63947);r(29905),r(75927).Buffer;var o=null,s=24;BigInt(24);var a=[],c=10n;for(let e=0,t=5n;e<s;e++,t*=c)a[e]=t;function u(e,t=s){let r=BigInt(e);if(t!==s){let e=s-t-1;e>0&&(r+=a[e])}let n=(e=r.toString()).substring(0,e.length-s)||"0",i=e.substring(e.length-s).padStart(s,"0").substring(0,t);return l(`${d(n)}.${i}`)}function l(e){return e.replace(/\.?0*$/,"")}function d(e){let t=/(-?\d+)(\d{3})/;for(;t.test(e);)e=e.replace(t,"$1,$2");return e}function f(e){if("string"==typeof e){let t=[];for(let r=0;r<e.length;r++)t.push(e.charCodeAt(r));e=new Uint8Array(t)}return i.tw.encode(e)}function h(e){return i.tw.decode(e)}var p={formatNear:()=>(e,t)=>u(t(e))};function y(e){return"[object Object]"===Object.prototype.toString.call(e)}function g(e){return"[object String]"===Object.prototype.toString.call(e)}new class{constructor(e){this.logLevels=e}isLevelEnabled=e=>this.logLevels.includes(e);print(e,t,...r){switch(e){case"error":case"fatal":return console.error(t,...r);case"warn":return console.warn(t,...r);case"log":return console.log(t,...r);case"debug":case"verbose":return console.debug(t,...r)}}verbose(e,...t){this.isLevelEnabled("verbose")&&this.print("verbose",e,...t)}debug(e,...t){this.isLevelEnabled("debug")&&this.print("debug",e,...t)}log(e,...t){this.isLevelEnabled("log")&&this.print("log",e,...t)}warn(e,...t){this.isLevelEnabled("warn")&&this.print("warn",e,...t)}error(e,...t){this.isLevelEnabled("error")&&this.print("error",e,...t)}fatal(e,...t){this.isLevelEnabled("fatal")&&this.print("fatal",e,...t)}}(["verbose","debug","log","warn","error","fatal"]);var m=r(17078),b=r(52815),v=(e=>(e[e.ED25519=0]="ED25519",e[e.SECP256K1=1]="SECP256K1",e))(v||{});let w={SECRET_KEY:32,ED25519_PUBLIC_KEY:32,SECP256k1_PUBLIC_KEY:64};var _=r(22265);function E(e){switch(e){case v.ED25519:return"ed25519";case v.SECP256K1:return"secp256k1";default:throw Error(`Unknown key type ${e}`)}}function S(e){switch(e.toLowerCase()){case"ed25519":return v.ED25519;case"secp256k1":return v.SECP256K1;default:throw Error(`Unknown key type ${e}`)}}function x(e){switch(e){case v.ED25519:return"ed25519Key";case v.SECP256K1:return"secp256k1Key";default:throw Error(`unknown type ${e}`)}}class A{constructor(e){if(1!==Object.keys(e).length)throw Error("Enum can only take single value");Object.keys(e).map(t=>{this[t]=e[t]})}}class I extends A{enum;ed25519Key;secp256k1Key;constructor(e){let t=x(e.keyType);super({[t]:e}),this[t]=e,this.enum=t}static from(e){return"string"==typeof e?I.fromString(e):e}static fromString(e){let t,r;let n=e.split(":");if(1===n.length)t=n[0];else if(2===n.length)t=n[1],r=S(n[0]);else throw Error("Invalid encoded key format, must be <curve>:<encoded key>");let i=h(t);r||(r=i.length===w.SECP256k1_PUBLIC_KEY?v.SECP256K1:v.ED25519);let o=r===v.ED25519?w.ED25519_PUBLIC_KEY:w.SECP256k1_PUBLIC_KEY;if(i.length!==o)throw Error(`Invalid public key size (${i.length}), must be ${o}`);return new I({keyType:r,data:i})}toString(){let e=f(this.data);return`${E(this.keyType)}:${e}`}verify(e,t){let r=this.keyType,n=this.data;switch(r){case v.ED25519:return m.ev.verify(t,e,n);case v.SECP256K1:return _.ecdsaVerify(t.subarray(0,64),e,new Uint8Array([4,...n]));default:throw Error(`Unknown key type: ${r}`)}}get keyPair(){return this.ed25519Key||this.secp256k1Key}get keyType(){return this.keyPair.keyType}get data(){return this.keyPair.data}}class O extends n{publicKey;secretKey;extendedSecretKey;constructor(e){super();let t=new Uint8Array(h(e).slice(0,w.SECRET_KEY)),r=m.ev.getPublicKey(new Uint8Array(t));this.publicKey=new I({keyType:v.ED25519,data:r}),this.secretKey=f(t),this.extendedSecretKey=e}static fromRandom(){let e=b(w.SECRET_KEY),t=m.ev.getPublicKey(new Uint8Array(e));return new O(f(new Uint8Array([...e,...t])))}sign(e){return{signature:m.ev.sign(e,h(this.secretKey)),publicKey:this.publicKey}}verify(e,t){return this.publicKey.verify(e,t)}toString(){return`ed25519:${this.extendedSecretKey}`}getPublicKey(){return this.publicKey}}class T extends n{publicKey;secretKey;extendedSecretKey;constructor(e){super();let t=new Uint8Array(h(e).slice(0,w.SECRET_KEY)),r=_.publicKeyCreate(new Uint8Array(t),!1),n=r.subarray(1,r.length);this.publicKey=new I({keyType:v.SECP256K1,data:n}),this.secretKey=f(t),this.extendedSecretKey=e}static fromRandom(){let e=b(w.SECRET_KEY),t=_.publicKeyCreate(new Uint8Array(e),!1);
40return new T(f(new Uint8Array([...e,...t.subarray(1,t.length)])))}sign(e){let{signature:t,recid:r}=_.ecdsaSign(e,h(this.secretKey));return{signature:new Uint8Array([...t,r]),publicKey:this.publicKey}}verify(e,t){return this.publicKey.verify(e,t)}toString(){return`secp256k1:${this.extendedSecretKey}`}getPublicKey(){return this.publicKey}}class P extends n{static fromRandom(e){switch(e.toUpperCase()){case"ED25519":return O.fromRandom();case"SECP256K1":return T.fromRandom();default:throw Error(`Unknown curve ${e}`)}}static fromString(e){let t=e.split(":");if(2===t.length)switch(t[0].toUpperCase()){case"ED25519":return new O(t[1]);case"SECP256K1":return new T(t[1]);default:throw Error(`Unknown curve: ${t[0]}`)}else throw Error("Invalid encoded key format, must be <curve>:<encoded key>")}}class M{}let N="near-api-js:keystore:";class k extends M{localStorage;prefix;constructor(e=window.localStorage,t=N){super(),this.localStorage=e,this.prefix=t}async setKey(e,t,r){this.localStorage.setItem(this.storageKeyForSecretKey(e,t),r.toString())}async getKey(e,t){let r=this.localStorage.getItem(this.storageKeyForSecretKey(e,t));return r?P.fromString(r):null}async removeKey(e,t){this.localStorage.removeItem(this.storageKeyForSecretKey(e,t))}async clear(){for(let e of this.storageKeys())e.startsWith(this.prefix)&&this.localStorage.removeItem(e)}async getNetworks(){let e=new Set;for(let t of this.storageKeys())if(t.startsWith(this.prefix)){let r=t.substring(this.prefix.length).split(":");e.add(r[1])}return Array.from(e.values())}async getAccounts(e){let t=[];for(let r of this.storageKeys())if(r.startsWith(this.prefix)){let n=r.substring(this.prefix.length).split(":");n[1]===e&&t.push(n[0])}return t}storageKeyForSecretKey(e,t){return`${this.prefix}${t}:${e}`}*storageKeys(){for(let e=0;e<this.localStorage.length;e++)yield this.localStorage.key(e)}}},75658:(e,t,r)=>{"use strict";r.d(t,{X:()=>o});var n=r(15363),i=r(16658);class o{providers;currentProviderIndex;constructor(e){if(0===e.length)throw Error("At least one provider must be specified");this.providers=e,this.currentProviderIndex=0}switchToNextProvider(){1!==this.providers.length&&(this.providers.length-1<=this.currentProviderIndex?this.currentProviderIndex=0:this.currentProviderIndex+=1,n.Vy.debug(`Switched to provider at the index ${this.currentProviderIndex}`))}get currentProvider(){let e=this.providers[this.currentProviderIndex];if(!e)throw Error(`Provider wasn't found at index ${this.currentProviderIndex}`);return e}async withBackoff(e){for(let t=0;t<this.providers.length;t++)try{let t=await e(this.currentProvider);if(void 0===t)continue;return t}catch(e){console.error(e),this.switchToNextProvider()}throw new i.TI(`Exceeded ${this.providers.length} providers to execute request`,"RetriesExceeded")}async status(){return this.withBackoff(e=>e.status())}async getNetworkId(){return this.withBackoff(e=>e.getNetworkId())}async getCurrentEpochSeatPrice(){return this.withBackoff(e=>e.getCurrentEpochSeatPrice())}async getNextEpochSeatPrice(){return this.withBackoff(e=>e.getNextEpochSeatPrice())}async viewAccessKey(e,t,r){return this.withBackoff(n=>n.viewAccessKey(e,t,r))}async viewAccessKeyList(e,t){return this.withBackoff(r=>r.viewAccessKeyList(e,t))}async viewAccount(e,t){return this.withBackoff(r=>r.viewAccount(e,t))}async viewContractCode(e,t){return this.withBackoff(r=>r.viewContractCode(e,t))}async viewContractState(e,t,r){return this.withBackoff(n=>n.viewContractState(e,t,r))}async callFunction(e,t,r,n){return this.withBackoff(i=>i.callFunction(e,t,r,n))}async callFunctionRaw(e,t,r,n){return this.withBackoff(i=>i.callFunctionRaw(e,t,r,n))}async viewBlock(e){return this.withBackoff(t=>t.viewBlock(e))}async viewChunk(e){return this.withBackoff(t=>t.viewChunk(e))}async viewGasPrice(e){return this.withBackoff(t=>t.viewGasPrice(e))}async viewNodeStatus(){return this.withBackoff(e=>e.viewNodeStatus())}async viewValidators(e){return this.withBackoff(t=>t.viewValidators(e))}async viewValidatorsV2(e){return this.withBackoff(t=>t.viewValidatorsV2(e))}async viewTransactionStatus(e,t,r){return this.withBackoff(n=>n.viewTransactionStatus(e,t,r))}async viewTransactionStatusWithReceipts(e,t,r){return this.withBackoff(n=>n.viewTransactionStatusWithReceipts(e,t,r))}async viewTransactionReceipt(e){return this.withBackoff(t=>t.viewTransactionReceipt(e))}async sendTransactionUntil(e,t){return this.withBackoff(r=>r.sendTransactionUntil(e,t))}async sendTransaction(e){return this.withBackoff(t=>t.sendTransaction(e))}async sendTransactionAsync(e){return this.withBackoff(t=>t.sendTransactionAsync(e))}async txStatus(e,t,r){return this.withBackoff(n=>n.txStatus(e,t,r))}async txStatusReceipts(e,t,r){return this.withBackoff(n=>n.txStatusReceipts(e,t,r))}async query(e,t){return t?this.withBackoff(r=>r.query(e,t)):this.withBackoff(t=>t.query(e))}async block(e){return this.withBackoff(t=>t.block(e))}async blockChanges(e){return this.withBackoff(t=>t.blockChanges(e))}async chunk(e){return this.withBackoff(t=>t.chunk(e))}async validators(e){return this.withBackoff(t=>t.validators(e))}async experimental_protocolConfig(e){return this.withBackoff(t=>t.experimental_protocolConfig(e))}async lightClientProof(e){return this.withBackoff(t=>t.lightClientProof(e))}async nextLightClientBlock(e){return this.withBackoff(t=>
40t.nextLightClientBlock(e))}async accessKeyChanges(e,t){return this.withBackoff(r=>r.accessKeyChanges(e,t))}async singleAccessKeyChanges(e,t){return this.withBackoff(r=>r.singleAccessKeyChanges(e,t))}async accountChanges(e,t){return this.withBackoff(r=>r.accountChanges(e,t))}async contractStateChanges(e,t,r=""){return this.withBackoff(n=>n.contractStateChanges(e,t,r))}async contractCodeChanges(e,t){return this.withBackoff(r=>r.contractCodeChanges(e,t))}async gasPrice(e){return this.withBackoff(t=>t.gasPrice(e))}}},54338:(e,t,r)=>{"use strict";r.d(t,{F:()=>v});var n=r(15363),i=r(16658),o=r(84136),s=r(67918);let a=1.5,c=10,u=0;function l(e=c,t=a,r=u){return{numOfAttempts:e,timeMultiple:t,startingDelay:r,retry:e=>!!([503,500,408].includes(e.cause)||e.toString().includes("FetchError")||e.toString().includes("Failed to fetch"))}}class d extends Error{cause;constructor(e,t){super(e,t),t.cause&&(this.cause=t.cause)}}async function f(e,t,r,n){let o=await (0,s.backOff)(async()=>{let n=await fetch(e,{method:"POST",body:JSON.stringify(t),headers:{...r,"Content-Type":"application/json"}}),{ok:i,status:o}=n;if(500===o)throw new d("Internal server error",{cause:o});if(408===o)throw new d("Timeout error",{cause:o});if(400===o)throw new d("Request validation error",{cause:o});if(503===o)throw new d(`${e} unavailable`,{cause:o});if(!i)throw new d(await n.text(),{cause:o});return n},n);if(!o)throw new i.TI(`Exceeded ${c} attempts for ${e}.`,"RetriesExceeded");return await o.json()}var h=r(75927).Buffer;let p=12,y=500,g=1.5,m=123,b="optimistic";class v{connection;options;networkId;constructor(e,t){this.connection=e||{url:""};let r={retries:p,wait:y,backoff:g};this.options=Object.assign({},r,t),this.networkId=void 0}async getNetworkId(){if(this.networkId)return this.networkId;let{chain_id:e}=await this.viewNodeStatus();return this.networkId=e,this.networkId}async getCurrentEpochSeatPrice(){let{minimum_stake_ratio:e,protocol_version:t}=await this.experimental_protocolConfig({finality:b}),{current_validators:r}=await this.viewValidators(),i=300;return(0,n.sz)(r,i,e,t)}async getNextEpochSeatPrice(){let{minimum_stake_ratio:e,protocol_version:t}=await this.experimental_protocolConfig({finality:b}),{next_validators:r}=await this.viewValidators(),i=300;return(0,n.sz)(r,i,e,t)}async viewAccessKey(e,t,r={finality:b}){let n=await this.query({...r,request_type:"view_access_key",account_id:e,public_key:t.toString()});return{...n,nonce:BigInt(n.nonce)}}async viewAccessKeyList(e,t={finality:b}){return this.query({...t,request_type:"view_access_key_list",account_id:e})}async viewAccount(e,t={finality:b}){let r=await this.query({...t,request_type:"view_account",account_id:e});return{...r,amount:BigInt(r.amount),locked:BigInt(r.locked)}}async viewContractCode(e,t={finality:b}){let r=await this.query({...t,request_type:"view_code",account_id:e});return{...r,code:new Uint8Array(h.from(r.code_base64,"base64"))}}async viewContractState(e,t,r={finality:b}){let n=h.from(t||"").toString("base64");return this.query({...r,request_type:"view_state",account_id:e,prefix_base64:n})}async callFunction(e,t,r,n={finality:b}){let{result:i}=await this.callFunctionRaw(e,t,r,n);if(0===i.length)return;let o=h.from(i).toString();try{return JSON.parse(o)}catch{return o}}async callFunctionRaw(e,t,r,n={finality:b}){let i=(ArrayBuffer.isView(r)?h.from(r):h.from(JSON.stringify(r))).toString("base64");return await this.query({...n,request_type:"call_function",account_id:e,method_name:t,args_base64:i})}async viewBlock(e){let{finality:t}=e,{blockId:r}=e;return this.sendJsonRpc("block",{block_id:r,finality:t})}async viewChunk(e){return this.sendJsonRpc("chunk",[e])}async viewGasPrice(e){return this.sendJsonRpc("gas_price",[e||null])}async viewNodeStatus(){return this.sendJsonRpc("status",[])}async viewValidators(e){return this.sendJsonRpc("validators",[e||null])}async viewValidatorsV2(e){if(null===e)return this.sendJsonRpc("validators",[null]);if("object"==typeof e&&"blockId"in e)return this.sendJsonRpc("validators",{block_id:e.blockId});if("object"==typeof e&&"epochId"in e)return this.sendJsonRpc("validators",{epoch_id:e.epochId});throw Error("Invalid parameters for validatorsV2")}async viewTransactionStatus(e,t,r){let i="string"==typeof e?e:(0,n.aP)(e);return this.sendJsonRpc("tx",{tx_hash:i,sender_account_id:t,wait_until:r})}async viewTransactionStatusWithReceipts(e,t,r){let i="string"==typeof e?e:(0,n.aP)(e);return this.sendJsonRpc("EXPERIMENTAL_tx_status",{tx_hash:i,sender_account_id:t,wait_until:r})}async viewTransactionReceipt(e){return this.sendJsonRpc("EXPERIMENTAL_receipt",{receipt_id:e})}async status(){return this.sendJsonRpc("status",[])}async sendTransactionUntil(e,t){let r=(0,o.T9)(e);return this.sendJsonRpc("send_tx",{signed_tx_base64:h.from(r).toString("base64"),wait_until:t})}async sendTransaction(e){return this.sendTransactionUntil(e,"EXECUTED_OPTIMISTIC")}async sendTransactionAsync(e){return this.sendTransactionUntil(e,"NONE")}async txStatus(e,t,r="EXECUTED_OPTIMISTIC"){return"string"==typeof e?this.txStatusString(e,t,r):this.txStatusUint8Array(e,t,r)}async txStatusUint8Array(e,t,r){return this.sendJsonRpc("tx",{tx_hash:(0,n.aP)(e),sender_account_id:t,wait_until:r})}async txStatusString(e,t,r){return this.sendJsonRpc("tx",{tx_hash:e,sender_account_id:t,wait_until:r})}async txStatusReceipts(e,t,r="EXECUTED_OPTIMISTIC"){return"string"==typeof e?this.sendJsonRpc("EXPERIMENTAL_tx_status",{tx_hash:e,sender_account_id:t,wait_until:r}):this.sendJsonRpc("EXPERIMENTAL_tx_status",{tx_hash:(0,n.aP)(e),sender_account_id:t,wait_until:r})}async query(...e){let t;if(1===e.length){let{block_id:r,blockId:n,...i}=e[0];t=await this.sendJsonRpc("query",{...i,block_id:r||n})}else{let[r,n]=e;t=await this.sendJsonRpc("query",[r,n])}if(t&&t.error)throw new i.TI(`Querying failed: ${t.error}. 41${JSON.stringify(t,null,2)}`,(0,n.MO)(t.error,t.error.name));return t}async block(e){let{finality:t}=e,{blockId:r}=e;return this.sendJsonRpc("block",{block_id:r,finality:t})}async blockChanges(e){let{finality:t}=e,{blockId:r}=e;return this.sendJsonRpc("EXPERIMENTAL_changes_in_block",{block_id:r,finality:t})}async chunk(e){return this.sendJsonRpc("chunk",[e])}async validators(e){return this.sendJsonRpc("validators",[e])}async experimental_protocolConfig(e){let{blockId:t,...r}=e;return await this.sendJsonRpc("EXPERIMENTAL_protocol_config",{...r,block_id:t})}async lightClientProof(e){return await this.sendJsonRpc("EXPERIMENTAL_light_client_proof",e)}
41async nextLightClientBlock(e){return await this.sendJsonRpc("next_light_client_block",e)}async accessKeyChanges(e,t){let{finality:r}=t,{blockId:n}=t;return this.sendJsonRpc("EXPERIMENTAL_changes",{changes_type:"all_access_key_changes",account_ids:e,block_id:n,finality:r})}async singleAccessKeyChanges(e,t){let{finality:r}=t,{blockId:n}=t;return this.sendJsonRpc("EXPERIMENTAL_changes",{changes_type:"single_access_key_changes",keys:e,block_id:n,finality:r})}async accountChanges(e,t){let{finality:r}=t,{blockId:n}=t;return this.sendJsonRpc("EXPERIMENTAL_changes",{changes_type:"account_changes",account_ids:e,block_id:n,finality:r})}async contractStateChanges(e,t,r=""){let{finality:n}=t,{blockId:i}=t;return this.sendJsonRpc("EXPERIMENTAL_changes",{changes_type:"data_changes",account_ids:e,key_prefix_base64:r,block_id:i,finality:n})}async contractCodeChanges(e,t){let{finality:r}=t,{blockId:n}=t;return this.sendJsonRpc("EXPERIMENTAL_changes",{changes_type:"contract_code_changes",account_ids:e,block_id:n,finality:r})}async gasPrice(e){return await this.sendJsonRpc("gas_price",[e])}async sendJsonRpc(e,t){let r={method:e,params:t,id:m++,jsonrpc:"2.0"},o=await f(this.connection.url,r,this.connection.headers||{},l(this.options.retries,this.options.backoff,this.options.wait));if(o.error){if("object"==typeof o.error.data){if("string"==typeof o.error.data.error_message&&"string"==typeof o.error.data.error_type)throw new i.TI(o.error.data.error_message,o.error.data.error_type);throw(0,n.ND)(o.error.data)}{let e=`[${o.error.code}] ${o.error.message}: ${o.error.data}`,r=(0,n.MO)(o.error.data,"");if(r)throw new i.TI((0,n.Wk)(r,t),r);throw new i.TI(e,o.error.name)}}if("string"==typeof o.result?.error){let e=(0,n.MO)(o.result.error,"");if(e)throw new n.gP((0,n.Wk)(e,t),e)}let{result:s}=o;if(void 0===s)throw new i.TI(`Exceeded ${this.options.retries} attempts for request to ${e}.`,"RetriesExceeded");return s}}},7379:(e,t,r)=>{"use strict";r.d(t,{G:()=>M});var n=r(27868),i=r(91132),o=r(81587);let s={struct:{message:"string",nonce:{array:{type:"u8",len:32}},recipient:"string",callbackUrl:{option:"string"}}};class a{}var c=r(84136),u=r(20791),l=r(90546),d=["u8","u16","u32","u64","u128","i8","i16","i32","i64","i128","f32","f64"],f=function(){function e(){this.offset=0,this.buffer_size=256,this.buffer=new ArrayBuffer(this.buffer_size),this.view=new DataView(this.buffer)}return e.prototype.resize_if_necessary=function(e){if(this.buffer_size-this.offset<e){this.buffer_size=Math.max(2*this.buffer_size,this.buffer_size+e);var t=new ArrayBuffer(this.buffer_size);new Uint8Array(t).set(new Uint8Array(this.buffer)),this.buffer=t,this.view=new DataView(t)}},e.prototype.get_used_buffer=function(){return new Uint8Array(this.buffer).slice(0,this.offset)},e.prototype.store_value=function(e,t){var r=t.substring(1),n=parseInt(r)/8;this.resize_if_necessary(n);var i="f"===t[0]?"setFloat".concat(r):"i"===t[0]?"setInt".concat(r):"setUint".concat(r);this.view[i](this.offset,e,!0),this.offset+=n},e.prototype.store_bytes=function(e){this.resize_if_necessary(e.length),new Uint8Array(this.buffer).set(new Uint8Array(e),this.offset),this.offset+=e.length},e}(),h=function(){function e(e){this.offset=0,this.buffer_size=e.length,this.buffer=new ArrayBuffer(e.length),new Uint8Array(this.buffer).set(e),this.view=new DataView(this.buffer)}return e.prototype.assert_enough_buffer=function(e){if(this.offset+e>this.buffer.byteLength)throw Error("Error in schema, the buffer is smaller than expected")},e.prototype.consume_value=function(e){var t=e.substring(1),r=parseInt(t)/8;this.assert_enough_buffer(r);var n="f"===e[0]?"getFloat".concat(t):"i"===e[0]?"getInt".concat(t):"getUint".concat(t),i=this.view[n](this.offset,!0);return this.offset+=r,i},e.prototype.consume_bytes=function(e){this.assert_enough_buffer(e);var t=this.buffer.slice(this.offset,this.offset+e);return this.offset+=e,t},e}(),p=function(){var e=function(t,r){return(e=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])})(t,r)};return function(t,r){if("function"!=typeof r&&null!==r)throw TypeError("Class extends value "+String(r)+" is not a constructor or null");function n(){this.constructor=t}e(t,r),t.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}();function y(e){return Array.isArray(e)||!!e&&"object"==typeof e&&"length"in e&&"number"==typeof e.length&&(0===e.length||e.length>
410&&e.length-1 in e)}function g(e,t,r){if(typeof e!==t)throw Error("Expected ".concat(t," not ").concat(typeof e,"(").concat(e,") at ").concat(r.join(".")))}function m(e,t){var r=["number","string","bigint","boolean"].includes(typeof e),n="object"==typeof e&&null!==e&&"toString"in e;if(!r&&!n)throw Error("Expected bigint, number, boolean or string not ".concat(typeof e,"(").concat(e,") at ").concat(t.join(".")))}function b(e,t,r){if(e!==t)throw Error("Array length ".concat(e," does not match schema length ").concat(t," at ").concat(r.join(".")))}function v(e,t){if("object"!=typeof e||null===e)throw Error("Expected object not ".concat(typeof e,"(").concat(e,") at ").concat(t.join(".")))}var w=d.concat(["bool","string"]),_=["option","enum","array","set","map","struct"],E=function(e){function t(t,r){var n="Invalid schema: ".concat(JSON.stringify(t)," expected ").concat(r);return e.call(this,n)||this}return p(t,e),t}(Error);function S(e){if(!("string"==typeof e&&w.includes(e))){if(e&&"object"==typeof e){var t=Object.keys(e);if(1===t.length&&_.includes(t[0])){var r=t[0];if("option"===r)return S(e[r]);if("enum"===r)return x(e[r]);if("array"===r)return A(e[r]);if("set"===r)return S(e[r]);if("map"===r)return I(e[r]);if("struct"===r)return O(e[r])}}throw new E(e,_.join(", ")+" or "+w.join(", "))}}function x(e){if(!Array.isArray(e))throw new E(e,"Array");for(var t=0,r=e;t<r.length;t++){var n=r[t];if("object"!=typeof n||!("struct"in n))throw Error('Missing "struct" key in enum schema');if("object"!=typeof n.struct||1!==Object.keys(n.struct).length)throw Error('The "struct" in each enum must have a single key');S({struct:n.struct})}}function A(e){if("object"!=typeof e)throw new E(e,"{ type, len? }");if(e.len&&"number"!=typeof e.len)throw Error("Invalid schema: ".concat(e));if("type"in e)return S(e.type);throw new E(e,"{ type, len? }")}function I(e){if("object"==typeof e&&"key"in e&&"value"in e)S(e.key),S(e.value);else throw new E(e,"{ key, value }")}function O(e){if("object"!=typeof e)throw new E(e,"object");for(var t in e)S(e[t])}var T=function(){function e(e){this.encoded=new f,this.fieldPath=["value"],this.checkTypes=e}return e.prototype.encode=function(e,t){return this.encode_value(e,t),this.encoded.get_used_buffer()},e.prototype.encode_value=function(e,t){if("string"==typeof t){if(d.includes(t))return this.encode_integer(e,t);if("string"===t)return this.encode_string(e);if("bool"===t)return this.encode_boolean(e)}if("object"==typeof t){if("option"in t)return this.encode_option(e,t);if("enum"in t)return this.encode_enum(e,t);if("array"in t)return this.encode_array(e,t);if("set"in t)return this.encode_set(e,t);if("map"in t)return this.encode_map(e,t);if("struct"in t)return this.encode_struct(e,t)}},e.prototype.encode_integer=function(e,t){var r=parseInt(t.substring(1));r<=32||"f64"==t?(this.checkTypes&&g(e,"number",this.fieldPath),this.encoded.store_value(e,t)):(this.checkTypes&&m(e,this.fieldPath),this.encode_bigint(BigInt(e),r))},e.prototype.encode_bigint=function(e,t){for(var r=t/8,n=new Uint8Array(r),i=0;i<r;i++)n[i]=Number(e&BigInt(255)),e>>=BigInt(8);this.encoded.store_bytes(new Uint8Array(n))},e.prototype.encode_string=function(e){this.checkTypes&&g(e,"string",this.fieldPath);var t=e;this.encoded.store_value(t.length,"u32");for(var r=0;r<t.length;r++)this.encoded.store_value(t.charCodeAt(r),"u8")},e.prototype.encode_boolean=function(e){this.checkTypes&&g(e,"boolean",this.fieldPath),this.encoded.store_value(e?1:0,"u8")},e.prototype.encode_option=function(e,t){null==e?this.encoded.store_value(0,"u8"):(this.encoded.store_value(1,"u8"),this.encode_value(e,t.option))},e.prototype.encode_enum=function(e,t){this.checkTypes&&v(e,this.fieldPath);for(var r=Object.keys(e)[0],n=0;n<t.enum.length;n++){var i=t.enum[n];if(r===Object.keys(i.struct)[0])return this.encoded.store_value(n,"u8"),this.encode_struct(e,i)}throw Error("Enum key (".concat(r,") not found in enum schema: ").concat(JSON.stringify(t)," at ").concat(this.fieldPath.join(".")))},e.prototype.encode_array=function(e,t){if(y(e))return this.encode_arraylike(e,t);if(e instanceof ArrayBuffer)return this.encode_buffer(e,t);throw Error("Expected Array-like not ".concat(typeof e,"(").concat(e,") at ").concat(this.fieldPath.join(".")))},e.prototype.encode_arraylike=function(e,t){t.array.len?b(e.length,t.array.len,this.fieldPath):this.encoded.store_value(e.length,"u32");for(var r=0;r<e.length;r++)this.encode_value(e[r],t.array.type)},e.prototype.encode_buffer=function(e,t){t.array.len?b(e.byteLength,t.array.len,this.fieldPath):this.encoded.store_value(e.byteLength,"u32"),this.encoded.store_bytes(new Uint8Array(e))},e.prototype.encode_set=function(e,t){this.checkTypes&&g(e,"object",this.fieldPath);var r=e instanceof Set?Array.from(e.values()):Object.values(e);this.encoded.store_value(r.length,"u32");for(var n=0,i=r;n<i.length;n++){var o=i[n];this.encode_value(o,t.set)}},e.prototype.encode_map=function(e,t){this.checkTypes&&g(e,"object",this.fieldPath);var r=e instanceof Map,n=r?Array.from(e.keys()):Object.keys(e);this.encoded.store_value(n.length,"u32");for(var i=0,o=n;i<o.length;i++){var s=o[i];this.encode_value(s,t.map.key),this.encode_value(r?e.get(s):e[s],t.map.value)}},e.prototype.encode_struct=function(e,t){this.checkTypes&&g(e,"object",this.fieldPath);for(var r=0,n=Object.keys(t.struct);r<n.length;r++){var i=n[r];this.fieldPath.push(i),this.encode_value(e[i],t.struct[i]),this.fieldPath.pop()}},e}();function P(e,t,r){return void 0===r&&(r=!0),r&&S(e),new T(r).encode(t,e)}!function(){function e(e){this.buffer=new h(e)}e.prototype.decode=function(e){return this.decode_value(e)},e.prototype.decode_value=function(e){if("string"==typeof e){if(d.includes(e))return this.decode_integer(e);if("string"===e)return this.decode_string();if("bool"===e)return this.decode_boolean()}if("object"==typeof e){if("option"in e)return this.decode_option(e);if("enum"in e)return this.decode_enum(e);
41if("array"in e)return this.decode_array(e);if("set"in e)return this.decode_set(e);if("map"in e)return this.decode_map(e);if("struct"in e)return this.decode_struct(e)}throw Error("Unsupported type: ".concat(e))},e.prototype.decode_integer=function(e){var t=parseInt(e.substring(1));return t<=32||"f64"==e?this.buffer.consume_value(e):this.decode_bigint(t,e.startsWith("i"))},e.prototype.decode_bigint=function(e,t){void 0===t&&(t=!1);var r=e/8,n=new Uint8Array(this.buffer.consume_bytes(r)),i=n.reduceRight(function(e,t){return e+t.toString(16).padStart(2,"0")},"");return t&&n[r-1]?BigInt.asIntN(e,BigInt("0x".concat(i))):BigInt("0x".concat(i))},e.prototype.decode_string=function(){var e=this.decode_integer("u32"),t=new Uint8Array(this.buffer.consume_bytes(e));return String.fromCharCode.apply(null,t)},e.prototype.decode_boolean=function(){return this.buffer.consume_value("u8")>0},e.prototype.decode_option=function(e){var t=this.buffer.consume_value("u8");if(1===t)return this.decode_value(e.option);if(0!==t)throw Error("Invalid option ".concat(t));return null},e.prototype.decode_enum=function(e){var t,r=this.buffer.consume_value("u8");if(r>e.enum.length)throw Error("Enum option ".concat(r," is not available"));var n=e.enum[r].struct,i=Object.keys(n)[0];return(t={})[i]=this.decode_value(n[i]),t},e.prototype.decode_array=function(e){for(var t=[],r=e.array.len?e.array.len:this.decode_integer("u32"),n=0;n<r;++n)t.push(this.decode_value(e.array.type));return t},e.prototype.decode_set=function(e){for(var t=this.decode_integer("u32"),r=new Set,n=0;n<t;++n)r.add(this.decode_value(e.set));return r},e.prototype.decode_map=function(e){for(var t=this.decode_integer("u32"),r=new Map,n=0;n<t;++n){var i=this.decode_value(e.map.key),o=this.decode_value(e.map.value);r.set(i,o)}return r},e.prototype.decode_struct=function(e){var t={};for(var r in e.struct)t[r]=this.decode_value(e.struct[r]);return t}}();class M extends a{key;constructor(e){super(),this.key=e}static fromSecretKey(e){return new M(n.a.fromString(e))}async getPublicKey(){return this.key.getPublicKey()}async signNep413Message(e,t,r,n,i){if(32!==n.length)throw Error("Nonce must be exactly 32 bytes long");let a=this.key.getPublicKey(),c=P("u32",0x8000019d),u=P(s,{message:e,recipient:r,nonce:n,callbackUrl:i}),l=new Uint8Array(c.length+u.length);l.set(c),l.set(u,c.length);let d=new Uint8Array((0,o.sc)(l)),{signature:f}=this.key.sign(d);return{accountId:t,publicKey:a,signature:f}}async signTransaction(e){let t=this.key.getPublicKey();if(e.publicKey.toString()!==t.toString())throw Error("The public key doesn't match the signer's key");let r=(0,c.T9)(e),n=new Uint8Array((0,o.sc)(r)),{signature:s}=this.key.sign(n);return[n,new c.Zj({transaction:e,signature:new u.t({keyType:e.publicKey.ed25519Key?i._.ED25519:i._.SECP256K1,data:s})})]}async signDelegateAction(e){let t=this.key.getPublicKey();if(e.publicKey.toString()!==t.toString())throw Error("The public key doesn't match the signer's key");let r=(0,c.gS)(e),n=new Uint8Array((0,o.sc)(r)),{signature:i}=this.key.sign(n);return[n,new l.ss({delegateAction:e,signature:new u.t({keyType:t.keyType,data:i})})]}}},81587:(e,t,r)=>{"use strict";function n(e){return e instanceof Uint8Array||ArrayBuffer.isView(e)&&"Uint8Array"===e.constructor.name}function i(e,...t){if(!n(e))throw Error("Uint8Array expected");if(t.length>0&&!t.includes(e.length))throw Error("Uint8Array expected of length "+t+", got length="+e.length)}function o(e,t=!0){if(e.destroyed)throw Error("Hash instance has been destroyed");if(t&&e.finished)throw Error("Hash#digest() has already been called")}function s(e,t){i(e);let r=t.outputLen;if(e.length<r)throw Error("digestInto() expects output buffer of length at least "+r)}function a(e){return new DataView(e.buffer,e.byteOffset,e.byteLength)}function c(e,t){return e<<32-t|e>>>t}r.d(t,{sc:()=>_});function u(e){if("string"!=typeof e)throw Error("utf8ToBytes expected string, got "+typeof e);return new Uint8Array(new TextEncoder().encode(e))}function l(e){return"string"==typeof e&&(e=u(e)),i(e),e}class d{clone(){return this._cloneInto()}}function f(e){let t=t=>e().update(l(t)).digest(),r=e();return t.outputLen=r.outputLen,t.blockLen=r.blockLen,t.create=()=>e(),t}function h(e,t,r,n){if("function"==typeof e.setBigUint64)return e.setBigUint64(t,r,n);let i=BigInt(32),o=BigInt(0xffffffff),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)}function p(e,t,r){return e&t^~e&r}function y(e,t,r){return e&t^e&r^t&r}class g extends d{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=a(this.buffer)}update(e){o(this);let{view:t,buffer:r,blockLen:n}=this,i=(e=l(e)).length;for(let o=0;o<i;){let s=Math.min(n-this.pos,i-o);if(s===n){let t=a(e);for(;n<=i-o;o+=n)this.process(t,o);continue}r.set(e.subarray(o,o+s),this.pos),this.pos+=s,o+=s,this.pos===n&&(this.process(t,0),this.pos=0)}return this.length+=e.length,this.roundClean(),this}digestInto(e){o(this),s(e,this),this.finished=!0;let{buffer:t,view:r,blockLen:n,isLE:i}=this,{pos:c}=this;t[c++]=128,this.buffer.subarray(c).fill(0),this.padOffset>n-c&&(this.process(r,0),c=0);for(let e=c;e<n;e++)t[e]=0;h(r,n-8,BigInt(8*this.length),i),this.process(r,0);let u=a(e),l=this.outputLen;if(l%4)throw Error("_sha2: outputLen should be aligned to 32bit");let d=l/4,f=this.get();if(d>f.length)throw Error("_sha2: outputLen bigger than state");for(let e=0;e<d;e++)u.setUint32(4*e,f[e],i)}digest(){let{buffer:e,outputLen:t}=this;this.digestInto(e);let r=e.slice(0,t);return this.destroy(),r}_cloneInto(e){e||(e=new this.constructor),e.set(...this.get());let{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}}let m=new Uint32Array([0x428a2f98,0x71374491,0xb5c0fbcf,0xe9b5dba5,0x3956c25b,0x59f111f1,0x923f82a4,0xab1c5ed5,0xd807aa98,0x12835b01,0x243185be,0x550c7dc3,0x72be5d74,0x80deb1fe,0x9bdc06a7,0xc19bf174,0xe49b69c1,0xefbe4786,0xfc19dc6,0x240ca1cc,0x2de92c6f,0x4a7484aa,0x5cb0a9dc,0x76f988da,0x983e5152,0xa831c66d,0xb00327c8,0xbf597fc7,0xc6e00bf3,0xd5a79147,0x6ca6351,0x14292967,0x27b70a85,0x2e1b2138,0x4d2c6dfc,0x53380d13,0x650a7354,0x766a0abb,0x81c2c92e,0x92722c85,0xa2bfe8a1,0xa81a664b,0xc24b8b70,0xc
4176c51a3,0xd192e819,0xd6990624,0xf40e3585,0x106aa070,0x19a4c116,0x1e376c08,0x2748774c,0x34b0bcb5,0x391c0cb3,0x4ed8aa4a,0x5b9cca4f,0x682e6ff3,0x748f82ee,0x78a5636f,0x84c87814,0x8cc70208,0x90befffa,0xa4506ceb,0xbef9a3f7,0xc67178f2]),b=new Uint32Array([0x6a09e667,0xbb67ae85,0x3c6ef372,0xa54ff53a,0x510e527f,0x9b05688c,0x1f83d9ab,0x5be0cd19]),v=new Uint32Array(64);class w extends g{constructor(){super(64,32,8,!1),this.A=0|b[0],this.B=0|b[1],this.C=0|b[2],this.D=0|b[3],this.E=0|b[4],this.F=0|b[5],this.G=0|b[6],this.H=0|b[7]}get(){let{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 r=0;r<16;r++,t+=4)v[r]=e.getUint32(t,!1);for(let e=16;e<64;e++){let t=v[e-15],r=v[e-2],n=c(t,7)^c(t,18)^t>>>3,i=c(r,17)^c(r,19)^r>>>10;v[e]=i+v[e-7]+n+v[e-16]|0}let{A:r,B:n,C:i,D:o,E:s,F:a,G:u,H:l}=this;for(let e=0;e<64;e++){let t=l+(c(s,6)^c(s,11)^c(s,25))+p(s,a,u)+m[e]+v[e]|0,d=(c(r,2)^c(r,13)^c(r,22))+y(r,n,i)|0;l=u,u=a,a=s,s=o+t|0,o=i,i=n,n=r,r=t+d|0}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,u=u+this.G|0,l=l+this.H|0,this.set(r,n,i,o,s,a,u,l)}roundClean(){v.fill(0)}destroy(){this.set(0,0,0,0,0,0,0,0),this.buffer.fill(0)}}let _=f(()=>new w)},73403:(e,t,r)=>{"use strict";r.d(t,{I:()=>o,m:()=>s});var n=r(90546),i=r(75927).Buffer;function o(e){return void 0!==e.byteLength&&e.byteLength===e.length?e:i.from(JSON.stringify(e))}let s={addKey:function(e,t){return new n.rc({addKey:new n.ZP({publicKey:e,accessKey:t})})},createAccount:function(){return new n.rc({createAccount:new n.my})},deleteAccount:function(e){return new n.rc({deleteAccount:new n.FO({beneficiaryId:e})})},deleteKey:function(e){return new n.rc({deleteKey:new n.VU({publicKey:e})})},deployContract:function(e){return new n.rc({deployContract:new n.Kq({code:e})})},fullAccessKey:function(){return new n.wy({nonce:0n,permission:new n.vx({fullAccess:new n.V6})})},functionCall:function(e,t,r=0n,i=0n,s=o){return new n.rc({functionCall:new n.R6({methodName:e,args:s(t),gas:r,deposit:i})})},functionCallAccessKey:function(e,t,r){return new n.wy({nonce:0n,permission:new n.vx({functionCall:new n.Uy({receiverId:e,allowance:r,methodNames:t})})})},signedDelegate:function({delegateAction:e,signature:t}){return new n.rc({signedDelegate:new n.ss({delegateAction:e,signature:t})})},stake:function(e=0n,t){return new n.rc({stake:new n.Tf({stake:e,publicKey:t})})},transfer:function(e=0n){return new n.rc({transfer:new n.mr({deposit:e})})},deployGlobalContract:function(e,t){return new n.rc({deployGlobalContract:new n.BN({code:e,deployMode:t})})},useGlobalContract:function(e){return new n.rc({useGlobalContract:new n.ZQ({contractIdentifier:e})})}}},90546:(e,t,r)=>{"use strict";r.d(t,{BN:()=>h,FO:()=>v,Kq:()=>u,R6:()=>l,Tf:()=>g,Uy:()=>i,V6:()=>o,VU:()=>b,ZP:()=>m,ZQ:()=>p,eo:()=>d,mr:()=>y,my:()=>c,rc:()=>_,ss:()=>w,vC:()=>f,vx:()=>s,wy:()=>a});var n=r(55816);class i{allowance;receiverId;methodNames;constructor({allowance:e,receiverId:t,methodNames:r}){this.allowance=e,this.receiverId=t,this.methodNames=r}}class o{}class s extends n.g{enum;functionCall;fullAccess;constructor(e){for(let[t,r]of(super(e),Object.entries(e||{})))this[t]=r,this.enum=t}}class a{nonce;permission;constructor({nonce:e,permission:t}){this.nonce=e,this.permission=t}}class c{}class u{code;constructor({code:e}){this.code=e}}class l{methodName;args;gas;deposit;constructor({methodName:e,args:t,gas:r,deposit:n}){this.methodName=e,this.args=t,this.gas=r,this.deposit=n}}class d extends n.g{enum;CodeHash;AccountId;constructor(e){for(let[t,r]of(super(e),Object.entries(e||{})))this[t]=r,this.enum=t}}class f extends n.g{enum;CodeHash;AccountId;constructor(e){for(let[t,r]of(super(e),Object.entries(e||{})))this[t]=r,this.enum=t}}class h{code;deployMode;constructor({code:e,deployMode:t}){this.code=e,this.deployMode=t}}class p{contractIdentifier;constructor({contractIdentifier:e}){this.contractIdentifier=e}}class y{deposit;constructor({deposit:e}){this.deposit=e}}class g{stake;publicKey;constructor({stake:e,publicKey:t}){this.stake=e,this.publicKey=t}}class m{publicKey;accessKey;constructor({publicKey:e,accessKey:t}){this.publicKey=e,this.accessKey=t}}class b{publicKey;constructor({publicKey:e}){this.publicKey=e}}class v{beneficiaryId;constructor({beneficiaryId:e}){this.beneficiaryId=e}}class w{delegateAction;signature;constructor({delegateAction:e,signature:t}){this.delegateAction=e,this.signature=t}}class _ extends n.g{enum;createAccount;deployContract;functionCall;transfer;stake;addKey;deleteKey;deleteAccount;signedDelegate;deployGlobalContract;useGlobalContract;constructor(e){for(let[t,r]of(super(e),Object.entries(e||{})))this[t]=r,this.enum=t}}},40972:(e,t,r)=>{"use strict";r.d(t,{z:()=>i});var n=r(84136);function i(e,t,r,i,o,s){let a="bigint"==typeof i?i:BigInt(i);return new n.ZX({signerId:e,publicKey:t,nonce:a,receiverId:r,actions:o,blockHash:s})}},84136:(e,t,r)=>{"use strict";r.d(t,{yx:()=>j,Zj:()=>D,ZX:()=>C,gS:()=>P,T9:()=>M});var n=["u8","u16","u32","u64","u128","i8","i16","i32","i64","i128","f32","f64"],i=function(){function e(){this.offset=0,this.buffer_size=256,this.buffer=new ArrayBuffer(this.buffer_size),this.view=new DataView(this.buffer)}return e.prototype.resize_if_necessary=function(e){if(this.buffer_size-this.offset<e){this.buffer_size=Math.max(2*this.buffer_size,this.buffer_size+e);var t=new ArrayBuffer(this.buffer_size);new Uint8Array(t).set(new Uint8Array(this.buffer)),this.buffer=t,this.view=new DataView(t)}},e.prototype.get_used_buffer=function(){return new Uint8Array(this.buffer).slice(0,this.offset)},e.prototype.store_value=function(e,t){var r=t.substring(1),n=parseInt(r)/8;this.resize_if_necessary(n);var i="f"===t[0]?"setFloat".concat(r):"i"===t[0]?"setInt".concat(r):"setUint".concat(r);this.view[i](this.offset,e,!0),this.offset+=n},e.prototype.store_bytes=function(e){this.resize_if_necessary(e.length),new Uint8Array(this.buffer).set(new Uint8Array(e),this.offset),this.offset+=e.length},e}(),o=function(){function e(e){this.offset=0,this.buffer_size=e.length,this.buffer=new ArrayBuffer(e.length),new Uint8Array(this.buffer).set(e),this.view=new DataView(this.buffer)}return e.prototype.assert_enough_buffer=function(e){if(this.offset+e>this.buffer.byteLength)throw Error("Error in schema, the buffer is smaller than expected")},e.prototype.consume_value=function(e){var t=e.substring(1),r=parseInt(t)/8;this.assert_enough_buffer(r);var n="f"===e[0]?"getFloat".concat(t):"i"===e[0]?"getInt".concat(t):"getUint".concat(t),i=this.view[n](this.offset,!0);return this.offset+=r,i},e.prototype.consume_bytes=function(e){this.assert_enough_buffer(e);var t=this.buffer.slice(this.offset,this.offset+e);return this.offset+=e,t},e}(),s=function(){var e=function(t,r){return(e=Object.setPrototypeOf||({__proto__:[]}
41)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])})(t,r)};return function(t,r){if("function"!=typeof r&&null!==r)throw TypeError("Class extends value "+String(r)+" is not a constructor or null");function n(){this.constructor=t}e(t,r),t.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}();function a(e){return Array.isArray(e)||!!e&&"object"==typeof e&&"length"in e&&"number"==typeof e.length&&(0===e.length||e.length>0&&e.length-1 in e)}function c(e,t,r){if(typeof e!==t)throw Error("Expected ".concat(t," not ").concat(typeof e,"(").concat(e,") at ").concat(r.join(".")))}function u(e,t){var r=["number","string","bigint","boolean"].includes(typeof e),n="object"==typeof e&&null!==e&&"toString"in e;if(!r&&!n)throw Error("Expected bigint, number, boolean or string not ".concat(typeof e,"(").concat(e,") at ").concat(t.join(".")))}function l(e,t,r){if(e!==t)throw Error("Array length ".concat(e," does not match schema length ").concat(t," at ").concat(r.join(".")))}function d(e,t){if("object"!=typeof e||null===e)throw Error("Expected object not ".concat(typeof e,"(").concat(e,") at ").concat(t.join(".")))}var f=n.concat(["bool","string"]),h=["option","enum","array","set","map","struct"],p=function(e){function t(t,r){var n="Invalid schema: ".concat(JSON.stringify(t)," expected ").concat(r);return e.call(this,n)||this}return s(t,e),t}(Error);function y(e){if(!("string"==typeof e&&f.includes(e))){if(e&&"object"==typeof e){var t=Object.keys(e);if(1===t.length&&h.includes(t[0])){var r=t[0];if("option"===r)return y(e[r]);if("enum"===r)return g(e[r]);if("array"===r)return m(e[r]);if("set"===r)return y(e[r]);if("map"===r)return b(e[r]);if("struct"===r)return v(e[r])}}throw new p(e,h.join(", ")+" or "+f.join(", "))}}function g(e){if(!Array.isArray(e))throw new p(e,"Array");for(var t=0,r=e;t<r.length;t++){var n=r[t];if("object"!=typeof n||!("struct"in n))throw Error('Missing "struct" key in enum schema');if("object"!=typeof n.struct||1!==Object.keys(n.struct).length)throw Error('The "struct" in each enum must have a single key');y({struct:n.struct})}}function m(e){if("object"!=typeof e)throw new p(e,"{ type, len? }");if(e.len&&"number"!=typeof e.len)throw Error("Invalid schema: ".concat(e));if("type"in e)return y(e.type);throw new p(e,"{ type, len? }")}function b(e){if("object"==typeof e&&"key"in e&&"value"in e)y(e.key),y(e.value);else throw new p(e,"{ key, value }")}function v(e){if("object"!=typeof e)throw new p(e,"object");for(var t in e)y(e[t])}var w=function(){function e(e){this.encoded=new i,this.fieldPath=["value"],this.checkTypes=e}return e.prototype.encode=function(e,t){return this.encode_value(e,t),this.encoded.get_used_buffer()},e.prototype.encode_value=function(e,t){if("string"==typeof t){if(n.includes(t))return this.encode_integer(e,t);if("string"===t)return this.encode_string(e);if("bool"===t)return this.encode_boolean(e)}if("object"==typeof t){if("option"in t)return this.encode_option(e,t);if("enum"in t)return this.encode_enum(e,t);if("array"in t)return this.encode_array(e,t);if("set"in t)return this.encode_set(e,t);if("map"in t)return this.encode_map(e,t);if("struct"in t)return this.encode_struct(e,t)}},e.prototype.encode_integer=function(e,t){var r=parseInt(t.substring(1));r<=32||"f64"==t?(this.checkTypes&&c(e,"number",this.fieldPath),this.encoded.store_value(e,t)):(this.checkTypes&&u(e,this.fieldPath),this.encode_bigint(BigInt(e),r))},e.prototype.encode_bigint=function(e,t){for(var r=t/8,n=new Uint8Array(r),i=0;i<r;i++)n[i]=Number(e&BigInt(255)),e>>=BigInt(8);this.encoded.store_bytes(new Uint8Array(n))},e.prototype.encode_string=function(e){this.checkTypes&&c(e,"string",this.fieldPath);var t=e;this.encoded.store_value(t.length,"u32");for(var r=0;r<t.length;r++)this.encoded.store_value(t.charCodeAt(r),"u8")},e.prototype.encode_boolean=function(e){this.checkTypes&&c(e,"boolean",this.fieldPath),this.encoded.store_value(e?1:0,"u8")},e.prototype.encode_option=function(e,t){null==e?this.encoded.store_value(0,"u8"):(this.encoded.store_value(1,"u8"),this.encode_value(e,t.option))},e.prototype.encode_enum=function(e,t){this.checkTypes&&d(e,this.fieldPath);for(var r=Object.keys(e)[0],n=0;n<t.enum.length;n++){var i=t.enum[n];if(r===Object.keys(i.struct)[0])return this.encoded.store_value(n,"u8"),this.encode_struct(e,i)}throw Error("Enum key (".concat(r,") not found in enum schema: ").concat(JSON.stringify(t)," at ").concat(this.fieldPath.join(".")))},e.prototype.encode_array=function(e,t){if(a(e))return this.encode_arraylike(e,t);if(e instanceof ArrayBuffer)return this.encode_buffer(e,t);throw Error("Expected Array-like not ".concat(typeof e,"(").concat(e,") at ").concat(this.fieldPath.join(".")))},e.prototype.encode_arraylike=function(e,t){t.array.len?l(e.length,t.array.len,this.fieldPath):this.encoded.store_value(e.length,"u32");for(var r=0;r<e.length;r++)this.encode_value(e[r],t.array.type)},e.prototype.encode_buffer=function(e,t){t.array.len?l(e.byteLength,t.array.len,this.fieldPath):this.encoded.store_value(e.byteLength,"u32"),this.encoded.store_bytes(new Uint8Array(e))},e.prototype.encode_set=function(e,t){this.checkTypes&&c(e,"object",this.fieldPath);var r=e instanceof Set?Array.from(e.values()):Object.values(e);this.encoded.store_value(r.length,"u32");for(var n=0,i=r;n<i.length;n++){var o=i[n];this.encode_value(o,t.set)}},e.prototype.encode_map=function(e,t){this.checkTypes&&c(e,"object",this.fieldPath);var r=e instanceof Map,n=r?Array.from(e.keys()):Object.keys(e);this.encoded.store_value(n.length,"u32");for(var i=0,o=n;i<o.length;i++){var s=o[i];this.encode_value(s,t.map.key),this.encode_value(r?e.get(s):e[s],t.map.value)}},e.prototype.encode_struct=function(e,t){this.checkTypes&&c(e,"object",this.fieldPath);for(var r=0,n=Object.keys(t.struct);r<n.length;r++){var i=n[r];this.fieldPath.push(i),this.encode_value(e[i],t.struct[i]),this.fieldPath.pop()}},e}(),_=function(){function e(e){this.buffer=new o(e)}return e.prototype.decode=function(e){return this.decode_value(e)},e.prototype.decode_value=function(e){if("string"==typeof e){if(n.includes(e))return this.decode_integer(e);if("string"===e)return this.decode_string();if("bool"===e)return this.decode_boolean()}if("object"==typeof e){if("option"in e)return this.decode_option(e);if("enum"in e)return this.decode_enum(e);
41if("array"in e)return this.decode_array(e);if("set"in e)return this.decode_set(e);if("map"in e)return this.decode_map(e);if("struct"in e)return this.decode_struct(e)}throw Error("Unsupported type: ".concat(e))},e.prototype.decode_integer=function(e){var t=parseInt(e.substring(1));return t<=32||"f64"==e?this.buffer.consume_value(e):this.decode_bigint(t,e.startsWith("i"))},e.prototype.decode_bigint=function(e,t){void 0===t&&(t=!1);var r=e/8,n=new Uint8Array(this.buffer.consume_bytes(r)),i=n.reduceRight(function(e,t){return e+t.toString(16).padStart(2,"0")},"");return t&&n[r-1]?BigInt.asIntN(e,BigInt("0x".concat(i))):BigInt("0x".concat(i))},e.prototype.decode_string=function(){var e=this.decode_integer("u32"),t=new Uint8Array(this.buffer.consume_bytes(e));return String.fromCharCode.apply(null,t)},e.prototype.decode_boolean=function(){return this.buffer.consume_value("u8")>0},e.prototype.decode_option=function(e){var t=this.buffer.consume_value("u8");if(1===t)return this.decode_value(e.option);if(0!==t)throw Error("Invalid option ".concat(t));return null},e.prototype.decode_enum=function(e){var t,r=this.buffer.consume_value("u8");if(r>e.enum.length)throw Error("Enum option ".concat(r," is not available"));var n=e.enum[r].struct,i=Object.keys(n)[0];return(t={})[i]=this.decode_value(n[i]),t},e.prototype.decode_array=function(e){for(var t=[],r=e.array.len?e.array.len:this.decode_integer("u32"),n=0;n<r;++n)t.push(this.decode_value(e.array.type));return t},e.prototype.decode_set=function(e){for(var t=this.decode_integer("u32"),r=new Set,n=0;n<t;++n)r.add(this.decode_value(e.set));return r},e.prototype.decode_map=function(e){for(var t=this.decode_integer("u32"),r=new Map,n=0;n<t;++n){var i=this.decode_value(e.map.key),o=this.decode_value(e.map.value);r.set(i,o)}return r},e.prototype.decode_struct=function(e){var t={};for(var r in e.struct)t[r]=this.decode_value(e.struct[r]);return t},e}();function E(e,t,r){return void 0===r&&(r=!0),r&&y(e),new w(r).encode(t,e)}function S(e,t,r){return void 0===r&&(r=!0),r&&y(e),new _(t).decode(e)}let x=0x40000000,A={MetaTransactions:366};class I{prefix;constructor({prefix:e}){this.prefix=e}}class O extends I{constructor(e){super({prefix:x+e})}}class T extends O{constructor(){super(A.MetaTransactions)}}function P(e){return new Uint8Array([...E(j.DelegateActionPrefix,new T),...E(j.DelegateAction,e)])}function M(e){return E("signature"in e?j.SignedTransaction:j.Transaction,e)}function N(e){return new C(S(j.Transaction,e))}function k(e){return new D(S(j.SignedTransaction,e))}class C{signerId;publicKey;nonce;receiverId;actions;blockHash;constructor({signerId:e,publicKey:t,nonce:r,receiverId:n,actions:i,blockHash:o}){this.signerId=e,this.publicKey=t,this.nonce=r,this.receiverId=n,this.actions=i,this.blockHash=o}encode(){return M(this)}static decode(e){return N(e)}}class D{transaction;signature;constructor({transaction:e,signature:t}){this.transaction=e,this.signature=t}encode(){return M(this)}static decode(e){return k(e)}}let j=new class{Ed25519Signature={struct:{data:{array:{type:"u8",len:64}}}};Secp256k1Signature={struct:{data:{array:{type:"u8",len:65}}}};Signature={enum:[{struct:{ed25519Signature:this.Ed25519Signature}},{struct:{secp256k1Signature:this.Secp256k1Signature}}]};Ed25519Data={struct:{data:{array:{type:"u8",len:32}}}};Secp256k1Data={struct:{data:{array:{type:"u8",len:64}}}};PublicKey={enum:[{struct:{ed25519Key:this.Ed25519Data}},{struct:{secp256k1Key:this.Secp256k1Data}}]};FunctionCallPermission={struct:{allowance:{option:"u128"},receiverId:"string",methodNames:{array:{type:"string"}}}};FullAccessPermission={struct:{}};AccessKeyPermission={enum:[{struct:{functionCall:this.FunctionCallPermission}},{struct:{fullAccess:this.FullAccessPermission}}]};AccessKey={struct:{nonce:"u64",permission:this.AccessKeyPermission}};CreateAccount={struct:{}};DeployContract={struct:{code:{array:{type:"u8"}}}};FunctionCall={struct:{methodName:"string",args:{array:{type:"u8"}},gas:"u64",deposit:"u128"}};Transfer={struct:{deposit:"u128"}};Stake={struct:{stake:"u128",publicKey:this.PublicKey}};AddKey={struct:{publicKey:this.PublicKey,accessKey:this.AccessKey}};DeleteKey={struct:{publicKey:this.PublicKey}};DeleteAccount={struct:{beneficiaryId:"string"}};GlobalContractDeployMode={enum:[{struct:{CodeHash:{struct:{}}}},{struct:{AccountId:{struct:{}}}}]};GlobalContractIdentifier={enum:[{struct:{CodeHash:{array:{type:"u8",len:32}}}},{struct:{AccountId:"string"}}]};DeployGlobalContract={struct:{code:{array:{type:"u8"}},deployMode:this.GlobalContractDeployMode}};UseGlobalContract={struct:{contractIdentifier:this.GlobalContractIdentifier}};DelegateActionPrefix={struct:{prefix:"u32"}};ClassicActions={enum:[{struct:{createAccount:this.CreateAccount}},{struct:{deployContract:this.DeployContract}},{struct:{functionCall:this.FunctionCall}},{struct:{transfer:this.Transfer}},{struct:{stake:this.Stake}},{struct:{addKey:this.AddKey}},{struct:{deleteKey:this.DeleteKey}},{struct:{deleteAccount:this.DeleteAccount}},{struct:{signedDelegate:"string"}},{struct:{deployGlobalContract:this.DeployGlobalContract}},{struct:{useGlobalContract:this.UseGlobalContract}}]};DelegateAction={struct:{senderId:"string",receiverId:"string",actions:{array:{type:this.ClassicActions}},nonce:"u64",maxBlockHeight:"u64",publicKey:this.PublicKey}};SignedDelegate={struct:{delegateAction:this.DelegateAction,signature:this.Signature}};Action={enum:[{struct:{createAccount:this.CreateAccount}},{struct:{deployContract:this.DeployContract}},{struct:{functionCall:this.FunctionCall}},{struct:{transfer:this.Transfer}},{struct:{stake:this.Stake}},{struct:{addKey:this.AddKey}},{struct:{deleteKey:this.DeleteKey}},{struct:{deleteAccount:this.DeleteAccount}},{struct:{signedDelegate:this.SignedDelegate}},{struct:{deployGlobalContract:this.DeployGlobalContract}},{struct:{useGlobalContract:this.UseGlobalContract}}]};Transaction={struct:{signerId:"string",publicKey:this.PublicKey,nonce:"u64",receiverId:"string",blockHash:{array:{type:"u8",len:32}},actions:{array:{type:this.Action}}}};SignedTransaction={struct:{transaction:this.Transaction,signature:this.Signature}}}},20791:(e,t,r)=>{"use strict";r.d(t,{t:()=>s});var n=r(91132),i=r(55816);function o(e){switch(e){case n._.ED25519:return"ed25519Signature";case n._.SECP256K1:return"secp256k1Signature";default:throw Error(`unknown type ${e}`)}}class s extends i.g{enum;ed25519Signature;secp256k1Signature;
41constructor(e){let t=o(e.keyType);super({[t]:e}),this[t]=e,this.enum=t}get signature(){return this.ed25519Signature||this.secp256k1Signature}get signatureType(){return this.signature.keyType}get data(){return this.signature.data}}},55816:(e,t,r)=>{"use strict";r.d(t,{g:()=>n});class n{constructor(e){if(1!==Object.keys(e).length)throw Error("Enum can only take single value");Object.keys(e).map(t=>{this[t]=e[t]})}}},16658:(e,t,r)=>{"use strict";r.d(t,{Ir:()=>o,TI:()=>i,ee:()=>n});class n extends Error{constructor(){super("Contract method calls expect named arguments wrapped in object, e.g. { argName1: argValue1, argName2: argValue2 }")}}class i extends Error{type;context;constructor(e,t,r){super(e),this.type=t||"UntypedError",this.context=r}}class o{transactionHash;constructor(e){this.transactionHash=e}}},15363:(e,t,r)=>{"use strict";r.d(t,{Dj:()=>S,I0:()=>c,KN:()=>m,MO:()=>I,ND:()=>E,Nl:()=>k,Vy:()=>M,Wk:()=>x,aP:()=>g,g9:()=>C,gP:()=>w,rg:()=>N,sz:()=>j});var n=r(16658),i=r(2139),o=r(63947),s=r(29905),a=r(75927).Buffer,c=30000000000000n,u={GasLimitExceeded:"Exceeded the maximum amount of gas allowed to burn per contract",MethodEmptyName:"Method name is empty",WasmerCompileError:"Wasmer compilation error: {{msg}}",GuestPanic:"Smart contract panicked: {{panic_msg}}",Memory:"Error creating Wasm memory",GasExceeded:"Exceeded the prepaid gas",MethodUTF8Error:"Method name is not valid UTF8 string",BadUTF16:"String encoding is bad UTF-16 sequence",WasmTrap:"WebAssembly trap: {{msg}}",GasInstrumentation:"Gas instrumentation failed or contract has denied instructions.",InvalidPromiseIndex:"{{promise_idx}} does not correspond to existing promises",InvalidPromiseResultIndex:"Accessed invalid promise result index: {{result_idx}}",Deserialization:"Error happened while deserializing the module",MethodNotFound:"Contract method is not found",InvalidRegisterId:"Accessed invalid register id: {{register_id}}",InvalidReceiptIndex:"VM Logic returned an invalid receipt index: {{receipt_index}}",EmptyMethodName:"Method name is empty in contract call",CannotReturnJointPromise:"Returning joint promise is currently prohibited",StackHeightInstrumentation:"Stack instrumentation failed",CodeDoesNotExist:"Cannot find contract code for account {{account_id}}",MethodInvalidSignature:"Invalid method signature",IntegerOverflow:"Integer overflow happened during contract execution",MemoryAccessViolation:"MemoryAccessViolation",InvalidIteratorIndex:"Iterator index {{iterator_index}} does not exist",IteratorWasInvalidated:"Iterator {{iterator_index}} was invalidated after its creation by performing a mutable operation on trie",InvalidAccountId:"VM Logic returned an invalid account id",Serialization:"Error happened while serializing the module",CannotAppendActionToJointPromise:"Actions can only be appended to non-joint promise.",InternalMemoryDeclared:"Internal memory declaration has been found in the module",Instantiate:"Error happened during instantiation",ProhibitedInView:"{{method_name}} is not allowed in view calls",InvalidMethodName:"VM Logic returned an invalid method name",BadUTF8:"String encoding is bad UTF-8 sequence",BalanceExceeded:"Exceeded the account balance",LinkError:"Wasm contract link error: {{msg}}",InvalidPublicKey:"VM Logic provided an invalid public key",ActorNoPermission:"Actor {{actor_id}} doesn't have permission to account {{account_id}} to complete the action",LackBalanceForState:"The account {{account_id}} wouldn't have enough balance to cover storage, required to have {{amount}} yoctoNEAR more",ReceiverMismatch:"Wrong AccessKey used for transaction: transaction is sent to receiver_id={{tx_receiver}}, but is signed with function call access key that restricted to only use with receiver_id={{ak_receiver}}. Either change receiver_id in your transaction or switch to use a FullAccessKey.",CostOverflow:"Transaction gas or balance cost is too high",InvalidSignature:"Transaction is not signed with the given public key",AccessKeyNotFound:'Signer "{{account_id}}" doesn\'t have access key with the given public_key {{public_key}}',NotEnoughBalance:"Sender {{signer_id}} does not have enough balance {{#formatNear}}{{balance}}{{/formatNear}} for operation costing {{#formatNear}}{{cost}}{{/formatNear}}",NotEnoughAllowance:"Access Key {account_id}:{public_key} does not have enough balance {{#formatNear}}{{allowance}}{{/formatNear}} for transaction costing {{#formatNear}}{{cost}}{{/formatNear}}",Expired:"Transaction has expired",DeleteAccountStaking:"Account {{account_id}} is staking and can not be deleted",SignerDoesNotExist:"Signer {{signer_id}} does not exist",TriesToStake:"Account {{account_id}} tried to stake {{#formatNear}}{{stake}}{{/formatNear}}, but has staked {{#formatNear}}{{locked}}{{/formatNear}} and only has {{#formatNear}}{{balance}}{{/formatNear}}",AddKeyAlreadyExists:"The public key {{public_key}} is already used for an existing access key",InvalidSigner:"Invalid signer account ID {{signer_id}} according to requirements",CreateAccountNotAllowed:"The new account_id {{account_id}} can't be created by {{predecessor_id}}",RequiresFullAccess:"The transaction contains more then one action, but it was signed with an access key which allows transaction to apply only one specific action. To apply more then one actions TX must be signed with a full access key",TriesToUnstake:"Account {{account_id}} is not yet staked, but tried to unstake",InvalidNonce:"Transaction nonce {{tx_nonce}} must be larger than nonce of the used access key {{ak_nonce}}",AccountAlreadyExists:"Can't create a new account {{account_id}}, because it already exists",InvalidChain:"Transaction parent block hash doesn't belong to the current chain",AccountDoesNotExist:"Can't complete the action because account {{account_id}} doesn't exist",AccessKeyDoesNotExist:"Can't complete the action because access key {{public_key}}
41 doesn't exist",MethodNameMismatch:"Transaction method name {{method_name}} isn't allowed by the access key",DeleteAccountHasRent:"Account {{account_id}} can't be deleted. It has {{#formatNear}}{{balance}}{{/formatNear}}, which is enough to cover the rent",DeleteAccountHasEnoughBalance:"Account {{account_id}} can't be deleted. It has {{#formatNear}}{{balance}}{{/formatNear}}, which is enough to cover it's storage",InvalidReceiver:"Invalid receiver account ID {{receiver_id}} according to requirements",DeleteKeyDoesNotExist:"Account {{account_id}} tries to remove an access key that doesn't exist",Timeout:"Timeout exceeded",Closed:"Connection closed",ShardCongested:"Shard {{shard_id}} rejected the transaction due to congestion level {{congestion_level}}, try again later",ShardStuck:"Shard {{shard_id}} rejected the transaction because it missed {{missed_chunks}} chunks and needs to recover before accepting new transactions, try again later"},l=24;BigInt(24);var d=[],f=10n;for(let e=0,t=5n;e<l;e++,t*=f)d[e]=t;function h(e,t=l){let r=BigInt(e);if(t!==l){let e=l-t-1;e>0&&(r+=d[e])}let n=(e=r.toString()).substring(0,e.length-l)||"0",i=e.substring(e.length-l).padStart(l,"0").substring(0,t);return p(`${y(n)}.${i}`)}function p(e){return e.replace(/\.?0*$/,"")}function y(e){let t=/(-?\d+)(\d{3})/;for(;t.test(e);)e=e.replace(t,"$1,$2");return e}function g(e){if("string"==typeof e){let t=[];for(let r=0;r<e.length;r++)t.push(e.charCodeAt(r));e=new Uint8Array(t)}return o.tw.encode(e)}function m(e){return o.tw.decode(e)}var b={schema:{AccessKeyNotFound:{name:"AccessKeyNotFound",subtypes:[],props:{account_id:"",public_key:""}},AccountAlreadyExists:{name:"AccountAlreadyExists",subtypes:[],props:{account_id:""}},AccountDoesNotExist:{name:"AccountDoesNotExist",subtypes:[],props:{account_id:""}},ActionError:{name:"ActionError",subtypes:["AccountAlreadyExists","AccountDoesNotExist","CreateAccountOnlyByRegistrar","CreateAccountNotAllowed","ActorNoPermission","DeleteKeyDoesNotExist","AddKeyAlreadyExists","DeleteAccountStaking","LackBalanceForState","TriesToUnstake","TriesToStake","InsufficientStake","FunctionCallError","NewReceiptValidationError","OnlyImplicitAccountCreationAllowed","DeleteAccountWithLargeState","DelegateActionInvalidSignature","DelegateActionSenderDoesNotMatchTxReceiver","DelegateActionExpired","DelegateActionAccessKeyError","DelegateActionInvalidNonce","DelegateActionNonceTooLarge"],props:{index:""}},ActionsValidationError:{name:"ActionsValidationError",subtypes:["DeleteActionMustBeFinal","TotalPrepaidGasExceeded","TotalNumberOfActionsExceeded","AddKeyMethodNamesNumberOfBytesExceeded","AddKeyMethodNameLengthExceeded","IntegerOverflow","InvalidAccountId","ContractSizeExceeded","FunctionCallMethodNameLengthExceeded","FunctionCallArgumentsLengthExceeded","UnsuitableStakingKey","FunctionCallZeroAttachedGas","DelegateActionMustBeOnlyOne","UnsupportedProtocolFeature"],props:{}},ActorNoPermission:{name:"ActorNoPermission",subtypes:[],props:{account_id:"",actor_id:""}},AddKeyAlreadyExists:{name:"AddKeyAlreadyExists",subtypes:[],props:{account_id:"",public_key:""}},AddKeyMethodNameLengthExceeded:{name:"AddKeyMethodNameLengthExceeded",subtypes:[],props:{length:"",limit:""}},AddKeyMethodNamesNumberOfBytesExceeded:{name:"AddKeyMethodNamesNumberOfBytesExceeded",subtypes:[],props:{limit:"",total_number_of_bytes:""}},AltBn128InvalidInput:{name:"AltBn128InvalidInput",subtypes:[],props:{msg:""}},BadUTF16:{name:"BadUTF16",subtypes:[],props:{}},BadUTF8:{name:"BadUTF8",subtypes:[],props:{}},BalanceExceeded:{name:"BalanceExceeded",subtypes:[],props:{}},BalanceMismatchError:{name:"BalanceMismatchError",subtypes:[],props:{final_accounts_balance:"",final_postponed_receipts_balance:"",forwarded_buffered_receipts_balance:"",incoming_receipts_balance:"",incoming_validator_rewards:"",initial_accounts_balance:"",initial_postponed_receipts_balance:"",new_buffered_receipts_balance:"",new_delayed_receipts_balance:"",other_burnt_amount:"",outgoing_receipts_balance:"",processed_delayed_receipts_balance:"",slashed_burnt_amount:"",tx_burnt_amount:""}},CallIndirectOOB:{name:"CallIndirectOOB",subtypes:[],props:{}},CannotAppendActionToJointPromise:{name:"CannotAppendActionToJointPromise",subtypes:[],props:{}},CannotReturnJointPromise:{name:"CannotReturnJointPromise",subtypes:[],props:{}},CodeDoesNotExist:{name:"CodeDoesNotExist",subtypes:[],props:{account_id:""}},CompilationError:{name:"CompilationError",subtypes:["CodeDoesNotExist","PrepareError","WasmerCompileError"],props:{}},ContractSizeExceeded:{name:"ContractSizeExceeded",subtypes:[],props:{limit:"",size:""}},CostOverflow:{name:"CostOverflow",subtypes:[],props:{}},CreateAccountNotAllowed:{name:"CreateAccountNotAllowed",subtypes:[],props:{account_id:"",predecessor_id:""}},CreateAccountOnlyByRegistrar:{name:"CreateAccountOnlyByRegistrar",subtypes:[],props:{account_id:"",predecessor_id:"",registrar_account_id:""}},DelegateActionExpired:{name:"DelegateActionExpired",subtypes:[],props:{}},DelegateActionInvalidNonce:{name:"DelegateActionInvalidNonce",subtypes:[],props:{ak_nonce:"",delegate_nonce:""}},DelegateActionInvalidSignature:{name:"DelegateActionInvalidSignature",subtypes:[],props:{}},DelegateActionMustBeOnlyOne:{name:"DelegateActionMustBeOnlyOne",subtypes:[],props:{}},DelegateActionNonceTooLarge:{name:"DelegateActionNonceTooLarge",subtypes:[],props:{delegate_nonce:"",upper_bound:""}},DelegateActionSenderDoesNotMatchTxReceiver:{name:"DelegateActionSenderDoesNotMatchTxReceiver",subtypes:[],props:{receiver_id:"",sender_id:""}},DeleteAccountStaking:{name:"DeleteAccountStaking",subtypes:[],props:{account_id:""}},DeleteAccountWithLargeState:{name:"DeleteAccountWithLargeState",subtypes:[],props:{account_id:""}},DeleteActionMustBeFinal:{name:"DeleteActionMustBeFinal",subtypes:[],props:{}},DeleteKeyDoesNotExist:{name:"DeleteKeyDoesNotExist",subtypes:[],props:{account_id:"",public_key:""}},DepositWithFunctionCall:{name:"DepositWithFunctionCall",subtypes:[],props:{}},Deprecated:{name:"Deprecated",subtypes:[],props:{method_name:""}},Deserialization:{name:"Deserialization",subtypes:[],props:{}}
41,ECRecoverError:{name:"ECRecoverError",subtypes:[],props:{msg:""}},Ed25519VerifyInvalidInput:{name:"Ed25519VerifyInvalidInput",subtypes:[],props:{msg:""}},EmptyMethodName:{name:"EmptyMethodName",subtypes:[],props:{}},Expired:{name:"Expired",subtypes:[],props:{}},FunctionCallArgumentsLengthExceeded:{name:"FunctionCallArgumentsLengthExceeded",subtypes:[],props:{length:"",limit:""}},FunctionCallMethodNameLengthExceeded:{name:"FunctionCallMethodNameLengthExceeded",subtypes:[],props:{length:"",limit:""}},FunctionCallZeroAttachedGas:{name:"FunctionCallZeroAttachedGas",subtypes:[],props:{}},GasExceeded:{name:"GasExceeded",subtypes:[],props:{}},GasInstrumentation:{name:"GasInstrumentation",subtypes:[],props:{}},GasLimitExceeded:{name:"GasLimitExceeded",subtypes:[],props:{}},GenericTrap:{name:"GenericTrap",subtypes:[],props:{}},GuestPanic:{name:"GuestPanic",subtypes:[],props:{panic_msg:""}},HostError:{name:"HostError",subtypes:["BadUTF16","BadUTF8","GasExceeded","GasLimitExceeded","BalanceExceeded","EmptyMethodName","GuestPanic","IntegerOverflow","InvalidPromiseIndex","CannotAppendActionToJointPromise","CannotReturnJointPromise","InvalidPromiseResultIndex","InvalidRegisterId","IteratorWasInvalidated","MemoryAccessViolation","InvalidReceiptIndex","InvalidIteratorIndex","InvalidAccountId","InvalidMethodName","InvalidPublicKey","ProhibitedInView","NumberOfLogsExceeded","KeyLengthExceeded","ValueLengthExceeded","TotalLogLengthExceeded","NumberPromisesExceeded","NumberInputDataDependenciesExceeded","ReturnedValueLengthExceeded","ContractSizeExceeded","Deprecated","ECRecoverError","AltBn128InvalidInput","Ed25519VerifyInvalidInput"],props:{}},IllegalArithmetic:{name:"IllegalArithmetic",subtypes:[],props:{}},IncorrectCallIndirectSignature:{name:"IncorrectCallIndirectSignature",subtypes:[],props:{}},IndirectCallToNull:{name:"IndirectCallToNull",subtypes:[],props:{}},Instantiate:{name:"Instantiate",subtypes:[],props:{}},InsufficientStake:{name:"InsufficientStake",subtypes:[],props:{account_id:"",minimum_stake:"",stake:""}},IntegerOverflow:{name:"IntegerOverflow",subtypes:[],props:{}},InternalMemoryDeclared:{name:"InternalMemoryDeclared",subtypes:[],props:{}},InvalidAccessKeyError:{name:"InvalidAccessKeyError",subtypes:["AccessKeyNotFound","ReceiverMismatch","MethodNameMismatch","RequiresFullAccess","NotEnoughAllowance","DepositWithFunctionCall"],props:{}},InvalidAccountId:{name:"InvalidAccountId",subtypes:[],props:{}},InvalidChain:{name:"InvalidChain",subtypes:[],props:{}},InvalidDataReceiverId:{name:"InvalidDataReceiverId",subtypes:[],props:{account_id:""}},InvalidIteratorIndex:{name:"InvalidIteratorIndex",subtypes:[],props:{iterator_index:""}},InvalidMethodName:{name:"InvalidMethodName",subtypes:[],props:{}},InvalidNonce:{name:"InvalidNonce",subtypes:[],props:{ak_nonce:"",tx_nonce:""}},InvalidPredecessorId:{name:"InvalidPredecessorId",subtypes:[],props:{account_id:""}},InvalidPromiseIndex:{name:"InvalidPromiseIndex",subtypes:[],props:{promise_idx:""}},InvalidPromiseResultIndex:{name:"InvalidPromiseResultIndex",subtypes:[],props:{result_idx:""}},InvalidPublicKey:{name:"InvalidPublicKey",subtypes:[],props:{}},InvalidReceiptIndex:{name:"InvalidReceiptIndex",subtypes:[],props:{receipt_index:""}},InvalidReceiverId:{name:"InvalidReceiverId",subtypes:[],props:{account_id:""}},InvalidRegisterId:{name:"InvalidRegisterId",subtypes:[],props:{register_id:""}},InvalidSignature:{name:"InvalidSignature",subtypes:[],props:{}},InvalidSignerId:{name:"InvalidSignerId",subtypes:[],props:{account_id:""}},InvalidTxError:{name:"InvalidTxError",subtypes:["InvalidAccessKeyError","InvalidSignerId","SignerDoesNotExist","InvalidNonce","NonceTooLarge","InvalidReceiverId","InvalidSignature","NotEnoughBalance","LackBalanceForState","CostOverflow","InvalidChain","Expired","ActionsValidation","TransactionSizeExceeded","StorageError","ShardCongested","ShardStuck"],props:{}},IteratorWasInvalidated:{name:"IteratorWasInvalidated",subtypes:[],props:{iterator_index:""}},KeyLengthExceeded:{name:"KeyLengthExceeded",subtypes:[],props:{length:"",limit:""}},LackBalanceForState:{name:"LackBalanceForState",subtypes:[],props:{account_id:"",amount:""}},Memory:{name:"Memory",subtypes:[],props:{}},MemoryAccessViolation:{name:"MemoryAccessViolation",subtypes:[],props:{}},MemoryOutOfBounds:{name:"MemoryOutOfBounds",subtypes:[],props:{}},MethodEmptyName:{name:"MethodEmptyName",subtypes:[],props:{}},MethodInvalidSignature:{name:"MethodInvalidSignature",subtypes:[],props:{}},MethodNameMismatch:{name:"MethodNameMismatch",subtypes:[],props:{method_name:""}},MethodNotFound:{name:"MethodNotFound",subtypes:[],props:{}},MethodResolveError:{name:"MethodResolveError",subtypes:["MethodEmptyName","MethodNotFound","MethodInvalidSignature"],props:{}},MisalignedAtomicAccess:{name:"MisalignedAtomicAccess",subtypes:[],props:{}},NonceTooLarge:{name:"NonceTooLarge",subtypes:[],props:{tx_nonce:"",upper_bound:""}},NotEnoughAllowance:{name:"NotEnoughAllowance",subtypes:[],props:{account_id:"",allowance:"",cost:"",public_key:""}},NotEnoughBalance:{name:"NotEnoughBalance",subtypes:[],props:{balance:"",cost:"",signer_id:""}},NumberInputDataDependenciesExceeded:{name:"NumberInputDataDependenciesExceeded",subtypes:[],props:{limit:"",number_of_input_data_dependencies:""}},NumberOfLogsExceeded:{name:"NumberOfLogsExceeded",subtypes:[],props:{limit:""}},NumberPromisesExceeded:{name:"NumberPromisesExceeded",subtypes:[],props:{limit:"",number_of_promises:""}},OnlyImplicitAccountCreationAllowed:{name:"OnlyImplicitAccountCreationAllowed",subtypes:[],props:{account_id:""}},PrepareError:{name:"PrepareError",subtypes:["Serialization","Deserialization","InternalMemoryDeclared","GasInstrumentation","StackHeightInstrumentation","Instantiate","Memory","TooManyFunctions","TooManyLocals"],props:{}},ProhibitedInView:{name:"ProhibitedInView",subtypes:[],props:{method_name:""}},ReceiptSizeExceeded:{name:"ReceiptSizeExceeded",subtypes:[],props:{limit:"",size:""}},ReceiptValidationError:{name:"ReceiptValidationError",subtypes:["InvalidPredecessorId","InvalidReceiverId","InvalidSignerId","InvalidDataReceiverId","ReturnedValueLengthExceeded","NumberInputDataDependenciesExceeded","ActionsValidation","ReceiptSizeExceeded"],props:{}},ReceiverMismatch:{name:"ReceiverMismatch",subtypes:[],props:{ak_receiver:"",tx_re
41ceiver:""}},RequiresFullAccess:{name:"RequiresFullAccess",subtypes:[],props:{}},ReturnedValueLengthExceeded:{name:"ReturnedValueLengthExceeded",subtypes:[],props:{length:"",limit:""}},Serialization:{name:"Serialization",subtypes:[],props:{}},ShardCongested:{name:"ShardCongested",subtypes:[],props:{congestion_level:"",shard_id:""}},ShardStuck:{name:"ShardStuck",subtypes:[],props:{missed_chunks:"",shard_id:""}},SignerDoesNotExist:{name:"SignerDoesNotExist",subtypes:[],props:{signer_id:""}},StackHeightInstrumentation:{name:"StackHeightInstrumentation",subtypes:[],props:{}},StackOverflow:{name:"StackOverflow",subtypes:[],props:{}},TooManyFunctions:{name:"TooManyFunctions",subtypes:[],props:{}},TooManyLocals:{name:"TooManyLocals",subtypes:[],props:{}},TotalLogLengthExceeded:{name:"TotalLogLengthExceeded",subtypes:[],props:{length:"",limit:""}},TotalNumberOfActionsExceeded:{name:"TotalNumberOfActionsExceeded",subtypes:[],props:{limit:"",total_number_of_actions:""}},TotalPrepaidGasExceeded:{name:"TotalPrepaidGasExceeded",subtypes:[],props:{limit:"",total_prepaid_gas:""}},TransactionSizeExceeded:{name:"TransactionSizeExceeded",subtypes:[],props:{limit:"",size:""}},TriesToStake:{name:"TriesToStake",subtypes:[],props:{account_id:"",balance:"",locked:"",stake:""}},TriesToUnstake:{name:"TriesToUnstake",subtypes:[],props:{account_id:""}},TxExecutionError:{name:"TxExecutionError",subtypes:["ActionError","InvalidTxError"],props:{}},Unreachable:{name:"Unreachable",subtypes:[],props:{}},UnsuitableStakingKey:{name:"UnsuitableStakingKey",subtypes:[],props:{public_key:""}},UnsupportedProtocolFeature:{name:"UnsupportedProtocolFeature",subtypes:[],props:{protocol_feature:"",version:""}},ValueLengthExceeded:{name:"ValueLengthExceeded",subtypes:[],props:{length:"",limit:""}},WasmTrap:{name:"WasmTrap",subtypes:["Unreachable","IncorrectCallIndirectSignature","MemoryOutOfBounds","CallIndirectOOB","IllegalArithmetic","MisalignedAtomicAccess","IndirectCallToNull","StackOverflow","GenericTrap"],props:{}},WasmerCompileError:{name:"WasmerCompileError",subtypes:[],props:{msg:""}},Closed:{name:"Closed",subtypes:[],props:{}},ServerError:{name:"ServerError",subtypes:["TxExecutionError","Timeout","Closed"],props:{}},Timeout:{name:"Timeout",subtypes:[],props:{}}}},v={formatNear:()=>(e,t)=>h(t(e))},w=class extends n.TI{},_=class extends w{transaction_outcome};function E(e){let t={},r=A(e,b.schema,t,""),n=new w(x(r,t),r);return Object.assign(n,t),n}function S(e){let t=E(e.status.Failure),r=new _;return Object.assign(r,t),r.type=t.type,r.message=t.message,r.transaction_outcome=e.transaction_outcome,r}function x(e,t){return"string"==typeof u[e]?i.render(u[e],{...t,...v}):JSON.stringify(t)}function A(e,t,r,n){let i,o,s;for(let r in t){if(T(e[r]))return e[r];if(O(e[r]))i=e[r],o=t[r],s=r;else{if(!(O(e.kind)&&O(e.kind[r])))continue;i=e.kind[r],o=t[r],s=r}}if(!i||!o)return r.kind=e,n;for(let e of Object.keys(o.props))r[e]=i[e];return A(i,t,r,s)}function I(e,t){switch(!0){case/^account .*? does not exist while viewing$/.test(e):case/^Account .*? doesn't exist$/.test(e):return"AccountDoesNotExist";case/^access key .*? does not exist while viewing$/.test(e):return"AccessKeyDoesNotExist";case/wasm execution failed with error: FunctionCallError\(CompilationError\(CodeDoesNotExist/.test(e):case/wasm execution failed with error: CompilationError\(CodeDoesNotExist/.test(e):return"CodeDoesNotExist";case/wasm execution failed with error: FunctionCallError\(MethodResolveError\(MethodNotFound/.test(e):case/wasm execution failed with error: MethodResolveError\(MethodNotFound/.test(e):return"MethodNotFound";case/Transaction nonce \d+ must be larger than nonce of the used access key \d+/.test(e):return"InvalidNonce";default:return t}}function O(e){return"[object Object]"===Object.prototype.toString.call(e)}function T(e){return"[object String]"===Object.prototype.toString.call(e)}var P=new class{constructor(e){this.logLevels=e}isLevelEnabled=e=>this.logLevels.includes(e);print(e,t,...r){switch(e){case"error":case"fatal":return console.error(t,...r);case"warn":return console.warn(t,...r);case"log":return console.log(t,...r);case"debug":case"verbose":return console.debug(t,...r)}}verbose(e,...t){this.isLevelEnabled("verbose")&&this.print("verbose",e,...t)}debug(e,...t){this.isLevelEnabled("debug")&&this.print("debug",e,...t)}log(e,...t){this.isLevelEnabled("log")&&this.print("log",e,...t)}warn(e,...t){this.isLevelEnabled("warn")&&this.print("warn",e,...t)}error(e,...t){this.isLevelEnabled("error")&&this.print("error",e,...t)}fatal(e,...t){this.isLevelEnabled("fatal")&&this.print("fatal",e,...t)}}
41(["verbose","debug","log","warn","error","fatal"]),M=class{static instanceRef=P;static overrideLogger=e=>{this.instanceRef=e};static error(e,...t){this.instanceRef?.error(e,...t)}static log(e,...t){this.instanceRef?.log(e,...t)}static warn(e,...t){this.instanceRef?.warn(e,...t)}static debug(e,...t){this.instanceRef?.debug?.(e,...t)}static verbose(e,...t){this.instanceRef?.verbose?.(e,...t)}static fatal(e,...t){this.instanceRef?.fatal?.(e,...t)}};function N({contractId:e,outcome:t}){for(let r of[t.transaction_outcome,...t.receipts_outcome].reduce((e,t)=>{let r="object"==typeof t.outcome.status&&"object"==typeof t.outcome.status.Failure;return t.outcome.logs.length||r?e.concat({receiptIds:t.outcome.receipt_ids,logs:t.outcome.logs,failure:"object"==typeof t.outcome.status&&void 0!==t.outcome.status.Failure?E(t.outcome.status.Failure):null}):e},[]))M.log(`Receipt${r.receiptIds.length>1?"s":""}: ${r.receiptIds.join(", ")}`),k({contractId:e,logs:r.logs,prefix:" "}),r.failure&&M.warn(` Failure [${e}]: ${r.failure}`)}function k({contractId:e,logs:t,prefix:r=""}){for(let n of t)M.log(`${r}Log [${e}]: ${n}`)}function C(e){if("object"==typeof e.status&&"string"==typeof e.status.SuccessValue){let t=a.from(e.status.SuccessValue,"base64").toString();try{return JSON.parse(t)}catch(e){return t}}return null}function D(e,t){return e<t?-1:e>t?1:0}function j(e,t,r,n){return n&&n<49?R(e,t):(r||(s("findSeatPrice(validators, maxNumberOfSeats)")("`use `findSeatPrice(validators, maxNumberOfSeats, minimumStakeRatio)` instead"),r=[1,6250]),L(e,t,r))}function R(e,t){let r=e.map(e=>BigInt(e.stake)).sort(D),n=BigInt(t),i=r.reduce((e,t)=>e+t);if(i<n)throw Error("Stakes are below seats");let o=1n,s=i+1n;for(;o!==s-1n;){let e=(o+s)/2n,t=!1,i=0n;for(let s=0;s<r.length;++s)if((i+=r[s]/e)>=n){o=e,t=!0;break}t||(s=e)}return o}function L(e,t,r){if(2!=r.length)throw Error("minimumStakeRatio should have 2 elements");let n=e.map(e=>BigInt(e.stake)).sort(D),i=n.reduce((e,t)=>e+t);return e.length<t?i*BigInt(r[0])/BigInt(r[1]):n[0]+1n}},20011:(e,t,r)=>{"use strict";r.d(t,{D:()=>sJ});var n,i,o,s,a,c,u,l,d,f,h,p,y,g,m,b,v,w,_,E,S,x,A,I,O=r(22392);let{transactions:T,utils:P}=r.t(O,2),M=e=>{if("FullAccess"===e)return T.fullAccessKey();let{receiverId:t,methodNames:r=[]}=e,n=e.allowance?BigInt(e.allowance):void 0;return T.functionCallAccessKey(t,r,n)},N=e=>{switch(e.type){case"CreateAccount":return T.createAccount();case"DeployContract":{let{code:t}=e.params;return T.deployContract(t)}case"FunctionCall":{let{methodName:t,args:r,gas:n,deposit:i}=e.params;return T.functionCall(t,r,BigInt(n),BigInt(i))}case"Transfer":{let{deposit:t}=e.params;return T.transfer(BigInt(t))}case"Stake":{let{stake:t,publicKey:r}=e.params;return T.stake(BigInt(t),P.PublicKey.from(r))}case"AddKey":{let{publicKey:t,accessKey:r}=e.params;return T.addKey(P.PublicKey.from(t),M(r.permission))}case"DeleteKey":{let{publicKey:t}=e.params;return T.deleteKey(P.PublicKey.from(t))}case"DeleteAccount":{let{beneficiaryId:t}=e.params;return T.deleteAccount(t)}default:throw Error("Invalid action type")}};var k="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},C=function(e){try{return!!e()}catch(e){return!0}},D={}.toString,j=function(e){return D.call(e).slice(8,-1)},R=C,L=j,B="".split,U=R(function(){return!Object("z").propertyIsEnumerable(0)})?function(e){return"String"==L(e)?B.call(e,""):Object(e)}:Object,$=function(e){if(void 0==e)throw TypeError("Can't call method on "+e);return e},K=U,F=$,z=function(e){return K(F(e))},q=function(e){return e&&e.Math==Math&&e},V=q("object"==typeof globalThis&&globalThis)||q("object"==typeof window&&window)||q("object"==typeof self&&self)||q("object"==typeof k&&k)||Function("return this")(),H={exports:{}},G=!C(function(){return 7!=Object.defineProperty({},1,{get:function(){return 7}})[1]}),W={},J=function(e){return"object"==typeof e?null!==e:"function"==typeof e},Z=J,Y=V.document,X=Z(Y)&&Z(Y.createElement),Q=function(e){return X?Y.createElement(e):{}},ee=C,et=Q,er=!G&&!ee(function(){return 7!=Object.defineProperty(et("div"),"a",{get:function(){return 7}}).a}),en=J,ei=function(e){if(!en(e))throw TypeError(String(e)+" is not an object");return e},eo=J,es=function(e,t){var r,n;if(!eo(e))return e;if(t&&"function"==typeof(r=e.toString)&&!eo(n=r.call(e))||"function"==typeof(r=e.valueOf)&&!eo(n=r.call(e))||!t&&"function"==typeof(r=e.toString)&&!eo(n=r.call(e)))return n;throw TypeError("Can't convert object to primitive value")},ea=G,ec=er,eu=ei,el=es,ed=Object.defineProperty;W.f=ea?ed:function(e,t,r){if(eu(e),t=el(t,!0),eu(r),ec)try{return ed(e,t,r)}catch(e){}if("get"in r||"set"in r)throw TypeError("Accessors not supported");return"value"in r&&(e[t]=r.value),e};var ef=function(e,t){return{enumerable:!(1&e),configurable:!(2&e),writable:!(4&e),value:t}},eh=W,ep=ef,ey=G?function(e,t,r){return eh.f(e,t,ep(1,r))}:function(e,t,r){return e[t]=r,e},eg=V,em=ey,eb=function(e,t){try{em(eg,e,t)}catch(r){eg[e]=t}return t},ev=eb,ew="__core-js_shared__",e_=V[ew]||ev(ew,{}),eE=e_;(H.exports=function(e,t){return eE[e]||(eE[e]=void 0!==t?t:{})})("versions",[]).push({version:"3.6.5",mode:"global",copyright:"\xa9 2020 Denis Pushkarev (zloirock.ru)"});var eS={}.hasOwnProperty,ex=function(e,t){return eS.call(e,t)},eA=0,eI=Math.random(),eO=function(e){return"Symbol("+String(void 0===e?"":e)+")_"+(++eA+eI).toString(36)},eT=C,eP=!!Object.getOwnPropertySymbols&&!eT(function(){return!String(Symbol())}),eM=eP&&!Symbol.sham&&"symbol"==typeof Symbol.iterator,eN=V,ek=H.exports,eC=ex,eD=eO,ej=eP,eR=eM,eL=ek("wks"),eB=eN.Symbol,eU=eR?eB:eB&&eB.withoutSetter||eD,e$=function(e){return eC(eL,e)||(ej&&eC(eB,e)?eL[e]=eB[e]:eL[e]=eU("Symbol."+e)),eL[e]},eK=Math.ceil,eF=Math.floor,ez=function(e){return isNaN(e=+e)?0:(e>0?eF:eK)(e)},eq=ez,eV=Math.min,eH=function(e){return e>0?eV(eq(e),0x1fffffffffffff):0},eG=ez,eW=Math.max,eJ=Math.min,eZ=z,eY=eH,eX=function(e,t){var r=eG(e);return r<0?eW(r+t,0):eJ(r,t)},eQ=function(e){return function(t,r,n){var i,o=eZ(t),s=eY(o.length),a=eX(n,s);if(e&&r!=r){for(;s>a;)if((i=o[a++])!=i)return!0}else for(;s>a;a++)if((e||a in o)&&o[a]===r)return e||a||0;return!e&&-1}},e0={includes:eQ(!0),indexOf:eQ(!1)},e1={},e2=ex,e5=z,e3=e0.indexOf,e8=e1,e6=function(e,t){var r,n=e5(e),i=0,o=[];for(r in n)!e2(e8,r)&&e2(n,r)&&o.push(r);for(;t.length>i;)e2(n,r=t[i++])&&(~e3(o,r)||o.push(r));return o},e4=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleStr
41ing","toString","valueOf"],e9=e6,e7=e4,te=W,tt=ei,tr=Object.keys||function(e){return e9(e,e7)},tn=G?Object.defineProperties:function(e,t){tt(e);for(var r,n=tr(t),i=n.length,o=0;i>o;)te.f(e,r=n[o++],t[r]);return e},ti=V,to=V,ts=function(e){return"function"==typeof e?e:void 0},ta=function(e,t){return arguments.length<2?ts(ti[e])||ts(to[e]):ti[e]&&ti[e][t]||to[e]&&to[e][t]},tc=ta("document","documentElement"),tu=H.exports,tl=eO,td=tu("keys"),tf=function(e){return td[e]||(td[e]=tl(e))},th=ei,tp=tn,ty=e4,tg=e1,tm=tc,tb=Q,tv=">",tw="<",t_="prototype",tE="script",tS=tf("IE_PROTO"),tx=function(){},tA=function(e){return tw+tE+tv+e+tw+"/"+tE+tv},tI=function(e){e.write(tA("")),e.close();var t=e.parentWindow.Object;return e=null,t},tO=function(){var e,t=tb("iframe"),r="java"+tE+":";return t.style.display="none",tm.appendChild(t),t.src=String(r),(e=t.contentWindow.document).open(),e.write(tA("document.F=Object")),e.close(),e.F},tT=function(){try{n=document.domain&&new ActiveXObject("htmlfile")}catch(e){}tT=n?tI(n):tO();for(var e=ty.length;e--;)delete tT[t_][ty[e]];return tT()};tg[tS]=!0;var tP=Object.create||function(e,t){var r;return null!==e?(tx[t_]=th(e),r=new tx,tx[t_]=null,r[tS]=e):r=tT(),void 0===t?r:tp(r,t)},tM=tP,tN=W,tk=e$("unscopables"),tC=Array.prototype;void 0==tC[tk]&&tN.f(tC,tk,{configurable:!0,value:tM(null)});var tD=function(e){tC[tk][e]=!0},tj={},tR=e_,tL=Function.toString;"function"!=typeof tR.inspectSource&&(tR.inspectSource=function(e){return tL.call(e)});var tB=tR.inspectSource,tU=tB,t$=V.WeakMap,tK="function"==typeof t$&&/native code/.test(tU(t$)),tF=J,tz=ey,tq=ex,tV=tf,tH=e1,tG=V.WeakMap,tW=function(e){return s(e)?o(e):i(e,{})},tJ=function(e){return function(t){var r;if(!tF(t)||(r=o(t)).type!==e)throw TypeError("Incompatible receiver, "+e+" required");return r}};if(tK){var tZ=new tG,tY=tZ.get,tX=tZ.has,tQ=tZ.set;i=function(e,t){return tQ.call(tZ,e,t),t},o=function(e){return tY.call(tZ,e)||{}},s=function(e){return tX.call(tZ,e)}}else{var t0=tV("state");tH[t0]=!0,i=function(e,t){return tz(e,t0,t),t},o=function(e){return tq(e,t0)?e[t0]:{}},s=function(e){return tq(e,t0)}}var t1={set:i,get:o,has:s,enforce:tW,getterFor:tJ},t2={},t5={},t3={}.propertyIsEnumerable,t8=Object.getOwnPropertyDescriptor,t6=t8&&!t3.call({1:2},1);t5.f=t6?function(e){var t=t8(this,e);return!!t&&t.enumerable}:t3;var t4=G,t9=t5,t7=ef,re=z,rt=es,rr=ex,rn=er,ri=Object.getOwnPropertyDescriptor;t2.f=t4?ri:function(e,t){if(e=re(e),t=rt(t,!0),rn)try{return ri(e,t)}catch(e){}if(rr(e,t))return t7(!t9.f.call(e,t),e[t])};var ro={exports:{}},rs=V,ra=ey,rc=ex,ru=eb,rl=tB,rd=t1,rf=rd.get,rh=rd.enforce,rp=String(String).split("String");(ro.exports=function(e,t,r,n){var i=!!n&&!!n.unsafe,o=!!n&&!!n.enumerable,s=!!n&&!!n.noTargetGet;if("function"==typeof r&&("string"!=typeof t||rc(r,"name")||ra(r,"name",t),rh(r).source=rp.join("string"==typeof t?t:"")),e===rs){o?e[t]=r:ru(t,r);return}i?!s&&e[t]&&(o=!0):delete e[t],o?e[t]=r:ra(e,t,r)})(Function.prototype,"toString",function(){return"function"==typeof this&&rf(this).source||rl(this)});var ry={},rg=e6,rm=e4.concat("length","prototype");ry.f=Object.getOwnPropertyNames||function(e){return rg(e,rm)};var rb={};rb.f=Object.getOwnPropertySymbols;var rv=ry,rw=rb,r_=ei,rE=ta("Reflect","ownKeys")||function(e){var t=rv.f(r_(e)),r=rw.f;return r?t.concat(r(e)):t},rS=ex,rx=rE,rA=t2,rI=W,rO=function(e,t){for(var r=rx(t),n=rI.f,i=rA.f,o=0;o<r.length;o++){var s=r[o];rS(e,s)||n(e,s,i(t,s))}},rT=C,rP=/#|\.prototype\./,rM=function(e,t){var r=rk[rN(e)];return r==rD||r!=rC&&("function"==typeof t?rT(t):!!t)},rN=rM.normalize=function(e){return String(e).replace(rP,".").toLowerCase()},rk=rM.data={},rC=rM.NATIVE="N",rD=rM.POLYFILL="P",rj=rM,rR=V,rL=t2.f,rB=ey,rU=ro.exports,r$=eb,rK=rO,rF=rj,rz=function(e,t){var r,n,i,o,s,a=e.target,c=e.global,u=e.stat;if(r=c?rR:u?rR[a]||r$(a,{}):(rR[a]||{}).prototype)for(n in t){if(o=t[n],i=e.noTargetGet?(s=rL(r,n))&&s.value:r[n],!rF(c?n:a+(u?".":"#")+n,e.forced)&&void 0!==i){if(typeof o==typeof i)continue;rK(o,i)}(e.sham||i&&i.sham)&&rB(o,"sham",!0),rU(r,n,o,e)}},rq=$,rV=function(e){return Object(rq(e))},rH=!C(function(){function e(){}return e.prototype.constructor=null,Object.getPrototypeOf(new e)!==e.prototype}),rG=ex,rW=rV,rJ=rH,rZ=tf("IE_PROTO"),rY=Object.prototype,rX=rJ?Object.getPrototypeOf:function(e){return rG(e=rW(e),rZ)?e[rZ]:"function"==typeof e.constructor&&e instanceof e.constructor?e.constructor.prototype:e instanceof Object?rY:null},rQ=rX,r0=ey,r1=ex,r2=e$("iterator"),r5=!1,r3=function(){return this};[].keys&&("next"in(u=[].keys())?(c=rQ(rQ(u)))!==Object.prototype&&(a=c):r5=!0),void 0==a&&(a={}),r1(a,r2)||r0(a,r2,r3);var r8={IteratorPrototype:a,BUGGY_SAFARI_ITERATORS:r5},r6=W.f,r4=ex,r9=e$("toStringTag"),r7=function(e,t,r){e&&!r4(e=r?e:e.prototype,r9)&&r6(e,r9,{configurable:!0,value:t})},ne=r8.IteratorPrototype,nt=tP,nr=ef,nn=r7,ni=tj,no=function(){return this},ns=function(e,t,r){var n=t+" Iterator";return e.prototype=nt(ne,{next:nr(1,r)}),nn(e,n,!1),ni[n]=no,e},na=J,nc=ei,nu=function(e){if(!na(e)&&null!==e)throw TypeError("Can't set "+String(e)+" as a prototype");return e},nl=Object.setPrototypeOf||("__proto__"in{}?function(){var e,t=!1,r={};try{(e=Object.getOwnPropertyDescriptor(Object.prototype,"__proto__").set).call(r,[]),t=r instanceof Array}catch(e){}return function(r,n){return nc(r),nu(n),t?e.call(r,n):r.__proto__=n,r}}():void 0),nd=rz,nf=ns,nh=rX,np=nl,ny=r7,ng=ey,nm=ro.exports,nb=e$,nv=tj,nw=r8,n_=nw.IteratorPrototype,nE=nw.BUGGY_SAFARI_ITERATORS,nS=nb("iterator"),nx="keys",nA="values",nI="entries",nO=function(){return this},nT=z,nP=tD,nM=tj,nN=t1,nk=function(e,t,r,n,i,o,s){nf(r,t,n);var a,c,u,l=function(e){if(e===i&&y)return y;if(!nE&&e in h)return h[e];switch(e){case nx:case nA:case nI:return function(){return new r(this,e)}}return function(){return new r(this)}},d=t+" Iterator",f=!1,h=e.prototype,p=h[nS]||h["@@iterator"]||i&&h[i],y=!nE&&p||l(i),g="Array"==t&&h.entries||p;if(g&&(a=nh(g.call(new e)),n_!==Object.prototype&&a.next&&(nh(a)!==n_&&(np?np(a,n_):"function"!=typeof a[nS]&&ng(a,nS,nO)),ny(a,d,!0))),i==nA&&p&&p.name!==nA&&(f=!0,y=function(){return p.call(this)}
41),h[nS]!==y&&ng(h,nS,y),nv[t]=y,i){if(c={values:l(nA),keys:o?y:l(nx),entries:l(nI)},s)for(u in c)!nE&&!f&&u in h||nm(h,u,c[u]);else nd({target:t,proto:!0,forced:nE||f},c)}return c},nC="Array Iterator",nD=nN.set,nj=nN.getterFor(nC),nR=nk(Array,"Array",function(e,t){nD(this,{type:nC,target:nT(e),index:0,kind:t})},function(){var e=nj(this),t=e.target,r=e.kind,n=e.index++;return!t||n>=t.length?(e.target=void 0,{value:void 0,done:!0}):"keys"==r?{value:n,done:!1}:"values"==r?{value:t[n],done:!1}:{value:[n,t[n]],done:!1}},"values");nM.Arguments=nM.Array,nP("keys"),nP("values"),nP("entries");var nL=V.Promise,nB=ro.exports,nU=function(e,t,r){for(var n in t)nB(e,n,t[n],r);return e},n$=ta,nK=W,nF=G,nz=e$("species"),nq=function(e){var t=n$(e),r=nK.f;nF&&t&&!t[nz]&&r(t,nz,{configurable:!0,get:function(){return this}})},nV=function(e){if("function"!=typeof e)throw TypeError(String(e)+" is not a function");return e},nH=function(e,t,r){if(!(e instanceof t))throw TypeError("Incorrect "+(r?r+" ":"")+"invocation");return e},nG={exports:{}},nW=tj,nJ=e$("iterator"),nZ=Array.prototype,nY=function(e){return void 0!==e&&(nW.Array===e||nZ[nJ]===e)},nX=nV,nQ=function(e,t,r){if(nX(e),void 0===t)return e;switch(r){case 0:return function(){return e.call(t)};case 1:return function(r){return e.call(t,r)};case 2:return function(r,n){return e.call(t,r,n)};case 3:return function(r,n,i){return e.call(t,r,n,i)}}return function(){return e.apply(t,arguments)}},n0=e$("toStringTag"),n1={};n1[n0]="z";var n2="[object z]"===String(n1),n5=j,n3=e$("toStringTag"),n8="Arguments"==n5(function(){return arguments}()),n6=function(e,t){try{return e[t]}catch(e){}},n4=n2?n5:function(e){var t,r,n;return void 0===e?"Undefined":null===e?"Null":"string"==typeof(r=n6(t=Object(e),n3))?r:n8?n5(t):"Object"==(n=n5(t))&&"function"==typeof t.callee?"Arguments":n},n9=tj,n7=e$("iterator"),ie=ei,it=ei,ir=nY,ii=eH,io=nQ,is=function(e){if(void 0!=e)return e[n7]||e["@@iterator"]||n9[n4(e)]},ia=function(e,t,r,n){try{return n?t(ie(r)[0],r[1]):t(r)}catch(t){var i=e.return;throw void 0!==i&&ie(i.call(e)),t}},ic=function(e,t){this.stopped=e,this.result=t};(nG.exports=function(e,t,r,n,i){var o,s,a,c,u,l,d,f=io(t,r,n?2:1);if(i)o=e;else{if("function"!=typeof(s=is(e)))throw TypeError("Target is not iterable");if(ir(s)){for(a=0,c=ii(e.length);c>a;a++)if((u=n?f(it(d=e[a])[0],d[1]):f(e[a]))&&u instanceof ic)return u;return new ic(!1)}o=s.call(e)}for(l=o.next;!(d=l.call(o)).done;)if("object"==typeof(u=ia(o,f,d.value,n))&&u&&u instanceof ic)return u;return new ic(!1)}).stop=function(e){return new ic(!0,e)};var iu=e$("iterator"),il=!1;try{var id=0,ih={next:function(){return{done:!!id++}},return:function(){il=!0}};ih[iu]=function(){return this},Array.from(ih,function(){throw 2})}catch(e){}var ip=function(e,t){if(!t&&!il)return!1;var r=!1;try{var n={};n[iu]=function(){return{next:function(){return{done:r=!0}}}},e(n)}catch(e){}return r},iy=ei,ig=nV,im=e$("species"),ib=function(e,t){var r,n=iy(e).constructor;return void 0===n||void 0==(r=iy(n)[im])?t:ig(r)},iv=ta("navigator","userAgent")||"",iw=iv,i_=/(iphone|ipod|ipad).*applewebkit/i.test(iw),iE=V,iS=C,ix=j,iA=nQ,iI=tc,iO=Q,iT=i_,iP=iE.location,iM=iE.setImmediate,iN=iE.clearImmediate,ik=iE.process,iC=iE.MessageChannel,iD=iE.Dispatch,ij=0,iR={},iL="onreadystatechange",iB=function(e){if(iR.hasOwnProperty(e)){var t=iR[e];delete iR[e],t()}},iU=function(e){return function(){iB(e)}},i$=function(e){iB(e.data)},iK=function(e){iE.postMessage(e+"",iP.protocol+"//"+iP.host)};iM&&iN||(iM=function(e){for(var t=[],r=1;arguments.length>r;)t.push(arguments[r++]);return iR[++ij]=function(){("function"==typeof e?e:Function(e)).apply(void 0,t)},l(ij),ij},iN=function(e){delete iR[e]},"process"==ix(ik)?l=function(e){ik.nextTick(iU(e))}:iD&&iD.now?l=function(e){iD.now(iU(e))}:iC&&!iT?(f=(d=new iC).port2,d.port1.onmessage=i$,l=iA(f.postMessage,f,1)):!iE.addEventListener||"function"!=typeof postMessage||iE.importScripts||iS(iK)||"file:"===iP.protocol?l=iL in iO("script")?function(e){iI.appendChild(iO("script"))[iL]=function(){iI.removeChild(this),iB(e)}}:function(e){setTimeout(iU(e),0)}:(l=iK,iE.addEventListener("message",i$,!1)));var iF={set:iM},iz=V,iq=t2.f,iV=j,iH=iF.set,iG=i_,iW=iz.MutationObserver||iz.WebKitMutationObserver,iJ=iz.process,iZ=iz.Promise,iY="process"==iV(iJ),iX=iq(iz,"queueMicrotask"),iQ=iX&&iX.value;iQ||(h=function(){var e,t;for(iY&&(e=iJ.domain)&&e.exit();p;){t=p.fn,p=p.next;try{t()}catch(e){throw p?g():y=void 0,e}}y=void 0,e&&e.enter()},iY?g=function(){iJ.nextTick(h)}:iW&&!iG?(m=!0,b=document.createTextNode(""),new iW(h).observe(b,{characterData:!0}
41),g=function(){b.data=m=!m}):iZ&&iZ.resolve?(w=(v=iZ.resolve(void 0)).then,g=function(){w.call(v,h)}):g=function(){iH.call(iz,h)});var i0=iQ||function(e){var t={fn:e,next:void 0};y&&(y.next=t),p||(p=t,g()),y=t},i1={},i2=nV,i5=function(e){var t,r;this.promise=new e(function(e,n){if(void 0!==t||void 0!==r)throw TypeError("Bad Promise constructor");t=e,r=n}),this.resolve=i2(t),this.reject=i2(r)};i1.f=function(e){return new i5(e)};var i3=ei,i8=J,i6=i1,i4=function(e,t){if(i3(e),i8(t)&&t.constructor===e)return t;var r=i6.f(e);return(0,r.resolve)(t),r.promise},i9=V,i7=function(e,t){var r=i9.console;r&&r.error&&(1==arguments.length?r.error(e):r.error(e,t))},oe=function(e){try{return{error:!1,value:e()}}catch(e){return{error:!0,value:e}}},ot=iv,or=V.process,on=or&&or.versions,oi=on&&on.v8;oi?E=(_=oi.split("."))[0]+_[1]:ot&&(!(_=ot.match(/Edge\/(\d+)/))||_[1]>=74)&&(_=ot.match(/Chrome\/(\d+)/))&&(E=_[1]);var oo=E&&+E,os=rz,oa=V,oc=ta,ou=nL,ol=ro.exports,od=nU,of=r7,oh=nq,op=J,oy=nV,og=nH,om=j,ob=tB,ov=nG.exports,ow=ip,o_=ib,oE=iF.set,oS=i0,ox=i4,oA=i7,oI=i1,oO=oe,oT=t1,oP=rj,oM=oo,oN=e$("species"),ok="Promise",oC=oT.get,oD=oT.set,oj=oT.getterFor(ok),oR=ou,oL=oa.TypeError,oB=oa.document,oU=oa.process,o$=oc("fetch"),oK=oI.f,oF=oK,oz="process"==om(oU),oq=!!(oB&&oB.createEvent&&oa.dispatchEvent),oV="unhandledrejection",oH="rejectionhandled",oG=0,oW=1,oJ=2,oZ=1,oY=2,oX=oP(ok,function(){if(!(ob(oR)!==String(oR))&&(66===oM||!oz&&"function"!=typeof PromiseRejectionEvent))return!0;if(oM>=51&&/native code/.test(oR))return!1;var e=oR.resolve(1),t=function(e){e(function(){},function(){})};return(e.constructor={})[oN]=t,!(e.then(function(){})instanceof t)}),oQ=oX||!ow(function(e){oR.all(e).catch(function(){})}),o0=function(e){var t;return!!op(e)&&"function"==typeof(t=e.then)&&t},o1=function(e,t,r){if(!t.notified){t.notified=!0;var n=t.reactions;oS(function(){for(var i=t.value,o=t.state==oW,s=0;n.length>s;){var a,c,u,l=n[s++],d=o?l.ok:l.fail,f=l.resolve,h=l.reject,p=l.domain;try{d?(o||(t.rejection===oY&&o8(e,t),t.rejection=oZ),!0===d?a=i:(p&&p.enter(),a=d(i),p&&(p.exit(),u=!0)),a===l.promise?h(oL("Promise-chain cycle")):(c=o0(a))?c.call(a,f,h):f(a)):h(i)}catch(e){p&&!u&&p.exit(),h(e)}}t.reactions=[],t.notified=!1,r&&!t.rejection&&o5(e,t)})}},o2=function(e,t,r){var n,i;oq?((n=oB.createEvent("Event")).promise=t,n.reason=r,n.initEvent(e,!1,!0),oa.dispatchEvent(n)):n={promise:t,reason:r},(i=oa["on"+e])?i(n):e===oV&&oA("Unhandled promise rejection",r)},o5=function(e,t){oE.call(oa,function(){var r,n=t.value;if(o3(t)&&(r=oO(function(){oz?oU.emit("unhandledRejection",n,e):o2(oV,e,n)}),t.rejection=oz||o3(t)?oY:oZ,r.error))throw r.value})},o3=function(e){return e.rejection!==oZ&&!e.parent},o8=function(e,t){oE.call(oa,function(){oz?oU.emit("rejectionHandled",e):o2(oH,e,t.value)})},o6=function(e,t,r,n){return function(i){e(t,r,i,n)}},o4=function(e,t,r,n){t.done||(t.done=!0,n&&(t=n),t.value=r,t.state=oJ,o1(e,t,!0))},o9=function(e,t,r,n){if(!t.done){t.done=!0,n&&(t=n);try{if(e===r)throw oL("Promise can't be resolved itself");var i=o0(r);i?oS(function(){var n={done:!1};try{i.call(r,o6(o9,e,n,t),o6(o4,e,n,t))}catch(r){o4(e,n,r,t)}}):(t.value=r,t.state=oW,o1(e,t,!1))}catch(r){o4(e,{done:!1},r,t)}}};oX&&(oR=function(e){og(this,oR,ok),oy(e),S.call(this);var t=oC(this);try{e(o6(o9,this,t),o6(o4,this,t))}catch(e){o4(this,t,e)}},(S=function(e){oD(this,{type:ok,done:!1,notified:!1,parent:!1,reactions:[],rejection:!1,state:oG,value:void 0})}).prototype=od(oR.prototype,{then:function(e,t){var r=oj(this),n=oK(o_(this,oR));return n.ok="function"!=typeof e||e,n.fail="function"==typeof t&&t,n.domain=oz?oU.domain:void 0,r.parent=!0,r.reactions.push(n),r.state!=oG&&o1(this,r,!1),n.promise},catch:function(e){return this.then(void 0,e)}}),x=function(){var e=new S,t=oC(e);this.promise=e,this.resolve=o6(o9,e,t),this.reject=o6(o4,e,t)},oI.f=oK=function(e){return e===oR||e===A?new x(e):oF(e)},"function"==typeof ou&&(I=ou.prototype.then,ol(ou.prototype,"then",function(e,t){var r=this;return new oR(function(e,t){I.call(r,e,t)}).then(e,t)},{unsafe:!0}),"function"==typeof o$&&os({global:!0,enumerable:!0,forced:!0},{fetch:function(e){return ox(oR,o$.apply(oa,arguments))}}))),os({global:!0,wrap:!0,forced:oX},{Promise:oR}),of(oR,ok,!1),oh(ok),A=oc(ok),os({target:ok,stat:!0,forced:oX},{reject:function(e){var t=oK(this);return t.reject.call(void 0,e),t.promise}}),os({target:ok,stat:!0,forced:oX},{resolve:function(e){return ox(this,e)}}),os({target:ok,stat:!0,forced:oQ},{all:function(e){var t=this,r=oK(t),n=r.resolve,i=r.reject,o=oO(function(){var r=oy(t.resolve),o=[],s=0,a=1;ov(e,function(e){var c=s++,u=!1;o.push(void 0),a++,r.call(t,e).then(function(e){!u&&(u=!0,o[c]=e,--a||n(o))},i)}),--a||n(o)});return o.error&&i(o.value),r.promise},race:function(e){var t=this,r=oK(t),n=r.reject,i=oO(function(){var i=oy(t.resolve);ov(e,function(e){i.call(t,e).then(r.resolve,n)})});return i.error&&n(i.value),r.promise}});var o7=ei,se=function(){var e=o7(this),t="";return e.global&&(t+="g"),e.ignoreCase&&(t+="i"),e.multiline&&(t+="m"),e.dotAll&&(t+="s"),e.unicode&&(t+="u"),e.sticky&&(t+="y"),t},st=ro.exports,sr=ei,sn=C,si=se,so="toString",ss=RegExp.prototype,sa=ss[so],sc=sn(function(){return"/a/b"!=sa.call({
41source:"a",flags:"b"})}),su=sa.name!=so;(sc||su)&&st(RegExp.prototype,so,function(){var e=sr(this),t=String(e.source),r=e.flags;return"/"+t+"/"+String(void 0===r&&e instanceof RegExp&&!("flags"in ss)?si.call(e):r)},{unsafe:!0});var sl=V,sd={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},sf=nR,sh=ey,sp=e$,sy=sp("iterator"),sg=sp("toStringTag"),sm=sf.values;for(var sb in sd){var sv=sl[sb],sw=sv&&sv.prototype;if(sw){if(sw[sy]!==sm)try{sh(sw,sy,sm)}catch(e){sw[sy]=sm}if(sw[sg]||sh(sw,sg,sb),sd[sb]){for(var s_ in sf)if(sw[s_]!==sf[s_])try{sh(sw,s_,sf[s_])}catch(e){sw[s_]=sf[s_]}}}}"function"==typeof SuppressedError&&SuppressedError;var sE=r(31151),sS="data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iOTUiIGhlaWdodD0iOTUiIHZpZXdCb3g9IjAgMCA5NSA5NSIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KPHBhdGggZmlsbC1ydWxlPSJldmVub2RkIiBjbGlwLXJ1bGU9ImV2ZW5vZGQiIGQ9Ik0xLjc3NjE3IDU5LjE4MjZMNjIuNzIyNyA2My4zMTNDNjMuMTE4NSA2My40MzA5IDYzLjQ3ODggNjMuNjQ1NiA2My43NzA4IDYzLjkzNzdDNjQuMDYyOSA2NC4yMjk3IDY0LjI3NzUgNjQuNTg5OSA2NC4zOTU0IDY0Ljk4NThMNjguNTI1OSA3OC44NTU1QzY4LjY3ODcgNzkuMzY4NiA2OC45OTMyIDc5LjgxODYgNjkuNDIyNCA4MC4xMzg3QzY5Ljg1MTYgODAuNDU4NyA3MC4zNzI3IDgwLjYzMTYgNzAuOTA4MiA4MC42MzE2QzcxLjQ0MzYgODAuNjMxNiA3MS45NjQ3IDgwLjQ1ODcgNzIuMzkzOSA4MC4xMzg3QzcyLjgyMzEgNzkuODE4NiA3My4xMzc2IDc5LjM2ODYgNzMuMjkwNCA3OC44NTU1TDc3LjQyMDkgNjQuOTg1OEM3Ny41Mzg4IDY0LjU4OTkgNzcuNzUzNCA2NC4yMjk3IDc4LjA0NTUgNjMuOTM3N0M3OC4zMzc2IDYzLjY0NTYgNzguNjk3OCA2My40MzA5IDc5LjA5MzYgNjMuMzEzTDkyLjk2MzMgNTkuMTgyNkM5My40NzY0IDU5LjAyOTcgOTMuOTI2NSA1OC43MTUzIDk0LjI0NjYgNTguMjg2MUM5NC41NjY2IDU3Ljg1NjggOTQuNzM5NSA1Ny4zMzU3IDk0LjczOTUgNTYuODAwM0M5NC43Mzk1IDU2LjI2NDkgOTQuNTY2NiA1NS43NDM4IDk0LjI0NjYgNTUuMzE0NkM5My45MjY1IDU0Ljg4NTMgOTMuNDc2NCA1NC41NzA5IDkyLjk2MzMgNTQuNDE4MUw3OS4wOTM3IDUwLjI4NzZDNzguNjk3OCA1MC4xNjk3IDc4LjMzNzYgNDkuOTU1IDc4LjA0NTUgNDkuNjYzQzc3Ljc1MzUgNDkuMzcwOSA3Ny41Mzg4IDQ5LjAxMDcgNzcuNDIwOSA0OC42MTQ4TDczLjI5MDQgMzQuNzQ1MkM3My4xMzc2IDM0LjIzMiA3Mi44MjMyIDMzLjc4MTkgNzIuMzkzOSAzMy40NjE5QzcxLjk2NDcgMzMuMTQxOSA3MS40NDM2IDMyLjk2OSA3MC45MDgyIDMyLjk2OUM3MC4zNzI4IDMyLjk2OSA2OS44NTE3IDMzLjE0MTkgNjkuNDIyNCAzMy40NjE5QzY4Ljk5MzIgMzMuNzgxOSA2OC42Nzg4IDM0LjIzMiA2OC41MjYgMzQuNzQ1Mkw2NC4zOTU0IDQ4LjYxNDhDNjQuMjc3NiA0OS4wMTA3IDY0LjA2MjkgNDkuMzcwOSA2My43NzA4IDQ5LjY2M0M2My40Nzg4IDQ5Ljk1NSA2My4xMTg1IDUwLjE2OTcgNjIuNzIyNyA1MC4yODc2TDEuNzc2MTggNTQuNDE4MUMxLjI2MzA1IDU0LjU3MDkgMC44MTI5NTYgNTQuODg1MyAwLjQ5MjkyIDU1LjMxNDZDMC4xNzI4ODQgNTUuNzQzOCAyLjI0NzU1ZS0wNiA1Ni4yNjQ5IDAgNTYuODAwM0MtMi4yNDc1MWUtMDYgNTcuMzM1NyAwLjE3Mjg4NyA1Ny44NTY4IDAuNDkyOTIgNTguMjg2MUMwLjgxMjk1MyA1OC43MTUzIDEuMjYzMDMgNTkuMDI5NyAxLjc3NjE3IDU5LjE4MjZaIiBmaWxsPSJibGFjayIvPgo8cGF0aCBmaWxsLXJ1bGU9ImV2ZW5vZGQiIGNsaXAtcnVsZT0iZXZlbm9kZCIgZD0iTTMyLjE2MzcgMjkuNDg2OEw0MC4zNTc4IDMxLjkyNzFDNDAuNTkxNyAzMS45OTY3IDQwLjgwNDUgMzIuMTIzNiA0MC45NzcgMzIuMjk2MUM0MS4xNDk2IDMyLjQ2ODcgNDEuMjc2NCAzMi42ODE1IDQxLjM0NjEgMzIuOTE1NEw0My43ODYzIDQxLjEwOTVDNDMuODc2NiA0MS40MTI2IDQ0LjA2MjQgNDEuNjc4NSA0NC4zMTYgNDEuODY3NkM0NC41Njk2IDQyLjA1NjcgNDQuODc3NCA0Mi4xNTg4IDQ1LjE5MzcgNDIuMTU4OEM0NS41MTAxIDQyLjE1ODggNDUuODE3OSA0Mi4wNTY3IDQ2LjA3MTUgNDEuODY3NkM0Ni4zMjUxIDQxLjY3ODUgNDYuNTEwOSA0MS40MTI2IDQ2LjYwMTEgNDEuMTA5NUw0OS4wNDE0IDMyLjkxNTRDNDkuMTExMSAzMi42ODE1IDQ5LjIzNzkgMzIuNDY4NyA0OS40MTA0IDMyLjI5NjFDNDkuNTgzIDMyLjEyMzYgNDkuNzk1OCAzMS45OTY3IDUwLjAyOTcgMzEuOTI3MUw1OC4yMjM4IDI5LjQ4NjhDNTguNTI2OSAyOS4zOTY2IDU4Ljc5MjggMjkuMjEwOCA1OC45ODE5IDI4Ljk1NzJDNTkuMTcxIDI4LjcwMzYgNTkuMjczMSAyOC4zOTU4IDU5LjI3MzEgMjguMDc5NEM1OS4yNzMxIDI3Ljc2MzEgNTkuMTcxIDI3LjQ1NTMgNTguOTgxOSAyNy4yMDE3QzU4Ljc5MjggMjYuOTQ4MSA1OC41MjY5IDI2Ljc2MjMgNTguMjIzOCAyNi42NzJMNTAuMDI5NiAyNC4yMzE3QzQ5Ljc5NTggMjQuMTYyMSA0OS41ODI5IDI0LjAzNTIgNDkuNDEwNCAyMy44NjI3QzQ5LjIzNzkgMjMuNjkwMiA0OS4xMTEgMjMuNDc3MyA0OS4wNDE0IDIzLjI0MzRMNDYuNjAxMSAxNS4wNDkzQzQ2LjUxMDggMTQuNzQ2MiA0Ni4zMjUgMTQuNDgwMyA0Ni4wNzE1IDE0LjI5MTJDNDUuODE3OSAxNC4xMDIxIDQ1LjUxIDE0IDQ1LjE5MzcgMTRDNDQuODc3NCAxNCA0NC41Njk1IDE0LjEwMjEgNDQuMzE1OSAxNC4yOTEyQzQ0LjA2MjMgMTQuNDgwMyA0My44NzY2IDE0Ljc0NjIgNDMuNzg2MyAxNS4wNDkzTDQxLjM0NiAyMy4yNDM0QzQxLjI3NjQgMjMuNDc3MyA0MS4xNDk1IDIzLjY5MDIgNDAuOTc3IDIzLjg2MjdDNDAuODA0NCAyNC4wMzUyIDQwLjU5MTYgMjQuMTYyMSA0
41MC4zNTc4IDI0LjIzMTdMMzIuMTYzNyAyNi42NzJDMzEuODYwNSAyNi43NjIyIDMxLjU5NDYgMjYuOTQ4IDMxLjQwNTUgMjcuMjAxNkMzMS4yMTY0IDI3LjQ1NTIgMzEuMTE0MyAyNy43NjMxIDMxLjExNDMgMjguMDc5NEMzMS4xMTQzIDI4LjM5NTggMzEuMjE2NCAyOC43MDM3IDMxLjQwNTUgMjguOTU3MkMzMS41OTQ2IDI5LjIxMDggMzEuODYwNSAyOS4zOTY2IDMyLjE2MzcgMjkuNDg2OFoiIGZpbGw9ImJsYWNrIi8+Cjwvc3ZnPgo=",sx=480,sA=640,sI=300,sO=()=>({signedAccountId:localStorage.getItem("bitte:signedAccountId")||"",functionCallKey:JSON.parse(localStorage.getItem("bitte:functionCallKey")||"null")}),sT=e=>{localStorage.setItem("bitte:signedAccountId",e.signedAccountId),localStorage.setItem("bitte:functionCallKey",JSON.stringify(e.functionCallKey))},sP=(e,t)=>({walletUrl:e,network:t,provider:new O.providers.JsonRpcProvider({url:t.nodeUrl})}),sM=e=>e.signedAccountId,sN=e=>{if(e.functionCallKey)return sE.KeyPair.fromString(e.functionCallKey.privateKey).getPublicKey()},sk=e=>!!e.signedAccountId,sC=()=>{let e={signedAccountId:"",functionCallKey:null};return sT(e),e},sD=(e,{contractId:t,methodNames:r})=>{let n=new URL(window.location.href),i=new URL(`${e.walletUrl}/login/`);i.searchParams.set("success_url",n.href),i.searchParams.set("failure_url",n.href);let o=null;if(t){i.searchParams.set("contract_id",t);let e=sE.KeyPair.fromRandom("ed25519");i.searchParams.set("public_key",e.getPublicKey().toString()),o={privateKey:e.toString(),contractId:t,methods:r||[]}}r&&r.forEach(e=>{i.searchParams.append("methodNames",e)});let s=sO();return s.functionCallKey=o,sT(s),{url:i.toString(),newState:s}},sj=async(e,t,{contractId:r,methodNames:n})=>{let{url:i,newState:o}=sD(e,{contractId:r,methodNames:n});return sq(e,i,async e=>{let{public_key:t,account_id:r}=e;if(r)return sT({...o,signedAccountId:r}),[{accountId:r,publicKey:t||""}];throw Error("Invalid response data from wallet")})},sR=async(e,{message:t,nonce:r,recipient:n,callbackUrl:i,state:o})=>{let s=i||window.location.href;if(!s)throw Error("BitteWallet: CallbackUrl is missing");let a=new URL(e.walletUrl);return a.pathname="sign-message",a.searchParams.append("message",t),a.searchParams.append("nonce",r.toString("base64")),a.searchParams.append("recipient",n),a.searchParams.append("callbackUrl",s),o&&a.searchParams.append("state",o),sq(e,a.toString(),e=>({accountId:e?.signedRequest?.accountId||"",publicKey:e?.signedRequest?.publicKey||"",signature:e?.signedRequest?.signature||""}))},sL=(e,t,r)=>!!e.functionCallKey&&e.functionCallKey.contractId===t&&"FunctionCall"===r[0].type&&"0"===r[0].params.deposit&&(0===e.functionCallKey.methods.length||e.functionCallKey.methods.includes(r[0].params.methodName)),sB=async(e,t,{receiverId:r,actions:n})=>{let i=new O.keyStores.InMemoryKeyStore,o=sE.KeyPair.fromString(t.functionCallKey.privateKey);return await i.setKey(e.network.networkId,t.signedAccountId,o),(await (await (0,O.connect)({...e.network,keyStore:i})).account(t.signedAccountId)).signAndSendTransaction({receiverId:r,actions:n.map(e=>N(e))})},sU=(e,t)=>{let r=new URL(`${e.walletUrl}/sign-transaction`),n=encodeURIComponent(JSON.stringify(t,(e,t)=>"bigint"==typeof t?t.toString():t));return r.searchParams.set("transactions_data",n),r.searchParams.set("callback_url",window.location.origin),r.toString()},s$=async(e,t)=>{let r=sU(e,t),n=(await sq(e,r,e=>e.transactionHashes))?.split("%2C");if(!n)throw Error("No transaction hashes received");return Promise.all(n.map(t=>e.provider.txStatus(t,"unused")))},sK=async(e,t,{receiverId:r,actions:n})=>{if(1===n.length&&sL(t,r,n))try{return await sB(e,t,{receiverId:r,actions:n})}catch(e){console.warn("Failed to sign using key pair, falling back to wallet",e)}return(await s$(e,[{signerId:t.signedAccountId,receiverId:r,actions:n}]))[0]},sF=async(e,t,r)=>s$(e,r),sz=(e,t,r,n,i)=>async o=>{let s=o.data,a=new URL(o.origin),c=new URL(e.walletUrl);if(a.origin!==c.origin){console.warn("Ignoring message from different origin",a.origin);return}switch(s.status){case"success":n?.close(),t(i(s));break;case"failure":n?.close(),r(Error(s.errorMessage||"Transaction failed"));break;default:console.warn("Unhandled message status:",s.status)}},sq=(e,t,r)=>{let n=window.innerWidth||screen.width,i=window.innerHeight||screen.height,o=(n-sx)/2,s=(i-sA)/2,a=window.open(t,"BitteWallet",`width=${sx},height=${sA},top=${s},left=${o}`);if(!a)throw Error("Popup window blocked. Please allow popups for this site.");return new Promise((t,n)=>{let i=sz(e,t,n,a,r);window.addEventListener("message",i);let o=setInterval(()=>{a.closed&&(window.removeEventListener("message",i),clearInterval(o),n(Error("User closed the window")))},sI)})},sV=(e,t)=>{let r=sP(e,t),n=localStorage.getItem("mintbase-wallet_wallet_auth_key");if(n){let{accountId:e}=JSON.parse(n)||{};localStorage.setItem("bitte:signedAccountId",e),localStorage.removeItem("mintbase-wallet_wallet_auth_key")}let i=sO();return{getAccountId:()=>sM(i),getPublicKey:()=>sN(i),isSignedIn:()=>sk(i),signOut:()=>(i=sC(),null),requestSignIn:async e=>{let t=await sj(r,i,e);return i=sO(),t},requestSignInUrl:e=>{let{url:t,newState:n}=sD(r,e);return i=n,t},signMessage:e=>sR(r,e),signAndSendTransaction:e=>sK(r,i,e),signAndSendTransactions:e=>sF(r,i,e)}},sH=(e,t)=>{if(t)return t;if(!e)return"https://wallet.bitte.ai";switch(e.networkId){case"mainnet":default:return"https://wallet.bitte.ai";case"testnet":return"https://testnet.wallet.bitte.ai"}},sG=async(e,t)=>({wallet:sV(e.walletUrl,t)}),sW=async({metadata:e,options:t,store:r,params:n,logger:i})=>{let o=await sG(n,t.network),s=async()=>{let e=o.wallet.getAccountId(),t=o.wallet.getPublicKey();return[{accountId:e,publicKey:t?t.toString():""}]};return{signIn:async({contractId:e,methodNames:t})=>(o.wallet.isSignedIn()||await o.wallet.requestSignIn({contractId:e,methodNames:t}),s()),async signOut(){o.wallet.signOut()},getAccounts:async()=>s(),async verifyOwner(){throw Error(`Method not supported by ${e.name}`)},signMessage:async({message:e,nonce:t,recipient:r,callbackUrl:n,state:s})=>(i.log("sign message",{message:e}),await o.wallet.signMessage({message:e,nonce:t,recipient:r,callbackUrl:n,state:s})),async signAndSendTransaction({signerId:e,receiverId:t,actions:n}){i.log("signAndSendTransaction",{signerId:e,receiverId:t,actions:n});let{contract:s}=r.getState();if(!o.wallet.isSignedIn()||!s)throw Error("Wallet not signed in");let a=o.wallet.getAccountId();if(e&&a!==e)throw Error(`Signed in as ${a}, cannot sign for ${e}`);return o.wallet.signAndSendTransaction({receiverId:t||s.contractId,actions:n})},async signAndSendTransactions({transactions:e}){if(i.log("signAndSendTransactions",{transactions:e}),!o.wallet.isSignedIn())throw Error("Wallet not signed in");return o.wallet.signAndSendTransactions(e)},buildImportAccountsUrl:()=>`${n.walletUrl}/batch-import`}};function sJ({walletUrl:e,iconUrl:t=sS,deprecated:r=!1}={}){return async n=>({id:"bitte-wallet",type:"injected",metadata:{name:"Bitte Wallet",description:"NEAR wallet to store, buy, send and stake assets for DeFi.",iconUrl:t,deprecated:r,available:!0,downloadUrl:sH(n.options.network,e)},init:t=>sW({...t,params:{walletUrl:sH(n.options.network,e)}})})}},73790:(e,t,r)=>{"use strict";r.d(t,{l:()=>id});var n,i,o,s,a,c=r(66567),u=r(28539),l="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},d=function(e){return e&&e.Math===Math&&e},f=d("object"==typeof globalThis&&globalThis)||d("object"==typeof window&&window)||d("object"==typeof self&&self)||d("object"==typeof l&&l)||d("object"==typeof l&&l)||function(){return this}()||Function("return this")(),h={},p=function(e){try{return!!e()}catch(e){return!0}},y=!p(function(){return 7!==Object.defineProperty({},1,{get:function(){return 7}}
vendor: 5,597 bytes, line 41
41)[1]}),g=!p(function(){var e=(function(){}).bind();return"function"!=typeof e||e.hasOwnProperty("prototype")}),m=g,b=Function.prototype.call,v=m?b.bind(b):function(){return b.apply(b,arguments)},w={},_={}.propertyIsEnumerable,E=Object.getOwnPropertyDescriptor,S=E&&!_.call({1:2},1);w.f=S?function(e){var t=E(this,e);return!!t&&t.enumerable}:_;var x=function(e,t){return{enumerable:!(1&e),configurable:!(2&e),writable:!(4&e),value:t}},A=g,I=Function.prototype,O=I.call,T=A&&I.bind.bind(O,O),P=A?T:function(e){return function(){return O.apply(e,arguments)}},M=P,N=M({}.toString),k=M("".slice),C=function(e){return k(N(e),8,-1)},D=p,j=C,R=Object,L=P("".split),B=D(function(){return!R("z").propertyIsEnumerable(0)})?function(e){return"String"===j(e)?L(e,""):R(e)}:R,U=function(e){return null==e},$=U,K=TypeError,F=function(e){if($(e))throw new K("Can't call method on "+e);return e},z=B,q=F,V=function(e){return z(q(e))},H="object"==typeof document&&document.all,G=void 0===H&&void 0!==H?function(e){return"function"==typeof e||e===H}:function(e){return"function"==typeof e},W=G,J=function(e){return"object"==typeof e?null!==e:W(e)},Z=f,Y=G,X=function(e){return Y(e)?e:void 0},Q=function(e,t){return arguments.length<2?X(Z[e]):Z[e]&&Z[e][t]},ee=P({}.isPrototypeOf),et=f.navigator,er=et&&et.userAgent,en=er?String(er):"",ei=f,eo=en,es=ei.process,ea=ei.Deno,ec=es&&es.versions||ea&&ea.version,eu=ec&&ec.v8;eu&&(i=(n=eu.split("."))[0]>0&&n[0]<4?1:+(n[0]+n[1])),!i&&eo&&(!(n=eo.match(/Edge\/(\d+)/))||n[1]>=74)&&(n=eo.match(/Chrome\/(\d+)/))&&(i=+n[1]);var el=i,ed=p,ef=f.String,eh=!!Object.getOwnPropertySymbols&&!ed(function(){var e=Symbol("symbol detection");return!ef(e)||!(Object(e)instanceof Symbol)||!Symbol.sham&&el&&el<41}),ep=eh&&!Symbol.sham&&"symbol"==typeof Symbol.iterator,ey=Q,eg=G,em=ee,eb=Object,ev=ep?function(e){return"symbol"==typeof e}:function(e){var t=ey("Symbol");return eg(t)&&em(t.prototype,eb(e))},ew=String,e_=G,eE=function(e){try{return ew(e)}catch(e){return"Object"}},eS=TypeError,ex=function(e){if(e_(e))return e;throw new eS(eE(e)+" is not a function")},eA=U,eI=function(e,t){var r=e[t];return eA(r)?void 0:ex(r)},eO=v,eT=G,eP=J,eM=TypeError,eN=function(e,t){var r,n;if("string"===t&&eT(r=e.toString)&&!eP(n=eO(r,e))||eT(r=e.valueOf)&&!eP(n=eO(r,e))||"string"!==t&&eT(r=e.toString)&&!eP(n=eO(r,e)))return n;throw new eM("Can't convert object to primitive value")},ek={exports:{}},eC=f,eD=Object.defineProperty,ej=function(e,t){try{eD(eC,e,{value:t,configurable:!0,writable:!0})}catch(r){eC[e]=t}return t},eR=f,eL=ej,eB="__core-js_shared__",eU=ek.exports=eR[eB]||eL(eB,{});(eU.versions||(eU.versions=[])).push({version:"3.41.0",mode:"global",copyright:"\xa9 2014-2025 Denis Pushkarev (zloirock.ru)",license:"https://github.com/zloirock/core-js/blob/v3.41.0/LICENSE",source:"https://github.com/zloirock/core-js"});var e$=ek.exports,eK=function(e,t){return e$[e]||(e$[e]=t||{})},eF=F,ez=Object,eq=function(e){return ez(eF(e))},eV=eq,eH=P({}.hasOwnProperty),eG=Object.hasOwn||function(e,t){return eH(eV(e),t)},eW=0,eJ=Math.random(),eZ=P(1..toString),eY=function(e){return"Symbol("+(void 0===e?"":e)+")_"+eZ(++eW+eJ,36)},eX=eK,eQ=eG,e0=eY,e1=eh,e2=ep,e5=f.Symbol,e3=eX("wks"),e8=e2?e5.for||e5:e5&&e5.withoutSetter||e0,e6=function(e){return eQ(e3,e)||(e3[e]=e1&&eQ(e5,e)?e5[e]:e8("Symbol."+e)),e3[e]},e4=v,e9=J,e7=ev,te=eI,tt=eN,tr=TypeError,tn=e6("toPrimitive"),ti=function(e,t){if(!e9(e)||e7(e))return e;var r,n=te(e,tn);if(n){if(void 0===t&&(t="default"),!e9(r=e4(n,e,t))||e7(r))return r;throw new tr("Can't convert object to primitive value")}return void 0===t&&(t="number"),tt(e,t)},to=ev,ts=function(e){var t=ti(e,"string");return to(t)?t:t+""},ta=J,tc=f.document,tu=ta(tc)&&ta(tc.createElement),tl=p,td=function(e){return tu?tc.createElement(e):{}},tf=!y&&!tl(function(){return 7!==Object.defineProperty(td("div"),"a",{get:function(){return 7}}).a}),th=y,tp=v,ty=w,tg=x,tm=V,tb=ts,tv=eG,tw=tf,t_=Object.getOwnPropertyDescriptor;h.f=th?t_:function(e,t){if(e=tm(e),t=tb(t),tw)try{return t_(e,t)}catch(e){}if(tv(e,t))return tg(!tp(ty.f,e,t),e[t])};var tE={},tS=p,tx=y&&tS(function(){return 42!==Object.defineProperty(function(){},"prototype",{value:42,writable:!1}).prototype}),tA=J,tI=String,tO=TypeError,tT=function(e){if(tA(e))return e;throw new tO(tI(e)+" is not an object")},tP=y,tM=tf,tN=tx,tk=tT,tC=ts,tD=TypeError,tj=Object.defineProperty,tR=Object.getOwnPropertyDescriptor,tL="enumerable",tB="configurable",tU="writable";tE.f=tP?tN?function(e,t,r){if(tk(e),t=tC(t),tk(r),"function"==typeof e&&"prototype"===t&&"value"in r&&tU in r&&!r[tU]){var n=tR(e,t);n&&n[tU]&&(e[t]=r.value,r={configurable:tB in r?r[tB]:n[tB],enumerable:tL in r?r[tL]:n[tL],writable:!1})}return tj(e,t,r)}:tj:function(e,t,r){if(tk(e),t=tC(t),tk(r),tM)try{return tj(e,t,r)}catch(e){}if("get"in r||"set"in r)throw new tD("Accessors not supported");return"value"in r&&(e[t]=r.value),e};var t$=tE,tK=x,tF=y?function(e,t,r){return t$.f(e,t,tK(1,r))}:function(e,t,r){return e[t]=r,e},tz={exports:{}},tq=y,tV=Function.prototype,tH=tq&&Object.getOwnPropertyDescriptor,tG=eG(tV,"name"),tW={PROPER:tG&&"something"===(function(){}).name,CONFIGURABLE:tG&&(!tq||tq&&tH(tV,"name").configurable)},tJ=P,tZ=G,tY=ek.exports,tX=tJ(Function.toString);tZ(tY.inspectSource)||(tY.inspectSource=function(e){return tX(e)});var tQ=tY.inspectSource,t0=G,t1=f.WeakMap,t2=t0(t1)&&/native code/.test(String(t1)),t5=eY,t3=eK("keys"),t8=function(e){return t3[e]||(t3[e]=t5(e))},t6={},t4=t2,t9=f,t7=J,re=tF,rt=eG,rr=ek.exports,rn=t8,ri=t6,ro="Object already initialized",rs=t9.TypeError,ra=t9.WeakMap,rc=function(e){return a(e)?
41s(e):o(e,{})},ru=function(e){return function(t){var r;if(!t7(t)||(r=s(t)).type!==e)throw new rs("Incompatible receiver, "+e+" required");return r}};if(t4||rr.state){var rl=rr.state||(rr.state=new ra);rl.get=rl.get,rl.has=rl.has,rl.set=rl.set,o=function(e,t){if(rl.has(e))throw new rs(ro);return t.facade=e,rl.set(e,t),t},s=function(e){return rl.get(e)||{}},a=function(e){return rl.has(e)}}else{var rd=rn("state");ri[rd]=!0,o=function(e,t){if(rt(e,rd))throw new rs(ro);return t.facade=e,re(e,rd,t),t},s=function(e){return rt(e,rd)?e[rd]:{}},a=function(e){return rt(e,rd)}}var rf={set:o,get:s,has:a,enforce:rc,getterFor:ru},rh=P,rp=p,ry=G,rg=eG,rm=y,rb=tW.CONFIGURABLE,rv=tQ,rw=rf,r_=rw.enforce,rE=rw.get,rS=String,rx=Object.defineProperty,rA=rh("".slice),rI=rh("".replace),rO=rh([].join),rT=rm&&!rp(function(){return 8!==rx(function(){},"length",{value:8}).length}),rP=String(String).split("String"),rM=tz.exports=function(e,t,r){"Symbol("===rA(rS(t),0,7)&&(t="["+rI(rS(t),/^Symbol\(([^)]*)\).*$/,"$1")+"]"),r&&r.getter&&(t="get "+t),r&&r.setter&&(t="set "+t),(!rg(e,"name")||rb&&e.name!==t)&&(rm?rx(e,"name",{value:t,configurable:!0}):e.name=t),rT&&r&&rg(r,"arity")&&e.length!==r.arity&&rx(e,"length",{value:r.arity});try{r&&rg(r,"constructor")&&r.constructor?rm&&rx(e,"prototype",{writable:!1}):e.prototype&&(e.prototype=void 0)}catch(e){}var n=r_(e);return rg(n,"source")||(n.source=rO(rP,"string"==typeof t?t:"")),e};Function.prototype.toString=rM(function(){return ry(this)&&rE(this).source||rv(this)},"toString");var rN=G,rk=tE,rC=tz.exports,rD=ej,rj=function(e,t,r,n){n||(n={});var i=n.enumerable,o=void 0!==n.name?n.name:t;if(rN(r)&&rC(r,o,n),n.global)i?e[t]=r:rD(t,r);else{try{n.unsafe?e[t]&&(i=!0):delete e[t]}catch(e){}i?e[t]=r:rk.f(e,t,{value:r,enumerable:!1,configurable:!n.nonConfigurable,writable:!n.nonWritable})}return e},rR={},rL=Math.ceil,rB=Math.floor,rU=Math.trunc||function(e){var t=+e;return(t>0?rB:rL)(t)},r$=function(e){var t=+e;return t!=t||0===t?0:rU(t)},rK=r$,rF=Math.max,rz=Math.min,rq=r$,rV=Math.min,rH=function(e){var t=rq(e);return t>0?rV(t,0x1fffffffffffff):0},rG=V,rW=function(e,t){var r=rK(e);return r<0?rF(r+t,0):rz(r,t)},rJ=function(e){return rH(e.length)},rZ=function(e){return function(t,r,n){var i,o=rG(t),s=rJ(o);if(0===s)return!e&&-1;var a=rW(n,s);if(e&&r!=r){for(;s>a;)if((i=o[a++])!=i)return!0}else for(;s>a;a++)if((e||a in o)&&o[a]===r)return e||a||0;return!e&&-1}},rY={includes:rZ(!0),indexOf:rZ(!1)},rX=P,rQ=eG,r0=V,r1=rY.indexOf,r2=t6,r5=rX([].push),r3=function(e,t){var r,n=r0(e),i=0,o=[];for(r in n)!rQ(r2,r)&&rQ(n,r)&&r5(o,r);for(;t.length>i;)rQ(n,r=t[i++])&&(~r1(o,r)||r5(o,r));return o},r8=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"],r6=r3,r4=r8.concat("length","prototype");rR.f=Object.getOwnPropertyNames||function(e){return r6(e,r4)};var r9={};r9.f=Object.getOwnPropertySymbols;var r7=Q,ne=rR,nt=r9,nr=tT,nn=P([].concat),ni=r7("Reflect","ownKeys")||function(e){var t=ne.f(nr(e)),r=nt.f;return r?nn(t,r(e)):t},no=eG,ns=ni,na=h,nc=tE,nu=function(e,t,r){for(var n=ns(t),i=nc.f,o=na.f,s=0;s<n.length;s++){var a=n[s];no(e,a)||r&&no(r,a)||i(e,a,o(t,a))}},nl=p,nd=G,nf=/#|\.prototype\./,nh=function(e,t){var r=ny[np(e)];return r===nm||r!==ng&&(nd(t)?nl(t):!!t)},np=nh.normalize=function(e){return String(e).replace(nf,".").toLowerCase()},ny=nh.data={},ng=nh.NATIVE="N",nm=nh.POLYFILL="P",nb=nh,nv=f,nw=h.f,n_=tF,nE=rj,nS=ej,nx=nu,nA=nb,nI=function(e,t){var r,n,i,o,s,a=e.target,c=e.global,u=e.stat;if(r=c?nv:u?nv[a]||nS(a,{}):nv[a]&&nv[a].prototype)for(n in t){if(o=t[n],i=e.dontCallGetSet?(s=nw(r,n))&&s.value:r[n],!nA(c?n:a+(u?".":"#")+n,e.forced)&&void 0!==i){if(typeof o==typeof i)continue;nx(o,i)}(e.sham||i&&i.sham)&&n_(o,"sham",!0),nE(r,n,o,e)}},nO=r3,nT=r8,nP=y,nM=v,nN=p,nk=Object.keys||function(e){return nO(e,nT)},nC=r9,nD=w,nj=eq,nR=B,nL=Object.assign,nB=Object.defineProperty,nU=P([].concat),n$=!nL||nN(function(){if(nP&&1!==nL({b:1},nL(nB({},"a",{enumerable:!0,get:function(){nB(this,"b",{value:3,enumerable:!1})}}),{b:2})).b)return!0;var e={},t={},r=Symbol("assign detection"),n="abcdefghijklmnopqrst";return e[r]=7,n.split("").forEach(function(e){t[e]=e}),7!==nL({},e)[r]||nk(nL({},t)).join("")!==n})?function(e,t){for(var r=nj(e),n=arguments.length,i=1,o=nC.f,s=nD.f;n>i;)for(var a,c=nR(arguments[i++]),u=o?nU(nk(c),o(c)):nk(c),l=u.length,d=0;l>d;)a=u[d++],(!nP||nM(s,c,a))&&(r[a]=c[a]);return r}:nL;function nK(e,t,r,n){function i(e){return e instanceof r?e:new r(function(t){t(e)})}return new(r||(r=Promise))(function(r,o){function s(e){try{c(n.next(e))}catch(e){o(e)}}function a(e){try{c(n.throw(e))}catch(e){o(e)}}function c(e){e.done?r(e.value):i(e.value).then(s,a)}c((n=n.apply(e,t||[])).next())})}nI({target:"Object",stat:!0,arity:2,forced:Object.assign!==n$},{assign:n$}),"function"==typeof SuppressedError&&SuppressedError;var nF=e6("toStringTag"),nz={};nz[nF]="z";var nq="[object z]"===String(nz),nV=G,nH=C,nG=e6("toStringTag"),nW=Object,nJ="Arguments"===nH(function(){return arguments}()),nZ=function(e,t){try{return e[t]}catch(e){}},nY=nq?nH:function(e){var t,r,n;return void 0===e?"Undefined":null===e?"Null":"string"==typeof(r=nZ(t=nW(e),nG))?r:nJ?nH(t):"Object"===(n=nH(t))&&nV(t.callee)?"Arguments":n},nX=String,nQ=function(e){if("Symbol"===nY(e))throw TypeError("Cannot convert a Symbol value to a string");return nX(e)},n0=tT,n1=v,n2=eG,n5=ee,n3=function(){var e=n0(this),t="";return e.hasIndices&&(t+="d"),e.global&&(t+="g"),e.ignoreCase&&(t+="i"),e.multiline&&(t+="m"),e.dotAll&&(t+="s"),e.unicode&&(t+="u"),e.unicodeSets&&(t+="v"),e.sticky&&(t+="y"),t},n8=RegExp.prototype,n6=function(e){var t=e.flags;return!(void 0===t&&!("flags"in n8)&&!n2(e,"flags")&&n5(n8,e))?t:n1(n3,e)},n4=tW.PROPER,n9=rj,n7=tT,ie=nQ,it=p,ir=n6,ii="toString",io=RegExp.prototype,is=io[ii],ia=it(function(){return"/a/b"!==is.call({source:"a",flags:"b"})}),ic=n4&&is.name!==ii;(ia||ic)&&n9(io,ii,function(){var e=n7(this);return"/"+ie(e.source)+"/"+ie(ir(e))},{unsafe:!0});let iu=e=>nK(void 0,void 0,void 0,function*(){let{store:t,logger:r,emitter:n,options:i,walletOptions:o}=e,s=yield c.HereWallet.connect(o);function a(){return nK(this,void 0,void 0,function*(){r.log("HereWallet:getAccounts");let e=yield s.getAccounts(),t=[];for(let r=0;r<e.length;r++){let n=yield s.signer.getPublicKey(e[r],i.network.networkId);t.push({accountId:e[r],publicKey:n.toString()})}return t})}return{get networkId(){return s.networkId},buildImportAccountsUrl:()=>`https://my.herewallet.app/import?network=${i.network.networkId}`,account(e){return nK(this,void 0,void 0,function*(){return r.log("HereWallet:account"),yield s.account(e)})},switchAccount(e){return nK(this,void 0,void 0,function*(){r.log("HereWallet:switchAccount"),yield s.switchAccount(e)})},getAccountId(){return nK(this,void 0,void 0,function*(){return r.log("HereWallet:getAccountId"),yield s.getAccountId()})},isSignedIn(){return nK(this,void 0,void 0,function*(){return r.log("HereWallet:isSignedIn"),yield s.isSignedIn()})}
41,signIn(e){var t;return nK(this,void 0,void 0,function*(){if(r.log("HereWallet:signIn"),!(yield c.waitInjectedHereWallet)){let t=""!==e.contractId?e.contractId:void 0;yield s.signIn(Object.assign(Object.assign({},e),{contractId:t}))}return n.emit("signedIn",{contractId:e.contractId,methodNames:null!==(t=e.methodNames)&&void 0!==t?t:[],accounts:yield a()}),yield a()})},signOut(){return nK(this,void 0,void 0,function*(){r.log("HereWallet:signOut"),yield s.signOut()})},getAccounts(){return nK(this,void 0,void 0,function*(){return a()})},signAndSendTransaction(e){return nK(this,void 0,void 0,function*(){r.log("HereWallet:signAndSendTransaction",e);let{contract:n}=t.getState();return yield s.signAndSendTransaction({receiverId:null==n?void 0:n.contractId,actions:e.actions.map(e=>(0,u.Cc)(e))})})},verifyOwner(){return nK(this,void 0,void 0,function*(){throw Error("HereWallet:verifyOwner is deprecated, use signMessage method with implementation NEP0413 Standard")})},signMessage(e){return nK(this,void 0,void 0,function*(){return r.log("HereWallet:signMessage",e),yield s.signMessage(e)})},signAndSendTransactions(e){return nK(this,void 0,void 0,function*(){return r.log("HereWallet:signAndSendTransactions",e),yield s.signAndSendTransactions({transactions:e.transactions.map(e=>Object.assign(Object.assign({},e),{actions:e.actions.map(e=>(0,u.Cc)(e))}))})})},createSignedTransaction(e,t){return nK(this,void 0,void 0,function*(){throw r.log("HereWallet:createSignedTransaction",{actions:t,receiverId:e}),Error("Method not supported by Here Wallet")})},signTransaction(e){return nK(this,void 0,void 0,function*(){throw r.log("signTransaction",{transaction:e}),Error("Method not supported by Here Wallet")})},getPublicKey(){return nK(this,void 0,void 0,function*(){throw r.log("getPublicKey",{}),Error("Method not supported by Here Wallet")})},signNep413Message(e,t,n,i,o){return nK(this,void 0,void 0,function*(){throw r.log("signNep413Message",{message:e,accountId:t,recipient:n,nonce:i,callbackUrl:o}),Error("Method not supported by Here Wallet")})},signDelegateAction(e){return nK(this,void 0,void 0,function*(){throw r.log("signDelegateAction",{delegateAction:e}),Error("Method not supported by Here Wallet")})}}});var il="data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNDAiIGhlaWdodD0iNDAiIHZpZXdCb3g9IjAgMCA0MCA0MCIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KPHBhdGggZmlsbC1ydWxlPSJldmVub2RkIiBjbGlwLXJ1bGU9ImV2ZW5vZGQiIGQ9Ik0xOS43MzM1IDExLjY4MzFMMjEuNzA4OSA4TDI0LjI5ODMgMTYuNjc2NkwyMC40MTYgMTQuOTIxNUwxOS43MzM1IDExLjY4MzFaTTUuNzYzODggMTUuNTQwOUwzLjc1NTYyIDE5LjE2MjFMOS44OTYwNSAyMi4xNjYxTDE4LjM0NzMgMjEuNTgyOEw1Ljc2Mzg4IDE1LjU0MDlaTTQuNjQ0NjQgMjIuMzY5NEwyLjY0ODY1IDI1Ljk3MTNMMTQuOTA4MyAzMi4wNTc1TDM1LjMzODggMzAuODE3NEwzNy4zMzQ4IDI3LjIxNTRMMTYuOTA0MyAyOC40NTU3TDQuNjQ0NjQgMjIuMzY5NFoiIGZpbGw9IiMy
41QzMwMzQiLz4KPHBhdGggZD0iTTM3LjMzNTkgMjcuMjE1N0wxNi45MTEyIDI4LjQ1NjFMNC41NDYzMyAyMi4zNTU0TDE3LjkzNTggMjEuNTQ1M0w1Ljc2Mzg3IDE1LjU0MDlMMTEuNzQxIDEwLjQ3ODZMMjQuMTQwMSAxNi41NzYzTDIxLjcwOSA4TDMzLjU1NyAxMy44MUwzNy4zMzU5IDI3LjIxNTdaIiBmaWxsPSIjRkRCRjFDIi8+Cjwvc3ZnPgo=";function id({deprecated:e=!1,iconUrl:t=il,walletOptions:r}={}){return()=>nK(this,void 0,void 0,function*(){return{id:"here-wallet",type:"injected",metadata:{name:"Here Wallet",description:"Mobile wallet for NEAR Protocol",useUrlAccountImport:!0,downloadUrl:"https://herewallet.app",topLevelInjected:null!=(yield c.waitInjectedHereWallet),iconUrl:t,deprecated:e,available:!0},init:e=>iu(Object.assign(Object.assign({},e),{walletOptions:r}))}})}},36349:(e,t,r)=>{"use strict";r.d(t,{N:()=>pi});var n,i,o,s,a,c,u,l,d,f,h,p,y,g,m,b=r(36152),v=r(51957),w=r(28539),_=r(7490),E=r(91132),S=r(7316),x=r(60429),A=r.n(x);let I={},O={},T=(e,t)=>{O[e]=t},P=e=>{class t extends Error{cause;constructor(r,n,i){if(super(r||e,i),Object.setPrototypeOf(this,t.prototype),this.name=e,n)for(let e in n)this[e]=n[e];if(i&&M(i)&&"cause"in i&&!this.cause){let e=i.cause;this.cause=e,"stack"in e&&(this.stack=this.stack+"\nCAUSE: "+e.stack)}}}return I[e]=t,t};function M(e){return"object"==typeof e}P("AccountNameRequired"),P("AccountNotSupported"),P("AccountAwaitingSendPendingOperations"),P("AmountRequired"),P("BluetoothRequired"),P("BtcUnmatchedApp"),P("CantOpenDevice"),P("CashAddrNotSupported"),P("ClaimRewardsFeesWarning"),P("CurrencyNotSupported"),P("DeviceAppVerifyNotSupported"),P("DeviceGenuineSocketEarlyClose"),P("DeviceNotGenuine"),P("DeviceOnDashboardExpected"),P("DeviceOnDashboardUnexpected"),P("DeviceInOSUExpected"),P("DeviceHalted"),P("DeviceNameInvalid"),P("DeviceSocketFail"),P("DeviceSocketNoBulkStatus"),P("DeviceSocketNoBulkStatus"),P("UnresponsiveDeviceError");let N=P("DisconnectedDevice"),k=P("DisconnectedDeviceDuringOperation");P("DeviceExtractOnboardingStateError"),P("DeviceOnboardingStatePollingError"),P("EnpointConfig"),P("EthAppPleaseEnableContractData"),P("SolAppPleaseEnableContractData"),P("CeloAppPleaseEnableContractData"),P("FeeEstimationFailed"),P("FirmwareNotRecognized"),P("HardResetFail"),P("InvalidXRPTag"),P("InvalidAddress"),P("InvalidNonce"),P("InvalidAddressBecauseDestinationIsAlsoSource"),P("LatestMCUInstalledError"),P("LatestFirmwareVersionRequired"),P("UnsupportedFeatureError"),P("NanoSNotSupported"),P("UnknownMCU"),P("LedgerAPIError"),P("LedgerAPIErrorWithMessage"),P("LedgerAPINotAvailable"),P("ManagerAppAlreadyInstalled"),P("ManagerAppRelyOnBTC"),P("ManagerAppDepInstallRequired"),P("ManagerAppDepUninstallRequired"),P("ManagerDeviceLocked"),P("ManagerFirmwareNotEnoughSpace"),P("ManagerNotEnoughSpace"),P("ManagerUninstallBTCDep"),P("NetworkDown"),P("NetworkError"),P("NoAddressesFound"),P("NotEnoughBalance"),P("NotEnoughBalanceFees"),P("NotEnoughBalanceSwap"),P("NotEnoughBalanceToDelegate"),P("UnstakeNotEnoughStakedBalanceLeft"),P("RestakeNotEnoughStakedBalanceLeft"),P("NotEnoughToRestake"),P("NotEnoughToUnstake"),P("NotEnoughBalanceInParentAccount"),P("NotEnoughSpendableBalance"),P("NotEnoughBalanceBecauseDestinationNotCreated"),P("NotEnoughToStake"),P("NoAccessToCamera"),P("NotEnoughGas"),P("NotEnoughGasSwap"),P("TronEmptyAccount"),P("MaybeKeepTronAccountAlive"),P("NotSupportedLegacyAddress"),P("GasLessThanEstimate"),P("PriorityFeeTooLow"),P("PriorityFeeTooHigh"),P("PriorityFeeHigherThanMaxFee"),P("MaxFeeTooLow"),P("PasswordsDontMatch"),P("PasswordIncorrect"),P("RecommendSubAccountsToEmpty"),P("RecommendUndelegation"),P("TimeoutTagged"),P("UnexpectedBootloader"),P("MCUNotGenuineToDashboard"),P("RecipientRequired"),P("UnavailableTezosOriginatedAccountReceive"),P("UnavailableTezosOriginatedAccountSend"),P("UpdateFetchFileFail"),P("UpdateIncorrectHash"),P("UpdateIncorrectSig"),P("UpdateYourApp"),P("UserRefusedDeviceNameChange"),P("UserRefusedAddress"),P("UserRefusedFirmwareUpdate"),P("UserRefusedAllowManager"),P("UserRefusedOnDevice"),P("PinNotSet"),P("ExpertModeRequired");let C=P("TransportOpenUserCancelled");P("TransportInterfaceNotAvailable");let D=P("TransportRaceCondition");
41P("TransportWebUSBGestureRequired"),P("TransactionHasBeenValidatedError"),P("TransportExchangeTimeoutError"),P("DeviceShouldStayInApp"),P("WebsocketConnectionError"),P("WebsocketConnectionFailed"),P("WrongDeviceForAccount"),P("WrongDeviceForAccountPayout"),P("MissingSwapPayloadParamaters"),P("WrongDeviceForAccountRefund"),P("WrongAppForCurrency"),P("ETHAddressNonEIP"),P("CantScanQRCode"),P("FeeNotLoaded"),P("FeeNotLoadedSwap"),P("FeeRequired"),P("FeeTooHigh"),P("PendingOperation"),P("SyncError"),P("PairingFailed"),P("PeerRemovedPairing"),P("GenuineCheckFailed"),P("LedgerAPI4xx"),P("LedgerAPI5xx"),P("FirmwareOrAppUpdateRequired"),P("ReplacementTransactionUnderpriced"),P("OpReturnSizeLimit"),P("DustLimit"),P("LanguageNotFound"),P("NoDBPathGiven"),P("DBWrongPassword"),P("DBNotReset"),P("SequenceNumberError"),P("DisabledTransactionBroadcastError"),function(e){e.Unknown="Unknown",e.LocationServicesDisabled="LocationServicesDisabled",e.LocationServicesUnauthorized="LocationServicesUnauthorized",e.BluetoothScanStartFailed="BluetoothScanStartFailed"}(n||(n={}));class j extends Error{id;constructor(e,t){let r="TransportError";super(e||r),this.name=r,this.message=e,this.stack=Error(e).stack,this.id=t}}T("TransportError",e=>new j(e.message,e.id));let R={ACCESS_CONDITION_NOT_FULFILLED:38916,ALGORITHM_NOT_SUPPORTED:38020,CLA_NOT_SUPPORTED:28160,CODE_BLOCKED:38976,CODE_NOT_INITIALIZED:38914,COMMAND_INCOMPATIBLE_FILE_STRUCTURE:27009,CONDITIONS_OF_USE_NOT_SATISFIED:27013,CONTRADICTION_INVALIDATION:38928,CONTRADICTION_SECRET_CODE_STATUS:38920,DEVICE_IN_RECOVERY_MODE:26159,CUSTOM_IMAGE_EMPTY:26158,FILE_ALREADY_EXISTS:27273,FILE_NOT_FOUND:37892,GP_AUTH_FAILED:25344,HALTED:28586,INCONSISTENT_FILE:37896,INCORRECT_DATA:27264,INCORRECT_LENGTH:26368,INCORRECT_P1_P2:27392,INS_NOT_SUPPORTED:27904,DEVICE_NOT_ONBOARDED:27911,DEVICE_NOT_ONBOARDED_2:26129,INVALID_KCV:38021,INVALID_OFFSET:37890,LICENSING:28482,LOCKED_DEVICE:21781,MAX_VALUE_REACHED:38992,MEMORY_PROBLEM:37440,MISSING_CRITICAL_PARAMETER:26624,NO_EF_SELECTED:37888,NOT_ENOUGH_MEMORY_SPACE:27268,OK:36864,PIN_REMAINING_ATTEMPTS:25536,REFERENCED_DATA_NOT_FOUND:27272,SECURITY_STATUS_NOT_SATISFIED:27010,TECHNICAL_PROBLEM:28416,UNKNOWN_APDU:27906,USER_REFUSED_ON_DEVICE:21761,NOT_ENOUGH_SPACE:20738,APP_NOT_FOUND_OR_INVALID_CONTEXT:20771,INVALID_APP_NAME_LENGTH:26378,GEN_AES_KEY_FAILED:21529,INTERNAL_CRYPTO_OPERATION_FAILED:21530,INTERNAL_COMPUTE_AES_CMAC_FAILED:21531,ENCRYPT_APP_STORAGE_FAILED:21532,INVALID_BACKUP_STATE:26178,PIN_NOT_SET:21762,INVALID_BACKUP_LENGTH:26419,INVALID_RESTORE_STATE:26179,INVALID_CHUNK_LENGTH:26420,INVALID_BACKUP_HEADER:26698,TRUSTCHAIN_WRONG_SEED:45063};function L(e){switch(e){case 26368:return"Incorrect length";case 26624:return"Missing critical parameter";case 27010:return"Security not satisfied (dongle locked or have invalid access rights)";case 27013:return"Condition of use not satisfied (denied by the user?)";case 27264:return"Invalid data received";case 27392:return"Invalid parameter received";case 21781:return"Locked device"}if(28416<=e&&e<=28671)return"Internal error, please report"}class B extends Error{statusCode;statusText;constructor(e,{canBeMappedToChildError:t=!0}={}){let r=Object.keys(R).find(t=>R[t]===e)||"UNKNOWN_ERROR",n=L(e)||r,i=e.toString(16),o=`Ledger device: ${n} (0x${i})`;if(super(o),this.name="TransportStatusError",this.statusCode=e,this.statusText=r,Object.setPrototypeOf(this,B.prototype),t&&e===R.LOCKED_DEVICE)return new U(o)}}class U extends B{constructor(e){super(R.LOCKED_DEVICE,{canBeMappedToChildError:!1}),e&&(this.message=e),this.name="LockedDeviceError",Object.setPrototypeOf(this,U.prototype)}}T("TransportStatusError",e=>new B(e.statusCode));let $=0,K=[],F=(e,t,r)=>{let n={type:e,id:String(++$),date:new Date};t&&(n.message=t),r&&(n.data=r),H(n)},z=({type:e,message:t,data:r,context:n})=>{let i={type:e,id:String(++$),date:new Date};t&&(i.message=t),r&&(i.data=r),n&&(i.context=n),H(i)};class q{type;context;constructor(e,t){this.type=e,this.context=t}trace(e,t){z({type:this.type,message:e,data:t,context:this.context})}getContext(){return this.context}setContext(e){this.context=e}updateContext(e){this.context={...this.context,...e}}getType(){return this.type}setType(e){this.type=e}withType(e){return new q(e,this.context)}
41withContext(e){return new q(this.type,e)}withUpdatedContext(e){return new q(this.type,{...this.context,...e})}}let V=e=>(K.push(e),()=>{let t=K.indexOf(e);-1!==t&&(K[t]=K[K.length-1],K.pop())});function H(e){for(let t=0;t<K.length;t++)try{K[t](e)}catch(e){console.error(e)}}"undefined"!=typeof window&&(window.__ledgerLogsListen=V);var G=r(75927).Buffer;let W="transport";class J{exchangeTimeout=3e4;unresponsiveTimeout=15e3;deviceModel=null;tracer;constructor({context:e,logType:t}={}){this.tracer=new q(t??W,e)}static isSupported;static list;static listen;static open;exchange(e,{abortTimeoutMs:t}={}){throw Error("exchange not implemented")}exchangeBulk(e,t){let r=!1,n=()=>{r=!0};return(async()=>{if(!r)for(let n of e){let e=await this.exchange(n);if(r)return;let i=e.readUInt16BE(e.length-2);if(i!==R.OK)throw new B(i);t.next(e)}})().then(()=>!r&&t.complete(),e=>!r&&t.error(e)),{unsubscribe:n}}setScrambleKey(e){}close(){return Promise.resolve()}_events=new(A());on(e,t){this._events.on(e,t)}off(e,t){this._events.removeListener(e,t)}emit(e,...t){this._events.emit(e,...t)}setDebugMode(){console.warn("setDebugMode is deprecated. use @ledgerhq/logs instead. No logs are emitted in this anymore.")}setExchangeTimeout(e){this.exchangeTimeout=e}setExchangeUnresponsiveTimeout(e){this.unresponsiveTimeout=e}send=async(e,t,r,n,i=G.alloc(0),o=[R.OK],{abortTimeoutMs:s}={})=>{let a=this.tracer.withUpdatedContext({function:"send"});if(i.length>=256)throw a.trace("data.length exceeded 256 bytes limit",{dataLength:i.length}),new j("data.length exceed 256 bytes limit. Got: "+i.length,"DataLengthTooBig");let c=await this.exchange(G.concat([G.from([e,t,r,n]),G.from([i.length]),i]),{abortTimeoutMs:s}),u=c.readUInt16BE(c.length-2);if(!o.some(e=>e===u))throw new B(u);return c};static create(e=3e3,t){return new Promise((r,n)=>{let i=!1,o=this.listen({next:t=>{i=!0,o&&o.unsubscribe(),s&&clearTimeout(s),this.open(t.descriptor,e).then(r,n)},error:e=>{s&&clearTimeout(s),n(e)},complete:()=>{s&&clearTimeout(s),i||n(new j(this.ErrorMessage_NoDeviceFound,"NoDeviceFound"))}}),s=t?setTimeout(()=>{o.unsubscribe(),n(new j(this.ErrorMessage_ListenTimeout,"ListenTimeout"))},t):null})}exchangeBusyPromise;async exchangeAtomicImpl(e){let t;let r=this.tracer.withUpdatedContext({function:"exchangeAtomicImpl",unresponsiveTimeout:this.unresponsiveTimeout});if(this.exchangeBusyPromise)throw r.trace("Atomic exchange is already busy"),new D("An action was already pending on the Ledger device. Please deny or reconnect.");let n=new Promise(e=>{t=e});this.exchangeBusyPromise=n;let i=!1,o=setTimeout(()=>{r.trace('Timeout reached, emitting Transport event "unresponsive"',{unresponsiveTimeout:this.unresponsiveTimeout}),i=!0,this.emit("unresponsive")},this.unresponsiveTimeout);try{let t=await e();return i&&(r.trace("Device was unresponsive, emitting responsive"),this.emit("responsive")),t}finally{r.trace("Finalize, clearing busy guard"),clearTimeout(o),t&&t(),this.exchangeBusyPromise=null}}decorateAppAPIMethods(e,t,r){for(let n of t)e[n]=this.decorateAppAPIMethod(n,e[n],e,r)}_appAPIlock=null;decorateAppAPIMethod(e,t,r,n){return async(...i)=>{let{_appAPIlock:o}=this;if(o)return Promise.reject(new j("Ledger Device is busy (lock "+o+")","TransportLocked"));try{return this._appAPIlock=e,this.setScrambleKey(n),await t.apply(r,i)}finally{this._appAPIlock=null}}}setTraceContext(e){this.tracer=this.tracer.withContext(e)}updateTraceContext(e){this.tracer.updateContext(e)}getTraceContext(){return this.tracer.getContext()}static ErrorMessage_ListenTimeout="No Ledger device found (timeout)";static ErrorMessage_NoDeviceFound="No Ledger device found"}var Z=r(75927).Buffer;let Y=5;function X(e){let t=Z.alloc(2);return t.writeUInt16BE(e,0),t}let Q={data:Z.alloc(0),dataLength:0,sequence:0},ee=(e,t)=>({makeBlocks(r){let n=Z.concat([X(r.length),r]),i=t-5,o=Math.ceil(n.length/i);n=Z.concat([n,Z.alloc(o*i-n.length+1).fill(0)]);let s=[];for(let t=0;t<o;t++){let r=Z.alloc(5);r.writeUInt16BE(e,0),r.writeUInt8(Y,2),r.writeUInt16BE(t,3);let o=n.slice(t*i,(t+1)*i);s.push(Z.concat([r,o]))}return s},reduceResponse(t,r){let{data:n,dataLength:i,sequence:o}=t||Q;if(r.readUInt16BE(0)!==e)throw new j("Invalid channel","InvalidChannel");
41if(r.readUInt8(2)!==Y)throw new j("Invalid tag","InvalidTag");if(r.readUInt16BE(3)!==o)throw new j("Invalid sequence","InvalidSequence");t||(i=r.readUInt16BE(5)),o++;let s=r.slice(t?5:7);return(n=Z.concat([n,s])).length>i&&(n=n.slice(0,i)),{data:n,dataLength:i,sequence:o}},getReducedResult(e){if(e&&e.dataLength===e.data.length)return e.data}});var et=r(60235),er=r.n(et);!function(e){e.blue="blue",e.nanoS="nanoS",e.nanoSP="nanoSP",e.nanoX="nanoX",e.stax="stax",e.europa="europa",e.apex="apex"}(i||(i={}));let en={[i.blue]:{id:i.blue,productName:"Ledger\xa0Blue",productIdMM:0,legacyUsbProductId:0,usbOnly:!0,memorySize:491520,masks:[0x31000000,0x31010000],getBlockSize:e=>4096},[i.nanoS]:{id:i.nanoS,productName:"Ledger\xa0Nano\xa0S",productIdMM:16,legacyUsbProductId:1,usbOnly:!0,memorySize:327680,masks:[0x31100000],getBlockSize:e=>er().lt(er().coerce(e)??"","2.0.0")?4096:2048},[i.nanoX]:{id:i.nanoX,productName:"Ledger\xa0Nano\xa0X",productIdMM:64,legacyUsbProductId:4,usbOnly:!1,memorySize:2097152,masks:[0x33000000],getBlockSize:e=>4096,bluetoothSpec:[{serviceUuid:"13d63400-2c97-0004-0000-4c6564676572",notifyUuid:"13d63400-2c97-0004-0001-4c6564676572",writeUuid:"13d63400-2c97-0004-0002-4c6564676572",writeCmdUuid:"13d63400-2c97-0004-0003-4c6564676572"}]},[i.nanoSP]:{id:i.nanoSP,productName:"Ledger Nano S Plus",productIdMM:80,legacyUsbProductId:5,usbOnly:!0,memorySize:1569792,masks:[0x33100000],getBlockSize:e=>32},[i.apex]:{id:i.apex,productName:"Ledger\xa0Nano\xa0Gen5",productIdMM:128,legacyUsbProductId:8,usbOnly:!1,memorySize:1569792,masks:[0x33400000],getBlockSize:e=>32,bluetoothSpec:[{serviceUuid:"13d63400-2c97-8004-0000-4c6564676572",notifyUuid:"13d63400-2c97-8004-0001-4c6564676572",writeUuid:"13d63400-2c97-8004-0002-4c6564676572",writeCmdUuid:"13d63400-2c97-8004-0003-4c6564676572"}]},[i.stax]:{id:i.stax,productName:"Ledger\xa0Stax",productIdMM:96,legacyUsbProductId:6,usbOnly:!1,memorySize:1569792,masks:[0x33200000],getBlockSize:e=>32,bluetoothSpec:[{serviceUuid:"13d63400-2c97-6004-0000-4c6564676572",notifyUuid:"13d63400-2c97-6004-0001-4c6564676572",writeUuid:"13d63400-2c97-6004-0002-4c6564676572",writeCmdUuid:"13d63400-2c97-6004-0003-4c6564676572"}]},[i.europa]:{id:i.europa,productName:"Ledger\xa0Flex",productIdMM:112,legacyUsbProductId:7,usbOnly:!1,memorySize:1569792,masks:[0x33300000],getBlockSize:e=>32,bluetoothSpec:[{serviceUuid:"13d63400-2c97-3004-0000-4c6564676572",notifyUuid:"13d63400-2c97-3004-0001-4c6564676572",writeUuid:"13d63400-2c97-3004-0002-4c6564676572",writeCmdUuid:"13d63400-2c97-3004-0003-4c6564676572"}]}};i.blue,i.nanoS,i.nanoSP,i.nanoX,i.stax,i.europa;let ei=Object.values(en),eo=11415,es=e=>{let t=ei.find(t=>t.legacyUsbProductId===e);if(t)return t;let r=e>>8;return ei.find(e=>e.productIdMM===r)},ea=[],ec={};for(let e in en){let t=en[e],{bluetoothSpec:r}=t;if(r)for(let e=0;e<r.length;e++){let n=r[e];ea.push(n.serviceUuid),ec[n.serviceUuid]=ec[n.serviceUuid.replace(/-/g,"")]={deviceModel:t,...n}}}var eu=r(75927).Buffer;let el=[{vendorId:eo}],ed=()=>Promise.resolve(!!(window.navigator&&window.navigator.hid)),ef=()=>{let{hid:e}=navigator;if(!e)throw new j("navigator.hid is not supported","HIDNotSupported");return e};async function eh(){let e=await ef().requestDevice({filters:el});return Array.isArray(e)?e:[e]}async function ep(){return(await ef().getDevices()).filter(e=>e.vendorId===eo)}async function ey(){let e=await ep();return e.length>0?e[0]:(await eh())[0]}class eg extends J{device;deviceModel;channel=Math.floor(65535*Math.random());packetSize=64;constructor(e){super(),this.device=e,this.deviceModel="number"==typeof e.productId?es(e.productId):void 0,e.addEventListener("inputreport",this.onInputReport)}inputs=[];inputCallback;read=()=>this.inputs.length?Promise.resolve(this.inputs.shift()):new Promise(e=>{this.inputCallback=e});onInputReport=e=>{let t=eu.from(e.data.buffer);this.inputCallback?(this.inputCallback(t),this.inputCallback=null):this.inputs.push(t)};static isSupported=ed;static list=ep;static listen=e=>{let t=!1;return ey().then(r=>{if(r){if(!t){let t="number"==typeof r.productId?es(r.productId):void 0;e.next({type:"add",descriptor:r,deviceModel:t}),e.complete()}}else e.error(new C("Access denied to use Ledger device"))},t=>{e.error(new C(t.message))}),{unsubscribe:function(){t=!0}}};static async request(){let[e]=await eh();return eg.open(e)}static async openConnected(){let e=await ep();return 0===e.length?null:eg.open(e[0])}static async open(e){await e.open();let t=new eg(e),r=n=>{e===n.device&&(ef().removeEventListener("disconnect",r),t._emitDisconnect(new N))};return ef().addEventListener("disconnect",r),t}_disconnectEmitted=!1;_emitDisconnect=e=>
41{this._disconnectEmitted||(this._disconnectEmitted=!0,this.emit("disconnect",e))};async close(){await this.exchangeBusyPromise,this.device.removeEventListener("inputreport",this.onInputReport),await this.device.close()}exchange=async e=>await this.exchangeAtomicImpl(async()=>{let t,r;let{channel:n,packetSize:i}=this;F("apdu","=> "+e.toString("hex"));let o=ee(n,i),s=o.makeBlocks(e);for(let e=0;e<s.length;e++)await this.device.sendReport(0,s[e]);for(;!(t=o.getReducedResult(r));)try{let e=await this.read();r=o.reduceResponse(r,e)}catch(e){if(e instanceof j&&"InvalidChannel"===e.id)continue;throw e}return F("apdu","<= "+t.toString("hex")),t}).catch(e=>{if(e&&e.message&&e.message.includes("write"))throw this._emitDisconnect(e),new k(e.message);throw e});setScrambleKey(){}}var em=r(15363),eb=r(85771),ev=r(20791),ew=r(84136),e_=r(75927).Buffer,eE="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},eS=function(e){try{return!!e()}catch(e){return!0}},ex=!eS(function(){var e=(function(){}).bind();return"function"!=typeof e||e.hasOwnProperty("prototype")}),eA=ex,eI=Function.prototype,eO=eI.call,eT=eA&&eI.bind.bind(eO,eO),eP=eA?eT:function(e){return function(){return eO.apply(e,arguments)}},eM=eP,eN=eM({}.toString),ek=eM("".slice),eC=function(e){return ek(eN(e),8,-1)},eD=eS,ej=eC,eR=Object,eL=eP("".split),eB=eD(function(){return!eR("z").propertyIsEnumerable(0)})?function(e){return"String"===ej(e)?eL(e,""):eR(e)}:eR,eU=function(e){return null==e},e$=eU,eK=TypeError,eF=function(e){if(e$(e))throw new eK("Can't call method on "+e);return e},ez=eB,eq=eF,eV=function(e){return ez(eq(e))},eH=function(e){return e&&e.Math===Math&&e},eG=eH("object"==typeof globalThis&&globalThis)||eH("object"==typeof window&&window)||eH("object"==typeof self&&self)||eH("object"==typeof eE&&eE)||eH("object"==typeof eE&&eE)||function(){return this}()||Function("return this")(),eW={exports:{}},eJ=eG,eZ=Object.defineProperty,eY=function(e,t){try{eZ(eJ,e,{value:t,configurable:!0,writable:!0})}catch(r){eJ[e]=t}return t},eX=eG,eQ=eY,e0="__core-js_shared__",e1=eW.exports=eX[e0]||eQ(e0,{});(e1.versions||(e1.versions=[])).push({version:"3.41.0",mode:"global",copyright:"\xa9 2014-2025 Denis Pushkarev (zloirock.ru)",license:"https://github.com/zloirock/core-js/blob/v3.41.0/LICENSE",source:"https://github.com/zloirock/core-js"});var e2=eW.exports,e5=function(e,t){return e2[e]||(e2[e]=t||{})},e3=eF,e8=Object,e6=function(e){return e8(e3(e))},e4=e6,e9=eP({}.hasOwnProperty),e7=Object.hasOwn||function(e,t){return e9(e4(e),t)},te=0,tt=Math.random(),tr=eP(1..toString),tn=function(e){return"Symbol("+(void 0===e?"":e)+")_"+tr(++te+tt,36)},ti=eG.navigator,to=ti&&ti.userAgent,ts=to?String(to):"",ta=eG,tc=ts,tu=ta.process,tl=ta.Deno,td=tu&&tu.versions||tl&&tl.version,tf=td&&td.v8;tf&&(s=(o=tf.split("."))[0]>0&&o[0]<4?1:+(o[0]+o[1])),!s&&tc&&(!(o=tc.match(/Edge\/(\d+)/))||o[1]>=74)&&(o=tc.match(/Chrome\/(\d+)/))&&(s=+o[1]);var th=s,tp=th,ty=eS,tg=eG.String,tm=!!Object.getOwnPropertySymbols&&!ty(function(){var e=Symbol("symbol detection");return!tg(e)||!(Object(e)instanceof Symbol)||!Symbol.sham&&tp&&tp<41}),tb=tm&&!Symbol.sham&&"symbol"==typeof Symbol.iterator,tv=e5,tw=e7,t_=tn,tE=tm,tS=tb,tx=eG.Symbol,tA=tv("wks"),tI=tS?tx.for||tx:tx&&tx.withoutSetter||t_,tO=function(e){return tw(tA,e)||(tA[e]=tE&&tw(tx,e)?tx[e]:tI("Symbol."+e)),tA[e]},tT="object"==typeof document&&document.all,tP=void 0===tT&&void 0!==tT?function(e){return"function"==typeof e||e===tT}:function(e){return"function"==typeof e},tM=tP,tN=function(e){return"object"==typeof e?null!==e:tM(e)},tk=tN,tC=String,tD=TypeError,tj=function(e){if(tk(e))return e;throw new tD(tC(e)+" is not an object")},tR={},tL=!eS(function(){return 7!==Object.defineProperty({},1,{get:function(){return 7}})[1]}),tB=eS,tU=tL&&tB(function(){return 42!==Object.defineProperty(function(){},"prototype",{value:42,writable:!1}).prototype}),t$={},tK=tN,tF=eG.document,tz=tK(tF)&&tK(tF.createElement),tq=function(e){return tz?tF.createElement(e):{}},tV=eS,tH=tq,tG=!tL&&!tV(function(){return 7!==Object.defineProperty(tH("div"),"a",{get:function(){return 7}}).a}),tW=ex,tJ=Function.prototype.call,tZ=tW?tJ.bind(tJ):function(){return tJ.apply(tJ,arguments)},tY=eG,tX=tP,tQ=function(e){return tX(e)?e:void 0},t0=function(e,t){return arguments.length<2?tQ(tY[e]):tY[e]&&tY[e][t]},t1=eP({}.isPrototypeOf),t2=t0,t5=tP,t3=t1,t8=Object,t6=tb?function(e){return"symbol"==typeof e}:function(e){var t=t2("Symbol");return t5(t)&&t3(t.prototype,t8(e))},t4=String,t9=function(e){try{return t4(e)}catch(e){return"Object"}},t7=tP,re=t9,rt=TypeError,rr=function(e){if(t7(e))return e;throw new rt(re(e)+" is not a function")},rn=rr,ri=eU,ro=function(e,t){var r=e[t];return ri(r)?void 0:rn(r)},rs=tZ,ra=tP,rc=tN,ru=TypeError,rl=tZ,rd=tN,rf=t6,rh=ro,rp=function(e,t){var r,n;if("string"===t&&ra(r=e.toString)&&!rc(n=rs(r,e))||ra(r=e.valueOf)&&!rc(n=rs(r,e))||"string"!==t&&ra(r=e.toString)&&!rc(n=rs(r,e)))return n;throw new ru("Can't convert object to primitive value")},ry=TypeError,rg=tO("toPrimitive"),rm=function(e,t){if(!rd(e)||rf(e))return e;var r,n=rh(e,rg);if(n){if(void 0===t&&(t="default"),!rd(r=rl(n,e,t))||rf(r))return r;throw new ry("Can't convert object to primitive value")}return void 0===t&&(t="number"),rp(e,t)},rb=rm,rv=t6,rw=function(e){var t=rb(e,"string");return rv(t)?t:t+""},r_=tL,rE=tG,rS=tU,rx=tj,rA=rw,rI=TypeError,rO=Object.defineProperty,rT=Object.getOwnPropertyDescriptor,rP="enumerable",rM="configurable",rN="writable";t$.f=r_?rS?function(e,t,r){if(rx(e),t=rA(t),rx(r),"function"==typeof e&&"prototype"===t&&"value"in r&&rN in r&&!r[rN]){var n=rT(e,t);n&&n[rN]&&(e[t]=r.value,r={configurable:rM in r?r[rM]:n[rM],enumerable:rP in r?r[rP]:n[rP],writable:!1})}return rO(e,t,r)}:rO:function(e,t,r){if(rx(e),t=rA(t),rx(r),rE)try{return rO(e,t,r)}catch(e){}if("get"in r||"set"in r)throw new rI("Accessors not supported");return"value"in r&&(e[t]=r.value),e};var rk=Math.ceil,rC=Math.floor,rD=Math.trunc||function(e){var t=+e;return(t>0?rC:rk)(t)},rj=function(e){var t=+e;return t!=t||0===t?0:rD(t)},rR=rj,rL=Math.max,rB=Math.min,rU=function(e,t){var r=rR(e);return r<0?rL(r+t,0):rB(r,t)},r$=rj,rK=Math.min,rF=function(e){var t=r$(e);return t>0?rK(t,0x1fffffffffffff):0},rz=rF,rq=function(e){return rz(e.length)},rV=eV,rH=rU,rG=rq,rW=function(e){return function(t,r,n){var i,o=rV(t),s=rG(o);if(0===s)return!e&&-1;var a=rH(n,s);if(e&&r!=r){for(;s>a;)if((i=o[a++])!=i)return!0}else for(;s>a;a++)if((e||a in o)&&o[a]===r)return e||a||0;return!e&&-1}},rJ={includes:rW(!0),indexOf:rW(!1)},rZ={},rY=eP,rX=e7,rQ=eV,r0=rJ.indexOf,r1=rZ,r2=rY([].push),r5=function(e,t){var r,n=rQ(e),i=0,o=[];for(r in n)!rX(r1,r)&&rX(n,r)&&r2(o,r);for(;t.length>i;)rX(n,r=t[i++])&&(~r0(o,r)||r2(o,r));return o},r3=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleStr
41ing","toString","valueOf"],r8=r5,r6=r3,r4=Object.keys||function(e){return r8(e,r6)},r9=tL,r7=tU,ne=t$,nt=tj,nr=eV,nn=r4;tR.f=r9&&!r7?Object.defineProperties:function(e,t){nt(e);for(var r,n=nr(t),i=nn(t),o=i.length,s=0;o>s;)ne.f(e,r=i[s++],n[r]);return e};var ni=t0("document","documentElement"),no=tn,ns=e5("keys"),na=function(e){return ns[e]||(ns[e]=no(e))},nc=tj,nu=tR,nl=r3,nd=rZ,nf=ni,nh=tq,np=">",ny="<",ng="prototype",nm="script",nb=na("IE_PROTO"),nv=function(){},nw=function(e){return ny+nm+np+e+ny+"/"+nm+np},n_=function(e){e.write(nw("")),e.close();var t=e.parentWindow.Object;return e=null,t},nE=function(){var e,t=nh("iframe"),r="java"+nm+":";return t.style.display="none",nf.appendChild(t),t.src=String(r),(e=t.contentWindow.document).open(),e.write(nw("document.F=Object")),e.close(),e.F},nS=function(){try{a=new ActiveXObject("htmlfile")}catch(e){}nS="undefined"!=typeof document?document.domain&&a?n_(a):nE():n_(a);for(var e=nl.length;e--;)delete nS[ng][nl[e]];return nS()};nd[nb]=!0;var nx=Object.create||function(e,t){var r;return null!==e?(nv[ng]=nc(e),r=new nv,nv[ng]=null,r[nb]=e):r=nS(),void 0===t?r:nu.f(r,t)},nA=tO,nI=nx,nO=t$.f,nT=nA("unscopables"),nP=Array.prototype;void 0===nP[nT]&&nO(nP,nT,{configurable:!0,value:nI(null)});var nM=function(e){nP[nT][e]=!0},nN={},nk=tP,nC=eG.WeakMap,nD=nk(nC)&&/native code/.test(String(nC)),nj=function(e,t){return{enumerable:!(1&e),configurable:!(2&e),writable:!(4&e),value:t}},nR=t$,nL=nj,nB=tL?function(e,t,r){return nR.f(e,t,nL(1,r))}:function(e,t,r){return e[t]=r,e},nU=nD,n$=eG,nK=tN,nF=nB,nz=e7,nq=eW.exports,nV=na,nH=rZ,nG="Object already initialized",nW=n$.TypeError,nJ=n$.WeakMap,nZ=function(e){return l(e)?u(e):c(e,{})},nY=function(e){return function(t){var r;if(!nK(t)||(r=u(t)).type!==e)throw new nW("Incompatible receiver, "+e+" required");return r}};if(nU||nq.state){var nX=nq.state||(nq.state=new nJ);nX.get=nX.get,nX.has=nX.has,nX.set=nX.set,c=function(e,t){if(nX.has(e))throw new nW(nG);return t.facade=e,nX.set(e,t),t},u=function(e){return nX.get(e)||{}},l=function(e){return nX.has(e)}}else{var nQ=nV("state");nH[nQ]=!0,c=function(e,t){if(nz(e,nQ))throw new nW(nG);return t.facade=e,nF(e,nQ,t),t},u=function(e){return nz(e,nQ)?e[nQ]:{}},l=function(e){return nz(e,nQ)}}var n0={set:c,get:u,has:l,enforce:nZ,getterFor:nY},n1={},n2={},n5={}.propertyIsEnumerable,n3=Object.getOwnPropertyDescriptor,n8=n3&&!n5.call({1:2},1);n2.f=n8?function(e){var t=n3(this,e);return!!t&&t.enumerable}:n5;var n6=tL,n4=tZ,n9=n2,n7=nj,ie=eV,it=rw,ir=e7,ii=tG,io=Object.getOwnPropertyDescriptor;n1.f=n6?io:function(e,t){if(e=ie(e),t=it(t),ii)try{return io(e,t)}catch(e){}if(ir(e,t))return n7(!n4(n9.f,e,t),e[t])};var is={exports:{}},ia=tL,ic=Function.prototype,iu=ia&&Object.getOwnPropertyDescriptor,il=e7(ic,"name"),id=il&&"something"===(function(){}).name,ih=il&&(!ia||ia&&iu(ic,"name").configurable),ip={EXISTS:il,PROPER:id,CONFIGURABLE:ih},iy=eP,ig=tP,im=eW.exports,ib=iy(Function.toString);ig(im.inspectSource)||(im.inspectSource=function(e){return ib(e)});var iv=im.inspectSource,iw=eP,i_=eS,iE=tP,iS=e7,ix=tL,iA=ip.CONFIGURABLE,iI=iv,iO=n0,iT=iO.enforce,iP=iO.get,iM=String,iN=Object.defineProperty,ik=iw("".slice),iC=iw("".replace),iD=iw([].join),ij=ix&&!i_(function(){return 8!==iN(function(){},"length",{value:8}).length}),iR=String(String).split("String"),iL=is.exports=function(e,t,r){"Symbol("===ik(iM(t),0,7)&&(t="["+iC(iM(t),/^Symbol\(([^)]*)\).*$/,"$1")+"]"),r&&r.getter&&(t="get "+t),r&&r.setter&&(t="set "+t),(!iS(e,"name")||iA&&e.name!==t)&&(ix?iN(e,"name",{value:t,configurable:!0}):e.name=t),ij&&r&&iS(r,"arity")&&e.length!==r.arity&&iN(e,"length",{value:r.arity});try{r&&iS(r,"constructor")&&r.constructor?ix&&iN(e,"prototype",{writable:!1}):e.prototype&&(e.prototype=void 0)}catch(e){}var n=iT(e);return iS(n,"source")||(n.source=iD(iR,"string"==typeof t?t:"")),e};Function.prototype.toString=iL(function(){return iE(this)&&iP(this).source||iI(this)},"toString");var iB=tP,iU=t$,i$=is.exports,iK=eY,iF=function(e,t,r,n){n||(n={});var i=n.enumerable,o=void 0!==n.name?n.name:t;if(iB(r)&&i$(r,o,n),n.global)i?e[t]=r:iK(t,r);
41else{try{n.unsafe?e[t]&&(i=!0):delete e[t]}catch(e){}i?e[t]=r:iU.f(e,t,{value:r,enumerable:!1,configurable:!n.nonConfigurable,writable:!n.nonWritable})}return e},iz={},iq=r5,iV=r3.concat("length","prototype");iz.f=Object.getOwnPropertyNames||function(e){return iq(e,iV)};var iH={};iH.f=Object.getOwnPropertySymbols;var iG=t0,iW=iz,iJ=iH,iZ=tj,iY=eP([].concat),iX=iG("Reflect","ownKeys")||function(e){var t=iW.f(iZ(e)),r=iJ.f;return r?iY(t,r(e)):t},iQ=e7,i0=iX,i1=n1,i2=t$,i5=function(e,t,r){for(var n=i0(t),i=i2.f,o=i1.f,s=0;s<n.length;s++){var a=n[s];iQ(e,a)||r&&iQ(r,a)||i(e,a,o(t,a))}},i3=eS,i8=tP,i6=/#|\.prototype\./,i4=function(e,t){var r=i7[i9(e)];return r===ot||r!==oe&&(i8(t)?i3(t):!!t)},i9=i4.normalize=function(e){return String(e).replace(i6,".").toLowerCase()},i7=i4.data={},oe=i4.NATIVE="N",ot=i4.POLYFILL="P",or=i4,on=eG,oi=n1.f,oo=nB,os=iF,oa=eY,oc=i5,ou=or,ol=function(e,t){var r,n,i,o,s,a=e.target,c=e.global,u=e.stat;if(r=c?on:u?on[a]||oa(a,{}):on[a]&&on[a].prototype)for(n in t){if(o=t[n],i=e.dontCallGetSet?(s=oi(r,n))&&s.value:r[n],!ou(c?n:a+(u?".":"#")+n,e.forced)&&void 0!==i){if(typeof o==typeof i)continue;oc(o,i)}(e.sham||i&&i.sham)&&oo(o,"sham",!0),os(r,n,o,e)}},od=!eS(function(){function e(){}return e.prototype.constructor=null,Object.getPrototypeOf(new e)!==e.prototype}),of=e7,oh=tP,op=e6,oy=od,og=na("IE_PROTO"),om=Object,ob=om.prototype,ov=oy?om.getPrototypeOf:function(e){var t=op(e);if(of(t,og))return t[og];var r=t.constructor;return oh(r)&&t instanceof r?r.prototype:t instanceof om?ob:null},ow=eS,o_=tP,oE=tN,oS=ov,ox=iF,oA=tO("iterator"),oI=!1;[].keys&&("next"in(h=[].keys())?(f=oS(oS(h)))!==Object.prototype&&(d=f):oI=!0),(!oE(d)||ow(function(){var e={};return d[oA].call(e)!==e}))&&(d={}),o_(d[oA])||ox(d,oA,function(){return this});var oO={IteratorPrototype:d,BUGGY_SAFARI_ITERATORS:oI},oT=t$.f,oP=e7,oM=tO("toStringTag"),oN=function(e,t,r){e&&!r&&(e=e.prototype),e&&!oP(e,oM)&&oT(e,oM,{configurable:!0,value:t})},ok=oO.IteratorPrototype,oC=nx,oD=nj,oj=oN,oR=nN,oL=function(){return this},oB=function(e,t,r,n){var i=t+" Iterator";return e.prototype=oC(ok,{next:oD(+!n,r)}),oj(e,i,!1),oR[i]=oL,e},oU=eP,o$=rr,oK=tN,oF=function(e){return oK(e)||null===e},oz=String,oq=TypeError,oV=function(e,t,r){try{return oU(o$(Object.getOwnPropertyDescriptor(e,t)[r]))}catch(e){}},oH=tN,oG=eF,oW=function(e){if(oF(e))return e;throw new oq("Can't set "+oz(e)+" as a prototype")},oJ=Object.setPrototypeOf||("__proto__"in{}?function(){var e,t=!1,r={};try{(e=oV(Object.prototype,"__proto__","set"))(r,[]),t=r instanceof Array}catch(e){}return function(r,n){return oG(r),oW(n),oH(r)&&(t?e(r,n):r.__proto__=n),r}}():void 0),oZ=ol,oY=tZ,oX=ip,oQ=tP,o0=oB,o1=ov,o2=oJ,o5=oN,o3=nB,o8=iF,o6=tO,o4=nN,o9=oO,o7=oX.PROPER,se=oX.CONFIGURABLE,st=o9.IteratorPrototype,sr=o9.BUGGY_SAFARI_ITERATORS,sn=o6("iterator"),si="keys",so="values",ss="entries",sa=function(){return this},sc=function(e,t,r,n,i,o,s){o0(r,t,n);var a,c,u,l=function(e){if(e===i&&y)return y;if(!sr&&e&&e in h)return h[e];switch(e){case si:case so:case ss:return function(){return new r(this,e)}}return function(){return new r(this)}},d=t+" Iterator",f=!1,h=e.prototype,p=h[sn]||h["@@iterator"]||i&&h[i],y=!sr&&p||l(i),g="Array"===t&&h.entries||p;if(g&&(a=o1(g.call(new e)))!==Object.prototype&&a.next&&(o1(a)===st||(o2?o2(a,st):oQ(a[sn])||o8(a,sn,sa)),o5(a,d,!0)),o7&&i===so&&p&&p.name!==so&&(se?o3(h,"name",so):(f=!0,y=function(){return oY(p,this)})),i){if(c={values:l(so),keys:o?y:l(si),entries:l(ss)},s)for(u in c)!sr&&!f&&u in h||o8(h,u,c[u]);else oZ({target:t,proto:!0,forced:sr||f},c)}return h[sn]!==y&&o8(h,sn,y,{name:i}),o4[t]=y,c},su=function(e,t){return{value:e,done:t}},sl=eV,sd=nM,sf=nN,sh=n0,sp=t$.f,sy=sc,sg=su,sm=tL,sb="Array Iterator",sv=sh.set,sw=sh.getterFor(sb),s_=sy(Array,"Array",function(e,t){sv(this,{type:sb,target:sl(e),index:0,kind:t})},function(){var e=sw(this),t=e.target,r=e.index++;if(!t||r>=t.length)return e.target=null,sg(void 0,!0);switch(e.kind){case"keys":return sg(r,!1);case"values":return sg(t[r],!1)}return sg([r,t[r]],!1)},"values"),sE=sf.Arguments=sf.Array;
41if(sd("keys"),sd("values"),sd("entries"),sm&&"values"!==sE.name)try{sp(sE,"name",{value:"values"})}catch(e){}var sS="undefined"!=typeof ArrayBuffer&&"undefined"!=typeof DataView,sx=is.exports,sA=t$,sI=function(e,t,r){return r.get&&sx(r.get,t,{getter:!0}),r.set&&sx(r.set,t,{setter:!0}),sA.f(e,t,r)},sO=iF,sT=function(e,t,r){for(var n in t)sO(e,n,t[n],r);return e},sP=t1,sM=TypeError,sN=function(e,t){if(sP(t,e))return e;throw new sM("Incorrect invocation")},sk=rj,sC=rF,sD=RangeError,sj=function(e){if(void 0===e)return 0;var t=sk(e),r=sC(t);if(t!==r)throw new sD("Wrong length or index");return r},sR=0x10000000000000,sL=Math.sign||function(e){var t=+e;return 0===t||t!=t?t:t<0?-1:1},sB=function(e){return e+sR-sR},sU=Math.abs,s$=2220446049250313e-31,sK=function(e,t,r,n){var i=+e,o=sU(i),s=sL(i);if(o<n)return s*sB(o/n/t)*n*t;var a=(1+t/s$)*o,c=a-(a-o);return c>r||c!=c?1/0*s:s*c},sF=11920928955078125e-23,sz=34028234663852886e22,sq=11754943508222875e-54,sV=Math.fround||function(e){return sK(e,sF,sz,sq)},sH=Array,sG=Math.abs,sW=Math.pow,sJ=Math.floor,sZ=Math.log,sY=Math.LN2,sX={pack:function(e,t,r){var n,i,o,s=sH(r),a=8*r-t-1,c=(1<<a)-1,u=c>>1,l=23===t?sW(2,-24)-sW(2,-77):0,d=e<0||0===e&&1/e<0?1:0,f=0;for((e=sG(e))!=e||e===1/0?(i=e!=e?1:0,n=c):(o=sW(2,-(n=sJ(sZ(e)/sY))),e*o<1&&(n--,o*=2),n+u>=1?e+=l/o:e+=l*sW(2,1-u),e*o>=2&&(n++,o/=2),n+u>=c?(i=0,n=c):n+u>=1?(i=(e*o-1)*sW(2,t),n+=u):(i=e*sW(2,u-1)*sW(2,t),n=0));t>=8;)s[f++]=255&i,i/=256,t-=8;for(n=n<<t|i,a+=t;a>0;)s[f++]=255&n,n/=256,a-=8;return s[f-1]|=128*d,s},unpack:function(e,t){var r,n=e.length,i=8*n-t-1,o=(1<<i)-1,s=o>>1,a=i-7,c=n-1,u=e[c--],l=127&u;for(u>>=7;a>0;)l=256*l+e[c--],a-=8;for(r=l&(1<<-a)-1,l>>=-a,a+=t;a>0;)r=256*r+e[c--],a-=8;if(0===l)l=1-s;else{if(l===o)return r?NaN:u?-1/0:1/0;r+=sW(2,t),l-=s}return(u?-1:1)*r*sW(2,l-t)}},sQ=e6,s0=rU,s1=rq,s2=function(e){for(var t=sQ(this),r=s1(t),n=arguments.length,i=s0(n>1?arguments[1]:void 0,r),o=n>2?arguments[2]:void 0,s=void 0===o?r:s0(o,r);s>i;)t[i++]=e;return t},s5=eP([].slice),s3=tP,s8=tN,s6=oJ,s4=function(e,t,r){var n,i;return s6&&s3(n=t.constructor)&&n!==r&&s8(i=n.prototype)&&i!==r.prototype&&s6(e,i),e},s9=eG,s7=eP,ae=tL,at=sS,ar=ip,an=nB,ai=sI,ao=sT,as=eS,aa=sN,ac=rj,au=rF,al=sj,ad=sV,af=sX,ah=ov,ap=oJ,ay=s2,ag=s5,am=s4,ab=i5,av=oN,aw=n0,a_=ar.PROPER,aE=ar.CONFIGURABLE,aS="ArrayBuffer",ax="DataView",aA="prototype",aI="Wrong length",aO="Wrong index",aT=aw.getterFor(aS),aP=aw.getterFor(ax),aM=aw.set,aN=s9[aS],ak=aN,aC=ak&&ak[aA],aD=s9[ax],aj=aD&&aD[aA],aR=Object.prototype,aL=s9.Array,aB=s9.RangeError,aU=s7(ay),a$=s7([].reverse),aK=af.pack,aF=af.unpack,az=function(e){return[255&e]},aq=function(e){return[255&e,e>>8&255]},aV=function(e){return[255&e,e>>8&255,e>>16&255,e>>24&255]},aH=function(e){return e[3]<<24|e[2]<<16|e[1]<<8|e[0]},aG=function(e){return aK(ad(e),23,4)},aW=function(e){return aK(e,52,8)},aJ=function(e,t,r){ai(e[aA],t,{configurable:!0,get:function(){return r(this)[t]}})},aZ=function(e,t,r,n){var i=aP(e),o=al(r),s=!!n;if(o+t>i.byteLength)throw new aB(aO);var a=i.bytes,c=o+i.byteOffset,u=ag(a,c,c+t);return s?u:a$(u)},aY=function(e,t,r,n,i,o){var s=aP(e),a=al(r),c=n(+i),u=!!o;if(a+t>s.byteLength)throw new aB(aO);for(var l=s.bytes,d=a+s.byteOffset,f=0;f<t;f++)l[d+f]=c[u?f:t-f-1]};if(at){var aX=a_&&aN.name!==aS;!as(function(){aN(1)})||!as(function(){new aN(-1)})||as(function(){return new aN,new aN(1.5),new aN(NaN),1!==aN.length||aX&&!aE})?((ak=function(e){return aa(this,aC),am(new aN(al(e)),this,ak)})[aA]=aC,aC.constructor=ak,ab(ak,aN)):aX&&aE&&an(aN,"name",aS),ap&&ah(aj)!==aR&&ap(aj,aR);var aQ=new aD(new ak(2)),a0=s7(aj.setInt8);aQ.setInt8(0,0x80000000),aQ.setInt8(1,0x80000001),(aQ.getInt8(0)||!aQ.getInt8(1))&&ao(aj,{setInt8:function(e,t){a0(this,e,t<<24>>24)},setUint8:function(e,t){a0(this,e,t<<24>>24)}},{unsafe:!0})}else aC=(ak=function(e){aa(this,aC);var t=al(e);aM(this,{type:aS,bytes:aU(aL(t),0),byteLength:t}),ae||(this.byteLength=t,this.detached=!1)})[aA],aj=(aD=function(e,t,r){aa(this,aj),aa(e,aC);var n=aT(e),i=n.byteLength,o=ac(t);if(o<0||o>i)throw new aB("Wrong offset");if(r=void 0===r?i-o:au(r),o+r>i)throw new aB(aI);aM(this,{type:ax,buffer:e,byteLength:r,byteOffset:o,bytes:n.bytes}),ae||(this.buffer=e,this.byteLength=r,this.byteOffset=o)})[aA],ae&&(aJ(ak,"byteLength",aT),aJ(aD,"buffer",aP),aJ(aD,"byteLength",aP),aJ(aD,"byteOffset",aP)),ao(aj,{getInt8:function(e){return aZ(this,1,e)[0]<<24>>24},getUint8:function(e){return aZ(this,1,e)[0]},getInt16:function(e){var t=aZ(this,2,e,arguments.length>1&&arguments[1]);return(t[1]<<8|t[0])<<16>>16},getUint16:function(e){var t=aZ(this,2,e,arguments.length>1&&arguments[1]);return t[1]<<8|t[0]},getInt32:function(e){return aH(aZ(this,4,e,arguments.length>1&&arguments[1]))},getUint32:function(e){return aH(aZ(this,4,e,arguments.length>1&&arguments[1]))>>>0},getFloat32:function(e){return aF(aZ(this,4,e,arguments.length>1&&arguments[1]),23)},getFloat64:function(e){return aF(aZ(this,8,e,arguments.length>1&&arguments[1]),52)},setInt8:function(e,t){aY(this,1,e,az,t)},setUint8:function(e,t){aY(this,1,e,az,t)},setInt16:function(e,t){aY(this,2,e,aq,t,arguments.length>2&&arguments[2])},setUint16:function(e,t){aY(this,2,e,aq,t,arguments.length>2&&arguments[2])},setInt32:function(e,t){aY(this,4,e,aV,t,arguments.length>2&&arguments[2])},setUint32:function(e,t){aY(this,4,e,aV,t,arguments.length>2&&arguments[2])},setFloat32:function(e,t){aY(this,4,e,aG,t,arguments.length>2&&arguments[2])},setFloat64:function(e,t){aY(this,8,e,aW,t,arguments.length>2&&arguments[2])}});av(ak,aS),av(aD,ax);var a1={ArrayBuffer:ak,DataView:aD},a2=t0,a5=sI,a3=tL,a8=tO("species"),a6=function(e){var t=a2(e);a3&&t&&!t[a8]&&a5(t,a8,{configurable:!0,get:function(){return this}})},a4=ol,a9=eG,a7=a6,ce="ArrayBuffer",ct=a1[ce];a4({global:!0,constructor:!0,forced:a9[ce]!==ct},{ArrayBuffer:ct}),a7(ce);var cr=eC,cn=eP,ci=function(e){if("Function"===cr(e))return cn(e)},co=ol,cs=ci,ca=eS,cc=a1,cu=tj,cl=rU,cd=rF,cf=cc.ArrayBuffer,ch=cc.DataView,cp=ch.prototype,cy=cs(cf.prototype.slice),cg=cs(cp.getUint8),cm=cs(cp.setUint8);co({target:"ArrayBuffer",proto:!0,unsafe:!0,forced:ca(function(){return!new cf(2).slice(1,void 0).byteLength})},{slice:function(e,t){if(cy&&void 0===t)return cy(cu(this),e);for(var r=cu(this).byteLength,n=cl(e,r),i=cl(void 0===t?r:t,r),o=new cf(cd(i-n)),s=new ch(this),a=new ch(o),c=0;n<i;)cm(a,c++,cg(s,n++));return o}});var cb=tO("toStringTag"),cv={};cv[cb]="z";var cw="[object z]"===String(cv),c_=tP,cE=eC,cS=tO("toStringTag"),cx=Object,cA="Arguments"===cE(function(){return arguments}()),cI=function(e,t){try{return e[t]}catch(e){}},cO=cw?cE:function(e){var t,r,n;return void 0===e?"Undefined":null===e?"Null":"string"==typeof(r=cI(t=cx(e),cS))?r:cA?cE(t):"Object"===(n=cE(t))&&c_(t.callee)?"Arguments":n},cT=cO,cP=String,cM=function(e){if("Symbol"===cT(e))throw TypeError("Cannot convert a Symbol value to a string");return cP(e)},cN=tj,ck=tZ,cC=e7,cD=t1,cj=function(){var e=cN(this),t="";return e.hasIndices&&(t+="d"),e.global&&(t+="g"),e.ignoreCase&&(t+="i"),e.multiline&&(t+="m"),e.dotAll&&(t+="s"),e.unicode&&(t+="u"),e.unicodeSets&&(t+="v"),e.sticky&&(t+="y"),t},cR=RegExp.prototype,cL=function(e){var t=e.flags;return!(void 0===t&&!("flags"in cR)&&!cC(e,"flags")&&cD(cR,e))?t:ck(cj,e)},cB=ip.PROPER,cU=iF,c$=tj,cK=cM,cF=eS,cz=cL,cq="toString",cV=RegExp.prototype,cH=cV[cq],cG=cF(function(){return"/a/b"!==cH.call({
41source:"a",flags:"b"})}),cW=cB&&cH.name!==cq;(cG||cW)&&cU(cV,cq,function(){var e=c$(this);return"/"+cK(e.source)+"/"+cK(cz(e))},{unsafe:!0});var cJ={exports:{}},cZ=tO("iterator"),cY=!1;try{var cX=0,cQ={next:function(){return{done:!!cX++}},return:function(){cY=!0}};cQ[cZ]=function(){return this},Array.from(cQ,function(){throw 2})}catch(e){}var c0=function(e,t){try{if(!t&&!cY)return!1}catch(e){return!1}var r=!1;try{var n={};n[cZ]=function(){return{next:function(){return{done:r=!0}}}},e(n)}catch(e){}return r},c1=sS,c2=tL,c5=eG,c3=tP,c8=tN,c6=e7,c4=cO,c9=t9,c7=nB,ue=iF,ut=sI,ur=t1,un=ov,ui=oJ,uo=tO,us=tn,ua=n0,uc=ua.enforce,uu=ua.get,ul=c5.Int8Array,ud=ul&&ul.prototype,uf=c5.Uint8ClampedArray,uh=uf&&uf.prototype,up=ul&&un(ul),uy=ud&&un(ud),ug=Object.prototype,um=c5.TypeError,ub=uo("toStringTag"),uv=us("TYPED_ARRAY_TAG"),uw="TypedArrayConstructor",u_=c1&&!!ui&&"Opera"!==c4(c5.opera),uE=!1,uS={Int8Array:1,Uint8Array:1,Uint8ClampedArray:1,Int16Array:2,Uint16Array:2,Int32Array:4,Uint32Array:4,Float32Array:4,Float64Array:8},ux={BigInt64Array:8,BigUint64Array:8},uA=function(e){if(!c8(e))return!1;var t=c4(e);return"DataView"===t||c6(uS,t)||c6(ux,t)},uI=function(e){var t=un(e);if(c8(t)){var r=uu(t);return r&&c6(r,uw)?r[uw]:uI(t)}},uO=function(e){if(!c8(e))return!1;var t=c4(e);return c6(uS,t)||c6(ux,t)},uT=function(e){if(uO(e))return e;throw new um("Target is not a typed array")},uP=function(e){if(c3(e)&&(!ui||ur(up,e)))return e;throw new um(c9(e)+" is not a typed array constructor")},uM=function(e,t,r,n){if(c2){if(r)for(var i in uS){var o=c5[i];if(o&&c6(o.prototype,e))try{delete o.prototype[e]}catch(r){try{o.prototype[e]=t}catch(e){}}}(!uy[e]||r)&&ue(uy,e,r?t:u_&&ud[e]||t,n)}},uN=function(e,t,r){var n,i;if(c2){if(ui){if(r){for(n in uS)if((i=c5[n])&&c6(i,e))try{delete i[e]}catch(e){}}if(up[e]&&!r)return;try{return ue(up,e,r?t:u_&&up[e]||t)}catch(e){}}for(n in uS)(i=c5[n])&&(!i[e]||r)&&ue(i,e,t)}};for(p in uS)(g=(y=c5[p])&&y.prototype)?uc(g)[uw]=y:u_=!1;for(p in ux)(g=(y=c5[p])&&y.prototype)&&(uc(g)[uw]=y);if((!u_||!c3(up)||up===Function.prototype)&&(up=function(){throw new um("Incorrect invocation")},u_))for(p in uS)c5[p]&&ui(c5[p],up);if((!u_||!uy||uy===ug)&&(uy=up.prototype,u_))for(p in uS)c5[p]&&ui(c5[p].prototype,uy);if(u_&&un(uh)!==uy&&ui(uh,uy),c2&&!c6(uy,ub))for(p in uE=!0,ut(uy,ub,{configurable:!0,get:function(){return c8(this)?this[uv]:void 0}}),uS)c5[p]&&c7(c5[p],uv,p);var uk={NATIVE_ARRAY_BUFFER_VIEWS:u_,TYPED_ARRAY_TAG:uE&&uv,aTypedArray:uT,aTypedArrayConstructor:uP,exportTypedArrayMethod:uM,exportTypedArrayStaticMethod:uN,getTypedArrayConstructor:uI,isView:uA,isTypedArray:uO,TypedArray:up,TypedArrayPrototype:uy},uC=eG,uD=eS,uj=c0,uR=uk.NATIVE_ARRAY_BUFFER_VIEWS,uL=uC.ArrayBuffer,uB=uC.Int8Array,uU=!uR||!uD(function(){uB(1)})||!uD(function(){new uB(-1)})||!uj(function(e){new uB,new uB(null),new uB(1.5),new uB(e)},!0)||uD(function(){return 1!==new uB(new uL(2),1,void 0).length}),u$=tN,uK=Math.floor,uF=Number.isInteger||function(e){return!u$(e)&&isFinite(e)&&uK(e)===e},uz=rj,uq=RangeError,uV=function(e){var t=uz(e);if(t<0)throw new uq("The argument can't be less than 0");return t},uH=RangeError,uG=function(e,t){var r=uV(e);if(r%t)throw new uH("Wrong offset");return r},uW=Math.round,uJ=function(e){var t=uW(e);return t<0?0:t>255?255:255&t},uZ=ci,uY=rr,uX=ex,uQ=uZ(uZ.bind),u0=function(e,t){return uY(e),void 0===t?e:uX?uQ(e,t):function(){return e.apply(t,arguments)}},u1=eP,u2=eS,u5=tP,u3=cO,u8=iv,u6=function(){},u4=t0("Reflect","construct"),u9=/^\s*(?:class|function)\b/,u7=u1(u9.exec),le=!u9.test(u6),lt=function(e){if(!u5(e))return!1;try{return u4(u6,[],e),!0}catch(e){return!1}},lr=function(e){if(!u5(e))return!1;switch(u3(e)){case"AsyncFunction":case"GeneratorFunction":case"AsyncGeneratorFunction":return!1}try{return le||!!u7(u9,u8(e))}catch(e){return!0}};lr.sham=!0;var ln=!u4||u2(function(){var e;return lt(lt.call)||!lt(Object)||!lt(function(){e=!0})||e})?lr:lt,li=ln,lo=t9,ls=TypeError,la=function(e){if(li(e))return e;throw new ls(lo(e)+" is not a constructor")},lc=cO,lu=ro,ll=eU,ld=nN,lf=tO("iterator"),lh=function(e){if(!ll(e))return lu(e,lf)||lu(e,"@@iterator")||ld[lc(e)]},lp=tZ,ly=rr,lg=tj,lm=t9,lb=lh,lv=TypeError,lw=function(e,t){var r=arguments.length<2?lb(e):t;if(ly(r))return lg(lp(r,e));throw new lv(lm(e)+" is not iterable")},l_=nN,lE=tO("iterator"),lS=Array.prototype,lx=cO,lA=rm,lI=TypeError,lO=function(e){var t=lA(e,"number");if("number"==typeof t)throw new lI("Can't convert number to bigint");return BigInt(t)},lT=u0,lP=tZ,lM=la,lN=e6,lk=rq,lC=lw,lD=lh,lj=function(e){return void 0!==e&&(l_.Array===e||lS[lE]===e)},lR=function(e){var t=lx(e);return"BigInt64Array"===t||"BigUint64Array"===t},lL=uk.aTypedArrayConstructor,lB=lO,lU=function(e){var t,r,n,i,o,s,a,c,u=lM(this),l=lN(e),d=arguments.length,f=d>1?arguments[1]:void 0,h=void 0!==f,p=lD(l);if(p&&!lj(p))for(c=(a=lC(l,p)).next,l=[];!(s=lP(c,a)).done;)l.push(s.value);for(h&&d>2&&(f=lT(f,arguments[2])),r=lk(l),i=lR(n=new(lL(u))(r)),t=0;r>t;t++)o=h?f(l[t],t):l[t],n[t]=i?lB(o):+o;return n},l$=eC,lK=Array.isArray||function(e){return"Array"===l$(e)},lF=ln,lz=tN,lq=tO("species"),lV=Array,lH=function(e){var t;return lK(e)&&(lF(t=e.constructor)&&(t===lV||lK(t.prototype))?t=void 0:lz(t)&&null===(t=t[lq])&&(t=void 0)),void 0===t?lV:t},lG=u0,lW=eB,lJ=e6,lZ=rq,lY=function(e,t){return new(lH(e))(0===t?0:t)},lX=eP([].push),lQ=function(e){var t=1===e,r=2===e,n=3===e,i=4===e,o=6===e,s=7===e,a=5===e||o;return function(c,u,l,d){for(var f,h,p=lJ(c),y=lW(p),g=lZ(y),m=lG(u,l),b=0,v=d||lY,w=t?v(c,g):r||s?v(c,0):void 0;g>b;b++)if((a||b in y)&&(h=m(f=y[b],b,p),e)){if(t)w[b]=h;else if(h)switch(e){case 3:return!0;case 5:return f;case 6:return b;case 2:lX(w,f)}else switch(e){case 4:return!1;case 7:lX(w,f)}}return o?-1:n||i?i:w}},l0={forEach:lQ(0),map:lQ(1),filter:lQ(2),some:lQ(3),every:lQ(4),find:lQ(5),findIndex:lQ(6),filterReject:lQ(7)},l1=rq,l2=function(e,t,r){for(var n=0,i=arguments.length>2?r:l1(t),o=new e(i);i>n;)o[n]=t[n++];return o},l5=ol,l3=eG,l8=tZ,l6=tL,l4=uU,l9=uk,l7=a1,de=sN,dt=nj,dr=nB,dn=uF,di=rF,ds=sj,da=uG,dc=uJ,du=rw,dl=e7,dd=cO,df=tN,dh=t6,dp=nx,dy=t1,dg=oJ,dm=iz.f,db=lU,dv=l0.forEac
vendor: 4,734 bytes, line 41
41h,dw=a6,d_=sI,dE=t$,dS=n1,dx=l2,dA=n0,dI=s4,dO=dA.get,dT=dA.set,dP=dA.enforce,dM=dE.f,dN=dS.f,dk=l3.RangeError,dC=l7.ArrayBuffer,dD=dC.prototype,dj=l7.DataView,dR=l9.NATIVE_ARRAY_BUFFER_VIEWS,dL=l9.TYPED_ARRAY_TAG,dB=l9.TypedArray,dU=l9.TypedArrayPrototype,d$=l9.isTypedArray,dK="BYTES_PER_ELEMENT",dF="Wrong length",dz=function(e,t){d_(e,t,{configurable:!0,get:function(){return dO(this)[t]}})},dq=function(e){var t;return dy(dD,e)||"ArrayBuffer"===(t=dd(e))||"SharedArrayBuffer"===t},dV=function(e,t){return d$(e)&&!dh(t)&&t in e&&dn(+t)&&t>=0},dH=function(e,t){return dV(e,t=du(t))?dt(2,e[t]):dN(e,t)},dG=function(e,t,r){return dV(e,t=du(t))&&df(r)&&dl(r,"value")&&!dl(r,"get")&&!dl(r,"set")&&!r.configurable&&(!dl(r,"writable")||r.writable)&&(!dl(r,"enumerable")||r.enumerable)?(e[t]=r.value,e):dM(e,t,r)};l6?(dR||(dS.f=dH,dE.f=dG,dz(dU,"buffer"),dz(dU,"byteOffset"),dz(dU,"byteLength"),dz(dU,"length")),l5({target:"Object",stat:!0,forced:!dR},{getOwnPropertyDescriptor:dH,defineProperty:dG}),cJ.exports=function(e,t,r){var n=e.match(/\d+/)[0]/8,i=e+(r?"Clamped":"")+"Array",o="get"+e,s="set"+e,a=l3[i],c=a,u=c&&c.prototype,l={},d=function(e,t){var r=dO(e);return r.view[o](t*n+r.byteOffset,!0)},f=function(e,t,i){var o=dO(e);o.view[s](t*n+o.byteOffset,r?dc(i):i,!0)},h=function(e,t){dM(e,t,{get:function(){return d(this,t)},set:function(e){return f(this,t,e)},enumerable:!0})};dR?l4&&(c=t(function(e,t,r,i){return de(e,u),dI(function(){return df(t)?dq(t)?void 0!==i?new a(t,da(r,n),i):void 0!==r?new a(t,da(r,n)):new a(t):d$(t)?dx(c,t):l8(db,c,t):new a(ds(t))}(),e,c)}),dg&&dg(c,dB),dv(dm(a),function(e){e in c||dr(c,e,a[e])}),c.prototype=u):(c=t(function(e,t,r,i){de(e,u);var o,s,a,l=0,d=0;if(df(t)){if(dq(t)){o=t,d=da(r,n);var f=t.byteLength;if(void 0===i){if(f%n||(s=f-d)<0)throw new dk(dF)}else if((s=di(i)*n)+d>f)throw new dk(dF);a=s/n}else if(d$(t))return dx(c,t);else return l8(db,c,t)}else o=new dC(s=(a=ds(t))*n);for(dT(e,{buffer:o,byteOffset:d,byteLength:s,length:a,view:new dj(o)});l<a;)h(e,l++)}),dg&&dg(c,dB),u=c.prototype=dp(dU)),u.constructor!==c&&dr(u,"constructor",c),dP(u).TypedArrayConstructor=c,dL&&dr(u,dL,i);var p=c!==a;l[i]=c,l5({global:!0,constructor:!0,forced:p,sham:!dR},l),dK in c||dr(c,dK,n),dK in u||dr(u,dK,n),dw(i)}):cJ.exports=function(){},(0,cJ.exports)("Uint8",function(e){return function(t,r,n){return e(this,t,r,n)}});var dW=uk,dJ=s2,dZ=lO,dY=cO,dX=tZ,dQ=eP,d0=eS,d1=dW.aTypedArray,d2=dW.exportTypedArrayMethod,d5=dQ("".slice);d2("fill",function(e){var t=arguments.length;return d1(this),dX(dJ,this,"Big"===d5(dY(this),0,3)?dZ(e):+e,t>1?arguments[1]:void 0,t>2?arguments[2]:void 0)},d0(function(){var e=0;return new Int8Array(2).fill({valueOf:function(){return e++}}),1!==e}));var d3=eG,d8=tZ,d6=uk,d4=rq,d9=uG,d7=e6,fe=eS,ft=d3.RangeError,fr=d3.Int8Array,fn=fr&&fr.prototype,fi=fn&&fn.set,fo=d6.aTypedArray,fs=d6.exportTypedArrayMethod,fa=!fe(function(){var e=new Uint8ClampedArray(2);return d8(fi,e,{length:1,0:3},1),3!==e[1]}),fc=fa&&d6.NATIVE_ARRAY_BUFFER_VIEWS&&fe(function(){var e=new fr(2);return e.set(1),e.set("2",1),0!==e[0]||2!==e[1]});fs("set",function(e){fo(this);var t=d9(arguments.length>1?arguments[1]:void 0,1),r=d7(e);if(fa)return d8(fi,this,r,t);var n=this.length,i=d4(r),o=0;if(i+t>n)throw new ft("Wrong length");for(;o<i;)this[t+o]=r[o++]},!fa||fc);var fu=s5,fl=Math.floor,fd=function(e,t){var r=e.length;if(r<8)for(var n,i,o=1;o<r;){for(i=o,n=e[o];i&&t(e[i-1],n)>0;)e[i]=e[--i];i!==o++&&(e[i]=n)}else for(var s=fl(r/2),a=fd(fu(e,0,s),t),c=fd(fu(e,s),t),u=a.length,l=c.length,d=0,f=0;d<u||f<l;)e[d+f]=d<u&&f<l?0>=t(a[d],c[f])?a[d++]:c[f++]:d<u?a[d++]:c[f++];return e},ff=fd,fh=ts.match(/firefox\/(\d+)/i),fp=!!fh&&+fh[1],fy=ts,fg=/MSIE|Trident/.test(fy),fm=ts.match(/AppleWebKit\/(\d+)\./),fb=!!fm&&+fm[1],fv=eG,fw=ci,f_=eS,fE=rr,fS=ff,fx=uk,fA=fp,fI=fg,fO=th,fT=fb,fP=fx.aTypedArray,fM=fx.exportTypedArrayMethod,fN=fv.Uint16Array,fk=fN&&fw(fN.prototype.sort),fC=!!fk&&!(f_(function(){fk(new fN(2),null)})&&f_(function(){fk(new fN(2),{})})),fD=!!fk&&!f_(function(){if(fO)return fO<74;if(fA)return fA<67;if(fI)return!0;if(fT)return fT<602;var e,t,r=new fN(516),n=Array(516);for(e=0;e<516;e++)t=e%4,r[e]=515-e,n[e]=e-2*t+3;for(fk(r,function(e,t){return(e/4|0)-(t/4|0)}),e=0;e<516;e++)if(r[e]!==n[e])return!0}),fj=function(e){return function(t,r){return void 0!==e?+e(t,r)||0:r!=r?-1:t!=t?1:0===t&&0===r?1/t>0&&1/r<0?1:-1:t>r}};fM("sort",function(e){return(void 0!==e&&fE(e),fD)?fk(this,e):fS(fP(this),fj(e))},!fD||fC);var fR=ex,fL=Function.prototype,fB=fL.apply,fU=fL.call,f$="object"==typeof Reflect&&Reflect.apply||(fR?fU.bind(fB):function(){return fU.apply(fB,arguments)}),fK=uk,fF=eS,fz=s5,fq=eG.Int8Array,fV=fK.aTypedArray,fH=fK.exportTypedArrayMethod,fG=[].toLocaleStr
41ing,fW=!!fq&&fF(function(){fG.call(new fq(1))});fH("toLocaleString",function(){return f$(fG,fW?fz(fV(this)):fV(this),fz(arguments))},fF(function(){return[1,2].toLocaleString()!==new fq([1,2]).toLocaleString()})||!fF(function(){fq.prototype.toLocaleString.call([1,2])}));var fJ={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},fZ=tq("span").classList,fY=fZ&&fZ.constructor&&fZ.constructor.prototype,fX=eG,fQ=fJ,f0=fY===Object.prototype?void 0:fY,f1=s_,f2=nB,f5=oN,f3=tO("iterator"),f8=f1.values,f6=function(e,t){if(e){if(e[f3]!==f8)try{f2(e,f3,f8)}catch(t){e[f3]=f8}if(f5(e,t,!0),fQ[t]){for(var r in f1)if(e[r]!==f1[r])try{f2(e,r,f1[r])}catch(t){e[r]=f1[r]}}}};for(var f4 in fQ)f6(fX[f4]&&fX[f4].prototype,f4);function f9(e,t,r,n){function i(e){return e instanceof r?e:new r(function(t){t(e)})}return new(r||(r=Promise))(function(r,o){function s(e){try{c(n.next(e))}catch(e){o(e)}}function a(e){try{c(n.throw(e))}catch(e){o(e)}}function c(e){e.done?r(e.value):i(e.value).then(s,a)}c((n=n.apply(e,t||[])).next())})}f6(f0,"DOMTokenList"),"function"==typeof SuppressedError&&SuppressedError;var f7=" \n\v\f\r \xa0áââââââ
ââââââ¯âã\u2028\u2029\uFEFF",he=eF,ht=cM,hr=f7,hn=eP("".replace),hi=RegExp("^["+hr+"]+"),ho=RegExp("(^|[^"+hr+"])["+hr+"]+$"),hs=function(e){return function(t){var r=ht(he(t));return 1&e&&(r=hn(r,hi,"")),2&e&&(r=hn(r,ho,"$1")),r}},ha={start:hs(1),end:hs(2),trim:hs(3)}
41,hc=eG,hu=eS,hl=eP,hd=cM,hf=ha.trim,hh=f7,hp=hc.parseInt,hy=hc.Symbol,hg=hy&&hy.iterator,hm=/^[+-]?0x/i,hb=hl(hm.exec),hv=8!==hp(hh+"08")||22!==hp(hh+"0x16")||hg&&!hu(function(){hp(Object(hg))})?function(e,t){var r=hf(hd(e));return hp(r,t>>>0||(hb(hm,r)?16:10))}:hp;ol({global:!0,forced:parseInt!==hv},{parseInt:hv});var hw=tN,h_=eC,hE=tO("match"),hS=function(e){var t;return hw(e)&&(void 0!==(t=e[hE])?!!t:"RegExp"===h_(e))},hx=TypeError,hA=function(e){if(hS(e))throw new hx("The method doesn't accept regular expressions");return e},hI=tO("match"),hO=function(e){var t=/./;try{"/./"[e](t)}catch(r){try{return t[hI]=!1,"/./"[e](t)}catch(e){}}return!1},hT=ol,hP=ci,hM=n1.f,hN=rF,hk=cM,hC=hA,hD=eF,hj=hO,hR=hP("".slice),hL=Math.min,hB=hj("endsWith");hT({target:"String",proto:!0,forced:!(!hB&&function(){var e=hM(String.prototype,"endsWith");return e&&!e.writable}())&&!hB},{endsWith:function(e){var t=hk(hD(this));hC(e);var r=arguments.length>1?arguments[1]:void 0,n=t.length,i=void 0===r?n:hL(hN(r),n),o=hk(e);return hR(t,i-o.length,i)===o}});let hU=128;!function(e){e[e.GET_VERSION=6]="GET_VERSION",e[e.GET_PUBLIC_KEY=4]="GET_PUBLIC_KEY",e[e.GET_WALLET_ID=5]="GET_WALLET_ID",e[e.SIGN_TRANSACTION=2]="SIGN_TRANSACTION",e[e.NEP413_SIGN_MESSAGE=7]="NEP413_SIGN_MESSAGE",e[e.NEP366_SIGN_DELEGATE_ACTION=8]="NEP366_SIGN_DELEGATE_ACTION"}(m||(m={}));let h$=128,hK=0,hF=0,hz=0,hq=250;function hV(e){let t=e.split("/");return e_.concat(t.map(e=>e.endsWith("'")?0x80000000|Math.abs(parseInt(e.slice(0,-1))):Math.abs(parseInt(e))).map(e=>e_.from([e>>24&255,e>>16&255,e>>8&255,255&e])))}let hH=87,hG=()=>{var e;return!!(null===(e=window.navigator)||void 0===e?void 0:e.hid)};
41class hW{constructor(){this.transport=null,this.isConnected=()=>!!this.transport,this.connect=()=>f9(this,void 0,void 0,function*(){this.transport=yield eg.create();let e=()=>{var t;null===(t=this.transport)||void 0===t||t.off("disconnect",e),this.transport=null};this.transport.on("disconnect",e)}),this.disconnect=()=>f9(this,void 0,void 0,function*(){if(!this.transport)throw Error("Device not connected");yield this.transport.close(),this.transport=null}),this.setScrambleKey=e=>{if(!this.transport)throw Error("Device not connected");this.transport.setScrambleKey(e)},this.on=(e,t)=>{if(!this.transport)throw Error("Device not connected");return this.transport.on(e,t),{remove:()=>{var r;return null===(r=this.transport)||void 0===r?void 0:r.off(e,t)}}},this.off=(e,t)=>{if(!this.transport)throw Error("Device not connected");this.transport.off(e,t)},this.getVersion=()=>f9(this,void 0,void 0,function*(){if(!this.transport)throw Error("Device not connected");let[e,t,r]=Array.from((yield this.transport.send(hU,m.GET_VERSION,hF,hz)));return`${e}.${t}.${r}`}),this.getPublicKey=({derivationPath:e})=>f9(this,void 0,void 0,function*(){if(!this.transport)throw Error("Device not connected");let t=yield this.transport.send(hU,m.GET_PUBLIC_KEY,hz,hH,hV(e));return(0,em.aP)(new Uint8Array(t.subarray(0,-2)))}),this.internalSign=({data:e,derivationPath:t,ins:r})=>f9(this,void 0,void 0,function*(){if(!this.transport)throw Error("Device not connected");yield this.getVersion();let n=e_.concat([hV(t),e]);for(let e=0;e<n.length;e+=hq){let t=e+hq>=n.length,i=yield this.transport.send(hU,r,t?h$:hK,hz,e_.from(n.subarray(e,e+hq)));if(t)return e_.from(i.subarray(0,-2))}throw Error("Invalid data or derivation path")}),this.sign=({data:e,derivationPath:t})=>f9(this,void 0,void 0,function*(){return this.internalSign({data:e,derivationPath:t,ins:m.SIGN_TRANSACTION})}),this.signMessage=({data:e,derivationPath:t})=>f9(this,void 0,void 0,function*(){return this.internalSign({data:e,derivationPath:t,ins:m.NEP413_SIGN_MESSAGE})}),this.signDelegateAction=({data:e,derivationPath:t})=>f9(this,void 0,void 0,function*(){return this.internalSign({data:e,derivationPath:t,ins:m.NEP366_SIGN_DELEGATE_ACTION})})}}var hJ="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAASwAAAEsCAQAAADTdEb+AAAABGdBTUEAALGPC/xhBQAAACBjSFJNAAB6JgAAgIQAAPoAAACA6AAAdTAAAOpgAAA6mAAAF3CculE8AAAAAmJLR0QA/4ePzL8AAAAJcEhZcwAAFQkAABUJATOjLtcAAAAHdElNRQfmCBYRFRR5QOqTAAAE6UlEQVR42u3dPYtcZRzG4fvkRQxRNBhlQcEQED+HjY2wKa0stLCxsLS2FfHlC8TaVkhjnzRWqYw2IkGIkJBgQMgmu2NhfZbMMPc8szvXNeVwZv7POb+ZOXAGTgIAAAAAAAAAAAAAAAAAAAAAwOk3zT7zbj7M2dHjrW2VD/NDHo0eI8mr+TiXshg9xpoc5sf8tuxG13KYxal53M2V0UchSXIld4fvi/U9DnNtbqFnZnfBIoejj8Iabc9atmeSdaxl9rv3zDKvA89LWFQIiwphUSEsKoRFhbCoEBYVwqJCWFQIi4pdCevc6AG2cJKtXOa9/JSno4d/bmdyP49HD5EkeZzruZyj0WM8t/PZz956X3I/B8f8YeJmLoxeMxtwITePqeAg+3Mbrv5TuCs/ortt5aMsDyqERYWwqBAWFcKiQlhUCIsKYVEhLCqERYWwqBAWFcKiQlhUCIsKYVEhLCqERYWwqBAWFcKiQlhUCIsKYVEhLCqERYWwqBAWFcKiQlhUCIsKYVEhLCqERYWwqBAWFcKiQlhUCIsKYVEhLCqERYWwqBAWFcKiQlhUCIsKYVEhLCpWvSf0NHrwNU+8GD3e1lrxSM+HdTufzX6fTbmXg9ErXsqFfJF3Zm7yPeVJvs6vo0fcSgf5KnuzH7uj3B494Giv5Jdjbpr9JO+NHvC02ZVzrEUOj3n2mZ/CdduVsNgwYVEhLCqERYWwqBAWFcKiQlhUCIsKYVEhLCqERYWwqBAWFcKiQlhUCIsKYVEhLCqERYWwqBAWFcKiQlhUCIsKYVEhLCqERYWwqBAWFcKiQlhUCIsKYVEhLCqERYWwqBAWFcKiQlhUCIsKYVEhLCqERYWwqBAWFcKiQlhUCIsKYVEhLCqERYWwqBAWFcKiQlhUCIsKYVEhLCqERYWwqBAWFcKiQlhUCIsKYVEhLCqERYWwqBAWFcKiQlhUCIsKYVEhLCqERYWwqBAWFcKiQlhUCIsKYVEhLCqERYWwqBDW/xajBzhtzo0eYCtMeT1vbGRfHOZBno1e7iYIK0lezLf5N1P9fab8nY/yx+jlboKwkmTKWxt6p5fywujFboZzrM062pWzOWFRISwqhEWFsKgQFhXCokJYVAiLCmFRsSthTTk7eoQkybkNXJHcCvPXCt/O+7PZTbmXG3k6evglHORGfs/R4CmmPMw/o3fFUs7ng+zNXoY6ys/5c9mX3M9BFrOPW7k4es1LmrbkcbJczK1jKjjI/tyGq/674eRdSj15E2+HFffbrpxjsWHCokJYVAiLCmFRISwqhEWFsKgQFhXCokJYVAiLCmFRISwqhEWFsKgQFhXCokJYVAiLCmFRISwqhEWFsKgQFhXCokJYVAiLCmFRISwqhEWFsKgQFhXCokJYVAiLCmFRISwqhEWFsKgQFhXCokJYVAiLCmFRISwqhEWFsKgQFhWrhzX6/spswspHedVb917NdyfoZuNncj/f58HoMZK8ls9z+QR9KM/n6mobrhrWXj4dveal/JXrWxHWy/kkb44eYhN25Rzr2egBtnCSql0Jiw0TFhXCokJYVAiLCmFRISwqhEWFsKgQFhXComI+rClnRw+3Rtuzlu2ZZB1rmeaemv93w518eWp2wpSHeTR6iCTJo3yTS1mMHmNNDnNn9AgAAAAAAAAAAAAAAAAAAAAAAIz0H5C/bp2MgRJCAAAAJXRFWHRkYXRlOmNyZWF0ZQAyMDIyLTA4LTIyVDE3OjIwOjM2KzAwOjAwLb5rZQAAACV0RVh0ZGF0ZTptb2RpZnkAMjAyMi0wOC0yMlQxNzoyMDozNiswMDowMFzj09kAAAAASUVORK5CYII=",hZ=tL,hY=tZ,hX=eS,hQ=r4,h0=iH,h1=n2,h2=e6,h5=eB,h3=Object.assign,h8=Object.defineProperty,h6=eP([].concat),h4=!h3||hX(function(){if(hZ&&1!==h3({b:1},h3(h8({},"a",{enumerable:!0,get:function(){h8(this,"b",{value:3,enumerable:!1})}}),{b:2})).b)return!0;var e={},t={},r=Symbol("assign detection"),n="abcdefghijklmnopqrst";return e[r]=7,n.split("").forEach(function(e){t[e]=e}),7!==h3({},e)[r]||hQ(h3({},t)).join("")!==n})?function(e,t){for(var r=h2(e),n=arguments.length,i=1,o=h0.f,s=h1.f;n>i;)for(var a,c=h5(arguments[i++]),u=o?h6(hQ(c),o(c)):hQ(c),l=u.length,d=0;l>d;)a=u[d++],(!hZ||hY(s,c,a))&&(r[a]=c[a]);return r}:h3;ol({target:"Object",stat:!0,arity:2,forced:Object.assign!==h4},{assign:h4});class h9{constructor(e){this.message=e.message,this.nonce=e.nonce,this.recipient=e.recipient,e.callbackUrl&&(this.callbackUrl=e.callbackUrl)}}let h7={struct:{message:"string",nonce:{array:{type:"u8",len:32}},recipient:"string",callbackUrl:{option:"string"}}},pe=e=>{let t=new h9(Object.assign({},e));return e_.from((0,eb.l)(h7,t))},pt="accounts",pr=e=>f9(void 0,void 0,void 0,function*(){let t=yield e.getItem(pt);return{client:new hW,subscriptions:[],accounts:t||[]}}),pn=({options:e,store:t,provider:r,logger:n,storage:i,metadata:o})=>f9(void 0,void 0,void 0,function*(){let s=yield pr(i),a={createKey:()=>{throw Error("Not implemented")},getPublicKey:e=>f9(void 0,void 0,void 0,function*(){let t=s.accounts.find(t=>t.accountId===e);if(!t)throw Error("Failed to find public key for account");return _.J.from(t.publicKey)}),signMessage:(e,t)=>
41f9(void 0,void 0,void 0,function*(){let r=s.accounts.find(e=>e.accountId===t);if(!r)throw Error("Failed to find account for signing");let n=yield s.client.sign({data:e_.from(e),derivationPath:r.derivationPath});return new ev.t({data:n,keyType:_.J.from(r.publicKey).keyType})})},c=()=>s.accounts.map(e=>({accountId:e.accountId,publicKey:"ed25519:"+e.publicKey})),u=()=>{s.subscriptions.forEach(e=>e.remove()),s.subscriptions=[],s.accounts=[],i.removeItem(pt)},l=()=>f9(void 0,void 0,void 0,function*(){s.client.isConnected()||(yield s.client.connect())}),d=({accountId:e,publicKey:t})=>(n.log("validateAccessKey",{accountId:e,publicKey:t}),r.viewAccessKey({accountId:e,publicKey:t}).then(e=>{if(n.log("validateAccessKey:accessKey",{accessKey:e}),"FullAccess"!==e.permission)throw Error("Public key requires 'FullAccess' permission");return e},e=>{if("AccessKeyDoesNotExist"===e.type)return null;throw e})),f=e=>{let{contract:r}=t.getState();if(!r)throw Error("Wallet not signed in");let n=(0,w.yq)(t.getState());if(!n)throw Error("No active account");return e.map(e=>({signerId:e.signerId||n.accountId,receiverId:e.receiverId||r.contractId,actions:e.actions}))};return{signIn({accounts:e}){return f9(this,void 0,void 0,function*(){let t=c();if(t.length)return t;let r=[];for(let t=0;t<e.length;t++){let{derivationPath:n,accountId:i,publicKey:o}=e[t];if(!(yield d({accountId:i,publicKey:o})))throw Error(`Public key is not registered with the account '${i}'.`);r.push({accountId:i,derivationPath:n,publicKey:o})}return yield i.setItem(pt,r),s.accounts=r,c()})},signOut:()=>f9(void 0,void 0,void 0,function*(){s.client.isConnected()&&(yield s.client.disconnect().catch(e=>{n.log("Failed to disconnect device"),n.error(e)})),u()}),getAccounts(){return f9(this,void 0,void 0,function*(){return c()})},verifyOwner({message:e}){return f9(this,void 0,void 0,function*(){throw n.log("Ledger:verifyOwner",{message:e}),Error(`Method not supported by ${o.name}`)})},signAndSendTransaction({signerId:t,receiverId:i,actions:o}){return f9(this,void 0,void 0,function*(){if(n.log("signAndSendTransaction",{signerId:t,receiverId:i,actions:o}),!s.accounts.length)throw Error("Wallet not signed in");yield l();let c=yield(0,v.j)(f([{signerId:t,receiverId:i,actions:o}]),a,e.network);return r.sendTransaction(c[0])})},signAndSendTransactions({transactions:t}){return f9(this,void 0,void 0,function*(){if(n.log("signAndSendTransactions",{transactions:t}),!s.accounts.length)throw Error("Wallet not signed in");yield l();let i=yield(0,v.j)(f(t),a,e.network),o=[];for(let e=0;e<i.length;e++)o.push((yield r.sendTransaction(i[e])));return o})},getPublicKey(e){return f9(this,void 0,void 0,function*(){if(yield l(),"string"==typeof e)return yield s.client.getPublicKey({derivationPath:e});{let e=(0,w.yq)(t.getState());if(!e)throw Error("No active account");let r=s.accounts.find(({accountId:t})=>t===e.accountId);if(!r)throw Error("No active account in state");let n=yield s.client.getPublicKey({derivationPath:r.derivationPath});return _.J.fromString(n)}})},signMessage({message:r,nonce:i,recipient:o,callbackUrl:a}){return f9(this,void 0,void 0,function*(){if(n.log("signMessage",{message:r,nonce:i,recipient:o,callbackUrl:a}),!s.accounts.length)throw Error("Wallet not signed in");let c=(0,w.yq)(t.getState());if(!c)throw Error("No active account");let u=s.accounts.find(e=>e.accountId===c.accountId);if(!u)throw Error("Failed to find account for signing");if(!(yield(0,w.oe)({publicKey:u.publicKey,accountId:c.accountId,network:e.network})))throw Error("Public key not found for the active account.");yield l();let d=pe({message:r,nonce:i,recipient:o,callbackUrl:a}),f=yield s.client.signMessage({data:d,derivationPath:u.derivationPath}),h=e_.from(f).toString("base64");if(!(0,w.Od)({publicKey:u.publicKey,signature:h,message:r,nonce:i,recipient:o,callbackUrl:a}))throw Error("Failed to verify signature");return{accountId:u.accountId,publicKey:"ed25519:"+u.publicKey,signature:h}})},createSignedTransaction(t,r){return f9(this,void 0,void 0,function*(){if(n.log("createSignedTransaction",{receiverId:t,actions:r}),!s.accounts.length)throw Error("Wallet not signed in");yield l();let[i]=yield(0,v.j)(f([{receiverId:t,actions:r}]),a,e.network);return i})},signTransaction(t){return f9(this,void 0,void 0,function*(){n.log("signTransaction",{transaction:t});let r=(0,ew.T9)(t),i=new Uint8Array(S.sha256.array(r)),o=yield a.signMessage(r,t.signerId,e.network.networkId),s=t.publicKey.ed25519Key?E._.ED25519:E._.SECP256K1;return[i,new ew.Zj({transaction:t,signature:new ev.t({keyType:s,data:o.signature.data})})]})},signNep413Message(e,t,r,i,s){return f9(this,void 0,void 0,function*(){throw n.log("signNep413Message",{message:e,accountId:t,recipient:r,nonce:i,callbackUrl:s}),Error(`Method not supported by ${o.name}`)})},signDelegateAction(e){return f9(this,void 0,void 0,function*(){throw n.log("signDelegateAction",{delegateAction:e}),Error(`Method not supported by ${o.name}`)})}}});function pi({iconUrl:e=hJ,deprecated:t=!1}={}){return()=>f9(this,void 0,void 0,function*(){let r=(0,b.isMobile)(),n=hG();return r?null:{id:"ledger",type:"hardware",metadata:{name:"Ledger",description:"Protect crypto assets with the most popular hardware wallet.",iconUrl:e,deprecated:t,available:n},init:pn}})}},95910:(e,t,r)=>{"use strict";let n;r.d(t,{R:()=>vd});var i,o,s,a,c,u,l,d,f,h,p,y={};r.r(y),r.d(y,{base64:()=>ii,base64url:()=>io,bigint:()=>ig,boolean:()=>iv,browserEmail:()=>n8,cidrv4:()=>it,cidrv6:()=>ir,cuid:()=>nK,cuid2:()=>nF,date:()=>il,datetime:()=>ip,domain:()=>ia,duration:()=>nG,e164:()=>ic,email:()=>n0,emoji:()=>n4,extendedDuration:()=>nW,guid:()=>nJ,hex:()=>ix,hostname:()=>is,html5Email:()=>
41n1,idnEmail:()=>n3,integer:()=>im,ipv4:()=>n9,ipv6:()=>n7,ksuid:()=>nV,lowercase:()=>iE,mac:()=>ie,md5_base64:()=>iT,md5_base64url:()=>iP,md5_hex:()=>iO,nanoid:()=>nH,null:()=>iw,number:()=>ib,rfc5322Email:()=>n2,sha1_base64:()=>iN,sha1_base64url:()=>ik,sha1_hex:()=>iM,sha256_base64:()=>iD,sha256_base64url:()=>ij,sha256_hex:()=>iC,sha384_base64:()=>iL,sha384_base64url:()=>iB,sha384_hex:()=>iR,sha512_base64:()=>i$,sha512_base64url:()=>iK,sha512_hex:()=>iU,string:()=>iy,time:()=>ih,ulid:()=>nz,undefined:()=>i_,unicodeEmail:()=>n5,uppercase:()=>iS,uuid:()=>nZ,uuid4:()=>nY,uuid6:()=>nX,uuid7:()=>nQ,xid:()=>nq});var g={};r.r(g),r.d(g,{endsWith:()=>az,gt:()=>aA,gte:()=>aI,includes:()=>aK,length:()=>aL,lowercase:()=>aU,lt:()=>aS,lte:()=>ax,maxLength:()=>aj,maxSize:()=>ak,mime:()=>aV,minLength:()=>aR,minSize:()=>aC,multipleOf:()=>aN,negative:()=>aT,nonnegative:()=>aM,nonpositive:()=>aP,normalize:()=>aG,overwrite:()=>aH,positive:()=>aO,property:()=>aq,regex:()=>aB,size:()=>aD,slugify:()=>aY,startsWith:()=>aF,toLowerCase:()=>aJ,toUpperCase:()=>aZ,trim:()=>aW,uppercase:()=>a$});var m={};r.r(m),r.d(m,{ZodISODate:()=>cG,ZodISODateTime:()=>cV,ZodISODuration:()=>cY,ZodISOTime:()=>cJ,date:()=>cW,datetime:()=>cH,duration:()=>cX,time:()=>cZ});var b={};r.r(b),r.d(b,{ZodAny:()=>lp,ZodArray:()=>lx,ZodBase64:()=>uq,ZodBase64URL:()=>uH,ZodBigInt:()=>ln,ZodBigIntFormat:()=>lo,ZodBoolean:()=>lt,ZodCIDRv4:()=>u$,ZodCIDRv6:()=>uF,ZodCUID:()=>ux,ZodCUID2:()=>uI,ZodCatch:()=>dl,ZodCodec:()=>dg,ZodCustom:()=>dT,ZodCustomStringFormat:()=>uX,ZodDate:()=>lE,ZodDefault:()=>dt,ZodDiscriminatedUnion:()=>lj,ZodE164:()=>uW,ZodEmail:()=>uc,ZodEmoji:()=>uw,ZodEnum:()=>lJ,ZodExactOptional:()=>l6,ZodFile:()=>l0,ZodFunction:()=>dI,ZodGUID:()=>ul,ZodIPv4:()=>uD,ZodIPv6:()=>uB,ZodIntersection:()=>lL,ZodJWT:()=>uZ,ZodKSUID:()=>uk,ZodLazy:()=>dE,ZodLiteral:()=>lX,ZodMAC:()=>uR,ZodMap:()=>lV,ZodNaN:()=>df,ZodNanoID:()=>uE,ZodNever:()=>lb,ZodNonOptional:()=>ds,ZodNull:()=>lf,ZodNullable:()=>l9,ZodNumber:()=>u5,ZodNumberFormat:()=>u8,ZodObject:()=>lO,ZodOptional:()=>l3,ZodPipe:()=>dp,ZodPrefault:()=>dn,ZodPromise:()=>dx,ZodReadonly:()=>db,ZodRecord:()=>lK,ZodSet:()=>lG,ZodString:()=>uo,ZodStringFormat:()=>ua,ZodSuccess:()=>dc,ZodSymbol:()=>lc,ZodTemplateLiteral:()=>dw,ZodTransform:()=>l2,ZodTuple:()=>lU,ZodType:()=>un,ZodULID:()=>uT,ZodURL:()=>um,ZodUUID:()=>uf,ZodUndefined:()=>ll,ZodUnion:()=>lN,ZodUnknown:()=>lg,ZodVoid:()=>lw,ZodXID:()=>uM,ZodXor:()=>lC,_ZodString:()=>ui,_default:()=>dr,_function:()=>dO,any:()=>ly,array:()=>lA,base64:()=>uV,base64url:()=>uG,bigint:()=>li,boolean:()=>lr,catch:()=>dd,check:()=>dP,cidrv4:()=>uK,cidrv6:()=>uz,codec:()=>dm,cuid:()=>uA,cuid2:()=>uO,custom:()=>dM,date:()=>lS,describe:()=>dC,discriminatedUnion:()=>lR,e164:()=>uJ,email:()=>uu,emoji:()=>u_,enum:()=>lZ,exactOptional:()=>l4,file:()=>l1,float32:()=>u4,float64:()=>u9,function:()=>dO,guid:()=>ud,hash:()=>u2,hex:()=>u1,hostname:()=>u0,httpUrl:()=>uv,instanceof:()=>dj,int:()=>u6,int32:()=>u7,int64:()=>ls,intersection:()=>lB,ipv4:()=>uj,ipv6:()=>uU,json:()=>dL,jwt:()=>uY,keyof:()=>lI,ksuid:()=>uC,lazy:()=>dS,literal:()=>lQ,looseObject:()=>lM,looseRecord:()=>lq,mac:()=>uL,map:()=>lH,meta:()=>dD,nan:()=>dh,nanoid:()=>uS,nativeEnum:()=>lY,never:()=>lv,nonoptional:()=>da,null:()=>lh,nullable:()=>l7,nullish:()=>de,number:()=>u3,object:()=>lT,optional:()=>l8,partialRecord:()=>lz,pipe:()=>dy,prefault:()=>di,preprocess:()=>dB,promise:()=>dA,readonly:()=>dv,record:()=>lF,refine:()=>dN,set:()=>lW,strictObject:()=>lP,string:()=>us,stringFormat:()=>uQ,stringbool:()=>dR,success:()=>du,superRefine:()=>dk,symbol:()=>lu,templateLiteral:()=>d_,transform:()=>l5,tuple:()=>l$,uint32:()=>le,uint64:()=>la,ulid:()=>uP,undefined:()=>ld,union:()=>lk,unknown:()=>lm,url:()=>ub,uuid:()=>uh,uuidv4:()=>up,uuidv6:()=>uy,uuidv7:()=>ug,void:()=>l_,xid:()=>uN,xor:()=>lD});var v=r(28539),w=r(16436);class _ extends Error{constructor(){super("Contract method calls expect named arguments wrapped in object, e.g. { argName1: argValue1, argName2: argValue2 }")}}class E extends Error{type;context;constructor(e,t,r){super(e),this.type=t||"UntypedError",this.context=r}}class S{transactionHash;constructor(e){this.transactionHash=e}}var x=r(2139),A=r(63947),I=r(29905),O=r(75927).Buffer,T=30000000000000n,P={GasLim
41itExceeded:"Exceeded the maximum amount of gas allowed to burn per contract",MethodEmptyName:"Method name is empty",WasmerCompileError:"Wasmer compilation error: {{msg}}",GuestPanic:"Smart contract panicked: {{panic_msg}}",Memory:"Error creating Wasm memory",GasExceeded:"Exceeded the prepaid gas",MethodUTF8Error:"Method name is not valid UTF8 string",BadUTF16:"String encoding is bad UTF-16 sequence",WasmTrap:"WebAssembly trap: {{msg}}",GasInstrumentation:"Gas instrumentation failed or contract has denied instructions.",InvalidPromiseIndex:"{{promise_idx}} does not correspond to existing promises",InvalidPromiseResultIndex:"Accessed invalid promise result index: {{result_idx}}",Deserialization:"Error happened while deserializing the module",MethodNotFound:"Contract method is not found",InvalidRegisterId:"Accessed invalid register id: {{register_id}}",InvalidReceiptIndex:"VM Logic returned an invalid receipt index: {{receipt_index}}",EmptyMethodName:"Method name is empty in contract call",CannotReturnJointPromise:"Returning joint promise is currently prohibited",StackHeightInstrumentation:"Stack instrumentation failed",CodeDoesNotExist:"Cannot find contract code for account {{account_id}}",MethodInvalidSignature:"Invalid method signature",IntegerOverflow:"Integer overflow happened during contract execution",MemoryAccessViolation:"MemoryAccessViolation",InvalidIteratorIndex:"Iterator index {{iterator_index}} does not exist",IteratorWasInvalidated:"Iterator {{iterator_index}} was invalidated after its creation by performing a mutable operation on trie",InvalidAccountId:"VM Logic returned an invalid account id",Serialization:"Error happened while serializing the module",CannotAppendActionToJointPromise:"Actions can only be appended to non-joint promise.",InternalMemoryDeclared:"Internal memory declaration has been found in the module",Instantiate:"Error happened during instantiation",ProhibitedInView:"{{method_name}} is not allowed in view calls",InvalidMethodName:"VM Logic returned an invalid method name",BadUTF8:"String encoding is bad UTF-8 sequence",BalanceExceeded:"Exceeded the account balance",LinkError:"Wasm contract link error: {{msg}}",InvalidPublicKey:"VM Logic provided an invalid public key",ActorNoPermission:"Actor {{actor_id}} doesn't have permission to account {{account_id}} to complete the action",LackBalanceForState:"The account {{account_id}} wouldn't have enough balance to cover storage, required to have {{amount}} yoctoNEAR more",ReceiverMismatch:"Wrong AccessKey used for transaction: transaction is sent to receiver_id={{tx_receiver}}, but is signed with function call access key that restricted to only use with receiver_id={{ak_receiver}}. Either change receiver_id in your transaction or switch to use a FullAccessKey.",CostOverflow:"Transaction gas or balance cost is too high",InvalidSignature:"Transaction is not signed with the given public key",AccessKeyNotFound:'Signer "{{account_id}}" doesn\'t have access key with the given public_key {{public_key}}',NotEnoughBalance:"Sender {{signer_id}} does not have enough balance {{#formatNear}}{{balance}}{{/formatNear}} for operation costing {{#formatNear}}{{cost}}{{/formatNear}}",NotEnoughAllowance:"Access Key {account_id}:{public_key} does not have enough balance {{#formatNear}}{{allowance}}{{/formatNear}} for transaction costing {{#formatNear}}{{cost}}{{/formatNear}}",Expired:"Transaction has expired",DeleteAccountStaking:"Account {{account_id}} is staking and can not be deleted",SignerDoesNotExist:"Signer {{signer_id}} does not exist",TriesToStake:"Account {{account_id}} tried to stake {{#formatNear}}{{stake}}{{/formatNear}}, but has staked {{#formatNear}}{{locked}}{{/formatNear}} and only has {{#formatNear}}{{balance}}{{/formatNear}}",AddKeyAlreadyExists:"The public key {{public_key}} is already used for an existing access key",InvalidSigner:"Invalid signer account ID {{signer_id}} according to requirements",CreateAccountNotAllowed:"The new account_id {{account_id}} can't be created by {{predecessor_id}}",RequiresFullAccess:"The transaction contains more then one action, but it was signed with an access key which allows transaction to apply only one specific action. To apply more then one actions TX must be signed with a full access key",TriesToUnstake:"Account {{account_id}} is not yet staked, but tried to unstake",InvalidNonce:"Transaction nonce {{tx_nonce}} must be larger than nonce of the used access key {{ak_nonce}}",AccountAlreadyExists:"Can't create a new account {{account_id}}, because it already exists",InvalidChain:"Transaction parent block hash doesn't belong to the current chain",AccountDoesNotExist:"Can't complete the action because account {{account_id}} doesn't exist",AccessKeyDoesNotExist:"Can't complete the action because access key {{public_key}}
41 doesn't exist",MethodNameMismatch:"Transaction method name {{method_name}} isn't allowed by the access key",DeleteAccountHasRent:"Account {{account_id}} can't be deleted. It has {{#formatNear}}{{balance}}{{/formatNear}}, which is enough to cover the rent",DeleteAccountHasEnoughBalance:"Account {{account_id}} can't be deleted. It has {{#formatNear}}{{balance}}{{/formatNear}}, which is enough to cover it's storage",InvalidReceiver:"Invalid receiver account ID {{receiver_id}} according to requirements",DeleteKeyDoesNotExist:"Account {{account_id}} tries to remove an access key that doesn't exist",Timeout:"Timeout exceeded",Closed:"Connection closed",ShardCongested:"Shard {{shard_id}} rejected the transaction due to congestion level {{congestion_level}}, try again later",ShardStuck:"Shard {{shard_id}} rejected the transaction because it missed {{missed_chunks}} chunks and needs to recover before accepting new transactions, try again later"},M=24;BigInt(24);var N=[],k=10n;for(let e=0,t=5n;e<M;e++,t*=k)N[e]=t;function C(e,t=M){let r=BigInt(e);if(t!==M){let e=M-t-1;e>0&&(r+=N[e])}let n=(e=r.toString()).substring(0,e.length-M)||"0",i=e.substring(e.length-M).padStart(M,"0").substring(0,t);return D(`${j(n)}.${i}`)}function D(e){return e.replace(/\.?0*$/,"")}function j(e){let t=/(-?\d+)(\d{3})/;for(;t.test(e);)e=e.replace(t,"$1,$2");return e}function R(e){if("string"==typeof e){let t=[];for(let r=0;r<e.length;r++)t.push(e.charCodeAt(r));e=new Uint8Array(t)}return A.tw.encode(e)}function L(e){return A.tw.decode(e)}var B={schema:{AccessKeyNotFound:{name:"AccessKeyNotFound",subtypes:[],props:{account_id:"",public_key:""}},AccountAlreadyExists:{name:"AccountAlreadyExists",subtypes:[],props:{account_id:""}},AccountDoesNotExist:{name:"AccountDoesNotExist",subtypes:[],props:{account_id:""}},ActionError:{name:"ActionError",subtypes:["AccountAlreadyExists","AccountDoesNotExist","CreateAccountOnlyByRegistrar","CreateAccountNotAllowed","ActorNoPermission","DeleteKeyDoesNotExist","AddKeyAlreadyExists","DeleteAccountStaking","LackBalanceForState","TriesToUnstake","TriesToStake","InsufficientStake","FunctionCallError","NewReceiptValidationError","OnlyImplicitAccountCreationAllowed","DeleteAccountWithLargeState","DelegateActionInvalidSignature","DelegateActionSenderDoesNotMatchTxReceiver","DelegateActionExpired","DelegateActionAccessKeyError","DelegateActionInvalidNonce","DelegateActionNonceTooLarge"],props:{index:""}},ActionsValidationError:{name:"ActionsValidationError",subtypes:["DeleteActionMustBeFinal","TotalPrepaidGasExceeded","TotalNumberOfActionsExceeded","AddKeyMethodNamesNumberOfBytesExceeded","AddKeyMethodNameLengthExceeded","IntegerOverflow","InvalidAccountId","ContractSizeExceeded","FunctionCallMethodNameLengthExceeded","FunctionCallArgumentsLengthExceeded","UnsuitableStakingKey","FunctionCallZeroAttachedGas","DelegateActionMustBeOnlyOne","UnsupportedProtocolFeature"],props:{}},ActorNoPermission:{name:"ActorNoPermission",subtypes:[],props:{account_id:"",actor_id:""}},AddKeyAlreadyExists:{name:"AddKeyAlreadyExists",subtypes:[],props:{account_id:"",public_key:""}},AddKeyMethodNameLengthExceeded:{name:"AddKeyMethodNameLengthExceeded",subtypes:[],props:{length:"",limit:""}},AddKeyMethodNamesNumberOfBytesExceeded:{name:"AddKeyMethodNamesNumberOfBytesExceeded",subtypes:[],props:{limit:"",total_number_of_bytes:""}},AltBn128InvalidInput:{name:"AltBn128InvalidInput",subtypes:[],props:{msg:""}},BadUTF16:{name:"BadUTF16",subtypes:[],props:{}},BadUTF8:{name:"BadUTF8",subtypes:[],props:{}},BalanceExceeded:{name:"BalanceExceeded",subtypes:[],props:{}},BalanceMismatchError:{name:"BalanceMismatchError",subtypes:[],props:{final_accounts_balance:"",final_postponed_receipts_balance:"",forwarded_buffered_receipts_balance:"",incoming_receipts_balance:"",incoming_validator_rewards:"",initial_accounts_balance:"",initial_postponed_receipts_balance:"",new_buffered_receipts_balance:"",new_delayed_receipts_balance:"",other_burnt_amount:"",outgoing_receipts_balance:"",processed_delayed_receipts_balance:"",slashed_burnt_amount:"",tx_burnt_amount:""}},CallIndirectOOB:{name:"CallIndirectOOB",subtypes:[],props:{}},CannotAppendActionToJointPromise:{name:"CannotAppendActionToJointPromise",subtypes:[],props:{}},CannotReturnJointPromise:{name:"CannotReturnJointPromise",subtypes:[],props:{}},CodeDoesNotExist:{name:"CodeDoesNotExist",subtypes:[],props:{account_id:""}},CompilationError:{name:"CompilationError",subtypes:["CodeDoesNotExist","PrepareError","WasmerCompileError"],props:{}},ContractSizeExceeded:{name:"ContractSizeExceeded",subtypes:[],props:{limit:"",size:""}},CostOverflow:{name:"CostOverflow",subtypes:[],props:{}},CreateAccountNotAllowed:{name:"CreateAccountNotAllowed",subtypes:[],props:{account_id:"",predecessor_id:""}},CreateAccountOnlyByRegistrar:{name:"CreateAccountOnlyByRegistrar",subtypes:[],props:{account_id:"",predecessor_id:"",registrar_account_id:""}},DelegateActionExpired:{name:"DelegateActionExpired",subtypes:[],props:{}},DelegateActionInvalidNonce:{name:"DelegateActionInvalidNonce",subtypes:[],props:{ak_nonce:"",delegate_nonce:""}},DelegateActionInvalidSignature:{name:"DelegateActionInvalidSignature",subtypes:[],props:{}},DelegateActionMustBeOnlyOne:{name:"DelegateActionMustBeOnlyOne",subtypes:[],props:{}},DelegateActionNonceTooLarge:{name:"DelegateActionNonceTooLarge",subtypes:[],props:{delegate_nonce:"",upper_bound:""}},DelegateActionSenderDoesNotMatchTxReceiver:{name:"DelegateActionSenderDoesNotMatchTxReceiver",subtypes:[],props:{receiver_id:"",sender_id:""}},DeleteAccountStaking:{name:"DeleteAccountStaking",subtypes:[],props:{account_id:""}},DeleteAccountWithLargeState:{name:"DeleteAccountWithLargeState",subtypes:[],props:{account_id:""}},DeleteActionMustBeFinal:{name:"DeleteActionMustBeFinal",subtypes:[],props:{}},DeleteKeyDoesNotExist:{name:"DeleteKeyDoesNotExist",subtypes:[],props:{account_id:"",public_key:""}},DepositWithFunctionCall:{name:"DepositWithFunctionCall",subtypes:[],props:{}},Deprecated:{name:"Deprecated",subtypes:[],props:{method_name:""}},Deserialization:{name:"Deserialization",subtypes:[],props:{}}
41,ECRecoverError:{name:"ECRecoverError",subtypes:[],props:{msg:""}},Ed25519VerifyInvalidInput:{name:"Ed25519VerifyInvalidInput",subtypes:[],props:{msg:""}},EmptyMethodName:{name:"EmptyMethodName",subtypes:[],props:{}},Expired:{name:"Expired",subtypes:[],props:{}},FunctionCallArgumentsLengthExceeded:{name:"FunctionCallArgumentsLengthExceeded",subtypes:[],props:{length:"",limit:""}},FunctionCallMethodNameLengthExceeded:{name:"FunctionCallMethodNameLengthExceeded",subtypes:[],props:{length:"",limit:""}},FunctionCallZeroAttachedGas:{name:"FunctionCallZeroAttachedGas",subtypes:[],props:{}},GasExceeded:{name:"GasExceeded",subtypes:[],props:{}},GasInstrumentation:{name:"GasInstrumentation",subtypes:[],props:{}},GasLimitExceeded:{name:"GasLimitExceeded",subtypes:[],props:{}},GenericTrap:{name:"GenericTrap",subtypes:[],props:{}},GuestPanic:{name:"GuestPanic",subtypes:[],props:{panic_msg:""}},HostError:{name:"HostError",subtypes:["BadUTF16","BadUTF8","GasExceeded","GasLimitExceeded","BalanceExceeded","EmptyMethodName","GuestPanic","IntegerOverflow","InvalidPromiseIndex","CannotAppendActionToJointPromise","CannotReturnJointPromise","InvalidPromiseResultIndex","InvalidRegisterId","IteratorWasInvalidated","MemoryAccessViolation","InvalidReceiptIndex","InvalidIteratorIndex","InvalidAccountId","InvalidMethodName","InvalidPublicKey","ProhibitedInView","NumberOfLogsExceeded","KeyLengthExceeded","ValueLengthExceeded","TotalLogLengthExceeded","NumberPromisesExceeded","NumberInputDataDependenciesExceeded","ReturnedValueLengthExceeded","ContractSizeExceeded","Deprecated","ECRecoverError","AltBn128InvalidInput","Ed25519VerifyInvalidInput"],props:{}},IllegalArithmetic:{name:"IllegalArithmetic",subtypes:[],props:{}},IncorrectCallIndirectSignature:{name:"IncorrectCallIndirectSignature",subtypes:[],props:{}},IndirectCallToNull:{name:"IndirectCallToNull",subtypes:[],props:{}},Instantiate:{name:"Instantiate",subtypes:[],props:{}},InsufficientStake:{name:"InsufficientStake",subtypes:[],props:{account_id:"",minimum_stake:"",stake:""}},IntegerOverflow:{name:"IntegerOverflow",subtypes:[],props:{}},InternalMemoryDeclared:{name:"InternalMemoryDeclared",subtypes:[],props:{}},InvalidAccessKeyError:{name:"InvalidAccessKeyError",subtypes:["AccessKeyNotFound","ReceiverMismatch","MethodNameMismatch","RequiresFullAccess","NotEnoughAllowance","DepositWithFunctionCall"],props:{}},InvalidAccountId:{name:"InvalidAccountId",subtypes:[],props:{}},InvalidChain:{name:"InvalidChain",subtypes:[],props:{}},InvalidDataReceiverId:{name:"InvalidDataReceiverId",subtypes:[],props:{account_id:""}},InvalidIteratorIndex:{name:"InvalidIteratorIndex",subtypes:[],props:{iterator_index:""}},InvalidMethodName:{name:"InvalidMethodName",subtypes:[],props:{}},InvalidNonce:{name:"InvalidNonce",subtypes:[],props:{ak_nonce:"",tx_nonce:""}},InvalidPredecessorId:{name:"InvalidPredecessorId",subtypes:[],props:{account_id:""}},InvalidPromiseIndex:{name:"InvalidPromiseIndex",subtypes:[],props:{promise_idx:""}},InvalidPromiseResultIndex:{name:"InvalidPromiseResultIndex",subtypes:[],props:{result_idx:""}},InvalidPublicKey:{name:"InvalidPublicKey",subtypes:[],props:{}},InvalidReceiptIndex:{name:"InvalidReceiptIndex",subtypes:[],props:{receipt_index:""}},InvalidReceiverId:{name:"InvalidReceiverId",subtypes:[],props:{account_id:""}},InvalidRegisterId:{name:"InvalidRegisterId",subtypes:[],props:{register_id:""}},InvalidSignature:{name:"InvalidSignature",subtypes:[],props:{}},InvalidSignerId:{name:"InvalidSignerId",subtypes:[],props:{account_id:""}},InvalidTxError:{name:"InvalidTxError",subtypes:["InvalidAccessKeyError","InvalidSignerId","SignerDoesNotExist","InvalidNonce","NonceTooLarge","InvalidReceiverId","InvalidSignature","NotEnoughBalance","LackBalanceForState","CostOverflow","InvalidChain","Expired","ActionsValidation","TransactionSizeExceeded","StorageError","ShardCongested","ShardStuck"],props:{}},IteratorWasInvalidated:{name:"IteratorWasInvalidated",subtypes:[],props:{iterator_index:""}},KeyLengthExceeded:{name:"KeyLengthExceeded",subtypes:[],props:{length:"",limit:""}},LackBalanceForState:{name:"LackBalanceForState",subtypes:[],props:{account_id:"",amount:""}},Memory:{name:"Memory",subtypes:[],props:{}},MemoryAccessViolation:{name:"MemoryAccessViolation",subtypes:[],props:{}},MemoryOutOfBounds:{name:"MemoryOutOfBounds",subtypes:[],props:{}},MethodEmptyName:{name:"MethodEmptyName",subtypes:[],props:{}},MethodInvalidSignature:{name:"MethodInvalidSignature",subtypes:[],props:{}},MethodNameMismatch:{name:"MethodNameMismatch",subtypes:[],props:{method_name:""}},MethodNotFound:{name:"MethodNotFound",subtypes:[],props:{}},MethodResolveError:{name:"MethodResolveError",subtypes:["MethodEmptyName","MethodNotFound","MethodInvalidSignature"],props:{}},MisalignedAtomicAccess:{name:"MisalignedAtomicAccess",subtypes:[],props:{}},NonceTooLarge:{name:"NonceTooLarge",subtypes:[],props:{tx_nonce:"",upper_bound:""}},NotEnoughAllowance:{name:"NotEnoughAllowance",subtypes:[],props:{account_id:"",allowance:"",cost:"",public_key:""}},NotEnoughBalance:{name:"NotEnoughBalance",subtypes:[],props:{balance:"",cost:"",signer_id:""}},NumberInputDataDependenciesExceeded:{name:"NumberInputDataDependenciesExceeded",subtypes:[],props:{limit:"",number_of_input_data_dependencies:""}},NumberOfLogsExceeded:{name:"NumberOfLogsExceeded",subtypes:[],props:{limit:""}},NumberPromisesExceeded:{name:"NumberPromisesExceeded",subtypes:[],props:{limit:"",number_of_promises:""}},OnlyImplicitAccountCreationAllowed:{name:"OnlyImplicitAccountCreationAllowed",subtypes:[],props:{account_id:""}},PrepareError:{name:"PrepareError",subtypes:["Serialization","Deserialization","InternalMemoryDeclared","GasInstrumentation","StackHeightInstrumentation","Instantiate","Memory","TooManyFunctions","TooManyLocals"],props:{}},ProhibitedInView:{name:"ProhibitedInView",subtypes:[],props:{method_name:""}},ReceiptSizeExceeded:{name:"ReceiptSizeExceeded",subtypes:[],props:{limit:"",size:""}},ReceiptValidationError:{name:"ReceiptValidationError",subtypes:["InvalidPredecessorId","InvalidReceiverId","InvalidSignerId","InvalidDataReceiverId","ReturnedValueLengthExceeded","NumberInputDataDependenciesExceeded","ActionsValidation","ReceiptSizeExceeded"],props:{}},ReceiverMismatch:{name:"ReceiverMismatch",subtypes:[],props:{ak_receiver:"",tx_re
41ceiver:""}},RequiresFullAccess:{name:"RequiresFullAccess",subtypes:[],props:{}},ReturnedValueLengthExceeded:{name:"ReturnedValueLengthExceeded",subtypes:[],props:{length:"",limit:""}},Serialization:{name:"Serialization",subtypes:[],props:{}},ShardCongested:{name:"ShardCongested",subtypes:[],props:{congestion_level:"",shard_id:""}},ShardStuck:{name:"ShardStuck",subtypes:[],props:{missed_chunks:"",shard_id:""}},SignerDoesNotExist:{name:"SignerDoesNotExist",subtypes:[],props:{signer_id:""}},StackHeightInstrumentation:{name:"StackHeightInstrumentation",subtypes:[],props:{}},StackOverflow:{name:"StackOverflow",subtypes:[],props:{}},TooManyFunctions:{name:"TooManyFunctions",subtypes:[],props:{}},TooManyLocals:{name:"TooManyLocals",subtypes:[],props:{}},TotalLogLengthExceeded:{name:"TotalLogLengthExceeded",subtypes:[],props:{length:"",limit:""}},TotalNumberOfActionsExceeded:{name:"TotalNumberOfActionsExceeded",subtypes:[],props:{limit:"",total_number_of_actions:""}},TotalPrepaidGasExceeded:{name:"TotalPrepaidGasExceeded",subtypes:[],props:{limit:"",total_prepaid_gas:""}},TransactionSizeExceeded:{name:"TransactionSizeExceeded",subtypes:[],props:{limit:"",size:""}},TriesToStake:{name:"TriesToStake",subtypes:[],props:{account_id:"",balance:"",locked:"",stake:""}},TriesToUnstake:{name:"TriesToUnstake",subtypes:[],props:{account_id:""}},TxExecutionError:{name:"TxExecutionError",subtypes:["ActionError","InvalidTxError"],props:{}},Unreachable:{name:"Unreachable",subtypes:[],props:{}},UnsuitableStakingKey:{name:"UnsuitableStakingKey",subtypes:[],props:{public_key:""}},UnsupportedProtocolFeature:{name:"UnsupportedProtocolFeature",subtypes:[],props:{protocol_feature:"",version:""}},ValueLengthExceeded:{name:"ValueLengthExceeded",subtypes:[],props:{length:"",limit:""}},WasmTrap:{name:"WasmTrap",subtypes:["Unreachable","IncorrectCallIndirectSignature","MemoryOutOfBounds","CallIndirectOOB","IllegalArithmetic","MisalignedAtomicAccess","IndirectCallToNull","StackOverflow","GenericTrap"],props:{}},WasmerCompileError:{name:"WasmerCompileError",subtypes:[],props:{msg:""}},Closed:{name:"Closed",subtypes:[],props:{}},ServerError:{name:"ServerError",subtypes:["TxExecutionError","Timeout","Closed"],props:{}},Timeout:{name:"Timeout",subtypes:[],props:{}}}},U={formatNear:()=>(e,t)=>C(t(e))},$=class extends E{},K=class extends ${transaction_outcome};function F(e){let t={},r=V(e,B.schema,t,""),n=new $(q(r,t),r);return Object.assign(n,t),n}function z(e){let t=F(e.status.Failure),r=new K;return Object.assign(r,t),r.type=t.type,r.message=t.message,r.transaction_outcome=e.transaction_outcome,r}function q(e,t){return"string"==typeof P[e]?x.render(P[e],{...t,...U}):JSON.stringify(t)}function V(e,t,r,n){let i,o,s;for(let r in t){if(W(e[r]))return e[r];if(G(e[r]))i=e[r],o=t[r],s=r;else{if(!(G(e.kind)&&G(e.kind[r])))continue;i=e.kind[r],o=t[r],s=r}}if(!i||!o)return r.kind=e,n;for(let e of Object.keys(o.props))r[e]=i[e];return V(i,t,r,s)}function H(e,t){switch(!0){case/^account .*? does not exist while viewing$/.test(e):case/^Account .*? doesn't exist$/.test(e):return"AccountDoesNotExist";case/^access key .*? does not exist while viewing$/.test(e):return"AccessKeyDoesNotExist";case/wasm execution failed with error: FunctionCallError\(CompilationError\(CodeDoesNotExist/.test(e):case/wasm execution failed with error: CompilationError\(CodeDoesNotExist/.test(e):return"CodeDoesNotExist";case/wasm execution failed with error: FunctionCallError\(MethodResolveError\(MethodNotFound/.test(e):case/wasm execution failed with error: MethodResolveError\(MethodNotFound/.test(e):return"MethodNotFound";case/Transaction nonce \d+ must be larger than nonce of the used access key \d+/.test(e):return"InvalidNonce";default:return t}}function G(e){return"[object Object]"===Object.prototype.toString.call(e)}function W(e){return"[object String]"===Object.prototype.toString.call(e)}var J=new class{constructor(e){this.logLevels=e}isLevelEnabled=e=>this.logLevels.includes(e);print(e,t,...r){switch(e){case"error":case"fatal":return console.error(t,...r);case"warn":return console.warn(t,...r);case"log":return console.log(t,...r);case"debug":case"verbose":return console.debug(t,...r)}}verbose(e,...t){this.isLevelEnabled("verbose")&&this.print("verbose",e,...t)}debug(e,...t){this.isLevelEnabled("debug")&&this.print("debug",e,...t)}log(e,...t){this.isLevelEnabled("log")&&this.print("log",e,...t)}warn(e,...t){this.isLevelEnabled("warn")&&this.print("warn",e,...t)}error(e,...t){this.isLevelEnabled("error")&&this.print("error",e,...t)}fatal(e,...t){this.isLevelEnabled("fatal")&&this.print("fatal",e,...t)}}
41(["verbose","debug","log","warn","error","fatal"]),Z=class{static instanceRef=J;static overrideLogger=e=>{this.instanceRef=e};static error(e,...t){this.instanceRef?.error(e,...t)}static log(e,...t){this.instanceRef?.log(e,...t)}static warn(e,...t){this.instanceRef?.warn(e,...t)}static debug(e,...t){this.instanceRef?.debug?.(e,...t)}static verbose(e,...t){this.instanceRef?.verbose?.(e,...t)}static fatal(e,...t){this.instanceRef?.fatal?.(e,...t)}};function Y({contractId:e,outcome:t}){for(let r of[t.transaction_outcome,...t.receipts_outcome].reduce((e,t)=>{let r="object"==typeof t.outcome.status&&"object"==typeof t.outcome.status.Failure;return t.outcome.logs.length||r?e.concat({receiptIds:t.outcome.receipt_ids,logs:t.outcome.logs,failure:"object"==typeof t.outcome.status&&void 0!==t.outcome.status.Failure?F(t.outcome.status.Failure):null}):e},[]))Z.log(`Receipt${r.receiptIds.length>1?"s":""}: ${r.receiptIds.join(", ")}`),X({contractId:e,logs:r.logs,prefix:" "}),r.failure&&Z.warn(` Failure [${e}]: ${r.failure}`)}function X({contractId:e,logs:t,prefix:r=""}){for(let n of t)Z.log(`${r}Log [${e}]: ${n}`)}function Q(e){if("object"==typeof e.status&&"string"==typeof e.status.SuccessValue){let t=O.from(e.status.SuccessValue,"base64").toString();try{return JSON.parse(t)}catch(e){return t}}return null}function ee(e,t){return e<t?-1:e>t?1:0}function et(e,t,r,n){return n&&n<49?er(e,t):(r||(I("findSeatPrice(validators, maxNumberOfSeats)")("`use `findSeatPrice(validators, maxNumberOfSeats, minimumStakeRatio)` instead"),r=[1,6250]),en(e,t,r))}function er(e,t){let r=e.map(e=>BigInt(e.stake)).sort(ee),n=BigInt(t),i=r.reduce((e,t)=>e+t);if(i<n)throw Error("Stakes are below seats");let o=1n,s=i+1n;for(;o!==s-1n;){let e=(o+s)/2n,t=!1,i=0n;for(let s=0;s<r.length;++s)if((i+=r[s]/e)>=n){o=e,t=!0;break}t||(s=e)}return o}function en(e,t,r){if(2!=r.length)throw Error("minimumStakeRatio should have 2 elements");let n=e.map(e=>BigInt(e.stake)).sort(ee),i=n.reduce((e,t)=>e+t);return e.length<t?i*BigInt(r[0])/BigInt(r[1]):n[0]+1n}var ei=r(17078),eo=r(22265),es=(e=>(e[e.ED25519=0]="ED25519",e[e.SECP256K1=1]="SECP256K1",e))(es||{});let ea={SECRET_KEY:32,ED25519_PUBLIC_KEY:32,SECP256k1_PUBLIC_KEY:64};function ec(e){switch(e){case es.ED25519:return"ed25519";case es.SECP256K1:return"secp256k1";default:throw Error(`Unknown key type ${e}`)}}function eu(e){switch(e.toLowerCase()){case"ed25519":return es.ED25519;case"secp256k1":return es.SECP256K1;default:throw Error(`Unknown key type ${e}`)}}function el(e){switch(e){case es.ED25519:return"ed25519Key";case es.SECP256K1:return"secp256k1Key";default:throw Error(`unknown type ${e}`)}}class ed{constructor(e){if(1!==Object.keys(e).length)throw Error("Enum can only take single value");Object.keys(e).map(t=>{this[t]=e[t]})}}class ef extends ed{enum;ed25519Key;secp256k1Key;constructor(e){let t=el(e.keyType);super({[t]:e}),this[t]=e,this.enum=t}static from(e){return"string"==typeof e?ef.fromString(e):e}static fromString(e){let t,r;let n=e.split(":");if(1===n.length)t=n[0];else if(2===n.length)t=n[1],r=eu(n[0]);else throw Error("Invalid encoded key format, must be <curve>:<encoded key>");let i=L(t);r||(r=i.length===ea.SECP256k1_PUBLIC_KEY?es.SECP256K1:es.ED25519);let o=r===es.ED25519?ea.ED25519_PUBLIC_KEY:ea.SECP256k1_PUBLIC_KEY;if(i.length!==o)throw Error(`Invalid public key size (${i.length}), must be ${o}`);return new ef({keyType:r,data:i})}toString(){let e=R(this.data);return`${ec(this.keyType)}:${e}`}verify(e,t){let r=this.keyType,n=this.data;switch(r){case es.ED25519:return ei.ev.verify(t,e,n);case es.SECP256K1:return eo.ecdsaVerify(t.subarray(0,64),e,new Uint8Array([4,...n]));default:throw Error(`Unknown key type: ${r}`)}}get keyPair(){return this.ed25519Key||this.secp256k1Key}get keyType(){return this.keyPair.keyType}get data(){return this.keyPair.data}}async function eh(e,t,r,n){let i=e;for(let e=0;e<t;e++){let e=await n();if(e)return e;await ep(i),i*=r}return null}function ep(e){return new Promise(t=>setTimeout(t,e))}class ey{constructor(e){if(1!==Object.keys(e).length)throw Error("Enum can only take single value");Object.keys(e).map(t=>{this[t]=e[t]})}}class eg{allowance;receiverId;methodNames;constructor({allowance:e,receiverId:t,methodNames:r}){this.allowance=e,this.receiverId=t,this.methodNames=r}}class em{}class eb extends ey{enum;functionCall;fullAccess;constructor(e){for(let[t,r]of(super(e),Object.entries(e||{})))this[t]=r,this.enum=t}}class ev{nonce;permission;constructor({nonce:e,permission:t}){this.nonce=e,this.permission=t}}class ew{}class e_{code;constructor({code:e}
41){this.code=e}}class eE{methodName;args;gas;deposit;constructor({methodName:e,args:t,gas:r,deposit:n}){this.methodName=e,this.args=t,this.gas=r,this.deposit=n}}class eS extends ey{enum;CodeHash;AccountId;constructor(e){for(let[t,r]of(super(e),Object.entries(e||{})))this[t]=r,this.enum=t}}class ex extends ey{enum;CodeHash;AccountId;constructor(e){for(let[t,r]of(super(e),Object.entries(e||{})))this[t]=r,this.enum=t}}class eA{code;deployMode;constructor({code:e,deployMode:t}){this.code=e,this.deployMode=t}}class eI{contractIdentifier;constructor({contractIdentifier:e}){this.contractIdentifier=e}}class eO{deposit;constructor({deposit:e}){this.deposit=e}}class eT{stake;publicKey;constructor({stake:e,publicKey:t}){this.stake=e,this.publicKey=t}}class eP{publicKey;accessKey;constructor({publicKey:e,accessKey:t}){this.publicKey=e,this.accessKey=t}}class eM{publicKey;constructor({publicKey:e}){this.publicKey=e}}class eN{beneficiaryId;constructor({beneficiaryId:e}){this.beneficiaryId=e}}class ek{delegateAction;signature;constructor({delegateAction:e,signature:t}){this.delegateAction=e,this.signature=t}}class eC extends ey{enum;createAccount;deployContract;functionCall;transfer;stake;addKey;deleteKey;deleteAccount;signedDelegate;deployGlobalContract;useGlobalContract;constructor(e){for(let[t,r]of(super(e),Object.entries(e||{})))this[t]=r,this.enum=t}}var eD=r(75927).Buffer;function ej(e){return void 0!==e.byteLength&&e.byteLength===e.length?e:eD.from(JSON.stringify(e))}let eR={addKey:function(e,t){return new eC({addKey:new eP({publicKey:e,accessKey:t})})},createAccount:function(){return new eC({createAccount:new ew})},deleteAccount:function(e){return new eC({deleteAccount:new eN({beneficiaryId:e})})},deleteKey:function(e){return new eC({deleteKey:new eM({publicKey:e})})},deployContract:function(e){return new eC({deployContract:new e_({code:e})})},fullAccessKey:function(){return new ev({nonce:0n,permission:new eb({fullAccess:new em})})},functionCall:function(e,t,r=0n,n=0n,i=ej){return new eC({functionCall:new eE({methodName:e,args:i(t),gas:r,deposit:n})})},functionCallAccessKey:function(e,t,r){return new ev({nonce:0n,permission:new eb({functionCall:new eg({receiverId:e,allowance:r,methodNames:t})})})},signedDelegate:function({delegateAction:e,signature:t}){return new eC({signedDelegate:new ek({delegateAction:e,signature:t})})},stake:function(e=0n,t){return new eC({stake:new eT({stake:e,publicKey:t})})},transfer:function(e=0n){return new eC({transfer:new eO({deposit:e})})},deployGlobalContract:function(e,t){return new eC({deployGlobalContract:new eA({code:e,deployMode:t})})},useGlobalContract:function(e){return new eC({useGlobalContract:new eI({contractIdentifier:e})})}};var eL=["u8","u16","u32","u64","u128","i8","i16","i32","i64","i128","f32","f64"],eB=function(){function e(){this.offset=0,this.buffer_size=256,this.buffer=new ArrayBuffer(this.buffer_size),this.view=new DataView(this.buffer)}return e.prototype.resize_if_necessary=function(e){if(this.buffer_size-this.offset<e){this.buffer_size=Math.max(2*this.buffer_size,this.buffer_size+e);var t=new ArrayBuffer(this.buffer_size);new Uint8Array(t).set(new Uint8Array(this.buffer)),this.buffer=t,this.view=new DataView(t)}},e.prototype.get_used_buffer=function(){return new Uint8Array(this.buffer).slice(0,this.offset)},e.prototype.store_value=function(e,t){var r=t.substring(1),n=parseInt(r)/8;this.resize_if_necessary(n);var i="f"===t[0]?"setFloat".concat(r):"i"===t[0]?"setInt".concat(r):"setUint".concat(r);this.view[i](this.offset,e,!0),this.offset+=n},e.prototype.store_bytes=function(e){this.resize_if_necessary(e.length),new Uint8Array(this.buffer).set(new Uint8Array(e),this.offset),this.offset+=e.length},e}(),eU=function(){function e(e){this.offset=0,this.buffer_size=e.length,this.buffer=new ArrayBuffer(e.length),new Uint8Array(this.buffer).set(e),this.view=new DataView(this.buffer)}return e.prototype.assert_enough_buffer=function(e){if(this.offset+e>this.buffer.byteLength)throw Error("Error in schema, the buffer is smaller than expected")},e.prototype.consume_value=function(e){var t=e.substring(1),r=parseInt(t)/8;this.assert_enough_buffer(r);var n="f"===e[0]?"getFloat".concat(t):"i"===e[0]?"getInt".concat(t):"getUint".concat(t),i=this.view[n](this.offset,!0);return this.offset+=r,i},e.prototype.consume_bytes=function(e){this.assert_enough_buffer(e);var t=this.buffer.slice(this.offset,this.offset+e);return this.offset+=e,t},e}(),e$=function(){var e=function(t,r){return(e=Object.setPrototypeOf||({__proto__:[]}
41)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])})(t,r)};return function(t,r){if("function"!=typeof r&&null!==r)throw TypeError("Class extends value "+String(r)+" is not a constructor or null");function n(){this.constructor=t}e(t,r),t.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}();function eK(e){return Array.isArray(e)||!!e&&"object"==typeof e&&"length"in e&&"number"==typeof e.length&&(0===e.length||e.length>0&&e.length-1 in e)}function eF(e,t,r){if(typeof e!==t)throw Error("Expected ".concat(t," not ").concat(typeof e,"(").concat(e,") at ").concat(r.join(".")))}function ez(e,t){var r=["number","string","bigint","boolean"].includes(typeof e),n="object"==typeof e&&null!==e&&"toString"in e;if(!r&&!n)throw Error("Expected bigint, number, boolean or string not ".concat(typeof e,"(").concat(e,") at ").concat(t.join(".")))}function eq(e,t,r){if(e!==t)throw Error("Array length ".concat(e," does not match schema length ").concat(t," at ").concat(r.join(".")))}function eV(e,t){if("object"!=typeof e||null===e)throw Error("Expected object not ".concat(typeof e,"(").concat(e,") at ").concat(t.join(".")))}var eH=eL.concat(["bool","string"]),eG=["option","enum","array","set","map","struct"],eW=function(e){function t(t,r){var n="Invalid schema: ".concat(JSON.stringify(t)," expected ").concat(r);return e.call(this,n)||this}return e$(t,e),t}(Error);function eJ(e){if(!("string"==typeof e&&eH.includes(e))){if(e&&"object"==typeof e){var t=Object.keys(e);if(1===t.length&&eG.includes(t[0])){var r=t[0];if("option"===r)return eJ(e[r]);if("enum"===r)return eZ(e[r]);if("array"===r)return eY(e[r]);if("set"===r)return eJ(e[r]);if("map"===r)return eX(e[r]);if("struct"===r)return eQ(e[r])}}throw new eW(e,eG.join(", ")+" or "+eH.join(", "))}}function eZ(e){if(!Array.isArray(e))throw new eW(e,"Array");for(var t=0,r=e;t<r.length;t++){var n=r[t];if("object"!=typeof n||!("struct"in n))throw Error('Missing "struct" key in enum schema');if("object"!=typeof n.struct||1!==Object.keys(n.struct).length)throw Error('The "struct" in each enum must have a single key');eJ({struct:n.struct})}}function eY(e){if("object"!=typeof e)throw new eW(e,"{ type, len? }");if(e.len&&"number"!=typeof e.len)throw Error("Invalid schema: ".concat(e));if("type"in e)return eJ(e.type);throw new eW(e,"{ type, len? }")}function eX(e){if("object"==typeof e&&"key"in e&&"value"in e)eJ(e.key),eJ(e.value);else throw new eW(e,"{ key, value }")}function eQ(e){if("object"!=typeof e)throw new eW(e,"object");for(var t in e)eJ(e[t])}var e0=function(){function e(e){this.encoded=new eB,this.fieldPath=["value"],this.checkTypes=e}return e.prototype.encode=function(e,t){return this.encode_value(e,t),this.encoded.get_used_buffer()},e.prototype.encode_value=function(e,t){if("string"==typeof t){if(eL.includes(t))return this.encode_integer(e,t);if("string"===t)return this.encode_string(e);if("bool"===t)return this.encode_boolean(e)}if("object"==typeof t){if("option"in t)return this.encode_option(e,t);if("enum"in t)return this.encode_enum(e,t);if("array"in t)return this.encode_array(e,t);if("set"in t)return this.encode_set(e,t);if("map"in t)return this.encode_map(e,t);if("struct"in t)return this.encode_struct(e,t)}},e.prototype.encode_integer=function(e,t){var r=parseInt(t.substring(1));r<=32||"f64"==t?(this.checkTypes&&eF(e,"number",this.fieldPath),this.encoded.store_value(e,t)):(this.checkTypes&&ez(e,this.fieldPath),this.encode_bigint(BigInt(e),r))},e.prototype.encode_bigint=function(e,t){for(var r=t/8,n=new Uint8Array(r),i=0;i<r;i++)n[i]=Number(e&BigInt(255)),e>>=BigInt(8);this.encoded.store_bytes(new Uint8Array(n))},e.prototype.encode_string=function(e){this.checkTypes&&eF(e,"string",this.fieldPath);var t=e;this.encoded.store_value(t.length,"u32");for(var r=0;r<t.length;r++)this.encoded.store_value(t.charCodeAt(r),"u8")},e.prototype.encode_boolean=function(e){this.checkTypes&&eF(e,"boolean",this.fieldPath),this.encoded.store_value(e?1:0,"u8")},e.prototype.encode_option=function(e,t){null==e?this.encoded.store_value(0,"u8"):(this.encoded.store_value(1,"u8"),this.encode_value(e,t.option))},e.prototype.encode_enum=function(e,t){this.checkTypes&&eV(e,this.fieldPath);for(var r=Object.keys(e)[0],n=0;n<t.enum.length;n++){var i=t.enum[n];if(r===Object.keys(i.struct)[0])return this.encoded.store_value(n,"u8"),this.encode_struct(e,i)}throw Error("Enum key (".concat(r,") not found in enum schema: ").concat(JSON.stringify(t)," at ").concat(this.fieldPath.join(".")))},e.prototype.encode_array=function(e,t){if(eK(e))return this.encode_arraylike(e,t);if(e instanceof ArrayBuffer)return this.encode_buffer(e,t);throw Error("Expected Array-like not ".concat(typeof e,"(").concat(e,") at ").concat(this.fieldPath.join(".")))},e.prototype.encode_arraylike=function(e,t){t.array.len?eq(e.length,t.array.len,this.fieldPath):this.encoded.store_value(e.length,"u32");for(var r=0;r<e.length;r++)this.encode_value(e[r],t.array.type)},e.prototype.encode_buffer=function(e,t){t.array.len?eq(e.byteLength,t.array.len,this.fieldPath):this.encoded.store_value(e.byteLength,"u32"),this.encoded.store_bytes(new Uint8Array(e))},e.prototype.encode_set=function(e,t){this.checkTypes&&eF(e,"object",this.fieldPath);var r=e instanceof Set?Array.from(e.values()):Object.values(e);this.encoded.store_value(r.length,"u32");for(var n=0,i=r;n<i.length;n++){var o=i[n];this.encode_value(o,t.set)}},e.prototype.encode_map=function(e,t){this.checkTypes&&eF(e,"object",this.fieldPath);var r=e instanceof Map,n=r?Array.from(e.keys()):Object.keys(e);this.encoded.store_value(n.length,"u32");for(var i=0,o=n;i<o.length;i++){var s=o[i];this.encode_value(s,t.map.key),this.encode_value(r?e.get(s):e[s],t.map.value)}},e.prototype.encode_struct=function(e,t){this.checkTypes&&eF(e,"object",this.fieldPath);for(var r=0,n=Object.keys(t.struct);r<n.length;r++){var i=n[r];this.fieldPath.push(i),this.encode_value(e[i],t.struct[i]),this.fieldPath.pop()}},e}(),e1=function(){function e(e){this.buffer=new eU(e)}return e.prototype.decode=function(e){return this.decode_value(e)},e.prototype.decode_value=function(e){if("string"==typeof e){if(eL.includes(e))return this.decode_integer(e);if("string"===e)return this.decode_string();if("bool"===e)return this.decode_boolean()}if("object"==typeof e){if("option"in e)return this.decode_option(e);if("enum"in e)return this.decode_enum(e);
41if("array"in e)return this.decode_array(e);if("set"in e)return this.decode_set(e);if("map"in e)return this.decode_map(e);if("struct"in e)return this.decode_struct(e)}throw Error("Unsupported type: ".concat(e))},e.prototype.decode_integer=function(e){var t=parseInt(e.substring(1));return t<=32||"f64"==e?this.buffer.consume_value(e):this.decode_bigint(t,e.startsWith("i"))},e.prototype.decode_bigint=function(e,t){void 0===t&&(t=!1);var r=e/8,n=new Uint8Array(this.buffer.consume_bytes(r)),i=n.reduceRight(function(e,t){return e+t.toString(16).padStart(2,"0")},"");return t&&n[r-1]?BigInt.asIntN(e,BigInt("0x".concat(i))):BigInt("0x".concat(i))},e.prototype.decode_string=function(){var e=this.decode_integer("u32"),t=new Uint8Array(this.buffer.consume_bytes(e));return String.fromCharCode.apply(null,t)},e.prototype.decode_boolean=function(){return this.buffer.consume_value("u8")>0},e.prototype.decode_option=function(e){var t=this.buffer.consume_value("u8");if(1===t)return this.decode_value(e.option);if(0!==t)throw Error("Invalid option ".concat(t));return null},e.prototype.decode_enum=function(e){var t,r=this.buffer.consume_value("u8");if(r>e.enum.length)throw Error("Enum option ".concat(r," is not available"));var n=e.enum[r].struct,i=Object.keys(n)[0];return(t={})[i]=this.decode_value(n[i]),t},e.prototype.decode_array=function(e){for(var t=[],r=e.array.len?e.array.len:this.decode_integer("u32"),n=0;n<r;++n)t.push(this.decode_value(e.array.type));return t},e.prototype.decode_set=function(e){for(var t=this.decode_integer("u32"),r=new Set,n=0;n<t;++n)r.add(this.decode_value(e.set));return r},e.prototype.decode_map=function(e){for(var t=this.decode_integer("u32"),r=new Map,n=0;n<t;++n){var i=this.decode_value(e.map.key),o=this.decode_value(e.map.value);r.set(i,o)}return r},e.prototype.decode_struct=function(e){var t={};for(var r in e.struct)t[r]=this.decode_value(e.struct[r]);return t},e}();function e2(e,t,r){return void 0===r&&(r=!0),r&&eJ(e),new e0(r).encode(t,e)}function e5(e,t,r){return void 0===r&&(r=!0),r&&eJ(e),new e1(t).decode(e)}let e3=0x40000000,e8={MetaTransactions:366};class e6{prefix;constructor({prefix:e}){this.prefix=e}}class e4 extends e6{constructor(e){super({prefix:e3+e})}}class e9 extends e4{constructor(){super(e8.MetaTransactions)}}function e7(e){return new Uint8Array([...e2(to.DelegateActionPrefix,new e9),...e2(to.DelegateAction,e)])}function te(e){return e2("signature"in e?to.SignedTransaction:to.Transaction,e)}function tt(e){return new tn(e5(to.Transaction,e))}function tr(e){return new ti(e5(to.SignedTransaction,e))}class tn{signerId;publicKey;nonce;receiverId;actions;blockHash;constructor({signerId:e,publicKey:t,nonce:r,receiverId:n,actions:i,blockHash:o}){this.signerId=e,this.publicKey=t,this.nonce=r,this.receiverId=n,this.actions=i,this.blockHash=o}encode(){return te(this)}static decode(e){return tt(e)}}class ti{transaction;signature;constructor({transaction:e,signature:t}){this.transaction=e,this.signature=t}encode(){return te(this)}static decode(e){return tr(e)}}let to=new class{Ed25519Signature={struct:{data:{array:{type:"u8",len:64}}}};Secp256k1Signature={struct:{data:{array:{type:"u8",len:65}}}};Signature={enum:[{struct:{ed25519Signature:this.Ed25519Signature}},{struct:{secp256k1Signature:this.Secp256k1Signature}}]};Ed25519Data={struct:{data:{array:{type:"u8",len:32}}}};Secp256k1Data={struct:{data:{array:{type:"u8",len:64}}}};PublicKey={enum:[{struct:{ed25519Key:this.Ed25519Data}},{struct:{secp256k1Key:this.Secp256k1Data}}]};FunctionCallPermission={struct:{allowance:{option:"u128"},receiverId:"string",methodNames:{array:{type:"string"}}}};FullAccessPermission={struct:{}};AccessKeyPermission={enum:[{struct:{functionCall:this.FunctionCallPermission}},{struct:{fullAccess:this.FullAccessPermission}}]};AccessKey={struct:{nonce:"u64",permission:this.AccessKeyPermission}};CreateAccount={struct:{}};DeployContract={struct:{code:{array:{type:"u8"}}}};FunctionCall={struct:{methodName:"string",args:{array:{type:"u8"}},gas:"u64",deposit:"u128"}};Transfer={struct:{deposit:"u128"}};Stake={struct:{stake:"u128",publicKey:this.PublicKey}};AddKey={struct:{publicKey:this.PublicKey,accessKey:this.AccessKey}};DeleteKey={struct:{publicKey:this.PublicKey}};DeleteAccount={struct:{beneficiaryId:"string"}};GlobalContractDeployMode={enum:[{struct:{CodeHash:{struct:{}}}},{struct:{AccountId:{struct:{}}}}]};GlobalContractIdentifier={enum:[{struct:{CodeHash:{array:{type:"u8",len:32}}}},{struct:{AccountId:"string"}}]};DeployGlobalContract={struct:{code:{array:{type:"u8"}},deployMode:this.GlobalContractDeployMode}};UseGlobalContract={struct:{contractIdentifier:this.GlobalContractIdentifier}};DelegateActionPrefix={struct:{prefix:"u32"}};ClassicActions={enum:[{struct:{createAccount:this.CreateAccount}},{struct:{deployContract:this.DeployContract}},{struct:{functionCall:this.FunctionCall}},{struct:{transfer:this.Transfer}},{struct:{stake:this.Stake}},{struct:{addKey:this.AddKey}},{struct:{deleteKey:this.DeleteKey}},{struct:{deleteAccount:this.DeleteAccount}},{struct:{signedDelegate:"string"}},{struct:{deployGlobalContract:this.DeployGlobalContract}},{struct:{useGlobalContract:this.UseGlobalContract}}]};DelegateAction={struct:{senderId:"string",receiverId:"string",actions:{array:{type:this.ClassicActions}},nonce:"u64",maxBlockHeight:"u64",publicKey:this.PublicKey}};SignedDelegate={struct:{delegateAction:this.DelegateAction,signature:this.Signature}};Action={enum:[{struct:{createAccount:this.CreateAccount}},{struct:{deployContract:this.DeployContract}},{struct:{functionCall:this.FunctionCall}},{struct:{transfer:this.Transfer}},{struct:{stake:this.Stake}},{struct:{addKey:this.AddKey}},{struct:{deleteKey:this.DeleteKey}},{struct:{deleteAccount:this.DeleteAccount}},{struct:{signedDelegate:this.SignedDelegate}},{struct:{deployGlobalContract:this.DeployGlobalContract}},{struct:{useGlobalContract:this.UseGlobalContract}}]};Transaction={struct:{signerId:"string",publicKey:this.PublicKey,nonce:"u64",receiverId:"string",blockHash:{array:{type:"u8",len:32}},actions:{array:{type:this.Action}}}};SignedTransaction={struct:{transaction:this.Transaction,signature:this.Signature}}};function ts(e,t,r,n,i,o){return new tn({signerId:e,publicKey:t,nonce:"bigint"==typeof n?n:BigInt(n),receiverId:r,actions:i,blockHash:o})}let{addKey:ta,createAccount:tc,deleteAccount:tu,deleteKey:tl,deployContract:td,functionCall:tf,stake:th,transfer:tp,deployGlobalContract:ty,useGlobalContract:tg}=eR;class tm{senderId;receiverId;actions;nonce;maxBlockHeight;publicKey;constructor({senderId:e,receiverId:t,actions:r,nonce:n,maxBlockHeight:i,publicKey:o}){this.senderId=e,this.receiverId=t,this.actions=r,this.nonce=n,this.maxBlockHeight=i,this.publicKey=o}}
41function tb({actions:e,maxBlockHeight:t,nonce:r,publicKey:n,receiverId:i,senderId:o}){return new tm({senderId:o,receiverId:i,actions:e.map(e=>{if(!e.type&&!e.params)return e;switch(e.type){case"AddKey":{let{publicKey:t,accessKey:r}=e.params;return ta(t,r)}case"CreateAccount":return tc(e.params.createAccount);case"DeleteAccount":return tu(e.params.deleteAccount);case"DeleteKey":return tl(e.params.publicKey);case"DeployContract":return td(e.params.code);case"FunctionCall":{let{methodName:t,args:r,gas:n,deposit:i}=e.params;return tf(t,r,n,i)}case"Stake":return th(e.params.stake,e.params.publicKey);case"Transfer":{let{deposit:t}=e.params;return tp(t)}case"DeployGlobalContract":{let{code:t,deployMode:r}=e.params;return ty(t,r instanceof eS?r:new eS(r))}case"UseGlobalContract":{let{identifier:t}=e.params;return tg(t instanceof ex?t:new ex(t))}}throw Error("Unrecognized action")}),nonce:r,maxBlockHeight:t,publicKey:n})}class tv{}var tw=r(52815);class t_ extends tv{publicKey;secretKey;extendedSecretKey;constructor(e){super();let t=new Uint8Array(L(e).slice(0,ea.SECRET_KEY)),r=ei.ev.getPublicKey(new Uint8Array(t));this.publicKey=new ef({keyType:es.ED25519,data:r}),this.secretKey=R(t),this.extendedSecretKey=e}static fromRandom(){let e=tw(ea.SECRET_KEY),t=ei.ev.getPublicKey(new Uint8Array(e));return new t_(R(new Uint8Array([...e,...t])))}sign(e){return{signature:ei.ev.sign(e,L(this.secretKey)),publicKey:this.publicKey}}verify(e,t){return this.publicKey.verify(e,t)}toString(){return`ed25519:${this.extendedSecretKey}`}getPublicKey(){return this.publicKey}}class tE extends tv{publicKey;secretKey;extendedSecretKey;constructor(e){super();let t=new Uint8Array(L(e).slice(0,ea.SECRET_KEY)),r=eo.publicKeyCreate(new Uint8Array(t),!1),n=r.subarray(1,r.length);this.publicKey=new ef({keyType:es.SECP256K1,data:n}),this.secretKey=R(t),this.extendedSecretKey=e}static fromRandom(){let e=tw(ea.SECRET_KEY),t=eo.publicKeyCreate(new Uint8Array(e),!1);return new tE(R(new Uint8Array([...e,...t.subarray(1,t.length)])))}sign(e){let{signature:t,recid:r}=eo.ecdsaSign(e,L(this.secretKey));return{signature:new Uint8Array([...t,r]),publicKey:this.publicKey}}verify(e,t){return this.publicKey.verify(e,t)}toString(){return`secp256k1:${this.extendedSecretKey}`}getPublicKey(){return this.publicKey}}class tS extends tv{static fromRandom(e){switch(e.toUpperCase()){case"ED25519":return t_.fromRandom();case"SECP256K1":return tE.fromRandom();default:throw Error(`Unknown curve ${e}`)}}static fromString(e){let t=e.split(":");if(2===t.length)switch(t[0].toUpperCase()){case"ED25519":return new t_(t[1]);case"SECP256K1":return new tE(t[1]);default:throw Error(`Unknown curve: ${t[0]}`)}else throw Error("Invalid encoded key format, must be <curve>:<encoded key>")}}function tx(e){return e instanceof Uint8Array||ArrayBuffer.isView(e)&&"Uint8Array"===e.constructor.name}function tA(e,...t){if(!tx(e))throw Error("Uint8Array expected");if(t.length>0&&!t.includes(e.length))throw Error("Uint8Array expected of length "+t+", got length="+e.length)}function tI(e,t=!0){if(e.destroyed)throw Error("Hash instance has been destroyed");if(t&&e.finished)throw Error("Hash#digest() has already been called")}function tO(e,t){tA(e);let r=t.outputLen;if(e.length<r)throw Error("digestInto() expects output buffer of length at least "+r)}function tT(e){return new DataView(e.buffer,e.byteOffset,e.byteLength)}function tP(e,t){return e<<32-t|e>>>t}function tM(e){if("string"!=typeof e)throw Error("utf8ToBytes expected string, got "+typeof e);return new Uint8Array(new TextEncoder().encode(e))}function tN(e){return"string"==typeof e&&(e=tM(e)),tA(e),e}class tk{clone(){return this._cloneInto()}}function tC(e){let t=t=>e().update(tN(t)).digest(),r=e();return t.outputLen=r.outputLen,t.blockLen=r.blockLen,t.create=()=>e(),t}function tD(e,t,r,n){if("function"==typeof e.setBigUint64)return e.setBigUint64(t,r,n);let i=BigInt(32),o=BigInt(0xffffffff),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)}function tj(e,t,r){return e&t^~e&r}function tR(e,t,r){return e&t^e&r^t&r}class tL extends tk{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=tT(this.buffer)}update(e){tI(this);let{view:t,buffer:r,blockLen:n}=this,i=(e=tN(e)).length;for(let o=0;o<i;){let s=Math.min(n-this.pos,i-o);if(s===n){let t=tT(e);for(;n<=i-o;o+=n)this.process(t,o);continue}r.set(e.subarray(o,o+s),this.pos),this.pos+=s,o+=s,this.pos===n&&(this.process(t,0),this.pos=0)}return this.length+=e.length,this.roundClean(),this}digestInto(e){tI(this),tO(e,this),this.finished=!0;let{buffer:t,view:r,blockLen:n,isLE:i}=this,{pos:o}=this;t[o++]=128,this.buffer.subarray(o).fill(0),this.padOffset>n-o&&(this.process(r,0),o=0);for(let e=o;e<n;e++)t[e]=0;tD(r,n-8,BigInt(8*this.length),i),this.process(r,0);let s=tT(e),a=this.outputLen;if(a%4)throw Error("_sha2: outputLen should be aligned to 32bit");let c=a/4,u=this.get();if(c>u.length)throw Error("_sha2: outputLen bigger than state");for(let e=0;e<c;e++)s.setUint32(4*e,u[e],i)}digest(){let{buffer:e,outputLen:t}=this;this.digestInto(e);let r=e.slice(0,t);return this.destroy(),r}_cloneInto(e){e||(e=new this.constructor),e.set(...this.get());let{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}}let tB=new Uint32Array([0x428a2f98,0x71374491,0xb5c0fbcf,0xe9b5dba5,0x3956c25b,0x59f111f1,0x923f82a4,0xab1c5ed5,0xd807aa98,0x12835b01,0x243185be,0x550c7dc3,0x72be5d74,0x80deb1fe,0x9bdc06a7,0xc19bf174,0xe49b69c1,0xefbe4786,0xfc19dc6,0x240ca1cc,0x2de92c6f,0x4a7484aa,0x5cb0a9dc,0x76f988da,0x983e5152,0xa831c66d,0xb00327c8,0xbf597fc7,0xc6e00bf3,0xd5a79147,0x6ca6351,0x14292967,0x27b70a85,0x2e1b2138,0x4d2c6dfc,0x53380d13,0x650a7354,0x766a0abb,0x81c2c92e,0x92722c85,0xa2bfe8a1,0xa81a664b,0xc24b8b70,0xc
4176c51a3,0xd192e819,0xd6990624,0xf40e3585,0x106aa070,0x19a4c116,0x1e376c08,0x2748774c,0x34b0bcb5,0x391c0cb3,0x4ed8aa4a,0x5b9cca4f,0x682e6ff3,0x748f82ee,0x78a5636f,0x84c87814,0x8cc70208,0x90befffa,0xa4506ceb,0xbef9a3f7,0xc67178f2]),tU=new Uint32Array([0x6a09e667,0xbb67ae85,0x3c6ef372,0xa54ff53a,0x510e527f,0x9b05688c,0x1f83d9ab,0x5be0cd19]),t$=new Uint32Array(64);class tK extends tL{constructor(){super(64,32,8,!1),this.A=0|tU[0],this.B=0|tU[1],this.C=0|tU[2],this.D=0|tU[3],this.E=0|tU[4],this.F=0|tU[5],this.G=0|tU[6],this.H=0|tU[7]}get(){let{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 r=0;r<16;r++,t+=4)t$[r]=e.getUint32(t,!1);for(let e=16;e<64;e++){let t=t$[e-15],r=t$[e-2],n=tP(t,7)^tP(t,18)^t>>>3,i=tP(r,17)^tP(r,19)^r>>>10;t$[e]=i+t$[e-7]+n+t$[e-16]|0}let{A:r,B:n,C:i,D:o,E:s,F:a,G:c,H:u}=this;for(let e=0;e<64;e++){let t=u+(tP(s,6)^tP(s,11)^tP(s,25))+tj(s,a,c)+tB[e]+t$[e]|0,l=(tP(r,2)^tP(r,13)^tP(r,22))+tR(r,n,i)|0;u=c,c=a,a=s,s=o+t|0,o=i,i=n,n=r,r=t+l|0}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(){t$.fill(0)}destroy(){this.set(0,0,0,0,0,0,0,0),this.buffer.fill(0)}}let tF=tC(()=>new tK),tz={struct:{message:"string",nonce:{array:{type:"u8",len:32}},recipient:"string",callbackUrl:{option:"string"}}};class tq{}function tV(e){switch(e){case es.ED25519:return"ed25519Signature";case es.SECP256K1:return"secp256k1Signature";default:throw Error(`unknown type ${e}`)}}class tH extends ey{enum;ed25519Signature;secp256k1Signature;constructor(e){let t=tV(e.keyType);super({[t]:e}),this[t]=e,this.enum=t}get signature(){return this.ed25519Signature||this.secp256k1Signature}get signatureType(){return this.signature.keyType}get data(){return this.signature.data}}class tG extends tq{key;constructor(e){super(),this.key=e}static fromSecretKey(e){return new tG(tS.fromString(e))}async getPublicKey(){return this.key.getPublicKey()}async signNep413Message(e,t,r,n,i){if(32!==n.length)throw Error("Nonce must be exactly 32 bytes long");let o=this.key.getPublicKey(),s=e2("u32",0x8000019d),a=e2(tz,{message:e,recipient:r,nonce:n,callbackUrl:i}),c=new Uint8Array(s.length+a.length);c.set(s),c.set(a,s.length);let u=new Uint8Array(tF(c)),{signature:l}=this.key.sign(u);return{accountId:t,publicKey:o,signature:l}}async signTransaction(e){let t=this.key.getPublicKey();if(e.publicKey.toString()!==t.toString())throw Error("The public key doesn't match the signer's key");let r=new Uint8Array(tF(te(e))),{signature:n}=this.key.sign(r);return[r,new ti({transaction:e,signature:new tH({keyType:e.publicKey.ed25519Key?es.ED25519:es.SECP256K1,data:n})})]}async signDelegateAction(e){let t=this.key.getPublicKey();if(e.publicKey.toString()!==t.toString())throw Error("The public key doesn't match the signer's key");let r=new Uint8Array(tF(e7(e))),{signature:n}=this.key.sign(r);return[r,new ek({delegateAction:e,signature:new tH({keyType:t.keyType,data:n})})]}}var tW=r(67918);let tJ=1.5,tZ=10,tY=0;function tX(e=tZ,t=tJ,r=tY){return{numOfAttempts:e,timeMultiple:t,startingDelay:r,retry:e=>!!([503,500,408].includes(e.cause)||e.toString().includes("FetchError")||e.toString().includes("Failed to fetch"))}}class tQ extends Error{cause;constructor(e,t){super(e,t),t.cause&&(this.cause=t.cause)}}async function t0(e,t,r,n){let i=await (0,tW.backOff)(async()=>{let n=await fetch(e,{method:"POST",body:JSON.stringify(t),headers:{...r,"Content-Type":"application/json"}}),{ok:i,status:o}=n;if(500===o)throw new tQ("Internal server error",{cause:o});if(408===o)throw new tQ("Timeout error",{cause:o});if(400===o)throw new tQ("Request validation error",{cause:o});if(503===o)throw new tQ(`${e} unavailable`,{cause:o});if(!i)throw new tQ(await n.text(),{cause:o});return n},n);if(!i)throw new E(`Exceeded ${tZ} attempts for ${e}.`,"RetriesExceeded");return await i.json()}var t1=r(75927).Buffer;let t2=12,t5=500,t3=1.5,t8=123;class t6{connection;options;networkId;constructor(e,t){this.connection=e||{url:""};let r={retries:t2,wait:t5,backoff:t3};this.options=Object.assign({},r,t),this.networkId=void 0}async getNetworkId(){if(this.networkId)return this.networkId;let{chain_id:e}=await this.viewNodeStatus();return this.networkId=e,this.networkId}async getCurrentEpochSeatPrice(){let{minimum_stake_ratio:e,protocol_version:t}=await this.experimental_protocolConfig({finality:"final"}),{current_validators:r}=await this.viewValidators();return et(r,300,e,t)}async getNextEpochSeatPrice(){let{minimum_stake_ratio:e,protocol_version:t}=await this.experimental_protocolConfig({finality:"final"}),{next_validators:r}=await this.viewValidators();return et(r,300,e,t)}async viewAccessKey(e,t,r={finality:"final"}){let n=await this.query({...r,request_type:"view_access_key",account_id:e,public_key:t.toString()});return{...n,nonce:BigInt(n.nonce)}}async viewAccessKeyList(e,t={finality:"final"}){return this.query({...t,request_type:"view_access_key_list",account_id:e})}async viewAccount(e,t={finality:"final"}){let r=await this.query({...t,request_type:"view_account",account_id:e});return{...r,amount:BigInt(r.amount),locked:BigInt(r.locked)}}async viewContractCode(e,t={finality:"final"}){let r=await this.query({...t,request_type:"view_code",account_id:e});return{...r,code:new Uint8Array(t1.from(r.code_base64,"base64"))}}async viewContractState(e,t,r={finality:"final"}){let n=t1.from(t||"").toString("base64");return this.query({...r,request_type:"view_state",account_id:e,prefix_base64:n})}async callFunction(e,t,r,n={finality:"final"}){let{result:i}=await this.callFunctionRaw(e,t,r,n);if(0===i.length)return;let o=t1.from(i).toString();try{return JSON.parse(o)}catch{return o}}async callFunctionRaw(e,t,r,n={finality:"final"}){let i=t1.from(JSON.stringify(r)).toString("base64");return await this.query({...n,request_type:"call_function",account_id:e,method_name:t,args_base64:i})}async viewBlock(e){let{finality:t}=e,{blockId:r}=e;return this.sendJsonRpc("block",{block_id:r,finality:t})}async viewChunk(e){return this.sendJsonRpc("chunk",[e])}async viewGasPrice(e){return this.sendJsonRpc("gas_price",[e||null])}async viewNodeStatus(){return this.sendJsonRpc("status",[])}async viewValidators(e){return this.sendJsonRpc("validators",[e||null])}async viewTransactionStatus(e,t,r){let n="string"==typeof e?e:R(e);return this.sendJsonRpc("tx",{tx_hash:n,sender_account_id:t,wait_until:r})}async viewTransactionStatusWithReceipts(e,t,r){let n="string"==typeof e?e:R(e);return this.sendJsonRpc("EXPERIMENTAL_tx_status",{tx_hash:n,sender_account_id:t,wait_until:r})}async viewTransactionReceipt(e){return this.sendJsonRpc("EXPERIMENTAL_receipt",{receipt_id:e})}async status(){return this.sendJsonRpc("status",[])}async sendTransactionUntil(e,t){let r=te(e);return this.sendJsonRpc("send_tx",{signed_tx_base64:t1.from(r).toString("base64"),wait_until:t})}async sendTransaction(e){return this.sendTransactionUntil(e,"EXECUTED_OPTIMISTIC")}async sendTransactionAsync(e){return this.sendTransactionUntil(e,"NONE")}async txStatus(e,t,r="EXECUTED_OPTIMISTIC"){return"string"==typeof e?this.txStatusString(e,t,r):this.txStatusUint8Array(e,t,r)}async txStatusUint8Array(e,t,r){return this.sendJsonRpc("tx",{tx_hash:R(e),sender_account_id:t,wait_until:r})}async txStatusString(e,t,r){return this.sendJsonRpc("tx",{tx_hash:e,sender_account_id:t,wait_until:r})}async txStatusReceipts(e,t,r="EXECUTED_OPTIMISTIC"){return"string"==typeof e?this.sendJsonRpc("EXPERIMENTAL_tx_status",{tx_hash:e,sender_account_id:t,wait_until:r}):this.sendJsonRpc("EXPERIMENTAL_tx_status",{tx_hash:R(e),sender_account_id:t,wait_until:r})}async query(...e){let t;if(1===e.length){let{block_id:r,blockId:n,...i}=e[0];t=await this.sendJsonRpc("query",{...i,block_id:r||n})}else{let[r,n]=e;t=await this.sendJsonRpc("query",[r,n])}if(t&&t.error)throw new E(`Querying failed: ${t.error}. 42${JSON.stringify(t,null,2)}`,H(t.error,t.error.name));return t}async block(e){let{finality:t}=e,{blockId:r}=e;return this.sendJsonRpc("block",{block_id:r,finality:t})}async blockChanges(e){let{finality:t}=e,{blockId:r}=e;return this.sendJsonRpc("EXPERIMENTAL_changes_in_block",{block_id:r,finality:t})}async chunk(e){return this.sendJsonRpc("chunk",[e])}async validators(e){return this.sendJsonRpc("validators",[e])}async experimental_protocolConfig(e){let{blockId:t,...r}=e;return await this.sendJsonRpc("EXPERIMENTAL_protocol_config",{...r,block_id:t})}async lightClientProof(e){return await this.sendJsonRpc("EXPERIMENTAL_light_client_proof",e)}
42async nextLightClientBlock(e){return await this.sendJsonRpc("next_light_client_block",e)}async accessKeyChanges(e,t){let{finality:r}=t,{blockId:n}=t;return this.sendJsonRpc("EXPERIMENTAL_changes",{changes_type:"all_access_key_changes",account_ids:e,block_id:n,finality:r})}async singleAccessKeyChanges(e,t){let{finality:r}=t,{blockId:n}=t;return this.sendJsonRpc("EXPERIMENTAL_changes",{changes_type:"single_access_key_changes",keys:e,block_id:n,finality:r})}async accountChanges(e,t){let{finality:r}=t,{blockId:n}=t;return this.sendJsonRpc("EXPERIMENTAL_changes",{changes_type:"account_changes",account_ids:e,block_id:n,finality:r})}async contractStateChanges(e,t,r=""){let{finality:n}=t,{blockId:i}=t;return this.sendJsonRpc("EXPERIMENTAL_changes",{changes_type:"data_changes",account_ids:e,key_prefix_base64:r,block_id:i,finality:n})}async contractCodeChanges(e,t){let{finality:r}=t,{blockId:n}=t;return this.sendJsonRpc("EXPERIMENTAL_changes",{changes_type:"contract_code_changes",account_ids:e,block_id:n,finality:r})}async gasPrice(e){return await this.sendJsonRpc("gas_price",[e])}async sendJsonRpc(e,t){let r={method:e,params:t,id:t8++,jsonrpc:"2.0"},n=await t0(this.connection.url,r,this.connection.headers||{},tX(this.options.retries,this.options.backoff,this.options.wait));if(n.error){if("object"==typeof n.error.data){if("string"==typeof n.error.data.error_message&&"string"==typeof n.error.data.error_type)throw new E(n.error.data.error_message,n.error.data.error_type);throw F(n.error.data)}{let e=`[${n.error.code}] ${n.error.message}: ${n.error.data}`,r=H(n.error.data,"");if(r)throw new E(q(r,t),r);throw new E(e,n.error.name)}}if("string"==typeof n.result?.error){let e=H(n.result.error,"");if(e)throw new $(q(e,t),e)}let{result:i}=n;if(void 0===i)throw new E(`Exceeded ${this.options.retries} attempts for request to ${e}.`,"RetriesExceeded");return i}}class t4{providers;currentProviderIndex;constructor(e){if(0===e.length)throw Error("At least one provider must be specified");this.providers=e,this.currentProviderIndex=0}switchToNextProvider(){1!==this.providers.length&&(this.providers.length-1<=this.currentProviderIndex?this.currentProviderIndex=0:this.currentProviderIndex+=1,Z.debug(`Switched to provider at the index ${this.currentProviderIndex}`))}get currentProvider(){let e=this.providers[this.currentProviderIndex];if(!e)throw Error(`Provider wasn't found at index ${this.currentProviderIndex}`);return e}async withBackoff(e){for(let t=0;t<this.providers.length;t++)try{let t=await e(this.currentProvider);if(t)return t}catch(e){console.error(e),this.switchToNextProvider()}throw new E(`Exceeded ${this.providers.length} providers to execute request`,"RetriesExceeded")}async status(){return this.withBackoff(e=>e.status())}async getNetworkId(){return this.withBackoff(e=>e.getNetworkId())}async getCurrentEpochSeatPrice(){return this.withBackoff(e=>e.getCurrentEpochSeatPrice())}async getNextEpochSeatPrice(){return this.withBackoff(e=>e.getNextEpochSeatPrice())}async viewAccessKey(e,t,r){return this.withBackoff(n=>n.viewAccessKey(e,t,r))}async viewAccessKeyList(e,t){return this.withBackoff(r=>r.viewAccessKeyList(e,t))}async viewAccount(e,t){return this.withBackoff(r=>r.viewAccount(e,t))}async viewContractCode(e,t){return this.withBackoff(r=>r.viewContractCode(e,t))}async viewContractState(e,t,r){return this.withBackoff(n=>n.viewContractState(e,t,r))}async callFunction(e,t,r,n){return this.withBackoff(i=>i.callFunction(e,t,r,n))}async callFunctionRaw(e,t,r,n){return this.withBackoff(i=>i.callFunctionRaw(e,t,r,n))}async viewBlock(e){return this.withBackoff(t=>t.viewBlock(e))}async viewChunk(e){return this.withBackoff(t=>t.viewChunk(e))}async viewGasPrice(e){return this.withBackoff(t=>t.viewGasPrice(e))}async viewNodeStatus(){return this.withBackoff(e=>e.viewNodeStatus())}async viewValidators(e){return this.withBackoff(t=>t.viewValidators(e))}async viewTransactionStatus(e,t,r){return this.withBackoff(n=>n.viewTransactionStatus(e,t,r))}async viewTransactionStatusWithReceipts(e,t,r){return this.withBackoff(n=>n.viewTransactionStatusWithReceipts(e,t,r))}async viewTransactionReceipt(e){return this.withBackoff(t=>t.viewTransactionReceipt(e))}async sendTransactionUntil(e,t){return this.withBackoff(r=>r.sendTransactionUntil(e,t))}async sendTransaction(e){return this.withBackoff(t=>t.sendTransaction(e))}async sendTransactionAsync(e){return this.withBackoff(t=>t.sendTransactionAsync(e))}async txStatus(e,t,r){return this.withBackoff(n=>n.txStatus(e,t,r))}async txStatusReceipts(e,t,r){return this.withBackoff(n=>n.txStatusReceipts(e,t,r))}async query(e,t){return t?this.withBackoff(r=>r.query(e,t)):this.withBackoff(t=>t.query(e))}async block(e){return this.withBackoff(t=>t.block(e))}async blockChanges(e){return this.withBackoff(t=>t.blockChanges(e))}async chunk(e){return this.withBackoff(t=>t.chunk(e))}async validators(e){return this.withBackoff(t=>t.validators(e))}async experimental_protocolConfig(e){return this.withBackoff(t=>t.experimental_protocolConfig(e))}async lightClientProof(e){return this.withBackoff(t=>t.lightClientProof(e))}async nextLightClientBlock(e){return this.withBackoff(t=>
42t.nextLightClientBlock(e))}async accessKeyChanges(e,t){return this.withBackoff(r=>r.accessKeyChanges(e,t))}async singleAccessKeyChanges(e,t){return this.withBackoff(r=>r.singleAccessKeyChanges(e,t))}async accountChanges(e,t){return this.withBackoff(r=>r.accountChanges(e,t))}async contractStateChanges(e,t,r=""){return this.withBackoff(n=>n.contractStateChanges(e,t,r))}async contractCodeChanges(e,t){return this.withBackoff(r=>r.contractCodeChanges(e,t))}async gasPrice(e){return this.withBackoff(t=>t.gasPrice(e))}}function t9(e){switch(e.type){case void 0:return e;case"JsonRpcProvider":return new t6({...e.args});case"FailoverRpcProvider":return new t4((e?.args||[]).map(e=>new t6(e)));default:throw Error(`Unknown provider type ${e.type}`)}}function t7(e){switch(e.type){case void 0:return e;case"KeyPairSigner":return new tG(e.keyPair);default:throw Error(`Unknown signer type ${e.type}`)}}class re{networkId;provider;signer;constructor(e,t,r){I("new Connection(networkId, provider, signer)")("`Connection` is no longer used anywhere, please switch to constructing `Account` without it - use `new Account(accountId, provider, signer)`"),this.networkId=e,this.provider=t,this.signer=r}getConnection(){return this}static fromConfig(e){let t=t9(e.provider),r=t7(e.signer);return new re(e.networkId,t,r)}}var rt=r(75927).Buffer;function rr(e){return JSON.parse(rt.from(e).toString())}function rn(e){return rt.from(JSON.stringify(e))}function ri(e){if((void 0===e.byteLength||e.byteLength!==e.length)&&(Array.isArray(e)||"object"!=typeof e))throw new _}async function ro(e,t,r,n={finality:"optimistic"}){let{values:i}=await e.provider.query({request_type:"view_state",...n,account_id:t,prefix_base64:rt.from(r).toString("base64")});return i.map(({key:e,value:t})=>({key:rt.from(e,"base64"),value:rt.from(t,"base64")}))}async function rs(e,{contractId:t,methodName:r,args:n={},parse:i=rr,stringify:o=rn,blockQuery:s={finality:"optimistic"}}){ri(n);let a=o(n),c=await e.provider.query({request_type:"call_function",...s,account_id:t,method_name:r,args_base64:a.toString("base64")});return c.logs&&X({contractId:t,logs:c.logs}),c.result&&c.result.length>0&&i(rt.from(c.result))}let ra=24;function rc(e,t){let r=(e=rh(e)).substring(0,e.length-t)||"0",n=e.substring(e.length-t).substring(0,t).padStart(t,"0");return rd(`${r}.${n}`)}function ru(e,t){let r=(e=rl(e)).split(".");if(r.length>2)throw Error(`Cannot parse amount '${e}' as it contains more than a single dot`);let n=r[0],i=r[1]||"";if(i.length>ra)throw Error(`Cannot parse amount '${e}' as it exceeds maximum decimal precision of ${ra}`);return rf(n+i.substring(0,t).padEnd(t,"0"))}function rl(e){return e.replace(/,/g,".").trim()}function rd(e){return e.replace(/\.?0*$/,"")}function rf(e){return""===(e=e.replace(/^0+/,""))?"0":e}function rh(e){return BigInt(e).toString()}class rp{metadata;constructor(e){this.metadata=e}toUnits(e){return BigInt(ru(e.toString(),this.metadata.decimals))}toDecimal(e){return rc(e,this.metadata.decimals)}}class ry extends rp{constructor(e){super(e)}async transfer({from:e,receiverId:t,amount:r}){return e.signAndSendTransaction({receiverId:t,actions:[{transfer:{deposit:r.toString()}}]})}async getBalance(e){let{balance:{available:t}}=await e.getState();return t}}let rg=new ry({name:"NEAR",decimals:24,symbol:"NEAR",icon:"data:image/svg+xml,%3Csvg%20width%3D%2232%22%20height%3D%2232%22%20viewBox%3D%220%200%2032%2032%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Ccircle%20cx%3D%2216%22%20cy%3D%2216%22%20r%3D%2216%22%20fill%3D%22white%22%3E%3C%2Fcircle%3E%3Cg%20clip-path%3D%22url(%23clip0000000003)%22%3E%3Cpath%20d%3D%22M20.8422%208.84471L17.4978%2013.776C17.4501%2013.847%2017.43%2013.9328%2017.4411%2014.0174C17.4522%2014.102%2017.4938%2014.1798%2017.5582%2014.2363C17.6225%2014.2928%2017.7053%2014.3243%2017.7913%2014.3249C17.8772%2014.3254%2017.9604%2014.2951%2018.0256%2014.2395L21.3178%2011.4036C21.3371%2011.3865%2021.361%2011.3753%2021.3866%2011.3714C21.4122%2011.3675%2021.4383%2011.3711%2021.4619%2011.3818C21.4855%2011.3924%2021.5054%2011.4096%2021.5193%2011.4314C21.5331%2011.4531%2021.5403%2011.4783%2021.54%2011.504V20.3824C21.54%2020.4095%2021.5316%2020.4361%2021.5158%2020.4583C21.5001%2020.4806%2021.4779%2020.4975%202
421.4522%2020.5068C21.4265%2020.516%2021.3985%2020.5172%2021.3721%2020.5102C21.3456%2020.5031%2021.322%2020.4882%2021.3044%2020.4673L11.3533%208.63726C11.1933%208.44956%2010.994%208.29873%2010.7693%208.19525C10.5446%208.09178%2010.2999%208.03815%2010.0522%208.03809H9.70444C9.2524%208.03809%208.81887%208.21642%208.49922%208.53386C8.17957%208.8513%208%209.28185%208%209.73078V22.2351C8%2022.684%208.17957%2023.1145%208.49922%2023.432C8.81887%2023.7494%209.2524%2023.9277%209.70444%2023.9277V23.9277C9.99591%2023.9278%2010.2825%2023.8537%2010.537%2023.7125C10.7914%2023.5713%2011.0051%2023.3677%2011.1578%2023.1211L14.5022%2018.1898C14.5499%2018.1188%2014.57%2018.033%2014.5589%2017.9484C14.5478%2017.8638%2014.5062%2017.7861%2014.4418%2017.7295C14.3775%2017.673%2014.2947%2017.6415%2014.2087%2017.641C14.1228%2017.6404%2014.0396%2017.6707%2013.9744%2017.7264L10.6822%2020.5622C10.6629%2020.5794%2010.639%2020.5906%2010.6134%2020.5944C10.5878%2020.5983%2010.5617%2020.5947%2010.5381%2020.5841C10.5145%2020.5734%2010.4946%2020.5562%2010.4807%2020.5345C10.4669%2020.5128%2010.4597%2020.4875%2010.46%2020.4618V11.5813C10.46%2011.5541%2010.4684%2011.5276%2010.4842%2011.5053C10.4999%2011.483%2010.5221%2011.4661%2010.5478%2011.4568C10.5735%2011.4476%2010.6015%2011.4464%2010.6279%2011.4534C10.6544%2011.4605%2010.678%2011.4755%2010.6956%2011.4963L20.6456%2023.3286C20.8056%2023.5163%2021.0049%2023.6671%2021.2296%2023.7706C21.4543%2023.874%2021.699%2023.9277%2021.9467%2023.9277H22.2944C22.5184%2023.9279%2022.7401%2023.8842%2022.947%2023.7992C23.154%2023.7142%2023.342%2023.5895%2023.5004%2023.4324C23.6588%2023.2752%2023.7844%2023.0885%2023.8702%2022.8831C23.9559%2022.6776%2024%2022.4574%2024%2022.2351V9.73078C24%209.28185%2023.8204%208.8513%2023.5008%208.53386C23.1811%208.21642%2022.7476%208.03809%2022.2956%208.03809C22.0041%208.03801%2021.7175%208.11211%2021.4631%208.25332C21.2086%208.39453%2020.9949%208.59814%2020.8422%208.84471V8.84471Z%22%20fill%3D%22black%22%3E%3C%2Fpath%3E%3C%2Fg%3E%3Cdefs%3E%3CclipPath%20id%3D%22clip00033%22%3E%3Crect%20width%3D%2216%22%20height%3D%2216%22%20fill%3D%22black%22%20transform%3D%22translate(8%207.9834)%22%3E%3C%2Frect%3E%3C%2FclipPath%3E%3C%2Fdefs%3E%3C%2Fsvg%3E"});var rm=r(2818),rb=r(75927).Buffer;let{addKey:rv,createAccount:rw,deleteAccount:r_,deleteKey:rE,deployContract:rS,deployGlobalContract:rx,fullAccessKey:rA,functionCall:rI,functionCallAccessKey:rO,transfer:rT,useGlobalContract:rP}=eR,rM=rm.env.DEFAULT_FINALITY||"near-final",rN="EXECUTED_OPTIMISTIC";class rk{accountId;provider;signer;constructor(e,t,r){this.accountId=e,this.provider=t,this.signer=r}setSigner(e){this.signer=e}getSigner(){return this.signer}async getState(){let e=await this.provider.experimental_protocolConfig({finality:rM}),t=await this.provider.viewAccount(this.accountId,{finality:rM}),r=BigInt(e.runtime_config.storage_amount_per_byte),n=BigInt(t.storage_usage)*r,i=BigInt(t.locked),o=BigInt(t.amount)+i,s=o-(i>n?i:n);return{balance:{total:o,usedOnStorage:n,locked:i,available:s},storageUsage:t.storage_usage,codeHash:t.code_hash}}async getAccessKey(e){return this.provider.viewAccessKey(this.accountId,e,{finality:rM})}async getAccessKeyList(){return this.provider.viewAccessKeyList(this.accountId,{finality:rM})}async getContractCode(){return this.provider.viewContractCode(this.accountId,{finality:rM})}async getContractState(e){return this.provider.viewContractState(this.accountId,e,{finality:rM})}async createTransaction(e,t,r){if(!r)throw Error("Please provide a public key");let n=ef.from(r),i=await this.getAccessKey(n),o=(await this.provider.viewBlock({finality:rM})).header.hash,s=BigInt(i.nonce)+1n;return ts(this.accountId,n,e,s+1n,t,L(o))}async createSignedTransaction(e,t){if(!this.signer)throw Error("Please set a signer");let r=await this.createTransaction(e,t,await this.signer.getPublicKey()),[,n]=await this.signer.signTransaction(r);return n}async createMetaTransaction(e,t,r=200,n){if(!n)throw Error("Please provide a public key");let i=ef.from(n),o=BigInt((await this.getAccessKey(i)).nonce)+1n,{header:s}=await this.provider.viewBlock({finality:rM}),a=BigInt(s.height)+BigInt(r);return tb({receiverId:e,senderId:this.accountId,actions:t,publicKey:i,nonce:o,maxBlockHeight:a})}async createSignedMetaTransaction(e,t,r=200){if(!this.signer)throw Error("Please set a signer");let n=await this.createMetaTransaction(e,t,r,await this.signer.getPublicKey());return this.signer.signDelegateAction(n)}async signAndSendTransaction({receiverId:e,actions:t,waitUntil:r=rN,throwOnFailure:n=!0}){let i=await this.createSignedTransaction(e,t),o=await this.provider.sendTransactionUntil(i,r);if(n&&"object"==typeof o.status&&"object"==typeof o.status.Failure&&null!==o.status.Failure)throw z(o);return o}async signAndSendTransactions({transactions:e,waitUntil:t=rN,throwOnFailure:r=!0}){if(!this.signer)throw Error("Please set a signer");return await Promise.all(e.map(async({receiverId:e,actions:n})=>this.signAndSendTransaction({receiverId:e,actions:n,waitUntil:t,throwOnFailure:r})))}async createAccount(e,t,r="0"){if(e.endsWith(this.accountId))return this.createSubAccount(e,t,r);let n=e.split(".");if(2!=n.length)throw Error("newAccountId needs to be of the form <string>.<tla>");let i=n[1];return this.signAndSendTransaction({receiverId:i,actions:[rI("create_account",{new_account_id:e,new_public_key:t.toString()},BigInt("60000000000000"),BigInt(r))]})}async createSubAccount(e,t,r="0"){if(!this.signer)throw Error("Please set a signer");let n=e.includes(".")?e:`${e}.${this.accountId}`;if(n.length>64)throw Error("Accounts cannot exceed 64 characters");if(!n.endsWith(this.accountId))throw Error(`New account must end up with ${this.accountId}`);let i=[rw(),rT(BigInt(r)),rv(ef.from(t),rA())];return this.signAndSendTransaction({receiverId:n,actions:i})}async deleteAccount(e){return this.signAndSendTransaction({receiverId:this.accountId,actions:[r_(e)]})}async deployContract(e){return this.signAndSendTransaction({receiverId:this.accountId,actions:[rS(e)]})}async deployGlobalContract(e,t){let r=new eS("codeHash"===t?{CodeHash:null}:{AccountId:null});return this.signAndSendTransaction({receiverId:this.accountId,actions:[rx(e,r)]})}async useGlobalContract(e){let t=new ex("accountId"in e?{AccountId:e.accountId}:{CodeHash:"string"==typeof e.codeHash?rb.from(e.codeHash,"hex"):e.codeHash});return this.signAndSendTransaction({receiverId:this.accountId,actions:[rP(t)]})}async addFunctionCallAccessKey({publicKey:e,contractId:t,methodNames:r=[],allowance:n=rg.toUnits("0.25")}){return this.signAndSendTransaction({receiverId:this.accountId,actions:[rv(ef.from(e),rO(t,r,BigInt(n)))]})}async addFullAccessKey(e){return this.signAndSendTransaction({receiverId:this.accountId,actions:[rv(ef.from(e),rA())]})}async deleteKey(e){return this.signAndSendTransaction({receiverId:this.accountId,actions:[rE(ef.from(e))]})}async callFunction(e){return Q(await this.callFunctionRaw(e))}async callFunctionRaw({contractId:e,methodName:t,args:r={},deposit:n="0",gas:i=T,waitUntil:o=rN}){return await this.signAndSendTransaction({receiverId:e,actions:[rI(t,r,BigInt(i),BigInt(n))],waitUntil:o})}async signNep413Message({message:e,recipient:t,nonce:r,callbackUrl:n}){if(!this.signer)throw Error("Please set a signer");return this.signer.signNep413Message(e,this.accountId,t,r,n)}async getBalance(e=rg){return e.getBalance(this)}async transfer({receiverId:e,amount:t,token:r=rg}){return r.transfer({from:this,receiverId:e,amount:t})}async signedDelegate({actions:e,blockHeightTtl:t,receiverId:r}){let{header:n}=await this.provider.viewBlock({finality:rM});if(!this.signer)throw Error("Please set a signer");let i=await this.signer.getPublicKey(),o=await this.getAccessKey(i),s=tb({actions:e,max
42BlockHeight:BigInt(n.height)+BigInt(t),nonce:BigInt(o.nonce)+1n,publicKey:i,receiverId:r,senderId:this.accountId}),[,a]=await this.signer.signDelegateAction(s);return a}getConnection(){return new re("",this.provider,this.signer)}validateArgs(e){if((void 0===e.byteLength||e.byteLength!==e.length)&&(Array.isArray(e)||"object"!=typeof e))throw new _}async functionCall({contractId:e,methodName:t,args:r={},gas:n=T,attachedDeposit:i,walletMeta:o,walletCallbackUrl:s,stringify:a}){this.validateArgs(r);let c=[t,r,n,i,void 0===a?ej:a,!1];return this.signAndSendTransactionLegacy({receiverId:e,actions:[rI.apply(void 0,c)],walletMeta:o,walletCallbackUrl:s})}async getTransactionStatus(e){return this.provider.viewTransactionStatus(e,this.accountId,"EXECUTED_OPTIMISTIC")}async signTransaction(e,t,r){let n=r?.signer||this.signer;if(!n)throw Error("Please set a signer");let i=await n.getPublicKey(),o=await this.getAccessKey(i),s=(await this.provider.viewBlock({finality:rM})).header.hash,a=BigInt(o.nonce)+1n,c=ts(this.accountId,i,e,a+1n,t,L(s));return n.signTransaction(c)}async createAndDeployContract(e,t,r,n){let i=rA();return await this.signAndSendTransactionLegacy({receiverId:e,actions:[rw(),rT(n),rv(ef.from(t),i),rS(r)]}),new rk(e,this.provider)}async sendMoney(e,t){return this.signAndSendTransactionLegacy({receiverId:e,actions:[rT(t)]})}async signAndSendTransactionLegacy({receiverId:e,actions:t,returnError:r},n){let i,o;let s=12,a=500,c=1.5,u=await eh(a,s,c,async()=>{[i,o]=await this.signTransaction(e,t,n);try{return await this.provider.sendTransaction(o)}catch(t){if("InvalidNonce"===t.type)return Z.warn(`Retrying transaction ${e}:${R(i)} with new nonce.`),null;if("Expired"===t.type)return Z.warn(`Retrying transaction ${e}:${R(i)} due to expired block hash`),null;throw t.context=new S(R(i)),t}});if(!u)throw new E("nonce retries exceeded for transaction. This usually means there are too many parallel requests with the same access key.","RetriesExceeded");if(Y({contractId:o.transaction.receiverId,outcome:u}),!r&&"object"==typeof u.status&&"object"==typeof u.status.Failure&&null!==u.status.Failure){if(u.status.Failure.error_message&&u.status.Failure.error_type)throw new E(`Transaction ${u.transaction_outcome.id} failed. ${u.status.Failure.error_message}`,u.status.Failure.error_type);throw z(u)}return u}accessKeyByPublicKeyCache={};async findAccessKey(e,t){if(!this.signer)throw Error("Please set a signer");let r=await this.signer.getPublicKey();if(!r)throw new E(`no matching key pair found in ${this.signer.constructor.name}`,"PublicKeyNotFound");let n=this.accessKeyByPublicKeyCache[r.toString()];if(void 0!==n)return{publicKey:r,accessKey:n};try{let e=await this.provider.query({request_type:"view_access_key",account_id:this.accountId,public_key:r.toString(),finality:rM}),t={...e,nonce:BigInt(e.nonce||0)};if(this.accessKeyByPublicKeyCache[r.toString()])return{publicKey:r,accessKey:this.accessKeyByPublicKeyCache[r.toString()]};return this.accessKeyByPublicKeyCache[r.toString()]=t,{publicKey:r,accessKey:t}}catch(e){if("AccessKeyDoesNotExist"==e.type)return null;throw e}}async addKey(e,t,r,n){let i;return r||(r=[]),Array.isArray(r)||(r=[r]),i=t?rO(t,r,n):rA(),this.signAndSendTransactionLegacy({receiverId:this.accountId,actions:[rv(ef.from(e),i)]})}async viewFunction(e){return await rs(this.getConnection(),e)}async viewState(e,t={finality:rM}){return await ro(this.getConnection(),this.accountId,e,t)}async getAccessKeys(){let e=await this.provider.query({request_type:"view_access_key_list",account_id:this.accountId,finality:rM});return e?.keys?.map(e=>({...e,access_key:{...e.access_key,nonce:BigInt(e.access_key.nonce)}}))}async getAccountDetails(){return{authorizedApps:(await this.getAccessKeys()).filter(e=>"FullAccess"!==e.access_key.permission).map(e=>{let t=e.access_key.permission;return{contractId:t.FunctionCall.receiver_id,amount:t.FunctionCall.allowance,publicKey:e.public_key}})}}async state(){return this.provider.query({request_type:"view_account",account_id:this.accountId,finality:"optimistic"})}async getAccountBalance(){let e=await this.provider.experimental_protocolConfig({finality:rM}),t=await this.state(),r=BigInt(e.runtime_config.storage_amount_per_byte),n=BigInt(t.storage_usage)*r,i=BigInt(t.locked),o=BigInt(t.amount)+i,s=o-(i>n?i:n);return{total:o.toString(),stateStaked:n.toString(),staked:i.toString(),available:s.toString()}}async getActiveDelegatedStakeBalance(){let e=await this.provider.block({finality:rM}
42),t=e.header.hash,r=e.header.epoch_id,{current_validators:n,next_validators:i,current_proposals:o}=await this.provider.validators(r),s=new Set;[...n,...i,...o].forEach(e=>s.add(e.account_id));let a=[...s],c=a.map(e=>this.viewFunction({contractId:e,methodName:"get_account_total_balance",args:{account_id:this.accountId},blockQuery:{blockId:t}})),u=await Promise.allSettled(c);if(u.some(e=>"rejected"===e.status&&"TimeoutError"===e.reason.type))throw Error("Failed to get delegated stake balance");let l=u.reduce((e,t,r)=>{let n=a[r];if("fulfilled"===t.status){let r=BigInt(t.value);if(0n!==r)return{...e,stakedValidators:[...e.stakedValidators,{validatorId:n,amount:r.toString()}],total:e.total+r}}return"rejected"===t.status?{...e,failedValidators:[...e.failedValidators,{validatorId:n,error:t.reason}]}:e},{stakedValidators:[],failedValidators:[],total:0n});return{...l,total:l.total.toString()}}}class rC{}let rD="near-api-js:keystore:";class rj extends rC{localStorage;prefix;constructor(e=window.localStorage,t=rD){super(),this.localStorage=e,this.prefix=t}async setKey(e,t,r){this.localStorage.setItem(this.storageKeyForSecretKey(e,t),r.toString())}async getKey(e,t){let r=this.localStorage.getItem(this.storageKeyForSecretKey(e,t));return r?tS.fromString(r):null}async removeKey(e,t){this.localStorage.removeItem(this.storageKeyForSecretKey(e,t))}async clear(){for(let e of this.storageKeys())e.startsWith(this.prefix)&&this.localStorage.removeItem(e)}async getNetworks(){let e=new Set;for(let t of this.storageKeys())if(t.startsWith(this.prefix)){let r=t.substring(this.prefix.length).split(":");e.add(r[1])}return Array.from(e.values())}async getAccounts(e){let t=[];for(let r of this.storageKeys())if(r.startsWith(this.prefix)){let n=r.substring(this.prefix.length).split(":");n[1]===e&&t.push(n[0])}return t}storageKeyForSecretKey(e,t){return`${this.prefix}${t}:${e}`}*storageKeys(){for(let e=0;e<this.localStorage.length;e++)yield this.localStorage.key(e)}}var rR=r(40689);function rL(e,t,r){function n(r,n){if(r._zod||Object.defineProperty(r,"_zod",{value:{def:n,constr:s,traits:new Set},enumerable:!1}),r._zod.traits.has(e))return;r._zod.traits.add(e),t(r,n);let i=s.prototype,o=Object.keys(i);for(let e=0;e<o.length;e++){let t=o[e];t in r||(r[t]=i[t].bind(r))}}let i=r?.Parent??Object;class o extends i{}function s(e){var t;let i=r?.Parent?new o:this;for(let r of(n(i,e),(t=i._zod).deferred??(t.deferred=[]),i._zod.deferred))r();return i}return Object.defineProperty(o,"name",{value:e}),Object.defineProperty(s,"init",{value:n}),Object.defineProperty(s,Symbol.hasInstance,{value:t=>!!r?.Parent&&t instanceof r.Parent||t?._zod?.traits?.has(e)}),Object.defineProperty(s,"name",{value:e}),s}Object.freeze({status:"aborted"}),Symbol("zod_brand");class rB extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}}class rU extends Error{constructor(e){super(`Encountered unidirectional transform during encode: ${e}`),this.name="ZodEncodeError"}}let r$={};function rK(e){return e&&Object.assign(r$,e),r$}function rF(e){let t=Object.values(e).filter(e=>"number"==typeof e);return Object.entries(e).filter(([e,r])=>-1===t.indexOf(+e)).map(([e,t])=>t)}function rz(e,t="|"){return e.map(e=>nt(e)).join(t)}function rq(e,t){return"bigint"==typeof t?t.toString():t}function rV(e){let t=!1;return{get value(){if(!t){let t=e();return Object.defineProperty(this,"value",{value:t}),t}throw Error("cached value already set")}}}function rH(e){return null==e}function rG(e){let t=e.startsWith("^")?1:0,r=e.endsWith("$")?e.length-1:e.length;return e.slice(t,r)}function rW(e,t){let r=(e.toString().split(".")[1]||"").length,n=t.toString(),i=(n.split(".")[1]||"").length;if(0===i&&/\d?e-\d?/.test(n)){let e=n.match(/\d?e-(\d?)/);e?.[1]&&(i=Number.parseInt(e[1]))}let o=r>i?r:i;return Number.parseInt(e.toFixed(o).replace(".",""))%Number.parseInt(t.toFixed(o).replace(".",""))/10**o}let rJ=Symbol("evaluating");function rZ(e,t,r){let n;Object.defineProperty(e,t,{get(){if(n!==rJ)return void 0===n&&(n=rJ,n=r()),n},set(r){Object.defineProperty(e,t,{value:r})},configurable:!0})}function rY(e,t,r){Object.defineProperty(e,t,{value:r,writable:!0,enumerable:!0,configurable:!0})}function rX(...e){let t={};for(let r of e)Object.assign(t,Object.getOwnPropertyDescriptors(r));return Object.defineProperties({},t)}function rQ(e){return JSON.stringify(e)}function r0(e){return e.toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}let r1="captureStackTrace"in Error?Error.captureStackTrace:(...e)=>{};function r2(e){return"object"==typeof e&&null!==e&&!Array.isArray(e)}let r5=rV(()=>
42{if("undefined"!=typeof navigator&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{return Function(""),!0}catch(e){return!1}});function r3(e){if(!1===r2(e))return!1;let t=e.constructor;if(void 0===t||"function"!=typeof t)return!0;let r=t.prototype;return!1!==r2(r)&&!1!==Object.prototype.hasOwnProperty.call(r,"isPrototypeOf")}function r8(e){return r3(e)?{...e}:Array.isArray(e)?[...e]:e}let r6=new Set(["string","number","symbol"]),r4=new Set(["string","number","bigint","boolean","symbol","undefined"]);function r9(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function r7(e,t,r){let n=new e._zod.constr(t??e._zod.def);return(!t||r?.parent)&&(n._zod.parent=e),n}function ne(e){let t=e;if(!t)return{};if("string"==typeof t)return{error:()=>t};if(t?.message!==void 0){if(t?.error!==void 0)throw Error("Cannot specify both `message` and `error` params");t.error=t.message}return(delete t.message,"string"==typeof t.error)?{...t,error:()=>t.error}:t}function nt(e){return"bigint"==typeof e?e.toString()+"n":"string"==typeof e?`"${e}"`:`${e}`}function nr(e){return Object.keys(e).filter(t=>"optional"===e[t]._zod.optin&&"optional"===e[t]._zod.optout)}let nn={safeint:[Number.MIN_SAFE_INTEGER,Number.MAX_SAFE_INTEGER],int32:[-0x80000000,0x7fffffff],uint32:[0,0xffffffff],float32:[-34028234663852886e22,34028234663852886e22],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]},ni={int64:[BigInt("-9223372036854775808"),BigInt("9223372036854775807")],uint64:[BigInt(0),BigInt("18446744073709551615")]};function no(e,t){let r=e._zod.def,n=r.checks;if(n&&n.length>0)throw Error(".pick() cannot be used on object schemas containing refinements");let i=rX(e._zod.def,{get shape(){let e={};for(let n in t){if(!(n in r.shape))throw Error(`Unrecognized key: "${n}"`);t[n]&&(e[n]=r.shape[n])}return rY(this,"shape",e),e},checks:[]});return r7(e,i)}function ns(e,t){let r=e._zod.def,n=r.checks;if(n&&n.length>0)throw Error(".omit() cannot be used on object schemas containing refinements");let i=rX(e._zod.def,{get shape(){let n={...e._zod.def.shape};for(let e in t){if(!(e in r.shape))throw Error(`Unrecognized key: "${e}"`);t[e]&&delete n[e]}return rY(this,"shape",n),n},checks:[]});return r7(e,i)}function na(e,t){if(!r3(t))throw Error("Invalid input to extend: expected a plain object");let r=e._zod.def.checks;if(r&&r.length>0){let r=e._zod.def.shape;for(let e in t)if(void 0!==Object.getOwnPropertyDescriptor(r,e))throw Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}let n=rX(e._zod.def,{get shape(){let r={...e._zod.def.shape,...t};return rY(this,"shape",r),r}});return r7(e,n)}function nc(e,t){if(!r3(t))throw Error("Invalid input to safeExtend: expected a plain object");let r=rX(e._zod.def,{get shape(){let r={...e._zod.def.shape,...t};return rY(this,"shape",r),r}});return r7(e,r)}function nu(e,t){let r=rX(e._zod.def,{get shape(){let r={...e._zod.def.shape,...t._zod.def.shape};return rY(this,"shape",r),r},get catchall(){return t._zod.def.catchall},checks:[]});return r7(e,r)}function nl(e,t,r){let n=t._zod.def.checks;if(n&&n.length>0)throw Error(".partial() cannot be used on object schemas containing refinements");let i=rX(t._zod.def,{get shape(){let n=t._zod.def.shape,i={...n};if(r)for(let t in r){if(!(t in n))throw Error(`Unrecognized key: "${t}"`);r[t]&&(i[t]=e?new e({type:"optional",innerType:n[t]}):n[t])}else for(let t in n)i[t]=e?new e({type:"optional",innerType:n[t]}):n[t];return rY(this,"shape",i),i},checks:[]});return r7(t,i)}function nd(e,t,r){let n=rX(t._zod.def,{get shape(){let n=t._zod.def.shape,i={...n};if(r)for(let t in r){if(!(t in i))throw Error(`Unrecognized key: "${t}"`);r[t]&&(i[t]=new e({type:"nonoptional",innerType:n[t]}))}else for(let t in n)i[t]=new e({type:"nonoptional",innerType:n[t]});return rY(this,"shape",i),i}});return r7(t,n)}function nf(e,t=0){if(!0===e.aborted)return!0;for(let r=t;r<e.issues.length;r++)if(e.issues[r]?.continue!==!0)return!0;return!1}function nh(e,t){return t.map(t=>{var r;return(r=t).path??(r.path=[]),t.path.unshift(e),t})}function np(e){return"string"==typeof e?e:e?.message}function ny(e,t,r){let n={...e,path:e.path??[]};if(!e.message){let i=np(e.inst?._zod.def?.error?.(e))??np(t?.error?.(e))??np(r.customError?.(e))??np(r.localeError?.(e))??"Invalid input";n.message=i}return delete n.inst,delete n.continue,t?.reportInput||delete n.input,n}function ng(e){return e instanceof Set?"set":e instanceof Map?"map":e instanceof File?"file":"unknown"}function nm(e){return Array.isArray(e)?"array":"string"==typeof e?"string":"unknown"}function nb(e){let t=typeof e;switch(t){case"number":return Number.isNaN(e)?"nan":"number";case"object":{if(null===e)return"null";if(Array.isArray(e))return"array";let t=e;if(t&&Object.getPrototypeOf(t)!==Object.prototype&&"constructor"in t&&t.constructor)return t.constructor.name}}return t}function nv(...e){let[t,r,n]=e;return"string"==typeof t?{message:t,code:"custom",input:r,inst:n}:{...t}}let nw=(e,t)=>{e.name="$ZodError",Object.defineProperty(e,"_zod",{value:e._zod,enumerable:!1}),Object.defineProperty(e,"issues",{value:t,enumerable:!1}),e.message=JSON.stringify(t,rq,2),Object.defineProperty(e,"toString",{value:()=>e.message,enumerable:!1})},n_=rL("$ZodError",nw),nE=rL("$ZodError",nw,{Parent:Error});function nS(e,t=e=>e.message){let r={},n=[];for(let i of e.issues)i.path.length>0?(r[i.path[0]]=r[i.path[0]]||[],r[i.path[0]].push(t(i))):n.push(t(i));return{formErrors:n,fieldErrors:r}}function nx(e,t=e=>e.message){let r={_errors:[]},n=e=>{for(let i of e.issues)if("invalid_union"===i.code&&i.errors.length)i.errors.map(e=>n({issues:e}));else if("invalid_key"===i.code)n({issues:i.issues});else if("invalid_element"===i.code)n({issues:i.issues});else if(0===i.path.length)r._errors.push(t(i));else{let e=r,n=0;for(;n<i.path.length;){let r=i.path[n];n===i.path.length-1?(e[r]=e[r]||{_errors:[]},e[r]._errors.push(t(i))):e[r]=e[r]||{_errors:[]},e=e[r],n++}}};return n(e),r}let nA=e=>(t,r,n,i)=>{let o=n?Object.assign(n,{async:!1}):{async:!1},s=t._zod.run({value:r,issues:[]},o);if(s instanceof Promise)throw new rB;if(s.issues.length){let t=new(i?.Err??e)(s.issues.map(e=>ny(e,o,rK())));throw r1(t,i?.callee),t}return s.value},nI=nA(nE),nO=e=>async(t,r,n,i)=>{let o=n?Object.assign(n,{async:!0}):{async:!0},s=t._zod.run({value:r,issues:[]},o);if(s instanceof Promise&&(s=await s),s.issues.length){let t=new(i?.Err??e)(s.issues.map(e=>ny(e,o,rK())));throw r1(t,i?.callee),t}return s.value},nT=nO(nE),nP=e=>(t,r,n)=>{let i=n?{...n,async:!1}:{async:!1},o=t._zod.run({value:r,issues:[]},i);if(o instanceof Promise)throw new rB;return o.issues.length?{success:!1,error:new(e??n_)(o.issues.map(e=>ny(e,i,rK())))}:{success:!0,data:o.value}}
42,nM=nP(nE),nN=e=>async(t,r,n)=>{let i=n?Object.assign(n,{async:!0}):{async:!0},o=t._zod.run({value:r,issues:[]},i);return o instanceof Promise&&(o=await o),o.issues.length?{success:!1,error:new e(o.issues.map(e=>ny(e,i,rK())))}:{success:!0,data:o.value}},nk=nN(nE),nC=e=>(t,r,n)=>{let i=n?Object.assign(n,{direction:"backward"}):{direction:"backward"};return nA(e)(t,r,i)},nD=e=>(t,r,n)=>nA(e)(t,r,n),nj=e=>async(t,r,n)=>{let i=n?Object.assign(n,{direction:"backward"}):{direction:"backward"};return nO(e)(t,r,i)},nR=e=>async(t,r,n)=>nO(e)(t,r,n),nL=e=>(t,r,n)=>{let i=n?Object.assign(n,{direction:"backward"}):{direction:"backward"};return nP(e)(t,r,i)},nB=e=>(t,r,n)=>nP(e)(t,r,n),nU=e=>async(t,r,n)=>{let i=n?Object.assign(n,{direction:"backward"}):{direction:"backward"};return nN(e)(t,r,i)},n$=e=>async(t,r,n)=>nN(e)(t,r,n),nK=/^[cC][^\s-]{8,}$/,nF=/^[0-9a-z]+$/,nz=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,nq=/^[0-9a-vA-V]{20}$/,nV=/^[A-Za-z0-9]{27}$/,nH=/^[a-zA-Z0-9_-]{21}$/,nG=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,nW=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,nJ=/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$/,nZ=e=>e?RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${e}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`):/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/,nY=nZ(4),nX=nZ(6),nQ=nZ(7),n0=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,n1=/^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/,n2=/^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/,n5=/^[^\s@"]{1,64}@[^\s@]{1,255}$/u,n3=n5,n8=/^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/,n6="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";function n4(){return RegExp(n6,"u")}let n9=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,n7=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:))$/,ie=e=>{let t=r9(e??":");return RegExp(`^(?:[0-9A-F]{2}${t}){5}[0-9A-F]{2}$|^(?:[0-9a-f]{2}${t}){5}[0-9a-f]{2}$`)},it=/^((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/([0-9]|[1-2][0-9]|3[0-2])$/,ir=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,ii=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,io=/^[A-Za-z0-9_-]*$/,is=/^(?=.{1,253}\.?$)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[-0-9a-zA-Z]{0,61}[0-9a-zA-Z])?)*\.?$/,ia=/^([a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?\.)+[a-zA-Z]{2,}$/,ic=/^\+[1-9]\d{6,14}$/,iu="(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))",il=RegExp(`^${iu}$`);function id(e){let t="(?:[01]\\d|2[0-3]):[0-5]\\d";return"number"==typeof e.precision?-1===e.precision?`${t}`:0===e.precision?`${t}:[0-5]\\d`:`${t}:[0-5]\\d\\.\\d{${e.precision}}`:`${t}(?::[0-5]\\d(?:\\.\\d+)?)?`}function ih(e){return RegExp(`^${id(e)}$`)}function ip(e){let t=id({precision:e.precision}),r=["Z"];e.local&&r.push(""),e.offset&&r.push("([+-](?:[01]\\d|2[0-3]):[0-5]\\d)");let n=`${t}(?:${r.join("|")})`;return RegExp(`^${iu}T(?:${n})$`)}let iy=e=>{let t=e?`[\\s\\S]{${e?.minimum??0},${e?.maximum??""}}`:"[\\s\\S]*";return RegExp(`^${t}$`)},ig=/^-?\d+n?$/,im=/^-?\d+$/,ib=/^-?\d+(?:\.\d+)?$/,iv=/^(?:true|false)$/i,iw=/^null$/i,i_=/^undefined$/i,iE=/^[^A-Z]*$/,iS=/^[^a-z]*$/,ix=/^[0-9a-fA-F]*$/;function iA(e,t){return RegExp(`^[A-Za-z0-9+/]{${e}}${t}$`)}function iI(e){return RegExp(`^[A-Za-z0-9_-]{${e}}$`)}let iO=/^[0-9a-fA-F]{32}$/,iT=iA(22,"=="),iP=iI(22),iM=/^[0-9a-fA-F]{40}$/,iN=iA(27,"="),ik=iI(27),iC=/^[0-9a-fA-F]{64}$/,iD=iA(43,"="),ij=iI(43),iR=/^[0-9a-fA-F]{96}$/,iL=iA(64,""),iB=iI(64),iU=/^[0-9a-fA-F]{128}$/,i$=iA(86,"=="),iK=iI(86),iF=rL("$ZodCheck",(e,t)=>{var r;e._zod??(e._zod={}),e._zod.def=t,(r=e._zod).onattach??(r.onattach=[])}),iz={number:"number",bigint:"bigint",object:"date"},iq=rL("$ZodCheckLessThan",(e,t)=>{iF.init(e,t);let r=iz[typeof t.value];e._zod.onattach.push(e=>{let r=e._zod.bag,n=(t.inclusive?r.maximum:r.exclusiveMaximum)??Number.POSITIVE_INFINITY;t.value<n&&(t.inclusive?r.maximum=t.value:r.exclusiveMaximum=t.value)}),e._zod.check=n=>{(t.inclusive?n.value<=t.value:n.value<t.value)||n.issues.push({origin:r,code:"too_big",maximum:"object"==typeof t.value?t.value.getTime():t.value,input:n.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),iV=rL("$ZodCheckGreaterThan",(e,t)=>{iF.init(e,t);let r=iz[typeof t.value];e._zod.onattach.push(e=>{let r=e._zod.bag,n=(t.inclusive?r.minimum:r.exclusiveMinimum)??Number.NEGATIVE_INFINITY;t.value>n&&(t.inclusive?r.minimum=t.value:r.exclusiveMinimum=t.value)}),e._zod.check=n=>{(t.inclusive?n.value>=t.value:n.value>t.value)||n.issues.push({origin:r,code:"too_small",minimum:"object"==typeof t.value?t.value.getTime():t.value,input:n.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),iH=rL("$ZodCheckMultipleOf",(e,t)=>{iF.init(e,t),e._zod.onattach.push(e=>{var r;(r=e._zod.bag).multipleOf??(r.multipleOf=t.value)}),e._zod.check=r=>{if(typeof r.value!=typeof t.value)throw Error("Cannot mix number and bigint in multiple_of check.");("bigint"==typeof r.value?r.value%t.value===BigInt(0):0===rW(r.value,t.value))||r.issues.push({origin:typeof r.value,code:"not_multiple_of",divisor:t.value,input:r.value,inst:e,continue:!t.abort})}}),iG=rL("$ZodCheckNumberFormat",(e,t)=>{iF.init(e,t),t.format=t.format||"float64";let r=t.format?.includes("int"),n=r?"int":"number",[i,o]=nn[t.format];e._zod.onattach.push(e=>{let n=e._zod.bag;n.format=t.format,n.minimum=i,n.maximum=o,r&&(n.pattern=im)}),e._zod.check=s=>{let a=s.value;if(r){if(!Number.isInteger(a)){s.issues.push({expected:n,format:t.format,code:"invalid_type",continue:!1,input:a,inst:e});return}if(!Number.isSafeInteger(a)){a>0?s.issues.push({input:a,code:"too_big",maximum:Number.MAX_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:n,inclusive:!0,
vendor: 4,785 bytes, line 42
42continue:!t.abort}):s.issues.push({input:a,code:"too_small",minimum:Number.MIN_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:n,inclusive:!0,continue:!t.abort});return}}a<i&&s.issues.push({origin:"number",input:a,code:"too_small",minimum:i,inclusive:!0,inst:e,continue:!t.abort}),a>o&&s.issues.push({origin:"number",input:a,code:"too_big",maximum:o,inclusive:!0,inst:e,continue:!t.abort})}}),iW=rL("$ZodCheckBigIntFormat",(e,t)=>{iF.init(e,t);let[r,n]=ni[t.format];e._zod.onattach.push(e=>{let i=e._zod.bag;i.format=t.format,i.minimum=r,i.maximum=n}),e._zod.check=i=>{let o=i.value;o<r&&i.issues.push({origin:"bigint",input:o,code:"too_small",minimum:r,inclusive:!0,inst:e,continue:!t.abort}),o>n&&i.issues.push({origin:"bigint",input:o,code:"too_big",maximum:n,inclusive:!0,inst:e,continue:!t.abort})}}),iJ=rL("$ZodCheckMaxSize",(e,t)=>{var r;iF.init(e,t),(r=e._zod.def).when??(r.when=e=>{let t=e.value;return!rH(t)&&void 0!==t.size}),e._zod.onattach.push(e=>{let r=e._zod.bag.maximum??Number.POSITIVE_INFINITY;t.maximum<r&&(e._zod.bag.maximum=t.maximum)}),e._zod.check=r=>{let n=r.value;n.size<=t.maximum||r.issues.push({origin:ng(n),code:"too_big",maximum:t.maximum,inclusive:!0,input:n,inst:e,continue:!t.abort})}}),iZ=rL("$ZodCheckMinSize",(e,t)=>{var r;iF.init(e,t),(r=e._zod.def).when??(r.when=e=>{let t=e.value;return!rH(t)&&void 0!==t.size}),e._zod.onattach.push(e=>{let r=e._zod.bag.minimum??Number.NEGATIVE_INFINITY;t.minimum>r&&(e._zod.bag.minimum=t.minimum)}),e._zod.check=r=>{let n=r.value;n.size>=t.minimum||r.issues.push({origin:ng(n),code:"too_small",minimum:t.minimum,inclusive:!0,input:n,inst:e,continue:!t.abort})}}),iY=rL("$ZodCheckSizeEquals",(e,t)=>{var r;iF.init(e,t),(r=e._zod.def).when??(r.when=e=>{let t=e.value;return!rH(t)&&void 0!==t.size}),e._zod.onattach.push(e=>{let r=e._zod.bag;r.minimum=t.size,r.maximum=t.size,r.size=t.size}),e._zod.check=r=>{let n=r.value,i=n.size;if(i===t.size)return;let o=i>t.size;r.issues.push({origin:ng(n),...o?{code:"too_big",maximum:t.size}:{code:"too_small",minimum:t.size},inclusive:!0,exact:!0,input:r.value,inst:e,continue:!t.abort})}}),iX=rL("$ZodCheckMaxLength",(e,t)=>{var r;iF.init(e,t),(r=e._zod.def).when??(r.when=e=>{let t=e.value;return!rH(t)&&void 0!==t.length}),e._zod.onattach.push(e=>{let r=e._zod.bag.maximum??Number.POSITIVE_INFINITY;t.maximum<r&&(e._zod.bag.maximum=t.maximum)}),e._zod.check=r=>{let n=r.value;if(n.length<=t.maximum)return;let i=nm(n);r.issues.push({origin:i,code:"too_big",maximum:t.maximum,inclusive:!0,input:n,inst:e,continue:!t.abort})}}),iQ=rL("$ZodCheckMinLength",(e,t)=>{var r;iF.init(e,t),(r=e._zod.def).when??(r.when=e=>{let t=e.value;return!rH(t)&&void 0!==t.length}),e._zod.onattach.push(e=>{let r=e._zod.bag.minimum??Number.NEGATIVE_INFINITY;t.minimum>r&&(e._zod.bag.minimum=t.minimum)}),e._zod.check=r=>{let n=r.value;if(n.length>=t.minimum)return;let i=nm(n);r.issues.push({origin:i,code:"too_small",minimum:t.minimum,inclusive:!0,input:n,inst:e,continue:!t.abort})}}),i0=rL("$ZodCheckLengthEquals",(e,t)=>{var r;iF.init(e,t),(r=e._zod.def).when??(r.when=e=>{let t=e.value;return!rH(t)&&void 0!==t.length}),e._zod.onattach.push(e=>{let r=e._zod.bag;r.minimum=t.length,r.maximum=t.length,r.length=t.length}),e._zod.check=r=>{let n=r.value,i=n.length;if(i===t.length)return;let o=nm(n),s=i>t.length;r.issues.push({origin:o,...s?{code:"too_big",maximum:t.length}:{code:"too_small",minimum:t.length},inclusive:!0,exact:!0,input:r.value,inst:e,continue:!t.abort})}}),i1=rL("$ZodCheckStringFormat",(e,t)=>{var r,n;iF.init(e,t),e._zod.onattach.push(e=>{let r=e._zod.bag;r.format=t.format,t.pattern&&(r.patterns??(r.patterns=new Set),r.patterns.add(t.pattern))}),t.pattern?(r=e._zod).check??(r.check=r=>{t.pattern.lastIndex=0,t.pattern.test(r.value)||r.issues.push({origin:"string",code:"invalid_format",format:t.format,input:r.value,...t.pattern?{pattern:t.pattern.toString()}:{},inst:e,continue:!t.abort})}):(n=e._zod).check??(n.check=()=>{})}),i2=rL("$ZodCheckRegex",(e,t)=>{i1.init(e,t),e._zod.check=r=>{t.pattern.lastIndex=0,t.pattern.test(r.value)||r.issues.push({origin:"string",code:"invalid_format",format:"regex",input:r.value,pattern:t.pattern.toString(),inst:e,continue:!t.abort})}}),i5=rL("$ZodCheckLowerCase",(e,t)=>{t.pattern??(t.pattern=iE),i1.init(e,t)}),i3=rL("$ZodCheckUpperCase",(e,t)=>{t.pattern??(t.pattern=iS),i1.init(e,t)}),i8=rL("$ZodCheckIncludes",(e,t)=>{iF.init(e,t);let r=r9(t.includes),n=new RegExp("number"==typeof t.position?`^.{${t.position}}${r}`:r);t.pattern=n,e._zod.onattach.push(e=>{let t=e._zod.bag;t.patterns??(t.patterns=new Set),t.patterns.add(n)}),e._zod.check=r=>{r.value.includes(t.includes,t.position)||r.issues.push({origin:"string",code:"invalid_format",format:"includes",includes:t.includes,input
42:r.value,inst:e,continue:!t.abort})}}),i6=rL("$ZodCheckStartsWith",(e,t)=>{iF.init(e,t);let r=RegExp(`^${r9(t.prefix)}.*`);t.pattern??(t.pattern=r),e._zod.onattach.push(e=>{let t=e._zod.bag;t.patterns??(t.patterns=new Set),t.patterns.add(r)}),e._zod.check=r=>{r.value.startsWith(t.prefix)||r.issues.push({origin:"string",code:"invalid_format",format:"starts_with",prefix:t.prefix,input:r.value,inst:e,continue:!t.abort})}}),i4=rL("$ZodCheckEndsWith",(e,t)=>{iF.init(e,t);let r=RegExp(`.*${r9(t.suffix)}$`);t.pattern??(t.pattern=r),e._zod.onattach.push(e=>{let t=e._zod.bag;t.patterns??(t.patterns=new Set),t.patterns.add(r)}),e._zod.check=r=>{r.value.endsWith(t.suffix)||r.issues.push({origin:"string",code:"invalid_format",format:"ends_with",suffix:t.suffix,input:r.value,inst:e,continue:!t.abort})}});function i9(e,t,r){e.issues.length&&t.issues.push(...nh(r,e.issues))}let i7=rL("$ZodCheckProperty",(e,t)=>{iF.init(e,t),e._zod.check=e=>{let r=t.schema._zod.run({value:e.value[t.property],issues:[]},{});if(r instanceof Promise)return r.then(r=>i9(r,e,t.property));i9(r,e,t.property)}}),oe=rL("$ZodCheckMimeType",(e,t)=>{iF.init(e,t);let r=new Set(t.mime);e._zod.onattach.push(e=>{e._zod.bag.mime=t.mime}),e._zod.check=n=>{r.has(n.value.type)||n.issues.push({code:"invalid_value",values:t.mime,input:n.value.type,inst:e,continue:!t.abort})}}),ot=rL("$ZodCheckOverwrite",(e,t)=>{iF.init(e,t),e._zod.check=e=>{e.value=t.tx(e.value)}});class or{constructor(e=[]){this.content=[],this.indent=0,this&&(this.args=e)}indented(e){this.indent+=1,e(this),this.indent-=1}write(e){if("function"==typeof e){e(this,{execution:"sync"}),e(this,{execution:"async"});return}let t=e.split("\n").filter(e=>e),r=Math.min(...t.map(e=>e.length-e.trimStart().length));for(let e of t.map(e=>e.slice(r)).map(e=>" ".repeat(2*this.indent)+e))this.content.push(e)}compile(){return Function(...this?.args,[...(this?.content??[""]).map(e=>` ${e}`)].join("\n"))}}let on={major:4,minor:3,patch:6},oi=rL("$ZodType",(e,t)=>{var r;e??(e={}),e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=on;let n=[...e._zod.def.checks??[]];for(let t of(e._zod.traits.has("$ZodCheck")&&n.unshift(e),n))for(let r of t._zod.onattach)r(e);if(0===n.length)(r=e._zod).deferred??(r.deferred=[]),e._zod.deferred?.push(()=>{e._zod.run=e._zod.parse});else{let t=(e,t,r)=>{let n,i=nf(e);for(let o of t){if(o._zod.def.when){if(!o._zod.def.when(e))continue}else if(i)continue;let t=e.issues.length,s=o._zod.check(e);if(s instanceof Promise&&r?.async===!1)throw new rB;if(n||s instanceof Promise)n=(n??Promise.resolve()).then(async()=>{await s,e.issues.length===t||i||(i=nf(e,t))});else{if(e.issues.length===t)continue;i||(i=nf(e,t))}}return n?n.then(()=>e):e},r=(r,i,o)=>{if(nf(r))return r.aborted=!0,r;let s=t(i,n,o);if(s instanceof Promise){if(!1===o.async)throw new rB;return s.then(t=>e._zod.parse(t,o))}return e._zod.parse(s,o)};e._zod.run=(i,o)=>{if(o.skipChecks)return e._zod.parse(i,o);if("backward"===o.direction){let t=e._zod.parse({value:i.value,issues:[]},{...o,skipChecks:!0});return t instanceof Promise?t.then(e=>r(e,i,o)):r(t,i,o)}let s=e._zod.parse(i,o);if(s instanceof Promise){if(!1===o.async)throw new rB;return s.then(e=>t(e,n,o))}return t(s,n,o)}}rZ(e,"~standard",()=>({validate:t=>{try{let r=nM(e,t);return r.success?{value:r.data}:{issues:r.error?.issues}}catch(r){return nk(e,t).then(e=>e.success?{value:e.data}:{issues:e.error?.issues})}},vendor:"zod",version:1}))}),oo=rL("$ZodString",(e,t)=>{oi.init(e,t),e._zod.pattern=[...e?._zod.bag?.patterns??[]].pop()??iy(e._zod.bag),e._zod.parse=(r,n)=>{if(t.coerce)try{r.value=String(r.value)}catch(e){}return"string"==typeof r.value||r.issues.push({expected:"string",code:"invalid_type",input:r.value,inst:e}),r}}),os=rL("$ZodStringFormat",(e,t)=>{i1.init(e,t),oo.init(e,t)}),oa=rL("$ZodGUID",(e,t)=>{t.pattern??(t.pattern=nJ),os.init(e,t)}),oc=rL("$ZodUUID",(e,t)=>{if(t.version){let e={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[t.version];if(void 0===e)throw Error(`Invalid UUID version: "${t.version}"`);t.pattern??(t.pattern=nZ(e))}else t.pattern??(t.pattern=nZ());os.init(e,t)}),ou=rL("$ZodEmail",(e,t)=>{t.pattern??(t.pattern=n0),os.init(e,t)}),ol=rL("$ZodURL",(e,t)=>{os.init(e,t),e._zod.check=r=>{try{let n=r.value.trim(),i=new URL(n);t.hostname&&(t.hostname.lastIndex=0,t.hostname.test(i.hostname)||r.issues.push({code:"invalid_format",format:"url",n
42ote:"Invalid hostname",pattern:t.hostname.source,input:r.value,inst:e,continue:!t.abort})),t.protocol&&(t.protocol.lastIndex=0,t.protocol.test(i.protocol.endsWith(":")?i.protocol.slice(0,-1):i.protocol)||r.issues.push({code:"invalid_format",format:"url",note:"Invalid protocol",pattern:t.protocol.source,input:r.value,inst:e,continue:!t.abort})),t.normalize?r.value=i.href:r.value=n;return}catch(n){r.issues.push({code:"invalid_format",format:"url",input:r.value,inst:e,continue:!t.abort})}}}),od=rL("$ZodEmoji",(e,t)=>{t.pattern??(t.pattern=n4()),os.init(e,t)}),of=rL("$ZodNanoID",(e,t)=>{t.pattern??(t.pattern=nH),os.init(e,t)}),oh=rL("$ZodCUID",(e,t)=>{t.pattern??(t.pattern=nK),os.init(e,t)}),op=rL("$ZodCUID2",(e,t)=>{t.pattern??(t.pattern=nF),os.init(e,t)}),oy=rL("$ZodULID",(e,t)=>{t.pattern??(t.pattern=nz),os.init(e,t)}),og=rL("$ZodXID",(e,t)=>{t.pattern??(t.pattern=nq),os.init(e,t)}),om=rL("$ZodKSUID",(e,t)=>{t.pattern??(t.pattern=nV),os.init(e,t)}),ob=rL("$ZodISODateTime",(e,t)=>{t.pattern??(t.pattern=ip(t)),os.init(e,t)}),ov=rL("$ZodISODate",(e,t)=>{t.pattern??(t.pattern=il),os.init(e,t)}),ow=rL("$ZodISOTime",(e,t)=>{t.pattern??(t.pattern=ih(t)),os.init(e,t)}),o_=rL("$ZodISODuration",(e,t)=>{t.pattern??(t.pattern=nG),os.init(e,t)}),oE=rL("$ZodIPv4",(e,t)=>{t.pattern??(t.pattern=n9),os.init(e,t),e._zod.bag.format="ipv4"}),oS=rL("$ZodIPv6",(e,t)=>{t.pattern??(t.pattern=n7),os.init(e,t),e._zod.bag.format="ipv6",e._zod.check=r=>{try{new URL(`http://[${r.value}]`)}catch{r.issues.push({code:"invalid_format",format:"ipv6",input:r.value,inst:e,continue:!t.abort})}}}),ox=rL("$ZodMAC",(e,t)=>{t.pattern??(t.pattern=ie(t.delimiter)),os.init(e,t),e._zod.bag.format="mac"}),oA=rL("$ZodCIDRv4",(e,t)=>{t.pattern??(t.pattern=it),os.init(e,t)}),oI=rL("$ZodCIDRv6",(e,t)=>{t.pattern??(t.pattern=ir),os.init(e,t),e._zod.check=r=>{let n=r.value.split("/");try{if(2!==n.length)throw Error();let[e,t]=n;if(!t)throw Error();let r=Number(t);if(`${r}`!==t||r<0||r>128)throw Error();new URL(`http://[${e}]`)}catch{r.issues.push({code:"invalid_format",format:"cidrv6",input:r.value,inst:e,continue:!t.abort})}}});function oO(e){if(""===e)return!0;if(e.length%4!=0)return!1;try{return atob(e),!0}catch{return!1}}let oT=rL("$ZodBase64",(e,t)=>{t.pattern??(t.pattern=ii),os.init(e,t),e._zod.bag.contentEncoding="base64",e._zod.check=r=>{oO(r.value)||r.issues.push({code:"invalid_format",format:"base64",input:r.value,inst:e,continue:!t.abort})}});function oP(e){if(!io.test(e))return!1;let t=e.replace(/[-_]/g,e=>"-"===e?"+":"/");return oO(t.padEnd(4*Math.ceil(t.length/4),"="))}let oM=rL("$ZodBase64URL",(e,t)=>{t.pattern??(t.pattern=io),os.init(e,t),e._zod.bag.contentEncoding="base64url",e._zod.check=r=>{oP(r.value)||r.issues.push({code:"invalid_format",format:"base64url",input:r.value,inst:e,continue:!t.abort})}}),oN=rL("$ZodE164",(e,t)=>{t.pattern??(t.pattern=ic),os.init(e,t)});function ok(e,t=null){try{let r=e.split(".");if(3!==r.length)return!1;let[n]=r;if(!n)return!1;let i=JSON.parse(atob(n));if("typ"in i&&i?.typ!=="JWT"||!i.alg||t&&(!("alg"in i)||i.alg!==t))return!1;return!0}catch{return!1}}let oC=rL("$ZodJWT",(e,t)=>{os.init(e,t),e._zod.check=r=>{ok(r.value,t.alg)||r.issues.push({code:"invalid_format",format:"jwt",input:r.value,inst:e,continue:!t.abort})}}),oD=rL("$ZodCustomStringFormat",(e,t)=>{os.init(e,t),e._zod.check=r=>{t.fn(r.value)||r.issues.push({code:"invalid_format",format:t.format,input:r.value,inst:e,continue:!t.abort})}}),oj=rL("$ZodNumber",(e,t)=>{oi.init(e,t),e._zod.pattern=e._zod.bag.pattern??ib,e._zod.parse=(r,n)=>{if(t.coerce)try{r.value=Number(r.value)}catch(e){}let i=r.value;if("number"==typeof i&&!Number.isNaN(i)&&Number.isFinite(i))return r;let o="number"==typeof i?Number.isNaN(i)?"NaN":Number.isFinite(i)?void 0:"Infinity":void 0;return r.issues.push({expected:"number",code:"invalid_type",input:i,inst:e,...o?{received:o}:{}}),r}}),oR=rL("$ZodNumberFormat",(e,t)=>{iG.init(e,t),oj.init(e,t)}),oL=rL("$ZodBoolean",(e,t)=>{oi.init(e,t),e._zod.pattern=iv,e._zod.parse=(r,n)=>{if(t.coerce)try{r.value=!!r.value}catch(e){}let i=r.value;return"boolean"==typeof i||r.issues.push({expected:"boolean",code:"invalid_type",input:i,inst:e}),r}}),oB=rL("$ZodBigInt",(e,t)=>{oi.init(e,t),e._zod.pattern=ig,e._zod.parse=(r,n)=>{if(t.coerce)try{r.value=BigInt(r.value)}catch(e){}return"bigint"==typeof r.value||r.issues.push({expected:"bigint",code:"invalid_type",input:r.value,inst:e}),r}}),oU=rL("$ZodBigIntFormat",(e,t)=>{iW.init(e,t),oB.init(e,t)}),o$=rL("$ZodSymbol",(e,t)=>{oi.init(e,t),e._zod.parse=(t,r)=>{let n=t.value;return"symbol"==typeof n||t.issues.push({expected:"symbol",code:"invalid_type",input:n,inst:e}),t}}),oK=rL("$ZodUndefined",(e,t)=>{oi.init(e,t),e._zod.pattern=i_,e._zod.values=new Set([void 0]),e._zod.optin="optional",e._zod.optout="optional",e._zod.parse=(t,r)=>{let n=t.value;return void 0===n||t.issues.push({expected:"undefined",code:"invalid_type",input:n,inst:e}),t}}),oF=rL("$ZodNull",(e,t)=>{oi.init(e,t),e._zod.pattern=iw,e._zod.values=new Set([null]),e._zod.parse=(t,r)=>{let n=t.value;return null===n||t.issues.push({expected:"null",code:"invalid_type",input:n,inst:e}),t}}),oz=rL("$ZodAny",(e,t)=>{oi.init(e,t),e._zod.parse=e=>e}),oq=rL("$ZodUnknown",(e,t)=>{oi.init(e,t),e._zod.parse=e=>e}),oV=rL("$ZodNever",(e,t)=>{oi.init(e,t),e._zod.parse=(t,r)=>(t.issues.push({expected:"never",code:"invalid_type",input:t.value,inst:e}),t)}),oH=rL("$ZodVoid",(e,t)=>{oi.init(e,t),e._zod.parse=(t,r)=>{let n=t.value;return void 0===n||t.issues.push({expected:"void",code:"invalid_type",input:n,inst:e}),t}}),oG=rL("$ZodDate",(e,t)=>{oi.init(e,t),e._zod.parse=(r,n)=>{if(t.coerce)try{r.value=new Date(r.value)}catch(e){}let i=r.value,o=i instanceof Date;return o&&!Number.isNaN(i.getTime())||r.issues.push({expected:"date",code:"invalid_type",input:i,...o?{received:"Invalid Date"}:{},inst:e}),r}});function oW(e,t,r){e.issues.length&&t.issues.push(...nh(r,e.issues)),t.value[r]=e.value}let oJ=rL("$ZodArray",(e,t)=>{oi.init(e,t),e._zod.parse=(r,n)=>{let i=r.value;if(!Array.isArray(i))return r.issues.push({expected:"array",code:"invalid_type",input:i,inst:e}),r;r.value=Array(i.length);let o=[];for(let e=0;e<i.length;e++){let s=i[e],a=t.element._zod.run({value:s,issues:[]},n);a instanceof Promise?o.push(a.then(t=>oW(t,r,e))):oW(a,r,e)}return o.length?Promise.all(o).then(()=>r):r}});function oZ(e,t,r,n,i){if(e.issues.length){if(i&&!(r in n))return;t.issues.push(...nh(r,e.issues))}
42void 0===e.value?r in n&&(t.value[r]=void 0):t.value[r]=e.value}function oY(e){let t=Object.keys(e.shape);for(let r of t)if(!e.shape?.[r]?._zod?.traits?.has("$ZodType"))throw Error(`Invalid element at key "${r}": expected a Zod schema`);let r=nr(e.shape);return{...e,keys:t,keySet:new Set(t),numKeys:t.length,optionalKeys:new Set(r)}}function oX(e,t,r,n,i,o){let s=[],a=i.keySet,c=i.catchall._zod,u=c.def.type,l="optional"===c.optout;for(let i in t){if(a.has(i))continue;if("never"===u){s.push(i);continue}let o=c.run({value:t[i],issues:[]},n);o instanceof Promise?e.push(o.then(e=>oZ(e,r,i,t,l))):oZ(o,r,i,t,l)}return(s.length&&r.issues.push({code:"unrecognized_keys",keys:s,input:t,inst:o}),e.length)?Promise.all(e).then(()=>r):r}let oQ=rL("$ZodObject",(e,t)=>{let r;oi.init(e,t);let n=Object.getOwnPropertyDescriptor(t,"shape");if(!n?.get){let e=t.shape;Object.defineProperty(t,"shape",{get:()=>{let r={...e};return Object.defineProperty(t,"shape",{value:r}),r}})}let i=rV(()=>oY(t));rZ(e._zod,"propValues",()=>{let e=t.shape,r={};for(let t in e){let n=e[t]._zod;if(n.values)for(let e of(r[t]??(r[t]=new Set),n.values))r[t].add(e)}return r});let o=r2,s=t.catchall;e._zod.parse=(t,n)=>{r??(r=i.value);let a=t.value;if(!o(a))return t.issues.push({expected:"object",code:"invalid_type",input:a,inst:e}),t;t.value={};let c=[],u=r.shape;for(let e of r.keys){let r=u[e],i="optional"===r._zod.optout,o=r._zod.run({value:a[e],issues:[]},n);o instanceof Promise?c.push(o.then(r=>oZ(r,t,e,a,i))):oZ(o,t,e,a,i)}return s?oX(c,a,t,n,i.value,e):c.length?Promise.all(c).then(()=>t):t}}),o0=rL("$ZodObjectJIT",(e,t)=>{let r,n;oQ.init(e,t);let i=e._zod.parse,o=rV(()=>oY(t)),s=e=>{let t=new or(["shape","payload","ctx"]),r=o.value,n=e=>{let t=rQ(e);return`shape[${t}]._zod.run({ value: input[${t}], issues: [] }, ctx)`};t.write("const input = payload.value;");let i=Object.create(null),s=0;for(let e of r.keys)i[e]=`key_${s++}`;for(let o of(t.write("const newResult = {};"),r.keys)){let r=i[o],s=rQ(o),a=e[o],c=a?._zod?.optout==="optional";t.write(`const ${r} = ${n(o)};`),c?t.write(` 43 if (${r}.issues.length) { 44 if (${s} in input) { 45 payload.issues = payload.issues.concat(${r}.issues.map(iss => ({ 46 ...iss, 47 path: iss.path ? [${s}, ...iss.path] : [${s}] 48 }))); 49 } 50 } 51 52 if (${r}.value === undefined) { 53 if (${s} in input) { 54 newResult[${s}] = undefined; 55 } 56 } else { 57 newResult[${s}] = ${r}.value; 58 } 59 60 `):t.write(` 61 if (${r}.issues.length) { 62 payload.issues = payload.issues.concat(${r}.issues.map(iss => ({ 63 ...iss, 64 path: iss.path ? [${s}, ...iss.path] : [${s}] 65 }))); 66 } 67 68 if (${r}.value === undefined) { 69 if (${s} in input) { 70 newResult[${s}] = undefined; 71 } 72 } else { 73 newResult[${s}] = ${r}.value; 74 } 75 76 `)}t.write("payload.value = newResult;"),t.write("return payload;");let a=t.compile();return(t,r)=>a(e,t,r)},a=r2,c=!r$.jitless,u=r5,l=c&&u.value,d=t.catchall;e._zod.parse=(u,f)=>{n??(n=o.value);let h=u.value;return a(h)?c&&l&&f?.async===!1&&!0!==f.jitless?(r||(r=s(t.shape)),u=r(u,f),d)?oX([],h,u,f,n,e):u:i(u,f):(u.issues.push({expected:"object",code:"invalid_type",input:h,inst:e}),u)}});function o1(e,t,r,n){for(let r of e)if(0===r.issues.length)return t.value=r.value,t;let i=e.filter(e=>!nf(e));return 1===i.length?(t.value=i[0].value,i[0]):(t.issues.push({code:"invalid_union",input:t.value,inst:r,errors:e.map(e=>e.issues.map(e=>ny(e,n,rK())))}),t)}let o2=rL("$ZodUnion",(e,t)=>{oi.init(e,t),rZ(e._zod,"optin",()=>t.options.some(e=>"optional"===e._zod.optin)?"optional":void 0),rZ(e._zod,"optout",()=>t.options.some(e=>"optional"===e._zod.optout)?"optional":void 0),rZ(e._zod,"values",()=>{if(t.options.every(e=>e._zod.values))return new Set(t.options.flatMap(e=>Array.from(e._zod.values)))}),rZ(e._zod,"pattern",()=>{if(t.options.every(e=>e._zod.pattern)){let e=t.options.map(e=>e._zod.pattern);return RegExp(`^(${e.map(e=>rG(e.source)).join("|")})$`)}});let r=1===t.options.length,n=t.options[0]._zod.run;e._zod.parse=(i,o)=>
76{if(r)return n(i,o);let s=!1,a=[];for(let e of t.options){let t=e._zod.run({value:i.value,issues:[]},o);if(t instanceof Promise)a.push(t),s=!0;else{if(0===t.issues.length)return t;a.push(t)}}return s?Promise.all(a).then(t=>o1(t,i,e,o)):o1(a,i,e,o)}});function o5(e,t,r,n){let i=e.filter(e=>0===e.issues.length);return 1===i.length?t.value=i[0].value:0===i.length?t.issues.push({code:"invalid_union",input:t.value,inst:r,errors:e.map(e=>e.issues.map(e=>ny(e,n,rK())))}):t.issues.push({code:"invalid_union",input:t.value,inst:r,errors:[],inclusive:!1}),t}let o3=rL("$ZodXor",(e,t)=>{o2.init(e,t),t.inclusive=!1;let r=1===t.options.length,n=t.options[0]._zod.run;e._zod.parse=(i,o)=>{if(r)return n(i,o);let s=!1,a=[];for(let e of t.options){let t=e._zod.run({value:i.value,issues:[]},o);t instanceof Promise?(a.push(t),s=!0):a.push(t)}return s?Promise.all(a).then(t=>o5(t,i,e,o)):o5(a,i,e,o)}}),o8=rL("$ZodDiscriminatedUnion",(e,t)=>{t.inclusive=!1,o2.init(e,t);let r=e._zod.parse;rZ(e._zod,"propValues",()=>{let e={};for(let r of t.options){let n=r._zod.propValues;if(!n||0===Object.keys(n).length)throw Error(`Invalid discriminated union option at index "${t.options.indexOf(r)}"`);for(let[t,r]of Object.entries(n))for(let n of(e[t]||(e[t]=new Set),r))e[t].add(n)}return e});let n=rV(()=>{let e=t.options,r=new Map;for(let n of e){let e=n._zod.propValues?.[t.discriminator];if(!e||0===e.size)throw Error(`Invalid discriminated union option at index "${t.options.indexOf(n)}"`);for(let t of e){if(r.has(t))throw Error(`Duplicate discriminator value "${String(t)}"`);r.set(t,n)}}return r});e._zod.parse=(i,o)=>{let s=i.value;if(!r2(s))return i.issues.push({code:"invalid_type",expected:"object",input:s,inst:e}),i;let a=n.value.get(s?.[t.discriminator]);return a?a._zod.run(i,o):t.unionFallback?r(i,o):(i.issues.push({code:"invalid_union",errors:[],note:"No matching discriminator",discriminator:t.discriminator,input:s,path:[t.discriminator],inst:e}),i)}}),o6=rL("$ZodIntersection",(e,t)=>{oi.init(e,t),e._zod.parse=(e,r)=>{let n=e.value,i=t.left._zod.run({value:n,issues:[]},r),o=t.right._zod.run({value:n,issues:[]},r);return i instanceof Promise||o instanceof Promise?Promise.all([i,o]).then(([t,r])=>o9(e,t,r)):o9(e,i,o)}});function o4(e,t){if(e===t||e instanceof Date&&t instanceof Date&&+e==+t)return{valid:!0,data:e};if(r3(e)&&r3(t)){let r=Object.keys(t),n=Object.keys(e).filter(e=>-1!==r.indexOf(e)),i={...e,...t};for(let r of n){let n=o4(e[r],t[r]);if(!n.valid)return{valid:!1,mergeErrorPath:[r,...n.mergeErrorPath]};i[r]=n.data}return{valid:!0,data:i}}if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return{valid:!1,mergeErrorPath:[]};let r=[];for(let n=0;n<e.length;n++){let i=o4(e[n],t[n]);if(!i.valid)return{valid:!1,mergeErrorPath:[n,...i.mergeErrorPath]};r.push(i.data)}return{valid:!0,data:r}}return{valid:!1,mergeErrorPath:[]}}function o9(e,t,r){let n;let i=new Map;for(let r of t.issues)if("unrecognized_keys"===r.code)for(let e of(n??(n=r),r.keys))i.has(e)||i.set(e,{}),i.get(e).l=!0;else e.issues.push(r);for(let t of r.issues)if("unrecognized_keys"===t.code)for(let e of t.keys)i.has(e)||i.set(e,{}),i.get(e).r=!0;else e.issues.push(t);let o=[...i].filter(([,e])=>e.l&&e.r).map(([e])=>e);if(o.length&&n&&e.issues.push({...n,keys:o}),nf(e))return e;let s=o4(t.value,r.value);if(!s.valid)throw Error(`Unmergable intersection. Error path: ${JSON.stringify(s.mergeErrorPath)}`);return e.value=s.data,e}let o7=rL("$ZodTuple",(e,t)=>{oi.init(e,t);let r=t.items;e._zod.parse=(n,i)=>{let o=n.value;if(!Array.isArray(o))return n.issues.push({input:o,inst:e,expected:"tuple",code:"invalid_type"}),n;n.value=[];let s=[],a=[...r].reverse().findIndex(e=>"optional"!==e._zod.optin),c=-1===a?0:r.length-a;if(!t.rest){let t=o.length>r.length,i=o.length<c-1;if(t||i)return n.issues.push({...t?{code:"too_big",maximum:r.length,inclusive:!0}:{code:"too_small",minimum:r.length},input:o,inst:e,origin:"array"}),n}let u=-1;for(let e of r){if(++u>=o.length&&u>=c)continue;let t=e._zod.run({value:o[u],issues:[]},i);t instanceof Promise?s.push(t.then(e=>se(e,n,u))):se(t,n,u)}if(t.rest)for(let e of o.slice(r.length)){u++;let r=t.rest._zod.run({value:e,issues:[]},i);r instanceof Promise?s.push(r.then(e=>se(e,n,u))):se(r,n,u)}return s.length?Promise.all(s).then(()=>n):n}});function se(e,t,r){e.issues.length&&t.issues.push(...nh(r,e.issues)),t.value[r]=e.value}let st=rL("$ZodRecord",(e,t)=>{oi.init(e,t),e._zod.parse=(r,n)=>{let i=r.value;if(!r3(i))return r.issues.push({expected:"record",code:"invalid_type",input:i,inst:e}),r;let o=[],s=t.keyType._zod.values;if(s){let a;r.value={};let c=new Set;for(let e of s)if("string"==typeof e||"number"==typeof e||"symbol"==typeof e){c.add("number"==typeof e?e.toString():e);let s=t.valueType._zod.run({value:i[e],issues:[]},n);s instanceof Promise?o.push(s.then(t=>{t.issues.length&&r.issues.push(...nh(e,t.issues)),r.value[e]=t.value})):(s.issues.length&&r.issues.push(...nh(e,s.issues)),r.value[e]=s.value)}for(let e in i)c.has(e)||(a=a??[]).push(e);a&&a.length>0&&r.issues.push({code:"unrecognized_keys",input:i,inst:e,keys:a})}else for(let s of(r.value={}
76,Reflect.ownKeys(i))){if("__proto__"===s)continue;let a=t.keyType._zod.run({value:s,issues:[]},n);if(a instanceof Promise)throw Error("Async schemas not supported in object keys currently");if("string"==typeof s&&ib.test(s)&&a.issues.length){let e=t.keyType._zod.run({value:Number(s),issues:[]},n);if(e instanceof Promise)throw Error("Async schemas not supported in object keys currently");0===e.issues.length&&(a=e)}if(a.issues.length){"loose"===t.mode?r.value[s]=i[s]:r.issues.push({code:"invalid_key",origin:"record",issues:a.issues.map(e=>ny(e,n,rK())),input:s,path:[s],inst:e});continue}let c=t.valueType._zod.run({value:i[s],issues:[]},n);c instanceof Promise?o.push(c.then(e=>{e.issues.length&&r.issues.push(...nh(s,e.issues)),r.value[a.value]=e.value})):(c.issues.length&&r.issues.push(...nh(s,c.issues)),r.value[a.value]=c.value)}return o.length?Promise.all(o).then(()=>r):r}}),sr=rL("$ZodMap",(e,t)=>{oi.init(e,t),e._zod.parse=(r,n)=>{let i=r.value;if(!(i instanceof Map))return r.issues.push({expected:"map",code:"invalid_type",input:i,inst:e}),r;let o=[];for(let[s,a]of(r.value=new Map,i)){let c=t.keyType._zod.run({value:s,issues:[]},n),u=t.valueType._zod.run({value:a,issues:[]},n);c instanceof Promise||u instanceof Promise?o.push(Promise.all([c,u]).then(([t,o])=>{sn(t,o,r,s,i,e,n)})):sn(c,u,r,s,i,e,n)}return o.length?Promise.all(o).then(()=>r):r}});function sn(e,t,r,n,i,o,s){e.issues.length&&(r6.has(typeof n)?r.issues.push(...nh(n,e.issues)):r.issues.push({code:"invalid_key",origin:"map",input:i,inst:o,issues:e.issues.map(e=>ny(e,s,rK()))})),t.issues.length&&(r6.has(typeof n)?r.issues.push(...nh(n,t.issues)):r.issues.push({origin:"map",code:"invalid_element",input:i,inst:o,key:n,issues:t.issues.map(e=>ny(e,s,rK()))})),r.value.set(e.value,t.value)}let si=rL("$ZodSet",(e,t)=>{oi.init(e,t),e._zod.parse=(r,n)=>{let i=r.value;if(!(i instanceof Set))return r.issues.push({input:i,inst:e,expected:"set",code:"invalid_type"}),r;let o=[];for(let e of(r.value=new Set,i)){let i=t.valueType._zod.run({value:e,issues:[]},n);i instanceof Promise?o.push(i.then(e=>so(e,r))):so(i,r)}return o.length?Promise.all(o).then(()=>r):r}});function so(e,t){e.issues.length&&t.issues.push(...e.issues),t.value.add(e.value)}let ss=rL("$ZodEnum",(e,t)=>{oi.init(e,t);let r=rF(t.entries),n=new Set(r);e._zod.values=n,e._zod.pattern=RegExp(`^(${r.filter(e=>r6.has(typeof e)).map(e=>"string"==typeof e?r9(e):e.toString()).join("|")})$`),e._zod.parse=(t,i)=>{let o=t.value;return n.has(o)||t.issues.push({code:"invalid_value",values:r,input:o,inst:e}),t}}),sa=rL("$ZodLiteral",(e,t)=>{if(oi.init(e,t),0===t.values.length)throw Error("Cannot create literal schema with no valid values");let r=new Set(t.values);e._zod.values=r,e._zod.pattern=RegExp(`^(${t.values.map(e=>"string"==typeof e?r9(e):e?r9(e.toString()):String(e)).join("|")})$`),e._zod.parse=(n,i)=>{let o=n.value;return r.has(o)||n.issues.push({code:"invalid_value",values:t.values,input:o,inst:e}),n}}),sc=rL("$ZodFile",(e,t)=>{oi.init(e,t),e._zod.parse=(t,r)=>{let n=t.value;return n instanceof File||t.issues.push({expected:"file",code:"invalid_type",input:n,inst:e}),t}}),su=rL("$ZodTransform",(e,t)=>{oi.init(e,t),e._zod.parse=(r,n)=>{if("backward"===n.direction)throw new rU(e.constructor.name);let i=t.transform(r.value,r);if(n.async)return(i instanceof Promise?i:Promise.resolve(i)).then(e=>(r.value=e,r));if(i instanceof Promise)throw new rB;return r.value=i,r}});function sl(e,t){return e.issues.length&&void 0===t?{issues:[],value:void 0}:e}let sd=rL("$ZodOptional",(e,t)=>{oi.init(e,t),e._zod.optin="optional",e._zod.optout="optional",rZ(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,void 0]):void 0),rZ(e._zod,"pattern",()=>{let e=t.innerType._zod.pattern;return e?RegExp(`^(${rG(e.source)})?$`):void 0}),e._zod.parse=(e,r)=>{if("optional"===t.innerType._zod.optin){let n=t.innerType._zod.run(e,r);return n instanceof Promise?n.then(t=>sl(t,e.value)):sl(n,e.value)}return void 0===e.value?e:t.innerType._zod.run(e,r)}}),sf=rL("$ZodExactOptional",(e,t)=>{sd.init(e,t),rZ(e._zod,"values",()=>t.innerType._zod.values),rZ(e._zod,"pattern",()=>t.innerType._zod.pattern),e._zod.parse=(e,r)=>t.innerType._zod.run(e,r)}),sh=rL("$ZodNullable",(e,t)=>{oi.init(e,t),rZ(e._zod,"optin",()=>t.innerType._zod.optin),rZ(e._zod,"optout",()=>t.innerType._zod.optout),rZ(e._zod,"pattern",()=>{let e=t.innerType._zod.pattern;return e?RegExp(`^(${rG(e.source)}|null)$`):void 0}),rZ(e._zod,"values",()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,null]):void 0),e._zod.parse=(e,r)=>null===e.value?e:t.innerType._zod.run(e,r)}),sp=rL("$ZodDefault",(e,t)=>{oi.init(e,t),e._zod.optin="optional",rZ(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(e,r)=>{if("backward"===r.direction)return t.innerType._zod.run(e,r);if(void 0===e.value)return e.value=t.defaultValue,e;let n=t.innerType._zod.run(e,r);return n instanceof Promise?n.then(e=>sy(e,t)):sy(n,t)}});function sy(e,t){return void 0===e.value&&(e.value=t.defaultValue),e}let sg=rL("$ZodPrefault",(e,t)=>{oi.init(e,t),e._zod.optin="optional",rZ(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(e,r)=>("backward"===r.direction||void 0===e.value&&(e.value=t.defaultValue),t.innerType._zod.run(e,r))}),sm=rL("$ZodNonOptional",(e,t)=>{oi.init(e,t),rZ(e._zod,"values",()=>{let e=t.innerType._zod.values;return e?new Set([...e].filter(e=>void 0!==e)):void 0}),e._zod.parse=(r,n)=>{let i=t.innerType._zod.run(r,n);return i instanceof Promise?i.then(t=>sb(t,e)):sb(i,e)}});
76function sb(e,t){return e.issues.length||void 0!==e.value||e.issues.push({code:"invalid_type",expected:"nonoptional",input:e.value,inst:t}),e}let sv=rL("$ZodSuccess",(e,t)=>{oi.init(e,t),e._zod.parse=(e,r)=>{if("backward"===r.direction)throw new rU("ZodSuccess");let n=t.innerType._zod.run(e,r);return n instanceof Promise?n.then(t=>(e.value=0===t.issues.length,e)):(e.value=0===n.issues.length,e)}}),sw=rL("$ZodCatch",(e,t)=>{oi.init(e,t),rZ(e._zod,"optin",()=>t.innerType._zod.optin),rZ(e._zod,"optout",()=>t.innerType._zod.optout),rZ(e._zod,"values",()=>t.innerType._zod.values),e._zod.parse=(e,r)=>{if("backward"===r.direction)return t.innerType._zod.run(e,r);let n=t.innerType._zod.run(e,r);return n instanceof Promise?n.then(n=>(e.value=n.value,n.issues.length&&(e.value=t.catchValue({...e,error:{issues:n.issues.map(e=>ny(e,r,rK()))},input:e.value}),e.issues=[]),e)):(e.value=n.value,n.issues.length&&(e.value=t.catchValue({...e,error:{issues:n.issues.map(e=>ny(e,r,rK()))},input:e.value}),e.issues=[]),e)}}),s_=rL("$ZodNaN",(e,t)=>{oi.init(e,t),e._zod.parse=(t,r)=>("number"==typeof t.value&&Number.isNaN(t.value)||t.issues.push({input:t.value,inst:e,expected:"nan",code:"invalid_type"}),t)}),sE=rL("$ZodPipe",(e,t)=>{oi.init(e,t),rZ(e._zod,"values",()=>t.in._zod.values),rZ(e._zod,"optin",()=>t.in._zod.optin),rZ(e._zod,"optout",()=>t.out._zod.optout),rZ(e._zod,"propValues",()=>t.in._zod.propValues),e._zod.parse=(e,r)=>{if("backward"===r.direction){let n=t.out._zod.run(e,r);return n instanceof Promise?n.then(e=>sS(e,t.in,r)):sS(n,t.in,r)}let n=t.in._zod.run(e,r);return n instanceof Promise?n.then(e=>sS(e,t.out,r)):sS(n,t.out,r)}});function sS(e,t,r){return e.issues.length?(e.aborted=!0,e):t._zod.run({value:e.value,issues:e.issues},r)}let sx=rL("$ZodCodec",(e,t)=>{oi.init(e,t),rZ(e._zod,"values",()=>t.in._zod.values),rZ(e._zod,"optin",()=>t.in._zod.optin),rZ(e._zod,"optout",()=>t.out._zod.optout),rZ(e._zod,"propValues",()=>t.in._zod.propValues),e._zod.parse=(e,r)=>{if("forward"===(r.direction||"forward")){let n=t.in._zod.run(e,r);return n instanceof Promise?n.then(e=>sA(e,t,r)):sA(n,t,r)}{let n=t.out._zod.run(e,r);return n instanceof Promise?n.then(e=>sA(e,t,r)):sA(n,t,r)}}});function sA(e,t,r){if(e.issues.length)return e.aborted=!0,e;if("forward"===(r.direction||"forward")){let n=t.transform(e.value,e);return n instanceof Promise?n.then(n=>sI(e,n,t.out,r)):sI(e,n,t.out,r)}{let n=t.reverseTransform(e.value,e);return n instanceof Promise?n.then(n=>sI(e,n,t.in,r)):sI(e,n,t.in,r)}}function sI(e,t,r,n){return e.issues.length?(e.aborted=!0,e):r._zod.run({value:t,issues:e.issues},n)}let sO=rL("$ZodReadonly",(e,t)=>{oi.init(e,t),rZ(e._zod,"propValues",()=>t.innerType._zod.propValues),rZ(e._zod,"values",()=>t.innerType._zod.values),rZ(e._zod,"optin",()=>t.innerType?._zod?.optin),rZ(e._zod,"optout",()=>t.innerType?._zod?.optout),e._zod.parse=(e,r)=>{if("backward"===r.direction)return t.innerType._zod.run(e,r);let n=t.innerType._zod.run(e,r);return n instanceof Promise?n.then(sT):sT(n)}});function sT(e){return e.value=Object.freeze(e.value),e}let sP=rL("$ZodTemplateLiteral",(e,t)=>{oi.init(e,t);let r=[];for(let e of t.parts)if("object"==typeof e&&null!==e){if(!e._zod.pattern)throw Error(`Invalid template literal part, no pattern found: ${[...e._zod.traits].shift()}`);let t=e._zod.pattern instanceof RegExp?e._zod.pattern.source:e._zod.pattern;if(!t)throw Error(`Invalid template literal part: ${e._zod.traits}`);let n=t.startsWith("^")?1:0,i=t.endsWith("$")?t.length-1:t.length;r.push(t.slice(n,i))}else if(null===e||r4.has(typeof e))r.push(r9(`${e}`));else throw Error(`Invalid template literal part: ${e}`);e._zod.pattern=RegExp(`^${r.join("")}$`),e._zod.parse=(r,n)=>("string"!=typeof r.value?r.issues.push({input:r.value,inst:e,expected:"string",code:"invalid_type"}):(e._zod.pattern.lastIndex=0,e._zod.pattern.test(r.value)||r.issues.push({input:r.value,inst:e,code:"invalid_format",format:t.format??"template_literal",pattern:e._zod.pattern.source})),r)}),sM=rL("$ZodFunction",(e,t)=>(oi.init(e,t),e._def=t,e._zod.def=t,e.implement=t=>{if("function"!=typeof t)throw Error("implement() must be called with a function");return function(...r){let n=Reflect.apply(t,this,e._def.input?nI(e._def.input,r):r);return e._def.output?nI(e._def.output,n):n}},e.implementAsync=t=>{if("function"!=typeof t)throw Error("implementAsync() must be called with a function");return async function(...r){let n=e._def.input?await nT(e._def.input,r):r,i=await Reflect.apply(t,this,n);return e._def.output?await nT(e._def.output,i):i}},e._zod.parse=(t,r)=>("function"!=typeof t.value?t.issues.push({code:"invalid_type",expected:"function",input:t.value,inst:e}):e._def.output&&"promise"===e._def.output._zod.def.type?t.value=e.implementAsync(t.value):t.value=e.implement(t.value),t),e.input=(...t)=>new e.constructor(Array.isArray(t[0])?{type:"function",input:new o7({type:"tuple",items:t[0],rest:t[1]}),output:e._def.output}:{type:"function",input:t[0],output:e._def.output}),e.output=t=>new e.constructor({type:"function",input:e._def.input,output:t}),e)),sN=rL("$ZodPromise",(e,t)=>{oi.init(e,t),e._zod.parse=(e,r)=>Promise.resolve(e.value).then(e=>t.innerType._zod.run({value:e,issues:[]},r))}),sk=rL("$ZodLazy",(e,t)=>{oi.init(e,t),rZ(e._zod,"innerType",()=>t.getter()),rZ(e._zod,"pattern",()=>e._zod.innerType?._zod?.pattern),rZ(e._zod,"propValues",()=>e._zod.innerType?._zod?.propValues),rZ(e._zod,"optin",()=>e._zod.innerType?._zod?.optin??void 0),rZ(e._zod,"optout",()=>e._zod.innerType?._zod?.optout??void 0),e._zod.parse=(t,r)=>e._zod.innerType._zod.run(t,r)}),sC=rL("$ZodCustom",(e,t)=>{iF.init(e,t),oi.init(e,t),e._zod.parse=(e,t)=>e,e._zod.check=r=>{let n=r.value,i=t.fn(n);if(i instanceof Promise)return i.then(t=>sD(t,r,n,e));sD(i,r,n,e)}});function sD(e,t,r,n){if(!e){let e={code:"custom",input:r,inst:n,path:[...n._zod.def.path??[]],continue:!n._zod.def.abort};n._zod.def.params&&(e.params=n._zod.def.params),t.issues.push(nv(e))}}let sj=()=>{let e={string:{unit:"characters",verb:"to have"},file:{unit:"bytes",verb:"to have"},array:{unit:"items",verb:"to have"},set:{unit:"items",verb:"to have"},map:{unit:"entries",verb:"to have"}};function t(t){return e[t]??null}let r={regex:"input",email:"email address",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO datetime",date:"ISO date",time:"ISO time",duration:"ISO duration",ipv4:"IPv4 address",ipv6:"IPv6 address",mac:"MAC address",cidrv4:"IPv4 range",cidrv6:"IPv6 range",base64:"base64-encoded string",base64url:"base64url-encoded string",json_string:"JSON string",e164:"E.164 number",jwt:"JWT",template_literal:"input"},n={nan:"NaN"};return e=>
76{switch(e.code){case"invalid_type":{let t=n[e.expected]??e.expected,r=nb(e.input),i=n[r]??r;return`Invalid input: expected ${t}, received ${i}`}case"invalid_value":if(1===e.values.length)return`Invalid input: expected ${nt(e.values[0])}`;return`Invalid option: expected one of ${rz(e.values,"|")}`;case"too_big":{let r=e.inclusive?"<=":"<",n=t(e.origin);if(n)return`Too big: expected ${e.origin??"value"} to have ${r}${e.maximum.toString()} ${n.unit??"elements"}`;return`Too big: expected ${e.origin??"value"} to be ${r}${e.maximum.toString()}`}case"too_small":{let r=e.inclusive?">=":">",n=t(e.origin);if(n)return`Too small: expected ${e.origin} to have ${r}${e.minimum.toString()} ${n.unit}`;return`Too small: expected ${e.origin} to be ${r}${e.minimum.toString()}`}case"invalid_format":{let t=e;if("starts_with"===t.format)return`Invalid string: must start with "${t.prefix}"`;if("ends_with"===t.format)return`Invalid string: must end with "${t.suffix}"`;if("includes"===t.format)return`Invalid string: must include "${t.includes}"`;if("regex"===t.format)return`Invalid string: must match pattern ${t.pattern}`;return`Invalid ${r[t.format]??e.format}`}case"not_multiple_of":return`Invalid number: must be a multiple of ${e.divisor}`;case"unrecognized_keys":return`Unrecognized key${e.keys.length>1?"s":""}: ${rz(e.keys,", ")}`;case"invalid_key":return`Invalid key in ${e.origin}`;case"invalid_union":default:return"Invalid input";case"invalid_element":return`Invalid value in ${e.origin}`}}};function sR(){return{localeError:sj()}}Symbol("ZodOutput"),Symbol("ZodInput");class sL{constructor(){this._map=new WeakMap,this._idmap=new Map}add(e,...t){let r=t[0];return this._map.set(e,r),r&&"object"==typeof r&&"id"in r&&this._idmap.set(r.id,e),this}clear(){return this._map=new WeakMap,this._idmap=new Map,this}remove(e){let t=this._map.get(e);return t&&"object"==typeof t&&"id"in t&&this._idmap.delete(t.id),this._map.delete(e),this}get(e){let t=e._zod.parent;if(t){let r={...this.get(t)??{}};delete r.id;let n={...r,...this._map.get(e)};return Object.keys(n).length?n:void 0}return this._map.get(e)}has(e){return this._map.has(e)}}function sB(){return new sL}(i=globalThis).__zod_globalRegistry??(i.__zod_globalRegistry=sB());let sU=globalThis.__zod_globalRegistry;function s$(e,t){return new e({type:"string",...ne(t)})}function sK(e,t){return new e({type:"string",format:"email",check:"string_format",abort:!1,...ne(t)})}function sF(e,t){return new e({type:"string",format:"guid",check:"string_format",abort:!1,...ne(t)})}function sz(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,...ne(t)})}function sq(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...ne(t)})}function sV(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...ne(t)})}function sH(e,t){return new e({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...ne(t)})}function sG(e,t){return new e({type:"string",format:"url",check:"string_format",abort:!1,...ne(t)})}function sW(e,t){return new e({type:"string",format:"emoji",check:"string_format",abort:!1,...ne(t)})}function sJ(e,t){return new e({type:"string",format:"nanoid",check:"string_format",abort:!1,...ne(t)})}function sZ(e,t){return new e({type:"string",format:"cuid",check:"string_format",abort:!1,...ne(t)})}function sY(e,t){return new e({type:"string",format:"cuid2",check:"string_format",abort:!1,...ne(t)})}function sX(e,t){return new e({type:"string",format:"ulid",check:"string_format",abort:!1,...ne(t)})}function sQ(e,t){return new e({type:"string",format:"xid",check:"string_format",abort:!1,...ne(t)})}function s0(e,t){return new e({type:"string",format:"ksuid",check:"string_format",abort:!1,...ne(t)})}function s1(e,t){return new e({type:"string",format:"ipv4",check:"string_format",abort:!1,...ne(t)})}function s2(e,t){return new e({type:"string",format:"ipv6",check:"string_format",abort:!1,...ne(t)})}function s5(e,t){return new e({type:"string",format:"mac",check:"string_format",abort:!1,...ne(t)})}function s3(e,t){return new e({type:"string",format:"cidrv4",check:"string_format",abort:!1,...ne(t)})}function s8(e,t){return new e({type:"string",format:"cidrv6",check:"string_format",abort:!1,...ne(t)})}function s6(e,t){return new e({type:"string",format:"base64",check:"string_format",abort:!1,...ne(t)})}function s4(e,t){return new e({type:"string",format:"base64url",check:"string_format",abort:!1,...ne(t)})}function s9(e,t){return new e({type:"string",format:"e164",check:"string_format",abort:!1,...ne(t)})}function s7(e,t){return new e({type:"string",format:"jwt",check:"string_format",abort:!1,...ne(t)})}function ae(e,t){return new e({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...ne(t)})}function at(e,t){return new e({type:"string",format:"date",check:"string_format",...ne(t)})}function ar(e,t){return new e({type:"string",format:"time",check:"string_format",precision:null,...ne(t)})}function an(e,t){return new e({type:"string",format:"duration",check:"string_format",...ne(t)})}function ai(e,t){return new e({type:"number",checks:[],...ne(t)})}function ao(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"safeint",...ne(t)})}function as(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"float32",...ne(t)})}function aa(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"float64",...ne(t)})}function ac(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"int32",...ne(t)})}function au(e,t){return new e({type:"number",check:"number_format",abort:!1,format:"uint32",...ne(t)})}function al(e,t){return new e({type:"boolean",...ne(t)})}function ad(e,t){return new e({type:"bigint",...ne(t)})}function af(e,t){return new e({type:"bigint",check:"bigint_format",abort:!1,format:"int64",...ne(t)})}function ah(e,t){return new e({type:"bigint",check:"bigint_format",abort:!1,format:"uint64",...ne(t)})}function ap(e,t){return new e({type:"symbol",...ne(t)})}function ay(e,t){return new e({type:"undefined",...ne(t)})}function ag(e,t){return new e({type:"null",...ne(t)})}function am(e){return new e({type:"any"})}function ab(e){return new e({type:"unknown"})}function av(e,t){return new e({type:"never",...ne(t)})}function aw(e,t){return new e({type:"void",...ne(t)})}function a_(e,t){return new e({type:"date",...ne(t)})}function aE(e,t){return new e({type:"nan",...ne(t)})}function aS(e,t){return new iq({check:"less_than",...ne(t),value:e,inclusive:!1})}function ax(e,t){return new iq({check:"less_than",...ne(t),value:e,inclusive:!0})}function aA(e,t){return new iV({check:"greater_than",...ne(t),value:e,inclusive:!1})}function aI(e,t){return new iV({check:"greater_than",...ne(t),value:e,inclusive:!0})}function aO(e){return aA(0,e)}function aT(e){return aS(0,e)}function aP(e){return ax(0,e)}function aM(e){return aI(0,e)}function aN(e,t){return new iH({check:"multiple_of",...ne(t),value:e})}function ak(e,t){return new iJ({check:"max_size",...ne(t),maximum:e})}function aC(e,t){return new iZ({check:"min_size",...ne(t),minimum:e})}function aD(e,t){return new iY({check:"size_equals",...ne(t),size:e})}function aj(e,t){return new iX({check:"max_length",...ne(t),maximum:e})}function aR(e,t){return new iQ({check:"min_length",...ne(t),minimum:e})}function aL(e,t){return new i0({check:"length_equals",...ne(t),length:e})}function aB(e,t){return new i2({check:"string_format",format:"regex",...ne(t),pattern:e})}function aU(e){return new i5({check:"string_format",format:"lowercase",...ne(e)})}
76function a$(e){return new i3({check:"string_format",format:"uppercase",...ne(e)})}function aK(e,t){return new i8({check:"string_format",format:"includes",...ne(t),includes:e})}function aF(e,t){return new i6({check:"string_format",format:"starts_with",...ne(t),prefix:e})}function az(e,t){return new i4({check:"string_format",format:"ends_with",...ne(t),suffix:e})}function aq(e,t,r){return new i7({check:"property",property:e,schema:t,...ne(r)})}function aV(e,t){return new oe({check:"mime_type",mime:e,...ne(t)})}function aH(e){return new ot({check:"overwrite",tx:e})}function aG(e){return aH(t=>t.normalize(e))}function aW(){return aH(e=>e.trim())}function aJ(){return aH(e=>e.toLowerCase())}function aZ(){return aH(e=>e.toUpperCase())}function aY(){return aH(e=>r0(e))}function aX(e,t,r){return new e({type:"array",element:t,...ne(r)})}function aQ(e,t){return new e({type:"file",...ne(t)})}function a0(e,t,r){let n=ne(r);return n.abort??(n.abort=!0),new e({type:"custom",check:"custom",fn:t,...n})}function a1(e,t,r){return new e({type:"custom",check:"custom",fn:t,...ne(r)})}function a2(e){let t=a5(r=>(r.addIssue=e=>{if("string"==typeof e)r.issues.push(nv(e,r.value,t._zod.def));else{let n=e;n.fatal&&(n.continue=!1),n.code??(n.code="custom"),n.input??(n.input=r.value),n.inst??(n.inst=t),n.continue??(n.continue=!t._zod.def.abort),r.issues.push(nv(n))}},e(r.value,r)));return t}function a5(e,t){let r=new iF({check:"custom",...ne(t)});return r._zod.check=e,r}function a3(e){let t=new iF({check:"describe"});return t._zod.onattach=[t=>{let r=sU.get(t)??{};sU.add(t,{...r,description:e})}],t._zod.check=()=>{},t}function a8(e){let t=new iF({check:"meta"});return t._zod.onattach=[t=>{let r=sU.get(t)??{};sU.add(t,{...r,...e})}],t._zod.check=()=>{},t}function a6(e,t){let r=ne(t),n=r.truthy??["true","1","yes","on","y","enabled"],i=r.falsy??["false","0","no","off","n","disabled"];"sensitive"!==r.case&&(n=n.map(e=>"string"==typeof e?e.toLowerCase():e),i=i.map(e=>"string"==typeof e?e.toLowerCase():e));let o=new Set(n),s=new Set(i),a=e.Codec??sx,c=e.Boolean??oL,u=new a({type:"pipe",in:new(e.String??oo)({type:"string",error:r.error}),out:new c({type:"boolean",error:r.error}),transform:(e,t)=>{let n=e;return"sensitive"!==r.case&&(n=n.toLowerCase()),!!o.has(n)||!s.has(n)&&(t.issues.push({code:"invalid_value",expected:"stringbool",values:[...o,...s],input:t.value,inst:u,continue:!1}),{})},reverseTransform:(e,t)=>!0===e?n[0]||"true":i[0]||"false",error:r.error});return u}function a4(e,t,r,n={}){let i=ne(n),o={...ne(n),check:"string_format",type:"string",format:t,fn:"function"==typeof r?r:e=>r.test(e),...i};return r instanceof RegExp&&(o.pattern=r),new e(o)}function a9(e){let t=e?.target??"draft-2020-12";return"draft-4"===t&&(t="draft-04"),"draft-7"===t&&(t="draft-07"),{processors:e.processors??{},metadataRegistry:e?.metadata??sU,target:t,unrepresentable:e?.unrepresentable??"throw",override:e?.override??(()=>{}),io:e?.io??"output",counter:0,seen:new Map,cycles:e?.cycles??"ref",reused:e?.reused??"inline",external:e?.external??void 0}}function a7(e,t,r={path:[],schemaPath:[]}){var n;let i=e._zod.def,o=t.seen.get(e);if(o)return o.count++,r.schemaPath.includes(e)&&(o.cycle=r.path),o.schema;let s={schema:{},count:1,cycle:void 0,path:r.path};t.seen.set(e,s);let a=e._zod.toJSONSchema?.();if(a)s.schema=a;else{let n={...r,schemaPath:[...r.schemaPath,e],path:r.path};if(e._zod.processJSONSchema)e._zod.processJSONSchema(t,s.schema,n);else{let r=s.schema,o=t.processors[i.type];if(!o)throw Error(`[toJSONSchema]: Non-representable type encountered: ${i.type}`);o(e,t,r,n)}let o=e._zod.parent;o&&(s.ref||(s.ref=o),a7(o,t,n),t.seen.get(o).isParent=!0)}let c=t.metadataRegistry.get(e);return c&&Object.assign(s.schema,c),"input"===t.io&&cr(e)&&(delete s.schema.examples,delete s.schema.default),"input"===t.io&&s.schema._prefault&&((n=s.schema).default??(n.default=s.schema._prefault)),delete s.schema._prefault,t.seen.get(e).schema}function ce(e,t){let r=e.seen.get(t);if(!r)throw Error("Unprocessed schema. This is a bug in Zod.");let n=new Map;for(let t of e.seen.entries()){let r=e.metadataRegistry.get(t[0])?.id;if(r){let e=n.get(r);if(e&&e!==t[0])throw Error(`Duplicate schema id "${r}" detected during JSON Schema conversion. Two different schemas cannot share the same id when converted together.`);n.set(r,t[0])}}let i=t=>
76{let n="draft-2020-12"===e.target?"$defs":"definitions";if(e.external){let r=e.external.registry.get(t[0])?.id,i=e.external.uri??(e=>e);if(r)return{ref:i(r)};let o=t[1].defId??t[1].schema.id??`schema${e.counter++}`;return t[1].defId=o,{defId:o,ref:`${i("__shared")}#/${n}/${o}`}}if(t[1]===r)return{ref:"#"};let i="#",o=`${i}/${n}/`,s=t[1].schema.id??`__schema${e.counter++}`;return{defId:s,ref:o+s}},o=e=>{if(e[1].schema.$ref)return;let t=e[1],{ref:r,defId:n}=i(e);t.def={...t.schema},n&&(t.defId=n);let o=t.schema;for(let e in o)delete o[e];o.$ref=r};if("throw"===e.cycles)for(let t of e.seen.entries()){let e=t[1];if(e.cycle)throw Error(`Cycle detected: #/${e.cycle?.join("/")}/<root> 77 78Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(let r of e.seen.entries()){let n=r[1];if(t===r[0]){o(r);continue}if(e.external){let n=e.external.registry.get(r[0])?.id;if(t!==r[0]&&n){o(r);continue}}if(e.metadataRegistry.get(r[0])?.id||n.cycle||n.count>1&&"ref"===e.reused){o(r);continue}}}function ct(e,t){let r=e.seen.get(t);if(!r)throw Error("Unprocessed schema. This is a bug in Zod.");let n=t=>{let r=e.seen.get(t);if(null===r.ref)return;let i=r.def??r.schema,o={...i},s=r.ref;if(r.ref=null,s){n(s);let r=e.seen.get(s),a=r.schema;if(a.$ref&&("draft-07"===e.target||"draft-04"===e.target||"openapi-3.0"===e.target)?(i.allOf=i.allOf??[],i.allOf.push(a)):Object.assign(i,a),Object.assign(i,o),t._zod.parent===s)for(let e in i)"$ref"===e||"allOf"===e||e in o||delete i[e];if(a.$ref&&r.def)for(let e in i)"$ref"!==e&&"allOf"!==e&&e in r.def&&JSON.stringify(i[e])===JSON.stringify(r.def[e])&&delete i[e]}let a=t._zod.parent;if(a&&a!==s){n(a);let t=e.seen.get(a);if(t?.schema.$ref&&(i.$ref=t.schema.$ref,t.def))for(let e in i)"$ref"!==e&&"allOf"!==e&&e in t.def&&JSON.stringify(i[e])===JSON.stringify(t.def[e])&&delete i[e]}e.override({zodSchema:t,jsonSchema:i,path:r.path??[]})};for(let t of[...e.seen.entries()].reverse())n(t[0]);let i={};if("draft-2020-12"===e.target?i.$schema="https://json-schema.org/draft/2020-12/schema":"draft-07"===e.target?i.$schema="http://json-schema.org/draft-07/schema#":"draft-04"===e.target?i.$schema="http://json-schema.org/draft-04/schema#":e.target,e.external?.uri){let r=e.external.registry.get(t)?.id;if(!r)throw Error("Schema is missing an `id` property");i.$id=e.external.uri(r)}Object.assign(i,r.def??r.schema);let o=e.external?.defs??{};for(let t of e.seen.entries()){let e=t[1];e.def&&e.defId&&(o[e.defId]=e.def)}e.external||Object.keys(o).length>0&&("draft-2020-12"===e.target?i.$defs=o:i.definitions=o);try{let r=JSON.parse(JSON.stringify(i));return Object.defineProperty(r,"~standard",{value:{...t["~standard"],jsonSchema:{input:ci(t,"input",e.processors),output:ci(t,"output",e.processors)}},enumerable:!1,writable:!1}),r}catch(e){throw Error("Error converting schema to JSON.")}}function cr(e,t){let r=t??{seen:new Set};if(r.seen.has(e))return!1;r.seen.add(e);let n=e._zod.def;if("transform"===n.type)return!0;if("array"===n.type)return cr(n.element,r);if("set"===n.type)return cr(n.valueType,r);if("lazy"===n.type)return cr(n.getter(),r);if("promise"===n.type||"optional"===n.type||"nonoptional"===n.type||"nullable"===n.type||"readonly"===n.type||"default"===n.type||"prefault"===n.type)return cr(n.innerType,r);if("intersection"===n.type)return cr(n.left,r)||cr(n.right,r);if("record"===n.type||"map"===n.type)return cr(n.keyType,r)||cr(n.valueType,r);if("pipe"===n.type)return cr(n.in,r)||cr(n.out,r);if("object"===n.type){for(let e in n.shape)if(cr(n.shape[e],r))return!0;return!1}if("union"===n.type){for(let e of n.options)if(cr(e,r))return!0;return!1}if("tuple"===n.type){for(let e of n.items)if(cr(e,r))return!0;if(n.rest&&cr(n.rest,r))return!0}return!1}let cn=(e,t={})=>r=>{let n=a9({...r,processors:t});return a7(e,n),ce(n,e),ct(n,e)},ci=(e,t,r={})=>n=>{let{libraryOptions:i,target:o}=n??{},s=a9({...i??{},target:o,io:t,processors:r});return a7(e,s),ce(s,e),ct(s,e)},co={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},cs=(e,t,r,n)=>{let i=r;i.type="string";let{minimum:o,maximum:s,format:a,patterns:c,contentEncoding:u}=e._zod.bag;if("number"==typeof o&&(i.minLength=o),"number"==typeof s&&(i.maxLength=s),a&&(i.format=co[a]??a,""===i.format&&delete i.format,"time"===a&&delete i.format),u&&(i.contentEncoding=u),c&&c.size>0){let e=[...c];
781===e.length?i.pattern=e[0].source:e.length>1&&(i.allOf=[...e.map(e=>({..."draft-07"===t.target||"draft-04"===t.target||"openapi-3.0"===t.target?{type:"string"}:{},pattern:e.source}))])}},ca=(e,t,r,n)=>{let i=r,{minimum:o,maximum:s,format:a,multipleOf:c,exclusiveMaximum:u,exclusiveMinimum:l}=e._zod.bag;"string"==typeof a&&a.includes("int")?i.type="integer":i.type="number","number"==typeof l&&("draft-04"===t.target||"openapi-3.0"===t.target?(i.minimum=l,i.exclusiveMinimum=!0):i.exclusiveMinimum=l),"number"==typeof o&&(i.minimum=o,"number"==typeof l&&"draft-04"!==t.target&&(l>=o?delete i.minimum:delete i.exclusiveMinimum)),"number"==typeof u&&("draft-04"===t.target||"openapi-3.0"===t.target?(i.maximum=u,i.exclusiveMaximum=!0):i.exclusiveMaximum=u),"number"==typeof s&&(i.maximum=s,"number"==typeof u&&"draft-04"!==t.target&&(u<=s?delete i.maximum:delete i.exclusiveMaximum)),"number"==typeof c&&(i.multipleOf=c)},cc=(e,t,r,n)=>{r.type="boolean"},cu=(e,t,r,n)=>{if("throw"===t.unrepresentable)throw Error("BigInt cannot be represented in JSON Schema")},cl=(e,t,r,n)=>{if("throw"===t.unrepresentable)throw Error("Symbols cannot be represented in JSON Schema")},cd=(e,t,r,n)=>{"openapi-3.0"===t.target?(r.type="string",r.nullable=!0,r.enum=[null]):r.type="null"},cf=(e,t,r,n)=>{if("throw"===t.unrepresentable)throw Error("Undefined cannot be represented in JSON Schema")},ch=(e,t,r,n)=>{if("throw"===t.unrepresentable)throw Error("Void cannot be represented in JSON Schema")},cp=(e,t,r,n)=>{r.not={}},cy=(e,t,r,n)=>{},cg=(e,t,r,n)=>{},cm=(e,t,r,n)=>{if("throw"===t.unrepresentable)throw Error("Date cannot be represented in JSON Schema")},cb=(e,t,r,n)=>{let i=rF(e._zod.def.entries);i.every(e=>"number"==typeof e)&&(r.type="number"),i.every(e=>"string"==typeof e)&&(r.type="string"),r.enum=i},cv=(e,t,r,n)=>{let i=e._zod.def,o=[];for(let e of i.values)if(void 0===e){if("throw"===t.unrepresentable)throw Error("Literal `undefined` cannot be represented in JSON Schema")}else if("bigint"==typeof e){if("throw"===t.unrepresentable)throw Error("BigInt literals cannot be represented in JSON Schema");o.push(Number(e))}else o.push(e);if(0===o.length);else if(1===o.length){let e=o[0];r.type=null===e?"null":typeof e,"draft-04"===t.target||"openapi-3.0"===t.target?r.enum=[e]:r.const=e}else o.every(e=>"number"==typeof e)&&(r.type="number"),o.every(e=>"string"==typeof e)&&(r.type="string"),o.every(e=>"boolean"==typeof e)&&(r.type="boolean"),o.every(e=>null===e)&&(r.type="null"),r.enum=o},cw=(e,t,r,n)=>{if("throw"===t.unrepresentable)throw Error("NaN cannot be represented in JSON Schema")},c_=(e,t,r,n)=>{let i=r,o=e._zod.pattern;if(!o)throw Error("Pattern not found in template literal");i.type="string",i.pattern=o.source},cE=(e,t,r,n)=>{let i=r,o={type:"string",format:"binary",contentEncoding:"binary"},{minimum:s,maximum:a,mime:c}=e._zod.bag;void 0!==s&&(o.minLength=s),void 0!==a&&(o.maxLength=a),c?1===c.length?(o.contentMediaType=c[0],Object.assign(i,o)):(Object.assign(i,o),i.anyOf=c.map(e=>({contentMediaType:e}))):Object.assign(i,o)},cS=(e,t,r,n)=>{r.type="boolean"},cx=(e,t,r,n)=>{if("throw"===t.unrepresentable)throw Error("Custom types cannot be represented in JSON Schema")},cA=(e,t,r,n)=>{if("throw"===t.unrepresentable)throw Error("Function types cannot be represented in JSON Schema")},cI=(e,t,r,n)=>{if("throw"===t.unrepresentable)throw Error("Transforms cannot be represented in JSON Schema")},cO=(e,t,r,n)=>{if("throw"===t.unrepresentable)throw Error("Map cannot be represented in JSON Schema")},cT=(e,t,r,n)=>{if("throw"===t.unrepresentable)throw Error("Set cannot be represented in JSON Schema")},cP=(e,t,r,n)=>{let i=r,o=e._zod.def,{minimum:s,maximum:a}=e._zod.bag;"number"==typeof s&&(i.minItems=s),"number"==typeof a&&(i.maxItems=a),i.type="array",i.items=a7(o.element,t,{...n,path:[...n.path,"items"]})},cM=(e,t,r,n)=>{let i=r,o=e._zod.def;i.type="object",i.properties={};let s=o.shape;for(let e in s)i.properties[e]=a7(s[e],t,{...n,path:[...n.path,"properties",e]});let a=new Set([...new Set(Object.keys(s))].filter(e=>{let r=o.shape[e]._zod;return"input"===t.io?void 0===r.optin:void 0===r.optout}));a.size>
780&&(i.required=Array.from(a)),o.catchall?._zod.def.type==="never"?i.additionalProperties=!1:o.catchall?o.catchall&&(i.additionalProperties=a7(o.catchall,t,{...n,path:[...n.path,"additionalProperties"]})):"output"===t.io&&(i.additionalProperties=!1)},cN=(e,t,r,n)=>{let i=e._zod.def,o=!1===i.inclusive,s=i.options.map((e,r)=>a7(e,t,{...n,path:[...n.path,o?"oneOf":"anyOf",r]}));o?r.oneOf=s:r.anyOf=s},ck=(e,t,r,n)=>{let i=e._zod.def,o=a7(i.left,t,{...n,path:[...n.path,"allOf",0]}),s=a7(i.right,t,{...n,path:[...n.path,"allOf",1]}),a=e=>"allOf"in e&&1===Object.keys(e).length,c=[...a(o)?o.allOf:[o],...a(s)?s.allOf:[s]];r.allOf=c},cC=(e,t,r,n)=>{let i=r,o=e._zod.def;i.type="array";let s="draft-2020-12"===t.target?"prefixItems":"items",a="draft-2020-12"===t.target?"items":"openapi-3.0"===t.target?"items":"additionalItems",c=o.items.map((e,r)=>a7(e,t,{...n,path:[...n.path,s,r]})),u=o.rest?a7(o.rest,t,{...n,path:[...n.path,a,..."openapi-3.0"===t.target?[o.items.length]:[]]}):null;"draft-2020-12"===t.target?(i.prefixItems=c,u&&(i.items=u)):"openapi-3.0"===t.target?(i.items={anyOf:c},u&&i.items.anyOf.push(u),i.minItems=c.length,u||(i.maxItems=c.length)):(i.items=c,u&&(i.additionalItems=u));let{minimum:l,maximum:d}=e._zod.bag;"number"==typeof l&&(i.minItems=l),"number"==typeof d&&(i.maxItems=d)},cD=(e,t,r,n)=>{let i=r,o=e._zod.def;i.type="object";let s=o.keyType,a=s._zod.bag,c=a?.patterns;if("loose"===o.mode&&c&&c.size>0){let e=a7(o.valueType,t,{...n,path:[...n.path,"patternProperties","*"]});for(let t of(i.patternProperties={},c))i.patternProperties[t.source]=e}else("draft-07"===t.target||"draft-2020-12"===t.target)&&(i.propertyNames=a7(o.keyType,t,{...n,path:[...n.path,"propertyNames"]})),i.additionalProperties=a7(o.valueType,t,{...n,path:[...n.path,"additionalProperties"]});let u=s._zod.values;if(u){let e=[...u].filter(e=>"string"==typeof e||"number"==typeof e);e.length>0&&(i.required=e)}},cj=(e,t,r,n)=>{let i=e._zod.def,o=a7(i.innerType,t,n),s=t.seen.get(e);"openapi-3.0"===t.target?(s.ref=i.innerType,r.nullable=!0):r.anyOf=[o,{type:"null"}]},cR=(e,t,r,n)=>{let i=e._zod.def;a7(i.innerType,t,n),t.seen.get(e).ref=i.innerType},cL=(e,t,r,n)=>{let i=e._zod.def;a7(i.innerType,t,n),t.seen.get(e).ref=i.innerType,r.default=JSON.parse(JSON.stringify(i.defaultValue))},cB=(e,t,r,n)=>{let i=e._zod.def;a7(i.innerType,t,n),t.seen.get(e).ref=i.innerType,"input"===t.io&&(r._prefault=JSON.parse(JSON.stringify(i.defaultValue)))},cU=(e,t,r,n)=>{let i;let o=e._zod.def;a7(o.innerType,t,n),t.seen.get(e).ref=o.innerType;try{i=o.catchValue(void 0)}catch{throw Error("Dynamic catch values are not supported in JSON Schema")}r.default=i},c$=(e,t,r,n)=>{let i=e._zod.def,o="input"===t.io?"transform"===i.in._zod.def.type?i.out:i.in:i.out;a7(o,t,n),t.seen.get(e).ref=o},cK=(e,t,r,n)=>{let i=e._zod.def;a7(i.innerType,t,n),t.seen.get(e).ref=i.innerType,r.readOnly=!0},cF=(e,t,r,n)=>{let i=e._zod.def;a7(i.innerType,t,n),t.seen.get(e).ref=i.innerType},cz=(e,t,r,n)=>{let i=e._zod.def;a7(i.innerType,t,n),t.seen.get(e).ref=i.innerType},cq=(e,t,r,n)=>{let i=e._zod.innerType;a7(i,t,n),t.seen.get(e).ref=i},cV=rL("ZodISODateTime",(e,t)=>{ob.init(e,t),ua.init(e,t)});function cH(e){return ae(cV,e)}let cG=rL("ZodISODate",(e,t)=>{ov.init(e,t),ua.init(e,t)});function cW(e){return at(cG,e)}let cJ=rL("ZodISOTime",(e,t)=>{ow.init(e,t),ua.init(e,t)});function cZ(e){return ar(cJ,e)}let cY=rL("ZodISODuration",(e,t)=>{o_.init(e,t),ua.init(e,t)});function cX(e){return an(cY,e)}let cQ=(e,t)=>{n_.init(e,t),e.name="ZodError",Object.defineProperties(e,{format:{value:t=>nx(e,t)},flatten:{value:t=>nS(e,t)},addIssue:{value:t=>{e.issues.push(t),e.message=JSON.stringify(e.issues,rq,2)}},addIssues:{value:t=>{e.issues.push(...t),e.message=JSON.stringify(e.issues,rq,2)}},isEmpty:{get:()=>0===e.issues.length}})};rL("ZodError",cQ);let c0=rL("ZodError",cQ,{Parent:Error}),c1=nA(c0),c2=nO(c0),c5=nP(c0),c3=nN(c0),c8=nC(c0),c6=nD(c0),c4=nj(c0),c9=nR(c0),c7=nL(c0),ue=nB(c0),ut=nU(c0),ur=n$(c0),un=rL("ZodType",(e,t)=>(oi.init(e,t),Object.assign(e["~standard"],{jsonSchema:{input:ci(e,"input"),output:ci(e,"output")}}),e.toJSONSchema=cn(e,{}),e.def=t,e.type=t.type,Object.defineProperty(e,"_def",{value:t}),e.check=(...r)=>e.clone(rX(t,{checks:[...t.checks??[],...r.map(e=>"function"==typeof e?{_zod:{check:e,def:{check:"custom"},onattach:[]}}:e)]}),{parent:!0}),e.with=e.check,e.clone=(t,r)=>r7(e,t,r),e.brand=()=>e,e.register=(t,r)=>(t.add(e,r),e),e.parse=(t,r)=>c1(e,t,r,{callee:e.parse}),e.safeParse=(t,r)=>c5(e,t,r),e.parseAsync=async(t,r)=>c2(e,t,r,{callee:e.parseAsync}),e.safeParseAsync=async(t,r)=>c3(e,t,r),e.spa=e.safeParseAsync,e.encode=(t,r)=>c8(e,t,r),e.decode=(t,r)=>c6(e,t,r),e.encodeAsync=async(t,r)=>c4(e,t,r),e.decodeAsync=async(t,r)=>c9(e,t,r),e.safeEncode=(t,r)=>c7(e,t,r),e.safeDecode=(t,r)=>ue(e,t,r),e.safeEncodeAsync=async(t,r)=>ut(e,t,r),e.safeDecodeAsync=async(t,r)=>ur(e,t,r),e.refine=(t,r)=>e.check(dN(t,r)),e.superRefine=t=>e.check(dk(t)),e.overwrite=t=>
vendor: 7,503 bytes, line 78
78e.check(aH(t)),e.optional=()=>l8(e),e.exactOptional=()=>l4(e),e.nullable=()=>l7(e),e.nullish=()=>l8(l7(e)),e.nonoptional=t=>da(e,t),e.array=()=>lA(e),e.or=t=>lk([e,t]),e.and=t=>lB(e,t),e.transform=t=>dy(e,l5(t)),e.default=t=>dr(e,t),e.prefault=t=>di(e,t),e.catch=t=>dd(e,t),e.pipe=t=>dy(e,t),e.readonly=()=>dv(e),e.describe=t=>{let r=e.clone();return sU.add(r,{description:t}),r},Object.defineProperty(e,"description",{get:()=>sU.get(e)?.description,configurable:!0}),e.meta=(...t)=>{if(0===t.length)return sU.get(e);let r=e.clone();return sU.add(r,t[0]),r},e.isOptional=()=>e.safeParse(void 0).success,e.isNullable=()=>e.safeParse(null).success,e.apply=t=>t(e),e)),ui=rL("_ZodString",(e,t)=>{oo.init(e,t),un.init(e,t),e._zod.processJSONSchema=(t,r,n)=>cs(e,t,r,n);let r=e._zod.bag;e.format=r.format??null,e.minLength=r.minimum??null,e.maxLength=r.maximum??null,e.regex=(...t)=>e.check(aB(...t)),e.includes=(...t)=>e.check(aK(...t)),e.startsWith=(...t)=>e.check(aF(...t)),e.endsWith=(...t)=>e.check(az(...t)),e.min=(...t)=>e.check(aR(...t)),e.max=(...t)=>e.check(aj(...t)),e.length=(...t)=>e.check(aL(...t)),e.nonempty=(...t)=>e.check(aR(1,...t)),e.lowercase=t=>e.check(aU(t)),e.uppercase=t=>e.check(a$(t)),e.trim=()=>e.check(aW()),e.normalize=(...t)=>e.check(aG(...t)),e.toLowerCase=()=>e.check(aJ()),e.toUpperCase=()=>e.check(aZ()),e.slugify=()=>e.check(aY())}),uo=rL("ZodString",(e,t)=>{oo.init(e,t),ui.init(e,t),e.email=t=>e.check(sK(uc,t)),e.url=t=>e.check(sG(um,t)),e.jwt=t=>e.check(s7(uZ,t)),e.emoji=t=>e.check(sW(uw,t)),e.guid=t=>e.check(sF(ul,t)),e.uuid=t=>e.check(sz(uf,t)),e.uuidv4=t=>e.check(sq(uf,t)),e.uuidv6=t=>e.check(sV(uf,t)),e.uuidv7=t=>e.check(sH(uf,t)),e.nanoid=t=>e.check(sJ(uE,t)),e.guid=t=>e.check(sF(ul,t)),e.cuid=t=>e.check(sZ(ux,t)),e.cuid2=t=>e.check(sY(uI,t)),e.ulid=t=>e.check(sX(uT,t)),e.base64=t=>e.check(s6(uq,t)),e.base64url=t=>e.check(s4(uH,t)),e.xid=t=>e.check(sQ(uM,t)),e.ksuid=t=>e.check(s0(uk,t)),e.ipv4=t=>e.check(s1(uD,t)),e.ipv6=t=>e.check(s2(uB,t)),e.cidrv4=t=>e.check(s3(u$,t)),e.cidrv6=t=>e.check(s8(uF,t)),e.e164=t=>e.check(s9(uW,t)),e.datetime=t=>e.check(cH(t)),e.date=t=>e.check(cW(t)),e.time=t=>e.check(cZ(t)),e.duration=t=>e.check(cX(t))});function us(e){return s$(uo,e)}let ua=rL("ZodStringFormat",(e,t)=>{os.init(e,t),ui.init(e,t)}),uc=rL("ZodEmail",(e,t)=>{ou.init(e,t),ua.init(e,t)});function uu(e){return sK(uc,e)}let ul=rL("ZodGUID",(e,t)=>{oa.init(e,t),ua.init(e,t)});function ud(e){return sF(ul,e)}let uf=rL("ZodUUID",(e,t)=>{oc.init(e,t),ua.init(e,t)});function uh(e){return sz(uf,e)}function up(e){return sq(uf,e)}function uy(e){return sV(uf,e)}function ug(e){return sH(uf,e)}let um=rL("ZodURL",(e,t)=>{ol.init(e,t),ua.init(e,t)});function ub(e){return sG(um,e)}function uv(e){return sG(um,{protocol:/^https?$/,hostname:ia,...ne(e)})}let uw=rL("ZodEmoji",(e,t)=>{od.init(e,t),ua.init(e,t)});function u_(e){return sW(uw,e)}let uE=rL("ZodNanoID",(e,t)=>{of.init(e,t),ua.init(e,t)});function uS(e){return sJ(uE,e)}let ux=rL("ZodCUID",(e,t)=>{oh.init(e,t),ua.init(e,t)});function uA(e){return sZ(ux,e)}let uI=rL("ZodCUID2",(e,t)=>{op.init(e,t),ua.init(e,t)});function uO(e){return sY(uI,e)}let uT=rL("ZodULID",(e,t)=>{oy.init(e,t),ua.init(e,t)});function uP(e){return sX(uT,e)}let uM=rL("ZodXID",(e,t)=>{og.init(e,t),ua.init(e,t)});function uN(e){return sQ(uM,e)}let uk=rL("ZodKSUID",(e,t)=>{om.init(e,t),ua.init(e,t)});function uC(e){return s0(uk,e)}let uD=rL("ZodIPv4",(e,t)=>{oE.init(e,t),ua.init(e,t)});function uj(e){return s1(uD,e)}let uR=rL("ZodMAC",(e,t)=>{ox.init(e,t),ua.init(e,t)});function uL(e){return s5(uR,e)}let uB=rL("ZodIPv6",(e,t)=>{oS.init(e,t),ua.init(e,t)});function uU(e){return s2(uB,e)}let u$=rL("ZodCIDRv4",(e,t)=>{oA.init(e,t),ua.init(e,t)});function uK(e){return s3(u$,e)}let uF=rL("ZodCIDRv6",(e,t)=>{oI.init(e,t),ua.init(e,t)});function uz(e){return s8(uF,e)}let uq=rL("ZodBase64",(e,t)=>{oT.init(e,t),ua.init(e,t)});function uV(e){return s6(uq,e)}let uH=rL("ZodBase64URL",(e,t)=>{oM.init(e,t),ua.init(e,t)});function uG(e){return s4(uH,e)}let uW=rL("ZodE164",(e,t)=>{oN.init(e,t),ua.init(e,t)});function uJ(e){return s9(uW,e)}let uZ=rL("ZodJWT",(e,t)=>{oC.init(e,t),ua.init(e,t)});function uY(e){return s7(uZ,e)}let uX=rL("ZodCustomStringFormat",(e,t)=>{oD.init(e,t),ua.init(e,t)});function uQ(e,t,r={}){return a4(uX,e,t,r)}function u0(e){return a4(uX,"hostname",is,e)}function u1(e){return a4(uX,"hex",ix,e)}function u2(e,t){let r=t?.enc??"hex",n=`${e}_${r}`,i=y[n];if(!i)throw Error(`Unrecognized hash format: ${n}`);return a4(uX,n,i,t)}let u5=rL("ZodNumber",(e,t)=>{oj.init(e,t),un.init(e,t),e._zod.processJSONSchema=(t,r,n)=>ca(e,t,r,n),e.gt=(t,r)=>e.check(aA(t,r)),e.gte=(t,r)=>e.check(aI(t,r)),e.min=(t,r)=>e.check(aI(t,r)),e.lt=(t,r)=>e.check(aS(t,r)),e.lte=(t,r)=>e.check(ax(t,r)),e.max=(t,r)=>e.check(ax(t,r)),e.int=t=>e.check(u6(t)),e.safe=t=>e.check(u6(t)),e.positive=t=>e.check(aA(0,t)),e.nonnegative=t=>e.check(aI(0,t)),e.negative=t=>e.check(aS(0,t)),e.nonpositive=t=>e.check(ax(0,t)),e.multipleOf=(t,r)=>e.check(aN(t,r)),e.step=(t,r)=>e.check(aN(t,r)),e.finite=()=>e;let r=e._zod.bag;e.minValue=Math.max(r.minimum??Number.NEGATIVE_INFINITY,r.exclusiveMinimum??Number.NEGATIVE_INFINITY)??null,e.maxValue=Math.min(r.maximum??Number.POSITIVE_INFINITY,r.exclusiveMaximum??Number.POSITIVE_INFINITY)??null,e.isInt=(r.format??"").includes("int")||Number.isSafeInteger(r.multipleOf??.5),e.isFinite=!0,e.format=r.format??null});function u3(e){return ai(u5,e)}let u8=rL("ZodNumberFormat",(e,t)=>{oR.init(e,t),u5.init(e,t)});function u6(e){return ao(u8,e)}function u4(e){return as(u8,e)}function u9(e){return aa(u8,e)}function u7(e){return ac(u8,e)}function le(e){return au(u8,e)}let lt=rL("ZodBoolean",(e,t)=>{oL.init(e,t),un.init(e,t),e._zod.processJSONSchema=(t,r,n)=>cc(e,t,r,n)});function lr(e){return al(lt,e)}let ln=rL("ZodBigInt",(e,t)=>{oB.init(e,t),un.init(e,t),e._zod.processJSONSchema=(t,r,n)=>cu(e,t,r,n),e.gte=(t,r)=>e.check(aI(t,r)),e.min=(t,r)=>e.check(aI(t,r)),e.gt=(t,r)=>e.check(aA(t,r)),e.gte=(t,r)=>e.check(aI(t,r)),e.min=(t,r)=>e.check(aI(t,r)),e.lt=(t,r)=>e.check(aS(t,r)),e.lte=(t,r)=>e.check(ax(t,r)),e.max=(t,r)=>e.check(ax(t,r)),e.positive=t=>e.check(aA(BigInt(0),t)),e.negative=t=>e.check(aS(BigInt(0),t)),e.nonpositive=t=>e.check(ax(BigInt(0),t)),e.nonnegative=t=>e.check(aI(BigInt(0),t)),e.multipleOf=(t,r)=>e.check(aN(t,r));let r=e._zod.bag;e.minValue=r.minimum??null,e.maxValue=r.maximum??null,e.format=r.format??null});function li(e){return ad(ln,e)}let lo=rL("ZodBigIntFormat",(e,t)=>{oU.init(e,t),ln.init(e,t)});function ls(e){return af(lo,e)}function la(e){return ah(lo,e)}let lc=rL("ZodSymbol",(e,t)=>{o$.init(e,t),un.init(e,t),e._zod.processJSONSchema=(t,r,n)=>cl(e,t,r,n)});function lu(e){return ap(lc,e)}let ll=rL("ZodUndefined",(e,t)=>{oK.init(e,t),un.init(e,t),e._zod.processJSONSchema=(t,r,n)=>cf(e,t,r,n)});function ld(e){return ay(ll,e)}let lf=rL("ZodNull",(e,t)=>{oF.init(e,t),un.init(e,t),e._zod.processJSONSchema=(t,r,n)=>cd(e,t,r,n)});function lh(e){return ag(lf,e)}let lp=rL("ZodAny",(e,t)=>{oz.init(e,t),un.init(e,t),e._zod.processJSONSchema=(t,r,n)=>cy(e,t,r,n)});function ly(){return am(lp)}let lg=rL("ZodUnknown",(e,t)=>{oq.init(e,t),un.init(e,t),e._zod.processJSONSchema=(t,r,n)=>cg(e,t,r,n)});function lm(){return ab(lg)}let lb=rL("ZodNever",(e,t)=>{oV.init(e,t),un.init(e,t),e._zod.processJSONSchema=(t,r,n)=>cp(e,t,r,n)});function lv(e){return av(lb,e)}let lw=rL("ZodVoid",(e,t)=>{oH.init(e,t),un.init(e,t),e._zod.processJSONSchema=(t,r,n)=>ch(e,t,r,n)});
vendor: 4,068 bytes, line 78
78function l_(e){return aw(lw,e)}let lE=rL("ZodDate",(e,t)=>{oG.init(e,t),un.init(e,t),e._zod.processJSONSchema=(t,r,n)=>cm(e,t,r,n),e.min=(t,r)=>e.check(aI(t,r)),e.max=(t,r)=>e.check(ax(t,r));let r=e._zod.bag;e.minDate=r.minimum?new Date(r.minimum):null,e.maxDate=r.maximum?new Date(r.maximum):null});function lS(e){return a_(lE,e)}let lx=rL("ZodArray",(e,t)=>{oJ.init(e,t),un.init(e,t),e._zod.processJSONSchema=(t,r,n)=>cP(e,t,r,n),e.element=t.element,e.min=(t,r)=>e.check(aR(t,r)),e.nonempty=t=>e.check(aR(1,t)),e.max=(t,r)=>e.check(aj(t,r)),e.length=(t,r)=>e.check(aL(t,r)),e.unwrap=()=>e.element});function lA(e,t){return aX(lx,e,t)}function lI(e){return lZ(Object.keys(e._zod.def.shape))}let lO=rL("ZodObject",(e,t)=>{o0.init(e,t),un.init(e,t),e._zod.processJSONSchema=(t,r,n)=>cM(e,t,r,n),rZ(e,"shape",()=>t.shape),e.keyof=()=>lZ(Object.keys(e._zod.def.shape)),e.catchall=t=>e.clone({...e._zod.def,catchall:t}),e.passthrough=()=>e.clone({...e._zod.def,catchall:lm()}),e.loose=()=>e.clone({...e._zod.def,catchall:lm()}),e.strict=()=>e.clone({...e._zod.def,catchall:lv()}),e.strip=()=>e.clone({...e._zod.def,catchall:void 0}),e.extend=t=>na(e,t),e.safeExtend=t=>nc(e,t),e.merge=t=>nu(e,t),e.pick=t=>no(e,t),e.omit=t=>ns(e,t),e.partial=(...t)=>nl(l3,e,t[0]),e.required=(...t)=>nd(ds,e,t[0])});function lT(e,t){return new lO({type:"object",shape:e??{},...ne(t)})}function lP(e,t){return new lO({type:"object",shape:e,catchall:lv(),...ne(t)})}function lM(e,t){return new lO({type:"object",shape:e,catchall:lm(),...ne(t)})}let lN=rL("ZodUnion",(e,t)=>{o2.init(e,t),un.init(e,t),e._zod.processJSONSchema=(t,r,n)=>cN(e,t,r,n),e.options=t.options});function lk(e,t){return new lN({type:"union",options:e,...ne(t)})}let lC=rL("ZodXor",(e,t)=>{lN.init(e,t),o3.init(e,t),e._zod.processJSONSchema=(t,r,n)=>cN(e,t,r,n),e.options=t.options});function lD(e,t){return new lC({type:"union",options:e,inclusive:!1,...ne(t)})}let lj=rL("ZodDiscriminatedUnion",(e,t)=>{lN.init(e,t),o8.init(e,t)});function lR(e,t,r){return new lj({type:"union",options:t,discriminator:e,...ne(r)})}let lL=rL("ZodIntersection",(e,t)=>{o6.init(e,t),un.init(e,t),e._zod.processJSONSchema=(t,r,n)=>ck(e,t,r,n)});function lB(e,t){return new lL({type:"intersection",left:e,right:t})}let lU=rL("ZodTuple",(e,t)=>{o7.init(e,t),un.init(e,t),e._zod.processJSONSchema=(t,r,n)=>cC(e,t,r,n),e.rest=t=>e.clone({...e._zod.def,rest:t})});function l$(e,t,r){let n=t instanceof oi,i=n?r:t;return new lU({type:"tuple",items:e,rest:n?t:null,...ne(i)})}let lK=rL("ZodRecord",(e,t)=>{st.init(e,t),un.init(e,t),e._zod.processJSONSchema=(t,r,n)=>cD(e,t,r,n),e.keyType=t.keyType,e.valueType=t.valueType});function lF(e,t,r){return new lK({type:"record",keyType:e,valueType:t,...ne(r)})}function lz(e,t,r){let n=r7(e);return n._zod.values=void 0,new lK({type:"record",keyType:n,valueType:t,...ne(r)})}function lq(e,t,r){return new lK({type:"record",keyType:e,valueType:t,mode:"loose",...ne(r)})}let lV=rL("ZodMap",(e,t)=>{sr.init(e,t),un.init(e,t),e._zod.processJSONSchema=(t,r,n)=>cO(e,t,r,n),e.keyType=t.keyType,e.valueType=t.valueType,e.min=(...t)=>e.check(aC(...t)),e.nonempty=t=>e.check(aC(1,t)),e.max=(...t)=>e.check(ak(...t)),e.size=(...t)=>e.check(aD(...t))});function lH(e,t,r){return new lV({type:"map",keyType:e,valueType:t,...ne(r)})}let lG=rL("ZodSet",(e,t)=>{si.init(e,t),un.init(e,t),e._zod.processJSONSchema=(t,r,n)=>cT(e,t,r,n),e.min=(...t)=>e.check(aC(...t)),e.nonempty=t=>e.check(aC(1,t)),e.max=(...t)=>e.check(ak(...t)),e.size=(...t)=>e.check(aD(...t))});function lW(e,t){return new lG({type:"set",valueType:e,...ne(t)})}let lJ=rL("ZodEnum",(e,t)=>{ss.init(e,t),un.init(e,t),e._zod.processJSONSchema=(t,r,n)=>cb(e,t,r,n),e.enum=t.entries,e.options=Object.values(t.entries);let r=new Set(Object.keys(t.entries));e.extract=(e,n)=>{let i={};for(let n of e)if(r.has(n))i[n]=t.entries[n];else throw Error(`Key ${n} not found in enum`);return new lJ({...t,checks:[],...ne(n),entries:i})},e.exclude=(e,n)=>{let i={...t.entries};for(let t of e)if(r.has(t))delete i[t];else throw Error(`Key ${t} not found in enum`);
78return new lJ({...t,checks:[],...ne(n),entries:i})}});function lZ(e,t){return new lJ({type:"enum",entries:Array.isArray(e)?Object.fromEntries(e.map(e=>[e,e])):e,...ne(t)})}function lY(e,t){return new lJ({type:"enum",entries:e,...ne(t)})}let lX=rL("ZodLiteral",(e,t)=>{sa.init(e,t),un.init(e,t),e._zod.processJSONSchema=(t,r,n)=>cv(e,t,r,n),e.values=new Set(t.values),Object.defineProperty(e,"value",{get(){if(t.values.length>1)throw Error("This schema contains multiple valid literal values. Use `.values` instead.");return t.values[0]}})});function lQ(e,t){return new lX({type:"literal",values:Array.isArray(e)?e:[e],...ne(t)})}let l0=rL("ZodFile",(e,t)=>{sc.init(e,t),un.init(e,t),e._zod.processJSONSchema=(t,r,n)=>cE(e,t,r,n),e.min=(t,r)=>e.check(aC(t,r)),e.max=(t,r)=>e.check(ak(t,r)),e.mime=(t,r)=>e.check(aV(Array.isArray(t)?t:[t],r))});function l1(e){return aQ(l0,e)}let l2=rL("ZodTransform",(e,t)=>{su.init(e,t),un.init(e,t),e._zod.processJSONSchema=(t,r,n)=>cI(e,t,r,n),e._zod.parse=(r,n)=>{if("backward"===n.direction)throw new rU(e.constructor.name);r.addIssue=n=>{if("string"==typeof n)r.issues.push(nv(n,r.value,t));else{let t=n;t.fatal&&(t.continue=!1),t.code??(t.code="custom"),t.input??(t.input=r.value),t.inst??(t.inst=e),r.issues.push(nv(t))}};let i=t.transform(r.value,r);return i instanceof Promise?i.then(e=>(r.value=e,r)):(r.value=i,r)}});function l5(e){return new l2({type:"transform",transform:e})}let l3=rL("ZodOptional",(e,t)=>{sd.init(e,t),un.init(e,t),e._zod.processJSONSchema=(t,r,n)=>cz(e,t,r,n),e.unwrap=()=>e._zod.def.innerType});function l8(e){return new l3({type:"optional",innerType:e})}let l6=rL("ZodExactOptional",(e,t)=>{sf.init(e,t),un.init(e,t),e._zod.processJSONSchema=(t,r,n)=>cz(e,t,r,n),e.unwrap=()=>e._zod.def.innerType});function l4(e){return new l6({type:"optional",innerType:e})}let l9=rL("ZodNullable",(e,t)=>{sh.init(e,t),un.init(e,t),e._zod.processJSONSchema=(t,r,n)=>cj(e,t,r,n),e.unwrap=()=>e._zod.def.innerType});function l7(e){return new l9({type:"nullable",innerType:e})}function de(e){return l8(l7(e))}let dt=rL("ZodDefault",(e,t)=>{sp.init(e,t),un.init(e,t),e._zod.processJSONSchema=(t,r,n)=>cL(e,t,r,n),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});function dr(e,t){return new dt({type:"default",innerType:e,get defaultValue(){return"function"==typeof t?t():r8(t)}})}let dn=rL("ZodPrefault",(e,t)=>{sg.init(e,t),un.init(e,t),e._zod.processJSONSchema=(t,r,n)=>cB(e,t,r,n),e.unwrap=()=>e._zod.def.innerType});function di(e,t){return new dn({type:"prefault",innerType:e,get defaultValue(){return"function"==typeof t?t():r8(t)}})}let ds=rL("ZodNonOptional",(e,t)=>{sm.init(e,t),un.init(e,t),e._zod.processJSONSchema=(t,r,n)=>cR(e,t,r,n),e.unwrap=()=>e._zod.def.innerType});function da(e,t){return new ds({type:"nonoptional",innerType:e,...ne(t)})}let dc=rL("ZodSuccess",(e,t)=>{sv.init(e,t),un.init(e,t),e._zod.processJSONSchema=(t,r,n)=>cS(e,t,r,n),e.unwrap=()=>e._zod.def.innerType});function du(e){return new dc({type:"success",innerType:e})}let dl=rL("ZodCatch",(e,t)=>{sw.init(e,t),un.init(e,t),e._zod.processJSONSchema=(t,r,n)=>cU(e,t,r,n),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});function dd(e,t){return new dl({type:"catch",innerType:e,catchValue:"function"==typeof t?t:()=>t})}let df=rL("ZodNaN",(e,t)=>{s_.init(e,t),un.init(e,t),e._zod.processJSONSchema=(t,r,n)=>cw(e,t,r,n)});function dh(e){return aE(df,e)}let dp=rL("ZodPipe",(e,t)=>{sE.init(e,t),un.init(e,t),e._zod.processJSONSchema=(t,r,n)=>c$(e,t,r,n),e.in=t.in,e.out=t.out});function dy(e,t){return new dp({type:"pipe",in:e,out:t})}let dg=rL("ZodCodec",(e,t)=>{dp.init(e,t),sx.init(e,t)});function dm(e,t,r){return new dg({type:"pipe",in:e,out:t,transform:r.decode,reverseTransform:r.encode})}let db=rL("ZodReadonly",(e,t)=>{sO.init(e,t),un.init(e,t),e._zod.processJSONSchema=(t,r,n)=>cK(e,t,r,n),e.unwrap=()=>e._zod.def.innerType});function dv(e){return new db({type:"readonly",innerType:e})}let dw=rL("ZodTemplateLiteral",(e,t)=>{sP.init(e,t),un.init(e,t),e._zod.processJSONSchema=(t,r,n)=>c_(e,t,r,n)});function d_(e,t){return new dw({type:"template_literal",parts:e,...ne(t)})}let dE=rL("ZodLazy",(e,t)=>{sk.init(e,t),un.init(e,t),e._zod.processJSONSchema=(t,r,n)=>cq(e,t,r,n),e.unwrap=()=>e._zod.def.getter()});function dS(e){return new dE({type:"lazy",getter:e})}let dx=rL("ZodPromise",(e,t)=>{sN.init(e,t),un.init(e,t),e._zod.processJSONSchema=(t,r,n)=>cF(e,t,r,n),e.unwrap=()=>e._zod.def.innerType});function dA(e){return new dx({type:"promise",innerType:e})}let dI=rL("ZodFunction",(e,t)=>{sM.init(e,t),un.init(e,t),e._zod.processJSONSchema=(t,r,n)=>cA(e,t,r,n)});function dO(e){return new dI({type:"function",input:Array.isArray(e?.input)?l$(e?.input):e?.input??lA(lm()),output:e?.output??lm()})}let dT=rL("ZodCustom",(e,t)=>{sC.init(e,t),un.init(e,t),e._zod.processJSONSchema=(t,r,n)=>cx(e,t,r,n)});function dP(e){let t=new iF({check:"custom"});return t._zod.check=e,t}function dM(e,t){return a0(dT,e??(()=>!0),t)}function dN(e,t={}){return a1(dT,e,t)}function dk(e){return a2(e)}let dC=a3,dD=a8;function dj(e,t={}){let r=new dT({type:"custom",check:"custom",fn:t=>t instanceof e,abort:!0,...ne(t)});return r._zod.bag.Class=e,r._zod.check=t=>{t.value instanceof e||t.issues.push({code:"invalid_type",expected:e.name,input:t.value,inst:r,path:[...r._zod.def.path??[]]})},r}let dR=(...e)=>a6({Codec:dg,Boolean:lt,String:uo},...e);function dL(e){let t=dS(()=>lk([us(e),u3(),lr(),lh(),lA(t),lF(us(),t)]));return t}function dB(e,t){return dy(l5(e),t)}o||(o={});let dU={...b,...g,iso:m},d$=new Set(["$schema","$ref","$defs","definitions","$id","id","$comment","$anchor","$vocabulary","$dynamicRef","$dynamicAnchor","type","enum","const","anyOf","oneOf","allOf","not","properties","required","additionalProperties","patternProperties","propertyNames","minProperties","maxProperties","items","prefixItems","additionalItems","minItems","maxItems","uniqueItems","contains","minContains","maxContains","minLength","maxLength","pattern","format","minimum","maximum","exclusiveMinimum","exclusiveMaximum","multipleOf","description","default","contentEncoding","contentMediaType","contentSchema","unevaluatedItems","unevaluatedProperties","if","then","else","dependentSchemas","dependentRequired","nullable","readOnly"]);function dK(e,t){if(!e.startsWith("#"))throw Error("External $ref is not supported, only local refs (#/...) are allowed");
78let r=e.slice(1).split("/").filter(Boolean);if(0===r.length)return t.rootSchema;let n="draft-2020-12"===t.version?"$defs":"definitions";if(r[0]===n){let n=r[1];if(!n||!t.defs[n])throw Error(`Reference not found: ${e}`);return t.defs[n]}throw Error(`Reference not found: ${e}`)}function dF(e,t){let r;if(void 0!==e.not){if("object"==typeof e.not&&0===Object.keys(e.not).length)return dU.never();throw Error("not is not supported in Zod (except { not: {} } for never)")}if(void 0!==e.unevaluatedItems)throw Error("unevaluatedItems is not supported");if(void 0!==e.unevaluatedProperties)throw Error("unevaluatedProperties is not supported");if(void 0!==e.if||void 0!==e.then||void 0!==e.else)throw Error("Conditional schemas (if/then/else) are not supported");if(void 0!==e.dependentSchemas||void 0!==e.dependentRequired)throw Error("dependentSchemas and dependentRequired are not supported");if(e.$ref){let r=e.$ref;if(t.refs.has(r))return t.refs.get(r);if(t.processing.has(r))return dU.lazy(()=>{if(!t.refs.has(r))throw Error(`Circular reference not resolved: ${r}`);return t.refs.get(r)});t.processing.add(r);let n=dz(dK(r,t),t);return t.refs.set(r,n),t.processing.delete(r),n}if(void 0!==e.enum){let r=e.enum;if("openapi-3.0"===t.version&&!0===e.nullable&&1===r.length&&null===r[0])return dU.null();if(0===r.length)return dU.never();if(1===r.length)return dU.literal(r[0]);if(r.every(e=>"string"==typeof e))return dU.enum(r);let n=r.map(e=>dU.literal(e));return n.length<2?n[0]:dU.union([n[0],n[1],...n.slice(2)])}if(void 0!==e.const)return dU.literal(e.const);let n=e.type;if(Array.isArray(n)){let r=n.map(r=>dF({...e,type:r},t));return 0===r.length?dU.never():1===r.length?r[0]:dU.union(r)}if(!n)return dU.any();switch(n){case"string":{let t=dU.string();if(e.format){let r=e.format;"email"===r?t=t.check(dU.email()):"uri"===r||"uri-reference"===r?t=t.check(dU.url()):"uuid"===r||"guid"===r?t=t.check(dU.uuid()):"date-time"===r?t=t.check(dU.iso.datetime()):"date"===r?t=t.check(dU.iso.date()):"time"===r?t=t.check(dU.iso.time()):"duration"===r?t=t.check(dU.iso.duration()):"ipv4"===r?t=t.check(dU.ipv4()):"ipv6"===r?t=t.check(dU.ipv6()):"mac"===r?t=t.check(dU.mac()):"cidr"===r?t=t.check(dU.cidrv4()):"cidr-v6"===r?t=t.check(dU.cidrv6()):"base64"===r?t=t.check(dU.base64()):"base64url"===r?t=t.check(dU.base64url()):"e164"===r?t=t.check(dU.e164()):"jwt"===r?t=t.check(dU.jwt()):"emoji"===r?t=t.check(dU.emoji()):"nanoid"===r?t=t.check(dU.nanoid()):"cuid"===r?t=t.check(dU.cuid()):"cuid2"===r?t=t.check(dU.cuid2()):"ulid"===r?t=t.check(dU.ulid()):"xid"===r?t=t.check(dU.xid()):"ksuid"===r&&(t=t.check(dU.ksuid()))}"number"==typeof e.minLength&&(t=t.min(e.minLength)),"number"==typeof e.maxLength&&(t=t.max(e.maxLength)),e.pattern&&(t=t.regex(new RegExp(e.pattern))),r=t;break}case"number":case"integer":{let t="integer"===n?dU.number().int():dU.number();"number"==typeof e.minimum&&(t=t.min(e.minimum)),"number"==typeof e.maximum&&(t=t.max(e.maximum)),"number"==typeof e.exclusiveMinimum?t=t.gt(e.exclusiveMinimum):!0===e.exclusiveMinimum&&"number"==typeof e.minimum&&(t=t.gt(e.minimum)),"number"==typeof e.exclusiveMaximum?t=t.lt(e.exclusiveMaximum):!0===e.exclusiveMaximum&&"number"==typeof e.maximum&&(t=t.lt(e.maximum)),"number"==typeof e.multipleOf&&(t=t.multipleOf(e.multipleOf)),r=t;break}case"boolean":r=dU.boolean();break;case"null":r=dU.null();break;case"object":{let n={},i=e.properties||{},o=new Set(e.required||[]);for(let[e,r]of Object.entries(i)){let i=dz(r,t);n[e]=o.has(e)?i:i.optional()}if(e.propertyNames){let i=dz(e.propertyNames,t),o=e.additionalProperties&&"object"==typeof e.additionalProperties?dz(e.additionalProperties,t):dU.any();if(0===Object.keys(n).length){r=dU.record(i,o);break}let s=dU.object(n).passthrough(),a=dU.looseRecord(i,o);r=dU.intersection(s,a);break}if(e.patternProperties){let i=e.patternProperties,o=Object.keys(i),s=[];for(let e of o){let r=dz(i[e],t),n=dU.string().regex(new RegExp(e));s.push(dU.looseRecord(n,r))}let a=[];if(Object.keys(n).length>0&&a.push(dU.object(n).passthrough()),a.push(...s),0===a.length)r=dU.object({}).passthrough();else if(1===a.length)r=a[0];else{let e=dU.intersection(a[0],a[1]);for(let t=2;t<a.length;t++)e=dU.intersection(e,a[t]);r=e}break}let s=dU.object(n);r=!1===e.additionalProperties?s.strict():"object"==typeof e.additionalProperties?s.catchall(dz(e.additionalProperties,t)):s.passthrough();break}case"array":{let n=e.prefixItems,i=e.items;if(n&&Array.isArray(n)){let o=n.map(e=>dz(e,t)),s=i&&"object"==typeof i&&!Array.isArray(i)?dz(i,t):void 0;r=s?dU.tuple(o).rest(s):dU.tuple(o),"number"==typeof e.minItems&&(r=r.check(dU.minLength(e.minItems))),"number"==typeof e.maxItems&&(r=r.check(dU.maxLength(e.maxItems)))}else if(Array.isArray(i)){let n=i.map(e=>dz(e,t)),o=e.additionalItems&&"object"==typeof e.additionalItems?dz(e.additionalItems,t):void 0;r=o?dU.tuple(n).rest(o):dU.tuple(n),"number"==typeof e.minItems&&(r=r.check(dU.minLength(e.minItems))),"number"==typeof e.maxItems&&(r=r.check(dU.maxLength(e.maxItems)))}else if(void 0!==i){let n=dz(i,t),o=dU.array(n);"number"==typeof e.minItems&&(o=o.min(e.minItems)),"number"==typeof e.maxItems&&(o=o.max(e.maxItems)),r=o}else r=dU.array(dU.any());break}default:throw Error(`Unsupported type: ${n}`)}return e.description&&(r=r.describe(e.description)),void 0!==e.default&&(r=r.default(e.default)),r}function dz(e,t){if("boolean"==typeof e)return e?dU.any():dU.never();let r=dF(e,t),n=e.type||void 0!==e.enum||void 0!==e.const;if(e.anyOf&&Array.isArray(e.anyOf)){let i=e.anyOf.map(e=>dz(e,t)),o=dU.union(i);r=n?dU.intersection(r,o):o}if(e.oneOf&&Array.isArray(e.oneOf)){let i=e.oneOf.map(e=>dz(e,t)),o=dU.xor(i);r=n?dU.intersection(r,o):o}if(e.allOf&&Array.isArray(e.allOf)){if(0===e.allOf.length)r=n?r:dU.any();
78else{let i=n?r:dz(e.allOf[0],t),o=n?0:1;for(let r=o;r<e.allOf.length;r++)i=dU.intersection(i,dz(e.allOf[r],t));r=i}}!0===e.nullable&&"openapi-3.0"===t.version&&(r=dU.nullable(r)),!0===e.readOnly&&(r=dU.readonly(r));let i={};for(let t of["$id","id","$comment","$anchor","$vocabulary","$dynamicRef","$dynamicAnchor"])t in e&&(i[t]=e[t]);for(let t of["contentEncoding","contentMediaType","contentSchema"])t in e&&(i[t]=e[t]);for(let t of Object.keys(e))d$.has(t)||(i[t]=e[t]);return Object.keys(i).length>0&&t.registry.add(r,i),r}rK(sR());let dq="useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict",dV=(e=21)=>{let t="",r=crypto.getRandomValues(new Uint8Array(e|=0));for(;e--;)t+=dq[63&r[e]];return t};var dH=r(65155),dG=r(75927).Buffer;let dW=function(e){return e.login="login",e.sign="sign",e.logout="logout",e.verify_owner="verify_owner",e.keypom_claim="keypom_claim",e.sign_message="sign_message",e}({}),dJ=function(e){return e.ALL_METHODS="ALL_METHODS",e.SELECTED_METHODS="SELECTED_METHODS",e.FULL_ACCESS="FULL_ACCESS",e}({}),dZ=function(e){return e.website_callback="wcb",e.website_post_message="wpm",e.website_visit="wv",e.extension_injected="ext",e}({}),dY=function(e){return e.initializing="initializing",e.connected="connected",e.attempting_reconnect="attempting_reconnect",e.disconnected="disconnected",e.closed_success="closed_success",e.closed_fail="closed_fail",e.closed_window="closed_window",e}({}),dX=function(e){return e.localnet="localnet",e.testnet="testnet",e.betanet="betanet",e.mainnet="mainnet",e}({}),dQ=lT({contract_id:us(),public_key:us()}),d0=dQ.merge(lT({type:lQ(dJ.SELECTED_METHODS),methods:lA(us()).min(1)})),d1=dQ.merge(lT({type:lQ(dJ.ALL_METHODS),methods:ld().optional()}));d0.or(d1),lT({callback_url:us().min(2),transactions:us().min(2),meta:us().optional()});let d2=function(e){return e.NEW_ACTION_STARTED="NEW_ACTION_STARTED",e.INCOMPLETE_ACTION="INCOMPLETE_ACTION",e.NO_ACCOUNTS="NO_ACCOUNTS",e.WINDOW_CLOSED="WINDOW_CLOSED",e.USER_CANCELLED="USER_CANCELLED",e.POPUP_WINDOW_REFUSED="POPUP_WINDOW_REFUSED",e.POPUP_WINDOW_OPEN_FAILED="POPUP_WINDOW_OPEN_FAILED",e}({}),d5={[d2.WINDOW_CLOSED]:"User closed the window",[d2.INCOMPLETE_ACTION]:"User didn't complete the action",[d2.NEW_ACTION_STARTED]:"A new action was started by the user, old action failed",[d2.POPUP_WINDOW_OPEN_FAILED]:"Popup window failed to open",[d2.POPUP_WINDOW_REFUSED]:"User refused to allow the popup window to open",[d2.USER_CANCELLED]:"User cancelled the action",[d2.NO_ACCOUNTS]:"No Meteor account found- try again after creating one"};function d3(e){return d5[e]??"An unknown error occurred"}var d8=class extends Error{_reason;cause;constructor(e,t){super(),null==e.message&&(e.message=d3(e.endTags?.[e.endTags.length-1]??"unknown")),this._reason=e,this.message=e.message,this.name="MeteorActionError",this.cause=t}};dX.testnet,dX.mainnet,dX.localnet,dX.betanet;let d6={networkId:dX.testnet,name:"Fastnear Testnet",nodeUrl:"https://test.rpc.fastnear.com",archivalUrl:"https://archival-rpc.testnet.near.org",helperUrl:"https://helper.testnet.near.org",explorerUrl:"https://explorer.testnet.near.org"},d4={networkId:dX.betanet,name:"Fastnear Betanet",nodeUrl:"https://rpc.betanet.near.org",helperUrl:"https://helper.betanet.near.org",explorerUrl:"https://explorer.betanet.near.org"},d9={networkId:dX.mainnet,name:"Fastnear Mainnet",nodeUrl:"https://mw.rpc.fastnear.com",archivalUrl:"https://archival-rpc.mainnet.near.org",helperUrl:"https://helper.mainnet.near.org",explorerUrl:"https://explorer.mainnet.near.org"},d7={networkId:dX.localnet,name:"Localnet",nodeUrl:"http://localhost:3001",walletUrl:"http://localhost:3001/wallet"},fe={[dX.localnet]:d7,[dX.testnet]:d6,[dX.betanet]:d4,[dX.mainnet]:d9};var ft=class{implementation;constructor(e){this.implementation=e}setJson(e,t){this.implementation.setString(e,JSON.stringify(t))}getJson(e){let t=this.implementation.getString(e);if(null!=t&&"undefined"!==t&&"null"!==t)return JSON.parse(t)}setString(e,t){this.implementation.setString(e,t)}getString(e){let t=this.implementation.getString(e);if(null!=t)return t}clear(e){this.implementation.clear(e)}createJsonGetterSetter(e){return{get:()=>this.getJson(e),set:t=>this.setJson(e,t)}}createStringGetterSetter(e){return{get:()=>this.getString(e),set:t=>this.setString(e,t)}}};let fr=e=>null!=e&&e.length>0,fn="https://wallet.meteorwallet.app",fi={wallet_base_url:("undefined"!=typeof window?window.localStorage.getItem("DEV__METEOR_WALLET_BASE_URL"):void 0)??fn},fo=390,fs=650;var fa=class{comType;websiteWindow;wasOpened;walletOrigin;constructor(e,t){let r=fi.wallet_base_url,n=new URL(r);if(this.walletOrigin=n.origin,null==window.meteorCom){this.comType=dZ.website_post_message,console.log("No extension found. Need to connect to web popup for Meteor communication");let n={source:dZ.website_post_message,connectionUid:e.uid,pageUri:encodeURIComponent(window.location.href)},i=fo,o=fs,s=window.top.outerHeight/2+window.top.screenY-o/2,a=window.top.outerWidth/2+window.top.screenX-i/2,c=window.open(`${r}/connect/${e.network}/${e.actionType}?${(0,dH.stringify)(n)}`,"_blank",`popup=1,width=${i},height=${o},top=${s},left=${a}`);if(null!=c)this.websiteWindow=c;else throw new d8({message:"Couldn't open popup window to complete wallet action",endTags:[d2.POPUP_WINDOW_OPEN_FAILED]});window.addEventListener("message",e=>t(e.data)),this.wasOpened=!1}
78else this.comType=dZ.extension_injected,this.wasOpened=!0,window.meteorCom.addMessageDataListener(t)}focus(){this.comType===dZ.website_post_message&&this.websiteWindow?.focus()}sendMessage(e){this.comType===dZ.website_post_message?this.websiteWindow?.postMessage(e,this.walletOrigin):window.meteorCom?.sendMessageData(e)}isWindowClosed(){return this.comType===dZ.website_post_message&&(this.websiteWindow?.closed??!0)}hasActiveWindow(){return this.comType!==dZ.website_post_message||null!=this.websiteWindow}close(){this.comType===dZ.website_post_message&&delete this.websiteWindow}};let fc=450;var fu=class{baseWalletUrl;walletOrigin;listener;connections=[];comWindow;comInterval;constructor(){let e=fi.wallet_base_url,t=new URL(e);this.baseWalletUrl=e,this.walletOrigin=t.origin,this.listener=e=>{if(null!=e){let t=this.connections.find(t=>t.uid===e.uid);null!=t&&(this.updateConnection(t.uid,{lastConnection:Date.now()}),e.status===dY.attempting_reconnect&&(this.updateConnection(t.uid,{status:dY.initializing}),this.sendComs()),e.status===dY.connected&&t.status===dY.initializing&&this.updateConnection(t.uid,{status:dY.connected}),e.status===dY.closed_success&&(t.resolve({success:!0,endTags:[],payload:e.payload}),this.updateConnection(t.uid,{status:dY.closed_success}),this.sendComs()),e.status===dY.closed_fail&&(this.updateConnection(t.uid,{status:dY.closed_fail}),this.sendComs(),t.reject(new d8({endTags:e.endTags}))),e.status===dY.closed_window&&(this.updateConnection(t.uid,{status:dY.closed_window}),t.reject(new d8({endTags:e.endTags,message:"User closed the window"}))),[dY.disconnected,dY.closed_fail,dY.closed_window,dY.closed_success].includes(e.status)&&this.removeConnection(t.uid))}}}removeConnection(e){this.connections=this.connections.filter(t=>t.uid!==e),0===this.connections.length&&(delete this.comWindow,clearInterval(this.comInterval),delete this.comInterval)}updateConnection(e,t){this.connections=this.connections.map(r=>r.uid===e?{...r,...t,uid:r.uid}:r)}sendComs(){if(this.comWindow?.hasActiveWindow()&&this.connections.length>0){if(null==this.comInterval&&(this.comInterval=setInterval(()=>this.sendComs(),fc)),this.comWindow.isWindowClosed()){if(this.comWindow.wasOpened){for(let e of this.connections)e.reject(new d8({message:"User closed the window before completing the action",endTags:[d2.INCOMPLETE_ACTION,d2.WINDOW_CLOSED]}));this.connections=[],this.comWindow.close()}else console.log("Window is closed, need to allow popup")}else for(let{network:e,actionType:t,endTags:r,status:n,inputs:i,uid:o}of(this.comWindow.wasOpened=!0,this.connections)){let s={endTags:r,actionType:t,status:n,uid:o,network:e};n===dY.initializing&&(s.inputs=i),this.comWindow.sendMessage(s)}}else clearInterval(this.comInterval),delete this.comInterval}addAndStartConnection(e){if(this.connections.length>0)for(let e of this.connections)e.status=dY.disconnected,e.endTags=[d2.NEW_ACTION_STARTED];this.connections.push(e),null!=this.comWindow&&this.comWindow.hasActiveWindow()?this.comWindow.focus():this.comWindow=new fa(e,this.listener),this.sendComs()}async connectAndWaitForResponse({actionType:e,network:t,inputs:r}){let n={uid:dV(),actionType:e,lastAttemptedConnection:0,lastConnection:0,status:dY.initializing,promise:void 0,reject:void 0,resolve:void 0,currentPayload:{},inputs:r,network:t,endTags:[]},i=new Promise((e,t)=>{n.resolve=e,n.reject=e=>{this.connections=this.connections.filter(e=>e.uid!==n.uid),t(e)}});return n.promise=i,this.addAndStartConnection(n),await i}};function fl(){return null==n&&(n=new fu),n}let fd=e=>{if("FullAccess"===e)return eR.fullAccessKey();let{receiverId:t,methodNames:r=[]}=e,n=e.allowance?BigInt(e.allowance):void 0;return eR.functionCallAccessKey(t,r,n)},ff=e=>"string"==typeof e?dG.from(e,"base64"):e,fh=e=>{switch(e.type){case"CreateAccount":return eR.createAccount();case"DeployContract":{let{code:t}=e.params;return eR.deployContract(t)}case"FunctionCall":{let{methodName:t,args:r,gas:n,deposit:i}=e.params;return eR.functionCall(t,ff(r),BigInt(n),BigInt(i))}case"Transfer":{let{deposit:t}=e.params;return eR.transfer(BigInt(t))}case"Stake":{let{stake:t,publicKey:r}=e.params;return eR.stake(BigInt(t),ef.from(r))}case"AddKey":{let{publicKey:t,accessKey:r}=e.params;return eR.addKey(ef.from(t),fd(r.permission))}case"DeleteKey":{let{publicKey:t}=e.params;return eR.deleteKey(ef.from(t))}
78case"DeleteAccount":{let{beneficiaryId:t}=e.params;return eR.deleteAccount(t)}default:throw Error("Invalid action type")}},fp=(e,t)=>{if(t)return t;let r=fi.wallet_base_url;switch(e){case"mainnet":return`${r}/connect/mainnet`;case"testnet":return`${r}/connect/testnet`;case"betanet":return`${r}/connect/betanet`;default:throw Error("Invalid wallet URL")}},fy="add_request_and_confirm",fg="_meteor_wallet_auth_key",fm=new ft({getString:e=>window.localStorage.getItem(e),setString:(e,t)=>window.localStorage.setItem(e,t),clear:e=>window.localStorage.removeItem(e)});new ft({getString:e=>window.sessionStorage.getItem(e),setString:(e,t)=>window.sessionStorage.setItem(e,t),clear:e=>window.sessionStorage.removeItem(e)});var fb=class e{_walletBaseUrl;_authDataKey;_keyStore;_authData;_networkId;_provider;_connectedAccount;_initializationPromises=[];static async init(t){let r=new rj(window.localStorage,"_meteor_wallet"),n=new e({appKeyPrefix:"near_app",keyStore:r,...t});return n.isSignedIn()||await r.clear(),n}constructor({appKeyPrefix:e="default",keyStore:t,networkId:r,walletUrl:n,nodeUrl:i}){let o=e+fg;this._authDataKey=o,this._authData=fm.getJson(o)??{allKeys:[]},this._walletBaseUrl=fp(r,n),this._networkId=r,this._keyStore=t,this._provider=new t6({url:i??fe[r].nodeUrl})}isExtensionInstalled(){return null!=window.meteorWallet}isSignedIn(){return!!this._authData.accountId}getAccountId(){return this._authData.accountId}async verifyOwner(e){let t=e.accountId??this.getAccountId(),r=await fl().connectAndWaitForResponse({actionType:dW.verify_owner,inputs:{accountId:t,message:e.message},network:this._networkId});if(r.success)return r;throw new d8({endTags:r.endTags,message:r.message})}async requestSignIn(e){let{keyPair:t,...r}=e,n=t??tS.fromRandom("ed25519");console.log(n);let i=n.getPublicKey().toString(),o=await fl().connectAndWaitForResponse({actionType:dW.login,inputs:{public_key:i,...r},network:this._networkId});if(o.success){let{allKeys:e,accountId:t}=o.payload;return this._authData={accountId:t,allKeys:e,signedInContract:{contract_id:r.contract_id,public_key:i}},fm.setJson(this._authDataKey,this._authData),await this._keyStore.setKey(this._networkId,t,n),{success:!0,endTags:[],payload:{accessKey:n,accountId:t}}}throw new d8({endTags:o.endTags,message:o.message})}async signOut(){let e=this.getAccountId();if(null!=this._authData.signedInContract&&null!=e){let t={accountId:e,contractInfo:this._authData.signedInContract};await fl().connectAndWaitForResponse({actionType:dW.logout,inputs:t,network:this._networkId})}this._authData={allKeys:[]},fm.clear(this._authDataKey)}async signMessage({message:e,nonce:t,recipient:r,callbackUrl:n,state:i,accountId:o}){let s=await fl().connectAndWaitForResponse({actionType:dW.sign_message,inputs:{message:e,nonce:t,recipient:r,callbackUrl:n,state:i,accountId:o},network:this._networkId});if(s.success)return s.payload.state=i,s;throw new d8({endTags:s.endTags,message:s.message})}async requestSignTransactions(e){let{transactions:t}=e,r=await this.transformTransactions(t);console.log("Transformed transactions",r);let n=await fl().connectAndWaitForResponse({actionType:dW.sign,inputs:{transactions:r.map(e=>e.encode()).map(e=>dG.from(e).toString("base64")).join(",")},network:this._networkId});if(n.success)return n.payload.executionOutcomes;throw new d8({endTags:n.endTags,message:n.message})}async account(){let e=this.getAccountId();if(fr(e)&&this._connectedAccount?.accountId!==e){let t=await this._keyStore.getKey(this._networkId,e),r=tG.fromSecretKey(t.toString());this._connectedAccount=new fv(this,e,r)}if(null==this._connectedAccount)throw new d8({endTags:[],message:"No current account connected to Meteor Wallet"});return this._connectedAccount}async transformTransactions(e){let t=await this.account(),r=t.getSigner(),n=t.provider,i=await r.getPublicKey();return Promise.all(e.map(async(e,r)=>{let o=await t.accessKeyForTransaction(i);if(!o)throw Error(`Failed to find matching key for transaction sent to ${e.receiverId}`);let s=e.actions.map(e=>fh(e)),a=await n.viewBlock({finality:"final"});return ts(t.accountId,ef.from(o.public_key),e.receiverId,BigInt(o.access_key.nonce)+BigInt(r)+BigInt(1),s,rR.utils.serialize.base_decode(a.header.hash))}))}},fv=class extends rk{meteorWallet;constructor(e,t,r){super(t,e._provider,r),this.setSigner(r),this.meteorWallet=e}async signAndSendTransaction(...e){return"string"==typeof e[0]?this.signAndSendTransaction_direct({receiverId:e[0],actions:e[1]}):this.signAndSendTransaction_direct(e[0])}async trySendOrCreateTransaction({receiverId:e,actions:t}
78){let r=await this.getSigner().getPublicKey(),n=await this.accessKeyForTransaction(r);if(null!=n&&"FullAccess"!==n.access_key.permission&&!await this.accessKeyMatchesTransaction(n,e,t))return{sent:!1,transaction:{receiverId:e,signerId:this.accountId,actions:t}};if(n&&r&&r.toString()===n.public_key)try{return{executionOutcome:await super.signAndSendTransaction({receiverId:e,actions:t.map(e=>fh(e))}),sent:!0}}catch(e){if("NotEnoughAllowance"!==e.type)throw e}return{sent:!1,transaction:{receiverId:e,signerId:this.accountId,actions:t}}}async signAndSendTransaction_direct({receiverId:e,actions:t}){let{transaction:r,sent:n,executionOutcome:i}=await this.trySendOrCreateTransaction({receiverId:e,actions:t});return n?i:(await this.meteorWallet.requestSignTransactions({transactions:[r]}))[0]}async accessKeyMatchesTransaction(e,t,r){let{access_key:{permission:n}}=e;if("FullAccess"===n)return!0;if(console.log("Comparing access key and actions",{accessKey:e,receiverId:t,actions:r}),n.FunctionCall){let{receiver_id:e,method_names:i}=n.FunctionCall;if(e===t&&i.includes(fy))return!0;if(e===t){if(1!==r.length)return!1;let e=r[0];if(console.log(e),"FunctionCall"===e.type){let t=e.params;return(!t.deposit||"0"===t.deposit.toString())&&(0===i.length||i.includes(t.methodName))}}}return!1}async accessKeyForTransaction(e){let t=(await this.getAccessKeyList()).keys;if(console.log("accessKeys",t),e){let r=t.find(t=>t.public_key.toString()===e.toString());if(r)return r}let r=this.meteorWallet._authData.allKeys;for(let e of t)if(-1!==r.indexOf(e.public_key))return e;for(let e of t)if("FullAccess"===e.access_key.permission)return e;return null}},fw="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},f_=function(e){return e&&e.Math===Math&&e},fE=f_("object"==typeof globalThis&&globalThis)||f_("object"==typeof window&&window)||f_("object"==typeof self&&self)||f_("object"==typeof fw&&fw)||f_("object"==typeof fw&&fw)||function(){return this}()||Function("return this")(),fS={},fx=function(e){try{return!!e()}catch(e){return!0}},fA=!fx(function(){return 7!==Object.defineProperty({},1,{get:function(){return 7}})[1]}),fI=!fx(function(){var e=(function(){}).bind();return"function"!=typeof e||e.hasOwnProperty("prototype")}),fO=fI,fT=Function.prototype.call,fP=fO?fT.bind(fT):function(){return fT.apply(fT,arguments)},fM={},fN={}.propertyIsEnumerable,fk=Object.getOwnPropertyDescriptor,fC=fk&&!fN.call({1:2},1);fM.f=fC?function(e){var t=fk(this,e);return!!t&&t.enumerable}:fN;var fD=function(e,t){return{enumerable:!(1&e),configurable:!(2&e),writable:!(4&e),value:t}},fj=fI,fR=Function.prototype,fL=fR.call,fB=fj&&fR.bind.bind(fL,fL),fU=fj?fB:function(e){return function(){return fL.apply(e,arguments)}},f$=fU,fK=f$({}.toString),fF=f$("".slice),fz=function(e){return fF(fK(e),8,-1)},fq=fx,fV=fz,fH=Object,fG=fU("".split),fW=fq(function(){return!fH("z").propertyIsEnumerable(0)})?function(e){return"String"===fV(e)?fG(e,""):fH(e)}:fH,fJ=function(e){return null==e},fZ=fJ,fY=TypeError,fX=function(e){if(fZ(e))throw new fY("Can't call method on "+e);return e},fQ=fW,f0=fX,f1=function(e){return fQ(f0(e))},f2="object"==typeof document&&document.all,f5=void 0===f2&&void 0!==f2?function(e){return"function"==typeof e||e===f2}:function(e){return"function"==typeof e},f3=f5,f8=function(e){return"object"==typeof e?null!==e:f3(e)},f6=fE,f4=f5,f9=function(e){return f4(e)?e:void 0},f7=function(e,t){return arguments.length<2?f9(f6[e]):f6[e]&&f6[e][t]},he=fU({}.isPrototypeOf),ht=fE.navigator,hr=ht&&ht.userAgent,hn=hr?String(hr):"",hi=fE,ho=hn,hs=hi.process,ha=hi.Deno,hc=hs&&hs.versions||ha&&ha.version,hu=hc&&hc.v8;hu&&(a=(s=hu.split("."))[0]>0&&s[0]<4?1:+(s[0]+s[1])),!a&&ho&&(!(s=ho.match(/Edge\/(\d+)/))||s[1]>=74)&&(s=ho.match(/Chrome\/(\d+)/))&&(a=+s[1]);var hl=a,hd=fx,hf=fE.String,hh=!!Object.getOwnPropertySymbols&&!hd(function(){var e=Symbol("symbol detection");return!hf(e)||!(Object(e)instanceof Symbol)||!Symbol.sham&&hl&&hl<41}),hp=hh&&!Symbol.sham&&"symbol"==typeof Symbol.iterator,hy=f7,hg=f5,hm=he,hb=Object,hv=hp?function(e){return"symbol"==typeof e}:function(e){var t=hy("Symbol");return hg(t)&&hm(t.prototype,hb(e))},hw=String,h_=f5,hE=function(e){try{return hw(e)}catch(e){return"Object"}},hS=TypeError,hx=function(e){if(h_(e))return e;throw new hS(hE(e)+" is not a function")},hA=hx,hI=fJ,hO=function(e,t){var r=e[t];return hI(r)?void 0:hA(r)},hT=fP,hP=f5,hM=f8,hN=TypeError,hk=function(e,t){var r,n;if("string"===t&&hP(r=e.toString)&&!hM(n=hT(r,e))||hP(r=e.valueOf)&&!hM(n=hT(r,e))||"string"!==t&&hP(r=e.toString)&&!hM(n=hT(r,e)))return n;throw new hN("Can't convert object to primitive value")},hC={exports:{}},hD=fE,hj=Object.defineProperty,hR=function(e,t){try{hj(hD,e,{value:t,configurable:!0,writable:!0})}catch(r){hD[e]=t}return t},hL=fE,hB=hR,hU="__core-js_shared__",h$=hC.exports=hL[hU]||hB(hU,{});(h$.versions||(h$.versions=[])).push({version:"3.41.0",mode:"global",copyright:"\xa9 2014-2025 Denis Pushkarev (zloirock.ru)",license:"https://github.com/zloirock/core-js/blob/v3.41.0/LICENSE",source:"https://github.com/zloirock/core-js"});var hK=hC.exports,hF=function(e,t){return hK[e]||(hK[e]=t||{})},hz=fX,hq=Object,hV=function(e){return hq(hz(e))},hH=hV,hG=fU({}.hasOwnProperty),hW=Object.hasOwn||function(e,t){return hG(hH(e),t)},hJ=0,hZ=Math.random(),hY=fU(1..toString),hX=function(e){return"Symbol("+(void 0===e?"":e)+")_"+hY(++hJ+hZ,36)},hQ=hF,h0=hW,h1=hX,h2=hh,h5=hp,h3=fE.Symbol,h8=hQ("wks"),h6=h5?h3.for||h3:h3&&h3.withoutSetter||h1,h4=function(e){return h0(h8,e)||(h8[e]=h2&&h0(h3,e)?h3[e]:h6("Symbol."+e)),h8[e]},h9=fP,h7=f8,pe=hv,pt=hO,pr=hk,pn=TypeError,pi=h4("toPrimitive"),po=function(e,t){if(!h7(e)||pe(e))return e;var r,n=pt(e,pi);if(n){if(void 0===t&&(t="default"),!h7(r=h9(n,e,t))||pe(r))return r;throw new pn("Can't convert object to primitive value")}return void 0===t&&(t="number"),pr(e,t)},ps=hv,pa=function(e){var t=po(e,"string");return ps(t)?t:t+""},pc=f8,pu=fE.document,pl=pc(pu)&&pc(pu.createElement),pd=function(e){return pl?pu.createElement(e):{}},pf=fx,ph=pd,pp=!fA&&!pf(function(){return 7!==Object.defineProperty(ph("div"),"a",{get:function(){return 7}}).a}),py=fA,pg=fP,pm=fM,pb=fD,pv=f1,pw=pa,p_=hW,pE=pp,pS=Object.getOwnPropertyDescriptor;fS.f=py?pS:function(e,t){if(e=pv(e),t=pw(t),pE)try{return pS(e,t)}catch(e){}if(p_(e,t))return pb(!pg(pm.f,e,t),e[t])};var px={},pA=fx,pI=fA&&pA(function(){return 42!==Object.defineProperty(function(){},"prototype",{value:42,writable:!1}).prototype}),pO=f8,pT=String,pP=TypeError,pM=function(e){if(pO(e))return e;throw new pP(pT(e)+" is not an object")},pN=fA,pk=pp,pC=pI,pD=pM,pj=pa,pR=TypeError,pL=Object.defineProperty,pB=Object.getOwnPropertyDescriptor,pU="enumerable",p$="configurable",pK="writable";px.f=pN?pC?function(e,t,r){if(pD(e),t=pj(t),pD(r),"function"==typeof e&&"prototype"===t&&"value"in r&&pK in r&&!r[pK]){var n=pB(e,t);n&&n[pK]&&(e[t]=r.value,r={configurable:p$ in r?r[p$]:n[p$],enumerable:pU in r?r[pU]:n[pU],writable:!1})}return pL(e,t,r)}:pL:function(e,t,r){if(pD(e),t=pj(t),pD(r),pk)try{return pL(e,t,r)}catch(e){}if("get"in r||"set"in r)throw new pR("Accessors not supported");return"value"in r&&(e[t]=r.value),e};var pF=px,pz=fD,pq=fA?function(e,t,r){return pF.f(e,t,pz(1,r))}:function(e,t,r){return e[t]=r,e},pV={exports:{}},pH=fA,pG=Function.prototype,pW=pH&&Object.getOwnPropertyDescriptor,pJ=hW(pG,"name"),pZ=pJ&&"something"===(function(){}).name,pY=pJ&&(!pH||pH&&pW(pG,"name").configurable),pX={EXISTS:pJ,PROPER:pZ,CONFIGURABLE:pY},pQ=fU,p0=f5,p1=hC.exports,p2=pQ(Function.toString);p0(p1.inspectSource)||(p1.inspectSource=function(e){return p2(e)}
vendor: 2,754 bytes, line 78
78);var p5=p1.inspectSource,p3=f5,p8=fE.WeakMap,p6=p3(p8)&&/native code/.test(String(p8)),p4=hX,p9=hF("keys"),p7=function(e){return p9[e]||(p9[e]=p4(e))},ye={},yt=p6,yr=fE,yn=f8,yi=pq,yo=hW,ys=hC.exports,ya=p7,yc=ye,yu="Object already initialized",yl=yr.TypeError,yd=yr.WeakMap,yf=function(e){return l(e)?u(e):c(e,{})},yh=function(e){return function(t){var r;if(!yn(t)||(r=u(t)).type!==e)throw new yl("Incompatible receiver, "+e+" required");return r}};if(yt||ys.state){var yp=ys.state||(ys.state=new yd);yp.get=yp.get,yp.has=yp.has,yp.set=yp.set,c=function(e,t){if(yp.has(e))throw new yl(yu);return t.facade=e,yp.set(e,t),t},u=function(e){return yp.get(e)||{}},l=function(e){return yp.has(e)}}else{var yy=ya("state");yc[yy]=!0,c=function(e,t){if(yo(e,yy))throw new yl(yu);return t.facade=e,yi(e,yy,t),t},u=function(e){return yo(e,yy)?e[yy]:{}},l=function(e){return yo(e,yy)}}var yg={set:c,get:u,has:l,enforce:yf,getterFor:yh},ym=fU,yb=fx,yv=f5,yw=hW,y_=fA,yE=pX.CONFIGURABLE,yS=p5,yx=yg,yA=yx.enforce,yI=yx.get,yO=String,yT=Object.defineProperty,yP=ym("".slice),yM=ym("".replace),yN=ym([].join),yk=y_&&!yb(function(){return 8!==yT(function(){},"length",{value:8}).length}),yC=String(String).split("String"),yD=pV.exports=function(e,t,r){"Symbol("===yP(yO(t),0,7)&&(t="["+yM(yO(t),/^Symbol\(([^)]*)\).*$/,"$1")+"]"),r&&r.getter&&(t="get "+t),r&&r.setter&&(t="set "+t),(!yw(e,"name")||yE&&e.name!==t)&&(y_?yT(e,"name",{value:t,configurable:!0}):e.name=t),yk&&r&&yw(r,"arity")&&e.length!==r.arity&&yT(e,"length",{value:r.arity});try{r&&yw(r,"constructor")&&r.constructor?y_&&yT(e,"prototype",{writable:!1}):e.prototype&&(e.prototype=void 0)}catch(e){}var n=yA(e);return yw(n,"source")||(n.source=yN(yC,"string"==typeof t?t:"")),e};Function.prototype.toString=yD(function(){return yv(this)&&yI(this).source||yS(this)},"toString");var yj=f5,yR=px,yL=pV.exports,yB=hR,yU=function(e,t,r,n){n||(n={});var i=n.enumerable,o=void 0!==n.name?n.name:t;if(yj(r)&&yL(r,o,n),n.global)i?e[t]=r:yB(t,r);else{try{n.unsafe?e[t]&&(i=!0):delete e[t]}catch(e){}i?e[t]=r:yR.f(e,t,{value:r,enumerable:!1,configurable:!n.nonConfigurable,writable:!n.nonWritable})}return e},y$={},yK=Math.ceil,yF=Math.floor,yz=Math.trunc||function(e){var t=+e;return(t>0?yF:yK)(t)},yq=function(e){var t=+e;return t!=t||0===t?0:yz(t)},yV=yq,yH=Math.max,yG=Math.min,yW=yq,yJ=Math.min,yZ=function(e){var t=yW(e);return t>0?yJ(t,0x1fffffffffffff):0},yY=f1,yX=function(e,t){var r=yV(e);return r<0?yH(r+t,0):yG(r,t)},yQ=function(e){return yZ(e.length)},y0=function(e){return function(t,r,n){var i,o=yY(t),s=yQ(o);if(0===s)return!e&&-1;var a=yX(n,s);if(e&&r!=r){for(;s>a;)if((i=o[a++])!=i)return!0}else for(;s>a;a++)if((e||a in o)&&o[a]===r)return e||a||0;return!e&&-1}},y1={includes:y0(!0),indexOf:y0(!1)}
78,y2=fU,y5=hW,y3=f1,y8=y1.indexOf,y6=ye,y4=y2([].push),y9=function(e,t){var r,n=y3(e),i=0,o=[];for(r in n)!y5(y6,r)&&y5(n,r)&&y4(o,r);for(;t.length>i;)y5(n,r=t[i++])&&(~y8(o,r)||y4(o,r));return o},y7=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"],ge=y9,gt=y7.concat("length","prototype");y$.f=Object.getOwnPropertyNames||function(e){return ge(e,gt)};var gr={};gr.f=Object.getOwnPropertySymbols;var gn=f7,gi=y$,go=gr,gs=pM,ga=fU([].concat),gc=gn("Reflect","ownKeys")||function(e){var t=gi.f(gs(e)),r=go.f;return r?ga(t,r(e)):t},gu=hW,gl=gc,gd=fS,gf=px,gh=function(e,t,r){for(var n=gl(t),i=gf.f,o=gd.f,s=0;s<n.length;s++){var a=n[s];gu(e,a)||r&&gu(r,a)||i(e,a,o(t,a))}},gp=fx,gy=f5,gg=/#|\.prototype\./,gm=function(e,t){var r=gv[gb(e)];return r===g_||r!==gw&&(gy(t)?gp(t):!!t)},gb=gm.normalize=function(e){return String(e).replace(gg,".").toLowerCase()},gv=gm.data={},gw=gm.NATIVE="N",g_=gm.POLYFILL="P",gE=gm,gS=fE,gx=fS.f,gA=pq,gI=yU,gO=hR,gT=gh,gP=gE,gM=function(e,t){var r,n,i,o,s,a=e.target,c=e.global,u=e.stat;if(r=c?gS:u?gS[a]||gO(a,{}):gS[a]&&gS[a].prototype)for(n in t){if(o=t[n],i=e.dontCallGetSet?(s=gx(r,n))&&s.value:r[n],!gP(c?n:a+(u?".":"#")+n,e.forced)&&void 0!==i){if(typeof o==typeof i)continue;gT(o,i)}(e.sham||i&&i.sham)&&gA(o,"sham",!0),gI(r,n,o,e)}},gN=y9,gk=y7,gC=Object.keys||function(e){return gN(e,gk)},gD=fA,gj=fP,gR=fx,gL=gC,gB=gr,gU=fM,g$=hV,gK=fW,gF=Object.assign,gz=Object.defineProperty,gq=fU([].concat),gV=!gF||gR(function(){if(gD&&1!==gF({b:1},gF(gz({},"a",{enumerable:!0,get:function(){gz(this,"b",{value:3,enumerable:!1})}}),{b:2})).b)return!0;var e={},t={},r=Symbol("assign detection"),n="abcdefghijklmnopqrst";return e[r]=7,n.split("").forEach(function(e){t[e]=e}),7!==gF({},e)[r]||gL(gF({},t)).join("")!==n})?function(e,t){for(var r=g$(e),n=arguments.length,i=1,o=gB.f,s=gU.f;n>i;)for(var a,c=gK(arguments[i++]),u=o?gq(gL(c),o(c)):gL(c),l=u.length,d=0;l>d;)a=u[d++],(!gD||gj(s,c,a))&&(r[a]=c[a]);return r}:gF;gM({target:"Object",stat:!0,arity:2,forced:Object.assign!==gV},{assign:gV});var gH=h4("toStringTag"),gG={};gG[gH]="z";var gW="[object z]"===String(gG),gJ=f5,gZ=fz,gY=h4("toStringTag"),gX=Object,gQ="Arguments"===gZ(function(){return arguments}()),g0=function(e,t){try{return e[t]}catch(e){}},g1=gW?gZ:function(e){var t,r,n;return void 0===e?"Undefined":null===e?"Null":"string"==typeof(r=g0(t=gX(e),gY))?r:gQ?gZ(t):"Object"===(n=gZ(t))&&gJ(t.callee)?"Arguments":n},g2=String,g5=function(e){if("Symbol"===g1(e))throw TypeError("Cannot convert a Symbol value to a string");return g2(e)},g3=pM,g8=fP,g6=hW,g4=he,g9=function(){var e=g3(this),t="";return e.hasIndices&&(t+="d"),e.global&&(t+="g"),e.ignoreCase&&(t+="i"),e.multiline&&(t+="m"),e.dotAll&&(t+="s"),e.unicode&&(t+="u"),e.unicodeSets&&(t+="v"),e.sticky&&(t+="y"),t},g7=RegExp.prototype,me=function(e){var t=e.flags;return!(void 0===t&&!("flags"in g7)&&!g6(e,"flags")&&g4(g7,e))?t:g8(g9,e)},mt=pX.PROPER,mr=yU,mn=pM,mi=g5,mo=fx,ms=me,ma="toString",mc=RegExp.prototype,mu=mc[ma],ml=mo(function(){return"/a/b"!==mu.call({source:"a",flags:"b"})}),md=mt&&mu.name!==ma;function mf(e,t,r,n){function i(e){return e instanceof r?e:new r(function(t){t(e)})}return new(r||(r=Promise))(function(r,o){function s(e){try{c(n.next(e))}catch(e){o(e)}}function a(e){try{c(n.throw(e))}catch(e){o(e)}}function c(e){e.done?r(e.value):i(e.value).then(s,a)}c((n=n.apply(e,t||[])).next())})}(ml||md)&&mr(mc,ma,function(){var e=mn(this);return"/"+mi(e.source)+"/"+mi(ms(e))},{unsafe:!0}),"function"==typeof SuppressedError&&SuppressedError;var mh="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAZsAAAGbCAMAAAAlRs3KAAAC/VBMVEUAAAB1gdddWs6cq+JsadRdXalLTJhFRXtTU415iNhOTo5+pe41NXxjYM8qKmscHGuRn+MSGZl0ovJ3eL6EqPEXF19QUcFdnfNlctZZmvNvc9prbdaMsPA1NoYkJHFdXdFSg+08ReFMO9VVTdg3k/Vdk/BHSL1bXac+mPVDlvQcIqFKcupJlfQvL3lRculLS404ivJLRNw9P7dHkPIoKHQ/lPQpLapPm/RGRohmlvF0oPCBg7pFPt4UFFBOQ9AkKag0OK9Ie+04PLJYT9ZeYLtJRsc4OH9LXOE/TuIrL64kJG9dZ+EVHJxDZudFgu5AXuZHk/NHjfE9PMA2OLVQfOtLd+tQjfBrbLZ7fbFGdOs8d+1Dj/JCK9hPT49Jk/JqnvJaVc4jI3EXHptRTclVUcxOS8dUQdhNQ91SO9pZUdBLRt5WR9UgIGlLScVYU80YGFJXTNJGRcMbG1tDfO1BXOVDeexSPttJR8RVRNZDV+MUFEVTUMohIW5BaOhCcuqkoe9Eh+9DgO5CQcBCdetAX+VHT+FCbelBZedPQdxBaulITeBJS99GUeFFU+JAYeZYTtEdHWBKSd8XF04WFkseHmNCWeQTE0JEVeISEj94a+49Pr1WStRQP9xAQL5FivBCb+lFj/IfH2YZGVVBY+YaGlhGlvNEhO4VFUk5O7tGkvNFjPEPDzoRET0tMLDCv/02OLgwM7IqLa00NrZaVM8cIqAcHF4kKagyNbQhJqVCWuQODjVGmvQnK6tEQsIKCi0dHW1MR8tQSsuAcfUYGGmrqPNiXd97bfFKSN9hXNFNS9CvrPQGBiMFDJMTE2ZIRMhfWtsVG6NFRc0/QMfIxf9AlvQICFxQTtUoJ3lpZNU5OcCbmOw0NJrRzv8ZHopoYONcV9UwL4ampPAPFpgSElRRTcJEQacwMbo6Oq1WU9g8PLM+jvIVFV0dIamBfeAoKpM3cOsnKrOOi+ZJSNE7g+9GM9s4VuU7OqJ0cNo1e+83aOlyZ+q7uPkyX+gzT+RLR7VJUHVbAAAAYHRSTlMACZEcgRAaYFcjjy+3ib/zE9xhVFP2lmouhmk/Q3XcXEv+/bL+qGNK9d7Vq8yjfzb+2a2k7em8saKagj/++dCl
78jvvGnHfp0r7s6s2b7u3z3b7u6NrO8+HPcNr59ujU+LDlSLXNAAApKklEQVR42uzYPU7EMBAF4IlQftZEASkNTdxSRdtssdK2aIvcYu4xd5vCtUvEdRACaSRgvSlINsLvu8LzjJ9NAAAAAAAAAAAAAAAAAJCzsjoNbhzd0FcVwXZUjTt7/uInVz8RbMLe+fAqLMIfhDnGw1gXBLfWtxqUv9Gg55eS4Jb2owb+VQhdQ3A79SEIX6I8YLHdjAvKCRLaHa2prO77pq6b/qnK/FSUY+Ar4rSntVS18wdVEVHVw3loMo6naCNfpX6dcIrno5coLHbdvU1uT3myaJKC39HiiuEcflx8IoG7njJUWjRpsStoYc2kKvwLERl3lJuyDTxTGGlR1VGVLxH1uTX5wqK5Lja0oJNX4QRVRzmxhTaH+pIW8/ygnCaxzej31aKZJwy0lMaiuUynbAqbNbSZ1N+RWW1qjHSZTM7n1GxicCyaK7TL4iFqDW0+nQoy6y00E3MoBIloEuKJzB9Gs5WyuAmJhZYSj2RWXGhG/SP9b+/s2rFrE1EcB/BLbFqjRcWaUBTtIOgkhVKkIARRU1G3OOgiRK635QXO5YY7EO4vyNCp4FBwTWiE6OLjkOsQAhHhCCYli4iTEezk0MXna8jvJeba9L0neSl+h66v8Mn39969O9oaHptVGGqSW/N/qgENV5zPi+OhgTiJY317Qwaa4/DhNK7/C5r/xWFpSPhsno6JBuItn9COa8hAc2jGfxhgaY7PUS0yfeHixYsX4rEIV2u4cfyVsdM892c1dXPp2t1U2sWmiTPp1KOFeQ4aXhxvVioN1+/DUfYYHVu4qiPTMNB+rBZOJy8dgeZ7zhHAcWaltobP5rmiQ23hqoWQ8SeoG8vCZnJ+dJqcCI43K5OGt7yXNQUzf9WkMAM4Fn68MDKNEI6/Io+Gu7yNFU29TKWRbUAAB5k4GRuZhsUZw8MFtIbTxl/VlEvU1EmG4ZDgpfhhNGcojVBzGnOSaHxn4F9Q5QUsVyJ3EZEJx7Ey04fTiOJ4i1JoNoGGA8dZVuwVWyRKaSiOibH5N465FNPCM00HmiCOv3pOSms2yfI5fpyzatlEooZOY2GMstVq1nRdNIDjJg9szWZOGMe/IYeGLn9cbLo0tuEav3Zqe6XS3pfdJt5AAzgLB9FsiuP4JyXQdP8PJzdEZwJnWiSq2zahMY0ftaDdDkjI35dN19T7cDLxkIFGaYRxnOWYOE1iHZbnw/GuKPTVAKUhOLi63W6XemkHOwizOOhVNOzwTGDEceqnJAw0SkPDu+XUn2nKhNKQ4GaJyDAJ2tvI7WvORnzoQPu6vi4Bxzkbl9QaseY01HmDQ2jW1oCmL+0vlmkADmpFhw60dRJxnPqKRJrhe86E3dlQGoKD9BrQAM7uRt9pLRVGI47jLcflDTRYnmPXu6WpkUjUXqPBu0ADCYKmy+LguWEDTQpOY0ZOa0Sb41zR1EiPBlVLAZCwU81EDE5rarA1XwsFKTj+rDBNBZYO23Mm6IOBHo39EWrDhoBVsQE47v2/aaTgeA8FHypmEgV2ae7TmuOr8cV6JLrWjW7XgtLQtH+0DAYnHWMHGqWRgeMkFgVbQ2hIxJvjryrxdENo8vk8tTGqpTCbHYwYnPT0QGsAh4YPxxO9gJ6pVOB3wbfnwGdYCoTSdHHQrzCbYNuwDMDJnGBpKhXAEWiOVxelSVToyjSHNWcCXt5QGrAJwmz28qYBOK0LDM0LsBFojnhrTia+04UlNKeuQm0ITTab3w/0JsQGcFrnGZoXgMPRHIk0FVhZbM+p39DGH0oDOEa4Tc224GWbtXGaoeHDkb7XkNbAyjS8zfGvKPBRZySaz2YB56CzwEsDbAyUOQc01IYbRz7N6M0JvdFT4EqAtobFse3tMJtdVzcg6WmGhrc5kml663LuOUAzo409PRrACX32DJpYBxwzBTQCOHJpCoAjdFqrK3DJCTSA86EZcmdT05EOOO4USyM01uDwHL8+lVy6eXMpOTW3yEVT4GiOou8GgIbB+bjTHmrzi9QGcNAcpXkNMiLN8RK3tNi125lO5325WCy/7XzaunMvfhSaF4RmdJz+KEgDrenD+VDdC4beChg6g5Pap3ktBccrPJlPPtjaKr7bIin+SbnTeXD70hFpOJvjTAJNtzjw+MlONMvWAQc/6tIADv9Yy+W+Vd/8fPfmzTuwKZbL79+Wb8ePMtC4m6MazW/q7i60rTIOA7jzC4coykBkIkIHE7zTCxH82Jh6oezOC28U0iaZ69YmSy/WkQwCvfKuNSkhzZaLhsIJJCH9yloObWhCEtO07KwV1i5zSVNbt+Iy7CgtdFD8vydJ/yc5zTnp+5529ZmgF2rAn89z3ryJFgdNpnO7+MefNTTP0pNAs4vT/u1bx77nfISGvTn91zfn/x0OD0NKOKjz+LsPG6PBF6VrzpGiwdbshbP47M8/pF8XsNssQIM4t19+4c2/fD5NcHqbH94bDkNEnOrqDI1PvK9OMzDQg32lfOb8H2jKs5bO/vEn8JS+BPWsaOy0Vdk8+vFNzkcywDxrvQtr8/5w2aZ21kh13lFtzUAEwtico0ODg1ZHJza1SL46CHlWKJomjTYI0tzVdbiIDHtzgMY/74eIOvJZg9z5RJUG/41gaM4RocHWwC2NzQbX0DIcg9GiTy9CdO0WI/w5UhxDa7PbZzaz4xAaD9CQgExJpTJriHNWedAilbpGmJpzxGgMeoMOANLkD2pwIDZjO/wy2gwQm0TH8GjJbYYo4kQawiGt8ZRoBsfCnslOb3gsNCTD+UClNTIcqhuCo0RjiKWL61k7JLteTMdMMhyDJGhjE+5bzT60UXjmqH2eEyE0HoIzFo4Jue2+vr7tXGvXUAhnjdjc+uhYXRrJxQTVM+do0uhtRXsmkShAEomMfctmk+GY9sIRVq2cWQzrrEWaPUADCY915uLxeIoEfi+Eh6qfOXfeqTdovg4MxawdUZpYej2TsO8mkVlP61VxII9WOaDRAqenQuMP5+Pxvt2k4n2WGpzxd/emwdZQz1rb0aPRL9oz9qpksoCjNmsGYZWzmqU21Efpjt3W+JPxVJ808XgMcbA4dQYNQ3GUPkI0lcOzcbFQosGAlU5t1oDGijQszZHS5HZLg9WZqmrOxHfH5TQ+pGF55hwVmt1BW7TjniHOusGkhCPSuBwOdpzys8br9SJNNU7KOzSGOHhUQ5ov/8LXY5q1/wMN4GzFdAqzVqZBHPpZg9bc9pIgTXXiyZC0OLc+kdPg6zHO2lGgeWGXpoA00iSyOkNdHJshWaZhb85AhcaPNLU4Fun7nIkfjslpSNhmDWle/fybs2fOnDl78l2mr/xq3xrE2cLjgGzWhFW3y+xgxyGt8ZZpPEhTayOExhBnKPReFY2jTKM6a+o4/3z2wntnz52fXV5uaWlZXp49f+6s6uX3IdKgTTFWz8aUXHW5nSIM66zBoM15uxRpwGY7PCi9IDhd3ZrSq7HPWn/P0o9nWpZnWzCzyy2f4uONMeyDhqOGV2tVOmUapzqOenN8zV6ggSjRwGnAEpJcfA6+X0ODOAyz1t/b9mAcClMTsPoUekoRptYY67cGUsimDbq9cIDGDTSIQz9rvuswaITGo0ADgfc4ks9zHp+WDJrDJ4Z11qA0zS13UKRKp+UNbQFoBw1t7GnbXja6Mg2EddYGoDVdIo0XaBRtQpKPDO6cxNaUaRhmDSK2ZgFp9qgO5amAfdDUbVBnJLfqDgILOw60pkLjTwKNig3iQG+QBl6tnP3OGuoATf8DlNlL56PXXzj4HFOmwSRw0zCkNcGgk+PAhXXWzNe7gIbEnwcaRZupkORj6rH3cdDMZsShn7VeFRrAOS+/jdCexiQbNNWzAGYkuRogNBrg+K5PTpVoPMZUSpEGzgKDYQnOaWyNrKc0OL29QKOS2bdf0UaAnQbP0NLAoAUDnBjWWYPWTFssoo03p1abbenH1KGxEyUavAOnnzWkUcU5q5EBO02hsKiX2eRWAwHOakUc6uaY2yanJi0WyyTWRsEmPyjBCf3wFqFxIg1Lc5BGFecEOwALDSaxjpOGgybSEBzGWTNfF2kIjvrTJtU3OexHnMFz2BoNcJBGJcvyj1y1p9Gn1WkKeNdZNWjWUhhnzdEGg1ZOA5MmjEm/ffP4ZTkNztp+j9I9PUijVhx8z3tgrVGiwc8I9Cb5oFVo2GYt4myzAE3FxrKdUqbp8w77EWcwdBxOaEizn+bIcZBGPctv47ucA2rNYiM0WVPtATq5yiMNy6xFHIQGbdqVbVJxI9QGcULvwLPGii9EP2tI02hx8ELigAYtq06TwM+kcdACPMpQzhrSYLztfSlFmm7SGrT5+8RrX3IOBwWObNaQpsHifMoAoE5jMGUz6q2xp2O1g7YT4F0uF5iwzpqz3zLd2dmJvencTinRtI75PR7UGZ7/mePwhVhmDWkaHrXjGpIgjWGkVJuiOk1CTpNccfNWF+JQzxrQdE5bOiH4vMmllFpDaCQ48/cDVocY5lnriCANw6ix07SKNvrFQqHhQcPk871RVymMs0aOAUQGbSa9ybhCa8JAgzjhe8M+l0MM86xFkKZhmxe1t3nxSmsrwTHp1zMUg6bLLUXdLi1wuH7L3RIN6nhaU/VphokL4njmm4MOCFNzaFsDNue0b00MaAiOLW0vqNJga3DRgrwbcehnjevtvNvejjj4wFGkQZy5J0HOqYajfvFJRwP56BWtWxPrbi3h6LcS+xg0vA9ojrohzDhcP6GR4Xjz8XqDJn41CnHmN61WfBmGZw7NoJGc1/gdzhvXusFGTKyoYpPJ4qBhbXYCAWLDOmswaEAjx4F3n/G9aUBGajO/5nA7IezNEVvz/G3eaOqGoE2jNBhhAWqDOLRHaVdPu0gjx8HbTllrpDhza76gE8KO09EBNM/f5mTTlStXKjqx9USjg4bJr7h4As
78M4a1Z41hiNdXAMqbiMxi/CoM480rDNWmSA0Dx/m/e+7VawUWgNJnk/GgiCC9usuXo7HxmN9XC8xu24pDogpfd7u9BGbI054IQwNwdpnu9Z4N2PbwBNSQc3raETGr63aYsGg5Q4SBMhNAo4k0JfvLRsqVQ8lbSEvV0QxCE0+CIUzUGaAQoa7c/Qx7+6fKOCQ3RiW4kGBw0j2Dg+CGGZNZ+1hwyaEk6X1yjkwAV8tgWjx0NkEKdMQ43DSqP9e8+Xvmq6AZHY4PsbtUFDG/hoAG3omuPqWYHW1MOpXHp6J42t+XyrsQtkKtmlcQCNFjh0g6b9nc2ppsuXoTiS5sTWM/ugwceNGGocd2Tlkd5YDwd1KhRlF8QBGt7KaYHjG3jwmAJF87vOF5tuXK7BiS0mCo0OGt7XkOIwzJoLaIx6NRzMZFdVyjRWLXB8Phoa7T8jONl07bIYyaxdweKotQYvBWZkNvtqjrsHWgNRwrFUpcZm7qEzYIWw4xCa0ZZR6kn7QKsjWtO1a3KcWN6eaYgGbdqiAcChnbXSoJHQNufpGkdaw44jDtroKDXOslYn6Le+unBNhgM6U2nEQRq9rq6N0E9sqGct2EFo6HG8T9ecQKMFjtgaCNCMPteTwKkmsJE3h+BkMwU7JpFZ1wFNfZu2GZChnbUgtoZu1uawNYw4ZjPQiKGQ0fI7UKc3rl2oh2MoFjLlI0EhkbEXbUBTP8nrxIZy1gIdK4INTKib8/Qh0rDhmKE142Uaqlmb/VAbmhNNFyByHFHnylS6mC1kIAl7tqiLmXRKyS3M8CBDNWswaHmbjQHn6ZoVaZhwoDX/Ak05FDiz32j1sLl4oZQ9cbpjsdbFrWKxuLVo0ht0ykkuRcGGCicQARoxlDhzQIN/fxYch/nBxPj4+CjhoXrmLJ/RaNG+birJ1Js1wjMVg98M0Bk1m01iQzNr4qBBaJvTNedxAo0WOA7SGhKszT5ptPrPCD7YuHi1Hg5efJKM6FQj7PBgQ4ETGAAag4Ee5/YU+QYJOw6hefLvrVslnHGaWZt9+yWN3tn8dPGiCg6kjKOqkzc54BC931kjrbERGgacu0u826UBjs/hABpIVXMQh4KGOqeARhmnu8Hm4MXAvpvDw6ABDAPO9Fow4HKx4/icZZqa5hCZ0UOmeXnjopgLGs1abnOG57E4DTXHyfv0QMOE87QfFo0FB2n+nhBlKjiYQ6Y5DosGYZ81HDUuyvP7m7WAzwY0TDjTcP/tZsLB1kxMAA7RwebgiYCChnrRNq5eBRgNZy25BMUpyTR4Q8APrCRNBgoctOmEg4DbzY5DWjNUtsFZk5ykD5HmA6ABHC1nTVjhowSn0aM0x5uBxkSDgzrTm4GAmx2HcwLNEOBgc2TPnMOiOd508yqJprOWg+Jgc1RnjTfbBJMYBpy7C1AbJhykQRxsDoaChnbRblbhXNBi1gQTV8LhG5k13getEcMwa1MWM+9mxnECTQhtZM3B4hwCzYmNX28eAE5udSaKzVGetSgMGv6/b2hxpjeBhhWHIzQhxKnTHMA5BJpjH9/8tQan4RsCJZ2R0nGgkdMaDBrQMONML4ENIw6hGQyVcBSeOXgiUKRhf2vzKwRw0EbttAZpoDl5IVLBkdtI//mRQdOhjRwH0gjOdFvUzYhj5Z7cAxqSKpu9bggOnub1jV9+QRwtj9Km5IgDcFRPa1EH0FTC8syZ8kWD1DhIM1iFU/+0Br8Uadhz6otf9okDaRTHxmFz6uFEyaBh6GdtysvxQSYcq/XJveFBxFE5rbUcMM17QENwUAdxKqE9SgOOYUD5meNyR3tNhAZDPWvTay4+CKHGITT4A3QaeeaMKtOw1wZycLOWb1Y8rfHRhTzSsM3a9EM32lDglGnABiK1kTUHZUYPkObkhihzcLMmJDcDoLP3m9BA1LqZFEw6DMusTT8Mgg01jtv6ZD4s+7Fg6qe1g6J56+MvLl1CHFFH2xsCUz6nX+BBJ1A7ayDDL6zk8kDDjIM21Dgu631Co4gDkeFoToO1uURs2GdNKUJyp5mfmameNT4aDbTtJAUdhnXWxOcNBQ7S1PxYMLkNNgeCpzWk0bI2QCPH0fricySZ3FnyRWdmohCeB5aZqCuytCMk4a/TDifWxUUDlDhu6/05f5ikweagDrZG07z8xe/EpnbWtL/4HBGS+dX7S70+zh10Wc29C5sr+aQwgnOmxawZY75ogA6HtMbvV8BROa2NIo1mtfn9t0sUzaH8mDon5E2GlZ0VmwmocMy0aw7cCwRocCo0aKN0kpaf1pBGu5z8j717i42iCuMAvmu9gEUliAgCYuOFKOIFFFEeVEQF7wQvqC+u8fbQ2tCChLoQWi4Nd9gtZUNSSguhwK4BTCi4abdt9oFsmq5tI7tp+mDDA21NA00JBBIwfrPd9ut2Zs45c3pWZqbnM9EXn/jl+8/Z7xvOZO3ZAzjpjjXk+Rvqzz/hX/g/i+ycWAfYcOAESttb9gMNoXOIE4I00IxffG7PIA7GmpjBJ73E48TgtjYOHB/SHDXyzEGaZ4BGdNts2wY253Q75yeeWBNvw4zTkOMJGcbxJmig0IYaa9g5SCP6abMtgSPwmSO4jOJ0xRv9RnH8CRrEIXxhVz0hwEAT3TZbt0EJjbVvbm+sxTqDQYM4fp9CgziGT2sXnhkvnMb54tatAziYawYHn9g6Ap85/IPPhkhFox9x6IPPqgDQ4OU3HM+cCxBowmtG1lbEocfaL5aItS58R56pc/wKDdqocMiDT6QRXI9nbQIbu8VaDBqHHccfaO8r2484Rw11DhQGmsiamrVpEwmHfZ9jqljr+jcY8rPGmtI1RWVKccZaM3aNyHo/YWO/WOuCF0gYOwdo+gbvvsFij7UL6aGZvHiTUsZi7QcLxNqvXRVsOIlAK0rScMVaMwaa0Loza/t2Ag518GmOWNPCieV4Gv0MOMEETZFKB4oJp7pnHnaNyHK+u2k74AzY2CrWulYXUHGQhqVztBvn9TR9d+ix7TvARq9zfjRrrDHirPBSYy3ku9ZXWwRFaBzi4LMaaQTXW1k7EIfyzLFerHXlnCbj+ELezgSNSocVpyZtNGMX71BsNGLtnFlna0YGnzm7YvFQSBen1B+qgI8dYqljjTL4RBrxdeetHUohjqJjjcEnW+d819Ve2ggLai0cfyjQUd+HMmoc+uBTPA2eBHbs2wc26lizzT6noSsn7ged4TgB+Gnq7o5Ea2uLiDpHSac1pBFfU4EGbNSxZqN9Ts6urn87vCGINsQBmGCBqzMSwYuJSI+c/XqxNgdphNdzWWsAx7Kxxjr43NWV057tCYYGK+itaC8Dmf6q5Y211x1Qd89cfu/82bPn37v8+btFRtrH+9YATmqs2XHw+X1DLLa6s70j7q6ocMU72q8VRSL1q3WvkVSnmlas9cInOxdMn/1SuKnO7XK565rCL82e/rywHzdroIbh2HLwqbxDADyxSEN9fUMkEoshDAGHPCHofXvszHFhVxhcBsoddtWNG+MUM+a8NYCDsWbPwSfgKJX8r8bFREZj7eTF/V+8Ew67VBUOj1sgItI+XLMXaEZJrBm6HZc2vjlz4veOkiY3kgxtnqbpI7fJXLx3717eWLPYhIADhzQhOHoifjrb5QYcLZ2mcXeP+JR2td8GasDG/rGmi0OxgUKcthPx3dluKJd2hR99fqQ/PK/+sXdY51hy8Pm/x1rb0Xhedjbg6OrU1T04ski7unKlFo5d9zmiYi1JQ8EJzxyJzcO3VgIOxhppQmDXWFvBcVpra4vnVSRsSLHmfmAkz5x3oW+Gdc4Oq8bad6I6h44DNJUlFYijpxO+38kfaR/uBRp1rNl5nyMg1lrbXJUlYEPvnPP38r9pe3UjyKhizdb7HO5YQ5r98crdJVBUHEi1ydwn6FsbEadfx9KDz5/TGmvYNbn9H8ivoMda02zuOefKjVo4dt/njCTWoGtc3rzdKhzdRw7nr5yMxTvBxlisnVN1Du/FRCKL/2IitGHrnNYylwe+uQY2bLHWNJ/PZsJKsEntnFE2+DQca61Fbm8eFDNOHZyj+QY2OxEHCmzk4FM71pCm4HDys8UqHG2d81zTAeenYKPqnNG0zzGEk6SpPJzE2
78c2GU8d1Gpi8duNONc4aGWt6R+lobXZBZSUBR9PmUSfPyvPWoUM7d8pYY+2c1la3LxdsjHVOXZxnz/ba1UODONg5cp+jjVNW2+oqzYVixMG6h8NmVrFiQ4k1sLHti+zGJgR9HT5PLh1HbTOdx2ZncbEaxx77HOFH6bKWa74qsDHeOU1jeAadYFM8PNbkPkcTpyxaVunzeNQ4p6njm/OLjNvMWAs0KbFmj8FnWmKttiXu93oRx0CsnV/OMYS+WazCoU4ILBRrQjunpbOqwMuKk6pTx3EWePXm2kTnYKzJwacuTl/cX+VNxTlMirURngW+LAYbaqzZ/0V2lliL7vf4qgCHI9bcrjEcC4Ita9U49trnCDuttVwKwp0qup2zm3AgqHtprPEFwYdAM6gjJwREnGgJ2KhwQIc++Ky7n2NBULyFG8d+FxORcaJlXn8B4kCxHwjC8zkWBGu3bFHZyH2OJg58HixQoBTHM+f8Aj6bLTLWmHDg7k/lXhWeWAu/5+SwublFjSP3OZo4kXioFIon1sLTeRZrN4CGFmvyRfb+r1G6Qj6w4Yg19wMZHBd0frZ2M9BwxZo9LybSx1kdzQ75+HC4Xh6cXL55cyqOHHzq4UQVG8CBMoiTXHo6M2c+BTU1g9HmxmbESdrIfY4KBzPNx9M5D42BP+lFcxb+3n9PxJJ5kx68i24z7SbQqDsnFUe+yA46/TaBAAfO4emOGXPO9Jw8VXMKZOBOolM9PfMWjaUupG+Wp+Lc9sGniWMtFm8MqHCog8+S0/EvFv7Wm3KvNPicXTKJ0jtTboDNsFiz5z5HwOAzdkn5XovBWDtdcunoxZMa961VNy+cSd4Q3ChPxbH94HMEnQPf2A0CjqFYy8vubNO8kR3q7AekXahz1rry8nKzxZpZ9zk5K6pCfr+hWDtccbKVcI1k8xz9ccFds9YBzrDOkfscPZyIG2yMxFplRWcr8UMTgEPoG8AZbbHGjRNrDwXpOLjPqdzd2Ur+0ATg6I4FZt1QcDDW5OCThFMfLVAah/WZk1sCNLTbcZvf0Pt589nldQZxRvXgMwa3gCMOZfCZm+gaGk71t1MJNpRYky+yI06kqBQah+2Z48nrbKV+aALq7Dxtm4lvKjYy1hhwsHGCTLEGNC1s3zJoXqRjU76BgiNfZB+KUx/NRRxSrHkTNEw41Us0z2oT3ly3AXBSYk3uc0g4sU7lU7G0WKusqgQa1u/nnJ2ha8PQObZ8kZ2vc+CjICFqrFXlJmmYOqdnoa5NKo7c55BxcmDiGSTFGuAUAI2BG9lreibr2hiNtdF9MVF9xNVIjrVSD9Aw38gO1fyIpg3ApHaO3OdQcWJxQqx5vAHoGmMfmqiZ49Q6p21YNQTHjINPE8Zafazd3wg2mjil/uzuFqYb2RGnZt5d2jbDcOQ+h+WZ03061KgRayDj6aiNst3IjjZnl2Xq2CDOaBx88p3WIrF2TyMkW2Aojs8fLIh399WWGf3QRM3JRzRsPlJszB5rJtznrKiP1bfn+RsbgwPBFgiGArkgE9W+Nor4zDl1cpHGPE2xMdo58mKiRIFOd0e2xx9MlL+qJN5e1tKif98a4WuHBJvbH2sWPEpD5URikSL4toFS17pX9PWtqCXfv6qDAzaPaNi8+RXAII4cfBrCgaqPJKs+Sru6WD/WapY8qLbJ+PRy/lAcEww+LbXPGdGN7IhTszBDbeOcuwpsUnDkPiftN7KrP0Wp9fvGOSs/P3+VjLXb8qEJ7Jzq+xyaNlBmizXrTAgoOKxf2G2eqmUzF220Yk2+yC7g6mJq5/y2bLzme51fIQ5b58iLicidw3FaOzVJ+33o6yCTEmtyn5PmWFPj1CzQtHntcorNaB183oZYQ5veOTrXCyg2xFgz0eDToqc12uCzd4G2TaaSaagjB5+icehf2O3Ve7FzcmFhfr45Ys3iL7IjjLEv7J5ZlqFncyQFxxSDT4s+czhjbclU3auGluarcKDkhEB0rOmlWu9TDr1yfn69ECq/kPGZIy8mEnuU7r2P9JcKEzagUmimWLPohMBwrPVOIt5nU5iofhk5+PwfYw2KTOOYciRpo/xjxsGnjfc5F8k0jgmFgKMba/JF9jTuc6BryDXtypEBHJPFmg0nBIM6SEMq55dHAGcg1+TgM/04ycJAIxyiwWZIrMl9TpoHn0hDr2evII7qtCZfZBfdOUjDUK9dXw82ZjmtWf9FdmqsIQ21HruyfhDHPINPC7/IzhBrF+9wMNW0A0dScArNNSGw4ovslM7BrqGV81lonCE4cp+TbhzsGmrNhb4Z3jlmiDW77nOQhl5PKn2DOHKfk97TGgQae028DjKqzpH7HNGxhl3DXpmJvmF75siLiUYw+EQa5sqAw4Be58gX2QXGGtKw1xSwGcAx6+DTHrGGNMw2Bw4kbcw0IbDhi+xtSMMcah9p4kDJfY7IWMOuYS/n0gOIQ37myIuJOHCQhqNevTKAY64Jga32ORBoPPUw2PTjmHNCYPFYQxqOmrZ0vQ6O3OcIeuYADWd9otCY8rRmk31O230O3npy/fEhOHKfI3rwydM1OFIDG8SR+xxhncNPg2+sHzhO7xxrxJrp9jk5GGh8ofaCYmOK05rtLiZCGr6acOX4EByT73OsdZTGQOOs8S8cPA5F6Bw5+OSINaQZaaglcEw7IbDmPgcDjb8efuHgQYw1uc8RE2tCaByZTys2AzpynyMm1oqARkC98k8Sx6wTAgvucwTROCZAqPWfB0wxIbBDrLUKonGMXQqNQ+0ceTERO07RHQ5RNVexOWj205p1Bp/QNcJqIoRaAsc0EwKTz9bInVMkkMbhfBoah9Y58mIixs6pBRqBNSXROCY/rVlk8CmYxjHta0XGVKc1q77ILo4Gf+IcG8SR+xzOZw7SCK3H/jmWxNEffMqLieixBjTCK+NpwGF75siLifRxxNLgwPMYdo52rMmLiWixFkUakTX+5YNJHDn45OscpBFeUyDUCDimusHDnPscpBFdmS8rNqTTmryYSAMnzTR4jKZ1jjnvWzPHhCCdNI6JTxxLlAUmBCYcfKaVxuH85K+EjekmBFaItXTR4DT6v/bOoLWJKIjjs6wKYRHKGojRBZMYpSEhWEIIhuAlhxZKbQUVRNCbeBRE6EWoWBXRjyClICnYq8dc9CRePO2n2IuHNNBAC07WrjGmJumyu5l5O79D6P3HzJvM//WldZLKkYvsg8pBNSFTcv7IIZ/nkLrI/uUUhA0WTuvIjeQ50xGRGmTNbo1WDpMbn7NbfH4JvaF5hdNiM60RyXPCrxpvVEM5NKc1qnkOqomGZL7lyZE8ZyqwoUVF7Y8cyXNIVQ2SqLY8OQTzHHKLz6+oJjqu256cKfOcOF9kx6qJEr3a8uRInkNLDUA678lhnudM2hAwa2h95gr2kRzJc2hVDWLlWyesHPQSv4eJUM0MqLmFw2lD4DfPYacGu5prhuGG4KRtjZ0agJTX1STPoaYGtJLX1STPIaYGwPAKR/Icamq8LzmjlcPoBY9p5XBTA4BdbUxbo/PGZxB5DjM1YM23W8SntcAeJmKmBruaPSRnYIdRnjPtKM1MDc5qrhxZfNJTA2DMt1EOww2BrzyHlZr+N9DfciTPIacGoGK3pa3RVAN66bccyXPIqXGPHFcOxTwn+IvsrNQA1G1Xjo88R72HiYipcY8cptOar8UnJzWgF1AO+Q1BYLs1TmoAjGrbb+Wo9DARRTUAmXlXjup5zp/FJyM1/bigjbDNc056kZ2TGnceQGKc5/wgqwa02kDOuIvsqv7CLt2qQfRa2/eZw/9hIsJV0ydRaiPxzHOIq+mnoKgmlotP8moAkiiH64bAV57D4azxMFEO3cVn8G2NTdW4chRpa9NuCBipAUj15TDNc3wtPnk0tDFytqm0teDzHDZV48pBM2TynJAvsn/mpQblcJ3WfFxkZ6bmt5x45Dns1ExROUw2BJPk4Gsb/EA5MchznjSBIyhH+Tzne/M0sMS0Vc9zck0NmGJV20rnOTmOZ42HscYiz/G5+Mzxm9D+JlGzZ57nhHSRfX3hEvBGu5JXYvE5Iie3cBHYU6/y3BCMv8i+fuM8KECmao/KobIh8NnWHjV1UALLvY7L47+ppxulmU8Bf2PUbJYbguPznPVHuQugDlra5rwhGJKznruhwBTwN2bB9lM59PKcx3uXE6AYRinPcVr7t3Ier18F9dCv5G32ec7eZcX62aCvHclh+yL
787XvMMKIpes21fZw6Rh4nYb2nGoaUKNvVp7T8PE6GapnJDwDBGZbRyXKjnOWoXzRFYOn6mtRkvPveaSuzPJmHgwMZsQ7B3Q6VNwKTS4ZTnfMgtKzuejaKn5202eY6y32n+h4XjNIsNQWMhNu1sgFnK2/TynHfDchoLZxUfnI9Hr1fzn3xUTnQPEzUay7E049pJVx2601qjEbeDZhgD7XwiuSH41rh8DmJO344d0rTmf0PwLbsYgzXAZBLpap7WtJbNXs6wvUwbeO0UHIdKnvMKzVwUMwP0esHZJpHnZJfiPQEch2auOc7Mf2E3u1CO7dQ8Di1Z23acGf7CbnZp8cIcCMdjpQvXnN3JeU4Ybe390rI0swmtrfLg2m7ki8/s+0VpZlNgpGo4tkX1gge6Oeyuls/LZDb1UF26tu1E0da63e5S8ZIiF8+jwkpX7ne2tsL9hd3u4cqyKce/r+ZWubXb2QhpWusebi4Wk1IxvjEy6dLNrQ4WUIAbgo+b3c3u6u0LspcJoHzSdzc6G52dnQDynM3Nj4eHK8VyUrwExFzCrKztbnX20Y3PPAfNPD84eP56sVg3ZFoOGiOTeli6vbOxs7//4oS7tTcHb96+WV0tXsgYIISFZqXK6dLdmy/2nz7dwY8xZ87rt73eW/w4WFm5d6VcTso8FglzifNmvVKsoCMsnWc/h+j1egc99PPyzp3bxeJy3UqcFy3RoxtGBqlfR6544N/1DHLR0OXAnykaYljJZNI0zVQqhZ/4tzWnaeJFEARBEARBEARBEARBEARBEARBEASBMr8ADJvUZ0bGgJQAAAAASUVORK5CYII=",mp={},my=fA,mg=pI,mm=px,mb=pM,mv=f1,mw=gC;mp.f=my&&!mg?Object.defineProperties:function(e,t){mb(e);for(var r,n=mv(t),i=mw(t),o=i.length,s=0;o>s;)mm.f(e,r=i[s++],n[r]);return e};var m_=f7("document","documentElement"),mE=pM,mS=mp,mx=y7,mA=ye,mI=m_,mO=pd,mT=">",mP="<",mM="prototype",mN="script",mk=p7("IE_PROTO"),mC=function(){},mD=function(e){return mP+mN+mT+e+mP+"/"+mN+mT},mj=function(e){e.write(mD("")),e.close();var t=e.parentWindow.Object;return e=null,t},mR=function(){var e,t=mO("iframe"),r="java"+mN+":";return t.style.display="none",mI.appendChild(t),t.src=String(r),(e=t.contentWindow.document).open(),e.write(mD("document.F=Object")),e.close(),e.F},mL=function(){try{d=new ActiveXObject("htmlfile")}catch(e){}mL="undefined"!=typeof document?document.domain&&d?mj(d):mR():mj(d);for(var e=mx.length;e--;)delete mL[mM][mx[e]];return mL()};mA[mk]=!0;var mB=Object.create||function(e,t){var r;return null!==e?(mC[mM]=mE(e),r=new mC,mC[mM]=null,r[mk]=e):r=mL(),void 0===t?r:mS.f(r,t)},mU=h4,m$=mB,mK=px.f,mF=mU("unscopables"),mz=Array.prototype;void 0===mz[mF]&&mK(mz,mF,{configurable:!0,value:m$(null)});var mq=function(e){mz[mF][e]=!0},mV={},mH=!fx(function(){function e(){}return e.prototype.constructor=null,Object.getPrototypeOf(new e)!==e.prototype}),mG=hW,mW=f5,mJ=hV,mZ=mH,mY=p7("IE_PROTO"),mX=Object,mQ=mX.prototype,m0=mZ?mX.getPrototypeOf:function(e){var t=mJ(e);if(mG(t,mY))return t[mY];var r=t.constructor;return mW(r)&&t instanceof r?r.prototype:t instanceof mX?mQ:null},m1=fx,m2=f5,m5=f8,m3=m0,m8=yU,m6=h4("iterator"),m4=!1;[].keys&&("next"in(p=[].keys())?(h=m3(m3(p)))!==Object.prototype&&(f=h):m4=!0),(!m5(f)||m1(function(){var e={};return f[m6].call(e)!==e}))&&(f={}),m2(f[m6])||m8(f,m6,function(){return this});var m9={IteratorPrototype:f,BUGGY_SAFARI_ITERATORS:m4},m7=px.f,be=hW,bt=h4("toStringTag"),br=function(e,t,r){e&&!r&&(e=e.prototype),e&&!be(e,bt)&&m7(e,bt,{configurable:!0,value:t})},bn=m9.IteratorPrototype,bi=mB,bo=fD,bs=br,ba=mV,bc=function(){return this},bu=function(e,t,r,n){var i=t+" Iterator";return e.prototype=bi(bn,{next:bo(+!n,r)}),bs(e,i,!1),ba[i]=bc,e},bl=fU,bd=hx,bf=f8,bh=function(e){return bf(e)||null===e},bp=String,by=TypeError,bg=function(e,t,r){try{return bl(bd(Object.getOwnPropertyDescriptor(e,t)[r]))}catch(e){}},bm=f8,bb=fX,bv=function(e){if(bh(e))return e;throw new by("Can't set "+bp(e)+" as a prototype")}
78,bw=Object.setPrototypeOf||("__proto__"in{}?function(){var e,t=!1,r={};try{(e=bg(Object.prototype,"__proto__","set"))(r,[]),t=r instanceof Array}catch(e){}return function(r,n){return bb(r),bv(n),bm(r)&&(t?e(r,n):r.__proto__=n),r}}():void 0),b_=gM,bE=fP,bS=pX,bx=f5,bA=bu,bI=m0,bO=bw,bT=br,bP=pq,bM=yU,bN=h4,bk=mV,bC=m9,bD=bS.PROPER,bj=bS.CONFIGURABLE,bR=bC.IteratorPrototype,bL=bC.BUGGY_SAFARI_ITERATORS,bB=bN("iterator"),bU="keys",b$="values",bK="entries",bF=function(){return this},bz=function(e,t,r,n,i,o,s){bA(r,t,n);var a,c,u,l=function(e){if(e===i&&y)return y;if(!bL&&e&&e in h)return h[e];switch(e){case bU:case b$:case bK:return function(){return new r(this,e)}}return function(){return new r(this)}},d=t+" Iterator",f=!1,h=e.prototype,p=h[bB]||h["@@iterator"]||i&&h[i],y=!bL&&p||l(i),g="Array"===t&&h.entries||p;if(g&&(a=bI(g.call(new e)))!==Object.prototype&&a.next&&(bI(a)===bR||(bO?bO(a,bR):bx(a[bB])||bM(a,bB,bF)),bT(a,d,!0)),bD&&i===b$&&p&&p.name!==b$&&(bj?bP(h,"name",b$):(f=!0,y=function(){return bE(p,this)})),i){if(c={values:l(b$),keys:o?y:l(bU),entries:l(bK)},s)for(u in c)!bL&&!f&&u in h||bM(h,u,c[u]);else b_({target:t,proto:!0,forced:bL||f},c)}return h[bB]!==y&&bM(h,bB,y,{name:i}),bk[t]=y,c},bq=function(e,t){return{value:e,done:t}},bV=f1,bH=mq,bG=mV,bW=yg,bJ=px.f,bZ=bz,bY=bq,bX=fA,bQ="Array Iterator",b0=bW.set,b1=bW.getterFor(bQ),b2=bZ(Array,"Array",function(e,t){b0(this,{type:bQ,target:bV(e),index:0,kind:t})},function(){var e=b1(this),t=e.target,r=e.index++;if(!t||r>=t.length)return e.target=null,bY(void 0,!0);switch(e.kind){case"keys":return bY(r,!1);case"values":return bY(t[r],!1)}return bY([r,t[r]],!1)},"values"),b5=bG.Arguments=bG.Array;if(bH("keys"),bH("values"),bH("entries"),bX&&"values"!==b5.name)try{bJ(b5,"name",{value:"values"})}catch(e){}var b3={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},b8=pd("span").classList,b6=b8&&b8.constructor&&b8.constructor.prototype,b4=fE,b9=b3,b7=b6===Object.prototype?void 0:b6,ve=b2,vt=pq,vr=br,vn=h4("iterator"),vi=ve.values,vo=function(e,t){if(e){if(e[vn]!==vi)try{vt(e,vn,vi)}catch(t){e[vn]=vi}if(vr(e,t,!0),b9[t]){for(var r in ve)if(e[r]!==ve[r])try{vt(e,r,ve[r])}catch(t){e[r]=ve[r]}}}};for(var vs in b9)vo(b4[vs]&&b4[vs].prototype,vs);vo(b7,"DOMTokenList");let va=e=>null!=e&&e.length>0,vc=e=>!va(e),vu=(e,t)=>mf(void 0,void 0,void 0,function*(){let e=new w.R(window.localStorage,"_meteor_wallet");return{wallet:new fb(Object.assign(Object.assign({},t),{keyStore:e})),keyStore:e}}),vl=({options:e,logger:t,store:r,params:n,metadata:i})=>mf(void 0,void 0,void 0,function*(){let o=yield vu(n,e.network),s=()=>mf(void 0,void 0,void 0,function*(){let e=o.wallet.getAccountId(),t=yield o.wallet.account();if(vc(e)||null==t)return[];let r=yield t.getSigner().getPublicKey();return[{accountId:e,publicKey:r?r.toString():""}]});return{signIn({contractId:e,methodNames:r=[]}){return mf(this,void 0,void 0,function*(){t.log("MeteorWallet:signIn",{contractId:e,methodNames:r}),r.length?yield o.wallet.requestSignIn({methods:r,type:dJ.SELECTED_METHODS,contract_id:null!=e?e:""}):yield o.wallet.requestSignIn({type:dJ.ALL_METHODS,contract_id:null!=e?e:""});let n=yield s();return t.log("MeteorWallet:signIn",{contractId:e,methodNames:r,account:n[0]}),n})},signOut(){return mf(this,void 0,void 0,function*(){o.wallet.isSignedIn()&&(yield o.wallet.signOut())})},isSignedIn(){return mf(this,void 0,void 0,function*(){return!!o.wallet&&o.wallet.isSignedIn()})},getAccounts(){return mf(this,void 0,void 0,function*(){return s()})},verifyOwner({message:e}){return mf(this,void 0,void 0,function*(){t.log("MeteorWallet:verifyOwner",{message:e});let r=yield o.wallet.verifyOwner({message:e});if(r.success)return r.payload;throw Error(`Couldn't verify owner: ${r.message}`)})},signMessage({message:e,nonce:r,recipient:n,state:i}){return mf(this,void 0,void 0,function*(){t.log("MeteorWallet:signMessage",{message:e,nonce:r,recipient:n,state:i});let s=o.wallet.getAccountId(),a=yield o.wallet.signMessage({message:e,nonce:r,recipient:n,accountId:s,state:i});if(a.success)return a.payload;throw Error(`Couldn't sign message owner: ${a.message}`)})},signAndSendTransaction({signerId:e,receiverId:n,actions:i}){return mf(this,void 0,void 0,function*(){t.log("MeteorWallet:signAndSendTransaction",{signerId:e,receiverId:n,actions:i});let{contract:s}=r.getState();if(!o.wallet.isSignedIn())throw Error("Wallet not signed in");if(!n&&!s)throw Error("No receiver found to send the transaction to");return(yield o.wallet.account()).signAndSendTransaction_direct({receiverId:null!=n?n:s.contractId,actions:i.map(e=>(0,v.Cc)(e))})})},signAndSendTransactions({transactions:e}){return mf(this,void 0,void 0,function*(){if(t.log("MeteorWallet:signAndSendTransactions",{transactions:e}),!o.wallet.isSignedIn())throw Error("Wallet not signed in");return o.wallet.requestSignTransactions({transactions:e.map(e=>Object.assign(Object.assign({},e),{actions:e.actions.map(e=>(0,v.Cc)(e))}))})})},createSignedTransaction(e,r){return mf(this,void 0,void 0,function*(){throw t.log("createSignedTransaction",{receiverId:e,actions:r}),Error(`Method not supported by ${i.name}`)})},signTransaction(e){return mf(this,void 0,void 0,function*(){throw t.log("signTransaction",{transaction:e}),Error(`Method not supported by ${i.name}`)})},getPublicKey(){return mf(this,void 0,void 0,function*(){throw t.log("getPublicKey",{}),Error(`Method not supported by ${i.name}`)})},signNep413Message(e,r,n,o,s){return mf(this,void 0,void 0,function*(){throw t.log("signNep413Message",{message:e,accountId:r,recipient:n,nonce:o,callbackUrl:s}),Error(`Method not supported by ${i.name}`)})},signDelegateAction(e){return mf(this,void 0,void 0,function*(){throw t.log("signDelegateAction",{delegateAction:e}),Error(`Method not supported by ${i.name}`)})},buildImportAccountsUrl:()=>`https://wallet.meteorwallet.app/batch-import?network=${o.wallet._networkId}`}});function vd({iconUrl:e=mh,deprecated:t=!1}={}){return()=>mf(this,void 0,void 0,function*(){return{id:"meteor-wallet",type:"injected",metadata:{available:!0,name:"Meteor Wallet",description:"Securely store and stake your NEAR tokens and compatible assets with Meteor.",iconUrl:e,deprecated:t,downloadUrl:"https://wallet.meteorwallet.app",useUrlAccountImport:!0},init:t=>vl(Object.assign(Object.assign({},t),{params:{iconUrl:e}}))}})}},92511:(e,t,r)=>{"use strict";r.d(t,{r:()=>lx});var n,i,o,s,a,c,u,l,d,f,h,p,y,g,m,b,v,w,_,E,S,x,A=r(51957),I=r(7490),O=r(75927).Buffer,T="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},P=function(e){try{return!!e()}catch(e){return!0}},M=!P(function(){var e=(function(){}).bind();return"function"!=typeof e||e.hasOwnProperty("prototype")}),N=M,k=Function.prototype,C=k.call,D=N&&k.bind.bind(C,C),j=N?D:function(e){return function(){return C.apply(e,arguments)}},R=j,L=R({}.toString),B=R("".slice),U=function(e){return B(L(e),8,-1)},$=P,K=U,F=Object,z=j("".split),q=$(function(){return!F("z").propertyIsEnumerable(0)})?function(e){return"String"===K(e)?z(e,""):F(e)}:F,V=function(e){return null==e},H=V,G=TypeError,W=function(e){if(H(e))throw new G("Can't call method on "+e);return e},J=q,Z=W,Y=function(e){return J(Z(e))},X=function(e){return e&&e.Math===Math&&e},Q=X("object"==typeof globalThis&&globalThis)||X("object"==typeof window&&window)||X("object"==typeof self&&self)||X("object"==typeof T&&T)||X("object"==typeof T&&T)||function(){return this}()||Function("return this")(),ee={exports:{}},et=Q,er=Object.defineProperty,en=function(e,t){try{er(et,e,{value:t,configurable:!0,writable:!0})}catch(r){et[e]=t}return t},ei=Q,eo=en,es="__core-js_shared__",ea=ee.exports=ei[es]||eo(es,{});(ea.versions||(ea.versions=[])).push({version:"3.41.0",mode:"global",copyright:"\xa9 2014-2025 Denis Pushkarev (zloirock.ru)",license:"https://github.com/zloirock/core-js/blob/v3.41.0/LICENSE",source:"https://github.com/zloirock/core-js"});var ec=ee.exports,eu=function(e,t){return ec[e]||(ec[e]=t||{})},el=W,ed=Object,ef=function(e){return ed(el(e))},eh=ef,ep=j({}.hasOwnProperty),ey=Object.hasOwn||function(e,t){return ep(eh(e),t)},eg=0,em=Math.random(),eb=j(1..toString),ev=function(e){return"Symbol("+(void 0===e?"":e)+")_"+eb(++eg+em,36)},ew=Q.navigator,e_=ew&&ew.userAgent,eE=e_?String(e_):"",eS=Q,ex=eE,eA=eS.process,eI=eS.Deno,eO=eA&&eA.versions||eI&&eI.version,eT=eO&&eO.v8;eT&&(i=(n=eT.split("."))[0]>0&&n[0]<4?1:+(n[0]+n[1])),!i&&ex&&(!(n=ex.match(/Edge\/(\d+)/))||n[1]>
vendor: 9,915 bytes, line 78
78=74)&&(n=ex.match(/Chrome\/(\d+)/))&&(i=+n[1]);var eP=i,eM=eP,eN=P,ek=Q.String,eC=!!Object.getOwnPropertySymbols&&!eN(function(){var e=Symbol("symbol detection");return!ek(e)||!(Object(e)instanceof Symbol)||!Symbol.sham&&eM&&eM<41}),eD=eC&&!Symbol.sham&&"symbol"==typeof Symbol.iterator,ej=eu,eR=ey,eL=ev,eB=eC,eU=eD,e$=Q.Symbol,eK=ej("wks"),eF=eU?e$.for||e$:e$&&e$.withoutSetter||eL,ez=function(e){return eR(eK,e)||(eK[e]=eB&&eR(e$,e)?e$[e]:eF("Symbol."+e)),eK[e]},eq="object"==typeof document&&document.all,eV=void 0===eq&&void 0!==eq?function(e){return"function"==typeof e||e===eq}:function(e){return"function"==typeof e},eH=eV,eG=function(e){return"object"==typeof e?null!==e:eH(e)},eW=eG,eJ=String,eZ=TypeError,eY=function(e){if(eW(e))return e;throw new eZ(eJ(e)+" is not an object")},eX={},eQ=!P(function(){return 7!==Object.defineProperty({},1,{get:function(){return 7}})[1]}),e0=P,e1=eQ&&e0(function(){return 42!==Object.defineProperty(function(){},"prototype",{value:42,writable:!1}).prototype}),e2={},e5=eG,e3=Q.document,e8=e5(e3)&&e5(e3.createElement),e6=function(e){return e8?e3.createElement(e):{}},e4=P,e9=e6,e7=!eQ&&!e4(function(){return 7!==Object.defineProperty(e9("div"),"a",{get:function(){return 7}}).a}),te=M,tt=Function.prototype.call,tr=te?tt.bind(tt):function(){return tt.apply(tt,arguments)},tn=Q,ti=eV,to=function(e){return ti(e)?e:void 0},ts=function(e,t){return arguments.length<2?to(tn[e]):tn[e]&&tn[e][t]},ta=j({}.isPrototypeOf),tc=ts,tu=eV,tl=ta,td=Object,tf=eD?function(e){return"symbol"==typeof e}:function(e){var t=tc("Symbol");return tu(t)&&tl(t.prototype,td(e))},th=String,tp=function(e){try{return th(e)}catch(e){return"Object"}},ty=eV,tg=tp,tm=TypeError,tb=function(e){if(ty(e))return e;throw new tm(tg(e)+" is not a function")},tv=tb,tw=V,t_=function(e,t){var r=e[t];return tw(r)?void 0:tv(r)},tE=tr,tS=eV,tx=eG,tA=TypeError,tI=tr,tO=eG,tT=tf,tP=t_,tM=function(e,t){var r,n;if("string"===t&&tS(r=e.toString)&&!tx(n=tE(r,e))||tS(r=e.valueOf)&&!tx(n=tE(r,e))||"string"!==t&&tS(r=e.toString)&&!tx(n=tE(r,e)))return n;throw new tA("Can't convert object to primitive value")},tN=TypeError,tk=ez("toPrimitive"),tC=function(e,t){if(!tO(e)||tT(e))return e;var r,n=tP(e,tk);if(n){if(void 0===t&&(t="default"),!tO(r=tI(n,e,t))||tT(r))return r;throw new tN("Can't convert object to primitive value")}return void 0===t&&(t="number"),tM(e,t)},tD=tf,tj=function(e){var t=tC(e,"string");return tD(t)?t:t+""},tR=eQ,tL=e7,tB=e1,tU=eY,t$=tj,tK=TypeError,tF=Object.defineProperty,tz=Object.getOwnPropertyDescriptor,tq="enumerable",tV="configurable",tH="writable";e2.f=tR?tB?function(e,t,r){if(tU(e),t=t$(t),tU(r),"function"==typeof e&&"prototype"===t&&"value"in r&&tH in r&&!r[tH]){var n=tz(e,t);n&&n[tH]&&(e[t]=r.value,r={configurable:tV in r?r[tV]:n[tV],enumerable:tq in r?r[tq]:n[tq],writable:!1})}return tF(e,t,r)}:tF:function(e,t,r){if(tU(e),t=t$(t),tU(r),tL)try{return tF(e,t,r)}catch(e){}if("get"in r||"set"in r)throw new tK("Accessors not supported");return"value"in r&&(e[t]=r.value),e};var tG=Math.ceil,tW=Math.floor,tJ=Math.trunc||function(e){var t=+e;return(t>0?tW:tG)(t)},tZ=function(e){var t=+e;return t!=t||0===t?0:tJ(t)},tY=tZ,tX=Math.max,tQ=Math.min,t0=tZ,t1=Math.min,t2=function(e){var t=t0(e);return t>0?t1(t,0x1fffffffffffff):0},t5=function(e){return t2(e.length)},t3=Y,t8=function(e,t){var r=tY(e);return r<0?tX(r+t,0):tQ(r,t)},t6=t5,t4=function(e){return function(t,r,n){var i,o=t3(t),s=t6(o);if(0===s)return!e&&-1;var a=t8(n,s);if(e&&r!=r){for(;s>a;)if((i=o[a++])!=i)return!0}else for(;s>a;a++)if((e||a in o)&&o[a]===r)return e||a||0;return!e&&-1}},t9={includes:t4(!0),indexOf:t4(!1)},t7={},re=j,rt=ey,rr=Y,rn=t9.indexOf,ri=t7,ro=re([].push),rs=function(e,t){var r,n=rr(e),i=0,o=[];for(r in n)!rt(ri,r)&&rt(n,r)&&ro(o,r);for(;t.length>i;)rt(n,r=t[i++])&&(~rn(o,r)||ro(o,r));return o},ra=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"],rc=rs,ru=ra,rl=Object.keys||function(e){return rc(e,ru)},rd=eQ,rf=e1,rh=e2,rp=eY,ry=Y,rg=rl;eX.f=rd&&!rf?Object.defineProperties:function(e,t){rp(e);for(var r,n=ry(t),i=rg(t),o=i.length,s=0;o>s;)rh.f(e,r=i[s++],n[r]);return e};var rm=ts("document","documentElement"),rb=ev,rv=eu("keys"),rw=function(e){return rv[e]||(rv[e]=rb(e))},r_=eY,rE=eX,rS=ra,rx=t7,rA=rm,rI=e6,rO=">",rT="<",rP="prototype",rM="script",rN=rw("IE_PROTO"),rk=function(){},rC=function(e){return rT+rM+rO+e+rT+"/"+rM+rO},rD=function(e){e.write(rC("")),e.close();var t=e.parentWindow.Object;return e=null,t},rj=function(){var e,t=rI("iframe"),r="java"+rM+":";return t.style.display="none",rA.appendChild(t),t.src=String(r),(e=t.contentWindow.document).open(),e.write(rC("document.F=Object")),e.close(),e.F},rR=function(){try{o=new ActiveXObject("htmlfile")}catch(e){}rR="undefined"!=typeof document?document.domain&&o?rD(o):rj():rD(o);for(var e=rS.length;e--;)delete rR[rP][rS[e]];return rR()};rx[rN]=!0;var rL=Object.create||function(e,t){var r;return null!==e?(rk[rP]=r_(e),r=new rk,rk[rP]=null,r[rN]=e):r=rR(),void 0===t?r:rE.f(r,t)},rB=ez,rU=rL,r$=e2.f,rK=rB("unscopables"),rF=Array.prototype;void 0===rF[rK]&&r$(rF,rK,{configurable:!0,value:rU(null)});var rz=function(e){rF[rK][e]=!0},rq={},rV=eV,rH=Q.WeakMap,rG=rV(rH)&&/native code/.test(String(rH)),rW=function(e,t){return{enumerable:!(1&e),configurable:!(2&e),writable:!(4&e),value:t}},rJ=e2,rZ=rW,rY=eQ?function(e,t,r){return rJ.f(e,t,rZ(1,r))}:function(e,t,r){return e[t]=r,e},rX=rG,rQ=Q,r0=eG,r1=rY,r2=ey,r5=ee.exports,r3=rw,r8=t7,r6="Object already initialized",r4=rQ.TypeError,r9=rQ.WeakMap,r7=function(e){return c(e)?a(e):s(e,{})},ne=function(e){return function(t){var r;if(!r0(t)||(r=a(t)).type!==e)throw new r4("Incompatible receiver, "+e+" required");return r}};if(rX||r5.state){var nt=r5.state||(r5.state=new r9);nt.get=nt.get,nt.has=nt.has,nt.set=nt.set,s=function(e,t){if(nt.has(e))throw new r4(r6);return t.facade=e,nt.set(e,t),t},a=function(e){return nt.get(e)||{}},c=function(e){return nt.has(e)}}else{var nr=r3("state");r8[nr]=!0,s=function(e,t){if(r2(e,nr))throw new r4(r6);return t.facade=e,r1(e,nr,t),t},a=function(e){return r2(e,nr)?e[nr]:{}},c=function(e){return r2(e,nr)}}var nn={set:s,get:a,has:c,enforce:r7,getterFor:ne},ni={},no={},ns={}.propertyIsEnumerable,na=Object.getOwnPropertyDescriptor,nc=na&&!ns.call({1:2},1);no.f=nc?function(e){var t=na(this,e);return!!t&&t.enumerable}:ns;var nu=eQ,nl=tr,nd=no,nf=rW,nh=Y,np=tj,ny=ey,ng=e7,nm=Object.getOwnPropertyDescriptor;ni.f=nu?nm:function(e,t){if(e=nh(e),t=np(t),ng)try{return nm(e,t)}catch(e){}if(ny(e,t))return nf(!nl(nd.f,e,t),e[t])};var nb={exports:{}},nv=eQ,nw=Function.prototype,n_=nv&&Object.getOwnPropertyDescriptor,nE=ey(nw,"name"),nS=nE&&"something"===(function(){}).name,nx=nE&&(!nv||nv&&n_(nw,"name").configurable),nA={EXISTS:nE,PROPER:nS,CONFIGURABLE:nx},nI=j,nO=eV,nT=ee.exports,nP=nI(Function.toString);nO(nT.inspectSource)||(nT.inspectSource=function(e){return nP(e)});var nM=nT.inspectSource,nN=j,nk=P,nC=eV,nD=ey,nj=eQ,nR=nA.CONFIGURABLE,nL=nM,nB=nn,nU=nB.enforce,n$=nB.get,nK=String,nF=Object.defineProperty,nz=nN("".slice),nq=nN("".replace),nV=nN([].join),nH=nj&&!nk(function(){return 8!==nF(function(){},"length",{value:8}).length}),nG=String(String).split("String"),nW=nb.exports=function(e,t,r){"Symbol("===nz(nK(t),0,7)&&(t="["+nq(nK(t),/^Symbol\(([^)]*)\).*$/,"$1")+"]"),r&&r.getter&&(t="get "+t),r&&r.setter&&(t="set "+t),(!nD(e,"name")||nR&&e.name!==t)&&(nj?nF(e,"name",{value:t,configurable:!0}):e.name=t),nH&&r&&nD(r,"arity")&&e.length!==r.arity&&nF(e,"length",{value:r.arity});try{r&&nD(r,"constructor")&&r.constructor?nj&&nF(e,"prototype",{writable:!1}):e.prototype&&(e.prototype=void 0)}catch(e){}var n=nU(e);return nD(n,"source")||(n.source=nV(nG,"string"==typeof t?t:"")),e};Function.prototype.toString=nW(function(){return nC(this)&&n$(this).source||nL(this)},"toString");var nJ=eV,nZ=e2,nY=nb.exports,nX=en,nQ=function(e,t,r,n){n||(n={});var i=n.enumerable,o=void 0!==n.name?n.name:t;if(nJ(r)&&nY(r,o,n),n.global)i?e[t]=r:nX(t,r);else{try{n.unsafe?e[t]&&(i=!0):delete e[t]}catch(e){}i?e[t]=r:nZ.f(e,t,{value:r,enumerable:!1,configurable:!n.nonConfigurable,writable:!n.nonWritable})}return e},n0={},n1=rs,n2=ra.concat("length","prototype");n0.f=Object.getOwnPropertyNames||function(e){return n1(e,n2)};var n5={};n5.f=Object.getOwnPropertySymbols;var n3=ts,n8=n0,n6=n5,n4=eY,n9=j([].concat),n7=n3("Reflect","ownKeys")||function(e){var t=n8.f(n4(e)),r=n6.f;return r?n9(t,r(e)):t},ie=ey,it=n7,ir=ni,ii=e2,io=function(e,t,r){for(var n=it(t),i=ii.f,o=ir.f,s=0;s<n.length;s++){var a=n[s];ie(e,a)||r&&ie(r,a)||i(e,a,o(t,a))}},is=P,ia=eV,ic=/#|\.prototype\./,iu=function(e,t){var r=id[il(e)];return r===ip||r!==ih&&(ia(t)?is(t):!!t)},il=iu.normalize=function(e){return String(e).replace(ic,".").toLowerCase()},id=iu.data={},ih=iu.NATIVE="N",ip=iu.POLYFILL="P",iy=iu,ig=Q,im=ni.f,ib=rY,iv=nQ,iw=en,i_=io,iE=iy,iS=function(e,t){var r,n,i,o,s,a=e.target,c=e.global,u=e.stat;if(r=c?ig:u?ig[a]||iw(a,{}):ig[a]&&ig[a].prototype)for(n in t){if(o=t[n],i=e.dontCallGetSet?(s=im(r,n))&&s.value:r[n],!iE(c?n:a+(u?".":"#")+n,e.forced)&&void 0!==i){if(typeof o==typeof i)continue;i_(o,i)}(e.sham||i&&i.sham)&&ib(o,"sham",!0),iv(r,n,o,e)}},ix=!P(function(){function e(){}return e.prototype.constructor=null,Object.getPrototypeOf(new e)!==e.prototype}),iA=ey,iI=eV,iO=ef,iT=ix,iP=rw("IE_PROTO"),iM=Object,iN=iM.prototype,ik=iT?iM.getPrototypeOf:function(e){var t=iO(e);if(iA(t,iP))return t[iP];var r=t.constructor;return iI(r)&&t instanceof r?r.prototype:t instanceof iM?iN:null},iC=P,iD=eV,ij=eG,iR=ik,iL=nQ,iB=ez("iterator"),iU=!1;[].keys&&("next"in(d=[].keys())?(l=iR(iR(d)))!==Object.prototype&&(u=l):iU=!0),(!ij(u)||iC(function(){var e={};return u[iB].call(e)!==e}))&&(u={}),iD(u[iB])||iL(u,iB,function(){return this});var i$={IteratorPrototype:u,BUGGY_SAFARI_ITERATORS:iU},iK=e2.f,iF=ey,iz=ez("toStringTag"),iq=function(e,t,r){e&&!r&&(e=e.prototype),e&&!i
78F(e,iz)&&iK(e,iz,{configurable:!0,value:t})},iV=i$.IteratorPrototype,iH=rL,iG=rW,iW=iq,iJ=rq,iZ=function(){return this},iY=function(e,t,r,n){var i=t+" Iterator";return e.prototype=iH(iV,{next:iG(+!n,r)}),iW(e,i,!1),iJ[i]=iZ,e},iX=j,iQ=tb,i0=eG,i1=function(e){return i0(e)||null===e},i2=String,i5=TypeError,i3=function(e,t,r){try{return iX(iQ(Object.getOwnPropertyDescriptor(e,t)[r]))}catch(e){}},i8=eG,i6=W,i4=function(e){if(i1(e))return e;throw new i5("Can't set "+i2(e)+" as a prototype")},i9=Object.setPrototypeOf||("__proto__"in{}?function(){var e,t=!1,r={};try{(e=i3(Object.prototype,"__proto__","set"))(r,[]),t=r instanceof Array}catch(e){}return function(r,n){return i6(r),i4(n),i8(r)&&(t?e(r,n):r.__proto__=n),r}}():void 0),i7=iS,oe=tr,ot=nA,or=eV,on=iY,oi=ik,oo=i9,os=iq,oa=rY,oc=nQ,ou=ez,ol=rq,od=i$,of=ot.PROPER,oh=ot.CONFIGURABLE,op=od.IteratorPrototype,oy=od.BUGGY_SAFARI_ITERATORS,og=ou("iterator"),om="keys",ob="values",ov="entries",ow=function(){return this},o_=function(e,t,r,n,i,o,s){on(r,t,n);var a,c,u,l=function(e){if(e===i&&y)return y;if(!oy&&e&&e in h)return h[e];switch(e){case om:case ob:case ov:return function(){return new r(this,e)}}return function(){return new r(this)}},d=t+" Iterator",f=!1,h=e.prototype,p=h[og]||h["@@iterator"]||i&&h[i],y=!oy&&p||l(i),g="Array"===t&&h.entries||p;if(g&&(a=oi(g.call(new e)))!==Object.prototype&&a.next&&(oi(a)===op||(oo?oo(a,op):or(a[og])||oc(a,og,ow)),os(a,d,!0)),of&&i===ob&&p&&p.name!==ob&&(oh?oa(h,"name",ob):(f=!0,y=function(){return oe(p,this)})),i){if(c={values:l(ob),keys:o?y:l(om),entries:l(ov)},s)for(u in c)!oy&&!f&&u in h||oc(h,u,c[u]);else i7({target:t,proto:!0,forced:oy||f},c)}return h[og]!==y&&oc(h,og,y,{name:i}),ol[t]=y,c},oE=function(e,t){return{value:e,done:t}},oS=Y,ox=rz,oA=rq,oI=nn,oO=e2.f,oT=o_,oP=oE,oM=eQ,oN="Array Iterator",ok=oI.set,oC=oI.getterFor(oN),oD=oT(Array,"Array",function(e,t){ok(this,{type:oN,target:oS(e),index:0,kind:t})},function(){var e=oC(this),t=e.target,r=e.index++;if(!t||r>=t.length)return e.target=null,oP(void 0,!0);switch(e.kind){case"keys":return oP(r,!1);case"values":return oP(t[r],!1)}return oP([r,t[r]],!1)},"values"),oj=oA.Arguments=oA.Array;if(ox("keys"),ox("values"),ox("entries"),oM&&"values"!==oj.name)try{oO(oj,"name",{value:"values"})}catch(e){}var oR=eQ,oL=tr,oB=P,oU=rl,o$=n5,oK=no,oF=ef,oz=q,oq=Object.assign,oV=Object.defineProperty,oH=j([].concat),oG=!oq||oB(function(){if(oR&&1!==oq({b:1},oq(oV({},"a",{enumerable:!0,get:function(){oV(this,"b",{value:3,enumerable:!1})}}),{b:2})).b)return!0;var e={},t={},r=Symbol("assign detection"),n="abcdefghijklmnopqrst";return e[r]=7,n.split("").forEach(function(e){t[e]=e}),7!==oq({},e)[r]||oU(oq({},t)).join("")!==n})?function(e,t){for(var r=oF(e),n=arguments.length,i=1,o=o$.f,s=oK.f;n>i;)for(var a,c=oz(arguments[i++]),u=o?oH(oU(c),o(c)):oU(c),l=u.length,d=0;l>d;)a=u[d++],(!oR||oL(s,c,a))&&(r[a]=c[a]);return r}:oq;iS({target:"Object",stat:!0,arity:2,forced:Object.assign!==oG},{assign:oG});var oW=Q,oJ=eE,oZ=U,oY=function(e){return oJ.slice(0,e.length)===e},oX=function(){return oY("Bun/")?"BUN":oY("Cloudflare-Workers")?"CLOUDFLARE":oY("Deno/")?"DENO":oY("Node.js/")?"NODE":oW.Bun&&"string"==typeof Bun.version?"BUN":oW.Deno&&"object"==typeof Deno.version?"DENO":"process"===oZ(oW.process)?"NODE":oW.window&&oW.document?"BROWSER":"REST"}(),oQ="NODE"===oX,o0=nb.exports,o1=e2,o2=ts,o5=function(e,t,r){return r.get&&o0(r.get,t,{getter:!0}),r.set&&o0(r.set,t,{setter:!0}),o1.f(e,t,r)},o3=eQ,o8=ez("species"),o6=function(e){var t=o2(e);o3&&t&&!t[o8]&&o5(t,o8,{configurable:!0,get:function(){return this}})}
vendor: 10,426 bytes, line 78
78,o4=ta,o9=TypeError,o7=function(e,t){if(o4(t,e))return e;throw new o9("Incorrect invocation")},se=ez("toStringTag"),st={};st[se]="z";var sr="[object z]"===String(st),sn=eV,si=U,so=ez("toStringTag"),ss=Object,sa="Arguments"===si(function(){return arguments}()),sc=function(e,t){try{return e[t]}catch(e){}},su=sr?si:function(e){var t,r,n;return void 0===e?"Undefined":null===e?"Null":"string"==typeof(r=sc(t=ss(e),so))?r:sa?si(t):"Object"===(n=si(t))&&sn(t.callee)?"Arguments":n},sl=j,sd=P,sf=eV,sh=su,sp=nM,sy=function(){},sg=ts("Reflect","construct"),sm=/^\s*(?:class|function)\b/,sb=sl(sm.exec),sv=!sm.test(sy),sw=function(e){if(!sf(e))return!1;try{return sg(sy,[],e),!0}catch(e){return!1}},s_=function(e){if(!sf(e))return!1;switch(sh(e)){case"AsyncFunction":case"GeneratorFunction":case"AsyncGeneratorFunction":return!1}try{return sv||!!sb(sm,sp(e))}catch(e){return!0}};s_.sham=!0;var sE=!sg||sd(function(){var e;return sw(sw.call)||!sw(Object)||!sw(function(){e=!0})||e})?s_:sw,sS=tp,sx=TypeError,sA=eY,sI=function(e){if(sE(e))return e;throw new sx(sS(e)+" is not a constructor")},sO=V,sT=ez("species"),sP=function(e,t){var r,n=sA(e).constructor;return void 0===n||sO(r=sA(n)[sT])?t:sI(r)},sM=M,sN=Function.prototype,sk=sN.apply,sC=sN.call,sD="object"==typeof Reflect&&Reflect.apply||(sM?sC.bind(sk):function(){return sC.apply(sk,arguments)}),sj=U,sR=j,sL=function(e){if("Function"===sj(e))return sR(e)},sB=tb,sU=M,s$=sL(sL.bind),sK=function(e,t){return sB(e),void 0===t?e:sU?s$(e,t):function(){return e.apply(t,arguments)}},sF=j([].slice),sz=TypeError,sq=function(e,t){if(e<t)throw new sz("Not enough arguments");return e},sV=eE,sH=/(?:ipad|iphone|ipod).*applewebkit/i.test(sV),sG=Q,sW=sD,sJ=sK,sZ=eV,sY=ey,sX=P,sQ=rm,s0=sF,s1=e6,s2=sq,s5=sH,s3=oQ,s8=sG.setImmediate,s6=sG.clearImmediate,s4=sG.process,s9=sG.Dispatch,s7=sG.Function,ae=sG.MessageChannel,at=sG.String,ar=0,an={},ai="onreadystatechange";sX(function(){f=sG.location});var ao=function(e){if(sY(an,e)){var t=an[e];delete an[e],t()}},as=function(e){return function(){ao(e)}},aa=function(e){ao(e.data)},ac=function(e){sG.postMessage(at(e),f.protocol+"//"+f.host)};s8&&s6||(s8=function(e){s2(arguments.length,1);var t=sZ(e)?e:s7(e),r=s0(arguments,1);return an[++ar]=function(){sW(t,void 0,r)},h(ar),ar},s6=function(e){delete an[e]},s3?h=function(e){s4.nextTick(as(e))}:s9&&s9.now?h=function(e){s9.now(as(e))}:ae&&!s5?(y=(p=new ae).port2,p.port1.onmessage=aa,h=sJ(y.postMessage,y)):sG.addEventListener&&sZ(sG.postMessage)&&!sG.importScripts&&f&&"file:"!==f.protocol&&!sX(ac)?(h=ac,sG.addEventListener("message",aa,!1)):h=ai in s1("script")?function(e){sQ.appendChild(s1("script"))[ai]=function(){sQ.removeChild(this),ao(e)}}:function(e){setTimeout(as(e),0)});var au={set:s8},al=Q,ad=eQ,af=Object.getOwnPropertyDescriptor,ah=function(e){if(!ad)return al[e];var t=af(al,e);return t&&t.value},ap=function(){this.head=null,this.tail=null};ap.prototype={add:function(e){var t={item:e,next:null},r=this.tail;r?r.next=t:this.head=t,this.tail=t},get:function(){var e=this.head;if(e)return null===(this.head=e.next)&&(this.tail=null),e.item}};var ay=ap,ag=eE,am=/ipad|iphone|ipod/i.test(ag)&&"undefined"!=typeof Pebble,ab=eE,av=/web0s(?!.*chrome)/i.test(ab),aw=Q,a_=ah,aE=sK,aS=au.set,ax=ay,aA=sH,aI=am,aO=av,aT=oQ,aP=aw.MutationObserver||aw.WebKitMutationObserver,aM=aw.document,aN=aw.process,ak=aw.Promise,aC=a_("queueMicrotask");if(!aC){var aD=new ax,aj=function(){var e,t;for(aT&&(e=aN.domain)&&e.exit();t=aD.get();)try{t()}catch(e){throw aD.head&&g(),e}e&&e.enter()};aA||aT||aO||!aP||!aM?!aI&&ak&&ak.resolve?((v=ak.resolve(void 0)).constructor=ak,w=aE(v.then,v),g=function(){w(aj)}):aT?g=function(){aN.nextTick(aj)}:(aS=aE(aS,aw),g=function(){aS(aj)}):(m=!0,b=aM.createTextNode(""),new aP(aj).observe(b,{characterData:!0}),g=function(){b.data=m=!m}),aC=function(e){aD.head||g(),aD.add(e)}}var aR=aC,aL=function(e,t){try{1==arguments.length?console.error(e):console.error(e,t)}catch(e){}},aB=function(e){try{return{error:!1,value:e()}}catch(e){return{error:!0,value:e}}},aU=Q.Promise,a$=Q,aK=aU,aF=eV,az=iy,aq=nM,aV=ez,aH=oX,aG=eP;aK&&aK.prototype;var aW=aV("species"),aJ=!1,aZ=aF(a$.PromiseRejectionEvent),aY={CONSTRUCTOR:az("Promise",function(){var e=aq(aK),t=e!==String(aK);if(!t&&66===aG)return!0;if(!aG||aG<51||!/native code/.test(e)){var r=new aK(function(e){e(1)}),n=function(e){e(function(){},function(){})};if((r.constructor={})[aW]=n,!(aJ=r.then(function(){})instanceof n))return!0}return!t&&("BROWSER"===aH||"DENO"===aH)&&!aZ}),REJECTION_EVENT:aZ,SUBCLASSING:aJ},aX={},aQ=tb,a0=TypeError,a1=function(e){var t,r;this.promise=new e(function(e,n){if(void 0!==t||void 0!==r)throw new a0("Bad Promise constructor");t=e,r=n}),this.resolve=aQ(t),this.reject=aQ(r)};aX.f=function(e){return new a1(e)};var a2=iS,a5=oQ,a3=Q,a8=tr,a6=nQ,a4=i9,a9=iq,a7=o6,ce=tb,ct=eV,cr=eG,cn=o7,ci=sP,co=au.set,cs=aR,ca=aL,cc=aB,cu=ay,cl=nn,cd=aU,cf=aY,ch=aX,cp="Promise",cy=cf.CONSTRUCTOR,cg=cf.REJECTION_EVENT,cm=cf.SUBCLASSING,cb=cl.getterFor(cp),cv=cl.set,cw=cd&&cd.prototype,c_=cd,cE=cw,cS=a3.TypeError,cx=a3.document,cA=a3.process,cI=ch.f,cO=cI,cT=!!(cx&&cx.createEvent&&a3.dispatchEvent),cP="unhandledrejection",cM="rejectionhandled",cN=0,ck=1,cC=2,cD=1,cj=2,cR=function(e){var t;return!!(cr(e)&&ct(t=e.then))&&t},cL=function(e,t){var r,n,i,o=t.value,s=t.state===ck,a=s?e.ok:e.fail,c=e.resolve,u=e.reject,l=e.domain;try{a?(s||(t.rejection===cj&&cF(t),t.rejection=cD),!0===a?r=o:(l&&l.enter(),r=a(o),l&&(l.exit(),i=!0)),r===e.promise?u(new cS("Promise-chain cycle")):(n=cR(r))?a8(n,r,c,u):c(r)):u(o)}catch(e){l&&!i&&l.exit(),u(e)}},cB=function(e,t){e.notified||(e.notified=!0,cs(function(){for(var r,n=e.reactions;r=n.get();)cL(r,e);e.notified=!1,t&&!e.rejection&&c$(e)}))},cU=function(e,t,r){var n,i;cT?((n=cx.createEvent("Event")).promise=t,n.reason=r,n.initEvent(e,!1,!0),a3.dispatchEvent(n)):n={promise:t,reason:r},!cg&&(i=a3["on"+e])?i(n):e===cP&&ca("Unhandled promise rejection",r)},c$=function(e){a8(co,a3,function(){var t,r=e.facade,n=e.value;if(cK(e)&&(t=cc(function(){a5?cA.emit("unhandledRejection",n,r):cU(cP,r,n)}),e.rejection=a5||cK(e)?cj:cD,t.error))throw t.value})},cK=function(e){return e.rejection!==cD&&!e.parent},cF=function(e){a8(co,a3,function(){var t=e.facade;a5?cA.emit("rejectionHandled",t):cU(cM,t,e.value)})},cz=function(e,t,r){return function(n){e(t,n,r)}},cq=function(e,t,r){e.done||(e.done=!0,r&&(e=r),e.value=t,e.state=cC,cB(e,!0))},cV=function(e,t,r){if(!e.done){e.done=!0,r&&(e=r);try{if(e.facade===t)throw new cS("Promise can't be resolved itself");var n=cR(t);n?cs(function(){var r={done:!1};try{a8(n,t,cz(cV,r,e),cz(cq,r,e))}catch(t){cq(r,t,e)}}):(e.value=t,e.state=ck,cB(e,!1))}catch(t){cq({done:!1},t,e)}}};if(cy&&(cE=(c_=function(e){cn(this,cE),ce(e),a8(_,this);var t=cb(this);try{e(cz(cV,t),cz(cq,t))}catch(e){cq(t,e)}}).prototype,(_=function(e){cv(this,{type:cp,done:!1,notified:!1,parent:!1,reactions:new cu,rejection:!1,state:cN,value:null})}).prototype=a6(cE,"then",function(e,t){var r=cb(this),n=cI(ci(this,c_));return r.parent=!0,n.ok=!ct(e)||e,n.fail=ct(t)&&t,n.domain=a5?cA.domain:void 0,r.state===cN?r.reactions.add(n):cs(function(){cL(n,r)}),n.promise}),E=function(){var e=new _,t=cb(e);this.promise=e,this.resolve=cz(cV,t),this.reject=cz(cq,t)},ch.f=cI=function(e){return e===c_||e===S?new E(e):cO(e)},ct(cd)&&cw!==Object.prototype)){x=cw.then,cm||a6(cw,"then",function(e,t){var r=this;return new c_(function(e,t){a8(x,r,e,t)}).then(e,t)},{unsafe:!0});try{delete cw.constructor}catch(e){}a4&&a4(cw,cE)}a2({global:!0,constructor:!0,wrap:!0,forced:cy},{Promise:c_}),a9(c_,cp,!1),a7(cp);var cH=rq,cG=ez("iterator"),cW=Array.prototype,cJ=function(e){return void 0!==e&&(cH.Array===e||cW[cG]===e)},cZ=su,cY=t_,cX=V,cQ=rq,c0=ez("iterator"),c1=function(e){if(!cX(e))return cY(e,c0)||cY(e,"@@iterator")||cQ[cZ(e)]},c2=tr,c5=tb,c3=eY,c8=tp,c6=c1,c4=TypeError,c9=tr,c7=eY,ue=t_,ut=sK,ur=tr,un=eY,ui=tp,uo=cJ,us=t5,ua=ta,uc=function(e,t){var r=arguments.length<2?c6(e):t;if(c5(r))return c3(c2(r,e));throw new c4(c8(e)+" is not iterable")},uu=c1,ul=function(e,t,r){var n,i;c7(e);try{if(!(n=ue(e,"return"))){if("throw"===t)throw r;return r}n=c9(n,e)}catch(e){i=!0,n=e}if("throw"===t)throw r;if(i)throw n;return c7(n),r},ud=TypeError,uf=function(e,t){this.stopped=e,this.result=t},uh=uf.prototype,up=function(e,t,r){var n,i,o,s,a,c,u,l=r&&r.that,d=!!(r&&r.AS_ENTRIES),f=!!(r&&r.IS_RECORD),h=!!(r&&r.IS_ITERATOR),p=!!(r&&r.INTERRUPTED),y=ut(t,l),g=function(e){return n&&ul(n,"normal",e),new uf(!0,e)},m=function(e){return d?(un(e),p?y(e[0],e[1],g):y(e[0],e[1])):p?y(e,g):y(e)};if(f)n=e.iterator;else if(h)n=e;else{if(!(i=uu(e)))throw new ud(ui(e)+" is not iterable");if(uo(i)){for(o=0,s=us(e);s>o;o++)if((a=m(e[o]))&&ua(uh,a))return a;return new uf(!1)}n=uc(e,i)}for(c=f?e.next:n.next;!(u=ur(c,n)).done;){try{a=m(u.value)}catch(e){ul(n,"throw",e)}if("object"==typeof a&&a&&ua(uh,a))return a}return new uf(!1)},uy=ez("iterator"),ug=!1;try{var um=0,ub={next:function(){return{done:!!um++}},return:function(){ug=!0}};ub[uy]=function(){return this},Array.from(ub,function(){throw 2})}catch(e){}var uv=aU,uw=function(e,t){try{if(!t&&!ug)return!1}catch(e){return!1}var r=!1;try{var n={};n[uy]=function(){return{next:function(){return{done:r=!0}}}},e(n)}catch(e){}return r},u_=aY.CONSTRUCTOR||!uw(function(e){uv.all(e).then(void 0,function(){})}),uE=tr,uS=tb,ux=aX,uA=aB,uI=up;iS({target:"Promise",stat:!0,forced:u_},{all:function(e){var t=this,r=ux.f(t),n=r.resolve,i=r.reject,o=uA(function(){var r=uS(t.resolve),o=[],s=0,a=1;uI(e,function(e){var c=s++,u=!1;a++,uE(r,t,e).then(function(e){!u&&(u=!0,o[c]=e,--a||n(o))},i)}),--a||n(o)});return o.error&&i(o.value),r.promise}});var uO=iS,uT=aY.CONSTRUCTOR,uP=aU,uM=ts,uN=eV,uk=nQ,uC=uP&&uP.prototype;if(uO({target:"Promise",proto:!0,forced:uT,real:!0},{catch:function(e){return this.then(void 0,e)}}),uN(uP)){var uD=uM("Promise").prototype.catch;uC.catch!==uD&&uk(uC,"catch",uD,{unsafe:!0})}var uj=tr,uR=tb,uL=aX,uB=aB,uU=up;iS({target:"Promise",stat:!0,forced:u_},{race:function(e){var t=this,r=uL.f(t),n=r.reject,i=uB(function(){var i=uR(t.resolve);uU(e,function(e){uj(i,t,e).then(r.resolve,n)})});return i.error&&n(i.value),r.promise}});var u$=aX;iS({target:"Promise",stat:!0,forced:aY.CONSTRUCTOR},{reject:function(e){var t=u$.f(this);return(0,t.reject)(e),t.promise}});var uK=eY,uF=eG,uz=aX,uq=function(e,t){if(uK(e),uF(t)&&t.constructor===e)return t;var r=uz.f(e);return(0,r.resolve)(t),r.promise}
78,uV=iS,uH=ts,uG=aY.CONSTRUCTOR,uW=uq;uH("Promise"),uV({target:"Promise",stat:!0,forced:uG},{resolve:function(e){return uW(this,e)}});var uJ=su,uZ=String,uY=function(e){if("Symbol"===uJ(e))throw TypeError("Cannot convert a Symbol value to a string");return uZ(e)},uX=eY,uQ=tr,u0=ey,u1=ta,u2=function(){var e=uX(this),t="";return e.hasIndices&&(t+="d"),e.global&&(t+="g"),e.ignoreCase&&(t+="i"),e.multiline&&(t+="m"),e.dotAll&&(t+="s"),e.unicode&&(t+="u"),e.unicodeSets&&(t+="v"),e.sticky&&(t+="y"),t},u5=RegExp.prototype,u3=function(e){var t=e.flags;return!(void 0===t&&!("flags"in u5)&&!u0(e,"flags")&&u1(u5,e))?t:uQ(u2,e)},u8=nA.PROPER,u6=nQ,u4=eY,u9=uY,u7=P,le=u3,lt="toString",lr=RegExp.prototype,ln=lr[lt],li=u7(function(){return"/a/b"!==ln.call({source:"a",flags:"b"})}),lo=u8&&ln.name!==lt;(li||lo)&&u6(lr,lt,function(){var e=u4(this);return"/"+u9(e.source)+"/"+u9(le(e))},{unsafe:!0});var ls={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},la=e6("span").classList,lc=la&&la.constructor&&la.constructor.prototype,lu=Q,ll=ls,ld=lc===Object.prototype?void 0:lc,lf=oD,lh=rY,lp=iq,ly=ez("iterator"),lg=lf.values,lm=function(e,t){if(e){if(e[ly]!==lg)try{lh(e,ly,lg)}catch(t){e[ly]=lg}if(lp(e,t,!0),ll[t]){for(var r in lf)if(e[r]!==lf[r])try{lh(e,r,lf[r])}catch(t){e[r]=lf[r]}}}};for(var lb in ll)lm(lu[lb]&&lu[lb].prototype,lb);function lv(e,t,r,n){function i(e){return e instanceof r?e:new r(function(t){t(e)})}return new(r||(r=Promise))(function(r,o){function s(e){try{c(n.next(e))}catch(e){o(e)}}function a(e){try{c(n.throw(e))}catch(e){o(e)}}function c(e){e.done?r(e.value):i(e.value).then(s,a)}c((n=n.apply(e,t||[])).next())})}lm(ld,"DOMTokenList"),"function"==typeof SuppressedError&&SuppressedError;var lw="data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz4NCjwhLS0gR2VuZXJhdG9yOiBBZG9iZSBJbGx1c3RyYXRvciAyOC4wLjAsIFNWRyBFeHBvcnQgUGx1Zy1JbiAuIFNWRyBWZXJzaW9uOiA2LjAwIEJ1aWxkIDApICAtLT4NCjxzdmcgdmVyc2lvbj0iMS4xIiBpZD0iV2Fyc3R3YV8xIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHhtbG5zOnhsaW5rPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5L3hsaW5rIiB4PSIwcHgiIHk9IjBweCINCgkgdmlld0JveD0iMCAwIDg1MS41IDg1MS41IiBzdHlsZT0iZW5hYmxlLWJhY2tncm91bmQ6bmV3IDAgMCA4NTEuNSA4NTEuNTsiIHhtbDpzcGFjZT0icHJlc2VydmUiPg0KPHN0eWxlIHR5cGU9InRleHQvY3NzIj4NCgkuc3Qwe2ZpbGw6IzYwNjdGOTt9DQoJLnN0MXtmaWxsOiNGN0Y3Rjc7fQ0KPC9zdHlsZT4NCjxnPg0KCTxnIGlkPSJXYXJzdHdhXzJfMDAwMDAwMTQ2MDk2NTQyNTMxODA5NDY0NjAwMDAwMDg2NDc4NTIwMDIxMTY5MTg2ODhfIj4NCgkJPHBhdGggY2xhc3M9InN0MCIgZD0iTTEyNCwwaDYwMy42YzY4LjUsMCwxMjQsNTUuNSwxMjQsMTI0djYwMy42YzAsNjguNS01NS41LDEyNC0xMjQsMTI0SDEyNGMtNjguNSwwLTEyNC01NS41LTEyNC0xMjRWMTI0DQoJCQlDMCw1NS41LDU1LjUsMCwxMjQsMHoiLz4NCgk8L2c+DQoJPGcgaWQ9IldhcnN0d2FfMyI+DQoJCTxwYXRoIGNsYXNzPSJzdDEiIGQ9Ik02MjMuNSwxNzAuM2MtMzcuNCw1Mi4yLTg0LjIsODguNC0xMzkuNSwxMTIuNmMtMTkuMi01LjMtMzguOS04LTU4LjMtNy44Yy0xOS40LTAuMi0zOS4xLDIuNi01OC4zLDcuOA0KCQkJYy01NS4zLTI0LjMtMTAyLjEtNjAuMy0xMzkuNS0xMTIuNmMtMTEuMywyOC40LTU0LjgsMTI2LjQtMi42LDI2My40YzAsMC0xNi43LDcxLjUsMTQsMTMyLjljMCwwLDQ0LjQtMjAuMSw3OS43LDguMg0KCQkJYzM2LjksMjkuOSwyNS4xLDU4LjcsNTEuMSw4My41YzIyLjQsMjIuOSw1NS43LDIyLjksNTUuNywyMi45czMzLjMsMCw1NS43LTIyLjhjMjYtMjQuNywxNC4zLTUzLjUsNTEuMS04My41DQoJCQljMzUuMi0yOC4zLDc5LjctOC4yLDc5LjctOC4yYzMwLjYtNjEuNCwxNC0xMzIuOSwxNC0xMzIuOUM2NzguMywyOTYuNyw2MzQuOSwxOTguNyw2MjMuNSwxNzAuM3ogTTI1My4xLDQxNC44DQoJCQljLTI4LjQtNTguMy0zNi4yLTEzOC4zLTE4LjMtMjAxLjVjMjMuNyw2MCw1NS45LDg2LjksOTQuMiwxMTUuM0MzMTIuOCwzNjIuMywyODIuMywzOTQuMSwyNTMuMSw0MTQuOHogTTMzNC44LDUxNy41DQoJCQljLTIyLjQtOS45LTI3LjEtMjkuNC0yNy4xLTI5LjRjMzAuNS0xOS4yLDc1LjQtNC4
781LDc2LjgsNDAuOUMzNjAuOSw1MTQuNywzNTMsNTI1LjQsMzM0LjgsNTE3LjV6IE00MjUuNyw2NzguNw0KCQkJYy0xNiwwLTI5LTExLjUtMjktMjUuNnMxMy0yNS42LDI5LTI1LjZzMjksMTEuNSwyOSwyNS42QzQ1NC43LDY2Ny4zLDQ0MS43LDY3OC43LDQyNS43LDY3OC43eiBNNTE2LjcsNTE3LjUNCgkJCWMtMTguMiw4LTI2LTIuOC00OS43LDExLjVjMS41LTQ1LjQsNDYuMi02MC4xLDc2LjgtNDAuOUM1NDMuOCw0ODgsNTM5LDUwNy42LDUxNi43LDUxNy41eiBNNTk4LjMsNDE0LjgNCgkJCWMtMjkuMS0yMC43LTU5LjctNTIuNC03Ni04Ni4yYzM4LjMtMjguNCw3MC42LTU1LjQsOTQuMi0xMTUuM0M2MzQuNiwyNzYuNSw2MjYuOCwzNTYuNiw1OTguMyw0MTQuOHoiLz4NCgk8L2c+DQo8L2c+DQo8L3N2Zz4NCg==";let l_=({timeoutMs:e=2e3,intervalMs:t=50}={})=>lv(void 0,void 0,void 0,function*(){return new Promise((r,n)=>{let i=Date.now(),o=()=>{var s;let a=null===(s=null==window?void 0:window.nightly)||void 0===s?void 0:s.near;if(a){r(a);return}if(Date.now()-i>=e){n(Error("Nightly wallet not injected within timeout"));return}setTimeout(o,t)};o()})}),lE=(e,t)=>lv(void 0,void 0,void 0,function*(){let{selectedWalletId:r}=e.getState(),n=yield l_();return"nightly"===r&&(yield n.connect(e=>{e?t.emit("accountsChanged",{accounts:[{accountId:e.accountId,publicKey:n.account.publicKey.toString()}]}):t.emit("signedOut",null)},!0).catch(()=>null)),{wallet:n}}),lS=({metadata:e,options:t,store:r,logger:n,provider:i,emitter:o})=>lv(void 0,void 0,void 0,function*(){let s=yield lE(r,o),a=()=>{let{accountId:e,publicKey:t}=s.wallet.account;return e?[{accountId:e,publicKey:t.toString()}]:[]},c=e=>{let t=a(),{contract:n}=r.getState();if(!t.length||!n)throw Error("Wallet not signed in");return e.map(e=>({signerId:e.signerId||t[0].accountId,receiverId:e.receiverId||n.contractId,actions:e.actions}))},u={signNep413Message:(e,t,r,n,i)=>lv(void 0,void 0,void 0,function*(){let t=yield s.wallet.signMessage({message:e,nonce:O.from(n),recipient:r,callbackUrl:i});return Object.assign(Object.assign({},t),{publicKey:I.J.fromString(t.publicKey),signature:O.from(t.signature,"base64")})}),signTransaction:e=>lv(void 0,void 0,void 0,function*(){let t=yield s.wallet.signTransaction(e);return[O.from(t.signature.data),t]}),getPublicKey:()=>lv(void 0,void 0,void 0,function*(){return I.J.fromString(s.wallet.account.publicKey.toString())}),signDelegateAction:()=>lv(void 0,void 0,void 0,function*(){throw Error(`Method not supported by ${e.name}`)})};return{signIn(){return lv(this,void 0,void 0,function*(){let e=a();return e.length?e:(yield s.wallet.connect(e=>{e?o.emit("accountsChanged",{accounts:[{accountId:e.accountId,publicKey:s.wallet.account.publicKey.toString()}]}):o.emit("signedOut",null)}),a())})},signOut(){return lv(this,void 0,void 0,function*(){yield s.wallet.disconnect()})},getAccounts(){return lv(this,void 0,void 0,function*(){return a()})},verifyOwner({message:t}){return lv(this,void 0,void 0,function*(){throw n.log("Nightly:verifyOwner",{message:t}),Error(`Method not supported by ${e.name}`)})},signMessage({message:e,nonce:t,recipient:r,state:i}){return lv(this,void 0,void 0,function*(){return n.log("Nightly:signMessage",{message:e,nonce:t,recipient:r,state:i}),s.wallet.isConnected||(yield s.wallet.connect()),yield s.wallet.signMessage({message:e,nonce:t,recipient:r,state:i})})},signAndSendTransaction({signerId:e,receiverId:o,actions:s}){return lv(this,void 0,void 0,function*(){n.log("signAndSendTransaction",{signerId:e,receiverId:o,actions:s});let{contract:l}=r.getState();if(!a().length||!l)throw Error("Wallet not signed in");let[d]=yield(0,A.j)(c([{signerId:e,receiverId:o,actions:s}]),u,t.network);return i.sendTransaction(d)})},signAndSendTransactions({transactions:e}){return lv(this,void 0,void 0,function*(){n.log("signAndSendTransactions",{transactions:e});let r=yield(0,A.j)(c(e),u,t.network),o=[];for(let e=0;e<r.length;e++)o.push((yield i.sendTransaction(r[e])));return o})},createSignedTransaction(e,r){return lv(this,void 0,void 0,function*(){n.log("createSignedTransaction",{receiverId:e,actions:r});let[i]=yield(0,A.j)(c([{receiverId:e,actions:r}]),u,t.network);return i})},signTransaction(e){return lv(this,void 0,void 0,function*(){return n.log("signTransaction",{transaction:e}),yield u.signTransaction(e)})},getPublicKey(){return lv(this,void 0,void 0,function*(){throw n.log("getPublicKey",{}),Error(`Method not supported by ${e.name}`)})},signNep413Message(t,r,i,o,s){return lv(this,void 0,void 0,function*(){throw n.log("signNep413Message",{message:t,accountId:r,recipient:i,nonce:o,callbackUrl:s}),Error(`Method not supported by ${e.name}`)})},signDelegateAction(t){return lv(this,void 0,void 0,function*(){throw n.log("signDelegateAction",{delegateAction:t}),Error(`Method not supported by ${e.name}`)})}}});function lx({iconUrl:e=lw,deprecated:t=!1}={}){return()=>lv(this,void 0,void 0,function*(){return{id:"nightly",type:"injected",metadata:{name:"Nightly",description:"Multichain crypto wallet.",iconUrl:e,downloadUrl:"https://nightly.app/download",deprecated:t,available:!0},init:lS}})}},19597:(e,t,r)=>{"use strict";r.d(t,{R:()=>fa});var n,i,o,s,a,c,u,l,d,f,h,p,y=r(36152),g=r(28539),m=r(75927).Buffer,b="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},v=function(e){try{return!!e()}catch(e){return!0}},w=!v(function(){var e=(function(){}).bind();return"function"!=typeof e||e.hasOwnProperty("prototype")}),_=w,E=Function.prototype,S=E.call,x=_&&E.bind.bind(S,S),A=_?x:function(e){return function(){return S.apply(e,arguments)}},I=A,O=I({}.toString),T=I("".slice),P=function(e){return T(O(e),8,-1)},M=v,N=P,k=Object,C=A("".split),D=M(function(){return!k("z").propertyIsEnumerable(0)})?function(e){return"String"===N(e)?C(e,""):k(e)}:k,j=function(e){return null==e},R=j,L=TypeError,B=function(e){if(R(e))throw new L("Can't call method on "+e);return e},U=D,$=B,K=function(e){return U($(e))},F=function(e){return e&&e.Math===Math&&e},z=F("object"==typeof globalThis&&globalThis)||F("object"==typeof window&&window)||F("object"==typeof self&&self)||F("object"==typeof b&&b)||F("object"==typeof b&&b)||function(){return this}()||Function("return this")(),q={exports:{}},V=z,H=Object.defineProperty,G=function(e,t){try{H(V,e,{value:t,configurable:!0,writable:!0})}catch(r){V[e]=t}return t},W=z,J=G,Z="__core-js_shared__",Y=q.exports=W[Z]||J(Z,{});(Y.versions||(Y.versions=[])).push({version:"3.41.0",mode:"global",copyright:"\xa9 2014-2025 Denis Pushkarev (zloirock.ru)",license:"https://github.com/zloirock/core-js/blob/v3.41.0/LICENSE",source:"https://github.com/zloirock/core-js"});var X=q.exports,Q=function(e,t){return X[e]||(X[e]=t||{})},ee=B,et=Object,er=function(e){return et(ee(e))},en=er,ei=A({}.hasOwnProperty),eo=Object.hasOwn||function(e,t){return ei(en(e),t)},es=0,ea=Math.random(),ec=A(1..toString),eu=function(e){return"Symbol("+(void 0===e?"":e)+")_"+ec(++es+ea,36)},el=z.navigator,ed=el&&el.userAgent,ef=ed?String(ed):"",eh=z,ep=ef,ey=eh.process,eg=eh.Deno,em=ey&&ey.versions||eg&&eg.version,eb=em&&em.v8;eb&&(i=(n=eb.split("."))[0]>0&&n[0]<4?1:+(n[0]+n[1])),!i&&ep&&(!(n=ep.match(/Edge\/(\d+)/))||n[1]>
vendor: 7,975 bytes, line 78
78=74)&&(n=ep.match(/Chrome\/(\d+)/))&&(i=+n[1]);var ev=i,ew=ev,e_=v,eE=z.String,eS=!!Object.getOwnPropertySymbols&&!e_(function(){var e=Symbol("symbol detection");return!eE(e)||!(Object(e)instanceof Symbol)||!Symbol.sham&&ew&&ew<41}),ex=eS&&!Symbol.sham&&"symbol"==typeof Symbol.iterator,eA=Q,eI=eo,eO=eu,eT=eS,eP=ex,eM=z.Symbol,eN=eA("wks"),ek=eP?eM.for||eM:eM&&eM.withoutSetter||eO,eC=function(e){return eI(eN,e)||(eN[e]=eT&&eI(eM,e)?eM[e]:ek("Symbol."+e)),eN[e]},eD="object"==typeof document&&document.all,ej=void 0===eD&&void 0!==eD?function(e){return"function"==typeof e||e===eD}:function(e){return"function"==typeof e},eR=ej,eL=function(e){return"object"==typeof e?null!==e:eR(e)},eB=eL,eU=String,e$=TypeError,eK=function(e){if(eB(e))return e;throw new e$(eU(e)+" is not an object")},eF={},ez=!v(function(){return 7!==Object.defineProperty({},1,{get:function(){return 7}})[1]}),eq=v,eV=ez&&eq(function(){return 42!==Object.defineProperty(function(){},"prototype",{value:42,writable:!1}).prototype}),eH={},eG=eL,eW=z.document,eJ=eG(eW)&&eG(eW.createElement),eZ=function(e){return eJ?eW.createElement(e):{}},eY=v,eX=eZ,eQ=!ez&&!eY(function(){return 7!==Object.defineProperty(eX("div"),"a",{get:function(){return 7}}).a}),e0=w,e1=Function.prototype.call,e2=e0?e1.bind(e1):function(){return e1.apply(e1,arguments)},e5=z,e3=ej,e8=function(e){return e3(e)?e:void 0},e6=function(e,t){return arguments.length<2?e8(e5[e]):e5[e]&&e5[e][t]},e4=A({}.isPrototypeOf),e9=e6,e7=ej,te=e4,tt=Object,tr=ex?function(e){return"symbol"==typeof e}:function(e){var t=e9("Symbol");return e7(t)&&te(t.prototype,tt(e))},tn=String,ti=function(e){try{return tn(e)}catch(e){return"Object"}},to=ej,ts=ti,ta=TypeError,tc=function(e){if(to(e))return e;throw new ta(ts(e)+" is not a function")},tu=tc,tl=j,td=function(e,t){var r=e[t];return tl(r)?void 0:tu(r)},tf=e2,th=ej,tp=eL,ty=TypeError,tg=e2,tm=eL,tb=tr,tv=td,tw=function(e,t){var r,n;if("string"===t&&th(r=e.toString)&&!tp(n=tf(r,e))||th(r=e.valueOf)&&!tp(n=tf(r,e))||"string"!==t&&th(r=e.toString)&&!tp(n=tf(r,e)))return n;throw new ty("Can't convert object to primitive value")},t_=TypeError,tE=eC("toPrimitive"),tS=function(e,t){if(!tm(e)||tb(e))return e;var r,n=tv(e,tE);if(n){if(void 0===t&&(t="default"),!tm(r=tg(n,e,t))||tb(r))return r;throw new t_("Can't convert object to primitive value")}return void 0===t&&(t="number"),tw(e,t)},tx=tS,tA=tr,tI=function(e){var t=tx(e,"string");return tA(t)?t:t+""},tO=ez,tT=eQ,tP=eV,tM=eK,tN=tI,tk=TypeError,tC=Object.defineProperty,tD=Object.getOwnPropertyDescriptor,tj="enumerable",tR="configurable",tL="writable";eH.f=tO?tP?function(e,t,r){if(tM(e),t=tN(t),tM(r),"function"==typeof e&&"prototype"===t&&"value"in r&&tL in r&&!r[tL]){var n=tD(e,t);n&&n[tL]&&(e[t]=r.value,r={configurable:tR in r?r[tR]:n[tR],enumerable:tj in r?r[tj]:n[tj],writable:!1})}return tC(e,t,r)}:tC:function(e,t,r){if(tM(e),t=tN(t),tM(r),tT)try{return tC(e,t,r)}catch(e){}if("get"in r||"set"in r)throw new tk("Accessors not supported");return"value"in r&&(e[t]=r.value),e};var tB=Math.ceil,tU=Math.floor,t$=Math.trunc||function(e){var t=+e;return(t>0?tU:tB)(t)},tK=function(e){var t=+e;return t!=t||0===t?0:t$(t)},tF=tK,tz=Math.max,tq=Math.min,tV=function(e,t){var r=tF(e);return r<0?tz(r+t,0):tq(r,t)},tH=tK,tG=Math.min,tW=function(e){var t=tH(e);return t>0?tG(t,0x1fffffffffffff):0},tJ=tW,tZ=function(e){return tJ(e.length)},tY=K,tX=tV,tQ=tZ,t0=function(e){return function(t,r,n){var i,o=tY(t),s=tQ(o);if(0===s)return!e&&-1;var a=tX(n,s);if(e&&r!=r){for(;s>a;)if((i=o[a++])!=i)return!0}else for(;s>a;a++)if((e||a in o)&&o[a]===r)return e||a||0;return!e&&-1}},t1={includes:t0(!0),indexOf:t0(!1)},t2={},t5=A,t3=eo,t8=K,t6=t1.indexOf,t4=t2,t9=t5([].push),t7=function(e,t){var r,n=t8(e),i=0,o=[];for(r in n)!t3(t4,r)&&t3(n,r)&&t9(o,r);for(;t.length>i;)t3(n,r=t[i++])&&(~t6(o,r)||t9(o,r));return o},re=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"],rt=t7,rr=re,rn=Object.keys||function(e){return rt(e,rr)},ri=ez,ro=eV,rs=eH,ra=eK,rc=K,ru=rn;eF.f=ri&&!ro?Object.defineProperties:function(e,t){ra(e);for(var r,n=rc(t),i=ru(t),o=i.length,s=0;o>s;)rs.f(e,r=i[s++],n[r]);return e};var rl=e6("document","documentElement"),rd=eu,rf=Q("keys"),rh=function(e){return rf[e]||(rf[e]=rd(e))},rp=eK,ry=eF,rg=re,rm=t2,rb=rl,rv=eZ,rw=">",r_="<",rE="prototype",rS="script",rx=rh("IE_PROTO"),rA=function(){},rI=function(e){return r_+rS+rw+e+r_+"/"+rS+rw},rO=function(e){e.write(rI("")),e.close();var t=e.parentWindow.Object;return e=null,t},rT=function(){var e,t=rv("iframe"),r="java"+rS+":";return t.style.display="none",rb.appendChild(t),t.src=String(r),(e=t.contentWindow.document).open(),e.write(rI("document.F=Object")),e.close(),e.F},rP=function(){try{o=new ActiveXObject("htmlfile")}catch(e){}rP="undefined"!=typeof document?document.domain&&o?rO(o):rT():rO(o);for(var e=rg.length;e--;)delete rP[rE][rg[e]];return rP()};rm[rx]=!0;var rM=Object.create||function(e,t){var r;return null!==e?(rA[rE]=rp(e),r=new rA,rA[rE]=null,r[rx]=e):r=rP(),void 0===t?r:ry.f(r,t)},rN=eC,rk=rM,rC=eH.f,rD=rN("unscopables"),rj=Array.prototype;void 0===rj[rD]&&rC(rj,rD,{configurable:!0,value:rk(null)});var rR=function(e){rj[rD][e]=!0},rL={},rB=ej,rU=z.WeakMap,r$=rB(rU)&&/native code/.test(String(rU)),rK=function(e,t){return{enumerable:!(1&e),configurable:!(2&e),writable:!(4&e),value:t}},rF=eH,rz=rK,rq=ez?function(e,t,r){return rF.f(e,t,rz(1,r))}:function(e,t,r){return e[t]=r,e},rV=r$,rH=z,rG=eL,rW=rq,rJ=eo,rZ=q.exports,rY=rh,rX=t2,rQ="Object already initialized",r0=rH.TypeError,r1=rH.WeakMap,r2=function(e){return c(e)?a(e):s(e,{})},r5=function(e){return function(t){var r;if(!rG(t)||(r=a(t)).type!==e)throw new r0("Incompatible receiver, "+e+" required");return r}};if(rV||rZ.state){var r3=rZ.state||(rZ.state=new r1);r3.get=r3.get,r3.has=r3.has,r3.set=r3.set,s=function(e,t){if(r3.has(e))throw new r0(rQ);return t.facade=e,r3.set(e,t),t},a=function(e){return r3.get(e)||{}},c=function(e){return r3.has(e)}}else{var r8=rY("state");rX[r8]=!0,s=function(e,t){if(rJ(e,r8))throw new r0(rQ);return t.facade=e,rW(e,r8,t),t},a=function(e){return rJ(e,r8)?e[r8]:{}},c=function(e){return rJ(e,r8)}}var r6={set:s,get:a,has:c,enforce:r2,getterFor:r5},r4={},r9={},r7={}.propertyIsEnumerable,ne=Object.getOwnPropertyDescriptor,nt=ne&&!r7.call({1:2},1);r9.f=nt?function(e){var t=ne(this,e);return!!t&&t.enumerable}:r7;var nr=ez,nn=e2,ni=r9,no=rK,ns=K,na=tI,nc=eo,nu=eQ,nl=Object.getOwnPropertyDescriptor;r4.f=nr?nl:function(e,t){if(e=ns(e),t=na(t),nu)try{return nl(e,t)}catch(e){}if(nc(e,t))return no(!nn(ni.f,e,t),e[t])};var nd={exports:{}},nf=ez,nh=Function.prototype,np=nf&&Object.getOwnPropertyDescriptor,ny=eo(nh,"name"),ng=ny&&"something"===(function(){}).name,nm=ny&&(!nf||nf&&np(nh,"name").configurable),nb={EXISTS:ny,PROPER:ng,CONFIGURABLE:nm},nv=A,nw=ej,n_=q.exports,nE=nv(Function.toString);nw(n_.inspectSource)||(n_.inspectSource=function(e){return nE(e)});var nS=n_.inspectSource,nx=A,nA=v,nI=ej,nO=eo,nT=ez,nP=nb.CONFIGURABLE,nM=nS,nN=r6,nk=nN.enforce,nC=nN.get,nD=String,nj=Object.defineProperty,nR=nx("".slice),nL=nx("".replace),nB=nx([].join),nU=nT&&!nA(function(){return 8!==nj(function(){},"length",{value:8}).length}),n$=String(String).split("String"),nK=nd.exports=function(e,t,r){"Symbol("===nR(nD(t),0,7)&&(t="["+nL(nD(t),/^Symbol\(([^)]*)\).*$/,"$1")+"]"),r&&r.getter&&(t="get "+t),r&&r.setter&&(t="set "+t),(!nO(e,"name")||nP&&e.name!==t)&&(nT?nj(e,"name",{value:t,configurable:!0}):e.name=t),nU&&r&&nO(r,"arity")&&e.length!==r.arity&&nj(e,"length",{value:r.arity});try{r&&nO(r,"constructor")&&r.constructor?nT&&nj(e,"prototype",{writable:!1}):e.prototype&&(e.prototype=void 0)}catch(e){}var n=nk(e);return nO(n,"source")||(n.source=nB(n$,"string"==typeof t?t:"")),e};Function.prototype.toString=nK(function(){return nI(this)&&nC(this).source||nM(this)},"toString");var nF=ej,nz=eH,nq=nd.exports,nV=G,nH=function(e,t,r,n){n||(n={});var i=n.enumerable,o=void 0!==n.name?n.name:t;
78if(nF(r)&&nq(r,o,n),n.global)i?e[t]=r:nV(t,r);else{try{n.unsafe?e[t]&&(i=!0):delete e[t]}catch(e){}i?e[t]=r:nz.f(e,t,{value:r,enumerable:!1,configurable:!n.nonConfigurable,writable:!n.nonWritable})}return e},nG={},nW=t7,nJ=re.concat("length","prototype");nG.f=Object.getOwnPropertyNames||function(e){return nW(e,nJ)};var nZ={};nZ.f=Object.getOwnPropertySymbols;var nY=e6,nX=nG,nQ=nZ,n0=eK,n1=A([].concat),n2=nY("Reflect","ownKeys")||function(e){var t=nX.f(n0(e)),r=nQ.f;return r?n1(t,r(e)):t},n5=eo,n3=n2,n8=r4,n6=eH,n4=function(e,t,r){for(var n=n3(t),i=n6.f,o=n8.f,s=0;s<n.length;s++){var a=n[s];n5(e,a)||r&&n5(r,a)||i(e,a,o(t,a))}},n9=v,n7=ej,ie=/#|\.prototype\./,it=function(e,t){var r=ii[ir(e)];return r===is||r!==io&&(n7(t)?n9(t):!!t)},ir=it.normalize=function(e){return String(e).replace(ie,".").toLowerCase()},ii=it.data={},io=it.NATIVE="N",is=it.POLYFILL="P",ia=it,ic=z,iu=r4.f,il=rq,id=nH,ih=G,ip=n4,iy=ia,ig=function(e,t){var r,n,i,o,s,a=e.target,c=e.global,u=e.stat;if(r=c?ic:u?ic[a]||ih(a,{}):ic[a]&&ic[a].prototype)for(n in t){if(o=t[n],i=e.dontCallGetSet?(s=iu(r,n))&&s.value:r[n],!iy(c?n:a+(u?".":"#")+n,e.forced)&&void 0!==i){if(typeof o==typeof i)continue;ip(o,i)}(e.sham||i&&i.sham)&&il(o,"sham",!0),id(r,n,o,e)}},im=!v(function(){function e(){}return e.prototype.constructor=null,Object.getPrototypeOf(new e)!==e.prototype}),ib=eo,iv=ej,iw=er,i_=im,iE=rh("IE_PROTO"),iS=Object,ix=iS.prototype,iA=i_?iS.getPrototypeOf:function(e){var t=iw(e);if(ib(t,iE))return t[iE];var r=t.constructor;return iv(r)&&t instanceof r?r.prototype:t instanceof iS?ix:null},iI=v,iO=ej,iT=eL,iP=iA,iM=nH,iN=eC("iterator"),ik=!1;[].keys&&("next"in(d=[].keys())?(l=iP(iP(d)))!==Object.prototype&&(u=l):ik=!0),(!iT(u)||iI(function(){var e={};return u[iN].call(e)!==e}))&&(u={}),iO(u[iN])||iM(u,iN,function(){return this});var iC={IteratorPrototype:u,BUGGY_SAFARI_ITERATORS:ik},iD=eH.f,ij=eo,iR=eC("toStringTag"),iL=function(e,t,r){e&&!r&&(e=e.prototype),e&&!ij(e,iR)&&iD(e,iR,{configurable:!0,value:t})},iB=iC.IteratorPrototype,iU=rM,i$=rK,iK=iL,iF=rL,iz=function(){return this},iq=function(e,t,r,n){var i=t+" Iterator";return e.prototype=iU(iB,{next:i$(+!n,r)}),iK(e,i,!1),iF[i]=iz,e},iV=A,iH=tc,iG=eL,iW=function(e){return iG(e)||null===e},iJ=String,iZ=TypeError,iY=function(e,t,r){try{return iV(iH(Object.getOwnPropertyDescriptor(e,t)[r]))}catch(e){}},iX=eL,iQ=B,i0=function(e){if(iW(e))return e;throw new iZ("Can't set "+iJ(e)+" as a prototype")},i1=Object.setPrototypeOf||("__proto__"in{}?function(){var e,t=!1,r={};try{(e=iY(Object.prototype,"__proto__","set"))(r,[]),t=r instanceof Array}catch(e){}return function(r,n){return iQ(r),i0(n),iX(r)&&(t?e(r,n):r.__proto__=n),r}}():void 0),i2=ig,i5=e2,i3=nb,i8=ej,i6=iq,i4=iA,i9=i1,i7=iL,oe=rq,ot=nH,or=eC,on=rL,oi=iC,oo=i3.PROPER,os=i3.CONFIGURABLE,oa=oi.IteratorPrototype,oc=oi.BUGGY_SAFARI_ITERATORS,ou=or("iterator"),ol="keys",od="values",of="entries",oh=function(){return this},op=function(e,t,r,n,i,o,s){i6(r,t,n);var a,c,u,l=function(e){if(e===i&&y)return y;if(!oc&&e&&e in h)return h[e];switch(e){case ol:case od:case of:return function(){return new r(this,e)}}return function(){return new r(this)}},d=t+" Iterator",f=!1,h=e.prototype,p=h[ou]||h["@@iterator"]||i&&h[i],y=!oc&&p||l(i),g="Array"===t&&h.entries||p;if(g&&(a=i4(g.call(new e)))!==Object.prototype&&a.next&&(i4(a)===oa||(i9?i9(a,oa):i8(a[ou])||ot(a,ou,oh)),i7(a,d,!0)),oo&&i===od&&p&&p.name!==od&&(os?oe(h,"name",od):(f=!0,y=function(){return i5(p,this)})),i){if(c={values:l(od),keys:o?y:l(ol),entries:l(of)},s)for(u in c)!oc&&!f&&u in h||ot(h,u,c[u]);else i2({target:t,proto:!0,forced:oc||f},c)}return h[ou]!==y&&ot(h,ou,y,{name:i}),on[t]=y,c},oy=function(e,t){return{value:e,done:t}},og=K,om=rR,ob=rL,ov=r6,ow=eH.f,o_=op,oE=oy,oS=ez,ox="Array Iterator",oA=ov.set,oI=ov.getterFor(ox);o_(Array,"Array",function(e,t){oA(this,{type:ox,target:og(e),index:0,kind:t})},function(){var e=oI(this),t=e.target,r=e.index++;if(!t||r>=t.length)return e.target=null,oE(void 0,!0);switch(e.kind){case"keys":return oE(r,!1);case"values":return oE(t[r],!1)}return oE([r,t[r]],!1)},"values");var oO=ob.Arguments=ob.Array;
vendor: 5,620 bytes, line 78
78if(om("keys"),om("values"),om("entries"),oS&&"values"!==oO.name)try{ow(oO,"name",{value:"values"})}catch(e){}var oT="undefined"!=typeof ArrayBuffer&&"undefined"!=typeof DataView,oP=nd.exports,oM=eH,oN=function(e,t,r){return r.get&&oP(r.get,t,{getter:!0}),r.set&&oP(r.set,t,{setter:!0}),oM.f(e,t,r)},ok=nH,oC=function(e,t,r){for(var n in t)ok(e,n,t[n],r);return e},oD=e4,oj=TypeError,oR=function(e,t){if(oD(t,e))return e;throw new oj("Incorrect invocation")},oL=tK,oB=tW,oU=RangeError,o$=function(e){if(void 0===e)return 0;var t=oL(e),r=oB(t);if(t!==r)throw new oU("Wrong length or index");return r},oK=0x10000000000000,oF=Math.sign||function(e){var t=+e;return 0===t||t!=t?t:t<0?-1:1},oz=function(e){return e+oK-oK},oq=Math.abs,oV=2220446049250313e-31,oH=function(e,t,r,n){var i=+e,o=oq(i),s=oF(i);if(o<n)return s*oz(o/n/t)*n*t;var a=(1+t/oV)*o,c=a-(a-o);return c>r||c!=c?1/0*s:s*c},oG=11920928955078125e-23,oW=34028234663852886e22,oJ=11754943508222875e-54,oZ=Math.fround||function(e){return oH(e,oG,oW,oJ)},oY=Array,oX=Math.abs,oQ=Math.pow,o0=Math.floor,o1=Math.log,o2=Math.LN2,o5={pack:function(e,t,r){var n,i,o,s=oY(r),a=8*r-t-1,c=(1<<a)-1,u=c>>1,l=23===t?oQ(2,-24)-oQ(2,-77):0,d=e<0||0===e&&1/e<0?1:0,f=0;for((e=oX(e))!=e||e===1/0?(i=e!=e?1:0,n=c):(o=oQ(2,-(n=o0(o1(e)/o2))),e*o<1&&(n--,o*=2),n+u>=1?e+=l/o:e+=l*oQ(2,1-u),e*o>=2&&(n++,o/=2),n+u>=c?(i=0,n=c):n+u>=1?(i=(e*o-1)*oQ(2,t),n+=u):(i=e*oQ(2,u-1)*oQ(2,t),n=0));t>=8;)s[f++]=255&i,i/=256,t-=8;for(n=n<<t|i,a+=t;a>0;)s[f++]=255&n,n/=256,a-=8;return s[f-1]|=128*d,s},unpack:function(e,t){var r,n=e.length,i=8*n-t-1,o=(1<<i)-1,s=o>>1,a=i-7,c=n-1,u=e[c--],l=127&u;for(u>>=7;a>0;)l=256*l+e[c--],a-=8;for(r=l&(1<<-a)-1,l>>=-a,a+=t;a>0;)r=256*r+e[c--],a-=8;if(0===l)l=1-s;else{if(l===o)return r?NaN:u?-1/0:1/0;r+=oQ(2,t),l-=s}return(u?-1:1)*r*oQ(2,l-t)}},o3=er,o8=tV,o6=tZ,o4=function(e){for(var t=o3(this),r=o6(t),n=arguments.length,i=o8(n>1?arguments[1]:void 0,r),o=n>2?arguments[2]:void 0,s=void 0===o?r:o8(o,r);s>i;)t[i++]=e;return t},o9=A([].slice),o7=ej,se=eL,st=i1,sr=function(e,t,r){var n,i;return st&&o7(n=t.constructor)&&n!==r&&se(i=n.prototype)&&i!==r.prototype&&st(e,i),e},sn=z,si=A,so=ez,ss=oT,sa=nb,sc=rq,su=oN,sl=oC,sd=v,sf=oR,sh=tK,sp=tW,sy=o$,sg=oZ,sm=o5,sb=iA,sv=i1,sw=o4,s_=o9,sE=sr,sS=n4,sx=iL,sA=r6,sI=sa.PROPER,sO=sa.CONFIGURABLE,sT="ArrayBuffer",sP="DataView",sM="prototype",sN="Wrong length",sk="Wrong index",sC=sA.getterFor(sT),sD=sA.getterFor(sP),sj=sA.set,sR=sn[sT],sL=sR,sB=sL&&sL[sM],sU=sn[sP],s$=sU&&sU[sM],sK=Object.prototype,sF=sn.Array,sz=sn.RangeError,sq=si(sw),sV=si([].reverse),sH=sm.pack,sG=sm.unpack,sW=function(e){return[255&e]},sJ=function(e){return[255&e,e>>8&255]},sZ=function(e){return[255&e,e>>8&255,e>>16&255,e>>24&255]},sY=function(e){return e[3]<<24|e[2]<<16|e[1]<<8|e[0]},sX=function(e){return sH(sg(e),23,4)},sQ=function(e){return sH(e,52,8)},s0=function(e,t,r){su(e[sM],t,{configurable:!0,get:function(){return r(this)[t]}})},s1=function(e,t,r,n){var i=sD(e),o=sy(r),s=!!n;if(o+t>i.byteLength)throw new sz(sk);var a=i.bytes,c=o+i.byteOffset,u=s_(a,c,c+t);return s?u:sV(u)},s2=function(e,t,r,n,i,o){var s=sD(e),a=sy(r),c=n(+i),u=!!o;if(a+t>s.byteLength)throw new sz(sk);for(var l=s.bytes,d=a+s.byteOffset,f=0;f<t;f++)l[d+f]=c[u?f:t-f-1]};if(ss){var s5=sI&&sR.name!==sT;!sd(function(){sR(1)})||!sd(function(){new sR(-1)})||sd(function(){return new sR,new sR(1.5),new sR(NaN),1!==sR.length||s5&&!sO})?((sL=function(e){return sf(this,sB),sE(new sR(sy(e)),this,sL)})[sM]=sB,sB.constructor=sL,sS(sL,sR)):s5&&sO&&sc(sR,"name",sT),sv&&sb(s$)!==sK&&sv(s$,sK);var s3=new sU(new sL(2)),s8=si(s$.setInt8);s3.setInt8(0,0x80000000),s3.setInt8(1,0x80000001),(s3.getInt8(0)||!s3.getInt8(1))&&sl(s$,{setInt8:function(e,t){s8(this,e,t<<24>>24)},setUint8:function(e,t){s8(this,e,t<<24>>24)}},{unsafe:!0})}else sB=(sL=function(e){sf(this,sB);var t=sy(e);sj(this,{type:sT,bytes:sq(sF(t),0),byteLength:t}),so||(this.byteLength=t,this.detached=!1)})[sM],s$=(sU=function(e,t,r){sf(this,s$),sf(e,sB);var n=sC(e),i=n.byteLength,o=sh(t);if(o<0||o>i)throw new sz("Wrong offset");if(r=void 0===r?i-o:sp(r),o+r>i)throw new sz(sN);sj(this,{type:sP,buffer:e,byteLength:r,byteOffset:o,bytes:n.bytes}),so||(this.buffer=e,this.byteLength=r,this.byteOffset=o)})[sM],so&&(s0(sL,"byteLength",sC),s0(sU,"buffer",sD),s0(sU,"byteLength",sD),s0(sU,"byteOffset",sD)),sl(s$,{getInt8:function(e){return s1(this,1,e)[0]<<24>>24},getUint8:function(e){return s1(this,1,e)[0]},getInt16:function(e){var t=s1(this,2,e,arguments.length>1&&arguments[1]);return(t[1]<<8|t[0])<<16>>16},getUint16:function(e){var t=s1(this,2,e,arguments.length>1&&arguments[1]);return t[1]<<8|t[0]},getInt32:function(e){return sY(s1(this,4,e,arguments.length>1&&arguments[1]))},getUint32:function(e){return sY(s1(this,4,e,arguments.length>1&&arguments[1]))>>>0},getFloat32:function(e){return sG(s1(this,4,e,arguments.length>1&&arguments[1]),23)},getFloat64:function(e){return sG(s1(this,8,e,arguments.length>1&&arguments[1]),52)},setInt8:function(e,t){s2(this,1,e,sW,t)},setUint8:function(e,t){s2(this,1,e,sW,t)},setInt16:function(e,t){s2(this,2,e,sJ,t,arguments.length>2&&arguments[2])},setUint16:function(e,t){s2(this,2,e,sJ,t,arguments.length>2&&arguments[2])},setInt32:function(e,t){s2(this,4,e,sZ,t,arguments.length>2&&arguments[2])},setUint32:function(e,t){s2(this,4,e,sZ,t,arguments.length>2&&arguments[2])},setFloat32:function(e,t){s2(this,4,e,sX,t,arguments.length>2&&arguments[2])},setFloat64:function(e,t){s2(this,8,e,sQ,t,arguments.length>2&&arguments[2])}});sx(sL,sT),sx(sU,sP);var s6={ArrayBuffer:sL,DataView:sU},s4=e6,s9=oN,s7=ez,ae=eC("species"),at=function(e){var t=s4(e);
78s7&&t&&!t[ae]&&s9(t,ae,{configurable:!0,get:function(){return this}})},ar=ig,an=z,ai=at,ao="ArrayBuffer",as=s6[ao];ar({global:!0,constructor:!0,forced:an[ao]!==as},{ArrayBuffer:as}),ai(ao);var aa=P,ac=A,au=function(e){if("Function"===aa(e))return ac(e)},al=ig,ad=au,af=v,ah=s6,ap=eK,ay=tV,ag=tW,am=ah.ArrayBuffer,ab=ah.DataView,av=ab.prototype,aw=ad(am.prototype.slice),a_=ad(av.getUint8),aE=ad(av.setUint8);al({target:"ArrayBuffer",proto:!0,unsafe:!0,forced:af(function(){return!new am(2).slice(1,void 0).byteLength})},{slice:function(e,t){if(aw&&void 0===t)return aw(ap(this),e);for(var r=ap(this).byteLength,n=ay(e,r),i=ay(void 0===t?r:t,r),o=new am(ag(i-n)),s=new ab(this),a=new ab(o),c=0;n<i;)aE(a,c++,a_(s,n++));return o}});var aS=ez,ax=e2,aA=v,aI=rn,aO=nZ,aT=r9,aP=er,aM=D,aN=Object.assign,ak=Object.defineProperty,aC=A([].concat),aD=!aN||aA(function(){if(aS&&1!==aN({b:1},aN(ak({},"a",{enumerable:!0,get:function(){ak(this,"b",{value:3,enumerable:!1})}}),{b:2})).b)return!0;var e={},t={},r=Symbol("assign detection"),n="abcdefghijklmnopqrst";return e[r]=7,n.split("").forEach(function(e){t[e]=e}),7!==aN({},e)[r]||aI(aN({},t)).join("")!==n})?function(e,t){for(var r=aP(e),n=arguments.length,i=1,o=aO.f,s=aT.f;n>i;)for(var a,c=aM(arguments[i++]),u=o?aC(aI(c),o(c)):aI(c),l=u.length,d=0;l>d;)a=u[d++],(!aS||ax(s,c,a))&&(r[a]=c[a]);return r}:aN;ig({target:"Object",stat:!0,arity:2,forced:Object.assign!==aD},{assign:aD});var aj=eC("toStringTag"),aR={};aR[aj]="z";var aL="[object z]"===String(aR),aB=ej,aU=P,a$=eC("toStringTag"),aK=Object,aF="Arguments"===aU(function(){return arguments}()),az=function(e,t){try{return e[t]}catch(e){}},aq=aL?aU:function(e){var t,r,n;return void 0===e?"Undefined":null===e?"Null":"string"==typeof(r=az(t=aK(e),a$))?r:aF?aU(t):"Object"===(n=aU(t))&&aB(t.callee)?"Arguments":n},aV=aq,aH=String,aG=function(e){if("Symbol"===aV(e))throw TypeError("Cannot convert a Symbol value to a string");return aH(e)},aW=eK,aJ=e2,aZ=eo,aY=e4,aX=function(){var e=aW(this),t="";return e.hasIndices&&(t+="d"),e.global&&(t+="g"),e.ignoreCase&&(t+="i"),e.multiline&&(t+="m"),e.dotAll&&(t+="s"),e.unicode&&(t+="u"),e.unicodeSets&&(t+="v"),e.sticky&&(t+="y"),t},aQ=RegExp.prototype,a0=function(e){var t=e.flags;return!(void 0===t&&!("flags"in aQ)&&!aZ(e,"flags")&&aY(aQ,e))?t:aJ(aX,e)},a1=nb.PROPER,a2=nH,a5=eK,a3=aG,a8=v,a6=a0,a4="toString",a9=RegExp.prototype,a7=a9[a4],ce=a8(function(){return"/a/b"!==a7.call({source:"a",flags:"b"})}),ct=a1&&a7.name!==a4;(ce||ct)&&a2(a9,a4,function(){var e=a5(this);return"/"+a3(e.source)+"/"+a3(a6(e))},{unsafe:!0});var cr={exports:{}},cn=eC("iterator"),ci=!1;try{var co=0,cs={next:function(){return{done:!!co++}},return:function(){ci=!0}};cs[cn]=function(){return this},Array.from(cs,function(){throw 2})}catch(e){}var ca=function(e,t){try{if(!t&&!ci)return!1}catch(e){return!1}var r=!1;try{var n={};n[cn]=function(){return{next:function(){return{done:r=!0}}}},e(n)}catch(e){}return r},cc=oT,cu=ez,cl=z,cd=ej,cf=eL,ch=eo,cp=aq,cy=ti,cg=rq,cm=nH,cb=oN,cv=e4,cw=iA,c_=i1,cE=eC,cS=eu,cx=r6,cA=cx.enforce,cI=cx.get,cO=cl.Int8Array,cT=cO&&cO.prototype,cP=cl.Uint8ClampedArray,cM=cP&&cP.prototype,cN=cO&&cw(cO),ck=cT&&cw(cT),cC=Object.prototype,cD=cl.TypeError,cj=cE("toStringTag"),cR=cS("TYPED_ARRAY_TAG"),cL="TypedArrayConstructor",cB=cc&&!!c_&&"Opera"!==cp(cl.opera),cU=!1,c$={Int8Array:1,Uint8Array:1,Uint8ClampedArray:1,Int16Array:2,Uint16Array:2,Int32Array:4,Uint32Array:4,Float32Array:4,Float64Array:8},cK={BigInt64Array:8,BigUint64Array:8},cF=function(e){if(!cf(e))return!1;var t=cp(e);return"DataView"===t||ch(c$,t)||ch(cK,t)},cz=function(e){var t=cw(e);if(cf(t)){var r=cI(t);return r&&ch(r,cL)?r[cL]:cz(t)}},cq=function(e){if(!cf(e))return!1;var t=cp(e);return ch(c$,t)||ch(cK,t)},cV=function(e){if(cq(e))return e;throw new cD("Target is not a typed array")},cH=function(e){if(cd(e)&&(!c_||cv(cN,e)))return e;throw new cD(cy(e)+" is not a typed array constructor")},cG=function(e,t,r,n){if(cu){if(r)for(var i in c$){var o=cl[i];if(o&&ch(o.prototype,e))try{delete o.prototype[e]}catch(r){try{o.prototype[e]=t}catch(e){}}}(!ck[e]||r)&&cm(ck,e,r?t:cB&&cT[e]||t,n)}},cW=function(e,t,r){var n,i;if(cu){if(c_){if(r){for(n in c$)if((i=cl[n])&&ch(i,e))try{delete i[e]}catch(e){}}if(cN[e]&&!r)return;try{return cm(cN,e,r?t:cB&&cN[e]||t)}catch(e){}}for(n in c$)(i=cl[n])&&(!i[e]||r)&&cm(i,e,t)}};for(f in c$)(p=(h=cl[f])&&h.prototype)?cA(p)[cL]=h:cB=!1;for(f in cK)(p=(h=cl[f])&&h.prototype)&&(cA(p)[cL]=h);if((!cB||!cd(cN)||cN===Function.prototype)&&(cN=function(){throw new cD("Incorrect invocation")},cB))for(f in c$)cl[f]&&c_(cl[f],cN);if((!cB||!ck||ck===cC)&&(ck=cN.prototype,cB))for(f in c$)cl[f]&&c_(cl[f].prototype,ck);if(cB&&cw(cM)!==ck&&c_(cM,ck),cu&&!ch(ck,cj))for(f in cU=!0,cb(ck,cj,{configurable:!0,get:function(){return cf(this)?this[cR]:void 0}}
vendor: 5,076 bytes, line 78
78),c$)cl[f]&&cg(cl[f],cR,f);var cJ={NATIVE_ARRAY_BUFFER_VIEWS:cB,TYPED_ARRAY_TAG:cU&&cR,aTypedArray:cV,aTypedArrayConstructor:cH,exportTypedArrayMethod:cG,exportTypedArrayStaticMethod:cW,getTypedArrayConstructor:cz,isView:cF,isTypedArray:cq,TypedArray:cN,TypedArrayPrototype:ck},cZ=z,cY=v,cX=ca,cQ=cJ.NATIVE_ARRAY_BUFFER_VIEWS,c0=cZ.ArrayBuffer,c1=cZ.Int8Array,c2=!cQ||!cY(function(){c1(1)})||!cY(function(){new c1(-1)})||!cX(function(e){new c1,new c1(null),new c1(1.5),new c1(e)},!0)||cY(function(){return 1!==new c1(new c0(2),1,void 0).length}),c5=eL,c3=Math.floor,c8=Number.isInteger||function(e){return!c5(e)&&isFinite(e)&&c3(e)===e},c6=tK,c4=RangeError,c9=function(e){var t=c6(e);if(t<0)throw new c4("The argument can't be less than 0");return t},c7=RangeError,ue=function(e,t){var r=c9(e);if(r%t)throw new c7("Wrong offset");return r},ut=Math.round,ur=function(e){var t=ut(e);return t<0?0:t>255?255:255&t},un=au,ui=tc,uo=w,us=un(un.bind),ua=function(e,t){return ui(e),void 0===t?e:uo?us(e,t):function(){return e.apply(t,arguments)}},uc=A,uu=v,ul=ej,ud=aq,uf=nS,uh=function(){},up=e6("Reflect","construct"),uy=/^\s*(?:class|function)\b/,ug=uc(uy.exec),um=!uy.test(uh),ub=function(e){if(!ul(e))return!1;try{return up(uh,[],e),!0}catch(e){return!1}},uv=function(e){if(!ul(e))return!1;switch(ud(e)){case"AsyncFunction":case"GeneratorFunction":case"AsyncGeneratorFunction":return!1}try{return um||!!ug(uy,uf(e))}catch(e){return!0}};uv.sham=!0;var uw=!up||uu(function(){var e;return ub(ub.call)||!ub(Object)||!ub(function(){e=!0})||e})?uv:ub,u_=uw,uE=ti,uS=TypeError,ux=function(e){if(u_(e))return e;throw new uS(uE(e)+" is not a constructor")},uA=aq,uI=td,uO=j,uT=rL,uP=eC("iterator"),uM=function(e){if(!uO(e))return uI(e,uP)||uI(e,"@@iterator")||uT[uA(e)]},uN=e2,uk=tc,uC=eK,uD=ti,uj=uM,uR=TypeError,uL=function(e,t){var r=arguments.length<2?uj(e):t;if(uk(r))return uC(uN(r,e));throw new uR(uD(e)+" is not iterable")},uB=rL,uU=eC("iterator"),u$=Array.prototype,uK=aq,uF=tS,uz=TypeError,uq=function(e){var t=uF(e,"number");if("number"==typeof t)throw new uz("Can't convert number to bigint");return BigInt(t)},uV=ua,uH=e2,uG=ux,uW=er,uJ=tZ,uZ=uL,uY=uM,uX=function(e){return void 0!==e&&(uB.Array===e||u$[uU]===e)},uQ=function(e){var t=uK(e);return"BigInt64Array"===t||"BigUint64Array"===t},u0=cJ.aTypedArrayConstructor,u1=uq,u2=function(e){var t,r,n,i,o,s,a,c,u=uG(this),l=uW(e),d=arguments.length,f=d>1?arguments[1]:void 0,h=void 0!==f,p=uY(l);if(p&&!uX(p))for(c=(a=uZ(l,p)).next,l=[];!(s=uH(c,a)).done;)l.push(s.value);for(h&&d>2&&(f=uV(f,arguments[2])),r=uJ(l),i=uQ(n=new(u0(u))(r)),t=0;r>t;t++)o=h?f(l[t],t):l[t],n[t]=i?u1(o):+o;return n},u5=P,u3=Array.isArray||function(e){return"Array"===u5(e)},u8=uw,u6=eL,u4=eC("species"),u9=Array,u7=function(e){var t;return u3(e)&&(u8(t=e.constructor)&&(t===u9||u3(t.prototype))?t=void 0:u6(t)&&null===(t=t[u4])&&(t=void 0)),void 0===t?u9:t},le=ua,lt=D,lr=er,ln=tZ,li=function(e,t){return new(u7(e))(0===t?0:t)},lo=A([].push),ls=function(e){var t=1===e,r=2===e,n=3===e,i=4===e,o=6===e,s=7===e,a=5===e||o;return function(c,u,l,d){for(var f,h,p=lr(c),y=lt(p),g=ln(y),m=le(u,l),b=0,v=d||li,w=t?v(c,g):r||s?v(c,0):void 0;g>b;b++)if((a||b in y)&&(h=m(f=y[b],b,p),e)){if(t)w[b]=h;else if(h)switch(e){case 3:return!0;case 5:return f;case 6:return b;case 2:lo(w,f)}else switch(e){case 4:return!1;case 7:lo(w,f)}}return o?-1:n||i?i:w}},la={forEach:ls(0),map:ls(1),filter:ls(2),some:ls(3),every:ls(4),find:ls(5),findIndex:ls(6),filterReject:ls(7)},lc=tZ,lu=function(e,t,r){for(var n=0,i=arguments.length>2?r:lc(t),o=new e(i);i>n;)o[n]=t[n++];return o},ll=ig,ld=z,lf=e2,lh=ez,lp=c2,ly=cJ,lg=s6,lm=oR,lb=rK,lv=rq,lw=c8,l_=tW,lE=o$,lS=ue,lx=ur,lA=tI,lI=eo,lO=aq,lT=eL,lP=tr,lM=rM,lN=e4,lk=i1,lC=nG.f,lD=u2,lj=la.forEach,lR=at,lL=oN,lB=eH,lU=r4,l$=lu,lK=r6,lF=sr,lz=lK.get,lq=lK.set,lV=lK.enforce,lH=lB.f,lG=lU.f,lW=ld.RangeError,lJ=lg.ArrayBuffer,lZ=lJ.prototype,lY=lg.DataView,lX=ly.NATIVE_ARRAY_BUFFER_VIEWS,lQ=ly.TYPED_ARRAY_TAG,l0=ly.TypedArray,l1=ly.TypedArrayPrototype,l2=ly.isTypedArray,l5="BYTES_PER_ELEMENT",l3="Wrong length",l8=function(e,t){lL(e,t,{configurable:!0,get:function(){return lz(this)[t]}})},l6=function(e){var t;return lN(lZ,e)||"ArrayBuffer"===(t=lO(e))||"SharedArrayBuffer"===t},l4=function(e,t){return l2(e)&&!lP(t)&&t in e&&lw(+t)&&t>=0},l9=function(e,t){return l4(e,t=lA(t))?lb(2,e[t]):lG(e,t)},l7=function(e,t,r){return l4(e,t=lA(t))&&lT(r)&&lI(r,"value")&&!lI(r,"get")&&!lI(r,"set")&&!r.configurable&&(!lI(r,"writable")||r.writable)&&(!lI(r,"enumerable")||r.enumerable)?(e[t]=r.value,e):lH(e,t,r)};lh?(lX||(lU.f=l9,lB.f=l7,l8(l1,"buffer"),l8(l1,"byteOffset"),l8(l1,"byteLength"),l8(l1,"length")),ll({target:"Object",stat:!0,forced:!lX},{getOwnPropertyDescriptor:l9,defineProperty:l7}),cr.exports=function(e,t,r){var n=e.match(/\d+/)[0]/8,i=e+(r?"Clamped":"")+"Array",o="get"+e,s="set"+e,a=ld[i],c=a,u=c&&c.prototype,l={},d=function(e,t){var r=lz(e);return r.view[o](t*n+r.byteOffset,!0)},f=function(e,t,i){var o=lz(e);o.view[s](t*n+o.byteOffset,r?lx(i):i,!0)},h=function(e,t){lH(e,t,{get:function(){return d(this,t)}
78,set:function(e){return f(this,t,e)},enumerable:!0})};lX?lp&&(c=t(function(e,t,r,i){return lm(e,u),lF(function(){return lT(t)?l6(t)?void 0!==i?new a(t,lS(r,n),i):void 0!==r?new a(t,lS(r,n)):new a(t):l2(t)?l$(c,t):lf(lD,c,t):new a(lE(t))}(),e,c)}),lk&&lk(c,l0),lj(lC(a),function(e){e in c||lv(c,e,a[e])}),c.prototype=u):(c=t(function(e,t,r,i){lm(e,u);var o,s,a,l=0,d=0;if(lT(t)){if(l6(t)){o=t,d=lS(r,n);var f=t.byteLength;if(void 0===i){if(f%n||(s=f-d)<0)throw new lW(l3)}else if((s=l_(i)*n)+d>f)throw new lW(l3);a=s/n}else if(l2(t))return l$(c,t);else return lf(lD,c,t)}else o=new lJ(s=(a=lE(t))*n);for(lq(e,{buffer:o,byteOffset:d,byteLength:s,length:a,view:new lY(o)});l<a;)h(e,l++)}),lk&&lk(c,l0),u=c.prototype=lM(l1)),u.constructor!==c&&lv(u,"constructor",c),lV(u).TypedArrayConstructor=c,lQ&&lv(u,lQ,i);var p=c!==a;l[i]=c,ll({global:!0,constructor:!0,forced:p,sham:!lX},l),l5 in c||lv(c,l5,n),l5 in u||lv(u,l5,n),lR(i)}):cr.exports=function(){},(0,cr.exports)("Uint8",function(e){return function(t,r,n){return e(this,t,r,n)}});var de=cJ,dt=o4,dr=uq,dn=aq,di=e2,ds=A,da=v,dc=de.aTypedArray,du=de.exportTypedArrayMethod,dl=ds("".slice);du("fill",function(e){var t=arguments.length;return dc(this),di(dt,this,"Big"===dl(dn(this),0,3)?dr(e):+e,t>1?arguments[1]:void 0,t>2?arguments[2]:void 0)},da(function(){var e=0;return new Int8Array(2).fill({valueOf:function(){return e++}}),1!==e}));var dd=z,df=e2,dh=cJ,dp=tZ,dy=ue,dg=er,dm=v,db=dd.RangeError,dv=dd.Int8Array,dw=dv&&dv.prototype,d_=dw&&dw.set,dE=dh.aTypedArray,dS=dh.exportTypedArrayMethod,dx=!dm(function(){var e=new Uint8ClampedArray(2);return df(d_,e,{length:1,0:3},1),3!==e[1]}),dA=dx&&dh.NATIVE_ARRAY_BUFFER_VIEWS&&dm(function(){var e=new dv(2);return e.set(1),e.set("2",1),0!==e[0]||2!==e[1]});dS("set",function(e){dE(this);var t=dy(arguments.length>1?arguments[1]:void 0,1),r=dg(e);if(dx)return df(d_,this,r,t);var n=this.length,i=dp(r),o=0;if(i+t>n)throw new db("Wrong length");for(;o<i;)this[t+o]=r[o++]},!dx||dA);var dI=o9,dO=Math.floor,dT=function(e,t){var r=e.length;if(r<8)for(var n,i,o=1;o<r;){for(i=o,n=e[o];i&&t(e[i-1],n)>0;)e[i]=e[--i];i!==o++&&(e[i]=n)}else for(var s=dO(r/2),a=dT(dI(e,0,s),t),c=dT(dI(e,s),t),u=a.length,l=c.length,d=0,f=0;d<u||f<l;)e[d+f]=d<u&&f<l?0>=t(a[d],c[f])?a[d++]:c[f++]:d<u?a[d++]:c[f++];return e},dP=dT,dM=ef.match(/firefox\/(\d+)/i),dN=!!dM&&+dM[1],dk=ef,dC=/MSIE|Trident/.test(dk),dD=ef.match(/AppleWebKit\/(\d+)\./),dj=!!dD&&+dD[1],dR=z,dL=au,dB=v,dU=tc,d$=dP,dK=cJ,dF=dN,dz=dC,dq=ev,dV=dj,dH=dK.aTypedArray,dG=dK.exportTypedArrayMethod,dW=dR.Uint16Array,dJ=dW&&dL(dW.prototype.sort),dZ=!!dJ&&!(dB(function(){dJ(new dW(2),null)})&&dB(function(){dJ(new dW(2),{})})),dY=!!dJ&&!dB(function(){if(dq)return dq<74;if(dF)return dF<67;if(dz)return!0;if(dV)return dV<602;var e,t,r=new dW(516),n=Array(516);for(e=0;e<516;e++)t=e%4,r[e]=515-e,n[e]=e-2*t+3;for(dJ(r,function(e,t){return(e/4|0)-(t/4|0)}),e=0;e<516;e++)if(r[e]!==n[e])return!0}),dX=function(e){return function(t,r){return void 0!==e?+e(t,r)||0:r!=r?-1:t!=t?1:0===t&&0===r?1/t>0&&1/r<0?1:-1:t>r}};dG("sort",function(e){return(void 0!==e&&dU(e),dY)?dJ(this,e):d$(dH(this),dX(e))},!dY||dZ);var dQ=w,d0=Function.prototype,d1=d0.apply,d2=d0.call,d5="object"==typeof Reflect&&Reflect.apply||(dQ?d2.bind(d1):function(){return d2.apply(d1,arguments)}),d3=cJ,d8=v,d6=o9,d4=z.Int8Array,d9=d3.aTypedArray,d7=d3.exportTypedArrayMethod,fe=[].toLocaleString,ft=!!d4&&d8(function(){fe.call(new d4(1))});function fr(e,t,r,n){function i(e){return e instanceof r?e:new r(function(t){t(e)})}return new(r||(r=Promise))(function(r,o){function s(e){try{c(n.next(e))}catch(e){o(e)}}function a(e){try{c(n.throw(e))}catch(e){o(e)}}function c(e){e.done?r(e.value):i(e.value).then(s,a)}c((n=n.apply(e,t||[])).next())})}d7("toLocaleString",function(){return d5(fe,ft?d6(d9(this)):d9(this),d6(arguments))},d8(function(){return[1,2].toLocaleString()!==new d4([1,2]).toLocaleString()})||!d8(function(){d4.prototype.toLocaleString.call([1,2])})),"function"==typeof SuppressedError&&SuppressedError;var fn="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAQ4AAAEOCAYAAAB4sfmlAAAABGdBTUEAALGPC/xhBQAAACBjSFJNAAB6JgAAgIQAAPoAAACA6AAAdTAAAOpgAAA6mAAAF3CculE8AAAABmJLR0QA/wD/AP+gvaeTAAAAB3RJTUUH5gYXDA8FsK/ZnQAAAAFvck5UAc+id5oAACF9SURBVHja7d19gJRlvTfw7++a2ZnlVQFRJGBneU1gZ0EyszpHy15OnvJRj5rlU5aVnTJEAnZ3dkFHZXeWtwBJe/FkVk9lUumpTm9Hj1SPmSXCzgKGLOwMi4gKaLwsO2/X7/lDMvThZXeZmd/98vv8FbUx3/tm5rvXfc91XxdBKXVSNQ3pYaDCnYboF20t1b+RzuMEQekASjnWNRyITk5/ni3fSaARbOlZ6UhOocWh1HFEG1LvBXWugqUaOvrfEVGVdC6n0OJQ6hjRhalqFLAc4KsAesP/xrBaHEdpcSgFIDp/zyCEemJc4HkEVJ7gx0ZK53QKLQ7lc0y1jTuvZ+5pBfNb6OQ/PFw6rVNocSjfmtaw/YIApVcz80W9+XnW4nidFofynemNL54TQ
78HerZXwSYNPb/x8BQ6WzO4UWh/KNqfHNoWB20Bzm7oUMDKW+/gVE+nk5Sk+E8oVoU/oj6LErQDypz4Xxd8wV0sfhFFocytOmL0ydRwVeBWs/gH43xmsY0OI4SotDedKMeOeZNmNuR8HejCJ94AmUkz4up9DiUN5yzUOB2okXfNZmcBdgizzvgnukD88ptDiUZ9TEui4m5FcxMKM0r0BHpI/RKbQ4lOvNqt89Lk/Z5YzC1cDp3sk4qcPSx+oUWhzKtWbFdw/MZjL1OWQWABhQ+lfkvdLH7BRaHMqVoo07r8tlMksJGFu2F2V+Sfq4nUKLQ7lKtDF1PoDV4MK7y/7iZLQ4jtLiUK4Qnd9xNkLBZma+kYBeTxMvKqIu6fPgFFocytFm3cQV+ZHp2Wz5NjCfUco7n6dCwHbp8+EUWhzKsWoaUx/KIbUSFlOkswCAZdbiOEqLQzlObWzXZEZ+JZgvk85yrCDCHdIZnEKLQznGrPrtZ+QosIiRmw0gJJ3nWAy8sCFx7svSOZxCi0PJi7OJ9qRvzBEvBvgc6TjHQ6AN0hmcRItDiaqt3/5uzqRWg3C+dJaTsxulEziJFocSEa3bNQaB/FIGX4fSThMvkuBT0gmcRItDldWYuV0DRlTmFzBy9QAGSufpDQas7Tn4f6VzOIkWhyqbmqb0NWTzyxhw1f4kBGzavHLafukcTqLFoUpuWv2O2oCh1bD2Yuks/cGg30lncBotDlUyk+ftPmtAKLOYGZ8FEJDO01/E/EvpDE6jxaGK7pI4B/dnd94Mzt7OwDA33Po8MTrUfTj3uHQKp9HiUEVV29j5wX09qZVEOE86SzEw+NGONZMy0jmcRotDFcX5DV0T8yb/FWZ8hFw9wngTtj+WjuBEWhzqtEype3lIZeDQwjzyc8AIS+cpssOUH/SIdAgn0uJQ/cNMNU1dN8AeSjAwSjpOSRD9Z3L5KF1n9Di0OFSf1cRSF6ExtZqAC9x94/PkCOa70hmcysP/7KrYapu2vgWFcCuDrwd5/L1DtD3ZXDUJRCwdxYl0xKFOKRLvrBzaw/PYmgYQD5bOUybf0NI4MS0OdVK1sdRVnOHlIKoGfPM5OpLl4P3SIZxMi0MdV0399hoygVUMfq90lnIj0P1/TYzZJ53DybQ41BtMi3cND2YLdzLj8wD78f2RMya0TDqE0/nxjaGOJ/54sLan+t85k7+DgeHSccQQfriheXRaOobTaXEoRBvTlyLDq5h4unQWYVlrAndKh3ADLQ4fq2lIjzeGlzPbK6WzOAGB7tu0eJxugdALWhw+NDW+eXAwO7CR2c5lRqV0HmfgQxweoKONXtLi8BWm2tjO/80Z2wpgtLdncPURU0syPkr3hu0lLQ6fqG3qejtzajUz3iGdxYH+mq/sXiEdwk20ODzuvMbUuRXMCbaFT0Bqs2ZHI0YAN2+JT8tKJ3ETLQ6Pmjh7W3jAkNCtYNsEYIiPZn32EX83ubj6f6RTuI0WhwfV1Hf+LzJYAbYTpLM4XFeFtXOkQ7iRFoeHzIylp1rYVQy8XzqL4zHYGv7M+iUT/iYdxY20ODygpiE9jMjGC7BfAFAhnccNCFi1qWX8f0vncCstDje7hgPRiambwHwngLOk47gHPRncv7deOoWb6Vf5LjVjYecltoDVAKLSWVyFaa8NVJy/qfktXdJR3ExHHC4zo6EzYomW2QL+DWAt/r7JwRSu29Qc0dI4TVocLhGd3zaIK4Y0WGAewAOk87gRAbPbWiY8Jp3DC7Q4XKCmMfVxMJYQeIx0Frci8FfaEuO/IZ3DK3So62DT61LnmSC+BmZXbtbsHPS9ZKLqBkDXEC0WHXE4UCTeWTkkS43EXOfBTY7KjH4xPFx1o5ZGcemIw2FqGra/j4y5F4xJ0lncjhkPFyoj122Jkz6HUmRaHA4Rnd9xNoeCK4hxvX5bUgz0veTMqk/jWipIJ/EifYM6QE0sdRkxfxuEs6WzeALRvcnmqi/pviilo8UhKBLvrByawRIwZnt+Z7QyIcKStpbqBukcXqdvViG1i9LTOG9/AJ35WSw5GDM/2Vx1t3QQP9DiEBBtSn0RlpcD0IlcRcCMPUR8bTIx/g/SWfxCi6OMptS9PCQcOPQAgKuks3gHPZEjXPNsS+QF6SR+okvJlUlNQ3p8OHD4SWhpFA0RranYt/c9WhrlpyOOMpixsOuSQiH/YwJGSGfxiBcB86VkourH0kH8SkccJVbb0PnvNp//rZZGUTARHij0BKdqacjSEUfJMEVj6aUAz5dO4g20w5D99426apcj6LMqJXBJnIP7e1LfAvBJ6SzuR3kG7g6FQ4vWx0d3S6dRr9ERR5HNiu8emM9mH2Lmf5XO4npEjwHm1mTLuE3SUdQbaXEU0cT4tqEDeoK/IsI7pbO4XCcZmtfWHHlYOog6Pr1UKZKJs7cNHZip+DWIL5LO4l58CDCJ7kNVKzrWUEY6jToxHXEUwdGJXb8BoKXRHwxm8PdNINfQ1jzleek46tS0OE7TlLq/Dqk04V+zXp70CwN/IYNbks3Vf5LOonpPL1VOw9T45lAwU/kwg7U0+ogZe2AQa2+JfEdX53IfnQDWX8wUzAz8LsCXSkdxmQwBS7M2M7m9pfoBLQ130hFHP0UbU6sAfFQ6h8v8rMDBeZtbx3ZIB1GnR4ujH6Kx1HyAb5HO4RYM2mLYzm1rHf9b6SyqOPTmaB/VxFKXEfAzgAPSWVzgFRDuGB6K3LMuTnnpMKp4tDj6ILpwxxRY+hMYZ0pncTRGgYy570imYtFzK0bvlY6jik+Lo5dm1W8/I0fmKRCmSGdxMgKty1t76+Yl49uks6jS0XscvZQ35gFAS+Mk0sy8INlavVY6iCo9LY5eqGnccTMzrpDO4Ux0mAhL9h0JLN+1cuwR6TSqPPRS5RSmN+6IEtNTBFRKZ3EUBoPoQRSCdcmlY3ZJx1HlpcVxErPiuwfmejJPg3CedBZnofUGNGdjouoJ6SRKhs4cPYl8T2axlsYbvAjQZ5PhB96upeFvOuI4gWis60Kg8ITO1wAAZMG0prtyyJ0d8REHpMMoeXpz9DimxjeHkCl8S0sDAPBLQsXcttYxz0kHUc6hxXEcwezARoCnSecQxdjKhua2t0R+JR1FOY9eqrzJzKbdVQWbfRZgv27P+DcG3Rnat3fN+m++LScdRjmTjjjexNrMUvhyT1cqgOy3kbVN7csnviSdRjmbjjiOEY3t/CfA/g5gv52XP4Do1mRL5BnpIModdMRxLLJfAfuqNLpAqEu2VD8oHUS5ixbHUdHYzsvBhbdJ5ygP6mbw8tC+fUvWf/NtusmR6jMtjtcVbpdOUHrEBF4btKEF65eM3imdRrmXFgeAaGzH5QDOl85RYhvZmjnJJeN+Lx1EuZ8WBwCAGqUTlNDLbMzC9opx/4E4Wekwyht8Xxy1TV1vZ5u/UDpH0TFyINxjjuCOjauqXpWOo7zF98VhC4XZ5L3vUX5jLc3dtDTyrHQQ5U3e+8j0wfTGHecYpjSAsHSWomBsA/O85JLxP5eOorzN14/VEwdugAdKg4EDIKrLV3ZP19JQ5eDrSxUD+3E3byPGgDXAdywNjLW3nPOidB7lH769VJkZS08twG6WztFfDGwhg8/oZs1Kgm8vVQrEH5fO0E85gFuOHMqfr6WhpPj2UoUZV7ptuMXAvkAAV29cPH6ddBblb2777BTF9KaOscYG0256CpaBLZzPX75p2aTt0lmU8uWIw9jgB9xUGgA2BMJ478bEpFclQ1wY3zf0YPbA+ECBzoXhUcQYBUMjCDyEmQaDeQgMBV9/wpjBMNQN5kMEOgTgFTZ4gSz2sOHdPT3ZjudWTNEtIl3Il8VBhA+yW75OIdrUk8l84LnElFfL9ZLTG3ecE7CoZTJRwEbBNAmECUcyB0YGAcAcPXkEgBmv/Ylf//M/sv/jz3//KVi89p8sUBkKIRrr3A/Gc2SQZNBfDPjpM0ORTbpJtbO56bdu0URjqecBHi2d41QY2FnI48Ity6r3lOo1Zt3EFbmRz88im38ns30niC4CIH1uDgL0OxA9GjT822cW6wxYp/Fdccys2zm6ECg8L52jFzJkgv/c1jz2zyV7hWseCkQnvu2d1pgCcniFDGUCCNkCdw8JmOBQy3YcQONBXAPgQoCqJC7xmPAsGGtN0DzUdleVa79C9xLfFUe0Kf0RWPsz6RynZOjmZHPkXukYx5re9PzYALL/yowrwPQ+ke0jGH9iwjdD4fCP1sdH6yJEQvxXHI2dcTAcvmgPPZpMRN4vneJkonW7xlAgdyMDXwIwUiDCfjDuLmS612xeOW2/9PnwG/9NAGOaJB3hpPEYGULhZukcp5JcOmZXW6L6zopwOMKELzNoX5kjDAchbioHpqKxHc1T6v46RPqc+InvRhw1DZ1PEOGd0jlOiKg52RJZKB2jr2oa0sPIcDMYnwdY4BcS7QFhUTJUdb8uWFR6vhtxEBCRznAiDD7IllZI5+iP9taqV5ItkS+aQOBSAF3lT8
78CjwHxfNJP+fW1s+2Tp8+F1viqOWTc9XcGEUdI5ToTIfL29teoV6RynY+Piset6suHzifDfMgn4XcxmY7QxPUf6XHiZr4ojO3zkYHLsMXO+AlgpnaIYnlsxeu+wUOoygL4lEoAwAGxXRWOdP5wV3z1Q+nx4ka/ucUTrdo1BICcwjO4N+nUyEfmQdIpiq42lvspgsZu9DCTB5sr21qod0ufCSxz627dEQjRIOsIJEf1QOkIptIWrbmHgIanXJyBKZP80rX5HrfS58BJfFYe1GacuE5jrDmUfkQ5REnGyhXD3JwB6VDDFSGPMY7WLUjOlT4dX+Ko4gjk+Ip3hBDZ0xCcdkA5RKlvi07KZwqCrQOiUykDgEZznx6Y3bffJNp+l5aviIKo4LJ3huLkYT0hnKLWtS0ceNCZ4IwOScyyGGWt+MbV++zjp8+F2vioOzhYc+WyDBT8pnaEcNi4eu46ArwrHOCdoAo/oty2nx1fFsfHM7xxgUI90jjdjU7FVOkO5VITDMQJ1yKbgmfls9gHpc+FmvioOxOOWBK+zj4/YhsK++apwfXx0N9iIT6ln5mtqYunPSedwK38VBwAwnLVmJ+HwlvjZh6RjlFNbYuxDAJLSOQh2WW3T1rdI53AjHxYHO6o4iHFQOkP5D5qYiZZIxwBwBnPoa9Ih3Mh/xQHeJJ3gDWkIjrxhW2pHDuZ+AuBl6RxgfKQm1nmFdAy38V1xmAL/TjrDG7D7967tj441kzIg+q50DgAwQNxlq96L811xbFw2YRuA3dI5jjFAOoAUw/SwdAYAYKC2Npa+UjqHm/iuOAAAROukIxzjDMQf9+U2FRvD454E8JJ0DgBg8O066ug9XxYHwf5KOsM/cHBmboo/7+zHyRKRUy4do9GG9HukQ7iFL4uDswcfBpzzbYbl7HjpDFKYUbrtH/qK+JPSEdzCl8WRXF57GMBPpXP8HTNmSWeQQoT10hmOcVV0fptzl15wEF8WBwCAnXFHHwCI8HbpDFIMhZw0a3YIhYboTdJe8G1xJFurHocDZi8CADNfjLjEyuDyNlRsfR5wzj6xDOO5VdhKwZdv1tcQE+gO6RRHnT0js/Mi6RAi4u/Jg/CqdIzXMV8iHcENfFwcQFui6mEC2qRzAACjcJV0BsGjd9ICS6NnLNzu6E27nMDXxQEQWyAunQIAGPSJibO3+XIWKUBZ6QTHsnm6WDqD0/m8OID2RPUjIPxcOgeAkQOGVPybdAgJxHDWojqGpktHcDrfFwcAEGW/AOBv4jmY68H+m73IBGft+8o0QTqC02lxAGhrnvI8wyyQzgEgWruw61rpEOU0Nf7SYDCcNXeCoMVxClocR7Unqu4jorXSOWDtYj+th0lHDk1w2jMizKhGPK6fjZPQk3OMYCj0KYA2SGZg8MRcJpOQPhflYgiO2yCawJUzXr1hqHQOJ9PiOMb6+OjuvC1cAeBFyRwMfGnGwq5LpM9HORiQI+evUCjgm1Fff2hxvMmWJRN2WhP4MACxXeMJMNbm759S97KzbhqWgCW8WzrD8TDnnHXfxWG0OI5jU/O4pylIlzJon1gIRnU4cPinU+ObQ9Lno1QmxrcNJWCGdI7jyVeQbxdY6g0tjhNouyuywVp7KUTXxeT3BTIDv+fV51gGZkNXAKiQznE8xoQz0hmczJNvyGLZvGR8G7N5Bws+DEfAtbWZ9N3S56IkmD8mHeGEsuzI7UKdQovjFNpbq3aEwuGLAHpQKgODb47GUv9xiYeWGJzVmDoXsO+TznEibApaHCehxdEL6+Oju5OJyMdA5lYwhB7I4s+8ko38cvK83WdJn49iyAFzAXJkETJgR1SOc8wKcU7kqIk3blAb2z6ZEbgf4HcJRegyjE9ubK1eJ30u+qumIT0MVEgTyKHfGtHzyURkjHQKJ9MRRx+1JSY8lwxX/TOIPgfQHoEIYy3RY9HG1L01Delh0uejP8jwPOeWBsDMaekMTqcjjtMwpe6vQ8KBUAODZhPK/6AWg/aBuDkUCn9jfXy0K3aEq41tn2zZJImcvBEV/SCZiFwvncLJdMRxGrYufevBZGJ8k+3pjoBNHMD+cr4+gUcQ4yu5TCZVG+u8LVq3y/HDa0bgHmeXBgDibdIRnE5HHEU0K757YDaT+SgRbgLjHeVPQAUQP0qERwoI/dem5rd0SZ+TY0WbUl+E5Xukc5yS4cuTzeOdsEaLY2lxlEjtovQ0W+CPAnw1Mc4rfwJigFMA/gymdoB3GDI7CzZ/IEADDxaQNWw5jAoMM9YGkh1P/xFrry2U7Hw0db2dbf73gMNHGwByRKOfbYm8IJ3DybQ4yuD8hanz8pY+AOb3AXwxBO6HvMluMD9JZP5ogSdD+6qeXv9NypXqxaYu6BwVCOIpAsYJH3cv0O5kIuLPnfX6QIujzC6Jc/DVbGp6gfkCQ/Q2tojC0GQwDy/6izHvBagDxNtAaCeLtoIZ1Lap5ZyyPf07ed7WsyrD4cfB7Irl+Bh4qD1R/VHpHE6nxeEQk+ftPquyMjORLI22hHMNYxSAYQweDKLBAAa+vqwgEcNyHkQHifgQgw7C8j4m7IGlPYUAvzCgYDvXL5kguhzijHjnmTaD/wEwU/r89h59NpmIfEs6hdNpcaiSmL5g2wQKBn9GwFTpLL1HbE2+alPzREfdVHYi/TpWFd2MhZ2XUDD4lLtKA2Dws1oavePIZwWUO02cvS08cHDgNlvAAnLo4/InQ0QPS2dwCy0OVRTRps53sMW34LJRxrECTD+QzuAWWhzqtExvfPGcAB9JWMs3kIsvfRlo25Co2iKdwy20OFS/TI1vDgWzg+Ywdy9kYKj777IbHW30gRaH6rPaWPrD3GO/AuJJ7i8MAECGwuEHpEO4iRaH6rXpdanzTJBWMtsPeumLfGZa2x4f9ZJ0DjfR4lCndHQi1+0A3wxm131bciomEFgjncFtPPR7QxVdnE1NJvU5Au4CMFI6Tok8lUxUCzzJ7G464lDHVRPrvJgyqVVw6L4nxcMt0gncSEcc6g1m1e8elzeZZQy6xmmbQZfAM8lE9SzpEG6kIw4F4PVFiOpznFkAYADA0pHKIHCHdAK38vpvFNUL0cbO68BYCmCsdJayIXo62RK5QDqGW+mIw8eijanzYbEazI7c+Ll0iMHmy9Ip3EyLw4ei8zvORkVwMRg3gjggnafcCLy2LTHuD9I53EyLw0dm3cQV+RHp2Qy+DeAzpPPIoCPGhOqkU7idFodP1DSmPpSzqZUApkhnEUW8dEPzaN1w6TRpcXhcbWzXZEZ+JZgv01vhtDkfOqzzNorA928lrxpfv/2MwRRYBOLZAELSeeRRAeB3JRPVT0kn8QIdcXhNnE00k/40wM0AnyMdxymI+e62Vi2NYtHi8JAZsfS7bCa9GmCdDXkMAm0J7t+7UDqHl+iligdE63aNQSC/FODroP+mb8BADxNfuKllfFI6i5foiMPFxsztGjAsXJgPytcDPEg6jxORoXntzdVaGkWmv51cqqZhxzVEtAxAlXQWpyLgkbZE9ZXSObxIRxwuM61+R23A0GoAF0tncTTG1iDbT0nH8CodcbjE5HlbzxoQrryLrf0cCL6bJt4nhFdh+B3JxeO3SkfxKh1xONwlcQ7uz6ZuBuN2ZjtMq/5UqMCM69sXV2tplJC+DR2stmHnByzZlQR27SZH5UcLkonIcukUXqfF4UDnN3RNzFN+BYDLpbO4zN3JRPUc6RB+oMXhIFPqXh5SGTi0kIE5AMLSeVzmR8mWyMdA5Iely8TpPQ5HYKppTN0AeyjBwCjpNO5Dj+XDhz+ppVE+OuIQVhNLXQTwagJ0Gbt+IMYfe2zmX7YufetB6Sx+osUhZGZ852jbY5cw+HqQ/jv005OZwuAPbl06UkujzPRSpcwi8c7KoRn6ciFjYyAeLJ3HvejJ7kO5f+lYo6UhQYujjGqbUldyBssBHi+dxc2Y8ccjlbkPdSQmHZDO4lc6RC6DmvrtNWTMKgDvlc7idkT0X8FQ6Nr18dHd0ln8TEccJfTaJkfZuwi4BWA916eL8d1h4arPrItTXjqK3+mIo0RmNO54v2Xzdb0sKRZankxU1QH6lasTaHEU2bS5XcODA/IrmHED9PyePkaOgFvaWqu/Lh1F/YO+sYsoGktfDdivAtC1PouAgX2BQPDqjYvHrpPOot5Ii6MIZt30dEX2rLNWEPNs6SzeQZuZ6fL21qod0knU/0+L4zSd15g6t4KxFuB3SWfxkJ9mCoM/pRO7nEuL4zREYzv+iZkeItLnS4rkCAzNTzZH7pUOok7OSAdwq2hT+haAHtPSKJokBc0FWhruoMXRD7WNna2wdjWACuksrsdgAHcfCOPCtruqNkvHUb2jlyp9wUzRxtQ9AL4gHcUTGC8x0afbE5FfSkdRfaPF0VsPcSC6If1tgD8hHcX9iJnwfcrm5yWXT3xJOo3qOy2OXpga51CgJ/UgEXSPjtNF2MbWfrG9dcKj0lFU/+k9jlO4JM7BYCb9Ey2N05ZhorsOhBDV0nA/ffDqpJj2Z9L3A/xh6SSuRvQ7m8cXNi2NPCsdRRWHFsdJ1MbSy1nvaZwG2sWE+vaWyA+kk6ji0nscJ1Ab6/w8A/pgVf8cYfCKULgyoetmeJMWx3FEG7dfCja/gs7T6CNiwP7EMC3Y2Fqdkk6jSkeL402mNz0/1hRyz4D4LOksLpM0jDkbW6vXSQdRpaf3OI4x66anK3I29yMtjT4g2kvEi9qe+8t9WHttQTqOKg8tjmPkh49YAvBF0jlcIgfga2wpnmyNvCIdRpWXXqocNb1xx/uNpd/oHienRsBvDczcDYmqLdJZlAz9kACYVb/9jJwx7QDGSmdxMgJ1WMvz25dU/6d0FiVLL1UA5IxZDS2NE2LgAMi0
785EPjVm6JU1Y6j5Ln+xFHdGHqvSjgUYB9fy7ejAFLwPdyRLFnWyIvSOdRzuHrD8vU+OZQMDOwDcBbpbM4DuNPFAjOaWse+2fpKMp5fH2pEuwZOA+kpfEmuwmmoa113P/RPUzUifh2xDG9ccc5htEBkG78DICBHmKszB/obtly77RD0nmUs/l2xBFgs4ihu8UDABE9zJbmJ3UrAtVLvhxxTF+4c4IpFLYACElnkUWbQHRrsqXqMekkyl18OeIwtnAb/F0a+4np9rbtVV/DWtJp4qrPfDfimNm0u6pgM9vgyydfKU/AN/LhwG2b42P3S6dR7uW7EYe12QXwY2kQPcaFwtzkkgnt0lGU+/lqxPHW2K4RIeS6AAyQzlJGnWRoXltz5GHpIMo7fDXiCFH+RrBfSoMOAUh0H6pa0bGGMtJplLf4pziYCU3pz0vHKP1xgsnQ90GBhrbmsc9Lx1He5JviiMZSHwRhgnSOUmLgLyCak2yJPCmdRXmbb4oDhj4B9uwM6j1MiLW3RL6j08RVOfji5mh0/p5BqDjyIoBB0lmKLEPA6p7C4MVbl448KB1G+YcvRhwcPHwFwXirNAg/D9rgl59pHdshHUX5jy+KA2Sulo5QLMx41oBvbUuM/610FuVfnr9UmTh7W3jg4Iq9cP8Dba+AcMfwUOSedXHKS4dR/ub5EcfAQcH3uLo0GAUy5r4joYpFz8VH75WOoxTgg+JgossI7vyigUDr8mxv3dxS1SadRaljeb44iPhiF/ZGmo1ZkGyuWisdRKnj8fQ9jmlzNw83lQNfJsBIZ+kdOkzgpft6gst2rRx7RDqNUifi6RFHoHLIu4GC80uDwSB60Jp8/abmiV3ScZQ6FU8XB5C/0AWDqmcMmVs2JqqekA6iVG95vDjMDDj1BgfjJRA1JsNV30acrHQcpfrC08XB4JkOHG9kQbSmOzzkzo74iAPSYZTqDwd+ropjZuyFkQX0vCSd443ol4Tg3LbEmOekkyh1Ojw74sjZzCTjlNuijK1saG57S+RX0lGUKgbPFkfA2AksP6D6Gxm6M/hy1Zr136ScdBilisWzxcFEE+Tui1IBhG8jm29qWz7RYZdLSp0+zxYHmMYIfaPyBxBuTbZEnpE+BUqVineLg/jsMvdGFwh1yZbqB6UPXalS825xMM4u0+scYcKyUDi8ZH18dLf0YStVDt4tDmBkaf96YgKtNbl
78C3YYV49PSB6tUOXm5OEq5VOBGNmZOsnnc76UPUikJXi6OyhL8nS8zsKg9HLlPp4krP/NycRRvxzZGDmTuMWF7x8Z49avSB6aUNM8WBwPBIk3/+o21NHfT0qpnpY9JKafwbHEQkAMQPo2/YBsKPC+5ZPzPpY9FKadxytMcxUf9m+LNwAEQ1eVD3dO1NJQ6Ps+OOMDcpy0EGLAG+E4+j8YtyyJ7pOMr5WSeLQ4GDhBwZi9//EnLdk5764S/SOdWyg08WxwE7Acw7hQ/9jwbqm9vrvqBbtasVO95tjgA2neih9wY6CGiFchWJtqXjzosnVQpt/FwcfCJdj37KeVofnJ5pFM6oVJu5dniIJg049jJndxOZOa0tUQel86mlNt5tjiYOQ0CGNhHTLclt0e+gbVUkM6llBd4tjgIpsPCftX2HL5988pp+6XzKOUl/w9vbeT/L2dfMwAAACV0RVh0ZGF0ZTpjcmVhdGUAMjAyMi0wNi0yM1QxMjoxMzo0MiswMDowMIbbr3kAAAAldEVYdGRhdGU6bW9kaWZ5ADIwMjItMDYtMjNUMTI6MTM6NDIrMDA6MDD3hhfFAAAAAElFTkSuQmCC";let fi=()=>{var e;return!!(null===(e=window.near)||void 0===e?void 0:e.isSender)},fo=()=>({wallet:window.near}),fs=({options:e,metadata:t,store:r,provider:n,emitter:i,logger:o,id:s})=>fr(void 0,void 0,void 0,function*(){let a=fo(),c=()=>{for(let e in a.wallet.callbacks)a.wallet.remove(e)},u=()=>fr(void 0,void 0,void 0,function*(){if(!a.wallet.isSignedIn())return;c();let e=yield a.wallet.signOut();if(!0===e)return;let t=Error("string"==typeof e.error?e.error:e.error.type);if("User reject"===t.message)throw t;o.log("Failed to sign out"),o.error(t)}),l=()=>{a.wallet.on("accountChanged",e=>fr(void 0,void 0,void 0,function*(){o.log("onAccountChange",e),i.emit("signedOut",null)})),a.wallet.on("rpcChanged",t=>fr(void 0,void 0,void 0,function*(){o.log("onNetworkChange",t),e.network.networkId!==t.networkId&&(yield u(),i.emit("signedOut",null),i.emit("networkChanged",{networkId:t.networkId}))}))},d=()=>fr(void 0,void 0,void 0,function*(){let{selectedWalletId:t}=r.getState();t===s&&(yield(0,g.fm)(()=>{var e;return!!(null===(e=a.wallet)||void 0===e?void 0:e.isSignedIn())},{timeout:1e3}).catch());let n=a.wallet.getAccountId();if(!n)return[];yield(0,g.fm)(()=>!!a.wallet.account(),{timeout:100});let i=a.wallet.account();if(!i.connection.signer.getPublicKey)return[{accountId:n,publicKey:void 0}];let o=yield i.connection.signer.getPublicKey(i.accountId,e.network.networkId);return[{accountId:n,publicKey:o?o.toString():void 0}]}),f=e=>e.every(e=>e.functionCall),h=e=>{if(!f(e))throw Error(`Only 'FunctionCall' actions types are supported by ${t.name}`);return e.map(e=>{let t=(0,g.Cc)(e);return"FunctionCall"===t.type?t.params:{}})},p=e=>e.map(e=>({receiverId:e.receiverId,actions:h(e.actions)}));return a.wallet&&a.wallet.isSignedIn()&&l(),{signIn({contractId:e,methodNames:t}){return fr(this,void 0,void 0,function*(){let r=yield d();if(r.length)return r;let{accessKey:n,error:i}=yield a.wallet.requestSignIn({contractId:e||"",methodNames:t});if(!n||i)throw yield u(),Error(("string"==typeof i?i:i.type)||"Failed to sign in");return l(),yield d()})},signOut:u,getAccounts(){return fr(this,void 0,void 0,function*(){return d()})},verifyOwner({message:t}){return fr(this,void 0,void 0,function*(){o.log("Sender:verifyOwner",{message:t});let r=a.wallet.account();if(!r)throw Error("Wallet not signed in");if(!r.connection.signer.signMessage)throw Error("Wallet is locked");let i=e.network.networkId,s=r.accountId,c=yield r.connection.signer.getPublicKey(s,i),u={accountId:s,message:t,blockId:(yield n.block({finality:"final"})).header.hash,publicKey:m.from(c.data).toString("base64"),keyType:c.keyType},l=JSON.stringify(u),d=yield r.connection.signer.signMessage(new Uint8Array(m.from(l)),s,i);return Object.assign(Object.assign({},u),{signature:m.from(d.signature).toString("base64"),keyType:d.publicKey.keyType})})},signMessage(e){return fr(this,void 0,void 0,function*(){return a.wallet.signMessage(e).then(e=>{if(e.error)throw Error(e.error);if(!(null==e?void 0:e.response))throw Error("Invalid response");return e.response})})},signAndSendTransaction({signerId:e,receiverId:t,actions:n}){return fr(this,void 0,void 0,function*(){o.log("signAndSendTransaction",{signerId:e,receiverId:t,actions:n});let{contract:i}=r.getState();if(!a.wallet.isSignedIn()||!i)throw Error("Wallet not signed in");return a.wallet.signAndSendTransaction({receiverId:t||i.contractId,actions:h(n)}).then(e=>{var t;if(e.error)throw Error(e.error);if(e.response&&"error"in e.response)throw Error(e.response.error.message);if(!(null===(t=e.response)||void 0===t?void 0:t.length))throw Error("Invalid response");return e.response[0]})})},signAndSendTransactions({transactions:e}){return fr(this,void 0,void 0,function*(){if(o.log("signAndSendTransactions",{transactions:e}),!a.wallet.isSignedIn())throw Error("Wallet not signed in");return a.wallet.requestSignTransactions({transactions:p(e)}).then(e=>{var t;if(e.error)throw Error(e.error);if(e.response&&"error"in e.response)throw Error(e.response.error.message);if(!(null===(t=e.response)||void 0===t?void 0:t.length))throw Error("Invalid response");return e.response})})},importAccountsInSecureContext({accounts:t}){return fr(this,void 0,void 0,function*(){window.near&&window.near.isSender&&(yield window.near.batchImport({keystore:t,network:e.network.networkId}))})},createSignedTransaction(e,r){return fr(this,void 0,void 0,function*(){throw o.log("createSignedTransaction",{receiverId:e,actions:r}),Error(`Method not supported by ${t.name}`)})},signTransaction(e){return fr(this,void 0,void 0,function*(){throw o.log("signTransaction",{transaction:e}),Error(`Method not supported by ${t.name}`)})},getPublicKey(){return fr(this,void 0,void 0,function*(){throw o.log("getPublicKey",{}),Error(`Method not supported by ${t.name}`)})},signNep413Message(e,r,n,i,s){return fr(this,void 0,void 0,function*(){throw o.log("signNep413Message",{message:e,accountId:r,recipient:n,nonce:i,callbackUrl:s}),Error(`Method not supported by ${t.name}`)})},signDelegateAction(e){return fr(this,void 0,void 0,function*(){throw o.log("signDelegateAction",{delegateAction:e}),Error(`Method not supported by ${t.name}`)})}}});function fa({iconUrl:e=fn,deprecated:t=!1}={}){return()=>
vendor: 6,530 bytes, line 78
78fr(this,void 0,void 0,function*(){return(0,y.isMobile)()?null:{id:"sender",type:"injected",metadata:{name:"Sender",description:"Browser extension wallet built on NEAR.",iconUrl:e,downloadUrl:"https://chrome.google.com/webstore/detail/sender-wallet/epapihdplajcdnnkdeiahlgigofloibg",deprecated:t,available:yield fi()},init:fs}})}},51957:(e,t,r)=>{"use strict";r.d(t,{j:()=>yS});var n,i,o,s,a,c,u,l,d,f,h,p,y,g,m,b,v,w,_,E,S,x,A,I,O,T=r(54338),P=r(91132),M=r(7490),N=r(84136),k=r(20791),C=r(40972),D=r(7316),j=r(15363),R=r(75927).Buffer,L="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},B=function(e){try{return!!e()}catch(e){return!0}},U=!B(function(){var e=(function(){}).bind();return"function"!=typeof e||e.hasOwnProperty("prototype")}),$=U,K=Function.prototype,F=K.call,z=$&&K.bind.bind(F,F),q=$?z:function(e){return function(){return F.apply(e,arguments)}},V=q,H=V({}.toString),G=V("".slice),W=function(e){return G(H(e),8,-1)},J=B,Z=W,Y=Object,X=q("".split),Q=J(function(){return!Y("z").propertyIsEnumerable(0)})?function(e){return"String"===Z(e)?X(e,""):Y(e)}:Y,ee=function(e){return null==e},et=ee,er=TypeError,en=function(e){if(et(e))throw new er("Can't call method on "+e);return e},ei=Q,eo=en,es=function(e){return ei(eo(e))},ea=function(e){return e&&e.Math===Math&&e},ec=ea("object"==typeof globalThis&&globalThis)||ea("object"==typeof window&&window)||ea("object"==typeof self&&self)||ea("object"==typeof L&&L)||ea("object"==typeof L&&L)||function(){return this}()||Function("return this")(),eu={exports:{}},el=ec,ed=Object.defineProperty,ef=function(e,t){try{ed(el,e,{value:t,configurable:!0,writable:!0})}catch(r){el[e]=t}return t},eh=ec,ep=ef,ey="__core-js_shared__",eg=eu.exports=eh[ey]||ep(ey,{});(eg.versions||(eg.versions=[])).push({version:"3.41.0",mode:"global",copyright:"\xa9 2014-2025 Denis Pushkarev (zloirock.ru)",license:"https://github.com/zloirock/core-js/blob/v3.41.0/LICENSE",source:"https://github.com/zloirock/core-js"});var em=eu.exports,eb=function(e,t){return em[e]||(em[e]=t||{})},ev=en,ew=Object,e_=function(e){return ew(ev(e))},eE=e_,eS=q({}.hasOwnProperty),ex=Object.hasOwn||function(e,t){return eS(eE(e),t)},eA=0,eI=Math.random(),eO=q(1..toString),eT=function(e){return"Symbol("+(void 0===e?"":e)+")_"+eO(++eA+eI,36)},eP=ec.navigator,eM=eP&&eP.userAgent,eN=eM?String(eM):"",ek=ec,eC=eN,eD=ek.process,ej=ek.Deno,eR=eD&&eD.versions||ej&&ej.version,eL=eR&&eR.v8;eL&&(i=(n=eL.split("."))[0]>0&&n[0]<4?1:+(n[0]+n[1])),!i&&eC&&(!(n=eC.match(/Edge\/(\d+)/))||n[1]>=74)&&(n=eC.match(/Chrome\/(\d+)/))&&(i=+n[1]);var eB=i,eU=eB,e$=B,eK=ec.String,eF=!!Object.getOwnPropertySymbols&&!e$(function(){var e=Symbol("symbol detection");return!eK(e)||!(Object(e)instanceof Symbol)||!Symbol.sham&&eU&&eU<41}),ez=eF&&!Symbol.sham&&"symbol"==typeof Symbol.iterator,eq=eb,eV=ex,eH=eT,eG=eF,eW=ez,eJ=ec.Symbol,eZ=eq("wks"),eY=eW?eJ.for||eJ:eJ&&eJ.withoutSetter||eH,eX=function(e){return eV(eZ,e)||(eZ[e]=eG&&eV(eJ,e)?eJ[e]:eY("Symbol."+e)),eZ[e]},eQ="object"==typeof document&&document.all,e0=void 0===eQ&&void 0!==eQ?function(e){return"function"==typeof e||e===eQ}:function(e){return"function"==typeof e},e1=e0,e2=function(e){return"object"==typeof e?null!==e:e1(e)},e5=e2,e3=String,e8=TypeError,e6=function(e){if(e5(e))return e;throw new e8(e3(e)+" is not an object")},e4={},e9=!B(function(){return 7!==Object.defineProperty({},1,{get:function(){return 7}})[1]}),e7=B,te=e9&&e7(function(){return 42!==Object.defineProperty(function(){},"prototype",{value:42,writable:!1}).prototype}),tt={},tr=e2,tn=ec.document,ti=tr(tn)&&tr(tn.createElement),to=function(e){return ti?tn.createElement(e):{}},ts=B,ta=to,tc=!e9&&!ts(function(){return 7!==Object.defineProperty(ta("div"),"a",{get:function(){return 7}}).a}),tu=U,tl=Function.prototype.call,td=tu?tl.bind(tl):function(){return tl.apply(tl,arguments)},tf=ec,th=e0,tp=function(e){return th(e)?e:void 0},ty=function(e,t){return arguments.length<2?tp(tf[e]):tf[e]&&tf[e][t]},tg=q({}.isPrototypeOf),tm=ty,tb=e0,tv=tg,tw=Object,t_=ez?function(e){return"symbol"==typeof e}:function(e){var t=tm("Symbol");return tb(t)&&tv(t.prototype,tw(e))},tE=String,tS=function(e){try{return tE(e)}catch(e){return"Object"}},tx=e0,tA=tS,tI=TypeError,tO=function(e){if(tx(e))return e;throw new tI(tA(e)+" is not a function")},tT=tO,tP=ee,tM=function(e,t){var r=e[t];return tP(r)?void 0:tT(r)},tN=td,tk=e0,tC=e2,tD=TypeError,tj=td,tR=e2,tL=t_,tB=tM,tU=function(e,t){var r,n;if("string"===t&&tk(r=e.toString)&&!tC(n=tN(r,e))||tk(r=e.valueOf)&&!tC(n=tN(r,e))||"string"!==t&&tk(r=e.toString)&&!tC(n=tN(r,e)))return n;throw new tD("Can't convert object to primitive value")},t$=TypeError,tK=eX("toPrimitive"),tF=function(e,t){if(!tR(e)||tL(e))return e;var r,n=tB(e,tK);if(n){if(void 0===t&&(t="default"),!tR(r=tj(n,e,t))||tL(r))return r;throw new t$("Can't convert object to primitive value")}return void 0===t&&(t="number"),tU(e,t)},tz=tF,tq=t_,tV=function(e){var t=tz(e,"string");return tq(t)?t:t+""},tH=e9,tG=tc,tW=te,tJ=e6,tZ=tV,tY=TypeError,tX=Object.defineProperty,tQ=Object.getOwnPropertyDescriptor,t0="enumerable",t1="configurable",t2="writable";tt.f=tH?tW?function(e,t,r){if(tJ(e),t=tZ(t),tJ(r),"function"==typeof e&&"prototype"===t&&"value"in r&&t2 in r&&!r[t2]){var n=tQ(e,t);n&&n[t2]&&(e[t]=r.value,r={configurable:t1 in r?r[t1]:n[t1],enumerable:t0 in r?r[t0]:n[t0],writable:!1})}return tX(e,t,r)}:tX:function(e,t,r){if(tJ(e),t=tZ(t),tJ(r),tG)try{return tX(e,t,r)}catch(e){}if("get"in r||"set"in r)throw new tY("Accessors not supported");return"value"in r&&(e[t]=r.value),e};var t5=Math.ceil,t3=Math.floor,t8=Math.trunc||function(e){var t=+e;return(t>0?t3:t5)(t)},t6=function(e){var t=+e;return t!=t||0===t?0:t8(t)},t4=t6,t9=Math.max,t7=Math.min,re=function(e,t){var r=t4(e);return r<0?t9(r+t,0):t7(r,t)},rt=t6,rr=Math.min,rn=function(e){var t=rt(e);return t>0?rr(t,0x1fffffffffffff):0},ri=rn,ro=function(e){return ri(e.length)},rs=es,ra=re,rc=ro,ru=function(e){return function(t,r,n){var i,o=rs(t),s=rc(o);if(0===s)return!e&&-1;var a=ra(n,s);if(e&&r!=r){for(;s>a;)if((i=o[a++])!=i)return!0}else for(;s>a;a++)if((e||a in o)&&o[a]===r)return e||a||0;return!e&&-1}},rl={includes:ru(!0),indexOf:ru(!1)},rd={},rf=q,rh=ex,rp=es,ry=rl.indexOf,rg=rd,rm=rf([].push),rb=function(e,t){var r,n=rp(e),i=0,o=[];for(r in n)!rh(rg,r)&&rh(n,r)&&rm(o,r);for(;t.length>i;)rh(n,r=t[i++])&&(~ry(o,r)||rm(o,r));return o},rv=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleStr
78ing","toString","valueOf"],rw=rb,r_=rv,rE=e9,rS=te,rx=tt,rA=e6,rI=es,rO=Object.keys||function(e){return rw(e,r_)};e4.f=rE&&!rS?Object.defineProperties:function(e,t){rA(e);for(var r,n=rI(t),i=rO(t),o=i.length,s=0;o>s;)rx.f(e,r=i[s++],n[r]);return e};var rT=ty("document","documentElement"),rP=eT,rM=eb("keys"),rN=function(e){return rM[e]||(rM[e]=rP(e))},rk=e6,rC=e4,rD=rv,rj=rd,rR=rT,rL=to,rB=">",rU="<",r$="prototype",rK="script",rF=rN("IE_PROTO"),rz=function(){},rq=function(e){return rU+rK+rB+e+rU+"/"+rK+rB},rV=function(e){e.write(rq("")),e.close();var t=e.parentWindow.Object;return e=null,t},rH=function(){var e,t=rL("iframe"),r="java"+rK+":";return t.style.display="none",rR.appendChild(t),t.src=String(r),(e=t.contentWindow.document).open(),e.write(rq("document.F=Object")),e.close(),e.F},rG=function(){try{o=new ActiveXObject("htmlfile")}catch(e){}rG="undefined"!=typeof document?document.domain&&o?rV(o):rH():rV(o);for(var e=rD.length;e--;)delete rG[r$][rD[e]];return rG()};rj[rF]=!0;var rW=Object.create||function(e,t){var r;return null!==e?(rz[r$]=rk(e),r=new rz,rz[r$]=null,r[rF]=e):r=rG(),void 0===t?r:rC.f(r,t)},rJ=eX,rZ=rW,rY=tt.f,rX=rJ("unscopables"),rQ=Array.prototype;void 0===rQ[rX]&&rY(rQ,rX,{configurable:!0,value:rZ(null)});var r0=function(e){rQ[rX][e]=!0},r1={},r2=e0,r5=ec.WeakMap,r3=r2(r5)&&/native code/.test(String(r5)),r8=function(e,t){return{enumerable:!(1&e),configurable:!(2&e),writable:!(4&e),value:t}},r6=tt,r4=r8,r9=e9?function(e,t,r){return r6.f(e,t,r4(1,r))}:function(e,t,r){return e[t]=r,e},r7=r3,ne=ec,nt=e2,nr=r9,nn=ex,ni=eu.exports,no=rN,ns=rd,na="Object already initialized",nc=ne.TypeError,nu=ne.WeakMap,nl=function(e){return c(e)?a(e):s(e,{})},nd=function(e){return function(t){var r;if(!nt(t)||(r=a(t)).type!==e)throw new nc("Incompatible receiver, "+e+" required");return r}};if(r7||ni.state){var nf=ni.state||(ni.state=new nu);nf.get=nf.get,nf.has=nf.has,nf.set=nf.set,s=function(e,t){if(nf.has(e))throw new nc(na);return t.facade=e,nf.set(e,t),t},a=function(e){return nf.get(e)||{}},c=function(e){return nf.has(e)}}else{var nh=no("state");ns[nh]=!0,s=function(e,t){if(nn(e,nh))throw new nc(na);return t.facade=e,nr(e,nh,t),t},a=function(e){return nn(e,nh)?e[nh]:{}},c=function(e){return nn(e,nh)}}var np={set:s,get:a,has:c,enforce:nl,getterFor:nd},ny={},ng={},nm={}.propertyIsEnumerable,nb=Object.getOwnPropertyDescriptor,nv=nb&&!nm.call({1:2},1);ng.f=nv?function(e){var t=nb(this,e);return!!t&&t.enumerable}:nm;
78var nw=e9,n_=td,nE=ng,nS=r8,nx=es,nA=tV,nI=ex,nO=tc,nT=Object.getOwnPropertyDescriptor;ny.f=nw?nT:function(e,t){if(e=nx(e),t=nA(t),nO)try{return nT(e,t)}catch(e){}if(nI(e,t))return nS(!n_(nE.f,e,t),e[t])};var nP={exports:{}},nM=e9,nN=Function.prototype,nk=nM&&Object.getOwnPropertyDescriptor,nC=ex(nN,"name"),nD=nC&&"something"===(function(){}).name,nj=nC&&(!nM||nM&&nk(nN,"name").configurable),nR={EXISTS:nC,PROPER:nD,CONFIGURABLE:nj},nL=q,nB=e0,nU=eu.exports,n$=nL(Function.toString);nB(nU.inspectSource)||(nU.inspectSource=function(e){return n$(e)});var nK=nU.inspectSource,nF=q,nz=B,nq=e0,nV=ex,nH=e9,nG=nR.CONFIGURABLE,nW=nK,nJ=np,nZ=nJ.enforce,nY=nJ.get,nX=String,nQ=Object.defineProperty,n0=nF("".slice),n1=nF("".replace),n2=nF([].join),n5=nH&&!nz(function(){return 8!==nQ(function(){},"length",{value:8}).length}),n3=String(String).split("String"),n8=nP.exports=function(e,t,r){"Symbol("===n0(nX(t),0,7)&&(t="["+n1(nX(t),/^Symbol\(([^)]*)\).*$/,"$1")+"]"),r&&r.getter&&(t="get "+t),r&&r.setter&&(t="set "+t),(!nV(e,"name")||nG&&e.name!==t)&&(nH?nQ(e,"name",{value:t,configurable:!0}):e.name=t),n5&&r&&nV(r,"arity")&&e.length!==r.arity&&nQ(e,"length",{value:r.arity});try{r&&nV(r,"constructor")&&r.constructor?nH&&nQ(e,"prototype",{writable:!1}):e.prototype&&(e.prototype=void 0)}catch(e){}var n=nZ(e);return nV(n,"source")||(n.source=n2(n3,"string"==typeof t?t:"")),e};Function.prototype.toString=n8(function(){return nq(this)&&nY(this).source||nW(this)},"toString");var n6=e0,n4=tt,n9=nP.exports,n7=ef,ie=function(e,t,r,n){n||(n={});var i=n.enumerable,o=void 0!==n.name?n.name:t;if(n6(r)&&n9(r,o,n),n.global)i?e[t]=r:n7(t,r);else{try{n.unsafe?e[t]&&(i=!0):delete e[t]}catch(e){}i?e[t]=r:n4.f(e,t,{value:r,enumerable:!1,configurable:!n.nonConfigurable,writable:!n.nonWritable})}return e},it={},ir=rb,ii=rv.concat("length","prototype");it.f=Object.getOwnPropertyNames||function(e){return ir(e,ii)};var io={};io.f=Object.getOwnPropertySymbols;var is=ty,ia=it,ic=io,iu=e6,il=q([].concat),id=is("Reflect","ownKeys")||function(e){var t=ia.f(iu(e)),r=ic.f;return r?il(t,r(e)):t},ih=ex,ip=id,iy=ny,ig=tt,im=function(e,t,r){for(var n=ip(t),i=ig.f,o=iy.f,s=0;s<n.length;s++){var a=n[s];ih(e,a)||r&&ih(r,a)||i(e,a,o(t,a))}},ib=B,iv=e0,iw=/#|\.prototype\./,i_=function(e,t){var r=iS[iE(e)];return r===iA||r!==ix&&(iv(t)?ib(t):!!t)},iE=i_.normalize=function(e){return String(e).replace(iw,".").toLowerCase()},iS=i_.data={},ix=i_.NATIVE="N",iA=i_.POLYFILL="P",iI=i_,iO=ec,iT=ny.f,iP=r9,iM=ie,iN=ef,ik=im,iC=iI,iD=function(e,t){var r,n,i,o,s,a=e.target,c=e.global,u=e.stat;if(r=c?iO:u?iO[a]||iN(a,{}):iO[a]&&iO[a].prototype)for(n in t){if(o=t[n],i=e.dontCallGetSet?(s=iT(r,n))&&s.value:r[n],!iC(c?n:a+(u?".":"#")+n,e.forced)&&void 0!==i){if(typeof o==typeof i)continue;ik(o,i)}(e.sham||i&&i.sham)&&iP(o,"sham",!0),iM(r,n,o,e)}},ij=!B(function(){function e(){}return e.prototype.constructor=null,Object.getPrototypeOf(new e)!==e.prototype}),iR=ex,iL=e0,iB=e_,iU=ij,i$=rN("IE_PROTO"),iK=Object,iF=iK.prototype,iz=iU?iK.getPrototypeOf:function(e){var t=iB(e);if(iR(t,i$))return t[i$];var r=t.constructor;return iL(r)&&t instanceof r?r.prototype:t instanceof iK?iF:null},iq=B,iV=e0,iH=e2,iG=iz,iW=ie,iJ=eX("iterator"),iZ=!1;[].keys&&("next"in(d=[].keys())?(l=iG(iG(d)))!==Object.prototype&&(u=l):iZ=!0),(!iH(u)||iq(function(){var e={};return u[iJ].call(e)!==e}))&&(u={}),iV(u[iJ])||iW(u,iJ,function(){return this});var iY={IteratorPrototype:u,BUGGY_SAFARI_ITERATORS:iZ},iX=tt.f,iQ=ex,i0=eX("toStringTag"),i1=function(e,t,r){e&&!r&&(e=e.prototype),e&&!iQ(e,i0)&&iX(e,i0,{configurable:!0,value:t})},i2=iY.IteratorPrototype,i5=rW,i3=r8,i8=i1,i6=r1,i4=function(){return this},i9=function(e,t,r,n){var i=t+" Iterator";return e.prototype=i5(i2,{next:i3(+!n,r)}),i8(e,i,!1),i6[i]=i4,e},i7=q,oe=tO,ot=e2,or=function(e){return ot(e)||null===e},on=String,oi=TypeError,oo=function(e,t,r){try{return i7(oe(Object.getOwnPropertyDescriptor(e,t)[r]))}catch(e){}},os=e2,oa=en,oc=function(e){if(or(e))return e;throw new oi("Can't set "+on(e)+" as a prototype")},ou=Object.setPrototypeOf||("__proto__"in{}?function(){var e,t=!1,r={};try{(e=oo(Object.prototype,"__proto__","set"))(r,[]),t=r instanceof Array}catch(e){}return function(r,n){return oa(r),oc(n),os(r)&&(t?e(r,n):r.__proto__=n),r}}():void 0),ol=iD,od=td,of=nR,oh=e0,op=i9,oy=iz,og=ou,om=i1,ob=r9,ov=ie,ow=eX,o_=r1,oE=iY,oS=of.PROPER,ox=of.CONFIGURABLE,oA=oE.IteratorPrototype,oI=oE.BUGGY_SAFARI_ITERATORS,oO=ow("iterator"),oT="keys",oP="values",oM="entries",oN=function(){return this},ok=function(e,t,r,n,i,o,s){op(r,t,n);var a,c,u,l=function(e){if(e===i&&y)return y;if(!oI&&e&&e in h)return h[e];switch(e){case oT:case oP:case oM:return function(){return new r(this,e)}}return function(){return new r(this)}},d=t+" Iterator",f=!1,h=e.prototype,p=h[oO]||h["@@iterator"]||i&&h[i],y=!oI&&p||l(i),g="Array"===t&&h.entries||p;if(g&&(a=oy(g.call(new e)))!==Object.prototype&&a.next&&(oy(a)===oA||(og?og(a,oA):oh(a[oO])||ov(a,oO,oN)),om(a,d,!0)),oS&&i===oP&&p&&p.name!==oP&&(ox?ob(h,"name",oP):(f=!0,y=function(){return od(p,this)})),i){if(c={values:l(oP),keys:o?y:l(oT),entries:l(oM)},s)for(u in c)!oI&&!f&&u in h||ov(h,u,c[u]);else ol({target:t,proto:!0,forced:oI||f},c)}return h[oO]!==y&&ov(h,oO,y,{name:i}),o_[t]=y,c},oC=function(e,t){return{value:e,done:t}},oD=es,oj=r0,oR=r1,oL=np,oB=tt.f,oU=ok,o$=oC,oK=e9,oF="Array Iterator",oz=oL.set,oq=oL.getterFor(oF),oV=oU(Array,"Array",function(e,t){oz(this,{type:oF,target:oD(e),index:0,kind:t})},function(){var e=oq(this),t=e.target,r=e.index++;if(!t||r>=t.length)return e.target=null,o$(void 0,!0);switch(e.kind){case"keys":return o$(r,!1);case"values":return o$(t[r],!1)}return o$([r,t[r]],!1)},"values"),oH=oR.Arguments=oR.Array;
vendor: 4,229 bytes, line 78
78if(oj("keys"),oj("values"),oj("entries"),oK&&"values"!==oH.name)try{oB(oH,"name",{value:"values"})}catch(e){}var oG="undefined"!=typeof ArrayBuffer&&"undefined"!=typeof DataView,oW=nP.exports,oJ=tt,oZ=function(e,t,r){return r.get&&oW(r.get,t,{getter:!0}),r.set&&oW(r.set,t,{setter:!0}),oJ.f(e,t,r)},oY=ie,oX=function(e,t,r){for(var n in t)oY(e,n,t[n],r);return e},oQ=tg,o0=TypeError,o1=function(e,t){if(oQ(t,e))return e;throw new o0("Incorrect invocation")},o2=t6,o5=rn,o3=RangeError,o8=function(e){if(void 0===e)return 0;var t=o2(e),r=o5(t);if(t!==r)throw new o3("Wrong length or index");return r},o6=0x10000000000000,o4=Math.sign||function(e){var t=+e;return 0===t||t!=t?t:t<0?-1:1},o9=function(e){return e+o6-o6},o7=Math.abs,se=2220446049250313e-31,st=function(e,t,r,n){var i=+e,o=o7(i),s=o4(i);if(o<n)return s*o9(o/n/t)*n*t;var a=(1+t/se)*o,c=a-(a-o);return c>r||c!=c?1/0*s:s*c},sr=11920928955078125e-23,sn=34028234663852886e22,si=11754943508222875e-54,so=Math.fround||function(e){return st(e,sr,sn,si)},ss=Array,sa=Math.abs,sc=Math.pow,su=Math.floor,sl=Math.log,sd=Math.LN2,sf={pack:function(e,t,r){var n,i,o,s=ss(r),a=8*r-t-1,c=(1<<a)-1,u=c>>1,l=23===t?sc(2,-24)-sc(2,-77):0,d=e<0||0===e&&1/e<0?1:0,f=0;for((e=sa(e))!=e||e===1/0?(i=e!=e?1:0,n=c):(o=sc(2,-(n=su(sl(e)/sd))),e*o<1&&(n--,o*=2),n+u>=1?e+=l/o:e+=l*sc(2,1-u),e*o>=2&&(n++,o/=2),n+u>=c?(i=0,n=c):n+u>=1?(i=(e*o-1)*sc(2,t),n+=u):(i=e*sc(2,u-1)*sc(2,t),n=0));t>=8;)s[f++]=255&i,i/=256,t-=8;for(n=n<<t|i,a+=t;a>0;)s[f++]=255&n,n/=256,a-=8;return s[f-1]|=128*d,s},unpack:function(e,t){var r,n=e.length,i=8*n-t-1,o=(1<<i)-1,s=o>>1,a=i-7,c=n-1,u=e[c--],l=127&u;for(u>>=7;a>0;)l=256*l+e[c--],a-=8;for(r=l&(1<<-a)-1,l>>=-a,a+=t;a>0;)r=256*r+e[c--],a-=8;if(0===l)l=1-s;else{if(l===o)return r?NaN:u?-1/0:1/0;r+=sc(2,t),l-=s}return(u?-1:1)*r*sc(2,l-t)}},sh=e_,sp=re,sy=ro,sg=function(e){for(var t=sh(this),r=sy(t),n=arguments.length,i=sp(n>1?arguments[1]:void 0,r),o=n>2?arguments[2]:void 0,s=void 0===o?r:sp(o,r);s>i;)t[i++]=e;return t},sm=q([].slice),sb=e0,sv=e2,sw=ou,s_=function(e,t,r){var n,i;return sw&&sb(n=t.constructor)&&n!==r&&sv(i=n.prototype)&&i!==r.prototype&&sw(e,i),e},sE=ec,sS=q,sx=e9,sA=oG,sI=nR,sO=r9,sT=oZ,sP=oX,sM=B,sN=o1,sk=t6,sC=rn,sD=o8,sj=so,sR=sf,sL=iz,sB=ou,sU=sg,s$=sm,sK=s_,sF=im,sz=i1,sq=np,sV=sI.PROPER,sH=sI.CONFIGURABLE,sG="ArrayBuffer",sW="DataView",sJ="prototype",sZ="Wrong length",sY="Wrong index",sX=sq.getterFor(sG),sQ=sq.getterFor(sW),s0=sq.set,s1=sE[sG],s2=s1,s5=s2&&s2[sJ],s3=sE[sW],s8=s3&&s3[sJ],s6=Object.prototype,s4=sE.Array,s9=sE.RangeError,s7=sS(sU),ae=sS([].reverse),at=sR.pack,ar=sR.unpack,an=function(e){return[255&e]},ai=function(e){return[255&e,e>>8&255]},ao=function(e){return[255&e,e>>8&255,e>>16&255,e>>24&255]},as=function(e){return e[3]<<24|e[2]<<16|e[1]<<8|e[0]},aa=function(e){return at(sj(e),23,4)},ac=function(e){return at(e,52,8)},au=function(e,t,r){sT(e[sJ],t,{configurable:!0,get:function(){return r(this)[t]}})},al=function(e,t,r,n){var i=sQ(e),o=sD(r),s=!!n;if(o+t>i.byteLength)throw new s9(sY);var a=i.bytes,c=o+i.byteOffset,u=s$(a,c,c+t);return s?u:ae(u)},ad=function(e,t,r,n,i,o){var s=sQ(e),a=sD(r),c=n(+i),u=!!o;if(a+t>s.byteLength)throw new s9(sY);for(var l=s.bytes,d=a+s.byteOffset,f=0;f<t;f++)l[d+f]=c[u?f:t-f-1]};if(sA){var af=sV&&s1.name!==sG;!sM(function(){s1(1)})||!sM(function(){new s1(-1)})||sM(function(){return new s1,new s1(1.5),new s1(NaN),1!==s1.length||af&&!sH})?((s2=function(e){return sN(this,s5),sK(new s1(sD(e)),this,s2)})[sJ]=s5,s5.constructor=s2,sF(s2,s1)):af&&sH&&sO(s1,"name",sG),sB&&sL(s8)!==s6&&sB(s8,s6);var ah=new s3(new s2(2)),ap=sS(s8.setInt8);ah.setInt8(0,0x80000000),ah.setInt8(1,0x80000001),(ah.getInt8(0)||!ah.getInt8(1))&&sP(s8,{setInt8:function(e,t){ap(this,e,t<<24>>24)},setUint8:function(e,t){ap(this,e,t<<24>>24)}},{unsafe:!0})}else s5=(s2=function(e){sN(this,s5);var t=sD(e);s0(this,{type:sG,bytes:s7(s4(t),0),byteLength:t}),sx||(this.byteLength=t,this.detached=!1)})[sJ],s8=(s3=function(e,t,r){sN(this,s8),sN(e,s5);var n=sX(e),i=n.byteLength,o=sk(t);if(o<0||o>i)throw new s9("Wrong offset");if(r=void 0===r?i-o:sC(r),o+r>i)throw new s9(sZ);s0(this,{type:sW,buffer:e,byteLength:r,byteOffset:o,bytes:n.bytes}),sx||(this.buffer=e,this.byteLength=r,this.byteOffset=o)}
78)[sJ],sx&&(au(s2,"byteLength",sX),au(s3,"buffer",sQ),au(s3,"byteLength",sQ),au(s3,"byteOffset",sQ)),sP(s8,{getInt8:function(e){return al(this,1,e)[0]<<24>>24},getUint8:function(e){return al(this,1,e)[0]},getInt16:function(e){var t=al(this,2,e,arguments.length>1&&arguments[1]);return(t[1]<<8|t[0])<<16>>16},getUint16:function(e){var t=al(this,2,e,arguments.length>1&&arguments[1]);return t[1]<<8|t[0]},getInt32:function(e){return as(al(this,4,e,arguments.length>1&&arguments[1]))},getUint32:function(e){return as(al(this,4,e,arguments.length>1&&arguments[1]))>>>0},getFloat32:function(e){return ar(al(this,4,e,arguments.length>1&&arguments[1]),23)},getFloat64:function(e){return ar(al(this,8,e,arguments.length>1&&arguments[1]),52)},setInt8:function(e,t){ad(this,1,e,an,t)},setUint8:function(e,t){ad(this,1,e,an,t)},setInt16:function(e,t){ad(this,2,e,ai,t,arguments.length>2&&arguments[2])},setUint16:function(e,t){ad(this,2,e,ai,t,arguments.length>2&&arguments[2])},setInt32:function(e,t){ad(this,4,e,ao,t,arguments.length>2&&arguments[2])},setUint32:function(e,t){ad(this,4,e,ao,t,arguments.length>2&&arguments[2])},setFloat32:function(e,t){ad(this,4,e,aa,t,arguments.length>2&&arguments[2])},setFloat64:function(e,t){ad(this,8,e,ac,t,arguments.length>2&&arguments[2])}});sz(s2,sG),sz(s3,sW);var ay={ArrayBuffer:s2,DataView:s3},ag=ty,am=oZ,ab=e9,av=eX("species"),aw=function(e){var t=ag(e);ab&&t&&!t[av]&&am(t,av,{configurable:!0,get:function(){return this}})},a_=iD,aE=ec,aS=aw,ax="ArrayBuffer",aA=ay[ax];a_({global:!0,constructor:!0,forced:aE[ax]!==aA},{ArrayBuffer:aA}),aS(ax);var aI=W,aO=q,aT=function(e){if("Function"===aI(e))return aO(e)},aP=iD,aM=aT,aN=B,ak=ay,aC=e6,aD=re,aj=rn,aR=ak.ArrayBuffer,aL=ak.DataView,aB=aL.prototype,aU=aM(aR.prototype.slice),a$=aM(aB.getUint8),aK=aM(aB.setUint8);aP({target:"ArrayBuffer",proto:!0,unsafe:!0,forced:aN(function(){return!new aR(2).slice(1,void 0).byteLength})},{slice:function(e,t){if(aU&&void 0===t)return aU(aC(this),e);for(var r=aC(this).byteLength,n=aD(e,r),i=aD(void 0===t?r:t,r),o=new aR(aj(i-n)),s=new aL(this),a=new aL(o),c=0;n<i;)aK(a,c++,a$(s,n++));return o}});var aF=ec,az=eN,aq=W,aV=function(e){return az.slice(0,e.length)===e},aH=function(){return aV("Bun/")?"BUN":aV("Cloudflare-Workers")?"CLOUDFLARE":aV("Deno/")?"DENO":aV("Node.js/")?"NODE":aF.Bun&&"string"==typeof Bun.version?"BUN":aF.Deno&&"object"==typeof Deno.version?"DENO":"process"===aq(aF.process)?"NODE":aF.window&&aF.document?"BROWSER":"REST"}(),aG="NODE"===aH,aW=eX("toStringTag"),aJ={};aJ[aW]="z";var aZ="[object z]"===String(aJ),aY=e0,aX=W,aQ=eX("toStringTag"),a0=Object,a1="Arguments"===aX(function(){return arguments}()),a2=function(e,t){try{return e[t]}catch(e){}},a5=aZ?aX:function(e){var t,r,n;return void 0===e?"Undefined":null===e?"Null":"string"==typeof(r=a2(t=a0(e),aQ))?r:a1?aX(t):"Object"===(n=aX(t))&&aY(t.callee)?"Arguments":n},a3=q,a8=B,a6=e0,a4=a5,a9=nK,a7=function(){},ce=ty("Reflect","construct"),ct=/^\s*(?:class|function)\b/,cr=a3(ct.exec),cn=!ct.test(a7),ci=function(e){if(!a6(e))return!1;try{return ce(a7,[],e),!0}catch(e){return!1}},co=function(e){if(!a6(e))return!1;switch(a4(e)){case"AsyncFunction":case"GeneratorFunction":case"AsyncGeneratorFunction":return!1}try{return cn||!!cr(ct,a9(e))}catch(e){return!0}};co.sham=!0;var cs=!ce||a8(function(){var e;return ci(ci.call)||!ci(Object)||!ci(function(){e=!0})||e})?co:ci,ca=cs,cc=tS,cu=TypeError,cl=function(e){if(ca(e))return e;throw new cu(cc(e)+" is not a constructor")},cd=e6,cf=cl,ch=ee,cp=eX("species"),cy=function(e,t){var r,n=cd(e).constructor;return void 0===n||ch(r=cd(n)[cp])?t:cf(r)},cg=U,cm=Function.prototype,cb=cm.apply,cv=cm.call,cw="object"==typeof Reflect&&Reflect.apply||(cg?cv.bind(cb):function(){return cv.apply(cb,arguments)}),c_=aT,cE=tO,cS=U,cx=c_(c_.bind),cA=function(e,t){return cE(e),void 0===t?e:cS?cx(e,t):function(){return e.apply(t,arguments)}},cI=TypeError,cO=function(e,t){if(e<t)throw new cI("Not enough arguments");return e},cT=eN,cP=/(?:ipad|iphone|ipod).*applewebkit/i.test(cT),cM=ec,cN=cw,ck=cA,cC=e0,cD=ex,cj=B,cR=rT,cL=sm,cB=to,cU=cO,c$=cP,cK=aG,cF=cM.setImmediate,cz=cM.clearImmediate,cq=cM.process,cV=cM.Dispatch,cH=cM.Function,cG=cM.MessageChannel,cW=cM.String,cJ=0,cZ={},cY="onreadystatechange";cj(function(){f=cM.location});var cX=function(e){if(cD(cZ,e)){var t=cZ[e];delete cZ[e],t()}},cQ=function(e){return function(){cX(e)}},c0=function(e){cX(e.data)},c1=function(e){cM.postMessage(cW(e),f.protocol+"//"+f.host)};cF&&cz||(cF=function(e){cU(arguments.length,1);
vendor: 9,021 bytes, line 78
78var t=cC(e)?e:cH(e),r=cL(arguments,1);return cZ[++cJ]=function(){cN(t,void 0,r)},h(cJ),cJ},cz=function(e){delete cZ[e]},cK?h=function(e){cq.nextTick(cQ(e))}:cV&&cV.now?h=function(e){cV.now(cQ(e))}:cG&&!c$?(y=(p=new cG).port2,p.port1.onmessage=c0,h=ck(y.postMessage,y)):cM.addEventListener&&cC(cM.postMessage)&&!cM.importScripts&&f&&"file:"!==f.protocol&&!cj(c1)?(h=c1,cM.addEventListener("message",c0,!1)):h=cY in cB("script")?function(e){cR.appendChild(cB("script"))[cY]=function(){cR.removeChild(this),cX(e)}}:function(e){setTimeout(cQ(e),0)});var c2={set:cF},c5=ec,c3=e9,c8=Object.getOwnPropertyDescriptor,c6=function(e){if(!c3)return c5[e];var t=c8(c5,e);return t&&t.value},c4=function(){this.head=null,this.tail=null};c4.prototype={add:function(e){var t={item:e,next:null},r=this.tail;r?r.next=t:this.head=t,this.tail=t},get:function(){var e=this.head;if(e)return null===(this.head=e.next)&&(this.tail=null),e.item}};var c9=c4,c7=eN,ue=/ipad|iphone|ipod/i.test(c7)&&"undefined"!=typeof Pebble,ut=eN,ur=/web0s(?!.*chrome)/i.test(ut),un=ec,ui=c6,uo=cA,us=c2.set,ua=c9,uc=cP,uu=ue,ul=ur,ud=aG,uf=un.MutationObserver||un.WebKitMutationObserver,uh=un.document,up=un.process,uy=un.Promise,ug=ui("queueMicrotask");if(!ug){var um=new ua,ub=function(){var e,t;for(ud&&(e=up.domain)&&e.exit();t=um.get();)try{t()}catch(e){throw um.head&&g(),e}e&&e.enter()};uc||ud||ul||!uf||!uh?!uu&&uy&&uy.resolve?((v=uy.resolve(void 0)).constructor=uy,w=uo(v.then,v),g=function(){w(ub)}):ud?g=function(){up.nextTick(ub)}:(us=uo(us,un),g=function(){us(ub)}):(m=!0,b=uh.createTextNode(""),new uf(ub).observe(b,{characterData:!0}),g=function(){b.data=m=!m}),ug=function(e){um.head||g(),um.add(e)}}var uv=ug,uw=function(e,t){try{1==arguments.length?console.error(e):console.error(e,t)}catch(e){}},u_=function(e){try{return{error:!1,value:e()}}catch(e){return{error:!0,value:e}}},uE=ec.Promise,uS=ec,ux=uE,uA=e0,uI=iI,uO=nK,uT=eX,uP=aH,uM=eB;ux&&ux.prototype;var uN=uT("species"),uk=!1,uC=uA(uS.PromiseRejectionEvent),uD={CONSTRUCTOR:uI("Promise",function(){var e=uO(ux),t=e!==String(ux);if(!t&&66===uM)return!0;if(!uM||uM<51||!/native code/.test(e)){var r=new ux(function(e){e(1)}),n=function(e){e(function(){},function(){})};if((r.constructor={})[uN]=n,!(uk=r.then(function(){})instanceof n))return!0}return!t&&("BROWSER"===uP||"DENO"===uP)&&!uC}),REJECTION_EVENT:uC,SUBCLASSING:uk},uj={},uR=tO,uL=TypeError,uB=function(e){var t,r;this.promise=new e(function(e,n){if(void 0!==t||void 0!==r)throw new uL("Bad Promise constructor");t=e,r=n}),this.resolve=uR(t),this.reject=uR(r)};uj.f=function(e){return new uB(e)};var uU=iD,u$=aG,uK=ec,uF=td,uz=ie,uq=ou,uV=i1,uH=aw,uG=tO,uW=e0,uJ=e2,uZ=o1,uY=cy,uX=c2.set,uQ=uv,u0=uw,u1=u_,u2=c9,u5=np,u3=uE,u8=uD,u6=uj,u4="Promise",u9=u8.CONSTRUCTOR,u7=u8.REJECTION_EVENT,le=u8.SUBCLASSING,lt=u5.getterFor(u4),lr=u5.set,ln=u3&&u3.prototype,li=u3,lo=ln,ls=uK.TypeError,la=uK.document,lc=uK.process,lu=u6.f,ll=lu,ld=!!(la&&la.createEvent&&uK.dispatchEvent),lf="unhandledrejection",lh="rejectionhandled",lp=0,ly=1,lg=2,lm=1,lb=2,lv=function(e){var t;return!!(uJ(e)&&uW(t=e.then))&&t},lw=function(e,t){var r,n,i,o=t.value,s=t.state===ly,a=s?e.ok:e.fail,c=e.resolve,u=e.reject,l=e.domain;try{a?(s||(t.rejection===lb&&lA(t),t.rejection=lm),!0===a?r=o:(l&&l.enter(),r=a(o),l&&(l.exit(),i=!0)),r===e.promise?u(new ls("Promise-chain cycle")):(n=lv(r))?uF(n,r,c,u):c(r)):u(o)}catch(e){l&&!i&&l.exit(),u(e)}},l_=function(e,t){e.notified||(e.notified=!0,uQ(function(){for(var r,n=e.reactions;r=n.get();)lw(r,e);e.notified=!1,t&&!e.rejection&&lS(e)}))},lE=function(e,t,r){var n,i;ld?((n=la.createEvent("Event")).promise=t,n.reason=r,n.initEvent(e,!1,!0),uK.dispatchEvent(n)):n={promise:t,reason:r},!u7&&(i=uK["on"+e])?i(n):e===lf&&u0("Unhandled promise rejection",r)},lS=function(e){uF(uX,uK,function(){var t,r=e.facade,n=e.value;if(lx(e)&&(t=u1(function(){u$?lc.emit("unhandledRejection",n,r):lE(lf,r,n)}),e.rejection=u$||lx(e)?lb:lm,t.error))throw t.value})},lx=function(e){return e.rejection!==lm&&!e.parent},lA=function(e){uF(uX,uK,function(){var t=e.facade;u$?lc.emit("rejectionHandled",t):lE(lh,t,e.value)})},lI=function(e,t,r){return function(n){e(t,n,r)}},lO=function(e,t,r){e.done||(e.done=!0,r&&(e=r),e.value=t,e.state=lg,l_(e,!0))},lT=function(e,t,r){if(!e.done){e.done=!0,r&&(e=r);try{if(e.facade===t)throw new ls("Promise can't be resolved itself");var n=lv(t);n?uQ(function(){var r={done:!1};try{uF(n,t,lI(lT,r,e),lI(lO,r,e))}catch(t){lO(r,t,e)}}):(e.value=t,e.state=ly,l_(e,!1))}catch(t){lO({done:!1},t,e)}}};if(u9&&(lo=(li=function(e){uZ(this,lo),uG(e),uF(_,this);var t=lt(this);try{e(lI(lT,t),lI(lO,t))}catch(e){lO(t,e)}}).prototype,(_=function(e){lr(this,{type:u4,done:!1,notified:!1,parent:!1,reactions:new u2,rejection:!1,state:lp,value:null})}).prototype=uz(lo,"then",function(e,t){var r=lt(this),n=lu(uY(this,li));return r.parent=!0,n.ok=!uW(e)||e,n.fail=uW(t)&&t,n.domain=u$?lc.domain:void 0,r.state===lp?r.reactions.add(n):uQ(function(){lw(n,r)}),n.promise}),E=function(){var e=new _,t=lt(e);this.promise=e,this.resolve=lI(lT,t),this.reject=lI(lO,t)},u6.f=lu=function(e){return e===li||e===S?new E(e):ll(e)},uW(u3)&&ln!==Object.prototype)){x=ln.then,le||uz(ln,"then",function(e,t){var r=this;return new li(function(e,t){uF(x,r,e,t)}).then(e,t)},{unsafe:!0});try{delete ln.constructor}catch(e){}uq&&uq(ln,lo)}uU({global:!0,constructor:!0,wrap:!0,forced:u9},{Promise:li}),uV(li,u4,!1),uH(u4);var lP=r1,lM=eX("iterator"),lN=Array.prototype,lk=function(e){return void 0!==e&&(lP.Array===e||lN[lM]===e)},lC=a5,lD=tM,lj=ee,lR=r1,lL=eX("iterator"),lB=function(e){if(!lj(e))return lD(e,lL)||lD(e,"@@iterator")||lR[lC(e)]},lU=td,l$=tO,lK=e6,lF=tS,lz=lB,lq=TypeError,lV=function(e,t){var r=arguments.length<2?lz(e):t;if(l$(r))return lK(lU(r,e));throw new lq(lF(e)+" is not iterable")},lH=td,lG=e6,lW=tM,lJ=cA,lZ=td,lY=e6,lX=tS,lQ=lk,l0=ro,l1=tg,l2=lV,l5=lB,l3=function(e,t,r){var n,i;lG(e);try{if(!(n=lW(e,"return"))){if("throw"===t)throw r;return r}n=lH(n,e)}catch(e){i=!0,n=e}if("throw"===t)throw r;if(i)throw n;return lG(n),r},l8=TypeError,l6=function(e,t){this.stopped=e,this.result=t},l4=l6.prototype,l9=function(e,t,r){var n,i,o,s,a,c,u,l=r&&r.that,d=!!(r&&r.AS_ENTRIES),f=!!(r&&r.IS_RECORD),h=!!(r&&r.IS_ITERATOR),p=!!(r&&r.INTERRUPTED),y=lJ(t,l),g=function(e){return n&&l3(n,"normal",e),new l6(!0,e)},m=function(e){return d?(lY(e),p?y(e[0],e[1],g):y(e[0],e[1])):p?y(e,g):y(e)};if(f)n=e.iterator;else if(h)n=e;else{if(!(i=l5(e)))throw new l8(lX(e)+" is not iterable");if(lQ(i)){for(o=0,s=l0(e);s>o;o++)if((a=m(e[o]))&&l1(l4,a))return a;return new l6(!1)}n=l2(e,i)}for(c=f?e.next:n.next;!(u=lZ(c,n)).done;){try{a=m(u.value)}catch(e){l3(n,"throw",e)}if("object"==typeof a&&a&&l1(l4,a))return a}return new l6(!1)},l7=eX("iterator"),de=!1;try{var dt=0,dr={next:function(){return{done:!!dt++}},return:function(){de=!0}};dr[l7]=function(){return this},Array.from(dr,function(){throw 2})}catch(e){}var dn=function(e,t){try{if(!t&&!de)return!1}catch(e){return!1}var r=!1;try{var n={};n[l7]=function(){return{next:function(){return{done:r=!0}}}},e(n)}catch(e){}return r},di=uE,ds=dn,da=uD.CONSTRUCTOR||!ds(function(e){di.all(e).then(void 0,function(){})}),dc=td,du=tO,dl=uj,dd=u_,df=l9;iD({target:"Promise",stat:!0,forced:da},{all:function(e){var t=this,r=dl.f(t),n=r.resolve,i=r.reject,o=dd(function(){var r=du(t.resolve),o=[],s=0,a=1;df(e,function(e){var c=s++,u=!1;a++,dc(r,t,e).then(function(e){!u&&(u=!0,o[c]=e,--a||n(o))},i)}),--a||n(o)});return o.error&&i(o.value),r.promise}});var dh=iD,dp=uD.CONSTRUCTOR,dy=uE,dg=ty,dm=e0,db=ie,dv=dy&&dy.prototype;if(dh({target:"Promise",proto:!0,forced:dp,real:!0},{catch:function(e){return this.then(void 0,e)}}),dm(dy)){var dw=dg("Promise").prototype.catch;dv.catch!==dw&&db(dv,"catch",dw,{unsafe:!0})}var d_=td,dE=tO,dS=uj,dx=u_,dA=l9;iD({target:"Promise",stat:!0,forced:da},{race:function(e){var t=this,r=dS.f(t),n=r.reject,i=dx(function(){var i=dE(t.resolve);dA(e,function(e){d_(i,t,e).then(r.resolve,n)})});return i.error&&n(i.value),r.promise}});var dI=uj;iD({target:"Promise",stat:!0,forced:uD.CONSTRUCTOR},{reject:function(e){var t=dI.f(this);return(0,t.reject)(e),t.promise}});var dO=e6,dT=e2,dP=uj,dM=function(e,t){if(dO(e),dT(t)&&t.constructor===e)return t;var r=dP.f(e);return(0,r.resolve)(t),r.promise},dN=iD,dk=ty,dC=uD.CONSTRUCTOR,dD=dM;dk("Promise"),dN({target:"Promise",stat:!0,forced:dC},{resolve:function(e){return dD(this,e)}});var dj=a5,dR=String,dL=function(e){if("Symbol"===dj(e))throw TypeError("Cannot convert a Symbol value to a string");return dR(e)},dB=e6,dU=td,d$=ex,dK=tg,dF=function(){var e=dB(this),t="";return e.hasIndices&&(t+="d"),e.global&&(t+="g"),e.ignoreCase&&(t+="i"),e.multiline&&(t+="m"),e.dotAll&&(t+="s"),e.unicode&&(t+="u"),e.unicodeSets&&(t+="v"),e.sticky&&(t+="y"),t},dz=RegExp.prototype,dq=function(e){var t=e.flags;return!(void 0===t&&!("flags"in dz)&&!d$(e,"flags")&&dK(dz,e))?t:dU(dF,e)},dV=nR.PROPER,dH=ie,dG=e6,dW=dL,dJ=B,dZ=dq,dY="toString",dX=RegExp.prototype,dQ=dX[dY],d0=dJ(function(){return"/a/b"!==dQ.call({
78source:"a",flags:"b"})}),d1=dV&&dQ.name!==dY;(d0||d1)&&dH(dX,dY,function(){var e=dG(this);return"/"+dW(e.source)+"/"+dW(dZ(e))},{unsafe:!0});var d2={exports:{}},d5=oG,d3=e9,d8=ec,d6=e0,d4=e2,d9=ex,d7=a5,fe=tS,ft=r9,fr=ie,fn=oZ,fi=tg,fo=iz,fs=ou,fa=eX,fc=eT,fu=np,fl=fu.enforce,fd=fu.get,ff=d8.Int8Array,fh=ff&&ff.prototype,fp=d8.Uint8ClampedArray,fy=fp&&fp.prototype,fg=ff&&fo(ff),fm=fh&&fo(fh),fb=Object.prototype,fv=d8.TypeError,fw=fa("toStringTag"),f_=fc("TYPED_ARRAY_TAG"),fE="TypedArrayConstructor",fS=d5&&!!fs&&"Opera"!==d7(d8.opera),fx=!1,fA={Int8Array:1,Uint8Array:1,Uint8ClampedArray:1,Int16Array:2,Uint16Array:2,Int32Array:4,Uint32Array:4,Float32Array:4,Float64Array:8},fI={BigInt64Array:8,BigUint64Array:8},fO=function(e){if(!d4(e))return!1;var t=d7(e);return"DataView"===t||d9(fA,t)||d9(fI,t)},fT=function(e){var t=fo(e);if(d4(t)){var r=fd(t);return r&&d9(r,fE)?r[fE]:fT(t)}},fP=function(e){if(!d4(e))return!1;var t=d7(e);return d9(fA,t)||d9(fI,t)},fM=function(e){if(fP(e))return e;throw new fv("Target is not a typed array")},fN=function(e){if(d6(e)&&(!fs||fi(fg,e)))return e;throw new fv(fe(e)+" is not a typed array constructor")},fk=function(e,t,r,n){if(d3){if(r)for(var i in fA){var o=d8[i];if(o&&d9(o.prototype,e))try{delete o.prototype[e]}catch(r){try{o.prototype[e]=t}catch(e){}}}(!fm[e]||r)&&fr(fm,e,r?t:fS&&fh[e]||t,n)}},fC=function(e,t,r){var n,i;if(d3){if(fs){if(r){for(n in fA)if((i=d8[n])&&d9(i,e))try{delete i[e]}catch(e){}}if(fg[e]&&!r)return;try{return fr(fg,e,r?t:fS&&fg[e]||t)}catch(e){}}for(n in fA)(i=d8[n])&&(!i[e]||r)&&fr(i,e,t)}};for(A in fA)(O=(I=d8[A])&&I.prototype)?fl(O)[fE]=I:fS=!1;for(A in fI)(O=(I=d8[A])&&I.prototype)&&(fl(O)[fE]=I);if((!fS||!d6(fg)||fg===Function.prototype)&&(fg=function(){throw new fv("Incorrect invocation")},fS))for(A in fA)d8[A]&&fs(d8[A],fg);if((!fS||!fm||fm===fb)&&(fm=fg.prototype,fS))for(A in fA)d8[A]&&fs(d8[A].prototype,fm);if(fS&&fo(fy)!==fm&&fs(fy,fm),d3&&!d9(fm,fw))for(A in fx=!0,fn(fm,fw,{configurable:!0,get:function(){return d4(this)?this[f_]:void 0}}),fA)d8[A]&&ft(d8[A],f_,A);var fD={NATIVE_ARRAY_BUFFER_VIEWS:fS,TYPED_ARRAY_TAG:fx&&f_,aTypedArray:fM,aTypedArrayConstructor:fN,exportTypedArrayMethod:fk,exportTypedArrayStaticMethod:fC,getTypedArrayConstructor:fT,isView:fO,isTypedArray:fP,TypedArray:fg,TypedArrayPrototype:fm},fj=ec,fR=B,fL=dn,fB=fD.NATIVE_ARRAY_BUFFER_VIEWS,fU=fj.ArrayBuffer,f$=fj.Int8Array,fK=!fB||!fR(function(){f$(1)})||!fR(function(){new f$(-1)})||!fL(function(e){new f$,new f$(null),new f$(1.5),new f$(e)},!0)||fR(function(){return 1!==new f$(new fU(2),1,void 0).length}),fF=e2,fz=Math.floor,fq=Number.isInteger||function(e){return!fF(e)&&isFinite(e)&&fz(e)===e},fV=t6,fH=RangeError,fG=function(e){var t=fV(e);if(t<0)throw new fH("The argument can't be less than 0");return t},fW=RangeError,fJ=function(e,t){var r=fG(e);if(r%t)throw new fW("Wrong offset");return r},fZ=Math.round,fY=function(e){var t=fZ(e);return t<0?0:t>255?255:255&t},fX=a5,fQ=tF,f0=TypeError,f1=function(e){var t=fQ(e,"number");if("number"==typeof t)throw new f0("Can't convert number to bigint");return BigInt(t)},f2=cA,f5=td,f3=cl,f8=e_,f6=ro,f4=lV,f9=lB,f7=lk,he=function(e){var t=fX(e);return"BigInt64Array"===t||"BigUint64Array"===t},ht=fD.aTypedArrayConstructor,hr=f1,hn=function(e){var t,r,n,i,o,s,a,c,u=f3(this),l=f8(e),d=arguments.length,f=d>1?arguments[1]:void 0,h=void 0!==f,p=f9(l);if(p&&!f7(p))for(c=(a=f4(l,p)).next,l=[];!(s=f5(c,a)).done;)l.push(s.value);for(h&&d>2&&(f=f2(f,arguments[2])),r=f6(l),i=he(n=new(ht(u))(r)),t=0;r>t;t++)o=h?f(l[t],t):l[t],n[t]=i?hr(o):+o;return n},hi=W,ho=Array.isArray||function(e){return"Array"===hi(e)},hs=cs,ha=e2,hc=eX("species"),hu=Array,hl=function(e){var t;return ho(e)&&(hs(t=e.constructor)&&(t===hu||ho(t.prototype))?t=void 0:ha(t)&&null===(t=t[hc])&&(t=void 0)),void 0===t?hu:t},hd=cA,hf=Q,hh=e_,hp=ro,hy=function(e,t){return new(hl(e))(0===t?0:t)},hg=q([].push),hm=function(e){var t=1===e,r=2===e,n=3===e,i=4===e,o=6===e,s=7===e,a=5===e||o;return function(c,u,l,d){for(var f,h,p=hh(c),y=hf(p),g=hp(y),m=hd(u,l),b=0,v=d||hy,w=t?v(c,g):r||s?v(c,0):void 0;g>b;b++)if((a||b in y)&&(h=m(f=y[b],b,p),e)){if(t)w[b]=h;else if(h)switch(e){case 3:return!0;case 5:return f;case 6:return b;case 2:hg(w,f)}else switch(e){case 4:return!1;case 7:hg(w,f)}}return o?-1:n||i?i:w}},hb={forEach:hm(0),map:hm(1),filter:hm(2),some:hm(3),every:hm(4),find:hm(5),findIndex:hm(6),filterReject:hm(7)},hv=ro,hw=function(e,t,r){for(var n=0,i=arguments.length>2?r:hv(t),o=new e(i);i>n;)o[n]=t[n++];return o},h_=iD,hE=ec,hS=td,hx=e9,hA=fK,hI=fD,hO=ay,hT=o1,hP=r8,hM=r9,hN=fq,hk=rn,hC=o8,hD=fJ,hj=fY,hR=tV,hL=ex,hB=a5,hU=e2,h$=t_,hK=rW,hF=tg,hz=ou,hq=it.f,hV=hn,hH=hb.forEach,hG=aw,hW=oZ,hJ=tt,hZ=ny,hY=hw,hX=np,hQ=s_,h0=hX.get,h1=hX.set,h2=hX.enforce,h5=hJ.f,h3=hZ.f,h8=hE.RangeError,h6=hO.ArrayBuffer,h4=h6.prototype,h9=hO.DataView,h7=hI.NATIVE_ARRAY_BUFFER_VIEWS,pe=hI.TYPED_ARRAY_TAG,pt=hI.TypedArray,pr=hI.TypedArrayPrototype,pn=hI.isTypedArray,pi="BYTES_PER_ELEMENT",po="Wrong length",ps=function(e,t){hW(e,t,{c
vendor: 4,238 bytes, line 78
78onfigurable:!0,get:function(){return h0(this)[t]}})},pa=function(e){var t;return hF(h4,e)||"ArrayBuffer"===(t=hB(e))||"SharedArrayBuffer"===t},pc=function(e,t){return pn(e)&&!h$(t)&&t in e&&hN(+t)&&t>=0},pu=function(e,t){return pc(e,t=hR(t))?hP(2,e[t]):h3(e,t)},pl=function(e,t,r){return pc(e,t=hR(t))&&hU(r)&&hL(r,"value")&&!hL(r,"get")&&!hL(r,"set")&&!r.configurable&&(!hL(r,"writable")||r.writable)&&(!hL(r,"enumerable")||r.enumerable)?(e[t]=r.value,e):h5(e,t,r)};hx?(h7||(hZ.f=pu,hJ.f=pl,ps(pr,"buffer"),ps(pr,"byteOffset"),ps(pr,"byteLength"),ps(pr,"length")),h_({target:"Object",stat:!0,forced:!h7},{getOwnPropertyDescriptor:pu,defineProperty:pl}),d2.exports=function(e,t,r){var n=e.match(/\d+/)[0]/8,i=e+(r?"Clamped":"")+"Array",o="get"+e,s="set"+e,a=hE[i],c=a,u=c&&c.prototype,l={},d=function(e,t){var r=h0(e);return r.view[o](t*n+r.byteOffset,!0)},f=function(e,t,i){var o=h0(e);o.view[s](t*n+o.byteOffset,r?hj(i):i,!0)},h=function(e,t){h5(e,t,{get:function(){return d(this,t)},set:function(e){return f(this,t,e)},enumerable:!0})};h7?hA&&(c=t(function(e,t,r,i){return hT(e,u),hQ(function(){return hU(t)?pa(t)?void 0!==i?new a(t,hD(r,n),i):void 0!==r?new a(t,hD(r,n)):new a(t):pn(t)?hY(c,t):hS(hV,c,t):new a(hC(t))}(),e,c)}),hz&&hz(c,pt),hH(hq(a),function(e){e in c||hM(c,e,a[e])}),c.prototype=u):(c=t(function(e,t,r,i){hT(e,u);var o,s,a,l=0,d=0;if(hU(t)){if(pa(t)){o=t,d=hD(r,n);var f=t.byteLength;if(void 0===i){if(f%n||(s=f-d)<0)throw new h8(po)}else if((s=hk(i)*n)+d>f)throw new h8(po);a=s/n}else if(pn(t))return hY(c,t);else return hS(hV,c,t)}else o=new h6(s=(a=hC(t))*n);for(h1(e,{buffer:o,byteOffset:d,byteLength:s,length:a,view:new h9(o)});l<a;)h(e,l++)}),hz&&hz(c,pt),u=c.prototype=hK(pr)),u.constructor!==c&&hM(u,"constructor",c),h2(u).TypedArrayConstructor=c,pe&&hM(u,pe,i);var p=c!==a;l[i]=c,h_({global:!0,constructor:!0,forced:p,sham:!h7},l),pi in c||hM(c,pi,n),pi in u||hM(u,pi,n),hG(i)}):d2.exports=function(){},(0,d2.exports)("Uint8",function(e){return function(t,r,n){return e(this,t,r,n)}});var pd=fD,pf=sg,ph=f1,pp=a5,py=td,pg=q,pm=B,pb=pd.aTypedArray,pv=pd.exportTypedArrayMethod,pw=pg("".slice);pv("fill",function(e){var t=arguments.length;return pb(this),py(pf,this,"Big"===pw(pp(this),0,3)?ph(e):+e,t>1?arguments[1]:void 0,t>2?arguments[2]:void 0)},pm(function(){var e=0;return new Int8Array(2).fill({valueOf:function(){return e++}}),1!==e}));var p_=ec,pE=td,pS=fD,px=ro,pA=fJ,pI=e_,pO=B,pT=p_.RangeError,pP=p_.Int8Array,pM=pP&&pP.prototype,pN=pM&&pM.set,pk=pS.aTypedArray,pC=pS.exportTypedArrayMethod,pD=!pO(function(){var e=new Uint8ClampedArray(2);return pE(pN,e,{length:1,0:3},1),3!==e[1]}),pj=pD&&pS.NATIVE_ARRAY_BUFFER_VIEWS&&pO(function(){var e=new pP(2);return e.set(1),e.set("2",1),0!==e[0]||2!==e[1]});pC("set",function(e){pk(this);var t=pA(arguments.length>1?arguments[1]:void 0,1),r=pI(e);if(pD)return pE(pN,this,r,t);var n=this.length,i=px(r),o=0;if(i+t>n)throw new pT("Wrong length");for(;o<i;)this[t+o]=r[o++]},!pD||pj);var pR=sm,pL=Math.floor,pB=function(e,t){var r=e.length;if(r<8)for(var n,i,o=1;o<r;){for(i=o,n=e[o];i&&t(e[i-1],n)>0;)e[i]=e[--i];i!==o++&&(e[i]=n)}else for(var s=pL(r/2),a=pB(pR(e,0,s),t),c=pB(pR(e,s),t),u=a.length,l=c.length,d=0,f=0;d<u||f<l;)e[d+f]=d<u&&f<l?0>=t(a[d],c[f])?a[d++]:c[f++]:d<u?a[d++]:c[f++];return e},pU=pB,p$=eN.match(/firefox\/(\d+)/i),pK=!!p$&&+p$[1],pF=eN,pz=/MSIE|Trident/.test(pF),pq=eN.match(/AppleWebKit\/(\d+)\./),pV=!!pq&&+pq[1],pH=ec,pG=aT,pW=B,pJ=tO,pZ=pU,pY=fD,pX=pK,pQ=pz,p0=eB,p1=pV,p2=pY.aTypedArray,p5=pY.exportTypedArrayMethod,p3=pH.Uint16Array,p8=p3&&pG(p3.prototype.sort),p6=!!p8&&!(pW(function(){p8(new p3(2),null)})&&pW(function(){p8(new p3(2),{})})),p4=!!p8&&!pW(function(){if(p0)return p0<74;if(pX)return pX<67;if(pQ)return!0;if(p1)return p1<602;var e,t,r=new p3(516),n=Array(516);for(e=0;e<516;e++)t=e%4,r[e]=515-e,n[e]=e-2*t+3;for(p8(r,function(e,t){return(e/4|0)-(t/4|0)}),e=0;e<516;e++)if(r[e]!==n[e])return!0}),p9=function(e){return function(t,r){return void 0!==e?+e(t,r)||0:r!=r?-1:t!=t?1:0===t&&0===r?1/t>0&&1/r<0?1:-1:t>r}};p5("sort",function(e){return(void 0!==e&&pJ(e),p4)?p8(this,e):pZ(p2(this),p9(e))},!p4||p6);var p7=cw,ye=fD,yt=B,yr=sm,yn=ec.Int8Array,yi=ye.aTypedArray,yo=ye.exportTypedArrayMethod,ys=[].toLocaleStr
78ing,ya=!!yn&&yt(function(){ys.call(new yn(1))});yo("toLocaleString",function(){return p7(ys,ya?yr(yi(this)):yi(this),yr(arguments))},yt(function(){return[1,2].toLocaleString()!==new yn([1,2]).toLocaleString()})||!yt(function(){yn.prototype.toLocaleString.call([1,2])}));var yc={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},yu=to("span").classList,yl=yu&&yu.constructor&&yu.constructor.prototype,yd=ec,yf=yc,yh=yl===Object.prototype?void 0:yl,yp=oV,yy=r9,yg=i1,ym=eX("iterator"),yb=yp.values,yv=function(e,t){if(e){if(e[ym]!==yb)try{yy(e,ym,yb)}catch(t){e[ym]=yb}if(yg(e,t,!0),yf[t]){for(var r in yp)if(e[r]!==yp[r])try{yy(e,r,yp[r])}catch(t){e[r]=yp[r]}}}};for(var yw in yf)yv(yd[yw]&&yd[yw].prototype,yw);function y_(e,t,r,n){function i(e){return e instanceof r?e:new r(function(t){t(e)})}return new(r||(r=Promise))(function(r,o){function s(e){try{c(n.next(e))}catch(e){o(e)}}function a(e){try{c(n.throw(e))}catch(e){o(e)}}function c(e){e.done?r(e.value):i(e.value).then(s,a)}c((n=n.apply(e,t||[])).next())})}function yE(e,t,r,n){return y_(this,void 0,void 0,function*(){let i=(0,N.T9)(e),o=new Uint8Array(D.sha256.array(i)),s=yield t.signMessage(i,r,n),a=e.publicKey.ed25519Key?P._.ED25519:P._.SECP256K1;return[o,new N.Zj({transaction:e,signature:new k.t({keyType:a,data:s.signature.data})})]})}yv(yh,"DOMTokenList"),"function"==typeof SuppressedError&&SuppressedError;let yS=(e,t,r)=>y_(void 0,void 0,void 0,function*(){let n=new T.F({url:r.nodeUrl}),i=[];for(let o=0;o<e.length;o++){let s=yield t.getPublicKey(e[o].signerId,r.networkId),[a,c]=yield Promise.all([n.block({finality:"final"}),n.query({request_type:"view_access_key",finality:"final",account_id:e[o].signerId,public_key:s.toString()})]),u=(0,C.z)(e[o].signerId,M.J.from(s.toString()),e[o].receiverId,c.nonce+o+1,e[o].actions,(0,j.KN)(a.header.hash)),[,l]="signTransaction"in t&&t.signTransaction?yield t.signTransaction(u):yield yE(u,t,e[o].signerId,r.networkId),d=new N.Zj({signature:new k.t({data:R.from(l.signature.data),keyType:s.keyType===P._.SECP256K1?P._.SECP256K1:P._.ED25519}),transaction:u});i.push(d)}return i})},17078:(e,t,r)=>{"use strict";function n(e){return e instanceof Uint8Array||ArrayBuffer.isView(e)&&"Uint8Array"===e.constructor.name}function i(e,...t){if(!n(e))throw Error("Uint8Array expected");if(t.length>0&&!t.includes(e.length))throw Error("Uint8Array expected of length "+t+", got length="+e.length)}function o(e,t=!0){if(e.destroyed)throw Error("Hash instance has been destroyed");if(t&&e.finished)throw Error("Hash#digest() has already been called")}function s(e,t){i(e);let r=t.outputLen;if(e.length<r)throw Error("digestInto() expects output buffer of length at least "+r)}r.d(t,{ev:()=>eJ});let a="object"==typeof globalThis&&"crypto"in globalThis?globalThis.crypto:void 0;function c(e){return new DataView(e.buffer,e.byteOffset,e.byteLength)}function u(e){if("string"!=typeof e)throw Error("utf8ToBytes expected string, got "+typeof e);return new Uint8Array(new TextEncoder().encode(e))}function l(e){return"string"==typeof e&&(e=u(e)),i(e),e}class d{clone(){return this._cloneInto()}}function f(e){let t=t=>e().update(l(t)).digest(),r=e();return t.outputLen=r.outputLen,t.blockLen=r.blockLen,t.create=()=>e(),t}function h(e=32){if(a&&"function"==typeof a.getRandomValues)return a.getRandomValues(new Uint8Array(e));if(a&&"function"==typeof a.randomBytes)return a.randomBytes(e);throw Error("crypto.getRandomValues must be defined")}function p(e,t,r,n){if("function"==typeof e.setBigUint64)return e.setBigUint64(t,r,n);let i=BigInt(32),o=BigInt(0xffffffff),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)}class y extends d{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=c(this.buffer)}update(e){o(this);let{view:t,buffer:r,blockLen:n}=this,i=(e=l(e)).length;for(let o=0;o<i;){let s=Math.min(n-this.pos,i-o);if(s===n){let t=c(e);for(;n<=i-o;o+=n)this.process(t,o);continue}r.set(e.subarray(o,o+s),this.pos),this.pos+=s,o+=s,this.pos===n&&(this.process(t,0),this.pos=0)}return this.length+=e.length,this.roundClean(),this}digestInto(e){o(this),s(e,this),this.finished=!0;let{buffer:t,view:r,blockLen:n,isLE:i}=this,{pos:a}=this;t[a++]=128,this.buffer.subarray(a).fill(0),this.padOffset>n-a&&(this.process(r,0),a=0);for(let e=a;
78e<n;e++)t[e]=0;p(r,n-8,BigInt(8*this.length),i),this.process(r,0);let u=c(e),l=this.outputLen;if(l%4)throw Error("_sha2: outputLen should be aligned to 32bit");let d=l/4,f=this.get();if(d>f.length)throw Error("_sha2: outputLen bigger than state");for(let e=0;e<d;e++)u.setUint32(4*e,f[e],i)}digest(){let{buffer:e,outputLen:t}=this;this.digestInto(e);let r=e.slice(0,t);return this.destroy(),r}_cloneInto(e){e||(e=new this.constructor),e.set(...this.get());let{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}}let g=BigInt(0x100000000-1),m=BigInt(32);function b(e,t=!1){return t?{h:Number(e&g),l:Number(e>>m&g)}:{h:0|Number(e>>m&g),l:0|Number(e&g)}}let v={split:function(e,t=!1){let r=new Uint32Array(e.length),n=new Uint32Array(e.length);for(let i=0;i<e.length;i++){let{h:o,l:s}=b(e[i],t);[r[i],n[i]]=[o,s]}return[r,n]},shrSH:(e,t,r)=>e>>>r,shrSL:(e,t,r)=>e<<32-r|t>>>r,rotrSH:(e,t,r)=>e>>>r|t<<32-r,rotrSL:(e,t,r)=>e<<32-r|t>>>r,rotrBH:(e,t,r)=>e<<64-r|t>>>r-32,rotrBL:(e,t,r)=>e>>>r-32|t<<64-r,add:function(e,t,r,n){let i=(t>>>0)+(n>>>0);return{h:e+r+(i/0x100000000|0)|0,l:0|i}},add3L:(e,t,r)=>(e>>>0)+(t>>>0)+(r>>>0),add3H:(e,t,r,n)=>t+r+n+(e/0x100000000|0)|0,add4L:(e,t,r,n)=>(e>>>0)+(t>>>0)+(r>>>0)+(n>>>0),add4H:(e,t,r,n,i)=>t+r+n+i+(e/0x100000000|0)|0,add5H:(e,t,r,n,i,o)=>t+r+n+i+o+(e/0x100000000|0)|0,add5L:(e,t,r,n,i)=>(e>>>0)+(t>>>0)+(r>>>0)+(n>>>0)+(i>>>0)},[w,_]=v.split(["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","0xf40e3585
785771202a","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))),E=new Uint32Array(80),S=new Uint32Array(80);class x extends y{constructor(){super(128,64,16,!1),this.Ah=0x6a09e667,this.Al=-0xc4336f8,this.Bh=-0x4498517b,this.Bl=-0x7b3558c5,this.Ch=0x3c6ef372,this.Cl=-0x16b07d5,this.Dh=-0x5ab00ac6,this.Dl=0x5f1d36f1,this.Eh=0x510e527f,this.El=-0x52197d2f,this.Fh=-0x64fa9774,this.Fl=0x2b3e6c1f,this.Gh=0x1f83d9ab,this.Gl=-0x4be4295,this.Hh=0x5be0cd19,this.Hl=0x137e2179}get(){let{Ah:e,Al:t,Bh:r,Bl:n,Ch:i,Cl:o,Dh:s,Dl:a,Eh:c,El:u,Fh:l,Fl:d,Gh:f,Gl:h,Hh:p,Hl:y}=this;return[e,t,r,n,i,o,s,a,c,u,l,d,f,h,p,y]}set(e,t,r,n,i,o,s,a,c,u,l,d,f,h,p,y){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|d,this.Gh=0|f,this.Gl=0|h,this.Hh=0|p,this.Hl=0|y}process(e,t){for(let r=0;r<16;r++,t+=4)E[r]=e.getUint32(t),S[r]=e.getUint32(t+=4);for(let e=16;e<80;e++){let t=0|E[e-15],r=0|S[e-15],n=v.rotrSH(t,r,1)^v.rotrSH(t,r,8)^v.shrSH(t,r,7),i=v.rotrSL(t,r,1)^v.rotrSL(t,r,8)^v.shrSL(t,r,7),o=0|E[e-2],s=0|S[e-2],a=v.rotrSH(o,s,19)^v.rotrBH(o,s,61)^v.shrSH(o,s,6),c=v.rotrSL(o,s,19)^v.rotrBL(o,s,61)^v.shrSL(o,s,6),u=v.add4L(i,c,S[e-7],S[e-16]),l=v.add4H(u,n,a,E[e-7],E[e-16]);E[e]=0|l,S[e]=0|u}let{Ah:r,Al:n,Bh:i,Bl:o,Ch:s,Cl:a,Dh:c,Dl:u,Eh:l,El:d,Fh:f,Fl:h,Gh:p,Gl:y,Hh:g,Hl:m}=this;for(let e=0;e<80;e++){let t=v.rotrSH(l,d,14)^v.rotrSH(l,d,18)^v.rotrBH(l,d,41),b=v.rotrSL(l,d,14)^v.rotrSL(l,d,18)^v.rotrBL(l,d,41),x=l&f^~l&p,A=d&h^~d&y,I=v.add5L(m,b,A,_[e],S[e]),O=v.add5H(I,g,t,x,w[e],E[e]),T=0|I,P=v.rotrSH(r,n,28)^v.rotrBH(r,n,34)^v.rotrBH(r,n,39),M=v.rotrSL(r,n,28)^v.rotrBL(r,n,34)^v.rotrBL(r,n,39),N=r&i^r&s^i&s,k=n&o^n&a^o&a;g=0|p,m=0|y,p=0|f,y=0|h,f=0|l,h=0|d,({h:l,l:d}=v.add(0|c,0|u,0|O,0|T)),c=0|s,u=0|a,s=0|i,a=0|o,i=0|r,o=0|n;let C=v.add3L(T,M,k);r=v.add3H(C,O,P,N),n=0|C}({h:r,l:n}=v.add(0|this.Ah,0|this.Al,0|r,0|n)),({h:i,l:o}=v.add(0|this.Bh,0|this.Bl,0|i,0|o)),({h:s,l:a}=v.add(0|this.Ch,0|this.Cl,0|s,0|a)),({h:c,l:u}=v.add(0|this.Dh,0|this.Dl,0|c,0|u)),({h:l,l:d}=v.add(0|this.Eh,0|this.El,0|l,0|d)),({h:f,l:h}=v.add(0|this.Fh,0|this.Fl,0|f,0|h)),({h:p,l:y}=v.add(0|this.Gh,0|this.Gl,0|p,0|y)),({h:g,l:m}=v.add(0|this.Hh,0|this.Hl,0|g,0|m)),this.set(r,n,i,o,s,a,c,u,l,d,f,h,p,y,g,m)}roundClean(){E.fill(0),S.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)}}let A=f(()=>new x),I=BigInt(0),O=BigInt(1),T=BigInt(2);function P(e){return e instanceof Uint8Array||ArrayBuffer.isView(e)&&"Uint8Array"===e.constructor.name}function M(e){if(!P(e))throw Error("Uint8Array expected")}function N(e,t){if("boolean"!=typeof t)throw Error(e+" boolean expected, got "+t)}let k=Array.from({length:256},(e,t)=>t.toString(16).padStart(2,"0"));function C(e){M(e);let t="";for(let r=0;r<e.length;r++)t+=k[e[r]];return t}function D(e){if("string"!=typeof e)throw Error("hex string expected, got "+typeof e);return""===e?I:BigInt("0x"+e)}let j={_0:48,_9:57,A:65,F:70,a:97,f:102};function R(e){return e>=j._0&&e<=j._9?e-j._0:e>=j.A&&e<=j.F?e-(j.A-10):e>=j.a&&e<=j.f?e-(j.a-10):void 0}function L(e){if("string"!=typeof e)throw Error("hex string expected, got "+typeof e);let t=e.length,r=t/2;if(t%2)throw Error("hex string expected, got unpadded hex of length "+t);let n=new Uint8Array(r);for(let t=0,i=0;t<r;t++,i+=2){let r=R(e.charCodeAt(i)),o=R(e.charCodeAt(i+1));if(void 0===r||void 0===o)throw Error('hex string expected, got non-hex character "'+(e[i]+e[i+1])+'" at index '+i);n[t]=16*r+o}return n}function B(e){return D(C(e))}function U(e){return M(e),D(C(Uint8Array.from(e).reverse()))}function $(e,t){return L(e.toString(16).padStart(2*t,"0"))}function K(e,t){return $(e,t).reverse()}function F(e,t,r){let n;if("string"==typeof t)try{n=L(t)}catch(t){throw Error(e+" must be hex string or Uint8Array, cause: "+t)}else if(P(t))n=Uint8Array.from(t);else throw Error(e+" must be hex string or Uint8Array");let i=n.length;if("number"==typeof r&&i!==r)throw Error(e+" of length "+r+" expected, got "+i);return n}function z(...e){let t=0;for(let r=0;r<e.length;r++){let n=e[r];M(n),t+=n.length}let r=new Uint8Array(t);for(let t=0,n=0;t<e.length;t++){let i=e[t];r.set(i,n),n+=i.length}return r}let q=e=>"bigint"==typeof e&&I<=e;function V(e,t,r){return q(e)&&q(t)&&q(r)&&t<=e&&e<r}function H(e,t,r,n){if(!V(t,r,n))throw Error("expected valid "+e+": "+r+" <= n < "+n+", got "+t)}function G(e){let t;for(t=0;e>I;e>>=O,t+=1);return t}let W=e=>(T<<BigInt(e-1))-O,J={bigint:e=>"bigint"==typeof e,function:e=>"function"==typeof e,boolean:e=>"boolean"==typeof e,string:e=>"string"==typeof e,stringOrUint8Array:e=>"string"==typeof e||P(e),isSafeInteger:e=>Number.isSafeInteger(e),array:e=>Array.isArray(e),field:(e,t)=>t.Fp.isValid(e),hash:e=>"function"==typeof e&&Number.isSafeInteger(e.outputLen)};function Z(e,t,r={}){let n=(t,r,n)=>{let i=J[r];if("function"!=typeof i)throw Error("invalid validator function");let o=e[t];if((!n||void 0!==o)&&!i(o,e))throw Error("param "+String(t)+" is invali
78d. Expected "+r+", got "+o)};for(let[e,r]of Object.entries(t))n(e,r,!1);for(let[e,t]of Object.entries(r))n(e,t,!0);return e}function Y(e){let t=new WeakMap;return(r,...n)=>{let i=t.get(r);if(void 0!==i)return i;let o=e(r,...n);return t.set(r,o),o}}let X=BigInt(0),Q=BigInt(1),ee=BigInt(2),et=BigInt(3),er=BigInt(4),en=BigInt(5),ei=BigInt(8);function eo(e,t){let r=e%t;return r>=X?r:t+r}function es(e,t,r){if(t<X)throw Error("invalid exponent, negatives unsupported");if(r<=X)throw Error("invalid modulus");if(r===Q)return X;let n=Q;for(;t>X;)t&Q&&(n=n*e%r),e=e*e%r,t>>=Q;return n}function ea(e,t,r){let n=e;for(;t-- >X;)n*=n,n%=r;return n}function ec(e,t){if(e===X)throw Error("invert: expected non-zero number");if(t<=X)throw Error("invert: expected positive modulus, got "+t);let r=eo(e,t),n=t,i=X,o=Q,s=Q,a=X;for(;r!==X;){let 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!==Q)throw Error("invert: does not exist");return eo(i,t)}function eu(e){let t,r,n;let i=(e-Q)/ee;for(t=e-Q,r=0;t%ee===X;t/=ee,r++);for(n=ee;n<e&&es(n,i,e)!==e-Q;n++)if(n>1e3)throw Error("Cannot find square root: likely non-prime P");if(1===r){let t=(e+Q)/er;return function(e,r){let n=e.pow(r,t);if(!e.eql(e.sqr(n),r))throw Error("Cannot find square root");return n}}let o=(t+Q)/ee;return function(e,s){if(e.pow(s,i)===e.neg(e.ONE))throw Error("Cannot find square root");let a=r,c=e.pow(e.mul(e.ONE,n),t),u=e.pow(s,o),l=e.pow(s,t);for(;!e.eql(l,e.ONE);){if(e.eql(l,e.ZERO))return e.ZERO;let t=1;for(let r=e.sqr(l);t<a&&!e.eql(r,e.ONE);t++)r=e.sqr(r);let r=e.pow(c,Q<<BigInt(a-t-1));c=e.sqr(r),u=e.mul(u,r),l=e.mul(l,c),a=t}return u}}function el(e){if(e%er===et){let t=(e+Q)/er;return function(e,r){let n=e.pow(r,t);if(!e.eql(e.sqr(n),r))throw Error("Cannot find square root");return n}}if(e%ei===en){let t=(e-en)/ei;return function(e,r){let n=e.mul(r,ee),i=e.pow(n,t),o=e.mul(r,i),s=e.mul(e.mul(o,ee),i),a=e.mul(o,e.sub(s,e.ONE));if(!e.eql(e.sqr(a),r))throw Error("Cannot find square root");return a}}return eu(e)}let ed=(e,t)=>(eo(e,t)&Q)===Q,ef=["create","isValid","is0","neg","inv","sqrt","sqr","eql","add","sub","mul","pow","div","addN","subN","mulN","sqrN"];function eh(e){let t={ORDER:"bigint",MASK:"bigint",BYTES:"isSafeInteger",BITS:"isSafeInteger"};return Z(e,ef.reduce((e,t)=>(e[t]="function",e),t))}function ep(e,t,r){if(r<X)throw Error("invalid exponent, negatives unsupported");if(r===X)return e.ONE;if(r===Q)return t;let n=e.ONE,i=t;for(;r>X;)r&Q&&(n=e.mul(n,i)),i=e.sqr(i),r>>=Q;return n}function ey(e,t){let r=Array(t.length),n=t.reduce((t,n,i)=>e.is0(n)?t:(r[i]=t,e.mul(t,n)),e.ONE),i=e.inv(n);return t.reduceRight((t,n,i)=>e.is0(n)?t:(r[i]=e.mul(t,r[i]),e.mul(t,n)),i),r}function eg(e,t){let r=void 0!==t?t:e.toString(2).length,n=Math.ceil(r/8);return{nBitLength:r,nByteLength:n}}function em(e,t,r=!1,n={}){let i;if(e<=X)throw Error("invalid field: expected ORDER > 0, got "+e);let{nBitLength:o,nByteLength:s}=eg(e,t);if(s>2048)throw Error("invalid field: expected ORDER of <= 2048 bytes");let a=Object.freeze({ORDER:e,isLE:r,BITS:o,BYTES:s,MASK:W(o),ZERO:X,ONE:Q,create:t=>eo(t,e),isValid:t=>{if("bigint"!=typeof t)throw Error("invalid field element: expected bigint, got "+typeof t);return X<=t&&t<e},is0:e=>e===X,isOdd:e=>(e&Q)===Q,neg:t=>eo(-t,e),eql:(e,t)=>e===t,sqr:t=>eo(t*t,e),add:(t,r)=>eo(t+r,e),sub:(t,r)=>eo(t-r,e),mul:(t,r)=>eo(t*r,e),pow:(e,t)=>ep(a,e,t),div:(t,r)=>eo(t*ec(r,e),e),sqrN:e=>e*e,addN:(e,t)=>e+t,subN:(e,t)=>e-t,mulN:(e,t)=>e*t,inv:t=>ec(t,e),sqrt:n.sqrt||(t=>(i||(i=el(e)),i(a,t))),invertBatch:e=>ey(a,e),cmov:(e,t,r)=>r?t:e,toBytes:e=>r?K(e,s):$(e,s),fromBytes:e=>{if(e.length!==s)throw Error("Field.fromBytes: expected "+s+" bytes, got "+e.length);return r?U(e):B(e)}});return Object.freeze(a)}let eb=BigInt(0),ev=BigInt(1);function ew(e,t){let r=t.negate();return e?r:t}function e_(e,t){if(!Number.isSafeInteger(e)||e<=0||e>t)throw Error("invalid window size, expected [1.."+t+"], got W="+e)}function eE(e,t){return e_(e,t),{windows:Math.ceil(t/e)+1,windowSize:2**(e-1)}}function eS(e,t){if(!Array.isArray(e))throw Error("array expected");e.forEach((e,r)=>{if(!(e instanceof t))throw Error("invalid point at index "+r)})}function ex(e,t){if(!Array.isArray(e))throw Error("array of scalars expected");e.forEach((e,r)=>{if(!t.isValid(e))throw Error("invalid scalar at index "+r)})}let eA=new WeakMap,eI=new WeakMap;function eO(e){return eI.get(e)||1}function eT(e,t){return{constTimeNegate:ew,hasPrecomputes:e=>1!==eO(e),unsafeLadder(t,r,n=e.ZERO){let i=t;for(;r>eb;)r&ev&&(n=n.add(i)),i=i.double(),r>>=ev;return n},precomputeWindow(e,r){let{windows:n,windowSize:i}=eE(r,t),o=[],s=e,a=s;for(let e=0;e<n;e++){a=s,o.push(a);for(let e=1;e<i;e++)a=a.add(s),o.push(a);s=a.double()}return o},wNAF(r,n,i){let{windows:o,windowSize:s}=eE(r,t),a=e.ZERO,c=e.BASE,u=BigInt(2**r-1),l=2**r,d=BigInt(r);for(let e=0;e<o;e++){let t=e*s,r=Number(i&u);i>>=d,r>s&&(r-=l,i+=ev);let o=t,f=t+Math.abs(r)-1,h=e%2!=0,p=r<0;0===r?c=c.add(ew(h,n[o])):a=a.add(ew(p,n[f]))}return{p:a,f:c}},wNAFUnsafe(r,n,i,o=e.ZERO){let{windows:s,windowSize:a}=eE(r,t),c=BigInt(2**r-1),u=2**r,l=BigInt(r);for(let e=0;e<s;e++){let t=e*a;if(i===eb)break;let r=Number(i&c);if(i>>=l,r>a&&(r-=u,i+=ev),0===r)continue;let s=n[t+Math.abs(r)-1];r<0&&(s=s.negate()),o=o.add(s)}return o},getPrecomputes(e,t,r){let n=eA.get(t);
78return n||(n=this.precomputeWindow(t,e),1!==e&&eA.set(t,r(n))),n},wNAFCached(e,t,r){let n=eO(e);return this.wNAF(n,this.getPrecomputes(n,e,r),t)},wNAFCachedUnsafe(e,t,r,n){let i=eO(e);return 1===i?this.unsafeLadder(e,t,n):this.wNAFUnsafe(i,this.getPrecomputes(i,e,r),t,n)},setWindowSize(e,r){e_(r,t),eI.set(e,r),eA.delete(e)}}}function eP(e,t,r,n){if(eS(r,e),ex(n,t),r.length!==n.length)throw Error("arrays of points and scalars must have equal length");let i=e.ZERO,o=G(BigInt(r.length)),s=o>12?o-3:o>4?o-2:o?2:1,a=(1<<s)-1,c=Array(a+1).fill(i),u=Math.floor((t.BITS-1)/s)*s,l=i;for(let e=u;e>=0;e-=s){c.fill(i);for(let t=0;t<n.length;t++){let i=Number(n[t]>>BigInt(e)&BigInt(a));c[i]=c[i].add(r[t])}let t=i;for(let e=c.length-1,r=i;e>0;e--)r=r.add(c[e]),t=t.add(r);if(l=l.add(t),0!==e)for(let e=0;e<s;e++)l=l.double()}return l}function eM(e){return eh(e.Fp),Z(e,{n:"bigint",h:"bigint",Gx:"field",Gy:"field"},{nBitLength:"isSafeInteger",nByteLength:"isSafeInteger"}),Object.freeze({...eg(e.n,e.nBitLength),...e,p:e.Fp.ORDER})}let eN=BigInt(0),ek=BigInt(1),eC=BigInt(2),eD=BigInt(8),ej={zip215:!0};function eR(e){let t=eM(e);return Z(e,{hash:"function",a:"bigint",d:"bigint",randomBytes:"function"},{adjustScalarBytes:"function",domain:"function",uvRatio:"function",mapToCurve:"function"}),Object.freeze({...t})}function eL(e){let t=eR(e),{Fp:r,n:n,prehash:i,hash:o,randomBytes:s,nByteLength:a,h:c}=t,u=eC<<BigInt(8*a)-ek,l=r.create,d=em(t.n,t.nBitLength),f=t.uvRatio||((e,t)=>{try{return{isValid:!0,value:r.sqrt(e*r.inv(t))}}catch(e){return{isValid:!1,value:eN}}}),h=t.adjustScalarBytes||(e=>e),p=t.domain||((e,t,r)=>{if(N("phflag",r),t.length||r)throw Error("Contexts/pre-hash are not supported");return e});function y(e,t){H("coordinate "+e,t,eN,u)}function g(e){if(!(e instanceof v))throw Error("ExtendedPoint expected")}let m=Y((e,t)=>{let{ex:n,ey:i,ez:o}=e,s=e.is0();null==t&&(t=s?eD:r.inv(o));let a=l(n*t),c=l(i*t),u=l(o*t);if(s)return{x:eN,y:ek};if(u!==ek)throw Error("invZ was invalid");return{x:a,y:c}}),b=Y(e=>{let{a:r,d:n}=t;if(e.is0())throw Error("bad point: ZERO");let{ex:i,ey:o,ez:s,et:a}=e,c=l(i*i),u=l(o*o),d=l(s*s),f=l(d*d),h=l(c*r);if(l(d*l(h+u))!==l(f+l(n*l(c*u))))throw Error("bad point: equation left != right (1)");if(l(i*o)!==l(s*a))throw Error("bad point: equation left != right (2)");return!0});class v{constructor(e,t,r,n){this.ex=e,this.ey=t,this.ez=r,this.et=n,y("x",e),y("y",t),y("z",r),y("t",n),Object.freeze(this)}get x(){return this.toAffine().x}get y(){return this.toAffine().y}static fromAffine(e){if(e instanceof v)throw Error("extended point not allowed");let{x:t,y:r}=e||{};return y("x",t),y("y",r),new v(t,r,ek,l(t*r))}static normalizeZ(e){let t=r.invertBatch(e.map(e=>e.ez));return e.map((e,r)=>e.toAffine(t[r])).map(v.fromAffine)}static msm(e,t){return eP(v,d,e,t)}_setWindowSize(e){E.setWindowSize(this,e)}assertValidity(){b(this)}equals(e){g(e);let{ex:t,ey:r,ez:n}=this,{ex:i,ey:o,ez:s}=e,a=l(t*s),c=l(i*n),u=l(r*s),d=l(o*n);return a===c&&u===d}is0(){return this.equals(v.ZERO)}negate(){return new v(l(-this.ex),this.ey,this.ez,l(-this.et))}double(){let{a:e}=t,{ex:r,ey:n,ez:i}=this,o=l(r*r),s=l(n*n),a=l(eC*l(i*i)),c=l(e*o),u=r+n,d=l(l(u*u)-o-s),f=c+s,h=f-a,p=c-s,y=l(d*h),g=l(f*p),m=l(d*p);return new v(y,g,l(h*f),m)}add(e){g(e);let{a:r,d:n}=t,{ex:i,ey:o,ez:s,et:a}=this,{ex:c,ey:u,ez:d,et:f}=e;if(r===BigInt(-1)){let e=l((o-i)*(u+c)),t=l((o+i)*(u-c)),r=l(t-e);if(r===eN)return this.double();let n=l(s*eC*f),h=l(a*eC*d),p=h+n,y=t+e,g=h-n,m=l(p*r),b=l(y*g),w=l(p*g);return new v(m,b,l(r*y),w)}let h=l(i*c),p=l(o*u),y=l(a*n*f),m=l(s*d),b=l((i+o)*(c+u)-h-p),w=m-y,_=m+y,E=l(p-r*h),S=l(b*w),x=l(_*E),A=l(b*E);return new v(S,x,l(w*_),A)}subtract(e){return this.add(e.negate())}wNAF(e){return E.wNAFCached(this,e,v.normalizeZ)}multiply(e){let t=e;H("scalar",t,ek,n);let{p:r,f:i}=this.wNAF(t);return v.normalizeZ([r,i])[0]}multiplyUnsafe(e,t=v.ZERO){let r=e;return(H("scalar",r,eN,n),r===eN)?_:this.is0()||r===ek?this:E.wNAFCachedUnsafe(this,r,v.normalizeZ,t)}isSmallOrder(){return this.multiplyUnsafe(c).is0()}isTorsionFree(){return E.unsafeLadder(this,n).is0()}toAffine(e){return m(this,e)}clearCofactor(){let{h:e}=t;return e===ek?this:this.multiplyUnsafe(e)}static fromHex(e,n=!1){let{d:i,a:o}=t,s=r.BYTES;e=F("pointHex",e,s),N("zip215",n);let a=e.slice(),c=e[s-1];a[s-1]=-129&c;let d=U(a);H("pointHex.y",d,eN,n?u:r.ORDER);let h=l(d*d),{isValid:p,value:y}=f(l(h-ek),l(i*h-o));
78if(!p)throw Error("Point.fromHex: invalid y coordinate");let g=(y&ek)===ek,m=(128&c)!=0;if(!n&&y===eN&&m)throw Error("Point.fromHex: x=0 and x_0=1");return m!==g&&(y=l(-y)),v.fromAffine({x:y,y:d})}static fromPrivateKey(e){return A(e).point}toRawBytes(){let{x:e,y:t}=this.toAffine(),n=K(t,r.BYTES);return n[n.length-1]|=e&ek?128:0,n}toHex(){return C(this.toRawBytes())}}v.BASE=new v(t.Gx,t.Gy,ek,l(t.Gx*t.Gy)),v.ZERO=new v(eN,ek,ek,eN);let{BASE:w,ZERO:_}=v,E=eT(v,8*a);function S(e){return eo(e,n)}function x(e){return S(U(e))}function A(e){let t=r.BYTES;e=F("private key",e,t);let n=F("hashed private key",o(e),2*t),i=h(n.slice(0,t)),s=n.slice(t,2*t),a=x(i),c=w.multiply(a),u=c.toRawBytes();return{head:i,prefix:s,scalar:a,point:c,pointBytes:u}}function I(e){return A(e).pointBytes}function O(e=new Uint8Array,...t){return x(o(p(z(...t),F("context",e),!!i)))}function T(e,t,o={}){e=F("message",e),i&&(e=i(e));let{prefix:s,scalar:a,pointBytes:c}=A(t),u=O(o.context,s,e),l=w.multiply(u).toRawBytes(),d=S(u+O(o.context,l,c,e)*a);return H("signature.s",d,eN,n),F("result",z(l,K(d,r.BYTES)),2*r.BYTES)}let P=ej;function M(e,t,n,o=P){let s,a,c;let{context:u,zip215:l}=o,d=r.BYTES;e=F("signature",e,2*d),t=F("message",t),n=F("publicKey",n,d),void 0!==l&&N("zip215",l),i&&(t=i(t));let f=U(e.slice(d,2*d));try{s=v.fromHex(n,l),a=v.fromHex(e.slice(0,d),l),c=w.multiplyUnsafe(f)}catch(e){return!1}if(!l&&s.isSmallOrder())return!1;let h=O(u,a.toRawBytes(),s.toRawBytes(),t);return a.add(s.multiplyUnsafe(h)).subtract(c).clearCofactor().equals(v.ZERO)}w._setWindowSize(8);let k={getExtendedPublicKey:A,randomPrivateKey:()=>s(r.BYTES),precompute:(e=8,t=v.BASE)=>(t._setWindowSize(e),t.multiply(BigInt(3)),t)};return{CURVE:t,getPublicKey:I,sign:T,verify:M,ExtendedPoint:v,utils:k}}let eB=BigInt("57896044618658097711785492504343953926634992332820282019728792003956564819949"),eU=BigInt("19681161376707505956807079304988542015446066515923890162744021073123829784752"),e$=BigInt(0),eK=BigInt(1),eF=BigInt(2);BigInt(3);let ez=BigInt(5),eq=BigInt(8);function eV(e){let t=BigInt(10),r=BigInt(20),n=BigInt(40),i=BigInt(80),o=eB,s=e*e%o*e%o,a=ea(s,eF,o)*s%o,c=ea(a,eK,o)*e%o,u=ea(c,ez,o)*c%o,l=ea(u,t,o)*u%o,d=ea(l,r,o)*l%o,f=ea(d,n,o)*d%o,h=ea(f,i,o)*f%o,p=ea(h,i,o)*f%o,y=ea(p,t,o)*u%o;return{pow_p_5_8:ea(y,eF,o)*e%o,b2:s}}function eH(e){return e[0]&=248,e[31]&=127,e[31]|=64,e}function eG(e,t){let r=eB,n=eo(t*t*t,r),i=eV(e*eo(n*n*t,r)).pow_p_5_8,o=eo(e*n*i,r),s=eo(t*o*o,r),a=o,c=eo(o*eU,r),u=s===e,l=s===eo(-e,r),d=s===eo(-e*eU,r);return u&&(o=a),(l||d)&&(o=c),ed(o,r)&&(o=eo(-o,r)),{isValid:u||l,value:o}}let eW=em(eB,void 0,!0),eJ=eL({a:BigInt(-1),d:BigInt("37095705934669439343138083508754565189542113879843219016388785533085940283555"),Fp:eW,n:BigInt("7237005577332262213973186563042994240857116359379907606001950938285454250989"),h:eq,Gx:BigInt("15112221349535400772501151409588531511454012693041857206046113283949847762202"),Gy:BigInt("46316835694926478169428394003475163141307993866256225615783033603165251855960"),hash:A,randomBytes:h,adjustScalarBytes:eH,uvRatio:eG});function eZ(e){if(!(e instanceof e6))throw Error("RistrettoPoint expected")}let eY=null,eX=null,eQ=null,e0=null,e1=null,e2=e=>eG(eK,e),e5=null,e3=e=>eJ.CURVE.Fp.create(bytesToNumberLE(e)&e5);function e8(e){let{d:t}=eJ.CURVE,r=eJ.CURVE.Fp.ORDER,n=eJ.CURVE.Fp.create,i=n(eY*e*e),o=n((i+eK)*e0),s=BigInt(-1),a=n((s-t*i)*n(i+t)),{isValid:c,value:u}=eG(o,a),l=n(u*e);isNegativeLE(l,r)||(l=n(-l)),c||(u=l),c||(s=i);let d=n(s*(i-eK)*e1-a),f=u*u,h=n((u+u)*a),p=n(d*eX),y=n(eK-f),g=n(eK+f);return new eJ.ExtendedPoint(n(h*g),n(y*p),n(p*g),n(h*y))}class e6{constructor(e){this.ep=e}static fromAffine(e){return new e6(eJ.ExtendedPoint.fromAffine(e))}static hashToCurve(e){let t=e8(e3((e=ensureBytes("ristrettoHash",e,64)).slice(0,32))),r=e8(e3(e.slice(32,64)));return new e6(t.add(r))}static fromHex(e){e=ensureBytes("ristrettoHex",e,32);let{a:t,d:r}=eJ.CURVE,n=eJ.CURVE.Fp.ORDER,i=eJ.CURVE.Fp.create,o="RistrettoPoint.fromHex: the hex is not valid encoding of RistrettoPoint",s=e3(e);
78if(!equalBytes(numberToBytesLE(s,32),e)||isNegativeLE(s,n))throw Error(o);let a=i(s*s),c=i(eK+t*a),u=i(eK-t*a),l=i(c*c),d=i(u*u),f=i(t*r*l-d),{isValid:h,value:p}=e2(i(f*d)),y=i(p*u),g=i(p*y*f),m=i((s+s)*y);isNegativeLE(m,n)&&(m=i(-m));let b=i(c*g),v=i(m*b);if(!h||isNegativeLE(v,n)||b===e$)throw Error(o);return new e6(new eJ.ExtendedPoint(m,b,eK,v))}static msm(e,t){return pippenger(e6,Field(eJ.CURVE.n,eJ.CURVE.nBitLength),e,t)}toRawBytes(){let e,{ex:t,ey:r,ez:n,et:i}=this.ep,o=eJ.CURVE.Fp.ORDER,s=eJ.CURVE.Fp.create,a=s(s(n+r)*s(n-r)),c=s(t*r),u=s(c*c),{value:l}=e2(s(a*u)),d=s(l*a),f=s(l*c),h=s(d*f*i);if(isNegativeLE(i*h,o)){let n=s(r*eY),i=s(t*eY);t=n,r=i,e=s(d*eQ)}else e=f;isNegativeLE(t*h,o)&&(r=s(-r));let p=s((n-r)*e);return isNegativeLE(p,o)&&(p=s(-p)),numberToBytesLE(p,32)}toHex(){return bytesToHex(this.toRawBytes())}toString(){return this.toHex()}equals(e){eZ(e);let{ex:t,ey:r}=this.ep,{ex:n,ey:i}=e.ep,o=eJ.CURVE.Fp.create,s=o(t*i)===o(r*n),a=o(r*i)===o(t*n);return s||a}add(e){return eZ(e),new e6(this.ep.add(e.ep))}subtract(e){return eZ(e),new e6(this.ep.subtract(e.ep))}multiply(e){return new e6(this.ep.multiply(e))}multiplyUnsafe(e){return new e6(this.ep.multiplyUnsafe(e))}double(){return new e6(this.ep.double())}negate(){return new e6(this.ep.negate())}}},62980:(e,t,r)=>{"use strict";r.d(t,{B4:()=>p,CQ:()=>_,CW:()=>w,Ei:()=>f,F8:()=>E,P5:()=>h,TH:()=>S,Vl:()=>b,Vr:()=>v,WM:()=>y,WQ:()=>m,im:()=>g,jm:()=>c,lD:()=>s,qh:()=>d,rE:()=>u,ry:()=>l,xn:()=>a});let n=BigInt(0x100000000-1),i=BigInt(32);function o(e,t=!1){return t?{h:Number(e&n),l:Number(e>>i&n)}:{h:0|Number(e>>i&n),l:0|Number(e&n)}}function s(e,t=!1){let r=e.length,n=new Uint32Array(r),i=new Uint32Array(r);for(let s=0;s<r;s++){let{h:r,l:a}=o(e[s],t);[n[s],i[s]]=[r,a]}return[n,i]}let a=(e,t,r)=>e>>>r,c=(e,t,r)=>e<<32-r|t>>>r,u=(e,t,r)=>e>>>r|t<<32-r,l=(e,t,r)=>e<<32-r|t>>>r,d=(e,t,r)=>e<<64-r|t>>>r-32,f=(e,t,r)=>e>>>r-32|t<<64-r,h=(e,t,r)=>e<<r|t>>>32-r,p=(e,t,r)=>t<<r|e>>>32-r,y=(e,t,r)=>t<<r-32|e>>>64-r,g=(e,t,r)=>e<<r-32|t>>>64-r;function m(e,t,r,n){let i=(t>>>0)+(n>>>0);return{h:e+r+(i/0x100000000|0)|0,l:0|i}}let b=(e,t,r)=>(e>>>0)+(t>>>0)+(r>>>0),v=(e,t,r,n)=>t+r+n+(e/0x100000000|0)|0,w=(e,t,r,n)=>(e>>>0)+(t>>>0)+(r>>>0)+(n>>>0),_=(e,t,r,n,i)=>t+r+n+i+(e/0x100000000|0)|0,E=(e,t,r,n,i)=>(e>>>0)+(t>>>0)+(r>>>0)+(n>>>0)+(i>>>0),S=(e,t,r,n,i,o)=>t+r+n+i+o+(e/0x100000000|0)|0},43331:(e,t,r)=>{"use strict";r.d(t,{Vw:()=>w,DO:()=>s,CC:()=>c,sd:()=>a,Fe:()=>o,Ht:()=>u,uH:()=>d,Id:()=>v,qj:()=>_,O8:()=>f,po:()=>E,Ow:()=>h,fd:()=>g,ZJ:()=>b,DH:()=>l});let n="object"==typeof globalThis&&"crypto"in globalThis?globalThis.crypto:void 0;function i(e){return e instanceof Uint8Array||ArrayBuffer.isView(e)&&"Uint8Array"===e.constructor.name}function o(e){if(!Number.isSafeInteger(e)||e<0)throw Error("positive integer expected, got "+e)}function s(e,...t){if(!i(e))throw Error("Uint8Array expected");if(t.length>0&&!t.includes(e.length))throw Error("Uint8Array expected of length "+t+", got length="+e.length)}function a(e){if("function"!=typeof e||"function"!=typeof e.create)throw Error("Hash should be wrapped by utils.createHasher");o(e.outputLen),o(e.blockLen)}function c(e,t=!0){if(e.destroyed)throw Error("Hash instance has been destroyed");if(t&&e.finished)throw Error("Hash#digest() has already been called")}function u(e,t){s(e);let r=t.outputLen;if(e.length<r)throw Error("digestInto() expects output buffer of length at least "+r)}function l(e){return new Uint32Array(e.buffer,e.byteOffset,Math.floor(e.byteLength/4))}function d(...e){for(let t=0;t<e.length;t++)e[t].fill(0)}function f(e){return new DataView(e.buffer,e.byteOffset,e.byteLength)}function h(e,t){return e<<32-t|e>>>t}function p(e){return e<<24&0xff000000|e<<8&0xff0000|e>>>8&65280|e>>>24&255}function y(e){for(let t=0;t<e.length;t++)e[t]=p(e[t]);return e}let g=68===new Uint8Array(new Uint32Array([0x11223344]).buffer)[0]?e=>e:y;function m(e){if("string"!=typeof e)throw Error("string expected");return new Uint8Array(new TextEncoder().encode(e))}function b(e){return"string"==typeof e&&(e=m(e)),s(e),e}function v(...e){let t=0;for(let r=0;r<e.length;r++){let n=e[r];s(n),t+=n.length}let r=new Uint8Array(t);for(let t=0,n=0;t<e.length;t++){let i=e[t];r.set(i,n),n+=i.length}return r}class w{}function _(e){let t=t=>e().update(b(t)).digest(),r=e();return t.outputLen=r.outputLen,t.blockLen=r.blockLen,t.create=()=>e(),t}
78function E(e=32){if(n&&"function"==typeof n.getRandomValues)return n.getRandomValues(new Uint8Array(e));if(n&&"function"==typeof n.randomBytes)return Uint8Array.from(n.randomBytes(e));throw Error("crypto.getRandomValues must be defined")}},63947:(e,t,r)=>{"use strict";let n;function i(e){return e instanceof Uint8Array||ArrayBuffer.isView(e)&&"Uint8Array"===e.constructor.name}function o(e,t){return!!Array.isArray(t)&&(0===t.length||(e?t.every(e=>"string"==typeof e):t.every(e=>Number.isSafeInteger(e))))}function s(e,t){if("string"!=typeof t)throw Error(`${e}: string expected`);return!0}function a(e){if(!Number.isSafeInteger(e))throw Error(`invalid integer: ${e}`)}function c(e){if(!Array.isArray(e))throw Error("array expected")}function u(e,t){if(!o(!0,t))throw Error(`${e}: array of strings expected`)}function l(e,t){if(!o(!1,t))throw Error(`${e}: array of numbers expected`)}function d(...e){let t=e=>e,r=(e,t)=>r=>e(t(r));return{encode:e.map(e=>e.encode).reduceRight(r,t),decode:e.map(e=>e.decode).reduce(r,t)}}function f(e){let t="string"==typeof e?e.split(""):e,r=t.length;u("alphabet",t);let n=new Map(t.map((e,t)=>[e,t]));return{encode:n=>(c(n),n.map(n=>{if(!Number.isSafeInteger(n)||n<0||n>=r)throw Error(`alphabet.encode: digit index outside alphabet "${n}". Allowed: ${e}`);return t[n]})),decode:t=>(c(t),t.map(t=>{s("alphabet.decode",t);let r=n.get(t);if(void 0===r)throw Error(`Unknown letter: "${t}". Allowed: ${e}`);return r}))}}function h(e=""){return s("join",e),{encode:t=>(u("join.decode",t),t.join(e)),decode:t=>(s("join.decode",t),t.split(e))}}function p(e,t="="){return a(e),s("padding",t),{encode(r){for(u("padding.encode",r);r.length*e%8;)r.push(t);return r},decode(r){u("padding.decode",r);let n=r.length;if(n*e%8)throw Error("padding: invalid, string should have whole number of bytes");for(;n>0&&r[n-1]===t;n--)if((n-1)*e%8==0)throw Error("padding: invalid, string has too much padding");return r.slice(0,n)}}}function y(e,t,r){if(t<2)throw Error(`convertRadix: invalid from=${t}, base cannot be less than 2`);if(r<2)throw Error(`convertRadix: invalid to=${r}, base cannot be less than 2`);if(c(e),!e.length)return[];let n=0,i=[],o=Array.from(e,e=>{if(a(e),e<0||e>=t)throw Error(`invalid integer: ${e}`);return e}),s=o.length;for(;;){let e=0,a=!0;for(let i=n;i<s;i++){let s=o[i],c=t*e,u=c+s;if(!Number.isSafeInteger(u)||c/t!==e||u-s!==c)throw Error("convertRadix: carry overflow");let l=u/r;e=u%r;let d=Math.floor(l);if(o[i]=d,!Number.isSafeInteger(d)||d*r+e!==u)throw Error("convertRadix: carry overflow");a&&(d?a=!1:n=i)}if(i.push(e),a)break}for(let t=0;t<e.length-1&&0===e[t];t++)i.push(0);return i.reverse()}r.d(t,{RG:()=>_,tw:()=>E});let g=(e,t)=>0===t?e:g(t,e%t),m=(e,t)=>
78e+(t-g(e,t)),b=(()=>{let e=[];for(let t=0;t<40;t++)e.push(2**t);return e})();function v(e,t,r,n){if(c(e),t<=0||t>32)throw Error(`convertRadix2: wrong from=${t}`);if(r<=0||r>32)throw Error(`convertRadix2: wrong to=${r}`);if(m(t,r)>32)throw Error(`convertRadix2: carry overflow from=${t} to=${r} carryBits=${m(t,r)}`);let i=0,o=0,s=b[t],u=b[r]-1,l=[];for(let n of e){if(a(n),n>=s)throw Error(`convertRadix2: invalid data word=${n} from=${t}`);if(i=i<<t|n,o+t>32)throw Error(`convertRadix2: carry overflow pos=${o} from=${t}`);for(o+=t;o>=r;o-=r)l.push((i>>o-r&u)>>>0);let e=b[o];if(void 0===e)throw Error("invalid carry");i&=e-1}if(i=i<<r-o&u,!n&&o>=t)throw Error("Excess padding");if(!n&&i>0)throw Error(`Non-zero padding: ${i}`);return n&&o>0&&l.push(i>>>0),l}function w(e){a(e);let t=256;return{encode:r=>{if(!i(r))throw Error("radix.encode input should be Uint8Array");return y(Array.from(r),t,e)},decode:r=>(l("radix.decode",r),Uint8Array.from(y(r,e,t)))}}let _=d(function e(t,r=!1){if(a(t),t<=0||t>32)throw Error("radix2: bits should be in (0..32]");if(m(8,t)>32||m(t,8)>32)throw Error("radix2: carry overflow");return{encode:e=>{if(!i(e))throw Error("radix2.encode input should be Uint8Array");return v(Array.from(e),8,t,!r)},decode:e=>(l("radix2.decode",e),Uint8Array.from(v(e,t,8,r)))}}(5),f("ABCDEFGHIJKLMNOPQRSTUVWXYZ234567"),p(5),h(""));"function"==typeof Uint8Array.from([]).toBase64&&Uint8Array.fromBase64;let E=(n="123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz",d(w(58),f(n),h(""))),S=[0x3b6a57b2,0x26508e6d,0x1ea119fa,0x3d4233dd,0x2a1462b3];"function"==typeof Uint8Array.from([]).toHex&&Uint8Array.fromHex},85771:(e,t,r)=>{"use strict";r.d(t,{l:()=>_});var n=["u8","u16","u32","u64","u128","i8","i16","i32","i64","i128","f32","f64"],i=function(){function e(){this.offset=0,this.buffer_size=256,this.buffer=new ArrayBuffer(this.buffer_size),this.view=new DataView(this.buffer)}return e.prototype.resize_if_necessary=function(e){if(this.buffer_size-this.offset<e){this.buffer_size=Math.max(2*this.buffer_size,this.buffer_size+e);var t=new ArrayBuffer(this.buffer_size);new Uint8Array(t).set(new Uint8Array(this.buffer)),this.buffer=t,this.view=new DataView(t)}},e.prototype.get_used_buffer=function(){return new Uint8Array(this.buffer).slice(0,this.offset)},e.prototype.store_value=function(e,t){var r=t.substring(1),n=parseInt(r)/8;this.resize_if_necessary(n);var i="f"===t[0]?"setFloat".concat(r):"i"===t[0]?"setInt".concat(r):"setUint".concat(r);this.view[i](this.offset,e,!0),this.offset+=n},e.prototype.store_bytes=function(e){this.resize_if_necessary(e.length),new Uint8Array(this.buffer).set(new Uint8Array(e),this.offset),this.offset+=e.length},e}(),o=function(){function e(e){this.offset=0,this.buffer_size=e.length,this.buffer=new ArrayBuffer(e.length),new Uint8Array(this.buffer).set(e),this.view=new DataView(this.buffer)}return e.prototype.assert_enough_buffer=function(e){if(this.offset+e>this.buffer.byteLength)throw Error("Error in schema, the buffer is smaller than expected")},e.prototype.consume_value=function(e){var t=e.substring(1),r=parseInt(t)/8;this.assert_enough_buffer(r);var n="f"===e[0]?"getFloat".concat(t):"i"===e[0]?"getInt".concat(t):"getUint".concat(t),i=this.view[n](this.offset,!0);return this.offset+=r,i},e.prototype.consume_bytes=function(e){this.assert_enough_buffer(e);var t=this.buffer.slice(this.offset,this.offset+e);return this.offset+=e,t},e}(),s=function(){var e=function(t,r){return(e=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])})(t,r)};return function(t,r){if("function"!=typeof r&&null!==r)throw TypeError("Class extends value "+String(r)+" is not a constructor or null");function n(){this.constructor=t}e(t,r),t.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}();function a(e){return Array.isArray(e)||!!e&&"object"==typeof e&&"length"in e&&"number"==typeof e.length&&(0===e.length||e.length>0&&e.length-1 in e)}function c(e,t,r){if(typeof e!==t)throw Error("Expected ".concat(t," not ").concat(typeof e,"(").concat(e,") at ").concat(r.join(".")))}function u(e,t){var r=["number","string","bigint","boolean"].includes(typeof e),n="object"==typeof e&&null!==e&&"toString"in e;if(!r&&!n)throw Error("Expected bigint, number, boolean or string not ".concat(typeof e,"(").concat(e,") at ").concat(t.join(".")))}function l(e,t,r){if(e!==t)throw Error("Array length ".concat(e," does not match sc
78hema length ").concat(t," at ").concat(r.join(".")))}function d(e,t){if("object"!=typeof e||null===e)throw Error("Expected object not ".concat(typeof e,"(").concat(e,") at ").concat(t.join(".")))}var f=n.concat(["bool","string"]),h=["option","enum","array","set","map","struct"],p=function(e){function t(t,r){var n="Invalid schema: ".concat(JSON.stringify(t)," expected ").concat(r);return e.call(this,n)||this}return s(t,e),t}(Error);function y(e){if(!("string"==typeof e&&f.includes(e))){if(e&&"object"==typeof e){var t=Object.keys(e);if(1===t.length&&h.includes(t[0])){var r=t[0];if("option"===r)return y(e[r]);if("enum"===r)return g(e[r]);if("array"===r)return m(e[r]);if("set"===r)return y(e[r]);if("map"===r)return b(e[r]);if("struct"===r)return v(e[r])}}throw new p(e,h.join(", ")+" or "+f.join(", "))}}function g(e){if(!Array.isArray(e))throw new p(e,"Array");for(var t=0,r=e;t<r.length;t++){var n=r[t];if("object"!=typeof n||!("struct"in n))throw Error('Missing "struct" key in enum schema');if("object"!=typeof n.struct||1!==Object.keys(n.struct).length)throw Error('The "struct" in each enum must have a single key');y({struct:n.struct})}}function m(e){if("object"!=typeof e)throw new p(e,"{ type, len? }");if(e.len&&"number"!=typeof e.len)throw Error("Invalid schema: ".concat(e));if("type"in e)return y(e.type);throw new p(e,"{ type, len? }")}function b(e){if("object"==typeof e&&"key"in e&&"value"in e)y(e.key),y(e.value);else throw new p(e,"{ key, value }")}function v(e){if("object"!=typeof e)throw new p(e,"object");for(var t in e)y(e[t])}var w=function(){function e(e){this.encoded=new i,this.fieldPath=["value"],this.checkTypes=e}return e.prototype.encode=function(e,t){return this.encode_value(e,t),this.encoded.get_used_buffer()},e.prototype.encode_value=function(e,t){if("string"==typeof t){if(n.includes(t))return this.encode_integer(e,t);if("string"===t)return this.encode_string(e);if("bool"===t)return this.encode_boolean(e)}if("object"==typeof t){if("option"in t)return this.encode_option(e,t);if("enum"in t)return this.encode_enum(e,t);if("array"in t)return this.encode_array(e,t);if("set"in t)return this.encode_set(e,t);if("map"in t)return this.encode_map(e,t);if("struct"in t)return this.encode_struct(e,t)}},e.prototype.encode_integer=function(e,t){var r=parseInt(t.substring(1));r<=32||"f64"==t?(this.checkTypes&&c(e,"number",this.fieldPath),this.encoded.store_value(e,t)):(this.checkTypes&&u(e,this.fieldPath),this.encode_bigint(BigInt(e),r))},e.prototype.encode_bigint=function(e,t){for(var r=t/8,n=new Uint8Array(r),i=0;i<r;i++)n[i]=Number(e&BigInt(255)),e>>=BigInt(8);this.encoded.store_bytes(new Uint8Array(n))},e.prototype.encode_string=function(e){this.checkTypes&&c(e,"string",this.fieldPath);for(var t=e,r=[],n=0;n<t.length;n++){var i=t.charCodeAt(n);i<128?r.push(i):i<2048?r.push(192|i>>6,128|63&i):i<55296||i>=57344?r.push(224|i>>12,128|i>>6&63,128|63&i):(n++,i=65536+((1023&i)<<10|1023&t.charCodeAt(n)),r.push(240|i>>18,128|i>>12&63,128|i>>6&63,128|63&i))}this.encoded.store_value(r.length,"u32"),this.encoded.store_bytes(new Uint8Array(r))},e.prototype.encode_boolean=function(e){this.checkTypes&&c(e,"boolean",this.fieldPath),this.encoded.store_value(e?1:0,"u8")},e.prototype.encode_option=function(e,t){null==e?this.encoded.store_value(0,"u8"):(this.encoded.store_value(1,"u8"),this.encode_value(e,t.option))},e.prototype.encode_enum=function(e,t){this.checkTypes&&d(e,this.fieldPath);for(var r=Object.keys(e)[0],n=0;n<t.enum.length;n++){var i=t.enum[n];if(r===Object.keys(i.struct)[0])return this.encoded.store_value(n,"u8"),this.encode_struct(e,i)}throw Error("Enum key (".concat(r,") not found in enum schema: ").concat(JSON.stringify(t)," at ").concat(this.fieldPath.join(".")))},e.prototype.encode_array=function(e,t){if(a(e))return this.encode_arraylike(e,t);if(e instanceof ArrayBuffer)return this.encode_buffer(e,t);throw Error("Expected Array-like not ".concat(typeof e,"(").concat(e,") at ").concat(this.fieldPath.join(".")))},e.prototype.encode_arraylike=function(e,t){t.array.len?l(e.length,t.array.len,this.fieldPath):this.encoded.store_value(e.length,"u32");for(var r=0;r<e.length;r++)this.encode_value(e[r],t.array.type)},e.prototype.encode_buffer=function(e,t){t.array.len?l(e.byteLength,t.array.len,this.fieldPath):this.encoded.store_value(e.byteLength,"u32"),this.encoded.store_bytes(new Uint8Array(e))},e.prototype.encode_set=function(e,t){this.checkTypes&&c(e,"object",this.fieldPath);var r=e instanceof Set?Array.from(e.values()):Object.values(e);this.encoded.store_value(r.length,"u32");for(var n=0,i=r;n<i.length;n++){var o=i[n];this.encode_value(o,t.set)}},e.prototype.encode_map=function(e,t){this.checkTypes&&c(e,"object",this.fieldPath);var r=e instanceof Map,n=r?Array.from(e.keys()):Object.keys(e);this.encoded.store_value(n.length,"u32");for(var i=0,o=n;i<o.length;i++){var s=o[i];this.encode_value(s,t.map.key),this.encode_value(r?e.get(s):e[s],t.map.value)}},e.prototype.encode_struct=function(e,t){this.checkTypes&&c(e,"object",this.fieldPath);for(var r=0,n=Object.keys(t.struct);r<n.length;r++){var i=n[r];this.fieldPath.push(i),this.encode_value(e[i],t.struct[i]),this.fieldPath.pop()}},e}();function _(e,t,r){return void 0===r&&(r=!0),r&&y(e),new w(r).encode(t,e)}!function(){function e(e){this.buffer=new o(e)}e.prototype.decode=function(e){return this.decode_value(e)},e.prototype.decode_value=function(e){if("string"==typeof e){if(n.includes(e))return this.decode_integer(e);if("string"===e)return this.decode_string();if("bool"===e)return this.decode_boolean()}if("object"==typeof e){if("option"in e)return this.decode_option(e);if("enum"in e)return this.decode_enum(e);
78if("array"in e)return this.decode_array(e);if("set"in e)return this.decode_set(e);if("map"in e)return this.decode_map(e);if("struct"in e)return this.decode_struct(e)}throw Error("Unsupported type: ".concat(e))},e.prototype.decode_integer=function(e){var t=parseInt(e.substring(1));return t<=32||"f64"==e?this.buffer.consume_value(e):this.decode_bigint(t,e.startsWith("i"))},e.prototype.decode_bigint=function(e,t){void 0===t&&(t=!1);var r=e/8,n=new Uint8Array(this.buffer.consume_bytes(r)),i=n.reduceRight(function(e,t){return e+t.toString(16).padStart(2,"0")},"");return t&&n[r-1]?BigInt.asIntN(e,BigInt("0x".concat(i))):BigInt("0x".concat(i))},e.prototype.decode_string=function(){for(var e=this.decode_integer("u32"),t=new Uint8Array(this.buffer.consume_bytes(e)),r=[],n=0;n<e;++n){var i=t[n];if(i<128)r.push(i);else if(i<224)r.push((31&i)<<6|63&t[++n]);else if(i<240)r.push((15&i)<<12|(63&t[++n])<<6|63&t[++n]);else{var o=(7&i)<<18|(63&t[++n])<<12|(63&t[++n])<<6|63&t[++n];r.push(o)}}return String.fromCodePoint.apply(String,r)},e.prototype.decode_boolean=function(){return this.buffer.consume_value("u8")>0},e.prototype.decode_option=function(e){var t=this.buffer.consume_value("u8");if(1===t)return this.decode_value(e.option);if(0!==t)throw Error("Invalid option ".concat(t));return null},e.prototype.decode_enum=function(e){var t,r=this.buffer.consume_value("u8");if(r>e.enum.length)throw Error("Enum option ".concat(r," is not available"));var n=e.enum[r].struct,i=Object.keys(n)[0];return(t={})[i]=this.decode_value(n[i]),t},e.prototype.decode_array=function(e){for(var t=[],r=e.array.len?e.array.len:this.decode_integer("u32"),n=0;n<r;++n)t.push(this.decode_value(e.array.type));return t},e.prototype.decode_set=function(e){for(var t=this.decode_integer("u32"),r=new Set,n=0;n<t;++n)r.add(this.decode_value(e.set));return r},e.prototype.decode_map=function(e){for(var t=this.decode_integer("u32"),r=new Map,n=0;n<t;++n){var i=this.decode_value(e.map.key),o=this.decode_value(e.map.value);r.set(i,o)}return r},e.prototype.decode_struct=function(e){var t={};for(var r in e.struct)t[r]=this.decode_value(e.struct[r]);return t}}()},6476:(e,t,r)=>{"use strict";r.d(t,{C6:()=>i,Ju:()=>o,fX:()=>a,zs:()=>s});var n=function(e,t){return(n=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])})(e,t)};function i(e,t){if("function"!=typeof t&&null!==t)throw TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}function o(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 TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function s(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,i,o=r.call(e),s=[];try{for(;(void 0===t||t-- >0)&&!(n=o.next()).done;)s.push(n.value)}catch(e){i={error:e}}finally{try{n&&!n.done&&(r=o.return)&&r.call(o)}finally{if(i)throw i.error}}return s}function a(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))}Object.create;Object.create,"function"==typeof SuppressedError&&SuppressedError},39523:(e,t,r)=>{"use strict";r.r(t),r.d(t,{default:()=>s,uuid4:()=>o,valid:()=>i});let n=/^[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/i;function i(e){return n.test(e)}function o(){var e=URL.createObjectURL(new Blob),t=e.toString();return URL.revokeObjectURL(e),t.split(/[:\/]/g).pop().toLowerCase()}o.valid=i;let s=o},67352:e=>{"use strict";e.exports=JSON.parse('{"GasLimitExceeded":"Exceeded the maximum amount of gas allowed to burn per contract","MethodEmptyName":"Method name is empty","WasmerCompileError":"Wasmer compilation error: {{msg}}","GuestPanic":"Smart contract panicked: {{panic_msg}}","Memory":"Error creating Wasm memory","GasExceeded":"Exceeded the prepaid gas","MethodUTF8Error":"Method name is not val
78id UTF8 string","BadUTF16":"String encoding is bad UTF-16 sequence","WasmTrap":"WebAssembly trap: {{msg}}","GasInstrumentation":"Gas instrumentation failed or contract has denied instructions.","InvalidPromiseIndex":"{{promise_idx}} does not correspond to existing promises","InvalidPromiseResultIndex":"Accessed invalid promise result index: {{result_idx}}","Deserialization":"Error happened while deserializing the module","MethodNotFound":"Contract method is not found","InvalidRegisterId":"Accessed invalid register id: {{register_id}}","InvalidReceiptIndex":"VM Logic returned an invalid receipt index: {{receipt_index}}","EmptyMethodName":"Method name is empty in contract call","CannotReturnJointPromise":"Returning joint promise is currently prohibited","StackHeightInstrumentation":"Stack instrumentation failed","CodeDoesNotExist":"Cannot find contract code for account {{account_id}}","MethodInvalidSignature":"Invalid method signature","IntegerOverflow":"Integer overflow happened during contract execution","MemoryAccessViolation":"MemoryAccessViolation","InvalidIteratorIndex":"Iterator index {{iterator_index}} does not exist","IteratorWasInvalidated":"Iterator {{iterator_index}} was invalidated after its creation by performing a mutable operation on trie","InvalidAccountId":"VM Logic returned an invalid account id","Serialization":"Error happened while serializing the module","CannotAppendActionToJointPromise":"Actions can only be appended to non-joint promise.","InternalMemoryDeclared":"Internal memory declaration has been found in the module","Instantiate":"Error happened during instantiation","ProhibitedInView":"{{method_name}} is not allowed in view calls","InvalidMethodName":"VM Logic returned an invalid method name","BadUTF8":"String encoding is bad UTF-8 sequence","BalanceExceeded":"Exceeded the account balance","LinkError":"Wasm contract link error: {{msg}}","InvalidPublicKey":"VM Logic provided an invalid public key","ActorNoPermission":"Actor {{actor_id}} doesn\'t have permission to account {{account_id}} to complete the action","LackBalanceForState":"The account {{account_id}} wouldn\'t have enough balance to cover storage, required to have {{amount}} yoctoNEAR more","ReceiverMismatch":"Wrong AccessKey used for transaction: transaction is sent to receiver_id={{tx_receiver}}, but is signed with function call access key that restricted to only use with receiver_id={{ak_receiver}}. Either change receiver_id in your transaction or switch to use a FullAccessKey.","CostOverflow":"Transaction gas or balance cost is too high","InvalidSignature":"Transaction is not signed with the given public key","AccessKeyNotFound":"Signer \\"{{account_id}}\\" doesn\'t have access key with the given public_key {{public_key}}","NotEnoughBalance":"Sender {{signer_id}} does not have enough balance {{#formatNear}}{{balance}}{{/formatNear}} for operation costing {{#formatNear}}{{cost}}{{/formatNear}}","NotEnoughAllowance":"Access Key {account_id}:{public_key} does not have enough balance {{#formatNear}}{{allowance}}{{/formatNear}} for transaction costing {{#formatNear}}{{cost}}{{/formatNear}}","Expired":"Transaction has expired","DeleteAccountStaking":"Account {{account_id}} is staking and can not be deleted","SignerDoesNotExist":"Signer {{signer_id}} does not exist","TriesToStake":"Account {{account_id}} tried to stake {{#formatNear}}{{stake}}{{/formatNear}}, but has staked {{#formatNear}}{{locked}}{{/formatNear}} and only has {{#formatNear}}{{balance}}{{/formatNear}}","AddKeyAlreadyExists":"The public key {{public_key}} is already used for an existing access key","InvalidSigner":"Invalid signer account ID {{signer_id}} according to requirements","CreateAccountNotAllowed":"The new account_id {{account_id}} can\'t be created by {{predecessor_id}}","RequiresFullAccess":"The transaction contains more then one action, but it was signed with an access key which allows transaction to apply only one specific action. To apply more then one actions TX must be signed with a full access key","TriesToUnstake":"Account {{account_id}} is not yet staked, but tried to unstake","InvalidNonce":"Transaction nonce {{tx_nonce}} must be larger than nonce of the used access key {{ak_nonce}}","AccountAlreadyExists":"Can\'t create a new account {{account_id}}, because it already exists","InvalidChain":"Transaction parent block hash doesn\'t belong to the current chain","AccountDoesNotExist":"Can\'t complete the action because account {{account_id}} doesn\'t exist","AccessKeyDoesNotExist":"Can\'t complete the action because access key {{public_key}}
78 doesn\'t exist","MethodNameMismatch":"Transaction method name {{method_name}} isn\'t allowed by the access key","DeleteAccountHasRent":"Account {{account_id}} can\'t be deleted. It has {{#formatNear}}{{balance}}{{/formatNear}}, which is enough to cover the rent","DeleteAccountHasEnoughBalance":"Account {{account_id}} can\'t be deleted. It has {{#formatNear}}{{balance}}{{/formatNear}}, which is enough to cover it\'s storage","InvalidReceiver":"Invalid receiver account ID {{receiver_id}} according to requirements","DeleteKeyDoesNotExist":"Account {{account_id}} tries to remove an access key that doesn\'t exist","Timeout":"Timeout exceeded","Closed":"Connection closed","ShardCongested":"Shard {{shard_id}} rejected the transaction due to congestion level {{congestion_level}}, try again later","ShardStuck":"Shard {{shard_id}} rejected the transaction because it missed {{missed_chunks}} chunks and needs to recover before accepting new transactions, try again later"}')},18403:e=>{"use strict";e.exports=JSON.parse('{"schema":{"AccessKeyNotFound":{"name":"AccessKeyNotFound","subtypes":[],"props":{"account_id":"","public_key":""}},"AccountAlreadyExists":{"name":"AccountAlreadyExists","subtypes":[],"props":{"account_id":""}},"AccountDoesNotExist":{"name":"AccountDoesNotExist","subtypes":[],"props":{"account_id":""}},"ActionError":{"name":"ActionError","subtypes":["AccountAlreadyExists","AccountDoesNotExist","CreateAccountOnlyByRegistrar","CreateAccountNotAllowed","ActorNoPermission","DeleteKeyDoesNotExist","AddKeyAlreadyExists","DeleteAccountStaking","LackBalanceForState","TriesToUnstake","TriesToStake","InsufficientStake","FunctionCallError","NewReceiptValidationError","OnlyImplicitAccountCreationAllowed","DeleteAccountWithLargeState","DelegateActionInvalidSignature","DelegateActionSenderDoesNotMatchTxReceiver","DelegateActionExpired","DelegateActionAccessKeyError","DelegateActionInvalidNonce","DelegateActionNonceTooLarge"],"props":{"index":""}},"ActionsValidationError":{"name":"ActionsValidationError","subtypes":["DeleteActionMustBeFinal","TotalPrepaidGasExceeded","TotalNumberOfActionsExceeded","AddKeyMethodNamesNumberOfBytesExceeded","AddKeyMethodNameLengthExceeded","IntegerOverflow","InvalidAccountId","ContractSizeExceeded","FunctionCallMethodNameLengthExceeded","FunctionCallArgumentsLengthExceeded","UnsuitableStakingKey","FunctionCallZeroAttachedGas","DelegateActionMustBeOnlyOne","UnsupportedProtocolFeature"],"props":{}},"ActorNoPermission":{"name":"ActorNoPermission","subtypes":[],"props":{"account_id":"","actor_id":""}},"AddKeyAlreadyExists":{"name":"AddKeyAlreadyExists","subtypes":[],"props":{"account_id":"","public_key":""}},"AddKeyMethodNameLengthExceeded":{"name":"AddKeyMethodNameLengthExceeded","subtypes":[],"props":{"length":"","limit":""}},"AddKeyMethodNamesNumberOfBytesExceeded":{"name":"AddKeyMethodNamesNumberOfBytesExceeded","subtypes":[],"props":{"limit":"","total_number_of_bytes":""}},"AltBn128InvalidInput":{"name":"AltBn128InvalidInput","subtypes":[],"props":{"msg":""}},"BadUTF16":{"name":"BadUTF16","subtypes":[],"props":{}},"BadUTF8":{"name":"BadUTF8","subtypes":[],"props":{}},"BalanceExceeded":{"name":"BalanceExceeded","subtypes":[],"props":{}},"BalanceMismatchError":{"name":"BalanceMismatchError","subtypes":[],"props":{"final_accounts_balance":"","final_postponed_receipts_balance":"","forwarded_buffered_receipts_balance":"","incoming_receipts_balance":"","incoming_validator_rewards":"","initial_accounts_balance":"","initial_postponed_receipts_balance":"","new_buffered_receipts_balance":"","new_delayed_receipts_balance":"","other_burnt_amount":"","outgoing_receipts_balance":"","processed_delayed_receipts_balance":"","slashed_burnt_amount":"","tx_burnt_amount":""}},"CallIndirectOOB":{"name":"CallIndirectOOB","subtypes":[],"props":{}},"CannotAppendActionToJointPromise":{"name":"CannotAppendActionToJointPromise","subtypes":[],"props":{}},"CannotReturnJointPromise":{"name":"CannotReturnJointPromise","subtypes":[],"props":{}},"CodeDoesNotExist":{"name":"CodeDoesNotExist","subtypes":[],"props":{"account_id":""}},"CompilationError":{"name":"CompilationError","subtypes":["CodeDoesNotExist","PrepareError","WasmerCompileError"],"props":{}},"ContractSizeExceeded":{"name":"ContractSizeExceeded","subtypes":[],"props":{"limit":"","size":""}},"CostOverflow":{"name":"CostOverflow","subtypes":[],"props":{}},"CreateAccountNotAllowed":{"name":"CreateAccountNotAllowed","subtypes":[],"props":{"account_id":"","predecessor_id":""}},"CreateAccountOnlyByRegistrar":{"name":"CreateAccountOnlyByRegistrar","subtypes":[],"props":{"account_id":"","predecessor_id":"","registrar_account_id":""}},"DelegateActionExpired":{"name":"DelegateActionExpired","subtypes":[],"props":{}},"DelegateActionInvalidNonce":{"name":"DelegateActionInvalidNonce","subtypes":[],"props":{"ak_nonce":"","delegate_nonce":""}}
78,"DelegateActionInvalidSignature":{"name":"DelegateActionInvalidSignature","subtypes":[],"props":{}},"DelegateActionMustBeOnlyOne":{"name":"DelegateActionMustBeOnlyOne","subtypes":[],"props":{}},"DelegateActionNonceTooLarge":{"name":"DelegateActionNonceTooLarge","subtypes":[],"props":{"delegate_nonce":"","upper_bound":""}},"DelegateActionSenderDoesNotMatchTxReceiver":{"name":"DelegateActionSenderDoesNotMatchTxReceiver","subtypes":[],"props":{"receiver_id":"","sender_id":""}},"DeleteAccountStaking":{"name":"DeleteAccountStaking","subtypes":[],"props":{"account_id":""}},"DeleteAccountWithLargeState":{"name":"DeleteAccountWithLargeState","subtypes":[],"props":{"account_id":""}},"DeleteActionMustBeFinal":{"name":"DeleteActionMustBeFinal","subtypes":[],"props":{}},"DeleteKeyDoesNotExist":{"name":"DeleteKeyDoesNotExist","subtypes":[],"props":{"account_id":"","public_key":""}},"DepositWithFunctionCall":{"name":"DepositWithFunctionCall","subtypes":[],"props":{}},"Deprecated":{"name":"Deprecated","subtypes":[],"props":{"method_name":""}},"Deserialization":{"name":"Deserialization","subtypes":[],"props":{}},"ECRecoverError":{"name":"ECRecoverError","subtypes":[],"props":{"msg":""}},"Ed25519VerifyInvalidInput":{"name":"Ed25519VerifyInvalidInput","subtypes":[],"props":{"msg":""}},"EmptyMethodName":{"name":"EmptyMethodName","subtypes":[],"props":{}},"Expired":{"name":"Expired","subtypes":[],"props":{}},"FunctionCallArgumentsLengthExceeded":{"name":"FunctionCallArgumentsLengthExceeded","subtypes":[],"props":{"length":"","limit":""}},"FunctionCallMethodNameLengthExceeded":{"name":"FunctionCallMethodNameLengthExceeded","subtypes":[],"props":{"length":"","limit":""}},"FunctionCallZeroAttachedGas":{"name":"FunctionCallZeroAttachedGas","subtypes":[],"props":{}},"GasExceeded":{"name":"GasExceeded","subtypes":[],"props":{}},"GasInstrumentation":{"name":"GasInstrumentation","subtypes":[],"props":{}},"GasLimitExceeded":{"name":"GasLimitExceeded","subtypes":[],"props":{}},"GenericTrap":{"name":"GenericTrap","subtypes":[],"props":{}},"GuestPanic":{"name":"GuestPanic","subtypes":[],"props":{"panic_msg":""}},"HostError":{"name":"HostError","subtypes":["BadUTF16","BadUTF8","GasExceeded","GasLimitExceeded","BalanceExceeded","EmptyMethodName","GuestPanic","IntegerOverflow","InvalidPromiseIndex","CannotAppendActionToJointPromise","CannotReturnJointPromise","InvalidPromiseResultIndex","InvalidRegisterId","IteratorWasInvalidated","MemoryAccessViolation","InvalidReceiptIndex","InvalidIteratorIndex","InvalidAccountId","InvalidMethodName","InvalidPublicKey","ProhibitedInView","NumberOfLogsExceeded","KeyLengthExceeded","ValueLengthExceeded","TotalLogLengthExceeded","NumberPromisesExceeded","NumberInputDataDependenciesExceeded","ReturnedValueLengthExceeded","ContractSizeExceeded","Deprecated","ECRecoverError","AltBn128InvalidInput","Ed25519VerifyInvalidInput"],"props":{}},"IllegalArithmetic":{"name":"IllegalArithmetic","subtypes":[],"props":{}},"IncorrectCallIndirectSignature":{"name":"IncorrectCallIndirectSignature","subtypes":[],"props":{}},"IndirectCallToNull":{"name":"IndirectCallToNull","subtypes":[],"props":{}},"Instantiate":{"name":"Instantiate","subtypes":[],"props":{}},"InsufficientStake":{"name":"InsufficientStake","subtypes":[],"props":{"account_id":"","minimum_stake":"","stake":""}},"IntegerOverflow":{"name":"IntegerOverflow","subtypes":[],"props":{}},"InternalMemoryDeclared":{"name":"InternalMemoryDeclared","subtypes":[],"props":{}},"InvalidAccessKeyError":{"name":"InvalidAccessKeyError","subtypes":["AccessKeyNotFound","ReceiverMismatch","MethodNameMismatch","RequiresFullAccess","NotEnoughAllowance","DepositWithFunctionCall"],"props":{}},"InvalidAccountId":{"name":"InvalidAccountId","subtypes":[],"props":{}},"InvalidChain":{"name":"InvalidChain","subtypes":[],"props":{}},"InvalidDataReceiverId":{"name":"InvalidDataReceiverId","subtypes":[],"props":{"account_id":""}},"InvalidIteratorIndex":{"name":"InvalidIteratorIndex","subtypes":[],"props":{"iterator_index":""}}
78,"InvalidMethodName":{"name":"InvalidMethodName","subtypes":[],"props":{}},"InvalidNonce":{"name":"InvalidNonce","subtypes":[],"props":{"ak_nonce":"","tx_nonce":""}},"InvalidPredecessorId":{"name":"InvalidPredecessorId","subtypes":[],"props":{"account_id":""}},"InvalidPromiseIndex":{"name":"InvalidPromiseIndex","subtypes":[],"props":{"promise_idx":""}},"InvalidPromiseResultIndex":{"name":"InvalidPromiseResultIndex","subtypes":[],"props":{"result_idx":""}},"InvalidPublicKey":{"name":"InvalidPublicKey","subtypes":[],"props":{}},"InvalidReceiptIndex":{"name":"InvalidReceiptIndex","subtypes":[],"props":{"receipt_index":""}},"InvalidReceiverId":{"name":"InvalidReceiverId","subtypes":[],"props":{"account_id":""}},"InvalidRegisterId":{"name":"InvalidRegisterId","subtypes":[],"props":{"register_id":""}},"InvalidSignature":{"name":"InvalidSignature","subtypes":[],"props":{}},"InvalidSignerId":{"name":"InvalidSignerId","subtypes":[],"props":{"account_id":""}},"InvalidTxError":{"name":"InvalidTxError","subtypes":["InvalidAccessKeyError","InvalidSignerId","SignerDoesNotExist","InvalidNonce","NonceTooLarge","InvalidReceiverId","InvalidSignature","NotEnoughBalance","LackBalanceForState","CostOverflow","InvalidChain","Expired","ActionsValidation","TransactionSizeExceeded","StorageError","ShardCongested","ShardStuck"],"props":{}},"IteratorWasInvalidated":{"name":"IteratorWasInvalidated","subtypes":[],"props":{"iterator_index":""}}
78,"KeyLengthExceeded":{"name":"KeyLengthExceeded","subtypes":[],"props":{"length":"","limit":""}},"LackBalanceForState":{"name":"LackBalanceForState","subtypes":[],"props":{"account_id":"","amount":""}},"Memory":{"name":"Memory","subtypes":[],"props":{}},"MemoryAccessViolation":{"name":"MemoryAccessViolation","subtypes":[],"props":{}},"MemoryOutOfBounds":{"name":"MemoryOutOfBounds","subtypes":[],"props":{}},"MethodEmptyName":{"name":"MethodEmptyName","subtypes":[],"props":{}},"MethodInvalidSignature":{"name":"MethodInvalidSignature","subtypes":[],"props":{}},"MethodNameMismatch":{"name":"MethodNameMismatch","subtypes":[],"props":{"method_name":""}},"MethodNotFound":{"name":"MethodNotFound","subtypes":[],"props":{}},"MethodResolveError":{"name":"MethodResolveError","subtypes":["MethodEmptyName","MethodNotFound","MethodInvalidSignature"],"props":{}},"MisalignedAtomicAccess":{"name":"MisalignedAtomicAccess","subtypes":[],"props":{}},"NonceTooLarge":{"name":"NonceTooLarge","subtypes":[],"props":{"tx_nonce":"","upper_bound":""}},"NotEnoughAllowance":{"name":"NotEnoughAllowance","subtypes":[],"props":{"account_id":"","allowance":"","cost":"","public_key":""}},"NotEnoughBalance":{"name":"NotEnoughBalance","subtypes":[],"props":{"balance":"","cost":"","signer_id":""}},"NumberInputDataDependenciesExceeded":{"name":"NumberInputDataDependenciesExceeded","subtypes":[],"props":{"limit":"","number_of_input_data_dependencies":""}},"NumberOfLogsExceeded":{"name":"NumberOfLogsExceeded","subtypes":[],"props":{"limit":""}},"NumberPromisesExceeded":{"name":"NumberPromisesExceeded","subtypes":[],"props":{"limit":"","number_of_promises":""}},"OnlyImplicitAccountCreationAllowed":{"name":"OnlyImplicitAccountCreationAllowed","subtypes":[],"props":{"account_id":""}},"PrepareError":{"name":"PrepareError","subtypes":["Serialization","Deserialization","InternalMemoryDeclared","GasInstrumentation","StackHeightInstrumentation","Instantiate","Memory","TooManyFunctions","TooManyLocals"],"props":{}},"ProhibitedInView":{"name":"ProhibitedInView","subtypes":[],"props":{"method_name":""}},"ReceiptSizeExceeded":{"name":"ReceiptSizeExceeded","subtypes":[],"props":{"limit":"","size":""}},"ReceiptValidationError":{"name":"ReceiptValidationError","subtypes":["InvalidPredecessorId","InvalidReceiverId","InvalidSignerId","InvalidDataReceiverId","ReturnedValueLengthExceeded","NumberInputDataDependenciesExceeded","ActionsValidation","ReceiptSizeExceeded"],"props":{}},"ReceiverMismatch":{"name":"ReceiverMismatch","subtypes":[],"props":{"ak_receiver":"","tx_receiver":""}},"RequiresFullAccess":{"name":"RequiresFullAccess","subtypes":[],"props":{}},"ReturnedValueLengthExceeded":{"name":"ReturnedValueLengthExceeded","subtypes":[],"props":{"length":"","limit":""}},"Serialization":{"name":"Serialization","subtypes":[],"props":{}},"ShardCongested":{"name":"ShardCongested","subtypes":[],"props":{"congestion_level":"","shard_id":""}},"ShardStuck":{"name":"ShardStuck","subtypes":[],"props":{"missed_chunks":"","shard_id":""}},"SignerDoesNotExist":{"name":"SignerDoesNotExist","subtypes":[],"props":{"signer_id":""}},"StackHeightInstrumentation":{"name":"StackHeightInstrumentation","subtypes":[],"props":{}},"StackOverflow":{"name":"StackOverflow","subtypes":[],"props":{}},"TooManyFunctions":{"name":"TooManyFunctions","subtypes":[],"props":{}},"TooManyLocals":{"name":"TooManyLocals","subtypes":[],"props":{}},"TotalLogLengthExceeded":{"name":"TotalLogLengthExceeded","subtypes":[],"props":{"length":"","limit":""}},"TotalNumberOfActionsExceeded":{"name":"TotalNumberOfActionsExceeded","subtypes":[],"props":{"limit":"","total_number_of_actions":""}},"TotalPrepaidGasExceeded":{"name":"TotalPrepaidGasExceeded","subtypes":[],"props":{"limit":"","total_prepaid_gas":""}},"TransactionSizeExceeded":{"name":"TransactionSizeExceeded","subtypes":[],"props":{"limit":"","size":""}},"TriesToStake":{"name":"TriesToStake","subtypes":[],"props":{"account_id":"","balance":"","locked":"","stake":""}},"TriesToUnstake":{"name":"TriesToUnstake","subtypes":[],"props":{"account_id":""}},"TxExecutionError":{"name":"TxExecutionError","subtypes":["ActionError","InvalidTxError"],"props":{}},"Unreachable":{"name":"Unreachable","subtypes":[],"props":{}}
78,"UnsuitableStakingKey":{"name":"UnsuitableStakingKey","subtypes":[],"props":{"public_key":""}},"UnsupportedProtocolFeature":{"name":"UnsupportedProtocolFeature","subtypes":[],"props":{"protocol_feature":"","version":""}},"ValueLengthExceeded":{"name":"ValueLengthExceeded","subtypes":[],"props":{"length":"","limit":""}},"WasmTrap":{"name":"WasmTrap","subtypes":["Unreachable","IncorrectCallIndirectSignature","MemoryOutOfBounds","CallIndirectOOB","IllegalArithmetic","MisalignedAtomicAccess","IndirectCallToNull","StackOverflow","GenericTrap"],"props":{}},"WasmerCompileError":{"name":"WasmerCompileError","subtypes":[],"props":{"msg":""}},"Closed":{"name":"Closed","subtypes":[],"props":{}},"ServerError":{"name":"ServerError","subtypes":["TxExecutionError","Timeout","Closed"],"props":{}},"Timeout":{"name":"Timeout","subtypes":[],"props":{}}}}')},69379:e=>{"use strict";e.exports=JSON.parse('{"GasLimitExceeded":"Exceeded the maximum amount of gas allowed to burn per contract","MethodEmptyName":"Method name is empty","WasmerCompileError":"Wasmer compilation error: {{msg}}","GuestPanic":"Smart contract panicked: {{panic_msg}}","Memory":"Error creating Wasm memory","GasExceeded":"Exceeded the prepaid gas","MethodUTF8Error":"Method name is not valid UTF8 string","BadUTF16":"String encoding is bad UTF-16 sequence","WasmTrap":"WebAssembly trap: {{msg}}","GasInstrumentation":"Gas instrumentation failed or contract has denied instructions.","InvalidPromiseIndex":"{{promise_idx}} does not correspond to existing promises","InvalidPromiseResultIndex":"Accessed invalid promise result index: {{result_idx}}","Deserialization":"Error happened while deserializing the module","MethodNotFound":"Contract method is not found","InvalidRegisterId":"Accessed invalid register id: {{register_id}}","InvalidReceiptIndex":"VM Logic returned an invalid receipt index: {{receipt_index}}","EmptyMethodName":"Method name is empty in contract call","CannotReturnJointPromise":"Returning joint promise is currently prohibited","StackHeightInstrumentation":"Stack instrumentation failed","CodeDoesNotExist":"Cannot find contract code for account {{account_id}}","MethodInvalidSignature":"Invalid method signature","IntegerOverflow":"Integer overflow happened during contract execution","MemoryAccessViolation":"MemoryAccessViolation","InvalidIteratorIndex":"Iterator index {{iterator_index}} does not exist","IteratorWasInvalidated":"Iterator {{iterator_index}} was invalidated after its creation by performing a mutable operation on trie","InvalidAccountId":"VM Logic returned an invalid account id","Serialization":"Error happened while serializing the module","CannotAppendActionToJointPromise":"Actions can only be appended to non-joint promise.","InternalMemoryDeclared":"Internal memory declaration has been found in the module","Instantiate":"Error happened during instantiation","ProhibitedInView":"{{method_name}} is not allowed in view calls","InvalidMethodName":"VM Logic returned an invalid method name","BadUTF8":"String encoding is bad UTF-8 sequence","BalanceExceeded":"Exceeded the account balance","LinkError":"Wasm contract link error: {{msg}}","InvalidPublicKey":"VM Logic provided an invalid public key","ActorNoPermission":"Actor {{actor_id}} doesn\'t have permission to account {{account_id}} to complete the action","LackBalanceForState":"The account {{account_id}} wouldn\'t have enough balance to cover storage, required to have {{amount}} yoctoNEAR more","ReceiverMismatch":"Wrong AccessKey used for transaction: transaction is sent to receiver_id={{tx_receiver}}, but is signed with function call access key that restricted to only use with receiver_id={{ak_receiver}}. Either change receiver_id in your transaction or switch to use a FullAccessKey.","CostOverflow":"Transaction gas or balance cost is too high","InvalidSignature":"Transaction is not signed with the given public key","AccessKeyNotFound":"Signer \\"{{account_id}}\\" doesn\'t have access key with the given public_key {{public_key}}","NotEnoughBalance":"Sender {{signer_id}} does not have enough balance {{#formatNear}}{{balance}}{{/formatNear}} for operation costing {{#formatNear}}{{cost}}{{/formatNear}}
78","NotEnoughAllowance":"Access Key {account_id}:{public_key} does not have enough balance {{#formatNear}}{{allowance}}{{/formatNear}} for transaction costing {{#formatNear}}{{cost}}{{/formatNear}}","Expired":"Transaction has expired","DeleteAccountStaking":"Account {{account_id}} is staking and can not be deleted","SignerDoesNotExist":"Signer {{signer_id}} does not exist","TriesToStake":"Account {{account_id}} tried to stake {{#formatNear}}{{stake}}{{/formatNear}}, but has staked {{#formatNear}}{{locked}}{{/formatNear}} and only has {{#formatNear}}{{balance}}{{/formatNear}}","AddKeyAlreadyExists":"The public key {{public_key}} is already used for an existing access key","InvalidSigner":"Invalid signer account ID {{signer_id}} according to requirements","CreateAccountNotAllowed":"The new account_id {{account_id}} can\'t be created by {{predecessor_id}}","RequiresFullAccess":"The transaction contains more then one action, but it was signed with an access key which allows transaction to apply only one specific action. To apply more then one actions TX must be signed with a full access key","TriesToUnstake":"Account {{account_id}} is not yet staked, but tried to unstake","InvalidNonce":"Transaction nonce {{tx_nonce}} must be larger than nonce of the used access key {{ak_nonce}}","AccountAlreadyExists":"Can\'t create a new account {{account_id}}, because it already exists","InvalidChain":"Transaction parent block hash doesn\'t belong to the current chain","AccountDoesNotExist":"Can\'t complete the action because account {{account_id}} doesn\'t exist","AccessKeyDoesNotExist":"Can\'t complete the action because access key {{public_key}} doesn\'t exist","MethodNameMismatch":"Transaction method name {{method_name}} isn\'t allowed by the access key","DeleteAccountHasRent":"Account {{account_id}} can\'t be deleted. It has {{#formatNear}}{{balance}}{{/formatNear}}, which is enough to cover the rent","DeleteAccountHasEnoughBalance":"Account {{account_id}} can\'t be deleted. It has {{#formatNear}}{{balance}}{{/formatNear}}, which is enough to cover it\'s storage","InvalidReceiver":"Invalid receiver account ID {{receiver_id}} according to requirements","DeleteKeyDoesNotExist":"Account {{account_id}} tries to remove an access key that doesn\'t exist","Timeout":"Timeout exceeded","Closed":"Connection closed","ShardCongested":"Shard {{shard_id}} rejected the transaction due to congestion level {{congestion_level}}, try again later","ShardStuck":"Shard {{shard_id}} rejected the transaction because it missed {{missed_chunks}} chunks and needs to recover before accepting new transactions, try again later"}')},9052:e=>{"use strict";e.exports=JSON.parse('{"schema":{"AccessKeyNotFound":{"name":"AccessKeyNotFound","subtypes":[],"props":{"account_id":"","public_key":""}},"AccountAlreadyExists":{"name":"AccountAlreadyExists","subtypes":[],"props":{"account_id":""}},"AccountDoesNotExist":{"name":"AccountDoesNotExist","subtypes":[],"props":{"account_id":""}},"ActionError":{"name":"ActionError","subtypes":["AccountAlreadyExists","AccountDoesNotExist","CreateAccountOnlyByRegistrar","CreateAccountNotAllowed","ActorNoPermission","DeleteKeyDoesNotExist","AddKeyAlreadyExists","DeleteAccountStaking","LackBalanceForState","TriesToUnstake","TriesToStake","InsufficientStake","FunctionCallError","NewReceiptValidationError","OnlyImplicitAccountCreationAllowed","DeleteAccountWithLargeState","DelegateActionInvalidSignature","DelegateActionSenderDoesNotMatchTxReceiver","DelegateActionExpired","DelegateActionAccessKeyError","DelegateActionInvalidNonce","DelegateActionNonceTooLarge"],"props":{"index":""}},"ActionsValidationError":{"name":"ActionsValidationError","subtypes":["DeleteActionMustBeFinal","TotalPrepaidGasExceeded","TotalNumberOfActionsExceeded","AddKeyMethodNamesNumberOfBytesExceeded","AddKeyMethodNameLengthExceeded","IntegerOverflow","InvalidAccountId","ContractSizeExceeded","FunctionCallMethodNameLengthExceeded","FunctionCallArgumentsLengthExceeded","UnsuitableStakingKey","FunctionCallZeroAttachedGas","DelegateActionMustBeOnlyOne","UnsupportedProtocolFeature"],"props":{}},"ActorNoPermission":{"name":"ActorNoPermission","subtypes":[],"props":{"account_id":"","actor_id":""}},"AddKeyAlreadyExists":{"name":"AddKeyAlreadyExists","subtypes":[],"props":{"account_id":"","public_key":""}},"AddKeyMethodNameLengthExceeded":{"name":"AddKeyMethodNameLengthExceeded","subtypes":[],"props":{"length":"","limit":""}},"AddKeyMethodNamesNumberOfBytesExceeded":{"name":"AddKeyMethodNamesNumberOfBytesExceeded","subtypes":[],"props":{"limit":"","total_number_of_bytes":""}},"AltBn128InvalidInput":{"name":"AltBn128InvalidInput","subtypes":[],"props":{"msg":""}}
78,"BadUTF16":{"name":"BadUTF16","subtypes":[],"props":{}},"BadUTF8":{"name":"BadUTF8","subtypes":[],"props":{}},"BalanceExceeded":{"name":"BalanceExceeded","subtypes":[],"props":{}},"BalanceMismatchError":{"name":"BalanceMismatchError","subtypes":[],"props":{"final_accounts_balance":"","final_postponed_receipts_balance":"","forwarded_buffered_receipts_balance":"","incoming_receipts_balance":"","incoming_validator_rewards":"","initial_accounts_balance":"","initial_postponed_receipts_balance":"","new_buffered_receipts_balance":"","new_delayed_receipts_balance":"","other_burnt_amount":"","outgoing_receipts_balance":"","processed_delayed_receipts_balance":"","slashed_burnt_amount":"","tx_burnt_amount":""}},"CallIndirectOOB":{"name":"CallIndirectOOB","subtypes":[],"props":{}},"CannotAppendActionToJointPromise":{"name":"CannotAppendActionToJointPromise","subtypes":[],"props":{}},"CannotReturnJointPromise":{"name":"CannotReturnJointPromise","subtypes":[],"props":{}},"CodeDoesNotExist":{"name":"CodeDoesNotExist","subtypes":[],"props":{"account_id":""}},"CompilationError":{"name":"CompilationError","subtypes":["CodeDoesNotExist","PrepareError","WasmerCompileError"],"props":{}},"ContractSizeExceeded":{"name":"ContractSizeExceeded","subtypes":[],"props":{"limit":"","size":""}},"CostOverflow":{"name":"CostOverflow","subtypes":[],"props":{}},"CreateAccountNotAllowed":{"name":"CreateAccountNotAllowed","subtypes":[],"props":{"account_id":"","predecessor_id":""}},"CreateAccountOnlyByRegistrar":{"name":"CreateAccountOnlyByRegistrar","subtypes":[],"props":{"account_id":"","predecessor_id":"","registrar_account_id":""}},"DelegateActionExpired":{"name":"DelegateActionExpired","subtypes":[],"props":{}},"DelegateActionInvalidNonce":{"name":"DelegateActionInvalidNonce","subtypes":[],"props":{"ak_nonce":"","delegate_nonce":""}},"DelegateActionInvalidSignature":{"name":"DelegateActionInvalidSignature","subtypes":[],"props":{}},"DelegateActionMustBeOnlyOne":{"name":"DelegateActionMustBeOnlyOne","subtypes":[],"props":{}},"DelegateActionNonceTooLarge":{"name":"DelegateActionNonceTooLarge","subtypes":[],"props":{"delegate_nonce":"","upper_bound":""}},"DelegateActionSenderDoesNotMatchTxReceiver":{"name":"DelegateActionSenderDoesNotMatchTxReceiver","subtypes":[],"props":{"receiver_id":"","sender_id":""}},"DeleteAccountStaking":{"name":"DeleteAccountStaking","subtypes":[],"props":{"account_id":""}},"DeleteAccountWithLargeState":{"name":"DeleteAccountWithLargeState","subtypes":[],"props":{"account_id":""}},"DeleteActionMustBeFinal":{"name":"DeleteActionMustBeFinal","subtypes":[],"props":{}},"DeleteKeyDoesNotExist":{"name":"DeleteKeyDoesNotExist","subtypes":[],"props":{"account_id":"","public_key":""}},"DepositWithFunctionCall":{"name":"DepositWithFunctionCall","subtypes":[],"props":{}},"Deprecated":{"name":"Deprecated","subtypes":[],"props":{"method_name":""}},"Deserialization":{"name":"Deserialization","subtypes":[],"props":{}},"ECRecoverError":{"name":"ECRecoverError","subtypes":[],"props":{"msg":""}},"Ed25519VerifyInvalidInput":{"name":"Ed25519VerifyInvalidInput","subtypes":[],"props":{"msg":""}},"EmptyMethodName":{"name":"EmptyMethodName","subtypes":[],"props":{}},"Expired":{"name":"Expired","subtypes":[],"props":{}},"FunctionCallArgumentsLengthExceeded":{"name":"FunctionCallArgumentsLengthExceeded","subtypes":[],"props":{"length":"","limit":""}},"FunctionCallMethodNameLengthExceeded":{"name":"FunctionCallMethodNameLengthExceeded","subtypes":[],"props":{"length":"","limit":""}},"FunctionCallZeroAttachedGas":{"name":"FunctionCallZeroAttachedGas","subtypes":[],"props":{}},"GasExceeded":{"name":"GasExceeded","subtypes":[],"props":{}},"GasInstrumentation":{"name":"GasInstrumentation","subtypes":[],"props":{}},"GasLimitExceeded":{"name":"GasLimitExceeded","subtypes":[],"props":{}},"GenericTrap":{"name":"GenericTrap","subtypes":[],"props":{}},"GuestPanic":{"name":"GuestPanic","subtypes":[],"props":{"panic_msg":""}},"HostError":{"name":"HostError","subtypes":["BadUTF16","BadUTF8","GasExceeded","GasLimitExceeded","BalanceExceeded","EmptyMethodName","GuestPanic","IntegerOverflow","InvalidPromiseIndex","CannotAppendActionToJointPromise","CannotReturnJointPromise","InvalidPromiseResultIndex","InvalidRegisterId","IteratorWasInvalidated","MemoryAccessViolation","InvalidReceiptIndex","InvalidIteratorIndex","InvalidAccountId","InvalidMethodName","InvalidPublicKey","ProhibitedInView","NumberOfLogsExceeded","KeyLengthExceeded","ValueLengthExceeded","TotalLogLengthExceeded","NumberPromisesExceeded","NumberInputDataDependenciesExceeded","ReturnedValueLengthExceeded","ContractSizeExceeded","Deprecated","ECRecover
78Error","AltBn128InvalidInput","Ed25519VerifyInvalidInput"],"props":{}},"IllegalArithmetic":{"name":"IllegalArithmetic","subtypes":[],"props":{}},"IncorrectCallIndirectSignature":{"name":"IncorrectCallIndirectSignature","subtypes":[],"props":{}},"IndirectCallToNull":{"name":"IndirectCallToNull","subtypes":[],"props":{}},"Instantiate":{"name":"Instantiate","subtypes":[],"props":{}},"InsufficientStake":{"name":"InsufficientStake","subtypes":[],"props":{"account_id":"","minimum_stake":"","stake":""}},"IntegerOverflow":{"name":"IntegerOverflow","subtypes":[],"props":{}},"InternalMemoryDeclared":{"name":"InternalMemoryDeclared","subtypes":[],"props":{}},"InvalidAccessKeyError":{"name":"InvalidAccessKeyError","subtypes":["AccessKeyNotFound","ReceiverMismatch","MethodNameMismatch","RequiresFullAccess","NotEnoughAllowance","DepositWithFunctionCall"],"props":{}},"InvalidAccountId":{"name":"InvalidAccountId","subtypes":[],"props":{}},"InvalidChain":{"name":"InvalidChain","subtypes":[],"props":{}},"InvalidDataReceiverId":{"name":"InvalidDataReceiverId","subtypes":[],"props":{"account_id":""}},"InvalidIteratorIndex":{"name":"InvalidIteratorIndex","subtypes":[],"props":{"iterator_index":""}}
78,"InvalidMethodName":{"name":"InvalidMethodName","subtypes":[],"props":{}},"InvalidNonce":{"name":"InvalidNonce","subtypes":[],"props":{"ak_nonce":"","tx_nonce":""}},"InvalidPredecessorId":{"name":"InvalidPredecessorId","subtypes":[],"props":{"account_id":""}},"InvalidPromiseIndex":{"name":"InvalidPromiseIndex","subtypes":[],"props":{"promise_idx":""}},"InvalidPromiseResultIndex":{"name":"InvalidPromiseResultIndex","subtypes":[],"props":{"result_idx":""}},"InvalidPublicKey":{"name":"InvalidPublicKey","subtypes":[],"props":{}},"InvalidReceiptIndex":{"name":"InvalidReceiptIndex","subtypes":[],"props":{"receipt_index":""}},"InvalidReceiverId":{"name":"InvalidReceiverId","subtypes":[],"props":{"account_id":""}},"InvalidRegisterId":{"name":"InvalidRegisterId","subtypes":[],"props":{"register_id":""}},"InvalidSignature":{"name":"InvalidSignature","subtypes":[],"props":{}},"InvalidSignerId":{"name":"InvalidSignerId","subtypes":[],"props":{"account_id":""}},"InvalidTxError":{"name":"InvalidTxError","subtypes":["InvalidAccessKeyError","InvalidSignerId","SignerDoesNotExist","InvalidNonce","NonceTooLarge","InvalidReceiverId","InvalidSignature","NotEnoughBalance","LackBalanceForState","CostOverflow","InvalidChain","Expired","ActionsValidation","TransactionSizeExceeded","StorageError","ShardCongested","ShardStuck"],"props":{}},"IteratorWasInvalidated":{"name":"IteratorWasInvalidated","subtypes":[],"props":{"iterator_index":""}}
78,"KeyLengthExceeded":{"name":"KeyLengthExceeded","subtypes":[],"props":{"length":"","limit":""}},"LackBalanceForState":{"name":"LackBalanceForState","subtypes":[],"props":{"account_id":"","amount":""}},"Memory":{"name":"Memory","subtypes":[],"props":{}},"MemoryAccessViolation":{"name":"MemoryAccessViolation","subtypes":[],"props":{}},"MemoryOutOfBounds":{"name":"MemoryOutOfBounds","subtypes":[],"props":{}},"MethodEmptyName":{"name":"MethodEmptyName","subtypes":[],"props":{}},"MethodInvalidSignature":{"name":"MethodInvalidSignature","subtypes":[],"props":{}},"MethodNameMismatch":{"name":"MethodNameMismatch","subtypes":[],"props":{"method_name":""}},"MethodNotFound":{"name":"MethodNotFound","subtypes":[],"props":{}},"MethodResolveError":{"name":"MethodResolveError","subtypes":["MethodEmptyName","MethodNotFound","MethodInvalidSignature"],"props":{}},"MisalignedAtomicAccess":{"name":"MisalignedAtomicAccess","subtypes":[],"props":{}},"NonceTooLarge":{"name":"NonceTooLarge","subtypes":[],"props":{"tx_nonce":"","upper_bound":""}},"NotEnoughAllowance":{"name":"NotEnoughAllowance","subtypes":[],"props":{"account_id":"","allowance":"","cost":"","public_key":""}},"NotEnoughBalance":{"name":"NotEnoughBalance","subtypes":[],"props":{"balance":"","cost":"","signer_id":""}},"NumberInputDataDependenciesExceeded":{"name":"NumberInputDataDependenciesExceeded","subtypes":[],"props":{"limit":"","number_of_input_data_dependencies":""}},"NumberOfLogsExceeded":{"name":"NumberOfLogsExceeded","subtypes":[],"props":{"limit":""}},"NumberPromisesExceeded":{"name":"NumberPromisesExceeded","subtypes":[],"props":{"limit":"","number_of_promises":""}},"OnlyImplicitAccountCreationAllowed":{"name":"OnlyImplicitAccountCreationAllowed","subtypes":[],"props":{"account_id":""}},"PrepareError":{"name":"PrepareError","subtypes":["Serialization","Deserialization","InternalMemoryDeclared","GasInstrumentation","StackHeightInstrumentation","Instantiate","Memory","TooManyFunctions","TooManyLocals"],"props":{}},"ProhibitedInView":{"name":"ProhibitedInView","subtypes":[],"props":{"method_name":""}},"ReceiptSizeExceeded":{"name":"ReceiptSizeExceeded","subtypes":[],"props":{"limit":"","size":""}},"ReceiptValidationError":{"name":"ReceiptValidationError","subtypes":["InvalidPredecessorId","InvalidReceiverId","InvalidSignerId","InvalidDataReceiverId","ReturnedValueLengthExceeded","NumberInputDataDependenciesExceeded","ActionsValidation","ReceiptSizeExceeded"],"props":{}},"ReceiverMismatch":{"name":"ReceiverMismatch","subtypes":[],"props":{"ak_receiver":"","tx_receiver":""}},"RequiresFullAccess":{"name":"RequiresFullAccess","subtypes":[],"props":{}},"ReturnedValueLengthExceeded":{"name":"ReturnedValueLengthExceeded","subtypes":[],"props":{"length":"","limit":""}},"Serialization":{"name":"Serialization","subtypes":[],"props":{}},"ShardCongested":{"name":"ShardCongested","subtypes":[],"props":{"congestion_level":"","shard_id":""}},"ShardStuck":{"name":"ShardStuck","subtypes":[],"props":{"missed_chunks":"","shard_id":""}},"SignerDoesNotExist":{"name":"SignerDoesNotExist","subtypes":[],"props":{"signer_id":""}},"StackHeightInstrumentation":{"name":"StackHeightInstrumentation","subtypes":[],"props":{}},"StackOverflow":{"name":"StackOverflow","subtypes":[],"props":{}},"TooManyFunctions":{"name":"TooManyFunctions","subtypes":[],"props":{}},"TooManyLocals":{"name":"TooManyLocals","subtypes":[],"props":{}},"TotalLogLengthExceeded":{"name":"TotalLogLengthExceeded","subtypes":[],"props":{"length":"","limit":""}},"TotalNumberOfActionsExceeded":{"name":"TotalNumberOfActionsExceeded","subtypes":[],"props":{"limit":"","total_number_of_actions":""}},"TotalPrepaidGasExceeded":{"name":"TotalPrepaidGasExceeded","subtypes":[],"props":{"limit":"","total_prepaid_gas":""}},"TransactionSizeExceeded":{"name":"TransactionSizeExceeded","subtypes":[],"props":{"limit":"","size":""}},"TriesToStake":{"name":"TriesToStake","subtypes":[],"props":{"account_id":"","balance":"","locked":"","stake":""}},"TriesToUnstake":{"name":"TriesToUnstake","subtypes":[],"props":{"account_id":""}},"TxExecutionError":{"name":"TxExecutionError","subtypes":["ActionError","InvalidTxError"],"props":{}},"Unreachable":{"name":"Unreachable","subtypes":[],"props":{}}
78,"UnsuitableStakingKey":{"name":"UnsuitableStakingKey","subtypes":[],"props":{"public_key":""}},"UnsupportedProtocolFeature":{"name":"UnsupportedProtocolFeature","subtypes":[],"props":{"protocol_feature":"","version":""}},"ValueLengthExceeded":{"name":"ValueLengthExceeded","subtypes":[],"props":{"length":"","limit":""}},"WasmTrap":{"name":"WasmTrap","subtypes":["Unreachable","IncorrectCallIndirectSignature","MemoryOutOfBounds","CallIndirectOOB","IllegalArithmetic","MisalignedAtomicAccess","IndirectCallToNull","StackOverflow","GenericTrap"],"props":{}},"WasmerCompileError":{"name":"WasmerCompileError","subtypes":[],"props":{"msg":""}},"Closed":{"name":"Closed","subtypes":[],"props":{}},"ServerError":{"name":"ServerError","subtypes":["TxExecutionError","Timeout","Closed"],"props":{}},"Timeout":{"name":"Timeout","subtypes":[],"props":{}}}}')},30789:e=>{"use strict";e.exports=JSON.parse('{"GasLimitExceeded":"Exceeded the maximum amount of gas allowed to burn per contract","MethodEmptyName":"Method name is empty","WasmerCompileError":"Wasmer compilation error: {{msg}}","GuestPanic":"Smart contract panicked: {{panic_msg}}","Memory":"Error creating Wasm memory","GasExceeded":"Exceeded the prepaid gas","MethodUTF8Error":"Method name is not valid UTF8 string","BadUTF16":"String encoding is bad UTF-16 sequence","WasmTrap":"WebAssembly trap: {{msg}}","GasInstrumentation":"Gas instrumentation failed or contract has denied instructions.","InvalidPromiseIndex":"{{promise_idx}} does not correspond to existing promises","InvalidPromiseResultIndex":"Accessed invalid promise result index: {{result_idx}}","Deserialization":"Error happened while deserializing the module","MethodNotFound":"Contract method is not found","InvalidRegisterId":"Accessed invalid register id: {{register_id}}","InvalidReceiptIndex":"VM Logic returned an invalid receipt index: {{receipt_index}}","EmptyMethodName":"Method name is empty in contract call","CannotReturnJointPromise":"Returning joint promise is currently prohibited","StackHeightInstrumentation":"Stack instrumentation failed","CodeDoesNotExist":"Cannot find contract code for account {{account_id}}","MethodInvalidSignature":"Invalid method signature","IntegerOverflow":"Integer overflow happened during contract execution","MemoryAccessViolation":"MemoryAccessViolation","InvalidIteratorIndex":"Iterator index {{iterator_index}} does not exist","IteratorWasInvalidated":"Iterator {{iterator_index}} was invalidated after its creation by performing a mutable operation on trie","InvalidAccountId":"VM Logic returned an invalid account id","Serialization":"Error happened while serializing the module","CannotAppendActionToJointPromise":"Actions can only be appended to non-joint promise.","InternalMemoryDeclared":"Internal memory declaration has been found in the module","Instantiate":"Error happened during instantiation","ProhibitedInView":"{{method_name}} is not allowed in view calls","InvalidMethodName":"VM Logic returned an invalid method name","BadUTF8":"String encoding is bad UTF-8 sequence","BalanceExceeded":"Exceeded the account balance","LinkError":"Wasm contract link error: {{msg}}","InvalidPublicKey":"VM Logic provided an invalid public key","ActorNoPermission":"Actor {{actor_id}} doesn\'t have permission to account {{account_id}} to complete the action","LackBalanceForState":"The account {{account_id}} wouldn\'t have enough balance to cover storage, required to have {{amount}} yoctoNEAR more","ReceiverMismatch":"Wrong AccessKey used for transaction: transaction is sent to receiver_id={{tx_receiver}}, but is signed with function call access key that restricted to only use with receiver_id={{ak_receiver}}. Either change receiver_id in your transaction or switch to use a FullAccessKey.","CostOverflow":"Transaction gas or balance cost is too high","InvalidSignature":"Transaction is not signed with the given public key","AccessKeyNotFound":"Signer \\"{{account_id}}\\" doesn\'t have access key with the given public_key {{public_key}}","NotEnoughBalance":"Sender {{signer_id}} does not have enough balance {{#formatNear}}{{balance}}{{/formatNear}} for operation costing {{#formatNear}}{{cost}}{{/formatNear}}
78","NotEnoughAllowance":"Access Key {account_id}:{public_key} does not have enough balance {{#formatNear}}{{allowance}}{{/formatNear}} for transaction costing {{#formatNear}}{{cost}}{{/formatNear}}","Expired":"Transaction has expired","DeleteAccountStaking":"Account {{account_id}} is staking and can not be deleted","SignerDoesNotExist":"Signer {{signer_id}} does not exist","TriesToStake":"Account {{account_id}} tried to stake {{#formatNear}}{{stake}}{{/formatNear}}, but has staked {{#formatNear}}{{locked}}{{/formatNear}} and only has {{#formatNear}}{{balance}}{{/formatNear}}","AddKeyAlreadyExists":"The public key {{public_key}} is already used for an existing access key","InvalidSigner":"Invalid signer account ID {{signer_id}} according to requirements","CreateAccountNotAllowed":"The new account_id {{account_id}} can\'t be created by {{predecessor_id}}","RequiresFullAccess":"The transaction contains more then one action, but it was signed with an access key which allows transaction to apply only one specific action. To apply more then one actions TX must be signed with a full access key","TriesToUnstake":"Account {{account_id}} is not yet staked, but tried to unstake","InvalidNonce":"Transaction nonce {{tx_nonce}} must be larger than nonce of the used access key {{ak_nonce}}","AccountAlreadyExists":"Can\'t create a new account {{account_id}}, because it already exists","InvalidChain":"Transaction parent block hash doesn\'t belong to the current chain","AccountDoesNotExist":"Can\'t complete the action because account {{account_id}} doesn\'t exist","AccessKeyDoesNotExist":"Can\'t complete the action because access key {{public_key}} doesn\'t exist","MethodNameMismatch":"Transaction method name {{method_name}} isn\'t allowed by the access key","DeleteAccountHasRent":"Account {{account_id}} can\'t be deleted. It has {{#formatNear}}{{balance}}{{/formatNear}}, which is enough to cover the rent","DeleteAccountHasEnoughBalance":"Account {{account_id}} can\'t be deleted. It has {{#formatNear}}{{balance}}{{/formatNear}}, which is enough to cover it\'s storage","InvalidReceiver":"Invalid receiver account ID {{receiver_id}} according to requirements","DeleteKeyDoesNotExist":"Account {{account_id}} tries to remove an access key that doesn\'t exist","Timeout":"Timeout exceeded","Closed":"Connection closed","ShardCongested":"Shard {{shard_id}} rejected the transaction due to congestion level {{congestion_level}}, try again later","ShardStuck":"Shard {{shard_id}} rejected the transaction because it missed {{missed_chunks}} chunks and needs to recover before accepting new transactions, try again later"}')},16450:e=>{"use strict";e.exports=JSON.parse('{"schema":{"AccessKeyNotFound":{"name":"AccessKeyNotFound","subtypes":[],"props":{"account_id":"","public_key":""}},"AccountAlreadyExists":{"name":"AccountAlreadyExists","subtypes":[],"props":{"account_id":""}},"AccountDoesNotExist":{"name":"AccountDoesNotExist","subtypes":[],"props":{"account_id":""}},"ActionError":{"name":"ActionError","subtypes":["AccountAlreadyExists","AccountDoesNotExist","CreateAccountOnlyByRegistrar","CreateAccountNotAllowed","ActorNoPermission","DeleteKeyDoesNotExist","AddKeyAlreadyExists","DeleteAccountStaking","LackBalanceForState","TriesToUnstake","TriesToStake","InsufficientStake","FunctionCallError","NewReceiptValidationError","OnlyImplicitAccountCreationAllowed","DeleteAccountWithLargeState","DelegateActionInvalidSignature","DelegateActionSenderDoesNotMatchTxReceiver","DelegateActionExpired","DelegateActionAccessKeyError","DelegateActionInvalidNonce","DelegateActionNonceTooLarge"],"props":{"index":""}},"ActionsValidationError":{"name":"ActionsValidationError","subtypes":["DeleteActionMustBeFinal","TotalPrepaidGasExceeded","TotalNumberOfActionsExceeded","AddKeyMethodNamesNumberOfBytesExceeded","AddKeyMethodNameLengthExceeded","IntegerOverflow","InvalidAccountId","ContractSizeExceeded","FunctionCallMethodNameLengthExceeded","FunctionCallArgumentsLengthExceeded","UnsuitableStakingKey","FunctionCallZeroAttachedGas","DelegateActionMustBeOnlyOne","UnsupportedProtocolFeature"],"props":{}},"ActorNoPermission":{"name":"ActorNoPermission","subtypes":[],"props":{"account_id":"","actor_id":""}},"AddKeyAlreadyExists":{"name":"AddKeyAlreadyExists","subtypes":[],"props":{"account_id":"","public_key":""}},"AddKeyMethodNameLengthExceeded":{"name":"AddKeyMethodNameLengthExceeded","subtypes":[],"props":{"length":"","limit":""}},"AddKeyMethodNamesNumberOfBytesExceeded":{"name":"AddKeyMethodNamesNumberOfBytesExceeded","subtypes":[],"props":{"limit":"","total_number_of_bytes":""}},"AltBn128InvalidInput":{"name":"AltBn128InvalidInput","subtypes":[],"props":{"msg":""}}
78,"BadUTF16":{"name":"BadUTF16","subtypes":[],"props":{}},"BadUTF8":{"name":"BadUTF8","subtypes":[],"props":{}},"BalanceExceeded":{"name":"BalanceExceeded","subtypes":[],"props":{}},"BalanceMismatchError":{"name":"BalanceMismatchError","subtypes":[],"props":{"final_accounts_balance":"","final_postponed_receipts_balance":"","forwarded_buffered_receipts_balance":"","incoming_receipts_balance":"","incoming_validator_rewards":"","initial_accounts_balance":"","initial_postponed_receipts_balance":"","new_buffered_receipts_balance":"","new_delayed_receipts_balance":"","other_burnt_amount":"","outgoing_receipts_balance":"","processed_delayed_receipts_balance":"","slashed_burnt_amount":"","tx_burnt_amount":""}},"CallIndirectOOB":{"name":"CallIndirectOOB","subtypes":[],"props":{}},"CannotAppendActionToJointPromise":{"name":"CannotAppendActionToJointPromise","subtypes":[],"props":{}},"CannotReturnJointPromise":{"name":"CannotReturnJointPromise","subtypes":[],"props":{}},"CodeDoesNotExist":{"name":"CodeDoesNotExist","subtypes":[],"props":{"account_id":""}},"CompilationError":{"name":"CompilationError","subtypes":["CodeDoesNotExist","PrepareError","WasmerCompileError"],"props":{}},"ContractSizeExceeded":{"name":"ContractSizeExceeded","subtypes":[],"props":{"limit":"","size":""}},"CostOverflow":{"name":"CostOverflow","subtypes":[],"props":{}},"CreateAccountNotAllowed":{"name":"CreateAccountNotAllowed","subtypes":[],"props":{"account_id":"","predecessor_id":""}},"CreateAccountOnlyByRegistrar":{"name":"CreateAccountOnlyByRegistrar","subtypes":[],"props":{"account_id":"","predecessor_id":"","registrar_account_id":""}},"DelegateActionExpired":{"name":"DelegateActionExpired","subtypes":[],"props":{}},"DelegateActionInvalidNonce":{"name":"DelegateActionInvalidNonce","subtypes":[],"props":{"ak_nonce":"","delegate_nonce":""}},"DelegateActionInvalidSignature":{"name":"DelegateActionInvalidSignature","subtypes":[],"props":{}},"DelegateActionMustBeOnlyOne":{"name":"DelegateActionMustBeOnlyOne","subtypes":[],"props":{}},"DelegateActionNonceTooLarge":{"name":"DelegateActionNonceTooLarge","subtypes":[],"props":{"delegate_nonce":"","upper_bound":""}},"DelegateActionSenderDoesNotMatchTxReceiver":{"name":"DelegateActionSenderDoesNotMatchTxReceiver","subtypes":[],"props":{"receiver_id":"","sender_id":""}},"DeleteAccountStaking":{"name":"DeleteAccountStaking","subtypes":[],"props":{"account_id":""}},"DeleteAccountWithLargeState":{"name":"DeleteAccountWithLargeState","subtypes":[],"props":{"account_id":""}},"DeleteActionMustBeFinal":{"name":"DeleteActionMustBeFinal","subtypes":[],"props":{}},"DeleteKeyDoesNotExist":{"name":"DeleteKeyDoesNotExist","subtypes":[],"props":{"account_id":"","public_key":""}},"DepositWithFunctionCall":{"name":"DepositWithFunctionCall","subtypes":[],"props":{}},"Deprecated":{"name":"Deprecated","subtypes":[],"props":{"method_name":""}},"Deserialization":{"name":"Deserialization","subtypes":[],"props":{}},"ECRecoverError":{"name":"ECRecoverError","subtypes":[],"props":{"msg":""}},"Ed25519VerifyInvalidInput":{"name":"Ed25519VerifyInvalidInput","subtypes":[],"props":{"msg":""}},"EmptyMethodName":{"name":"EmptyMethodName","subtypes":[],"props":{}},"Expired":{"name":"Expired","subtypes":[],"props":{}},"FunctionCallArgumentsLengthExceeded":{"name":"FunctionCallArgumentsLengthExceeded","subtypes":[],"props":{"length":"","limit":""}},"FunctionCallMethodNameLengthExceeded":{"name":"FunctionCallMethodNameLengthExceeded","subtypes":[],"props":{"length":"","limit":""}},"FunctionCallZeroAttachedGas":{"name":"FunctionCallZeroAttachedGas","subtypes":[],"props":{}},"GasExceeded":{"name":"GasExceeded","subtypes":[],"props":{}},"GasInstrumentation":{"name":"GasInstrumentation","subtypes":[],"props":{}},"GasLimitExceeded":{"name":"GasLimitExceeded","subtypes":[],"props":{}},"GenericTrap":{"name":"GenericTrap","subtypes":[],"props":{}},"GuestPanic":{"name":"GuestPanic","subtypes":[],"props":{"panic_msg":""}},"HostError":{"name":"HostError","subtypes":["BadUTF16","BadUTF8","GasExceeded","GasLimitExceeded","BalanceExceeded","EmptyMethodName","GuestPanic","IntegerOverflow","InvalidPromiseIndex","CannotAppendActionToJointPromise","CannotReturnJointPromise","InvalidPromiseResultIndex","InvalidRegisterId","IteratorWasInvalidated","MemoryAccessViolation","InvalidReceiptIndex","InvalidIteratorIndex","InvalidAccountId","InvalidMethodName","InvalidPublicKey","ProhibitedInView","NumberOfLogsExceeded","KeyLengthExceeded","ValueLengthExceeded","TotalLogLengthExceeded","NumberPromisesExceeded","NumberInputDataDependenciesExceeded","ReturnedValueLengthExceeded","ContractSizeExceeded","Deprecated","ECRecover
78Error","AltBn128InvalidInput","Ed25519VerifyInvalidInput"],"props":{}},"IllegalArithmetic":{"name":"IllegalArithmetic","subtypes":[],"props":{}},"IncorrectCallIndirectSignature":{"name":"IncorrectCallIndirectSignature","subtypes":[],"props":{}},"IndirectCallToNull":{"name":"IndirectCallToNull","subtypes":[],"props":{}},"Instantiate":{"name":"Instantiate","subtypes":[],"props":{}},"InsufficientStake":{"name":"InsufficientStake","subtypes":[],"props":{"account_id":"","minimum_stake":"","stake":""}},"IntegerOverflow":{"name":"IntegerOverflow","subtypes":[],"props":{}},"InternalMemoryDeclared":{"name":"InternalMemoryDeclared","subtypes":[],"props":{}},"InvalidAccessKeyError":{"name":"InvalidAccessKeyError","subtypes":["AccessKeyNotFound","ReceiverMismatch","MethodNameMismatch","RequiresFullAccess","NotEnoughAllowance","DepositWithFunctionCall"],"props":{}},"InvalidAccountId":{"name":"InvalidAccountId","subtypes":[],"props":{}},"InvalidChain":{"name":"InvalidChain","subtypes":[],"props":{}},"InvalidDataReceiverId":{"name":"InvalidDataReceiverId","subtypes":[],"props":{"account_id":""}},"InvalidIteratorIndex":{"name":"InvalidIteratorIndex","subtypes":[],"props":{"iterator_index":""}}
78,"InvalidMethodName":{"name":"InvalidMethodName","subtypes":[],"props":{}},"InvalidNonce":{"name":"InvalidNonce","subtypes":[],"props":{"ak_nonce":"","tx_nonce":""}},"InvalidPredecessorId":{"name":"InvalidPredecessorId","subtypes":[],"props":{"account_id":""}},"InvalidPromiseIndex":{"name":"InvalidPromiseIndex","subtypes":[],"props":{"promise_idx":""}},"InvalidPromiseResultIndex":{"name":"InvalidPromiseResultIndex","subtypes":[],"props":{"result_idx":""}},"InvalidPublicKey":{"name":"InvalidPublicKey","subtypes":[],"props":{}},"InvalidReceiptIndex":{"name":"InvalidReceiptIndex","subtypes":[],"props":{"receipt_index":""}},"InvalidReceiverId":{"name":"InvalidReceiverId","subtypes":[],"props":{"account_id":""}},"InvalidRegisterId":{"name":"InvalidRegisterId","subtypes":[],"props":{"register_id":""}},"InvalidSignature":{"name":"InvalidSignature","subtypes":[],"props":{}},"InvalidSignerId":{"name":"InvalidSignerId","subtypes":[],"props":{"account_id":""}},"InvalidTxError":{"name":"InvalidTxError","subtypes":["InvalidAccessKeyError","InvalidSignerId","SignerDoesNotExist","InvalidNonce","NonceTooLarge","InvalidReceiverId","InvalidSignature","NotEnoughBalance","LackBalanceForState","CostOverflow","InvalidChain","Expired","ActionsValidation","TransactionSizeExceeded","StorageError","ShardCongested","ShardStuck"],"props":{}},"IteratorWasInvalidated":{"name":"IteratorWasInvalidated","subtypes":[],"props":{"iterator_index":""}}
78,"KeyLengthExceeded":{"name":"KeyLengthExceeded","subtypes":[],"props":{"length":"","limit":""}},"LackBalanceForState":{"name":"LackBalanceForState","subtypes":[],"props":{"account_id":"","amount":""}},"Memory":{"name":"Memory","subtypes":[],"props":{}},"MemoryAccessViolation":{"name":"MemoryAccessViolation","subtypes":[],"props":{}},"MemoryOutOfBounds":{"name":"MemoryOutOfBounds","subtypes":[],"props":{}},"MethodEmptyName":{"name":"MethodEmptyName","subtypes":[],"props":{}},"MethodInvalidSignature":{"name":"MethodInvalidSignature","subtypes":[],"props":{}},"MethodNameMismatch":{"name":"MethodNameMismatch","subtypes":[],"props":{"method_name":""}},"MethodNotFound":{"name":"MethodNotFound","subtypes":[],"props":{}},"MethodResolveError":{"name":"MethodResolveError","subtypes":["MethodEmptyName","MethodNotFound","MethodInvalidSignature"],"props":{}},"MisalignedAtomicAccess":{"name":"MisalignedAtomicAccess","subtypes":[],"props":{}},"NonceTooLarge":{"name":"NonceTooLarge","subtypes":[],"props":{"tx_nonce":"","upper_bound":""}},"NotEnoughAllowance":{"name":"NotEnoughAllowance","subtypes":[],"props":{"account_id":"","allowance":"","cost":"","public_key":""}},"NotEnoughBalance":{"name":"NotEnoughBalance","subtypes":[],"props":{"balance":"","cost":"","signer_id":""}},"NumberInputDataDependenciesExceeded":{"name":"NumberInputDataDependenciesExceeded","subtypes":[],"props":{"limit":"","number_of_input_data_dependencies":""}},"NumberOfLogsExceeded":{"name":"NumberOfLogsExceeded","subtypes":[],"props":{"limit":""}},"NumberPromisesExceeded":{"name":"NumberPromisesExceeded","subtypes":[],"props":{"limit":"","number_of_promises":""}},"OnlyImplicitAccountCreationAllowed":{"name":"OnlyImplicitAccountCreationAllowed","subtypes":[],"props":{"account_id":""}},"PrepareError":{"name":"PrepareError","subtypes":["Serialization","Deserialization","InternalMemoryDeclared","GasInstrumentation","StackHeightInstrumentation","Instantiate","Memory","TooManyFunctions","TooManyLocals"],"props":{}},"ProhibitedInView":{"name":"ProhibitedInView","subtypes":[],"props":{"method_name":""}},"ReceiptSizeExceeded":{"name":"ReceiptSizeExceeded","subtypes":[],"props":{"limit":"","size":""}},"ReceiptValidationError":{"name":"ReceiptValidationError","subtypes":["InvalidPredecessorId","InvalidReceiverId","InvalidSignerId","InvalidDataReceiverId","ReturnedValueLengthExceeded","NumberInputDataDependenciesExceeded","ActionsValidation","ReceiptSizeExceeded"],"props":{}},"ReceiverMismatch":{"name":"ReceiverMismatch","subtypes":[],"props":{"ak_receiver":"","tx_receiver":""}},"RequiresFullAccess":{"name":"RequiresFullAccess","subtypes":[],"props":{}},"ReturnedValueLengthExceeded":{"name":"ReturnedValueLengthExceeded","subtypes":[],"props":{"length":"","limit":""}},"Serialization":{"name":"Serialization","subtypes":[],"props":{}},"ShardCongested":{"name":"ShardCongested","subtypes":[],"props":{"congestion_level":"","shard_id":""}},"ShardStuck":{"name":"ShardStuck","subtypes":[],"props":{"missed_chunks":"","shard_id":""}},"SignerDoesNotExist":{"name":"SignerDoesNotExist","subtypes":[],"props":{"signer_id":""}},"StackHeightInstrumentation":{"name":"StackHeightInstrumentation","subtypes":[],"props":{}},"StackOverflow":{"name":"StackOverflow","subtypes":[],"props":{}},"TooManyFunctions":{"name":"TooManyFunctions","subtypes":[],"props":{}},"TooManyLocals":{"name":"TooManyLocals","subtypes":[],"props":{}},"TotalLogLengthExceeded":{"name":"TotalLogLengthExceeded","subtypes":[],"props":{"length":"","limit":""}},"TotalNumberOfActionsExceeded":{"name":"TotalNumberOfActionsExceeded","subtypes":[],"props":{"limit":"","total_number_of_actions":""}},"TotalPrepaidGasExceeded":{"name":"TotalPrepaidGasExceeded","subtypes":[],"props":{"limit":"","total_prepaid_gas":""}},"TransactionSizeExceeded":{"name":"TransactionSizeExceeded","subtypes":[],"props":{"limit":"","size":""}},"TriesToStake":{"name":"TriesToStake","subtypes":[],"props":{"account_id":"","balance":"","locked":"","stake":""}},"TriesToUnstake":{"name":"TriesToUnstake","subtypes":[],"props":{"account_id":""}},"TxExecutionError":{"name":"TxExecutionError","subtypes":["ActionError","InvalidTxError"],"props":{}},"Unreachable":{"name":"Unreachable","subtypes":[],"props":{}}
78,"UnsuitableStakingKey":{"name":"UnsuitableStakingKey","subtypes":[],"props":{"public_key":""}},"UnsupportedProtocolFeature":{"name":"UnsupportedProtocolFeature","subtypes":[],"props":{"protocol_feature":"","version":""}},"ValueLengthExceeded":{"name":"ValueLengthExceeded","subtypes":[],"props":{"length":"","limit":""}},"WasmTrap":{"name":"WasmTrap","subtypes":["Unreachable","IncorrectCallIndirectSignature","MemoryOutOfBounds","CallIndirectOOB","IllegalArithmetic","MisalignedAtomicAccess","IndirectCallToNull","StackOverflow","GenericTrap"],"props":{}},"WasmerCompileError":{"name":"WasmerCompileError","subtypes":[],"props":{"msg":""}},"Closed":{"name":"Closed","subtypes":[],"props":{}},"ServerError":{"name":"ServerError","subtypes":["TxExecutionError","Timeout","Closed"],"props":{}},"Timeout":{"name":"Timeout","subtypes":[],"props":{}}}}')},61930:e=>{"use strict";e.exports=JSON.parse('{"GasLimitExceeded":"Exceeded the maximum amount of gas allowed to burn per contract","MethodEmptyName":"Method name is empty","WasmerCompileError":"Wasmer compilation error: {{msg}}","GuestPanic":"Smart contract panicked: {{panic_msg}}","Memory":"Error creating Wasm memory","GasExceeded":"Exceeded the prepaid gas","MethodUTF8Error":"Method name is not valid UTF8 string","BadUTF16":"String encoding is bad UTF-16 sequence","WasmTrap":"WebAssembly trap: {{msg}}","GasInstrumentation":"Gas instrumentation failed or contract has denied instructions.","InvalidPromiseIndex":"{{promise_idx}} does not correspond to existing promises","InvalidPromiseResultIndex":"Accessed invalid promise result index: {{result_idx}}","Deserialization":"Error happened while deserializing the module","MethodNotFound":"Contract method is not found","InvalidRegisterId":"Accessed invalid register id: {{register_id}}","InvalidReceiptIndex":"VM Logic returned an invalid receipt index: {{receipt_index}}","EmptyMethodName":"Method name is empty in contract call","CannotReturnJointPromise":"Returning joint promise is currently prohibited","StackHeightInstrumentation":"Stack instrumentation failed","CodeDoesNotExist":"Cannot find contract code for account {{account_id}}","MethodInvalidSignature":"Invalid method signature","IntegerOverflow":"Integer overflow happened during contract execution","MemoryAccessViolation":"MemoryAccessViolation","InvalidIteratorIndex":"Iterator index {{iterator_index}} does not exist","IteratorWasInvalidated":"Iterator {{iterator_index}} was invalidated after its creation by performing a mutable operation on trie","InvalidAccountId":"VM Logic returned an invalid account id","Serialization":"Error happened while serializing the module","CannotAppendActionToJointPromise":"Actions can only be appended to non-joint promise.","InternalMemoryDeclared":"Internal memory declaration has been found in the module","Instantiate":"Error happened during instantiation","ProhibitedInView":"{{method_name}} is not allowed in view calls","InvalidMethodName":"VM Logic returned an invalid method name","BadUTF8":"String encoding is bad UTF-8 sequence","BalanceExceeded":"Exceeded the account balance","LinkError":"Wasm contract link error: {{msg}}","InvalidPublicKey":"VM Logic provided an invalid public key","ActorNoPermission":"Actor {{actor_id}} doesn\'t have permission to account {{account_id}} to complete the action","LackBalanceForState":"The account {{account_id}} wouldn\'t have enough balance to cover storage, required to have {{amount}} yoctoNEAR more","ReceiverMismatch":"Wrong AccessKey used for transaction: transaction is sent to receiver_id={{tx_receiver}}, but is signed with function call access key that restricted to only use with receiver_id={{ak_receiver}}. Either change receiver_id in your transaction or switch to use a FullAccessKey.","CostOverflow":"Transaction gas or balance cost is too high","InvalidSignature":"Transaction is not signed with the given public key","AccessKeyNotFound":"Signer \\"{{account_id}}\\" doesn\'t have access key with the given public_key {{public_key}}","NotEnoughBalance":"Sender {{signer_id}} does not have enough balance {{#formatNear}}{{balance}}{{/formatNear}} for operation costing {{#formatNear}}{{cost}}{{/formatNear}}
78","NotEnoughAllowance":"Access Key {account_id}:{public_key} does not have enough balance {{#formatNear}}{{allowance}}{{/formatNear}} for transaction costing {{#formatNear}}{{cost}}{{/formatNear}}","Expired":"Transaction has expired","DeleteAccountStaking":"Account {{account_id}} is staking and can not be deleted","SignerDoesNotExist":"Signer {{signer_id}} does not exist","TriesToStake":"Account {{account_id}} tried to stake {{#formatNear}}{{stake}}{{/formatNear}}, but has staked {{#formatNear}}{{locked}}{{/formatNear}} and only has {{#formatNear}}{{balance}}{{/formatNear}}","AddKeyAlreadyExists":"The public key {{public_key}} is already used for an existing access key","InvalidSigner":"Invalid signer account ID {{signer_id}} according to requirements","CreateAccountNotAllowed":"The new account_id {{account_id}} can\'t be created by {{predecessor_id}}","RequiresFullAccess":"The transaction contains more then one action, but it was signed with an access key which allows transaction to apply only one specific action. To apply more then one actions TX must be signed with a full access key","TriesToUnstake":"Account {{account_id}} is not yet staked, but tried to unstake","InvalidNonce":"Transaction nonce {{tx_nonce}} must be larger than nonce of the used access key {{ak_nonce}}","AccountAlreadyExists":"Can\'t create a new account {{account_id}}, because it already exists","InvalidChain":"Transaction parent block hash doesn\'t belong to the current chain","AccountDoesNotExist":"Can\'t complete the action because account {{account_id}} doesn\'t exist","AccessKeyDoesNotExist":"Can\'t complete the action because access key {{public_key}} doesn\'t exist","MethodNameMismatch":"Transaction method name {{method_name}} isn\'t allowed by the access key","DeleteAccountHasRent":"Account {{account_id}} can\'t be deleted. It has {{#formatNear}}{{balance}}{{/formatNear}}, which is enough to cover the rent","DeleteAccountHasEnoughBalance":"Account {{account_id}} can\'t be deleted. It has {{#formatNear}}{{balance}}{{/formatNear}}, which is enough to cover it\'s storage","InvalidReceiver":"Invalid receiver account ID {{receiver_id}} according to requirements","DeleteKeyDoesNotExist":"Account {{account_id}} tries to remove an access key that doesn\'t exist","Timeout":"Timeout exceeded","Closed":"Connection closed","ShardCongested":"Shard {{shard_id}} rejected the transaction due to congestion level {{congestion_level}}, try again later","ShardStuck":"Shard {{shard_id}} rejected the transaction because it missed {{missed_chunks}} chunks and needs to recover before accepting new transactions, try again later"}')},16001:e=>{"use strict";e.exports=JSON.parse('{"schema":{"AccessKeyNotFound":{"name":"AccessKeyNotFound","subtypes":[],"props":{"account_id":"","public_key":""}},"AccountAlreadyExists":{"name":"AccountAlreadyExists","subtypes":[],"props":{"account_id":""}},"AccountDoesNotExist":{"name":"AccountDoesNotExist","subtypes":[],"props":{"account_id":""}},"ActionError":{"name":"ActionError","subtypes":["AccountAlreadyExists","AccountDoesNotExist","CreateAccountOnlyByRegistrar","CreateAccountNotAllowed","ActorNoPermission","DeleteKeyDoesNotExist","AddKeyAlreadyExists","DeleteAccountStaking","LackBalanceForState","TriesToUnstake","TriesToStake","InsufficientStake","FunctionCallError","NewReceiptValidationError","OnlyImplicitAccountCreationAllowed","DeleteAccountWithLargeState","DelegateActionInvalidSignature","DelegateActionSenderDoesNotMatchTxReceiver","DelegateActionExpired","DelegateActionAccessKeyError","DelegateActionInvalidNonce","DelegateActionNonceTooLarge"],"props":{"index":""}},"ActionsValidationError":{"name":"ActionsValidationError","subtypes":["DeleteActionMustBeFinal","TotalPrepaidGasExceeded","TotalNumberOfActionsExceeded","AddKeyMethodNamesNumberOfBytesExceeded","AddKeyMethodNameLengthExceeded","IntegerOverflow","InvalidAccountId","ContractSizeExceeded","FunctionCallMethodNameLengthExceeded","FunctionCallArgumentsLengthExceeded","UnsuitableStakingKey","FunctionCallZeroAttachedGas","DelegateActionMustBeOnlyOne","UnsupportedProtocolFeature"],"props":{}},"ActorNoPermission":{"name":"ActorNoPermission","subtypes":[],"props":{"account_id":"","actor_id":""}},"AddKeyAlreadyExists":{"name":"AddKeyAlreadyExists","subtypes":[],"props":{"account_id":"","public_key":""}},"AddKeyMethodNameLengthExceeded":{"name":"AddKeyMethodNameLengthExceeded","subtypes":[],"props":{"length":"","limit":""}},"AddKeyMethodNamesNumberOfBytesExceeded":{"name":"AddKeyMethodNamesNumberOfBytesExceeded","subtypes":[],"props":{"limit":"","total_number_of_bytes":""}},"AltBn128InvalidInput":{"name":"AltBn128InvalidInput","subtypes":[],"props":{"msg":""}}
78,"BadUTF16":{"name":"BadUTF16","subtypes":[],"props":{}},"BadUTF8":{"name":"BadUTF8","subtypes":[],"props":{}},"BalanceExceeded":{"name":"BalanceExceeded","subtypes":[],"props":{}},"BalanceMismatchError":{"name":"BalanceMismatchError","subtypes":[],"props":{"final_accounts_balance":"","final_postponed_receipts_balance":"","forwarded_buffered_receipts_balance":"","incoming_receipts_balance":"","incoming_validator_rewards":"","initial_accounts_balance":"","initial_postponed_receipts_balance":"","new_buffered_receipts_balance":"","new_delayed_receipts_balance":"","other_burnt_amount":"","outgoing_receipts_balance":"","processed_delayed_receipts_balance":"","slashed_burnt_amount":"","tx_burnt_amount":""}},"CallIndirectOOB":{"name":"CallIndirectOOB","subtypes":[],"props":{}},"CannotAppendActionToJointPromise":{"name":"CannotAppendActionToJointPromise","subtypes":[],"props":{}},"CannotReturnJointPromise":{"name":"CannotReturnJointPromise","subtypes":[],"props":{}},"CodeDoesNotExist":{"name":"CodeDoesNotExist","subtypes":[],"props":{"account_id":""}},"CompilationError":{"name":"CompilationError","subtypes":["CodeDoesNotExist","PrepareError","WasmerCompileError"],"props":{}},"ContractSizeExceeded":{"name":"ContractSizeExceeded","subtypes":[],"props":{"limit":"","size":""}},"CostOverflow":{"name":"CostOverflow","subtypes":[],"props":{}},"CreateAccountNotAllowed":{"name":"CreateAccountNotAllowed","subtypes":[],"props":{"account_id":"","predecessor_id":""}},"CreateAccountOnlyByRegistrar":{"name":"CreateAccountOnlyByRegistrar","subtypes":[],"props":{"account_id":"","predecessor_id":"","registrar_account_id":""}},"DelegateActionExpired":{"name":"DelegateActionExpired","subtypes":[],"props":{}},"DelegateActionInvalidNonce":{"name":"DelegateActionInvalidNonce","subtypes":[],"props":{"ak_nonce":"","delegate_nonce":""}},"DelegateActionInvalidSignature":{"name":"DelegateActionInvalidSignature","subtypes":[],"props":{}},"DelegateActionMustBeOnlyOne":{"name":"DelegateActionMustBeOnlyOne","subtypes":[],"props":{}},"DelegateActionNonceTooLarge":{"name":"DelegateActionNonceTooLarge","subtypes":[],"props":{"delegate_nonce":"","upper_bound":""}},"DelegateActionSenderDoesNotMatchTxReceiver":{"name":"DelegateActionSenderDoesNotMatchTxReceiver","subtypes":[],"props":{"receiver_id":"","sender_id":""}},"DeleteAccountStaking":{"name":"DeleteAccountStaking","subtypes":[],"props":{"account_id":""}},"DeleteAccountWithLargeState":{"name":"DeleteAccountWithLargeState","subtypes":[],"props":{"account_id":""}},"DeleteActionMustBeFinal":{"name":"DeleteActionMustBeFinal","subtypes":[],"props":{}},"DeleteKeyDoesNotExist":{"name":"DeleteKeyDoesNotExist","subtypes":[],"props":{"account_id":"","public_key":""}},"DepositWithFunctionCall":{"name":"DepositWithFunctionCall","subtypes":[],"props":{}},"Deprecated":{"name":"Deprecated","subtypes":[],"props":{"method_name":""}},"Deserialization":{"name":"Deserialization","subtypes":[],"props":{}},"ECRecoverError":{"name":"ECRecoverError","subtypes":[],"props":{"msg":""}},"Ed25519VerifyInvalidInput":{"name":"Ed25519VerifyInvalidInput","subtypes":[],"props":{"msg":""}},"EmptyMethodName":{"name":"EmptyMethodName","subtypes":[],"props":{}},"Expired":{"name":"Expired","subtypes":[],"props":{}},"FunctionCallArgumentsLengthExceeded":{"name":"FunctionCallArgumentsLengthExceeded","subtypes":[],"props":{"length":"","limit":""}},"FunctionCallMethodNameLengthExceeded":{"name":"FunctionCallMethodNameLengthExceeded","subtypes":[],"props":{"length":"","limit":""}},"FunctionCallZeroAttachedGas":{"name":"FunctionCallZeroAttachedGas","subtypes":[],"props":{}},"GasExceeded":{"name":"GasExceeded","subtypes":[],"props":{}},"GasInstrumentation":{"name":"GasInstrumentation","subtypes":[],"props":{}},"GasLimitExceeded":{"name":"GasLimitExceeded","subtypes":[],"props":{}},"GenericTrap":{"name":"GenericTrap","subtypes":[],"props":{}},"GuestPanic":{"name":"GuestPanic","subtypes":[],"props":{"panic_msg":""}},"HostError":{"name":"HostError","subtypes":["BadUTF16","BadUTF8","GasExceeded","GasLimitExceeded","BalanceExceeded","EmptyMethodName","GuestPanic","IntegerOverflow","InvalidPromiseIndex","CannotAppendActionToJointPromise","CannotReturnJointPromise","InvalidPromiseResultIndex","InvalidRegisterId","IteratorWasInvalidated","MemoryAccessViolation","InvalidReceiptIndex","InvalidIteratorIndex","InvalidAccountId","InvalidMethodName","InvalidPublicKey","ProhibitedInView","NumberOfLogsExceeded","KeyLengthExceeded","ValueLengthExceeded","TotalLogLengthExceeded","NumberPromisesExceeded","NumberInputDataDependenciesExceeded","ReturnedValueLengthExceeded","ContractSizeExceeded","Deprecated","ECRecover
78Error","AltBn128InvalidInput","Ed25519VerifyInvalidInput"],"props":{}},"IllegalArithmetic":{"name":"IllegalArithmetic","subtypes":[],"props":{}},"IncorrectCallIndirectSignature":{"name":"IncorrectCallIndirectSignature","subtypes":[],"props":{}},"IndirectCallToNull":{"name":"IndirectCallToNull","subtypes":[],"props":{}},"Instantiate":{"name":"Instantiate","subtypes":[],"props":{}},"InsufficientStake":{"name":"InsufficientStake","subtypes":[],"props":{"account_id":"","minimum_stake":"","stake":""}},"IntegerOverflow":{"name":"IntegerOverflow","subtypes":[],"props":{}},"InternalMemoryDeclared":{"name":"InternalMemoryDeclared","subtypes":[],"props":{}},"InvalidAccessKeyError":{"name":"InvalidAccessKeyError","subtypes":["AccessKeyNotFound","ReceiverMismatch","MethodNameMismatch","RequiresFullAccess","NotEnoughAllowance","DepositWithFunctionCall"],"props":{}},"InvalidAccountId":{"name":"InvalidAccountId","subtypes":[],"props":{}},"InvalidChain":{"name":"InvalidChain","subtypes":[],"props":{}},"InvalidDataReceiverId":{"name":"InvalidDataReceiverId","subtypes":[],"props":{"account_id":""}},"InvalidIteratorIndex":{"name":"InvalidIteratorIndex","subtypes":[],"props":{"iterator_index":""}}
78,"InvalidMethodName":{"name":"InvalidMethodName","subtypes":[],"props":{}},"InvalidNonce":{"name":"InvalidNonce","subtypes":[],"props":{"ak_nonce":"","tx_nonce":""}},"InvalidPredecessorId":{"name":"InvalidPredecessorId","subtypes":[],"props":{"account_id":""}},"InvalidPromiseIndex":{"name":"InvalidPromiseIndex","subtypes":[],"props":{"promise_idx":""}},"InvalidPromiseResultIndex":{"name":"InvalidPromiseResultIndex","subtypes":[],"props":{"result_idx":""}},"InvalidPublicKey":{"name":"InvalidPublicKey","subtypes":[],"props":{}},"InvalidReceiptIndex":{"name":"InvalidReceiptIndex","subtypes":[],"props":{"receipt_index":""}},"InvalidReceiverId":{"name":"InvalidReceiverId","subtypes":[],"props":{"account_id":""}},"InvalidRegisterId":{"name":"InvalidRegisterId","subtypes":[],"props":{"register_id":""}},"InvalidSignature":{"name":"InvalidSignature","subtypes":[],"props":{}},"InvalidSignerId":{"name":"InvalidSignerId","subtypes":[],"props":{"account_id":""}},"InvalidTxError":{"name":"InvalidTxError","subtypes":["InvalidAccessKeyError","InvalidSignerId","SignerDoesNotExist","InvalidNonce","NonceTooLarge","InvalidReceiverId","InvalidSignature","NotEnoughBalance","LackBalanceForState","CostOverflow","InvalidChain","Expired","ActionsValidation","TransactionSizeExceeded","StorageError","ShardCongested","ShardStuck"],"props":{}},"IteratorWasInvalidated":{"name":"IteratorWasInvalidated","subtypes":[],"props":{"iterator_index":""}}
78,"KeyLengthExceeded":{"name":"KeyLengthExceeded","subtypes":[],"props":{"length":"","limit":""}},"LackBalanceForState":{"name":"LackBalanceForState","subtypes":[],"props":{"account_id":"","amount":""}},"Memory":{"name":"Memory","subtypes":[],"props":{}},"MemoryAccessViolation":{"name":"MemoryAccessViolation","subtypes":[],"props":{}},"MemoryOutOfBounds":{"name":"MemoryOutOfBounds","subtypes":[],"props":{}},"MethodEmptyName":{"name":"MethodEmptyName","subtypes":[],"props":{}},"MethodInvalidSignature":{"name":"MethodInvalidSignature","subtypes":[],"props":{}},"MethodNameMismatch":{"name":"MethodNameMismatch","subtypes":[],"props":{"method_name":""}},"MethodNotFound":{"name":"MethodNotFound","subtypes":[],"props":{}},"MethodResolveError":{"name":"MethodResolveError","subtypes":["MethodEmptyName","MethodNotFound","MethodInvalidSignature"],"props":{}},"MisalignedAtomicAccess":{"name":"MisalignedAtomicAccess","subtypes":[],"props":{}},"NonceTooLarge":{"name":"NonceTooLarge","subtypes":[],"props":{"tx_nonce":"","upper_bound":""}},"NotEnoughAllowance":{"name":"NotEnoughAllowance","subtypes":[],"props":{"account_id":"","allowance":"","cost":"","public_key":""}},"NotEnoughBalance":{"name":"NotEnoughBalance","subtypes":[],"props":{"balance":"","cost":"","signer_id":""}},"NumberInputDataDependenciesExceeded":{"name":"NumberInputDataDependenciesExceeded","subtypes":[],"props":{"limit":"","number_of_input_data_dependencies":""}},"NumberOfLogsExceeded":{"name":"NumberOfLogsExceeded","subtypes":[],"props":{"limit":""}},"NumberPromisesExceeded":{"name":"NumberPromisesExceeded","subtypes":[],"props":{"limit":"","number_of_promises":""}},"OnlyImplicitAccountCreationAllowed":{"name":"OnlyImplicitAccountCreationAllowed","subtypes":[],"props":{"account_id":""}},"PrepareError":{"name":"PrepareError","subtypes":["Serialization","Deserialization","InternalMemoryDeclared","GasInstrumentation","StackHeightInstrumentation","Instantiate","Memory","TooManyFunctions","TooManyLocals"],"props":{}},"ProhibitedInView":{"name":"ProhibitedInView","subtypes":[],"props":{"method_name":""}},"ReceiptSizeExceeded":{"name":"ReceiptSizeExceeded","subtypes":[],"props":{"limit":"","size":""}},"ReceiptValidationError":{"name":"ReceiptValidationError","subtypes":["InvalidPredecessorId","InvalidReceiverId","InvalidSignerId","InvalidDataReceiverId","ReturnedValueLengthExceeded","NumberInputDataDependenciesExceeded","ActionsValidation","ReceiptSizeExceeded"],"props":{}},"ReceiverMismatch":{"name":"ReceiverMismatch","subtypes":[],"props":{"ak_receiver":"","tx_receiver":""}},"RequiresFullAccess":{"name":"RequiresFullAccess","subtypes":[],"props":{}},"ReturnedValueLengthExceeded":{"name":"ReturnedValueLengthExceeded","subtypes":[],"props":{"length":"","limit":""}},"Serialization":{"name":"Serialization","subtypes":[],"props":{}},"ShardCongested":{"name":"ShardCongested","subtypes":[],"props":{"congestion_level":"","shard_id":""}},"ShardStuck":{"name":"ShardStuck","subtypes":[],"props":{"missed_chunks":"","shard_id":""}},"SignerDoesNotExist":{"name":"SignerDoesNotExist","subtypes":[],"props":{"signer_id":""}},"StackHeightInstrumentation":{"name":"StackHeightInstrumentation","subtypes":[],"props":{}},"StackOverflow":{"name":"StackOverflow","subtypes":[],"props":{}},"TooManyFunctions":{"name":"TooManyFunctions","subtypes":[],"props":{}},"TooManyLocals":{"name":"TooManyLocals","subtypes":[],"props":{}},"TotalLogLengthExceeded":{"name":"TotalLogLengthExceeded","subtypes":[],"props":{"length":"","limit":""}},"TotalNumberOfActionsExceeded":{"name":"TotalNumberOfActionsExceeded","subtypes":[],"props":{"limit":"","total_number_of_actions":""}},"TotalPrepaidGasExceeded":{"name":"TotalPrepaidGasExceeded","subtypes":[],"props":{"limit":"","total_prepaid_gas":""}},"TransactionSizeExceeded":{"name":"TransactionSizeExceeded","subtypes":[],"props":{"limit":"","size":""}},"TriesToStake":{"name":"TriesToStake","subtypes":[],"props":{"account_id":"","balance":"","locked":"","stake":""}},"TriesToUnstake":{"name":"TriesToUnstake","subtypes":[],"props":{"account_id":""}},"TxExecutionError":{"name":"TxExecutionError","subtypes":["ActionError","InvalidTxError"],"props":{}},"Unreachable":{"name":"Unreachable","subtypes":[],"props":{}}
78,"UnsuitableStakingKey":{"name":"UnsuitableStakingKey","subtypes":[],"props":{"public_key":""}},"UnsupportedProtocolFeature":{"name":"UnsupportedProtocolFeature","subtypes":[],"props":{"protocol_feature":"","version":""}},"ValueLengthExceeded":{"name":"ValueLengthExceeded","subtypes":[],"props":{"length":"","limit":""}},"WasmTrap":{"name":"WasmTrap","subtypes":["Unreachable","IncorrectCallIndirectSignature","MemoryOutOfBounds","CallIndirectOOB","IllegalArithmetic","MisalignedAtomicAccess","IndirectCallToNull","StackOverflow","GenericTrap"],"props":{}},"WasmerCompileError":{"name":"WasmerCompileError","subtypes":[],"props":{"msg":""}},"Closed":{"name":"Closed","subtypes":[],"props":{}},"ServerError":{"name":"ServerError","subtypes":["TxExecutionError","Timeout","Closed"],"props":{}},"Timeout":{"name":"Timeout","subtypes":[],"props":{}}}}')},39197:e=>{"use strict";e.exports=JSON.parse('{"GasLimitExceeded":"Exceeded the maximum amount of gas allowed to burn per contract","MethodEmptyName":"Method name is empty","WasmerCompileError":"Wasmer compilation error: {{msg}}","GuestPanic":"Smart contract panicked: {{panic_msg}}","Memory":"Error creating Wasm memory","GasExceeded":"Exceeded the prepaid gas","MethodUTF8Error":"Method name is not valid UTF8 string","BadUTF16":"String encoding is bad UTF-16 sequence","WasmTrap":"WebAssembly trap: {{msg}}","GasInstrumentation":"Gas instrumentation failed or contract has denied instructions.","InvalidPromiseIndex":"{{promise_idx}} does not correspond to existing promises","InvalidPromiseResultIndex":"Accessed invalid promise result index: {{result_idx}}","Deserialization":"Error happened while deserializing the module","MethodNotFound":"Contract method is not found","InvalidRegisterId":"Accessed invalid register id: {{register_id}}","InvalidReceiptIndex":"VM Logic returned an invalid receipt index: {{receipt_index}}","EmptyMethodName":"Method name is empty in contract call","CannotReturnJointPromise":"Returning joint promise is currently prohibited","StackHeightInstrumentation":"Stack instrumentation failed","CodeDoesNotExist":"Cannot find contract code for account {{account_id}}","MethodInvalidSignature":"Invalid method signature","IntegerOverflow":"Integer overflow happened during contract execution","MemoryAccessViolation":"MemoryAccessViolation","InvalidIteratorIndex":"Iterator index {{iterator_index}} does not exist","IteratorWasInvalidated":"Iterator {{iterator_index}} was invalidated after its creation by performing a mutable operation on trie","InvalidAccountId":"VM Logic returned an invalid account id","Serialization":"Error happened while serializing the module","CannotAppendActionToJointPromise":"Actions can only be appended to non-joint promise.","InternalMemoryDeclared":"Internal memory declaration has been found in the module","Instantiate":"Error happened during instantiation","ProhibitedInView":"{{method_name}} is not allowed in view calls","InvalidMethodName":"VM Logic returned an invalid method name","BadUTF8":"String encoding is bad UTF-8 sequence","BalanceExceeded":"Exceeded the account balance","LinkError":"Wasm contract link error: {{msg}}","InvalidPublicKey":"VM Logic provided an invalid public key","ActorNoPermission":"Actor {{actor_id}} doesn\'t have permission to account {{account_id}} to complete the action","LackBalanceForState":"The account {{account_id}} wouldn\'t have enough balance to cover storage, required to have {{amount}} yoctoNEAR more","ReceiverMismatch":"Wrong AccessKey used for transaction: transaction is sent to receiver_id={{tx_receiver}}, but is signed with function call access key that restricted to only use with receiver_id={{ak_receiver}}. Either change receiver_id in your transaction or switch to use a FullAccessKey.","CostOverflow":"Transaction gas or balance cost is too high","InvalidSignature":"Transaction is not signed with the given public key","AccessKeyNotFound":"Signer \\"{{account_id}}\\" doesn\'t have access key with the given public_key {{public_key}}","NotEnoughBalance":"Sender {{signer_id}} does not have enough balance {{#formatNear}}{{balance}}{{/formatNear}} for operation costing {{#formatNear}}{{cost}}{{/formatNear}}
78","NotEnoughAllowance":"Access Key {account_id}:{public_key} does not have enough balance {{#formatNear}}{{allowance}}{{/formatNear}} for transaction costing {{#formatNear}}{{cost}}{{/formatNear}}","Expired":"Transaction has expired","DeleteAccountStaking":"Account {{account_id}} is staking and can not be deleted","SignerDoesNotExist":"Signer {{signer_id}} does not exist","TriesToStake":"Account {{account_id}} tried to stake {{#formatNear}}{{stake}}{{/formatNear}}, but has staked {{#formatNear}}{{locked}}{{/formatNear}} and only has {{#formatNear}}{{balance}}{{/formatNear}}","AddKeyAlreadyExists":"The public key {{public_key}} is already used for an existing access key","InvalidSigner":"Invalid signer account ID {{signer_id}} according to requirements","CreateAccountNotAllowed":"The new account_id {{account_id}} can\'t be created by {{predecessor_id}}","RequiresFullAccess":"The transaction contains more then one action, but it was signed with an access key which allows transaction to apply only one specific action. To apply more then one actions TX must be signed with a full access key","TriesToUnstake":"Account {{account_id}} is not yet staked, but tried to unstake","InvalidNonce":"Transaction nonce {{tx_nonce}} must be larger than nonce of the used access key {{ak_nonce}}","AccountAlreadyExists":"Can\'t create a new account {{account_id}}, because it already exists","InvalidChain":"Transaction parent block hash doesn\'t belong to the current chain","AccountDoesNotExist":"Can\'t complete the action because account {{account_id}} doesn\'t exist","AccessKeyDoesNotExist":"Can\'t complete the action because access key {{public_key}} doesn\'t exist","MethodNameMismatch":"Transaction method name {{method_name}} isn\'t allowed by the access key","DeleteAccountHasRent":"Account {{account_id}} can\'t be deleted. It has {{#formatNear}}{{balance}}{{/formatNear}}, which is enough to cover the rent","DeleteAccountHasEnoughBalance":"Account {{account_id}} can\'t be deleted. It has {{#formatNear}}{{balance}}{{/formatNear}}, which is enough to cover it\'s storage","InvalidReceiver":"Invalid receiver account ID {{receiver_id}} according to requirements","DeleteKeyDoesNotExist":"Account {{account_id}} tries to remove an access key that doesn\'t exist","Timeout":"Timeout exceeded","Closed":"Connection closed","ShardCongested":"Shard {{shard_id}} rejected the transaction due to congestion level {{congestion_level}}, try again later","ShardStuck":"Shard {{shard_id}} rejected the transaction because it missed {{missed_chunks}} chunks and needs to recover before accepting new transactions, try again later"}')},86810:e=>{"use strict";e.exports=JSON.parse('{"schema":{"AccessKeyNotFound":{"name":"AccessKeyNotFound","subtypes":[],"props":{"account_id":"","public_key":""}},"AccountAlreadyExists":{"name":"AccountAlreadyExists","subtypes":[],"props":{"account_id":""}},"AccountDoesNotExist":{"name":"AccountDoesNotExist","subtypes":[],"props":{"account_id":""}},"ActionError":{"name":"ActionError","subtypes":["AccountAlreadyExists","AccountDoesNotExist","CreateAccountOnlyByRegistrar","CreateAccountNotAllowed","ActorNoPermission","DeleteKeyDoesNotExist","AddKeyAlreadyExists","DeleteAccountStaking","LackBalanceForState","TriesToUnstake","TriesToStake","InsufficientStake","FunctionCallError","NewReceiptValidationError","OnlyImplicitAccountCreationAllowed","DeleteAccountWithLargeState","DelegateActionInvalidSignature","DelegateActionSenderDoesNotMatchTxReceiver","DelegateActionExpired","DelegateActionAccessKeyError","DelegateActionInvalidNonce","DelegateActionNonceTooLarge"],"props":{"index":""}},"ActionsValidationError":{"name":"ActionsValidationError","subtypes":["DeleteActionMustBeFinal","TotalPrepaidGasExceeded","TotalNumberOfActionsExceeded","AddKeyMethodNamesNumberOfBytesExceeded","AddKeyMethodNameLengthExceeded","IntegerOverflow","InvalidAccountId","ContractSizeExceeded","FunctionCallMethodNameLengthExceeded","FunctionCallArgumentsLengthExceeded","UnsuitableStakingKey","FunctionCallZeroAttachedGas","DelegateActionMustBeOnlyOne","UnsupportedProtocolFeature"],"props":{}},"ActorNoPermission":{"name":"ActorNoPermission","subtypes":[],"props":{"account_id":"","actor_id":""}},"AddKeyAlreadyExists":{"name":"AddKeyAlreadyExists","subtypes":[],"props":{"account_id":"","public_key":""}},"AddKeyMethodNameLengthExceeded":{"name":"AddKeyMethodNameLengthExceeded","subtypes":[],"props":{"length":"","limit":""}},"AddKeyMethodNamesNumberOfBytesExceeded":{"name":"AddKeyMethodNamesNumberOfBytesExceeded","subtypes":[],"props":{"limit":"","total_number_of_bytes":""}},"AltBn128InvalidInput":{"name":"AltBn128InvalidInput","subtypes":[],"props":{"msg":""}}
78,"BadUTF16":{"name":"BadUTF16","subtypes":[],"props":{}},"BadUTF8":{"name":"BadUTF8","subtypes":[],"props":{}},"BalanceExceeded":{"name":"BalanceExceeded","subtypes":[],"props":{}},"BalanceMismatchError":{"name":"BalanceMismatchError","subtypes":[],"props":{"final_accounts_balance":"","final_postponed_receipts_balance":"","forwarded_buffered_receipts_balance":"","incoming_receipts_balance":"","incoming_validator_rewards":"","initial_accounts_balance":"","initial_postponed_receipts_balance":"","new_buffered_receipts_balance":"","new_delayed_receipts_balance":"","other_burnt_amount":"","outgoing_receipts_balance":"","processed_delayed_receipts_balance":"","slashed_burnt_amount":"","tx_burnt_amount":""}},"CallIndirectOOB":{"name":"CallIndirectOOB","subtypes":[],"props":{}},"CannotAppendActionToJointPromise":{"name":"CannotAppendActionToJointPromise","subtypes":[],"props":{}},"CannotReturnJointPromise":{"name":"CannotReturnJointPromise","subtypes":[],"props":{}},"CodeDoesNotExist":{"name":"CodeDoesNotExist","subtypes":[],"props":{"account_id":""}},"CompilationError":{"name":"CompilationError","subtypes":["CodeDoesNotExist","PrepareError","WasmerCompileError"],"props":{}},"ContractSizeExceeded":{"name":"ContractSizeExceeded","subtypes":[],"props":{"limit":"","size":""}},"CostOverflow":{"name":"CostOverflow","subtypes":[],"props":{}},"CreateAccountNotAllowed":{"name":"CreateAccountNotAllowed","subtypes":[],"props":{"account_id":"","predecessor_id":""}},"CreateAccountOnlyByRegistrar":{"name":"CreateAccountOnlyByRegistrar","subtypes":[],"props":{"account_id":"","predecessor_id":"","registrar_account_id":""}},"DelegateActionExpired":{"name":"DelegateActionExpired","subtypes":[],"props":{}},"DelegateActionInvalidNonce":{"name":"DelegateActionInvalidNonce","subtypes":[],"props":{"ak_nonce":"","delegate_nonce":""}},"DelegateActionInvalidSignature":{"name":"DelegateActionInvalidSignature","subtypes":[],"props":{}},"DelegateActionMustBeOnlyOne":{"name":"DelegateActionMustBeOnlyOne","subtypes":[],"props":{}},"DelegateActionNonceTooLarge":{"name":"DelegateActionNonceTooLarge","subtypes":[],"props":{"delegate_nonce":"","upper_bound":""}},"DelegateActionSenderDoesNotMatchTxReceiver":{"name":"DelegateActionSenderDoesNotMatchTxReceiver","subtypes":[],"props":{"receiver_id":"","sender_id":""}},"DeleteAccountStaking":{"name":"DeleteAccountStaking","subtypes":[],"props":{"account_id":""}},"DeleteAccountWithLargeState":{"name":"DeleteAccountWithLargeState","subtypes":[],"props":{"account_id":""}},"DeleteActionMustBeFinal":{"name":"DeleteActionMustBeFinal","subtypes":[],"props":{}},"DeleteKeyDoesNotExist":{"name":"DeleteKeyDoesNotExist","subtypes":[],"props":{"account_id":"","public_key":""}},"DepositWithFunctionCall":{"name":"DepositWithFunctionCall","subtypes":[],"props":{}},"Deprecated":{"name":"Deprecated","subtypes":[],"props":{"method_name":""}},"Deserialization":{"name":"Deserialization","subtypes":[],"props":{}},"ECRecoverError":{"name":"ECRecoverError","subtypes":[],"props":{"msg":""}},"Ed25519VerifyInvalidInput":{"name":"Ed25519VerifyInvalidInput","subtypes":[],"props":{"msg":""}},"EmptyMethodName":{"name":"EmptyMethodName","subtypes":[],"props":{}},"Expired":{"name":"Expired","subtypes":[],"props":{}},"FunctionCallArgumentsLengthExceeded":{"name":"FunctionCallArgumentsLengthExceeded","subtypes":[],"props":{"length":"","limit":""}},"FunctionCallMethodNameLengthExceeded":{"name":"FunctionCallMethodNameLengthExceeded","subtypes":[],"props":{"length":"","limit":""}},"FunctionCallZeroAttachedGas":{"name":"FunctionCallZeroAttachedGas","subtypes":[],"props":{}},"GasExceeded":{"name":"GasExceeded","subtypes":[],"props":{}},"GasInstrumentation":{"name":"GasInstrumentation","subtypes":[],"props":{}},"GasLimitExceeded":{"name":"GasLimitExceeded","subtypes":[],"props":{}},"GenericTrap":{"name":"GenericTrap","subtypes":[],"props":{}},"GuestPanic":{"name":"GuestPanic","subtypes":[],"props":{"panic_msg":""}},"HostError":{"name":"HostError","subtypes":["BadUTF16","BadUTF8","GasExceeded","GasLimitExceeded","BalanceExceeded","EmptyMethodName","GuestPanic","IntegerOverflow","InvalidPromiseIndex","CannotAppendActionToJointPromise","CannotReturnJointPromise","InvalidPromiseResultIndex","InvalidRegisterId","IteratorWasInvalidated","MemoryAccessViolation","InvalidReceiptIndex","InvalidIteratorIndex","InvalidAccountId","InvalidMethodName","InvalidPublicKey","ProhibitedInView","NumberOfLogsExceeded","KeyLengthExceeded","ValueLengthExceeded","TotalLogLengthExceeded","NumberPromisesExceeded","NumberInputDataDependenciesExceeded","ReturnedValueLengthExceeded","ContractSizeExceeded","Deprecated","ECRecover
78Error","AltBn128InvalidInput","Ed25519VerifyInvalidInput"],"props":{}},"IllegalArithmetic":{"name":"IllegalArithmetic","subtypes":[],"props":{}},"IncorrectCallIndirectSignature":{"name":"IncorrectCallIndirectSignature","subtypes":[],"props":{}},"IndirectCallToNull":{"name":"IndirectCallToNull","subtypes":[],"props":{}},"Instantiate":{"name":"Instantiate","subtypes":[],"props":{}},"InsufficientStake":{"name":"InsufficientStake","subtypes":[],"props":{"account_id":"","minimum_stake":"","stake":""}},"IntegerOverflow":{"name":"IntegerOverflow","subtypes":[],"props":{}},"InternalMemoryDeclared":{"name":"InternalMemoryDeclared","subtypes":[],"props":{}},"InvalidAccessKeyError":{"name":"InvalidAccessKeyError","subtypes":["AccessKeyNotFound","ReceiverMismatch","MethodNameMismatch","RequiresFullAccess","NotEnoughAllowance","DepositWithFunctionCall"],"props":{}},"InvalidAccountId":{"name":"InvalidAccountId","subtypes":[],"props":{}},"InvalidChain":{"name":"InvalidChain","subtypes":[],"props":{}},"InvalidDataReceiverId":{"name":"InvalidDataReceiverId","subtypes":[],"props":{"account_id":""}},"InvalidIteratorIndex":{"name":"InvalidIteratorIndex","subtypes":[],"props":{"iterator_index":""}}
78,"InvalidMethodName":{"name":"InvalidMethodName","subtypes":[],"props":{}},"InvalidNonce":{"name":"InvalidNonce","subtypes":[],"props":{"ak_nonce":"","tx_nonce":""}},"InvalidPredecessorId":{"name":"InvalidPredecessorId","subtypes":[],"props":{"account_id":""}},"InvalidPromiseIndex":{"name":"InvalidPromiseIndex","subtypes":[],"props":{"promise_idx":""}},"InvalidPromiseResultIndex":{"name":"InvalidPromiseResultIndex","subtypes":[],"props":{"result_idx":""}},"InvalidPublicKey":{"name":"InvalidPublicKey","subtypes":[],"props":{}},"InvalidReceiptIndex":{"name":"InvalidReceiptIndex","subtypes":[],"props":{"receipt_index":""}},"InvalidReceiverId":{"name":"InvalidReceiverId","subtypes":[],"props":{"account_id":""}},"InvalidRegisterId":{"name":"InvalidRegisterId","subtypes":[],"props":{"register_id":""}},"InvalidSignature":{"name":"InvalidSignature","subtypes":[],"props":{}},"InvalidSignerId":{"name":"InvalidSignerId","subtypes":[],"props":{"account_id":""}},"InvalidTxError":{"name":"InvalidTxError","subtypes":["InvalidAccessKeyError","InvalidSignerId","SignerDoesNotExist","InvalidNonce","NonceTooLarge","InvalidReceiverId","InvalidSignature","NotEnoughBalance","LackBalanceForState","CostOverflow","InvalidChain","Expired","ActionsValidation","TransactionSizeExceeded","StorageError","ShardCongested","ShardStuck"],"props":{}},"IteratorWasInvalidated":{"name":"IteratorWasInvalidated","subtypes":[],"props":{"iterator_index":""}}
78,"KeyLengthExceeded":{"name":"KeyLengthExceeded","subtypes":[],"props":{"length":"","limit":""}},"LackBalanceForState":{"name":"LackBalanceForState","subtypes":[],"props":{"account_id":"","amount":""}},"Memory":{"name":"Memory","subtypes":[],"props":{}},"MemoryAccessViolation":{"name":"MemoryAccessViolation","subtypes":[],"props":{}},"MemoryOutOfBounds":{"name":"MemoryOutOfBounds","subtypes":[],"props":{}},"MethodEmptyName":{"name":"MethodEmptyName","subtypes":[],"props":{}},"MethodInvalidSignature":{"name":"MethodInvalidSignature","subtypes":[],"props":{}},"MethodNameMismatch":{"name":"MethodNameMismatch","subtypes":[],"props":{"method_name":""}},"MethodNotFound":{"name":"MethodNotFound","subtypes":[],"props":{}},"MethodResolveError":{"name":"MethodResolveError","subtypes":["MethodEmptyName","MethodNotFound","MethodInvalidSignature"],"props":{}},"MisalignedAtomicAccess":{"name":"MisalignedAtomicAccess","subtypes":[],"props":{}},"NonceTooLarge":{"name":"NonceTooLarge","subtypes":[],"props":{"tx_nonce":"","upper_bound":""}},"NotEnoughAllowance":{"name":"NotEnoughAllowance","subtypes":[],"props":{"account_id":"","allowance":"","cost":"","public_key":""}},"NotEnoughBalance":{"name":"NotEnoughBalance","subtypes":[],"props":{"balance":"","cost":"","signer_id":""}},"NumberInputDataDependenciesExceeded":{"name":"NumberInputDataDependenciesExceeded","subtypes":[],"props":{"limit":"","number_of_input_data_dependencies":""}},"NumberOfLogsExceeded":{"name":"NumberOfLogsExceeded","subtypes":[],"props":{"limit":""}},"NumberPromisesExceeded":{"name":"NumberPromisesExceeded","subtypes":[],"props":{"limit":"","number_of_promises":""}},"OnlyImplicitAccountCreationAllowed":{"name":"OnlyImplicitAccountCreationAllowed","subtypes":[],"props":{"account_id":""}},"PrepareError":{"name":"PrepareError","subtypes":["Serialization","Deserialization","InternalMemoryDeclared","GasInstrumentation","StackHeightInstrumentation","Instantiate","Memory","TooManyFunctions","TooManyLocals"],"props":{}},"ProhibitedInView":{"name":"ProhibitedInView","subtypes":[],"props":{"method_name":""}},"ReceiptSizeExceeded":{"name":"ReceiptSizeExceeded","subtypes":[],"props":{"limit":"","size":""}},"ReceiptValidationError":{"name":"ReceiptValidationError","subtypes":["InvalidPredecessorId","InvalidReceiverId","InvalidSignerId","InvalidDataReceiverId","ReturnedValueLengthExceeded","NumberInputDataDependenciesExceeded","ActionsValidation","ReceiptSizeExceeded"],"props":{}},"ReceiverMismatch":{"name":"ReceiverMismatch","subtypes":[],"props":{"ak_receiver":"","tx_receiver":""}},"RequiresFullAccess":{"name":"RequiresFullAccess","subtypes":[],"props":{}},"ReturnedValueLengthExceeded":{"name":"ReturnedValueLengthExceeded","subtypes":[],"props":{"length":"","limit":""}},"Serialization":{"name":"Serialization","subtypes":[],"props":{}},"ShardCongested":{"name":"ShardCongested","subtypes":[],"props":{"congestion_level":"","shard_id":""}},"ShardStuck":{"name":"ShardStuck","subtypes":[],"props":{"missed_chunks":"","shard_id":""}},"SignerDoesNotExist":{"name":"SignerDoesNotExist","subtypes":[],"props":{"signer_id":""}},"StackHeightInstrumentation":{"name":"StackHeightInstrumentation","subtypes":[],"props":{}},"StackOverflow":{"name":"StackOverflow","subtypes":[],"props":{}},"TooManyFunctions":{"name":"TooManyFunctions","subtypes":[],"props":{}},"TooManyLocals":{"name":"TooManyLocals","subtypes":[],"props":{}},"TotalLogLengthExceeded":{"name":"TotalLogLengthExceeded","subtypes":[],"props":{"length":"","limit":""}},"TotalNumberOfActionsExceeded":{"name":"TotalNumberOfActionsExceeded","subtypes":[],"props":{"limit":"","total_number_of_actions":""}},"TotalPrepaidGasExceeded":{"name":"TotalPrepaidGasExceeded","subtypes":[],"props":{"limit":"","total_prepaid_gas":""}},"TransactionSizeExceeded":{"name":"TransactionSizeExceeded","subtypes":[],"props":{"limit":"","size":""}},"TriesToStake":{"name":"TriesToStake","subtypes":[],"props":{"account_id":"","balance":"","locked":"","stake":""}},"TriesToUnstake":{"name":"TriesToUnstake","subtypes":[],"props":{"account_id":""}},"TxExecutionError":{"name":"TxExecutionError","subtypes":["ActionError","InvalidTxError"],"props":{}},"Unreachable":{"name":"Unreachable","subtypes":[],"props":{}}
78,"UnsuitableStakingKey":{"name":"UnsuitableStakingKey","subtypes":[],"props":{"public_key":""}},"UnsupportedProtocolFeature":{"name":"UnsupportedProtocolFeature","subtypes":[],"props":{"protocol_feature":"","version":""}},"ValueLengthExceeded":{"name":"ValueLengthExceeded","subtypes":[],"props":{"length":"","limit":""}},"WasmTrap":{"name":"WasmTrap","subtypes":["Unreachable","IncorrectCallIndirectSignature","MemoryOutOfBounds","CallIndirectOOB","IllegalArithmetic","MisalignedAtomicAccess","IndirectCallToNull","StackOverflow","GenericTrap"],"props":{}},"WasmerCompileError":{"name":"WasmerCompileError","subtypes":[],"props":{"msg":""}},"Closed":{"name":"Closed","subtypes":[],"props":{}},"ServerError":{"name":"ServerError","subtypes":["TxExecutionError","Timeout","Closed"],"props":{}},"Timeout":{"name":"Timeout","subtypes":[],"props":{}}}}')},51539:e=>{"use strict";e.exports=JSON.parse('{"GasLimitExceeded":"Exceeded the maximum amount of gas allowed to burn per contract","MethodEmptyName":"Method name is empty","WasmerCompileError":"Wasmer compilation error: {{msg}}","GuestPanic":"Smart contract panicked: {{panic_msg}}","Memory":"Error creating Wasm memory","GasExceeded":"Exceeded the prepaid gas","MethodUTF8Error":"Method name is not valid UTF8 string","BadUTF16":"String encoding is bad UTF-16 sequence","WasmTrap":"WebAssembly trap: {{msg}}","GasInstrumentation":"Gas instrumentation failed or contract has denied instructions.","InvalidPromiseIndex":"{{promise_idx}} does not correspond to existing promises","InvalidPromiseResultIndex":"Accessed invalid promise result index: {{result_idx}}","Deserialization":"Error happened while deserializing the module","MethodNotFound":"Contract method is not found","InvalidRegisterId":"Accessed invalid register id: {{register_id}}","InvalidReceiptIndex":"VM Logic returned an invalid receipt index: {{receipt_index}}","EmptyMethodName":"Method name is empty in contract call","CannotReturnJointPromise":"Returning joint promise is currently prohibited","StackHeightInstrumentation":"Stack instrumentation failed","CodeDoesNotExist":"Cannot find contract code for account {{account_id}}","MethodInvalidSignature":"Invalid method signature","IntegerOverflow":"Integer overflow happened during contract execution","MemoryAccessViolation":"MemoryAccessViolation","InvalidIteratorIndex":"Iterator index {{iterator_index}} does not exist","IteratorWasInvalidated":"Iterator {{iterator_index}} was invalidated after its creation by performing a mutable operation on trie","InvalidAccountId":"VM Logic returned an invalid account id","Serialization":"Error happened while serializing the module","CannotAppendActionToJointPromise":"Actions can only be appended to non-joint promise.","InternalMemoryDeclared":"Internal memory declaration has been found in the module","Instantiate":"Error happened during instantiation","ProhibitedInView":"{{method_name}} is not allowed in view calls","InvalidMethodName":"VM Logic returned an invalid method name","BadUTF8":"String encoding is bad UTF-8 sequence","BalanceExceeded":"Exceeded the account balance","LinkError":"Wasm contract link error: {{msg}}","InvalidPublicKey":"VM Logic provided an invalid public key","ActorNoPermission":"Actor {{actor_id}} doesn\'t have permission to account {{account_id}} to complete the action","LackBalanceForState":"The account {{account_id}} wouldn\'t have enough balance to cover storage, required to have {{amount}} yoctoNEAR more","ReceiverMismatch":"Wrong AccessKey used for transaction: transaction is sent to receiver_id={{tx_receiver}}, but is signed with function call access key that restricted to only use with receiver_id={{ak_receiver}}. Either change receiver_id in your transaction or switch to use a FullAccessKey.","CostOverflow":"Transaction gas or balance cost is too high","InvalidSignature":"Transaction is not signed with the given public key","AccessKeyNotFound":"Signer \\"{{account_id}}\\" doesn\'t have access key with the given public_key {{public_key}}","NotEnoughBalance":"Sender {{signer_id}} does not have enough balance {{#formatNear}}{{balance}}{{/formatNear}} for operation costing {{#formatNear}}{{cost}}{{/formatNear}}
78","NotEnoughAllowance":"Access Key {account_id}:{public_key} does not have enough balance {{#formatNear}}{{allowance}}{{/formatNear}} for transaction costing {{#formatNear}}{{cost}}{{/formatNear}}","Expired":"Transaction has expired","DeleteAccountStaking":"Account {{account_id}} is staking and can not be deleted","SignerDoesNotExist":"Signer {{signer_id}} does not exist","TriesToStake":"Account {{account_id}} tried to stake {{#formatNear}}{{stake}}{{/formatNear}}, but has staked {{#formatNear}}{{locked}}{{/formatNear}} and only has {{#formatNear}}{{balance}}{{/formatNear}}","AddKeyAlreadyExists":"The public key {{public_key}} is already used for an existing access key","InvalidSigner":"Invalid signer account ID {{signer_id}} according to requirements","CreateAccountNotAllowed":"The new account_id {{account_id}} can\'t be created by {{predecessor_id}}","RequiresFullAccess":"The transaction contains more then one action, but it was signed with an access key which allows transaction to apply only one specific action. To apply more then one actions TX must be signed with a full access key","TriesToUnstake":"Account {{account_id}} is not yet staked, but tried to unstake","InvalidNonce":"Transaction nonce {{tx_nonce}} must be larger than nonce of the used access key {{ak_nonce}}","AccountAlreadyExists":"Can\'t create a new account {{account_id}}, because it already exists","InvalidChain":"Transaction parent block hash doesn\'t belong to the current chain","AccountDoesNotExist":"Can\'t complete the action because account {{account_id}} doesn\'t exist","AccessKeyDoesNotExist":"Can\'t complete the action because access key {{public_key}} doesn\'t exist","MethodNameMismatch":"Transaction method name {{method_name}} isn\'t allowed by the access key","DeleteAccountHasRent":"Account {{account_id}} can\'t be deleted. It has {{#formatNear}}{{balance}}{{/formatNear}}, which is enough to cover the rent","DeleteAccountHasEnoughBalance":"Account {{account_id}} can\'t be deleted. It has {{#formatNear}}{{balance}}{{/formatNear}}, which is enough to cover it\'s storage","InvalidReceiver":"Invalid receiver account ID {{receiver_id}} according to requirements","DeleteKeyDoesNotExist":"Account {{account_id}} tries to remove an access key that doesn\'t exist","Timeout":"Timeout exceeded","Closed":"Connection closed"}')},60332:e=>{"use strict";e.exports=JSON.parse('{"schema":{"AccessKeyNotFound":{"name":"AccessKeyNotFound","subtypes":[],"props":{"account_id":"","public_key":""}},"AccountAlreadyExists":{"name":"AccountAlreadyExists","subtypes":[],"props":{"account_id":""}},"AccountDoesNotExist":{"name":"AccountDoesNotExist","subtypes":[],"props":{"account_id":""}},"ActionError":{"name":"ActionError","subtypes":["AccountAlreadyExists","AccountDoesNotExist","CreateAccountOnlyByRegistrar","CreateAccountNotAllowed","ActorNoPermission","DeleteKeyDoesNotExist","AddKeyAlreadyExists","DeleteAccountStaking","LackBalanceForState","TriesToUnstake","TriesToStake","InsufficientStake","FunctionCallError","NewReceiptValidationError","OnlyImplicitAccountCreationAllowed","DeleteAccountWithLargeState","DelegateActionInvalidSignature","DelegateActionSenderDoesNotMatchTxReceiver","DelegateActionExpired","DelegateActionAccessKeyError","DelegateActionInvalidNonce","DelegateActionNonceTooLarge"],"props":{"index":""}},"ActionsValidationError":{"name":"ActionsValidationError","subtypes":["DeleteActionMustBeFinal","TotalPrepaidGasExceeded","TotalNumberOfActionsExceeded","AddKeyMethodNamesNumberOfBytesExceeded","AddKeyMethodNameLengthExceeded","IntegerOverflow","InvalidAccountId","ContractSizeExceeded","FunctionCallMethodNameLengthExceeded","FunctionCallArgumentsLengthExceeded","UnsuitableStakingKey","FunctionCallZeroAttachedGas","DelegateActionMustBeOnlyOne","UnsupportedProtocolFeature"],"props":{}},"ActorNoPermission":{"name":"ActorNoPermission","subtypes":[],"props":{"account_id":"","actor_id":""}},"AddKeyAlreadyExists":{"name":"AddKeyAlreadyExists","subtypes":[],"props":{"account_id":"","public_key":""}},"AddKeyMethodNameLengthExceeded":{"name":"AddKeyMethodNameLengthExceeded","subtypes":[],"props":{"length":"","limit":""}},"AddKeyMethodNamesNumberOfBytesExceeded":{"name":"AddKeyMethodNamesNumberOfBytesExceeded","subtypes":[],"props":{"limit":"","total_number_of_bytes":""}},"AltBn128InvalidInput":{"name":"AltBn128InvalidInput","subtypes":[],"props":{"msg":""}}
78,"BadUTF16":{"name":"BadUTF16","subtypes":[],"props":{}},"BadUTF8":{"name":"BadUTF8","subtypes":[],"props":{}},"BalanceExceeded":{"name":"BalanceExceeded","subtypes":[],"props":{}},"BalanceMismatchError":{"name":"BalanceMismatchError","subtypes":[],"props":{"final_accounts_balance":"","final_postponed_receipts_balance":"","incoming_receipts_balance":"","incoming_validator_rewards":"","initial_accounts_balance":"","initial_postponed_receipts_balance":"","new_delayed_receipts_balance":"","other_burnt_amount":"","outgoing_receipts_balance":"","processed_delayed_receipts_balance":"","slashed_burnt_amount":"","tx_burnt_amount":""}},"CallIndirectOOB":{"name":"CallIndirectOOB","subtypes":[],"props":{}},"CannotAppendActionToJointPromise":{"name":"CannotAppendActionToJointPromise","subtypes":[],"props":{}},"CannotReturnJointPromise":{"name":"CannotReturnJointPromise","subtypes":[],"props":{}},"CodeDoesNotExist":{"name":"CodeDoesNotExist","subtypes":[],"props":{"account_id":""}},"CompilationError":{"name":"CompilationError","subtypes":["CodeDoesNotExist","PrepareError","WasmerCompileError"],"props":{}},"ContractSizeExceeded":{"name":"ContractSizeExceeded","subtypes":[],"props":{"limit":"","size":""}},"CostOverflow":{"name":"CostOverflow","subtypes":[],"props":{}},"CreateAccountNotAllowed":{"name":"CreateAccountNotAllowed","subtypes":[],"props":{"account_id":"","predecessor_id":""}},"CreateAccountOnlyByRegistrar":{"name":"CreateAccountOnlyByRegistrar","subtypes":[],"props":{"account_id":"","predecessor_id":"","registrar_account_id":""}},"DelegateActionExpired":{"name":"DelegateActionExpired","subtypes":[],"props":{}},"DelegateActionInvalidNonce":{"name":"DelegateActionInvalidNonce","subtypes":[],"props":{"ak_nonce":"","delegate_nonce":""}},"DelegateActionInvalidSignature":{"name":"DelegateActionInvalidSignature","subtypes":[],"props":{}},"DelegateActionMustBeOnlyOne":{"name":"DelegateActionMustBeOnlyOne","subtypes":[],"props":{}},"DelegateActionNonceTooLarge":{"name":"DelegateActionNonceTooLarge","subtypes":[],"props":{"delegate_nonce":"","upper_bound":""}},"DelegateActionSenderDoesNotMatchTxReceiver":{"name":"DelegateActionSenderDoesNotMatchTxReceiver","subtypes":[],"props":{"receiver_id":"","sender_id":""}},"DeleteAccountStaking":{"name":"DeleteAccountStaking","subtypes":[],"props":{"account_id":""}},"DeleteAccountWithLargeState":{"name":"DeleteAccountWithLargeState","subtypes":[],"props":{"account_id":""}},"DeleteActionMustBeFinal":{"name":"DeleteActionMustBeFinal","subtypes":[],"props":{}},"DeleteKeyDoesNotExist":{"name":"DeleteKeyDoesNotExist","subtypes":[],"props":{"account_id":"","public_key":""}},"DepositWithFunctionCall":{"name":"DepositWithFunctionCall","subtypes":[],"props":{}},"Deprecated":{"name":"Deprecated","subtypes":[],"props":{"method_name":""}},"Deserialization":{"name":"Deserialization","subtypes":[],"props":{}},"ECRecoverError":{"name":"ECRecoverError","subtypes":[],"props":{"msg":""}},"Ed25519VerifyInvalidInput":{"name":"Ed25519VerifyInvalidInput","subtypes":[],"props":{"msg":""}},"EmptyMethodName":{"name":"EmptyMethodName","subtypes":[],"props":{}},"Expired":{"name":"Expired","subtypes":[],"props":{}},"FunctionCallArgumentsLengthExceeded":{"name":"FunctionCallArgumentsLengthExceeded","subtypes":[],"props":{"length":"","limit":""}},"FunctionCallMethodNameLengthExceeded":{"name":"FunctionCallMethodNameLengthExceeded","subtypes":[],"props":{"length":"","limit":""}},"FunctionCallZeroAttachedGas":{"name":"FunctionCallZeroAttachedGas","subtypes":[],"props":{}},"GasExceeded":{"name":"GasExceeded","subtypes":[],"props":{}},"GasInstrumentation":{"name":"GasInstrumentation","subtypes":[],"props":{}},"GasLimitExceeded":{"name":"GasLimitExceeded","subtypes":[],"props":{}},"GenericTrap":{"name":"GenericTrap","subtypes":[],"props":{}},"GuestPanic":{"name":"GuestPanic","subtypes":[],"props":{"panic_msg":""}},"HostError":{"name":"HostError","subtypes":["BadUTF16","BadUTF8","GasExceeded","GasLimitExceeded","BalanceExceeded","EmptyMethodName","GuestPanic","IntegerOverflow","InvalidPromiseIndex","CannotAppendActionToJointPromise","CannotReturnJointPromise","InvalidPromiseResultIndex","InvalidRegisterId","IteratorWasInvalidated","MemoryAccessViolation","InvalidReceiptIndex","InvalidIteratorIndex","InvalidAccountId","InvalidMethodName","InvalidPublicKey","ProhibitedInView","NumberOfLogsExceeded","KeyLengthExceeded","ValueLengthExceeded","TotalLogLengthExceeded","NumberPromisesExceeded","NumberInputDataDependenciesExceeded","ReturnedValueLengthExceeded","ContractSizeExceeded","Deprecated","ECRecover
78Error","AltBn128InvalidInput","Ed25519VerifyInvalidInput"],"props":{}},"IllegalArithmetic":{"name":"IllegalArithmetic","subtypes":[],"props":{}},"IncorrectCallIndirectSignature":{"name":"IncorrectCallIndirectSignature","subtypes":[],"props":{}},"IndirectCallToNull":{"name":"IndirectCallToNull","subtypes":[],"props":{}},"Instantiate":{"name":"Instantiate","subtypes":[],"props":{}},"InsufficientStake":{"name":"InsufficientStake","subtypes":[],"props":{"account_id":"","minimum_stake":"","stake":""}},"IntegerOverflow":{"name":"IntegerOverflow","subtypes":[],"props":{}},"InternalMemoryDeclared":{"name":"InternalMemoryDeclared","subtypes":[],"props":{}},"InvalidAccessKeyError":{"name":"InvalidAccessKeyError","subtypes":["AccessKeyNotFound","ReceiverMismatch","MethodNameMismatch","RequiresFullAccess","NotEnoughAllowance","DepositWithFunctionCall"],"props":{}},"InvalidAccountId":{"name":"InvalidAccountId","subtypes":[],"props":{}},"InvalidChain":{"name":"InvalidChain","subtypes":[],"props":{}},"InvalidDataReceiverId":{"name":"InvalidDataReceiverId","subtypes":[],"props":{"account_id":""}},"InvalidIteratorIndex":{"name":"InvalidIteratorIndex","subtypes":[],"props":{"iterator_index":""}}
78,"InvalidMethodName":{"name":"InvalidMethodName","subtypes":[],"props":{}},"InvalidNonce":{"name":"InvalidNonce","subtypes":[],"props":{"ak_nonce":"","tx_nonce":""}},"InvalidPredecessorId":{"name":"InvalidPredecessorId","subtypes":[],"props":{"account_id":""}},"InvalidPromiseIndex":{"name":"InvalidPromiseIndex","subtypes":[],"props":{"promise_idx":""}},"InvalidPromiseResultIndex":{"name":"InvalidPromiseResultIndex","subtypes":[],"props":{"result_idx":""}},"InvalidPublicKey":{"name":"InvalidPublicKey","subtypes":[],"props":{}},"InvalidReceiptIndex":{"name":"InvalidReceiptIndex","subtypes":[],"props":{"receipt_index":""}},"InvalidReceiverId":{"name":"InvalidReceiverId","subtypes":[],"props":{"account_id":""}},"InvalidRegisterId":{"name":"InvalidRegisterId","subtypes":[],"props":{"register_id":""}},"InvalidSignature":{"name":"InvalidSignature","subtypes":[],"props":{}},"InvalidSignerId":{"name":"InvalidSignerId","subtypes":[],"props":{"account_id":""}},"InvalidTxError":{"name":"InvalidTxError","subtypes":["InvalidAccessKeyError","InvalidSignerId","SignerDoesNotExist","InvalidNonce","NonceTooLarge","InvalidReceiverId","InvalidSignature","NotEnoughBalance","LackBalanceForState","CostOverflow","InvalidChain","Expired","ActionsValidation","TransactionSizeExceeded"],"props":{}},"IteratorWasInvalidated":{"name":"IteratorWasInvalidated","subtypes":[],"props":{"iterator_index":""}}
78,"KeyLengthExceeded":{"name":"KeyLengthExceeded","subtypes":[],"props":{"length":"","limit":""}},"LackBalanceForState":{"name":"LackBalanceForState","subtypes":[],"props":{"account_id":"","amount":""}},"Memory":{"name":"Memory","subtypes":[],"props":{}},"MemoryAccessViolation":{"name":"MemoryAccessViolation","subtypes":[],"props":{}},"MemoryOutOfBounds":{"name":"MemoryOutOfBounds","subtypes":[],"props":{}},"MethodEmptyName":{"name":"MethodEmptyName","subtypes":[],"props":{}},"MethodInvalidSignature":{"name":"MethodInvalidSignature","subtypes":[],"props":{}},"MethodNameMismatch":{"name":"MethodNameMismatch","subtypes":[],"props":{"method_name":""}},"MethodNotFound":{"name":"MethodNotFound","subtypes":[],"props":{}},"MethodResolveError":{"name":"MethodResolveError","subtypes":["MethodEmptyName","MethodNotFound","MethodInvalidSignature"],"props":{}},"MisalignedAtomicAccess":{"name":"MisalignedAtomicAccess","subtypes":[],"props":{}},"NonceTooLarge":{"name":"NonceTooLarge","subtypes":[],"props":{"tx_nonce":"","upper_bound":""}},"NotEnoughAllowance":{"name":"NotEnoughAllowance","subtypes":[],"props":{"account_id":"","allowance":"","cost":"","public_key":""}},"NotEnoughBalance":{"name":"NotEnoughBalance","subtypes":[],"props":{"balance":"","cost":"","signer_id":""}},"NumberInputDataDependenciesExceeded":{"name":"NumberInputDataDependenciesExceeded","subtypes":[],"props":{"limit":"","number_of_input_data_dependencies":""}},"NumberOfLogsExceeded":{"name":"NumberOfLogsExceeded","subtypes":[],"props":{"limit":""}},"NumberPromisesExceeded":{"name":"NumberPromisesExceeded","subtypes":[],"props":{"limit":"","number_of_promises":""}},"OnlyImplicitAccountCreationAllowed":{"name":"OnlyImplicitAccountCreationAllowed","subtypes":[],"props":{"account_id":""}},"PrepareError":{"name":"PrepareError","subtypes":["Serialization","Deserialization","InternalMemoryDeclared","GasInstrumentation","StackHeightInstrumentation","Instantiate","Memory","TooManyFunctions","TooManyLocals"],"props":{}},"ProhibitedInView":{"name":"ProhibitedInView","subtypes":[],"props":{"method_name":""}},"ReceiptValidationError":{"name":"ReceiptValidationError","subtypes":["InvalidPredecessorId","InvalidReceiverId","InvalidSignerId","InvalidDataReceiverId","ReturnedValueLengthExceeded","NumberInputDataDependenciesExceeded","ActionsValidation"],"props":{}},"ReceiverMismatch":{"name":"ReceiverMismatch","subtypes":[],"props":{"ak_receiver":"","tx_receiver":""}},"RequiresFullAccess":{"name":"RequiresFullAccess","subtypes":[],"props":{}},"ReturnedValueLengthExceeded":{"name":"ReturnedValueLengthExceeded","subtypes":[],"props":{"length":"","limit":""}},"Serialization":{"name":"Serialization","subtypes":[],"props":{}},"SignerDoesNotExist":{"name":"SignerDoesNotExist","subtypes":[],"props":{"signer_id":""}},"StackHeightInstrumentation":{"name":"StackHeightInstrumentation","subtypes":[],"props":{}},"StackOverflow":{"name":"StackOverflow","subtypes":[],"props":{}},"TooManyFunctions":{"name":"TooManyFunctions","subtypes":[],"props":{}},"TooManyLocals":{"name":"TooManyLocals","subtypes":[],"props":{}},"TotalLogLengthExceeded":{"name":"TotalLogLengthExceeded","subtypes":[],"props":{"length":"","limit":""}},"TotalNumberOfActionsExceeded":{"name":"TotalNumberOfActionsExceeded","subtypes":[],"props":{"limit":"","total_number_of_actions":""}},"TotalPrepaidGasExceeded":{"name":"TotalPrepaidGasExceeded","subtypes":[],"props":{"limit":"","total_prepaid_gas":""}},"TransactionSizeExceeded":{"name":"TransactionSizeExceeded","subtypes":[],"props":{"limit":"","size":""}},"TriesToStake":{"name":"TriesToStake","subtypes":[],"props":{"account_id":"","balance":"","locked":"","stake":""}},"TriesToUnstake":{"name":"TriesToUnstake","subtypes":[],"props":{"account_id":""}},"TxExecutionError":{"name":"TxExecutionError","subtypes":["ActionError","InvalidTxError"],"props":{}},"Unreachable":{"name":"Unreachable","subtypes":[],"props":{}},"UnsuitableStakingKey":{"name":"UnsuitableStakingKey","subtypes":[],"props":{"public_key":""}},"UnsupportedProtocolFeature":{"name":"UnsupportedProtocolFeature","subtypes":[],"props":{"protocol_feature":"","version":""}},"ValueLengthExceeded":{"name":"ValueLengthExceeded","subtypes":[],"props":{"length":"","limit":""}},"WasmTrap":{"name":"WasmTrap","subtypes":["Unreachable","IncorrectCallIndirectSignature","MemoryOutOfBounds","CallIndirectOOB","IllegalArithmetic","MisalignedAtomicAccess","IndirectCallToNull","StackOverflow","GenericTrap"],"props":{}},"WasmerCompileError":{"name":"WasmerCompileError","subtypes":[],"props":{"msg":""}},"Closed":{"name":"Closed","subtypes":[],"props":{}},"ServerError":{"name":"ServerError","subtypes":["TxExecutionError","Timeout","Closed"],"props":{}},"Timeout":{"name":"Timeout","subtypes":[],"props":{}}}}')},59832:e=>{"use strict";e.exports=JSON.parse('{"$id":"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#","description":"Meta-schema for $data reference (JSON AnySchema extension proposal)","type":"object","required":["$data"],"properties":{"$data":{"type":"string","anyOf":[{"format":"relative-json-pointer"},{"format":"json-pointer"}]}},"additionalProperties":false}')},5754:e=>{"use strict";e.exports=JSON.parse('{"$schema":"http://json-schema.org/draft-07/schema#","$id":"http://json-schema.org/draft-07/schema#","title":"Core schema meta-schema","definitions":{"schemaArray":{"type":"array","minItems":1,"items":{"$ref":"#"}},"nonNegativeInteger":{"type":"integer","minimum":0},"nonNegativeIntegerDefault0":{"allOf":[{"$ref":"#/definitions/nonNegativeInteger"},{"default":0}]},"simpleTypes":{"enum":["array","boolean","integer","null","number","object","string"]},"stringArray":{"type":"array","items":{"type":"string"},"uniqueItems":true,"default":[]}},"type":["object","boolean"],"properties":{"$id":{"type":"string","format":"uri-reference"},"$schema":{"type":"string","format":"uri"},"$ref":{"type":"string","format":"uri-reference"},"$comment":{"type":"string"},"title":{"type":"string"},"description":{"type":"string"},"default":true,"readOnly":{"type":"boolean","default":false},"examples":{"type":"array","items":true},"multipleOf":{"type":"number","exclusiveMinimum":0},"maximum":{"type":"number"},"exclusiveMaximum":{"type":"number"},"minimum":{"type":"number"},"exclusiveMinimum":{"type":"number"},"maxLength":{"$ref":"#/definitions/nonNegativeInteger"},"minLength":{"$ref":"#/definitions/nonNegativeIntegerDefault0"},"pattern":{"type":"string","format":"regex"},"additionalItems":{"$ref":"#"},"items":{"anyOf":[{"$ref":"#"},{"$ref":"#/definitions/schemaArray"}],"default":true}
vendor: 1,444 bytes, line 78
78,"maxItems":{"$ref":"#/definitions/nonNegativeInteger"},"minItems":{"$ref":"#/definitions/nonNegativeIntegerDefault0"},"uniqueItems":{"type":"boolean","default":false},"contains":{"$ref":"#"},"maxProperties":{"$ref":"#/definitions/nonNegativeInteger"},"minProperties":{"$ref":"#/definitions/nonNegativeIntegerDefault0"},"required":{"$ref":"#/definitions/stringArray"},"additionalProperties":{"$ref":"#"},"definitions":{"type":"object","additionalProperties":{"$ref":"#"},"default":{}},"properties":{"type":"object","additionalProperties":{"$ref":"#"},"default":{}},"patternProperties":{"type":"object","additionalProperties":{"$ref":"#"},"propertyNames":{"format":"regex"},"default":{}},"dependencies":{"type":"object","additionalProperties":{"anyOf":[{"$ref":"#"},{"$ref":"#/definitions/stringArray"}]}},"propertyNames":{"$ref":"#"},"const":true,"enum":{"type":"array","items":true,"minItems":1,"uniqueItems":true},"type":{"anyOf":[{"$ref":"#/definitions/simpleTypes"},{"type":"array","items":{"$ref":"#/definitions/simpleTypes"},"minItems":1,"uniqueItems":true}]},"format":{"type":"string"},"contentMediaType":{"type":"string"},"contentEncoding":{"type":"string"},"if":{"$ref":"#"},"then":{"$ref":"#"},"else":{"$ref":"#"},"allOf":{"$ref":"#/definitions/schemaArray"},"anyOf":{"$ref":"#/definitions/schemaArray"},"oneOf":{"$ref":"#/definitions/schemaArray"},"not":{"$ref":"#"}},"default":true}')},14537:e=>{"use strict";e.exports={rE:"6.6.1"}}
78,35495:e=>{"use strict";e.exports=JSON.parse('{"GasLimitExceeded":"Exceeded the maximum amount of gas allowed to burn per contract","MethodEmptyName":"Method name is empty","WasmerCompileError":"Wasmer compilation error: {{msg}}","GuestPanic":"Smart contract panicked: {{panic_msg}}","Memory":"Error creating Wasm memory","GasExceeded":"Exceeded the prepaid gas","MethodUTF8Error":"Method name is not valid UTF8 string","BadUTF16":"String encoding is bad UTF-16 sequence","WasmTrap":"WebAssembly trap: {{msg}}","GasInstrumentation":"Gas instrumentation failed or contract has denied instructions.","InvalidPromiseIndex":"{{promise_idx}} does not correspond to existing promises","InvalidPromiseResultIndex":"Accessed invalid promise result index: {{result_idx}}","Deserialization":"Error happened while deserializing the module","MethodNotFound":"Contract method is not found","InvalidRegisterId":"Accessed invalid register id: {{register_id}}","InvalidReceiptIndex":"VM Logic returned an invalid receipt index: {{receipt_index}}","EmptyMethodName":"Method name is empty in contract call","CannotReturnJointPromise":"Returning joint promise is currently prohibited","StackHeightInstrumentation":"Stack instrumentation failed","CodeDoesNotExist":"Cannot find contract code for account {{account_id}}","MethodInvalidSignature":"Invalid method signature","IntegerOverflow":"Integer overflow happened during contract execution","MemoryAccessViolation":"MemoryAccessViolation","InvalidIteratorIndex":"Iterator index {{iterator_index}} does not exist","IteratorWasInvalidated":"Iterator {{iterator_index}} was invalidated after its creation by performing a mutable operation on trie","InvalidAccountId":"VM Logic returned an invalid account id","Serialization":"Error happened while serializing the module","CannotAppendActionToJointPromise":"Actions can only be appended to non-joint promise.","InternalMemoryDeclared":"Internal memory declaration has been found in the module","Instantiate":"Error happened during instantiation","ProhibitedInView":"{{method_name}} is not allowed in view calls","InvalidMethodName":"VM Logic returned an invalid method name","BadUTF8":"String encoding is bad UTF-8 sequence","BalanceExceeded":"Exceeded the account balance","LinkError":"Wasm contract link error: {{msg}}","InvalidPublicKey":"VM Logic provided an invalid public key","ActorNoPermission":"Actor {{actor_id}} doesn\'t have permission to account {{account_id}} to complete the action","LackBalanceForState":"The account {{account_id}} wouldn\'t have enough balance to cover storage, required to have {{amount}} yoctoNEAR more","ReceiverMismatch":"Wrong AccessKey used for transaction: transaction is sent to receiver_id={{tx_receiver}}, but is signed with function call access key that restricted to only use with receiver_id={{ak_receiver}}. Either change receiver_id in your transaction or switch to use a FullAccessKey.","CostOverflow":"Transaction gas or balance cost is too high","InvalidSignature":"Transaction is not signed with the given public key","AccessKeyNotFound":"Signer \\"{{account_id}}\\" doesn\'t have access key with the given public_key {{public_key}}","NotEnoughBalance":"Sender {{signer_id}} does not have enough balance {{#formatNear}}{{balance}}{{/formatNear}} for operation costing {{#formatNear}}{{cost}}{{/formatNear}}","NotEnoughAllowance":"Access Key {account_id}:{public_key} does not have enough balance {{#formatNear}}{{allowance}}{{/formatNear}} for transaction costing {{#formatNear}}{{cost}}{{/formatNear}}","Expired":"Transaction has expired","DeleteAccountStaking":"Account {{account_id}} is staking and can not be deleted","SignerDoesNotExist":"Signer {{signer_id}} does not exist","TriesToStake":"Account {{account_id}} tried to stake {{#formatNear}}{{stake}}{{/formatNear}}, but has staked {{#formatNear}}{{locked}}{{/formatNear}} and only has {{#formatNear}}{{balance}}{{/formatNear}}","AddKeyAlreadyExists":"The public key {{public_key}} is already used for an existing access key","InvalidSigner":"Invalid signer account ID {{signer_id}} according to requirements","CreateAccountNotAllowed":"The new account_id {{account_id}} can\'t be created by {{predecessor_id}}","RequiresFullAccess":"The transaction contains more then one action, but it was signed with an access key which allows transaction to apply only one specific action. To apply more then one actions TX must be signed with a full access key","TriesToUnstake":"Account {{account_id}} is not yet staked, but tried to unstake","InvalidNonce":"Transaction nonce {{tx_nonce}} must be larger than nonce of the used access key {{ak_nonce}}","AccountAlreadyExists":"Can\'t create a new account {{account_id}}, because it already exists","InvalidChain":"Transaction parent block hash doesn\'t belong to the current chain","AccountDoesNotExist":"Can\'t complete the action because account {{account_id}} doesn\'t exist","AccessKeyDoesNotExist":"Can\'t complete the action because access key {{public_key}}
78 doesn\'t exist","MethodNameMismatch":"Transaction method name {{method_name}} isn\'t allowed by the access key","DeleteAccountHasRent":"Account {{account_id}} can\'t be deleted. It has {{#formatNear}}{{balance}}{{/formatNear}}, which is enough to cover the rent","DeleteAccountHasEnoughBalance":"Account {{account_id}} can\'t be deleted. It has {{#formatNear}}{{balance}}{{/formatNear}}, which is enough to cover it\'s storage","InvalidReceiver":"Invalid receiver account ID {{receiver_id}} according to requirements","DeleteKeyDoesNotExist":"Account {{account_id}} tries to remove an access key that doesn\'t exist","Timeout":"Timeout exceeded","Closed":"Connection closed"}')},42728:e=>{"use strict";e.exports=JSON.parse('{"schema":{"AccessKeyNotFound":{"name":"AccessKeyNotFound","subtypes":[],"props":{"account_id":"","public_key":""}},"AccountAlreadyExists":{"name":"AccountAlreadyExists","subtypes":[],"props":{"account_id":""}},"AccountDoesNotExist":{"name":"AccountDoesNotExist","subtypes":[],"props":{"account_id":""}},"ActionError":{"name":"ActionError","subtypes":["AccountAlreadyExists","AccountDoesNotExist","CreateAccountOnlyByRegistrar","CreateAccountNotAllowed","ActorNoPermission","DeleteKeyDoesNotExist","AddKeyAlreadyExists","DeleteAccountStaking","LackBalanceForState","TriesToUnstake","TriesToStake","InsufficientStake","FunctionCallError","NewReceiptValidationError","OnlyImplicitAccountCreationAllowed","DeleteAccountWithLargeState","DelegateActionInvalidSignature","DelegateActionSenderDoesNotMatchTxReceiver","DelegateActionExpired","DelegateActionAccessKeyError","DelegateActionInvalidNonce","DelegateActionNonceTooLarge"],"props":{"index":""}},"ActionsValidationError":{"name":"ActionsValidationError","subtypes":["DeleteActionMustBeFinal","TotalPrepaidGasExceeded","TotalNumberOfActionsExceeded","AddKeyMethodNamesNumberOfBytesExceeded","AddKeyMethodNameLengthExceeded","IntegerOverflow","InvalidAccountId","ContractSizeExceeded","FunctionCallMethodNameLengthExceeded","FunctionCallArgumentsLengthExceeded","UnsuitableStakingKey","FunctionCallZeroAttachedGas","DelegateActionMustBeOnlyOne","UnsupportedProtocolFeature"],"props":{}},"ActorNoPermission":{"name":"ActorNoPermission","subtypes":[],"props":{"account_id":"","actor_id":""}},"AddKeyAlreadyExists":{"name":"AddKeyAlreadyExists","subtypes":[],"props":{"account_id":"","public_key":""}},"AddKeyMethodNameLengthExceeded":{"name":"AddKeyMethodNameLengthExceeded","subtypes":[],"props":{"length":"","limit":""}},"AddKeyMethodNamesNumberOfBytesExceeded":{"name":"AddKeyMethodNamesNumberOfBytesExceeded","subtypes":[],"props":{"limit":"","total_number_of_bytes":""}},"AltBn128InvalidInput":{"name":"AltBn128InvalidInput","subtypes":[],"props":{"msg":""}},"BadUTF16":{"name":"BadUTF16","subtypes":[],"props":{}},"BadUTF8":{"name":"BadUTF8","subtypes":[],"props":{}},"BalanceExceeded":{"name":"BalanceExceeded","subtypes":[],"props":{}},"BalanceMismatchError":{"name":"BalanceMismatchError","subtypes":[],"props":{"final_accounts_balance":"","final_postponed_receipts_balance":"","incoming_receipts_balance":"","incoming_validator_rewards":"","initial_accounts_balance":"","initial_postponed_receipts_balance":"","new_delayed_receipts_balance":"","other_burnt_amount":"","outgoing_receipts_balance":"","processed_delayed_receipts_balance":"","slashed_burnt_amount":"","tx_burnt_amount":""}},"CallIndirectOOB":{"name":"CallIndirectOOB","subtypes":[],"props":{}},"CannotAppendActionToJointPromise":{"name":"CannotAppendActionToJointPromise","subtypes":[],"props":{}},"CannotReturnJointPromise":{"name":"CannotReturnJointPromise","subtypes":[],"props":{}},"CodeDoesNotExist":{"name":"CodeDoesNotExist","subtypes":[],"props":{"account_id":""}},"CompilationError":{"name":"CompilationError","subtypes":["CodeDoesNotExist","PrepareError","WasmerCompileError"],"props":{}},"ContractSizeExceeded":{"name":"ContractSizeExceeded","subtypes":[],"props":{"limit":"","size":""}},"CostOverflow":{"name":"CostOverflow","subtypes":[],"props":{}},"CreateAccountNotAllowed":{"name":"CreateAccountNotAllowed","subtypes":[],"props":{"account_id":"","predecessor_id":""}},"CreateAccountOnlyByRegistrar":{"name":"CreateAccountOnlyByRegistrar","subtypes":[],"props":{"account_id":"","predecessor_id":"","registrar_account_id":""}},"DelegateActionExpired":{"name":"DelegateActionExpired","subtypes":[],"props":{}},"DelegateActionInvalidNonce":{"name":"DelegateActionInvalidNonce","subtypes":[],"props":{"ak_nonce":"","delegate_nonce":""}}
78,"DelegateActionInvalidSignature":{"name":"DelegateActionInvalidSignature","subtypes":[],"props":{}},"DelegateActionMustBeOnlyOne":{"name":"DelegateActionMustBeOnlyOne","subtypes":[],"props":{}},"DelegateActionNonceTooLarge":{"name":"DelegateActionNonceTooLarge","subtypes":[],"props":{"delegate_nonce":"","upper_bound":""}},"DelegateActionSenderDoesNotMatchTxReceiver":{"name":"DelegateActionSenderDoesNotMatchTxReceiver","subtypes":[],"props":{"receiver_id":"","sender_id":""}},"DeleteAccountStaking":{"name":"DeleteAccountStaking","subtypes":[],"props":{"account_id":""}},"DeleteAccountWithLargeState":{"name":"DeleteAccountWithLargeState","subtypes":[],"props":{"account_id":""}},"DeleteActionMustBeFinal":{"name":"DeleteActionMustBeFinal","subtypes":[],"props":{}},"DeleteKeyDoesNotExist":{"name":"DeleteKeyDoesNotExist","subtypes":[],"props":{"account_id":"","public_key":""}},"DepositWithFunctionCall":{"name":"DepositWithFunctionCall","subtypes":[],"props":{}},"Deprecated":{"name":"Deprecated","subtypes":[],"props":{"method_name":""}},"Deserialization":{"name":"Deserialization","subtypes":[],"props":{}},"ECRecoverError":{"name":"ECRecoverError","subtypes":[],"props":{"msg":""}},"Ed25519VerifyInvalidInput":{"name":"Ed25519VerifyInvalidInput","subtypes":[],"props":{"msg":""}},"EmptyMethodName":{"name":"EmptyMethodName","subtypes":[],"props":{}},"Expired":{"name":"Expired","subtypes":[],"props":{}},"FunctionCallArgumentsLengthExceeded":{"name":"FunctionCallArgumentsLengthExceeded","subtypes":[],"props":{"length":"","limit":""}},"FunctionCallMethodNameLengthExceeded":{"name":"FunctionCallMethodNameLengthExceeded","subtypes":[],"props":{"length":"","limit":""}},"FunctionCallZeroAttachedGas":{"name":"FunctionCallZeroAttachedGas","subtypes":[],"props":{}},"GasExceeded":{"name":"GasExceeded","subtypes":[],"props":{}},"GasInstrumentation":{"name":"GasInstrumentation","subtypes":[],"props":{}},"GasLimitExceeded":{"name":"GasLimitExceeded","subtypes":[],"props":{}},"GenericTrap":{"name":"GenericTrap","subtypes":[],"props":{}},"GuestPanic":{"name":"GuestPanic","subtypes":[],"props":{"panic_msg":""}},"HostError":{"name":"HostError","subtypes":["BadUTF16","BadUTF8","GasExceeded","GasLimitExceeded","BalanceExceeded","EmptyMethodName","GuestPanic","IntegerOverflow","InvalidPromiseIndex","CannotAppendActionToJointPromise","CannotReturnJointPromise","InvalidPromiseResultIndex","InvalidRegisterId","IteratorWasInvalidated","MemoryAccessViolation","InvalidReceiptIndex","InvalidIteratorIndex","InvalidAccountId","InvalidMethodName","InvalidPublicKey","ProhibitedInView","NumberOfLogsExceeded","KeyLengthExceeded","ValueLengthExceeded","TotalLogLengthExceeded","NumberPromisesExceeded","NumberInputDataDependenciesExceeded","ReturnedValueLengthExceeded","ContractSizeExceeded","Deprecated","ECRecoverError","AltBn128InvalidInput","Ed25519VerifyInvalidInput"],"props":{}},"IllegalArithmetic":{"name":"IllegalArithmetic","subtypes":[],"props":{}},"IncorrectCallIndirectSignature":{"name":"IncorrectCallIndirectSignature","subtypes":[],"props":{}},"IndirectCallToNull":{"name":"IndirectCallToNull","subtypes":[],"props":{}},"Instantiate":{"name":"Instantiate","subtypes":[],"props":{}},"InsufficientStake":{"name":"InsufficientStake","subtypes":[],"props":{"account_id":"","minimum_stake":"","stake":""}},"IntegerOverflow":{"name":"IntegerOverflow","subtypes":[],"props":{}},"InternalMemoryDeclared":{"name":"InternalMemoryDeclared","subtypes":[],"props":{}},"InvalidAccessKeyError":{"name":"InvalidAccessKeyError","subtypes":["AccessKeyNotFound","ReceiverMismatch","MethodNameMismatch","RequiresFullAccess","NotEnoughAllowance","DepositWithFunctionCall"],"props":{}},"InvalidAccountId":{"name":"InvalidAccountId","subtypes":[],"props":{}},"InvalidChain":{"name":"InvalidChain","subtypes":[],"props":{}},"InvalidDataReceiverId":{"name":"InvalidDataReceiverId","subtypes":[],"props":{"account_id":""}},"InvalidIteratorIndex":{"name":"InvalidIteratorIndex","subtypes":[],"props":{"iterator_index":""}}
78,"InvalidMethodName":{"name":"InvalidMethodName","subtypes":[],"props":{}},"InvalidNonce":{"name":"InvalidNonce","subtypes":[],"props":{"ak_nonce":"","tx_nonce":""}},"InvalidPredecessorId":{"name":"InvalidPredecessorId","subtypes":[],"props":{"account_id":""}},"InvalidPromiseIndex":{"name":"InvalidPromiseIndex","subtypes":[],"props":{"promise_idx":""}},"InvalidPromiseResultIndex":{"name":"InvalidPromiseResultIndex","subtypes":[],"props":{"result_idx":""}},"InvalidPublicKey":{"name":"InvalidPublicKey","subtypes":[],"props":{}},"InvalidReceiptIndex":{"name":"InvalidReceiptIndex","subtypes":[],"props":{"receipt_index":""}},"InvalidReceiverId":{"name":"InvalidReceiverId","subtypes":[],"props":{"account_id":""}},"InvalidRegisterId":{"name":"InvalidRegisterId","subtypes":[],"props":{"register_id":""}},"InvalidSignature":{"name":"InvalidSignature","subtypes":[],"props":{}},"InvalidSignerId":{"name":"InvalidSignerId","subtypes":[],"props":{"account_id":""}},"InvalidTxError":{"name":"InvalidTxError","subtypes":["InvalidAccessKeyError","InvalidSignerId","SignerDoesNotExist","InvalidNonce","NonceTooLarge","InvalidReceiverId","InvalidSignature","NotEnoughBalance","LackBalanceForState","CostOverflow","InvalidChain","Expired","ActionsValidation","TransactionSizeExceeded"],"props":{}},"IteratorWasInvalidated":{"name":"IteratorWasInvalidated","subtypes":[],"props":{"iterator_index":""}}
78,"KeyLengthExceeded":{"name":"KeyLengthExceeded","subtypes":[],"props":{"length":"","limit":""}},"LackBalanceForState":{"name":"LackBalanceForState","subtypes":[],"props":{"account_id":"","amount":""}},"Memory":{"name":"Memory","subtypes":[],"props":{}},"MemoryAccessViolation":{"name":"MemoryAccessViolation","subtypes":[],"props":{}},"MemoryOutOfBounds":{"name":"MemoryOutOfBounds","subtypes":[],"props":{}},"MethodEmptyName":{"name":"MethodEmptyName","subtypes":[],"props":{}},"MethodInvalidSignature":{"name":"MethodInvalidSignature","subtypes":[],"props":{}},"MethodNameMismatch":{"name":"MethodNameMismatch","subtypes":[],"props":{"method_name":""}},"MethodNotFound":{"name":"MethodNotFound","subtypes":[],"props":{}},"MethodResolveError":{"name":"MethodResolveError","subtypes":["MethodEmptyName","MethodNotFound","MethodInvalidSignature"],"props":{}},"MisalignedAtomicAccess":{"name":"MisalignedAtomicAccess","subtypes":[],"props":{}},"NonceTooLarge":{"name":"NonceTooLarge","subtypes":[],"props":{"tx_nonce":"","upper_bound":""}},"NotEnoughAllowance":{"name":"NotEnoughAllowance","subtypes":[],"props":{"account_id":"","allowance":"","cost":"","public_key":""}},"NotEnoughBalance":{"name":"NotEnoughBalance","subtypes":[],"props":{"balance":"","cost":"","signer_id":""}},"NumberInputDataDependenciesExceeded":{"name":"NumberInputDataDependenciesExceeded","subtypes":[],"props":{"limit":"","number_of_input_data_dependencies":""}},"NumberOfLogsExceeded":{"name":"NumberOfLogsExceeded","subtypes":[],"props":{"limit":""}},"NumberPromisesExceeded":{"name":"NumberPromisesExceeded","subtypes":[],"props":{"limit":"","number_of_promises":""}},"OnlyImplicitAccountCreationAllowed":{"name":"OnlyImplicitAccountCreationAllowed","subtypes":[],"props":{"account_id":""}},"PrepareError":{"name":"PrepareError","subtypes":["Serialization","Deserialization","InternalMemoryDeclared","GasInstrumentation","StackHeightInstrumentation","Instantiate","Memory","TooManyFunctions","TooManyLocals"],"props":{}},"ProhibitedInView":{"name":"ProhibitedInView","subtypes":[],"props":{"method_name":""}},"ReceiptValidationError":{"name":"ReceiptValidationError","subtypes":["InvalidPredecessorId","InvalidReceiverId","InvalidSignerId","InvalidDataReceiverId","ReturnedValueLengthExceeded","NumberInputDataDependenciesExceeded","ActionsValidation"],"props":{}},"ReceiverMismatch":{"name":"ReceiverMismatch","subtypes":[],"props":{"ak_receiver":"","tx_receiver":""}},"RequiresFullAccess":{"name":"RequiresFullAccess","subtypes":[],"props":{}},"ReturnedValueLengthExceeded":{"name":"ReturnedValueLengthExceeded","subtypes":[],"props":{"length":"","limit":""}},"Serialization":{"name":"Serialization","subtypes":[],"props":{}},"SignerDoesNotExist":{"name":"SignerDoesNotExist","subtypes":[],"props":{"signer_id":""}},"StackHeightInstrumentation":{"name":"StackHeightInstrumentation","subtypes":[],"props":{}},"StackOverflow":{"name":"StackOverflow","subtypes":[],"props":{}},"TooManyFunctions":{"name":"TooManyFunctions","subtypes":[],"props":{}},"TooManyLocals":{"name":"TooManyLocals","subtypes":[],"props":{}},"TotalLogLengthExceeded":{"name":"TotalLogLengthExceeded","subtypes":[],"props":{"length":"","limit":""}},"TotalNumberOfActionsExceeded":{"name":"TotalNumberOfActionsExceeded","subtypes":[],"props":{"limit":"","total_number_of_actions":""}},"TotalPrepaidGasExceeded":{"name":"TotalPrepaidGasExceeded","subtypes":[],"props":{"limit":"","total_prepaid_gas":""}},"TransactionSizeExceeded":{"name":"TransactionSizeExceeded","subtypes":[],"props":{"limit":"","size":""}},"TriesToStake":{"name":"TriesToStake","subtypes":[],"props":{"account_id":"","balance":"","locked":"","stake":""}},"TriesToUnstake":{"name":"TriesToUnstake","subtypes":[],"props":{"account_id":""}},"TxExecutionError":{"name":"TxExecutionError","subtypes":["ActionError","InvalidTxError"],"props":{}},"Unreachable":{"name":"Unreachable","subtypes":[],"props":{}},"UnsuitableStakingKey":{"name":"UnsuitableStakingKey","subtypes":[],"props":{"public_key":""}},"UnsupportedProtocolFeature":{"name":"UnsupportedProtocolFeature","subtypes":[],"props":{"protocol_feature":"","version":""}},"ValueLengthExceeded":{"name":"ValueLengthExceeded","subtypes":[],"props":{"length":"","limit":""}},"WasmTrap":{"name":"WasmTrap","subtypes":["Unreachable","IncorrectCallIndirectSignature","MemoryOutOfBounds","CallIndirectOOB","IllegalArithmetic","MisalignedAtomicAccess","IndirectCallToNull","StackOverflow","GenericTrap"],"props":{}},"WasmerCompileError":{"name":"WasmerCompileError","subtypes":[],"props":{"msg":""}},"Closed":{"name":"Closed","subtypes":[],"props":{}},"ServerError":{"name":"ServerError","subtypes":["TxExecutionError","Timeout","Closed"],"props":{}},"Timeout":{"name":"Timeout","subtypes":[],"props":{}}}}')},16091:e=>{"use strict";e.exports=JSON.parse('{"$id":"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#","description":"Meta-schema for $data reference (JSON AnySchema extension proposal)","type":"object","required":["$data"],"properties":{"$data":{"type":"string","anyOf":[{"format":"relative-json-pointer"},{"format":"json-pointer"}]}},"additionalProperties":false}')},5825:e=>{"use strict";e.exports=JSON.parse('{"$schema":"http://json-schema.org/draft-07/schema#","$id":"http://json-schema.org/draft-07/schema#","title":"Core schema meta-schema","definitions":{"schemaArray":{"type":"array","minItems":1,"items":{"$ref":"#"}},"nonNegativeInteger":{"type":"integer","minimum":0},"nonNegativeIntegerDefault0":{"allOf":[{"$ref":"#/definitions/nonNegativeInteger"},{"default":0}]},"simpleTypes":{"enum":["array","boolean","integer","null","number","object","string"]},"stringArray":{"type":"array","items":{"type":"string"},"uniqueItems":true,"default":[]}},"type":["object","boolean"],"properties":{"$id":{"type":"string","format":"uri-reference"},"$schema":{"type":"string","format":"uri"},"$ref":{"type":"string","format":"uri-reference"},"$comment":{"type":"string"},"title":{"type":"string"},"description":{"type":"string"},"default":true,"readOnly":{"type":"boolean","default":false},"examples":{"type":"array","items":true},"multipleOf":{"type":"number","exclusiveMinimum":0},"maximum":{"type":"number"},"exclusiveMaximum":{"type":"number"},"minimum":{"type":"number"},"exclusiveMinimum":{"type":"number"},"maxLength":{"$ref":"#/definitions/nonNegativeInteger"},"minLength":{"$ref":"#/definitions/nonNegativeIntegerDefault0"},"pattern":{"type":"string","format":"regex"},"additionalItems":{"$ref":"#"},"items":{"anyOf":[{"$ref":"#"},{"$ref":"#/definitions/schemaArray"}],"default":true}
vendor: 3,014 bytes, line 78
78,"maxItems":{"$ref":"#/definitions/nonNegativeInteger"},"minItems":{"$ref":"#/definitions/nonNegativeIntegerDefault0"},"uniqueItems":{"type":"boolean","default":false},"contains":{"$ref":"#"},"maxProperties":{"$ref":"#/definitions/nonNegativeInteger"},"minProperties":{"$ref":"#/definitions/nonNegativeIntegerDefault0"},"required":{"$ref":"#/definitions/stringArray"},"additionalProperties":{"$ref":"#"},"definitions":{"type":"object","additionalProperties":{"$ref":"#"},"default":{}},"properties":{"type":"object","additionalProperties":{"$ref":"#"},"default":{}},"patternProperties":{"type":"object","additionalProperties":{"$ref":"#"},"propertyNames":{"format":"regex"},"default":{}},"dependencies":{"type":"object","additionalProperties":{"anyOf":[{"$ref":"#"},{"$ref":"#/definitions/stringArray"}]}},"propertyNames":{"$ref":"#"},"const":true,"enum":{"type":"array","items":true,"minItems":1,"uniqueItems":true},"type":{"anyOf":[{"$ref":"#/definitions/simpleTypes"},{"type":"array","items":{"$ref":"#/definitions/simpleTypes"},"minItems":1,"uniqueItems":true}]},"format":{"type":"string"},"contentMediaType":{"type":"string"},"contentEncoding":{"type":"string"},"if":{"$ref":"#"},"then":{"$ref":"#"},"else":{"$ref":"#"},"allOf":{"$ref":"#/definitions/schemaArray"},"anyOf":{"$ref":"#/definitions/schemaArray"},"oneOf":{"$ref":"#/definitions/schemaArray"},"not":{"$ref":"#"}},"default":true}')},81315:e=>{"use strict";e.exports=JSON.parse('{"100":"Continue","101":"Switching Protocols","102":"Processing","103":"Early Hints","200":"OK","201":"Created","202":"Accepted","203":"Non-Authoritative Information","204":"No Content","205":"Reset Content","206":"Partial Content","207":"Multi-Status","208":"Already Reported","226":"IM Used","300":"Multiple Choices","301":"Moved Permanently","302":"Found","303":"See Other","304":"Not Modified","305":"Use Proxy","306":"(Unused)","307":"Temporary Redirect","308":"Permanent Redirect","400":"Bad Request","401":"Unauthorized","402":"Payment Required","403":"Forbidden","404":"Not Found","405":"Method Not Allowed","406":"Not Acceptable","407":"Proxy Authentication Required","408":"Request Timeout","409":"Conflict","410":"Gone","411":"Length Required","412":"Precondition Failed","413":"Payload Too Large","414":"URI Too Long","415":"Unsupported Media Type","416":"Range Not Satisfiable","417":"Expectation Failed","418":"I\'m a teapot","421":"Misdirected Request","422":"Unprocessable Entity","423":"Locked","424":"Failed Dependency","425":"Unordered Collection","426":"Upgrade Required","428":"Precondition Required","429":"Too Many Requests","431":"Request Header Fields Too Large","451":"Unavailable For Legal Reasons","500":"Internal Server Error","501":"Not Implemented","502":"Bad Gateway","503":"Service Unavailable","504":"Gateway Timeout","505":"HTTP Version Not Supported","506":"Variant Also Negotiates","507":"Insufficient Storage","508":"Loop Detected","509":"Bandwidth Limit Exceeded","510":"Not Extended","511":"Network Authentication Required"}')}}]);
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.