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