-
Notifications
You must be signed in to change notification settings - Fork 2
/
6667.3ffc0c9554f837fd85f9.js
1 lines (1 loc) · 86.7 KB
/
6667.3ffc0c9554f837fd85f9.js
1
(self.webpackChunktimeless_frontend=self.webpackChunktimeless_frontend||[]).push([[6667],{46667:(Bt,B0,Z)=>{"use strict";Z.r(B0),Z.d(B0,{default:()=>fr});var H0=Z(34553),N0=Z(36574);class O{static create(...t){return new this(...t)}mixIn(t){return Object.assign(this,t)}clone(){const t=new this.constructor;return Object.assign(t,this),t}}class R extends O{constructor(t=[],e=4*t.length){super();let n=t;if(n instanceof ArrayBuffer&&(n=new Uint8Array(n)),(n instanceof Int8Array||n instanceof Uint8ClampedArray||n instanceof Int16Array||n instanceof Uint16Array||n instanceof Int32Array||n instanceof Uint32Array||n instanceof Float32Array||n instanceof Float64Array)&&(n=new Uint8Array(n.buffer,n.byteOffset,n.byteLength)),n instanceof Uint8Array){const r=n.byteLength,i=[];for(let o=0;o<r;o+=1)i[o>>>2]|=n[o]<<24-o%4*8;this.words=i,this.sigBytes=r}else this.words=t,this.sigBytes=e}static random(t){const e=[],n=r=>{let i=r,o=987654321;const c=4294967295;return()=>{o=36969*(65535&o)+(o>>16)&c,i=18e3*(65535&i)+(i>>16)&c;let a=(o<<16)+i&c;return a/=4294967296,a+=.5,a*(Math.random()>.5?1:-1)}};for(let i,r=0;r<t;r+=4){const o=n(4294967296*(i||Math.random()));i=987654071*o(),e.push(4294967296*o()|0)}return new R(e,t)}toString(t=S0){return t.stringify(this)}concat(t){const e=this.words,n=t.words,r=this.sigBytes,i=t.sigBytes;if(this.clamp(),r%4)for(let o=0;o<i;o+=1)e[r+o>>>2]|=(n[o>>>2]>>>24-o%4*8&255)<<24-(r+o)%4*8;else for(let o=0;o<i;o+=4)e[r+o>>>2]=n[o>>>2];return this.sigBytes+=i,this}clamp(){const{words:t,sigBytes:e}=this;t[e>>>2]&=4294967295<<32-e%4*8,t.length=Math.ceil(e/4)}clone(){const t=super.clone.call(this);return t.words=this.words.slice(0),t}}const S0={stringify(s){const{words:t,sigBytes:e}=s,n=[];for(let r=0;r<e;r+=1){const i=t[r>>>2]>>>24-r%4*8&255;n.push((i>>>4).toString(16)),n.push((15&i).toString(16))}return n.join("")},parse(s){const t=s.length,e=[];for(let n=0;n<t;n+=2)e[n>>>3]|=parseInt(s.substr(n,2),16)<<24-n%8*4;return new R(e,t/2)}},t0={stringify(s){const{words:t,sigBytes:e}=s,n=[];for(let r=0;r<e;r+=1)n.push(String.fromCharCode(t[r>>>2]>>>24-r%4*8&255));return n.join("")},parse(s){const t=s.length,e=[];for(let n=0;n<t;n+=1)e[n>>>2]|=(255&s.charCodeAt(n))<<24-n%4*8;return new R(e,t)}},e0={stringify(s){try{return decodeURIComponent(escape(t0.stringify(s)))}catch{throw new Error("Malformed UTF-8 data")}},parse:s=>t0.parse(unescape(encodeURIComponent(s)))};class E extends O{constructor(){super(),this._minBufferSize=0}reset(){this._data=new R,this._nDataBytes=0}_append(t){let e=t;"string"==typeof e&&(e=e0.parse(e)),this._data.concat(e),this._nDataBytes+=e.sigBytes}_process(t){let e;const{_data:n,blockSize:r}=this,i=n.words,o=n.sigBytes;let a=o/(4*r);a=t?Math.ceil(a):Math.max((0|a)-this._minBufferSize,0);const f=a*r,l=Math.min(4*f,o);if(f){for(let d=0;d<f;d+=r)this._doProcessBlock(i,d);e=i.splice(0,f),n.sigBytes-=l}return new R(e,l)}clone(){const t=super.clone.call(this);return t._data=this._data.clone(),t}}class g extends E{constructor(t){super(),this.blockSize=16,this.cfg=Object.assign(new O,t),this.reset()}static _createHelper(t){return(e,n)=>new t(n).finalize(e)}static _createHmacHelper(t){return(e,n)=>new T(t,n).finalize(e)}reset(){super.reset.call(this),this._doReset()}update(t){return this._append(t),this._process(),this}finalize(t){return t&&this._append(t),this._doFinalize()}}class T extends O{constructor(t,e){super();const n=new t;this._hasher=n;let r=e;"string"==typeof r&&(r=e0.parse(r));const i=n.blockSize,o=4*i;r.sigBytes>o&&(r=n.finalize(e)),r.clamp();const c=r.clone();this._oKey=c;const a=r.clone();this._iKey=a;const f=c.words,l=a.words;for(let d=0;d<i;d+=1)f[d]^=1549556828,l[d]^=909522486;c.sigBytes=o,a.sigBytes=o,this.reset()}reset(){const t=this._hasher;t.reset(),t.update(this._iKey)}update(t){return this._hasher.update(t),this}finalize(t){const e=this._hasher,n=e.finalize(t);return e.reset(),e.finalize(this._oKey.clone().concat(n))}}const L=R;class x extends O{constructor(t,e){super(),this.high=t,this.low=e}}class V extends O{constructor(t=[],e=8*t.length){super(),this.words=t,this.sigBytes=e}toX32(){const t=this.words,e=t.length,n=[];for(let r=0;r<e;r+=1){const i=t[r];n.push(i.high),n.push(i.low)}return L.create(n,this.sigBytes)}clone(){const t=super.clone.call(this);t.words=this.words.slice(0);const{words:e}=t,n=e.length;for(let r=0;r<n;r+=1)e[r]=e[r].clone();return t}}const a0={stringify(s){const{words:t,sigBytes:e}=s,n=this._map;s.clamp();const r=[];for(let o=0;o<e;o+=3){const l=(t[o>>>2]>>>24-o%4*8&255)<<16|(t[o+1>>>2]>>>24-(o+1)%4*8&255)<<8|t[o+2>>>2]>>>24-(o+2)%4*8&255;for(let d=0;d<4&&o+.75*d<e;d+=1)r.push(n.charAt(l>>>6*(3-d)&63))}const i=n.charAt(64);if(i)for(;r.length%4;)r.push(i);return r.join("")},parse(s){let t=s.length;const e=this._map;let n=this._reverseMap;if(!n){this._reverseMap=[],n=this._reverseMap;for(let i=0;i<e.length;i+=1)n[e.charCodeAt(i)]=i}const r=e.charAt(64);if(r){const i=s.indexOf(r);-1!==i&&(t=i)}return((s,t,e)=>{const n=[];let r=0;for(let i=0;i<t;i+=1)if(i%4){const o=e[s.charCodeAt(i-1)]<<i%4*2,c=e[s.charCodeAt(i)]>>>6-i%4*2;n[r>>>2]|=(o|c)<<24-r%4*8,r+=1}return R.create(n,r)})(s,t,n)},_map:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="},m=[];for(let s=0;s<64;s+=1)m[s]=4294967296*Math.abs(Math.sin(s+1))|0;const U=(s,t,e,n,r,i,o)=>{const c=s+(t&e|~t&n)+r+o;return(c<<i|c>>>32-i)+t},F=(s,t,e,n,r,i,o)=>{const c=s+(t&n|e&~n)+r+o;return(c<<i|c>>>32-i)+t},j=(s,t,e,n,r,i,o)=>{const c=s+(t^e^n)+r+o;return(c<<i|c>>>32-i)+t},N=(s,t,e,n,r,i,o)=>{const c=s+(e^(t|~n))+r+o;return(c<<i|c>>>32-i)+t};class I0 extends g{_doReset(){this._hash=new R([1732584193,4023233417,2562383102,271733878])}_doProcessBlock(t,e){const n=t;for(let u0=0;u0<16;u0+=1){const nt=e+u0,v0=t[nt];n[nt]=16711935&(v0<<8|v0>>>24)|4278255360&(v0<<24|v0>>>8)}const r=this._hash.words,i=n[e+0],o=n[e+1],c=n[e+2],a=n[e+3],f=n[e+4],l=n[e+5],d=n[e+6],y=n[e+7],A=n[e+8],B=n[e+9],C=n[e+10],k=n[e+11],v=n[e+12],M=n[e+13],H=n[e+14],z=n[e+15];let h=r[0],u=r[1],p=r[2],_=r[3];h=U(h,u,p,_,i,7,m[0]),_=U(_,h,u,p,o,12,m[1]),p=U(p,_,h,u,c,17,m[2]),u=U(u,p,_,h,a,22,m[3]),h=U(h,u,p,_,f,7,m[4]),_=U(_,h,u,p,l,12,m[5]),p=U(p,_,h,u,d,17,m[6]),u=U(u,p,_,h,y,22,m[7]),h=U(h,u,p,_,A,7,m[8]),_=U(_,h,u,p,B,12,m[9]),p=U(p,_,h,u,C,17,m[10]),u=U(u,p,_,h,k,22,m[11]),h=U(h,u,p,_,v,7,m[12]),_=U(_,h,u,p,M,12,m[13]),p=U(p,_,h,u,H,17,m[14]),u=U(u,p,_,h,z,22,m[15]),h=F(h,u,p,_,o,5,m[16]),_=F(_,h,u,p,d,9,m[17]),p=F(p,_,h,u,k,14,m[18]),u=F(u,p,_,h,i,20,m[19]),h=F(h,u,p,_,l,5,m[20]),_=F(_,h,u,p,C,9,m[21]),p=F(p,_,h,u,z,14,m[22]),u=F(u,p,_,h,f,20,m[23]),h=F(h,u,p,_,B,5,m[24]),_=F(_,h,u,p,H,9,m[25]),p=F(p,_,h,u,a,14,m[26]),u=F(u,p,_,h,A,20,m[27]),h=F(h,u,p,_,M,5,m[28]),_=F(_,h,u,p,c,9,m[29]),p=F(p,_,h,u,y,14,m[30]),u=F(u,p,_,h,v,20,m[31]),h=j(h,u,p,_,l,4,m[32]),_=j(_,h,u,p,A,11,m[33]),p=j(p,_,h,u,k,16,m[34]),u=j(u,p,_,h,H,23,m[35]),h=j(h,u,p,_,o,4,m[36]),_=j(_,h,u,p,f,11,m[37]),p=j(p,_,h,u,y,16,m[38]),u=j(u,p,_,h,C,23,m[39]),h=j(h,u,p,_,M,4,m[40]),_=j(_,h,u,p,i,11,m[41]),p=j(p,_,h,u,a,16,m[42]),u=j(u,p,_,h,d,23,m[43]),h=j(h,u,p,_,B,4,m[44]),_=j(_,h,u,p,v,11,m[45]),p=j(p,_,h,u,z,16,m[46]),u=j(u,p,_,h,c,23,m[47]),h=N(h,u,p,_,i,6,m[48]),_=N(_,h,u,p,y,10,m[49]),p=N(p,_,h,u,H,15,m[50]),u=N(u,p,_,h,l,21,m[51]),h=N(h,u,p,_,v,6,m[52]),_=N(_,h,u,p,a,10,m[53]),p=N(p,_,h,u,C,15,m[54]),u=N(u,p,_,h,o,21,m[55]),h=N(h,u,p,_,A,6,m[56]),_=N(_,h,u,p,z,10,m[57]),p=N(p,_,h,u,d,15,m[58]),u=N(u,p,_,h,M,21,m[59]),h=N(h,u,p,_,f,6,m[60]),_=N(_,h,u,p,k,10,m[61]),p=N(p,_,h,u,c,15,m[62]),u=N(u,p,_,h,B,21,m[63]),r[0]=r[0]+h|0,r[1]=r[1]+u|0,r[2]=r[2]+p|0,r[3]=r[3]+_|0}_doFinalize(){const t=this._data,e=t.words,n=8*this._nDataBytes,r=8*t.sigBytes;e[r>>>5]|=128<<24-r%32;const i=Math.floor(n/4294967296),o=n;e[15+(r+64>>>9<<4)]=16711935&(i<<8|i>>>24)|4278255360&(i<<24|i>>>8),e[14+(r+64>>>9<<4)]=16711935&(o<<8|o>>>24)|4278255360&(o<<24|o>>>8),t.sigBytes=4*(e.length+1),this._process();const c=this._hash,a=c.words;for(let f=0;f<4;f+=1){const l=a[f];a[f]=16711935&(l<<8|l>>>24)|4278255360&(l<<24|l>>>8)}return c}clone(){const t=super.clone.call(this);return t._hash=this._hash.clone(),t}}const $0=g._createHelper(I0),Tt=g._createHmacHelper(I0);class V0 extends O{constructor(t){super(),this.cfg=Object.assign(new O,{keySize:4,hasher:I0,iterations:1},t)}compute(t,e){let n;const{cfg:r}=this,i=r.hasher.create(),o=R.create(),c=o.words,{keySize:a,iterations:f}=r;for(;c.length<a;){n&&i.update(n),n=i.update(t).finalize(e),i.reset();for(let l=1;l<f;l+=1)n=i.finalize(n),i.reset();o.concat(n)}return o.sigBytes=4*a,o}}let q0=(()=>{class s extends E{constructor(e,n,r){super(),this.cfg=Object.assign(new O,r),this._xformMode=e,this._key=n,this.reset()}static createEncryptor(e,n){return this.create(this._ENC_XFORM_MODE,e,n)}static createDecryptor(e,n){return this.create(this._DEC_XFORM_MODE,e,n)}static _createHelper(e){const n=r=>"string"==typeof r?I:w;return{encrypt:(r,i,o)=>n(i).encrypt(e,r,i,o),decrypt:(r,i,o)=>n(i).decrypt(e,r,i,o)}}reset(){super.reset.call(this),this._doReset()}process(e){return this._append(e),this._process()}finalize(e){return e&&this._append(e),this._doFinalize()}}return s._ENC_XFORM_MODE=1,s._DEC_XFORM_MODE=2,s.keySize=4,s.ivSize=4,s})();class l0 extends q0{constructor(...t){super(...t),this.blockSize=1}_doFinalize(){return this._process(!0)}}class b0 extends O{constructor(t,e){super(),this._cipher=t,this._iv=e}static createEncryptor(t,e){return this.Encryptor.create(t,e)}static createDecryptor(t,e){return this.Decryptor.create(t,e)}}function P0(s,t,e){const n=s;let r;const i=this._iv;i?(r=i,this._iv=void 0):r=this._prevBlock;for(let o=0;o<e;o+=1)n[t+o]^=r[o]}let xt=(()=>{class s extends b0{}return s.Encryptor=class extends s{processBlock(t,e){const n=this._cipher,{blockSize:r}=n;P0.call(this,t,e,r),n.encryptBlock(t,e),this._prevBlock=t.slice(e,e+r)}},s.Decryptor=class extends s{processBlock(t,e){const n=this._cipher,{blockSize:r}=n,i=t.slice(e,e+r);n.decryptBlock(t,e),P0.call(this,t,e,r),this._prevBlock=i}},s})();const ft={pad(s,t){const e=4*t,n=e-s.sigBytes%e,r=n<<24|n<<16|n<<8|n,i=[];for(let c=0;c<n;c+=4)i.push(r);const o=R.create(i,n);s.concat(o)},unpad(s){s.sigBytes-=255&s.words[s.sigBytes-1>>>2]}};class y0 extends q0{constructor(t,e,n){super(t,e,Object.assign({mode:xt,padding:ft},n)),this.blockSize=4}reset(){let t;super.reset.call(this);const{cfg:e}=this,{iv:n,mode:r}=e;this._xformMode===this.constructor._ENC_XFORM_MODE?t=r.createEncryptor:(t=r.createDecryptor,this._minBufferSize=1),this._mode=t.call(r,this,n&&n.words),this._mode.__creator=t}_doProcessBlock(t,e){this._mode.processBlock(t,e)}_doFinalize(){let t;const{padding:e}=this.cfg;return this._xformMode===this.constructor._ENC_XFORM_MODE?(e.pad(this._data,this.blockSize),t=this._process(!0)):(t=this._process(!0),e.unpad(t)),t}}class T0 extends O{constructor(t){super(),this.mixIn(t)}toString(t){return(t||this.formatter).stringify(this)}}const b={stringify(s){let t;const{ciphertext:e,salt:n}=s;return t=n?R.create([1398893684,1701076831]).concat(n).concat(e):e,t.toString(a0)},parse(s){let t;const e=a0.parse(s),n=e.words;return 1398893684===n[0]&&1701076831===n[1]&&(t=R.create(n.slice(2,4)),n.splice(0,4),e.sigBytes-=16),T0.create({ciphertext:e,salt:t})}};class w extends O{static encrypt(t,e,n,r){const i=Object.assign(new O,this.cfg,r),o=t.createEncryptor(n,i),c=o.finalize(e),a=o.cfg;return T0.create({ciphertext:c,key:n,iv:a.iv,algorithm:t,mode:a.mode,padding:a.padding,blockSize:o.blockSize,formatter:i.format})}static decrypt(t,e,n,r){let i=e;const o=Object.assign(new O,this.cfg,r);return i=this._parse(i,o.format),t.createDecryptor(n,o).finalize(i.ciphertext)}static _parse(t,e){return"string"==typeof t?e.parse(t,this):t}}w.cfg=Object.assign(new O,{format:b});const S={execute(s,t,e,n){let r=n;r||(r=R.random(8));const i=V0.create({keySize:t+e}).compute(s,r),o=R.create(i.words.slice(t),4*e);return i.sigBytes=4*t,T0.create({key:i,iv:o,salt:r})}};class I extends w{static encrypt(t,e,n,r){const i=Object.assign(new O,this.cfg,r),o=i.kdf.execute(n,t.keySize,t.ivSize);i.iv=o.iv;const c=w.encrypt.call(this,t,e,o.key,i);return c.mixIn(o),c}static decrypt(t,e,n,r){let i=e;const o=Object.assign(new O,this.cfg,r);i=this._parse(i,o.format);const c=o.kdf.execute(n,t.keySize,t.ivSize,i.salt);return o.iv=c.iv,w.decrypt.call(this,t,i,c.key,o)}}I.cfg=Object.assign(w.cfg,{kdf:S});const $=s=>s<<8&4278255360|s>>>8&16711935,W={stringify(s){const{words:t,sigBytes:e}=s,n=[];for(let r=0;r<e;r+=2)n.push(String.fromCharCode(t[r>>>2]>>>16-r%4*8&65535));return n.join("")},parse(s){const t=s.length,e=[];for(let n=0;n<t;n+=1)e[n>>>1]|=s.charCodeAt(n)<<16-n%2*16;return R.create(e,2*t)}},q=W,A0={stringify(s){const{words:t,sigBytes:e}=s,n=[];for(let r=0;r<e;r+=2){const i=$(t[r>>>2]>>>16-r%4*8&65535);n.push(String.fromCharCode(i))}return n.join("")},parse(s){const t=s.length,e=[];for(let n=0;n<t;n+=1)e[n>>>1]|=$(s.charCodeAt(n)<<16-n%2*16);return R.create(e,2*t)}},C0=[];class ut extends g{_doReset(){this._hash=new R([1732584193,4023233417,2562383102,271733878,3285377520])}_doProcessBlock(t,e){const n=this._hash.words;let r=n[0],i=n[1],o=n[2],c=n[3],a=n[4];for(let f=0;f<80;f+=1){if(f<16)C0[f]=0|t[e+f];else{const d=C0[f-3]^C0[f-8]^C0[f-14]^C0[f-16];C0[f]=d<<1|d>>>31}let l=(r<<5|r>>>27)+a+C0[f];l+=f<20?1518500249+(i&o|~i&c):f<40?1859775393+(i^o^c):f<60?(i&o|i&c|o&c)-1894007588:(i^o^c)-899497514,a=c,c=o,o=i<<30|i>>>2,i=r,r=l}n[0]=n[0]+r|0,n[1]=n[1]+i|0,n[2]=n[2]+o|0,n[3]=n[3]+c|0,n[4]=n[4]+a|0}_doFinalize(){const t=this._data,e=t.words,n=8*this._nDataBytes,r=8*t.sigBytes;return e[r>>>5]|=128<<24-r%32,e[14+(r+64>>>9<<4)]=Math.floor(n/4294967296),e[15+(r+64>>>9<<4)]=n,t.sigBytes=4*e.length,this._process(),this._hash}clone(){const t=super.clone.call(this);return t._hash=this._hash.clone(),t}}const Ze=g._createHelper(ut),Je=g._createHmacHelper(ut),Jt=[],te=[],tn=s=>{const t=Math.sqrt(s);for(let e=2;e<=t;e+=1)if(!(s%e))return!1;return!0},ee=s=>4294967296*(s-(0|s))|0;let dt=2,X0=0;for(;X0<64;)tn(dt)&&(X0<8&&(Jt[X0]=ee(dt**.5)),te[X0]=ee(dt**(1/3)),X0+=1),dt+=1;const R0=[];class D0 extends g{_doReset(){this._hash=new R(Jt.slice(0))}_doProcessBlock(t,e){const n=this._hash.words;let r=n[0],i=n[1],o=n[2],c=n[3],a=n[4],f=n[5],l=n[6],d=n[7];for(let y=0;y<64;y+=1){if(y<16)R0[y]=0|t[e+y];else{const H=R0[y-15],h=R0[y-2];R0[y]=((H<<25|H>>>7)^(H<<14|H>>>18)^H>>>3)+R0[y-7]+((h<<15|h>>>17)^(h<<13|h>>>19)^h>>>10)+R0[y-16]}const B=r&i^r&o^i&o,v=d+((a<<26|a>>>6)^(a<<21|a>>>11)^(a<<7|a>>>25))+(a&f^~a&l)+te[y]+R0[y];d=l,l=f,f=a,a=c+v|0,c=o,o=i,i=r,r=v+(((r<<30|r>>>2)^(r<<19|r>>>13)^(r<<10|r>>>22))+B)|0}n[0]=n[0]+r|0,n[1]=n[1]+i|0,n[2]=n[2]+o|0,n[3]=n[3]+c|0,n[4]=n[4]+a|0,n[5]=n[5]+f|0,n[6]=n[6]+l|0,n[7]=n[7]+d|0}_doFinalize(){const t=this._data,e=t.words,n=8*this._nDataBytes,r=8*t.sigBytes;return e[r>>>5]|=128<<24-r%32,e[14+(r+64>>>9<<4)]=Math.floor(n/4294967296),e[15+(r+64>>>9<<4)]=n,t.sigBytes=4*e.length,this._process(),this._hash}clone(){const t=super.clone.call(this);return t._hash=this._hash.clone(),t}}const en=g._createHelper(D0),nn=g._createHmacHelper(D0);class At extends D0{_doReset(){this._hash=new R([3238371032,914150663,812702999,4144912697,4290775857,1750603025,1694076839,3204075428])}_doFinalize(){const t=super._doFinalize.call(this);return t.sigBytes-=4,t}}const sn=D0._createHelper(At),rn=D0._createHmacHelper(At),on=[new x(1116352408,3609767458),new x(1899447441,602891725),new x(3049323471,3964484399),new x(3921009573,2173295548),new x(961987163,4081628472),new x(1508970993,3053834265),new x(2453635748,2937671579),new x(2870763221,3664609560),new x(3624381080,2734883394),new x(310598401,1164996542),new x(607225278,1323610764),new x(1426881987,3590304994),new x(1925078388,4068182383),new x(2162078206,991336113),new x(2614888103,633803317),new x(3248222580,3479774868),new x(3835390401,2666613458),new x(4022224774,944711139),new x(264347078,2341262773),new x(604807628,2007800933),new x(770255983,1495990901),new x(1249150122,1856431235),new x(1555081692,3175218132),new x(1996064986,2198950837),new x(2554220882,3999719339),new x(2821834349,766784016),new x(2952996808,2566594879),new x(3210313671,3203337956),new x(3336571891,1034457026),new x(3584528711,2466948901),new x(113926993,3758326383),new x(338241895,168717936),new x(666307205,1188179964),new x(773529912,1546045734),new x(1294757372,1522805485),new x(1396182291,2643833823),new x(1695183700,2343527390),new x(1986661051,1014477480),new x(2177026350,1206759142),new x(2456956037,344077627),new x(2730485921,1290863460),new x(2820302411,3158454273),new x(3259730800,3505952657),new x(3345764771,106217008),new x(3516065817,3606008344),new x(3600352804,1432725776),new x(4094571909,1467031594),new x(275423344,851169720),new x(430227734,3100823752),new x(506948616,1363258195),new x(659060556,3750685593),new x(883997877,3785050280),new x(958139571,3318307427),new x(1322822218,3812723403),new x(1537002063,2003034995),new x(1747873779,3602036899),new x(1955562222,1575990012),new x(2024104815,1125592928),new x(2227730452,2716904306),new x(2361852424,442776044),new x(2428436474,593698344),new x(2756734187,3733110249),new x(3204031479,2999351573),new x(3329325298,3815920427),new x(3391569614,3928383900),new x(3515267271,566280711),new x(3940187606,3454069534),new x(4118630271,4000239992),new x(116418474,1914138554),new x(174292421,2731055270),new x(289380356,3203993006),new x(460393269,320620315),new x(685471733,587496836),new x(852142971,1086792851),new x(1017036298,365543100),new x(1126000580,2618297676),new x(1288033470,3409855158),new x(1501505948,4234509866),new x(1607167915,987167468),new x(1816402316,1246189591)],M0=[];for(let s=0;s<80;s+=1)M0[s]=new x;class O0 extends g{constructor(){super(),this.blockSize=32}_doReset(){this._hash=new V([new x(1779033703,4089235720),new x(3144134277,2227873595),new x(1013904242,4271175723),new x(2773480762,1595750129),new x(1359893119,2917565137),new x(2600822924,725511199),new x(528734635,4215389547),new x(1541459225,327033209)])}_doProcessBlock(t,e){const n=this._hash.words,r=n[0],i=n[1],o=n[2],c=n[3],a=n[4],f=n[5],l=n[6],d=n[7],y=r.high;let A=r.low;const B=i.high;let C=i.low;const k=o.high;let v=o.low;const M=c.high;let H=c.low;const z=a.high;let h=a.low;const u=f.high;let p=f.low;const _=l.high;let u0=l.low;const nt=d.high;let v0=d.low,i0=y,Q=A,st=B,F0=C,rt=k,W0=v,Yt=M,it=H,o0=z,Y=h,kt=u,ot=p,Et=_,ct=u0,Zt=nt,at=v0;for(let c0=0;c0<80;c0+=1){let d0,k0;const K0=M0[c0];if(c0<16)K0.high=0|t[e+2*c0],k0=K0.high,K0.low=0|t[e+2*c0+1],d0=K0.low;else{const $e=M0[c0-15],U0=$e.high,lt=$e.low,Ve=(lt>>>1|U0<<31)^(lt>>>8|U0<<24)^(lt>>>7|U0<<25),Ge=M0[c0-2],j0=Ge.high,ht=Ge.low,qe=(ht>>>19|j0<<13)^(ht<<3|j0>>>29)^(ht>>>6|j0<<26),Xe=M0[c0-7],Qe=M0[c0-16],Ye=Qe.low;d0=Ve+Xe.low,k0=((U0>>>1|lt<<31)^(U0>>>8|lt<<24)^U0>>>7)+Xe.high+(d0>>>0<Ve>>>0?1:0),d0+=qe,k0=k0+((j0>>>19|ht<<13)^(j0<<3|ht>>>29)^j0>>>6)+(d0>>>0<qe>>>0?1:0),d0+=Ye,k0=k0+Qe.high+(d0>>>0<Ye>>>0?1:0),K0.high=k0,K0.low=d0}const We=Y&ot^~Y&ct,dr=i0&st^i0&rt^st&rt,br=(i0>>>28|Q<<4)^(i0<<30|Q>>>2)^(i0<<25|Q>>>7),Ke=(Q>>>28|i0<<4)^(Q<<30|i0>>>2)^(Q<<25|i0>>>7),Ue=on[c0],je=Ue.low;let p0=at+((Y>>>14|o0<<18)^(Y>>>18|o0<<14)^(Y<<23|o0>>>9)),E0=Zt+((o0>>>14|Y<<18)^(o0>>>18|Y<<14)^(o0<<23|Y>>>9))+(p0>>>0<at>>>0?1:0);p0+=We,E0=E0+(o0&kt^~o0&Et)+(p0>>>0<We>>>0?1:0),p0+=je,E0=E0+Ue.high+(p0>>>0<je>>>0?1:0),p0+=d0,E0=E0+k0+(p0>>>0<d0>>>0?1:0);const Ne=Ke+(Q&F0^Q&W0^F0&W0);Zt=Et,at=ct,Et=kt,ct=ot,kt=o0,ot=Y,Y=it+p0|0,o0=Yt+E0+(Y>>>0<it>>>0?1:0)|0,Yt=rt,it=W0,rt=st,W0=F0,st=i0,F0=Q,Q=p0+Ne|0,i0=E0+(br+dr+(Ne>>>0<Ke>>>0?1:0))+(Q>>>0<p0>>>0?1:0)|0}r.low=A+Q,A=r.low,r.high=y+i0+(A>>>0<Q>>>0?1:0),i.low=C+F0,C=i.low,i.high=B+st+(C>>>0<F0>>>0?1:0),o.low=v+W0,v=o.low,o.high=k+rt+(v>>>0<W0>>>0?1:0),c.low=H+it,H=c.low,c.high=M+Yt+(H>>>0<it>>>0?1:0),a.low=h+Y,h=a.low,a.high=z+o0+(h>>>0<Y>>>0?1:0),f.low=p+ot,p=f.low,f.high=u+kt+(p>>>0<ot>>>0?1:0),l.low=u0+ct,u0=l.low,l.high=_+Et+(u0>>>0<ct>>>0?1:0),d.low=v0+at,v0=d.low,d.high=nt+Zt+(v0>>>0<at>>>0?1:0)}_doFinalize(){const t=this._data,e=t.words,n=8*this._nDataBytes,r=8*t.sigBytes;return e[r>>>5]|=128<<24-r%32,e[30+(r+128>>>10<<5)]=Math.floor(n/4294967296),e[31+(r+128>>>10<<5)]=n,t.sigBytes=4*e.length,this._process(),this._hash.toX32()}clone(){const t=super.clone.call(this);return t._hash=this._hash.clone(),t}}const cn=g._createHelper(O0),an=g._createHmacHelper(O0);class Ct extends O0{_doReset(){this._hash=new V([new x(3418070365,3238371032),new x(1654270250,914150663),new x(2438529370,812702999),new x(355462360,4144912697),new x(1731405415,4290775857),new x(2394180231,1750603025),new x(3675008525,1694076839),new x(1203062813,3204075428)])}_doFinalize(){const t=super._doFinalize.call(this);return t.sigBytes-=16,t}}const ln=O0._createHelper(Ct),hn=O0._createHmacHelper(Ct),ne=[],se=[],re=[];let Rt=1,pt=0;for(let s=0;s<24;s+=1){ne[Rt+5*pt]=(s+1)*(s+2)/2%64;const e=(2*Rt+3*pt)%5;Rt=pt%5,pt=e}for(let s=0;s<5;s+=1)for(let t=0;t<5;t+=1)se[s+5*t]=t+(2*s+3*t)%5*5;let Q0=1;for(let s=0;s<24;s+=1){let t=0,e=0;for(let n=0;n<7;n+=1){if(1&Q0){const r=(1<<n)-1;r<32?e^=1<<r:t^=1<<r-32}128&Q0?Q0=Q0<<1^113:Q0<<=1}re[s]=x.create(t,e)}const _0=[];for(let s=0;s<25;s+=1)_0[s]=x.create();class Ht extends g{constructor(t){super(Object.assign({outputLength:512},t))}_doReset(){this._state=[];const t=this._state;for(let e=0;e<25;e+=1)t[e]=new x;this.blockSize=(1600-2*this.cfg.outputLength)/32}_doProcessBlock(t,e){const n=this._state,r=this.blockSize/2;for(let i=0;i<r;i+=1){let o=t[e+2*i],c=t[e+2*i+1];o=16711935&(o<<8|o>>>24)|4278255360&(o<<24|o>>>8),c=16711935&(c<<8|c>>>24)|4278255360&(c<<24|c>>>8);const a=n[i];a.high^=c,a.low^=o}for(let i=0;i<24;i+=1){for(let l=0;l<5;l+=1){let d=0,y=0;for(let B=0;B<5;B+=1){const C=n[l+5*B];d^=C.high,y^=C.low}const A=_0[l];A.high=d,A.low=y}for(let l=0;l<5;l+=1){const d=_0[(l+4)%5],y=_0[(l+1)%5],A=y.high,B=y.low,C=d.high^(A<<1|B>>>31),k=d.low^(B<<1|A>>>31);for(let v=0;v<5;v+=1){const M=n[l+5*v];M.high^=C,M.low^=k}}for(let l=1;l<25;l+=1){let d,y;const A=n[l],B=A.high,C=A.low,k=ne[l];k<32?(d=B<<k|C>>>32-k,y=C<<k|B>>>32-k):(d=C<<k-32|B>>>64-k,y=B<<k-32|C>>>64-k);const v=_0[se[l]];v.high=d,v.low=y}const o=_0[0],c=n[0];o.high=c.high,o.low=c.low;for(let l=0;l<5;l+=1)for(let d=0;d<5;d+=1){const y=l+5*d,A=n[y],B=_0[y],C=_0[(l+1)%5+5*d],k=_0[(l+2)%5+5*d];A.high=B.high^~C.high&k.high,A.low=B.low^~C.low&k.low}const a=n[0],f=re[i];a.high^=f.high,a.low^=f.low}}_doFinalize(){const t=this._data,e=t.words,n=8*t.sigBytes,r=32*this.blockSize;e[n>>>5]|=1<<24-n%32,e[(Math.ceil((n+1)/r)*r>>>5)-1]|=128,t.sigBytes=4*e.length,this._process();const i=this._state,o=this.cfg.outputLength/8,c=o/8,a=[];for(let f=0;f<c;f+=1){const l=i[f];let d=l.high,y=l.low;d=16711935&(d<<8|d>>>24)|4278255360&(d<<24|d>>>8),y=16711935&(y<<8|y>>>24)|4278255360&(y<<24|y>>>8),a.push(y),a.push(d)}return new R(a,o)}clone(){const t=super.clone.call(this);t._state=this._state.slice(0);const e=t._state;for(let n=0;n<25;n+=1)e[n]=e[n].clone();return t}}const xn=g._createHelper(Ht),fn=g._createHmacHelper(Ht),un=R.create([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,7,4,13,1,10,6,15,3,12,0,9,5,2,14,11,8,3,10,14,4,9,15,8,1,2,7,0,6,13,11,5,12,1,9,11,10,0,8,12,4,13,3,7,15,14,5,6,2,4,0,5,9,7,12,2,10,14,1,3,8,11,6,15,13]),dn=R.create([5,14,7,0,9,2,11,4,13,6,15,8,1,10,3,12,6,11,3,7,0,13,5,10,14,15,8,12,4,9,1,2,15,5,1,3,7,14,6,9,11,8,12,2,10,0,4,13,8,6,4,1,3,11,15,0,5,12,2,13,9,7,10,14,12,15,10,4,1,5,8,7,6,2,13,14,0,3,9,11]),pn=R.create([11,14,15,12,5,8,7,9,11,13,14,15,6,7,9,8,7,6,8,13,11,9,7,15,7,12,15,9,11,7,13,12,11,13,6,7,14,9,13,15,14,8,13,6,5,12,7,5,11,12,14,15,14,15,9,8,9,14,5,6,8,6,5,12,9,15,5,11,6,8,13,12,5,12,13,14,11,8,5,6]),bn=R.create([8,9,9,11,13,15,15,5,7,7,8,11,14,14,12,6,9,13,15,7,12,8,9,11,7,7,12,7,6,15,13,11,9,7,15,11,8,6,6,14,12,13,5,14,13,13,7,5,15,5,8,11,14,14,6,14,6,9,12,9,12,5,15,8,8,5,12,9,12,5,14,6,8,13,6,5,15,13,11,11]),yn=R.create([0,1518500249,1859775393,2400959708,2840853838]),_n=R.create([1352829926,1548603684,1836072691,2053994217,0]),ie=(s,t,e)=>s^t^e,oe=(s,t,e)=>s&t|~s&e,ce=(s,t,e)=>(s|~t)^e,ae=(s,t,e)=>s&e|t&~e,le=(s,t,e)=>s^(t|~e),bt=(s,t)=>s<<t|s>>>32-t;class It extends g{_doReset(){this._hash=R.create([1732584193,4023233417,2562383102,271733878,3285377520])}_doProcessBlock(t,e){const n=t;for(let u=0;u<16;u+=1){const p=e+u,_=n[p];n[p]=16711935&(_<<8|_>>>24)|4278255360&(_<<24|_>>>8)}const r=this._hash.words,i=yn.words,o=_n.words,c=un.words,a=dn.words,f=pn.words,l=bn.words;let h,d=r[0],y=r[1],A=r[2],B=r[3],C=r[4],k=r[0],v=r[1],M=r[2],H=r[3],z=r[4];for(let u=0;u<80;u+=1)h=d+n[e+c[u]]|0,h+=u<16?ie(y,A,B)+i[0]:u<32?oe(y,A,B)+i[1]:u<48?ce(y,A,B)+i[2]:u<64?ae(y,A,B)+i[3]:le(y,A,B)+i[4],h|=0,h=bt(h,f[u]),h=h+C|0,d=C,C=B,B=bt(A,10),A=y,y=h,h=k+n[e+a[u]]|0,h+=u<16?le(v,M,H)+o[0]:u<32?ae(v,M,H)+o[1]:u<48?ce(v,M,H)+o[2]:u<64?oe(v,M,H)+o[3]:ie(v,M,H)+o[4],h|=0,h=bt(h,l[u]),h=h+z|0,k=z,z=H,H=bt(M,10),M=v,v=h;h=r[1]+A+H|0,r[1]=r[2]+B+z|0,r[2]=r[3]+C+k|0,r[3]=r[4]+d+v|0,r[4]=r[0]+y+M|0,r[0]=h}_doFinalize(){const t=this._data,e=t.words,n=8*this._nDataBytes,r=8*t.sigBytes;e[r>>>5]|=128<<24-r%32,e[14+(r+64>>>9<<4)]=16711935&(n<<8|n>>>24)|4278255360&(n<<24|n>>>8),t.sigBytes=4*(e.length+1),this._process();const i=this._hash,o=i.words;for(let c=0;c<5;c+=1){const a=o[c];o[c]=16711935&(a<<8|a>>>24)|4278255360&(a<<24|a>>>8)}return i}clone(){const t=super.clone.call(this);return t._hash=this._hash.clone(),t}}const gn=g._createHelper(It),wn=g._createHmacHelper(It);class he extends O{constructor(t){super(),this.cfg=Object.assign(new O,{keySize:4,hasher:ut,iterations:1},t)}compute(t,e){const{cfg:n}=this,r=T.create(n.hasher,t),i=R.create(),o=R.create([1]),c=i.words,a=o.words,{keySize:f,iterations:l}=n;for(;c.length<f;){const d=r.update(e).finalize(o);r.reset();const y=d.words,A=y.length;let B=d;for(let C=1;C<l;C+=1){B=r.finalize(B),r.reset();const k=B.words;for(let v=0;v<A;v+=1)y[v]^=k[v]}i.concat(d),a[0]+=1}return i.sigBytes=4*f,i}}const X=[],xe=[],fe=[],ue=[],de=[],pe=[],Pt=[],Dt=[],Mt=[],Ot=[],n0=[];for(let s=0;s<256;s+=1)n0[s]=s<128?s<<1:s<<1^283;let s0=0,g0=0;for(let s=0;s<256;s+=1){let t=g0^g0<<1^g0<<2^g0<<3^g0<<4;t=t>>>8^255&t^99,X[s0]=t,xe[t]=s0;const e=n0[s0],n=n0[e],r=n0[n];let i=257*n0[t]^16843008*t;fe[s0]=i<<24|i>>>8,ue[s0]=i<<16|i>>>16,de[s0]=i<<8|i>>>24,pe[s0]=i,i=16843009*r^65537*n^257*e^16843008*s0,Pt[t]=i<<24|i>>>8,Dt[t]=i<<16|i>>>16,Mt[t]=i<<8|i>>>24,Ot[t]=i,s0?(s0=e^n0[n0[n0[r^e]]],g0^=n0[n0[g0]]):(g0=1,s0=g0)}const vn=[0,1,2,4,8,16,32,64,128,27,54];let be=(()=>{class s extends y0{_doReset(){let e;if(this._nRounds&&this._keyPriorReset===this._key)return;this._keyPriorReset=this._key;const n=this._keyPriorReset,r=n.words,i=n.sigBytes/4;this._nRounds=i+6;const c=4*(this._nRounds+1);this._keySchedule=[];const a=this._keySchedule;for(let l=0;l<c;l+=1)l<i?a[l]=r[l]:(e=a[l-1],l%i?i>6&&l%i==4&&(e=X[e>>>24]<<24|X[e>>>16&255]<<16|X[e>>>8&255]<<8|X[255&e]):(e=e<<8|e>>>24,e=X[e>>>24]<<24|X[e>>>16&255]<<16|X[e>>>8&255]<<8|X[255&e],e^=vn[l/i|0]<<24),a[l]=a[l-i]^e);this._invKeySchedule=[];const f=this._invKeySchedule;for(let l=0;l<c;l+=1){const d=c-l;e=l%4?a[d]:a[d-4],f[l]=l<4||d<=4?e:Pt[X[e>>>24]]^Dt[X[e>>>16&255]]^Mt[X[e>>>8&255]]^Ot[X[255&e]]}}encryptBlock(e,n){this._doCryptBlock(e,n,this._keySchedule,fe,ue,de,pe,X)}decryptBlock(e,n){const r=e;let i=r[n+1];r[n+1]=r[n+3],r[n+3]=i,this._doCryptBlock(r,n,this._invKeySchedule,Pt,Dt,Mt,Ot,xe),i=r[n+1],r[n+1]=r[n+3],r[n+3]=i}_doCryptBlock(e,n,r,i,o,c,a,f){const l=e,d=this._nRounds;let y=l[n]^r[0],A=l[n+1]^r[1],B=l[n+2]^r[2],C=l[n+3]^r[3],k=4;for(let h=1;h<d;h+=1){const u=i[y>>>24]^o[A>>>16&255]^c[B>>>8&255]^a[255&C]^r[k];k+=1;const p=i[A>>>24]^o[B>>>16&255]^c[C>>>8&255]^a[255&y]^r[k];k+=1;const _=i[B>>>24]^o[C>>>16&255]^c[y>>>8&255]^a[255&A]^r[k];k+=1;const u0=i[C>>>24]^o[y>>>16&255]^c[A>>>8&255]^a[255&B]^r[k];k+=1,y=u,A=p,B=_,C=u0}const v=(f[y>>>24]<<24|f[A>>>16&255]<<16|f[B>>>8&255]<<8|f[255&C])^r[k];k+=1;const M=(f[A>>>24]<<24|f[B>>>16&255]<<16|f[C>>>8&255]<<8|f[255&y])^r[k];k+=1;const H=(f[B>>>24]<<24|f[C>>>16&255]<<16|f[y>>>8&255]<<8|f[255&A])^r[k];k+=1;const z=(f[C>>>24]<<24|f[y>>>16&255]<<16|f[A>>>8&255]<<8|f[255&B])^r[k];k+=1,l[n]=v,l[n+1]=M,l[n+2]=H,l[n+3]=z}}return s.keySize=8,s})();const Sn=y0._createHelper(be),kn=[57,49,41,33,25,17,9,1,58,50,42,34,26,18,10,2,59,51,43,35,27,19,11,3,60,52,44,36,63,55,47,39,31,23,15,7,62,54,46,38,30,22,14,6,61,53,45,37,29,21,13,5,28,20,12,4],ye=[14,17,11,24,1,5,3,28,15,6,21,10,23,19,12,4,26,8,16,7,27,20,13,2,41,52,31,37,47,55,30,40,51,45,33,48,44,49,39,56,34,53,46,42,50,36,29,32],En=[1,2,4,6,8,10,12,14,15,17,19,21,23,25,27,28],Bn=[{0:8421888,268435456:32768,536870912:8421378,805306368:2,1073741824:512,1342177280:8421890,1610612736:8389122,1879048192:8388608,2147483648:514,2415919104:8389120,2684354560:33280,2952790016:8421376,3221225472:32770,3489660928:8388610,3758096384:0,4026531840:33282,134217728:0,402653184:8421890,671088640:33282,939524096:32768,1207959552:8421888,1476395008:512,1744830464:8421378,2013265920:2,2281701376:8389120,2550136832:33280,2818572288:8421376,3087007744:8389122,3355443200:8388610,3623878656:32770,3892314112:514,4160749568:8388608,1:32768,268435457:2,536870913:8421888,805306369:8388608,1073741825:8421378,1342177281:33280,1610612737:512,1879048193:8389122,2147483649:8421890,2415919105:8421376,2684354561:8388610,2952790017:33282,3221225473:514,3489660929:8389120,3758096385:32770,4026531841:0,134217729:8421890,402653185:8421376,671088641:8388608,939524097:512,1207959553:32768,1476395009:8388610,1744830465:2,2013265921:33282,2281701377:32770,2550136833:8389122,2818572289:514,3087007745:8421888,3355443201:8389120,3623878657:0,3892314113:33280,4160749569:8421378},{0:1074282512,16777216:16384,33554432:524288,50331648:1074266128,67108864:1073741840,83886080:1074282496,100663296:1073758208,117440512:16,134217728:540672,150994944:1073758224,167772160:1073741824,184549376:540688,201326592:524304,218103808:0,234881024:16400,251658240:1074266112,8388608:1073758208,25165824:540688,41943040:16,58720256:1073758224,75497472:1074282512,92274688:1073741824,109051904:524288,125829120:1074266128,142606336:524304,159383552:0,176160768:16384,192937984:1074266112,209715200:1073741840,226492416:540672,243269632:1074282496,260046848:16400,268435456:0,285212672:1074266128,301989888:1073758224,318767104:1074282496,335544320:1074266112,352321536:16,369098752:540688,385875968:16384,402653184:16400,419430400:524288,436207616:524304,452984832:1073741840,469762048:540672,486539264:1073758208,503316480:1073741824,520093696:1074282512,276824064:540688,293601280:524288,310378496:1074266112,327155712:16384,343932928:1073758208,360710144:1074282512,377487360:16,394264576:1073741824,411041792:1074282496,427819008:1073741840,444596224:1073758224,461373440:524304,478150656:0,494927872:16400,511705088:1074266128,528482304:540672},{0:260,1048576:0,2097152:67109120,3145728:65796,4194304:65540,5242880:67108868,6291456:67174660,7340032:67174400,8388608:67108864,9437184:67174656,10485760:65792,11534336:67174404,12582912:67109124,13631488:65536,14680064:4,15728640:256,524288:67174656,1572864:67174404,2621440:0,3670016:67109120,4718592:67108868,5767168:65536,6815744:65540,7864320:260,8912896:4,9961472:256,11010048:67174400,12058624:65796,13107200:65792,14155776:67109124,15204352:67174660,16252928:67108864,16777216:67174656,17825792:65540,18874368:65536,19922944:67109120,20971520:256,22020096:67174660,23068672:67108868,24117248:0,25165824:67109124,26214400:67108864,27262976:4,28311552:65792,29360128:67174400,30408704:260,31457280:65796,32505856:67174404,17301504:67108864,18350080:260,19398656:67174656,20447232:0,21495808:65540,22544384:67109120,23592960:256,24641536:67174404,25690112:65536,26738688:67174660,27787264:65796,28835840:67108868,29884416:67109124,30932992:67174400,31981568:4,33030144:65792},{0:2151682048,65536:2147487808,131072:4198464,196608:2151677952,262144:0,327680:4198400,393216:2147483712,458752:4194368,524288:2147483648,589824:4194304,655360:64,720896:2147487744,786432:2151678016,851968:4160,917504:4096,983040:2151682112,32768:2147487808,98304:64,163840:2151678016,229376:2147487744,294912:4198400,360448:2151682112,425984:0,491520:2151677952,557056:4096,622592:2151682048,688128:4194304,753664:4160,819200:2147483648,884736:4194368,950272:4198464,1015808:2147483712,1048576:4194368,1114112:4198400,1179648:2147483712,1245184:0,1310720:4160,1376256:2151678016,1441792:2151682048,1507328:2147487808,1572864:2151682112,1638400:2147483648,1703936:2151677952,1769472:4198464,1835008:2147487744,1900544:4194304,1966080:64,2031616:4096,1081344:2151677952,1146880:2151682112,1212416:0,1277952:4198400,1343488:4194368,1409024:2147483648,1474560:2147487808,1540096:64,1605632:2147483712,1671168:4096,1736704:2147487744,1802240:2151678016,1867776:4160,1933312:2151682048,1998848:4194304,2064384:4198464},{0:128,4096:17039360,8192:262144,12288:536870912,16384:537133184,20480:16777344,24576:553648256,28672:262272,32768:16777216,36864:537133056,40960:536871040,45056:553910400,49152:553910272,53248:0,57344:17039488,61440:553648128,2048:17039488,6144:553648256,10240:128,14336:17039360,18432:262144,22528:537133184,26624:553910272,30720:536870912,34816:537133056,38912:0,43008:553910400,47104:16777344,51200:536871040,55296:553648128,59392:16777216,63488:262272,65536:262144,69632:128,73728:536870912,77824:553648256,81920:16777344,86016:553910272,90112:537133184,94208:16777216,98304:553910400,102400:553648128,106496:17039360,110592:537133056,114688:262272,118784:536871040,122880:0,126976:17039488,67584:553648256,71680:16777216,75776:17039360,79872:537133184,83968:536870912,88064:17039488,92160:128,96256:553910272,100352:262272,104448:553910400,108544:0,112640:553648128,116736:16777344,120832:262144,124928:537133056,129024:536871040},{0:268435464,256:8192,512:270532608,768:270540808,1024:268443648,1280:2097152,1536:2097160,1792:268435456,2048:0,2304:268443656,2560:2105344,2816:8,3072:270532616,3328:2105352,3584:8200,3840:270540800,128:270532608,384:270540808,640:8,896:2097152,1152:2105352,1408:268435464,1664:268443648,1920:8200,2176:2097160,2432:8192,2688:268443656,2944:270532616,3200:0,3456:270540800,3712:2105344,3968:268435456,4096:268443648,4352:270532616,4608:270540808,4864:8200,5120:2097152,5376:268435456,5632:268435464,5888:2105344,6144:2105352,6400:0,6656:8,6912:270532608,7168:8192,7424:268443656,7680:270540800,7936:2097160,4224:8,4480:2105344,4736:2097152,4992:268435464,5248:268443648,5504:8200,5760:270540808,6016:270532608,6272:270540800,6528:270532616,6784:8192,7040:2105352,7296:2097160,7552:0,7808:268435456,8064:268443656},{0:1048576,16:33555457,32:1024,48:1049601,64:34604033,80:0,96:1,112:34603009,128:33555456,144:1048577,160:33554433,176:34604032,192:34603008,208:1025,224:1049600,240:33554432,8:34603009,24:0,40:33555457,56:34604032,72:1048576,88:33554433,104:33554432,120:1025,136:1049601,152:33555456,168:34603008,184:1048577,200:1024,216:34604033,232:1,248:1049600,256:33554432,272:1048576,288:33555457,304:34603009,320:1048577,336:33555456,352:34604032,368:1049601,384:1025,400:34604033,416:1049600,432:1,448:0,464:34603008,480:33554433,496:1024,264:1049600,280:33555457,296:34603009,312:1,328:33554432,344:1048576,360:1025,376:34604032,392:33554433,408:34603008,424:0,440:34604033,456:1049601,472:1024,488:33555456,504:1048577},{0:134219808,1:131072,2:134217728,3:32,4:131104,5:134350880,6:134350848,7:2048,8:134348800,9:134219776,10:133120,11:134348832,12:2080,13:0,14:134217760,15:133152,2147483648:2048,2147483649:134350880,2147483650:134219808,2147483651:134217728,2147483652:134348800,2147483653:133120,2147483654:133152,2147483655:32,2147483656:134217760,2147483657:2080,2147483658:131104,2147483659:134350848,2147483660:0,2147483661:134348832,2147483662:134219776,2147483663:131072,16:133152,17:134350848,18:32,19:2048,20:134219776,21:134217760,22:134348832,23:131072,24:0,25:131104,26:134348800,27:134219808,28:134350880,29:133120,30:2080,31:134217728,2147483664:131072,2147483665:2048,2147483666:134348832,2147483667:133152,2147483668:32,2147483669:134348800,2147483670:134217728,2147483671:134219808,2147483672:134350880,2147483673:134217760,2147483674:134219776,2147483675:0,2147483676:133120,2147483677:2080,2147483678:131104,2147483679:134350848}],Tn=[4160749569,528482304,33030144,2064384,129024,8064,504,2147483679];function L0(s,t){const e=(this._lBlock>>>s^this._rBlock)&t;this._rBlock^=e,this._lBlock^=e<<s}function yt(s,t){const e=(this._rBlock>>>s^this._lBlock)&t;this._lBlock^=e,this._rBlock^=e<<s}let Y0=(()=>{class s extends y0{_doReset(){const n=this._key.words,r=[];for(let c=0;c<56;c+=1){const a=kn[c]-1;r[c]=n[a>>>5]>>>31-a%32&1}this._subKeys=[];const i=this._subKeys;for(let c=0;c<16;c+=1){i[c]=[];const a=i[c],f=En[c];for(let l=0;l<24;l+=1)a[l/6|0]|=r[(ye[l]-1+f)%28]<<31-l%6,a[4+(l/6|0)]|=r[28+(ye[l+24]-1+f)%28]<<31-l%6;a[0]=a[0]<<1|a[0]>>>31;for(let l=1;l<7;l+=1)a[l]>>>=4*(l-1)+3;a[7]=a[7]<<5|a[7]>>>27}this._invSubKeys=[];const o=this._invSubKeys;for(let c=0;c<16;c+=1)o[c]=i[15-c]}encryptBlock(e,n){this._doCryptBlock(e,n,this._subKeys)}decryptBlock(e,n){this._doCryptBlock(e,n,this._invSubKeys)}_doCryptBlock(e,n,r){const i=e;this._lBlock=e[n],this._rBlock=e[n+1],L0.call(this,4,252645135),L0.call(this,16,65535),yt.call(this,2,858993459),yt.call(this,8,16711935),L0.call(this,1,1431655765);for(let c=0;c<16;c+=1){const a=r[c],f=this._lBlock,l=this._rBlock;let d=0;for(let y=0;y<8;y+=1)d|=Bn[y][((l^a[y])&Tn[y])>>>0];this._lBlock=l,this._rBlock=f^d}const o=this._lBlock;this._lBlock=this._rBlock,this._rBlock=o,L0.call(this,1,1431655765),yt.call(this,8,16711935),yt.call(this,2,858993459),L0.call(this,16,65535),L0.call(this,4,252645135),i[n]=this._lBlock,i[n+1]=this._rBlock}}return s.keySize=2,s.ivSize=2,s.blockSize=2,s})();const An=y0._createHelper(Y0);let _e=(()=>{class s extends y0{_doReset(){const n=this._key.words;if(2!==n.length&&4!==n.length&&n.length<6)throw new Error("Invalid key length - 3DES requires the key length to be 64, 128, 192 or >192.");const r=n.slice(0,2),i=n.length<4?n.slice(0,2):n.slice(2,4),o=n.length<6?n.slice(0,2):n.slice(4,6);this._des1=Y0.createEncryptor(R.create(r)),this._des2=Y0.createEncryptor(R.create(i)),this._des3=Y0.createEncryptor(R.create(o))}encryptBlock(e,n){this._des1.encryptBlock(e,n),this._des2.decryptBlock(e,n),this._des3.encryptBlock(e,n)}decryptBlock(e,n){this._des3.decryptBlock(e,n),this._des2.encryptBlock(e,n),this._des1.decryptBlock(e,n)}}return s.keySize=6,s.ivSize=2,s.blockSize=2,s})();const Cn=y0._createHelper(_e),h0=[],w0=[],P=[];function Lt(){const s=this._X,t=this._C;for(let e=0;e<8;e+=1)w0[e]=t[e];t[0]=t[0]+1295307597+this._b|0,t[1]=t[1]+3545052371+(t[0]>>>0<w0[0]>>>0?1:0)|0,t[2]=t[2]+886263092+(t[1]>>>0<w0[1]>>>0?1:0)|0,t[3]=t[3]+1295307597+(t[2]>>>0<w0[2]>>>0?1:0)|0,t[4]=t[4]+3545052371+(t[3]>>>0<w0[3]>>>0?1:0)|0,t[5]=t[5]+886263092+(t[4]>>>0<w0[4]>>>0?1:0)|0,t[6]=t[6]+1295307597+(t[5]>>>0<w0[5]>>>0?1:0)|0,t[7]=t[7]+3545052371+(t[6]>>>0<w0[6]>>>0?1:0)|0,this._b=t[7]>>>0<w0[7]>>>0?1:0;for(let e=0;e<8;e+=1){const n=s[e]+t[e],r=65535&n,i=n>>>16;P[e]=((r*r>>>17)+r*i>>>15)+i*i^((4294901760&n)*n|0)+((65535&n)*n|0)}s[0]=P[0]+(P[7]<<16|P[7]>>>16)+(P[6]<<16|P[6]>>>16)|0,s[1]=P[1]+(P[0]<<8|P[0]>>>24)+P[7]|0,s[2]=P[2]+(P[1]<<16|P[1]>>>16)+(P[0]<<16|P[0]>>>16)|0,s[3]=P[3]+(P[2]<<8|P[2]>>>24)+P[1]|0,s[4]=P[4]+(P[3]<<16|P[3]>>>16)+(P[2]<<16|P[2]>>>16)|0,s[5]=P[5]+(P[4]<<8|P[4]>>>24)+P[3]|0,s[6]=P[6]+(P[5]<<16|P[5]>>>16)+(P[4]<<16|P[4]>>>16)|0,s[7]=P[7]+(P[6]<<8|P[6]>>>24)+P[5]|0}class ge extends l0{constructor(...t){super(...t),this.blockSize=4,this.ivSize=2}_doReset(){const t=this._key.words,{iv:e}=this.cfg;for(let i=0;i<4;i+=1)t[i]=16711935&(t[i]<<8|t[i]>>>24)|4278255360&(t[i]<<24|t[i]>>>8);this._X=[t[0],t[3]<<16|t[2]>>>16,t[1],t[0]<<16|t[3]>>>16,t[2],t[1]<<16|t[0]>>>16,t[3],t[2]<<16|t[1]>>>16];const n=this._X;this._C=[t[2]<<16|t[2]>>>16,4294901760&t[0]|65535&t[1],t[3]<<16|t[3]>>>16,4294901760&t[1]|65535&t[2],t[0]<<16|t[0]>>>16,4294901760&t[2]|65535&t[3],t[1]<<16|t[1]>>>16,4294901760&t[3]|65535&t[0]];const r=this._C;this._b=0;for(let i=0;i<4;i+=1)Lt.call(this);for(let i=0;i<8;i+=1)r[i]^=n[i+4&7];if(e){const i=e.words,o=i[0],c=i[1],a=16711935&(o<<8|o>>>24)|4278255360&(o<<24|o>>>8),f=16711935&(c<<8|c>>>24)|4278255360&(c<<24|c>>>8),l=a>>>16|4294901760&f,d=f<<16|65535&a;r[0]^=a,r[1]^=l,r[2]^=f,r[3]^=d,r[4]^=a,r[5]^=l,r[6]^=f,r[7]^=d;for(let y=0;y<4;y+=1)Lt.call(this)}}_doProcessBlock(t,e){const n=t,r=this._X;Lt.call(this),h0[0]=r[0]^r[5]>>>16^r[3]<<16,h0[1]=r[2]^r[7]>>>16^r[5]<<16,h0[2]=r[4]^r[1]>>>16^r[7]<<16,h0[3]=r[6]^r[3]>>>16^r[1]<<16;for(let i=0;i<4;i+=1)h0[i]=16711935&(h0[i]<<8|h0[i]>>>24)|4278255360&(h0[i]<<24|h0[i]>>>8),n[e+i]^=h0[i]}}const Rn=l0._createHelper(ge),x0=[],m0=[],D=[];function zt(){const s=this._X,t=this._C;for(let e=0;e<8;e+=1)m0[e]=t[e];t[0]=t[0]+1295307597+this._b|0,t[1]=t[1]+3545052371+(t[0]>>>0<m0[0]>>>0?1:0)|0,t[2]=t[2]+886263092+(t[1]>>>0<m0[1]>>>0?1:0)|0,t[3]=t[3]+1295307597+(t[2]>>>0<m0[2]>>>0?1:0)|0,t[4]=t[4]+3545052371+(t[3]>>>0<m0[3]>>>0?1:0)|0,t[5]=t[5]+886263092+(t[4]>>>0<m0[4]>>>0?1:0)|0,t[6]=t[6]+1295307597+(t[5]>>>0<m0[5]>>>0?1:0)|0,t[7]=t[7]+3545052371+(t[6]>>>0<m0[6]>>>0?1:0)|0,this._b=t[7]>>>0<m0[7]>>>0?1:0;for(let e=0;e<8;e+=1){const n=s[e]+t[e],r=65535&n,i=n>>>16;D[e]=((r*r>>>17)+r*i>>>15)+i*i^((4294901760&n)*n|0)+((65535&n)*n|0)}s[0]=D[0]+(D[7]<<16|D[7]>>>16)+(D[6]<<16|D[6]>>>16)|0,s[1]=D[1]+(D[0]<<8|D[0]>>>24)+D[7]|0,s[2]=D[2]+(D[1]<<16|D[1]>>>16)+(D[0]<<16|D[0]>>>16)|0,s[3]=D[3]+(D[2]<<8|D[2]>>>24)+D[1]|0,s[4]=D[4]+(D[3]<<16|D[3]>>>16)+(D[2]<<16|D[2]>>>16)|0,s[5]=D[5]+(D[4]<<8|D[4]>>>24)+D[3]|0,s[6]=D[6]+(D[5]<<16|D[5]>>>16)+(D[4]<<16|D[4]>>>16)|0,s[7]=D[7]+(D[6]<<8|D[6]>>>24)+D[5]|0}class we extends l0{constructor(...t){super(...t),this.blockSize=4,this.ivSize=2}_doReset(){const t=this._key.words,{iv:e}=this.cfg;this._X=[t[0],t[3]<<16|t[2]>>>16,t[1],t[0]<<16|t[3]>>>16,t[2],t[1]<<16|t[0]>>>16,t[3],t[2]<<16|t[1]>>>16];const n=this._X;this._C=[t[2]<<16|t[2]>>>16,4294901760&t[0]|65535&t[1],t[3]<<16|t[3]>>>16,4294901760&t[1]|65535&t[2],t[0]<<16|t[0]>>>16,4294901760&t[2]|65535&t[3],t[1]<<16|t[1]>>>16,4294901760&t[3]|65535&t[0]];const r=this._C;this._b=0;for(let i=0;i<4;i+=1)zt.call(this);for(let i=0;i<8;i+=1)r[i]^=n[i+4&7];if(e){const i=e.words,o=i[0],c=i[1],a=16711935&(o<<8|o>>>24)|4278255360&(o<<24|o>>>8),f=16711935&(c<<8|c>>>24)|4278255360&(c<<24|c>>>8),l=a>>>16|4294901760&f,d=f<<16|65535&a;r[0]^=a,r[1]^=l,r[2]^=f,r[3]^=d,r[4]^=a,r[5]^=l,r[6]^=f,r[7]^=d;for(let y=0;y<4;y+=1)zt.call(this)}}_doProcessBlock(t,e){const n=t,r=this._X;zt.call(this),x0[0]=r[0]^r[5]>>>16^r[3]<<16,x0[1]=r[2]^r[7]>>>16^r[5]<<16,x0[2]=r[4]^r[1]>>>16^r[7]<<16,x0[3]=r[6]^r[3]>>>16^r[1]<<16;for(let i=0;i<4;i+=1)x0[i]=16711935&(x0[i]<<8|x0[i]>>>24)|4278255360&(x0[i]<<24|x0[i]>>>8),n[e+i]^=x0[i]}}const Hn=l0._createHelper(we);function me(){const s=this._S;let t=this._i,e=this._j,n=0;for(let r=0;r<4;r+=1){t=(t+1)%256,e=(e+s[t])%256;const i=s[t];s[t]=s[e],s[e]=i,n|=s[(s[t]+s[e])%256]<<24-8*r}return this._i=t,this._j=e,n}let Ft=(()=>{class s extends l0{_doReset(){const e=this._key,n=e.words,r=e.sigBytes;this._S=[];const i=this._S;for(let o=0;o<256;o+=1)i[o]=o;for(let o=0,c=0;o<256;o+=1){const a=o%r;c=(c+i[o]+(n[a>>>2]>>>24-a%4*8&255))%256;const l=i[o];i[o]=i[c],i[c]=l}this._j=0,this._i=this._j}_doProcessBlock(e,n){e[n]^=me.call(this)}}return s.keySize=8,s.ivSize=0,s})();const In=l0._createHelper(Ft);class ve extends Ft{constructor(...t){super(...t),Object.assign(this.cfg,{drop:192})}_doReset(){super._doReset.call(this);for(let t=this.cfg.drop;t>0;t-=1)me.call(this)}}const Pn=l0._createHelper(ve);function Se(s,t,e,n){const r=s;let i;const o=this._iv;o?(i=o.slice(0),this._iv=void 0):i=this._prevBlock,n.encryptBlock(i,0);for(let c=0;c<e;c+=1)r[t+c]^=i[c]}let Dn=(()=>{class s extends b0{}return s.Encryptor=class extends s{processBlock(t,e){const n=this._cipher,{blockSize:r}=n;Se.call(this,t,e,r,n),this._prevBlock=t.slice(e,e+r)}},s.Decryptor=class extends s{processBlock(t,e){const n=this._cipher,{blockSize:r}=n,i=t.slice(e,e+r);Se.call(this,t,e,r,n),this._prevBlock=i}},s})();class Z0 extends b0{}Z0.Encryptor=class extends Z0{processBlock(s,t){const e=s,n=this._cipher,{blockSize:r}=n,i=this._iv;let o=this._counter;i&&(this._counter=i.slice(0),o=this._counter,this._iv=void 0);const c=o.slice(0);n.encryptBlock(c,0),o[r-1]=o[r-1]+1|0;for(let a=0;a<r;a+=1)e[t+a]^=c[a]}},Z0.Decryptor=Z0.Encryptor;const ke=s=>{let t=s;if(255==(s>>24&255)){let e=s>>16&255,n=s>>8&255,r=255&s;255===e?(e=0,255===n?(n=0,255===r?r=0:r+=1):n+=1):e+=1,t=0,t+=e<<16,t+=n<<8,t+=r}else t+=1<<24;return t};class J0 extends b0{}J0.Encryptor=class extends J0{processBlock(s,t){const e=s,n=this._cipher,{blockSize:r}=n,i=this._iv;let o=this._counter;i&&(this._counter=i.slice(0),o=this._counter,this._iv=void 0),(s=>{const t=s;t[0]=ke(t[0]),0===t[0]&&(t[1]=ke(t[1]))})(o);const c=o.slice(0);n.encryptBlock(c,0);for(let a=0;a<r;a+=1)e[t+a]^=c[a]}},J0.Decryptor=J0.Encryptor;let On=(()=>{class s extends b0{}return s.Encryptor=class extends s{processBlock(t,e){this._cipher.encryptBlock(t,e)}},s.Decryptor=class extends s{processBlock(t,e){this._cipher.decryptBlock(t,e)}},s})();class tt extends b0{}tt.Encryptor=class extends tt{processBlock(s,t){const e=s,n=this._cipher,{blockSize:r}=n,i=this._iv;let o=this._keystream;i&&(this._keystream=i.slice(0),o=this._keystream,this._iv=void 0),n.encryptBlock(o,0);for(let c=0;c<r;c+=1)e[t+c]^=o[c]}},tt.Decryptor=tt.Encryptor;const zn={pad(s,t){const e=4*t,n=e-s.sigBytes%e;s.concat(R.random(n-1)).concat(R.create([n<<24],1))},unpad(s){s.sigBytes-=255&s.words[s.sigBytes-1>>>2]}},Wt={pad(s,t){const e=s,n=4*t;e.clamp(),e.sigBytes+=n-(s.sigBytes%n||n)},unpad(s){const t=s,e=t.words;for(let n=t.sigBytes-1;n>=0;n-=1)if(e[n>>>2]>>>24-n%4*8&255){t.sigBytes=n+1;break}}},Fn={lib:{Base:O,WordArray:R,BufferedBlockAlgorithm:E,Hasher:g,Cipher:q0,StreamCipher:l0,BlockCipherMode:b0,BlockCipher:y0,CipherParams:T0,SerializableCipher:w,PasswordBasedCipher:I},x64:{Word:x,WordArray:V},enc:{Hex:S0,Latin1:t0,Utf8:e0,Utf16:q,Utf16BE:W,Utf16LE:A0,Base64:a0},algo:{HMAC:T,MD5:I0,SHA1:ut,SHA224:At,SHA256:D0,SHA384:Ct,SHA512:O0,SHA3:Ht,RIPEMD160:It,PBKDF2:he,EvpKDF:V0,AES:be,DES:Y0,TripleDES:_e,Rabbit:ge,RabbitLegacy:we,RC4:Ft,RC4Drop:ve},mode:{CBC:xt,CFB:Dn,CTR:Z0,CTRGladman:J0,ECB:On,OFB:tt},pad:{Pkcs7:ft,AnsiX923:{pad(s,t){const e=s,n=e.sigBytes,r=4*t,i=r-n%r,o=n+i-1;e.clamp(),e.words[o>>>2]|=i<<24-o%4*8,e.sigBytes+=i},unpad(s){s.sigBytes-=255&s.words[s.sigBytes-1>>>2]}},Iso10126:zn,Iso97971:{pad(s,t){s.concat(R.create([2147483648],1)),Wt.pad(s,t)},unpad(s){const t=s;Wt.unpad(t),t.sigBytes-=1}},NoPadding:{pad(){},unpad(){}},ZeroPadding:Wt},format:{OpenSSL:b,Hex:{stringify:s=>s.ciphertext.toString(S0),parse(s){const t=S0.parse(s);return T0.create({ciphertext:t})}}},kdf:{OpenSSL:S},MD5:$0,HmacMD5:Tt,SHA1:Ze,HmacSHA1:Je,SHA224:sn,HmacSHA224:rn,SHA256:en,HmacSHA256:nn,SHA384:ln,HmacSHA384:hn,SHA512:cn,HmacSHA512:an,SHA3:xn,HmacSHA3:fn,RIPEMD160:gn,HmacRIPEMD160:wn,PBKDF2:(s,t,e)=>he.create(e).compute(s,t),EvpKDF:(s,t,e)=>V0.create(e).compute(s,t),AES:Sn,DES:An,TripleDES:Cn,Rabbit:Rn,RabbitLegacy:Hn,RC4:In,RC4Drop:Pn};let Ee=(s=21)=>crypto.getRandomValues(new Uint8Array(s)).reduce((t,e)=>t+((e&=63)<36?e.toString(36):e<62?(e-26).toString(36).toUpperCase():e>62?"-":"_"),"");var _t=Z(79765),Un=Z(22759),jn=Z(46797),Nn=Z(66682);const Be={ethereum:{1:"main",5:"goerli",100:"xdai",137:"matic-main",80001:"matic-mumbai"}},$n=[2,3,4,42,56,250],Te={points:150,duration:1};function G(s){const{name:t,value:e,type:n,optional:r,customValidation:i}=s;if(!r&&void 0===e)throw new Error(`"${t}" is required`);if(void 0!==e&&("array"===n?Array.isArray(n):typeof e!==n))throw new Error(`"${t}" must be of type: ${n}, received type: ${typeof e} from value: ${e}`);if(void 0!==e&&i&&!i(e))throw new Error(`"${e}" is not a valid "${t}"`)}function Gn(s){return!!Be[s]}function Kt(){return{listeners:{},on:function(s,t){switch(s){case"txSent":case"txPool":case"txConfirmed":case"txSpeedUp":case"txCancel":case"txFailed":case"txDropped":case"txRequest":case"nsfFail":case"txRepeat":case"txAwaitingApproval":case"txConfirmReminder":case"txSendFail":case"txError":case"txUnderPriced":case"txPoolSimulation":case"all":break;default:throw new Error(`${s} is not a valid event code, for a list of valid event codes see: https://docs.blocknative.com/notify-sdk#event-codes`)}if("function"!=typeof t)throw new Error("Listener must be a function");this.listeners[s]=t},off:function(s){delete this.listeners[s]},emit:function(s){return this.listeners[s.eventCode]?this.listeners[s.eventCode](s):this.listeners.all?this.listeners.all(s):void 0}}}function Ce(s,t){return Be[s][t]}function Ut(s){return new Promise(t=>{setTimeout(t,s)})}const Jn=(s,t)=>void 0===t?"undefined":t;function Re(){if("undefined"!=typeof window&&"localStorage"in window){const t="__testLocalStorage";try{return window.localStorage.setItem(t,"1"),window.localStorage.removeItem(t),!0}catch{return!1}}return!1}function ts(s,t){if(this._destroyed)throw new Error("The WebSocket instance has been destroyed, re-initialize to continue making requests.");const e=Date.now(),n=Kt(),r="txSent";this.watchedTransactions.push({hash:s,emitter:n});const o={..."ethereum"===this._system?{hash:s}:{txid:s},id:t||s,startTime:e,status:"sent"},c={...o,eventCode:r};this._sendMessage({eventCode:r,categoryCode:"activeTransaction",transaction:o});const a={details:c,emitter:n};return setTimeout(function(){const l=n.emit(c);this._transactionHandlers.forEach(d=>d({transaction:c,emitterResult:l}))}.bind(this),5),a}function es(s){if(this._destroyed)throw new Error("The WebSocket instance has been destroyed, re-initialize to continue making requests.");s="ethereum"===this._system?s.toLowerCase():s;const t=Kt(),n=this.watchedAccounts.find(r=>r.address===s);return n?n.emitters.push(t):this.watchedAccounts.push({address:s,emitters:[t]}),this._sendMessage({eventCode:"watch",categoryCode:"accountAddress",account:{address:s}}),{emitter:t,details:{address:s}}}function ns(s){if(this._destroyed)throw new Error("The WebSocket instance has been destroyed, re-initialize to continue making requests.");this._sendMessage(s)}var jt=function(s,t){return(jt=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,n){e.__proto__=n}||function(e,n){for(var r in n)n.hasOwnProperty(r)&&(e[r]=n[r])})(s,t)};function J(s,t){function e(){this.constructor=s}jt(s,t),s.prototype=null===t?Object.create(t):(e.prototype=t.prototype,new e)}function Nt(s){return"function"==typeof s}var He=!1,f0={Promise:void 0,set useDeprecatedSynchronousErrorHandling(s){He=s},get useDeprecatedSynchronousErrorHandling(){return He}};function z0(s){setTimeout(function(){throw s},0)}var gt={closed:!0,next:function(s){},error:function(s){if(f0.useDeprecatedSynchronousErrorHandling)throw s;z0(s)},complete:function(){}},ss=function(){return Array.isArray||function(s){return s&&"number"==typeof s.length}}();function Ie(s){return null!==s&&"object"==typeof s}var wt=function(){function s(t){return Error.call(this),this.message=t?t.length+" errors occurred during unsubscription:\n"+t.map(function(e,n){return n+1+") "+e.toString()}).join("\n "):"",this.name="UnsubscriptionError",this.errors=t,this}return s.prototype=Object.create(Error.prototype),s}(),$t=function(){function s(t){this.closed=!1,this._parentOrParents=null,this._subscriptions=null,t&&(this._ctorUnsubscribe=!0,this._unsubscribe=t)}return s.prototype.unsubscribe=function(){var t;if(!this.closed){var e=this,n=e._parentOrParents,r=e._ctorUnsubscribe,i=e._unsubscribe,o=e._subscriptions;if(this.closed=!0,this._parentOrParents=null,this._subscriptions=null,n instanceof s)n.remove(this);else if(null!==n)for(var c=0;c<n.length;++c)n[c].remove(this);if(Nt(i)){r&&(this._unsubscribe=void 0);try{i.call(this)}catch(d){t=d instanceof wt?Pe(d.errors):[d]}}if(ss(o)){c=-1;for(var f=o.length;++c<f;){var l=o[c];if(Ie(l))try{l.unsubscribe()}catch(y){t=t||[],y instanceof wt?t=t.concat(Pe(y.errors)):t.push(y)}}}if(t)throw new wt(t)}},s.prototype.add=function(t){var e=t;if(!t)return s.EMPTY;switch(typeof t){case"function":e=new s(t);case"object":if(e===this||e.closed||"function"!=typeof e.unsubscribe)return e;if(this.closed)return e.unsubscribe(),e;if(!(e instanceof s)){var n=e;(e=new s)._subscriptions=[n]}break;default:throw new Error("unrecognized teardown "+t+" added to Subscription.")}var r=e._parentOrParents;if(null===r)e._parentOrParents=this;else if(r instanceof s){if(r===this)return e;e._parentOrParents=[r,this]}else{if(-1!==r.indexOf(this))return e;r.push(this)}var i=this._subscriptions;return null===i?this._subscriptions=[e]:i.push(e),e},s.prototype.remove=function(t){var e=this._subscriptions;if(e){var n=e.indexOf(t);-1!==n&&e.splice(n,1)}},s.EMPTY=((t=new s).closed=!0,t),s;var t}();function Pe(s){return s.reduce(function(t,e){return t.concat(e instanceof wt?e.errors:e)},[])}var Vt=function(){return"function"==typeof Symbol?Symbol("rxSubscriber"):"@@rxSubscriber_"+Math.random()}(),r0=function(s){function t(e,n,r){var i=s.call(this)||this;switch(i.syncErrorValue=null,i.syncErrorThrown=!1,i.syncErrorThrowable=!1,i.isStopped=!1,arguments.length){case 0:i.destination=gt;break;case 1:if(!e){i.destination=gt;break}if("object"==typeof e){e instanceof t?(i.syncErrorThrowable=e.syncErrorThrowable,i.destination=e,e.add(i)):(i.syncErrorThrowable=!0,i.destination=new De(i,e));break}default:i.syncErrorThrowable=!0,i.destination=new De(i,e,n,r)}return i}return J(t,s),t.prototype[Vt]=function(){return this},t.create=function(e,n,r){var i=new t(e,n,r);return i.syncErrorThrowable=!1,i},t.prototype.next=function(e){this.isStopped||this._next(e)},t.prototype.error=function(e){this.isStopped||(this.isStopped=!0,this._error(e))},t.prototype.complete=function(){this.isStopped||(this.isStopped=!0,this._complete())},t.prototype.unsubscribe=function(){this.closed||(this.isStopped=!0,s.prototype.unsubscribe.call(this))},t.prototype._next=function(e){this.destination.next(e)},t.prototype._error=function(e){this.destination.error(e),this.unsubscribe()},t.prototype._complete=function(){this.destination.complete(),this.unsubscribe()},t.prototype._unsubscribeAndRecycle=function(){var e=this._parentOrParents;return this._parentOrParents=null,this.unsubscribe(),this.closed=!1,this.isStopped=!1,this._parentOrParents=e,this},t}($t),De=function(s){function t(e,n,r,i){var o=s.call(this)||this;o._parentSubscriber=e;var c,a=o;return Nt(n)?c=n:n&&(c=n.next,r=n.error,i=n.complete,n!==gt&&(Nt((a=Object.create(n)).unsubscribe)&&o.add(a.unsubscribe.bind(a)),a.unsubscribe=o.unsubscribe.bind(o))),o._context=a,o._next=c,o._error=r,o._complete=i,o}return J(t,s),t.prototype.next=function(e){if(!this.isStopped&&this._next){var n=this._parentSubscriber;f0.useDeprecatedSynchronousErrorHandling&&n.syncErrorThrowable?this.__tryOrSetError(n,this._next,e)&&this.unsubscribe():this.__tryOrUnsub(this._next,e)}},t.prototype.error=function(e){if(!this.isStopped){var n=this._parentSubscriber,r=f0.useDeprecatedSynchronousErrorHandling;if(this._error)r&&n.syncErrorThrowable?(this.__tryOrSetError(n,this._error,e),this.unsubscribe()):(this.__tryOrUnsub(this._error,e),this.unsubscribe());else if(n.syncErrorThrowable)r?(n.syncErrorValue=e,n.syncErrorThrown=!0):z0(e),this.unsubscribe();else{if(this.unsubscribe(),r)throw e;z0(e)}}},t.prototype.complete=function(){var e=this;if(!this.isStopped){var n=this._parentSubscriber;if(this._complete){var r=function(){return e._complete.call(e._context)};f0.useDeprecatedSynchronousErrorHandling&&n.syncErrorThrowable?(this.__tryOrSetError(n,r),this.unsubscribe()):(this.__tryOrUnsub(r),this.unsubscribe())}else this.unsubscribe()}},t.prototype.__tryOrUnsub=function(e,n){try{e.call(this._context,n)}catch(r){if(this.unsubscribe(),f0.useDeprecatedSynchronousErrorHandling)throw r;z0(r)}},t.prototype.__tryOrSetError=function(e,n,r){if(!f0.useDeprecatedSynchronousErrorHandling)throw new Error("bad call");try{n.call(this._context,r)}catch(i){return f0.useDeprecatedSynchronousErrorHandling?(e.syncErrorValue=i,e.syncErrorThrown=!0,!0):(z0(i),!0)}return!1},t.prototype._unsubscribe=function(){var e=this._parentSubscriber;this._context=null,this._parentSubscriber=null,e.unsubscribe()},t}(r0),Gt=function(){return"function"==typeof Symbol&&Symbol.observable||"@@observable"}();function cs(s){return s}function as(s){return 0===s.length?cs:1===s.length?s[0]:function(e){return s.reduce(function(n,r){return r(n)},e)}}var et=function(){function s(t){this._isScalar=!1,t&&(this._subscribe=t)}return s.prototype.lift=function(t){var e=new s;return e.source=this,e.operator=t,e},s.prototype.subscribe=function(t,e,n){var r=this.operator,i=function(s,t,e){if(s){if(s instanceof r0)return s;if(s[Vt])return s[Vt]()}return s||t||e?new r0(s,t,e):new r0(gt)}(t,e,n);if(i.add(r?r.call(i,this.source):this.source||f0.useDeprecatedSynchronousErrorHandling&&!i.syncErrorThrowable?this._subscribe(i):this._trySubscribe(i)),f0.useDeprecatedSynchronousErrorHandling&&i.syncErrorThrowable&&(i.syncErrorThrowable=!1,i.syncErrorThrown))throw i.syncErrorValue;return i},s.prototype._trySubscribe=function(t){try{return this._subscribe(t)}catch(e){f0.useDeprecatedSynchronousErrorHandling&&(t.syncErrorThrown=!0,t.syncErrorValue=e),function(s){for(;s;){var n=s.destination;if(s.closed||s.isStopped)return!1;s=n&&n instanceof r0?n:null}return!0}(t)?t.error(e):console.warn(e)}},s.prototype.forEach=function(t,e){var n=this;return new(e=Me(e))(function(r,i){var o;o=n.subscribe(function(c){try{t(c)}catch(a){i(a),o&&o.unsubscribe()}},i,r)})},s.prototype._subscribe=function(t){var e=this.source;return e&&e.subscribe(t)},s.prototype[Gt]=function(){return this},s.prototype.pipe=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return 0===t.length?this:as(t)(this)},s.prototype.toPromise=function(t){var e=this;return new(t=Me(t))(function(n,r){var i;e.subscribe(function(o){return i=o},function(o){return r(o)},function(){return n(i)})})},s.create=function(t){return new s(t)},s}();function Me(s){if(s||(s=Promise),!s)throw new Error("no Promise impl found");return s}function xs(){return"function"==typeof Symbol&&Symbol.iterator?Symbol.iterator:"@@iterator"}var Oe=xs(),ys=function(s){function t(e){var n=s.call(this)||this;return n.parent=e,n}return J(t,s),t.prototype._next=function(e){this.parent.notifyNext(e)},t.prototype._error=function(e){this.parent.notifyError(e),this.unsubscribe()},t.prototype._complete=function(){this.parent.notifyComplete(),this.unsubscribe()},t}(r0),_s=function(s){function t(){return null!==s&&s.apply(this,arguments)||this}return J(t,s),t.prototype.notifyNext=function(e){this.destination.next(e)},t.prototype.notifyError=function(e){this.destination.error(e)},t.prototype.notifyComplete=function(){this.destination.complete()},t}(r0),ms=function(s){function t(e,n){var r=s.call(this,e,n)||this;return r.scheduler=e,r.work=n,r.pending=!1,r}return J(t,s),t.prototype.schedule=function(e,n){if(void 0===n&&(n=0),this.closed)return this;this.state=e;var r=this.id,i=this.scheduler;return null!=r&&(this.id=this.recycleAsyncId(i,r,n)),this.pending=!0,this.delay=n,this.id=this.id||this.requestAsyncId(i,this.id,n),this},t.prototype.requestAsyncId=function(e,n,r){return void 0===r&&(r=0),setInterval(e.flush.bind(e,this),r)},t.prototype.recycleAsyncId=function(e,n,r){if(void 0===r&&(r=0),null!==r&&this.delay===r&&!1===this.pending)return n;clearInterval(n)},t.prototype.execute=function(e,n){if(this.closed)return new Error("executing a cancelled action");this.pending=!1;var r=this._execute(e,n);if(r)return r;!1===this.pending&&null!=this.id&&(this.id=this.recycleAsyncId(this.scheduler,this.id,null))},t.prototype._execute=function(e,n){var r=!1,i=void 0;try{this.work(e)}catch(o){r=!0,i=!!o&&o||new Error(o)}if(r)return this.unsubscribe(),i},t.prototype._unsubscribe=function(){var e=this.id,n=this.scheduler,r=n.actions,i=r.indexOf(this);this.work=null,this.state=null,this.pending=!1,this.scheduler=null,-1!==i&&r.splice(i,1),null!=e&&(this.id=this.recycleAsyncId(n,e,null)),this.delay=null},t}(function(s){function t(e,n){return s.call(this)||this}return J(t,s),t.prototype.schedule=function(e,n){return this},t}($t)),Le=function(){function s(t,e){void 0===e&&(e=s.now),this.SchedulerAction=t,this.now=e}return s.prototype.schedule=function(t,e,n){return void 0===e&&(e=0),new this.SchedulerAction(this,t).schedule(n,e)},s.now=function(){return Date.now()},s}(),ze=new(function(s){function t(e,n){void 0===n&&(n=Le.now);var r=s.call(this,e,function(){return t.delegate&&t.delegate!==r?t.delegate.now():n()})||this;return r.actions=[],r.active=!1,r.scheduled=void 0,r}return J(t,s),t.prototype.schedule=function(e,n,r){return void 0===n&&(n=0),t.delegate&&t.delegate!==this?t.delegate.schedule(e,n,r):s.prototype.schedule.call(this,e,n,r)},t.prototype.flush=function(e){var n=this.actions;if(this.active)n.push(e);else{var r;this.active=!0;do{if(r=e.execute(e.state,e.delay))break}while(e=n.shift());if(this.active=!1,r){for(;e=n.shift();)e.unsubscribe();throw r}}},t}(Le))(ms),Es=new et(function(s){return s.complete()});var Hs=function(){function s(){return Error.call(this),this.message="argument out of range",this.name="ArgumentOutOfRangeError",this}return s.prototype=Object.create(Error.prototype),s}();function mt(s,t){return function(n){return n.lift(new Is(s,t))}}var Is=function(){function s(t,e){this.predicate=t,this.thisArg=e}return s.prototype.call=function(t,e){return e.subscribe(new Ps(t,this.predicate,this.thisArg))},s}(),Ps=function(s){function t(e,n,r){var i=s.call(this,e)||this;return i.predicate=n,i.thisArg=r,i.count=0,i}return J(t,s),t.prototype._next=function(e){var n;try{n=this.predicate.call(this.thisArg,e,this.count++)}catch(r){return void this.destination.error(r)}n&&this.destination.next(e)},t}(r0);function vt(s){return function(t){return 0===s?function(s){return s?function(s){return new et(function(t){return s.schedule(function(){return t.complete()})})}(s):Es}():t.lift(new Ds(s))}}var Ds=function(){function s(t){if(this.total=t,this.total<0)throw new Hs}return s.prototype.call=function(t,e){return e.subscribe(new Ms(t,this.total))},s}(),Ms=function(s){function t(e,n){var r=s.call(this,e)||this;return r.total=n,r.count=0,r}return J(t,s),t.prototype._next=function(e){var n=this.total,r=++this.count;r<=n&&(this.destination.next(e),r===n&&(this.destination.complete(),this.unsubscribe()))},t}(r0);function Fe(s){return function(t){return t.lift(new Os(s))}}var Os=function(){function s(t){this.callback=t}return s.prototype.call=function(t,e){return e.subscribe(new Ls(t,this.callback))},s}(),Ls=function(s){function t(e,n){var r=s.call(this,e)||this;return r.add(new $t(n)),r}return J(t,s),t}(r0),Fs=function(){function s(t,e){this.predicate=t,this.inclusive=e}return s.prototype.call=function(t,e){return e.subscribe(new Ws(t,this.predicate,this.inclusive))},s}(),Ws=function(s){function t(e,n,r){var i=s.call(this,e)||this;return i.predicate=n,i.inclusive=r,i.index=0,i}return J(t,s),t.prototype._next=function(e){var r,n=this.destination;try{r=this.predicate(e,this.index++)}catch(i){return void n.error(i)}this.nextOrComplete(e,r)},t.prototype.nextOrComplete=function(e,n){var r=this.destination;Boolean(n)?r.next(e):(this.inclusive&&r.next(e),r.complete())},t}(r0),Us=function(){function s(){return Error.call(this),this.message="Timeout has occurred",this.name="TimeoutError",this}return s.prototype=Object.create(Error.prototype),s}();var Ns=function(){function s(t,e,n,r){this.waitFor=t,this.absoluteTimeout=e,this.withObservable=n,this.scheduler=r}return s.prototype.call=function(t,e){return e.subscribe(new $s(t,this.absoluteTimeout,this.waitFor,this.withObservable,this.scheduler))},s}(),$s=function(s){function t(e,n,r,i,o){var c=s.call(this,e)||this;return c.absoluteTimeout=n,c.waitFor=r,c.withObservable=i,c.scheduler=o,c.scheduleTimeout(),c}return J(t,s),t.dispatchTimeout=function(e){var n=e.withObservable;e._unsubscribeAndRecycle(),e.add(function(s,t){if(!t.closed)return s instanceof et?s.subscribe(t):function(s){if(s&&"function"==typeof s[Gt])return function(s){return function(t){var e=s[Gt]();if("function"!=typeof e.subscribe)throw new TypeError("Provided object does not correctly implement Symbol.observable");return e.subscribe(t)}}(s);if(function(s){return s&&"number"==typeof s.length&&"function"!=typeof s}(s))return function(s){return function(t){for(var e=0,n=s.length;e<n&&!t.closed;e++)t.next(s[e]);t.complete()}}(s);if(function(s){return!!s&&"function"!=typeof s.subscribe&&"function"==typeof s.then}(s))return function(s){return function(t){return s.then(function(e){t.closed||(t.next(e),t.complete())},function(e){return t.error(e)}).then(null,z0),t}}(s);if(s&&"function"==typeof s[Oe])return function(s){return function(t){for(var e=s[Oe]();;){var n=void 0;try{n=e.next()}catch(r){return t.error(r),t}if(n.done){t.complete();break}if(t.next(n.value),t.closed)break}return"function"==typeof e.return&&t.add(function(){e.return&&e.return()}),t}}(s);var t=Ie(s)?"an invalid object":"'"+s+"'";throw new TypeError("You provided "+t+" where a stream was expected. You can provide an Observable, Promise, Array, or Iterable.")}(s)(t)}(n,new ys(e)))},t.prototype.scheduleTimeout=function(){var e=this.action;e?this.action=e.schedule(this,this.waitFor):this.add(this.action=this.scheduler.schedule(t.dispatchTimeout,this.waitFor,this))},t.prototype._next=function(e){this.absoluteTimeout||this.scheduleTimeout(),s.prototype._next.call(this,e)},t.prototype._unsubscribe=function(){this.action=void 0,this.scheduler=null,this.withObservable=null},t}(_s);function Vs(s,t){return void 0===t&&(t=ze),function(s,t,e){return void 0===e&&(e=ze),function(n){var r=function(s){return s instanceof Date&&!isNaN(+s)}(s),i=r?+s-e.now():Math.abs(s);return n.lift(new Ns(i,r,t,e))}}(s,function(s,t){return new et(function(e){return e.error(s)})}(new Us),t)}const St=new _t.xQ;function Gs(s,t,e){if(this._destroyed)throw new Error("The WebSocket instance has been destroyed, re-initialize to continue making requests.");const n=Ee();return this._sendMessage({categoryCode:"simulate",eventCode:"txSimulation",eventId:n,transaction:e}),new Promise((r,i)=>{St.pipe(mt(({eventId:o})=>o===n),vt(1)).subscribe({next:({transaction:o})=>r(o),error:({error:o})=>i(o.message)})})}function qs(s){if(this._destroyed)throw new Error("The WebSocket instance has been destroyed, re-initialize to continue making requests.");const t=Ee();return this._sendMessage({categoryCode:"simulate",eventCode:"txSimulation",eventId:t,transaction:s}),new Promise((e,n)=>{St.pipe(mt(({eventId:r})=>r===t),vt(1)).subscribe({next:({transaction:r})=>e(r),error:({error:r})=>n(r.message)})})}function Xs(s){if(this._destroyed)throw new Error("The WebSocket instance has been destroyed, re-initialize to continue making requests.");const t=function(s,t){switch(s){case"ethereum":return 42===t.length;case"bitcoin":return 64!==t.length;default:return!1}}(this._system,s),e=function(s,t){switch(s){case"ethereum":return 66===t.length;case"bitcoin":return 64===t.length;default:return!1}}(this._system,s);if(t){const n="ethereum"===this._system?s.toLowerCase():s;this.watchedAccounts=this.watchedAccounts.filter(r=>r.address!==n),this.configurations.delete(n),this._sendMessage({categoryCode:"accountAddress",eventCode:"unwatch",account:{address:n}})}else{if(!e)throw new Error(`Error trying to unsubscribe ${s}: not a valid address or transaction id/hash`);{this.watchedTransactions=this.watchedTransactions.filter(i=>i.hash!==s);const r={..."ethereum"===this._system?{hash:s}:{txid:s},id:s,status:"unsubscribed"};this._sendMessage({categoryCode:"activeTransaction",eventCode:"unwatch",transaction:r})}}}function Qs(s){if(this._destroyed)throw new Error("The WebSocket instance has been destroyed, re-initialize to continue making requests.");const t="ethereum"===this._system?s.scope.toLowerCase():s.scope,e=this.configurations.get(t);e&&e.subscription&&e.subscription.next();const n=new _t.xQ,r=s.watchAddress?{emitter:Kt()}:{};return this.configurations.set(t,{...s,...r,subscription:n}),this._sendMessage({categoryCode:"configs",eventCode:"put",config:s}),new Promise((i,o)=>{n.pipe(vt(1),Vs(5e3)).subscribe({next:()=>i({...r,details:{config:s}}),error:c=>{const a="Timeout has occurred"===c.message?`Configuration with scope: ${s.scope} has been sent to the Blocknative server, but has not received a reply within 5 seconds.`:c.message;this._onerror?(this._onerror({message:a}),i(`Error: ${a}`)):o(a)}})})}function Ys(s){const{id:t,chainId:e,type:n}=s;if(!Ce("ethereum",parseInt(e,16)))throw new Error(`chainId: ${e} is an unsupported network`);this.connections[e]||(this.connections[e]=new this.Blocknative({system:"ethereum",networkId:parseInt(e,16),dappId:this.apiKey,ws:this.ws,apiUrl:this.apiUrl,transactionHandlers:[({transaction:i})=>{this.onTransaction$.next(i)}],onerror:i=>this.errors$.next(i)}));const r=this.connections[e];if("account"===n){const{filters:i=[],abi:o}=s;return r.configuration({scope:t,filters:i,...o?{abi:o}:{},watchAddress:!0}),this.transactions$.pipe(mt(({watchedAddress:c})=>c===t),Fe(()=>{this.unsubscribe({id:t,chainId:e})}))}{const{emitter:i}=r.transaction(t);return(0,Un.R)(i,"all").pipe(function(s,t){return void 0===t&&(t=!1),function(e){return e.lift(new Fs(s,t))}}(({status:o})=>"confirmed"!==o&&"failed"!==o&&"dropped"!==o,!0),Fe(()=>{this.unsubscribe({id:t,chainId:e})}))}}function Zs(s){const{id:t,chainId:e,timeout:n=0}=s,r=(0,jn.H)(n),i=this.transactions$.pipe(mt(({hash:o,watchedAddress:c})=>o===t||c===t));(0,Nn.T)(i,r).pipe(vt(1)).subscribe(o=>{"number"==typeof o?Object.entries(this.connections).filter(([a,f])=>null!==f).forEach(([a,f])=>{e&&a!==e||(f.unsubscribe(t),!f.watchedAccounts.length&&!f.watchedTransactions.length&&!f.configurations.size&&(f.destroy(),this.connections[a]=null))}):this.unsubscribe(s)})}class Js{constructor(t,e){const{ws:n}=t,{apiKey:r}=t,{apiUrl:i}=t;this.apiKey=r,this.apiUrl=i,this.ws=n,this.connections={},this.onTransaction$=new _t.xQ,this.transactions$=this.onTransaction$.asObservable(),this.errors$=new _t.xQ,this.Blocknative=e,this.subscribe=Ys.bind(this),this.unsubscribe=Zs.bind(this)}}function er(s){if(this._queuedMessages.length>1e4)throw new Error("Queue limit of 10000 messages has been reached.");this._queuedMessages.push(Xt.bind(this)(s)),this._processingQueue||this._processQueue()}function nr(){return qt.apply(this,arguments)}function qt(){return(qt=(0,H0.Z)(function*(){for(this._processingQueue=!0,this._connected||(yield rr.bind(this)());this._queuedMessages.length>0;){yield Ut(1),null!==this._waitToRetry&&(yield this._waitToRetry,this._waitToRetry=null);const s=this._queuedMessages.shift(),t=this._limitRules.duration/this._limitRules.points*1e3;yield Ut(t),this._socket.send(s)}this._processingQueue=!1,this._limitRules=Te})).apply(this,arguments)}function sr(s){const{status:t,reason:e,event:n,connectionId:r,serverVersion:i,retryMs:o,limitRules:c,blockedMsg:a,dispatchTimestamp:f}=JSON.parse(s.data);if(r&&(Re()&&window.localStorage.setItem(this._storageKey,r),this._connectionId=r),"error"===t){if(e.includes("ratelimit")&&!e.match(/IP (PendingSimulation|Notification) ratelimit reached/))return this._waitToRetry=Ut(o),this._limitRules=c,void(a&&this._queuedMessages.unshift(a));if(e.includes("upgrade your plan")){if(this._onerror)return void this._onerror({message:e});throw new Error(e)}if(e.includes("not a valid API key")){if(this._onerror)return void this._onerror({message:e});throw new Error(e)}if(e.includes("network not supported")){if(this._onerror)return void this._onerror({message:e});throw new Error(e)}if(e.includes("maximum allowed amount")){if(this._onerror)return void this._onerror({message:e});throw new Error(e)}if(e.includes("invalid txid")){const l=`${n.transaction.txid} is an invalid txid`;if(this._onerror)return void this._onerror({message:l,transaction:n.transaction.txid});throw new Error(l)}if(e.includes("invalid hash")){const l=`${n.transaction.hash} is an invalid transaction hash`;if(this._onerror)return void this._onerror({message:l,transaction:n.transaction.hash});throw new Error(l)}if(e.includes("invalid address")){const l=`${n.account.address} is an invalid address`;if(this._onerror)return void this._onerror({message:l,account:n.account.address});throw new Error(l)}if(e.includes("not a valid Bitcoin")){if(this._onerror)return void this._onerror({message:e,account:n.account.address});throw new Error(e)}if(e.includes("not a valid Ethereum")){if(this._onerror)return void this._onerror({message:e,account:n.account.address});throw new Error(e)}if(n&&"simulate"===n.categoryCode)return void St.error({eventId:n.eventId,error:{message:e}});if(n&&n.config){const l=this.configurations.get(n.config.scope);return void(l&&l.subscription&&l.subscription.error({message:e}))}if(this._onerror)return void this._onerror({message:e});throw new Error(e)}if(n&&n.config){const l="ethereum"===this._system?n.config.scope.toLowerCase():n.config.scope,d=this.configurations.get(l);d&&d.subscription&&d.subscription.next()}if(n&&n.transaction){const{eventId:l,transaction:d,eventCode:y,contractCall:A,timeStamp:B,blockchain:{system:C,network:k}}=n,v="ethereum"===this._system?{...d,serverVersion:i,eventCode:y,timeStamp:B,dispatchTimestamp:f,system:C,network:k,contractCall:A}:{...d,serverVersion:i,eventCode:y,timeStamp:B,dispatchTimestamp:f,system:C,network:k};if(function(s){switch(s){case"txRequest":case"nsfFail":case"txRepeat":case"txAwaitingApproval":case"txConfirmReminder":case"txSendFail":case"txError":case"txUnderPriced":case"txSent":return!0;default:return!1}}(y)||"unsubscribed"===d.status)return;if(v.originalHash&&(v.replaceHash=v.hash,v.hash=v.originalHash,delete v.originalHash),"txSpeedUp"===y&&"speedup"!==v.status&&(v.status="speedup"),"txCancel"===y&&"cancel"!==v.status&&(v.status="cancel"),("txSpeedUp"===y||"txCancel"===y)&&(this.watchedTransactions=this.watchedTransactions.map(H=>(H.hash===v.replaceHash&&(H.hash=d.hash||d.txid),H))),n&&"simulate"===n.categoryCode)return v.contractCall=n.transaction.contractCall,delete v.dispatchTimestamp,void St.next({eventId:l,transaction:v});const M=d.watchedAddress&&"ethereum"===this._system?d.watchedAddress.toLowerCase():d.watchedAddress;if(M){const H=this.watchedAccounts.find(p=>p.address===M),z=!!H&&function(s){return s.reverse()[0]}(H.emitters.map(p=>p.emit(v))),h=this.configurations.get(M),u=h&&h.emitter&&h.emitter.emit(v)||z;this._transactionHandlers.forEach(p=>p({transaction:v,emitterResult:u}))}else{const H=this.watchedTransactions.find(h=>h.hash===v.hash||v.txid),z=H&&H.emitter.emit(v);this._transactionHandlers.forEach(h=>h({transaction:v,emitterResult:z})),("speedup"===v.status||"cancel"===v.status)&&(this.watchedTransactions=this.watchedTransactions.map(h=>h.hash===v.hash||v.txid?{...h,hash:v.replaceHash}:h))}}}function Xt(s){return JSON.stringify({timeStamp:(new Date).toISOString(),dappId:this._dappId,version:"4.6.7",appName:this._appName,appVersion:this._appVersion,blockchain:{system:this._system,network:Ce(this._system,this._networkId)||"local"},...s},"configs"===s.categoryCode?Jn:void 0)}function rr(){return new Promise(s=>{const t=setInterval(()=>{this._connected&&(setTimeout(s,100),clearInterval(t))})})}const ir="unknown",or="unknown",cr="ethereum";function lr(s){this._connected=!0;const t={categoryCode:"initialize",eventCode:"checkDappId",connectionId:this._connectionId};this._socket.send(Xt.bind(this)(t)),this._heartbeat&&this._heartbeat(),s&&s()}function hr(s,t){this._connected=!1,s&&s(t),this._pingTimeout&&clearTimeout(this._pingTimeout)}function xr(s){return Qt.apply(this,arguments)}function Qt(){return(Qt=(0,H0.Z)(function*(s){this._connected=!0;const t={categoryCode:"initialize",eventCode:"checkDappId",connectionId:this._connectionId};this._socket.send(Xt.bind(this)(t));const e=Array.from(this.configurations.values()),n=this.configurations.get("global");if(n)try{const{emitter:i,subscription:o,...c}=n;yield this.configuration(c)}catch(i){console.warn("Error re-sending global configuration upon reconnection:",i)}e.filter(({scope:i})=>"global"!==i).forEach(i=>{const{emitter:o,subscription:c,...a}=i;this._sendMessage({categoryCode:"configs",eventCode:"put",config:a})}),this.watchedAccounts.forEach(i=>{this._sendMessage({eventCode:"accountAddress",categoryCode:"watch",account:{address:i.address}})}),s&&s(),this._socket.ws&&this._socket.ws.on&&(this._socket.ws.on("ping",()=>{this._heartbeat&&this._heartbeat()}),this._heartbeat())})).apply(this,arguments)}const fr=class{constructor(t){!function(s){G({name:"sdk options",value:s,type:"object"});const{dappId:t,system:e,name:n,appVersion:r,networkId:i,transactionHandlers:o,apiUrl:c,ws:a,onopen:f,ondown:l,onreopen:d,onerror:y,onclose:A,...B}=s;(function(s,t,e){const n=Object.keys(s);if(n.length>0)throw new Error(`${n[0]} is not a valid parameter for Initialization Options, must be one of the following valid parameters: ${["dappId","system","name","appVersion","networkId","transactionHandlers","apiUrl","ws","onopen","ondown","onreopen","onerror","onclose"].join(", ")}`)})(B),G({name:"dappId",value:t,type:"string",optional:!0}),G({name:"system",value:e,type:"string",optional:!0,customValidation:Gn}),G({name:"name",value:n,type:"string",optional:!0}),G({name:"appVersion",value:r,type:"string",optional:!0}),G({name:"networkId",value:i,type:"number"}),$n.includes(i)&&console.error(`Blocknative SDK: Network with ID: ${i} has been deprecated and you will no longer receive transaction events on this network.`),G({name:"transactionHandler",value:o,type:"array",optional:!0}),o&&o.forEach(C=>G({name:"transactionHandler",value:C,type:"function"})),G({name:"apiUrl",value:c,type:"string",optional:!0}),G({name:"ws",value:a,type:"function",optional:!0}),G({name:"onopen",value:f,type:"function",optional:!0}),G({name:"ondown",value:l,type:"function",optional:!0}),G({name:"onreopen",value:d,type:"function",optional:!0}),G({name:"onerror",value:y,type:"function",optional:!0}),G({name:"onclose",value:A,type:"function",optional:!0})}(t);const{system:e=cr,name:n=ir,appVersion:r=or,networkId:i,transactionHandlers:o=[],ws:c,onopen:a,ondown:f,onreopen:l,onerror:d,onclose:y}=t,{apiUrl:A}=t,{dappId:B}=t,C={connectTimeout:1e4},k=new N0.Z(A||"wss://api.blocknative.com/v0",c?{wsConstructor:c,...C}:{...C});k.onopen=lr.bind(this,a),k.ondown=hr.bind(this,f),k.onreopen=xr.bind(this,l),k.onmessage=sr.bind(this),k.onerror=H=>d&&d({message:"There was a WebSocket error",error:H}),k.onclose=()=>{this._pingTimeout&&clearInterval(this._pingTimeout),y&&y()};const v=Fn.SHA1(`${B} - ${n}`).toString(),M=Re()&&window.localStorage.getItem(v);this._storageKey=v,this._connectionId=M||void 0,this._dappId=B,this._system=e,this._networkId=i,this._appName=n,this._appVersion=r,this._transactionHandlers=o,this._socket=k,this._connected=!1,this._sendMessage=er.bind(this),this._pingTimeout=void 0,this._destroyed=!1,this._onerror=d,this._queuedMessages=[],this._limitRules=Te,this._waitToRetry=null,this._processingQueue=!1,this._processQueue=nr.bind(this),this._socket.ws.on&&(this._heartbeat=()=>{this._pingTimeout&&clearTimeout(this._pingTimeout),this._pingTimeout=setTimeout(()=>{this._socket.ws.terminate()},31e3)},this._socket.ws.on("ping",()=>{this._heartbeat&&this._heartbeat()})),this.watchedTransactions=[],this.watchedAccounts=[],this.configurations=new Map,this.transaction=ts.bind(this),this.account=es.bind(this),this.event=ns.bind(this),this.simulate=Gs.bind(this),this.multiSim=qs.bind(this),this.unsubscribe=Xs.bind(this),this.configuration=Qs.bind(this),this.destroy=()=>{this._socket.close(),this._destroyed=!0,this._socket.onclose()}}static multichain(t){return new Js(t,this)}}},19923:Bt=>{var B0=9007199254740991,O=/^(?:0|[1-9]\d*)$/;function R(b,w,S){switch(S.length){case 0:return b.call(w);case 1:return b.call(w,S[0]);case 2:return b.call(w,S[0],S[1]);case 3:return b.call(w,S[0],S[1],S[2])}return b.apply(w,S)}var t0=Object.prototype,e0=t0.hasOwnProperty,E=t0.toString,g=t0.propertyIsEnumerable,T=Math.max;function x(b,w,S,I){return void 0===b||$0(b,t0[S])&&!e0.call(I,S)?w:b}function V(b,w,S){var I=b[w];(!e0.call(b,w)||!$0(I,S)||void 0===S&&!(w in b))&&(b[w]=S)}function a0(b,w){return w=T(void 0===w?b.length-1:w,0),function(){for(var S=arguments,I=-1,$=T(S.length-w,0),W=Array($);++I<$;)W[I]=S[w+I];I=-1;for(var q=Array(w+1);++I<w;)q[I]=S[I];return q[w]=W,R(b,this,q)}}function F(b,w){return!!(w=w??B0)&&("number"==typeof b||O.test(b))&&b>-1&&b%1==0&&b<w}function $0(b,w){return b===w||b!=b&&w!=w}var V0=Array.isArray;function G0(b){return null!=b&&function(b){return"number"==typeof b&&b>-1&&b%1==0&&b<=B0}(b.length)&&!function(b){var w=P0(b)?E.call(b):"";return"[object Function]"==w||"[object GeneratorFunction]"==w}(b)}function P0(b){var w=typeof b;return!!b&&("object"==w||"function"==w)}var b,ft=(b=function(b,w,S,I){!function(b,w,S,I){S||(S={});for(var $=-1,W=w.length;++$<W;){var q=w[$],A0=I?I(S[q],b[q],q,S,b):void 0;V(S,q,void 0===A0?b[q]:A0)}}(w,function(b){return G0(b)?function(b,w){var S=V0(b)||function(b){return function(b){return function(b){return!!b&&"object"==typeof b}(b)&&G0(b)}(b)&&e0.call(b,"callee")&&(!g.call(b,"callee")||"[object Arguments]"==E.call(b))}(b)?function(b,w){for(var S=-1,I=Array(b);++S<b;)I[S]=w(S);return I}(b.length,String):[],I=S.length,$=!!I;for(var W in b)(w||e0.call(b,W))&&(!$||"length"!=W&&!F(W,I))&&S.push(W);return S}(b,!0):function(b){if(!P0(b))return function(b){var w=[];if(null!=b)for(var S in Object(b))w.push(S);return w}(b);var w=function(b){var w=b&&b.constructor;return b===("function"==typeof w&&w.prototype||t0)}(b),S=[];for(var I in b)"constructor"==I&&(w||!e0.call(b,I))||S.push(I);return S}(b)}(w),b,I)},a0(function(w,S){var I=-1,$=S.length,W=$>1?S[$-1]:void 0,q=$>2?S[2]:void 0;for(W=b.length>3&&"function"==typeof W?($--,W):void 0,q&&function(b,w,S){if(!P0(S))return!1;var I=typeof w;return!!("number"==I?G0(S)&&F(w,S.length):"string"==I&&w in S)&&$0(S[w],b)}(S[0],S[1],q)&&(W=$<3?void 0:W,$=1),w=Object(w);++I<$;){var A0=S[I];A0&&b(w,A0,0,W)}return w})),y0=a0(function(b){return b.push(void 0,x),R(ft,void 0,b)});Bt.exports=y0},36574:(Bt,B0,Z)=>{"use strict";var N0=Z(19923),S0=function(){function E(g,T,L){if(this.url=g,this.onclose=null,this.onerror=null,this.onmessage=null,this.onopen=null,this.ondown=null,this.onreopen=null,this.CONNECTING=E.CONNECTING,this.OPEN=E.OPEN,this.CLOSING=E.CLOSING,this.CLOSED=E.CLOSED,this.hasBeenOpened=!1,this.isClosed=!1,this.messageBuffer=[],this.nextRetryTime=0,this.reconnectCount=0,this.lastKnownExtensions="",this.lastKnownProtocol="",this.listeners={},null==T||"string"==typeof T||Array.isArray(T)?this.protocols=T:L=T,this.options=N0({},L,E.DEFAULT_OPTIONS),!this.options.wsConstructor){if("undefined"==typeof WebSocket)throw new Error("WebSocket not present in global scope and no wsConstructor option was provided.");this.options.wsConstructor=WebSocket}this.openNewWebSocket()}return Object.defineProperty(E.prototype,"binaryType",{get:function(){return this.binaryTypeInternal||"blob"},set:function(g){this.binaryTypeInternal=g,this.ws&&(this.ws.binaryType=g)},enumerable:!0,configurable:!0}),Object.defineProperty(E.prototype,"bufferedAmount",{get:function(){var g=this.ws?this.ws.bufferedAmount:0,T=!1;return this.messageBuffer.forEach(function(L){var x=function(E){return"string"==typeof E?2*E.length:E instanceof ArrayBuffer?E.byteLength:E instanceof Blob?E.size:void 0}(L);null!=x?g+=x:T=!0}),T&&this.debugLog("Some buffered data had unknown length. bufferedAmount() return value may be below the correct amount."),g},enumerable:!0,configurable:!0}),Object.defineProperty(E.prototype,"extensions",{get:function(){return this.ws?this.ws.extensions:this.lastKnownExtensions},enumerable:!0,configurable:!0}),Object.defineProperty(E.prototype,"protocol",{get:function(){return this.ws?this.ws.protocol:this.lastKnownProtocol},enumerable:!0,configurable:!0}),Object.defineProperty(E.prototype,"readyState",{get:function(){return this.isClosed?E.CLOSED:E.OPEN},enumerable:!0,configurable:!0}),E.prototype.close=function(g,T){this.ws&&this.ws.close(g,T),this.shutdown(),this.debugLog("WebSocket permanently closed by client.")},E.prototype.send=function(g){this.ws&&this.ws.readyState===this.OPEN?this.ws.send(g):this.messageBuffer.push(g)},E.prototype.addEventListener=function(g,T){this.listeners[g]||(this.listeners[g]=[]),this.listeners[g].push(T)},E.prototype.dispatchEvent=function(g){return this.dispatchEventOfType(g.type,g)},E.prototype.removeEventListener=function(g,T){this.listeners[g]&&(this.listeners[g]=this.listeners[g].filter(function(L){return L!==T}))},E.prototype.openNewWebSocket=function(){var g=this;if(!this.isClosed){var T=this.options,L=T.connectTimeout,x=T.wsConstructor;this.debugLog("Opening new WebSocket to "+this.url+".");var V=new x(this.url,this.protocols);V.onclose=function(K){return g.handleClose(K)},V.onerror=function(K){return g.handleError(K)},V.onmessage=function(K){return g.handleMessage(K)},V.onopen=function(K){return g.handleOpen(K)},this.connectTimeoutId=setTimeout(function(){g.clearConnectTimeout(),V.close()},L),this.ws=V}},E.prototype.handleOpen=function(g){var T=this;if(this.ws&&!this.isClosed){var L=this.options.allClearResetTime;this.debugLog("WebSocket opened."),null!=this.binaryTypeInternal?this.ws.binaryType=this.binaryTypeInternal:this.binaryTypeInternal=this.ws.binaryType,this.clearConnectTimeout(),this.hasBeenOpened?this.dispatchEventOfType("reopen",g):(this.dispatchEventOfType("open",g),this.hasBeenOpened=!0),this.messageBuffer.forEach(function(x){return T.send(x)}),this.messageBuffer=[],this.allClearTimeoutId=setTimeout(function(){T.clearAllClearTimeout(),T.nextRetryTime=0,T.reconnectCount=0,T.debugLog("WebSocket remained open for "+(L/1e3|0)+" seconds. Resetting retry time and count.")},L)}},E.prototype.handleMessage=function(g){this.isClosed||this.dispatchEventOfType("message",g)},E.prototype.handleClose=function(g){var T=this;if(!this.isClosed){var L=this.options,x=L.maxReconnectAttempts,V=L.shouldReconnect;if(this.clearConnectTimeout(),this.clearAllClearTimeout(),this.ws&&(this.lastKnownExtensions=this.ws.extensions,this.lastKnownProtocol=this.ws.protocol,this.ws=void 0),this.dispatchEventOfType("down",g),this.reconnectCount>=x)return void this.stopReconnecting(g,this.getTooManyFailedReconnectsMessage());var K=V(g);"boolean"==typeof K?this.handleWillReconnect(K,g,"Provided shouldReconnect() returned false. Closing permanently."):K.then(function(a0){T.isClosed||T.handleWillReconnect(a0,g,"Provided shouldReconnect() resolved to false. Closing permanently.")})}},E.prototype.handleError=function(g){this.dispatchEventOfType("error",g),this.debugLog("WebSocket encountered an error.")},E.prototype.handleWillReconnect=function(g,T,L){g?this.reconnect():this.stopReconnecting(T,L)},E.prototype.reconnect=function(){var g=this,T=this.options,L=T.minReconnectDelay,x=T.maxReconnectDelay,V=T.reconnectBackoffFactor;this.reconnectCount++;var K=this.nextRetryTime;this.nextRetryTime=Math.max(L,Math.min(this.nextRetryTime*V,x)),setTimeout(function(){return g.openNewWebSocket()},K),this.debugLog("WebSocket was closed. Re-opening in "+(K/1e3|0)+" seconds.")},E.prototype.stopReconnecting=function(g,T){this.debugLog(T),this.shutdown(),this.dispatchEventOfType("close",g)},E.prototype.shutdown=function(){this.isClosed=!0,this.clearAllTimeouts(),this.messageBuffer=[]},E.prototype.clearAllTimeouts=function(){this.clearConnectTimeout(),this.clearAllClearTimeout()},E.prototype.clearConnectTimeout=function(){null!=this.connectTimeoutId&&(clearTimeout(this.connectTimeoutId),this.connectTimeoutId=void 0)},E.prototype.clearAllClearTimeout=function(){null!=this.allClearTimeoutId&&(clearTimeout(this.allClearTimeoutId),this.allClearTimeoutId=void 0)},E.prototype.dispatchEventOfType=function(g,T){var L=this;switch(g){case"close":this.onclose&&this.onclose(T);break;case"error":this.onerror&&this.onerror(T);break;case"message":this.onmessage&&this.onmessage(T);break;case"open":this.onopen&&this.onopen(T);break;case"down":this.ondown&&this.ondown(T);break;case"reopen":this.onreopen&&this.onreopen(T)}return g in this.listeners&&this.listeners[g].slice().forEach(function(x){return L.callListener(x,T)}),!T||!T.defaultPrevented},E.prototype.callListener=function(g,T){"function"==typeof g?g.call(this,T):g.handleEvent.call(this,T)},E.prototype.debugLog=function(g){this.options.debug&&console.log(g)},E.prototype.getTooManyFailedReconnectsMessage=function(){var g=this.options.maxReconnectAttempts;return"Failed to reconnect after "+g+" "+function(E,g){return 1===g?E:E+"s"}("attempt",g)+". Closing permanently."},E.DEFAULT_OPTIONS={allClearResetTime:5e3,connectTimeout:5e3,debug:!1,minReconnectDelay:1e3,maxReconnectDelay:3e4,maxReconnectAttempts:Number.POSITIVE_INFINITY,reconnectBackoffFactor:1.5,shouldReconnect:function(){return!0},wsConstructor:void 0},E.CONNECTING=0,E.OPEN=1,E.CLOSING=2,E.CLOSED=3,E}();B0.Z=S0}}]);