import { defineComponent as u, toRefs as m, ref as d, createVNode as o, resolveComponent as n } from "vue";
import { ElButton as p } from "element-plus";
import { j as f, A as r, B as g } from "./main-DXvReGBc.js";
import { E as C } from "./index-BjLglEQs.js";
const v = {
  "code-container": "_code-container_dlaox_1"
}, y = /* @__PURE__ */ u({
  name: "KlCommonCodeEditorPlus",
  components: {
    CompLoading: f,
    EditorMonacoEditor: C,
    ElButton: p
  },
  emits: ["close"],
  props: {
    modelValue: {
      type: String,
      default: ""
    },
    language: {
      type: String,
      default: "json"
    }
  },
  setup(a, {
    emit: t
  }) {
    const {
      modelValue: l
    } = m(a), s = d(!0), c = d(), i = () => {
      const e = c.value.getValue();
      g(e, l.value) ? t("close", "") : t("close", e);
    };
    return () => o("div", {
      class: "dialog-component"
    }, [o("section", {
      class: "dialog-component__body"
    }, [o("section", {
      class: v["code-container"]
    }, [s.value && o(n("comp-loading"), null, null), o(n("editor-monaco-editor"), {
      ref: c,
      modelValue: l.value,
      "onUpdate:modelValue": (e) => l.value = e,
      language: a.language,
      onChange: () => {
        s.value = !1;
      }
    }, null)])]), o("section", {
      class: "dialog-component__footer"
    }, [o(n("el-button"), {
      onClick: () => t("close")
    }, {
      default: () => [r.CANCEL]
    }), o(n("el-button"), {
      type: "primary",
      onClick: i
    }, {
      default: () => [r.COMFIRM]
    })])]);
  }
});
export {
  y as default
};
