var A=Object.create;var a=Object.defineProperty;var P=Object.getOwnPropertyDescriptor;var k=Object.getOwnPropertyNames;var T=Object.getPrototypeOf,$=Object.prototype.hasOwnProperty;var E=(e,t)=>{for(var o in t)a(e,o,{get:t[o],enumerable:!0})},u=(e,t,o,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let r of k(t))!$.call(e,r)&&r!==o&&a(e,r,{get:()=>t[r],enumerable:!(n=P(t,r))||n.enumerable});return e};var B=(e,t,o)=>(o=e!=null?A(T(e)):{},u(t||!e||!e.__esModule?a(o,"default",{value:e,enumerable:!0}):o,e)),N=e=>u(a({},"__esModule",{value:!0}),e);var O={};E(O,{default:()=>L});module.exports=N(O);var c=require("@chakra-ui/react"),b=require("react-icons/fi"),s=require("react-redux");var w=B(require("axios"),1);var d=require("react"),z=require("react/jsx-runtime"),q=(0,d.createContext)(void 0),m="production";var h=m==="development"?"https://qa-api-v2.bandit.network/sdk":"https://api-v2.bandit.network/sdk";var y=async(e,t,o)=>{try{await w.default.post(`${h}/metrics/${t}`,o,{headers:{"X-API-KEY":e}})}catch(n){console.log(n)}};var C={MINT_CLICK:"MINT_CLICK",SOURCE:"SOURCE"};var g=require("@reduxjs/toolkit"),R={selectedCollectionId:null,showMint:!1,collectionViewOpen:!1,selectedSpaceId:!1},S=(0,g.createSlice)({name:"collection",initialState:R,reducers:{updateSelectedCollectionId(e,{payload:{id:t}}){e.selectedCollectionId=t},updateShowMint(e,{payload:{showMint:t}}){e.showMint=t},updateCollectionViewOpen(e,{payload:{collectionViewOpen:t}}){e.collectionViewOpen=t},updateSelectedSpaceId(e,{payload:{id:t}}){e.selectedSpaceId=t}}}),{updateSelectedCollectionId:x,updateShowMint:v,updateCollectionViewOpen:Z,updateSelectedSpaceId:H}=S.actions,F=S.reducer;var I=(e,t,o,n,r,p,f)=>{if(f)n(t);else{let i=new URLSearchParams(e);i.set("collectionId",o);let M=`${t}?${i.toString()}${p?"#mint":""}`;n(M)}};var l=require("react/jsx-runtime"),K=({collectionId:e,isExternalMint:t,profile:o,isCollectionContest:n})=>{let r=(0,s.useDispatch)(),p=(0,s.useSelector)(i=>i.user.accessKey);return(0,l.jsxs)(c.Button,{variant:"outline",size:"sm",w:"20",onClick:()=>{t?window.open(o.socialmedia.website):(r(x({id:e})),r(v({showMint:!0})),I(window.location.search,window.location.pathname,e,i=>{window.history.pushState({},"",i)},!1,!0,!1)),y(p,C.MINT_CLICK,{collectionId:e})},children:[n?"Claim":"Mint",t&&(0,l.jsx)(c.Icon,{as:b.FiExternalLink,pos:"absolute",right:"2.5",h:"3",w:"3"})]})},L=K;
