"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const l=require("vue"),y=require("../_util/omit.js"),w=require("../_util/vnode.js"),C=require("../config-provider/index.js"),g=require("./ConfirmDialog.js"),s=require("./destroyFns.js"),b=require("./locale.js"),q=e=>{const u=document.createDocumentFragment();let n={...y.default(e,["parentContext","appContext"]),close:c,open:!0},i=null;function d(...t){i&&(l.render(null,u),i=null);const o=t.some(r=>r&&r.triggerCancel);e.onCancel&&o&&e.onCancel(()=>{},...t.slice(1));for(let r=0;r<s.default.length;r++)if(s.default[r]===c){s.default.splice(r,1);break}}function c(...t){n={...n,open:!1,afterClose:()=>{typeof e.afterClose=="function"&&e.afterClose(),d.apply(this,t)}},n.visible&&delete n.visible,f(n)}function f(t){typeof t=="function"?n=t(n):n={...n,...t},i&&w.triggerVNodeUpdate(i,n,u)}const x=t=>{const o=C.globalConfigForApi,r=o.prefixCls,a=t.prefixCls||`${r}-modal`,h=o.iconPrefixCls,p=b.getConfirmLocale();return l.createVNode(C.default,{...o,prefixCls:r},{default:()=>[l.createVNode(g.default,{...t,rootPrefixCls:r,prefixCls:a,iconPrefixCls:h,locale:p,cancelText:t.cancelText||p.cancelText},null)]})};function m(t){const o=l.createVNode(x,{...t});return o.appContext=e.parentContext||e.appContext||o.appContext,l.render(o,u),o}return i=m(n),s.default.push(c),{destroy:c,update:f}};function v(e){return{...e,type:"warning"}}function P(e){return{...e,type:"info"}}function N(e){return{...e,type:"success"}}function S(e){return{...e,type:"error"}}function T(e){return{...e,type:"confirm"}}exports.default=q;exports.withConfirm=T;exports.withError=S;exports.withInfo=P;exports.withSuccess=N;exports.withWarn=v;
