const e=require("../_util/util.js"),t=require("../_util/classNames.js"),n=require("../vc-notification/index.js"),r=require("./style/index.js"),i=require("./util.js"),a=require("./useNotification.js"),o=require("../config-provider/index.js");let s=require("vue"),c=require("@antsoo-lib/icons");var l={},u=4.5,d=`24px`,f=`24px`,p=``,m=`topRight`,h=()=>document.body,g=null,_=!1,v;function y(e){let{duration:t,placement:n,bottom:r,top:i,getContainer:a,closeIcon:o,prefixCls:s}=e;s!==void 0&&(p=s),t!==void 0&&(u=t),n!==void 0&&(m=n),r!==void 0&&(f=typeof r==`number`?`${r}px`:r),i!==void 0&&(d=typeof i==`number`?`${i}px`:i),a!==void 0&&(h=a),o!==void 0&&(g=o),e.rtl!==void 0&&(_=e.rtl),e.maxCount!==void 0&&(v=e.maxCount)}function b({prefixCls:a,placement:u=m,getContainer:y=h,top:b,bottom:x,closeIcon:S=g,appContext:C},w){let{getPrefixCls:T}=o.globalConfig(),E=T(`notification`,a||p),D=`${E}-${u}-${_}`,O=l[D];if(O){Promise.resolve(O).then(e=>{w(e)});return}let k=t.default(`${E}-${u}`,{[`${E}-rtl`]:_===!0});n.default.newInstance({name:`notification`,prefixCls:a||p,useStyle:r.default,class:k,style:i.getPlacementStyle(u,b??d,x??f),appContext:C,getContainer:y,closeIcon:({prefixCls:t})=>(0,s.createVNode)(`span`,{class:`${t}-close-x`},[e.renderHelper(S,{},(0,s.createVNode)(c.CloseOutlined,{class:`${t}-close-icon`},null))]),maxCount:v,hasTransitionName:!0},e=>{l[D]=e,w(e)})}var x={success:c.CheckCircleOutlined,info:c.InfoCircleOutlined,error:c.CloseCircleOutlined,warning:c.ExclamationCircleOutlined};function S(t){let{icon:n,type:r,description:i,message:a,btn:o}=t,c=t.duration===void 0?u:t.duration;b(t,l=>{l.notice({content:({prefixCls:t})=>{let c=`${t}-notice`,l=null;if(n)l=()=>(0,s.createVNode)(`span`,{class:`${c}-icon`},[e.renderHelper(n)]);else if(r){let e=x[r];l=()=>(0,s.createVNode)(e,{class:`${c}-icon ${c}-icon-${r}`},null)}return(0,s.createVNode)(`div`,{class:l?`${c}-with-icon`:``},[l&&l(),(0,s.createVNode)(`div`,{class:`${c}-message`},[!i&&l?(0,s.createVNode)(`span`,{class:`${c}-message-single-line-auto-margin`},null):null,e.renderHelper(a)]),(0,s.createVNode)(`div`,{class:`${c}-description`},[e.renderHelper(i)]),o?(0,s.createVNode)(`span`,{class:`${c}-btn`},[e.renderHelper(o)]):null])},duration:c,closable:!0,onClose:t.onClose,onClick:t.onClick,key:t.key,style:t.style||{},class:t.class})})}var C={open:S,close(e){Object.keys(l).forEach(t=>Promise.resolve(l[t]).then(t=>{t.removeNotice(e)}))},config:y,destroy(){Object.keys(l).forEach(e=>{Promise.resolve(l[e]).then(e=>{e.destroy()}),delete l[e]})}};[`success`,`info`,`warning`,`error`].forEach(e=>{C[e]=t=>C.open({...t,type:e})}),C.warn=C.warning,C.useNotification=a.default,exports.default=C;