import { defineComponent as u, ref as d, createVNode as o, resolveComponent as n } from "vue";
import { ElButton as m } from "element-plus";
import { k as p, A as r, G as f } from "./main-Blxobku2.js";
import { E as g } from "./index-BpkhRblb.js";
const C = {
  "code-container": "_code-container_dlaox_1"
}, x = /* @__PURE__ */ u({
  name: "KlCommonCodeEditorPlus",
  components: {
    CompLoading: p,
    EditorMonacoEditor: g,
    ElButton: m
  },
  emits: ["close"],
  props: {
    modelValue: {
      type: String,
      default: ""
    },
    language: {
      type: String,
      default: "json"
    }
  },
  setup(a, {
    emit: t
  }) {
    const {
      modelValue: l
    } = a, s = d(!0), c = d(), i = () => {
      const e = c.value.getValue();
      f(e, l) ? t("close", "") : t("close", e);
    };
    return () => o("div", {
      class: "dialog-component"
    }, [o("section", {
      class: "dialog-component__body"
    }, [o("section", {
      class: C["code-container"]
    }, [s.value && o(n("comp-loading"), null, null), o(n("editor-monaco-editor"), {
      ref: c,
      modelValue: l,
      "onUpdate:modelValue": (e) => l = 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 {
  x as default
};
