"use strict";
var __importDefault = (this && this.__importDefault) || function (mod) {
    return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.parseTimestamp = exports.getEventsUrl = exports.DEFAULT_EVENTS_HOST_NAME = void 0;
const dayjs_1 = __importDefault(require("../../lib/dayjs"));
exports.DEFAULT_EVENTS_HOST_NAME = 'events.launchdarkly.com';
const BULK_EVENTS_PATH = 'events/bulk';
const getEventsUrl = (settings) => {
    const { client_id, events_host_name } = settings;
    return `https://${events_host_name || exports.DEFAULT_EVENTS_HOST_NAME}/${BULK_EVENTS_PATH}/${client_id}`;
};
exports.getEventsUrl = getEventsUrl;
const parseTimestamp = (ts) => {
    const d = (0, dayjs_1.default)(ts);
    if (!d.isValid()) {
        return new Date().getTime();
    }
    return d.valueOf();
};
exports.parseTimestamp = parseTimestamp;
//# sourceMappingURL=utils.js.map