import { toRef as f, inject as v, defineComponent as c, openBlock as B, createBlock as C, unref as p, mergeProps as b, withCtx as i, renderSlot as m } from "vue";
import { ElDialog as g } from "element-plus";
const F = Symbol("ModalStateToken"), O = Symbol("ModalIdToken"), k = () => v(F, {}), w = () => v(O, "");
function A() {
  const {
    store: u,
    action: t,
    modalPromise: s
  } = k(), e = w(), d = u[e], n = (r) => t == null ? void 0 : t.show(e, r), a = () => t == null ? void 0 : t.hide(e), o = () => t == null ? void 0 : t.remove(e), l = (r) => s[e].resolve(r), y = (r) => s[e].reject(r);
  return {
    show: n,
    hide: a,
    visible: f(d, "visible"),
    args: f(d, "args"),
    remove: o,
    resolve: l,
    reject: y
  };
}
const T = /* @__PURE__ */ c({
  name: "FsDialog",
  __name: "FsDialog",
  props: {
    removeOnClosed: { type: Boolean, default: !0 },
    appendToBody: { type: Boolean },
    appendTo: {},
    beforeClose: {},
    destroyOnClose: { type: Boolean },
    closeOnClickModal: { type: Boolean, default: !0 },
    closeOnPressEscape: { type: Boolean, default: !0 },
    lockScroll: { type: Boolean, default: !0 },
    modal: { type: Boolean, default: !0 },
    openDelay: { default: 0 },
    closeDelay: { default: 0 },
    top: {},
    modelValue: { type: Boolean },
    modalClass: {},
    width: {},
    zIndex: {},
    trapFocus: { type: Boolean },
    headerAriaLevel: {},
    center: { type: Boolean },
    alignCenter: { type: Boolean },
    closeIcon: {},
    draggable: { type: Boolean },
    overflow: { type: Boolean },
    fullscreen: { type: Boolean },
    showClose: { type: Boolean, default: !0 },
    title: {},
    ariaLevel: {}
  },
  emits: ["open", "opened", "close", "closed", "openAutoFocus", "closeAutoFocus"],
  setup(u, { emit: t }) {
    const s = u, e = t, d = () => {
      e("closed", n.visible.value), s.removeOnClosed && n.remove();
    }, n = A();
    return (a, o) => (B(), C(p(g), b(s, {
      modelValue: p(n).visible.value,
      "onUpdate:modelValue": o[0] || (o[0] = (l) => p(n).visible.value = l),
      onOpen: o[1] || (o[1] = (l) => e("open", l)),
      onOpened: o[2] || (o[2] = (l) => e("opened", l)),
      onCloseAutoFocus: o[3] || (o[3] = (l) => e("closeAutoFocus", l)),
      onClose: o[4] || (o[4] = (l) => e("close", l)),
      onClosed: d
    }), {
      header: i(() => [
        m(a.$slots, "header")
      ]),
      footer: i(() => [
        m(a.$slots, "footer")
      ]),
      default: i(() => [
        m(a.$slots, "default")
      ]),
      _: 3
    }, 16, ["modelValue"]));
  }
});
export {
  T as default
};
//# sourceMappingURL=FsDialog.mjs.map
