import{an as $,ae as R,a as U,y as c,C as W,r as m,c1 as x,L as X,M as l,j as o,c2 as Y,U as Z,cg as q,dS as G,w as J,v as K,N as F,dR as Q,a5 as ee,dV as ae,a7 as te,a6 as ne,dW as oe,dX as re,dY as le,dZ as ie}from"./index.0d073eaa.js";var ce={success:ee,info:ae,error:te,warning:ne},se={success:oe,info:re,error:le,warning:ie},de=R("success","info","warning","error"),fe=function(){return{type:c.oneOf(de),closable:{type:Boolean,default:void 0},closeText:c.any,message:c.any,description:c.any,afterClose:Function,showIcon:{type:Boolean,default:void 0},prefixCls:String,banner:{type:Boolean,default:void 0},icon:c.any,closeIcon:c.any,onClose:Function}},ue=U({name:"AAlert",inheritAttrs:!1,props:fe(),setup:function(a,u){var i=u.slots,P=u.emit,b=u.attrs,L=u.expose,C=W("alert",a),N=C.prefixCls,S=C.direction,s=m(!1),w=m(!1),I=m(),B=function(n){n.preventDefault();var r=I.value;r.style.height="".concat(r.offsetHeight,"px"),r.style.height="".concat(r.offsetHeight,"px"),s.value=!0,P("close",n)},k=function(){var n;s.value=!1,w.value=!0,(n=a.afterClose)===null||n===void 0||n.call(a)};L({animationEnd:k});var H=m({});return function(){var t,n,r=a.banner,z=a.closeIcon,A=z===void 0?(n=i.closeIcon)===null||n===void 0?void 0:n.call(i):z,h=a.closable,d=a.type,f=a.showIcon,y=x(i,a,"closeText"),p=x(i,a,"description"),T=x(i,a,"message"),g=x(i,a,"icon");f=r&&f===void 0?!0:f,d=r&&d===void 0?"warning":d||"info";var _=(p?se:ce)[d]||null;y&&(h=!0);var e=N.value,j=X(e,(t={},l(t,"".concat(e,"-").concat(d),!0),l(t,"".concat(e,"-closing"),s.value),l(t,"".concat(e,"-with-description"),!!p),l(t,"".concat(e,"-no-icon"),!f),l(t,"".concat(e,"-banner"),!!r),l(t,"".concat(e,"-closable"),h),l(t,"".concat(e,"-rtl"),S.value==="rtl"),t)),V=h?o("button",{type:"button",onClick:B,class:"".concat(e,"-close-icon"),tabindex:0},[y?o("span",{class:"".concat(e,"-close-text")},[y]):A===void 0?o(Y,null,null):A]):null,M=g&&(Z(g)?q(g,{class:"".concat(e,"-icon")}):o("span",{class:"".concat(e,"-icon")},[g]))||o(_,{class:"".concat(e,"-icon")},null),D=G("".concat(e,"-motion"),{appear:!1,css:!0,onAfterLeave:k,onBeforeLeave:function(v){v.style.maxHeight="".concat(v.offsetHeight,"px")},onLeave:function(v){v.style.maxHeight="0px"}});return w.value?null:o(Q,D,{default:function(){return[J(o("div",F(F({role:"alert"},b),{},{style:[b.style,H.value],class:[b.class,j],"data-show":!s.value,ref:I}),[f?M:null,o("div",{class:"".concat(e,"-content")},[T?o("div",{class:"".concat(e,"-message")},[T]):null,p?o("div",{class:"".concat(e,"-description")},[p]):null]),V]),[[K,!s.value]])]}})}}}),ge=$(ue);export{ge as A};
