"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const t=require("vue"),E=require("@ant-design/icons-vue/ExclamationCircleFilled"),z=require("../_util/ActionButton.js"),F=require("../_util/KeyCode.js"),M=require("../_util/classNames.js"),_=require("../_util/hooks/useMergedState.js"),K=require("../_util/omit.js"),I=require("../_util/props-util/initDefaultProps.js"),U=require("../_util/transition.js"),n=require("../_util/type.js"),G=require("../_util/vnode.js"),H=require("../_util/warning.js");require("../button/index.js");const N=require("../button/buttonTypes.js"),J=require("../config-provider/hooks/useConfigInject.js"),Q=require("../locale/LocaleReceiver.js"),W=require("../locale/en_US.js"),X=require("../popover/index.js"),Y=require("../tooltip/Tooltip.js"),Z=require("../tooltip/abstractTooltipProps.js"),ee=require("./style/index.js"),te=require("../button/button.js"),b=()=>({...Z.default(),prefixCls:String,content:n.anyType(),title:n.anyType(),description:n.anyType(),okType:n.stringType("primary"),disabled:{type:Boolean,default:!1},okText:n.anyType(),cancelText:n.anyType(),icon:n.anyType(),okButtonProps:n.objectType(),cancelButtonProps:n.objectType(),showCancel:{type:Boolean,default:!0},onConfirm:Function,onCancel:Function}),oe=t.defineComponent({compatConfig:{MODE:3},name:"APopconfirm",inheritAttrs:!1,props:I.default(b(),{...Y.tooltipDefaultProps(),trigger:"click",placement:"top",mouseEnterDelay:.1,mouseLeaveDelay:.1,arrowPointAtCenter:!1,autoAdjustOverflow:!0,okType:"primary",disabled:!1}),slots:Object,setup(o,{slots:a,emit:f,expose:k,attrs:V}){const m=t.ref();H.default(o.visible===void 0),k({getPopupDomNode:()=>m.value?.getPopupDomNode?.()});const[y,O]=_.default(!1,{value:t.toRef(o,"open")}),s=(e,c)=>{o.open===void 0&&O(e),f("update:open",e),f("openChange",e,c)},h=e=>{s(!1,e)},v=e=>o.onConfirm?.(e),w=e=>{s(!1,e),o.onCancel?.(e)},B=e=>{e.keyCode===F.default.ESC&&y&&s(!1,e)},$=e=>{const{disabled:c}=o;c||s(e)},{prefixCls:r,getPrefixCls:C}=J.default("popconfirm",o),D=t.computed(()=>C()),S=t.computed(()=>C("btn")),[j]=ee.default(r),[g]=Q.useLocaleReceiver("Popconfirm",W.default.Popconfirm),L=()=>{const{okButtonProps:e,cancelButtonProps:c,title:u=a.title?.(),description:l=a.description?.(),cancelText:p=a.cancel?.(),okText:d=a.okText?.(),okType:i,icon:P=a.icon?.()||t.createVNode(E,null,null),showCancel:R=!0}=o,{cancelButton:T,okButton:q}=a,x={onClick:w,size:"small",...c},A={onClick:v,...N.convertLegacyProps(i),size:"small",...e};return t.createVNode("div",{class:`${r.value}-inner-content`},[t.createVNode("div",{class:`${r.value}-message`},[P&&t.createVNode("span",{class:`${r.value}-message-icon`},[P]),t.createVNode("div",{class:[`${r.value}-message-title`,{[`${r.value}-message-title-only`]:!!l}]},[u])]),l&&t.createVNode("div",{class:`${r.value}-description`},[l]),t.createVNode("div",{class:`${r.value}-buttons`},[R?T?T(x):t.createVNode(te.default,x,{default:()=>[p||g.value.cancelText]}):null,q?q(A):t.createVNode(z.default,{buttonProps:{size:"small",...N.convertLegacyProps(i),...e},actionFn:v,close:h,prefixCls:S.value,quitOnNullishReturnValue:!0,emitEvent:!0},{default:()=>[d||g.value.okText]})])])};return()=>{const{placement:e,overlayClassName:c,trigger:u="click",...l}=o,p=K.default(l,["title","content","cancelText","okText","onUpdate:open","onConfirm","onCancel","prefixCls"]),d=M.default(r.value,c);return j(t.createVNode(X.default,{...p,...V,trigger:u,placement:e,onOpenChange:$,open:y.value,overlayClassName:d,transitionName:U.getTransitionName(D.value,"zoom-big",o.transitionName),ref:m,"data-popover-inject":!0},{default:()=>[G.cloneVNodes(a.default?.()||[],{onKeydown:i=>{B(i)}},!1)],content:L}))}}}),ne=n.withInstall(oe);exports.default=ne;exports.popconfirmProps=b;
