import{getPropsSlot as e}from"../../_util/props-util/index.mjs";import t from"../../_util/vue-types/index.mjs";import n from"../../vc-trigger/index.mjs";import r from"./placements.mjs";import i from"./Content.mjs";import{createVNode as a,defineComponent as o,shallowRef as s,watchEffect as c}from"vue";function l(){}var u=o({compatConfig:{MODE:3},name:`Tooltip`,inheritAttrs:!1,props:{trigger:t.any.def([`hover`]),defaultVisible:{type:Boolean,default:void 0},visible:{type:Boolean,default:void 0},placement:t.string.def(`right`),transitionName:String,animation:t.any,afterVisibleChange:t.func.def(()=>{}),overlayStyle:{type:Object,default:void 0},overlayClassName:String,prefixCls:t.string.def(`rc-tooltip`),mouseEnterDelay:t.number.def(.1),mouseLeaveDelay:t.number.def(.1),getPopupContainer:Function,destroyTooltipOnHide:{type:Boolean,default:!1},align:t.object.def(()=>({})),arrowContent:t.any.def(null),tipId:String,builtinPlacements:t.object,overlayInnerStyle:{type:Object,default:void 0},popupVisible:{type:Boolean,default:void 0},onVisibleChange:Function,onPopupAlign:Function,arrow:{type:Boolean,default:!0}},setup(t,{slots:o,attrs:u,expose:d}){let f=s(),p=()=>{let{prefixCls:n,tipId:r,overlayInnerStyle:s}=t;return[t.arrow?a(`div`,{class:`${n}-arrow`,key:`arrow`},[e(o,t,`arrowContent`)]):null,a(i,{key:`content`,prefixCls:n,id:r,overlayInnerStyle:s},{overlay:o.overlay})]};d({getPopupDomNode:()=>f.value.getPopupDomNode(),triggerDOM:f,forcePopupAlign:()=>f.value?.forcePopupAlign()});let m=s(!1),h=s(!1);return c(()=>{let{destroyTooltipOnHide:e}=t;if(typeof e==`boolean`)m.value=e;else if(e&&typeof e==`object`){let{keepParent:t}=e;m.value=t===!0,h.value=t===!1}}),()=>{let{overlayClassName:e,trigger:i,mouseEnterDelay:s,mouseLeaveDelay:c,overlayStyle:d,prefixCls:g,afterVisibleChange:_,transitionName:v,animation:y,placement:b,align:x,destroyTooltipOnHide:S,defaultVisible:C,...w}=t,T={...w};return t.visible!==void 0&&(T.popupVisible=t.visible),a(n,{popupClassName:e,prefixCls:g,action:i,builtinPlacements:r,popupPlacement:b,popupAlign:x,afterPopupVisibleChange:_,popupTransitionName:v,popupAnimation:y,defaultPopupVisible:C,destroyPopupOnHide:m.value,autoDestroy:h.value,mouseLeaveDelay:c,popupStyle:d,mouseEnterDelay:s,...T,...u,onPopupVisibleChange:t.onVisibleChange||l,onPopupAlign:t.onPopupAlign||l,ref:f,arrow:!!t.arrow,popup:p()},{default:o.default})}}});export{u as default};