diff --git a/src/server.js b/src/server.js index 37435a0..72279e1 100644 --- a/src/server.js +++ b/src/server.js @@ -13,7 +13,7 @@ function runServer() { const app = new Koa() app.use(serve('static')) app.use(async (context, next) => { - context.set('Access-Control-Allow-Origin', `*`) + context.set('Access-Control-Allow-Origin', '*') context.set('Access-Control-Allow-Credentials', 'true') context.set( 'Access-Control-Allow-Headers', diff --git a/static/dashboard/asset-manifest.json b/static/dashboard/asset-manifest.json index ff300a4..7ba08ce 100644 --- a/static/dashboard/asset-manifest.json +++ b/static/dashboard/asset-manifest.json @@ -1,8 +1,8 @@ { "files": { "main.css": "./static/css/main.59b0af6f.chunk.css", - "main.js": "./static/js/main.9569b243.chunk.js", - "main.js.map": "./static/js/main.9569b243.chunk.js.map", + "main.js": "./static/js/main.8fd2d334.chunk.js", + "main.js.map": "./static/js/main.8fd2d334.chunk.js.map", "runtime-main.js": "./static/js/runtime-main.418312b1.js", "runtime-main.js.map": "./static/js/runtime-main.418312b1.js.map", "static/js/2.917f37fb.chunk.js": "./static/js/2.917f37fb.chunk.js", @@ -19,6 +19,6 @@ "static/js/runtime-main.418312b1.js", "static/js/2.917f37fb.chunk.js", "static/css/main.59b0af6f.chunk.css", - "static/js/main.9569b243.chunk.js" + "static/js/main.8fd2d334.chunk.js" ] } \ No newline at end of file diff --git a/static/dashboard/index.html b/static/dashboard/index.html index c10690f..17a3118 100644 --- a/static/dashboard/index.html +++ b/static/dashboard/index.html @@ -1 +1 @@ -Bee Dashboard
\ No newline at end of file +Bee Dashboard
\ No newline at end of file diff --git a/static/dashboard/static/js/main.8fd2d334.chunk.js b/static/dashboard/static/js/main.8fd2d334.chunk.js new file mode 100644 index 0000000..f7062d1 --- /dev/null +++ b/static/dashboard/static/js/main.8fd2d334.chunk.js @@ -0,0 +1,2 @@ +(this["webpackJsonp@ethersphere/bee-dashboard"]=this["webpackJsonp@ethersphere/bee-dashboard"]||[]).push([[0],{25:function(e,t,n){"use strict";n.d(t,"f",(function(){return s})),n.d(t,"g",(function(){return l})),n.d(t,"k",(function(){return b})),n.d(t,"h",(function(){return j})),n.d(t,"d",(function(){return h})),n.d(t,"l",(function(){return p})),n.d(t,"e",(function(){return O})),n.d(t,"i",(function(){return f})),n.d(t,"c",(function(){return x})),n.d(t,"b",(function(){return m})),n.d(t,"a",(function(){return g})),n.d(t,"j",(function(){return v}));var a=n(9),r=n.n(a),c=n(19),i=n(38),o=n(31);function s(e){return i.BigNumber.isBigNumber(e)&&e.isInteger()||"bigint"===typeof e}function l(e){if(i.BigNumber.isBigNumber(e))return e;if("string"===typeof e)return new i.BigNumber(e);if("bigint"===typeof e)return new i.BigNumber(e.toString());if("number"===typeof e)return new i.BigNumber(e);throw new TypeError("Not a BigNumber or BigNumber convertible value. Type: ".concat(typeof e," value: ").concat(e))}function u(e){return d.apply(this,arguments)}function d(){return(d=Object(c.a)(r.a.mark((function e(t){return r.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)}function b(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"}))}}function j(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(c.a)(r.a.mark((function a(c,i){var o,s;return r.a.wrap((function(a){for(;;)switch(a.prev=a.next){case 0:o=0;case 1:if(!(o>t/4).toString(16)}))}function O(e){return(e.charAt(0).toUpperCase()+e.slice(1).toLowerCase()).replaceAll("_"," ")}function f(e){var t=e;return t<120?"".concat(e," seconds"):(t/=60)<120?"".concat(Math.round(t)," minutes"):(t/=60)<48?"".concat(Math.round(t)," hours"):(t/=24)<14?"".concat(Math.round(t)," days"):(t/=7)<52?"".concat(Math.round(t)," weeks"):"".concat((t/=52).toFixed(1)," years")}function x(e){return 4096*Math.pow(2,e)}function m(e,t){return 5*e/t}function g(e,t){return new o.a(t*BigInt(Math.pow(2,e)))}function v(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:20,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"[\u2026]";return e.length<=2*t+n.length?e:"".concat(e.slice(0,t)).concat(n).concat(e.slice(-t))}},31:function(e,t,n){"use strict";n.d(t,"a",(function(){return s}));var a=n(113),r=n(170),c=n(38),i=n(25),o=[18,17,16,15,14,13,12,11,10,9,8,7,6,5,4,3,2,1,0],s=function(){function e(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:16;Object(a.a)(this,e),this.amount=void 0,this.decimals=void 0;var r=Object(i.g)(t);if(!Object(i.f)(r)||!o.includes(n))throw new TypeError("Not a valid token values");this.amount=r,this.decimals=n}return Object(r.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 c.BigNumber(this.amount)}},{key:"toDecimal",get:function(){return this.amount.dividedBy(new c.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:"toSignificantDigits",value:function(){for(var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:4,t=this.toDecimal.toFixed(16),n=-1,a=!1,r=0;r1&&void 0!==arguments[1]?arguments[1]:16,a=Object(i.g)(t),r=a.multipliedBy(new c.BigNumber(10).pow(n));return new e(r,n)}}]),e}()},333:function(e){e.exports=JSON.parse('{"a":{"node":">=12.0.0","npm":">=6.0.0","bee":">=0.6.0"}}')},383:function(e,t,n){},388:function(e,t,n){},40:function(e,t,n){"use strict";(function(e){n.d(t,"b",(function(){return l})),n.d(t,"e",(function(){return u})),n.d(t,"d",(function(){return d})),n.d(t,"a",(function(){return b})),n.d(t,"c",(function(){return h})),n.d(t,"f",(function(){return m}));var a=n(9),r=n.n(a),c=n(19),i=n(115),o=n.n(i),s=n(25);function l(){var t=new Uint8Array(32);return crypto.getRandomValues(t),new o.a(e.from(t))}function u(e,t){var n=e.findIndex((function(e){return e.uuid===t.uuid}));-1!==n&&e.splice(n,1),e.unshift(t),localStorage.setItem("feeds",JSON.stringify(e))}function d(e){localStorage.setItem("feeds",JSON.stringify(e))}function b(e,t,n,a){return j.apply(this,arguments)}function j(){return(j=Object(c.a)(r.a.mark((function e(t,n,a,c){var i;return r.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if("V3"!==n||c){e.next=2;break}throw Error("V3 passwords require password");case 2:if("PRIVATE_KEY"!==n){e.next=6;break}e.t0=t.getPrivateKeyString(),e.next=9;break;case 6:return e.next=8,t.toV3String(c);case 8:e.t0=e.sent;case 9:return i=e.t0,e.abrupt("return",{uuid:Object(s.l)(),name:a,type:c?"V3":"PRIVATE_KEY",address:t.getAddressString(),identity:i});case 11:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function h(e,t){return p.apply(this,arguments)}function p(){return(p=Object(c.a)(r.a.mark((function e(t,n){var a,c,i,o;return r.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(64!==n.length){e.next=5;break}return e.next=3,f("PRIVATE_KEY",n);case 3:return a=e.sent,e.abrupt("return",{uuid:Object(s.l)(),name:t,type:"PRIVATE_KEY",identity:n,address:a.getAddressString()});case 5:if(66!==n.length||!n.toLowerCase().startsWith("0x")){e.next=10;break}return e.next=8,f("PRIVATE_KEY",n.slice(2));case 8:return c=e.sent,e.abrupt("return",{uuid:Object(s.l)(),name:t,type:"PRIVATE_KEY",identity:n,address:c.getAddressString()});case 10:return e.prev=10,i=JSON.parse(n),o=i.address,e.abrupt("return",{uuid:Object(s.l)(),name:t,type:"V3",identity:n,address:o});case 15:return e.prev=15,e.t0=e.catch(10),e.abrupt("return",null);case 18:case"end":return e.stop()}}),e,null,[[10,15]])})))).apply(this,arguments)}function O(e,t){return f(e.type,e.identity,t)}function f(e,t,n){return x.apply(this,arguments)}function x(){return(x=Object(c.a)(r.a.mark((function t(n,a,c){return r.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if("PRIVATE_KEY"!==n){t.next=4;break}t.t0=o.a.fromPrivateKey(e.from(v(a),"hex")),t.next=7;break;case 4:return t.next=6,o.a.fromV3(a,c);case 6:t.t0=t.sent;case 7:return t.abrupt("return",t.t0);case 8:case"end":return t.stop()}}),t)})))).apply(this,arguments)}function m(e,t,n,a,r){return g.apply(this,arguments)}function g(){return(g=Object(c.a)(r.a.mark((function e(t,n,a,c,i){var o,s;return r.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,O(n,i);case 2:if(o=e.sent,n.feedHash){e.next=7;break}return e.next=6,t.createFeedManifest(c,"sequence","00".repeat(32),o.getAddressString());case 6:n.feedHash=e.sent;case 7:return s=t.makeFeedWriter("sequence","00".repeat(32),o.getPrivateKeyString()),e.next=10,s.upload(c,a);case 10:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function v(e){return e.toLowerCase().startsWith("0x")?e.slice(2):e}}).call(this,n(17).Buffer)},457:function(e,t){},459:function(e,t){},46:function(e,t,n){"use strict";(function(e){n.d(t,"a",(function(){return c}));var a=n(113);function r(t){return"object"===typeof e&&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"})[t]}var c=new function e(){Object(a.a)(this,e),this.BEE_API_HOST=void 0,this.BEE_DEBUG_API_HOST=void 0,this.BLOCKCHAIN_EXPLORER_URL=void 0,this.BEE_DOCS_HOST=void 0,this.BEE_DISCORD_HOST=void 0,this.GITHUB_REPO_URL=void 0,this.BEE_API_HOST=sessionStorage.getItem("api_host")||r("REACT_APP_BEE_HOST")||"http://localhost:1633",this.BEE_DEBUG_API_HOST=sessionStorage.getItem("debug_api_host")||r("REACT_APP_BEE_DEBUG_HOST")||"http://localhost:1635",this.BLOCKCHAIN_EXPLORER_URL=r("REACT_APP_BLOCKCHAIN_EXPLORER_URL")||"https://blockscout.com/xdai/mainnet",this.BEE_DOCS_HOST=r("REACT_APP_BEE_DOCS_HOST")||"https://docs.ethswarm.org/docs/",this.BEE_DISCORD_HOST=r("REACT_APP_BEE_DISCORD_HOST")||"https://discord.gg/eKr9XPv7",this.GITHUB_REPO_URL=r("REACT_APP_BEE_GITHUB_REPO_URL")||"https://api.github.com/repos/ethersphere/bee"};t.b=c}).call(this,n(21))},471:function(e,t){},473:function(e,t){},499:function(e,t){},500:function(e,t){},505:function(e,t){},507:function(e,t){},514:function(e,t){},532:function(e,t){},548:function(e,t){},553:function(e,t){},561:function(e,t){},563:function(e,t){},802:function(e,t,n){"use strict";n.r(t);var a=n(0),r=n.n(a),c=n(20),i=n.n(c),o=(n(383),n(911)),s=n(910),l=n(22),u=n(35),d=(n(388),n(113)),b=n(170),j=n(354),h=n(353),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),f=n(6),x=n(807),m=n(363),g=n(914),v=n(851),y=n(806),w=n(850),S=n(171),k=n.n(S),C=n(9),E=n.n(C),A=n(19),P=n(37),T=n(132),B=n.n(T),N=n(333),D=n(334),I=n.n(D),_=n(46),L=n(31),U=n(72),R={apiUrl:_.a.BEE_API_HOST,apiDebugUrl:_.a.BEE_DEBUG_API_HOST,beeApi:null,beeDebugApi:null,setApiUrl:function(){},setDebugApiUrl:function(){},lockedApiSettings:!1},F=Object(a.createContext)(R);F.Consumer;function W(e){var t=e.children,n=e.beeApiUrl,r=e.beeDebugApiUrl,c=e.lockedApiSettings,i=Object(a.useState)(R.apiUrl),o=Object(f.a)(i,2),s=o[0],l=o[1],u=Object(a.useState)(R.apiDebugUrl),d=Object(f.a)(u,2),b=d[0],j=d[1],h=Object(a.useState)(null),O=Object(f.a)(h,2),x=O[0],m=O[1],g=Object(a.useState)(null),v=Object(f.a)(g,2),y=v[0],w=v[1],S=Object(a.useState)(Boolean(c)),k=Object(f.a)(S,1)[0],C=n||s,E=r||b;return Object(a.useEffect)((function(){try{m(new U.Bee(C)),sessionStorage.setItem("api_host",C)}catch(e){m(null)}}),[C]),Object(a.useEffect)((function(){try{w(new U.BeeDebug(E)),sessionStorage.setItem("debug_api_host",E)}catch(e){w(null)}}),[E]),Object(p.jsx)(F.Provider,{value:{apiUrl:C,apiDebugUrl:E,beeApi:x,beeDebugApi:y,setApiUrl:l,setDebugApiUrl:j,lockedApiSettings:k},children:t})}var H=window.location.search.includes("devMode=1"),M={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,nodeInfo:null,topology:null,chequebookAddress:null,peers:null,chequebookBalance:null,peerBalances:null,peerCheques:null,settlements:null,chainState:null,latestBeeRelease:null,isLoading:!0,isRefreshing:!1,lastUpdate:null,start:function(){},stop:function(){},refresh:function(){return Promise.reject()}},V=Object(a.createContext)(M);V.Consumer;function z(e,t,n,a,r,c,i,o){var s,l=H||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)||"dev"===(null===n||void 0===n?void 0:n.beeMode),u={version:Boolean(e&&B.a.satisfies(e.version,N.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:a,topology:Boolean((null===r||void 0===r?void 0:r.connected)&&(null===r||void 0===r?void 0:r.connected)>0)||l,chequebook:Boolean(null===c||void 0===c?void 0:c.chequebookAddress)&&null!==i&&(null===i||void 0===i?void 0:i.totalBalance.toBigNumber.isGreaterThan(0))||l||(s=null===n||void 0===n?void 0:n.beeMode,"ultra-light"===s)};return Object(P.a)(Object(P.a)({},u),{},{all:!o&&Object.values(u).every((function(e){return e}))})}function q(e){var t,n,r=e.children,c=Object(a.useContext)(F),i=c.beeApi,o=c.beeDebugApi,s=Object(a.useState)(!1),l=Object(f.a)(s,2),u=l[0],d=l[1],b=Object(a.useState)(null),j=Object(f.a)(b,2),h=j[0],O=j[1],x=Object(a.useState)(null),m=Object(f.a)(x,2),g=m[0],v=m[1],y=Object(a.useState)(null),w=Object(f.a)(y,2),S=w[0],k=w[1],C=Object(a.useState)(null),P=Object(f.a)(C,2),T=P[0],N=P[1],D=Object(a.useState)(null),U=Object(f.a)(D,2),R=U[0],W=U[1],H=Object(a.useState)(null),q=Object(f.a)(H,2),Y=q[0],G=q[1],Z=Object(a.useState)(null),K=Object(f.a)(Z,2),J=K[0],X=K[1],$=Object(a.useState)(null),Q=Object(f.a)($,2),ee=Q[0],te=Q[1],ne=Object(a.useState)(null),ae=Object(f.a)(ne,2),re=ae[0],ce=ae[1],ie=Object(a.useState)(null),oe=Object(f.a)(ie,2),se=oe[0],le=oe[1],ue=Object(a.useState)(null),de=Object(f.a)(ue,2),be=de[0],je=de[1],he=function(){var e=Object(a.useState)(null),t=Object(f.a)(e,2),n=t[0],r=t[1],c=Object(a.useState)(!1),i=Object(f.a)(c,2),o=i[0],s=i[1],l=Object(a.useState)(null),u=Object(f.a)(l,2),d=u[0],b=u[1];return Object(a.useEffect)((function(){I.a.get("".concat(_.a.GITHUB_REPO_URL,"/releases/latest")).then((function(e){r(e.data)})).catch((function(e){b(e)})).finally((function(){s(!1)}))}),[]),{latestBeeRelease:n,isLoadingLatestBeeRelease:o,error:d}}(),pe=he.latestBeeRelease,Oe=Object(a.useState)(M.error),fe=Object(f.a)(Oe,2),xe=fe[0],me=fe[1],ge=Object(a.useState)(M.isLoading),ve=Object(f.a)(ge,2),ye=ve[0],we=ve[1],Se=Object(a.useState)(M.isRefreshing),ke=Object(f.a)(Se,2),Ce=ke[0],Ee=ke[1],Ae=Object(a.useState)(M.lastUpdate),Pe=Object(f.a)(Ae,2),Te=Pe[0],Be=Pe[1],Ne=Object(a.useState)(3e4),De=Object(f.a)(Ne,2),Ie=De[0],_e=De[1],Le=null===(t=B.a.coerce(null===pe||void 0===pe?void 0:pe.name))||void 0===t?void 0:t.version,Ue=null===(n=B.a.coerce(null===h||void 0===h?void 0:h.version))||void 0===n?void 0:n.version,Re=null===h||void 0===h?void 0:h.version;Object(a.useEffect)((function(){we(!0),d(!1),Fe()}),[i]),Object(a.useEffect)((function(){we(!0),O(null),v(null),N(null),k(null),G(null),W(null),X(null),te(null),ce(null),le(null),je(null),Fe()}),[o]);var Fe=function(){var e=Object(A.a)(E.a.mark((function e(){var t,n,a,r;return E.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!Ce){e.next=2;break}return e.abrupt("return");case 2:if(i&&o){e.next=5;break}return we(!1),e.abrupt("return");case 5:return e.prev=5,Ee(!0),me(null),t=function(){var e=Object(A.a)(E.a.mark((function e(){var t,n,a;return E.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,o.getChequebookBalance();case 2:return t=e.sent,n=t.totalBalance,a=t.availableBalance,e.abrupt("return",{totalBalance:new L.a(n),availableBalance:new L.a(a)});case 6:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),n=function(){var e=Object(A.a)(E.a.mark((function e(){var t,n;return E.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,o.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 L.a(n)}})));case 5:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),a=function(){var e=Object(A.a)(E.a.mark((function e(){var t,n,a,r;return E.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,o.getAllSettlements();case 2:return t=e.sent,n=t.totalReceived,a=t.settlements,r=t.totalSent,e.abrupt("return",{totalReceived:new L.a(n),totalSent:new L.a(r),settlements:a.map((function(e){var t=e.peer,n=e.received,a=e.sent;return{peer:t,received:new L.a(n),sent:new L.a(a)}}))});case 7:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),r=[i.isConnected().then(d).catch((function(){return d(!1)})),o.getHealth().then(O).catch((function(){return O(null)})),o.getNodeAddresses().then(v).catch((function(){return v(null)})),o.getNodeInfo().then(k).catch((function(){return k(null)})),o.getTopology().then(N).catch((function(){return N(null)})),o.getPeers().then(G).catch((function(){return G(null)})),o.getChequebookAddress().then(W).catch((function(){return W(null)})),o.getLastCheques().then(ce).catch((function(){return ce(null)})),o.getChainState().then(je).catch((function(){return je(null)})),t().then(X).catch((function(){return X(null)})),n().then(te).catch((function(){return te(null)})),a().then(le).catch((function(){return le(null)}))],e.next=14,Promise.allSettled(r);case 14:e.next=19;break;case 16:e.prev=16,e.t0=e.catch(5),me(e.t0);case 19:return e.prev=19,we(!1),Ee(!1),Be(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(Fe(),Ie){var e=setInterval(Fe,Ie);return function(){return clearInterval(e)}}}),[Ie,o,i]),Object(p.jsx)(V.Provider,{value:{status:z(h,g,S,u,T,R,J,xe),latestUserVersion:Ue,latestUserVersionExact:Re,latestPublishedVersion:Le,isLatestBeeVersion:Boolean(Le&&Ue&&B.a.satisfies(Le,Ue,{includePrerelease:!0})),latestBeeVersionUrl:(null===pe||void 0===pe?void 0:pe.html_url)||"https://github.com/ethersphere/bee/releases/latest",error:xe,apiHealth:u,debugApiHealth:h,nodeAddresses:g,nodeInfo:S,topology:T,chequebookAddress:R,peers:Y,chequebookBalance:J,peerBalances:ee,peerCheques:re,settlements:se,chainState:be,latestBeeRelease:pe,isLoading:ye,isRefreshing:Ce,lastUpdate:Te,start:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:3e4;return _e(e)},stop:function(){return _e(null)},refresh:Fe},children:r})}var Y=Object(x.a)((function(e){return Object(m.a)({root:{width:"100%",marginBottom:e.spacing(2)}})}));function G(){var e=Y(),t=Object(a.useContext)(V),n=t.isLoading,r=t.latestUserVersionExact,c=Object(a.useState)(!0),i=Object(f.a)(c,2),o=i[0],s=i[1],l=U.SUPPORTED_BEE_VERSION_EXACT===r;return n||!r?null:Object(p.jsx)(y.a,{in:!l&&o,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)(k.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:U.SUPPORTED_BEE_VERSION_EXACT}),"). Please note that some functionality may not work properly."]})})})}var Z=n(869),K=n(870),J=n(907),X=n(855),$=n(880),Q=n(908),ee=n(872),te=n(885),ne=n(903),ae=n(900),re=n(904),ce=n(890),ie=n(898),oe=n(905),se=n(906),le=n(909),ue=n.p+"static/media/logo.3d1155fe.svg",de=n(12),be=n(808),je=n(852),he=n(85),pe=n(853),Oe=n(854),fe=Object(x.a)((function(e){return Object(m.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 xe(e){var t=e.children,n=e.label,r=e.level,c=e.defaultOpen,i=e.info,o=fe(),s=Object(a.useState)(Boolean(c)),l=Object(f.a)(s,2),u=l[0],d=l[1],b="",j="h1",h=o.contentLevel0;return 1===r?(b=o.rootLevel1,j="h2",h=o.contentLevel12):2===r&&(b=o.rootLevel2,j="h3",h=o.contentLevel12),Object(p.jsxs)("div",{className:"".concat(o.root," ").concat(b),children:[Object(p.jsxs)(be.a,{button:!0,onClick:function(){d(!u)},className:o.header,children:[Object(p.jsx)(je.a,{primary:Object(p.jsx)(he.a,{variant:j,children:n})}),Object(p.jsxs)("div",{style:{display:"flex"},children:[!u&&Object(p.jsx)(he.a,{variant:"body2",className:o.infoText,children:i}),u?Object(p.jsx)(pe.a,{}):Object(p.jsx)(Oe.a,{})]})]}),Object(p.jsx)(y.a,{in:u,timeout:"auto",unmountOnExit:!0,children:Object(p.jsx)("div",{className:h,children:t})})]})}var me=n(916),ge=n(858),ve=Object(x.a)((function(e){return Object(m.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 ye(e){var t=e.label,n=e.value,a=e.tooltip,r=ve();return Object(p.jsx)(be.a,{className:r.header,children:Object(p.jsxs)(X.a,{container:!0,direction:"row",justifyContent:"space-between",alignItems:"center",children:[t&&Object(p.jsx)(he.a,{variant:"body1",children:t}),n&&Object(p.jsxs)(he.a,{variant:"body2",children:[n,a&&Object(p.jsx)(me.a,{title:a,placement:"top",arrow:!0,children:Object(p.jsx)(w.a,{size:"small",className:r.copyValue,children:Object(p.jsx)(ge.a,{strokeWidth:1})})})]})]})})}var we=Object(x.a)((function(e){return Object(m.a)({wrapper:{display:"flex",flexDirection:"row",flexWrap:"wrap"},action:{marginBottom:e.spacing(1),marginRight:e.spacing(1)}})}));function Se(e){var t=e.children,n=we();return Array.isArray(t)?Object(p.jsx)("div",{className:n.wrapper,children:t.filter((function(e){return e})).map((function(e,t){return Object(p.jsx)("div",{className:n.action,children:e},t)}))}):Object(p.jsx)(X.a,{container:!0,direction:"row",children:Object(p.jsx)(X.a,{className:n.action,children:t})})}var ke=n(97),Ce=n.n(ke),Ee=n(859),Ae=n(860),Pe=Object(x.a)((function(e){return Object(m.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 Te(e){var t,n=e.label,r=e.value,c=Pe(),i=Object(a.useState)(!1),o=Object(f.a)(i,2),s=o[0],l=o[1],u=Object(a.useState)(!1),d=Object(f.a)(u,2),b=d[0],j=d[1],h=function(){return l(!s)},O=function(){return j(!0)},x=function(){return j(!1)},m=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(m[0]," ").concat(m[1]):m[0],"[\u2026]").concat(m[m.length-1]);return Object(p.jsx)(be.a,{className:"".concat(c.header," ").concat(s?c.headerOpen:""),children:Object(p.jsxs)(X.a,{container:!0,direction:"column",justifyContent:"space-between",alignItems:"stretch",children:[Object(p.jsxs)(X.a,{container:!0,direction:"row",justifyContent:"space-between",alignItems:"center",children:[n&&Object(p.jsx)(he.a,{variant:"body1",children:n}),Object(p.jsx)(he.a,{variant:"body2",children:Object(p.jsxs)("div",{children:[!s&&Object(p.jsx)("span",{className:c.copyValue,children:Object(p.jsx)(me.a,{title:b?"Copied":"Copy",placement:"top",arrow:!0,onClose:x,children:Object(p.jsx)(ke.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)(Ee.a,{onClick:h,strokeWidth:1}):Object(p.jsx)(Ae.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)(me.a,{title:b?"Copied":"Copy",placement:"top",arrow:!0,onClose:x,children:Object(p.jsx)(ke.CopyToClipboard,{text:r,children:Object(p.jsx)("span",{onClick:O,children:Object(p.jsx)("span",{className:c.copyValue,children:m.map((function(e,t){return Object(p.jsx)(he.a,{variant:"body2",className:c.keyMargin,component:"span",children:e},t)}))})})})})})})]})})}var Be=n(865),Ne=n(863),De=n(871),Ie=n(867),_e=n(868),Le=n(864),Ue=n(866),Re=n(336),Fe=n.n(Re),We=n(861);function He(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)(ke.CopyToClipboard,{text:t,children:Object(p.jsx)(We.a,{style:{height:"20px"}})})})})}var Me=n(337),Ve=n.n(Me),ze=n(862);function qe(e){var t=Object(a.useState)(!1),n=Object(f.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)(ze.a,{})}),Object(p.jsx)(Ne.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)(Le.a,{id:"simple-dialog-title",children:e.label}),Object(p.jsx)(Ve.a,{value:e.value,size:150,bgColor:"#ffffff",fgColor:"#000000",level:"L",includeMargin:!1,renderAs:"svg"})]})})]})}function Ye(e){return Object(p.jsx)(he.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)(Fe.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(_.a.BLOCKCHAIN_EXPLORER_URL,"/").concat(e.transaction?"tx":"address","/").concat(e.address),target:"_blank",rel:"noreferrer",children:e.address})}),Object(p.jsx)(qe,{value:e.address,label:"Ethereum Address"}),Object(p.jsx)(He,{value:e.address})]}):"-"})}function Ge(e){var t=e.peerId,n=e.uncashedAmount,r=Object(a.useState)(!1),c=Object(f.a)(r,2),i=c[0],o=c[1],s=Object(a.useState)(!1),u=Object(f.a)(s,2),d=u[0],b=u[1],j=Object(l.b)().enqueueSnackbar,h=Object(a.useContext)(F).beeDebugApi,O=function(){o(!1)};return Object(p.jsxs)("div",{children:[Object(p.jsxs)(Be.a,{variant:"contained",onClick:function(){o(!0)},startIcon:Object(p.jsx)(Ue.a,{size:"1rem"}),children:["Cash out peer ",t.substr(0,8),"[\u2026]"]}),Object(p.jsxs)(Ne.a,{open:i,onClose:O,"aria-labelledby":"form-dialog-title",children:[Object(p.jsx)(Le.a,{id:"form-dialog-title",children:"Cashout Cheque"}),Object(p.jsx)(Ie.a,{children:Object(p.jsxs)(_e.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)(Z.a,{style:{textAlign:"center",padding:"50px"},children:Object(p.jsx)(K.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)(De.a,{children:[Object(p.jsx)(Be.a,{onClick:O,color:"primary",children:"Cancel"}),Object(p.jsx)(Be.a,{onClick:function(){h&&(t?(b(!0),h.cashoutLastCheque(t).then((function(e){o(!1),j(Object(p.jsxs)("span",{children:["Successfully cashed out cheque. Transaction",Object(p.jsx)(Ye,{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 Ze(e){var t=e.accounting,n=e.isLoadingUncashed,a=e.totalUncashed;return Object(p.jsxs)(xe,{label:"Peers (".concat((null===t||void 0===t?void 0:t.length)||0,")"),info:"".concat(a.toFixedDecimal()," BZZ (uncashed)"),children:[Object(p.jsx)(ye,{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,i=e.uncashedAmount,o=e.total;return Object(p.jsxs)(xe,{label:"Peer ".concat(t.substr(0,8),"[\u2026]"),level:1,info:"".concat(i.toFixedDecimal()," BZZ (uncashed)"),children:[Object(p.jsx)(Te,{label:"Peer ID",value:t}),Object(p.jsx)(ye,{label:"Outstanding Balance",value:"".concat(a.toFixedDecimal()," BZZ")}),Object(p.jsx)(ye,{label:"Settlements Sent / Received",value:"-".concat(c.toFixedDecimal()," / ").concat(r.toFixedDecimal()," BZZ")}),Object(p.jsx)(ye,{label:"Total",value:"".concat(o.toFixedDecimal()," BZZ")}),Object(p.jsx)(ye,{label:"Uncashed Amount",value:n?"loading\u2026":"".concat(i.toFixedDecimal()," BZZ")}),i.toBigNumber.isGreaterThan("0")&&Object(p.jsx)(Se,{children:Object(p.jsx)(Ge,{uncashedAmount:i.toFixedDecimal(),peerId:t})})]},t)}))]})}var Ke=n(873),Je=Object(x.a)((function(e){return Object(m.a)({root:{height:"100%"},content:{maxWidth:500,marginBottom:e.spacing(4),"&:last-child":{marginBottom:0}},icon:{height:"1rem"}})}));function Xe(){var e=Je();return Object(p.jsxs)(X.a,{container:!0,direction:"column",justifyContent:"center",alignItems:"center",className:e.root,children:[Object(p.jsx)(X.a,{item:!0,className:e.content,children:Object(p.jsx)(he.a,{variant:"h1",align:"center",children:"Uh oh, it looks like your node is not connected."})}),Object(p.jsx)(X.a,{item:!0,className:e.content,children:Object(p.jsxs)(he.a,{align:"center",children:["Please check your node status to fix the problem. You can also check out the"," ",Object(p.jsx)(ee.a,{href:_.a.BEE_DOCS_HOST,target:"_blank",rel:"noreferrer",children:"Swarm Bee Docs"})," ","or ask for support on the"," ",Object(p.jsx)(ee.a,{href:_.a.BEE_DISCORD_HOST,target:"_blank",rel:"noreferrer",children:"Ethereum Swarm Discord"}),"."]})}),Object(p.jsx)(X.a,{item:!0,className:e.content,children:Object(p.jsx)(he.a,{align:"center",children:Object(p.jsx)(Be.a,{component:u.b,variant:"contained",startIcon:Object(p.jsx)(Ke.a,{className:e.icon}),to:ir.STATUS,children:"Check node status"})})})]})}var $e=n(25);var Qe=function(e,t,n){var r=Object(a.useState)(!1),c=Object(f.a)(r,2),i=c[0],o=c[1],s=Object(a.useState)(void 0),l=Object(f.a)(s,2),u=l[0],d=l[1];Object(a.useEffect)((function(){if(!i&&e&&t&&!u){o(!0);var n=t.settlements.filter((function(e){return e.received.toBigNumber.gt("0")})).map((function(t){var n=t.peer;return Object($e.h)((function(){return e.getLastCashoutAction(n)}))}));Promise.allSettled(n).then((function(e){var t=Object($e.k)(e);d(t.fulfilled),o(!1)}))}}),[t,i,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 L.a("0"),received:new L.a("0"),uncashedAmount:new L.a("0"),total:n}})),t.forEach((function(e){var t=e.peer,n=e.sent,r=e.received;return a[t]=Object(P.a)(Object(P.a)({},a[t]),{},{sent:n,received:r,total:new L.a(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 L.a(n)})),Object.values(a).sort((function(e,t){var n=t.uncashedAmount.toBigNumber.minus(e.uncashedAmount.toBigNumber).toNumber();return 0!==n?n:e.peer22?n.slice(0,19)+"...":n;function x(){"NEW_WINDOW"===i?window.open(r||n):h(r||n)}return Object(p.jsx)(be.a,{className:l.header,children:Object(p.jsx)(X.a,{container:!0,direction:"column",justifyContent:"space-between",alignItems:"stretch",children:Object(p.jsxs)(X.a,{container:!0,direction:"row",justifyContent:"space-between",alignItems:"center",children:[t&&Object(p.jsx)(he.a,{variant:"body1",children:t}),Object(p.jsx)(he.a,{variant:"body2",children:Object(p.jsxs)("div",{children:[s&&Object(p.jsx)("span",{className:l.copyValue,children:Object(p.jsx)(me.a,{title:b?"Copied":"Copy",placement:"top",arrow:!0,onClose:function(){return j(!1)},children:Object(p.jsx)(Ce.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"===i&&Object(p.jsx)(te.a,{onClick:x,strokeWidth:1}),"HISTORY_PUSH"===i&&Object(p.jsx)(tn.a,{onClick:x,strokeWidth:1})]})]})})]})})})}var rn=n(352),cn=n(887),on=n(888),sn=n(889),ln=["index.html","index.htm"];function un(e){var t=e.map(jn);if(!t.length)return!1;var n=t.find((function(e){return ln.includes(e)}));if(n)return{indexPath:n};var a=t[0].split("/")[0]+"/";if(t.every((function(e){return e.startsWith(a)}))){var r=t.find((function(e){return ln.map((function(e){return a+e})).includes(e)}));if(r)return{indexPath:r,commonPrefix:a}}return!1}function dn(e){return e>=1e15?(e/1e15).toFixed(2)+" PB":e>=1e12?(e/1e12).toFixed(2)+" TB":e>=1e9?(e/1e9).toFixed(2)+" GB":e>=1e6?(e/1e6).toFixed(2)+" MB":e>=1e3?(e/1e3).toFixed(2)+" kB":e+" bytes"}function bn(e){if(1===e.length)return e[0].name;if(e.length>0){var t=jn(e[0]).split("/")[0];if(e.every((function(e){return jn(e).split("/")[0]===t})))return t}return"unknown"}function jn(e){return(e.path||e.webkitRelativePath||e.name).replace(/^\//g,"")}function hn(e){var t=jn(e);return{path:t,fullPath:t,webkitRelativePath:t,lastModified:e.lastModified,name:e.name,size:e.size,type:e.type,stream:e.stream,slice:e.slice,text:e.text,arrayBuffer:function(){var t=Object(A.a)(E.a.mark((function t(){return E.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,e.arrayBuffer();case 2:return t.abrupt("return",t.sent);case 3:case"end":return t.stop()}}),t)})));return function(){return t.apply(this,arguments)}}()}}function pn(e,t,n){return new Promise((function(a,r){if(!e.size||!e.type||!["image/bmp","image/gif","image/vnd.microsoft.icon","image/jpeg","image/png","image/svg+xml","image/tiff","image/webp"].includes(e.type))return r("File not supported!");try{var c=new FileReader;c.readAsDataURL(e),c.onload=function(e){var r,c=null===e||void 0===e||null===(r=e.target)||void 0===r?void 0:r.result;if(!c||"string"!==typeof c)throw new Error("Failed to load the image source");var i=new Image;i.src=c,i.onload=function(){var e=function(e,t,n,a){var r=n?e/n:1,c=a?t/a:1,i=Math.max(r,c);return i<=1?{width:e,height:t}:{width:e/i,height:t/i}}(i.width,i.height,t,n),r=document.createElement("canvas");r.width=e.width,r.height=e.height;var c=r.getContext("2d");if(!c)throw new Error("Failed to create canvas context");c.drawImage(i,0,0,r.width,r.height),c.canvas.toBlob((function(e){if(!e)throw new Error("Failed to extract the blob from canvas");a(e)}),"image/jpeg",1)}},c.onerror=function(e){return r(e)}}catch(i){r(i)}}))}var On=".swarmgatewaymeta.json",fn=".swarmgatewaypreview.jpeg",xn=250,mn=175,gn={origin:"UPLOAD"},vn={files:[],setFiles:function(){},uploadOrigin:gn,setUploadOrigin:function(){}},yn=Object(a.createContext)(vn);yn.Consumer;function wn(e){var t=e.children,n=Object(a.useState)(vn.files),r=Object(f.a)(n,2),c=r[0],i=r[1],o=Object(a.useState)(vn.uploadOrigin),s=Object(f.a)(o,2),l=s[0],u=s[1],d=Object(a.useState)(void 0),b=Object(f.a)(d,2),j=b[0],h=b[1],O=Object(a.useState)(void 0),x=Object(f.a)(O,2),m=x[0],g=x[1],v=Object(a.useState)(void 0),y=Object(f.a)(v,2),w=y[0],S=y[1];return Object(a.useEffect)((function(){if(h(function(e){var t=e.reduce((function(e,t){return e+t.size}),0),n=Boolean(un(e));return{size:t,name:bn(e),type:1===e.length?e[0].type:"folder",isWebsite:n,count:e.length}}(c)),m&&(URL.revokeObjectURL(m),g(void 0),S(void 0)),1===c.length&&c[0].type.startsWith("image"))return pn(c[0],xn,mn).then((function(e){g(URL.createObjectURL(e)),S(e)})),function(){m&&URL.revokeObjectURL(m)}}),[c]),Object(p.jsx)(yn.Provider,{value:{files:c,setFiles:i,uploadOrigin:l,setUploadOrigin:u,metadata:j,previewUri:m,previewBlob:w},children:t})}var Sn=Object(x.a)((function(e){return Object(m.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 kn(e){var t=e.uploadOrigin,n=e.showHelp,r=Object(a.useContext)(yn),c=r.setFiles,i=r.setUploadOrigin,o=Sn(),s=Object(de.g)(),u=Object(l.b)().enqueueSnackbar,d=Object(a.useState)(!1),b=Object(f.a)(d,2),j=b[0],h=b[1],O=Object(a.useState)(0),x=Object(f.a)(O,2),m=x[0],g=x[1],v=function(){return document.querySelector(".MuiDropzoneArea-root input")},y=function(){var e=v();e&&(e.setAttribute("directory",""),e.setAttribute("webkitdirectory",""),e.setAttribute("mozdirectory",""),e.click())};return Object(p.jsxs)(p.Fragment,{children:[Object(p.jsxs)("div",{className:o.areaWrapper,children:[Object(p.jsx)(rn.a,{dropzoneClass:o.dropzone,onChange:function(e){if(e){var n=e,a=1===e.length?e[0].name:un(n)||void 0;if(e.length&&j&&!a)return u("To upload a website, there must be an index.html or index.htm in the root of the folder.",{variant:"error"}),void setTimeout((function(){g((function(e){return e+1})),c([])}),0);c(n),e.length&&(i(t),s(ir.UPLOAD_IN_PROGRESS))}},filesLimit:1e9,maxFileSize:1e9,showPreviews:!1},m),Object(p.jsxs)("div",{className:o.buttonWrapper,children:[Object(p.jsx)(ht,{className:o.button,onClick:function(){var e=v();e&&(e.removeAttribute("directory"),e.removeAttribute("webkitdirectory"),e.removeAttribute("mozdirectory"),e.click())},iconType:cn.a,children:"Add File"}),Object(p.jsx)(ht,{className:o.button,onClick:function(){y(),h(!1)},iconType:on.a,children:"Add Folder"}),Object(p.jsx)(ht,{className:o.button,onClick:function(){y(),h(!0)},iconType:sn.a,children:"Add Website"})]})]}),n&&Object(p.jsx)(zt,{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 Cn(){var e=Object(a.useContext)(Ot).identities,t=Object(de.h)().uuid,n=Object(a.useContext)(F).beeApi,r=Object(a.useContext)(V).status,c=Object(de.g)(),i=Object(a.useState)(!1),o=Object(f.a)(i,2),s=o[0],l=o[1],u=e.find((function(e){return e.uuid===t}));if(Object(a.useEffect)((function(){if(u&&u.feedHash)try{null===n||void 0===n||n.downloadData(u.feedHash).then((function(){return l(!0)}))}catch(e){l(!1)}}),[n,t,u]),!u||!r.all)return c(ir.FEEDS,{replace:!0}),Object(p.jsx)(p.Fragment,{});return Object(p.jsxs)("div",{children:[Object(p.jsx)(Gt,{children:"".concat(u.name," Website")}),Object(p.jsx)(kn,{showHelp:!1,uploadOrigin:{origin:"FEED",uuid:t}}),s&&u.feedHash?Object(p.jsxs)(p.Fragment,{children:[Object(p.jsx)(ut.a,{mb:.25,children:Object(p.jsx)(Te,{label:"Feed hash",value:u.feedHash})}),Object(p.jsx)(ut.a,{mb:4,children:Object(p.jsx)(an,{label:"BZZ Link",value:"https://".concat(en.encodeFeedReference(u.feedHash),".bzz.link")})})]}):Object(p.jsx)(ut.a,{mb:4,children:Object(p.jsxs)(zt,{children:["This feed is curently not pointing anywhere, you can update the feed to fix this. Please refer to the"," ",Object(p.jsx)("a",{href:"https://docs.ethswarm.org/api/#tag/Feed/paths/~1feeds~1{owner}~1{topic}/post",target:"_blank",rel:"noreferrer",children:"official Bee documentation"}),"."]})}),Object(p.jsx)(Se,{children:Object(p.jsx)(ht,{iconType:mt.a,onClick:function(){c(ir.FEEDS)},cancel:!0,children:"Close"})})]})}var En=n(180),An={stamps:null,error:null,isLoading:!1,lastUpdate:null,start:function(){},stop:function(){},refresh:function(){return Promise.reject()}},Pn=Object(a.createContext)(An);Pn.Consumer;function Tn(e){var t=e.depth,n=e.bucketDepth,a=e.utilization/Math.pow(2,t-n),r="".concat(Math.ceil(100*a),"%");return Object(P.a)(Object(P.a)({},e),{},{usage:a,usageText:r})}function Bn(e){var t=e.children,n=Object(a.useContext)(F).beeDebugApi,r=Object(a.useState)(An.stamps),c=Object(f.a)(r,2),i=c[0],o=c[1],s=Object(a.useState)(An.error),l=Object(f.a)(s,2),u=l[0],d=l[1],b=Object(a.useState)(An.isLoading),j=Object(f.a)(b,2),h=j[0],O=j[1],x=Object(a.useState)(An.lastUpdate),m=Object(f.a)(x,2),g=m[0],v=m[1],y=Object(a.useState)(null),w=Object(f.a)(y,2),S=w[0],k=w[1],C=function(){var e=Object(A.a)(E.a.mark((function e(){var t;return E.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,o(t.map(Tn)),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(),S){var e=setInterval(C,S);return function(){return clearInterval(e)}}}),[S]),Object(p.jsx)(Pn.Provider,{value:{stamps:i,error:u,isLoading:h,lastUpdate:g,start:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:3e4;return k(e)},stop:function(){return k(null)},refresh:C},children:t})}function Nn(e){var t=e.feedName,n=e.onProceed,r=e.onCancel,c=e.loading,i=Object(a.useState)(""),o=Object(f.a)(i,2),s=o[0],l=o[1];return Object(p.jsxs)(gt,{children:[Object(p.jsx)(ut.a,{mb:4,children:Object(p.jsx)(kt,{onClose:r,children:"Update Feed"})}),Object(p.jsx)(ut.a,{mb:2,children:Object(p.jsxs)(he.a,{children:["Please enter the password for \u201c",t,"\u201d:"]})}),Object(p.jsx)(ut.a,{mb:4,children:Object(p.jsx)(Ft,{label:"Password",name:"password",onChange:function(e){l(e.target.value)},password:!0})}),Object(p.jsxs)(Se,{children:[Object(p.jsx)(ht,{iconType:It.a,onClick:function(){return n(s)},disabled:c,loading:c,children:"Proceed"}),Object(p.jsx)(ht,{iconType:mt.a,onClick:r,cancel:!0,disabled:c,children:"Cancel"})]})]})}function Dn(){var e=Object(a.useContext)(Ot),t=e.identities,n=e.setIdentities,r=Object(a.useContext)(F),c=r.beeApi,i=r.beeDebugApi,o=Object(a.useContext)(Pn),s=o.stamps,u=o.refresh,d=Object(a.useContext)(V).status,b=Object(de.h)().hash,j=Object(a.useState)(null),h=Object(f.a)(j,2),O=h[0],x=h[1],m=Object(a.useState)(null),g=Object(f.a)(m,2),v=g[0],y=g[1],w=Object(a.useState)(!1),S=Object(f.a)(w,2),k=S[0],C=S[1],P=Object(l.b)().enqueueSnackbar,T=Object(a.useState)(!1),B=Object(f.a)(T,2),N=B[0],D=B[1],I=Object(de.g)();function _(e,t){return L.apply(this,arguments)}function L(){return(L=Object(A.a)(E.a.mark((function e(a,r){return E.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(C(!0),c&&i&&O){e.next=5;break}return P(Object(p.jsx)("span",{children:"Bee API unavailabe"}),{variant:"error"}),C(!1),e.abrupt("return");case 5:return e.prev=5,e.next=8,Object(xt.f)(c,a,b,O,r);case 8:Object(xt.e)(t,a),n(Object(En.a)(t)),I(ir.FEEDS_PAGE.replace(":uuid",a.uuid)),e.next=18;break;case 13:e.prev=13,e.t0=e.catch(5),C(!1),("object"===typeof e.t0&&null!==e.t0&&Reflect.get(e.t0,"message")||"").includes("possibly wrong passphrase")?P("Wrong password, please try again",{variant:"error"}):P("Could not update feed at this time, please try again later",{variant:"error"});case 18:case"end":return e.stop()}}),e,null,[[5,13]])})))).apply(this,arguments)}return Object(a.useEffect)((function(){u()}),[]),d.all?Object(p.jsxs)("div",{children:[N&&v&&Object(p.jsx)(Nn,{feedName:v.name+" Website",onCancel:function(){D(!1)},onProceed:function(e){_(v,e)},loading:k}),Object(p.jsx)(Gt,{children:"Update feed"}),Object(p.jsx)(ut.a,{mb:2,children:Object(p.jsx)(X.a,{container:!0,children:Object(p.jsx)(Xt,{options:t.map((function(e){return{value:e.uuid,label:"".concat(e.name," Website")}})),onChange:function(e){var n=e.target.value;y(t.find((function(e){return e.uuid===n}))||null)},label:"Feed"})})}),Object(p.jsx)(ut.a,{mb:4,children:Object(p.jsx)(X.a,{container:!0,children:s?Object(p.jsx)(Xt,{options:s.map((function(e){return{value:e.batchID,label:e.batchID.slice(0,8)}})),onChange:function(e){var t=e.target.value;x(t)},label:"Stamp"}):Object(p.jsx)(he.a,{children:"You need to buy a stamp first to be able to update a feed."})})}),Object(p.jsxs)(Se,{children:[Object(p.jsx)(ht,{onClick:function(){v&&("V3"===v.type?D(!0):_(v))},iconType:ce.a,loading:!N&&k,disabled:k||!O||!v,children:"Update Selected Feed"}),Object(p.jsx)(ht,{onClick:function(){I(-1)},iconType:mt.a,disabled:k,cancel:!0,children:"Close"})]})]}):Object(p.jsx)(Xe,{})}var In=n(178),_n=n(361),Ln=n(891),Un=n(892),Rn=Object(x.a)((function(e){return Object(m.a)({header:{backgroundColor:"#F7F7F7",marginBottom:e.spacing(.25)},typography:{color:"#242424"}})}));function Fn(e){var t=e.children,n=Rn();return Object(p.jsx)(be.a,{className:n.header,children:Object(p.jsx)(he.a,{variant:"body1",className:n.typography,children:t})})}var Wn,Hn=Object(x.a)((function(e){return Object(m.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 Mn(e){var t=e.label,n=e.value,r=e.onConfirm,c=e.onChange,i=e.confirmLabel,o=e.confirmLabelDisabled,s=e.expandedOnly,l=e.helperText,u=e.placeholder,d=e.loading,b=e.mapperFn,j=e.locked,h=Hn(),O=Object(a.useState)(Boolean(s)),x=Object(f.a)(O,2),m=x[0],g=x[1],v=Object(a.useState)(n||""),S=Object(f.a)(v,2),k=S[0],C=S[1],E=function(){return g(!m)};return Object(p.jsxs)(p.Fragment,{children:[Object(p.jsx)(be.a,{className:"".concat(h.header," ").concat(m?h.headerOpen:""),children:Object(p.jsxs)(X.a,{container:!0,direction:"column",justifyContent:"space-between",alignItems:"stretch",children:[Object(p.jsxs)(X.a,{container:!0,direction:"row",justifyContent:"space-between",alignItems:"center",children:[t&&Object(p.jsx)(he.a,{variant:"body1",className:h.unselectableLabel,children:t}),Object(p.jsx)(he.a,{variant:"body2",children:Object(p.jsxs)("div",{children:[!m&&n,!s&&!j&&Object(p.jsx)(w.a,{size:"small",className:h.copyValue,children:m?Object(p.jsx)(Ee.a,{onClick:E,strokeWidth:1}):Object(p.jsx)(Ln.a,{onClick:E,strokeWidth:1})})]})})]}),Object(p.jsx)(y.a,{in:m,timeout:"auto",unmountOnExit:!0,children:Object(p.jsx)(_n.a,{value:k,placeholder:u,onChange:function(e){b&&(e.target.value=b(e.target.value)),C(e.target.value),c&&c(e.target.value)},fullWidth:!0,className:h.content,autoFocus:!0,hidden:j})})]})}),Object(p.jsxs)(y.a,{in:m,timeout:"auto",unmountOnExit:!0,children:[l&&Object(p.jsx)(Fn,{children:l}),Object(p.jsxs)(Se,{children:[Object(p.jsx)(ht,{disabled:d||k===n||Boolean(o)||""===k&&void 0===n,loading:d,iconType:Un.a,onClick:function(){return r(k)},children:i||"Save"}),Object(p.jsx)(ht,{disabled:d||k===n||""===k,iconType:mt.a,onClick:function(){return C(n||"")},cancel:!0,children:"Cancel"})]})]})]})}function Vn(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 zn(e,t,n){var a=qn(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 qn(e){var t=localStorage.getItem(e);if(!t)return[];try{var n=JSON.parse(t);return Array.isArray(n)&&n.every(Yn)?n:[]}catch(a){return[]}}function Yn(e){return"object"===typeof e&&null!==e&&("createdAt"in e&&"hash"in e)}function Gn(e,t){return"index.html"===t?"Website ".concat(Vn(e,4)):t||"Folder ".concat(Vn(e,4))}function Zn(e){var t=e.title,n=e.localStorageKey,r=Object(a.useState)([]),c=Object(f.a)(r,2),i=c[0],o=c[1];return Object(a.useEffect)((function(){o(qn(n))}),[n]),i.length?Object(p.jsx)(xe,{label:t,defaultOpen:!0,children:i.map((function(e,t){return Object(p.jsx)(an,{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}!function(e){e.UPLOAD_HISTORY="UPLOAD_HISTORY",e.DOWNLOAD_HISTORY="DOWNLOAD_HISTORY"}(Wn||(Wn={}));var Kn=n(913),Jn=n(893),Xn=Object(x.a)((function(e){return Object(m.a)({root:{flexGrow:1,marginBottom:e.spacing(4)},leftTab:{marginRight:e.spacing(.5)},rightTab:{marginLeft:e.spacing(.5)}})}));function $n(e){var t=e.active,n=Xn(),a=Object(de.g)();return Object(p.jsx)("div",{className:n.root,children:Object(p.jsxs)(Kn.a,{value:"UPLOAD"===t?0:1,onChange:function(e,t){a(1===t?ir.DOWNLOAD:ir.UPLOAD)},variant:"fullWidth",children:[Object(p.jsx)(Jn.a,{className:n.leftTab,label:"Upload"},"UPLOAD"),Object(p.jsx)(Jn.a,{className:n.rightTab,label:"Download"},"DOWNLOAD")]})})}function Qn(){var e=Object(a.useState)(!1),t=Object(f.a)(e,2),n=t[0],r=t[1],c=Object(a.useContext)(F).beeApi,i=Object(a.useState)(void 0),o=Object(f.a)(i,2),s=o[0],u=o[1],d=Object(a.useContext)(yn).setUploadOrigin,b=Object(l.b)().enqueueSnackbar,j=Object(de.g)();function h(){return(h=Object(A.a)(E.a.mark((function e(t){var n,a,i,o;return E.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r(!0),c){e.next=4;break}return r(!1),e.abrupt("return");case 4:return e.prev=4,n=new In.ManifestJs(c),e.next=8,n.resolveFeedManifest(t);case 8:return(a=e.sent)&&(t=a),e.next=12,n.isManifest(t);case 12:if(e.sent){e.next=15;break}throw Error("The specified hash does not contain valid content.");case 15:return e.next=17,n.getIndexDocumentPath(t);case 17:i=e.sent,zn(Wn.DOWNLOAD_HISTORY,t,Gn(t,i)),d(gn),j(ir.HASH.replace(":hash",t)),e.next=29;break;case 23:e.prev=23,e.t0=e.catch(4),(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."),b(Object(p.jsxs)("span",{children:["Error: ",o||"Unknown"]}),{variant:"error"});case 29:return e.prev=29,r(!1),e.finish(29);case 32:case"end":return e.stop()}}),e,null,[[4,23,29,32]])})))).apply(this,arguments)}return Object(p.jsxs)(p.Fragment,{children:[Object(p.jsx)($n,{active:"DOWNLOAD"}),Object(p.jsx)(Mn,{label:"Swarm Hash",onConfirm:function(e){return function(e){return h.apply(this,arguments)}(e)},onChange:function(e){U.Utils.isHexString(e,64)||U.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:"Find",confirmLabelDisabled:Boolean(s)||n,placeholder:"e.g. 31fb0362b1a42536134c86bc58b97ac0244e5c6630beec3e27c2d1cecb38c605",expandedOnly:!0,mapperFn:function(e){return function(e){return e.length<64?e:Object($e.d)(e)||e}(e)},loading:n}),Object(p.jsx)(Zn,{title:"Download History",localStorageKey:Wn.DOWNLOAD_HISTORY})]})}var ea=n(348),ta=n.n(ea);function na(){return Object(p.jsx)(X.a,{container:!0,direction:"row",justifyContent:"center",alignItems:"center",children:Object(p.jsx)(K.a,{})})}var aa=n(895),ra=n(894),ca=n(896),ia=Object(x.a)((function(){return Object(m.a)({image:{width:"100%",height:"100%",objectFit:"cover"}})}));function oa(e){var t=ia(),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 sa=Object(x.a)((function(){return Object(m.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 la(e){var t=e.children,n=sa();return Object(p.jsx)("div",{className:n.wrapper,children:t})}function ua(e){var t=e.icon;return Object(p.jsx)(la,{children:t})}function da(e){var t=e.metadata,n=e.previewUri,a=Object(p.jsx)(ra.a,{}),r=null===t||void 0===t?void 0:t.type;return(null===t||void 0===t?void 0:t.isWebsite)?(a=Object(p.jsx)(aa.a,{}),r="Website"):"folder"===(null===t||void 0===t?void 0:t.type)&&(a=Object(p.jsx)(ca.a,{}),r="Folder"),Object(p.jsxs)(ut.a,{mb:4,children:[Object(p.jsx)(ut.a,{bgcolor:"background.paper",children:Object(p.jsxs)(X.a,{container:!0,direction:"row",children:[n?Object(p.jsx)(oa,{maxWidth:"250px",maxHeight:"175px",alt:"Upload Preview",src:n}):Object(p.jsx)(ua,{icon:a}),Object(p.jsxs)(ut.a,{p:2,children:[(null===t||void 0===t?void 0:t.hash)&&Object(p.jsxs)(he.a,{children:["Swarm Hash: ",Vn(t.hash)]}),(null===t||void 0===t?void 0:t.name)&&(null===t||void 0===t?void 0:t.name)!==(null===t||void 0===t?void 0:t.hash)&&Object(p.jsxs)(he.a,{children:["folder"===(null===t||void 0===t?void 0:t.type)?"Folder Name":"Filename",": ",Object($e.j)(null===t||void 0===t?void 0:t.name)]}),Object(p.jsxs)(he.a,{children:["Kind: ",r]}),(null===t||void 0===t?void 0:t.size)?Object(p.jsxs)(he.a,{children:["Size: ",dn(t.size)]}):null]})]})}),"folder"===(null===t||void 0===t?void 0:t.type)&&t.count&&Object(p.jsx)(ut.a,{mt:.25,p:2,bgcolor:"background.paper",children:Object(p.jsxs)(X.a,{container:!0,justifyContent:"space-between",alignItems:"center",direction:"row",children:[Object(p.jsx)(he.a,{variant:"subtitle2",children:"Folder content"}),Object(p.jsxs)(he.a,{variant:"subtitle2",children:[t.count," items"]})]})})]})}function ba(e){var t=e.isWebsite,n=e.hash;return Object(p.jsxs)(p.Fragment,{children:[Object(p.jsxs)(ut.a,{mb:4,children:[Object(p.jsx)(Te,{label:"Swarm hash",value:n}),Object(p.jsx)(an,{label:"Share on Swarm Gateway",value:"https://gateway.ethswarm.org/access/".concat(n)}),t&&Object(p.jsx)(an,{label:"BZZ Link",value:"https://".concat(en.encodeManifestReference(n).toString(),".bzz.link")})]}),Object(p.jsxs)(zt,{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 ja=n(897);function ha(e){var t=e.onOpen,n=e.onCancel,a=e.onDownload,r=e.onUpdateFeed,c=e.hasIndexDocument,i=e.loading;return Object(p.jsxs)(X.a,{container:!0,justifyContent:"space-between",children:[Object(p.jsxs)(Se,{children:[c&&Object(p.jsx)(ht,{onClick:t,iconType:ja.a,disabled:i,children:"View Website"}),Object(p.jsx)(ht,{onClick:a,iconType:ot.a,disabled:i,loading:i,children:"Download"}),Object(p.jsx)(ht,{onClick:n,iconType:mt.a,disabled:i,cancel:!0,children:"Close"})]}),Object(p.jsx)(ut.a,{mb:1,mr:1,children:Object(p.jsx)(ht,{onClick:r,iconType:ce.a,disabled:i,children:"Update Feed"})})]})}function pa(){var e=Object(a.useContext)(F),t=e.apiUrl,n=e.beeApi,r=Object(a.useContext)(V).status,c=Object(de.h)().hash,i=c,o=Object(de.g)(),s=Object(l.b)().enqueueSnackbar,u=Object(a.useState)(!0),d=Object(f.a)(u,2),b=d[0],j=d[1],h=Object(a.useState)(!1),O=Object(f.a)(h,2),x=O[0],m=O[1],g=Object(a.useState)({}),v=Object(f.a)(g,2),y=v[0],w=v[1],S=Object(a.useState)(null),k=Object(f.a)(S,2),C=k[0],T=k[1],B=Object(a.useState)(!1),N=Object(f.a)(B,2),D=N[0],I=N[1],L=Object(a.useState)(void 0),U=Object(f.a)(L,2),R=U[0],W=U[1],H=Object(a.useState)(),M=Object(f.a)(H,2),z=M[0],q=M[1];function Y(){return Y=Object(A.a)(E.a.mark((function e(){var t,a,o,l,u,d,b,j;return E.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n&&r.all){e.next=2;break}return e.abrupt("return");case 2:return t=new In.ManifestJs(n),e.next=5,t.isManifest(i);case 5:if(e.sent){e.next=10;break}return I(!0),s("The specified hash does not contain valid content.",{variant:"error"}),e.abrupt("return");case 10:return e.next=12,t.getHashes(i);case 12:return a=e.sent,e.next=15,t.getIndexDocumentPath(i);case 15:return o=e.sent,T(o),l=a[fn],delete a[On],delete a[fn],w(a),u=Object.keys(a).length,d={hash:c,size:0,type:u>1?"folder":"unknown",name:i,isWebsite:Boolean(o)&&u>1,count:u},e.prev=23,e.next=26,n.downloadFile(i,On);case 26:b=e.sent,j=b.data.text(),d=Object(P.a)(Object(P.a)({},d),JSON.parse(j)),e.next=33;break;case 31:e.prev=31,e.t0=e.catch(23);case 33:l&&W("".concat(_.b.BEE_API_HOST,"/bzz/").concat(i,"/").concat(fn)),q(d);case 35:case"end":return e.stop()}}),e,null,[[23,31]])}))),Y.apply(this,arguments)}function G(){return(G=Object(A.a)(E.a.mark((function e(){var a,r,c,o,s,l,u;return E.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n){e.next=2;break}return e.abrupt("return");case 2:if(zn(Wn.DOWNLOAD_HISTORY,i,Gn(i,C)),m(!0),1!==Object.keys(y).length){e.next=8;break}window.open("".concat(t,"/bzz/").concat(i,"/"),"_blank"),e.next=25;break;case 8:a=new ta.a,r=0,c=Object.entries(y);case 10:if(!(r0?o(-1):o(ir.UPLOAD)},onDownload:function(){return G.apply(this,arguments)},onUpdateFeed:function(){o(ir.FEEDS_UPDATE.replace(":hash",i))},hasIndexDocument:Boolean(null===z||void 0===z?void 0:z.isWebsite),loading:x})]}):Object(p.jsx)(Xe,{})}var Oa=Object(x.a)((function(){return Object(m.a)({wrapper:{height:"52px",display:"flex",flex:1,justifyContent:"center",alignItems:"center"},todo:{background:"#f7f7f7",color:"#c9c9c9"},inProgress:{background:"#ffffff",color:"#242424",height:"52px"},done:{background:"#f7f7f7",color:"#606060",height:"52px"}})}));function fa(e){var t=e.steps,n=e.index,a=Oa();function r(e){return e===n?a.inProgress:e255)return"-";var n=Object($e.a)(e,t);return"".concat(n.toSignificantDigits()," BZZ")}return Object(p.jsx)(Lt.c,{initialValues:xa,onSubmit:function(){var e=Object(A.a)(E.a.mark((function e(n,a){var o,s,l;return E.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 o=BigInt(n.amount),s=Number.parseInt(n.depth),l=n.label?{label:n.label}:void 0,e.next=10,c.createPostageBatch(o.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),i("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 tt.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 tt.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 t,n=e.submitForm,a=e.isValid,r=e.isSubmitting,c=e.values;return Object(p.jsxs)(Lt.b,{children:[Object(p.jsxs)(ut.a,{mb:2,children:[Object(p.jsx)(Ft,{name:"depth",label:"Depth",formik:!0}),Object(p.jsx)(ut.a,{mt:.25,sx:{bgcolor:"#f6f6f6"},p:2,children:Object(p.jsxs)(X.a,{container:!0,justifyContent:"space-between",children:[Object(p.jsx)(he.a,{children:"Corresponding file size"}),Object(p.jsx)(he.a,{children:(t=parseInt(c.depth||"0",10),isNaN(t)||t<17||t>255?"-":"~".concat(dn(Object($e.c)(t))))})]})})]}),Object(p.jsxs)(ut.a,{mb:2,children:[Object(p.jsx)(Ft,{name:"amount",label:"Amount",formik:!0}),Object(p.jsx)(ut.a,{mt:.25,sx:{bgcolor:"#f6f6f6"},p:2,children:Object(p.jsxs)(X.a,{container:!0,justifyContent:"space-between",children:[Object(p.jsx)(he.a,{children:"Corresponding TTL (Time to live)"}),Object(p.jsx)(he.a,{children:o(Number.parseInt(c.amount||"0",10))})]})})]}),Object(p.jsx)(ut.a,{mb:2,children:Object(p.jsx)(Ft,{name:"label",label:"Label",optional:!0,formik:!0})}),Object(p.jsx)(ut.a,{mb:4,sx:{bgcolor:"#fcf2e8"},p:2,children:Object(p.jsxs)(X.a,{container:!0,justifyContent:"space-between",children:[Object(p.jsx)(he.a,{children:"Indicative Price"}),Object(p.jsx)(he.a,{children:s(parseInt(c.depth||"0",10),BigInt(c.amount||"0"))})]})}),Object(p.jsx)(ht,{disabled:r||!a||!c.amount||!c.depth,onClick:n,iconType:It.a,loading:r,children:"Buy New Stamp"})]})}})}function ga(e){var t=e.onSelect,n=e.defaultValue,r=Object(a.useContext)(Pn).stamps;return Object(p.jsx)(Xt,{options:(r||[]).map((function(e){return{label:e.batchID.slice(0,8),value:e.batchID}})),onChange:function(e){return function(e){if(r){var n=r.find((function(t){return t.batchID===e}));n&&t(n)}}(e.target.value)},defaultValue:n})}function va(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 ya(e){var t=e.stamp,n=e.shorten;return Object(p.jsx)(ut.a,{p:2,width:"100%",children:Object(p.jsxs)(X.a,{container:!0,justifyContent:"space-between",alignItems:"center",direction:"row",children:[Object(p.jsx)(he.a,{variant:"subtitle2",children:n?t.batchID.slice(0,8):t.batchID}),Object(p.jsx)(va,{width:"100px",usage:t.usage})]})})}function wa(e){var t=e.stamp;return Object(p.jsxs)(ut.a,{mb:4,children:[Object(p.jsx)(ut.a,{mb:.25,p:2,bgcolor:"background.paper",children:Object(p.jsx)(he.a,{variant:"subtitle2",children:"Associated postage stamp:"})}),Object(p.jsx)(ut.a,{bgcolor:"background.paper",children:Object(p.jsx)(ya,{stamp:t,shorten:!0})})]})}var Sa=n(899);function ka(e){var t=e.step,n=e.onUpload,a=e.onCancel,r=e.onGoBack,c=e.onProceed,i=e.isUploading,o=e.hasStamp,s=e.uploadLabel,l=e.stampMode,u=e.setStampMode;return 0===t?Object(p.jsxs)(p.Fragment,{children:[Object(p.jsx)(ut.a,{mb:1,children:Object(p.jsxs)(Se,{children:[Object(p.jsx)(ht,{onClick:c,iconType:ie.a,children:"Add Postage Stamp"}),Object(p.jsx)(ht,{onClick:a,iconType:mt.a,cancel:!0,children:"Cancel"})]})}),Object(p.jsx)(zt,{children:"You need a postage stamp to upload."})]}):1===t?Object(p.jsxs)(X.a,{container:!0,direction:"row",justifyContent:"space-between",children:[Object(p.jsxs)(Se,{children:["SELECT"===l&&Object(p.jsx)(ht,{onClick:c,iconType:It.a,disabled:!o,children:"Proceed With Selected Stamp"}),Object(p.jsx)(ht,{onClick:r,iconType:Sa.a,cancel:!0,children:"Back To Preview"})]}),Object(p.jsx)(ht,{onClick:function(){return u("BUY"===l?"SELECT":"BUY")},iconType:"BUY"===l?ie.a:dt.a,children:"BUY"===l?"Use Existing Stamp":"Buy New Stamp"})]}):2===t?Object(p.jsxs)(Se,{children:[Object(p.jsx)(ht,{onClick:n,iconType:It.a,disabled:i,loading:i,children:s}),Object(p.jsx)(ht,{onClick:r,iconType:Sa.a,disabled:i,cancel:!0,children:"Change Postage Stamp"})]}):Object(p.jsx)(p.Fragment,{})}function Ca(){var e=Object(a.useState)(0),t=Object(f.a)(e,2),n=t[0],r=t[1],c=Object(a.useState)("SELECT"),i=Object(f.a)(c,2),o=i[0],s=i[1],u=Object(a.useState)(null),d=Object(f.a)(u,2),b=d[0],j=d[1],h=Object(a.useState)(!1),O=Object(f.a)(h,2),x=O[0],m=O[1],g=Object(a.useState)(!1),v=Object(f.a)(g,2),y=v[0],w=v[1],S=Object(a.useContext)(Pn).refresh,k=Object(a.useContext)(F).beeApi,C=Object(a.useContext)(yn),E=C.files,A=C.setFiles,T=C.uploadOrigin,B=C.metadata,N=C.previewUri,D=C.previewBlob,I=Object(a.useContext)(Ot),_=I.identities,L=I.setIdentities,U=Object(a.useContext)(V).status,R=Object(l.b)().enqueueSnackbar,W=Object(de.g)();if(Object(a.useEffect)((function(){S()}),[]),!U.all)return Object(p.jsx)(Xe,{});if(!E.length)return A([]),W(ir.UPLOAD,{replace:!0}),Object(p.jsx)(p.Fragment,{});var H=T.uuid?_.find((function(e){return e.uuid===T.uuid})):null,M=function(e){if(k&&E.length&&b&&B){var t=E.map(hn),n=void 0;if(1===E.length)n=E[0].name;else if(E.length>1){var a=un(E);if(a)if(a.commonPrefix){var r=a.commonPrefix.length;n=a.indexPath.substr(r),t=t.map((function(e){var t=e.path.substr(r);return Object(P.a)(Object(P.a)({},e),{},{path:t,webkitRelativePath:t,fullPath:t})}))}else n=a.indexPath}var c=E[0].lastModified,i={name:B.name,size:B.size};1===E.length&&(i.type=B.type);var o=new File([JSON.stringify(i)],On,{type:"application/json",lastModified:c});if(t.push(hn(o)),D){var s=new File([D],fn,{type:"image/jpeg",lastModified:c});t.push(hn(s))}m(!0),k.uploadFiles(b.batchID,t,{indexDocument:n}).then((function(t){zn(Wn.UPLOAD_HISTORY,t.reference,bn(E)),"UPLOAD"===T.origin?W(ir.HASH.replace(":hash",t.reference),{replace:!0}):Object(xt.f)(k,H,t.reference,b.batchID,e).then((function(){Object(xt.e)(_,H),L(Object(En.a)(_)),W(ir.FEEDS_PAGE.replace(":uuid",T.uuid),{replace:!0})}))})).catch((function(e){R("Error uploading: ".concat(e.message),{variant:"error"}),m(!1)}))}};return Object(p.jsxs)(p.Fragment,{children:[y&&Object(p.jsx)(Nn,{loading:x,feedName:H.name,onCancel:function(){return w(!1)},onProceed:function(e){M(e)}}),H&&Object(p.jsx)(Gt,{children:'Update "'.concat(H.name,'"')}),!H&&Object(p.jsx)(Gt,{children:"Upload"}),Object(p.jsx)(ut.a,{mb:4,children:Object(p.jsx)(fa,{steps:["Preview","Add postage stamp","Upload to node"],index:n})}),(0===n||2===n)&&Object(p.jsx)(da,{metadata:B,previewUri:N}),1===n&&Object(p.jsxs)(p.Fragment,{children:[Object(p.jsx)(ut.a,{mb:2,children:"SELECT"===o?Object(p.jsx)(ga,{onSelect:function(e){return j(e)},defaultValue:null===b||void 0===b?void 0:b.batchID}):Object(p.jsx)(ma,{onFinished:function(){return s("SELECT")}})}),Object(p.jsx)(ut.a,{mb:4,children:Object(p.jsxs)(zt,{children:["Please refer to the"," ",Object(p.jsx)("a",{href:"https://docs.ethswarm.org/debug-api/#tag/Postage-Stamps/paths/~1stamps~1{amount}~1{depth}/post",target:"_blank",rel:"noreferrer",children:"official Bee documentation"})," ","to understand these values."]})})]}),2===n&&b&&Object(p.jsx)(wa,{stamp:b}),Object(p.jsx)(ka,{step:n,onCancel:function(){r(0),A([]),j(null),m(!1)},onGoBack:function(){return r((function(e){return e-1}))},onProceed:function(){return r((function(e){return e+1}))},onUpload:function(){"UPLOAD"===T.origin||"PRIVATE_KEY"===H.type?M():w(!0)},isUploading:x,hasStamp:Boolean(b),uploadLabel:H?"Update Feed":"Upload To Your Node",stampMode:o,setStampMode:s})]})}function Ea(){return Object(a.useContext)(V).status.all?Object(p.jsxs)(p.Fragment,{children:[Object(p.jsx)($n,{active:"UPLOAD"}),Object(p.jsx)(kn,{showHelp:!0,uploadOrigin:gn}),Object(p.jsx)(Zn,{title:"Upload History",localStorageKey:Wn.UPLOAD_HISTORY})]}):Object(p.jsx)(Xe,{})}var Aa=n(173),Pa=1e5,Ta="There may be issues with your Bee node or connection.",Ba={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. "+Ta,score:0}],population:[{minimumValue:Pa,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(Pa.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. "+Ta,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. "+Ta,score:0}]};function Na(e,t){var n,a=Ba[e],r=a[0].score,c=Object(Aa.a)(a);try{for(c.s();!(n=c.n()).done;){var i=n.value;if(t>=i.minimumValue)return{score:i.score,maximumScore:r,explanation:i.explanation}}}catch(s){c.e(s)}finally{c.f()}var o=a[a.length-1];return{score:o.score,maximumScore:r,explanation:o.explanation}}var Da=function(e){var t,n,a,r,c,i,o={connectedPeers:Na("connectedPeers",(null===(t=e.topology)||void 0===t?void 0:t.connected)||0),population:Na("population",(null===(n=e.topology)||void 0===n?void 0:n.population)||0),depth:Na("depth",(null===(a=e.topology)||void 0===a?void 0:a.depth)||0)},s=Object.values(o).reduce((function(e,t){return e+t.maximumScore}),0),l=Object.values(o).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)(ye,{label:"Overall Health Indicator",value:u}),Object(p.jsx)(ye,{label:"Connected Peers",value:null===(r=e.topology)||void 0===r?void 0:r.connected.toString(),tooltip:o.connectedPeers.explanation}),Object(p.jsx)(ye,{label:"Population",value:null===(c=e.topology)||void 0===c?void 0:c.population.toString(),tooltip:o.population.explanation}),Object(p.jsx)(ye,{label:"Depth",value:null===(i=e.topology)||void 0===i?void 0:i.depth.toString(),tooltip:o.depth.explanation})]})};function Ia(){var e=Object(a.useContext)(V),t=e.status,n=e.latestUserVersion,r=e.isLatestBeeVersion,c=e.latestBeeVersionUrl,i=e.topology,o=e.nodeAddresses,s=e.chequebookAddress;return t.all?Object(p.jsxs)("div",{children:[Object(p.jsxs)(xe,{label:"Bee Node",defaultOpen:!0,children:[Object(p.jsx)(ye,{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)(Be.a,{size:"small",variant:"outlined",href:c,target:"_blank",children:r?"latest":"update"})]})}),Object(p.jsx)(Te,{label:"Public key",value:(null===o||void 0===o?void 0:o.publicKey)||""}),Object(p.jsx)(Te,{label:"PSS public key",value:(null===o||void 0===o?void 0:o.pssPublicKey)||""}),Object(p.jsx)(Te,{label:"Overlay address (Peer ID)",value:(null===o||void 0===o?void 0:o.overlay)||""}),Object(p.jsx)(xe,{level:1,label:"Underlay addresses",children:null===o||void 0===o?void 0:o.underlay.map((function(e){return Object(p.jsx)(ye,{value:e},e)}))})]}),Object(p.jsxs)(xe,{label:"Blockchain",defaultOpen:!0,children:[Object(p.jsx)(Te,{label:"Ethereum address",value:(null===o||void 0===o?void 0:o.ethereum)||""}),Object(p.jsx)(Te,{label:"Chequebook contract address",value:(null===s||void 0===s?void 0:s.chequebookAddress)||""})]}),Object(p.jsx)(xe,{label:"Connectivity",defaultOpen:!0,children:Object(p.jsx)(Da,{topology:i})})]}):Object(p.jsx)(Xe,{})}function _a(){var e=Object(a.useContext)(F),t=e.apiUrl,n=e.apiDebugUrl,r=e.setApiUrl,c=e.setDebugApiUrl,i=e.lockedApiSettings;return Object(p.jsxs)(xe,{label:"API Settings",defaultOpen:!0,children:[Object(p.jsx)(Mn,{label:"Bee API",value:t,onConfirm:r,locked:i}),Object(p.jsx)(Mn,{label:"Bee Debug API",value:n,onConfirm:c,locked:i})]})}var La=Object(x.a)((function(e){return Object(m.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 Ua(e){var t=e.children,n=e.expandable,r=e.defaultOpen,c=La(),i=Object(a.useState)(Boolean(r)),o=Object(f.a)(i,2),s=o[0],l=o[1];return Object(p.jsxs)("div",{className:"".concat(c.root," ").concat(c.rootLevel2),children:[Object(p.jsxs)(be.a,{button:!0,onClick:function(){l(!s)},className:c.header,children:[t,s?Object(p.jsx)(pe.a,{}):Object(p.jsx)(Oe.a,{})]}),Object(p.jsx)(y.a,{in:s,timeout:"auto",unmountOnExit:!0,children:Object(p.jsx)("div",{className:c.contentLevel12,children:n})})]})}var Ra=function(e){var t=e.postageStamps;return null===t?null:Object(p.jsx)(xe,{label:"Postage Stamps",defaultOpen:!0,children:t.map((function(e){return Object(p.jsx)(Ua,{expandable:Object(p.jsxs)(p.Fragment,{children:[Object(p.jsx)(Te,{label:"Batch ID",value:e.batchID}),Object(p.jsx)(ye,{label:"Depth",value:String(e.depth)}),Object(p.jsx)(ye,{label:"Capacity",value:"".concat(dn(4096*Math.pow(2,e.depth)*e.usage)," / ").concat(dn(4096*Math.pow(2,e.depth)))}),Object(p.jsx)(ye,{label:"Amount",value:parseInt(e.amount,10).toLocaleString()})]}),children:Object(p.jsx)(ya,{stamp:e,shorten:!0})},e.batchID)}))})},Fa=Object(x.a)((function(){return Object(m.a)({root:{width:"100%",display:"grid"},actions:{display:"flex",width:"100%",flex:"0 1 auto",flexWrap:"wrap",alignItems:"center"}})}));function Wa(){var e=Fa(),t=Object(de.g)(),n=Object(a.useContext)(Pn),r=n.stamps,c=n.isLoading,i=n.error,o=n.start,s=n.stop,l=Object(a.useContext)(V).status;if(Object(a.useEffect)((function(){if(l.all)return o(),function(){return s()}}),[l]),!l.all)return Object(p.jsx)(Xe,{});return Object(p.jsxs)("div",{className:e.root,children:[i&&Object(p.jsxs)(Z.a,{style:{textAlign:"center",padding:"50px"},children:["Error loading postage stamps details: ",i.message]}),!i&&Object(p.jsxs)(p.Fragment,{children:[Object(p.jsxs)("div",{className:e.actions,children:[Object(p.jsx)(ht,{onClick:function(){t(ir.STAMPS_NEW)},iconType:dt.a,children:"Buy New Postage Stamp"}),Object(p.jsx)("div",{style:{height:"5px"},children:c&&Object(p.jsx)(K.a,{})})]}),Object(p.jsx)(Ra,{postageStamps:r})]})]})}function Ha(){var e=Object(de.g)();return Object(p.jsxs)("div",{children:[Object(p.jsx)(Gt,{children:"Buy new postage stamp"}),Object(p.jsx)(ma,{onFinished:function(){e(ir.STAMPS)}})]})}var Ma=n(355),Va=["children","value","index"];function za(e){var t=e.children,n=e.value,a=e.index,r=Object(Ma.a)(e,Va);return Object(p.jsx)("div",Object(P.a)(Object(P.a)({role:"tabpanel",hidden:n!==a},r),{},{children:n===a&&t}))}var qa=Object(x.a)((function(e){return Object(m.a)({root:{flexGrow:1},content:{marginTop:e.spacing(2)}})}));function Ya(e){var t=e.values,n=e.index,a=e.indexChanged,c=qa(),i=r.a.useState(n||0),o=Object(f.a)(i,2),s=o[0],l=o[1],u=void 0!==n?n:s;return Object(p.jsxs)("div",{className:c.root,children:[Object(p.jsx)(Kn.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)(Jn.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)(za,{value:u,index:t,children:n},t)}))})]})}var Ga,Za,Ka=n(915),Ja=function(e){return Object(p.jsx)("div",{style:{textAlign:"left"},children:Object(p.jsx)(Ka.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"}(Ga||(Ga={})),function(e){e[e.macOS=Ga.macOS]="macOS",e[e.Linux=Ga.Linux]="Linux"}(Za||(Za={}));var Xa={platform:Za.macOS,setPlatform:function(){}},$a=Object(a.createContext)(Xa);$a.Consumer;function Qa(e){var t=e.children,n=Object(a.useState)(Za.Linux),r=Object(f.a)(n,2),c=r[0],i=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)?Ga.macOS:["iPhone","iPad","iPod"].includes(t)?Ga.iOS:["Win32","Win64","Windows","WinCE"].includes(t)?Ga.Windows:/Android/.test(e)?Ga.Android:/Linux/.test(t)?Ga.Linux:null}();i(function(e){return Object.keys(Za).includes(e)}(e)?e:Za.Linux)}),[]),Object(p.jsx)($a.Provider,{value:{platform:c,setPlatform:i},children:t})}function er(e){var t=Object(a.useContext)($a),n=t.platform,r=t.setPlatform;return Object(p.jsx)(Ya,{index:n,indexChanged:r,values:[{label:"Linux",component:Object(p.jsx)(Ja,{showLineNumbers:e.showLineNumbers,language:"bash",code:e.linux})},{label:"macOS",component:Object(p.jsx)(Ja,{showLineNumbers:e.showLineNumbers,language:"bash",code:e.mac})}]})}function tr(e){var t=e.isOk,n=e.size,a=e.className,r=n||"1rem";return e.isLoading?Object(p.jsx)(K.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 nr(){var e=Object(a.useContext)(V),t=e.status,n=e.isLoading,r=Object(a.useContext)(F),c=r.setDebugApiUrl,i=r.apiDebugUrl,o=t.debugApiConnection;return Object(p.jsxs)(xe,{label:Object(p.jsxs)(p.Fragment,{children:[Object(p.jsx)(tr,{isOk:o,isLoading:n})," Connection to Bee Debug API"]}),children:[Object(p.jsx)(Fn,{children:o?"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)(Mn,{label:"Bee Debug API",value:i,onConfirm:c}),!o&&Object(p.jsx)(xe,{level:1,label:"Troubleshoot",children:Object(p.jsx)(ye,{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)(er,{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)(er,{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)(er,{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)(er,{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 ar(){var e=Object(a.useContext)(F),t=e.setApiUrl,n=e.apiUrl,r=Object(a.useContext)(V),c=r.status,i=r.isLoading,o=c.apiConnection;return Object(p.jsxs)(xe,{label:Object(p.jsxs)(p.Fragment,{children:[Object(p.jsx)(tr,{isOk:o,isLoading:i})," Connection to Bee API"]}),children:[Object(p.jsx)(Fn,{children:o?"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)(Mn,{label:"Bee API",value:n,onConfirm:t}),!o&&Object(p.jsx)(xe,{level:1,label:"Troubleshoot",children:Object(p.jsx)(ye,{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)(er,{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)(er,{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)(er,{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 rr(){var e=Object(a.useContext)(V),t=e.status,n=e.isLoading,r=e.latestUserVersion,c=e.latestPublishedVersion,i=e.latestBeeVersionUrl,o=t.version;return Object(p.jsxs)(xe,{label:Object(p.jsxs)(p.Fragment,{children:[Object(p.jsx)(tr,{isOk:o,isLoading:n})," Bee Version"]}),children:[Object(p.jsx)(Fn,{children:o?"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:i,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)(er,{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)(ye,{label:"Your Version",value:r||"-"}),Object(p.jsx)(ye,{label:"Latest Version",value:c||"-"})]})}function cr(){var e=Object(a.useContext)(V),t=e.status,n=e.isLoading,r=e.nodeAddresses,c=t.blockchainConnection;return Object(p.jsxs)(xe,{label:Object(p.jsxs)(p.Fragment,{children:[Object(p.jsx)(tr,{isOk:c,isLoading:n})," Connection to Blockchain"]}),children:[Object(p.jsx)(Fn,{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)(Te,{label:"Ethereum Address",value:null===r||void 0===r?void 0:r.ethereum})]})}var ir,or=function(){var e=Object(a.useContext)(V),t=e.status,n=e.isLoading,r=e.chequebookAddress,c=t.chequebook;return Object(p.jsxs)(xe,{label:Object(p.jsxs)(p.Fragment,{children:[Object(p.jsx)(tr,{isOk:c,isLoading:n})," Chequebook Deployment & Funding"]}),children:[Object(p.jsx)(Fn,{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)(Te,{label:"Chequebook Address",value:r.chequebookAddress}),Object(p.jsx)(Se,{children:Object(p.jsx)(st,{})})]})]})};function sr(){var e=Object(a.useContext)(V),t=e.status,n=e.isLoading,r=e.topology,c=t.topology;return Object(p.jsxs)(xe,{label:Object(p.jsxs)(p.Fragment,{children:[Object(p.jsx)(tr,{isOk:c,isLoading:n})," Connection to Peers"]}),children:[Object(p.jsx)(Fn,{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)(Da,{topology:r})]})}function lr(){return Object(p.jsxs)("div",{children:[Object(p.jsx)(nr,{}),Object(p.jsx)(rr,{}),Object(p.jsx)(cr,{}),Object(p.jsx)(or,{}),Object(p.jsx)(ar,{}),Object(p.jsx)(sr,{})]})}function ur(){var e=Object(a.useState)(null),t=Object(f.a)(e,2),n=t[0],r=t[1],c=Object(a.useState)(!1),i=Object(f.a)(c,2),o=i[0],s=i[1],l=Object(a.useState)("https://dai.poa.network/"),u=Object(f.a)(l,2),d=u[0],b=u[1];function j(){return(j=Object(A.a)(E.a.mark((function e(){var t,n,a,r;return E.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return s(!0),e.prev=1,e.next=4,fetch("http://localhost:5000/status").then((function(e){return e.json()}));case 4:return t=e.sent,n=t.address,e.next=8,fetch(d,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({jsonrpc:"2.0",method:"eth_getBalance",params:[n,"latest"],id:1})}).then((function(e){return e.json()}));case 8:if(a=e.sent,r=a.result,!(parseInt(r,16)>=1e16)){e.next=14;break}return s(!1),e.abrupt("return");case 14:return e.next=16,fetch("http://getxdai.co/".concat(n,"/0.01"),{method:"POST"});case 16:return e.prev=16,s(!1),e.finish(16);case 19:case"end":return e.stop()}}),e,null,[[1,,16,19]])})))).apply(this,arguments)}function h(){return(h=Object(A.a)(E.a.mark((function e(){return E.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return s(!0),e.prev=1,e.next=4,fetch("http://localhost:5000/config",{method:"PATCH",headers:{"content-type":"application/json"},body:JSON.stringify({"chain-enable":!0,"swap-enable":!0,"swap-endpoint":d})});case 4:return e.next=6,fetch("http://localhost:5000/restart",{method:"POST"});case 6:return e.prev=6,s(!1),e.finish(6);case 9:case"end":return e.stop()}}),e,null,[[1,,6,9]])})))).apply(this,arguments)}return Object(a.useEffect)((function(){fetch("http://localhost:1635/node").then((function(e){return e.json()})).then((function(e){return r(e)}))}),[]),n?"ultra-light"!==n.beeMode?Object(p.jsx)("div",{children:Object(p.jsx)(he.a,{children:"Already upgraded"})}):Object(p.jsxs)("div",{children:[Object(p.jsx)(ut.a,{mb:4,children:Object(p.jsx)(ht,{onClick:function(){return j.apply(this,arguments)},iconType:ae.a,loading:o,disabled:o,children:"Fund"})}),Object(p.jsx)(ut.a,{mb:2,children:Object(p.jsx)(Ft,{label:"RPC Provider",name:"rpc-provider",defaultValue:"https://dai.poa.network/",onChange:function(e){b(e.target.value)}})}),Object(p.jsx)(ht,{onClick:function(){return h.apply(this,arguments)},iconType:ae.a,loading:o,disabled:o,children:"Upgrade to Light Node"})]}):Object(p.jsx)(na,{})}!function(e){e.INFO="/",e.UPGRADE="/upgrade",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.STAMPS_NEW="/stamps/new",e.STATUS="/status",e.FEEDS="/feeds",e.FEEDS_NEW="/feeds/new",e.FEEDS_UPDATE="/feeds/update/:hash",e.FEEDS_PAGE="/feeds/:uuid"}(ir||(ir={}));var dr=function(){return Object(p.jsxs)(de.c,{children:[Object(p.jsx)(de.a,{path:ir.UPLOAD_IN_PROGRESS,element:Object(p.jsx)(Ca,{})}),Object(p.jsx)(de.a,{path:ir.UPLOAD,element:Object(p.jsx)(Ea,{})}),Object(p.jsx)(de.a,{path:ir.DOWNLOAD,element:Object(p.jsx)(Qn,{})}),Object(p.jsx)(de.a,{path:ir.UPGRADE,element:Object(p.jsx)(ur,{})}),Object(p.jsx)(de.a,{path:ir.HASH,element:Object(p.jsx)(pa,{})}),Object(p.jsx)(de.a,{path:ir.ACCOUNTING,element:Object(p.jsx)(lt,{})}),Object(p.jsx)(de.a,{path:ir.SETTINGS,element:Object(p.jsx)(_a,{})}),Object(p.jsx)(de.a,{path:ir.STAMPS,element:Object(p.jsx)(Wa,{})}),Object(p.jsx)(de.a,{path:ir.STAMPS_NEW,element:Object(p.jsx)(Ha,{})}),Object(p.jsx)(de.a,{path:ir.STATUS,element:Object(p.jsx)(lr,{})}),Object(p.jsx)(de.a,{path:ir.FEEDS,element:Object(p.jsx)(Mt,{})}),Object(p.jsx)(de.a,{path:ir.FEEDS_NEW,element:Object(p.jsx)(Qt,{})}),Object(p.jsx)(de.a,{path:ir.FEEDS_UPDATE,element:Object(p.jsx)(Dn,{})}),Object(p.jsx)(de.a,{path:ir.FEEDS_PAGE,element:Object(p.jsx)(Cn,{})}),Object(p.jsx)(de.a,{path:ir.INFO,element:Object(p.jsx)(Ia,{})})]})},br=n(7),jr=n(901),hr=Object(br.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"}}}}}))(be.a),pr=Object(x.a)((function(e){return Object(m.a)({icon:{color:"inherit"},activeIcon:{color:e.palette.primary.main}})}));function Or(e){var t=e.iconStart,n=e.iconEnd,a=e.path,r=e.label,c=pr(),i=Object(de.f)(),o=Boolean(a&&Object(de.d)(i.pathname,a));return Object(p.jsxs)(hr,{button:!0,selected:o,disableRipple:!0,children:[Object(p.jsx)(jr.a,{className:o?c.activeIcon:c.icon,children:t}),Object(p.jsx)(je.a,{primary:r}),Object(p.jsx)(jr.a,{className:o?c.activeIcon:c.icon,children:n})]})}var fr=n(902),xr=Object(x.a)((function(e){return Object(m.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 mr(e){var t=e.path,n=Object(a.useContext)(V),r=n.status,c=n.isLoading,i=xr(),o=Object(de.f)(),s=Boolean(t&&Object(de.d)(o.pathname,t));return Object(p.jsxs)(be.a,{button:!0,classes:{root:"".concat(i.root," ").concat(r.all?"":i.rootError),button:i.button},selected:s,disableRipple:!0,children:[Object(p.jsx)(jr.a,{style:{marginLeft:"30px"},children:Object(p.jsx)(tr,{isOk:r.all,isLoading:c})}),Object(p.jsx)(je.a,{primary:Object(p.jsx)(he.a,{className:i.smallerText,children:"Node ".concat(r.all?"OK":"Error")})}),Object(p.jsx)(jr.a,{className:i.icon,children:r.all?null:Object(p.jsx)(fr.a,{className:i.iconSmall})})]})}var gr=[{label:"Info",path:ir.INFO,icon:ne.a},{label:"Upgrade",path:ir.UPGRADE,icon:ae.a},{label:"Files",path:ir.UPLOAD,icon:re.a},{label:"Feeds",path:ir.FEEDS,icon:ce.a},{label:"Stamps",path:ir.STAMPS,icon:ie.a},{label:"Accounting",path:ir.ACCOUNTING,icon:oe.a},{label:"Settings",path:ir.SETTINGS,icon:se.a}],vr=Object(x.a)((function(e){return Object(m.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 yr(){var e=vr();return Object(p.jsx)(J.a,{className:e.drawer,variant:"permanent",anchor:"left",classes:{paper:e.drawerPaper},children:Object(p.jsxs)(X.a,{container:!0,direction:"column",justifyContent:"space-between",className:e.root,children:[Object(p.jsx)(X.a,{className:e.logo,children:Object(p.jsx)(u.b,{to:ir.INFO,children:Object(p.jsx)("img",{alt:"swarm",src:ue})})}),Object(p.jsxs)(X.a,{children:[Object(p.jsx)($.a,{children:gr.map((function(t){return Object(p.jsx)(u.b,{to:t.path,className:e.link,children:Object(p.jsx)(Or,{iconStart:Object(p.jsx)(t.icon,{className:e.icon}),path:t.path,label:t.label},t.path)},t.path)}))}),Object(p.jsx)(Q.a,{className:e.divider}),Object(p.jsx)($.a,{children:Object(p.jsx)(ee.a,{href:_.a.BEE_DOCS_HOST,target:"_blank",className:e.link,children:Object(p.jsx)(Or,{iconStart:Object(p.jsx)(le.a,{className:e.icon}),iconEnd:Object(p.jsx)(te.a,{className:e.iconSmall}),label:Object(p.jsx)("span",{children:"Docs"})})})})]}),Object(p.jsx)(X.a,{children:Object(p.jsx)(u.b,{to:ir.STATUS,className:e.link,children:Object(p.jsx)(mr,{path:ir.STATUS})})})]})})}var wr,Sr=Object(x.a)((function(e){return Object(m.a)({content:{backgroundColor:e.palette.background.default,minHeight:"100vh"}})})),kr=function(e){var t=Sr(),n=Object(a.useContext)(V).isLoading;return Object(p.jsxs)("div",{style:{display:"flex"},children:[Object(p.jsx)(yr,{}),Object(p.jsx)(Z.a,{className:t.content,children:Object(p.jsx)(O,{children:Object(p.jsxs)(p.Fragment,{children:[Object(p.jsx)(G,{}),n?Object(p.jsx)("div",{style:{textAlign:"center",width:"100%"},children:Object(p.jsx)(K.a,{})}):e.children]})})})]})},Cr=n(351),Er=n(181),Ar=Object(Cr.a)({palette:{type:"light",background:{default:"#efefef"},primary:{light:"#fcf2e8",main:"#dd7700",dark:Er.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"}}});Ar.overrides={MuiListItem:{button:{"&:hover":{backgroundColor:"#fcf2e8",color:(wr=Ar).palette.primary.main,"@media (hover: none)":{backgroundColor:"#fcf2e8",color:wr.palette.primary.main}}}},MuiContainer:{root:{padding:wr.spacing(8)},maxWidthXs:{padding:wr.spacing(8)},maxWidthSm:{padding:wr.spacing(8)},maxWidthMd:{padding:wr.spacing(8)},maxWidthLg:{padding:wr.spacing(8)},maxWidthXl:{padding:wr.spacing(8)}},MuiButton:{startIcon:{marginLeft:wr.spacing(1)},endIcon:{marginRight:wr.spacing(1)},outlined:{border:"none",borderRadius:wr.spacing(10),color:wr.palette.primary.main,backgroundColor:"#fcf2e8"},outlinedSizeSmall:{padding:wr.spacing(1),paddingLeft:wr.spacing(2),paddingRight:wr.spacing(2),boxShadow:"none","&:hover":{backgroundColor:wr.palette.primary.main,color:"white",boxShadow:"none","@media (hover: none)":{backgroundColor:wr.palette.primary.main,color:"white",boxShadow:"none"}}},outlinedSizeLarge:{padding:wr.spacing(4),borderRadius:0,boxShadow:"none","&:hover":{backgroundColor:wr.palette.primary.main,color:"white",boxShadow:"none","@media (hover: none)":{backgroundColor:wr.palette.primary.main,color:"white",boxShadow:"none"}}},containedSizeLarge:{padding:wr.spacing(4),borderRadius:0,boxShadow:"none","&:hover":{backgroundColor:wr.palette.primary.main,color:"white",boxShadow:"none","@media (hover: none)":{backgroundColor:wr.palette.primary.main,color:"white",boxShadow:"none"}}},containedSizeSmall:{padding:wr.spacing(1),paddingLeft:wr.spacing(2),paddingRight:wr.spacing(2),borderRadius:0,boxShadow:"none","&:hover":{backgroundColor:wr.palette.primary.main,color:"white",boxShadow:"none","@media (hover: none)":{backgroundColor:wr.palette.primary.main,color:"white",boxShadow:"none"}}},contained:{padding:wr.spacing(2),backgroundColor:"white",boxShadow:"none",borderRadius:0,"&:hover":{backgroundColor:wr.palette.primary.main,color:"white",boxShadow:"none","@media (hover: none)":{backgroundColor:wr.palette.primary.main,color:"white",boxShadow:"none"}},"&:focus":{backgroundColor:wr.palette.primary.main,color:"white"},"&:active":{backgroundColor:wr.palette.primary.main,color:"white"},"&:disabled":{backgroundColor:"white"}}},MuiTab:{root:{backgroundColor:wr.palette.background.paper,"&:hover":{backgroundColor:"#fcf2e8",color:wr.palette.primary.main,opacity:1},"&$selected":{fontWeight:wr.typography.fontWeightMedium}},textColorInherit:{opacity:.5}},MuiTabs:{root:{borderBottom:"none"},indicator:{backgroundColor:"transparent"}}},Ar.props={MuiTab:{disableRipple:!0},MuiButtonBase:{disableRipple:!0}};var Pr=function(e){var t=e.beeApiUrl,n=e.beeDebugApiUrl,a=e.lockedApiSettings;return Object(p.jsx)("div",{className:"App",children:Object(p.jsx)(s.a,{theme:Ar,children:Object(p.jsx)(W,{beeApiUrl:t,beeDebugApiUrl:n,lockedApiSettings:a,children:Object(p.jsx)(q,{children:Object(p.jsx)(Bn,{children:Object(p.jsx)(wn,{children:Object(p.jsx)(ft,{children:Object(p.jsx)(Qa,{children:Object(p.jsx)(l.a,{children:Object(p.jsx)(u.a,{children:Object(p.jsxs)(p.Fragment,{children:[Object(p.jsx)(o.a,{}),Object(p.jsx)(kr,{children:Object(p.jsx)(dr,{})})]})})})})})})})})})})})},Tr=function(e){e&&e instanceof Function&&n.e(3).then(n.bind(null,918)).then((function(t){var n=t.getCLS,a=t.getFID,r=t.getFCP,c=t.getLCP,i=t.getTTFB;n(e),a(e),r(e),c(e),i(e)}))};i.a.render(Object(p.jsx)(r.a.StrictMode,{children:Object(p.jsx)(Pr,{})}),document.getElementById("root")),Tr()}},[[802,1,2]]]); +//# sourceMappingURL=main.8fd2d334.chunk.js.map \ No newline at end of file diff --git a/static/dashboard/static/js/main.8fd2d334.chunk.js.map b/static/dashboard/static/js/main.8fd2d334.chunk.js.map new file mode 100644 index 0000000..f9550c9 --- /dev/null +++ b/static/dashboard/static/js/main.8fd2d334.chunk.js.map @@ -0,0 +1 @@ +{"version":3,"sources":["utils/index.ts","models/Token.ts","utils/identity.ts","config.ts","components/ErrorBoundary.tsx","providers/Settings.tsx","providers/Bee.tsx","hooks/apiHooks.tsx","components/AlertVersion.tsx","assets/logo.svg","components/ExpandableList.tsx","components/ExpandableListItem.tsx","components/ExpandableListItemActions.tsx","components/ExpandableListItemKey.tsx","components/ClipboardCopy.tsx","components/QRCodeModal.tsx","components/EthereumAddress.tsx","components/CashoutModal.tsx","pages/accounting/PeerBalances.tsx","components/TroubleshootConnectionCard.tsx","hooks/accounting.ts","components/WithdrawDepositModal.tsx","containers/WithdrawModal.tsx","containers/DepositModal.tsx","pages/accounting/index.tsx","components/SwarmButton.tsx","providers/Feeds.tsx","components/SwarmDialog.tsx","components/CloseButton.tsx","components/TitleWithClose.tsx","pages/feeds/DeleteFeedDialog.tsx","components/Code.tsx","pages/feeds/ExportFeedDialog.tsx","components/SwarmTextInput.tsx","pages/feeds/ImportFeedDialog.tsx","pages/feeds/index.tsx","components/DocumentationText.tsx","components/HistoryHeader.tsx","components/SwarmSelect.tsx","pages/feeds/CreateNewFeed.tsx","components/ExpandableListItemLink.tsx","utils/file.ts","utils/image.ts","constants.ts","providers/File.tsx","pages/files/UploadArea.tsx","pages/feeds/FeedSubpage.tsx","providers/Stamps.tsx","pages/feeds/FeedPasswordDialog.tsx","pages/feeds/UpdateFeed.tsx","components/ExpandableListItemNote.tsx","components/ExpandableListItemInput.tsx","utils/local-storage.ts","utils/hash.ts","components/History.tsx","utils/date.ts","pages/files/FileNavigation.tsx","pages/files/Download.tsx","components/Loading.tsx","components/FitImage.tsx","components/StripedWrapper.tsx","pages/files/AssetIcon.tsx","pages/files/AssetPreview.tsx","pages/files/AssetSummary.tsx","pages/files/DownloadActionBar.tsx","pages/files/Share.tsx","components/ProgressIndicator.tsx","pages/stamps/PostageStampCreation.tsx","pages/stamps/PostageStampSelector.tsx","components/Capacity.tsx","pages/stamps/PostageStamp.tsx","pages/files/StampPreview.tsx","pages/files/UploadActionBar.tsx","pages/files/Upload.tsx","pages/files/UploadLander.tsx","utils/threshold.ts","components/TopologyStats.tsx","pages/info/index.tsx","pages/settings/index.tsx","components/ExpandableElement.tsx","pages/stamps/StampsTable.tsx","pages/stamps/index.tsx","pages/stamps/CreatePostageStampPage.tsx","components/TabsContainer.tsx","providers/Platform.tsx","components/CodeBlock.tsx","components/CodeBlockTabs.tsx","components/StatusIcon.tsx","pages/status/SetupSteps/DebugConnectionCheck.tsx","pages/status/SetupSteps/NodeConnectionCheck.tsx","pages/status/SetupSteps/VersionCheck.tsx","pages/status/SetupSteps/EthereumConnectionCheck.tsx","pages/status/SetupSteps/ChequebookDeployFund.tsx","routes.tsx","pages/status/SetupSteps/PeerConnection.tsx","pages/status/index.tsx","pages/upgrade/index.tsx","components/SideBarItem.tsx","components/SideBarStatus.tsx","components/SideBar.tsx","layout/Dashboard.tsx","theme.tsx","App.tsx","reportWebVitals.ts","index.tsx"],"names":["isInteger","value","BigNumber","isBigNumber","makeBigNumber","toString","TypeError","sleepMs","ms","a","Promise","resolve","setTimeout","unwrapPromiseSettlements","promiseSettledResults","promises","values","fulfilled","filter","promise","status","rejected","map","x","reason","String","makeRetriablePromise","fn","maxRetries","delayMs","reject","tries","results","extractSwarmHash","string","matches","match","uuidV4","replace","s","c","parseInt","crypto","getRandomValues","Uint8Array","formatEnum","charAt","toUpperCase","slice","toLowerCase","replaceAll","secondsToTimeString","seconds","unit","Math","round","toFixed","convertDepthToBytes","depth","convertAmountToSeconds","amount","pricePerBlock","calculateStampPrice","Token","BigInt","shortenText","text","length","separator","POSSIBLE_DECIMALS","decimals","includes","this","dividedBy","pow","digits","toDecimal","asString","indexOfSignificantDigit","reachedDecimalPoint","i","char","t","multipliedBy","generateWallet","buffer","Wallet","Buffer","from","persistIdentity","identities","identity","existingIndex","findIndex","uuid","splice","unshift","localStorage","setItem","JSON","stringify","persistIdentitiesWithoutUpdate","convertWalletToIdentity","type","name","password","Error","getPrivateKeyString","toV3String","identityString","address","getAddressString","importIdentity","data","getWallet","wallet","startsWith","parse","getWalletFromIdentity","fromPrivateKey","trimHexString","fromV3","updateFeed","beeApi","hash","stamp","feedHash","createFeedManifest","repeat","writer","makeFeedWriter","upload","getProcessEnv","key","process","config","BEE_API_HOST","BEE_DEBUG_API_HOST","BLOCKCHAIN_EXPLORER_URL","BEE_DOCS_HOST","BEE_DISCORD_HOST","GITHUB_REPO_URL","sessionStorage","getItem","ErrorBoundary","props","state","error","errorInfo","console","message","children","Component","initialValues","apiUrl","apiDebugUrl","beeDebugApi","setApiUrl","setDebugApiUrl","lockedApiSettings","Context","createContext","Consumer","Provider","beeApiUrl","beeDebugApiUrl","extLockedApiSettings","useState","setBeeApi","setBeeDebugApi","Boolean","url","debugUrl","useEffect","Bee","e","BeeDebug","startedInDevMode","window","location","search","all","version","blockchainConnection","debugApiConnection","apiConnection","topology","chequebook","latestPublishedVersion","undefined","latestUserVersion","latestUserVersionExact","isLatestBeeVersion","latestBeeVersionUrl","apiHealth","debugApiHealth","nodeAddresses","nodeInfo","chequebookAddress","peers","chequebookBalance","peerBalances","peerCheques","settlements","chainState","latestBeeRelease","isLoading","isRefreshing","lastUpdate","start","stop","refresh","getStatus","devMode","REACT_APP_DEV_MODE","beeMode","semver","satisfies","engines","bee","includePrerelease","ethereum","connected","totalBalance","toBigNumber","isGreaterThan","Object","every","v","useContext","SettingsContext","setApiHealth","setDebugApiHealth","setNodeAddresses","setNodeInfo","setNodeTopology","setChequebookAddress","setPeers","setChequebookBalance","setPeerBalances","setPeerCheques","setSettlements","setChainState","setLatestBeeRelease","isLoadingLatestBeeRelease","setLoading","setError","axios","get","then","res","catch","finally","useLatestBeeRelease","setIsLoading","setIsRefreshing","setLastUpdate","frequency","setFrequency","coerce","chequeBalanceWrapper","getChequebookBalance","availableBalance","peerBalanceWrapper","getAllBalances","balances","peer","balance","settlementsWrapper","getAllSettlements","totalReceived","totalSent","received","sent","isConnected","getHealth","getNodeAddresses","getNodeInfo","getTopology","getPeers","getChequebookAddress","getLastCheques","getChainState","allSettled","Date","now","interval","setInterval","clearInterval","html_url","freq","useStyles","makeStyles","theme","createStyles","root","width","marginBottom","spacing","VersionAlert","classes","open","setOpen","isExactlySupportedBeeVersion","SUPPORTED_BEE_VERSION_EXACT","Collapse","in","className","Alert","severity","action","IconButton","color","size","onClick","fontSize","AlertTitle","padding","margin","marginTop","rootLevel1","rootLevel2","header","backgroundColor","palette","background","paper","contentLevel0","contentLevel12","infoText","ExpandableList","label","level","defaultOpen","info","rootLevelClass","typographyVariant","contentLevelClass","ListItem","button","ListItemText","primary","Typography","variant","style","display","ExpandLess","ExpandMore","timeout","unmountOnExit","wordBreak","copyValue","cursor","borderRadius","main","ExpandableListItem","tooltip","Grid","container","direction","justifyContent","alignItems","Tooltip","title","placement","arrow","strokeWidth","wrapper","flexDirection","flexWrap","marginRight","ExpandableListItemActions","Array","isArray","borderLeft","headerOpen","content","keyMargin","ExpandableListItemKey","copied","setCopied","toggleOpen","tooltipClickHandler","tooltipCloseHandler","splitValues","nonPrefixLength","lengthWithoutPrefix","split","hasPrefix","test","spanText","onClose","component","ClipboardCopy","enqueueSnackbar","useSnackbar","marginLeft","height","QRCodeModal","FilterCenterFocusSharp","Dialog","textAlign","DialogTitle","id","bgColor","fgColor","includeMargin","renderAs","EthereumAddress","hideBlockie","paddingTop","truncate","maxWidth","overflow","textOverflow","whiteSpace","href","transaction","target","rel","CheckoutModal","peerId","uncashedAmount","loadingCashout","setLoadingCashout","handleClose","Button","startIcon","substr","DialogContent","DialogContentText","overflowWrap","Container","CircularProgress","DialogActions","cashoutLastCheque","disabled","PeerBalances","accounting","isLoadingUncashed","totalUncashed","toFixedDecimal","total","icon","TroubleshootConnectionCard","item","align","Link","to","ROUTES","STATUS","useAccounting","setIsloadingUncashed","uncashedAmounts","setUncashedAmounts","gt","getLastCashoutAction","forEach","plus","minus","sort","b","diff","toNumber","mergeAccounting","WithdrawDepositModal","successMessage","errorMessage","dialogMessage","min","max","setAmount","amountToken","setAmountToken","amountError","setAmountError","handleAction","toBigInt","transactionHash","stopPropagation","Input","autoFocus","placeholder","fullWidth","onChange","fromDecimal","isLessThan","FormHelperText","WithdrawModal","withdrawTokens","DepositModal","depositTokens","Accounting","BeeContext","position","stroke","transition","cancelButton","spinnerWrapper","left","top","transform","SwarmButton","iconType","loading","cancel","React","createElement","join","event","currentTarget","blur","setIdentities","SwarmDialog","PaperProps","Box","p","sx","CloseButton","fontWeight","TitleWithClose","DeleteFeedDialog","onConfirm","mb","Trash","X","pre","maxHeight","prettifyString","Code","prettify","ExportFeedDialog","Download","saveAs","Blob","Clipboard","navigator","clipboard","writeText","field","border","SwarmTextInput","optional","formik","defaultValue","TextField","required","InputProps","disableUnderline","textarea","displayNone","ImportFeedDialog","textareaValue","setTextareaValue","setName","fileInputRef","useRef","feed","onFeedReady","fileReader","FileReader","file","files","onload","result","readAsText","ref","TextareaAutosize","minRows","Upload","current","click","Check","Feeds","IdentityContext","navigate","useNavigate","selectedIdentity","setSelectedIdentity","showImport","setShowImport","showExport","setShowExport","showDelete","setShowDelete","onDialogClose","updatedFeeds","onDelete","PlusSquare","FEEDS_NEW","mt","FEEDS_PAGE","Info","DocumentationText","pressable","HistoryHeader","mr","ArrowBack","select","option","SwarmSelect","options","Select","MenuProps","MenuListProps","disablePadding","square","MenuItem","identityName","CreateNewFeed","FeedsContext","getAllPostageBatch","stamps","FEEDS","onSubmit","submitForm","bgcolor","openLinkIcon","ExpandableListItemLink","link","navigationType","allowClipboard","displayValue","onNavigation","OpenInNewSharp","ArrowForward","indexHtmls","detectIndexHtml","paths","getPath","exactMatch","find","indexPath","prefix","y","commonPrefix","getHumanReadableFileSize","bytes","getAssetNameFromFiles","f","path","webkitRelativePath","packageFile","fullPath","lastModified","stream","arrayBuffer","resize","reader","readAsDataURL","src","img","Image","dimensions","imgWidth","imgHeight","ratioWidth","ratioHeight","ratio","getDimensions","elem","document","ctx","getContext","drawImage","canvas","toBlob","blob","onerror","META_FILE_NAME","PREVIEW_FILE_NAME","PREVIEW_DIMENSIONS","defaultUploadOrigin","origin","setFiles","uploadOrigin","setUploadOrigin","metadata","setMetadata","previewUri","setPreviewUri","previewBlob","setPreviewBlob","reduce","isWebsite","count","getMetadata","URL","revokeObjectURL","createObjectURL","areaWrapper","dropzone","default","outline","zIndex","opacity","buttonWrapper","UploadArea","showHelp","strictWebsiteMode","setStrictWebsiteMode","setVersion","getDropzoneInputDomElement","querySelector","onUploadCollectionClick","element","setAttribute","dropzoneClass","FilePaths","indexDocument","UPLOAD_IN_PROGRESS","filesLimit","maxFileSize","showPreviews","removeAttribute","FilePlus","FolderPlus","PlusCircle","FeedSubpage","useParams","available","setAvailable","downloadData","swarmCid","enrichStamp","postageBatch","bucketDepth","usage","utilization","usageText","ceil","setStamps","FeedPasswordDialog","feedName","onProceed","onCancel","setPassword","UpdateFeed","StampContext","selectedStamp","setSelectedStamp","showPasswordPrompt","setShowPasswordPrompt","onFeedUpdate","Reflect","batchID","batchId","Bookmark","typography","ExpandableListItemNote","HISTORY_KEYS","unselectableLabel","userSelect","WebkitUserSelect","MozUserSelect","msUserSelect","confirmLabel","confirmLabelDisabled","expandedOnly","helperText","mapperFn","locked","inputValue","setInputValue","InputBase","hidden","Search","shortenHash","sliceLength","putHistory","history","getHistorySafe","createdAt","items","parsed","isHistoryItem","determineHistoryName","History","localStorageKey","setItems","date","trim","flexGrow","leftTab","rightTab","FileNavigation","active","Tabs","newValue","DOWNLOAD","UPLOAD","Tab","referenceError","setReferenceError","identifier","manifestJs","ManifestJs","resolveFeedManifest","feedIdentifier","isManifest","getIndexDocumentPath","DOWNLOAD_HISTORY","HASH","onSwarmIdentifier","Utils","isHexString","recognizeSwarmHash","Loading","image","objectFit","FitImage","inlineStyles","alt","StripedWrapper","AssetIcon","AssetPreview","previewComponent","Web","AssetSummary","DownloadActionBar","onOpen","onDownload","onUpdateFeed","hasIndexDocument","Share","reference","downloading","setDownloading","swarmEntries","setSwarmEntries","setIndexDocument","notFound","setNotFound","preview","setPreview","getHashes","entries","previewFile","keys","downloadFile","mtdt","remoteMetadata","zip","JSZip","generateAsync","prepare","FEEDS_UPDATE","flex","todo","inProgress","done","ProgressIndicator","steps","index","pickClass","initialFormValues","PostageStampCreation","onFinished","StampsContext","getTtl","isCurrentPriceAvailable","currentPrice","Number","getPrice","isNaN","price","toSignificantDigits","actions","createPostageBatch","resetForm","setSubmitting","validate","errors","isLessThanOrEqualTo","isValid","isSubmitting","PostageStampSelector","onSelect","stampId","Capacity","integerUsage","used","free","PostageStamp","shorten","StampPreview","UploadActionBar","step","onUpload","onGoBack","isUploading","hasStamp","uploadLabel","stampMode","setStampMode","Layers","ArrowLeft","setStep","setStamp","setUploading","FileContext","uploadFiles","fls","idx","substrStart","mtd","metafile","File","push","UPLOAD_HISTORY","UploadLander","OPTIMAL_POPULATION","GENERIC_ERROR","THRESHOLDS","connectedPeers","minimumValue","explanation","score","population","toLocaleString","pickThreshold","thresholds","maximumScore","last","TopologyStats","maximumTotalScore","sum","actualTotalScore","percentageText","Status","publicKey","pssPublicKey","overlay","underlay","addr","Settings","ExpandableElement","expandable","StampsTable","postageStamps","Stamp","STAMPS_NEW","CreatePostageStampPage","STAMPS","TabPanel","other","role","SimpleTabs","indexChanged","setValue","Platforms","SupportedPlatforms","CodeBlock","language","showLineNumbers","code","macOS","Linux","platform","setPlatform","os","userAgent","iOS","Windows","Android","getOS","isSupportedPlatform","CodeBlockTabs","linux","mac","StatusIcon","isOk","NodeConnectionCheck","elevation","VersionCheck","EthereumConnectionCheck","ChequebookDeployFund","PeerConnection","NodeSetupWorkflow","UpgradePage","node","setNode","rpcProvider","setRpcProvider","fetch","r","json","method","headers","body","jsonrpc","params","balanceResponse","Send","BaseRouter","UPGRADE","ACCOUNTING","SETTINGS","INFO","StyledListItem","withStyles","paddingLeft","paddingRight","activeIcon","SideBarItem","iconStart","iconEnd","useLocation","isSelected","matchPath","pathname","selected","disableRipple","ListItemIcon","iconSmall","rootError","smallerText","navBarItems","Home","FileText","DollarSign","minHeight","paddingBottom","drawer","flexShrink","drawerPaper","logo","divider","textDecoration","SideBar","Drawer","anchor","Logo","List","Divider","Dashboard","createTheme","light","dark","orange","secondary","fontFamily","h1","h2","h3","body2","overrides","MuiListItem","MuiContainer","maxWidthXs","maxWidthSm","maxWidthMd","maxWidthLg","maxWidthXl","MuiButton","endIcon","outlined","outlinedSizeSmall","boxShadow","outlinedSizeLarge","containedSizeLarge","containedSizeSmall","contained","MuiTab","fontWeightMedium","textColorInherit","MuiTabs","borderBottom","indicator","MuiButtonBase","App","ThemeProvider","CssBaseline","reportWebVitals","onPerfEntry","Function","getCLS","getFID","getFCP","getLCP","getTTFB","ReactDOM","render","StrictMode","getElementById"],"mappings":"mlBAUO,SAASA,EAAUC,GACxB,OAAQC,YAAUC,YAAYF,IAAUA,EAAMD,aAAiC,kBAAVC,EAYhE,SAASG,EAAcH,GAC5B,GAAIC,YAAUC,YAAYF,GAAQ,OAAO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SAM1BX,O","file":"static/js/main.8fd2d334.chunk.js","sourcesContent":["import { BigNumber } from 'bignumber.js'\nimport { Token } from '../models/Token'\n\n/**\n * Test if value is an integer\n *\n * @param value Value to be tested if it is an integer\n *\n * @returns True if the passed in value is integer\n */\nexport function isInteger(value: unknown): value is BigNumber | bigint {\n return (BigNumber.isBigNumber(value) && value.isInteger()) || typeof value === 'bigint'\n}\n\n/**\n *Convert value into a BigNumber if not already\n *\n * @param value Value to be converted\n *\n * @throws {TypeError} if the value is not convertible to a BigNumber\n *\n * @returns BigNumber - but it may still be NaN or Infinite\n */\nexport function makeBigNumber(value: BigNumber | BigInt | number | string): BigNumber | never {\n if (BigNumber.isBigNumber(value)) return value\n\n if (typeof value === 'string') return new BigNumber(value)\n\n if (typeof value === 'bigint') return new BigNumber(value.toString())\n\n // FIXME: bee-js still returns some values as numbers and even outside of SAFE INTEGER bounds\n if (typeof value === 'number' /* && Number.isSafeInteger(value)*/) return new BigNumber(value)\n\n throw new TypeError(`Not a BigNumber or BigNumber convertible value. Type: ${typeof value} value: ${value}`)\n}\n\nexport type PromiseSettlements = {\n fulfilled: PromiseFulfilledResult[]\n rejected: PromiseRejectedResult[]\n}\n\nexport type UnwrappedPromiseSettlements = {\n fulfilled: T[]\n rejected: string[]\n}\n\nexport async function sleepMs(ms: number): Promise {\n await new Promise(resolve =>\n setTimeout(() => {\n resolve()\n }, ms),\n )\n}\n\n/**\n * Maps the returned results of `Promise.allSettled` to an object\n * with `fulfilled` and `rejected` arrays for easy access.\n *\n * The results still need to be unwrapped to get the fulfilled values or rejection reasons.\n */\nexport function mapPromiseSettlements(promises: PromiseSettledResult[]): PromiseSettlements {\n const fulfilled = promises.filter(promise => promise.status === 'fulfilled') as PromiseFulfilledResult[]\n const rejected = promises.filter(promise => promise.status === 'rejected') as PromiseRejectedResult[]\n\n return { fulfilled, rejected }\n}\n\n/**\n * Maps the returned values of `Promise.allSettled` to an object\n * with `fulfilled` and `rejected` arrays for easy access.\n *\n * For rejected promises, the value is the stringified `reason`,\n * or `'Unknown error'` string when it is unavailable.\n */\nexport function unwrapPromiseSettlements(\n promiseSettledResults: PromiseSettledResult[],\n): UnwrappedPromiseSettlements {\n const values = mapPromiseSettlements(promiseSettledResults)\n const fulfilled = values.fulfilled.map(x => x.value)\n const rejected = values.rejected.map(x => (x.reason ? String(x.reason) : 'Unknown error'))\n\n return { fulfilled, rejected }\n}\n\n/**\n * Wraps a `Promise` or async function inside a new `Promise`,\n * which retries the original function up to `maxRetries` times,\n * waiting `delayMs` milliseconds between failed attempts.\n *\n * If all attempts fail, then this `Promise` also rejects.\n */\nexport function makeRetriablePromise(fn: () => Promise, maxRetries = 3, delayMs = 1000): Promise {\n return new Promise(async (resolve, reject) => {\n for (let tries = 0; tries < maxRetries; tries++) {\n try {\n const results = await fn()\n resolve(results)\n\n return\n } catch (error) {\n if (tries < maxRetries - 1) {\n await sleepMs(delayMs)\n } else {\n reject(error)\n }\n }\n }\n })\n}\n\nexport function extractSwarmHash(string: string): string | null {\n const matches = string.match(/[a-fA-F0-9]{64,128}/)\n\n return (matches && matches[0]) || null\n}\n\nexport function uuidV4(): string {\n const pattern = '10000000-1000-4000-8000-100000000000'\n\n return pattern.replace(/[018]/g, (s: string) => {\n const c = parseInt(s, 10)\n\n return (c ^ (crypto.getRandomValues(new Uint8Array(1))[0] & (15 >> (c / 4)))).toString(16)\n })\n}\n\nexport function formatEnum(string: string): string {\n return (string.charAt(0).toUpperCase() + string.slice(1).toLowerCase()).replaceAll('_', ' ')\n}\n\nexport function secondsToTimeString(seconds: number): string {\n let unit = seconds\n\n if (unit < 120) {\n return `${seconds} seconds`\n }\n unit /= 60\n\n if (unit < 120) {\n return `${Math.round(unit)} minutes`\n }\n unit /= 60\n\n if (unit < 48) {\n return `${Math.round(unit)} hours`\n }\n unit /= 24\n\n if (unit < 14) {\n return `${Math.round(unit)} days`\n }\n unit /= 7\n\n if (unit < 52) {\n return `${Math.round(unit)} weeks`\n }\n unit /= 52\n\n return `${unit.toFixed(1)} years`\n}\n\nexport function convertDepthToBytes(depth: number): number {\n return 2 ** depth * 4096\n}\n\nexport function convertAmountToSeconds(amount: number, pricePerBlock: number): number {\n // TODO: blocktime should come directly from the blockchain as it may differ between different networks\n const blockTime = 5 // On mainnet there is 5 seconds between blocks\n\n // See https://github.com/ethersphere/bee/blob/66f079930d739182c4c79eb6008784afeeba1096/pkg/debugapi/postage.go#L410-L413\n return (amount * blockTime) / pricePerBlock\n}\n\nexport function calculateStampPrice(depth: number, amount: bigint): Token {\n // See https://github.com/ethersphere/bee/blob/66f079930d739182c4c79eb6008784afeeba1096/pkg/debugapi/postage.go#L410-L413\n return new Token(amount * BigInt(2 ** depth)) // FIXME: the 2 ** depth should be performed on bigint already\n}\n\nexport function shortenText(text: string, length = 20, separator = '[…]'): string {\n if (text.length <= length * 2 + separator.length) {\n return text\n }\n\n return `${text.slice(0, length)}${separator}${text.slice(-length)}`\n}\n","import { BigNumber } from 'bignumber.js'\nimport { isInteger, makeBigNumber } from '../utils'\n\nconst POSSIBLE_DECIMALS = [18, 17, 16, 15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0]\ntype digits = typeof POSSIBLE_DECIMALS[number]\n\nconst BZZ_DECIMALS = 16\n\nexport class Token {\n private amount: BigNumber // Represented in the base units, so it is always an integer value\n private readonly decimals: digits\n\n constructor(amount: BigNumber | string | BigInt, decimals: digits = BZZ_DECIMALS) {\n const a = makeBigNumber(amount)\n\n if (!isInteger(a) || !POSSIBLE_DECIMALS.includes(decimals)) throw new TypeError('Not a valid token values')\n\n this.amount = a\n this.decimals = decimals\n }\n\n /**\n * Construct new Token from a digit representation\n *\n * @param amount Amount of a token in the digits (1 token = 10^decimals)\n * @param decimals Number of decimals for the token (must be integer)\n *\n * @throws {TypeError} If the decimals is not an integer or the amount after conversion is not an integer\n *\n * @returns new Token\n */\n static fromDecimal(amount: BigNumber | string | BigInt, decimals: digits = BZZ_DECIMALS): Token | never {\n const a = makeBigNumber(amount)\n\n // No need to do any validation here, it is done when the new token is created\n const t = a.multipliedBy(new BigNumber(10).pow(decimals))\n\n return new Token(t, decimals)\n }\n\n get toBigInt(): BigInt {\n return BigInt(this.amount.toFixed(0))\n }\n\n get toString(): string {\n return this.amount.toFixed(0)\n }\n\n get toBigNumber(): BigNumber {\n return new BigNumber(this.amount)\n }\n\n get toDecimal(): BigNumber {\n return this.amount.dividedBy(new BigNumber(10).pow(this.decimals))\n }\n\n toFixedDecimal(digits = 7): string {\n return this.toDecimal.toFixed(digits)\n }\n\n toSignificantDigits(digits = 4): string {\n const asString = this.toDecimal.toFixed(16)\n\n let indexOfSignificantDigit = -1\n let reachedDecimalPoint = false\n\n for (let i = 0; i < asString.length; i++) {\n const char = asString[i]\n\n if (char === '.') {\n reachedDecimalPoint = true\n indexOfSignificantDigit = i + 1\n } else if (reachedDecimalPoint && char !== '0') {\n indexOfSignificantDigit = i\n break\n }\n }\n\n return asString.slice(0, indexOfSignificantDigit + digits)\n }\n}\n","import { Bee, Reference } from '@ethersphere/bee-js'\nimport Wallet from 'ethereumjs-wallet'\nimport { uuidV4 } from '.'\nimport { Identity, IdentityType } from '../providers/Feeds'\n\nexport function generateWallet(): Wallet {\n const buffer = new Uint8Array(32)\n crypto.getRandomValues(buffer)\n const wallet = new Wallet(Buffer.from(buffer))\n\n return wallet\n}\n\nexport function persistIdentity(identities: Identity[], identity: Identity): void {\n const existingIndex = identities.findIndex(x => x.uuid === identity.uuid)\n\n if (existingIndex !== -1) {\n identities.splice(existingIndex, 1)\n }\n identities.unshift(identity)\n localStorage.setItem('feeds', JSON.stringify(identities))\n}\n\nexport function persistIdentitiesWithoutUpdate(identities: Identity[]): void {\n localStorage.setItem('feeds', JSON.stringify(identities))\n}\n\nexport async function convertWalletToIdentity(\n identity: Wallet,\n type: IdentityType,\n name: string,\n password?: string,\n): Promise {\n if (type === 'V3' && !password) {\n throw Error('V3 passwords require password')\n }\n\n const identityString =\n type === 'PRIVATE_KEY' ? identity.getPrivateKeyString() : await identity.toV3String(password as string)\n\n return {\n uuid: uuidV4(),\n name,\n type: password ? 'V3' : 'PRIVATE_KEY',\n address: identity.getAddressString(),\n identity: identityString,\n }\n}\n\nexport async function importIdentity(name: string, data: string): Promise {\n if (data.length === 64) {\n const wallet = await getWallet('PRIVATE_KEY', data)\n\n return {\n uuid: uuidV4(),\n name,\n type: 'PRIVATE_KEY',\n identity: data,\n address: wallet.getAddressString(),\n }\n }\n\n if (data.length === 66 && data.toLowerCase().startsWith('0x')) {\n const wallet = await getWallet('PRIVATE_KEY', data.slice(2))\n\n return { uuid: uuidV4(), name, type: 'PRIVATE_KEY', identity: data, address: wallet.getAddressString() }\n }\n try {\n const { address } = JSON.parse(data)\n\n return { uuid: uuidV4(), name, type: 'V3', identity: data, address }\n } catch {\n return null\n }\n}\n\nfunction getWalletFromIdentity(identity: Identity, password?: string): Promise {\n return getWallet(identity.type, identity.identity, password)\n}\n\nasync function getWallet(type: IdentityType, data: string, password?: string): Promise {\n return type === 'PRIVATE_KEY'\n ? Wallet.fromPrivateKey(Buffer.from(trimHexString(data), 'hex'))\n : await Wallet.fromV3(data, password as string)\n}\n\nexport async function updateFeed(\n beeApi: Bee,\n identity: Identity,\n hash: string,\n stamp: string,\n password?: string,\n): Promise {\n const wallet = await getWalletFromIdentity(identity, password)\n\n if (!identity.feedHash) {\n identity.feedHash = await beeApi.createFeedManifest(stamp, 'sequence', '00'.repeat(32), wallet.getAddressString())\n }\n\n const writer = beeApi.makeFeedWriter('sequence', '00'.repeat(32), wallet.getPrivateKeyString())\n await writer.upload(stamp, hash as Reference)\n}\n\nfunction trimHexString(string: string): string {\n if (string.toLowerCase().startsWith('0x')) {\n return string.slice(2)\n }\n\n return string\n}\n","function getProcessEnv(key: string): string | undefined | false {\n return typeof process === 'object' && process.env[key]\n}\n\nclass Config {\n public readonly BEE_API_HOST: string\n public readonly BEE_DEBUG_API_HOST: string\n public readonly BLOCKCHAIN_EXPLORER_URL: string\n public readonly BEE_DOCS_HOST: string\n public readonly BEE_DISCORD_HOST: string\n public readonly GITHUB_REPO_URL: string\n\n constructor() {\n this.BEE_API_HOST =\n sessionStorage.getItem('api_host') || getProcessEnv('REACT_APP_BEE_HOST') || 'http://localhost:1633'\n this.BEE_DEBUG_API_HOST =\n sessionStorage.getItem('debug_api_host') || getProcessEnv('REACT_APP_BEE_DEBUG_HOST') || 'http://localhost:1635'\n this.BLOCKCHAIN_EXPLORER_URL =\n getProcessEnv('REACT_APP_BLOCKCHAIN_EXPLORER_URL') || 'https://blockscout.com/xdai/mainnet'\n this.BEE_DOCS_HOST = getProcessEnv('REACT_APP_BEE_DOCS_HOST') || 'https://docs.ethswarm.org/docs/'\n this.BEE_DISCORD_HOST = getProcessEnv('REACT_APP_BEE_DISCORD_HOST') || 'https://discord.gg/eKr9XPv7'\n this.GITHUB_REPO_URL =\n getProcessEnv('REACT_APP_BEE_GITHUB_REPO_URL') || 'https://api.github.com/repos/ethersphere/bee'\n }\n}\n\nexport const config = new Config()\n\nexport default config\n","import { Component, ErrorInfo, ReactElement } from 'react'\n\ninterface Props {\n children: ReactElement\n}\n\ninterface State {\n error: Error | null\n}\n\nexport default class ErrorBoundary extends Component {\n constructor(props: Props) {\n super(props)\n this.state = { error: null }\n }\n\n static getDerivedStateFromError(error: Error): { error: Error } {\n // Update state so the next render will show the fallback UI.\n return { error }\n }\n\n componentDidCatch(error: Error, errorInfo: ErrorInfo): void {\n // You can also log the error to an error reporting service\n console.error({ error, errorInfo }) // eslint-disable-line\n }\n\n render(): ReactElement {\n if (this.state.error) {\n // You can render any custom fallback UI\n return

Something went wrong. Error: {this.state.error.message}

\n }\n\n return this.props.children\n }\n}\n","import { Bee, BeeDebug } from '@ethersphere/bee-js'\nimport { createContext, ReactChild, ReactElement, useEffect, useState } from 'react'\nimport { config } from '../config'\n\ninterface ContextInterface {\n apiUrl: string\n apiDebugUrl: string\n beeApi: Bee | null\n beeDebugApi: BeeDebug | null\n setApiUrl: (url: string) => void\n setDebugApiUrl: (url: string) => void\n lockedApiSettings: boolean\n}\n\nconst initialValues: ContextInterface = {\n apiUrl: config.BEE_API_HOST,\n apiDebugUrl: config.BEE_DEBUG_API_HOST,\n beeApi: null,\n beeDebugApi: null,\n setApiUrl: () => {}, // eslint-disable-line\n setDebugApiUrl: () => {}, // eslint-disable-line\n lockedApiSettings: false,\n}\n\nexport const Context = createContext(initialValues)\nexport const Consumer = Context.Consumer\n\ninterface Props {\n children: ReactChild\n beeApiUrl?: string\n beeDebugApiUrl?: string\n lockedApiSettings?: boolean\n}\n\nexport function Provider({\n children,\n beeApiUrl,\n beeDebugApiUrl,\n lockedApiSettings: extLockedApiSettings,\n}: Props): ReactElement {\n const [apiUrl, setApiUrl] = useState(initialValues.apiUrl)\n const [apiDebugUrl, setDebugApiUrl] = useState(initialValues.apiDebugUrl)\n const [beeApi, setBeeApi] = useState(null)\n const [beeDebugApi, setBeeDebugApi] = useState(null)\n const [lockedApiSettings] = useState(Boolean(extLockedApiSettings))\n\n const url = beeApiUrl || apiUrl\n const debugUrl = beeDebugApiUrl || apiDebugUrl\n\n useEffect(() => {\n try {\n setBeeApi(new Bee(url))\n sessionStorage.setItem('api_host', url)\n } catch (e) {\n setBeeApi(null)\n }\n }, [url])\n\n useEffect(() => {\n try {\n setBeeDebugApi(new BeeDebug(debugUrl))\n sessionStorage.setItem('debug_api_host', debugUrl)\n } catch (e) {\n setBeeDebugApi(null)\n }\n }, [debugUrl])\n\n return (\n \n {children}\n \n )\n}\n","import type {\n ChainState,\n ChequebookAddressResponse,\n Health,\n LastChequesResponse,\n NodeAddresses,\n NodesInfo,\n Peer,\n Topology,\n} from '@ethersphere/bee-js'\nimport { createContext, ReactChild, ReactElement, useContext, useEffect, useState } from 'react'\nimport semver from 'semver'\nimport { engines } from '../../package.json'\nimport { useLatestBeeRelease } from '../hooks/apiHooks'\nimport { Token } from '../models/Token'\nimport type { Balance, ChequebookBalance, Settlements } from '../types'\nimport { Context as SettingsContext } from './Settings'\n\ninterface Status {\n all: boolean\n version: boolean\n blockchainConnection: boolean\n debugApiConnection: boolean\n apiConnection: boolean\n topology: boolean\n chequebook: boolean\n}\n\ninterface ContextInterface {\n status: Status\n latestPublishedVersion?: string\n latestUserVersion?: string\n latestUserVersionExact?: string\n isLatestBeeVersion: boolean\n latestBeeVersionUrl: string\n error: Error | null\n apiHealth: boolean\n debugApiHealth: Health | null\n nodeAddresses: NodeAddresses | null\n nodeInfo: NodesInfo | null\n topology: Topology | null\n chequebookAddress: ChequebookAddressResponse | null\n peers: Peer[] | null\n chequebookBalance: ChequebookBalance | null\n peerBalances: Balance[] | null\n peerCheques: LastChequesResponse | null\n settlements: Settlements | null\n chainState: ChainState | null\n latestBeeRelease: LatestBeeRelease | null\n isLoading: boolean\n isRefreshing: boolean\n lastUpdate: number | null\n start: (frequency?: number) => void\n stop: () => void\n refresh: () => Promise\n}\n\nconst startedInDevMode = window.location.search.includes('devMode=1')\n\nconst initialValues: ContextInterface = {\n status: {\n all: false,\n version: false,\n blockchainConnection: false,\n debugApiConnection: false,\n apiConnection: false,\n topology: false,\n chequebook: false,\n },\n latestPublishedVersion: undefined,\n latestUserVersion: undefined,\n latestUserVersionExact: undefined,\n isLatestBeeVersion: false,\n latestBeeVersionUrl: 'https://github.com/ethersphere/bee/releases/latest',\n error: null,\n apiHealth: false,\n debugApiHealth: null,\n nodeAddresses: null,\n nodeInfo: null,\n topology: null,\n chequebookAddress: null,\n peers: null,\n chequebookBalance: null,\n peerBalances: null,\n peerCheques: null,\n settlements: null,\n chainState: null,\n latestBeeRelease: null,\n isLoading: true,\n isRefreshing: false,\n lastUpdate: null,\n start: () => {}, // eslint-disable-line\n stop: () => {}, // eslint-disable-line\n refresh: () => Promise.reject(),\n}\n\nexport const Context = createContext(initialValues)\nexport const Consumer = Context.Consumer\n\ninterface Props {\n children: ReactChild\n}\n\nfunction isUltraLight(string?: string) {\n return string === 'ultra-light'\n}\n\nfunction getStatus(\n debugApiHealth: Health | null,\n nodeAddresses: NodeAddresses | null,\n nodeInfo: NodesInfo | null,\n apiHealth: boolean,\n topology: Topology | null,\n chequebookAddress: ChequebookAddressResponse | null,\n chequebookBalance: ChequebookBalance | null,\n error: Error | null,\n): Status {\n // FIXME: `devMode` is a temporary workaround to be able to develop with only one node\n const devMode = startedInDevMode || Boolean(process.env.REACT_APP_DEV_MODE) || nodeInfo?.beeMode === 'dev'\n const status = {\n version: Boolean(\n debugApiHealth &&\n semver.satisfies(debugApiHealth.version, engines.bee, {\n includePrerelease: true,\n }),\n ),\n blockchainConnection: Boolean(nodeAddresses?.ethereum),\n debugApiConnection: Boolean(debugApiHealth?.status === 'ok'),\n apiConnection: apiHealth,\n topology: Boolean(topology?.connected && topology?.connected > 0) || devMode,\n chequebook:\n (Boolean(chequebookAddress?.chequebookAddress) &&\n chequebookBalance !== null &&\n chequebookBalance?.totalBalance.toBigNumber.isGreaterThan(0)) ||\n devMode ||\n isUltraLight(nodeInfo?.beeMode),\n }\n\n return { ...status, all: !error && Object.values(status).every(v => v) }\n}\n\nexport function Provider({ children }: Props): ReactElement {\n const { beeApi, beeDebugApi } = useContext(SettingsContext)\n const [apiHealth, setApiHealth] = useState(false)\n const [debugApiHealth, setDebugApiHealth] = useState(null)\n const [nodeAddresses, setNodeAddresses] = useState(null)\n const [nodeInfo, setNodeInfo] = useState(null)\n const [topology, setNodeTopology] = useState(null)\n const [chequebookAddress, setChequebookAddress] = useState(null)\n const [peers, setPeers] = useState(null)\n const [chequebookBalance, setChequebookBalance] = useState(null)\n const [peerBalances, setPeerBalances] = useState(null)\n const [peerCheques, setPeerCheques] = useState(null)\n const [settlements, setSettlements] = useState(null)\n const [chainState, setChainState] = useState(null)\n\n const { latestBeeRelease } = useLatestBeeRelease()\n\n const [error, setError] = useState(initialValues.error)\n const [isLoading, setIsLoading] = useState(initialValues.isLoading)\n const [isRefreshing, setIsRefreshing] = useState(initialValues.isRefreshing)\n const [lastUpdate, setLastUpdate] = useState(initialValues.lastUpdate)\n const [frequency, setFrequency] = useState(30000)\n\n const latestPublishedVersion = semver.coerce(latestBeeRelease?.name)?.version\n const latestUserVersion = semver.coerce(debugApiHealth?.version)?.version\n const latestUserVersionExact = debugApiHealth?.version\n\n useEffect(() => {\n setIsLoading(true)\n\n setApiHealth(false)\n\n refresh()\n }, [beeApi]) // eslint-disable-line react-hooks/exhaustive-deps\n\n useEffect(() => {\n setIsLoading(true)\n\n setDebugApiHealth(null)\n setNodeAddresses(null)\n setNodeTopology(null)\n setNodeInfo(null)\n setPeers(null)\n setChequebookAddress(null)\n setChequebookBalance(null)\n setPeerBalances(null)\n setPeerCheques(null)\n setSettlements(null)\n setChainState(null)\n\n refresh()\n }, [beeDebugApi]) // eslint-disable-line react-hooks/exhaustive-deps\n\n const refresh = async () => {\n // Don't want to refresh when already refreshing\n if (isRefreshing) return\n\n // Not a valid bee api\n if (!beeApi || !beeDebugApi) {\n setIsLoading(false)\n\n return\n }\n\n try {\n setIsRefreshing(true)\n setError(null)\n\n // Wrap the chequebook balance call to return BZZ values as Token object\n const chequeBalanceWrapper = async () => {\n const { totalBalance, availableBalance } = await beeDebugApi.getChequebookBalance()\n\n return {\n totalBalance: new Token(totalBalance),\n availableBalance: new Token(availableBalance),\n }\n }\n\n // Wrap the balances call to return BZZ values as Token object\n const peerBalanceWrapper = async () => {\n const { balances } = await beeDebugApi.getAllBalances()\n\n return balances.map(({ peer, balance }) => ({ peer, balance: new Token(balance) }))\n }\n\n // Wrap the settlements call to return BZZ values as Token object\n const settlementsWrapper = async () => {\n const { totalReceived, settlements, totalSent } = await beeDebugApi.getAllSettlements()\n\n return {\n totalReceived: new Token(totalReceived),\n totalSent: new Token(totalSent),\n settlements: settlements.map(({ peer, received, sent }) => ({\n peer,\n received: new Token(received),\n sent: new Token(sent),\n })),\n }\n }\n\n const promises = [\n // API health\n beeApi\n .isConnected()\n .then(setApiHealth)\n .catch(() => setApiHealth(false)),\n\n // Debug API health\n beeDebugApi\n .getHealth()\n .then(setDebugApiHealth)\n .catch(() => setDebugApiHealth(null)),\n\n // Node Addresses\n beeDebugApi\n .getNodeAddresses()\n .then(setNodeAddresses)\n .catch(() => setNodeAddresses(null)),\n\n // NodeInfo\n beeDebugApi\n .getNodeInfo()\n .then(setNodeInfo)\n .catch(() => setNodeInfo(null)),\n\n // Network Topology\n beeDebugApi\n .getTopology()\n .then(setNodeTopology)\n .catch(() => setNodeTopology(null)),\n\n // Peers\n beeDebugApi\n .getPeers()\n .then(setPeers)\n .catch(() => setPeers(null)),\n\n // Chequebook address\n beeDebugApi\n .getChequebookAddress()\n .then(setChequebookAddress)\n .catch(() => setChequebookAddress(null)),\n\n // Cheques\n beeDebugApi\n .getLastCheques()\n .then(setPeerCheques)\n .catch(() => setPeerCheques(null)),\n\n // Chain state\n beeDebugApi\n .getChainState()\n .then(setChainState)\n .catch(() => setChainState(null)),\n\n // Chequebook balance\n chequeBalanceWrapper()\n .then(setChequebookBalance)\n .catch(() => setChequebookBalance(null)),\n\n // Peer balances\n peerBalanceWrapper()\n .then(setPeerBalances)\n .catch(() => setPeerBalances(null)),\n\n // Settlements\n settlementsWrapper()\n .then(setSettlements)\n .catch(() => setSettlements(null)),\n ]\n\n await Promise.allSettled(promises)\n } catch (e) {\n setError(e as Error)\n } finally {\n setIsLoading(false)\n setIsRefreshing(false)\n setLastUpdate(Date.now())\n }\n }\n\n const start = (freq = 30000) => setFrequency(freq)\n const stop = () => setFrequency(null)\n\n // Start the update loop\n useEffect(() => {\n refresh()\n\n // Start autorefresh only if the frequency is set\n if (frequency) {\n const interval = setInterval(refresh, frequency)\n\n return () => clearInterval(interval)\n }\n }, [frequency, beeDebugApi, beeApi]) // eslint-disable-line react-hooks/exhaustive-deps\n\n return (\n \n {children}\n \n )\n}\n","import axios from 'axios'\nimport { useEffect, useState } from 'react'\nimport { config } from '../config'\n\nexport interface LatestBeeReleaseHook {\n latestBeeRelease: LatestBeeRelease | null\n isLoadingLatestBeeRelease: boolean\n error: Error | null\n}\n\nexport const useLatestBeeRelease = (): LatestBeeReleaseHook => {\n const [latestBeeRelease, setLatestBeeRelease] = useState(null)\n const [isLoadingLatestBeeRelease, setLoading] = useState(false)\n const [error, setError] = useState(null)\n\n useEffect(() => {\n axios\n .get(`${config.GITHUB_REPO_URL}/releases/latest`)\n .then(res => {\n setLatestBeeRelease(res.data)\n })\n .catch((error: Error) => {\n setError(error)\n })\n .finally(() => {\n setLoading(false)\n })\n }, [])\n\n return { latestBeeRelease, isLoadingLatestBeeRelease, error }\n}\n","import { ReactElement, useState, useContext } from 'react'\nimport { makeStyles, Theme, createStyles } from '@material-ui/core/styles'\nimport { Alert, AlertTitle } from '@material-ui/lab'\nimport Collapse from '@material-ui/core/Collapse'\nimport IconButton from '@material-ui/core/IconButton'\nimport CloseIcon from '@material-ui/icons/Close'\nimport { Context } from '../providers/Bee'\nimport { SUPPORTED_BEE_VERSION_EXACT } from '@ethersphere/bee-js'\n\nconst useStyles = makeStyles((theme: Theme) =>\n createStyles({\n root: {\n width: '100%',\n marginBottom: theme.spacing(2),\n },\n }),\n)\n\nexport default function VersionAlert(): ReactElement | null {\n const classes = useStyles()\n const { isLoading, latestUserVersionExact } = useContext(Context)\n const [open, setOpen] = useState(true)\n\n const isExactlySupportedBeeVersion = SUPPORTED_BEE_VERSION_EXACT === latestUserVersionExact\n\n if (isLoading || !latestUserVersionExact) return null\n\n return (\n \n
\n {\n setOpen(false)\n }}\n >\n \n \n }\n >\n Warning\n Your Bee node version ({latestUserVersionExact}) does not exactly match the Bee version we tested\n the Bee Dashboard against ({SUPPORTED_BEE_VERSION_EXACT}). Please note that some functionality\n may not work properly.\n \n
\n
\n )\n}\n","export default __webpack_public_path__ + \"static/media/logo.3d1155fe.svg\";","import { ReactElement, ReactNode, useState } from 'react'\nimport { makeStyles, Theme, createStyles } from '@material-ui/core/styles'\nimport { Collapse, ListItem, ListItemText, Typography } from '@material-ui/core'\nimport { ExpandLess, ExpandMore } from '@material-ui/icons'\n\nconst useStyles = makeStyles((theme: Theme) =>\n createStyles({\n root: {\n width: '100%',\n padding: 0,\n margin: 0,\n marginTop: theme.spacing(4),\n '&:first-child': {\n marginTop: 0,\n },\n },\n rootLevel1: { marginTop: theme.spacing(1) },\n rootLevel2: { marginTop: theme.spacing(0.5) },\n header: {\n backgroundColor: theme.palette.background.paper,\n },\n contentLevel0: {\n marginTop: theme.spacing(1),\n },\n contentLevel12: {\n marginTop: theme.spacing(0.25),\n },\n infoText: {\n color: '#c9c9c9',\n },\n }),\n)\n\ninterface Props {\n children?: ReactNode\n label: ReactNode\n info?: ReactNode\n level?: 0 | 1 | 2\n defaultOpen?: boolean\n}\n\nexport default function ExpandableList({ children, label, level, defaultOpen, info }: Props): ReactElement | null {\n const classes = useStyles()\n const [open, setOpen] = useState(Boolean(defaultOpen))\n\n const handleClick = () => {\n setOpen(!open)\n }\n\n let rootLevelClass = ''\n let typographyVariant: 'h1' | 'h2' | 'h3' = 'h1'\n let contentLevelClass = classes.contentLevel0\n\n if (level === 1) {\n rootLevelClass = classes.rootLevel1\n typographyVariant = 'h2'\n contentLevelClass = classes.contentLevel12\n } else if (level === 2) {\n rootLevelClass = classes.rootLevel2\n typographyVariant = 'h3'\n contentLevelClass = classes.contentLevel12\n }\n\n return (\n
\n \n {label}} />\n
\n {!open && (\n \n {info}\n \n )}\n {open ? : }\n
\n
\n \n
{children}
\n
\n
\n )\n}\n","import { ReactElement, ReactNode } from 'react'\nimport { makeStyles, Theme, createStyles } from '@material-ui/core/styles'\nimport { Typography, Grid, IconButton, Tooltip } from '@material-ui/core'\nimport { Info } from 'react-feather'\nimport ListItem from '@material-ui/core/ListItem'\n\nconst useStyles = makeStyles((theme: Theme) =>\n createStyles({\n header: {\n backgroundColor: theme.palette.background.paper,\n marginBottom: theme.spacing(0.25),\n wordBreak: 'break-word',\n },\n copyValue: {\n cursor: 'pointer',\n padding: theme.spacing(1),\n borderRadius: 0,\n '&:hover': {\n backgroundColor: '#fcf2e8',\n color: theme.palette.primary.main,\n },\n },\n }),\n)\n\ninterface Props {\n label?: ReactNode\n value?: ReactNode\n tooltip?: string\n}\n\nexport default function ExpandableListItem({ label, value, tooltip }: Props): ReactElement | null {\n const classes = useStyles()\n\n return (\n \n \n {label && {label}}\n {value && (\n \n {value}\n {tooltip && (\n \n \n \n \n \n )}\n \n )}\n \n \n )\n}\n","import { Grid } from '@material-ui/core'\nimport { createStyles, makeStyles, Theme } from '@material-ui/core/styles'\nimport { ReactElement, ReactNode } from 'react'\n\nconst useStyles = makeStyles((theme: Theme) =>\n createStyles({\n wrapper: {\n display: 'flex',\n flexDirection: 'row',\n flexWrap: 'wrap',\n },\n action: {\n marginBottom: theme.spacing(1),\n marginRight: theme.spacing(1),\n },\n }),\n)\n\ninterface Props {\n children: ReactNode | ReactNode[]\n}\n\nexport default function ExpandableListItemActions({ children }: Props): ReactElement | null {\n const classes = useStyles()\n\n if (Array.isArray(children)) {\n return (\n
\n {children\n // Exclude falsy values to allow conditional rendering\n .filter(x => x)\n .map((a, i) => (\n
\n {a}\n
\n ))}\n
\n )\n }\n\n return (\n \n {children}\n \n )\n}\n","import { Grid, IconButton, ListItem, Tooltip, Typography } from '@material-ui/core'\nimport Collapse from '@material-ui/core/Collapse'\nimport { createStyles, makeStyles, Theme } from '@material-ui/core/styles'\nimport { ReactElement, useState } from 'react'\nimport { CopyToClipboard } from 'react-copy-to-clipboard'\nimport { Eye, Minus } from 'react-feather'\n\nconst useStyles = makeStyles((theme: Theme) =>\n createStyles({\n header: {\n backgroundColor: theme.palette.background.paper,\n marginBottom: theme.spacing(0.25),\n borderLeft: `${theme.spacing(0.25)}px solid rgba(0,0,0,0)`,\n wordBreak: 'break-word',\n },\n headerOpen: {\n borderLeft: `${theme.spacing(0.25)}px solid ${theme.palette.primary.main}`,\n },\n copyValue: {\n cursor: 'pointer',\n padding: theme.spacing(1),\n borderRadius: 0,\n '&:hover': {\n backgroundColor: '#fcf2e8',\n color: theme.palette.primary.main,\n },\n },\n content: {\n marginTop: theme.spacing(2),\n marginBottom: theme.spacing(2),\n },\n keyMargin: {\n marginRight: theme.spacing(1),\n },\n }),\n)\n\ninterface Props {\n label: string\n value: string\n}\n\nconst lengthWithoutPrefix = (s: string) => s.replace(/^0x/i, '').length\n\nfunction isPrefixedHexString(s: unknown): boolean {\n return typeof s === 'string' && /^0x[0-9a-f]+$/i.test(s)\n}\n\nconst split = (s: string): string[] => {\n const nonPrefixLength = lengthWithoutPrefix(s)\n\n if (nonPrefixLength % 6 === 0) return s.match(/(0x|.{6})/gi) || []\n\n return s.match(/(0x|.{1,8})/gi) || []\n}\n\nexport default function ExpandableListItemKey({ label, value }: Props): ReactElement | null {\n const classes = useStyles()\n const [open, setOpen] = useState(false)\n const [copied, setCopied] = useState(false)\n const toggleOpen = () => setOpen(!open)\n\n const tooltipClickHandler = () => setCopied(true)\n const tooltipCloseHandler = () => setCopied(false)\n\n const splitValues = split(value)\n const hasPrefix = isPrefixedHexString(value)\n const spanText = `${hasPrefix ? `${splitValues[0]} ${splitValues[1]}` : splitValues[0]}[…]${\n splitValues[splitValues.length - 1]\n }`\n\n return (\n \n \n \n {label && {label}}\n \n
\n {!open && (\n \n \n \n {value ? spanText : ''}\n \n \n \n )}\n \n {open ? : }\n \n
\n
\n
\n \n
\n \n \n {/* This has to be wrapped in two spans otherwise either the tooltip or the highlighting does not work*/}\n \n \n {splitValues.map((s, i) => (\n \n {s}\n \n ))}\n \n \n \n \n
\n
\n
\n
\n )\n}\n","import type { ReactElement } from 'react'\nimport IconButton from '@material-ui/core/IconButton'\nimport { CopyToClipboard } from 'react-copy-to-clipboard'\nimport { Clipboard } from 'react-feather'\nimport { useSnackbar } from 'notistack'\n\ninterface Props {\n value: string\n}\n\nexport default function ClipboardCopy({ value }: Props): ReactElement {\n const { enqueueSnackbar } = useSnackbar()\n const handleCopy = () => enqueueSnackbar(`Copied: ${value}`, { variant: 'success' })\n\n return (\n
\n \n \n \n \n \n
\n )\n}\n","import { ReactElement, useState } from 'react'\nimport QRCode from 'qrcode.react'\nimport { IconButton, Dialog, DialogTitle } from '@material-ui/core'\nimport { FilterCenterFocusSharp } from '@material-ui/icons'\n\ninterface Props {\n value: string\n label: string\n}\n\nexport default function QRCodeModal(props: Props): ReactElement {\n const [open, setOpen] = useState(false)\n\n const handleOpen = () => {\n setOpen(true)\n }\n\n const handleClose = () => {\n setOpen(false)\n }\n\n return (\n
\n \n \n \n \n
\n {props.label}\n \n
\n
\n
\n )\n}\n","import { Typography } from '@material-ui/core/'\nimport { ReactElement } from 'react'\nimport Identicon from 'react-identicons'\nimport { config } from '../config'\nimport ClipboardCopy from './ClipboardCopy'\nimport QRCodeModal from './QRCodeModal'\n\ninterface Props {\n address: string | undefined\n hideBlockie?: boolean\n transaction?: boolean\n truncate?: boolean\n}\n\nexport default function EthereumAddress(props: Props): ReactElement {\n return (\n \n {props.address ? (\n
\n {props.hideBlockie ? null : (\n
\n \n
\n )}\n
\n \n {props.address}\n \n
\n \n \n
\n ) : (\n '-'\n )}\n
\n )\n}\n","import { CircularProgress, Container } from '@material-ui/core'\nimport Button from '@material-ui/core/Button'\nimport Dialog from '@material-ui/core/Dialog'\nimport DialogActions from '@material-ui/core/DialogActions'\nimport DialogContent from '@material-ui/core/DialogContent'\nimport DialogContentText from '@material-ui/core/DialogContentText'\nimport DialogTitle from '@material-ui/core/DialogTitle'\nimport { useSnackbar } from 'notistack'\nimport { ReactElement, useState, useContext } from 'react'\nimport { Zap } from 'react-feather'\nimport { Context as SettingsContext } from '../providers/Settings'\nimport EthereumAddress from './EthereumAddress'\n\ninterface Props {\n peerId: string\n uncashedAmount: string\n}\n\nexport default function CheckoutModal({ peerId, uncashedAmount }: Props): ReactElement {\n const [open, setOpen] = useState(false)\n const [loadingCashout, setLoadingCashout] = useState(false)\n const { enqueueSnackbar } = useSnackbar()\n const { beeDebugApi } = useContext(SettingsContext)\n\n const handleClickOpen = () => {\n setOpen(true)\n }\n\n const handleClose = () => {\n setOpen(false)\n }\n\n const handleCashout = () => {\n if (!beeDebugApi) return\n\n if (peerId) {\n setLoadingCashout(true)\n beeDebugApi\n .cashoutLastCheque(peerId)\n .then(res => {\n setOpen(false)\n enqueueSnackbar(\n \n Successfully cashed out cheque. Transaction\n \n ,\n { variant: 'success' },\n )\n })\n .catch((e: Error) => {\n enqueueSnackbar(Error: {e.message}, { variant: 'error' })\n })\n .finally(() => {\n setLoadingCashout(false)\n })\n } else {\n enqueueSnackbar(Peer Id invalid, { variant: 'error' })\n }\n }\n\n return (\n
\n \n \n Cashout Cheque\n \n \n {loadingCashout && (\n <>\n \n Cashing out {uncashedAmount} from Peer {peerId}. Please wait...\n \n \n \n \n \n )}\n {!loadingCashout && (\n \n Are you sure you want to cashout {uncashedAmount} BZZ from Peer{' '}\n {peerId}?\n \n )}\n \n \n \n \n \n \n \n
\n )\n}\n","import type { ReactElement } from 'react'\n\nimport ExpandableList from '../../components/ExpandableList'\nimport ExpandableListItem from '../../components/ExpandableListItem'\nimport ExpandableListItemActions from '../../components/ExpandableListItemActions'\nimport ExpandableListItemKey from '../../components/ExpandableListItemKey'\n\nimport CashoutModal from '../../components/CashoutModal'\nimport { Accounting } from '../../hooks/accounting'\nimport type { Token } from '../../models/Token'\n\ninterface Props {\n isLoadingUncashed: boolean\n totalUncashed: Token\n accounting: Accounting[] | null\n}\n\nexport default function PeerBalances({ accounting, isLoadingUncashed, totalUncashed }: Props): ReactElement | null {\n return (\n \n \n {accounting?.map(({ peer, balance, received, sent, uncashedAmount, total }) => (\n \n \n \n \n \n \n {uncashedAmount.toBigNumber.isGreaterThan('0') && (\n \n \n \n )}\n \n ))}\n \n )\n}\n","import { Button, Grid, Link as MuiLink, Typography } from '@material-ui/core/'\nimport { createStyles, makeStyles, Theme } from '@material-ui/core/styles'\nimport type { ReactElement } from 'react'\nimport { Activity } from 'react-feather'\nimport { Link } from 'react-router-dom'\nimport { config } from '../config'\nimport { ROUTES } from '../routes'\n\nconst useStyles = makeStyles((theme: Theme) =>\n createStyles({\n root: {\n height: '100%',\n },\n content: {\n maxWidth: 500,\n marginBottom: theme.spacing(4),\n '&:last-child': {\n marginBottom: 0,\n },\n },\n icon: {\n height: '1rem',\n },\n }),\n)\n\nexport default function TroubleshootConnectionCard(): ReactElement {\n const classes = useStyles()\n\n return (\n \n \n \n Uh oh, it looks like your node is not connected.\n \n \n \n \n Please check your node status to fix the problem. You can also check out the{' '}\n \n Swarm Bee Docs\n {' '}\n or ask for support on the{' '}\n \n Ethereum Swarm Discord\n \n .\n \n \n \n \n }\n to={ROUTES.STATUS}\n >\n Check node status\n \n \n \n \n )\n}\n","import { LastCashoutActionResponse, BeeDebug } from '@ethersphere/bee-js'\nimport { useEffect, useState } from 'react'\nimport { Token } from '../models/Token'\nimport { makeRetriablePromise, unwrapPromiseSettlements } from '../utils'\nimport { Balance, Settlements, Settlement } from '../types'\n\ninterface UseAccountingHook {\n isLoadingUncashed: boolean\n totalUncashed: Token\n accounting: Accounting[] | null\n}\n\nexport interface Accounting {\n peer: string\n uncashedAmount: Token\n balance: Token\n received: Token\n sent: Token\n total: Token\n}\n\n/**\n * Merges the balances, settlements and uncashedAmounts arrays into single array which is sorted by uncashed amounts (if any)\n *\n * @param balances Balances for all peers\n * @param settlements Settlements for all peers which has some settlement\n * @param uncashedAmounts Array of getPeerLastCashout responses which is needed to calculate uncashed amount\n *\n * @returns\n */\nfunction mergeAccounting(\n balances: Balance[] | null,\n settlements?: Settlement[],\n uncashedAmounts?: LastCashoutActionResponse[],\n): Accounting[] | null {\n // Settlements or balances are still loading or there is an error -> return null\n if (!balances || !settlements) return null\n\n const accounting: Record = {}\n\n balances.forEach(\n // Some peers may not have settlement but all have balance (therefore initialize sent, received and uncashed to 0)\n ({ peer, balance }) =>\n (accounting[peer] = {\n peer,\n balance,\n sent: new Token('0'),\n received: new Token('0'),\n uncashedAmount: new Token('0'),\n total: balance,\n }),\n )\n\n settlements.forEach(\n ({ peer, sent, received }) =>\n (accounting[peer] = {\n ...accounting[peer],\n sent,\n received,\n total: new Token(accounting[peer].balance.toBigNumber.plus(received.toBigNumber).minus(sent.toBigNumber)),\n }),\n )\n\n // If there are no cheques (and hence last cashout actions)\n if (!uncashedAmounts) return Object.values(accounting).sort((a, b) => (a.peer < b.peer ? -1 : 1))\n\n uncashedAmounts?.forEach(({ peer, uncashedAmount }) => {\n accounting[peer].uncashedAmount = new Token(uncashedAmount)\n })\n\n // Return sorted by the uncashed amount first and then by the peer id\n return Object.values(accounting).sort((a, b) => {\n const diff = b.uncashedAmount.toBigNumber.minus(a.uncashedAmount.toBigNumber).toNumber()\n\n if (diff !== 0) return diff\n\n return a.peer < b.peer ? -1 : 1\n })\n}\n\nexport const useAccounting = (\n beeDebugApi: BeeDebug | null,\n settlements: Settlements | null,\n balances: Balance[] | null,\n): UseAccountingHook => {\n const [isLoadingUncashed, setIsloadingUncashed] = useState(false)\n const [uncashedAmounts, setUncashedAmounts] = useState(undefined)\n\n useEffect(() => {\n // We don't have any settlements loaded yet or we are already loading/have loaded the uncashed amounts\n if (isLoadingUncashed || !beeDebugApi || !settlements || uncashedAmounts) return\n\n setIsloadingUncashed(true)\n const promises = settlements.settlements\n .filter(({ received }) => received.toBigNumber.gt('0'))\n .map(({ peer }) => makeRetriablePromise(() => beeDebugApi.getLastCashoutAction(peer)))\n\n Promise.allSettled(promises).then(settlements => {\n const results = unwrapPromiseSettlements(settlements)\n setUncashedAmounts(results.fulfilled)\n setIsloadingUncashed(false)\n })\n }, [settlements, isLoadingUncashed, uncashedAmounts, beeDebugApi])\n\n const accounting = mergeAccounting(balances, settlements?.settlements, uncashedAmounts)\n\n let totalUncashed: Token = new Token('0')\n accounting?.forEach(\n ({ uncashedAmount }) => (totalUncashed = new Token(totalUncashed.toBigNumber.plus(uncashedAmount.toBigNumber))),\n )\n\n return {\n isLoadingUncashed,\n totalUncashed,\n accounting,\n }\n}\n","import { ReactElement, ReactNode, useState } from 'react'\nimport Button from '@material-ui/core/Button'\nimport Input from '@material-ui/core/Input'\nimport Dialog from '@material-ui/core/Dialog'\nimport DialogActions from '@material-ui/core/DialogActions'\nimport DialogContent from '@material-ui/core/DialogContent'\nimport DialogContentText from '@material-ui/core/DialogContentText'\nimport DialogTitle from '@material-ui/core/DialogTitle'\nimport FormHelperText from '@material-ui/core/FormHelperText'\nimport { Token } from '../models/Token'\nimport type { BigNumber } from 'bignumber.js'\nimport { useSnackbar } from 'notistack'\n\ninterface Props {\n successMessage: string\n errorMessage: string\n dialogMessage: string\n label: string\n max?: BigNumber\n min?: BigNumber\n action: (amount: bigint) => Promise\n icon?: ReactNode\n}\n\nexport default function WithdrawDepositModal({\n successMessage,\n errorMessage,\n dialogMessage,\n min,\n max,\n label,\n action,\n icon,\n}: Props): ReactElement {\n const [open, setOpen] = useState(false)\n const [amount, setAmount] = useState('')\n const [amountToken, setAmountToken] = useState(null)\n const [amountError, setAmountError] = useState(null)\n const { enqueueSnackbar } = useSnackbar()\n\n const handleClickOpen = (e: React.MouseEvent) => {\n setOpen(true)\n e.stopPropagation()\n }\n\n const handleClose = () => {\n setOpen(false)\n }\n\n const handleAction = async () => {\n if (amountToken === null) return\n\n try {\n const transactionHash = await action(amountToken.toBigInt as bigint)\n setOpen(false)\n enqueueSnackbar(`${successMessage} Transaction ${transactionHash}`, { variant: 'success' })\n } catch (e) {\n enqueueSnackbar(`${errorMessage} Error: ${(e as Error).message}`, { variant: 'error' })\n }\n }\n\n const handleChange = (e: React.ChangeEvent) => {\n const value = e.target.value\n setAmount(value)\n setAmountError(null)\n try {\n const t = Token.fromDecimal(value)\n setAmountToken(t)\n\n if (min && t.toDecimal.isLessThan(min)) setAmountError(new Error(`Needs to be more than ${min}`))\n\n if (max && t.toDecimal.isGreaterThan(max)) setAmountError(new Error(`Needs to be less than ${max}`))\n } catch (e) {\n setAmountError(e as Error)\n }\n }\n\n return (\n
\n \n \n {label}\n \n {dialogMessage}\n \n {amountError && (\n \n Please provide valid BZZ amount (max 16 decimals). Error: {amountError.message}\n \n )}\n \n \n \n \n \n \n
\n )\n}\n","import { BigNumber } from 'bignumber.js'\nimport { ReactElement, useContext } from 'react'\nimport { Upload } from 'react-feather'\nimport WithdrawDepositModal from '../components/WithdrawDepositModal'\nimport { Context as SettingsContext } from '../providers/Settings'\n\nexport default function WithdrawModal(): ReactElement {\n const { beeDebugApi } = useContext(SettingsContext)\n\n return (\n }\n min={new BigNumber(0)}\n action={(amount: bigint) => {\n if (!beeDebugApi) throw new Error('Bee Debug URL is not valid')\n\n return beeDebugApi.withdrawTokens(amount.toString())\n }}\n />\n )\n}\n","import { ReactElement, useContext } from 'react'\nimport { Download } from 'react-feather'\nimport { Context as SettingsContext } from '../providers/Settings'\n\nimport WithdrawDepositModal from '../components/WithdrawDepositModal'\nimport { BigNumber } from 'bignumber.js'\n\nexport default function DepositModal(): ReactElement {\n const { beeDebugApi } = useContext(SettingsContext)\n\n return (\n }\n min={new BigNumber(0)}\n action={(amount: bigint) => {\n if (!beeDebugApi) throw new Error('Bee Debug URL is not valid')\n\n return beeDebugApi.depositTokens(amount.toString())\n }}\n />\n )\n}\n","import { ReactElement, useContext } from 'react'\n\nimport PeerBalances from './PeerBalances'\nimport TroubleshootConnectionCard from '../../components/TroubleshootConnectionCard'\nimport { Context as BeeContext } from '../../providers/Bee'\nimport { Context as SettingsContext } from '../../providers/Settings'\nimport { useAccounting } from '../../hooks/accounting'\nimport ExpandableList from '../../components/ExpandableList'\nimport ExpandableListItem from '../../components/ExpandableListItem'\nimport ExpandableListItemActions from '../../components/ExpandableListItemActions'\nimport ExpandableListItemKey from '../../components/ExpandableListItemKey'\nimport WithdrawModal from '../../containers/WithdrawModal'\nimport DepositModal from '../../containers/DepositModal'\n\nexport default function Accounting(): ReactElement {\n const { status, nodeAddresses, chequebookAddress, chequebookBalance, settlements, peerBalances } =\n useContext(BeeContext)\n const { beeDebugApi } = useContext(SettingsContext)\n\n const { accounting, totalUncashed, isLoadingUncashed } = useAccounting(beeDebugApi, settlements, peerBalances)\n\n if (!status.all) return \n\n return (\n
\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n
\n )\n}\n","import { Button, CircularProgress, createStyles, makeStyles } from '@material-ui/core'\nimport React, { ReactElement } from 'react'\nimport { IconProps } from 'react-feather'\n\ninterface Props {\n onClick: () => void\n iconType: React.ComponentType\n children: string\n className?: string\n disabled?: boolean\n loading?: boolean\n cancel?: boolean\n}\n\nconst useStyles = makeStyles(() =>\n createStyles({\n button: {\n height: '52px',\n position: 'relative',\n whiteSpace: 'nowrap',\n color: '#242424',\n '&:hover, &:focus': {\n '& svg': {\n stroke: '#fff',\n transition: '0.1s',\n },\n },\n },\n cancelButton: {\n background: '#f7f7f7',\n color: '#606060',\n },\n spinnerWrapper: {\n position: 'absolute',\n left: '50%',\n top: '50%',\n width: '40px',\n height: '40px',\n transform: 'translate(-50%, -50%)',\n },\n }),\n)\n\nexport function SwarmButton({\n children,\n onClick,\n iconType,\n className,\n disabled,\n loading,\n cancel,\n}: Props): ReactElement {\n const classes = useStyles()\n\n function getIconColor() {\n if (loading || disabled) {\n return 'rgba(0, 0, 0, 0.26)'\n }\n\n return cancel ? '#606060' : '#dd7700'\n }\n\n function getButtonClassName() {\n return [className, classes.button, cancel && classes.cancelButton].filter(x => x).join(' ')\n }\n\n const icon = React.createElement(iconType, {\n size: '1.25rem',\n color: getIconColor(),\n })\n\n return (\n ) => {\n onClick()\n event.currentTarget.blur()\n }}\n variant=\"contained\"\n startIcon={icon}\n disabled={disabled}\n >\n {children}\n {loading && (\n
\n \n
\n )}\n \n )\n}\n","import { createContext, ReactChild, ReactElement, useEffect, useState } from 'react'\n\nexport type IdentityType = 'V3' | 'PRIVATE_KEY'\n\nexport interface Identity {\n uuid: string\n name: string\n feedHash?: string\n identity: string\n address: string\n type: IdentityType\n}\n\ninterface ContextInterface {\n identities: Identity[]\n setIdentities: (identities: Identity[]) => void\n}\n\nconst initialValues: ContextInterface = {\n identities: [],\n setIdentities: () => {}, // eslint-disable-line\n}\n\nexport const Context = createContext(initialValues)\nexport const Consumer = Context.Consumer\n\ninterface Props {\n children: ReactChild\n}\n\nexport function Provider({ children }: Props): ReactElement {\n const [identities, setIdentities] = useState(initialValues.identities)\n\n useEffect(() => {\n try {\n setIdentities(JSON.parse(localStorage.getItem('feeds') || '[]'))\n } catch {\n setIdentities([])\n }\n }, []) // eslint-disable-line react-hooks/exhaustive-deps\n\n return {children}\n}\n","import { Box, Dialog, Grid } from '@material-ui/core'\nimport { ReactElement } from 'react'\n\ninterface Props {\n children: ReactElement | ReactElement[]\n}\n\nexport function SwarmDialog({ children }: Props): ReactElement {\n return (\n \n \n \n {children}\n \n \n \n )\n}\n","import { createStyles, makeStyles, Theme } from '@material-ui/core'\nimport { Close } from '@material-ui/icons'\nimport { ReactElement } from 'react'\n\ninterface Props {\n onClose: () => void\n}\n\nconst useStyles = makeStyles((theme: Theme) =>\n createStyles({\n wrapper: {\n padding: theme.spacing(1),\n cursor: 'pointer',\n },\n }),\n)\n\nexport function CloseButton({ onClose }: Props): ReactElement {\n const classes = useStyles()\n\n return (\n
\n \n
\n )\n}\n","import { createStyles, Grid, makeStyles, Typography } from '@material-ui/core'\nimport { ReactElement } from 'react'\nimport { CloseButton } from './CloseButton'\n\ninterface Props {\n children: string\n onClose: () => void\n}\n\nconst useStyles = makeStyles(() =>\n createStyles({\n text: {\n color: '#606060',\n fontWeight: 'bold',\n },\n }),\n)\n\nexport function TitleWithClose({ children, onClose }: Props): ReactElement {\n const classes = useStyles()\n\n return (\n \n  \n \n {children}\n \n \n \n )\n}\n","import { Box, Typography } from '@material-ui/core'\nimport { ReactElement } from 'react'\nimport { Trash, X } from 'react-feather'\nimport ExpandableListItemActions from '../../components/ExpandableListItemActions'\nimport { SwarmButton } from '../../components/SwarmButton'\nimport { SwarmDialog } from '../../components/SwarmDialog'\nimport { TitleWithClose } from '../../components/TitleWithClose'\nimport { Identity } from '../../providers/Feeds'\n\ninterface Props {\n identity: Identity\n onConfirm: (identity: Identity) => void\n onClose: () => void\n}\n\nexport function DeleteFeedDialog({ identity, onConfirm, onClose }: Props): ReactElement {\n return (\n \n \n Delete\n \n \n {`You are about to delete feed ${identity.name} Website. It is strongly advised to export this feed first.`}\n \n \n onConfirm(identity)}>\n Delete\n \n \n Cancel\n \n \n \n )\n}\n","import { createStyles, makeStyles, Theme } from '@material-ui/core'\nimport { ReactElement } from 'react'\n\ninterface Props {\n children: string\n prettify?: boolean\n}\n\nconst useStyles = makeStyles((theme: Theme) =>\n createStyles({\n wrapper: {\n overflow: 'scroll',\n background: '#ffffff',\n },\n pre: {\n maxHeight: '6em',\n padding: theme.spacing(2),\n },\n }),\n)\n\nfunction prettifyString(string: string): string {\n try {\n return JSON.stringify(JSON.parse(string), null, 4)\n } catch {\n return string\n }\n}\n\nexport function Code({ children, prettify }: Props): ReactElement {\n const classes = useStyles()\n\n return (\n
\n
{prettify ? prettifyString(children) : children}
\n
\n )\n}\n","import { Box, createStyles, makeStyles, Typography } from '@material-ui/core'\nimport { saveAs } from 'file-saver'\nimport { useSnackbar } from 'notistack'\nimport { ReactElement } from 'react'\nimport { Clipboard, Download } from 'react-feather'\nimport { Code } from '../../components/Code'\nimport ExpandableListItemActions from '../../components/ExpandableListItemActions'\nimport { SwarmButton } from '../../components/SwarmButton'\nimport { SwarmDialog } from '../../components/SwarmDialog'\nimport { TitleWithClose } from '../../components/TitleWithClose'\nimport { Identity } from '../../providers/Feeds'\n\ninterface Props {\n identity: Identity\n onClose: () => void\n}\n\nconst useStyles = makeStyles(() =>\n createStyles({\n wrapper: {\n maxWidth: '100%',\n },\n }),\n)\n\nexport function ExportFeedDialog({ identity, onClose }: Props): ReactElement {\n const { enqueueSnackbar } = useSnackbar()\n\n const classes = useStyles()\n\n function onDownload() {\n saveAs(\n new Blob([identity.identity], {\n type: 'application/json',\n }),\n identity.name + '.json',\n )\n }\n\n function getExportText() {\n return identity.type === 'V3' ? 'JSON file' : 'the private key string'\n }\n\n function onCopy() {\n navigator.clipboard\n .writeText(identity.identity)\n .then(() => enqueueSnackbar('Copied to Clipboard', { variant: 'success' }))\n }\n\n return (\n \n \n Export\n \n \n {`We exported the identity associated with this feed as ${getExportText()}.`}\n \n \n {identity.identity}\n \n \n \n Download JSON File\n \n \n Copy To Clipboard\n \n \n \n )\n}\n","import { createStyles, makeStyles, TextField as SimpleTextField, Theme } from '@material-ui/core'\nimport { Field } from 'formik'\nimport { TextField } from 'formik-material-ui'\nimport { ChangeEvent, ReactElement } from 'react'\n\ninterface Props {\n name: string\n label: string\n password?: boolean\n formik?: boolean\n optional?: boolean\n defaultValue?: string\n onChange?: (event: ChangeEvent) => void\n}\n\nconst useStyles = makeStyles((theme: Theme) =>\n createStyles({\n field: {\n background: theme.palette.background.paper,\n '& fieldset': {\n border: 0,\n },\n '& .Mui-focused': {\n background: theme.palette.background.paper,\n },\n '& .MuiInputBase-root': {\n background: theme.palette.background.paper,\n },\n '& .MuiFilledInput-root': {\n borderRadius: 0,\n },\n },\n }),\n)\n\nexport function SwarmTextInput({\n name,\n label,\n password,\n optional,\n formik,\n onChange,\n defaultValue,\n}: Props): ReactElement {\n const classes = useStyles()\n\n if (formik) {\n return (\n \n )\n }\n\n return (\n \n )\n}\n","import { Box, createStyles, makeStyles, TextareaAutosize, Theme } from '@material-ui/core'\nimport { useSnackbar } from 'notistack'\nimport React, { ReactElement, useContext, useRef, useState } from 'react'\nimport { Check, Upload } from 'react-feather'\nimport ExpandableListItemActions from '../../components/ExpandableListItemActions'\nimport { SwarmButton } from '../../components/SwarmButton'\nimport { SwarmDialog } from '../../components/SwarmDialog'\nimport { SwarmTextInput } from '../../components/SwarmTextInput'\nimport { TitleWithClose } from '../../components/TitleWithClose'\nimport { Context, Identity } from '../../providers/Feeds'\nimport { importIdentity, persistIdentity } from '../../utils/identity'\n\ninterface Props {\n onClose: () => void\n}\n\nconst useStyles = makeStyles((theme: Theme) =>\n createStyles({\n textarea: {\n width: '100%',\n border: 0,\n padding: theme.spacing(1),\n },\n displayNone: {\n display: 'none',\n },\n }),\n)\n\nexport function ImportFeedDialog({ onClose }: Props): ReactElement {\n const [textareaValue, setTextareaValue] = useState('')\n const [name, setName] = useState('')\n const fileInputRef = useRef(null)\n\n const { identities, setIdentities } = useContext(Context)\n\n const { enqueueSnackbar } = useSnackbar()\n\n const classes = useStyles()\n\n async function onImport() {\n const feed = await importIdentity(name, textareaValue)\n\n if (feed) {\n onFeedReady(feed)\n } else {\n enqueueSnackbar('Feed is not valid', { variant: 'error' })\n }\n }\n\n function onUploadIdentityFile() {\n if (fileInputRef.current) {\n const input = fileInputRef.current as HTMLInputElement\n input.click()\n }\n }\n\n function onIdentityFileSelected(event: React.ChangeEvent) {\n const fileReader = new FileReader()\n const file = event.target?.files?.[0]\n fileReader.onload = async event => {\n const string = event.target?.result\n\n if (string) {\n const feed = await importIdentity(name, string as string)\n\n if (feed) {\n onFeedReady(feed)\n } else {\n enqueueSnackbar('Feed is not valid', { variant: 'error' })\n }\n }\n }\n\n if (file) {\n fileReader.readAsText(file)\n }\n }\n\n function onFeedReady(identity: Identity) {\n persistIdentity(identities, identity)\n setIdentities(identities)\n enqueueSnackbar('Feed imported successfully', { variant: 'success' })\n onClose()\n }\n\n return (\n \n \n \n Import\n \n \n setName(event.target.value)} />\n \n \n setTextareaValue(event.target.value)}\n />\n \n \n \n Upload Json File\n \n \n Use Pasted Text\n \n \n \n )\n}\n","import { Box, Typography } from '@material-ui/core'\nimport { ReactElement, useContext, useState } from 'react'\nimport { Download, Info, PlusSquare, Trash } from 'react-feather'\nimport { useNavigate } from 'react-router'\nimport ExpandableList from '../../components/ExpandableList'\nimport ExpandableListItem from '../../components/ExpandableListItem'\nimport ExpandableListItemActions from '../../components/ExpandableListItemActions'\nimport ExpandableListItemKey from '../../components/ExpandableListItemKey'\nimport { SwarmButton } from '../../components/SwarmButton'\nimport TroubleshootConnectionCard from '../../components/TroubleshootConnectionCard'\nimport { Context as BeeContext } from '../../providers/Bee'\nimport { Context as IdentityContext, Identity } from '../../providers/Feeds'\nimport { ROUTES } from '../../routes'\nimport { formatEnum } from '../../utils'\nimport { persistIdentitiesWithoutUpdate } from '../../utils/identity'\nimport { DeleteFeedDialog } from './DeleteFeedDialog'\nimport { ExportFeedDialog } from './ExportFeedDialog'\nimport { ImportFeedDialog } from './ImportFeedDialog'\n\nexport default function Feeds(): ReactElement {\n const { identities, setIdentities } = useContext(IdentityContext)\n const { status } = useContext(BeeContext)\n\n const navigate = useNavigate()\n\n const [selectedIdentity, setSelectedIdentity] = useState(null)\n const [showImport, setShowImport] = useState(false)\n const [showExport, setShowExport] = useState(false)\n const [showDelete, setShowDelete] = useState(false)\n\n function createNewFeed() {\n return navigate(ROUTES.FEEDS_NEW)\n }\n\n function viewFeed(uuid: string) {\n navigate(ROUTES.FEEDS_PAGE.replace(':uuid', uuid))\n }\n\n function onDialogClose() {\n setShowDelete(false)\n setShowExport(false)\n setShowImport(false)\n setSelectedIdentity(null)\n }\n\n function onDelete(identity: Identity) {\n onDialogClose()\n const updatedFeeds = identities.filter(x => x.uuid !== identity.uuid)\n setIdentities(updatedFeeds)\n persistIdentitiesWithoutUpdate(updatedFeeds)\n }\n\n function onShowExport(identity: Identity) {\n setSelectedIdentity(identity)\n setShowExport(true)\n }\n\n function onShowDelete(identity: Identity) {\n setSelectedIdentity(identity)\n setShowDelete(true)\n }\n\n if (!status.all) return \n\n return (\n
\n {showImport && setShowImport(false)} />}\n {showExport && selectedIdentity && }\n {showDelete && selectedIdentity && (\n onDelete(identity)}\n />\n )}\n \n Feeds\n \n \n \n \n Create New Feed\n \n setShowImport(true)}>\n Import Feed\n \n \n \n {identities.map((x, i) => (\n \n \n \n \n \n \n \n \n {x.feedHash && }\n \n \n viewFeed(x.uuid)} iconType={Info}>\n View Feed Page\n \n onShowExport(x)} iconType={Download}>\n Export...\n \n onShowDelete(x)} iconType={Trash}>\n Delete...\n \n \n \n \n ))}\n
\n )\n}\n","import { createStyles, makeStyles, Typography } from '@material-ui/core'\nimport { ReactElement } from 'react'\n\ninterface Props {\n children: (string | ReactElement)[] | (string | ReactElement)\n}\n\nconst useStyles = makeStyles(() =>\n createStyles({\n text: {\n color: '#606060',\n fontSize: '0.9rem',\n },\n }),\n)\n\nexport function DocumentationText({ children }: Props): ReactElement {\n const classes = useStyles()\n\n return {children}\n}\n","import { Box, createStyles, Grid, makeStyles, Typography } from '@material-ui/core'\nimport { ArrowBack } from '@material-ui/icons'\nimport { ReactElement } from 'react'\nimport { useNavigate } from 'react-router-dom'\n\ninterface Props {\n children: string\n}\n\nconst useStyles = makeStyles(() =>\n createStyles({\n pressable: {\n cursor: 'pointer',\n },\n icon: {\n color: '#242424',\n },\n }),\n)\n\nexport function HistoryHeader({ children }: Props): ReactElement {\n const classes = useStyles()\n const navigate = useNavigate()\n\n function goBack() {\n navigate(-1)\n }\n\n return (\n \n \n \n
\n \n
\n
\n {children}\n
\n
\n )\n}\n","import { createStyles, FormHelperText, makeStyles, MenuItem, Select as SimpleSelect, Theme } from '@material-ui/core'\nimport { Field } from 'formik'\nimport { Select } from 'formik-material-ui'\nimport { ReactElement } from 'react'\n\nexport type SelectEvent = React.ChangeEvent<{\n name?: string | undefined\n value: unknown\n}>\n\ninterface Props {\n label?: string\n name?: string\n options: { value: string; label: string }[]\n onChange?: (event: SelectEvent) => void\n formik?: boolean\n defaultValue?: string\n}\n\nconst useStyles = makeStyles((theme: Theme) =>\n createStyles({\n select: {\n borderRadius: 0,\n background: theme.palette.background.paper,\n '& fieldset': {\n border: 0,\n },\n '& .MuiSelect-select': {\n '&:focus': {\n background: theme.palette.background.paper,\n },\n },\n },\n option: {\n height: '52px',\n },\n }),\n)\n\nexport function SwarmSelect({ defaultValue, formik, name, options, onChange, label }: Props): ReactElement {\n const classes = useStyles()\n\n if (formik) {\n return (\n <>\n {label && {label}}\n \n {options.map((x, i) => (\n \n {x.label}\n \n ))}\n \n \n )\n }\n\n return (\n <>\n {label && {label}}\n \n {options.map((x, i) => (\n \n {x.label}\n \n ))}\n \n \n )\n}\n","import { Box, Grid, Typography } from '@material-ui/core'\nimport { Form, Formik } from 'formik'\nimport { useSnackbar } from 'notistack'\nimport { ReactElement, useContext, useState } from 'react'\nimport { Check, X } from 'react-feather'\nimport { useNavigate } from 'react-router'\nimport { DocumentationText } from '../../components/DocumentationText'\nimport ExpandableListItemActions from '../../components/ExpandableListItemActions'\nimport ExpandableListItemKey from '../../components/ExpandableListItemKey'\nimport { HistoryHeader } from '../../components/HistoryHeader'\nimport { SwarmButton } from '../../components/SwarmButton'\nimport { SwarmSelect } from '../../components/SwarmSelect'\nimport { SwarmTextInput } from '../../components/SwarmTextInput'\nimport { Context as FeedsContext, IdentityType } from '../../providers/Feeds'\nimport { Context as SettingsContext } from '../../providers/Settings'\nimport { ROUTES } from '../../routes'\nimport { convertWalletToIdentity, generateWallet, persistIdentity } from '../../utils/identity'\n\ninterface FormValues {\n identityName?: string\n type?: IdentityType\n password?: string\n}\n\nconst initialValues: FormValues = {\n identityName: '',\n type: 'PRIVATE_KEY',\n password: '',\n}\n\nexport default function CreateNewFeed(): ReactElement {\n const { beeApi, beeDebugApi } = useContext(SettingsContext)\n const { identities, setIdentities } = useContext(FeedsContext)\n const [loading, setLoading] = useState(false)\n const { enqueueSnackbar } = useSnackbar()\n\n const navigate = useNavigate()\n\n async function onSubmit(values: FormValues) {\n setLoading(true)\n\n if (!beeApi) {\n enqueueSnackbar(Bee API unavailabe, { variant: 'error' })\n setLoading(false)\n\n return\n }\n const wallet = generateWallet()\n const stamps = await beeDebugApi?.getAllPostageBatch()\n\n if (!stamps || !stamps.length) {\n enqueueSnackbar(No stamp available, { variant: 'error' })\n setLoading(false)\n\n return\n }\n\n if (!values.identityName || !values.type) {\n enqueueSnackbar(Form is unfinished, { variant: 'error' })\n setLoading(false)\n\n return\n }\n\n const identity = await convertWalletToIdentity(wallet, values.type, values.identityName, values.password)\n persistIdentity(identities, identity)\n setIdentities(identities)\n navigate(ROUTES.FEEDS)\n setLoading(false)\n }\n\n function cancel() {\n navigate(-1)\n }\n\n return (\n
\n Create new feed\n \n \n To create a feed you will need to create an identity. Please refer to the{' '}\n \n official Bee documentation\n {' '}\n to understand how feeds work.\n \n \n \n {({ submitForm, values }) => (\n
\n \n \n \n \n \n \n {values.type === 'V3' && }\n \n \n \n \n \n Feeds name\n {values.identityName} Website\n \n \n \n \n \n Create Feed\n \n \n Cancel\n \n \n \n \n )}\n
\n
\n )\n}\n","import { Grid, IconButton, ListItem, Tooltip, Typography } from '@material-ui/core'\nimport { createStyles, makeStyles, Theme } from '@material-ui/core/styles'\nimport { ArrowForward, OpenInNewSharp } from '@material-ui/icons'\nimport { ReactElement, useState } from 'react'\nimport CopyToClipboard from 'react-copy-to-clipboard'\nimport { useNavigate } from 'react-router'\n\nconst useStyles = makeStyles((theme: Theme) =>\n createStyles({\n header: {\n backgroundColor: theme.palette.background.paper,\n marginBottom: theme.spacing(0.25),\n borderLeft: `${theme.spacing(0.25)}px solid rgba(0,0,0,0)`,\n wordBreak: 'break-word',\n },\n headerOpen: {\n borderLeft: `${theme.spacing(0.25)}px solid ${theme.palette.primary.main}`,\n },\n openLinkIcon: {\n cursor: 'pointer',\n padding: theme.spacing(1),\n borderRadius: 0,\n '&:hover': {\n backgroundColor: '#fcf2e8',\n color: theme.palette.primary.main,\n },\n },\n content: {\n marginTop: theme.spacing(2),\n marginBottom: theme.spacing(2),\n },\n keyMargin: {\n marginRight: theme.spacing(1),\n },\n copyValue: {\n cursor: 'pointer',\n padding: theme.spacing(1),\n borderRadius: 0,\n '&:hover': {\n backgroundColor: '#fcf2e8',\n color: theme.palette.primary.main,\n },\n },\n }),\n)\n\ninterface Props {\n label: string\n value: string\n link?: string\n navigationType?: 'NEW_WINDOW' | 'HISTORY_PUSH'\n allowClipboard?: boolean\n}\n\nexport default function ExpandableListItemLink({\n label,\n value,\n link,\n navigationType = 'NEW_WINDOW',\n allowClipboard = true,\n}: Props): ReactElement | null {\n const classes = useStyles()\n const [copied, setCopied] = useState(false)\n const navigate = useNavigate()\n\n const tooltipClickHandler = () => setCopied(true)\n const tooltipCloseHandler = () => setCopied(false)\n\n const displayValue = value.length > 22 ? value.slice(0, 19) + '...' : value\n\n function onNavigation() {\n if (navigationType === 'NEW_WINDOW') {\n window.open(link || value)\n } else {\n navigate(link || value)\n }\n }\n\n return (\n \n \n \n {label && {label}}\n \n
\n {allowClipboard && (\n \n \n \n {displayValue}\n \n \n \n )}\n {!allowClipboard && {displayValue}}\n \n {navigationType === 'NEW_WINDOW' && }\n {navigationType === 'HISTORY_PUSH' && }\n \n
\n
\n
\n
\n
\n )\n}\n","const indexHtmls = ['index.html', 'index.htm']\n\ninterface DetectedIndex {\n indexPath: string\n commonPrefix?: string\n}\n\nexport function detectIndexHtml(files: FilePath[]): DetectedIndex | false {\n const paths = files.map(getPath)\n\n if (!paths.length) {\n return false\n }\n\n const exactMatch = paths.find(x => indexHtmls.includes(x))\n\n if (exactMatch) {\n return { indexPath: exactMatch }\n }\n\n const prefix = paths[0].split('/')[0] + '/'\n\n const allStartWithSamePrefix = paths.every(x => x.startsWith(prefix))\n\n if (allStartWithSamePrefix) {\n const match = paths.find(x => indexHtmls.map(y => prefix + y).includes(x))\n\n if (match) {\n return { indexPath: match, commonPrefix: prefix }\n }\n }\n\n return false\n}\n\nexport function getHumanReadableFileSize(bytes: number): string {\n if (bytes >= 1e15) {\n return (bytes / 1e15).toFixed(2) + ' PB'\n }\n\n if (bytes >= 1e12) {\n return (bytes / 1e12).toFixed(2) + ' TB'\n }\n\n if (bytes >= 1e9) {\n return (bytes / 1e9).toFixed(2) + ' GB'\n }\n\n if (bytes >= 1e6) {\n return (bytes / 1e6).toFixed(2) + ' MB'\n }\n\n if (bytes >= 1e3) {\n return (bytes / 1e3).toFixed(2) + ' kB'\n }\n\n return bytes + ' bytes'\n}\n\nexport function getAssetNameFromFiles(files: FilePath[]): string {\n if (files.length === 1) return files[0].name\n\n if (files.length > 0) {\n const prefix = getPath(files[0]).split('/')[0]\n\n // Only if all files have a common prefix we can use it as a folder name\n if (files.every(f => getPath(f).split('/')[0] === prefix)) return prefix\n }\n\n return 'unknown'\n}\n\nexport function getMetadata(files: FilePath[]): Metadata {\n const size = files.reduce((total, item) => total + item.size, 0)\n const isWebsite = Boolean(detectIndexHtml(files))\n const name = getAssetNameFromFiles(files)\n const type = files.length === 1 ? files[0].type : 'folder'\n const count = files.length\n\n return { size, name, type, isWebsite, count }\n}\n\nexport function getPath(file: FilePath): string {\n return (file.path || file.webkitRelativePath || file.name).replace(/^\\//g, '') // remove the starting slash\n}\n\n/**\n * Utility function that is needed to have correct directory structure as webkitRelativePath is read only\n */\nexport function packageFile(file: FilePath): FilePath {\n const path = getPath(file)\n\n return {\n path: path,\n fullPath: path,\n webkitRelativePath: path,\n lastModified: file.lastModified,\n name: file.name,\n size: file.size,\n type: file.type,\n stream: file.stream,\n slice: file.slice,\n text: file.text,\n arrayBuffer: async () => await file.arrayBuffer(), // This is needed for successful upload and can not simply be { arrayBuffer: file.arrayBuffer }\n }\n}\n","interface Dimensions {\n width: number\n height: number\n}\n\n/**\n * Get the dimensions of the image after resize\n *\n * @param imgWidth Current image width\n * @param imgHeight Current image height\n * @param maxWidth Desired max width\n * @param maxHeight Desired max height\n *\n * @returns Downscaled dimensions of the image to fit in the bounding box\n */\nexport function getDimensions(imgWidth: number, imgHeight: number, maxWidth?: number, maxHeight?: number): Dimensions {\n const ratioWidth = maxWidth ? imgWidth / maxWidth : 1\n const ratioHeight = maxHeight ? imgHeight / maxHeight : 1\n\n const ratio = Math.max(ratioWidth, ratioHeight)\n\n // No need to resize\n if (ratio <= 1) return { width: imgWidth, height: imgHeight }\n\n return { width: imgWidth / ratio, height: imgHeight / ratio }\n}\n\n/**\n * Resize image passed to fit in the bounding box defined with maxWidth and maxHeight.\n * Note that one or both of the bounding box dimensions may be omitted\n *\n * @param file Image file to be resized\n * @param maxWidth Maximal image width\n * @param maxHeight Maximal image height\n *\n * @returns Promise that resolves into the resized image blob\n */\nexport function resize(file: File, maxWidth?: number, maxHeight?: number): Promise {\n return new Promise((resolve, reject) => {\n const allowedTypes = [\n 'image/bmp',\n 'image/gif',\n 'image/vnd.microsoft.icon',\n 'image/jpeg',\n 'image/png',\n 'image/svg+xml',\n 'image/tiff',\n 'image/webp',\n ]\n\n if (!file.size || !file.type || !allowedTypes.includes(file.type)) return reject('File not supported!')\n\n try {\n const reader = new FileReader()\n reader.readAsDataURL(file)\n reader.onload = event => {\n const src = event?.target?.result\n\n if (!src || typeof src !== 'string') throw new Error('Failed to load the image source')\n\n const img = new Image()\n img.src = src\n img.onload = () => {\n const dimensions = getDimensions(img.width, img.height, maxWidth, maxHeight)\n const elem = document.createElement('canvas')\n elem.width = dimensions.width\n elem.height = dimensions.height\n const ctx = elem.getContext('2d')\n\n if (!ctx) throw new Error('Failed to create canvas context')\n\n ctx.drawImage(img, 0, 0, elem.width, elem.height)\n ctx.canvas.toBlob(\n blob => {\n if (!blob) throw new Error('Failed to extract the blob from canvas')\n\n resolve(blob)\n },\n 'image/jpeg',\n 1,\n )\n }\n }\n reader.onerror = error => reject(error)\n } catch (error) {\n reject(error)\n }\n })\n}\n","export const META_FILE_NAME = '.swarmgatewaymeta.json'\nexport const PREVIEW_FILE_NAME = '.swarmgatewaypreview.jpeg'\nexport const PREVIEW_DIMENSIONS = { maxWidth: 250, maxHeight: 175 }\n","/* eslint-disable @typescript-eslint/no-empty-function */\n\nimport { createContext, ReactChild, ReactElement, useState, useEffect } from 'react'\nimport { getMetadata } from '../utils/file'\nimport { resize } from '../utils/image'\nimport { PREVIEW_DIMENSIONS } from '../constants'\n\nexport type UploadOrigin = { origin: 'UPLOAD' | 'FEED'; uuid?: string }\n\nexport const defaultUploadOrigin: UploadOrigin = { origin: 'UPLOAD' }\n\ninterface ContextInterface {\n files: FilePath[]\n setFiles: (files: FilePath[]) => void\n uploadOrigin: UploadOrigin\n setUploadOrigin: (uploadOrigin: UploadOrigin) => void\n metadata?: Metadata\n previewUri?: string\n previewBlob?: Blob\n}\n\nconst initialValues: ContextInterface = {\n files: [],\n setFiles: () => {},\n uploadOrigin: defaultUploadOrigin,\n setUploadOrigin: () => {},\n}\n\nexport const Context = createContext(initialValues)\nexport const Consumer = Context.Consumer\n\ninterface Props {\n children: ReactChild\n}\n\nexport function Provider({ children }: Props): ReactElement {\n const [files, setFiles] = useState(initialValues.files)\n const [uploadOrigin, setUploadOrigin] = useState(initialValues.uploadOrigin)\n const [metadata, setMetadata] = useState(undefined)\n const [previewUri, setPreviewUri] = useState(undefined)\n const [previewBlob, setPreviewBlob] = useState(undefined)\n\n useEffect(() => {\n setMetadata(getMetadata(files))\n\n if (previewUri) {\n URL.revokeObjectURL(previewUri) // Clear the preview from memory\n setPreviewUri(undefined)\n setPreviewBlob(undefined)\n }\n\n if (files.length !== 1 || !files[0].type.startsWith('image')) return\n\n resize(files[0], PREVIEW_DIMENSIONS.maxWidth, PREVIEW_DIMENSIONS.maxHeight).then(blob => {\n setPreviewUri(URL.createObjectURL(blob)) // NOTE: Until it is cleared with URL.revokeObjectURL, the file stays allocated in memory\n setPreviewBlob(blob)\n })\n\n return () => {\n if (previewUri) {\n URL.revokeObjectURL(previewUri)\n }\n }\n }, [files]) // eslint-disable-line react-hooks/exhaustive-deps\n\n return (\n \n {children}\n \n )\n}\n","import { createStyles, makeStyles, Theme } from '@material-ui/core'\nimport { DropzoneArea } from 'material-ui-dropzone'\nimport { useSnackbar } from 'notistack'\nimport { ReactElement, useContext, useState } from 'react'\nimport { FilePlus, FolderPlus, PlusCircle } from 'react-feather'\nimport { useNavigate } from 'react-router-dom'\nimport { DocumentationText } from '../../components/DocumentationText'\nimport { SwarmButton } from '../../components/SwarmButton'\nimport { Context, UploadOrigin } from '../../providers/File'\nimport { ROUTES } from '../../routes'\nimport { detectIndexHtml } from '../../utils/file'\n\ninterface Props {\n uploadOrigin: UploadOrigin\n showHelp: boolean\n}\n\nconst MAX_FILE_SIZE = 1_000_000_000 // 1 gigabyte\n\nconst useStyles = makeStyles((theme: Theme) =>\n createStyles({\n areaWrapper: { position: 'relative', marginBottom: theme.spacing(2) },\n dropzone: {\n background: theme.palette.background.default,\n outline: 'none',\n color: 'transparent',\n zIndex: 1,\n '& svg': {\n opacity: 0,\n },\n },\n buttonWrapper: {\n top: '0',\n left: '0',\n position: 'absolute',\n display: 'flex',\n width: '100%',\n height: '100%',\n justifyContent: 'center',\n alignItems: 'center',\n },\n button: {\n marginLeft: theme.spacing(0.5),\n marginRight: theme.spacing(0.5),\n zIndex: 2,\n },\n }),\n)\n\nexport function UploadArea({ uploadOrigin, showHelp }: Props): ReactElement {\n const { setFiles, setUploadOrigin } = useContext(Context)\n const classes = useStyles()\n const navigate = useNavigate()\n const { enqueueSnackbar } = useSnackbar()\n const [strictWebsiteMode, setStrictWebsiteMode] = useState(false)\n const [version, setVersion] = useState(0)\n\n const getDropzoneInputDomElement = () => document.querySelector('.MuiDropzoneArea-root input') as HTMLInputElement\n\n const onUploadCollectionClick = () => {\n const element = getDropzoneInputDomElement()\n\n if (element) {\n element.setAttribute('directory', '')\n element.setAttribute('webkitdirectory', '')\n element.setAttribute('mozdirectory', '')\n element.click()\n }\n }\n\n const onUploadWebsiteClick = () => {\n onUploadCollectionClick()\n setStrictWebsiteMode(true)\n }\n\n const onUploadFolderClick = () => {\n onUploadCollectionClick()\n setStrictWebsiteMode(false)\n }\n\n const onUploadFileClick = () => {\n const element = getDropzoneInputDomElement()\n\n if (element) {\n element.removeAttribute('directory')\n element.removeAttribute('webkitdirectory')\n element.removeAttribute('mozdirectory')\n element.click()\n }\n }\n\n const resetComponentOnAddingInvalidContent = () => {\n setTimeout(() => {\n setVersion(x => x + 1)\n setFiles([])\n }, 0)\n }\n\n const handleChange = (files?: File[]) => {\n if (files) {\n const FilePaths = files as FilePath[]\n const indexDocument = files.length === 1 ? files[0].name : detectIndexHtml(FilePaths) || undefined\n\n if (files.length && strictWebsiteMode && !indexDocument) {\n enqueueSnackbar('To upload a website, there must be an index.html or index.htm in the root of the folder.', {\n variant: 'error',\n })\n resetComponentOnAddingInvalidContent()\n\n return\n }\n\n setFiles(FilePaths)\n\n if (files.length) {\n setUploadOrigin(uploadOrigin)\n navigate(ROUTES.UPLOAD_IN_PROGRESS)\n }\n }\n }\n\n return (\n <>\n
\n \n
\n \n Add File\n \n \n Add Folder\n \n \n Add Website\n \n
\n
\n {showHelp && (\n \n You can click the buttons above or simply drag and drop to add a file or folder. To upload a website to Swarm,\n make sure that your folder contains an “index.html” file.\n \n )}\n \n )\n}\n","import * as swarmCid from '@ethersphere/swarm-cid'\nimport { Box } from '@material-ui/core'\nimport { ReactElement, useContext, useEffect, useState } from 'react'\nimport { X } from 'react-feather'\nimport { useParams, useNavigate } from 'react-router-dom'\nimport { DocumentationText } from '../../components/DocumentationText'\nimport ExpandableListItemActions from '../../components/ExpandableListItemActions'\nimport ExpandableListItemKey from '../../components/ExpandableListItemKey'\nimport ExpandableListItemLink from '../../components/ExpandableListItemLink'\nimport { HistoryHeader } from '../../components/HistoryHeader'\nimport { SwarmButton } from '../../components/SwarmButton'\nimport { Context as BeeContext } from '../../providers/Bee'\nimport { Context as IdentityContext } from '../../providers/Feeds'\nimport { Context as SettingsContext } from '../../providers/Settings'\nimport { ROUTES } from '../../routes'\nimport { UploadArea } from '../files/UploadArea'\n\nexport function FeedSubpage(): ReactElement {\n const { identities } = useContext(IdentityContext)\n const { uuid } = useParams()\n const { beeApi } = useContext(SettingsContext)\n const { status } = useContext(BeeContext)\n\n const navigate = useNavigate()\n\n const [available, setAvailable] = useState(false)\n\n const identity = identities.find(x => x.uuid === uuid)\n\n useEffect(() => {\n if (!identity || !identity.feedHash) {\n return\n }\n\n try {\n beeApi?.downloadData(identity.feedHash).then(() => setAvailable(true))\n } catch {\n setAvailable(false)\n }\n }, [beeApi, uuid, identity])\n\n if (!identity || !status.all) {\n navigate(ROUTES.FEEDS, { replace: true })\n\n return <>\n }\n\n function onClose() {\n navigate(ROUTES.FEEDS)\n }\n\n return (\n
\n {`${identity.name} Website`}\n \n {available && identity.feedHash ? (\n <>\n \n \n \n \n \n \n \n ) : (\n \n \n This feed is curently not pointing anywhere, you can update the feed to fix this. Please refer to the{' '}\n \n official Bee documentation\n \n .\n \n \n )}\n \n \n Close\n \n \n
\n )\n}\n","import { PostageBatch } from '@ethersphere/bee-js'\nimport { createContext, ReactChild, ReactElement, useContext, useEffect, useState } from 'react'\nimport { Context as SettingsContext } from './Settings'\n\nexport interface EnrichedPostageBatch extends PostageBatch {\n usage: number\n usageText: string\n}\n\ninterface ContextInterface {\n stamps: EnrichedPostageBatch[] | null\n error: Error | null\n isLoading: boolean\n lastUpdate: number | null\n start: (frequency?: number) => void\n stop: () => void\n refresh: () => Promise\n}\n\nconst initialValues: ContextInterface = {\n stamps: null,\n error: null,\n isLoading: false,\n lastUpdate: null,\n start: () => {}, // eslint-disable-line\n stop: () => {}, // eslint-disable-line\n refresh: () => Promise.reject(),\n}\n\nexport const Context = createContext(initialValues)\nexport const Consumer = Context.Consumer\n\ninterface Props {\n children: ReactChild\n}\n\nfunction enrichStamp(postageBatch: PostageBatch): EnrichedPostageBatch {\n const { depth, bucketDepth, utilization } = postageBatch\n\n const usage = utilization / Math.pow(2, depth - bucketDepth)\n const usageText = `${Math.ceil(usage * 100)}%`\n\n return {\n ...postageBatch,\n usage,\n usageText,\n }\n}\n\nexport function Provider({ children }: Props): ReactElement {\n const { beeDebugApi } = useContext(SettingsContext)\n const [stamps, setStamps] = useState(initialValues.stamps)\n const [error, setError] = useState(initialValues.error)\n const [isLoading, setIsLoading] = useState(initialValues.isLoading)\n const [lastUpdate, setLastUpdate] = useState(initialValues.lastUpdate)\n const [frequency, setFrequency] = useState(null)\n\n const refresh = async () => {\n // Don't want to refresh when already refreshing\n if (isLoading) return\n\n if (!beeDebugApi) return\n\n try {\n setIsLoading(true)\n const stamps = await beeDebugApi.getAllPostageBatch()\n\n setStamps(stamps.map(enrichStamp))\n setLastUpdate(Date.now())\n } catch (e) {\n setError(e as Error)\n } finally {\n setIsLoading(false)\n }\n }\n\n const start = (freq = 30000) => setFrequency(freq)\n const stop = () => setFrequency(null)\n\n // Start the update loop\n useEffect(() => {\n refresh()\n\n // Start autorefresh only if the frequency is set\n if (frequency) {\n const interval = setInterval(refresh, frequency)\n\n return () => clearInterval(interval)\n }\n }, [frequency]) // eslint-disable-line react-hooks/exhaustive-deps\n\n return (\n \n {children}\n \n )\n}\n","import { Box, Typography } from '@material-ui/core'\nimport { ReactElement, useState } from 'react'\nimport { Check, X } from 'react-feather'\nimport ExpandableListItemActions from '../../components/ExpandableListItemActions'\nimport { SwarmButton } from '../../components/SwarmButton'\nimport { SwarmDialog } from '../../components/SwarmDialog'\nimport { SwarmTextInput } from '../../components/SwarmTextInput'\nimport { TitleWithClose } from '../../components/TitleWithClose'\n\ninterface Props {\n feedName: string\n onProceed: (password: string) => void\n onCancel: () => void\n loading: boolean\n}\n\nexport function FeedPasswordDialog({ feedName, onProceed, onCancel, loading }: Props): ReactElement {\n const [password, setPassword] = useState('')\n\n function onProceedClick() {\n return onProceed(password)\n }\n\n return (\n \n \n Update Feed\n \n \n Please enter the password for “{feedName}”:\n \n \n {\n setPassword(event.target.value)\n }}\n password\n />\n \n \n \n Proceed\n \n \n Cancel\n \n \n \n )\n}\n","import { Box, Grid, Typography } from '@material-ui/core'\nimport { useSnackbar } from 'notistack'\nimport { ReactElement, useContext, useEffect, useState } from 'react'\nimport { Bookmark, X } from 'react-feather'\nimport { useParams, useNavigate } from 'react-router'\nimport ExpandableListItemActions from '../../components/ExpandableListItemActions'\nimport { HistoryHeader } from '../../components/HistoryHeader'\nimport { SwarmButton } from '../../components/SwarmButton'\nimport { SelectEvent, SwarmSelect } from '../../components/SwarmSelect'\nimport TroubleshootConnectionCard from '../../components/TroubleshootConnectionCard'\nimport { Context as BeeContext } from '../../providers/Bee'\nimport { Context as IdentityContext, Identity } from '../../providers/Feeds'\nimport { Context as SettingsContext } from '../../providers/Settings'\nimport { Context as StampContext } from '../../providers/Stamps'\nimport { ROUTES } from '../../routes'\nimport { persistIdentity, updateFeed } from '../../utils/identity'\nimport { FeedPasswordDialog } from './FeedPasswordDialog'\n\nexport default function UpdateFeed(): ReactElement {\n const { identities, setIdentities } = useContext(IdentityContext)\n const { beeApi, beeDebugApi } = useContext(SettingsContext)\n const { stamps, refresh } = useContext(StampContext)\n const { status } = useContext(BeeContext)\n const { hash } = useParams()\n\n const [selectedStamp, setSelectedStamp] = useState(null)\n const [selectedIdentity, setSelectedIdentity] = useState(null)\n const [loading, setLoading] = useState(false)\n const { enqueueSnackbar } = useSnackbar()\n const [showPasswordPrompt, setShowPasswordPrompt] = useState(false)\n\n const navigate = useNavigate()\n\n useEffect(() => {\n refresh()\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [])\n\n function onFeedChange(event: SelectEvent) {\n const uuid = event.target.value\n setSelectedIdentity(identities.find(x => x.uuid === uuid) || null)\n }\n\n function onStampChange(event: SelectEvent) {\n const batchId = event.target.value as string\n setSelectedStamp(batchId)\n }\n\n function onCancel() {\n navigate(-1)\n }\n\n function onBeginUpdatingFeed() {\n if (!selectedIdentity) {\n return\n }\n\n if (selectedIdentity.type === 'V3') {\n setShowPasswordPrompt(true)\n } else {\n onFeedUpdate(selectedIdentity)\n }\n }\n\n async function onFeedUpdate(identity: Identity, password?: string) {\n setLoading(true)\n\n if (!beeApi || !beeDebugApi || !selectedStamp) {\n enqueueSnackbar(Bee API unavailabe, { variant: 'error' })\n setLoading(false)\n\n return\n }\n\n try {\n await updateFeed(beeApi, identity, hash!, selectedStamp, password as string) // eslint-disable-line\n persistIdentity(identities, identity)\n setIdentities([...identities])\n navigate(ROUTES.FEEDS_PAGE.replace(':uuid', identity.uuid))\n } catch (error: unknown) {\n setLoading(false)\n\n const message = (typeof error === 'object' && error !== null && Reflect.get(error, 'message')) || ''\n\n if (message.includes('possibly wrong passphrase')) {\n enqueueSnackbar('Wrong password, please try again', { variant: 'error' })\n } else {\n enqueueSnackbar('Could not update feed at this time, please try again later', { variant: 'error' })\n }\n }\n }\n\n if (!status.all) return \n\n return (\n
\n {showPasswordPrompt && selectedIdentity && (\n {\n setShowPasswordPrompt(false)\n }}\n onProceed={(password: string) => {\n onFeedUpdate(selectedIdentity, password)\n }}\n loading={loading}\n />\n )}\n Update feed\n \n \n ({ value: x.uuid, label: `${x.name} Website` }))}\n onChange={onFeedChange}\n label=\"Feed\"\n />\n \n \n\n \n \n {stamps ? (\n ({ value: x.batchID, label: x.batchID.slice(0, 8) }))}\n onChange={onStampChange}\n label=\"Stamp\"\n />\n ) : (\n You need to buy a stamp first to be able to update a feed.\n )}\n \n \n \n \n Update Selected Feed\n \n \n Close\n \n \n
\n )\n}\n","import { ReactElement, ReactNode } from 'react'\nimport { makeStyles, Theme, createStyles } from '@material-ui/core/styles'\nimport { Typography } from '@material-ui/core'\nimport ListItem from '@material-ui/core/ListItem'\n\nconst useStyles = makeStyles((theme: Theme) =>\n createStyles({\n header: {\n backgroundColor: '#F7F7F7',\n marginBottom: theme.spacing(0.25),\n },\n typography: {\n color: '#242424',\n },\n }),\n)\n\ninterface Props {\n children?: ReactNode | ReactNode[]\n}\n\nexport default function ExpandableListItemNote({ children }: Props): ReactElement | null {\n const classes = useStyles()\n\n return (\n \n \n {children}\n \n \n )\n}\n","import { Grid, IconButton, InputBase, ListItem, Typography } from '@material-ui/core'\nimport Collapse from '@material-ui/core/Collapse'\nimport { createStyles, makeStyles, Theme } from '@material-ui/core/styles'\nimport { ChangeEvent, ReactElement, useState } from 'react'\nimport { Edit, Minus, Search, X } from 'react-feather'\nimport ExpandableListItemActions from './ExpandableListItemActions'\nimport ExpandableListItemNote from './ExpandableListItemNote'\nimport { SwarmButton } from './SwarmButton'\n\nconst useStyles = makeStyles((theme: Theme) =>\n createStyles({\n header: {\n backgroundColor: theme.palette.background.paper,\n marginBottom: theme.spacing(0.25),\n borderLeft: `${theme.spacing(0.25)}px solid rgba(0,0,0,0)`,\n wordBreak: 'break-word',\n },\n headerOpen: {\n borderLeft: `${theme.spacing(0.25)}px solid ${theme.palette.primary.main}`,\n },\n copyValue: {\n cursor: 'pointer',\n padding: theme.spacing(1),\n borderRadius: 0,\n '&:hover': {\n backgroundColor: '#fcf2e8',\n color: theme.palette.primary.main,\n },\n },\n content: {\n marginTop: theme.spacing(1),\n marginBottom: theme.spacing(1),\n },\n keyMargin: {\n marginRight: theme.spacing(1),\n },\n unselectableLabel: {\n cursor: 'default',\n userSelect: 'none',\n // Many browsers don't support yet the general user-select css property\n WebkitUserSelect: 'none',\n MozUserSelect: 'none',\n msUserSelect: 'none',\n },\n }),\n)\n\ninterface Props {\n label: string\n value?: string\n placeholder?: string\n helperText?: string\n expandedOnly?: boolean\n confirmLabel?: string\n confirmLabelDisabled?: boolean\n loading?: boolean\n onChange?: (value: string) => void\n onConfirm: (value: string) => void\n mapperFn?: (value: string) => string\n locked?: boolean\n}\n\nexport default function ExpandableListItemKey({\n label,\n value,\n onConfirm,\n onChange,\n confirmLabel,\n confirmLabelDisabled,\n expandedOnly,\n helperText,\n placeholder,\n loading,\n mapperFn,\n locked,\n}: Props): ReactElement | null {\n const classes = useStyles()\n const [open, setOpen] = useState(Boolean(expandedOnly))\n const [inputValue, setInputValue] = useState(value || '')\n const toggleOpen = () => setOpen(!open)\n const handleChange = (e: ChangeEvent) => {\n if (mapperFn) {\n e.target.value = mapperFn(e.target.value)\n }\n\n setInputValue(e.target.value)\n\n if (onChange) onChange(e.target.value)\n }\n\n return (\n <>\n \n \n \n {label && (\n \n {label}\n \n )}\n \n
\n {!open && value}\n {!expandedOnly && !locked && (\n \n {open ? (\n \n ) : (\n \n )}\n \n )}\n
\n
\n
\n \n \n
\n
\n \n {helperText && {helperText}}\n \n onConfirm(inputValue)}\n >\n {confirmLabel || 'Save'}\n \n setInputValue(value || '')}\n cancel\n >\n Cancel\n \n \n \n \n )\n}\n","import { shortenHash } from './hash'\n\nexport enum HISTORY_KEYS {\n UPLOAD_HISTORY = 'UPLOAD_HISTORY',\n DOWNLOAD_HISTORY = 'DOWNLOAD_HISTORY',\n}\n\nexport interface HistoryItem {\n createdAt: number\n name: string\n hash: string\n}\n\nexport function putHistory(key: string, hash: string, name: string): void {\n const history = getHistorySafe(key)\n\n const existingIndex = history.findIndex(x => x.hash === hash)\n\n if (existingIndex !== -1) {\n history.splice(existingIndex, 1)\n }\n\n history.unshift({\n createdAt: Date.now(),\n hash,\n name,\n })\n\n if (history.length > 10) {\n history.length = 10\n }\n localStorage.setItem(key, JSON.stringify(history))\n}\n\nexport function getHistorySafe(key: string): HistoryItem[] {\n const items = localStorage.getItem(key)\n\n if (!items) {\n return []\n }\n try {\n const parsed = JSON.parse(items)\n\n if (!Array.isArray(parsed) || !parsed.every(isHistoryItem)) {\n return []\n }\n\n return parsed\n } catch {\n return []\n }\n}\n\nfunction isHistoryItem(x: unknown): x is HistoryItem {\n if (typeof x !== 'object' || x === null) {\n return false\n }\n\n return 'createdAt' in x && 'hash' in x\n}\n\nexport function determineHistoryName(hash: string, indexDocument?: string | null): string {\n if (indexDocument === 'index.html') {\n return `Website ${shortenHash(hash, 4)}`\n } else if (indexDocument) {\n return indexDocument\n }\n\n return `Folder ${shortenHash(hash, 4)}`\n}\n","export function shortenHash(hash: string, sliceLength = 8): string {\n return `${hash.slice(0, sliceLength)}[…]${hash.slice(-sliceLength)}`\n}\n","import { ReactElement, useEffect, useState } from 'react'\nimport { getPrettyDateString } from '../utils/date'\nimport { getHistorySafe, HistoryItem, HISTORY_KEYS } from '../utils/local-storage'\nimport ExpandableList from './ExpandableList'\nimport ExpandableListItemLink from './ExpandableListItemLink'\n\ninterface Props {\n title: string\n localStorageKey: HISTORY_KEYS\n}\n\nexport function History({ title, localStorageKey }: Props): ReactElement | null {\n const [items, setItems] = useState([])\n\n useEffect(() => {\n setItems(getHistorySafe(localStorageKey))\n }, [localStorageKey])\n\n if (!items.length) {\n return null\n }\n\n return (\n \n {items.map((x, i) => (\n \n ))}\n \n )\n}\n","export function getPrettyDateString(date: Date): string {\n const string = date.toString()\n\n return string.split('GMT')[0].trim()\n}\n","import { createStyles, makeStyles, Tab, Tabs, Theme } from '@material-ui/core'\nimport { ReactElement } from 'react'\nimport { useNavigate } from 'react-router-dom'\nimport { ROUTES } from '../../routes'\n\ninterface Props {\n active: 'UPLOAD' | 'DOWNLOAD'\n}\n\nconst useStyles = makeStyles((theme: Theme) =>\n createStyles({\n root: {\n flexGrow: 1,\n marginBottom: theme.spacing(4),\n },\n leftTab: {\n marginRight: theme.spacing(0.5),\n },\n rightTab: {\n marginLeft: theme.spacing(0.5),\n },\n }),\n)\n\nexport function FileNavigation({ active }: Props): ReactElement {\n const classes = useStyles()\n const navigate = useNavigate()\n\n function onChange(event: React.ChangeEvent>, newValue: number) {\n navigate(newValue === 1 ? ROUTES.DOWNLOAD : ROUTES.UPLOAD)\n }\n\n return (\n
\n \n \n \n \n
\n )\n}\n","import { Utils } from '@ethersphere/bee-js'\nimport { ManifestJs } from '@ethersphere/manifest-js'\nimport { useSnackbar } from 'notistack'\nimport { ReactElement, useContext, useState } from 'react'\nimport { useNavigate } from 'react-router-dom'\nimport ExpandableListItemInput from '../../components/ExpandableListItemInput'\nimport { History } from '../../components/History'\nimport { Context, defaultUploadOrigin } from '../../providers/File'\nimport { Context as SettingsContext } from '../../providers/Settings'\nimport { ROUTES } from '../../routes'\nimport { extractSwarmHash } from '../../utils'\nimport { determineHistoryName, HISTORY_KEYS, putHistory } from '../../utils/local-storage'\nimport { FileNavigation } from './FileNavigation'\n\nexport function Download(): ReactElement {\n const [loading, setLoading] = useState(false)\n const { beeApi } = useContext(SettingsContext)\n const [referenceError, setReferenceError] = useState(undefined)\n\n const { setUploadOrigin } = useContext(Context)\n\n const { enqueueSnackbar } = useSnackbar()\n const navigate = useNavigate()\n\n const validateChange = (value: string) => {\n if (Utils.isHexString(value, 64) || Utils.isHexString(value, 128) || !value.trim().length) {\n setReferenceError(undefined)\n } else {\n setReferenceError('Incorrect format of swarm hash. Expected 64 or 128 hexstring characters.')\n }\n }\n\n async function onSwarmIdentifier(identifier: string) {\n setLoading(true)\n\n if (!beeApi) {\n setLoading(false)\n\n return\n }\n\n try {\n const manifestJs = new ManifestJs(beeApi)\n const feedIdentifier = await manifestJs.resolveFeedManifest(identifier)\n\n if (feedIdentifier) {\n identifier = feedIdentifier\n }\n const isManifest = await manifestJs.isManifest(identifier)\n\n if (!isManifest) {\n throw Error('The specified hash does not contain valid content.')\n }\n const indexDocument = await manifestJs.getIndexDocumentPath(identifier)\n putHistory(HISTORY_KEYS.DOWNLOAD_HISTORY, identifier, determineHistoryName(identifier, indexDocument))\n setUploadOrigin(defaultUploadOrigin)\n navigate(ROUTES.HASH.replace(':hash', identifier))\n } catch (error: unknown) {\n let message = typeof error === 'object' && error !== null && Reflect.get(error, 'message')\n\n if (message.includes('path address not found')) {\n message = 'The specified hash does not have an index document set.'\n }\n\n if (message.includes('Not Found: Not Found')) {\n message = 'The specified hash was not found.'\n }\n enqueueSnackbar(Error: {message || 'Unknown'}, { variant: 'error' })\n } finally {\n setLoading(false)\n }\n }\n\n function recognizeSwarmHash(value: string) {\n if (value.length < 64) {\n return value\n }\n\n const hash = extractSwarmHash(value)\n\n if (hash) {\n return hash\n }\n\n return value\n }\n\n return (\n <>\n \n onSwarmIdentifier(value)}\n onChange={validateChange}\n helperText={referenceError}\n confirmLabel={'Find'}\n confirmLabelDisabled={Boolean(referenceError) || loading}\n placeholder=\"e.g. 31fb0362b1a42536134c86bc58b97ac0244e5c6630beec3e27c2d1cecb38c605\"\n expandedOnly\n mapperFn={value => recognizeSwarmHash(value)}\n loading={loading}\n />\n \n \n )\n}\n","import { CircularProgress, Grid } from '@material-ui/core'\nimport { ReactElement } from 'react'\n\nexport function Loading(): ReactElement {\n return (\n \n \n \n )\n}\n","import { createStyles, makeStyles } from '@material-ui/core'\nimport { ReactElement } from 'react'\n\nconst useStyles = makeStyles(() =>\n createStyles({\n image: {\n width: '100%',\n height: '100%',\n objectFit: 'cover',\n },\n }),\n)\n\ninterface Props {\n alt: string\n src: string | undefined\n maxHeight?: string\n maxWidth?: string\n}\n\nexport function FitImage(props: Props): ReactElement {\n const classes = useStyles()\n\n const inlineStyles: Record = {}\n\n props.maxHeight && (inlineStyles.maxHeight = props.maxHeight)\n props.maxWidth && (inlineStyles.maxWidth = props.maxWidth)\n\n return {props.alt}\n}\n","import { createStyles, makeStyles } from '@material-ui/core'\nimport { ReactElement } from 'react'\n\ninterface Props {\n children: ReactElement | ReactElement[]\n}\n\nconst useStyles = makeStyles(() =>\n createStyles({\n wrapper: {\n display: 'flex',\n justifyContent: 'center',\n alignItems: 'center',\n width: '175px',\n height: '175px',\n background: `repeating-linear-gradient(\n 45deg,\n #efefef,\n #efefef 4px,\n #ffffff 4px,\n #ffffff 8px\n )`,\n },\n }),\n)\n\nexport function StripedWrapper({ children }: Props): ReactElement {\n const classes = useStyles()\n\n return
{children}
\n}\n","import { ReactElement } from 'react'\nimport { StripedWrapper } from '../../components/StripedWrapper'\n\ninterface Props {\n icon: ReactElement\n}\n\nexport function AssetIcon({ icon }: Props): ReactElement {\n return {icon}\n}\n","import { Box, Grid, Typography } from '@material-ui/core'\nimport { Web } from '@material-ui/icons'\nimport { ReactElement } from 'react'\nimport { File, Folder } from 'react-feather'\nimport { FitImage } from '../../components/FitImage'\nimport { shortenText } from '../../utils'\nimport { getHumanReadableFileSize } from '../../utils/file'\nimport { shortenHash } from '../../utils/hash'\nimport { AssetIcon } from './AssetIcon'\n\ninterface Props {\n previewUri?: string\n metadata?: Metadata\n}\n\n// TODO: add optional prop for indexDocument when it is already known (e.g. downloading a manifest)\n\nexport function AssetPreview({ metadata, previewUri }: Props): ReactElement | null {\n let previewComponent = \n let type = metadata?.type\n\n if (metadata?.isWebsite) {\n previewComponent = \n type = 'Website'\n } else if (metadata?.type === 'folder') {\n previewComponent = \n type = 'Folder'\n }\n\n return (\n \n \n \n {previewUri ? (\n \n ) : (\n \n )}\n \n {metadata?.hash && Swarm Hash: {shortenHash(metadata.hash)}}\n {metadata?.name && metadata?.name !== metadata?.hash && (\n \n {metadata?.type === 'folder' ? 'Folder Name' : 'Filename'}: {shortenText(metadata?.name)}\n \n )}\n Kind: {type}\n {metadata?.size ? Size: {getHumanReadableFileSize(metadata.size)} : null}\n \n \n \n {metadata?.type === 'folder' && metadata.count && (\n \n \n Folder content\n {metadata.count} items\n \n \n )}\n \n )\n}\n","import * as swarmCid from '@ethersphere/swarm-cid'\nimport { Box } from '@material-ui/core'\nimport { ReactElement } from 'react'\nimport { DocumentationText } from '../../components/DocumentationText'\nimport ExpandableListItemKey from '../../components/ExpandableListItemKey'\nimport ExpandableListItemLink from '../../components/ExpandableListItemLink'\n\ninterface Props {\n isWebsite?: boolean\n hash: string\n}\n\nexport function AssetSummary({ isWebsite, hash }: Props): ReactElement {\n return (\n <>\n \n \n \n {isWebsite && (\n \n )}\n \n \n The Swarm Gateway is graciously provided by the Swarm Foundation. This service is under development and provided\n for testing purposes only. Learn more at{' '}\n https://gateway.ethswarm.org/.\n \n \n )\n}\n","import { Box, Grid } from '@material-ui/core'\nimport { ReactElement } from 'react'\nimport { Bookmark, Download, Link, X } from 'react-feather'\nimport ExpandableListItemActions from '../../components/ExpandableListItemActions'\nimport { SwarmButton } from '../../components/SwarmButton'\n\ninterface Props {\n onOpen: () => void\n onCancel: () => void\n onDownload: () => void\n onUpdateFeed: () => void\n hasIndexDocument: boolean\n loading: boolean\n}\n\nexport function DownloadActionBar({\n onOpen,\n onCancel,\n onDownload,\n onUpdateFeed,\n hasIndexDocument,\n loading,\n}: Props): ReactElement {\n return (\n \n \n {hasIndexDocument && (\n \n View Website\n \n )}\n \n Download\n \n \n Close\n \n \n \n \n Update Feed\n \n \n \n )\n}\n","import { ManifestJs } from '@ethersphere/manifest-js'\nimport { Box, Typography } from '@material-ui/core'\nimport { saveAs } from 'file-saver'\nimport JSZip from 'jszip'\nimport { useSnackbar } from 'notistack'\nimport { ReactElement, useContext, useEffect, useState } from 'react'\nimport { useNavigate, useParams } from 'react-router-dom'\nimport { HistoryHeader } from '../../components/HistoryHeader'\nimport { Loading } from '../../components/Loading'\nimport TroubleshootConnectionCard from '../../components/TroubleshootConnectionCard'\nimport config from '../../config'\nimport { META_FILE_NAME, PREVIEW_FILE_NAME } from '../../constants'\nimport { Context as BeeContext } from '../../providers/Bee'\nimport { Context as SettingsContext } from '../../providers/Settings'\nimport { ROUTES } from '../../routes'\nimport { determineHistoryName, HISTORY_KEYS, putHistory } from '../../utils/local-storage'\nimport { AssetPreview } from './AssetPreview'\nimport { AssetSummary } from './AssetSummary'\nimport { DownloadActionBar } from './DownloadActionBar'\n\nexport function Share(): ReactElement {\n const { apiUrl, beeApi } = useContext(SettingsContext)\n const { status } = useContext(BeeContext)\n\n const { hash } = useParams()\n const reference = hash! // eslint-disable-line\n\n const navigate = useNavigate()\n const { enqueueSnackbar } = useSnackbar()\n\n const [loading, setLoading] = useState(true)\n const [downloading, setDownloading] = useState(false)\n const [swarmEntries, setSwarmEntries] = useState>({})\n const [indexDocument, setIndexDocument] = useState(null)\n const [notFound, setNotFound] = useState(false)\n const [preview, setPreview] = useState(undefined)\n const [metadata, setMetadata] = useState()\n\n async function prepare() {\n if (!beeApi || !status.all) {\n return\n }\n\n const manifestJs = new ManifestJs(beeApi)\n const isManifest = await manifestJs.isManifest(reference)\n\n if (!isManifest) {\n setNotFound(true)\n enqueueSnackbar('The specified hash does not contain valid content.', { variant: 'error' })\n\n return\n }\n const entries = await manifestJs.getHashes(reference)\n const indexDocument = await manifestJs.getIndexDocumentPath(reference)\n setIndexDocument(indexDocument)\n\n const previewFile = entries[PREVIEW_FILE_NAME]\n\n delete entries[META_FILE_NAME]\n delete entries[PREVIEW_FILE_NAME]\n setSwarmEntries(entries)\n\n const count = Object.keys(entries).length\n\n let metadata: Metadata | undefined = {\n hash,\n size: 0,\n type: count > 1 ? 'folder' : 'unknown',\n name: reference,\n isWebsite: Boolean(indexDocument) && count > 1,\n count,\n }\n\n try {\n const mtdt = await beeApi.downloadFile(reference, META_FILE_NAME)\n const remoteMetadata = mtdt.data.text()\n metadata = { ...metadata, ...(JSON.parse(remoteMetadata) as Metadata) }\n } catch (e) {} // eslint-disable-line no-empty\n\n if (previewFile) {\n setPreview(`${config.BEE_API_HOST}/bzz/${reference}/${PREVIEW_FILE_NAME}`)\n }\n\n setMetadata(metadata)\n }\n\n function onOpen() {\n window.open(`${apiUrl}/bzz/${reference}/`, '_blank')\n }\n\n function onClose() {\n if (navigate.length > 0) {\n // There is at least one different route in browser history that we can return to\n navigate(-1)\n } else {\n // This is the first page user opened, navigate to upload page instead of going back\n navigate(ROUTES.UPLOAD)\n }\n }\n\n function onUpdateFeed() {\n navigate(ROUTES.FEEDS_UPDATE.replace(':hash', reference))\n }\n\n useEffect(() => {\n setLoading(true)\n prepare().finally(() => {\n setLoading(false)\n })\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [reference])\n\n async function onDownload() {\n if (!beeApi) {\n return\n }\n putHistory(HISTORY_KEYS.DOWNLOAD_HISTORY, reference, determineHistoryName(reference, indexDocument))\n setDownloading(true)\n\n if (Object.keys(swarmEntries).length === 1) {\n window.open(`${apiUrl}/bzz/${reference}/`, '_blank')\n } else {\n const zip = new JSZip()\n for (const [path, hash] of Object.entries(swarmEntries)) {\n zip.file(path, await beeApi.downloadData(hash))\n }\n const content = await zip.generateAsync({ type: 'blob' })\n saveAs(content, reference + '.zip')\n }\n setDownloading(false)\n }\n\n if (!status.all) return \n\n if (loading) {\n return \n }\n\n if (notFound) {\n return (\n <>\n Not Found\n The specified hash is not found.\n \n )\n }\n\n return (\n <>\n \n \n \n \n \n \n \n \n )\n}\n","import { createStyles, Grid, makeStyles, Typography } from '@material-ui/core'\nimport { ReactElement } from 'react'\n\ninterface Props {\n steps: string[]\n index: number\n}\n\nconst useStyles = makeStyles(() =>\n createStyles({\n wrapper: {\n height: '52px',\n display: 'flex',\n flex: 1,\n justifyContent: 'center',\n alignItems: 'center',\n },\n todo: {\n background: '#f7f7f7',\n color: '#c9c9c9',\n },\n inProgress: {\n background: '#ffffff',\n color: '#242424',\n height: '52px',\n },\n done: {\n background: '#f7f7f7',\n color: '#606060',\n height: '52px',\n },\n }),\n)\n\nexport function ProgressIndicator({ steps, index }: Props): ReactElement {\n const classes = useStyles()\n\n function pickClass(i: number): string {\n if (i === index) {\n return classes.inProgress\n }\n\n return i < index ? classes.done : classes.todo\n }\n\n return (\n \n {steps.map((x, i) => (\n
\n {x}\n
\n ))}\n
\n )\n}\n","import { Box, Grid, Typography } from '@material-ui/core'\nimport BigNumber from 'bignumber.js'\nimport { Form, Formik, FormikHelpers } from 'formik'\nimport { useSnackbar } from 'notistack'\nimport { ReactElement, useContext } from 'react'\nimport { Check } from 'react-feather'\nimport { SwarmButton } from '../../components/SwarmButton'\nimport { SwarmTextInput } from '../../components/SwarmTextInput'\nimport { Context as BeeContext } from '../../providers/Bee'\nimport { Context as SettingsContext } from '../../providers/Settings'\nimport { Context as StampsContext } from '../../providers/Stamps'\nimport { calculateStampPrice, convertAmountToSeconds, convertDepthToBytes, secondsToTimeString } from '../../utils'\nimport { getHumanReadableFileSize } from '../../utils/file'\n\ninterface FormValues {\n depth?: string\n amount?: string\n label?: string\n}\ntype FormErrors = Partial\nconst initialFormValues: FormValues = {\n depth: '',\n amount: '',\n label: '',\n}\n\ninterface Props {\n onFinished: () => void\n}\n\nexport function PostageStampCreation({ onFinished }: Props): ReactElement {\n const { chainState } = useContext(BeeContext)\n const { refresh } = useContext(StampsContext)\n const { beeDebugApi } = useContext(SettingsContext)\n\n const { enqueueSnackbar } = useSnackbar()\n\n function getFileSize(depth: number): string {\n if (isNaN(depth) || depth < 17 || depth > 255) {\n return '-'\n }\n\n return `~${getHumanReadableFileSize(convertDepthToBytes(depth))}`\n }\n\n function getTtl(amount: number): string {\n const isCurrentPriceAvailable = chainState && chainState.currentPrice\n\n if (amount <= 0 || !isCurrentPriceAvailable) {\n return '-'\n }\n\n const pricePerBlock = Number.parseInt(chainState.currentPrice, 10)\n\n return `${secondsToTimeString(convertAmountToSeconds(amount, pricePerBlock))} (with price of 0 per block)`\n }\n\n function getPrice(depth: number, amount: bigint): string {\n const hasInvalidInput = amount <= 0 || isNaN(depth) || depth < 17 || depth > 255\n\n if (hasInvalidInput) {\n return '-'\n }\n\n const price = calculateStampPrice(depth, amount)\n\n return `${price.toSignificantDigits()} BZZ`\n }\n\n return (\n ) => {\n try {\n // This is really just a typeguard, the validation pretty much guarantees these will have the right values\n if (!values.depth || !values.amount) return\n\n if (!beeDebugApi) return\n\n const amount = BigInt(values.amount)\n const depth = Number.parseInt(values.depth)\n const options = values.label ? { label: values.label } : undefined\n await beeDebugApi.createPostageBatch(amount.toString(), depth, options)\n actions.resetForm()\n await refresh()\n onFinished()\n } catch (e) {\n enqueueSnackbar(`Error: ${(e as Error).message}`, { variant: 'error' })\n actions.setSubmitting(false)\n }\n }}\n validate={(values: FormValues) => {\n const errors: FormErrors = {}\n\n // Depth\n if (!values.depth) errors.depth = 'Required field'\n else {\n const depth = new BigNumber(values.depth)\n\n if (!depth.isInteger()) errors.depth = 'Depth must be an integer'\n else if (depth.isLessThan(16)) errors.depth = 'Minimal depth is 16'\n else if (depth.isGreaterThan(255)) errors.depth = 'Depth has to be at most 255'\n }\n\n // Amount\n if (!values.amount) errors.amount = 'Required field'\n else {\n const amount = new BigNumber(values.amount)\n\n if (!amount.isInteger()) errors.amount = 'Amount must be an integer'\n else if (amount.isLessThanOrEqualTo(0)) errors.amount = 'Amount must be greater than 0'\n }\n\n // Label\n if (values.label && !/^[0-9a-z]*$/i.test(values.label)) errors.label = 'Label must be an alphanumeric string'\n\n return errors\n }}\n >\n {({ submitForm, isValid, isSubmitting, values }) => (\n
\n \n \n \n \n Corresponding file size\n {getFileSize(parseInt(values.depth || '0', 10))}\n \n \n \n \n \n \n \n Corresponding TTL (Time to live)\n {getTtl(Number.parseInt(values.amount || '0', 10))}\n \n \n \n \n \n \n \n \n Indicative Price\n {getPrice(parseInt(values.depth || '0', 10), BigInt(values.amount || '0'))}\n \n \n \n Buy New Stamp\n \n \n )}\n \n )\n}\n","import React, { ReactElement, useContext } from 'react'\nimport { SwarmSelect } from '../../components/SwarmSelect'\nimport { Context, EnrichedPostageBatch } from '../../providers/Stamps'\n\ninterface Props {\n onSelect: (stamp: EnrichedPostageBatch) => void\n defaultValue?: string\n}\n\nexport function PostageStampSelector({ onSelect, defaultValue }: Props): ReactElement {\n const { stamps } = useContext(Context)\n\n function onChange(stampId: string) {\n if (!stamps) {\n return\n }\n const stamp = stamps.find(x => x.batchID === stampId)\n\n if (stamp) {\n onSelect(stamp)\n }\n }\n\n return (\n ({ label: x.batchID.slice(0, 8), value: x.batchID }))}\n onChange={event => onChange(event.target.value as string)}\n defaultValue={defaultValue}\n />\n )\n}\n","import { ReactElement } from 'react'\n\ninterface Props {\n width: string\n usage: number\n}\n\nexport function Capacity({ width, usage }: Props): ReactElement {\n const integerUsage = Math.round(usage * 100)\n const used = integerUsage + '%'\n const free = 100 - 2 - integerUsage + '%'\n\n return (\n
\n
\n
\n
\n
\n
\n
\n )\n}\n","import { Box, Grid, Typography } from '@material-ui/core'\nimport { ReactElement } from 'react'\nimport { Capacity } from '../../components/Capacity'\nimport { EnrichedPostageBatch } from '../../providers/Stamps'\n\ninterface Props {\n stamp: EnrichedPostageBatch\n shorten?: boolean\n}\n\nexport function PostageStamp({ stamp, shorten }: Props): ReactElement {\n return (\n \n \n {shorten ? stamp.batchID.slice(0, 8) : stamp.batchID}\n \n \n \n )\n}\n","import { Box, Typography } from '@material-ui/core'\nimport { ReactElement } from 'react'\nimport { EnrichedPostageBatch } from '../../providers/Stamps'\nimport { PostageStamp } from '../stamps/PostageStamp'\n\ninterface Props {\n stamp: EnrichedPostageBatch\n}\n\nexport function StampPreview({ stamp }: Props): ReactElement {\n return (\n \n \n Associated postage stamp:\n \n \n \n \n \n )\n}\n","import { Box, Grid } from '@material-ui/core'\nimport { ReactElement } from 'react'\nimport { ArrowLeft, Check, Layers, PlusSquare, X } from 'react-feather'\nimport { DocumentationText } from '../../components/DocumentationText'\nimport ExpandableListItemActions from '../../components/ExpandableListItemActions'\nimport { SwarmButton } from '../../components/SwarmButton'\n\ninterface Props {\n step: number\n onUpload: () => void\n onCancel: () => void\n onGoBack: () => void\n onProceed: () => void\n isUploading: boolean\n hasStamp: boolean\n uploadLabel: string\n stampMode: 'BUY' | 'SELECT'\n setStampMode: (mode: 'BUY' | 'SELECT') => void\n}\n\nexport function UploadActionBar({\n step,\n onUpload,\n onCancel,\n onGoBack,\n onProceed,\n isUploading,\n hasStamp,\n uploadLabel,\n stampMode,\n setStampMode,\n}: Props): ReactElement {\n if (step === 0) {\n return (\n <>\n \n \n \n Add Postage Stamp\n \n \n Cancel\n \n \n \n You need a postage stamp to upload.\n \n )\n }\n\n if (step === 1) {\n return (\n \n \n {stampMode === 'SELECT' && (\n \n Proceed With Selected Stamp\n \n )}\n \n Back To Preview\n \n \n setStampMode(stampMode === 'BUY' ? 'SELECT' : 'BUY')}\n iconType={stampMode === 'BUY' ? Layers : PlusSquare}\n >\n {stampMode === 'BUY' ? 'Use Existing Stamp' : 'Buy New Stamp'}\n \n \n )\n }\n\n if (step === 2) {\n return (\n \n \n {uploadLabel}\n \n \n Change Postage Stamp\n \n \n )\n }\n\n return <>\n}\n","import { Box } from '@material-ui/core'\nimport { useSnackbar } from 'notistack'\nimport { ReactElement, useContext, useEffect, useState } from 'react'\nimport { useNavigate } from 'react-router-dom'\nimport { DocumentationText } from '../../components/DocumentationText'\nimport { HistoryHeader } from '../../components/HistoryHeader'\nimport { ProgressIndicator } from '../../components/ProgressIndicator'\nimport TroubleshootConnectionCard from '../../components/TroubleshootConnectionCard'\nimport { Context as BeeContext } from '../../providers/Bee'\nimport { Context as IdentityContext, Identity } from '../../providers/Feeds'\nimport { Context as FileContext } from '../../providers/File'\nimport { Context as SettingsContext } from '../../providers/Settings'\nimport { Context as StampsContext, EnrichedPostageBatch } from '../../providers/Stamps'\nimport { ROUTES } from '../../routes'\nimport { detectIndexHtml, getAssetNameFromFiles, packageFile } from '../../utils/file'\nimport { persistIdentity, updateFeed } from '../../utils/identity'\nimport { HISTORY_KEYS, putHistory } from '../../utils/local-storage'\nimport { FeedPasswordDialog } from '../feeds/FeedPasswordDialog'\nimport { PostageStampCreation } from '../stamps/PostageStampCreation'\nimport { PostageStampSelector } from '../stamps/PostageStampSelector'\nimport { AssetPreview } from './AssetPreview'\nimport { StampPreview } from './StampPreview'\nimport { UploadActionBar } from './UploadActionBar'\nimport { META_FILE_NAME, PREVIEW_FILE_NAME } from '../../constants'\n\nexport function Upload(): ReactElement {\n const [step, setStep] = useState(0)\n const [stampMode, setStampMode] = useState<'SELECT' | 'BUY'>('SELECT')\n const [stamp, setStamp] = useState(null)\n const [isUploading, setUploading] = useState(false)\n const [showPasswordPrompt, setShowPasswordPrompt] = useState(false)\n\n const { refresh } = useContext(StampsContext)\n const { beeApi } = useContext(SettingsContext)\n const { files, setFiles, uploadOrigin, metadata, previewUri, previewBlob } = useContext(FileContext)\n const { identities, setIdentities } = useContext(IdentityContext)\n const { status } = useContext(BeeContext)\n\n const { enqueueSnackbar } = useSnackbar()\n const navigate = useNavigate()\n\n useEffect(() => {\n refresh()\n }, []) // eslint-disable-line react-hooks/exhaustive-deps\n\n if (!status.all) return \n\n if (!files.length) {\n setFiles([])\n navigate(ROUTES.UPLOAD, { replace: true })\n\n return <>\n }\n\n const identity = uploadOrigin.uuid ? identities.find(x => x.uuid === uploadOrigin.uuid) : null\n\n const onUpload = () => {\n if (uploadOrigin.origin === 'UPLOAD') {\n uploadFiles()\n } else {\n if ((identity as Identity).type === 'PRIVATE_KEY') {\n uploadFiles()\n } else {\n setShowPasswordPrompt(true)\n }\n }\n }\n\n const uploadFiles = (password?: string) => {\n if (!beeApi || !files.length || !stamp || !metadata) {\n return\n }\n\n let fls = files.map(packageFile) // Apart from packaging, this is needed to not modify the original files array as it can trigger effects\n let indexDocument: string | undefined = undefined // This means we assume it's folder\n\n if (files.length === 1) indexDocument = files[0].name\n else if (files.length > 1) {\n const idx = detectIndexHtml(files)\n\n // This is a website\n if (idx) {\n // The website is in some directory, remove it\n if (idx.commonPrefix) {\n const substrStart = idx.commonPrefix.length\n indexDocument = idx.indexPath.substr(substrStart)\n fls = fls.map(f => {\n const path = (f.path as string).substr(substrStart)\n\n return { ...f, path, webkitRelativePath: path, fullPath: path }\n })\n } else {\n // The website is not packed in a directory\n indexDocument = idx.indexPath\n }\n }\n }\n const lastModified = files[0].lastModified\n\n // We want to store only some metadata\n const mtd: SwarmMetadata = {\n name: metadata.name,\n size: metadata.size,\n }\n\n // Type of the file only makes sense for a single file\n if (files.length === 1) mtd.type = metadata.type\n\n const metafile = new File([JSON.stringify(mtd)], META_FILE_NAME, {\n type: 'application/json',\n lastModified,\n })\n fls.push(packageFile(metafile))\n\n if (previewBlob) {\n const previewFile = new File([previewBlob], PREVIEW_FILE_NAME, {\n type: 'image/jpeg',\n lastModified,\n })\n fls.push(packageFile(previewFile))\n }\n\n setUploading(true)\n\n beeApi\n .uploadFiles(stamp.batchID, fls, { indexDocument })\n .then(hash => {\n putHistory(HISTORY_KEYS.UPLOAD_HISTORY, hash.reference, getAssetNameFromFiles(files))\n\n if (uploadOrigin.origin === 'UPLOAD') {\n navigate(ROUTES.HASH.replace(':hash', hash.reference), { replace: true })\n } else {\n updateFeed(beeApi, identity as Identity, hash.reference, stamp.batchID, password as string).then(() => {\n persistIdentity(identities, identity as Identity)\n setIdentities([...identities])\n navigate(ROUTES.FEEDS_PAGE.replace(':uuid', uploadOrigin.uuid as string), { replace: true })\n })\n }\n })\n .catch(e => {\n enqueueSnackbar(`Error uploading: ${e.message}`, { variant: 'error' })\n setUploading(false)\n })\n }\n\n const reset = () => {\n setStep(0)\n setFiles([])\n setStamp(null)\n setUploading(false)\n }\n\n const onFeedPasswordGiven = (password: string) => {\n uploadFiles(password)\n }\n\n return (\n <>\n {showPasswordPrompt && (\n setShowPasswordPrompt(false)}\n onProceed={onFeedPasswordGiven}\n />\n )}\n {identity && {`Update \"${identity.name}\"`}}\n {!identity && Upload}\n \n \n \n {(step === 0 || step === 2) && }\n {step === 1 && (\n <>\n \n {stampMode === 'SELECT' ? (\n setStamp(stamp)} defaultValue={stamp?.batchID} />\n ) : (\n setStampMode('SELECT')} />\n )}\n \n \n \n Please refer to the{' '}\n \n official Bee documentation\n {' '}\n to understand these values.\n \n \n \n )}\n {step === 2 && stamp && }\n setStep(step => step - 1)}\n onProceed={() => setStep(step => step + 1)}\n onUpload={onUpload}\n isUploading={isUploading}\n hasStamp={Boolean(stamp)}\n uploadLabel={identity ? 'Update Feed' : 'Upload To Your Node'}\n stampMode={stampMode}\n setStampMode={setStampMode}\n />\n \n )\n}\n","import { ReactElement, useContext } from 'react'\nimport { History } from '../../components/History'\nimport TroubleshootConnectionCard from '../../components/TroubleshootConnectionCard'\nimport { Context as BeeContext } from '../../providers/Bee'\nimport { defaultUploadOrigin } from '../../providers/File'\nimport { HISTORY_KEYS } from '../../utils/local-storage'\nimport { FileNavigation } from './FileNavigation'\nimport { UploadArea } from './UploadArea'\n\nexport function UploadLander(): ReactElement {\n const { status } = useContext(BeeContext)\n\n if (!status.all) return \n\n return (\n <>\n \n \n \n \n )\n}\n","const OPTIMAL_CONNECTED_PEERS = 200\nconst OPTIMAL_POPULATION = 100000\nconst OPTIMAL_DEPTH = 12\n\ninterface Threshold {\n minimumValue: number\n explanation: string\n score: number\n}\n\ntype Thresholds = {\n connectedPeers: Threshold[]\n population: Threshold[]\n depth: Threshold[]\n}\n\ntype ThresholdValue = {\n score: number\n maximumScore: number\n explanation: string\n}\n\nexport type ThresholdValues = {\n connectedPeers: ThresholdValue\n population: ThresholdValue\n depth: ThresholdValue\n}\n\nconst GENERIC_ERROR = 'There may be issues with your Bee node or connection.'\n\nconst THRESHOLDS: Thresholds = {\n connectedPeers: [\n {\n minimumValue: OPTIMAL_CONNECTED_PEERS,\n explanation: `Perfect! ${OPTIMAL_CONNECTED_PEERS} or more connected peers indicate a healthy topology.`,\n score: 2,\n },\n {\n minimumValue: 1,\n explanation: `Your Bee node is connected to peers, but this number should ideally be above ${OPTIMAL_CONNECTED_PEERS}. If you have only started your Bee node, this number may increase quickly.`,\n score: 1,\n },\n {\n minimumValue: 0,\n explanation: 'Your Bee node has not connected to any peers. ' + GENERIC_ERROR,\n score: 0,\n },\n ],\n population: [\n {\n minimumValue: OPTIMAL_POPULATION,\n explanation:\n 'Perfect! Your Bee node seems to have a realistic value for the network size, which means everything is working well on your end.',\n score: 2,\n },\n {\n minimumValue: 1,\n explanation: `Population is usually above ${OPTIMAL_POPULATION.toLocaleString()}. If the number does not increase within a few hours, there may be issues with your Bee node.`,\n score: 1,\n },\n {\n minimumValue: 0,\n explanation: 'Your Bee node has no information on the network population. ' + GENERIC_ERROR,\n score: 0,\n },\n ],\n depth: [\n {\n minimumValue: OPTIMAL_DEPTH,\n explanation: 'Perfect! Your Bee node has the highest available depth.',\n score: 2,\n },\n {\n minimumValue: 1,\n explanation: `Your Bee node is supposed to reach a depth of ${OPTIMAL_DEPTH} eventually. Stagnation or decrease in this number may indicate problems with your Bee node.`,\n score: 1,\n },\n {\n minimumValue: 0,\n explanation: 'Your Bee node has not started building its topology yet. ' + GENERIC_ERROR,\n score: 0,\n },\n ],\n}\n\nexport function pickThreshold(key: keyof Thresholds, value: number): ThresholdValue {\n const thresholds = THRESHOLDS[key]\n const maximumScore = thresholds[0].score\n for (const item of thresholds) {\n if (value >= item.minimumValue) {\n return {\n score: item.score,\n maximumScore,\n explanation: item.explanation,\n }\n }\n }\n const last = thresholds[thresholds.length - 1]\n\n return {\n score: last.score,\n maximumScore,\n explanation: last.explanation,\n }\n}\n","import type { Topology } from '@ethersphere/bee-js'\nimport type { ReactElement } from 'react'\nimport { pickThreshold, ThresholdValues } from '../utils/threshold'\nimport ExpandableListItem from './ExpandableListItem'\n\ninterface Props {\n topology: Topology | null\n}\n\nconst TopologyStats = (props: Props): ReactElement => {\n const thresholds: ThresholdValues = {\n connectedPeers: pickThreshold('connectedPeers', props.topology?.connected || 0),\n population: pickThreshold('population', props.topology?.population || 0),\n depth: pickThreshold('depth', props.topology?.depth || 0),\n }\n\n const maximumTotalScore = Object.values(thresholds).reduce((sum, item) => sum + item.maximumScore, 0)\n const actualTotalScore = Object.values(thresholds).reduce((sum, item) => sum + item.score, 0)\n const percentageText = Math.round((actualTotalScore / maximumTotalScore) * 100) + '%'\n\n return (\n <>\n \n \n \n \n \n )\n}\n\nexport default TopologyStats\n","import { ReactElement, useContext } from 'react'\nimport { Button } from '@material-ui/core'\n\nimport TroubleshootConnectionCard from '../../components/TroubleshootConnectionCard'\nimport { Context as BeeContext } from '../../providers/Bee'\nimport ExpandableList from '../../components/ExpandableList'\nimport ExpandableListItem from '../../components/ExpandableListItem'\nimport ExpandableListItemKey from '../../components/ExpandableListItemKey'\nimport TopologyStats from '../../components/TopologyStats'\n\nexport default function Status(): ReactElement {\n const {\n status,\n latestUserVersion,\n isLatestBeeVersion,\n latestBeeVersionUrl,\n topology,\n nodeAddresses,\n chequebookAddress,\n } = useContext(BeeContext)\n\n if (!status.all) return \n\n return (\n
\n \n \n \n Bee\n \n {` ${latestUserVersion || '-'} `}\n \n
\n }\n />\n \n \n \n\n \n {nodeAddresses?.underlay.map(addr => (\n \n ))}\n \n \n \n \n \n \n \n \n \n
\n )\n}\n","import { ReactElement, useContext } from 'react'\nimport ExpandableList from '../../components/ExpandableList'\nimport ExpandableListItemInput from '../../components/ExpandableListItemInput'\nimport { Context as SettingsContext } from '../../providers/Settings'\n\nexport default function Settings(): ReactElement {\n const { apiUrl, apiDebugUrl, setApiUrl, setDebugApiUrl, lockedApiSettings } = useContext(SettingsContext)\n\n return (\n \n \n \n \n )\n}\n","import { Collapse, ListItem } from '@material-ui/core'\nimport { createStyles, makeStyles, Theme } from '@material-ui/core/styles'\nimport { ExpandLess, ExpandMore } from '@material-ui/icons'\nimport { ReactElement, ReactNode, useState } from 'react'\n\nconst useStyles = makeStyles((theme: Theme) =>\n createStyles({\n root: {\n width: '100%',\n padding: 0,\n margin: 0,\n marginTop: theme.spacing(4),\n '&:first-child': {\n marginTop: 0,\n },\n },\n rootLevel1: { marginTop: theme.spacing(1) },\n rootLevel2: { marginTop: theme.spacing(0.5) },\n header: {\n backgroundColor: theme.palette.background.paper,\n },\n contentLevel0: {\n marginTop: theme.spacing(1),\n },\n contentLevel12: {\n marginTop: theme.spacing(0.25),\n },\n infoText: {\n color: '#c9c9c9',\n },\n }),\n)\n\ninterface Props {\n children: ReactNode\n expandable: ReactNode\n defaultOpen?: boolean\n}\n\nexport default function ExpandableElement({ children, expandable, defaultOpen }: Props): ReactElement | null {\n const classes = useStyles()\n const [open, setOpen] = useState(Boolean(defaultOpen))\n\n const handleClick = () => {\n setOpen(!open)\n }\n\n return (\n
\n \n {children}\n {open ? : }\n \n \n
{expandable}
\n
\n
\n )\n}\n","import type { ReactElement } from 'react'\nimport ExpandableElement from '../../components/ExpandableElement'\nimport ExpandableList from '../../components/ExpandableList'\nimport ExpandableListItem from '../../components/ExpandableListItem'\nimport ExpandableListItemKey from '../../components/ExpandableListItemKey'\nimport { EnrichedPostageBatch } from '../../providers/Stamps'\nimport { getHumanReadableFileSize } from '../../utils/file'\nimport { PostageStamp } from './PostageStamp'\n\ninterface Props {\n postageStamps: EnrichedPostageBatch[] | null\n}\n\nfunction StampsTable({ postageStamps }: Props): ReactElement | null {\n if (postageStamps === null) return null\n\n return (\n \n {postageStamps.map(stamp => (\n \n \n \n \n \n \n }\n >\n \n \n ))}\n \n )\n}\n\nexport default StampsTable\n","import { CircularProgress, Container } from '@material-ui/core'\nimport { createStyles, makeStyles } from '@material-ui/core/styles'\nimport { ReactElement, useContext, useEffect } from 'react'\nimport { PlusSquare } from 'react-feather'\nimport { useNavigate } from 'react-router'\nimport { SwarmButton } from '../../components/SwarmButton'\nimport TroubleshootConnectionCard from '../../components/TroubleshootConnectionCard'\nimport { Context as BeeContext } from '../../providers/Bee'\nimport { Context as StampsContext } from '../../providers/Stamps'\nimport { ROUTES } from '../../routes'\nimport StampsTable from './StampsTable'\n\nconst useStyles = makeStyles(() =>\n createStyles({\n root: {\n width: '100%',\n display: 'grid',\n },\n actions: {\n display: 'flex',\n width: '100%',\n flex: '0 1 auto',\n flexWrap: 'wrap',\n alignItems: 'center',\n },\n }),\n)\n\nexport default function Stamp(): ReactElement {\n const classes = useStyles()\n\n const navigate = useNavigate()\n\n const { stamps, isLoading, error, start, stop } = useContext(StampsContext)\n const { status } = useContext(BeeContext)\n\n useEffect(() => {\n if (!status.all) return\n start()\n\n return () => stop()\n }, [status]) // eslint-disable-line react-hooks/exhaustive-deps\n\n if (!status.all) return \n\n function navigateToNewStamp() {\n navigate(ROUTES.STAMPS_NEW)\n }\n\n return (\n
\n {error && (\n \n Error loading postage stamps details: {error.message}\n \n )}\n {!error && (\n <>\n
\n \n Buy New Postage Stamp\n \n
{isLoading && }
\n
\n \n \n )}\n
\n )\n}\n","import { ReactElement } from 'react'\nimport { useNavigate } from 'react-router'\nimport { HistoryHeader } from '../../components/HistoryHeader'\nimport { ROUTES } from '../../routes'\nimport { PostageStampCreation } from './PostageStampCreation'\n\nexport function CreatePostageStampPage(): ReactElement {\n const navigate = useNavigate()\n\n function onFinished() {\n navigate(ROUTES.STAMPS)\n }\n\n return (\n
\n Buy new postage stamp\n \n
\n )\n}\n","import React, { ReactElement, ReactNode } from 'react'\nimport { makeStyles, Theme, createStyles } from '@material-ui/core/styles'\nimport { Tab, Tabs } from '@material-ui/core'\n\ninterface TabPanelProps {\n children?: ReactNode\n index: number\n value: number\n}\n\nfunction TabPanel(props: TabPanelProps) {\n const { children, value, index, ...other } = props\n\n return (\n \n )\n}\n\nconst useStyles = makeStyles((theme: Theme) =>\n createStyles({\n root: {\n flexGrow: 1,\n },\n content: {\n marginTop: theme.spacing(2),\n },\n }),\n)\n\ninterface TabsValues {\n component: ReactNode\n label: ReactNode\n}\n\ninterface Props {\n values: TabsValues[]\n index?: number\n indexChanged?: (index: number) => void\n}\n\nexport default function SimpleTabs({ values, index, indexChanged }: Props): ReactElement {\n const classes = useStyles()\n const [value, setValue] = React.useState(index || 0)\n\n const handleChange = (event: React.ChangeEvent>, newValue: number) => {\n if (indexChanged) indexChanged(newValue)\n else setValue(newValue)\n }\n\n const v = index !== undefined ? index : value\n\n return (\n
\n \n {values.map(({ label }, idx) => (\n \n ))}\n \n
\n {values.map(({ component }, idx) => (\n \n {component}\n \n ))}\n
\n
\n )\n}\n","import { createContext, ReactChild, ReactElement, useState, useEffect } from 'react'\n\n// These need to be numeric values as they are used as indexes in the TabsContainer\nexport enum Platforms {\n macOS = 0,\n Linux,\n Windows,\n iOS,\n Android,\n}\n\nexport enum SupportedPlatforms {\n macOS = Platforms.macOS,\n Linux = Platforms.Linux,\n}\n\ninterface ContextInterface {\n platform: SupportedPlatforms\n setPlatform: (platform: SupportedPlatforms) => void\n}\n\nconst initialValues: ContextInterface = {\n platform: SupportedPlatforms.macOS,\n setPlatform: () => {}, // eslint-disable-line\n}\n\nexport const Context = createContext(initialValues)\nexport const Consumer = Context.Consumer\n\ninterface Props {\n children: ReactChild\n}\n\nfunction isSupportedPlatform(platform: unknown): platform is SupportedPlatforms {\n return Object.keys(SupportedPlatforms).includes(platform as string)\n}\n\nfunction getOS(): Platforms | null {\n const userAgent = window.navigator.userAgent\n const platform = window.navigator.platform\n const macosPlatforms = ['Macintosh', 'MacIntel', 'MacPPC', 'Mac68K']\n const windowsPlatforms = ['Win32', 'Win64', 'Windows', 'WinCE']\n const iosPlatforms = ['iPhone', 'iPad', 'iPod']\n\n if (macosPlatforms.includes(platform)) return Platforms.macOS\n\n if (iosPlatforms.includes(platform)) return Platforms.iOS\n\n if (windowsPlatforms.includes(platform)) return Platforms.Windows\n\n if (/Android/.test(userAgent)) return Platforms.Android\n\n if (/Linux/.test(platform)) return Platforms.Linux\n\n return null\n}\n\nexport function Provider({ children }: Props): ReactElement {\n const [platform, setPlatform] = useState(SupportedPlatforms.Linux)\n\n // This is in useEffect as it really just needs to run once and not on each re-render\n useEffect(() => {\n const os = getOS()\n\n setPlatform(isSupportedPlatform(os) ? os : SupportedPlatforms.Linux)\n }, [])\n\n return {children}\n}\n","import type { ReactElement } from 'react'\nimport SyntaxHighlighter from 'react-syntax-highlighter'\n\ninterface Props {\n code: string\n language: string\n showLineNumbers?: boolean\n}\n\nconst CodeBlock = (props: Props): ReactElement => {\n return (\n
\n \n {props.code}\n \n
\n )\n}\n\nexport default CodeBlock\n","import { ReactElement, useContext } from 'react'\nimport TabsContainer from './TabsContainer'\nimport CodeBlock from './CodeBlock'\nimport { Context } from '../providers/Platform'\n\ninterface Props {\n linux: string\n mac: string\n showLineNumbers?: boolean\n}\n\nexport default function CodeBlockTabs(props: Props): ReactElement {\n const { platform, setPlatform } = useContext(Context)\n\n return (\n ,\n },\n {\n label: 'macOS',\n component: ,\n },\n ]}\n />\n )\n}\n","import type { ReactElement } from 'react'\nimport { CircularProgress } from '@material-ui/core'\n\ninterface Props {\n isOk: boolean\n isLoading?: boolean\n size?: number | string\n className?: string\n}\n\nexport default function StatusIcon({ isOk, size, className, isLoading }: Props): ReactElement {\n const s = size || '1rem'\n\n if (isLoading) return \n\n return (\n \n )\n}\n","import MuiAlert from '@material-ui/lab/Alert'\nimport { ReactElement, useContext } from 'react'\nimport CodeBlockTabs from '../../../components/CodeBlockTabs'\nimport ExpandableList from '../../../components/ExpandableList'\nimport ExpandableListItem from '../../../components/ExpandableListItem'\nimport ExpandableListItemInput from '../../../components/ExpandableListItemInput'\nimport ExpandableListItemNote from '../../../components/ExpandableListItemNote'\nimport StatusIcon from '../../../components/StatusIcon'\nimport { Context } from '../../../providers/Bee'\nimport { Context as SettingsContext } from '../../../providers/Settings'\n\nexport default function NodeConnectionCheck(): ReactElement | null {\n const { status, isLoading } = useContext(Context)\n const { setDebugApiUrl, apiDebugUrl } = useContext(SettingsContext)\n const isOk = status.debugApiConnection\n\n return (\n \n Connection to Bee Debug API\n \n }\n >\n \n {isOk\n ? 'The connection to the Bee nodes debug API has been successful'\n : 'We cannot connect to your nodes debug API. Please check the following to troubleshoot your issue.'}\n \n \n\n {!isOk && (\n \n \n
  • Check the status of your node by running the below command to see if your node is running.
  • \n \n
  • \n If your node is running, check your firewall settings to make sure that port 1635 (or your custom\n specified port) is bound to localhost. If your node is not running try executing the below command to\n start your bee node\n
  • \n \n Your debug node API should never be completely open to the internet. If you want to connect remotely,\n make sure your firewall settings are set to only allow specific trusted IP addresses and block all\n other ports. A simple google search for "what is my ip" will show you your computers public\n IP address to allow.\n \n \n
  • Run the commands to validate your node is running and see the log output.
  • \n \n
  • \n Lastly, check your nodes configuration settings to validate the debug API is enabled and the Cross\n Origin Resource Sharing (CORS) setting is configured to allow your host. Config parameter{' '}\n debug-api-enable must be set to true and{' '}\n cors-allowed-origins must be set to your host domain or IP (you can also use the\n wildcard {\"cors-allowed-origins: ['*']\"}). If edits are made to the configuration run the\n restart command below for changes to take effect.\n
  • \n \n \n }\n />\n
    \n )}\n \n )\n}\n","import { ReactElement, useContext } from 'react'\n\nimport CodeBlockTabs from '../../../components/CodeBlockTabs'\nimport { Context as SettingsContext } from '../../../providers/Settings'\nimport ExpandableList from '../../../components/ExpandableList'\nimport ExpandableListItem from '../../../components/ExpandableListItem'\nimport ExpandableListItemNote from '../../../components/ExpandableListItemNote'\nimport ExpandableListItemInput from '../../../components/ExpandableListItemInput'\nimport StatusIcon from '../../../components/StatusIcon'\nimport { Context } from '../../../providers/Bee'\n\nexport default function NodeConnectionCheck(): ReactElement | null {\n const { setApiUrl, apiUrl } = useContext(SettingsContext)\n const { status, isLoading } = useContext(Context)\n const isOk = status.apiConnection\n\n return (\n \n Connection to Bee API\n \n }\n >\n \n {isOk\n ? 'The connection to the Bee nodes API has been successful'\n : 'Could not connect to your Bee nodes API. Please check the troubleshoot below on how you may resolve it.'}\n \n \n {!isOk && (\n \n \n
  • Check the status of your node by running the below command to see if your node is running.
  • \n \n
  • \n If your node is running, check your firewall settings to make sure that port 1633 (or your custom\n specified port) is exposed to the internet. If your node is not running try executing the below\n command to start your bee node\n
  • \n \n
  • Run the commands to validate your node is running and see the log output.
  • \n \n \n }\n />\n
    \n )}\n \n )\n}\n","import { ReactElement, useContext } from 'react'\nimport CodeBlockTabs from '../../../components/CodeBlockTabs'\nimport ExpandableList from '../../../components/ExpandableList'\nimport ExpandableListItem from '../../../components/ExpandableListItem'\nimport ExpandableListItemNote from '../../../components/ExpandableListItemNote'\nimport StatusIcon from '../../../components/StatusIcon'\nimport { Context } from '../../../providers/Bee'\n\nexport default function VersionCheck(): ReactElement | null {\n const { status, isLoading, latestUserVersion, latestPublishedVersion, latestBeeVersionUrl } = useContext(Context)\n const isOk = status.version\n\n return (\n \n Bee Version\n \n }\n >\n \n {isOk ? (\n 'You are running the latest version of Bee.'\n ) : (\n <>\n Your Bee version is out of date. Please update to the{' '}\n \n latest\n {' '}\n before continuing. Rerun the installation script below to upgrade. For more information please see the{' '}\n \n Docs\n \n .\n \n \n )}\n \n \n \n \n )\n}\n","import { ReactElement, useContext } from 'react'\nimport ExpandableList from '../../../components/ExpandableList'\nimport ExpandableListItemKey from '../../../components/ExpandableListItemKey'\nimport ExpandableListItemNote from '../../../components/ExpandableListItemNote'\nimport StatusIcon from '../../../components/StatusIcon'\nimport { Context } from '../../../providers/Bee'\n\nexport default function EthereumConnectionCheck(): ReactElement | null {\n const { status, isLoading, nodeAddresses } = useContext(Context)\n const isOk = status.blockchainConnection\n\n return (\n \n Connection to Blockchain\n \n }\n >\n \n {isOk ? (\n 'Your node is connected to the xDai blockchain'\n ) : (\n <>\n Your Bee node must have access to the xDai blockchain, so that it can interact and deploy your chequebook\n contract. You can run{' '}\n \n your own xDai node\n \n , or use a provider instead - we recommend{' '}\n \n Getblock\n \n . By default, Bee expects a local node at http://localhost:8545. To use a provider instead, simply change\n the swap-endpoint in your configuration file.\n \n )}\n \n {nodeAddresses?.ethereum && }\n \n )\n}\n","import { useContext } from 'react'\nimport DepositModal from '../../../containers/DepositModal'\nimport type { ReactElement } from 'react'\nimport ExpandableList from '../../../components/ExpandableList'\nimport ExpandableListItemKey from '../../../components/ExpandableListItemKey'\nimport ExpandableListItemActions from '../../../components/ExpandableListItemActions'\nimport ExpandableListItemNote from '../../../components/ExpandableListItemNote'\nimport StatusIcon from '../../../components/StatusIcon'\nimport { Context } from '../../../providers/Bee'\n\nconst ChequebookDeployFund = (): ReactElement | null => {\n const { status, isLoading, chequebookAddress } = useContext(Context)\n const isOk = status.chequebook\n\n return (\n \n Chequebook Deployment & Funding\n \n }\n >\n \n {isOk ? (\n 'Your chequebook is deployed and funded'\n ) : (\n <>\n Your chequebook is either not deployed or funded. To run the node you will need xDAI and xBZZ on the xDai\n network. You may need to aquire BZZ (e.g. bzz.exchange) and bridge it to\n the xDai network through the omni bridge. To pay the\n transaction fees, you will also need xDAI token. You can purchase DAI on the network and bridge it to xDai\n network through the xDai Bridge. See the{' '}\n official xDai website for more information.\n \n )}\n \n {chequebookAddress && (\n <>\n \n \n \n \n \n )}\n \n )\n}\n\nexport default ChequebookDeployFund\n","import type { ReactElement } from 'react'\nimport { Route, Routes } from 'react-router-dom'\nimport Accounting from './pages/accounting'\nimport Feeds from './pages/feeds'\nimport CreateNewFeed from './pages/feeds/CreateNewFeed'\nimport { FeedSubpage } from './pages/feeds/FeedSubpage'\nimport UpdateFeed from './pages/feeds/UpdateFeed'\nimport { Download } from './pages/files/Download'\nimport { Share } from './pages/files/Share'\nimport { Upload } from './pages/files/Upload'\nimport { UploadLander } from './pages/files/UploadLander'\nimport Info from './pages/info'\nimport Settings from './pages/settings'\nimport Stamps from './pages/stamps'\nimport { CreatePostageStampPage } from './pages/stamps/CreatePostageStampPage'\nimport Status from './pages/status'\nimport Upgrade from './pages/upgrade'\n\nexport enum ROUTES {\n INFO = '/',\n UPGRADE = '/upgrade',\n FILES = '/files',\n UPLOAD = '/files/upload',\n UPLOAD_IN_PROGRESS = '/files/upload/workflow',\n DOWNLOAD = '/files/download',\n HASH = '/files/hash/:hash',\n ACCOUNTING = '/accounting',\n SETTINGS = '/settings',\n STAMPS = '/stamps',\n STAMPS_NEW = '/stamps/new',\n STATUS = '/status',\n FEEDS = '/feeds',\n FEEDS_NEW = '/feeds/new',\n FEEDS_UPDATE = '/feeds/update/:hash',\n FEEDS_PAGE = '/feeds/:uuid',\n}\n\nconst BaseRouter = (): ReactElement => (\n \n } />\n } />\n } />\n } />\n } />\n } />\n } />\n } />\n } />\n } />\n } />\n } />\n } />\n } />\n } />\n \n)\n\nexport default BaseRouter\n","import { ReactElement, useContext } from 'react'\nimport ExpandableList from '../../../components/ExpandableList'\nimport ExpandableListItemNote from '../../../components/ExpandableListItemNote'\nimport TopologyStats from '../../../components/TopologyStats'\nimport StatusIcon from '../../../components/StatusIcon'\nimport { Context } from '../../../providers/Bee'\n\nexport default function PeerConnection(): ReactElement | null {\n const { status, isLoading, topology } = useContext(Context)\n const isOk = status.topology\n\n return (\n \n Connection to Peers\n \n }\n >\n \n {isOk\n ? 'You are connected to other Bee nodes'\n : 'Your node is not connected to any peers. Please wait a bit if you just started the node, otherwise review your configuration file.'}\n \n\n \n \n )\n}\n","import type { ReactElement } from 'react'\n\nimport DebugConnectionCheck from './SetupSteps/DebugConnectionCheck'\nimport NodeConnectionCheck from './SetupSteps/NodeConnectionCheck'\nimport VersionCheck from './SetupSteps/VersionCheck'\nimport EthereumConnectionCheck from './SetupSteps/EthereumConnectionCheck'\nimport ChequebookDeployFund from './SetupSteps/ChequebookDeployFund'\nimport PeerConnection from './SetupSteps/PeerConnection'\n\nexport default function NodeSetupWorkflow(): ReactElement {\n return (\n
    \n \n \n \n \n \n \n
    \n )\n}\n","import { Box, Typography } from '@material-ui/core'\nimport { ReactElement, useEffect, useState } from 'react'\nimport { Send } from 'react-feather'\nimport { Loading } from '../../components/Loading'\nimport { SwarmButton } from '../../components/SwarmButton'\nimport { SwarmTextInput } from '../../components/SwarmTextInput'\n\nexport default function UpgradePage(): ReactElement {\n const [node, setNode] = useState | null>(null)\n const [loading, setLoading] = useState(false)\n const [rpcProvider, setRpcProvider] = useState('https://dai.poa.network/')\n\n useEffect(() => {\n fetch('http://localhost:1635/node')\n .then(r => r.json())\n .then(json => setNode(json))\n }, [])\n\n async function onFund() {\n setLoading(true)\n try {\n const status = await fetch('http://localhost:5000/status').then(r => r.json())\n const { address } = status\n const balanceResponse = await fetch(rpcProvider, {\n method: 'POST',\n headers: {\n 'content-type': 'application/json',\n },\n body: JSON.stringify({\n jsonrpc: '2.0',\n method: 'eth_getBalance',\n params: [address, 'latest'],\n id: 1,\n }),\n }).then(r => r.json())\n const result = balanceResponse.result\n const xdai = parseInt(result, 16)\n\n if (xdai >= 10000000000000000) {\n setLoading(false)\n\n return\n }\n await fetch(`http://getxdai.co/${address}/0.01`, {\n method: 'POST',\n })\n } finally {\n setLoading(false)\n }\n }\n\n async function onUpgrade() {\n setLoading(true)\n try {\n await fetch('http://localhost:5000/config', {\n method: 'PATCH',\n headers: {\n 'content-type': 'application/json',\n },\n body: JSON.stringify({\n 'chain-enable': true,\n 'swap-enable': true,\n 'swap-endpoint': rpcProvider,\n }),\n })\n await fetch('http://localhost:5000/restart', {\n method: 'POST',\n })\n } finally {\n setLoading(false)\n }\n }\n\n if (!node) {\n return \n }\n\n if (node.beeMode !== 'ultra-light') {\n return (\n
    \n Already upgraded\n
    \n )\n }\n\n return (\n
    \n \n \n Fund\n \n \n \n {\n setRpcProvider(event.target.value)\n }}\n />\n \n \n Upgrade to Light Node\n \n
    \n )\n}\n","import type { ReactElement, ReactNode } from 'react'\nimport { useLocation, matchPath } from 'react-router-dom'\n\nimport { createStyles, Theme, makeStyles, withStyles } from '@material-ui/core/styles'\nimport { ListItemText, ListItemIcon, ListItem } from '@material-ui/core'\n\nconst StyledListItem = withStyles((theme: Theme) => ({\n root: {\n paddingLeft: theme.spacing(4),\n paddingRight: theme.spacing(4),\n borderLeft: '4px solid rgba(0,0,0,0)',\n '&.Mui-selected, &.Mui-selected:hover': {\n borderLeft: `4px solid ${theme.palette.primary.main}`,\n backgroundColor: '#2c2c2c',\n color: '#f9f9f9',\n },\n },\n button: {\n '&:hover': {\n backgroundColor: '#2c2c2c',\n color: '#f9f9f9',\n\n // https://github.com/mui-org/material-ui/issues/22543\n '@media (hover: none)': {\n backgroundColor: '#2c2c2c',\n color: '#f9f9f9',\n },\n },\n },\n}))(ListItem)\n\nconst useStyles = makeStyles((theme: Theme) =>\n createStyles({\n icon: {\n color: 'inherit',\n },\n activeIcon: {\n color: theme.palette.primary.main,\n },\n }),\n)\n\ninterface Props {\n iconStart?: ReactNode\n iconEnd?: ReactNode\n path?: string\n label: ReactNode\n}\n\nexport default function SideBarItem({ iconStart, iconEnd, path, label }: Props): ReactElement {\n const classes = useStyles()\n const location = useLocation()\n const isSelected = Boolean(path && matchPath(location.pathname, path))\n\n return (\n \n {iconStart}\n \n {iconEnd}\n \n )\n}\n","import { ReactElement, useContext } from 'react'\nimport { useLocation, matchPath } from 'react-router-dom'\nimport { ArrowRight } from 'react-feather'\n\nimport { createStyles, Theme, makeStyles } from '@material-ui/core/styles'\nimport { ListItemText, ListItemIcon, ListItem, Typography } from '@material-ui/core'\nimport { Context } from '../providers/Bee'\nimport StatusIcon from './StatusIcon'\n\nconst useStyles = makeStyles((theme: Theme) =>\n createStyles({\n icon: {\n color: 'inherit',\n },\n iconSmall: {\n height: theme.spacing(2),\n },\n\n root: {\n height: theme.spacing(4),\n paddingLeft: theme.spacing(1),\n paddingRight: theme.spacing(4),\n color: '#f9f9f9',\n borderLeft: '0px solid rgba(0,0,0,0)',\n '&.Mui-selected, &.Mui-selected:hover': {\n borderLeft: `0px solid ${theme.palette.primary.main}`,\n backgroundColor: '#2c2c2c',\n },\n },\n rootError: {\n backgroundColor: 'rgba(255, 58, 82, 0.25)',\n },\n button: {\n '&:hover': {\n backgroundColor: '#2c2c2c',\n color: 'white',\n\n // https://github.com/mui-org/material-ui/issues/22543\n '@media (hover: none)': {\n backgroundColor: '#2c2c2c',\n color: 'white',\n },\n },\n },\n smallerText: {\n fontSize: '0.9rem',\n },\n }),\n)\n\ninterface Props {\n path?: string\n}\n\nexport default function SideBarItem({ path }: Props): ReactElement {\n const { status, isLoading } = useContext(Context)\n const classes = useStyles()\n const location = useLocation()\n const isSelected = Boolean(path && matchPath(location.pathname, path))\n\n return (\n \n \n \n \n {`Node ${status.all ? 'OK' : 'Error'}`}}\n />\n \n {status.all ? null : }\n \n \n )\n}\n","import { Divider, Drawer, Grid, Link as MUILink, List } from '@material-ui/core'\nimport { createStyles, makeStyles, Theme } from '@material-ui/core/styles'\nimport { OpenInNewSharp } from '@material-ui/icons'\nimport type { ReactElement } from 'react'\nimport { Bookmark, BookOpen, DollarSign, FileText, Home, Layers, Send, Settings } from 'react-feather'\nimport { Link } from 'react-router-dom'\nimport Logo from '../assets/logo.svg'\nimport { config } from '../config'\nimport { ROUTES } from '../routes'\nimport SideBarItem from './SideBarItem'\nimport SideBarStatus from './SideBarStatus'\n\nconst navBarItems = [\n {\n label: 'Info',\n path: ROUTES.INFO,\n icon: Home,\n },\n {\n label: 'Upgrade',\n path: ROUTES.UPGRADE,\n icon: Send,\n },\n {\n label: 'Files',\n path: ROUTES.UPLOAD,\n icon: FileText,\n },\n {\n label: 'Feeds',\n path: ROUTES.FEEDS,\n icon: Bookmark,\n },\n {\n label: 'Stamps',\n path: ROUTES.STAMPS,\n icon: Layers,\n },\n {\n label: 'Accounting',\n path: ROUTES.ACCOUNTING,\n icon: DollarSign,\n },\n {\n label: 'Settings',\n path: ROUTES.SETTINGS,\n icon: Settings,\n },\n]\n\nconst drawerWidth = 300\n\nconst useStyles = makeStyles((theme: Theme) =>\n createStyles({\n root: {\n flexWrap: 'nowrap',\n minHeight: '100vh',\n paddingTop: theme.spacing(8),\n paddingBottom: theme.spacing(8),\n },\n drawer: {\n width: drawerWidth,\n flexShrink: 0,\n },\n drawerPaper: {\n width: drawerWidth,\n backgroundColor: '#212121',\n },\n logo: {\n marginLeft: theme.spacing(8),\n marginRight: theme.spacing(8),\n },\n icon: {\n height: theme.spacing(4),\n },\n iconSmall: {\n height: theme.spacing(2),\n },\n divider: {\n backgroundColor: '#2c2c2c',\n marginLeft: theme.spacing(4),\n marginRight: theme.spacing(4),\n },\n link: {\n color: '#9f9f9f',\n textDecoration: 'none',\n '&:hover': {\n textDecoration: 'none',\n\n // https://github.com/mui-org/material-ui/issues/22543\n '@media (hover: none)': {\n textDecoration: 'none',\n },\n },\n },\n }),\n)\n\nexport default function SideBar(): ReactElement {\n const classes = useStyles()\n\n return (\n \n \n \n \n \"swarm\"\n \n \n \n \n {navBarItems.map(p => (\n \n }\n path={p.path}\n label={p.label}\n />\n \n ))}\n \n \n \n \n }\n iconEnd={}\n label={Docs}\n />\n \n \n \n \n \n \n \n \n \n \n )\n}\n","import { useContext, ReactElement } from 'react'\nimport ErrorBoundary from '../components/ErrorBoundary'\nimport AlertVersion from '../components/AlertVersion'\nimport { Container, CircularProgress } from '@material-ui/core'\n\nimport { createStyles, Theme, makeStyles } from '@material-ui/core/styles'\n\nimport SideBar from '../components/SideBar'\n\nimport { Context } from '../providers/Bee'\n\nconst useStyles = makeStyles((theme: Theme) =>\n createStyles({\n content: {\n backgroundColor: theme.palette.background.default,\n minHeight: '100vh',\n },\n }),\n)\n\ninterface Props {\n children?: ReactElement\n}\n\nconst Dashboard = (props: Props): ReactElement => {\n const classes = useStyles()\n\n const { isLoading } = useContext(Context)\n\n return (\n
    \n \n \n \n <>\n \n {isLoading ? (\n
    \n \n
    \n ) : (\n props.children\n )}\n \n
    \n
    \n
    \n )\n}\n\nexport default Dashboard\n","import { createTheme, Theme } from '@material-ui/core/styles'\nimport { orange } from '@material-ui/core/colors'\n\ndeclare module '@material-ui/core/styles/createPalette' {\n interface TypeBackground {\n appBar: string\n }\n}\n\n// Overwriting default components styles\nconst componentsOverrides = (theme: Theme) => ({\n MuiListItem: {\n button: {\n '&:hover': {\n backgroundColor: '#fcf2e8',\n color: theme.palette.primary.main,\n // https://github.com/mui-org/material-ui/issues/22543\n '@media (hover: none)': {\n backgroundColor: '#fcf2e8',\n color: theme.palette.primary.main,\n },\n },\n },\n },\n MuiContainer: {\n root: { padding: theme.spacing(8) },\n maxWidthXs: { padding: theme.spacing(8) },\n maxWidthSm: { padding: theme.spacing(8) },\n maxWidthMd: { padding: theme.spacing(8) },\n maxWidthLg: { padding: theme.spacing(8) },\n maxWidthXl: { padding: theme.spacing(8) },\n },\n MuiButton: {\n startIcon: { marginLeft: theme.spacing(1) },\n endIcon: { marginRight: theme.spacing(1) },\n outlined: {\n border: 'none',\n borderRadius: theme.spacing(10),\n color: theme.palette.primary.main,\n backgroundColor: '#fcf2e8',\n },\n outlinedSizeSmall: {\n padding: theme.spacing(1),\n paddingLeft: theme.spacing(2),\n paddingRight: theme.spacing(2),\n boxShadow: 'none',\n '&:hover': {\n backgroundColor: theme.palette.primary.main,\n color: 'white',\n boxShadow: 'none',\n // https://github.com/mui-org/material-ui/issues/22543\n '@media (hover: none)': {\n backgroundColor: theme.palette.primary.main,\n color: 'white',\n boxShadow: 'none',\n },\n },\n },\n outlinedSizeLarge: {\n padding: theme.spacing(4),\n borderRadius: 0,\n boxShadow: 'none',\n '&:hover': {\n backgroundColor: theme.palette.primary.main,\n color: 'white',\n boxShadow: 'none',\n // https://github.com/mui-org/material-ui/issues/22543\n '@media (hover: none)': {\n backgroundColor: theme.palette.primary.main,\n color: 'white',\n boxShadow: 'none',\n },\n },\n },\n containedSizeLarge: {\n padding: theme.spacing(4),\n borderRadius: 0,\n boxShadow: 'none',\n '&:hover': {\n backgroundColor: theme.palette.primary.main,\n color: 'white',\n boxShadow: 'none',\n // https://github.com/mui-org/material-ui/issues/22543\n '@media (hover: none)': {\n backgroundColor: theme.palette.primary.main,\n color: 'white',\n boxShadow: 'none',\n },\n },\n },\n containedSizeSmall: {\n padding: theme.spacing(1),\n paddingLeft: theme.spacing(2),\n paddingRight: theme.spacing(2),\n borderRadius: 0,\n boxShadow: 'none',\n '&:hover': {\n backgroundColor: theme.palette.primary.main,\n color: 'white',\n boxShadow: 'none',\n // https://github.com/mui-org/material-ui/issues/22543\n '@media (hover: none)': {\n backgroundColor: theme.palette.primary.main,\n color: 'white',\n boxShadow: 'none',\n },\n },\n },\n contained: {\n padding: theme.spacing(2),\n backgroundColor: 'white',\n boxShadow: 'none',\n borderRadius: 0,\n '&:hover': {\n backgroundColor: theme.palette.primary.main,\n color: 'white',\n boxShadow: 'none',\n // https://github.com/mui-org/material-ui/issues/22543\n '@media (hover: none)': {\n backgroundColor: theme.palette.primary.main,\n color: 'white',\n boxShadow: 'none',\n },\n },\n '&:focus': {\n backgroundColor: theme.palette.primary.main,\n color: 'white',\n },\n '&:active': {\n backgroundColor: theme.palette.primary.main,\n color: 'white',\n },\n '&:disabled': {\n backgroundColor: 'white',\n },\n },\n },\n MuiTab: {\n root: {\n backgroundColor: theme.palette.background.paper,\n '&:hover': {\n backgroundColor: '#fcf2e8',\n color: theme.palette.primary.main,\n opacity: 1,\n },\n '&$selected': {\n fontWeight: theme.typography.fontWeightMedium,\n },\n },\n textColorInherit: {\n opacity: 0.5,\n },\n },\n MuiTabs: {\n root: {\n borderBottom: 'none',\n },\n indicator: {\n backgroundColor: 'transparent',\n },\n },\n})\n\nconst propsOverrides = {\n MuiTab: {\n disableRipple: true,\n },\n MuiButtonBase: {\n disableRipple: true,\n },\n}\n\nexport const theme = createTheme({\n palette: {\n type: 'light',\n background: {\n default: '#efefef',\n },\n primary: {\n light: '#fcf2e8',\n main: '#dd7700',\n dark: orange[800],\n },\n secondary: {\n main: '#333333',\n },\n },\n typography: {\n fontFamily: ['Work Sans', 'Montserrat', 'Nunito', 'Roboto', '\"Helvetica Neue\"', 'Arial', 'sans-serif'].join(','),\n h1: {\n fontSize: '1.3rem',\n fontWeight: 500,\n },\n h2: {\n fontSize: '1rem',\n fontWeight: 500,\n },\n h3: {\n fontSize: '0.8rem',\n fontWeight: 500,\n },\n body2: {\n fontFamily: '\"IBM Plex Mono\", monospace',\n fontWeight: 500,\n fontSize: '1rem',\n },\n },\n})\n\ntheme.overrides = componentsOverrides(theme)\ntheme.props = propsOverrides\n","import CssBaseline from '@material-ui/core/CssBaseline'\nimport { ThemeProvider } from '@material-ui/core/styles'\nimport { SnackbarProvider } from 'notistack'\nimport React, { ReactElement } from 'react'\nimport { HashRouter as Router } from 'react-router-dom'\nimport './App.css'\nimport Dashboard from './layout/Dashboard'\nimport { Provider as BeeProvider } from './providers/Bee'\nimport { Provider as FeedsProvider } from './providers/Feeds'\nimport { Provider as FileProvider } from './providers/File'\nimport { Provider as PlatformProvider } from './providers/Platform'\nimport { Provider as SettingsProvider } from './providers/Settings'\nimport { Provider as StampsProvider } from './providers/Stamps'\nimport BaseRouter from './routes'\nimport { theme } from './theme'\n\ninterface Props {\n beeApiUrl?: string\n beeDebugApiUrl?: string\n lockedApiSettings?: boolean\n}\n\nconst App = ({ beeApiUrl, beeDebugApiUrl, lockedApiSettings }: Props): ReactElement => (\n
    \n \n \n \n \n \n \n \n \n \n <>\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n
    \n)\n\nexport default App\n","import { ReportHandler } from 'web-vitals'\n\nconst reportWebVitals = (onPerfEntry?: ReportHandler): void => {\n if (onPerfEntry && onPerfEntry instanceof Function) {\n import('web-vitals').then(({ getCLS, getFID, getFCP, getLCP, getTTFB }) => {\n getCLS(onPerfEntry)\n getFID(onPerfEntry)\n getFCP(onPerfEntry)\n getLCP(onPerfEntry)\n getTTFB(onPerfEntry)\n })\n }\n}\n\nexport default reportWebVitals\n","import React from 'react'\nimport ReactDOM from 'react-dom'\nimport './index.css'\nimport App from './App'\nimport reportWebVitals from './reportWebVitals'\n\nReactDOM.render(\n \n \n ,\n document.getElementById('root'),\n)\n\n// If you want to start measuring performance in your app, pass a function\n// to log results (for example: reportWebVitals(console.log))\n// or send to an analytics endpoint. Learn more: https://bit.ly/CRA-vitals\nreportWebVitals()\n"],"sourceRoot":""} \ No newline at end of file diff --git a/static/dashboard/static/js/main.9569b243.chunk.js b/static/dashboard/static/js/main.9569b243.chunk.js deleted file mode 100644 index 5a312ce..0000000 --- a/static/dashboard/static/js/main.9569b243.chunk.js +++ /dev/null @@ -1,2 +0,0 @@ -(this["webpackJsonp@ethersphere/bee-dashboard"]=this["webpackJsonp@ethersphere/bee-dashboard"]||[]).push([[0],{25:function(e,t,n){"use strict";n.d(t,"f",(function(){return s})),n.d(t,"g",(function(){return l})),n.d(t,"k",(function(){return b})),n.d(t,"h",(function(){return j})),n.d(t,"d",(function(){return h})),n.d(t,"l",(function(){return p})),n.d(t,"e",(function(){return O})),n.d(t,"i",(function(){return f})),n.d(t,"c",(function(){return x})),n.d(t,"b",(function(){return m})),n.d(t,"a",(function(){return g})),n.d(t,"j",(function(){return v}));var a=n(9),r=n.n(a),c=n(19),i=n(38),o=n(31);function s(e){return i.BigNumber.isBigNumber(e)&&e.isInteger()||"bigint"===typeof e}function l(e){if(i.BigNumber.isBigNumber(e))return e;if("string"===typeof e)return new i.BigNumber(e);if("bigint"===typeof e)return new i.BigNumber(e.toString());if("number"===typeof e)return new i.BigNumber(e);throw new TypeError("Not a BigNumber or BigNumber convertible value. Type: ".concat(typeof e," value: ").concat(e))}function u(e){return d.apply(this,arguments)}function d(){return(d=Object(c.a)(r.a.mark((function e(t){return r.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)}function b(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"}))}}function j(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(c.a)(r.a.mark((function a(c,i){var o,s;return r.a.wrap((function(a){for(;;)switch(a.prev=a.next){case 0:o=0;case 1:if(!(o>t/4).toString(16)}))}function O(e){return(e.charAt(0).toUpperCase()+e.slice(1).toLowerCase()).replaceAll("_"," ")}function f(e){var t=e;return t<120?"".concat(e," seconds"):(t/=60)<120?"".concat(Math.round(t)," minutes"):(t/=60)<48?"".concat(Math.round(t)," hours"):(t/=24)<14?"".concat(Math.round(t)," days"):(t/=7)<52?"".concat(Math.round(t)," weeks"):"".concat((t/=52).toFixed(1)," years")}function x(e){return 4096*Math.pow(2,e)}function m(e,t){return 5*e/t}function g(e,t){return new o.a(t*BigInt(Math.pow(2,e)))}function v(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:20,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"[\u2026]";return e.length<=2*t+n.length?e:"".concat(e.slice(0,t)).concat(n).concat(e.slice(-t))}},31:function(e,t,n){"use strict";n.d(t,"a",(function(){return s}));var a=n(113),r=n(170),c=n(38),i=n(25),o=[18,17,16,15,14,13,12,11,10,9,8,7,6,5,4,3,2,1,0],s=function(){function e(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:16;Object(a.a)(this,e),this.amount=void 0,this.decimals=void 0;var r=Object(i.g)(t);if(!Object(i.f)(r)||!o.includes(n))throw new TypeError("Not a valid token values");this.amount=r,this.decimals=n}return Object(r.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 c.BigNumber(this.amount)}},{key:"toDecimal",get:function(){return this.amount.dividedBy(new c.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:"toSignificantDigits",value:function(){for(var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:4,t=this.toDecimal.toFixed(16),n=-1,a=!1,r=0;r1&&void 0!==arguments[1]?arguments[1]:16,a=Object(i.g)(t),r=a.multipliedBy(new c.BigNumber(10).pow(n));return new e(r,n)}}]),e}()},333:function(e){e.exports=JSON.parse('{"a":{"node":">=12.0.0","npm":">=6.0.0","bee":">=0.6.0"}}')},383:function(e,t,n){},388:function(e,t,n){},40:function(e,t,n){"use strict";(function(e){n.d(t,"b",(function(){return l})),n.d(t,"e",(function(){return u})),n.d(t,"d",(function(){return d})),n.d(t,"a",(function(){return b})),n.d(t,"c",(function(){return h})),n.d(t,"f",(function(){return m}));var a=n(9),r=n.n(a),c=n(19),i=n(115),o=n.n(i),s=n(25);function l(){var t=new Uint8Array(32);return crypto.getRandomValues(t),new o.a(e.from(t))}function u(e,t){var n=e.findIndex((function(e){return e.uuid===t.uuid}));-1!==n&&e.splice(n,1),e.unshift(t),localStorage.setItem("feeds",JSON.stringify(e))}function d(e){localStorage.setItem("feeds",JSON.stringify(e))}function b(e,t,n,a){return j.apply(this,arguments)}function j(){return(j=Object(c.a)(r.a.mark((function e(t,n,a,c){var i;return r.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if("V3"!==n||c){e.next=2;break}throw Error("V3 passwords require password");case 2:if("PRIVATE_KEY"!==n){e.next=6;break}e.t0=t.getPrivateKeyString(),e.next=9;break;case 6:return e.next=8,t.toV3String(c);case 8:e.t0=e.sent;case 9:return i=e.t0,e.abrupt("return",{uuid:Object(s.l)(),name:a,type:c?"V3":"PRIVATE_KEY",address:t.getAddressString(),identity:i});case 11:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function h(e,t){return p.apply(this,arguments)}function p(){return(p=Object(c.a)(r.a.mark((function e(t,n){var a,c,i,o;return r.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(64!==n.length){e.next=5;break}return e.next=3,f("PRIVATE_KEY",n);case 3:return a=e.sent,e.abrupt("return",{uuid:Object(s.l)(),name:t,type:"PRIVATE_KEY",identity:n,address:a.getAddressString()});case 5:if(66!==n.length||!n.toLowerCase().startsWith("0x")){e.next=10;break}return e.next=8,f("PRIVATE_KEY",n.slice(2));case 8:return c=e.sent,e.abrupt("return",{uuid:Object(s.l)(),name:t,type:"PRIVATE_KEY",identity:n,address:c.getAddressString()});case 10:return e.prev=10,i=JSON.parse(n),o=i.address,e.abrupt("return",{uuid:Object(s.l)(),name:t,type:"V3",identity:n,address:o});case 15:return e.prev=15,e.t0=e.catch(10),e.abrupt("return",null);case 18:case"end":return e.stop()}}),e,null,[[10,15]])})))).apply(this,arguments)}function O(e,t){return f(e.type,e.identity,t)}function f(e,t,n){return x.apply(this,arguments)}function x(){return(x=Object(c.a)(r.a.mark((function t(n,a,c){return r.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if("PRIVATE_KEY"!==n){t.next=4;break}t.t0=o.a.fromPrivateKey(e.from(v(a),"hex")),t.next=7;break;case 4:return t.next=6,o.a.fromV3(a,c);case 6:t.t0=t.sent;case 7:return t.abrupt("return",t.t0);case 8:case"end":return t.stop()}}),t)})))).apply(this,arguments)}function m(e,t,n,a,r){return g.apply(this,arguments)}function g(){return(g=Object(c.a)(r.a.mark((function e(t,n,a,c,i){var o,s;return r.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,O(n,i);case 2:if(o=e.sent,n.feedHash){e.next=7;break}return e.next=6,t.createFeedManifest(c,"sequence","00".repeat(32),o.getAddressString());case 6:n.feedHash=e.sent;case 7:return s=t.makeFeedWriter("sequence","00".repeat(32),o.getPrivateKeyString()),e.next=10,s.upload(c,a);case 10:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function v(e){return e.toLowerCase().startsWith("0x")?e.slice(2):e}}).call(this,n(17).Buffer)},457:function(e,t){},459:function(e,t){},46:function(e,t,n){"use strict";(function(e){n.d(t,"a",(function(){return c}));var a=n(113);function r(t){return"object"===typeof e&&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"})[t]}var c=new function e(){Object(a.a)(this,e),this.BEE_API_HOST=void 0,this.BEE_DEBUG_API_HOST=void 0,this.BLOCKCHAIN_EXPLORER_URL=void 0,this.BEE_DOCS_HOST=void 0,this.BEE_DISCORD_HOST=void 0,this.GITHUB_REPO_URL=void 0,this.BEE_API_HOST=sessionStorage.getItem("api_host")||r("REACT_APP_BEE_HOST")||"http://localhost:1633",this.BEE_DEBUG_API_HOST=sessionStorage.getItem("debug_api_host")||r("REACT_APP_BEE_DEBUG_HOST")||"http://localhost:1635",this.BLOCKCHAIN_EXPLORER_URL=r("REACT_APP_BLOCKCHAIN_EXPLORER_URL")||"https://blockscout.com/xdai/mainnet",this.BEE_DOCS_HOST=r("REACT_APP_BEE_DOCS_HOST")||"https://docs.ethswarm.org/docs/",this.BEE_DISCORD_HOST=r("REACT_APP_BEE_DISCORD_HOST")||"https://discord.gg/eKr9XPv7",this.GITHUB_REPO_URL=r("REACT_APP_BEE_GITHUB_REPO_URL")||"https://api.github.com/repos/ethersphere/bee"};t.b=c}).call(this,n(21))},471:function(e,t){},473:function(e,t){},499:function(e,t){},500:function(e,t){},505:function(e,t){},507:function(e,t){},514:function(e,t){},532:function(e,t){},548:function(e,t){},553:function(e,t){},561:function(e,t){},563:function(e,t){},802:function(e,t,n){"use strict";n.r(t);var a=n(0),r=n.n(a),c=n(20),i=n.n(c),o=(n(383),n(911)),s=n(910),l=n(22),u=n(35),d=(n(388),n(113)),b=n(170),j=n(354),h=n(353),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),f=n(6),x=n(807),m=n(363),g=n(914),v=n(851),y=n(806),w=n(850),S=n(171),k=n.n(S),C=n(9),E=n.n(C),A=n(19),P=n(37),T=n(132),B=n.n(T),N=n(333),D=n(334),I=n.n(D),_=n(46),L=n(31),U=n(72),R={apiUrl:_.a.BEE_API_HOST,apiDebugUrl:_.a.BEE_DEBUG_API_HOST,beeApi:null,beeDebugApi:null,setApiUrl:function(){},setDebugApiUrl:function(){},lockedApiSettings:!1},F=Object(a.createContext)(R);F.Consumer;function W(e){var t=e.children,n=e.beeApiUrl,r=e.beeDebugApiUrl,c=e.lockedApiSettings,i=Object(a.useState)(R.apiUrl),o=Object(f.a)(i,2),s=o[0],l=o[1],u=Object(a.useState)(R.apiDebugUrl),d=Object(f.a)(u,2),b=d[0],j=d[1],h=Object(a.useState)(null),O=Object(f.a)(h,2),x=O[0],m=O[1],g=Object(a.useState)(null),v=Object(f.a)(g,2),y=v[0],w=v[1],S=Object(a.useState)(Boolean(c)),k=Object(f.a)(S,1)[0],C=n||s,E=r||b;return Object(a.useEffect)((function(){try{m(new U.Bee(C)),sessionStorage.setItem("api_host",C)}catch(e){m(null)}}),[C]),Object(a.useEffect)((function(){try{w(new U.BeeDebug(E)),sessionStorage.setItem("debug_api_host",E)}catch(e){w(null)}}),[E]),Object(p.jsx)(F.Provider,{value:{apiUrl:C,apiDebugUrl:E,beeApi:x,beeDebugApi:y,setApiUrl:l,setDebugApiUrl:j,lockedApiSettings:k},children:t})}var H=window.location.search.includes("devMode=1"),M={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,nodeInfo:null,topology:null,chequebookAddress:null,peers:null,chequebookBalance:null,peerBalances:null,peerCheques:null,settlements:null,chainState:null,latestBeeRelease:null,isLoading:!0,isRefreshing:!1,lastUpdate:null,start:function(){},stop:function(){},refresh:function(){return Promise.reject()}},V=Object(a.createContext)(M);V.Consumer;function z(e,t,n,a,r,c,i,o){var s=H||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)||"dev"===(null===n||void 0===n?void 0:n.beeMode),l={version:Boolean(e&&B.a.satisfies(e.version,N.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:a,topology:Boolean((null===r||void 0===r?void 0:r.connected)&&(null===r||void 0===r?void 0:r.connected)>0)||s,chequebook:Boolean(null===c||void 0===c?void 0:c.chequebookAddress)&&null!==i&&(null===i||void 0===i?void 0:i.totalBalance.toBigNumber.isGreaterThan(0))||s};return Object(P.a)(Object(P.a)({},l),{},{all:!o&&Object.values(l).every((function(e){return e}))})}function q(e){var t,n,r=e.children,c=Object(a.useContext)(F),i=c.beeApi,o=c.beeDebugApi,s=Object(a.useState)(!1),l=Object(f.a)(s,2),u=l[0],d=l[1],b=Object(a.useState)(null),j=Object(f.a)(b,2),h=j[0],O=j[1],x=Object(a.useState)(null),m=Object(f.a)(x,2),g=m[0],v=m[1],y=Object(a.useState)(null),w=Object(f.a)(y,2),S=w[0],k=w[1],C=Object(a.useState)(null),P=Object(f.a)(C,2),T=P[0],N=P[1],D=Object(a.useState)(null),U=Object(f.a)(D,2),R=U[0],W=U[1],H=Object(a.useState)(null),q=Object(f.a)(H,2),Y=q[0],G=q[1],Z=Object(a.useState)(null),K=Object(f.a)(Z,2),J=K[0],X=K[1],$=Object(a.useState)(null),Q=Object(f.a)($,2),ee=Q[0],te=Q[1],ne=Object(a.useState)(null),ae=Object(f.a)(ne,2),re=ae[0],ce=ae[1],ie=Object(a.useState)(null),oe=Object(f.a)(ie,2),se=oe[0],le=oe[1],ue=Object(a.useState)(null),de=Object(f.a)(ue,2),be=de[0],je=de[1],he=function(){var e=Object(a.useState)(null),t=Object(f.a)(e,2),n=t[0],r=t[1],c=Object(a.useState)(!1),i=Object(f.a)(c,2),o=i[0],s=i[1],l=Object(a.useState)(null),u=Object(f.a)(l,2),d=u[0],b=u[1];return Object(a.useEffect)((function(){I.a.get("".concat(_.a.GITHUB_REPO_URL,"/releases/latest")).then((function(e){r(e.data)})).catch((function(e){b(e)})).finally((function(){s(!1)}))}),[]),{latestBeeRelease:n,isLoadingLatestBeeRelease:o,error:d}}(),pe=he.latestBeeRelease,Oe=Object(a.useState)(M.error),fe=Object(f.a)(Oe,2),xe=fe[0],me=fe[1],ge=Object(a.useState)(M.isLoading),ve=Object(f.a)(ge,2),ye=ve[0],we=ve[1],Se=Object(a.useState)(M.isRefreshing),ke=Object(f.a)(Se,2),Ce=ke[0],Ee=ke[1],Ae=Object(a.useState)(M.lastUpdate),Pe=Object(f.a)(Ae,2),Te=Pe[0],Be=Pe[1],Ne=Object(a.useState)(3e4),De=Object(f.a)(Ne,2),Ie=De[0],_e=De[1],Le=null===(t=B.a.coerce(null===pe||void 0===pe?void 0:pe.name))||void 0===t?void 0:t.version,Ue=null===(n=B.a.coerce(null===h||void 0===h?void 0:h.version))||void 0===n?void 0:n.version,Re=null===h||void 0===h?void 0:h.version;Object(a.useEffect)((function(){we(!0),d(!1),Fe()}),[i]),Object(a.useEffect)((function(){we(!0),O(null),v(null),N(null),k(null),G(null),W(null),X(null),te(null),ce(null),le(null),je(null),Fe()}),[o]);var Fe=function(){var e=Object(A.a)(E.a.mark((function e(){var t,n,a,r;return E.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!Ce){e.next=2;break}return e.abrupt("return");case 2:if(i&&o){e.next=5;break}return we(!1),e.abrupt("return");case 5:return e.prev=5,Ee(!0),me(null),t=function(){var e=Object(A.a)(E.a.mark((function e(){var t,n,a;return E.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,o.getChequebookBalance();case 2:return t=e.sent,n=t.totalBalance,a=t.availableBalance,e.abrupt("return",{totalBalance:new L.a(n),availableBalance:new L.a(a)});case 6:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),n=function(){var e=Object(A.a)(E.a.mark((function e(){var t,n;return E.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,o.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 L.a(n)}})));case 5:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),a=function(){var e=Object(A.a)(E.a.mark((function e(){var t,n,a,r;return E.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,o.getAllSettlements();case 2:return t=e.sent,n=t.totalReceived,a=t.settlements,r=t.totalSent,e.abrupt("return",{totalReceived:new L.a(n),totalSent:new L.a(r),settlements:a.map((function(e){var t=e.peer,n=e.received,a=e.sent;return{peer:t,received:new L.a(n),sent:new L.a(a)}}))});case 7:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),r=[i.isConnected().then(d).catch((function(){return d(!1)})),o.getHealth().then(O).catch((function(){return O(null)})),o.getNodeAddresses().then(v).catch((function(){return v(null)})),o.getNodeInfo().then(k).catch((function(){return k(null)})),o.getTopology().then(N).catch((function(){return N(null)})),o.getPeers().then(G).catch((function(){return G(null)})),o.getChequebookAddress().then(W).catch((function(){return W(null)})),o.getLastCheques().then(ce).catch((function(){return ce(null)})),o.getChainState().then(je).catch((function(){return je(null)})),t().then(X).catch((function(){return X(null)})),n().then(te).catch((function(){return te(null)})),a().then(le).catch((function(){return le(null)}))],e.next=14,Promise.allSettled(r);case 14:e.next=19;break;case 16:e.prev=16,e.t0=e.catch(5),me(e.t0);case 19:return e.prev=19,we(!1),Ee(!1),Be(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(Fe(),Ie){var e=setInterval(Fe,Ie);return function(){return clearInterval(e)}}}),[Ie,o,i]),Object(p.jsx)(V.Provider,{value:{status:z(h,g,S,u,T,R,J,xe),latestUserVersion:Ue,latestUserVersionExact:Re,latestPublishedVersion:Le,isLatestBeeVersion:Boolean(Le&&Ue&&B.a.satisfies(Le,Ue,{includePrerelease:!0})),latestBeeVersionUrl:(null===pe||void 0===pe?void 0:pe.html_url)||"https://github.com/ethersphere/bee/releases/latest",error:xe,apiHealth:u,debugApiHealth:h,nodeAddresses:g,nodeInfo:S,topology:T,chequebookAddress:R,peers:Y,chequebookBalance:J,peerBalances:ee,peerCheques:re,settlements:se,chainState:be,latestBeeRelease:pe,isLoading:ye,isRefreshing:Ce,lastUpdate:Te,start:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:3e4;return _e(e)},stop:function(){return _e(null)},refresh:Fe},children:r})}var Y=Object(x.a)((function(e){return Object(m.a)({root:{width:"100%",marginBottom:e.spacing(2)}})}));function G(){var e=Y(),t=Object(a.useContext)(V),n=t.isLoading,r=t.latestUserVersionExact,c=Object(a.useState)(!0),i=Object(f.a)(c,2),o=i[0],s=i[1],l=U.SUPPORTED_BEE_VERSION_EXACT===r;return n||!r?null:Object(p.jsx)(y.a,{in:!l&&o,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)(k.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:U.SUPPORTED_BEE_VERSION_EXACT}),"). Please note that some functionality may not work properly."]})})})}var Z=n(869),K=n(870),J=n(907),X=n(855),$=n(880),Q=n(908),ee=n(872),te=n(885),ne=n(903),ae=n(900),re=n(904),ce=n(890),ie=n(898),oe=n(905),se=n(906),le=n(909),ue=n.p+"static/media/logo.3d1155fe.svg",de=n(12),be=n(808),je=n(852),he=n(85),pe=n(853),Oe=n(854),fe=Object(x.a)((function(e){return Object(m.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 xe(e){var t=e.children,n=e.label,r=e.level,c=e.defaultOpen,i=e.info,o=fe(),s=Object(a.useState)(Boolean(c)),l=Object(f.a)(s,2),u=l[0],d=l[1],b="",j="h1",h=o.contentLevel0;return 1===r?(b=o.rootLevel1,j="h2",h=o.contentLevel12):2===r&&(b=o.rootLevel2,j="h3",h=o.contentLevel12),Object(p.jsxs)("div",{className:"".concat(o.root," ").concat(b),children:[Object(p.jsxs)(be.a,{button:!0,onClick:function(){d(!u)},className:o.header,children:[Object(p.jsx)(je.a,{primary:Object(p.jsx)(he.a,{variant:j,children:n})}),Object(p.jsxs)("div",{style:{display:"flex"},children:[!u&&Object(p.jsx)(he.a,{variant:"body2",className:o.infoText,children:i}),u?Object(p.jsx)(pe.a,{}):Object(p.jsx)(Oe.a,{})]})]}),Object(p.jsx)(y.a,{in:u,timeout:"auto",unmountOnExit:!0,children:Object(p.jsx)("div",{className:h,children:t})})]})}var me=n(916),ge=n(858),ve=Object(x.a)((function(e){return Object(m.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 ye(e){var t=e.label,n=e.value,a=e.tooltip,r=ve();return Object(p.jsx)(be.a,{className:r.header,children:Object(p.jsxs)(X.a,{container:!0,direction:"row",justifyContent:"space-between",alignItems:"center",children:[t&&Object(p.jsx)(he.a,{variant:"body1",children:t}),n&&Object(p.jsxs)(he.a,{variant:"body2",children:[n,a&&Object(p.jsx)(me.a,{title:a,placement:"top",arrow:!0,children:Object(p.jsx)(w.a,{size:"small",className:r.copyValue,children:Object(p.jsx)(ge.a,{strokeWidth:1})})})]})]})})}var we=Object(x.a)((function(e){return Object(m.a)({wrapper:{display:"flex",flexDirection:"row",flexWrap:"wrap"},action:{marginBottom:e.spacing(1),marginRight:e.spacing(1)}})}));function Se(e){var t=e.children,n=we();return Array.isArray(t)?Object(p.jsx)("div",{className:n.wrapper,children:t.filter((function(e){return e})).map((function(e,t){return Object(p.jsx)("div",{className:n.action,children:e},t)}))}):Object(p.jsx)(X.a,{container:!0,direction:"row",children:Object(p.jsx)(X.a,{className:n.action,children:t})})}var ke=n(97),Ce=n.n(ke),Ee=n(859),Ae=n(860),Pe=Object(x.a)((function(e){return Object(m.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 Te(e){var t,n=e.label,r=e.value,c=Pe(),i=Object(a.useState)(!1),o=Object(f.a)(i,2),s=o[0],l=o[1],u=Object(a.useState)(!1),d=Object(f.a)(u,2),b=d[0],j=d[1],h=function(){return l(!s)},O=function(){return j(!0)},x=function(){return j(!1)},m=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(m[0]," ").concat(m[1]):m[0],"[\u2026]").concat(m[m.length-1]);return Object(p.jsx)(be.a,{className:"".concat(c.header," ").concat(s?c.headerOpen:""),children:Object(p.jsxs)(X.a,{container:!0,direction:"column",justifyContent:"space-between",alignItems:"stretch",children:[Object(p.jsxs)(X.a,{container:!0,direction:"row",justifyContent:"space-between",alignItems:"center",children:[n&&Object(p.jsx)(he.a,{variant:"body1",children:n}),Object(p.jsx)(he.a,{variant:"body2",children:Object(p.jsxs)("div",{children:[!s&&Object(p.jsx)("span",{className:c.copyValue,children:Object(p.jsx)(me.a,{title:b?"Copied":"Copy",placement:"top",arrow:!0,onClose:x,children:Object(p.jsx)(ke.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)(Ee.a,{onClick:h,strokeWidth:1}):Object(p.jsx)(Ae.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)(me.a,{title:b?"Copied":"Copy",placement:"top",arrow:!0,onClose:x,children:Object(p.jsx)(ke.CopyToClipboard,{text:r,children:Object(p.jsx)("span",{onClick:O,children:Object(p.jsx)("span",{className:c.copyValue,children:m.map((function(e,t){return Object(p.jsx)(he.a,{variant:"body2",className:c.keyMargin,component:"span",children:e},t)}))})})})})})})]})})}var Be=n(865),Ne=n(863),De=n(871),Ie=n(867),_e=n(868),Le=n(864),Ue=n(866),Re=n(336),Fe=n.n(Re),We=n(861);function He(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)(ke.CopyToClipboard,{text:t,children:Object(p.jsx)(We.a,{style:{height:"20px"}})})})})}var Me=n(337),Ve=n.n(Me),ze=n(862);function qe(e){var t=Object(a.useState)(!1),n=Object(f.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)(ze.a,{})}),Object(p.jsx)(Ne.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)(Le.a,{id:"simple-dialog-title",children:e.label}),Object(p.jsx)(Ve.a,{value:e.value,size:150,bgColor:"#ffffff",fgColor:"#000000",level:"L",includeMargin:!1,renderAs:"svg"})]})})]})}function Ye(e){return Object(p.jsx)(he.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)(Fe.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(_.a.BLOCKCHAIN_EXPLORER_URL,"/").concat(e.transaction?"tx":"address","/").concat(e.address),target:"_blank",rel:"noreferrer",children:e.address})}),Object(p.jsx)(qe,{value:e.address,label:"Ethereum Address"}),Object(p.jsx)(He,{value:e.address})]}):"-"})}function Ge(e){var t=e.peerId,n=e.uncashedAmount,r=Object(a.useState)(!1),c=Object(f.a)(r,2),i=c[0],o=c[1],s=Object(a.useState)(!1),u=Object(f.a)(s,2),d=u[0],b=u[1],j=Object(l.b)().enqueueSnackbar,h=Object(a.useContext)(F).beeDebugApi,O=function(){o(!1)};return Object(p.jsxs)("div",{children:[Object(p.jsxs)(Be.a,{variant:"contained",onClick:function(){o(!0)},startIcon:Object(p.jsx)(Ue.a,{size:"1rem"}),children:["Cash out peer ",t.substr(0,8),"[\u2026]"]}),Object(p.jsxs)(Ne.a,{open:i,onClose:O,"aria-labelledby":"form-dialog-title",children:[Object(p.jsx)(Le.a,{id:"form-dialog-title",children:"Cashout Cheque"}),Object(p.jsx)(Ie.a,{children:Object(p.jsxs)(_e.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)(Z.a,{style:{textAlign:"center",padding:"50px"},children:Object(p.jsx)(K.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)(De.a,{children:[Object(p.jsx)(Be.a,{onClick:O,color:"primary",children:"Cancel"}),Object(p.jsx)(Be.a,{onClick:function(){h&&(t?(b(!0),h.cashoutLastCheque(t).then((function(e){o(!1),j(Object(p.jsxs)("span",{children:["Successfully cashed out cheque. Transaction",Object(p.jsx)(Ye,{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 Ze(e){var t=e.accounting,n=e.isLoadingUncashed,a=e.totalUncashed;return Object(p.jsxs)(xe,{label:"Peers (".concat((null===t||void 0===t?void 0:t.length)||0,")"),info:"".concat(a.toFixedDecimal()," BZZ (uncashed)"),children:[Object(p.jsx)(ye,{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,i=e.uncashedAmount,o=e.total;return Object(p.jsxs)(xe,{label:"Peer ".concat(t.substr(0,8),"[\u2026]"),level:1,info:"".concat(i.toFixedDecimal()," BZZ (uncashed)"),children:[Object(p.jsx)(Te,{label:"Peer ID",value:t}),Object(p.jsx)(ye,{label:"Outstanding Balance",value:"".concat(a.toFixedDecimal()," BZZ")}),Object(p.jsx)(ye,{label:"Settlements Sent / Received",value:"-".concat(c.toFixedDecimal()," / ").concat(r.toFixedDecimal()," BZZ")}),Object(p.jsx)(ye,{label:"Total",value:"".concat(o.toFixedDecimal()," BZZ")}),Object(p.jsx)(ye,{label:"Uncashed Amount",value:n?"loading\u2026":"".concat(i.toFixedDecimal()," BZZ")}),i.toBigNumber.isGreaterThan("0")&&Object(p.jsx)(Se,{children:Object(p.jsx)(Ge,{uncashedAmount:i.toFixedDecimal(),peerId:t})})]},t)}))]})}var Ke=n(873),Je=Object(x.a)((function(e){return Object(m.a)({root:{height:"100%"},content:{maxWidth:500,marginBottom:e.spacing(4),"&:last-child":{marginBottom:0}},icon:{height:"1rem"}})}));function Xe(){var e=Je();return Object(p.jsxs)(X.a,{container:!0,direction:"column",justifyContent:"center",alignItems:"center",className:e.root,children:[Object(p.jsx)(X.a,{item:!0,className:e.content,children:Object(p.jsx)(he.a,{variant:"h1",align:"center",children:"Uh oh, it looks like your node is not connected."})}),Object(p.jsx)(X.a,{item:!0,className:e.content,children:Object(p.jsxs)(he.a,{align:"center",children:["Please check your node status to fix the problem. You can also check out the"," ",Object(p.jsx)(ee.a,{href:_.a.BEE_DOCS_HOST,target:"_blank",rel:"noreferrer",children:"Swarm Bee Docs"})," ","or ask for support on the"," ",Object(p.jsx)(ee.a,{href:_.a.BEE_DISCORD_HOST,target:"_blank",rel:"noreferrer",children:"Ethereum Swarm Discord"}),"."]})}),Object(p.jsx)(X.a,{item:!0,className:e.content,children:Object(p.jsx)(he.a,{align:"center",children:Object(p.jsx)(Be.a,{component:u.b,variant:"contained",startIcon:Object(p.jsx)(Ke.a,{className:e.icon}),to:ir.STATUS,children:"Check node status"})})})]})}var $e=n(25);var Qe=function(e,t,n){var r=Object(a.useState)(!1),c=Object(f.a)(r,2),i=c[0],o=c[1],s=Object(a.useState)(void 0),l=Object(f.a)(s,2),u=l[0],d=l[1];Object(a.useEffect)((function(){if(!i&&e&&t&&!u){o(!0);var n=t.settlements.filter((function(e){return e.received.toBigNumber.gt("0")})).map((function(t){var n=t.peer;return Object($e.h)((function(){return e.getLastCashoutAction(n)}))}));Promise.allSettled(n).then((function(e){var t=Object($e.k)(e);d(t.fulfilled),o(!1)}))}}),[t,i,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 L.a("0"),received:new L.a("0"),uncashedAmount:new L.a("0"),total:n}})),t.forEach((function(e){var t=e.peer,n=e.sent,r=e.received;return a[t]=Object(P.a)(Object(P.a)({},a[t]),{},{sent:n,received:r,total:new L.a(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 L.a(n)})),Object.values(a).sort((function(e,t){var n=t.uncashedAmount.toBigNumber.minus(e.uncashedAmount.toBigNumber).toNumber();return 0!==n?n:e.peer22?n.slice(0,19)+"...":n;function x(){"NEW_WINDOW"===i?window.open(r||n):h(r||n)}return Object(p.jsx)(be.a,{className:l.header,children:Object(p.jsx)(X.a,{container:!0,direction:"column",justifyContent:"space-between",alignItems:"stretch",children:Object(p.jsxs)(X.a,{container:!0,direction:"row",justifyContent:"space-between",alignItems:"center",children:[t&&Object(p.jsx)(he.a,{variant:"body1",children:t}),Object(p.jsx)(he.a,{variant:"body2",children:Object(p.jsxs)("div",{children:[s&&Object(p.jsx)("span",{className:l.copyValue,children:Object(p.jsx)(me.a,{title:b?"Copied":"Copy",placement:"top",arrow:!0,onClose:function(){return j(!1)},children:Object(p.jsx)(Ce.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"===i&&Object(p.jsx)(te.a,{onClick:x,strokeWidth:1}),"HISTORY_PUSH"===i&&Object(p.jsx)(tn.a,{onClick:x,strokeWidth:1})]})]})})]})})})}var rn=n(352),cn=n(887),on=n(888),sn=n(889),ln=["index.html","index.htm"];function un(e){var t=e.map(jn);if(!t.length)return!1;var n=t.find((function(e){return ln.includes(e)}));if(n)return{indexPath:n};var a=t[0].split("/")[0]+"/";if(t.every((function(e){return e.startsWith(a)}))){var r=t.find((function(e){return ln.map((function(e){return a+e})).includes(e)}));if(r)return{indexPath:r,commonPrefix:a}}return!1}function dn(e){return e>=1e15?(e/1e15).toFixed(2)+" PB":e>=1e12?(e/1e12).toFixed(2)+" TB":e>=1e9?(e/1e9).toFixed(2)+" GB":e>=1e6?(e/1e6).toFixed(2)+" MB":e>=1e3?(e/1e3).toFixed(2)+" kB":e+" bytes"}function bn(e){if(1===e.length)return e[0].name;if(e.length>0){var t=jn(e[0]).split("/")[0];if(e.every((function(e){return jn(e).split("/")[0]===t})))return t}return"unknown"}function jn(e){return(e.path||e.webkitRelativePath||e.name).replace(/^\//g,"")}function hn(e){var t=jn(e);return{path:t,fullPath:t,webkitRelativePath:t,lastModified:e.lastModified,name:e.name,size:e.size,type:e.type,stream:e.stream,slice:e.slice,text:e.text,arrayBuffer:function(){var t=Object(A.a)(E.a.mark((function t(){return E.a.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,e.arrayBuffer();case 2:return t.abrupt("return",t.sent);case 3:case"end":return t.stop()}}),t)})));return function(){return t.apply(this,arguments)}}()}}function pn(e,t,n){return new Promise((function(a,r){if(!e.size||!e.type||!["image/bmp","image/gif","image/vnd.microsoft.icon","image/jpeg","image/png","image/svg+xml","image/tiff","image/webp"].includes(e.type))return r("File not supported!");try{var c=new FileReader;c.readAsDataURL(e),c.onload=function(e){var r,c=null===e||void 0===e||null===(r=e.target)||void 0===r?void 0:r.result;if(!c||"string"!==typeof c)throw new Error("Failed to load the image source");var i=new Image;i.src=c,i.onload=function(){var e=function(e,t,n,a){var r=n?e/n:1,c=a?t/a:1,i=Math.max(r,c);return i<=1?{width:e,height:t}:{width:e/i,height:t/i}}(i.width,i.height,t,n),r=document.createElement("canvas");r.width=e.width,r.height=e.height;var c=r.getContext("2d");if(!c)throw new Error("Failed to create canvas context");c.drawImage(i,0,0,r.width,r.height),c.canvas.toBlob((function(e){if(!e)throw new Error("Failed to extract the blob from canvas");a(e)}),"image/jpeg",1)}},c.onerror=function(e){return r(e)}}catch(i){r(i)}}))}var On=".swarmgatewaymeta.json",fn=".swarmgatewaypreview.jpeg",xn=250,mn=175,gn={origin:"UPLOAD"},vn={files:[],setFiles:function(){},uploadOrigin:gn,setUploadOrigin:function(){}},yn=Object(a.createContext)(vn);yn.Consumer;function wn(e){var t=e.children,n=Object(a.useState)(vn.files),r=Object(f.a)(n,2),c=r[0],i=r[1],o=Object(a.useState)(vn.uploadOrigin),s=Object(f.a)(o,2),l=s[0],u=s[1],d=Object(a.useState)(void 0),b=Object(f.a)(d,2),j=b[0],h=b[1],O=Object(a.useState)(void 0),x=Object(f.a)(O,2),m=x[0],g=x[1],v=Object(a.useState)(void 0),y=Object(f.a)(v,2),w=y[0],S=y[1];return Object(a.useEffect)((function(){if(h(function(e){var t=e.reduce((function(e,t){return e+t.size}),0),n=Boolean(un(e));return{size:t,name:bn(e),type:1===e.length?e[0].type:"folder",isWebsite:n,count:e.length}}(c)),m&&(URL.revokeObjectURL(m),g(void 0),S(void 0)),1===c.length&&c[0].type.startsWith("image"))return pn(c[0],xn,mn).then((function(e){g(URL.createObjectURL(e)),S(e)})),function(){m&&URL.revokeObjectURL(m)}}),[c]),Object(p.jsx)(yn.Provider,{value:{files:c,setFiles:i,uploadOrigin:l,setUploadOrigin:u,metadata:j,previewUri:m,previewBlob:w},children:t})}var Sn=Object(x.a)((function(e){return Object(m.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 kn(e){var t=e.uploadOrigin,n=e.showHelp,r=Object(a.useContext)(yn),c=r.setFiles,i=r.setUploadOrigin,o=Sn(),s=Object(de.g)(),u=Object(l.b)().enqueueSnackbar,d=Object(a.useState)(!1),b=Object(f.a)(d,2),j=b[0],h=b[1],O=Object(a.useState)(0),x=Object(f.a)(O,2),m=x[0],g=x[1],v=function(){return document.querySelector(".MuiDropzoneArea-root input")},y=function(){var e=v();e&&(e.setAttribute("directory",""),e.setAttribute("webkitdirectory",""),e.setAttribute("mozdirectory",""),e.click())};return Object(p.jsxs)(p.Fragment,{children:[Object(p.jsxs)("div",{className:o.areaWrapper,children:[Object(p.jsx)(rn.a,{dropzoneClass:o.dropzone,onChange:function(e){if(e){var n=e,a=1===e.length?e[0].name:un(n)||void 0;if(e.length&&j&&!a)return u("To upload a website, there must be an index.html or index.htm in the root of the folder.",{variant:"error"}),void setTimeout((function(){g((function(e){return e+1})),c([])}),0);c(n),e.length&&(i(t),s(ir.UPLOAD_IN_PROGRESS))}},filesLimit:1e9,maxFileSize:1e9,showPreviews:!1},m),Object(p.jsxs)("div",{className:o.buttonWrapper,children:[Object(p.jsx)(ht,{className:o.button,onClick:function(){var e=v();e&&(e.removeAttribute("directory"),e.removeAttribute("webkitdirectory"),e.removeAttribute("mozdirectory"),e.click())},iconType:cn.a,children:"Add File"}),Object(p.jsx)(ht,{className:o.button,onClick:function(){y(),h(!1)},iconType:on.a,children:"Add Folder"}),Object(p.jsx)(ht,{className:o.button,onClick:function(){y(),h(!0)},iconType:sn.a,children:"Add Website"})]})]}),n&&Object(p.jsx)(zt,{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 Cn(){var e=Object(a.useContext)(Ot).identities,t=Object(de.h)().uuid,n=Object(a.useContext)(F).beeApi,r=Object(a.useContext)(V).status,c=Object(de.g)(),i=Object(a.useState)(!1),o=Object(f.a)(i,2),s=o[0],l=o[1],u=e.find((function(e){return e.uuid===t}));if(Object(a.useEffect)((function(){if(u&&u.feedHash)try{null===n||void 0===n||n.downloadData(u.feedHash).then((function(){return l(!0)}))}catch(e){l(!1)}}),[n,t,u]),!u||!r.all)return c(ir.FEEDS,{replace:!0}),Object(p.jsx)(p.Fragment,{});return Object(p.jsxs)("div",{children:[Object(p.jsx)(Gt,{children:"".concat(u.name," Website")}),Object(p.jsx)(kn,{showHelp:!1,uploadOrigin:{origin:"FEED",uuid:t}}),s&&u.feedHash?Object(p.jsxs)(p.Fragment,{children:[Object(p.jsx)(ut.a,{mb:.25,children:Object(p.jsx)(Te,{label:"Feed hash",value:u.feedHash})}),Object(p.jsx)(ut.a,{mb:4,children:Object(p.jsx)(an,{label:"BZZ Link",value:"https://".concat(en.encodeFeedReference(u.feedHash),".bzz.link")})})]}):Object(p.jsx)(ut.a,{mb:4,children:Object(p.jsxs)(zt,{children:["This feed is curently not pointing anywhere, you can update the feed to fix this. Please refer to the"," ",Object(p.jsx)("a",{href:"https://docs.ethswarm.org/api/#tag/Feed/paths/~1feeds~1{owner}~1{topic}/post",target:"_blank",rel:"noreferrer",children:"official Bee documentation"}),"."]})}),Object(p.jsx)(Se,{children:Object(p.jsx)(ht,{iconType:mt.a,onClick:function(){c(ir.FEEDS)},cancel:!0,children:"Close"})})]})}var En=n(180),An={stamps:null,error:null,isLoading:!1,lastUpdate:null,start:function(){},stop:function(){},refresh:function(){return Promise.reject()}},Pn=Object(a.createContext)(An);Pn.Consumer;function Tn(e){var t=e.depth,n=e.bucketDepth,a=e.utilization/Math.pow(2,t-n),r="".concat(Math.ceil(100*a),"%");return Object(P.a)(Object(P.a)({},e),{},{usage:a,usageText:r})}function Bn(e){var t=e.children,n=Object(a.useContext)(F).beeDebugApi,r=Object(a.useState)(An.stamps),c=Object(f.a)(r,2),i=c[0],o=c[1],s=Object(a.useState)(An.error),l=Object(f.a)(s,2),u=l[0],d=l[1],b=Object(a.useState)(An.isLoading),j=Object(f.a)(b,2),h=j[0],O=j[1],x=Object(a.useState)(An.lastUpdate),m=Object(f.a)(x,2),g=m[0],v=m[1],y=Object(a.useState)(null),w=Object(f.a)(y,2),S=w[0],k=w[1],C=function(){var e=Object(A.a)(E.a.mark((function e(){var t;return E.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,o(t.map(Tn)),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(),S){var e=setInterval(C,S);return function(){return clearInterval(e)}}}),[S]),Object(p.jsx)(Pn.Provider,{value:{stamps:i,error:u,isLoading:h,lastUpdate:g,start:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:3e4;return k(e)},stop:function(){return k(null)},refresh:C},children:t})}function Nn(e){var t=e.feedName,n=e.onProceed,r=e.onCancel,c=e.loading,i=Object(a.useState)(""),o=Object(f.a)(i,2),s=o[0],l=o[1];return Object(p.jsxs)(gt,{children:[Object(p.jsx)(ut.a,{mb:4,children:Object(p.jsx)(kt,{onClose:r,children:"Update Feed"})}),Object(p.jsx)(ut.a,{mb:2,children:Object(p.jsxs)(he.a,{children:["Please enter the password for \u201c",t,"\u201d:"]})}),Object(p.jsx)(ut.a,{mb:4,children:Object(p.jsx)(Ft,{label:"Password",name:"password",onChange:function(e){l(e.target.value)},password:!0})}),Object(p.jsxs)(Se,{children:[Object(p.jsx)(ht,{iconType:It.a,onClick:function(){return n(s)},disabled:c,loading:c,children:"Proceed"}),Object(p.jsx)(ht,{iconType:mt.a,onClick:r,cancel:!0,disabled:c,children:"Cancel"})]})]})}function Dn(){var e=Object(a.useContext)(Ot),t=e.identities,n=e.setIdentities,r=Object(a.useContext)(F),c=r.beeApi,i=r.beeDebugApi,o=Object(a.useContext)(Pn),s=o.stamps,u=o.refresh,d=Object(a.useContext)(V).status,b=Object(de.h)().hash,j=Object(a.useState)(null),h=Object(f.a)(j,2),O=h[0],x=h[1],m=Object(a.useState)(null),g=Object(f.a)(m,2),v=g[0],y=g[1],w=Object(a.useState)(!1),S=Object(f.a)(w,2),k=S[0],C=S[1],P=Object(l.b)().enqueueSnackbar,T=Object(a.useState)(!1),B=Object(f.a)(T,2),N=B[0],D=B[1],I=Object(de.g)();function _(e,t){return L.apply(this,arguments)}function L(){return(L=Object(A.a)(E.a.mark((function e(a,r){return E.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(C(!0),c&&i&&O){e.next=5;break}return P(Object(p.jsx)("span",{children:"Bee API unavailabe"}),{variant:"error"}),C(!1),e.abrupt("return");case 5:return e.prev=5,e.next=8,Object(xt.f)(c,a,b,O,r);case 8:Object(xt.e)(t,a),n(Object(En.a)(t)),I(ir.FEEDS_PAGE.replace(":uuid",a.uuid)),e.next=18;break;case 13:e.prev=13,e.t0=e.catch(5),C(!1),("object"===typeof e.t0&&null!==e.t0&&Reflect.get(e.t0,"message")||"").includes("possibly wrong passphrase")?P("Wrong password, please try again",{variant:"error"}):P("Could not update feed at this time, please try again later",{variant:"error"});case 18:case"end":return e.stop()}}),e,null,[[5,13]])})))).apply(this,arguments)}return Object(a.useEffect)((function(){u()}),[]),d.all?Object(p.jsxs)("div",{children:[N&&v&&Object(p.jsx)(Nn,{feedName:v.name+" Website",onCancel:function(){D(!1)},onProceed:function(e){_(v,e)},loading:k}),Object(p.jsx)(Gt,{children:"Update feed"}),Object(p.jsx)(ut.a,{mb:2,children:Object(p.jsx)(X.a,{container:!0,children:Object(p.jsx)(Xt,{options:t.map((function(e){return{value:e.uuid,label:"".concat(e.name," Website")}})),onChange:function(e){var n=e.target.value;y(t.find((function(e){return e.uuid===n}))||null)},label:"Feed"})})}),Object(p.jsx)(ut.a,{mb:4,children:Object(p.jsx)(X.a,{container:!0,children:s?Object(p.jsx)(Xt,{options:s.map((function(e){return{value:e.batchID,label:e.batchID.slice(0,8)}})),onChange:function(e){var t=e.target.value;x(t)},label:"Stamp"}):Object(p.jsx)(he.a,{children:"You need to buy a stamp first to be able to update a feed."})})}),Object(p.jsxs)(Se,{children:[Object(p.jsx)(ht,{onClick:function(){v&&("V3"===v.type?D(!0):_(v))},iconType:ce.a,loading:!N&&k,disabled:k||!O||!v,children:"Update Selected Feed"}),Object(p.jsx)(ht,{onClick:function(){I(-1)},iconType:mt.a,disabled:k,cancel:!0,children:"Close"})]})]}):Object(p.jsx)(Xe,{})}var In=n(178),_n=n(361),Ln=n(891),Un=n(892),Rn=Object(x.a)((function(e){return Object(m.a)({header:{backgroundColor:"#F7F7F7",marginBottom:e.spacing(.25)},typography:{color:"#242424"}})}));function Fn(e){var t=e.children,n=Rn();return Object(p.jsx)(be.a,{className:n.header,children:Object(p.jsx)(he.a,{variant:"body1",className:n.typography,children:t})})}var Wn,Hn=Object(x.a)((function(e){return Object(m.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 Mn(e){var t=e.label,n=e.value,r=e.onConfirm,c=e.onChange,i=e.confirmLabel,o=e.confirmLabelDisabled,s=e.expandedOnly,l=e.helperText,u=e.placeholder,d=e.loading,b=e.mapperFn,j=e.locked,h=Hn(),O=Object(a.useState)(Boolean(s)),x=Object(f.a)(O,2),m=x[0],g=x[1],v=Object(a.useState)(n||""),S=Object(f.a)(v,2),k=S[0],C=S[1],E=function(){return g(!m)};return Object(p.jsxs)(p.Fragment,{children:[Object(p.jsx)(be.a,{className:"".concat(h.header," ").concat(m?h.headerOpen:""),children:Object(p.jsxs)(X.a,{container:!0,direction:"column",justifyContent:"space-between",alignItems:"stretch",children:[Object(p.jsxs)(X.a,{container:!0,direction:"row",justifyContent:"space-between",alignItems:"center",children:[t&&Object(p.jsx)(he.a,{variant:"body1",className:h.unselectableLabel,children:t}),Object(p.jsx)(he.a,{variant:"body2",children:Object(p.jsxs)("div",{children:[!m&&n,!s&&!j&&Object(p.jsx)(w.a,{size:"small",className:h.copyValue,children:m?Object(p.jsx)(Ee.a,{onClick:E,strokeWidth:1}):Object(p.jsx)(Ln.a,{onClick:E,strokeWidth:1})})]})})]}),Object(p.jsx)(y.a,{in:m,timeout:"auto",unmountOnExit:!0,children:Object(p.jsx)(_n.a,{value:k,placeholder:u,onChange:function(e){b&&(e.target.value=b(e.target.value)),C(e.target.value),c&&c(e.target.value)},fullWidth:!0,className:h.content,autoFocus:!0,hidden:j})})]})}),Object(p.jsxs)(y.a,{in:m,timeout:"auto",unmountOnExit:!0,children:[l&&Object(p.jsx)(Fn,{children:l}),Object(p.jsxs)(Se,{children:[Object(p.jsx)(ht,{disabled:d||k===n||Boolean(o)||""===k&&void 0===n,loading:d,iconType:Un.a,onClick:function(){return r(k)},children:i||"Save"}),Object(p.jsx)(ht,{disabled:d||k===n||""===k,iconType:mt.a,onClick:function(){return C(n||"")},cancel:!0,children:"Cancel"})]})]})]})}function Vn(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 zn(e,t,n){var a=qn(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 qn(e){var t=localStorage.getItem(e);if(!t)return[];try{var n=JSON.parse(t);return Array.isArray(n)&&n.every(Yn)?n:[]}catch(a){return[]}}function Yn(e){return"object"===typeof e&&null!==e&&("createdAt"in e&&"hash"in e)}function Gn(e,t){return"index.html"===t?"Website ".concat(Vn(e,4)):t||"Folder ".concat(Vn(e,4))}function Zn(e){var t=e.title,n=e.localStorageKey,r=Object(a.useState)([]),c=Object(f.a)(r,2),i=c[0],o=c[1];return Object(a.useEffect)((function(){o(qn(n))}),[n]),i.length?Object(p.jsx)(xe,{label:t,defaultOpen:!0,children:i.map((function(e,t){return Object(p.jsx)(an,{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}!function(e){e.UPLOAD_HISTORY="UPLOAD_HISTORY",e.DOWNLOAD_HISTORY="DOWNLOAD_HISTORY"}(Wn||(Wn={}));var Kn=n(913),Jn=n(893),Xn=Object(x.a)((function(e){return Object(m.a)({root:{flexGrow:1,marginBottom:e.spacing(4)},leftTab:{marginRight:e.spacing(.5)},rightTab:{marginLeft:e.spacing(.5)}})}));function $n(e){var t=e.active,n=Xn(),a=Object(de.g)();return Object(p.jsx)("div",{className:n.root,children:Object(p.jsxs)(Kn.a,{value:"UPLOAD"===t?0:1,onChange:function(e,t){a(1===t?ir.DOWNLOAD:ir.UPLOAD)},variant:"fullWidth",children:[Object(p.jsx)(Jn.a,{className:n.leftTab,label:"Upload"},"UPLOAD"),Object(p.jsx)(Jn.a,{className:n.rightTab,label:"Download"},"DOWNLOAD")]})})}function Qn(){var e=Object(a.useState)(!1),t=Object(f.a)(e,2),n=t[0],r=t[1],c=Object(a.useContext)(F).beeApi,i=Object(a.useState)(void 0),o=Object(f.a)(i,2),s=o[0],u=o[1],d=Object(a.useContext)(yn).setUploadOrigin,b=Object(l.b)().enqueueSnackbar,j=Object(de.g)();function h(){return(h=Object(A.a)(E.a.mark((function e(t){var n,a,i,o;return E.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r(!0),c){e.next=4;break}return r(!1),e.abrupt("return");case 4:return e.prev=4,n=new In.ManifestJs(c),e.next=8,n.resolveFeedManifest(t);case 8:return(a=e.sent)&&(t=a),e.next=12,n.isManifest(t);case 12:if(e.sent){e.next=15;break}throw Error("The specified hash does not contain valid content.");case 15:return e.next=17,n.getIndexDocumentPath(t);case 17:i=e.sent,zn(Wn.DOWNLOAD_HISTORY,t,Gn(t,i)),d(gn),j(ir.HASH.replace(":hash",t)),e.next=29;break;case 23:e.prev=23,e.t0=e.catch(4),(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."),b(Object(p.jsxs)("span",{children:["Error: ",o||"Unknown"]}),{variant:"error"});case 29:return e.prev=29,r(!1),e.finish(29);case 32:case"end":return e.stop()}}),e,null,[[4,23,29,32]])})))).apply(this,arguments)}return Object(p.jsxs)(p.Fragment,{children:[Object(p.jsx)($n,{active:"DOWNLOAD"}),Object(p.jsx)(Mn,{label:"Swarm Hash",onConfirm:function(e){return function(e){return h.apply(this,arguments)}(e)},onChange:function(e){U.Utils.isHexString(e,64)||U.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:"Find",confirmLabelDisabled:Boolean(s)||n,placeholder:"e.g. 31fb0362b1a42536134c86bc58b97ac0244e5c6630beec3e27c2d1cecb38c605",expandedOnly:!0,mapperFn:function(e){return function(e){return e.length<64?e:Object($e.d)(e)||e}(e)},loading:n}),Object(p.jsx)(Zn,{title:"Download History",localStorageKey:Wn.DOWNLOAD_HISTORY})]})}var ea=n(348),ta=n.n(ea);function na(){return Object(p.jsx)(X.a,{container:!0,direction:"row",justifyContent:"center",alignItems:"center",children:Object(p.jsx)(K.a,{})})}var aa=n(895),ra=n(894),ca=n(896),ia=Object(x.a)((function(){return Object(m.a)({image:{width:"100%",height:"100%",objectFit:"cover"}})}));function oa(e){var t=ia(),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 sa=Object(x.a)((function(){return Object(m.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 la(e){var t=e.children,n=sa();return Object(p.jsx)("div",{className:n.wrapper,children:t})}function ua(e){var t=e.icon;return Object(p.jsx)(la,{children:t})}function da(e){var t=e.metadata,n=e.previewUri,a=Object(p.jsx)(ra.a,{}),r=null===t||void 0===t?void 0:t.type;return(null===t||void 0===t?void 0:t.isWebsite)?(a=Object(p.jsx)(aa.a,{}),r="Website"):"folder"===(null===t||void 0===t?void 0:t.type)&&(a=Object(p.jsx)(ca.a,{}),r="Folder"),Object(p.jsxs)(ut.a,{mb:4,children:[Object(p.jsx)(ut.a,{bgcolor:"background.paper",children:Object(p.jsxs)(X.a,{container:!0,direction:"row",children:[n?Object(p.jsx)(oa,{maxWidth:"250px",maxHeight:"175px",alt:"Upload Preview",src:n}):Object(p.jsx)(ua,{icon:a}),Object(p.jsxs)(ut.a,{p:2,children:[(null===t||void 0===t?void 0:t.hash)&&Object(p.jsxs)(he.a,{children:["Swarm Hash: ",Vn(t.hash)]}),(null===t||void 0===t?void 0:t.name)&&(null===t||void 0===t?void 0:t.name)!==(null===t||void 0===t?void 0:t.hash)&&Object(p.jsxs)(he.a,{children:["folder"===(null===t||void 0===t?void 0:t.type)?"Folder Name":"Filename",": ",Object($e.j)(null===t||void 0===t?void 0:t.name)]}),Object(p.jsxs)(he.a,{children:["Kind: ",r]}),(null===t||void 0===t?void 0:t.size)?Object(p.jsxs)(he.a,{children:["Size: ",dn(t.size)]}):null]})]})}),"folder"===(null===t||void 0===t?void 0:t.type)&&t.count&&Object(p.jsx)(ut.a,{mt:.25,p:2,bgcolor:"background.paper",children:Object(p.jsxs)(X.a,{container:!0,justifyContent:"space-between",alignItems:"center",direction:"row",children:[Object(p.jsx)(he.a,{variant:"subtitle2",children:"Folder content"}),Object(p.jsxs)(he.a,{variant:"subtitle2",children:[t.count," items"]})]})})]})}function ba(e){var t=e.isWebsite,n=e.hash;return Object(p.jsxs)(p.Fragment,{children:[Object(p.jsxs)(ut.a,{mb:4,children:[Object(p.jsx)(Te,{label:"Swarm hash",value:n}),Object(p.jsx)(an,{label:"Share on Swarm Gateway",value:"https://gateway.ethswarm.org/access/".concat(n)}),t&&Object(p.jsx)(an,{label:"BZZ Link",value:"https://".concat(en.encodeManifestReference(n).toString(),".bzz.link")})]}),Object(p.jsxs)(zt,{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 ja=n(897);function ha(e){var t=e.onOpen,n=e.onCancel,a=e.onDownload,r=e.onUpdateFeed,c=e.hasIndexDocument,i=e.loading;return Object(p.jsxs)(X.a,{container:!0,justifyContent:"space-between",children:[Object(p.jsxs)(Se,{children:[c&&Object(p.jsx)(ht,{onClick:t,iconType:ja.a,disabled:i,children:"View Website"}),Object(p.jsx)(ht,{onClick:a,iconType:ot.a,disabled:i,loading:i,children:"Download"}),Object(p.jsx)(ht,{onClick:n,iconType:mt.a,disabled:i,cancel:!0,children:"Close"})]}),Object(p.jsx)(ut.a,{mb:1,mr:1,children:Object(p.jsx)(ht,{onClick:r,iconType:ce.a,disabled:i,children:"Update Feed"})})]})}function pa(){var e=Object(a.useContext)(F),t=e.apiUrl,n=e.beeApi,r=Object(a.useContext)(V).status,c=Object(de.h)().hash,i=c,o=Object(de.g)(),s=Object(l.b)().enqueueSnackbar,u=Object(a.useState)(!0),d=Object(f.a)(u,2),b=d[0],j=d[1],h=Object(a.useState)(!1),O=Object(f.a)(h,2),x=O[0],m=O[1],g=Object(a.useState)({}),v=Object(f.a)(g,2),y=v[0],w=v[1],S=Object(a.useState)(null),k=Object(f.a)(S,2),C=k[0],T=k[1],B=Object(a.useState)(!1),N=Object(f.a)(B,2),D=N[0],I=N[1],L=Object(a.useState)(void 0),U=Object(f.a)(L,2),R=U[0],W=U[1],H=Object(a.useState)(),M=Object(f.a)(H,2),z=M[0],q=M[1];function Y(){return Y=Object(A.a)(E.a.mark((function e(){var t,a,o,l,u,d,b,j;return E.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n&&r.all){e.next=2;break}return e.abrupt("return");case 2:return t=new In.ManifestJs(n),e.next=5,t.isManifest(i);case 5:if(e.sent){e.next=10;break}return I(!0),s("The specified hash does not contain valid content.",{variant:"error"}),e.abrupt("return");case 10:return e.next=12,t.getHashes(i);case 12:return a=e.sent,e.next=15,t.getIndexDocumentPath(i);case 15:return o=e.sent,T(o),l=a[fn],delete a[On],delete a[fn],w(a),u=Object.keys(a).length,d={hash:c,size:0,type:u>1?"folder":"unknown",name:i,isWebsite:Boolean(o)&&u>1,count:u},e.prev=23,e.next=26,n.downloadFile(i,On);case 26:b=e.sent,j=b.data.text(),d=Object(P.a)(Object(P.a)({},d),JSON.parse(j)),e.next=33;break;case 31:e.prev=31,e.t0=e.catch(23);case 33:l&&W("".concat(_.b.BEE_API_HOST,"/bzz/").concat(i,"/").concat(fn)),q(d);case 35:case"end":return e.stop()}}),e,null,[[23,31]])}))),Y.apply(this,arguments)}function G(){return(G=Object(A.a)(E.a.mark((function e(){var a,r,c,o,s,l,u;return E.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n){e.next=2;break}return e.abrupt("return");case 2:if(zn(Wn.DOWNLOAD_HISTORY,i,Gn(i,C)),m(!0),1!==Object.keys(y).length){e.next=8;break}window.open("".concat(t,"/bzz/").concat(i,"/"),"_blank"),e.next=25;break;case 8:a=new ta.a,r=0,c=Object.entries(y);case 10:if(!(r0?o(-1):o(ir.UPLOAD)},onDownload:function(){return G.apply(this,arguments)},onUpdateFeed:function(){o(ir.FEEDS_UPDATE.replace(":hash",i))},hasIndexDocument:Boolean(null===z||void 0===z?void 0:z.isWebsite),loading:x})]}):Object(p.jsx)(Xe,{})}var Oa=Object(x.a)((function(){return Object(m.a)({wrapper:{height:"52px",display:"flex",flex:1,justifyContent:"center",alignItems:"center"},todo:{background:"#f7f7f7",color:"#c9c9c9"},inProgress:{background:"#ffffff",color:"#242424",height:"52px"},done:{background:"#f7f7f7",color:"#606060",height:"52px"}})}));function fa(e){var t=e.steps,n=e.index,a=Oa();function r(e){return e===n?a.inProgress:e255)return"-";var n=Object($e.a)(e,t);return"".concat(n.toSignificantDigits()," BZZ")}return Object(p.jsx)(Lt.c,{initialValues:xa,onSubmit:function(){var e=Object(A.a)(E.a.mark((function e(n,a){var o,s,l;return E.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 o=BigInt(n.amount),s=Number.parseInt(n.depth),l=n.label?{label:n.label}:void 0,e.next=10,c.createPostageBatch(o.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),i("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 tt.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 tt.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 t,n=e.submitForm,a=e.isValid,r=e.isSubmitting,c=e.values;return Object(p.jsxs)(Lt.b,{children:[Object(p.jsxs)(ut.a,{mb:2,children:[Object(p.jsx)(Ft,{name:"depth",label:"Depth",formik:!0}),Object(p.jsx)(ut.a,{mt:.25,sx:{bgcolor:"#f6f6f6"},p:2,children:Object(p.jsxs)(X.a,{container:!0,justifyContent:"space-between",children:[Object(p.jsx)(he.a,{children:"Corresponding file size"}),Object(p.jsx)(he.a,{children:(t=parseInt(c.depth||"0",10),isNaN(t)||t<17||t>255?"-":"~".concat(dn(Object($e.c)(t))))})]})})]}),Object(p.jsxs)(ut.a,{mb:2,children:[Object(p.jsx)(Ft,{name:"amount",label:"Amount",formik:!0}),Object(p.jsx)(ut.a,{mt:.25,sx:{bgcolor:"#f6f6f6"},p:2,children:Object(p.jsxs)(X.a,{container:!0,justifyContent:"space-between",children:[Object(p.jsx)(he.a,{children:"Corresponding TTL (Time to live)"}),Object(p.jsx)(he.a,{children:o(Number.parseInt(c.amount||"0",10))})]})})]}),Object(p.jsx)(ut.a,{mb:2,children:Object(p.jsx)(Ft,{name:"label",label:"Label",optional:!0,formik:!0})}),Object(p.jsx)(ut.a,{mb:4,sx:{bgcolor:"#fcf2e8"},p:2,children:Object(p.jsxs)(X.a,{container:!0,justifyContent:"space-between",children:[Object(p.jsx)(he.a,{children:"Indicative Price"}),Object(p.jsx)(he.a,{children:s(parseInt(c.depth||"0",10),BigInt(c.amount||"0"))})]})}),Object(p.jsx)(ht,{disabled:r||!a||!c.amount||!c.depth,onClick:n,iconType:It.a,loading:r,children:"Buy New Stamp"})]})}})}function ga(e){var t=e.onSelect,n=e.defaultValue,r=Object(a.useContext)(Pn).stamps;return Object(p.jsx)(Xt,{options:(r||[]).map((function(e){return{label:e.batchID.slice(0,8),value:e.batchID}})),onChange:function(e){return function(e){if(r){var n=r.find((function(t){return t.batchID===e}));n&&t(n)}}(e.target.value)},defaultValue:n})}function va(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 ya(e){var t=e.stamp,n=e.shorten;return Object(p.jsx)(ut.a,{p:2,width:"100%",children:Object(p.jsxs)(X.a,{container:!0,justifyContent:"space-between",alignItems:"center",direction:"row",children:[Object(p.jsx)(he.a,{variant:"subtitle2",children:n?t.batchID.slice(0,8):t.batchID}),Object(p.jsx)(va,{width:"100px",usage:t.usage})]})})}function wa(e){var t=e.stamp;return Object(p.jsxs)(ut.a,{mb:4,children:[Object(p.jsx)(ut.a,{mb:.25,p:2,bgcolor:"background.paper",children:Object(p.jsx)(he.a,{variant:"subtitle2",children:"Associated postage stamp:"})}),Object(p.jsx)(ut.a,{bgcolor:"background.paper",children:Object(p.jsx)(ya,{stamp:t,shorten:!0})})]})}var Sa=n(899);function ka(e){var t=e.step,n=e.onUpload,a=e.onCancel,r=e.onGoBack,c=e.onProceed,i=e.isUploading,o=e.hasStamp,s=e.uploadLabel,l=e.stampMode,u=e.setStampMode;return 0===t?Object(p.jsxs)(p.Fragment,{children:[Object(p.jsx)(ut.a,{mb:1,children:Object(p.jsxs)(Se,{children:[Object(p.jsx)(ht,{onClick:c,iconType:ie.a,children:"Add Postage Stamp"}),Object(p.jsx)(ht,{onClick:a,iconType:mt.a,cancel:!0,children:"Cancel"})]})}),Object(p.jsx)(zt,{children:"You need a postage stamp to upload."})]}):1===t?Object(p.jsxs)(X.a,{container:!0,direction:"row",justifyContent:"space-between",children:[Object(p.jsxs)(Se,{children:["SELECT"===l&&Object(p.jsx)(ht,{onClick:c,iconType:It.a,disabled:!o,children:"Proceed With Selected Stamp"}),Object(p.jsx)(ht,{onClick:r,iconType:Sa.a,cancel:!0,children:"Back To Preview"})]}),Object(p.jsx)(ht,{onClick:function(){return u("BUY"===l?"SELECT":"BUY")},iconType:"BUY"===l?ie.a:dt.a,children:"BUY"===l?"Use Existing Stamp":"Buy New Stamp"})]}):2===t?Object(p.jsxs)(Se,{children:[Object(p.jsx)(ht,{onClick:n,iconType:It.a,disabled:i,loading:i,children:s}),Object(p.jsx)(ht,{onClick:r,iconType:Sa.a,disabled:i,cancel:!0,children:"Change Postage Stamp"})]}):Object(p.jsx)(p.Fragment,{})}function Ca(){var e=Object(a.useState)(0),t=Object(f.a)(e,2),n=t[0],r=t[1],c=Object(a.useState)("SELECT"),i=Object(f.a)(c,2),o=i[0],s=i[1],u=Object(a.useState)(null),d=Object(f.a)(u,2),b=d[0],j=d[1],h=Object(a.useState)(!1),O=Object(f.a)(h,2),x=O[0],m=O[1],g=Object(a.useState)(!1),v=Object(f.a)(g,2),y=v[0],w=v[1],S=Object(a.useContext)(Pn).refresh,k=Object(a.useContext)(F).beeApi,C=Object(a.useContext)(yn),E=C.files,A=C.setFiles,T=C.uploadOrigin,B=C.metadata,N=C.previewUri,D=C.previewBlob,I=Object(a.useContext)(Ot),_=I.identities,L=I.setIdentities,U=Object(a.useContext)(V).status,R=Object(l.b)().enqueueSnackbar,W=Object(de.g)();if(Object(a.useEffect)((function(){S()}),[]),!U.all)return Object(p.jsx)(Xe,{});if(!E.length)return A([]),W(ir.UPLOAD,{replace:!0}),Object(p.jsx)(p.Fragment,{});var H=T.uuid?_.find((function(e){return e.uuid===T.uuid})):null,M=function(e){if(k&&E.length&&b&&B){var t=E.map(hn),n=void 0;if(1===E.length)n=E[0].name;else if(E.length>1){var a=un(E);if(a)if(a.commonPrefix){var r=a.commonPrefix.length;n=a.indexPath.substr(r),t=t.map((function(e){var t=e.path.substr(r);return Object(P.a)(Object(P.a)({},e),{},{path:t,webkitRelativePath:t,fullPath:t})}))}else n=a.indexPath}var c=E[0].lastModified,i={name:B.name,size:B.size};1===E.length&&(i.type=B.type);var o=new File([JSON.stringify(i)],On,{type:"application/json",lastModified:c});if(t.push(hn(o)),D){var s=new File([D],fn,{type:"image/jpeg",lastModified:c});t.push(hn(s))}m(!0),k.uploadFiles(b.batchID,t,{indexDocument:n}).then((function(t){zn(Wn.UPLOAD_HISTORY,t.reference,bn(E)),"UPLOAD"===T.origin?W(ir.HASH.replace(":hash",t.reference),{replace:!0}):Object(xt.f)(k,H,t.reference,b.batchID,e).then((function(){Object(xt.e)(_,H),L(Object(En.a)(_)),W(ir.FEEDS_PAGE.replace(":uuid",T.uuid),{replace:!0})}))})).catch((function(e){R("Error uploading: ".concat(e.message),{variant:"error"}),m(!1)}))}};return Object(p.jsxs)(p.Fragment,{children:[y&&Object(p.jsx)(Nn,{loading:x,feedName:H.name,onCancel:function(){return w(!1)},onProceed:function(e){M(e)}}),H&&Object(p.jsx)(Gt,{children:'Update "'.concat(H.name,'"')}),!H&&Object(p.jsx)(Gt,{children:"Upload"}),Object(p.jsx)(ut.a,{mb:4,children:Object(p.jsx)(fa,{steps:["Preview","Add postage stamp","Upload to node"],index:n})}),(0===n||2===n)&&Object(p.jsx)(da,{metadata:B,previewUri:N}),1===n&&Object(p.jsxs)(p.Fragment,{children:[Object(p.jsx)(ut.a,{mb:2,children:"SELECT"===o?Object(p.jsx)(ga,{onSelect:function(e){return j(e)},defaultValue:null===b||void 0===b?void 0:b.batchID}):Object(p.jsx)(ma,{onFinished:function(){return s("SELECT")}})}),Object(p.jsx)(ut.a,{mb:4,children:Object(p.jsxs)(zt,{children:["Please refer to the"," ",Object(p.jsx)("a",{href:"https://docs.ethswarm.org/debug-api/#tag/Postage-Stamps/paths/~1stamps~1{amount}~1{depth}/post",target:"_blank",rel:"noreferrer",children:"official Bee documentation"})," ","to understand these values."]})})]}),2===n&&b&&Object(p.jsx)(wa,{stamp:b}),Object(p.jsx)(ka,{step:n,onCancel:function(){r(0),A([]),j(null),m(!1)},onGoBack:function(){return r((function(e){return e-1}))},onProceed:function(){return r((function(e){return e+1}))},onUpload:function(){"UPLOAD"===T.origin||"PRIVATE_KEY"===H.type?M():w(!0)},isUploading:x,hasStamp:Boolean(b),uploadLabel:H?"Update Feed":"Upload To Your Node",stampMode:o,setStampMode:s})]})}function Ea(){return Object(a.useContext)(V).status.all?Object(p.jsxs)(p.Fragment,{children:[Object(p.jsx)($n,{active:"UPLOAD"}),Object(p.jsx)(kn,{showHelp:!0,uploadOrigin:gn}),Object(p.jsx)(Zn,{title:"Upload History",localStorageKey:Wn.UPLOAD_HISTORY})]}):Object(p.jsx)(Xe,{})}var Aa=n(173),Pa=1e5,Ta="There may be issues with your Bee node or connection.",Ba={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. "+Ta,score:0}],population:[{minimumValue:Pa,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(Pa.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. "+Ta,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. "+Ta,score:0}]};function Na(e,t){var n,a=Ba[e],r=a[0].score,c=Object(Aa.a)(a);try{for(c.s();!(n=c.n()).done;){var i=n.value;if(t>=i.minimumValue)return{score:i.score,maximumScore:r,explanation:i.explanation}}}catch(s){c.e(s)}finally{c.f()}var o=a[a.length-1];return{score:o.score,maximumScore:r,explanation:o.explanation}}var Da=function(e){var t,n,a,r,c,i,o={connectedPeers:Na("connectedPeers",(null===(t=e.topology)||void 0===t?void 0:t.connected)||0),population:Na("population",(null===(n=e.topology)||void 0===n?void 0:n.population)||0),depth:Na("depth",(null===(a=e.topology)||void 0===a?void 0:a.depth)||0)},s=Object.values(o).reduce((function(e,t){return e+t.maximumScore}),0),l=Object.values(o).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)(ye,{label:"Overall Health Indicator",value:u}),Object(p.jsx)(ye,{label:"Connected Peers",value:null===(r=e.topology)||void 0===r?void 0:r.connected.toString(),tooltip:o.connectedPeers.explanation}),Object(p.jsx)(ye,{label:"Population",value:null===(c=e.topology)||void 0===c?void 0:c.population.toString(),tooltip:o.population.explanation}),Object(p.jsx)(ye,{label:"Depth",value:null===(i=e.topology)||void 0===i?void 0:i.depth.toString(),tooltip:o.depth.explanation})]})};function Ia(){var e=Object(a.useContext)(V),t=e.status,n=e.latestUserVersion,r=e.isLatestBeeVersion,c=e.latestBeeVersionUrl,i=e.topology,o=e.nodeAddresses,s=e.chequebookAddress;return t.all?Object(p.jsxs)("div",{children:[Object(p.jsxs)(xe,{label:"Bee Node",defaultOpen:!0,children:[Object(p.jsx)(ye,{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)(Be.a,{size:"small",variant:"outlined",href:c,target:"_blank",children:r?"latest":"update"})]})}),Object(p.jsx)(Te,{label:"Public key",value:(null===o||void 0===o?void 0:o.publicKey)||""}),Object(p.jsx)(Te,{label:"PSS public key",value:(null===o||void 0===o?void 0:o.pssPublicKey)||""}),Object(p.jsx)(Te,{label:"Overlay address (Peer ID)",value:(null===o||void 0===o?void 0:o.overlay)||""}),Object(p.jsx)(xe,{level:1,label:"Underlay addresses",children:null===o||void 0===o?void 0:o.underlay.map((function(e){return Object(p.jsx)(ye,{value:e},e)}))})]}),Object(p.jsxs)(xe,{label:"Blockchain",defaultOpen:!0,children:[Object(p.jsx)(Te,{label:"Ethereum address",value:(null===o||void 0===o?void 0:o.ethereum)||""}),Object(p.jsx)(Te,{label:"Chequebook contract address",value:(null===s||void 0===s?void 0:s.chequebookAddress)||""})]}),Object(p.jsx)(xe,{label:"Connectivity",defaultOpen:!0,children:Object(p.jsx)(Da,{topology:i})})]}):Object(p.jsx)(Xe,{})}function _a(){var e=Object(a.useContext)(F),t=e.apiUrl,n=e.apiDebugUrl,r=e.setApiUrl,c=e.setDebugApiUrl,i=e.lockedApiSettings;return Object(p.jsxs)(xe,{label:"API Settings",defaultOpen:!0,children:[Object(p.jsx)(Mn,{label:"Bee API",value:t,onConfirm:r,locked:i}),Object(p.jsx)(Mn,{label:"Bee Debug API",value:n,onConfirm:c,locked:i})]})}var La=Object(x.a)((function(e){return Object(m.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 Ua(e){var t=e.children,n=e.expandable,r=e.defaultOpen,c=La(),i=Object(a.useState)(Boolean(r)),o=Object(f.a)(i,2),s=o[0],l=o[1];return Object(p.jsxs)("div",{className:"".concat(c.root," ").concat(c.rootLevel2),children:[Object(p.jsxs)(be.a,{button:!0,onClick:function(){l(!s)},className:c.header,children:[t,s?Object(p.jsx)(pe.a,{}):Object(p.jsx)(Oe.a,{})]}),Object(p.jsx)(y.a,{in:s,timeout:"auto",unmountOnExit:!0,children:Object(p.jsx)("div",{className:c.contentLevel12,children:n})})]})}var Ra=function(e){var t=e.postageStamps;return null===t?null:Object(p.jsx)(xe,{label:"Postage Stamps",defaultOpen:!0,children:t.map((function(e){return Object(p.jsx)(Ua,{expandable:Object(p.jsxs)(p.Fragment,{children:[Object(p.jsx)(Te,{label:"Batch ID",value:e.batchID}),Object(p.jsx)(ye,{label:"Depth",value:String(e.depth)}),Object(p.jsx)(ye,{label:"Capacity",value:"".concat(dn(4096*Math.pow(2,e.depth)*e.usage)," / ").concat(dn(4096*Math.pow(2,e.depth)))}),Object(p.jsx)(ye,{label:"Amount",value:parseInt(e.amount,10).toLocaleString()})]}),children:Object(p.jsx)(ya,{stamp:e,shorten:!0})},e.batchID)}))})},Fa=Object(x.a)((function(){return Object(m.a)({root:{width:"100%",display:"grid"},actions:{display:"flex",width:"100%",flex:"0 1 auto",flexWrap:"wrap",alignItems:"center"}})}));function Wa(){var e=Fa(),t=Object(de.g)(),n=Object(a.useContext)(Pn),r=n.stamps,c=n.isLoading,i=n.error,o=n.start,s=n.stop,l=Object(a.useContext)(V).status;if(Object(a.useEffect)((function(){if(l.all)return o(),function(){return s()}}),[l]),!l.all)return Object(p.jsx)(Xe,{});return Object(p.jsxs)("div",{className:e.root,children:[i&&Object(p.jsxs)(Z.a,{style:{textAlign:"center",padding:"50px"},children:["Error loading postage stamps details: ",i.message]}),!i&&Object(p.jsxs)(p.Fragment,{children:[Object(p.jsxs)("div",{className:e.actions,children:[Object(p.jsx)(ht,{onClick:function(){t(ir.STAMPS_NEW)},iconType:dt.a,children:"Buy New Postage Stamp"}),Object(p.jsx)("div",{style:{height:"5px"},children:c&&Object(p.jsx)(K.a,{})})]}),Object(p.jsx)(Ra,{postageStamps:r})]})]})}function Ha(){var e=Object(de.g)();return Object(p.jsxs)("div",{children:[Object(p.jsx)(Gt,{children:"Buy new postage stamp"}),Object(p.jsx)(ma,{onFinished:function(){e(ir.STAMPS)}})]})}var Ma=n(355),Va=["children","value","index"];function za(e){var t=e.children,n=e.value,a=e.index,r=Object(Ma.a)(e,Va);return Object(p.jsx)("div",Object(P.a)(Object(P.a)({role:"tabpanel",hidden:n!==a},r),{},{children:n===a&&t}))}var qa=Object(x.a)((function(e){return Object(m.a)({root:{flexGrow:1},content:{marginTop:e.spacing(2)}})}));function Ya(e){var t=e.values,n=e.index,a=e.indexChanged,c=qa(),i=r.a.useState(n||0),o=Object(f.a)(i,2),s=o[0],l=o[1],u=void 0!==n?n:s;return Object(p.jsxs)("div",{className:c.root,children:[Object(p.jsx)(Kn.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)(Jn.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)(za,{value:u,index:t,children:n},t)}))})]})}var Ga,Za,Ka=n(915),Ja=function(e){return Object(p.jsx)("div",{style:{textAlign:"left"},children:Object(p.jsx)(Ka.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"}(Ga||(Ga={})),function(e){e[e.macOS=Ga.macOS]="macOS",e[e.Linux=Ga.Linux]="Linux"}(Za||(Za={}));var Xa={platform:Za.macOS,setPlatform:function(){}},$a=Object(a.createContext)(Xa);$a.Consumer;function Qa(e){var t=e.children,n=Object(a.useState)(Za.Linux),r=Object(f.a)(n,2),c=r[0],i=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)?Ga.macOS:["iPhone","iPad","iPod"].includes(t)?Ga.iOS:["Win32","Win64","Windows","WinCE"].includes(t)?Ga.Windows:/Android/.test(e)?Ga.Android:/Linux/.test(t)?Ga.Linux:null}();i(function(e){return Object.keys(Za).includes(e)}(e)?e:Za.Linux)}),[]),Object(p.jsx)($a.Provider,{value:{platform:c,setPlatform:i},children:t})}function er(e){var t=Object(a.useContext)($a),n=t.platform,r=t.setPlatform;return Object(p.jsx)(Ya,{index:n,indexChanged:r,values:[{label:"Linux",component:Object(p.jsx)(Ja,{showLineNumbers:e.showLineNumbers,language:"bash",code:e.linux})},{label:"macOS",component:Object(p.jsx)(Ja,{showLineNumbers:e.showLineNumbers,language:"bash",code:e.mac})}]})}function tr(e){var t=e.isOk,n=e.size,a=e.className,r=n||"1rem";return e.isLoading?Object(p.jsx)(K.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 nr(){var e=Object(a.useContext)(V),t=e.status,n=e.isLoading,r=Object(a.useContext)(F),c=r.setDebugApiUrl,i=r.apiDebugUrl,o=t.debugApiConnection;return Object(p.jsxs)(xe,{label:Object(p.jsxs)(p.Fragment,{children:[Object(p.jsx)(tr,{isOk:o,isLoading:n})," Connection to Bee Debug API"]}),children:[Object(p.jsx)(Fn,{children:o?"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)(Mn,{label:"Bee Debug API",value:i,onConfirm:c}),!o&&Object(p.jsx)(xe,{level:1,label:"Troubleshoot",children:Object(p.jsx)(ye,{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)(er,{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)(er,{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)(er,{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)(er,{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 ar(){var e=Object(a.useContext)(F),t=e.setApiUrl,n=e.apiUrl,r=Object(a.useContext)(V),c=r.status,i=r.isLoading,o=c.apiConnection;return Object(p.jsxs)(xe,{label:Object(p.jsxs)(p.Fragment,{children:[Object(p.jsx)(tr,{isOk:o,isLoading:i})," Connection to Bee API"]}),children:[Object(p.jsx)(Fn,{children:o?"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)(Mn,{label:"Bee API",value:n,onConfirm:t}),!o&&Object(p.jsx)(xe,{level:1,label:"Troubleshoot",children:Object(p.jsx)(ye,{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)(er,{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)(er,{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)(er,{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 rr(){var e=Object(a.useContext)(V),t=e.status,n=e.isLoading,r=e.latestUserVersion,c=e.latestPublishedVersion,i=e.latestBeeVersionUrl,o=t.version;return Object(p.jsxs)(xe,{label:Object(p.jsxs)(p.Fragment,{children:[Object(p.jsx)(tr,{isOk:o,isLoading:n})," Bee Version"]}),children:[Object(p.jsx)(Fn,{children:o?"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:i,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)(er,{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)(ye,{label:"Your Version",value:r||"-"}),Object(p.jsx)(ye,{label:"Latest Version",value:c||"-"})]})}function cr(){var e=Object(a.useContext)(V),t=e.status,n=e.isLoading,r=e.nodeAddresses,c=t.blockchainConnection;return Object(p.jsxs)(xe,{label:Object(p.jsxs)(p.Fragment,{children:[Object(p.jsx)(tr,{isOk:c,isLoading:n})," Connection to Blockchain"]}),children:[Object(p.jsx)(Fn,{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)(Te,{label:"Ethereum Address",value:null===r||void 0===r?void 0:r.ethereum})]})}var ir,or=function(){var e=Object(a.useContext)(V),t=e.status,n=e.isLoading,r=e.chequebookAddress,c=t.chequebook;return Object(p.jsxs)(xe,{label:Object(p.jsxs)(p.Fragment,{children:[Object(p.jsx)(tr,{isOk:c,isLoading:n})," Chequebook Deployment & Funding"]}),children:[Object(p.jsx)(Fn,{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)(Te,{label:"Chequebook Address",value:r.chequebookAddress}),Object(p.jsx)(Se,{children:Object(p.jsx)(st,{})})]})]})};function sr(){var e=Object(a.useContext)(V),t=e.status,n=e.isLoading,r=e.topology,c=t.topology;return Object(p.jsxs)(xe,{label:Object(p.jsxs)(p.Fragment,{children:[Object(p.jsx)(tr,{isOk:c,isLoading:n})," Connection to Peers"]}),children:[Object(p.jsx)(Fn,{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)(Da,{topology:r})]})}function lr(){return Object(p.jsxs)("div",{children:[Object(p.jsx)(nr,{}),Object(p.jsx)(rr,{}),Object(p.jsx)(cr,{}),Object(p.jsx)(or,{}),Object(p.jsx)(ar,{}),Object(p.jsx)(sr,{})]})}function ur(){var e=Object(a.useState)(null),t=Object(f.a)(e,2),n=t[0],r=t[1],c=Object(a.useState)(!1),i=Object(f.a)(c,2),o=i[0],s=i[1],l=Object(a.useState)("https://dai.poa.network/"),u=Object(f.a)(l,2),d=u[0],b=u[1];function j(){return(j=Object(A.a)(E.a.mark((function e(){var t,n;return E.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return s(!0),e.prev=1,e.next=4,fetch("http://localhost:5000/status").then((function(e){return e.json()}));case 4:return t=e.sent,n=t.address,e.next=8,fetch("http://getxdai.co/".concat(n,"/0.01"),{method:"POST"});case 8:return e.prev=8,s(!1),e.finish(8);case 11:case"end":return e.stop()}}),e,null,[[1,,8,11]])})))).apply(this,arguments)}function h(){return(h=Object(A.a)(E.a.mark((function e(){return E.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return s(!0),e.prev=1,e.next=4,fetch("http://localhost:5000/config",{method:"PATCH",headers:{"content-type":"application/json"},body:JSON.stringify({"chain-enable":!0,"swap-enable":!0,"swap-endpoint":d})});case 4:return e.next=6,fetch("http://localhost:5000/restart",{method:"POST"});case 6:return e.prev=6,s(!1),e.finish(6);case 9:case"end":return e.stop()}}),e,null,[[1,,6,9]])})))).apply(this,arguments)}return Object(a.useEffect)((function(){fetch("http://localhost:1635/node").then((function(e){return e.json()})).then((function(e){return r(e)}))}),[]),n?"ultra-light"!==n.beeMode?Object(p.jsx)("div",{children:Object(p.jsx)(he.a,{children:"Already upgraded"})}):Object(p.jsxs)("div",{children:[Object(p.jsx)(ut.a,{mb:4,children:Object(p.jsx)(ht,{onClick:function(){return j.apply(this,arguments)},iconType:ae.a,loading:o,disabled:o,children:"Fund"})}),Object(p.jsx)(ut.a,{mb:2,children:Object(p.jsx)(Ft,{label:"RPC Provider",name:"rpc-provider",defaultValue:"https://dai.poa.network/",onChange:function(e){b(e.target.value)}})}),Object(p.jsx)(ht,{onClick:function(){return h.apply(this,arguments)},iconType:ae.a,loading:o,disabled:o,children:"Upgrade to Light Node"})]}):Object(p.jsx)(na,{})}!function(e){e.INFO="/",e.UPGRADE="/upgrade",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.STAMPS_NEW="/stamps/new",e.STATUS="/status",e.FEEDS="/feeds",e.FEEDS_NEW="/feeds/new",e.FEEDS_UPDATE="/feeds/update/:hash",e.FEEDS_PAGE="/feeds/:uuid"}(ir||(ir={}));var dr=function(){return Object(p.jsxs)(de.c,{children:[Object(p.jsx)(de.a,{path:ir.UPLOAD_IN_PROGRESS,element:Object(p.jsx)(Ca,{})}),Object(p.jsx)(de.a,{path:ir.UPLOAD,element:Object(p.jsx)(Ea,{})}),Object(p.jsx)(de.a,{path:ir.DOWNLOAD,element:Object(p.jsx)(Qn,{})}),Object(p.jsx)(de.a,{path:ir.UPGRADE,element:Object(p.jsx)(ur,{})}),Object(p.jsx)(de.a,{path:ir.HASH,element:Object(p.jsx)(pa,{})}),Object(p.jsx)(de.a,{path:ir.ACCOUNTING,element:Object(p.jsx)(lt,{})}),Object(p.jsx)(de.a,{path:ir.SETTINGS,element:Object(p.jsx)(_a,{})}),Object(p.jsx)(de.a,{path:ir.STAMPS,element:Object(p.jsx)(Wa,{})}),Object(p.jsx)(de.a,{path:ir.STAMPS_NEW,element:Object(p.jsx)(Ha,{})}),Object(p.jsx)(de.a,{path:ir.STATUS,element:Object(p.jsx)(lr,{})}),Object(p.jsx)(de.a,{path:ir.FEEDS,element:Object(p.jsx)(Mt,{})}),Object(p.jsx)(de.a,{path:ir.FEEDS_NEW,element:Object(p.jsx)(Qt,{})}),Object(p.jsx)(de.a,{path:ir.FEEDS_UPDATE,element:Object(p.jsx)(Dn,{})}),Object(p.jsx)(de.a,{path:ir.FEEDS_PAGE,element:Object(p.jsx)(Cn,{})}),Object(p.jsx)(de.a,{path:ir.INFO,element:Object(p.jsx)(Ia,{})})]})},br=n(7),jr=n(901),hr=Object(br.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"}}}}}))(be.a),pr=Object(x.a)((function(e){return Object(m.a)({icon:{color:"inherit"},activeIcon:{color:e.palette.primary.main}})}));function Or(e){var t=e.iconStart,n=e.iconEnd,a=e.path,r=e.label,c=pr(),i=Object(de.f)(),o=Boolean(a&&Object(de.d)(i.pathname,a));return Object(p.jsxs)(hr,{button:!0,selected:o,disableRipple:!0,children:[Object(p.jsx)(jr.a,{className:o?c.activeIcon:c.icon,children:t}),Object(p.jsx)(je.a,{primary:r}),Object(p.jsx)(jr.a,{className:o?c.activeIcon:c.icon,children:n})]})}var fr=n(902),xr=Object(x.a)((function(e){return Object(m.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 mr(e){var t=e.path,n=Object(a.useContext)(V),r=n.status,c=n.isLoading,i=xr(),o=Object(de.f)(),s=Boolean(t&&Object(de.d)(o.pathname,t));return Object(p.jsxs)(be.a,{button:!0,classes:{root:"".concat(i.root," ").concat(r.all?"":i.rootError),button:i.button},selected:s,disableRipple:!0,children:[Object(p.jsx)(jr.a,{style:{marginLeft:"30px"},children:Object(p.jsx)(tr,{isOk:r.all,isLoading:c})}),Object(p.jsx)(je.a,{primary:Object(p.jsx)(he.a,{className:i.smallerText,children:"Node ".concat(r.all?"OK":"Error")})}),Object(p.jsx)(jr.a,{className:i.icon,children:r.all?null:Object(p.jsx)(fr.a,{className:i.iconSmall})})]})}var gr=[{label:"Info",path:ir.INFO,icon:ne.a},{label:"Upgrade",path:ir.UPGRADE,icon:ae.a},{label:"Files",path:ir.UPLOAD,icon:re.a},{label:"Feeds",path:ir.FEEDS,icon:ce.a},{label:"Stamps",path:ir.STAMPS,icon:ie.a},{label:"Accounting",path:ir.ACCOUNTING,icon:oe.a},{label:"Settings",path:ir.SETTINGS,icon:se.a}],vr=Object(x.a)((function(e){return Object(m.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 yr(){var e=vr();return Object(p.jsx)(J.a,{className:e.drawer,variant:"permanent",anchor:"left",classes:{paper:e.drawerPaper},children:Object(p.jsxs)(X.a,{container:!0,direction:"column",justifyContent:"space-between",className:e.root,children:[Object(p.jsx)(X.a,{className:e.logo,children:Object(p.jsx)(u.b,{to:ir.INFO,children:Object(p.jsx)("img",{alt:"swarm",src:ue})})}),Object(p.jsxs)(X.a,{children:[Object(p.jsx)($.a,{children:gr.map((function(t){return Object(p.jsx)(u.b,{to:t.path,className:e.link,children:Object(p.jsx)(Or,{iconStart:Object(p.jsx)(t.icon,{className:e.icon}),path:t.path,label:t.label},t.path)},t.path)}))}),Object(p.jsx)(Q.a,{className:e.divider}),Object(p.jsx)($.a,{children:Object(p.jsx)(ee.a,{href:_.a.BEE_DOCS_HOST,target:"_blank",className:e.link,children:Object(p.jsx)(Or,{iconStart:Object(p.jsx)(le.a,{className:e.icon}),iconEnd:Object(p.jsx)(te.a,{className:e.iconSmall}),label:Object(p.jsx)("span",{children:"Docs"})})})})]}),Object(p.jsx)(X.a,{children:Object(p.jsx)(u.b,{to:ir.STATUS,className:e.link,children:Object(p.jsx)(mr,{path:ir.STATUS})})})]})})}var wr,Sr=Object(x.a)((function(e){return Object(m.a)({content:{backgroundColor:e.palette.background.default,minHeight:"100vh"}})})),kr=function(e){var t=Sr(),n=Object(a.useContext)(V).isLoading;return Object(p.jsxs)("div",{style:{display:"flex"},children:[Object(p.jsx)(yr,{}),Object(p.jsx)(Z.a,{className:t.content,children:Object(p.jsx)(O,{children:Object(p.jsxs)(p.Fragment,{children:[Object(p.jsx)(G,{}),n?Object(p.jsx)("div",{style:{textAlign:"center",width:"100%"},children:Object(p.jsx)(K.a,{})}):e.children]})})})]})},Cr=n(351),Er=n(181),Ar=Object(Cr.a)({palette:{type:"light",background:{default:"#efefef"},primary:{light:"#fcf2e8",main:"#dd7700",dark:Er.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"}}});Ar.overrides={MuiListItem:{button:{"&:hover":{backgroundColor:"#fcf2e8",color:(wr=Ar).palette.primary.main,"@media (hover: none)":{backgroundColor:"#fcf2e8",color:wr.palette.primary.main}}}},MuiContainer:{root:{padding:wr.spacing(8)},maxWidthXs:{padding:wr.spacing(8)},maxWidthSm:{padding:wr.spacing(8)},maxWidthMd:{padding:wr.spacing(8)},maxWidthLg:{padding:wr.spacing(8)},maxWidthXl:{padding:wr.spacing(8)}},MuiButton:{startIcon:{marginLeft:wr.spacing(1)},endIcon:{marginRight:wr.spacing(1)},outlined:{border:"none",borderRadius:wr.spacing(10),color:wr.palette.primary.main,backgroundColor:"#fcf2e8"},outlinedSizeSmall:{padding:wr.spacing(1),paddingLeft:wr.spacing(2),paddingRight:wr.spacing(2),boxShadow:"none","&:hover":{backgroundColor:wr.palette.primary.main,color:"white",boxShadow:"none","@media (hover: none)":{backgroundColor:wr.palette.primary.main,color:"white",boxShadow:"none"}}},outlinedSizeLarge:{padding:wr.spacing(4),borderRadius:0,boxShadow:"none","&:hover":{backgroundColor:wr.palette.primary.main,color:"white",boxShadow:"none","@media (hover: none)":{backgroundColor:wr.palette.primary.main,color:"white",boxShadow:"none"}}},containedSizeLarge:{padding:wr.spacing(4),borderRadius:0,boxShadow:"none","&:hover":{backgroundColor:wr.palette.primary.main,color:"white",boxShadow:"none","@media (hover: none)":{backgroundColor:wr.palette.primary.main,color:"white",boxShadow:"none"}}},containedSizeSmall:{padding:wr.spacing(1),paddingLeft:wr.spacing(2),paddingRight:wr.spacing(2),borderRadius:0,boxShadow:"none","&:hover":{backgroundColor:wr.palette.primary.main,color:"white",boxShadow:"none","@media (hover: none)":{backgroundColor:wr.palette.primary.main,color:"white",boxShadow:"none"}}},contained:{padding:wr.spacing(2),backgroundColor:"white",boxShadow:"none",borderRadius:0,"&:hover":{backgroundColor:wr.palette.primary.main,color:"white",boxShadow:"none","@media (hover: none)":{backgroundColor:wr.palette.primary.main,color:"white",boxShadow:"none"}},"&:focus":{backgroundColor:wr.palette.primary.main,color:"white"},"&:active":{backgroundColor:wr.palette.primary.main,color:"white"},"&:disabled":{backgroundColor:"white"}}},MuiTab:{root:{backgroundColor:wr.palette.background.paper,"&:hover":{backgroundColor:"#fcf2e8",color:wr.palette.primary.main,opacity:1},"&$selected":{fontWeight:wr.typography.fontWeightMedium}},textColorInherit:{opacity:.5}},MuiTabs:{root:{borderBottom:"none"},indicator:{backgroundColor:"transparent"}}},Ar.props={MuiTab:{disableRipple:!0},MuiButtonBase:{disableRipple:!0}};var Pr=function(e){var t=e.beeApiUrl,n=e.beeDebugApiUrl,a=e.lockedApiSettings;return Object(p.jsx)("div",{className:"App",children:Object(p.jsx)(s.a,{theme:Ar,children:Object(p.jsx)(W,{beeApiUrl:t,beeDebugApiUrl:n,lockedApiSettings:a,children:Object(p.jsx)(q,{children:Object(p.jsx)(Bn,{children:Object(p.jsx)(wn,{children:Object(p.jsx)(ft,{children:Object(p.jsx)(Qa,{children:Object(p.jsx)(l.a,{children:Object(p.jsx)(u.a,{children:Object(p.jsxs)(p.Fragment,{children:[Object(p.jsx)(o.a,{}),Object(p.jsx)(kr,{children:Object(p.jsx)(dr,{})})]})})})})})})})})})})})},Tr=function(e){e&&e instanceof Function&&n.e(3).then(n.bind(null,918)).then((function(t){var n=t.getCLS,a=t.getFID,r=t.getFCP,c=t.getLCP,i=t.getTTFB;n(e),a(e),r(e),c(e),i(e)}))};i.a.render(Object(p.jsx)(r.a.StrictMode,{children:Object(p.jsx)(Pr,{})}),document.getElementById("root")),Tr()}},[[802,1,2]]]); -//# sourceMappingURL=main.9569b243.chunk.js.map \ No newline at end of file diff --git a/static/dashboard/static/js/main.9569b243.chunk.js.map b/static/dashboard/static/js/main.9569b243.chunk.js.map deleted file mode 100644 index 79e341e..0000000 --- a/static/dashboard/static/js/main.9569b243.chunk.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["utils/index.ts","models/Token.ts","utils/identity.ts","config.ts","components/ErrorBoundary.tsx","providers/Settings.tsx","providers/Bee.tsx","hooks/apiHooks.tsx","components/AlertVersion.tsx","assets/logo.svg","components/ExpandableList.tsx","components/ExpandableListItem.tsx","components/ExpandableListItemActions.tsx","components/ExpandableListItemKey.tsx","components/ClipboardCopy.tsx","components/QRCodeModal.tsx","components/EthereumAddress.tsx","components/CashoutModal.tsx","pages/accounting/PeerBalances.tsx","components/TroubleshootConnectionCard.tsx","hooks/accounting.ts","components/WithdrawDepositModal.tsx","containers/WithdrawModal.tsx","containers/DepositModal.tsx","pages/accounting/index.tsx","components/SwarmButton.tsx","providers/Feeds.tsx","components/SwarmDialog.tsx","components/CloseButton.tsx","components/TitleWithClose.tsx","pages/feeds/DeleteFeedDialog.tsx","components/Code.tsx","pages/feeds/ExportFeedDialog.tsx","components/SwarmTextInput.tsx","pages/feeds/ImportFeedDialog.tsx","pages/feeds/index.tsx","components/DocumentationText.tsx","components/HistoryHeader.tsx","components/SwarmSelect.tsx","pages/feeds/CreateNewFeed.tsx","components/ExpandableListItemLink.tsx","utils/file.ts","utils/image.ts","constants.ts","providers/File.tsx","pages/files/UploadArea.tsx","pages/feeds/FeedSubpage.tsx","providers/Stamps.tsx","pages/feeds/FeedPasswordDialog.tsx","pages/feeds/UpdateFeed.tsx","components/ExpandableListItemNote.tsx","components/ExpandableListItemInput.tsx","utils/local-storage.ts","utils/hash.ts","components/History.tsx","utils/date.ts","pages/files/FileNavigation.tsx","pages/files/Download.tsx","components/Loading.tsx","components/FitImage.tsx","components/StripedWrapper.tsx","pages/files/AssetIcon.tsx","pages/files/AssetPreview.tsx","pages/files/AssetSummary.tsx","pages/files/DownloadActionBar.tsx","pages/files/Share.tsx","components/ProgressIndicator.tsx","pages/stamps/PostageStampCreation.tsx","pages/stamps/PostageStampSelector.tsx","components/Capacity.tsx","pages/stamps/PostageStamp.tsx","pages/files/StampPreview.tsx","pages/files/UploadActionBar.tsx","pages/files/Upload.tsx","pages/files/UploadLander.tsx","utils/threshold.ts","components/TopologyStats.tsx","pages/info/index.tsx","pages/settings/index.tsx","components/ExpandableElement.tsx","pages/stamps/StampsTable.tsx","pages/stamps/index.tsx","pages/stamps/CreatePostageStampPage.tsx","components/TabsContainer.tsx","providers/Platform.tsx","components/CodeBlock.tsx","components/CodeBlockTabs.tsx","components/StatusIcon.tsx","pages/status/SetupSteps/DebugConnectionCheck.tsx","pages/status/SetupSteps/NodeConnectionCheck.tsx","pages/status/SetupSteps/VersionCheck.tsx","pages/status/SetupSteps/EthereumConnectionCheck.tsx","pages/status/SetupSteps/ChequebookDeployFund.tsx","routes.tsx","pages/status/SetupSteps/PeerConnection.tsx","pages/status/index.tsx","pages/upgrade/index.tsx","components/SideBarItem.tsx","components/SideBarStatus.tsx","components/SideBar.tsx","layout/Dashboard.tsx","theme.tsx","App.tsx","reportWebVitals.ts","index.tsx"],"names":["isInteger","value","BigNumber","isBigNumber","makeBigNumber","toString","TypeError","sleepMs","ms","a","Promise","resolve","setTimeout","unwrapPromiseSettlements","promiseSettledResults","promises","values","fulfilled","filter","promise","status","rejected","map","x","reason","String","makeRetriablePromise","fn","maxRetries","delayMs","reject","tries","results","extractSwarmHash","string","matches","match","uuidV4","replace","s","c","parseInt","crypto","getRandomValues","Uint8Array","formatEnum","charAt","toUpperCase","slice","toLowerCase","replaceAll","secondsToTimeString","seconds","unit","Math","round","toFixed","convertDepthToBytes","depth","convertAmountToSeconds","amount","pricePerBlock","calculateStampPrice","Token","BigInt","shortenText","text","length","separator","POSSIBLE_DECIMALS","decimals","includes","this","dividedBy","pow","digits","toDecimal","asString","indexOfSignificantDigit","reachedDecimalPoint","i","char","t","multipliedBy","generateWallet","buffer","Wallet","Buffer","from","persistIdentity","identities","identity","existingIndex","findIndex","uuid","splice","unshift","localStorage","setItem","JSON","stringify","persistIdentitiesWithoutUpdate","convertWalletToIdentity","type","name","password","Error","getPrivateKeyString","toV3String","identityString","address","getAddressString","importIdentity","data","getWallet","wallet","startsWith","parse","getWalletFromIdentity","fromPrivateKey","trimHexString","fromV3","updateFeed","beeApi","hash","stamp","feedHash","createFeedManifest","repeat","writer","makeFeedWriter","upload","getProcessEnv","key","process","config","BEE_API_HOST","BEE_DEBUG_API_HOST","BLOCKCHAIN_EXPLORER_URL","BEE_DOCS_HOST","BEE_DISCORD_HOST","GITHUB_REPO_URL","sessionStorage","getItem","ErrorBoundary","props","state","error","errorInfo","console","message","children","Component","initialValues","apiUrl","apiDebugUrl","beeDebugApi","setApiUrl","setDebugApiUrl","lockedApiSettings","Context","createContext","Consumer","Provider","beeApiUrl","beeDebugApiUrl","extLockedApiSettings","useState","setBeeApi","setBeeDebugApi","Boolean","url","debugUrl","useEffect","Bee","e","BeeDebug","startedInDevMode","window","location","search","all","version","blockchainConnection","debugApiConnection","apiConnection","topology","chequebook","latestPublishedVersion","undefined","latestUserVersion","latestUserVersionExact","isLatestBeeVersion","latestBeeVersionUrl","apiHealth","debugApiHealth","nodeAddresses","nodeInfo","chequebookAddress","peers","chequebookBalance","peerBalances","peerCheques","settlements","chainState","latestBeeRelease","isLoading","isRefreshing","lastUpdate","start","stop","refresh","getStatus","devMode","REACT_APP_DEV_MODE","beeMode","semver","satisfies","engines","bee","includePrerelease","ethereum","connected","totalBalance","toBigNumber","isGreaterThan","Object","every","v","useContext","SettingsContext","setApiHealth","setDebugApiHealth","setNodeAddresses","setNodeInfo","setNodeTopology","setChequebookAddress","setPeers","setChequebookBalance","setPeerBalances","setPeerCheques","setSettlements","setChainState","setLatestBeeRelease","isLoadingLatestBeeRelease","setLoading","setError","axios","get","then","res","catch","finally","useLatestBeeRelease","setIsLoading","setIsRefreshing","setLastUpdate","frequency","setFrequency","coerce","chequeBalanceWrapper","getChequebookBalance","availableBalance","peerBalanceWrapper","getAllBalances","balances","peer","balance","settlementsWrapper","getAllSettlements","totalReceived","totalSent","received","sent","isConnected","getHealth","getNodeAddresses","getNodeInfo","getTopology","getPeers","getChequebookAddress","getLastCheques","getChainState","allSettled","Date","now","interval","setInterval","clearInterval","html_url","freq","useStyles","makeStyles","theme","createStyles","root","width","marginBottom","spacing","VersionAlert","classes","open","setOpen","isExactlySupportedBeeVersion","SUPPORTED_BEE_VERSION_EXACT","Collapse","in","className","Alert","severity","action","IconButton","color","size","onClick","fontSize","AlertTitle","padding","margin","marginTop","rootLevel1","rootLevel2","header","backgroundColor","palette","background","paper","contentLevel0","contentLevel12","infoText","ExpandableList","label","level","defaultOpen","info","rootLevelClass","typographyVariant","contentLevelClass","ListItem","button","ListItemText","primary","Typography","variant","style","display","ExpandLess","ExpandMore","timeout","unmountOnExit","wordBreak","copyValue","cursor","borderRadius","main","ExpandableListItem","tooltip","Grid","container","direction","justifyContent","alignItems","Tooltip","title","placement","arrow","strokeWidth","wrapper","flexDirection","flexWrap","marginRight","ExpandableListItemActions","Array","isArray","borderLeft","headerOpen","content","keyMargin","ExpandableListItemKey","copied","setCopied","toggleOpen","tooltipClickHandler","tooltipCloseHandler","splitValues","nonPrefixLength","lengthWithoutPrefix","split","hasPrefix","test","spanText","onClose","component","ClipboardCopy","enqueueSnackbar","useSnackbar","marginLeft","height","QRCodeModal","FilterCenterFocusSharp","Dialog","textAlign","DialogTitle","id","bgColor","fgColor","includeMargin","renderAs","EthereumAddress","hideBlockie","paddingTop","truncate","maxWidth","overflow","textOverflow","whiteSpace","href","transaction","target","rel","CheckoutModal","peerId","uncashedAmount","loadingCashout","setLoadingCashout","handleClose","Button","startIcon","substr","DialogContent","DialogContentText","overflowWrap","Container","CircularProgress","DialogActions","cashoutLastCheque","disabled","PeerBalances","accounting","isLoadingUncashed","totalUncashed","toFixedDecimal","total","icon","TroubleshootConnectionCard","item","align","Link","to","ROUTES","STATUS","useAccounting","setIsloadingUncashed","uncashedAmounts","setUncashedAmounts","gt","getLastCashoutAction","forEach","plus","minus","sort","b","diff","toNumber","mergeAccounting","WithdrawDepositModal","successMessage","errorMessage","dialogMessage","min","max","setAmount","amountToken","setAmountToken","amountError","setAmountError","handleAction","toBigInt","transactionHash","stopPropagation","Input","autoFocus","placeholder","fullWidth","onChange","fromDecimal","isLessThan","FormHelperText","WithdrawModal","withdrawTokens","DepositModal","depositTokens","Accounting","BeeContext","position","stroke","transition","cancelButton","spinnerWrapper","left","top","transform","SwarmButton","iconType","loading","cancel","React","createElement","join","event","currentTarget","blur","setIdentities","SwarmDialog","PaperProps","Box","p","sx","CloseButton","fontWeight","TitleWithClose","DeleteFeedDialog","onConfirm","mb","Trash","X","pre","maxHeight","prettifyString","Code","prettify","ExportFeedDialog","Download","saveAs","Blob","Clipboard","navigator","clipboard","writeText","field","border","SwarmTextInput","optional","formik","defaultValue","TextField","required","InputProps","disableUnderline","textarea","displayNone","ImportFeedDialog","textareaValue","setTextareaValue","setName","fileInputRef","useRef","feed","onFeedReady","fileReader","FileReader","file","files","onload","result","readAsText","ref","TextareaAutosize","minRows","Upload","current","click","Check","Feeds","IdentityContext","navigate","useNavigate","selectedIdentity","setSelectedIdentity","showImport","setShowImport","showExport","setShowExport","showDelete","setShowDelete","onDialogClose","updatedFeeds","onDelete","PlusSquare","FEEDS_NEW","mt","FEEDS_PAGE","Info","DocumentationText","pressable","HistoryHeader","mr","ArrowBack","select","option","SwarmSelect","options","Select","MenuProps","MenuListProps","disablePadding","square","MenuItem","identityName","CreateNewFeed","FeedsContext","getAllPostageBatch","stamps","FEEDS","onSubmit","submitForm","bgcolor","openLinkIcon","ExpandableListItemLink","link","navigationType","allowClipboard","displayValue","onNavigation","OpenInNewSharp","ArrowForward","indexHtmls","detectIndexHtml","paths","getPath","exactMatch","find","indexPath","prefix","y","commonPrefix","getHumanReadableFileSize","bytes","getAssetNameFromFiles","f","path","webkitRelativePath","packageFile","fullPath","lastModified","stream","arrayBuffer","resize","reader","readAsDataURL","src","img","Image","dimensions","imgWidth","imgHeight","ratioWidth","ratioHeight","ratio","getDimensions","elem","document","ctx","getContext","drawImage","canvas","toBlob","blob","onerror","META_FILE_NAME","PREVIEW_FILE_NAME","PREVIEW_DIMENSIONS","defaultUploadOrigin","origin","setFiles","uploadOrigin","setUploadOrigin","metadata","setMetadata","previewUri","setPreviewUri","previewBlob","setPreviewBlob","reduce","isWebsite","count","getMetadata","URL","revokeObjectURL","createObjectURL","areaWrapper","dropzone","default","outline","zIndex","opacity","buttonWrapper","UploadArea","showHelp","strictWebsiteMode","setStrictWebsiteMode","setVersion","getDropzoneInputDomElement","querySelector","onUploadCollectionClick","element","setAttribute","dropzoneClass","FilePaths","indexDocument","UPLOAD_IN_PROGRESS","filesLimit","maxFileSize","showPreviews","removeAttribute","FilePlus","FolderPlus","PlusCircle","FeedSubpage","useParams","available","setAvailable","downloadData","swarmCid","enrichStamp","postageBatch","bucketDepth","usage","utilization","usageText","ceil","setStamps","FeedPasswordDialog","feedName","onProceed","onCancel","setPassword","UpdateFeed","StampContext","selectedStamp","setSelectedStamp","showPasswordPrompt","setShowPasswordPrompt","onFeedUpdate","Reflect","batchID","batchId","Bookmark","typography","ExpandableListItemNote","HISTORY_KEYS","unselectableLabel","userSelect","WebkitUserSelect","MozUserSelect","msUserSelect","confirmLabel","confirmLabelDisabled","expandedOnly","helperText","mapperFn","locked","inputValue","setInputValue","InputBase","hidden","Search","shortenHash","sliceLength","putHistory","history","getHistorySafe","createdAt","items","parsed","isHistoryItem","determineHistoryName","History","localStorageKey","setItems","date","trim","flexGrow","leftTab","rightTab","FileNavigation","active","Tabs","newValue","DOWNLOAD","UPLOAD","Tab","referenceError","setReferenceError","identifier","manifestJs","ManifestJs","resolveFeedManifest","feedIdentifier","isManifest","getIndexDocumentPath","DOWNLOAD_HISTORY","HASH","onSwarmIdentifier","Utils","isHexString","recognizeSwarmHash","Loading","image","objectFit","FitImage","inlineStyles","alt","StripedWrapper","AssetIcon","AssetPreview","previewComponent","Web","AssetSummary","DownloadActionBar","onOpen","onDownload","onUpdateFeed","hasIndexDocument","Share","reference","downloading","setDownloading","swarmEntries","setSwarmEntries","setIndexDocument","notFound","setNotFound","preview","setPreview","getHashes","entries","previewFile","keys","downloadFile","mtdt","remoteMetadata","zip","JSZip","generateAsync","prepare","FEEDS_UPDATE","flex","todo","inProgress","done","ProgressIndicator","steps","index","pickClass","initialFormValues","PostageStampCreation","onFinished","StampsContext","getTtl","isCurrentPriceAvailable","currentPrice","Number","getPrice","isNaN","price","toSignificantDigits","actions","createPostageBatch","resetForm","setSubmitting","validate","errors","isLessThanOrEqualTo","isValid","isSubmitting","PostageStampSelector","onSelect","stampId","Capacity","integerUsage","used","free","PostageStamp","shorten","StampPreview","UploadActionBar","step","onUpload","onGoBack","isUploading","hasStamp","uploadLabel","stampMode","setStampMode","Layers","ArrowLeft","setStep","setStamp","setUploading","FileContext","uploadFiles","fls","idx","substrStart","mtd","metafile","File","push","UPLOAD_HISTORY","UploadLander","OPTIMAL_POPULATION","GENERIC_ERROR","THRESHOLDS","connectedPeers","minimumValue","explanation","score","population","toLocaleString","pickThreshold","thresholds","maximumScore","last","TopologyStats","maximumTotalScore","sum","actualTotalScore","percentageText","Status","publicKey","pssPublicKey","overlay","underlay","addr","Settings","ExpandableElement","expandable","StampsTable","postageStamps","Stamp","STAMPS_NEW","CreatePostageStampPage","STAMPS","TabPanel","other","role","SimpleTabs","indexChanged","setValue","Platforms","SupportedPlatforms","CodeBlock","language","showLineNumbers","code","macOS","Linux","platform","setPlatform","os","userAgent","iOS","Windows","Android","getOS","isSupportedPlatform","CodeBlockTabs","linux","mac","StatusIcon","isOk","NodeConnectionCheck","elevation","VersionCheck","EthereumConnectionCheck","ChequebookDeployFund","PeerConnection","NodeSetupWorkflow","UpgradePage","node","setNode","rpcProvider","setRpcProvider","fetch","r","json","method","headers","body","Send","BaseRouter","UPGRADE","ACCOUNTING","SETTINGS","INFO","StyledListItem","withStyles","paddingLeft","paddingRight","activeIcon","SideBarItem","iconStart","iconEnd","useLocation","isSelected","matchPath","pathname","selected","disableRipple","ListItemIcon","iconSmall","rootError","smallerText","navBarItems","Home","FileText","DollarSign","minHeight","paddingBottom","drawer","flexShrink","drawerPaper","logo","divider","textDecoration","SideBar","Drawer","anchor","Logo","List","Divider","Dashboard","createTheme","light","dark","orange","secondary","fontFamily","h1","h2","h3","body2","overrides","MuiListItem","MuiContainer","maxWidthXs","maxWidthSm","maxWidthMd","maxWidthLg","maxWidthXl","MuiButton","endIcon","outlined","outlinedSizeSmall","boxShadow","outlinedSizeLarge","containedSizeLarge","containedSizeSmall","contained","MuiTab","fontWeightMedium","textColorInherit","MuiTabs","borderBottom","indicator","MuiButtonBase","App","ThemeProvider","CssBaseline","reportWebVitals","onPerfEntry","Function","getCLS","getFID","getFCP","getLCP","getTTFB","ReactDOM","render","StrictMode","getElementById"],"mappings":"mlBAUO,SAASA,EAAUC,GACxB,OAAQC,YAAUC,YAAYF,IAAUA,EAAMD,aAAiC,kBAAVC,EAYhE,SAASG,EAAcH,GAC5B,GAAIC,YAAUC,YAAYF,GAAQ,OAAOA,EAEzC,GAAqB,kBAAVA,EAAoB,OAAO,IAAIC,YAAUD,GAEpD,GAAqB,kBAAVA,EAAoB,OAAO,IAAIC,YAAUD,EAAMI,YAG1D,GAAqB,kBAAVJ,EAAwD,OAAO,IAAIC,YAAUD,GAExF,MAAM,IAAIK,UAAJ,uEAA8EL,EAA9E,mBAA8FA,IAa/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,cAAC,EAAD,CAAkBjI,UAAWA,EAAWC,eAAgBA,EAAgBN,kBAAmBA,EAA3F,SACE,cAAC,EAAD,UACE,cAAC,GAAD,UACE,cAAC,GAAD,UACE,cAAC,GAAD,UACE,cAAC,GAAD,UACE,cAAC,IAAD,UACE,cAAC,IAAD,UACE,qCACE,cAAC84B,EAAA,EAAD,IACA,cAAC,GAAD,UACE,cAAC,GAAD,8BCtBXC,GAZS,SAACC,GACnBA,GAAeA,aAAuBC,UACxC,8BAAqBvzB,MAAK,YAAkD,IAA/CwzB,EAA8C,EAA9CA,OAAQC,EAAsC,EAAtCA,OAAQC,EAA8B,EAA9BA,OAAQC,EAAsB,EAAtBA,OAAQC,EAAc,EAAdA,QAC3DJ,EAAOF,GACPG,EAAOH,GACPI,EAAOJ,GACPK,EAAOL,GACPM,EAAQN,OCHdO,IAASC,OACP,cAAC,IAAMC,WAAP,UACE,cAAC,GAAD,MAEFna,SAASoa,eAAe,SAM1BX,O","file":"static/js/main.9569b243.chunk.js","sourcesContent":["import { BigNumber } from 'bignumber.js'\nimport { Token } from '../models/Token'\n\n/**\n * Test if value is an integer\n *\n * @param value Value to be tested if it is an integer\n *\n * @returns True if the passed in value is integer\n */\nexport function isInteger(value: unknown): value is BigNumber | bigint {\n return (BigNumber.isBigNumber(value) && value.isInteger()) || typeof value === 'bigint'\n}\n\n/**\n *Convert value into a BigNumber if not already\n *\n * @param value Value to be converted\n *\n * @throws {TypeError} if the value is not convertible to a BigNumber\n *\n * @returns BigNumber - but it may still be NaN or Infinite\n */\nexport function makeBigNumber(value: BigNumber | BigInt | number | string): BigNumber | never {\n if (BigNumber.isBigNumber(value)) return value\n\n if (typeof value === 'string') return new BigNumber(value)\n\n if (typeof value === 'bigint') return new BigNumber(value.toString())\n\n // FIXME: bee-js still returns some values as numbers and even outside of SAFE INTEGER bounds\n if (typeof value === 'number' /* && Number.isSafeInteger(value)*/) return new BigNumber(value)\n\n throw new TypeError(`Not a BigNumber or BigNumber convertible value. Type: ${typeof value} value: ${value}`)\n}\n\nexport type PromiseSettlements = {\n fulfilled: PromiseFulfilledResult[]\n rejected: PromiseRejectedResult[]\n}\n\nexport type UnwrappedPromiseSettlements = {\n fulfilled: T[]\n rejected: string[]\n}\n\nexport async function sleepMs(ms: number): Promise {\n await new Promise(resolve =>\n setTimeout(() => {\n resolve()\n }, ms),\n )\n}\n\n/**\n * Maps the returned results of `Promise.allSettled` to an object\n * with `fulfilled` and `rejected` arrays for easy access.\n *\n * The results still need to be unwrapped to get the fulfilled values or rejection reasons.\n */\nexport function mapPromiseSettlements(promises: PromiseSettledResult[]): PromiseSettlements {\n const fulfilled = promises.filter(promise => promise.status === 'fulfilled') as PromiseFulfilledResult[]\n const rejected = promises.filter(promise => promise.status === 'rejected') as PromiseRejectedResult[]\n\n return { fulfilled, rejected }\n}\n\n/**\n * Maps the returned values of `Promise.allSettled` to an object\n * with `fulfilled` and `rejected` arrays for easy access.\n *\n * For rejected promises, the value is the stringified `reason`,\n * or `'Unknown error'` string when it is unavailable.\n */\nexport function unwrapPromiseSettlements(\n promiseSettledResults: PromiseSettledResult[],\n): UnwrappedPromiseSettlements {\n const values = mapPromiseSettlements(promiseSettledResults)\n const fulfilled = values.fulfilled.map(x => x.value)\n const rejected = values.rejected.map(x => (x.reason ? String(x.reason) : 'Unknown error'))\n\n return { fulfilled, rejected }\n}\n\n/**\n * Wraps a `Promise` or async function inside a new `Promise`,\n * which retries the original function up to `maxRetries` times,\n * waiting `delayMs` milliseconds between failed attempts.\n *\n * If all attempts fail, then this `Promise` also rejects.\n */\nexport function makeRetriablePromise(fn: () => Promise, maxRetries = 3, delayMs = 1000): Promise {\n return new Promise(async (resolve, reject) => {\n for (let tries = 0; tries < maxRetries; tries++) {\n try {\n const results = await fn()\n resolve(results)\n\n return\n } catch (error) {\n if (tries < maxRetries - 1) {\n await sleepMs(delayMs)\n } else {\n reject(error)\n }\n }\n }\n })\n}\n\nexport function extractSwarmHash(string: string): string | null {\n const matches = string.match(/[a-fA-F0-9]{64,128}/)\n\n return (matches && matches[0]) || null\n}\n\nexport function uuidV4(): string {\n const pattern = '10000000-1000-4000-8000-100000000000'\n\n return pattern.replace(/[018]/g, (s: string) => {\n const c = parseInt(s, 10)\n\n return (c ^ (crypto.getRandomValues(new Uint8Array(1))[0] & (15 >> (c / 4)))).toString(16)\n })\n}\n\nexport function formatEnum(string: string): string {\n return (string.charAt(0).toUpperCase() + string.slice(1).toLowerCase()).replaceAll('_', ' ')\n}\n\nexport function secondsToTimeString(seconds: number): string {\n let unit = seconds\n\n if (unit < 120) {\n return `${seconds} seconds`\n }\n unit /= 60\n\n if (unit < 120) {\n return `${Math.round(unit)} minutes`\n }\n unit /= 60\n\n if (unit < 48) {\n return `${Math.round(unit)} hours`\n }\n unit /= 24\n\n if (unit < 14) {\n return `${Math.round(unit)} days`\n }\n unit /= 7\n\n if (unit < 52) {\n return `${Math.round(unit)} weeks`\n }\n unit /= 52\n\n return `${unit.toFixed(1)} years`\n}\n\nexport function convertDepthToBytes(depth: number): number {\n return 2 ** depth * 4096\n}\n\nexport function convertAmountToSeconds(amount: number, pricePerBlock: number): number {\n // TODO: blocktime should come directly from the blockchain as it may differ between different networks\n const blockTime = 5 // On mainnet there is 5 seconds between blocks\n\n // See https://github.com/ethersphere/bee/blob/66f079930d739182c4c79eb6008784afeeba1096/pkg/debugapi/postage.go#L410-L413\n return (amount * blockTime) / pricePerBlock\n}\n\nexport function calculateStampPrice(depth: number, amount: bigint): Token {\n // See https://github.com/ethersphere/bee/blob/66f079930d739182c4c79eb6008784afeeba1096/pkg/debugapi/postage.go#L410-L413\n return new Token(amount * BigInt(2 ** depth)) // FIXME: the 2 ** depth should be performed on bigint already\n}\n\nexport function shortenText(text: string, length = 20, separator = '[…]'): string {\n if (text.length <= length * 2 + separator.length) {\n return text\n }\n\n return `${text.slice(0, length)}${separator}${text.slice(-length)}`\n}\n","import { BigNumber } from 'bignumber.js'\nimport { isInteger, makeBigNumber } from '../utils'\n\nconst POSSIBLE_DECIMALS = [18, 17, 16, 15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0]\ntype digits = typeof POSSIBLE_DECIMALS[number]\n\nconst BZZ_DECIMALS = 16\n\nexport class Token {\n private amount: BigNumber // Represented in the base units, so it is always an integer value\n private readonly decimals: digits\n\n constructor(amount: BigNumber | string | BigInt, decimals: digits = BZZ_DECIMALS) {\n const a = makeBigNumber(amount)\n\n if (!isInteger(a) || !POSSIBLE_DECIMALS.includes(decimals)) throw new TypeError('Not a valid token values')\n\n this.amount = a\n this.decimals = decimals\n }\n\n /**\n * Construct new Token from a digit representation\n *\n * @param amount Amount of a token in the digits (1 token = 10^decimals)\n * @param decimals Number of decimals for the token (must be integer)\n *\n * @throws {TypeError} If the decimals is not an integer or the amount after conversion is not an integer\n *\n * @returns new Token\n */\n static fromDecimal(amount: BigNumber | string | BigInt, decimals: digits = BZZ_DECIMALS): Token | never {\n const a = makeBigNumber(amount)\n\n // No need to do any validation here, it is done when the new token is created\n const t = a.multipliedBy(new BigNumber(10).pow(decimals))\n\n return new Token(t, decimals)\n }\n\n get toBigInt(): BigInt {\n return BigInt(this.amount.toFixed(0))\n }\n\n get toString(): string {\n return this.amount.toFixed(0)\n }\n\n get toBigNumber(): BigNumber {\n return new BigNumber(this.amount)\n }\n\n get toDecimal(): BigNumber {\n return this.amount.dividedBy(new BigNumber(10).pow(this.decimals))\n }\n\n toFixedDecimal(digits = 7): string {\n return this.toDecimal.toFixed(digits)\n }\n\n toSignificantDigits(digits = 4): string {\n const asString = this.toDecimal.toFixed(16)\n\n let indexOfSignificantDigit = -1\n let reachedDecimalPoint = false\n\n for (let i = 0; i < asString.length; i++) {\n const char = asString[i]\n\n if (char === '.') {\n reachedDecimalPoint = true\n indexOfSignificantDigit = i + 1\n } else if (reachedDecimalPoint && char !== '0') {\n indexOfSignificantDigit = i\n break\n }\n }\n\n return asString.slice(0, indexOfSignificantDigit + digits)\n }\n}\n","import { Bee, Reference } from '@ethersphere/bee-js'\nimport Wallet from 'ethereumjs-wallet'\nimport { uuidV4 } from '.'\nimport { Identity, IdentityType } from '../providers/Feeds'\n\nexport function generateWallet(): Wallet {\n const buffer = new Uint8Array(32)\n crypto.getRandomValues(buffer)\n const wallet = new Wallet(Buffer.from(buffer))\n\n return wallet\n}\n\nexport function persistIdentity(identities: Identity[], identity: Identity): void {\n const existingIndex = identities.findIndex(x => x.uuid === identity.uuid)\n\n if (existingIndex !== -1) {\n identities.splice(existingIndex, 1)\n }\n identities.unshift(identity)\n localStorage.setItem('feeds', JSON.stringify(identities))\n}\n\nexport function persistIdentitiesWithoutUpdate(identities: Identity[]): void {\n localStorage.setItem('feeds', JSON.stringify(identities))\n}\n\nexport async function convertWalletToIdentity(\n identity: Wallet,\n type: IdentityType,\n name: string,\n password?: string,\n): Promise {\n if (type === 'V3' && !password) {\n throw Error('V3 passwords require password')\n }\n\n const identityString =\n type === 'PRIVATE_KEY' ? identity.getPrivateKeyString() : await identity.toV3String(password as string)\n\n return {\n uuid: uuidV4(),\n name,\n type: password ? 'V3' : 'PRIVATE_KEY',\n address: identity.getAddressString(),\n identity: identityString,\n }\n}\n\nexport async function importIdentity(name: string, data: string): Promise {\n if (data.length === 64) {\n const wallet = await getWallet('PRIVATE_KEY', data)\n\n return {\n uuid: uuidV4(),\n name,\n type: 'PRIVATE_KEY',\n identity: data,\n address: wallet.getAddressString(),\n }\n }\n\n if (data.length === 66 && data.toLowerCase().startsWith('0x')) {\n const wallet = await getWallet('PRIVATE_KEY', data.slice(2))\n\n return { uuid: uuidV4(), name, type: 'PRIVATE_KEY', identity: data, address: wallet.getAddressString() }\n }\n try {\n const { address } = JSON.parse(data)\n\n return { uuid: uuidV4(), name, type: 'V3', identity: data, address }\n } catch {\n return null\n }\n}\n\nfunction getWalletFromIdentity(identity: Identity, password?: string): Promise {\n return getWallet(identity.type, identity.identity, password)\n}\n\nasync function getWallet(type: IdentityType, data: string, password?: string): Promise {\n return type === 'PRIVATE_KEY'\n ? Wallet.fromPrivateKey(Buffer.from(trimHexString(data), 'hex'))\n : await Wallet.fromV3(data, password as string)\n}\n\nexport async function updateFeed(\n beeApi: Bee,\n identity: Identity,\n hash: string,\n stamp: string,\n password?: string,\n): Promise {\n const wallet = await getWalletFromIdentity(identity, password)\n\n if (!identity.feedHash) {\n identity.feedHash = await beeApi.createFeedManifest(stamp, 'sequence', '00'.repeat(32), wallet.getAddressString())\n }\n\n const writer = beeApi.makeFeedWriter('sequence', '00'.repeat(32), wallet.getPrivateKeyString())\n await writer.upload(stamp, hash as Reference)\n}\n\nfunction trimHexString(string: string): string {\n if (string.toLowerCase().startsWith('0x')) {\n return string.slice(2)\n }\n\n return string\n}\n","function getProcessEnv(key: string): string | undefined | false {\n return typeof process === 'object' && process.env[key]\n}\n\nclass Config {\n public readonly BEE_API_HOST: string\n public readonly BEE_DEBUG_API_HOST: string\n public readonly BLOCKCHAIN_EXPLORER_URL: string\n public readonly BEE_DOCS_HOST: string\n public readonly BEE_DISCORD_HOST: string\n public readonly GITHUB_REPO_URL: string\n\n constructor() {\n this.BEE_API_HOST =\n sessionStorage.getItem('api_host') || getProcessEnv('REACT_APP_BEE_HOST') || 'http://localhost:1633'\n this.BEE_DEBUG_API_HOST =\n sessionStorage.getItem('debug_api_host') || getProcessEnv('REACT_APP_BEE_DEBUG_HOST') || 'http://localhost:1635'\n this.BLOCKCHAIN_EXPLORER_URL =\n getProcessEnv('REACT_APP_BLOCKCHAIN_EXPLORER_URL') || 'https://blockscout.com/xdai/mainnet'\n this.BEE_DOCS_HOST = getProcessEnv('REACT_APP_BEE_DOCS_HOST') || 'https://docs.ethswarm.org/docs/'\n this.BEE_DISCORD_HOST = getProcessEnv('REACT_APP_BEE_DISCORD_HOST') || 'https://discord.gg/eKr9XPv7'\n this.GITHUB_REPO_URL =\n getProcessEnv('REACT_APP_BEE_GITHUB_REPO_URL') || 'https://api.github.com/repos/ethersphere/bee'\n }\n}\n\nexport const config = new Config()\n\nexport default config\n","import { Component, ErrorInfo, ReactElement } from 'react'\n\ninterface Props {\n children: ReactElement\n}\n\ninterface State {\n error: Error | null\n}\n\nexport default class ErrorBoundary extends Component {\n constructor(props: Props) {\n super(props)\n this.state = { error: null }\n }\n\n static getDerivedStateFromError(error: Error): { error: Error } {\n // Update state so the next render will show the fallback UI.\n return { error }\n }\n\n componentDidCatch(error: Error, errorInfo: ErrorInfo): void {\n // You can also log the error to an error reporting service\n console.error({ error, errorInfo }) // eslint-disable-line\n }\n\n render(): ReactElement {\n if (this.state.error) {\n // You can render any custom fallback UI\n return

    Something went wrong. Error: {this.state.error.message}

    \n }\n\n return this.props.children\n }\n}\n","import { Bee, BeeDebug } from '@ethersphere/bee-js'\nimport { createContext, ReactChild, ReactElement, useEffect, useState } from 'react'\nimport { config } from '../config'\n\ninterface ContextInterface {\n apiUrl: string\n apiDebugUrl: string\n beeApi: Bee | null\n beeDebugApi: BeeDebug | null\n setApiUrl: (url: string) => void\n setDebugApiUrl: (url: string) => void\n lockedApiSettings: boolean\n}\n\nconst initialValues: ContextInterface = {\n apiUrl: config.BEE_API_HOST,\n apiDebugUrl: config.BEE_DEBUG_API_HOST,\n beeApi: null,\n beeDebugApi: null,\n setApiUrl: () => {}, // eslint-disable-line\n setDebugApiUrl: () => {}, // eslint-disable-line\n lockedApiSettings: false,\n}\n\nexport const Context = createContext(initialValues)\nexport const Consumer = Context.Consumer\n\ninterface Props {\n children: ReactChild\n beeApiUrl?: string\n beeDebugApiUrl?: string\n lockedApiSettings?: boolean\n}\n\nexport function Provider({\n children,\n beeApiUrl,\n beeDebugApiUrl,\n lockedApiSettings: extLockedApiSettings,\n}: Props): ReactElement {\n const [apiUrl, setApiUrl] = useState(initialValues.apiUrl)\n const [apiDebugUrl, setDebugApiUrl] = useState(initialValues.apiDebugUrl)\n const [beeApi, setBeeApi] = useState(null)\n const [beeDebugApi, setBeeDebugApi] = useState(null)\n const [lockedApiSettings] = useState(Boolean(extLockedApiSettings))\n\n const url = beeApiUrl || apiUrl\n const debugUrl = beeDebugApiUrl || apiDebugUrl\n\n useEffect(() => {\n try {\n setBeeApi(new Bee(url))\n sessionStorage.setItem('api_host', url)\n } catch (e) {\n setBeeApi(null)\n }\n }, [url])\n\n useEffect(() => {\n try {\n setBeeDebugApi(new BeeDebug(debugUrl))\n sessionStorage.setItem('debug_api_host', debugUrl)\n } catch (e) {\n setBeeDebugApi(null)\n }\n }, [debugUrl])\n\n return (\n \n {children}\n \n )\n}\n","import type {\n ChainState,\n ChequebookAddressResponse,\n Health,\n LastChequesResponse,\n NodeAddresses,\n NodesInfo,\n Peer,\n Topology,\n} from '@ethersphere/bee-js'\nimport { createContext, ReactChild, ReactElement, useContext, useEffect, useState } from 'react'\nimport semver from 'semver'\nimport { engines } from '../../package.json'\nimport { useLatestBeeRelease } from '../hooks/apiHooks'\nimport { Token } from '../models/Token'\nimport type { Balance, ChequebookBalance, Settlements } from '../types'\nimport { Context as SettingsContext } from './Settings'\n\ninterface Status {\n all: boolean\n version: boolean\n blockchainConnection: boolean\n debugApiConnection: boolean\n apiConnection: boolean\n topology: boolean\n chequebook: boolean\n}\n\ninterface ContextInterface {\n status: Status\n latestPublishedVersion?: string\n latestUserVersion?: string\n latestUserVersionExact?: string\n isLatestBeeVersion: boolean\n latestBeeVersionUrl: string\n error: Error | null\n apiHealth: boolean\n debugApiHealth: Health | null\n nodeAddresses: NodeAddresses | null\n nodeInfo: NodesInfo | null\n topology: Topology | null\n chequebookAddress: ChequebookAddressResponse | null\n peers: Peer[] | null\n chequebookBalance: ChequebookBalance | null\n peerBalances: Balance[] | null\n peerCheques: LastChequesResponse | null\n settlements: Settlements | null\n chainState: ChainState | null\n latestBeeRelease: LatestBeeRelease | null\n isLoading: boolean\n isRefreshing: boolean\n lastUpdate: number | null\n start: (frequency?: number) => void\n stop: () => void\n refresh: () => Promise\n}\n\nconst startedInDevMode = window.location.search.includes('devMode=1')\n\nconst initialValues: ContextInterface = {\n status: {\n all: false,\n version: false,\n blockchainConnection: false,\n debugApiConnection: false,\n apiConnection: false,\n topology: false,\n chequebook: false,\n },\n latestPublishedVersion: undefined,\n latestUserVersion: undefined,\n latestUserVersionExact: undefined,\n isLatestBeeVersion: false,\n latestBeeVersionUrl: 'https://github.com/ethersphere/bee/releases/latest',\n error: null,\n apiHealth: false,\n debugApiHealth: null,\n nodeAddresses: null,\n nodeInfo: null,\n topology: null,\n chequebookAddress: null,\n peers: null,\n chequebookBalance: null,\n peerBalances: null,\n peerCheques: null,\n settlements: null,\n chainState: null,\n latestBeeRelease: null,\n isLoading: true,\n isRefreshing: false,\n lastUpdate: null,\n start: () => {}, // eslint-disable-line\n stop: () => {}, // eslint-disable-line\n refresh: () => Promise.reject(),\n}\n\nexport const Context = createContext(initialValues)\nexport const Consumer = Context.Consumer\n\ninterface Props {\n children: ReactChild\n}\n\nfunction getStatus(\n debugApiHealth: Health | null,\n nodeAddresses: NodeAddresses | null,\n nodeInfo: NodesInfo | null,\n apiHealth: boolean,\n topology: Topology | null,\n chequebookAddress: ChequebookAddressResponse | null,\n chequebookBalance: ChequebookBalance | null,\n error: Error | null,\n): Status {\n // FIXME: `devMode` is a temporary workaround to be able to develop with only one node\n const devMode = startedInDevMode || Boolean(process.env.REACT_APP_DEV_MODE) || nodeInfo?.beeMode === 'dev'\n const status = {\n version: Boolean(\n debugApiHealth &&\n semver.satisfies(debugApiHealth.version, engines.bee, {\n includePrerelease: true,\n }),\n ),\n blockchainConnection: Boolean(nodeAddresses?.ethereum),\n debugApiConnection: Boolean(debugApiHealth?.status === 'ok'),\n apiConnection: apiHealth,\n topology: Boolean(topology?.connected && topology?.connected > 0) || devMode,\n chequebook:\n (Boolean(chequebookAddress?.chequebookAddress) &&\n chequebookBalance !== null &&\n chequebookBalance?.totalBalance.toBigNumber.isGreaterThan(0)) ||\n devMode,\n }\n\n return { ...status, all: !error && Object.values(status).every(v => v) }\n}\n\nexport function Provider({ children }: Props): ReactElement {\n const { beeApi, beeDebugApi } = useContext(SettingsContext)\n const [apiHealth, setApiHealth] = useState(false)\n const [debugApiHealth, setDebugApiHealth] = useState(null)\n const [nodeAddresses, setNodeAddresses] = useState(null)\n const [nodeInfo, setNodeInfo] = useState(null)\n const [topology, setNodeTopology] = useState(null)\n const [chequebookAddress, setChequebookAddress] = useState(null)\n const [peers, setPeers] = useState(null)\n const [chequebookBalance, setChequebookBalance] = useState(null)\n const [peerBalances, setPeerBalances] = useState(null)\n const [peerCheques, setPeerCheques] = useState(null)\n const [settlements, setSettlements] = useState(null)\n const [chainState, setChainState] = useState(null)\n\n const { latestBeeRelease } = useLatestBeeRelease()\n\n const [error, setError] = useState(initialValues.error)\n const [isLoading, setIsLoading] = useState(initialValues.isLoading)\n const [isRefreshing, setIsRefreshing] = useState(initialValues.isRefreshing)\n const [lastUpdate, setLastUpdate] = useState(initialValues.lastUpdate)\n const [frequency, setFrequency] = useState(30000)\n\n const latestPublishedVersion = semver.coerce(latestBeeRelease?.name)?.version\n const latestUserVersion = semver.coerce(debugApiHealth?.version)?.version\n const latestUserVersionExact = debugApiHealth?.version\n\n useEffect(() => {\n setIsLoading(true)\n\n setApiHealth(false)\n\n refresh()\n }, [beeApi]) // eslint-disable-line react-hooks/exhaustive-deps\n\n useEffect(() => {\n setIsLoading(true)\n\n setDebugApiHealth(null)\n setNodeAddresses(null)\n setNodeTopology(null)\n setNodeInfo(null)\n setPeers(null)\n setChequebookAddress(null)\n setChequebookBalance(null)\n setPeerBalances(null)\n setPeerCheques(null)\n setSettlements(null)\n setChainState(null)\n\n refresh()\n }, [beeDebugApi]) // eslint-disable-line react-hooks/exhaustive-deps\n\n const refresh = async () => {\n // Don't want to refresh when already refreshing\n if (isRefreshing) return\n\n // Not a valid bee api\n if (!beeApi || !beeDebugApi) {\n setIsLoading(false)\n\n return\n }\n\n try {\n setIsRefreshing(true)\n setError(null)\n\n // Wrap the chequebook balance call to return BZZ values as Token object\n const chequeBalanceWrapper = async () => {\n const { totalBalance, availableBalance } = await beeDebugApi.getChequebookBalance()\n\n return {\n totalBalance: new Token(totalBalance),\n availableBalance: new Token(availableBalance),\n }\n }\n\n // Wrap the balances call to return BZZ values as Token object\n const peerBalanceWrapper = async () => {\n const { balances } = await beeDebugApi.getAllBalances()\n\n return balances.map(({ peer, balance }) => ({ peer, balance: new Token(balance) }))\n }\n\n // Wrap the settlements call to return BZZ values as Token object\n const settlementsWrapper = async () => {\n const { totalReceived, settlements, totalSent } = await beeDebugApi.getAllSettlements()\n\n return {\n totalReceived: new Token(totalReceived),\n totalSent: new Token(totalSent),\n settlements: settlements.map(({ peer, received, sent }) => ({\n peer,\n received: new Token(received),\n sent: new Token(sent),\n })),\n }\n }\n\n const promises = [\n // API health\n beeApi\n .isConnected()\n .then(setApiHealth)\n .catch(() => setApiHealth(false)),\n\n // Debug API health\n beeDebugApi\n .getHealth()\n .then(setDebugApiHealth)\n .catch(() => setDebugApiHealth(null)),\n\n // Node Addresses\n beeDebugApi\n .getNodeAddresses()\n .then(setNodeAddresses)\n .catch(() => setNodeAddresses(null)),\n\n // NodeInfo\n beeDebugApi\n .getNodeInfo()\n .then(setNodeInfo)\n .catch(() => setNodeInfo(null)),\n\n // Network Topology\n beeDebugApi\n .getTopology()\n .then(setNodeTopology)\n .catch(() => setNodeTopology(null)),\n\n // Peers\n beeDebugApi\n .getPeers()\n .then(setPeers)\n .catch(() => setPeers(null)),\n\n // Chequebook address\n beeDebugApi\n .getChequebookAddress()\n .then(setChequebookAddress)\n .catch(() => setChequebookAddress(null)),\n\n // Cheques\n beeDebugApi\n .getLastCheques()\n .then(setPeerCheques)\n .catch(() => setPeerCheques(null)),\n\n // Chain state\n beeDebugApi\n .getChainState()\n .then(setChainState)\n .catch(() => setChainState(null)),\n\n // Chequebook balance\n chequeBalanceWrapper()\n .then(setChequebookBalance)\n .catch(() => setChequebookBalance(null)),\n\n // Peer balances\n peerBalanceWrapper()\n .then(setPeerBalances)\n .catch(() => setPeerBalances(null)),\n\n // Settlements\n settlementsWrapper()\n .then(setSettlements)\n .catch(() => setSettlements(null)),\n ]\n\n await Promise.allSettled(promises)\n } catch (e) {\n setError(e as Error)\n } finally {\n setIsLoading(false)\n setIsRefreshing(false)\n setLastUpdate(Date.now())\n }\n }\n\n const start = (freq = 30000) => setFrequency(freq)\n const stop = () => setFrequency(null)\n\n // Start the update loop\n useEffect(() => {\n refresh()\n\n // Start autorefresh only if the frequency is set\n if (frequency) {\n const interval = setInterval(refresh, frequency)\n\n return () => clearInterval(interval)\n }\n }, [frequency, beeDebugApi, beeApi]) // eslint-disable-line react-hooks/exhaustive-deps\n\n return (\n \n {children}\n \n )\n}\n","import axios from 'axios'\nimport { useEffect, useState } from 'react'\nimport { config } from '../config'\n\nexport interface LatestBeeReleaseHook {\n latestBeeRelease: LatestBeeRelease | null\n isLoadingLatestBeeRelease: boolean\n error: Error | null\n}\n\nexport const useLatestBeeRelease = (): LatestBeeReleaseHook => {\n const [latestBeeRelease, setLatestBeeRelease] = useState(null)\n const [isLoadingLatestBeeRelease, setLoading] = useState(false)\n const [error, setError] = useState(null)\n\n useEffect(() => {\n axios\n .get(`${config.GITHUB_REPO_URL}/releases/latest`)\n .then(res => {\n setLatestBeeRelease(res.data)\n })\n .catch((error: Error) => {\n setError(error)\n })\n .finally(() => {\n setLoading(false)\n })\n }, [])\n\n return { latestBeeRelease, isLoadingLatestBeeRelease, error }\n}\n","import { ReactElement, useState, useContext } from 'react'\nimport { makeStyles, Theme, createStyles } from '@material-ui/core/styles'\nimport { Alert, AlertTitle } from '@material-ui/lab'\nimport Collapse from '@material-ui/core/Collapse'\nimport IconButton from '@material-ui/core/IconButton'\nimport CloseIcon from '@material-ui/icons/Close'\nimport { Context } from '../providers/Bee'\nimport { SUPPORTED_BEE_VERSION_EXACT } from '@ethersphere/bee-js'\n\nconst useStyles = makeStyles((theme: Theme) =>\n createStyles({\n root: {\n width: '100%',\n marginBottom: theme.spacing(2),\n },\n }),\n)\n\nexport default function VersionAlert(): ReactElement | null {\n const classes = useStyles()\n const { isLoading, latestUserVersionExact } = useContext(Context)\n const [open, setOpen] = useState(true)\n\n const isExactlySupportedBeeVersion = SUPPORTED_BEE_VERSION_EXACT === latestUserVersionExact\n\n if (isLoading || !latestUserVersionExact) return null\n\n return (\n \n
    \n {\n setOpen(false)\n }}\n >\n \n \n }\n >\n Warning\n Your Bee node version ({latestUserVersionExact}) does not exactly match the Bee version we tested\n the Bee Dashboard against ({SUPPORTED_BEE_VERSION_EXACT}). Please note that some functionality\n may not work properly.\n \n
    \n
    \n )\n}\n","export default __webpack_public_path__ + \"static/media/logo.3d1155fe.svg\";","import { ReactElement, ReactNode, useState } from 'react'\nimport { makeStyles, Theme, createStyles } from '@material-ui/core/styles'\nimport { Collapse, ListItem, ListItemText, Typography } from '@material-ui/core'\nimport { ExpandLess, ExpandMore } from '@material-ui/icons'\n\nconst useStyles = makeStyles((theme: Theme) =>\n createStyles({\n root: {\n width: '100%',\n padding: 0,\n margin: 0,\n marginTop: theme.spacing(4),\n '&:first-child': {\n marginTop: 0,\n },\n },\n rootLevel1: { marginTop: theme.spacing(1) },\n rootLevel2: { marginTop: theme.spacing(0.5) },\n header: {\n backgroundColor: theme.palette.background.paper,\n },\n contentLevel0: {\n marginTop: theme.spacing(1),\n },\n contentLevel12: {\n marginTop: theme.spacing(0.25),\n },\n infoText: {\n color: '#c9c9c9',\n },\n }),\n)\n\ninterface Props {\n children?: ReactNode\n label: ReactNode\n info?: ReactNode\n level?: 0 | 1 | 2\n defaultOpen?: boolean\n}\n\nexport default function ExpandableList({ children, label, level, defaultOpen, info }: Props): ReactElement | null {\n const classes = useStyles()\n const [open, setOpen] = useState(Boolean(defaultOpen))\n\n const handleClick = () => {\n setOpen(!open)\n }\n\n let rootLevelClass = ''\n let typographyVariant: 'h1' | 'h2' | 'h3' = 'h1'\n let contentLevelClass = classes.contentLevel0\n\n if (level === 1) {\n rootLevelClass = classes.rootLevel1\n typographyVariant = 'h2'\n contentLevelClass = classes.contentLevel12\n } else if (level === 2) {\n rootLevelClass = classes.rootLevel2\n typographyVariant = 'h3'\n contentLevelClass = classes.contentLevel12\n }\n\n return (\n
    \n \n {label}} />\n
    \n {!open && (\n \n {info}\n \n )}\n {open ? : }\n
    \n
    \n \n
    {children}
    \n
    \n
    \n )\n}\n","import { ReactElement, ReactNode } from 'react'\nimport { makeStyles, Theme, createStyles } from '@material-ui/core/styles'\nimport { Typography, Grid, IconButton, Tooltip } from '@material-ui/core'\nimport { Info } from 'react-feather'\nimport ListItem from '@material-ui/core/ListItem'\n\nconst useStyles = makeStyles((theme: Theme) =>\n createStyles({\n header: {\n backgroundColor: theme.palette.background.paper,\n marginBottom: theme.spacing(0.25),\n wordBreak: 'break-word',\n },\n copyValue: {\n cursor: 'pointer',\n padding: theme.spacing(1),\n borderRadius: 0,\n '&:hover': {\n backgroundColor: '#fcf2e8',\n color: theme.palette.primary.main,\n },\n },\n }),\n)\n\ninterface Props {\n label?: ReactNode\n value?: ReactNode\n tooltip?: string\n}\n\nexport default function ExpandableListItem({ label, value, tooltip }: Props): ReactElement | null {\n const classes = useStyles()\n\n return (\n \n \n {label && {label}}\n {value && (\n \n {value}\n {tooltip && (\n \n \n \n \n \n )}\n \n )}\n \n \n )\n}\n","import { Grid } from '@material-ui/core'\nimport { createStyles, makeStyles, Theme } from '@material-ui/core/styles'\nimport { ReactElement, ReactNode } from 'react'\n\nconst useStyles = makeStyles((theme: Theme) =>\n createStyles({\n wrapper: {\n display: 'flex',\n flexDirection: 'row',\n flexWrap: 'wrap',\n },\n action: {\n marginBottom: theme.spacing(1),\n marginRight: theme.spacing(1),\n },\n }),\n)\n\ninterface Props {\n children: ReactNode | ReactNode[]\n}\n\nexport default function ExpandableListItemActions({ children }: Props): ReactElement | null {\n const classes = useStyles()\n\n if (Array.isArray(children)) {\n return (\n
    \n {children\n // Exclude falsy values to allow conditional rendering\n .filter(x => x)\n .map((a, i) => (\n
    \n {a}\n
    \n ))}\n
    \n )\n }\n\n return (\n \n {children}\n \n )\n}\n","import { Grid, IconButton, ListItem, Tooltip, Typography } from '@material-ui/core'\nimport Collapse from '@material-ui/core/Collapse'\nimport { createStyles, makeStyles, Theme } from '@material-ui/core/styles'\nimport { ReactElement, useState } from 'react'\nimport { CopyToClipboard } from 'react-copy-to-clipboard'\nimport { Eye, Minus } from 'react-feather'\n\nconst useStyles = makeStyles((theme: Theme) =>\n createStyles({\n header: {\n backgroundColor: theme.palette.background.paper,\n marginBottom: theme.spacing(0.25),\n borderLeft: `${theme.spacing(0.25)}px solid rgba(0,0,0,0)`,\n wordBreak: 'break-word',\n },\n headerOpen: {\n borderLeft: `${theme.spacing(0.25)}px solid ${theme.palette.primary.main}`,\n },\n copyValue: {\n cursor: 'pointer',\n padding: theme.spacing(1),\n borderRadius: 0,\n '&:hover': {\n backgroundColor: '#fcf2e8',\n color: theme.palette.primary.main,\n },\n },\n content: {\n marginTop: theme.spacing(2),\n marginBottom: theme.spacing(2),\n },\n keyMargin: {\n marginRight: theme.spacing(1),\n },\n }),\n)\n\ninterface Props {\n label: string\n value: string\n}\n\nconst lengthWithoutPrefix = (s: string) => s.replace(/^0x/i, '').length\n\nfunction isPrefixedHexString(s: unknown): boolean {\n return typeof s === 'string' && /^0x[0-9a-f]+$/i.test(s)\n}\n\nconst split = (s: string): string[] => {\n const nonPrefixLength = lengthWithoutPrefix(s)\n\n if (nonPrefixLength % 6 === 0) return s.match(/(0x|.{6})/gi) || []\n\n return s.match(/(0x|.{1,8})/gi) || []\n}\n\nexport default function ExpandableListItemKey({ label, value }: Props): ReactElement | null {\n const classes = useStyles()\n const [open, setOpen] = useState(false)\n const [copied, setCopied] = useState(false)\n const toggleOpen = () => setOpen(!open)\n\n const tooltipClickHandler = () => setCopied(true)\n const tooltipCloseHandler = () => setCopied(false)\n\n const splitValues = split(value)\n const hasPrefix = isPrefixedHexString(value)\n const spanText = `${hasPrefix ? `${splitValues[0]} ${splitValues[1]}` : splitValues[0]}[…]${\n splitValues[splitValues.length - 1]\n }`\n\n return (\n \n \n \n {label && {label}}\n \n
    \n {!open && (\n \n \n \n {value ? spanText : ''}\n \n \n \n )}\n \n {open ? : }\n \n
    \n
    \n
    \n \n
    \n \n \n {/* This has to be wrapped in two spans otherwise either the tooltip or the highlighting does not work*/}\n \n \n {splitValues.map((s, i) => (\n \n {s}\n \n ))}\n \n \n \n \n
    \n
    \n
    \n
    \n )\n}\n","import type { ReactElement } from 'react'\nimport IconButton from '@material-ui/core/IconButton'\nimport { CopyToClipboard } from 'react-copy-to-clipboard'\nimport { Clipboard } from 'react-feather'\nimport { useSnackbar } from 'notistack'\n\ninterface Props {\n value: string\n}\n\nexport default function ClipboardCopy({ value }: Props): ReactElement {\n const { enqueueSnackbar } = useSnackbar()\n const handleCopy = () => enqueueSnackbar(`Copied: ${value}`, { variant: 'success' })\n\n return (\n
    \n \n \n \n \n \n
    \n )\n}\n","import { ReactElement, useState } from 'react'\nimport QRCode from 'qrcode.react'\nimport { IconButton, Dialog, DialogTitle } from '@material-ui/core'\nimport { FilterCenterFocusSharp } from '@material-ui/icons'\n\ninterface Props {\n value: string\n label: string\n}\n\nexport default function QRCodeModal(props: Props): ReactElement {\n const [open, setOpen] = useState(false)\n\n const handleOpen = () => {\n setOpen(true)\n }\n\n const handleClose = () => {\n setOpen(false)\n }\n\n return (\n
    \n \n \n \n \n
    \n {props.label}\n \n
    \n
    \n
    \n )\n}\n","import { Typography } from '@material-ui/core/'\nimport { ReactElement } from 'react'\nimport Identicon from 'react-identicons'\nimport { config } from '../config'\nimport ClipboardCopy from './ClipboardCopy'\nimport QRCodeModal from './QRCodeModal'\n\ninterface Props {\n address: string | undefined\n hideBlockie?: boolean\n transaction?: boolean\n truncate?: boolean\n}\n\nexport default function EthereumAddress(props: Props): ReactElement {\n return (\n \n {props.address ? (\n
    \n {props.hideBlockie ? null : (\n
    \n \n
    \n )}\n
    \n \n {props.address}\n \n
    \n \n \n
    \n ) : (\n '-'\n )}\n
    \n )\n}\n","import { CircularProgress, Container } from '@material-ui/core'\nimport Button from '@material-ui/core/Button'\nimport Dialog from '@material-ui/core/Dialog'\nimport DialogActions from '@material-ui/core/DialogActions'\nimport DialogContent from '@material-ui/core/DialogContent'\nimport DialogContentText from '@material-ui/core/DialogContentText'\nimport DialogTitle from '@material-ui/core/DialogTitle'\nimport { useSnackbar } from 'notistack'\nimport { ReactElement, useState, useContext } from 'react'\nimport { Zap } from 'react-feather'\nimport { Context as SettingsContext } from '../providers/Settings'\nimport EthereumAddress from './EthereumAddress'\n\ninterface Props {\n peerId: string\n uncashedAmount: string\n}\n\nexport default function CheckoutModal({ peerId, uncashedAmount }: Props): ReactElement {\n const [open, setOpen] = useState(false)\n const [loadingCashout, setLoadingCashout] = useState(false)\n const { enqueueSnackbar } = useSnackbar()\n const { beeDebugApi } = useContext(SettingsContext)\n\n const handleClickOpen = () => {\n setOpen(true)\n }\n\n const handleClose = () => {\n setOpen(false)\n }\n\n const handleCashout = () => {\n if (!beeDebugApi) return\n\n if (peerId) {\n setLoadingCashout(true)\n beeDebugApi\n .cashoutLastCheque(peerId)\n .then(res => {\n setOpen(false)\n enqueueSnackbar(\n \n Successfully cashed out cheque. Transaction\n \n ,\n { variant: 'success' },\n )\n })\n .catch((e: Error) => {\n enqueueSnackbar(Error: {e.message}, { variant: 'error' })\n })\n .finally(() => {\n setLoadingCashout(false)\n })\n } else {\n enqueueSnackbar(Peer Id invalid, { variant: 'error' })\n }\n }\n\n return (\n
    \n \n \n Cashout Cheque\n \n \n {loadingCashout && (\n <>\n \n Cashing out {uncashedAmount} from Peer {peerId}. Please wait...\n \n \n \n \n \n )}\n {!loadingCashout && (\n \n Are you sure you want to cashout {uncashedAmount} BZZ from Peer{' '}\n {peerId}?\n \n )}\n \n \n \n \n \n \n \n
    \n )\n}\n","import type { ReactElement } from 'react'\n\nimport ExpandableList from '../../components/ExpandableList'\nimport ExpandableListItem from '../../components/ExpandableListItem'\nimport ExpandableListItemActions from '../../components/ExpandableListItemActions'\nimport ExpandableListItemKey from '../../components/ExpandableListItemKey'\n\nimport CashoutModal from '../../components/CashoutModal'\nimport { Accounting } from '../../hooks/accounting'\nimport type { Token } from '../../models/Token'\n\ninterface Props {\n isLoadingUncashed: boolean\n totalUncashed: Token\n accounting: Accounting[] | null\n}\n\nexport default function PeerBalances({ accounting, isLoadingUncashed, totalUncashed }: Props): ReactElement | null {\n return (\n \n \n {accounting?.map(({ peer, balance, received, sent, uncashedAmount, total }) => (\n \n \n \n \n \n \n {uncashedAmount.toBigNumber.isGreaterThan('0') && (\n \n \n \n )}\n \n ))}\n \n )\n}\n","import { Button, Grid, Link as MuiLink, Typography } from '@material-ui/core/'\nimport { createStyles, makeStyles, Theme } from '@material-ui/core/styles'\nimport type { ReactElement } from 'react'\nimport { Activity } from 'react-feather'\nimport { Link } from 'react-router-dom'\nimport { config } from '../config'\nimport { ROUTES } from '../routes'\n\nconst useStyles = makeStyles((theme: Theme) =>\n createStyles({\n root: {\n height: '100%',\n },\n content: {\n maxWidth: 500,\n marginBottom: theme.spacing(4),\n '&:last-child': {\n marginBottom: 0,\n },\n },\n icon: {\n height: '1rem',\n },\n }),\n)\n\nexport default function TroubleshootConnectionCard(): ReactElement {\n const classes = useStyles()\n\n return (\n \n \n \n Uh oh, it looks like your node is not connected.\n \n \n \n \n Please check your node status to fix the problem. You can also check out the{' '}\n \n Swarm Bee Docs\n {' '}\n or ask for support on the{' '}\n \n Ethereum Swarm Discord\n \n .\n \n \n \n \n }\n to={ROUTES.STATUS}\n >\n Check node status\n \n \n \n \n )\n}\n","import { LastCashoutActionResponse, BeeDebug } from '@ethersphere/bee-js'\nimport { useEffect, useState } from 'react'\nimport { Token } from '../models/Token'\nimport { makeRetriablePromise, unwrapPromiseSettlements } from '../utils'\nimport { Balance, Settlements, Settlement } from '../types'\n\ninterface UseAccountingHook {\n isLoadingUncashed: boolean\n totalUncashed: Token\n accounting: Accounting[] | null\n}\n\nexport interface Accounting {\n peer: string\n uncashedAmount: Token\n balance: Token\n received: Token\n sent: Token\n total: Token\n}\n\n/**\n * Merges the balances, settlements and uncashedAmounts arrays into single array which is sorted by uncashed amounts (if any)\n *\n * @param balances Balances for all peers\n * @param settlements Settlements for all peers which has some settlement\n * @param uncashedAmounts Array of getPeerLastCashout responses which is needed to calculate uncashed amount\n *\n * @returns\n */\nfunction mergeAccounting(\n balances: Balance[] | null,\n settlements?: Settlement[],\n uncashedAmounts?: LastCashoutActionResponse[],\n): Accounting[] | null {\n // Settlements or balances are still loading or there is an error -> return null\n if (!balances || !settlements) return null\n\n const accounting: Record = {}\n\n balances.forEach(\n // Some peers may not have settlement but all have balance (therefore initialize sent, received and uncashed to 0)\n ({ peer, balance }) =>\n (accounting[peer] = {\n peer,\n balance,\n sent: new Token('0'),\n received: new Token('0'),\n uncashedAmount: new Token('0'),\n total: balance,\n }),\n )\n\n settlements.forEach(\n ({ peer, sent, received }) =>\n (accounting[peer] = {\n ...accounting[peer],\n sent,\n received,\n total: new Token(accounting[peer].balance.toBigNumber.plus(received.toBigNumber).minus(sent.toBigNumber)),\n }),\n )\n\n // If there are no cheques (and hence last cashout actions)\n if (!uncashedAmounts) return Object.values(accounting).sort((a, b) => (a.peer < b.peer ? -1 : 1))\n\n uncashedAmounts?.forEach(({ peer, uncashedAmount }) => {\n accounting[peer].uncashedAmount = new Token(uncashedAmount)\n })\n\n // Return sorted by the uncashed amount first and then by the peer id\n return Object.values(accounting).sort((a, b) => {\n const diff = b.uncashedAmount.toBigNumber.minus(a.uncashedAmount.toBigNumber).toNumber()\n\n if (diff !== 0) return diff\n\n return a.peer < b.peer ? -1 : 1\n })\n}\n\nexport const useAccounting = (\n beeDebugApi: BeeDebug | null,\n settlements: Settlements | null,\n balances: Balance[] | null,\n): UseAccountingHook => {\n const [isLoadingUncashed, setIsloadingUncashed] = useState(false)\n const [uncashedAmounts, setUncashedAmounts] = useState(undefined)\n\n useEffect(() => {\n // We don't have any settlements loaded yet or we are already loading/have loaded the uncashed amounts\n if (isLoadingUncashed || !beeDebugApi || !settlements || uncashedAmounts) return\n\n setIsloadingUncashed(true)\n const promises = settlements.settlements\n .filter(({ received }) => received.toBigNumber.gt('0'))\n .map(({ peer }) => makeRetriablePromise(() => beeDebugApi.getLastCashoutAction(peer)))\n\n Promise.allSettled(promises).then(settlements => {\n const results = unwrapPromiseSettlements(settlements)\n setUncashedAmounts(results.fulfilled)\n setIsloadingUncashed(false)\n })\n }, [settlements, isLoadingUncashed, uncashedAmounts, beeDebugApi])\n\n const accounting = mergeAccounting(balances, settlements?.settlements, uncashedAmounts)\n\n let totalUncashed: Token = new Token('0')\n accounting?.forEach(\n ({ uncashedAmount }) => (totalUncashed = new Token(totalUncashed.toBigNumber.plus(uncashedAmount.toBigNumber))),\n )\n\n return {\n isLoadingUncashed,\n totalUncashed,\n accounting,\n }\n}\n","import { ReactElement, ReactNode, useState } from 'react'\nimport Button from '@material-ui/core/Button'\nimport Input from '@material-ui/core/Input'\nimport Dialog from '@material-ui/core/Dialog'\nimport DialogActions from '@material-ui/core/DialogActions'\nimport DialogContent from '@material-ui/core/DialogContent'\nimport DialogContentText from '@material-ui/core/DialogContentText'\nimport DialogTitle from '@material-ui/core/DialogTitle'\nimport FormHelperText from '@material-ui/core/FormHelperText'\nimport { Token } from '../models/Token'\nimport type { BigNumber } from 'bignumber.js'\nimport { useSnackbar } from 'notistack'\n\ninterface Props {\n successMessage: string\n errorMessage: string\n dialogMessage: string\n label: string\n max?: BigNumber\n min?: BigNumber\n action: (amount: bigint) => Promise\n icon?: ReactNode\n}\n\nexport default function WithdrawDepositModal({\n successMessage,\n errorMessage,\n dialogMessage,\n min,\n max,\n label,\n action,\n icon,\n}: Props): ReactElement {\n const [open, setOpen] = useState(false)\n const [amount, setAmount] = useState('')\n const [amountToken, setAmountToken] = useState(null)\n const [amountError, setAmountError] = useState(null)\n const { enqueueSnackbar } = useSnackbar()\n\n const handleClickOpen = (e: React.MouseEvent) => {\n setOpen(true)\n e.stopPropagation()\n }\n\n const handleClose = () => {\n setOpen(false)\n }\n\n const handleAction = async () => {\n if (amountToken === null) return\n\n try {\n const transactionHash = await action(amountToken.toBigInt as bigint)\n setOpen(false)\n enqueueSnackbar(`${successMessage} Transaction ${transactionHash}`, { variant: 'success' })\n } catch (e) {\n enqueueSnackbar(`${errorMessage} Error: ${(e as Error).message}`, { variant: 'error' })\n }\n }\n\n const handleChange = (e: React.ChangeEvent) => {\n const value = e.target.value\n setAmount(value)\n setAmountError(null)\n try {\n const t = Token.fromDecimal(value)\n setAmountToken(t)\n\n if (min && t.toDecimal.isLessThan(min)) setAmountError(new Error(`Needs to be more than ${min}`))\n\n if (max && t.toDecimal.isGreaterThan(max)) setAmountError(new Error(`Needs to be less than ${max}`))\n } catch (e) {\n setAmountError(e as Error)\n }\n }\n\n return (\n
    \n \n \n {label}\n \n {dialogMessage}\n \n {amountError && (\n \n Please provide valid BZZ amount (max 16 decimals). Error: {amountError.message}\n \n )}\n \n \n \n \n \n \n
    \n )\n}\n","import { BigNumber } from 'bignumber.js'\nimport { ReactElement, useContext } from 'react'\nimport { Upload } from 'react-feather'\nimport WithdrawDepositModal from '../components/WithdrawDepositModal'\nimport { Context as SettingsContext } from '../providers/Settings'\n\nexport default function WithdrawModal(): ReactElement {\n const { beeDebugApi } = useContext(SettingsContext)\n\n return (\n }\n min={new BigNumber(0)}\n action={(amount: bigint) => {\n if (!beeDebugApi) throw new Error('Bee Debug URL is not valid')\n\n return beeDebugApi.withdrawTokens(amount.toString())\n }}\n />\n )\n}\n","import { ReactElement, useContext } from 'react'\nimport { Download } from 'react-feather'\nimport { Context as SettingsContext } from '../providers/Settings'\n\nimport WithdrawDepositModal from '../components/WithdrawDepositModal'\nimport { BigNumber } from 'bignumber.js'\n\nexport default function DepositModal(): ReactElement {\n const { beeDebugApi } = useContext(SettingsContext)\n\n return (\n }\n min={new BigNumber(0)}\n action={(amount: bigint) => {\n if (!beeDebugApi) throw new Error('Bee Debug URL is not valid')\n\n return beeDebugApi.depositTokens(amount.toString())\n }}\n />\n )\n}\n","import { ReactElement, useContext } from 'react'\n\nimport PeerBalances from './PeerBalances'\nimport TroubleshootConnectionCard from '../../components/TroubleshootConnectionCard'\nimport { Context as BeeContext } from '../../providers/Bee'\nimport { Context as SettingsContext } from '../../providers/Settings'\nimport { useAccounting } from '../../hooks/accounting'\nimport ExpandableList from '../../components/ExpandableList'\nimport ExpandableListItem from '../../components/ExpandableListItem'\nimport ExpandableListItemActions from '../../components/ExpandableListItemActions'\nimport ExpandableListItemKey from '../../components/ExpandableListItemKey'\nimport WithdrawModal from '../../containers/WithdrawModal'\nimport DepositModal from '../../containers/DepositModal'\n\nexport default function Accounting(): ReactElement {\n const { status, nodeAddresses, chequebookAddress, chequebookBalance, settlements, peerBalances } =\n useContext(BeeContext)\n const { beeDebugApi } = useContext(SettingsContext)\n\n const { accounting, totalUncashed, isLoadingUncashed } = useAccounting(beeDebugApi, settlements, peerBalances)\n\n if (!status.all) return \n\n return (\n
    \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n
    \n )\n}\n","import { Button, CircularProgress, createStyles, makeStyles } from '@material-ui/core'\nimport React, { ReactElement } from 'react'\nimport { IconProps } from 'react-feather'\n\ninterface Props {\n onClick: () => void\n iconType: React.ComponentType\n children: string\n className?: string\n disabled?: boolean\n loading?: boolean\n cancel?: boolean\n}\n\nconst useStyles = makeStyles(() =>\n createStyles({\n button: {\n height: '52px',\n position: 'relative',\n whiteSpace: 'nowrap',\n color: '#242424',\n '&:hover, &:focus': {\n '& svg': {\n stroke: '#fff',\n transition: '0.1s',\n },\n },\n },\n cancelButton: {\n background: '#f7f7f7',\n color: '#606060',\n },\n spinnerWrapper: {\n position: 'absolute',\n left: '50%',\n top: '50%',\n width: '40px',\n height: '40px',\n transform: 'translate(-50%, -50%)',\n },\n }),\n)\n\nexport function SwarmButton({\n children,\n onClick,\n iconType,\n className,\n disabled,\n loading,\n cancel,\n}: Props): ReactElement {\n const classes = useStyles()\n\n function getIconColor() {\n if (loading || disabled) {\n return 'rgba(0, 0, 0, 0.26)'\n }\n\n return cancel ? '#606060' : '#dd7700'\n }\n\n function getButtonClassName() {\n return [className, classes.button, cancel && classes.cancelButton].filter(x => x).join(' ')\n }\n\n const icon = React.createElement(iconType, {\n size: '1.25rem',\n color: getIconColor(),\n })\n\n return (\n ) => {\n onClick()\n event.currentTarget.blur()\n }}\n variant=\"contained\"\n startIcon={icon}\n disabled={disabled}\n >\n {children}\n {loading && (\n
    \n \n
    \n )}\n \n )\n}\n","import { createContext, ReactChild, ReactElement, useEffect, useState } from 'react'\n\nexport type IdentityType = 'V3' | 'PRIVATE_KEY'\n\nexport interface Identity {\n uuid: string\n name: string\n feedHash?: string\n identity: string\n address: string\n type: IdentityType\n}\n\ninterface ContextInterface {\n identities: Identity[]\n setIdentities: (identities: Identity[]) => void\n}\n\nconst initialValues: ContextInterface = {\n identities: [],\n setIdentities: () => {}, // eslint-disable-line\n}\n\nexport const Context = createContext(initialValues)\nexport const Consumer = Context.Consumer\n\ninterface Props {\n children: ReactChild\n}\n\nexport function Provider({ children }: Props): ReactElement {\n const [identities, setIdentities] = useState(initialValues.identities)\n\n useEffect(() => {\n try {\n setIdentities(JSON.parse(localStorage.getItem('feeds') || '[]'))\n } catch {\n setIdentities([])\n }\n }, []) // eslint-disable-line react-hooks/exhaustive-deps\n\n return {children}\n}\n","import { Box, Dialog, Grid } from '@material-ui/core'\nimport { ReactElement } from 'react'\n\ninterface Props {\n children: ReactElement | ReactElement[]\n}\n\nexport function SwarmDialog({ children }: Props): ReactElement {\n return (\n \n \n \n {children}\n \n \n \n )\n}\n","import { createStyles, makeStyles, Theme } from '@material-ui/core'\nimport { Close } from '@material-ui/icons'\nimport { ReactElement } from 'react'\n\ninterface Props {\n onClose: () => void\n}\n\nconst useStyles = makeStyles((theme: Theme) =>\n createStyles({\n wrapper: {\n padding: theme.spacing(1),\n cursor: 'pointer',\n },\n }),\n)\n\nexport function CloseButton({ onClose }: Props): ReactElement {\n const classes = useStyles()\n\n return (\n
    \n \n
    \n )\n}\n","import { createStyles, Grid, makeStyles, Typography } from '@material-ui/core'\nimport { ReactElement } from 'react'\nimport { CloseButton } from './CloseButton'\n\ninterface Props {\n children: string\n onClose: () => void\n}\n\nconst useStyles = makeStyles(() =>\n createStyles({\n text: {\n color: '#606060',\n fontWeight: 'bold',\n },\n }),\n)\n\nexport function TitleWithClose({ children, onClose }: Props): ReactElement {\n const classes = useStyles()\n\n return (\n \n  \n \n {children}\n \n \n \n )\n}\n","import { Box, Typography } from '@material-ui/core'\nimport { ReactElement } from 'react'\nimport { Trash, X } from 'react-feather'\nimport ExpandableListItemActions from '../../components/ExpandableListItemActions'\nimport { SwarmButton } from '../../components/SwarmButton'\nimport { SwarmDialog } from '../../components/SwarmDialog'\nimport { TitleWithClose } from '../../components/TitleWithClose'\nimport { Identity } from '../../providers/Feeds'\n\ninterface Props {\n identity: Identity\n onConfirm: (identity: Identity) => void\n onClose: () => void\n}\n\nexport function DeleteFeedDialog({ identity, onConfirm, onClose }: Props): ReactElement {\n return (\n \n \n Delete\n \n \n {`You are about to delete feed ${identity.name} Website. It is strongly advised to export this feed first.`}\n \n \n onConfirm(identity)}>\n Delete\n \n \n Cancel\n \n \n \n )\n}\n","import { createStyles, makeStyles, Theme } from '@material-ui/core'\nimport { ReactElement } from 'react'\n\ninterface Props {\n children: string\n prettify?: boolean\n}\n\nconst useStyles = makeStyles((theme: Theme) =>\n createStyles({\n wrapper: {\n overflow: 'scroll',\n background: '#ffffff',\n },\n pre: {\n maxHeight: '6em',\n padding: theme.spacing(2),\n },\n }),\n)\n\nfunction prettifyString(string: string): string {\n try {\n return JSON.stringify(JSON.parse(string), null, 4)\n } catch {\n return string\n }\n}\n\nexport function Code({ children, prettify }: Props): ReactElement {\n const classes = useStyles()\n\n return (\n
    \n
    {prettify ? prettifyString(children) : children}
    \n
    \n )\n}\n","import { Box, createStyles, makeStyles, Typography } from '@material-ui/core'\nimport { saveAs } from 'file-saver'\nimport { useSnackbar } from 'notistack'\nimport { ReactElement } from 'react'\nimport { Clipboard, Download } from 'react-feather'\nimport { Code } from '../../components/Code'\nimport ExpandableListItemActions from '../../components/ExpandableListItemActions'\nimport { SwarmButton } from '../../components/SwarmButton'\nimport { SwarmDialog } from '../../components/SwarmDialog'\nimport { TitleWithClose } from '../../components/TitleWithClose'\nimport { Identity } from '../../providers/Feeds'\n\ninterface Props {\n identity: Identity\n onClose: () => void\n}\n\nconst useStyles = makeStyles(() =>\n createStyles({\n wrapper: {\n maxWidth: '100%',\n },\n }),\n)\n\nexport function ExportFeedDialog({ identity, onClose }: Props): ReactElement {\n const { enqueueSnackbar } = useSnackbar()\n\n const classes = useStyles()\n\n function onDownload() {\n saveAs(\n new Blob([identity.identity], {\n type: 'application/json',\n }),\n identity.name + '.json',\n )\n }\n\n function getExportText() {\n return identity.type === 'V3' ? 'JSON file' : 'the private key string'\n }\n\n function onCopy() {\n navigator.clipboard\n .writeText(identity.identity)\n .then(() => enqueueSnackbar('Copied to Clipboard', { variant: 'success' }))\n }\n\n return (\n \n \n Export\n \n \n {`We exported the identity associated with this feed as ${getExportText()}.`}\n \n \n {identity.identity}\n \n \n \n Download JSON File\n \n \n Copy To Clipboard\n \n \n \n )\n}\n","import { createStyles, makeStyles, TextField as SimpleTextField, Theme } from '@material-ui/core'\nimport { Field } from 'formik'\nimport { TextField } from 'formik-material-ui'\nimport { ChangeEvent, ReactElement } from 'react'\n\ninterface Props {\n name: string\n label: string\n password?: boolean\n formik?: boolean\n optional?: boolean\n defaultValue?: string\n onChange?: (event: ChangeEvent) => void\n}\n\nconst useStyles = makeStyles((theme: Theme) =>\n createStyles({\n field: {\n background: theme.palette.background.paper,\n '& fieldset': {\n border: 0,\n },\n '& .Mui-focused': {\n background: theme.palette.background.paper,\n },\n '& .MuiInputBase-root': {\n background: theme.palette.background.paper,\n },\n '& .MuiFilledInput-root': {\n borderRadius: 0,\n },\n },\n }),\n)\n\nexport function SwarmTextInput({\n name,\n label,\n password,\n optional,\n formik,\n onChange,\n defaultValue,\n}: Props): ReactElement {\n const classes = useStyles()\n\n if (formik) {\n return (\n \n )\n }\n\n return (\n \n )\n}\n","import { Box, createStyles, makeStyles, TextareaAutosize, Theme } from '@material-ui/core'\nimport { useSnackbar } from 'notistack'\nimport React, { ReactElement, useContext, useRef, useState } from 'react'\nimport { Check, Upload } from 'react-feather'\nimport ExpandableListItemActions from '../../components/ExpandableListItemActions'\nimport { SwarmButton } from '../../components/SwarmButton'\nimport { SwarmDialog } from '../../components/SwarmDialog'\nimport { SwarmTextInput } from '../../components/SwarmTextInput'\nimport { TitleWithClose } from '../../components/TitleWithClose'\nimport { Context, Identity } from '../../providers/Feeds'\nimport { importIdentity, persistIdentity } from '../../utils/identity'\n\ninterface Props {\n onClose: () => void\n}\n\nconst useStyles = makeStyles((theme: Theme) =>\n createStyles({\n textarea: {\n width: '100%',\n border: 0,\n padding: theme.spacing(1),\n },\n displayNone: {\n display: 'none',\n },\n }),\n)\n\nexport function ImportFeedDialog({ onClose }: Props): ReactElement {\n const [textareaValue, setTextareaValue] = useState('')\n const [name, setName] = useState('')\n const fileInputRef = useRef(null)\n\n const { identities, setIdentities } = useContext(Context)\n\n const { enqueueSnackbar } = useSnackbar()\n\n const classes = useStyles()\n\n async function onImport() {\n const feed = await importIdentity(name, textareaValue)\n\n if (feed) {\n onFeedReady(feed)\n } else {\n enqueueSnackbar('Feed is not valid', { variant: 'error' })\n }\n }\n\n function onUploadIdentityFile() {\n if (fileInputRef.current) {\n const input = fileInputRef.current as HTMLInputElement\n input.click()\n }\n }\n\n function onIdentityFileSelected(event: React.ChangeEvent) {\n const fileReader = new FileReader()\n const file = event.target?.files?.[0]\n fileReader.onload = async event => {\n const string = event.target?.result\n\n if (string) {\n const feed = await importIdentity(name, string as string)\n\n if (feed) {\n onFeedReady(feed)\n } else {\n enqueueSnackbar('Feed is not valid', { variant: 'error' })\n }\n }\n }\n\n if (file) {\n fileReader.readAsText(file)\n }\n }\n\n function onFeedReady(identity: Identity) {\n persistIdentity(identities, identity)\n setIdentities(identities)\n enqueueSnackbar('Feed imported successfully', { variant: 'success' })\n onClose()\n }\n\n return (\n \n \n \n Import\n \n \n setName(event.target.value)} />\n \n \n setTextareaValue(event.target.value)}\n />\n \n \n \n Upload Json File\n \n \n Use Pasted Text\n \n \n \n )\n}\n","import { Box, Typography } from '@material-ui/core'\nimport { ReactElement, useContext, useState } from 'react'\nimport { Download, Info, PlusSquare, Trash } from 'react-feather'\nimport { useNavigate } from 'react-router'\nimport ExpandableList from '../../components/ExpandableList'\nimport ExpandableListItem from '../../components/ExpandableListItem'\nimport ExpandableListItemActions from '../../components/ExpandableListItemActions'\nimport ExpandableListItemKey from '../../components/ExpandableListItemKey'\nimport { SwarmButton } from '../../components/SwarmButton'\nimport TroubleshootConnectionCard from '../../components/TroubleshootConnectionCard'\nimport { Context as BeeContext } from '../../providers/Bee'\nimport { Context as IdentityContext, Identity } from '../../providers/Feeds'\nimport { ROUTES } from '../../routes'\nimport { formatEnum } from '../../utils'\nimport { persistIdentitiesWithoutUpdate } from '../../utils/identity'\nimport { DeleteFeedDialog } from './DeleteFeedDialog'\nimport { ExportFeedDialog } from './ExportFeedDialog'\nimport { ImportFeedDialog } from './ImportFeedDialog'\n\nexport default function Feeds(): ReactElement {\n const { identities, setIdentities } = useContext(IdentityContext)\n const { status } = useContext(BeeContext)\n\n const navigate = useNavigate()\n\n const [selectedIdentity, setSelectedIdentity] = useState(null)\n const [showImport, setShowImport] = useState(false)\n const [showExport, setShowExport] = useState(false)\n const [showDelete, setShowDelete] = useState(false)\n\n function createNewFeed() {\n return navigate(ROUTES.FEEDS_NEW)\n }\n\n function viewFeed(uuid: string) {\n navigate(ROUTES.FEEDS_PAGE.replace(':uuid', uuid))\n }\n\n function onDialogClose() {\n setShowDelete(false)\n setShowExport(false)\n setShowImport(false)\n setSelectedIdentity(null)\n }\n\n function onDelete(identity: Identity) {\n onDialogClose()\n const updatedFeeds = identities.filter(x => x.uuid !== identity.uuid)\n setIdentities(updatedFeeds)\n persistIdentitiesWithoutUpdate(updatedFeeds)\n }\n\n function onShowExport(identity: Identity) {\n setSelectedIdentity(identity)\n setShowExport(true)\n }\n\n function onShowDelete(identity: Identity) {\n setSelectedIdentity(identity)\n setShowDelete(true)\n }\n\n if (!status.all) return \n\n return (\n
    \n {showImport && setShowImport(false)} />}\n {showExport && selectedIdentity && }\n {showDelete && selectedIdentity && (\n onDelete(identity)}\n />\n )}\n \n Feeds\n \n \n \n \n Create New Feed\n \n setShowImport(true)}>\n Import Feed\n \n \n \n {identities.map((x, i) => (\n \n \n \n \n \n \n \n \n {x.feedHash && }\n \n \n viewFeed(x.uuid)} iconType={Info}>\n View Feed Page\n \n onShowExport(x)} iconType={Download}>\n Export...\n \n onShowDelete(x)} iconType={Trash}>\n Delete...\n \n \n \n \n ))}\n
    \n )\n}\n","import { createStyles, makeStyles, Typography } from '@material-ui/core'\nimport { ReactElement } from 'react'\n\ninterface Props {\n children: (string | ReactElement)[] | (string | ReactElement)\n}\n\nconst useStyles = makeStyles(() =>\n createStyles({\n text: {\n color: '#606060',\n fontSize: '0.9rem',\n },\n }),\n)\n\nexport function DocumentationText({ children }: Props): ReactElement {\n const classes = useStyles()\n\n return {children}\n}\n","import { Box, createStyles, Grid, makeStyles, Typography } from '@material-ui/core'\nimport { ArrowBack } from '@material-ui/icons'\nimport { ReactElement } from 'react'\nimport { useNavigate } from 'react-router-dom'\n\ninterface Props {\n children: string\n}\n\nconst useStyles = makeStyles(() =>\n createStyles({\n pressable: {\n cursor: 'pointer',\n },\n icon: {\n color: '#242424',\n },\n }),\n)\n\nexport function HistoryHeader({ children }: Props): ReactElement {\n const classes = useStyles()\n const navigate = useNavigate()\n\n function goBack() {\n navigate(-1)\n }\n\n return (\n \n \n \n
    \n \n
    \n
    \n {children}\n
    \n
    \n )\n}\n","import { createStyles, FormHelperText, makeStyles, MenuItem, Select as SimpleSelect, Theme } from '@material-ui/core'\nimport { Field } from 'formik'\nimport { Select } from 'formik-material-ui'\nimport { ReactElement } from 'react'\n\nexport type SelectEvent = React.ChangeEvent<{\n name?: string | undefined\n value: unknown\n}>\n\ninterface Props {\n label?: string\n name?: string\n options: { value: string; label: string }[]\n onChange?: (event: SelectEvent) => void\n formik?: boolean\n defaultValue?: string\n}\n\nconst useStyles = makeStyles((theme: Theme) =>\n createStyles({\n select: {\n borderRadius: 0,\n background: theme.palette.background.paper,\n '& fieldset': {\n border: 0,\n },\n '& .MuiSelect-select': {\n '&:focus': {\n background: theme.palette.background.paper,\n },\n },\n },\n option: {\n height: '52px',\n },\n }),\n)\n\nexport function SwarmSelect({ defaultValue, formik, name, options, onChange, label }: Props): ReactElement {\n const classes = useStyles()\n\n if (formik) {\n return (\n <>\n {label && {label}}\n \n {options.map((x, i) => (\n \n {x.label}\n \n ))}\n \n \n )\n }\n\n return (\n <>\n {label && {label}}\n \n {options.map((x, i) => (\n \n {x.label}\n \n ))}\n \n \n )\n}\n","import { Box, Grid, Typography } from '@material-ui/core'\nimport { Form, Formik } from 'formik'\nimport { useSnackbar } from 'notistack'\nimport { ReactElement, useContext, useState } from 'react'\nimport { Check, X } from 'react-feather'\nimport { useNavigate } from 'react-router'\nimport { DocumentationText } from '../../components/DocumentationText'\nimport ExpandableListItemActions from '../../components/ExpandableListItemActions'\nimport ExpandableListItemKey from '../../components/ExpandableListItemKey'\nimport { HistoryHeader } from '../../components/HistoryHeader'\nimport { SwarmButton } from '../../components/SwarmButton'\nimport { SwarmSelect } from '../../components/SwarmSelect'\nimport { SwarmTextInput } from '../../components/SwarmTextInput'\nimport { Context as FeedsContext, IdentityType } from '../../providers/Feeds'\nimport { Context as SettingsContext } from '../../providers/Settings'\nimport { ROUTES } from '../../routes'\nimport { convertWalletToIdentity, generateWallet, persistIdentity } from '../../utils/identity'\n\ninterface FormValues {\n identityName?: string\n type?: IdentityType\n password?: string\n}\n\nconst initialValues: FormValues = {\n identityName: '',\n type: 'PRIVATE_KEY',\n password: '',\n}\n\nexport default function CreateNewFeed(): ReactElement {\n const { beeApi, beeDebugApi } = useContext(SettingsContext)\n const { identities, setIdentities } = useContext(FeedsContext)\n const [loading, setLoading] = useState(false)\n const { enqueueSnackbar } = useSnackbar()\n\n const navigate = useNavigate()\n\n async function onSubmit(values: FormValues) {\n setLoading(true)\n\n if (!beeApi) {\n enqueueSnackbar(Bee API unavailabe, { variant: 'error' })\n setLoading(false)\n\n return\n }\n const wallet = generateWallet()\n const stamps = await beeDebugApi?.getAllPostageBatch()\n\n if (!stamps || !stamps.length) {\n enqueueSnackbar(No stamp available, { variant: 'error' })\n setLoading(false)\n\n return\n }\n\n if (!values.identityName || !values.type) {\n enqueueSnackbar(Form is unfinished, { variant: 'error' })\n setLoading(false)\n\n return\n }\n\n const identity = await convertWalletToIdentity(wallet, values.type, values.identityName, values.password)\n persistIdentity(identities, identity)\n setIdentities(identities)\n navigate(ROUTES.FEEDS)\n setLoading(false)\n }\n\n function cancel() {\n navigate(-1)\n }\n\n return (\n
    \n Create new feed\n \n \n To create a feed you will need to create an identity. Please refer to the{' '}\n \n official Bee documentation\n {' '}\n to understand how feeds work.\n \n \n \n {({ submitForm, values }) => (\n
    \n \n \n \n \n \n \n {values.type === 'V3' && }\n \n \n \n \n \n Feeds name\n {values.identityName} Website\n \n \n \n \n \n Create Feed\n \n \n Cancel\n \n \n \n \n )}\n
    \n
    \n )\n}\n","import { Grid, IconButton, ListItem, Tooltip, Typography } from '@material-ui/core'\nimport { createStyles, makeStyles, Theme } from '@material-ui/core/styles'\nimport { ArrowForward, OpenInNewSharp } from '@material-ui/icons'\nimport { ReactElement, useState } from 'react'\nimport CopyToClipboard from 'react-copy-to-clipboard'\nimport { useNavigate } from 'react-router'\n\nconst useStyles = makeStyles((theme: Theme) =>\n createStyles({\n header: {\n backgroundColor: theme.palette.background.paper,\n marginBottom: theme.spacing(0.25),\n borderLeft: `${theme.spacing(0.25)}px solid rgba(0,0,0,0)`,\n wordBreak: 'break-word',\n },\n headerOpen: {\n borderLeft: `${theme.spacing(0.25)}px solid ${theme.palette.primary.main}`,\n },\n openLinkIcon: {\n cursor: 'pointer',\n padding: theme.spacing(1),\n borderRadius: 0,\n '&:hover': {\n backgroundColor: '#fcf2e8',\n color: theme.palette.primary.main,\n },\n },\n content: {\n marginTop: theme.spacing(2),\n marginBottom: theme.spacing(2),\n },\n keyMargin: {\n marginRight: theme.spacing(1),\n },\n copyValue: {\n cursor: 'pointer',\n padding: theme.spacing(1),\n borderRadius: 0,\n '&:hover': {\n backgroundColor: '#fcf2e8',\n color: theme.palette.primary.main,\n },\n },\n }),\n)\n\ninterface Props {\n label: string\n value: string\n link?: string\n navigationType?: 'NEW_WINDOW' | 'HISTORY_PUSH'\n allowClipboard?: boolean\n}\n\nexport default function ExpandableListItemLink({\n label,\n value,\n link,\n navigationType = 'NEW_WINDOW',\n allowClipboard = true,\n}: Props): ReactElement | null {\n const classes = useStyles()\n const [copied, setCopied] = useState(false)\n const navigate = useNavigate()\n\n const tooltipClickHandler = () => setCopied(true)\n const tooltipCloseHandler = () => setCopied(false)\n\n const displayValue = value.length > 22 ? value.slice(0, 19) + '...' : value\n\n function onNavigation() {\n if (navigationType === 'NEW_WINDOW') {\n window.open(link || value)\n } else {\n navigate(link || value)\n }\n }\n\n return (\n \n \n \n {label && {label}}\n \n
    \n {allowClipboard && (\n \n \n \n {displayValue}\n \n \n \n )}\n {!allowClipboard && {displayValue}}\n \n {navigationType === 'NEW_WINDOW' && }\n {navigationType === 'HISTORY_PUSH' && }\n \n
    \n
    \n
    \n
    \n
    \n )\n}\n","const indexHtmls = ['index.html', 'index.htm']\n\ninterface DetectedIndex {\n indexPath: string\n commonPrefix?: string\n}\n\nexport function detectIndexHtml(files: FilePath[]): DetectedIndex | false {\n const paths = files.map(getPath)\n\n if (!paths.length) {\n return false\n }\n\n const exactMatch = paths.find(x => indexHtmls.includes(x))\n\n if (exactMatch) {\n return { indexPath: exactMatch }\n }\n\n const prefix = paths[0].split('/')[0] + '/'\n\n const allStartWithSamePrefix = paths.every(x => x.startsWith(prefix))\n\n if (allStartWithSamePrefix) {\n const match = paths.find(x => indexHtmls.map(y => prefix + y).includes(x))\n\n if (match) {\n return { indexPath: match, commonPrefix: prefix }\n }\n }\n\n return false\n}\n\nexport function getHumanReadableFileSize(bytes: number): string {\n if (bytes >= 1e15) {\n return (bytes / 1e15).toFixed(2) + ' PB'\n }\n\n if (bytes >= 1e12) {\n return (bytes / 1e12).toFixed(2) + ' TB'\n }\n\n if (bytes >= 1e9) {\n return (bytes / 1e9).toFixed(2) + ' GB'\n }\n\n if (bytes >= 1e6) {\n return (bytes / 1e6).toFixed(2) + ' MB'\n }\n\n if (bytes >= 1e3) {\n return (bytes / 1e3).toFixed(2) + ' kB'\n }\n\n return bytes + ' bytes'\n}\n\nexport function getAssetNameFromFiles(files: FilePath[]): string {\n if (files.length === 1) return files[0].name\n\n if (files.length > 0) {\n const prefix = getPath(files[0]).split('/')[0]\n\n // Only if all files have a common prefix we can use it as a folder name\n if (files.every(f => getPath(f).split('/')[0] === prefix)) return prefix\n }\n\n return 'unknown'\n}\n\nexport function getMetadata(files: FilePath[]): Metadata {\n const size = files.reduce((total, item) => total + item.size, 0)\n const isWebsite = Boolean(detectIndexHtml(files))\n const name = getAssetNameFromFiles(files)\n const type = files.length === 1 ? files[0].type : 'folder'\n const count = files.length\n\n return { size, name, type, isWebsite, count }\n}\n\nexport function getPath(file: FilePath): string {\n return (file.path || file.webkitRelativePath || file.name).replace(/^\\//g, '') // remove the starting slash\n}\n\n/**\n * Utility function that is needed to have correct directory structure as webkitRelativePath is read only\n */\nexport function packageFile(file: FilePath): FilePath {\n const path = getPath(file)\n\n return {\n path: path,\n fullPath: path,\n webkitRelativePath: path,\n lastModified: file.lastModified,\n name: file.name,\n size: file.size,\n type: file.type,\n stream: file.stream,\n slice: file.slice,\n text: file.text,\n arrayBuffer: async () => await file.arrayBuffer(), // This is needed for successful upload and can not simply be { arrayBuffer: file.arrayBuffer }\n }\n}\n","interface Dimensions {\n width: number\n height: number\n}\n\n/**\n * Get the dimensions of the image after resize\n *\n * @param imgWidth Current image width\n * @param imgHeight Current image height\n * @param maxWidth Desired max width\n * @param maxHeight Desired max height\n *\n * @returns Downscaled dimensions of the image to fit in the bounding box\n */\nexport function getDimensions(imgWidth: number, imgHeight: number, maxWidth?: number, maxHeight?: number): Dimensions {\n const ratioWidth = maxWidth ? imgWidth / maxWidth : 1\n const ratioHeight = maxHeight ? imgHeight / maxHeight : 1\n\n const ratio = Math.max(ratioWidth, ratioHeight)\n\n // No need to resize\n if (ratio <= 1) return { width: imgWidth, height: imgHeight }\n\n return { width: imgWidth / ratio, height: imgHeight / ratio }\n}\n\n/**\n * Resize image passed to fit in the bounding box defined with maxWidth and maxHeight.\n * Note that one or both of the bounding box dimensions may be omitted\n *\n * @param file Image file to be resized\n * @param maxWidth Maximal image width\n * @param maxHeight Maximal image height\n *\n * @returns Promise that resolves into the resized image blob\n */\nexport function resize(file: File, maxWidth?: number, maxHeight?: number): Promise {\n return new Promise((resolve, reject) => {\n const allowedTypes = [\n 'image/bmp',\n 'image/gif',\n 'image/vnd.microsoft.icon',\n 'image/jpeg',\n 'image/png',\n 'image/svg+xml',\n 'image/tiff',\n 'image/webp',\n ]\n\n if (!file.size || !file.type || !allowedTypes.includes(file.type)) return reject('File not supported!')\n\n try {\n const reader = new FileReader()\n reader.readAsDataURL(file)\n reader.onload = event => {\n const src = event?.target?.result\n\n if (!src || typeof src !== 'string') throw new Error('Failed to load the image source')\n\n const img = new Image()\n img.src = src\n img.onload = () => {\n const dimensions = getDimensions(img.width, img.height, maxWidth, maxHeight)\n const elem = document.createElement('canvas')\n elem.width = dimensions.width\n elem.height = dimensions.height\n const ctx = elem.getContext('2d')\n\n if (!ctx) throw new Error('Failed to create canvas context')\n\n ctx.drawImage(img, 0, 0, elem.width, elem.height)\n ctx.canvas.toBlob(\n blob => {\n if (!blob) throw new Error('Failed to extract the blob from canvas')\n\n resolve(blob)\n },\n 'image/jpeg',\n 1,\n )\n }\n }\n reader.onerror = error => reject(error)\n } catch (error) {\n reject(error)\n }\n })\n}\n","export const META_FILE_NAME = '.swarmgatewaymeta.json'\nexport const PREVIEW_FILE_NAME = '.swarmgatewaypreview.jpeg'\nexport const PREVIEW_DIMENSIONS = { maxWidth: 250, maxHeight: 175 }\n","/* eslint-disable @typescript-eslint/no-empty-function */\n\nimport { createContext, ReactChild, ReactElement, useState, useEffect } from 'react'\nimport { getMetadata } from '../utils/file'\nimport { resize } from '../utils/image'\nimport { PREVIEW_DIMENSIONS } from '../constants'\n\nexport type UploadOrigin = { origin: 'UPLOAD' | 'FEED'; uuid?: string }\n\nexport const defaultUploadOrigin: UploadOrigin = { origin: 'UPLOAD' }\n\ninterface ContextInterface {\n files: FilePath[]\n setFiles: (files: FilePath[]) => void\n uploadOrigin: UploadOrigin\n setUploadOrigin: (uploadOrigin: UploadOrigin) => void\n metadata?: Metadata\n previewUri?: string\n previewBlob?: Blob\n}\n\nconst initialValues: ContextInterface = {\n files: [],\n setFiles: () => {},\n uploadOrigin: defaultUploadOrigin,\n setUploadOrigin: () => {},\n}\n\nexport const Context = createContext(initialValues)\nexport const Consumer = Context.Consumer\n\ninterface Props {\n children: ReactChild\n}\n\nexport function Provider({ children }: Props): ReactElement {\n const [files, setFiles] = useState(initialValues.files)\n const [uploadOrigin, setUploadOrigin] = useState(initialValues.uploadOrigin)\n const [metadata, setMetadata] = useState(undefined)\n const [previewUri, setPreviewUri] = useState(undefined)\n const [previewBlob, setPreviewBlob] = useState(undefined)\n\n useEffect(() => {\n setMetadata(getMetadata(files))\n\n if (previewUri) {\n URL.revokeObjectURL(previewUri) // Clear the preview from memory\n setPreviewUri(undefined)\n setPreviewBlob(undefined)\n }\n\n if (files.length !== 1 || !files[0].type.startsWith('image')) return\n\n resize(files[0], PREVIEW_DIMENSIONS.maxWidth, PREVIEW_DIMENSIONS.maxHeight).then(blob => {\n setPreviewUri(URL.createObjectURL(blob)) // NOTE: Until it is cleared with URL.revokeObjectURL, the file stays allocated in memory\n setPreviewBlob(blob)\n })\n\n return () => {\n if (previewUri) {\n URL.revokeObjectURL(previewUri)\n }\n }\n }, [files]) // eslint-disable-line react-hooks/exhaustive-deps\n\n return (\n \n {children}\n \n )\n}\n","import { createStyles, makeStyles, Theme } from '@material-ui/core'\nimport { DropzoneArea } from 'material-ui-dropzone'\nimport { useSnackbar } from 'notistack'\nimport { ReactElement, useContext, useState } from 'react'\nimport { FilePlus, FolderPlus, PlusCircle } from 'react-feather'\nimport { useNavigate } from 'react-router-dom'\nimport { DocumentationText } from '../../components/DocumentationText'\nimport { SwarmButton } from '../../components/SwarmButton'\nimport { Context, UploadOrigin } from '../../providers/File'\nimport { ROUTES } from '../../routes'\nimport { detectIndexHtml } from '../../utils/file'\n\ninterface Props {\n uploadOrigin: UploadOrigin\n showHelp: boolean\n}\n\nconst MAX_FILE_SIZE = 1_000_000_000 // 1 gigabyte\n\nconst useStyles = makeStyles((theme: Theme) =>\n createStyles({\n areaWrapper: { position: 'relative', marginBottom: theme.spacing(2) },\n dropzone: {\n background: theme.palette.background.default,\n outline: 'none',\n color: 'transparent',\n zIndex: 1,\n '& svg': {\n opacity: 0,\n },\n },\n buttonWrapper: {\n top: '0',\n left: '0',\n position: 'absolute',\n display: 'flex',\n width: '100%',\n height: '100%',\n justifyContent: 'center',\n alignItems: 'center',\n },\n button: {\n marginLeft: theme.spacing(0.5),\n marginRight: theme.spacing(0.5),\n zIndex: 2,\n },\n }),\n)\n\nexport function UploadArea({ uploadOrigin, showHelp }: Props): ReactElement {\n const { setFiles, setUploadOrigin } = useContext(Context)\n const classes = useStyles()\n const navigate = useNavigate()\n const { enqueueSnackbar } = useSnackbar()\n const [strictWebsiteMode, setStrictWebsiteMode] = useState(false)\n const [version, setVersion] = useState(0)\n\n const getDropzoneInputDomElement = () => document.querySelector('.MuiDropzoneArea-root input') as HTMLInputElement\n\n const onUploadCollectionClick = () => {\n const element = getDropzoneInputDomElement()\n\n if (element) {\n element.setAttribute('directory', '')\n element.setAttribute('webkitdirectory', '')\n element.setAttribute('mozdirectory', '')\n element.click()\n }\n }\n\n const onUploadWebsiteClick = () => {\n onUploadCollectionClick()\n setStrictWebsiteMode(true)\n }\n\n const onUploadFolderClick = () => {\n onUploadCollectionClick()\n setStrictWebsiteMode(false)\n }\n\n const onUploadFileClick = () => {\n const element = getDropzoneInputDomElement()\n\n if (element) {\n element.removeAttribute('directory')\n element.removeAttribute('webkitdirectory')\n element.removeAttribute('mozdirectory')\n element.click()\n }\n }\n\n const resetComponentOnAddingInvalidContent = () => {\n setTimeout(() => {\n setVersion(x => x + 1)\n setFiles([])\n }, 0)\n }\n\n const handleChange = (files?: File[]) => {\n if (files) {\n const FilePaths = files as FilePath[]\n const indexDocument = files.length === 1 ? files[0].name : detectIndexHtml(FilePaths) || undefined\n\n if (files.length && strictWebsiteMode && !indexDocument) {\n enqueueSnackbar('To upload a website, there must be an index.html or index.htm in the root of the folder.', {\n variant: 'error',\n })\n resetComponentOnAddingInvalidContent()\n\n return\n }\n\n setFiles(FilePaths)\n\n if (files.length) {\n setUploadOrigin(uploadOrigin)\n navigate(ROUTES.UPLOAD_IN_PROGRESS)\n }\n }\n }\n\n return (\n <>\n
    \n \n
    \n \n Add File\n \n \n Add Folder\n \n \n Add Website\n \n
    \n
    \n {showHelp && (\n \n You can click the buttons above or simply drag and drop to add a file or folder. To upload a website to Swarm,\n make sure that your folder contains an “index.html” file.\n \n )}\n \n )\n}\n","import * as swarmCid from '@ethersphere/swarm-cid'\nimport { Box } from '@material-ui/core'\nimport { ReactElement, useContext, useEffect, useState } from 'react'\nimport { X } from 'react-feather'\nimport { useParams, useNavigate } from 'react-router-dom'\nimport { DocumentationText } from '../../components/DocumentationText'\nimport ExpandableListItemActions from '../../components/ExpandableListItemActions'\nimport ExpandableListItemKey from '../../components/ExpandableListItemKey'\nimport ExpandableListItemLink from '../../components/ExpandableListItemLink'\nimport { HistoryHeader } from '../../components/HistoryHeader'\nimport { SwarmButton } from '../../components/SwarmButton'\nimport { Context as BeeContext } from '../../providers/Bee'\nimport { Context as IdentityContext } from '../../providers/Feeds'\nimport { Context as SettingsContext } from '../../providers/Settings'\nimport { ROUTES } from '../../routes'\nimport { UploadArea } from '../files/UploadArea'\n\nexport function FeedSubpage(): ReactElement {\n const { identities } = useContext(IdentityContext)\n const { uuid } = useParams()\n const { beeApi } = useContext(SettingsContext)\n const { status } = useContext(BeeContext)\n\n const navigate = useNavigate()\n\n const [available, setAvailable] = useState(false)\n\n const identity = identities.find(x => x.uuid === uuid)\n\n useEffect(() => {\n if (!identity || !identity.feedHash) {\n return\n }\n\n try {\n beeApi?.downloadData(identity.feedHash).then(() => setAvailable(true))\n } catch {\n setAvailable(false)\n }\n }, [beeApi, uuid, identity])\n\n if (!identity || !status.all) {\n navigate(ROUTES.FEEDS, { replace: true })\n\n return <>\n }\n\n function onClose() {\n navigate(ROUTES.FEEDS)\n }\n\n return (\n
    \n {`${identity.name} Website`}\n \n {available && identity.feedHash ? (\n <>\n \n \n \n \n \n \n \n ) : (\n \n \n This feed is curently not pointing anywhere, you can update the feed to fix this. Please refer to the{' '}\n \n official Bee documentation\n \n .\n \n \n )}\n \n \n Close\n \n \n
    \n )\n}\n","import { PostageBatch } from '@ethersphere/bee-js'\nimport { createContext, ReactChild, ReactElement, useContext, useEffect, useState } from 'react'\nimport { Context as SettingsContext } from './Settings'\n\nexport interface EnrichedPostageBatch extends PostageBatch {\n usage: number\n usageText: string\n}\n\ninterface ContextInterface {\n stamps: EnrichedPostageBatch[] | null\n error: Error | null\n isLoading: boolean\n lastUpdate: number | null\n start: (frequency?: number) => void\n stop: () => void\n refresh: () => Promise\n}\n\nconst initialValues: ContextInterface = {\n stamps: null,\n error: null,\n isLoading: false,\n lastUpdate: null,\n start: () => {}, // eslint-disable-line\n stop: () => {}, // eslint-disable-line\n refresh: () => Promise.reject(),\n}\n\nexport const Context = createContext(initialValues)\nexport const Consumer = Context.Consumer\n\ninterface Props {\n children: ReactChild\n}\n\nfunction enrichStamp(postageBatch: PostageBatch): EnrichedPostageBatch {\n const { depth, bucketDepth, utilization } = postageBatch\n\n const usage = utilization / Math.pow(2, depth - bucketDepth)\n const usageText = `${Math.ceil(usage * 100)}%`\n\n return {\n ...postageBatch,\n usage,\n usageText,\n }\n}\n\nexport function Provider({ children }: Props): ReactElement {\n const { beeDebugApi } = useContext(SettingsContext)\n const [stamps, setStamps] = useState(initialValues.stamps)\n const [error, setError] = useState(initialValues.error)\n const [isLoading, setIsLoading] = useState(initialValues.isLoading)\n const [lastUpdate, setLastUpdate] = useState(initialValues.lastUpdate)\n const [frequency, setFrequency] = useState(null)\n\n const refresh = async () => {\n // Don't want to refresh when already refreshing\n if (isLoading) return\n\n if (!beeDebugApi) return\n\n try {\n setIsLoading(true)\n const stamps = await beeDebugApi.getAllPostageBatch()\n\n setStamps(stamps.map(enrichStamp))\n setLastUpdate(Date.now())\n } catch (e) {\n setError(e as Error)\n } finally {\n setIsLoading(false)\n }\n }\n\n const start = (freq = 30000) => setFrequency(freq)\n const stop = () => setFrequency(null)\n\n // Start the update loop\n useEffect(() => {\n refresh()\n\n // Start autorefresh only if the frequency is set\n if (frequency) {\n const interval = setInterval(refresh, frequency)\n\n return () => clearInterval(interval)\n }\n }, [frequency]) // eslint-disable-line react-hooks/exhaustive-deps\n\n return (\n \n {children}\n \n )\n}\n","import { Box, Typography } from '@material-ui/core'\nimport { ReactElement, useState } from 'react'\nimport { Check, X } from 'react-feather'\nimport ExpandableListItemActions from '../../components/ExpandableListItemActions'\nimport { SwarmButton } from '../../components/SwarmButton'\nimport { SwarmDialog } from '../../components/SwarmDialog'\nimport { SwarmTextInput } from '../../components/SwarmTextInput'\nimport { TitleWithClose } from '../../components/TitleWithClose'\n\ninterface Props {\n feedName: string\n onProceed: (password: string) => void\n onCancel: () => void\n loading: boolean\n}\n\nexport function FeedPasswordDialog({ feedName, onProceed, onCancel, loading }: Props): ReactElement {\n const [password, setPassword] = useState('')\n\n function onProceedClick() {\n return onProceed(password)\n }\n\n return (\n \n \n Update Feed\n \n \n Please enter the password for “{feedName}”:\n \n \n {\n setPassword(event.target.value)\n }}\n password\n />\n \n \n \n Proceed\n \n \n Cancel\n \n \n \n )\n}\n","import { Box, Grid, Typography } from '@material-ui/core'\nimport { useSnackbar } from 'notistack'\nimport { ReactElement, useContext, useEffect, useState } from 'react'\nimport { Bookmark, X } from 'react-feather'\nimport { useParams, useNavigate } from 'react-router'\nimport ExpandableListItemActions from '../../components/ExpandableListItemActions'\nimport { HistoryHeader } from '../../components/HistoryHeader'\nimport { SwarmButton } from '../../components/SwarmButton'\nimport { SelectEvent, SwarmSelect } from '../../components/SwarmSelect'\nimport TroubleshootConnectionCard from '../../components/TroubleshootConnectionCard'\nimport { Context as BeeContext } from '../../providers/Bee'\nimport { Context as IdentityContext, Identity } from '../../providers/Feeds'\nimport { Context as SettingsContext } from '../../providers/Settings'\nimport { Context as StampContext } from '../../providers/Stamps'\nimport { ROUTES } from '../../routes'\nimport { persistIdentity, updateFeed } from '../../utils/identity'\nimport { FeedPasswordDialog } from './FeedPasswordDialog'\n\nexport default function UpdateFeed(): ReactElement {\n const { identities, setIdentities } = useContext(IdentityContext)\n const { beeApi, beeDebugApi } = useContext(SettingsContext)\n const { stamps, refresh } = useContext(StampContext)\n const { status } = useContext(BeeContext)\n const { hash } = useParams()\n\n const [selectedStamp, setSelectedStamp] = useState(null)\n const [selectedIdentity, setSelectedIdentity] = useState(null)\n const [loading, setLoading] = useState(false)\n const { enqueueSnackbar } = useSnackbar()\n const [showPasswordPrompt, setShowPasswordPrompt] = useState(false)\n\n const navigate = useNavigate()\n\n useEffect(() => {\n refresh()\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [])\n\n function onFeedChange(event: SelectEvent) {\n const uuid = event.target.value\n setSelectedIdentity(identities.find(x => x.uuid === uuid) || null)\n }\n\n function onStampChange(event: SelectEvent) {\n const batchId = event.target.value as string\n setSelectedStamp(batchId)\n }\n\n function onCancel() {\n navigate(-1)\n }\n\n function onBeginUpdatingFeed() {\n if (!selectedIdentity) {\n return\n }\n\n if (selectedIdentity.type === 'V3') {\n setShowPasswordPrompt(true)\n } else {\n onFeedUpdate(selectedIdentity)\n }\n }\n\n async function onFeedUpdate(identity: Identity, password?: string) {\n setLoading(true)\n\n if (!beeApi || !beeDebugApi || !selectedStamp) {\n enqueueSnackbar(Bee API unavailabe, { variant: 'error' })\n setLoading(false)\n\n return\n }\n\n try {\n await updateFeed(beeApi, identity, hash!, selectedStamp, password as string) // eslint-disable-line\n persistIdentity(identities, identity)\n setIdentities([...identities])\n navigate(ROUTES.FEEDS_PAGE.replace(':uuid', identity.uuid))\n } catch (error: unknown) {\n setLoading(false)\n\n const message = (typeof error === 'object' && error !== null && Reflect.get(error, 'message')) || ''\n\n if (message.includes('possibly wrong passphrase')) {\n enqueueSnackbar('Wrong password, please try again', { variant: 'error' })\n } else {\n enqueueSnackbar('Could not update feed at this time, please try again later', { variant: 'error' })\n }\n }\n }\n\n if (!status.all) return \n\n return (\n
    \n {showPasswordPrompt && selectedIdentity && (\n {\n setShowPasswordPrompt(false)\n }}\n onProceed={(password: string) => {\n onFeedUpdate(selectedIdentity, password)\n }}\n loading={loading}\n />\n )}\n Update feed\n \n \n ({ value: x.uuid, label: `${x.name} Website` }))}\n onChange={onFeedChange}\n label=\"Feed\"\n />\n \n \n\n \n \n {stamps ? (\n ({ value: x.batchID, label: x.batchID.slice(0, 8) }))}\n onChange={onStampChange}\n label=\"Stamp\"\n />\n ) : (\n You need to buy a stamp first to be able to update a feed.\n )}\n \n \n \n \n Update Selected Feed\n \n \n Close\n \n \n
    \n )\n}\n","import { ReactElement, ReactNode } from 'react'\nimport { makeStyles, Theme, createStyles } from '@material-ui/core/styles'\nimport { Typography } from '@material-ui/core'\nimport ListItem from '@material-ui/core/ListItem'\n\nconst useStyles = makeStyles((theme: Theme) =>\n createStyles({\n header: {\n backgroundColor: '#F7F7F7',\n marginBottom: theme.spacing(0.25),\n },\n typography: {\n color: '#242424',\n },\n }),\n)\n\ninterface Props {\n children?: ReactNode | ReactNode[]\n}\n\nexport default function ExpandableListItemNote({ children }: Props): ReactElement | null {\n const classes = useStyles()\n\n return (\n \n \n {children}\n \n \n )\n}\n","import { Grid, IconButton, InputBase, ListItem, Typography } from '@material-ui/core'\nimport Collapse from '@material-ui/core/Collapse'\nimport { createStyles, makeStyles, Theme } from '@material-ui/core/styles'\nimport { ChangeEvent, ReactElement, useState } from 'react'\nimport { Edit, Minus, Search, X } from 'react-feather'\nimport ExpandableListItemActions from './ExpandableListItemActions'\nimport ExpandableListItemNote from './ExpandableListItemNote'\nimport { SwarmButton } from './SwarmButton'\n\nconst useStyles = makeStyles((theme: Theme) =>\n createStyles({\n header: {\n backgroundColor: theme.palette.background.paper,\n marginBottom: theme.spacing(0.25),\n borderLeft: `${theme.spacing(0.25)}px solid rgba(0,0,0,0)`,\n wordBreak: 'break-word',\n },\n headerOpen: {\n borderLeft: `${theme.spacing(0.25)}px solid ${theme.palette.primary.main}`,\n },\n copyValue: {\n cursor: 'pointer',\n padding: theme.spacing(1),\n borderRadius: 0,\n '&:hover': {\n backgroundColor: '#fcf2e8',\n color: theme.palette.primary.main,\n },\n },\n content: {\n marginTop: theme.spacing(1),\n marginBottom: theme.spacing(1),\n },\n keyMargin: {\n marginRight: theme.spacing(1),\n },\n unselectableLabel: {\n cursor: 'default',\n userSelect: 'none',\n // Many browsers don't support yet the general user-select css property\n WebkitUserSelect: 'none',\n MozUserSelect: 'none',\n msUserSelect: 'none',\n },\n }),\n)\n\ninterface Props {\n label: string\n value?: string\n placeholder?: string\n helperText?: string\n expandedOnly?: boolean\n confirmLabel?: string\n confirmLabelDisabled?: boolean\n loading?: boolean\n onChange?: (value: string) => void\n onConfirm: (value: string) => void\n mapperFn?: (value: string) => string\n locked?: boolean\n}\n\nexport default function ExpandableListItemKey({\n label,\n value,\n onConfirm,\n onChange,\n confirmLabel,\n confirmLabelDisabled,\n expandedOnly,\n helperText,\n placeholder,\n loading,\n mapperFn,\n locked,\n}: Props): ReactElement | null {\n const classes = useStyles()\n const [open, setOpen] = useState(Boolean(expandedOnly))\n const [inputValue, setInputValue] = useState(value || '')\n const toggleOpen = () => setOpen(!open)\n const handleChange = (e: ChangeEvent) => {\n if (mapperFn) {\n e.target.value = mapperFn(e.target.value)\n }\n\n setInputValue(e.target.value)\n\n if (onChange) onChange(e.target.value)\n }\n\n return (\n <>\n \n \n \n {label && (\n \n {label}\n \n )}\n \n
    \n {!open && value}\n {!expandedOnly && !locked && (\n \n {open ? (\n \n ) : (\n \n )}\n \n )}\n
    \n
    \n
    \n \n \n
    \n
    \n \n {helperText && {helperText}}\n \n onConfirm(inputValue)}\n >\n {confirmLabel || 'Save'}\n \n setInputValue(value || '')}\n cancel\n >\n Cancel\n \n \n \n \n )\n}\n","import { shortenHash } from './hash'\n\nexport enum HISTORY_KEYS {\n UPLOAD_HISTORY = 'UPLOAD_HISTORY',\n DOWNLOAD_HISTORY = 'DOWNLOAD_HISTORY',\n}\n\nexport interface HistoryItem {\n createdAt: number\n name: string\n hash: string\n}\n\nexport function putHistory(key: string, hash: string, name: string): void {\n const history = getHistorySafe(key)\n\n const existingIndex = history.findIndex(x => x.hash === hash)\n\n if (existingIndex !== -1) {\n history.splice(existingIndex, 1)\n }\n\n history.unshift({\n createdAt: Date.now(),\n hash,\n name,\n })\n\n if (history.length > 10) {\n history.length = 10\n }\n localStorage.setItem(key, JSON.stringify(history))\n}\n\nexport function getHistorySafe(key: string): HistoryItem[] {\n const items = localStorage.getItem(key)\n\n if (!items) {\n return []\n }\n try {\n const parsed = JSON.parse(items)\n\n if (!Array.isArray(parsed) || !parsed.every(isHistoryItem)) {\n return []\n }\n\n return parsed\n } catch {\n return []\n }\n}\n\nfunction isHistoryItem(x: unknown): x is HistoryItem {\n if (typeof x !== 'object' || x === null) {\n return false\n }\n\n return 'createdAt' in x && 'hash' in x\n}\n\nexport function determineHistoryName(hash: string, indexDocument?: string | null): string {\n if (indexDocument === 'index.html') {\n return `Website ${shortenHash(hash, 4)}`\n } else if (indexDocument) {\n return indexDocument\n }\n\n return `Folder ${shortenHash(hash, 4)}`\n}\n","export function shortenHash(hash: string, sliceLength = 8): string {\n return `${hash.slice(0, sliceLength)}[…]${hash.slice(-sliceLength)}`\n}\n","import { ReactElement, useEffect, useState } from 'react'\nimport { getPrettyDateString } from '../utils/date'\nimport { getHistorySafe, HistoryItem, HISTORY_KEYS } from '../utils/local-storage'\nimport ExpandableList from './ExpandableList'\nimport ExpandableListItemLink from './ExpandableListItemLink'\n\ninterface Props {\n title: string\n localStorageKey: HISTORY_KEYS\n}\n\nexport function History({ title, localStorageKey }: Props): ReactElement | null {\n const [items, setItems] = useState([])\n\n useEffect(() => {\n setItems(getHistorySafe(localStorageKey))\n }, [localStorageKey])\n\n if (!items.length) {\n return null\n }\n\n return (\n \n {items.map((x, i) => (\n \n ))}\n \n )\n}\n","export function getPrettyDateString(date: Date): string {\n const string = date.toString()\n\n return string.split('GMT')[0].trim()\n}\n","import { createStyles, makeStyles, Tab, Tabs, Theme } from '@material-ui/core'\nimport { ReactElement } from 'react'\nimport { useNavigate } from 'react-router-dom'\nimport { ROUTES } from '../../routes'\n\ninterface Props {\n active: 'UPLOAD' | 'DOWNLOAD'\n}\n\nconst useStyles = makeStyles((theme: Theme) =>\n createStyles({\n root: {\n flexGrow: 1,\n marginBottom: theme.spacing(4),\n },\n leftTab: {\n marginRight: theme.spacing(0.5),\n },\n rightTab: {\n marginLeft: theme.spacing(0.5),\n },\n }),\n)\n\nexport function FileNavigation({ active }: Props): ReactElement {\n const classes = useStyles()\n const navigate = useNavigate()\n\n function onChange(event: React.ChangeEvent>, newValue: number) {\n navigate(newValue === 1 ? ROUTES.DOWNLOAD : ROUTES.UPLOAD)\n }\n\n return (\n
    \n \n \n \n \n
    \n )\n}\n","import { Utils } from '@ethersphere/bee-js'\nimport { ManifestJs } from '@ethersphere/manifest-js'\nimport { useSnackbar } from 'notistack'\nimport { ReactElement, useContext, useState } from 'react'\nimport { useNavigate } from 'react-router-dom'\nimport ExpandableListItemInput from '../../components/ExpandableListItemInput'\nimport { History } from '../../components/History'\nimport { Context, defaultUploadOrigin } from '../../providers/File'\nimport { Context as SettingsContext } from '../../providers/Settings'\nimport { ROUTES } from '../../routes'\nimport { extractSwarmHash } from '../../utils'\nimport { determineHistoryName, HISTORY_KEYS, putHistory } from '../../utils/local-storage'\nimport { FileNavigation } from './FileNavigation'\n\nexport function Download(): ReactElement {\n const [loading, setLoading] = useState(false)\n const { beeApi } = useContext(SettingsContext)\n const [referenceError, setReferenceError] = useState(undefined)\n\n const { setUploadOrigin } = useContext(Context)\n\n const { enqueueSnackbar } = useSnackbar()\n const navigate = useNavigate()\n\n const validateChange = (value: string) => {\n if (Utils.isHexString(value, 64) || Utils.isHexString(value, 128) || !value.trim().length) {\n setReferenceError(undefined)\n } else {\n setReferenceError('Incorrect format of swarm hash. Expected 64 or 128 hexstring characters.')\n }\n }\n\n async function onSwarmIdentifier(identifier: string) {\n setLoading(true)\n\n if (!beeApi) {\n setLoading(false)\n\n return\n }\n\n try {\n const manifestJs = new ManifestJs(beeApi)\n const feedIdentifier = await manifestJs.resolveFeedManifest(identifier)\n\n if (feedIdentifier) {\n identifier = feedIdentifier\n }\n const isManifest = await manifestJs.isManifest(identifier)\n\n if (!isManifest) {\n throw Error('The specified hash does not contain valid content.')\n }\n const indexDocument = await manifestJs.getIndexDocumentPath(identifier)\n putHistory(HISTORY_KEYS.DOWNLOAD_HISTORY, identifier, determineHistoryName(identifier, indexDocument))\n setUploadOrigin(defaultUploadOrigin)\n navigate(ROUTES.HASH.replace(':hash', identifier))\n } catch (error: unknown) {\n let message = typeof error === 'object' && error !== null && Reflect.get(error, 'message')\n\n if (message.includes('path address not found')) {\n message = 'The specified hash does not have an index document set.'\n }\n\n if (message.includes('Not Found: Not Found')) {\n message = 'The specified hash was not found.'\n }\n enqueueSnackbar(Error: {message || 'Unknown'}, { variant: 'error' })\n } finally {\n setLoading(false)\n }\n }\n\n function recognizeSwarmHash(value: string) {\n if (value.length < 64) {\n return value\n }\n\n const hash = extractSwarmHash(value)\n\n if (hash) {\n return hash\n }\n\n return value\n }\n\n return (\n <>\n \n onSwarmIdentifier(value)}\n onChange={validateChange}\n helperText={referenceError}\n confirmLabel={'Find'}\n confirmLabelDisabled={Boolean(referenceError) || loading}\n placeholder=\"e.g. 31fb0362b1a42536134c86bc58b97ac0244e5c6630beec3e27c2d1cecb38c605\"\n expandedOnly\n mapperFn={value => recognizeSwarmHash(value)}\n loading={loading}\n />\n \n \n )\n}\n","import { CircularProgress, Grid } from '@material-ui/core'\nimport { ReactElement } from 'react'\n\nexport function Loading(): ReactElement {\n return (\n \n \n \n )\n}\n","import { createStyles, makeStyles } from '@material-ui/core'\nimport { ReactElement } from 'react'\n\nconst useStyles = makeStyles(() =>\n createStyles({\n image: {\n width: '100%',\n height: '100%',\n objectFit: 'cover',\n },\n }),\n)\n\ninterface Props {\n alt: string\n src: string | undefined\n maxHeight?: string\n maxWidth?: string\n}\n\nexport function FitImage(props: Props): ReactElement {\n const classes = useStyles()\n\n const inlineStyles: Record = {}\n\n props.maxHeight && (inlineStyles.maxHeight = props.maxHeight)\n props.maxWidth && (inlineStyles.maxWidth = props.maxWidth)\n\n return {props.alt}\n}\n","import { createStyles, makeStyles } from '@material-ui/core'\nimport { ReactElement } from 'react'\n\ninterface Props {\n children: ReactElement | ReactElement[]\n}\n\nconst useStyles = makeStyles(() =>\n createStyles({\n wrapper: {\n display: 'flex',\n justifyContent: 'center',\n alignItems: 'center',\n width: '175px',\n height: '175px',\n background: `repeating-linear-gradient(\n 45deg,\n #efefef,\n #efefef 4px,\n #ffffff 4px,\n #ffffff 8px\n )`,\n },\n }),\n)\n\nexport function StripedWrapper({ children }: Props): ReactElement {\n const classes = useStyles()\n\n return
    {children}
    \n}\n","import { ReactElement } from 'react'\nimport { StripedWrapper } from '../../components/StripedWrapper'\n\ninterface Props {\n icon: ReactElement\n}\n\nexport function AssetIcon({ icon }: Props): ReactElement {\n return {icon}\n}\n","import { Box, Grid, Typography } from '@material-ui/core'\nimport { Web } from '@material-ui/icons'\nimport { ReactElement } from 'react'\nimport { File, Folder } from 'react-feather'\nimport { FitImage } from '../../components/FitImage'\nimport { shortenText } from '../../utils'\nimport { getHumanReadableFileSize } from '../../utils/file'\nimport { shortenHash } from '../../utils/hash'\nimport { AssetIcon } from './AssetIcon'\n\ninterface Props {\n previewUri?: string\n metadata?: Metadata\n}\n\n// TODO: add optional prop for indexDocument when it is already known (e.g. downloading a manifest)\n\nexport function AssetPreview({ metadata, previewUri }: Props): ReactElement | null {\n let previewComponent = \n let type = metadata?.type\n\n if (metadata?.isWebsite) {\n previewComponent = \n type = 'Website'\n } else if (metadata?.type === 'folder') {\n previewComponent = \n type = 'Folder'\n }\n\n return (\n \n \n \n {previewUri ? (\n \n ) : (\n \n )}\n \n {metadata?.hash && Swarm Hash: {shortenHash(metadata.hash)}}\n {metadata?.name && metadata?.name !== metadata?.hash && (\n \n {metadata?.type === 'folder' ? 'Folder Name' : 'Filename'}: {shortenText(metadata?.name)}\n \n )}\n Kind: {type}\n {metadata?.size ? Size: {getHumanReadableFileSize(metadata.size)} : null}\n \n \n \n {metadata?.type === 'folder' && metadata.count && (\n \n \n Folder content\n {metadata.count} items\n \n \n )}\n \n )\n}\n","import * as swarmCid from '@ethersphere/swarm-cid'\nimport { Box } from '@material-ui/core'\nimport { ReactElement } from 'react'\nimport { DocumentationText } from '../../components/DocumentationText'\nimport ExpandableListItemKey from '../../components/ExpandableListItemKey'\nimport ExpandableListItemLink from '../../components/ExpandableListItemLink'\n\ninterface Props {\n isWebsite?: boolean\n hash: string\n}\n\nexport function AssetSummary({ isWebsite, hash }: Props): ReactElement {\n return (\n <>\n \n \n \n {isWebsite && (\n \n )}\n \n \n The Swarm Gateway is graciously provided by the Swarm Foundation. This service is under development and provided\n for testing purposes only. Learn more at{' '}\n https://gateway.ethswarm.org/.\n \n \n )\n}\n","import { Box, Grid } from '@material-ui/core'\nimport { ReactElement } from 'react'\nimport { Bookmark, Download, Link, X } from 'react-feather'\nimport ExpandableListItemActions from '../../components/ExpandableListItemActions'\nimport { SwarmButton } from '../../components/SwarmButton'\n\ninterface Props {\n onOpen: () => void\n onCancel: () => void\n onDownload: () => void\n onUpdateFeed: () => void\n hasIndexDocument: boolean\n loading: boolean\n}\n\nexport function DownloadActionBar({\n onOpen,\n onCancel,\n onDownload,\n onUpdateFeed,\n hasIndexDocument,\n loading,\n}: Props): ReactElement {\n return (\n \n \n {hasIndexDocument && (\n \n View Website\n \n )}\n \n Download\n \n \n Close\n \n \n \n \n Update Feed\n \n \n \n )\n}\n","import { ManifestJs } from '@ethersphere/manifest-js'\nimport { Box, Typography } from '@material-ui/core'\nimport { saveAs } from 'file-saver'\nimport JSZip from 'jszip'\nimport { useSnackbar } from 'notistack'\nimport { ReactElement, useContext, useEffect, useState } from 'react'\nimport { useNavigate, useParams } from 'react-router-dom'\nimport { HistoryHeader } from '../../components/HistoryHeader'\nimport { Loading } from '../../components/Loading'\nimport TroubleshootConnectionCard from '../../components/TroubleshootConnectionCard'\nimport config from '../../config'\nimport { META_FILE_NAME, PREVIEW_FILE_NAME } from '../../constants'\nimport { Context as BeeContext } from '../../providers/Bee'\nimport { Context as SettingsContext } from '../../providers/Settings'\nimport { ROUTES } from '../../routes'\nimport { determineHistoryName, HISTORY_KEYS, putHistory } from '../../utils/local-storage'\nimport { AssetPreview } from './AssetPreview'\nimport { AssetSummary } from './AssetSummary'\nimport { DownloadActionBar } from './DownloadActionBar'\n\nexport function Share(): ReactElement {\n const { apiUrl, beeApi } = useContext(SettingsContext)\n const { status } = useContext(BeeContext)\n\n const { hash } = useParams()\n const reference = hash! // eslint-disable-line\n\n const navigate = useNavigate()\n const { enqueueSnackbar } = useSnackbar()\n\n const [loading, setLoading] = useState(true)\n const [downloading, setDownloading] = useState(false)\n const [swarmEntries, setSwarmEntries] = useState>({})\n const [indexDocument, setIndexDocument] = useState(null)\n const [notFound, setNotFound] = useState(false)\n const [preview, setPreview] = useState(undefined)\n const [metadata, setMetadata] = useState()\n\n async function prepare() {\n if (!beeApi || !status.all) {\n return\n }\n\n const manifestJs = new ManifestJs(beeApi)\n const isManifest = await manifestJs.isManifest(reference)\n\n if (!isManifest) {\n setNotFound(true)\n enqueueSnackbar('The specified hash does not contain valid content.', { variant: 'error' })\n\n return\n }\n const entries = await manifestJs.getHashes(reference)\n const indexDocument = await manifestJs.getIndexDocumentPath(reference)\n setIndexDocument(indexDocument)\n\n const previewFile = entries[PREVIEW_FILE_NAME]\n\n delete entries[META_FILE_NAME]\n delete entries[PREVIEW_FILE_NAME]\n setSwarmEntries(entries)\n\n const count = Object.keys(entries).length\n\n let metadata: Metadata | undefined = {\n hash,\n size: 0,\n type: count > 1 ? 'folder' : 'unknown',\n name: reference,\n isWebsite: Boolean(indexDocument) && count > 1,\n count,\n }\n\n try {\n const mtdt = await beeApi.downloadFile(reference, META_FILE_NAME)\n const remoteMetadata = mtdt.data.text()\n metadata = { ...metadata, ...(JSON.parse(remoteMetadata) as Metadata) }\n } catch (e) {} // eslint-disable-line no-empty\n\n if (previewFile) {\n setPreview(`${config.BEE_API_HOST}/bzz/${reference}/${PREVIEW_FILE_NAME}`)\n }\n\n setMetadata(metadata)\n }\n\n function onOpen() {\n window.open(`${apiUrl}/bzz/${reference}/`, '_blank')\n }\n\n function onClose() {\n if (navigate.length > 0) {\n // There is at least one different route in browser history that we can return to\n navigate(-1)\n } else {\n // This is the first page user opened, navigate to upload page instead of going back\n navigate(ROUTES.UPLOAD)\n }\n }\n\n function onUpdateFeed() {\n navigate(ROUTES.FEEDS_UPDATE.replace(':hash', reference))\n }\n\n useEffect(() => {\n setLoading(true)\n prepare().finally(() => {\n setLoading(false)\n })\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [reference])\n\n async function onDownload() {\n if (!beeApi) {\n return\n }\n putHistory(HISTORY_KEYS.DOWNLOAD_HISTORY, reference, determineHistoryName(reference, indexDocument))\n setDownloading(true)\n\n if (Object.keys(swarmEntries).length === 1) {\n window.open(`${apiUrl}/bzz/${reference}/`, '_blank')\n } else {\n const zip = new JSZip()\n for (const [path, hash] of Object.entries(swarmEntries)) {\n zip.file(path, await beeApi.downloadData(hash))\n }\n const content = await zip.generateAsync({ type: 'blob' })\n saveAs(content, reference + '.zip')\n }\n setDownloading(false)\n }\n\n if (!status.all) return \n\n if (loading) {\n return \n }\n\n if (notFound) {\n return (\n <>\n Not Found\n The specified hash is not found.\n \n )\n }\n\n return (\n <>\n \n \n \n \n \n \n \n \n )\n}\n","import { createStyles, Grid, makeStyles, Typography } from '@material-ui/core'\nimport { ReactElement } from 'react'\n\ninterface Props {\n steps: string[]\n index: number\n}\n\nconst useStyles = makeStyles(() =>\n createStyles({\n wrapper: {\n height: '52px',\n display: 'flex',\n flex: 1,\n justifyContent: 'center',\n alignItems: 'center',\n },\n todo: {\n background: '#f7f7f7',\n color: '#c9c9c9',\n },\n inProgress: {\n background: '#ffffff',\n color: '#242424',\n height: '52px',\n },\n done: {\n background: '#f7f7f7',\n color: '#606060',\n height: '52px',\n },\n }),\n)\n\nexport function ProgressIndicator({ steps, index }: Props): ReactElement {\n const classes = useStyles()\n\n function pickClass(i: number): string {\n if (i === index) {\n return classes.inProgress\n }\n\n return i < index ? classes.done : classes.todo\n }\n\n return (\n \n {steps.map((x, i) => (\n
    \n {x}\n
    \n ))}\n
    \n )\n}\n","import { Box, Grid, Typography } from '@material-ui/core'\nimport BigNumber from 'bignumber.js'\nimport { Form, Formik, FormikHelpers } from 'formik'\nimport { useSnackbar } from 'notistack'\nimport { ReactElement, useContext } from 'react'\nimport { Check } from 'react-feather'\nimport { SwarmButton } from '../../components/SwarmButton'\nimport { SwarmTextInput } from '../../components/SwarmTextInput'\nimport { Context as BeeContext } from '../../providers/Bee'\nimport { Context as SettingsContext } from '../../providers/Settings'\nimport { Context as StampsContext } from '../../providers/Stamps'\nimport { calculateStampPrice, convertAmountToSeconds, convertDepthToBytes, secondsToTimeString } from '../../utils'\nimport { getHumanReadableFileSize } from '../../utils/file'\n\ninterface FormValues {\n depth?: string\n amount?: string\n label?: string\n}\ntype FormErrors = Partial\nconst initialFormValues: FormValues = {\n depth: '',\n amount: '',\n label: '',\n}\n\ninterface Props {\n onFinished: () => void\n}\n\nexport function PostageStampCreation({ onFinished }: Props): ReactElement {\n const { chainState } = useContext(BeeContext)\n const { refresh } = useContext(StampsContext)\n const { beeDebugApi } = useContext(SettingsContext)\n\n const { enqueueSnackbar } = useSnackbar()\n\n function getFileSize(depth: number): string {\n if (isNaN(depth) || depth < 17 || depth > 255) {\n return '-'\n }\n\n return `~${getHumanReadableFileSize(convertDepthToBytes(depth))}`\n }\n\n function getTtl(amount: number): string {\n const isCurrentPriceAvailable = chainState && chainState.currentPrice\n\n if (amount <= 0 || !isCurrentPriceAvailable) {\n return '-'\n }\n\n const pricePerBlock = Number.parseInt(chainState.currentPrice, 10)\n\n return `${secondsToTimeString(convertAmountToSeconds(amount, pricePerBlock))} (with price of 0 per block)`\n }\n\n function getPrice(depth: number, amount: bigint): string {\n const hasInvalidInput = amount <= 0 || isNaN(depth) || depth < 17 || depth > 255\n\n if (hasInvalidInput) {\n return '-'\n }\n\n const price = calculateStampPrice(depth, amount)\n\n return `${price.toSignificantDigits()} BZZ`\n }\n\n return (\n ) => {\n try {\n // This is really just a typeguard, the validation pretty much guarantees these will have the right values\n if (!values.depth || !values.amount) return\n\n if (!beeDebugApi) return\n\n const amount = BigInt(values.amount)\n const depth = Number.parseInt(values.depth)\n const options = values.label ? { label: values.label } : undefined\n await beeDebugApi.createPostageBatch(amount.toString(), depth, options)\n actions.resetForm()\n await refresh()\n onFinished()\n } catch (e) {\n enqueueSnackbar(`Error: ${(e as Error).message}`, { variant: 'error' })\n actions.setSubmitting(false)\n }\n }}\n validate={(values: FormValues) => {\n const errors: FormErrors = {}\n\n // Depth\n if (!values.depth) errors.depth = 'Required field'\n else {\n const depth = new BigNumber(values.depth)\n\n if (!depth.isInteger()) errors.depth = 'Depth must be an integer'\n else if (depth.isLessThan(16)) errors.depth = 'Minimal depth is 16'\n else if (depth.isGreaterThan(255)) errors.depth = 'Depth has to be at most 255'\n }\n\n // Amount\n if (!values.amount) errors.amount = 'Required field'\n else {\n const amount = new BigNumber(values.amount)\n\n if (!amount.isInteger()) errors.amount = 'Amount must be an integer'\n else if (amount.isLessThanOrEqualTo(0)) errors.amount = 'Amount must be greater than 0'\n }\n\n // Label\n if (values.label && !/^[0-9a-z]*$/i.test(values.label)) errors.label = 'Label must be an alphanumeric string'\n\n return errors\n }}\n >\n {({ submitForm, isValid, isSubmitting, values }) => (\n
    \n \n \n \n \n Corresponding file size\n {getFileSize(parseInt(values.depth || '0', 10))}\n \n \n \n \n \n \n \n Corresponding TTL (Time to live)\n {getTtl(Number.parseInt(values.amount || '0', 10))}\n \n \n \n \n \n \n \n \n Indicative Price\n {getPrice(parseInt(values.depth || '0', 10), BigInt(values.amount || '0'))}\n \n \n \n Buy New Stamp\n \n \n )}\n \n )\n}\n","import React, { ReactElement, useContext } from 'react'\nimport { SwarmSelect } from '../../components/SwarmSelect'\nimport { Context, EnrichedPostageBatch } from '../../providers/Stamps'\n\ninterface Props {\n onSelect: (stamp: EnrichedPostageBatch) => void\n defaultValue?: string\n}\n\nexport function PostageStampSelector({ onSelect, defaultValue }: Props): ReactElement {\n const { stamps } = useContext(Context)\n\n function onChange(stampId: string) {\n if (!stamps) {\n return\n }\n const stamp = stamps.find(x => x.batchID === stampId)\n\n if (stamp) {\n onSelect(stamp)\n }\n }\n\n return (\n ({ label: x.batchID.slice(0, 8), value: x.batchID }))}\n onChange={event => onChange(event.target.value as string)}\n defaultValue={defaultValue}\n />\n )\n}\n","import { ReactElement } from 'react'\n\ninterface Props {\n width: string\n usage: number\n}\n\nexport function Capacity({ width, usage }: Props): ReactElement {\n const integerUsage = Math.round(usage * 100)\n const used = integerUsage + '%'\n const free = 100 - 2 - integerUsage + '%'\n\n return (\n
    \n
    \n
    \n
    \n
    \n
    \n
    \n )\n}\n","import { Box, Grid, Typography } from '@material-ui/core'\nimport { ReactElement } from 'react'\nimport { Capacity } from '../../components/Capacity'\nimport { EnrichedPostageBatch } from '../../providers/Stamps'\n\ninterface Props {\n stamp: EnrichedPostageBatch\n shorten?: boolean\n}\n\nexport function PostageStamp({ stamp, shorten }: Props): ReactElement {\n return (\n \n \n {shorten ? stamp.batchID.slice(0, 8) : stamp.batchID}\n \n \n \n )\n}\n","import { Box, Typography } from '@material-ui/core'\nimport { ReactElement } from 'react'\nimport { EnrichedPostageBatch } from '../../providers/Stamps'\nimport { PostageStamp } from '../stamps/PostageStamp'\n\ninterface Props {\n stamp: EnrichedPostageBatch\n}\n\nexport function StampPreview({ stamp }: Props): ReactElement {\n return (\n \n \n Associated postage stamp:\n \n \n \n \n \n )\n}\n","import { Box, Grid } from '@material-ui/core'\nimport { ReactElement } from 'react'\nimport { ArrowLeft, Check, Layers, PlusSquare, X } from 'react-feather'\nimport { DocumentationText } from '../../components/DocumentationText'\nimport ExpandableListItemActions from '../../components/ExpandableListItemActions'\nimport { SwarmButton } from '../../components/SwarmButton'\n\ninterface Props {\n step: number\n onUpload: () => void\n onCancel: () => void\n onGoBack: () => void\n onProceed: () => void\n isUploading: boolean\n hasStamp: boolean\n uploadLabel: string\n stampMode: 'BUY' | 'SELECT'\n setStampMode: (mode: 'BUY' | 'SELECT') => void\n}\n\nexport function UploadActionBar({\n step,\n onUpload,\n onCancel,\n onGoBack,\n onProceed,\n isUploading,\n hasStamp,\n uploadLabel,\n stampMode,\n setStampMode,\n}: Props): ReactElement {\n if (step === 0) {\n return (\n <>\n \n \n \n Add Postage Stamp\n \n \n Cancel\n \n \n \n You need a postage stamp to upload.\n \n )\n }\n\n if (step === 1) {\n return (\n \n \n {stampMode === 'SELECT' && (\n \n Proceed With Selected Stamp\n \n )}\n \n Back To Preview\n \n \n setStampMode(stampMode === 'BUY' ? 'SELECT' : 'BUY')}\n iconType={stampMode === 'BUY' ? Layers : PlusSquare}\n >\n {stampMode === 'BUY' ? 'Use Existing Stamp' : 'Buy New Stamp'}\n \n \n )\n }\n\n if (step === 2) {\n return (\n \n \n {uploadLabel}\n \n \n Change Postage Stamp\n \n \n )\n }\n\n return <>\n}\n","import { Box } from '@material-ui/core'\nimport { useSnackbar } from 'notistack'\nimport { ReactElement, useContext, useEffect, useState } from 'react'\nimport { useNavigate } from 'react-router-dom'\nimport { DocumentationText } from '../../components/DocumentationText'\nimport { HistoryHeader } from '../../components/HistoryHeader'\nimport { ProgressIndicator } from '../../components/ProgressIndicator'\nimport TroubleshootConnectionCard from '../../components/TroubleshootConnectionCard'\nimport { Context as BeeContext } from '../../providers/Bee'\nimport { Context as IdentityContext, Identity } from '../../providers/Feeds'\nimport { Context as FileContext } from '../../providers/File'\nimport { Context as SettingsContext } from '../../providers/Settings'\nimport { Context as StampsContext, EnrichedPostageBatch } from '../../providers/Stamps'\nimport { ROUTES } from '../../routes'\nimport { detectIndexHtml, getAssetNameFromFiles, packageFile } from '../../utils/file'\nimport { persistIdentity, updateFeed } from '../../utils/identity'\nimport { HISTORY_KEYS, putHistory } from '../../utils/local-storage'\nimport { FeedPasswordDialog } from '../feeds/FeedPasswordDialog'\nimport { PostageStampCreation } from '../stamps/PostageStampCreation'\nimport { PostageStampSelector } from '../stamps/PostageStampSelector'\nimport { AssetPreview } from './AssetPreview'\nimport { StampPreview } from './StampPreview'\nimport { UploadActionBar } from './UploadActionBar'\nimport { META_FILE_NAME, PREVIEW_FILE_NAME } from '../../constants'\n\nexport function Upload(): ReactElement {\n const [step, setStep] = useState(0)\n const [stampMode, setStampMode] = useState<'SELECT' | 'BUY'>('SELECT')\n const [stamp, setStamp] = useState(null)\n const [isUploading, setUploading] = useState(false)\n const [showPasswordPrompt, setShowPasswordPrompt] = useState(false)\n\n const { refresh } = useContext(StampsContext)\n const { beeApi } = useContext(SettingsContext)\n const { files, setFiles, uploadOrigin, metadata, previewUri, previewBlob } = useContext(FileContext)\n const { identities, setIdentities } = useContext(IdentityContext)\n const { status } = useContext(BeeContext)\n\n const { enqueueSnackbar } = useSnackbar()\n const navigate = useNavigate()\n\n useEffect(() => {\n refresh()\n }, []) // eslint-disable-line react-hooks/exhaustive-deps\n\n if (!status.all) return \n\n if (!files.length) {\n setFiles([])\n navigate(ROUTES.UPLOAD, { replace: true })\n\n return <>\n }\n\n const identity = uploadOrigin.uuid ? identities.find(x => x.uuid === uploadOrigin.uuid) : null\n\n const onUpload = () => {\n if (uploadOrigin.origin === 'UPLOAD') {\n uploadFiles()\n } else {\n if ((identity as Identity).type === 'PRIVATE_KEY') {\n uploadFiles()\n } else {\n setShowPasswordPrompt(true)\n }\n }\n }\n\n const uploadFiles = (password?: string) => {\n if (!beeApi || !files.length || !stamp || !metadata) {\n return\n }\n\n let fls = files.map(packageFile) // Apart from packaging, this is needed to not modify the original files array as it can trigger effects\n let indexDocument: string | undefined = undefined // This means we assume it's folder\n\n if (files.length === 1) indexDocument = files[0].name\n else if (files.length > 1) {\n const idx = detectIndexHtml(files)\n\n // This is a website\n if (idx) {\n // The website is in some directory, remove it\n if (idx.commonPrefix) {\n const substrStart = idx.commonPrefix.length\n indexDocument = idx.indexPath.substr(substrStart)\n fls = fls.map(f => {\n const path = (f.path as string).substr(substrStart)\n\n return { ...f, path, webkitRelativePath: path, fullPath: path }\n })\n } else {\n // The website is not packed in a directory\n indexDocument = idx.indexPath\n }\n }\n }\n const lastModified = files[0].lastModified\n\n // We want to store only some metadata\n const mtd: SwarmMetadata = {\n name: metadata.name,\n size: metadata.size,\n }\n\n // Type of the file only makes sense for a single file\n if (files.length === 1) mtd.type = metadata.type\n\n const metafile = new File([JSON.stringify(mtd)], META_FILE_NAME, {\n type: 'application/json',\n lastModified,\n })\n fls.push(packageFile(metafile))\n\n if (previewBlob) {\n const previewFile = new File([previewBlob], PREVIEW_FILE_NAME, {\n type: 'image/jpeg',\n lastModified,\n })\n fls.push(packageFile(previewFile))\n }\n\n setUploading(true)\n\n beeApi\n .uploadFiles(stamp.batchID, fls, { indexDocument })\n .then(hash => {\n putHistory(HISTORY_KEYS.UPLOAD_HISTORY, hash.reference, getAssetNameFromFiles(files))\n\n if (uploadOrigin.origin === 'UPLOAD') {\n navigate(ROUTES.HASH.replace(':hash', hash.reference), { replace: true })\n } else {\n updateFeed(beeApi, identity as Identity, hash.reference, stamp.batchID, password as string).then(() => {\n persistIdentity(identities, identity as Identity)\n setIdentities([...identities])\n navigate(ROUTES.FEEDS_PAGE.replace(':uuid', uploadOrigin.uuid as string), { replace: true })\n })\n }\n })\n .catch(e => {\n enqueueSnackbar(`Error uploading: ${e.message}`, { variant: 'error' })\n setUploading(false)\n })\n }\n\n const reset = () => {\n setStep(0)\n setFiles([])\n setStamp(null)\n setUploading(false)\n }\n\n const onFeedPasswordGiven = (password: string) => {\n uploadFiles(password)\n }\n\n return (\n <>\n {showPasswordPrompt && (\n setShowPasswordPrompt(false)}\n onProceed={onFeedPasswordGiven}\n />\n )}\n {identity && {`Update \"${identity.name}\"`}}\n {!identity && Upload}\n \n \n \n {(step === 0 || step === 2) && }\n {step === 1 && (\n <>\n \n {stampMode === 'SELECT' ? (\n setStamp(stamp)} defaultValue={stamp?.batchID} />\n ) : (\n setStampMode('SELECT')} />\n )}\n \n \n \n Please refer to the{' '}\n \n official Bee documentation\n {' '}\n to understand these values.\n \n \n \n )}\n {step === 2 && stamp && }\n setStep(step => step - 1)}\n onProceed={() => setStep(step => step + 1)}\n onUpload={onUpload}\n isUploading={isUploading}\n hasStamp={Boolean(stamp)}\n uploadLabel={identity ? 'Update Feed' : 'Upload To Your Node'}\n stampMode={stampMode}\n setStampMode={setStampMode}\n />\n \n )\n}\n","import { ReactElement, useContext } from 'react'\nimport { History } from '../../components/History'\nimport TroubleshootConnectionCard from '../../components/TroubleshootConnectionCard'\nimport { Context as BeeContext } from '../../providers/Bee'\nimport { defaultUploadOrigin } from '../../providers/File'\nimport { HISTORY_KEYS } from '../../utils/local-storage'\nimport { FileNavigation } from './FileNavigation'\nimport { UploadArea } from './UploadArea'\n\nexport function UploadLander(): ReactElement {\n const { status } = useContext(BeeContext)\n\n if (!status.all) return \n\n return (\n <>\n \n \n \n \n )\n}\n","const OPTIMAL_CONNECTED_PEERS = 200\nconst OPTIMAL_POPULATION = 100000\nconst OPTIMAL_DEPTH = 12\n\ninterface Threshold {\n minimumValue: number\n explanation: string\n score: number\n}\n\ntype Thresholds = {\n connectedPeers: Threshold[]\n population: Threshold[]\n depth: Threshold[]\n}\n\ntype ThresholdValue = {\n score: number\n maximumScore: number\n explanation: string\n}\n\nexport type ThresholdValues = {\n connectedPeers: ThresholdValue\n population: ThresholdValue\n depth: ThresholdValue\n}\n\nconst GENERIC_ERROR = 'There may be issues with your Bee node or connection.'\n\nconst THRESHOLDS: Thresholds = {\n connectedPeers: [\n {\n minimumValue: OPTIMAL_CONNECTED_PEERS,\n explanation: `Perfect! ${OPTIMAL_CONNECTED_PEERS} or more connected peers indicate a healthy topology.`,\n score: 2,\n },\n {\n minimumValue: 1,\n explanation: `Your Bee node is connected to peers, but this number should ideally be above ${OPTIMAL_CONNECTED_PEERS}. If you have only started your Bee node, this number may increase quickly.`,\n score: 1,\n },\n {\n minimumValue: 0,\n explanation: 'Your Bee node has not connected to any peers. ' + GENERIC_ERROR,\n score: 0,\n },\n ],\n population: [\n {\n minimumValue: OPTIMAL_POPULATION,\n explanation:\n 'Perfect! Your Bee node seems to have a realistic value for the network size, which means everything is working well on your end.',\n score: 2,\n },\n {\n minimumValue: 1,\n explanation: `Population is usually above ${OPTIMAL_POPULATION.toLocaleString()}. If the number does not increase within a few hours, there may be issues with your Bee node.`,\n score: 1,\n },\n {\n minimumValue: 0,\n explanation: 'Your Bee node has no information on the network population. ' + GENERIC_ERROR,\n score: 0,\n },\n ],\n depth: [\n {\n minimumValue: OPTIMAL_DEPTH,\n explanation: 'Perfect! Your Bee node has the highest available depth.',\n score: 2,\n },\n {\n minimumValue: 1,\n explanation: `Your Bee node is supposed to reach a depth of ${OPTIMAL_DEPTH} eventually. Stagnation or decrease in this number may indicate problems with your Bee node.`,\n score: 1,\n },\n {\n minimumValue: 0,\n explanation: 'Your Bee node has not started building its topology yet. ' + GENERIC_ERROR,\n score: 0,\n },\n ],\n}\n\nexport function pickThreshold(key: keyof Thresholds, value: number): ThresholdValue {\n const thresholds = THRESHOLDS[key]\n const maximumScore = thresholds[0].score\n for (const item of thresholds) {\n if (value >= item.minimumValue) {\n return {\n score: item.score,\n maximumScore,\n explanation: item.explanation,\n }\n }\n }\n const last = thresholds[thresholds.length - 1]\n\n return {\n score: last.score,\n maximumScore,\n explanation: last.explanation,\n }\n}\n","import type { Topology } from '@ethersphere/bee-js'\nimport type { ReactElement } from 'react'\nimport { pickThreshold, ThresholdValues } from '../utils/threshold'\nimport ExpandableListItem from './ExpandableListItem'\n\ninterface Props {\n topology: Topology | null\n}\n\nconst TopologyStats = (props: Props): ReactElement => {\n const thresholds: ThresholdValues = {\n connectedPeers: pickThreshold('connectedPeers', props.topology?.connected || 0),\n population: pickThreshold('population', props.topology?.population || 0),\n depth: pickThreshold('depth', props.topology?.depth || 0),\n }\n\n const maximumTotalScore = Object.values(thresholds).reduce((sum, item) => sum + item.maximumScore, 0)\n const actualTotalScore = Object.values(thresholds).reduce((sum, item) => sum + item.score, 0)\n const percentageText = Math.round((actualTotalScore / maximumTotalScore) * 100) + '%'\n\n return (\n <>\n \n \n \n \n \n )\n}\n\nexport default TopologyStats\n","import { ReactElement, useContext } from 'react'\nimport { Button } from '@material-ui/core'\n\nimport TroubleshootConnectionCard from '../../components/TroubleshootConnectionCard'\nimport { Context as BeeContext } from '../../providers/Bee'\nimport ExpandableList from '../../components/ExpandableList'\nimport ExpandableListItem from '../../components/ExpandableListItem'\nimport ExpandableListItemKey from '../../components/ExpandableListItemKey'\nimport TopologyStats from '../../components/TopologyStats'\n\nexport default function Status(): ReactElement {\n const {\n status,\n latestUserVersion,\n isLatestBeeVersion,\n latestBeeVersionUrl,\n topology,\n nodeAddresses,\n chequebookAddress,\n } = useContext(BeeContext)\n\n if (!status.all) return \n\n return (\n
    \n \n \n \n Bee\n \n {` ${latestUserVersion || '-'} `}\n \n
    \n }\n />\n \n \n \n\n \n {nodeAddresses?.underlay.map(addr => (\n \n ))}\n \n \n \n \n \n \n \n \n \n
    \n )\n}\n","import { ReactElement, useContext } from 'react'\nimport ExpandableList from '../../components/ExpandableList'\nimport ExpandableListItemInput from '../../components/ExpandableListItemInput'\nimport { Context as SettingsContext } from '../../providers/Settings'\n\nexport default function Settings(): ReactElement {\n const { apiUrl, apiDebugUrl, setApiUrl, setDebugApiUrl, lockedApiSettings } = useContext(SettingsContext)\n\n return (\n \n \n \n \n )\n}\n","import { Collapse, ListItem } from '@material-ui/core'\nimport { createStyles, makeStyles, Theme } from '@material-ui/core/styles'\nimport { ExpandLess, ExpandMore } from '@material-ui/icons'\nimport { ReactElement, ReactNode, useState } from 'react'\n\nconst useStyles = makeStyles((theme: Theme) =>\n createStyles({\n root: {\n width: '100%',\n padding: 0,\n margin: 0,\n marginTop: theme.spacing(4),\n '&:first-child': {\n marginTop: 0,\n },\n },\n rootLevel1: { marginTop: theme.spacing(1) },\n rootLevel2: { marginTop: theme.spacing(0.5) },\n header: {\n backgroundColor: theme.palette.background.paper,\n },\n contentLevel0: {\n marginTop: theme.spacing(1),\n },\n contentLevel12: {\n marginTop: theme.spacing(0.25),\n },\n infoText: {\n color: '#c9c9c9',\n },\n }),\n)\n\ninterface Props {\n children: ReactNode\n expandable: ReactNode\n defaultOpen?: boolean\n}\n\nexport default function ExpandableElement({ children, expandable, defaultOpen }: Props): ReactElement | null {\n const classes = useStyles()\n const [open, setOpen] = useState(Boolean(defaultOpen))\n\n const handleClick = () => {\n setOpen(!open)\n }\n\n return (\n
    \n \n {children}\n {open ? : }\n \n \n
    {expandable}
    \n
    \n
    \n )\n}\n","import type { ReactElement } from 'react'\nimport ExpandableElement from '../../components/ExpandableElement'\nimport ExpandableList from '../../components/ExpandableList'\nimport ExpandableListItem from '../../components/ExpandableListItem'\nimport ExpandableListItemKey from '../../components/ExpandableListItemKey'\nimport { EnrichedPostageBatch } from '../../providers/Stamps'\nimport { getHumanReadableFileSize } from '../../utils/file'\nimport { PostageStamp } from './PostageStamp'\n\ninterface Props {\n postageStamps: EnrichedPostageBatch[] | null\n}\n\nfunction StampsTable({ postageStamps }: Props): ReactElement | null {\n if (postageStamps === null) return null\n\n return (\n \n {postageStamps.map(stamp => (\n \n \n \n \n \n \n }\n >\n \n \n ))}\n \n )\n}\n\nexport default StampsTable\n","import { CircularProgress, Container } from '@material-ui/core'\nimport { createStyles, makeStyles } from '@material-ui/core/styles'\nimport { ReactElement, useContext, useEffect } from 'react'\nimport { PlusSquare } from 'react-feather'\nimport { useNavigate } from 'react-router'\nimport { SwarmButton } from '../../components/SwarmButton'\nimport TroubleshootConnectionCard from '../../components/TroubleshootConnectionCard'\nimport { Context as BeeContext } from '../../providers/Bee'\nimport { Context as StampsContext } from '../../providers/Stamps'\nimport { ROUTES } from '../../routes'\nimport StampsTable from './StampsTable'\n\nconst useStyles = makeStyles(() =>\n createStyles({\n root: {\n width: '100%',\n display: 'grid',\n },\n actions: {\n display: 'flex',\n width: '100%',\n flex: '0 1 auto',\n flexWrap: 'wrap',\n alignItems: 'center',\n },\n }),\n)\n\nexport default function Stamp(): ReactElement {\n const classes = useStyles()\n\n const navigate = useNavigate()\n\n const { stamps, isLoading, error, start, stop } = useContext(StampsContext)\n const { status } = useContext(BeeContext)\n\n useEffect(() => {\n if (!status.all) return\n start()\n\n return () => stop()\n }, [status]) // eslint-disable-line react-hooks/exhaustive-deps\n\n if (!status.all) return \n\n function navigateToNewStamp() {\n navigate(ROUTES.STAMPS_NEW)\n }\n\n return (\n
    \n {error && (\n \n Error loading postage stamps details: {error.message}\n \n )}\n {!error && (\n <>\n
    \n \n Buy New Postage Stamp\n \n
    {isLoading && }
    \n
    \n \n \n )}\n
    \n )\n}\n","import { ReactElement } from 'react'\nimport { useNavigate } from 'react-router'\nimport { HistoryHeader } from '../../components/HistoryHeader'\nimport { ROUTES } from '../../routes'\nimport { PostageStampCreation } from './PostageStampCreation'\n\nexport function CreatePostageStampPage(): ReactElement {\n const navigate = useNavigate()\n\n function onFinished() {\n navigate(ROUTES.STAMPS)\n }\n\n return (\n
    \n Buy new postage stamp\n \n
    \n )\n}\n","import React, { ReactElement, ReactNode } from 'react'\nimport { makeStyles, Theme, createStyles } from '@material-ui/core/styles'\nimport { Tab, Tabs } from '@material-ui/core'\n\ninterface TabPanelProps {\n children?: ReactNode\n index: number\n value: number\n}\n\nfunction TabPanel(props: TabPanelProps) {\n const { children, value, index, ...other } = props\n\n return (\n \n )\n}\n\nconst useStyles = makeStyles((theme: Theme) =>\n createStyles({\n root: {\n flexGrow: 1,\n },\n content: {\n marginTop: theme.spacing(2),\n },\n }),\n)\n\ninterface TabsValues {\n component: ReactNode\n label: ReactNode\n}\n\ninterface Props {\n values: TabsValues[]\n index?: number\n indexChanged?: (index: number) => void\n}\n\nexport default function SimpleTabs({ values, index, indexChanged }: Props): ReactElement {\n const classes = useStyles()\n const [value, setValue] = React.useState(index || 0)\n\n const handleChange = (event: React.ChangeEvent>, newValue: number) => {\n if (indexChanged) indexChanged(newValue)\n else setValue(newValue)\n }\n\n const v = index !== undefined ? index : value\n\n return (\n
    \n \n {values.map(({ label }, idx) => (\n \n ))}\n \n
    \n {values.map(({ component }, idx) => (\n \n {component}\n \n ))}\n
    \n
    \n )\n}\n","import { createContext, ReactChild, ReactElement, useState, useEffect } from 'react'\n\n// These need to be numeric values as they are used as indexes in the TabsContainer\nexport enum Platforms {\n macOS = 0,\n Linux,\n Windows,\n iOS,\n Android,\n}\n\nexport enum SupportedPlatforms {\n macOS = Platforms.macOS,\n Linux = Platforms.Linux,\n}\n\ninterface ContextInterface {\n platform: SupportedPlatforms\n setPlatform: (platform: SupportedPlatforms) => void\n}\n\nconst initialValues: ContextInterface = {\n platform: SupportedPlatforms.macOS,\n setPlatform: () => {}, // eslint-disable-line\n}\n\nexport const Context = createContext(initialValues)\nexport const Consumer = Context.Consumer\n\ninterface Props {\n children: ReactChild\n}\n\nfunction isSupportedPlatform(platform: unknown): platform is SupportedPlatforms {\n return Object.keys(SupportedPlatforms).includes(platform as string)\n}\n\nfunction getOS(): Platforms | null {\n const userAgent = window.navigator.userAgent\n const platform = window.navigator.platform\n const macosPlatforms = ['Macintosh', 'MacIntel', 'MacPPC', 'Mac68K']\n const windowsPlatforms = ['Win32', 'Win64', 'Windows', 'WinCE']\n const iosPlatforms = ['iPhone', 'iPad', 'iPod']\n\n if (macosPlatforms.includes(platform)) return Platforms.macOS\n\n if (iosPlatforms.includes(platform)) return Platforms.iOS\n\n if (windowsPlatforms.includes(platform)) return Platforms.Windows\n\n if (/Android/.test(userAgent)) return Platforms.Android\n\n if (/Linux/.test(platform)) return Platforms.Linux\n\n return null\n}\n\nexport function Provider({ children }: Props): ReactElement {\n const [platform, setPlatform] = useState(SupportedPlatforms.Linux)\n\n // This is in useEffect as it really just needs to run once and not on each re-render\n useEffect(() => {\n const os = getOS()\n\n setPlatform(isSupportedPlatform(os) ? os : SupportedPlatforms.Linux)\n }, [])\n\n return {children}\n}\n","import type { ReactElement } from 'react'\nimport SyntaxHighlighter from 'react-syntax-highlighter'\n\ninterface Props {\n code: string\n language: string\n showLineNumbers?: boolean\n}\n\nconst CodeBlock = (props: Props): ReactElement => {\n return (\n
    \n \n {props.code}\n \n
    \n )\n}\n\nexport default CodeBlock\n","import { ReactElement, useContext } from 'react'\nimport TabsContainer from './TabsContainer'\nimport CodeBlock from './CodeBlock'\nimport { Context } from '../providers/Platform'\n\ninterface Props {\n linux: string\n mac: string\n showLineNumbers?: boolean\n}\n\nexport default function CodeBlockTabs(props: Props): ReactElement {\n const { platform, setPlatform } = useContext(Context)\n\n return (\n ,\n },\n {\n label: 'macOS',\n component: ,\n },\n ]}\n />\n )\n}\n","import type { ReactElement } from 'react'\nimport { CircularProgress } from '@material-ui/core'\n\ninterface Props {\n isOk: boolean\n isLoading?: boolean\n size?: number | string\n className?: string\n}\n\nexport default function StatusIcon({ isOk, size, className, isLoading }: Props): ReactElement {\n const s = size || '1rem'\n\n if (isLoading) return \n\n return (\n \n )\n}\n","import MuiAlert from '@material-ui/lab/Alert'\nimport { ReactElement, useContext } from 'react'\nimport CodeBlockTabs from '../../../components/CodeBlockTabs'\nimport ExpandableList from '../../../components/ExpandableList'\nimport ExpandableListItem from '../../../components/ExpandableListItem'\nimport ExpandableListItemInput from '../../../components/ExpandableListItemInput'\nimport ExpandableListItemNote from '../../../components/ExpandableListItemNote'\nimport StatusIcon from '../../../components/StatusIcon'\nimport { Context } from '../../../providers/Bee'\nimport { Context as SettingsContext } from '../../../providers/Settings'\n\nexport default function NodeConnectionCheck(): ReactElement | null {\n const { status, isLoading } = useContext(Context)\n const { setDebugApiUrl, apiDebugUrl } = useContext(SettingsContext)\n const isOk = status.debugApiConnection\n\n return (\n \n Connection to Bee Debug API\n \n }\n >\n \n {isOk\n ? 'The connection to the Bee nodes debug API has been successful'\n : 'We cannot connect to your nodes debug API. Please check the following to troubleshoot your issue.'}\n \n \n\n {!isOk && (\n \n \n
  • Check the status of your node by running the below command to see if your node is running.
  • \n \n
  • \n If your node is running, check your firewall settings to make sure that port 1635 (or your custom\n specified port) is bound to localhost. If your node is not running try executing the below command to\n start your bee node\n
  • \n \n Your debug node API should never be completely open to the internet. If you want to connect remotely,\n make sure your firewall settings are set to only allow specific trusted IP addresses and block all\n other ports. A simple google search for "what is my ip" will show you your computers public\n IP address to allow.\n \n \n
  • Run the commands to validate your node is running and see the log output.
  • \n \n
  • \n Lastly, check your nodes configuration settings to validate the debug API is enabled and the Cross\n Origin Resource Sharing (CORS) setting is configured to allow your host. Config parameter{' '}\n debug-api-enable must be set to true and{' '}\n cors-allowed-origins must be set to your host domain or IP (you can also use the\n wildcard {\"cors-allowed-origins: ['*']\"}). If edits are made to the configuration run the\n restart command below for changes to take effect.\n
  • \n \n \n }\n />\n
    \n )}\n \n )\n}\n","import { ReactElement, useContext } from 'react'\n\nimport CodeBlockTabs from '../../../components/CodeBlockTabs'\nimport { Context as SettingsContext } from '../../../providers/Settings'\nimport ExpandableList from '../../../components/ExpandableList'\nimport ExpandableListItem from '../../../components/ExpandableListItem'\nimport ExpandableListItemNote from '../../../components/ExpandableListItemNote'\nimport ExpandableListItemInput from '../../../components/ExpandableListItemInput'\nimport StatusIcon from '../../../components/StatusIcon'\nimport { Context } from '../../../providers/Bee'\n\nexport default function NodeConnectionCheck(): ReactElement | null {\n const { setApiUrl, apiUrl } = useContext(SettingsContext)\n const { status, isLoading } = useContext(Context)\n const isOk = status.apiConnection\n\n return (\n \n Connection to Bee API\n \n }\n >\n \n {isOk\n ? 'The connection to the Bee nodes API has been successful'\n : 'Could not connect to your Bee nodes API. Please check the troubleshoot below on how you may resolve it.'}\n \n \n {!isOk && (\n \n \n
  • Check the status of your node by running the below command to see if your node is running.
  • \n \n
  • \n If your node is running, check your firewall settings to make sure that port 1633 (or your custom\n specified port) is exposed to the internet. If your node is not running try executing the below\n command to start your bee node\n
  • \n \n
  • Run the commands to validate your node is running and see the log output.
  • \n \n \n }\n />\n
    \n )}\n \n )\n}\n","import { ReactElement, useContext } from 'react'\nimport CodeBlockTabs from '../../../components/CodeBlockTabs'\nimport ExpandableList from '../../../components/ExpandableList'\nimport ExpandableListItem from '../../../components/ExpandableListItem'\nimport ExpandableListItemNote from '../../../components/ExpandableListItemNote'\nimport StatusIcon from '../../../components/StatusIcon'\nimport { Context } from '../../../providers/Bee'\n\nexport default function VersionCheck(): ReactElement | null {\n const { status, isLoading, latestUserVersion, latestPublishedVersion, latestBeeVersionUrl } = useContext(Context)\n const isOk = status.version\n\n return (\n \n Bee Version\n \n }\n >\n \n {isOk ? (\n 'You are running the latest version of Bee.'\n ) : (\n <>\n Your Bee version is out of date. Please update to the{' '}\n \n latest\n {' '}\n before continuing. Rerun the installation script below to upgrade. For more information please see the{' '}\n \n Docs\n \n .\n \n \n )}\n \n \n \n \n )\n}\n","import { ReactElement, useContext } from 'react'\nimport ExpandableList from '../../../components/ExpandableList'\nimport ExpandableListItemKey from '../../../components/ExpandableListItemKey'\nimport ExpandableListItemNote from '../../../components/ExpandableListItemNote'\nimport StatusIcon from '../../../components/StatusIcon'\nimport { Context } from '../../../providers/Bee'\n\nexport default function EthereumConnectionCheck(): ReactElement | null {\n const { status, isLoading, nodeAddresses } = useContext(Context)\n const isOk = status.blockchainConnection\n\n return (\n \n Connection to Blockchain\n \n }\n >\n \n {isOk ? (\n 'Your node is connected to the xDai blockchain'\n ) : (\n <>\n Your Bee node must have access to the xDai blockchain, so that it can interact and deploy your chequebook\n contract. You can run{' '}\n \n your own xDai node\n \n , or use a provider instead - we recommend{' '}\n \n Getblock\n \n . By default, Bee expects a local node at http://localhost:8545. To use a provider instead, simply change\n the swap-endpoint in your configuration file.\n \n )}\n \n {nodeAddresses?.ethereum && }\n \n )\n}\n","import { useContext } from 'react'\nimport DepositModal from '../../../containers/DepositModal'\nimport type { ReactElement } from 'react'\nimport ExpandableList from '../../../components/ExpandableList'\nimport ExpandableListItemKey from '../../../components/ExpandableListItemKey'\nimport ExpandableListItemActions from '../../../components/ExpandableListItemActions'\nimport ExpandableListItemNote from '../../../components/ExpandableListItemNote'\nimport StatusIcon from '../../../components/StatusIcon'\nimport { Context } from '../../../providers/Bee'\n\nconst ChequebookDeployFund = (): ReactElement | null => {\n const { status, isLoading, chequebookAddress } = useContext(Context)\n const isOk = status.chequebook\n\n return (\n \n Chequebook Deployment & Funding\n \n }\n >\n \n {isOk ? (\n 'Your chequebook is deployed and funded'\n ) : (\n <>\n Your chequebook is either not deployed or funded. To run the node you will need xDAI and xBZZ on the xDai\n network. You may need to aquire BZZ (e.g. bzz.exchange) and bridge it to\n the xDai network through the omni bridge. To pay the\n transaction fees, you will also need xDAI token. You can purchase DAI on the network and bridge it to xDai\n network through the xDai Bridge. See the{' '}\n official xDai website for more information.\n \n )}\n \n {chequebookAddress && (\n <>\n \n \n \n \n \n )}\n \n )\n}\n\nexport default ChequebookDeployFund\n","import type { ReactElement } from 'react'\nimport { Route, Routes } from 'react-router-dom'\nimport Accounting from './pages/accounting'\nimport Feeds from './pages/feeds'\nimport CreateNewFeed from './pages/feeds/CreateNewFeed'\nimport { FeedSubpage } from './pages/feeds/FeedSubpage'\nimport UpdateFeed from './pages/feeds/UpdateFeed'\nimport { Download } from './pages/files/Download'\nimport { Share } from './pages/files/Share'\nimport { Upload } from './pages/files/Upload'\nimport { UploadLander } from './pages/files/UploadLander'\nimport Info from './pages/info'\nimport Settings from './pages/settings'\nimport Stamps from './pages/stamps'\nimport { CreatePostageStampPage } from './pages/stamps/CreatePostageStampPage'\nimport Status from './pages/status'\nimport Upgrade from './pages/upgrade'\n\nexport enum ROUTES {\n INFO = '/',\n UPGRADE = '/upgrade',\n FILES = '/files',\n UPLOAD = '/files/upload',\n UPLOAD_IN_PROGRESS = '/files/upload/workflow',\n DOWNLOAD = '/files/download',\n HASH = '/files/hash/:hash',\n ACCOUNTING = '/accounting',\n SETTINGS = '/settings',\n STAMPS = '/stamps',\n STAMPS_NEW = '/stamps/new',\n STATUS = '/status',\n FEEDS = '/feeds',\n FEEDS_NEW = '/feeds/new',\n FEEDS_UPDATE = '/feeds/update/:hash',\n FEEDS_PAGE = '/feeds/:uuid',\n}\n\nconst BaseRouter = (): ReactElement => (\n \n } />\n } />\n } />\n } />\n } />\n } />\n } />\n } />\n } />\n } />\n } />\n } />\n } />\n } />\n } />\n \n)\n\nexport default BaseRouter\n","import { ReactElement, useContext } from 'react'\nimport ExpandableList from '../../../components/ExpandableList'\nimport ExpandableListItemNote from '../../../components/ExpandableListItemNote'\nimport TopologyStats from '../../../components/TopologyStats'\nimport StatusIcon from '../../../components/StatusIcon'\nimport { Context } from '../../../providers/Bee'\n\nexport default function PeerConnection(): ReactElement | null {\n const { status, isLoading, topology } = useContext(Context)\n const isOk = status.topology\n\n return (\n \n Connection to Peers\n \n }\n >\n \n {isOk\n ? 'You are connected to other Bee nodes'\n : 'Your node is not connected to any peers. Please wait a bit if you just started the node, otherwise review your configuration file.'}\n \n\n \n \n )\n}\n","import type { ReactElement } from 'react'\n\nimport DebugConnectionCheck from './SetupSteps/DebugConnectionCheck'\nimport NodeConnectionCheck from './SetupSteps/NodeConnectionCheck'\nimport VersionCheck from './SetupSteps/VersionCheck'\nimport EthereumConnectionCheck from './SetupSteps/EthereumConnectionCheck'\nimport ChequebookDeployFund from './SetupSteps/ChequebookDeployFund'\nimport PeerConnection from './SetupSteps/PeerConnection'\n\nexport default function NodeSetupWorkflow(): ReactElement {\n return (\n
    \n \n \n \n \n \n \n
    \n )\n}\n","import { Box, Typography } from '@material-ui/core'\nimport { ReactElement, useEffect, useState } from 'react'\nimport { Send } from 'react-feather'\nimport { Loading } from '../../components/Loading'\nimport { SwarmButton } from '../../components/SwarmButton'\nimport { SwarmTextInput } from '../../components/SwarmTextInput'\n\nexport default function UpgradePage(): ReactElement {\n const [node, setNode] = useState | null>(null)\n const [loading, setLoading] = useState(false)\n const [rpcProvider, setRpcProvider] = useState('https://dai.poa.network/')\n\n useEffect(() => {\n fetch('http://localhost:1635/node')\n .then(r => r.json())\n .then(json => setNode(json))\n }, [])\n\n async function onFund() {\n setLoading(true)\n try {\n const status = await fetch('http://localhost:5000/status').then(r => r.json())\n const { address } = status\n await fetch(`http://getxdai.co/${address}/0.01`, {\n method: 'POST',\n })\n } finally {\n setLoading(false)\n }\n }\n\n async function onUpgrade() {\n setLoading(true)\n try {\n await fetch('http://localhost:5000/config', {\n method: 'PATCH',\n headers: {\n 'content-type': 'application/json',\n },\n body: JSON.stringify({\n 'chain-enable': true,\n 'swap-enable': true,\n 'swap-endpoint': rpcProvider,\n }),\n })\n await fetch('http://localhost:5000/restart', {\n method: 'POST',\n })\n } finally {\n setLoading(false)\n }\n }\n\n if (!node) {\n return \n }\n\n if (node.beeMode !== 'ultra-light') {\n return (\n
    \n Already upgraded\n
    \n )\n }\n\n return (\n
    \n \n \n Fund\n \n \n \n {\n setRpcProvider(event.target.value)\n }}\n />\n \n \n Upgrade to Light Node\n \n
    \n )\n}\n","import type { ReactElement, ReactNode } from 'react'\nimport { useLocation, matchPath } from 'react-router-dom'\n\nimport { createStyles, Theme, makeStyles, withStyles } from '@material-ui/core/styles'\nimport { ListItemText, ListItemIcon, ListItem } from '@material-ui/core'\n\nconst StyledListItem = withStyles((theme: Theme) => ({\n root: {\n paddingLeft: theme.spacing(4),\n paddingRight: theme.spacing(4),\n borderLeft: '4px solid rgba(0,0,0,0)',\n '&.Mui-selected, &.Mui-selected:hover': {\n borderLeft: `4px solid ${theme.palette.primary.main}`,\n backgroundColor: '#2c2c2c',\n color: '#f9f9f9',\n },\n },\n button: {\n '&:hover': {\n backgroundColor: '#2c2c2c',\n color: '#f9f9f9',\n\n // https://github.com/mui-org/material-ui/issues/22543\n '@media (hover: none)': {\n backgroundColor: '#2c2c2c',\n color: '#f9f9f9',\n },\n },\n },\n}))(ListItem)\n\nconst useStyles = makeStyles((theme: Theme) =>\n createStyles({\n icon: {\n color: 'inherit',\n },\n activeIcon: {\n color: theme.palette.primary.main,\n },\n }),\n)\n\ninterface Props {\n iconStart?: ReactNode\n iconEnd?: ReactNode\n path?: string\n label: ReactNode\n}\n\nexport default function SideBarItem({ iconStart, iconEnd, path, label }: Props): ReactElement {\n const classes = useStyles()\n const location = useLocation()\n const isSelected = Boolean(path && matchPath(location.pathname, path))\n\n return (\n \n {iconStart}\n \n {iconEnd}\n \n )\n}\n","import { ReactElement, useContext } from 'react'\nimport { useLocation, matchPath } from 'react-router-dom'\nimport { ArrowRight } from 'react-feather'\n\nimport { createStyles, Theme, makeStyles } from '@material-ui/core/styles'\nimport { ListItemText, ListItemIcon, ListItem, Typography } from '@material-ui/core'\nimport { Context } from '../providers/Bee'\nimport StatusIcon from './StatusIcon'\n\nconst useStyles = makeStyles((theme: Theme) =>\n createStyles({\n icon: {\n color: 'inherit',\n },\n iconSmall: {\n height: theme.spacing(2),\n },\n\n root: {\n height: theme.spacing(4),\n paddingLeft: theme.spacing(1),\n paddingRight: theme.spacing(4),\n color: '#f9f9f9',\n borderLeft: '0px solid rgba(0,0,0,0)',\n '&.Mui-selected, &.Mui-selected:hover': {\n borderLeft: `0px solid ${theme.palette.primary.main}`,\n backgroundColor: '#2c2c2c',\n },\n },\n rootError: {\n backgroundColor: 'rgba(255, 58, 82, 0.25)',\n },\n button: {\n '&:hover': {\n backgroundColor: '#2c2c2c',\n color: 'white',\n\n // https://github.com/mui-org/material-ui/issues/22543\n '@media (hover: none)': {\n backgroundColor: '#2c2c2c',\n color: 'white',\n },\n },\n },\n smallerText: {\n fontSize: '0.9rem',\n },\n }),\n)\n\ninterface Props {\n path?: string\n}\n\nexport default function SideBarItem({ path }: Props): ReactElement {\n const { status, isLoading } = useContext(Context)\n const classes = useStyles()\n const location = useLocation()\n const isSelected = Boolean(path && matchPath(location.pathname, path))\n\n return (\n \n \n \n \n {`Node ${status.all ? 'OK' : 'Error'}`}}\n />\n \n {status.all ? null : }\n \n \n )\n}\n","import { Divider, Drawer, Grid, Link as MUILink, List } from '@material-ui/core'\nimport { createStyles, makeStyles, Theme } from '@material-ui/core/styles'\nimport { OpenInNewSharp } from '@material-ui/icons'\nimport type { ReactElement } from 'react'\nimport { Bookmark, BookOpen, DollarSign, FileText, Home, Layers, Send, Settings } from 'react-feather'\nimport { Link } from 'react-router-dom'\nimport Logo from '../assets/logo.svg'\nimport { config } from '../config'\nimport { ROUTES } from '../routes'\nimport SideBarItem from './SideBarItem'\nimport SideBarStatus from './SideBarStatus'\n\nconst navBarItems = [\n {\n label: 'Info',\n path: ROUTES.INFO,\n icon: Home,\n },\n {\n label: 'Upgrade',\n path: ROUTES.UPGRADE,\n icon: Send,\n },\n {\n label: 'Files',\n path: ROUTES.UPLOAD,\n icon: FileText,\n },\n {\n label: 'Feeds',\n path: ROUTES.FEEDS,\n icon: Bookmark,\n },\n {\n label: 'Stamps',\n path: ROUTES.STAMPS,\n icon: Layers,\n },\n {\n label: 'Accounting',\n path: ROUTES.ACCOUNTING,\n icon: DollarSign,\n },\n {\n label: 'Settings',\n path: ROUTES.SETTINGS,\n icon: Settings,\n },\n]\n\nconst drawerWidth = 300\n\nconst useStyles = makeStyles((theme: Theme) =>\n createStyles({\n root: {\n flexWrap: 'nowrap',\n minHeight: '100vh',\n paddingTop: theme.spacing(8),\n paddingBottom: theme.spacing(8),\n },\n drawer: {\n width: drawerWidth,\n flexShrink: 0,\n },\n drawerPaper: {\n width: drawerWidth,\n backgroundColor: '#212121',\n },\n logo: {\n marginLeft: theme.spacing(8),\n marginRight: theme.spacing(8),\n },\n icon: {\n height: theme.spacing(4),\n },\n iconSmall: {\n height: theme.spacing(2),\n },\n divider: {\n backgroundColor: '#2c2c2c',\n marginLeft: theme.spacing(4),\n marginRight: theme.spacing(4),\n },\n link: {\n color: '#9f9f9f',\n textDecoration: 'none',\n '&:hover': {\n textDecoration: 'none',\n\n // https://github.com/mui-org/material-ui/issues/22543\n '@media (hover: none)': {\n textDecoration: 'none',\n },\n },\n },\n }),\n)\n\nexport default function SideBar(): ReactElement {\n const classes = useStyles()\n\n return (\n \n \n \n \n \"swarm\"\n \n \n \n \n {navBarItems.map(p => (\n \n }\n path={p.path}\n label={p.label}\n />\n \n ))}\n \n \n \n \n }\n iconEnd={}\n label={Docs}\n />\n \n \n \n \n \n \n \n \n \n \n )\n}\n","import { useContext, ReactElement } from 'react'\nimport ErrorBoundary from '../components/ErrorBoundary'\nimport AlertVersion from '../components/AlertVersion'\nimport { Container, CircularProgress } from '@material-ui/core'\n\nimport { createStyles, Theme, makeStyles } from '@material-ui/core/styles'\n\nimport SideBar from '../components/SideBar'\n\nimport { Context } from '../providers/Bee'\n\nconst useStyles = makeStyles((theme: Theme) =>\n createStyles({\n content: {\n backgroundColor: theme.palette.background.default,\n minHeight: '100vh',\n },\n }),\n)\n\ninterface Props {\n children?: ReactElement\n}\n\nconst Dashboard = (props: Props): ReactElement => {\n const classes = useStyles()\n\n const { isLoading } = useContext(Context)\n\n return (\n
    \n \n \n \n <>\n \n {isLoading ? (\n
    \n \n
    \n ) : (\n props.children\n )}\n \n
    \n
    \n
    \n )\n}\n\nexport default Dashboard\n","import { createTheme, Theme } from '@material-ui/core/styles'\nimport { orange } from '@material-ui/core/colors'\n\ndeclare module '@material-ui/core/styles/createPalette' {\n interface TypeBackground {\n appBar: string\n }\n}\n\n// Overwriting default components styles\nconst componentsOverrides = (theme: Theme) => ({\n MuiListItem: {\n button: {\n '&:hover': {\n backgroundColor: '#fcf2e8',\n color: theme.palette.primary.main,\n // https://github.com/mui-org/material-ui/issues/22543\n '@media (hover: none)': {\n backgroundColor: '#fcf2e8',\n color: theme.palette.primary.main,\n },\n },\n },\n },\n MuiContainer: {\n root: { padding: theme.spacing(8) },\n maxWidthXs: { padding: theme.spacing(8) },\n maxWidthSm: { padding: theme.spacing(8) },\n maxWidthMd: { padding: theme.spacing(8) },\n maxWidthLg: { padding: theme.spacing(8) },\n maxWidthXl: { padding: theme.spacing(8) },\n },\n MuiButton: {\n startIcon: { marginLeft: theme.spacing(1) },\n endIcon: { marginRight: theme.spacing(1) },\n outlined: {\n border: 'none',\n borderRadius: theme.spacing(10),\n color: theme.palette.primary.main,\n backgroundColor: '#fcf2e8',\n },\n outlinedSizeSmall: {\n padding: theme.spacing(1),\n paddingLeft: theme.spacing(2),\n paddingRight: theme.spacing(2),\n boxShadow: 'none',\n '&:hover': {\n backgroundColor: theme.palette.primary.main,\n color: 'white',\n boxShadow: 'none',\n // https://github.com/mui-org/material-ui/issues/22543\n '@media (hover: none)': {\n backgroundColor: theme.palette.primary.main,\n color: 'white',\n boxShadow: 'none',\n },\n },\n },\n outlinedSizeLarge: {\n padding: theme.spacing(4),\n borderRadius: 0,\n boxShadow: 'none',\n '&:hover': {\n backgroundColor: theme.palette.primary.main,\n color: 'white',\n boxShadow: 'none',\n // https://github.com/mui-org/material-ui/issues/22543\n '@media (hover: none)': {\n backgroundColor: theme.palette.primary.main,\n color: 'white',\n boxShadow: 'none',\n },\n },\n },\n containedSizeLarge: {\n padding: theme.spacing(4),\n borderRadius: 0,\n boxShadow: 'none',\n '&:hover': {\n backgroundColor: theme.palette.primary.main,\n color: 'white',\n boxShadow: 'none',\n // https://github.com/mui-org/material-ui/issues/22543\n '@media (hover: none)': {\n backgroundColor: theme.palette.primary.main,\n color: 'white',\n boxShadow: 'none',\n },\n },\n },\n containedSizeSmall: {\n padding: theme.spacing(1),\n paddingLeft: theme.spacing(2),\n paddingRight: theme.spacing(2),\n borderRadius: 0,\n boxShadow: 'none',\n '&:hover': {\n backgroundColor: theme.palette.primary.main,\n color: 'white',\n boxShadow: 'none',\n // https://github.com/mui-org/material-ui/issues/22543\n '@media (hover: none)': {\n backgroundColor: theme.palette.primary.main,\n color: 'white',\n boxShadow: 'none',\n },\n },\n },\n contained: {\n padding: theme.spacing(2),\n backgroundColor: 'white',\n boxShadow: 'none',\n borderRadius: 0,\n '&:hover': {\n backgroundColor: theme.palette.primary.main,\n color: 'white',\n boxShadow: 'none',\n // https://github.com/mui-org/material-ui/issues/22543\n '@media (hover: none)': {\n backgroundColor: theme.palette.primary.main,\n color: 'white',\n boxShadow: 'none',\n },\n },\n '&:focus': {\n backgroundColor: theme.palette.primary.main,\n color: 'white',\n },\n '&:active': {\n backgroundColor: theme.palette.primary.main,\n color: 'white',\n },\n '&:disabled': {\n backgroundColor: 'white',\n },\n },\n },\n MuiTab: {\n root: {\n backgroundColor: theme.palette.background.paper,\n '&:hover': {\n backgroundColor: '#fcf2e8',\n color: theme.palette.primary.main,\n opacity: 1,\n },\n '&$selected': {\n fontWeight: theme.typography.fontWeightMedium,\n },\n },\n textColorInherit: {\n opacity: 0.5,\n },\n },\n MuiTabs: {\n root: {\n borderBottom: 'none',\n },\n indicator: {\n backgroundColor: 'transparent',\n },\n },\n})\n\nconst propsOverrides = {\n MuiTab: {\n disableRipple: true,\n },\n MuiButtonBase: {\n disableRipple: true,\n },\n}\n\nexport const theme = createTheme({\n palette: {\n type: 'light',\n background: {\n default: '#efefef',\n },\n primary: {\n light: '#fcf2e8',\n main: '#dd7700',\n dark: orange[800],\n },\n secondary: {\n main: '#333333',\n },\n },\n typography: {\n fontFamily: ['Work Sans', 'Montserrat', 'Nunito', 'Roboto', '\"Helvetica Neue\"', 'Arial', 'sans-serif'].join(','),\n h1: {\n fontSize: '1.3rem',\n fontWeight: 500,\n },\n h2: {\n fontSize: '1rem',\n fontWeight: 500,\n },\n h3: {\n fontSize: '0.8rem',\n fontWeight: 500,\n },\n body2: {\n fontFamily: '\"IBM Plex Mono\", monospace',\n fontWeight: 500,\n fontSize: '1rem',\n },\n },\n})\n\ntheme.overrides = componentsOverrides(theme)\ntheme.props = propsOverrides\n","import CssBaseline from '@material-ui/core/CssBaseline'\nimport { ThemeProvider } from '@material-ui/core/styles'\nimport { SnackbarProvider } from 'notistack'\nimport React, { ReactElement } from 'react'\nimport { HashRouter as Router } from 'react-router-dom'\nimport './App.css'\nimport Dashboard from './layout/Dashboard'\nimport { Provider as BeeProvider } from './providers/Bee'\nimport { Provider as FeedsProvider } from './providers/Feeds'\nimport { Provider as FileProvider } from './providers/File'\nimport { Provider as PlatformProvider } from './providers/Platform'\nimport { Provider as SettingsProvider } from './providers/Settings'\nimport { Provider as StampsProvider } from './providers/Stamps'\nimport BaseRouter from './routes'\nimport { theme } from './theme'\n\ninterface Props {\n beeApiUrl?: string\n beeDebugApiUrl?: string\n lockedApiSettings?: boolean\n}\n\nconst App = ({ beeApiUrl, beeDebugApiUrl, lockedApiSettings }: Props): ReactElement => (\n
    \n \n \n \n \n \n \n \n \n \n <>\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n
    \n)\n\nexport default App\n","import { ReportHandler } from 'web-vitals'\n\nconst reportWebVitals = (onPerfEntry?: ReportHandler): void => {\n if (onPerfEntry && onPerfEntry instanceof Function) {\n import('web-vitals').then(({ getCLS, getFID, getFCP, getLCP, getTTFB }) => {\n getCLS(onPerfEntry)\n getFID(onPerfEntry)\n getFCP(onPerfEntry)\n getLCP(onPerfEntry)\n getTTFB(onPerfEntry)\n })\n }\n}\n\nexport default reportWebVitals\n","import React from 'react'\nimport ReactDOM from 'react-dom'\nimport './index.css'\nimport App from './App'\nimport reportWebVitals from './reportWebVitals'\n\nReactDOM.render(\n \n \n ,\n document.getElementById('root'),\n)\n\n// If you want to start measuring performance in your app, pass a function\n// to log results (for example: reportWebVitals(console.log))\n// or send to an analytics endpoint. Learn more: https://bit.ly/CRA-vitals\nreportWebVitals()\n"],"sourceRoot":""} \ No newline at end of file diff --git a/static/installer/asset-manifest.json b/static/installer/asset-manifest.json index d4b1bf8..fbc574b 100644 --- a/static/installer/asset-manifest.json +++ b/static/installer/asset-manifest.json @@ -1,13 +1,13 @@ { "files": { - "main.css": "/installer/static/css/main.3814743f.css", - "main.js": "/installer/static/js/main.59899838.js", + "main.css": "/installer/static/css/main.cfed29a4.css", + "main.js": "/installer/static/js/main.334f6d10.js", "index.html": "/installer/index.html", - "main.3814743f.css.map": "/installer/static/css/main.3814743f.css.map", - "main.59899838.js.map": "/installer/static/js/main.59899838.js.map" + "main.cfed29a4.css.map": "/installer/static/css/main.cfed29a4.css.map", + "main.334f6d10.js.map": "/installer/static/js/main.334f6d10.js.map" }, "entrypoints": [ - "static/css/main.3814743f.css", - "static/js/main.59899838.js" + "static/css/main.cfed29a4.css", + "static/js/main.334f6d10.js" ] } \ No newline at end of file diff --git a/static/installer/css/main.cfed29a4.css b/static/installer/css/main.cfed29a4.css new file mode 100644 index 0000000..a390781 --- /dev/null +++ b/static/installer/css/main.cfed29a4.css @@ -0,0 +1,2 @@ +body{-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale;font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Oxygen,Ubuntu,Cantarell,Fira Sans,Droid Sans,Helvetica Neue,sans-serif}body,p{margin:0}p{padding:0}#root{align-items:center;background:#eee;display:flex;flex-direction:column;justify-content:center;min-height:100vh}.todo-item{background:#fff;box-shadow:0 0 4px #ddd;color:#888;margin-bottom:16px;padding:1rem;width:500px}.todo-body{align-items:center;display:flex}.todo-item p{margin-left:8px}.todo-item code{display:block;font-size:90%;margin-top:8px}@-webkit-keyframes spinner{0%{-webkit-transform:rotate(0deg);transform:rotate(0deg)}to{-webkit-transform:rotate(1turn);transform:rotate(1turn)}}@keyframes spinner{0%{-webkit-transform:rotate(0deg);transform:rotate(0deg)}to{-webkit-transform:rotate(1turn);transform:rotate(1turn)}}.spinner{-webkit-animation:spinner 1s linear infinite;animation:spinner 1s linear infinite}button{background:#fff;border:0;box-shadow:0 0 4px #ddd;color:#303030;font-size:15px;padding:1rem 2rem}button:disabled{background:#ddd;color:#aaa} +/*# sourceMappingURL=main.cfed29a4.css.map*/ \ No newline at end of file diff --git a/static/installer/css/main.cfed29a4.css.map b/static/installer/css/main.cfed29a4.css.map new file mode 100644 index 0000000..21dfb46 --- /dev/null +++ b/static/installer/css/main.cfed29a4.css.map @@ -0,0 +1 @@ +{"version":3,"file":"static/css/main.cfed29a4.css","mappings":"AAAA,KAII,kCAAmC,CACnC,iCAAkC,CAHlC,mIAIJ,CAEA,OAPI,QAUJ,CAHA,EAEI,SACJ,CAEA,MAII,kBAAmB,CAEnB,eAAgB,CALhB,YAAa,CACb,qBAAsB,CACtB,sBAAuB,CAEvB,gBAEJ,CAEA,WACI,eAAgB,CAIhB,uBAAwB,CADxB,UAAW,CADX,kBAAmB,CADnB,YAAa,CAIb,WACJ,CAEA,WAEI,kBAAmB,CADnB,YAEJ,CAEA,aACI,eACJ,CAEA,gBACI,aAAc,CAEd,aAAc,CADd,cAEJ,CAEA,2BACI,GACI,8BAAuB,CAAvB,sBACJ,CACA,GACI,+BAAyB,CAAzB,uBACJ,CACJ,CAPA,mBACI,GACI,8BAAuB,CAAvB,sBACJ,CACA,GACI,+BAAyB,CAAzB,uBACJ,CACJ,CAEA,SACI,4CAAqC,CAArC,oCACJ,CAEA,OAEI,eAAgB,CADhB,QAAS,CAKT,uBAAwB,CAFxB,aAAc,CACd,cAAe,CAFf,iBAIJ,CAEA,gBACI,eAAgB,CAChB,UACJ","sources":["index.css"],"sourcesContent":["body {\n margin: 0;\n font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', 'Fira Sans',\n 'Droid Sans', 'Helvetica Neue', sans-serif;\n -webkit-font-smoothing: antialiased;\n -moz-osx-font-smoothing: grayscale;\n}\n\np {\n margin: 0;\n padding: 0;\n}\n\n#root {\n display: flex;\n flex-direction: column;\n justify-content: center;\n align-items: center;\n min-height: 100vh;\n background: #eee;\n}\n\n.todo-item {\n background: #fff;\n padding: 1rem;\n margin-bottom: 16px;\n color: #888;\n box-shadow: 0 0 4px #ddd;\n width: 500px;\n}\n\n.todo-body {\n display: flex;\n align-items: center;\n}\n\n.todo-item p {\n margin-left: 8px;\n}\n\n.todo-item code {\n display: block;\n margin-top: 8px;\n font-size: 90%;\n}\n\n@keyframes spinner {\n 0% {\n transform: rotate(0deg);\n }\n 100% {\n transform: rotate(360deg);\n }\n}\n\n.spinner {\n animation: spinner 1s infinite linear;\n}\n\nbutton {\n border: 0;\n background: #fff;\n padding: 1rem 2rem;\n color: #303030;\n font-size: 15px;\n box-shadow: 0 0 4px #ddd;\n}\n\nbutton:disabled {\n background: #ddd;\n color: #aaa;\n}\n"],"names":[],"sourceRoot":""} \ No newline at end of file diff --git a/static/installer/index.html b/static/installer/index.html index 19941fd..32b663c 100644 --- a/static/installer/index.html +++ b/static/installer/index.html @@ -1 +1 @@ -React App
    \ No newline at end of file +React App
    \ No newline at end of file diff --git a/static/installer/js/main.334f6d10.js b/static/installer/js/main.334f6d10.js new file mode 100644 index 0000000..52f5649 --- /dev/null +++ b/static/installer/js/main.334f6d10.js @@ -0,0 +1,3 @@ +/*! For license information please see main.334f6d10.js.LICENSE.txt */ +!function(){var e={757:function(e,t,n){e.exports=n(727)},725:function(e){"use strict";var t=Object.getOwnPropertySymbols,n=Object.prototype.hasOwnProperty,r=Object.prototype.propertyIsEnumerable;function l(e){if(null===e||void 0===e)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(e)}e.exports=function(){try{if(!Object.assign)return!1;var e=new String("abc");if(e[5]="de","5"===Object.getOwnPropertyNames(e)[0])return!1;for(var t={},n=0;n<10;n++)t["_"+String.fromCharCode(n)]=n;if("0123456789"!==Object.getOwnPropertyNames(t).map((function(e){return t[e]})).join(""))return!1;var r={};return"abcdefghijklmnopqrst".split("").forEach((function(e){r[e]=e})),"abcdefghijklmnopqrst"===Object.keys(Object.assign({},r)).join("")}catch(l){return!1}}()?Object.assign:function(e,a){for(var o,i,u=l(e),c=1;c