PageSourceSearch

https://www.soniclabs.com/_next/static/chunks/14527.30b14d8b65df1137.js

js soniclabs.com collected 2026-09-24 09:29:20 UTC 107,099 bytes, 3 lines download raw bytes

1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[14527],{67021:function(e,t){"use strict";function n(e){if(!Number.isSafeInteger(e)||e<0)throw Error("positive integer expected, got "+e)}function r(e,...t){if(!(e instanceof Uint8Array||ArrayBuffer.isView(e)&&"Uint8Array"===e.constructor.name))throw Error("Uint8Array expected");if(t.length>0&&!t.includes(e.length))throw Error("Uint8Array expected of length "+t+", got length="+e.length)}Object.defineProperty(t,"__esModule",{value:!0}),t.anumber=n,t.abytes=r,t.ahash=function(e){if("function"!=typeof e||"function"!=typeof e.create)throw Error("Hash should be wrapped by utils.wrapConstructor");n(e.outputLen),n(e.blockLen)},t.aexists=function(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")},t.aoutput=function(e,t){r(e);let n=t.outputLen;if(e.length<n)throw Error("digestInto() expects output buffer of length at least "+n)}},30455:function(e,t){"use strict";Object.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=s,t.split=i,t.add=b;let n=BigInt(4294967296-1),r=BigInt(32);function s(e,t=!1){return t?{h:Number(e&n),l:Number(e>>r&n)}:{h:0|Number(e>>r&n),l:0|Number(e&n)}}
1function i(e,t=!1){let n=new Uint32Array(e.length),r=new Uint32Array(e.length);for(let i=0;i<e.length;i++){let{h:a,l:o}=s(e[i],t);[n[i],r[i]]=[a,o]}return[n,r]}let a=(e,t)=>BigInt(e>>>0)<<r|BigInt(t>>>0);t.toBig=a;let o=(e,t,n)=>e>>>n;t.shrSH=o;let l=(e,t,n)=>e<<32-n|t>>>n;t.shrSL=l;let c=(e,t,n)=>e>>>n|t<<32-n;t.rotrSH=c;let h=(e,t,n)=>e<<32-n|t>>>n;t.rotrSL=h;let d=(e,t,n)=>e<<64-n|t>>>n-32;t.rotrBH=d;let u=(e,t,n)=>e>>>n-32|t<<64-n;t.rotrBL=u;let p=(e,t)=>t;t.rotr32H=p;let f=(e,t)=>e;t.rotr32L=f;let g=(e,t,n)=>e<<n|t>>>32-n;t.rotlSH=g;let m=(e,t,n)=>t<<n|e>>>32-n;t.rotlSL=m;let y=(e,t,n)=>t<<n-32|e>>>64-n;t.rotlBH=y;let _=(e,t,n)=>e<<n-32|t>>>64-n;function b(e,t,n,r){let s=(t>>>0)+(r>>>0);return{h:e+n+(s/4294967296|0)|0,l:0|s}}t.rotlBL=_;let w=(e,t,n)=>(e>>>0)+(t>>>0)+(n>>>0);t.add3L=w;let v=(e,t,n,r)=>t+n+r+(e/4294967296|0)|0;t.add3H=v;let k=(e,t,n,r)=>(e>>>0)+(t>>>0)+(n>>>0)+(r>>>0);t.add4L=k;let C=(e,t,n,r,s)=>t+n+r+s+(e/4294967296|0)|0;t.add4H=C;let E=(e,t,n,r,s)=>(e>>>0)+(t>>>0)+(n>>>0)+(r>>>0)+(s>>>0);t.add5L=E;let I=(e,t,n,r,s,i)=>t+n+r+s+i+(e/4294967296|0)|0;t.add5H=I,t.default={fromBig:s,split:i,toBig:a,shrSH:o,shrSL:l,rotrSH:c,rotrSL:h,rotrBH:d,rotrBL:u,rotr32H:p,rotr32L:f,rotlSH:g,rotlSL:m,rotlBH:y,rotlBL:_,add:b,add3L:w,add3H:v,add4L:k,add4H:C,add5H:I,add5L:E}},4319:function(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},52975:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.shake256=t.shake128=t.keccak_512=t.keccak_384=t.keccak_256=t.keccak_224=t.sha3_512=t.sha3_384=t.sha3_256=t.sha3_224=t.Keccak=void 0,t.keccakP=b;let r=n(67021),s=n(30455),i=n(85758),a=[],o=[],l=[],c=BigInt(0),h=BigInt(1),d=BigInt(2),u=BigInt(7),p=BigInt(256),f=BigInt(113);for(let e=0,t=h,n=1,r=0;e<24;e++){[n,r]=[r,(2*n+3*r)%5],a.push(2*(5*r+n)),o.push((e+1)*(e+2)/2%64);let s=c;for(let e=0;e<7;e++)(t=(t<<h^(t>>u)*f)%p)&d&&(s^=h<<(h<<BigInt(e))-h);l.push(s)}let[g,m]=(0,s.split)(l,!0),y=(e,t,n)=>n>32?(0,s.rotlBH)(e,t,n):(0,s.rotlSH)(e,t,n),_=(e,t,n)=>n>32?(0,s.rotlBL)(e,t,n):(0,s.rotlSL)(e,t,n);function b(e,t=24){let n=new Uint32Array(10);for(let r=24-t;r<24;r++){for(let t=0;t<10;t++)n[t]=e[t]^e[t+10]^e[t+20]^e[t+30]^e[t+40];for(let t=0;t<10;t+=2){let r=(t+8)%10,s=(t+2)%10,i=n[s],a=n[s+1],o=y(i,a,1)^n[r],l=_(i,a,1)^n[r+1];for(let n=0;n<50;n+=10)e[t+n]^=o,e[t+n+1]^=l}let t=e[2],s=e[3];for(let n=0;n<24;n++){let r=o[n],i=y(t,s,r),l=_(t,s,r),c=a[n];t=e[c],s=e[c+1],e[c]=i,e[c+1]=l}for(let t=0;t<50;t+=10){for(let r=0;r<10;r++)n[r]=e[t+r];for(let r=0;r<10;r++)e[t+r]^=~n[(r+2)%10]&n[(r+4)%10]}e[0]^=g[r],e[1]^=m[r]}n.fill(0)}class w extends i.Hash{constructor(e,t,n,s=!1,a=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=n,this.enableXOF=s,this.rounds=a,(0,r.anumber)(n),0>=this.blockLen||this.blockLen>=200)throw Error("Sha3 supports only keccak-f1600 function");this.state=new Uint8Array(200),this.state32=(0,i.u32)(this.state)}keccak(){i.isLE||(0,i.byteSwap32)(this.state32),b(this.state32,this.rounds),i.isLE||(0,i.byteSwap32)(this.state32),this.posOut=0,this.pos=0}update(e){(0,r.aexists)(this);let{blockLen:t,state:n}=this,s=(e=(0,i.toBytes)(e)).length;for(let r=0;r<s;){let i=Math.min(t-this.pos,s-r);for(let t=0;t<i;t++)n[this.pos++]^=e[r++];this.pos===t&&this.keccak()}return this}finish(){if(this.finished)return;this.finished=!0;let{state:e,suffix:t,pos:n,blockLen:r}=this;e[n]^=t,(128&t)!=0&&n===r-1&&this.keccak(),e[r-1]^=128,this.keccak()}writeInto(e){(0,r.aexists)(this,!1),(0,r.abytes)(e),this.finish();let t=this.state,{blockLen:n}=this;for(let r=0,s=e.length;r<s;){this.posOut>=n&&this.keccak();let i=Math.min(n-this.posOut,s-r);e.set(t.subarray(this.posOut,this.posOut+i),r),this.posOut+=i,r+=i}return e}xofInto(e){if(!this.enableXOF)throw Error("XOF is not possible for this instance");return this.writeInto(e)}xof(e){return(0,r.anumber)(e),this.xofInto(new Uint8Array(e))}digestInto(e){if((0,r.aoutput)(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,this.state.fill(0)}_cloneInto(e){let{blockLen:t,suffix:n,outputLen:r,rounds:s,enableXOF:i}=this;return e||(e=new w(t,n,r,i,s)),e.state32.set(this.state32),e.pos=this.pos,e.posOut=this.posOut,e.finished=this.finished,e.rounds=s,e.suffix=n,e.outputLen=r,e.enableXOF=i,e.destroyed=this.destroyed,e}}t.Keccak=w;
1let v=(e,t,n)=>(0,i.wrapConstructor)(()=>new w(t,e,n));t.sha3_224=v(6,144,28),t.sha3_256=v(6,136,32),t.sha3_384=v(6,104,48),t.sha3_512=v(6,72,64),t.keccak_224=v(1,144,28),t.keccak_256=v(1,136,32),t.keccak_384=v(1,104,48),t.keccak_512=v(1,72,64);let k=(e,t,n)=>(0,i.wrapXOFConstructorWithOpts)((r={})=>new w(t,e,void 0===r.dkLen?n:r.dkLen,!0));t.shake128=k(31,168,16),t.shake256=k(31,136,32)},85758:function(e,t,n){"use strict";/*! noble-hashes - MIT License (c) 2022 Paul Miller (paulmillr.com) */Object.defineProperty(t,"__esModule",{value:!0}),t.Hash=t.nextTick=t.byteSwapIfBE=t.isLE=void 0,t.isBytes=function(e){return e instanceof Uint8Array||ArrayBuffer.isView(e)&&"Uint8Array"===e.constructor.name},t.u8=function(e){return new Uint8Array(e.buffer,e.byteOffset,e.byteLength)},t.u32=function(e){return new Uint32Array(e.buffer,e.byteOffset,Math.floor(e.byteLength/4))},t.createView=function(e){return new DataView(e.buffer,e.byteOffset,e.byteLength)},t.rotr=function(e,t){return e<<32-t|e>>>t},t.rotl=function(e,t){return e<<t|e>>>32-t>>>0},t.byteSwap=i,t.byteSwap32=function(e){for(let t=0;t<e.length;t++)e[t]=i(e[t])},t.bytesToHex=function(e){if((0,s.abytes)(e),a)return e.toHex();let t="";for(let n=0;n<e.length;n++)t+=o[e[n]];return t},t.hexToBytes=function(e){if("string"!=typeof e)throw Error("hex string expected, got "+typeof e);if(a)return Uint8Array.fromHex(e);let t=e.length,n=t/2;if(t%2)throw Error("hex string expected, got unpadded hex of length "+t);let r=new Uint8Array(n);for(let t=0,s=0;t<n;t++,s+=2){let n=c(e.charCodeAt(s)),i=c(e.charCodeAt(s+1));if(void 0===n||void 0===i)throw Error('hex string expected, got non-hex character "'+(e[s]+e[s+1])+'" at index '+s);r[t]=16*n+i}return r},t.asyncLoop=d,t.utf8ToBytes=u,t.toBytes=p,t.concatBytes=function(...e){let t=0;for(let n=0;n<e.length;n++){let r=e[n];(0,s.abytes)(r),t+=r.length}let n=new Uint8Array(t);for(let t=0,r=0;t<e.length;t++){let s=e[t];n.set(s,r),r+=s.length}return n},t.checkOpts=function(e,t){if(void 0!==t&&"[object Object]"!==({}).toString.call(t))throw Error("Options should be object or undefined");return Object.assign(e,t)},t.wrapConstructor=function(e){let t=t=>e().update(p(t)).digest(),n=e();return t.outputLen=n.outputLen,t.blockLen=n.blockLen,t.create=()=>e(),t},t.wrapConstructorWithOpts=function(e){let t=(t,n)=>e(n).update(p(t)).digest(),n=e({});return t.outputLen=n.outputLen,t.blockLen=n.blockLen,t.create=t=>e(t),t},t.wrapXOFConstructorWithOpts=function(e){let t=(t,n)=>e(n).update(p(t)).digest(),n=e({});return t.outputLen=n.outputLen,t.blockLen=n.blockLen,t.create=t=>e(t),t},t.randomBytes=function(e=32){if(r.crypto&&"function"==typeof r.crypto.getRandomValues)return r.crypto.getRandomValues(new Uint8Array(e));if(r.crypto&&"function"==typeof r.crypto.randomBytes)return Uint8Array.from(r.crypto.randomBytes(e));throw Error("crypto.getRandomValues must be defined")};let r=n(4319),s=n(67021);function i(e){return e<<24&4278190080|e<<8&16711680|e>>>8&65280|e>>>24&255}t.isLE=68===new Uint8Array(new Uint32Array([287454020]).buffer)[0],t.byteSwapIfBE=t.isLE?e=>e:e=>i(e);let a="function"==typeof Uint8Array.from([]).toHex&&"function"==typeof Uint8Array.fromHex,o=Array.from({length:256},(e,t)=>t.toString(16).padStart(2,"0")),l={_0:48,_9:57,A:65,F:70,a:97,f:102};function c(e){return e>=l._0&&e<=l._9?e-l._0:e>=l.A&&e<=l.F?e-(l.A-10):e>=l.a&&e<=l.f?e-(l.a-10):void 0}let h=async()=>{};async function d(e,n,r){let s=Date.now();for(let i=0;i<e;i++){r(i);let e=Date.now()-s;e>=0&&e<n||(await (0,t.nextTick)(),s+=e)}}function u(e){if("string"!=typeof e)throw Error("utf8ToBytes expected string, got "+typeof e);return new Uint8Array(new TextEncoder().encode(e))}function p(e){return"string"==typeof e&&(e=u(e)),(0,s.abytes)(e),e}t.nextTick=h;class f{clone(){return this._cloneInto()}}t.Hash=f},37836:function(e){"use strict";var t=Object.prototype.hasOwnProperty,n="~";function r(){}function s(e,t,n){this.fn=e,this.context=t,this.once=n||!1}function i(e,t,r,i,a){if("function"!=typeof r)throw TypeError("The listener must be a function");var o=new s(r,i||e,a),l=n?n+t:t;return e._events[l]?e._events[l].fn?e._events[l]=[e._events[l],o]:e._events[l].push(o):(e._events[l]=o,e._eventsCount++),e}function a(e,t){0==--e._eventsCount?e._events=new r:delete e._events[t]}function o(){this._events=new r,this._eventsCount=0}Object.create&&(r.prototype=Object.create(null),new r().__proto__||(n=!1)),o.prototype.eventNames=function(){var e,r,s=[];if(0===this._eventsCount)return s;for(r in e=this._events)t.call(e,r)&&s.push(n?r.slice(1):r);return Object.getOwnPropertySymbols?s.concat(Object.getOwnPropertySymbols(e)):s},o.prototype.listeners=function(e){var t=n?n+e:e,r=this._events[t];if(!r)return[];if(r.fn)return[r.fn];for(var s=0,i=r.length,a=Array(i);s<i;s++)a[s]=r[s].fn;return a},o.prototype.listenerCount=function(e){var t=n?n+e:e,r=this._events[t];return r?r.fn?1:r.length:0},o.prototype.emit=function(e,t,r,s,i,a){var o=n?n+e:e;if(!this._events[o])return!1;var l,c,h=this._events[o],d=arguments.length;if(h.fn){switch(h.once&&this.removeListener(e,h.fn,void 0,!0),d){case 1:return h.fn.call(h.context),!0;case 2:return h.fn.call(h.context,t),!0;case 3:return h.fn.call(h.context,t,r),!0;case 4:return h.fn.call(h.context,t,r,s),!0;case 5:return h.fn.call(h.context,t,r,s,i),!0;case 6:return h.fn.call(h.context,t,r,s,i,a),!0}for(c=1,l=Array(d-1);c<d;c++)l[c-1]=arguments[c];h.fn.apply(h.context,l)}else{var u,p=h.length;for(c=0;c<p;c++)switch(h[c].once&&this.removeListener(e,h[c].fn,void 0,!0),d){case 1:h[c].fn.call(h[c].context);break;case 2:h[c].fn.call(h[c].context,t);break;case 3:h[c].fn.call(h[c].context,t,r);break;case 4:h[c].fn.call(h[c].context,t,r,s);break;default:if(!l)for(u=1,l=Array(d-1);u<d;u++)l[u-1]=arguments[u];
vendor: 5,660 bytes, line 1
1h[c].fn.apply(h[c].context,l)}}return!0},o.prototype.on=function(e,t,n){return i(this,e,t,n,!1)},o.prototype.once=function(e,t,n){return i(this,e,t,n,!0)},o.prototype.removeListener=function(e,t,r,s){var i=n?n+e:e;if(!this._events[i])return this;if(!t)return a(this,i),this;var o=this._events[i];if(o.fn)o.fn!==t||s&&!o.once||r&&o.context!==r||a(this,i);else{for(var l=0,c=[],h=o.length;l<h;l++)(o[l].fn!==t||s&&!o[l].once||r&&o[l].context!==r)&&c.push(o[l]);c.length?this._events[i]=1===c.length?c[0]:c:a(this,i)}return this},o.prototype.removeAllListeners=function(e){var t;return e?(t=n?n+e:e,this._events[t]&&a(this,t)):(this._events=new r,this._eventsCount=0),this},o.prototype.off=o.prototype.removeListener,o.prototype.addListener=o.prototype.on,o.prefixed=n,o.EventEmitter=o,e.exports=o},29472:function(e,t,n){var r=n(9109).lW;let s=n(11860);function i(e){if(e.startsWith("int["))return"int256"+e.slice(3);if("int"===e)return"int256";if(e.startsWith("uint["))return"uint256"+e.slice(4);if("uint"===e)return"uint256";if(e.startsWith("fixed["))return"fixed128x128"+e.slice(5);if("fixed"===e)return"fixed128x128";if(e.startsWith("ufixed["))return"ufixed128x128"+e.slice(6);else if("ufixed"===e)return"ufixed128x128";return e}function a(e){return Number.parseInt(/^\D+(\d+)$/.exec(e)[1],10)}function o(e){var t=/^\D+(\d+)x(\d+)$/.exec(e);return[Number.parseInt(t[1],10),Number.parseInt(t[2],10)]}function l(e){var t=e.match(/(.*)\[(.*?)\]$/);return t?""===t[2]?"dynamic":Number.parseInt(t[2],10):null}function c(e){var t=typeof e;if("string"===t||"number"===t)return BigInt(e);if("bigint"===t)return e;throw Error("Argument is not a number")}function h(e,t){if("address"===e)return h("uint160",c(t));if("bool"===e)return h("uint8",t?1:0);if("string"===e)return h("bytes",new r(t,"utf8"));if((p=e).lastIndexOf("]")===p.length-1){if(void 0===t.length)throw Error("Not an array?");if("dynamic"!==(n=l(e))&&0!==n&&t.length>n)throw Error("Elements exceed array size: "+n);for(u in d=[],e=e.slice(0,e.lastIndexOf("[")),"string"==typeof t&&(t=JSON.parse(t)),t)d.push(h(e,t[u]));if("dynamic"===n){var n,i,d,u,p,f=h("uint256",t.length);d.unshift(f)}return r.concat(d)}if("bytes"===e)return t=new r(t),d=r.concat([h("uint256",t.length),t]),t.length%32!=0&&(d=r.concat([d,s.zeros(32-t.length%32)])),d;if(e.startsWith("bytes")){if((n=a(e))<1||n>32)throw Error("Invalid bytes<N> width: "+n);return s.setLengthRight(t,32)}else if(e.startsWith("uint")){if((n=a(e))%8||n<8||n>256)throw Error("Invalid uint<N> width: "+n);i=c(t);let r=s.bitLengthFromBigInt(i);if(r>n)throw Error("Supplied uint exceeds width: "+n+" vs "+r);if(i<0)throw Error("Supplied uint is negative");return s.bufferBEFromBigInt(i,32)}else if(e.startsWith("int")){if((n=a(e))%8||n<8||n>256)throw Error("Invalid int<N> width: "+n);i=c(t);let r=s.bitLengthFromBigInt(i);if(r>n)throw Error("Supplied int exceeds width: "+n+" vs "+r);let o=s.twosFromBigInt(i,256);return s.bufferBEFromBigInt(o,32)}else if(e.startsWith("ufixed")){if(n=o(e),(i=c(t))<0)throw Error("Supplied ufixed is negative");return h("uint256",i*BigInt(2)**BigInt(n[1]))}else if(e.startsWith("fixed"))return n=o(e),h("int256",c(t)*BigInt(2)**BigInt(n[1]));throw Error("Unsupported or invalid type: "+e)}function d(e,t){if(e.length!==t.length)throw Error("Number of types are not matching the values");for(var n,o,l=[],h=0;h<e.length;h++){var d=i(e[h]),u=t[h];if("bytes"===d)l.push(u);else if("string"===d)l.push(new r(u,"utf8"));else if("bool"===d)l.push(new r(u?"01":"00","hex"));else if("address"===d)l.push(s.setLength(u,20));else if(d.startsWith("bytes")){if((n=a(d))<1||n>32)throw Error("Invalid bytes<N> width: "+n);l.push(s.setLengthRight(u,n))}else if(d.startsWith("uint")){if((n=a(d))%8||n<8||n>256)throw Error("Invalid uint<N> width: "+n);o=c(u);let e=s.bitLengthFromBigInt(o);if(e>n)throw Error("Supplied uint exceeds width: "+n+" vs "+e);l.push(s.bufferBEFromBigInt(o,n/8))}else if(d.startsWith("int")){if((n=a(d))%8||n<8||n>256)throw Error("Invalid int<N> width: "+n);o=c(u);let e=s.bitLengthFromBigInt(o);if(e>n)throw Error("Supplied int exceeds width: "+n+" vs "+e);let t=s.twosFromBigInt(o,n);l.push(s.bufferBEFromBigInt(t,n/8))}else throw Error("Unsupported or invalid type: "+d)}return r.concat(l)}e.exports={rawEncode:function(e,t){var n=[],s=[],a=32*e.length;for(var o in e){var c=i(e[o]),d=h(c,t[o]);"string"===c||"bytes"===c||"dynamic"===l(c)?(n.push(h("uint256",a)),s.push(d),a+=d.length):n.push(d)}return r.concat(n.concat(s))},solidityPack:d,soliditySHA3:function(e,t){return s.keccak(d(e,t))}}},7602:function(e,t,n){var r=n(9109).lW;let s=n(11860),i=n(29472),a={type:"object",properties:{types:{type:"object",additionalProperties:{type:"array",items:{type:"object",properties:{name:{type:"string"},type:{type:"string"}},required:["name","type"]}}},primaryType:{type:"string"},domain:{type:"object"},message:{type:"object"}},required:["types","primaryType","domain","message"]},o={encodeData(e,t,n,a=!0){let o=["bytes32"],l=[this.hashType(e,n)];if(a){let c=(e,t,o)=>{if(void 0!==n[t])return["bytes32",null==o?"0x0000000000000000000000000000000000000000000000000000000000000000":s.keccak(this.encodeData(t,o,n,a))];if(void 0===o)throw Error(`missing value for field ${e} of type ${t}`);if("bytes"===t)return["bytes32",s.keccak(o)];if("string"===t)return"string"==typeof o&&(o=r.from(o,"utf8")),["bytes32",s.keccak(o)];if(t.lastIndexOf("]")===t.length-1){let n=t.slice(0,t.lastIndexOf("[")),r=o.map(t=>c(e,n,t));return["bytes32",s.keccak(i.rawEncode(r.map(([e])=>e),r.map(([,e])=>e)))]}return[t,o]};for(let r of n[e]){let[e,n]=c(r.name,r.type,t[r.name]);o.push(e),l.push(n)}}else for(let i of n[e]){let e=t[i.name];
vendor: 3,579 bytes, line 1
1if(void 0!==e){if("bytes"===i.type)o.push("bytes32"),e=s.keccak(e),l.push(e);else if("string"===i.type)o.push("bytes32"),"string"==typeof e&&(e=r.from(e,"utf8")),e=s.keccak(e),l.push(e);else if(void 0!==n[i.type])o.push("bytes32"),e=s.keccak(this.encodeData(i.type,e,n,a)),l.push(e);else if(i.type.lastIndexOf("]")===i.type.length-1)throw Error("Arrays currently unimplemented in encodeData");else o.push(i.type),l.push(e)}}return i.rawEncode(o,l)},encodeType(e,t){let n="",r=this.findTypeDependencies(e,t).filter(t=>t!==e);for(let s of r=[e].concat(r.sort())){if(!t[s])throw Error("No type definition specified: "+s);n+=s+"("+t[s].map(({name:e,type:t})=>t+" "+e).join(",")+")"}return n},findTypeDependencies(e,t,n=[]){if(e=e.match(/^\w*/)[0],n.includes(e)||void 0===t[e])return n;for(let r of(n.push(e),t[e]))for(let e of this.findTypeDependencies(r.type,t,n))n.includes(e)||n.push(e);return n},hashStruct(e,t,n,r=!0){return s.keccak(this.encodeData(e,t,n,r))},hashType(e,t){return s.keccak(this.encodeType(e,t))},sanitizeData(e){let t={};for(let n in a.properties)e[n]&&(t[n]=e[n]);return t.types&&(t.types=Object.assign({EIP712Domain:[]},t.types)),t},hash(e,t=!0){let n=this.sanitizeData(e),i=[r.from("1901","hex")];return i.push(this.hashStruct("EIP712Domain",n.domain,n.types,t)),"EIP712Domain"!==n.primaryType&&i.push(this.hashStruct(n.primaryType,n.message,n.types,t)),s.keccak(r.concat(i))}};e.exports={TYPED_MESSAGE_SCHEMA:a,TypedDataUtils:o,hashForSignTypedDataLegacy:function(e){return function(e){let t=Error("Expect argument to be non-empty array");if("object"!=typeof e||!e.length)throw t;let n=e.map(function(e){return"bytes"===e.type?s.toBuffer(e.value):e.value}),r=e.map(function(e){return e.type}),a=e.map(function(e){if(!e.name)throw t;return e.type+" "+e.name});return i.soliditySHA3(["bytes32","bytes32"],[i.soliditySHA3(Array(e.length).fill("string"),a),i.soliditySHA3(r,n)])}(e.data)},hashForSignTypedData_v3:function(e){return o.hash(e.data,!1)},hashForSignTypedData_v4:function(e){return o.hash(e.data)}}},11860:function(e,t,n){var r=n(9109).lW;let{keccak_256:s}=n(52975);function i(e){return r.allocUnsafe(e).fill(0)}function a(e,t){let n=e.toString(16);n.length%2!=0&&(n="0"+n);let s=n.match(/.{1,2}/g).map(e=>parseInt(e,16));for(;s.length<t;)s.unshift(0);return r.from(s)}function o(e,t,n){let r=i(t);return(e=l(e),n)?e.length<t?(e.copy(r),r):e.slice(0,t):e.length<t?(e.copy(r,t-e.length),r):e.slice(-t)}function l(e){if(!r.isBuffer(e)){if(Array.isArray(e))e=r.from(e);else if("string"==typeof e){var t;e=c(e)?r.from((t=h(e)).length%2?"0"+t:t,"hex"):r.from(e)}else if("number"==typeof e)e=intToBuffer(e);else if(null==e)e=r.allocUnsafe(0);else if("bigint"==typeof e)e=a(e);else if(e.toArray)e=r.from(e.toArray());else throw Error("invalid type")}return e}function c(e){return"string"==typeof e&&e.match(/^0x[0-9A-Fa-f]*$/)}function h(e){return"string"==typeof e&&e.startsWith("0x")?e.slice(2):e}e.exports={zeros:i,setLength:o,setLengthRight:function(e,t){return o(e,t,!0)},isHexString:c,stripHexPrefix:h,toBuffer:l,bufferToHex:function(e){return"0x"+(e=l(e)).toString("hex")},keccak:function(e,t){if(e=l(e),t||(t=256),256!==t)throw Error("unsupported");return r.from(s(new Uint8Array(e)))},bitLengthFromBigInt:function(e){return e.toString(2).length},bufferBEFromBigInt:a,twosFromBigInt:function(e,t){return(e<0n?(~e&(1n<<BigInt(t))-1n)+1n:e)&(1n<<BigInt(t))-1n}}},14527:function(e,t,n){"use strict";let r;n.r(t),n.d(t,{CoinbaseWalletSDK:function(){return tZ},createCoinbaseWalletSDK:function(){return tK},default:function(){return tF}});let s=(e,t)=>
vendor: 9,478 bytes, line 1
1{let n;switch(e){case"standard":default:return n=t,`data:image/svg+xml,%3Csvg width='${t}' height='${n}' viewBox='0 0 1024 1024' fill='none' xmlns='http://www.w3.org/2000/svg'%3E %3Crect width='1024' height='1024' fill='%230052FF'/%3E %3Cpath fill-rule='evenodd' clip-rule='evenodd' d='M152 512C152 710.823 313.177 872 512 872C710.823 872 872 710.823 872 512C872 313.177 710.823 152 512 152C313.177 152 152 313.177 152 512ZM420 396C406.745 396 396 406.745 396 420V604C396 617.255 406.745 628 420 628H604C617.255 628 628 617.255 628 604V420C628 406.745 617.255 396 604 396H420Z' fill='white'/%3E %3C/svg%3E `;case"circle":return n=t,`data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='${t}' height='${n}' viewBox='0 0 999.81 999.81'%3E%3Cdefs%3E%3Cstyle%3E.cls-1%7Bfill:%230052fe;%7D.cls-2%7Bfill:%23fefefe;%7D.cls-3%7Bfill:%230152fe;%7D%3C/style%3E%3C/defs%3E%3Cpath class='cls-1' d='M655-115.9h56c.83,1.59,2.36.88,3.56,1a478,478,0,0,1,75.06,10.42C891.4-81.76,978.33-32.58,1049.19,44q116.7,126,131.94,297.61c.38,4.14-.34,8.53,1.78,12.45v59c-1.58.84-.91,2.35-1,3.56a482.05,482.05,0,0,1-10.38,74.05c-24,106.72-76.64,196.76-158.83,268.93s-178.18,112.82-287.2,122.6c-4.83.43-9.86-.25-14.51,1.77H654c-1-1.68-2.69-.91-4.06-1a496.89,496.89,0,0,1-105.9-18.59c-93.54-27.42-172.78-77.59-236.91-150.94Q199.34,590.1,184.87,426.58c-.47-5.19.25-10.56-1.77-15.59V355c1.68-1,.91-2.7,1-4.06a498.12,498.12,0,0,1,18.58-105.9c26-88.75,72.64-164.9,140.6-227.57q126-116.27,297.21-131.61C645.32-114.57,650.35-113.88,655-115.9Zm377.92,500c0-192.44-156.31-349.49-347.56-350.15-194.13-.68-350.94,155.13-352.29,347.42-1.37,194.55,155.51,352.1,348.56,352.47C876.15,734.23,1032.93,577.84,1032.93,384.11Z' transform='translate(-183.1 115.9)'/%3E%3Cpath class='cls-2' d='M1032.93,384.11c0,193.73-156.78,350.12-351.29,349.74-193-.37-349.93-157.92-348.56-352.47C334.43,189.09,491.24,33.28,685.37,34,876.62,34.62,1032.94,191.67,1032.93,384.11ZM683,496.81q43.74,0,87.48,0c15.55,0,25.32-9.72,25.33-25.21q0-87.48,0-175c0-15.83-9.68-25.46-25.59-25.46H595.77c-15.88,0-25.57,9.64-25.58,25.46q0,87.23,0,174.45c0,16.18,9.59,25.7,25.84,25.71Z' transform='translate(-183.1 115.9)'/%3E%3Cpath class='cls-3' d='M683,496.81H596c-16.25,0-25.84-9.53-25.84-25.71q0-87.23,0-174.45c0-15.82,9.7-25.46,25.58-25.46H770.22c15.91,0,25.59,9.63,25.59,25.46q0,87.47,0,175c0,15.49-9.78,25.2-25.33,25.21Q726.74,496.84,683,496.81Z' transform='translate(-183.1 115.9)'/%3E%3C/svg%3E`;case"text":return n=(.1*t).toFixed(2),`data:image/svg+xml,%3Csvg width='${t}' height='${n}' xmlns='http://www.w3.org/2000/svg' viewBox='0 0 528.15 53.64'%3E%3Cdefs%3E%3Cstyle%3E.cls-1%7Bfill:%230052ff;%7D%3C/style%3E%3C/defs%3E%3Ctitle%3ECoinbase_Wordmark_SubBrands_ALL%3C/title%3E%3Cpath class='cls-1' d='M164.45,15a15,15,0,0,0-11.74,5.4V0h-8.64V52.92h8.5V48a15,15,0,0,0,11.88,5.62c10.37,0,18.21-8.21,18.21-19.3S174.67,15,164.45,15Zm-1.3,30.67c-6.19,0-10.73-4.83-10.73-11.31S157,23,163.22,23s10.66,4.82,10.66,11.37S169.34,45.65,163.15,45.65Zm83.31-14.91-6.34-.93c-3-.43-5.18-1.44-5.18-3.82,0-2.59,2.8-3.89,6.62-3.89,4.18,0,6.84,1.8,7.42,4.76h8.35c-.94-7.49-6.7-11.88-15.55-11.88-9.15,0-15.2,4.68-15.2,11.3,0,6.34,4,10,12,11.16l6.33.94c3.1.43,4.83,1.65,4.83,4,0,2.95-3,4.17-7.2,4.17-5.12,0-8-2.09-8.43-5.25h-8.49c.79,7.27,6.48,12.38,16.84,12.38,9.44,0,15.7-4.32,15.7-11.74C258.12,35.28,253.58,31.82,246.46,30.74Zm-27.65-2.3c0-8.06-4.9-13.46-15.27-13.46-9.79,0-15.26,5-16.34,12.6h8.57c.43-3,2.73-5.4,7.63-5.4,4.39,0,6.55,1.94,6.55,4.32,0,3.09-4,3.88-8.85,4.39-6.63.72-14.84,3-14.84,11.66,0,6.7,5,11,12.89,11,6.19,0,10.08-2.59,12-6.7.28,3.67,3,6.05,6.84,6.05h5v-7.7h-4.25Zm-8.5,9.36c0,5-4.32,8.64-9.57,8.64-3.24,0-6-1.37-6-4.25,0-3.67,4.39-4.68,8.42-5.11s6-1.22,7.13-2.88ZM281.09,15c-11.09,0-19.23,8.35-19.23,19.36,0,11.6,8.72,19.3,19.37,19.3,9,0,16.06-5.33,17.86-12.89h-9c-1.3,3.31-4.47,5.19-8.71,5.19-5.55,0-9.72-3.46-10.66-9.51H299.3V33.12C299.3,22.46,291.53,15,281.09,15Zm-9.87,15.26c1.37-5.18,5.26-7.7,9.72-7.7,4.9,0,8.64,2.8,9.51,7.7ZM19.3,23a9.84,9.84,0,0,1,9.5,7h9.14c-1.65-8.93-9-15-18.57-15A19,19,0,0,0,0,34.34c0,11.09,8.28,19.3,19.37,19.3,9.36,0,16.85-6,18.5-15H28.8a9.75,9.75,0,0,1-9.43,7.06c-6.27,0-10.66-4.83-10.66-11.31S13,23,19.3,23Zm41.11-8A19,19,0,0,0,41,34.34c0,11.09,8.28,19.3,19.37,19.3A19,19,0,0,0,79.92,34.27C79.92,23.33,71.64,15,60.41,15Zm.07,30.67c-6.19,0-10.73-4.83-10.73-11.31S54.22,23,60.41,23s10.8,4.89,10.8,11.37S66.67,45.65,60.48,45.65ZM123.41,15c-5.62,0-9.29,2.3-11.45,5.54V15.7h-8.57V52.92H112V32.69C112,27,115.63,23,121,23c5,0,8.06,3.53,8.06,8.64V52.92h8.64V31C137.66,21.6,132.84,15,123.41,15ZM92,.36a5.36,5.36,0,0,0-5.55,5.47,5.55,5.55,0,0,0,11.09,0A5.35,5.35,0,0,0,92,.36Zm-9.72,23h5.4V52.92h8.64V15.7h-14Zm298.17-7.7L366.2,52.92H372L375.29,44H392l3.33,8.88h6L386.87,15.7ZM377,39.23l6.45-17.56h.1l6.56,17.56ZM362.66,15.7l-7.88,29h-.11l-8.14-29H341l-8,28.93h-.1l-8-28.87H319L329.82,53h5.45l8.19-29.24h.11L352,53h5.66L368.1,15.7Zm135.25,0v4.86h12.32V52.92h5.6V20.56h12.32V15.7ZM467.82,52.92h25.54V48.06H473.43v-12h18.35V31.35H473.43V20.56h19.93V15.7H467.82ZM443,15.7h-5.6V52.92h24.32V48.06H443Zm-30.45,0h-5.61V52.92h24.32V48.06H412.52Z'/%3E%3C/svg%3E`;case"textWithLogo":return n=(.25*t).toFixed(2),`data:image/svg+xml,%3Csvg width='${t}' height='${n}' xmlns='http://www.w3.org/2000/svg' viewBox='0 0 308.44 77.61'%3E%3Cdefs%3E%3Cstyle%3E.cls-1%7Bfill:%230052ff;%7D%3C/style%3E%3C/defs%3E%3Cpath class='cls-1' d='M142.94,20.2l-7.88,29H135l-8.15-29h-5.55l-8,28.93h-.11l-8-28.87H99.27l10.84,37.27h5.44l8.2-29.24h.1l8.41,29.24h5.66L148.39,20.2Zm17.82,0L146.48,57.42h5.82l3.28-8.88h16.65l3.34,8.88h6L167.16,20.2Zm-3.44,23.52,6.45-17.55h.11l6.56,17.55ZM278.2,20.2v4.86h12.32V57.42h5.6V25.06h12.32V20.2ZM248.11,57.42h25.54V52.55H253.71V40.61h18.35V35.85H253.71V25.06h19.94V20.2H248.11ZM223.26,20.2h-5.61V57.42H242V52.55H223.26Zm-30.46,0h-5.6V57.42h24.32V52.55H192.8Zm-154,38A19.41,19.41,0,1,1,57.92,35.57H77.47a38.81,38.81,0,1,0,0,6.47H57.92A19.39,19.39,0,0,1,38.81,58.21Z'/%3E%3C/svg%3E`;case"textLight":return n=(.1*t).toFixed(2),`data:image/svg+xml,%3Csvg width='${t}' height='${n}' xmlns='http://www.w3.org/2000/svg' viewBox='0 0 528.15 53.64'%3E%3Cdefs%3E%3Cstyle%3E.cls-1%7Bfill:%23fefefe;%7D%3C/style%3E%3C/defs%3E%3Ctitle%3ECoinbase_Wordmark_SubBrands_ALL%3C/title%3E%3Cpath class='cls-1' d='M164.45,15a15,15,0,0,0-11.74,5.4V0h-8.64V52.92h8.5V48a15,15,0,0,0,11.88,5.62c10.37,0,18.21-8.21,18.21-19.3S174.67,15,164.45,15Zm-1.3,30.67c-6.19,0-10.73-4.83-10.73-11.31S157,23,163.22,23s10.66,4.82,10.66,11.37S169.34,45.65,163.15,45.65Zm83.31-14.91-6.34-.93c-3-.43-5.18-1.44-5.18-3.82,0-2.59,2.8-3.89,6.62-3.89,4.18,0,6.84,1.8,7.42,4.76h8.35c-.94-7.49-6.7-11.88-15.55-11.88-9.15,0-15.2,4.68-15.2,11.3,0,6.34,4,10,12,11.16l6.33.94c3.1.43,4.83,1.65,4.83,4,0,2.95-3,4.17-7.2,4.17-5.12,0-8-2.09-8.43-5.25h-8.49c.79,7.27,6.48,12.38,16.84,12.38,9.44,0,15.7-4.32,15.7-11.74C258.12,35.28,253.58,31.82,246.46,30.74Zm-27.65-2.3c0-8.06-4.9-13.46-15.27-13.46-9.79,0-15.26,5-16.34,12.6h8.57c.43-3,2.73-5.4,7.63-5.4,4.39,0,6.55,1.94,6.55,4.32,0,3.09-4,3.88-8.85,4.39-6.63.72-14.84,3-14.84,11.66,0,6.7,5,11,12.89,11,6.19,0,10.08-2.59,12-6.7.28,3.67,3,6.05,6.84,6.05h5v-7.7h-4.25Zm-8.5,9.36c0,5-4.32,8.64-9.57,8.64-3.24,0-6-1.37-6-4.25,0-3.67,4.39-4.68,8.42-5.11s6-1.22,7.13-2.88ZM281.09,15c-11.09,0-19.23,8.35-19.23,19.36,0,11.6,8.72,19.3,19.37,19.3,9,0,16.06-5.33,17.86-12.89h-9c-1.3,3.31-4.47,5.19-8.71,5.19-5.55,0-9.72-3.46-10.66-9.51H299.3V33.12C299.3,22.46,291.53,15,281.09,15Zm-9.87,15.26c1.37-5.18,5.26-7.7,9.72-7.7,4.9,0,8.64,2.8,9.51,7.7ZM19.3,23a9.84,9.84,0,0,1,9.5,7h9.14c-1.65-8.93-9-15-18.57-15A19,19,0,0,0,0,34.34c0,11.09,8.28,19.3,19.37,19.3,9.36,0,16.85-6,18.5-15H28.8a9.75,9.75,0,0,1-9.43,7.06c-6.27,0-10.66-4.83-10.66-11.31S13,23,19.3,23Zm41.11-8A19,19,0,0,0,41,34.34c0,11.09,8.28,19.3,19.37,19.3A19,19,0,0,0,79.92,34.27C79.92,23.33,71.64,15,60.41,15Zm.07,30.67c-6.19,0-10.73-4.83-10.73-11.31S54.22,23,60.41,23s10.8,4.89,10.8,11.37S66.67,45.65,60.48,45.65ZM123.41,15c-5.62,0-9.29,2.3-11.45,5.54V15.7h-8.57V52.92H112V32.69C112,27,115.63,23,121,23c5,0,8.06,3.53,8.06,8.64V52.92h8.64V31C137.66,21.6,132.84,15,123.41,15ZM92,.36a5.36,5.36,0,0,0-5.55,5.47,5.55,5.55,0,0,0,11.09,0A5.35,5.35,0,0,0,92,.36Zm-9.72,23h5.4V52.92h8.64V15.7h-14Zm298.17-7.7L366.2,52.92H372L375.29,44H392l3.33,8.88h6L386.87,15.7ZM377,39.23l6.45-17.56h.1l6.56,17.56ZM362.66,15.7l-7.88,29h-.11l-8.14-29H341l-8,28.93h-.1l-8-28.87H319L329.82,53h5.45l8.19-29.24h.11L352,53h5.66L368.1,15.7Zm135.25,0v4.86h12.32V52.92h5.6V20.56h12.32V15.7ZM467.82,52.92h25.54V48.06H473.43v-12h18.35V31.35H473.43V20.56h19.93V15.7H467.82ZM443,15.7h-5.6V52.92h24.32V48.06H443Zm-30.45,0h-5.61V52.92h24.32V48.06H412.52Z'/%3E%3C/svg%3E`;case"textWithLogoLight":return n=(.25*t).toFixed(2),`data:image/svg+xml,%3Csvg width='${t}' height='${n}' xmlns='http://www.w3.org/2000/svg' viewBox='0 0 308.44 77.61'%3E%3Cdefs%3E%3Cstyle%3E.cls-1%7Bfill:%23fefefe;%7D%3C/style%3E%3C/defs%3E%3Cpath class='cls-1' d='M142.94,20.2l-7.88,29H135l-8.15-29h-5.55l-8,28.93h-.11l-8-28.87H99.27l10.84,37.27h5.44l8.2-29.24h.1l8.41,29.24h5.66L148.39,20.2Zm17.82,0L146.48,57.42h5.82l3.28-8.88h16.65l3.34,8.88h6L167.16,20.2Zm-3.44,23.52,6.45-17.55h.11l6.56,17.55ZM278.2,20.2v4.86h12.32V57.42h5.6V25.06h12.32V20.2ZM248.11,57.42h25.54V52.55H253.71V40.61h18.35V35.85H253.71V25.06h19.94V20.2H248.11ZM223.26,20.2h-5.61V57.42H242V52.55H223.26Zm-30.46,0h-5.6V57.42h24.32V52.55H192.8Zm-154,38A19.41,19.41,0,1,1,57.92,35.57H77.47a38.81,38.81,0,1,0,0,6.47H57.92A19.39,19.39,0,0,1,38.81,58.21Z'/%3E%3C/svg%3E`}}
1;class i{constructor(e,t){this.scope=e,this.module=t}storeObject(e,t){this.setItem(e,JSON.stringify(t))}loadObject(e){let t=this.getItem(e);return t?JSON.parse(t):void 0}setItem(e,t){localStorage.setItem(this.scopedKey(e),t)}getItem(e){return localStorage.getItem(this.scopedKey(e))}removeItem(e){localStorage.removeItem(this.scopedKey(e))}clear(){let e=this.scopedKey(""),t=[];for(let n=0;n<localStorage.length;n++){let r=localStorage.key(n);"string"==typeof r&&r.startsWith(e)&&t.push(r)}t.forEach(e=>localStorage.removeItem(e))}scopedKey(e){return`-${this.scope}${this.module?`:${this.module}`:""}:${e}`}static clearAll(){new i("CBWSDK").clear(),new i("walletlink").clear()}}let a={rpc:{invalidInput:-32e3,resourceNotFound:-32001,resourceUnavailable:-32002,transactionRejected:-32003,methodNotSupported:-32004,limitExceeded:-32005,parse:-32700,invalidRequest:-32600,methodNotFound:-32601,invalidParams:-32602,internal:-32603},provider:{userRejectedRequest:4001,unauthorized:4100,unsupportedMethod:4200,disconnected:4900,chainDisconnected:4901,unsupportedChain:4902}},o={"-32700":{standard:"JSON RPC 2.0",message:"Invalid JSON was received by the server. An error occurred on the server while parsing the JSON text."},"-32600":{standard:"JSON RPC 2.0",message:"The JSON sent is not a valid Request object."},"-32601":{standard:"JSON RPC 2.0",message:"The method does not exist / is not available."},"-32602":{standard:"JSON RPC 2.0",message:"Invalid method parameter(s)."},"-32603":{standard:"JSON RPC 2.0",message:"Internal JSON-RPC error."},"-32000":{standard:"EIP-1474",message:"Invalid input."},"-32001":{standard:"EIP-1474",message:"Resource not found."},"-32002":{standard:"EIP-1474",message:"Resource unavailable."},"-32003":{standard:"EIP-1474",message:"Transaction rejected."},"-32004":{standard:"EIP-1474",message:"Method not supported."},"-32005":{standard:"EIP-1474",message:"Request limit exceeded."},4001:{standard:"EIP-1193",message:"User rejected the request."},4100:{standard:"EIP-1193",message:"The requested account and/or method has not been authorized by the user."},4200:{standard:"EIP-1193",message:"The requested method is not supported by this Ethereum provider."},4900:{standard:"EIP-1193",message:"The provider is disconnected from all chains."},4901:{standard:"EIP-1193",message:"The provider is disconnected from the specified chain."},4902:{standard:"EIP-3085",message:"Unrecognized chain ID."}},l="Unspecified error message.";function c(e,t=l){if(e&&Number.isInteger(e)){let t=e.toString();if(d(o,t))return o[t].message;if(e>=-32099&&e<=-32e3)return"Unspecified server error."}return t}function h(e){return e&&"object"==typeof e&&!Array.isArray(e)?Object.assign({},e):e}function d(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function u(e,t){return"object"==typeof e&&null!==e&&t in e&&"string"==typeof e[t]}let p={rpc:{parse:e=>f(a.rpc.parse,e),invalidRequest:e=>f(a.rpc.invalidRequest,e),invalidParams:e=>f(a.rpc.invalidParams,e),methodNotFound:e=>f(a.rpc.methodNotFound,e),internal:e=>f(a.rpc.internal,e),server:e=>{if(!e||"object"!=typeof e||Array.isArray(e))throw Error("Ethereum RPC Server errors must provide single object argument.");let{code:t}=e;if(!Number.isInteger(t)||t>-32005||t<-32099)throw Error('"code" must be an integer such that: -32099 <= code 
1<= -32005');return f(t,e)},invalidInput:e=>f(a.rpc.invalidInput,e),resourceNotFound:e=>f(a.rpc.resourceNotFound,e),resourceUnavailable:e=>f(a.rpc.resourceUnavailable,e),transactionRejected:e=>f(a.rpc.transactionRejected,e),methodNotSupported:e=>f(a.rpc.methodNotSupported,e),limitExceeded:e=>f(a.rpc.limitExceeded,e)},provider:{userRejectedRequest:e=>g(a.provider.userRejectedRequest,e),unauthorized:e=>g(a.provider.unauthorized,e),unsupportedMethod:e=>g(a.provider.unsupportedMethod,e),disconnected:e=>g(a.provider.disconnected,e),chainDisconnected:e=>g(a.provider.chainDisconnected,e),unsupportedChain:e=>g(a.provider.unsupportedChain,e),custom:e=>{if(!e||"object"!=typeof e||Array.isArray(e))throw Error("Ethereum Provider custom errors must provide single object argument.");let{code:t,message:n,data:r}=e;if(!n||"string"!=typeof n)throw Error('"message" must be a nonempty string');return new _(t,n,r)}}};function f(e,t){let[n,r]=m(t);return new y(e,n||c(e),r)}function g(e,t){let[n,r]=m(t);return new _(e,n||c(e),r)}function m(e){if(e){if("string"==typeof e)return[e];if("object"==typeof e&&!Array.isArray(e)){let{message:t,data:n}=e;if(t&&"string"!=typeof t)throw Error("Must specify string message.");return[t||void 0,n]}}return[]}class y extends Error{constructor(e,t,n){if(!Number.isInteger(e))throw Error('"code" must be an integer.');if(!t||"string"!=typeof t)throw Error('"message" must be a nonempty string.');super(t),this.code=e,void 0!==n&&(this.data=n)}}class _ extends y{constructor(e,t,n){if(!(Number.isInteger(e)&&e>=1e3&&e<=4999))throw Error('"code" must be an integer such that: 1000 <= code <= 4999');super(e,t,n)}}let b=e=>e,w=e=>e,v=e=>e;function k(e){return Math.floor(e)}var C=n(9109).lW;let E=/^[0-9]*$/,I=/^[a-f0-9]*$/;function x(e){return S(crypto.getRandomValues(new Uint8Array(e)))}function S(e){return[...e].map(e=>e.toString(16).padStart(2,"0")).join("")}function M(e){return new Uint8Array(e.match(/.{1,2}/g).map(e=>Number.parseInt(e,16)))}function L(e,t=!1){let n=e.toString("hex");return b(t?`0x${n}`:n)}function A(e){return L(H(e),!0)}function P(e){return v(e.toString(10))}function D(e){return b(`0x${BigInt(e).toString(16)}`)}function N(e){return e.startsWith("0x")||e.startsWith("0X")}function R(e){return N(e)?e.slice(2):e}function T(e){return N(e)?`0x${e.slice(2)}`:`0x${e}`}function O(e){if("string"!=typeof e)return!1;let t=R(e).toLowerCase();return I.test(t)}function j(e,t=!1){let n=function(e,t=!1){if("string"==typeof e){let n=R(e).toLowerCase();if(I.test(n))return b(t?`0x${n}`:n)}throw p.rpc.invalidParams(`"${String(e)}" is not a hexadecimal string`)}(e,!1);return n.length%2==1&&(n=b(`0${n}`)),t?b(`0x${n}`):n}function U(e){if("string"==typeof e){let t=R(e).toLowerCase();if(O(t)&&40===t.length)return w(T(t))}throw p.rpc.invalidParams(`Invalid Ethereum address: ${String(e)}`)}function H(e){if(C.isBuffer(e))return e;if("string"==typeof e){if(O(e)){let t=j(e,!1);return C.from(t,"hex")}return C.from(e,"utf8")}throw p.rpc.invalidParams(`Not binary data: ${String(e)}`)}function W(e){if("number"==typeof e&&Number.isInteger(e))return k(e);if("string"==typeof e){if(E.test(e))return k(Number(e));if(O(e))return k(Number(BigInt(j(e,!0))))}throw p.rpc.invalidParams(`Not an integer: ${String(e)}`)}function q(e){if(null!==e&&("bigint"==typeof e||function(e){if(null==e||"function"!=typeof e.constructor)return!1;let{constructor:t}=e;return"function"==typeof t.config&&"number"==typeof t.EUCLID}(e)))return BigInt(e.toString(10));if("number"==typeof e)return BigInt(W(e));if("string"==typeof e){if(E.test(e))return BigInt(e);if(O(e))return BigInt(j(e,!0))}throw p.rpc.invalidParams(`Not an integer: ${String(e)}`)}async function B(){return crypto.subtle.generateKey({name:"ECDH",namedCurve:"P-256"},!0,["deriveKey"])}async function V(e,t){return crypto.subtle.deriveKey({name:"ECDH",public:t},e,{name:"AES-GCM",length:256},!1,["encrypt","decrypt"])}async function Z(e,t){let n=crypto.getRandomValues(new Uint8Array(12)),r=await crypto.subtle.encrypt({name:"AES-GCM",iv:n},e,new TextEncoder().encode(t));return{iv:n,cipherText:r}}async function z(e,{iv:t,cipherText:n}
vendor: 2,420 bytes, line 1
1){let r=await crypto.subtle.decrypt({name:"AES-GCM",iv:t},e,n);return new TextDecoder().decode(r)}function K(e){switch(e){case"public":return"spki";case"private":return"pkcs8"}}async function F(e,t){let n=K(e);return S(new Uint8Array(await crypto.subtle.exportKey(n,t)))}async function $(e,t){let n=K(e),r=M(t).buffer;return await crypto.subtle.importKey(n,new Uint8Array(r),{name:"ECDH",namedCurve:"P-256"},!0,"private"===e?["deriveKey"]:[])}async function G(e,t){return Z(t,JSON.stringify(e,(e,t)=>t instanceof Error?Object.assign(Object.assign({},t.code?{code:t.code}:{}),{message:t.message}):t))}async function J(e,t){return JSON.parse(await z(t,e))}let Y={storageKey:"ownPrivateKey",keyType:"private"},Q={storageKey:"ownPublicKey",keyType:"public"},X={storageKey:"peerPublicKey",keyType:"public"};class ee{constructor(){this.storage=new i("CBWSDK","SCWKeyManager"),this.ownPrivateKey=null,this.ownPublicKey=null,this.peerPublicKey=null,this.sharedSecret=null}async getOwnPublicKey(){return await this.loadKeysIfNeeded(),this.ownPublicKey}async getSharedSecret(){return await this.loadKeysIfNeeded(),this.sharedSecret}async setPeerPublicKey(e){this.sharedSecret=null,this.peerPublicKey=e,await this.storeKey(X,e),await this.loadKeysIfNeeded()}async clear(){this.ownPrivateKey=null,this.ownPublicKey=null,this.peerPublicKey=null,this.sharedSecret=null,this.storage.removeItem(Q.storageKey),this.storage.removeItem(Y.storageKey),this.storage.removeItem(X.storageKey)}async generateKeyPair(){let e=await B();this.ownPrivateKey=e.privateKey,this.ownPublicKey=e.publicKey,await this.storeKey(Y,e.privateKey),await this.storeKey(Q,e.publicKey)}async loadKeysIfNeeded(){null===this.ownPrivateKey&&(this.ownPrivateKey=await this.loadKey(Y)),null===this.ownPublicKey&&(this.ownPublicKey=await this.loadKey(Q)),(null===this.ownPrivateKey||null===this.ownPublicKey)&&await this.generateKeyPair(),null===this.peerPublicKey&&(this.peerPublicKey=await this.loadKey(X)),null===this.sharedSecret&&null!==this.ownPrivateKey&&null!==this.peerPublicKey&&(this.sharedSecret=await V(this.ownPrivateKey,this.peerPublicKey))}async loadKey(e){let t=this.storage.getItem(e.storageKey);return t?$(e.keyType,t):null}async storeKey(e,t){let n=await F(e.keyType,t);this.storage.setItem(e.storageKey,n)}}let et="4.3.0",en="@coinbase/wallet-sdk";async function er(e,t){let n=Object.assign(Object.assign({},e),{jsonrpc:"2.0",id:crypto.randomUUID()}
1),r=await window.fetch(t,{method:"POST",body:JSON.stringify(n),mode:"cors",headers:{"Content-Type":"application/json","X-Cbw-Sdk-Version":et,"X-Cbw-Sdk-Platform":en}}),{result:s,error:i}=await r.json();if(i)throw i;return s}function es({metadata:e,preference:t}){var n,r;let{appName:s,appLogoUrl:i,appChainIds:a}=e;if("smartWalletOnly"!==t.options){let e=globalThis.coinbaseWalletExtension;if(e)return null===(n=e.setAppInfo)||void 0===n||n.call(e,s,i,a,t),e}let o=function(){var e,t;try{let n=globalThis;return null!==(e=n.ethereum)&&void 0!==e?e:null===(t=n.top)||void 0===t?void 0:t.ethereum}catch(e){return}}();if(null==o?void 0:o.isCoinbaseBrowser)return null===(r=o.setAppInfo)||void 0===r||r.call(o,s,i,a,t),o}let ei="accounts",ea="activeChain",eo="availableChains",el="walletCapabilities";class ec{constructor(e){var t,n,r;this.metadata=e.metadata,this.communicator=e.communicator,this.callback=e.callback,this.keyManager=new ee,this.storage=new i("CBWSDK","SCWStateManager"),this.accounts=null!==(t=this.storage.loadObject(ei))&&void 0!==t?t:[],this.chain=this.storage.loadObject(ea)||{id:null!==(r=null===(n=e.metadata.appChainIds)||void 0===n?void 0:n[0])&&void 0!==r?r:1},this.handshake=this.handshake.bind(this),this.request=this.request.bind(this),this.createRequestMessage=this.createRequestMessage.bind(this),this.decryptResponseMessage=this.decryptResponseMessage.bind(this)}async handshake(e){var t,n,r,s;await (null===(n=(t=this.communicator).waitForPopupLoaded)||void 0===n?void 0:n.call(t));let i=await this.createRequestMessage({handshake:{method:e.method,params:Object.assign({},this.metadata,null!==(r=e.params)&&void 0!==r?r:{})}}),a=await this.communicator.postRequestAndWaitForResponse(i);if("failure"in a.content)throw a.content.failure;let o=await $("public",a.sender);await this.keyManager.setPeerPublicKey(o);let l=(await this.decryptResponseMessage(a)).result;if("error"in l)throw l.error;if("eth_requestAccounts"===e.method){let e=l.value;this.accounts=e,this.storage.storeObject(ei,e),null===(s=this.callback)||void 0===s||s.call(this,"accountsChanged",e)}}async request(e){var t;if(0===this.accounts.length){if("wallet_sendCalls"===e.method)return this.sendRequestToPopup(e);throw p.provider.unauthorized()}switch(e.method){case"eth_requestAccounts":return null===(t=this.callback)||void 0===t||t.call(this,"connect",{chainId:D(this.chain.id)}),this.accounts;case"eth_accounts":return this.accounts;case"eth_coinbase":return this.accounts[0];case"net_version":return this.chain.id;case"eth_chainId":return D(this.chain.id);case"wallet_getCapabilities":return this.storage.loadObject(el);case"wallet_switchEthereumChain":return this.handleSwitchChainRequest(e);case"eth_ecRecover":case"personal_sign":case"wallet_sign":case"personal_ecRecover":case"eth_signTransaction":case"eth_sendTransaction":case"eth_signTypedData_v1":case"eth_signTypedData_v3":case"eth_signTypedData_v4":case"eth_signTypedData":case"wallet_addEthereumChain":case"wallet_watchAsset":case"wallet_sendCalls":case"wallet_showCallsStatus":case"wallet_grantPermissions":return this.sendRequestToPopup(e);default:if(!this.chain.rpcUrl)throw p.rpc.internal("No RPC URL set for chain");return er(e,this.chain.rpcUrl)}}async sendRequestToPopup(e){var t,n;await (null===(n=(t=this.communicator).waitForPopupLoaded)||void 0===n?void 0:n.call(t));let r=await this.sendEncryptedRequest(e),s=(await this.decryptResponseMessage(r)).result;if("error"in s)throw s.error;return s.value}async cleanup(){var e,t;this.storage.clear(),await this.keyManager.clear(),this.accounts=[],this.chain={id:null!==(t=null===(e=this.metadata.appChainIds)||void 0===e?void 0:e[0])&&void 0!==t?t:1}}async handleSwitchChainRequest(e){var t;let n=e.params;if(!n||!(null===(t=n[0])||void 0===t?void 0:t.chainId))throw p.rpc.invalidParams();let r=W(n[0].chainId);if(this.updateChain(r))return null;let s=await this.sendRequestToPopup(e);return null===s&&this.updateChain(r),s}async sendEncryptedRequest(e){let t=await this.keyManager.getSharedSecret();if(!t)throw p.provider.unauthorized("No valid session found, try requestAccounts before other methods");let n=await G({action:e,chainId:this.chain.id},t),r=await this.createRequestMessage({encrypted:n});return this.communicator.postRequestAndWaitForResponse(r)}async createRequestMessage(e){let t=await F("public",await this.keyManager.getOwnPublicKey());return{id:crypto.randomUUID(),sender:t,content:e,timestamp:new Date}}async decryptResponseMessage(e){var t,n;let r=e.content;if("failure"in r)throw r.failure;let s=await this.keyManager.getSharedSecret();if(!s)throw p.provider.unauthorized("Invalid session");let i=await J(r.encrypted,s),a=null===(t=i.data)||void 0===t?void 0:t.chains;if(a){let e=Object.entries(a).map(([e,t])=>({id:Number(e),rpcUrl:t}));this.storage.storeObject(eo,e),this.updateChain(this.chain.id,e)}let o=null===(n=i.data)||void 0===n?void 0:n.capabilities;return o&&this.storage.storeObject(el,o),i}updateChain(e,t){var n;let r=null!=t?t:this.storage.loadObject(eo),s=null==r?void 0:r.find(t=>
1t.id===e);return!!s&&(s!==this.chain&&(this.chain=s,this.storage.storeObject(ea,s),null===(n=this.callback)||void 0===n||n.call(this,"chainChanged",D(s.id))),!0)}}var eh=n(7602);let ed="Addresses";function eu(e){return void 0!==e.errorMessage}class ep{constructor(e){this.secret=e}async encrypt(e){let t=this.secret;if(64!==t.length)throw Error("secret must be 256 bits");let n=crypto.getRandomValues(new Uint8Array(12)),r=await crypto.subtle.importKey("raw",M(t),{name:"aes-gcm"},!1,["encrypt","decrypt"]),s=new TextEncoder,i=await window.crypto.subtle.encrypt({name:"AES-GCM",iv:n},r,s.encode(e)),a=i.slice(i.byteLength-16),o=i.slice(0,i.byteLength-16),l=new Uint8Array(a),c=new Uint8Array(o);return S(new Uint8Array([...n,...l,...c]))}async decrypt(e){let t=this.secret;if(64!==t.length)throw Error("secret must be 256 bits");return new Promise((n,r)=>{!async function(){let s=await crypto.subtle.importKey("raw",M(t),{name:"aes-gcm"},!1,["encrypt","decrypt"]),i=M(e),a=i.slice(0,12),o=i.slice(12,28),l=new Uint8Array([...i.slice(28),...o]),c={name:"AES-GCM",iv:new Uint8Array(a)};try{let e=await window.crypto.subtle.decrypt(c,s,l),t=new TextDecoder;n(t.decode(e))}catch(e){r(e)}}()})}}class ef{constructor(e,t,n){this.linkAPIUrl=e,this.sessionId=t;let r=`${t}:${n}`;this.auth=`Basic ${btoa(r)}`}async markUnseenEventsAsSeen(e){return Promise.all(e.map(e=>fetch(`${this.linkAPIUrl}/events/${e.eventId}/seen`,{method:"POST",headers:{Authorization:this.auth}}))).catch(e=>console.error("Unabled to mark event as failed:",e))}async fetchUnseenEvents(){var e;let t=await fetch(`${this.linkAPIUrl}/events?unseen=true`,{headers:{Authorization:this.auth}});if(t.ok){let{events:n,error:r}=await t.json();if(r)throw Error(`Check unseen events failed: ${r}`);let s=null!==(e=null==n?void 0:n.filter(e=>"Web3Response"===e.event).map(e=>({type:"Event",sessionId:this.sessionId,eventId:e.id,event:e.event,data:e.data})))&&void 0!==e?e:[];return this.markUnseenEventsAsSeen(s),s}throw Error(`Check unseen events failed: ${t.status}`)}}(eS=eM||(eM={}))[eS.DISCONNECTED=0]="DISCONNECTED",eS[eS.CONNECTING=1]="CONNECTING",eS[eS.CONNECTED=2]="CONNECTED";class eg{setConnectionStateListener(e){this.connectionStateListener=e}setIncomingDataListener(e){this.incomingDataListener=e}constructor(e,t=WebSocket){this.WebSocketClass=t,this.webSocket=null,this.pendingData=[],this.url=e.replace(/^http/,"ws")}async connect(){if(this.webSocket)throw Error("webSocket object is not null");return new Promise((e,t)=>{var n;let r;try{this.webSocket=r=new this.WebSocketClass(this.url)}catch(e){t(e);return}null===(n=this.connectionStateListener)||void 0===n||n.call(this,eM.CONNECTING),r.onclose=e=>{var n;this.clearWebSocket(),t(Error(`websocket error ${e.code}: ${e.reason}`)),null===(n=this.connectionStateListener)||void 0===n||n.call(this,eM.DISCONNECTED)},r.onopen=t=>{var n;e(),null===(n=this.connectionStateListener)||void 0===n||n.call(this,eM.CONNECTED),this.pendingData.length>0&&([...this.pendingData].forEach(e=>this.sendData(e)),this.pendingData=[])},r.onmessage=e=>{var t,n;if("h"===e.data)null===(t=this.incomingDataListener)||void 0===t||t.call(this,{type:"Heartbeat"});else try{let t=JSON.parse(e.data);null===(n=this.incomingDataListener)||void 0===n||n.call(this,t)}catch(e){}}})}disconnect(){var e;let{webSocket:t}=this;if(t){this.clearWebSocket(),null===(e=this.connectionStateListener)||void 0===e||e.call(this,eM.DISCONNECTED),this.connectionStateListener=void 0,this.incomingDataListener=void 0;try{t.close()}catch(e){}}}sendData(e){let{webSocket:t}=this;if(!t){this.pendingData.push(e),this.connect();return}t.send(e)}clearWebSocket(){let{webSocket:e}=this;e&&(this.webSocket=null,e.onclose=null,e.onerror=null,e.onmessage=null,e.onopen=null)}}class em{constructor({session:e,linkAPIUrl:t,listener:n}){this.destroyed=!1,this.lastHeartbeatResponse=0,this.nextReqId=k(1),this._connected=!1,this._linked=!1,this.shouldFetchUnseenEventsOnConnect=!1,this.requestResolutions=new Map,this.handleSessionMetadataUpdated=e=>{e&&new Map([["__destroyed",this.handleDestroyed],["EthereumAddress",this.handleAccountUpdated],["WalletUsername",this.handleWalletUsernameUpdated],["AppVersion",this.handleAppVersionUpdated],["ChainId",t=>
1e.JsonRpcUrl&&this.handleChainUpdated(t,e.JsonRpcUrl)]]).forEach((t,n)=>{let r=e[n];void 0!==r&&t(r)})},this.handleDestroyed=e=>{var t;"1"===e&&(null===(t=this.listener)||void 0===t||t.resetAndReload())},this.handleAccountUpdated=async e=>{var t;let n=await this.cipher.decrypt(e);null===(t=this.listener)||void 0===t||t.accountUpdated(n)},this.handleMetadataUpdated=async(e,t)=>{var n;let r=await this.cipher.decrypt(t);null===(n=this.listener)||void 0===n||n.metadataUpdated(e,r)},this.handleWalletUsernameUpdated=async e=>{this.handleMetadataUpdated("walletUsername",e)},this.handleAppVersionUpdated=async e=>{this.handleMetadataUpdated("AppVersion",e)},this.handleChainUpdated=async(e,t)=>{var n;let r=await this.cipher.decrypt(e),s=await this.cipher.decrypt(t);null===(n=this.listener)||void 0===n||n.chainUpdated(r,s)},this.session=e,this.cipher=new ep(e.secret),this.listener=n;let r=new eg(`${t}/rpc`,WebSocket);r.setConnectionStateListener(async e=>{let t=!1;switch(e){case eM.DISCONNECTED:if(!this.destroyed){let e=async()=>{await new Promise(e=>setTimeout(e,5e3)),this.destroyed||r.connect().catch(()=>{e()})};e()}break;case eM.CONNECTED:t=await this.handleConnected(),this.updateLastHeartbeat(),setInterval(()=>{this.heartbeat()},1e4),this.shouldFetchUnseenEventsOnConnect&&this.fetchUnseenEventsAPI();case eM.CONNECTING:}this.connected!==t&&(this.connected=t)}),r.setIncomingDataListener(e=>{var t;switch(e.type){case"Heartbeat":this.updateLastHeartbeat();return;case"IsLinkedOK":case"Linked":{let t="IsLinkedOK"===e.type?e.linked:void 0;this.linked=t||e.onlineGuests>0;break}case"GetSessionConfigOK":case"SessionConfigUpdated":this.handleSessionMetadataUpdated(e.metadata);break;case"Event":this.handleIncomingEvent(e)}void 0!==e.id&&(null===(t=this.requestResolutions.get(e.id))||void 0===t||t(e))}),this.ws=r,this.http=new ef(t,e.id,e.key)}connect(){if(this.destroyed)throw Error("instance is destroyed");this.ws.connect()}async destroy(){this.destroyed||(await this.makeRequest({type:"SetSessionConfig",id:k(this.nextReqId++),sessionId:this.session.id,metadata:{__destroyed:"1"}},{timeout:1e3}),this.destroyed=!0,this.ws.disconnect(),this.listener=void 0)}get connected(){return this._connected}set connected(e){this._connected=e}get linked(){return this._linked}set linked(e){var t,n;this._linked=e,e&&(null===(t=this.onceLinked)||void 0===t||t.call(this)),null===(n=this.listener)||void 0===n||n.linkedUpdated(e)}setOnceLinked(e){return new Promise(t=>{this.linked?e().then(t):this.onceLinked=()=>{e().then(t),this.onceLinked=void 0}})}async handleIncomingEvent(e){var t;if("Event"!==e.type||"Web3Response"!==e.event)return;let n=JSON.parse(await this.cipher.decrypt(e.data));if("WEB3_RESPONSE"!==n.type)return;let{id:r,response:s}=n;null===(t=this.listener)||void 0===t||t.handleWeb3ResponseMessage(r,s)}async checkUnseenEvents(){if(!this.connected){this.shouldFetchUnseenEventsOnConnect=!0;return}await new Promise(e=>setTimeout(e,250));try{await this.fetchUnseenEventsAPI()}catch(e){console.error("Unable to check for unseen events",e)}}async fetchUnseenEventsAPI(){this.shouldFetchUnseenEventsOnConnect=!1,(await this.http.fetchUnseenEvents()).forEach(e=>this.handleIncomingEvent(e))}async publishEvent(e,t,n=!1){let r=await this.cipher.encrypt(JSON.stringify(Object.assign(Object.assign({},t),{origin:location.origin,location:location.href,relaySource:"coinbaseWalletExtension"in window&&window.coinbaseWalletExtension?"injected_sdk":"sdk"}))),s={type:"PublishEvent",id:k(this.nextReqId++),sessionId:this.session.id,event:e,data:r,callWebhook:n};return this.setOnceLinked(async()=>{let e=await this.makeRequest(s);if("Fail"===e.type)throw Error(e.error||"failed to publish event");return e.eventId})}sendData(e){this.ws.sendData(JSON.stringify(e))}updateLastHeartbeat(){this.lastHeartbeatResponse=Date.now()}heartbeat(){if(Date.now()-this.lastHeartbeatResponse>2e4){this.ws.disconnect();return}try{this.ws.sendData("h")}catch(e){}}async makeRequest(e,t={timeout:6e4}){let n;let r=e.id;return this.sendData(e),Promise.race([new Promise((e,s)=>{n=window.setTimeout(()=>{s(Error(`request ${r} timed out`))},t.timeout)}),new Promise(e=>{this.requestResolutions.set(r,t=>{clearTimeout(n),e(t),this.requestResolutions.delete(r)})})])}
1async handleConnected(){return"Fail"!==(await this.makeRequest({type:"HostSession",id:k(this.nextReqId++),sessionId:this.session.id,sessionKey:this.session.key})).type&&(this.sendData({type:"IsLinked",id:k(this.nextReqId++),sessionId:this.session.id}),this.sendData({type:"GetSessionConfig",id:k(this.nextReqId++),sessionId:this.session.id}),!0)}}class ey{constructor(){this._nextRequestId=0,this.callbacks=new Map}makeRequestId(){this._nextRequestId=(this._nextRequestId+1)%2147483647;let e=this._nextRequestId,t=T(e.toString(16));return this.callbacks.get(t)&&this.callbacks.delete(t),e}}var e_=n(65530),eb=n(68104);let ew="session:id",ev="session:secret",ek="session:linked";class eC{constructor(e,t,n,r=!1){this.storage=e,this.id=t,this.secret=n,this.key=(0,eb.ci)((0,e_.JQ)(`${t}, ${n} WalletLink`)),this._linked=!!r}static create(e){return new eC(e,x(16),x(32)).save()}static load(e){let t=e.getItem(ew),n=e.getItem(ek),r=e.getItem(ev);return t&&r?new eC(e,t,r,"1"===n):null}get linked(){return this._linked}set linked(e){this._linked=e,this.persistLinked()}save(){return this.storage.setItem(ew,this.id),this.storage.setItem(ev,this.secret),this.persistLinked(),this}persistLinked(){this.storage.setItem(ek,this._linked?"1":"0")}}function eE(){var e,t;return null!==(t=null===(e=null==window?void 0:window.matchMedia)||void 0===e?void 0:e.call(window,"(prefers-color-scheme: dark)").matches)&&void 0!==t&&t}function eI(){let e=document.createElement("style");e.type="text/css",e.appendChild(document.createTextNode('@namespace svg "http://www.w3.org/2000/svg";.-cbwsdk-css-reset,.-cbwsdk-css-reset *{animation:none;animation-delay:0;animation-direction:normal;animation-duration:0;animation-fill-mode:none;animation-iteration-count:1;animation-name:none;animation-play-state:running;animation-timing-function:ease;backface-visibility:visible;background:0;background-attachment:scroll;background-clip:border-box;background-color:rgba(0,0,0,0);background-image:none;background-origin:padding-box;background-position:0 0;background-position-x:0;background-position-y:0;background-repeat:repeat;background-size:auto auto;border:0;border-style:none;border-width:medium;border-color:inherit;border-bottom:0;border-bottom-color:inherit;border-bottom-left-radius:0;border-bottom-right-radius:0;border-bottom-style:none;border-bottom-width:medium;border-collapse:separate;border-image:none;border-left:0;border-left-color:inherit;border-left-style:none;border-left-width:medium;border-radius:0;border-right:0;border-right-color:inherit;border-right-style:none;border-right-width:medium;border-spacing:0;border-top:0;border-top-color:inherit;border-top-left-radius:0;border-top-right-radius:0;border-top-style:none;border-top-width:medium;box-shadow:none;box-sizing:border-box;caption-side:top;clear:none;clip:auto;color:inherit;columns:auto;column-count:auto;column-fill:balance;column-gap:normal;column-rule:medium none currentColor;column-rule-color:currentColor;column-rule-style:none;column-rule-width:none;column-span:1;column-width:auto;counter-increment:none;counter-reset:none;direction:ltr;empty-cells:show;float:none;font:normal;font-family:-apple-system,BlinkMacSystemFont,"Segoe UI","Helvetica Neue",Arial,sans-serif;font-size:medium;font-style:normal;font-variant:normal;font-weight:normal;height:auto;hyphens:none;letter-spacing:normal;line-height:normal;list-style:none;list-style-image:none;list-style-position:outside;list-style-type:disc;margin:0;margin-bottom:0;margin-left:0;margin-right:0;margin-top:0;opacity:1;orphans:0;outline:0;outline-color:invert;outline-style:none;outline-width:medium;overflow:visible;overflow-x:visible;overflow-y:visible;padding:0;padding-bottom:0;padding-left:0;padding-right:0;padding-top:0;page-break-after:auto;page-break-before:auto;page-break-inside:auto;perspective:none;perspective-origin:50% 50%;pointer-events:auto;position:static;quotes:"\\201C" "\\201D" "\\2018" "\\2019";tab-size:8;table-layout:auto;text-align:inherit;text-align-last:auto;text-decoration:none;text-decoration-color:inherit;text-decoration-line:none;text-decoration-style:solid;text-indent:0;text-shadow:none;text-transform:none;transform:none;transform-style:flat;transition:none;transition-delay:0s;transition-duration:0s;transition-property:none;transition-timing-function:ease;unicode-bidi:normal;vertical-align:baseline;visibility:visible;white-space:normal;widows:0;word-spacing:normal;z-index:auto}.-cbwsdk-css-reset strong{font-weight:bold}.-cbwsdk-css-reset *{box-sizing:border-box;font-family:-apple-system,BlinkMacSystemFont,"Segoe UI","Helvetica Neue",Arial,sans-serif;line-height:1}.-cbwsdk-css-reset [class*=container]{margin:0;padding:0}.-cbwsdk-css-reset style{display:none}')),document.documentElement.appendChild(e)}function ex(){for(var e,t,n=0,r="";n<arguments.length;)(e=arguments[n++])&&(t=function e(t){var n,r,s="";if("string"==typeof t||"number"==typeof t)s+=t;else if("object"==typeof t){if(Array.isArray(t))for(n=0;n<t.length;n++)t[n]&&(r=e(t[n]))&&(s&&(s+=" "),s+=r);else for(n in t)t[n]&&(s&&(s+=" "),s+=n)}return s}(e))&&(r&&(r+=" "),r+=t);return r}var eS,eM,eL,eA,eP,eD,eN,eR,eT,eO,ej,eU,eH,eW={},eq=[],eB=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,eV=Array.isArray;function eZ(e,t){for(var n in t)e[n]=t[n];return e}function ez(e){e&&e.parentNode&&e.parentNode.removeChild(e)}
vendor: 4,830 bytes, line 1
1function eK(e,t,n){var r,s,i,a={};for(i in t)"key"==i?r=t[i]:"ref"==i?s=t[i]:a[i]=t[i];if(arguments.length>2&&(a.children=arguments.length>3?eL.call(arguments,2):n),"function"==typeof e&&null!=e.defaultProps)for(i in e.defaultProps)null==a[i]&&(a[i]=e.defaultProps[i]);return eF(e,a,r,s,null)}function eF(e,t,n,r,s){var i={type:e,props:t,key:n,ref:r,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:null==s?++eP:s,__i:-1,__u:0};return null==s&&null!=eA.vnode&&eA.vnode(i),i}function e$(e){return e.children}function eG(e,t){this.props=e,this.context=t}function eJ(e,t){if(null==t)return e.__?eJ(e.__,e.__i+1):null;for(var n;t<e.__k.length;t++)if(null!=(n=e.__k[t])&&null!=n.__e)return n.__e;return"function"==typeof e.type?eJ(e):null}function eY(e){(!e.__d&&(e.__d=!0)&&eD.push(e)&&!eQ.__r++||eN!=eA.debounceRendering)&&((eN=eA.debounceRendering)||eR)(eQ)}function eQ(){for(var e,t,n,r,s,i,a=1;eD.length;)eD.length>a&&eD.sort(eT),e=eD.shift(),a=eD.length,e.__d&&(t=void 0,r=(n=e.__v).__e,s=[],i=[],e.__P&&((t=eZ({},n)).__v=n.__v+1,eA.vnode&&eA.vnode(t),e3(e.__P,t,n,e.__n,e.__P.namespaceURI,32&n.__u?[r]:null,s,null==r?eJ(n):r,!!(32&n.__u),i),t.__v=n.__v,t.__.__k[t.__i]=t,e5(s,t,i),t.__e!=r&&function e(t){var n,r;if(null!=(t=t.__)&&null!=t.__c){for(t.__e=t.__c.base=null,n=0;n<t.__k.length;n++)if(null!=(r=t.__k[n])&&null!=r.__e){t.__e=t.__c.base=r.__e;break}return e(t)}}(t)));eQ.__r=0}function eX(e,t,n,r,s,i,a,o,l,c,h){var d,u,p,f,g,m,y=r&&r.__k||eq,_=t.length;for(l=function(e,t,n,r,s){var i,a,o,l,c,h=n.length,d=h,u=0;for(e.__k=Array(s),i=0;i<s;i++)null!=(a=t[i])&&"boolean"!=typeof a&&"function"!=typeof a?(l=i+u,(a=e.__k[i]="string"==typeof a||"number"==typeof a||"bigint"==typeof a||a.constructor==String?eF(null,a,null,null,null):eV(a)?eF(e$,{children:a},null,null,null):null==a.constructor&&a.__b>0?eF(a.type,a.props,a.key,a.ref?a.ref:null,a.__v):a).__=e,a.__b=e.__b+1,o=null,-1!=(c=a.__i=function(e,t,n,r){var s,i,a=e.key,o=e.type,l=t[n];if(null===l&&null==e.key||l&&a==l.key&&o==l.type&&0==(2&l.__u))return n;if(r>(null!=l&&0==(2&l.__u)?1:0))for(s=n-1,i=n+1;s>=0||i<t.length;){if(s>=0){if((l=t[s])&&0==(2&l.__u)&&a==l.key&&o==l.type)return s;s--}if(i<t.length){if((l=t[i])&&0==(2&l.__u)&&a==l.key&&o==l.type)return i;i++}}return -1}(a,n,l,d))&&(d--,(o=n[c])&&(o.__u|=2)),null==o||null==o.__v?(-1==c&&(s>h?u--:s<h&&u++),"function"!=typeof a.type&&(a.__u|=4)):c!=l&&(c==l-1?u--:c==l+1?u++:(c>l?u--:u++,a.__u|=4))):e.__k[i]=null;if(d)for(i=0;i<h;i++)null!=(o=n[i])&&0==(2&o.__u)&&(o.__e==r&&(r=eJ(o)),function e(t,n,r){var s,i;if(eA.unmount&&eA.unmount(t),(s=t.ref)&&(s.current&&s.current!=t.__e||e4(s,null,n)),null!=(s=t.__c)){if(s.componentWillUnmount)try{s.componentWillUnmount()}catch(e){eA.__e(e,n)}s.base=s.__P=null}if(s=t.__k)for(i=0;i<s.length;i++)s[i]&&e(s[i],n,r||"function"!=typeof t.type);r||ez(t.__e),t.__c=t.__=t.__e=void 0}(o,o));return r}(n,t,y,l,_),d=0;d<_;d++)null!=(p=n.__k[d])&&(u=-1==p.__i?eW:y[p.__i]||eW,p.__i=d,m=e3(e,p,u,s,i,a,o,l,c,h),f=p.__e,p.ref&&u.ref!=p.ref&&(u.ref&&e4(u.ref,null,p),h.push(p.ref,p.__c||f,p)),null==g&&null!=f&&(g=f),4&p.__u||u.__k===p.__k?l=function e(t,n,r){var s,i;if("function"==typeof t.type){for(s=t.__k,i=0;s&&i<s.length;i++)s[i]&&(s[i].__=t,n=e(s[i],n,r));return n}t.__e!=n&&(n&&t.type&&!r.contains(n)&&(n=eJ(t)),r.insertBefore(t.__e,n||null),n=t.__e);do n=n&&n.nextSibling;while(null!=n&&8==n.nodeType);return n}(p,l,e):"function"==typeof p.type&&void 0!==m?l=m:f&&(l=f.nextSibling),p.__u&=-7);return n.__e=g,l}function e0(e,t,n){"-"==t[0]?e.setProperty(t,null==n?"":n):e[t]=null==n?"":"number"!=typeof n||eB.test(t)?n:n+"px"}function e1(e,t,n,r,s){var i;e:if("style"==t){if("string"==typeof n)e.style.cssText=n;else{if("string"==typeof r&&(e.style.cssText=r=""),r)for(t in r)n&&t in n||e0(e.style,t,"");if(n)for(t in n)r&&n[t]==r[t]||e0(e.style,t,n[t])}}else if("o"==t[0]&&"n"==t[1])i=t!=(t=t.replace(eO,"$1")),t=t.toLowerCase() in e||"onFocusOut"==t||"onFocusIn"==t?t.toLowerCase().slice(2):t.slice(2),e.l||(e.l={}),e.l[t+i]=n,n?r?n.u=r.u:(n.u=ej,e.addEventListener(t,i?eH:eU,i)):e.removeEventListener(t,i?eH:eU,i);else{if("http://www.w3.org/2000/svg"==s)t=t.replace(/xlink(H|:h)/,"h").replace(/sName$/,"s");else if("width"!=t&&"height"!=t&&"href"!=t&&"list"!=t&&"form"!=t&&"tabIndex"!=t&&"download"!=t&&"rowSpan"!=t&&"colSpan"!=t&&"role"!=t&&"popover"!=t&&t in e)try{e[t]=null==n?"":n;break e}catch(e){}"function"==typeof n||(null==n||!1===n&&"-"!=t[4]?e.removeAttribute(t):e.setAttribute(t,"popover"==t&&1==n?"":n))}}function e2(e){return function(t){if(this.l){var n=this.l[t.type+e];if(null==t.t)t.t=ej++;else if(t.t<n.u)return;return n(eA.event?eA.event(t):t)}}}function e3(e,t,n,r,s,i,a,o,l,c){var h,d,u,p,f,g,m,y,_,b,w,v,k,C,E,I,x,S=t.type;if(null!=t.constructor)return null;128&n.__u&&(l=!!(32&n.__u),i=[o=t.__e=n.__e]),(h=eA.__b)&&h(t);
vendor: 5,168 bytes, line 1
1e:if("function"==typeof S)try{if(y=t.props,_="prototype"in S&&S.prototype.render,b=(h=S.contextType)&&r[h.__c],w=h?b?b.props.value:h.__:r,n.__c?m=(d=t.__c=n.__c).__=d.__E:(_?t.__c=d=new S(y,w):(t.__c=d=new eG(y,w),d.constructor=S,d.render=e8),b&&b.sub(d),d.props=y,d.state||(d.state={}),d.context=w,d.__n=r,u=d.__d=!0,d.__h=[],d._sb=[]),_&&null==d.__s&&(d.__s=d.state),_&&null!=S.getDerivedStateFromProps&&(d.__s==d.state&&(d.__s=eZ({},d.__s)),eZ(d.__s,S.getDerivedStateFromProps(y,d.__s))),p=d.props,f=d.state,d.__v=t,u)_&&null==S.getDerivedStateFromProps&&null!=d.componentWillMount&&d.componentWillMount(),_&&null!=d.componentDidMount&&d.__h.push(d.componentDidMount);else{if(_&&null==S.getDerivedStateFromProps&&y!==p&&null!=d.componentWillReceiveProps&&d.componentWillReceiveProps(y,w),!d.__e&&null!=d.shouldComponentUpdate&&!1===d.shouldComponentUpdate(y,d.__s,w)||t.__v==n.__v){for(t.__v!=n.__v&&(d.props=y,d.state=d.__s,d.__d=!1),t.__e=n.__e,t.__k=n.__k,t.__k.some(function(e){e&&(e.__=t)}),v=0;v<d._sb.length;v++)d.__h.push(d._sb[v]);d._sb=[],d.__h.length&&a.push(d);break e}null!=d.componentWillUpdate&&d.componentWillUpdate(y,d.__s,w),_&&null!=d.componentDidUpdate&&d.__h.push(function(){d.componentDidUpdate(p,f,g)})}if(d.context=w,d.props=y,d.__P=e,d.__e=!1,k=eA.__r,C=0,_){for(d.state=d.__s,d.__d=!1,k&&k(t),h=d.render(d.props,d.state,d.context),E=0;E<d._sb.length;E++)d.__h.push(d._sb[E]);d._sb=[]}else do d.__d=!1,k&&k(t),h=d.render(d.props,d.state,d.context),d.state=d.__s;while(d.__d&&++C<25);d.state=d.__s,null!=d.getChildContext&&(r=eZ(eZ({},r),d.getChildContext())),_&&!u&&null!=d.getSnapshotBeforeUpdate&&(g=d.getSnapshotBeforeUpdate(p,f)),I=h,null!=h&&h.type===e$&&null==h.key&&(I=function e(t){return"object"!=typeof t||null==t||t.__b&&t.__b>0?t:eV(t)?t.map(e):eZ({},t)}(h.props.children)),o=eX(e,eV(I)?I:[I],t,n,r,s,i,a,o,l,c),d.base=t.__e,t.__u&=-161,d.__h.length&&a.push(d),m&&(d.__E=d.__=null)}catch(e){if(t.__v=null,l||null!=i){if(e.then){for(t.__u|=l?160:128;o&&8==o.nodeType&&o.nextSibling;)o=o.nextSibling;i[i.indexOf(o)]=null,t.__e=o}else for(x=i.length;x--;)ez(i[x])}else t.__e=n.__e,t.__k=n.__k;eA.__e(e,t,n)}else null==i&&t.__v==n.__v?(t.__k=n.__k,t.__e=n.__e):o=t.__e=function(e,t,n,r,s,i,a,o,l){var c,h,d,u,p,f,g,m=n.props,y=t.props,_=t.type;if("svg"==_?s="http://www.w3.org/2000/svg":"math"==_?s="http://www.w3.org/1998/Math/MathML":s||(s="http://www.w3.org/1999/xhtml"),null!=i){for(c=0;c<i.length;c++)if((p=i[c])&&"setAttribute"in p==!!_&&(_?p.localName==_:3==p.nodeType)){e=p,i[c]=null;break}}if(null==e){if(null==_)return document.createTextNode(y);e=document.createElementNS(s,_,y.is&&y),o&&(eA.__m&&eA.__m(t,i),o=!1),i=null}if(null==_)m===y||o&&e.data==y||(e.data=y);else{if(i=i&&eL.call(e.childNodes),m=n.props||eW,!o&&null!=i)for(m={},c=0;c<e.attributes.length;c++)m[(p=e.attributes[c]).name]=p.value;for(c in m)if(p=m[c],"children"==c);else if("dangerouslySetInnerHTML"==c)d=p;else if(!(c in y)){if("value"==c&&"defaultValue"in y||"checked"==c&&"defaultChecked"in y)continue;e1(e,c,null,p,s)}for(c in y)p=y[c],"children"==c?u=p:"dangerouslySetInnerHTML"==c?h=p:"value"==c?f=p:"checked"==c?g=p:o&&"function"!=typeof p||m[c]===p||e1(e,c,p,m[c],s);if(h)o||d&&(h.__html==d.__html||h.__html==e.innerHTML)||(e.innerHTML=h.__html),t.__k=[];else if(d&&(e.innerHTML=""),eX("template"==t.type?e.content:e,eV(u)?u:[u],t,n,r,"foreignObject"==_?"http://www.w3.org/1999/xhtml":s,i,a,i?i[0]:n.__k&&eJ(n,0),o,l),null!=i)for(c=i.length;c--;)ez(i[c]);o||(c="value","progress"==_&&null==f?e.removeAttribute("value"):null==f||f===e[c]&&("progress"!=_||f)&&("option"!=_||f==m[c])||e1(e,c,f,m[c],s),c="checked",null!=g&&g!=e[c]&&e1(e,c,g,m[c],s))}return e}(n.__e,t,n,r,s,i,a,l,c);return(h=eA.diffed)&&h(t),128&t.__u?void 0:o}function e5(e,t,n){for(var r=0;r<n.length;r++)e4(n[r],n[++r],n[++r]);eA.__c&&eA.__c(t,e),e.some(function(t){try{e=t.__h,t.__h=[],e.some(function(e){e.call(t)})}catch(e){eA.__e(e,t.__v)}})}function e4(e,t,n){try{if("function"==typeof e){var r="function"==typeof e.__u;r&&e.__u(),r&&null==t||(e.__u=e(t))}else e.current=t}catch(e){eA.__e(e,n)}}function e8(e,t,n){return this.constructor(e,n)}function e6(e,t,n){var r,s,i,a;t==document&&(t=document.documentElement),eA.__&&eA.__(e,t),s=(r="function"==typeof n)?null:n&&n.__k||t.__k,i=[],a=[],e3(t,e=(!r&&n||t).__k=eK(e$,null,[e]),s||eW,eW,t.namespaceURI,!r&&n?[n]:s?null:t.firstChild?eL.call(t.childNodes):null,i,!r&&n?n:s?s.__e:t.firstChild,r,a),e5(i,e,a)}eL=eq.slice,eA={__e:function(e,t,n,r){for(var s,i,a;t=t.__;)if((s=t.__c)&&!s.__)try{if((i=s.constructor)&&null!=i.getDerivedStateFromError&&(s.setState(i.getDerivedStateFromError(e)),a=s.__d),null!=s.componentDidCatch&&(s.componentDidCatch(e,r||{}),a=s.__d),a)return s.__E=s}catch(t){e=t}throw e}},eP=0,eG.prototype.setState=function(e,t){var n;n=null!=this.__s&&this.__s!=this.state?this.__s:this.__s=eZ({},this.state),"function"==typeof e&&(e=e(eZ({},n),this.props)),e&&eZ(n,e),null!=e&&this.__v&&(t&&this._sb.push(t),eY(this))},eG.prototype.forceUpdate=function(e){this.__v&&(this.__e=!0,e&&this.__h.push(e),eY(this))},eG.prototype.render=e$,eD=[],eR="function"==typeof Promise?Promise.prototype.then.bind(Prom
vendor: 4,201 bytes, line 1
1ise.resolve()):setTimeout,eT=function(e,t){return e.__v.__b-t.__v.__b},eQ.__r=0,eO=/(PointerCapture)$|Capture$/i,ej=0,eU=e2(!1),eH=e2(!0);var e7,e9,te,tt,tn=0,tr=[],ts=eA,ti=ts.__b,ta=ts.__r,to=ts.diffed,tl=ts.__c,tc=ts.unmount,th=ts.__;function td(e,t){ts.__h&&ts.__h(e9,e,tn||t),tn=0;var n=e9.__H||(e9.__H={__:[],__h:[]});return e>=n.__.length&&n.__.push({}),n.__[e]}function tu(e,t,n){var r=td(e7++,2);if(r.t=e,!r.__c&&(r.__=[n?n(t):ty(void 0,t),function(e){var t=r.__N?r.__N[0]:r.__[0],n=r.t(t,e);t!==n&&(r.__N=[n,r.__[1]],r.__c.setState({}))}],r.__c=e9,!e9.__f)){var s=function(e,t,n){if(!r.__c.__H)return!0;var s=r.__c.__H.__.filter(function(e){return!!e.__c});if(s.every(function(e){return!e.__N}))return!i||i.call(this,e,t,n);var a=r.__c.props!==e;return s.forEach(function(e){if(e.__N){var t=e.__[0];e.__=e.__N,e.__N=void 0,t!==e.__[0]&&(a=!0)}}),i&&i.call(this,e,t,n)||a};e9.__f=!0;var i=e9.shouldComponentUpdate,a=e9.componentWillUpdate;e9.componentWillUpdate=function(e,t,n){if(this.__e){var r=i;i=void 0,s(e,t,n),i=r}a&&a.call(this,e,t,n)},e9.shouldComponentUpdate=s}return r.__N||r.__}function tp(){for(var e;e=tr.shift();)if(e.__P&&e.__H)try{e.__H.__h.forEach(tg),e.__H.__h.forEach(tm),e.__H.__h=[]}catch(t){e.__H.__h=[],ts.__e(t,e.__v)}}ts.__b=function(e){e9=null,ti&&ti(e)},ts.__=function(e,t){e&&t.__k&&t.__k.__m&&(e.__m=t.__k.__m),th&&th(e,t)},ts.__r=function(e){ta&&ta(e),e7=0;var t=(e9=e.__c).__H;t&&(te===e9?(t.__h=[],e9.__h=[],t.__.forEach(function(e){e.__N&&(e.__=e.__N),e.u=e.__N=void 0})):(t.__h.forEach(tg),t.__h.forEach(tm),t.__h=[],e7=0)),te=e9},ts.diffed=function(e){to&&to(e);var t=e.__c;t&&t.__H&&(t.__H.__h.length&&(1!==tr.push(t)&&tt===ts.requestAnimationFrame||((tt=ts.requestAnimationFrame)||function(e){var t,n=function(){clearTimeout(r),tf&&cancelAnimationFrame(t),setTimeout(e)},r=setTimeout(n,100);tf&&(t=requestAnimationFrame(n))})(tp)),t.__H.__.forEach(function(e){e.u&&(e.__H=e.u),e.u=void 0})),te=e9=null},ts.__c=function(e,t){t.some(function(e){try{e.__h.forEach(tg),e.__h=e.__h.filter(function(e){return!e.__||tm(e)})}catch(n){t.some(function(e){e.__h&&(e.__h=[])}),t=[],ts.__e(n,e.__v)}}),tl&&tl(e,t)},ts.unmount=function(e){tc&&tc(e);var t,n=e.__c;n&&n.__H&&(n.__H.__.forEach(function(e){try{tg(e)}catch(e){t=e}}),n.__H=void 0,t&&ts.__e(t,n.__v))};var tf="function"==typeof requestAnimationFrame;function tg(e){var t=e9,n=e.__c;"function"==typeof n&&(e.__c=void 0,n()),e9=t}function tm(e){var t=e9;e.__c=e.__(),e9=t}function ty(e,t){return"function"==typeof t?t(e):t}class t_{constructor(){this.items=new Map,this.nextItemKey=0,this.root=null,this.darkMode=eE()}attach(e){this.root=document.createElement("div"),this.root.className="-cbwsdk-snackbar-root",e.appendChild(this.root),this.render()}presentItem(e){let t=this.nextItemKey++;return this.items.set(t,e),this.render(),()=>{this.items.delete(t),this.render()}}clear(){this.items.clear(),this.render()}render(){this.root&&e6(eK("div",null,eK(tb,{darkMode:this.darkMode},Array.from(this.items.entries()).map(([e,t])=>eK(tw,Object.assign({},t,{key:e}))))),this.root)}}let tb=e=>eK("div",{class:ex("-cbwsdk-snackbar-container")},eK("style",null,".-cbwsdk-css-reset .-gear-container{margin-left:16px !important;margin-right:9px !important;display:flex;align-items:center;justify-content:center;width:24px;height:24px;transition:opacity .25s}.-cbwsdk-css-reset .-gear-container *{user-select:none}.-cbwsdk-css-reset .-gear-container svg{opacity:0;position:absolute}.-cbwsdk-css-reset .-gear-icon{height:12px;width:12px;z-index:10000}.-cbwsdk-css-reset .-cbwsdk-snackbar{align-items:flex-end;display:flex;flex-direction:column;position:fixed;right:0;top:0;z-index:2147483647}.-cbwsdk-css-reset .-cbwsdk-snackbar *{user-select:none}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance{display:flex;flex-direction:column;margin:8px 16px 0 16px;overflow:visible;text-align:left;transform:translateX(0);transition:opacity .25s,transform .25s}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-header:hover .-gear-container svg{opacity:1}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-header{display:flex;align-items:center;background:#fff;overflow:hidden;border:1px solid #e7ebee;box-sizing:border-box;border-radius:8px;
1cursor:pointer}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-header-cblogo{margin:8px 8px 8px 8px}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-header *{cursor:pointer}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-header-message{color:#000;font-size:13px;line-height:1.5;user-select:none}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-menu{background:#fff;transition:opacity .25s ease-in-out,transform .25s linear,visibility 0s;visibility:hidden;border:1px solid #e7ebee;box-sizing:border-box;border-radius:8px;opacity:0;flex-direction:column;padding-left:8px;padding-right:8px}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-menu-item:last-child{margin-bottom:8px !important}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-menu-item:hover{background:#f5f7f8;border-radius:6px;transition:background .25s}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-menu-item:hover span{color:#050f19;transition:color .25s}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-menu-item:hover svg path{fill:#000;transition:fill .25s}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-menu-item{visibility:inherit;height:35px;margin-top:8px;margin-bottom:0;display:flex;flex-direction:row;align-items:center;padding:8px;cursor:pointer}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-menu-item *{visibility:inherit;cursor:pointer}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-menu-item-is-red:hover{background:rgba(223,95,103,.2);transition:background .25s}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-menu-item-is-red:hover *{cursor:pointer}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-menu-item-is-red:hover svg path{fill:#df5f67;transition:fill .25s}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-menu-item-is-red:hover span{color:#df5f67;transition:color .25s}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-menu-item-info{color:#aaa;font-size:13px;margin:0 8px 0 32px;position:absolute}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-hidden{opacity:0;text-align:left;transform:translateX(25%);transition:opacity .5s linear}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-expanded .-cbwsdk-snackbar-instance-menu{opacity:1;display:flex;transform:translateY(8px);visibility:visible}"),eK("div",{class:"-cbwsdk-snackbar"},e.children)),tw=({autoExpand:e,message:t,menuItems:n})=>{var r,s,i,a,o;let[l,c]=(tn=1,tu(ty,!0)),[h,d]=(tn=1,tu(ty,null!=e&&e));return r=()=>{let e=[window.setTimeout(()=>{c(!1)},1),window.setTimeout(()=>{d(!0)},1e4)];return()=>{e.forEach(window.clearTimeout)}},i=td(e7++,3),!ts.__s&&(a=i.__H,o=void 0,!a||a.length!==o.length||o.some(function(e,t){return e!==a[t]}))&&(i.__=r,i.u=s,e9.__H.__h.push(i)),eK("div",{class:ex("-cbwsdk-snackbar-instance",l&&"-cbwsdk-snackbar-instance-hidden",h&&"-cbwsdk-snackbar-instance-expanded")},eK("div",{class:"-cbwsdk-snackbar-instance-header",onClick:()=>{d(!h)}},eK("img",{src:"data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMzIiIGhlaWdodD0iMzIiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHBhdGggZD0iTTEuNDkyIDEwLjQxOWE4LjkzIDguOTMgMCAwMTguOTMtOC45M2gxMS4xNjNhOC45MyA4LjkzIDAgMDE4LjkzIDguOTN2MTEuMTYzYTguOTMgOC45MyAwIDAxLTguOTMgOC45M0gxMC40MjJhOC45MyA4LjkzIDAgMDEtOC45My04LjkzVjEwLjQxOXoiIGZpbGw9IiMxNjUyRjAiLz48cGF0aCBmaWxsLXJ1bGU9ImV2ZW5vZGQiIGNsaXAtcnVsZT0iZXZlbm9kZCIgZD0iTTEwLjQxOSAwSDIxLjU4QzI3LjMzNSAwIDMyIDQuNjY1IDMyIDEwLjQxOVYyMS41OEMzMiAyNy4zMzUgMjcuMzM1IDMyIDIxLjU4MSAzMkgxMC40MkM0LjY2NSAzMiAwIDI3LjMzNSAwIDIxLjU4MVYxMC40MkMwIDQuNjY1IDQuNjY1IDAgMTAuNDE5IDB6bTAgMS40ODhhOC45MyA4LjkzIDAgMDAtOC45MyA4LjkzdjExLjE2M2E4LjkzIDguOTMgMCAwMDguOTMgOC45M0gyMS41OGE4LjkzIDguOTMgMCAwMDguOTMtOC45M1YxMC40MmE4LjkzIDguOTMgMCAwMC04LjkzLTguOTNIMTAuNDJ6IiBmaWxsPSIjZmZmIi8+PHBhdGggZmlsbC1ydWxlPSJldmVub2RkIiBjbGlwLXJ1bGU9ImV2ZW5vZGQiIGQ9Ik0xNS45OTggMjYuMDQ5Yy01LjU0OSAwLTEwLjA0Ny00LjQ5OC0xMC4wNDctMTAuMDQ3IDAtNS41NDggNC40OTgtMTAuMDQ2IDEwLjA0Ny0xMC4wNDYgNS41NDggMCAxMC4wNDYgNC40OTggMTAuMDQ2IDEwLjA0NiAwIDUuNTQ5LTQuNDk4IDEwLjA0Ny0xMC4wNDYgMTAuMDQ3eiIgZmlsbD0iI2ZmZiIvPjxwYXRoIGQ9Ik0xMi43NjIgMTQuMjU0YzAtLjgyMi42NjctMS40ODkgMS40ODktMS40ODloMy40OTdjLjgyMiAwIDEuNDg4LjY2NiAxLjQ4OCAxLjQ4OXYzLjQ5N2MwIC44MjItLjY2NiAxLjQ4OC0xLjQ4OCAxLjQ4OGgtMy40OTdhMS40ODggMS40ODggMCAwMS0xLjQ4OS0xLjQ4OHYtMy40OTh6IiBmaWxsPSIjMTY1MkYwIi8+PC9zdmc+",class:"-cbwsdk-snackbar-instance-header-cblogo"})," ",eK("div",{class:"-cbwsdk-snackbar-instance-header-message"},t),eK("div",{class:"-gear-container"},!h&&eK("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},eK("circle",{cx:"12",cy:"12",r:"12",fill:"#F5F7F8"})),eK("img",{src:"data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTIiIGhlaWdodD0iMTIiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHBhdGggZD0iTTEyIDYuNzV2LTEuNWwtMS43Mi0uNTdjLS4wOC0uMjctLjE5LS41Mi0uMzItLjc3bC44MS0xLjYyLTEuMDYtMS4wNi0xLjYyLjgxYy0uMjQtLjEzLS41LS4yNC0uNzctLjMyTDYuNzUgMGgtMS41bC0uNTcgMS43MmMtLjI3LjA4LS41My4xOS0uNzcuMzJsLTEuNjItLjgxLTEuMDYgMS4wNi44MSAxLjYyYy0uMTMuMjQtLjI0LjUtLjMyLjc3TDAgNS4yNXYxLjVsMS43Mi41N2MuMDguMjcuMTkuNTMuMzIuNzdsLS44MSAxLjYyIDEuMDYgMS4wNiAxLjYyLS44MWMuMjQuMTMuNS4yMy43Ny4zMkw1LjI1IDEyaDEuNWwu
1NTctMS43MmMuMjctLjA4LjUyLS4xOS43Ny0uMzJsMS42Mi44MSAxLjA2LTEuMDYtLjgxLTEuNjJjLjEzLS4yNC4yMy0uNS4zMi0uNzdMMTIgNi43NXpNNiA4LjVhMi41IDIuNSAwIDAxMC01IDIuNSAyLjUgMCAwMTAgNXoiIGZpbGw9IiMwNTBGMTkiLz48L3N2Zz4=",class:"-gear-icon",title:"Expand"}))),n&&n.length>0&&eK("div",{class:"-cbwsdk-snackbar-instance-menu"},n.map((e,t)=>eK("div",{class:ex("-cbwsdk-snackbar-instance-menu-item",e.isRed&&"-cbwsdk-snackbar-instance-menu-item-is-red"),onClick:e.onClick,key:t},eK("svg",{width:e.svgWidth,height:e.svgHeight,viewBox:"0 0 10 11",fill:"none",xmlns:"http://www.w3.org/2000/svg"},eK("path",{"fill-rule":e.defaultFillRule,"clip-rule":e.defaultClipRule,d:e.path,fill:"#AAAAAA"})),eK("span",{class:ex("-cbwsdk-snackbar-instance-menu-item-info",e.isRed&&"-cbwsdk-snackbar-instance-menu-item-info-is-red")},e.info)))))};class tv{constructor(){this.attached=!1,this.snackbar=new t_}attach(){if(this.attached)throw Error("Coinbase Wallet SDK UI is already attached");let e=document.documentElement,t=document.createElement("div");t.className="-cbwsdk-css-reset",e.appendChild(t),this.snackbar.attach(t),this.attached=!0,eI()}showConnecting(e){let t;return t=e.isUnlinkedErrorState?{autoExpand:!0,message:"Connection lost",menuItems:[{isRed:!1,info:"Reset connection",svgWidth:"10",svgHeight:"11",path:"M5.00008 0.96875C6.73133 0.96875 8.23758 1.94375 9.00008 3.375L10.0001 2.375V5.5H9.53133H7.96883H6.87508L7.80633 4.56875C7.41258 3.3875 6.31258 2.53125 5.00008 2.53125C3.76258 2.53125 2.70633 3.2875 2.25633 4.36875L0.812576 3.76875C1.50008 2.125 3.11258 0.96875 5.00008 0.96875ZM2.19375 6.43125C2.5875 7.6125 3.6875 8.46875 5 8.46875C6.2375 8.46875 7.29375 7.7125 7.74375 6.63125L9.1875 7.23125C8.5 8.875 6.8875 10.0312 5 10.0312C3.26875 10.0312 1.7625 9.05625 1 7.625L0 8.625V5.5H0.46875H2.03125H3.125L2.19375 6.43125Z",defaultFillRule:"evenodd",defaultClipRule:"evenodd",onClick:e.onResetConnection}]}:{message:"Confirm on phone",menuItems:[{isRed:!0,info:"Cancel transaction",svgWidth:"11",svgHeight:"11",path:"M10.3711 1.52346L9.21775 0.370117L5.37109 4.21022L1.52444 0.370117L0.371094 1.52346L4.2112 5.37012L0.371094 9.21677L1.52444 10.3701L5.37109 6.53001L9.21775 10.3701L10.3711 9.21677L6.53099 5.37012L10.3711 1.52346Z",defaultFillRule:"inherit",defaultClipRule:"inherit",onClick:e.onCancel},{isRed:!1,info:"Reset connection",svgWidth:"10",svgHeight:"11",path:"M5.00008 0.96875C6.73133 0.96875 8.23758 1.94375 9.00008 3.375L10.0001 2.375V5.5H9.53133H7.96883H6.87508L7.80633 4.56875C7.41258 3.3875 6.31258 2.53125 5.00008 2.53125C3.76258 2.53125 2.70633 3.2875 2.25633 4.36875L0.812576 3.76875C1.50008 2.125 3.11258 0.96875 5.00008 0.96875ZM2.19375 6.43125C2.5875 7.6125 3.6875 8.46875 5 8.46875C6.2375 8.46875 7.29375 7.7125 7.74375 6.63125L9.1875 7.23125C8.5 8.875 6.8875 10.0312 5 10.0312C3.26875 10.0312 1.7625 9.05625 1 7.625L0 8.625V5.5H0.46875H2.03125H3.125L2.19375 6.43125Z",defaultFillRule:"evenodd",defaultClipRule:"evenodd",onClick:e.onResetConnection}]},this.snackbar.presentItem(t)}}class tk{constructor(){this.root=null,this.darkMode=eE()}attach(){let e=document.documentElement;this.root=document.createElement("div"),this.root.className="-cbwsdk-css-reset",e.appendChild(this.root),eI()}present(e){this.render(e)}clear(){this.render(null)}render(e){this.root&&(e6(null,this.root),e&&e6(eK(tC,Object.assign({},e,{onDismiss:()=>{this.clear()},darkMode:this.darkMode})),this.root))}}let tC=({title:e,buttonText:t,darkMode:n,onButtonClick:r,onDismiss:s})=>eK(tb,{darkMode:n},eK("div",{class:"-cbwsdk-redirect-dialog"},eK("style",null,".-cbwsdk-css-reset .-cbwsdk-redirect-dialog-backdrop{position:fixed;top:0;left:0;right:0;bottom:0;transition:opacity .25s;background-color:rgba(10,11,13,.5)}.-cbwsdk-css-reset .-cbwsdk-redirect-dialog-backdrop-hidden{opacity:0}
1.-cbwsdk-css-reset .-cbwsdk-redirect-dialog-box{display:block;position:fixed;top:50%;left:50%;transform:translate(-50%, -50%);padding:20px;border-radius:8px;background-color:#fff;color:#0a0b0d}.-cbwsdk-css-reset .-cbwsdk-redirect-dialog-box p{display:block;font-weight:400;font-size:14px;line-height:20px;padding-bottom:12px;color:#5b636e}.-cbwsdk-css-reset .-cbwsdk-redirect-dialog-box button{appearance:none;border:none;background:none;color:#0052ff;padding:0;text-decoration:none;display:block;font-weight:600;font-size:16px;line-height:24px}.-cbwsdk-css-reset .-cbwsdk-redirect-dialog-box.dark{background-color:#0a0b0d;color:#fff}.-cbwsdk-css-reset .-cbwsdk-redirect-dialog-box.dark button{color:#0052ff}.-cbwsdk-css-reset .-cbwsdk-redirect-dialog-box.light{background-color:#fff;color:#0a0b0d}.-cbwsdk-css-reset .-cbwsdk-redirect-dialog-box.light button{color:#0052ff}"),eK("div",{class:"-cbwsdk-redirect-dialog-backdrop",onClick:s}),eK("div",{class:ex("-cbwsdk-redirect-dialog-box",n?"dark":"light")},eK("p",null,e),eK("button",{onClick:r},t)))),tE="https://www.walletlink.org";class tI{constructor(){this.attached=!1,this.redirectDialog=new tk}attach(){if(this.attached)throw Error("Coinbase Wallet SDK UI is already attached");this.redirectDialog.attach(),this.attached=!0}redirectToCoinbaseWallet(e){let t=new URL("https://go.cb-w.com/walletlink");t.searchParams.append("redirect_url",function(){try{if(function(){try{return null!==window.frameElement}catch(e){return!1}}()&&window.top)return window.top.location;return window.location}catch(e){return window.location}}().href),e&&t.searchParams.append("wl_url",e);let n=document.createElement("a");n.target="cbw-opener",n.href=t.href,n.rel="noreferrer noopener",n.click()}openCoinbaseWalletDeeplink(e){this.redirectDialog.present({title:"Redirecting to Coinbase Wallet...",buttonText:"Open",onButtonClick:()=>{this.redirectToCoinbaseWallet(e)}}),setTimeout(()=>{this.redirectToCoinbaseWallet(e)},99)}showConnecting(e){return()=>{this.redirectDialog.clear()}}}class tx{constructor(e){var t;this.chainCallbackParams={chainId:"",jsonRpcUrl:""},this.isMobileWeb=/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(null===(t=null==window?void 0:window.navigator)||void 0===t?void 0:t.userAgent),this.linkedUpdated=e=>{this.isLinked=e;let t=this.storage.getItem(ed);if(e&&(this._session.linked=e),this.isUnlinkedErrorState=!1,t){let n=t.split(" "),r="true"===this.storage.getItem("IsStandaloneSigning");""===n[0]||e||!this._session.linked||r||(this.isUnlinkedErrorState=!0)}},this.metadataUpdated=(e,t)=>{this.storage.setItem(e,t)},this.chainUpdated=(e,t)=>{(this.chainCallbackParams.chainId!==e||this.chainCallbackParams.jsonRpcUrl!==t)&&(this.chainCallbackParams={chainId:e,jsonRpcUrl:t},this.chainCallback&&this.chainCallback(t,Number.parseInt(e,10)))},this.accountUpdated=e=>{this.accountsCallback&&this.accountsCallback([e]),tx.accountRequestCallbackIds.size>0&&(Array.from(tx.accountRequestCallbackIds.values()).forEach(t=>{this.invokeCallback(t,{method:"requestEthereumAccounts",result:[e]})}),tx.accountRequestCallbackIds.clear())},this.resetAndReload=this.resetAndReload.bind(this),this.linkAPIUrl=e.linkAPIUrl,this.storage=e.storage,this.metadata=e.metadata,this.accountsCallback=e.accountsCallback,this.chainCallback=e.chainCallback;let{session:n,ui:r,connection:s}=this.subscribe();this._session=n,this.connection=s,this.relayEventManager=new ey,this.ui=r,this.ui.attach()}subscribe(){let e=eC.load(this.storage)||eC.create(this.storage),{linkAPIUrl:t}=this,n=new em({session:e,linkAPIUrl:t,listener:this}),r=this.isMobileWeb?new tI:new tv;return n.connect(),{session:e,ui:r,connection:n}}resetAndReload(){this.connection.destroy().then(()=>{let e=eC.load(this.storage);(null==e?void 0:e.id)===this._session.id&&i.clearAll(),document.location.reload()}).catch(e=>{})}signEthereumTransaction(e){return this.sendRequest({method:"signEthereumTransaction",params:{fromAddress:e.fromAddress,toAddress:e.toAddress,weiValue:P(e.weiValue),data:L(e.data,!0),nonce:e.nonce,gasPriceInWei:e.gasPriceInWei?P(e.gasPriceInWei):null,maxFeePerGas:e.gasPriceInWei?P(e.gasPriceInWei):null,maxPriorityFeePerGas:e.gasPriceInWei?P(e.gasPriceInWei):null,gasLimit:e.gasLim
vendor: 4,173 bytes, line 1
1it?P(e.gasLimit):null,chainId:e.chainId,shouldSubmit:!1}})}signAndSubmitEthereumTransaction(e){return this.sendRequest({method:"signEthereumTransaction",params:{fromAddress:e.fromAddress,toAddress:e.toAddress,weiValue:P(e.weiValue),data:L(e.data,!0),nonce:e.nonce,gasPriceInWei:e.gasPriceInWei?P(e.gasPriceInWei):null,maxFeePerGas:e.maxFeePerGas?P(e.maxFeePerGas):null,maxPriorityFeePerGas:e.maxPriorityFeePerGas?P(e.maxPriorityFeePerGas):null,gasLimit:e.gasLimit?P(e.gasLimit):null,chainId:e.chainId,shouldSubmit:!0}})}submitEthereumTransaction(e,t){return this.sendRequest({method:"submitEthereumTransaction",params:{signedTransaction:L(e,!0),chainId:t}})}getWalletLinkSession(){return this._session}sendRequest(e){let t=null,n=x(8),r=r=>{this.publishWeb3RequestCanceledEvent(n),this.handleErrorResponse(n,e.method,r),null==t||t()};return new Promise((s,i)=>{t=this.ui.showConnecting({isUnlinkedErrorState:this.isUnlinkedErrorState,onCancel:r,onResetConnection:this.resetAndReload}),this.relayEventManager.callbacks.set(n,e=>{if(null==t||t(),eu(e))return i(Error(e.errorMessage));s(e)}),this.publishWeb3RequestEvent(n,e)})}publishWeb3RequestEvent(e,t){let n={type:"WEB3_REQUEST",id:e,request:t};this.publishEvent("Web3Request",n,!0).then(e=>{}).catch(e=>{this.handleWeb3ResponseMessage(n.id,{method:t.method,errorMessage:e.message})}),this.isMobileWeb&&this.openCoinbaseWalletDeeplink(t.method)}openCoinbaseWalletDeeplink(e){if(this.ui instanceof tI)switch(e){case"requestEthereumAccounts":case"switchEthereumChain":return;default:window.addEventListener("blur",()=>{window.addEventListener("focus",()=>{this.connection.checkUnseenEvents()},{once:!0})},{once:!0}),this.ui.openCoinbaseWalletDeeplink()}}publishWeb3RequestCanceledEvent(e){this.publishEvent("Web3RequestCanceled",{type:"WEB3_REQUEST_CANCELED",id:e},!1).then()}publishEvent(e,t,n){return this.connection.publishEvent(e,t,n)}handleWeb3ResponseMessage(e,t){if("requestEthereumAccounts"===t.method){tx.accountRequestCallbackIds.forEach(e=>this.invokeCallback(e,t)),tx.accountRequestCallbackIds.clear();return}this.invokeCallback(e,t)}handleErrorResponse(e,t,n){var r;let s=null!==(r=null==n?void 0:n.message)&&void 0!==r?r:"Unspecified error message.";this.handleWeb3ResponseMessage(e,{method:t,errorMessage:s})}invokeCallback(e,t){let n=this.relayEventManager.callbacks.get(e);n&&(n(t),this.relayEventManager.callbacks.delete(e))}requestEthereumAccounts(){let{appName:e,appLogoUrl:t}=this.metadata,n={method:"requestEthereumAccounts",params:{appName:e,appLogoUrl:t}},r=x(8);return new Promise((e,t)=>{this.relayEventManager.callbacks.set(r,n=>{if(eu(n))return t(Error(n.errorMessage));e(n)}),tx.accountRequestCallbackIds.add(r),this.publishWeb3RequestEvent(r,n)})}watchAsset(e,t,n,r,s,i){let a={method:"watchAsset",params:{type:e,options:{address:t,symbol:n,decimals:r,image:s},chainId:i}},o=null,l=x(8);return o=this.ui.showConnecting({isUnlinkedErrorState:this.isUnlinkedErrorState,onCancel:e=>{this.publishWeb3RequestCanceledEvent(l),this.handleErrorResponse(l,a.method,e),null==o||o()},onResetConnection:this.resetAndReload}),new Promise((e,t)=>{this.relayEventManager.callbacks.set(l,n=>{if(null==o||o(),eu(n))return t(Error(n.errorMessage));e(n)}),this.publishWeb3RequestEvent(l,a)})}addEthereumChain(e,t,n,r,s,i){let a={method:"addEthereumChain",params:{chainId:e,rpcUrls:t,blockExplorerUrls:r,chainName:s,iconUrls:n,nativeCurrency:i}},o=null,l=x(8);return o=this.ui.showConnecting({isUnlinkedErrorState:this.isUnlinkedErrorState,onCancel:e=>{this.publishWeb3RequestCanceledEvent(l),this.handleErrorResponse(l,a.method,e),null==o||o()},onResetConnection:this.resetAndReload}),new Promise((e,t)=>{this.relayEventManager.callbacks.set(l,n=>{if(null==o||o(),eu(n))return t(Error(n.errorMessage));e(n)}),this.publishWeb3RequestEvent(l,a)})}switchEthereumChain(e,t){let n={method:"switchEthereumChain",params:Object.assign({chainId:e},{address:t})},r=null,s=x(8);return r=this.ui.showConnecting({isUnlinkedErrorState:this.isUnlinkedErrorState,onCancel:e=>{this.publishWeb3RequestCanceledEvent(s),this.handleErrorResponse(s,n.method,e),null==r||r()},onResetConnection:this.resetAndReload}),new Promise((e,t)=>
1{this.relayEventManager.callbacks.set(s,n=>(null==r||r(),eu(n)&&n.errorCode)?t(p.provider.custom({code:n.errorCode,message:"Unrecognized chain ID. Try adding the chain using addEthereumChain first."})):eu(n)?t(Error(n.errorMessage)):void e(n)),this.publishWeb3RequestEvent(s,n)})}}tx.accountRequestCallbackIds=new Set;var tS=n(9109).lW;let tM="DefaultChainId",tL="DefaultJsonRpcUrl";class tA{constructor(e){this._relay=null,this._addresses=[],this.metadata=e.metadata,this._storage=new i("walletlink",tE),this.callback=e.callback||null;let t=this._storage.getItem(ed);if(t){let e=t.split(" ");""!==e[0]&&(this._addresses=e.map(e=>U(e)))}this.initializeRelay()}getSession(){let{id:e,secret:t}=this.initializeRelay().getWalletLinkSession();return{id:e,secret:t}}async handshake(){await this._eth_requestAccounts()}get selectedAddress(){return this._addresses[0]||void 0}get jsonRpcUrl(){var e;return null!==(e=this._storage.getItem(tL))&&void 0!==e?e:void 0}set jsonRpcUrl(e){this._storage.setItem(tL,e)}updateProviderInfo(e,t){var n;this.jsonRpcUrl=e;let r=this.getChainId();this._storage.setItem(tM,t.toString(10)),W(t)!==r&&(null===(n=this.callback)||void 0===n||n.call(this,"chainChanged",D(t)))}async watchAsset(e){let t=Array.isArray(e)?e[0]:e;if(!t.type)throw p.rpc.invalidParams("Type is required");if((null==t?void 0:t.type)!=="ERC20")throw p.rpc.invalidParams(`Asset of type '${t.type}' is not supported`);if(!(null==t?void 0:t.options))throw p.rpc.invalidParams("Options are required");if(!(null==t?void 0:t.options.address))throw p.rpc.invalidParams("Address is required");let n=this.getChainId(),{address:r,symbol:s,image:i,decimals:a}=t.options,o=this.initializeRelay(),l=await o.watchAsset(t.type,r,s,a,i,null==n?void 0:n.toString());return!eu(l)&&!!l.result}async addEthereumChain(e){var t,n;let r=e[0];if((null===(t=r.rpcUrls)||void 0===t?void 0:t.length)===0)throw p.rpc.invalidParams("please pass in at least 1 rpcUrl");if(!r.chainName||""===r.chainName.trim())throw p.rpc.invalidParams("chainName is a required field");if(!r.nativeCurrency)throw p.rpc.invalidParams("nativeCurrency is a required field");let s=Number.parseInt(r.chainId,16);if(s===this.getChainId())return!1;let i=this.initializeRelay(),{rpcUrls:a=[],blockExplorerUrls:o=[],chainName:l,iconUrls:c=[],nativeCurrency:h}=r,d=await i.addEthereumChain(s.toString(),a,c,o,l,h);if(eu(d))return!1;if((null===(n=d.result)||void 0===n?void 0:n.isApproved)===!0)return this.updateProviderInfo(a[0],s),null;throw p.rpc.internal("unable to add ethereum chain")}async switchEthereumChain(e){let t=Number.parseInt(e[0].chainId,16),n=this.initializeRelay(),r=await n.switchEthereumChain(t.toString(10),this.selectedAddress||void 0);if(eu(r))throw r;let s=r.result;return s.isApproved&&s.rpcUrl.length>0&&this.updateProviderInfo(s.rpcUrl,t),null}async cleanup(){this.callback=null,this._relay&&this._relay.resetAndReload(),this._storage.clear()}_setAddresses(e,t){var n;if(!Array.isArray(e))throw Error("addresses is not an array");let r=e.map(e=>U(e));JSON.stringify(r)!==JSON.stringify(this._addresses)&&(this._addresses=r,null===(n=this.callback)||void 0===n||n.call(this,"accountsChanged",r),this._storage.setItem(ed,r.join(" ")))}async request(e){let t=e.params||[];switch(e.method){case"eth_accounts":return[...this._addresses];case"eth_coinbase":return this.selectedAddress||null;case"net_version":return this.getChainId().toString(10);case"eth_chainId":return D(this.getChainId());case"eth_requestAccounts":return this._eth_requestAccounts();case"eth_ecRecover":case"personal_ecRecover":return this.ecRecover(e);case"personal_sign":return this.personalSign(e);case"eth_signTransaction":return this._eth_signTransaction(t);case"eth_sendRawTransaction":return this._eth_sendRawTransaction(t);case"eth_sendTransaction":return this._eth_sendTransaction(t);case"eth_signTypedData_v1":case"eth_signTypedData_v3":case"eth_signTypedData_v4":case"eth_signTypedData":return this.signTypedData(e);case"wallet_addEthereumChain":return this.addEthereumChain(t);case"wallet_switchEthereumChain":return this.switchEthereumChain(t);case"wallet_watchAsset":return this.watchAsset(t);default:if(!this.jsonRpcUrl)throw p.rpc.internal("No RPC URL set for chain");return er(e,this.jsonRpcUrl)}}_ensureKnownAddress(e){let t=U(e);if(!this._addresses.map(e=>U(e)).includes(t))throw Error("Unknown Ethereum address")}_prepareTransactionParams(e){let t=e.from?U(e.from):this.selectedAddress;if(!t)throw Error("Ethereum address is unavailable");this._ensureKnownAddress(t);let n=e.to?U(e.to):null,r=null!=e.value?q(e.value):BigInt(0),s=e.data?H(e.data):tS.alloc(0),i=null!=e.nonce?W(e.nonce):null,a=null!=e.gasPrice?q(e.gasPrice):null,o=null!=e.maxFeePerGas?q(e.maxFeePerGas):null;return{fromAddress:t,toAddress:n,weiValue:r,data:s,nonce:i,gasPriceInWei:a,maxFeePerGas:o,maxPriorityFeePerGas:null!=e.maxPriorityFeePerGas?q(e.maxPriorityFeePerGas):null,gasLimit:null!=e.gas?q(e.gas):null,chainId:e.chainId?W(e.chainId):this.getChainId()}}async ecRecover(e){let{method:t,params:n}=e;if(!Array.isArray(n))throw p.rpc.invalidParams();let r=this.initializeRelay(),s=await r.sendRequest({method:"ethereumAddressFromSignedMessage",params:{message:A(n[0]),signature:A(n[1]),addPrefix:"personal_ecRecover"===t}});if(eu(s))throw s;return s.result}getChainId(){var e;return Number.parseInt(null!==(e=this._storage.getItem(tM))&&void 0!==e?e:"1",10)}async _eth_requestAccounts(){var e,t;if(this._addresses.length>0)return null===(e=this.callback)||void 0===e||e.call(this,"connect",{chainId:D(this.getChainId())}),this._addresses;let n=this.initializeRelay(),r=await n.requestEthereumAccounts();if(eu(r))throw r;if(!r.result)throw Error("accounts received is empty");return this._setAddresses(r.result),null===(t=this.callback)||void 0===t||t.call(this,"connect",{chainId:D(this.getChainId())}),this._addresses}async personalSign({params:e}){if(!Array.isArray(e))throw p.rpc.invalidParams();let t=e[1],n=e[0];this._ensureKnownAddress(t);let r=this.initializeRelay(),s=await r.sendRequest({method:"signEthereumMessage",params:{address:U(t),message:A(n),addPrefix:!0,typedDataJson:null}});if(eu(s))throw s;return s.result}async _eth_signTransaction(e){let t=this._prepareTransactionParams(e[0]||{}),n=this.initializeRelay(),r=await n.signEthereumTransaction(t);
1if(eu(r))throw r;return r.result}async _eth_sendRawTransaction(e){let t=H(e[0]),n=this.initializeRelay(),r=await n.submitEthereumTransaction(t,this.getChainId());if(eu(r))throw r;return r.result}async _eth_sendTransaction(e){let t=this._prepareTransactionParams(e[0]||{}),n=this.initializeRelay(),r=await n.signAndSubmitEthereumTransaction(t);if(eu(r))throw r;return r.result}async signTypedData(e){let{method:t,params:n}=e;if(!Array.isArray(n))throw p.rpc.invalidParams();let r=n["eth_signTypedData_v1"===t?1:0],s=n["eth_signTypedData_v1"===t?0:1];this._ensureKnownAddress(r);let i=this.initializeRelay(),a=await i.sendRequest({method:"signEthereumMessage",params:{address:U(r),message:L(({eth_signTypedData_v1:eh.hashForSignTypedDataLegacy,eth_signTypedData_v3:eh.hashForSignTypedData_v3,eth_signTypedData_v4:eh.hashForSignTypedData_v4,eth_signTypedData:eh.hashForSignTypedData_v4})[t]({data:function(e){if("string"==typeof e)return JSON.parse(e);if("object"==typeof e)return e;throw p.rpc.invalidParams(`Not a JSON string or an object: ${String(e)}`)}(s)}),!0),typedDataJson:JSON.stringify(s,null,2),addPrefix:!1}});if(eu(a))throw a;return a.result}initializeRelay(){return this._relay||(this._relay=new tx({linkAPIUrl:tE,storage:this._storage,metadata:this.metadata,accountsCallback:this._setAddresses.bind(this),chainCallback:this.updateProviderInfo.bind(this)})),this._relay}}let tP="SignerType",tD=new i("CBWSDK","SignerConfigurator");async function tN(e){let{communicator:t,metadata:n,handshakeRequest:r,callback:s}=e;tR(t,n,s).catch(()=>{});let i={id:crypto.randomUUID(),event:"selectSignerType",data:Object.assign(Object.assign({},e.preference),{handshakeRequest:r})},{data:a}=await t.postRequestAndWaitForResponse(i);return a}async function tR(e,t,n){await e.onMessage(({event:e})=>"WalletLinkSessionRequest"===e);let r=new tA({metadata:t,callback:n});e.postMessage({event:"WalletLinkUpdate",data:{session:r.getSession()}}),await r.handshake(),e.postMessage({event:"WalletLinkUpdate",data:{connected:!0}})}let tT=`Coinbase Wallet SDK requires the Cross-Origin-Opener-Policy header to not be set to 'same-origin'. This is to ensure that the SDK can communicate with the Coinbase Smart Wallet app.
2
3Please see https://www.smartwallet.dev/guides/tips/popup-tips#cross-origin-opener-policy for more information.`,{checkCrossOriginOpenerPolicy:tO,getCrossOriginOpenerPolicy:tj}={getCrossOriginOpenerPolicy:()=>void 0===r?"undefined":r,checkCrossOriginOpenerPolicy:async()=>{if("undefined"==typeof window){r="non-browser-env";return}try{let e=`${window.location.origin}${window.location.pathname}`,t=await fetch(e,{method:"HEAD"});if(!t.ok)throw Error(`HTTP error! status: ${t.status}`);let n=t.headers.get("Cross-Origin-Opener-Policy");r=null!=n?n:"null","same-origin"===r&&console.error(tT)}catch(e){console.error("Error checking Cross-Origin-Opener-Policy:",e.message),r="error"}}};class tU{constructor({url:e="https://keys.coinbase.com/connect",metadata:t,preference:n}){this.popup=null,this.listeners=new Map,this.postMessage=async e=>{(await this.waitForPopupLoaded()).postMessage(e,this.url.origin)},this.postRequestAndWaitForResponse=async e=>{let t=this.onMessage(({requestId:t})=>t===e.id);return this.postMessage(e),await t},this.onMessage=async e=>new Promise((t,n)=>{let r=n=>{if(n.origin!==this.url.origin)return;let s=n.data;e(s)&&(t(s),window.removeEventListener("message",r),this.listeners.delete(r))};window.addEventListener("message",r),this.listeners.set(r,{reject:n})}),this.disconnect=()=>{var e;(e=this.popup)&&!e.closed&&e.close(),this.popup=null,this.listeners.forEach(({reject:e},t)=>{e(p.provider.userRejectedRequest("Request rejected")),window.removeEventListener("message",t)}),this.listeners.clear()},this.waitForPopupLoaded=async()=>this.popup&&!this.popup.closed?(this.popup.focus(),this.popup):(this.popup=function(e){let t=(window.innerWidth-420)/2+window.screenX,n=(window.innerHeight-540)/2+window.screenY;(function(e){for(let[t,n]of Object.entries({sdkName:en,sdkVersion:et,origin:window.location.origin,coop:tj()}))e.searchParams.append(t,n.toString())})(e);let r=`wallet_${crypto.randomUUID()}`,s=window.open(e,r,`width=420, height=540, left=${t}, top=${n}`);if(null==s||s.focus(),!s)throw p.rpc.internal("Pop up window failed to open");return s}(this.url),this.onMessage(({event:e})=>"PopupUnload"===e).then(this.disconnect).catch(()=>{}),this.onMessage(({event:e})=>"PopupLoaded"===e).then(e=>{this.postMessage({requestId:e.id,data:{version:et,metadata:this.metadata,preference:this.preference,location:window.location.toString()}})}).then(()=>
3{if(!this.popup)throw p.rpc.internal();return this.popup})),this.url=new URL(e),this.metadata=t,this.preference=n}}var tH=n(37836);class tW extends tH{}var tq=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&0>t.indexOf(r)&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var s=0,r=Object.getOwnPropertySymbols(e);s<r.length;s++)0>t.indexOf(r[s])&&Object.prototype.propertyIsEnumerable.call(e,r[s])&&(n[r[s]]=e[r[s]]);return n};class tB extends tW{constructor(e){var{metadata:t}=e,n=e.preference,{keysUrl:r}=n,s=tq(n,["keysUrl"]);super(),this.signer=null,this.isCoinbaseWallet=!0,this.metadata=t,this.preference=s,this.communicator=new tU({url:r,metadata:t,preference:s});let i=tD.getItem(tP);i&&(this.signer=this.initSigner(i))}async request(e){try{if(!function(e){if(!e||"object"!=typeof e||Array.isArray(e))throw p.rpc.invalidParams({message:"Expected a single, non-array, object argument.",data:e});let{method:t,params:n}=e;if("string"!=typeof t||0===t.length)throw p.rpc.invalidParams({message:"'args.method' must be a non-empty string.",data:e});if(void 0!==n&&!Array.isArray(n)&&("object"!=typeof n||null===n))throw p.rpc.invalidParams({message:"'args.params' must be an object or array if provided.",data:e});switch(t){case"eth_sign":case"eth_signTypedData_v2":case"eth_subscribe":case"eth_unsubscribe":throw p.provider.unsupportedMethod()}}(e),!this.signer)switch(e.method){case"eth_requestAccounts":{let t=await this.requestSignerSelection(e),n=this.initSigner(t);await n.handshake(e),this.signer=n,tD.setItem(tP,t);break}case"wallet_sendCalls":{let t=this.initSigner("scw");await t.handshake({method:"handshake"});let n=await t.request(e);return await t.cleanup(),n}case"wallet_getCallsStatus":return er(e,"http://rpc.wallet.coinbase.com");case"net_version":return 1;case"eth_chainId":return D(1);default:throw p.provider.unauthorized("Must call 'eth_requestAccounts' before other methods")}return await this.signer.request(e)}catch(t){let{code:e}=t;return e===a.provider.unauthorized&&this.disconnect(),Promise.reject(function(e){let t=function(e,{shouldIncludeStack:t=!1}={}){var n,r;let s={};return e&&"object"==typeof e&&!Array.isArray(e)&&d(e,"code")&&Number.isInteger(n=e.code)&&(o[n.toString()]||(r=n)>=-32099&&r<=-32e3)?(s.code=e.code,e.message&&"string"==typeof e.message?(s.message=e.message,d(e,"data")&&(s.data=e.data)):(s.message=c(s.code),s.data={originalError:h(e)})):(s.code=a.rpc.internal,s.message=u(e,"message")?e.message:l,s.data={originalError:h(e)}),t&&(s.stack=u(e,"stack")?e.stack:void 0),s}(function(e){var t;if("string"==typeof e)return{message:e,code:a.rpc.internal};if(eu(e)){let n=e.errorMessage,r=null!==(t=e.errorCode)&&void 0!==t?t:n.match(/(denied|rejected)/i)?a.provider.userRejectedRequest:void 0;return Object.assign(Object.assign({},e),{message:n,code:r,data:{method:e.method}})}return e}(e),{shouldIncludeStack:!0}),n=new URL("https://docs.cloud.coinbase.com/wallet-sdk/docs/errors");return n.searchParams.set("version",et),n.searchParams.set("code",t.code.toString()),n.searchParams.set("message",t.message),Object.assign(Object.assign({},t),{docUrl:n.href})}(t))}}async enable(){return console.warn('.enable() has been deprecated. Please use .request({ method: "eth_requestAccounts" }) instead.'),await this.request({method:"eth_requestAccounts"})}async disconnect(){var e;await (null===(e=this.signer)||void 0===e?void 0:e.cleanup()),this.signer=null,i.clearAll(),this.emit("disconnect",p.provider.disconnected("User initiated disconnection"))}requestSignerSelection(e){return tN({communicator:this.communicator,preference:this.preference,metadata:this.metadata,handshakeRequest:e,callback:this.emit.bind(this)})}initSigner(e){return function(e){let{signerType:t,metadata:n,communicator:r,callback:s}=e;switch(t){case"scw":return new ec({metadata:n,callback:s,communicator:r});case"walletlink":return new tA({metadata:n,callback:s})}}({signerType:e,metadata:this.metadata,communicator:this.communicator,callback:this.emit.bind(this)})}}function tV(e){if(e){if(!["all","smartWalletOnly","eoaOnly"].includes(e.options))throw Error(`Invalid options: ${e.options}`);
3if(e.attribution&&void 0!==e.attribution.auto&&void 0!==e.attribution.dataSuffix)throw Error("Attribution cannot contain both auto and dataSuffix properties")}}class tZ{constructor(e){this.metadata={appName:e.appName||"Dapp",appLogoUrl:e.appLogoUrl||function(){let e=document.querySelector('link[sizes="192x192"]')||document.querySelector('link[sizes="180x180"]')||document.querySelector('link[rel="icon"]')||document.querySelector('link[rel="shortcut icon"]'),{protocol:t,host:n}=document.location,r=e?e.getAttribute("href"):null;return!r||r.startsWith("javascript:")||r.startsWith("vbscript:")?`${t}//${n}/favicon.ico`:r.startsWith("http://")||r.startsWith("https://")||r.startsWith("data:")?r:r.startsWith("//")?t+r:`${t}//${n}${r}`}(),appChainIds:e.appChainIds||[]},this.storeLatestVersion(),tO()}makeWeb3Provider(e={options:"all"}){var t;tV(e);let n={metadata:this.metadata,preference:e};return null!==(t=es(n))&&void 0!==t?t:new tB(n)}getCoinbaseWalletLogo(e,t=240){return s(e,t)}storeLatestVersion(){new i("CBWSDK").setItem("VERSION",et)}}let tz={options:"all"};function tK(e){var t;new i("CBWSDK").setItem("VERSION",et),tO();let n={metadata:{appName:e.appName||"Dapp",appLogoUrl:e.appLogoUrl||"",appChainIds:e.appChainIds||[]},preference:Object.assign(tz,null!==(t=e.preference)&&void 0!==t?t:{})};tV(n.preference);let r=null;return{getProvider:()=>(r||(r=function(e){var t;let n={metadata:e.metadata,preference:e.preference};return null!==(t=es(n))&&void 0!==t?t:new tB(n)}(n)),r)}}var tF=tZ}}]);

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.