"use strict";

Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.default = void 0;
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
var _constants = require("../../../constants");
var extractFileFormatIcon = function extractFileFormatIcon(fileFormat) {
  switch (fileFormat) {
    // Generic documents
    case 'folder':
      return (0, _platformFeatureFlags.fg)('navx-2827-eslint-object-translation-smart-links') ? {
        icon: _constants.IconType.Folder
      } : {
        icon: _constants.IconType.Folder,
        // eslint-disable-next-line @atlassian/i18n/no-literal-string-in-object
        label: 'Folder'
      };
    case 'text/plain':
    case 'application/vnd.oasis.opendocument.text':
    case 'application/vnd.apple.pages':
      return (0, _platformFeatureFlags.fg)('navx-2827-eslint-object-translation-smart-links') ? {
        icon: _constants.IconType.Document
      } : {
        icon: _constants.IconType.Document,
        // eslint-disable-next-line @atlassian/i18n/no-literal-string-in-object
        label: 'Document'
      };
    case 'application/pdf':
      return (0, _platformFeatureFlags.fg)('navx-2827-eslint-object-translation-smart-links') ? {
        icon: _constants.IconType.PDF
      } : {
        icon: _constants.IconType.PDF,
        // eslint-disable-next-line @atlassian/i18n/no-literal-string-in-object
        label: 'PDF document'
      };
    case 'application/vnd.oasis.opendocument.presentation':
    case 'application/vnd.apple.keynote':
      return (0, _platformFeatureFlags.fg)('navx-2827-eslint-object-translation-smart-links') ? {
        icon: _constants.IconType.Presentation
      } : {
        icon: _constants.IconType.Presentation,
        // eslint-disable-next-line @atlassian/i18n/no-literal-string-in-object
        label: 'Presentation'
      };
    case 'application/vnd.oasis.opendocument.spreadsheet':
    case 'application/vnd.apple.numbers':
      return (0, _platformFeatureFlags.fg)('navx-2827-eslint-object-translation-smart-links') ? {
        icon: _constants.IconType.Spreadsheet
      } : {
        icon: _constants.IconType.Spreadsheet,
        // eslint-disable-next-line @atlassian/i18n/no-literal-string-in-object
        label: 'Spreadsheet'
      };
    // Google Drive
    case 'application/vnd.google-apps.document':
      return (0, _platformFeatureFlags.fg)('navx-2827-eslint-object-translation-smart-links') ? {
        icon: _constants.IconType.GoogleDocs
      } : {
        icon: _constants.IconType.GoogleDocs,
        // eslint-disable-next-line @atlassian/i18n/no-literal-string-in-object
        label: 'Google Docs'
      };
    case 'application/vnd.google-apps.form':
      return (0, _platformFeatureFlags.fg)('navx-2827-eslint-object-translation-smart-links') ? {
        icon: _constants.IconType.GoogleForms
      } : {
        icon: _constants.IconType.GoogleForms,
        // eslint-disable-next-line @atlassian/i18n/no-literal-string-in-object
        label: 'Google Form'
      };
    case 'application/vnd.google-apps.spreadsheet':
      return (0, _platformFeatureFlags.fg)('navx-2827-eslint-object-translation-smart-links') ? {
        icon: _constants.IconType.GoogleSheets
      } : {
        icon: _constants.IconType.GoogleSheets,
        // eslint-disable-next-line @atlassian/i18n/no-literal-string-in-object
        label: 'Google Sheets'
      };
    case 'application/vnd.google-apps.presentation':
      return (0, _platformFeatureFlags.fg)('navx-2827-eslint-object-translation-smart-links') ? {
        icon: _constants.IconType.GoogleSlides
      } : {
        icon: _constants.IconType.GoogleSlides,
        // eslint-disable-next-line @atlassian/i18n/no-literal-string-in-object
        label: 'Google Slides'
      };
    // Microsoft
    case 'application/vnd.ms-excel':
    case 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet':
      return (0, _platformFeatureFlags.fg)('navx-2827-eslint-object-translation-smart-links') ? {
        icon: _constants.IconType.MSExcel
      } : {
        icon: _constants.IconType.MSExcel,
        // eslint-disable-next-line @atlassian/i18n/no-literal-string-in-object
        label: 'Excel spreadsheet'
      };
    case 'application/vnd.ms-powerpoint':
    case 'application/vnd.openxmlformats-officedocument.presentationml.presentation':
      return (0, _platformFeatureFlags.fg)('navx-2827-eslint-object-translation-smart-links') ? {
        icon: _constants.IconType.MSPowerpoint
      } : {
        icon: _constants.IconType.MSPowerpoint,
        // eslint-disable-next-line @atlassian/i18n/no-literal-string-in-object
        label: 'PowerPoint presentation'
      };
    case 'application/msword':
    case 'application/vnd.openxmlformats-officedocument.wordprocessingml.document':
      return (0, _platformFeatureFlags.fg)('navx-2827-eslint-object-translation-smart-links') ? {
        icon: _constants.IconType.MSWord
      } : {
        icon: _constants.IconType.MSWord,
        // eslint-disable-next-line @atlassian/i18n/no-literal-string-in-object
        label: 'Word document'
      };
    case 'image/png':
    case 'image/jpeg':
    case 'image/bmp':
    case 'image/webp':
    case 'image/svg+xml':
      return (0, _platformFeatureFlags.fg)('navx-2827-eslint-object-translation-smart-links') ? {
        icon: _constants.IconType.Image
      } : {
        icon: _constants.IconType.Image,
        // eslint-disable-next-line @atlassian/i18n/no-literal-string-in-object
        label: 'Image'
      };
    case 'image/gif':
      return (0, _platformFeatureFlags.fg)('navx-2827-eslint-object-translation-smart-links') ? {
        icon: _constants.IconType.GIF
      } : {
        icon: _constants.IconType.GIF,
        // eslint-disable-next-line @atlassian/i18n/no-literal-string-in-object
        label: 'GIF'
      };
    case 'audio/midi':
    case 'audio/mpeg':
    case 'audio/webm':
    case 'audio/ogg':
    case 'audio/wav':
      return (0, _platformFeatureFlags.fg)('navx-2827-eslint-object-translation-smart-links') ? {
        icon: _constants.IconType.Audio
      } : {
        icon: _constants.IconType.Audio,
        // eslint-disable-next-line @atlassian/i18n/no-literal-string-in-object
        label: 'Audio'
      };
    case 'video/mp4':
    case 'video/quicktime':
    case 'video/mov':
    case 'video/webm':
    case 'video/ogg':
    case 'video/x-ms-wmv':
    case 'video/x-msvideo':
      return (0, _platformFeatureFlags.fg)('navx-2827-eslint-object-translation-smart-links') ? {
        icon: _constants.IconType.Video
      } : {
        icon: _constants.IconType.Video,
        // eslint-disable-next-line @atlassian/i18n/no-literal-string-in-object
        label: 'Video'
      };
    // Others
    case 'text/css':
    case 'text/html':
    case 'application/javascript':
      return (0, _platformFeatureFlags.fg)('navx-2827-eslint-object-translation-smart-links') ? {
        icon: _constants.IconType.Code
      } : {
        icon: _constants.IconType.Code,
        // eslint-disable-next-line @atlassian/i18n/no-literal-string-in-object
        label: 'Source Code'
      };
    case 'application/zip':
    case 'application/x-tar':
    case 'application/x-gtar':
    case 'application/x-7z-compressed':
    case 'application/x-apple-diskimage':
    case 'application/vnd.rar':
      return (0, _platformFeatureFlags.fg)('navx-2827-eslint-object-translation-smart-links') ? {
        icon: _constants.IconType.Archive
      } : {
        icon: _constants.IconType.Archive,
        // eslint-disable-next-line @atlassian/i18n/no-literal-string-in-object
        label: 'Archive'
      };
    case 'application/dmg':
      return (0, _platformFeatureFlags.fg)('navx-2827-eslint-object-translation-smart-links') ? {
        icon: _constants.IconType.Executable
      } : {
        icon: _constants.IconType.Executable,
        // eslint-disable-next-line @atlassian/i18n/no-literal-string-in-object
        label: 'Executable'
      };
    case 'application/sketch':
      return (0, _platformFeatureFlags.fg)('navx-2827-eslint-object-translation-smart-links') ? {
        icon: _constants.IconType.Sketch
      } : {
        icon: _constants.IconType.Sketch,
        // eslint-disable-next-line @atlassian/i18n/no-literal-string-in-object
        label: 'Sketch'
      };
    case 'application/octet-stream':
      return (0, _platformFeatureFlags.fg)('navx-2827-eslint-object-translation-smart-links') ? {
        icon: _constants.IconType.Generic
      } : {
        icon: _constants.IconType.Generic,
        // eslint-disable-next-line @atlassian/i18n/no-literal-string-in-object
        label: 'Binary file'
      };
    case 'application/invision.prototype':
      return (0, _platformFeatureFlags.fg)('navx-2827-eslint-object-translation-smart-links') ? {
        icon: _constants.IconType.Generic
      } : {
        icon: _constants.IconType.Generic,
        // eslint-disable-next-line @atlassian/i18n/no-literal-string-in-object
        label: 'Prototype'
      };
    default:
      return undefined;
  }
};
var _default = exports.default = extractFileFormatIcon;