@solana-agent-wallet-adapter/cli 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (29) hide show
  1. package/LICENSE +15 -0
  2. package/README.md +107 -0
  3. package/dist/index.d.ts +3 -0
  4. package/dist/index.d.ts.map +1 -0
  5. package/dist/index.js +84340 -0
  6. package/dist/index.js.map +7 -0
  7. package/dist/wallet-host/.well-known/assetlinks.json +12 -0
  8. package/dist/wallet-host/assets/codex-B1ZwolvK.svg +3 -0
  9. package/dist/wallet-host/assets/index-D5ySS2CU.js +2143 -0
  10. package/dist/wallet-host/assets/index-ZynMhs1G.css +1 -0
  11. package/dist/wallet-host/assets/mobile-wallet-adapter-CqDJSDZ5.js +738 -0
  12. package/dist/wallet-host/assets/saturn-source-cutout-wQ5itUw-.png +0 -0
  13. package/dist/wallet-host/assets/solana-runtime-BhiDfU5_.js +20 -0
  14. package/dist/wallet-host/assets/wallet-standard-eoxEevjj.js +11 -0
  15. package/dist/wallet-host/icons/agentic-192.png +0 -0
  16. package/dist/wallet-host/icons/agentic-192.png.bak +0 -0
  17. package/dist/wallet-host/icons/agentic-512.png +0 -0
  18. package/dist/wallet-host/icons/agentic-512.png.bak +0 -0
  19. package/dist/wallet-host/icons/agentic.png +0 -0
  20. package/dist/wallet-host/icons/agentic.png.bak +0 -0
  21. package/dist/wallet-host/icons/agentic.svg +44 -0
  22. package/dist/wallet-host/icons/favicon-transparent.png +0 -0
  23. package/dist/wallet-host/index.html +45 -0
  24. package/dist/wallet-host/manifest.webmanifest +20 -0
  25. package/dist/wallet-host/og/agentic-multi-wallet-agent-signer-1200.png +0 -0
  26. package/dist/wallet-host/og/agentic-solana-multi-wallet-agent-signer-agentic-bigger.png +0 -0
  27. package/dist/wallet-host/og/agentic-solana-multi-wallet-agent-signer.png +0 -0
  28. package/dist/wallet-host/og/og-card.png +0 -0
  29. package/package.json +55 -0
