var gt = Object.defineProperty, yt = Object.defineProperties; var Ct = Object.getOwnPropertyDescriptors; var Ne = Object.getOwnPropertySymbols; var bt = Object.prototype.hasOwnProperty, ht = Object.prototype.propertyIsEnumerable; var ze = (e, t, o) => t in e ? gt(e, t, { enumerable: !0, configurable: !0, writable: !0, value: o }) : e[t] = o, me = (e, t) => { for (var o in t || (t = {})) bt.call(t, o) && ze(e, o, t[o]); if (Ne) for (var o of Ne(t)) ht.call(t, o) && ze(e, o, t[o]); return e; }, Te = (e, t) => yt(e, Ct(t)); import { defineComponent as q, ref as B, computed as Z, createVNode as a, Transition as Ke, withDirectives as Ye, vShow as Ue, nextTick as Qe, shallowRef as D, watch as j, onBeforeUnmount as Ze, watchEffect as qe, Fragment as Pe, render as Re, unref as Me, isRef as Je, toRefs as xt, customRef as St, getCurrentScope as $t, onScopeDispose as wt, useAttrs as Tt, resolveComponent as xe, openBlock as E, createBlock as ne, mergeProps as Bt, withCtx as L, createElementVNode as ve, createElementBlock as le, renderList as Ee, createCommentVNode as Q, renderSlot as De, normalizeStyle as Pt, resolveDynamicComponent as Ft, createTextVNode as ce, toDisplayString as ae } from "vue"; import Ot from "./ModalHeader.js"; import { cQ as Mt, aI as et, P as R, _ as P, az as tt, d as f, au as At, c as ge, o as ot, i as $e, cR as Ht, K as Le, cS as It, bZ as Nt, g as zt, m as Rt, bM as Et, r as Dt, cO as Lt, aH as kt, aL as Ae, u as Wt, bA as nt, a3 as Se, c1 as _t, B as Fe, cT as Vt, e as pe, cU as jt, a as Gt, bs as Xt, br as Kt, bt as Yt, cV as Ut, cW as Qt, cX as Zt, cP as qt, cY as Jt, cZ as eo, aM as to, n as oo, ao as no } from "./index2.js"; import { A as ke } from "./ActionButton.js"; import { T as lo, _ as ao } from "./index11.js"; import { _ as io, S as ro } from "./index10.js"; const so = new et("antFadeIn", { "0%": { opacity: 0 }, "100%": { opacity: 1 } }), co = new et("antFadeOut", { "0%": { opacity: 1 }, "100%": { opacity: 0 } }), uo = function(e) { let t = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : !1; const { antCls: o } = e, n = `${o}-fade`, l = t ? "&" : ""; return [Mt(n, so, co, e.motionDurationMid, t), { [` ${l}${n}-enter, ${l}${n}-appear `]: { opacity: 0, animationTimingFunction: "linear" }, [`${l}${n}-leave`]: { animationTimingFunction: "linear" } }]; }; function He() { return { keyboard: { type: Boolean, default: void 0 }, mask: { type: Boolean, default: void 0 }, afterClose: Function, closable: { type: Boolean, default: void 0 }, maskClosable: { type: Boolean, default: void 0 }, visible: { type: Boolean, default: void 0 }, destroyOnClose: { type: Boolean, default: void 0 }, mousePosition: R.shape({ x: Number, y: Number }).loose, title: R.any, footer: R.any, transitionName: String, maskTransitionName: String, animation: R.any, maskAnimation: R.any, wrapStyle: { type: Object, default: void 0 }, bodyStyle: { type: Object, default: void 0 }, maskStyle: { type: Object, default: void 0 }, prefixCls: String, wrapClassName: String, rootClassName: String, width: [String, Number], height: [String, Number], zIndex: Number, bodyProps: R.any, maskProps: R.any, wrapProps: R.any, getContainer: R.any, dialogStyle: { type: Object, default: void 0 }, dialogClass: String, closeIcon: R.any, forceRender: { type: Boolean, default: void 0 }, getOpenCount: Function, // https://github.com/ant-design/ant-design/issues/19771 // https://github.com/react-component/dialog/issues/95 focusTriggerAfterClose: { type: Boolean, default: void 0 }, onClose: Function, modalRender: Function }; } function We(e, t, o) { let n = t; return !n && o && (n = `${e}-${o}`), n; } let _e = -1; function fo() { return _e += 1, _e; } function Ve(e, t) { let o = e[`page${t ? "Y" : "X"}Offset`]; const n = `scroll${t ? "Top" : "Left"}`; if (typeof o != "number") { const l = e.document; o = l.documentElement[n], typeof o != "number" && (o = l.body[n]); } return o; } function mo(e) { const t = e.getBoundingClientRect(), o = { left: t.left, top: t.top }, n = e.ownerDocument, l = n.defaultView || n.parentWindow; return o.left += Ve(l), o.top += Ve(l, !0), o; } const vo = { width: 0, height: 0, overflow: "hidden", outline: "none" }, po = { outline: "none" }, go = q({ compatConfig: { MODE: 3 }, name: "DialogContent", inheritAttrs: !1, props: f(f({}, He()), { motionName: String, ariaId: String, onVisibleChanged: Function, onMousedown: Function, onMouseup: Function }), setup(e, t) { let { expose: o, slots: n, attrs: l } = t; const i = B(), p = B(), m = B(); o({ focus: () => { var s; (s = i.value) === null || s === void 0 || s.focus({ preventScroll: !0 }); }, changeActive: (s) => { const { activeElement: r } = document; s && r === p.value ? i.value.focus({ preventScroll: !0 }) : !s && r === i.value && p.value.focus({ preventScroll: !0 }); } }); const S = B(), v = Z(() => { const { width: s, height: r } = e, g = {}; return s !== void 0 && (g.width = typeof s == "number" ? `${s}px` : s), r !== void 0 && (g.height = typeof r == "number" ? `${r}px` : r), S.value && (g.transformOrigin = S.value), g; }), d = () => { Qe(() => { if (m.value) { const s = mo(m.value); S.value = e.mousePosition ? `${e.mousePosition.x - s.left}px ${e.mousePosition.y - s.top}px` : ""; } }); }, u = (s) => { e.onVisibleChanged(s); }; return () => { var s, r, g, x; const { prefixCls: $, footer: c = (s = n.footer) === null || s === void 0 ? void 0 : s.call(n), title: C = (r = n.title) === null || r === void 0 ? void 0 : r.call(n), ariaId: y, closable: w, closeIcon: O = (g = n.closeIcon) === null || g === void 0 ? void 0 : g.call(n), onClose: A, bodyStyle: T, bodyProps: b, onMousedown: H, onMouseup: M, visible: I, modalRender: F = n.modalRender, destroyOnClose: N, motionName: G } = e; let U; c && (U = a("div", { class: `${$}-footer` }, [c])); let W; C && (W = a("div", { class: `${$}-header` }, [a("div", { class: `${$}-title`, id: y }, [C])])); let K; w && (K = a("button", { type: "button", onClick: A, "aria-label": "Close", class: `${$}-close` }, [O || a("span", { class: `${$}-close-x` }, null)])); const _ = a("div", { class: `${$}-content` }, [K, W, a("div", P({ class: `${$}-body`, style: T }, b), [(x = n.default) === null || x === void 0 ? void 0 : x.call(n)]), U]), J = tt(G); return a(Ke, P(P({}, J), {}, { onBeforeEnter: d, onAfterEnter: () => u(!0), onAfterLeave: () => u(!1) }), { default: () => [I || !N ? Ye(a("div", P(P({}, l), {}, { ref: m, key: "dialog-element", role: "document", style: [v.value, l.style], class: [$, l.class], onMousedown: H, onMouseup: M }), [a("div", { tabindex: 0, ref: i, style: po }, [F ? F({ originVNode: _ }) : _]), a("div", { tabindex: 0, ref: p, style: vo }, null)]), [[Ue, I]]) : null] }); }; } }), yo = q({ compatConfig: { MODE: 3 }, name: "DialogMask", props: { prefixCls: String, visible: Boolean, motionName: String, maskProps: Object }, setup(e, t) { return () => { const { prefixCls: o, visible: n, maskProps: l, motionName: i } = e, p = tt(i); return a(Ke, p, { default: () => [Ye(a("div", P({ class: `${o}-mask` }, l), null), [[Ue, n]])] }); }; } }), je = q({ compatConfig: { MODE: 3 }, name: "VcDialog", inheritAttrs: !1, props: $e(f(f({}, He()), { getOpenCount: Function, scrollLocker: Object }), { mask: !0, visible: !1, keyboard: !0, closable: !0, maskClosable: !0, destroyOnClose: !1, prefixCls: "rc-dialog", getOpenCount: () => null, focusTriggerAfterClose: !0 }), setup(e, t) { let { attrs: o, slots: n } = t; const l = D(), i = D(), p = D(), m = D(e.visible), S = D(`vcDialogTitle${fo()}`), v = (c) => { var C, y; if (c) Ht(i.value, document.activeElement) || (l.value = document.activeElement, (C = p.value) === null || C === void 0 || C.focus()); else { const w = m.value; if (m.value = !1, e.mask && l.value && e.focusTriggerAfterClose) { try { l.value.focus({ preventScroll: !0 }); } catch (O) { } l.value = null; } w && ((y = e.afterClose) === null || y === void 0 || y.call(e)); } }, d = (c) => { var C; (C = e.onClose) === null || C === void 0 || C.call(e, c); }, u = D(!1), s = D(), r = () => { clearTimeout(s.value), u.value = !0; }, g = () => { s.value = setTimeout(() => { u.value = !1; }); }, x = (c) => { if (!e.maskClosable) return null; u.value ? u.value = !1 : i.value === c.target && d(c); }, $ = (c) => { if (e.keyboard && c.keyCode === Le.ESC) { c.stopPropagation(), d(c); return; } e.visible && c.keyCode === Le.TAB && p.value.changeActive(!c.shiftKey); }; return j(() => e.visible, () => { e.visible && (m.value = !0); }, { flush: "post" }), Ze(() => { var c; clearTimeout(s.value), (c = e.scrollLocker) === null || c === void 0 || c.unLock(); }), qe(() => { var c, C; (c = e.scrollLocker) === null || c === void 0 || c.unLock(), m.value && ((C = e.scrollLocker) === null || C === void 0 || C.lock()); }), () => { const { prefixCls: c, mask: C, visible: y, maskTransitionName: w, maskAnimation: O, zIndex: A, wrapClassName: T, rootClassName: b, wrapStyle: H, closable: M, maskProps: I, maskStyle: F, transitionName: N, animation: G, wrapProps: U, title: W = n.title } = e, { style: K, class: _ } = o; return a("div", P({ class: [`${c}-root`, b] }, At(e, { data: !0 })), [a(yo, { prefixCls: c, visible: C && y, motionName: We(c, w, O), style: f({ zIndex: A }, F), maskProps: I }, null), a("div", P({ tabIndex: -1, onKeydown: $, class: ge(`${c}-wrap`, T), ref: i, onClick: x, role: "dialog", "aria-labelledby": W ? S.value : null, style: f(f({ zIndex: A }, H), { display: m.value ? null : "none" }) }, U), [a(go, P(P({}, ot(e, ["scrollLocker"])), {}, { style: K, class: _, onMousedown: r, onMouseup: g, ref: p, closable: M, ariaId: S.value, prefixCls: c, visible: y, onClose: d, onVisibleChanged: v, motionName: We(c, N, G) }), n)])]); }; } }), Co = He(), bo = q({ compatConfig: { MODE: 3 }, name: "DialogWrap", inheritAttrs: !1, props: $e(Co, { visible: !1 }), setup(e, t) { let { attrs: o, slots: n } = t; const l = B(e.visible); return It({}, { inTriggerContext: !1 }), j(() => e.visible, () => { e.visible && (l.value = !0); }, { flush: "post" }), () => { const { visible: i, getContainer: p, forceRender: m, destroyOnClose: S = !1, afterClose: v } = e; let d = f(f(f({}, e), o), { ref: "_component", key: "dialog" }); return p === !1 ? a(je, P(P({}, d), {}, { getOpenCount: () => 2 }), n) : !m && S && !l.value ? null : a(Nt, { autoLock: !0, visible: i, forceRender: m, getContainer: p }, { default: (u) => (d = f(f(f({}, d), u), { afterClose: () => { v == null || v(), l.value = !1; } }), a(je, d, n)) }); }; } }); function Ge(e) { return { position: e, top: 0, insetInlineEnd: 0, bottom: 0, insetInlineStart: 0 }; } const ho = (e) => { const { componentCls: t } = e; return [{ [`${t}-root`]: { [`${t}${e.antCls}-zoom-enter, ${t}${e.antCls}-zoom-appear`]: { // reset scale avoid mousePosition bug transform: "none", opacity: 0, animationDuration: e.motionDurationSlow, // https://github.com/ant-design/ant-design/issues/11777 userSelect: "none" }, [`${t}${e.antCls}-zoom-leave ${t}-content`]: { pointerEvents: "none" }, [`${t}-mask`]: f(f({}, Ge("fixed")), { zIndex: e.zIndexPopupBase, height: "100%", backgroundColor: e.colorBgMask, [`${t}-hidden`]: { display: "none" } }), [`${t}-wrap`]: f(f({}, Ge("fixed")), { overflow: "auto", outline: 0, WebkitOverflowScrolling: "touch" }) } }, { [`${t}-root`]: uo(e) }]; }, xo = (e) => { const { componentCls: t } = e; return [ // ======================== Root ========================= { [`${t}-root`]: { [`${t}-wrap`]: { zIndex: e.zIndexPopupBase, position: "fixed", inset: 0, overflow: "auto", outline: 0, WebkitOverflowScrolling: "touch" }, [`${t}-wrap-rtl`]: { direction: "rtl" }, [`${t}-centered`]: { textAlign: "center", "&::before": { display: "inline-block", width: 0, height: "100%", verticalAlign: "middle", content: '""' }, [t]: { top: 0, display: "inline-block", paddingBottom: 0, textAlign: "start", verticalAlign: "middle" } }, [`@media (max-width: ${e.screenSMMax})`]: { [t]: { maxWidth: "calc(100vw - 16px)", margin: `${e.marginXS} auto` }, [`${t}-centered`]: { [t]: { flex: 1 } } } } }, // ======================== Modal ======================== { [t]: f(f({}, Dt(e)), { pointerEvents: "none", position: "relative", top: 100, width: "auto", maxWidth: `calc(100vw - ${e.margin * 2}px)`, margin: "0 auto", paddingBottom: e.paddingLG, [`${t}-title`]: { margin: 0, color: e.modalHeadingColor, fontWeight: e.fontWeightStrong, fontSize: e.modalHeaderTitleFontSize, lineHeight: e.modalHeaderTitleLineHeight, wordWrap: "break-word" }, [`${t}-content`]: { position: "relative", backgroundColor: e.modalContentBg, backgroundClip: "padding-box", border: 0, borderRadius: e.borderRadiusLG, boxShadow: e.boxShadowSecondary, pointerEvents: "auto", padding: `${e.paddingMD}px ${e.paddingContentHorizontalLG}px` }, [`${t}-close`]: f({ position: "absolute", top: (e.modalHeaderCloseSize - e.modalCloseBtnSize) / 2, insetInlineEnd: (e.modalHeaderCloseSize - e.modalCloseBtnSize) / 2, zIndex: e.zIndexPopupBase + 10, padding: 0, color: e.modalCloseColor, fontWeight: e.fontWeightStrong, lineHeight: 1, textDecoration: "none", background: "transparent", borderRadius: e.borderRadiusSM, width: e.modalConfirmIconSize, height: e.modalConfirmIconSize, border: 0, outline: 0, cursor: "pointer", transition: `color ${e.motionDurationMid}, background-color ${e.motionDurationMid}`, "&-x": { display: "block", fontSize: e.fontSizeLG, fontStyle: "normal", lineHeight: `${e.modalCloseBtnSize}px`, textAlign: "center", textTransform: "none", textRendering: "auto" }, "&:hover": { color: e.modalIconHoverColor, backgroundColor: e.wireframe ? "transparent" : e.colorFillContent, textDecoration: "none" }, "&:active": { backgroundColor: e.wireframe ? "transparent" : e.colorFillContentHover } }, Lt(e)), [`${t}-header`]: { color: e.colorText, background: e.modalHeaderBg, borderRadius: `${e.borderRadiusLG}px ${e.borderRadiusLG}px 0 0`, marginBottom: e.marginXS }, [`${t}-body`]: { fontSize: e.fontSize, lineHeight: e.lineHeight, wordWrap: "break-word" }, [`${t}-footer`]: { textAlign: "end", background: e.modalFooterBg, marginTop: e.marginSM, [`${e.antCls}-btn + ${e.antCls}-btn:not(${e.antCls}-dropdown-trigger)`]: { marginBottom: 0, marginInlineStart: e.marginXS } }, [`${t}-open`]: { overflow: "hidden" } }) }, // ======================== Pure ========================= { [`${t}-pure-panel`]: { top: "auto", padding: 0, display: "flex", flexDirection: "column", [`${t}-content, ${t}-body, ${t}-confirm-body-wrapper`]: { display: "flex", flexDirection: "column", flex: "auto" }, [`${t}-confirm-body`]: { marginBottom: "auto" } } } ]; }, So = (e) => { const { componentCls: t } = e, o = `${t}-confirm`; return { [o]: { "&-rtl": { direction: "rtl" }, [`${e.antCls}-modal-header`]: { display: "none" }, [`${o}-body-wrapper`]: f({}, kt()), [`${o}-body`]: { display: "flex", flexWrap: "wrap", alignItems: "center", [`${o}-title`]: { flex: "0 0 100%", display: "block", // create BFC to avoid // https://user-images.githubusercontent.com/507615/37702510-ba844e06-2d2d-11e8-9b67-8e19be57f445.png overflow: "hidden", color: e.colorTextHeading, fontWeight: e.fontWeightStrong, fontSize: e.modalHeaderTitleFontSize, lineHeight: e.modalHeaderTitleLineHeight, [`+ ${o}-content`]: { marginBlockStart: e.marginXS, flexBasis: "100%", maxWidth: `calc(100% - ${e.modalConfirmIconSize + e.marginSM}px)` } }, [`${o}-content`]: { color: e.colorText, fontSize: e.fontSize }, [`> ${e.iconCls}`]: { flex: "none", marginInlineEnd: e.marginSM, fontSize: e.modalConfirmIconSize, [`+ ${o}-title`]: { flex: 1 }, // `content` after `icon` should set marginLeft [`+ ${o}-title + ${o}-content`]: { marginInlineStart: e.modalConfirmIconSize + e.marginSM } } }, [`${o}-btns`]: { textAlign: "end", marginTop: e.marginSM, [`${e.antCls}-btn + ${e.antCls}-btn`]: { marginBottom: 0, marginInlineStart: e.marginXS } } }, [`${o}-error ${o}-body > ${e.iconCls}`]: { color: e.colorError }, [`${o}-warning ${o}-body > ${e.iconCls}, ${o}-confirm ${o}-body > ${e.iconCls}`]: { color: e.colorWarning }, [`${o}-info ${o}-body > ${e.iconCls}`]: { color: e.colorInfo }, [`${o}-success ${o}-body > ${e.iconCls}`]: { color: e.colorSuccess }, // https://github.com/ant-design/ant-design/issues/37329 [`${t}-zoom-leave ${t}-btns`]: { pointerEvents: "none" } }; }, $o = (e) => { const { componentCls: t } = e; return { [`${t}-root`]: { [`${t}-wrap-rtl`]: { direction: "rtl", [`${t}-confirm-body`]: { direction: "rtl" } } } }; }, wo = (e) => { const { componentCls: t, antCls: o } = e, n = `${t}-confirm`; return { [t]: { [`${t}-content`]: { padding: 0 }, [`${t}-header`]: { padding: e.modalHeaderPadding, borderBottom: `${e.modalHeaderBorderWidth}px ${e.modalHeaderBorderStyle} ${e.modalHeaderBorderColorSplit}`, marginBottom: 0 }, [`${t}-body`]: { padding: e.modalBodyPadding }, [`${t}-footer`]: { padding: `${e.modalFooterPaddingVertical}px ${e.modalFooterPaddingHorizontal}px`, borderTop: `${e.modalFooterBorderWidth}px ${e.modalFooterBorderStyle} ${e.modalFooterBorderColorSplit}`, borderRadius: `0 0 ${e.borderRadiusLG}px ${e.borderRadiusLG}px`, marginTop: 0 } }, [n]: { [`${o}-modal-body`]: { padding: `${e.padding * 2}px ${e.padding * 2}px ${e.paddingLG}px` }, [`${n}-body`]: { [`> ${e.iconCls}`]: { marginInlineEnd: e.margin, // `content` after `icon` should set marginLeft [`+ ${n}-title + ${n}-content`]: { marginInlineStart: e.modalConfirmIconSize + e.margin } } }, [`${n}-btns`]: { marginTop: e.marginLG } } }; }, To = zt("Modal", (e) => { const t = e.padding, o = e.fontSizeHeading5, n = e.lineHeightHeading5, l = Rt(e, { modalBodyPadding: e.paddingLG, modalHeaderBg: e.colorBgElevated, modalHeaderPadding: `${t}px ${e.paddingLG}px`, modalHeaderBorderWidth: e.lineWidth, modalHeaderBorderStyle: e.lineType, modalHeaderTitleLineHeight: n, modalHeaderTitleFontSize: o, modalHeaderBorderColorSplit: e.colorSplit, modalHeaderCloseSize: n * o + t * 2, modalContentBg: e.colorBgElevated, modalHeadingColor: e.colorTextHeading, modalCloseColor: e.colorTextDescription, modalFooterBg: "transparent", modalFooterBorderColorSplit: e.colorSplit, modalFooterBorderStyle: e.lineType, modalFooterPaddingVertical: e.paddingXS, modalFooterPaddingHorizontal: e.padding, modalFooterBorderWidth: e.lineWidth, modalConfirmTitleFontSize: e.fontSizeLG, modalIconHoverColor: e.colorIconHover, modalConfirmIconSize: e.fontSize * e.lineHeight, modalCloseBtnSize: e.controlHeightLG * 0.55 }); return [xo(l), So(l), $o(l), ho(l), e.wireframe && wo(l), Et(l, "zoom")]; }); var Bo = function(e, t) { var o = {}; for (var n in e) Object.prototype.hasOwnProperty.call(e, n) && t.indexOf(n) < 0 && (o[n] = e[n]); if (e != null && typeof Object.getOwnPropertySymbols == "function") for (var l = 0, n = Object.getOwnPropertySymbols(e); l < n.length; l++) t.indexOf(n[l]) < 0 && Object.prototype.propertyIsEnumerable.call(e, n[l]) && (o[n[l]] = e[n[l]]); return o; }; let Oe; const Po = (e) => { Oe = { x: e.pageX, y: e.pageY }, setTimeout(() => Oe = null, 100); }; jt() && Gt(document.documentElement, "click", Po, !0); const Fo = () => ({ prefixCls: String, /** @deprecated Please use `open` instead. */ visible: { type: Boolean, default: void 0 }, open: { type: Boolean, default: void 0 }, confirmLoading: { type: Boolean, default: void 0 }, title: R.any, closable: { type: Boolean, default: void 0 }, closeIcon: R.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: R.any, okText: R.any, okType: String, cancelText: R.any, icon: R.any, maskClosable: { type: Boolean, default: void 0 }, forceRender: { type: Boolean, default: void 0 }, okButtonProps: pe(), cancelButtonProps: pe(), destroyOnClose: { type: Boolean, default: void 0 }, wrapClassName: String, maskTransitionName: String, transitionName: String, getContainer: { type: [String, Function, Boolean, Object], default: void 0 }, zIndex: Number, bodyStyle: pe(), maskStyle: pe(), mask: { type: Boolean, default: void 0 }, keyboard: { type: Boolean, default: void 0 }, wrapProps: Object, focusTriggerAfterClose: { type: Boolean, default: void 0 }, modalRender: Function, mousePosition: pe() }), k = q({ compatConfig: { MODE: 3 }, name: "AModal", inheritAttrs: !1, props: $e(Fo(), { width: 520, confirmLoading: !1, okType: "primary" }), setup(e, t) { let { emit: o, slots: n, attrs: l } = t; const [i] = Ae("Modal"), { prefixCls: p, rootPrefixCls: m, direction: S, getPopupContainer: v } = Wt("modal", e), [d, u] = To(p); nt(e.visible === void 0, "Modal", "`visible` will be removed in next major version, please use `open` instead."); const s = (x) => { o("update:visible", !1), o("update:open", !1), o("cancel", x), o("change", !1); }, r = (x) => { o("ok", x); }, g = () => { var x, $; const { okText: c = (x = n.okText) === null || x === void 0 ? void 0 : x.call(n), okType: C, cancelText: y = ($ = n.cancelText) === null || $ === void 0 ? void 0 : $.call(n), confirmLoading: w } = e; return a(Pe, null, [a(Fe, P({ onClick: s }, e.cancelButtonProps), { default: () => [y || i.value.cancelText] }), a(Fe, P(P({}, Vt(C)), {}, { loading: w, onClick: r }, e.okButtonProps), { default: () => [c || i.value.okText] })]); }; return () => { var x, $; const { prefixCls: c, visible: C, open: y, wrapClassName: w, centered: O, getContainer: A, closeIcon: T = (x = n.closeIcon) === null || x === void 0 ? void 0 : x.call(n), focusTriggerAfterClose: b = !0 } = e, H = Bo(e, ["prefixCls", "visible", "open", "wrapClassName", "centered", "getContainer", "closeIcon", "focusTriggerAfterClose"]), M = ge(w, { [`${p.value}-centered`]: !!O, [`${p.value}-wrap-rtl`]: S.value === "rtl" }); return d(a(bo, P(P(P({}, H), l), {}, { rootClassName: u.value, class: ge(u.value, l.class), getContainer: A || (v == null ? void 0 : v.value), prefixCls: p.value, wrapClassName: M, visible: y != null ? y : C, onClose: s, focusTriggerAfterClose: b, transitionName: Se(m.value, "zoom", e.transitionName), maskTransitionName: Se(m.value, "fade", e.maskTransitionName), mousePosition: ($ = H.mousePosition) !== null && $ !== void 0 ? $ : Oe }), f(f({}, n), { footer: n.footer || g, closeIcon: () => a("span", { class: `${p.value}-close-x` }, [T || a(_t, { class: `${p.value}-close-icon` }, null)]) }))); }; } }); function de(e) { return typeof e == "function" ? e() : e; } const lt = q({ name: "ConfirmDialog", inheritAttrs: !1, props: ["icon", "onCancel", "onOk", "close", "closable", "zIndex", "afterClose", "visible", "open", "keyboard", "centered", "getContainer", "maskStyle", "okButtonProps", "cancelButtonProps", "okType", "prefixCls", "okCancel", "width", "mask", "maskClosable", "okText", "cancelText", "autoFocusButton", "transitionName", "maskTransitionName", "type", "title", "content", "direction", "rootPrefixCls", "bodyStyle", "closeIcon", "modalRender", "focusTriggerAfterClose", "wrapClassName", "confirmPrefixCls", "footer"], setup(e, t) { let { attrs: o } = t; const [n] = Ae("Modal"); return process.env.NODE_ENV !== "production" && nt(e.visible === void 0, "Modal", "`visible` is deprecated, please use `open` instead."), () => { const { icon: l, onCancel: i, onOk: p, close: m, okText: S, closable: v = !1, zIndex: d, afterClose: u, keyboard: s, centered: r, getContainer: g, maskStyle: x, okButtonProps: $, cancelButtonProps: c, okCancel: C, width: y = 416, mask: w = !0, maskClosable: O = !1, type: A, open: T, title: b, content: H, direction: M, closeIcon: I, modalRender: F, focusTriggerAfterClose: N, rootPrefixCls: G, bodyStyle: U, wrapClassName: W, footer: K } = e; let _ = l; if (!l && l !== null) switch (A) { case "info": _ = a(Ut, null, null); break; case "success": _ = a(Yt, null, null); break; case "error": _ = a(Kt, null, null); break; default: _ = a(Xt, null, null); } const J = e.okType || "primary", ue = e.prefixCls || "ant-modal", ee = `${ue}-confirm`, we = o.style || {}, Ce = C != null ? C : A === "confirm", fe = e.autoFocusButton === null ? !1 : e.autoFocusButton || "ok", h = `${ue}-confirm`, Y = ge(h, `${h}-${e.type}`, { [`${h}-rtl`]: M === "rtl" }, o.class), V = n.value, X = Ce && a(ke, { actionFn: i, close: m, autofocus: fe === "cancel", buttonProps: c, prefixCls: `${G}-btn` }, { default: () => [de(e.cancelText) || V.cancelText] }); return a(k, { prefixCls: ue, class: Y, wrapClassName: ge({ [`${h}-centered`]: !!r }, W), onCancel: (re) => m == null ? void 0 : m({ triggerCancel: !0 }, re), open: T, title: "", footer: "", transitionName: Se(G, "zoom", e.transitionName), maskTransitionName: Se(G, "fade", e.maskTransitionName), mask: w, maskClosable: O, maskStyle: x, style: we, bodyStyle: U, width: y, zIndex: d, afterClose: u, keyboard: s, centered: r, getContainer: g, closable: v, closeIcon: I, modalRender: F, focusTriggerAfterClose: N }, { default: () => [a("div", { class: `${ee}-body-wrapper` }, [a("div", { class: `${ee}-body` }, [de(_), b === void 0 ? null : a("span", { class: `${ee}-title` }, [de(b)]), a("div", { class: `${ee}-content` }, [de(H)])]), K !== void 0 ? de(K) : a("div", { class: `${ee}-btns` }, [X, a(ke, { type: J, actionFn: p, close: m, autofocus: fe === "ok", buttonProps: $, prefixCls: `${G}-btn` }, { default: () => [de(S) || (Ce ? V.okText : V.justOkText)] })])])] }); }; } }), ie = [], ye = (e) => { const t = document.createDocumentFragment(); let o = f(f({}, ot(e, ["parentContext", "appContext"])), { close: i, open: !0 }), n = null; function l() { n && (Re(null, t), n = null); for (var v = arguments.length, d = new Array(v), u = 0; u < v; u++) d[u] = arguments[u]; const s = d.some((r) => r && r.triggerCancel); e.onCancel && s && e.onCancel(() => { }, ...d.slice(1)); for (let r = 0; r < ie.length; r++) if (ie[r] === i) { ie.splice(r, 1); break; } } function i() { for (var v = arguments.length, d = new Array(v), u = 0; u < v; u++) d[u] = arguments[u]; o = f(f({}, o), { open: !1, afterClose: () => { typeof e.afterClose == "function" && e.afterClose(), l.apply(this, d); } }), o.visible && delete o.visible, p(o); } function p(v) { typeof v == "function" ? o = v(o) : o = f(f({}, o), v), n && Qt(n, o, t); } const m = (v) => { const d = Zt, u = d.prefixCls, s = v.prefixCls || `${u}-modal`, r = d.iconPrefixCls, g = Jt(); return a(qt, P(P({}, d), {}, { prefixCls: u }), { default: () => [a(lt, P(P({}, v), {}, { rootPrefixCls: u, prefixCls: s, iconPrefixCls: r, locale: g, cancelText: v.cancelText || g.cancelText }), null)] }); }; function S(v) { const d = a(m, f({}, v)); return d.appContext = e.parentContext || e.appContext || d.appContext, Re(d, t), d; } return n = S(o), ie.push(i), { destroy: i, update: p }; }; function at(e) { return f(f({}, e), { type: "warning" }); } function it(e) { return f(f({}, e), { type: "info" }); } function rt(e) { return f(f({}, e), { type: "success" }); } function st(e) { return f(f({}, e), { type: "error" }); } function ct(e) { return f(f({}, e), { type: "confirm" }); } const Oo = () => ({ config: Object, afterClose: Function, destroyAction: Function, open: Boolean }), Mo = q({ name: "HookModal", inheritAttrs: !1, props: $e(Oo(), { config: { width: 520, okType: "primary" } }), setup(e, t) { let { expose: o } = t; var n; const l = Z(() => e.open), i = Z(() => e.config), { direction: p, getPrefixCls: m } = eo(), S = m("modal"), v = m(), d = () => { var g, x; e == null || e.afterClose(), (x = (g = i.value).afterClose) === null || x === void 0 || x.call(g); }, u = function() { e.destroyAction(...arguments); }; o({ destroy: u }); const s = (n = i.value.okCancel) !== null && n !== void 0 ? n : i.value.type === "confirm", [r] = Ae("Modal", to.Modal); return () => a(lt, P(P({ prefixCls: S, rootPrefixCls: v }, i.value), {}, { close: u, open: l.value, afterClose: d, okText: i.value.okText || (s ? r == null ? void 0 : r.value.okText : r == null ? void 0 : r.value.justOkText), direction: i.value.direction || p.value, cancelText: i.value.cancelText || (r == null ? void 0 : r.value.cancelText) }), null); } }); let Xe = 0; const Ao = q({ name: "ElementsHolder", inheritAttrs: !1, setup(e, t) { let { expose: o } = t; const n = D([]); return o({ addModal: (i) => (n.value.push(i), n.value = n.value.slice(), () => { n.value = n.value.filter((p) => p !== i); }) }), () => n.value.map((i) => i()); } }); function Ho() { const e = D(null), t = D([]); j(t, () => { t.value.length && ([...t.value].forEach((p) => { p(); }), t.value = []); }, { immediate: !0 }); const o = (i) => function(m) { var S; Xe += 1; const v = D(!0), d = D(null), u = D(Me(m)), s = D({}); j(() => m, (y) => { $(f(f({}, Je(y) ? y.value : y), s.value)); }); const r = function() { v.value = !1; for (var y = arguments.length, w = new Array(y), O = 0; O < y; O++) w[O] = arguments[O]; const A = w.some((T) => T && T.triggerCancel); u.value.onCancel && A && u.value.onCancel(() => { }, ...w.slice(1)); }; let g; const x = () => a(Mo, { key: `modal-${Xe}`, config: i(u.value), ref: d, open: v.value, destroyAction: r, afterClose: () => { g == null || g(); } }, null); g = (S = e.value) === null || S === void 0 ? void 0 : S.addModal(x), g && ie.push(g); const $ = (y) => { u.value = f(f({}, u.value), y); }; return { destroy: () => { d.value ? r() : t.value = [...t.value, r]; }, update: (y) => { s.value = y, d.value ? $(y) : t.value = [...t.value, () => $(y)]; } }; }, n = Z(() => ({ info: o(it), success: o(rt), error: o(st), warning: o(at), confirm: o(ct) })), l = Symbol("modalHolderKey"); return [n.value, () => a(Ao, { key: l, ref: e }, null)]; } function dt(e) { return ye(at(e)); } k.useModal = Ho; k.info = function(t) { return ye(it(t)); }; k.success = function(t) { return ye(rt(t)); }; k.error = function(t) { return ye(st(t)); }; k.warning = dt; k.warn = dt; k.confirm = function(t) { return ye(ct(t)); }; k.destroyAll = function() { for (; ie.length; ) { const t = ie.pop(); t && t(); } }; k.install = function(e) { return e.component(k.name, k), e; }; function Io(e) { return $t() ? (wt(e), !0) : !1; } function z(e) { return typeof e == "function" ? e() : Me(e); } const ut = typeof window != "undefined" && typeof document != "undefined"; typeof WorkerGlobalScope != "undefined" && globalThis instanceof WorkerGlobalScope; const No = Object.prototype.toString, zo = (e) => No.call(e) === "[object Object]", Ro = () => { }; function Eo(e, t = {}) { if (!Je(e)) return xt(e); const o = Array.isArray(e.value) ? Array.from({ length: e.value.length }) : {}; for (const n in e.value) o[n] = St(() => ({ get() { return e.value[n]; }, set(l) { var i; if ((i = z(t.replaceRef)) != null ? i : !0) if (Array.isArray(e.value)) { const m = [...e.value]; m[n] = l, e.value = m; } else { const m = Te(me({}, e.value), { [n]: l }); Object.setPrototypeOf(m, Object.getPrototypeOf(e.value)), e.value = m; } else e.value[n] = l; } })); return o; } const ft = ut ? window : void 0; function Do(e) { var t; const o = z(e); return (t = o == null ? void 0 : o.$el) != null ? t : o; } function Be(...e) { let t, o, n, l; if (typeof e[0] == "string" || Array.isArray(e[0]) ? ([o, n, l] = e, t = ft) : [t, o, n, l] = e, !t) return Ro; Array.isArray(o) || (o = [o]), Array.isArray(n) || (n = [n]); const i = [], p = () => { i.forEach((d) => d()), i.length = 0; }, m = (d, u, s, r) => (d.addEventListener(u, s, r), () => d.removeEventListener(u, s, r)), S = j( () => [Do(t), z(l)], ([d, u]) => { if (p(), !d) return; const s = zo(u) ? me({}, u) : u; i.push( ...o.flatMap((r) => n.map((g) => m(d, r, g, s))) ); }, { immediate: !0, flush: "post" } ), v = () => { S(), p(); }; return Io(v), v; } function Lo(e, t = {}) { var o, n; const { pointerTypes: l, preventDefault: i, stopPropagation: p, exact: m, onMove: S, onEnd: v, onStart: d, initialValue: u, axis: s = "both", draggingElement: r = ft, containerElement: g, handle: x = e, buttons: $ = [0] } = t, c = B( (o = z(u)) != null ? o : { x: 0, y: 0 } ), C = B(), y = (b) => l ? l.includes(b.pointerType) : !0, w = (b) => { z(i) && b.preventDefault(), z(p) && b.stopPropagation(); }, O = (b) => { var H; if (!z($).includes(b.button) || z(t.disabled) || !y(b) || z(m) && b.target !== z(e)) return; const M = z(g), I = (H = M == null ? void 0 : M.getBoundingClientRect) == null ? void 0 : H.call(M), F = z(e).getBoundingClientRect(), N = { x: b.clientX - (M ? F.left - I.left + M.scrollLeft : F.left), y: b.clientY - (M ? F.top - I.top + M.scrollTop : F.top) }; (d == null ? void 0 : d(N, b)) !== !1 && (C.value = N, w(b)); }, A = (b) => { if (z(t.disabled) || !y(b) || !C.value) return; const H = z(g), M = z(e).getBoundingClientRect(); let { x: I, y: F } = c.value; (s === "x" || s === "both") && (I = b.clientX - C.value.x, H && (I = Math.min(Math.max(0, I), H.scrollWidth - M.width))), (s === "y" || s === "both") && (F = b.clientY - C.value.y, H && (F = Math.min(Math.max(0, F), H.scrollHeight - M.height))), c.value = { x: I, y: F }, S == null || S(c.value, b), w(b); }, T = (b) => { z(t.disabled) || !y(b) || C.value && (C.value = void 0, v == null || v(c.value, b), w(b)); }; if (ut) { const b = { capture: (n = t.capture) != null ? n : !0 }; Be(x, "pointerdown", O, b), Be(r, "pointermove", A, b), Be(r, "pointerup", T, b); } return Te(me({}, Eo(c)), { position: c, isDragging: Z(() => !!C.value), style: Z( () => `left:${c.value.x}px;top:${c.value.y}px;` ) }); } const ko = { class: "modalHeader" }, Wo = { key: 0, class: "tabs-wrap" }, _o = { key: 1, class: "step-wrap", ref: "stepRef" }, Vo = { class: "modal-body-container" }, jo = /* @__PURE__ */ Object.assign({ name: "SModal" }, { __name: "SModal", props: { loading: { type: Boolean, default: !1 }, centered: { type: Boolean, default: !0 }, maskClosable: { type: Boolean, default: !0 }, mask: { type: Boolean, default: !0 }, topStyle: { type: String, default: "" }, closable: { type: Boolean, default: !0 }, destroyOnClose: { type: Boolean, default: !1 }, keyboardOpen: { type: Boolean, default: !0 }, title: { type: String, default: "" }, value: { type: Boolean, default: !1 }, width: { type: [String, Number], default: "60vw" }, boxHeight: { type: [String, Number], default: 60 }, bodyStyle: { type: Object, default() { return { overflowX: "hidden", overflowY: "auto" }; } }, showFullScreen: { type: Boolean, default: !0 }, tabs: { type: Array, default: () => [] }, tabKey: { type: Object, default: () => ({ label: "label", value: "value" }) }, steps: { type: Array, default: () => [] }, stepDefaultActive: { type: Number, default: 0 }, stepValid: { type: Function, default: void 0 }, saveBtnText: { type: String, default: window.$l("保存") } }, emits: [ "update:value", "handCancel", "afterClose", "tabsChange", "stepCallback", "handSave" ], setup(e, { emit: t }) { const o = e, n = t, l = Tt(), i = B(null), p = B(), { x: m, y: S, isDragging: v } = Lo(i), d = B(0), u = B(0), s = B(!1), r = B(0), g = B(0), x = B(0), $ = B(0), c = B({ left: 0, right: 0, top: 0, bottom: 0 }), C = B(null), y = B(null), w = B(o.width), O = B(), A = B(o.value), T = B(0), b = Z(() => T.value === o.steps.length - 1), H = Z(() => ({ transform: `translate(${r.value}px, ${g.value}px)` })), M = B(me({}, o.bodyStyle)); let I = -1, F = null, N = null; const G = (h) => { p.value = h, i.value = O.value ? null : h; }, U = () => { const h = C.value; if (!h) return; const Y = i.value, V = y.value, X = h.scrollHeight || h.clientHeight; if (!X) return; const re = (Y == null ? void 0 : Y.clientHeight) || 0, be = (V == null ? void 0 : V.clientHeight) || 0, he = document.body.offsetHeight, te = X + re + be + 85 >= he ? he - re - be - 82 : X; te <= 0 || te === I || (I = te, M.value = Object.assign({ height: `${te}px` }, o.bodyStyle)); }, W = () => { Qe(() => { F || (F = requestAnimationFrame(() => { F = null, U(); })); }); }, K = () => { w.value = "100vw", O.value = "s-full-modal", i.value = null, r.value = 0, g.value = 0; }, _ = () => { w.value = o.width, O.value = "", i.value = p.value; }, J = () => { n("update:value", !1), n("handCancel"); }, ue = () => { O.value = "", i.value = p.value, w.value = o.width, n("afterClose"); }, ee = (h) => { n("tabsChange", h); }; function we() { T.value--, n("stepCallback", "prev", T.value); } function Ce() { if (!window.$utils.isFunction(o.stepValid)) { T.value++, n("stepCallback", "next", T.value); return; } o.stepValid(T.value).then((h) => { h && (T.value++, n("stepCallback", "next", T.value)); }); } function fe() { n("handSave", "save"); } return qe(() => { s.value && (r.value = x.value + Math.min(Math.max(c.value.left, m.value), c.value.right) - d.value, g.value = $.value + Math.min(Math.max(c.value.top, S.value), c.value.bottom) - u.value); }), j([m, S], () => { var h, Y; if (!s.value) { d.value = m.value, u.value = S.value; const V = document.body.getBoundingClientRect(), X = (Y = (h = i.value) == null ? void 0 : h.getBoundingClientRect()) != null ? Y : { width: 0, height: 0 }; c.value.right = V.width - X.width, c.value.bottom = V.height - X.height, x.value = r.value, $.value = g.value; } s.value = !0; }), j(v, () => { v.value || (s.value = !1); }), j(C, (h) => { N && (N.disconnect(), N = null), h && typeof ResizeObserver != "undefined" && (N = new ResizeObserver(() => W()), N.observe(h)), W(); }), j( () => o.value, (h) => { h ? (A.value = !0, W()) : A.value = !1; }, { deep: !0 } ), j( () => A.value, (h) => { h && W(); } ), j( () => o.value, () => { o.value && W(); }, { immediate: !0 } ), Ze(() => { N && (N.disconnect(), N = null), F && (cancelAnimationFrame(F), F = null); }), (h, Y) => { const V = ao, X = lo, re = ro, be = io, he = no, te = xe("close-outlined"), se = Fe, Ie = xe("save-outlined"), mt = xe("arrow-left-outlined"), vt = xe("arrow-right-outlined"), pt = k; return E(), ne(pt, Bt({ open: A.value, "body-style": M.value, width: w.value, centered: e.centered, onCancel: J, afterClose: ue, destroyOnClose: e.destroyOnClose, keyboard: e.keyboardOpen, style: e.topStyle, maskClosable: e.maskClosable, mask: e.mask, "wrap-class-name": "s-modal " + O.value }, Me(l)), { title: L(() => [ ve("div", ko, [ ve("div", { ref: G, class: "draggableTitle" }, ae(e.title), 513), a(Ot, { width: w.value, showFullScreen: e.showFullScreen, onFullScreen: K, onReduction: _ }, null, 8, ["width", "showFullScreen"]) ]) ]), footer: L(() => [ h.$slots.footer ? (E(), le("div", { key: 0, ref_key: "footerSlot", ref: y }, [ De(h.$slots, "footer", {}, void 0, !0) ], 512)) : Q("", !0), !h.$slots.footer && (!e.steps || !e.steps.length) ? (E(), le("div", { key: 1, ref_key: "footerSlot", ref: y }, [ a(se, { onClick: J }, { default: L(() => [ a(te), ce(ae(h.$l("关闭")), 1) ]), _: 1 }), a(se, { style: { "margin-right": "8px" }, type: "primary", onClick: fe }, { default: L(() => [ a(Ie), ce(" " + ae(h.$l(e.saveBtnText)), 1) ]), _: 1 }) ], 512)) : Q("", !0), e.steps && e.steps.length > 0 ? (E(), le("div", { key: 2, ref_key: "footerSlot", ref: y }, [ a(se, { onClick: J }, { default: L(() => [ a(te), ce(ae(h.$l("关闭")), 1) ]), _: 1 }), e.steps.length ? (E(), ne(se, { key: 0, disabled: T.value === e.stepDefaultActive, onClick: we }, { default: L(() => [ a(mt), ce(ae(h.$l("上一步")), 1) ]), _: 1 }, 8, ["disabled"])) : Q("", !0), e.steps.length ? (E(), ne(se, { key: 1, type: "primary", disabled: T.value === e.steps.length - 1, onClick: Ce }, { default: L(() => [ a(vt), ce(ae(h.$l("下一步")), 1) ]), _: 1 }, 8, ["disabled"])) : Q("", !0), b.value ? (E(), ne(se, { key: 2, style: { "margin-right": "8px" }, type: "primary", onClick: fe }, { default: L(() => [ a(Ie), ce(" " + ae(h.$l(e.saveBtnText)), 1) ]), _: 1 })) : Q("", !0) ], 512)) : Q("", !0) ]), modalRender: L(({ originVNode: oe }) => [ ve("div", { style: Pt(H.value) }, [ (E(), ne(Ft(oe))) ], 4) ]), default: L(() => [ a(he, { spinning: e.loading }, { default: L(() => [ ve("div", { ref_key: "bodySlot", ref: C }, [ e.tabs && e.tabs.length > 0 ? (E(), le("div", Wo, [ a(X, { "default-active-key": e.tabs[0][e.tabKey.label], onChange: ee }, { default: L(() => [ (E(!0), le(Pe, null, Ee(e.tabs, (oe) => (E(), ne(V, { tab: oe[e.tabKey.label], key: oe[e.tabKey.value] }, null, 8, ["tab"]))), 128)) ]), _: 1 }, 8, ["default-active-key"]) ])) : Q("", !0), e.steps && e.steps.length ? (E(), le("div", _o, [ a(be, { current: T.value, type: "navigation", size: "small" }, { default: L(() => [ (E(!0), le(Pe, null, Ee(e.steps, (oe) => (E(), ne(re, { title: oe, key: oe, disabled: !0 }, null, 8, ["title"]))), 128)) ]), _: 1 }, 8, ["current"]) ], 512)) : Q("", !0), ve("div", Vo, [ De(h.$slots, "default", {}, void 0, !0) ]) ], 512) ]), _: 3 }, 8, ["spinning"]) ]), _: 3 }, 16, ["open", "body-style", "width", "centered", "destroyOnClose", "keyboard", "style", "maskClosable", "mask", "wrap-class-name"]); }; } }), qo = /* @__PURE__ */ oo(jo, [["__scopeId", "data-v-c3b5b9cf"]]); export { qo as default };