1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[231],{25215:function(n,e,t){(window.__NEXT_P=window.__NEXT_P||[]).push(["/governance/votings/[address]",function(){return t(48177)}])},32299:function(n,e,t){"use strict";var i=t(49339),o=t(92782),r=t(18602);function s(){let n=(0,i.Z)(["\n width: 100%;\n background-color: ",";\n ","\n position: relative;\n ","\n ","\n"]);return s=function(){return n},n}let c=(0,o.ZP)(r.ZP).withConfig({componentId:"sc-d1cdff1-0"})(s(),n=>"secondary"===n.variant?n.theme.colors.cardSecondary:n.theme.colors.card,n=>{let{radius:e,theme:t}=n;return!e&&"border-radius: ".concat(t.radius.md,";")},n=>{let{padding:e,theme:t}=n;return!e&&"padding: ".concat(t.spacing[5]," ").concat(t.spacing[6],";")},n=>{let{hoverable:e,theme:t,border:i}=n;return e&&"\n cursor: pointer;\n border: 1px solid ".concat(i?t.colors.border:"transparent",";\n transition: border-color 0.3s ease-in-out;\n transition: top 0.3s ease-in-out;\n transition: box-shadow 0.3s ease-in-out;\n &:hover {\n border: 1px solid ").concat(t.colors.primary,";\n box-shadow: 0px 0px 24px 0px ").concat(t.colors.opecityPrimary,";\n top: -2px;\n\n & .hoverable {\n color: ").concat(t.colors.primary,";\n }\n }\n ")});e.Z=c},55496:function(n,e,t){"use strict";t.d(e,{k:function(){return h}});var i=t(49339),o=t(36734),r=t(30681),s=t(92782),c=t(29842),a=t(51776);function d(){let n=(0,i.Z)(["\n position: relative;\n"]);return d=function(){return n},n}function l(){let n=(0,i.Z)(["\n position: relative;\n width: 100%;\n height: 0.25rem;\n background-color: ",";\n border-radius: 0.5rem;\n overflow: hidden;\n"]);return l=function(){return n},n}function u(){let n=(0,i.Z)(["\n position: absolute;\n top: 0;\n left: 0;\n height: 100%;\n /* width: ","%; */\n background-color: ",";\n border-radius: 0.5rem;\n"]);return u=function(){return n},n}let h=n=>{let{percent:e,width:t="full",...i}=n,[r,s]=(0,a.useState)(!1);return(0,a.useEffect)(()=>{s(!0)},[]),(0,o.jsx)(f,{width:t,...i,children:(0,o.jsx)(p,{children:(0,o.jsx)(g,{initial:"enter",animate:r?"animate":"enter",exit:"enter",variants:{enter:{width:0},animate:{width:"".concat(e,"%"),transition:{duration:1,ease:"easeInOut"}}},percent:e})})})},f=(0,s.ZP)(r.ZP).withConfig({componentId:"sc-535d95f5-0"})(d()),p=(0,s.ZP)(r.ZP).withConfig({componentId:"sc-535d95f5-1"})(l(),n=>n.theme.colors["white-50"]),g=(0,s.ZP)(c.Z).withConfig({componentId:"sc-535d95f5-2"})(u(),n=>n.percent,n=>n.theme.colors.primary)},22713:function(n,e,t){"use strict";t.d(e,{N:function(){return d}});var i=t(49339),o=t(36734),r=t(92782),s=t(66384);function c(){let n=(0,i.Z)(["\n font-family: ",";\n font-weight: 700;\n font-size: ",";\n padding: "," ",";\n border-radius: ",";\n text-transform: uppercase;\n color: ",";\n background-color: ",";\n"]);return c=function(){return n},n}let a=(0,r.ZP)(s.C).withConfig({componentId:"sc-af99019c-0"})(c(),n=>n.theme.fontFamily.inter,n=>n.theme.fontSize.desktop["body-md"],n=>n.theme.spacing[1],n=>n.theme.spacing[2],n=>n.theme.radius.sm,n=>{switch(n.status){case"active":return n.theme.colors.primary;case"closed":return n.theme.colors.purple;default:return n.theme.colors.secondary}},n=>{switch(n.status){case"active":return n.theme.colors["opecityPrimary-2"];case"closed":return n.theme.colors["opecityPurple-2"];default:return n.theme.colors["opecitySecondary-2"]}}),d=n=>{let{status:e}=n;return(0,o.jsx)(a,{status:e,children:e})}},23762:function(n,e,t){"use strict";t.d(e,{ER:function(){return g},W2:function(){return h},b:function(){return m},iz:function(){return f},w:function(){return p},wn:function(){return x}});var i=t(49339),o=t(92782),r=t(18602);function s(){let n=(0,i.Z)(["\n width: 100%;\n height: 100%;\n padding: "," ",";\n"]);return s=function(){return n},n}function c(){let n=(0,i.Z)(["\n width: 1px;\n top: 0;\n display: flex;\n box-sizing: border-box;\n position: sticky;\n flex-direction: column;\n height: 100vh;\n border-right: 1px solid ",";\n @media (max-width: 1024px) {\n display: none;\n }\n"]);return c=function(){return n},n}function a(){let n=(0,i.Z)(["\n @media (max-width: 1024px) {\n flex-direction: column;\n }\n"]);return a=function(){return n},n}function d(){let n=(0,i.Z)(["\n flex: 1;\n @media (max-width: 1024px) {\n width: 100%;
1\n border-right: none;\n }\n"]);return d=function(){return n},n}function l(){let n=(0,i.Z)(["\n width: 381px;\n padding-bottom: 150px;\n min-height: 100vh;\n @media (max-width: 1024px) {\n width: 100%;\n }\n"]);return l=function(){return n},n}function u(){let n=(0,i.Z)(["\n display: flex;\n width: 100%;\n justify-content: center;\n align-items: center;\n align-self: stretch;\n padding: ",";\n border: 1px solid ",";\n border-radius: ",";\n background-color: ",";\n cursor: ",";\n text-align: center;\n &:hover {\n background-color: ",";\n }\n opacity: ",";\n pointer-events: ",";\n"]);return u=function(){return n},n}let h=(0,o.ZP)(r.sg).withConfig({componentId:"sc-1797ef34-0"})(s(),n=>n.theme.spacing[6],n=>n.theme.spacing[10]),f=o.ZP.div.withConfig({componentId:"sc-1797ef34-1"})(c(),n=>n.theme.colors.border),p=(0,o.ZP)(r.ZP).withConfig({componentId:"sc-1797ef34-2"})(a()),g=(0,o.ZP)(r.sg).withConfig({componentId:"sc-1797ef34-3"})(d()),m=(0,o.ZP)(r.sg).withConfig({componentId:"sc-1797ef34-4"})(l()),x=o.ZP.div.withConfig({componentId:"sc-1797ef34-5"})(u(),n=>n.theme.spacing[3],n=>n.theme.colors.border,n=>n.theme.radius.md,n=>n.selected?n.theme.colors.white:n.theme.colors.black,n=>n.disabled?"not-allowed":"pointer",n=>n.theme.colors["white-50"],n=>n.disabled?.5:1,n=>n.disabled?"none":"auto")},46445:function(n,e,t){"use strict";t.d(e,{y:function(){return I}});var i=t(49339),o=t(36734),r=t(55564),s=t(33906),c=t(92782),a=t(29842),d=t(94218),l=t(30681),u=t(66384);function h(){let n=(0,i.Z)(["\n position: relative;\n z-index: 999;\n filter: blur(2px);\n width: 100%;\n & > * {\n pointer-events: none;\n user-select: none;\n }\n"]);return h=function(){return n},n}function f(){let n=(0,i.Z)(["\n position: absolute;\n top: 0;\n left: 0;\n z-index: 1000;\n width: 100%;\n height: 100vh;\n right: 0;\n display: flex;\n align-items: center;\n justify-content: center;\n background-color: rgba(0, 0, 0, 0.5);\n"]);return f=function(){return n},n}let p=n=>{let{children:e,needAuth:t}=n,{profile:i}=(0,d.F_)();return t&&!i?(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(g,{children:e}),(0,o.jsx)(m,{children:(0,o.jsx)(u.C,{variant:"header-md",textAlign:"center",children:"You need to login to use this feature"})})]}):(0,o.jsx)(o.Fragment,{children:e})},g=(0,c.ZP)(l.ZP).withConfig({componentId:"sc-86ec4059-0"})(h()),m=(0,c.ZP)(l.ZP).withConfig({componentId:"sc-86ec4059-1"})(f());var x=t(18602);function w(){let n=(0,i.Z)(["\n width: 100%;\n max-width: 1200px;\n margin: 0 auto;\n padding: 24px;\n\n header {\n display: flex;\n align-items: center;\n gap: 16px;\n margin-bottom: 24px;\n\n button {\n display: flex;\n align-items: center;\n justify-content: center;\n padding: 8px;\n border: none;\n background: none;\n cursor: pointer;\n border-radius: 50%;\n transition: background-color 0.2s;\n\n &:hover {\n background-color: ",";\n }\n }\n\n h1 {\n color: ",";\n font-size: ",";\n font-weight: bold;\n margin: 0;\n }\n }\n"]);return w=function(){return n},n}let v=c.ZP.div.withConfig({componentId:"sc-6cc29f02-0"})(w(),n=>n.theme.colors["black-90"],n=>n.theme.colors.white,n=>n.theme.fontSize.desktop["header-lg"]);function b(){let n=(0,i.Z)(["\n width: 100%;\n position: sticky;\n display: flex;\n top: 35px;\n max-height: 67px;\n align-items: center;\n z-index: 100;\n backdrop-filter: blur(20px);\n -webkit-backdrop-filter: blur(20px);\n border-bottom: 1px solid ",";\n"]);return b=function(){return n},n}function y(){let n=(0,i.Z)(["\n width: 100%;\n border-right: 1px solid ",";\n /* border-left: 1px solid ","; */\n"]);return y=function(){return n},n}function Z(){let n=(0,i.Z)(["\n width: 100%;\n height: 100%;\n min-height: 100vh;\n"]);return Z=function(){return n},n}function j(){let n=(0,i.Z)(["\n width: 100%;\n height: 100%;\n min-height: 100vh;\n"]);return j=function(){return n},n}let I=n=>{let{title:e,disableGoBack:t=!1,children:i,className:c}=n,a=(0,s.useRouter)();return(0,o.jsx)(p,{children:(0,o.jsxs)(v,{className:c,children:[(0,o.jsxs)("header",{children:[!t&&(0,o.jsx)("button",{onClick:()=>a.back(),children:(0,o.jsx)(r.Rp,{size:24,color:"#ffffff"})}),e&&(0,o.jsx)("h1",{children:e})]}),i]})})};(0,c.ZP)(x.ZP).withConfig({componentId:"sc-ca99e12d-0"})(b(),n=>n.theme.colors.border),c.ZP.div.withConfig({componentId:"sc-ca99e12d-1"})(y(),n=>n.theme.colors.border,n=>n.theme.colors.border),(0,c.ZP)(l.ZP).withConfig({componentId:"sc-ca99e12d-2"})(Z()),(0,c.ZP)(a.Z).withConfig({componentId:"sc-ca99e12d-3"})(j())}
1,48177:function(n,e,t){"use strict";t.r(e),t.d(e,{__N_SSP:function(){return I},default:function(){return P}});var i=t(36734),o=t(51776),r=t(25326),s=t(32299),c=t(18602),a=t(55496),d=t(66384),l=t(22713),u=t(23762),h=t(46445),f=t(19494),p=t(97087),g=t(92856),m=t(56683),x=t(94218),w=t(81864),v=t(68227),b=t(85616),y=t(38377),Z=t(45807),j=t(35994).Buffer,I=!0;function P(n){let{voting:e}=n,{isDesktop:t}=(0,f.Gc)(),[I,P]=(0,o.useState)(null),[C,k]=(0,o.useState)(!1),[R,S]=(0,o.useState)(!0),{walletAddress:_}=(0,x.F_)(),{signMessage:q,getChainId:E}=(0,w.K9)(),[z,N]=(0,o.useState)(e),T=z.proposal,V=(0,g.y)(z.proposal);(0,o.useEffect)(()=>{let n=async()=>{let n=await p.Z.getVotes({votingId:e.votingId,voter:null!=_?_:void 0});S(n.length>0)};_&&n()},[_]);let W=(0,o.useCallback)(async()=>{let n=await p.Z.getVoting(e.votingId);N(n)},[]),X=(0,o.useCallback)(async()=>{try{var n,e,t,i,o;if(k(!0),!I)throw Error("Please select your vote");if(!_)throw Error("Wallet address not found");let r=Date.now(),s=JSON.stringify({votingId:z.votingId,choiceId:I,choiceTitle:null!==(i=null===(n=T.choices.find(n=>n.choiceId===I))||void 0===n?void 0:n.title)&&void 0!==i?i:"",signAt:r}),c=await q(s);if(!c.success)throw Error("Sign message failed");let a=null===(e=c.data)||void 0===e?void 0:e.signature;if(!a)throw Error("Signature not found");let d=await p.Z.createVote({votingId:z.votingId,choiceId:I,choiceTitle:null!==(o=null===(t=T.choices.find(n=>n.choiceId===I))||void 0===t?void 0:t.title)&&void 0!==o?o:"",signInfo:{signer:_,signature:a,chainId:E(),signAt:r}});console.log({voteData:d}),P(null),W()}catch(n){console.log(n),v.Am.error(n.message)}finally{k(!1)}},[I]),F="data:image/svg+xml;base64,"+j.from((0,Z.KT)(T.signInfo.signer,100)).toString("base64");return(0,i.jsx)(h.y,{title:T.title,needAuth:!0,children:(0,i.jsxs)(u.w,{children:[(0,i.jsxs)(u.ER,{gap:5,padding:{x:t?10:3,y:7},style:{paddingBottom:t?"150px":"0px"},children:[(0,i.jsx)(d.C,{variant:"header-xl",fontWeight:"bold",children:T.title}),(0,i.jsxs)(c.X2,{width:"100%",responsive:!0,alignItems:"center",gap:2,children:[(0,i.jsx)(l.N,{status:(0,g.n)(z)}),(0,i.jsxs)(c.X2,{gap:2,children:[(0,i.jsx)(d.C,{variant:"body-md",color:"white-50",children:"Proposal by"}),(0,i.jsxs)(c.X2,{gap:2,alignItems:"center",children:[(0,i.jsx)(y.Z,{avatar:{imageUrl:F,width:24,height:24},containerProps:{border:!0,radius:"full"},radius:!0}),(0,i.jsx)(d.C,{variant:"body-md",children:(0,m.Tg)(T.signInfo.signer)})]})]})]}),(0,i.jsx)(c.sg,{width:"100%",children:(0,i.jsx)(d.C,{variant:"body-md",color:"white-50",children:T.description})}),(0,i.jsxs)(c.sg,{width:"100%",gap:4,children:[(0,i.jsx)(d.C,{variant:"header-md",fontWeight:"bold",children:"Cast your vote"}),T.choices.map(n=>(0,i.jsx)(u.wn,{disabled:C||R||"active"!==(0,g.n)(z),onClick:()=>{C||P(e=>e===n.choiceId?null:n.choiceId)},selected:I===n.choiceId,children:(0,i.jsxs)(d.C,{color:I===n.choiceId?"black":"white",children:[n.title,n.description&&n.description.length>0&&", ".concat(n.description)]})},n.choiceId)),(0,i.jsx)(r.Z,{width:"100%",variant:"primary",disabled:!I||C||R||"active"!==(0,g.n)(z),loading:C,onClick:async()=>{await X()},children:"Vote"})]})]}),(0,i.jsx)(u.iz,{}),(0,i.jsxs)(u.b,{gap:4,padding:{x:t?10:3,y:8},children:[(0,i.jsx)(d.C,{variant:"header-md",fontWeight:"bold",children:"Results"}),(0,i.jsxs)(s.Z,{direction:"column",gap:8,padding:{x:6,y:8},children:[T.choices.map(n=>(0,i.jsxs)(c.sg,{width:"100%",gap:3,children:[(0,i.jsxs)(c.X2,{width:"100%",justifyContent:"space-between",alignItems:"center",children:[(0,i.jsx)(d.C,{variant:"body-md",fontWeight:"bold",children:n.title}),(0,i.jsxs)(d.C,{variant:"body-md",fontWeight:"bold",children:[n.veReap?Math.floor(n.veReap/V*100):0,"%"]})]}),(0,i.jsx)(a.k,{percent:n.veReap?Math.floor(n.veReap/V*100):0})]},n.choiceId)),(0,i.jsxs)(c.sg,{width:"100%",gap:3,children:[(0,i.jsxs)(c.X2,{width:"100%",justifyContent:"space-between",alignItems:"center",children:[(0,i.jsx)(d.C,{variant:"body-md",fontWeight:"bold",children:"Quorum"}),(0,i.jsxs)(d.C,{variant:"body-md",fontWeight:"bold",children:[(0,m.sy)(Math.floor(V/b.F_.reapTokenPrecision)),"/",(0,m.sy)(z.quorum)]})]}),(0,i.jsx)(a.k,{percent:Math.floor(V/z.quorum*100)})]})]})]})]})})}},97087:function(n,e,t){"use strict";t.d(e,{Z:function(){return s}});var i=t(37746),o=t(85616);let r=i.Z.create({baseURL:o.eG.governanceUrl,headers:{}});var s=new class{constructor(){this.postRequest=async function(n,e){let t=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},i=await r.post("/".concat(n),{...e},{headers:{...t}});return i.data},this.getRequests=async function(n){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},t=await r.get("/".concat(n),{headers:{...e}});return t.data},this.deleteRequest=async function(n,e){let t=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},i=await r.delete("/".concat(n),{data:{...e},headers:{...t}});return i.data},this.createProposal=async n=>{let e=await this.postRequest("proposals",n);return e}
1,this.createVoting=async n=>{let e=await this.postRequest("votings",n);return e},this.createVote=async n=>{let e=await this.postRequest("votes",n);return e},this.rejectProposal=async(n,e)=>{let t=await this.deleteRequest("proposals/".concat(n),e);return t},this.getProposal=async n=>{let e=await this.getRequests("proposals/".concat(n));return e},this.getProposals=async n=>{let e=await this.getRequests("proposals?".concat(new URLSearchParams(n)));return e},this.getVotings=async n=>{let e=await this.getRequests("votings?".concat(new URLSearchParams(n)));return e},this.getVoting=async n=>{let e=await this.getRequests("votings/".concat(n));return e},this.getVotes=async n=>{let e=await this.getRequests("votes?".concat(new URLSearchParams(n)));return e}}}},92856:function(n,e,t){"use strict";t.d(e,{n:function(){return o},y:function(){return r}});var i=t(39632);let o=n=>{if(!n)return"unlisted";let e=n?i.ou.fromMillis(n.startTime):null,t=n?i.ou.fromMillis(n.endTime):null;return e&&t?e<i.ou.now()&&t>i.ou.now()?"active":t<i.ou.now()?"closed":"unlisted":"unlisted"},r=n=>{var e;return n.choices.reduce((n,t)=>n+(null!==(e=t.veReap)&&void 0!==e?e:0),0)}}},function(n){n.O(0,[774,888,179],function(){return n(n.s=25215)}),_N_E=n.O()}]);
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.