@ethersphere/bee-dashboard 0.10.0 → 0.11.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +19 -0
- package/build/asset-manifest.json +12 -12
- package/build/index.html +1 -1
- package/build/static/js/2.4ff98457.chunk.js +3 -0
- package/build/static/js/{2.8d4d28e5.chunk.js.LICENSE.txt → 2.4ff98457.chunk.js.LICENSE.txt} +0 -0
- package/build/static/js/{2.8d4d28e5.chunk.js.map → 2.4ff98457.chunk.js.map} +1 -1
- package/build/static/js/{3.1e3c5cd7.chunk.js → 3.11a1627e.chunk.js} +2 -2
- package/build/static/js/{3.1e3c5cd7.chunk.js.map → 3.11a1627e.chunk.js.map} +1 -1
- package/build/static/js/main.2ee7499d.chunk.js +2 -0
- package/build/static/js/main.2ee7499d.chunk.js.map +1 -0
- package/build/static/js/{runtime-main.bd9d6fc5.js → runtime-main.6c2da3b6.js} +2 -2
- package/build/static/js/{runtime-main.bd9d6fc5.js.map → runtime-main.6c2da3b6.js.map} +1 -1
- package/lib/App.js +105277 -0
- package/package.json +28 -6
- package/serve.js +0 -0
- package/build/static/js/2.8d4d28e5.chunk.js +0 -3
- package/build/static/js/main.f316c903.chunk.js +0 -2
- package/build/static/js/main.f316c903.chunk.js.map +0 -1
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
(this["webpackJsonp@ethersphere/bee-dashboard"]=this["webpackJsonp@ethersphere/bee-dashboard"]||[]).push([[0],{194:function(e){e.exports=JSON.parse('{"a":{"node":">=12.0.0","npm":">=6.0.0","bee":">=0.6.0"}}')},246:function(e,t,n){},251:function(e,t,n){},529:function(e,t,n){"use strict";n.r(t);var a=n(0),r=n.n(a),c=n(15),o=n.n(c),i=(n(246),n(630)),s=n(629),l=n(30),u=n(28),d=(n(251),n(85)),b=n(124),j=n(217),h=n(216),p=n(1),O=function(e){Object(j.a)(n,e);var t=Object(h.a)(n);function n(e){var a;return Object(d.a)(this,n),(a=t.call(this,e)).state={error:null},a}return Object(b.a)(n,[{key:"componentDidCatch",value:function(e,t){console.error({error:e,errorInfo:t})}},{key:"render",value:function(){return this.state.error?Object(p.jsxs)("h1",{children:["Something went wrong. Error: ",this.state.error.message]}):this.props.children}}],[{key:"getDerivedStateFromError",value:function(e){return{error:e}}}]),n}(a.Component),m=n(7),x=n(533),f=n(226),g=n(634),v=n(570),y=n(532),w=n(569),k=n(125),S=n.n(k),C=n(13),B=n.n(C),A=n(21),N=n(45),L=n(94),T=n.n(L),D=n(194),P=n(195),I=n.n(P),E=n(29),U=n.n(E);function R(e){return E.BigNumber.isBigNumber(e)&&e.isInteger()||"bigint"===typeof e}function F(e){if(E.BigNumber.isBigNumber(e))return e;if("string"===typeof e)return new E.BigNumber(e);if("bigint"===typeof e)return new E.BigNumber(e.toString());if("number"===typeof e)return new E.BigNumber(e);throw new TypeError("Not a BigNumber or BigNumber convertible value. Type: ".concat(typeof e," value: ").concat(e))}function W(e){return _.apply(this,arguments)}function _(){return(_=Object(A.a)(B.a.mark((function e(t){return B.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,new Promise((function(e){return setTimeout((function(){e()}),t)}));case 2:case"end":return e.stop()}}),e)})))).apply(this,arguments)}var z=[18,17,16,15,14,13,12,11,10,9,8,7,6,5,4,3,2,1,0],M=function(){function e(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:16;Object(d.a)(this,e),this.amount=void 0,this.decimals=void 0;var a=F(t);if(!R(a)||!z.includes(n))throw new TypeError("Not a valid token values");this.amount=a,this.decimals=n}return Object(b.a)(e,[{key:"toBigInt",get:function(){return BigInt(this.amount.toFixed(0))}},{key:"toString",get:function(){return this.amount.toFixed(0)}},{key:"toBigNumber",get:function(){return new E.BigNumber(this.amount)}},{key:"toDecimal",get:function(){return this.amount.dividedBy(new E.BigNumber(10).pow(this.decimals))}},{key:"toFixedDecimal",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:7;return this.toDecimal.toFixed(e)}}],[{key:"fromDecimal",value:function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:16,a=F(t),r=a.multipliedBy(new E.BigNumber(10).pow(n));return new e(r,n)}}]),e}(),H=n(59),q={apiUrl:sessionStorage.getItem("api_host")||"http://localhost:1633",apiDebugUrl:sessionStorage.getItem("debug_api_host")||"http://localhost:1635",beeApi:null,beeDebugApi:null,setApiUrl:function(){},setDebugApiUrl:function(){}},V=Object(a.createContext)(q);V.Consumer;function Y(e){var t=e.children,n=Object(a.useState)(q.apiUrl),r=Object(m.a)(n,2),c=r[0],o=r[1],i=Object(a.useState)(q.apiDebugUrl),s=Object(m.a)(i,2),l=s[0],u=s[1],d=Object(a.useState)(null),b=Object(m.a)(d,2),j=b[0],h=b[1],O=Object(a.useState)(null),x=Object(m.a)(O,2),f=x[0],g=x[1];return Object(a.useEffect)((function(){try{h(new H.Bee(c)),sessionStorage.setItem("api_host",c)}catch(e){h(null)}}),[c]),Object(a.useEffect)((function(){try{g(new H.BeeDebug(l)),sessionStorage.setItem("debug_api_host",l)}catch(e){g(null)}}),[l]),Object(p.jsx)(V.Provider,{value:{apiUrl:c,apiDebugUrl:l,beeApi:j,beeDebugApi:f,setApiUrl:o,setDebugApiUrl:u},children:t})}var Z=window.location.search.includes("devMode=1"),G={status:{all:!1,version:!1,blockchainConnection:!1,debugApiConnection:!1,apiConnection:!1,topology:!1,chequebook:!1},latestPublishedVersion:void 0,latestUserVersion:void 0,latestUserVersionExact:void 0,isLatestBeeVersion:!1,latestBeeVersionUrl:"https://github.com/ethersphere/bee/releases/latest",error:null,apiHealth:!1,debugApiHealth:null,nodeAddresses:null,topology:null,chequebookAddress:null,peers:null,chequebookBalance:null,peerBalances:null,peerCheques:null,settlements:null,latestBeeRelease:null,isLoading:!0,isRefreshing:!1,lastUpdate:null,start:function(){},stop:function(){},refresh:function(){return Promise.reject()}},K=Object(a.createContext)(G);K.Consumer;function J(e,t,n,a,r,c,o){var i=Z||Boolean(Object({NODE_ENV:"production",PUBLIC_URL:".",WDS_SOCKET_HOST:void 0,WDS_SOCKET_PATH:void 0,WDS_SOCKET_PORT:void 0,FAST_REFRESH:!0,REACT_APP_BEE_HOST:"http://localhost:1633",REACT_APP_BEE_DEBUG_HOST:"http://localhost:1635",REACT_APP_BEE_DOCS_HOST:"https://docs.ethswarm.org/docs/",REACT_APP_BEE_DISCORD_HOST:"https://discord.gg/eKr9XPv7",REACT_APP_BLOCKCHAIN_EXPLORER_URL:"https://blockscout.com/xdai/mainnet",REACT_APP_BEE_GITHUB_REPO_URL:"https://api.github.com/repos/ethersphere/bee"}).REACT_APP_DEV_MODE),s={version:Boolean(e&&T.a.satisfies(e.version,D.a.bee,{includePrerelease:!0})),blockchainConnection:Boolean(null===t||void 0===t?void 0:t.ethereum),debugApiConnection:Boolean("ok"===(null===e||void 0===e?void 0:e.status)),apiConnection:n,topology:Boolean((null===a||void 0===a?void 0:a.connected)&&(null===a||void 0===a?void 0:a.connected)>0)||i,chequebook:Boolean(null===r||void 0===r?void 0:r.chequebookAddress)&&null!==c&&(null===c||void 0===c?void 0:c.totalBalance.toBigNumber.isGreaterThan(0))||i};return Object(N.a)(Object(N.a)({},s),{},{all:!o&&Object.values(s).every((function(e){return e}))})}function X(e){var t,n,r=e.children,c=Object(a.useContext)(V),o=c.beeApi,i=c.beeDebugApi,s=Object(a.useState)(!1),l=Object(m.a)(s,2),u=l[0],d=l[1],b=Object(a.useState)(null),j=Object(m.a)(b,2),h=j[0],O=j[1],x=Object(a.useState)(null),f=Object(m.a)(x,2),g=f[0],v=f[1],y=Object(a.useState)(null),w=Object(m.a)(y,2),k=w[0],S=w[1],C=Object(a.useState)(null),N=Object(m.a)(C,2),L=N[0],D=N[1],P=Object(a.useState)(null),E=Object(m.a)(P,2),U=E[0],R=E[1],F=Object(a.useState)(null),W=Object(m.a)(F,2),_=W[0],z=W[1],H=Object(a.useState)(null),q=Object(m.a)(H,2),Y=q[0],Z=q[1],X=Object(a.useState)(null),$=Object(m.a)(X,2),Q=$[0],ee=$[1],te=Object(a.useState)(null),ne=Object(m.a)(te,2),ae=ne[0],re=ne[1],ce=function(){var e=Object(a.useState)(null),t=Object(m.a)(e,2),n=t[0],r=t[1],c=Object(a.useState)(!1),o=Object(m.a)(c,2),i=o[0],s=o[1],l=Object(a.useState)(null),u=Object(m.a)(l,2),d=u[0],b=u[1];return Object(a.useEffect)((function(){I.a.get("".concat("https://api.github.com/repos/ethersphere/bee","/releases/latest")).then((function(e){r(e.data)})).catch((function(e){b(e)})).finally((function(){s(!1)}))}),[]),{latestBeeRelease:n,isLoadingLatestBeeRelease:i,error:d}}(),oe=ce.latestBeeRelease,ie=Object(a.useState)(G.error),se=Object(m.a)(ie,2),le=se[0],ue=se[1],de=Object(a.useState)(G.isLoading),be=Object(m.a)(de,2),je=be[0],he=be[1],pe=Object(a.useState)(G.isRefreshing),Oe=Object(m.a)(pe,2),me=Oe[0],xe=Oe[1],fe=Object(a.useState)(G.lastUpdate),ge=Object(m.a)(fe,2),ve=ge[0],ye=ge[1],we=Object(a.useState)(3e4),ke=Object(m.a)(we,2),Se=ke[0],Ce=ke[1],Be=null===(t=T.a.coerce(null===oe||void 0===oe?void 0:oe.name))||void 0===t?void 0:t.version,Ae=null===(n=T.a.coerce(null===h||void 0===h?void 0:h.version))||void 0===n?void 0:n.version,Ne=null===h||void 0===h?void 0:h.version;Object(a.useEffect)((function(){he(!0),d(!1),Le()}),[o]),Object(a.useEffect)((function(){he(!0),O(null),v(null),S(null),R(null),D(null),z(null),Z(null),ee(null),re(null),Le()}),[i]);var Le=function(){var e=Object(A.a)(B.a.mark((function e(){var t,n,a,r;return B.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!me){e.next=2;break}return e.abrupt("return");case 2:if(o&&i){e.next=5;break}return he(!1),e.abrupt("return");case 5:return e.prev=5,xe(!0),ue(null),t=function(){var e=Object(A.a)(B.a.mark((function e(){var t,n,a;return B.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,i.getChequebookBalance();case 2:return t=e.sent,n=t.totalBalance,a=t.availableBalance,e.abrupt("return",{totalBalance:new M(n),availableBalance:new M(a)});case 6:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),n=function(){var e=Object(A.a)(B.a.mark((function e(){var t,n;return B.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,i.getAllBalances();case 2:return t=e.sent,n=t.balances,e.abrupt("return",n.map((function(e){var t=e.peer,n=e.balance;return{peer:t,balance:new M(n)}})));case 5:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),a=function(){var e=Object(A.a)(B.a.mark((function e(){var t,n,a,r;return B.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,i.getAllSettlements();case 2:return t=e.sent,n=t.totalReceived,a=t.settlements,r=t.totalSent,e.abrupt("return",{totalReceived:new M(n),totalSent:new M(r),settlements:a.map((function(e){var t=e.peer,n=e.received,a=e.sent;return{peer:t,received:new M(n),sent:new M(a)}}))});case 7:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),r=[o.isConnected().then(d).catch((function(){return d(!1)})),i.getHealth().then(O).catch((function(){return O(null)})),i.getNodeAddresses().then(v).catch((function(){return v(null)})),i.getTopology().then(S).catch((function(){return S(null)})),i.getPeers().then(R).catch((function(){return R(null)})),i.getChequebookAddress().then(D).catch((function(){return D(null)})),i.getLastCheques().then(ee).catch((function(){return ee(null)})),t().then(z).catch((function(){return z(null)})),n().then(Z).catch((function(){return Z(null)})),a().then(re).catch((function(){return re(null)}))],e.next=14,Promise.allSettled(r);case 14:e.next=19;break;case 16:e.prev=16,e.t0=e.catch(5),ue(e.t0);case 19:return e.prev=19,he(!1),xe(!1),ye(Date.now()),e.finish(19);case 24:case"end":return e.stop()}}),e,null,[[5,16,19,24]])})));return function(){return e.apply(this,arguments)}}();return Object(a.useEffect)((function(){if(Le(),Se){var e=setInterval(Le,Se);return function(){return clearInterval(e)}}}),[Se,i,o]),Object(p.jsx)(K.Provider,{value:{status:J(h,g,u,k,L,_,le),latestUserVersion:Ae,latestUserVersionExact:Ne,latestPublishedVersion:Be,isLatestBeeVersion:Boolean(Be&&Ae&&T.a.satisfies(Be,Ae,{includePrerelease:!0})),latestBeeVersionUrl:(null===oe||void 0===oe?void 0:oe.html_url)||"https://github.com/ethersphere/bee/releases/latest",error:le,apiHealth:u,debugApiHealth:h,nodeAddresses:g,topology:k,chequebookAddress:L,peers:U,chequebookBalance:_,peerBalances:Y,peerCheques:Q,settlements:ae,latestBeeRelease:oe,isLoading:je,isRefreshing:me,lastUpdate:ve,start:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:3e4;return Ce(e)},stop:function(){return Ce(null)},refresh:Le},children:r})}var $=Object(x.a)((function(e){return Object(f.a)({root:{width:"100%",marginBottom:e.spacing(2)}})}));function Q(){var e=$(),t=Object(a.useContext)(K),n=t.isLoading,r=t.latestUserVersionExact,c=Object(a.useState)(!0),o=Object(m.a)(c,2),i=o[0],s=o[1],l=H.SUPPORTED_BEE_VERSION_EXACT===r;return n||!r?null:Object(p.jsx)(y.a,{in:!l&&i,children:Object(p.jsx)("div",{className:e.root,children:Object(p.jsxs)(g.a,{severity:"warning",action:Object(p.jsx)(w.a,{"aria-label":"close",color:"inherit",size:"small",onClick:function(){s(!1)},children:Object(p.jsx)(S.a,{fontSize:"inherit"})}),children:[Object(p.jsx)(v.a,{children:"Warning"}),"Your Bee node version (",Object(p.jsx)("code",{children:r}),") does not exactly match the Bee version we tested the Bee Dashboard against (",Object(p.jsx)("code",{children:H.SUPPORTED_BEE_VERSION_EXACT}),"). Please note that some functionality may not work properly."]})})})}var ee=n(588),te=n(589),ne=n(626),ae=n(574),re=n(611),ce=n(627),oe=n(591),ie=n(600),se=n(622),le=n(623),ue=n(615),de=n(624),be=n(625),je=n(628),he=n.p+"static/media/logo.3d1155fe.svg",pe=n(17),Oe=n(534),me=n(571),xe=n(71),fe=n(572),ge=n(573),ve=Object(x.a)((function(e){return Object(f.a)({root:{width:"100%",padding:0,margin:0,marginTop:e.spacing(4),"&:first-child":{marginTop:0}},rootLevel1:{marginTop:e.spacing(1)},rootLevel2:{marginTop:e.spacing(.5)},header:{backgroundColor:e.palette.background.paper},contentLevel0:{marginTop:e.spacing(1)},contentLevel12:{marginTop:e.spacing(.25)},infoText:{color:"#c9c9c9"}})}));function ye(e){var t=e.children,n=e.label,r=e.level,c=e.defaultOpen,o=e.info,i=ve(),s=Object(a.useState)(Boolean(c)),l=Object(m.a)(s,2),u=l[0],d=l[1],b="",j="h1",h=i.contentLevel0;return 1===r?(b=i.rootLevel1,j="h2",h=i.contentLevel12):2===r&&(b=i.rootLevel2,j="h3",h=i.contentLevel12),Object(p.jsxs)("div",{className:"".concat(i.root," ").concat(b),children:[Object(p.jsxs)(Oe.a,{button:!0,onClick:function(){d(!u)},className:i.header,children:[Object(p.jsx)(me.a,{primary:Object(p.jsx)(xe.a,{variant:j,children:n})}),Object(p.jsxs)("div",{style:{display:"flex"},children:[!u&&Object(p.jsx)(xe.a,{variant:"body2",className:i.infoText,children:o}),u?Object(p.jsx)(fe.a,{}):Object(p.jsx)(ge.a,{})]})]}),Object(p.jsx)(y.a,{in:u,timeout:"auto",unmountOnExit:!0,children:Object(p.jsx)("div",{className:h,children:t})})]})}var we=n(636),ke=n(577),Se=Object(x.a)((function(e){return Object(f.a)({header:{backgroundColor:e.palette.background.paper,marginBottom:e.spacing(.25),wordBreak:"break-word"},copyValue:{cursor:"pointer",padding:e.spacing(1),borderRadius:0,"&:hover":{backgroundColor:"#fcf2e8",color:e.palette.primary.main}}})}));function Ce(e){var t=e.label,n=e.value,a=e.tooltip,r=Se();return Object(p.jsx)(Oe.a,{className:r.header,children:Object(p.jsxs)(ae.a,{container:!0,direction:"row",justifyContent:"space-between",alignItems:"center",children:[t&&Object(p.jsx)(xe.a,{variant:"body1",children:t}),n&&Object(p.jsxs)(xe.a,{variant:"body2",children:[n,a&&Object(p.jsx)(we.a,{title:a,placement:"top",arrow:!0,children:Object(p.jsx)(w.a,{size:"small",className:r.copyValue,children:Object(p.jsx)(ke.a,{strokeWidth:1})})})]})]})})}var Be=Object(x.a)((function(e){return Object(f.a)({action:{marginTop:e.spacing(.75),marginBottom:e.spacing(1),marginRight:e.spacing(1)}})}));function Ae(e){var t=e.children,n=Be();return Array.isArray(t)?Object(p.jsx)(ae.a,{container:!0,direction:"row",children:t.filter((function(e){return e})).map((function(e,t){return Object(p.jsx)(ae.a,{className:n.action,children:e},t)}))}):Object(p.jsx)(ae.a,{container:!0,direction:"row",children:Object(p.jsx)(ae.a,{className:n.action,children:t})})}var Ne=n(77),Le=n.n(Ne),Te=n(578),De=n(579),Pe=Object(x.a)((function(e){return Object(f.a)({header:{backgroundColor:e.palette.background.paper,marginBottom:e.spacing(.25),borderLeft:"".concat(e.spacing(.25),"px solid rgba(0,0,0,0)"),wordBreak:"break-word"},headerOpen:{borderLeft:"".concat(e.spacing(.25),"px solid ").concat(e.palette.primary.main)},copyValue:{cursor:"pointer",padding:e.spacing(1),borderRadius:0,"&:hover":{backgroundColor:"#fcf2e8",color:e.palette.primary.main}},content:{marginTop:e.spacing(2),marginBottom:e.spacing(2)},keyMargin:{marginRight:e.spacing(1)}})}));function Ie(e){var t,n=e.label,r=e.value,c=Pe(),o=Object(a.useState)(!1),i=Object(m.a)(o,2),s=i[0],l=i[1],u=Object(a.useState)(!1),d=Object(m.a)(u,2),b=d[0],j=d[1],h=function(){return l(!s)},O=function(){return j(!0)},x=function(){return j(!1)},f=function(e){var t=function(e){return e.replace(/^0x/i,"").length}(e);return t%6===0?e.match(/(0x|.{6})/gi)||[]:e.match(/(0x|.{1,8})/gi)||[]}(r),g="string"===typeof(t=r)&&/^0x[0-9a-f]+$/i.test(t),v="".concat(g?"".concat(f[0]," ").concat(f[1]):f[0],"[\u2026]").concat(f[f.length-1]);return Object(p.jsx)(Oe.a,{className:"".concat(c.header," ").concat(s?c.headerOpen:""),children:Object(p.jsxs)(ae.a,{container:!0,direction:"column",justifyContent:"space-between",alignItems:"stretch",children:[Object(p.jsxs)(ae.a,{container:!0,direction:"row",justifyContent:"space-between",alignItems:"center",children:[n&&Object(p.jsx)(xe.a,{variant:"body1",children:n}),Object(p.jsx)(xe.a,{variant:"body2",children:Object(p.jsxs)("div",{children:[!s&&Object(p.jsx)("span",{className:c.copyValue,children:Object(p.jsx)(we.a,{title:b?"Copied":"Copy",placement:"top",arrow:!0,onClose:x,children:Object(p.jsx)(Ne.CopyToClipboard,{text:r,children:Object(p.jsx)("span",{onClick:O,children:r?v:""})})})}),Object(p.jsx)(w.a,{size:"small",className:c.copyValue,children:s?Object(p.jsx)(Te.a,{onClick:h,strokeWidth:1}):Object(p.jsx)(De.a,{onClick:h,strokeWidth:1})})]})})]}),Object(p.jsx)(y.a,{in:s,timeout:"auto",unmountOnExit:!0,children:Object(p.jsx)("div",{className:c.content,children:Object(p.jsx)(we.a,{title:b?"Copied":"Copy",placement:"top",arrow:!0,onClose:x,children:Object(p.jsx)(Ne.CopyToClipboard,{text:r,children:Object(p.jsx)("span",{onClick:O,children:Object(p.jsx)("span",{className:c.copyValue,children:f.map((function(e,t){return Object(p.jsx)(xe.a,{variant:"body2",className:c.keyMargin,component:"span",children:e},t)}))})})})})})})]})})}var Ee=n(584),Ue=n(581),Re=n(590),Fe=n(586),We=n(587),_e=n(582),ze=n(585),Me=n(197),He=n.n(Me),qe=n(580);function Ve(e){var t=Object(a.useState)(!1),n=Object(m.a)(t,2),r=n[0],c=n[1];return Object(p.jsxs)("div",{children:[Object(p.jsx)(w.a,{color:"primary",size:"small",onClick:function(){c(!0)},children:Object(p.jsx)(qe.a,{})}),Object(p.jsx)(Ue.a,{onClose:function(){c(!1)},"aria-labelledby":"simple-dialog-title",open:r,children:Object(p.jsxs)("div",{style:{padding:"30px",textAlign:"center"},children:[Object(p.jsx)(_e.a,{id:"simple-dialog-title",children:e.label}),Object(p.jsx)(He.a,{value:e.value,size:150,bgColor:"#ffffff",fgColor:"#000000",level:"L",includeMargin:!1,renderAs:"svg"})]})})]})}var Ye=n(583);function Ze(e){var t=e.value,n=Object(l.b)().enqueueSnackbar;return Object(p.jsx)("div",{style:{marginRight:"3px",marginLeft:"3px"},children:Object(p.jsx)(w.a,{color:"primary",size:"small",onClick:function(){return n("Copied: ".concat(t),{variant:"success"})},children:Object(p.jsx)(Ne.CopyToClipboard,{text:t,children:Object(p.jsx)(Ye.a,{style:{height:"20px"}})})})})}var Ge=n(198),Ke=n.n(Ge);function Je(e){return Object(p.jsx)(xe.a,{component:"div",variant:"subtitle1",children:e.address?Object(p.jsxs)("div",{style:{display:"flex"},children:[e.hideBlockie?null:Object(p.jsx)("div",{style:{paddingTop:"5px",marginRight:"10px"},children:Object(p.jsx)(Ke.a,{size:20,string:e.address})}),Object(p.jsx)("div",{children:Object(p.jsx)("a",{style:e.truncate?{marginRight:"7px",maxWidth:"200px",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",display:"block"}:{marginRight:"7px"},href:"".concat("https://blockscout.com/xdai/mainnet","/").concat(e.transaction?"tx":"address","/").concat(e.address),target:"_blank",rel:"noreferrer",children:e.address})}),Object(p.jsx)(Ve,{value:e.address,label:"Ethereum Address"}),Object(p.jsx)(Ze,{value:e.address})]}):"-"})}function Xe(e){var t=e.peerId,n=e.uncashedAmount,r=Object(a.useState)(!1),c=Object(m.a)(r,2),o=c[0],i=c[1],s=Object(a.useState)(!1),u=Object(m.a)(s,2),d=u[0],b=u[1],j=Object(l.b)().enqueueSnackbar,h=Object(a.useContext)(V).beeDebugApi,O=function(){i(!1)};return Object(p.jsxs)("div",{children:[Object(p.jsxs)(Ee.a,{variant:"contained",onClick:function(){i(!0)},startIcon:Object(p.jsx)(ze.a,{size:"1rem"}),children:["Cash out peer ",t.substr(0,8),"[\u2026]"]}),Object(p.jsxs)(Ue.a,{open:o,onClose:O,"aria-labelledby":"form-dialog-title",children:[Object(p.jsx)(_e.a,{id:"form-dialog-title",children:"Cashout Cheque"}),Object(p.jsx)(Fe.a,{children:Object(p.jsxs)(We.a,{style:{marginTop:"20px",overflowWrap:"break-word"},children:[d&&Object(p.jsxs)(p.Fragment,{children:[Object(p.jsxs)("span",{children:["Cashing out ",Object(p.jsx)("strong",{children:n})," from Peer ",Object(p.jsx)("strong",{children:t}),". Please wait..."]}),Object(p.jsx)(ee.a,{style:{textAlign:"center",padding:"50px"},children:Object(p.jsx)(te.a,{})})]}),!d&&Object(p.jsxs)("span",{children:["Are you sure you want to cashout ",Object(p.jsxs)("strong",{children:[n," BZZ"]})," from Peer"," ",Object(p.jsx)("strong",{children:t}),"?"]})]})}),Object(p.jsxs)(Re.a,{children:[Object(p.jsx)(Ee.a,{onClick:O,color:"primary",children:"Cancel"}),Object(p.jsx)(Ee.a,{onClick:function(){h&&(t?(b(!0),h.cashoutLastCheque(t).then((function(e){i(!1),j(Object(p.jsxs)("span",{children:["Successfully cashed out cheque. Transaction",Object(p.jsx)(Je,{hideBlockie:!0,transaction:!0,address:e})]}),{variant:"success"})})).catch((function(e){j(Object(p.jsxs)("span",{children:["Error: ",e.message]}),{variant:"error"})})).finally((function(){b(!1)}))):j(Object(p.jsx)("span",{children:"Peer Id invalid"}),{variant:"error"}))},color:"primary",disabled:d,children:"Yes Cashout"})]})]})]})}function $e(e){var t=e.accounting,n=e.isLoadingUncashed,a=e.totalUncashed;return Object(p.jsxs)(ye,{label:"Peers (".concat((null===t||void 0===t?void 0:t.length)||0,")"),info:"".concat(a.toFixedDecimal()," BZZ (uncashed)"),children:[Object(p.jsx)(Ce,{label:"Uncashed Amount Total",value:"".concat(a.toFixedDecimal()," BZZ")}),null===t||void 0===t?void 0:t.map((function(e){var t=e.peer,a=e.balance,r=e.received,c=e.sent,o=e.uncashedAmount,i=e.total;return Object(p.jsxs)(ye,{label:"Peer ".concat(t.substr(0,8),"[\u2026]"),level:1,info:"".concat(o.toFixedDecimal()," BZZ (uncashed)"),children:[Object(p.jsx)(Ie,{label:"Peer ID",value:t}),Object(p.jsx)(Ce,{label:"Outstanding Balance",value:"".concat(a.toFixedDecimal()," BZZ")}),Object(p.jsx)(Ce,{label:"Settlements Sent / Received",value:"-".concat(c.toFixedDecimal()," / ").concat(r.toFixedDecimal()," BZZ")}),Object(p.jsx)(Ce,{label:"Total",value:"".concat(i.toFixedDecimal()," BZZ")}),Object(p.jsx)(Ce,{label:"Uncashed Amount",value:n?"loading\u2026":"".concat(o.toFixedDecimal()," BZZ")}),o.toBigNumber.isGreaterThan("0")&&Object(p.jsx)(Ae,{children:Object(p.jsx)(Xe,{uncashedAmount:o.toFixedDecimal(),peerId:t})})]},t)}))]})}var Qe=n(592),et=Object(x.a)((function(e){return Object(f.a)({root:{height:"100%"},content:{maxWidth:500,marginBottom:e.spacing(4),"&:last-child":{marginBottom:0}},icon:{height:"1rem"}})}));function tt(){var e=et();return Object(p.jsxs)(ae.a,{container:!0,direction:"column",justifyContent:"center",alignItems:"center",className:e.root,children:[Object(p.jsx)(ae.a,{item:!0,className:e.content,children:Object(p.jsx)(xe.a,{variant:"h1",align:"center",children:"Uh oh, it looks like your node is not connected."})}),Object(p.jsx)(ae.a,{item:!0,className:e.content,children:Object(p.jsxs)(xe.a,{align:"center",children:["Please check your node status to fix the problem. You can also check out the"," ",Object(p.jsx)(oe.a,{href:"https://docs.ethswarm.org/docs/",target:"_blank",rel:"noreferrer",children:"Swarm Bee Docs"})," ","or ask for support on the"," ",Object(p.jsx)(oe.a,{href:"https://discord.gg/eKr9XPv7",target:"_blank",rel:"noreferrer",children:"Ethereum Swarm Discord"}),"."]})}),Object(p.jsx)(ae.a,{item:!0,className:e.content,children:Object(p.jsx)(xe.a,{align:"center",children:Object(p.jsx)(Ee.a,{component:u.b,variant:"contained",startIcon:Object(p.jsx)(Qe.a,{className:e.icon}),to:va.STATUS,children:"Check node status"})})})]})}var nt=function(e,t,n){var r=Object(a.useState)(!1),c=Object(m.a)(r,2),o=c[0],i=c[1],s=Object(a.useState)(void 0),l=Object(m.a)(s,2),u=l[0],d=l[1];Object(a.useEffect)((function(){if(!o&&e&&t&&!u){i(!0);var n=t.settlements.filter((function(e){return e.received.toBigNumber.gt("0")})).map((function(t){var n=t.peer;return function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:3,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1e3;return new Promise(function(){var a=Object(A.a)(B.a.mark((function a(r,c){var o,i;return B.a.wrap((function(a){for(;;)switch(a.prev=a.next){case 0:o=0;case 1:if(!(o<t)){a.next=21;break}return a.prev=2,a.next=5,e();case 5:return i=a.sent,r(i),a.abrupt("return");case 10:if(a.prev=10,a.t0=a.catch(2),!(o<t-1)){a.next=17;break}return a.next=15,W(n);case 15:a.next=18;break;case 17:c(a.t0);case 18:o++,a.next=1;break;case 21:case"end":return a.stop()}}),a,null,[[2,10]])})));return function(e,t){return a.apply(this,arguments)}}())}((function(){return e.getLastCashoutAction(n)}))}));Promise.allSettled(n).then((function(e){var t=function(e){var t,n={fulfilled:(t=e).filter((function(e){return"fulfilled"===e.status})),rejected:t.filter((function(e){return"rejected"===e.status}))};return{fulfilled:n.fulfilled.map((function(e){return e.value})),rejected:n.rejected.map((function(e){return e.reason?String(e.reason):"Unknown error"}))}}(e);d(t.fulfilled),i(!1)}))}}),[t,o,u,e]);var b=function(e,t,n){if(!e||!t)return null;var a={};return e.forEach((function(e){var t=e.peer,n=e.balance;return a[t]={peer:t,balance:n,sent:new M("0"),received:new M("0"),uncashedAmount:new M("0"),total:n}})),t.forEach((function(e){var t=e.peer,n=e.sent,r=e.received;return a[t]=Object(N.a)(Object(N.a)({},a[t]),{},{sent:n,received:r,total:new M(a[t].balance.toBigNumber.plus(r.toBigNumber).minus(n.toBigNumber))})})),n?(null===n||void 0===n||n.forEach((function(e){var t=e.peer,n=e.uncashedAmount;a[t].uncashedAmount=new M(n)})),Object.values(a).sort((function(e,t){var n=t.uncashedAmount.toBigNumber.minus(e.uncashedAmount.toBigNumber).toNumber();return 0!==n?n:e.peer<t.peer?-1:1}))):Object.values(a).sort((function(e,t){return e.peer<t.peer?-1:1}))}(n,null===t||void 0===t?void 0:t.settlements,u),j=new M("0");return null===b||void 0===b||b.forEach((function(e){var t=e.uncashedAmount;return j=new M(j.toBigNumber.plus(t.toBigNumber))})),{isLoadingUncashed:o,totalUncashed:j,accounting:b}},at=n(595),rt=n(593),ct=n(594);function ot(e){var t=e.successMessage,n=e.errorMessage,r=e.dialogMessage,c=e.min,o=e.max,i=e.label,s=e.action,u=e.icon,d=Object(a.useState)(!1),b=Object(m.a)(d,2),j=b[0],h=b[1],O=Object(a.useState)(""),x=Object(m.a)(O,2),f=x[0],g=x[1],v=Object(a.useState)(null),y=Object(m.a)(v,2),w=y[0],k=y[1],S=Object(a.useState)(null),C=Object(m.a)(S,2),N=C[0],L=C[1],T=Object(l.b)().enqueueSnackbar,D=function(){h(!1)},P=function(){var e=Object(A.a)(B.a.mark((function e(){var a;return B.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(null!==w){e.next=2;break}return e.abrupt("return");case 2:return e.prev=2,e.next=5,s(w.toBigInt);case 5:a=e.sent,h(!1),T("".concat(t," Transaction ").concat(a),{variant:"success"}),e.next=13;break;case 10:e.prev=10,e.t0=e.catch(2),T("".concat(n," Error: ").concat(e.t0.message),{variant:"error"});case 13:case"end":return e.stop()}}),e,null,[[2,10]])})));return function(){return e.apply(this,arguments)}}();return Object(p.jsxs)("div",{children:[Object(p.jsx)(Ee.a,{variant:"contained",onClick:function(e){h(!0),e.stopPropagation()},startIcon:u,children:i}),Object(p.jsxs)(Ue.a,{open:j,onClose:D,"aria-labelledby":"form-dialog-title",children:[Object(p.jsx)(_e.a,{id:"form-dialog-title",children:i}),Object(p.jsxs)(Fe.a,{children:[Object(p.jsx)(We.a,{children:r}),Object(p.jsx)(rt.a,{autoFocus:!0,margin:"dense",id:"name",type:"text",placeholder:"Amount",fullWidth:!0,value:f,onChange:function(e){var t=e.target.value;g(t),L(null);try{var n=M.fromDecimal(t);k(n),c&&n.toDecimal.isLessThan(c)&&L(new Error("Needs to be more than ".concat(c))),o&&n.toDecimal.isGreaterThan(o)&&L(new Error("Needs to be less than ".concat(o)))}catch(e){L(e)}}}),N&&Object(p.jsxs)(ct.a,{error:!0,children:["Please provide valid BZZ amount (max 16 decimals). Error: ",N.message]})]}),Object(p.jsxs)(Re.a,{children:[Object(p.jsx)(Ee.a,{onClick:D,color:"primary",children:"Cancel"}),Object(p.jsx)(Ee.a,{onClick:P,color:"primary",children:i})]})]})]})}function it(){var e=Object(a.useContext)(V).beeDebugApi;return Object(p.jsx)(ot,{successMessage:"Successful withdrawal.",errorMessage:"Error with withdrawing.",dialogMessage:"Specify the amount of BZZ you would like to withdraw from your node.",label:"Withdraw",icon:Object(p.jsx)(at.a,{size:"1rem"}),min:new E.BigNumber(0),action:function(t){if(!e)throw new Error("Bee Debug URL is not valid");return e.withdrawTokens(t.toString())}})}var st=n(596);function lt(){var e=Object(a.useContext)(V).beeDebugApi;return Object(p.jsx)(ot,{successMessage:"Successful deposit.",errorMessage:"Error with depositing",dialogMessage:"Specify the amount of BZZ you would like to deposit to your node.",label:"Deposit",icon:Object(p.jsx)(st.a,{size:"1rem"}),min:new E.BigNumber(0),action:function(t){if(!e)throw new Error("Bee Debug URL is not valid");return e.depositTokens(t.toString())}})}function ut(){var e=Object(a.useContext)(K),t=e.status,n=e.nodeAddresses,r=e.chequebookAddress,c=e.chequebookBalance,o=e.settlements,i=e.peerBalances,s=Object(a.useContext)(V).beeDebugApi,l=nt(s,o,i),u=l.accounting,d=l.totalUncashed,b=l.isLoadingUncashed;return t.all?Object(p.jsxs)("div",{children:[Object(p.jsxs)(ye,{label:"Chequebook",defaultOpen:!0,children:[Object(p.jsx)(Ce,{label:"Total Balance",value:"".concat(null===c||void 0===c?void 0:c.totalBalance.toFixedDecimal()," BZZ")}),Object(p.jsx)(Ce,{label:"Available Uncommitted Balance",value:"".concat(null===c||void 0===c?void 0:c.availableBalance.toFixedDecimal()," BZZ")}),Object(p.jsx)(Ce,{label:"Total Cheques Amount Sent",value:"".concat(null===o||void 0===o?void 0:o.totalSent.toFixedDecimal()," BZZ")}),Object(p.jsx)(Ce,{label:"Total Cheques Amount Received",value:"".concat(null===o||void 0===o?void 0:o.totalReceived.toFixedDecimal()," BZZ")}),Object(p.jsxs)(Ae,{children:[Object(p.jsx)(it,{}),Object(p.jsx)(lt,{})]})]}),Object(p.jsxs)(ye,{label:"Blockchain",defaultOpen:!0,children:[Object(p.jsx)(Ie,{label:"Ethereum address",value:(null===n||void 0===n?void 0:n.ethereum)||""}),Object(p.jsx)(Ie,{label:"Chequebook contract address",value:(null===r||void 0===r?void 0:r.chequebookAddress)||""})]}),Object(p.jsx)($e,{accounting:u,isLoadingUncashed:b,totalUncashed:d})]}):Object(p.jsx)(tt,{})}var dt=n(127),bt=n(227),jt=n(597),ht=n(598),pt=n(599),Ot=Object(x.a)((function(e){return Object(f.a)({header:{backgroundColor:"#F7F7F7",marginBottom:e.spacing(.25)},typography:{color:"#242424"}})}));function mt(e){var t=e.children,n=Ot();return Object(p.jsx)(Oe.a,{className:n.header,children:Object(p.jsx)(xe.a,{variant:"body1",className:n.typography,children:t})})}var xt,ft=Object(x.a)((function(e){return Object(f.a)({header:{backgroundColor:e.palette.background.paper,marginBottom:e.spacing(.25),borderLeft:"".concat(e.spacing(.25),"px solid rgba(0,0,0,0)"),wordBreak:"break-word"},headerOpen:{borderLeft:"".concat(e.spacing(.25),"px solid ").concat(e.palette.primary.main)},copyValue:{cursor:"pointer",padding:e.spacing(1),borderRadius:0,"&:hover":{backgroundColor:"#fcf2e8",color:e.palette.primary.main}},content:{marginTop:e.spacing(1),marginBottom:e.spacing(1)},keyMargin:{marginRight:e.spacing(1)},unselectableLabel:{cursor:"default",userSelect:"none",WebkitUserSelect:"none",MozUserSelect:"none",msUserSelect:"none"}})}));function gt(e){var t=e.label,n=e.value,r=e.onConfirm,c=e.onChange,o=e.confirmLabel,i=e.confirmLabelDisabled,s=e.expandedOnly,l=e.helperText,u=e.placeholder,d=e.mapperFn,b=ft(),j=Object(a.useState)(Boolean(s)),h=Object(m.a)(j,2),O=h[0],x=h[1],f=Object(a.useState)(n||""),g=Object(m.a)(f,2),v=g[0],k=g[1],S=function(){return x(!O)};return Object(p.jsxs)(p.Fragment,{children:[Object(p.jsx)(Oe.a,{className:"".concat(b.header," ").concat(O?b.headerOpen:""),children:Object(p.jsxs)(ae.a,{container:!0,direction:"column",justifyContent:"space-between",alignItems:"stretch",children:[Object(p.jsxs)(ae.a,{container:!0,direction:"row",justifyContent:"space-between",alignItems:"center",children:[t&&Object(p.jsx)(xe.a,{variant:"body1",className:b.unselectableLabel,children:t}),Object(p.jsx)(xe.a,{variant:"body2",children:Object(p.jsxs)("div",{children:[!O&&n,!s&&Object(p.jsx)(w.a,{size:"small",className:b.copyValue,children:O?Object(p.jsx)(Te.a,{onClick:S,strokeWidth:1}):Object(p.jsx)(jt.a,{onClick:S,strokeWidth:1})})]})})]}),Object(p.jsx)(y.a,{in:O,timeout:"auto",unmountOnExit:!0,children:Object(p.jsx)(bt.a,{value:v,placeholder:u,onChange:function(e){d&&(e.target.value=d(e.target.value)),k(e.target.value),c&&c(e.target.value)},fullWidth:!0,className:b.content,autoFocus:!0})})]})}),Object(p.jsxs)(y.a,{in:O,timeout:"auto",unmountOnExit:!0,children:[l&&Object(p.jsx)(mt,{children:l}),Object(p.jsxs)(Ae,{children:[Object(p.jsx)(Ee.a,{variant:"contained",disabled:v===n||Boolean(i)||""===v&&void 0===n,startIcon:Object(p.jsx)(ht.a,{size:"1rem"}),onClick:function(){return r(v)},children:o||"Save"}),Object(p.jsx)(Ee.a,{variant:"contained",disabled:v===n||""===v,startIcon:Object(p.jsx)(pt.a,{size:"1rem"}),onClick:function(){return k(n||"")},children:"Cancel"})]})]})]})}function vt(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:8;return"".concat(e.slice(0,t),"[\u2026]").concat(e.slice(-t))}function yt(e,t,n){var a=wt(e),r=a.findIndex((function(e){return e.hash===t}));-1!==r&&a.splice(r,1),a.unshift({createdAt:Date.now(),hash:t,name:n}),a.length>10&&(a.length=10),localStorage.setItem(e,JSON.stringify(a))}function wt(e){var t=localStorage.getItem(e);if(!t)return[];try{var n=JSON.parse(t);return Array.isArray(n)&&n.every(kt)?n:[]}catch(a){return[]}}function kt(e){return"object"===typeof e&&null!==e&&("createdAt"in e&&"hash"in e)}function St(e,t){return"index.html"===t?"Website ".concat(vt(e,4)):t||"Folder ".concat(vt(e,4))}!function(e){e.UPLOAD_HISTORY="UPLOAD_HISTORY",e.DOWNLOAD_HISTORY="DOWNLOAD_HISTORY"}(xt||(xt={}));var Ct=n(601),Bt=Object(x.a)((function(e){return Object(f.a)({header:{backgroundColor:e.palette.background.paper,marginBottom:e.spacing(.25),borderLeft:"".concat(e.spacing(.25),"px solid rgba(0,0,0,0)"),wordBreak:"break-word"},headerOpen:{borderLeft:"".concat(e.spacing(.25),"px solid ").concat(e.palette.primary.main)},openLinkIcon:{cursor:"pointer",padding:e.spacing(1),borderRadius:0,"&:hover":{backgroundColor:"#fcf2e8",color:e.palette.primary.main}},content:{marginTop:e.spacing(2),marginBottom:e.spacing(2)},keyMargin:{marginRight:e.spacing(1)},copyValue:{cursor:"pointer",padding:e.spacing(1),borderRadius:0,"&:hover":{backgroundColor:"#fcf2e8",color:e.palette.primary.main}}})}));function At(e){var t=e.label,n=e.value,r=e.link,c=e.navigationType,o=void 0===c?"NEW_WINDOW":c,i=e.allowClipboard,s=void 0===i||i,l=Bt(),u=Object(a.useState)(!1),d=Object(m.a)(u,2),b=d[0],j=d[1],h=Object(pe.f)(),O=n.length>22?n.slice(0,19)+"...":n;function x(){"NEW_WINDOW"===o?window.open(r||n):h.push(r||n)}return Object(p.jsx)(Oe.a,{className:l.header,children:Object(p.jsx)(ae.a,{container:!0,direction:"column",justifyContent:"space-between",alignItems:"stretch",children:Object(p.jsxs)(ae.a,{container:!0,direction:"row",justifyContent:"space-between",alignItems:"center",children:[t&&Object(p.jsx)(xe.a,{variant:"body1",children:t}),Object(p.jsx)(xe.a,{variant:"body2",children:Object(p.jsxs)("div",{children:[s&&Object(p.jsx)("span",{className:l.copyValue,children:Object(p.jsx)(we.a,{title:b?"Copied":"Copy",placement:"top",arrow:!0,onClose:function(){return j(!1)},children:Object(p.jsx)(Le.a,{text:n,children:Object(p.jsx)("span",{onClick:function(){return j(!0)},children:O})})})}),!s&&Object(p.jsx)("span",{onClick:x,children:O}),Object(p.jsxs)(w.a,{size:"small",className:l.openLinkIcon,children:["NEW_WINDOW"===o&&Object(p.jsx)(ie.a,{onClick:x,strokeWidth:1}),"HISTORY_PUSH"===o&&Object(p.jsx)(Ct.a,{onClick:x,strokeWidth:1})]})]})})]})})})}function Nt(e){var t=e.title,n=e.localStorageKey,r=Object(a.useState)([]),c=Object(m.a)(r,2),o=c[0],i=c[1];return Object(a.useEffect)((function(){i(wt(n))}),[n]),o.length?Object(p.jsx)(ye,{label:t,defaultOpen:!0,children:o.map((function(e,t){return Object(p.jsx)(At,{label:(n=new Date(e.createdAt),n.toString().split("GMT")[0].trim()),value:e.name,link:"/files/hash/"+e.hash,navigationType:"HISTORY_PUSH",allowClipboard:!1},t);var n}))}):null}var Lt=n(632),Tt=n(602),Dt=Object(x.a)((function(e){return Object(f.a)({root:{flexGrow:1,marginBottom:e.spacing(4)},leftTab:{marginRight:e.spacing(.5)},rightTab:{marginLeft:e.spacing(.5)}})}));function Pt(e){var t=e.active,n=Dt(),a=Object(pe.f)();return Object(p.jsx)("div",{className:n.root,children:Object(p.jsxs)(Lt.a,{value:"UPLOAD"===t?0:1,onChange:function(e,t){a.push(1===t?va.DOWNLOAD:va.UPLOAD)},variant:"fullWidth",children:[Object(p.jsx)(Tt.a,{className:n.leftTab,label:"Upload"},"UPLOAD"),Object(p.jsx)(Tt.a,{className:n.rightTab,label:"Download"},"DOWNLOAD")]})})}function It(){var e=Object(a.useState)(!1),t=Object(m.a)(e,2),n=t[0],r=t[1],c=Object(a.useContext)(V).beeApi,o=Object(a.useState)(void 0),i=Object(m.a)(o,2),s=i[0],u=i[1],d=Object(l.b)().enqueueSnackbar,b=Object(pe.f)();function j(){return(j=Object(A.a)(B.a.mark((function e(t){var n,a,o;return B.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(c){e.next=2;break}return e.abrupt("return");case 2:return e.prev=2,n=new dt.ManifestJs(c),e.next=6,n.isManifest(t);case 6:if(e.sent){e.next=9;break}throw Error("The specified hash does not contain valid content.");case 9:return e.next=11,n.getIndexDocumentPath(t);case 11:a=e.sent,yt(xt.DOWNLOAD_HISTORY,t,St(t,a)),b.push(va.HASH.replace(":hash",t)),e.next=22;break;case 16:e.prev=16,e.t0=e.catch(2),(o="object"===typeof e.t0&&null!==e.t0&&Reflect.get(e.t0,"message")).includes("path address not found")&&(o="The specified hash does not have an index document set."),o.includes("Not Found: Not Found")&&(o="The specified hash was not found."),d(Object(p.jsxs)("span",{children:["Error: ",o||"Unknown"]}),{variant:"error"});case 22:return e.prev=22,r(!1),e.finish(22);case 25:case"end":return e.stop()}}),e,null,[[2,16,22,25]])})))).apply(this,arguments)}return Object(p.jsxs)(p.Fragment,{children:[Object(p.jsx)(Pt,{active:"DOWNLOAD"}),Object(p.jsx)(gt,{label:"Swarm Hash",onConfirm:function(e){return function(e){return j.apply(this,arguments)}(e)},onChange:function(e){H.Utils.isHexString(e,64)||H.Utils.isHexString(e,128)||!e.trim().length?u(void 0):u("Incorrect format of swarm hash. Expected 64 or 128 hexstring characters.")},helperText:s,confirmLabel:"Search",confirmLabelDisabled:Boolean(s)||n,placeholder:"e.g. 31fb0362b1a42536134c86bc58b97ac0244e5c6630beec3e27c2d1cecb38c605",expandedOnly:!0,mapperFn:function(e){return function(e){return e.length<64?e:function(e){var t=e.match(/[a-fA-F0-9]{64,128}/);return t&&t[0]||null}(e)||e}(e)}}),Object(p.jsx)(Nt,{title:"Download History",localStorageKey:xt.DOWNLOAD_HISTORY})]})}var Et=n(631),Ut=n(199),Rt=n(200),Ft=n.n(Rt);function Wt(){return Object(p.jsx)(ae.a,{container:!0,direction:"row",justifyContent:"center",alignItems:"center",children:Object(p.jsx)(te.a,{})})}var _t=["index.html","index.htm"];function zt(e){if(!e.length)return!1;var t=e.find((function(e){return _t.includes(e.path)}));if(t)return t.name;var n=e[0].path.split("/")[0]+"/";if(e.every((function(e){return e.path.startsWith(n)}))){var a=e.find((function(e){return _t.map((function(e){return n+e})).includes(e.path)}));if(a)return a.name}return!1}function Mt(e){return{name:e.name,size:e.data.byteLength,type:e.contentType,arrayBuffer:function(){return new Promise((function(t){return t(e.data)}))}}}function Ht(e){return Object.entries(e).map((function(e){return{name:e[0],path:e[0],type:"n/a",size:0,webkitRelativePath:e[0],arrayBuffer:function(){return new Promise((function(e){return e(new ArrayBuffer(0))}))}}}))}function qt(e){return 1===e.length?e[0].name:e[0].path.split("/")[0]}var Vt=function e(t){var n=this;Object(d.a)(this,e),this.name=void 0,this.path=void 0,this.type=void 0,this.size=void 0,this.webkitRelativePath=void 0,this.arrayBuffer=void 0,this.data=void 0;var a=Reflect.get(t,"path")||t.webkitRelativePath||t.name;this.path=a.startsWith("/")?a.slice(1):a,this.webkitRelativePath=this.path,this.name=t.name,this.type=t.type,this.size=t.size,this.data=t.arrayBuffer(),this.arrayBuffer=Object(A.a)(B.a.mark((function e(){var t;return B.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,n.data;case 2:return t=e.sent,e.abrupt("return",t);case 4:case"end":return e.stop()}}),e)})))},Yt=n(604),Zt=n(603),Gt=n(605),Kt=Object(x.a)((function(){return Object(f.a)({image:{width:"100%",height:"100%",objectFit:"cover"}})}));function Jt(e){var t=Kt(),n={};return e.maxHeight&&(n.maxHeight=e.maxHeight),e.maxWidth&&(n.maxWidth=e.maxWidth),Object(p.jsx)("img",{className:t.image,alt:e.alt,src:e.src,style:n})}var Xt=Object(x.a)((function(){return Object(f.a)({wrapper:{display:"flex",justifyContent:"center",alignItems:"center",width:"175px",height:"175px",background:"repeating-linear-gradient(\n 45deg,\n #efefef,\n #efefef 4px,\n #ffffff 4px,\n #ffffff 8px\n )"}})}));function $t(e){var t=e.children,n=Xt();return Object(p.jsx)("div",{className:n.wrapper,children:t})}function Qt(e){var t=e.icon;return Object(p.jsx)($t,{children:t})}function en(e){var t=e.assetName,n=e.files,r=Object(a.useState)(void 0),c=Object(m.a)(r,2),o=c[0],i=c[1],s=Object(a.useState)(void 0),l=Object(m.a)(s,2),u=l[0],d=l[1];Object(a.useEffect)((function(){1===n.length?n[0].type.startsWith("image/")?n[0].arrayBuffer().then((function(e){var t=new Blob([e]);d(URL.createObjectURL(t))})):(d(void 0),i(Object(p.jsx)(Qt,{icon:Object(p.jsx)(Zt.a,{})}))):zt(n)?(d(void 0),i(Object(p.jsx)(Qt,{icon:Object(p.jsx)(Yt.a,{})}))):(d(void 0),i(Object(p.jsx)(Qt,{icon:Object(p.jsx)(Gt.a,{})})))}),[n]);var b,j=function(){return 1===n.length?n[0].type:zt(n)?"Website":"Folder"},h=(b=n.reduce((function(e,t){return e+t.size}),0))>=1e6?(b/1e6).toFixed(2)+" MB":b>=1e3?(b/1e3).toFixed(2)+" kB":b+" bytes";return Object(p.jsxs)(Et.a,{mb:4,children:[Object(p.jsx)(Et.a,{bgcolor:"background.paper",children:Object(p.jsxs)(ae.a,{container:!0,direction:"row",children:[o||Object(p.jsx)(Jt,{maxWidth:"250px",maxHeight:"175px",alt:"Upload Preview",src:u}),Object(p.jsxs)(Et.a,{p:2,children:[Object(p.jsx)(xe.a,{children:function(){var e=qt(n);return 1===n.length?"Filename: "+(t||e):"Folder name: "+(t||e)}()}),Object(p.jsxs)(xe.a,{children:["Kind: ",j()]}),"0 bytes"!==h&&Object(p.jsxs)(xe.a,{children:["Size: ",h]})]})]})}),["Folder","Website"].includes(j())&&Object(p.jsx)(Et.a,{mt:.25,p:2,bgcolor:"background.paper",children:Object(p.jsxs)(ae.a,{container:!0,justifyContent:"space-between",alignItems:"center",direction:"row",children:[Object(p.jsx)(xe.a,{variant:"subtitle2",children:"Folder content"}),Object(p.jsxs)(xe.a,{variant:"subtitle2",children:[n.length," items"]})]})})]})}function tn(e){var t=e.hash;return Object(p.jsxs)(p.Fragment,{children:[Object(p.jsxs)(Et.a,{mb:4,children:[Object(p.jsx)(Ie,{label:"Swarm hash",value:t}),Object(p.jsx)(At,{label:"Share on Swarm Gateway",value:"https://gateway.ethswarm.org/access/".concat(t)})]}),Object(p.jsxs)(xe.a,{children:["The Swarm Gateway is graciously provided by the Swarm Foundation. This service is under development and provided for testing purposes only. Learn more at"," ",Object(p.jsx)("a",{href:"https://gateway.ethswarm.org/",children:"https://gateway.ethswarm.org/"}),"."]})]})}var nn=n(607),an=n(606),rn=Object(x.a)((function(){return Object(f.a)({button:{position:"relative",whiteSpace:"nowrap","&:hover, &:focus":{"& svg":{stroke:"#fff",transition:"0.1s"}}},spinnerWrapper:{position:"absolute",left:"50%",top:"50%",width:"40px",height:"40px",transform:"translate(-50%, -50%)"}})}));function cn(e){var t=e.children,n=e.onClick,a=e.iconType,c=e.className,o=e.disabled,i=e.loading,s=rn(),l=r.a.createElement(a,{size:"1.25rem",color:o?"rgba(0, 0, 0, 0.26)":"#dd7700"}),u=c?[c,s.button].join(" "):s.button;return Object(p.jsxs)(Ee.a,{className:u,onClick:function(e){n(),e.currentTarget.blur()},variant:"contained",startIcon:l,disabled:o,children:[t,i&&Object(p.jsx)("div",{className:s.spinnerWrapper,children:Object(p.jsx)(te.a,{})})]})}function on(e){var t=e.onOpen,n=e.onDownload,a=e.onCancel,r=e.hasIndexDocument,c=e.loading;return Object(p.jsxs)(Ae,{children:[r&&Object(p.jsx)(cn,{onClick:t,iconType:an.a,disabled:c,children:"View Website"}),Object(p.jsx)(cn,{onClick:n,iconType:st.a,disabled:c,loading:c,children:"Download"}),Object(p.jsx)(Ee.a,{onClick:a,variant:"contained",startIcon:Object(p.jsx)(nn.a,{}),disabled:c,children:"Close"})]})}function sn(e){var t=Object(a.useContext)(V),n=t.apiUrl,r=t.beeApi,c=e.match.params.hash,o=Object(pe.f)(),i=Object(a.useState)(!0),s=Object(m.a)(i,2),l=s[0],u=s[1],d=Object(a.useState)(!1),b=Object(m.a)(d,2),j=b[0],h=b[1],O=Object(a.useState)([]),x=Object(m.a)(O,2),f=x[0],g=x[1],v=Object(a.useState)({}),y=Object(m.a)(v,2),w=y[0],k=y[1],S=Object(a.useState)(null),C=Object(m.a)(S,2),N=C[0],L=C[1];function T(){return T=Object(A.a)(B.a.mark((function e(){var t,n,a,o;return B.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r){e.next=2;break}return e.abrupt("return");case 2:return t=new dt.ManifestJs(r),e.next=5,t.isManifest(c);case 5:if(e.sent){e.next=8;break}throw Error("The specified hash does not contain valid content.");case 8:return e.next=10,t.getHashes(c);case 10:return n=e.sent,k(n),e.next=14,t.getIndexDocumentPath(c);case 14:if(a=e.sent,L(a),1!==Object.keys(n).length){e.next=23;break}return e.next=19,r.downloadFile(c);case 19:o=e.sent,g([new Vt(Mt(o))]),e.next=24;break;case 23:g(Ht(n));case 24:case"end":return e.stop()}}),e)}))),T.apply(this,arguments)}function D(){return(D=Object(A.a)(B.a.mark((function e(){var t,a,o,i,s,l,u;return B.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r){e.next=2;break}return e.abrupt("return");case 2:if(yt(xt.DOWNLOAD_HISTORY,c,St(c,N)),h(!0),1!==Object.keys(w).length){e.next=8;break}window.open("".concat(n,"/bzz/").concat(c,"/"),"_blank"),e.next=25;break;case 8:t=new Ft.a,a=0,o=Object.entries(w);case 10:if(!(a<o.length)){e.next=21;break}return i=Object(m.a)(o[a],2),s=i[0],l=i[1],e.t0=t,e.t1=s,e.next=16,r.downloadData(l);case 16:e.t2=e.sent,e.t0.file.call(e.t0,e.t1,e.t2);case 18:a++,e.next=10;break;case 21:return e.next=23,t.generateAsync({type:"blob"});case 23:u=e.sent,Object(Ut.saveAs)(u,c+".zip");case 25:h(!1);case 26:case"end":return e.stop()}}),e)})))).apply(this,arguments)}Object(a.useEffect)((function(){u(!0),function(){return T.apply(this,arguments)}().then((function(){u(!1)}))}),[c]);var P=vt(c);return l?Object(p.jsx)(Wt,{}):Object(p.jsxs)(p.Fragment,{children:[Object(p.jsx)(Et.a,{mb:4,children:Object(p.jsx)(en,{files:f,assetName:P})}),Object(p.jsx)(Et.a,{mb:4,children:Object(p.jsx)(tn,{hash:c})}),Object(p.jsx)(on,{onOpen:function(){window.open("".concat(n,"/bzz/").concat(c,"/"),"_blank")},onCancel:function(){"POP"===o.action?o.push(va.UPLOAD):o.goBack()},onDownload:function(){return D.apply(this,arguments)},hasIndexDocument:Boolean(N&&f.length>1),loading:j})]})}var ln=n(608),un=Object(x.a)((function(){return Object(f.a)({pressable:{cursor:"pointer"},icon:{color:"#242424"}})}));function dn(e){var t=e.children,n=un(),a=Object(pe.f)();return Object(p.jsx)(Et.a,{mb:4,children:Object(p.jsxs)(ae.a,{container:!0,direction:"row",children:[Object(p.jsx)(Et.a,{mr:2,children:Object(p.jsx)("div",{className:n.pressable,onClick:function(){a.goBack()},children:Object(p.jsx)(ln.a,{className:n.icon})})}),Object(p.jsx)(xe.a,{variant:"h1",children:t})]})})}var bn={files:[],setFiles:function(){}},jn=Object(a.createContext)(bn);jn.Consumer;function hn(e){var t=e.children,n=Object(a.useState)(bn.files),r=Object(m.a)(n,2),c=r[0],o=r[1];return Object(p.jsx)(jn.Provider,{value:{files:c,setFiles:o},children:t})}var pn={stamps:null,error:null,isLoading:!1,lastUpdate:null,start:function(){},stop:function(){},refresh:function(){return Promise.reject()}},On=Object(a.createContext)(pn);On.Consumer;function mn(e){var t=e.depth,n=e.bucketDepth,a=e.utilization/Math.pow(2,t-n),r="".concat(Math.ceil(100*a),"%");return Object(N.a)(Object(N.a)({},e),{},{usage:a,usageText:r})}function xn(e){var t=e.children,n=Object(a.useContext)(V).beeDebugApi,r=Object(a.useState)(pn.stamps),c=Object(m.a)(r,2),o=c[0],i=c[1],s=Object(a.useState)(pn.error),l=Object(m.a)(s,2),u=l[0],d=l[1],b=Object(a.useState)(pn.isLoading),j=Object(m.a)(b,2),h=j[0],O=j[1],x=Object(a.useState)(pn.lastUpdate),f=Object(m.a)(x,2),g=f[0],v=f[1],y=Object(a.useState)(null),w=Object(m.a)(y,2),k=w[0],S=w[1],C=function(){var e=Object(A.a)(B.a.mark((function e(){var t;return B.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!h){e.next=2;break}return e.abrupt("return");case 2:if(n){e.next=4;break}return e.abrupt("return");case 4:return e.prev=4,O(!0),e.next=8,n.getAllPostageBatch();case 8:t=e.sent,i(t.map(mn)),v(Date.now()),e.next=16;break;case 13:e.prev=13,e.t0=e.catch(4),d(e.t0);case 16:return e.prev=16,O(!1),e.finish(16);case 19:case"end":return e.stop()}}),e,null,[[4,13,16,19]])})));return function(){return e.apply(this,arguments)}}();return Object(a.useEffect)((function(){if(C(),k){var e=setInterval(C,k);return function(){return clearInterval(e)}}}),[k]),Object(p.jsx)(On.Provider,{value:{stamps:o,error:u,isLoading:h,lastUpdate:g,start:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:3e4;return S(e)},stop:function(){return S(null)},refresh:C},children:t})}var fn=n(50),gn=n(132),vn={depth:"",amount:"",label:""},yn=Object(x.a)((function(e){return Object(f.a)({wrapper:{margin:e.spacing(1),position:"relative"},field:{marginTop:e.spacing(1),marginBottom:e.spacing(1)},buttonProgress:{position:"absolute",top:"50%",left:"50%",marginTop:-12,marginBottom:-12}})}));function wn(e){var t=e.onClose,n=yn(),r=Object(a.useContext)(On).refresh,c=Object(a.useContext)(V).beeDebugApi,o=Object(l.b)().enqueueSnackbar;return Object(p.jsx)(fn.c,{initialValues:vn,onSubmit:function(){var e=Object(A.a)(B.a.mark((function e(n,a){var i,s,l;return B.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(e.prev=0,n.depth&&n.amount){e.next=3;break}return e.abrupt("return");case 3:if(c){e.next=5;break}return e.abrupt("return");case 5:return i=BigInt(n.amount),s=Number.parseInt(n.depth),l=n.label?{label:n.label}:void 0,e.next=10,c.createPostageBatch(i.toString(),s,l);case 10:return a.resetForm(),e.next=13,r();case 13:t(),e.next=20;break;case 16:e.prev=16,e.t0=e.catch(0),o("Error: ".concat(e.t0.message),{variant:"error"}),a.setSubmitting(!1);case 20:case"end":return e.stop()}}),e,null,[[0,16]])})));return function(t,n){return e.apply(this,arguments)}}(),validate:function(e){var t={};if(e.depth){var n=new U.a(e.depth);n.isInteger()?n.isLessThan(16)?t.depth="Minimal depth is 16":n.isGreaterThan(255)&&(t.depth="Depth has to be at most 255"):t.depth="Depth must be an integer"}else t.depth="Required field";if(e.amount){var a=new U.a(e.amount);a.isInteger()?a.isLessThanOrEqualTo(0)&&(t.amount="Amount must be greater than 0"):t.amount="Amount must be an integer"}else t.amount="Required field";return e.label&&!/^[0-9a-z]*$/i.test(e.label)&&(t.label="Label must be an alphanumeric string"),t},children:function(e){var a=e.submitForm,r=e.isValid,c=e.isSubmitting,o=e.values;return Object(p.jsx)(fn.b,{children:Object(p.jsxs)(Ue.a,{open:!0,onClose:t,"aria-labelledby":"form-dialog-title",children:[Object(p.jsx)(_e.a,{id:"form-dialog-title",children:"Buy new postage stamp"}),Object(p.jsxs)(Fe.a,{children:[Object(p.jsx)(fn.a,{component:gn.a,required:!0,name:"depth",autoFocus:!0,label:"Depth",fullWidth:!0,className:n.field}),Object(p.jsx)(fn.a,{component:gn.a,required:!0,name:"amount",label:"Amount",fullWidth:!0,className:n.field}),Object(p.jsx)(fn.a,{component:gn.a,name:"label",label:"Label",fullWidth:!0,className:n.field})]}),Object(p.jsxs)(Re.a,{children:[Object(p.jsx)(Ee.a,{onClick:t,variant:"contained",children:"Cancel"}),Object(p.jsx)("div",{className:n.wrapper,children:Object(p.jsxs)(Ee.a,{disabled:c||!r||!o.amount||!o.depth,type:"submit",variant:"contained",onClick:a,children:["Create",c&&Object(p.jsx)(te.a,{size:24,className:n.buttonProgress})]})})]}),Object(p.jsx)(Fe.a,{children:Object(p.jsx)(We.a,{children:"Please refer to the official Bee documentation to understand these values."})})]})})}})}var kn=n(610),Sn=n(633),Cn=n(612),Bn=n(613),An=Object(x.a)((function(e){return Object(f.a)({dialog:{background:e.palette.background.default,borderRadius:0,width:"100%",maxWidth:"890px"},title:{color:"#606060",textAlign:"center"},select:{background:e.palette.background.paper,borderRadius:0,border:0},option:{height:"52px"},hint:{marginBottom:"16px"}})}));function Nn(e){var t=e.stamps,n=e.onSelect,r=e.onClose,c=Object(a.useState)(null),o=Object(m.a)(c,2),i=o[0],s=o[1],l=An();return Object(p.jsxs)(Ue.a,{open:!0,onClose:r,"aria-labelledby":"form-dialog-title",fullWidth:!0,PaperProps:{className:l.dialog},children:[Object(p.jsx)(_e.a,{id:"form-dialog-title",className:l.title,children:"Select postage stamp"}),Object(p.jsx)(Fe.a,{children:Object(p.jsx)(kn.a,{fullWidth:!0,children:Object(p.jsx)(Sn.a,{onChange:function(e){return function(e){var n=t.find((function(t){return t.batchID===e}));n&&s(n)}(e.target.value)},fullWidth:!0,variant:"outlined",className:l.select,defaultValue:"",children:t.map((function(e){return Object(p.jsx)(Cn.a,{value:e.batchID,className:l.option,children:e.batchID.slice(0,8)},e.batchID)}))})})}),Object(p.jsx)(Fe.a,{children:Object(p.jsxs)(Ae,{children:[Object(p.jsx)(Ee.a,{disabled:!i,onClick:function(){i&&(n(i),r())},variant:"contained",startIcon:Object(p.jsx)(Bn.a,{}),children:"Select"}),Object(p.jsx)(Ee.a,{onClick:r,variant:"contained",startIcon:Object(p.jsx)(nn.a,{}),children:"Cancel"})]})})]})}function Ln(e){var t=e.width,n=e.usage,a=Math.round(100*n),r=a+"%",c=98-a+"%";return Object(p.jsx)("div",{style:{display:"flex",alignItems:"center",height:"100%",width:t},children:Object(p.jsxs)("div",{style:{display:"flex",height:"4px",width:"100%"},children:[Object(p.jsx)("div",{style:{width:r,background:"#dd7200"}}),Object(p.jsx)("div",{style:{width:"2%"}}),Object(p.jsx)("div",{style:{width:c,background:"#c9c9c9"}})]})})}function Tn(e){var t=e.stamp,n=e.shorten;return Object(p.jsx)(Et.a,{p:2,width:"100%",children:Object(p.jsxs)(ae.a,{container:!0,justifyContent:"space-between",alignItems:"center",direction:"row",children:[Object(p.jsx)(xe.a,{variant:"subtitle2",children:n?t.batchID.slice(0,8):t.batchID}),Object(p.jsx)(Ln,{width:"100px",usage:t.usage})]})})}function Dn(e){var t=e.stamp;return Object(p.jsxs)(Et.a,{mb:4,children:[Object(p.jsx)(Et.a,{mb:.25,p:2,bgcolor:"background.paper",children:Object(p.jsx)(xe.a,{variant:"subtitle2",children:"Associated postage stamp:"})}),Object(p.jsx)(Et.a,{bgcolor:"background.paper",children:Object(p.jsx)(Tn,{stamp:t,shorten:!0})})]})}var Pn=n(614),In=n(616);function En(e){var t=e.canSelectStamp,n=e.hasSelectedStamp,a=e.onUpload,r=e.onBuy,c=e.onSelect,o=e.onCancel,i=e.onClearStamp,s=e.isUploading,l=!n,u=t&&!n,d=n,b=t&&n;return Object(p.jsxs)(p.Fragment,{children:[Object(p.jsxs)(Ae,{children:[l?Object(p.jsx)(cn,{onClick:r,iconType:Pn.a,children:"Buy New Postage Stamp"}):null,u?Object(p.jsx)(cn,{onClick:c,iconType:ue.a,children:"Use Existing Postage Stamp"}):null,d?Object(p.jsx)(cn,{onClick:a,iconType:ht.a,disabled:s,loading:s,children:"Upload To Your Node"}):null,b?Object(p.jsx)(cn,{onClick:i,iconType:In.a,disabled:s,children:"Change Postage Stamp"}):null,Object(p.jsx)(Ee.a,{onClick:o,variant:"contained",startIcon:Object(p.jsx)(nn.a,{}),children:"Cancel"})]}),u?Object(p.jsx)(xe.a,{children:"You need a postage stamp to upload. Please refer to the official Bee documentation to understand how postage stamps work."}):null]})}function Un(){var e=Object(a.useState)(!1),t=Object(m.a)(e,2),n=t[0],r=t[1],c=Object(a.useState)(!1),o=Object(m.a)(c,2),i=o[0],s=o[1],u=Object(a.useState)(null),d=Object(m.a)(u,2),b=d[0],j=d[1],h=Object(a.useState)(!1),O=Object(m.a)(h,2),x=O[0],f=O[1],g=Object(a.useContext)(On),v=g.stamps,y=g.refresh,w=Object(a.useContext)(V).beeApi,k=Object(a.useContext)(jn),S=k.files,C=k.setFiles,B=Object(l.b)().enqueueSnackbar,A=Object(pe.f)();S.length||(C([]),A.replace(va.UPLOAD)),Object(a.useEffect)((function(){y()}),[]);return Object(p.jsxs)(p.Fragment,{children:[Object(p.jsx)(dn,{children:"Upload"}),S.length&&Object(p.jsx)(en,{files:S}),null!==b?Object(p.jsx)(Dn,{stamp:b}):null,S.length&&Object(p.jsx)(En,{canSelectStamp:null!==v&&v.length>0,hasSelectedStamp:null!==b,onCancel:function(){C([]),j(null),f(!1)},onBuy:function(){return r(!0)},onSelect:function(){return s(!0)},onUpload:function(){if(w&&S.length&&b){var e=1===S.length?S[0].name:zt(S)||void 0;f(!0),w.uploadFiles(b.batchID,S,{indexDocument:e}).then((function(e){yt(xt.UPLOAD_HISTORY,e.reference,qt(S)),A.replace(va.HASH.replace(":hash",e.reference))})).catch((function(e){B("Error uploading: ".concat(e.message),{variant:"error"}),f(!1)}))}},onClearStamp:function(){return j(null)},isUploading:x}),n?Object(p.jsx)(wn,{onClose:function(){return r(!1)}}):null,v&&i?Object(p.jsx)(Nn,{stamps:v,onClose:function(){return s(!1)},onSelect:function(e){return j(e)}}):null]})}var Rn=n(215),Fn=n(617),Wn=n(618),_n=n(619),zn=Object(x.a)((function(e){return Object(f.a)({areaWrapper:{position:"relative",marginBottom:e.spacing(2)},dropzone:{background:e.palette.background.default,outline:"none",color:"transparent",zIndex:1,"& svg":{opacity:0}},buttonWrapper:{top:"0",left:"0",position:"absolute",display:"flex",width:"100%",height:"100%",justifyContent:"center",alignItems:"center"},button:{marginLeft:e.spacing(.5),marginRight:e.spacing(.5),zIndex:2}})}));function Mn(e){var t=e.maximumSizeInBytes,n=Object(a.useContext)(jn).setFiles,r=zn(),c=Object(pe.f)(),o=Object(l.b)().enqueueSnackbar,i=Object(a.useState)(!1),s=Object(m.a)(i,2),u=s[0],d=s[1],b=Object(a.useState)(0),j=Object(m.a)(b,2),h=j[0],O=j[1],x=function(){return document.querySelector(".MuiDropzoneArea-root input")},f=function(){var e=x();e&&(e.setAttribute("directory",""),e.setAttribute("webkitdirectory",""),e.setAttribute("mozdirectory",""),e.click())};return Object(p.jsxs)(p.Fragment,{children:[Object(p.jsxs)("div",{className:r.areaWrapper,children:[Object(p.jsx)(Rn.a,{dropzoneClass:r.dropzone,onChange:function(e){if(e){var t=e.map((function(e){return new Vt(e)})),a=1===e.length?e[0].name:zt(t)||void 0;if(e.length&&u&&!a)return o("To upload a website, there must be an index.html or index.htm in the root of the folder.",{variant:"error"}),void setTimeout((function(){O((function(e){return e+1})),n([])}),0);n(t),e.length&&c.push(va.UPLOAD_IN_PROGRESS)}},filesLimit:1e9,maxFileSize:t,showPreviews:!1},h),Object(p.jsxs)("div",{className:r.buttonWrapper,children:[Object(p.jsx)(cn,{className:r.button,onClick:function(){var e=x();e&&(e.removeAttribute("directory"),e.removeAttribute("webkitdirectory"),e.removeAttribute("mozdirectory"),e.click())},iconType:Fn.a,children:"Add File"}),Object(p.jsx)(cn,{className:r.button,onClick:function(){f(),d(!1)},iconType:Wn.a,children:"Add Folder"}),Object(p.jsx)(cn,{className:r.button,onClick:function(){f(),d(!0)},iconType:_n.a,children:"Add Website"})]})]}),Object(p.jsx)(xe.a,{children:"You can click the buttons above or simply drag and drop to add a file or folder. To upload a website to Swarm, make sure that your folder contains an \u201cindex.html\u201d file."})]})}function Hn(){return Object(p.jsxs)(p.Fragment,{children:[Object(p.jsx)(Pt,{active:"UPLOAD"}),Object(p.jsx)(Mn,{maximumSizeInBytes:1e9}),Object(p.jsx)(Nt,{title:"Upload History",localStorageKey:xt.UPLOAD_HISTORY})]})}var qn=n(211),Vn=1e5,Yn="There may be issues with your Bee node or connection.",Zn={connectedPeers:[{minimumValue:200,explanation:"Perfect! ".concat(200," or more connected peers indicate a healthy topology."),score:2},{minimumValue:1,explanation:"Your Bee node is connected to peers, but this number should ideally be above ".concat(200,". If you have only started your Bee node, this number may increase quickly."),score:1},{minimumValue:0,explanation:"Your Bee node has not connected to any peers. "+Yn,score:0}],population:[{minimumValue:Vn,explanation:"Perfect! Your Bee node seems to have a realistic value for the network size, which means everything is working well on your end.",score:2},{minimumValue:1,explanation:"Population is usually above ".concat(Vn.toLocaleString(),". If the number does not increase within a few hours, there may be issues with your Bee node."),score:1},{minimumValue:0,explanation:"Your Bee node has no information on the network population. "+Yn,score:0}],depth:[{minimumValue:12,explanation:"Perfect! Your Bee node has the highest available depth.",score:2},{minimumValue:1,explanation:"Your Bee node is supposed to reach a depth of ".concat(12," eventually. Stagnation or decrease in this number may indicate problems with your Bee node."),score:1},{minimumValue:0,explanation:"Your Bee node has not started building its topology yet. "+Yn,score:0}]};function Gn(e,t){var n,a=Zn[e],r=a[0].score,c=Object(qn.a)(a);try{for(c.s();!(n=c.n()).done;){var o=n.value;if(t>=o.minimumValue)return{score:o.score,maximumScore:r,explanation:o.explanation}}}catch(s){c.e(s)}finally{c.f()}var i=a[a.length-1];return{score:i.score,maximumScore:r,explanation:i.explanation}}var Kn=function(e){var t,n,a,r,c,o,i={connectedPeers:Gn("connectedPeers",(null===(t=e.topology)||void 0===t?void 0:t.connected)||0),population:Gn("population",(null===(n=e.topology)||void 0===n?void 0:n.population)||0),depth:Gn("depth",(null===(a=e.topology)||void 0===a?void 0:a.depth)||0)},s=Object.values(i).reduce((function(e,t){return e+t.maximumScore}),0),l=Object.values(i).reduce((function(e,t){return e+t.score}),0),u=Math.round(l/s*100)+"%";return Object(p.jsxs)(p.Fragment,{children:[Object(p.jsx)(Ce,{label:"Overall Health Indicator",value:u}),Object(p.jsx)(Ce,{label:"Connected Peers",value:null===(r=e.topology)||void 0===r?void 0:r.connected.toString(),tooltip:i.connectedPeers.explanation}),Object(p.jsx)(Ce,{label:"Population",value:null===(c=e.topology)||void 0===c?void 0:c.population.toString(),tooltip:i.population.explanation}),Object(p.jsx)(Ce,{label:"Depth",value:null===(o=e.topology)||void 0===o?void 0:o.depth.toString(),tooltip:i.depth.explanation})]})};function Jn(){var e=Object(a.useContext)(K),t=e.status,n=e.latestUserVersion,r=e.isLatestBeeVersion,c=e.latestBeeVersionUrl,o=e.topology,i=e.nodeAddresses,s=e.chequebookAddress;return t.all?Object(p.jsxs)("div",{children:[Object(p.jsxs)(ye,{label:"Bee Node",defaultOpen:!0,children:[Object(p.jsx)(Ce,{label:"Agent",value:Object(p.jsxs)("div",{children:[Object(p.jsx)("a",{href:"https://github.com/ethersphere/bee",rel:"noreferrer",target:"_blank",children:"Bee"})," ".concat(n||"-"," "),Object(p.jsx)(Ee.a,{size:"small",variant:"outlined",href:c,target:"_blank",children:r?"latest":"update"})]})}),Object(p.jsx)(Ie,{label:"Public key",value:(null===i||void 0===i?void 0:i.publicKey)||""}),Object(p.jsx)(Ie,{label:"PSS public key",value:(null===i||void 0===i?void 0:i.pssPublicKey)||""}),Object(p.jsx)(Ie,{label:"Overlay address (Peer ID)",value:(null===i||void 0===i?void 0:i.overlay)||""}),Object(p.jsx)(ye,{level:1,label:"Underlay addresses",children:null===i||void 0===i?void 0:i.underlay.map((function(e){return Object(p.jsx)(Ce,{value:e},e)}))})]}),Object(p.jsxs)(ye,{label:"Blockchain",defaultOpen:!0,children:[Object(p.jsx)(Ie,{label:"Ethereum address",value:(null===i||void 0===i?void 0:i.ethereum)||""}),Object(p.jsx)(Ie,{label:"Chequebook contract address",value:(null===s||void 0===s?void 0:s.chequebookAddress)||""})]}),Object(p.jsx)(ye,{label:"Connectivity",defaultOpen:!0,children:Object(p.jsx)(Kn,{topology:o})})]}):Object(p.jsx)(tt,{})}function Xn(){var e=Object(a.useContext)(V),t=e.apiUrl,n=e.apiDebugUrl,r=e.setApiUrl,c=e.setDebugApiUrl;return Object(p.jsxs)(ye,{label:"API Settings",defaultOpen:!0,children:[Object(p.jsx)(gt,{label:"Bee API",value:t,onConfirm:r}),Object(p.jsx)(gt,{label:"Bee Debug API",value:n,onConfirm:c})]})}var $n=Object(x.a)((function(e){return Object(f.a)({root:{width:"100%",padding:0,margin:0,marginTop:e.spacing(4),"&:first-child":{marginTop:0}},rootLevel1:{marginTop:e.spacing(1)},rootLevel2:{marginTop:e.spacing(.5)},header:{backgroundColor:e.palette.background.paper},contentLevel0:{marginTop:e.spacing(1)},contentLevel12:{marginTop:e.spacing(.25)},infoText:{color:"#c9c9c9"}})}));function Qn(e){var t=e.children,n=e.expandable,r=e.defaultOpen,c=$n(),o=Object(a.useState)(Boolean(r)),i=Object(m.a)(o,2),s=i[0],l=i[1];return Object(p.jsxs)("div",{className:"".concat(c.root," ").concat(c.rootLevel2),children:[Object(p.jsxs)(Oe.a,{button:!0,onClick:function(){l(!s)},className:c.header,children:[t,s?Object(p.jsx)(fe.a,{}):Object(p.jsx)(ge.a,{})]}),Object(p.jsx)(y.a,{in:s,timeout:"auto",unmountOnExit:!0,children:Object(p.jsx)("div",{className:c.contentLevel12,children:n})})]})}var ea=function(e){var t=e.postageStamps;return null===t?null:Object(p.jsx)(ye,{label:"Postage Stamps",defaultOpen:!0,children:t.map((function(e){return Object(p.jsx)(Qn,{expandable:Object(p.jsx)(Ie,{label:"Batch ID",value:e.batchID}),children:Object(p.jsx)(Tn,{stamp:e,shorten:!0})},e.batchID)}))})},ta=Object(x.a)((function(){return Object(f.a)({root:{width:"100%",display:"grid"},actions:{display:"flex",width:"100%",flex:"0 1 auto",flexWrap:"wrap",alignItems:"center"}})}));function na(){var e=ta(),t=Object(a.useState)(!1),n=Object(m.a)(t,2),r=n[0],c=n[1],o=Object(a.useContext)(On),i=o.stamps,s=o.isLoading,l=o.error,u=o.start,d=o.stop,b=Object(a.useContext)(K).status;return Object(a.useEffect)((function(){if(b.all)return u(),function(){return d()}}),[b]),b.all?Object(p.jsxs)("div",{className:e.root,children:[l&&Object(p.jsxs)(ee.a,{style:{textAlign:"center",padding:"50px"},children:["Error loading postage stamps details: ",l.message]}),!l&&Object(p.jsxs)(p.Fragment,{children:[Object(p.jsxs)("div",{className:e.actions,children:[r?Object(p.jsx)(wn,{onClose:function(){return c(!1)}}):null,Object(p.jsx)(cn,{onClick:function(){return c(!0)},iconType:Pn.a,children:"Buy New Postage Stamp"}),Object(p.jsx)("div",{style:{height:"5px"},children:s&&Object(p.jsx)(te.a,{})})]}),Object(p.jsx)(ea,{postageStamps:i})]})]}):Object(p.jsx)(tt,{})}var aa=n(218),ra=["children","value","index"];function ca(e){var t=e.children,n=e.value,a=e.index,r=Object(aa.a)(e,ra);return Object(p.jsx)("div",Object(N.a)(Object(N.a)({role:"tabpanel",hidden:n!==a},r),{},{children:n===a&&t}))}var oa=Object(x.a)((function(e){return Object(f.a)({root:{flexGrow:1},content:{marginTop:e.spacing(2)}})}));function ia(e){var t=e.values,n=e.index,a=e.indexChanged,c=oa(),o=r.a.useState(n||0),i=Object(m.a)(o,2),s=i[0],l=i[1],u=void 0!==n?n:s;return Object(p.jsxs)("div",{className:c.root,children:[Object(p.jsx)(Lt.a,{value:u,onChange:function(e,t){a?a(t):l(t)},variant:"fullWidth",children:t.map((function(e,t){var n=e.label;return Object(p.jsx)(Tt.a,{label:n},t)}))}),Object(p.jsx)("div",{className:c.content,children:t.map((function(e,t){var n=e.component;return Object(p.jsx)(ca,{value:u,index:t,children:n},t)}))})]})}var sa,la,ua=n(635),da=function(e){return Object(p.jsx)("div",{style:{textAlign:"left"},children:Object(p.jsx)(ua.a,{language:e.language,showLineNumbers:e.showLineNumbers,children:e.code})})};!function(e){e[e.macOS=0]="macOS",e[e.Linux=1]="Linux",e[e.Windows=2]="Windows",e[e.iOS=3]="iOS",e[e.Android=4]="Android"}(sa||(sa={})),function(e){e[e.macOS=sa.macOS]="macOS",e[e.Linux=sa.Linux]="Linux"}(la||(la={}));var ba={platform:la.macOS,setPlatform:function(){}},ja=Object(a.createContext)(ba);ja.Consumer;function ha(e){var t=e.children,n=Object(a.useState)(la.Linux),r=Object(m.a)(n,2),c=r[0],o=r[1];return Object(a.useEffect)((function(){var e=function(){var e=window.navigator.userAgent,t=window.navigator.platform;return["Macintosh","MacIntel","MacPPC","Mac68K"].includes(t)?sa.macOS:["iPhone","iPad","iPod"].includes(t)?sa.iOS:["Win32","Win64","Windows","WinCE"].includes(t)?sa.Windows:/Android/.test(e)?sa.Android:/Linux/.test(t)?sa.Linux:null}();o(function(e){return Object.keys(la).includes(e)}(e)?e:la.Linux)}),[]),Object(p.jsx)(ja.Provider,{value:{platform:c,setPlatform:o},children:t})}function pa(e){var t=Object(a.useContext)(ja),n=t.platform,r=t.setPlatform;return Object(p.jsx)(ia,{index:n,indexChanged:r,values:[{label:"Linux",component:Object(p.jsx)(da,{showLineNumbers:e.showLineNumbers,language:"bash",code:e.linux})},{label:"macOS",component:Object(p.jsx)(da,{showLineNumbers:e.showLineNumbers,language:"bash",code:e.mac})}]})}function Oa(e){var t=e.isOk,n=e.size,a=e.className,r=n||"1rem";return e.isLoading?Object(p.jsx)(te.a,{size:r,className:a}):Object(p.jsx)("span",{className:a,style:{backgroundColor:t?"#1de600":"#ff3a52",height:r,width:r,borderRadius:"50%",display:"inline-block"}})}function ma(){var e=Object(a.useContext)(K),t=e.status,n=e.isLoading,r=Object(a.useContext)(V),c=r.setDebugApiUrl,o=r.apiDebugUrl,i=t.debugApiConnection;return Object(p.jsxs)(ye,{label:Object(p.jsxs)(p.Fragment,{children:[Object(p.jsx)(Oa,{isOk:i,isLoading:n})," Connection to Bee Debug API"]}),children:[Object(p.jsx)(mt,{children:i?"The connection to the Bee nodes debug API has been successful":"We cannot connect to your nodes debug API. Please check the following to troubleshoot your issue."}),Object(p.jsx)(gt,{label:"Bee Debug API",value:o,onConfirm:c}),!i&&Object(p.jsx)(ye,{level:1,label:"Troubleshoot",children:Object(p.jsx)(Ce,{label:Object(p.jsxs)("ol",{children:[Object(p.jsx)("li",{children:"Check the status of your node by running the below command to see if your node is running."}),Object(p.jsx)(pa,{showLineNumbers:!0,linux:"sudo systemctl status bee",mac:"brew services list"}),Object(p.jsx)("li",{children:"If your node is running, check your firewall settings to make sure that port 1635 (or your custom specified port) is bound to localhost. If your node is not running try executing the below command to start your bee node"}),Object(p.jsx)(g.a,{style:{marginTop:"10px",marginBottom:"10px"},elevation:6,variant:"filled",severity:"error",children:'Your debug node API should never be completely open to the internet. If you want to connect remotely, make sure your firewall settings are set to only allow specific trusted IP addresses and block all other ports. A simple google search for "what is my ip" will show you your computers public IP address to allow.'}),Object(p.jsx)(pa,{showLineNumbers:!0,linux:"sudo systemctl start bee",mac:"brew services start swarm-bee"}),Object(p.jsx)("li",{children:"Run the commands to validate your node is running and see the log output."}),Object(p.jsx)(pa,{showLineNumbers:!0,linux:"sudo systemctl status bee \njournalctl --lines=100 --follow --unit bee",mac:"brew services list \ntail -f /usr/local/var/log/swarm-bee/bee.log"}),Object(p.jsxs)("li",{children:["Lastly, check your nodes configuration settings to validate the debug API is enabled and the Cross Origin Resource Sharing (CORS) setting is configured to allow your host. Config parameter"," ",Object(p.jsx)("strong",{children:"debug-api-enable"})," must be set to ",Object(p.jsx)("strong",{children:"true"})," and"," ",Object(p.jsx)("strong",{children:"cors-allowed-origins"})," must be set to your host domain or IP (you can also use the wildcard ",Object(p.jsx)("code",{children:"cors-allowed-origins: ['*']"}),"). If edits are made to the configuration run the restart command below for changes to take effect."]}),Object(p.jsx)(pa,{showLineNumbers:!0,linux:"sudo vi /etc/bee/bee.yaml\nsudo systemctl restart bee",mac:"sudo vi /usr/local/etc/swarm-bee/bee.yaml \nbrew services restart swarm-bee"})]})})})]})}function xa(){var e=Object(a.useContext)(V),t=e.setApiUrl,n=e.apiUrl,r=Object(a.useContext)(K),c=r.status,o=r.isLoading,i=c.apiConnection;return Object(p.jsxs)(ye,{label:Object(p.jsxs)(p.Fragment,{children:[Object(p.jsx)(Oa,{isOk:i,isLoading:o})," Connection to Bee API"]}),children:[Object(p.jsx)(mt,{children:i?"The connection to the Bee nodes API has been successful":"Could not connect to your Bee nodes API. Please check the troubleshoot below on how you may resolve it."}),Object(p.jsx)(gt,{label:"Bee API",value:n,onConfirm:t}),!i&&Object(p.jsx)(ye,{level:1,label:"Troubleshoot",children:Object(p.jsx)(Ce,{label:Object(p.jsxs)("ol",{children:[Object(p.jsx)("li",{children:"Check the status of your node by running the below command to see if your node is running."}),Object(p.jsx)(pa,{showLineNumbers:!0,linux:"sudo systemctl status bee",mac:"brew services list"}),Object(p.jsx)("li",{children:"If your node is running, check your firewall settings to make sure that port 1633 (or your custom specified port) is exposed to the internet. If your node is not running try executing the below command to start your bee node"}),Object(p.jsx)(pa,{showLineNumbers:!0,linux:"sudo systemctl start bee",mac:"brew services start swarm-bee"}),Object(p.jsx)("li",{children:"Run the commands to validate your node is running and see the log output."}),Object(p.jsx)(pa,{showLineNumbers:!0,linux:"sudo systemctl status bee \njournalctl --lines=100 --follow --unit bee",mac:"brew services list \ntail -f /usr/local/var/log/swarm-bee/bee.log"})]})})})]})}function fa(){var e=Object(a.useContext)(K),t=e.status,n=e.isLoading,r=e.latestUserVersion,c=e.latestPublishedVersion,o=e.latestBeeVersionUrl,i=t.version;return Object(p.jsxs)(ye,{label:Object(p.jsxs)(p.Fragment,{children:[Object(p.jsx)(Oa,{isOk:i,isLoading:n})," Bee Version"]}),children:[Object(p.jsx)(mt,{children:i?"You are running the latest version of Bee.":Object(p.jsxs)(p.Fragment,{children:["Your Bee version is out of date. Please update to the"," ",Object(p.jsx)("a",{href:o,rel:"noreferrer",target:"_blank",children:"latest"})," ","before continuing. Rerun the installation script below to upgrade. For more information please see the"," ",Object(p.jsx)("a",{href:"https://docs.ethswarm.org/docs/installation/manual#upgrading-bee",rel:"noreferrer",target:"_blank",children:"Docs"}),".",Object(p.jsx)(pa,{showLineNumbers:!0,linux:"bee version\nwget https://github.com/ethersphere/bee/releases/download/".concat(c,"/bee_").concat(c,"_amd64.deb\nsudo dpkg -i bee_").concat(c,"_amd64.deb"),mac:"bee version\nbrew tap ethersphere/tap\nbrew install swarm-bee\nbrew services start swarm-bee"})]})}),Object(p.jsx)(Ce,{label:"Your Version",value:r||"-"}),Object(p.jsx)(Ce,{label:"Latest Version",value:c||"-"})]})}function ga(){var e=Object(a.useContext)(K),t=e.status,n=e.isLoading,r=e.nodeAddresses,c=t.blockchainConnection;return Object(p.jsxs)(ye,{label:Object(p.jsxs)(p.Fragment,{children:[Object(p.jsx)(Oa,{isOk:c,isLoading:n})," Connection to Blockchain"]}),children:[Object(p.jsx)(mt,{children:c?"Your node is connected to the xDai blockchain":Object(p.jsxs)(p.Fragment,{children:["Your Bee node must have access to the xDai blockchain, so that it can interact and deploy your chequebook contract. You can run"," ",Object(p.jsx)("a",{href:"https://www.xdaichain.com/",rel:"noreferrer",target:"_blank",children:"your own xDai node"}),", or use a provider instead - we recommend"," ",Object(p.jsx)("a",{href:"https://getblock.io/",rel:"noreferrer",target:"_blank",children:"Getblock"}),". By default, Bee expects a local node at http://localhost:8545. To use a provider instead, simply change the ",Object(p.jsx)("strong",{children:"swap-endpoint"})," in your configuration file."]})}),(null===r||void 0===r?void 0:r.ethereum)&&Object(p.jsx)(Ie,{label:"Ethereum Address",value:null===r||void 0===r?void 0:r.ethereum})]})}var va,ya=function(){var e=Object(a.useContext)(K),t=e.status,n=e.isLoading,r=e.chequebookAddress,c=t.chequebook;return Object(p.jsxs)(ye,{label:Object(p.jsxs)(p.Fragment,{children:[Object(p.jsx)(Oa,{isOk:c,isLoading:n})," Chequebook Deployment & Funding"]}),children:[Object(p.jsx)(mt,{children:c?"Your chequebook is deployed and funded":Object(p.jsxs)(p.Fragment,{children:["Your chequebook is either not deployed or funded. To run the node you will need xDAI and xBZZ on the xDai network. You may need to aquire BZZ (e.g. ",Object(p.jsx)("a",{href:"https://bzz.exchange/",children:"bzz.exchange"}),") and bridge it to the xDai network through the ",Object(p.jsx)("a",{href:"https://omni.xdaichain.com/bridge",children:"omni bridge"}),". To pay the transaction fees, you will also need xDAI token. You can purchase DAI on the network and bridge it to xDai network through the ",Object(p.jsx)("a",{href:"https://bridge.xdaichain.com/",children:"xDai Bridge"}),". See the"," ",Object(p.jsx)("a",{href:"https://www.xdaichain.com/#xdai-stable-chain",children:"official xDai website"})," for more information."]})}),r&&Object(p.jsxs)(p.Fragment,{children:[Object(p.jsx)(Ie,{label:"Chequebook Address",value:r.chequebookAddress}),Object(p.jsx)(Ae,{children:Object(p.jsx)(lt,{})})]})]})};function wa(){var e=Object(a.useContext)(K),t=e.status,n=e.isLoading,r=e.topology,c=t.topology;return Object(p.jsxs)(ye,{label:Object(p.jsxs)(p.Fragment,{children:[Object(p.jsx)(Oa,{isOk:c,isLoading:n})," Connection to Peers"]}),children:[Object(p.jsx)(mt,{children:c?"You are connected to other Bee nodes":"Your node is not connected to any peers. Please wait a bit if you just started the node, otherwise review your configuration file."}),Object(p.jsx)(Kn,{topology:r})]})}function ka(){return Object(p.jsxs)("div",{children:[Object(p.jsx)(ma,{}),Object(p.jsx)(fa,{}),Object(p.jsx)(ga,{}),Object(p.jsx)(ya,{}),Object(p.jsx)(xa,{}),Object(p.jsx)(wa,{})]})}!function(e){e.INFO="/",e.FILES="/files",e.UPLOAD="/files/upload",e.UPLOAD_IN_PROGRESS="/files/upload/workflow",e.DOWNLOAD="/files/download",e.HASH="/files/hash/:hash",e.ACCOUNTING="/accounting",e.SETTINGS="/settings",e.STAMPS="/stamps",e.STATUS="/status"}(va||(va={}));var Sa=function(){return Object(p.jsxs)(pe.c,{children:[Object(p.jsx)(pe.a,{exact:!0,path:va.UPLOAD_IN_PROGRESS,component:Un}),Object(p.jsx)(pe.a,{exact:!0,path:va.UPLOAD,component:Hn}),Object(p.jsx)(pe.a,{exact:!0,path:va.DOWNLOAD,component:It}),Object(p.jsx)(pe.a,{exact:!0,path:va.HASH,component:sn}),Object(p.jsx)(pe.a,{exact:!0,path:va.ACCOUNTING,component:ut}),Object(p.jsx)(pe.a,{exact:!0,path:va.SETTINGS,component:Xn}),Object(p.jsx)(pe.a,{exact:!0,path:va.STAMPS,component:na}),Object(p.jsx)(pe.a,{exact:!0,path:va.STATUS,component:ka}),Object(p.jsx)(pe.a,{path:va.INFO,component:Jn})]})},Ca=n(6),Ba=n(620),Aa=Object(Ca.a)((function(e){return{root:{paddingLeft:e.spacing(4),paddingRight:e.spacing(4),borderLeft:"4px solid rgba(0,0,0,0)","&.Mui-selected, &.Mui-selected:hover":{borderLeft:"4px solid ".concat(e.palette.primary.main),backgroundColor:"#2c2c2c",color:"#f9f9f9"}},button:{"&:hover":{backgroundColor:"#2c2c2c",color:"#f9f9f9","@media (hover: none)":{backgroundColor:"#2c2c2c",color:"#f9f9f9"}}}}}))(Oe.a),Na=Object(x.a)((function(e){return Object(f.a)({icon:{color:"inherit"},activeIcon:{color:e.palette.primary.main}})}));function La(e){var t=e.iconStart,n=e.iconEnd,a=e.path,r=e.label,c=Na(),o=Object(pe.g)(),i=Boolean(Object(pe.e)(o.pathname,{path:a,exact:!0}));return Object(p.jsxs)(Aa,{button:!0,selected:i,disableRipple:!0,children:[Object(p.jsx)(Ba.a,{className:i?c.activeIcon:c.icon,children:t}),Object(p.jsx)(me.a,{primary:r}),Object(p.jsx)(Ba.a,{className:i?c.activeIcon:c.icon,children:n})]})}var Ta=n(621),Da=Object(x.a)((function(e){return Object(f.a)({icon:{color:"inherit"},iconSmall:{height:e.spacing(2)},root:{height:e.spacing(4),paddingLeft:e.spacing(1),paddingRight:e.spacing(4),color:"#f9f9f9",borderLeft:"0px solid rgba(0,0,0,0)","&.Mui-selected, &.Mui-selected:hover":{borderLeft:"0px solid ".concat(e.palette.primary.main),backgroundColor:"#2c2c2c"}},rootError:{backgroundColor:"rgba(255, 58, 82, 0.25)"},button:{"&:hover":{backgroundColor:"#2c2c2c",color:"white","@media (hover: none)":{backgroundColor:"#2c2c2c",color:"white"}}},smallerText:{fontSize:"0.9rem"}})}));function Pa(e){var t=e.path,n=Object(a.useContext)(K),r=n.status,c=n.isLoading,o=Da(),i=Object(pe.g)(),s=Boolean(Object(pe.e)(i.pathname,{path:t,exact:!0}));return Object(p.jsxs)(Oe.a,{button:!0,classes:{root:"".concat(o.root," ").concat(r.all?"":o.rootError),button:o.button},selected:s,disableRipple:!0,children:[Object(p.jsx)(Ba.a,{style:{marginLeft:"30px"},children:Object(p.jsx)(Oa,{isOk:r.all,isLoading:c})}),Object(p.jsx)(me.a,{primary:Object(p.jsx)(xe.a,{className:o.smallerText,children:"Node ".concat(r.all?"OK":"Error")})}),Object(p.jsx)(Ba.a,{className:o.icon,children:r.all?null:Object(p.jsx)(Ta.a,{className:o.iconSmall})})]})}var Ia=[{label:"Info",path:va.INFO,icon:se.a},{label:"Files",path:va.UPLOAD,icon:le.a},{label:"Stamps",path:va.STAMPS,icon:ue.a},{label:"Accounting",path:va.ACCOUNTING,icon:de.a},{label:"Settings",path:va.SETTINGS,icon:be.a}],Ea=Object(x.a)((function(e){return Object(f.a)({root:{flexWrap:"nowrap",minHeight:"100vh",paddingTop:e.spacing(8),paddingBottom:e.spacing(8)},drawer:{width:300,flexShrink:0},drawerPaper:{width:300,backgroundColor:"#212121"},logo:{marginLeft:e.spacing(8),marginRight:e.spacing(8)},icon:{height:e.spacing(4)},iconSmall:{height:e.spacing(2)},divider:{backgroundColor:"#2c2c2c",marginLeft:e.spacing(4),marginRight:e.spacing(4)},link:{color:"#9f9f9f",textDecoration:"none","&:hover":{textDecoration:"none","@media (hover: none)":{textDecoration:"none"}}}})}));function Ua(){var e=Ea();return Object(p.jsx)(ne.a,{className:e.drawer,variant:"permanent",anchor:"left",classes:{paper:e.drawerPaper},children:Object(p.jsxs)(ae.a,{container:!0,direction:"column",justifyContent:"space-between",className:e.root,children:[Object(p.jsx)(ae.a,{className:e.logo,children:Object(p.jsx)(u.b,{to:va.INFO,children:Object(p.jsx)("img",{alt:"swarm",src:he})})}),Object(p.jsxs)(ae.a,{children:[Object(p.jsx)(re.a,{children:Ia.map((function(t){return Object(p.jsx)(u.b,{to:t.path,className:e.link,children:Object(p.jsx)(La,{iconStart:Object(p.jsx)(t.icon,{className:e.icon}),path:t.path,label:t.label},t.path)},t.path)}))}),Object(p.jsx)(ce.a,{className:e.divider}),Object(p.jsx)(re.a,{children:Object(p.jsx)(oe.a,{href:"https://docs.ethswarm.org/docs/",target:"_blank",className:e.link,children:Object(p.jsx)(La,{iconStart:Object(p.jsx)(je.a,{className:e.icon}),iconEnd:Object(p.jsx)(ie.a,{className:e.iconSmall}),label:Object(p.jsx)("span",{children:"Docs"})})})})]}),Object(p.jsx)(ae.a,{children:Object(p.jsx)(u.b,{to:va.STATUS,className:e.link,children:Object(p.jsx)(Pa,{path:va.STATUS})})})]})})}var Ra,Fa=Object(x.a)((function(e){return Object(f.a)({content:{backgroundColor:e.palette.background.default,minHeight:"100vh"}})})),Wa=function(e){var t=Fa(),n=Object(a.useContext)(K).isLoading;return Object(p.jsxs)("div",{style:{display:"flex"},children:[Object(p.jsx)(Ua,{}),Object(p.jsx)(ee.a,{className:t.content,children:Object(p.jsx)(O,{children:Object(p.jsxs)(p.Fragment,{children:[Object(p.jsx)(Q,{}),n?Object(p.jsx)("div",{style:{textAlign:"center",width:"100%"},children:Object(p.jsx)(te.a,{})}):e.children]})})})]})},_a=n(214),za=n(131),Ma=Object(_a.a)({palette:{type:"light",background:{default:"#efefef"},primary:{light:"#fcf2e8",main:"#dd7700",dark:za.a[800]},secondary:{main:"#333333"}},typography:{fontFamily:["Work Sans","Montserrat","Nunito","Roboto",'"Helvetica Neue"',"Arial","sans-serif"].join(","),h1:{fontSize:"1.3rem",fontWeight:500},h2:{fontSize:"1rem",fontWeight:500},h3:{fontSize:"0.8rem",fontWeight:500},body2:{fontFamily:'"IBM Plex Mono", monospace',fontWeight:500,fontSize:"1rem"}}});Ma.overrides={MuiListItem:{button:{"&:hover":{backgroundColor:"#fcf2e8",color:(Ra=Ma).palette.primary.main,"@media (hover: none)":{backgroundColor:"#fcf2e8",color:Ra.palette.primary.main}}}},MuiContainer:{root:{padding:Ra.spacing(8)},maxWidthXs:{padding:Ra.spacing(8)},maxWidthSm:{padding:Ra.spacing(8)},maxWidthMd:{padding:Ra.spacing(8)},maxWidthLg:{padding:Ra.spacing(8)},maxWidthXl:{padding:Ra.spacing(8)}},MuiButton:{startIcon:{marginLeft:Ra.spacing(1)},endIcon:{marginRight:Ra.spacing(1)},outlined:{border:"none",borderRadius:Ra.spacing(10),color:Ra.palette.primary.main,backgroundColor:"#fcf2e8"},outlinedSizeSmall:{padding:Ra.spacing(1),paddingLeft:Ra.spacing(2),paddingRight:Ra.spacing(2),boxShadow:"none","&:hover":{backgroundColor:Ra.palette.primary.main,color:"white",boxShadow:"none","@media (hover: none)":{backgroundColor:Ra.palette.primary.main,color:"white",boxShadow:"none"}}},outlinedSizeLarge:{padding:Ra.spacing(4),borderRadius:0,boxShadow:"none","&:hover":{backgroundColor:Ra.palette.primary.main,color:"white",boxShadow:"none","@media (hover: none)":{backgroundColor:Ra.palette.primary.main,color:"white",boxShadow:"none"}}},containedSizeLarge:{padding:Ra.spacing(4),borderRadius:0,boxShadow:"none","&:hover":{backgroundColor:Ra.palette.primary.main,color:"white",boxShadow:"none","@media (hover: none)":{backgroundColor:Ra.palette.primary.main,color:"white",boxShadow:"none"}}},containedSizeSmall:{padding:Ra.spacing(1),paddingLeft:Ra.spacing(2),paddingRight:Ra.spacing(2),borderRadius:0,boxShadow:"none","&:hover":{backgroundColor:Ra.palette.primary.main,color:"white",boxShadow:"none","@media (hover: none)":{backgroundColor:Ra.palette.primary.main,color:"white",boxShadow:"none"}}},contained:{padding:Ra.spacing(2),backgroundColor:"white",boxShadow:"none",borderRadius:0,"&:hover":{backgroundColor:Ra.palette.primary.main,color:"white",boxShadow:"none","@media (hover: none)":{backgroundColor:Ra.palette.primary.main,color:"white",boxShadow:"none"}},"&:focus":{backgroundColor:Ra.palette.primary.main,color:"white"},"&:active":{backgroundColor:Ra.palette.primary.main,color:"white"},"&:disabled":{backgroundColor:"white"}}},MuiTab:{root:{backgroundColor:Ra.palette.background.paper,"&:hover":{backgroundColor:"#fcf2e8",color:Ra.palette.primary.main,opacity:1},"&$selected":{fontWeight:Ra.typography.fontWeightMedium}},textColorInherit:{opacity:.5}},MuiTabs:{root:{borderBottom:"none"},indicator:{backgroundColor:"transparent"}}},Ma.props={MuiTab:{disableRipple:!0},MuiButtonBase:{disableRipple:!0}};var Ha=function(){return Object(p.jsx)("div",{className:"App",children:Object(p.jsx)(s.a,{theme:Ma,children:Object(p.jsx)(Y,{children:Object(p.jsx)(X,{children:Object(p.jsx)(xn,{children:Object(p.jsx)(hn,{children:Object(p.jsx)(ha,{children:Object(p.jsx)(l.a,{children:Object(p.jsx)(u.a,{children:Object(p.jsxs)(p.Fragment,{children:[Object(p.jsx)(i.a,{}),Object(p.jsx)(Wa,{children:Object(p.jsx)(Sa,{})})]})})})})})})})})})})},qa=function(e){e&&e instanceof Function&&n.e(3).then(n.bind(null,639)).then((function(t){var n=t.getCLS,a=t.getFID,r=t.getFCP,c=t.getLCP,o=t.getTTFB;n(e),a(e),r(e),c(e),o(e)}))};o.a.render(Object(p.jsx)(r.a.StrictMode,{children:Object(p.jsx)(Ha,{})}),document.getElementById("root")),qa()}},[[529,1,2]]]);
|
|
2
|
-
//# sourceMappingURL=main.f316c903.chunk.js.map
|