import { capitalCase, sentenceCase } from "change-case";
import { format } from "date-fns";
var dateToHumanReadable = function (date) {
    return date ? (date = new Date(date), format(date, "dd MMM yyyy HH:mm")) : "";
  },
  dateToHumanReadableDay = function (date) {
    return date ? (date = new Date(date), format(date, "dd MMM yyyy")) : "";
  },
  dateToHumanReadableTime = function (date) {
    return date ? (date = new Date(date), format(date, "HH:mm")) : "";
  },
  dateToHumanReadableRange = function (start, end, includeTime) {
    return includeTime ? `${dateToHumanReadable(start)} - ${dateToHumanReadable(end)}` : `${dateToHumanReadableDay(start)} - ${dateToHumanReadableDay(end)}`;
  },
  toCapitalCase = function (str) {
    return str ? capitalCase(str) : "";
  },
  toSentenceCase = function (str) {
    return str ? sentenceCase(str) : "";
  },
  renderName = function (param) {
    var {
      firstName,
      middleName,
      lastName
    } = param;
    if (!firstName && !middleName && !lastName) return "";
    var str = `${lastName}, ${firstName}`;
    return middleName && (str = `${str} ${middleName}`), str;
  },
  locationToAddress = function (location) {
    var _location_city, _location_stateOrRegion;
    return location ? `${location?.streetAddressOne}, ${location?.city}, ${(_location_city = location.city) === null || _location_city === void 0 ? void 0 : _location_city.toUpperCase()}, ${(_location_stateOrRegion = location.stateOrRegion) === null || _location_stateOrRegion === void 0 ? void 0 : _location_stateOrRegion.toUpperCase()}, ${location?.postalCode}` : "";
  },
  renderFileSize = function (sizeInBytes) {
    if (sizeInBytes < 0) throw new Error("Size must be a non-negative integer.");
    var units = ["B", "KB", "MB", "GB", "TB", "PB", "EB", "ZB", "YB"];
    if (sizeInBytes === 0) return "0 B";
    for (var i = 0, size = sizeInBytes; size >= 1024 && i < units.length - 1;) size /= 1024, i++;
    return `${size.toFixed(2)} ${units[i]}`;
  };
export { dateToHumanReadable, dateToHumanReadableDay, dateToHumanReadableRange, dateToHumanReadableTime, locationToAddress, renderFileSize, renderName, toCapitalCase, toSentenceCase };
//# sourceMappingURL=render.native.js.map
