import{n as o,m as l,a as c,p as u}from"./app.b25a7691.js";var d=function(){var e=this,i=e.$createElement,t=e._self._c||i;return t("div",{staticClass:"mobile-nav-box"},[e._t("left",function(){return[t("div",{staticClass:"nav-back",on:{click:e.onBack}},[t("i",{staticClass:"taskfont"},[e._v("\uE676")])])]}),t("div",{staticClass:"nav-title"},[e._v(e._s(e.title))]),e._t("right")],2)},v=[];const m={name:"MobileNavTitle",props:{title:{default:""},beforeBack:{type:Function}},methods:{onBack(){if(typeof this.beforeBack=="function"){const e=this.beforeBack();e&&e.then&&e.then(()=>{this.goBack()});return}this.goBack()}}},a={};var h=o(m,d,v,!1,p,"305e6ddf",null,null);function p(e){for(let i in a)this[i]=a[i]}var _=function(){return h.exports}(),g=function(){var e=this,i=e.$createElement,t=e._self._c||i;return t("div",{staticClass:"page-setting"},[t("PageTitle",{attrs:{title:e.titleNameRoute}}),t("div",{staticClass:"setting-head"},[t("div",{staticClass:"setting-titbox"},[t("div",{staticClass:"setting-title"},[t("h1",[e._v(e._s(e.settingTitleName))])])])]),t("div",{staticClass:"setting-box"},[t("div",{staticClass:"setting-menu"},[t("MobileNavTitle",{attrs:{title:e.$L("\u8BBE\u7F6E")}}),t("ul",[e._l(e.menu,function(s,r){return t("li",{key:r,class:e.classNameRoute(s.path,s.divided),on:{click:function(C){return e.toggleRoute(s.path)}}},[e._v(e._s(e.$L(s.name)))])}),e.clientNewVersion?t("li",{staticClass:"flex",class:e.classNameRoute("version",!0),on:{click:function(s){return e.toggleRoute("version")}}},[t("AutoTip",{attrs:{disabled:""}},[e._v(e._s(e.$L("\u7248\u672C"))+": "+e._s(e.version))]),t("Badge",{attrs:{text:e.clientNewVersion}})],1):t("li",{staticClass:"version divided",on:{click:e.onVersion}},[t("AutoTip",[e._v(e._s(e.$L("\u7248\u672C"))+": "+e._s(e.version))])],1)],2)],1),t("transition",{attrs:{name:e.$isEEUiApp?"mobile-dialog":"none"}},[e.showContent?t("div",{staticClass:"setting-content"},[t("MobileNavTitle",{attrs:{title:e.settingTitleName}}),t("div",{staticClass:"setting-content-title"},[e._v(e._s(e.titleNameRoute))]),t("div",{staticClass:"setting-content-view"},[t("router-view",{staticClass:"setting-router-view"})],1)],1):e._e()])],1)],1)},$=[];const f={components:{MobileNavTitle:_},data(){return{version:window.systemInfo.version}},mounted(){},computed:{...l(["userInfo","userIsAdmin","clientNewVersion"]),routeName(){return this.$route.name},showContent(){return this.$route.path.match(/^\/manage\/setting\/\w+$/)},menu(){const e=[{path:"personal",name:"\u4E2A\u4EBA\u8BBE\u7F6E"},{path:"password",name:"\u5BC6\u7801\u8BBE\u7F6E"},{path:"email",name:"\u4FEE\u6539\u90AE\u7BB1"},{path:"language",name:"\u8BED\u8A00\u8BBE\u7F6E",divided:!0},{path:"theme",name:"\u4E3B\u9898\u8BBE\u7F6E"}];return(this.$Electron||this.$isEEUiApp)&&e.push({path:"keyboard",name:"\u952E\u76D8\u8BBE\u7F6E",desc:" (Beta)"}),$A.isDooServer()&&this.$isEEUiApp&&e.push({path:"privacy",name:"\u9690\u79C1\u653F\u7B56",divided:!0},{path:"delete",name:"\u5220\u9664\u5E10\u53F7"}),this.userIsAdmin&&e.push({path:"system",name:"\u7CFB\u7EDF\u8BBE\u7F6E",divided:!0},{path:"license",name:"License Key"}),e.push({path:"clearCache",name:"\u6E05\u9664\u7F13\u5B58",divided:!0},{path:"logout",name:"\u9000\u51FA\u767B\u5F55"}),e},titleNameRoute(){const{routeName:e,menu:i}=this;let t="";return i.some(s=>{if(e===`manage-setting-${s.path}`)return t=`${this.$L(s.name)}${s.desc||""}`,!0}),t||this.$L("\u8BBE\u7F6E")},settingTitleName(){return this.windowPortrait?this.titleNameRoute:this.$L("\u8BBE\u7F6E")}},watch:{routeName:{handler(e){e==="manage-setting"&&this.windowLandscape&&this.goForward({name:"manage-setting-personal"},!0)},immediate:!0}},methods:{toggleRoute(e){switch(e){case"clearCache":$A.modalConfirm({title:"\u6E05\u9664\u7F13\u5B58",content:"\u4F60\u786E\u5B9A\u8981\u6E05\u9664\u7F13\u5B58\u5417\uFF1F",onOk:()=>{$A.IDBSet("clearCache","handle").then(i=>{$A.reloadUrl()})}});break;case"logout":$A.modalConfirm({title:"\u9000\u51FA\u767B\u5F55",content:"\u4F60\u786E\u5B9A\u8981\u767B\u51FA\u7CFB\u7EDF\u5417\uFF1F",onOk:()=>{this.$store.dispatch("logout",!1)}});break;case"version":c.Store.set("updateNotification",null);break;case"privacy":this.openPrivacy();break;case"index":this.goForward({name:"manage-setting"});break;default:this.goForward({name:"manage-setting-"+e});break}},openPrivacy(){const e=$A.apiUrl("privacy");this.$isEEUiApp?$A.eeuiAppOpenPage({pageType:"app",pageTitle:" ",url:"web.js",params:{url:e,browser:!0,showProgress:!0}}):window.open(e)},classNameRoute(e,i){return{active:this.windowLandscape&&this.routeName===`manage-setting-${e}`,divided:!!i}},onVersion(){u.get($A.apiUrl("system/version")).then(({status:e,data:i})=>{if(e===200){let t=`${this.$L("\u670D\u52A1\u5668")}: ${$A.getDomain($A.apiUrl("../"))}`;t+=`
${this.$L("\u670D\u52A1\u5668\u7248\u672C")}: v${i.version}`,t+=`
${this.$L("\u5BA2\u6237\u7AEF\u7248\u672C")}: v${this.version}`,$A.modalInfo({language:!1,title:this.$L("\u7248\u672C\u4FE1\u606F"),content:t})}}).catch(e=>{})}}},n={};var w=o(f,g,$,!1,b,null,null,null);function b(e){for(let i in n)this[i]=n[i]}var N=function(){return w.exports}();export{N as default};