import{a5 as M,r as l,bJ as _,U as E,an as U,b6 as q,bK as $,B as D,bL as J,bM as K,bN as Y,X as h,am as G,P as Q,W as Z}from"./index-BtzNP73w.js";const ee=e=>{const{componentCls:t,iconCls:s,antCls:n,zIndexPopup:o,colorText:m,colorWarning:u,marginXXS:i,marginXS:p,fontSize:v,fontWeightStrong:y,colorTextHeading:b}=e;return{[t]:{zIndex:o,[`&${n}-popover`]:{fontSize:v},[`${t}-message`]:{marginBottom:p,display:"flex",flexWrap:"nowrap",alignItems:"start",[`> ${t}-message-icon ${s}`]:{color:u,fontSize:v,lineHeight:1,marginInlineEnd:p},[`${t}-title`]:{fontWeight:y,color:b,"&:only-child":{fontWeight:"normal"}},[`${t}-description`]:{marginTop:i,color:m}},[`${t}-buttons`]:{textAlign:"end",whiteSpace:"nowrap",button:{marginInlineStart:p}}}}},ne=e=>{const{zIndexPopupBase:t}=e;return{zIndexPopup:t+60}},w=M("Popconfirm",e=>ee(e),ne,{resetStyle:!1});var te=function(e,t){var s={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(s[n]=e[n]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var o=0,n=Object.getOwnPropertySymbols(e);o<n.length;o++)t.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(e,n[o])&&(s[n[o]]=e[n[o]]);return s};const I=e=>{const{prefixCls:t,okButtonProps:s,cancelButtonProps:n,title:o,description:m,cancelText:u,okText:i,okType:p="primary",icon:v=l.createElement(_,null),showCancel:y=!0,close:b,onConfirm:x,onCancel:P,onPopupClick:N}=e,{getPrefixCls:C}=l.useContext(E),[d]=U("Popconfirm",q.Popconfirm),O=$(o),f=$(m);return l.createElement("div",{className:`${t}-inner-content`,onClick:N},l.createElement("div",{className:`${t}-message`},v&&l.createElement("span",{className:`${t}-message-icon`},v),l.createElement("div",{className:`${t}-message-text`},O&&l.createElement("div",{className:`${t}-title`},O),f&&l.createElement("div",{className:`${t}-description`},f))),l.createElement("div",{className:`${t}-buttons`},y&&l.createElement(D,Object.assign({onClick:P,size:"small"},n),u||(d==null?void 0:d.cancelText)),l.createElement(J,{buttonProps:Object.assign(Object.assign({size:"small"},K(p)),s),actionFn:x,close:b,prefixCls:C("btn"),quitOnNullishReturnValue:!0,emitEvent:!0},i||(d==null?void 0:d.okText))))},oe=e=>{const{prefixCls:t,placement:s,className:n,style:o}=e,m=te(e,["prefixCls","placement","className","style"]),{getPrefixCls:u}=l.useContext(E),i=u("popconfirm",t),[p]=w(i);return p(l.createElement(Y,{placement:s,className:h(i,n),style:o,content:l.createElement(I,Object.assign({prefixCls:i},m))}))};var le=function(e,t){var s={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(s[n]=e[n]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var o=0,n=Object.getOwnPropertySymbols(e);o<n.length;o++)t.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(e,n[o])&&(s[n[o]]=e[n[o]]);return s};const se=l.forwardRef((e,t)=>{var s,n,o,m,u,i;const{prefixCls:p,placement:v="top",trigger:y="click",okType:b="primary",icon:x=l.createElement(_,null),children:P,overlayClassName:N,onOpenChange:C,onVisibleChange:d,overlayStyle:O,styles:f,classNames:g}=e,k=le(e,["prefixCls","placement","trigger","okType","icon","children","overlayClassName","onOpenChange","onVisibleChange","overlayStyle","styles","classNames"]),{getPrefixCls:T,popconfirm:a}=l.useContext(E),[z,B]=G(!1,{value:(s=e.open)!==null&&s!==void 0?s:e.visible,defaultValue:(n=e.defaultOpen)!==null&&n!==void 0?n:e.defaultVisible}),j=(r,c)=>{B(r,!0),d==null||d(r),C==null||C(r,c)},V=r=>{j(!1,r)},W=r=>{var c;return(c=e.onConfirm)===null||c===void 0?void 0:c.call(void 0,r)},L=r=>{var c;j(!1,r),(c=e.onCancel)===null||c===void 0||c.call(void 0,r)},R=(r,c)=>{const{disabled:F=!1}=e;F||j(r,c)},S=T("popconfirm",p),X=h(S,N,(o=a==null?void 0:a.classNames)===null||o===void 0?void 0:o.root,g==null?void 0:g.root),H=h((m=a==null?void 0:a.classNames)===null||m===void 0?void 0:m.body,g==null?void 0:g.body),[A]=w(S);return A(l.createElement(Q,Object.assign({},Z(k,["title"]),{trigger:y,placement:v,onOpenChange:R,open:z,ref:t,classNames:{root:X,body:H},styles:{root:Object.assign(Object.assign(Object.assign(Object.assign({},(u=a==null?void 0:a.styles)===null||u===void 0?void 0:u.root),a==null?void 0:a.style),O),f==null?void 0:f.root),body:Object.assign(Object.assign({},(i=a==null?void 0:a.styles)===null||i===void 0?void 0:i.body),f==null?void 0:f.body)},content:l.createElement(I,Object.assign({okType:b,icon:x},e,{prefixCls:S,close:V,onConfirm:W,onCancel:L})),"data-popover-inject":!0}),P))}),ae=se;ae._InternalPanelDoNotUseOrYouWillBeFired=oe;export{ae as P};
