import{V,cm as $,cn as w,f as D,ah as I,Z as q,h as o,o as l,w as d,y as x,a as k,n,N as e,u as c,q as g,a5 as S,ae as f,au as z,c as i,d as b,t as m,F as A,e as F,co as M,z as P,i as j,cp as O,S as Z,cq as G,aj as H}from"./index-Dyf_FKwG.js";const J=["light","dark"],K=V({title:{type:String,default:""},description:{type:String,default:""},type:{type:String,values:$(w),default:"info"},closable:{type:Boolean,default:!0},closeText:{type:String,default:""},showIcon:Boolean,center:Boolean,effect:{type:String,values:J,default:"light"}}),L={close:t=>t instanceof MouseEvent};var Q=D({name:"ElAlert",__name:"alert",props:K,emits:L,setup(t,{emit:E}){const{Close:B}=M,v=t,T=E,y=I(),s=q("alert"),p=j(!0),h=g(()=>w[v.type]),r=g(()=>{var a;if(v.description)return!0;const u=(a=y.default)==null?void 0:a.call(y);return u?Z(u).some(N=>!G(N)):!1}),C=a=>{p.value=!1,T("close",a)};return(a,u)=>(l(),o(O,{name:e(s).b("fade"),persisted:""},{default:d(()=>[x(k("div",{class:n([e(s).b(),e(s).m(t.type),e(s).is("center",t.center),e(s).is(t.effect)]),role:"alert"},[t.showIcon&&(a.$slots.icon||h.value)?(l(),o(e(S),{key:0,class:n([e(s).e("icon"),e(s).is("big",r.value)])},{default:d(()=>[f(a.$slots,"icon",{},()=>[(l(),o(z(h.value)))])]),_:3},8,["class"])):c("v-if",!0),k("div",{class:n(e(s).e("content"))},[t.title||a.$slots.title?(l(),i("span",{key:0,class:n([e(s).e("title"),{"with-description":r.value}])},[f(a.$slots,"title",{},()=>[b(m(t.title),1)])],2)):c("v-if",!0),r.value?(l(),i("p",{key:1,class:n(e(s).e("description"))},[f(a.$slots,"default",{},()=>[b(m(t.description),1)])],2)):c("v-if",!0),t.closable?(l(),i(A,{key:2},[t.closeText?(l(),i("div",{key:0,class:n([e(s).e("close-btn"),e(s).is("customed")]),onClick:C},m(t.closeText),3)):(l(),o(e(S),{key:1,class:n(e(s).e("close-btn")),onClick:C},{default:d(()=>[F(e(B))]),_:1},8,["class"]))],64)):c("v-if",!0)],2)],2),[[P,p.value]])]),_:3},8,["name"]))}});const W=H(Q);export{W as E};
