import { MediaType } from ".//request-service-provider/consts.js";
const getMediaFileType = (fileName) => {
  const imageExtensions = [
    "jpg",
    "png",
    "gif",
    "jpeg",
    "jpe",
    "jfif",
    "bmp",
    "heic",
    "heif",
    "tiff",
    "tif",
    "webp"
  ];
  const videoExtensions = [
    "avi",
    "mpeg",
    "mpg",
    "mpe",
    "mp4",
    "mkv",
    "webm",
    "mov",
    "ogv",
    "vob",
    "m4v",
    "3gp",
    "divx",
    "xvid",
    "mxf",
    "wmv",
    "m1v",
    "flv",
    "m2ts"
  ];
  const audioExtensions = ["mp3", "wav", "flac", "m4a", "wma", "aac", "aif", "aiff"];
  const archiveExtensions = ["zip", "rar", "tar", "gz", "gzip", "jar", "7z", "fgz", "webarchive"];
  const type = fileName?.split(".").pop()?.toLowerCase() || "";
  if (imageExtensions.includes(type)) {
    return MediaType.IMAGE;
  }
  if (videoExtensions.includes(type)) {
    return MediaType.VIDEO;
  }
  if (audioExtensions.includes(type)) {
    return MediaType.AUDIO;
  }
  if (archiveExtensions.includes(type)) {
    return "archive";
  }
  return MediaType.DOCUMENT;
};
export {
  getMediaFileType
};
//# sourceMappingURL=get-media-file-type.js.map
