var x=Object.create;var c=Object.defineProperty;var M=Object.getOwnPropertyDescriptor;var T=Object.getOwnPropertyNames;var E=Object.getPrototypeOf,L=Object.prototype.hasOwnProperty;var b=(e,t)=>{for(var o in t)c(e,o,{get:t[o],enumerable:!0})},d=(e,t,o,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let n of T(t))!L.call(e,n)&&n!==o&&c(e,n,{get:()=>t[n],enumerable:!(r=M(t,n))||r.enumerable});return e};var v=(e,t,o)=>(o=e!=null?x(E(e)):{},d(t||!e||!e.__esModule?c(o,"default",{value:e,enumerable:!0}):o,e)),A=e=>d(c({},"__esModule",{value:!0}),e);var B={};b(B,{default:()=>N});module.exports=A(B);var a=require("@chakra-ui/react"),I=require("react-icons/fi"),l=require("react-redux");var u=require("@reduxjs/toolkit"),O={selectedCollectionId:null,showMint:!1,collectionViewOpen:!1,selectedSpaceId:!1},h=(0,u.createSlice)({name:"collection",initialState:O,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:m,updateShowMint:y,updateCollectionViewOpen:D,updateSelectedSpaceId:$}=h.actions,k=h.reducer;var w=(e,t,o,r,n,p,f)=>{if(f)r(t);else{let i=new URLSearchParams(e);i.set("collectionId",o);let S=`${t}?${i.toString()}${p?"#mint":""}`;r(S)}};var C=v(require("posthog-js"),1);function g(e,t){try{C.default.capture(e,t)}catch(o){}}var s=require("react/jsx-runtime"),_=({collectionId:e,isExternalMint:t,profile:o,isCollectionContest:r})=>{let n=(0,l.useDispatch)(),p=(0,l.useSelector)(i=>i.user.accessKey);return(0,s.jsxs)(a.Button,{variant:"outline",size:"sm",w:"20",onClick:()=>{t?window.open(o.socialmedia.website):(n(m({id:e})),n(y({showMint:!0})),w(window.location.search,window.location.pathname,e,i=>{window.history.pushState({},"",i)},!1,!0,!1)),g("Collection Mint Button Clicked",{collectionId:e})},children:[r?"Claim":"Mint",t&&(0,s.jsx)(a.Icon,{as:I.FiExternalLink,pos:"absolute",right:"2.5",h:"3",w:"3"})]})},N=_;
