1import{g as Fe,a as _e,r as A,u as Ue,y as Bn,z as Fn,p as _n,A as Mn,C as Ln,j as i,s as de,c as Re,b as Me,D as Ot,m as Ce,E as je,P as tt,F as en,G as De,J as tn,K as Ie,M as Nn,e as zt,N as $t,T as S,h as Ge,O as Le,i as ue,Q as pt,R as lt,l as X,B as O,S as Se,U as bt,V as Tt,W as Pn,X as Ve,Y as Qe,n as T,Z as nn,o as re,_ as Ze,$ as Vn,a0 as Ee,a1 as Un,a2 as On,a3 as ut,a4 as dt,a5 as Dt,a6 as H,a7 as zn,a8 as nt,q as Bt,a9 as Wt,aa as Ht,ab as Gt,ac as He,ad as rn,ae as on,af as $n,ag as Wn,ah as Hn}from"./index-DpnwFwBB.js";import{B as Ae,S as Gn,h as Be}from"./moment-B502RJfB.js";import{F as G}from"./enum-type-DmmPJCuj.js";import{V as ce}from"./Ve-DFWFHs5h.js";import{d as Yn,a as Kn}from"./api-DrVi9ifP.js";import{r as et,G as ye}from"./Grid2-DGJtSRmG.js";import{w as Oe,a as ze,B as qn,D as Jn,T as Ye,b as Ke,c as qe,C as Xn}from"./ToastNotifyHelper-f_680716.js";import{r as Te}from"./readContracts-CvWNsYjA.js";import{I as Zn,u as Qn,a as At,b as er,H as tr}from"./highcharts-react.min-BX39jkoB.js";import{u as sn,F as nr,T as an,S as cn,a as rr,P as ir,C as Yt}from"./CheckBox-D4HdejnN.js";import{B as fe,F as or}from"./Failed-BEo7VfGb.js";import{u as ln,T as rt}from"./Tooltip-1YwIWVCr.js";import{L as sr}from"./index-Dv6pJBfA.js";import{E as ar}from"./index-Cy9cR6BL.js";import"./node-3mEPKbP8.js";function cr(r){return Fe("MuiCollapse",r)}_e("MuiCollapse",["root","horizontal","vertical","entered","hidden","wrapper","wrapperInner"]);const lr=r=>{const{orientation:n,classes:c}=r,l={root:["root",`${n}`],entered:["entered"],hidden:["hidden"],wrapper:["wrapper",`${n}`],wrapperInner:["wrapperInner",`${n}`]};return Me(l,cr,c)},ur=de("div",{name:"MuiCollapse",slot:"Root",overridesResolver:(r,n)=>{const{ownerState:c}=r;return[n.root,n[c.orientation],c.state==="entered"&&n.entered,c.state==="exited"&&!c.in&&c.collapsedSize==="0px"&&n.hidden]}})(Ce(({theme:r})=>({height:0,overflow:"hidden",transition:r.transitions.create("height"),variants:[{props:{orientation:"horizontal"},style:{height:"auto",width:0,transition:r.transitions.create("width")}},{props:{state:"entered"},style:{height:"auto",overflow:"visible"}},{props:{state:"entered",orientation:"horizontal"},style:{width:"auto"}},{props:({ownerState:n})=>n.state==="exited"&&!n.in&&n.collapsedSize==="0px",style:{visibility:"hidden"}}]}))),dr=de("div",{name:"MuiCollapse",slot:"Wrapper",overridesResolver:(r,n)=>n.wrapper})({display:"flex",width:"100%",variants:[{props:{orientation:"horizontal"},style:{width:"auto",height:"100%"}}]}),hr=de("div",{name:"MuiCollapse",slot:"WrapperInner",overridesResolver:(r,n)=>n.wrapperInner})({width:"100%",variants:[{props:{orientation:"horizontal"},style:{width:"auto",height:"100%"}}]}),ht=A.forwardRef(function(n,c){const l=Ue({props:n,name:"MuiCollapse"}),{addEndListener:h,children:f,className:d,collapsedSize:a="0px",component:y,easing:b,in:w,onEnter:x,onEntered:j,onEntering:m,onExit:E,onExited:I,onExiting:D,orientation:R="vertical",style:k,timeout:v=Bn.standard,TransitionComponent:_=Fn,...C}=l,F={...l,orientation:R,collapsedSize:a},M=lr(F),ee=_n(),ie=Mn(),L=A.useRef(null),J=A.useRef(),W=typeof a=="number"?`${a}px`:a,Z=R==="horizontal",N=Z?"width":"height",U=A.useRef(null),P=Ln(c,U),z=B=>ne=>{if(B){const le=U.current;ne===void 0?B(le):B(le,ne)}},te=()=>L.current?L.current[Z?"clientWidth":"clientHeight"]:0,he=z((B,ne)=>{L.current&&Z&&(L.current.style.position="absolute"),B.style[N]=W,x&&x(B,ne)}),K=z((B,ne)=>{const le=te();L.current&&Z&&(L.current.style.position="");const{duration:be,easing:Ne}=Ot({style:k,timeout:v,easing:b},{mode:"enter"});if(v==="auto"){const ot=ee.transitions.getAutoHeightDuration(le);B.style.transitionDuration=`${ot}ms`,J.current=ot}else B.style.transitionDuration=typeof be=="string"?be:`${be}ms`;B.style[N]=`${le}px`,B.style.transitionTimingFunction=Ne,m&&m(B,ne)}),Y=z((B,ne)=>{B.style[N]="auto",j&&j(B,ne)}),$=z(B=>{B.style[N]=`${te()}px`,E&&E(B)}),we=z(I),xe=z(B=>{const ne=te(),{duration:le,easing:be}=Ot({style:k,timeout:v,easing:b},{mode:"exit"});if(v==="auto"){const Ne=ee.transitions.getAutoHeightDuration(ne);B.style.transitionDuration=`${Ne}ms`,J.current=Ne}else B.style.transitionDuration=typeof le=="string"?le:`${le}ms`;B.style[N]=W,B.style.transitionTimingFunction=be,D&&D(B)}),q=B=>{v==="auto"&&ie.start(J.current||0,B),h&&h(U.current,B)};return i.jsx(_,{in:w,onEnter:he,onEntered:Y,onEntering:K,onExit:$,onExited:we,onExiting:xe,addEndListener:q,nodeRef:U,timeout:v==="auto"?null:v,...C,children:(B,{ownerState:ne,...le})=>i.jsx(ur,{as:y,className:Re(M.root,d,{entered:M.entered,exited:!w&&W==="0px"&&M.hidden}[B]),style:{[Z?"minWidth":"minHeight"]:W,...k},ref:P,ownerState:{...F,state:B},...le,children:i.jsx(dr,{ownerState:{...F,state:B},className:M.wrapper,ref:L,children:i.jsx(hr,{ownerState:{...F,state:B},className:M.wrapperInner,children:f})})})})});ht&&(ht.muiSupportAuto=!0);const un=A.createContext({});function pr(r){return Fe("MuiAccordion",r)}const at=_e("MuiAccordion",["root","heading","rounded","expanded","disabled","gutters","region"]),fr=r=>{const{classes:n,square:c,expanded:l,disabled:h,disableGutters:f}=r;return Me({root:["root",!c&&"rounded",l&&"expanded",h&&"disabled",!f&&"gutters"],heading:["heading"],region:["region"]},pr,n)},mr=de(tt,{name:"MuiAccordion",slot:"Root",overridesResolver:(r,n)=>{const{ownerState:c}=r;
1return[{[`& .${at.region}`]:n.region},n.root,!c.square&&n.rounded,!c.disableGutters&&n.gutters]}})(Ce(({theme:r})=>{const n={duration:r.transitions.duration.shortest};return{position:"relative",transition:r.transitions.create(["margin"],n),overflowAnchor:"none","&::before":{position:"absolute",left:0,top:-1,right:0,height:1,content:'""',opacity:1,backgroundColor:(r.vars||r).palette.divider,transition:r.transitions.create(["opacity","background-color"],n)},"&:first-of-type":{"&::before":{display:"none"}},[`&.${at.expanded}`]:{"&::before":{opacity:0},"&:first-of-type":{marginTop:0},"&:last-of-type":{marginBottom:0},"& + &":{"&::before":{display:"none"}}},[`&.${at.disabled}`]:{backgroundColor:(r.vars||r).palette.action.disabledBackground}}}),Ce(({theme:r})=>({variants:[{props:n=>!n.square,style:{borderRadius:0,"&:first-of-type":{borderTopLeftRadius:(r.vars||r).shape.borderRadius,borderTopRightRadius:(r.vars||r).shape.borderRadius},"&:last-of-type":{borderBottomLeftRadius:(r.vars||r).shape.borderRadius,borderBottomRightRadius:(r.vars||r).shape.borderRadius,"@supports (-ms-ime-align: auto)":{borderBottomLeftRadius:0,borderBottomRightRadius:0}}}},{props:n=>!n.disableGutters,style:{[`&.${at.expanded}`]:{margin:"16px 0"}}}]}))),xr=de("h3",{name:"MuiAccordion",slot:"Heading",overridesResolver:(r,n)=>n.heading})({all:"unset"}),gr=A.forwardRef(function(n,c){const l=Ue({props:n,name:"MuiAccordion"}),{children:h,className:f,defaultExpanded:d=!1,disabled:a=!1,disableGutters:y=!1,expanded:b,onChange:w,square:x=!1,slots:j={},slotProps:m={},TransitionComponent:E,TransitionProps:I,...D}=l,[R,k]=ln({controlled:b,default:d,name:"Accordion",state:"expanded"}),v=A.useCallback(te=>{k(!R),w&&w(te,!R)},[R,w,k]),[_,...C]=A.Children.toArray(h),F=A.useMemo(()=>({expanded:R,disabled:a,disableGutters:y,toggle:v}),[R,a,y,v]),M={...l,square:x,disabled:a,disableGutters:y,expanded:R},ee=fr(M),ie={transition:E,...j},L={transition:I,...m},J={slots:ie,slotProps:L},[W,Z]=je("root",{elementType:mr,externalForwardedProps:{...J,...D},className:Re(ee.root,f),shouldForwardComponentProp:!0,ownerState:M,ref:c,additionalProps:{square:x}}),[N,U]=je("heading",{elementType:xr,externalForwardedProps:J,className:ee.heading,ownerState:M}),[P,z]=je("transition",{elementType:ht,externalForwardedProps:J,ownerState:M});return i.jsxs(W,{...Z,children:[i.jsx(N,{...U,children:i.jsx(un.Provider,{value:F,children:_})}),i.jsx(P,{in:R,timeout:"auto",...z,children:i.jsx("div",{"aria-labelledby":_.props.id,id:_.props["aria-controls"],role:"region",className:ee.region,children:C})})]})});function yr(r){return Fe("MuiAccordionDetails",r)}_e("MuiAccordionDetails",["root"]);const wr=r=>{const{classes:n}=r;return Me({root:["root"]},yr,n)},br=de("div",{name:"MuiAccordionDetails",slot:"Root",overridesResolver:(r,n)=>n.root})(Ce(({theme:r})=>({padding:r.spacing(1,2,2)}))),Tr=A.forwardRef(function(n,c){const l=Ue({props:n,name:"MuiAccordionDetails"}),{className:h,...f}=l,d=l,a=wr(d);return i.jsx(br,{className:Re(a.root,h),ref:c,ownerState:d,...f})});function Ar(r){return Fe("MuiAccordionSummary",r)}const We=_e("MuiAccordionSummary",["root","expanded","focusVisible","disabled","gutters","contentGutters","content","expandIconWrapper"]),jr=r=>{const{classes:n,expanded:c,disabled:l,disableGutters:h}=r;return Me({root:["root",c&&"expanded",l&&"disabled",!h&&"gutters"],focusVisible:["focusVisible"],content:["content",c&&"expanded",!h&&"contentGutters"],expandIconWrapper:["expandIconWrapper",c&&"expanded"]},Ar,n)},Sr=de(en,{name:"MuiAccordionSummary",slot:"Root",overridesResolver:(r,n)=>n.root})(Ce(({theme:r})=>{const n={duration:r.transitions.duration.shortest};return{display:"flex",width:"100%",minHeight:48,padding:r.spacing(0,2),transition:r.transitions.create(["min-height","background-color"],n),[`&.${We.focusVisible}`]:{backgroundColor:(r.vars||r).palette.action.focus},[`&.${We.disabled}`]:{opacity:(r.vars||r).palette.action.disabledOpacity},[`&:hover:not(.${We.disabled})`]:{cursor:"pointer"},variants:[{props:c=>!c.disableGutters,style:{[`&.${We.expanded}`]:{minHeight:64}}}]}})),Er=de("span",{name:"MuiAccordionSummary",slot:"Content",overridesResolver:(r,n)=>n.content})(Ce(({theme:r})=>({display:"flex",textAlign:"start",flexGrow:1,margin:"12px 0",variants:[{props:n=>
1!n.disableGutters,style:{transition:r.transitions.create(["margin"],{duration:r.transitions.duration.shortest}),[`&.${We.expanded}`]:{margin:"20px 0"}}}]}))),Cr=de("span",{name:"MuiAccordionSummary",slot:"ExpandIconWrapper",overridesResolver:(r,n)=>n.expandIconWrapper})(Ce(({theme:r})=>({display:"flex",color:(r.vars||r).palette.action.active,transform:"rotate(0deg)",transition:r.transitions.create("transform",{duration:r.transitions.duration.shortest}),[`&.${We.expanded}`]:{transform:"rotate(180deg)"}}))),Ir=A.forwardRef(function(n,c){const l=Ue({props:n,name:"MuiAccordionSummary"}),{children:h,className:f,expandIcon:d,focusVisibleClassName:a,onClick:y,slots:b,slotProps:w,...x}=l,{disabled:j=!1,disableGutters:m,expanded:E,toggle:I}=A.useContext(un),D=L=>{I&&I(L),y&&y(L)},R={...l,expanded:E,disabled:j,disableGutters:m},k=jr(R),v={slots:b,slotProps:w},[_,C]=je("root",{ref:c,shouldForwardComponentProp:!0,className:Re(k.root,f),elementType:Sr,externalForwardedProps:{...v,...x},ownerState:R,additionalProps:{focusRipple:!1,disableRipple:!0,disabled:j,"aria-expanded":E,focusVisibleClassName:Re(k.focusVisible,a)},getSlotProps:L=>({...L,onClick:J=>{var W;(W=L.onClick)==null||W.call(L,J),D(J)}})}),[F,M]=je("content",{className:k.content,elementType:Er,externalForwardedProps:v,ownerState:R}),[ee,ie]=je("expandIconWrapper",{className:k.expandIconWrapper,elementType:Cr,externalForwardedProps:v,ownerState:R});return i.jsxs(_,{...C,children:[i.jsx(F,{...M,children:h}),d&&i.jsx(ee,{...ie,children:d})]})});function vr(r){return Fe("PrivateSwitchBase",r)}_e("PrivateSwitchBase",["root","checked","disabled","input","edgeStart","edgeEnd"]);const kr=r=>{const{classes:n,checked:c,disabled:l,edge:h}=r,f={root:["root",c&&"checked",l&&"disabled",h&&`edge${De(h)}`],input:["input"]};return Me(f,vr,n)},Rr=de(en,{name:"MuiSwitchBase"})({padding:9,borderRadius:"50%",variants:[{props:{edge:"start",size:"small"},style:{marginLeft:-3}},{props:({edge:r,ownerState:n})=>r==="start"&&n.size!=="small",style:{marginLeft:-12}},{props:{edge:"end",size:"small"},style:{marginRight:-3}},{props:({edge:r,ownerState:n})=>r==="end"&&n.size!=="small",style:{marginRight:-12}}]}),Dr=de("input",{name:"MuiSwitchBase",shouldForwardProp:tn})({cursor:"inherit",position:"absolute",opacity:0,width:"100%",height:"100%",top:0,left:0,margin:0,padding:0,zIndex:1}),Br=A.forwardRef(function(n,c){const{autoFocus:l,checked:h,checkedIcon:f,defaultChecked:d,disabled:a,disableFocusRipple:y=!1,edge:b=!1,icon:w,id:x,inputProps:j,inputRef:m,name:E,onBlur:I,onChange:D,onFocus:R,readOnly:k,required:v=!1,tabIndex:_,type:C,value:F,slots:M={},slotProps:ee={},...ie}=n,[L,J]=ln({controlled:h,default:!!d,name:"SwitchBase",state:"checked"}),W=sn(),Z=q=>{R&&R(q),W&&W.onFocus&&W.onFocus(q)},N=q=>{I&&I(q),W&&W.onBlur&&W.onBlur(q)},U=q=>{if(q.nativeEvent.defaultPrevented)return;const B=q.target.checked;J(B),D&&D(q,B)};let P=a;W&&typeof P>"u"&&(P=W.disabled);const z=C==="checkbox"||C==="radio",te={...n,checked:L,disabled:P,disableFocusRipple:y,edge:b},he=kr(te),K={slots:M,slotProps:{input:j,...ee}},[Y,$]=je("root",{ref:c,elementType:Rr,className:he.root,shouldForwardComponentProp:!0,externalForwardedProps:{...K,component:"span",...ie},getSlotProps:q=>({...q,onFocus:B=>{var ne;(ne=q.onFocus)==null||ne.call(q,B),Z(B)},onBlur:B=>{var ne;(ne=q.onBlur)==null||ne.call(q,B),N(B)}}),ownerState:te,additionalProps:{centerRipple:!0,focusRipple:!y,disabled:P,role:void 0,tabIndex:null}}),[we,xe]=je("input",{ref:m,elementType:Dr,className:he.input,externalForwardedProps:K,getSlotProps:q=>({onChange:B=>{var ne;(ne=q.onChange)==null||ne.call(q,B),U(B)}}),ownerState:te,additionalProps:{autoFocus:l,checked:h,defaultChecked:d,disabled:P,id:z?x:void 0,name:E,readOnly:k,required:v,tabIndex:_,type:C,...C==="checkbox"&&F===void 0?{}:{value:F}}});return i.jsxs(Y,{...$,children:[i.jsx(we,{...xe}),L?f:w]})}),Fr=Ie(i.jsx("path",{d:"M19 5v14H5V5h14m0-2H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2z"}),"CheckBoxOutlineBlank"),_r=Ie(i.jsx("path",{d:"M19 3H5c-1.11 0-2 .9-2 2v14c0 1.1.89 2 2 2h14c1.11 0 2-.9 2-2V5c0-1.1-.89-2-2-2zm-9 14l-5-5 1.41-1.41L10 14.17l7.59-7.59L19 8l-9 9z"}),"CheckBox"),Mr=Ie(i.jsx("path",{d:"M19 3H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zm-2 10H7v-2h10v2z"}),"IndeterminateCheckBox");function Lr(r){return Fe("MuiCheckbox",r)}const jt=_e("MuiCheckbox",["root","checked","disabled","indeterminate","colorPrimary","colorSecondary","sizeSmall","sizeMedium"]),Nr=r=>{const{classes:n,indeterminate:c,color:l,size:h}=r,f={root:["root",c&&"indeterminate",`color${De(l)}`,`size${De(h)}`]},d=Me(f,Lr,n);return{...n,...d}},Pr=de(Br,{shouldForwardProp:r=>tn(r)||r==="classes",name:"MuiCheckbox",slot:"Root",overridesResolver:(r,n)=>{const{ownerState:c}=r;return[n.root,c.indeterminate&&n.indeterminate,n[`size${De(c.size)}`],c.color!=="default"&&n[`color${De(c.color)}`]]}})(Ce(({theme:r})=>({color:(r.vars||r).palette.text.secondary,variants:[{props:{color:"default",disableRipple:!1},style:{"&:hover":{backgroundColor:r.vars?`rgba(${r.vars.palette.action.activeChannel} / ${r.vars.palette.action.hoverOpacity})`:zt(r.palette.action.active,r.palette.action.hoverOpacity)}}},...Object.entries(r.palette).filter($t()).map(([n])=>({props:{color:n,disableRipple:!1},style:{"&:hover":{backgroundColor:r.vars?`rgba(${r.vars.palette[n].mainChannel} / ${r.vars.palette.action.hoverOpacity})`:zt(r.palette[n].main,r.palette.action.hoverOpacity)}}})),...Object.entries(r.palette).filter($t()).map(([n])=>({props:{color:n},style:{[`&.${jt.checked}, &.${jt.indeterminate}`]:{color:(r.vars||r).palette[n].main},[`&.${jt.disabled}`]:{color:(r.vars||r).palette.action.disabled}}})),{props:{disableRipple:!1},style:{"&:hover":{"@media (hover: none)":{backgroundColor:"transparent"}}}}]}))),Vr=i.jsx(_r,{}),Ur=i.jsx(Fr,{}),Or=i.jsx(Mr,{}),dn=A.forwardRef(function(n,c){const l=Ue({props:n,name:"MuiCheckbox"}),{checkedIcon:h=Vr,color:f="primary",icon:d=Ur,indeterminate:a=!1,indeterminateIcon:y=Or,inputProps:b,size:w="medium",disableRipple:x=!1,className:j,slots:m={},slotProps:E={},...I}=l,D=a?y:d,R=a?y:h,k={...l,disableRipple:x,color:f,indeterminate:a,size:w},v=Nr(k),_=E.input??b,[C,F]=je("root",{ref:c,elementType:Pr,className:Re(v.root,j),shouldForwardComponentProp:!0,externalForwardedProps:{slots:m,slotProps:E,...I},ownerState:k,additionalProps:{type:"checkbox",icon:A.cloneElement(D,{fontSize:D.props.fontSize??w}),checkedIcon:A.cloneElement(R,{fontSize:R.props.fontSize??w}),disableRipple:x,slots:m,slotProps:{input:Nn(typeof _=="function"?_(k):_,{"data-indeterminate":a})}}});return i.jsx(C,{...F,classes:v})});function zr(r){return Fe("MuiDialogActions",r)}_e("MuiDialogActions",["root","spacing"]);const $r=r=>{const{classes:n,disableSpacing:c}=r;return Me({root:["root",!c&&"spacing"]},zr,n)},Wr=de("div",{name:"MuiDialogActions",slot:"Root",overridesResolver:(r,n)=>{const{ownerState:c}=r;return[n.root,!c.disableSpacing&&n.spacing]}})({display:"flex",alignItems:"center",padding:8,justifyContent:"flex-end",flex:"0 0 auto",variants:[{props:({ownerState:r})=>!r.disableSpacing,style:{"& > :not(style) ~ :not(style)":{marginLeft:8}}}]}),Hr=A.forwardRef(function(n,c){const l=Ue({props:n,name:"MuiDialogActions"}),{className:h,disableSpacing:f=!1,...d}=l,a={...l,disableSpacing:f},y=$r(a);return i.jsx(Wr,{className:Re(y.root,h),ownerState:a,ref:c,...d})});function Gr(r){return Fe("MuiInputAdornment",r)}const Kt=_e("MuiInputAdornment",["root","filled","standard","outlined","positionStart","positionEnd","disablePointerEvents","hiddenLabel","sizeSmall"]);var qt;const Yr=(r,n)=>{const{ownerState:c}=r;return[n.root,n[`position${De(c.position)}`],c.disablePointerEvents===!0&&n.disablePointerEvents,n[c.variant]]},Kr=r=>{const{classes:n,disablePointerEvents:c,hiddenLabel:l,position:h,size:f,variant:d}=r,a={root:["root",c&&"disablePointerEvents",h&&`position${De(h)}`,d,l&&"hiddenLabel",f&&`size${De(f)}`]};return Me(a,Gr,n)}
1,qr=de("div",{name:"MuiInputAdornment",slot:"Root",overridesResolver:Yr})(Ce(({theme:r})=>({display:"flex",maxHeight:"2em",alignItems:"center",whiteSpace:"nowrap",color:(r.vars||r).palette.action.active,variants:[{props:{variant:"filled"},style:{[`&.${Kt.positionStart}&:not(.${Kt.hiddenLabel})`]:{marginTop:16}}},{props:{position:"start"},style:{marginRight:8}},{props:{position:"end"},style:{marginLeft:8}},{props:{disablePointerEvents:!0},style:{pointerEvents:"none"}}]}))),kt=A.forwardRef(function(n,c){const l=Ue({props:n,name:"MuiInputAdornment"}),{children:h,className:f,component:d="div",disablePointerEvents:a=!1,disableTypography:y=!1,position:b,variant:w,...x}=l,j=sn()||{};let m=w;w&&j.variant,j&&!m&&(m=j.variant);const E={...l,hiddenLabel:j.hiddenLabel,size:j.size,disablePointerEvents:a,position:b,variant:m},I=Kr(E);return i.jsx(nr.Provider,{value:null,children:i.jsx(qr,{as:d,ownerState:E,className:Re(I.root,f),ref:c,...x,children:typeof h=="string"&&!y?i.jsx(S,{color:"textSecondary",children:h}):i.jsxs(A.Fragment,{children:[b==="start"?qt||(qt=i.jsx("span",{className:"notranslate","aria-hidden":!0,children:"â"})):null,h]})})})});var St={},Xe={},Jt;function Jr(){if(Jt)return Xe;Jt=1,Xe.byteLength=a,Xe.toByteArray=b,Xe.fromByteArray=j;for(var r=[],n=[],c=typeof Uint8Array<"u"?Uint8Array:Array,l="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",h=0,f=l.length;h<f;++h)r[h]=l[h],n[l.charCodeAt(h)]=h;n[45]=62,n[95]=63;function d(m){var E=m.length;if(E%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var I=m.indexOf("=");I===-1&&(I=E);var D=I===E?0:4-I%4;return[I,D]}function a(m){var E=d(m),I=E[0],D=E[1];return(I+D)*3/4-D}function y(m,E,I){return(E+I)*3/4-I}function b(m){var E,I=d(m),D=I[0],R=I[1],k=new c(y(m,D,R)),v=0,_=R>0?D-4:D,C;for(C=0;C<_;C+=4)E=n[m.charCodeAt(C)]<<18|n[m.charCodeAt(C+1)]<<12|n[m.charCodeAt(C+2)]<<6|n[m.charCodeAt(C+3)],k[v++]=E>>16&255,k[v++]=E>>8&255,k[v++]=E&255;return R===2&&(E=n[m.charCodeAt(C)]<<2|n[m.charCodeAt(C+1)]>>4,k[v++]=E&255),R===1&&(E=n[m.charCodeAt(C)]<<10|n[m.charCodeAt(C+1)]<<4|n[m.charCodeAt(C+2)]>>2,k[v++]=E>>8&255,k[v++]=E&255),k}function w(m){return r[m>>18&63]+r[m>>12&63]+r[m>>6&63]+r[m&63]}function x(m,E,I){for(var D,R=[],k=E;k<I;k+=3)D=(m[k]<<16&16711680)+(m[k+1]<<8&65280)+(m[k+2]&255),R.push(w(D));return R.join("")}function j(m){for(var E,I=m.length,D=I%3,R=[],k=16383,v=0,_=I-D;v<_;v+=k)R.push(x(m,v,v+k>_?_:v+k));return D===1?(E=m[I-1],R.push(r[E>>2]+r[E<<4&63]+"==")):D===2&&(E=(m[I-2]<<8)+m[I-1],R.push(r[E>>10]+r[E>>4&63]+r[E<<2&63]+"=")),R.join("")}return Xe}var ct={};/*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh <https://feross.org/opensource> */var Xt;function Xr(){return Xt||(Xt=1,ct.read=function(r,n,c,l,h){var f,d,a=h*8-l-1,y=(1<<a)-1,b=y>>1,w=-7,x=c?h-1:0,j=c?-1:1,m=r[n+x];for(x+=j,f=m&(1<<-w)-1,m>>=-w,w+=a;w>0;f=f*256+r[n+x],x+=j,w-=8);for(d=f&(1<<-w)-1,f>>=-w,w+=l;w>0;d=d*256+r[n+x],x+=j,w-=8);if(f===0)f=1-b;else{if(f===y)return d?NaN:(m?-1:1)*(1/0);d=d+Math.pow(2,l),f=f-b}return(m?-1:1)*d*Math.pow(2,f-l)},ct.write=function(r,n,c,l,h,f){var d,a,y,b=f*8-h-1,w=(1<<b)-1,x=w>>1,j=h===23?Math.pow(2,-24)-Math.pow(2,-77):0,m=l?0:f-1,E=l?1:-1,I=n<0||n===0&&1/n<0?1:0;for(n=Math.abs(n),isNaN(n)||n===1/0?(a=isNaN(n)?1:0,d=w):(d=Math.floor(Math.log(n)/Math.LN2),n*(y=Math.pow(2,-d))<1&&(d--,y*=2),d+x>=1?n+=j/y:n+=j*Math.pow(2,1-x),n*y>=2&&(d++,y/=2),d+x>=w?(a=0,d=w):d+x>=1?(a=(n*y-1)*Math.pow(2,h),d=d+x):(a=n*Math.pow(2,x-1)*Math.pow(2,h),d=0));h>=8;r[c+m]=a&255,m+=E,a/=256,h-=8);for(d=d<<h|a,b+=h;b>0;r[c+m]=d&255,m+=E,d/=256,b-=8);r[c+m-E]|=I*128}),ct}/*! 2 * The buffer module from node.js, for the browser. 3 * 4 * @author Feross Aboukhadijeh <https://feross.org> 5 * @license MIT 6 */var Zt;function Zr(){return Zt||(Zt=1,(function(r){const n=Jr(),c=Xr(),l=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):null;r.Buffer=a,r.SlowBuffer=k,r.INSPECT_MAX_BYTES=50;const h=2147483647;r.kMaxLength=h,a.TYPED_ARRAY_SUPPORT=f(),!a.TYPED_ARRAY_SUPPORT&&typeof console<"u"&&typeof console.error=="function"&&console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support.");function f(){try{const o=new Uint8Array(1),e={foo:function(){return 42}};return Object.setPrototypeOf(e,Uint8Array.prototype),Object.setPrototypeOf(o,e),o.foo()===42}catch{return!1}}Object.defineProperty(a.prototype,"parent",{enumerable:!0,get:function(){if(a.isBuffer(this))return this.buffer}}),Object.defineProperty(a.prototype,"offset",{enumerable:!0,get:function(){if(a.isBuffer(this))return this.byteOffset}});function d(o){if(o>
6h)throw new RangeError('The value "'+o+'" is invalid for option "size"');const e=new Uint8Array(o);return Object.setPrototypeOf(e,a.prototype),e}function a(o,e,t){if(typeof o=="number"){if(typeof e=="string")throw new TypeError('The "string" argument must be of type string. Received type number');return x(o)}return y(o,e,t)}a.poolSize=8192;function y(o,e,t){if(typeof o=="string")return j(o,e);if(ArrayBuffer.isView(o))return E(o);if(o==null)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof o);if(ge(o,ArrayBuffer)||o&&ge(o.buffer,ArrayBuffer)||typeof SharedArrayBuffer<"u"&&(ge(o,SharedArrayBuffer)||o&&ge(o.buffer,SharedArrayBuffer)))return I(o,e,t);if(typeof o=="number")throw new TypeError('The "value" argument must not be of type number. Received type number');const s=o.valueOf&&o.valueOf();if(s!=null&&s!==o)return a.from(s,e,t);const u=D(o);if(u)return u;if(typeof Symbol<"u"&&Symbol.toPrimitive!=null&&typeof o[Symbol.toPrimitive]=="function")return a.from(o[Symbol.toPrimitive]("string"),e,t);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof o)}a.from=function(o,e,t){return y(o,e,t)},Object.setPrototypeOf(a.prototype,Uint8Array.prototype),Object.setPrototypeOf(a,Uint8Array);function b(o){if(typeof o!="number")throw new TypeError('"size" argument must be of type number');if(o<0)throw new RangeError('The value "'+o+'" is invalid for option "size"')}function w(o,e,t){return b(o),o<=0?d(o):e!==void 0?typeof t=="string"?d(o).fill(e,t):d(o).fill(e):d(o)}a.alloc=function(o,e,t){return w(o,e,t)};function x(o){return b(o),d(o<0?0:R(o)|0)}a.allocUnsafe=function(o){return x(o)},a.allocUnsafeSlow=function(o){return x(o)};function j(o,e){if((typeof e!="string"||e==="")&&(e="utf8"),!a.isEncoding(e))throw new TypeError("Unknown encoding: "+e);const t=v(o,e)|0;let s=d(t);const u=s.write(o,e);return u!==t&&(s=s.slice(0,u)),s}function m(o){const e=o.length<0?0:R(o.length)|0,t=d(e);for(let s=0;s<e;s+=1)t[s]=o[s]&255;return t}function E(o){if(ge(o,Uint8Array)){const e=new Uint8Array(o);return I(e.buffer,e.byteOffset,e.byteLength)}return m(o)}function I(o,e,t){if(e<0||o.byteLength<e)throw new RangeError('"offset" is outside of buffer bounds');if(o.byteLength<e+(t||0))throw new RangeError('"length" is outside of buffer bounds');let s;return e===void 0&&t===void 0?s=new Uint8Array(o):t===void 0?s=new Uint8Array(o,e):s=new Uint8Array(o,e,t),Object.setPrototypeOf(s,a.prototype),s}function D(o){if(a.isBuffer(o)){const e=R(o.length)|0,t=d(e);return t.length===0||o.copy(t,0,0,e),t}if(o.length!==void 0)return typeof o.length!="number"||wt(o.length)?d(0):m(o);if(o.type==="Buffer"&&Array.isArray(o.data))return m(o.data)}function R(o){if(o>=h)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+h.toString(16)+" bytes");return o|0}function k(o){return+o!=o&&(o=0),a.alloc(+o)}a.isBuffer=function(e){return e!=null&&e._isBuffer===!0&&e!==a.prototype},a.compare=function(e,t){if(ge(e,Uint8Array)&&(e=a.from(e,e.offset,e.byteLength)),ge(t,Uint8Array)&&(t=a.from(t,t.offset,t.byteLength)),!a.isBuffer(e)||!a.isBuffer(t))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(e===t)return 0;let s=e.length,u=t.length;for(let p=0,g=Math.min(s,u);p<g;++p)if(e[p]!==t[p]){s=e[p],u=t[p];break}return s<u?-1:u<s?1:0},a.isEncoding=function(e){switch(String(e).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},a.concat=function(e,t){if(!Array.isArray(e))throw new TypeError('"list" argument must be an Array of Buffers');if(e.length===0)return a.alloc(0);let s;if(t===void 0)for(t=0,s=0;s<e.length;++s)t+=e[s].length;const u=a.allocUnsafe(t);let p=0;for(s=0;s<e.length;++s){let g=e[s];if(ge(g,Uint8Array))p+g.length>u.length?(a.isBuffer(g)||(g=a.from(g)),g.copy(u,p)):Uint8Array.prototype.set.call(u,g,p);else if(a.isBuffer(g))g.copy(u,p);else throw new TypeError('"list" argument must be an Array of Buffers');p+=g.length}return u};function v(o,e){if(a.isBuffer(o))return o.length;if(ArrayBuffer.isView(o)||ge(o,ArrayBuffer))return o.byteLength;if(typeof o!="string")throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof o);const t=o.length,s=arguments.length>2&&arguments[2]===!0;if(!s&&t===0)return 0;let u=!1;for(;;)switch(e){case"ascii":case"latin1":case"binary":return t;case"utf8":case"utf-8":return yt(o).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return t*2;case"hex":return t>>>1;case"base64":return Ut(o).length;default:if(u)return s?-1:yt(o).length;e=(""+e).toLowerCase(),u=!0}}a.byteLength=v;function _(o,e,t){let s=!1;if((e===void 0||e<0)&&(e=0),e>this.length||((t===void 0||t>this.length)&&(t=this.length),t<=0)||(t>>>=0,e>>>=0,t<=e))return"";for(o||(o="utf8");;)switch(o){case"hex":return he(this,e,t);case"utf8":case"utf-8":return N(this,e,t);case"ascii":return z(this,e,t);case"latin1":case"binary":return te(this,e,t);case"base64":return Z(this,e,t);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return K(this,e,t);default:if(s)throw new TypeError("Unknown encoding: "+o);o=(o+"").toLowerCase(),s=!0}}a.prototype._isBuffer=!0;function C(o,e,t){const s=o[e];o[e]=o[t],o[t]=s}a.prototype.swap16=function(){const e=this.length;if(e%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let t=0;t<e;t+=2)C(this,t,t+1);return this},a.prototype.swap32=function(){const e=this.length;if(e%4!==0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(let t=0;t<e;t+=4)C(this,t,t+3),C(this,t+1,t+2);return this},a.prototype.swap64=function(){const e=this.length;if(e%8!==0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(let t=0;t<e;t+=8)C(this,t,t+7),C(this,t+1,t+6),C(this,t+2,t+5),C(this,t+3,t+4);return this},a.prototype.toString=function(){const e=this.length;return e===0?"":arguments.length===0?N(this,0,e):_.apply(this,arguments)}
6,a.prototype.toLocaleString=a.prototype.toString,a.prototype.equals=function(e){if(!a.isBuffer(e))throw new TypeError("Argument must be a Buffer");return this===e?!0:a.compare(this,e)===0},a.prototype.inspect=function(){let e="";const t=r.INSPECT_MAX_BYTES;return e=this.toString("hex",0,t).replace(/(.{2})/g,"$1 ").trim(),this.length>t&&(e+=" ... "),"<Buffer "+e+">"},l&&(a.prototype[l]=a.prototype.inspect),a.prototype.compare=function(e,t,s,u,p){if(ge(e,Uint8Array)&&(e=a.from(e,e.offset,e.byteLength)),!a.isBuffer(e))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof e);if(t===void 0&&(t=0),s===void 0&&(s=e?e.length:0),u===void 0&&(u=0),p===void 0&&(p=this.length),t<0||s>e.length||u<0||p>this.length)throw new RangeError("out of range index");if(u>=p&&t>=s)return 0;if(u>=p)return-1;if(t>=s)return 1;if(t>>>=0,s>>>=0,u>>>=0,p>>>=0,this===e)return 0;let g=p-u,V=s-t;const se=Math.min(g,V),oe=this.slice(u,p),ae=e.slice(t,s);for(let Q=0;Q<se;++Q)if(oe[Q]!==ae[Q]){g=oe[Q],V=ae[Q];break}return g<V?-1:V<g?1:0};function F(o,e,t,s,u){if(o.length===0)return-1;if(typeof t=="string"?(s=t,t=0):t>2147483647?t=2147483647:t<-2147483648&&(t=-2147483648),t=+t,wt(t)&&(t=u?0:o.length-1),t<0&&(t=o.length+t),t>=o.length){if(u)return-1;t=o.length-1}else if(t<0)if(u)t=0;else return-1;if(typeof e=="string"&&(e=a.from(e,s)),a.isBuffer(e))return e.length===0?-1:M(o,e,t,s,u);if(typeof e=="number")return e=e&255,typeof Uint8Array.prototype.indexOf=="function"?u?Uint8Array.prototype.indexOf.call(o,e,t):Uint8Array.prototype.lastIndexOf.call(o,e,t):M(o,[e],t,s,u);throw new TypeError("val must be string, number or Buffer")}function M(o,e,t,s,u){let p=1,g=o.length,V=e.length;if(s!==void 0&&(s=String(s).toLowerCase(),s==="ucs2"||s==="ucs-2"||s==="utf16le"||s==="utf-16le")){if(o.length<2||e.length<2)return-1;p=2,g/=2,V/=2,t/=2}function se(ae,Q){return p===1?ae[Q]:ae.readUInt16BE(Q*p)}let oe;if(u){let ae=-1;for(oe=t;oe<g;oe++)if(se(o,oe)===se(e,ae===-1?0:oe-ae)){if(ae===-1&&(ae=oe),oe-ae+1===V)return ae*p}else ae!==-1&&(oe-=oe-ae),ae=-1}else for(t+V>g&&(t=g-V),oe=t;oe>=0;oe--){let ae=!0;for(let Q=0;Q<V;Q++)if(se(o,oe+Q)!==se(e,Q)){ae=!1;break}if(ae)return oe}return-1}a.prototype.includes=function(e,t,s){return this.indexOf(e,t,s)!==-1},a.prototype.indexOf=function(e,t,s){return F(this,e,t,s,!0)},a.prototype.lastIndexOf=function(e,t,s){return F(this,e,t,s,!1)};function ee(o,e,t,s){t=Number(t)||0;const u=o.length-t;s?(s=Number(s),s>u&&(s=u)):s=u;const p=e.length;s>p/2&&(s=p/2);let g;for(g=0;g<s;++g){const V=parseInt(e.substr(g*2,2),16);if(wt(V))return g;o[t+g]=V}return g}function ie(o,e,t,s){return st(yt(e,o.length-t),o,t,s)}function L(o,e,t,s){return st(vn(e),o,t,s)}function J(o,e,t,s){return st(Ut(e),o,t,s)}function W(o,e,t,s){return st(kn(e,o.length-t),o,t,s)}a.prototype.write=function(e,t,s,u){if(t===void 0)u="utf8",s=this.length,t=0;else if(s===void 0&&typeof t=="string")u=t,s=this.length,t=0;else if(isFinite(t))t=t>>>0,isFinite(s)?(s=s>>>0,u===void 0&&(u="utf8")):(u=s,s=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");const p=this.length-t;if((s===void 0||s>p)&&(s=p),e.length>0&&(s<0||t<0)||t>this.length)throw new RangeError("Attempt to write outside buffer bounds");u||(u="utf8");let g=!1;for(;;)switch(u){case"hex":return ee(this,e,t,s);case"utf8":case"utf-8":return ie(this,e,t,s);case"ascii":case"latin1":case"binary":return L(this,e,t,s);case"base64":return J(this,e,t,s);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return W(this,e,t,s);default:if(g)throw new TypeError("Unknown encoding: "+u);u=(""+u).toLowerCase(),g=!0}},a.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function Z(o,e,t){return e===0&&t===o.length?n.fromByteArray(o):n.fromByteArray(o.slice(e,t))}function N(o,e,t){t=Math.min(o.length,t);const s=[];let u=e;for(;u<t;){const p=o[u];let g=null,V=p>239?4:p>223?3:p>191?2:1;if(u+V<=t){let se,oe,ae,Q;switch(V){case 1:p<128&&(g=p);break;case 2:se=o[u+1],(se&192)===128&&(Q=(p&31)<<6|se&63,Q>127&&(g=Q));break;case 3:se=o[u+1],oe=o[u+2],(se&192)===128&&(oe&192)===128&&(Q=(p&15)<<12|(se&63)<<6|oe&63,Q>2047&&(Q<55296||Q>57343)&&(g=Q));break;case 4:se=o[u+1],oe=o[u+2],ae=o[u+3],(se&192)===128&&(oe&192)===128&&(ae&192)===128&&(Q=(p&15)<<18|(se&63)<<12|(oe&63)<<6|ae&63,Q>65535&&Q<1114112&&(g=Q))}}g===null?(g=65533,V=1):g>65535&&(g-=65536,s.push(g>>>10&1023|55296),g=56320|g&1023),s.push(g),u+=V}return P(s)}const U=4096;function P(o){const e=o.length;if(e<=U)return String.fromCharCode.apply(String,o);let t="",s=0;for(;s<e;)t+=String.fromCharCode.apply(String,o.slice(s,s+=U));return t}function z(o,e,t){let s="";t=Math.min(o.length,t);for(let u=e;u<t;++u)s+=String.fromCharCode(o[u]&127);return s}function te(o,e,t){let s="";t=Math.min(o.length,t);for(let u=e;u<t;++u)s+=String.fromCharCode(o[u]);return s}function he(o,e,t){const s=o.length;(!e||e<0)&&(e=0),(!t||t<0||t>s)&&(t=s);let u="";for(let p=e;p<t;++p)u+=Rn[o[p]];return u}function K(o,e,t){const s=o.slice(e,t);let u="";for(let p=0;p<s.length-1;p+=2)u+=String.fromCharCode(s[p]+s[p+1]*256);return u}a.prototype.slice=function(e,t){const s=this.length;e=~~e,t=t===void 0?s:~~t,e<0?(e+=s,e<0&&(e=0)):e>s&&(e=s),t<0?(t+=s,t<0&&(t=0)):t>s&&(t=s),t<e&&(t=e);const u=this.subarray(e,t);return Object.setPrototypeOf(u,a.prototype),u};function Y(o,e,t){if(o%1!==0||o<0)throw new RangeError("offset is not uint");if(o+e>t)throw new RangeError("Trying to access beyond buffer length")}a.prototype.readUintLE=a.prototype.readUIntLE=function(e,t,s){e=e>>>0,t=t>>>0,s||Y(e,t,this.length);let u=this[e],p=1,g=0;for(;++g<t&&(p*=256);)u+=this[e+g]*p;return u},a.prototype.readUintBE=a.prototype.readUIntBE=function(e,t,s){e=e>>>0,t=t>>>0,s||Y(e,t,this.length);let u=this[e+--t],p=1;for(;t>0&&(p*=256);)u+=this[e+--t]*p;return u},a.prototype.readUint8=a.prototype.readUInt8=function(e,t){return e=e>>>0,t||Y(e,1,this.length),this[e]},a.prototype.readUint16LE=a.prototype.readUInt16LE=function(e,t){return e=e>>>0,t||Y(e,2,this.length),this[e]|this[e+1]<<8},a.prototype.readUint16BE=a.prototype.readUInt16BE=function(e,t){return e=e>>>0,t||Y(e,2,this.length),this[e]<<8|this[e+1]},a.prototype.readUint32LE=a.prototype.readUInt32LE=function(e,t){return e=e>>>0,t||Y(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+this[e+3]*16777216},a.prototype.readUint32BE=a.prototype.readUInt32BE=function(e,t){return e=e>>>0,t||Y(e,4,this.length),this[e]*16777216+(this[e+1]<<16|this[e+2]<<8|this[e+3])},a.prototype.readBigUInt64LE=ve(function(e){e=e>>>0,$e(e,"offset");const t=this[e],s=this[e+7];(t===void 0||s===void 0)&&Je(e,this.length-8);const u=t+this[++e]*2**8+this[++e]*2**16+this[++e]*2**24,p=this[++e]+this[++e]*2**8+this[++e]*2**16+s*2**24;return BigInt(u)+(BigInt(p)<<BigInt(32))}),a.prototype.readBigUInt64BE=ve(function(e){e=e>>>0,$e(e,"offset");const t=this[e],s=this[e+7];(t===void 0||s===void 0)&&Je(e,this.length-8);const u=t*2**24+this[++e]*2**16+this[++e]*2**8+this[++e],p=this[++e]*2**24+this[++e]*2**16+this[++e]*2**8+s;return(BigInt(u)<<BigInt(32))+BigInt(p)}),a.prototype.readIntLE=function(e,t,s){e=e>>>0,t=t>>>0,s||Y(e,t,this.length);let u=this[e],p=1,g=0;for(;++g<t&&(p*=256);)u+=this[e+g]*p;return p*=128,u>=p&&(u-=Math.pow(2,8*t)),u},a.prototype.readIntBE=function(e,t,s){e=e>>>0,t=t>>>0,s||Y(e,t,this.length);let u=t,p=1,g=this[e+--u];for(;u>0&&(p*=256);)g+=this[e+--u]*p;return p*=128,g>=p&&(g-=Math.pow(2,8*t)),g},a.prototype.readInt8=function(e,t){return e=e>>>0,t||Y(e,1,this.length),this[e]&128?(255-this[e]+1)*-1:this[e]},a.prototype.readInt16LE=function(e,t){e=e>>>0,t||Y(e,2,this.length);const s=this[e]|this[e+1]<<8;return s&32768?s|4294901760:s},a.prototype.readInt16BE=function(e,t){e=e>>>0,t||Y(e,2,this.length);const s=this[e+1]|this[e]<<8;return s&32768?s|4294901760:s},a.prototype.readInt32LE=function(e,t){return e=e>>>0,t||Y(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},a.prototype.readInt32BE=function(e,t){return e=e>>>0,t||Y(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},a.prototype.readBigInt64LE=ve(function(e){e=e>>>0,$e(e,"offset");const t=this[e],s=this[e+7];(t===void 0||s===void 0)&&Je(e,this.length-8);const u=this[e+4]+this[e+5]*2**8+this[e+6]*2**16+(s<<24);return(BigInt(u)<<BigInt(32))+BigInt(t+this[++e]*2**8+this[++e]*2**16+this[++e]*2**24)}),a.prototype.readBigInt64BE=ve(function(e){e=e>>>0,$e(e,"offset");const t=this[e],s=this[e+7];(t===void 0||s===void 0)&&Je(e,this.length-8);const u=(t<<24)+this[++e]*2**16+this[++e]*2**8+this[++e];return(BigInt(u)<<BigInt(32))+BigInt(this[++e]*2**24+this[++e]*2**16+this[++e]*2**8+s)}),a.prototype.readFloatLE=function(e,t){return e=e>>>0,t||Y(e,4,this.length),c.read(this,e,!0,23,4)},a.prototype.readFloatBE=function(e,t){return e=e>>>0,t||Y(e,4,this.length),c.read(this,e,!1,23,4)},a.prototype.readDoubleLE=function(e,t){return e=e>>>0,t||Y(e,8,this.length),c.read(this,e,!0,52,8)},a.prototype.readDoubleBE=function(e,t){return e=e>>>0,t||Y(e,8,this.length),c.read(this,e,!1,52,8)};function $(o,e,t,s,u,p){if(!a.isBuffer(o))throw new TypeError('"buffer" argument must be a Buffer instance');if(e>u||e<p)throw new RangeError('"value" argument is out of bounds');if(t+s>o.length)throw new RangeError("Index out of range")}a.prototype.writeUintLE=a.prototype.writeUIntLE=function(e,t,s,u){if(e=+e,t=t>>>0,s=s>>>0,!u){const V=Math.pow(2,8*s)-1;$(this,e,t,s,V,0)}let p=1,g=0;for(this[t]=e&255;++g<s&&(p*=256);
6)this[t+g]=e/p&255;return t+s},a.prototype.writeUintBE=a.prototype.writeUIntBE=function(e,t,s,u){if(e=+e,t=t>>>0,s=s>>>0,!u){const V=Math.pow(2,8*s)-1;$(this,e,t,s,V,0)}let p=s-1,g=1;for(this[t+p]=e&255;--p>=0&&(g*=256);)this[t+p]=e/g&255;return t+s},a.prototype.writeUint8=a.prototype.writeUInt8=function(e,t,s){return e=+e,t=t>>>0,s||$(this,e,t,1,255,0),this[t]=e&255,t+1},a.prototype.writeUint16LE=a.prototype.writeUInt16LE=function(e,t,s){return e=+e,t=t>>>0,s||$(this,e,t,2,65535,0),this[t]=e&255,this[t+1]=e>>>8,t+2},a.prototype.writeUint16BE=a.prototype.writeUInt16BE=function(e,t,s){return e=+e,t=t>>>0,s||$(this,e,t,2,65535,0),this[t]=e>>>8,this[t+1]=e&255,t+2},a.prototype.writeUint32LE=a.prototype.writeUInt32LE=function(e,t,s){return e=+e,t=t>>>0,s||$(this,e,t,4,4294967295,0),this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=e&255,t+4},a.prototype.writeUint32BE=a.prototype.writeUInt32BE=function(e,t,s){return e=+e,t=t>>>0,s||$(this,e,t,4,4294967295,0),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=e&255,t+4};function we(o,e,t,s,u){Vt(e,s,u,o,t,7);let p=Number(e&BigInt(4294967295));o[t++]=p,p=p>>8,o[t++]=p,p=p>>8,o[t++]=p,p=p>>8,o[t++]=p;let g=Number(e>>BigInt(32)&BigInt(4294967295));return o[t++]=g,g=g>>8,o[t++]=g,g=g>>8,o[t++]=g,g=g>>8,o[t++]=g,t}function xe(o,e,t,s,u){Vt(e,s,u,o,t,7);let p=Number(e&BigInt(4294967295));o[t+7]=p,p=p>>8,o[t+6]=p,p=p>>8,o[t+5]=p,p=p>>8,o[t+4]=p;let g=Number(e>>BigInt(32)&BigInt(4294967295));return o[t+3]=g,g=g>>8,o[t+2]=g,g=g>>8,o[t+1]=g,g=g>>8,o[t]=g,t+8}a.prototype.writeBigUInt64LE=ve(function(e,t=0){return we(this,e,t,BigInt(0),BigInt("0xffffffffffffffff"))}),a.prototype.writeBigUInt64BE=ve(function(e,t=0){return xe(this,e,t,BigInt(0),BigInt("0xffffffffffffffff"))}),a.prototype.writeIntLE=function(e,t,s,u){if(e=+e,t=t>>>0,!u){const se=Math.pow(2,8*s-1);$(this,e,t,s,se-1,-se)}let p=0,g=1,V=0;for(this[t]=e&255;++p<s&&(g*=256);)e<0&&V===0&&this[t+p-1]!==0&&(V=1),this[t+p]=(e/g>>0)-V&255;return t+s},a.prototype.writeIntBE=function(e,t,s,u){if(e=+e,t=t>>>0,!u){const se=Math.pow(2,8*s-1);$(this,e,t,s,se-1,-se)}let p=s-1,g=1,V=0;for(this[t+p]=e&255;--p>=0&&(g*=256);)e<0&&V===0&&this[t+p+1]!==0&&(V=1),this[t+p]=(e/g>>0)-V&255;return t+s},a.prototype.writeInt8=function(e,t,s){return e=+e,t=t>>>0,s||$(this,e,t,1,127,-128),e<0&&(e=255+e+1),this[t]=e&255,t+1},a.prototype.writeInt16LE=function(e,t,s){return e=+e,t=t>>>0,s||$(this,e,t,2,32767,-32768),this[t]=e&255,this[t+1]=e>>>8,t+2},a.prototype.writeInt16BE=function(e,t,s){return e=+e,t=t>>>0,s||$(this,e,t,2,32767,-32768),this[t]=e>>>8,this[t+1]=e&255,t+2},a.prototype.writeInt32LE=function(e,t,s){return e=+e,t=t>>>0,s||$(this,e,t,4,2147483647,-2147483648),this[t]=e&255,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24,t+4},a.prototype.writeInt32BE=function(e,t,s){return e=+e,t=t>>>0,s||$(this,e,t,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=e&255,t+4},a.prototype.writeBigInt64LE=ve(function(e,t=0){return we(this,e,t,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))}),a.prototype.writeBigInt64BE=ve(function(e,t=0){return xe(this,e,t,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))});function q(o,e,t,s,u,p){if(t+s>o.length)throw new RangeError("Index out of range");if(t<0)throw new RangeError("Index out of range")}function B(o,e,t,s,u){return e=+e,t=t>>>0,u||q(o,e,t,4),c.write(o,e,t,s,23,4),t+4}a.prototype.writeFloatLE=function(e,t,s){return B(this,e,t,!0,s)},a.prototype.writeFloatBE=function(e,t,s){return B(this,e,t,!1,s)};function ne(o,e,t,s,u){return e=+e,t=t>>>0,u||q(o,e,t,8),c.write(o,e,t,s,52,8),t+8}a.prototype.writeDoubleLE=function(e,t,s){return ne(this,e,t,!0,s)},a.prototype.writeDoubleBE=function(e,t,s){return ne(this,e,t,!1,s)},a.prototype.copy=function(e,t,s,u){if(!a.isBuffer(e))throw new TypeError("argument should be a Buffer");if(s||(s=0),!u&&u!==0&&(u=this.length),t>=e.length&&(t=e.length),t||(t=0),u>0&&u<s&&(u=s),u===s||e.length===0||this.length===0)return 0;if(t<0)throw new RangeError("targetStart out of bounds");if(s<0||s>=this.length)throw new RangeError("Index out of range");if(u<0)throw new RangeError("sourceEnd out of bounds");u>this.length&&(u=this.length),e.length-t<u-s&&(u=e.length-t+s);const p=u-s;return this===e&&typeof Uint8Array.prototype.copyWithin=="function"?this.copyWithin(t,s,u):Uint8Array.prototype.set.call(e,this.subarray(s,u),t),p},a.prototype.fill=function(e,t,s,u){if(typeof e=="string"){if(typeof t=="string"?(u=t,t=0,s=this.length):typeof s=="string"&&(u=s,s=this.length),u!==void 0&&typeof u!="string")throw new TypeError("encoding must be a string");if(typeof u=="string"&&!a.isEncoding(u))throw new TypeError("Unknown encoding: "+u);if(e.length===1){const g=e.charCodeAt(0);(u==="utf8"&&g<128||u==="latin1")&&(e=g)}}else typeof e=="number"?e=e&255:typeof e=="boolean"&&(e=Number(e));if(t<0||this.length<t||this.length<s)throw new RangeError("Out of range index");if(s<=t)return this;t=t>>>0,s=s===void 0?this.length:s>>>0,e||(e=0);let p;if(typeof e=="number")for(p=t;p<s;++p)this[p]=e;else{const g=a.isBuffer(e)?e:a.from(e,u),V=g.length;
6if(V===0)throw new TypeError('The value "'+e+'" is invalid for argument "value"');for(p=0;p<s-t;++p)this[p+t]=g[p%V]}return this};const le={};function be(o,e,t){le[o]=class extends t{constructor(){super(),Object.defineProperty(this,"message",{value:e.apply(this,arguments),writable:!0,configurable:!0}),this.name=`${this.name} [${o}]`,this.stack,delete this.name}get code(){return o}set code(u){Object.defineProperty(this,"code",{configurable:!0,enumerable:!0,value:u,writable:!0})}toString(){return`${this.name} [${o}]: ${this.message}`}}}be("ERR_BUFFER_OUT_OF_BOUNDS",function(o){return o?`${o} is outside of buffer bounds`:"Attempt to access memory outside buffer bounds"},RangeError),be("ERR_INVALID_ARG_TYPE",function(o,e){return`The "${o}" argument must be of type number. Received type ${typeof e}`},TypeError),be("ERR_OUT_OF_RANGE",function(o,e,t){let s=`The value of "${o}" is out of range.`,u=t;return Number.isInteger(t)&&Math.abs(t)>2**32?u=Ne(String(t)):typeof t=="bigint"&&(u=String(t),(t>BigInt(2)**BigInt(32)||t<-(BigInt(2)**BigInt(32)))&&(u=Ne(u)),u+="n"),s+=` It must be ${e}. Received ${u}`,s},RangeError);function Ne(o){let e="",t=o.length;const s=o[0]==="-"?1:0;for(;t>=s+4;t-=3)e=`_${o.slice(t-3,t)}${e}`;return`${o.slice(0,t)}${e}`}function ot(o,e,t){$e(e,"offset"),(o[e]===void 0||o[e+t]===void 0)&&Je(e,o.length-(t+1))}function Vt(o,e,t,s,u,p){if(o>t||o<e){const g=typeof e=="bigint"?"n":"";let V;throw e===0||e===BigInt(0)?V=`>= 0${g} and < 2${g} ** ${(p+1)*8}${g}`:V=`>= -(2${g} ** ${(p+1)*8-1}${g}) and < 2 ** ${(p+1)*8-1}${g}`,new le.ERR_OUT_OF_RANGE("value",V,o)}ot(s,u,p)}function $e(o,e){if(typeof o!="number")throw new le.ERR_INVALID_ARG_TYPE(e,"number",o)}function Je(o,e,t){throw Math.floor(o)!==o?($e(o,t),new le.ERR_OUT_OF_RANGE("offset","an integer",o)):e<0?new le.ERR_BUFFER_OUT_OF_BOUNDS:new le.ERR_OUT_OF_RANGE("offset",`>= 0 and <= ${e}`,o)}const Cn=/[^+/0-9A-Za-z-_]/g;function In(o){if(o=o.split("=")[0],o=o.trim().replace(Cn,""),o.length<2)return"";for(;o.length%4!==0;)o=o+"=";return o}function yt(o,e){e=e||1/0;let t;const s=o.length;let u=null;const p=[];for(let g=0;g<s;++g){if(t=o.charCodeAt(g),t>55295&&t<57344){if(!u){if(t>56319){(e-=3)>-1&&p.push(239,191,189);continue}else if(g+1===s){(e-=3)>-1&&p.push(239,191,189);continue}u=t;continue}if(t<56320){(e-=3)>-1&&p.push(239,191,189),u=t;continue}t=(u-55296<<10|t-56320)+65536}else u&&(e-=3)>-1&&p.push(239,191,189);if(u=null,t<128){if((e-=1)<0)break;p.push(t)}else if(t<2048){if((e-=2)<0)break;p.push(t>>6|192,t&63|128)}else if(t<65536){if((e-=3)<0)break;p.push(t>>12|224,t>>6&63|128,t&63|128)}else if(t<1114112){if((e-=4)<0)break;p.push(t>>18|240,t>>12&63|128,t>>6&63|128,t&63|128)}else throw new Error("Invalid code point")}return p}function vn(o){const e=[];for(let t=0;t<o.length;++t)e.push(o.charCodeAt(t)&255);return e}function kn(o,e){let t,s,u;const p=[];for(let g=0;g<o.length&&!((e-=2)<0);++g)t=o.charCodeAt(g),s=t>>8,u=t%256,p.push(u),p.push(s);return p}function Ut(o){return n.toByteArray(In(o))}function st(o,e,t,s){let u;for(u=0;
6u<s&&!(u+t>=e.length||u>=o.length);++u)e[u+t]=o[u];return u}function ge(o,e){return o instanceof e||o!=null&&o.constructor!=null&&o.constructor.name!=null&&o.constructor.name===e.name}function wt(o){return o!==o}const Rn=(function(){const o="0123456789abcdef",e=new Array(256);for(let t=0;t<16;++t){const s=t*16;for(let u=0;u<16;++u)e[s+u]=o[t]+o[u]}return e})();function ve(o){return typeof BigInt>"u"?Dn:o}function Dn(){throw new Error("BigInt not supported")}})(St)),St}var Qr=Zr();globalThis.jotaiAtomCache=globalThis.jotaiAtomCache||{cache:new Map,get(r,n){return this.cache.has(r)?this.cache.get(r):(this.cache.set(r,n),n)}};function ei(){const[r,n]=A.useState(G.IDLE),[c,l]=A.useState(),{push:h,clear:f}=Ge(),{address:d}=Le(),{contractAddresses:a}=ue(),y=pt("locker.data.votingPowerHistory",{}),b=async x=>{r===G.IDLE||r===G.FAILED?n(G.FETCHING):n(G.UPDATING);try{const j=await Yn.get("/voting-power/0x00328b8a90652b37672f2f8c6c1d39ce718d7f89",{params:{n_days:x,refresh:!0}}).then(m=>m.data);h("locker.data.votingPowerHistory.votingLogs",{categories:Object.keys(j.voting_logs).map(m=>Number(m)*1e3),votingPower:Object.values(j.voting_logs).map(m=>m.voting_power),percentage:Object.values(j.voting_logs).map(m=>m.voting_power_percent)}),l(void 0),n(G.SUCCESS)}catch(j){l(j),n(G.FAILED)}},w=async()=>{try{if(!lt(d))throw new Error("Invalid address");let x;d&&a.VE_TRAVA_ADDRESS&&(x=await et(X,{address:a.VE_TRAVA_ADDRESS,abi:ce,functionName:"votingPowerOfUser",args:[d]})),x!=null&&h("locker.data.votingPowerHistory.currentVotingPower",O(x.toString()).div(Ae).toString())}catch(x){console.error(x),f("locker.data.votingPowerHistory.currentVotingPower")}};return A.useEffect(()=>{d&&w()},[d]),{status:r,data:y,error:c,fetch:b,fetchCurrentVotingPower:w}}globalThis.jotaiAtomCache=globalThis.jotaiAtomCache||{cache:new Map,get(r,n){return this.cache.has(r)?this.cache.get(r):(this.cache.set(r,n),n)}};const Pe=[{inputs:[{internalType:"string",name:"name",type:"string"},{internalType:"string",name:"symbol",type:"string"}],stateMutability:"nonpayable",type:"constructor"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"owner",type:"address"},{indexed:!0,internalType:"address",name:"spender",type:"address"},{indexed:!1,internalType:"uint256",name:"value",type:"uint256"}],name:"Approval",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"previousOwner",type:"address"},{indexed:!0,internalType:"address",name:"newOwner",type:"address"}],name:"OwnershipTransferred",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"from",type:"address"},{indexed:!0,internalType:"address",name:"to",type:"address"},{indexed:!1,internalType:"uint256",name:"value",type:"uint256"}],name:"Transfer",type:"event"},{inputs:[{internalType:"address",name:"owner",type:"address"},{internalType:"address",name:"spender",type:"address"}],name:"allowance",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"spender",type:"address"},{internalType:"uint256",name:"amount",type:"uint256"}],name:"approve",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"account",type:"address"}],name:"balanceOf",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[],name:"decimals",outputs:[{internalType:"uint8",name:"",type:"uint8"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"spender",type:"address"},{internalType:"uint256",name:"subtractedValue",type:"uint256"}],name:"decreaseAllowance",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"nonpayable",type:"function"},{inputs:[],name:"getOwner",outputs:[{internalType:"address",name:"",type:"address"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"spender",type:"address"},{internalType:"uint256",name:"addedValue",type:"uint256"}],name:"increaseAllowance",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"uint256",name:"amount",type:"uint256"}],name:"mint",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"nonpayable",type:"function"},{inputs:[],name:"name",outputs:[{internalType:"string",name:"",type:"string"}],stateMutability:"view",type:"function"},{inputs:[],name:"owner",outputs:[{internalType:"address",name:"",type:"address"}],stateMutability:"view",type:"function"},{inputs:[],name:"renounceOwnership",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[],name:"symbol",outputs:[{internalType:"string",name:"",type:"string"}],stateMutability:"view",type:"function"},{inputs:[],name:"totalSupply",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"recipient",type:"address"},{internalType:"uint256",name:"amount",type:"uint256"}],name:"transfer",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"sender",type:"address"},{internalType:"address",name:"recipient",type:"address"},{internalType:"uint256",name:"amount",type:"uint256"}],name:"transferFrom",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"newOwner",type:"address"}],name:"transferOwnership",outputs:[],stateMutability:"nonpayable",type:"function"}];globalThis.jotaiAtomCache=globalThis.jotaiAtomCache||{cache:new Map,get(r,n){return this.cache.has(r)?this.cache.get(r):(this.cache.set(r,n),n)}};function Ft(){const{address:r}=Le(),{select:n,push:c}=Ge(),l=async f=>{const d=`tokens.${String(f).toLowerCase()}`;let a=n(d);if(a===void 0){const y=await Te(X,{contracts:[{address:f,abi:Pe,functionName:"name"},{address:f,abi:Pe,functionName:"symbol"},{address:f,abi:Pe,functionName:"decimals"}],allowFailure:!0});
6y&&(a={name:y[0].result,symbol:y[1].result,decimals:y[2].result},c(d,a))}return a};return{getToken:l,handleTokenApprove:async(f,d,a,y)=>{const[b,w]=await Promise.all([l(f),await et(X,{address:f,abi:Pe,functionName:"allowance",args:[r,d]})]),x=O(10).pow(b.decimals);if(O(w.toString()).lt(O(a).times(x))){const j=await Oe(X,{address:f,abi:Pe,functionName:"approve",args:[d,BigInt(y)]});await ze(X,{hash:j})}}}}globalThis.jotaiAtomCache=globalThis.jotaiAtomCache||{cache:new Map,get(r,n){return this.cache.has(r)?this.cache.get(r):(this.cache.set(r,n),n)}};function ft(r){const{contractAddresses:n}=ue(),{select:c,push:l}=Ge(),h=r?c(`tokenRatio.${r.toLowerCase()}`):NaN,f=a=>[n.TRAVA_TOKEN_ADDRESS.toLowerCase(),n.RTRAVA_TOKEN_ADDRESS.toLowerCase()].includes(a.toLowerCase()),d=async a=>{if(!lt(a))throw new Error("Invalid token address");const y=`tokenRatio.${a.toLowerCase()}`;let b=c(y);if(b===void 0){if(n.TRAVA_TOKEN_ADDRESS.toLowerCase()===a.toLowerCase())b=1;else{let w;n.TOKEN_VALUATOR_ADDRESS&&n.LP_VALUATOR_ADDRESS&&(w=f(a)?n.TOKEN_VALUATOR_ADDRESS:n.LP_VALUATOR_ADDRESS);let x;w&&(x=await et(X,{address:w,abi:Zn,functionName:"ratio",args:[a]})),x&&(b=O(x.toString()).div(Ae).toNumber())}l(y,b)}return b};return A.useEffect(()=>{r&<(r)&&n&&d(r)},[r,n]),{ratio:h,getTokenRatio:d}}globalThis.jotaiAtomCache=globalThis.jotaiAtomCache||{cache:new Map,get(r,n){return this.cache.has(r)?this.cache.get(r):(this.cache.set(r,n),n)}};const pe=[{anonymous:!1,inputs:[{indexed:!1,internalType:"uint256",name:"time",type:"uint256"},{indexed:!1,internalType:"uint256",name:"tokens",type:"uint256"}],name:"CheckpointToken",type:"event"},{anonymous:!1,inputs:[{indexed:!1,internalType:"uint256",name:"tokenId",type:"uint256"},{indexed:!1,internalType:"uint256",name:"amount",type:"uint256"},{indexed:!1,internalType:"uint256",name:"claim_epoch",type:"uint256"},{indexed:!1,internalType:"uint256",name:"max_epoch",type:"uint256"}],name:"Claimed",type:"event"},{inputs:[],name:"APRBase",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[],name:"checkpoint_token",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[],name:"checkpoint_total_supply",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"uint256",name:"_tokenId",type:"uint256"}],name:"claim",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"uint256",name:"_tokenId",type:"uint256"}],name:"claimWarmUpReward",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"uint256[]",name:"_tokenIds",type:"uint256[]"}],name:"claim_many",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"uint256",name:"_tokenId",type:"uint256"}],name:"claimable",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[],name:"depositor",outputs:[{internalType:"address",name:"",type:"address"}],stateMutability:"view",type:"function"},{inputs:[],name:"emissionPerSecond",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[],name:"governance",outputs:[{internalType:"address",name:"",type:"address"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"_voting_escrow",type:"address"}],name:"initialize",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"uint256",name:"",type:"uint256"}],name:"isWarmUp",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"view",type:"function"},{inputs:[],name:"kill_me",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[],name:"last_token_time",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"uint256",name:"_t",type:"uint256"}],name:"roundDown",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"uint256",name:"_APRBase",type:"uint256"}],name:"setAPRBase",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"_depositor",type:"address"}],name:"setDepositor",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"uint256",name:"_emissionPerSecond",type:"uint256"}],name:"setEmissionPerSecond",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"_governance",type:"address"}],name:"setGovernance",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"uint256",name:"_week_ts",type:"uint256"},{internalType:"uint256",name:"_warmUpAPR",type:"uint256"}],name:"setWarmUpAPR",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[],name:"start_time",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[],name:"time_cursor",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"uint256",name:"",type:"uint256"}],name:"time_cursor_of",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[],name:"timestamp",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[],name:"token",outputs:[{internalType:"address",name:"",type:"address"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"uint256",name:"",type:"uint256"}],name:"tokens_per_week",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[],name:"update_token",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"uint256",name:"",type:"uint256"}],name:"user_epoch_of",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"uint256",name:"_tokenId",type:"uint256"},{internalType:"uint256",name:"_timestamp",type:"uint256"}],name:"ve_for_at",outputs:[{internalType:"uint256",name:"voting_power",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"uint256",name:"",type:"uint256"}],name:"ve_supply",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[],name:"voting_escrow",outputs:[{internalType:"address",name:"",type:"address"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"uint256",name:"",type:"uint256"}],name:"warmUpAPRWeekly",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"}];globalThis.jotaiAtomCache=globalThis.jotaiAtomCache||{cache:new Map,get(r,n){return this.cache.has(r)?this.cache.get(r):(this.cache.set(r,n),n)}};function Et({claimableRewardRaw:r,veNFTVotingPowerRawAtT:n,warmUpRewardRaw:c,isUseWarmup:l,totalVP:h,eps:f,token:d,now:a,roundedTime:y,locked:b,votingPowerRaw:w}){const x={};if(r&&(x.claimable=O(r).div(Ae).toString()),n&&a&&y&&h&&f&&c&&(x.unclaimable=l?O(c).div(Ae).toString():O(h).eq(0)?"0":O(n).times(a-y).div(h).times(f).toString()),x.claimable&&x.unclaimable&&(x.reward=O(x.claimable).plus(x.unclaimable).toString()),b&&d){const j=O(10).pow(d.decimals);x.amount=O(b[1].toString()).div(j).toString(),x.balance=x.amount,x.rewardAmount=O(b[0].toString()).div(Ae).toString(),x.endTime=O(b[2].toString()).times(1e3).toNumber(),x.token=b[3],x.tokenSymbol=Gn[d.symbol]??d.symbol}return w&&(x.votingPower=O(w).div(Ae).toString()),x}function Ct(){const r=Math.floor(new Date().getTime()/1e3),n=Se(r,0);return{now:r,roundedTime:n}}const hn=A.createContext({});function ti({children:r}){const{contractAddresses:n}=ue(),{address:c}=Le(),[l,h]=A.useState(G.IDLE),[f,d]=A.useState(),{status:a,error:y,fetch:b,fetchCurrentVotingPower:w}=ei(),x=pt("locker.data",{}),{push:j,clear:m,assign:E}=Ge(),{getToken:I}=Ft(),{getTokenRatio:D}=ft(),R=async C=>{var F;try{if(!c||!n)throw new Error("Connection error");C||l===G.IDLE||l===G.FAILED?h(G.FETCHING):h(G.UPDATING);const{now:M,roundedTime:ee}=Ct(),ie=await Te(X,{contracts:[{address:n.VE_TRAVA_ADDRESS,abi:ce,functionName:"getveNFTOfUser",args:[c]},{address:n.VE_TRAVA_ADDRESS,abi:ce,functionName:"totalSupplyAtT",args:[BigInt(ee)]},{address:n.INCENTIVE_VAULT_ADDRESS,abi:pe,functionName:"emissionPerSecond"}],allowFailure:!0}),L=ie[0].result,J=(F=ie[1].result)==null?void 0:F.toString(),W=ie[2].status==="success"&&ie[2].result!==void 0?O(ie[2].result.toString()).div(Ae):void 0,Z=await Te(X,{contracts:L.flatMap(K=>[{address:n.VE_TRAVA_ADDRESS,abi:ce,functionName:"tokenURI",args:[K]},{address:n.VE_TRAVA_ADDRESS,abi:ce,functionName:"balanceOfNFT",args:[K]},{address:n.VE_TRAVA_ADDRESS,abi:ce,functionName:"locked",args:[K]},{address:n.VE_TRAVA_ADDRESS,abi:ce,functionName:"user_point_history__ts",args:[K,1]}]),allowFailure:!0}),N=await Te(X,{contracts:L.flatMap(K=>
6[{address:n.INCENTIVE_VAULT_ADDRESS,abi:pe,functionName:"claimable",args:[K]},{address:n.INCENTIVE_VAULT_ADDRESS,abi:pe,functionName:"ve_for_at",args:[K,ee]},{address:n.INCENTIVE_VAULT_ADDRESS,abi:pe,functionName:"claimWarmUpReward",args:[K]}]),allowFailure:!0}),U=4,P=3,z=L.map((K,Y)=>{const $=Z[Y*U+2];return $.status==="success"&&$.result!==void 0?$.result[3]:null}).filter((K,Y,$)=>$.indexOf(K)===Y),te=(await Promise.all(z.map(async K=>await Promise.all([I(K),D(K)])))).reduce((K,Y,$)=>(K[z[$]]=Y,K),{}),he=L.reduce((K,Y,$)=>{var q,B,ne;const we=Z[$*U].result,xe=Z[$*U+2].result;return K[Y.toString()]={...JSON.parse(Qr.Buffer.from(we.split(",")[1],"base64").toString()),...Et({claimableRewardRaw:(q=N[P*$].result)==null?void 0:q.toString(),veNFTVotingPowerRawAtT:(B=N[P*$+1].result)==null?void 0:B.toString(),warmUpRewardRaw:(ne=N[P*$+2].result)==null?void 0:ne.toString(),isUseWarmup:Se(Number(Z[$*U+3].result.toString()),bt)>M,votingPowerRaw:Z[$*U+1].result.toString(),locked:xe,token:te[xe[3]][0],eps:W,totalVP:J,now:M,roundedTime:ee}),tokenRatio:te[xe[3]][1],id:Y.toString()},K},{});j("locker.data.veNFTList",he),h(G.SUCCESS),d(void 0)}catch(M){console.error("Failed to fetch locker data",M),d(M),m("locker.data.veNFTList"),h(G.FAILED)}},k=async C=>{m(`locker.data.veNFTList[${C}]`),await Promise.all([R(),w()])},v=async()=>{w();try{if(!n.VE_TRAVA_ADDRESS||!n.INCENTIVE_VAULT_ADDRESS)throw new Error("Cannot retrieve contract addresses");const C=Object.keys(x.veNFTList);if(C.length===0)return;const{now:F,roundedTime:M}=Ct(),ee=await Te(X,{contracts:C.flatMap(N=>[{address:n.VE_TRAVA_ADDRESS,abi:ce,functionName:"balanceOfNFT",args:[BigInt(N)]},{address:n.VE_TRAVA_ADDRESS,abi:ce,functionName:"user_point_history__ts",args:[BigInt(N),BigInt(1)]}]),allowFailure:!0}),ie=await et(X,{address:n.VE_TRAVA_ADDRESS,abi:ce,functionName:"totalSupplyAtT",args:[BigInt(M)]}),L=await Te(X,{contracts:C.flatMap(N=>[{address:n.INCENTIVE_VAULT_ADDRESS,abi:pe,functionName:"claimable",args:[N]},{address:n.INCENTIVE_VAULT_ADDRESS,abi:pe,functionName:"ve_for_at",args:[N,M]},{address:n.INCENTIVE_VAULT_ADDRESS,abi:pe,functionName:"claimWarmUpReward",args:[N]}]),allowFailure:!0}),J=await et(X,{address:n.INCENTIVE_VAULT_ADDRESS,abi:pe,functionName:"emissionPerSecond"}),W=ie.toString(),Z=O(J.toString()).div(Ae);C.forEach((N,U)=>{var P,z,te;x.veNFTList[N]&&E(`locker.data.veNFTList[${N}]`,Et({votingPowerRaw:ee[2*U].result.toString(),claimableRewardRaw:(P=L[3*U].result)==null?void 0:P.toString(),veNFTVotingPowerRawAtT:(z=L[3*U+1].result)==null?void 0:z.toString(),warmUpRewardRaw:(te=L[3*U+2].result)==null?void 0:te.toString(),isUseWarmup:Se(Number(ee[2*U+1].result.toString()),bt)>F,totalVP:W,eps:Z,now:F,roundedTime:M}))})}catch(C){console.error("Failed to refresh veNFTs",C)}},_=async C=>{var F,M,ee,ie,L,J;w();try{if(!n.VE_TRAVA_ADDRESS||!n.INCENTIVE_VAULT_ADDRESS||!C)return;const{now:W,roundedTime:Z}=Ct(),N=await Te(X,{contracts:[{address:n.VE_TRAVA_ADDRESS,abi:ce,functionName:"balanceOfNFT",args:[BigInt(C)]},{address:n.VE_TRAVA_ADDRESS,abi:ce,functionName:"locked",args:[BigInt(C)]},{address:n.VE_TRAVA_ADDRESS,abi:ce,functionName:"totalSupplyAtT",args:[BigInt(Z)]},{address:n.VE_TRAVA_ADDRESS,abi:ce,functionName:"user_point_history__ts",args:[BigInt(C),BigInt(1)]}],allowFailure:!0}),U=await Te(X,{contracts:[{address:n.INCENTIVE_VAULT_ADDRESS,abi:pe,functionName:"claimable",args:[BigInt(C)]},{address:n.INCENTIVE_VAULT_ADDRESS,abi:pe,functionName:"emissionPerSecond"},{address:n.INCENTIVE_VAULT_ADDRESS,abi:pe,functionName:"ve_for_at",args:[BigInt(C),BigInt(Z)]},{address:n.INCENTIVE_VAULT_ADDRESS,abi:pe,functionName:"claimWarmUpReward",args:[BigInt(C)]}],allowFailure:!0});let P;N[1].status==="success"&&N[1].result!==void 0&&(P=await I(N[1].result[3]));const z=(F=N[2].result)==null?void 0:F.toString(),te=U[1].status==="success"&&U[1].result!==void 0?O(U[1].result.toString()).div(Ae):void 0;E(`locker.data.veNFTList[${C}]`,Et({claimableRewardRaw:(M=U[0].result)==null?void 0:M.toString(),veNFTVotingPowerRawAtT:(ee=U[2].result)==null?void 0:ee.toString(),warmUpRewardRaw:(ie=U[3].result)==null?void 0:ie.toString(),isUseWarmup:Se(Number((L=N[3].result)==null?void 0:L.toString()),bt)>W,token:P,votingPowerRaw:(J=N[0].result)==null?void 0:J.toString(),locked:N[1].result,totalVP:z,eps:te,now:W,roundedTime:Z}))}catch(W){console.error("Failed to update veNFT "+C,W)}};return i.jsx(hn.Provider,{value:{status:l,votingPowerStatus:a,data:x,error:f,votingPowerError:y,fetch:R,fetchVotingPowerHistory:b,fetchCurrentVotingPower:w,removeVeNFT:k,refreshVeNFTList:v,updateVeNFT:_},children:r})}const me=()=>A.useContext(hn);globalThis.jotaiAtomCache=globalThis.jotaiAtomCache||{cache:new Map,get(r,n){return this.cache.has(r)?this.cache.get(r):(this.cache.set(r,n),n)}};const ni={[Pn.id]:{"0x0391be54e72f7e001f6bbc331777710b4f2999ef":{symbol:"TRAVA",name:"Trava Finance",img:Tt.travaIcon},"0x170772a06affc0d375ce90ef59c8ec04c7ebf5d2":{symbol:"rTRAVA",name:"Trava Finance",img:Tt.rTravaIcon},"0x865c77d4ff6383e06c58350a2cfb95cca2c0f056":{symbol:"BNB/TRAVA",name:"Trava Finance",img:Tt.travaBNBIcon}}};globalThis.jotaiAtomCache=globalThis.jotaiAtomCache||{cache:new Map,get(r,n){return this.cache.has(r)?this.cache.get(r):(this.cache.set(r,n),n)}};function mt(){const{chainId:r}=ue();return ni[r]}const _t=Ie(i.jsx("path",{d:"M7.41 8.59 12 13.17l4.59-4.58L18 10l-6 6-6-6z"}),"KeyboardArrowDown");globalThis.jotaiAtomCache=globalThis.jotaiAtomCache||{cache:new Map,get(r,n){return this.cache.has(r)?this.cache.get(r):(this.cache.set(r,n),n)}};function Mt(r){var k,v,_;const n=mt(),{max:c,min:l=0,value:h,onAmountChange:f,token:d,fixedToken:a,onTokenChange:y,slotProps:b,enableMaxAmount:w,...x}=r,[j,m]=A.useState(),E=C=>{if(!Ve(C))return m("Invalid value"),!1;const F=O(C);return F.lt(l)?(m(`Amount exceeds minimum of ${re(l)}`),!1):Ve(c)&&F.gt(c)?(m(`Amount exceeds maximum of ${re(c)}`),!1):(m(void 0),!0)};A.useEffect(()=>{f(h,E(h))});const I=C=>{const F=C.target.value,M=E(F);f&&typeof f=="function"&&f(F,M)},D=()=>{f&&typeof f=="function"&&f(c,!0)},R=C=>{y&&typeof y=="function"&&y(C.target.value)};return A.useEffect(()=>{f(h,E(h))},[l,c]),i.jsx(an,{variant:"outlined",margin:"dense",fullWidth:!0,placeholder:"Enter amount",type:"number",...x,error:j!==void 0,helperText:j,value:h,onChange:I,slotProps:{input:{endAdornment:i.jsxs(kt,{position:"end",children:[w&&Ve(c)&&i.jsx(Qe,{variant:"text",color:"primary",size:"small",onClick:D,s
6x:{minWidth:50},children:"Max"}),a&&i.jsxs(T,{sx:{display:"flex",alignItems:"center"},children:[i.jsx("img",{width:30,src:(k=n[d])==null?void 0:k.img,alt:`${(v=n[d])==null?void 0:v.symbol} icon`}),i.jsx(T,{ml:1,children:i.jsx(S,{variant:"button",color:"secondary.main",children:(_=n[d])==null?void 0:_.symbol})})]}),!a&&i.jsx(cn,{variant:"standard",value:d,onChange:R,disableUnderline:!0,IconComponent:_t,sx:{"& .MuiSelect-select":{color:"secondary.main",display:"flex",alignItems:"center"},"& .MuiInput-input:focus":{bgcolor:"transparent"}},children:Object.entries(n).map(([C,F])=>i.jsxs(nn,{value:C,sx:{display:"flex",alignItems:"center"},children:[i.jsx("img",{width:30,src:F.img,alt:`${F.symbol} icon`}),i.jsx(T,{ml:1,children:i.jsx(S,{variant:"button",children:F.symbol})})]},C))})]}),sx:{bgcolor:"background.default"}},htmlInput:{max:c,min:l},...b}})}globalThis.jotaiAtomCache=globalThis.jotaiAtomCache||{cache:new Map,get(r,n){return this.cache.has(r)?this.cache.get(r):(this.cache.set(r,n),n)}};const It=r=>Math.max(new Date(r).getTime()-new Date().getTime(),0)/100;function xt(r){const{amount:n,timeRemaining:c,unlockTime:l,refreshDuration:h=6e4}=r,[f,d]=A.useState(()=>Ze(n,c??It(l)));return A.useEffect(()=>{if(c!==void 0){d(Ze(n,c));return}d(Ze(n,It(l)));const a=setInterval(()=>{const y=It(l);d(Ze(n,y)),y===0&&a&&clearInterval(a)},h);return()=>clearInterval(a)},[n,l,c]),i.jsx(i.Fragment,{children:re(f,{fractionDigits:2,padZero:!0})})}const Lt=Ie(i.jsx("path",{d:"m12 4-1.41 1.41L16.17 11H4v2h12.17l-5.58 5.59L12 20l8-8z"}),"ArrowForward");globalThis.jotaiAtomCache=globalThis.jotaiAtomCache||{cache:new Map,get(r,n){return this.cache.has(r)?this.cache.get(r):(this.cache.set(r,n),n)}};const ri=({duration:r,format:n="MM/DD/YYYY"})=>{const c=A.useMemo(()=>{if(!Ve(r))return 0;let l=Number(r);return l==Ee[0].key&&(l+=l),Se(Math.floor(new Date().getTime()/1e3),l)*1e3},[r]);return Ve(r)?i.jsxs(T,{sx:{display:"flex",justifyContent:"space-between",alignItems:"center",mt:1.5},children:[i.jsx(T,{sx:{px:{xs:1.5,xsm:3},py:1,bgcolor:"background.default",borderRadius:2.5,borderWidth:1,borderStyle:"solid",borderColor:"secondary.dark"},children:i.jsx(S,{children:Be(new Date).format(n)})}),i.jsx(Lt,{}),i.jsx(T,{sx:{px:{xs:1.5,xsm:3},py:1,bgcolor:"background.default",borderRadius:2.5,borderWidth:1,borderStyle:"solid",borderColor:"secondary.dark"},children:i.jsx(S,{children:Be(c).format(n)})})]}):(console.error("Invalid `duration` property pass to TimeRange component, expect a number."),null)};function Nt(r){const{value:n,valueDisplay:c,textFieldProps:l,options:h,onChange:f,disableTimeRange:d=!0,format:a="MM/DD/YYYY hh:mm A",timeRangeFormat:y="MM/DD/YYYY",minTime:b,...w}=r,[x,j]=A.useState(!1),[m,E]=A.useState(),I=k=>(k===void 0&&(k=""),c!==void 0&&typeof c=="function"?c(k,a):Be().add(k,"s").format(a)),D=k=>{if(typeof b=="number"){if(isNaN(k))return E("Invalid time"),!1;if(k<b)return E(`Time to unlock must be after ${Be(b*1e3).format("MM/DD/YYYY")}`),!1}return E(void 0),!0},R=k=>{f&&typeof f=="function"&&f(k.target.value,D(Se(new Date().getTime()/1e3,Number(k.target.value))))};return i.jsxs(A.Fragment,{children:[i.jsx(an,{variant:"outlined",fullWidth:!0,margin:"dense",type:"text",...l,value:I(n),onClick:()=>j(!x),helperText:m,slotProps:{input:{sx:{bgcolor:"background.default"},startAdornment:i.jsx(kt,{position:"start",children:i.jsx(Vn,{color:"secondary"})}),endAdornment:i.jsx(kt,{position:"end",sx:{justifyContent:"flex-end"},children:i.jsx(cn,{open:x,disableUnderline:!0,variant:"standard",...w,value:n,onChange:R,IconComponent:_t,sx:{"& .MuiSelect-select":{color:"secondary.main",display:"flex",alignItems:"center"},"& .MuiInput-input:focus":{bgcolor:"transparent"}},children:h.map(k=>i.jsx(nn,{value:k.key,children:k.value},k.key))})})}}}),!d&&i.jsx(ri,{duration:n,format:y})]})}globalThis.jotaiAtomCache=globalThis.jotaiAtomCache||{cache:new Map,get(r,n){return this.cache.has(r)?this.cache.get(r):(this.cache.set(r,n),n)}};function ii(){const r=mt(),[n,c]=A.useState(100),[l,h]=A.useState(Object.keys(r)[0]),[f,d]=A.useState(Ee.slice(-1)[0].key),{ratio:a}=ft(l);A.useEffect(()=>{r&&h(Object.keys(r)[0])},[r]);const y=A.useMemo(()=>{const j=Math.floor(new Date().getTime()/1e3);let m=Number(f);return m===Ee[0].key&&(m+=m),Se(j,Number(m))-j},[f]),b=A.useMemo(()=>O(n).times(a).toString(),[a,n]),w=j=>{c(j)},x=j=>{d(j)};return i.jsxs(T,{sx:{display:"flex",flexDirection:"column",height:"100%"},children:[i.jsx(S,{variant:"h5",gutterBottom:!0,children:"Voting Power Calculator"}),i.jsxs(tt,{sx:{p:2,flexGrow:1,boxShadow:"0px 3px 6px #0000001F"},children:[i.jsx(T,{children:i.jsx(Mt,{id:"lock-amount-inp",value:n,token:l,onAmountChange:w,onTokenChange:j=>h(j)})}),i.jsx(T,{mt:1,children:i.jsx(Nt,{options:Ee,disableTimeRange:!1,value:f,onChange:x})}),i.jsx(T,{mt:3,children:i.jsxs(T,{sx:{display:"flex",alignItems:"center",justifyContent:"space-between"},children:[i.jsx(S,{color:"secondary.main",children:"Your Voting Power will be"}),i.jsx(S,{component:"div",variant:"h4",color:"primary.main",children:i.jsx(xt,{amount:b,timeRemaining:y})})]})})]})]})}globalThis.jotaiAtomCache=globalThis.jotaiAtomCache||{cache:new Map,get(r,n){return this.cache.has(r)?this.cache.get(r):(this.cache.set(r,n),n)}};function oi(){const r=[{text:"1W",days:7},{text:"1M",days:30},{text:"1Y",days:365},{text:"ALL"}],{address:n}=Le(),[c,l]=A.useState(3),{fetchVotingPowerHistory:h}=me();A.useEffect(()=>{h(r[c].days)},[c,n]);const f=d=>()=>{l(d)};return i.jsx(qn,{sx:{bgcolor:"background.default"},disableElevation:!0,children:r.map((d,a)=>i.jsx(Qe,{onClick:f(a),variant:c===a?"contained":"text",color:"primary",children:d.text},d.text))})}globalThis.jotaiAtomCache=globalThis.jotaiAtomCache||{cache:new Map,get(r,n){return this.cache.has(r)?this.cache.get(r):(this.cache.set(r,n),n)}};function si(){var y;const r=Qn(),n=A.useRef(null),{votingPowerStatus:c,data:l}=me();A.useEffect(()=>{var b;n!==null&&((b=n.current)!=null&&b.chart)&&(c===G.IDLE||c===G.FETCHING||c===G.UPDATING?n.current.chart.showLoading():n.current.chart.hideLoading())},[c]);const[h,f,d]=A.useMemo(()=>{var j;let b=[],w=[],x=[];return(j=l==null?void 0:l.votingPowerHistory)!=null&&j.votingLogs&&(b=[...l.votingPowerHistory.votingLogs.categories],w=[...l.votingPowerHistory.votingLogs.votingPower],x=[...l.votingPowerHistory.votingLogs.percentage]),[b,w,x]},[l.votingPowerHistory]),a=A.useMemo(()=>{const b=new At.Time({});return At.merge(r,{chart:{type:"areaspline",zoomType:"x",height:220},title:{text:void 0},tooltip:{xDateFormat:"%Y-%m-%d %I:%M:%S %p",shared:!0,crosshairs:!1,headerFormat:{},formatter:function(){return this.points?`<span style="font-size:11px">${Be(this.category).format("Y-MM-DD hh:MM:SS A")}</span> 7 <br/><span style="color:${this.points[0].color}">â</span> 8 ${this.points[0].series.name}: 9 <b> 10 ${re(this.points[0].y,{fractionDigits:4,delimiter:""})} 11 </b> 12 <br/><span style="color:${this.points[1].color}">â</span> 13 ${this.points[1].series.name}: 14 <b> 15 ${re(this.points[1].y,{fractionDigits:2,delimiter:""})} 16 </b>`:""}},legend:{y:20},xAxis:{gridLineWidth:0,type:"datetime",categories:h,tickInterval:Math.ceil(h.length/6),labels:{formatter:function(){return b.dateFormat("%d %b '%y",Number(this.value))}}},yAxis:[{...r.yAxis,gridLineWidth:1,title:{text:void 0},showFirstLabel:!1,tooltipValueFormat:"{value:.4f}"},{...r.yAxis,gridLineWidth:0,opposite:!0,title:{text:void 0}
16,min:0,max:100,endOnTick:!1,showFirstLabel:!1,tooltipValueFormat:"{value:.2f}"}],plotOptions:{areaspline:{fillOpacity:.2,marker:{radius:0,symbol:"circle",states:{hover:{radius:5}}},lineWidth:1,states:{hover:{lineWidth:1}},threshold:null}},series:[{name:"Voting Power",data:f,yAxis:0},{name:"Percentage",data:d,yAxis:1}]})},[r,h,f,d]);return i.jsxs(T,{sx:{width:"100%",height:"100%",display:"flex",flexDirection:"column"},children:[i.jsx(S,{variant:"h5",whiteSpace:"nowrap",gutterBottom:!0,children:"Your Voting Power"}),i.jsxs(tt,{sx:{p:2,flexGrow:1,boxShadow:"0px 3px 6px #0000001F"},children:[i.jsxs(T,{sx:{display:"flex",alignItems:{xsm:"center"},justifyContent:"space-between",flexDirection:{xs:"column",xsm:"row"},width:"100%",mb:2},children:[i.jsx(T,{sx:{display:"flex",alignItems:"baseline",mb:{xs:1,xsm:0}},children:i.jsxs(S,{color:"text.secondary",children:["Current Voting Power ",i.jsx(S,{color:"primary.main",variant:"h4",component:"span",children:re((y=l==null?void 0:l.votingPowerHistory)==null?void 0:y.currentVotingPower,{fractionDigits:2,fallback:"N/A"})})]})}),i.jsx(T,{sx:{display:"flex",justifyContent:"flex-end",width:{xs:"100%",xsm:"auto"}},children:i.jsx(oi,{})})]}),i.jsx(er,{ref:n,highcharts:At,options:a})]})]})}const ai=Ie(i.jsx("path",{d:"M19 6.41 17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z"}),"Close");globalThis.jotaiAtomCache=globalThis.jotaiAtomCache||{cache:new Map,get(r,n){return this.cache.has(r)?this.cache.get(r):(this.cache.set(r,n),n)}};function Rt(r){const{children:n,onClose:c,...l}=r;return i.jsxs(Jn,{...l,children:[n,c?i.jsx(Un,{"aria-label":"close",onClick:c,sx:{position:"absolute",right:8,top:8,color:"secondary.main"},children:i.jsx(ai,{})}):null]})}globalThis.jotaiAtomCache=globalThis.jotaiAtomCache||{cache:new Map,get(r,n){return this.cache.has(r)?this.cache.get(r):(this.cache.set(r,n),n)}};function pn(r,n){const[c,l]=A.useState(G.IDLE),{assign:h}=Ge(),f=pt("balances",{}),d=y=>typeof y=="string"&<(y),a=async()=>{c===G.IDLE||c===G.FAILED?l(G.FETCHING):c===G.SUCCESS&&l(G.UPDATING);try{const y=(n==null?void 0:n.filter(d))??[],b=await Te(X,{contracts:y.flatMap(w=>[{address:w,abi:Pe,functionName:"balanceOf",args:[r]},{address:w,abi:Pe,functionName:"decimals"}]),allowFailure:!0});b&&h("balances",...y.map((w,x)=>{var j,m;return{[w.toLowerCase()]:O(((j=b[2*x].result)==null?void 0:j.toString())??"0").div(O(10).pow(((m=b[2*x+1].result)==null?void 0:m.toString())??"0")).toFixed()}})),l(G.SUCCESS)}catch(y){console.error(y),l(G.FAILED)}};return A.useEffect(()=>{r&&n&&a()},[r,n]),{balances:f,loading:c===G.FETCHING||c===G.IDLE,status:c,refresh:a}}globalThis.jotaiAtomCache=globalThis.jotaiAtomCache||{cache:new Map,get(r,n){return this.cache.has(r)?this.cache.get(r):(this.cache.set(r,n),n)}};function ci(r){const n=mt(),[c,l]=A.useState(!1),[h,f]=A.useState(0),[d,a]=A.useState(!0),[y,b]=A.useState(Object.keys(n)[0]),[w,x]=A.useState(Ee.slice(-1)[0].key),[j,m]=A.useState(!1),{ratio:E}=ft(y),{contractAddresses:I}=ue(),D=A.useMemo(()=>{const P=Math.floor(new Date().getTime()/1e3);let z=Number(w);return z===Ee[0].key&&(z+=z),Se(P,Number(z))-P},[w]),R=A.useMemo(()=>O(h).times(E).toString(),[E,h]);A.useEffect(()=>{n&&b(Object.keys(n)[0])},[n]);const{fetch:k}=me(),{address:v}=Le(),_=A.useMemo(()=>Object.keys(n),[n]),{handleTokenApprove:C,getToken:F}=Ft(),M=(P,z)=>{f(P),a(z)},ee=P=>{x(P)},ie=()=>{l(!0)},L=()=>{l(!1)},{balances:J,loading:W,refresh:Z}=pn(v,_),N=()=>J[y]??0,U=async P=>{P.preventDefault();const z=H.info(i.jsx(Ye,{}),{autoClose:!1});try{if(!I)throw new Error("Cannot retrieve contract addresses");if(h===0)throw new Error("Amount must be positive");const te=await F(y);await C(y,I.VE_TRAVA_ADDRESS,h,1e9);const he=O(h).times(O(10).pow(te.decimals)).toFixed(0),K=await Oe(X,{address:I.VE_TRAVA_ADDRESS,abi:ce,functionName:"create_lock",args:[y,BigInt(he),BigInt(w)]});await ze(X,{hash:K}),H.dismiss(z),H.success(i.jsx(Ke,{message:"Create successfully",txHash:K}),{autoClose:3e3}),l(!1),k()}catch(te){console.error(te),H.dismiss(z),H.error(i.jsx(qe,{error:String(te)}))}finally{Z()}m(!1)};return i.jsxs(A.Fragment,{children:[i.jsx(fe,{...r,variant:"contained",color:"primary",startIcon:i.jsx(On,{}),onClick:ie,disabled:j||!v,children:"Create Lock"}),i.jsxs(ut,{open:c,maxWidth:"xs",fullWidth:!0,"aria-labelledby":"
16create-lock-dialog-title",children:[i.jsx(Rt,{id:"create-lock-dialog-title",onClose:L,children:i.jsx(S,{color:"primary",variant:"h4",component:"span",children:"New Lock"})}),i.jsx(dt,{children:i.jsxs("form",{onSubmit:U,noValidate:!0,children:[i.jsxs(T,{children:[i.jsxs(S,{variant:"body3",children:["Wallet balance: ",i.jsx("b",{children:re(J[y],{fallback:"N/A"})})," ",n[y].symbol.toUpperCase()]}),i.jsx(Mt,{id:"dialog-lock-amount-inp",value:h,max:N(),min:0,token:y,onAmountChange:M,onTokenChange:P=>b(P),enableMaxAmount:!0})]}),i.jsx(T,{mt:1,children:i.jsx(Nt,{options:Ee,disableTimeRange:!1,value:w,onChange:ee})}),i.jsx(Dt,{sx:{my:3}}),i.jsxs(T,{sx:{display:"flex",alignItems:"center",justifyContent:"space-between"},children:[i.jsx(S,{color:"secondary.main",children:"Your Voting Power"}),i.jsx(S,{variant:"subtitle1",color:"primary.main",children:i.jsx(xt,{amount:R,timeRemaining:D})})]}),i.jsx(T,{mt:3,children:i.jsx(fe,{type:"submit",size:"large",color:"primary",variant:"contained",fullWidth:!0,loading:j,disabled:j||!d||W,children:"Create Lock"})})]})})]})]})}globalThis.jotaiAtomCache=globalThis.jotaiAtomCache||{cache:new Map,get(r,n){return this.cache.has(r)?this.cache.get(r):(this.cache.set(r,n),n)}};function li(r,n){switch(n.type){case"ADD_SELECTED_ITEM":r.merge.selectedItemIds.push(n.payload.id);break;case"REMOVE_SELECTED_ITEM":r.merge.selectedItemIds=r.merge.selectedItemIds.filter(c=>c!==n.payload.id);break;case"REMOVE_ALL_SELECTED_ITEMS":r.merge.selectedItemIds=[];break;case"ADD_FILTER_TOKEN":r.filter.tokens.push(n.payload.item);break;case"REMOVE_FILTER_TOKEN":r.filter.tokens=r.filter.tokens.filter(c=>c!==n.payload.item);break;case"REMOVE_ALL_FILTER_TOKEN":r.filter.tokens=[];break;case"ADD_FILTER_STATUS":r.filter.statuses.push(n.payload.item);break;case"REMOVE_FILTER_STATUS":r.filter.statuses=r.filter.statuses.filter(c=>c!==n.payload.item);break;case"REMOVE_ALL_FILTER_STATUS":r.filter.statuses=[];break;default:return r}}const fn=r=>({type:"ADD_SELECTED_ITEM",payload:r}),mn=r=>({type:"REMOVE_SELECTED_ITEM",payload:r}),ui=()=>({type:"REMOVE_ALL_SELECTED_ITEMS",payload:{}}),di=r=>({type:"ADD_FILTER_STATUS",payload:r}),hi=r=>({type:"REMOVE_FILTER_STATUS",payload:r}),pi=r=>({type:"ADD_FILTER_TOKEN",payload:r}),fi=r=>({type:"REMOVE_FILTER_TOKEN",payload:r});globalThis.jotaiAtomCache=globalThis.jotaiAtomCache||{cache:new Map,get(r,n){return this.cache.has(r)?this.cache.get(r):(this.cache.set(r,n),n)}};const mi={merge:{selectedItemIds:[],max:2},filter:{tokens:[],statuses:[]}},xn=A.createContext({});function xi({children:r}){const[n,c]=zn(li,mi);return i.jsx(xn.Provider,{value:{...n,dispatch:c},children:r})}const it=()=>A.useContext(xn),gi=Ie(i.jsx("circle",{cx:"12",cy:"12",r:"8"}),"FiberManualRecord");globalThis.jotaiAtomCache=globalThis.jotaiAtomCache||{cache:new Map,get(r,n){return this.cache.has(r)?this.cache.get(r):(this.cache.set(r,n),n)}};var ke=(r=>(r.LOCKING="Locked",r.RELEASED="Released",r))(ke||{});const Qt=r=>r<new Date().getTime();function gt(r,n){const[c,l]=A.useState(()=>Qt(r)?"Released":"Locked");return A.useEffect(()=>{const h=setInterval(()=>{const f=Qt(r);l(f?"Released":"Locked"),f&&h&&clearInterval(h)},n);return()=>clearInterval(h)},[r,n]),c}globalThis.jotaiAtomCache=globalThis.jotaiAtomCache||{cache:new Map,get(r,n){return this.cache.has(r)?this.cache.get(r):(this.cache.set(r,n),n)}};function Pt(r){const{endTime:n,refreshDuration:c=6e4,...l}=r,h=gt(n,c);return i.jsxs(S,{sx:{display:"flex",alignItems:"center"},color:h===ke.LOCKING?"success.main":"warning.main",...l,children:[i.jsx(gi,{fontSize:"small"}),"Â ",h]})}globalThis.jotaiAtomCache=globalThis.jotaiAtomCache||{cache:new Map,get(r,n){return this.cache.has(r)?this.cache.get(r):(this.cache.set(r,n),n)}};function vt({data:r}){return i.jsxs(T,{sx:{borderWidth:1,borderStyle:"solid",borderColor:"secondary.dark",borderRadius:2.5,bgcolor:"background.secondary"},children:[i.jsx(T,{sx:{p:1.5,borderBottomWidth:1,borderBottomColor:"secondary.dark",borderBottomStyle:"solid"},children:i.jsx(S,{align:"center",variant:"subtitle1",children:"veTravaNFT"})}),i.jsxs(T,{p:2,children:[i.jsxs(T,{sx:{display:"flex",justifyContent:"space-between",alignItems:"baseline"},children:[i.jsx(S,{children:"ID"}),i.jsx(S,{children:r.id})]}),i.jsxs(T,{sx:{display:"flex",justifyContent:"space-between",alignItems:"baseline",mt:2},children:[i.jsx(S,{children:"Status"}),i.jsx(Pt,{endTime:r.endTime})]}),i.jsxs(T,{sx:{display:"flex",justifyContent:"space-between",alignItems:"baseline",mt:2},children:[i.jsx(S,{children:"Voting Power"}),i.jsx(S,{variant:"subtitle1",color:"primary.main",children:re(r.votingPower,{fractionDigits:2})})]}),i.jsxs(T,{sx:{display:"flex",justifyContent:"space-between",alignItems:"baseline",mt:2},children:[i.jsx(S,{children:"Unlock"}),i.jsx(S,{children:Be(r.endTime).format("MM/DD/YYYY")})]}),i.jsxs(T,{sx:{display:"flex",justifyContent:"space-between",alignItems:"baseline",mt:2},children:[i.jsx(S,{children:"Balance"}),i.jsxs(S,{sx:{display:"flex",alignItems:"center"},children:[re(r.balance,{fractionDigits:2}),"Â ",i.jsx(nt,{color:"primary",fontSize:"small"})]})]})]})]})}globalThis.jotaiAtomCache=globalThis.jotaiAtomCache||{cache:new Map,get(r,n){return this.cache.has(r)?this.cache.get(r):(this.cache.set(r,n),n)}};function yi(r){const{dispatch:n,merge:{selectedItemIds:c}}=it(),[l,h]=A.useState(0),[f,d]=A.useState(!1),a=Bt(v=>v.breakpoints.down("xsm")),{contractAddresses:y}=ue(),{data:b,fetch:w}=me(),x=A.useMemo(()=>c.length<2?[]:[b.veNFTList[c[0]],b.veNFTList[c[1]]],[c,b.veNFTList]),j=A.useMemo(()=>
16{if(x.length<2)return;const[v,_]=x;if(!v||!_)return;const C=Math.max(v.endTime,_.endTime),F=O(v.balance).plus(_.balance).toString();return{..._,endTime:C,votingPower:Ze(F,(C-new Date().getTime())/1e3),amount:O(v.amount).plus(_.amount).toString(),rewardAmount:O(v.rewardAmount).plus(_.rewardAmount).toString(),balance:F}},[x]),m=()=>{if(x.some(v=>v.endTime<new Date().getTime()))throw new Error("Cannot merge veTravaNFTs with Released status");if(x.some(v=>v.token!==x[0].token))throw new Error("Cannot merge veTravaNFTs of different type")},E=()=>{try{m()}catch(v){H.error(v.message),h(0);return}h(1)},I=()=>{h(0)},D=()=>{h(2)},R=()=>{h(1)},k=async()=>{h(1),d(!0);const v=H.info(i.jsx(Ye,{}),{autoClose:!1});try{if(!y.VE_TRAVA_ADDRESS)throw new Error("Cannot retrieve contract address");const _=await Oe(X,{address:y.VE_TRAVA_ADDRESS,abi:ce,functionName:"merge",args:[BigInt(c[0]),BigInt(c[1])]});await ze(X,{hash:_}),h(0),H.dismiss(v),H.success(i.jsx(Ke,{message:"Merge successfully",txHash:_}),{autoClose:3e3}),n(ui()),w()}catch(_){console.error(_),H.dismiss(v),H.error(i.jsx(qe,{error:String(_)}))}d(!1)};return i.jsxs(A.Fragment,{children:[i.jsx(fe,{...r,variant:"contained",color:"primary",startIcon:i.jsx(Wt,{}),onClick:E,disabled:c.length<2,children:"Merge"}),i.jsx(rt,{placement:"top",title:"You can merge 2 veTravaNFTs together while preserving your voting power & rewards.",children:i.jsx(tr,{color:"secondary",sx:{verticalAlign:"middle",ml:1}})}),i.jsxs(ut,{maxWidth:"xs",open:l===1,fullWidth:!0,"aria-labelledby":"merge-veTravaNFT-dialog-title",children:[i.jsx(Rt,{onClose:I,id:"merge-veTravaNFT-dialog-title",children:i.jsx(S,{color:"primary",variant:"h4",children:"Merge"})}),i.jsxs(dt,{children:[i.jsx(S,{sx:{mb:2},color:"error.main",variant:"body3",children:"* The unclaimed reward will be lost when merge 2 veTravaNFTs"}),i.jsxs(ye,{container:!0,spacing:3,children:[i.jsx(ye,{size:{xs:a?12:"auto"},children:x[0]&&i.jsx(vt,{data:x[0]})}),i.jsx(ye,{size:{xs:a?12:"grow"},children:i.jsx(T,{sx:{display:"flex",alignItems:"center",justifyContent:"center",height:"100%"},children:i.jsx(T,{sx:{display:"flex",alignItems:"center",justifyContent:"center",borderWidth:1,borderStyle:"solid",borderColor:"secondary.dark",borderRadius:"50%",width:58,height:58,bgcolor:"background.secondary"},children:i.jsx(Wt,{fontSize:"large",color:"primary",sx:{transform:a?"rotate(90deg)":"none"}})})})}),i.jsx(ye,{size:{xs:a?12:"auto"},children:x[1]&&i.jsx(vt,{data:x[1]})})]}),i.jsx(T,{sx:{width:200,margin:"auto",mt:3},children:i.jsx(fe,{fullWidth:!0,size:"large",variant:"contained",color:"primary",onClick:D,loading:f,disabled:f,children:"Merge"})})]})]}),i.jsxs(ut,{open:l===2,maxWidth:"xs",fullWidth:!0,"aria-labelledby":"confirm-merge-veTravaNFT-dialog-title",children:[i.jsx(Rt,{id:"confirm-merge-veTravaNFT-dialog-title",onClose:I,children:i.jsx(S,{color:"primary",variant:"h4",children:"Merge Result Preview"})}),i.jsxs(dt,{children:[j&&i.jsx(vt,{data:j}),i.jsxs(T,{sx:{display:"flex",mt:2},children:[i.jsx(fe,{fullWidth:!0,variant:"outlined",color:"primary",onClick:R,children:"Cancel"}),i.jsx(T,{px:2}),i.jsx(fe,{fullWidth:!0,variant:"contained",color:"primary",onClick:k,children:"Confirm"})]})]})]})]})}const gn=Ie(i.jsx("path",{d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2m1 17h-2v-2h2zm2.07-7.75-.9.92C13.45 12.9 13 13.5 13 15h-2v-.5c0-1.1.45-2.1 1.17-2.83l1.24-1.26c.37-.36.59-.86.59-1.41 0-1.1-.9-2-2-2s-2 .9-2 2H8c0-2.21 1.79-4 4-4s4 1.79 4 4c0 .88-.36 1.68-.93 2.25"}),"Help"),yn=Ie(i.jsx("path",{d:"M19 19H5V5h7V3H5c-1.11 0-2 .9-2 2v14c0 1.1.89 2 2 2h14c1.1 0 2-.9 2-2v-7h-2zM14 3v2h3.59l-9.83 9.83 1.41 1.41L19 6.41V10h2V3z"}),"Launch");globalThis.jotaiAtomCache=globalThis.jotaiAtomCache||{cache:new Map,get(r,n){return this.cache.has(r)?this.cache.get(r):(this.cache.set(r,n),n)}};function wi(r){const{dispatch:n,filter:c}=it(),[l,h]=A.useState(null),f=m=>{h(m.currentTarget)},d=()=>{h(null)},a=!!l,y=a?"simple-popover":void 0,b=[{title:"Tokens",data:["TRAVA","rTRAVA","TRAVA/BNB"]}],w=[{title:"Status",data:["Locked","Released"]}],x=m=>{c.tokens.includes(m)?n(fi({item:m})):n(pi({item:m}))},j=m=>{c.statuses.includes(m)?n(hi({item:m})):n(di({item:m}))};return i.jsxs(T,{children:[i.jsx(fe,{"aria-describedby":y,...r,variant:"text",size:"large",startIcon:i.jsx(rr,{}),onClick:f,children:"Filters"}),i.jsx(ir,{id:y,open:a,anchorEl:l,onClose:d,anchorOrigin:{vertical:"bottom",horizontal:"right"},transformOrigin:{vertical:"top",horizontal:"right"},sx:{cursor:"pointer"},children:i.jsxs(T,{children:[b.map((m,E)=>i.jsxs(T,{pt:1,px:2,children:[i.jsx(S,{fontSize:"16px",fontWeight:500,color:"primary",children:m.title}),i.jsx(Ht,{children:m.data.map((I,D)=>i.jsx(Gt,{sx:{padding:"6px"},children:i.jsxs(T,{width:120,display:"flex",justifyContent:"space-between",alignItems:"center",onClick:()=>x(I),children:[i.jsx(T,{children:i.jsx(S,{fontSize:"12px",sx:{color:c.tokens.includes(I)?"text.primary":"text.secondary"},children:I})}),i.jsx(T,{display:"flex",justifyContent:"space-between",alignItems:"center",children:c.tokens.includes(I)?i.jsx(Yt,{sx:{color:"#0c7ee3"},fontSize:"small"}):null})]})},D))})]},E)),w.map((m,E)=>i.jsxs(T,{pt:1,px:2,children:[i.jsx(S,{fontSize:"16px",fontWeight:500,color:"primary",children:m.title}),i.jsx(Ht,{children:m.data.map((I,D)=>i.jsx(Gt,{sx:{padding:"6px"},children:i.jsxs(T,{width:120,display:"flex",justifyContent:"space-between",alignItems:"center",onClick:()=>j(I),children:[i.jsx(T,{children:i.jsx(S,{fontSize:"12px",sx:{color:c.statuses.includes(I)?"text.primary":"text.secondary"},children:I})}),i.jsx(T,{display:"flex",justifyContent:"space-between",alignItems:"center",children:c.statuses.includes(I)?i.jsx(Yt,{sx:{color:"#0c7ee3"},fontSize:"small"}):null})]})},D))})]},E))]})})]})}globalThis.jotaiAtomCache=globalThis.jotaiAtomCache||{cache:new Map,get(r,n){return this.cache.has(r)?this.cache.get(r):(this.cache.set(r,n),n)}};function bi(){const r=Bt(n=>n.breakpoints.down("xsm"));return i.jsxs(T,{sx:{display:"flex",justifyContent:"space-between"},children:[i.jsxs(T,{children:[i.jsx(ci,{iconOnly:r,sx:{mr:{xs:2,xsm:4}}}),i.jsx(yi,{iconOnly:r})]}),i.jsx(T,{children:i.jsx(wi,{iconOnly:r})})]})}globalThis.jotaiAtomCache=globalThis.jotaiAtomCache||{cache:new Map,get(r,n){return this.cache.has(r)?this.cache.get(r):(this.cache.set(r,n),n)}};const wn=A.createContext({});function Ti({children:r}){const n=pt("tokenPrices",{}),{assign:c}=Ge(),{contractAddresses:l}=ue(),{getTokenRatio:h}=ft(),f=async()=>{try{const[d,a]=await Promise.all([Kn.get("https://scoringapi.trava.finance/supply/app/v0.1/trava-price").then(b=>b.data.price_usd),h(l.TRAVA_BNB_TOKEN_ADDRESS)]),y=O(d).times(a).toString();c("tokenPrices",{[l.TRAVA_TOKEN_ADDRESS.toLowerCase()]:d,[l.RTRAVA_TOKEN_ADDRESS.toLowerCase()]:d,[l.TRAVA_BNB_TOKEN_ADDRESS.toLowerCase()]:y,trava:d,rtrava:d,travaBnb:y})}catch(d){console.error(d)}};return A.useEffect(()=>{l&&f()},[l]),i.jsx(wn.Provider,{value:{prices:n},children:r})}const bn=()=>A.useContext(wn);globalThis.jotaiAtomCache=globalThis.jotaiAtomCache||{cache:new Map,get(r,n){return this.cache.has(r)?this.cache.get(r):(this.cache.set(r,n),n)}};function Ai(r){const{dispatch:n,merge:c}=it(),{id:l,votingPower:h,balance:f,unlockTime:d,reward:a,tokenSymbol:y,sx:b,...w}=r,x=m=>{if(m.target.checked&&c.selectedItemIds.length===c.max){H.info(`Cannot select more than ${c.max}`);return}m.target.checked?n(fn({id:l})):n(mn({id:l}))},j={display:"flex",justifyContent:"space-between",alignItems:"baseline",mb:1};return i.jsxs(tt,{sx:{p:2,borderBottomLeftRadius:0,borderBottomRightRadius:0,...b},...w,children:[i.jsx(dn,{sx:{ml:-1},inputProps:{"aria-label":"ve trava checkbox item"},onChange:x,onClick:m=>m.stopPropagation(),checked:c.selectedItemIds.includes(l)}),i.jsxs(T,{sx:{...j},children:[i.jsx(S,{color:"text.secondary",children:"ID"}),i.jsx(S,{children:l})]}),i.jsxs(T,{sx:j,children:[i.jsx(S,{color:"text.secondary",children:"Status"}),i.jsx(Pt,{endTime:d})]}),i.jsxs(T,{sx:j,children:[i.jsx(S,{color:"text.secondary",children:"Voting Power"}),i.jsx(S,{children:re(h,{fractionDigits:2})})]}),i.jsxs(T,{sx:j,children:[i.jsx(S,{color:"text.secondary",children:"Balance"}),i.jsxs(S,{children:[re(f,{fractionDigits:2})," ",y]})]}),i.jsxs(T,{sx:j,children:[i.jsx(S,{color:"text.secondary",children:"Unlock Time"}
16),i.jsx(S,{children:i.jsx(rt,{title:new Date(d).toLocaleString(),placement:"top",children:i.jsx("span",{children:Ve(d)?new Date(d).toLocaleDateString():"---"})})})]}),i.jsxs(T,{sx:j,children:[i.jsx(S,{color:"text.secondary",children:"Reward"}),i.jsxs(S,{sx:{display:"flex",alignItems:"center"},children:[i.jsx(nt,{color:"primary"}),"Â ",re(a,{fractionDigits:2})]})]})]})}globalThis.jotaiAtomCache=globalThis.jotaiAtomCache||{cache:new Map,get(r,n){return this.cache.has(r)?this.cache.get(r):(this.cache.set(r,n),n)}};function Tn(r){const{id:n,endTime:c,balance:l,claimedReward:h,votingPower:f,token:d,tokenSymbol:a,tokenRatio:y}=r,b=mt(),[w,x]=A.useState(0),[j,m]=A.useState(!0),[E,I]=A.useState(!1),D=A.useMemo(()=>O(w).plus(l).toString(),[w,l]),R=A.useMemo(()=>O(w).plus(l).times(y).plus(h).toString(),[w,l,y,h]),k=gt(c,6e4),{address:v}=Le(),_=A.useMemo(()=>Object.keys(b),[b]),{balances:C,loading:F,refresh:M}=pn(v,_),{getToken:ee,handleTokenApprove:ie}=Ft(),{updateVeNFT:L}=me(),{contractAddresses:J}=ue(),W=()=>C[d.toLowerCase()]??0,Z=async U=>{U.preventDefault(),I(!0);const P=H.info(i.jsx(Ye,{}),{autoClose:!1});try{if(!J.VE_TRAVA_ADDRESS)throw new Error("Cannot retrieve contract address");const z=await ee(d);await ie(d,J.VE_TRAVA_ADDRESS,w,1e9);const te=O(w).times(O(10).pow(z.decimals)).toFixed(0),he=await Oe(X,{address:J.VE_TRAVA_ADDRESS,abi:ce,functionName:"increase_amount",args:[BigInt(n),BigInt(te)]});await ze(X,{hash:he}),H.dismiss(P),H.success(i.jsx(Ke,{message:"Increase lock balance successfully",txHash:he}),{autoClose:3e3}),L(n)}catch(z){console.error(z),H.dismiss(P),H.error(i.jsx(qe,{error:String(z)}))}finally{M()}I(!1)},N=(U,P)=>{x(U),m(P)};return i.jsxs(T,{children:[i.jsx(S,{variant:"subtitle1",children:"Increase Lock Balance"}),i.jsx(T,{mt:1,children:i.jsxs("form",{onSubmit:Z,noValidate:!0,children:[i.jsx(Mt,{id:`lock-amount-inp-${n}`,value:w,max:W(),token:d.toLowerCase(),fixedToken:!0,onAmountChange:N,enableMaxAmount:!0}),i.jsx(T,{mt:1,children:i.jsx(fe,{type:"submit",size:"large",color:"primary",variant:"contained",fullWidth:!0,loading:E,disabled:k===ke.RELEASED||!j||E||F,children:"Lock Balance"})})]})}),i.jsxs(T,{mt:2,children:[i.jsxs(T,{sx:{display:"flex",alignItems:"center",justifyContent:"space-between"},children:[i.jsx(S,{color:"secondary.main",children:"Balance"}),i.jsxs(S,{children:[re(D,{fractionDigits:2}),"Â ",a]})]}),i.jsxs(T,{sx:{mt:1,display:"flex",alignItems:"center",justifyContent:"space-between"},children:[i.jsx(S,{color:"secondary.main",children:"Unlock"}),i.jsx(S,{children:Be(c).format("MM/DD/YYYY")})]}),i.jsx(Dt,{sx:{my:2}}),i.jsxs(T,{sx:{display:"flex",alignItems:"center",justifyContent:"space-between"},children:[i.jsx(S,{color:"secondary.main",children:"Voting Power"}),i.jsxs(T,{sx:{display:"flex",alignItems:"center"},children:[i.jsx(S,{component:"span",children:re(f,{fractionDigits:2,padZero:!0})}),"Â ",i.jsx(Lt,{fontSize:"small"}),"Â ",i.jsx(S,{component:"span",variant:"h4",color:"primary.main",children:i.jsx(xt,{amount:R,unlockTime:c})})]})]})]})]})}globalThis.jotaiAtomCache=globalThis.jotaiAtomCache||{cache:new Map,get(r,n){return this.cache.has(r)?this.cache.get(r):(this.cache.set(r,n),n)}};function An(r){const{id:n,endTime:c,balance:l,claimedReward:h,votingPower:f,tokenSymbol:d,tokenRatio:a}=r,{updateVeNFT:y}=me(),[b,w]=A.useState(()=>Ee.slice(-1)[0].key),[x,j]=A.useState(!1),[m,E]=A.useState(!0),I=A.useMemo(()=>Se(Math.floor(new Date().getTime()/1e3),Number(b))*1e3,[b]),D=A.useMemo(()=>O(l).times(a).plus(h).toString(),[l,a,h]),R=gt(c,6e4),{contractAddresses:k}=ue(),v=async C=>{C.preventDefault(),j(!0);const F=H.info(i.jsx(Ye,{}),{autoClose:!1});try{if(!k.VE_TRAVA_ADDRESS)throw new Error("Cannot retrieve contract address");const M=await Oe(X,{address:k.VE_TRAVA_ADDRESS,abi:ce,functionName:"increase_unlock_time",args:[BigInt(n),BigInt(b)]});await ze(X,{hash:M}),H.dismiss(F),H.success(i.jsx(Ke,{message:"Change unlock time successfully",txHash:M}),{autoClose:3e3}),y(n)}catch(M){console.error(M),H.dismiss(F),H.error(i.jsx(qe,{error:String(M)}))}j(!1)},_=(C,F)=>{w(C),E(F)};return i.jsxs(T,{children:[i.jsx(S,{variant:"subtitle1",children:"Change Unlock Time"}),i.jsx(T,{mt:1,children:i.jsxs("form",{onSubmit:v,noValidate:!0,children:[i.jsx(Nt,{id:`t
16ime-lock-select-${n}`,options:Ee,disableTimeRange:!0,value:b,onChange:_,minTime:c/1e3}),i.jsx(T,{mt:1,children:i.jsx(fe,{type:"submit",size:"large",color:"primary",variant:"contained",fullWidth:!0,loading:x,disabled:R===ke.RELEASED||x||!m,children:"Lock Time"})})]})}),i.jsxs(T,{mt:2,children:[i.jsxs(T,{sx:{display:"flex",alignItems:"center",justifyContent:"space-between"},children:[i.jsx(S,{color:"secondary.main",children:"Balance"}),i.jsxs(S,{children:[re(l,{fractionDigits:2})," ",d]})]}),i.jsxs(T,{sx:{mt:1,display:"flex",alignItems:"center",justifyContent:"space-between"},children:[i.jsx(S,{color:"secondary.main",children:"Unlock"}),i.jsx(S,{children:Be(I).format("MM/DD/YYYY")})]}),i.jsx(Dt,{sx:{my:2}}),i.jsxs(T,{sx:{display:"flex",alignItems:"center",justifyContent:"space-between"},children:[i.jsx(S,{color:"secondary.main",children:"Voting Power"}),i.jsxs(T,{sx:{display:"flex",alignItems:"center"},children:[i.jsx(S,{component:"span",children:re(f,{fractionDigits:2,padZero:!0})})," ",i.jsx(Lt,{fontSize:"small"})," ",i.jsx(S,{component:"span",variant:"h4",color:"primary.main",children:i.jsx(xt,{amount:D,unlockTime:I})})]})]})]})]})}globalThis.jotaiAtomCache=globalThis.jotaiAtomCache||{cache:new Map,get(r,n){return this.cache.has(r)?this.cache.get(r):(this.cache.set(r,n),n)}};function jn(r){const{tokenId:n,rewardAmount:c,rewardAmountUSD:l,...h}=r,[f,d]=A.useState(!1),{updateVeNFT:a}=me(),{contractAddresses:y}=ue(),b=async()=>{d(!0);const w=H.info(i.jsx(Ye,{}),{autoClose:!1});try{if(!y.INCENTIVE_VAULT_ADDRESS)throw new Error("Cannot retrieve contract addresss");const x=await Oe(X,{address:y.INCENTIVE_VAULT_ADDRESS,abi:pe,functionName:"claim",args:[BigInt(n)]});await ze(X,{hash:x}),H.dismiss(w),H.success(i.jsx(Ke,{message:"Claim successfully",txHash:x}),{autoClose:3e3}),a(n)}catch(x){console.error(x),H.dismiss(w),H.error(i.jsx(qe,{error:String(x)}))}};return i.jsxs(T,{...h,children:[i.jsxs(S,{variant:"subtitle1",sx:{display:"flex",alignItems:"center"},children:["Compoundable Rewards  ",i.jsx(rt,{placement:"top",title:"veTrava holders get rewards in TRAVA, which are emitted per week.",children:i.jsx(gn,{color:"secondary"})})]}),i.jsxs(T,{sx:{pt:1,pb:2,display:"flex",justifyContent:"space-between"},children:[i.jsxs(T,{children:[i.jsxs(S,{variant:"h5",color:"secondary.light",sx:{display:"flex",alignItems:"center"},children:[i.jsx(nt,{color:"primary"})," ",re(c,{fractionDigits:2})]}),i.jsxs(S,{variant:"body3",color:"secondary.light",children:["~ ",re(l,{fractionDigits:4,prefix:"$"})]})]}),i.jsx(T,{width:96,children:i.jsx(fe,{fullWidth:!0,variant:"outlined",color:"primary",onClick:b,loading:f,disabled:f||O(c).eq(0),children:"Compound"})})]})]})}globalThis.jotaiAtomCache=globalThis.jotaiAtomCache||{cache:new Map,get(r,n){return this.cache.has(r)?this.cache.get(r):(this.cache.set(r,n),n)}};function ji(r){const{text:n,onOk:c,onClose:l,children:h,...f}=r,d=()=>{l&&typeof l=="function"&&l({}),c&&typeof c=="function"&&c()};return i.jsxs(ut,{maxWidth:"xs",...f,children:[i.jsx(dt,{sx:{pb:2},children:h||n}),i.jsxs(Hr,{children:[i.jsx(Qe,{variant:"outlined",onClick:l,size:"small",children:"Cancel"}),i.jsx(Qe,{variant:"contained",color:"primary",onClick:d,size:"small",children:"Ok"})]})]})}globalThis.jotaiAtomCache=globalThis.jotaiAtomCache||{cache:new Map,get(r,n){return this.cache.has(r)?this.cache.get(r):(this.cache.set(r,n),n)}};function Sn(r){const{tokenId:n,endTime:c,lockedBalance:l,lockedBalanceUSD:h,tokenSymbol:f,unclaimedReward:d,...a}=r,[y,b]=A.useState(!1),[w,x]=A.useState(!1),j=gt(c,6e4*2),{contractAddresses:m}=ue(),{removeVeNFT:E}=me(),I=async()=>{x(!0);const k=H.info(i.jsx(Ye,{}),{autoClose:!1});try{if(!m.VE_TRAVA_ADDRESS)throw new Error("Cannot retrieve contract address");const v=await Oe(X,{address:m.VE_TRAVA_ADDRESS,abi:ce,functionName:"withdraw",args:[BigInt(n)]});await ze(X,{hash:v}),H.dismiss(k),H.success(i.jsx(Ke,{message:"Withdraw successfully",txHash:v}),{autoClose:3e3}),E(n)}catch(v){console.error(v),H.dismiss(k),H.error(i.jsx(qe,{error:String(v)}))}x(!1)},D=()=>{O(d).eq(0)?(b(!1),I()):b(!0)},R=()=>{b(!1)};return i.jsxs(A.Fragment,{children:[i.jsxs(T,{...a,children:[i.jsxs(S,{variant:"subtitle1",sx:{dis
16play:"flex",alignItems:"center"},children:["Locked Balance  ",i.jsx(rt,{placement:"top",title:"Total locked balance in this veTravaNFT, including locked tokens & incentive rewards.",children:i.jsx(gn,{color:"secondary"})})]}),i.jsxs(T,{sx:{pt:1,pb:2,display:"flex",justifyContent:"space-between"},children:[i.jsxs(T,{children:[i.jsxs(S,{variant:"h5",color:"secondary.light",children:[re(l,{fractionDigits:2})," ",f]}),i.jsxs(S,{variant:"body3",color:"secondary.light",children:["~ ",re(h,{fractionDigits:4,prefix:"$"})]})]}),i.jsx(T,{width:96,children:i.jsx(fe,{fullWidth:!0,variant:"outlined",color:"primary",onClick:D,loading:w,disabled:w||j===ke.LOCKING,children:"Withdraw"})})]})]}),i.jsx(ji,{open:y,onClose:R,onOk:I,children:i.jsxs(S,{gutterBottom:!0,color:"text.secondary",sx:{lineHeight:1.5},children:["The unclaimed reward will be lost after withdrawal.",i.jsx("br",{}),"Are you sure you want to do it?"]})})]})}globalThis.jotaiAtomCache=globalThis.jotaiAtomCache||{cache:new Map,get(r,n){return this.cache.has(r)?this.cache.get(r):(this.cache.set(r,n),n)}};function En(r){const{rewardAmount:n,rewardAmountUSD:c,...l}=r;return i.jsxs(T,{...l,children:[i.jsx(S,{variant:"subtitle1",sx:{display:"flex",alignItems:"center"},children:"Compounded Rewards"}),i.jsxs(T,{sx:{pt:1},children:[i.jsxs(S,{variant:"h5",color:"secondary.light",sx:{display:"flex",alignItems:"center"},children:[i.jsx(nt,{color:"primary"})," ",re(n,{fractionDigits:2})]}),i.jsxs(S,{variant:"body3",color:"secondary.light",children:["~ ",re(c,{fractionDigits:4,prefix:"$"})]})]})]})}globalThis.jotaiAtomCache=globalThis.jotaiAtomCache||{cache:new Map,get(r,n){return this.cache.has(r)?this.cache.get(r):(this.cache.set(r,n),n)}};function Si(r){const[n,c]=A.useState(!1),{data:l,...h}=r,{prices:f}=bn(),{chainId:d}=ue(),{contractAddresses:a}=ue(),y=()=>{c(!n)};return i.jsx(ye,{...h,children:i.jsxs(tt,{sx:{bgcolor:"background.secondary",overflow:"hidden"},children:[i.jsx(Ai,{sx:{...n?{bgcolor:"action.selected"}:{}},id:l.id,votingPower:l.votingPower,balance:l.balance,unlockTime:l.endTime,reward:l.reward,tokenSymbol:l.tokenSymbol}),i.jsx(ht,{in:n,unmountOnExit:!0,children:i.jsxs(T,{p:2,children:[i.jsx(T,{children:i.jsx(Tn,{id:l.id,endTime:l.endTime,balance:l.balance,claimedReward:l.rewardAmount,votingPower:l.votingPower,token:l.token,tokenSymbol:l.tokenSymbol,tokenRatio:l.tokenRatio})}),i.jsx(T,{mt:4,children:i.jsx(An,{id:l.id,endTime:l.endTime,balance:l.balance,claimedReward:l.rewardAmount,votingPower:l.votingPower,tokenSymbol:l.tokenSymbol,tokenRatio:l.tokenRatio})}),i.jsxs(T,{mt:4,children:[i.jsx(jn,{tokenId:l.id,rewardAmount:l.claimable,rewardAmountUSD:He(l.claimable,f.trava)}),i.jsx(Sn,{mt:1,tokenId:l.id,endTime:l.endTime,lockedBalance:l.amount,lockedBalanceUSD:He(l.amount,f[l.token.toLowerCase()]),unclaimedReward:l.claimable,tokenSymbol:l.tokenSymbol}),i.jsx(En,{mt:1,rewardAmount:l.rewardAmount,rewardAmountUSD:He(l.rewardAmount,f.trava)}),i.jsx(T,{textAlign:"right",mt:1,children:i.jsxs(rn,{sx:{display:"inline-flex",alignItems:"center",textDecoration:"none","&:hover":{textDecoration:"underline"}},href:on(d,a.VE_TRAVA_ADDRESS),rel:"noreferrer noopener",target:"_blank",color:"primary",children:["Contract  ",i.jsx(yn,{fontSize:"small"})]})})]})]})}),i.jsx(T,{onClick:y,sx:{p:1,display:"flex",justifyContent:"center",alignItems:"center",bgcolor:b=>b.palette.mode==="dark"?"#002147":"#EDF5FF"},children:i.jsx(_t,{fontSize:"large",sx:{transition:"250ms transform linear",...n?{transform:"rotate(180deg)"}:{}}})})]})})}globalThis.jotaiAtomCache=globalThis.jotaiAtomCache||{cache:new Map,get(r,n){return this.cache.has(r)?this.cache.get(r):(this.cache.set(r,n),n)}};function Ei({data:r}){return i.jsx(ye,{container:!0,spacing:3,children:r.map(n=>i.jsx(Si,{data:n,size:{xs:12,sm:6}},n.id))})}globalThis.jotaiAtomCache=globalThis.jotaiAtomCache||{cache:new Map,get(r,n){return this.cache.has(r)?this.cache.get(r):(this.cache.set(r,n),n)}};function Ci(r){const{dispatch:n,merge:c}=it(),{id:l,votingPower:h,balance:f,unlockTime:d,reward:a,tokenSymbol:y,...b}=r,w=j=>{if(j.target.checked&&c.selectedItemIds.length===c.max){H.info(`Cannot select more than ${c.max}`);return}j.target.checked?n(fn({id:l})):n(mn({id:l}))},x={flexBasis:100,flexGrow:1,display:"flex",flexDirection:"column",justifyContent:"center"};return i.jsxs(Ir,{id:String(l),...b,sx:{pl:1.5},expandIcon:i.jsx($n,{fontSize:"large"}),children:[i.jsx(T,{sx:{width:60,display:"flex",alignItems:"center"},children:i.jsx(dn,{inputProps:{"aria-label":"ve trava checkbox item"},onChange:w,onClick:j=>j.stopPropagation(),checked:c.selectedItemIds.includes(l)})}),i.jsxs(T,{sx:{...x,flexGrow:0,minWidth:60,width:"12%"},children:[i.jsx(S,{variant:"body3",color:"text.secondary",gutterBottom:!0,children:"ID"}),i.jsx(S,{variant:"body1",children:l})]}),i.jsxs(T,{sx:x,children:[i.jsx(S,{variant:"body3",color:"text.secondary",gutterBottom:!0,children:"Status"}),i.jsx(Pt,{endTime:d})]}),i.jsxs(T,{sx:x,children:[i.jsx(S,{variant:"body3",color:"text.secondary",gutterBottom:!0,children:"Voting Power"}),i.jsx(S,{variant:"body1",children:re(h,{fractionDigits:2})})]}),i.jsxs(T,{sx:x,children:[i.jsx(S,{variant:"body3",color:"text.secondary",gutterBottom:!0,children:"Balance"}
16),i.jsxs(S,{variant:"body1",sx:{display:"flex",alignItems:"center"},children:[re(f,{fractionDigits:2})," ",y]})]}),i.jsxs(T,{sx:x,children:[i.jsx(S,{variant:"body3",color:"text.secondary",gutterBottom:!0,children:"Unlock Time"}),i.jsx(S,{variant:"body1",display:"inline",children:i.jsx(rt,{title:new Date(d).toLocaleString(),placement:"top",children:i.jsx("span",{children:Ve(d)?new Date(d).toLocaleDateString():"---"})})})]}),i.jsxs(T,{sx:x,children:[i.jsx(S,{variant:"body3",color:"text.secondary",gutterBottom:!0,children:"Reward"}),i.jsxs(S,{variant:"body1",sx:{display:"flex",alignItems:"center"},children:[i.jsx(nt,{color:"primary"})," ",re(a,{fractionDigits:2})]})]})]})}globalThis.jotaiAtomCache=globalThis.jotaiAtomCache||{cache:new Map,get(r,n){return this.cache.has(r)?this.cache.get(r):(this.cache.set(r,n),n)}};function Ii(r){const{data:n}=r,{prices:c}=bn(),{contractAddresses:l}=ue(),{chainId:h}=ue();return i.jsxs(gr,{sx:{mb:2},slotProps:{transition:{unmountOnExit:!0}},children:[i.jsx(Ci,{id:n.id,votingPower:n.votingPower,balance:n.balance,unlockTime:n.endTime,reward:n.reward,tokenSymbol:n.tokenSymbol}),i.jsxs(Tr,{sx:{display:"flex",justifyContent:"space-between",pb:2},children:[i.jsx(T,{sx:{flexBasis:"34%"},children:i.jsx(Tn,{id:n.id,endTime:n.endTime,balance:n.balance,claimedReward:n.rewardAmount,votingPower:n.votingPower,token:n.token,tokenSymbol:n.tokenSymbol,tokenRatio:n.tokenRatio})}),i.jsx(T,{sx:{flexBasis:"34%"},children:i.jsx(An,{id:n.id,endTime:n.endTime,balance:n.balance,claimedReward:n.rewardAmount,votingPower:n.votingPower,tokenRatio:n.tokenRatio,tokenSymbol:n.tokenSymbol})}),i.jsxs(T,{sx:{flexBasis:"23%"},children:[i.jsx(jn,{tokenId:n.id,rewardAmount:n.claimable,rewardAmountUSD:He(n.claimable,c.trava)}),i.jsx(Sn,{mt:1,tokenId:n.id,endTime:n.endTime,lockedBalance:n.amount,lockedBalanceUSD:He(n.amount,c[n.token.toLowerCase()]),unclaimedReward:n.claimable,tokenSymbol:n.tokenSymbol}),i.jsx(En,{mt:1,rewardAmount:n.rewardAmount,rewardAmountUSD:He(n.rewardAmount,c.trava)}),i.jsx(T,{textAlign:"right",mt:1,children:i.jsxs(rn,{sx:{display:"inline-flex",alignItems:"center",textDecoration:"none","&:hover":{textDecoration:"underline"}},href:on(h,l.VE_TRAVA_ADDRESS),rel:"noreferrer noopener",target:"_blank",color:"primary",children:["Contract  ",i.jsx(yn,{fontSize:"small"})]})})]})]})]})}globalThis.jotaiAtomCache=globalThis.jotaiAtomCache||{cache:new Map,get(r,n){return this.cache.has(r)?this.cache.get(r):(this.cache.set(r,n),n)}};function vi({data:r}){return i.jsx(T,{children:r.map(n=>i.jsx(Ii,{data:n},n.id))})}globalThis.jotaiAtomCache=globalThis.jotaiAtomCache||{cache:new Map,get(r,n){return this.cache.has(r)?this.cache.get(r):(this.cache.set(r,n),n)}};function ki(){const{data:r}=me(),{filter:n}=it(),{contractAddresses:c}=ue(),l=Bt(a=>a.breakpoints.down("md"));function h({l:a}){const y=new Date().getTime();let b;return n.statuses.length===0||n.statuses.includes(ke.LOCKING)&&n.statuses.includes(ke.RELEASED)?a:(n.statuses.includes(ke.LOCKING)?b=a.filter(w=>w.endTime>y):b=a.filter(w=>w.endTime<=y),b)}function f({l:a}){if(n.tokens.length===0)return a;const y=n.tokens.map(w=>w==="TRAVA"?c.TRAVA_TOKEN_ADDRESS.toLowerCase():w==="rTRAVA"?c.RTRAVA_TOKEN_ADDRESS.toLowerCase():c.TRAVA_BNB_TOKEN_ADDRESS.toLowerCase());return a.filter(w=>y.includes(w.token.toLowerCase()))}const d=A.useMemo(()=>{let a=r!=null&&r.veNFTList?Object.values(r.veNFTList):[];return a=h({l:a}),a=f({l:a}),a},[r==null?void 0:r.veNFTList,n]);return i.jsx(Ti,{children:i.jsxs(T,{children:[d.length===0&&i.jsx(ar,{py:4}),d.length>0&&(l?i.jsx(Ei,{data:d}):i.jsx(vi,{data:d}))]})})}globalThis.jotaiAtomCache=globalThis.jotaiAtomCache||{cache:new Map,get(r,n){return this.cache.has(r)?this.cache.get(r):(this.cache.set(r,n),n)}};function Ri(){const{address:r}=Le(),{status:n,error:c,fetch:l}=me();return i.jsx(xi,{children:i.jsxs(T,{mt:3,children:[i.jsx(bi,{}),i.jsx(T,{mt:2,children:r?i.jsxs(i.Fragment,{children:[(n===G.IDLE||n===G.FETCHING)&&i.jsxs(T,{textAlign:"center",py:4,children:[i.jsx(sr,{size:50}),i.jsx(S,{color:"text.secondary",children:"Please wait a moment..."})]}
16),n===G.FAILED&&i.jsx(or,{title:"Failed to fetch data",detail:Wn(c),children:i.jsx(Qe,{variant:"contained",color:"primary",sx:{px:3},onClick:()=>l(),children:"Reload"})}),(n===G.SUCCESS||n===G.UPDATING)&&i.jsx(ki,{})]}):i.jsxs(T,{textAlign:"center",py:3,children:[i.jsx(Xn,{fontSize:"large",color:"secondary"}),i.jsx(S,{color:"secondary",children:"Please connect your wallet!"})]})})]})})}globalThis.jotaiAtomCache=globalThis.jotaiAtomCache||{cache:new Map,get(r,n){return this.cache.has(r)?this.cache.get(r):(this.cache.set(r,n),n)}};function Di(){const r=Hn();A.useEffect(()=>{r({data:{title:"Locker"}})},[r]);const{address:n}=Le(),{contractAddresses:c}=ue(),{fetch:l,refreshVeNFTList:h}=me(),f=A.useRef(h);return f.current=h,A.useEffect(()=>{c&&n&&l(!0)},[c,n]),A.useEffect(()=>{if(!n||!c)return;const d=setInterval(()=>{f.current()},3e4);return()=>clearInterval(d)},[c,n]),i.jsxs(ye,{container:!0,spacing:3,children:[i.jsx(ye,{size:{xs:12,md:5},children:i.jsx(ii,{})}),i.jsx(ye,{size:{xs:12,md:7},children:i.jsx(si,{})}),i.jsx(ye,{size:12,children:i.jsx(Ri,{})})]})}globalThis.jotaiAtomCache=globalThis.jotaiAtomCache||{cache:new Map,get(r,n){return this.cache.has(r)?this.cache.get(r):(this.cache.set(r,n),n)}};function Ki(){return i.jsx(ti,{children:i.jsx(Di,{})})}export{Ki as default};
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.