import { toRef as s, inject as T, defineComponent as v, openBlock as h, createElementBlock as k, createVNode as f, unref as m, withCtx as p, createTextVNode as u, toDisplayString as y } from "vue";
import { ElButton as b } from "element-plus";
const B = Symbol("ModalStateToken"), D = Symbol("ModalIdToken"), C = () => T(B, {}), F = () => T(D, "");
function S() {
  const {
    store: d,
    action: n,
    modalPromise: l
  } = C(), o = F(), a = d[o], i = (t) => n == null ? void 0 : n.show(o, t), c = () => n == null ? void 0 : n.hide(o), e = () => n == null ? void 0 : n.remove(o), r = (t) => l[o].resolve(t), g = (t) => l[o].reject(t);
  return {
    show: i,
    hide: c,
    visible: s(a, "visible"),
    args: s(a, "args"),
    remove: e,
    resolve: r,
    reject: g
  };
}
const _ = { class: "dialog-footer" }, L = /* @__PURE__ */ v({
  name: "FsPopupFooter",
  __name: "FsPopupFooter",
  props: {
    confirmLoading: { type: Boolean },
    confirmText: { default: "确认" },
    cancelText: { default: "取消" },
    confirmType: { default: "primary" },
    cancelType: { default: "default" },
    confirmDisabled: { type: Boolean, default: !1 },
    cancelDisabled: { type: Boolean, default: !1 }
  },
  emits: ["confirm", "cancel"],
  setup(d, { emit: n }) {
    const l = S(), o = (e) => {
      l.hide(), l.resolve(e);
    }, a = n, i = () => {
      a("confirm", o);
    }, c = () => {
      a("cancel", o);
    };
    return (e, r) => (h(), k("div", _, [
      f(m(b), {
        type: e.cancelType,
        disabled: e.cancelDisabled,
        loading: e.confirmLoading,
        onClick: c
      }, {
        default: p(() => [
          u(y(e.cancelText), 1)
        ]),
        _: 1
      }, 8, ["type", "disabled", "loading"]),
      f(m(b), {
        type: e.confirmType,
        disabled: e.confirmDisabled,
        loading: e.confirmLoading,
        onClick: i
      }, {
        default: p(() => [
          u(y(e.confirmText), 1)
        ]),
        _: 1
      }, 8, ["type", "disabled", "loading"])
    ]));
  }
});
export {
  L as default
};
//# sourceMappingURL=FsPopupFooter.mjs.map
