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