import { defineComponent as M, mergeModels as h, useModel as S, computed as U, onBeforeMount as _, createElementBlock as T, openBlock as n, createBlock as y, createCommentVNode as B, createVNode as m, Fragment as I, unref as t } from "vue";
import { useI18n as D } from "vue-i18n";
import { storeToRefs as N } from "pinia";
import { h as i, b as R, l as x } from "./start-BYfL32Oe.mjs";
import "vue-router";
import "./header-Droxy2Kd.mjs";
import "./moment-h96o7c8I.mjs";
import { u as C } from "./dataTypes-nQ5Ht0CH.mjs";
import { a as s } from "./constants-CwfsvyFM.mjs";
import { b as k } from "./number-to-tree.json_vue_type_i18n_index_0_src_true_lang-D7dGzgkq.mjs";
const $ = { class: "extension-config d-flex flex-wrap" }, A = /* @__PURE__ */ M({
  __name: "TreeExtension",
  props: /* @__PURE__ */ h({
    attributeMap: {},
    destinationAttribute: {},
    sourceAttributes: {},
    etlAttributeSetMapId: {}
  }, {
    modelValue: {},
    modelModifiers: {}
  }),
  emits: ["update:modelValue"],
  setup(E) {
    const l = S(E, "modelValue"), { t: a } = D(), p = C(), { languages: F, isLanguagesLoading: L } = N(p);
    function b(r, e, u) {
      return r === s && e === s ? u === "tree-to-tree" : r === s ? u === "tree-to-string" : e === s ? u === "string-to-tree" : !1;
    }
    const d = U(() => [
      {
        value: "key",
        title: a("datahub-plugin.etl.number-to-tree.Key"),
        mode: 1
      },
      {
        value: "title",
        title: a("datahub-plugin.etl.number-to-tree.Title"),
        mode: 0
      }
    ]);
    return _(p.fetchLanguages), (r, e) => {
      var u, f, g, v, c, V;
      return n(), T("div", $, [
        b(
          (f = (u = r.sourceAttributes) == null ? void 0 : u[0]) == null ? void 0 : f.dataType,
          (g = r.destinationAttribute) == null ? void 0 : g.dataType,
          "tree-to-tree"
        ) ? (n(), T(I, { key: 0 }, [
          m(t(i), {
            modelValue: l.value.sourceField,
            "onUpdate:modelValue": e[0] || (e[0] = (o) => l.value.sourceField = o),
            items: d.value,
            label: t(a)("datahub-plugin.etl.number-to-tree.SourceTreeLanguage"),
            "persistent-placeholder": ""
          }, null, 8, ["modelValue", "items", "label"]),
          m(t(i), {
            modelValue: l.value.destinationField,
            "onUpdate:modelValue": e[1] || (e[1] = (o) => l.value.destinationField = o),
            items: d.value,
            label: t(a)("datahub-plugin.etl.number-to-tree.DestinationField"),
            "persistent-placeholder": ""
          }, null, 8, ["modelValue", "items", "label"])
        ], 64)) : (n(), y(t(R), {
          key: 1,
          modelValue: l.value.separator,
          "onUpdate:modelValue": e[2] || (e[2] = (o) => l.value.separator = o),
          label: t(a)("datahub-plugin.etl.number-to-tree.Separator"),
          "persistent-placeholder": ""
        }, null, 8, ["modelValue", "label"])),
        b(
          (c = (v = r.sourceAttributes) == null ? void 0 : v[0]) == null ? void 0 : c.dataType,
          (V = r.destinationAttribute) == null ? void 0 : V.dataType,
          "string-to-tree"
        ) ? (n(), y(t(i), {
          key: 2,
          modelValue: l.value.mode,
          "onUpdate:modelValue": e[3] || (e[3] = (o) => l.value.mode = o),
          items: d.value,
          "item-value": "mode",
          label: t(a)("datahub-plugin.etl.number-to-tree.DestinationField"),
          "persistent-placeholder": ""
        }, null, 8, ["modelValue", "items", "label"])) : B("", !0),
        m(t(i), {
          modelValue: l.value.relevantLocale,
          "onUpdate:modelValue": e[4] || (e[4] = (o) => l.value.relevantLocale = o),
          items: t(F),
          loading: t(L),
          label: t(a)("datahub-plugin.etl.number-to-tree.RelevantLocale"),
          "item-title": "description",
          "item-value": "key",
          "persistent-placeholder": ""
        }, null, 8, ["modelValue", "items", "loading", "label"])
      ]);
    };
  }
});
typeof k == "function" && k(A);
const J = /* @__PURE__ */ x(A, [["__scopeId", "data-v-8ac2da03"]]);
export {
  J as default
};
