"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.USER_TIMEZONE_SETTING = exports.PROJECT_TIMEZONE_SETTING = exports.isTimeZone = exports.TimeZone = void 0;
exports.toTimezoneSetting = toTimezoneSetting;
var TimeZone;
(function (TimeZone) {
    TimeZone["UTC"] = "UTC";
    // 'Local' = 'Local', // TODO: decide what to do with local option UX
    TimeZone["Pacific/Pago_Pago"] = "Pacific/Pago_Pago";
    TimeZone["Pacific/Honolulu"] = "Pacific/Honolulu";
    TimeZone["Pacific/Marquesas"] = "Pacific/Marquesas";
    TimeZone["America/Anchorage"] = "America/Anchorage";
    TimeZone["America/Los_Angeles"] = "America/Los_Angeles";
    TimeZone["America/Denver"] = "America/Denver";
    TimeZone["America/Chicago"] = "America/Chicago";
    TimeZone["America/New_York"] = "America/New_York";
    TimeZone["America/Santo_Domingo"] = "America/Santo_Domingo";
    TimeZone["America/St_Johns"] = "America/St_Johns";
    TimeZone["America/Buenos_Aires"] = "America/Buenos_Aires";
    TimeZone["America/Noronha"] = "America/Noronha";
    TimeZone["Atlantic/Cape_Verde"] = "Atlantic/Cape_Verde";
    TimeZone["Europe/Paris"] = "Europe/Paris";
    TimeZone["Europe/Athens"] = "Europe/Athens";
    TimeZone["Europe/Moscow"] = "Europe/Moscow";
    TimeZone["Europe/London"] = "Europe/London";
    TimeZone["Asia/Dubai"] = "Asia/Dubai";
    TimeZone["Asia/Karachi"] = "Asia/Karachi";
    TimeZone["Asia/Kolkata"] = "Asia/Kolkata";
    TimeZone["Asia/Kathmandu"] = "Asia/Kathmandu";
    TimeZone["Asia/Dhaka"] = "Asia/Dhaka";
    TimeZone["Asia/Bangkok"] = "Asia/Bangkok";
    TimeZone["Asia/Shanghai"] = "Asia/Shanghai";
    TimeZone["Australia/Eucla"] = "Australia/Eucla";
    TimeZone["Asia/Tokyo"] = "Asia/Tokyo";
    TimeZone["Australia/Brisbane"] = "Australia/Brisbane";
    TimeZone["Australia/Sydney"] = "Australia/Sydney";
    TimeZone["Pacific/Noumea"] = "Pacific/Noumea";
    TimeZone["Pacific/Auckland"] = "Pacific/Auckland";
    TimeZone["Pacific/Apia"] = "Pacific/Apia";
    TimeZone["Pacific/Kiritimati"] = "Pacific/Kiritimati";
})(TimeZone || (exports.TimeZone = TimeZone = {}));
const isTimeZone = (timezone) => Object.values(TimeZone).includes(timezone);
exports.isTimeZone = isTimeZone;
/**
 * Sentinel values for a query's timezone setting. Anything that is not one of
 * these keywords is treated as an override IANA zone.
 */
exports.PROJECT_TIMEZONE_SETTING = 'project_timezone';
exports.USER_TIMEZONE_SETTING = 'user_timezone';
/**
 * Narrows an untrusted timezone string into a persisted TimezoneSetting. Keeps
 * the keywords and any supported TimeZone; anything else (an unsupported zone)
 * falls back to the project default rather than storing an arbitrary string.
 */
function toTimezoneSetting(value) {
    if (!value || value === exports.PROJECT_TIMEZONE_SETTING) {
        return exports.PROJECT_TIMEZONE_SETTING;
    }
    if (value === exports.USER_TIMEZONE_SETTING) {
        return exports.USER_TIMEZONE_SETTING;
    }
    return (0, exports.isTimeZone)(value) ? value : exports.PROJECT_TIMEZONE_SETTING;
}
//# sourceMappingURL=timezone.js.map