var w=Object.defineProperty;var z=Object.getOwnPropertyDescriptor;var k=Object.getOwnPropertyNames;var T=Object.prototype.hasOwnProperty;var b=(t,o)=>()=>(t&&(o=t(t=0)),o);var S=(t,o)=>{for(var a in o)w(t,a,{get:o[a],enumerable:!0})},A=(t,o,a,s)=>{if(o&&typeof o=="object"||typeof o=="function")for(let r of k(o))!T.call(t,r)&&r!==a&&w(t,r,{get:()=>o[r],enumerable:!(s=z(o,r))||s.enumerable});return t};var L=t=>A(w({},"__esModule",{value:!0}),t);var i,P,G,B,I=b(()=>{i=require("react"),P=require("react/jsx-runtime"),G=(0,i.createContext)(void 0),B=()=>(0,i.useContext)(G)});var D={};S(D,{default:()=>N});var Q,e,f,O,n,E,H,N,F=b(()=>{Q=require("react"),e=require("@chakra-ui/react"),f=require("react-icons/bs"),O=require("ics");I();n=require("react/jsx-runtime"),E=t=>{let o=t.getFullYear(),a=t.getMonth()+1,s=t.getDate(),r=t.getHours(),R=t.getMinutes();return[o,a,s,r,R]},H=({isOpen:t,onClose:o,reminderCollection:a})=>{let{rootRef:s}=B(),r=async(l,u,x)=>{let y={start:E(new Date(l*1e3)),duration:{hours:24},title:u,description:x},m=`${u}.ics`,h=await new Promise((v,U)=>{(0,O.createEvent)(y,(M,$)=>{M&&U(M),v(new File([$],m,{type:"plain/text"}))})}),p=URL.createObjectURL(h),d=document.createElement("a");d.href=p,d.download=m,document.body.appendChild(d),d.click(),document.body.removeChild(d),URL.revokeObjectURL(p)},R=(l,u,x)=>{let y=new Date(l*1e3).toISOString().replace(/-|:|\.\d+/g,""),m=new Date(l*1e3+1*24*60*60*1e3).toISOString().replace(/-|:|\.\d+/g,""),h=encodeURIComponent(u),p=encodeURIComponent(x),d="https://calendar.google.com/calendar/u/0/r/eventedit",v=`dates=${y}/${m}&text=${h}&details=${p}&location=&allday=false`;return`${d}?${v}`};return(0,n.jsxs)(e.Modal,{blockScrollOnMount:!1,isOpen:t,onClose:o,portalProps:{containerRef:s},children:[(0,n.jsx)(e.ModalOverlay,{}),(0,n.jsxs)(e.ModalContent,{children:[(0,n.jsx)(e.ModalHeader,{color:"foreground",fontSize:"md",children:"Add reminder to your calender"}),(0,n.jsx)(e.ModalCloseButton,{}),(0,n.jsxs)(e.ModalBody,{pb:4,children:[(0,n.jsxs)(e.Flex,{justifyContent:"space-between",alignItems:"center",mb:1,children:[(0,n.jsxs)(e.Flex,{alignItems:"center",children:[(0,n.jsx)(e.Icon,{as:f.BsGoogle,h:"4",w:"4",color:"mutedForeground"}),(0,n.jsx)(e.Text,{ml:"2",fontSize:"sm",children:"Google Calender"})]}),(0,n.jsx)(e.Button,{variant:"outline",size:"sm",onClick:()=>{let l=R(a?.stats?.startDate,a?.profile?.name,`Get your hands on ${a?.profile?.name} NFT Collection. Mint powered by Bandit.`);window.open(l)},children:"Add"})]}),(0,n.jsxs)(e.Flex,{justifyContent:"space-between",alignItems:"center",mv:"6",children:[(0,n.jsxs)(e.Flex,{alignItems:"center",children:[(0,n.jsx)(e.Icon,{as:f.BsApple,h:"4",w:"4",color:"mutedForeground"}),(0,n.jsx)(e.Text,{ml:"2",fontSize:"sm",children:"iCalender"})]}),(0,n.jsx)(e.Button,{variant:"outline",size:"sm",onClick:()=>{r(a?.stats?.startDate,a?.profile?.name,`Get your hands on ${a?.profile?.name} NFT Collection. Mint powered by Bandit.`).catch(l=>console.log(l))},children:"Add"})]})]})]})]})},N=H});var Y={};S(Y,{default:()=>W});module.exports=L(Y);var C=require("react"),g=require("@chakra-ui/react"),c=require("react/jsx-runtime"),j=(0,C.lazy)(()=>Promise.resolve().then(()=>(F(),D))),V=({collection:t})=>{let{isOpen:o,onOpen:a,onClose:s}=(0,g.useDisclosure)();return(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)(g.Button,{fontSize:"sm",fontWeight:500,variant:"outline",size:"sm",onClick:a,children:"Add"}),(0,c.jsx)(C.Suspense,{fallback:null,children:(0,c.jsx)(j,{isOpen:o,onClose:s,reminderCollection:t})})]})},W=V;
