import { defineComponent as y, mergeModels as c, useModel as d, onBeforeMount as V, watch as v, createBlock as u, createCommentVNode as g, openBlock as o, unref as t, withCtx as B, createElementVNode as S, createElementBlock as k, Fragment as M, renderList as _ } from "vue";
import { storeToRefs as C } from "pinia";
import { T as D, e as E } from "./start-CE9SawgU.js";
import "vue-i18n";
import "./header-Bn1EKnBE.js";
import { u as L } from "./dictionary-B08TTkmv.js";
const N = /* @__PURE__ */ y({
  __name: "RMAElementsQuantityValidationSettings",
  props: /* @__PURE__ */ c({
    modelValue: {},
    data: {},
    options: {},
    settings: {},
    loading: { type: Boolean },
    readonly: { type: Boolean },
    isDefault: { type: Boolean }
  }, {
    modelValue: { default: () => [] },
    modelModifiers: {},
    valid: { type: Boolean, default: !0 },
    validModifiers: {}
  }),
  emits: ["update:modelValue", "update:valid"],
  setup(l) {
    const e = d(l, "modelValue");
    d(l, "valid");
    const n = L(), {
      quantityValidationSettingsOptions: m,
      isQuantityValidationSettingsOptionsLoading: s
    } = C(n);
    return V(() => {
      n.ensureQuantityValidationSettingsOptions();
    }), v(
      e,
      (a) => {
        a || (e.value = []);
      },
      { immediate: !0 }
    ), (a, i) => e.value ? (o(), u(t(D), {
      key: 0,
      loading: t(s),
      type: "list-item-avatar@3"
    }, {
      default: B(() => [
        S("div", null, [
          (o(!0), k(M, null, _(t(m), ({ id: r, label: p }) => (o(), u(t(E), {
            key: r,
            modelValue: e.value,
            "onUpdate:modelValue": i[0] || (i[0] = (f) => e.value = f),
            label: p,
            value: r,
            readonly: a.readonly
          }, null, 8, ["modelValue", "label", "value", "readonly"]))), 128))
        ])
      ]),
      _: 1
    }, 8, ["loading"])) : g("", !0);
  }
});
export {
  N as default
};
