import{aH as x,a as I,cV as M,cW as w,dl as b,b1 as $,b as U,l as O,f as S,o as r,h as A,j as t,p as m,aK as h,aL as g,i as a,n as s,t as V,F as E,c as N,aJ as n,c_ as P}from"./index.bde7963b.js";import{D as R}from"./siteSetting.c485f07c.js";import{c as C,u as B}from"./index.c5b98ab4.js";import{b as z}from"./index.4b403226.js";import{h as T}from"./header.d801b988.js";import"./uniqBy.3333e3da.js";import"./_baseIteratee.34b68bfe.js";import"./index.706d2d48.js";import"./useWindowSizeFn.ada338ad.js";import"./useContentViewHeight.9a4f8bdd.js";import"./index.357d6afd.js";import"./RedoOutlined.4aa527e6.js";import"./lock.e24f9ae8.js";const F=I({name:"UserDropdown",components:{Dropdown:M,Menu:w,MenuItem:C(()=>b(()=>import("./DropMenuItem.aa572bf5.js"),["assets/DropMenuItem.aa572bf5.js","assets/index.bde7963b.js","assets/index.dde5d760.css"])),MenuDivider:w.Divider,LockAction:C(()=>b(()=>import("./LockModal.3592aedd.js"),["assets/LockModal.3592aedd.js","assets/LockModal.0068f88c.css","assets/index.bde7963b.js","assets/index.dde5d760.css","assets/index.4b403226.js","assets/index.d0b877f3.css","assets/useWindowSizeFn.ada338ad.js","assets/uniqBy.3333e3da.js","assets/_baseIteratee.34b68bfe.js","assets/BasicForm.948b0243.js","assets/BasicForm.fd1c49b9.css","assets/index.0103b3aa.js","assets/index.86d55544.css","assets/index.3289c967.js","assets/index.a18cc309.css","assets/index.9b1e5ec7.js","assets/index.3a3c1369.css","assets/index.dcd3d2b7.js","assets/index.542f49a8.css","assets/index.18602d99.js","assets/index.49ada229.css","assets/index.bfd670f8.js","assets/index.47f7c782.css","assets/index.13318916.js","assets/index.579bd49e.css","assets/index.ce7c5e55.js","assets/index.7b8b5e30.css","assets/index.b75cc0a1.js","assets/download.dc299cb5.js","assets/useForm.b21b423d.js","assets/lock.e24f9ae8.js","assets/header.d801b988.js"]))},props:{theme:$.oneOf(["dark","light"])},setup(){const{prefixCls:e}=U("header-user-dropdown"),{t:f}=N(),{getShowDoc:_,getUseLockPage:v}=B(),d=O(),k=S(()=>{const{nickname:u="",avatar:y,desc:L}=d.getUserInfo||{};return{nickname:u,avatar:y||T,desc:L}}),[o,{openModal:i}]=z();function p(){i(!0)}function c(){d.confirmLoginOut()}function l(){P(R)}function D(u){switch(u.key){case"logout":c();break;case"doc":l();break;case"lock":p();break}}return{prefixCls:e,t:f,getUserInfo:k,handleMenuClick:D,getShowDoc:_,register:o,getUseLockPage:v}}}),H=["src"];function W(e,f,_,v,d,k){const o=n("MenuItem"),i=n("MenuDivider"),p=n("Menu"),c=n("Dropdown"),l=n("LockAction");return r(),A(E,null,[t(c,{placement:"bottomLeft",overlayClassName:`${e.prefixCls}-dropdown-overlay`},{overlay:m(()=>[t(p,{onClick:e.handleMenuClick},{default:m(()=>[e.getShowDoc?(r(),h(o,{key:"doc",text:e.t("layout.header.dropdownItemDoc"),icon:"ion:document-text-outline"},null,8,["text"])):g("",!0),e.getShowDoc?(r(),h(i,{key:1})):g("",!0),e.getUseLockPage?(r(),h(o,{key:"lock",text:e.t("layout.header.tooltipLock"),icon:"ion:lock-closed-outline"},null,8,["text"])):g("",!0),t(o,{key:"logout",text:e.t("layout.header.dropdownItemLoginOut"),icon:"ion:power-outline"},null,8,["text"])]),_:1},8,["onClick"])]),default:m(()=>[a("span",{class:s([[e.prefixCls,`${e.prefixCls}--${e.theme}`],"flex"])},[a("img",{class:s(`${e.prefixCls}__header`),src:e.getUserInfo.avatar},null,10,H),a("span",{class:s(`${e.prefixCls}__info hidden md:block`)},[a("span",{class:s([`${e.prefixCls}__name  `,"truncate"])},V(e.getUserInfo.nickname),3)],2)],2)]),_:1},8,["overlayClassName"]),t(l,{onRegister:e.register},null,8,["onRegister"])],64)}var te=x(F,[["render",W]]);export{te as default};
