import { defineComponent as u, mergeModels as p, useModel as c, computed as M, createElementBlock as b, openBlock as f, createElementVNode as Y, createVNode as _, toDisplayString as D, unref as h } from "vue";
import { useI18n as g } from "vue-i18n";
import { b as y } from "./start-BYfL32Oe.mjs";
import "pinia";
import "vue-router";
import "./header-Droxy2Kd.mjs";
import { h as T } from "./moment-h96o7c8I.mjs";
import { D as v, T as V } from "./constants-1J8fqgyx.mjs";
const E = { class: "d-flex align-center flex-wrap" }, F = { class: "text-no-wrap mr-sm-2 mb-xs-0 mb-2" }, A = /* @__PURE__ */ u({
  __name: "DatahubDataTypeDateTimeValueEditor",
  props: /* @__PURE__ */ p({
    modelValue: {},
    readOnly: { type: Boolean },
    attribute: {},
    massEditing: { type: Boolean },
    label: {},
    fieldName: {},
    dataTypeInstance: {},
    loading: { type: Boolean }
  }, {
    modelValue: {},
    modelModifiers: {}
  }),
  emits: ["update:modelValue"],
  setup(i) {
    const e = i, m = c(i, "modelValue"), { t: n } = g(), s = M(() => {
      var a, o, d;
      if (!m.value)
        return "";
      const { dateFormat: t, timeFormat: l } = ((a = e.attribute) == null ? void 0 : a.configuration) ?? ((d = (o = e.attribute) == null ? void 0 : o.dataTypeInstance) == null ? void 0 : d.defaultConfiguration) ?? {
        dateFormat: "short",
        timeFormat: "medium"
      };
      return T(m.value).format(
        `${n(v[t])} ${n(V[l])}`
      );
    });
    return (t, l) => {
      var a, o;
      return f(), b("div", E, [
        Y("div", F, D(s.value), 1),
        _(h(y), {
          modelValue: m.value,
          "onUpdate:modelValue": l[0] || (l[0] = (d) => m.value = d),
          readonly: ((o = (a = t.attribute) == null ? void 0 : a.configuration) == null ? void 0 : o.readOnly) || t.readOnly,
          loading: t.loading,
          label: t.massEditing ? void 0 : t.label,
          type: "datetime-local",
          "persistent-placeholder": ""
        }, null, 8, ["modelValue", "readonly", "loading", "label"])
      ]);
    };
  }
});
function r(i) {
  const e = i;
  e.__i18n = e.__i18n || [], e.__i18n.push({
    locale: "",
    resource: {
      "en-US": {
        "datahub-plugin": {
          dateTime: {
            "date-time-value": {
              date_short: { t: 0, b: { t: 2, i: [{ t: 3 }], s: "MM/DD/YYYY" } },
              date_medium: { t: 0, b: { t: 2, i: [{ t: 3 }], s: "MMMM DD, YYYY" } },
              date_long: { t: 0, b: { t: 2, i: [{ t: 3 }], s: "dddd, MMMM DD, YYYY" } },
              time_short: { t: 0, b: { t: 2, i: [{ t: 3 }], s: "hh:mm A" } },
              time_medium: { t: 0, b: { t: 2, i: [{ t: 3 }], s: "hh:mm:ss A" } }
            }
          }
        }
      },
      "de-DE": {
        "datahub-plugin": {
          dateTime: {
            "date-time-value": {
              date_short: { t: 0, b: { t: 2, i: [{ t: 3 }], s: "DD.MM.YYYY" } },
              date_medium: { t: 0, b: { t: 2, i: [{ t: 3 }], s: "DD. MMMM YYYY" } },
              date_long: { t: 0, b: { t: 2, i: [{ t: 3 }], s: "dddd, DD. MMMM YYYY" } },
              time_short: { t: 0, b: { t: 2, i: [{ t: 3 }], s: "HH:mm" } },
              time_medium: { t: 0, b: { t: 2, i: [{ t: 3 }], s: "HH:mm:ss" } }
            }
          }
        }
      }
    }
  });
}
typeof r == "function" && r(A);
export {
  A as default
};
