import { defineComponent as g, mergeModels as b, useModel as V, computed as U, createElementBlock as v, openBlock as a, createVNode as _, createBlock as x, createCommentVNode as I, unref as i } from "vue";
import { useI18n as M } from "vue-i18n";
import { h as d, l as h } from "./start-BYfL32Oe.mjs";
import "pinia";
import "vue-router";
import "./header-Droxy2Kd.mjs";
import "./moment-h96o7c8I.mjs";
import { u as k } from "./units-DogXJCIC.mjs";
import { b as s } from "./unit-to-string.json_vue_type_i18n_index_0_src_true_lang-G_KV_4wK.mjs";
const A = { class: "extension-config d-flex flex-wrap" }, r = /* @__PURE__ */ g({
  __name: "UnitValueToUnitValueExtension",
  props: /* @__PURE__ */ b({
    attributeMap: {},
    destinationAttribute: {},
    sourceAttributes: {},
    etlAttributeSetMapId: {}
  }, {
    modelValue: {},
    modelModifiers: {}
  }),
  emits: ["update:modelValue"],
  setup(u) {
    const m = u, t = V(u, "modelValue"), { t: n } = M(), { units: p, isUnitsLoading: c } = k(
      () => {
        var o, e;
        return (e = (o = m.destinationAttribute) == null ? void 0 : o.configuration) == null ? void 0 : e.dimensionId;
      }
    ), f = U(() => [
      {
        value: "keep_unit",
        title: n("datahub-plugin.etl.unit-to-string.KeepUnit")
      },
      {
        value: "configured_unit",
        title: n("datahub-plugin.etl.unit-to-string.ConfiguredUnit")
      },
      {
        value: "destination_unit",
        title: n("datahub-plugin.etl.unit-to-string.DestinationUnit2")
      }
    ]);
    return (o, e) => (a(), v("div", A, [
      _(i(d), {
        modelValue: t.value.mode,
        "onUpdate:modelValue": e[0] || (e[0] = (l) => t.value.mode = l),
        items: f.value,
        label: i(n)("datahub-plugin.etl.unit-to-string.unitMappingMode"),
        "persistent-placeholder": ""
      }, null, 8, ["modelValue", "items", "label"]),
      t.value.mode && t.value.mode === "configured_unit" ? (a(), x(i(d), {
        key: 0,
        modelValue: t.value.configuredUnitId,
        "onUpdate:modelValue": e[1] || (e[1] = (l) => t.value.configuredUnitId = l),
        items: i(p),
        loading: i(c),
        label: i(n)("datahub-plugin.etl.unit-to-string.Unit"),
        "item-title": "name",
        "item-value": "id",
        "persistent-placeholder": ""
      }, null, 8, ["modelValue", "items", "loading", "label"])) : I("", !0)
    ]));
  }
});
typeof s == "function" && s(r);
const L = /* @__PURE__ */ h(r, [["__scopeId", "data-v-16aebb74"]]);
export {
  L as default
};
