import { defineComponent as x, mergeModels as U, useModel as S, computed as r, createElementBlock as M, openBlock as m, createVNode as o, createBlock as h, createCommentVNode as I, unref as a } from "vue";
import { useI18n as _ } from "vue-i18n";
import { h as n, b as d, l as k } from "./start-BYfL32Oe.mjs";
import "pinia";
import "vue-router";
import "./header-Droxy2Kd.mjs";
import "./moment-h96o7c8I.mjs";
import { u as y } from "./units-DogXJCIC.mjs";
import { b as p } 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" }, f = /* @__PURE__ */ x({
  __name: "UnitValueToStringExtension",
  props: /* @__PURE__ */ U({
    attributeMap: {},
    destinationAttribute: {},
    sourceAttributes: {},
    etlAttributeSetMapId: {}
  }, {
    modelValue: {},
    modelModifiers: {}
  }),
  emits: ["update:modelValue"],
  setup(s) {
    const g = s, t = S(s, "modelValue"), { t: i } = _(), { units: b, isUnitsLoading: c } = y(
      () => {
        var u, e, l;
        return (l = (e = (u = g.sourceAttributes) == null ? void 0 : u[0]) == null ? void 0 : e.configuration) == null ? void 0 : l.dimensionId;
      }
    ), V = r(() => [
      {
        value: "keep_unit",
        title: i("datahub-plugin.etl.unit-to-string.KeepUnit")
      },
      {
        value: "configured_unit",
        title: i("datahub-plugin.etl.unit-to-string.ConfiguredUnit")
      }
    ]), v = r(() => [
      {
        value: "suffix_symbol",
        title: i("datahub-plugin.etl.unit-to-string.SuffixSymbol")
      },
      {
        value: "suffix_name",
        title: i("datahub-plugin.etl.unit-to-string.SuffixName")
      },
      {
        value: "suffix_empty",
        title: i("datahub-plugin.etl.unit-to-string.SuffixEmpty")
      }
    ]);
    return (u, e) => (m(), M("div", A, [
      o(a(n), {
        modelValue: t.value.mode,
        "onUpdate:modelValue": e[0] || (e[0] = (l) => t.value.mode = l),
        items: V.value,
        label: a(i)("datahub-plugin.etl.unit-to-string.Mode"),
        "persistent-placeholder": ""
      }, null, 8, ["modelValue", "items", "label"]),
      t.value.mode && t.value.mode === "configured_unit" ? (m(), h(a(n), {
        key: 0,
        modelValue: t.value.configuredUnitId,
        "onUpdate:modelValue": e[1] || (e[1] = (l) => t.value.configuredUnitId = l),
        items: a(b),
        loading: a(c),
        label: a(i)("datahub-plugin.etl.unit-to-string.Unit"),
        "item-title": "name",
        "item-value": "id",
        "persistent-placeholder": ""
      }, null, 8, ["modelValue", "items", "loading", "label"])) : I("", !0),
      o(a(n), {
        modelValue: t.value.suffixMode,
        "onUpdate:modelValue": e[2] || (e[2] = (l) => t.value.suffixMode = l),
        items: v.value,
        label: a(i)("datahub-plugin.etl.unit-to-string.SuffixMode"),
        "persistent-placeholder": ""
      }, null, 8, ["modelValue", "items", "label"]),
      o(a(d), {
        modelValue: t.value.separator,
        "onUpdate:modelValue": e[3] || (e[3] = (l) => t.value.separator = l),
        label: a(i)("datahub-plugin.etl.unit-to-string.Separator"),
        "persistent-placeholder": ""
      }, null, 8, ["modelValue", "label"]),
      o(a(d), {
        modelValue: t.value.decimalSeparator,
        "onUpdate:modelValue": e[4] || (e[4] = (l) => t.value.decimalSeparator = l),
        label: a(i)("datahub-plugin.etl.unit-to-string.DecimalSeparator"),
        "persistent-placeholder": ""
      }, null, 8, ["modelValue", "label"]),
      o(a(d), {
        modelValue: t.value.decimalPlaces,
        "onUpdate:modelValue": e[5] || (e[5] = (l) => t.value.decimalPlaces = l),
        label: a(i)("datahub-plugin.etl.unit-to-string.DecimalPlaces"),
        "persistent-placeholder": ""
      }, null, 8, ["modelValue", "label"])
    ]));
  }
});
typeof p == "function" && p(f);
const K = /* @__PURE__ */ k(f, [["__scopeId", "data-v-07af2d31"]]);
export {
  K as default
};
