(this["webpackJsonpipfs-webui"]=this["webpackJsonpipfs-webui"]||[]).push([[11],{1017:function(e,t,a){"use strict";var n=a(3),c=a(1),s=a(77),r=a(62),l=a(63),o=a(108),i=a(107),d=a(0),u=a.n(d),b=a(182),j=a(964),p=a(39),h=a(957),m=function(e){Object(o.a)(a,e);var t=Object(i.a)(a);function a(e){var n;return Object(r.a)(this,a),(n=t.call(this,e)).onChange=function(e){var t=e.target.value;n.props.onChange&&(t=n.props.onChange(t)),n.props.onInputChange&&n.props.onInputChange(t),n.setState({value:t})},n.onSubmit=function(){(!n.props.validate||n.props.validate&&n.props.validate(n.state.value))&&n.props.onSubmit(n.state.value)},n.onKeyPress=function(e){"Enter"===e.key&&n.onSubmit()},n.state={value:e.defaultValue},n}return Object(l.a)(a,[{key:"render",value:function(){var e=this.props,t=e.t,a=e.onCancel,r=(e.onChange,e.onInputChange,e.mustBeDifferent,e.onSubmit,e.className),l=e.Icon,o=e.submitText,i=(e.validate,e.defaultValue,e.description),d=e.title,u=(e.error,e.loading),h=Object(s.a)(e,["t","onCancel","onChange","onInputChange","mustBeDifferent","onSubmit","className","Icon","submitText","validate","defaultValue","description","title","error","loading"]);return Object(c.jsxs)(j.a,Object(n.a)(Object(n.a)({},h),{},{className:r,onCancel:a,children:[Object(c.jsxs)(j.c,{title:d,Icon:l,children:[i&&"object"===typeof i&&i,i&&"string"===typeof i&&Object(c.jsx)("p",{className:"charcoal w-90 tl center",children:i}),Object(c.jsx)("input",{onChange:this.onChange,onKeyPress:this.onKeyPress,value:this.state.value,required:!0,className:"input-reset charcoal ba b--black-20 br1 pa2 mb2 db w-90 center focus-outline ".concat(this.inputClass),type:"text"})]}),Object(c.jsxs)(j.b,{children:[Object(c.jsx)(b.a,{className:"ma2 tc",bg:"bg-gray",onClick:a,children:t("actions.cancel")}),Object(c.jsx)(b.a,{className:"ma2 tc",bg:"bg-teal",disabled:this.isDisabled,onClick:this.onSubmit,children:o})]}),u&&Object(c.jsxs)("div",{className:"flex items-center justify-center absolute top-0 left-0 right-0 bottom-0",children:[Object(c.jsx)("div",{className:"absolute top-0 left-0 right-0 bottom-0 bg-light-gray o-80"}),Object(c.jsx)(p.a,{style:{width:"50%",margin:"auto"}})]})]}))}},{key:"inputClass",get:function(){return!this.props.validate||""===this.state.value||this.props.mustBeDifferent&&this.state.value===this.props.defaultValue?"":this.props.error?"b--red-muted focus-outline-red":this.props.validate(this.state.value)?"b--green-muted focus-outline-green":"b--red-muted focus-outline-red"}},{key:"isDisabled",get:function(){return!!(""===this.state.value||this.props.mustBeDifferent&&this.state.value===this.props.defaultValue)||!!this.props.validate&&!this.props.validate(this.state.value)}}]),a}(u.a.Component);m.defaultProps={className:"",defaultValue:"",submitText:"Save",mustBeDifferent:!1},t.a=Object(h.a)("app")(m)},1018:function(e,t,a){"use strict";var n=a(3),c=a(1),s=a(77),r=a(0),l=a(37),o=a(964),i=a(988),d=a(182),u=a(976),b=a(975),j=a(989),p=a(14),h=function(e){var t=e.command,a=e.t,r=e.onLeave,l=e.className,u=e.downloadConfig,h=Object(s.a)(e,["command","t","onLeave","className","downloadConfig"]);return Object(c.jsxs)(o.a,Object(n.a)(Object(n.a)({},h),{},{className:l,onCancel:r,style:{maxWidth:"40em"},children:[Object(c.jsxs)(o.c,{Icon:i.a,children:[Object(c.jsx)("p",{className:"charcoal w-80 center",style:{lineHeight:"1.3"},children:a("app:cliModal.description")}),Object(c.jsxs)("p",{className:"charcoal-muted w-90 center",children:[t&&t===p.h[p.f.UPDATE_IPFS_CONFIG]()?a("settings:cliModal.extraNotesJsonConfig"):"",t&&t.startsWith(p.g.PIN_OBJECT)?a("files:cliModal.extraNotesPinning"):""]}),Object(c.jsx)("div",{children:Object(c.jsx)(b.a,{className:"tl",title:"Shell",children:Object(c.jsxs)("code",{className:"db",children:[Object(c.jsx)("b",{className:"no-select",children:"$ "}),t]})})})]}),Object(c.jsxs)(o.b,{children:[Object(c.jsx)("div",{children:Object(c.jsx)(d.a,{className:"ma2 tc",bg:"bg-gray",onClick:r,children:a("app:actions.close")})}),Object(c.jsxs)("div",{className:"flex items-center",children:[t&&t===p.h[p.f.UPDATE_IPFS_CONFIG]()?Object(c.jsx)(j.a,{onClick:u,className:"dib fill-link pointer",style:{height:38}}):Object(c.jsx)("div",{}),Object(c.jsx)(d.a,{className:"ma2 tc",onClick:function(){return e=t,void navigator.clipboard.writeText(e).then((function(){r()}));var e},children:a("app:actions.copy")})]})]})]}))};h.defaultProps={className:""},t.a=Object(l.b)("doOpenCliTutorModal","selectIsCliTutorModalOpen","selectIsCliTutorModeEnabled",(function(e){var t=e.t,a=e.filesPage,n=e.isCliTutorModeEnabled,s=e.onLeave,l=e.isCliTutorModalOpen,o=e.command,d=e.config,b=e.showIcon,j=e.doOpenCliTutorModal;return n?a?Object(c.jsx)(h,{className:"outline-0",onLeave:s,t:t,command:o}):Object(c.jsxs)(r.Fragment,{children:[b?Object(c.jsx)(i.a,{onClick:function(){return j(!0)},className:"dib fill-link pointer mh2",style:{height:44}}):Object(c.jsx)("div",{}),Object(c.jsx)(u.a,{show:l,onLeave:function(){return j(!1)},children:Object(c.jsx)(h,{className:"outline-0",onLeave:function(){return j(!1)},t:t,command:o,downloadConfig:function(){return function(e){var t=window.URL.createObjectURL(new Blob([e])),a=document.createElement("a");a.style.display="none",a.href=t,a.download="settings.json",document.body.appendChild(a),a.click(),window.URL.revokeObjectURL(t)}(d)}})})]}):null}))},1045:function(e,t,a){"use strict";var n=a(3),c=a(1);a(0);t.a=function(e){return Object(c.jsx)("svg",Object(n.a)(Object(n.a)({viewBox:"0 0 100 100"},e),{},{children:Object(c.jsx)("path",{d:"M90 39.9a4.75 4.75 0 0 0-5.4-3.9 4.66 4.66 0 0 0-2.18 1l-8.25-5.41a4.59 4.59 0 0 0 .11-2 4.81 4.81 0 0 0-.25-.94l5.3-4.33a1.22 1.22 0 0 0 .17.15 4.67 4.67 0 0 0 2.78.91 4.79 4.79 0 0 0 3.85-2 4.75 4.75 0 0 0-4.58-7.48 4.74 4.74 0 0 0-4 5.43c0 .13.07.26.1.39l-5.59 4.57a4.69 4.69 0 0 0-3.26-.69 4.85 4.85 0 0 0-.63.16L58.16 11.6c.06-.07.12-.12.17-.19a4.68 4.68 0 0 0 .85-3.53 4.76 4.76 0 1 0-4 5.43c.14 0 .26-.07.4-.1L65.77 27.5a4.73 4.73 0 0 0-.86 3.5c0 .15.07.29.1.43L50 41.13l-.17-.13a4.73 4.73 0 0 0-3.53-.84 4.75 4.75 0 0 0-.7 9.21l.4 25.88a4.73 4.73 0 0 0-2.14 1.53L19.4 67.92a6.35 6.35 0 0 0 0-.87 4.73 4.73 0 0 0-1.9-3.1 4.75 4.75 0 1 0-2.79 8.59 4.73 4.73 0 0 0 3.71-1.81L42.8 79.6a5 5 0 0 0 .05.86c0 .16.08.31.12.46l-10.3 6.75-.14-.13a4.73 4.73 0 0 0-3.53-.85 4.75 4.75 0 0 0 .73 9.44 4.84 4.84 0 0 0 .75-.06 4.73 4.73 0 0 0 3.94-5.43 3.43 3.43 0 0 0-.11-.46l10.3-6.75a4.64 4.64 0 0 0 3.67 1 4.75 4.75 0 0 0 3.61-2.82l12 1a4.73 4.73 0 1 0 .24-3l-12-1A4.73 4.73 0 0 0 49 75.22l-.4-25.93a4.72 4.72 0 0 0 3.13-5.22c0-.14-.08-.28-.11-.42l15-9.66c.06 0 .11.11.17.15a4.7 4.7 0 0 0 3.53.85 4.8 4.8 0 0 0 2.19-1l8.24 5.41a4.74 4.74 0 1 0 9.25.5zM16.88 69.41A2.75 2.75 0 0 1 12 68.22a2.75 2.75 0 0 1 2.28-3.14 3.25 3.25 0 0 1 .44 0 2.73 2.73 0 0 1 1.6.52 2.69 2.69 0 0 1 1.1 1.79 2.73 2.73 0 0 1-.54 2.02zm51.2 9.34a3.11 3.11 0 0 1 .43 0 2.74 2.74 0 0 1 1.61.52 2.69 2.69 0 0 1 1.1 1.73 2.75 2.75 0 1 1-3.14-2.28zM80.07 19A2.74 2.74 0 0 1 85 20.18a2.7 2.7 0 0 1-.49 2 2.75 2.75 0 0 1-3.84.61A2.74 2.74 0 0 1 79.58 21a2.7 2.7 0 0 1 .49-2zm-27.19-8.16a2.74 2.74 0 0 1 1.18-4.93 3.27 3.27 0 0 1 .44 0 2.75 2.75 0 1 1-1.62 5zM32 93a2.75 2.75 0 0 1-3.84.61 2.77 2.77 0 0 1-1.16-1.8 2.73 2.73 0 0 1 .5-2 2.69 2.69 0 0 1 1.79-1.09 2.09 2.09 0 0 1 .43 0 2.68 2.68 0 0 1 1.61.53A2.74 2.74 0 0 1 32 93zm18.29-13.7a2.74 2.74 0 1 1-3.18-2.3 3.13 3.13 0 0 1 .43 0 2.75 2.75 0 0 1 2.71 2.29zm-1-32.86a2.77 2.77 0 0 1-1.8 1.1 2.71 2.71 0 0 1-2-.5 2.74 2.74 0 0 1-1.1-1.79 2.71 2.71 0 0 1 .5-2 2.74 2.74 0 0 1 1.79-1.1 3.11 3.11 0 0 1 .43 0 2.74 2.74 0 0 1 1.61.52 2.69 2.69 0 0 1 1.1 1.8 2.75 2.75 0 0 1-.56 1.96zM70 33a2.75 2.75 0 1 1 2.29-3.14A2.75 2.75 0 0 1 70 33zm15.77 10.35a2.75 2.75 0 0 1-3.14-2.28 2.74 2.74 0 1 1 3.14 2.28z"})}))}},1099:function(e,t,a){"use strict";var n=a(1),c=(a(0),a(29)),s=a.n(c);t.a=function(e){var t=e.value;if(!t)return null;t=t.buffer||t;var a=s()(t),c=a.protoNames().concat(["ipfs","p2p"]),r=a.toString().split("/");return Object(n.jsx)("div",{className:"charcoal-muted monospace",children:r.map((function(e,t){return Object(n.jsxs)("span",{children:[Object(n.jsx)("span",{className:c.includes(e)?"force-select":"force-select charcoal",children:e}),t3e3?3e3:t<700?700:t},L=function(e){return e>960?window.innerHeight<940?.6*(window.innerHeight-180):.273*e:.5*e},B=Object(r.b)("selectPeers",(function(e){var t=e.peers;return t?t.length:0})),A=function(e){var t=e.width,a=e.height,n=e.children,c=f.b().scale(a/Math.PI).translate([t/2,a/2]).precision(.1);return n({path:f.c().projection(c)})},H=function(e){return e<10?5:e<100?8:10},F=function(e){return e<10?"rgba(150, 204, 255, 0.6)":e<100?"rgba(53, 126, 221, 0.6)":"rgba(53, 126, 221, 0.8)"},V=Object(r.b)("selectPeersCoordinates",(function(e){var t=e.width,a=e.height,n=e.path,c=e.peersCoordinates,s=e.handleMouseEnter,r=e.handleMouseLeave,l=f.d(m.a.createElement("svg")).attr("width",t).attr("height",a).attr("viewBox","0 0 ".concat(t," ").concat(a));return c.forEach((function(e){var t=e.peerIds,a=e.coordinates;l.append("path").datum({type:"Point",coordinates:a}).attr("d",n.pointRadius((function(){return H(t.length)}))).attr("fill",(function(){return F(t.length)})).attr("class","mapDot").on("mouseenter",(function(){return s(t,f.a.relatedTarget)})).on("mouseleave",(function(){return r()}))})),l.node().toReact()})),W=Object(r.b)("selectPeerLocationsForSwarm",(function(e){var t=e.ids,a=e.peerLocationsForSwarm,s=e.t;if(!a)return null;var r=a.filter((function(e){var a=e.peerId;return t.includes(a)}));if(!r.length)return null;var l=Object(c.useMemo)((function(){return-1!==window.navigator.appVersion.indexOf("Win")}),[]);return Object(n.jsx)("div",{className:"f6 flex flex-column justify-center",children:r.sort((function(e,t){return e.address.localeCompare(t.address)})).map((function(e,t){return 5===t&&r.length>5?Object(n.jsx)("div",{className:"f7 pa1 self-end",children:s("plusPeers",{number:r.length-5})},"worldmap-more-label"):t>5?null:Object(n.jsxs)("div",{className:"pa2 f7 flex items-center monospace",children:[Object(n.jsx)(v.a,{className:"mr1",code:e.flagCode,svg:l}),Object(n.jsxs)("div",{className:"flex flex-auto items-center",children:[Object(n.jsx)(g.a,{value:e.address}),Object(n.jsx)("span",{className:"charcoal-muted",children:"/p2p/"}),Object(n.jsx)(z,{value:e.peerId})]}),Object(n.jsxs)("span",{className:"gray ml1",children:[" (",e.latency||"???","ms)"]})]},e.peerId)}))})})),K=Object(r.b)("selectSelectedPeers","doSetSelectedPeers",Object(o.a)("peers")((function(e){var t=e.t,a=e.className,s=e.selectedPeers,r=e.doSetSelectedPeers,l=Object(c.useState)(T(window.innerWidth)),o=Object(p.a)(l,2),i=o[0],d=o[1],u=Object(c.useState)(L(i)),b=Object(p.a)(u,2),j=b[0],h=b[1],m=Object(c.useState)(null),f=Object(p.a)(m,2),v=f[0],g=f[1];Object(c.useEffect)((function(){var e=Object(O.f)((function(){var e=T(window.innerWidth);d(e),h(L(e))}),100);return window.addEventListener("resize",e),function(){return window.removeEventListener("resize",e)}}));var w=Object(c.useCallback)((function(e,t){if(t){clearTimeout(v);var a=t.getBBox(),n=a.x,c=a.y,s=a.width,l=a.height;r({peerIds:e,left:"".concat(n+s/2,"px"),top:"".concat(c-l/2,"px")})}}),[r,v]),N=Object(c.useCallback)((function(){g(setTimeout((function(){return r({})}),600))}),[r]),C=Object(c.useCallback)((function(){return clearTimeout(v)}),[v]);return Object(n.jsxs)("div",{className:"flex flex-column",children:[Object(n.jsxs)("div",{className:"relative ".concat(a),children:[Object(n.jsx)("div",{className:"mb1 flex flex-column items-center",children:Object(n.jsxs)("div",{className:"relative no-events",style:{width:i,height:j,background:"transparent url(".concat(x,") center no-repeat"),backgroundSize:"auto 100%"},children:[Object(n.jsx)(A,{width:i,height:j,children:function(e){var t=e.path;return Object(n.jsx)(V,{width:i,height:j,path:t,handleMouseEnter:w,handleMouseLeave:N})}}),(null===s||void 0===s?void 0:s.peerIds)&&Object(n.jsx)(k,{show:!(!s.top||!s.left),top:s.top,left:s.left,align:"bottom",handleMouseEnter:C,handleMouseLeave:N,children:Object(n.jsx)(W,{ids:s.peerIds,t:t})})]})}),Object(n.jsx)("div",{className:"no-events absolute bottom-0 left-0 right-0",children:Object(n.jsxs)("div",{className:"flex flex-auto flex-column items-center self-end pb5-ns no-select",children:[Object(n.jsx)("div",{className:"f1 fw5 black",children:Object(n.jsx)(B,{})}),Object(n.jsx)("div",{className:"f4 b ttu charcoal-muted",children:t("app:terms.peers")})]})})]}),Object(n.jsx)("div",{className:"relative flex justify-end pt2 pb4",children:Object(n.jsxs)("div",{className:"f6 p2 no-select flex items-center",children:[Object(n.jsxs)("span",{className:"f6 charcoal-muted pr3",children:[t("app:terms.peers"),": "]}),Object(n.jsx)("i",{className:"mapDotExplanation mr1",style:{width:2*H(1),height:2*H(1),backgroundColor:F(1)}}),"1-10",Object(n.jsx)("i",{className:"mapDotExplanation ml3 mr1",style:{width:2*H(50),height:2*H(50),backgroundColor:F(50)}})," 10-100",Object(n.jsx)("i",{className:"mapDotExplanation ml3 mr1",style:{width:2*H(110),height:2*H(110),backgroundColor:F(110)}}),"100+"]})})]})}))),_=a(62),J=a(63),U=a(103),G=a(108),Q=a(107),q=a(75),X=a.n(q),Z=a(120),$=a(1043),Y=a(243),ee=(a(1637),function(e){Object(G.a)(a,e);var t=Object(Q.a)(a);function a(e){var c;return Object(_.a)(this,a),(c=t.call(this,e)).flagRenderer=function(e,t){var a=-1!==window.navigator.appVersion.indexOf("Win");return Object(n.jsx)("span",{className:"f4 pr2",children:t?"\ud83e\udd1d":e?Object(n.jsx)(v.a,{code:e,svg:a}):"\ud83c\udf10"})},c.locationCellRenderer=function(e){var t=e.rowData,a=s.a.createRef(),r=t.isPrivate?c.props.t("localNetwork"):t.location?t.isNearby?Object(n.jsxs)("span",{children:[t.location," ",Object(n.jsxs)("span",{className:"charcoal-muted",children:["(",c.props.t("nearby"),")"]})]}):t.location:Object(n.jsx)("span",{className:"charcoal-muted fw4",children:c.props.t("app:terms.unknown")}),l=t.location||c.props.t("app:terms.unknown");return Object(n.jsx)($.CopyToClipboard,{text:l,onCopy:function(){return ae(a,c.props.t)},children:Object(n.jsxs)("span",{title:l,className:"copyable",ref:a,children:[c.flagRenderer(t.flagCode,t.isPrivate),r]})})},c.latencyCellRenderer=function(e){var t=e.cellData,a=(e.rowData,"".concat(t,"ms"));return null==t?Object(n.jsx)("span",{className:"dib o-40 no-select",style:{width:"60px"},children:"-"}):Object(n.jsx)("span",{className:"dib no-select",children:a})},c.peerIdCellRenderer=function(e){var t=e.cellData,a=s.a.createRef(),r="/p2p/".concat(t);return Object(n.jsx)($.CopyToClipboard,{text:r,onCopy:function(){return ae(a,c.props.t)},children:Object(n.jsx)(z,{value:t,identicon:!0,ref:a,className:"copyable"})})},c.protocolsCellRenderer=function(e){var t=e.rowData,a=(e.cellData,s.a.createRef()),r=t.protocols,l=r.split(", ").join("\n");return Object(n.jsx)($.CopyToClipboard,{text:r,onCopy:function(){return ae(a,c.props.t)},children:Object(n.jsx)("span",{ref:a,className:"copyable",title:l,children:r.replaceAll("[unnamed]","\ud83e\udd14")})})},c.connectionCellRenderer=function(e){var t=e.rowData,a=s.a.createRef(),r=t.address,l=t.direction,o=t.peerId,i="".concat(r,"/p2p/").concat(o),d=null!=l?"".concat(r,"\n(").concat(te(l,c.props.t),")"):r;return Object(n.jsx)($.CopyToClipboard,{text:i,onCopy:function(){return ae(a,c.props.t)},children:Object(n.jsx)("abbr",{ref:a,className:"copyable",title:d,children:t.connection})})},c.rowClassRenderer=function(e){var t,a,n=e.index,s=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[],r=c.props.selectedPeers,l=null===r||void 0===r||null===(t=r.peerIds)||void 0===t?void 0:t.includes(null===(a=s[n])||void 0===a?void 0:a.peerId);return C()("bb b--near-white peersTableItem",-1===n&&"bg-near-white",l&&"bg-light-gray")},c.state={sortBy:"latency",sortDirection:Z.d.ASC},c.sort=c.sort.bind(Object(U.a)(c)),c}return Object(J.a)(a,[{key:"sort",value:function(e){var t=e.sortBy,a=e.sortDirection;this.setState({sortBy:t,sortDirection:a})}},{key:"render",value:function(){var e=this,t=this.props,a=t.className,c=t.peerLocationsForSwarm,s=t.t,r=this.state,l=r.sortBy,o=r.sortDirection,i=(c||[]).sort(Object(Y.b)(l,o===Z.d.ASC?1:-1));return Object(n.jsx)("div",{className:"bg-white-70 center ".concat(a),style:{height:"".concat(400,"px"),maxWidth:1764},children:c&&Object(n.jsx)(Z.a,{disableHeight:!0,children:function(t){var a=t.width;return Object(n.jsxs)(Z.e,{className:"tl fw4 w-100 f6",headerClassName:"teal fw2 ttu tracked ph2 no-select",rowClassName:function(t){return e.rowClassRenderer(t,c)},width:a,height:400,headerHeight:32,rowHeight:36,rowCount:c.length,rowGetter:function(e){var t=e.index;return i[t]},sort:e.sort,sortBy:l,sortDirection:o,children:[Object(n.jsx)(Z.b,{label:s("app:terms.location"),cellRenderer:e.locationCellRenderer,dataKey:"location",width:450,className:"f6 charcoal truncate pl2"}),Object(n.jsx)(Z.b,{label:s("app:terms.latency"),cellRenderer:e.latencyCellRenderer,dataKey:"latency",width:200,className:"f6 charcoal pl2"}),Object(n.jsx)(Z.b,{label:s("app:terms.peerId"),cellRenderer:e.peerIdCellRenderer,dataKey:"peerId",width:250,className:"charcoal monospace truncate f6 pl2"}),Object(n.jsx)(Z.b,{label:s("app:terms.connection"),cellRenderer:e.connectionCellRenderer,dataKey:"connection",width:250,className:"f6 charcoal truncate pl2"}),Object(n.jsx)(Z.b,{label:s("protocols"),cellRenderer:e.protocolsCellRenderer,dataKey:"protocols",width:520,className:"charcoal monospace truncate f7 pl2"})]})}})})}}]),a}(s.a.Component)),te=function(e,t){if(null!=e)switch(e){case 1:return t("connectionDirectionInbound");case 2:return t("connectionDirectionOutbound");default:return e}},ae=function(e,t){var a=e.current,n=a.parentNode,c=document.createElement("em");c.innerText=t("copyFeedback"),n.replaceChild(c,a),setTimeout((function(){return n.replaceChild(a,c)}),X.a.seconds(2))},ne=Object(r.b)("selectPeerLocationsForSwarm","selectSelectedPeers",Object(o.a)("peers")(ee)),ce=a(2),se=a.n(ce),re=a(11),le=a(169),oe=a.n(le),ie=a(1045),de=a(182),ue=a(976),be=a(1017),je=function(e){Object(G.a)(a,e);var t=Object(Q.a)(a);function a(){var e;Object(_.a)(this,a);for(var c=arguments.length,s=new Array(c),r=0;r