"use strict";

Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.getTherapyArea = exports.getDiseaseType = exports.generateUUID = exports.dateConverstion = exports.checkStringTypeOf = exports.capitalize = void 0;
var _moment = _interopRequireDefault(require("moment"));
require("react-native-get-random-values");
var _uuid = require("uuid");
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
// Function to generate UUID
const generateUUID = () => {
  return (0, _uuid.v4)();
};
exports.generateUUID = generateUUID;
const capitalize = (str = '') => {
  return str.charAt(0).toUpperCase() + str.slice(1);
};
exports.capitalize = capitalize;
const dateConverstion = (date, dateType = 'YYYY-MM-DD', format = 'YYYY-MM-DD', addTime = false) => {
  if (addTime) {
    const currentTime = (0, _moment.default)().format('hh:mm:ss');
    const customDate = `${date} ${currentTime}`;
    return (0, _moment.default)(customDate, dateType).format(format);
  }
  return (0, _moment.default)(date, dateType).format(format);
};
exports.dateConverstion = dateConverstion;
const checkStringTypeOf = data => {
  if (typeof data === 'string') {
    return data;
  }
  return JSON.stringify(data);
};
exports.checkStringTypeOf = checkStringTypeOf;
const getTherapyArea = userData => {
  var _userData$therapy_are;
  return (userData === null || userData === void 0 || (_userData$therapy_are = userData.therapy_area) === null || _userData$therapy_are === void 0 ? void 0 : _userData$therapy_are.toLowerCase()) || 'metabolism';
};
exports.getTherapyArea = getTherapyArea;
const getDiseaseType = userData => {
  var _userData$disease;
  return (userData === null || userData === void 0 || (_userData$disease = userData.disease) === null || _userData$disease === void 0 ? void 0 : _userData$disease.toLowerCase()) || 'Diabetes';
};
exports.getDiseaseType = getDiseaseType;
//# sourceMappingURL=common.js.map