import{Br as e,Ht as t,Jr as n,Kt as r,Lr as i,Or as a,Pr as o,Vr as s,W as c,Wn as l,Zn as u,ar as d,cr as f,di as p,dr as m,fr as h,g,h as _,jr as v,lr as y,mi as b,nt as x,or as S,p as C,pr as w,sr as T,ti as E,tr as D}from"./style-QAnagFj5.js";import{_ as O,g as k}from"./style-BqiJaO0R.js";var A=c(w({name:`ElAlert`,__name:`alert`,props:t({title:{type:String,default:``},description:{type:String,default:``},type:{type:String,values:r(g),default:`info`},closable:{type:Boolean,default:!0},closeText:{type:String,default:``},showIcon:Boolean,center:Boolean,effect:{type:String,values:[`light`,`dark`],default:`light`}}),emits:{close:e=>e instanceof MouseEvent},setup(t,{emit:r}){let{Close:c}=_,w=t,A=r,j=i(),M=x(`alert`),N=n(!0),P=d(()=>g[w.type]),F=d(()=>{if(w.description)return!0;let e=j.default?.();return e?k(e).some(e=>!O(e)):!1}),I=e=>{N.value=!1,A(`close`,e)};return(n,r)=>(a(),T(l,{name:E(M).b(`fade`),persisted:``},{default:e(()=>[s(S(`div`,{class:p([E(M).b(),E(M).m(t.type),E(M).is(`center`,t.center),E(M).is(t.effect)]),role:`alert`},[t.showIcon&&(n.$slots.icon||P.value)?(a(),T(E(C),{key:0,class:p([E(M).e(`icon`),E(M).is(`big`,F.value)])},{default:e(()=>[v(n.$slots,`icon`,{},()=>[(a(),T(o(P.value)))])]),_:3},8,[`class`])):f(`v-if`,!0),S(`div`,{class:p(E(M).e(`content`))},[t.title||n.$slots.title?(a(),y(`span`,{key:0,class:p([E(M).e(`title`),{"with-description":F.value}])},[v(n.$slots,`title`,{},()=>[m(b(t.title),1)])],2)):f(`v-if`,!0),F.value?(a(),y(`p`,{key:1,class:p(E(M).e(`description`))},[v(n.$slots,`default`,{},()=>[m(b(t.description),1)])],2)):f(`v-if`,!0),t.closable?(a(),y(D,{key:2},[t.closeText?(a(),y(`div`,{key:0,class:p([E(M).e(`close-btn`),E(M).is(`customed`)]),onClick:I},b(t.closeText),3)):(a(),T(E(C),{key:1,class:p(E(M).e(`close-btn`)),onClick:I},{default:e(()=>[h(E(c))]),_:1},8,[`class`]))],64)):f(`v-if`,!0)],2)],2),[[u,N.value]])]),_:3},8,[`name`]))}}));export{A as t};