import e from"../_util/props-util/initDefaultProps.mjs";import{useProvidePortal as t}from"../vc-trigger/context.mjs";import n from"../_util/PortalWrapper.mjs";import r from"./IDialogPropTypes.mjs";import i from"./Dialog.mjs";import{createVNode as a,defineComponent as o,ref as s,watch as c}from"vue";var l=o({compatConfig:{MODE:3},name:`DialogWrap`,inheritAttrs:!1,props:e(r(),{visible:!1}),setup(e,{attrs:r,slots:o}){let l=s(e.visible);return t({},{inTriggerContext:!1}),c(()=>e.visible,()=>{e.visible&&(l.value=!0)},{flush:`post`}),()=>{let{visible:t,getContainer:s,forceRender:c,destroyOnClose:u=!1,afterClose:d}=e,f={...e,...r,ref:`_component`,key:`dialog`};return s===!1?a(i,{...f,getOpenCount:()=>2},o):!c&&u&&!l.value?null:a(n,{autoLock:!0,visible:t,forceRender:c,getContainer:s},{default:e=>(f={...f,...e,afterClose:()=>{d?.(),l.value=!1}},a(i,f,o))})}}});export{l as default};