"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[7035],{15124:function(e,t,l){var r=l(85893),a=l(67294),o=l(41664),s=l.n(o),n=l(39883),i=l(21545),c=l(44823),d=l(18461),u=l(41715),h=l(45595),m=l(51077),x=l(55303),j=l(42136),p=l(6932);let f=()=>{let e={startVelocity:18,gravity:.2,spread:360,ticks:40,zIndex:0,colors:["#e0322d","#00aa45","#FFDE00","#2F80ED","#ff6a0a"],particleCount:50};(0,n.Z)({...e,origin:{x:j.ZP.randomInRange(.1,.3),y:Math.random()-.2}}),(0,n.Z)({...e,origin:{x:j.ZP.randomInRange(.7,.9),y:Math.random()-.2}})},v=e=>{var t;let{selectedProject:l={title:"",projectURL:""},featuredOn:o=new Date,showModal:n,setShowModal:v,forHackathon:g=!1}=e,P=m.Z.isProjectFromWeeklyLaunch(o),y=P?"".concat(m.Z.getFeaturedWeekYear({featuredOn:o,short:!1,fullYear:!0,commaSeparator:!1})):m.Z.getFeaturedMonthYear(o);return(0,a.useEffect)(()=>{let e=setInterval(f,250);return()=>{clearInterval(e)}},[]),(0,r.jsx)(i.ZP,{title:"",large:!1,showModal:n,setShowModal:v,noOverlay:!0,children:(0,r.jsxs)(i.$M.Body,{className:"h-auto",defaultClasses:"",children:[(0,r.jsx)("div",{className:"relative",children:(0,r.jsx)("p",{className:"text-5xl text-center pt-10",children:"\uD83D\uDE80"})}),(0,r.jsxs)("div",{className:"py-6 pb-10 px-3",children:[(0,r.jsx)(c.Z.SemiBoldText,{lg:!0,className:"py-2 text-center",children:"Aaand, we have a lift off!"}),(0,r.jsx)("div",{className:"flex items-center flex-col gap-5",children:g?(0,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)(c.Z.NormalText,{sm:!0,className:"text-center",children:["You've successfully submitted"," ",(0,r.jsx)("b",{children:l.title||"your project"}),"!"]}),(0,r.jsx)(c.Z.NormalText,{sm:!0,className:"text-center",children:"Tell your friends!"})]}):(0,r.jsxs)(c.Z.NormalText,{sm:!0,className:"text-center",children:["You've launched,"," ",(0,r.jsx)("b",{children:l.title||"your project"})," on Peerlist Project Spotlight ",y]})}),(0,r.jsx)("div",{className:"mx-auto w-11/12 my-2",children:(0,r.jsx)(d.l,{link:"".concat("https://peerlist.io").concat(null==l?void 0:l.projectURL),labelClassName:"text-sm"})}),g?(0,r.jsx)(p.Z.ShareIcons,{project:l,launched:!0}):(0,r.jsx)(u.C.ShareIcons,{project:l}),(0,r.jsxs)("div",{className:"flex flex-col gap-4 text-center mt-8 ".concat(g?"hidden":""),children:[(0,r.jsx)(c.Z.SemiBoldText,{sm:!0,children:"To make the most out of your launch"}),(0,r.jsxs)("div",{className:"flex gap-4",children:[(0,r.jsxs)(s(),{href:j.ZP.getProjectMediaKitURL({username:null==l?void 0:null===(t=l.creator)||void 0===t?void 0:t.profileHandle,projectTitle:null==l?void 0:l.title,slug:null==l?void 0:l.slug}),className:"p-4 flex flex-col items-center justify-center rounded-lg border border-primaryBorder hover:border-green-bright transition-all duration-200 ease-in-out",children:[(0,r.jsx)("div",{children:(0,r.jsx)(x.ZP.DownloadBox,{size:16})}),(0,r.jsx)(c.Z.SemiBoldText,{sm:!0,className:"mt-2",children:"Shareable Images"}),(0,r.jsx)(c.Z.MutedText,{xs:!0,className:"mt-0.5",children:"We’ve created personalized shareable images. You can use it for promoting your launch!"})]}),(0,r.jsxs)(s(),{href:h.APP_PATHS.mobileAppWaitlist,className:"p-4 flex flex-col items-center justify-center rounded-lg border border-primaryBorder hover:border-green-bright transition-all duration-200 ease-in-out",children:[(0,r.jsxs)("div",{className:"flex items-center gap-2",children:[(0,r.jsx)(x.ZP.Android,{size:16}),(0,r.jsx)(x.ZP.Apple,{size:16})]}),(0,r.jsx)(c.Z.SemiBoldText,{sm:!0,className:"mt-2",children:"Peerlist Mobile App"}),(0,r.jsx)(c.Z.MutedText,{xs:!0,className:"mt-0.5",children:"Be proactive with feedback comments from your supporters and monitor your launch."})]})]})]})]})]})})};t.Z=v},77035:function(e,t,l){l.d(t,{P:function(){return C}});var r=l(85893),a=l(39879),o=l(11163),s=l(67294),n=l(2185),i=l(51077),c=l(32545),d=l(31837),u=l(43205),h=l(42136),m=l(23489),x=l(55303),j=l(11542),p=l(29313),f=l(21545),v=l(60732),g=l(74180),P=l(44823),y=l(45595),Z=l(15124),N=l(79538),w=l(94826),b=l(29949),S=l(15403);let D=e=>{let{showModal:t,setShowModal:l,defaultSelectedProject:a,fromDetailsPage:n=!1}=e,c=(0,o.useRouter)(),[d,u]=(0,s.useState)(!1),[m,x]=(0,s.useState)(!1),[j,p]=(0,s.useState)(a),f=new Date,v=h.ZP.isWeeklyProjectStart(f),g=v?i.Z.getFeaturedWeekYear({fullYear:!0}):i.Z.getFeaturedMonthYear(f,!0,!0);if(m){if(d){var P;let e="Hey Peers, ".concat((null==j?void 0:null===(P=j.collaborators)||void 0===P?void 0:P.length)?"We":"I","'ve just launched ").concat(null==j?void 0:j.title," in this week of Project Spotlight. Do support the launch and let us know what you think!"),a=h.ZP.generateProjectShareData(j);return(0,r.jsx)(b.Z.CreatePostWithContext,{showModal:t,shareData:{...a,link:"<p>".concat(e," <a href=").concat(null==a?void 0:a.link,">").concat(null==a?void 0:a.link,"</a> </p>")},fromShareModal:!0,setShowModal:()=>{l(!1),c.push(i.Z.projectPageURL()),u(!1)}})}return(0,r.jsx)(Z.Z,{selectedProject:j,showModal:t,setShowModal:()=>u(!0),fromDetailsPage:!0})}return(0,r.jsx)(M,{showModal:t,setShowModal:l,fromDetailsPage:n,setSubmitted:x,setSelectedProject:p,selectedProject:j,featuredString:g})},M=e=>{let{showModal:t,setShowModal:l,setSubmitted:a,selectedProject:i,setSelectedProject:v,featuredString:P}=e,Z=(0,o.useRouter)(),b=(0,n.I0)(),{primaryUserData:S}=(0,n.v9)(e=>e.PrimaryUserData),[D,M]=(0,s.useState)(!1),[T,E]=(0,s.useState)(!1),B=()=>{M(!0),setTimeout(()=>{I()},4e3)},I=async()=>{if(!(null==i?void 0:i.id)){g.Z.ErrorToast("Please select project for Projects Spotlight!");return}try{E(!0),await d.T_.submitProjectForSpotlight(i.id,!1),M(!1),a(!0);let e=null==S?void 0:S.projects.map(e=>{let t={...e};return t.id===(null==i?void 0:i.id)&&(t.featuredOn=new Date),t});N.Z.capture(w.Z.LAUNCHED_PROJECT),b(c.xf.updatePrimaryUserData({projects:e})),h.ZP.throwConfetti()}catch(l){var e,t;M(!1),g.Z.ErrorToast((null==l?void 0:null===(e=l.response)||void 0===e?void 0:null===(t=e.data)||void 0===t?void 0:t.message)||u.Z.GLOBAL.wrong)}finally{E(!1)}},A=(null==S?void 0:S.projects)&&S.projects.length>0;return((0,s.useEffect)(()=>()=>{E(!1)},[]),D)?(0,r.jsx)(C,{showModal:D,setShowModal:M}):(0,r.jsxs)(f.ZP,{title:"Project Launch - ".concat(P),large:!0,showModal:t,setShowModal:l,children:[(0,r.jsx)(f.$M.Body,{className:"h-96 ".concat(A?"pt-0":""," overflow-y-scroll"),children:A?(0,r.jsx)(k,{selectedProject:i,setSelectedProject:v,primaryUserData:S}):(0,r.jsx)(p.Z.EmptyState,{icon:(0,r.jsx)(m.Z.EmptyProjects,{}),title:"You don't have any projects to submit",description:"Create a new project to submit for Project Spotlight",className:"h-72 items-center"})}),(0,r.jsxs)(f.$M.Footer,{className:"justify-between",children:[(0,r.jsxs)(j.ZP.CarbonButton,{small:!0,onClick:()=>Z.push(y.APP_PATHS.addProject()),className:"gap-1",children:[(0,r.jsx)(x.ZP.Plus,{size:16,stroke:2})," New Project"]}),(0,r.jsx)(j.ZP.PrimaryButton,{small:!0,loading:T,onClick:B,disabled:T||!i||!(null==i?void 0:i.id),children:"Launch Project"})]})]})},k=e=>{let{selectedProject:t,setSelectedProject:l,primaryUserData:a}=e,s=(0,o.useRouter)(),n=e=>{var t,l,r;let o="Built by";return(null==e?void 0:e.createdBy)&&(null==a?void 0:a.id)!==(null==e?void 0:e.createdBy)&&(o+=" ".concat(null==e?void 0:null===(l=e.creator)||void 0===l?void 0:l.firstName," ").concat(null==e?void 0:null===(r=e.creator)||void 0===r?void 0:r.lastName," ")),(null==e?void 0:e.createdBy)===(null==a?void 0:a.id)&&(o+=" you"),(null==e?void 0:e.collaborators)&&(null==e?void 0:null===(t=e.collaborators)||void 0===t?void 0:t.length)>0&&(o+=" +".concat(e.collaborators.length)),o},c=[],d=[];(null==a?void 0:a.projects)&&(null==a||a.projects.forEach(e=>{let t={...e},{percentage:l}=i.Z.calculateProjectPercentage(e),r=n(e);if(t.projectCreatorInfo=r,t.percentage=l,l<100){d.push(t);return}c.push(t)}));let u=[...c,...d];return(0,r.jsx)("ul",{children:u.map(e=>{var o;let n=e.percentage<100,c=!1,d=new Date(e.featuredOn);if(null==e?void 0:e.featuredOn){let e=i.Z.isProjectFromWeeklyLaunch(d);c=e?i.Z.getFeaturedWeekYear({featuredOn:d,fullYear:!0}):i.Z.getFeaturedMonthYear(d,!0,!0)}return(0,r.jsx)("li",{className:"flex items-center w-full gap-3 border-b border-primaryBorder  ".concat(n||c?"text-light":"text-primary"),children:(0,r.jsx)(v.Z,{checked:(null==e?void 0:e.id)===(null==t?void 0:t.id),name:"project",id:e.id,type:"radio",onChange:()=>{n||c||l(e)},containerClassName:"w-full",labelClassName:"w-full",inputClassName:n||c?"hidden":"block",label:(0,r.jsxs)("div",{className:"flex items-center justify-between w-full py-6 ".concat(n||c?"text-light hover:cursor-not-allowed":"text-primary"),children:[(0,r.jsxs)("div",{className:"flex items-center gap-2 w-full",children:[(0,r.jsx)("div",{className:"relative w-full max-w-[75px] h-[40px] overflow-hidden rounded",children:(0,r.jsx)("img",{src:(null==e?void 0:null===(o=e.images)||void 0===o?void 0:o[0])||"/images/emptyPortfolio.png",alt:"",className:"rounded w-full h-full max-w-[75px] max-h-10 object-cover",onError:e=>{e.target.src="/images/emptyPortfolio.png"}})}),(0,r.jsxs)("div",{children:[(0,r.jsx)("h3",{className:"text-sm font-semibold paragraph-clamp mb-1",children:e.title}),e.projectCreatorInfo&&(0,r.jsx)("p",{className:"text-xs font-normal mb-1",children:e.projectCreatorInfo}),c&&!n?(0,r.jsxs)("p",{className:"text-xs text-green-bright",children:["Launched in ",c]}):null,n&&!c?(0,r.jsx)(P.Z.ErrorText,{className:"text-xxs",children:"Not eligible — fill 100% project details."}):null]})]}),h.ZP.doIHaveProjectEditAccess({myId:a.id,projectDetails:e})?(0,r.jsx)(j.ZP.CarbonLineButton,{small:!0,className:"flex-1",onClick:()=>s.push(y.APP_PATHS.addProject(e.id)),children:"Edit"}):null]})})},e.id)})})},C=e=>{let{showModal:t,setShowModal:l,forHackathon:o=!1}=e,[n,i]=(0,s.useState)(1);return(0,s.useEffect)(()=>{let e=setInterval(()=>{n<4&&i(e=>e+1)},1500);return setTimeout(()=>{clearInterval(e)},5e3),()=>clearInterval(e)},[n]),(0,r.jsx)(f.ZP,{showModal:t,setShowModal:l,showClose:!1,children:(0,r.jsxs)("div",{className:"py-10 px-14",children:[1===n?(0,r.jsx)(T,{emoji:"✊",text:"Sit tight & brace yourself..."}):null,2===n?(0,r.jsx)(T,{emoji:"\uD83E\uDD1E",text:o?"Submitting your project...":"Preparing for the launch..."}):null,3===n?(0,r.jsx)(T,{emoji:"\uD83D\uDD25",text:"We have ignition..."}):null,(0,r.jsx)(a.J5,{loop:!0,autoplay:!0,src:S.ZP.countdown,style:{width:"100%"}})]})})},T=e=>{let{emoji:t,text:l}=e;return(0,r.jsxs)("span",{className:"text-center ease-in-out duration-200",children:[(0,r.jsx)("p",{className:"text-6xl",children:t}),(0,r.jsx)(P.Z.SemiBoldText,{lg:!0,className:"my-2",children:l})]})};t.Z=D}}]);