import{useState as S}from"react";import{Button as u,Image as C,Link as v,Spinner as z,Text as n,Box as I}from"@chakra-ui/react";import{Flex as r}from"@chakra-ui/layout";var c=(t,o)=>t?t.length>o?t.substr(0,o-1)+"..."+t.substr(t.length-(o-1),t.length-1):t:"";import{FaTwitter as T}from"react-icons/fa";import B from"@emotion/styled";import{AiOutlineFullscreen as A}from"react-icons/ai";import{useDispatch as F}from"react-redux";import{createSlice as x}from"@reduxjs/toolkit";var w={selectedCollectionId:null,showMint:!1,collectionViewOpen:!1,selectedSpaceId:!1},f=x({name:"collection",initialState:w,reducers:{updateSelectedCollectionId(t,{payload:{id:o}}){t.selectedCollectionId=o},updateShowMint(t,{payload:{showMint:o}}){t.showMint=o},updateCollectionViewOpen(t,{payload:{collectionViewOpen:o}}){t.collectionViewOpen=o},updateSelectedSpaceId(t,{payload:{id:o}}){t.selectedSpaceId=o}}}),{updateSelectedCollectionId:d,updateShowMint:D,updateCollectionViewOpen:U,updateSelectedSpaceId:_}=f.actions,j=f.reducer;import{jsx as e,jsxs as i}from"react/jsx-runtime";var O="https://imagedelivery.net/6iczWBYEbx_1dYNU7ek_bA/3761cd57-827a-4a05-f82f-ca8c1abc7300/quality=80,height=100",k="https://imagedelivery.net/6iczWBYEbx_1dYNU7ek_bA/2db84388-37eb-4c01-32cc-67b0e1741e00/height=100,quality=80",E="https://imagedelivery.net/6iczWBYEbx_1dYNU7ek_bA/62a5ffd5-6a84-4b3c-7812-f55cf4c7d300/height=100,quality=80",N=B(I)`
  //margin-left: 30px;
  //margin-right: 30px;
  z-index: 99;
  border: 1px solid #cccc;
  border-radius: 14px;
  padding: 10px 20px;
  height: 76px;
  overflow: hidden;
  ${({offersOpen:t})=>t&&`
    position: absolute;
    top : 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 80%;
    height: unset;
  `};
`,s=({imageSrc:t,title:o,onClick:a})=>i(r,{align:"center",justify:"space-between",borderWidth:"1.5px",borderColor:"gray.400",borderRadius:"lg",p:1,mb:2,children:[i(r,{align:"center",children:[e(C,{src:t,w:8,h:8,borderRadius:"50%"}),e(n,{fontSize:"12px",fontWeight:600,mb:1,ml:3,children:o})]}),a&&e(u,{size:"xs",bg:"gray.800",color:"white",_hover:{bg:"gray.800"},onClick:a,fontSize:"10",children:"Claim here"})]}),P=({transaction:t,postTransaction:o})=>e(r,{direction:"column",align:"center",children:t?.completed==="pending"?e(p,{}):t?.completed==="error"?e(W,{}):t?.completed==="completed"?e($,{showOffers:o?.showOffers,celebrate:o?.celebrate,website:o?.website,address:o?.address}):e(p,{})}),p=()=>i(r,{flexDirection:"column",align:"center",children:[e(r,{justify:"center",align:"center",bg:"muted",w:10,h:10,borderRadius:"50%",children:e(z,{size:"md"})}),e(n,{fontSize:"lg",fontWeight:"bold",mt:"2",children:"Transaction Pending"})]}),$=({showOffers:t,celebrate:o,website:a,address:g})=>{let[l,m]=S(!1),h=F(),b=y=>{h(d({id:y}))};return i(r,{flexDirection:"column",align:"center",children:[e(r,{justify:"center",align:"center",bg:"muted",w:10,h:10,borderRadius:"50%",children:"\u{1F389}"}),e(n,{fontSize:"lg",fontWeight:"bold",mt:"2",children:"Domain Purchase Successful"}),i(n,{textAlign:"center",marginY:"4",fontSize:14,children:["Note: Login to"," ",e(v,{href:a,target:"_blank",textDecoration:"underline",fontWeight:"semibold",children:a})," ","using ",e("b",{children:c(g,6)})," address to view your domain. It might take upto 10 minutes to register your domain."]}),e(u,{mb:5,border:"1.5px solid",w:"fit-content",borderColor:"input",size:"sm",fontWeight:500,rightIcon:e(T,{width:20,height:20,color:"#1DA1F2"}),onClick:o,children:"Celebrate"}),t&&i(N,{bg:"gray.200",offersOpen:l,children:[i(r,{justify:"space-between",align:"center",children:[e(n,{fontSize:"sm",fontWeight:600,mb:1,children:"Exclusive rewards for purchasing UD"}),e(A,{cursor:"pointer",onClick:()=>m(!l)})]}),e(n,{fontSize:"xs",fontWeight:500,mb:3,children:"As a thank you, we're offering exclusive rewards to the first 2500 users by our partner platforms"}),e(s,{imageSrc:E,onClick:()=>b("64072"),title:"Claim 100 $BAD token wrapped Bandit NFTs by Bandit"}),e(s,{imageSrc:O,title:"Eligible to receive 400K $BONK coins after the offer period by BONK"}),e(s,{imageSrc:k,title:"Get 15% discount on all services by NFT Evening"}),e(n,{fontSize:"2xs",children:"These rewards are only available to the first 2500 users from our partner platforms, so don't miss out! Start exploring the exciting world of web3 domains and NFTs with these amazing offers."})]})]})},W=()=>i(r,{flexDirection:"column",align:"center",children:[e(r,{justify:"center",align:"center",bg:"muted",w:10,h:10,borderRadius:"50%",children:"\u274C"}),e(n,{fontSize:"lg",fontWeight:"bold",mt:"2",children:"Domain Purchase Failed"})]}),ee=P;export{ee as default};
