"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.isValidIanaTimezone = isValidIanaTimezone;
exports.normalizeTimezone = normalizeTimezone;
const timezone_constants_1 = require("./timezone.constants");
function isValidIanaTimezone(timeZone) {
    if (!timeZone || typeof timeZone !== 'string') {
        return false;
    }
    try {
        Intl.DateTimeFormat(undefined, { timeZone });
        return true;
    }
    catch {
        return false;
    }
}
function normalizeTimezone(value) {
    if (value && isValidIanaTimezone(value)) {
        return value;
    }
    return timezone_constants_1.DEFAULT_ORG_TIMEZONE;
}
//# sourceMappingURL=timezone.util.js.map