import{Image as M}from"@chakra-ui/image";import{Box as b,Flex as R,Text as x}from"@chakra-ui/layout";import{Divider as T,Link as q}from"@chakra-ui/react";import"react";import E from"qrcode";import{useMemo as L}from"react";import{Fragment as Q,jsx as d,jsxs as A}from"react/jsx-runtime";var B=(s,a)=>{let f=Array.prototype.slice.call(E.create(s,{errorCorrectionLevel:a}).modules.data,0),u=Math.sqrt(f.length);return f.reduce((c,m,y)=>(y%u===0?c.push([m]):c[c.length-1].push(m))&&c,[])};function C({ecl:s="M",size:a=200,uri:f,clearArea:u=!1,image:c,imageBackground:m="transparent"}){let y=u?76:0,i=a-10*2,k=L(()=>{let g=[],o=B(f,s),t=i/o.length;if([{x:0,y:0},{x:1,y:0},{x:0,y:1}].forEach(({x:h,y:e})=>{let $=(o.length-7)*t*h,l=(o.length-7)*t*e;for(let r=0;r<3;r++)g.push(d("rect",{fill:r%2!==0?"var(--bad-colors-background, var(--bad-colors-background))":"var(--bad-colors-foreground)",rx:(r-2)*-5+(r===0?2:3),ry:(r-2)*-5+(r===0?2:3),width:t*(7-r*2),height:t*(7-r*2),x:$+t*r,y:l+t*r},`${r}-${h}-${e}`))}),c){let h=(o.length-7)*t*1,e=(o.length-7)*t*1;g.push(A(Q,{children:[d("rect",{fill:m,rx:(0-2)*-5+2,ry:(0-2)*-5+2,width:t*(7-0*2),height:t*(7-0*2),x:h+t*0,y:e+t*0}),d("foreignObject",{width:t*(7-0*2),height:t*(7-0*2),x:h+t*0,y:e+t*0,children:d("div",{style:{borderRadius:(0-2)*-5+2,overflow:"hidden"},children:c})})]}))}let v=Math.floor((y+25)/t),z=o.length/2-v/2,S=o.length/2+v/2-1;return o.forEach((h,e)=>{h.forEach(($,l)=>{o[e][l]&&(e<7&&l<7||e>o.length-8&&l<7||e<7&&l>o.length-8||(c||!(e>z&&e<S&&l>z&&l<S))&&g.push(d("circle",{cx:e*t+t/2,cy:l*t+t/2,fill:"var(--bad-colors-foreground)",r:t/3},`circle-${e}-${l}`)))})}),g},[s,i,f]);return A("svg",{height:i,width:i,viewBox:`0 0 ${i} ${i}`,style:{width:i,height:i},children:[d("rect",{fill:"transparent",height:i,width:i}),k]})}var w=s=>s?s.replace(/\W/g,"").toLowerCase():"";import{Fragment as F,jsx as n,jsxs as p}from"react/jsx-runtime";var D=({uri:s,selectedWallet:a})=>p(b,{children:[p(R,{justify:"center",pos:"relative",children:[n(b,{pos:"absolute",top:"50%",transform:"translateY(-50%)",children:n(M,{src:`https://bandit.network/svgs/wallets.svg#${w(a?.name||"")}`,width:14,height:14})}),n(C,{uri:s,size:288,ecl:"M",clearArea:!0})]}),n(x,{mb:2,mt:4,textAlign:"center",children:"Connect to your wallet"}),n(x,{fontSize:14,textAlign:"center",children:"Scan this QR code from your mobile wallet or phone's camera to connect."}),w(a?.name||"")!=="walletconnect"&&p(F,{children:[n(T,{marginY:2}),p(b,{children:[n(R,{justify:"center",mb:2,children:n(M,{src:"https://www.haha.me/images/install-button.png",h:"10",cursor:"pointer",onClick:()=>{window.open("https://join.haha.me/SANDESH-D9D3KI")}})}),n(x,{textAlign:"center",fontSize:"sm",children:a?.description}),n(q,{isExternal:!0,href:`${a.mobile.website}`,children:n(x,{fontSize:"xs",textAlign:"center",children:"Learn more"})})]})]})]}),Z=D;export{Z as default};
