1"use strict";(self.webpackChunkmstblockchain=self.webpackChunkmstblockchain||[]).push([[5348],{74212:(e,s,t)=>{t.d(s,{f:()=>i});var l=t(23768);const i=function(e){let s=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"Transaction failed.";if(console.error("Caught error:",e),4001===(null===e||void 0===e?void 0:e.code))return l.oR.dismiss(),void l.oR.error("Transaction rejected by user.");if("BaseError"===(null===e||void 0===e?void 0:e.name)||null!==e&&void 0!==e&&e.walk){const a=e.walk((e=>"ContractFunctionRevertedError"===e.name));if(a){var t,i;const e=null!==(t=null===(i=a.data)||void 0===i?void 0:i.errorName)&&void 0!==t?t:"Transaction reverted";l.oR.dismiss(),l.oR.error(`Reverted: ${e}`)}else l.oR.dismiss(),l.oR.error(`Blockchain Error: ${e.shortMessage||e.message||s}`)}else l.oR.dismiss(),l.oR.error(`Unknown Error: ${(null===e||void 0===e?void 0:e.message)||s}`)}},5348:(e,s,t)=>{t.r(s),t.d(s,{default:()=>K});var l=t(65043),i=t(85369),a=t(93751),d=t(1009),o=t(89271),r=t(27149),n=t(22285),c=t(90789),x=t(73216),m=t(22019),v=t(70579);const u=e=>{let{forVote:s,forAgainst:t,forAbstain:l}=e;const i=["Infinity"==s||"NaN"==s?0:s,"Infinity"==t||"NaN"==t?0:t,"Infinity"==l||"NaN"==l?0:l];return(0,v.jsxs)("div",{id:"chart",className:"w-full bg-black p-4 rounded-lg border border-red-800 justify-evenly flex flex-col items-center xxl:flex-row ",children:[(0,v.jsx)("div",{className:"w-[250px] h-[250px] md:w-[450px] md:h-[450px]",children:(0,v.jsx)(m.A,{options:{chart:{type:"radialBar",height:600},plotOptions:{radialBar:{startAngle:0,endAngle:360,hollow:{size:"20%"},track:{background:"#fff",strokeWidth:"100%",margin:10,padding:20},dataLabels:{name:{show:!1},value:{fontSize:"16px",color:"#fff",show:!0,offsetY:5}}}},stroke:{lineCap:"round"},fill:{type:"gradient",gradient:{shade:"dark",shadeIntensity:.4,inverseColors:!1,opacityFrom:1,opacityTo:1,stops:[0,100]}},labels:["For","Against","Abstain"],colors:["#2CA878","#AA0000","#8876E3"]},series:i,type:"radialBar",height:"100%",width:"100%"})}),(0,v.jsxs)("div",{className:"text-white space-y-2 text-sm flex flex-row xxl:flex-col gap-8",children:[(0,v.jsxs)("div",{className:"flex items-center gap-2",children:[(0,v.jsx)("div",{className:"md:w-8 md:h-8 w-6 h-6 rounded-full bg-gradient-to-br from-[#2CA878] to-[#D1F2E3]"}),(0,v.jsxs)("span",{children:["For :"," ","Infinity"==s||"NaN"==s||0==s?0:Number(s).toFixed(2),"%"]})]}),(0,v.jsxs)("div",{className:"flex items-center gap-2",children:[(0,v.jsx)("div",{className:"lg:w-8 lg:h-8 w-6 h-6 rounded-full bg-gradient-to-br from-[#AA0000] to-black"}),(0,v.jsxs)("span",{children:["Against :"," ","Infinity"==t||"NaN"==t||0==t?0:Number(t).toFixed(2),"%"]})]}),(0,v.jsxs)("div",{className:"flex items-center gap-2",children:[(0,v.jsx)("div",{className:"lg:w-8 lg:h-8 w-6 h-6 rounded-full bg-gradient-to-br from-[#8876E3] to-[#B8A3F6]"}),(0,v.jsxs)("span",{children:["Abstain :"," ","Infinity"==l||"NaN"==l||0==l?0:Number(l).toFixed(2),"%"]})]})]})]})};var p=t(91036),h=t(2829),f=t(53864),g=t(215),b=t(37718),j=t(32100),N=t(71321),w=t(2545),y=t(1273),_=t(37131),k=t(81064),T=t(85347),A=t(86178),R=t.n(A),C=t(72975),D=t(23438),E=t(80229),$=t(30267);const V=()=>{const[e,s]=(0,l.useState)(!1),[t,i]=(0,l.useState)({}),{id:a}=(0,x.g)();return(0,l.useEffect)((()=>{(async()=>{s(!0);const e=await(0,C.Nd)(`/proposal/votes/${a}`),{status:t,data:l}=e;t?(s(!1),i(l)):s(!1)})()}),[]),(0,v.jsxs)(v.Fragment,{children:[e&&(0,v.jsx)(T.A,{}),(0,v.jsx)("div",{className:"w-full bg-black px-2 rounded-lg border border-red-800 flex justify-evenly flex-col md:flex-row",children:(0,v.jsxs)("div",{className:"bg-black text-white max-h-[250px] md:max-h-[500px] overflow-y-auto rounded-xl p-4 w-full max-w-full mx-auto",children:[(0,v.jsxs)("div",{className:"flex justify-between items-center border-b border-red-800 pb-2 mb-4",children:[(0,v.jsxs)("span",{className:"text-sm text-gray-300",children:[null===t||void 0===t?void 0:t.total," addresses"]}),(0,v.jsxs)("span",{className:"text-sm text-gray-300",children:[" ",(null===t||void 0===t?void 0:t.totalVotingPower)&&(0,D.wk)((0,y.c)(null===t||void 0===t?void 0:t.totalVotingPower))," ","votes"]})]}),(0,v.jsx)("div",{className:"space-y-4",children:null!==t&&void 0!==t&&t.votes&&t.votes.length>0?t.votes.map(((e,s)=>(0,v.jsxs)("div",{className:"flex items-center justify-between",children:[(0,v.jsxs)("div",{className:"flex items-center gap-3",children:[(0,v.jsx)("img",{loading:"lazy",src:"/profile-1.png",alt:"avatar",className:"w-8 h-8 rounded-full bg-white"}),(0,v.jsx)("span",{className:"text-sm hidden md:flex font-medium",children:e.voter}),(0,v.jsx)("span",{title:e.voter,className:"text-sm md:hidden flex font-medium",children:e.voter&&e.voter.slice(0,6)+"..."+e.voter.slice(38,42)})]}),(0,v.jsx)("span",{className:`text-sm ${"Against"==e.voteType?"text-red-600":"For"==e.voteType?"text-green-600":"text-purple-600"} font-semibold `,children:(0,D.wk)((0,y.c)(e.votingPower))})]},s))):(0,v.jsx)("div",{className:"text-gray-400 text-sm text-center py-2",children:"No votes yet"})})]})})]})};var P=t(50108),F=t(11653),M=t(87734),S=t(52185),O=t(6026),B=t(86150),G=t(90168);const I=e=>{let{active:s=!1,payload:t=[],label:l=""}=e;if(s&&t&&t.length){var i,a;const e=R()(l),s=(null===(i=t[0].payload)||void 0===i?void 0:i.voteType)||"N/A";return(0,v.jsxs)("div",{className:"bg-gradient-2 p-2 rounded-md text-white text-xs border border-[#ee0000] pointer-events-none",children:[(0,v.jsx)("p",{className:"text-14 text-white",children:e.format("MMM Do hh:mm A")}),(0,v.jsxs)("p",{className:"text-white text-14 mt-1",children:["Vote Type: ",(0,v.jsx)("strong",{children:s})]}),(0,v.jsxs)("p",{className:"text-white text-14 mt-1",children:["Vote Power: ",(0,D.wk)(null===(a=t[0].payload)||void 0===a?void 0:a.votingPower)]}),(0,v.jsxs)("p",{className:"text-white text-14 mt-1",children:["\u23f1 ",e.fromNow()]})]})}return null},q=e=>{let{data:s}=e;return(0,v.jsx)("div",{className:"w-full bg-black px-2 py-6 rounded-lg border border-red-800 flex justify-evenly flex-col md:flex-row",children:(0,v.jsx)(P.u,{width:"100%",height:400,children:(0,v.jsxs)(F.b,{data:s,children:[(0,v.jsx)(M.d,{stroke:"#333",strokeDasharray:"3 3"}),(0,v.jsx)(S.W,{dataKey:"voteTime",stroke:"#eee",tick:{fill:"#eee",fontSize:12}
1,tickLine:!1,axisLine:{stroke:"#eee"},tickFormatter:e=>R()(e).format("MMM Do hh:mm A")}),(0,v.jsx)(O.h,{stroke:"#eee",tick:{fill:"#eee",fontSize:12},tickLine:!1,axisLine:{stroke:"#eee"},tickFormatter:e=>e>=1e9?(e/1e9).toFixed(1)+"B":e>=1e6?(e/1e6).toFixed(1)+"M":e>=1e3?(e/1e3).toFixed(1)+"K":e}),(0,v.jsx)(B.m,{content:(0,v.jsx)(I,{})}),(0,v.jsx)(G.N,{type:"monotone",dataKey:"votingPower",stroke:"red",strokeWidth:2,dot:{fill:"red",r:4},activeDot:{r:6}})]})})})};var z=t(37599),L=t(74212);const W=["Pending","Active","Canceled","Defeated","Succeeded","Queued","Expired","Executed"];const K=function(){var e,s,t,m,A,E;const P=(0,x.Zp)(),[F,M]=(0,l.useState)("Bubble"),S=(0,g.e)(),{id:O,proposalId:B}=(0,x.g)(),[G,I]=(0,l.useState)(""),[K,Q]=(0,l.useState)(null),[Z,H]=(0,l.useState)(!1),[J,U]=(0,l.useState)(!1),{data:X}=(0,b.Q)(),[ee,se]=(0,l.useState)([]),[te,le]=(0,l.useState)(""),[ie,ae]=(0,l.useState)({}),[de,oe]=(0,l.useState)(null),[re,ne]=(0,l.useState)(!1),[ce,xe]=(0,l.useState)(!1),[me,ve]=(0,l.useState)(!1);(0,l.useEffect)((()=>{setTimeout((()=>{M("Bubble")}),1500)}),[]);const ue=(0,w.PF)({address:null===h.$T||void 0===h.$T?void 0:h.$T.GOVERNOR_ADDR,abi:f,client:S});(0,l.useEffect)((()=>{if(!X||!S||null===h.$T||void 0===h.$T||!h.$T.GOVERNOR_ADDR||null===ie||void 0===ie||!ie.start_block)return void console.log("Dependencies missing: walletClient, publicClient, GOVERNOR_ADDR, or start_block");(async()=>{try{var e;if(!(null===(e=X.account)||void 0===e?void 0:e.address))return void p.oR.error("Wallet not connected.");const s=await S.readContract({address:h.$T.GOVERNOR_ADDR,abi:f,functionName:"quorum",args:[ie.start_block]}),t=(0,y.c)(s);Q(t)}catch(s){console.error(s)}})()}),[X,S,h.$T,null===ie||void 0===ie?void 0:ie.start_block]),(0,l.useEffect)((()=>{if(!X||!S||null===h.$T||void 0===h.$T||!h.$T.GOVERNOR_ADDR||null===ie||void 0===ie||!ie.start_block)return;(async()=>{try{var e;if(!(null===X||void 0===X||null===(e=X.account)||void 0===e?void 0:e.address))return void p.oR.error("Wallet not connected.");const s=await S.readContract({address:null===h.$T||void 0===h.$T?void 0:h.$T.GOV_TOKEN_ADDR,abi:$,functionName:"getPastTotalSupply",args:[null===ie||void 0===ie?void 0:ie.start_block]}),t=(0,y.c)(s);oe(t)}catch(s){console.error("Error fetching GovToken totalSupply:",s)}})()}),[X,S,h.$T,null===ie||void 0===ie?void 0:ie.start_block]);const pe=async()=>{const e=await(0,C.Nd)(`/proposal/${O}`),{status:s,data:t}=e;if(s){const e=t.map((e=>{const s=3*+e.voting_delay,t=3*(+e.voting_delay+ +e.voting_period),l=R()(e.proposal_created);return{...e,details:JSON.parse(e.description),voting_start:l.clone().add(s,"seconds").toISOString(),voting_end:l.clone().add(t,"seconds").toISOString()}}));ae(e[0])}};(0,l.useEffect)((()=>{pe()}),[]),(0,l.useEffect)((()=>{if(ie&&R()().isBefore(R()(ie.voting_end))){const e=setInterval((()=>{pe()}),1e3);return()=>clearInterval(e)}}),[null===ie||void 0===ie?void 0:ie.voting_end]);const he=[{label:"Published onchain",completed:!(null===ie||void 0===ie||!ie.onchain_proposal_id),date:R()(null===ie||void 0===ie?void 0:ie.proposal_created).format("ddd MMM DD, hh:mm a"),user:(null===ie||void 0===ie?void 0:ie.user_address)&&(null===ie||void 0===ie?void 0:ie.user_address.slice(0,7))+"..."},{label:(0,D.TT)(null===ie||void 0===ie?void 0:ie.voting_start)?"Voting period started":"Voting period start",completed:(0,D.TT)(null===ie||void 0===ie?void 0:ie.voting_start)||"Canceled"==G,date:R()(null===ie||void 0===ie?void 0:ie.voting_start).format("ddd MMM DD, hh:mm a")},{label:(0,D.TT)(null===ie||void 0===ie?void 0:ie.voting_end)?"Voting period ended":"Voting period end",completed:(0,D.TT)(null===ie||void 0===ie?void 0:ie.voting_end)||"Canceled"==G,date:R()(null===ie||void 0===ie?void 0:ie.voting_end).format("ddd MMM DD, hh:mm a")},{label:`Proposal ${G}`,completed:(0,D.TT)(null===ie||void 0===ie?void 0:ie.status_updated_at)&&(0,D.TT)(null===ie||void 0===ie?void 0:ie.voting_end)||"Canceled"==G,date:R()(null===ie||void 0===ie?void 0:ie.status_updated_at).format("ddd MMM DD, hh:mm a")}],fe=async(e,s)=>{try{var t;const l=null===(t=X.account)||void 0===t?void 0:t.address;if(!l)return void p.oR.error("Wallet not connected.");le(s);const{request:i}=await S.simulateContract({account:l,address:null===h.$T||void 0===h.$T?void 0:h.$T.GOVERNOR_ADDR,abi:f,functionName:"
1castVote",args:[B,e]}),a=await(0,j.E)(X,i),d=await(0,N.n)(X,{hash:a});"success"===(null===d||void 0===d?void 0:d.status)&&(p.oR.success("Vote cast successfully!"),we(),le(""),pe())}catch(l){(0,L.f)(l,"Error in vote casting")}finally{le("")}};(0,l.useEffect)((()=>{(async()=>{U(!0);const e=await(0,C.Nd)(`/proposal/votes-timeline/${O}`),{status:s,data:t}=e;if(s){U(!1);const e=null===t||void 0===t?void 0:t.votes.map((e=>{const s=(0,y.c)(e.votingPower);return{...e,votingPower:(0,D.uG)(s)}}));se(e)}else U(!1)})()}),[]);const ge=Number((0,y.c)((null===ie||void 0===ie?void 0:ie.for_votes)||0))+Number((0,y.c)((null===ie||void 0===ie?void 0:ie.against_votes)||0))+Number((0,y.c)((null===ie||void 0===ie?void 0:ie.abstain_votes)||0)),be=100*ge/de,je=be>=1?be.toFixed(1):0===be?0:be.toFixed(4),Ne=e=>{const s=100*Number((0,y.c)(e||0))/de;return s>=1?s.toFixed(1):0===s?0:s.toFixed(4)},we=async()=>{try{var e;const s=null===(e=X.account)||void 0===e?void 0:e.address;if(!s)return void p.oR.error("Wallet not connected.");const t=await ue.read.hasVoted([B,s]);H(t)}catch(s){console.error("Error checking voting status:",s)}},ye=async()=>{try{const e=await ue.read.state([B]);I(W[e])}catch(e){console.error("Error checking voting status:",e)}};return(0,l.useEffect)((()=>{B&&ye()}),[B]),(0,l.useEffect)((()=>{we()}),[X]),(0,v.jsxs)(v.Fragment,{children:[J&&(0,v.jsx)(T.A,{}),(0,v.jsx)("div",{className:"text-sm font-rubik",children:(0,v.jsxs)("div",{className:"min-h-screen text-white font-sans ",children:[(0,v.jsxs)("div",{className:"straight-gradient-bg px-4 md:px-36 py-8 lg:py-12 border-b border-red-600",children:[(0,v.jsxs)("div",{className:"flex items-center gap-2 text-white text-base font-medium",children:[(0,v.jsx)("span",{onClick:()=>P("/portal/dao"),className:"text-[22px] cursor-pointer",children:c.K.home}),c.K.rgtArrow,(0,v.jsx)("span",{className:"cursor-pointer",onClick:()=>P("/portal/dao/proposal-list"),children:"Proposals"}),c.K.rgtArrow,(0,v.jsx)("span",{className:"bg-custom-gradient px-4 py-1 rounded-xl",children:"Proposal Details"})]}),(0,v.jsxs)("div",{className:"flex mt-2 flex-col md:flex-row justify-between items-start md:items-center gap-4 text-white",children:[(0,v.jsxs)("div",{children:[(0,v.jsxs)("h1",{className:"text-2xl mt-2 font-semibold leading-tight text-white flex items-center gap-2",children:[null===ie||void 0===ie||null===(e=ie.details)||void 0===e?void 0:e.title,(0,v.jsxs)("span",{className:"flex items-center gap-1 text-xs bg-white text-[#942C2C] px-3 capitalize py-1 rounded-lg",children:[(0,v.jsx)("span",{className:"w-2 h-2 bg-[#942C2C] rounded-full"}),G]})]}),(0,v.jsxs)("div",{className:"text-sm mt-3 text-gray-400 flex flex-wrap gap-4 items-center",children:[(0,v.jsxs)("div",{className:"flex items-center gap-2",children:[(0,v.jsx)(i.zU_,{onClick:()=>{return e=B,navigator.clipboard.writeText(e),void p.oR.success("Copied !!");var e},className:"inline-block cursor-pointer"}),(0,v.jsxs)("span",{className:"text-white",children:["ID"," ",B&&B.slice(0,3)+"..."+B.slice(75,81)]})]}),(0,v.jsxs)("div",{className:"flex items-center gap-2",children:[(0,v.jsx)(r.Hvs,{className:"inline-block gap-4"}),(0,v.jsxs)("span",{className:"text-white",children:["Proposed on:"," ",R()(null===ie||void 0===ie?void 0:ie.proposal_created).format("MMM Do, YYYY")]})]}),(0,v.jsxs)("div",{className:"flex items-center gap-2",children:[(0,v.jsx)("span",{className:"mx-1 text-white",children:(0,v.jsx)("img",{loading:"lazy",src:"/image-icon.png",alt:"Proposal"})}),(0,v.jsxs)("span",{className:"text-white",children:["by"," ",(null===ie||void 0===ie?void 0:ie.user_address)&&(null===ie||void 0===ie?void 0:ie.user_address.slice(0,15))+"....."," "]})]})]})]}),(0,v.jsx)("div",{className:"flex items-center gap-2 relative",children:(0,v.jsxs)("button",{className:"button-gradient-bg border text-white border-red-600 px-4 py-2 text-sm rounded flex items-center gap-2",children:[(0,v.jsx)(n.tsq,{className:"text-20"})," Proposal"," ",G]})})]})]}),(0,v.jsxs)("div",{className:"flex flex-col-reverse xl:grid xl:grid-cols-3 gap-4 xl:px-36 mb-10 py-4",children:[(0,v.jsxs)("div",{className:"xl:col-span-2 space-y-6",children:[(0,v.jsxs)("div",{children:[(0,v.jsx)("div",{className:"px-4 py-2 text-white font-semibold text-2xl",children:"Result details"}),(0,v.jsxs)("div",{className:"p-4",children:[(0,v.jsx)("div",{className:"relative flex flex-wrap gap-2 mb-4 text-sm border border-red-700 p-1 rounded-md",children:["Bubble","TimeLine","Voted"].map((e=>(0,v.jsx)("button",{"data-tab":e,onClick:()=>M(e),className:"flex-1 px-4 py-2 rounded-md font-semibold text-center "+(F===e?"text-white rounded-md border border-red-700 button-gradient-bg z-0":"text-white/70"),children:e},e)))}),"Bubble"==F?(0,v.jsx)(v.Fragment,{children:(null===ie||void 0===ie?void 0:ie.for_votes)&&(null===ie||void 0===ie?void 0:ie.against_votes)&&(null===ie||void 0===ie?void 0:ie.abstain_votes)&&(0,v.jsx)(v.Fragment,{children:(null===ie||void 0===ie?void 0:ie.for_votes)&&(null===ie||void 0===ie?void 0:ie.against_votes)&&(null===ie||void 0===ie?void 0:ie.abstain_votes)&&(0,v.jsx)(u,{forVote:Ne((null===ie||void 0===ie?void 0:ie.for_votes)||0),forAgainst:Ne((null===ie||void 0===ie?void 0:ie.against_votes)||0),forAbstain:Ne((null===ie||void 0===ie?void 0:ie.abstain_votes)||0)})})}):"TimeLine"==F?(0,v.jsx)(q,{data:ee}):"Voted"==F?(0,v.jsx)(V,{}):(0,v.jsx)(u,{forVote:0,forAgainst:0,forAbstain:0})]})]}),(0,v.jsxs)("div",{className:"px-4",children:[(0,v.jsx)("div",{className:"flex justify-between items-center mb-4",children:(0,v.jsx)("h2",{className:"text-2xl font-semibold text-white",children:"Actions"})}),(0,v.jsx)("div",{className:"overflow-x-auto rounded-lg px-2 border border-red-700",children:(0,v.jsxs)("div",{className:"min-w-[700px]",children:[(0,v.jsxs)("div",{className:"grid grid-cols-12 text-white font-semibold py-3 px-4 text-sm",children:[(0,v.jsx)("div",{className:"col-span-5",children:"Type"}),(0,v.jsx)("div",{className:"col-span-4 text-center",children:"Address"}),(0,v.jsx)("div",{className:"col-span-3 text-center",children:"Details"})]}),(0,v.jsx)("div",{className:" ",children:ie&&(null===ie||void 0===ie?void 0:ie.actions)&&(null===ie||void 0===ie?void 0:ie.actions.map(((e,s)=>{var t;return(0,v.jsx)(v.Fragment,{children:e&&(null===e||void 0===e?void 0:e.params)&&(null===e||void 0===e||null===(t=e.params)||void 0===t?void 0:t.map(((t,l)=>(0,v.jsxs)("div",{className:"grid grid-cols-12 items-center text-white text-sm py-4 px-4 border-t first:border-t-0 border-[#a60101]",children:[(0,v.jsxs)("div",{className:"col-span-5 space-y-1 flex items-center gap-2",children:[(0,v.jsx)("div",{children:(0,v.jsx)("img",{loading:"lazy",src:"/images/icon-profile.jpg",alt:"Proposal",width:20})}),(0,v.jsxs)("div",{children:[(0,v.jsx)("div",{className:"font-medium",children:"Custom"}),(0,v.jsxs)("div",{className:"text-xs gap-1 text-gray-400",children:[(0,v.jsx)("span",{className:"font-bold text-white",children:"Key"})," ",(0,v.jsxs)("span",{className:"cursor-pointer",children:[" ",t.name||`args${l}`]})," ","\xa0",(0,v.jsx)("span",{className:"font-bold text-white",children:"Value"})," ",(0,v.jsx)("span",{className:"cursor-pointer",title:t.value,children:t.value.length>8?t.value.slice(0,8)+"..":t.value})," ",(0,v.jsx)("span",{className:"font-bold text-white",children:"Target"})," ",(0,v.jsx)("span",{className:"cursor-pointer",title:e.target,children:e.target&&e.target.slice(0,8)+".."})]})]})]}),(0,v.jsx)("div",{className:"col-span-4 text-center",children:(0,v.jsxs)("span",{title:e.target,className:"inline-flex cursor-pointer items-center border border-red-600 text-white text-xs px-4 py-2 rounded-lg",children:[e.target&&e.target.slice(0,6)+".."+e.target.slice(38,42),(0,v.jsx)("a",{href:`https://mstscan.com/address/${e.target}`,target:"_blank",rel:"noopener noreferrer",children:(0,v.jsx)(d.HaR,{className:"ml-1"})})]})}),(0,v.jsx)("div",{className:"col-span-3 text-center font-semibold",children:e.method+"(..)"})]},s))))})})))})]})})]}),(0,v.jsxs)("div",{className:"px-4 mb-10",children:[(0,v.jsx)("h3",{className:"text-2xl text-white font-semibold mb-2",children:"Proposal"}),(0,v.jsxs)("div",{className:"border border-red-600 rounded-lg p-4",children:[(0,v.jsx)("h4",{className:"text-xl font-semibold text-white mb-1",children:"Description"}),(0,v.jsx)("p",{className:"text-base !text-white",children:(null===ie||void 0===ie||null===(s=ie.details)||void 0===s?void 0:s.description)&&Y(null===ie||void 0===ie||null===(t=ie.details)||void 0===t?void 0:t.description)})]})]})]}),(0,v.jsxs)("div",{className:"space-y-4 px-4 xl:px-0",children:[(null===ie||void 0===ie?void 0:ie.voting_start)&&(null===ie||void 0===ie?void 0:ie.voting_end)&&R()().isAfter(R()(ie.voting_start))&&R()().isBefore(R()(ie.voting_end))&&"Canceled"!=G&&(0,v.jsxs)("div",{children:[(0,v.jsx)("div",{className:"p py-2 text-white text-xl font-semibold",children:"Cast V
1ote"}),(0,v.jsxs)("div",{className:"border border-red-700 rounded-lg p-4 space-y-4 mt-4",children:[(0,v.jsxs)("div",{className:"flex items-center gap-3",children:[(0,v.jsxs)("div",{className:"flex items-center",children:[(0,D.fo)(),(0,v.jsx)("span",{className:"flex text-[#04a928] text-14",children:"Live"})]})," ",(0,v.jsxs)("div",{children:["Voting End -"," ",R()(null===ie||void 0===ie?void 0:ie.voting_end).format("ddd MMM DD, hh:mm a")," "]})]}),Z?(0,v.jsx)("div",{className:"text-white text-14",children:"\u2705 Thank you, your vote has been submitted."}):(0,v.jsxs)("div",{className:"flex w-full",children:[(0,v.jsx)("div",{className:"w-1/3 lg:w-full px-1",children:(0,v.jsx)("button",{onClick:()=>fe(1,"voteFor"),disabled:te,className:"font-semibold bg-green-600 w-full text-center py-3",children:"voteFor"==te?(0,v.jsx)(z.A,{}):"Vote For"})}),(0,v.jsx)("div",{className:"w-1/3 lg:w-full px-1",children:(0,v.jsx)("button",{disabled:te,onClick:()=>fe(0,"VoteAgainst"),className:"font-semibold bg-red-600 w-full text-center py-3",children:"VoteAgainst"==te?(0,v.jsx)(z.A,{}):"Vote Against"})}),(0,v.jsx)("div",{className:"w-1/3 lg:w-full px-1",children:(0,v.jsx)("button",{disabled:te,onClick:()=>fe(2,"Abstain"),className:"font-semibold bg-purple-600 w-full text-center py-3",children:"Abstain"==te?(0,v.jsx)(z.A,{}):"Abstain"})})]})]})]}),(null===ie||void 0===ie?void 0:ie.voting_start)&&"Canceled"!=G&&R()().isBefore(R()(null===ie||void 0===ie?void 0:ie.voting_start))&&(null===X||void 0===X||null===(m=X.account)||void 0===m||null===(A=m.address)||void 0===A?void 0:A.toLowerCase())==(null===ie||void 0===ie||null===(E=ie.user_address)||void 0===E?void 0:E.toLowerCase())&&(0,v.jsxs)("div",{className:"",children:[(0,v.jsx)("div",{className:"p py-2 text-white text-xl font-semibold",children:"Cancel Proposal"}),(0,v.jsxs)("div",{className:"border border-red-700 rounded-lg p-4 space-y-4 mt-[17px]",children:[(0,v.jsx)("div",{className:"flex items-center gap-3",children:(0,v.jsxs)("div",{children:["Voting Start -"," ",R()(ie.voting_start).format("ddd MMM DD, hh:mm a")," "]})}),(0,v.jsx)("div",{className:"flex w-full",children:(0,v.jsx)("div",{className:"w-1/3 lg:w-full px-1",children:(0,v.jsx)("button",{onClick:()=>(async()=>{try{var e;ne(!0);const s=null===(e=X.account)||void 0===e?void 0:e.address;if(!s)return p.oR.error("Wallet not connected."),void ne(!1);const{request:t}=await S.simulateContract({account:s,address:null===h.$T||void 0===h.$T?void 0:h.$T.GOVERNOR_ADDR,abi:f,functionName:"cancel",args:[B]}),l=await(0,j.E)(X,t),i=await(0,N.n)(X,{hash:l});"success"===(null===i||void 0===i?void 0:i.status)?(p.oR.success("Proposal cancelled successfully!"),pe(),ye()):p.oR.error("Failed to cancel proposal.")}catch(s){(0,L.f)(s,"Error in cancel proposal")}finally{ne(!1)}})(),disabled:te,className:"font-semibold bg-red-600 w-full text-center py-3",children:re?(0,v.jsx)(z.A,{}):"Cancel Proposal"})})}),(0,v.jsx)("div",{className:"text-white text-14",children:"You can cancel your proposal before the voting starts, if you'd like."})]})]}),"Succeeded"==G&&(0,v.jsxs)("div",{className:"",children:[(0,v.jsx)("div",{className:"p py-2 text-white text-xl font-semibold",children:"Proposal"}),(0,v.jsxs)("div",{className:"border border-red-700 rounded-lg p-4 space-y-4 mt-[17px]",children:[(0,v.jsx)("div",{className:"text-white text-16",children:"Proposal approved! Please proceed to queue it for execution."}),(0,v.jsx)("div",{className:"flex w-full",children:(0,v.jsx)("div",{className:"w-1/3 lg:w-full px-1",children:(0,v.jsx)("button",{onClick:()=>(async()=>{try{var e;xe(!0);const s=null===(e=X.account)||void 0===e?void 0:e.address;if(!s)return p.oR.error("Wallet not connected."),void xe(!1);const t=(0,_.ZJ)(null===ie||void 0===ie?void 0:ie.description,"utf-8"),l=(0,k.S)(t),i=null===ie||void 0===ie?void 0:ie.actions.map((e=>e.calldata)),a=null===ie||void 0===ie?void 0:ie.actions.map((e=>e.value)),d=null===ie||void 0===ie?void 0:ie.actions.map((e=>e.target)),{request:o}=await S.simulateContract({account:s,address:null===h.$T||void 0===h.$T?void 0:h.$T.GOVERNOR_ADDR,abi:f,functionName:"queue",args:[d,a,i,l]}),r=await(0,j.E)(X,o),n=await(0,N.n)(X,{hash:r});"success"===(null===n||void 0===n?void 0:n.status)&&(p.oR.success("Proposal queued successfully!"),ye())}catch(s){(0,L.f)(s,"Error in proposal queue")}finally{xe(!1)}})(),disabled:te,className:"font-semibold bg-purple-600 w-full text-center py-3",children:ce?(0,v.jsx)(z.A,{}):"Queue Proposal"})})})]})]}),"Queued"==G&&(0,v.jsxs)("div",{className:"",children:[(0,v.jsx)("div",{className:"p py-2 text-white text-xl font-semibold",children:"Proposal"}),(0,v.jsxs)("div",{className:"border border-red-700 rounded-lg p-4 space-y-4 mt
1-[17px]",children:[(0,v.jsx)("div",{className:"text-white text-16",children:"The proposal has been queued and is now ready for execution."}),(0,v.jsx)("div",{className:"flex w-full",children:(0,v.jsx)("div",{className:"w-1/3 lg:w-full px-1",children:(0,v.jsx)("button",{onClick:()=>(async()=>{try{var e;ve(!0);const s=null===(e=X.account)||void 0===e?void 0:e.address;if(!s)return p.oR.error("Wallet not connected."),void ve(!1);const t=(0,_.ZJ)(null===ie||void 0===ie?void 0:ie.description,"utf-8"),l=(0,k.S)(t),i=null===ie||void 0===ie?void 0:ie.actions.map((e=>e.calldata)),a=null===ie||void 0===ie?void 0:ie.actions.map((e=>e.value)),d=null===ie||void 0===ie?void 0:ie.actions.map((e=>e.target)),{request:o}=await S.simulateContract({account:s,address:null===h.$T||void 0===h.$T?void 0:h.$T.GOVERNOR_ADDR,abi:f,functionName:"execute",args:[d,a,i,l]}),r=await(0,j.E)(X,o),n=await(0,N.n)(X,{hash:r});"success"===(null===n||void 0===n?void 0:n.status)&&(p.oR.success("Proposal execute successfully!"),ye())}catch(s){(0,L.f)(s,"Error in proposal execution")}finally{ve(!1)}})(),disabled:me,className:"font-semibold bg-green-600 w-full text-center py-3",children:me?(0,v.jsx)(z.A,{}):"Execute Proposal"})})})]})]}),R()(null===ie||void 0===ie?void 0:ie.voting_end).isValid()&&R()().isAfter(R()(ie.voting_end))&&(0,v.jsxs)("div",{children:[(0,v.jsx)("div",{className:"py-2 text-white text-xl font-semibold",children:"Final Votes"}),(0,v.jsxs)("div",{className:"border border-red-700 rounded-lg p-4 space-y-4 mt-[17px]",children:[(0,v.jsxs)("div",{className:"flex items-center gap-3",children:[(0,v.jsx)(a.z8D,{className:"text-white text-xl"}),(0,v.jsx)("div",{className:"flex-1 h-2 bg-red-800 rounded-full overflow-hidden",children:(0,v.jsx)("div",{className:"h-full bg-red-600 rounded-full",style:{width:`${je}%`}})}),(0,v.jsxs)("span",{className:"text-white text-sm font-semibold",children:[je," %"]})]}),(0,v.jsxs)("div",{className:"border border-red-700 rounded-full px-4 py-2 flex justify-between items-center text-sm",children:[(0,v.jsxs)("span",{className:"text-white flex items-center gap-2",children:[(0,v.jsx)(o.m75,{className:"text-red-700 text-18"})," ","Quorum"]}),(0,v.jsxs)("span",{className:"text-gray-300",children:[(0,D.wk)(de)," of"," ",(0,D.wk)(K)]})]}),(0,v.jsxs)("div",{className:"border border-red-700 rounded-full px-4 py-2 flex justify-between items-center text-sm",children:[(0,v.jsxs)("span",{className:"text-white flex items-center gap-2",children:[(0,v.jsx)(o.m75,{className:"text-red-700 text-18"}),"Majority support"]}),(0,v.jsx)("span",{className:(Number(K)>Number(ge)?"text-red-600":"text-green-400")+" font-semibold",children:Number(K)>Number(ge)?"No":"Yes"})]}),(0,v.jsxs)("div",{className:"border-t border-dashed border-red-700 p-2 text-lg flex flex-col",children:[(0,v.jsxs)("div",{className:"text-green-600 font-semibold",children:["\u2022 For :"," ",(0,v.jsxs)("span",{className:"text-white ml-1",children:[Ne(null===ie||void 0===ie?void 0:ie.for_votes)," %"]})]}),(0,v.jsxs)("div",{className:"text-red-600 font-semibold",children:["\u2022 Against :"," ",(0,v.jsxs)("span",{className:"text-white ml-1",children:[Ne(null===ie||void 0===ie?void 0:ie.against_votes)," ","%"]})]}),(0,v.jsxs)("div",{className:"text-purple-600 font-semibold",children:["\u2022 Abstain :"," ",(0,v.jsxs)("span",{className:"text-white ml-1",children:[Ne(null===ie||void 0===ie?void 0:ie.abstain_votes)," ","%"]})]})]})]})]}),(0,v.jsxs)("div",{children:[(0,v.jsx)("div",{className:"py-2 text-white text-xl font-semibold",children:"Status"}),(0,v.jsx)("div",{className:"border border-red-700 rounded-lg p-4 space-y-4 mt-[17px]",children:(0,v.jsx)("ul",{className:"relative pl-4 border-l border-dashed border-red-600 space-y-6",children:he.map(((e,s)=>(0,v.jsxs)("li",{className:"relative flex items-start gap-4 "+("Canceled"==G&&1==s||"Canceled"==G&&2==s?"hidden":""),children:[(0,v.jsx)("div",{className:"absolute -left-[27px] top-0",children:e.completed?(0,v.jsx)("div",{className:"h-5 w-5 bg-red-600 rounded-full flex items-center justify-center",children:(0,v.jsx)(r.GHp,{})}):(0,v.jsx)("div",{className:"h-5 w-5 bg-black border border-white rounded-full"})}),(0,v.jsxs)("div",{className:"flex-1",children:[(0,v.jsx)("h4",{className:"text-sm font-semibold text-white mb-1",children:e.label}),(0,v.jsxs)("div",{className:"text-xs text-gray-300 flex flex-col",children:[e.date&&(0,v.jsxs)("span",{className:"flex items-center gap-1",children:[(0,v.jsx)(i.bfZ,{className:"text-xs"})," ",e.date]}),e.user&&(0,v.jsxs)("span",{className:"text-purple-400 flex items-center gap-2 mt-1",children:[(0,v.jsx)("img",{loading:"lazy",src:"/image-icon.png",alt:"Proposal"}),e.user]})]})]})]},s)))})})]})]})]})]})})]})};function Y(e){return(0,E.Ay)(e,{replace:e=>{if("tag"===e.type){const s={h1:"!inter-font !text-22 wsm:!text-24 !mt-16 !font-bold !text-white !leading-[24px]",h2:"!inter-font !text-20 wsm:!text-22 !mt-16 !font-bold !text-white !leading-[24px]",h3:"!inter-font !text-18 wsm:!text-20 !mt-12 !font-semibold !text-white !leading-[24px]",p:"!tracking-wide !source-serif !text-18 wmd:!text-16 !text-white !leading-[28px] !mt-[18px]",span:"!source-serif !tracking-wide !text-16 wmd:!text-20 !text-white !leading-[28px]",ul:"!source-serif !list-disc !mt-6 !pl-5 !space-y-2",ol:"!source-serif !list-decimal !mt-6 !pl-5 !space-y-2",li:"!source-serif !text-16 wmd:!text-18 !text-white !leading-[28px] !mt-3",a:"!source-serif !text-gray-800 !underline hover:!text-white",img:"!rounded-md !my-4",blockquote:"!border-l-4 !pl-4 wmd:!my-5 !my-3 !italic !text-gray-500 !border-gray-300"}[e.name]||"";s&&(e.attribs.class=s)}}})}}}]); 2//# sourceMappingURL=5348.26db712c.chunk.js.map
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.