import { defineComponent as b, createElementBlock as x, openBlock as C, createElementVNode as I, createVNode as a, unref as e, withCtx as m, createTextVNode as i, toDisplayString as u } from "vue";
import { d as M, e as B, f as U, g as p, h as t, i as n, _ as k } from "./index-D1PfnS4S.js";
import "pinia";
const H = { class: "delete-document-modal" }, N = ["innerHTML"], q = /* @__PURE__ */ b({
  __name: "DeleteDocumentModal",
  props: {
    api: {},
    id: {}
  },
  emits: ["remove:document", "close"],
  setup(s, { emit: D }) {
    const c = s, d = D, { closeModal: f } = M(), { t: l } = B(), { requestHandler: v, isLoading: _ } = U({
      request: async (r) => await c.api.deleteDocument(r),
      then: async () => {
        d("remove:document", c.id), d("close");
      }
    });
    return (r, o) => (C(), x("div", H, [
      I("div", {
        innerHTML: e(l)("moduleDocuments.modal.removeDocument.text")
      }, null, 8, N),
      a(p, {
        color: e(t)[e(n).Red075],
        "bg-color": e(t)[e(n).Red1],
        "is-loading": e(_),
        onClick: o[0] || (o[0] = (g) => e(v)(s.id))
      }, {
        default: m(() => [
          i(u(e(l)("moduleDocuments.modal.removeDocument.btn.remove")), 1)
        ]),
        _: 1
      }, 8, ["color", "bg-color", "is-loading"]),
      a(p, {
        color: e(t)[e(n).Blue500],
        "bg-color": e(t)[e(n).Blue1],
        onClick: o[1] || (o[1] = (g) => e(f)())
      }, {
        default: m(() => [
          i(u(e(l)("moduleDocuments.modal.removeDocument.btn.cancel")), 1)
        ]),
        _: 1
      }, 8, ["color", "bg-color"])
    ]));
  }
}), T = /* @__PURE__ */ k(q, [["__scopeId", "data-v-c014d5f2"]]);
export {
  T as default
};
