import{d as D,c as P,o as L,i as t,a,L as C,S as v,b as R,s as I,t as y,r as O}from"./Logo1am-CSacEOt-.js";var q=y('<div style=flex:1;display:flex;flex-direction:column;justify-content:center;padding:24px><div style="background:var(--bg-primary);border-radius:12px;border:1px solid var(--border-secondary);overflow:hidden"><div style=padding:24px;text-align:center><div style="width:56px;height:56px;border-radius:12px;background:var(--bg-primary-solid);display:flex;align-items:center;justify-content:center;margin:0 auto 16px"></div><p style="font-family:var(--font-display);font-size:16px;font-weight:600;color:var(--text-primary);margin:0 0 4px"></p><p style=font-size:13px;color:var(--text-placeholder);margin:0></p></div><div style="padding:0 24px 24px"><div style=padding:12px;border-radius:8px;font-size:12px;line-height:1.5></div></div><div style="display:flex;gap:12px;padding:0 24px 24px"><button style="flex:1;height:44px;border-radius:8px;border:1px solid var(--border-secondary);background:var(--bg-primary);font-size:14px;font-weight:500;color:var(--text-tertiary);cursor:pointer">Reject</button><button style=flex:1;height:44px;border-radius:8px;border:none;background:var(--text-primary);font-size:14px;font-weight:500;color:var(--fg-white);cursor:pointer>'),z=y('<div style=min-height:100vh;background:var(--bg-tertiary);font-family:var(--font-body);display:flex;flex-direction:column><div style="background:var(--bg-primary-solid);padding:16px 20px;display:flex;align-items:center;gap:12px;border-bottom:1px solid var(--border-secondary)"><span style=font-family:var(--font-display);font-size:12px;color:var(--color-grey-dark-400);text-transform:uppercase;letter-spacing:0.05em>'),M=y("<div style=flex:1;display:flex;align-items:center;justify-content:center;color:var(--text-placeholder);font-size:14px>No approval request found");let S=null;const B=()=>{const[o,T]=P(null),[s,E]=P(!1);L(()=>{const e=new URLSearchParams(window.location.hash.slice(1)),r=e.get("requestId"),i=e.get("nonce"),l=e.get("type")||"DAPP_CONNECT_APPROVAL",p=e.get("origin")||"Unknown",d=e.get("networkId")||void 0;r&&i&&(T({requestId:r,type:l,origin:p,networkId:d}),S=i)});const f=e=>{const r=o();!r||s()||(E(!0),chrome.runtime.sendMessage({type:"WALLET_RESPONSE",requestId:r.requestId,nonce:S,data:{success:e}}),setTimeout(()=>window.close(),300))},c=()=>o()?.type==="DAPP_CONNECT_APPROVAL",b=()=>{switch(o()?.type){case"DAPP_CONNECT_APPROVAL":return"Connection Request";case"DAPP_SIGN_DATA":return"Sign Data";case"DAPP_MAKE_TRANSFER":return"Send Tokens";case"DAPP_MAKE_INTENT":return"Create Transaction";case"DAPP_BALANCE_UNSEALED_TX":case"DAPP_BALANCE_SEALED_TX":return"Balance Transaction";case"DAPP_SUBMIT_TRANSACTION":return"Submit Transaction";default:return"Approval Request"}};return(()=>{var e=z(),r=e.firstChild,i=r.firstChild;return t(r,a(C,{class:"h-5 w-auto",animated:!0}),i),t(i,b),t(e,a(v,{get when(){return o()},get fallback(){return M()},get children(){var l=q(),p=l.firstChild,d=p.firstChild,h=d.firstChild,m=h.nextSibling,N=m.nextSibling,_=d.nextSibling,u=_.firstChild,$=_.nextSibling,g=$.firstChild,x=g.nextSibling;return t(h,a(C,{class:"h-6 w-auto"})),t(m,b),t(N,()=>o().origin),t(u,a(v,{get when(){return c()},children:"This site wants to connect to your 1AM wallet. It will be able to view your balances and addresses."}),null),t(u,a(v,{get when(){return!c()},children:"This action may spend funds from your wallet. Only approve if you trust this site."}),null),g.$$click=()=>f(!1),x.$$click=()=>f(!0),t(x,()=>s()?"Done":"Approve"),R(n=>{var k={...c()?{background:"var(--bg-tertiary)",color:"var(--text-tertiary)"}:{background:"var(--bg-warning-primary)",color:"var(--text-warning-primary)",border:"1px solid color-mix(in srgb, var(--warning-foreground) 30%, transparent)"}},A=s(),w=s();return n.e=I(u,k,n.e),A!==n.t&&(g.disabled=n.t=A),w!==n.a&&(x.disabled=n.a=w),n},{e:void 0,t:void 0,a:void 0}),l}}),null),e})()};D(["click"]);const j=document.getElementById("root");O(()=>a(B,{}),j);
