import{defineComponent as P,ref as C,computed as h,createVNode as r,Fragment as N}from"vue";import D from"../_util/classNames.mjs";import A from"../_util/omit.mjs";import{filterEmpty as m}from"../_util/props-util/index.mjs";import{getTransitionName as x}from"../_util/transition.mjs";import{withInstall as T,anyType as s}from"../_util/type.mjs";import b from"../_util/warning.mjs";import w from"../config-provider/hooks/useConfigInject.mjs";import E from"../tooltip/index.mjs";import{tooltipDefaultProps as I}from"../tooltip/Tooltip.mjs";import S from"../tooltip/abstractTooltipProps.mjs";import $ from"./style/index.mjs";import j from"../_util/props-util/initDefaultProps.mjs";const O=()=>({...S(),content:s(),title:s()}),R=P({compatConfig:{MODE:3},name:"APopover",inheritAttrs:!1,props:j(O(),{...I(),trigger:"hover",placement:"top",mouseEnterDelay:.1,mouseLeaveDelay:.1}),setup(e,{expose:p,slots:n,attrs:f}){const a=C();b(e.visible===void 0),p({getPopupDomNode:()=>a.value?.getPopupDomNode?.()});const{prefixCls:o,configProvider:c}=w("popover",e),[u,v]=$(o),d=h(()=>c.getPrefixCls()),g=()=>{const{title:t=m(n.title?.()),content:i=m(n.content?.())}=e,l=!!(Array.isArray(t)?t.length:t),y=!!(Array.isArray(i)?i.length:t);return!l&&!y?null:r(N,null,[l&&r("div",{class:`${o.value}-title`},[t]),r("div",{class:`${o.value}-inner-content`},[i])])};return()=>{const t=D(e.overlayClassName,v.value);return u(r(E,{...A(e,["title","content"]),...f,prefixCls:o.value,ref:a,overlayClassName:t,transitionName:x(d.value,"zoom-big",e.transitionName),"data-popover-inject":!0},{title:g,default:n.default}))}}}),U=T(R);export{U as default,O as popoverProps};
