"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.parsePositiveInteger = parsePositiveInteger;
exports.parseNonNegativeInteger = parseNonNegativeInteger;
const catalog_1 = require("../i18n/catalog");
function parsePositiveInteger(label, value, locale = catalog_1.DEFAULT_APP_LOCALE) {
    const parsed = Number(value);
    if (!Number.isInteger(parsed) || parsed <= 0) {
        throw new Error((0, catalog_1.translate)(locale, "numbers.parsePositiveInteger", { label, value }));
    }
    return parsed;
}
function parseNonNegativeInteger(label, value, locale = catalog_1.DEFAULT_APP_LOCALE) {
    const parsed = Number(value);
    if (!Number.isInteger(parsed) || parsed < 0) {
        throw new Error((0, catalog_1.translate)(locale, "numbers.parseNonNegativeInteger", { label, value }));
    }
    return parsed;
}
