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