import m from "../ci-svg-icon/index.vue.js";
import { defineComponent as f, createElementBlock as i, openBlock as a, createElementVNode as s, createVNode as p, createCommentVNode as B, toDisplayString as g, normalizeClass as h, renderSlot as l } from "vue";
import { ElMessageBox as u } from "element-plus";
const k = { class: "CiPageHeader" }, _ = { class: "content-btn-title-leftSlot" }, w = {
  key: 0,
  class: "title"
}, S = { class: "content-right-slot" }, x = {
  name: "CiPageHeader"
}, y = /* @__PURE__ */ f({
  ...x,
  props: {
    title: { default: "返回" },
    isShowTitle: { type: Boolean, default: !0 },
    messageBoxMessage: { default: "确定放弃当前页面编辑？" },
    messageBoxTitle: { default: "确定操作" },
    isShowMessageBox: { type: Boolean, default: !1 }
  },
  emits: ["clickBack"],
  setup(n, { emit: c }) {
    const o = c, t = n, r = async () => {
      if (!t.isShowMessageBox) {
        o("clickBack", "没有开启二次确认框");
        return;
      }
      t.isShowMessageBox && (await u.confirm(t.messageBoxMessage, t.messageBoxTitle, {
        confirmButtonText: "确定",
        cancelButtonText: "取消",
        // 是否可以点击遮罩层关闭
        closeOnClickModal: !1,
        type: "warning"
      }), o("clickBack", "开启二次确认框"));
    };
    return (e, C) => {
      const d = m;
      return a(), i("div", k, [
        s("div", _, [
          p(d, {
            name: "btnBack",
            width: "32px",
            height: "32px",
            class: "btn-back",
            onClick: r
          }),
          e.isShowTitle ? (a(), i("span", w, g(e.title), 1)) : B("", !0),
          s("div", {
            class: h(["content-left-slot", { "is-show-title": !e.isShowTitle }])
          }, [
            l(e.$slots, "left", {}, void 0, !0)
          ], 2)
        ]),
        s("div", S, [
          l(e.$slots, "right", {}, void 0, !0)
        ])
      ]);
    };
  }
});
export {
  y as default
};
