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