import { defineComponent as l, ref as s, watch as m, createVNode as t, resolveComponent as r } from "vue";
import { ElNotification as c } from "element-plus";
import { k as u, F as d, m as p, G as f, n as E, T as i } from "./main-Blxobku2.js";
import { appSchema as n } from "@klweb/compose-app-engine";
const C = {
  "schema-code-container": "_schema-code-container_1nn60_1"
}, O = /* @__PURE__ */ l({
  name: "KlEditorSchemaPanel",
  components: {
    CompLoading: u,
    EditorMonacoEditor: d
  },
  inheritAttrs: !1,
  setup() {
    const o = s(JSON.stringify(n.value)), a = s(!0);
    return m(n, (e) => {
      o.value = JSON.stringify(e);
    }, {
      deep: !0
    }), () => t("section", {
      class: C["schema-code-container"]
    }, [a.value ? t(r("comp-loading"), null, null) : "", t(r("editor-monaco-editor"), {
      modelValue: o.value,
      "onUpdate:modelValue": (e) => o.value = e,
      onChange: (e) => {
        if (a.value = !1, p(e)) {
          if (f(e, o.value)) return;
          n.value = E(e);
        } else
          c({
            type: "error",
            title: i.CODE_ERROR_NOTICE_TITLE,
            message: i.CODE_ERROR_NOTICE_MESSAGE,
            position: "bottom-left"
          });
      }
    }, null)]);
  }
});
export {
  O as default
};
