"use strict";var h=Object.create;var u=Object.defineProperty;var _=Object.getOwnPropertyDescriptor;var b=Object.getOwnPropertyNames;var S=Object.getPrototypeOf;var y=Object.prototype.hasOwnProperty;var k=(t,e)=>u(t,"name",{value:e,configurable:true});var A=(t,e)=>{for(var o in e)u(t,o,{get:e[o],enumerable:true})};var f=(t,e,o,a)=>{if(e&&typeof e==="object"||typeof e==="function"){for(let s of b(e))if(!y.call(t,s)&&s!==o)u(t,s,{get:()=>e[s],enumerable:!(a=_(e,s))||a.enumerable})}return t};var I=(t,e,o)=>(o=t!=null?h(S(t)):{},f(e||!t||!t.__esModule?u(o,"default",{value:t,enumerable:true}):o,t));var x=t=>f(u({},"__esModule",{value:true}),t);var N=(t,e,o,a)=>{var s=a>1?void 0:a?_(e,o):e;for(var l=t.length-1,v;l>=0;l--)if(v=t[l])s=(a?v(e,o,s):v(s))||s;if(a&&s)u(e,o,s);return s};var E={};A(E,{default:()=>C});module.exports=x(E);var i=require("react/jsx-runtime");var m=require("mobx-react");var M=require("react");var d=require("react-intl");var g=require("react-router-dom");var p=require("../../../config");var L=I(require("../../../i18n/globalMessages"));const r=(0,d.defineMessages)({availableServices:{id:"settings.navigation.availableServices",defaultMessage:"Available services"},yourServices:{id:"settings.navigation.yourServices",defaultMessage:"Your services"},yourWorkspaces:{id:"settings.navigation.yourWorkspaces",defaultMessage:"Your workspaces"},account:{id:"settings.navigation.account",defaultMessage:"Account"},team:{id:"settings.navigation.team",defaultMessage:"Manage Team"},releaseNotes:{id:"settings.navigation.releaseNotes",defaultMessage:"Release Notes"},supportFerdium:{id:"settings.navigation.supportFerdium",defaultMessage:"About Ferdium"},logout:{id:"settings.navigation.logout",defaultMessage:"Logout"},exitSession:{id:"settings.navigation.exitSession",defaultMessage:"Exit session"}});let c=class extends M.Component{handleLogout(){const e=this.props.stores.settings.app.server===p.LOCAL_SERVER;localStorage.removeItem("authToken");if(e){this.props.actions.settings.update({type:"app",data:{server:p.LIVE_FERDIUM_API}})}this.props.stores.user.isLoggingOut=true;this.props.stores.router.push("/auth/welcome");window.location.reload()}render(){const{serviceCount:e,workspaceCount:o,stores:a,intl:s}=this.props;const l=a.settings.app.server===p.LOCAL_SERVER;const v=a.settings.app.server===p.LIVE_FRANZ_API;return(0,i.jsxs)("div",{className:"settings-navigation",children:[(0,i.jsx)(g.NavLink,{to:"/settings/recipes",className:({isActive:n})=>n?"settings-navigation__link is-active":"settings-navigation__link",children:s.formatMessage(r.availableServices)}),(0,i.jsxs)(g.NavLink,{to:"/settings/services",className:({isActive:n})=>n?"settings-navigation__link is-active":"settings-navigation__link",children:[s.formatMessage(r.yourServices)," ",(0,i.jsx)("span",{className:"badge",children:e})]}),(0,i.jsxs)(g.NavLink,{to:"/settings/workspaces",className:({isActive:n})=>n?"settings-navigation__link is-active":"settings-navigation__link",children:[s.formatMessage(r.yourWorkspaces)," ",(0,i.jsx)("span",{className:"badge",children:o})]}),!l&&(0,i.jsx)(g.NavLink,{to:"/settings/user",className:({isActive:n})=>n?"settings-navigation__link is-active":"settings-navigation__link",children:s.formatMessage(r.account)}),v&&(0,i.jsx)(g.NavLink,{to:"/settings/team",className:({isActive:n})=>n?"settings-navigation__link is-active":"settings-navigation__link",children:s.formatMessage(r.team)}),(0,i.jsxs)(g.NavLink,{to:"/settings/app",className:({isActive:n})=>n?"settings-navigation__link is-active":"settings-navigation__link",children:[s.formatMessage(L.default.settings),a.settings.app.automaticUpdates&&(a.ui.showServicesUpdatedInfoBar||a.app.updateStatus===a.app.updateStatusTypes.AVAILABLE||a.app.updateStatus===a.app.updateStatusTypes.DOWNLOADED)&&(0,i.jsx)("span",{className:"update-available",children:"\u2022"})]}),(0,i.jsx)(g.NavLink,{to:"/settings/releasenotes",className:({isActive:n})=>n?"settings-navigation__link is-active":"settings-navigation__link",children:s.formatMessage(r.releaseNotes)}),(0,i.jsx)(g.NavLink,{to:"/settings/support",className:({isActive:n})=>n?"settings-navigation__link is-active":"settings-navigation__link",children:s.formatMessage(r.supportFerdium)}),(0,i.jsx)("span",{className:"settings-navigation__expander"}),(0,i.jsx)("button",{type:"button",to:"/auth/logout",className:"settings-navigation__link",onClick:this.handleLogout.bind(this),children:l?s.formatMessage(r.exitSession):s.formatMessage(r.logout)})]})}};k(c,"SettingsNavigation");c=N([(0,m.inject)("stores","actions"),m.observer],c);var C=(0,d.injectIntl)(c);
