const e=require("../_util/type.js"),t=require("../_util/warning.js"),n=require("../_util/classNames.js"),r=require("../_util/props-util/initDefaultProps.js"),i=require("../locale/LocaleReceiver.js"),a=require("../config-provider/hooks/useConfigInject.js"),o=require("../vc-util/Dom/addEventListener.js"),s=require("../_util/vue-types/index.js"),c=require("../_util/transition.js"),l=require("../button/buttonTypes.js"),u=require("../button/index.js"),d=require("../_util/styleChecker.js"),f=require("../vc-dialog/index.js"),p=require("./style/index.js");let m=require("vue"),h=require("@antsoo-lib/icons");var g;d.canUseDocElement()&&o.default(document.documentElement,`click`,e=>{g={x:e.pageX,y:e.pageY},setTimeout(()=>g=null,100)},!0);var _=()=>({prefixCls:String,visible:{type:Boolean,default:void 0},open:{type:Boolean,default:void 0},confirmLoading:{type:Boolean,default:void 0},title:s.default.any,closable:{type:Boolean,default:void 0},closeIcon:s.default.any,onOk:Function,onCancel:Function,"onUpdate:visible":Function,"onUpdate:open":Function,onChange:Function,afterClose:Function,centered:{type:Boolean,default:void 0},width:[String,Number],footer:s.default.any,okText:s.default.any,okType:String,cancelText:s.default.any,icon:s.default.any,maskClosable:{type:Boolean,default:void 0},forceRender:{type:Boolean,default:void 0},okButtonProps:e.objectType(),cancelButtonProps:e.objectType(),destroyOnClose:{type:Boolean,default:void 0},wrapClassName:String,maskTransitionName:String,transitionName:String,getContainer:{type:[String,Function,Boolean,Object],default:void 0},zIndex:Number,bodyStyle:e.objectType(),maskStyle:e.objectType(),mask:{type:Boolean,default:void 0},keyboard:{type:Boolean,default:void 0},wrapProps:Object,focusTriggerAfterClose:{type:Boolean,default:void 0},modalRender:Function,mousePosition:e.objectType()}),v=(0,m.defineComponent)({compatConfig:{MODE:3},name:`AModal`,inheritAttrs:!1,props:r.default(_(),{width:520,confirmLoading:!1,okType:`primary`}),setup(e,{emit:r,slots:o,attrs:s}){let[d]=i.useLocaleReceiver(`Modal`),{prefixCls:_,rootPrefixCls:v,direction:y,getPopupContainer:b}=a.default(`modal`,e),[x,S]=p.default(_);t.default(e.visible===void 0,`Modal`,"`visible` will be removed in next major version, please use `open` instead.");let C=e=>{r(`update:visible`,!1),r(`update:open`,!1),r(`cancel`,e),r(`change`,!1)},w=e=>{r(`ok`,e)},T=()=>{let{okText:t=o.okText?.(),okType:n,cancelText:r=o.cancelText?.(),confirmLoading:i}=e;return(0,m.createVNode)(m.Fragment,null,[(0,m.createVNode)(u.default,{onClick:C,...e.cancelButtonProps},{default:()=>[r||d.value.cancelText]}),(0,m.createVNode)(u.default,{...l.convertLegacyProps(n),loading:i,onClick:w,...e.okButtonProps},{default:()=>[t||d.value.okText]})])};return()=>{let{prefixCls:t,visible:r,open:i,wrapClassName:a,centered:l,getContainer:u,closeIcon:d=o.closeIcon?.(),focusTriggerAfterClose:p=!0,...w}=e,E=n.default(a,{[`${_.value}-centered`]:!!l,[`${_.value}-wrap-rtl`]:y.value===`rtl`});return x((0,m.createVNode)(f.default,{...w,...s,rootClassName:S.value,class:n.default(S.value,s.class),getContainer:u||b?.value,prefixCls:_.value,wrapClassName:E,visible:i??r,onClose:C,focusTriggerAfterClose:p,transitionName:c.getTransitionName(v.value,`zoom`,e.transitionName),maskTransitionName:c.getTransitionName(v.value,`fade`,e.maskTransitionName),mousePosition:w.mousePosition??g},{...o,footer:o.footer||T,closeIcon:()=>(0,m.createVNode)(`span`,{class:`${_.value}-close-x`},[d||(0,m.createVNode)(h.CloseOutlined,{class:`${_.value}-close-icon`},null)])}))}}});exports.default=v,exports.modalProps=_;