import e from"../classNames.mjs";import{findDOMNode as t}from"../props-util/index.mjs";import n from"../../config-provider/hooks/useConfigInject.mjs";import r from"../../vc-util/Dom/isVisible.mjs";import i from"./style.mjs";import a from"./useWave.mjs";import{computed as o,defineComponent as s,getCurrentInstance as c,nextTick as l,onBeforeUnmount as u,onMounted as d,watch as f}from"vue";var p=s({compatConfig:{MODE:3},name:`Wave`,props:{disabled:Boolean},setup(s,{slots:p}){let m=c(),{prefixCls:h,wave:g}=n(`wave`,s),[,_]=i(h),v=a(o(()=>e(h.value,_.value)),g),y,b=()=>{t(m).removeEventListener(`click`,y,!0)};return d(()=>{f(()=>s.disabled,()=>{b(),l(()=>{let e=t(m);e?.removeEventListener(`click`,y,!0),!(!e||e.nodeType!==1||s.disabled)&&(y=t=>{t.target.tagName===`INPUT`||!r(t.target)||!e.getAttribute||e.getAttribute(`disabled`)||e.disabled||e.className.includes(`disabled`)||e.className.includes(`-leave`)||v()},e.addEventListener(`click`,y,!0))})},{immediate:!0,flush:`post`})}),u(()=>{b()}),()=>p.default?.()[0]}});export{p as default};