import E from "../../../@babel/runtime/helpers/esm/toConsumableArray.mjs";
import e from "react";
import T from "../../../@ant-design/icons/es/icons/CloseOutlined.mjs";
import { DisabledContextProvider as b } from "../config-provider/DisabledContext.mjs";
import c from "./components/NormalCancelBtn.mjs";
import m from "./components/NormalOkBtn.mjs";
import { ModalContextProvider as y } from "./context.mjs";
import { getConfirmLocale as B } from "./locale.mjs";
import L from "../locale/useLocale.mjs";
function j(l, r) {
  return /* @__PURE__ */ e.createElement("span", {
    className: `${l}-close-x`
  }, r || /* @__PURE__ */ e.createElement(T, {
    className: `${l}-close-icon`
  }));
}
const A = (l) => {
  const {
    okText: r,
    okType: i = "primary",
    cancelText: s,
    confirmLoading: f,
    onOk: u,
    onCancel: d,
    okButtonProps: p,
    cancelButtonProps: x,
    footer: n
  } = l, [t] = L("Modal", B()), C = r || (t == null ? void 0 : t.okText), k = s || (t == null ? void 0 : t.cancelText), a = {
    confirmLoading: f,
    okButtonProps: p,
    cancelButtonProps: x,
    okTextLocale: C,
    cancelTextLocale: k,
    okType: i,
    onOk: u,
    onCancel: d
  }, v = e.useMemo(() => a, E(Object.values(a)));
  let o;
  return typeof n == "function" || typeof n > "u" ? (o = /* @__PURE__ */ e.createElement(e.Fragment, null, /* @__PURE__ */ e.createElement(c, null), /* @__PURE__ */ e.createElement(m, null)), typeof n == "function" && (o = n(o, {
    OkBtn: m,
    CancelBtn: c
  })), o = /* @__PURE__ */ e.createElement(y, {
    value: v
  }, o)) : o = n, /* @__PURE__ */ e.createElement(b, {
    disabled: !1
  }, o);
};
export {
  A as Footer,
  j as renderCloseIcon
};