@@ -0,0 +1,738 @@
1
+ var Ho=Object.defineProperty;var yn=e=>{throw TypeError(e)};var Wo=(e,t,n)=>t in e?Ho(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var M=(e,t,n)=>Wo(e,typeof t!="symbol"?t+"":t,n),Gt=(e,t,n)=>t.has(e)||yn("Cannot "+n);var s=(e,t,n)=>(Gt(e,t,"read from private field"),n?n.call(e):t.get(e)),u=(e,t,n)=>t.has(e)?yn("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,n),A=(e,t,n,o)=>(Gt(e,t,"write to private field"),o?o.call(e,n):t.set(e,n),n),k=(e,t,n)=>(Gt(e,t,"access private method"),n);var Jt=(e,t,n,o)=>({set _(i){A(e,t,i,n)},get _(){return s(e,t,o)}});import{c as Ko,S as dn,a as un,b as Un,d as zn,e as Fn,f as pe,g as fe,h as Be,i as En,r as Cn}from"./wallet-standard-eoxEevjj.js";const Vo="modulepreload",jo=function(e){return"/"+e},vn={},qo=function(t,n,o){let i=Promise.resolve();if(n&&n.length>0){document.getElementsByTagName("link");const r=document.querySelector("meta[property=csp-nonce]"),l=(r==null?void 0:r.nonce)||(r==null?void 0:r.getAttribute("nonce"));i=Promise.allSettled(n.map(c=>{if(c=jo(c),c in vn)return;vn[c]=!0;const d=c.endsWith(".css"),h=d?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${c}"]${h}`))return;const S=document.createElement("link");if(S.rel=d?"stylesheet":Vo,d||(S.as="script"),S.crossOrigin="",S.href=c,l&&S.setAttribute("nonce",l),document.head.appendChild(S),d)return new Promise((w,m)=>{S.addEventListener("load",w),S.addEventListener("error",()=>m(new Error(`Unable to preload CSS for ${c}`)))})}))}function a(r){const l=new Event("vite:preloadError",{cancelable:!0});if(l.payload=r,window.dispatchEvent(l),!l.defaultPrevented)throw r}return i.then(r=>{for(const l of r||[])l.status==="rejected"&&a(l.reason);return t().catch(a)})};let _n=!1;async function Za(e){const t=Zo(),n=e.logLevel;if(!t.isBrowser)return Oe(n,"register","SKIP reason=not_browser"),{registered:!1,skippedReason:"not_browser",environment:t};if(!t.supportsMwaMobileWeb)return Oe(n,"register",`SKIP reason=unsupported_environment android=${t.isAndroid} chrome=${t.isChrome} ios=${t.isIos} safari=${t.isSafari}`),{registered:!1,skippedReason:"unsupported_environment",environment:t};if(_n)return Oe(n,"register","SKIP reason=already_registered"),{registered:!1,skippedReason:"already_registered",environment:t};try{const o=await qo(()=>Promise.resolve().then(()=>Va),void 0);return o.registerMwa({appIdentity:{name:e.appIdentity.name,uri:e.appIdentity.uri,...e.appIdentity.icon!==void 0&&{icon:e.appIdentity.icon}},authorizationCache:o.createDefaultAuthorizationCache(),chains:Sn(e.chains),chainSelector:o.createDefaultChainSelector(),onWalletNotFound:o.createDefaultWalletNotFoundHandler()}),_n=!0,Oe(n,"register",`DONE android=${t.isAndroid} chrome=${t.isChrome} chains=${Sn(e.chains).join(",")}`),{registered:!0,environment:t}}catch(o){return Oe(n,"register",`FAIL error="${o instanceof Error?o.message:String(o)}"`),{registered:!1,skippedReason:"registration_failed",environment:t}}}function Zo(e=Qo()){const t=globalThis,n=t.window!==void 0&&t.document!==void 0,o=e.toLowerCase(),i=o.includes("android"),a=o.includes("chrome/")&&!o.includes("edg/")&&!o.includes("opr/")&&!o.includes("firefox/"),r=o.includes("iphone")||o.includes("ipad")||o.includes("ipod")||o.includes("macintosh")&&o.includes("mobile/"),l=o.includes("safari/")&&!o.includes("chrome/")&&!o.includes("crios/")&&!o.includes("fxios/")&&!o.includes("edgios/");return{isBrowser:n,isAndroid:i,isChrome:a,isIos:r,isSafari:l,supportsMwaMobileWeb:n&&i&&a,supportsIosWalletStandardFallback:n&&r,userAgent:e}}function Sn(e){return(e??["solana:devnet","solana:mainnet"]).map(n=>n==="solana:mainnet-beta"?"solana:mainnet":n)}function Qo(){const e=globalThis;return e.navigator===void 0?"":e.navigator.userAgent??""}function Oe(e,t,n){console.info(`[AgentMWA] ${t} | ${n}`)}function Go(e){return Object.freeze({...e,decode:(t,n=0)=>e.read(t,n)[0]})}var Jo=e=>Go({read(t,n){const o=n===0||n<=-t.byteLength?t:t.slice(n);if(o.length===0)return["",0];let i=o.findIndex(c=>c!==0);i=i===-1?o.length:i;const a=e[0].repeat(i);if(i===o.length)return[a,t.length];const r=o.slice(i).reduce((c,d)=>c*256n+BigInt(d),0n),l=Yo(r,e);return[a+l,t.length]}});function Yo(e,t){const n=BigInt(t.length),o=[];for(;e>0n;)o.unshift(t[Number(e%n)]),e/=n;return o.join("")}var Xo="123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz",$o=()=>Jo(Xo);const O={ERROR_ASSOCIATION_PORT_OUT_OF_RANGE:"ERROR_ASSOCIATION_PORT_OUT_OF_RANGE",ERROR_REFLECTOR_ID_OUT_OF_RANGE:"ERROR_REFLECTOR_ID_OUT_OF_RANGE",ERROR_FORBIDDEN_WALLET_BASE_URL:"ERROR_FORBIDDEN_WALLET_BASE_URL",ERROR_SECURE_CONTEXT_REQUIRED:"ERROR_SECURE_CONTEXT_REQUIRED",ERROR_SESSION_CLOSED:"ERROR_SESSION_CLOSED",ERROR_SESSION_TIMEOUT:"ERROR_SESSION_TIMEOUT",ERROR_WALLET_NOT_FOUND:"ERROR_WALLET_NOT_FOUND",ERROR_INVALID_PROTOCOL_VERSION:"ERROR_INVALID_PROTOCOL_VERSION",ERROR_BROWSER_NOT_SUPPORTED:"ERROR_BROWSER_NOT_SUPPORTED",ERROR_LOOPBACK_ACCESS_BLOCKED:"ERROR_LOOPBACK_ACCESS_BLOCKED",ERROR_ASSOCIATION_CANCELLED:"ERROR_ASSOCIATION_CANCELLED"};var x=class extends Error{constructor(...t){const[n,o,i]=t;super(o);M(this,"data");M(this,"code");this.code=n,this.data=i,this.name="SolanaMobileWalletAdapterError"}},hn=class extends Error{constructor(...t){const[n,o,i,a]=t;super(i);M(this,"data");M(this,"code");M(this,"jsonRpcMessageId");this.code=o,this.data=a,this.jsonRpcMessageId=n,this.name="SolanaMobileWalletAdapterProtocolError"}};function ei(e){return window.btoa(e)}function De(e,t){const n=window.btoa(String.fromCharCode.call(null,...e));return t?n.replace(/\+/g,"-").replace(/\//g,"_").replace(/=+$/,""):n}function mn(e){return new Uint8Array(window.atob(e).split("").map(t=>t.charCodeAt(0)))}async function ht(e,t){const n=await crypto.subtle.exportKey("raw",e),o=await crypto.subtle.sign({hash:"SHA-256",name:"ECDSA"},t,n),i=new Uint8Array(n.byteLength+o.byteLength);return i.set(new Uint8Array(n),0),i.set(new Uint8Array(o),n.byteLength),i}function ti(e){return $o().decode(e)}function ni(e){return ti(mn(e))}function oi(e){return Ko(e)}function ii(e){return ei(oi(e)).replace(/\+/g,"-").replace(/\//g,"_").replace(/=+$/,"")}const ai="solana:signTransactions",An="solana:cloneAuthorization";function Hn(e,t){return new Proxy({},{get(n,o){return o==="then"?null:(n[o]==null&&(n[o]=async function(i){const{method:a,params:r}=ri(o,i,e),l=await t(a,r);return a==="authorize"&&r.sign_in_payload&&!l.sign_in_result&&(l.sign_in_result=await li(r.sign_in_payload,l,t)),si(o,l,e)}),n[o])},defineProperty(){return!1},deleteProperty(){return!1}})}function ri(e,t,n){let o=t,i=e.toString().replace(/[A-Z]/g,a=>`_${a.toLowerCase()}`).toLowerCase();switch(e){case"authorize":{const a=o;let{chain:r}=a;if(n==="legacy"){switch(r){case"solana:testnet":r="testnet";break;case"solana:devnet":r="devnet";break;case"solana:mainnet":r="mainnet-beta";break;default:r=a.cluster}a.cluster=r,o=a}else{switch(r){case"testnet":case"devnet":r=`solana:${r}`;break;case"mainnet-beta":r="solana:mainnet";break}a.chain=r,o=a}}case"reauthorize":{const{auth_token:a,identity:r}=o;if(a)switch(n){case"legacy":i="reauthorize",o={auth_token:a,identity:r};break;default:i="authorize";break}break}}return{method:i,params:o}}function si(e,t,n){switch(e){case"getCapabilities":{const o=t;switch(n){case"legacy":{const i=[ai];return o.supports_clone_authorization===!0&&i.push(An),{...o,features:i}}case"v1":return{...o,supports_sign_and_send_transactions:!0,supports_clone_authorization:o.features.includes(An)}}}}return t}async function li(e,t,n){const o=e.domain??window.location.host,i=t.accounts[0].address,a=ii({...e,domain:o,address:ni(i)}),r=mn((await n("sign_messages",{addresses:[i],payloads:[a]})).signed_payloads[0]),l=De(r.slice(0,r.length-64)),c=De(r.slice(r.length-64));return{address:i,signed_message:l.length==0?a:l,signature:c}}function ci(e){if(e>=4294967296)throw new Error("Outbound sequence number overflow. The maximum sequence number is 32-bytes.");const t=new ArrayBuffer(4);return new DataView(t).setUint32(0,e,!1),new Uint8Array(t)}const an=12;async function di(e,t,n){const o=ci(t),i=new Uint8Array(an);crypto.getRandomValues(i);const a=await crypto.subtle.encrypt(Kn(o,i),n,new TextEncoder().encode(e)),r=new Uint8Array(o.byteLength+i.byteLength+a.byteLength);return r.set(new Uint8Array(o),0),r.set(new Uint8Array(i),o.byteLength),r.set(new Uint8Array(a),o.byteLength+i.byteLength),r}async function Wn(e,t){const n=e.slice(0,4),o=e.slice(4,4+an),i=e.slice(4+an),a=await crypto.subtle.decrypt(Kn(n,o),t,i);return ui().decode(a)}function Kn(e,t){return{additionalData:e,iv:t,name:"AES-GCM",tagLength:128}}let Yt;function ui(){return Yt===void 0&&(Yt=new TextDecoder("utf-8")),Yt}async function Vn(){return await crypto.subtle.generateKey({name:"ECDSA",namedCurve:"P-256"},!1,["sign"])}async function mt(){return await crypto.subtle.generateKey({name:"ECDH",namedCurve:"P-256"},!1,["deriveKey","deriveBits"])}function jn(e){let t="";const n=new Uint8Array(e),o=n.byteLength;for(let i=0;i<o;i++)t+=String.fromCharCode(n[i]);return window.btoa(t)}function hi(){return qn(49152+Math.floor(Math.random()*16384))}function qn(e){if(e<49152||e>65535)throw new x(O.ERROR_ASSOCIATION_PORT_OUT_OF_RANGE,`Association port number must be between 49152 and 65535. ${e} given.`,{port:e});return e}function Zn(e){return e.replace(/[/+=]/g,t=>({"/":"_","+":"-","=":"."})[t])}const mi="solana-wallet";function Rn(e){return e.replace(/(^\/+|\/+$)/g,"").split("/")}function Qn(e,t){let n=null;if(t){try{n=new URL(t)}catch{}if((n==null?void 0:n.protocol)!=="https:")throw new x(O.ERROR_FORBIDDEN_WALLET_BASE_URL,"Base URLs supplied by wallets must be valid `https` URLs")}n||(n=new URL(`${mi}:/`));const o=e.startsWith("/")?e:[...Rn(n.pathname),...Rn(e)].join("/");return new URL(o,n)}async function pi(e,t,n,o=["v1"]){const i=qn(t),a=jn(await crypto.subtle.exportKey("raw",e)),r=Qn("v1/associate/local",n);return r.searchParams.set("association",Zn(a)),r.searchParams.set("port",`${i}`),o.forEach(l=>{r.searchParams.set("v",l)}),r}async function fi(e,t,n,o,i=["v1"]){const a=jn(await crypto.subtle.exportKey("raw",e)),r=Qn("v1/associate/remote",o);return r.searchParams.set("association",Zn(a)),r.searchParams.set("reflector",`${t}`),r.searchParams.set("id",`${De(n,!0)}`),i.forEach(l=>{r.searchParams.set("v",l)}),r}async function Gn(e,t){const n=JSON.stringify(e),o=e.id;return di(n,o,t)}async function Jn(e,t){const n=await Wn(e,t),o=JSON.parse(n);if(Object.hasOwnProperty.call(o,"error"))throw new hn(o.id,o.error.code,o.error.message);return o}async function Yn(e,t,n){const[o,i]=await Promise.all([crypto.subtle.exportKey("raw",t),crypto.subtle.importKey("raw",e.slice(0,65),{name:"ECDH",namedCurve:"P-256"},!1,[])]),a=await crypto.subtle.deriveBits({name:"ECDH",public:i},n,256),r=await crypto.subtle.importKey("raw",a,"HKDF",!1,["deriveKey"]);return await crypto.subtle.deriveKey({name:"HKDF",hash:"SHA-256",salt:new Uint8Array(o),info:new Uint8Array},r,{name:"AES-GCM",length:128},!1,["encrypt","decrypt"])}async function Xn(e,t){const n=await Wn(e,t),o=JSON.parse(n);let i="legacy";if(Object.hasOwnProperty.call(o,"v"))switch(o.v){case 1:case"1":case"v1":i="v1";break;case"legacy":i="legacy";break;default:throw new x(O.ERROR_INVALID_PROTOCOL_VERSION,`Unknown/unsupported protocol version: ${o.v}`)}return{protocol_version:i}}const gt={Firefox:0,Other:1};function gi(){return navigator.userAgent.indexOf("Firefox/")!==-1?gt.Firefox:gt.Other}function wi(){return new Promise((e,t)=>{function n(){clearTimeout(i),window.removeEventListener("blur",o)}function o(){n(),e()}window.addEventListener("blur",o);const i=setTimeout(()=>{n(),t()},3e3)})}let ke=null;function bi(e){ke==null&&(ke=document.createElement("iframe"),ke.style.display="none",document.body.appendChild(ke)),ke.contentWindow.location.href=e.toString()}async function yi(e){if(e.protocol==="https:")window.location.assign(e);else try{const t=gi();switch(t){case gt.Firefox:bi(e);break;case gt.Other:{const n=wi();window.location.assign(e),await n;break}default:}}catch{throw new x(O.ERROR_WALLET_NOT_FOUND,"Found no installed wallet that supports the mobile wallet protocol.")}}async function Ei(e,t){const n=hi();return await yi(await pi(e,n,t)),n}const wt={retryDelayScheduleMs:[150,150,200,500,500,750,750,1e3],timeoutMs:3e4},$n="com.solana.mobilewalletadapter.v1",Ln="com.solana.mobilewalletadapter.v1.base64";function eo(){if(typeof window>"u"||window.isSecureContext!==!0)throw new x(O.ERROR_SECURE_CONTEXT_REQUIRED,"The mobile wallet adapter protocol must be used in a secure context (`https`).")}function to(e){let t;try{t=new URL(e)}catch{throw new x(O.ERROR_FORBIDDEN_WALLET_BASE_URL,"Invalid base URL supplied by wallet")}if(t.protocol!=="https:")throw new x(O.ERROR_FORBIDDEN_WALLET_BASE_URL,"Base URLs supplied by wallets must be valid `https` URLs")}function bt(e){return new DataView(e).getUint32(0,!1)}function Ci(e){const t=new Uint8Array(e),n=e.byteLength,o=10;let i=0,a=0,r;do{if(a>=n||a>o)throw new RangeError("Failed to decode varint");r=t[a++],i|=(r&127)<<7*a}while(r>=128);return{value:i,offset:a}}function vi(e){const{value:t,offset:n}=Ci(e);return new Uint8Array(e.slice(n,n+t))}async function _i(e){eo();const t=await Vn(),n=`ws://localhost:${await Ei(t.publicKey,e==null?void 0:e.baseUri)}/solana-wallet`;let o;const i=(()=>{const S=[...wt.retryDelayScheduleMs];return()=>S.length>1?S.shift():S[0]})();let a=1,r=0,l={__type:"disconnected"},c,d=!1,h;return{close:()=>{c.close(),h()},wallet:new Promise((S,w)=>{const m={},_=async()=>{if(l.__type!=="connecting"){console.warn(`Expected adapter state to be \`connecting\` at the moment the websocket opens. Got \`${l.__type}\`.`);return}c.removeEventListener("open",_);const{associationKeypair:g}=l,y=await mt();c.send(await ht(y.publicKey,g.privateKey)),l={__type:"hello_req_sent",associationPublicKey:g.publicKey,ecdhPrivateKey:y.privateKey}},E=g=>{g.wasClean?l={__type:"disconnected"}:w(new x(O.ERROR_SESSION_CLOSED,`The wallet session dropped unexpectedly (${g.code}: ${g.reason}).`,{closeEvent:g})),v()},L=async g=>{v(),Date.now()-o>=wt.timeoutMs?w(new x(O.ERROR_SESSION_TIMEOUT,`Failed to connect to the wallet websocket at ${n}.`)):(await new Promise(y=>{const C=i();b=window.setTimeout(y,C)}),p())},f=async g=>{const y=await g.data.arrayBuffer();switch(l.__type){case"connecting":{if(y.byteLength!==0)throw new Error("Encountered unexpected message while connecting");const C=await mt();c.send(await ht(C.publicKey,t.privateKey)),l={__type:"hello_req_sent",associationPublicKey:t.publicKey,ecdhPrivateKey:C.privateKey};break}case"connected":try{const C=bt(y.slice(0,4));if(C!==r+1)throw new Error("Encrypted message has invalid sequence number");r=C;const R=await Jn(y,l.sharedSecret),T=m[R.id];delete m[R.id],T.resolve(R.result)}catch(C){if(C instanceof hn){const R=m[C.jsonRpcMessageId];delete m[C.jsonRpcMessageId],R.reject(C)}else throw C}break;case"hello_req_sent":{if(y.byteLength===0){const N=await mt();c.send(await ht(N.publicKey,t.privateKey)),l={__type:"hello_req_sent",associationPublicKey:t.publicKey,ecdhPrivateKey:N.privateKey};break}const C=await Yn(y,l.associationPublicKey,l.ecdhPrivateKey),R=y.slice(65),T=R.byteLength!==0?await(async()=>{const N=bt(R.slice(0,4));if(N!==r+1)throw new Error("Encrypted message has invalid sequence number");return r=N,Xn(R,C)})():{protocol_version:"legacy"};l={__type:"connected",sharedSecret:C,sessionProperties:T};const U=Hn(T.protocol_version,async(N,G)=>{const F=a++;return c.send(await Gn({id:F,jsonrpc:"2.0",method:N,params:G??{}},C)),new Promise((lt,xe)=>{m[F]={resolve(Ne){switch(N){case"authorize":case"reauthorize":{const{wallet_uri_base:ct}=Ne;if(ct!=null)try{to(ct)}catch(Fo){xe(Fo);return}break}}lt(Ne)},reject:xe}})});d=!0;try{S(U)}catch(N){w(N)}break}}};h=()=>{c.removeEventListener("message",f),v(),d||w(new x(O.ERROR_SESSION_CLOSED,"The wallet session was closed before connection.",{closeEvent:new CloseEvent("socket was closed before connection")}))};let v,b;const p=()=>{v&&v(),l={__type:"connecting",associationKeypair:t},o===void 0&&(o=Date.now()),c=new WebSocket(n,[$n]),c.addEventListener("open",_),c.addEventListener("close",E),c.addEventListener("error",L),c.addEventListener("message",f),v=()=>{window.clearTimeout(b),c.removeEventListener("open",_),c.removeEventListener("close",E),c.removeEventListener("error",L),c.removeEventListener("message",f)}};p()})}}async function Si(e){eo();const t=await Vn(),n=`wss://${e==null?void 0:e.remoteHostAuthority}/reflect`;let o;const i=(()=>{const E=[...wt.retryDelayScheduleMs];return()=>E.length>1?E.shift():E[0]})();let a=1,r=0,l,c={__type:"disconnected"},d,h;const S=async E=>l=="base64"?mn(await E.data).buffer:await E.data.arrayBuffer(),w=await new Promise((E,L)=>{const f=async()=>{if(c.__type!=="connecting"){console.warn(`Expected adapter state to be \`connecting\` at the moment the websocket opens. Got \`${c.__type}\`.`);return}d.protocol.includes(Ln)?l="base64":l="binary",d.removeEventListener("open",f)},v=C=>{C.wasClean?c={__type:"disconnected"}:L(new x(O.ERROR_SESSION_CLOSED,`The wallet session dropped unexpectedly (${C.code}: ${C.reason}).`,{closeEvent:C})),h()},b=async C=>{h(),Date.now()-o>=wt.timeoutMs?L(new x(O.ERROR_SESSION_TIMEOUT,`Failed to connect to the wallet websocket at ${n}.`)):(await new Promise(R=>{const T=i();g=window.setTimeout(R,T)}),y())},p=async C=>{const R=await S(C);if(c.__type==="connecting"){if(R.byteLength==0)throw new Error("Encountered unexpected message while connecting");const T=vi(R);c={__type:"reflector_id_received",reflectorId:T};const U=await fi(t.publicKey,e.remoteHostAuthority,T,e==null?void 0:e.baseUri);d.removeEventListener("message",p),E(U)}};let g;const y=()=>{h&&h(),c={__type:"connecting",associationKeypair:t},o===void 0&&(o=Date.now()),d=new WebSocket(n,[$n,Ln]),d.addEventListener("open",f),d.addEventListener("close",v),d.addEventListener("error",b),d.addEventListener("message",p),h=()=>{window.clearTimeout(g),d.removeEventListener("open",f),d.removeEventListener("close",v),d.removeEventListener("error",b),d.removeEventListener("message",p)}};y()});let m=!1,_;return{associationUrl:w,close:()=>{d.close(),_()},wallet:new Promise((E,L)=>{const f={},v=async b=>{const p=await S(b);switch(c.__type){case"reflector_id_received":{if(p.byteLength!==0)throw new Error("Encountered unexpected message while awaiting reflection");const g=await mt(),y=await ht(g.publicKey,t.privateKey);l=="base64"?d.send(De(y)):d.send(y),c={__type:"hello_req_sent",associationPublicKey:t.publicKey,ecdhPrivateKey:g.privateKey};break}case"connected":try{const g=bt(p.slice(0,4));if(g!==r+1)throw new Error("Encrypted message has invalid sequence number");r=g;const y=await Jn(p,c.sharedSecret),C=f[y.id];delete f[y.id],C.resolve(y.result)}catch(g){if(g instanceof hn){const y=f[g.jsonRpcMessageId];delete f[g.jsonRpcMessageId],y.reject(g)}else throw g}break;case"hello_req_sent":{const g=await Yn(p,c.associationPublicKey,c.ecdhPrivateKey),y=p.slice(65),C=y.byteLength!==0?await(async()=>{const T=bt(y.slice(0,4));if(T!==r+1)throw new Error("Encrypted message has invalid sequence number");return r=T,Xn(y,g)})():{protocol_version:"legacy"};c={__type:"connected",sharedSecret:g,sessionProperties:C};const R=Hn(C.protocol_version,async(T,U)=>{const N=a++,G=await Gn({id:N,jsonrpc:"2.0",method:T,params:U??{}},g);return l=="base64"?d.send(De(G)):d.send(G),new Promise((F,lt)=>{f[N]={resolve(xe){switch(T){case"authorize":case"reauthorize":{const{wallet_uri_base:Ne}=xe;if(Ne!=null)try{to(Ne)}catch(ct){lt(ct);return}break}}F(xe)},reject:lt}})});m=!0;try{E(R)}catch(T){L(T)}break}}};d.addEventListener("message",v),_=()=>{d.removeEventListener("message",v),h(),m||L(new x(O.ERROR_SESSION_CLOSED,"The wallet session was closed before connection.",{closeEvent:new CloseEvent("socket was closed before connection")}))}})}}var at={},Ai=function(){return typeof Promise=="function"&&Promise.prototype&&Promise.prototype.then},no={},W={};let pn;const Ri=[0,26,44,70,100,134,172,196,242,292,346,404,466,532,581,655,733,815,901,991,1085,1156,1258,1364,1474,1588,1706,1828,1921,2051,2185,2323,2465,2611,2761,2876,3034,3196,3362,3532,3706];W.getSymbolSize=function(t){if(!t)throw new Error('"version" cannot be null or undefined');if(t<1||t>40)throw new Error('"version" should be in range from 1 to 40');return t*4+17};W.getSymbolTotalCodewords=function(t){return Ri[t]};W.getBCHDigit=function(e){let t=0;for(;e!==0;)t++,e>>>=1;return t};W.setToSJISFunction=function(t){if(typeof t!="function")throw new Error('"toSJISFunc" is not a valid function.');pn=t};W.isKanjiModeEnabled=function(){return typeof pn<"u"};W.toSJIS=function(t){return pn(t)};var jt={};(function(e){e.L={bit:1},e.M={bit:0},e.Q={bit:3},e.H={bit:2};function t(n){if(typeof n!="string")throw new Error("Param is not a string");switch(n.toLowerCase()){case"l":case"low":return e.L;case"m":case"medium":return e.M;case"q":case"quartile":return e.Q;case"h":case"high":return e.H;default:throw new Error("Unknown EC Level: "+n)}}e.isValid=function(o){return o&&typeof o.bit<"u"&&o.bit>=0&&o.bit<4},e.from=function(o,i){if(e.isValid(o))return o;try{return t(o)}catch{return i}}})(jt);function oo(){this.buffer=[],this.length=0}oo.prototype={get:function(e){const t=Math.floor(e/8);return(this.buffer[t]>>>7-e%8&1)===1},put:function(e,t){for(let n=0;n<t;n++)this.putBit((e>>>t-n-1&1)===1)},getLengthInBits:function(){return this.length},putBit:function(e){const t=Math.floor(this.length/8);this.buffer.length<=t&&this.buffer.push(0),e&&(this.buffer[t]|=128>>>this.length%8),this.length++}};var Li=oo;function rt(e){if(!e||e<1)throw new Error("BitMatrix size must be defined and greater than 0");this.size=e,this.data=new Uint8Array(e*e),this.reservedBit=new Uint8Array(e*e)}rt.prototype.set=function(e,t,n,o){const i=e*this.size+t;this.data[i]=n,o&&(this.reservedBit[i]=!0)};rt.prototype.get=function(e,t){return this.data[e*this.size+t]};rt.prototype.xor=function(e,t,n){this.data[e*this.size+t]^=n};rt.prototype.isReserved=function(e,t){return this.reservedBit[e*this.size+t]};var Ti=rt,io={};(function(e){const t=W.getSymbolSize;e.getRowColCoords=function(o){if(o===1)return[];const i=Math.floor(o/7)+2,a=t(o),r=a===145?26:Math.ceil((a-13)/(2*i-2))*2,l=[a-7];for(let c=1;c<i-1;c++)l[c]=l[c-1]-r;return l.push(6),l.reverse()},e.getPositions=function(o){const i=[],a=e.getRowColCoords(o),r=a.length;for(let l=0;l<r;l++)for(let c=0;c<r;c++)l===0&&c===0||l===0&&c===r-1||l===r-1&&c===0||i.push([a[l],a[c]]);return i}})(io);var ao={};const Mi=W.getSymbolSize,Tn=7;ao.getPositions=function(t){const n=Mi(t);return[[0,0],[n-Tn,0],[0,n-Tn]]};var ro={};(function(e){e.Patterns={PATTERN000:0,PATTERN001:1,PATTERN010:2,PATTERN011:3,PATTERN100:4,PATTERN101:5,PATTERN110:6,PATTERN111:7};const t={N1:3,N2:3,N3:40,N4:10};e.isValid=function(i){return i!=null&&i!==""&&!isNaN(i)&&i>=0&&i<=7},e.from=function(i){return e.isValid(i)?parseInt(i,10):void 0},e.getPenaltyN1=function(i){const a=i.size;let r=0,l=0,c=0,d=null,h=null;for(let S=0;S<a;S++){l=c=0,d=h=null;for(let w=0;w<a;w++){let m=i.get(S,w);m===d?l++:(l>=5&&(r+=t.N1+(l-5)),d=m,l=1),m=i.get(w,S),m===h?c++:(c>=5&&(r+=t.N1+(c-5)),h=m,c=1)}l>=5&&(r+=t.N1+(l-5)),c>=5&&(r+=t.N1+(c-5))}return r},e.getPenaltyN2=function(i){const a=i.size;let r=0;for(let l=0;l<a-1;l++)for(let c=0;c<a-1;c++){const d=i.get(l,c)+i.get(l,c+1)+i.get(l+1,c)+i.get(l+1,c+1);(d===4||d===0)&&r++}return r*t.N2},e.getPenaltyN3=function(i){const a=i.size;let r=0,l=0,c=0;for(let d=0;d<a;d++){l=c=0;for(let h=0;h<a;h++)l=l<<1&2047|i.get(d,h),h>=10&&(l===1488||l===93)&&r++,c=c<<1&2047|i.get(h,d),h>=10&&(c===1488||c===93)&&r++}return r*t.N3},e.getPenaltyN4=function(i){let a=0;const r=i.data.length;for(let c=0;c<r;c++)a+=i.data[c];return Math.abs(Math.ceil(a*100/r/5)-10)*t.N4};function n(o,i,a){switch(o){case e.Patterns.PATTERN000:return(i+a)%2===0;case e.Patterns.PATTERN001:return i%2===0;case e.Patterns.PATTERN010:return a%3===0;case e.Patterns.PATTERN011:return(i+a)%3===0;case e.Patterns.PATTERN100:return(Math.floor(i/2)+Math.floor(a/3))%2===0;case e.Patterns.PATTERN101:return i*a%2+i*a%3===0;case e.Patterns.PATTERN110:return(i*a%2+i*a%3)%2===0;case e.Patterns.PATTERN111:return(i*a%3+(i+a)%2)%2===0;default:throw new Error("bad maskPattern:"+o)}}e.applyMask=function(i,a){const r=a.size;for(let l=0;l<r;l++)for(let c=0;c<r;c++)a.isReserved(c,l)||a.xor(c,l,n(i,c,l))},e.getBestMask=function(i,a){const r=Object.keys(e.Patterns).length;let l=0,c=1/0;for(let d=0;d<r;d++){a(d),e.applyMask(d,i);const h=e.getPenaltyN1(i)+e.getPenaltyN2(i)+e.getPenaltyN3(i)+e.getPenaltyN4(i);e.applyMask(d,i),h<c&&(c=h,l=d)}return l}})(ro);var qt={};const ne=jt,dt=[1,1,1,1,1,1,1,1,1,1,2,2,1,2,2,4,1,2,4,4,2,4,4,4,2,4,6,5,2,4,6,6,2,5,8,8,4,5,8,8,4,5,8,11,4,8,10,11,4,9,12,16,4,9,16,16,6,10,12,18,6,10,17,16,6,11,16,19,6,13,18,21,7,14,21,25,8,16,20,25,8,17,23,25,9,17,23,34,9,18,25,30,10,20,27,32,12,21,29,35,12,23,34,37,12,25,34,40,13,26,35,42,14,28,38,45,15,29,40,48,16,31,43,51,17,33,45,54,18,35,48,57,19,37,51,60,19,38,53,63,20,40,56,66,21,43,59,70,22,45,62,74,24,47,65,77,25,49,68,81],ut=[7,10,13,17,10,16,22,28,15,26,36,44,20,36,52,64,26,48,72,88,36,64,96,112,40,72,108,130,48,88,132,156,60,110,160,192,72,130,192,224,80,150,224,264,96,176,260,308,104,198,288,352,120,216,320,384,132,240,360,432,144,280,408,480,168,308,448,532,180,338,504,588,196,364,546,650,224,416,600,700,224,442,644,750,252,476,690,816,270,504,750,900,300,560,810,960,312,588,870,1050,336,644,952,1110,360,700,1020,1200,390,728,1050,1260,420,784,1140,1350,450,812,1200,1440,480,868,1290,1530,510,924,1350,1620,540,980,1440,1710,570,1036,1530,1800,570,1064,1590,1890,600,1120,1680,1980,630,1204,1770,2100,660,1260,1860,2220,720,1316,1950,2310,750,1372,2040,2430];qt.getBlocksCount=function(t,n){switch(n){case ne.L:return dt[(t-1)*4+0];case ne.M:return dt[(t-1)*4+1];case ne.Q:return dt[(t-1)*4+2];case ne.H:return dt[(t-1)*4+3];default:return}};qt.getTotalCodewordsCount=function(t,n){switch(n){case ne.L:return ut[(t-1)*4+0];case ne.M:return ut[(t-1)*4+1];case ne.Q:return ut[(t-1)*4+2];case ne.H:return ut[(t-1)*4+3];default:return}};var so={},Zt={};const Pe=new Uint8Array(512),yt=new Uint8Array(256);(function(){let t=1;for(let n=0;n<255;n++)Pe[n]=t,yt[t]=n,t<<=1,t&256&&(t^=285);for(let n=255;n<512;n++)Pe[n]=Pe[n-255]})();Zt.log=function(t){if(t<1)throw new Error("log("+t+")");return yt[t]};Zt.exp=function(t){return Pe[t]};Zt.mul=function(t,n){return t===0||n===0?0:Pe[yt[t]+yt[n]]};(function(e){const t=Zt;e.mul=function(o,i){const a=new Uint8Array(o.length+i.length-1);for(let r=0;r<o.length;r++)for(let l=0;l<i.length;l++)a[r+l]^=t.mul(o[r],i[l]);return a},e.mod=function(o,i){let a=new Uint8Array(o);for(;a.length-i.length>=0;){const r=a[0];for(let c=0;c<i.length;c++)a[c]^=t.mul(i[c],r);let l=0;for(;l<a.length&&a[l]===0;)l++;a=a.slice(l)}return a},e.generateECPolynomial=function(o){let i=new Uint8Array([1]);for(let a=0;a<o;a++)i=e.mul(i,new Uint8Array([1,t.exp(a)]));return i}})(so);const lo=so;function fn(e){this.genPoly=void 0,this.degree=e,this.degree&&this.initialize(this.degree)}fn.prototype.initialize=function(t){this.degree=t,this.genPoly=lo.generateECPolynomial(this.degree)};fn.prototype.encode=function(t){if(!this.genPoly)throw new Error("Encoder not initialized");const n=new Uint8Array(t.length+this.degree);n.set(t);const o=lo.mod(n,this.genPoly),i=this.degree-o.length;if(i>0){const a=new Uint8Array(this.degree);return a.set(o,i),a}return o};var Ii=fn,co={},le={},gn={};gn.isValid=function(t){return!isNaN(t)&&t>=1&&t<=40};var j={};const uo="[0-9]+",xi="[A-Z $%*+\\-./:]+";let Ue="(?:[u3000-u303F]|[u3040-u309F]|[u30A0-u30FF]|[uFF00-uFFEF]|[u4E00-u9FAF]|[u2605-u2606]|[u2190-u2195]|u203B|[u2010u2015u2018u2019u2025u2026u201Cu201Du2225u2260]|[u0391-u0451]|[u00A7u00A8u00B1u00B4u00D7u00F7])+";Ue=Ue.replace(/u/g,"\\u");const Ni="(?:(?![A-Z0-9 $%*+\\-./:]|"+Ue+`)(?:.|[\r
2
+ ]))+`;j.KANJI=new RegExp(Ue,"g");j.BYTE_KANJI=new RegExp("[^A-Z0-9 $%*+\\-./:]+","g");j.BYTE=new RegExp(Ni,"g");j.NUMERIC=new RegExp(uo,"g");j.ALPHANUMERIC=new RegExp(xi,"g");const Oi=new RegExp("^"+Ue+"$"),ki=new RegExp("^"+uo+"$"),Pi=new RegExp("^[A-Z0-9 $%*+\\-./:]+$");j.testKanji=function(t){return Oi.test(t)};j.testNumeric=function(t){return ki.test(t)};j.testAlphanumeric=function(t){return Pi.test(t)};(function(e){const t=gn,n=j;e.NUMERIC={id:"Numeric",bit:1,ccBits:[10,12,14]},e.ALPHANUMERIC={id:"Alphanumeric",bit:2,ccBits:[9,11,13]},e.BYTE={id:"Byte",bit:4,ccBits:[8,16,16]},e.KANJI={id:"Kanji",bit:8,ccBits:[8,10,12]},e.MIXED={bit:-1},e.getCharCountIndicator=function(a,r){if(!a.ccBits)throw new Error("Invalid mode: "+a);if(!t.isValid(r))throw new Error("Invalid version: "+r);return r>=1&&r<10?a.ccBits[0]:r<27?a.ccBits[1]:a.ccBits[2]},e.getBestModeForData=function(a){return n.testNumeric(a)?e.NUMERIC:n.testAlphanumeric(a)?e.ALPHANUMERIC:n.testKanji(a)?e.KANJI:e.BYTE},e.toString=function(a){if(a&&a.id)return a.id;throw new Error("Invalid mode")},e.isValid=function(a){return a&&a.bit&&a.ccBits};function o(i){if(typeof i!="string")throw new Error("Param is not a string");switch(i.toLowerCase()){case"numeric":return e.NUMERIC;case"alphanumeric":return e.ALPHANUMERIC;case"kanji":return e.KANJI;case"byte":return e.BYTE;default:throw new Error("Unknown mode: "+i)}}e.from=function(a,r){if(e.isValid(a))return a;try{return o(a)}catch{return r}}})(le);(function(e){const t=W,n=qt,o=jt,i=le,a=gn,r=7973,l=t.getBCHDigit(r);function c(w,m,_){for(let E=1;E<=40;E++)if(m<=e.getCapacity(E,_,w))return E}function d(w,m){return i.getCharCountIndicator(w,m)+4}function h(w,m){let _=0;return w.forEach(function(E){const L=d(E.mode,m);_+=L+E.getBitsLength()}),_}function S(w,m){for(let _=1;_<=40;_++)if(h(w,_)<=e.getCapacity(_,m,i.MIXED))return _}e.from=function(m,_){return a.isValid(m)?parseInt(m,10):_},e.getCapacity=function(m,_,E){if(!a.isValid(m))throw new Error("Invalid QR Code version");typeof E>"u"&&(E=i.BYTE);const L=t.getSymbolTotalCodewords(m),f=n.getTotalCodewordsCount(m,_),v=(L-f)*8;if(E===i.MIXED)return v;const b=v-d(E,m);switch(E){case i.NUMERIC:return Math.floor(b/10*3);case i.ALPHANUMERIC:return Math.floor(b/11*2);case i.KANJI:return Math.floor(b/13);case i.BYTE:default:return Math.floor(b/8)}},e.getBestVersionForData=function(m,_){let E;const L=o.from(_,o.M);if(Array.isArray(m)){if(m.length>1)return S(m,L);if(m.length===0)return 1;E=m[0]}else E=m;return c(E.mode,E.getLength(),L)},e.getEncodedBits=function(m){if(!a.isValid(m)||m<7)throw new Error("Invalid QR Code version");let _=m<<12;for(;t.getBCHDigit(_)-l>=0;)_^=r<<t.getBCHDigit(_)-l;return m<<12|_}})(co);var ho={};const rn=W,mo=1335,Bi=21522,Mn=rn.getBCHDigit(mo);ho.getEncodedBits=function(t,n){const o=t.bit<<3|n;let i=o<<10;for(;rn.getBCHDigit(i)-Mn>=0;)i^=mo<<rn.getBCHDigit(i)-Mn;return(o<<10|i)^Bi};var po={};const Di=le;function Le(e){this.mode=Di.NUMERIC,this.data=e.toString()}Le.getBitsLength=function(t){return 10*Math.floor(t/3)+(t%3?t%3*3+1:0)};Le.prototype.getLength=function(){return this.data.length};Le.prototype.getBitsLength=function(){return Le.getBitsLength(this.data.length)};Le.prototype.write=function(t){let n,o,i;for(n=0;n+3<=this.data.length;n+=3)o=this.data.substr(n,3),i=parseInt(o,10),t.put(i,10);const a=this.data.length-n;a>0&&(o=this.data.substr(n),i=parseInt(o,10),t.put(i,a*3+1))};var Ui=Le;const zi=le,Xt=["0","1","2","3","4","5","6","7","8","9","A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z"," ","$","%","*","+","-",".","/",":"];function Te(e){this.mode=zi.ALPHANUMERIC,this.data=e}Te.getBitsLength=function(t){return 11*Math.floor(t/2)+6*(t%2)};Te.prototype.getLength=function(){return this.data.length};Te.prototype.getBitsLength=function(){return Te.getBitsLength(this.data.length)};Te.prototype.write=function(t){let n;for(n=0;n+2<=this.data.length;n+=2){let o=Xt.indexOf(this.data[n])*45;o+=Xt.indexOf(this.data[n+1]),t.put(o,11)}this.data.length%2&&t.put(Xt.indexOf(this.data[n]),6)};var Fi=Te;const Hi=le;function Me(e){this.mode=Hi.BYTE,typeof e=="string"?this.data=new TextEncoder().encode(e):this.data=new Uint8Array(e)}Me.getBitsLength=function(t){return t*8};Me.prototype.getLength=function(){return this.data.length};Me.prototype.getBitsLength=function(){return Me.getBitsLength(this.data.length)};Me.prototype.write=function(e){for(let t=0,n=this.data.length;t<n;t++)e.put(this.data[t],8)};var Wi=Me;const Ki=le,Vi=W;function Ie(e){this.mode=Ki.KANJI,this.data=e}Ie.getBitsLength=function(t){return t*13};Ie.prototype.getLength=function(){return this.data.length};Ie.prototype.getBitsLength=function(){return Ie.getBitsLength(this.data.length)};Ie.prototype.write=function(e){let t;for(t=0;t<this.data.length;t++){let n=Vi.toSJIS(this.data[t]);if(n>=33088&&n<=40956)n-=33088;else if(n>=57408&&n<=60351)n-=49472;else throw new Error("Invalid SJIS character: "+this.data[t]+`
3
+ Make sure your charset is UTF-8`);n=(n>>>8&255)*192+(n&255),e.put(n,13)}};var ji=Ie,fo={exports:{}};(function(e){var t={single_source_shortest_paths:function(n,o,i){var a={},r={};r[o]=0;var l=t.PriorityQueue.make();l.push(o,0);for(var c,d,h,S,w,m,_,E,L;!l.empty();){c=l.pop(),d=c.value,S=c.cost,w=n[d]||{};for(h in w)w.hasOwnProperty(h)&&(m=w[h],_=S+m,E=r[h],L=typeof r[h]>"u",(L||E>_)&&(r[h]=_,l.push(h,_),a[h]=d))}if(typeof i<"u"&&typeof r[i]>"u"){var f=["Could not find a path from ",o," to ",i,"."].join("");throw new Error(f)}return a},extract_shortest_path_from_predecessor_list:function(n,o){for(var i=[],a=o;a;)i.push(a),n[a],a=n[a];return i.reverse(),i},find_path:function(n,o,i){var a=t.single_source_shortest_paths(n,o,i);return t.extract_shortest_path_from_predecessor_list(a,i)},PriorityQueue:{make:function(n){var o=t.PriorityQueue,i={},a;n=n||{};for(a in o)o.hasOwnProperty(a)&&(i[a]=o[a]);return i.queue=[],i.sorter=n.sorter||o.default_sorter,i},default_sorter:function(n,o){return n.cost-o.cost},push:function(n,o){var i={value:n,cost:o};this.queue.push(i),this.queue.sort(this.sorter)},pop:function(){return this.queue.shift()},empty:function(){return this.queue.length===0}}};e.exports=t})(fo);var qi=fo.exports;(function(e){const t=le,n=Ui,o=Fi,i=Wi,a=ji,r=j,l=W,c=qi;function d(f){return unescape(encodeURIComponent(f)).length}function h(f,v,b){const p=[];let g;for(;(g=f.exec(b))!==null;)p.push({data:g[0],index:g.index,mode:v,length:g[0].length});return p}function S(f){const v=h(r.NUMERIC,t.NUMERIC,f),b=h(r.ALPHANUMERIC,t.ALPHANUMERIC,f);let p,g;return l.isKanjiModeEnabled()?(p=h(r.BYTE,t.BYTE,f),g=h(r.KANJI,t.KANJI,f)):(p=h(r.BYTE_KANJI,t.BYTE,f),g=[]),v.concat(b,p,g).sort(function(C,R){return C.index-R.index}).map(function(C){return{data:C.data,mode:C.mode,length:C.length}})}function w(f,v){switch(v){case t.NUMERIC:return n.getBitsLength(f);case t.ALPHANUMERIC:return o.getBitsLength(f);case t.KANJI:return a.getBitsLength(f);case t.BYTE:return i.getBitsLength(f)}}function m(f){return f.reduce(function(v,b){const p=v.length-1>=0?v[v.length-1]:null;return p&&p.mode===b.mode?(v[v.length-1].data+=b.data,v):(v.push(b),v)},[])}function _(f){const v=[];for(let b=0;b<f.length;b++){const p=f[b];switch(p.mode){case t.NUMERIC:v.push([p,{data:p.data,mode:t.ALPHANUMERIC,length:p.length},{data:p.data,mode:t.BYTE,length:p.length}]);break;case t.ALPHANUMERIC:v.push([p,{data:p.data,mode:t.BYTE,length:p.length}]);break;case t.KANJI:v.push([p,{data:p.data,mode:t.BYTE,length:d(p.data)}]);break;case t.BYTE:v.push([{data:p.data,mode:t.BYTE,length:d(p.data)}])}}return v}function E(f,v){const b={},p={start:{}};let g=["start"];for(let y=0;y<f.length;y++){const C=f[y],R=[];for(let T=0;T<C.length;T++){const U=C[T],N=""+y+T;R.push(N),b[N]={node:U,lastCount:0},p[N]={};for(let G=0;G<g.length;G++){const F=g[G];b[F]&&b[F].node.mode===U.mode?(p[F][N]=w(b[F].lastCount+U.length,U.mode)-w(b[F].lastCount,U.mode),b[F].lastCount+=U.length):(b[F]&&(b[F].lastCount=U.length),p[F][N]=w(U.length,U.mode)+4+t.getCharCountIndicator(U.mode,v))}}g=R}for(let y=0;y<g.length;y++)p[g[y]].end=0;return{map:p,table:b}}function L(f,v){let b;const p=t.getBestModeForData(f);if(b=t.from(v,p),b!==t.BYTE&&b.bit<p.bit)throw new Error('"'+f+'" cannot be encoded with mode '+t.toString(b)+`.
4
+ Suggested mode is: `+t.toString(p));switch(b===t.KANJI&&!l.isKanjiModeEnabled()&&(b=t.BYTE),b){case t.NUMERIC:return new n(f);case t.ALPHANUMERIC:return new o(f);case t.KANJI:return new a(f);case t.BYTE:return new i(f)}}e.fromArray=function(v){return v.reduce(function(b,p){return typeof p=="string"?b.push(L(p,null)):p.data&&b.push(L(p.data,p.mode)),b},[])},e.fromString=function(v,b){const p=S(v,l.isKanjiModeEnabled()),g=_(p),y=E(g,b),C=c.find_path(y.map,"start","end"),R=[];for(let T=1;T<C.length-1;T++)R.push(y.table[C[T]].node);return e.fromArray(m(R))},e.rawSplit=function(v){return e.fromArray(S(v,l.isKanjiModeEnabled()))}})(po);const Qt=W,$t=jt,Zi=Li,Qi=Ti,Gi=io,Ji=ao,sn=ro,ln=qt,Yi=Ii,Et=co,Xi=ho,$i=le,en=po;function ea(e,t){const n=e.size,o=Ji.getPositions(t);for(let i=0;i<o.length;i++){const a=o[i][0],r=o[i][1];for(let l=-1;l<=7;l++)if(!(a+l<=-1||n<=a+l))for(let c=-1;c<=7;c++)r+c<=-1||n<=r+c||(l>=0&&l<=6&&(c===0||c===6)||c>=0&&c<=6&&(l===0||l===6)||l>=2&&l<=4&&c>=2&&c<=4?e.set(a+l,r+c,!0,!0):e.set(a+l,r+c,!1,!0))}}function ta(e){const t=e.size;for(let n=8;n<t-8;n++){const o=n%2===0;e.set(n,6,o,!0),e.set(6,n,o,!0)}}function na(e,t){const n=Gi.getPositions(t);for(let o=0;o<n.length;o++){const i=n[o][0],a=n[o][1];for(let r=-2;r<=2;r++)for(let l=-2;l<=2;l++)r===-2||r===2||l===-2||l===2||r===0&&l===0?e.set(i+r,a+l,!0,!0):e.set(i+r,a+l,!1,!0)}}function oa(e,t){const n=e.size,o=Et.getEncodedBits(t);let i,a,r;for(let l=0;l<18;l++)i=Math.floor(l/3),a=l%3+n-8-3,r=(o>>l&1)===1,e.set(i,a,r,!0),e.set(a,i,r,!0)}function tn(e,t,n){const o=e.size,i=Xi.getEncodedBits(t,n);let a,r;for(a=0;a<15;a++)r=(i>>a&1)===1,a<6?e.set(a,8,r,!0):a<8?e.set(a+1,8,r,!0):e.set(o-15+a,8,r,!0),a<8?e.set(8,o-a-1,r,!0):a<9?e.set(8,15-a-1+1,r,!0):e.set(8,15-a-1,r,!0);e.set(o-8,8,1,!0)}function ia(e,t){const n=e.size;let o=-1,i=n-1,a=7,r=0;for(let l=n-1;l>0;l-=2)for(l===6&&l--;;){for(let c=0;c<2;c++)if(!e.isReserved(i,l-c)){let d=!1;r<t.length&&(d=(t[r]>>>a&1)===1),e.set(i,l-c,d),a--,a===-1&&(r++,a=7)}if(i+=o,i<0||n<=i){i-=o,o=-o;break}}}function aa(e,t,n){const o=new Zi;n.forEach(function(c){o.put(c.mode.bit,4),o.put(c.getLength(),$i.getCharCountIndicator(c.mode,e)),c.write(o)});const i=Qt.getSymbolTotalCodewords(e),a=ln.getTotalCodewordsCount(e,t),r=(i-a)*8;for(o.getLengthInBits()+4<=r&&o.put(0,4);o.getLengthInBits()%8!==0;)o.putBit(0);const l=(r-o.getLengthInBits())/8;for(let c=0;c<l;c++)o.put(c%2?17:236,8);return ra(o,e,t)}function ra(e,t,n){const o=Qt.getSymbolTotalCodewords(t),i=ln.getTotalCodewordsCount(t,n),a=o-i,r=ln.getBlocksCount(t,n),l=o%r,c=r-l,d=Math.floor(o/r),h=Math.floor(a/r),S=h+1,w=d-h,m=new Yi(w);let _=0;const E=new Array(r),L=new Array(r);let f=0;const v=new Uint8Array(e.buffer);for(let C=0;C<r;C++){const R=C<c?h:S;E[C]=v.slice(_,_+R),L[C]=m.encode(E[C]),_+=R,f=Math.max(f,R)}const b=new Uint8Array(o);let p=0,g,y;for(g=0;g<f;g++)for(y=0;y<r;y++)g<E[y].length&&(b[p++]=E[y][g]);for(g=0;g<w;g++)for(y=0;y<r;y++)b[p++]=L[y][g];return b}function sa(e,t,n,o){let i;if(Array.isArray(e))i=en.fromArray(e);else if(typeof e=="string"){let d=t;if(!d){const h=en.rawSplit(e);d=Et.getBestVersionForData(h,n)}i=en.fromString(e,d||40)}else throw new Error("Invalid data");const a=Et.getBestVersionForData(i,n);if(!a)throw new Error("The amount of data is too big to be stored in a QR Code");if(!t)t=a;else if(t<a)throw new Error(`
5
+ The chosen QR Code version cannot contain this amount of data.
6
+ Minimum version required to store current data is: `+a+`.
7
+ `);const r=aa(t,n,i),l=Qt.getSymbolSize(t),c=new Qi(l);return ea(c,t),ta(c),na(c,t),tn(c,n,0),t>=7&&oa(c,t),ia(c,r),isNaN(o)&&(o=sn.getBestMask(c,tn.bind(null,c,n))),sn.applyMask(o,c),tn(c,n,o),{modules:c,version:t,errorCorrectionLevel:n,maskPattern:o,segments:i}}no.create=function(t,n){if(typeof t>"u"||t==="")throw new Error("No input text");let o=$t.M,i,a;return typeof n<"u"&&(o=$t.from(n.errorCorrectionLevel,$t.M),i=Et.from(n.version),a=sn.from(n.maskPattern),n.toSJISFunc&&Qt.setToSJISFunction(n.toSJISFunc)),sa(t,i,o,a)};var go={},wn={};(function(e){function t(n){if(typeof n=="number"&&(n=n.toString()),typeof n!="string")throw new Error("Color should be defined as hex string");let o=n.slice().replace("#","").split("");if(o.length<3||o.length===5||o.length>8)throw new Error("Invalid hex color: "+n);(o.length===3||o.length===4)&&(o=Array.prototype.concat.apply([],o.map(function(a){return[a,a]}))),o.length===6&&o.push("F","F");const i=parseInt(o.join(""),16);return{r:i>>24&255,g:i>>16&255,b:i>>8&255,a:i&255,hex:"#"+o.slice(0,6).join("")}}e.getOptions=function(o){o||(o={}),o.color||(o.color={});const i=typeof o.margin>"u"||o.margin===null||o.margin<0?4:o.margin,a=o.width&&o.width>=21?o.width:void 0,r=o.scale||4;return{width:a,scale:a?4:r,margin:i,color:{dark:t(o.color.dark||"#000000ff"),light:t(o.color.light||"#ffffffff")},type:o.type,rendererOpts:o.rendererOpts||{}}},e.getScale=function(o,i){return i.width&&i.width>=o+i.margin*2?i.width/(o+i.margin*2):i.scale},e.getImageWidth=function(o,i){const a=e.getScale(o,i);return Math.floor((o+i.margin*2)*a)},e.qrToImageData=function(o,i,a){const r=i.modules.size,l=i.modules.data,c=e.getScale(r,a),d=Math.floor((r+a.margin*2)*c),h=a.margin*c,S=[a.color.light,a.color.dark];for(let w=0;w<d;w++)for(let m=0;m<d;m++){let _=(w*d+m)*4,E=a.color.light;if(w>=h&&m>=h&&w<d-h&&m<d-h){const L=Math.floor((w-h)/c),f=Math.floor((m-h)/c);E=S[l[L*r+f]?1:0]}o[_++]=E.r,o[_++]=E.g,o[_++]=E.b,o[_]=E.a}}})(wn);(function(e){const t=wn;function n(i,a,r){i.clearRect(0,0,a.width,a.height),a.style||(a.style={}),a.height=r,a.width=r,a.style.height=r+"px",a.style.width=r+"px"}function o(){try{return document.createElement("canvas")}catch{throw new Error("You need to specify a canvas element")}}e.render=function(a,r,l){let c=l,d=r;typeof c>"u"&&(!r||!r.getContext)&&(c=r,r=void 0),r||(d=o()),c=t.getOptions(c);const h=t.getImageWidth(a.modules.size,c),S=d.getContext("2d"),w=S.createImageData(h,h);return t.qrToImageData(w.data,a,c),n(S,d,h),S.putImageData(w,0,0),d},e.renderToDataURL=function(a,r,l){let c=l;typeof c>"u"&&(!r||!r.getContext)&&(c=r,r=void 0),c||(c={});const d=e.render(a,r,c),h=c.type||"image/png",S=c.rendererOpts||{};return d.toDataURL(h,S.quality)}})(go);var wo={};const la=wn;function In(e,t){const n=e.a/255,o=t+'="'+e.hex+'"';return n<1?o+" "+t+'-opacity="'+n.toFixed(2).slice(1)+'"':o}function nn(e,t,n){let o=e+t;return typeof n<"u"&&(o+=" "+n),o}function ca(e,t,n){let o="",i=0,a=!1,r=0;for(let l=0;l<e.length;l++){const c=Math.floor(l%t),d=Math.floor(l/t);!c&&!a&&(a=!0),e[l]?(r++,l>0&&c>0&&e[l-1]||(o+=a?nn("M",c+n,.5+d+n):nn("m",i,0),i=0,a=!1),c+1<t&&e[l+1]||(o+=nn("h",r),r=0)):i++}return o}wo.render=function(t,n,o){const i=la.getOptions(n),a=t.modules.size,r=t.modules.data,l=a+i.margin*2,c=i.color.light.a?"<path "+In(i.color.light,"fill")+' d="M0 0h'+l+"v"+l+'H0z"/>':"",d="<path "+In(i.color.dark,"stroke")+' d="'+ca(r,a,i.margin)+'"/>',h='viewBox="0 0 '+l+" "+l+'"',w='<svg xmlns="http://www.w3.org/2000/svg" '+(i.width?'width="'+i.width+'" height="'+i.width+'" ':"")+h+' shape-rendering="crispEdges">'+c+d+`</svg>
8
+ `;return typeof o=="function"&&o(null,w),w};const da=Ai,cn=no,bo=go,ua=wo;function bn(e,t,n,o,i){const a=[].slice.call(arguments,1),r=a.length,l=typeof a[r-1]=="function";if(!l&&!da())throw new Error("Callback required as last argument");if(l){if(r<2)throw new Error("Too few arguments provided");r===2?(i=n,n=t,t=o=void 0):r===3&&(t.getContext&&typeof i>"u"?(i=o,o=void 0):(i=o,o=n,n=t,t=void 0))}else{if(r<1)throw new Error("Too few arguments provided");return r===1?(n=t,t=o=void 0):r===2&&!t.getContext&&(o=n,n=t,t=void 0),new Promise(function(c,d){try{const h=cn.create(n,o);c(e(h,t,o))}catch(h){d(h)}})}try{const c=cn.create(n,o);i(null,e(c,t,o))}catch(c){i(c)}}at.create=cn.create;at.toCanvas=bn.bind(null,bo.render);at.toDataURL=bn.bind(null,bo.renderToDataURL);at.toString=bn.bind(null,function(e,t,n){return ua.render(e,n)});function oe(e){return window.btoa(String.fromCharCode.call(null,...e))}function z(e){return new Uint8Array(window.atob(e).split("").map(t=>t.charCodeAt(0)))}const ha=`
9
+ <div class="mobile-wallet-adapter-embedded-loading-indicator" role="dialog" aria-modal="true" aria-labelledby="modal-title">
10
+ <div data-modal-close style="position: absolute; width: 100%; height: 100%;"></div>
11
+ <div class="mobile-wallet-adapter-embedded-loading-container">
12
+ <div class="mobile-wallet-adapter-embedded-loading-animation"></div>
13
+ </div>
14
+ </div>
15
+ `,ma=`
16
+ .mobile-wallet-adapter-embedded-loading-indicator {
17
+ display: flex; /* Use flexbox to center content */
18
+ justify-content: center; /* Center horizontally */
19
+ align-items: start; /* Center vertically */
20
+ position: fixed; /* Stay in place */
21
+ z-index: 1; /* Sit on top */
22
+ left: 0;
23
+ top: 0;
24
+ width: 100%; /* Full width */
25
+ height: 100%; /* Full height */
26
+ background-color: rgba(0,0,0,0.4); /* Black w/ opacity */
27
+ overflow-y: auto; /* enable scrolling */
28
+ }
29
+
30
+ .mobile-wallet-adapter-embedded-loading-container {
31
+ display: flex;
32
+ margin: auto;
33
+ }
34
+
35
+ .mobile-wallet-adapter-embedded-loading-animation {
36
+ position: relative;
37
+ left: -9999px;
38
+ width: 10px;
39
+ height: 10px;
40
+ border-radius: 5px;
41
+ background-color: var(--spinner-color);
42
+ color: var(--spinner-color);
43
+ box-shadow: 9984px 0 0 0 var(--spinner-color),
44
+ 9999px 0 0 0 var(--spinner-color),
45
+ 10014px 0 0 0 var(--spinner-color);
46
+ animation: dot-typing 1.5s infinite linear;
47
+ }
48
+
49
+ @keyframes dot-typing {
50
+ 0% {
51
+ box-shadow: 9984px 0 0 0 var(--spinner-color),
52
+ 9999px 0 0 0 var(--spinner-color),
53
+ 10014px 0 0 0 var(--spinner-color);
54
+ }
55
+ 16.667% {
56
+ box-shadow: 9984px -10px 0 0 var(--spinner-color),
57
+ 9999px 0 0 0 var(--spinner-color),
58
+ 10014px 0 0 0 var(--spinner-color);
59
+ }
60
+ 33.333% {
61
+ box-shadow: 9984px 0 0 0 var(--spinner-color),
62
+ 9999px 0 0 0 var(--spinner-color),
63
+ 10014px 0 0 0 var(--spinner-color);
64
+ }
65
+ 50% {
66
+ box-shadow: 9984px 0 0 0 var(--spinner-color),
67
+ 9999px -10px 0 0 var(--spinner-color),
68
+ 10014px 0 0 0 var(--spinner-color);
69
+ }
70
+ 66.667% {
71
+ box-shadow: 9984px 0 0 0 var(--spinner-color),
72
+ 9999px 0 0 0 var(--spinner-color),
73
+ 10014px 0 0 0 var(--spinner-color);
74
+ }
75
+ 83.333% {
76
+ box-shadow: 9984px 0 0 0 var(--spinner-color),
77
+ 9999px 0 0 0 var(--spinner-color),
78
+ 10014px -10px 0 0 var(--spinner-color);
79
+ }
80
+ 100% {
81
+ box-shadow: 9984px 0 0 0 var(--spinner-color),
82
+ 9999px 0 0 0 var(--spinner-color),
83
+ 10014px 0 0 0 var(--spinner-color);
84
+ }
85
+ }
86
+ `;var P,J,ce,re,yo,Eo,Co,ze,xn,pa=(xn=class{constructor(){u(this,re);u(this,P,null);u(this,J,{});u(this,ce,!1);M(this,"dom",null);M(this,"open",()=>{console.debug("Modal open"),k(this,re,Eo).call(this),s(this,P)&&(s(this,P).style.display="flex")});M(this,"close",(e=void 0)=>{var t;console.debug("Modal close"),k(this,re,Co).call(this),s(this,P)&&(s(this,P).style.display="none"),(t=s(this,J).close)==null||t.forEach(n=>n(e))});u(this,ze,e=>{e.key==="Escape"&&this.close(e)});this.init=this.init.bind(this),A(this,P,document.getElementById("mobile-wallet-adapter-embedded-root-ui"))}async init(){console.log("Injecting modal"),k(this,re,yo).call(this)}addEventListener(e,t){var n;return(n=s(this,J)[e])!=null&&n.push(t)||(s(this,J)[e]=[t]),()=>this.removeEventListener(e,t)}removeEventListener(e,t){var n;s(this,J)[e]=(n=s(this,J)[e])==null?void 0:n.filter(o=>t!==o)}},P=new WeakMap,J=new WeakMap,ce=new WeakMap,re=new WeakSet,yo=function(){if(this.dom)return;A(this,P,document.createElement("div")),s(this,P).id="mobile-wallet-adapter-embedded-root-ui",s(this,P).innerHTML=ha,s(this,P).style.display="none";const e=document.createElement("style");e.id="mobile-wallet-adapter-embedded-modal-styles",e.textContent=ma;const t=document.createElement("div");this.dom=t.attachShadow({mode:"closed"}),t.style.setProperty("--spinner-color","#FFFFFF"),this.dom.appendChild(e),this.dom.appendChild(s(this,P)),document.body.appendChild(t)},Eo=function(){!s(this,P)||s(this,ce)||([...s(this,P).querySelectorAll("[data-modal-close]")].forEach(e=>e==null?void 0:e.addEventListener("click",t=>{this.close(t)})),window.addEventListener("load",this.close),document.addEventListener("keydown",s(this,ze)),A(this,ce,!0))},Co=function(){s(this,ce)&&(window.removeEventListener("load",this.close),document.removeEventListener("keydown",s(this,ze)),s(this,P)&&([...s(this,P).querySelectorAll("[data-modal-close]")].forEach(e=>e==null?void 0:e.removeEventListener("click",this.close)),A(this,ce,!1)))},ze=new WeakMap,xn);const fa=`
87
+ <div class="mobile-wallet-adapter-embedded-modal-container" role="dialog" aria-modal="true" aria-labelledby="modal-title">
88
+ <div data-modal-close style="position: absolute; width: 100%; height: 100%;"></div>
89
+ <div class="mobile-wallet-adapter-embedded-modal-card">
90
+ <div>
91
+ <button data-modal-close class="mobile-wallet-adapter-embedded-modal-close">
92
+ <svg width="14" height="14">
93
+ <path d="M 6.7125,8.3036995 1.9082,13.108199 c -0.2113,0.2112 -0.4765,0.3168 -0.7957,0.3168 -0.3192,0 -0.5844,-0.1056 -0.7958,-0.3168 C 0.1056,12.896899 0,12.631699 0,12.312499 c 0,-0.3192 0.1056,-0.5844 0.3167,-0.7958 L 5.1212,6.7124995 0.3167,1.9082 C 0.1056,1.6969 0,1.4317 0,1.1125 0,0.7933 0.1056,0.5281 0.3167,0.3167 0.5281,0.1056 0.7933,0 1.1125,0 1.4317,0 1.6969,0.1056 1.9082,0.3167 L 6.7125,5.1212 11.5167,0.3167 C 11.7281,0.1056 11.9933,0 12.3125,0 c 0.3192,0 0.5844,0.1056 0.7957,0.3167 0.2112,0.2114 0.3168,0.4766 0.3168,0.7958 0,0.3192 -0.1056,0.5844 -0.3168,0.7957 L 8.3037001,6.7124995 13.1082,11.516699 c 0.2112,0.2114 0.3168,0.4766 0.3168,0.7958 0,0.3192 -0.1056,0.5844 -0.3168,0.7957 -0.2113,0.2112 -0.4765,0.3168 -0.7957,0.3168 -0.3192,0 -0.5844,-0.1056 -0.7958,-0.3168 z" />
94
+ </svg>
95
+ </button>
96
+ </div>
97
+ <div class="mobile-wallet-adapter-embedded-modal-content"></div>
98
+ </div>
99
+ </div>
100
+ `,ga=`
101
+ .mobile-wallet-adapter-embedded-modal-container {
102
+ display: flex; /* Use flexbox to center content */
103
+ justify-content: center; /* Center horizontally */
104
+ align-items: center; /* Center vertically */
105
+ position: fixed; /* Stay in place */
106
+ z-index: 2147483647; /* Sit on top */
107
+ left: 0;
108
+ top: 0;
109
+ width: 100%; /* Full width */
110
+ height: 100%; /* Full height */
111
+ background-color: rgba(0,0,0,0.4); /* Black w/ opacity */
112
+ overflow-y: auto; /* enable scrolling */
113
+ }
114
+
115
+ .mobile-wallet-adapter-embedded-modal-card {
116
+ display: flex;
117
+ flex-direction: column;
118
+ margin: auto 20px;
119
+ max-width: 780px;
120
+ padding: 20px;
121
+ border-radius: 24px;
122
+ background: #ffffff;
123
+ font-family: "Inter Tight", "PT Sans", Calibri, sans-serif;
124
+ transform: translateY(-200%);
125
+ animation: slide-in 0.5s forwards;
126
+ }
127
+
128
+ @keyframes slide-in {
129
+ 100% { transform: translateY(0%); }
130
+ }
131
+
132
+ .mobile-wallet-adapter-embedded-modal-close {
133
+ display: flex;
134
+ align-items: center;
135
+ justify-content: center;
136
+ width: 32px;
137
+ height: 32px;
138
+ cursor: pointer;
139
+ background: #e4e9e9;
140
+ border: none;
141
+ border-radius: 50%;
142
+ }
143
+
144
+ .mobile-wallet-adapter-embedded-modal-close:focus-visible {
145
+ outline-color: red;
146
+ }
147
+
148
+ .mobile-wallet-adapter-embedded-modal-close svg {
149
+ fill: #546266;
150
+ transition: fill 200ms ease 0s;
151
+ }
152
+
153
+ .mobile-wallet-adapter-embedded-modal-close:hover svg {
154
+ fill: #fff;
155
+ }
156
+ `,wa=`
157
+ <link rel="preconnect" href="https://fonts.googleapis.com">
158
+ <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
159
+ <link href="https://fonts.googleapis.com/css2?family=Inter+Tight:ital,wght@0,100..900;1,100..900&display=swap" rel="stylesheet">
160
+ `;var I,Y,de,se,vo,_o,So,Fe,Nn,st=(Nn=class{constructor(){u(this,se);u(this,I,null);u(this,Y,{});u(this,de,!1);M(this,"dom",null);M(this,"open",()=>{console.debug("Modal open"),k(this,se,_o).call(this),s(this,I)&&(s(this,I).style.display="flex")});M(this,"close",(e=void 0)=>{var t;console.debug("Modal close"),k(this,se,So).call(this),s(this,I)&&(s(this,I).style.display="none"),(t=s(this,Y).close)==null||t.forEach(n=>n(e))});u(this,Fe,e=>{e.key==="Escape"&&this.close(e)});this.init=this.init.bind(this),A(this,I,document.getElementById("mobile-wallet-adapter-embedded-root-ui"))}async init(){console.log("Injecting modal"),k(this,se,vo).call(this)}addEventListener(e,t){var n;return(n=s(this,Y)[e])!=null&&n.push(t)||(s(this,Y)[e]=[t]),()=>this.removeEventListener(e,t)}removeEventListener(e,t){var n;s(this,Y)[e]=(n=s(this,Y)[e])==null?void 0:n.filter(o=>t!==o)}},I=new WeakMap,Y=new WeakMap,de=new WeakMap,se=new WeakSet,vo=function(){if(document.getElementById("mobile-wallet-adapter-embedded-root-ui")){s(this,I)||A(this,I,document.getElementById("mobile-wallet-adapter-embedded-root-ui"));return}A(this,I,document.createElement("div")),s(this,I).id="mobile-wallet-adapter-embedded-root-ui",s(this,I).innerHTML=fa,s(this,I).style.display="none";const e=s(this,I).querySelector(".mobile-wallet-adapter-embedded-modal-content");e&&(e.innerHTML=this.contentHtml);const t=document.createElement("style");t.id="mobile-wallet-adapter-embedded-modal-styles",t.textContent=ga+this.contentStyles;const n=document.createElement("div");n.innerHTML=wa,this.dom=n.attachShadow({mode:"closed"}),this.dom.appendChild(t),this.dom.appendChild(s(this,I)),document.body.appendChild(n)},_o=function(){!s(this,I)||s(this,de)||([...s(this,I).querySelectorAll("[data-modal-close]")].forEach(e=>e==null?void 0:e.addEventListener("click",this.close)),window.addEventListener("load",this.close),document.addEventListener("keydown",s(this,Fe)),A(this,de,!0))},So=function(){s(this,de)&&(window.removeEventListener("load",this.close),document.removeEventListener("keydown",s(this,Fe)),s(this,I)&&([...s(this,I).querySelectorAll("[data-modal-close]")].forEach(e=>e==null?void 0:e.removeEventListener("click",this.close)),A(this,de,!1)))},Fe=new WeakMap,Nn),ba=class extends st{constructor(){super(...arguments);M(this,"contentStyles",Ea);M(this,"contentHtml",ya)}async initWithQR(t){super.init(),this.populateQRCode(t)}async populateQRCode(t){var o,i;const n=(o=this.dom)==null?void 0:o.getElementById("mobile-wallet-adapter-embedded-modal-qr-code-container");if(n){const a=await at.toCanvas(t,{width:200,margin:0});n.firstElementChild!==null?n.replaceChild(a,n.firstElementChild):n.appendChild(a);const r=(i=this.dom)==null?void 0:i.getElementById("mobile-wallet-adapter-embedded-modal-qr-placeholder");r&&(r.style.display="none")}else console.error("QRCode Container not found")}};const ya=`
161
+ <div class="mobile-wallet-adapter-embedded-modal-qr-content">
162
+ <div>
163
+ <svg class="mobile-wallet-adapter-embedded-modal-icon" width="100%" height="100%">
164
+ <circle r="52" cx="53" cy="53" fill="#99b3be" stroke="#000000" stroke-width="2"/>
165
+ <path d="m 53,82.7305 c -3.3116,0 -6.1361,-1.169 -8.4735,-3.507 -2.338,-2.338 -3.507,-5.1625 -3.507,-8.4735 0,-3.3116 1.169,-6.1364 3.507,-8.4744 2.3374,-2.338 5.1619,-3.507 8.4735,-3.507 3.3116,0 6.1361,1.169 8.4735,3.507 2.338,2.338 3.507,5.1628 3.507,8.4744 0,3.311 -1.169,6.1355 -3.507,8.4735 -2.3374,2.338 -5.1619,3.507 -8.4735,3.507 z m 0.007,-5.25 c 1.8532,0 3.437,-0.6598 4.7512,-1.9793 1.3149,-1.3195 1.9723,-2.9058 1.9723,-4.7591 0,-1.8526 -0.6598,-3.4364 -1.9793,-4.7512 -1.3195,-1.3149 -2.9055,-1.9723 -4.7582,-1.9723 -1.8533,0 -3.437,0.6598 -4.7513,1.9793 -1.3148,1.3195 -1.9722,2.9058 -1.9722,4.7591 0,1.8527 0.6597,3.4364 1.9792,4.7512 1.3195,1.3149 2.9056,1.9723 4.7583,1.9723 z m -28,-33.5729 -3.85,-3.6347 c 4.1195,-4.025 8.8792,-7.1984 14.2791,-9.52 5.4005,-2.3223 11.2551,-3.4834 17.5639,-3.4834 6.3087,0 12.1634,1.1611 17.5639,3.4834 5.3999,2.3216 10.1596,5.495 14.2791,9.52 l -3.85,3.6347 C 77.2999,40.358 73.0684,37.5726 68.2985,35.5514 63.5292,33.5301 58.4296,32.5195 53,32.5195 c -5.4297,0 -10.5292,1.0106 -15.2985,3.0319 -4.7699,2.0212 -9.0014,4.8066 -12.6945,8.3562 z m 44.625,10.8771 c -2.2709,-2.1046 -4.7962,-3.7167 -7.5758,-4.8361 -2.7795,-1.12 -5.7983,-1.68 -9.0562,-1.68 -3.2579,0 -6.2621,0.56 -9.0125,1.68 -2.7504,1.1194 -5.2903,2.7315 -7.6195,4.8361 L 32.5189,51.15 c 2.8355,-2.6028 5.9777,-4.6086 9.4263,-6.0174 3.4481,-1.4087 7.133,-2.1131 11.0548,-2.1131 3.9217,0 7.5979,0.7044 11.0285,2.1131 3.43,1.4088 6.5631,3.4146 9.3992,6.0174 z"/>
166
+ </svg>
167
+ <div class="mobile-wallet-adapter-embedded-modal-title">Remote Mobile Wallet Adapter</div>
168
+ </div>
169
+ <div>
170
+ <div>
171
+ <h4 class="mobile-wallet-adapter-embedded-modal-qr-label">
172
+ Open your wallet and scan this code
173
+ </h4>
174
+ </div>
175
+ <div id="mobile-wallet-adapter-embedded-modal-qr-code-container" class="mobile-wallet-adapter-embedded-modal-qr-code-container">
176
+ <div id="mobile-wallet-adapter-embedded-modal-qr-placeholder" class="mobile-wallet-adapter-embedded-modal-qr-placeholder"></div>
177
+ </div>
178
+ </div>
179
+ </div>
180
+ <div class="mobile-wallet-adapter-embedded-modal-divider"><hr></div>
181
+ <div class="mobile-wallet-adapter-embedded-modal-footer">
182
+ <div class="mobile-wallet-adapter-embedded-modal-subtitle">
183
+ Follow the instructions on your device. When you're finished, this screen will update.
184
+ </div>
185
+ <div class="mobile-wallet-adapter-embedded-modal-progress-badge">
186
+ <div>
187
+ <div class="spinner">
188
+ <div class="leftWrapper">
189
+ <div class="left">
190
+ <div class="circle"></div>
191
+ </div>
192
+ </div>
193
+ <div class="rightWrapper">
194
+ <div class="right">
195
+ <div class="circle"></div>
196
+ </div>
197
+ </div>
198
+ </div>
199
+ </div>
200
+ <div>Waiting for scan</div>
201
+ </div>
202
+ </div>
203
+ `,Ea=`
204
+ .mobile-wallet-adapter-embedded-modal-qr-content {
205
+ display: flex;
206
+ margin-top: 10px;
207
+ padding: 10px;
208
+ }
209
+
210
+ .mobile-wallet-adapter-embedded-modal-qr-content > div:first-child {
211
+ display: flex;
212
+ flex-direction: column;
213
+ flex: 2;
214
+ margin-top: auto;
215
+ margin-right: 30px;
216
+ }
217
+
218
+ .mobile-wallet-adapter-embedded-modal-qr-content > div:nth-child(2) {
219
+ display: flex;
220
+ flex-direction: column;
221
+ flex: 1;
222
+ margin-left: auto;
223
+ }
224
+
225
+ .mobile-wallet-adapter-embedded-modal-footer {
226
+ display: flex;
227
+ padding: 10px;
228
+ }
229
+
230
+ .mobile-wallet-adapter-embedded-modal-icon {}
231
+
232
+ .mobile-wallet-adapter-embedded-modal-title {
233
+ color: #000000;
234
+ font-size: 2.5em;
235
+ font-weight: 600;
236
+ }
237
+
238
+ .mobile-wallet-adapter-embedded-modal-qr-label {
239
+ text-align: right;
240
+ color: #000000;
241
+ }
242
+
243
+ .mobile-wallet-adapter-embedded-modal-qr-code-container {
244
+ margin-left: auto;
245
+ }
246
+
247
+ .mobile-wallet-adapter-embedded-modal-qr-placeholder {
248
+ margin-left: auto;
249
+ min-width: 200px;
250
+ min-height: 200px;
251
+ background: linear-gradient(-60deg, #F7F8F8 30%, #ECEEEE 50%, #F7F8F8 70%);
252
+ background-size: 200%;
253
+ animation: placeholderAnimate 2.7s linear infinite;
254
+ border-radius: 12px;
255
+ }
256
+
257
+ .mobile-wallet-adapter-embedded-modal-divider {
258
+ margin-top: 20px;
259
+ padding-left: 10px;
260
+ padding-right: 10px;
261
+ }
262
+
263
+ .mobile-wallet-adapter-embedded-modal-divider hr {
264
+ border-top: 1px solid #D9DEDE;
265
+ }
266
+
267
+ .mobile-wallet-adapter-embedded-modal-subtitle {
268
+ margin: auto;
269
+ margin-right: 60px;
270
+ padding: 20px;
271
+ color: #6E8286;
272
+ }
273
+
274
+ .mobile-wallet-adapter-embedded-modal-progress-badge {
275
+ display: flex;
276
+ background: #F7F8F8;
277
+ height: 56px;
278
+ min-width: 200px;
279
+ margin: auto;
280
+ padding-left: 20px;
281
+ padding-right: 20px;
282
+ border-radius: 18px;
283
+ color: #A8B6B8;
284
+ align-items: center;
285
+ }
286
+
287
+ .mobile-wallet-adapter-embedded-modal-progress-badge > div:first-child {
288
+ margin-left: auto;
289
+ margin-right: 20px;
290
+ }
291
+
292
+ .mobile-wallet-adapter-embedded-modal-progress-badge > div:nth-child(2) {
293
+ margin-right: auto;
294
+ }
295
+
296
+ /* Smaller screens */
297
+ @media all and (max-width: 600px) {
298
+ .mobile-wallet-adapter-embedded-modal-card {
299
+ text-align: center;
300
+ }
301
+ .mobile-wallet-adapter-embedded-modal-qr-content {
302
+ flex-direction: column;
303
+ }
304
+ .mobile-wallet-adapter-embedded-modal-qr-content > div:first-child {
305
+ margin: auto;
306
+ }
307
+ .mobile-wallet-adapter-embedded-modal-qr-content > div:nth-child(2) {
308
+ margin: auto;
309
+ flex: 2 auto;
310
+ }
311
+ .mobile-wallet-adapter-embedded-modal-footer {
312
+ flex-direction: column;
313
+ }
314
+ .mobile-wallet-adapter-embedded-modal-icon {
315
+ display: none;
316
+ }
317
+ .mobile-wallet-adapter-embedded-modal-title {
318
+ font-size: 1.5em;
319
+ }
320
+ .mobile-wallet-adapter-embedded-modal-subtitle {
321
+ margin-right: unset;
322
+ }
323
+ .mobile-wallet-adapter-embedded-modal-qr-label {
324
+ text-align: center;
325
+ }
326
+ .mobile-wallet-adapter-embedded-modal-qr-code-container {
327
+ margin: auto;
328
+ }
329
+ .mobile-wallet-adapter-embedded-modal-qr-placeholder {
330
+ margin: auto;
331
+ }
332
+ }
333
+
334
+ /* QR Placeholder */
335
+ @keyframes placeholderAnimate {
336
+ 0% { background-position: 200% 0; }
337
+ 100% { background-position: -200% 0; }
338
+ }
339
+
340
+ /* Spinner */
341
+ @keyframes spinLeft {
342
+ 0% {
343
+ transform: rotate(20deg);
344
+ }
345
+ 50% {
346
+ transform: rotate(160deg);
347
+ }
348
+ 100% {
349
+ transform: rotate(20deg);
350
+ }
351
+ }
352
+ @keyframes spinRight {
353
+ 0% {
354
+ transform: rotate(160deg);
355
+ }
356
+ 50% {
357
+ transform: rotate(20deg);
358
+ }
359
+ 100% {
360
+ transform: rotate(160deg);
361
+ }
362
+ }
363
+ @keyframes spin {
364
+ 0% {
365
+ transform: rotate(0deg);
366
+ }
367
+ 100% {
368
+ transform: rotate(2520deg);
369
+ }
370
+ }
371
+
372
+ .spinner {
373
+ position: relative;
374
+ width: 1.5em;
375
+ height: 1.5em;
376
+ margin: auto;
377
+ animation: spin 10s linear infinite;
378
+ }
379
+ .spinner::before {
380
+ content: "";
381
+ position: absolute;
382
+ top: 0;
383
+ bottom: 0;
384
+ left: 0;
385
+ right: 0;
386
+ }
387
+ .right, .rightWrapper, .left, .leftWrapper {
388
+ position: absolute;
389
+ top: 0;
390
+ overflow: hidden;
391
+ width: .75em;
392
+ height: 1.5em;
393
+ }
394
+ .left, .leftWrapper {
395
+ left: 0;
396
+ }
397
+ .right {
398
+ left: -12px;
399
+ }
400
+ .rightWrapper {
401
+ right: 0;
402
+ }
403
+ .circle {
404
+ border: .125em solid #A8B6B8;
405
+ width: 1.25em; /* 1.5em - 2*0.125em border */
406
+ height: 1.25em; /* 1.5em - 2*0.125em border */
407
+ border-radius: 0.75em; /* 0.5*1.5em spinner size 8 */
408
+ }
409
+ .left {
410
+ transform-origin: 100% 50%;
411
+ animation: spinLeft 2.5s cubic-bezier(.2,0,.8,1) infinite;
412
+ }
413
+ .right {
414
+ transform-origin: 100% 50%;
415
+ animation: spinRight 2.5s cubic-bezier(.2,0,.8,1) infinite;
416
+ }
417
+ `;var Ct,Ao,On,Ca=(On=class extends st{constructor(){super(...arguments);u(this,Ct);M(this,"contentStyles",_a);M(this,"contentHtml",va)}initWithCallback(t){super.init(),k(this,Ct,Ao).call(this,t)}},Ct=new WeakSet,Ao=function(t){var i;const n=(i=this.dom)==null?void 0:i.getElementById("mobile-wallet-adapter-launch-action"),o=async()=>{n==null||n.removeEventListener("click",o),this.close(),t()};n==null||n.addEventListener("click",o)},On);const va=`
418
+ <svg class="mobile-wallet-adapter-embedded-modal-launch-icon" width="48" height="48" viewBox="0 0 48 48" fill="none" xmlns="http://www.w3.org/2000/svg">
419
+ <path d="M21.6 48C7.2 48 0 40.8 0 26.4V21.6C0 7.2 7.2 0 21.6 0H26.4C40.8 0 48 7.2 48 21.6V26.4C48 40.8 40.8 48 26.4 48H21.6Z" fill="#15994E"/>
420
+ <mask id="mask0_189_522" style="mask-type:alpha" maskUnits="userSpaceOnUse" x="8" y="8" width="32" height="32">
421
+ <rect x="8" y="8" width="32" height="32" fill="#D9D9D9"/>
422
+ </mask>
423
+ <g mask="url(#mask0_189_522)">
424
+ <mask id="mask1_189_522" style="mask-type:alpha" maskUnits="userSpaceOnUse" x="8" y="8" width="32" height="32">
425
+ <rect x="8" y="8" width="32" height="32" fill="#D9D9D9"/>
426
+ </mask>
427
+ <g mask="url(#mask1_189_522)">
428
+ <path d="M22.1092 26.1208L19.4498 23.4615C19.1736 23.1851 18.8253 23.0468 18.4048 23.0468C17.9846 23.0468 17.6363 23.1851 17.3598 23.4615C17.0836 23.7377 16.9468 24.0861 16.9495 24.5065C16.9522 24.9267 17.0916 25.275 17.3678 25.5512L21.0405 29.2238C21.3463 29.5276 21.7031 29.6795 22.1108 29.6795C22.5184 29.6795 22.8742 29.5276 23.1782 29.2238L30.5918 21.8098C30.8683 21.5336 31.0065 21.1867 31.0065 20.7692C31.0065 20.3514 30.8683 20.0044 30.5918 19.7282C30.3156 19.4517 29.9673 19.3135 29.5468 19.3135C29.1266 19.3135 28.7784 19.4517 28.5022 19.7282L22.1092 26.1208ZM23.9998 37.6042C22.113 37.6042 20.3425 37.2473 18.6885 36.5335C17.0343 35.8197 15.5954 34.8512 14.3718 33.6278C13.1485 32.4043 12.18 30.9654 11.4662 29.3112C10.7524 27.6572 10.3955 25.8867 10.3955 23.9998C10.3955 22.113 10.7524 20.3425 11.4662 18.6885C12.18 17.0343 13.1485 15.5954 14.3718 14.3718C15.5954 13.1485 17.0343 12.18 18.6885 11.4662C20.3425 10.7524 22.113 10.3955 23.9998 10.3955C25.8867 10.3955 27.6572 10.7524 29.3112 11.4662C30.9654 12.18 32.4043 13.1485 33.6278 14.3718C34.8512 15.5954 35.8197 17.0343 36.5335 18.6885C37.2473 20.3425 37.6042 22.113 37.6042 23.9998C37.6042 25.8867 37.2473 27.6572 36.5335 29.3112C35.8197 30.9654 34.8512 32.4043 33.6278 33.6278C32.4043 34.8512 30.9654 35.8197 29.3112 36.5335C27.6572 37.2473 25.8867 37.6042 23.9998 37.6042Z" fill="white"/>
429
+ </g>
430
+ </g>
431
+ </svg>
432
+ <div class="mobile-wallet-adapter-embedded-modal-title">Ready to connect!</div>
433
+ <div>
434
+ <button data-modal-action id="mobile-wallet-adapter-launch-action" class="mobile-wallet-adapter-embedded-modal-launch-action">
435
+ Connect Wallet
436
+ </button>
437
+ </div>
438
+ `,_a=`
439
+ .mobile-wallet-adapter-embedded-modal-close {
440
+ display: none;
441
+ }
442
+ .mobile-wallet-adapter-embedded-modal-content {
443
+ text-align: center;
444
+ min-width: 300px;
445
+ }
446
+ .mobile-wallet-adapter-embedded-modal-launch-icon {
447
+ margin-top: 24px;
448
+ }
449
+ .mobile-wallet-adapter-embedded-modal-title {
450
+ margin: 18px 100px 30px 100px;
451
+ color: #000000;
452
+ font-size: 2.75em;
453
+ font-weight: 600;
454
+ }
455
+ .mobile-wallet-adapter-embedded-modal-launch-action {
456
+ display: block;
457
+ width: 100%;
458
+ height: 56px;
459
+ font-size: 1.25em;
460
+ background: #000000;
461
+ color: #FFFFFF;
462
+ border-radius: 18px;
463
+ }
464
+ /* Smaller screens */
465
+ @media all and (max-width: 600px) {
466
+ .mobile-wallet-adapter-embedded-modal-title {
467
+ font-size: 1.5em;
468
+ margin-right: 12px;
469
+ margin-left: 12px;
470
+ }
471
+ }
472
+ `;var vt,Ro,kn,Sa=(kn=class extends st{constructor(){super(...arguments);u(this,vt);M(this,"contentStyles",Ra)}get contentHtml(){const t=Oa()?"Long press the app icon on your home screen to open site settings":"Tap the lock or settings icon in the address bar to open site settings";return Aa.replace("{{PERMISSION_INSTRUCTION_DETAIL}}",t)}async init(){super.init(),k(this,vt,Ro).call(this)}},vt=new WeakSet,Ro=function(){var o;const t=(o=this.dom)==null?void 0:o.getElementById("mobile-wallet-adapter-launch-action"),n=async i=>{t==null||t.removeEventListener("click",n),this.close(i)};t==null||t.addEventListener("click",n)},kn);const Aa=`
473
+ <div class="mobile-wallet-adapter-embedded-modal-header">
474
+ Local Wallet Connection
475
+ </div>
476
+ <svg width="48" height="48" viewBox="0 0 48 48" fill="none" xmlns="http://www.w3.org/2000/svg">
477
+ <path d="M21.6 48C7.2 48 0 40.8 0 26.4V21.6C0 7.2 7.2 0 21.6 0H26.4C40.8 0 48 7.2 48 21.6V26.4C48 40.8 40.8 48 26.4 48H21.6Z" fill="#ED1515"/>
478
+ <mask id="mask0_147_1364" style="mask-type:alpha" maskUnits="userSpaceOnUse" x="8" y="8" width="32" height="32">
479
+ <rect x="8" y="8" width="32" height="32" fill="#D9D9D9"/>
480
+ </mask>
481
+ <g mask="url(#mask0_147_1364)">
482
+ <path d="M20.1398 36.2705C19.7363 36.2705 19.3508 36.1945 18.9835 36.0425C18.6162 35.8907 18.2916 35.674 18.0098 35.3922L12.6072 29.9895C12.3254 29.7077 12.1086 29.3832 11.9568 29.0158C11.8048 28.6485 11.7288 28.2631 11.7288 27.8595V20.1395C11.7288 19.736 11.8048 19.3505 11.9568 18.9832C12.1086 18.6158 12.3254 18.2913 12.6072 18.0095L18.0098 12.6068C18.2916 12.3251 18.6162 12.1083 18.9835 11.9565C19.3508 11.8045 19.7363 11.7285 20.1398 11.7285H27.8598C28.2634 11.7285 28.6488 11.8045 29.0162 11.9565C29.3835 12.1083 29.708 12.3251 29.9898 12.6068L35.3925 18.0095C35.6743 18.2913 35.891 18.6158 36.0428 18.9832C36.1948 19.3505 36.2708 19.736 36.2708 20.1395V27.8595C36.2708 28.2631 36.1948 28.6485 36.0428 29.0158C35.891 29.3832 35.6743 29.7077 35.3925 29.9895L29.9898 35.3922C29.708 35.674 29.3835 35.8907 29.0162 36.0425C28.6488 36.1945 28.2634 36.2705 27.8598 36.2705H20.1398ZM20.1732 33.2372H27.8265L33.2375 27.8262V20.1728L27.8265 14.7618H20.1732L14.7622 20.1728V27.8262L20.1732 33.2372ZM23.9998 25.9538L26.7868 28.7408C27.0473 29.0013 27.3729 29.1302 27.7638 29.1275C28.1549 29.1248 28.4807 28.9933 28.7412 28.7328C29.0016 28.4724 29.1318 28.1466 29.1318 27.7555C29.1318 27.3646 29.0016 27.039 28.7412 26.7785L25.9542 23.9995L28.7412 21.2125C29.0016 20.9521 29.1318 20.6264 29.1318 20.2355C29.1318 19.8444 29.0016 19.5186 28.7412 19.2582C28.4807 18.9977 28.1549 18.8675 27.7638 18.8675C27.3729 18.8675 27.0473 18.9977 26.7868 19.2582L23.9998 22.0452L21.2128 19.2582C20.9524 18.9977 20.628 18.8675 20.2398 18.8675C19.8514 18.8675 19.5269 18.9977 19.2665 19.2582C19.006 19.5186 18.8758 19.8444 18.8758 20.2355C18.8758 20.6264 19.006 20.9521 19.2665 21.2125L22.0455 23.9995L19.2585 26.7865C18.998 27.047 18.8692 27.3713 18.8718 27.7595C18.8745 28.148 19.006 28.4724 19.2665 28.7328C19.5269 28.9933 19.8527 29.1235 20.2438 29.1235C20.6347 29.1235 20.9604 28.9933 21.2208 28.7328L23.9998 25.9538Z" fill="black"/>
483
+ </g>
484
+ </svg>
485
+ <div class="mobile-wallet-adapter-embedded-modal-title">
486
+ Your wallet connection is blocked
487
+ </div>
488
+ <div id="mobile-wallet-adapter-local-launch-message" class="mobile-wallet-adapter-embedded-modal-subtitle">
489
+ Visit site settings in the address bar and allow "Apps on Device".
490
+ </div>
491
+
492
+ <div class="mobile-wallet-adapter-embedded-modal-divider"><hr></div>
493
+ <div class="mobile-wallet-adapter-embedded-modal-footer">
494
+ <div class="mobile-wallet-adapter-embedded-modal-details">
495
+ <!-- Clickable header (label associated with the checkbox) -->
496
+ <label for="collapsible-1" class="mobile-wallet-adapter-embedded-modal-details-collapsible-header">
497
+ <!-- Hidden checkbox to track state -->
498
+ <input type="checkbox" id="collapsible-1" class="mobile-wallet-adapter-embedded-modal-details-collapsible-input">
499
+ <span class="mobile-wallet-adapter-embedded-modal-details-collapsible-header-label">
500
+ See details
501
+ </span>
502
+ <svg class="mobile-wallet-adapter-embedded-modal-details-collapsible-header-icon" width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
503
+ <mask id="mask0_147_1382" style="mask-type:alpha" maskUnits="userSpaceOnUse" x="0" y="0" width="24" height="24">
504
+ <rect width="24" height="24" fill="#D9D9D9"/>
505
+ </mask>
506
+ <g mask="url(#mask0_147_1382)">
507
+ <path d="M11.9999 17.0811C11.8506 17.0811 11.7087 17.0563 11.5741 17.0067C11.4395 16.957 11.3162 16.8762 11.2042 16.7643L6.57924 12.1393C6.36801 11.9281 6.26656 11.667 6.27489 11.3561C6.28322 11.0453 6.39301 10.7842 6.60424 10.573C6.81547 10.3618 7.08069 10.2561 7.39989 10.2561C7.71909 10.2561 7.9843 10.3618 8.19554 10.573L11.9999 14.3773L15.8292 10.548C16.0405 10.3368 16.3015 10.2353 16.6124 10.2436C16.9233 10.252 17.1843 10.3618 17.3955 10.573C17.6068 10.7842 17.7124 11.0494 17.7124 11.3686C17.7124 11.6878 17.6068 11.9531 17.3955 12.1643L12.7955 16.7643C12.6836 16.8762 12.5603 16.957 12.4257 17.0067C12.2911 17.0563 12.1492 17.0811 11.9999 17.0811Z" fill="black"/>
508
+ </g>
509
+ </svg>
510
+ </label>
511
+
512
+ <!-- Content to show/hide -->
513
+ <ul class="mobile-wallet-adapter-embedded-modal-details-collapsible-content">
514
+ <li>{{PERMISSION_INSTRUCTION_DETAIL}}</li>
515
+ <li>Allow "Apps on Device"</li>
516
+ </ul>
517
+ </div>
518
+ </div>
519
+ <div>
520
+ <button data-modal-action id="mobile-wallet-adapter-launch-action" class="mobile-wallet-adapter-embedded-modal-launch-action">
521
+ Got it
522
+ </button>
523
+ </div>
524
+ `,Ra=`
525
+ .mobile-wallet-adapter-embedded-modal-close {
526
+ display: none;
527
+ }
528
+ .mobile-wallet-adapter-embedded-modal-content {
529
+ text-align: center;
530
+ }
531
+ .mobile-wallet-adapter-embedded-modal-header {
532
+ margin: 18px auto 30px auto;
533
+ color: #7D9093;
534
+ font-size: 1.0em;
535
+ font-weight: 500;
536
+ }
537
+ .mobile-wallet-adapter-embedded-modal-title {
538
+ margin: 18px 100px auto 100px;
539
+ color: #000000;
540
+ font-size: 2.75em;
541
+ font-weight: 600;
542
+ }
543
+ .mobile-wallet-adapter-embedded-modal-subtitle {
544
+ margin: 12px 60px 30px 60px;
545
+ color: #7D9093;
546
+ font-size: 1.25em;
547
+ font-weight: 400;
548
+ }
549
+ .mobile-wallet-adapter-embedded-modal-details-collapsible-header {
550
+ display: flex;
551
+ flex-direction: row;
552
+ justify-content: space-between;
553
+ margin: 10px auto 10px auto;
554
+ color: #000000;
555
+ font-size: 1.5em;
556
+ font-weight: 600;
557
+ cursor: pointer; /* Show pointer on hover */
558
+ transition: background 0.2s ease; /* Smooth background change */
559
+ }
560
+ .mobile-wallet-adapter-embedded-modal-details-collapsible-header-icon {
561
+ transition: rotate 0.3s ease;
562
+ }
563
+ .mobile-wallet-adapter-embedded-modal-details-collapsible-input {
564
+ display: none; /* Hide the checkbox */
565
+ }
566
+ .mobile-wallet-adapter-embedded-modal-details-collapsible-content {
567
+ margin: 0px auto 40px auto;
568
+ max-height: 0px; /* Collapse content */
569
+ overflow: hidden; /* Hide overflow when collapsed */
570
+ transition: max-height 0.3s ease; /* Smooth transition */
571
+ }
572
+ .mobile-wallet-adapter-embedded-modal-details-collapsible-content li {
573
+ margin: 20px auto;
574
+ color: #000000;
575
+ font-size: 1.25em;
576
+ font-weight: 400;
577
+ text-align: left;
578
+ }
579
+ /* When checkbox is checked, show content */
580
+ .mobile-wallet-adapter-embedded-modal-details-collapsible-header:has(> input:checked) ~ .mobile-wallet-adapter-embedded-modal-details-collapsible-content {
581
+ max-height: 300px;
582
+ }
583
+ .mobile-wallet-adapter-embedded-modal-details-collapsible-header:has(> input:checked) > .mobile-wallet-adapter-embedded-modal-details-collapsible-header-icon {
584
+ rotate: 180deg;
585
+ }
586
+ .mobile-wallet-adapter-embedded-modal-launch-action {
587
+ display: block;
588
+ width: 100%;
589
+ height: 56px;
590
+ /*margin-top: 40px;*/
591
+ font-size: 1.25em;
592
+ /*line-height: 24px;*/
593
+ /*letter-spacing: -1%;*/
594
+ background: #000000;
595
+ color: #FFFFFF;
596
+ border-radius: 18px;
597
+ }
598
+ /* Smaller screens */
599
+ @media all and (max-width: 600px) {
600
+ .mobile-wallet-adapter-embedded-modal-title {
601
+ font-size: 1.75em;
602
+ margin-right: 12px;
603
+ margin-left: 12px;
604
+ }
605
+ .mobile-wallet-adapter-embedded-modal-subtitle {
606
+ margin-right: 12px;
607
+ margin-left: 12px;
608
+ }
609
+ }
610
+ `;var _t,Lo,Pn,La=(Pn=class extends st{constructor(){super(...arguments);u(this,_t);M(this,"contentStyles",Ma);M(this,"contentHtml",Ta)}async init(){super.init(),k(this,_t,Lo).call(this)}},_t=new WeakSet,Lo=function(){var o;const t=(o=this.dom)==null?void 0:o.getElementById("mobile-wallet-adapter-launch-action"),n=async()=>{t==null||t.removeEventListener("click",n);try{await fetch("http://localhost")}catch{}this.close()};t==null||t.addEventListener("click",n)},Pn);const Ta=`
611
+ <div class="mobile-wallet-adapter-embedded-modal-title">Allow connections to your wallet</div>
612
+ <div id="mobile-wallet-adapter-local-launch-message" class="mobile-wallet-adapter-embedded-modal-subtitle">
613
+ Tap "Allow" on the next screen
614
+ </div>
615
+ <svg class="mobile-wallet-adapter-embedded-modal-permission-prompt-mock" xmlns="http://www.w3.org/2000/svg" width="281" height="83" viewBox="0 0 281 83" fill="none">
616
+ <rect width="281" height="83" rx="22" fill="#F0F3F5"/>
617
+ <path d="M254.194 64L252.626 56.657H254.047L254.866 61.452L254.985 62.278H255.02L255.146 61.452L255.993 57.497H257.4L258.254 61.431L258.373 62.278H258.415L258.534 61.431L259.346 56.657H260.718L259.143 64H257.673L256.826 59.961L256.693 59.093H256.651L256.511 59.961L255.664 64H254.194Z" fill="black"/>
618
+ <path d="M248.837 64.231C248.147 64.231 247.54 64.07 247.017 63.748C246.495 63.426 246.086 62.978 245.792 62.404C245.498 61.83 245.351 61.1673 245.351 60.416V60.241C245.351 59.4897 245.498 58.827 245.792 58.253C246.086 57.679 246.495 57.2333 247.017 56.916C247.54 56.594 248.147 56.433 248.837 56.433C249.528 56.433 250.135 56.594 250.657 56.916C251.18 57.2333 251.588 57.679 251.882 58.253C252.176 58.827 252.323 59.4897 252.323 60.241V60.416C252.323 61.1673 252.176 61.83 251.882 62.404C251.588 62.978 251.18 63.426 250.657 63.748C250.135 64.07 249.528 64.231 248.837 64.231ZM248.837 62.824C249.43 62.824 249.897 62.607 250.237 62.173C250.583 61.7343 250.755 61.1417 250.755 60.395V60.262C250.755 59.5107 250.583 58.918 250.237 58.484C249.897 58.05 249.43 57.833 248.837 57.833C248.249 57.833 247.783 58.05 247.437 58.484C247.092 58.918 246.919 59.5107 246.919 60.262V60.395C246.919 61.1417 247.092 61.7343 247.437 62.173C247.783 62.607 248.249 62.824 248.837 62.824Z" fill="black"/>
619
+ <path d="M242.298 64.231C241.467 64.231 240.814 63.993 240.338 63.517C239.866 63.0364 239.631 62.3737 239.631 61.529V53.78H241.178V61.389C241.178 62.3317 241.591 62.803 242.417 62.803C242.65 62.803 242.865 62.7587 243.061 62.67C243.257 62.5814 243.464 62.4367 243.684 62.236L244.538 63.377C244.225 63.6664 243.884 63.881 243.516 64.021C243.152 64.161 242.746 64.231 242.298 64.231ZM237.51 55.061V53.78H240.611V55.061H237.51Z" fill="black"/>
620
+ <path d="M234.463 64.231C233.633 64.231 232.979 63.993 232.503 63.517C232.032 63.0364 231.796 62.3737 231.796 61.529V53.78H233.343V61.389C233.343 62.3317 233.756 62.803 234.582 62.803C234.816 62.803 235.03 62.7587 235.226 62.67C235.422 62.5814 235.63 62.4367 235.849 62.236L236.703 63.377C236.391 63.6664 236.05 63.881 235.681 64.021C235.317 64.161 234.911 64.231 234.463 64.231ZM229.675 55.061V53.78H232.776V55.061H229.675Z" fill="black"/>
621
+ <path d="M221.442 64L224.557 53.976H226.132L229.233 64H227.581L225.642 56.972L225.341 55.761H225.299L225.005 56.972L223.073 64H221.442ZM222.835 61.634L223.255 60.29H227.371L227.805 61.634H222.835Z" fill="black"/>
622
+ <path d="M178.261 64L175.034 60.066V60.024L178.121 56.657H180.011L176.504 60.423V59.632L180.165 64H178.261ZM173.543 64V53.78H175.097V64H173.543Z" fill="#7D9093" fill-opacity="0.5"/>
623
+ <path d="M169.306 64.224C168.588 64.224 167.958 64.0653 167.416 63.748C166.88 63.426 166.462 62.9803 166.163 62.411C165.865 61.837 165.715 61.1673 165.715 60.402V60.248C165.715 59.4873 165.862 58.8223 166.156 58.253C166.45 57.679 166.863 57.2333 167.395 56.916C167.927 56.594 168.546 56.433 169.25 56.433C169.978 56.433 170.59 56.6056 171.084 56.951C171.579 57.2917 171.955 57.777 172.211 58.407L170.874 58.995C170.72 58.6123 170.508 58.323 170.237 58.127C169.967 57.9263 169.633 57.826 169.236 57.826C168.63 57.826 168.149 58.0383 167.794 58.463C167.444 58.883 167.269 59.4616 167.269 60.199V60.465C167.269 61.1837 167.454 61.7577 167.822 62.187C168.196 62.6163 168.69 62.831 169.306 62.831C169.712 62.831 170.06 62.733 170.349 62.537C170.639 62.341 170.877 62.0423 171.063 61.641L172.379 62.285C172.188 62.6957 171.941 63.0457 171.637 63.335C171.334 63.6243 170.986 63.846 170.594 64C170.202 64.1493 169.773 64.224 169.306 64.224Z" fill="#7D9093" fill-opacity="0.5"/>
624
+ <path d="M161.003 64.231C160.312 64.231 159.706 64.07 159.183 63.748C158.66 63.426 158.252 62.978 157.958 62.404C157.664 61.83 157.517 61.1673 157.517 60.416V60.241C157.517 59.4897 157.664 58.827 157.958 58.253C158.252 57.679 158.66 57.2333 159.183 56.916C159.706 56.594 160.312 56.433 161.003 56.433C161.694 56.433 162.3 56.594 162.823 56.916C163.346 57.2333 163.754 57.679 164.048 58.253C164.342 58.827 164.489 59.4897 164.489 60.241V60.416C164.489 61.1673 164.342 61.83 164.048 62.404C163.754 62.978 163.346 63.426 162.823 63.748C162.3 64.07 161.694 64.231 161.003 64.231ZM161.003 62.824C161.596 62.824 162.062 62.607 162.403 62.173C162.748 61.7343 162.921 61.1417 162.921 60.395V60.262C162.921 59.5107 162.748 58.918 162.403 58.484C162.062 58.05 161.596 57.833 161.003 57.833C160.415 57.833 159.948 58.05 159.603 58.484C159.258 58.918 159.085 59.5107 159.085 60.262V60.395C159.085 61.1417 159.258 61.7343 159.603 62.173C159.948 62.607 160.415 62.824 161.003 62.824Z" fill="#7D9093" fill-opacity="0.5"/>
625
+ <path d="M154.463 64.231C153.633 64.231 152.979 63.993 152.503 63.517C152.032 63.0364 151.796 62.3737 151.796 61.529V53.78H153.343V61.389C153.343 62.3317 153.756 62.803 154.582 62.803C154.816 62.803 155.03 62.7587 155.226 62.67C155.422 62.5814 155.63 62.4367 155.849 62.236L156.703 63.377C156.391 63.6664 156.05 63.881 155.681 64.021C155.317 64.161 154.911 64.231 154.463 64.231ZM149.675 55.061V53.78H152.776V55.061H149.675Z" fill="#7D9093" fill-opacity="0.5"/>
626
+ <path d="M142.24 64V53.976H145.544C146.421 53.976 147.112 54.1953 147.616 54.634C148.12 55.0726 148.372 55.6583 148.372 56.391V56.566C148.372 57.0886 148.246 57.5366 147.994 57.91C147.742 58.2833 147.38 58.5586 146.909 58.736V58.792C147.492 58.9226 147.947 59.2003 148.274 59.625C148.605 60.045 148.771 60.5606 148.771 61.172V61.361C148.771 61.893 148.645 62.3573 148.393 62.754C148.145 63.1506 147.795 63.4586 147.343 63.678C146.895 63.8926 146.365 64 145.754 64H142.24ZM143.794 62.656H145.572C146.085 62.656 146.482 62.5253 146.762 62.264C147.042 62.0026 147.182 61.6293 147.182 61.144V60.99C147.182 60.5046 147.037 60.1313 146.748 59.87C146.463 59.604 146.05 59.471 145.509 59.471H143.36V58.183H145.32C145.791 58.183 146.153 58.064 146.405 57.826C146.657 57.588 146.783 57.2496 146.783 56.811V56.685C146.783 56.2416 146.657 55.9033 146.405 55.67C146.157 55.4366 145.796 55.32 145.32 55.32H143.794V62.656Z" fill="#7D9093" fill-opacity="0.5"/>
627
+ <rect x="18" y="17" width="246" height="7" rx="3.5" fill="#7D9093" fill-opacity="0.26"/>
628
+ <rect x="18" y="33" width="82" height="7" rx="3.5" fill="#7D9093" fill-opacity="0.26"/>
629
+ </svg>
630
+ <div>
631
+ <button data-modal-action id="mobile-wallet-adapter-launch-action" class="mobile-wallet-adapter-embedded-modal-launch-action">
632
+ Continue to Allow
633
+ </button>
634
+ </div>
635
+ `,Ma=`
636
+ .mobile-wallet-adapter-embedded-modal-close {
637
+ display: none;
638
+ }
639
+ .mobile-wallet-adapter-embedded-modal-content {
640
+ text-align: center;
641
+ }
642
+ .mobile-wallet-adapter-embedded-modal-title {
643
+ margin: 18px 100px auto 100px;
644
+ color: #000000;
645
+ font-size: 2.75em;
646
+ font-weight: 600;
647
+ }
648
+ .mobile-wallet-adapter-embedded-modal-subtitle {
649
+ margin: 20px 60px 40px 60px;
650
+ color: #7D9093;
651
+ font-size: 1.25em;
652
+ font-weight: 400;
653
+ }
654
+ .mobile-wallet-adapter-embedded-modal-permission-prompt-mock {
655
+ width: 90%;
656
+ height: auto;
657
+ margin: 0 auto 30px auto;
658
+ display: block;
659
+ }
660
+ .mobile-wallet-adapter-embedded-modal-launch-action {
661
+ display: block;
662
+ width: 100%;
663
+ height: 56px;
664
+ font-size: 1.25em;
665
+ background: #000000;
666
+ color: #FFFFFF;
667
+ border-radius: 18px;
668
+ }
669
+ /* Smaller screens */
670
+ @media all and (max-width: 600px) {
671
+ .mobile-wallet-adapter-embedded-modal-title {
672
+ font-size: 1.5em;
673
+ margin-right: 12px;
674
+ margin-left: 12px;
675
+ }
676
+ .mobile-wallet-adapter-embedded-modal-subtitle {
677
+ margin-right: 12px;
678
+ margin-left: 12px;
679
+ }
680
+ }
681
+ `;function Ia(){return typeof window<"u"&&window.isSecureContext&&typeof document<"u"&&/android/i.test(navigator.userAgent)}function xa(){return typeof window<"u"&&window.isSecureContext&&typeof document<"u"&&!/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)}function Na(e){return/(WebView|Version\/.+(Chrome)\/(\d+)\.(\d+)\.(\d+)\.(\d+)|; wv\).+(Chrome)\/(\d+)\.(\d+)\.(\d+)\.(\d+))/i.test(e)}function To(e){return e.includes("Solana Mobile Web Shell")}function Oa(){const e=typeof document<"u"&&document.referrer.startsWith("android-app://");if(typeof window>"u")return e;const t=window.matchMedia("(display-mode: standalone)").matches,n=window.matchMedia("(display-mode: fullscreen)").matches,o=window.matchMedia("(display-mode: minimal-ui)").matches;return e||t||n||o}async function Mo(){if(!(typeof navigator<"u"&&To(navigator.userAgent)))try{const e=await navigator.permissions.query({name:"loopback-network"});if(e.state==="granted")return;if(e.state==="denied"){const t=new Sa;throw t.init(),t.open(),new x(O.ERROR_LOOPBACK_ACCESS_BLOCKED,"Local Network Access permission denied")}else if(e.state==="prompt"){const t=new La;if(await new Promise((n,o)=>{t.addEventListener("close",i=>{i&&o(new x(O.ERROR_ASSOCIATION_CANCELLED,"Wallet connection cancelled by user",{event:i}))}),e.onchange=()=>{e.onchange=null,n(e.state)},t.init(),t.open()})==="granted"){const n=new Ca;await new Promise((o,i)=>{n.addEventListener("close",a=>{a&&i(new x(O.ERROR_ASSOCIATION_CANCELLED,"Wallet connection cancelled by user",{event:a}))}),n.initWithCallback(async()=>{o(!0)}),n.open()});return}else return await Mo()}throw new x(O.ERROR_LOOPBACK_ACCESS_BLOCKED,"Local Network Access permission unknown")}catch(e){if(e instanceof TypeError&&(e.message.includes("loopback-network")||e.message.includes("local-network-access")))return;throw e instanceof x?e:new x(O.ERROR_LOOPBACK_ACCESS_BLOCKED,e instanceof Error?e.message:"Local Network Access permission unknown")}}const Io="data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjQiIGhlaWdodD0iMjQiIHZpZXdCb3g9IjAgMCAyNCAyNCIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KPHBhdGggZmlsbC1ydWxlPSJldmVub2RkIiBjbGlwLXJ1bGU9ImV2ZW5vZGQiIGQ9Ik03IDIuNUgxN0MxNy44Mjg0IDIuNSAxOC41IDMuMTcxNTcgMTguNSA0VjIwQzE4LjUgMjAuODI4NCAxNy44Mjg0IDIxLjUgMTcgMjEuNUg3QzYuMTcxNTcgMjEuNSA1LjUgMjAuODI4NCA1LjUgMjBWNEM1LjUgMy4xNzE1NyA2LjE3MTU3IDIuNSA3IDIuNVpNMyA0QzMgMS43OTA4NiA0Ljc5MDg2IDAgNyAwSDE3QzE5LjIwOTEgMCAyMSAxLjc5MDg2IDIxIDRWMjBDMjEgMjIuMjA5MSAxOS4yMDkxIDI0IDE3IDI0SDdDNC43OTA4NiAyNCAzIDIyLjIwOTEgMyAyMFY0Wk0xMSA0LjYxNTM4QzEwLjQ0NzcgNC42MTUzOCAxMCA1LjA2MzEgMTAgNS42MTUzOFY2LjM4NDYyQzEwIDYuOTM2OSAxMC40NDc3IDcuMzg0NjIgMTEgNy4zODQ2MkgxM0MxMy41NTIzIDcuMzg0NjIgMTQgNi45MzY5IDE0IDYuMzg0NjJWNS42MTUzOEMxNCA1LjA2MzEgMTMuNTUyMyA0LjYxNTM4IDEzIDQuNjE1MzhIMTFaIiBmaWxsPSIjRENCOEZGIi8+Cjwvc3ZnPgo=",xo="Mobile Wallet Adapter",No="Remote Mobile Wallet Adapter",Oo=64,ko=[fe,pe,un,dn],ka=3e4;function H(e){return e instanceof Error?e.message:"Unknown error"}var X,St,At,Rt,Lt,ge,B,V,q,we,$,He,be,We,Tt,ie,pt,Bo,Mt,Ke,ue,Ve,ye,je,he,Ee,qe,It,xt,Ze,Qe,Nt,Ot,Ge,Bn,Po=(Bn=class{constructor(e){u(this,ie);u(this,X,{});u(this,St,"1.0.0");u(this,At,xo);u(this,Rt,"https://solanamobile.com/wallets");u(this,Lt,Io);u(this,ge);u(this,B);u(this,V);u(this,q,!1);u(this,we,0);u(this,$,[]);u(this,He);u(this,be);u(this,We);u(this,Tt,(e,t)=>{var n;return(n=s(this,X)[e])!=null&&n.push(t)||(s(this,X)[e]=[t]),()=>k(this,ie,Bo).call(this,e,t)});u(this,Mt,async({silent:e}={})=>{if(s(this,q)||this.connected)return{accounts:this.accounts};A(this,q,!0);try{if(e){const t=await s(this,V).get();if(t)await s(this,Ve).call(this,t.capabilities),await s(this,ue).call(this,t);else return{accounts:this.accounts}}else await s(this,Ke).call(this)}catch(t){throw new Error(H(t),{cause:t})}finally{A(this,q,!1)}return{accounts:this.accounts}});u(this,Ke,async e=>{try{const t=await s(this,V).get();if(t)return s(this,ue).call(this,t),t;const n=await s(this,He).select(s(this,$));return await s(this,he).call(this,async o=>{const[i,a]=await Promise.all([o.getCapabilities(),o.authorize({chain:n,identity:s(this,ge),sign_in_payload:e})]),r=s(this,qe).call(this,a.accounts),l={...a,accounts:r,chain:n,capabilities:i};return Promise.all([s(this,Ve).call(this,i),s(this,V).set(l),s(this,ue).call(this,l)]),l})}catch(t){throw new Error(H(t),{cause:t})}});u(this,ue,async e=>{var n;const t=s(this,B)==null||((n=s(this,B))==null?void 0:n.accounts.length)!==e.accounts.length||s(this,B).accounts.some((o,i)=>o.address!==e.accounts[i].address);A(this,B,e),t&&k(this,ie,pt).call(this,"change",{accounts:this.accounts})});u(this,Ve,async e=>{const t=e.features.includes("solana:signTransactions"),n=e.supports_sign_and_send_transactions,o=fe in this.features!==n||pe in this.features!==t;A(this,be,{...(n||!n&&!t)&&{[fe]:{version:"1.0.0",supportedTransactionVersions:["legacy",0],signAndSendTransaction:s(this,Ze)}},...t&&{[pe]:{version:"1.0.0",supportedTransactionVersions:["legacy",0],signTransaction:s(this,Qe)}}}),o&&k(this,ie,pt).call(this,"change",{features:this.features})});u(this,ye,async(e,t,n)=>{var o;try{const[i,a]=await Promise.all([((o=s(this,B))==null?void 0:o.capabilities)??await e.getCapabilities(),e.authorize({auth_token:t,identity:s(this,ge),chain:n})]),r=s(this,qe).call(this,a.accounts),l={...a,accounts:r,chain:n,capabilities:i};Promise.all([s(this,V).set(l),s(this,ue).call(this,l)])}catch(i){throw s(this,je).call(this),new Error(H(i),{cause:i})}});u(this,je,async()=>{s(this,V).clear(),A(this,q,!1),Jt(this,we)._++,A(this,B,void 0),k(this,ie,pt).call(this,"change",{accounts:this.accounts})});u(this,he,async e=>{var a;const t=(a=s(this,B))==null?void 0:a.wallet_uri_base,n=t?{baseUri:t}:void 0,o=s(this,we),i=new pa;try{let r=!0,l;const c=await Promise.race([Mo().then(async()=>{i.init();const{wallet:d,close:h}=await _i(n);r=!1,i.addEventListener("close",w=>{w&&h()}),i.open();const S=await e(await d);return i.close(),h(),S}),new Promise((d,h)=>{l=setTimeout(()=>{r&&h(new x(O.ERROR_ASSOCIATION_CANCELLED,"Wallet connection timed out",{event:void 0}))},ka)})]);return clearTimeout(l),c}catch(r){throw i.close(),s(this,we)!==o&&await new Promise(()=>{}),r instanceof Error&&r.name==="SolanaMobileWalletAdapterError"&&r.code==="ERROR_WALLET_NOT_FOUND"&&await s(this,We).call(this,this),r}});u(this,Ee,()=>{if(!s(this,B))throw new Error("Wallet not connected");return{authToken:s(this,B).auth_token,chain:s(this,B).chain}});u(this,qe,e=>e.map(t=>{const n=z(t.address);return{address:Be.encode(n),publicKey:n,label:t.label,icon:t.icon,chains:t.chains??s(this,$),features:t.features??ko}}));u(this,It,async e=>{const{authToken:t,chain:n}=s(this,Ee).call(this);try{const o=e.map(i=>oe(i));return await s(this,he).call(this,async i=>(await s(this,ye).call(this,i,t,n),(await i.signTransactions({payloads:o})).signed_payloads.map(z)))}catch(o){throw new Error(H(o),{cause:o})}});u(this,xt,async(e,t)=>{const{authToken:n,chain:o}=s(this,Ee).call(this);try{return await s(this,he).call(this,async i=>{const[a]=await Promise.all([i.getCapabilities(),s(this,ye).call(this,i,n,o)]);if(a.supports_sign_and_send_transactions){const r=oe(e);return(await i.signAndSendTransactions({...t,payloads:[r]})).signatures.map(z)[0]}else throw new Error("connected wallet does not support signAndSendTransaction")})}catch(i){throw new Error(H(i),{cause:i})}});u(this,Ze,async(...e)=>{const t=[];for(const n of e){const o=await s(this,xt).call(this,n.transaction,n.options);t.push({signature:o})}return t});u(this,Qe,async(...e)=>(await s(this,It).call(this,e.map(({transaction:t})=>t))).map(t=>({signedTransaction:t})));u(this,Nt,async(...e)=>{const{authToken:t,chain:n}=s(this,Ee).call(this),o=e.map(({account:a})=>oe(new Uint8Array(a.publicKey))),i=e.map(({message:a})=>oe(a));try{return await s(this,he).call(this,async a=>(await s(this,ye).call(this,a,t,n),(await a.signMessages({addresses:o,payloads:i})).signed_payloads.map(z).map(r=>({signedMessage:r,signature:r.slice(-Oo)}))))}catch(a){throw new Error(H(a),{cause:a})}});u(this,Ot,async(...e)=>{const t=[];if(e.length>1)for(const n of e)t.push(await s(this,Ge).call(this,n));else return[await s(this,Ge).call(this,e[0])];return t});u(this,Ge,async e=>{A(this,q,!0);try{const t=await s(this,Ke).call(this,{...e,domain:(e==null?void 0:e.domain)??window.location.host});if(!t.sign_in_result)throw new Error("Sign in failed, no sign in result returned by wallet");const n=t.sign_in_result.address,o=t.accounts.find(i=>i.address==n);return{account:{...o??{address:Be.encode(z(n))},publicKey:z(n),chains:(o==null?void 0:o.chains)??s(this,$),features:(o==null?void 0:o.features)??t.capabilities.features},signedMessage:z(t.sign_in_result.signed_message),signature:z(t.sign_in_result.signature)}}catch(t){throw new Error(H(t),{cause:t})}finally{A(this,q,!1)}});A(this,V,e.authorizationCache),A(this,ge,e.appIdentity),A(this,$,e.chains),A(this,He,e.chainSelector),A(this,We,e.onWalletNotFound),A(this,be,{[fe]:{version:"1.0.0",supportedTransactionVersions:["legacy",0],signAndSendTransaction:s(this,Ze)},[pe]:{version:"1.0.0",supportedTransactionVersions:["legacy",0],signTransaction:s(this,Qe)}})}get version(){return s(this,St)}get name(){return s(this,At)}get url(){return s(this,Rt)}get icon(){return s(this,Lt)}get chains(){return s(this,$)}get features(){return{[Fn]:{version:"1.0.0",connect:s(this,Mt)},[zn]:{version:"1.0.0",disconnect:s(this,je)},[Un]:{version:"1.0.0",on:s(this,Tt)},[un]:{version:"1.0.0",signMessage:s(this,Nt)},[dn]:{version:"1.0.0",signIn:s(this,Ot)},...s(this,be)}}get accounts(){var e;return((e=s(this,B))==null?void 0:e.accounts)??[]}get connected(){return!!s(this,B)}get isAuthorized(){return!!s(this,B)}get currentAuthorization(){return s(this,B)}get cachedAuthorizationResult(){return s(this,V).get()}},X=new WeakMap,St=new WeakMap,At=new WeakMap,Rt=new WeakMap,Lt=new WeakMap,ge=new WeakMap,B=new WeakMap,V=new WeakMap,q=new WeakMap,we=new WeakMap,$=new WeakMap,He=new WeakMap,be=new WeakMap,We=new WeakMap,Tt=new WeakMap,ie=new WeakSet,pt=function(e,...t){var n;(n=s(this,X)[e])==null||n.forEach(o=>o.apply(null,t))},Bo=function(e,t){var n;s(this,X)[e]=(n=s(this,X)[e])==null?void 0:n.filter(o=>t!==o)},Mt=new WeakMap,Ke=new WeakMap,ue=new WeakMap,Ve=new WeakMap,ye=new WeakMap,je=new WeakMap,he=new WeakMap,Ee=new WeakMap,qe=new WeakMap,It=new WeakMap,xt=new WeakMap,Ze=new WeakMap,Qe=new WeakMap,Nt=new WeakMap,Ot=new WeakMap,Ge=new WeakMap,Bn),ee,kt,Pt,Bt,Dt,Ce,D,Z,Q,ve,te,Je,_e,Ye,Xe,K,Ut,ae,ft,Uo,zt,$e,Se,Ft,Ae,et,me,Re,tt,Ht,Wt,nt,ot,Kt,Vt,it,Dn,Do=(Dn=class{constructor(e){u(this,ae);u(this,ee,{});u(this,kt,"1.0.0");u(this,Pt,No);u(this,Bt,"https://solanamobile.com/wallets");u(this,Dt,Io);u(this,Ce);u(this,D);u(this,Z);u(this,Q,!1);u(this,ve,0);u(this,te,[]);u(this,Je);u(this,_e);u(this,Ye);u(this,Xe);u(this,K);u(this,Ut,(e,t)=>{var n;return(n=s(this,ee)[e])!=null&&n.push(t)||(s(this,ee)[e]=[t]),()=>k(this,ae,Uo).call(this,e,t)});u(this,zt,async(e={})=>{if(s(this,Q)||this.connected)return{accounts:this.accounts};A(this,Q,!0);try{await s(this,$e).call(this)}catch(t){throw new Error(H(t),{cause:t})}finally{A(this,Q,!1)}return{accounts:this.accounts}});u(this,$e,async e=>{try{const t=await s(this,Z).get();if(t)return s(this,Se).call(this,t),t;s(this,K)&&A(this,K,void 0);const n=await s(this,Je).select(s(this,te));return await s(this,me).call(this,async o=>{const[i,a]=await Promise.all([o.getCapabilities(),o.authorize({chain:n,identity:s(this,Ce),sign_in_payload:e})]),r=s(this,tt).call(this,a.accounts),l={...a,accounts:r,chain:n,capabilities:i};return Promise.all([s(this,Ft).call(this,i),s(this,Z).set(l),s(this,Se).call(this,l)]),l})}catch(t){throw new Error(H(t),{cause:t})}});u(this,Se,async e=>{var n;const t=s(this,D)==null||((n=s(this,D))==null?void 0:n.accounts.length)!==e.accounts.length||s(this,D).accounts.some((o,i)=>o.address!==e.accounts[i].address);A(this,D,e),t&&k(this,ae,ft).call(this,"change",{accounts:this.accounts})});u(this,Ft,async e=>{const t=e.features.includes("solana:signTransactions"),n=e.supports_sign_and_send_transactions||e.features.includes("solana:signAndSendTransaction"),o=fe in this.features!==n||pe in this.features!==t;A(this,_e,{...n&&{[fe]:{version:"1.0.0",supportedTransactionVersions:e.supported_transaction_versions,signAndSendTransaction:s(this,nt)}},...t&&{[pe]:{version:"1.0.0",supportedTransactionVersions:e.supported_transaction_versions,signTransaction:s(this,ot)}}}),o&&k(this,ae,ft).call(this,"change",{features:this.features})});u(this,Ae,async(e,t,n)=>{var o;try{const[i,a]=await Promise.all([((o=s(this,D))==null?void 0:o.capabilities)??await e.getCapabilities(),e.authorize({auth_token:t,identity:s(this,Ce),chain:n})]),r=s(this,tt).call(this,a.accounts),l={...a,accounts:r,chain:n,capabilities:i};Promise.all([s(this,Z).set(l),s(this,Se).call(this,l)])}catch(i){throw s(this,et).call(this),new Error(H(i),{cause:i})}});u(this,et,async()=>{var e;(e=s(this,K))==null||e.close(),s(this,Z).clear(),A(this,Q,!1),Jt(this,ve)._++,A(this,D,void 0),A(this,K,void 0),k(this,ae,ft).call(this,"change",{accounts:this.accounts})});u(this,me,async e=>{var a;const t=(a=s(this,D))==null?void 0:a.wallet_uri_base,n={...t?{baseUri:t}:void 0,remoteHostAuthority:s(this,Xe)},o=s(this,ve),i=new ba;if(s(this,K))return e(s(this,K).wallet);try{i.init(),i.open();const{associationUrl:r,close:l,wallet:c}=await Si(n),d=i.addEventListener("close",h=>{h&&l()});return i.populateQRCode(r.toString()),A(this,K,{close:l,wallet:await c}),d(),i.close(),await e(s(this,K).wallet)}catch(r){throw i.close(),s(this,ve)!==o&&await new Promise(()=>{}),r instanceof Error&&r.name==="SolanaMobileWalletAdapterError"&&r.code==="ERROR_WALLET_NOT_FOUND"&&await s(this,Ye).call(this,this),r}});u(this,Re,()=>{if(!s(this,D))throw new Error("Wallet not connected");return{authToken:s(this,D).auth_token,chain:s(this,D).chain}});u(this,tt,e=>e.map(t=>{const n=z(t.address);return{address:Be.encode(n),publicKey:n,label:t.label,icon:t.icon,chains:t.chains??s(this,te),features:t.features??ko}}));u(this,Ht,async e=>{const{authToken:t,chain:n}=s(this,Re).call(this);try{return await s(this,me).call(this,async o=>(await s(this,Ae).call(this,o,t,n),(await o.signTransactions({payloads:e.map(oe)})).signed_payloads.map(z)))}catch(o){throw new Error(H(o),{cause:o})}});u(this,Wt,async(e,t)=>{const{authToken:n,chain:o}=s(this,Re).call(this);try{return await s(this,me).call(this,async i=>{const[a]=await Promise.all([i.getCapabilities(),s(this,Ae).call(this,i,n,o)]);if(a.supports_sign_and_send_transactions)return(await i.signAndSendTransactions({...t,payloads:[oe(e)]})).signatures.map(z)[0];throw new Error("connected wallet does not support signAndSendTransaction")})}catch(i){throw new Error(H(i),{cause:i})}});u(this,nt,async(...e)=>{const t=[];for(const n of e){const o=await s(this,Wt).call(this,n.transaction,n.options);t.push({signature:o})}return t});u(this,ot,async(...e)=>(await s(this,Ht).call(this,e.map(({transaction:t})=>t))).map(t=>({signedTransaction:t})));u(this,Kt,async(...e)=>{const{authToken:t,chain:n}=s(this,Re).call(this),o=e.map(({account:a})=>oe(new Uint8Array(a.publicKey))),i=e.map(({message:a})=>oe(a));try{return await s(this,me).call(this,async a=>(await s(this,Ae).call(this,a,t,n),(await a.signMessages({addresses:o,payloads:i})).signed_payloads.map(z).map(r=>({signedMessage:r,signature:r.slice(-Oo)}))))}catch(a){throw new Error(H(a),{cause:a})}});u(this,Vt,async(...e)=>{const t=[];if(e.length>1)for(const n of e)t.push(await s(this,it).call(this,n));else return[await s(this,it).call(this,e[0])];return t});u(this,it,async e=>{A(this,Q,!0);try{const t=await s(this,$e).call(this,{...e,domain:(e==null?void 0:e.domain)??window.location.host});if(!t.sign_in_result)throw new Error("Sign in failed, no sign in result returned by wallet");const n=t.sign_in_result.address,o=t.accounts.find(i=>i.address==n);return{account:{...o??{address:Be.encode(z(n))},publicKey:z(n),chains:(o==null?void 0:o.chains)??s(this,te),features:(o==null?void 0:o.features)??t.capabilities.features},signedMessage:z(t.sign_in_result.signed_message),signature:z(t.sign_in_result.signature)}}catch(t){throw new Error(H(t),{cause:t})}finally{A(this,Q,!1)}});A(this,Z,e.authorizationCache),A(this,Ce,e.appIdentity),A(this,te,e.chains),A(this,Je,e.chainSelector),A(this,Xe,e.remoteHostAuthority),A(this,Ye,e.onWalletNotFound),A(this,_e,{[fe]:{version:"1.0.0",supportedTransactionVersions:["legacy",0],signAndSendTransaction:s(this,nt)},[pe]:{version:"1.0.0",supportedTransactionVersions:["legacy",0],signTransaction:s(this,ot)}})}get version(){return s(this,kt)}get name(){return s(this,Pt)}get url(){return s(this,Bt)}get icon(){return s(this,Dt)}get chains(){return s(this,te)}get features(){return{[Fn]:{version:"1.0.0",connect:s(this,zt)},[zn]:{version:"1.0.0",disconnect:s(this,et)},[Un]:{version:"1.0.0",on:s(this,Ut)},[un]:{version:"1.0.0",signMessage:s(this,Kt)},[dn]:{version:"1.0.0",signIn:s(this,Vt)},...s(this,_e)}}get accounts(){var e;return((e=s(this,D))==null?void 0:e.accounts)??[]}get connected(){return!!s(this,K)&&!!s(this,D)}get isAuthorized(){return!!s(this,D)}get currentAuthorization(){return s(this,D)}get cachedAuthorizationResult(){return s(this,Z).get()}},ee=new WeakMap,kt=new WeakMap,Pt=new WeakMap,Bt=new WeakMap,Dt=new WeakMap,Ce=new WeakMap,D=new WeakMap,Z=new WeakMap,Q=new WeakMap,ve=new WeakMap,te=new WeakMap,Je=new WeakMap,_e=new WeakMap,Ye=new WeakMap,Xe=new WeakMap,K=new WeakMap,Ut=new WeakMap,ae=new WeakSet,ft=function(e,...t){var n;(n=s(this,ee)[e])==null||n.forEach(o=>o.apply(null,t))},Uo=function(e,t){var n;s(this,ee)[e]=(n=s(this,ee)[e])==null?void 0:n.filter(o=>t!==o)},zt=new WeakMap,$e=new WeakMap,Se=new WeakMap,Ft=new WeakMap,Ae=new WeakMap,et=new WeakMap,me=new WeakMap,Re=new WeakMap,tt=new WeakMap,Ht=new WeakMap,Wt=new WeakMap,nt=new WeakMap,ot=new WeakMap,Kt=new WeakMap,Vt=new WeakMap,it=new WeakMap,Dn);function Pa(e){if(typeof window>"u"){console.warn("MWA not registered: no window object");return}if(!window.isSecureContext){console.warn("MWA not registered: secure context required (https)");return}const t=navigator.userAgent;Ia()&&(!Na(t)||To(t))?Cn(new Po(e)):xa()&&e.remoteHostAuthority!==void 0&&Cn(new Do({...e,remoteHostAuthority:e.remoteHostAuthority}))}const Ba="To use mobile wallet adapter, you must have a compatible mobile wallet application installed on your device.",Da="This browser appears to be incompatible with mobile wallet adapter. Open this page in a compatible mobile browser app and try again.";var Ua=class extends st{constructor(){super(...arguments);M(this,"contentStyles",Fa);M(this,"contentHtml",za)}initWithError(t){super.init(),this.populateError(t)}populateError(t){var i,a;const n=(i=this.dom)==null?void 0:i.getElementById("mobile-wallet-adapter-error-message"),o=(a=this.dom)==null?void 0:a.getElementById("mobile-wallet-adapter-error-action");if(n){if(t.name==="SolanaMobileWalletAdapterError")switch(t.code){case"ERROR_WALLET_NOT_FOUND":n.innerHTML=Ba,o&&o.addEventListener("click",()=>{window.location.href="https://solanamobile.com/wallets"});return;case"ERROR_BROWSER_NOT_SUPPORTED":n.innerHTML=Da,o&&(o.style.display="none");return}n.innerHTML=`An unexpected error occurred: ${t.message}`}else console.log("Failed to locate error dialog element")}};const za=`
682
+ <svg class="mobile-wallet-adapter-embedded-modal-error-icon" xmlns="http://www.w3.org/2000/svg" height="50px" viewBox="0 -960 960 960" width="50px" fill="#000000"><path d="M 280,-80 Q 197,-80 138.5,-138.5 80,-197 80,-280 80,-363 138.5,-421.5 197,-480 280,-480 q 83,0 141.5,58.5 58.5,58.5 58.5,141.5 0,83 -58.5,141.5 Q 363,-80 280,-80 Z M 824,-120 568,-376 Q 556,-389 542.5,-402.5 529,-416 516,-428 q 38,-24 61,-64 23,-40 23,-88 0,-75 -52.5,-127.5 Q 495,-760 420,-760 345,-760 292.5,-707.5 240,-655 240,-580 q 0,6 0.5,11.5 0.5,5.5 1.5,11.5 -18,2 -39.5,8 -21.5,6 -38.5,14 -2,-11 -3,-22 -1,-11 -1,-23 0,-109 75.5,-184.5 Q 311,-840 420,-840 q 109,0 184.5,75.5 75.5,75.5 75.5,184.5 0,43 -13.5,81.5 Q 653,-460 629,-428 l 251,252 z m -615,-61 71,-71 70,71 29,-28 -71,-71 71,-71 -28,-28 -71,71 -71,-71 -28,28 71,71 -71,71 z"/></svg>
683
+ <div class="mobile-wallet-adapter-embedded-modal-title">We can't find a wallet.</div>
684
+ <div id="mobile-wallet-adapter-error-message" class="mobile-wallet-adapter-embedded-modal-subtitle"></div>
685
+ <div>
686
+ <button data-error-action id="mobile-wallet-adapter-error-action" class="mobile-wallet-adapter-embedded-modal-error-action">
687
+ Find a wallet
688
+ </button>
689
+ </div>
690
+ `,Fa=`
691
+ .mobile-wallet-adapter-embedded-modal-content {
692
+ text-align: center;
693
+ }
694
+
695
+ .mobile-wallet-adapter-embedded-modal-error-icon {
696
+ margin-top: 24px;
697
+ }
698
+
699
+ .mobile-wallet-adapter-embedded-modal-title {
700
+ margin: 18px 100px auto 100px;
701
+ color: #000000;
702
+ font-size: 2.75em;
703
+ font-weight: 600;
704
+ }
705
+
706
+ .mobile-wallet-adapter-embedded-modal-subtitle {
707
+ margin: 30px 60px 40px 60px;
708
+ color: #000000;
709
+ font-size: 1.25em;
710
+ font-weight: 400;
711
+ }
712
+
713
+ .mobile-wallet-adapter-embedded-modal-error-action {
714
+ display: block;
715
+ width: 100%;
716
+ height: 56px;
717
+ /*margin-top: 40px;*/
718
+ font-size: 1.25em;
719
+ /*line-height: 24px;*/
720
+ /*letter-spacing: -1%;*/
721
+ background: #000000;
722
+ color: #FFFFFF;
723
+ border-radius: 18px;
724
+ }
725
+
726
+ /* Smaller screens */
727
+ @media all and (max-width: 600px) {
728
+ .mobile-wallet-adapter-embedded-modal-title {
729
+ font-size: 1.5em;
730
+ margin-right: 12px;
731
+ margin-left: 12px;
732
+ }
733
+ .mobile-wallet-adapter-embedded-modal-subtitle {
734
+ margin-right: 12px;
735
+ margin-left: 12px;
736
+ }
737
+ }
738
+ `;async function zo(){if(typeof window<"u"){const e=window.navigator.userAgent.toLowerCase(),t=new Ua;e.includes("wv")?t.initWithError({name:"SolanaMobileWalletAdapterError",code:"ERROR_BROWSER_NOT_SUPPORTED",message:""}):t.initWithError({name:"SolanaMobileWalletAdapterError",code:"ERROR_WALLET_NOT_FOUND",message:""}),t.open()}}function Ha(){return async()=>{zo()}}const on="SolanaMobileWalletAdapterDefaultAuthorizationCache";function Wa(){let e;try{e=window.localStorage}catch{}return{async clear(){if(e)try{e.removeItem(on)}catch{}},async get(){if(e)try{const t=JSON.parse(e.getItem(on));if(t&&t.accounts){const n=t.accounts.map(o=>({...o,publicKey:"publicKey"in o?new Uint8Array(Object.values(o.publicKey)):Be.decode(o.address)}));return{...t,accounts:n}}else return t||void 0}catch{}},async set(t){if(e)try{e.setItem(on,JSON.stringify(t))}catch{}}}}function Ka(){return{async select(e){return e.length===1?e[0]:e.includes(En)?En:e[0]}}}const Va=Object.freeze(Object.defineProperty({__proto__:null,LocalSolanaMobileWalletAdapterWallet:Po,RemoteSolanaMobileWalletAdapterWallet:Do,SolanaMobileWalletAdapterRemoteWalletName:No,SolanaMobileWalletAdapterWalletName:xo,createDefaultAuthorizationCache:Wa,createDefaultChainSelector:Ka,createDefaultWalletNotFoundHandler:Ha,defaultErrorModalWalletNotFoundHandler:zo,registerMwa:Pa},Symbol.toStringTag,{value:"Module"}));export{Zo as d,Za as r};