import { defineComponent as g, ref as b, resolveComponent as r, openBlock as C, createElementBlock as y, createVNode as n, withCtx as i, createElementVNode as s, toDisplayString as d, renderSlot as B, createTextVNode as V } from "vue";
const _ = { class: "flex w-full" }, F = /* @__PURE__ */ g({
  __name: "FmConfirmationButton",
  props: {
    label: {},
    loading: { type: Boolean },
    disabled: { type: Boolean },
    confirmTitle: {},
    confirmMessage: {}
  },
  emits: ["confirm"],
  setup(m, { emit: u }) {
    const o = m, f = u, l = b(!1);
    function c() {
      l.value = !1, f("confirm");
    }
    return (p, e) => {
      const t = r("FmButton"), v = r("FmDialog");
      return C(), y("div", null, [
        n(t, {
          label: o.label,
          loading: o.loading,
          disabled: o.disabled,
          onClick: e[0] || (e[0] = (a) => l.value = !0)
        }, null, 8, ["label", "loading", "disabled"]),
        n(v, {
          modelValue: l.value,
          "onUpdate:modelValue": e[2] || (e[2] = (a) => l.value = a),
          overlay: !0
        }, {
          "dialog-header": i(() => [
            s("div", null, d(o.confirmTitle || "Confirm"), 1)
          ]),
          "dialog-footer": i(() => [
            s("div", _, [
              n(t, {
                label: "Cancel",
                variant: "tertiary",
                onClick: e[1] || (e[1] = (a) => l.value = !1)
              }),
              n(t, {
                class: "ml-auto",
                label: "Confirm",
                variant: "primary",
                onClick: c
              })
            ])
          ]),
          default: i(() => [
            B(p.$slots, "dialog-content", {}, () => [
              V(d(o.confirmMessage || "Are you sure you want to proceed?"), 1)
            ])
          ]),
          _: 3
        }, 8, ["modelValue"])
      ]);
    };
  }
});
export {
  F as _
};
