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