(self.webpackChunkfrog=self.webpackChunkfrog||[]).push([[8859],{28232:(e,t)=>{"use strict";const s=/^[\u0021-\u003A\u003C\u003E-\u007E]+$/,n=/^[\u0021-\u003A\u003C-\u007E]*$/,i=/^([.]?[a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?)([.][a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?)*$/i,r=/^[\u0020-\u003A\u003D-\u007E]*$/,a=Object.prototype.toString,o=(()=>{const e=function(){};return e.prototype=Object.create(null),e})();function c(e,t,s){do{const s=e.charCodeAt(t);if(32!==s&&9!==s)return t}while(++ts;){const s=e.charCodeAt(--t);if(32!==s&&9!==s)return t+1}return s}function l(e){if(-1===e.indexOf("%"))return e;try{return decodeURIComponent(e)}catch(t){return e}}},76314:e=>{"use strict";e.exports=function(e){var t=[];return t.toString=function(){return this.map((function(t){var s="",n=void 0!==t[5];return t[4]&&(s+="@supports (".concat(t[4],") {")),t[2]&&(s+="@media ".concat(t[2]," {")),n&&(s+="@layer".concat(t[5].length>0?" ".concat(t[5]):""," {")),s+=e(t),n&&(s+="}"),t[2]&&(s+="}"),t[4]&&(s+="}"),s})).join("")},t.i=function(e,s,n,i,r){"string"==typeof e&&(e=[[null,e,void 0]]);var a={};if(n)for(var o=0;o0?" ".concat(l[5]):""," {").concat(l[1],"}")),l[5]=r),s&&(l[2]?(l[1]="@media ".concat(l[2]," {").concat(l[1],"}"),l[2]=s):l[2]=s),i&&(l[4]?(l[1]="@supports (".concat(l[4],") {").concat(l[1],"}"),l[4]=i):l[4]="".concat(i)),t.push(l))}},t}},31601:e=>{"use strict";e.exports=function(e){return e[1]}},62978:(e,t,s)=>{const n=s(94548);function i(e){return e.startsWith("int[")?"int256"+e.slice(3):"int"===e?"int256":e.startsWith("uint[")?"uint256"+e.slice(4):"uint"===e?"uint256":e.startsWith("fixed[")?"fixed128x128"+e.slice(5):"fixed"===e?"fixed128x128":e.startsWith("ufixed[")?"ufixed128x128"+e.slice(6):"ufixed"===e?"ufixed128x128":e}function r(e){return Number.parseInt(/^\D+(\d+)$/.exec(e)[1],10)}function a(e){var t=/^\D+(\d+)x(\d+)$/.exec(e);return[Number.parseInt(t[1],10),Number.parseInt(t[2],10)]}function o(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 new Error("Argument is not a number")}function d(e,t){var s,i,l,h;if("address"===e)return d("uint160",c(t));if("bool"===e)return d("uint8",t?1:0);if("string"===e)return d("bytes",new Buffer(t,"utf8"));if(function(e){return e.lastIndexOf("]")===e.length-1}(e)){if(void 0===t.length)throw new Error("Not an array?");if("dynamic"!==(s=o(e))&&0!==s&&t.length>s)throw new Error("Elements exceed array size: "+s);for(h in l=[],e=e.slice(0,e.lastIndexOf("[")),"string"==typeof t&&(t=JSON.parse(t)),t)l.push(d(e,t[h]));if("dynamic"===s){var u=d("uint256",t.length);l.unshift(u)}return Buffer.concat(l)}if("bytes"===e)return t=new Buffer(t),l=Buffer.concat([d("uint256",t.length),t]),t.length%32!=0&&(l=Buffer.concat([l,n.zeros(32-t.length%32)])),l;if(e.startsWith("bytes")){if((s=r(e))<1||s>32)throw new Error("Invalid bytes width: "+s);return n.setLengthRight(t,32)}if(e.startsWith("uint")){if((s=r(e))%8||s<8||s>256)throw new Error("Invalid uint width: "+s);i=c(t);const a=n.bitLengthFromBigInt(i);if(a>s)throw new Error("Supplied uint exceeds width: "+s+" vs "+a);if(i<0)throw new Error("Supplied uint is negative");return n.bufferBEFromBigInt(i,32)}if(e.startsWith("int")){if((s=r(e))%8||s<8||s>256)throw new Error("Invalid int width: "+s);i=c(t);const a=n.bitLengthFromBigInt(i);if(a>s)throw new Error("Supplied int exceeds width: "+s+" vs "+a);const o=n.twosFromBigInt(i,256);return n.bufferBEFromBigInt(o,32)}if(e.startsWith("ufixed")){if(s=a(e),(i=c(t))<0)throw new Error("Supplied ufixed is negative");return d("uint256",i*BigInt(2)**BigInt(s[1]))}if(e.startsWith("fixed"))return s=a(e),d("int256",c(t)*BigInt(2)**BigInt(s[1]));throw new Error("Unsupported or invalid type: "+e)}function l(e){return"string"===e||"bytes"===e||"dynamic"===o(e)}function h(e,t){if(e.length!==t.length)throw new Error("Number of types are not matching the values");for(var s,a,o=[],d=0;d32)throw new Error("Invalid bytes width: "+s);o.push(n.setLengthRight(h,s))}else if(l.startsWith("uint")){if((s=r(l))%8||s<8||s>256)throw new Error("Invalid uint width: "+s);a=c(h);const e=n.bitLengthFromBigInt(a);if(e>s)throw new Error("Supplied uint exceeds width: "+s+" vs "+e);o.push(n.bufferBEFromBigInt(a,s/8))}else{if(!l.startsWith("int"))throw new Error("Unsupported or invalid type: "+l);{if((s=r(l))%8||s<8||s>256)throw new Error("Invalid int width: "+s);a=c(h);const e=n.bitLengthFromBigInt(a);if(e>s)throw new Error("Supplied int exceeds width: "+s+" vs "+e);const t=n.twosFromBigInt(a,s);o.push(n.bufferBEFromBigInt(t,s/8))}}}return Buffer.concat(o)}e.exports={rawEncode:function(e,t){var s=[],n=[],r=32*e.length;for(var a in e){var o=i(e[a]),c=d(o,t[a]);l(o)?(s.push(d("uint256",r)),n.push(c),r+=c.length):s.push(c)}return Buffer.concat(s.concat(n))},solidityPack:h,soliditySHA3:function(e,t){return n.keccak(h(e,t))}}},76532:(e,t,s)=>{const n=s(94548),i=s(62978),r={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"]},a={encodeData(e,t,s,r=!0){const a=["bytes32"],o=[this.hashType(e,s)];if(r){const c=(e,t,a)=>{if(void 0!==s[t])return["bytes32",null==a?"0x0000000000000000000000000000000000000000000000000000000000000000":n.keccak(this.encodeData(t,a,s,r))];if(void 0===a)throw new Error(`missing value for field ${e} of type ${t}`);if("bytes"===t)return["bytes32",n.keccak(a)];if("string"===t)return"string"==typeof a&&(a=Buffer.from(a,"utf8")),["bytes32",n.keccak(a)];if(t.lastIndexOf("]")===t.length-1){const s=t.slice(0,t.lastIndexOf("[")),r=a.map((t=>c(e,s,t)));return["bytes32",n.keccak(i.rawEncode(r.map((([e])=>e)),r.map((([,e])=>e))))]}return[t,a]};for(const n of s[e]){const[e,s]=c(n.name,n.type,t[n.name]);a.push(e),o.push(s)}}else for(const i of s[e]){let e=t[i.name];if(void 0!==e)if("bytes"===i.type)a.push("bytes32"),e=n.keccak(e),o.push(e);else if("string"===i.type)a.push("bytes32"),"string"==typeof e&&(e=Buffer.from(e,"utf8")),e=n.keccak(e),o.push(e);else if(void 0!==s[i.type])a.push("bytes32"),e=n.keccak(this.encodeData(i.type,e,s,r)),o.push(e);else{if(i.type.lastIndexOf("]")===i.type.length-1)throw new Error("Arrays currently unimplemented in encodeData");a.push(i.type),o.push(e)}}return i.rawEncode(a,o)},encodeType(e,t){let s="",n=this.findTypeDependencies(e,t).filter((t=>t!==e));n=[e].concat(n.sort());for(const e of n){if(!t[e])throw new Error("No type definition specified: "+e);s+=e+"("+t[e].map((({name:e,type:t})=>t+" "+e)).join(",")+")"}return s},findTypeDependencies(e,t,s=[]){if(e=e.match(/^\w*/)[0],s.includes(e)||void 0===t[e])return s;s.push(e);for(const n of t[e])for(const e of this.findTypeDependencies(n.type,t,s))!s.includes(e)&&s.push(e);return s},hashStruct(e,t,s,i=!0){return n.keccak(this.encodeData(e,t,s,i))},hashType(e,t){return n.keccak(this.encodeType(e,t))},sanitizeData(e){const t={};for(const s in r.properties)e[s]&&(t[s]=e[s]);return t.types&&(t.types=Object.assign({EIP712Domain:[]},t.types)),t},hash(e,t=!0){const s=this.sanitizeData(e),i=[Buffer.from("1901","hex")];return i.push(this.hashStruct("EIP712Domain",s.domain,s.types,t)),"EIP712Domain"!==s.primaryType&&i.push(this.hashStruct(s.primaryType,s.message,s.types,t)),n.keccak(Buffer.concat(i))}};e.exports={TYPED_MESSAGE_SCHEMA:r,TypedDataUtils:a,hashForSignTypedDataLegacy:function(e){return function(e){const t=new Error("Expect argument to be non-empty array");if("object"!=typeof e||!e.length)throw t;const s=e.map((function(e){return"bytes"===e.type?n.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(new Array(e.length).fill("string"),a),i.soliditySHA3(r,s)])}(e.data)},hashForSignTypedData_v3:function(e){return a.hash(e.data,!1)},hashForSignTypedData_v4:function(e){return a.hash(e.data)}}},94548:(e,t,s)=>{const{keccak_256:n}=s(32955);function i(e){return Buffer.allocUnsafe(e).fill(0)}function r(e,t){let s=e.toString(16);s.length%2!=0&&(s="0"+s);const n=s.match(/.{1,2}/g).map((e=>parseInt(e,16)));for(;n.length{"use strict";s.d(t,{I:()=>tt});class n{constructor(e,t){this.scope=e,this.module=t}storeObject(e,t){this.setItem(e,JSON.stringify(t))}loadObject(e){const 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(){const e=this.scopedKey(""),t=[];for(let s=0;slocalStorage.removeItem(e)))}scopedKey(e){return`-${this.scope}${this.module?`:${this.module}`:""}:${e}`}static clearAll(){new n("CBWSDK").clear(),new n("walletlink").clear()}}const i={invalidInput:-32e3,resourceNotFound:-32001,resourceUnavailable:-32002,transactionRejected:-32003,methodNotSupported:-32004,limitExceeded:-32005,parse:-32700,invalidRequest:-32600,methodNotFound:-32601,invalidParams:-32602,internal:-32603},r={userRejectedRequest:4001,unauthorized:4100,unsupportedMethod:4200,disconnected:4900,chainDisconnected:4901,unsupportedChain:4902},a={"-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."}},o="Unspecified error message.";function c(e,t=o){if(e&&Number.isInteger(e)){const t=e.toString();if(u(a,t))return a[t].message;if(l(e))return"Unspecified server error."}return t}function d(e,{shouldIncludeStack:t=!1}={}){const s={};if(e&&"object"==typeof e&&!Array.isArray(e)&&u(e,"code")&&function(e){if(!Number.isInteger(e))return!1;const t=e.toString();return!!a[t]||!!l(e)}(e.code)){const t=e;s.code=t.code,t.message&&"string"==typeof t.message?(s.message=t.message,u(t,"data")&&(s.data=t.data)):(s.message=c(s.code),s.data={originalError:h(e)})}else s.code=i.internal,s.message=p(e,"message")?e.message:o,s.data={originalError:h(e)};return t&&(s.stack=p(e,"stack")?e.stack:void 0),s}function l(e){return e>=-32099&&e<=-32e3}function h(e){return e&&"object"==typeof e&&!Array.isArray(e)?Object.assign({},e):e}function u(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function p(e,t){return"object"==typeof e&&null!==e&&t in e&&"string"==typeof e[t]}const g={parse:e=>f(i.parse,e),invalidRequest:e=>f(i.invalidRequest,e),invalidParams:e=>f(i.invalidParams,e),methodNotFound:e=>f(i.methodNotFound,e),internal:e=>f(i.internal,e),server:e=>{if(!e||"object"!=typeof e||Array.isArray(e))throw new Error("Ethereum RPC Server errors must provide single object argument.");const{code:t}=e;if(!Number.isInteger(t)||t>-32005||t<-32099)throw new Error('"code" must be an integer such that: -32099 <= code <= -32005');return f(t,e)},invalidInput:e=>f(i.invalidInput,e),resourceNotFound:e=>f(i.resourceNotFound,e),resourceUnavailable:e=>f(i.resourceUnavailable,e),transactionRejected:e=>f(i.transactionRejected,e),methodNotSupported:e=>f(i.methodNotSupported,e),limitExceeded:e=>f(i.limitExceeded,e)},m={userRejectedRequest:e=>w(r.userRejectedRequest,e),unauthorized:e=>w(r.unauthorized,e),unsupportedMethod:e=>w(r.unsupportedMethod,e),disconnected:e=>w(r.disconnected,e),chainDisconnected:e=>w(r.chainDisconnected,e),unsupportedChain:e=>w(r.unsupportedChain,e),custom:e=>{if(!e||"object"!=typeof e||Array.isArray(e))throw new Error("Ethereum Provider custom errors must provide single object argument.");const{code:t,message:s,data:n}=e;if(!s||"string"!=typeof s)throw new Error('"message" must be a nonempty string');return new v(t,s,n)}};function f(e,t){const[s,n]=y(t);return new b(e,s||c(e),n)}function w(e,t){const[s,n]=y(t);return new v(e,s||c(e),n)}function y(e){if(e){if("string"==typeof e)return[e];if("object"==typeof e&&!Array.isArray(e)){const{message:t,data:s}=e;if(t&&"string"!=typeof t)throw new Error("Must specify string message.");return[t||void 0,s]}}return[]}class b extends Error{constructor(e,t,s){if(!Number.isInteger(e))throw new Error('"code" must be an integer.');if(!t||"string"!=typeof t)throw new Error('"message" must be a nonempty string.');super(t),this.code=e,void 0!==s&&(this.data=s)}}class v extends b{constructor(e,t,s){if(!function(e){return Number.isInteger(e)&&e>=1e3&&e<=4999}(e))throw new Error('"code" must be an integer such that: 1000 <= code <= 4999');super(e,t,s)}}const k=e=>e,C=e=>e,E=e=>e;function I(e){return Math.floor(e)}const M=/^[0-9]*$/,x=/^[a-f0-9]*$/;function S(e){return A(crypto.getRandomValues(new Uint8Array(e)))}function A(e){return[...e].map((e=>e.toString(16).padStart(2,"0"))).join("")}function L(e){return new Uint8Array(e.match(/.{1,2}/g).map((e=>Number.parseInt(e,16))))}function P(e,t=!1){const s=e.toString("hex");return k(t?`0x${s}`:s)}function R(e){return P(q(e),!0)}function D(e){return E(e.toString(10))}function N(e){return k(`0x${BigInt(e).toString(16)}`)}function j(e){return e.startsWith("0x")||e.startsWith("0X")}function T(e){return j(e)?e.slice(2):e}function O(e){return j(e)?`0x${e.slice(2)}`:`0x${e}`}function _(e){if("string"!=typeof e)return!1;const t=T(e).toLowerCase();return x.test(t)}function U(e,t=!1){let s=function(e,t=!1){if("string"==typeof e){const s=T(e).toLowerCase();if(x.test(s))return k(t?`0x${s}`:s)}throw g.invalidParams(`"${String(e)}" is not a hexadecimal string`)}(e,!1);return s.length%2==1&&(s=k(`0${s}`)),t?k(`0x${s}`):s}function W(e){if("string"==typeof e){const t=T(e).toLowerCase();if(_(t)&&40===t.length)return C(O(t))}throw g.invalidParams(`Invalid Ethereum address: ${String(e)}`)}function q(e){if(Buffer.isBuffer(e))return e;if("string"==typeof e){if(_(e)){const t=U(e,!1);return Buffer.from(t,"hex")}return Buffer.from(e,"utf8")}throw g.invalidParams(`Not binary data: ${String(e)}`)}function B(e){if("number"==typeof e&&Number.isInteger(e))return I(e);if("string"==typeof e){if(M.test(e))return I(Number(e));if(_(e))return I(Number(BigInt(U(e,!0))))}throw g.invalidParams(`Not an integer: ${String(e)}`)}function V(e){if(null!==e&&("bigint"==typeof e||function(e){if(null==e||"function"!=typeof e.constructor)return!1;const{constructor:t}=e;return"function"==typeof t.config&&"number"==typeof t.EUCLID}(e)))return BigInt(e.toString(10));if("number"==typeof e)return BigInt(B(e));if("string"==typeof e){if(M.test(e))return BigInt(e);if(_(e))return BigInt(U(e,!0))}throw g.invalidParams(`Not an integer: ${String(e)}`)}function z(e){if("string"==typeof e)return JSON.parse(e);if("object"==typeof e)return e;throw g.invalidParams(`Not a JSON string or an object: ${String(e)}`)}function H(){const 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:s}=document.location,n=e?e.getAttribute("href"):null;return!n||n.startsWith("javascript:")||n.startsWith("vbscript:")?`${t}//${s}/favicon.ico`:n.startsWith("http://")||n.startsWith("https://")||n.startsWith("data:")?n:n.startsWith("//")?t+n:`${t}//${s}${n}`}function Z(e){switch(e){case"public":return"spki";case"private":return"pkcs8"}}async function K(e,t){const s=Z(e),n=await crypto.subtle.exportKey(s,t);return A(new Uint8Array(n))}async function F(e,t){const s=Z(e),n=L(t).buffer;return await crypto.subtle.importKey(s,new Uint8Array(n),{name:"ECDH",namedCurve:"P-256"},!0,"private"===e?["deriveKey"]:[])}async function $(e,t){return async function(e,t){const s=crypto.getRandomValues(new Uint8Array(12));return{iv:s,cipherText:await crypto.subtle.encrypt({name:"AES-GCM",iv:s},e,(new TextEncoder).encode(t))}}(t,JSON.stringify(e,((e,t)=>{if(!(t instanceof Error))return t;const s=t;return Object.assign(Object.assign({},s.code?{code:s.code}:{}),{message:s.message})})))}async function G(e,t){return JSON.parse(await async function(e,{iv:t,cipherText:s}){const n=await crypto.subtle.decrypt({name:"AES-GCM",iv:t},e,s);return(new TextDecoder).decode(n)}(t,e))}const J={storageKey:"ownPrivateKey",keyType:"private"},Y={storageKey:"ownPublicKey",keyType:"public"},Q={storageKey:"peerPublicKey",keyType:"public"};class X{constructor(){this.storage=new n("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(Q,e),await this.loadKeysIfNeeded()}async clear(){this.ownPrivateKey=null,this.ownPublicKey=null,this.peerPublicKey=null,this.sharedSecret=null,this.storage.removeItem(Y.storageKey),this.storage.removeItem(J.storageKey),this.storage.removeItem(Q.storageKey)}async generateKeyPair(){const e=await async function(){return crypto.subtle.generateKey({name:"ECDH",namedCurve:"P-256"},!0,["deriveKey"])}();this.ownPrivateKey=e.privateKey,this.ownPublicKey=e.publicKey,await this.storeKey(J,e.privateKey),await this.storeKey(Y,e.publicKey)}async loadKeysIfNeeded(){if(null===this.ownPrivateKey&&(this.ownPrivateKey=await this.loadKey(J)),null===this.ownPublicKey&&(this.ownPublicKey=await this.loadKey(Y)),null!==this.ownPrivateKey&&null!==this.ownPublicKey||await this.generateKeyPair(),null===this.peerPublicKey&&(this.peerPublicKey=await this.loadKey(Q)),null===this.sharedSecret){if(null===this.ownPrivateKey||null===this.peerPublicKey)return;this.sharedSecret=await async function(e,t){return crypto.subtle.deriveKey({name:"ECDH",public:t},e,{name:"AES-GCM",length:256},!1,["encrypt","decrypt"])}(this.ownPrivateKey,this.peerPublicKey)}}async loadKey(e){const t=this.storage.getItem(e.storageKey);return t?F(e.keyType,t):null}async storeKey(e,t){const s=await K(e.keyType,t);this.storage.setItem(e.storageKey,s)}}const ee="4.2.4",te="@coinbase/wallet-sdk";async function se(e,t){const s=Object.assign(Object.assign({},e),{jsonrpc:"2.0",id:crypto.randomUUID()}),n=await window.fetch(t,{method:"POST",body:JSON.stringify(s),mode:"cors",headers:{"Content-Type":"application/json","X-Cbw-Sdk-Version":ee,"X-Cbw-Sdk-Platform":te}}),{result:i,error:r}=await n.json();if(r)throw r;return i}function ne({metadata:e,preference:t}){var s,n;const{appName:i,appLogoUrl:r,appChainIds:a}=e;if("smartWalletOnly"!==t.options){const e=globalThis.coinbaseWalletExtension;if(e)return null===(s=e.setAppInfo)||void 0===s||s.call(e,i,r,a,t),e}const o=function(){var e,t;try{const s=globalThis;return null!==(e=s.ethereum)&&void 0!==e?e:null===(t=s.top)||void 0===t?void 0:t.ethereum}catch(e){return}}();if(null==o?void 0:o.isCoinbaseBrowser)return null===(n=o.setAppInfo)||void 0===n||n.call(o,i,r,a,t),o}const ie="accounts",re="activeChain",ae="availableChains",oe="walletCapabilities";class ce{constructor(e){var t,s,i;this.metadata=e.metadata,this.communicator=e.communicator,this.callback=e.callback,this.keyManager=new X,this.storage=new n("CBWSDK","SCWStateManager"),this.accounts=null!==(t=this.storage.loadObject(ie))&&void 0!==t?t:[],this.chain=this.storage.loadObject(re)||{id:null!==(i=null===(s=e.metadata.appChainIds)||void 0===s?void 0:s[0])&&void 0!==i?i: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,s;const n=await this.createRequestMessage({handshake:{method:e.method,params:Object.assign({},this.metadata,null!==(t=e.params)&&void 0!==t?t:{})}}),i=await this.communicator.postRequestAndWaitForResponse(n);if("failure"in i.content)throw i.content.failure;const r=await F("public",i.sender);await this.keyManager.setPeerPublicKey(r);const a=(await this.decryptResponseMessage(i)).result;if("error"in a)throw a.error;const o=a.value;this.accounts=o,this.storage.storeObject(ie,o),null===(s=this.callback)||void 0===s||s.call(this,"accountsChanged",o)}async request(e){var t;if(0===this.accounts.length)throw m.unauthorized();switch(e.method){case"eth_requestAccounts":return null===(t=this.callback)||void 0===t||t.call(this,"connect",{chainId:N(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 N(this.chain.id);case"wallet_getCapabilities":return this.storage.loadObject(oe);case"wallet_switchEthereumChain":return this.handleSwitchChainRequest(e);case"eth_ecRecover":case"personal_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 g.internal("No RPC URL set for chain");return se(e,this.chain.rpcUrl)}}async sendRequestToPopup(e){var t,s;await(null===(s=(t=this.communicator).waitForPopupLoaded)||void 0===s?void 0:s.call(t));const n=await this.sendEncryptedRequest(e),i=(await this.decryptResponseMessage(n)).result;if("error"in i)throw i.error;return i.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;const s=e.params;if(!s||!(null===(t=s[0])||void 0===t?void 0:t.chainId))throw g.invalidParams();const n=B(s[0].chainId);if(this.updateChain(n))return null;const i=await this.sendRequestToPopup(e);return null===i&&this.updateChain(n),i}async sendEncryptedRequest(e){const t=await this.keyManager.getSharedSecret();if(!t)throw m.unauthorized("No valid session found, try requestAccounts before other methods");const s=await $({action:e,chainId:this.chain.id},t),n=await this.createRequestMessage({encrypted:s});return this.communicator.postRequestAndWaitForResponse(n)}async createRequestMessage(e){const t=await K("public",await this.keyManager.getOwnPublicKey());return{id:crypto.randomUUID(),sender:t,content:e,timestamp:new Date}}async decryptResponseMessage(e){var t,s;const n=e.content;if("failure"in n)throw n.failure;const i=await this.keyManager.getSharedSecret();if(!i)throw m.unauthorized("Invalid session");const r=await G(n.encrypted,i),a=null===(t=r.data)||void 0===t?void 0:t.chains;if(a){const e=Object.entries(a).map((([e,t])=>({id:Number(e),rpcUrl:t})));this.storage.storeObject(ae,e),this.updateChain(this.chain.id,e)}const o=null===(s=r.data)||void 0===s?void 0:s.capabilities;return o&&this.storage.storeObject(oe,o),r}updateChain(e,t){var s;const n=null!=t?t:this.storage.loadObject(ae),i=null==n?void 0:n.find((t=>t.id===e));return!!i&&(i!==this.chain&&(this.chain=i,this.storage.storeObject(re,i),null===(s=this.callback)||void 0===s||s.call(this,"chainChanged",N(i.id))),!0)}}var de=s(76532);const le="Addresses";function he(e){return void 0!==e.errorMessage}class ue{constructor(e){this.secret=e}async encrypt(e){const t=this.secret;if(64!==t.length)throw Error("secret must be 256 bits");const s=crypto.getRandomValues(new Uint8Array(12)),n=await crypto.subtle.importKey("raw",L(t),{name:"aes-gcm"},!1,["encrypt","decrypt"]),i=new TextEncoder,r=await window.crypto.subtle.encrypt({name:"AES-GCM",iv:s},n,i.encode(e)),a=r.slice(r.byteLength-16),o=r.slice(0,r.byteLength-16),c=new Uint8Array(a),d=new Uint8Array(o);return A(new Uint8Array([...s,...c,...d]))}async decrypt(e){const t=this.secret;if(64!==t.length)throw Error("secret must be 256 bits");return new Promise(((s,n)=>{!async function(){const i=await crypto.subtle.importKey("raw",L(t),{name:"aes-gcm"},!1,["encrypt","decrypt"]),r=L(e),a=r.slice(0,12),o=r.slice(12,28),c=r.slice(28),d=new Uint8Array([...c,...o]),l={name:"AES-GCM",iv:new Uint8Array(a)};try{const e=await window.crypto.subtle.decrypt(l,i,d),t=new TextDecoder;s(t.decode(e))}catch(e){n(e)}}()}))}}class pe{constructor(e,t,s){this.linkAPIUrl=e,this.sessionId=t;const n=`${t}:${s}`;this.auth=`Basic ${btoa(n)}`}async markUnseenEventsAsSeen(e){return Promise.all(e.map((e=>fetch(`${this.linkAPIUrl}/events/${e.eventId}/seen`,{method:"POST",headers:{Authorization:this.auth}})))).catch((e=>{}))}async fetchUnseenEvents(){var e;const t=await fetch(`${this.linkAPIUrl}/events?unseen=true`,{headers:{Authorization:this.auth}});if(t.ok){const{events:s,error:n}=await t.json();if(n)throw new Error(`Check unseen events failed: ${n}`);const i=null!==(e=null==s?void 0:s.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(i),i}throw new Error(`Check unseen events failed: ${t.status}`)}}var ge;!function(e){e[e.DISCONNECTED=0]="DISCONNECTED",e[e.CONNECTING=1]="CONNECTING",e[e.CONNECTED=2]="CONNECTED"}(ge||(ge={}));class me{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 new Error("webSocket object is not null");return new Promise(((e,t)=>{var s;let n;try{this.webSocket=n=new this.WebSocketClass(this.url)}catch(e){return void t(e)}null===(s=this.connectionStateListener)||void 0===s||s.call(this,ge.CONNECTING),n.onclose=e=>{var s;this.clearWebSocket(),t(new Error(`websocket error ${e.code}: ${e.reason}`)),null===(s=this.connectionStateListener)||void 0===s||s.call(this,ge.DISCONNECTED)},n.onopen=t=>{var s;if(e(),null===(s=this.connectionStateListener)||void 0===s||s.call(this,ge.CONNECTED),this.pendingData.length>0){[...this.pendingData].forEach((e=>this.sendData(e))),this.pendingData=[]}},n.onmessage=e=>{var t,s;if("h"===e.data)null===(t=this.incomingDataListener)||void 0===t||t.call(this,{type:"Heartbeat"});else try{const t=JSON.parse(e.data);null===(s=this.incomingDataListener)||void 0===s||s.call(this,t)}catch(e){}}}))}disconnect(){var e;const{webSocket:t}=this;if(t){this.clearWebSocket(),null===(e=this.connectionStateListener)||void 0===e||e.call(this,ge.DISCONNECTED),this.connectionStateListener=void 0,this.incomingDataListener=void 0;try{t.close()}catch(e){}}}sendData(e){const{webSocket:t}=this;if(!t)return this.pendingData.push(e),void this.connect();t.send(e)}clearWebSocket(){const{webSocket:e}=this;e&&(this.webSocket=null,e.onclose=null,e.onerror=null,e.onmessage=null,e.onopen=null)}}class fe{constructor({session:e,linkAPIUrl:t,listener:s}){this.destroyed=!1,this.lastHeartbeatResponse=0,this.nextReqId=I(1),this._connected=!1,this._linked=!1,this.shouldFetchUnseenEventsOnConnect=!1,this.requestResolutions=new Map,this.handleSessionMetadataUpdated=e=>{if(!e)return;new Map([["__destroyed",this.handleDestroyed],["EthereumAddress",this.handleAccountUpdated],["WalletUsername",this.handleWalletUsernameUpdated],["AppVersion",this.handleAppVersionUpdated],["ChainId",t=>e.JsonRpcUrl&&this.handleChainUpdated(t,e.JsonRpcUrl)]]).forEach(((t,s)=>{const n=e[s];void 0!==n&&t(n)}))},this.handleDestroyed=e=>{var t;"1"===e&&(null===(t=this.listener)||void 0===t||t.resetAndReload())},this.handleAccountUpdated=async e=>{var t;const s=await this.cipher.decrypt(e);null===(t=this.listener)||void 0===t||t.accountUpdated(s)},this.handleMetadataUpdated=async(e,t)=>{var s;const n=await this.cipher.decrypt(t);null===(s=this.listener)||void 0===s||s.metadataUpdated(e,n)},this.handleWalletUsernameUpdated=async e=>{this.handleMetadataUpdated("walletUsername",e)},this.handleAppVersionUpdated=async e=>{this.handleMetadataUpdated("AppVersion",e)},this.handleChainUpdated=async(e,t)=>{var s;const n=await this.cipher.decrypt(e),i=await this.cipher.decrypt(t);null===(s=this.listener)||void 0===s||s.chainUpdated(n,i)},this.session=e,this.cipher=new ue(e.secret),this.listener=s;const n=new me(`${t}/rpc`,WebSocket);n.setConnectionStateListener((async e=>{let t=!1;switch(e){case ge.DISCONNECTED:if(!this.destroyed){const e=async()=>{await new Promise((e=>setTimeout(e,5e3))),this.destroyed||n.connect().catch((()=>{e()}))};e()}break;case ge.CONNECTED:t=await this.handleConnected(),this.updateLastHeartbeat(),setInterval((()=>{this.heartbeat()}),1e4),this.shouldFetchUnseenEventsOnConnect&&this.fetchUnseenEventsAPI();case ge.CONNECTING:}this.connected!==t&&(this.connected=t)})),n.setIncomingDataListener((e=>{var t;switch(e.type){case"Heartbeat":return void this.updateLastHeartbeat();case"IsLinkedOK":case"Linked":{const 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=n,this.http=new pe(t,e.id,e.key)}connect(){if(this.destroyed)throw new Error("instance is destroyed");this.ws.connect()}async destroy(){this.destroyed||(await this.makeRequest({type:"SetSessionConfig",id:I(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,s;this._linked=e,e&&(null===(t=this.onceLinked)||void 0===t||t.call(this)),null===(s=this.listener)||void 0===s||s.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;const s=await this.cipher.decrypt(e.data),n=JSON.parse(s);if("WEB3_RESPONSE"!==n.type)return;const{id:i,response:r}=n;null===(t=this.listener)||void 0===t||t.handleWeb3ResponseMessage(i,r)}async checkUnseenEvents(){if(this.connected){await new Promise((e=>setTimeout(e,250)));try{await this.fetchUnseenEventsAPI()}catch(e){}}else this.shouldFetchUnseenEventsOnConnect=!0}async fetchUnseenEventsAPI(){this.shouldFetchUnseenEventsOnConnect=!1;(await this.http.fetchUnseenEvents()).forEach((e=>this.handleIncomingEvent(e)))}async publishEvent(e,t,s=!1){const n=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"}))),i={type:"PublishEvent",id:I(this.nextReqId++),sessionId:this.session.id,event:e,data:n,callWebhook:s};return this.setOnceLinked((async()=>{const e=await this.makeRequest(i);if("Fail"===e.type)throw new 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();else try{this.ws.sendData("h")}catch(e){}}async makeRequest(e,t={timeout:6e4}){const s=e.id;let n;return this.sendData(e),Promise.race([new Promise(((e,i)=>{n=window.setTimeout((()=>{i(new Error(`request ${s} timed out`))}),t.timeout)})),new Promise((e=>{this.requestResolutions.set(s,(t=>{clearTimeout(n),e(t),this.requestResolutions.delete(s)}))}))])}async handleConnected(){return"Fail"!==(await this.makeRequest({type:"HostSession",id:I(this.nextReqId++),sessionId:this.session.id,sessionKey:this.session.key})).type&&(this.sendData({type:"IsLinked",id:I(this.nextReqId++),sessionId:this.session.id}),this.sendData({type:"GetSessionConfig",id:I(this.nextReqId++),sessionId:this.session.id}),!0)}}class we{constructor(){this._nextRequestId=0,this.callbacks=new Map}makeRequestId(){this._nextRequestId=(this._nextRequestId+1)%2147483647;const e=this._nextRequestId,t=O(e.toString(16));return this.callbacks.get(t)&&this.callbacks.delete(t),e}}var ye=s(17663),be=s(4976);const ve="session:id",ke="session:secret",Ce="session:linked";class Ee{constructor(e,t,s,n=!1){this.storage=e,this.id=t,this.secret=s,this.key=(0,be.My)((0,ye.sc)(`${t}, ${s} WalletLink`)),this._linked=!!n}static create(e){const t=S(16),s=S(32);return new Ee(e,t,s).save()}static load(e){const t=e.getItem(ve),s=e.getItem(Ce),n=e.getItem(ke);return t&&n?new Ee(e,t,n,"1"===s):null}get linked(){return this._linked}set linked(e){this._linked=e,this.persistLinked()}save(){return this.storage.setItem(ve,this.id),this.storage.setItem(ke,this.secret),this.persistLinked(),this}persistLinked(){this.storage.setItem(Ce,this._linked?"1":"0")}}function Ie(){try{return function(){try{return null!==window.frameElement}catch(e){return!1}}()&&window.top?window.top.location:window.location}catch(e){return window.location}}function Me(){var e,t;return null!==(t=null===(e=null===window||void 0===window?void 0:window.matchMedia)||void 0===e?void 0:e.call(window,"(prefers-color-scheme: dark)").matches)&&void 0!==t&&t}function xe(){const 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 Se(e){var t,s,n="";if("string"==typeof e||"number"==typeof e)n+=e;else if("object"==typeof e)if(Array.isArray(e))for(t=0;t{this.items.delete(t),this.render()}}clear(){this.items.clear(),this.render()}render(){this.root&&(0,Le.XX)((0,Le.h)("div",null,(0,Le.h)(De,{darkMode:this.darkMode},Array.from(this.items.entries()).map((([e,t])=>(0,Le.h)(Ne,Object.assign({},t,{key:e})))))),this.root)}}const De=e=>(0,Le.h)("div",{class:Ae("-cbwsdk-snackbar-container")},(0,Le.h)("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;cursor: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}"),(0,Le.h)("div",{class:"-cbwsdk-snackbar"},e.children)),Ne=({autoExpand:e,message:t,menuItems:s})=>{const[n,i]=(0,Pe.J0)(!0),[r,a]=(0,Pe.J0)(null!=e&&e);(0,Pe.vJ)((()=>{const e=[window.setTimeout((()=>{i(!1)}),1),window.setTimeout((()=>{a(!0)}),1e4)];return()=>{e.forEach(window.clearTimeout)}}));return(0,Le.h)("div",{class:Ae("-cbwsdk-snackbar-instance",n&&"-cbwsdk-snackbar-instance-hidden",r&&"-cbwsdk-snackbar-instance-expanded")},(0,Le.h)("div",{class:"-cbwsdk-snackbar-instance-header",onClick:()=>{a(!r)}},(0,Le.h)("img",{src:"data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMzIiIGhlaWdodD0iMzIiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHBhdGggZD0iTTEuNDkyIDEwLjQxOWE4LjkzIDguOTMgMCAwMTguOTMtOC45M2gxMS4xNjNhOC45MyA4LjkzIDAgMDE4LjkzIDguOTN2MTEuMTYzYTguOTMgOC45MyAwIDAxLTguOTMgOC45M0gxMC40MjJhOC45MyA4LjkzIDAgMDEtOC45My04LjkzVjEwLjQxOXoiIGZpbGw9IiMxNjUyRjAiLz48cGF0aCBmaWxsLXJ1bGU9ImV2ZW5vZGQiIGNsaXAtcnVsZT0iZXZlbm9kZCIgZD0iTTEwLjQxOSAwSDIxLjU4QzI3LjMzNSAwIDMyIDQuNjY1IDMyIDEwLjQxOVYyMS41OEMzMiAyNy4zMzUgMjcuMzM1IDMyIDIxLjU4MSAzMkgxMC40MkM0LjY2NSAzMiAwIDI3LjMzNSAwIDIxLjU4MVYxMC40MkMwIDQuNjY1IDQuNjY1IDAgMTAuNDE5IDB6bTAgMS40ODhhOC45MyA4LjkzIDAgMDAtOC45MyA4LjkzdjExLjE2M2E4LjkzIDguOTMgMCAwMDguOTMgOC45M0gyMS41OGE4LjkzIDguOTMgMCAwMDguOTMtOC45M1YxMC40MmE4LjkzIDguOTMgMCAwMC04LjkzLTguOTNIMTAuNDJ6IiBmaWxsPSIjZmZmIi8+PHBhdGggZmlsbC1ydWxlPSJldmVub2RkIiBjbGlwLXJ1bGU9ImV2ZW5vZGQiIGQ9Ik0xNS45OTggMjYuMDQ5Yy01LjU0OSAwLTEwLjA0Ny00LjQ5OC0xMC4wNDctMTAuMDQ3IDAtNS41NDggNC40OTgtMTAuMDQ2IDEwLjA0Ny0xMC4wNDYgNS41NDggMCAxMC4wNDYgNC40OTggMTAuMDQ2IDEwLjA0NiAwIDUuNTQ5LTQuNDk4IDEwLjA0Ny0xMC4wNDYgMTAuMDQ3eiIgZmlsbD0iI2ZmZiIvPjxwYXRoIGQ9Ik0xMi43NjIgMTQuMjU0YzAtLjgyMi42NjctMS40ODkgMS40ODktMS40ODloMy40OTdjLjgyMiAwIDEuNDg4LjY2NiAxLjQ4OCAxLjQ4OXYzLjQ5N2MwIC44MjItLjY2NiAxLjQ4OC0xLjQ4OCAxLjQ4OGgtMy40OTdhMS40ODggMS40ODggMCAwMS0xLjQ4OS0xLjQ4OHYtMy40OTh6IiBmaWxsPSIjMTY1MkYwIi8+PC9zdmc+",class:"-cbwsdk-snackbar-instance-header-cblogo"})," ",(0,Le.h)("div",{class:"-cbwsdk-snackbar-instance-header-message"},t),(0,Le.h)("div",{class:"-gear-container"},!r&&(0,Le.h)("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},(0,Le.h)("circle",{cx:"12",cy:"12",r:"12",fill:"#F5F7F8"})),(0,Le.h)("img",{src:"data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTIiIGhlaWdodD0iMTIiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHBhdGggZD0iTTEyIDYuNzV2LTEuNWwtMS43Mi0uNTdjLS4wOC0uMjctLjE5LS41Mi0uMzItLjc3bC44MS0xLjYyLTEuMDYtMS4wNi0xLjYyLjgxYy0uMjQtLjEzLS41LS4yNC0uNzctLjMyTDYuNzUgMGgtMS41bC0uNTcgMS43MmMtLjI3LjA4LS41My4xOS0uNzcuMzJsLTEuNjItLjgxLTEuMDYgMS4wNi44MSAxLjYyYy0uMTMuMjQtLjI0LjUtLjMyLjc3TDAgNS4yNXYxLjVsMS43Mi41N2MuMDguMjcuMTkuNTMuMzIuNzdsLS44MSAxLjYyIDEuMDYgMS4wNiAxLjYyLS44MWMuMjQuMTMuNS4yMy43Ny4zMkw1LjI1IDEyaDEuNWwuNTctMS43MmMuMjctLjA4LjUyLS4xOS43Ny0uMzJsMS42Mi44MSAxLjA2LTEuMDYtLjgxLTEuNjJjLjEzLS4yNC4yMy0uNS4zMi0uNzdMMTIgNi43NXpNNiA4LjVhMi41IDIuNSAwIDAxMC01IDIuNSAyLjUgMCAwMTAgNXoiIGZpbGw9IiMwNTBGMTkiLz48L3N2Zz4=",class:"-gear-icon",title:"Expand"}))),s&&s.length>0&&(0,Le.h)("div",{class:"-cbwsdk-snackbar-instance-menu"},s.map(((e,t)=>(0,Le.h)("div",{class:Ae("-cbwsdk-snackbar-instance-menu-item",e.isRed&&"-cbwsdk-snackbar-instance-menu-item-is-red"),onClick:e.onClick,key:t},(0,Le.h)("svg",{width:e.svgWidth,height:e.svgHeight,viewBox:"0 0 10 11",fill:"none",xmlns:"http://www.w3.org/2000/svg"},(0,Le.h)("path",{"fill-rule":e.defaultFillRule,"clip-rule":e.defaultClipRule,d:e.path,fill:"#AAAAAA"})),(0,Le.h)("span",{class:Ae("-cbwsdk-snackbar-instance-menu-item-info",e.isRed&&"-cbwsdk-snackbar-instance-menu-item-info-is-red")},e.info))))))};class je{constructor(){this.attached=!1,this.snackbar=new Re}attach(){if(this.attached)throw new Error("Coinbase Wallet SDK UI is already attached");const e=document.documentElement,t=document.createElement("div");t.className="-cbwsdk-css-reset",e.appendChild(t),this.snackbar.attach(t),this.attached=!0,xe()}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 Te{constructor(){this.root=null,this.darkMode=Me()}attach(){const e=document.documentElement;this.root=document.createElement("div"),this.root.className="-cbwsdk-css-reset",e.appendChild(this.root),xe()}present(e){this.render(e)}clear(){this.render(null)}render(e){this.root&&((0,Le.XX)(null,this.root),e&&(0,Le.XX)((0,Le.h)(Oe,Object.assign({},e,{onDismiss:()=>{this.clear()},darkMode:this.darkMode})),this.root))}}const Oe=({title:e,buttonText:t,darkMode:s,onButtonClick:n,onDismiss:i})=>{const r=s?"dark":"light";return(0,Le.h)(De,{darkMode:s},(0,Le.h)("div",{class:"-cbwsdk-redirect-dialog"},(0,Le.h)("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}.-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}"),(0,Le.h)("div",{class:"-cbwsdk-redirect-dialog-backdrop",onClick:i}),(0,Le.h)("div",{class:Ae("-cbwsdk-redirect-dialog-box",r)},(0,Le.h)("p",null,e),(0,Le.h)("button",{onClick:n},t))))},_e="https://www.walletlink.org";class Ue{constructor(){this.attached=!1,this.redirectDialog=new Te}attach(){if(this.attached)throw new Error("Coinbase Wallet SDK UI is already attached");this.redirectDialog.attach(),this.attached=!0}redirectToCoinbaseWallet(e){const t=new URL("https://go.cb-w.com/walletlink");t.searchParams.append("redirect_url",Ie().href),e&&t.searchParams.append("wl_url",e);const s=document.createElement("a");s.target="cbw-opener",s.href=t.href,s.rel="noreferrer noopener",s.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 We{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?void 0:window.navigator)||void 0===t?void 0:t.userAgent),this.linkedUpdated=e=>{this.isLinked=e;const t=this.storage.getItem(le);if(e&&(this._session.linked=e),this.isUnlinkedErrorState=!1,t){const s=t.split(" "),n="true"===this.storage.getItem("IsStandaloneSigning");""===s[0]||e||!this._session.linked||n||(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]),We.accountRequestCallbackIds.size>0&&(Array.from(We.accountRequestCallbackIds.values()).forEach((t=>{this.invokeCallback(t,{method:"requestEthereumAccounts",result:[e]})})),We.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;const{session:s,ui:n,connection:i}=this.subscribe();this._session=s,this.connection=i,this.relayEventManager=new we,this.ui=n,this.ui.attach()}subscribe(){const e=Ee.load(this.storage)||Ee.create(this.storage),{linkAPIUrl:t}=this,s=new fe({session:e,linkAPIUrl:t,listener:this}),n=this.isMobileWeb?new Ue:new je;return s.connect(),{session:e,ui:n,connection:s}}resetAndReload(){this.connection.destroy().then((()=>{const e=Ee.load(this.storage);(null==e?void 0:e.id)===this._session.id&&n.clearAll(),document.location.reload()})).catch((e=>{}))}signEthereumTransaction(e){return this.sendRequest({method:"signEthereumTransaction",params:{fromAddress:e.fromAddress,toAddress:e.toAddress,weiValue:D(e.weiValue),data:P(e.data,!0),nonce:e.nonce,gasPriceInWei:e.gasPriceInWei?D(e.gasPriceInWei):null,maxFeePerGas:e.gasPriceInWei?D(e.gasPriceInWei):null,maxPriorityFeePerGas:e.gasPriceInWei?D(e.gasPriceInWei):null,gasLimit:e.gasLimit?D(e.gasLimit):null,chainId:e.chainId,shouldSubmit:!1}})}signAndSubmitEthereumTransaction(e){return this.sendRequest({method:"signEthereumTransaction",params:{fromAddress:e.fromAddress,toAddress:e.toAddress,weiValue:D(e.weiValue),data:P(e.data,!0),nonce:e.nonce,gasPriceInWei:e.gasPriceInWei?D(e.gasPriceInWei):null,maxFeePerGas:e.maxFeePerGas?D(e.maxFeePerGas):null,maxPriorityFeePerGas:e.maxPriorityFeePerGas?D(e.maxPriorityFeePerGas):null,gasLimit:e.gasLimit?D(e.gasLimit):null,chainId:e.chainId,shouldSubmit:!0}})}submitEthereumTransaction(e,t){return this.sendRequest({method:"submitEthereumTransaction",params:{signedTransaction:P(e,!0),chainId:t}})}getWalletLinkSession(){return this._session}sendRequest(e){let t=null;const s=S(8),n=n=>{this.publishWeb3RequestCanceledEvent(s),this.handleErrorResponse(s,e.method,n),null==t||t()};return new Promise(((i,r)=>{t=this.ui.showConnecting({isUnlinkedErrorState:this.isUnlinkedErrorState,onCancel:n,onResetConnection:this.resetAndReload}),this.relayEventManager.callbacks.set(s,(e=>{if(null==t||t(),he(e))return r(new Error(e.errorMessage));i(e)})),this.publishWeb3RequestEvent(s,e)}))}publishWeb3RequestEvent(e,t){const s={type:"WEB3_REQUEST",id:e,request:t};this.publishEvent("Web3Request",s,!0).then((e=>{})).catch((e=>{this.handleWeb3ResponseMessage(s.id,{method:t.method,errorMessage:e.message})})),this.isMobileWeb&&this.openCoinbaseWalletDeeplink(t.method)}openCoinbaseWalletDeeplink(e){if(this.ui instanceof Ue)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){const t={type:"WEB3_REQUEST_CANCELED",id:e};this.publishEvent("Web3RequestCanceled",t,!1).then()}publishEvent(e,t,s){return this.connection.publishEvent(e,t,s)}handleWeb3ResponseMessage(e,t){if("requestEthereumAccounts"===t.method)return We.accountRequestCallbackIds.forEach((e=>this.invokeCallback(e,t))),void We.accountRequestCallbackIds.clear();this.invokeCallback(e,t)}handleErrorResponse(e,t,s){var n;const i=null!==(n=null==s?void 0:s.message)&&void 0!==n?n:"Unspecified error message.";this.handleWeb3ResponseMessage(e,{method:t,errorMessage:i})}invokeCallback(e,t){const s=this.relayEventManager.callbacks.get(e);s&&(s(t),this.relayEventManager.callbacks.delete(e))}requestEthereumAccounts(){const{appName:e,appLogoUrl:t}=this.metadata,s={method:"requestEthereumAccounts",params:{appName:e,appLogoUrl:t}},n=S(8);return new Promise(((e,t)=>{this.relayEventManager.callbacks.set(n,(s=>{if(he(s))return t(new Error(s.errorMessage));e(s)})),We.accountRequestCallbackIds.add(n),this.publishWeb3RequestEvent(n,s)}))}watchAsset(e,t,s,n,i,r){const a={method:"watchAsset",params:{type:e,options:{address:t,symbol:s,decimals:n,image:i},chainId:r}};let o=null;const c=S(8),d=e=>{this.publishWeb3RequestCanceledEvent(c),this.handleErrorResponse(c,a.method,e),null==o||o()};return o=this.ui.showConnecting({isUnlinkedErrorState:this.isUnlinkedErrorState,onCancel:d,onResetConnection:this.resetAndReload}),new Promise(((e,t)=>{this.relayEventManager.callbacks.set(c,(s=>{if(null==o||o(),he(s))return t(new Error(s.errorMessage));e(s)})),this.publishWeb3RequestEvent(c,a)}))}addEthereumChain(e,t,s,n,i,r){const a={method:"addEthereumChain",params:{chainId:e,rpcUrls:t,blockExplorerUrls:n,chainName:i,iconUrls:s,nativeCurrency:r}};let o=null;const c=S(8),d=e=>{this.publishWeb3RequestCanceledEvent(c),this.handleErrorResponse(c,a.method,e),null==o||o()};return o=this.ui.showConnecting({isUnlinkedErrorState:this.isUnlinkedErrorState,onCancel:d,onResetConnection:this.resetAndReload}),new Promise(((e,t)=>{this.relayEventManager.callbacks.set(c,(s=>{if(null==o||o(),he(s))return t(new Error(s.errorMessage));e(s)})),this.publishWeb3RequestEvent(c,a)}))}switchEthereumChain(e,t){const s={method:"switchEthereumChain",params:Object.assign({chainId:e},{address:t})};let n=null;const i=S(8),r=e=>{this.publishWeb3RequestCanceledEvent(i),this.handleErrorResponse(i,s.method,e),null==n||n()};return n=this.ui.showConnecting({isUnlinkedErrorState:this.isUnlinkedErrorState,onCancel:r,onResetConnection:this.resetAndReload}),new Promise(((e,t)=>{this.relayEventManager.callbacks.set(i,(s=>(null==n||n(),he(s)&&s.errorCode?t(m.custom({code:s.errorCode,message:"Unrecognized chain ID. Try adding the chain using addEthereumChain first."})):he(s)?t(new Error(s.errorMessage)):void e(s)))),this.publishWeb3RequestEvent(i,s)}))}}We.accountRequestCallbackIds=new Set;const qe="DefaultChainId",Be="DefaultJsonRpcUrl";class Ve{constructor(e){this._relay=null,this._addresses=[],this.metadata=e.metadata,this._storage=new n("walletlink",_e),this.callback=e.callback||null;const t=this._storage.getItem(le);if(t){const e=t.split(" ");""!==e[0]&&(this._addresses=e.map((e=>W(e))))}this.initializeRelay()}getSession(){const e=this.initializeRelay(),{id:t,secret:s}=e.getWalletLinkSession();return{id:t,secret:s}}async handshake(){await this._eth_requestAccounts()}get selectedAddress(){return this._addresses[0]||void 0}get jsonRpcUrl(){var e;return null!==(e=this._storage.getItem(Be))&&void 0!==e?e:void 0}set jsonRpcUrl(e){this._storage.setItem(Be,e)}updateProviderInfo(e,t){var s;this.jsonRpcUrl=e;const n=this.getChainId();this._storage.setItem(qe,t.toString(10));B(t)!==n&&(null===(s=this.callback)||void 0===s||s.call(this,"chainChanged",N(t)))}async watchAsset(e){const t=Array.isArray(e)?e[0]:e;if(!t.type)throw g.invalidParams("Type is required");if("ERC20"!==(null==t?void 0:t.type))throw g.invalidParams(`Asset of type '${t.type}' is not supported`);if(!(null==t?void 0:t.options))throw g.invalidParams("Options are required");if(!(null==t?void 0:t.options.address))throw g.invalidParams("Address is required");const s=this.getChainId(),{address:n,symbol:i,image:r,decimals:a}=t.options,o=this.initializeRelay(),c=await o.watchAsset(t.type,n,i,a,r,null==s?void 0:s.toString());return!he(c)&&!!c.result}async addEthereumChain(e){var t,s;const n=e[0];if(0===(null===(t=n.rpcUrls)||void 0===t?void 0:t.length))throw g.invalidParams("please pass in at least 1 rpcUrl");if(!n.chainName||""===n.chainName.trim())throw g.invalidParams("chainName is a required field");if(!n.nativeCurrency)throw g.invalidParams("nativeCurrency is a required field");const i=Number.parseInt(n.chainId,16);if(i===this.getChainId())return!1;const r=this.initializeRelay(),{rpcUrls:a=[],blockExplorerUrls:o=[],chainName:c,iconUrls:d=[],nativeCurrency:l}=n,h=await r.addEthereumChain(i.toString(),a,d,o,c,l);if(he(h))return!1;if(!0===(null===(s=h.result)||void 0===s?void 0:s.isApproved))return this.updateProviderInfo(a[0],i),null;throw g.internal("unable to add ethereum chain")}async switchEthereumChain(e){const t=e[0],s=Number.parseInt(t.chainId,16),n=this.initializeRelay(),i=await n.switchEthereumChain(s.toString(10),this.selectedAddress||void 0);if(he(i))throw i;const r=i.result;return r.isApproved&&r.rpcUrl.length>0&&this.updateProviderInfo(r.rpcUrl,s),null}async cleanup(){this.callback=null,this._relay&&this._relay.resetAndReload(),this._storage.clear()}_setAddresses(e,t){var s;if(!Array.isArray(e))throw new Error("addresses is not an array");const n=e.map((e=>W(e)));JSON.stringify(n)!==JSON.stringify(this._addresses)&&(this._addresses=n,null===(s=this.callback)||void 0===s||s.call(this,"accountsChanged",n),this._storage.setItem(le,n.join(" ")))}async request(e){const 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 N(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 g.internal("No RPC URL set for chain");return se(e,this.jsonRpcUrl)}}_ensureKnownAddress(e){const t=W(e);if(!this._addresses.map((e=>W(e))).includes(t))throw new Error("Unknown Ethereum address")}_prepareTransactionParams(e){const t=e.from?W(e.from):this.selectedAddress;if(!t)throw new Error("Ethereum address is unavailable");this._ensureKnownAddress(t);return{fromAddress:t,toAddress:e.to?W(e.to):null,weiValue:null!=e.value?V(e.value):BigInt(0),data:e.data?q(e.data):Buffer.alloc(0),nonce:null!=e.nonce?B(e.nonce):null,gasPriceInWei:null!=e.gasPrice?V(e.gasPrice):null,maxFeePerGas:null!=e.maxFeePerGas?V(e.maxFeePerGas):null,maxPriorityFeePerGas:null!=e.maxPriorityFeePerGas?V(e.maxPriorityFeePerGas):null,gasLimit:null!=e.gas?V(e.gas):null,chainId:e.chainId?B(e.chainId):this.getChainId()}}async ecRecover(e){const{method:t,params:s}=e;if(!Array.isArray(s))throw g.invalidParams();const n=this.initializeRelay(),i=await n.sendRequest({method:"ethereumAddressFromSignedMessage",params:{message:R(s[0]),signature:R(s[1]),addPrefix:"personal_ecRecover"===t}});if(he(i))throw i;return i.result}getChainId(){var e;return Number.parseInt(null!==(e=this._storage.getItem(qe))&&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:N(this.getChainId())}),this._addresses;const s=this.initializeRelay(),n=await s.requestEthereumAccounts();if(he(n))throw n;if(!n.result)throw new Error("accounts received is empty");return this._setAddresses(n.result),null===(t=this.callback)||void 0===t||t.call(this,"connect",{chainId:N(this.getChainId())}),this._addresses}async personalSign({params:e}){if(!Array.isArray(e))throw g.invalidParams();const t=e[1],s=e[0];this._ensureKnownAddress(t);const n=this.initializeRelay(),i=await n.sendRequest({method:"signEthereumMessage",params:{address:W(t),message:R(s),addPrefix:!0,typedDataJson:null}});if(he(i))throw i;return i.result}async _eth_signTransaction(e){const t=this._prepareTransactionParams(e[0]||{}),s=this.initializeRelay(),n=await s.signEthereumTransaction(t);if(he(n))throw n;return n.result}async _eth_sendRawTransaction(e){const t=q(e[0]),s=this.initializeRelay(),n=await s.submitEthereumTransaction(t,this.getChainId());if(he(n))throw n;return n.result}async _eth_sendTransaction(e){const t=this._prepareTransactionParams(e[0]||{}),s=this.initializeRelay(),n=await s.signAndSubmitEthereumTransaction(t);if(he(n))throw n;return n.result}async signTypedData(e){const{method:t,params:s}=e;if(!Array.isArray(s))throw g.invalidParams();const n=s["eth_signTypedData_v1"===t?1:0],i=s["eth_signTypedData_v1"===t?0:1];this._ensureKnownAddress(n);const r=this.initializeRelay(),a=await r.sendRequest({method:"signEthereumMessage",params:{address:W(n),message:(o=i,P({eth_signTypedData_v1:de.hashForSignTypedDataLegacy,eth_signTypedData_v3:de.hashForSignTypedData_v3,eth_signTypedData_v4:de.hashForSignTypedData_v4,eth_signTypedData:de.hashForSignTypedData_v4}[t]({data:z(o)}),!0)),typedDataJson:JSON.stringify(i,null,2),addPrefix:!1}});var o;if(he(a))throw a;return a.result}initializeRelay(){return this._relay||(this._relay=new We({linkAPIUrl:_e,storage:this._storage,metadata:this.metadata,accountsCallback:this._setAddresses.bind(this),chainCallback:this.updateProviderInfo.bind(this)})),this._relay}}const ze="SignerType",He=new n("CBWSDK","SignerConfigurator");async function Ze(e){const{communicator:t,metadata:s,handshakeRequest:n,callback:i}=e;(async function(e,t,s){await e.onMessage((({event:e})=>"WalletLinkSessionRequest"===e));const n=new Ve({metadata:t,callback:s});e.postMessage({event:"WalletLinkUpdate",data:{session:n.getSession()}}),await n.handshake(),e.postMessage({event:"WalletLinkUpdate",data:{connected:!0}})})(t,s,i).catch((()=>{}));const r={id:crypto.randomUUID(),event:"selectSignerType",data:Object.assign(Object.assign({},e.preference),{handshakeRequest:n})},{data:a}=await t.postRequestAndWaitForResponse(r);return a}const{checkCrossOriginOpenerPolicy:Ke,getCrossOriginOpenerPolicy:Fe}=(()=>{let e;return{getCrossOriginOpenerPolicy:()=>void 0===e?"undefined":e,checkCrossOriginOpenerPolicy:async()=>{if("undefined"!=typeof window)try{const t=`${window.location.origin}${window.location.pathname}`,s=await fetch(t,{method:"HEAD"});if(!s.ok)throw new Error(`HTTP error! status: ${s.status}`);const n=s.headers.get("Cross-Origin-Opener-Policy");e=null!=n?n:"null"}catch(t){e="error"}else e="non-browser-env"}}})();function $e(e){const t=(window.innerWidth-420)/2+window.screenX,s=(window.innerHeight-540)/2+window.screenY;!function(e){const t={sdkName:te,sdkVersion:ee,origin:window.location.origin,coop:Fe()};for(const[s,n]of Object.entries(t))e.searchParams.append(s,n.toString())}(e);const n=window.open(e,"Smart Wallet",`width=420, height=540, left=${t}, top=${s}`);if(null==n||n.focus(),!n)throw g.internal("Pop up window failed to open");return n}class Ge{constructor({url:e="https://keys.coinbase.com/connect",metadata:t,preference:s}){this.popup=null,this.listeners=new Map,this.postMessage=async e=>{(await this.waitForPopupLoaded()).postMessage(e,this.url.origin)},this.postRequestAndWaitForResponse=async e=>{const t=this.onMessage((({requestId:t})=>t===e.id));return this.postMessage(e),await t},this.onMessage=async e=>new Promise(((t,s)=>{const n=s=>{if(s.origin!==this.url.origin)return;const i=s.data;e(i)&&(t(i),window.removeEventListener("message",n),this.listeners.delete(n))};window.addEventListener("message",n),this.listeners.set(n,{reject:s})})),this.disconnect=()=>{var e;(e=this.popup)&&!e.closed&&e.close(),this.popup=null,this.listeners.forEach((({reject:e},t)=>{e(m.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=$e(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:ee,metadata:this.metadata,preference:this.preference,location:window.location.toString()}})})).then((()=>{if(!this.popup)throw g.internal();return this.popup}))),this.url=new URL(e),this.metadata=t,this.preference=s}}function Je(e){const t=d(function(e){var t;if("string"==typeof e)return{message:e,code:i.internal};if(he(e)){const s=e.errorMessage,n=null!==(t=e.errorCode)&&void 0!==t?t:s.match(/(denied|rejected)/i)?r.userRejectedRequest:void 0;return Object.assign(Object.assign({},e),{message:s,code:n,data:{method:e.method}})}return e}(e),{shouldIncludeStack:!0}),s=new URL("https://docs.cloud.coinbase.com/wallet-sdk/docs/errors");return s.searchParams.set("version",ee),s.searchParams.set("code",t.code.toString()),s.searchParams.set("message",t.message),Object.assign(Object.assign({},t),{docUrl:s.href})}var Ye=s(74486);class Qe extends Ye.b{}var Xe=function(e,t){var s={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(s[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(n=Object.getOwnPropertySymbols(e);i{let s;switch(e){case"standard":default:return s=t,`data:image/svg+xml,%3Csvg width='${t}' height='${s}' 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 s=t,`data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='${t}' height='${s}' 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 s=(.1*t).toFixed(2),`data:image/svg+xml,%3Csvg width='${t}' height='${s}' 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 s=(.25*t).toFixed(2),`data:image/svg+xml,%3Csvg width='${t}' height='${s}' 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 s=(.1*t).toFixed(2),`data:image/svg+xml,%3Csvg width='${t}' height='${s}' 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 s=(.25*t).toFixed(2),`data:image/svg+xml,%3Csvg width='${t}' height='${s}' 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`}})(e,t)}storeLatestVersion(){new n("CBWSDK").setItem("VERSION",ee)}}}}]);