import{u as s,b as e,c as a,d as o,j as t,e as l,t as n,l as r,m as i,k as c,h as d,C as p,$ as u,K as h,V as v,E as f,W as g,ap as m}from"./index.1712150016841.js";import{a as b}from"./href.1712150016841.js";import"./dialog.1712150016841.js";const x={class:"user-control space-y-2"},w={key:0,class:"space-y-3 grid grid-cols-3 gap-x-3 grid-flow-dense"},y={class:"col-span-3"},k={class:"group before:hover:scale-95 before:hover:h-72 before:hover:w-full before:hover:h-full before:hover:rounded-b-2xl before:transition-all before:duration-500 before:content-[''] before:w-full before:h-24 before:rounded-t-2xl before:bg-gradient-to-bl from-sky-200 via-orange-200 to-orange-700 before:absolute before:top-0 w-full h-64 relative bg-white flex flex-col items-center justify-center gap-2 text-center rounded-xl overflow-hidden"},C={class:"w-28 h-28 bg-white mt-8 overflow-hidden rounded-full border-4 border-slate-50 z-10 group-hover:scale-150 group-hover:-translate-x-24 group-hover:-translate-y-20 transition-all duration-500"},z=["src"],B={class:"z-10 group-hover:text-white group-hover:-translate-y-4 transition-all duration-500"},V=l("span",{class:"text-2xl font-semibold"},"我的账号",-1),j={style:{height:"20px"}},L={style:{color:"#a686ba"}},M={class:"iconfont mt-2"},H={style:{width:"30px",height:"30px"},t:"1705845546796",class:"icon",viewBox:"0 0 1024 1024",version:"1.1",xmlns:"http://www.w3.org/2000/svg","p-id":"21733",width:"32",height:"32"},_=[l("path",{d:"M512 0a512 512 0 1 0 512 512A512.606923 512.606923 0 0 0 512 0z m430.793741 512A430.793741 430.793741 0 1 1 512 81.327643a431.279279 431.279279 0 0 1 430.793741 430.672357z",fill:"#a686ba","p-id":"21734"},null,-1),l("path",{d:"M771.277383 471.336178h-218.492177v-218.492176a40.663822 40.663822 0 0 0-81.327643 0v218.492176h-218.492177a40.663822 40.663822 0 0 0 0 81.327644h218.492177v218.492176a40.663822 40.663822 0 0 0 81.327643 0v-218.492176h218.492177a40.663822 40.663822 0 0 0 0-81.327644z",fill:"#a686ba","p-id":"21735"},null,-1)],A=l("span",{style:{"margin-top":"7px"}},"添加标签",-1),O={userBox:"",class:"hover user-card relative"},S=l("div",{class:"text-green-500"},[l("span",{class:"iconfont icon-daoru"}),l("span",null,"导入标签")],-1),E=["onChange"],J=["onClick"],N=[l("div",{class:"text-blue-500"},[l("span",{class:"iconfont icon-daochu"}),l("span",null,"导出标签")],-1)],T=["onClick"],F=[l("div",{class:"text-yellow-500"},[l("span",{class:"iconfont icon-zhongzhi"}),l("span",null,"重置所有")],-1)],K=["onClick"],R=[l("div",{class:"text-cyan-500"},[l("span",{class:"iconfont icon-yanshengguanliyuan"}),l("span",null,"管理后台")],-1)],W=["onClick"],$={style:{color:"#4f68b0"}},q={class:"iconfont mt-1.5"},D={style:{width:"36px",height:"36px"},t:"1705918028651",class:"icon",viewBox:"0 0 1024 1024",version:"1.1",xmlns:"http://www.w3.org/2000/svg","p-id":"11853",width:"32",height:"32"},G=[l("path",{d:"M874.666667 656.64V768a85.333333 85.333333 0 0 1-85.333334 85.333333h-128.256v-196.693333H874.666667z m-515.541334 0V853.333333H234.666667a85.333333 85.333333 0 0 1-85.333334-85.333333v-111.36h209.792z m247.594667 0V853.333333H412.501333v-196.693333h194.218667z m0-485.973333v435.456H149.333333V258.261333a85.333333 85.333333 0 0 1 84.821334-85.333333L606.72 170.666667z m265.514667 247.338666c1.365333 0 2.432 1.109333 2.432 2.474667v183.082667c0 1.408-1.066667 2.56-2.432 2.56h-211.2V418.005333h211.2zM487.68 284.330667L347.050667 423.125333 275.2 351.701333a29.354667 29.354667 0 0 0-41.941333 0 29.312 29.312 0 0 0 0 42.24l93.781333 92.202667a29.696 29.696 0 0 0 20.906667 8.789333 29.738667 29.738667 0 0 0 20.992-8.832l160.682666-159.573333a29.312 29.312 0 0 0 0-42.197333 29.354667 29.354667 0 0 0-41.941333 0zM789.333333 170.666667a85.333333 85.333333 0 0 1 85.333334 85.333333v101.888a2.389333 2.389333 0 0 1-2.432 2.474667h-211.2V170.666667H789.333333z",fill:"#4f68b0","p-id":"11854"},null,-1)],I=l("span",{style:{"margin-top":"4px"}},"将当前桌面设置为程序默认桌面",-1),P=[l("div",{style:{color:"#000ebd"}},[l("span",{class:"iconfont icon-xiugaimima"}),l("span",null,"修改密码")],-1)],Q=[l("div",{class:"text-slate-500"},[l("span",{class:"iconfont icon-tuichudenglu"}),l("span",null,"退出登录")],-1)],U={key:1,class:"space-y-2 grid grid-cols-3 gap-x-3"},X=l("div",{userBox:"",class:"col-span-3",style:{"align-items":"start"}},[l("span",{class:"text-blue-400"},[p(" 登录即可享更多功能和数据同步 "),l("br"),p(" 传输双重数据加密更加安全 ")])],-1),Y=["onClick"],Z=[l("div",{class:"text-yellow-500"},[l("span",{class:"iconfont icon-zhongzhi"}),l("span",null,"重置图标")],-1)],ss=["onClick"],es=[l("div",{class:"text-blue-500"},[l("span",{class:"iconfont icon-daochu"}),l("span",null,"导出图标")],-1)],as=[l("div",{class:"ml-2 text-emerald-600"},[l("span",{class:"iconfont icon-dengluzhanghu"}),l("span",null,"立即登录")],-1)],os={__name:"user",setup(p){const os=s(),ts=async()=>{try{await u.confirm("重置将会恢复到初始状态,是否重置图标和所有设置?","温馨提示"),await u.confirm("请再次确认是否重置?","二次确认")}catch(s){return}h.del("link").del("config").del("tabbar").del("SearchEngineLocal"),v({url:"/link/reset"}).then((s=>{1===s.code&&location.reload()}))},ls=()=>{window.open("/Manager","__blank"),f.emit("openController",!1)},ns=async()=>{try{await u.confirm("您确定要将您当前时间节点的标签布局和主题设置以及打开方式设为全局默认?设置后所有新用户则使用默认设置,请确保不包含您的私有内容,并点击确定来继续,","危险提示!"),await u.confirm("真的确定要设置为全局的默认配置吗?","危险操作呐!"),await u.confirm("请再次确认是否设置为全局默认配置!!!","最后一次询问!");const s=await v({url:"/Admin/export",method:"post",data:{link:{link:os.state.link,tabbar:os.state.tabbar,config:os.state.config}}});1===s.code?g.success("操作成功"):g.error(s.msg)}catch(s){g.info("操作已取消")}},rs=s=>{f.emit("openController",!1),f.emit("openLogin",s)},is=s=>{const[e=null]=s.target.files;if(e){const s=new FileReader;s.onload=s=>{const{result:e=""}=s.target;try{const s=JSON.parse(e),{link:a=!1,tabbar:o=!1}=s;a&&os.commit("updateLink",a),o&&os.commit("updateTabbar",o)}catch(a){g.error("导入失败,请检查文件内容")}},s.readAsText(e)}},cs=()=>{m("link",JSON.stringify({link:os.state.link,tabbar:os.state.tabbar}))};return(s,p)=>{const u=e("el-popover");return a(),o("div",x,[t(os).state.isLogin?(a(),o("div",w,[l("div",y,[l("div",k,[l("div",C,[l("img",{style:{width:"80%",margin:"auto"},src:t("/dist/assets/avatar.1712150016841.png"),alt:"头像"},null,8,z)]),l("div",B,[V,l("p",j,n(t(os).state.user.mail),1)])])]),l("div",{userBox:"",onClick:p[0]||(p[0]=r((s=>(b("tab://addicon"),void f.emit("openController",!1))),["stop"])),class:"hover user-card"},[l("div",L,[l("span",M,[(a(),o("svg",H,_))]),A])]),l("div",O,[S,l("input",{class:"absolute top-0 left-0 w-full h-full opacity-0 text-sm",type:"file",accept:".json",onChange:r(is,["stop"])},null,40,E)]),l("div",{userBox:"",onClick:r(cs,["stop"]),class:"hover user-card"},N,8,J),l("div",{userBox:"",onClick:r(ts,["stop"]),class:"hover user-card"},F,8,T),1===t(os).state.user.manager?(a(),o("div",{key:0,userBox:"",onClick:r(ls,["stop"]),class:"hover user-card"},R,8,K)):i("",!0),1===t(os).state.user.manager?(a(),o("div",{key:1,userBox:"",onClick:r(ns,["stop"]),class:"hover user-card col-span-2"},[c(u,{placement:"left",title:"功能解释",width:300,trigger:"hover",content:"程序安装后会有默认的桌面,可能不符合您的需求,所以可以将桌面默认内容删除,添加你的想要的桌面,然后点击这个按钮设置为所有新用户的默认桌面,这样新用户进来,或者用户点击重置所有按钮后,用户桌面就是你设置的默认的内容!!!"},{reference:d((()=>[l("div",$,[l("span",q,[(a(),o("svg",D,G))]),I])])),_:1})],8,W)):i("",!0),l("div",{userBox:"",onClick:p[1]||(p[1]=r((s=>rs(3)),["stop"])),class:"hover user-card"},P),l("div",{userBox:"",onClick:p[2]||(p[2]=r((s=>t(os).commit("loginOut")),["stop"])),class:"hover user-card"},Q)])):(a(),o("div",U,[X,l("div",{userBox:"",onClick:r(ts,["stop"]),class:"hover"},Z,8,Y),l("div",{userBox:"",onClick:r(cs,["stop"]),class:"hover user-card"},es,8,ss),l("div",{userBox:"",onClick:p[3]||(p[3]=r((s=>rs(1)),["stop"])),class:"hover"},as)]))])}}};export{os as default};