import{i as e,t}from"./react-B8IZ02wI.js";import{At as n,Et as r,I as i,Ot as a,P as o,Ut as s,V as c,et as l,f as u,n as d,pn as f,q as p}from"./button-DqbiydrF.js";import{l as m}from"./useForm-D_WiMFpZ.js";import{n as h,r as g,t as _}from"./popover-Dv6UP9sS.js";import{en as v,wn as y}from"./index-Bg7bo8aA.js";var b=e(t()),x=l(`Popconfirm`,e=>{let{componentCls:t,iconCls:n,antCls:r,zIndexPopup:i,colorText:a,colorWarning:o,marginXXS:s,marginXS:c,fontSize:l,fontWeightStrong:u,colorTextHeading:d}=e;return{[t]:{zIndex:i,[`&${r}-popover`]:{fontSize:l},[`${t}-message`]:{marginBottom:c,display:`flex`,flexWrap:`nowrap`,alignItems:`start`,[`> ${t}-message-icon`]:{color:o},[`> ${t}-message-icon ${n}`]:{fontSize:l,lineHeight:1,marginInlineEnd:c},[`${t}-title`]:{fontWeight:u,color:d,"&:only-child":{fontWeight:`normal`}},[`${t}-description`]:{marginTop:s,color:a}},[`${t}-buttons`]:{textAlign:`end`,whiteSpace:`nowrap`,button:{marginInlineStart:c}}}}},e=>{let{zIndexPopupBase:t}=e;return{zIndexPopup:t+60}},{resetStyle:!1}),S=e=>{let{prefixCls:t,okButtonProps:a,cancelButtonProps:s,title:c,description:l,cancelText:f,okText:m,okType:h=`primary`,icon:_=b.createElement(y,null),showCancel:x=!0,close:S,onConfirm:C,onCancel:w,onPopupClick:T,classNames:E,styles:D}=e,{getPrefixCls:O}=b.useContext(r),[k]=o(`Popconfirm`,i.Popconfirm),A=g(c),j=g(l);return b.createElement(`div`,{className:`${t}-inner-content`,onClick:T},b.createElement(`div`,{className:`${t}-message`},_&&b.createElement(`span`,{className:n(`${t}-message-icon`,E?.icon),style:D?.icon},_),b.createElement(`div`,{className:`${t}-message-text`},p(A)&&b.createElement(`div`,{className:n(`${t}-title`,E?.title),style:D?.title},A),p(j)&&b.createElement(`div`,{className:n(`${t}-description`,E?.content),style:D?.content},j))),b.createElement(`div`,{className:`${t}-buttons`},x&&b.createElement(d,{onClick:w,size:`small`,...s},f||k?.cancelText),b.createElement(v,{buttonProps:{size:`small`,...u(h),...a},actionFn:C,close:S,prefixCls:O(`btn`),quitOnNullishReturnValue:!0,emitEvent:!0},m||k?.okText)))},C=e=>{let{prefixCls:t,placement:i,className:a,style:o,...s}=e,{getPrefixCls:c}=b.useContext(r),l=c(`popconfirm`,t);return x(l),b.createElement(h,{placement:i,className:n(l,a),style:o,content:b.createElement(S,{prefixCls:l,...s})})},w=b.forwardRef((e,t)=>{let{prefixCls:r,placement:i=`top`,trigger:o,okType:l=`primary`,icon:u=b.createElement(y,null),children:d,overlayClassName:p,onOpenChange:h,overlayStyle:g,styles:v,arrow:C,classNames:w,...T}=e,{getPrefixCls:E,className:D,style:O,classNames:k,styles:A,arrow:j,trigger:M}=a(`popconfirm`),[N,P]=f(e.defaultOpen??!1,e.open),F=m(C,j),I=o||M||`click`,L=e=>{P(e),h?.(e)},R=()=>{L(!1)},z=t=>e.onConfirm?.call(void 0,t),B=t=>{L(!1),e.onCancel?.call(void 0,t)},V=t=>{let{disabled:n=!1}=e;n||L(t)},H=E(`popconfirm`,r),U={...e,placement:i,trigger:I,okType:l,overlayStyle:g,styles:v,classNames:w},[W,G]=c([k,w],[A,v],{props:U}),K=n(H,D,p,W.root);return x(H),b.createElement(_,{arrow:F,...s(T,[`title`]),trigger:I,placement:i,onOpenChange:V,open:N,ref:t,classNames:{root:K,container:W.container,arrow:W.arrow},styles:{root:{...O,...G.root,...g},container:G.container,arrow:G.arrow},content:b.createElement(S,{okType:l,icon:u,...e,prefixCls:H,close:R,onConfirm:z,onCancel:B,classNames:W,styles:G}),"data-popover-inject":!0},d)});w._InternalPanelDoNotUseOrYouWillBeFired=C;export{w as t};