import { isRecord as p } from "../../../isRecord.js";
import { resolveFieldTypeComponentProps as a } from "../../../resolveFieldContractAliases.js";
import { resolveFieldInputLabel as f } from "../../../resolveFieldInputLabel/resolveFieldInputLabel.js";
import { isFiniteNumber as r } from "./helpers/isFiniteNumber/isFiniteNumber.js";
function u(o, l) {
  const t = f(o, l), e = a(o.fieldType);
  if (!p(e))
    return { resolvedLabel: t };
  const i = {};
  return r(e.min) && (i.min = e.min), r(e.max) && (i.max = e.max), r(e.step) && (i.step = e.step), r(e.shiftMultiplier) && (i.shiftMultiplier = e.shiftMultiplier), r(e.defaultValue) && (i.defaultValue = e.defaultValue), typeof e.withDecimal == "boolean" && (i.withDecimal = e.withDecimal), typeof e.readOnly == "boolean" && (i.readOnly = e.readOnly), typeof e.error == "boolean" && (i.error = e.error), typeof e.id == "string" && e.id.trim() !== "" && (i.id = e.id.trim()), typeof e.placeholder == "string" && e.placeholder.trim() !== "" && (i.placeholder = e.placeholder.trim()), {
    ...i,
    resolvedLabel: t
  };
}
export {
  u as normalizeNumberInputPropsFromBackend
};
