import { defineComponent as m, mergeModels as p, useModel as c, watch as y, createElementBlock as f, openBlock as d, createBlock as g, createCommentVNode as b, unref as r } from "vue";
import { j as v, n as _, l as h } from "./start-BYfL32Oe.mjs";
import "vue-i18n";
import "pinia";
import "vue-router";
import "./header-Droxy2Kd.mjs";
import "./moment-h96o7c8I.mjs";
const V = { class: "extension-config" }, B = /* @__PURE__ */ m({
  __name: "DatahubDataTypeCountryValueEditor",
  props: /* @__PURE__ */ p({
    modelValue: {},
    readOnly: { type: Boolean },
    attribute: {},
    massEditing: { type: Boolean },
    label: {},
    fieldName: {},
    dataTypeInstance: {},
    loading: { type: Boolean }
  }, {
    modelValue: { default: () => ({}) },
    modelModifiers: {}
  }),
  emits: ["update:modelValue"],
  setup(u) {
    const a = c(u, "modelValue");
    function s(e, { code3digit: o, name: t }) {
      a.value = { code3digit: o, name: t };
    }
    return y(a, (e) => {
      e || (a.value = {});
    }), (e, o) => {
      var t, l, n, i;
      return d(), f("div", V, [
        a.value ? (d(), g(r(v), {
          key: 0,
          data: r(_).getCountriesCached,
          text: a.value.name,
          readonly: ((l = (t = e.attribute) == null ? void 0 : t.configuration) == null ? void 0 : l.readOnly) || e.readOnly,
          label: e.massEditing ? void 0 : e.label,
          disabled: e.readOnly || ((i = (n = e.attribute) == null ? void 0 : n.configuration) == null ? void 0 : i.readOnly),
          loading: e.loading,
          "item-title": "name",
          "item-value": "code3digit",
          "page-size": "",
          select: "",
          search: "",
          block: "",
          onEvent: s
        }, null, 8, ["data", "text", "readonly", "label", "disabled", "loading"])) : b("", !0)
      ]);
    };
  }
}), I = /* @__PURE__ */ h(B, [["__scopeId", "data-v-948e0211"]]);
export {
  I as default
};
