import { defineComponent as A, mergeModels as g, useModel as S, computed as m, onBeforeMount as x, createElementBlock as U, openBlock as u, createBlock as s, createCommentVNode as c, createVNode as p, unref as o, mergeProps as h, withCtx as M } from "vue";
import { useI18n as T } from "vue-i18n";
import { b as r, i as k } from "./start-BYfL32Oe.mjs";
import "pinia";
import "vue-router";
import "./header-Droxy2Kd.mjs";
import "./moment-h96o7c8I.mjs";
import { D as y } from "./constants--S2sBPny.mjs";
const f = "Actindo\\Modules\\Actindo\\DataHub\\DataTypes\\StringValue", B = /* @__PURE__ */ A({
  __name: "XToDateExtension",
  props: /* @__PURE__ */ g({
    attributeMap: {},
    destinationAttribute: {},
    sourceAttributes: {},
    etlAttributeSetMapId: {}
  }, {
    modelValue: {
      default: () => ({ modifiers: [] })
    },
    modelModifiers: {}
  }),
  emits: ["update:modelValue"],
  setup(l) {
    const a = l, e = S(l, "modelValue"), { t: d } = T(), v = m(
      () => {
        var t;
        return ((t = a.sourceAttributes) == null ? void 0 : t[0].dataType) === f;
      }
    ), V = m(
      () => {
        var t;
        return ((t = a.destinationAttribute) == null ? void 0 : t.dataType) === f;
      }
    );
    function F() {
      e.value.modifiers.push("");
    }
    function _({ rowIndex: t }) {
      e.value.modifiers.length > 1 ? e.value.modifiers.splice(t, 1) : e.value.modifiers = [];
    }
    return x(() => {
      e.value.modifiers || (e.value.modifiers = []);
    }), (t, n) => (u(), U("div", null, [
      v.value ? (u(), s(o(r), {
        key: 0,
        modelValue: e.value.sourceFormat,
        "onUpdate:modelValue": n[0] || (n[0] = (i) => e.value.sourceFormat = i),
        label: o(d)("datahub-plugin.etl.x-to-date.SourceFormat")
      }, null, 8, ["modelValue", "label"])) : c("", !0),
      V.value ? (u(), s(o(r), {
        key: 1,
        modelValue: e.value.destinationFormat,
        "onUpdate:modelValue": n[1] || (n[1] = (i) => e.value.destinationFormat = i),
        label: o(d)("datahub-plugin.etl.x-to-date.DestinationFormat")
      }, null, 8, ["modelValue", "label"])) : c("", !0),
      p(o(k), h({
        data: e.value.modifiers,
        "create-actions": [{ icon: "add_circle" }]
      }, o(y), {
        onCreate: F,
        onRemove: _
      }), {
        "cell-text": M(({ rowIndex: i }) => [
          p(o(r), {
            modelValue: e.value.modifiers[i],
            "onUpdate:modelValue": (D) => e.value.modifiers[i] = D
          }, null, 8, ["modelValue", "onUpdate:modelValue"])
        ]),
        _: 1
      }, 16, ["data"])
    ]));
  }
});
function b(l) {
  const a = l;
  a.__i18n = a.__i18n || [], a.__i18n.push({
    locale: "",
    resource: {
      "en-US": {
        "datahub-plugin": {
          etl: {
            "x-to-date": {
              SourceFormat: { t: 0, b: { t: 2, i: [{ t: 3 }], s: "Source Format" } },
              DestinationFormat: { t: 0, b: { t: 2, i: [{ t: 3 }], s: "Destination Format" } }
            }
          }
        }
      },
      "de-DE": {
        "datahub-plugin": {
          etl: {
            "x-to-date": {
              SourceFormat: { t: 0, b: { t: 2, i: [{ t: 3 }], s: "Ursprungs-Format" } },
              DestinationFormat: { t: 0, b: { t: 2, i: [{ t: 3 }], s: "Ziel-Format" } }
            }
          }
        }
      }
    }
  });
}
typeof b == "function" && b(B);
export {
  B as default
};
