import{b as U,H as Y,d as Z,u as q,c as m,t as g,k as z,l as t,n as o,N as G,c$ as J,cO as K,d9 as Q,cT as R,cU as W,p as F,da as X,P as c,cZ as ee,db as ne,cY as ae,bU as oe,dc as le,dd as te,de as se,df as ce}from"./index-c92c5b76.js";var ie={success:ee,info:ne,error:ae,warning:oe},re={success:le,info:te,error:se,warning:ce},ue=Y("success","info","warning","error"),de=function(){return{type:c.oneOf(ue),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}},ve=Z({compatConfig:{MODE:3},name:"AAlert",inheritAttrs:!1,props:de(),setup:function(a,v){var s=v.slots,N=v.emit,y=v.attrs,B=v.expose,I=q("alert",a),L=I.prefixCls,S=I.direction,i=m(!1),b=m(!1),w=m(),_=function(n){n.preventDefault();var l=w.value;l.style.height="".concat(l.offsetHeight,"px"),l.style.height="".concat(l.offsetHeight,"px"),i.value=!0,N("close",n)},O=function(){var n;i.value=!1,b.value=!0,(n=a.afterClose)===null||n===void 0||n.call(a)};B({animationEnd:O});var $=m({});return function(){var r,n,l=a.banner,T=a.closeIcon,A=T===void 0?(r=s.closeIcon)===null||r===void 0?void 0:r.call(s):T,h=a.closable,u=a.type,d=a.showIcon,x=g(s,a,"closeText"),f=g(s,a,"description"),E=g(s,a,"message"),p=g(s,a,"icon");d=l&&d===void 0?!0:d,u=l&&u===void 0?"warning":u||"info";var k=(f?re:ie)[u]||null;x&&(h=!0);var e=L.value,j=z(e,(n={},t(n,"".concat(e,"-").concat(u),!0),t(n,"".concat(e,"-closing"),i.value),t(n,"".concat(e,"-with-description"),!!f),t(n,"".concat(e,"-no-icon"),!d),t(n,"".concat(e,"-banner"),!!l),t(n,"".concat(e,"-closable"),h),t(n,"".concat(e,"-rtl"),S.value==="rtl"),n)),D=h?o("button",{type:"button",onClick:_,class:"".concat(e,"-close-icon"),tabindex:0},[x?o("span",{class:"".concat(e,"-close-text")},[x]):A===void 0?o(G,null,null):A]):null,M=p&&(J(p)?K(p,{class:"".concat(e,"-icon")}):o("span",{class:"".concat(e,"-icon")},[p]))||o(k,{class:"".concat(e,"-icon")},null),V=Q("".concat(e,"-motion"),{appear:!1,css:!0,onAfterLeave:O,onBeforeLeave:function(C){C.style.maxHeight="".concat(C.offsetHeight,"px")},onLeave:function(C){C.style.maxHeight="0px"}});return b.value?null:o(X,V,{default:function(){return[R(o("div",F(F({role:"alert"},y),{},{style:[y.style,$.value],class:[y.class,j],"data-show":!i.value,ref:w}),[d?M:null,o("div",{class:"".concat(e,"-content")},[E?o("div",{class:"".concat(e,"-message")},[E]):null,f?o("div",{class:"".concat(e,"-description")},[f]):null]),D]),[[W,!i.value]])]}})}}});const pe=U(ve);export{pe as A}; //# sourceMappingURL=index-e5379794.js.map