p.length-2?p.length-1:e.length-l;n>0;n--)if(void 0!==p[n])for(i=0;i0&&En)s.push(e);else{for(;n>=i&&!c||c&&i1)throw new r.Exception("Uncaught Syntax error");return o[0].value>1e15?"Infinity":parseFloat(o[0].value.toFixed(15))},r.eval=function(e,t,n){return void 0===t?this.lex(e).toPostfix().postfixEval():void 0!==n?this.lex(e,t).toPostfix().postfixEval(n):void 0!==t.length?this.lex(e,t).toPostfix().postfixEval():this.lex(e).toPostfix().postfixEval(t)},e.exports=r},38617:function(e,t,n){"use strict";n.d(t,{F:function(){return u},f:function(){return c}});var r=n(2784);let i=["light","dark"],o="(prefers-color-scheme: dark)",a="undefined"==typeof window,s=(0,r.createContext)(void 0),l={setTheme:e=>{},themes:[]},u=()=>{var e;return null!==(e=(0,r.useContext)(s))&&void 0!==e?e:l},c=e=>(0,r.useContext)(s)?r.createElement(r.Fragment,null,e.children):r.createElement(f,e),d=["light","dark"],f=({forcedTheme:e,disableTransitionOnChange:t=!1,enableSystem:n=!0,enableColorScheme:a=!0,storageKey:l="theme",themes:u=d,defaultTheme:c=n?"system":"light",attribute:f="data-theme",value:g,children:y,nonce:b})=>{let[x,w]=(0,r.useState)(()=>p(l,c)),[j,k]=(0,r.useState)(()=>p(l)),E=g?Object.values(g):u,S=(0,r.useCallback)(e=>{let r=e;if(!r)return;"system"===e&&n&&(r=v());let o=g?g[r]:r,s=t?m():null,l=document.documentElement;if("class"===f?(l.classList.remove(...E),o&&l.classList.add(o)):o?l.setAttribute(f,o):l.removeAttribute(f),a){let e=i.includes(c)?c:null,t=i.includes(r)?r:e;l.style.colorScheme=t}null==s||s()},[]),_=(0,r.useCallback)(e=>{w(e);try{localStorage.setItem(l,e)}catch(e){}},[e]),C=(0,r.useCallback)(t=>{let r=v(t);k(r),"system"===x&&n&&!e&&S("system")},[x,e]);(0,r.useEffect)(()=>{let e=window.matchMedia(o);return e.addListener(C),C(e),()=>e.removeListener(C)},[C]),(0,r.useEffect)(()=>{let e=e=>{e.key===l&&_(e.newValue||c)};return window.addEventListener("storage",e),()=>window.removeEventListener("storage",e)},[_]),(0,r.useEffect)(()=>{S(null!=e?e:x)},[e,x]);let O=(0,r.useMemo)(()=>({theme:x,setTheme:_,forcedTheme:e,resolvedTheme:"system"===x?j:x,themes:n?[...u,"system"]:u,systemTheme:n?j:void 0}),[x,_,e,j,n,u]);return r.createElement(s.Provider,{value:O},r.createElement(h,{forcedTheme:e,disableTransitionOnChange:t,enableSystem:n,enableColorScheme:a,storageKey:l,themes:u,defaultTheme:c,attribute:f,value:g,children:y,attrs:E,nonce:b}),y)},h=(0,r.memo)(({forcedTheme:e,storageKey:t,attribute:n,enableSystem:a,enableColorScheme:s,defaultTheme:l,value:u,attrs:c,nonce:d})=>{let f="system"===l,h="class"===n?`var d=document.documentElement,c=d.classList;c.remove(${c.map(e=>`'${e}'`).join(",")});`:`var d=document.documentElement,n='${n}',s='setAttribute';`,p=s?i.includes(l)&&l?`if(e==='light'||e==='dark'||!e)d.style.colorScheme=e||'${l}'`:"if(e==='light'||e==='dark')d.style.colorScheme=e":"",m=(e,t=!1,r=!0)=>{let o=u?u[e]:e,a=t?e+"|| ''":`'${o}'`,l="";return s&&r&&!t&&i.includes(e)&&(l+=`d.style.colorScheme = '${e}';`),"class"===n?l+=t||o?`c.add(${a})`:"null":o&&(l+=`d[s](n,${a})`),l},v=e?`!function(){${h}${m(e)}}()`:a?`!function(){try{${h}var e=localStorage.getItem('${t}');if('system'===e||(!e&&${f})){var t='${o}',m=window.matchMedia(t);if(m.media!==t||m.matches){${m("dark")}}else{${m("light")}}}else if(e){${u?`var x=${JSON.stringify(u)};`:""}${m(u?"x[e]":"e",!0)}}${f?"":"else{"+m(l,!1,!1)+"}"}${p}}catch(e){}}()`:`!function(){try{${h}var e=localStorage.getItem('${t}');if(e){${u?`var x=${JSON.stringify(u)};`:""}${m(u?"x[e]":"e",!0)}}else{${m(l,!1,!1)};}${p}}catch(t){}}();`;return r.createElement("script",{nonce:d,dangerouslySetInnerHTML:{__html:v}})},()=>!0),p=(e,t)=>{let n;if(!a){try{n=localStorage.getItem(e)||void 0}catch(e){}return n||t}},m=()=>{let e=document.createElement("style");return e.appendChild(document.createTextNode("*{-webkit-transition:none!important;-moz-transition:none!important;-o-transition:none!important;-ms-transition:none!important;transition:none!important}")),document.head.appendChild(e),()=>{window.getComputedStyle(document.body),setTimeout(()=>{document.head.removeChild(e)},1)}},v=e=>(e||(e=window.matchMedia(o)),e.matches?"dark":"light")},86570:function(e,t,n){(window.__NEXT_P=window.__NEXT_P||[]).push(["/_app",function(){return n(73221)}])},4941:function(e,t,n){"use strict";n.d(t,{Ul:function(){return s},WD:function(){return l},fu:function(){return c},o4:function(){return u}});var r=n(52322),i=n(57362),o=n(82851),a=n(99182);function s(e){let{currentPage:t,parentPage:n,commandPage:s,className:l,...u}=e,c=(0,a.U8)(e=>e.search);if((null==n?void 0:n.namespace)===(null==t?void 0:t.namespace)&&!c)return(0,r.jsx)(a.mY.Item,{className:(0,o.cx)((0,i.Vkc)(),"group",l),value:"".concat(null==s?void 0:s.label," ").concat(u.children.toString()),...u})}function l(e){let{currentPage:t,commandPage:n,className:s,...l}=e,u=(0,a.U8)(e=>e.search),c=n.namespace.startsWith((null==t?void 0:t.namespace)||"");if(u&&c||n.namespace===(null==t?void 0:t.namespace))return(0,r.jsx)(a.mY.Item,{className:(0,o.cx)((0,i.Vkc)(),"group",s),value:"".concat(n.label," ").concat(l.children.toString()),...l})}function u(e){let{currentPage:t,commandPage:n,className:s,...l}=e,u=(0,a.U8)(e=>e.search),c=n.namespace.startsWith((null==t?void 0:t.namespace)||"");if(u&&c||!t||n.namespace===(null==t?void 0:t.namespace))return(0,r.jsx)(a.mY.Item,{className:(0,o.cx)((0,i.Vkc)(),"group",s),value:"".concat(n.label," ").concat(l.children.toString()),...l})}function c(e){let{heading:t,currentPage:n,commandPage:o,...s}=e,l=(0,a.U8)(e=>e.search);return(0,r.jsx)(a.mY.Group,{heading:l&&(null==n?void 0:n.namespace)!==o.namespace&&(0,r.jsx)(i.__J,{className:"px-1",size:"12",children:o.label}),...s})}n(2784)},82459:function(e,t,n){"use strict";n.d(t,{F:function(){return g}});var r=n(52322),i=n(57362),o=n(88242),a=n(9969),s=n(71930),l=n(5632),u=n(26592),c=n(19513),d=n(33571),f=n(98358),h=n(31781),p=n(24801),m=n(86811),v=n(2784);function g(e){var t,n;let{id:g,address:y,publicKey:b,contentProps:x,buttonProps:w}=e,j=(0,l.useRouter)(),{setFilter:k,resetFilters:E}=(0,c.l)(),{setFilter:S,resetFilters:_}=(0,u.G)(),C=(0,a.uf)(),O=(0,a.s2)(),M=(0,f.l)(),T=(0,d.I)(),A=function(){let{openConfirmDialog:e}=(0,m.Rh)(),t=(0,a.IK)();return(0,v.useCallback)(n=>e({title:"Delete contract",action:(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(o.Jrl,{}),"Delete"]}),variant:"red",body:(0,r.jsxs)("div",{className:"flex flex-col",children:[(0,r.jsx)(i.nvN,{size:"14",children:"Are you sure you would like to delete the following contract:"}),(0,r.jsxs)(i.nvN,{size:"14",font:"mono",children:[n.slice(0,20),"..."]})]}),onConfirm:async()=>{let e=await t.delete({params:{id:n}});e.error&&(0,i.OHV)("Error deleting contract."),(0,i.OPV)("Successfully deleted contract.")}}),[e,t])}();return(0,r.jsxs)(i.h_2,{trigger:(0,r.jsx)(i.zxk,{variant:"ghost",icon:"hover",...w,children:(0,r.jsx)(o.iG7,{})}),contentProps:{align:"start",...x,onClick:e=>{e.stopPropagation()}},children:[(0,r.jsx)("div",{className:"px-1.5 py-1",children:(0,r.jsxs)(i.xvT,{size:"14",weight:"medium",color:"subtle",children:["Contract ",b.slice(0,24),"..."]})}),(0,r.jsx)(i.Juw,{children:"Filters"}),(0,r.jsxs)(i.Xiv,{onSelect:()=>{E(),k({id:"addressContains",value:y,label:"Address contains ".concat(y)}),j.push(s._.hosts.index)},children:[(0,r.jsx)(i.KpP,{children:(0,r.jsx)(o.q0D,{})}),"Filter hosts by host address"]}),(0,r.jsxs)(i.Xiv,{onSelect:()=>{_(),S((0,h.e)(y)),j.push(s._.contracts.index)},children:[(0,r.jsx)(i.KpP,{children:(0,r.jsx)(o.q0D,{})}),"Filter contracts by host address"]}),(0,r.jsxs)(i.Xiv,{onSelect:()=>{_(),S((0,p.V)(b)),j.push(s._.contracts.index)},children:[(0,r.jsx)(i.KpP,{children:(0,r.jsx)(o.q0D,{})}),"Filter contracts by host public key"]}),(0,r.jsx)(i.Juw,{children:"Actions"}),(null===(t=C.data)||void 0===t?void 0:t.find(e=>e===y))?(0,r.jsxs)(i.Xiv,{onSelect:()=>M([],[y]),children:[(0,r.jsx)(i.KpP,{children:(0,r.jsx)(o.nCM,{})}),"Remove host address from blocklist"]}):(0,r.jsxs)(i.Xiv,{onSelect:()=>M([y],[]),children:[(0,r.jsx)(i.KpP,{children:(0,r.jsx)(o.nCM,{})}),"Add host address to blocklist"]}),(null===(n=O.data)||void 0===n?void 0:n.find(e=>e===b))?(0,r.jsxs)(i.Xiv,{onSelect:()=>T([],[b]),children:[(0,r.jsx)(i.KpP,{children:(0,r.jsx)(o.nCM,{})}),"Remove host public key from allowlist"]}):(0,r.jsxs)(i.Xiv,{onSelect:()=>T([b],[]),children:[(0,r.jsx)(i.KpP,{children:(0,r.jsx)(o.nCM,{})}),"Add host public key to allowlist"]}),(0,r.jsxs)(i.Xiv,{onSelect:()=>A(g),children:[(0,r.jsx)(i.KpP,{children:(0,r.jsx)(o.Jrl,{})}),"Delete contract"]}),(0,r.jsx)(i.Juw,{children:"Copy"}),(0,r.jsxs)(i.Xiv,{onSelect:()=>(0,i.vQq)(g,"contract ID"),children:[(0,r.jsx)(i.KpP,{children:(0,r.jsx)(o.olJ,{})}),"Contract ID"]}),(0,r.jsxs)(i.Xiv,{onSelect:()=>(0,i.vQq)(b,"host public key"),children:[(0,r.jsx)(i.KpP,{children:(0,r.jsx)(o.olJ,{})}),"Host public key"]}),(0,r.jsxs)(i.Xiv,{onSelect:()=>(0,i.vQq)(y,"host address"),children:[(0,r.jsx)(i.KpP,{children:(0,r.jsx)(o.olJ,{})}),"Host address"]})]})}},93216:function(e,t,n){"use strict";n.d(t,{F:function(){return M}});var r=n(52322),i=n(57362),o=n(4941);let a={namespace:"contracts/filterExpiryDate",label:"Contracts filter by expiry date"},s=[{id:"expiry",value:"day",label:"expires today",fn:e=>{let t=new Date().getTime(),n=t+(0,i.NrH)(1);return e.endTimet}},{id:"expiry",value:"week",label:"expires this week",fn:e=>{let t=new Date().getTime(),n=t+(0,i.BL0)(1);return e.endTimet}},{id:"expiry",value:"month",label:"expires this month",fn:e=>{let t=new Date().getTime(),n=t+(0,i.xLV)(1);return e.endTimet}},{id:"expiry",value:"nextMonth",label:"expires next month",fn:e=>{let t=new Date().getTime(),n=t+(0,i.xLV)(2);return e.endTimet}},{id:"expiry",value:"year",label:"expires this year",fn:e=>{let t=new Date().getTime(),n=t+(0,i.ivg)(1);return e.endTimet}},{id:"expiry",value:"expired",label:"expired",fn:e=>{let t=new Date().getTime();return e.endTime(0,r.jsx)(o.WD,{currentPage:t,commandPage:a,onSelect:()=>{n(e)},children:e.label},e.id+e.value))})}let u={namespace:"contracts/filterFormationDate",label:"Contracts filter by formation date"},c=[{id:"formationDate",value:"day",label:"formed in the last day",fn:e=>{let t=new Date().getTime(),n=t-(0,i.NrH)(1);return e.startTime>=n}},{id:"formationDate",value:"week",label:"formed in the last week",fn:e=>{let t=new Date().getTime(),n=t-(0,i.BL0)(1);return e.startTime>=n}},{id:"formationDate",value:"twoWeeks",label:"formed in the last two weeks",fn:e=>{let t=new Date().getTime(),n=t-(0,i.BL0)(2);return e.startTime>=n}},{id:"formationDate",value:"month",label:"formed in the last month",fn:e=>{let t=new Date().getTime(),n=t-(0,i.xLV)(1);return e.startTime>=n}},{id:"formationDate",value:"twoMonths",label:"formed in the last two months",fn:e=>{let t=new Date().getTime(),n=t-(0,i.xLV)(2);return e.startTime>=n}},{id:"formationDate",value:"year",label:"formed in the last year",fn:e=>{let t=new Date().getTime(),n=t-(0,i.ivg)(1);return e.startTime>=n}}];function d(e){let{currentPage:t,select:n}=e;return(0,r.jsx)(o.fu,{currentPage:t,commandPage:u,children:c.map(e=>(0,r.jsx)(o.WD,{currentPage:t,commandPage:u,onSelect:()=>{n(e)},children:e.label},e.id+e.value))})}let f={namespace:"contracts/filterRenewDate",label:"Contracts filter by renew date"},h=[{id:"renewDate",value:"day",label:"renewed in the last day",fn:e=>{let t=new Date().getTime(),n=t-(0,i.NrH)(1);return e.isRenewed&&e.startTime>=n}},{id:"renewDate",value:"week",label:"renewed in the last week",fn:e=>{let t=new Date().getTime(),n=t-(0,i.BL0)(1);return e.isRenewed&&e.startTime>=n}},{id:"renewDate",value:"twoWeeks",label:"renewed in the last two weeks",fn:e=>{let t=new Date().getTime(),n=t-(0,i.BL0)(2);return e.isRenewed&&e.startTime>=n}},{id:"renewDate",value:"month",label:"renewed in the last month",fn:e=>{let t=new Date().getTime(),n=t-(0,i.xLV)(1);return e.isRenewed&&e.startTime>=n}},{id:"renewDate",value:"twoMonths",label:"renewed in the last two months",fn:e=>{let t=new Date().getTime(),n=t-(0,i.xLV)(2);return e.isRenewed&&e.startTime>=n}},{id:"renewDate",value:"year",label:"renewed in the last year",fn:e=>{let t=new Date().getTime(),n=t-(0,i.ivg)(1);return e.isRenewed&&e.startTime>=n}}];function p(e){let{currentPage:t,select:n}=e;return(0,r.jsx)(o.fu,{currentPage:t,commandPage:f,children:h.map(e=>(0,r.jsx)(o.WD,{currentPage:t,commandPage:f,onSelect:()=>{n(e)},children:e.label},e.id+e.value))})}var m=n(86811),v=n(31781);let g={namespace:"contracts/filterAddress",label:"Contracts filter by address"};function y(e){let{select:t,currentPage:n}=e,{openDialog:i}=(0,m.Rh)(),a=(0,v.e)("");return(0,r.jsx)(o.fu,{currentPage:n,commandPage:g,children:(0,r.jsx)(o.WD,{currentPage:n,commandPage:g,onSelect:()=>{t(),i("contractsFilterAddress")},children:a.label})})}function b(e){let{select:t,currentPage:n,parentPage:i,commandPage:a}=e,{openDialog:s}=(0,m.Rh)();return(0,r.jsx)(o.Ul,{currentPage:n,parentPage:i,commandPage:a,onSelect:()=>{t(),s("contractsFilterAddress")},children:g.label})}var x=n(24801);let w={namespace:"contracts/filterPublicKey",label:"Contracts filter by public key"};function j(e){let{select:t,currentPage:n}=e,i=(0,x.V)(""),{openDialog:a}=(0,m.Rh)();return(0,r.jsx)(o.fu,{currentPage:n,commandPage:w,children:(0,r.jsx)(o.WD,{currentPage:n,commandPage:w,onSelect:()=>{t(),a("contractsFilterPublicKey")},children:i.label})})}function k(e){let{select:t,currentPage:n,parentPage:i,commandPage:a}=e,{openDialog:s}=(0,m.Rh)();return(0,r.jsx)(o.Ul,{currentPage:n,parentPage:i,commandPage:a,onSelect:()=>{t(),s("contractsFilterPublicKey")},children:w.label})}function E(e){let{currentPage:t,select:n}=e;return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(y,{currentPage:t,select:n}),(0,r.jsx)(j,{currentPage:t,select:n}),(0,r.jsx)(l,{currentPage:t,select:n}),(0,r.jsx)(d,{currentPage:t,select:n}),(0,r.jsx)(p,{currentPage:t,select:n})]})}let S={namespace:"contracts",label:"Contracts"};function _(e){let{currentPage:t,parentPage:n,pushPage:i,select:s}=e;return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(b,{currentPage:t,parentPage:n,commandPage:S,select:s}),(0,r.jsx)(k,{currentPage:t,parentPage:n,commandPage:S,select:s}),(0,r.jsx)(o.Ul,{currentPage:t,parentPage:n,commandPage:S,onSelect:()=>{i(u)},children:u.label}),(0,r.jsx)(o.Ul,{currentPage:t,parentPage:n,commandPage:S,onSelect:()=>{i(a)},children:a.label}),(0,r.jsx)(o.Ul,{currentPage:t,parentPage:n,commandPage:S,onSelect:()=>{i(f)},children:f.label})]})}var C=n(26592),O=n(2784);function M(e){let{currentPage:t,parentPage:n,pushPage:i,beforeSelect:o,afterSelect:a}=e,{setFilter:s}=(0,C.G)(),l=(0,O.useCallback)(e=>{o&&o(),e&&s(e),a&&a()},[s,o,a]);return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(_,{parentPage:n,currentPage:t,pushPage:i,select:l}),(0,r.jsx)(E,{currentPage:t,select:l})]})}},31781:function(e,t,n){"use strict";n.d(t,{e:function(){return u},p:function(){return f}});var r=n(52322),i=n(57362),o=n(26592),a=n(7114),s=n(24511),l=n(86811);function u(e){return{id:"addressContains",value:e,label:"address contains ".concat(e),fn:t=>t.hostIp.includes(e)}}let c={address:""},d=s.Ry().shape({address:s.Z_().required("Required")});function f(e){let{trigger:t,open:n,onOpenChange:s}=e,{closeDialog:f}=(0,l.Rh)(),{setFilter:h}=(0,o.G)(),p=(0,a.TA)({initialValues:c,validationSchema:d,onSubmit:e=>{h(u(e.address)),p.resetForm(),f()}});return(0,r.jsx)(i.VqE,{trigger:t,title:"Filter by address",open:n,onOpenChange:e=>{e||p.resetForm(),s(e)},contentVariants:{className:"w-[400px]"},onSubmit:p.handleSubmit,children:(0,r.jsx)("div",{className:"flex flex-col gap-4",children:(0,r.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,r.jsx)(i.cB7,{formik:p,title:"Address",name:"address",placeholder:"Partial match against domain or IP",autoComplete:"off",type:"text",variants:{size:"medium"}}),(0,r.jsx)(i.IKw,{formik:p,size:"medium",children:"Filter"})]})})})}},24801:function(e,t,n){"use strict";n.d(t,{C:function(){return f},V:function(){return u}});var r=n(52322),i=n(57362),o=n(26592),a=n(7114),s=n(24511),l=n(86811);function u(e){return{id:"publicKeyContains",value:e,label:"public key contains ".concat((0,i.$Gg)(e,20)),fn:t=>t.hostKey.includes(e)}}let c={publicKey:""},d=s.Ry().shape({publicKey:s.Z_().required("Required")});function f(e){let{trigger:t,open:n,onOpenChange:s}=e,{closeDialog:f}=(0,l.Rh)(),{setFilter:h}=(0,o.G)(),p=(0,a.TA)({initialValues:c,validationSchema:d,onSubmit:e=>{h(u(e.publicKey)),p.resetForm(),f()}});return(0,r.jsx)(i.VqE,{trigger:t,title:"Filter by public key",open:n,onOpenChange:e=>{e||p.resetForm(),s(e)},contentVariants:{className:"w-[400px]"},onSubmit:p.handleSubmit,children:(0,r.jsx)("div",{className:"flex flex-col gap-4",children:(0,r.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,r.jsx)(i.cB7,{formik:p,title:"Public key",name:"publicKey",placeholder:"ed25519:02aabd26e627fd...",autoComplete:"off",type:"text",variants:{size:"medium"}}),(0,r.jsx)(i.IKw,{formik:p,size:"medium",children:"Filter"})]})})})}},4370:function(e,t,n){"use strict";n.d(t,{F:function(){return o}});var r=n(26592),i=n(34658);function o(){var e;let t=(0,i.w)(),{datasetCount:n,isLoading:o}=(0,r.G)(),a=t.data&&!o&&n{e.stopPropagation()}},children:[(0,r.jsx)("div",{className:"px-1.5 py-1",children:(0,r.jsxs)(i.xvT,{size:"14",weight:"medium",color:"subtle",children:["Host ",g.slice(0,24),"..."]})}),(0,r.jsx)(i.Juw,{children:"Filters"}),(0,r.jsxs)(i.Xiv,{onSelect:()=>{j(),w({id:"addressContains",value:v,label:"Address contains ".concat((0,i.$Gg)(v,20))}),x.push(s._.hosts.index)},children:[(0,r.jsx)(i.KpP,{children:(0,r.jsx)(o.q0D,{})}),"Filter hosts by address"]}),(0,r.jsxs)(i.Xiv,{onSelect:()=>{j(),w((0,m.K)(g)),x.push(s._.hosts.index)},children:[(0,r.jsx)(i.KpP,{children:(0,r.jsx)(o.q0D,{})}),"Filter hosts by public key"]}),(0,r.jsxs)(i.Xiv,{onSelect:()=>{E(),k((0,h.e)(v)),x.push(s._.contracts.index)},children:[(0,r.jsx)(i.KpP,{children:(0,r.jsx)(o.q0D,{})}),"Filter contracts by host address"]}),(0,r.jsxs)(i.Xiv,{onSelect:()=>{E(),k((0,p.V)(g)),x.push(s._.contracts.index)},children:[(0,r.jsx)(i.KpP,{children:(0,r.jsx)(o.q0D,{})}),"Filter contracts by host public key"]}),(0,r.jsx)(i.Juw,{children:"Actions"}),(0,r.jsxs)(i.Xiv,{onSelect:()=>M.post({payload:{hostKey:g,hostIP:v,timeout:(0,i.XBW)(30)}}),children:[(0,r.jsx)(i.KpP,{children:(0,r.jsx)(o._Eq,{})}),"Rescan host"]}),(null===(t=S.data)||void 0===t?void 0:t.find(e=>e===v))?(0,r.jsxs)(i.Xiv,{onSelect:()=>C([],[v]),children:[(0,r.jsx)(i.KpP,{children:(0,r.jsx)(o.nCM,{})}),"Remove address from blocklist"]}):(0,r.jsxs)(i.Xiv,{onSelect:()=>C([v],[]),children:[(0,r.jsx)(i.KpP,{children:(0,r.jsx)(o.nCM,{})}),"Add address to blocklist"]}),(null===(n=_.data)||void 0===n?void 0:n.find(e=>e===g))?(0,r.jsxs)(i.Xiv,{onSelect:()=>O([],[g]),children:[(0,r.jsx)(i.KpP,{children:(0,r.jsx)(o.nCM,{})}),"Remove public key from allowlist"]}):(0,r.jsxs)(i.Xiv,{onSelect:()=>O([g],[]),children:[(0,r.jsx)(i.KpP,{children:(0,r.jsx)(o.nCM,{})}),"Add public key to allowlist"]}),(0,r.jsx)(i.Juw,{children:"Copy"}),(0,r.jsxs)(i.Xiv,{onSelect:()=>(0,i.vQq)(g,"host public key"),children:[(0,r.jsx)(i.KpP,{children:(0,r.jsx)(o.olJ,{})}),"Host public key"]}),(0,r.jsxs)(i.Xiv,{onSelect:()=>(0,i.vQq)(v,"host address"),children:[(0,r.jsx)(i.KpP,{children:(0,r.jsx)(o.olJ,{})}),"Host address"]})]})}},34444:function(e,t,n){"use strict";n.d(t,{T:function(){return j},N:function(){return w}});var r=n(52322),i=n(2784),o=n(57362),a=n(25205),s=n(6391),l=n.n(s);function u(e){let{host:t,rates:n}=e,r=n?"$".concat(new(l())(t.settings.storageprice).times((0,a.xf)(1)).times((0,a.S5)(1)).div(1e24).times((null==n?void 0:n.usd)||1).toFixed(2),"/TB"):"".concat((0,a.Vz)(new(l())(t.settings.storageprice).times((0,a.xf)(1)).times((0,a.S5)(1)),{fixed:0}),"/TB"),i="".concat((0,a.vW)(t.activeContracts.reduce((e,t)=>e.plus(t.size),new(l())(0)).toNumber())," utilized"),s="".concat((0,a.vW)(t.settings.remainingstorage)," / ").concat((0,a.vW)(t.settings.totalstorage)," available");return"".concat((0,o.HLH)(t.countryCode)," \xb7 ").concat(r," \xb7 ").concat(i," \xb7 ").concat(s)}var c=function(){let[e,t]=(0,i.useState)(null),[n,r]=(0,i.useState)({width:0,height:0}),o=(0,i.useCallback)(()=>{r({width:(null==e?void 0:e.offsetWidth)||0,height:(null==e?void 0:e.offsetHeight)||0})},[null==e?void 0:e.offsetHeight,null==e?void 0:e.offsetWidth]);return d("resize",o),h(()=>{o()},[null==e?void 0:e.offsetHeight,null==e?void 0:e.offsetWidth]),[t,n]},d=function(e,t,n,r){let o=(0,i.useRef)(t);h(()=>{o.current=t},[t]),(0,i.useEffect)(()=>{var t;let i=null!==(t=null==n?void 0:n.current)&&void 0!==t?t:window;if(!(i&&i.addEventListener))return;let a=e=>o.current(e);return i.addEventListener(e,a,r),()=>{i.removeEventListener(e,a,r)}},[e,n,r])};let f="undefined"!=typeof window?i.useLayoutEffect:i.useEffect;var h=f,p=n(95753),m=n(25237),v=n.n(m);let g=v()(()=>Promise.all([n.e(546),n.e(508),n.e(167),n.e(764),n.e(17)]).then(n.bind(n,45017)),{loadableGenerated:{webpack:()=>[45017]},ssr:!1}),y=(0,i.forwardRef)(function(e,t){return(0,r.jsx)(g,{...e,forwardRef:t})});var b=n(10917),x=n(9455);let w={moveToLocation:(e,t)=>null};function j(e){let{activeHost:t,hosts:n,onMount:o,onHostClick:a,onHostHover:s}=e,d=(0,x.BW)({config:{swr:{revalidateOnFocus:!1}}}),f=(0,i.useRef)(null),h=(0,i.useRef)(w),m=(0,i.useCallback)((e,t)=>{var n;e&&(null===(n=f.current)||void 0===n||n.pointOfView({lat:e[0]-8,lng:e[1],altitude:t||1.5},700))},[]);(0,i.useEffect)(()=>{h.current.moveToLocation=m},[m]),(0,p.Q5)(()=>{var e;if(!f.current)return!1;m((null==t?void 0:t.location)||[48.8323,2.4075],1.5);let n=null===(e=f.current)||void 0===e?void 0:e.scene().children.find(e=>"DirectionalLight"===e.type);return n&&(n.intensity=10),!0}),(0,i.useEffect)(()=>{o&&o(h.current)},[]);let[v,{height:g,width:j}]=c(),k=(0,i.useMemo)(()=>n||[],[n]);return(0,r.jsx)("div",{ref:v,className:"w-full h-full",children:(0,r.jsx)(y,{ref:f,width:j,height:g,backgroundColor:"rgba(0,0,0,0)",globeImageUrl:"/_next/static/media/earth-dark-contrast.bf7081fc.png",bumpImageUrl:"/_next/static/media/earth-topology.e385a70e.png",arcsData:[],atmosphereColor:"rgba(0,0,0,0)",atmosphereAltitude:.16,animateIn:!1,arcLabel:e=>{var t;return u({host:e.dst,rates:null===(t=d.data)||void 0===t?void 0:t.rates.sc})},arcStartLat:e=>+e.src.location[0],arcStartLng:e=>+e.src.location[1],arcEndLat:e=>+e.dst.location[0],arcEndLng:e=>+e.dst.location[1],arcDashLength:.75,arcAltitude:0,arcDashGap:.1,arcDashInitialGap:()=>Math.random(),arcDashAnimateTime:5e3,arcColor:e=>t&&(e.dst.publicKey===t.publicKey||e.src.publicKey===t.publicKey)?["rgba(187, 229, 201, 0.25)","rgba(187, 229, 201, 0.25)"]:["rgba(187, 229, 201, 0.10)","rgba(187, 229, 201, 0.10)"],arcsTransitionDuration:0,pointsData:k,pointLat:e=>e.location[0],pointLng:e=>e.location[1],pointLabel:e=>{var t;return u({host:e,rates:null===(t=d.data)||void 0===t?void 0:t.rates.sc})},pointAltitude:e=>(t&&e.publicKey===(null==t?void 0:t.publicKey)||e.activeContractsCount.gt(0),.1),pointsTransitionDuration:0,pointColor:e=>{let{colorHex:n}=(0,b.Kg)(e);return t&&e.publicKey!==(null==t?void 0:t.publicKey)?function(e,t){let n=parseInt(e.slice(1,3),16),r=parseInt(e.slice(3,5),16),i=parseInt(e.slice(5,7),16);return"rgba(".concat(n,", ").concat(r,", ").concat(i,", ").concat(.2,")")}(n,0):n},pointRadius:e=>(e.activeContractsCount.gt(0)&&e.activeContracts.reduce((e,t)=>e.plus(t.size),new(l())(0)).div(1e12).toNumber(),Math.max(e.settings.remainingstorage/1e13/3,.1)),onPointHover:e=>{e&&(null==s||s(e.publicKey,e.location))},onPointClick:e=>{e&&(null==a||a(e.publicKey,e.location))},pointsMerge:!1})})}},18006:function(e,t,n){"use strict";n.d(t,{L:function(){return M}});var r=n(52322),i=n(4941),o=n(86811),a=n(2320);let s={namespace:"hosts/filterAddress",label:"Hosts filter by address"};function l(e){let{select:t,currentPage:n}=e,{openDialog:l}=(0,o.Rh)(),u=(0,a.q)("");return(0,r.jsx)(i.fu,{currentPage:n,commandPage:s,children:(0,r.jsx)(i.WD,{currentPage:n,commandPage:s,onSelect:()=>{t(),l("hostsFilterAddress")},children:u.label})})}function u(e){let{select:t,currentPage:n,parentPage:a,commandPage:l}=e,{openDialog:u}=(0,o.Rh)();return(0,r.jsx)(i.Ul,{currentPage:n,parentPage:a,commandPage:l,onSelect:()=>{t(),u("hostsFilterAddress")},children:s.label})}let c={namespace:"hosts/filterAllowBlock",label:"Hosts filter by allow/block status"},d=[{id:"filterMode",value:"allowed",label:"allowed"},{id:"filterMode",value:"blocked",label:"blocked"}];function f(e){let{select:t,currentPage:n}=e;return(0,r.jsx)(i.fu,{currentPage:n,commandPage:c,children:d.map(e=>(0,r.jsx)(i.WD,{currentPage:n,commandPage:c,onSelect:()=>{t(e)},children:e.label},e.id+e.value))})}let h={namespace:"hosts/filterActiveContracts",label:"Hosts filter by contracts"},p={id:"hasActiveContracts",bool:!0,label:"has active contracts"};function m(e){let{select:t,currentPage:n}=e;return(0,r.jsx)(i.fu,{currentPage:n,commandPage:h,children:(0,r.jsx)(i.WD,{currentPage:n,commandPage:h,onSelect:()=>{t(p)},children:p.label})})}let v={namespace:"hosts/filterUsable",label:"Hosts filter by usable"},g=[{id:"usabilityMode",value:"usable",label:"usable"},{id:"usabilityMode",value:"unusable",label:"unusable"}];function y(e){let{select:t,currentPage:n}=e;return(0,r.jsx)(i.fu,{currentPage:n,commandPage:v,children:g.map(e=>(0,r.jsx)(i.WD,{currentPage:n,commandPage:v,onSelect:()=>{t(e)},children:e.label},e.id+e.value))})}var b=n(91641),x=n(54155);let w={namespace:"hosts/filterPublicKey",label:"Hosts filter by public key"};function j(e){let{select:t,currentPage:n}=e,{openDialog:a}=(0,o.Rh)(),s=(0,x.K)("");return(0,r.jsx)(i.fu,{currentPage:n,commandPage:w,children:(0,r.jsx)(i.WD,{currentPage:n,commandPage:w,onSelect:()=>{t(),a("hostsFilterPublicKey")},children:s.label})})}function k(e){let{select:t,currentPage:n,parentPage:a,commandPage:s}=e,{openDialog:l}=(0,o.Rh)();return(0,r.jsx)(i.Ul,{currentPage:n,parentPage:a,commandPage:s,onSelect:()=>{t(),l("hostsFilterPublicKey")},children:w.label})}function E(e){let{currentPage:t,select:n}=e,{autopilot:i}=(0,b.q)();return(0,r.jsxs)(r.Fragment,{children:["on"===i.status&&(0,r.jsx)(y,{currentPage:t,select:n}),(0,r.jsx)(m,{currentPage:t,select:n}),(0,r.jsx)(l,{currentPage:t,select:n}),(0,r.jsx)(j,{currentPage:t,select:n}),(0,r.jsx)(f,{currentPage:t,select:n})]})}let S={namespace:"hosts",label:"Hosts"};function _(e){let{currentPage:t,parentPage:n,pushPage:o,select:a}=e,{autopilot:s}=(0,b.q)();return(0,r.jsxs)(r.Fragment,{children:["on"===s.status&&(0,r.jsx)(i.Ul,{currentPage:t,parentPage:n,commandPage:S,onSelect:()=>{o(v)},children:v.label}),(0,r.jsx)(k,{currentPage:t,parentPage:n,commandPage:S,select:a}),(0,r.jsx)(u,{currentPage:t,parentPage:n,commandPage:S,select:a}),(0,r.jsx)(i.Ul,{currentPage:t,parentPage:n,commandPage:S,onSelect:()=>{o(h)},children:h.label}),(0,r.jsx)(i.Ul,{currentPage:t,parentPage:n,commandPage:S,onSelect:()=>{o(c)},children:c.label})]})}var C=n(19513),O=n(2784);function M(e){let{currentPage:t,parentPage:n,pushPage:i,beforeSelect:o,afterSelect:a}=e,{setFilter:s}=(0,C.l)(),l=(0,O.useCallback)(e=>{o&&o(),e&&s(e),a&&a()},[s,o,a]);return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(_,{parentPage:n,currentPage:t,pushPage:i,select:l}),(0,r.jsx)(E,{currentPage:t,pushPage:i,select:l})]})}},2320:function(e,t,n){"use strict";n.d(t,{g:function(){return f},q:function(){return u}});var r=n(52322),i=n(57362),o=n(19513),a=n(7114),s=n(24511),l=n(86811);function u(e){return{id:"addressContains",value:e,label:"address contains ".concat(e)}}let c={address:""},d=s.Ry().shape({address:s.Z_().required("Required")});function f(e){let{trigger:t,open:n,onOpenChange:s}=e,{closeDialog:f}=(0,l.Rh)(),{setFilter:h}=(0,o.l)(),p=(0,a.TA)({initialValues:c,validationSchema:d,onSubmit:e=>{h(u(e.address)),p.resetForm(),f()}});return(0,r.jsx)(i.VqE,{trigger:t,title:"Filter by address",open:n,onOpenChange:e=>{e||p.resetForm(),s(e)},contentVariants:{className:"w-[400px]"},onSubmit:p.handleSubmit,children:(0,r.jsx)("div",{className:"flex flex-col gap-4",children:(0,r.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,r.jsx)(i.cB7,{formik:p,title:"Address",name:"address",placeholder:"Partial match against domain or IP",autoComplete:"off",type:"text",variants:{size:"medium"}}),(0,r.jsx)(i.IKw,{formik:p,size:"medium",children:"Filter"})]})})})}},54155:function(e,t,n){"use strict";n.d(t,{K:function(){return u},a:function(){return f}});var r=n(52322),i=n(57362),o=n(19513),a=n(7114),s=n(24511),l=n(86811);function u(e){return{id:"publicKeyEquals",value:e,label:"public key is ".concat((0,i.$Gg)(e,20))}}let c={publicKey:""},d=s.Ry().shape({publicKey:s.Z_().required("Required")});function f(e){let{trigger:t,open:n,onOpenChange:s}=e,{closeDialog:f}=(0,l.Rh)(),{setFilter:h}=(0,o.l)(),p=(0,a.TA)({initialValues:c,validationSchema:d,onSubmit:e=>{h(u(e.publicKey)),p.resetForm(),f()}});return(0,r.jsx)(i.VqE,{trigger:t,title:"Filter by public key",open:n,onOpenChange:e=>{e||p.resetForm(),s(e)},contentVariants:{className:"w-[400px]"},onSubmit:p.handleSubmit,children:(0,r.jsx)("div",{className:"flex flex-col gap-4",children:(0,r.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,r.jsx)(i.cB7,{formik:p,title:"Public key",name:"publicKey",placeholder:"ed25519:b050c0c6...",autoComplete:"off",type:"text",variants:{size:"medium"}}),(0,r.jsx)(i.IKw,{formik:p,size:"medium",children:"Filter"})]})})})}},71930:function(e,t,n){"use strict";n.d(t,{_:function(){return i},h:function(){return o}});var r=n(9969);let i={home:"/",files:{index:"/files"},config:{index:"/config",storage:"/config#storage",pricing:"/config#pricing",hosts:"/config#hosts",wallet:"/config#wallet",contracts:"/config#contracts",uploads:"/config#uploads",redundancy:"/config#redundancy"},contracts:{index:"/contracts"},hosts:{index:"/hosts"},wallet:{view:"/wallet"},node:{index:"/node"},login:"/login"},o=r.HI},91641:function(e,t,n){"use strict";n.d(t,{w:function(){return u},q:function(){return l}});var r=n(52322),i=n(2784),o=n(57362),a=n(9969);let s=(0,i.createContext)({}),l=()=>(0,i.useContext)(s);function u(e){let{children:t}=e,n=function(){let e=function(){let e=(0,a.YX)({config:{swr:{dedupingInterval:(0,o.XBW)(5),revalidateOnFocus:!1,refreshInterval:e=>e?(0,o.XBW)(60):(0,o.XBW)(1)}}}),[t,n]=(0,i.useState)("init");return(0,i.useEffect)(()=>{if(e.isLoading)n("init");else if(e.isValidating)return;else if(e.error)n("off");else if(e.data){let t="object"==typeof e.data;n(t?"on":"off")}},[e]),{status:t,state:e}}();return{autopilot:e}}();return(0,r.jsx)(s.Provider,{value:n,children:t})}},19847:function(e,t,n){"use strict";n.d(t,{iV:function(){return B},ZR:function(){return I}});var r=n(52322),i=n(2784),o=n(57362),a=n(25205),s=n(6391),l=n.n(s);let u={autopilotContractSet:"",amountHosts:void 0,allowanceMonth:void 0,periodWeeks:void 0,renewWindowWeeks:void 0,downloadTBMonth:void 0,uploadTBMonth:void 0,storageTB:void 0,prune:!1,allowRedundantIPs:!1,maxDowntimeHours:void 0,minRecentScanFailures:void 0},c={defaultContractSet:""},d={uploadPackingEnabled:!0},f={includeRedundancyMaxStoragePrice:!0,includeRedundancyMaxUploadPrice:!0},h={maxRpcPriceMillion:void 0,maxStoragePriceTBMonth:void 0,maxContractPrice:void 0,maxDownloadPriceTB:void 0,maxUploadPriceTB:void 0,minMaxCollateral:void 0,hostBlockHeightLeeway:void 0,minPriceTableValidityMinutes:void 0,minAccountExpiryDays:void 0,minMaxEphemeralAccountBalance:void 0,migrationSurchargeMultiplier:void 0},p={...u,...c,...d,...h,minShards:void 0,totalShards:void 0,...f};function m(e){return{storageTB:void 0,downloadTBMonth:void 0,uploadTBMonth:void 0,allowanceMonth:void 0,..."Mainnet"===e?{periodWeeks:new(l())(6),renewWindowWeeks:new(l())(2),amountHosts:new(l())(50),autopilotContractSet:"autopilot",allowRedundantIPs:!1,maxDowntimeHours:new(l())(336),minRecentScanFailures:new(l())(10),prune:!0}:{periodWeeks:new(l())(6),renewWindowWeeks:new(l())(2),amountHosts:new(l())(12),autopilotContractSet:"autopilot",allowRedundantIPs:!1,maxDowntimeHours:new(l())(336),minRecentScanFailures:new(l())(10),prune:!0}}}let v={...c,defaultContractSet:"autopilot"},g={...f},y={...d},b={...h},x=e=>Object.fromEntries(Object.entries(e).filter(e=>{let[t,n]=e;return void 0!==n&&""!==n}));function w(e,t){let n=e.defaultContractSet||(null==t?void 0:t.default)||v.defaultContractSet;return{...t,default:n}}function j(e){let{autopilot:t,contractSet:n,uploadPacking:r,gouging:i,redundancy:s,display:d,averages:h}=e,p=d?{includeRedundancyMaxStoragePrice:d.includeRedundancyMaxStoragePrice,includeRedundancyMaxUploadPrice:d.includeRedundancyMaxUploadPrice}:f,m={minShards:new(l())(s.minShards),totalShards:new(l())(s.totalShards)};return{...function(e){if(!e)return u;let t=e.contracts.set,n=(0,a.ll)(_(new(l())(e.contracts.allowance),e.contracts.period),6),r=new(l())(e.contracts.amount),i=new(l())((0,a.x5)(e.contracts.period)),s=new(l())((0,a.x5)(e.contracts.renewWindow)),c=new(l())((0,o.y70)(_((0,a.JW)(e.contracts.download),e.contracts.period),2)),d=new(l())((0,o.y70)(_((0,a.JW)(e.contracts.upload),e.contracts.period),2)),f=(0,a.JW)(new(l())(e.contracts.storage)),h=e.contracts.prune;return{autopilotContractSet:t,allowanceMonth:n,amountHosts:r,periodWeeks:i,renewWindowWeeks:s,downloadTBMonth:c,uploadTBMonth:d,storageTB:f,prune:h,allowRedundantIPs:e.hosts.allowRedundantIPs,maxDowntimeHours:new(l())(e.hosts.maxDowntimeHours),minRecentScanFailures:new(l())(e.hosts.minRecentScanFailures)}}(t),...n?{defaultContractSet:n.default}:c,uploadPackingEnabled:r.enabled,...function(e){let{gouging:t,redundancy:n,display:r,averages:i,hasBeenConfigured:s}=e,u=function(e){let{gouging:t,averages:n,hasBeenConfigured:r}=e;return r||!n?t:{...t,maxStoragePrice:n.settings.storage_price,maxDownloadPrice:new(l())(n.settings.download_price).times((0,a.xf)(1)).toString(),maxUploadPrice:new(l())(n.settings.upload_price).times((0,a.xf)(1)).toString()}}({gouging:t,averages:i,hasBeenConfigured:s});return{maxStoragePriceTBMonth:(0,a.ll)(new(l())(u.maxStoragePrice).times((0,a.S5)(1)).times((0,a.xf)(1)).times(E(n.minShards,n.totalShards,r.includeRedundancyMaxStoragePrice)),6),maxUploadPriceTB:(0,a.ll)(new(l())(u.maxUploadPrice).times(E(n.minShards,n.totalShards,r.includeRedundancyMaxUploadPrice)),6),maxDownloadPriceTB:(0,a.ll)(u.maxDownloadPrice,6),maxContractPrice:(0,a.ll)(u.maxContractPrice,6),maxRpcPriceMillion:(0,a.ll)(u.maxRPCPrice,6).times(1e6),minMaxCollateral:(0,a.ll)(u.minMaxCollateral,6),hostBlockHeightLeeway:new(l())(u.hostBlockHeightLeeway),minPriceTableValidityMinutes:new(l())((0,o.AEA)(u.minPriceTableValidity)),minAccountExpiryDays:new(l())((0,o.okB)(u.minAccountExpiry)),minMaxEphemeralAccountBalance:(0,a.ll)(u.minMaxEphemeralAccountBalance,6),migrationSurchargeMultiplier:new(l())(u.migrationSurchargeMultiplier)}}({gouging:i,averages:h,redundancy:m,display:p,hasBeenConfigured:!!d}),...m,...p}}function k(e,t){let n=new(l())(1),r=e&&t&&!e.isZero()&&!t.isZero()&&t.gte(e);return r&&(n=t.div(e)),n}function E(e,t,n){let r=k(e,t);return n?r:new(l())(1)}function S(e,t){let n=(0,a.mv)(t.toNumber());return e.times(n).div((0,a.S5)(1))}function _(e,t){let n=e.div(t);return n.times((0,a.S5)(1))}var C=n(9969),O=n(92762),M=n(80489);function T(){let[e,t]=(0,O.Z)("v0/autopilot/syncDefaultContractSet",{defaultValue:!0}),n=(0,M.a)({config:{swr:{errorRetryCount:0}}}),a=(0,C.KJ)(),s=(0,i.useCallback)(async t=>{let i=n.data||{default:""};try{e&&t!==i.default&&(await a.put({params:{key:"contractset"},payload:w({defaultContractSet:t},n.data)}),n.mutate(),(0,o.OPV)((0,r.jsxs)(o.xvT,{children:["Default contract set has been updated to:"," ",(0,r.jsx)(o.EKh,{children:t}),"."]})))}catch(e){(0,o.OHV)(e.message),console.log(e)}},[n.data,a,e]);return{shouldSyncDefaultContractSet:e,setShouldSyncDefaultContractSet:t,syncDefaultContractSet:s}}var A=n(95753);let P="v0-config-display-options";var N=n(34658),R=n(9455),D=n(91641),L=n(63955);function Z(e){let{isAutopilotEnabled:t,advancedDefaults:n,showAdvanced:i,redundancyMultiplier:a,includeRedundancyMaxStoragePrice:s,includeRedundancyMaxUploadPrice:u,storageAverage:c,uploadAverage:d,downloadAverage:f,contractAverage:h}=e;return{storageTB:{type:"number",category:"storage",title:"Expected storage",description:(0,r.jsx)(r.Fragment,{children:"The amount of storage you would like to rent in TB."}),units:"TB",hidden:!t,validation:t?{required:"required"}:{}},uploadTBMonth:{type:"number",category:"storage",title:"Expected upload",description:(0,r.jsx)(r.Fragment,{children:"The amount of upload bandwidth you plan to use each month in TB."}),units:"TB/month",hidden:!t,validation:t?{required:"required"}:{}},downloadTBMonth:{type:"number",category:"storage",title:"Expected download",description:(0,r.jsx)(r.Fragment,{children:"The amount of download bandwidth you plan to use each month in TB."}),units:"TB/month",hidden:!t,validation:t?{required:"required"}:{}},allowanceMonth:{type:"siacoin",category:"storage",title:"Allowance",description:(0,r.jsx)(r.Fragment,{children:"The amount of Siacoin you would like to spend per month."}),units:"SC/month",decimalsLimitSc:6,hidden:!t||!i,validation:t&&i?{required:"required"}:{}},periodWeeks:{type:"number",category:"storage",title:"Period",description:(0,r.jsx)(r.Fragment,{children:"The length of the storage contracts."}),units:"weeks",suggestion:null==n?void 0:n.periodWeeks,suggestionTip:"Typically ".concat(null==n?void 0:n.periodWeeks," weeks."),hidden:!t||!i,validation:t&&i?{required:"required"}:{}},renewWindowWeeks:{type:"number",category:"storage",title:"Renew window",description:(0,r.jsx)(r.Fragment,{children:"The number of weeks prior to contract expiration that Sia will attempt to renew your contracts."}),units:"weeks",decimalsLimit:6,suggestion:null==n?void 0:n.renewWindowWeeks,suggestionTip:"Typically ".concat(null==n?void 0:n.renewWindowWeeks," weeks."),hidden:!t||!i,validation:t&&i?{required:"required"}:{}},amountHosts:{type:"number",category:"storage",title:"Hosts",description:(0,r.jsx)(r.Fragment,{children:"The number of hosts to create contracts with."}),units:"hosts",decimalsLimit:0,suggestion:null==n?void 0:n.amountHosts,suggestionTip:"Typically ".concat(null==n?void 0:n.amountHosts," hosts."),hidden:!t||!i,validation:t&&i?{required:"required"}:{}},autopilotContractSet:{type:"text",category:"storage",title:"Contract set",description:(0,r.jsx)(r.Fragment,{children:"The contract set that autopilot should use. This should typically be the same as the default contract set."}),placeholder:null==n?void 0:n.autopilotContractSet,suggestion:null==n?void 0:n.autopilotContractSet,suggestionTip:(0,r.jsxs)(r.Fragment,{children:["The default contract set is"," ",(0,r.jsx)(o.EKh,{children:null==n?void 0:n.autopilotContractSet}),"."]}),hidden:!t||!i,validation:t&&i?{required:"required"}:{}},prune:{type:"boolean",category:"storage",title:"Prune sector roots",description:(0,r.jsx)(r.Fragment,{children:"When enabled, autopilot will try to prune deleted sector roots from contracts one contract at a time, for a max duration of 10 minutes per contract. For old hosts this process takes quite a while, while for new hosts it is fast. For new hosts pruning effectively deletes data from the contract, allowing the renter to stop paying for storage they are not using."}),suggestion:null==n?void 0:n.prune,suggestionTip:(0,r.jsxs)(r.Fragment,{children:["The default value is ",(0,r.jsx)(o.EKh,{children:null==n?void 0:n.prune}),"."]}),hidden:!t||!i,validation:{}},allowRedundantIPs:{type:"boolean",category:"hosts",title:"Redundant IPs",description:(0,r.jsx)(r.Fragment,{children:"Whether or not to allow forming contracts with multiple hosts in the same IP subnet. The subnets used are /16 for IPv4, and /64 for IPv6."}),suggestion:null==n?void 0:n.allowRedundantIPs,suggestionTip:"Defaults to ".concat((null==n?void 0:n.allowRedundantIPs)?"on":"off","."),hidden:!t||!i,validation:{}},maxDowntimeHours:{type:"number",category:"hosts",title:"Max downtime",description:(0,r.jsx)(r.Fragment,{children:"The maximum amount of host downtime that autopilot will tolerate in hours."}),units:"hours",suggestion:null==n?void 0:n.maxDowntimeHours,suggestionTip:"Defaults to ".concat(null==n?void 0:n.maxDowntimeHours.toNumber().toLocaleString()," which is ").concat((0,o.y70)(new(l())((0,o.XAn)(null==n?void 0:n.maxDowntimeHours.toNumber())),1)," days."),hidden:!t||!i,validation:t&&i?{required:"required"}:{}},minRecentScanFailures:{type:"number",category:"hosts",title:"Min recent scan failures",description:(0,r.jsx)(r.Fragment,{children:"The minimum number of recent scan failures that autopilot will tolerate."}),units:"scans",decimalsLimit:0,suggestion:null==n?void 0:n.minRecentScanFailures,suggestionTip:"Defaults to ".concat(null==n?void 0:n.minRecentScanFailures.toNumber(),"."),hidden:!t||!i,validation:t&&i?{required:"required"}:{}},defaultContractSet:{category:"contractset",type:"text",title:"Default contract set",placeholder:null==n?void 0:n.defaultContractSet,suggestion:null==n?void 0:n.defaultContractSet,suggestionTip:(0,r.jsx)(r.Fragment,{children:"Autopilot users will typically want to keep this the same as the autopilot contract set."}),description:(0,r.jsx)(r.Fragment,{children:"The default contract set is where data is uploaded to by default."}),hidden:!i,validation:i?{required:"required"}:{}},uploadPackingEnabled:{category:"uploadpacking",type:"boolean",title:"Upload packing",description:(0,r.jsx)(r.Fragment,{children:"Data on the Sia network is stored in 4MiB sectors. With the default 10 of 30 redundancy scheme, uploaded files are split into 40MiB chunks and encoded into 120MiB slabs. This means that storage is wasted on padding and files smaller than 40MiB still use 120MiB of space. The redundancy scheme can be configured, but unless all files are exactly 4MiB * the redundancy's minimum shards, there will always be wasted storage. Upload packing avoids this waste by buffering files and packing them together before they are uploaded to the network. This trades some performance for storage efficiency. It is also important to note that because buffered files are temporarily stored on disk they must be considered when backing up your renterd data."}),hidden:!i,validation:{}},maxStoragePriceTBMonth:{category:"gouging",type:"siacoin",title:"Max storage price",description:(0,r.jsx)(r.Fragment,{children:"The max allowed price to store 1 TB per month."}),units:"SC/TB/month",average:c,averageTip:F(s,a),after:function(e){let{form:t,fields:n}=e;return(0,r.jsx)(o.ua7,{align:"start",side:"bottom",content:z(s,a),children:(0,r.jsx)("div",{children:(0,r.jsx)(o.QBj,{size:"small",form:t,fields:n,name:"includeRedundancyMaxStoragePrice",group:!1,children:(0,r.jsxs)(o.xvT,{size:"12",weight:"medium",children:["Including ",a.toFixed(1),"x redundancy"]})})})})},decimalsLimitSc:6,validation:{required:"required"}},maxUploadPriceTB:{category:"gouging",type:"siacoin",title:"Max upload price",description:(0,r.jsx)(r.Fragment,{children:"The max allowed price to upload 1 TB."}),units:"SC/TB/month",average:d,averageTip:F(u,a),after:function(e){let{form:t,fields:n}=e;return(0,r.jsx)(o.ua7,{align:"start",side:"bottom",content:z(u,a),children:(0,r.jsx)("div",{children:(0,r.jsx)(o.QBj,{size:"small",form:t,fields:n,name:"includeRedundancyMaxUploadPrice",group:!1,children:(0,r.jsxs)(o.xvT,{size:"12",weight:"medium",children:["Including ",a.toFixed(1),"x redundancy"]})})})})},decimalsLimitSc:6,validation:{required:"required"}},maxDownloadPriceTB:{category:"gouging",type:"siacoin",title:"Max download price",description:(0,r.jsx)(r.Fragment,{children:"The max allowed price to download 1 TB."}),units:"SC/TB/month",average:f,averageTip:"Averages provided by Sia Central.",decimalsLimitSc:6,validation:{required:"required"}},maxContractPrice:{category:"gouging",type:"siacoin",title:"Max contract price",description:(0,r.jsx)(r.Fragment,{children:"The max allowed price to form a contract."}),average:h,decimalsLimitSc:6,tipsDecimalsLimitSc:3,hidden:!i,validation:i?{required:"required"}:{}},maxRpcPriceMillion:{category:"gouging",type:"siacoin",title:"Max RPC price",description:(0,r.jsx)(r.Fragment,{children:"The max allowed base price for RPCs in siacoins per million calls."}),units:"SC/million",decimalsLimitSc:6,hidden:!i,validation:i?{required:"required"}:{}},minMaxCollateral:{category:"gouging",type:"siacoin",title:"Min max collateral",description:(0,r.jsx)(r.Fragment,{children:"The min value for max collateral in the host's price settings."}),decimalsLimitSc:6,hidden:!i,validation:i?{required:"required"}:{}},hostBlockHeightLeeway:{category:"gouging",type:"number",title:"Block height leeway",description:(0,r.jsx)(r.Fragment,{children:"The amount of blocks of leeway given to the host block height in the host's price table."}),units:"blocks",decimalsLimit:0,suggestion:null==n?void 0:n.hostBlockHeightLeeway,suggestionTip:"The recommended value is 6 blocks.",hidden:!i,validation:i?{required:"required",validate:{min:e=>new(l())(e).gte(3)||"must be at least 3 blocks"}}:{}},minPriceTableValidityMinutes:{category:"gouging",type:"number",title:"Min price table validity",units:"minutes",description:(0,r.jsx)(r.Fragment,{children:"The min accepted value for `Validity` in the host's price settings."}),hidden:!i,validation:i?{required:"required",validate:{min:e=>new(l())(e).gte((0,o.GXN)(10))||"must be at least 10 seconds"}}:{}},minAccountExpiryDays:{category:"gouging",type:"number",title:"Min account expiry",units:"days",description:(0,r.jsx)(r.Fragment,{children:"The min accepted value for `AccountExpiry` in the host's price settings."}),hidden:!i,validation:i?{required:"required",validate:{min:e=>new(l())(e).gte((0,o.XAn)(1))||"must be at least 1 hour"}}:{}},minMaxEphemeralAccountBalance:{category:"gouging",type:"siacoin",title:"Min max ephemeral account balance",description:(0,r.jsx)(r.Fragment,{children:"The min accepted value for `MaxEphemeralAccountBalance` in the host's price settings."}),decimalsLimitSc:6,hidden:!i,validation:i?{required:"required",validate:{min:e=>new(l())(e).gte(1)||"must be at least 1 SC"}}:{}},migrationSurchargeMultiplier:{category:"gouging",type:"number",title:"Migration surcharge multiplier",units:"* download price",placeholder:"10",decimalsLimit:1,description:(0,r.jsx)(r.Fragment,{children:"Factor that gets applied on the max download price when trying to download migration-critical sectors from a host that is price gouging. For example, when migrating a low-health file, if the download is failing but would potentially succeed with looser gouging settings, we apply the migration surcharge multiplier to overpay on every sector download if it means saving the file/migration."}),suggestion:new(l())(10),suggestionTip:"The default multiplier is 10x the download price.",hidden:!i,validation:i?{required:"required"}:{}},minShards:{type:"number",category:"redundancy",title:"Min shards",description:(0,r.jsx)(r.Fragment,{children:"The min amount of shards needed to reconstruct a slab."}),suggestion:null==n?void 0:n.minShards,suggestionTip:"Typically ".concat(null==n?void 0:n.minShards," shards."),units:"shards",hidden:!i,validation:i?{required:"required",validate:{min:e=>new(l())(e).gt(0)||"must be greater than 0"}}:{},trigger:["totalShards"]},totalShards:{type:"number",category:"redundancy",title:"Total shards",description:(0,r.jsx)(r.Fragment,{children:"The total amount of shards for each slab."}),suggestion:null==n?void 0:n.totalShards,suggestionTip:"Typically ".concat(null==n?void 0:n.totalShards," shards."),units:"shards",hidden:!i,validation:i?{required:"required",validate:{gteMinShards:(e,t)=>new(l())(e).gte(t.minShards)||"must be at least equal to min shards",max:e=>new(l())(e).lt(256)||"must be less than 256"}}:{}},includeRedundancyMaxStoragePrice:{type:"boolean",title:"Include redundancy",validation:{}},includeRedundancyMaxUploadPrice:{type:"boolean",title:"Include redundancy",validation:{}}}}function F(e,t){return e?"The average price is adjusted for ".concat(t.toFixed(1),"x redundancy. Averages provided by Sia Central."):"The average price is not adjusted for redundancy. Averages provided by Sia Central."}function z(e,t){return e?(0,r.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,r.jsxs)(o.xvT,{color:"subtle",children:["Specified max price includes the cost of"," ",t.toFixed(1),"x redundancy."]}),(0,r.jsxs)(o.xvT,{color:"subtle",children:["Redundancy is calculated from the ratio of data shards:"," ",(0,r.jsx)(o.EKh,{children:"total shards / min shards"}),"."]})]}):"Specified max price does not include redundancy."}let V=(0,i.createContext)({}),I=()=>(0,i.useContext)(V);function B(e){let{children:t}=e,n=function(){let{autopilot:e,contractSet:t,display:n,gouging:r,redundancy:s,uploadPacking:u,averages:c,shouldSyncDefaultContractSet:d,setShouldSyncDefaultContractSet:f,appSettings:h,isAutopilotEnabled:_}=function(){var e,t,n;let r=(0,D.q)(),i="on"===r.autopilot.status,a=(0,C.e$)({config:{swr:{errorRetryCount:0,refreshInterval:(0,o.sWj)(1)}}}),s=(0,M.a)({config:{swr:{errorRetryCount:0,refreshInterval:(0,o.sWj)(1)}}}),l=(e={config:{swr:{errorRetryCount:0,refreshInterval:(0,o.sWj)(1)}}},(0,C.yu)({...e,params:{key:P}})),u=(t={config:{swr:{refreshInterval:(0,o.sWj)(1)}}},(0,C.yu)({...t,params:{key:"gouging"}})),c=(0,N.w)({config:{swr:{refreshInterval:(0,o.sWj)(1)}}}),d=(n={config:{swr:{refreshInterval:(0,o.sWj)(1)}}},(0,C.yu)({...n,params:{key:"uploadpacking"}})),f=(0,R.BF)({config:{swr:{revalidateOnFocus:!1}}}),{shouldSyncDefaultContractSet:h,setShouldSyncDefaultContractSet:p,syncDefaultContractSet:m}=T(),v=(0,A.Hv)();return{autopilot:a,contractSet:s,display:l,gouging:u,redundancy:c,uploadPacking:d,averages:f,shouldSyncDefaultContractSet:h,setShouldSyncDefaultContractSet:p,syncDefaultContractSet:m,appSettings:v,isAutopilotEnabled:i}}(),{form:F,maxStoragePriceTBMonth:z,maxDownloadPriceTB:V,maxUploadPriceTB:I,storageTB:B,downloadTBMonth:H,uploadTBMonth:U,includeRedundancyMaxStoragePrice:W,includeRedundancyMaxUploadPrice:q,redundancyMultiplier:$,fields:K,showAdvanced:Y,setShowAdvanced:G}=function(){let e=(0,L.cI)({mode:"all",defaultValues:p}),t=e.watch("maxStoragePriceTBMonth"),n=e.watch("maxDownloadPriceTB"),r=e.watch("maxUploadPriceTB"),o=e.watch("storageTB"),s=e.watch("downloadTBMonth"),u=e.watch("uploadTBMonth"),c=e.watch("minShards"),d=e.watch("totalShards"),f=e.watch("includeRedundancyMaxStoragePrice"),h=e.watch("includeRedundancyMaxUploadPrice"),x=(0,i.useMemo)(()=>k(c,d),[c,d]),{averages:w,storageAverage:j,uploadAverage:S,downloadAverage:_,contractAverage:M}=function(e){let{minShards:t,totalShards:n,includeRedundancyMaxStoragePrice:r,includeRedundancyMaxUploadPrice:o}=e,s=(0,R.BF)({config:{swr:{revalidateOnFocus:!1}}}),u=(0,i.useMemo)(()=>s.data?new(l())((0,a.ll)(s.data.settings.storage_price).times((0,a.S5)(1)).times((0,a.xf)(1)).times(E(t,n,r)).toFixed(0)):void 0,[s.data,t,n,r]),c=(0,i.useMemo)(()=>s.data?new(l())((0,a.ll)(s.data.settings.upload_price).times((0,a.xf)(1)).times(E(t,n,o)).toFixed(0)):void 0,[s.data,t,n,o]),d=(0,i.useMemo)(()=>s.data?new(l())((0,a.ll)(s.data.settings.download_price).times((0,a.xf)(1)).toFixed(0)):void 0,[s.data]),f=(0,i.useMemo)(()=>s.data?new(l())((0,a.ll)(s.data.settings.contract_price).toFixed(0)):void 0,[s.data]);return{averages:s,storageAverage:u,uploadAverage:c,downloadAverage:d,contractAverage:f}}({minShards:c,totalShards:d,includeRedundancyMaxStoragePrice:f,includeRedundancyMaxUploadPrice:h}),T=(0,D.q)(),A="on"===T.autopilot.status,[P,N]=(0,O.Z)("v0/config/showAdvanced",{defaultValue:!1}),F=(0,C.d_)(),z=(0,i.useMemo)(()=>{var e;let t=F.data?{...m(e=F.data.network),...v,...g,...y,...b,..."Mainnet"===e?{minShards:new(l())(10),totalShards:new(l())(30)}:{minShards:new(l())(2),totalShards:new(l())(6)}}:void 0;return w.data?Z({advancedDefaults:t,isAutopilotEnabled:A,showAdvanced:P,redundancyMultiplier:x,includeRedundancyMaxStoragePrice:f,includeRedundancyMaxUploadPrice:h,storageAverage:j,uploadAverage:S,downloadAverage:_,contractAverage:M}):Z({advancedDefaults:t,isAutopilotEnabled:A,showAdvanced:P,redundancyMultiplier:x,includeRedundancyMaxStoragePrice:f,includeRedundancyMaxUploadPrice:h})},[F.data,A,P,w.data,j,S,_,M,x,f,h]);return{form:e,fields:z,maxStoragePriceTBMonth:t,maxDownloadPriceTB:n,maxUploadPriceTB:r,storageTB:o,downloadTBMonth:s,uploadTBMonth:u,minShards:c,totalShards:d,includeRedundancyMaxStoragePrice:f,includeRedundancyMaxUploadPrice:h,redundancyMultiplier:x,showAdvanced:P,setShowAdvanced:N}}(),X=(0,i.useMemo)(()=>({autopilot:{data:e.data,error:e.error},contractSet:{data:t.data,error:t.error},uploadPacking:{data:u.data,error:u.error},gouging:{data:r.data,error:r.error},redundancy:{data:s.data,error:s.error},display:{data:n.data,error:n.error},averages:{data:c.data,error:c.error},appSettings:{settings:{siaCentral:h.settings.siaCentral}}}),[e.data,e.error,t.data,t.error,u.data,u.error,r.data,r.error,s.data,s.error,n.data,n.error,c.data,c.error,h.settings.siaCentral]),Q=(0,i.useMemo)(()=>!function(e){let{autopilot:t,contractSet:n,uploadPacking:r,gouging:i,redundancy:o,display:a,averages:s,appSettings:l}=e;return!!(o.data&&r.data&&i.data&&(t.data||t.error)&&(n.data||n.error)&&(a.data||a.error)&&(!l.settings.siaCentral||s.data))}(X)?null:j({autopilot:X.autopilot.data,contractSet:X.contractSet.data,uploadPacking:X.uploadPacking.data,gouging:X.gouging.data,averages:X.averages.data,redundancy:X.redundancy.data,display:X.display.data}),[X]),J=(0,i.useMemo)(()=>(function(e){let{uploadPacking:t,gouging:n,redundancy:r}=e;return!!(r.error||t.error||n.error)})(X),[X]),ee=(0,i.useCallback)(async()=>{let i=_?await e.mutate():void 0,a=await t.mutate(),l=await r.mutate(),d=await s.mutate(),f=await u.mutate(),h=await n.mutate();if(!r||!s)return(0,o.OHV)("Error fetching settings."),null;F.reset(j({autopilot:i,contractSet:a,uploadPacking:f,gouging:l,averages:c.data,redundancy:d,display:h}))},[F,_,e,t,r,u,s,n,c.data]);(0,o.u$d)({form:F,remoteValues:Q}),(0,o.Z4p)({form:F,remoteValues:Q});let{changeCount:et}=(0,o.mYE)({form:F}),{canEstimate:en,estimatedSpendingPerMonth:er,estimatedSpendingPerTB:ei}=function(e){let{isAutopilotEnabled:t,includeRedundancyMaxStoragePrice:n,includeRedundancyMaxUploadPrice:r,redundancyMultiplier:o,maxStoragePriceTBMonth:a,storageTB:s,maxDownloadPriceTB:u,downloadTBMonth:c,maxUploadPriceTB:d,uploadTBMonth:f}=e,h=(0,i.useMemo)(()=>!!t&&(null==a?void 0:a.gt(0))&&(null==s?void 0:s.gt(0))&&(null==u?void 0:u.gt(0))&&(null==d?void 0:d.gt(0)),[t,a,s,u,d]),p=(0,i.useMemo)(()=>{if(!h)return new(l())(0);let e=(null==s?void 0:s.gt(0))?s:new(l())(0),t=(null==c?void 0:c.gt(0))?c:new(l())(0),i=(null==f?void 0:f.gt(0))?f:new(l())(0),p=(null==a?void 0:a.gt(0))?a:new(l())(0),m=(null==d?void 0:d.gt(0))?d:new(l())(0),v=(null==u?void 0:u.gt(0))?u:new(l())(0),g=n?p.times(e):p.times(o).times(e),y=v.times(t),b=r?m.times(i):m.times(o).times(i),x=g.plus(y).plus(b);return x},[h,n,r,o,a,s,u,c,d,f]),m=(0,i.useMemo)(()=>{if(!h)return new(l())(0);let e=p.div(s);return e},[h,p,s]);return{canEstimate:h,estimatedSpendingPerMonth:p,estimatedSpendingPerTB:m}}({isAutopilotEnabled:_,includeRedundancyMaxStoragePrice:W,includeRedundancyMaxUploadPrice:q,redundancyMultiplier:$,maxStoragePriceTBMonth:z,storageTB:B,maxDownloadPriceTB:V,downloadTBMonth:H,maxUploadPriceTB:I,uploadTBMonth:U}),eo=function(e){let{resources:t,estimatedSpendingPerMonth:n,isAutopilotEnabled:r,showAdvanced:s,revalidateAndResetForm:l}=e,u=(0,C.Bl)(),c=(0,C.oe)(),d=(0,C.KJ)(),f=(0,C.d_)(),{syncDefaultContractSet:h}=T(),p=(0,A.Tu)(),v=(0,i.useCallback)(async e=>{if(t.gouging.data&&t.redundancy.data&&f.data)try{let i={};r&&!s&&(i.allowanceMonth=n);let v={...e,...i},g=r&&!t.autopilot.data,y=r?await c.put({payload:function(e,t,n){let r={...m(e),...x(t)};return{...n,contracts:{...null==n?void 0:n.contracts,set:r.autopilotContractSet,amount:Math.round(r.amountHosts.toNumber()),allowance:(0,a.qN)(S(r.allowanceMonth,r.periodWeeks)).toString(),period:Math.round((0,a.mv)(r.periodWeeks.toNumber())),renewWindow:Math.round((0,a.mv)(r.renewWindowWeeks.toNumber())),download:Number(S((0,a.xf)(r.downloadTBMonth),r.periodWeeks).toFixed(0)),upload:Number(S((0,a.xf)(r.uploadTBMonth),r.periodWeeks).toFixed(0)),storage:(0,a.xf)(r.storageTB).toNumber(),prune:r.prune},hosts:{...null==n?void 0:n.hosts,maxDowntimeHours:r.maxDowntimeHours.toNumber(),minRecentScanFailures:r.minRecentScanFailures.toNumber(),allowRedundantIPs:r.allowRedundantIPs,scoreOverrides:(null==n?void 0:n.hosts.scoreOverrides)||null}}}(f.data.network,v,t.autopilot.data)}):void 0,[b,j,k,_,O]=await Promise.all([d.put({params:{key:"contractset"},payload:w(v,t.contractSet.data)}),d.put({params:{key:"uploadpacking"},payload:{...t.uploadPacking.data,enabled:v.uploadPackingEnabled}}),d.put({params:{key:"gouging"},payload:{...t.gouging.data,maxRPCPrice:(0,a.qN)(v.maxRpcPriceMillion.div(1e6)).toString(),maxStoragePrice:(0,a.qN)(v.maxStoragePriceTBMonth.div((0,a.S5)(1)).div((0,a.xf)(1)).div(E(v.minShards,v.totalShards,v.includeRedundancyMaxStoragePrice))).toString(),maxUploadPrice:(0,a.qN)(v.maxUploadPriceTB.div(E(v.minShards,v.totalShards,v.includeRedundancyMaxUploadPrice))).toString(),maxDownloadPrice:(0,a.qN)(v.maxDownloadPriceTB).toString(),maxContractPrice:(0,a.qN)(v.maxContractPrice).toString(),minMaxCollateral:(0,a.qN)(v.minMaxCollateral).toString(),hostBlockHeightLeeway:Math.round(v.hostBlockHeightLeeway.toNumber()),minPriceTableValidity:Math.round((0,o.ort)(v.minPriceTableValidityMinutes.toNumber())),minAccountExpiry:Math.round((0,o.k9c)(v.minAccountExpiryDays.toNumber())),minMaxEphemeralAccountBalance:(0,a.qN)(v.minMaxEphemeralAccountBalance).toString(),migrationSurchargeMultiplier:v.migrationSurchargeMultiplier.toNumber()}}),d.put({params:{key:"redundancy"},payload:{...t.redundancy.data,minShards:v.minShards.toNumber(),totalShards:v.totalShards.toNumber()}}),d.put({params:{key:P},payload:{...t.display.data,includeRedundancyMaxStoragePrice:v.includeRedundancyMaxStoragePrice,includeRedundancyMaxUploadPrice:v.includeRedundancyMaxUploadPrice}})]);if(null==y?void 0:y.error)throw Error(y.error);if(b.error)throw Error(b.error);if(j.error)throw Error(j.error);if(k.error)throw Error(k.error);if(_.error)throw Error(_.error);if(O.error)throw Error(O.error);if(r&&(h(v.autopilotContractSet),u.post({payload:{forceScan:!0}})),(0,o.OPV)("Configuration has been saved."),g){let e=async()=>{await (0,A.gw)(5e3),p(e=>e.startsWith(C.pz)),await (0,A.gw)(5e3),p(e=>e.startsWith(C.pz))};e()}await l()}catch(e){(0,o.OHV)(e.message),console.log(e)}},[f.data,n,s,r,c,l,h,p,d,t,u]);return v}({resources:X,estimatedSpendingPerMonth:er,showAdvanced:Y,isAutopilotEnabled:_,revalidateAndResetForm:ee}),ea=(0,o.WsO)(K),es=(0,i.useMemo)(()=>F.handleSubmit(eo,ea),[F,eo,ea]);return{onSubmit:es,revalidateAndResetForm:ee,form:F,fields:K,changeCount:et,canEstimate:en,estimatedSpendingPerMonth:er,estimatedSpendingPerTB:ei,redundancyMultiplier:$,storageTB:B,shouldSyncDefaultContractSet:d,setShouldSyncDefaultContractSet:f,showAdvanced:Y,setShowAdvanced:G,remoteError:J}}();return(0,r.jsx)(V.Provider,{value:n,children:t})}},26592:function(e,t,n){"use strict";n.d(t,{x:function(){return E},G:function(){return k}});var r=n(52322),i=n(57362),o=n(5632),a=n(9969),s=n(2784),l=n(6391),u=n.n(l),c=n(56860),d=n(88242),f=n(25205),h=n(82459),p=n(82851);let m=[{id:"actions",label:"",fixed:!0,cellClassName:"w-[50px] !pl-2 !pr-4 [&+*]:!pl-0",render:e=>{let{data:{id:t,hostIp:n,hostKey:i}}=e;return(0,r.jsx)(h.F,{id:t,address:n,publicKey:i})}},{id:"contractId",label:"contract ID",category:"general",render:e=>{let{data:{id:t,isRenewed:n,renewedFrom:o},context:{siascanUrl:a}}=e;return(0,r.jsxs)("div",{className:"flex flex-col gap-1 w-full",children:[(0,r.jsx)(i.XxW,{size:"12",value:(0,i.I13)(t),type:"contract",label:"contract ID",siascanUrl:a}),n&&(0,r.jsx)(i.ua7,{content:"Renewed from",align:"start",children:(0,r.jsxs)("div",{className:"flex items-center",children:[(0,r.jsx)(i.xvT,{color:"subtle",children:(0,r.jsx)(d.L6f,{className:"scale-75"})}),(0,r.jsx)(i.XxW,{color:"subtle",size:"10",type:"contract",value:(0,i.I13)(o),siascanUrl:a,label:"contract ID"})]})})]})}},{id:"sets",label:"contract sets",contentClassName:"w-[120px]",category:"general",render:e=>{let{data:{sets:t},context:{defaultSet:n}}=e;return t?(0,r.jsx)("div",{className:"flex flex-col items-center overflow-hidden h-full",children:(0,r.jsx)(i.xrM,{children:(0,r.jsx)("div",{className:"flex min-h-full gap-1 flex-wrap py-2 items-center",children:t.map(e=>{let t=n===e;return(0,r.jsx)(i.ua7,{content:"Contract is part of set ".concat(e,".")+(t?" ".concat(e," is the default contract set."):""),children:(0,r.jsxs)(i.Cts,{interactive:!1,size:"small",className:(0,p.cx)("flex gap-px items-center",t?"pl-px":""),children:[t?(0,r.jsx)(d.Y3p,{className:"scale-75"}):null,e]})},e)})})})}):null}},{id:"hostIp",label:"host address",category:"general",render:e=>{let{data:{hostIp:t},context:{siascanUrl:n}}=e;return(0,r.jsx)(i.XxW,{size:"12",value:t,type:"hostIp",siascanUrl:n})}},{id:"hostKey",label:"host public key",category:"general",render:e=>{let{data:{hostKey:t},context:{siascanUrl:n}}=e;return(0,r.jsx)(i.XxW,{size:"12",value:t,type:"hostPublicKey",siascanUrl:n})}},{id:"state",label:"state",category:"general",render:e=>{let{data:{state:t}}=e;return(0,r.jsx)(i.ua7,{content:(0,r.jsxs)("div",{className:"flex flex-col gap-1.5",children:[(0,r.jsxs)("div",{className:"flex",children:[(0,r.jsx)(i.xvT,{className:"flex-1",weight:"medium",children:"pending"}),(0,r.jsx)(i.xvT,{className:"flex-[2]",color:"subtle",children:"Contract has been added."})]}),(0,r.jsx)(i.Z0O,{className:"w-full"}),(0,r.jsxs)("div",{className:"flex",children:[(0,r.jsx)(i.xvT,{className:"flex-1",weight:"medium",children:"active"}),(0,r.jsx)(i.xvT,{className:"flex-[2]",color:"subtle",children:"Contract has appeared on chain."})]}),(0,r.jsx)(i.Z0O,{className:"w-full"}),(0,r.jsxs)("div",{className:"flex",children:[(0,r.jsx)(i.xvT,{className:"flex-1",weight:"medium",children:"complete"}),(0,r.jsx)(i.xvT,{className:"flex-[2]",color:"subtle",children:"Storage proof has appeared on chain."})]}),(0,r.jsx)(i.Z0O,{className:"w-full"}),(0,r.jsxs)("div",{className:"flex",children:[(0,r.jsx)(i.xvT,{className:"flex-1",weight:"medium",children:"failed"}),(0,r.jsx)(i.xvT,{className:"flex-[2]",color:"subtle",children:"Storage proof was not submitted before the end of proof window."})]})]}),children:(0,r.jsx)(i.Cts,{variant:"active"===t?"amber":"failed"===t?"red":"pending"===t?"amber":"complete"===t?"green":void 0,children:t})})}},{id:"timeline",label:"timeline",category:"time",render:e=>{let{data:{contractHeightStart:t,contractHeightEnd:n,proofWindowHeightStart:o,proofWindowHeightEnd:a,revisionHeight:s,proofHeight:l},context:{currentHeight:u,contractsTimeRange:c}}=e;return(0,r.jsx)("div",{className:"w-[400px]",children:(0,r.jsx)(i.TaT,{currentHeight:u,contractHeightStart:t,contractHeightEnd:n,proofWindowHeightStart:o,proofWindowHeightEnd:a,proofHeight:l,revisionHeight:s,range:c})})}},{id:"startTime",label:"start date",category:"time",contentClassName:"w-[120px] justify-end",render:e=>{let{data:{startTime:t}}=e;return(0,r.jsx)(i.xvT,{size:"12",font:"mono",ellipsis:!0,children:(0,f.rN)(t)})}},{id:"endTime",label:"end date",category:"time",contentClassName:"w-[120px] justify-end",render:e=>{let{data:{endTime:t}}=e;return(0,r.jsx)(i.xvT,{size:"12",font:"mono",ellipsis:!0,children:(0,f.rN)(t)})}},{id:"size",label:"size",category:"general",contentClassName:"w-[120px] justify-end",render:e=>{let{data:{size:t}}=e;return(0,r.jsx)(i.m2c,{size:"12",value:t,variant:"value",format:e=>(0,f.vW)(e)})}},{id:"totalCost",label:"total cost",category:"financial",contentClassName:"w-[120px] justify-end",render:e=>{let{data:{totalCost:t}}=e;return(0,r.jsx)(i.ho9,{displayBoth:!0,size:"12",value:t.negated()})}},{id:"spendingUploads",label:"uploads spending",category:"financial",contentClassName:"w-[120px] justify-end",render:e=>{let{data:{spendingUploads:t}}=e;return(0,r.jsx)(i.ho9,{displayBoth:!0,size:"12",value:t.negated()})}},{id:"spendingDownloads",label:"downloads spending",category:"financial",contentClassName:"w-[120px] justify-end",render:e=>{let{data:{spendingDownloads:t}}=e;return(0,r.jsx)(i.ho9,{displayBoth:!0,size:"12",value:t.negated()})}},{id:"spendingFundAccount",label:"fund account spending",category:"financial",contentClassName:"w-[120px] justify-end",render:e=>{let{data:{spendingFundAccount:t}}=e;return(0,r.jsx)(i.ho9,{displayBoth:!0,size:"12",value:t.negated()})}}];var v=n(9455),g=n(25573),y=n(20189);function b(e){let t=(0,i.sWj)(5);return Math.round(e/t)*t}function x(e){let{start:t,disabled:n,contractId:o}=e,l=b(t),c=(0,i.NrH)(1),d=(0,s.useMemo)(()=>{let e=new Date().getTime(),t=b(e),n=t-l,r=Math.round(n/c);return Math.max(r,1)},[l,c]),h=(0,s.useMemo)(()=>{let e={start:new Date(l||0).toISOString(),interval:c,n:d};return o&&(e.contractID=o),e},[l,c,d,o]),p=(0,a.Yy)({disabled:n,params:h}),m=(0,s.useMemo)(()=>{var e;let t=(0,i.Y_Z)(null===(e=p.data)||void 0===e?void 0:e.map(e=>({uploadSpending:Number(e.uploadSpending),listSpending:Number(e.listSpending),deleteSpending:Number(e.deleteSpending),fundAccountSpending:Number(e.fundAccountSpending),remainingCollateral:Number(e.remainingCollateral),remainingFunds:Number(e.remainingFunds),timestamp:new Date(e.timestamp).getTime()})),"none"),n=(0,i.fVJ)(t);return{data:t,stats:n,config:{enabledGraph:["remainingFunds","remainingCollateral","fundAccountSpending","uploadSpending","listSpending","deleteSpending"],enabledTip:["remainingFunds","remainingCollateral","fundAccountSpending","uploadSpending","listSpending","deleteSpending"],categories:["funding","spending"],data:{remainingFunds:{label:"remaining funds",category:"funding",color:i.O9T.emerald[600]},remainingCollateral:{label:"remaining collateral",category:"funding",pattern:!0,color:i.O9T.emerald[600]},fundAccountSpending:{label:"fund account",category:"spending",color:i.O9T.red[600]},uploadSpending:{label:"upload",category:"spending",color:i.O9T.red[600]},listSpending:{label:"list",category:"spending",color:i.O9T.red[600]},deleteSpending:{label:"delete",category:"spending",color:i.O9T.red[600]}},formatComponent:function(e){let{value:t}=e;return(0,r.jsx)(i.ho9,{variant:"value",value:new(u())(t)})},formatTimestamp:c===(0,i.NrH)(1)?(0,i.kOJ)("daily"):void 0,formatTickY:e=>(0,f.Vz)(e,{fixed:0,dynamicUnits:!0}),disableAnimations:!0,chartType:"barstack",curveType:"linear",stackOffset:"none"},isLoading:p.isValidating&&!p.data}},[p.data,p.isValidating,c]);return{contractMetrics:m}}var w=n(80489);let j=(0,s.createContext)({}),k=()=>(0,s.useContext)(j);function E(e){let{children:t}=e,n=function(){let[e,t]=(0,s.useState)("list"),[n,r]=(0,s.useState)("spending"),l=(0,o.useRouter)(),d=Number(l.query.limit||50),h=Number(l.query.offset||0),p=(0,a.GP)({config:{swr:{refreshInterval:(0,i.sWj)(1)}}}),j=(0,v.JL)(),k=(0,s.useMemo)(()=>{var e;return(null===(e=j.data)||void 0===e?void 0:e.hosts)||[]},[j.data]),E=(0,g.n)(),S=E.isSynced?E.nodeBlockHeight:E.estimatedBlockHeight,[_,C]=(0,s.useState)(),O=(0,s.useCallback)(e=>{if(_===e){C(void 0);return}C(e),t("detail"),r("spending")},[_,C,t]),M=(0,s.useMemo)(()=>{var e;if(!p.data)return null;let t=(null===(e=p.data)||void 0===e?void 0:e.map(e=>{var t;let n="fcid:0000000000000000000000000000000000000000000000000000000000000000"!==e.renewedFrom,r=(0,f.jr)(S,e.startHeight),i=e.windowStart,o=(0,f.jr)(S,i);return{id:e.id,onClick:()=>O(e.id),contractId:e.id,state:e.state,hostIp:e.hostIP,hostKey:e.hostKey,sets:e.sets,location:null===(t=k.find(t=>t.public_key===e.hostKey))||void 0===t?void 0:t.location,timeline:r,startTime:r,endTime:o,contractHeightStart:e.startHeight,contractHeightEnd:i,proofWindowHeightStart:e.windowStart,proofWindowHeightEnd:e.windowEnd,proofHeight:e.proofHeight,revisionHeight:e.revisionHeight,isRenewed:n,renewedFrom:e.renewedFrom,totalCost:new(u())(e.totalCost),spendingUploads:new(u())(e.spending.uploads),spendingDownloads:new(u())(e.spending.downloads),spendingFundAccount:new(u())(e.spending.fundAccount),size:new(u())(e.size)}}))||[];return t},[p.data,k,S,O]),T=(0,s.useMemo)(()=>null==M?void 0:M.find(e=>e.id===_),[M,_]),{filters:A,setFilter:P,removeFilter:N,removeLastFilter:R,resetFilters:D}=(0,i.Wdu)(),{configurableColumns:L,enabledColumns:Z,sortableColumns:F,toggleColumnVisibility:z,setColumnsVisible:V,setColumnsHidden:I,toggleSort:B,setSortDirection:H,setSortField:U,sortField:W,sortDirection:q,resetDefaultColumnVisibility:$}=(0,i.oy6)("renterd/v0/contracts",{columns:m,columnsDefaultVisible:c.gd,sortOptions:c.Fo,defaultSortField:c.nw}),K=(0,i._4u)({dataset:M,filters:A,sortField:W,sortDirection:q}),Y=(0,s.useMemo)(()=>K?K.slice(h,h+d):null,[K,h,d]),{range:G}=(0,s.useMemo)(()=>(0,i.EJC)(S,Y||[]),[S,Y]),X=(0,s.useMemo)(()=>m.filter(e=>e.fixed||Z.includes(e.id)),[Z]),Q=(0,i.c2j)(K,p.isValidating,p.error,A),J=(0,y.B)(),ee=(0,w.a)(),et=(0,s.useMemo)(()=>{var e;return{currentHeight:E.estimatedBlockHeight,defaultSet:null===(e=ee.data)||void 0===e?void 0:e.default,contractsTimeRange:G,siascanUrl:J}},[E.estimatedBlockHeight,G,J,ee.data]),en=new Date().getTime()-(0,i.NrH)(30),{contractMetrics:er}=x({start:en}),{contractMetrics:ei}=x({contractId:_,start:(null==T?void 0:T.startTime)||0,disabled:!T}),{contractSetMetrics:eo}=function(){var e;let t=b(new Date().getTime()-(0,i.NrH)(30)),n=(0,i.NrH)(1),r=(0,s.useMemo)(()=>{let e=new Date().getTime(),r=b(e),i=r-t;return Math.round(i/n)},[t,n]),o=(0,a.e$)(),l=(0,a.Bi)({disabled:!o.data,params:{name:null===(e=o.data)||void 0===e?void 0:e.contracts.set,start:new Date(t).toISOString(),interval:n,n:r}}),u=(0,s.useMemo)(()=>{var e;let t=(0,i.Y_Z)(null===(e=l.data)||void 0===e?void 0:e.map(e=>({contracts:Number(e.contracts),timestamp:new Date(e.timestamp).getTime()})),"none"),r=(0,i.fVJ)(t);return{data:t,stats:r,config:{enabledGraph:["contracts"],enabledTip:["contracts"],data:{contracts:{label:"contracts",color:i.O9T.emerald[600]}},formatTimestamp:n===(0,i.NrH)(1)?(0,i.kOJ)("daily"):void 0,disableAnimations:!0,chartType:"line",curveType:"linear",stackOffset:"none"},isLoading:l.isValidating&&!l.data}},[l.data,l.isValidating,n]);return{contractSetMetrics:u}}();return{dataState:Q,limit:d,offset:h,isLoading:p.isLoading,error:p.error,pageCount:(null==Y?void 0:Y.length)||0,datasetCount:(null==M?void 0:M.length)||0,datasetFilteredCount:(null==K?void 0:K.length)||0,columns:X,dataset:M,cellContext:et,datasetPage:Y,configurableColumns:L,enabledColumns:Z,sortableColumns:F,toggleColumnVisibility:z,setColumnsVisible:V,setColumnsHidden:I,toggleSort:B,setSortDirection:H,setSortField:U,sortField:W,filters:A,setFilter:P,removeFilter:N,removeLastFilter:R,resetFilters:D,sortDirection:q,resetDefaultColumnVisibility:$,viewMode:e,setViewMode:t,graphMode:n,setGraphMode:r,selectedContract:T,selectContract:O,allContractsSpendingMetrics:er,selectedContractSpendingMetrics:ei,contractSetCountMetrics:eo}}();return(0,r.jsx)(j.Provider,{value:n,children:t})}},56860:function(e,t,n){"use strict";n.d(t,{Fo:function(){return o},gd:function(){return r},nw:function(){return i}});let r=["contractId","sets","hostIp","hostKey","state","timeline","size","totalCost","spendingUploads","spendingDownloads","spendingFundAccount"],i="startTime",o=[{id:"contractId",label:"contract ID",category:"general"},{id:"hostIp",label:"host address",category:"general"},{id:"hostKey",label:"host public key",category:"general"},{id:"state",label:"state",category:"general"},{id:"timeline",label:"timeline",category:"time"},{id:"startTime",label:"start date",category:"time"},{id:"endTime",label:"end date",category:"time"},{id:"size",label:"size",category:"general"},{id:"totalCost",label:"total cost",category:"financial"},{id:"spendingUploads",label:"uploads spending",category:"financial"},{id:"spendingDownloads",label:"downloads spending",category:"financial"},{id:"spendingFundAccount",label:"fund account spending",category:"financial"}]},86811:function(e,t,n){"use strict";n.d(t,{Tu:function(){return eP},xQ:function(){return eN},Rh:function(){return eA}});var r=n(52322),i=n(2784),o=n(57362),a=n(95753),s=n(71930),l=n(82851),u=n(99182),c=n(5632),d=n(4941),f=n(9969);let h={namespace:"wallet",label:"Wallet"};function p(e){var t;let{currentPage:n,parentPage:i,pushPage:a}=e,{openDialog:l,closeDialog:u}=eA(),p=(0,c.useRouter)(),m=(0,f.X2)();return(0,r.jsxs)(d.fu,{currentPage:n,commandPage:h,children:[(0,r.jsx)(d.Ul,{currentPage:n,parentPage:i,commandPage:h,onSelect:()=>{a(h)},children:h.label}),(0,r.jsx)(d.WD,{currentPage:n,commandPage:h,onSelect:()=>{p.push(s._.wallet.view),u()},children:"View wallet transactions"}),(0,r.jsx)(d.WD,{currentPage:n,commandPage:h,onSelect:()=>{l("sendSiacoin")},children:"Send siacoin"}),(0,r.jsx)(d.WD,{currentPage:n,commandPage:h,onSelect:()=>{l("addressDetails")},children:"Receive siacoin"}),(0,r.jsx)(d.WD,{currentPage:n,commandPage:h,onSelect:()=>{l("addressDetails")},children:"View wallet address"}),(0,r.jsx)(d.WD,{currentPage:n,commandPage:h,disabled:!(null===(t=m.data)||void 0===t?void 0:t.address),onSelect:()=>{var e;(null===(e=m.data)||void 0===e?void 0:e.address)&&((0,o.vQq)(m.data.address,"wallet address"),u())},children:"Copy wallet address to clipboard"})]})}var m=n(38617);let v={namespace:"settings",label:"Settings"};function g(e){let{currentPage:t,parentPage:n}=e,{openDialog:i,closeDialog:o}=eA(),{setTheme:s}=(0,m.F)(),{settings:l,setSettings:u,lock:c,currencyOptions:f,setCurrency:h}=(0,a.Hv)();return(0,r.jsxs)(d.fu,{currentPage:t,commandPage:v,children:[(0,r.jsx)(d.Ul,{currentPage:t,parentPage:n,commandPage:v,onSelect:()=>{i("settings")},children:"Open settings"}),(0,r.jsx)(d.WD,{currentPage:t,commandPage:v,onSelect:()=>{u({siaCentral:!l.siaCentral}),o()},children:(l.siaCentral?"Disable":"Enable")+" external API - Sia Central exchange rates"}),(0,r.jsx)(d.o4,{currentPage:t,commandPage:v,onSelect:()=>{c(),o()},children:"Lock renterd"}),(0,r.jsx)(d.WD,{currentPage:t,commandPage:v,onSelect:()=>{i("settings")},children:"Open interface theme menu"}),(0,r.jsx)(d.WD,{currentPage:t,commandPage:v,onSelect:()=>{s("system"),o()},children:"Set theme to system preference"}),(0,r.jsx)(d.WD,{currentPage:t,commandPage:v,onSelect:()=>{s("dark"),o()},children:"Set theme to dark"}),(0,r.jsx)(d.WD,{currentPage:t,commandPage:v,onSelect:()=>{s("light"),o()},children:"Set theme to light"}),(0,r.jsx)(d.WD,{currentPage:t,commandPage:v,onSelect:()=>{i("settings")},children:"Open currency settings menu"}),f.map(e=>{let{id:n,label:i}=e;return(0,r.jsx)(d.WD,{currentPage:t,commandPage:v,onSelect:()=>{h(n),o()},children:"Set currency to ".concat(i)},n)})]})}let y={namespace:"node",label:"Blockchain node"};function b(e){let{currentPage:t,parentPage:n,pushPage:i}=e,{openDialog:o,closeDialog:a}=eA(),l=(0,c.useRouter)();return(0,r.jsxs)(d.fu,{currentPage:t,commandPage:y,children:[(0,r.jsx)(d.Ul,{currentPage:t,parentPage:n,commandPage:y,onSelect:()=>{i(y)},children:y.label}),(0,r.jsx)(d.WD,{currentPage:t,commandPage:y,onSelect:()=>{o("connectPeer")},children:"Connect to a peer"}),(0,r.jsx)(d.WD,{currentPage:t,commandPage:y,onSelect:()=>{l.push(s._.node.index),a()},children:"View peers"}),(0,r.jsx)(d.WD,{currentPage:t,commandPage:y,onSelect:()=>{l.push(s._.node.index),a()},children:"View transaction pool"})]})}var x=n(19847),w=n(91641);let j={namespace:"configuration",label:"Configuration"};function k(e){let{currentPage:t,parentPage:n,pushPage:i}=e,o=(0,c.useRouter)(),{showAdvanced:a}=(0,x.ZR)(),{closeDialog:l}=eA(),{autopilot:u}=(0,w.q)();return(0,r.jsxs)(d.fu,{currentPage:t,commandPage:j,children:[(0,r.jsx)(d.Ul,{currentPage:t,parentPage:n,commandPage:j,onSelect:()=>{i(j)},children:j.label}),(0,r.jsx)(d.WD,{currentPage:t,commandPage:j,onSelect:()=>{o.push(s._.config.index),l()},children:"Open configuration"}),"on"===u.status&&(0,r.jsx)(d.WD,{currentPage:t,commandPage:j,onSelect:()=>{o.push(s._.config.storage),l()},children:"Configure storage"}),(0,r.jsx)(d.WD,{currentPage:t,commandPage:j,onSelect:()=>{o.push(s._.config.pricing),l()},children:"Configure pricing"}),a&&(0,r.jsxs)(r.Fragment,{children:["on"===u.status&&(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(d.WD,{currentPage:t,commandPage:j,onSelect:()=>{o.push(s._.config.hosts),l()},children:"Configure hosts"}),(0,r.jsx)(d.WD,{currentPage:t,commandPage:j,onSelect:()=>{o.push(s._.config.wallet),l()},children:"Configure wallet"})]}),(0,r.jsx)(d.WD,{currentPage:t,commandPage:j,onSelect:()=>{o.push(s._.config.contracts),l()},children:"Configure contracts"}),(0,r.jsx)(d.WD,{currentPage:t,commandPage:j,onSelect:()=>{o.push(s._.config.uploads),l()},children:"Configure uploads"}),(0,r.jsx)(d.WD,{currentPage:t,commandPage:j,onSelect:()=>{o.push(s._.config.redundancy),l()},children:"Configure redundancy"})]})]})}var E=n(93216);let S={namespace:"contracts",label:"Contracts"};function _(e){let{currentPage:t,parentPage:n,pushPage:i,beforeSelect:o,afterSelect:a}=e,l=(0,c.useRouter)(),{closeDialog:u}=eA();return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(d.Ul,{currentPage:t,parentPage:n,commandPage:n,onSelect:()=>{i(S)},children:S.label}),(0,r.jsx)(d.fu,{currentPage:t,commandPage:S,children:(0,r.jsx)(d.WD,{currentPage:t,commandPage:S,onSelect:()=>{l.push(s._.contracts.index),u()},children:"View contracts"})}),(0,r.jsx)(E.F,{parentPage:S,currentPage:t,beforeSelect:o,afterSelect:a,pushPage:i})]})}var C=n(26592),O=n(18006);let M={namespace:"hosts",label:"Hosts"};function T(e){let{currentPage:t,parentPage:n,pushPage:i,beforeSelect:o,afterSelect:a}=e,l=(0,c.useRouter)(),{closeDialog:u,openDialog:f}=eA();return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(d.Ul,{currentPage:t,parentPage:n,commandPage:n,onSelect:()=>{i(M)},children:M.label}),(0,r.jsx)(d.fu,{currentPage:t,commandPage:M,children:(0,r.jsx)(d.WD,{currentPage:t,commandPage:M,onSelect:()=>{l.push(s._.hosts.index),u()},children:"View hosts"})}),(0,r.jsx)(d.WD,{currentPage:t,commandPage:M,onSelect:()=>{f("hostsManageAllowBlock")},children:"Manage filter lists: allowlist + blocklist"}),(0,r.jsx)(O.L,{parentPage:M,currentPage:t,beforeSelect:o,afterSelect:a,pushPage:i})]})}var A=n(91652),P=n(48528),N=n(88242);function R(e){let{debouncedSearch:t}=e;return(0,r.jsxs)(o.xvT,{color:"verySubtle",className:"flex flex-col gap-2 justify-center items-center mt-5 mb-3",children:[(0,r.jsxs)(o.xvT,{color:"verySubtle",className:"flex gap-2 justify-center items-center",children:[(0,r.jsx)(N.e1T,{}),(0,r.jsx)(N.JCW,{}),(0,r.jsx)(N.c_L,{})]}),(0,r.jsx)(o.xvT,{size:"12",color:"verySubtle",className:"flex justify-center",children:t?"No files match the query.":"Type a query to get started."})]})}let D={namespace:"files/search",label:"File search",prompt:"Search for files, eg: backups, photo_archive.zip, etc...",empty:R};function L(e){let{debouncedSearch:t,search:n,currentPage:i,beforeSelect:a,afterSelect:s}=e,{activeBucket:l,navigateToFile:u}=(0,P.Y)(),c=(null==i?void 0:i.namespace)===D.namespace,h=(0,f.Iy)({disabled:!c,params:{bucket:l||"default",key:t,skip:0,limit:10},config:{swr:{keepPreviousData:!0}}});return c&&h.data?(0,r.jsx)(d.fu,{currentPage:i,commandPage:D,children:h.data.map(e=>{let{name:t}=e,l=function(e,t,n){let r=Math.max(e.length-55,0);if(0===r)return e;let i=Z(e),o=Z(t),a=i.toLowerCase().indexOf(o.toLowerCase()),s=a+o.length-1,l=0,u=0,c=i.split("/"),d=c.map(e=>{if(l>=r)return u+=e.length,Z(e);let t=u,n=u+e.length+1;return ta?(u+=e.length,Z(e)):!e.includes(o)&&e.length>3?(u+=e.length,l+=e.length+1,"..."):(u+=e.length,Z(e))});return d.reverse().join("/")}(t,n,0),{startIndex:c,endIndex:f}=function(e,t){let n=Z(e),r=Z(t),i=n.toLowerCase().indexOf(r.toLowerCase()),o=i+r.length;return{endIndex:e.length-i,startIndex:e.length-o}}(l,n);return(0,r.jsx)(d.WD,{commandPage:D,currentPage:i,onSelect:()=>{a(),u(t),s()},value:t,children:(0,r.jsxs)("div",{className:"flex items-center gap-2 overflow-hidden",children:[(0,r.jsx)(o.xvT,{color:"verySubtle",className:"group-data-[selected=true]:text-gray-1000 dark:group-data-[selected=true]:text-graydark-1000",children:(0,A.IQ)(t)?(0,r.jsx)(N.ROc,{size:16}):(0,r.jsx)(N.c_L,{})}),(0,r.jsxs)(o.xvT,{className:"flex items-center",children:[(0,r.jsx)(o.xvT,{color:"verySubtle",ellipsis:!0,children:l.slice(0,c)}),(0,r.jsx)(o.xvT,{color:"accent",ellipsis:!0,children:l.slice(c,f)}),(0,r.jsx)(o.xvT,{color:"verySubtle",ellipsis:!0,children:l.slice(f)})]})]})},t)})}):null}function Z(e){return e.split("").reverse().join("")}let F={namespace:"files",label:"Files"};function z(e){let{search:t,debouncedSearch:n,currentPage:i,parentPage:o,pushPage:a,beforeSelect:l,afterSelect:u}=e,f=(0,c.useRouter)(),{closeDialog:h}=eA();return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(d.Ul,{currentPage:i,parentPage:o,commandPage:o,onSelect:()=>{a(F)},children:F.label}),(0,r.jsxs)(d.fu,{currentPage:i,commandPage:F,children:[(0,r.jsx)(d.WD,{currentPage:i,commandPage:F,onSelect:()=>{f.pathname.startsWith(s._.files.index)||f.push(s._.files.index),h(),u()},children:"View files"}),(0,r.jsx)(d.WD,{currentPage:i,commandPage:F,onSelect:()=>{a(D),u()},children:"Search files"})]}),(0,r.jsx)(L,{debouncedSearch:n,search:t,currentPage:i,beforeSelect:l,afterSelect:u})]})}var V=n(19513),I=n(94225);function B(e){let{search:t}=e;return(0,r.jsxs)(o.xvT,{color:"verySubtle",className:"flex flex-col gap-2 justify-center items-center mt-5 mb-3",children:[(0,r.jsx)(o.xvT,{color:"verySubtle",className:"flex gap-2 justify-center items-center",children:(0,r.jsx)(N.owP,{})}),(0,r.jsx)(o.xvT,{size:"12",color:"verySubtle",className:"flex justify-center",children:t?"No results matching query.":"Type a query to get started."})]})}function H(e){let{panel:t}=e,{resetFilters:n}=(0,C.G)(),{resetFilters:a}=(0,V.l)(),{closeDialog:d}=eA(),f=(0,c.useRouter)(),[h,m]=(0,i.useState)(""),[v]=(0,I.Nr)(h,500),[y,x]=(0,i.useState)([]),w=y[y.length-1],j=0===y.length,E=(0,i.useCallback)(e=>{x(t=>[...t,e])},[x]),S=(0,i.useCallback)(()=>{d()},[d]),O=(0,i.useCallback)(()=>{m("")},[m]),M=(null==w?void 0:w.empty)||B;return(0,r.jsxs)(u.mY,{label:"Command Menu",loop:!0,className:(0,l.cx)(t&&(0,o.z$)()),onKeyDown:e=>{(y.length>0&&"Escape"===e.key||"Backspace"===e.key&&!h)&&(e.preventDefault(),x(e=>e.slice(0,-1)))},children:[w&&(0,r.jsx)(o.__J,{className:"px-2",children:w.label}),(0,r.jsx)(u.mY.Input,{value:h,onValueChange:m,className:(0,o.cEb)({variant:"ghost",focus:"none"}),placeholder:(null==w?void 0:w.prompt)||(j?"Search for commands, eg: theme, redundancy":"Search commands")}),(0,r.jsx)(o.Z0O,{className:"my-2"}),(0,r.jsxs)(u.mY.List,{children:[(0,r.jsx)(u.mY.Empty,{children:(0,r.jsx)(M,{search:h,debouncedSearch:v})}),(0,r.jsx)(g,{currentPage:w,pushPage:E}),(0,r.jsx)(z,{debouncedSearch:v,search:h,currentPage:w,pushPage:E,beforeSelect:()=>{S()},afterSelect:()=>{O()}}),(0,r.jsx)(p,{currentPage:w,pushPage:E}),(0,r.jsx)(_,{currentPage:w,pushPage:E,beforeSelect:()=>{S(),n()},afterSelect:()=>{f.pathname.startsWith(s._.contracts.index)||f.push(s._.contracts.index),O()}}),(0,r.jsx)(T,{currentPage:w,pushPage:E,beforeSelect:()=>{S(),a()},afterSelect:()=>{f.pathname.startsWith(s._.hosts.index)||f.push(s._.hosts.index),O()}}),(0,r.jsx)(k,{currentPage:w,pushPage:E}),(0,r.jsx)(b,{currentPage:w,pushPage:E})]})]})}function U(e){let{open:t,onOpenChange:n,setOpen:l}=e,{isUnlockedAndAuthedRoute:u}=(0,a.Hv)(),{isConnected:c}=(0,o.Y97)({route:s.h});return(0,i.useEffect)(()=>{if(!u||!c)return;let e=e=>{"k"===e.key&&e.metaKey&&l()};return document.addEventListener("keydown",e),()=>document.removeEventListener("keydown",e)},[u,c,l]),(0,r.jsx)(r.Fragment,{children:(0,r.jsx)(o.VqE,{open:t,onOpenChange:n,contentVariants:{className:"!absolute !p-1 w-[450px] top-[200px]"},bodyClassName:"!px-1 !py-1",closeClassName:"hidden",children:(0,r.jsx)(H,{})})})}var W=n(7114),q=n(24511);let $={name:""},K=q.Ry().shape({name:q.Z_().required("Required")});function Y(e){let{trigger:t,open:n,onOpenChange:i}=e,{activeDirectoryPath:a}=(0,P.Y)(),s=(0,f.ZM)(),l=(0,W.TA)({initialValues:$,validationSchema:K,onSubmit:async(e,t)=>{let n=await s.put({params:(0,A.W0)(a+e.name+"/"),payload:null});n.error?(0,o.OHV)(n.error):((0,o.RFt)("Directory created."),t.resetForm(),i(!1))}});return(0,r.jsx)(o.VqE,{trigger:t,title:"New directory",open:n,onOpenChange:e=>{e||l.resetForm(),i(e)},contentVariants:{className:"w-[400px]"},children:(0,r.jsx)("div",{className:"flex flex-col gap-4",children:(0,r.jsx)("form",{onSubmit:l.handleSubmit,children:(0,r.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,r.jsx)(o.cB7,{formik:l,title:"Name",name:"name",placeholder:"photos, backups, etc",autoComplete:"off",type:"text",variants:{size:"medium"}}),(0,r.jsx)(o.IKw,{formik:l,size:"medium",children:"Create"})]})})})})}var G=n(33571);let X={publicKey:""},Q=q.Ry().shape({publicKey:q.Z_().required("Required")});function J(){var e;let t=(0,f.s2)({config:{swr:{refreshInterval:6e4}}}),n=(0,G.I)(),a=(0,W.TA)({initialValues:X,validationSchema:Q,onSubmit:async(e,t)=>{let r=await n([e.publicKey],[]);r?t.resetForm():t.setStatus({error:"Error updating allowlist"})}});(0,i.useEffect)(()=>{a.setStatus(void 0)},[a.values]);let s=a.values.publicKey,l=(null===(e=t.data)||void 0===e?void 0:e.filter(e=>!a.values.publicKey||e.includes(a.values.publicKey)))||[];return(0,r.jsxs)("form",{onSubmit:a.handleSubmit,className:"flex flex-col gap-2 h-[400px]",children:[(0,r.jsx)(o.S$c,{title:"Public key",name:"publicKey",formik:a,withStatusError:!0,children:(0,r.jsxs)("div",{className:"flex gap-1",children:[(0,r.jsx)(o.KZS,{name:"publicKey",formik:a,placeholder:"ed25519:02aabd26e627fd...",autoComplete:"off",variants:{size:"small"}}),(0,r.jsx)(o.IKw,{formik:a,size:"small",variant:"amber",withStatusError:!1,children:"Allow public key"})]})}),(0,r.jsxs)(o.s_4,{className:"p-2 flex gap-2 items-center",children:[(0,r.jsx)(o.xvT,{children:(0,r.jsx)(N.qdM,{})}),(0,r.jsxs)(o.nvN,{size:"12",children:[(0,r.jsx)(o.xvT,{weight:"semibold",children:"Caution:"})," Please note that because the allowlist is inclusive, as soon as there are more than zero entries, contracting will be limited to only the hosts explicitly on the allowlist - all other existing contracts will immediately abort."]})]}),(0,r.jsx)("div",{className:"flex-1 overflow-hidden !-m-2",children:l.length?(0,r.jsx)(o.xrM,{children:(0,r.jsx)("div",{className:"p-2",children:(0,r.jsx)(o.hmz,{options:l.map(e=>({value:e,label:"".concat(e.slice(0,20),"...")}))||[],onClick:e=>(0,o.vQq)(e,"allowed public key"),onRemove:e=>n([],[e])})})}):s?(0,r.jsxs)("div",{className:"flex flex-col gap-3 items-center justify-center h-[200px]",children:[(0,r.jsx)(o.xvT,{color:"subtle",children:(0,r.jsx)(N.Hb6,{})}),(0,r.jsxs)(o.xvT,{color:"subtle",children:["No existing entries match ",a.values.publicKey,"."]})]}):(0,r.jsxs)("div",{className:"flex flex-col gap-3 items-center justify-center h-[200px]",children:[(0,r.jsx)(o.xvT,{color:"subtle",children:(0,r.jsx)(N.TtX,{})}),(0,r.jsx)(o.xvT,{color:"subtle",children:"The allowlist is empty."})]})})]})}var ee=n(98358);let et={address:""},en=["45.148.30.56","51.158.108.244","siacentral.ddnsfree.com","siacentral.mooo.com"],er=q.Ry().shape({address:q.Z_().required("Required").test("address","Invalid hostname or IP address",e=>(0,o.Ztc)().test(e||""))});function ei(){let e=(0,f.uf)({config:{swr:{refreshInterval:6e4}}}),t=(0,ee.l)(),n=(0,W.TA)({initialValues:et,validationSchema:er,onSubmit:async(e,n)=>{let r=await t([e.address],[]);r?n.resetForm():n.setStatus({error:"Error updating blocklist"})}});(0,i.useEffect)(()=>{n.setStatus(void 0)},[n.values]);let a=n.values.address,s=(0,i.useMemo)(()=>{var t;return(null===(t=e.data)||void 0===t?void 0:t.filter(e=>!n.values.address||e.includes(n.values.address)))||[]},[e.data,n.values.address]),{dataset:l}=(0,C.G)(),u=(0,i.useMemo)(()=>en.filter(t=>{var n;return!(null===(n=e.data)||void 0===n?void 0:n.find(e=>e===t))}).map(e=>({address:e,contractCount:null==l?void 0:l.filter(t=>t.hostIp===e).length})),[e.data,l]);return(0,r.jsxs)("form",{onSubmit:n.handleSubmit,className:"flex flex-col gap-2 h-[400px]",children:[(0,r.jsx)(o.S$c,{title:"Address",name:"address",formik:n,withStatusError:!0,children:(0,r.jsxs)("div",{className:"flex gap-1",children:[(0,r.jsx)(o.KZS,{name:"address",formik:n,placeholder:"eg: 51.258.128.144 or spam.ddnsfree.com",autoComplete:"off",variants:{size:"small"}}),(0,r.jsx)(o.IKw,{formik:n,size:"small",variant:"red",withStatusError:!1,children:"Block address"})]})}),(0,r.jsx)("div",{className:"flex-1 overflow-hidden !-m-2",children:(0,r.jsx)(o.xrM,{children:(0,r.jsxs)("div",{className:"p-2",children:[!!u.length&&(0,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)("div",{className:"flex gap-1 flex-wrap",children:[(0,r.jsx)(o.xvT,{size:"12",color:"subtle",children:"Suggestions:"}),u.map((e,t)=>{let{address:i,contractCount:a}=e;return(0,r.jsxs)(o.xvT,{size:"12",underline:"hover",className:"cursor-pointer",onClick:()=>n.setFieldValue("address",i),children:[i,!!a&&(0,r.jsxs)(r.Fragment,{children:[" ",(0,r.jsx)(o.ua7,{content:"".concat(a," active contracts"),children:(0,r.jsxs)(o.xvT,{color:"red",children:["(",a,")"]})})]}),t!==u.length-1&&(0,r.jsx)(o.xvT,{children:","})]},i)})]}),(0,r.jsx)(o.Z0O,{className:"my-2"})]}),s.length?(0,r.jsx)(o.hmz,{options:s.map(e=>({value:e,label:"".concat(e.slice(0,20),"...")}))||[],onClick:e=>(0,o.vQq)(e,"blocked address"),onRemove:e=>t([],[e])}):a?(0,r.jsxs)("div",{className:"flex flex-col gap-3 items-center justify-center h-[200px]",children:[(0,r.jsx)(o.xvT,{color:"subtle",children:(0,r.jsx)(N.Hb6,{})}),(0,r.jsxs)(o.xvT,{color:"subtle",children:["No existing entries match ",n.values.address,"."]})]}):(0,r.jsxs)("div",{className:"flex flex-col gap-3 items-center justify-center h-[200px]",children:[(0,r.jsx)(o.xvT,{color:"subtle",children:(0,r.jsx)(N.TtX,{})}),(0,r.jsx)(o.xvT,{color:"subtle",children:"The blocklist is empty."})]})]})})})]})}function eo(e){let{trigger:t,open:n,onOpenChange:i}=e;return(0,r.jsx)(o.VqE,{trigger:t,title:"Manage host blocklist and allowlist",open:n,onOpenChange:e=>{i(e)},contentVariants:{className:"w-[500px]"},children:(0,r.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,r.jsx)(o.nvN,{size:"12",children:"The allowlist and blocklist limit the set of hosts that renterd will consider when forming contracts. The blocklist excludes hosts with matching addresses whereas the allowlist restricts consideration to hosts with a matching public key. Each list's filtering is enabled and applied when it contains more than zero entries."}),(0,r.jsxs)(o.mQc,{defaultValue:"blocklist",children:[(0,r.jsxs)(o.drW,{"aria-label":"blocklist and allowlist tabs",children:[(0,r.jsx)(o.SPt,{value:"blocklist",children:"Block"}),(0,r.jsx)(o.SPt,{value:"allowlist",children:"Allow"})]}),(0,r.jsx)(o.nUL,{value:"blocklist",children:(0,r.jsx)(ei,{})}),(0,r.jsx)(o.nUL,{value:"allowlist",children:(0,r.jsx)(J,{})})]})]})})}var ea=n(2320),es=n(31781),el=n(24801);function eu(e){let{panel:t}=e,{resetFilters:n}=(0,C.G)(),{closeDialog:a}=eA(),d=(0,c.useRouter)(),[f,h]=(0,i.useState)(""),[p]=(0,I.Nr)(f,500),m=(0,i.useCallback)(()=>{a()},[a]);return(0,r.jsxs)(u.mY,{label:"Files search",shouldFilter:!1,className:(0,l.cx)(t&&(0,o.z$)()),children:[(0,r.jsx)(o.__J,{className:"px-2",children:"File search"}),(0,r.jsx)(u.mY.Input,{value:f,onValueChange:h,className:(0,o.cEb)({variant:"ghost",focus:"none"}),placeholder:D.prompt}),(0,r.jsx)(o.Z0O,{className:"my-2"}),(0,r.jsx)("div",{className:"overflow-hidden",children:(0,r.jsxs)(u.mY.List,{children:[(0,r.jsx)(u.mY.Empty,{children:(0,r.jsx)(R,{search:f,debouncedSearch:p})}),(0,r.jsx)(L,{debouncedSearch:p,search:f,currentPage:D,beforeSelect:()=>{m(),n()},afterSelect:()=>{d.pathname.startsWith(s._.files.index)||d.push(s._.files.index)}})]})})]})}function ec(e){let{open:t,onOpenChange:n,trigger:i}=e;return(0,r.jsx)(o.VqE,{open:t,trigger:i,onOpenChange:n,contentVariants:{className:"!absolute !p-1 w-[450px] top-[200px]"},bodyClassName:"!px-1 !py-1",closeClassName:"hidden",children:(0,r.jsx)(eu,{})})}var ed=n(6391),ef=n.n(ed);function eh(){let{dialog:e,openDialog:t,closeDialog:n}=eA(),a=(0,f.X2)(),s=(0,f.gU)(),l=(0,f.cg)(),u=(0,f.ys)(),c=(0,f.aO)(),d=(0,i.useCallback)(async e=>{let{sc:t,address:n}=e,r=await s.post({payload:{amount:t.toString(),transaction:{siacoinOutputs:[{address:n,value:t.toString()}]}}});if(r.error)return{error:r.error};let i=await l.post({payload:{transaction:r.data.transaction,toSign:r.data.toSign,coveredFields:{wholeTransaction:!0}}});if(i.error)return c.post({payload:r.data.transaction}),{error:i.error};let o=await u.post({payload:[i.data]});return o.error?(c.post({payload:i.data}),{error:o.error}):{}},[s,l,u,c]);return(0,r.jsx)(o.weF,{balance:a.data?new(ef())(a.data.spendable):void 0,send:d,open:"sendSiacoin"===e,onOpenChange:r=>r?t(e):n()})}var ep=n(63171);function em(){let{id:e,dialog:t,openDialog:n,closeDialog:a}=eA(),{dataset:s}=(0,ep.n)(),l=(0,i.useMemo)(()=>null==s?void 0:s.find(t=>t.hash===e),[s,e]);return(0,r.jsx)(o.mPE,{id:e,transaction:l,open:"transactionDetails"===t,onOpenChange:e=>e?n(t):a()})}var ev=n(82459);function eg(e){let{id:t,contentProps:n,buttonProps:i}=e,a=(0,f.cq)({params:{id:t}});return a.data?(0,r.jsx)(ev.F,{id:t,address:a.data.hostIP,publicKey:a.data.hostKey,contentProps:n,buttonProps:i}):(0,r.jsx)(o.zxk,{variant:"ghost",icon:"hover",state:"waiting",...i,children:(0,r.jsx)(N.iG7,{})})}var ey=n(848);function eb(e){let{open:t,onOpenChange:n}=e,a=(0,f.Z7)(),s=(0,f.Uy)(),l=(0,i.useCallback)(async e=>{let t=await s.post({payload:[e]});t.error?(0,o.OHV)("Error dismissing alert."):(0,o.OPV)("Alert has been dismissed.")},[s]),u=(0,i.useCallback)(async(e,t)=>{if(!a.data)return;let n=await s.post({payload:e});n.error?(0,o.OHV)(t?"Error dismissing all ".concat(t," alerts."):"Error dismissing all alerts."):(0,o.OPV)(t?"All ".concat(t," alerts have been dismissed."):"All alerts have been dismissed.")},[s,a.data]);return(0,r.jsx)(o.hcY,{open:t,onOpenChange:e=>{n(e)},alerts:a,dataFieldOrder:ex,dataFields:ew,dismissMany:u,dismissOne:l})}let ex=["hint","error","origin","hostKey","contractID","accountID","slabKey","additions","removals"],ew={contractID:{render:function(e){let{value:t}=e;return(0,r.jsxs)("div",{className:"flex justify-between w-full gap-2",children:[(0,r.jsx)(o.xvT,{color:"subtle",ellipsis:!0,children:"contract ID"}),(0,r.jsx)(o.PF9,{value:t,menu:(0,r.jsx)(eg,{id:t,contentProps:{align:"end"},buttonProps:{size:"none"}})})]})}},accountID:{render:function(e){let{value:t}=e;return(0,r.jsxs)("div",{className:"flex justify-between w-full gap-2",children:[(0,r.jsx)(o.xvT,{color:"subtle",ellipsis:!0,children:"account ID"}),(0,r.jsx)(o.XxW,{value:t,label:"account ID"})]})}},hostKey:{render:function(e){let{value:t}=e,n=(0,f.$)({params:{hostKey:t}});return n.data?(0,r.jsxs)("div",{className:"flex justify-between w-full gap-2",children:[(0,r.jsx)(o.xvT,{color:"subtle",ellipsis:!0,children:"host key"}),(0,r.jsx)(o.PF9,{value:t,menu:(0,r.jsx)(ey.G,{publicKey:n.data.publicKey,address:n.data.netAddress,contentProps:{align:"end"},buttonProps:{size:"none"}})})]}):null}},slabKey:{render:function(e){let{value:t}=e,{setActiveDirectory:n}=(0,P.Y)(),{closeDialog:i}=eA(),a=(0,f.og)({params:{key:t},config:{swr:{revalidateOnFocus:!1}}});return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)("div",{className:"flex justify-between w-full gap-2",children:[(0,r.jsx)(o.xvT,{color:"subtle",ellipsis:!0,children:"key"}),(0,r.jsx)(o.XxW,{value:t})]}),a.data&&(0,r.jsx)(o.xrM,{children:(0,r.jsx)("div",{className:"flex flex-col gap-2 mt-2 mb-2",children:a.data.map(e=>(0,r.jsx)(o.rUS,{color:"accent",underline:"hover",size:"12",noWrap:!0,onClick:()=>{n(()=>(0,A.gD)(e.name)),i()},children:e.name},e.name))})})]})}},additions:{render:function(e){let{value:t}=e;return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)("div",{className:"flex justify-between w-full gap-2",children:(0,r.jsx)(o.xvT,{color:"subtle",ellipsis:!0,children:"additions"})}),t&&(0,r.jsx)(o.xrM,{children:(0,r.jsx)("div",{className:"flex flex-wrap gap-2 mb-2",children:t.map(e=>(0,r.jsx)("div",{children:(0,r.jsx)(o.XxW,{value:e,label:"contract ID"})},e))})})]})}},removals:{render:function(e){let{value:t}=e;return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)("div",{className:"flex justify-between w-full gap-2",children:(0,r.jsx)(o.xvT,{color:"subtle",ellipsis:!0,children:"removals"})}),t&&(0,r.jsx)(o.xrM,{children:(0,r.jsx)("div",{className:"flex flex-col gap-2 mb-2",children:Object.entries(t).map(e=>{let[t,n]=e;return(0,r.jsxs)("div",{className:"flex gap-2 justify-between w-full",children:[(0,r.jsx)(o.XxW,{value:t,label:"contract ID"}),(0,r.jsx)(o.ua7,{content:n,children:(0,r.jsx)(o.xvT,{color:"subtle",ellipsis:!0,children:n})})]},t)})})})]})}},error:{render:e=>{let{value:t}=e;return(0,r.jsx)("div",{className:"flex flex-col w-full gap-2",children:(0,r.jsx)(o.UQy,{type:"single",children:(0,r.jsxs)(o.Qdk,{value:"error",variant:"ghost",children:[(0,r.jsx)(o.o48,{children:(0,r.jsx)(o.xvT,{color:"subtle",ellipsis:!0,children:"error"})}),(0,r.jsx)(o.vF,{children:(0,r.jsx)(o.xvT,{color:"contrast",children:t})})]})})})}},hint:{render:e=>{let{value:t}=e;return(0,r.jsx)("div",{className:"flex flex-col w-full gap-2",children:(0,r.jsx)(o.xvT,{color:"contrast",children:t})})}},allowance:{render:e=>{let{value:t}=e;return(0,r.jsxs)("div",{className:"flex justify-between w-full gap-2",children:[(0,r.jsx)(o.xvT,{color:"subtle",ellipsis:!0,children:"allowance"}),(0,r.jsx)(o.YKL,{variant:"value",value:new(ef())(t)})]})}},balance:{render:e=>{let{value:t}=e;return(0,r.jsxs)("div",{className:"flex justify-between w-full gap-2",children:[(0,r.jsx)(o.xvT,{color:"subtle",ellipsis:!0,children:"balance"}),(0,r.jsx)(o.YKL,{variant:"value",value:new(ef())(t)})]})}},address:{render:e=>{let{value:t}=e;return(0,r.jsxs)("div",{className:"flex justify-between w-full gap-2",children:[(0,r.jsx)(o.xvT,{color:"subtle",ellipsis:!0,children:"address"}),(0,r.jsx)(o.XxW,{value:t,type:"address"})]})}},account:{render:e=>{let{value:t}=e;return(0,r.jsxs)("div",{className:"flex justify-between w-full gap-2",children:[(0,r.jsx)(o.xvT,{color:"subtle",ellipsis:!0,children:"account"}),(0,r.jsx)(o.XxW,{value:t})]})}}};var ej=n(54155),ek=n(63955);let eE={name:""};function eS(e){let{trigger:t,open:n,onOpenChange:a}=e,{id:s,closeDialog:l}=eA(),u=(0,f.sg)(),c=(0,ek.cI)({mode:"all",defaultValues:eE}),d=(0,i.useCallback)(async e=>{let t=await u.delete({params:{name:e.name}});t.error?(0,o.OHV)(t.error):((0,o.OPV)("Bucket permanently deleted."),c.reset(),l())},[c,u,l]),h=(0,i.useMemo)(()=>({name:{type:"text",title:"Name",placeholder:s,validation:{required:"required",validate:{notDefault:()=>"default"!==s||"cannot delete default bucket",equals:e=>e===s||"bucket name does not match"}}}}),[s]),p=(0,o.WsO)(h);return(0,r.jsx)(o.VqE,{title:"Delete Bucket",trigger:t,open:n,onOpenChange:e=>{e||c.reset(eE),a(e)},contentVariants:{className:"w-[400px]"},onSubmit:c.handleSubmit(d,p),children:(0,r.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,r.jsx)(o.nvN,{size:"14",children:"Before you delete a bucket you must ensure that it is empty. Re-enter the bucket name to confirm the removal."}),(0,r.jsx)("div",{children:(0,r.jsx)(o.EKh,{color:"gray",children:s})}),(0,r.jsx)(o.yEL,{name:"name",form:c,fields:h,autoComplete:"off"}),(0,r.jsx)(o.ZqQ,{variant:"red",form:c,children:"Delete"})]})})}let e_={visibility:"public"};function eC(e){let{trigger:t,open:n,onOpenChange:a}=e,{id:s,closeDialog:l}=eA(),u=(0,f.D5)({disabled:!n,params:{name:s},config:{swr:{revalidateOnFocus:!1}}}),c=(0,f.ol)(),d=(0,ek.cI)({mode:"all",defaultValues:e_});(0,i.useEffect)(()=>{var e,t;d.reset({visibility:(null===(t=u.data)||void 0===t?void 0:null===(e=t.policy)||void 0===e?void 0:e.publicReadAccess)?"public":"private"})},[d,u.data]);let h=(0,i.useCallback)(async e=>{let t=await c.put({params:{name:s},payload:{policy:{publicReadAccess:"public"===e.visibility}}});t.error?(0,o.OHV)(t.error):((0,o.OPV)("Bucket policy has been updated."),d.reset(),l())},[d,s,c,l]),p=(0,i.useMemo)(()=>({visibility:{type:"text",title:"Read Access",placeholder:s,validation:{required:"required"},options:[{label:"Public",value:"public"},{label:"Private",value:"private"}]}}),[s]),m=(0,o.WsO)(p);return(0,r.jsx)(o.VqE,{title:"Change Policy: ".concat(s),trigger:t,open:n,onOpenChange:e=>{e||d.reset(e_),a(e)},contentVariants:{className:"w-[400px]"},onSubmit:d.handleSubmit(h,m),children:(0,r.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,r.jsx)(o.nvN,{size:"14",children:"Update the bucket's policy to set read access to either private or public. Files in public read access buckets can be accessed without authentication via the S3 API."}),(0,r.jsx)(o.WyV,{name:"visibility",form:d,fields:p}),(0,r.jsx)(o.ZqQ,{variant:"accent",form:d,children:"Update policy"})]})})}let eO={name:""};function eM(e){let{trigger:t,open:n,onOpenChange:a}=e,{closeDialog:s}=eA(),l=(0,f.oV)(),u=(0,ek.cI)({mode:"all",defaultValues:eO}),c=(0,i.useCallback)(async e=>{let t=await l.post({payload:{name:e.name}});t.error?(0,o.OHV)(t.error):((0,o.OPV)("Bucket created."),u.reset(),s())},[u,l,s]),d=(0,i.useMemo)(()=>({name:{type:"text",title:"Name",placeholder:"photos, backups, etc",validation:{required:"required"}}}),[]),h=(0,o.WsO)(d);return(0,r.jsx)(o.VqE,{title:"Create Bucket",trigger:t,open:n,onOpenChange:e=>{e||u.reset(eO),a(e)},contentVariants:{className:"w-[400px]"},onSubmit:u.handleSubmit(c,h),children:(0,r.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,r.jsx)(o.nvN,{size:"14",children:"A bucket is an isolated collection of files."}),(0,r.jsx)(o.yEL,{name:"name",form:u,fields:d,autoComplete:"off"}),(0,r.jsx)(o.ZqQ,{form:u,children:"Create bucket"})]})})}let eT=(0,i.createContext)({}),eA=()=>(0,i.useContext)(eT);function eP(e){let{children:t}=e,n=function(){let[e,t]=(0,i.useState)(),[n,r]=(0,i.useState)(),o=(0,i.useCallback)((e,n)=>{t(e),r(n)},[t,r]),[a,s]=(0,i.useState)(),l=(0,i.useCallback)(e=>{t("confirm"),s(e)},[t,s]),u=(0,i.useCallback)(()=>{t(void 0),r(void 0),s(void 0)},[t,r,s]),c=(0,i.useCallback)(e=>{e||u()},[u]);return{dialog:e,id:n,openDialog:o,confirm:a,openConfirmDialog:l,closeDialog:u,onOpenChange:c}}();return(0,r.jsx)(eT.Provider,{value:n,children:t})}function eN(){var e;let{dialog:t,openDialog:n,onOpenChange:i,closeDialog:a,confirm:s,openConfirmDialog:l}=eA(),u=(0,f.Wl)(),c=(0,f.X2)();return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(U,{open:"cmdk"===t,onOpenChange:i,setOpen:()=>n("cmdk")}),(0,r.jsx)(o.DLL,{open:"settings"===t,onOpenChange:i,showGpuSetting:!0}),(0,r.jsx)(eh,{}),(0,r.jsx)(o.YNn,{address:null===(e=c.data)||void 0===e?void 0:e.address,isValidating:c.isValidating,open:"addressDetails"===t,onOpenChange:e=>e?n(t):a()}),(0,r.jsx)(em,{}),(0,r.jsx)(o.D_D,{open:"connectPeer"===t,connect:e=>u.post({payload:e}),onOpenChange:e=>e?n(t):a()}),(0,r.jsx)(eM,{open:"filesCreateBucket"===t,onOpenChange:e=>e?n(t):a()}),(0,r.jsx)(eS,{open:"filesDeleteBucket"===t,onOpenChange:e=>e?n(t):a()}),(0,r.jsx)(eC,{open:"filesBucketPolicy"===t,onOpenChange:e=>e?n(t):a()}),(0,r.jsx)(Y,{open:"filesCreateDirectory"===t,onOpenChange:e=>e?n(t):a()}),(0,r.jsx)(ec,{open:"filesSearch"===t,onOpenChange:e=>e?n(t):a()}),(0,r.jsx)(eo,{open:"hostsManageAllowBlock"===t,onOpenChange:e=>e?n(t):a()}),(0,r.jsx)(ea.g,{open:"hostsFilterAddress"===t,onOpenChange:e=>e?n(t):a()}),(0,r.jsx)(ej.a,{open:"hostsFilterPublicKey"===t,onOpenChange:e=>e?n(t):a()}),(0,r.jsx)(es.p,{open:"contractsFilterAddress"===t,onOpenChange:e=>e?n(t):a()}),(0,r.jsx)(el.C,{open:"contractsFilterPublicKey"===t,onOpenChange:e=>e?n(t):a()}),(0,r.jsx)(eb,{open:"alerts"===t,onOpenChange:e=>e?n(t):a()}),(0,r.jsx)(o.QHy,{open:"confirm"===t,params:s,onOpenChange:e=>e?l(s):a()})]})}},48528:function(e,t,n){"use strict";n.d(t,{Z:function(){return N},Y:function(){return P}});var r=n(52322),i=n(57362),o=n(5632),a=n(2784),s=n(88242),l=n(25205),u=n(86811),c=n(9969),d=n(91652);function f(e){let{path:t}=e,n=(0,c.wy)({params:(0,d.W0)(t),config:{swr:{dedupingInterval:5e3}}});return(0,r.jsxs)(i.Xiv,{disabled:!n.data,onSelect:()=>{n.data&&(0,i.vQq)(JSON.stringify(n.data.object,null,2),"object metadata")},children:[(0,r.jsx)(i.KpP,{children:(0,r.jsx)(s.olJ,{})}),"Copy metadata"]})}function h(e){let{path:t}=e,{downloadFiles:n,getFileUrl:o,navigateToFile:l}=P(),h=function(){let{openConfirmDialog:e}=(0,u.Rh)(),t=(0,c.xw)();return(0,a.useCallback)(n=>e({title:"Delete file",action:(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(s.Jrl,{}),"Delete"]}),variant:"red",body:(0,r.jsxs)("div",{className:"flex flex-col",children:[(0,r.jsx)(i.nvN,{size:"14",children:"Are you sure you would like to delete the following file:"}),(0,r.jsx)(i.nvN,{size:"14",font:"mono",className:"break-words",children:n})]}),onConfirm:async()=>{let e=await t.delete({params:(0,d.W0)(n)});e.error&&(0,i.OHV)("Error deleting file."),(0,i.OPV)("Successfully deleted file.")}}),[e,t])}();return(0,r.jsxs)(i.h_2,{trigger:(0,r.jsx)(i.zxk,{variant:"ghost",icon:"hover",children:(0,r.jsx)(s.c_L,{})}),contentProps:{align:"start"},children:[(0,r.jsx)(i.Juw,{children:"Actions"}),(0,r.jsxs)(i.Xiv,{onSelect:async()=>{n([t])},children:[(0,r.jsx)(i.KpP,{children:(0,r.jsx)(s.vzB,{})}),"Download file"]}),(0,r.jsxs)(i.Xiv,{onSelect:()=>h(t),children:[(0,r.jsx)(i.KpP,{children:(0,r.jsx)(s.Jrl,{})}),"Delete file"]}),(0,r.jsx)(i.Juw,{children:"Filter"}),(0,r.jsxs)(i.Xiv,{onSelect:()=>{l(t)},children:[(0,r.jsx)(i.KpP,{children:(0,r.jsx)(s.q0D,{})}),"Filter by file name"]}),(0,r.jsx)(i.Juw,{children:"Copy"}),(0,r.jsxs)(i.Xiv,{onSelect:()=>{(0,i.vQq)(t,"file path")},children:[(0,r.jsx)(i.KpP,{children:(0,r.jsx)(s.olJ,{})}),"Copy file path"]}),(0,r.jsxs)(i.Xiv,{onSelect:()=>{(0,i.vQq)((0,d.vt)(t),"file path")},children:[(0,r.jsx)(i.KpP,{children:(0,r.jsx)(s.olJ,{})}),"Copy file name"]}),(0,r.jsxs)(i.Xiv,{onSelect:()=>{(0,i.vQq)(o(t,!1),"file URL")},children:[(0,r.jsx)(i.KpP,{children:(0,r.jsx)(s.olJ,{})}),"Copy URL"]}),(0,r.jsxs)(i.Xiv,{onSelect:()=>{(0,i.E5z)(o(t,!0),(0,r.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,r.jsx)(i.xvT,{children:"Copied authenticated file URL to clipboard."}),(0,r.jsxs)(i.xvT,{children:["The authenticated URL contains the ",(0,r.jsx)(i.EKh,{children:"renterd"})," ","password, be careful when pasting or sharing the URL."]})]}),{icon:(0,r.jsx)("div",{className:"!flex-none w-5",children:(0,r.jsx)(s.qdM,{className:"w-5 text-amber-600"})}),duration:1e4,className:"!max-w-[1200px]"})},children:[(0,r.jsx)(i.KpP,{children:(0,r.jsx)(s.olJ,{})}),"Copy authenticated URL"]}),(0,r.jsx)(f,{path:t})]})}function p(e){let{path:t,size:n}=e,o=function(){let{openConfirmDialog:e}=(0,u.Rh)(),t=(0,c.xw)();return(0,a.useCallback)((n,o)=>e({title:"Delete directory",action:(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(s.Jrl,{}),"Delete"]}),variant:"red",body:(0,r.jsxs)("div",{className:"flex flex-col",children:[(0,r.jsxs)(i.nvN,{size:"14",children:["Are you sure you would like to delete the following directory which contains ",(0,l.vW)(o)," of data:"]}),(0,r.jsx)(i.nvN,{size:"14",font:"mono",className:"break-words",children:n})]}),onConfirm:async()=>{let e=await t.delete({params:{...(0,d.W0)(n),batch:!0}});e.error&&(0,i.OHV)("Error deleting directory."),(0,i.OPV)("Successfully deleted directory.")}}),[e,t])}();return(0,r.jsxs)(i.h_2,{trigger:(0,r.jsx)(i.zxk,{variant:"ghost",icon:"hover",children:(0,r.jsx)(s.ROc,{size:16})}),contentProps:{align:"start"},children:[(0,r.jsx)(i.Juw,{children:"Actions"}),(0,r.jsxs)(i.Xiv,{onSelect:()=>{o(t,n)},children:[(0,r.jsx)(i.KpP,{children:(0,r.jsx)(s.Jrl,{})}),"Delete directory"]})]})}var m=n(6391),v=n.n(m),g=n(82439),y=n(82851),b=n(67693);function x(e){var t,n,o;let{path:a,isUploading:s,type:l,health:u,size:f}=e,h="directory"===l,p=(0,c.wy)({disabled:s||h,params:(0,d.W0)(a),config:{swr:{dedupingInterval:5e3}}}),{displayHealth:m,label:v}=(0,g.B)({health:u,size:f,isDirectory:h});if(p.isValidating)return(0,r.jsx)(w,{displayHealth:m,label:v,children:(0,r.jsx)("div",{className:"flex justify-center my-2",children:(0,r.jsx)(i.xgg,{})})});if(!(null===(t=p.data)||void 0===t?void 0:t.object))return(0,r.jsx)(w,{displayHealth:m,label:v,children:(0,r.jsx)(i.xvT,{size:"12",children:"Error fetching slab metadata."})});let y=(0,b.Z)(p.data.object.slabs.map(e=>{var t;return{...e.slab,isPartialSlab:!!e.slab.shards,contractSetShards:(null===(t=e.slab.shards)||void 0===t?void 0:t.length)?function(e){let{totalShards:t,minShards:n,health:r}=e,i=Math.ceil(r*(t-n)),o=i+n;return o<=0?0:o>t?t:o}({totalShards:e.slab.shards.length,minShards:e.slab.minShards,health:e.slab.health}):0}}),"contractSetShards");return(0,r.jsx)(w,{className:y.length>15?"h-[300px]":"",displayHealth:m,label:v,minShards:null===(n=y.find(e=>e.minShards))||void 0===n?void 0:n.minShards,totalShards:null===(o=y.find(e=>e.shards))||void 0===o?void 0:o.shards.length,children:y.map(e=>(0,r.jsxs)("div",{className:"flex justify-between gap-2",children:[(0,r.jsxs)(i.xvT,{size:"12",color:"subtle",className:"flex items-center",font:"mono",children:["Slab ",e.key.replace("key:","").slice(0,4),":"]}),(0,r.jsx)(i.xvT,{size:"12",className:"flex items-center",children:e.isPartialSlab?"".concat(e.contractSetShards,"/").concat(e.shards.length):"partial slab"})]},e.key))})}function w(e){let{className:t,displayHealth:n,label:o,children:a,minShards:s,totalShards:l}=e;return(0,r.jsxs)("div",{className:(0,y.cx)("z-10 flex flex-col pb-1 -mx-1 overflow-hidden",t),children:[(0,r.jsxs)("div",{className:"flex justify-between gap-2 pt-0.5 pb-px px-2",children:[(0,r.jsx)(i.xvT,{size:"12",children:o}),(0,r.jsxs)(i.xvT,{size:"12",children:[(100*n).toFixed(0),"%"]})]}),s&&l?(0,r.jsxs)("div",{className:"flex justify-between gap-2 pt-0.5 pb-px px-2",children:[(0,r.jsx)(i.xvT,{size:"12",color:"subtle",children:"redundancy"}),(0,r.jsxs)(i.xvT,{size:"12",color:"subtle",children:[s," of ",l]})]}):null,(0,r.jsx)("div",{className:"px-2",children:(0,r.jsx)(i.Z0O,{className:"w-full my-1"})}),(0,r.jsx)("div",{className:"flex-1 overflow-hidden",children:(0,r.jsx)(i.xrM,{children:(0,r.jsx)("div",{className:"px-2",children:a})})})]})}function j(e){let{name:t,isUploading:n,type:o,health:a,size:s}=e,l="directory"===o,{displayHealth:u,label:c,color:d,icon:f}=(0,g.B)({health:a,size:s,isDirectory:l});return l?".."===t?null:(0,r.jsx)(i.zsw,{rootProps:{openDelay:100},trigger:(0,r.jsx)(i.xvT,{color:d,className:"flex cursor-pointer",children:f}),children:(0,r.jsx)("div",{className:"z-10 flex flex-col -mx-1 overflow-hidden",children:(0,r.jsxs)("div",{className:"flex justify-between gap-2 py-0.5 px-2",children:[(0,r.jsx)(i.xvT,{size:"12",children:c}),(0,r.jsxs)(i.xvT,{size:"12",children:[(100*u).toFixed(0),"%"]})]})})}):n?(0,r.jsx)(i.xgg,{}):(0,r.jsx)(i.zsw,{rootProps:{openDelay:100},trigger:(0,r.jsx)(i.xvT,{color:d,className:"flex cursor-pointer",children:f}),children:(0,r.jsx)(x,{...e})})}function k(e){let{name:t}=e,{openDialog:n}=(0,u.Rh)();return(0,r.jsxs)(i.h_2,{trigger:(0,r.jsx)(i.zxk,{variant:"ghost",icon:"hover",children:(0,r.jsx)(s.fi8,{size:16})}),contentProps:{align:"start"},children:[(0,r.jsx)(i.Juw,{children:"Actions"}),(0,r.jsxs)(i.Xiv,{onSelect:()=>{n("filesBucketPolicy",t)},children:[(0,r.jsx)(i.KpP,{children:(0,r.jsx)(s.Zbu,{})}),"Change policy"]}),(0,r.jsxs)(i.Xiv,{disabled:"default"===t,onSelect:()=>{n("filesDeleteBucket",t)},children:[(0,r.jsx)(i.KpP,{children:(0,r.jsx)(s.Jrl,{})}),"Delete bucket"]})]})}let E=[{id:"type",label:"",fixed:!0,cellClassName:"w-[50px] !pl-2 !pr-2 [&+*]:!pl-0",render:function(e){let{data:{isUploading:t,type:n,name:o,path:a,size:l}}=e,{setActiveDirectory:u}=P();return t?(0,r.jsx)(i.zxk,{variant:"ghost",state:"waiting",children:(0,r.jsx)(s.c_L,{})}):".."===o?(0,r.jsx)(i.zxk,{variant:"ghost",icon:"hover",onClick:e=>{e.stopPropagation(),u(e=>e.slice(0,-1))},children:(0,r.jsx)(s.ROc,{size:16})}):"bucket"===n?(0,r.jsx)(k,{name:o}):"directory"===n?(0,r.jsx)(p,{path:a,size:l}):(0,r.jsx)(h,{path:a})}},{id:"name",label:"name",category:"general",contentClassName:"max-w-[600px]",render:function(e){let{data:{name:t,type:n}}=e,{setActiveDirectory:o}=P();return"bucket"===n?(0,r.jsx)(i.xvT,{ellipsis:!0,color:"accent",weight:"semibold",className:"cursor-pointer",onClick:e=>{e.stopPropagation(),o(()=>[t])},children:t}):"directory"===n?".."===t?(0,r.jsx)(i.xvT,{ellipsis:!0,color:"accent",weight:"semibold",className:"cursor-pointer",onClick:e=>{e.stopPropagation(),o(e=>e.slice(0,-1))},children:t}):(0,r.jsx)(i.xvT,{ellipsis:!0,color:"accent",weight:"semibold",className:"cursor-pointer",onClick:e=>{e.stopPropagation(),o(e=>e.concat(t.slice(0,-1)))},children:t}):(0,r.jsx)(i.xvT,{ellipsis:!0,weight:"semibold",children:t})}},{id:"readAccess",label:"public read access",contentClassName:"justify-center",render:function(e){var t,n;let{data:o}=e;if(".."===o.name)return null;let a=null===(n=o.bucket)||void 0===n?void 0:null===(t=n.policy)||void 0===t?void 0:t.publicReadAccess;return(0,r.jsx)(i.ua7,{content:a?"The bucket policy allows public read access.":"The bucket policy only allows private read access.",children:(0,r.jsx)("div",{children:(0,r.jsx)(i.zxk,{variant:"ghost",state:"waiting",children:(0,r.jsx)(i.xvT,{color:a?"contrast":"verySubtle",className:"flex gap-0.5 items-center",children:a?(0,r.jsx)(s.nDH,{}):(0,r.jsx)(s.Lur,{})})})})})}},{id:"size",label:"size",contentClassName:"justify-end",render:function(e){let{data:{type:t,name:n,size:o,isUploading:a}}=e;return"bucket"===t?null:a?(0,r.jsx)(i.xgg,{}):".."===n?null:(0,r.jsx)(i.m2c,{size:"12",value:new(v())(o),variant:"value",color:"subtle",format:e=>(0,l.vW)(e.toNumber())})}},{id:"health",label:"health",contentClassName:"justify-center",render:function(e){let{data:t}=e;return"bucket"===t.type?null:(0,r.jsx)(j,{...t})}}];var S=n(81471),_=n(88744),C=n(95753),O=n(69046),M=n(79381),T=n(26592);let A=(0,a.createContext)({}),P=()=>(0,a.useContext)(A);function N(e){let{children:t}=e,n=function(){let{configurableColumns:e,enabledColumns:t,sortableColumns:n,toggleColumnVisibility:r,setColumnsVisible:s,setColumnsHidden:l,toggleSort:u,setSortDirection:f,setSortField:h,sortField:p,sortDirection:m,resetDefaultColumnVisibility:v}=(0,i.oy6)("renterd/v0/objects",{columns:E,columnsDefaultVisible:S.gd,sortOptions:S.Fo,defaultSortField:S.nw}),g=(0,o.useRouter)(),{filters:y,setFilter:x,removeFilter:w,removeLastFilter:j,resetFilters:k}=(0,i.Uu5)(),A=(0,a.useMemo)(()=>(g.query.path||[]).map(decodeURIComponent),[g.query.path]),P=(0,a.useMemo)(()=>A[0],[A]),N=(0,a.useMemo)(()=>(0,d.rd)(A)+"/",[A]),R=(0,a.useCallback)(e=>{let t=e(A);g.push("/files/"+t.map(encodeURIComponent).join("/"))},[g,A]),{uploadFiles:D,uploadsList:L,uploadCancel:Z}=function(e){let{activeDirectoryPath:t}=e,n=(0,c.B$)(),r=(0,c.ZM)(),[o,s]=(0,a.useState)({}),l=(0,a.useCallback)(e=>{s(t=>({...t,[e.path]:{id:e.path,path:e.path,bucket:e.bucket,name:e.name,size:e.size,loaded:e.loaded,isUploading:!0,controller:e.controller,type:"file"}}))},[s]),u=(0,a.useCallback)(e=>{s(t=>t[e.path]?{...t,[e.path]:{...t[e.path],path:e.path,loaded:e.loaded,size:e.size}}:t)},[s]),f=(0,a.useCallback)(e=>{s(t=>(delete t[e],{...t}))},[s]),h=(0,a.useCallback)(e=>{e.controller.abort()},[]),p=async e=>{e.forEach(async e=>{var a;let s=e.name,c=(0,d.pC)(t,s),h=(0,d.ru)(c),p=null===(a=n.data)||void 0===a?void 0:a.find(e=>e.name===h);if(o[c]){(0,i.OHV)("Already uploading file: ".concat(c));return}let m=new AbortController,v=(0,_.Z)(e=>u({path:c,loaded:e.loaded,size:e.total}),2e3);l({path:c,name:s,bucket:p,loaded:0,size:1,controller:m});let g=await r.put({params:(0,d.W0)(c),payload:e,config:{axios:{onUploadProgress:v,signal:m.signal}}});g.error?("canceled"===g.error?(0,i.RFt)("File upload canceled."):(0,i.OHV)(g.error),f(c)):(f(c),(0,i.OPV)("Upload complete: ".concat(s)))})},m=(0,a.useMemo)(()=>Object.entries(o).map(e=>e[1]),[o]);return{uploadFiles:p,uploadsList:m,uploadCancel:h}}({activeDirectoryPath:N}),{downloadFiles:F,downloadsList:z,getFileUrl:V,downloadCancel:I}=function(){let e=(0,c.B$)(),t=(0,c.p$)(),[n,r]=(0,a.useState)({}),o=(0,a.useCallback)(e=>{r(t=>({...t,[e.path]:{id:e.path,path:e.path,bucket:e.bucket,name:e.name,size:e.size,loaded:e.loaded,isUploading:!1,controller:e.controller,type:"file"}}))},[r]),s=(0,a.useCallback)(e=>{r(t=>t[e.path]?{...t,[e.path]:{...t[e.path],path:e.path,loaded:e.loaded,size:e.size}}:t)},[r]),l=(0,a.useCallback)(e=>{r(t=>(delete t[e],{...t}))},[r]),u=(0,a.useCallback)(e=>{e.controller.abort()},[]),f=async r=>{r.forEach(async r=>{var a;let u=!1,c=(0,d.ru)(r),f=null===(a=e.data)||void 0===a?void 0:a.find(e=>e.name===c),h=(0,d.vt)(r);if(n[r]){(0,i.OHV)("Already downloading file: ".concat(r));return}let p=new AbortController,m=(0,_.Z)(e=>{u||s({path:r,loaded:e.loaded,size:e.total})},2e3);o({path:r,name:h,bucket:f,loaded:0,size:1,controller:p});let v=await t.get(h,{params:(0,d.W0)(r),config:{axios:{onDownloadProgress:m,signal:p.signal}}});u=!0,v.error&&("canceled"===v.error?(0,i.RFt)("File download canceled."):(0,i.OHV)(v.error)),l(r)})},h=(0,a.useMemo)(()=>Object.entries(n).map(e=>e[1]),[n]),{settings:p}=(0,C.Hv)(),m=(0,a.useCallback)((e,t)=>{let{bucket:n,key:r}=(0,d.W0)(e),i="/worker/objects/".concat(r,"?bucket=").concat(n),o=p.api||location.origin,a=o.startsWith("https")?"https":"http",s=o.replace("https://","").replace("http://","");return t?"".concat(a,"://:").concat(p.password,"@").concat(s,"/api").concat(i):"".concat(a,"://").concat(s,"/api").concat(i)},[p]);return{downloadFiles:f,downloadsList:h,getFileUrl:m,downloadCancel:u}}(),{limit:B,offset:H,response:U,dataset:W}=function(e){var t,n;let{activeDirectoryPath:r,uploadsList:s,sortDirection:l,sortField:u,filters:f}=e,h=(0,c.B$)(),p=(0,o.useRouter)(),m=Number(p.query.limit||50),v=Number(p.query.offset||0),g=(0,d.ru)(r),y=null===(t=h.data)||void 0===t?void 0:t.find(e=>e.name===g),x=(null===(n=f.find(e=>"fileNamePrefix"===e.id))||void 0===n?void 0:n.value)||"",w=(0,a.useMemo)(()=>{let e={...(0,d.W0)(r),sortBy:u,sortDir:l,offset:v,limit:m};return x&&(e.prefix=x),e},[r,x,u,l,v,m]),j=(0,c.Jv)({disabled:!g,params:w,config:{swr:{refreshInterval:(0,i.sWj)(1)}}}),{dataset:k}=(0,T.G)(),E=(0,M.ZP)(j.isValidating||h.isValidating?null:[j.data,s,k,h.data,g,r],()=>{var e,t;let n={};y?j.data&&(null===(t=j.data.entries)||void 0===t||t.forEach(e=>{let{name:t,size:r,health:i}=e,o=(0,d.M7)(g,t);n[o]={id:o,path:o,bucket:y,size:r,health:i,name:(0,d.vt)(t),type:(0,d.IQ)(t)?"directory":"file"}}),s.filter(e=>{let{path:t,name:n}=e;return t===(0,d.pC)(r,n)}).forEach(e=>{n[e.path]=e})):null===(e=h.data)||void 0===e||e.forEach(e=>{let t=e.name,r=(0,d.wv)(t,"");n[t]={id:r,path:r,bucket:e,size:0,health:0,name:t,type:"bucket"}});let i=(0,b.Z)((0,O.Z)(n).map(e=>e[1]),u);return"desc"===l&&i.reverse(),i},{keepPreviousData:!0});return{limit:m,offset:v,response:j,dataset:E.data}}({activeDirectoryPath:N,uploadsList:L,sortField:p,sortDirection:m,filters:y}),q=(0,a.useMemo)(()=>W?A.length>0&&W.length>0?[{id:"..",name:"..",path:"..",type:"directory"},...W]:W:null,[W]),$=(0,a.useMemo)(()=>E.filter(e=>e.fixed||t.includes(e.id)),[t]),K=(0,i.c2j)(W,U.isValidating,U.error,y),Y=0===A.length,G=1===A.length,X=A.length>0,Q=(0,a.useCallback)(e=>{R(()=>[P,...(0,d.gD)(e)]),x({id:"fileNamePrefix",label:"",value:(0,d.vt)(e)})},[P,R,x]);return{isViewingBuckets:Y,isViewingABucket:X,isViewingRootOfABucket:G,activeBucket:P,activeDirectory:A,setActiveDirectory:R,activeDirectoryPath:N,navigateToFile:Q,dataState:K,limit:B,offset:H,datasetPage:q,pageCount:(null==W?void 0:W.length)||0,columns:$,uploadFiles:D,uploadsList:L,uploadCancel:Z,downloadFiles:F,downloadsList:z,downloadCancel:I,configurableColumns:e,enabledColumns:t,sortableColumns:n,toggleColumnVisibility:r,setColumnsVisible:s,setColumnsHidden:l,toggleSort:u,setSortDirection:f,setSortField:h,sortField:p,filters:y,setFilter:x,removeFilter:w,removeLastFilter:j,resetFilters:k,sortDirection:m,resetDefaultColumnVisibility:v,getFileUrl:V}}();return(0,r.jsx)(A.Provider,{value:n,children:t})}},91652:function(e,t,n){"use strict";function r(e,t){let n=t.startsWith("/")?t.slice(1):t;return e+n}function i(e,t){let n=r(e,t);return n.endsWith("/")?n:n+"/"}function o(e,t){return"".concat(e).concat(t)}function a(e){return e.split("/")[0]}function s(e){return{bucket:a(e),key:(function(e){let t=e.split("/").slice(1).join("/");return"/".concat(t)})(e).slice(1).split("/").map(encodeURIComponent).join("/")}}function l(e){let t=e.split("/");return e.endsWith("/")?"".concat(t[t.length-2],"/"):t[t.length-1]}function u(e){return e.endsWith("/")}function c(e){return u(e)?e.slice(0,-1).split("/"):e.split("/").slice(0,-1)}function d(e){return e.join("/")}n.d(t,{IQ:function(){return u},M7:function(){return o},W0:function(){return s},gD:function(){return c},pC:function(){return r},rd:function(){return d},ru:function(){return a},vt:function(){return l},wv:function(){return i}})},81471:function(e,t,n){"use strict";n.d(t,{Fo:function(){return o},gd:function(){return r},nw:function(){return i}});let r=["type","name","readAccess","size","health"],i="name",o=[{id:"name",label:"name",category:"general"},{id:"health",label:"health",category:"general"}]},19513:function(e,t,n){"use strict";n.d(t,{x:function(){return eu},l:function(){return el}});var r,i,o=n(52322),a=n(57362),s=n(9969),l=n(2784);let u=["allow","netAddress","publicKey","lastScan","lastAnnouncement","totalScans","uptime","hasContract","ap_usable","ap_scoreOverall"];var c=n(5632),d=n(88242),f=n(25205),h=n(19785),p=n(66700),m=n(88811);function v(e){if(null===e||!0===e||!1===e)return NaN;var t=Number(e);return isNaN(t)?t:t<0?Math.ceil(t):Math.floor(t)}function g(e,t){return(0,h.Z)(2,arguments),function(e,t){(0,h.Z)(2,arguments);var n=(0,p.Z)(e).getTime(),r=v(t);return new Date(n+r)}(e,-v(t))}function y(e){(0,h.Z)(1,arguments);var t=(0,p.Z)(e),n=t.getUTCDay();return t.setUTCDate(t.getUTCDate()-((n<1?7:0)+n-1)),t.setUTCHours(0,0,0,0),t}function b(e){(0,h.Z)(1,arguments);var t=(0,p.Z)(e),n=t.getUTCFullYear(),r=new Date(0);r.setUTCFullYear(n+1,0,4),r.setUTCHours(0,0,0,0);var i=y(r),o=new Date(0);o.setUTCFullYear(n,0,4),o.setUTCHours(0,0,0,0);var a=y(o);return t.getTime()>=i.getTime()?n+1:t.getTime()>=a.getTime()?n:n-1}function x(e,t){(0,h.Z)(1,arguments);var n=t||{},r=n.locale,i=r&&r.options&&r.options.weekStartsOn,o=null==i?0:v(i),a=null==n.weekStartsOn?o:v(n.weekStartsOn);if(!(a>=0&&a<=6))throw RangeError("weekStartsOn must be between 0 and 6 inclusively");var s=(0,p.Z)(e),l=s.getUTCDay();return s.setUTCDate(s.getUTCDate()-((l=1&&l<=7))throw RangeError("firstWeekContainsDate must be between 1 and 7 inclusively");var u=new Date(0);u.setUTCFullYear(r+1,0,l),u.setUTCHours(0,0,0,0);var c=x(u,t),d=new Date(0);d.setUTCFullYear(r,0,l),d.setUTCHours(0,0,0,0);var f=x(d,t);return n.getTime()>=c.getTime()?r+1:n.getTime()>=f.getTime()?r:r-1}function j(e,t){for(var n=Math.abs(e).toString();n.length0?n:1-n;return j("yy"===t?r%100:r,t.length)},M:function(e,t){var n=e.getUTCMonth();return"M"===t?String(n+1):j(n+1,2)},d:function(e,t){return j(e.getUTCDate(),t.length)},a:function(e,t){var n=e.getUTCHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return n.toUpperCase();case"aaa":return n;case"aaaaa":return n[0];default:return"am"===n?"a.m.":"p.m."}},h:function(e,t){return j(e.getUTCHours()%12||12,t.length)},H:function(e,t){return j(e.getUTCHours(),t.length)},m:function(e,t){return j(e.getUTCMinutes(),t.length)},s:function(e,t){return j(e.getUTCSeconds(),t.length)},S:function(e,t){var n=t.length;return j(Math.floor(e.getUTCMilliseconds()*Math.pow(10,n-3)),t.length)}},E={midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"};function S(e,t){var n=e>0?"-":"+",r=Math.abs(e),i=Math.floor(r/60),o=r%60;return 0===o?n+String(i):n+String(i)+(t||"")+j(o,2)}function _(e,t){return e%60==0?(e>0?"-":"+")+j(Math.abs(e)/60,2):C(e,t)}function C(e,t){var n=e>0?"-":"+",r=Math.abs(e);return n+j(Math.floor(r/60),2)+(t||"")+j(r%60,2)}var O={G:function(e,t,n){var r=e.getUTCFullYear()>0?1:0;switch(t){case"G":case"GG":case"GGG":return n.era(r,{width:"abbreviated"});case"GGGGG":return n.era(r,{width:"narrow"});default:return n.era(r,{width:"wide"})}},y:function(e,t,n){if("yo"===t){var r=e.getUTCFullYear(),i=r>0?r:1-r;return n.ordinalNumber(i,{unit:"year"})}return k.y(e,t)},Y:function(e,t,n,r){var i=w(e,r),o=i>0?i:1-i;return"YY"===t?j(o%100,2):"Yo"===t?n.ordinalNumber(o,{unit:"year"}):j(o,t.length)},R:function(e,t){return j(b(e),t.length)},u:function(e,t){return j(e.getUTCFullYear(),t.length)},Q:function(e,t,n){var r=Math.ceil((e.getUTCMonth()+1)/3);switch(t){case"Q":return String(r);case"QQ":return j(r,2);case"Qo":return n.ordinalNumber(r,{unit:"quarter"});case"QQQ":return n.quarter(r,{width:"abbreviated",context:"formatting"});case"QQQQQ":return n.quarter(r,{width:"narrow",context:"formatting"});default:return n.quarter(r,{width:"wide",context:"formatting"})}},q:function(e,t,n){var r=Math.ceil((e.getUTCMonth()+1)/3);switch(t){case"q":return String(r);case"qq":return j(r,2);case"qo":return n.ordinalNumber(r,{unit:"quarter"});case"qqq":return n.quarter(r,{width:"abbreviated",context:"standalone"});case"qqqqq":return n.quarter(r,{width:"narrow",context:"standalone"});default:return n.quarter(r,{width:"wide",context:"standalone"})}},M:function(e,t,n){var r=e.getUTCMonth();switch(t){case"M":case"MM":return k.M(e,t);case"Mo":return n.ordinalNumber(r+1,{unit:"month"});case"MMM":return n.month(r,{width:"abbreviated",context:"formatting"});case"MMMMM":return n.month(r,{width:"narrow",context:"formatting"});default:return n.month(r,{width:"wide",context:"formatting"})}},L:function(e,t,n){var r=e.getUTCMonth();switch(t){case"L":return String(r+1);case"LL":return j(r+1,2);case"Lo":return n.ordinalNumber(r+1,{unit:"month"});case"LLL":return n.month(r,{width:"abbreviated",context:"standalone"});case"LLLLL":return n.month(r,{width:"narrow",context:"standalone"});default:return n.month(r,{width:"wide",context:"standalone"})}},w:function(e,t,n,r){var i=function(e,t){(0,h.Z)(1,arguments);var n=(0,p.Z)(e);return Math.round((x(n,t).getTime()-(function(e,t){(0,h.Z)(1,arguments);var n=t||{},r=n.locale,i=r&&r.options&&r.options.firstWeekContainsDate,o=null==i?1:v(i),a=null==n.firstWeekContainsDate?o:v(n.firstWeekContainsDate),s=w(e,t),l=new Date(0);return l.setUTCFullYear(s,0,a),l.setUTCHours(0,0,0,0),x(l,t)})(n,t).getTime())/6048e5)+1}(e,r);return"wo"===t?n.ordinalNumber(i,{unit:"week"}):j(i,t.length)},I:function(e,t,n){var r=function(e){(0,h.Z)(1,arguments);var t=(0,p.Z)(e);return Math.round((y(t).getTime()-(function(e){(0,h.Z)(1,arguments);var t=b(e),n=new Date(0);return n.setUTCFullYear(t,0,4),n.setUTCHours(0,0,0,0),y(n)})(t).getTime())/6048e5)+1}(e);return"Io"===t?n.ordinalNumber(r,{unit:"week"}):j(r,t.length)},d:function(e,t,n){return"do"===t?n.ordinalNumber(e.getUTCDate(),{unit:"date"}):k.d(e,t)},D:function(e,t,n){var r=function(e){(0,h.Z)(1,arguments);var t=(0,p.Z)(e),n=t.getTime();return t.setUTCMonth(0,1),t.setUTCHours(0,0,0,0),Math.floor((n-t.getTime())/864e5)+1}(e);return"Do"===t?n.ordinalNumber(r,{unit:"dayOfYear"}):j(r,t.length)},E:function(e,t,n){var r=e.getUTCDay();switch(t){case"E":case"EE":case"EEE":return n.day(r,{width:"abbreviated",context:"formatting"});case"EEEEE":return n.day(r,{width:"narrow",context:"formatting"});case"EEEEEE":return n.day(r,{width:"short",context:"formatting"});default:return n.day(r,{width:"wide",context:"formatting"})}},e:function(e,t,n,r){var i=e.getUTCDay(),o=(i-r.weekStartsOn+8)%7||7;switch(t){case"e":return String(o);case"ee":return j(o,2);case"eo":return n.ordinalNumber(o,{unit:"day"});case"eee":return n.day(i,{width:"abbreviated",context:"formatting"});case"eeeee":return n.day(i,{width:"narrow",context:"formatting"});case"eeeeee":return n.day(i,{width:"short",context:"formatting"});default:return n.day(i,{width:"wide",context:"formatting"})}},c:function(e,t,n,r){var i=e.getUTCDay(),o=(i-r.weekStartsOn+8)%7||7;switch(t){case"c":return String(o);case"cc":return j(o,t.length);case"co":return n.ordinalNumber(o,{unit:"day"});case"ccc":return n.day(i,{width:"abbreviated",context:"standalone"});case"ccccc":return n.day(i,{width:"narrow",context:"standalone"});case"cccccc":return n.day(i,{width:"short",context:"standalone"});default:return n.day(i,{width:"wide",context:"standalone"})}},i:function(e,t,n){var r=e.getUTCDay(),i=0===r?7:r;switch(t){case"i":return String(i);case"ii":return j(i,t.length);case"io":return n.ordinalNumber(i,{unit:"day"});case"iii":return n.day(r,{width:"abbreviated",context:"formatting"});case"iiiii":return n.day(r,{width:"narrow",context:"formatting"});case"iiiiii":return n.day(r,{width:"short",context:"formatting"});default:return n.day(r,{width:"wide",context:"formatting"})}},a:function(e,t,n){var r=e.getUTCHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return n.dayPeriod(r,{width:"abbreviated",context:"formatting"});case"aaa":return n.dayPeriod(r,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return n.dayPeriod(r,{width:"narrow",context:"formatting"});default:return n.dayPeriod(r,{width:"wide",context:"formatting"})}},b:function(e,t,n){var r,i=e.getUTCHours();switch(r=12===i?E.noon:0===i?E.midnight:i/12>=1?"pm":"am",t){case"b":case"bb":return n.dayPeriod(r,{width:"abbreviated",context:"formatting"});case"bbb":return n.dayPeriod(r,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return n.dayPeriod(r,{width:"narrow",context:"formatting"});default:return n.dayPeriod(r,{width:"wide",context:"formatting"})}},B:function(e,t,n){var r,i=e.getUTCHours();switch(r=i>=17?E.evening:i>=12?E.afternoon:i>=4?E.morning:E.night,t){case"B":case"BB":case"BBB":return n.dayPeriod(r,{width:"abbreviated",context:"formatting"});case"BBBBB":return n.dayPeriod(r,{width:"narrow",context:"formatting"});default:return n.dayPeriod(r,{width:"wide",context:"formatting"})}},h:function(e,t,n){if("ho"===t){var r=e.getUTCHours()%12;return 0===r&&(r=12),n.ordinalNumber(r,{unit:"hour"})}return k.h(e,t)},H:function(e,t,n){return"Ho"===t?n.ordinalNumber(e.getUTCHours(),{unit:"hour"}):k.H(e,t)},K:function(e,t,n){var r=e.getUTCHours()%12;return"Ko"===t?n.ordinalNumber(r,{unit:"hour"}):j(r,t.length)},k:function(e,t,n){var r=e.getUTCHours();return(0===r&&(r=24),"ko"===t)?n.ordinalNumber(r,{unit:"hour"}):j(r,t.length)},m:function(e,t,n){return"mo"===t?n.ordinalNumber(e.getUTCMinutes(),{unit:"minute"}):k.m(e,t)},s:function(e,t,n){return"so"===t?n.ordinalNumber(e.getUTCSeconds(),{unit:"second"}):k.s(e,t)},S:function(e,t){return k.S(e,t)},X:function(e,t,n,r){var i=(r._originalDate||e).getTimezoneOffset();if(0===i)return"Z";switch(t){case"X":return _(i);case"XXXX":case"XX":return C(i);default:return C(i,":")}},x:function(e,t,n,r){var i=(r._originalDate||e).getTimezoneOffset();switch(t){case"x":return _(i);case"xxxx":case"xx":return C(i);default:return C(i,":")}},O:function(e,t,n,r){var i=(r._originalDate||e).getTimezoneOffset();switch(t){case"O":case"OO":case"OOO":return"GMT"+S(i,":");default:return"GMT"+C(i,":")}},z:function(e,t,n,r){var i=(r._originalDate||e).getTimezoneOffset();switch(t){case"z":case"zz":case"zzz":return"GMT"+S(i,":");default:return"GMT"+C(i,":")}},t:function(e,t,n,r){return j(Math.floor((r._originalDate||e).getTime()/1e3),t.length)},T:function(e,t,n,r){return j((r._originalDate||e).getTime(),t.length)}};function M(e,t){switch(e){case"P":return t.date({width:"short"});case"PP":return t.date({width:"medium"});case"PPP":return t.date({width:"long"});default:return t.date({width:"full"})}}function T(e,t){switch(e){case"p":return t.time({width:"short"});case"pp":return t.time({width:"medium"});case"ppp":return t.time({width:"long"});default:return t.time({width:"full"})}}var A={p:T,P:function(e,t){var n,r=e.match(/(P+)(p+)?/)||[],i=r[1],o=r[2];if(!o)return M(e,t);switch(i){case"P":n=t.dateTime({width:"short"});break;case"PP":n=t.dateTime({width:"medium"});break;case"PPP":n=t.dateTime({width:"long"});break;default:n=t.dateTime({width:"full"})}return n.replace("{{date}}",M(i,t)).replace("{{time}}",T(o,t))}},P=n(1645),N=["D","DD"],R=["YY","YYYY"];function D(e,t,n){if("YYYY"===e)throw RangeError("Use `yyyy` instead of `YYYY` (in `".concat(t,"`) for formatting years to the input `").concat(n,"`; see: https://git.io/fxCyr"));if("YY"===e)throw RangeError("Use `yy` instead of `YY` (in `".concat(t,"`) for formatting years to the input `").concat(n,"`; see: https://git.io/fxCyr"));if("D"===e)throw RangeError("Use `d` instead of `D` (in `".concat(t,"`) for formatting days of the month to the input `").concat(n,"`; see: https://git.io/fxCyr"));if("DD"===e)throw RangeError("Use `dd` instead of `DD` (in `".concat(t,"`) for formatting days of the month to the input `").concat(n,"`; see: https://git.io/fxCyr"))}var L=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,Z=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,F=/^'([^]*?)'?$/,z=/''/g,V=/[a-zA-Z]/;function I(e,t,n){(0,h.Z)(2,arguments);var r=String(t),i=n||{},o=i.locale||m.Z,a=o.options&&o.options.firstWeekContainsDate,s=null==a?1:v(a),l=null==i.firstWeekContainsDate?s:v(i.firstWeekContainsDate);if(!(l>=1&&l<=7))throw RangeError("firstWeekContainsDate must be between 1 and 7 inclusively");var u=o.options&&o.options.weekStartsOn,c=null==u?0:v(u),d=null==i.weekStartsOn?c:v(i.weekStartsOn);if(!(d>=0&&d<=6))throw RangeError("weekStartsOn must be between 0 and 6 inclusively");if(!o.localize)throw RangeError("locale must contain localize property");if(!o.formatLong)throw RangeError("locale must contain formatLong property");var f=(0,p.Z)(e);if(!function(e){return(0,h.Z)(1,arguments),(!!function(e){return(0,h.Z)(1,arguments),e instanceof Date||"object"==typeof e&&"[object Date]"===Object.prototype.toString.call(e)}(e)||"number"==typeof e)&&!isNaN(Number((0,p.Z)(e)))}(f))throw RangeError("Invalid time value");var y=(0,P.Z)(f),b=g(f,y),x={firstWeekContainsDate:l,weekStartsOn:d,locale:o,_originalDate:f};return r.match(Z).map(function(e){var t=e[0];return"p"===t||"P"===t?(0,A[t])(e,o.formatLong,x):e}).join("").match(L).map(function(n){if("''"===n)return"'";var r=n[0];if("'"===r)return n.match(F)[1].replace(z,"'");var a=O[r];if(a)return i.useAdditionalWeekYearTokens||-1===R.indexOf(n)||D(n,t,e),i.useAdditionalDayOfYearTokens||-1===N.indexOf(n)||D(n,t,e),a(b,n,o.localize,x);if(r.match(V))throw RangeError("Format string contains an unescaped latin alphabet character `"+r+"`");return n}).join("")}var B=n(29193);function H(e){(0,h.Z)(1,arguments);var t=(0,p.Z)(e);return t.setHours(0,0,0,0),t}var U=n(848),W=n(95753),q=n(6391),$=n.n(q);let K=[{id:"actions",label:"",fixed:!0,category:"general",cellClassName:"w-[50px] !pl-2 !pr-4 [&+*]:!pl-0",render:e=>{let{data:t}=e;return(0,o.jsx)(U.G,{address:t.netAddress,publicKey:t.publicKey})}},{id:"allow",label:"allowed",category:"general",contentClassName:"justify-center",render:function(e){var t;let{data:n}=e,r=(0,s.s2)({config:{swr:{dedupingInterval:5e3}}}),i=!!(null===(t=r.data)||void 0===t?void 0:t.length);return(0,o.jsx)(a.ua7,{side:"right",content:(i?"Allowlist ".concat(n.isOnAllowlist?"allows this host.":"does not allow this host."):"Allowlist is inactive.")+" Blocklist ".concat(n.isOnBlocklist?"blocks this host.":"does not block this host."),children:(0,o.jsxs)("div",{className:"flex gap-2 items-center",children:[(0,o.jsx)("div",{className:"mt-[5px]",children:(0,o.jsx)(a.xvT,{color:n.isBlocked?"red":"green",children:n.isBlocked?(0,o.jsx)(d.SmH,{}):(0,o.jsx)(d.DI$,{})})}),(0,o.jsxs)("div",{className:"flex flex-col",children:[(0,o.jsx)(a.xvT,{size:"10",color:n.isOnBlocklist?"red":"verySubtle",noWrap:!0,children:"Blocklist"}),(0,o.jsx)(a.xvT,{size:"10",color:i?n.isOnAllowlist?"green":"red":"verySubtle",noWrap:!0,children:"Allowlist"})]})]})})}},{id:"ap_usable",label:"usable",category:"autopilot",render:e=>{let{data:t,context:n}=e;return n.isAutopilotConfigured?(0,o.jsx)(a.ua7,{side:"right",content:t.usable?"Host is usable":"Host is not usable",children:(0,o.jsxs)("div",{className:"flex gap-2 items-center",children:[(0,o.jsx)("div",{className:"mt-[5px]",children:(0,o.jsx)(a.xvT,{color:t.usable?"green":"red",children:t.usable?(0,o.jsx)(d.DI$,{}):(0,o.jsx)(d.SmH,{})})}),(0,o.jsx)("div",{className:"flex flex-col",children:t.unusableReasons.map(e=>(0,o.jsx)(a.xvT,{size:"10",noWrap:!0,children:e},e))})]})}):(0,o.jsx)(a.ua7,{side:"right",content:"Autopilot is not configured",children:(0,o.jsx)("div",{className:"mt-[5px]",children:(0,o.jsx)(a.xvT,{color:"subtle",children:(0,o.jsx)(d.I98,{})})})})}},{id:"ap_gouging",label:"gouging",category:"autopilot",render:e=>{let{data:t,context:n}=e;return n.isAutopilotConfigured?(0,o.jsx)(a.ua7,{side:"right",content:t.gouging?"Host is price gouging":"Host is not price gouging",children:(0,o.jsxs)("div",{className:"flex gap-2 items-center",children:[(0,o.jsx)("div",{className:"mt-[5px]",children:(0,o.jsx)(a.xvT,{color:t.gouging?"red":"subtle",children:t.gouging?(0,o.jsx)(d.SmH,{}):(0,o.jsx)(d.I98,{})})}),(0,o.jsx)("div",{className:"flex flex-col",children:Object.entries(t.gougingBreakdown).filter(e=>{let[t,n]=e;return n&&"string"==typeof n}).map(e=>{let[t,n]=e;return(0,o.jsx)(a.xvT,{size:"10",noWrap:!0,children:n},t)})})]})}):(0,o.jsx)(a.ua7,{side:"right",content:"Autopilot is not configured",children:(0,o.jsx)("div",{className:"mt-[5px]",children:(0,o.jsx)(a.xvT,{color:"subtle",children:(0,o.jsx)(d.I98,{})})})})}},{id:"lastScan",label:"last scan",category:"general",render:function(e){let{data:t}=e,{workflows:n}=(0,W.D)(),r=n.find(e=>{var n;return e.path.startsWith(s.RF)&&(null===(n=e.payload)||void 0===n?void 0:n.hostKey)===t.publicKey});if(r)return(0,o.jsx)(a.xgg,{});let i=(0,B.Z)(new Date(t.lastScan||0),new Date,{addSuffix:!0}),l="",u=null,c="subtle";return t.lastScan||(l="host has not been scanned",u=(0,o.jsx)(d.I98,{}),c="subtle"),t.lastScan&&!t.lastScanSuccess&&(l="host scan failed ".concat(i),u=(0,o.jsx)(d.SmH,{}),c="red"),t.lastScan&&t.lastScanSuccess&&(l="host scan succeeded ".concat(i),u=(0,o.jsx)(d.DI$,{}),c="green"),(0,o.jsx)(a.ua7,{side:"right",content:l,children:(0,o.jsxs)("div",{className:"flex gap-2 items-center",children:[(0,o.jsx)("div",{className:"mt-[5px]",children:(0,o.jsx)(a.xvT,{color:c,children:u})}),t.lastScan&&(0,o.jsxs)("div",{className:"flex flex-col",children:[(0,o.jsx)(a.xvT,{size:"12",noWrap:!0,children:i}),(0,o.jsx)(a.xvT,{color:"subtle",size:"10",noWrap:!0,children:I(new Date(t.lastScan),"Pp")})]})]})})}},{id:"hasContract",label:"active contract",category:"general",contentClassName:"w-[50px]",render:e=>{let{data:t}=e,n=t.activeContractsCount.gt(0);return(0,o.jsx)(a.ua7,{side:"right",content:n?"Host has active contract":"Host does not have an active contract",children:(0,o.jsx)("div",{className:"mt-[5px]",children:(0,o.jsx)(a.xvT,{color:n?"green":"subtle",children:n?(0,o.jsx)(d.DI$,{}):(0,o.jsx)(d.I98,{})})})})}},{id:"netAddress",label:"address",category:"general",render:e=>{let{data:t,context:n}=e;return(0,o.jsx)(a.XxW,{value:t.netAddress,size:"12",type:"hostIp",siascanUrl:n.siascanUrl})}},{id:"publicKey",label:"public key",category:"general",render:e=>{let{data:t,context:n}=e;return(0,o.jsx)(a.XxW,{value:t.publicKey,size:"12",type:"hostPublicKey",siascanUrl:n.siascanUrl})}},{id:"lastAnnouncement",label:"last announcement",category:"general",render:e=>{let{data:t}=e;return(0,o.jsxs)("div",{className:"flex flex-col",children:[(0,o.jsxs)(a.xvT,{size:"12",noWrap:!0,children:[(0,B.Z)(new Date,new Date(t.lastAnnouncement))," ago"]}),(0,o.jsx)(a.xvT,{color:"subtle",size:"10",noWrap:!0,children:function(e,t,n){(0,h.Z)(2,arguments);var r=(0,p.Z)(e),i=(0,p.Z)(t),o={},a=o.locale,s=void 0===a?m.Z:a,l=o.weekStartsOn,u=void 0===l?0:l;if(!s.localize)throw RangeError("locale must contain localize property");if(!s.formatLong)throw RangeError("locale must contain formatLong property");if(!s.formatRelative)throw RangeError("locale must contain formatRelative property");var c=function(e,t){(0,h.Z)(2,arguments);var n=H(e),r=H(t);return Math.round((n.getTime()-(0,P.Z)(n)-(r.getTime()-(0,P.Z)(r)))/864e5)}(r,i);if(isNaN(c))throw RangeError("Invalid time value");var d=g(r,(0,P.Z)(r)),f=g(i,(0,P.Z)(i));return I(r,s.formatRelative(c<-6?"other":c<-1?"lastWeek":c<0?"yesterday":c<1?"today":c<2?"tomorrow":c<7?"nextWeek":"other",d,f,{locale:s,weekStartsOn:u}),{locale:s,weekStartsOn:u})}(new Date(t.lastAnnouncement),new Date)})]})}},{id:"totalScans",label:"total scans",category:"general",contentClassName:"w-[120px] justify-end",render:e=>{let{data:t}=e;return(0,o.jsx)(a.m2c,{size:"12",value:t.totalScans,variant:"value",format:e=>(0,f.yF)(e.toNumber())})}},{id:"uptime",label:"uptime",category:"general",contentClassName:"w-[120px] justify-end",render:e=>{let{data:t}=e;return(0,o.jsx)(a.m2c,{size:"12",value:t.uptime.div(1e9).div(60).div(60).div(24),variant:"value",format:e=>(0,f.yF)(e,{fixed:e.isZero()?0:2,units:"days"})})}},{id:"downtime",label:"downtime",category:"general",contentClassName:"w-[120px] justify-end",render:e=>{let{data:t}=e;return(0,o.jsx)(a.m2c,{size:"12",value:t.downtime.div(1e9).div(60).div(60).div(24),variant:"value",format:e=>(0,f.yF)(e,{fixed:e.isZero()?0:2,units:"days"})})}},{id:"totalInteractions",label:"total interactions",category:"general",contentClassName:"w-[120px] justify-end",render:e=>{let{data:t}=e;return(0,o.jsx)(a.m2c,{size:"12",value:t.totalInteractions,variant:"value",format:e=>(0,f.yF)(e)})}},{id:"successfulInteractions",label:"successful interactions",category:"general",contentClassName:"w-[120px] justify-end",render:e=>{let{data:t}=e;return(0,o.jsx)(a.m2c,{size:"12",value:t.successfulInteractions,variant:"value",format:e=>(0,f.yF)(e.toNumber())})}},{id:"failedInteractions",label:"failed interactions",category:"general",contentClassName:"w-[120px] justify-end",render:e=>{let{data:t}=e;return(0,o.jsx)(a.m2c,{size:"12",value:t.failedInteractions,variant:"value",format:e=>(0,f.yF)(e.toNumber())})}},{id:"contractCount",label:"contract count",category:"general",contentClassName:"w-[120px] justify-end",render:e=>{let{data:t}=e;return(0,o.jsx)(a.m2c,{size:"12",value:t.activeContractsCount,variant:"value",format:e=>(0,f.yF)(e.toNumber())})}},{id:"ap_scoreOverall",label:"overall score",category:"autopilot",contentClassName:"w-[120px] justify-end",render:e=>{let{data:t,context:n}=e;return n.isAutopilotConfigured?(0,o.jsx)(a.m2c,{size:"12",value:t.score,variant:"value",format:e=>e.toPrecision(2)}):(0,o.jsx)(a.ua7,{content:"Autopilot is not configured",children:(0,o.jsx)(a.xvT,{color:"verySubtle",children:"-"})})}},{id:"ap_scoreAge",label:"age score",category:"autopilot",contentClassName:"w-[120px] justify-end",render:e=>{let{data:t,context:n}=e;return n.isAutopilotConfigured?(0,o.jsx)(a.m2c,{size:"12",value:t.scoreBreakdown.age,variant:"value",format:e=>e.toPrecision(2)}):(0,o.jsx)(a.ua7,{content:"Autopilot is not configured",children:(0,o.jsx)(a.xvT,{color:"verySubtle",children:"-"})})}},{id:"ap_scoreCollateral",label:"collateral score",category:"autopilot",contentClassName:"w-[120px] justify-end",render:e=>{let{data:t,context:n}=e;return n.isAutopilotConfigured?(0,o.jsx)(a.m2c,{size:"12",value:t.scoreBreakdown.collateral,variant:"value",format:e=>e.toPrecision(2)}):(0,o.jsx)(a.ua7,{content:"Autopilot is not configured",children:(0,o.jsx)(a.xvT,{color:"verySubtle",children:"-"})})}},{id:"ap_scoreInteractions",label:"interactions score",category:"autopilot",contentClassName:"w-[120px] justify-end",render:e=>{let{data:t,context:n}=e;return n.isAutopilotConfigured?(0,o.jsx)(a.m2c,{size:"12",value:t.scoreBreakdown.interactions,variant:"value",format:e=>e.toPrecision(2)}):(0,o.jsx)(a.ua7,{content:"Autopilot is not configured",children:(0,o.jsx)(a.xvT,{color:"verySubtle",children:"-"})})}},{id:"ap_scorePrices",label:"prices score",category:"autopilot",contentClassName:"w-[120px] justify-end",render:e=>{let{data:t,context:n}=e;return n.isAutopilotConfigured?(0,o.jsx)(a.m2c,{size:"12",value:t.scoreBreakdown.prices,variant:"value",format:e=>e.toPrecision(2)}):(0,o.jsx)(a.ua7,{content:"Autopilot is not configured",children:(0,o.jsx)(a.xvT,{color:"verySubtle",children:"-"})})}},{id:"ap_scoreStorageRemaining",label:"storage remaining score",category:"autopilot",contentClassName:"w-[120px] justify-end",render:e=>{let{data:t,context:n}=e;return n.isAutopilotConfigured?(0,o.jsx)(a.m2c,{size:"12",value:t.scoreBreakdown.storageRemaining,variant:"value",format:e=>e.toPrecision(2)}):(0,o.jsx)(a.ua7,{content:"Autopilot is not configured",children:(0,o.jsx)(a.xvT,{color:"verySubtle",children:"-"})})}},{id:"ap_scoreUptime",label:"uptime score",category:"autopilot",contentClassName:"w-[120px] justify-end",render:e=>{let{data:t,context:n}=e;return n.isAutopilotConfigured?(0,o.jsx)(a.m2c,{size:"12",value:t.scoreBreakdown.uptime,variant:"value",format:e=>e.toPrecision(2)}):(0,o.jsx)(a.ua7,{content:"Autopilot is not configured",children:(0,o.jsx)(a.xvT,{color:"verySubtle",children:"-"})})}},{id:"ap_scoreVersion",label:"version score",category:"autopilot",contentClassName:"w-[120px] justify-end",render:e=>{let{data:t,context:n}=e;return n.isAutopilotConfigured?(0,o.jsx)(a.m2c,{size:"12",value:t.scoreBreakdown.version,variant:"value",format:e=>n.isAutopilotConfigured?"-":e.toPrecision(2)}):(0,o.jsx)(a.ua7,{content:"Autopilot is not configured",children:(0,o.jsx)(a.xvT,{color:"verySubtle",children:"-"})})}},{id:"hpt_accountbalancecost",label:"account balance cost",category:"priceTable",contentClassName:"w-[120px] justify-end",render:Y("priceTable","accountbalancecost")},{id:"hpt_collateralcost",label:"collateral cost",category:"priceTable",contentClassName:"w-[120px] justify-end",render:Y("priceTable","collateralcost")},{id:"hpt_contractprice",label:"contract price",category:"priceTable",contentClassName:"w-[120px] justify-end",render:Y("priceTable","contractprice")},{id:"hpt_downloadbandwidthcost",label:"download bandwidth cost",category:"priceTable",contentClassName:"w-[120px] justify-end",render:Y("priceTable","downloadbandwidthcost")},{id:"hpt_dropsectorsbasecost",label:"drop sectors base cost",category:"priceTable",contentClassName:"w-[120px] justify-end",render:Y("priceTable","dropsectorsbasecost")},{id:"hpt_dropsectorsunitcost",label:"drop sectors unit cost",category:"priceTable",contentClassName:"w-[120px] justify-end",render:Y("priceTable","dropsectorsunitcost")},{id:"hpt_expiry",label:"expiry",category:"priceTable",contentClassName:"w-[120px] justify-end",render:G("priceTable","dropsectorsunitcost")},{id:"hpt_fundaccountcost",label:"fund account cost",category:"priceTable",contentClassName:"w-[120px] justify-end",render:Y("priceTable","fundaccountcost")},{id:"hpt_hassectorbasecost",label:"has sector cost",category:"priceTable",contentClassName:"w-[120px] justify-end",render:Y("priceTable","hassectorbasecost")},{id:"hpt_hostblockheight",label:"host block height",category:"priceTable",contentClassName:"w-[120px] justify-end",render:G("priceTable","hostblockheight")},{id:"hpt_initbasecost",label:"init base cost",category:"priceTable",contentClassName:"w-[120px] justify-end",render:Y("priceTable","initbasecost")},{id:"hpt_latestrevisioncost",label:"latest revision cost",category:"priceTable",contentClassName:"w-[120px] justify-end",render:Y("priceTable","latestrevisioncost")},{id:"hpt_maxcollateral",label:"max collateral",category:"priceTable",contentClassName:"w-[120px] justify-end",render:Y("priceTable","maxcollateral")},{id:"hpt_maxduration",label:"max duration",category:"priceTable",contentClassName:"w-[120px] justify-end",render:G("priceTable","maxduration")},{id:"hpt_memorytimecost",label:"memory time cost",category:"priceTable",contentClassName:"w-[120px] justify-end",render:Y("priceTable","memorytimecost")},{id:"hpt_readbasecost",label:"read base cost",category:"priceTable",contentClassName:"w-[120px] justify-end",render:Y("priceTable","readbasecost")},{id:"hpt_readlengthcost",label:"read length cost",category:"priceTable",contentClassName:"w-[120px] justify-end",render:Y("priceTable","readlengthcost")},{id:"hpt_registryentriesleft",label:"registry entries left",category:"priceTable",contentClassName:"w-[120px] justify-end",render:G("priceTable","registryentriesleft")},{id:"hpt_registryentriestotal",label:"registry entries total",category:"priceTable",contentClassName:"w-[120px] justify-end",render:G("priceTable","registryentriestotal")},{id:"hpt_renewcontractcost",label:"renew contract cost",category:"priceTable",contentClassName:"w-[120px] justify-end",render:Y("priceTable","renewcontractcost")},{id:"hpt_revisionbasecost",label:"revision base cost",category:"priceTable",contentClassName:"w-[120px] justify-end",render:Y("priceTable","renewcontractcost")},{id:"hpt_subscriptionmemorycost",label:"subscription memory cost",category:"priceTable",contentClassName:"w-[120px] justify-end",render:Y("priceTable","subscriptionmemorycost")},{id:"hpt_subscriptionnotificationcost",label:"subscription notification cost",category:"priceTable",contentClassName:"w-[120px] justify-end",render:Y("priceTable","subscriptionnotificationcost")},{id:"hpt_swapsectorcost",label:"swap sector cost",category:"priceTable",contentClassName:"w-[120px] justify-end",render:Y("priceTable","swapsectorcost")},{id:"hpt_txnfeemaxrecommended",label:"txn fee max recommended",category:"priceTable",contentClassName:"w-[120px] justify-end",render:Y("priceTable","txnfeemaxrecommended")},{id:"hpt_txnfeeminrecommended",label:"txn fee min recommended",category:"priceTable",contentClassName:"w-[120px] justify-end",render:Y("priceTable","txnfeeminrecommended")},{id:"hpt_uid",label:"UID",category:"priceTable",contentClassName:"w-[120px] justify-end",render:X("priceTable","uid")},{id:"hpt_updatepricetablecost",label:"update price table cost",category:"priceTable",contentClassName:"w-[120px] justify-end",render:Y("priceTable","updatepricetablecost")},{id:"hpt_uploadbandwidthcost",label:"upload bandwidth cost",category:"priceTable",contentClassName:"w-[120px] justify-end",render:Y("priceTable","uploadbandwidthcost")},{id:"hpt_validity",label:"validity",category:"priceTable",contentClassName:"w-[120px] justify-end",render:G("priceTable","validity")},{id:"hpt_windowsize",label:"window size",category:"priceTable",contentClassName:"w-[120px] justify-end",render:G("priceTable","windowsize")},{id:"hpt_writebasecost",label:"write base cost",category:"priceTable",contentClassName:"w-[120px] justify-end",render:Y("priceTable","writebasecost")},{id:"hpt_writelengthcost",label:"write length cost",category:"priceTable",contentClassName:"w-[120px] justify-end",render:Y("priceTable","writelengthcost")},{id:"hpt_writestorecost",label:"write store cost",category:"priceTable",contentClassName:"w-[120px] justify-end",render:Y("priceTable","writestorecost")},{id:"hs_acceptingcontracts",label:"accepting contracts",category:"hostSettings",contentClassName:"w-[120px] justify-end",render:(r="settings",i="acceptingcontracts",function(e){let{data:t}=e;return t[r]?(0,o.jsx)("div",{className:"mt-[5px]",children:(0,o.jsx)(a.xvT,{color:t[r][i]?"green":"red",children:t[r][i]?(0,o.jsx)(d.DI$,{}):(0,o.jsx)(d.SmH,{})})}):null})},{id:"hs_baserpcprice",label:"base RPC price",category:"hostSettings",contentClassName:"w-[120px] justify-end",render:Y("settings","baserpcprice")},{id:"hs_collateral",label:"collateral",category:"hostSettings",contentClassName:"w-[120px] justify-end",render:Y("settings","collateral")},{id:"hs_contractprice",label:"contract price",category:"hostSettings",contentClassName:"w-[120px] justify-end",render:Y("settings","contractprice")},{id:"hs_downloadbandwidthprice",label:"download bandwidth price",category:"hostSettings",contentClassName:"w-[120px] justify-end",render:Y("settings","downloadbandwidthprice")},{id:"hs_ephemeralaccountexpiry",label:"ephemeral account expiry",category:"hostSettings",contentClassName:"w-[120px] justify-end",render:G("settings","ephemeralaccountexpiry")},{id:"hs_maxcollateral",label:"max collateral",category:"hostSettings",contentClassName:"w-[120px] justify-end",render:Y("settings","maxcollateral")},{id:"hs_maxdownloadbatchsize",label:"max download batch size",category:"hostSettings",contentClassName:"w-[120px] justify-end",render:Q("settings","maxdownloadbatchsize")},{id:"hs_maxduration",label:"max duration",category:"hostSettings",contentClassName:"w-[120px] justify-end",render:G("settings","maxduration")},{id:"hs_maxephemeralaccountbalance",label:"max ephemeral account balance",category:"hostSettings",contentClassName:"w-[120px] justify-end",render:Y("settings","maxephemeralaccountbalance")},{id:"hs_maxrevisebatchsize",label:"max revise batch size",category:"hostSettings",contentClassName:"w-[120px] justify-end",render:Q("settings","maxrevisebatchsize")},{id:"hs_netaddress",label:"net address",category:"hostSettings",contentClassName:"w-[120px] justify-end",render:X("settings","netaddress")},{id:"hs_remainingstorage",label:"remaining storage",category:"hostSettings",contentClassName:"w-[120px] justify-end",render:Q("settings","remainingstorage")},{id:"hs_revisionnumber",label:"revision number",category:"hostSettings",contentClassName:"w-[120px] justify-end",render:G("settings","revisionnumber")},{id:"hs_sectoraccessprice",label:"sector access price",category:"hostSettings",contentClassName:"w-[120px] justify-end",render:Y("settings","sectoraccessprice")},{id:"hs_sectorsize",label:"sector size",category:"hostSettings",contentClassName:"w-[120px] justify-end",render:Q("settings","sectorsize")},{id:"hs_siamuxport",label:"siamux port",category:"hostSettings",contentClassName:"w-[120px] justify-end",render:G("settings","siamuxport")},{id:"hs_storageprice",label:"storage price",category:"hostSettings",contentClassName:"w-[120px] justify-end",render:Y("settings","storageprice")},{id:"hs_totalstorage",label:"total storage",category:"hostSettings",contentClassName:"w-[120px] justify-end",render:Q("settings","totalstorage")},{id:"hs_unlockhash",label:"unlock hash",category:"hostSettings",contentClassName:"w-[120px] justify-end",render:X("settings","unlockhash")},{id:"hs_uploadbandwidthprice",label:"upload bandwidth price",category:"hostSettings",contentClassName:"w-[120px] justify-end",render:Y("settings","uploadbandwidthprice")},{id:"hs_version",label:"verison",category:"hostSettings",contentClassName:"w-[120px] justify-end",render:X("settings","version")},{id:"hs_windowsize",label:"window size",category:"hostSettings",contentClassName:"w-[120px] justify-end",render:G("settings","windowsize")}].map(e=>({...e,..."autopilot"===e.category?{icon:(0,o.jsx)(d.n6M,{className:"relative opacity-50 scale-75"}),label:e.label,tip:"autopilot: ".concat(e.label)}:"hostSettings"===e.category?{icon:(0,o.jsx)(d.shL,{className:"relative top-px opacity-50 scale-75"}),label:e.label,tip:"host settings (RHPv2): ".concat(e.label)}:"priceTable"===e.category?{icon:(0,o.jsx)(d.B4q,{className:"relative top-px opacity-50 scale-75"}),label:e.label,tip:"price table (RHPv3): ".concat(e.label)}:{label:e.label,tip:e.label}}));function Y(e,t){return(0,l.memo)(function(n){let{data:r}=n;return r[e]?(0,o.jsx)(a.ho9,{displayBoth:!0,size:"12",value:new($())(r[e][t]||0),fixedFiat:4,variant:"value"}):null})}function G(e,t,n){return function(r){let{data:i}=r;return i[e]?(0,o.jsx)(a.m2c,{size:"12",value:new($())(i[e][t]||0),variant:"value",format:e=>(0,f.yF)(e,{abbreviated:n})}):null}}function X(e,t){return function(n){let{data:r}=n;return r[e]?(0,o.jsx)(a.XxW,{value:r[e][t],size:"12"}):null}}function Q(e,t){return function(n){let{data:r}=n;return r[e]?(0,o.jsx)(a.xvT,{size:"12",weight:"semibold",ellipsis:!0,children:(0,f.vW)(r[e][t])}):null}}var J=n(26592);function ee(e,t){return{id:e.publicKey,netAddress:e.netAddress,publicKey:e.publicKey,lastScanSuccess:e.interactions.lastScanSuccess,lastScan:"0001-01-01T00:00:00Z"===e.interactions.lastScan?null:e.interactions.lastScan,knownSince:"0001-01-01T00:00:00Z"===e.knownSince?null:e.knownSince,lastAnnouncement:"0001-01-01T00:00:00Z"===e.lastAnnouncement?null:e.lastAnnouncement,uptime:new($())(e.interactions.uptime||0),downtime:new($())(e.interactions.downtime||0),successfulInteractions:new($())(e.interactions.successfulInteractions||0),totalInteractions:new($())(e.interactions.successfulInteractions+e.interactions.failedInteractions||0),failedInteractions:new($())(e.interactions.failedInteractions||0),totalScans:new($())(e.interactions.totalScans||0),activeContractsCount:new($())((null==t?void 0:t.filter(t=>t.hostKey===e.publicKey).length)||0),activeContracts:(null==t?void 0:t.filter(t=>t.hostKey===e.publicKey))||[],priceTable:e.priceTable,settings:e.settings}}function et(e){let{host:t,allowlist:n,blocklist:r,isAllowlistActive:i}=e,o=!!(null==n?void 0:n.find(e=>e===t.publicKey)),a=!!(null==r?void 0:r.find(e=>{if(e===t.netAddress)return!0;try{let n=new URL("https://"+t.netAddress).hostname;return e===n}catch(e){return!1}}));return{isOnAllowlist:o,isOnBlocklist:a,isBlocked:a||!(!i||o)}}function en(e){return{score:new($())((null==e?void 0:e.score)||0),scoreBreakdown:{age:new($())((null==e?void 0:e.scoreBreakdown.age)||0),collateral:new($())((null==e?void 0:e.scoreBreakdown.collateral)||0),interactions:new($())((null==e?void 0:e.scoreBreakdown.interactions)||0),prices:new($())((null==e?void 0:e.scoreBreakdown.prices)||0),storageRemaining:new($())((null==e?void 0:e.scoreBreakdown.storageRemaining)||0),uptime:new($())((null==e?void 0:e.scoreBreakdown.uptime)||0),version:new($())((null==e?void 0:e.scoreBreakdown.version)||0)},gougingBreakdown:(null==e?void 0:e.gougingBreakdown)||{},gouging:null==e?void 0:e.gouging,unusableReasons:(null==e?void 0:e.unusableReasons)||[],usable:null==e?void 0:e.usable}}var er=n(91641),ei=n(34444),eo=n(9455),ea=n(20189);let es=(0,l.createContext)({}),el=()=>(0,l.useContext)(es);function eu(e){let{children:t}=e,n=function(){var e,t,n,r,i,o,d;let f=(0,c.useRouter)(),[h,p]=(0,l.useState)("list"),m=Number(f.query.limit||50),v=Number(f.query.offset||0),{filters:g,setFilter:y,removeFilter:b,removeLastFilter:x,resetFilters:w}=(0,a.Uu5)(),{dataset:j}=(0,J.G)(),{autopilot:k}=(0,er.q)(),E=(0,l.useMemo)(()=>{let e=[];g.find(e=>"hasActiveContracts"===e.id)&&j&&(e=j.map(e=>e.hostKey));let t=g.find(e=>"publicKeyEquals"===e.id);return t&&e.push(null==t?void 0:t.value),e.length?e:void 0},[g,j]),S=(0,s.S0)({disabled:g.find(e=>"hasActiveContracts"===e.id)&&!j||"on"!==k.status,payload:{limit:m,offset:v,usabilityMode:(null===(e=g.find(e=>"usabilityMode"===e.id))||void 0===e?void 0:e.value)||"all",filterMode:(null===(t=g.find(e=>"filterMode"===e.id))||void 0===t?void 0:t.value)||"all",addressContains:null===(n=g.find(e=>"addressContains"===e.id))||void 0===n?void 0:n.value,keyIn:E},config:{swr:{errorRetryInterval:2e4,refreshInterval:(0,a.sWj)(1)}}}),_=(0,s.FV)({disabled:"off"!==k.status,payload:{limit:m,offset:v,filterMode:(null===(r=g.find(e=>"filterMode"===e.id))||void 0===r?void 0:r.value)||"all",addressContains:null===(i=g.find(e=>"addressContains"===e.id))||void 0===i?void 0:i.value,keyIn:g.find(e=>"hasActiveContracts"===e.id)&&j?j.map(e=>e.hostKey):void 0},config:{swr:{refreshInterval:(0,a.sWj)(1)}}}),C=(0,s.s2)(),O=(0,s.uf)(),M=!!(null===(o=C.data)||void 0===o?void 0:o.length),{settings:T}=(0,W.Hv)(),A=(0,eo.JL)({disabled:!T.siaCentral,config:{swr:{revalidateOnFocus:!1}}});(0,l.useEffect)(()=>{T.siaCentral||p("list")},[T.siaCentral]);let P=(0,l.useMemo)(()=>{var e;return(null===(e=A.data)||void 0===e?void 0:e.hosts)||[]},[A.data]),N=(0,l.useRef)(ei.N),R=(0,l.useCallback)(e=>{N.current=e},[N]),[D,L]=(0,l.useState)(),Z=(0,l.useCallback)(e=>{let t=document.getElementById(e),n=document.getElementById("scroll-hosts");t&&n&&n.scroll({top:t.offsetTop-50,behavior:"smooth"})},[]),F=(0,l.useCallback)((e,t)=>{if(D===e){L(void 0);return}L(e),t&&N.current.moveToLocation(t),Z(e)},[L,N,D,Z]),z=(0,l.useCallback)((e,t)=>{if(D===e){L(void 0);return}L(e),t?N.current.moveToLocation(t):(0,a.OHV)("Geographic location is unknown for host ".concat((0,a.$Gg)(e,20))),Z(e)},[L,N,D,Z]),V=(0,l.useCallback)((e,t)=>null,[]),I=function(e){let{autopilotStatus:t,regularResponse:n,autopilotResponse:r,allContracts:i,allowlist:o,blocklist:a,isAllowlistActive:s,geoHosts:u,onHostSelect:c}=e;return(0,l.useMemo)(()=>{var e,l;return"off"===t?(null===(e=n.data)||void 0===e?void 0:e.map(e=>{let t=u.find(t=>t.public_key===e.publicKey);return{onClick:()=>c(e.publicKey,null==t?void 0:t.location),...ee(e,i),...et({host:e,allowlist:o.data,blocklist:a.data,isAllowlistActive:s}),...en(),location:null==t?void 0:t.location,countryCode:null==t?void 0:t.country_code}}))||null:"on"===t&&(null===(l=r.data)||void 0===l?void 0:l.map(e=>{let t=u.find(t=>t.public_key===e.host.publicKey);return{onClick:()=>c(e.host.publicKey,null==t?void 0:t.location),...ee(e.host,i),...et({host:e.host,allowlist:o.data,blocklist:a.data,isAllowlistActive:s}),...en(e.checks),location:null==t?void 0:t.location,countryCode:null==t?void 0:t.country_code}}))||null},[c,t,n.data,r.data,i,o.data,a.data,s,u])}({autopilotStatus:k.status,autopilotResponse:S,regularResponse:_,allContracts:j,allowlist:C,blocklist:O,isAllowlistActive:M,geoHosts:P,onHostSelect:z}),B=(0,l.useMemo)(()=>"off"===k.status?["autopilot"]:[],[k.status]),{configurableColumns:H,enabledColumns:U,toggleColumnVisibility:q,setColumnsVisible:$,setColumnsHidden:Y,toggleSort:G,setSortDirection:X,setSortField:Q,sortField:es,sortDirection:el,resetDefaultColumnVisibility:eu}=(0,a.oy6)("renterd/v0/hosts",{columns:K,columnsDefaultVisible:u,disabledCategories:B}),ec=(0,l.useMemo)(()=>K.filter(e=>U.includes(e.id)),[U]),ed="on"===k.status?S.isValidating:_.isValidating,ef="on"===k.status?S.error:_.error,eh=(0,a.c2j)(I,ed,ef,g),ep=(0,ea.B)(),em=null===(d=k.state.data)||void 0===d?void 0:d.configured,ev=(0,l.useMemo)(()=>({isAutopilotConfigured:em,siascanUrl:ep}),[em,ep]),eg=(0,l.useMemo)(()=>null==I?void 0:I.filter(e=>e.location),[I]),ey=(0,l.useMemo)(()=>null==I?void 0:I.find(e=>e.publicKey===D),[I,D]);return{setCmd:R,viewMode:h,activeHost:ey,onHostMapHover:V,onHostMapClick:F,setViewMode:p,hostsWithLocation:eg,error:ef,dataState:eh,offset:v,limit:m,pageCount:(null==I?void 0:I.length)||0,columns:ec,dataset:I,tableContext:ev,configurableColumns:H,enabledColumns:U,toggleColumnVisibility:q,setColumnsVisible:$,setColumnsHidden:Y,toggleSort:G,setSortDirection:X,setSortField:Q,sortField:es,sortDirection:el,resetDefaultColumnVisibility:eu,filters:g,setFilter:y,removeFilter:b,removeLastFilter:x,resetFilters:w}}();return(0,o.jsx)(es.Provider,{value:n,children:t})}},10917:function(e,t,n){"use strict";n.d(t,{Kg:function(){return o},jY:function(){return i}});var r=n(57362);let i={activeAndUsable:{colorHex:r.O9T.green[600],colorName:"green"},activeAndUnusable:{colorHex:r.O9T.amber[600],colorName:"amber"},potentialHost:{colorHex:r.O9T.blue[600],colorName:"blue"}};function o(e){return e.activeContractsCount.gt(0)&&!e.usable?{status:"activeAndUnusable",...i.activeAndUnusable}:e.activeContractsCount.gt(0)?{status:"activeAndUsable",...i.activeAndUsable}:{status:"potentialHost",...i.potentialHost}}},63171:function(e,t,n){"use strict";n.d(t,{n:function(){return p},v:function(){return m}});var r=n(52322),i=n(57362),o=n(9969),a=n(2784),s=n(86811),l=n(6391),u=n.n(l),c=n(5632),d=n(20189);let f=[],h=(0,a.createContext)({}),p=()=>(0,a.useContext)(h);function m(e){let{children:t}=e,n=function(){let e=(0,c.useRouter)(),t=Number(e.query.limit||50),n=Number(e.query.offset||0),r=(0,o.Qq)({params:{limit:t,offset:n},config:{swr:{refreshInterval:(0,i.XBW)(60)}}}),l=(0,o.a0)({config:{swr:{refreshInterval:(0,i.XBW)(60)}}}),{openDialog:h}=(0,s.Rh)(),p=(0,d.B)(),m=(0,a.useMemo)(()=>l.data&&r.data?[...(l.data||[]).map(e=>({type:"transaction",txType:(0,i.leQ)(e),unconfirmed:!0,siascanUrl:p})),...(r.data||[]).map(e=>({type:"transaction",txType:(0,i.leQ)(e.raw),hash:(0,i.I13)(e.id),timestamp:new Date(e.timestamp).getTime(),onClick:()=>h("transactionDetails",(0,i.I13)(e.id)),raw:e.raw,inflow:e.inflow,outflow:e.outflow,sc:new(u())(e.inflow).minus(e.outflow),siascanUrl:p})).sort((e,t)=>e.timestamp{let e=new Date().getTime(),t=30*y;return new Date(e-t).toISOString()},[30,y]),x=(0,o.X1)({params:{start:b,interval:y,n:30}}),w=(0,a.useMemo)(()=>(x.data||[]).map(e=>({sc:new(u())(e.spendable).plus(e.unconfirmed).toNumber(),timestamp:new Date(e.timestamp).getTime()})).sort((e,t)=>e.timestamp>=t.timestamp?1:-1),[x.data]);return{dataset:m,error:v,dataState:g,offset:n,limit:t,pageCount:(null==m?void 0:m.length)||0,balances:w,metrics:x}}();return(0,r.jsx)(h.Provider,{value:n,children:t})}},33571:function(e,t,n){"use strict";n.d(t,{I:function(){return a}});var r=n(57362),i=n(9969),o=n(2784);function a(){let e=(0,i.ni)();return(0,o.useCallback)((t,n)=>{let i=async()=>{let i=await e.put({payload:{add:t,remove:n}});return i.error?((0,r.OHV)(i.error),!1):(t.length&&(0,r.RFt)("".concat(t.map(e=>(0,r.$Gg)(e,20)).join(", ")," added to allowlist")),n.length&&(0,r.RFt)("".concat(n.map(e=>(0,r.$Gg)(e,20)).join(", ")," removed from allowlist")),!0)};return i()},[e])}},98358:function(e,t,n){"use strict";n.d(t,{l:function(){return a}});var r=n(57362),i=n(9969),o=n(2784);function a(){let e=(0,i.Os)();return(0,o.useCallback)((t,n)=>{let i=async()=>{let i=await e.put({payload:{add:t,remove:n}});return i.error?((0,r.OHV)(i.error),!1):(t.length&&(0,r.RFt)("".concat(t.map(e=>(0,r.$Gg)(e,20)).join(", ")," added to blocklist")),n.length&&(0,r.RFt)("".concat(n.map(e=>(0,r.$Gg)(e,20)).join(", ")," removed from blocklist")),!0)};return i()},[e])}},80489:function(e,t,n){"use strict";n.d(t,{a:function(){return i}});var r=n(9969);function i(e){return(0,r.yu)({...e,params:{key:"contractset"}})}},82439:function(e,t,n){"use strict";n.d(t,{B:function(){return a},V:function(){return o}});var r=n(52322),i=n(88242);let o={excellent:1,good:.5,poor:0};function a(e){let{health:t,size:n,isDirectory:a}=e,s="excellent",l="green",u=t,c=(0,r.jsx)(i.Y3p,{});return t1&&(u=1),t<0&&(u=0),{label:s+" health",color:l,icon:c,displayHealth:u}}},34658:function(e,t,n){"use strict";n.d(t,{w:function(){return i}});var r=n(9969);function i(e){return(0,r.yu)({...e,params:{key:"redundancy"}})}},20189:function(e,t,n){"use strict";n.d(t,{B:function(){return o}});var r=n(57362),i=n(9969);function o(){var e;let t=(0,i.d_)();return(null===(e=t.data)||void 0===e?void 0:e.network)==="Zen Testnet"?r.nNd.explore.testnetZen:r.nNd.explore.mainnet}},25573:function(e,t,n){"use strict";n.d(t,{n:function(){return a}});var r=n(57362),i=n(95753),o=n(9969);function a(){var e,t,n,a;let{isUnlockedAndAuthedRoute:s}=(0,i.Hv)(),l=(0,o.DQ)({config:{swr:{refreshInterval:e=>(null==e?void 0:e.synced)?(0,r.XBW)(60):(0,r.XBW)(10)}}}),u=(0,o.nH)(),c=l.data?null===(e=l.data)||void 0===e?void 0:e.blockHeight:0,d=(0,o.X2)({config:{swr:{refreshInterval:e=>(null==e?void 0:e.scanHeight)>=c?(0,r.XBW)(60):(0,r.XBW)(10)}}}),f=s&&c&&u?Number((100*Math.min(c/u,1)).toFixed(1)):0,h=s&&c&&d.data?Number((100*Math.min(d.data.scanHeight/u,1)).toFixed(1)):0;return{isSynced:null===(t=l.data)||void 0===t?void 0:t.synced,isWalletSynced:(null===(n=l.data)||void 0===n?void 0:n.synced)&&(null===(a=d.data)||void 0===a?void 0:a.scanHeight)>=c-1,nodeBlockHeight:c,estimatedBlockHeight:u,syncPercent:f,walletScanPercent:h,moreThan100BlocksToSync:!!c&&!!u&&u-c>100,firstTimeSyncing:!!c&&!!u&&u-c>5e4}}},73221:function(e,t,n){"use strict";n.r(t),n.d(t,{default:function(){return R}});var r=n(52322);n(37832);var i=n(57362),o=n(86811),a=n(48528),s=n(26592),l=n(19513),u=n(2784),c=n(91641),d=n(19847),f=n(88242),h=n(25573),p=n(71930),m=n(4370),v=n(9969),g=n(6391),y=n.n(g),b=n(25205),x=n(95753),w=n(92762);function j(){var e,t;let{isUnlockedAndAuthedRoute:n}=(0,x.Hv)(),a=(0,c.q)(),{openDialog:s}=(0,o.Rh)(),l=(0,v.X2)(),u=(0,v.e$)({config:{swr:{errorRetryInterval:1e4}}}),[d,g]=(0,w.Z)("v0/renterd/onboarding/maximized",{defaultValue:!0}),j=(0,h.n)(),E=(0,m.F)();if(!n||"on"!==a.autopilot.status)return null;let S=new(y())(l.data?l.data.confirmed+l.data.unconfirmed:0),_=new(y())((null===(e=u.data)||void 0===e?void 0:e.contracts.allowance)||0),C=null===(t=a.autopilot.state.data)||void 0===t?void 0:t.configured,O=j.isSynced,M=S.gt(0),T=!E.active,A=[C,O,M,T],P=A.length,N=A.filter(e=>e).length;return P===N?null:d?(0,r.jsx)("div",{className:"z-20 fixed bottom-5 left-1/2 -translate-x-1/2 flex justify-center",children:(0,r.jsx)(i.s_4,{className:"w-[400px] flex flex-col max-h-[600px]",children:(0,r.jsxs)(i.xrM,{children:[(0,r.jsxs)("div",{className:"flex justify-between items-center px-3 py-2 border-b border-gray-200 dark:border-graydark-300",children:[(0,r.jsxs)("div",{className:"flex gap-2 items-center",children:[(0,r.jsx)(i.TRl,{}),(0,r.jsx)(i.xvT,{size:"20",weight:"semibold",children:"Welcome to Sia"})]}),(0,r.jsx)(i.zxk,{variant:"ghost",onClick:()=>g(!1),children:(0,r.jsx)(f.mli,{})})]}),(0,r.jsx)("div",{className:"flex justify-between items-center px-3 py-2 border-b border-gray-200 dark:border-graydark-300",children:(0,r.jsx)(i.xvT,{size:"14",children:"Get set up by completing the following steps. Once they are complete, you can start uploading files."})}),(0,r.jsx)(k,{title:(0,r.jsx)(i.rUS,{href:p._.config.index,ellipsis:!0,size:"14",underline:"hover",children:"Step 1: Configure your storage settings"}),description:"Specify how much data you plan to store and your target price.",action:C?(0,r.jsx)(i.xvT,{color:"green",children:(0,r.jsx)(f.Y3p,{})}):(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(i.rUS,{href:p._.config.index,children:(0,r.jsx)(f.V8Q,{})}),(0,r.jsx)(i.xvT,{color:"amber",children:(0,r.jsx)(f.Fs9,{})})]})}),(0,r.jsx)(k,{title:(0,r.jsx)(i.rUS,{href:p._.node.index,underline:"hover",ellipsis:!0,size:"14",children:"Step 2: Wait for the blockchain to sync"}),description:"The blockchain will sync in the background, this takes some time. No user action required.",action:O?(0,r.jsx)(i.xvT,{color:"green",children:(0,r.jsx)(f.Y3p,{})}):(0,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)(i.xvT,{ellipsis:!0,size:"14",children:[j.syncPercent,"%"]}),(0,r.jsx)(i.xvT,{color:"amber",children:(0,r.jsx)(f.hzZ,{})})]})}),(0,r.jsx)(k,{title:(0,r.jsx)(i.rUS,{href:p._.wallet.view,onClick:()=>s("addressDetails"),ellipsis:!0,size:"14",underline:"hover",children:"Step 3: Fund your wallet"}),description:"Fund your wallet with at least ".concat((0,b.Vz)(_)," siacoin to cover the required allowance.").concat(j.isWalletSynced?"":" Balance will not be accurate until wallet is finished scanning."),action:M?(0,r.jsx)(i.xvT,{color:"green",children:(0,r.jsx)(f.Y3p,{})}):(0,r.jsxs)(r.Fragment,{children:[!j.isWalletSynced&&(0,r.jsx)(i.ua7,{content:"Wallet scanning progress ".concat(j.walletScanPercent,"%"),children:(0,r.jsxs)(i.xvT,{size:"14",children:[j.walletScanPercent,"%"]})}),(0,r.jsx)(i.rUS,{href:p._.wallet.view,onClick:()=>s("addressDetails"),children:(0,r.jsx)(f.V8Q,{})}),(0,r.jsx)(i.xvT,{color:"amber",children:(0,r.jsx)(f.Fs9,{})})]})}),(0,r.jsx)(k,{title:(0,r.jsx)(i.rUS,{href:p._.contracts.index,ellipsis:!0,size:"14",underline:"hover",children:"Step 4: Wait for storage contracts to form"}),description:"Once all other steps are complete, contracts will automatically form. No user action required.",action:T?(0,r.jsx)(i.xvT,{color:"green",children:(0,r.jsx)(f.Y3p,{})}):(0,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)(i.xvT,{ellipsis:!0,size:"14",children:[E.count,"/",E.required]}),(0,r.jsx)(i.xvT,{color:"amber",children:(0,r.jsx)(f.hzZ,{})})]})})]})})}):(0,r.jsx)("div",{className:"z-30 fixed bottom-5 left-1/2 -translate-x-1/2 flex justify-center",children:(0,r.jsx)(i.zxk,{onClick:()=>g(!0),size:"large",className:"flex gap-3 !px-3",children:(0,r.jsxs)(i.xvT,{className:"flex items-center gap-1",children:[(0,r.jsx)(i.TRl,{}),"Setup: ",N,"/",P," steps complete"]})})})}function k(e){let{title:t,action:n,description:o}=e;return(0,r.jsx)("div",{className:"border-t first:border-t-0 border-gray-200 dark:border-graydark-300 px-3 py-2",children:(0,r.jsxs)("div",{className:"flex flex-col gap-1",children:[(0,r.jsxs)("div",{className:"flex gap-2 items-center",children:[(0,r.jsx)("div",{className:"flex-1 flex items-center",children:t}),n]}),(0,r.jsx)("div",{className:"pr-5",children:(0,r.jsx)(i.xvT,{size:"12",color:"subtle",children:o})})]})})}function E(e){return void 0!==e.loaded?e.loaded/e.size:1}function S(){let{isUnlockedAndAuthedRoute:e}=(0,x.Hv)(),{uploadsList:t,uploadCancel:n,downloadsList:o,downloadCancel:s}=(0,a.Y)(),[l,c]=(0,u.useState)(!0),d=t.length,h=o.length;return e&&(0!==d||0!==h)?l?(0,r.jsx)("div",{className:"z-30 fixed bottom-5 left-1/2 -translate-x-1/2 flex justify-center",children:(0,r.jsx)(i.s_4,{className:"w-[400px] flex flex-col max-h-[600px]",children:(0,r.jsxs)(i.xrM,{children:[d>0?(0,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)("div",{className:"flex justify-between items-center px-3 py-2 border-b border-gray-200 dark:border-graydark-300",children:[(0,r.jsxs)(i.xvT,{size:"16",weight:"semibold",children:["Active uploads (",d,")"]}),(0,r.jsx)(i.zxk,{variant:"ghost",onClick:()=>c(!1),children:(0,r.jsx)(f.mli,{})})]}),t.map(e=>{let t=E(e);return(0,r.jsxs)("div",{className:"flex flex-col gap-1 border-t first:border-t-0 border-gray-200 dark:border-graydark-300 px-3 py-2",children:[(0,r.jsxs)("div",{className:"flex gap-1",children:[(0,r.jsx)(i.xvT,{ellipsis:!0,size:"14",className:"flex-1",children:e.path}),(0,r.jsx)(i.zxk,{tip:"Cancel file upload",variant:"ghost",size:"none",onClick:()=>n(e),children:(0,r.jsx)(f.PcV,{})})]}),(0,r.jsx)(i.kod,{variant:"accent",value:e.loaded,max:e.size,className:1===t?"animate-pulse":""}),(0,r.jsxs)("div",{className:"flex justify-between mt-1",children:[(0,r.jsx)(i.xvT,{size:"12",color:"subtle",children:1===t?"Processing":"Uploading"}),(0,r.jsxs)(i.xvT,{size:"12",color:"subtle",children:[(100*t).toFixed(0),"%"]})]})]},e.path)})]}):null,h>0?(0,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)("div",{className:"flex justify-between items-center px-3 py-2 border-b border-gray-200 dark:border-graydark-300",children:[(0,r.jsxs)(i.xvT,{size:"16",weight:"semibold",children:["Active downloads (",h,")"]}),0===d?(0,r.jsx)(i.zxk,{variant:"ghost",onClick:()=>c(!1),children:(0,r.jsx)(f.mli,{})}):null]}),o.map(e=>{let t=E(e);return(0,r.jsxs)("div",{className:"flex flex-col gap-1 border-t first:border-t-0 border-gray-200 dark:border-graydark-300 px-3 py-2",children:[(0,r.jsxs)("div",{className:"flex gap-1",children:[(0,r.jsx)(i.xvT,{ellipsis:!0,size:"14",className:"flex-1",children:e.path}),(0,r.jsx)(i.zxk,{tip:"Cancel file download",variant:"ghost",size:"none",onClick:()=>s(e),children:(0,r.jsx)(f.PcV,{})})]}),(0,r.jsx)(i.kod,{variant:"accent",value:e.loaded,max:e.size,className:1===t?"animate-pulse":""}),(0,r.jsxs)("div",{className:"flex justify-between mt-1",children:[(0,r.jsx)(i.xvT,{size:"12",color:"subtle",children:1===t?"Processing":"Downloading"}),(0,r.jsxs)(i.xvT,{size:"12",color:"subtle",children:[(100*t).toFixed(0),"%"]})]})]},e.path)})]}):null]})})}):(0,r.jsx)("div",{className:"z-30 fixed bottom-5 left-1/2 -translate-x-1/2 flex justify-center",children:(0,r.jsxs)(i.zxk,{onClick:()=>c(!0),className:"flex gap-3",children:[(0,r.jsx)(i.xgg,{}),d?(0,r.jsxs)(i.xvT,{className:"flex gap-1",children:[d,(0,r.jsx)(f.R$6,{className:"opacity-50 scale-75 relative top-px"})]}):null,h?(0,r.jsxs)(i.xvT,{className:"flex gap-1",children:[h&&h,(0,r.jsx)(f.vzB,{className:"opacity-50 scale-75"})]}):null]})}):null}var _=n(63171);function C(e){let{children:t}=e;return(0,r.jsx)(c.w,{children:(0,r.jsx)(d.iV,{children:(0,r.jsx)(o.Tu,{children:(0,r.jsx)(_.v,{children:(0,r.jsx)(s.x,{children:(0,r.jsx)(l.x,{children:(0,r.jsxs)(a.Z,{children:[(0,r.jsx)(j,{}),(0,r.jsx)(S,{}),(0,r.jsx)(o.xQ,{}),t]})})})})})})})}var O=n(1240),M=n.n(O),T=n(49854),A=n.n(T),P=n(82851);let N=(0,P.cx)(M().variable,A().variable);function R(e){let{Component:t,pageProps:n}=e;return(0,r.jsx)(i.PD$,{className:N,fallback:n.fallback,passwordProtectRequestHooks:!0,lockRoutes:p._,children:(0,r.jsx)(C,{children:(0,r.jsx)(t,{...n})})})}},57362:function(e,t,n){"use strict";let r,i,o,a;n.d(t,{UQy:function(){return ly},vF:function(){return lj},Qdk:function(){return lw},o48:function(){return lb},hcY:function(){return _$},tU3:function(){return _H},zXq:function(){return _6},juT:function(){return _m},Cts:function(){return lF},Z58:function(){return CF},WVB:function(){return cQ},zxk:function(){return lv},b0u:function(){return k8},EKh:function(){return lI},vRO:function(){return Oh},QHy:function(){return Ot},TaT:function(){return C$},eQh:function(){return lH},HfT:function(){return Oi},wEc:function(){return CV},ncR:function(){return S3},VqE:function(){return ux},h_2:function(){return c4},Xiv:function(){return c3},Juw:function(){return c5},KpP:function(){return c6},fhJ:function(){return pJ},XOF:function(){return S4},S$c:function(){return _o},WyV:function(){return Om},QBj:function(){return Op},yEL:function(){return _4},cB7:function(){return _e},ZqQ:function(){return S9},IKw:function(){return _a},KZS:function(){return _t},zsw:function(){return pi},__J:function(){return dl},rUS:function(){return dd},Qjf:function(){return df},xgg:function(){return k5},TRl:function(){return dp},kFS:function(){return cJ},FzK:function(){return C7},Clw:function(){return cX},PD$:function(){return Ow},Wxm:function(){return ht},uDJ:function(){return _l},wFK:function(){return _u},s_4:function(){return na},nvN:function(){return ni},u5Q:function(){return Cz},j4H:function(){return f8},hmz:function(){return f7},J2e:function(){return dL},kod:function(){return dG},xrM:function(){return ug},PhF:function(){return he},Z0O:function(){return cq},DLL:function(){return CM},KJW:function(){return _y},rsf:function(){return hg},D_D:function(){return Cb},iA_:function(){return _s},mQc:function(){return fE},nUL:function(){return fC},drW:function(){return fS},SPt:function(){return f_},t6k:function(){return Oo},xvT:function(){return nr},nvn:function(){return fM},ua7:function(){return lp},mPE:function(){return Cx},XxW:function(){return Sw},PF9:function(){return Sk},m2c:function(){return SM},YKL:function(){return SS},ho9:function(){return SO},QUh:function(){return CA},weF:function(){return Ca},YNn:function(){return Ck},DmW:function(){return CE},O9T:function(){return v2},fVJ:function(){return CD},vQq:function(){return Su},E5z:function(){return Sc},HLH:function(){return OV},NrH:function(){return k$},k9c:function(){return kJ},Y_Z:function(){return CP},EJC:function(){return OF},kOJ:function(){return CR},leQ:function(){return Sp},Ztc:function(){return Cv},XAn:function(){return k0},Vkc:function(){return cK},sWj:function(){return kq},ort:function(){return k1},xLV:function(){return kY},okB:function(){return kQ},AEA:function(){return kX},z$:function(){return no},XBW:function(){return k4},GXN:function(){return k2},I13:function(){return Sf},cEb:function(){return fO},y70:function(){return fQ},OHV:function(){return Sa},OPV:function(){return So},RFt:function(){return Sr},$Gg:function(){return Sd},_4u:function(){return OR},Wdu:function(){return ON},Y97:function(){return _B},c2j:function(){return _U},mYE:function(){return Og},u$d:function(){return Oy},Z4p:function(){return Ov},WsO:function(){return _2},Uu5:function(){return OD},fb0:function(){return OZ},oy6:function(){return OP},nNd:function(){return CS},BL0:function(){return kK},ivg:function(){return kG}});var s,l,u,c,d,f,h,p,m,v,g,y,b,x,w,j,k,E,S,_,C,O,M,T=n(52322),A=n(2784),P=n.t(A,2),N=n(7896),R=n(34540),D=n(26215),L=n(99575);function Z(e){let t=e+"CollectionProvider",[n,r]=(0,R.b)(t),[i,o]=n(t,{collectionRef:{current:null},itemMap:new Map}),a=e+"CollectionSlot",s=A.forwardRef((e,t)=>{let{scope:n,children:r}=e,i=o(a,n),s=(0,D.e)(t,i.collectionRef);return A.createElement(L.g7,{ref:s},r)}),l=e+"CollectionItemSlot",u="data-radix-collection-item",c=A.forwardRef((e,t)=>{let{scope:n,children:r,...i}=e,a=A.useRef(null),s=(0,D.e)(t,a),c=o(l,n);return A.useEffect(()=>(c.itemMap.set(a,{ref:a,...i}),()=>void c.itemMap.delete(a))),A.createElement(L.g7,{[u]:"",ref:s},r)});return[{Provider:e=>{let{scope:t,children:n}=e,r=A.useRef(null),o=A.useRef(new Map).current;return A.createElement(i,{scope:t,itemMap:o,collectionRef:r},n)},Slot:s,ItemSlot:c},function(t){let n=o(e+"CollectionConsumer",t),r=A.useCallback(()=>{let e=n.collectionRef.current;if(!e)return[];let t=Array.from(e.querySelectorAll(`[${u}]`)),r=Array.from(n.itemMap.values()),i=r.sort((e,n)=>t.indexOf(e.ref.current)-t.indexOf(n.ref.current));return i},[n.collectionRef,n.itemMap]);return r},r]}var F=n(41816),z=n(73597),V=n(72130),I=n(64680),B=n(28245),H=n(26074);let U="Collapsible",[W,q]=(0,R.b)(U),[$,K]=W(U),Y=(0,A.forwardRef)((e,t)=>{let{__scopeCollapsible:n,open:r,defaultOpen:i,disabled:o,onOpenChange:a,...s}=e,[l=!1,u]=(0,z.T)({prop:r,defaultProp:i,onChange:a});return(0,A.createElement)($,{scope:n,disabled:o,contentId:(0,H.M)(),open:l,onOpenToggle:(0,A.useCallback)(()=>u(e=>!e),[u])},(0,A.createElement)(V.WV.div,(0,N.Z)({"data-state":ee(l),"data-disabled":o?"":void 0},s,{ref:t})))}),G=(0,A.forwardRef)((e,t)=>{let{__scopeCollapsible:n,...r}=e,i=K("CollapsibleTrigger",n);return(0,A.createElement)(V.WV.button,(0,N.Z)({type:"button","aria-controls":i.contentId,"aria-expanded":i.open||!1,"data-state":ee(i.open),"data-disabled":i.disabled?"":void 0,disabled:i.disabled},r,{ref:t,onClick:(0,F.M)(e.onClick,i.onOpenToggle)}))}),X="CollapsibleContent",Q=(0,A.forwardRef)((e,t)=>{let{forceMount:n,...r}=e,i=K(X,e.__scopeCollapsible);return(0,A.createElement)(B.z,{present:n||i.open},({present:e})=>(0,A.createElement)(J,(0,N.Z)({},r,{ref:t,present:e})))}),J=(0,A.forwardRef)((e,t)=>{let{__scopeCollapsible:n,present:r,children:i,...o}=e,a=K(X,n),[s,l]=(0,A.useState)(r),u=(0,A.useRef)(null),c=(0,D.e)(t,u),d=(0,A.useRef)(0),f=d.current,h=(0,A.useRef)(0),p=h.current,m=a.open||s,v=(0,A.useRef)(m),g=(0,A.useRef)();return(0,A.useEffect)(()=>{let e=requestAnimationFrame(()=>v.current=!1);return()=>cancelAnimationFrame(e)},[]),(0,I.b)(()=>{let e=u.current;if(e){g.current=g.current||{transitionDuration:e.style.transitionDuration,animationDuration:e.style.animationDuration,animationFillMode:e.style.animationFillMode},e.style.transitionDuration="0s",e.style.animationDuration="0s",e.style.animationFillMode="none";let t=e.getBoundingClientRect();d.current=t.height,h.current=t.width,v.current||(e.style.transitionDuration=g.current.transitionDuration,e.style.animationDuration=g.current.animationDuration,e.style.animationFillMode=g.current.animationFillMode),l(r)}},[a.open,r]),(0,A.createElement)(V.WV.div,(0,N.Z)({"data-state":ee(a.open),"data-disabled":a.disabled?"":void 0,id:a.contentId,hidden:!m},o,{ref:c,style:{"--radix-collapsible-content-height":f?`${f}px`:void 0,"--radix-collapsible-content-width":p?`${p}px`:void 0,...e.style}}),m&&i)});function ee(e){return e?"open":"closed"}let et="Accordion",en=["Home","End","ArrowDown","ArrowUp"],[er,ei,eo]=Z(et),[ea,es]=(0,R.b)(et,[eo,q]),el=q(),eu=A.forwardRef((e,t)=>{let{type:n,...r}=e;return A.createElement(er.Provider,{scope:e.__scopeAccordion},"multiple"===n?A.createElement(em,(0,N.Z)({},r,{ref:t})):A.createElement(ep,(0,N.Z)({},r,{ref:t})))});eu.propTypes={type(e){let t=e.value||e.defaultValue;return e.type&&!["single","multiple"].includes(e.type)?Error("Invalid prop `type` supplied to `Accordion`. Expected one of `single | multiple`."):"multiple"===e.type&&"string"==typeof t?Error("Invalid prop `type` supplied to `Accordion`. Expected `single` when `defaultValue` or `value` is type `string`."):"single"===e.type&&Array.isArray(t)?Error("Invalid prop `type` supplied to `Accordion`. Expected `multiple` when `defaultValue` or `value` is type `string[]`."):null}};let[ec,ed]=ea(et),[ef,eh]=ea(et,{collapsible:!1}),ep=A.forwardRef((e,t)=>{let{value:n,defaultValue:r,onValueChange:i=()=>{},collapsible:o=!1,...a}=e,[s,l]=(0,z.T)({prop:n,defaultProp:r,onChange:i});return A.createElement(ec,{scope:e.__scopeAccordion,value:s?[s]:[],onItemOpen:l,onItemClose:A.useCallback(()=>o&&l(""),[o,l])},A.createElement(ef,{scope:e.__scopeAccordion,collapsible:o},A.createElement(ey,(0,N.Z)({},a,{ref:t}))))}),em=A.forwardRef((e,t)=>{let{value:n,defaultValue:r,onValueChange:i=()=>{},...o}=e,[a=[],s]=(0,z.T)({prop:n,defaultProp:r,onChange:i}),l=A.useCallback(e=>s((t=[])=>[...t,e]),[s]),u=A.useCallback(e=>s((t=[])=>t.filter(t=>t!==e)),[s]);return A.createElement(ec,{scope:e.__scopeAccordion,value:a,onItemOpen:l,onItemClose:u},A.createElement(ef,{scope:e.__scopeAccordion,collapsible:!0},A.createElement(ey,(0,N.Z)({},o,{ref:t}))))}),[ev,eg]=ea(et),ey=A.forwardRef((e,t)=>{let{__scopeAccordion:n,disabled:r,...i}=e,o=A.useRef(null),a=(0,D.e)(o,t),s=ei(n),l=(0,F.M)(e.onKeyDown,e=>{var t;if(!en.includes(e.key))return;let n=e.target,r=s().filter(e=>{var t;return!(null!==(t=e.ref.current)&&void 0!==t&&t.disabled)}),i=r.findIndex(e=>e.ref.current===n),o=r.length;if(-1===i)return;e.preventDefault();let a=i;switch(e.key){case"Home":a=0;break;case"End":a=o-1;break;case"ArrowDown":a=i+1;break;case"ArrowUp":(a=i-1)<0&&(a=o-1)}let l=a%o;null===(t=r[l].ref.current)||void 0===t||t.focus()});return A.createElement(ev,{scope:n,disabled:r},A.createElement(er.Slot,{scope:n},A.createElement(V.WV.div,(0,N.Z)({},i,{ref:a,onKeyDown:r?void 0:l}))))}),eb="AccordionItem",[ex,ew]=ea(eb),ej=A.forwardRef((e,t)=>{let{__scopeAccordion:n,value:r,...i}=e,o=eg(eb,n),a=ed(eb,n),s=el(n),l=(0,H.M)(),u=r&&a.value.includes(r)||!1,c=o.disabled||e.disabled;return A.createElement(ex,{scope:n,open:u,disabled:c,triggerId:l},A.createElement(Y,(0,N.Z)({"data-state":u?"open":"closed"},s,i,{ref:t,disabled:c,open:u,onOpenChange:e=>{e?a.onItemOpen(r):a.onItemClose(r)}})))}),ek=A.forwardRef((e,t)=>{let{__scopeAccordion:n,...r}=e,i=ew("AccordionHeader",n);return A.createElement(V.WV.h3,(0,N.Z)({"data-state":i.open?"open":"closed","data-disabled":i.disabled?"":void 0},r,{ref:t}))}),eE="AccordionTrigger",eS=A.forwardRef((e,t)=>{let{__scopeAccordion:n,...r}=e,i=ew(eE,n),o=eh(eE,n),a=el(n);return A.createElement(er.ItemSlot,{scope:n},A.createElement(G,(0,N.Z)({"aria-disabled":i.open&&!o.collapsible||void 0,id:i.triggerId},a,r,{ref:t})))}),e_=A.forwardRef((e,t)=>{let{__scopeAccordion:n,...r}=e,i=ew("AccordionContent",n),o=el(n);return A.createElement(Q,(0,N.Z)({role:"region","aria-labelledby":i.triggerId},o,r,{ref:t,style:{"--radix-accordion-content-height":"var(--radix-collapsible-content-height)","--radix-accordion-content-width":"var(--radix-collapsible-content-width)",...e.style}}))});var eC=n(82851),eO=n(83317);function eM(e){return e.split("-")[0]}function eT(e){return e.split("-")[1]}function eA(e){return["top","bottom"].includes(eM(e))?"x":"y"}function eP(e){return"y"===e?"height":"width"}function eN(e,t,n){let r,{reference:i,floating:o}=e,a=i.x+i.width/2-o.width/2,s=i.y+i.height/2-o.height/2,l=eA(t),u=eP(l),c=i[u]/2-o[u]/2,d="x"===l;switch(eM(t)){case"top":r={x:a,y:i.y-o.height};break;case"bottom":r={x:a,y:i.y+i.height};break;case"right":r={x:i.x+i.width,y:s};break;case"left":r={x:i.x-o.width,y:s};break;default:r={x:i.x,y:i.y}}switch(eT(t)){case"start":r[l]-=c*(n&&d?-1:1);break;case"end":r[l]+=c*(n&&d?-1:1)}return r}let eR=async(e,t,n)=>{let{placement:r="bottom",strategy:i="absolute",middleware:o=[],platform:a}=n,s=await (null==a.isRTL?void 0:a.isRTL(t)),l=await a.getElementRects({reference:e,floating:t,strategy:i}),{x:u,y:c}=eN(l,r,s),d=r,f={},h=0;for(let n=0;n({name:"arrow",options:e,async fn(t){let{element:n,padding:r=0}=null!=e?e:{},{x:i,y:o,placement:a,rects:s,platform:l}=t;if(null==n)return{};let u=eD(r),c={x:i,y:o},d=eA(a),f=eT(a),h=eP(d),p=await l.getDimensions(n),m="y"===d?"top":"left",v="y"===d?"bottom":"right",g=s.reference[h]+s.reference[d]-c[d]-s.floating[h],y=c[d]-s.reference[d],b=await (null==l.getOffsetParent?void 0:l.getOffsetParent(n)),x=b?"y"===d?b.clientHeight||0:b.clientWidth||0:0;0===x&&(x=s.floating[h]);let w=u[m],j=x-p[h]-u[v],k=x/2-p[h]/2+(g/2-y/2),E=ez(w,eF(k,j)),S=("start"===f?u[m]:u[v])>0&&k!==E&&s.reference[h]<=s.floating[h];return{[d]:c[d]-(S?keI[e])}let eH={start:"end",end:"start"};function eU(e){return e.replace(/start|end/g,e=>eH[e])}let eW=["top","right","bottom","left"];eW.reduce((e,t)=>e.concat(t,t+"-start",t+"-end"),[]);let eq=function(e){return void 0===e&&(e={}),{name:"flip",options:e,async fn(t){var n,r,i,o;let{placement:a,middlewareData:s,rects:l,initialPlacement:u,platform:c,elements:d}=t,{mainAxis:f=!0,crossAxis:h=!0,fallbackPlacements:p,fallbackStrategy:m="bestFit",flipAlignment:v=!0,...g}=e,y=eM(a),b=p||(y!==u&&v?function(e){let t=eB(e);return[eU(e),t,eU(t)]}(u):[eB(u)]),x=[u,...b],w=await eZ(t,g),j=[],k=(null==(n=s.flip)?void 0:n.overflows)||[];if(f&&j.push(w[y]),h){let{main:e,cross:t}=function(e,t,n){void 0===n&&(n=!1);let r=eT(e),i=eA(e),o=eP(i),a="x"===i?r===(n?"end":"start")?"right":"left":"start"===r?"bottom":"top";return t.reference[o]>t.floating[o]&&(a=eB(a)),{main:a,cross:eB(a)}}(a,l,await (null==c.isRTL?void 0:c.isRTL(d.floating)));j.push(w[e],w[t])}if(k=[...k,{placement:a,overflows:j}],!j.every(e=>e<=0)){let e=(null!=(r=null==(i=s.flip)?void 0:i.index)?r:0)+1,t=x[e];if(t)return{data:{index:e,overflows:k},reset:{placement:t}};let n="bottom";switch(m){case"bestFit":{let e=null==(o=k.map(e=>[e,e.overflows.filter(e=>e>0).reduce((e,t)=>e+t,0)]).sort((e,t)=>e[1]-t[1])[0])?void 0:o[0].placement;e&&(n=e);break}case"initialPlacement":n=u}if(a!==n)return{reset:{placement:n}}}return{}}}};function e$(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function eK(e){return eW.some(t=>e[t]>=0)}let eY=function(e){let{strategy:t="referenceHidden",...n}=void 0===e?{}:e;return{name:"hide",async fn(e){let{rects:r}=e;switch(t){case"referenceHidden":{let t=e$(await eZ(e,{...n,elementContext:"reference"}),r.reference);return{data:{referenceHiddenOffsets:t,referenceHidden:eK(t)}}}case"escaped":{let t=e$(await eZ(e,{...n,altBoundary:!0}),r.floating);return{data:{escapedOffsets:t,escaped:eK(t)}}}default:return{}}}}},eG=function(e){return void 0===e&&(e=0),{name:"offset",options:e,async fn(t){let{x:n,y:r}=t,i=await async function(e,t){let{placement:n,platform:r,elements:i}=e,o=await (null==r.isRTL?void 0:r.isRTL(i.floating)),a=eM(n),s=eT(n),l="x"===eA(n),u=["left","top"].includes(a)?-1:1,c=o&&l?-1:1,d="function"==typeof t?t(e):t,{mainAxis:f,crossAxis:h,alignmentAxis:p}="number"==typeof d?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:0,crossAxis:0,alignmentAxis:null,...d};return s&&"number"==typeof p&&(h="end"===s?-1*p:p),l?{x:h*c,y:f*u}:{x:f*u,y:h*c}}(t,e);return{x:n+i.x,y:r+i.y,data:i}}}};function eX(e){return"x"===e?"y":"x"}let eQ=function(e){return void 0===e&&(e={}),{name:"shift",options:e,async fn(t){let{x:n,y:r,placement:i}=t,{mainAxis:o=!0,crossAxis:a=!1,limiter:s={fn:e=>{let{x:t,y:n}=e;return{x:t,y:n}}},...l}=e,u={x:n,y:r},c=await eZ(t,l),d=eA(eM(i)),f=eX(d),h=u[d],p=u[f];if(o){let e="y"===d?"bottom":"right";h=ez(h+c["y"===d?"top":"left"],eF(h,h-c[e]))}a&&(p=ez(p+c["y"===f?"top":"left"],eF(p,p-c["y"===f?"bottom":"right"])));let m=s.fn({...t,[d]:h,[f]:p});return{...m,data:{x:m.x-n,y:m.y-r}}}}},eJ=function(e){return void 0===e&&(e={}),{options:e,fn(t){let{x:n,y:r,placement:i,rects:o,middlewareData:a}=t,{offset:s=0,mainAxis:l=!0,crossAxis:u=!0}=e,c={x:n,y:r},d=eA(i),f=eX(d),h=c[d],p=c[f],m="function"==typeof s?s({...o,placement:i}):s,v="number"==typeof m?{mainAxis:m,crossAxis:0}:{mainAxis:0,crossAxis:0,...m};if(l){let e="y"===d?"height":"width",t=o.reference[d]-o.floating[e]+v.mainAxis,n=o.reference[d]+o.reference[e]-v.mainAxis;hn&&(h=n)}if(u){var g,y,b,x;let e="y"===d?"width":"height",t=["top","left"].includes(eM(i)),n=o.reference[f]-o.floating[e]+(t&&null!=(g=null==(y=a.offset)?void 0:y[f])?g:0)+(t?0:v.crossAxis),r=o.reference[f]+o.reference[e]+(t?0:null!=(b=null==(x=a.offset)?void 0:x[f])?b:0)-(t?v.crossAxis:0);pr&&(p=r)}return{[d]:h,[f]:p}}}};function e0(e){return e&&e.document&&e.location&&e.alert&&e.setInterval}function e1(e){if(null==e)return window;if(!e0(e)){let t=e.ownerDocument;return t&&t.defaultView||window}return e}function e2(e){return e1(e).getComputedStyle(e)}function e4(e){return e0(e)?"":e?(e.nodeName||"").toLowerCase():""}function e3(){let e=navigator.userAgentData;return null!=e&&e.brands?e.brands.map(e=>e.brand+"/"+e.version).join(" "):navigator.userAgent}function e5(e){return e instanceof e1(e).HTMLElement}function e6(e){return e instanceof e1(e).Element}function e8(e){return"undefined"!=typeof ShadowRoot&&(e instanceof e1(e).ShadowRoot||e instanceof ShadowRoot)}function e7(e){let{overflow:t,overflowX:n,overflowY:r}=e2(e);return/auto|scroll|overlay|hidden/.test(t+r+n)}function e9(e){let t=/firefox/i.test(e3()),n=e2(e);return"none"!==n.transform||"none"!==n.perspective||"paint"===n.contain||["transform","perspective"].includes(n.willChange)||t&&"filter"===n.willChange||t&&!!n.filter&&"none"!==n.filter}function te(){return!/^((?!chrome|android).)*safari/i.test(e3())}let tt=Math.min,tn=Math.max,tr=Math.round;function ti(e,t,n){var r,i,o,a;void 0===t&&(t=!1),void 0===n&&(n=!1);let s=e.getBoundingClientRect(),l=1,u=1;t&&e5(e)&&(l=e.offsetWidth>0&&tr(s.width)/e.offsetWidth||1,u=e.offsetHeight>0&&tr(s.height)/e.offsetHeight||1);let c=e6(e)?e1(e):window,d=!te()&&n,f=(s.left+(d&&null!=(r=null==(i=c.visualViewport)?void 0:i.offsetLeft)?r:0))/l,h=(s.top+(d&&null!=(o=null==(a=c.visualViewport)?void 0:a.offsetTop)?o:0))/u,p=s.width/l,m=s.height/u;return{width:p,height:m,top:h,right:f+p,bottom:h+m,left:f,x:f,y:h}}function to(e){return((e instanceof e1(e).Node?e.ownerDocument:e.document)||window.document).documentElement}function ta(e){return e6(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.pageXOffset,scrollTop:e.pageYOffset}}function ts(e){return ti(to(e)).left+ta(e).scrollLeft}function tl(e){return"html"===e4(e)?e:e.assignedSlot||e.parentNode||(e8(e)?e.host:null)||to(e)}function tu(e){return e5(e)&&"fixed"!==getComputedStyle(e).position?e.offsetParent:null}function tc(e){let t=e1(e),n=tu(e);for(;n&&["table","td","th"].includes(e4(n))&&"static"===getComputedStyle(n).position;)n=tu(n);return n&&("html"===e4(n)||"body"===e4(n)&&"static"===getComputedStyle(n).position&&!e9(n))?t:n||function(e){let t=tl(e);for(e8(t)&&(t=t.host);e5(t)&&!["html","body"].includes(e4(t));){if(e9(t))return t;t=t.parentNode}return null}(e)||t}function td(e){if(e5(e))return{width:e.offsetWidth,height:e.offsetHeight};let t=ti(e);return{width:t.width,height:t.height}}function tf(e,t){var n;void 0===t&&(t=[]);let r=function e(t){let n=tl(t);return["html","body","#document"].includes(e4(n))?t.ownerDocument.body:e5(n)&&e7(n)?n:e(n)}(e),i=r===(null==(n=e.ownerDocument)?void 0:n.body),o=e1(r),a=i?[o].concat(o.visualViewport||[],e7(r)?r:[]):r,s=t.concat(a);return i?s:s.concat(tf(a))}function th(e,t,n){return"viewport"===t?eL(function(e,t){let n=e1(e),r=to(e),i=n.visualViewport,o=r.clientWidth,a=r.clientHeight,s=0,l=0;if(i){o=i.width,a=i.height;let e=te();(e||!e&&"fixed"===t)&&(s=i.offsetLeft,l=i.offsetTop)}return{width:o,height:a,x:s,y:l}}(e,n)):e6(t)?function(e,t){let n=ti(e,!1,"fixed"===t),r=n.top+e.clientTop,i=n.left+e.clientLeft;return{top:r,left:i,x:i,y:r,right:i+e.clientWidth,bottom:r+e.clientHeight,width:e.clientWidth,height:e.clientHeight}}(t,n):eL(function(e){var t;let n=to(e),r=ta(e),i=null==(t=e.ownerDocument)?void 0:t.body,o=tn(n.scrollWidth,n.clientWidth,i?i.scrollWidth:0,i?i.clientWidth:0),a=tn(n.scrollHeight,n.clientHeight,i?i.scrollHeight:0,i?i.clientHeight:0),s=-r.scrollLeft+ts(e),l=-r.scrollTop;return"rtl"===e2(i||n).direction&&(s+=tn(n.clientWidth,i?i.clientWidth:0)-o),{width:o,height:a,x:s,y:l}}(to(e)))}let tp={getClippingRect:function(e){let{element:t,boundary:n,rootBoundary:r,strategy:i}=e,o=[..."clippingAncestors"===n?function(e){let t=tf(e),n=["absolute","fixed"].includes(e2(e).position)&&e5(e)?tc(e):e;return e6(n)?t.filter(e=>e6(e)&&function(e,t){let n=null==t.getRootNode?void 0:t.getRootNode();if(e.contains(t))return!0;if(n&&e8(n)){let n=t;do{if(n&&e===n)return!0;n=n.parentNode||n.host}while(n)}return!1}(e,n)&&"body"!==e4(e)):[]}(t):[].concat(n),r],a=o[0],s=o.reduce((e,n)=>{let r=th(t,n,i);return e.top=tn(r.top,e.top),e.right=tt(r.right,e.right),e.bottom=tt(r.bottom,e.bottom),e.left=tn(r.left,e.left),e},th(t,a,i));return{width:s.right-s.left,height:s.bottom-s.top,x:s.left,y:s.top}},convertOffsetParentRelativeRectToViewportRelativeRect:function(e){let{rect:t,offsetParent:n,strategy:r}=e,i=e5(n),o=to(n);if(n===o)return t;let a={scrollLeft:0,scrollTop:0},s={x:0,y:0};if((i||!i&&"fixed"!==r)&&(("body"!==e4(n)||e7(o))&&(a=ta(n)),e5(n))){let e=ti(n,!0);s.x=e.x+n.clientLeft,s.y=e.y+n.clientTop}return{...t,x:t.x-a.scrollLeft+s.x,y:t.y-a.scrollTop+s.y}},isElement:e6,getDimensions:td,getOffsetParent:tc,getDocumentElement:to,getElementRects:e=>{let{reference:t,floating:n,strategy:r}=e;return{reference:function(e,t,n){let r=e5(t),i=to(t),o=ti(e,r&&function(e){let t=ti(e);return tr(t.width)!==e.offsetWidth||tr(t.height)!==e.offsetHeight}(t),"fixed"===n),a={scrollLeft:0,scrollTop:0},s={x:0,y:0};if(r||!r&&"fixed"!==n){if(("body"!==e4(t)||e7(i))&&(a=ta(t)),e5(t)){let e=ti(t,!0);s.x=e.x+t.clientLeft,s.y=e.y+t.clientTop}else i&&(s.x=ts(i))}return{x:o.left+a.scrollLeft-s.x,y:o.top+a.scrollTop-s.y,width:o.width,height:o.height}}(t,tc(n),r),floating:{...td(n),x:0,y:0}}},getClientRects:e=>Array.from(e.getClientRects()),isRTL:e=>"rtl"===e2(e).direction};function tm(e,t,n,r){void 0===r&&(r={});let{ancestorScroll:i=!0,ancestorResize:o=!0,elementResize:a=!0,animationFrame:s=!1}=r,l=i&&!s,u=o&&!s,c=l||u?[...e6(e)?tf(e):[],...tf(t)]:[];c.forEach(e=>{l&&e.addEventListener("scroll",n,{passive:!0}),u&&e.addEventListener("resize",n)});let d,f=null;if(a){let r=!0;f=new ResizeObserver(()=>{r||n(),r=!1}),e6(e)&&!s&&f.observe(e),f.observe(t)}let h=s?ti(e):null;return s&&function t(){let r=ti(e);h&&(r.x!==h.x||r.y!==h.y||r.width!==h.width||r.height!==h.height)&&n(),h=r,d=requestAnimationFrame(t)}(),n(),()=>{var e;c.forEach(e=>{l&&e.removeEventListener("scroll",n),u&&e.removeEventListener("resize",n)}),null==(e=f)||e.disconnect(),f=null,s&&cancelAnimationFrame(d)}}let tv=(e,t,n)=>eR(e,t,{platform:tp,...n});var tg=n(28316),ty="undefined"!=typeof document?A.useLayoutEffect:A.useEffect;function tb(e){let{middleware:t,placement:n="bottom",strategy:r="absolute",whileElementsMounted:i}=void 0===e?{}:e,o=A.useRef(null),a=A.useRef(null),s=function(e){let t=A.useRef(e);return ty(()=>{t.current=e}),t}(i),l=A.useRef(null),[u,c]=A.useState({x:null,y:null,strategy:r,placement:n,middlewareData:{}}),[d,f]=A.useState(t);!function e(t,n){let r,i,o;if(t===n)return!0;if(typeof t!=typeof n)return!1;if("function"==typeof t&&t.toString()===n.toString())return!0;if(t&&n&&"object"==typeof t){if(Array.isArray(t)){if((r=t.length)!=n.length)return!1;for(i=r;0!=i--;)if(!e(t[i],n[i]))return!1;return!0}if((r=(o=Object.keys(t)).length)!==Object.keys(n).length)return!1;for(i=r;0!=i--;)if(!Object.prototype.hasOwnProperty.call(n,o[i]))return!1;for(i=r;0!=i--;){let r=o[i];if(("_owner"!==r||!t.$$typeof)&&!e(t[r],n[r]))return!1}return!0}return t!=t&&n!=n}(null==d?void 0:d.map(e=>{let{options:t}=e;return t}),null==t?void 0:t.map(e=>{let{options:t}=e;return t}))&&f(t);let h=A.useCallback(()=>{o.current&&a.current&&tv(o.current,a.current,{middleware:d,placement:n,strategy:r}).then(e=>{p.current&&tg.flushSync(()=>{c(e)})})},[d,n,r]);ty(()=>{p.current&&h()},[h]);let p=A.useRef(!1);ty(()=>(p.current=!0,()=>{p.current=!1}),[]);let m=A.useCallback(()=>{if("function"==typeof l.current&&(l.current(),l.current=null),o.current&&a.current){if(s.current){let e=s.current(o.current,a.current,h);l.current=e}else h()}},[h,s]),v=A.useCallback(e=>{o.current=e,m()},[m]),g=A.useCallback(e=>{a.current=e,m()},[m]),y=A.useMemo(()=>({reference:o,floating:a}),[]);return A.useMemo(()=>({...u,update:h,refs:y,reference:v,floating:g}),[u,h,y,v,g])}let tx=e=>{let{element:t,padding:n}=e;return{name:"arrow",options:e,fn(e){if(Object.prototype.hasOwnProperty.call(t,"current")){if(null!=t.current)return eV({element:t.current,padding:n}).fn(e)}else if(t)return eV({element:t,padding:n}).fn(e);return{}}}},tw=(0,A.forwardRef)((e,t)=>{let{children:n,width:r=10,height:i=5,...o}=e;return(0,A.createElement)(V.WV.svg,(0,N.Z)({},o,{ref:t,width:r,height:i,viewBox:"0 0 30 10",preserveAspectRatio:"none"}),e.asChild?n:(0,A.createElement)("polygon",{points:"0,0 30,0 15,10"}))});function tj(e){let[t,n]=(0,A.useState)(void 0);return(0,I.b)(()=>{if(e){n({width:e.offsetWidth,height:e.offsetHeight});let t=new ResizeObserver(t=>{let r,i;if(!Array.isArray(t)||!t.length)return;let o=t[0];if("borderBoxSize"in o){let e=o.borderBoxSize,t=Array.isArray(e)?e[0]:e;r=t.inlineSize,i=t.blockSize}else r=e.offsetWidth,i=e.offsetHeight;n({width:r,height:i})});return t.observe(e,{box:"border-box"}),()=>t.unobserve(e)}n(void 0)},[e]),t}let tk="Popper",[tE,tS]=(0,R.b)(tk),[t_,tC]=tE(tk),tO=(0,A.forwardRef)((e,t)=>{let{__scopePopper:n,virtualRef:r,...i}=e,o=tC("PopperAnchor",n),a=(0,A.useRef)(null),s=(0,D.e)(t,a);return(0,A.useEffect)(()=>{o.onAnchorChange((null==r?void 0:r.current)||a.current)}),r?null:(0,A.createElement)(V.WV.div,(0,N.Z)({},i,{ref:s}))}),tM="PopperContent",[tT,tA]=tE(tM),[tP,tN]=tE(tM,{hasParent:!1,positionUpdateFns:new Set}),tR=(0,A.forwardRef)((e,t)=>{var n,r,i,o,a,s,l,u;let{__scopePopper:c,side:d="bottom",sideOffset:f=0,align:h="center",alignOffset:p=0,arrowPadding:m=0,collisionBoundary:v=[],collisionPadding:g=0,sticky:y="partial",hideWhenDetached:b=!1,avoidCollisions:x=!0,...w}=e,j=tC(tM,c),[k,E]=(0,A.useState)(null),S=(0,D.e)(t,e=>E(e)),[_,C]=(0,A.useState)(null),O=tj(_),M=null!==(n=null==O?void 0:O.width)&&void 0!==n?n:0,T=null!==(r=null==O?void 0:O.height)&&void 0!==r?r:0,P="number"==typeof g?g:{top:0,right:0,bottom:0,left:0,...g},N=Array.isArray(v)?v:[v],R=N.length>0,L={padding:P,boundary:N.filter(tF),altBoundary:R},{reference:Z,floating:F,strategy:z,x:B,y:H,placement:U,middlewareData:W,update:q}=tb({strategy:"fixed",placement:d+("center"!==h?"-"+h:""),whileElementsMounted:tm,middleware:[eG({mainAxis:f+T,alignmentAxis:p}),x?eQ({mainAxis:!0,crossAxis:!1,limiter:"partial"===y?eJ():void 0,...L}):void 0,_?tx({element:_,padding:m}):void 0,x?eq({...L}):void 0,tz({arrowWidth:M,arrowHeight:T}),b?eY({strategy:"referenceHidden"}):void 0].filter(tZ)});(0,I.b)(()=>{Z(j.anchor)},[Z,j.anchor]);let $=null!==B&&null!==H,[K,Y]=tV(U),G=null===(i=W.arrow)||void 0===i?void 0:i.x,X=null===(o=W.arrow)||void 0===o?void 0:o.y,Q=(null===(a=W.arrow)||void 0===a?void 0:a.centerOffset)!==0,[J,ee]=(0,A.useState)();(0,I.b)(()=>{k&&ee(window.getComputedStyle(k).zIndex)},[k]);let{hasParent:et,positionUpdateFns:en}=tN(tM,c),er=!et;(0,A.useLayoutEffect)(()=>{if(!er)return en.add(q),()=>{en.delete(q)}},[er,en,q]),(0,A.useLayoutEffect)(()=>{er&&$&&Array.from(en).reverse().forEach(e=>requestAnimationFrame(e))},[er,$,en]);let ei={"data-side":K,"data-align":Y,...w,ref:S,style:{...w.style,animation:$?void 0:"none",opacity:null!==(s=W.hide)&&void 0!==s&&s.referenceHidden?0:void 0}};return(0,A.createElement)("div",{ref:F,"data-radix-popper-content-wrapper":"",style:{position:z,left:0,top:0,transform:$?`translate3d(${Math.round(B)}px, ${Math.round(H)}px, 0)`:"translate3d(0, -200%, 0)",minWidth:"max-content",zIndex:J,"--radix-popper-transform-origin":[null===(l=W.transformOrigin)||void 0===l?void 0:l.x,null===(u=W.transformOrigin)||void 0===u?void 0:u.y].join(" ")}},(0,A.createElement)(tT,{scope:c,placedSide:K,onArrowChange:C,arrowX:G,arrowY:X,shouldHideArrow:Q},er?(0,A.createElement)(tP,{scope:c,hasParent:!0,positionUpdateFns:en},(0,A.createElement)(V.WV.div,ei)):(0,A.createElement)(V.WV.div,ei)))}),tD={top:"bottom",right:"left",bottom:"top",left:"right"},tL=(0,A.forwardRef)(function(e,t){let{__scopePopper:n,...r}=e,i=tA("PopperArrow",n),o=tD[i.placedSide];return(0,A.createElement)("span",{ref:i.onArrowChange,style:{position:"absolute",left:i.arrowX,top:i.arrowY,[o]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[i.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[i.placedSide],visibility:i.shouldHideArrow?"hidden":void 0}},(0,A.createElement)(tw,(0,N.Z)({},r,{ref:t,style:{...r.style,display:"block"}})))});function tZ(e){return void 0!==e}function tF(e){return null!==e}let tz=e=>({name:"transformOrigin",options:e,fn(t){var n,r,i,o,a;let{placement:s,rects:l,middlewareData:u}=t,c=(null===(n=u.arrow)||void 0===n?void 0:n.centerOffset)!==0,d=c?0:e.arrowWidth,f=c?0:e.arrowHeight,[h,p]=tV(s),m={start:"0%",center:"50%",end:"100%"}[p],v=(null!==(r=null===(i=u.arrow)||void 0===i?void 0:i.x)&&void 0!==r?r:0)+d/2,g=(null!==(o=null===(a=u.arrow)||void 0===a?void 0:a.y)&&void 0!==o?o:0)+f/2,y="",b="";return"bottom"===h?(y=c?m:`${v}px`,b=`${-f}px`):"top"===h?(y=c?m:`${v}px`,b=`${l.floating.height+f}px`):"right"===h?(y=`${-f}px`,b=c?m:`${g}px`):"left"===h&&(y=`${l.floating.width+f}px`,b=c?m:`${g}px`),{data:{x:y,y:b}}}});function tV(e){let[t,n="center"]=e.split("-");return[t,n]}let tI=e=>{let{__scopePopper:t,children:n}=e,[r,i]=(0,A.useState)(null);return(0,A.createElement)(t_,{scope:t,anchor:r,onAnchorChange:i},n)};var tB=n(6500);let tH=(0,A.forwardRef)((e,t)=>(0,A.createElement)(V.WV.span,(0,N.Z)({},e,{ref:t,style:{position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal",...e.style}}))),[tU,tW]=(0,R.b)("Tooltip",[tS]),tq=tS(),t$="tooltip.open",[tK,tY]=tU("TooltipProvider"),tG="Tooltip",[tX,tQ]=tU(tG),tJ="TooltipTrigger",t0=(0,A.forwardRef)((e,t)=>{let{__scopeTooltip:n,...r}=e,i=tQ(tJ,n),o=tY(tJ,n),a=tq(n),s=(0,A.useRef)(null),l=(0,D.e)(t,s,i.onTriggerChange),u=(0,A.useRef)(!1),c=(0,A.useRef)(!1),d=(0,A.useCallback)(()=>u.current=!1,[]);return(0,A.useEffect)(()=>()=>document.removeEventListener("pointerup",d),[d]),(0,A.createElement)(tO,(0,N.Z)({asChild:!0},a),(0,A.createElement)(V.WV.button,(0,N.Z)({"aria-describedby":i.open?i.contentId:void 0,"data-state":i.stateAttribute},r,{ref:l,onPointerMove:(0,F.M)(e.onPointerMove,e=>{"touch"===e.pointerType||c.current||o.isPointerInTransitRef.current||(i.onTriggerEnter(),c.current=!0)}),onPointerLeave:(0,F.M)(e.onPointerLeave,()=>{i.onTriggerLeave(),c.current=!1}),onPointerDown:(0,F.M)(e.onPointerDown,()=>{u.current=!0,document.addEventListener("pointerup",d,{once:!0})}),onFocus:(0,F.M)(e.onFocus,()=>{u.current||i.onOpen()}),onBlur:(0,F.M)(e.onBlur,i.onClose),onClick:(0,F.M)(e.onClick,e=>{let t=0===e.detail;t&&i.onClose()})})))}),t1="TooltipPortal",[t2,t4]=tU(t1,{forceMount:void 0}),t3="TooltipContent",t5=(0,A.forwardRef)((e,t)=>{let n=t4(t3,e.__scopeTooltip),{forceMount:r=n.forceMount,side:i="top",...o}=e,a=tQ(t3,e.__scopeTooltip);return(0,A.createElement)(B.z,{present:r||a.open},a.disableHoverableContent?(0,A.createElement)(t9,(0,N.Z)({side:i},o,{ref:t})):(0,A.createElement)(t6,(0,N.Z)({side:i},o,{ref:t})))}),t6=(0,A.forwardRef)((e,t)=>{let n=tQ(t3,e.__scopeTooltip),r=tY(t3,e.__scopeTooltip),i=(0,A.useRef)(null),o=(0,D.e)(t,i),[a,s]=(0,A.useState)(null),{trigger:l,onClose:u}=n,c=i.current,{onPointerInTransitChange:d}=r,f=(0,A.useCallback)(()=>{s(null),d(!1)},[d]),h=(0,A.useCallback)((e,t)=>{let n=e.currentTarget,r={x:e.clientX,y:e.clientY},i=function(e,t){let n=Math.abs(t.top-e.y),r=Math.abs(t.bottom-e.y),i=Math.abs(t.right-e.x),o=Math.abs(t.left-e.x);switch(Math.min(n,r,i,o)){case o:return"left";case i:return"right";case n:return"top";case r:return"bottom";default:return null}}(r,n.getBoundingClientRect()),o="right"===i||"bottom"===i?-5:5,a="right"===i||"left"===i?{x:e.clientX+o,y:e.clientY}:{x:e.clientX,y:e.clientY+o},l=function(e){let{top:t,right:n,bottom:r,left:i}=e;return[{x:i,y:t},{x:n,y:t},{x:n,y:r},{x:i,y:r}]}(t.getBoundingClientRect()),u=function(e){let t=e.slice();return t.sort((e,t)=>e.xt.x?1:e.yt.y?1:0),function(e){if(e.length<=1)return e.slice();let t=[];for(let n=0;n=2;){let e=t[t.length-1],n=t[t.length-2];if((e.x-n.x)*(r.y-n.y)>=(e.y-n.y)*(r.x-n.x))t.pop();else break}t.push(r)}t.pop();let n=[];for(let t=e.length-1;t>=0;t--){let r=e[t];for(;n.length>=2;){let e=n[n.length-1],t=n[n.length-2];if((e.x-t.x)*(r.y-t.y)>=(e.y-t.y)*(r.x-t.x))n.pop();else break}n.push(r)}return(n.pop(),1===t.length&&1===n.length&&t[0].x===n[0].x&&t[0].y===n[0].y)?t:t.concat(n)}(t)}([a,...l]);s(u),d(!0)},[d]);return(0,A.useEffect)(()=>()=>f(),[f]),(0,A.useEffect)(()=>{if(l&&c){let e=e=>h(e,c),t=e=>h(e,l);return l.addEventListener("pointerleave",e),c.addEventListener("pointerleave",t),()=>{l.removeEventListener("pointerleave",e),c.removeEventListener("pointerleave",t)}}},[l,c,h,f]),(0,A.useEffect)(()=>{if(a){let e=e=>{let t=e.target,n={x:e.clientX,y:e.clientY},r=(null==l?void 0:l.contains(t))||(null==c?void 0:c.contains(t)),i=!function(e,t){let{x:n,y:r}=e,i=!1;for(let e=0,o=t.length-1;er!=u>r&&n<(l-a)*(r-s)/(u-s)+a;c&&(i=!i)}return i}(n,a);r?f():i&&(f(),u())};return document.addEventListener("pointermove",e),()=>document.removeEventListener("pointermove",e)}},[l,c,a,u,f]),(0,A.createElement)(t9,(0,N.Z)({},e,{ref:o}))}),[t8,t7]=tU(tG,{isInside:!1}),t9=(0,A.forwardRef)((e,t)=>{let{__scopeTooltip:n,children:r,"aria-label":i,onEscapeKeyDown:o,onPointerDownOutside:a,...s}=e,l=tQ(t3,n),u=tq(n),{onClose:c}=l;return(0,A.useEffect)(()=>(document.addEventListener(t$,c),()=>document.removeEventListener(t$,c)),[c]),(0,A.useEffect)(()=>{if(l.trigger){let e=e=>{let t=e.target;null!=t&&t.contains(l.trigger)&&c()};return window.addEventListener("scroll",e,{capture:!0}),()=>window.removeEventListener("scroll",e,{capture:!0})}},[l.trigger,c]),(0,A.createElement)(eO.XB,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:o,onPointerDownOutside:a,onFocusOutside:e=>e.preventDefault(),onDismiss:c},(0,A.createElement)(tR,(0,N.Z)({"data-state":l.stateAttribute},u,s,{ref:t,style:{...s.style,"--radix-tooltip-content-transform-origin":"var(--radix-popper-transform-origin)"}}),(0,A.createElement)(L.A4,null,r),(0,A.createElement)(t8,{scope:n,isInside:!0},(0,A.createElement)(tH,{id:l.contentId,role:"tooltip"},i||r))))}),ne=e=>{let{__scopeTooltip:t,children:n,open:r,defaultOpen:i=!1,onOpenChange:o,disableHoverableContent:a,delayDuration:s}=e,l=tY(tG,e.__scopeTooltip),u=tq(t),[c,d]=(0,A.useState)(null),f=(0,H.M)(),h=(0,A.useRef)(0),p=null!=a?a:l.disableHoverableContent,m=null!=s?s:l.delayDuration,v=(0,A.useRef)(!1),[g=!1,y]=(0,z.T)({prop:r,defaultProp:i,onChange:e=>{e?(l.onOpen(),document.dispatchEvent(new CustomEvent(t$))):l.onClose(),null==o||o(e)}}),b=(0,A.useMemo)(()=>g?v.current?"delayed-open":"instant-open":"closed",[g]),x=(0,A.useCallback)(()=>{window.clearTimeout(h.current),v.current=!1,y(!0)},[y]),w=(0,A.useCallback)(()=>{window.clearTimeout(h.current),y(!1)},[y]),j=(0,A.useCallback)(()=>{window.clearTimeout(h.current),h.current=window.setTimeout(()=>{v.current=!0,y(!0)},m)},[m,y]);return(0,A.useEffect)(()=>()=>window.clearTimeout(h.current),[]),(0,A.createElement)(tI,u,(0,A.createElement)(tX,{scope:t,contentId:f,open:g,stateAttribute:b,trigger:c,onTriggerChange:d,onTriggerEnter:(0,A.useCallback)(()=>{l.isOpenDelayed?j():x()},[l.isOpenDelayed,j,x]),onTriggerLeave:(0,A.useCallback)(()=>{p?w():window.clearTimeout(h.current)},[w,p]),onOpen:x,onClose:w,disableHoverableContent:p},n))},nt=e=>{let{__scopeTooltip:t,forceMount:n,children:r,container:i}=e,o=tQ(t1,t);return(0,A.createElement)(t2,{scope:t,forceMount:n},(0,A.createElement)(B.z,{present:n||o.open},(0,A.createElement)(tB.h,{asChild:!0,container:i},r)))},nn=(0,eC.j)([],{variants:{display:{default:"inline-block",none:""},font:{mono:"font-mono",sans:"font-sans"},color:{verySubtle:"text-gray-700 dark:text-graydark-700",subtle:"text-gray-1000 dark:text-graydark-1000",contrast:"text-gray-1100 dark:text-white",lo:"text-white dark:text-graydark-50",accent:"text-accent-1100 dark:text-accentdark-1100",red:"text-red-700 dark:text-red-400",green:"text-emerald-700 dark:text-emerald-500",amber:"text-amber-600 dark:text-amber-500",none:""},weight:{extrabold:"font-extrabold",bold:"font-bold",medium:"font-medium",semibold:"font-semibold",regular:"font-normal",normal:"font-normal",light:"font-light",none:""},size:{10:"text-xxs",12:"text-xs",14:"text-sm",16:"text-base",18:"text-lg",20:"text-xl",24:"text-2xl",30:"text-3xl",36:"text-4xl",40:"text-5xl",48:"text-5xl",60:"text-6xl",64:"text-6xl"},scaleSize:{12:"text-xxs md:text-xs",14:"text-xs md:text-sm",16:"text-sm md:text-base",18:"text-base md:text-lg",20:"text-base md:text-xl",24:"text-xl md:text-2xl",30:"text-2xl md:text-3xl",36:"text-3xl md:text-4xl",40:"text-4xl md:text-5xl",48:"text-4xl md:text-5xl",60:"text-5xl md:text-6xl",64:"text-5xl md:text-6xl"},noWrap:{true:"whitespace-nowrap"},underline:{accent:"underline underline-offset-2 decoration-2 decoration-accent-900 dark:decoration-accentdark-900",show:"underline underline-offset-2 decoration-gray-1100 dark:decoration-gray-500",hover:"hover:underline underline-offset-2 decoration-gray-1100 dark:decoration-gray-500",none:""},ellipsis:{true:"overflow-hidden text-ellipsis whitespace-nowrap"},wrapEllipsis:{true:"overflow-hidden text-ellipsis"}},defaultVariants:{display:"default",weight:"regular",font:"sans",color:"contrast",underline:"none"}}),nr=A.forwardRef((e,t)=>{let{tag:n="span",className:r,font:i,color:o,weight:a,size:s,scaleSize:l,noWrap:u,underline:c,ellipsis:d,wrapEllipsis:f,...h}=e;return(0,T.jsx)(n,{ref:t,className:(0,eC.cx)(r,nn({font:i,color:o,weight:a,size:s,scaleSize:l,underline:c,noWrap:u,ellipsis:d,wrapEllipsis:f})),...h})}),ni=A.forwardRef((e,t)=>{let{size:n="18",...r}=e;return(0,T.jsx)(nr,{tag:"p",...r,ref:t,weight:"regular",scaleSize:n,color:"subtle",className:(0,eC.cx)("leading-relaxed md:leading-relaxed",e.className)})}),no=(0,eC.j)(["bg-white dark:bg-graydark-200","transition-shadow ease-in-out duration-300","shadow-sm hover:shadow","rounded","border","border-gray-400 dark:border-graydark-400"]),na=A.forwardRef((e,t)=>{let{className:n,...r}=e;return(0,T.jsx)("div",{ref:t,className:no({className:n}),...r})});var ns=n(34406);let nl=(void 0===ns||ns.env,"production"),nu=1/60*1e3,nc="undefined"!=typeof performance?()=>performance.now():()=>Date.now(),nd="undefined"!=typeof window?e=>window.requestAnimationFrame(e):e=>setTimeout(()=>e(nc()),nu),nf=!0,nh=!1,np=!1,nm={delta:0,timestamp:0},nv=["read","update","preRender","render","postRender"],ng=nv.reduce((e,t)=>(e[t]=function(e){let t=[],n=[],r=0,i=!1,o=!1,a=new WeakSet,s={schedule:(e,o=!1,s=!1)=>{let l=s&&i,u=l?t:n;return o&&a.add(e),-1===u.indexOf(e)&&(u.push(e),l&&i&&(r=t.length)),e},cancel:e=>{let t=n.indexOf(e);-1!==t&&n.splice(t,1),a.delete(e)},process:l=>{if(i){o=!0;return}if(i=!0,[t,n]=[n,t],n.length=0,r=t.length)for(let n=0;nnh=!0),e),{}),ny=nv.reduce((e,t)=>{let n=ng[t];return e[t]=(e,t=!1,r=!1)=>(nh||nk(),n.schedule(e,t,r)),e},{}),nb=nv.reduce((e,t)=>(e[t]=ng[t].cancel,e),{}),nx=nv.reduce((e,t)=>(e[t]=()=>ng[t].process(nm),e),{}),nw=e=>ng[e].process(nm),nj=e=>{nh=!1,nm.delta=nf?nu:Math.max(Math.min(e-nm.timestamp,40),1),nm.timestamp=e,np=!0,nv.forEach(nw),np=!1,nh&&(nf=!1,nd(nj))},nk=()=>{nh=!0,nf=!0,np||nd(nj)},nE=()=>nm,nS="undefined"!=typeof document,n_=nS?A.useLayoutEffect:A.useEffect;function nC(){let e=(0,A.useRef)(!1);return n_(()=>(e.current=!0,()=>{e.current=!1}),[]),e}let nO=(0,A.createContext)(null);function nM(e){let t=(0,A.useRef)(null);return null===t.current&&(t.current=e()),t.current}class nT extends A.Component{getSnapshotBeforeUpdate(e){let t=this.props.childRef.current;if(t&&e.isPresent&&!this.props.isPresent){let e=this.props.sizeRef.current;e.height=t.offsetHeight||0,e.width=t.offsetWidth||0,e.top=t.offsetTop,e.left=t.offsetLeft}return null}componentDidUpdate(){}render(){return this.props.children}}function nA({children:e,isPresent:t}){let n=(0,A.useId)(),r=(0,A.useRef)(null),i=(0,A.useRef)({width:0,height:0,top:0,left:0});return(0,A.useInsertionEffect)(()=>{let{width:e,height:o,top:a,left:s}=i.current;if(t||!r.current||!e||!o)return;r.current.dataset.motionPopId=n;let l=document.createElement("style");return document.head.appendChild(l),l.sheet&&l.sheet.insertRule(`
[data-motion-pop-id="${n}"] {
position: absolute !important;
width: ${e}px !important;
diff --git a/renterd/assets/config.html b/renterd/assets/config.html
index d9147ef2f..f28cdce7c 100644
--- a/renterd/assets/config.html
+++ b/renterd/assets/config.html
@@ -1 +1 @@
-
\ No newline at end of file
+
\ No newline at end of file
diff --git a/renterd/assets/contracts.html b/renterd/assets/contracts.html
index 30c301cb3..335ad9e89 100644
--- a/renterd/assets/contracts.html
+++ b/renterd/assets/contracts.html
@@ -1 +1 @@
-
\ No newline at end of file
+
\ No newline at end of file
diff --git a/renterd/assets/files/[[...path]].html b/renterd/assets/files/[[...path]].html
index 02d0f5fec..9b5af9d53 100644
--- a/renterd/assets/files/[[...path]].html
+++ b/renterd/assets/files/[[...path]].html
@@ -1 +1 @@
-
\ No newline at end of file
+
\ No newline at end of file
diff --git a/renterd/assets/hosts.html b/renterd/assets/hosts.html
index 1771ff9bc..a05c039f2 100644
--- a/renterd/assets/hosts.html
+++ b/renterd/assets/hosts.html
@@ -1 +1 @@
-
\ No newline at end of file
+
\ No newline at end of file
diff --git a/renterd/assets/index.html b/renterd/assets/index.html
index b9bf27176..d9416ce54 100644
--- a/renterd/assets/index.html
+++ b/renterd/assets/index.html
@@ -1 +1 @@
-
\ No newline at end of file
+
\ No newline at end of file
diff --git a/renterd/assets/login.html b/renterd/assets/login.html
index d5145e49e..46785e34e 100644
--- a/renterd/assets/login.html
+++ b/renterd/assets/login.html
@@ -1 +1 @@
-
\ No newline at end of file
+
\ No newline at end of file
diff --git a/renterd/assets/node.html b/renterd/assets/node.html
index 3ac5bde93..40b95257f 100644
--- a/renterd/assets/node.html
+++ b/renterd/assets/node.html
@@ -1 +1 @@
-
\ No newline at end of file
+
\ No newline at end of file
diff --git a/renterd/assets/wallet.html b/renterd/assets/wallet.html
index 9b1a96352..06149b9d7 100644
--- a/renterd/assets/wallet.html
+++ b/renterd/assets/wallet.html
@@ -1 +1 @@
-
\ No newline at end of file
+
\ No newline at end of file