import{U as e,b0 as s,cc as t,x as a,ag as l,a1 as i,r as o,Z as c,d as n,j as d,k as r,w as f,h as p,a7 as u,g as y,p as v,m,an as b,e as g,a6 as k,n as h,am as x,F as S,f as _,A as w,T,a8 as $,cb as B,ap as C}from"./index.286e9b79.js";const E=e({title:{type:String,default:""},description:{type:String,default:""},type:{type:String,values:s(t),default:"info"},closable:{type:Boolean,default:!0},closeText:{type:String,default:""},showIcon:Boolean,center:Boolean,effect:{type:String,values:["light","dark"],default:"light"}}),j={close:e=>e instanceof MouseEvent},A=a({name:"ElAlert"});const I=C($(a({...A,props:E,emits:j,setup(e,{emit:s}){const a=e,{Close:$}=B,C=l(),E=i("alert"),j=o(!0),A=c((()=>t[a.type])),I=c((()=>[E.e("icon"),{[E.is("big")]:!!a.description||!!C.default}])),F=c((()=>({"with-description":a.description||C.default}))),M=e=>{j.value=!1,s("close",e)};return(e,s)=>(n(),d(T,{name:y(E).b("fade"),persisted:""},{default:r((()=>[f(p("div",{class:u([y(E).b(),y(E).m(e.type),y(E).is("center",e.center),y(E).is(e.effect)]),role:"alert"},[e.showIcon&&y(A)?(n(),d(y(v),{key:0,class:u(y(I))},{default:r((()=>[(n(),d(m(y(A))))])),_:1},8,["class"])):b("v-if",!0),p("div",{class:u(y(E).e("content"))},[e.title||e.$slots.title?(n(),g("span",{key:0,class:u([y(E).e("title"),y(F)])},[k(e.$slots,"title",{},(()=>[h(x(e.title),1)]))],2)):b("v-if",!0),e.$slots.default||e.description?(n(),g("p",{key:1,class:u(y(E).e("description"))},[k(e.$slots,"default",{},(()=>[h(x(e.description),1)]))],2)):b("v-if",!0),e.closable?(n(),g(S,{key:2},[e.closeText?(n(),g("div",{key:0,class:u([y(E).e("close-btn"),y(E).is("customed")]),onClick:M},x(e.closeText),3)):(n(),d(y(v),{key:1,class:u(y(E).e("close-btn")),onClick:M},{default:r((()=>[_(y($))])),_:1},8,["class"]))],64)):b("v-if",!0)],2)],2),[[w,j.value]])])),_:3},8,["name"]))}}),[["__file","alert.vue"]]));export{I as E};
