"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[3817],{13089:function(e,t,r){r.d(t,{Z:function(){return v}});var l=r(97458),n=r(76742),s=r(20150),a=r.n(s),i=r(21397),o=r.n(i),d=r(52983),c=r(77785),u=r(68282),x=r(46712),h=r(43753),m=r(64314);let p=(0,h.tv)({base:"rounded-md min-w-[42px] px-2 md:px-3 py-2 cursor-pointer inline-flex justify-center items-center whitespace-nowrap uppercase",variants:{color:{primary:"text-white bg-black border-none",secondary:"text-black bg-white border border-black",neutral:"text-blue-500 bg-blue-50 border border-blue-500",disabled:"cursor-not-allowed text-gray-500 bg-gray-50 border border-gray-500"}}}),f=(0,m.L)("button",p),b=e=>{let{openAccountModal:t,account:r,isMobile:n}=e,s=n?null:r.ensName||r.displayName;return(0,l.jsx)("div",{children:(0,l.jsx)("div",{className:"flex gap-2 text-white",children:(0,l.jsxs)(f,{color:"neutral",onClick:t,children:[s,(0,l.jsx)(o(),{alt:"dropdown",height:"18",src:"/dropdown.svg",width:"18"})]})})})},g=e=>{let{showMobile:t}=e,r=(0,u.d)();return(0,d.useMemo)(()=>t===r,[r,t])?(0,l.jsx)(n.NL.Custom,{children:e=>{var t;let{account:r,chain:n,openAccountModal:s,openChainModal:a,openConnectModal:i,mounted:o,authenticationStatus:d}=e,u=o&&"loading"!==d&&r&&n&&(!d||"authenticated"===d);return(0,l.jsx)("div",{...!o&&{"aria-hidden":!0,style:{opacity:0,pointerEvents:"none",userSelect:"none"}},children:u?(null!==(t=n.unsupported)&&void 0!==t?t:![Number(c.vc.network.id)].includes(n.id))?(0,l.jsx)(f,{color:"disabled",onClick:a,children:"Wrong network"}):(0,l.jsx)(b,{account:r,isMobile:!1,openAccountModal:s}):(0,l.jsx)(x.z,{suppressHydrationWarning:!0,variant:"secondary",onClick:i,children:(0,l.jsx)("p",{children:"Connect wallet"})})})}}):null};var v=a()(async()=>Promise.resolve(g),{ssr:!1})},178:function(e,t,r){r.d(t,{k:function(){return U}});var l=r(97458),n=r(31900),s=r(43753),a=r(64314),i=r(19730),o=r(13183),d=r(57654),c=r(75968),u=r.n(c),x=r(52983),h=r(46712),m=r(3849),p=r(62693),f=r(30293),b=r(36094);let g=e=>{let{pollId:t}=e,{isLoading:r,initialVoiceCredits:n}=(0,b.Zb)(),{addToBallot:s,getBallot:a}=(0,p.Sn)(),i=(0,x.useMemo)(()=>a(t),[t,a]),o=(0,x.useCallback)(()=>{if(r)return;let e=Math.floor(n/i.votes.length);i.votes=i.votes.map(t=>({...t,amount:e})),s(i.votes,t)},[i,t,r]);return(0,l.jsxs)(h.z,{className:"mt-6",variant:"inverted",onClick:o,children:[!r&&"Allocate Votes Equally",r&&(0,l.jsx)(f.$,{className:"h-4 w-4"})]})},v=e=>{let{pollId:t}=e,{isLoading:r}=(0,b.Zb)(),{addToBallot:n,getBallot:s}=(0,p.Sn)(),a=(0,x.useMemo)(()=>s(t),[t,s]),i=(0,x.useCallback)(()=>{r||(a.votes=a.votes.map(e=>({...e,amount:0})),n(a.votes,t))},[a,t,r]);return(0,l.jsxs)(h.z,{className:"mt-2 text-sm underline underline-offset-2",variant:"",onClick:i,children:[!r&&"Remove All Votes",r&&(0,l.jsx)(f.$,{className:"h-4 w-4"})]})};var j=r(11251),y=r(15551),w=r(76766);let N=e=>{var t;let{pollId:r}=e,{getBallot:n}=(0,p.Sn)(),{chain:s}=(0,y.m)(),{getRoundByPollId:a}=(0,i.ay)(),o=(0,x.useMemo)(()=>a(r),[r,a]),{data:d}=(0,w.IO)({registryAddress:null!==(t=null==o?void 0:o.registryAddress)&&void 0!==t?t:j.DR,chain:s}),c=(0,x.useMemo)(()=>n(r),[r,n]);return(0,l.jsxs)("div",{className:"border-b border-gray-200 py-2",children:[(0,l.jsx)("h4",{children:"Projects Added"}),(0,l.jsxs)("div",{className:"mt-2 flex gap-2 text-2xl",children:[(0,l.jsx)("span",{children:(0,l.jsx)("b",{children:c.votes.length})}),(0,l.jsx)("span",{className:"text-gray-300",children:(0,l.jsx)("b",{children:"of"})}),(0,l.jsx)("span",{className:"text-gray-300",children:(0,l.jsx)("b",{children:null==d?void 0:d.count.toString()})})]})]})};var k=r(7829);let I=e=>{let{pollId:t}=e,{initialVoiceCredits:r}=(0,b.Zb)(),{getBallot:n,sumBallot:s}=(0,p.Sn)(),a=n(t),i=(0,x.useMemo)(()=>s(a.votes),[s,a]);return(0,l.jsxs)("div",{className:"mt-4 flex flex-col gap-2",children:[(0,l.jsx)("h4",{children:"Voting Power"}),(0,l.jsxs)("div",{children:[(0,l.jsxs)("div",{className:"bold flex gap-2 text-2xl",children:[(0,l.jsx)("span",{className:(0,k.Z)(i>r&&"text-red"),children:i}),(0,l.jsx)("span",{className:"text-gray-300",children:"of"}),(0,l.jsx)("span",{className:"text-gray-300",children:r})]}),(0,l.jsx)("p",{className:"text-xs text-gray-400",children:"Votes Used"})]})]})},A=e=>{let{title:t,pollId:r}=e,{getBallot:s}=(0,p.Sn)(),a=(0,x.useMemo)(()=>s(r),[r,s]),i=(0,o.i)({pollId:r}),{asPath:c}=(0,n.useRouter)(),f=(0,x.useMemo)(()=>!c.includes("ballot")&&(i===d.e7.VOTING||(i===d.e7.TALLYING||i===d.e7.RESULTS)&&a.published),[c]);return(0,l.jsx)(u(),{href:a.published&&(i===d.e7.TALLYING||i===d.e7.RESULTS)?"/rounds/".concat(r,"/ballot/confirmation"):"/rounds/".concat(r,"/ballot"),children:(0,l.jsxs)("div",{className:"dark:bg-lightBlack sm:w-66 w-full flex-col items-center gap-2 bg-white uppercase dark:text-white",children:[(0,l.jsx)(m.X,{as:"h3",size:"3xl",children:t}),(0,l.jsx)(N,{pollId:r}),(0,l.jsx)(I,{pollId:r}),!f&&i===d.e7.VOTING&&(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(g,{pollId:r}),(0,l.jsx)("p",{className:"mt-6 text-[10px] text-gray-300",children:"If votes are not equally divisible, the remainder will be distributed starting with the top item."}),(0,l.jsx)(v,{pollId:r})]}),f&&(0,l.jsx)(h.z,{className:"mt-2",variant:"secondary",children:"Check My Ballot"})]})})};var C=r(21397),L=r.n(C),S=r(19250);let M=(0,a.L)("div",(0,s.tv)({base:"rounded-md p-2 max-lg:w-full lg:w-64",variants:{state:{[d.yq.PASSED]:"border border-blue-500 bg-blue-50 text-blue-500 dark:bg-darkBlue dark:text-blue-800",[d.yq.ONGOING]:"border border-blue-500 bg-blue-500 text-white",[d.yq.UPCOMING]:"border border-gray-200 bg-transparent text-gray-200 dark:border-lighterBlack dark:text-gray-800"}}})),E=e=>{let{state:t,title:r,start:n,end:s}=e;return(0,l.jsxs)(M,{state:t,children:[(0,l.jsxs)("div",{className:"flex items-center justify-between",children:[(0,l.jsx)("p",{className:"uppercase",children:(0,l.jsx)("b",{children:r})}),t===d.yq.PASSED&&(0,l.jsx)(L(),{alt:"circle-check-blue",height:"20",src:"/circle-check-blue.svg",width:"20"}),t===d.yq.ONGOING&&(0,l.jsx)("div",{className:"bg-green h-4 w-4 rounded-full"}),t===d.yq.UPCOMING&&(0,l.jsx)("div",{className:"h-4 w-4 rounded-full border-2 border-gray-200 bg-transparent dark:border-gray-800"})]}),(0,l.jsx)("p",{children:(0,S.Iu)({start:n,end:s})})]})};var P=r(77785);let T=e=>{let{roundId:t}=e;return(0,l.jsxs)("div",{className:"w-full border-b border-gray-200 pb-2",children:[(0,l.jsx)("h4",{children:"Round"}),(0,l.jsxs)("div",{className:"flex items-center gap-2",children:[P.vc.roundLogo&&(0,l.jsx)(L(),{alt:"round logo",height:"30",src:"/".concat(P.vc.roundLogo),width:"30"}),(0,l.jsx)(m.X,{as:"h3",size:"3xl",children:t})]})]})};var O=r(60736);let D=e=>{let{num:t,unit:r}=e;return(0,l.jsxs)("div",{className:"flex flex-1 flex-col items-center",children:[(0,l.jsx)("p",{className:"text-2xl",children:(0,l.jsx)("b",{children:t})}),(0,l.jsx)("p",{className:"text-gray-400",children:r})]})},G=e=>{let{pollId:t}=e,{isLoading:r}=(0,b.Zb)(),{getRoundByPollId:n}=(0,i.ay)(),[s,a]=(0,x.useState)([0,0,0,0]),o=(0,x.useMemo)(()=>{let e=n(t);return(null==e?void 0:e.votingEndsAt)?new Date(e.votingEndsAt):new Date},[n,t]);return(0,O.Z)(()=>{a((0,S.VZ)(o))},1e3),(0,l.jsxs)("div",{className:"w-full py-4",children:[(0,l.jsx)("h4",{className:"mb-2",children:"Voting Ends In"}),r&&(0,l.jsx)("p",{children:"Loading..."}),!r&&s[3]<0&&(0,l.jsx)("p",{children:"Voting has ended"}),!r&&s[3]>0&&(0,l.jsxs)("div",{className:"flex gap-2 dark:text-white",children:[(0,l.jsx)(D,{num:s[0],unit:"Days"}),(0,l.jsx)(D,{num:s[1],unit:"Hours"}),(0,l.jsx)(D,{num:s[2],unit:"Minutes"}),(0,l.jsx)(D,{num:s[3],unit:"Seconds"})]})]})},V=(0,a.L)("div",(0,s.tv)({base:"flex justify-center gap-2 rounded-lg bg-white p-5 shadow-lg dark:bg-lightBlack",variants:{size:{sm:"flex-col",default:"flex-col max-lg:w-full xl:flex-row xl:w-fit"}}})),U=e=>{var t;let{size:r,pollId:s,showRoundInfo:a=!1,showAppState:c=!1,showBallot:u=!1}=e,x=(0,o.i)({pollId:s}),{getRoundByPollId:h}=(0,i.ay)(),m=h(s),{asPath:p}=(0,n.useRouter)(),f=[{label:"application",state:d.e7.APPLICATION,start:(null==m?void 0:m.startsAt)?new Date(m.startsAt):new Date,end:(null==m?void 0:m.registrationEndsAt)?new Date(m.registrationEndsAt):new Date},{label:"voting",state:d.e7.VOTING,start:(null==m?void 0:m.registrationEndsAt)?new Date(m.registrationEndsAt):new Date,end:(null==m?void 0:m.votingEndsAt)?new Date(m.votingEndsAt):new Date},{label:"tallying",state:d.e7.TALLYING,start:(null==m?void 0:m.votingEndsAt)?new Date(m.votingEndsAt):new Date,end:(null==m?void 0:m.votingEndsAt)?new Date(m.votingEndsAt):new Date},{label:"results",state:d.e7.RESULTS,start:(null==m?void 0:m.votingEndsAt)?new Date(m.votingEndsAt):new Date,end:(null==m?void 0:m.votingEndsAt)?new Date(m.votingEndsAt):new Date}];return(0,l.jsx)("div",{className:"flex w-full justify-center pb-3",children:(0,l.jsxs)(V,{size:r,children:[a&&(0,l.jsx)(T,{roundId:null!==(t=null==m?void 0:m.roundId)&&void 0!==t?t:""}),u&&(0,l.jsx)(A,{pollId:s,title:p.includes("ballot")?"Summary":void 0}),a&&x===d.e7.VOTING&&(0,l.jsx)(G,{pollId:s}),c&&f.map(e=>(0,l.jsx)(E,{end:e.end,start:e.start,state:function(e){let{state:t,roundState:r}=e,l=[d.e7.APPLICATION,d.e7.VOTING,d.e7.TALLYING,d.e7.RESULTS],n=l.indexOf(t),s=l.indexOf(r);return n<s?d.yq.PASSED:n===s?d.yq.ONGOING:d.yq.UPCOMING}({state:e.state,roundState:x}),title:e.label},e.label))]})})}},46712:function(e,t,r){r.d(t,{h:function(){return d},z:function(){return o}});var l=r(97458),n=r(52983),s=r(43753),a=r(64314);let i=(0,s.tv)({base:"inline-flex items-center justify-center font-semibold uppercase rounded-lg text-center transition-colors duration-150 whitespace-nowrap transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",variants:{variant:{primary:"bg-black text-white hover:bg-blue-950 dark:bg-white dark:text-black dark:hover:bg-blue-100",inverted:"text-black border border-black hover:text-blue-500 hover:border-blue-500 dark:border-white dark:text-white",tertiary:"bg-blue-50 text-blue-500 border border-blue-500 hover:bg-blue-100",secondary:"bg-blue-500 text-white hover:bg-blue-600",ghost:"hover:bg-gray-100 dark:invert",outline:"border border-gray-200 hover:border-gray-300 dark:text-white dark:border-white",disabled:"border border-gray-200 bg-gray-50 text-gray-200 cursor-not-allowed",none:""},size:{sm:"px-3 py-2 h-8 text-xs rounded-md",default:"px-4 py-2 h-10 w-full",auto:"px-4 py-2 h-10 w-auto",icon:"h-12 w-12"},disabled:{true:"text-gray-400 pointer-events-none pointer-default opacity-50 border-none"}},defaultVariants:{variant:"none",size:"default"}}),o=(0,a.L)("button",i),d=(0,n.forwardRef)((e,t)=>{let{children:r,icon:s,size:a,...i}=e;return(0,l.jsxs)(o,{ref:t,...i,size:r?a:"icon",children:[s?(0,n.createElement)(s,{className:"w-4 h-4 ".concat(r?"mr-2":"")}):null,r]})});d.displayName="IconButton"},3849:function(e,t,r){r.d(t,{X:function(){return n}});var l=r(43753);let n=(0,r(64314).L)("div",(0,l.tv)({base:"font-bold dark:text-white font-mono uppercase",variants:{size:{md:"text-base",lg:"text-lg mt-2 mb-1 ",xl:"text-xl ","2xl":"text-2xl mt-8 mb-4 ","3xl":"text-[32px]","4xl":"text-[40px]","6xl":"text-6xl mb-8"}},defaultVariants:{size:"md"}}))},29247:function(e,t,r){r.d(t,{q:function(){return c}});var l=r(97458),n=r(7829),s=r(68783),a=r(43753),i=r(64314);let o=(0,a.tv)({base:"w-full flex items-start text-sm gap-1 text-base",variants:{variant:{default:"text-blue-400 justify-center",block:"text-blue-700 bg-blue-400 border border-blue-700 rounded-lg p-4",note:"text-blue-400 justify-left"}},defaultVariants:{variant:"default"}}),d=(0,i.L)("div",o),c=e=>{let{content:t,variant:r,italic:a=!1,title:i}=e;return(0,l.jsxs)(d,{variant:r,children:[(0,l.jsx)("span",{className:"pt-1",children:(0,l.jsx)(s.j6O,{})}),(0,l.jsxs)("div",{children:[(0,l.jsx)("b",{children:null!=i?i:null}),(0,l.jsx)("p",{className:(0,n.Z)("text-sm",a?"italic":""),children:t})]})]})}},30293:function(e,t,r){r.d(t,{$:function(){return s}});var l=r(97458),n=r(7829);let s=e=>(0,l.jsxs)("div",{role:"status",...e,children:[(0,l.jsxs)("svg",{"aria-hidden":"true",className:(0,n.Z)("max-size-6 animate-spin fill-gray-800 text-gray-300"),fill:"none",viewBox:"0 0 100 101",xmlns:"http://www.w3.org/2000/svg",children:[(0,l.jsx)("path",{d:"M100 50.5908C100 78.2051 77.6142 100.591 50 100.591C22.3858 100.591 0 78.2051 0 50.5908C0 22.9766 22.3858 0.59082 50 0.59082C77.6142 0.59082 100 22.9766 100 50.5908ZM9.08144 50.5908C9.08144 73.1895 27.4013 91.5094 50 91.5094C72.5987 91.5094 90.9186 73.1895 90.9186 50.5908C90.9186 27.9921 72.5987 9.67226 50 9.67226C27.4013 9.67226 9.08144 27.9921 9.08144 50.5908Z",fill:"currentColor"}),(0,l.jsx)("path",{d:"M93.9676 39.0409C96.393 38.4038 97.8624 35.9116 97.0079 33.5539C95.2932 28.8227 92.871 24.3692 89.8167 20.348C85.8452 15.1192 80.8826 10.7238 75.2124 7.41289C69.5422 4.10194 63.2754 1.94025 56.7698 1.05124C51.7666 0.367541 46.6976 0.446843 41.7345 1.27873C39.2613 1.69328 37.813 4.19778 38.4501 6.62326C39.0873 9.04874 41.5694 10.4717 44.0505 10.1071C47.8511 9.54855 51.7191 9.52689 55.5402 10.0491C60.8642 10.7766 65.9928 12.5457 70.6331 15.2552C75.2735 17.9648 79.3347 21.5619 82.5849 25.841C84.9175 28.9121 86.7997 32.2913 88.1811 35.8758C89.083 38.2158 91.5421 39.6781 93.9676 39.0409Z",fill:"currentFill"})]}),(0,l.jsx)("span",{className:"sr-only",children:"Loading..."})]})},64314:function(e,t,r){r.d(t,{L:function(){return s}});var l=r(97458),n=r(52983);function s(e,t){let r=(0,n.forwardRef)((r,n)=>{let{as:s=e,className:a,...i}=r;return(0,l.jsx)(s,{ref:n,className:t({class:a,...i}),...i})});return r.displayName=e.toString(),r}},76766:function(e,t,r){r.d(t,{$8:function(){return s},D:function(){return i},H5:function(){return a},IO:function(){return o}});var l=r(9181),n=r(7855);function s(e,t){return n.h.projects.get.useQuery({ids:[e],registryAddress:t},{enabled:!!e})}function a(e){let{search:t,registryAddress:r}=e;return n.h.projects.search.useInfiniteQuery({search:t,registryAddress:r},{getNextPageParam:(e,t)=>t.length})}function i(e){return(0,l.A)(e)}function o(e){let{chain:t,registryAddress:r}=e;return n.h.projects.count.useQuery({chain:t,registryAddress:r})}},68282:function(e,t,r){r.d(t,{d:function(){return s}});var l=r(83176),n=r(57654);function s(){return"S"===(0,l.Z)({XL:n.Vy.XL,L:n.Vy.L,M:n.Vy.M,S:n.Vy.S})()}},9181:function(e,t,r){r.d(t,{A:function(){return s},O:function(){return a}});var l=r(68052),n=r(7855);function s(e){return n.h.metadata.get.useQuery({metadataPtr:String(e)},{enabled:!!e})}function a(){return(0,l.D)({mutationFn:async e=>{let t;return e instanceof File?t=e:t=new File([new Blob([JSON.stringify(e)],{type:"application/json"})],"metadata.json"),fetch("/api/blob?filename=".concat(t.name),{method:"POST",headers:{"Content-Type":"application/json"},body:t}).then(async e=>{if(!e.ok)throw Error("Network error");return await e.json()})}})}},63817:function(e,t,r){r.d(t,{A:function(){return ee},i:function(){return et}});var l=r(97458),n=r(84375),s=r(52983),a=r(15551),i=r(7829),o=r(30268),d=r(32097),c=r(23593),u=r(36718),x=r(20150),h=r.n(x),m=r(75968),p=r.n(m),f=r(31900),b=r(36221),g=r(62693),v=r(13183),j=r(57654),y=r(13089),w=r(42184),N=r(21397),k=r.n(N),I=r(98225),A=r(46712);function C(){document.dispatchEvent(new KeyboardEvent("keydown",{key:"Escape"}))}let L=()=>(0,l.jsxs)(w.fC,{children:[(0,l.jsx)(w.xz,{asChild:!0,children:(0,l.jsx)(A.h,{className:"w-[100px] px-0  text-gray-600",icon:I.RNg,variant:"ghost",children:"Help"})}),(0,l.jsx)(w.Uv,{children:(0,l.jsxs)(w.VY,{className:"DropdownMenuContent",sideOffset:25,children:[(0,l.jsx)(w.ck,{className:"DropdownMenuItem",children:(0,l.jsx)(p(),{className:"w-full underline",href:"/#FAQ",onClick:C,children:"FAQ"})}),(0,l.jsx)(w.ck,{className:"DropdownMenuItem",children:(0,l.jsx)(p(),{className:"w-full underline",href:"/#Glossary",onClick:C,children:"Glossary"})}),(0,l.jsxs)(w.ck,{className:"DropdownMenuItem",children:[(0,l.jsx)(p(),{className:"w-full underline",href:"https://wymzpyia.paperform.co/",rel:"noreferrer",target:"_blank",children:"Share your feedback"}),(0,l.jsx)("div",{className:"RightSlot",children:(0,l.jsx)(k(),{alt:"arrow-go-to",className:"dark:invert",height:"15",src:"/arrow-go-to.svg",width:"18"})})]})]})})]});var S=r(77785);let M=()=>(0,l.jsx)("div",{className:"h-10",children:S.vc.logoUrl?(0,l.jsx)(k(),{alt:"logo",className:"dark:invert",height:"35",src:S.vc.logoUrl,width:"150"}):(0,l.jsx)("div",{className:"flex h-full items-center justify-center rounded-md border border-black px-2 font-mono text-sm font-medium",children:S.Pu.title})}),E=e=>{let{isActive:t,...r}=e;return(0,l.jsx)(p(),{className:(0,i.Z)("flex h-full items-center p-4 font-sans hover:font-extrabold",t&&"border-b-2 border-blue-400"),...r})},P=e=>{let{isOpen:t=!1,navLinks:r}=e;return(0,l.jsxs)("div",{className:(0,i.Z)("fixed left-0 top-16 z-10 h-full w-full bg-white transition-transform duration-150",{"-translate-x-full":!t}),children:[(0,l.jsx)(p(),{className:(0,i.Z)("block p-4 text-2xl  font-semibold"),href:"/",children:"Home"},"home"),r.map(e=>(0,l.jsx)(p(),{className:(0,i.Z)("block p-4 text-2xl  font-semibold"),...e},e.href))]})},T=e=>{let{navLinks:t,pollId:r=""}=e,{asPath:n}=(0,f.useRouter)(),[a,i]=(0,s.useState)(!1),{getBallot:x}=(0,g.Sn)(),h=(0,v.i)({pollId:r}),{theme:m,setTheme:w}=(0,b.F)(),N=(0,s.useMemo)(()=>x(r),[r,x]);(0,s.useEffect)(()=>{let e="dark"===m?"dark":"light";["dark","light"].includes(null!=m?m:"")||w(e)},[]);let k=(0,s.useCallback)(()=>{w("light"===m?"dark":"light")},[m,w]),I=(0,s.useMemo)(()=>n.includes("rounds")&&!n.includes("proposals")&&!n.includes("ballot"),[n]);return(0,l.jsx)("header",{className:"dark:border-lighterBlack dark:bg-lightBlack relative z-[100] border-b border-gray-200 bg-white dark:text-white",children:(0,l.jsxs)("div",{className:"container mx-auto flex h-[72px] max-w-screen-2xl items-center px-2",children:[(0,l.jsxs)("div",{className:"mr-4 flex items-center md:mr-16",children:[(0,l.jsx)(A.h,{className:"mr-1 text-gray-600 md:hidden",icon:a?o.Z:d.Z,variant:"ghost",onClick:()=>{i(!a)}}),(0,l.jsx)(p(),{className:"py-4",href:"/",children:(0,l.jsx)(M,{})})]}),(0,l.jsx)("div",{className:"hidden h-full items-center gap-4 overflow-x-auto uppercase md:flex",children:t.map(e=>{let t="round"!==e.label&&n.includes(e.label)||"round"===e.label&&I;return(0,l.jsxs)(E,{href:e.href,isActive:t,children:[e.name,h===j.e7.VOTING&&e.href.includes("/ballot")&&N.votes.length>0&&(0,l.jsx)("div",{className:"ml-2 h-5 w-5 rounded-full border-2 border-blue-400 bg-blue-50 text-center text-sm leading-4 text-blue-400",children:N.votes.length})]},e.label)})}),(0,l.jsx)("div",{className:"flex-1 md:ml-8"}),(0,l.jsxs)("div",{className:"ml-4 flex items-center gap-2 md:ml-8 xl:ml-32",children:[(0,l.jsx)(L,{}),(0,l.jsx)(A.h,{className:"w-[50px] text-gray-600",icon:"light"===m?c.Z:u.Z,variant:"ghost",onClick:k}),(0,l.jsx)(y.Z,{showMobile:!1})]}),(0,l.jsx)(P,{isOpen:a,navLinks:t})]})})};var O=h()(async()=>Promise.resolve(T),{ssr:!1}),D=r(178),G=r(29247),V=r(36094),U=r(25138),Z=r(30293);let R=e=>{let{pollId:t}=e,r=(0,f.useRouter)(),{onVote:n,isLoading:a,initialVoiceCredits:i}=(0,V.Zb)(),{getBallot:o,publishBallot:d,sumBallot:c}=(0,g.Sn)(),u=(0,s.useCallback)(e=>{U.Am.error("Voting error: ".concat(e))},[]),x=(0,s.useMemo)(()=>o(t),[t,o]),h=(0,s.useMemo)(()=>c(x.votes),[x,c]),m=(0,s.useMemo)(()=>h<=i&&h>0,[h,i]),p=(0,s.useCallback)(async()=>{if(a||!m)return;let e=x.votes.map(e=>{let{amount:t,projectId:r,projectIndex:l}=e;return{projectId:r,voteOptionIndex:BigInt(l),newVoteWeight:BigInt(t)}});if(!t)throw Error("The pollId is undefined.");await n(e,t,u,()=>{d(t),r.push("/rounds/".concat(t,"/ballot/confirmation"))})},[x,r,n,d,u,t,a,m]);return(0,l.jsxs)(A.z,{variant:m&&!a?"primary":"disabled",onClick:p,children:[m&&!a&&"submit your ballot",h>i&&!a&&"Exceed initial voice credits",h<=0&&!a&&"Add your vote first",a&&(0,l.jsx)(Z.$,{className:"h-4 w-4"})]})};var z=r(18485),F=r.n(z),B=r(43753),q=r(39130),Y=r(28645),_=r(68282);let W=()=>{let e=(0,_.d)();return(0,l.jsxs)("footer",{className:"dark:border-lighterBlack flex flex-col items-center justify-between gap-4 border-t border-gray-300 bg-gray-50 px-2 py-4 sm:flex-row sm:px-12 sm:py-9 dark:bg-black dark:text-white",children:[(0,l.jsxs)("div",{className:"flex items-center justify-start gap-8 sm:gap-4",children:[(0,l.jsx)("a",{"aria-label":"twitter",href:"https://x.com/zkMACI",rel:"noreferrer",target:"_blank",children:(0,l.jsx)(Y.LCd,{})}),(0,l.jsx)("a",{"aria-label":"github",href:"https://github.com/privacy-scaling-explorations/maci-platform/",rel:"noreferrer",target:"_blank",children:(0,l.jsx)(q.hJX,{})}),(0,l.jsx)("a",{"aria-label":"discord",href:"https://discord.com/invite/sF5CT5rzrR",rel:"noreferrer",target:"_blank",children:(0,l.jsx)(q.j2d,{})})]}),(0,l.jsxs)("div",{className:"flex flex-col items-center justify-end gap-4 sm:flex-row",children:[(0,l.jsxs)("p",{className:"text-red flex items-center",children:["Git Version: ",S.vc.commitHash]}),(0,l.jsxs)("a",{className:"flex items-center justify-center sm:gap-1",href:"https://wymzpyia.paperform.co/",rel:"noreferrer",target:"_blank",children:[(0,l.jsx)("span",{children:e?"Share your feedback":"Feedback"}),(0,l.jsx)(k(),{alt:"arrow-go-to",className:"dark:invert",height:"18",src:"/arrow-go-to.svg",width:"18"})]}),(0,l.jsxs)("a",{className:"flex items-center justify-center sm:gap-1",href:"https://maci.pse.dev/docs/introduction",rel:"noreferrer",target:"_blank",children:[(0,l.jsx)("span",{children:e?"Documentation":"Docs"}),(0,l.jsx)(k(),{alt:"arrow-go-to",className:"dark:invert",height:"18",src:"/arrow-go-to.svg",width:"18"})]}),(0,l.jsxs)("a",{className:"flex items-center justify-center sm:gap-1",href:"https://maci.pse.dev",rel:"noreferrer",target:"_blank",children:[(0,l.jsx)("span",{children:e?"About MACI Platform":"About"}),(0,l.jsx)(k(),{alt:"arrow-go-to",className:"dark:invert",height:"18",src:"/arrow-go-to.svg",width:"18"})]}),(0,l.jsx)(M,{})]})]})};var H=h()(async()=>Promise.resolve(W),{ssr:!1}),X=r(64314);let Q=(0,s.createContext)({eligibilityCheck:!1,showBallot:!1}),$=(0,X.L)("div",(0,B.tv)({base:"w-full flex-1 md:flex",variants:{type:{default:"pl-2 pr-2 sm:mt-12 mt-4",home:"mt-0 pl-0 pr-0"}},defaultVariants:{type:"default"}})),J=e=>{let{side:t,...r}=e;return(0,l.jsx)("div",{children:(0,l.jsx)("div",{className:(0,i.Z)("px-2 md:w-[336px] md:px-4",{"left-0 top-[2rem] md:sticky":"left"===t}),...r})})},K=e=>{let{header:t=null,title:r="",sidebar:n,sidebarComponent:o=null,requireAuth:d=!1,eligibilityCheck:c=!1,showBallot:u=!1,type:x,children:h=null}=e,{theme:m,resolvedTheme:p}=(0,b.F)(),[g,v]=(0,s.useState)(""),j=(0,f.useRouter)(),{address:y,isConnecting:w}=(0,a.m)(),N=(0,s.useCallback)(()=>{!d||y||w||j.push("/")},[d,y,w,j]);(0,s.useEffect)(()=>{N()},[N]),(0,s.useEffect)(()=>{v(m||p||"")},[m,p]);let k=(0,l.jsx)(J,{side:n,children:o}),I=(0,s.useMemo)(()=>({eligibilityCheck:c,showBallot:u}),[c,u]);return(0,l.jsxs)(Q.Provider,{value:I,children:[(0,l.jsxs)(F(),{children:[(0,l.jsx)("title",{children:r?"".concat(r," - ").concat(S.Pu.title):S.Pu.title}),(0,l.jsx)("meta",{content:S.Pu.description,name:"description"}),(0,l.jsx)("link",{href:"/favicon.svg",rel:"icon"}),(0,l.jsx)("meta",{content:S.Pu.url,property:"og:url"}),(0,l.jsx)("meta",{content:"website",property:"og:type"}),(0,l.jsx)("meta",{content:r,property:"og:title"}),(0,l.jsx)("meta",{content:S.Pu.description,property:"og:description"}),(0,l.jsx)("meta",{content:S.Pu.image,property:"og:image"}),(0,l.jsx)("meta",{content:"summary_large_image",name:"twitter:card"}),(0,l.jsx)("meta",{content:"https://github.com/privacy-scaling-explorations/maci-platform",property:"twitter:domain"}),(0,l.jsx)("meta",{content:S.Pu.url,property:"twitter:url"}),(0,l.jsx)("meta",{content:r,name:"twitter:title"}),(0,l.jsx)("meta",{content:S.Pu.description,name:"twitter:description"}),(0,l.jsx)("meta",{content:S.Pu.image,name:"twitter:image"})]}),(0,l.jsxs)("div",{className:(0,i.Z)("flex h-full min-h-screen flex-1 flex-col bg-white dark:bg-black",g),children:[t,(0,l.jsxs)($,{type:x,children:["left"===n?k:null,(0,l.jsx)("div",{className:"w-full pb-24",children:h}),"right"===n?k:null]}),(0,l.jsx)(H,{})]})]})},ee=e=>{var t;let{children:r=null,...i}=e,{address:o}=(0,a.m)(),d=(0,v.i)({pollId:null!==(t=i.pollId)&&void 0!==t?t:""}),{getBallot:c}=(0,g.Sn)(),{isRegistered:u,gatekeeperTrait:x}=(0,V.Zb)(),h=(0,s.useMemo)(()=>c(i.pollId),[i.pollId,c]),m=(0,s.useMemo)(()=>{let e=[];return d!==j.e7.DEFAULT&&e.push({label:"round",href:"/rounds/".concat(i.pollId),name:"Projects"}),d===j.e7.VOTING&&u&&e.push({label:"ballot",href:"/rounds/".concat(i.pollId,"/ballot"),name:"My Ballot"}),(d===j.e7.TALLYING||d===j.e7.RESULTS)&&h.published&&u&&e.push({label:"ballot",href:"/rounds/".concat(i.pollId,"/ballot/confirmation"),name:"Submitted Ballot"}),d===j.e7.RESULTS&&e.push({label:"result",href:"/rounds/".concat(i.pollId,"/result"),name:"Result"}),S.vc.admin===o&&i.pollId&&e.push({label:"proposals",href:"/rounds/".concat(i.pollId,"/proposals"),name:"Proposals"}),S.vc.admin===o&&x===n.GatekeeperTrait.EAS&&e.push({label:"voters",href:"/voters",name:"Voters"},{label:"coordinator",href:"/coordinator",name:"Coordinator"}),e},[h.published,d,u,o]);return(0,l.jsx)(K,{...i,header:(0,l.jsx)(O,{navLinks:m}),children:r})},et=e=>{var t,r,n;let{...i}=e,{isRegistered:o}=(0,V.Zb)(),{address:d}=(0,a.m)(),{getBallot:c}=(0,g.Sn)(),u=(0,v.i)({pollId:null!==(t=i.pollId)&&void 0!==t?t:""}),x=(0,s.useMemo)(()=>c(i.pollId),[i.pollId,c]),{showInfo:h,showBallot:m,showSubmitButton:p}=i;return(0,l.jsx)(ee,{sidebarComponent:(0,l.jsxs)("div",{children:[(0,l.jsx)(D.k,{pollId:null!==(r=i.pollId)&&void 0!==r?r:"",showAppState:h,showBallot:u!==j.e7.APPLICATION&&!!(m&&d&&o),showRoundInfo:h,size:"sm"}),p&&x.votes.length>0&&(0,l.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,l.jsx)(R,{pollId:null!==(n=i.pollId)&&void 0!==n?n:""}),(0,l.jsx)(G.q,{italic:!0,content:"This is not a final submission, you can edit your ballot and resubmit it anytime during the voting period."})]}),(0,l.jsx)("div",{className:"h-2"})]}),...i})}},13183:function(e,t,r){r.d(t,{i:function(){return i}});var l=r(46640),n=r(39148),s=r(19730),a=r(57654);let i=e=>{var t;let{pollId:r}=e,i=new Date,{getRoundByPollId:o,isRoundTallied:d}=(0,s.ay)(),c=o(r),u=d(null!==(t=null==c?void 0:c.tallyAddress)&&void 0!==t?t:n.N);return c?(0,l.A)(c.registrationEndsAt,i)?a.e7.APPLICATION:(0,l.A)(c.votingEndsAt,i)?a.e7.VOTING:(0,l.A)(i,c.votingEndsAt)&&u?a.e7.RESULTS:(0,l.A)(i,c.votingEndsAt)&&!u?a.e7.TALLYING:a.e7.DEFAULT:a.e7.DEFAULT}},19250:function(e,t,r){r.d(t,{Iu:function(){return a},VZ:function(){return n},p6:function(){return s}});var l=r(70634);let n=e=>{let t=Math.floor((e.getTime()-Date.now())/1e3),r=Math.floor(t/60),l=Math.floor(r/60);return[Math.floor(l/24)%365,l%24,r%60,t%60]},s=e=>(0,l.WU)(e,"dd MMM yyyy HH:mm");function a(e){let{start:t,end:r}=e,n="d MMM yyyy";return t.getMonth()===r.getMonth()&&t.getFullYear()===r.getFullYear()?"".concat(t.getDate()," - ").concat((0,l.WU)(r,n)):t.getFullYear()===r.getFullYear()?"".concat((0,l.WU)(t,"d MMM")," - ").concat((0,l.WU)(r,n)):"".concat((0,l.WU)(t,n)," - ").concat((0,l.WU)(r,n))}},57654:function(e,t,r){var l,n,s,a,i,o,d,c,u,x;r.d(t,{Vy:function(){return s},e7:function(){return l},pJ:function(){return a},v6:function(){return i},yq:function(){return n}}),(o=l||(l={})).LOADING="LOADING",o.APPLICATION="APPLICATION",o.VOTING="VOTING",o.TALLYING="TALLYING",o.RESULTS="RESULTS",o.DEFAULT="DEFAULT",(d=n||(n={})).PASSED="PASSED",d.ONGOING="ONGOING",d.UPCOMING="UPCOMING",(c=s||(s={}))[c.S=320]="S",c[c.M=480]="M",c[c.L=768]="L",c[c.XL=1280]="XL",(u=a||(a={}))[u.Add=0]="Add",u[u.Change=1]="Change",u[u.Remove=2]="Remove",(x=i||(i={}))[x.Pending=0]="Pending",x[x.Approved=1]="Approved",x[x.Rejected=2]="Rejected"}}]);