<commit_before>import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
import { uniqueId, defaults } from 'lodash';
import { Tooltip, OverlayTrigger, Button } from 'react-bootstrap';
import { React, PropTypes, cn } from '../helpers/react';
import { library } from '@fortawesome/fontawesome-svg-core';
import styled from 'styled-components';

// Don't attempt to remove the duplication by using variable substition without testing ;)
// After trying multiple methods, it seems like webpack 4 will either:
//   * require all icons in the build
//   * fail to load required icons
const Icons = {
  // regular
  'calendar':             require('@fortawesome/free-regular-svg-icons/faCalendar.js'),
  'check-square':         require('@fortawesome/free-regular-svg-icons/faCheckSquare'),
  'circle':               require('@fortawesome/free-regular-svg-icons/faCircle'),
  'clock':                require('@fortawesome/free-regular-svg-icons/faClock'),
  'comment':              require('@fortawesome/free-regular-svg-icons/faComment'),
  'comments':             require('@fortawesome/free-regular-svg-icons/faComments'),
  'envelope':             require('@fortawesome/free-regular-svg-icons/faEnvelope'),
  'square':               require('@fortawesome/free-regular-svg-icons/faSquare'),

  // solid
  'angle-down':           require('@fortawesome/free-solid-svg-icons/faAngleDown'),
  'arrow-circle-down':    require('@fortawesome/free-solid-svg-icons/faArrowCircleDown'),
  'arrow-circle-left':    require('@fortawesome/free-solid-svg-icons/faArrowCircleLeft'),
  'arrow-circle-right':   require('@fortawesome/free-solid-svg-icons/faArrowCircleRight'),
  'arrow-circle-up':      require('@fortawesome/free-solid-svg-icons/faArrowCircleUp'),
  'arrow-down':           require('@fortawesome/free-solid-svg-icons/faArrowDown'),
  'arrow-left':           require('@fortawesome/free-solid-svg-icons/faArrowLeft'),
  'arrow-right':          require('@fortawesome/free-solid-svg-icons/faArrowRight'),
  'arrow-up':             require('@fortawesome/free-solid-svg-icons/faArrowUp'),
  'ban':                  require('@fortawesome/free-solid-svg-icons/faBan'),
  'bars':                 require('@fortawesome/free-solid-svg-icons/faBars'),
  'bookmark':             require('@fortawesome/free-solid-svg-icons/faBookmark'),
  'bullhorn':             require('@fortawesome/free-solid-svg-icons/faBullhorn'),
  'caret-left':           require('@fortawesome/free-solid-svg-icons/faCaretLeft'),
  'caret-right':          require('@fortawesome/free-solid-svg-icons/faCaretRight'),
  'check':                require('@fortawesome/free-solid-svg-icons/faCheck'),
  'check-circle':         require('@fortawesome/free-solid-svg-icons/faCheckCircle'),
  'check-square-solid':   require('@fortawesome/free-solid-svg-icons/faCheckSquare'),
  'cheveron-left':        require('@fortawesome/free-solid-svg-icons/faChevronLeft'),
  'chevron-down':         require('@fortawesome/free-solid-svg-icons/faChevronDown'),
  'chevron-left':         require('@fortawesome/free-solid-svg-icons/faChevronLeft'),
  'chevron-right':        require('@fortawesome/free-solid-svg-icons/faChevronRight'),
  'chevron-up':           require('@fortawesome/free-solid-svg-icons/faChevronUp'),
  'clock-solid':          require('@fortawesome/free-solid-svg-icons/faClock'),
  'close':                require('@fortawesome/free-solid-svg-icons/faTimes'),
  'close-circle':         require('@fortawesome/free-solid-svg-icons/faTimesCircle'),
  'comment-solid':        require('@fortawesome/free-solid-svg-icons/faComment'),
  'comments-solid':       require('@fortawesome/free-solid-svg-icons/faComments'),
  'download':             require('@fortawesome/free-solid-svg-icons/faDownload'),
  'edit':                 require('@fortawesome/free-solid-svg-icons/faEdit'),
  'exclamation-circle':   require('@fortawesome/free-solid-svg-icons/faExclamationCircle'),
  'exclamation-triangle': require('@fortawesome/free-solid-svg-icons/faExclamationTriangle'),
  'external-link-alt':    require('@fortawesome/free-solid-svg-icons/faExternalLinkAlt'),
  'eye':                  require('@fortawesome/free-solid-svg-icons/faEye'),
  'eye-slash':            require('@fortawesome/free-solid-svg-icons/faEyeSlash'),
  'ghost':                require('@fortawesome/free-solid-svg-icons/faGhost'),
  'hand-paper':           require('@fortawesome/free-solid-svg-icons/faHandPaper'),
  'info-circle':          require('@fortawesome/free-solid-svg-icons/faInfoCircle'),
  'lock':                 require('@fortawesome/free-solid-svg-icons/faLock'),
  'paper-plane':          require('@fortawesome/free-solid-svg-icons/faPaperPlane'),
  'pencil-alt':           require('@fortawesome/free-solid-svg-icons/faPencilAlt'),
  'plus-circle':          require('@fortawesome/free-solid-svg-icons/faPlusCircle'),
  'plus-square':          require('@fortawesome/free-solid-svg-icons/faPlusSquare'),
  'print':                require('@fortawesome/free-solid-svg-icons/faPrint'),
  'question-circle':      require('@fortawesome/free-solid-svg-icons/faQuestionCircle'),
  'sort':                 require('@fortawesome/free-solid-svg-icons/faSort'),
  'sort-down':            require('@fortawesome/free-solid-svg-icons/faSortDown'),
  'sort-up':              require('@fortawesome/free-solid-svg-icons/faSortUp'),
  'spinner':              require('@fortawesome/free-solid-svg-icons/faSpinner'),
  'th':                   require('@fortawesome/free-solid-svg-icons/faTh'),
  'thumbs-up':            require('@fortawesome/free-solid-svg-icons/faThumbsUp'),
  'trash':                require('@fortawesome/free-solid-svg-icons/faTrashAlt'),
  'user-plus':            require('@fortawesome/free-solid-svg-icons/faUserPlus'),
  'video':                require('@fortawesome/free-solid-svg-icons/faVideo'),

  // custom definitions
  'glasses':              require('./icons/glasses'),

};

Object.keys(Icons).forEach(k => {
  const icon = Icons[k];
  if (icon) {
    library.add(icon.definition);
    Icons[k] = icon.definition;
  } else {
    // eslint-disable-next-line no-console
    console.warn(`Icon ${k} was not imported correctly`);
  }
});

// aliases
Icons['wrong'] = Icons['close'];

export { Icons };

const defaultTooltipProps = {
  placement: 'auto',
  trigger: ['hover', 'focus'],
};

const IconWrapper = styled(FontAwesomeIcon)`
  margin-right: 0.5rem;
  margin-left: 0.5rem;
`;


const Variants = {
  errorInfo: {
    color: '#c2002f',
    type: 'exclamation-circle',
  },
};

export default
class Icon extends React.Component {
<commit_msg>add spinner variant<commit_after>import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
import { uniqueId, defaults } from 'lodash';
import { Tooltip, OverlayTrigger, Button } from 'react-bootstrap';
import { React, PropTypes, cn } from '../helpers/react';
import { library } from '@fortawesome/fontawesome-svg-core';
import styled from 'styled-components';

// Don't attempt to remove the duplication by using variable substition without testing ;)
// After trying multiple methods, it seems like webpack 4 will either:
//   * require all icons in the build
//   * fail to load required icons
const Icons = {
  // regular
  'calendar':             require('@fortawesome/free-regular-svg-icons/faCalendar.js'),
  'check-square':         require('@fortawesome/free-regular-svg-icons/faCheckSquare'),
  'circle':               require('@fortawesome/free-regular-svg-icons/faCircle'),
  'clock':                require('@fortawesome/free-regular-svg-icons/faClock'),
  'comment':              require('@fortawesome/free-regular-svg-icons/faComment'),
  'comments':             require('@fortawesome/free-regular-svg-icons/faComments'),
  'envelope':             require('@fortawesome/free-regular-svg-icons/faEnvelope'),
  'square':               require('@fortawesome/free-regular-svg-icons/faSquare'),

  // solid
  'angle-down':           require('@fortawesome/free-solid-svg-icons/faAngleDown'),
  'arrow-circle-down':    require('@fortawesome/free-solid-svg-icons/faArrowCircleDown'),
  'arrow-circle-left':    require('@fortawesome/free-solid-svg-icons/faArrowCircleLeft'),
  'arrow-circle-right':   require('@fortawesome/free-solid-svg-icons/faArrowCircleRight'),
  'arrow-circle-up':      require('@fortawesome/free-solid-svg-icons/faArrowCircleUp'),
  'arrow-down':           require('@fortawesome/free-solid-svg-icons/faArrowDown'),
  'arrow-left':           require('@fortawesome/free-solid-svg-icons/faArrowLeft'),
  'arrow-right':          require('@fortawesome/free-solid-svg-icons/faArrowRight'),
  'arrow-up':             require('@fortawesome/free-solid-svg-icons/faArrowUp'),
  'ban':                  require('@fortawesome/free-solid-svg-icons/faBan'),
  'bars':                 require('@fortawesome/free-solid-svg-icons/faBars'),
  'bookmark':             require('@fortawesome/free-solid-svg-icons/faBookmark'),
  'bullhorn':             require('@fortawesome/free-solid-svg-icons/faBullhorn'),
  'caret-left':           require('@fortawesome/free-solid-svg-icons/faCaretLeft'),
  'caret-right':          require('@fortawesome/free-solid-svg-icons/faCaretRight'),
  'check':                require('@fortawesome/free-solid-svg-icons/faCheck'),
  'check-circle':         require('@fortawesome/free-solid-svg-icons/faCheckCircle'),
  'check-square-solid':   require('@fortawesome/free-solid-svg-icons/faCheckSquare'),
  'cheveron-left':        require('@fortawesome/free-solid-svg-icons/faChevronLeft'),
  'chevron-down':         require('@fortawesome/free-solid-svg-icons/faChevronDown'),
  'chevron-left':         require('@fortawesome/free-solid-svg-icons/faChevronLeft'),
  'chevron-right':        require('@fortawesome/free-solid-svg-icons/faChevronRight'),
  'chevron-up':           require('@fortawesome/free-solid-svg-icons/faChevronUp'),
  'clock-solid':          require('@fortawesome/free-solid-svg-icons/faClock'),
  'close':                require('@fortawesome/free-solid-svg-icons/faTimes'),
  'close-circle':         require('@fortawesome/free-solid-svg-icons/faTimesCircle'),
  'comment-solid':        require('@fortawesome/free-solid-svg-icons/faComment'),
  'comments-solid':       require('@fortawesome/free-solid-svg-icons/faComments'),
  'download':             require('@fortawesome/free-solid-svg-icons/faDownload'),
  'edit':                 require('@fortawesome/free-solid-svg-icons/faEdit'),
  'exclamation-circle':   require('@fortawesome/free-solid-svg-icons/faExclamationCircle'),
  'exclamation-triangle': require('@fortawesome/free-solid-svg-icons/faExclamationTriangle'),
  'external-link-alt':    require('@fortawesome/free-solid-svg-icons/faExternalLinkAlt'),
  'eye':                  require('@fortawesome/free-solid-svg-icons/faEye'),
  'eye-slash':            require('@fortawesome/free-solid-svg-icons/faEyeSlash'),
  'ghost':                require('@fortawesome/free-solid-svg-icons/faGhost'),
  'hand-paper':           require('@fortawesome/free-solid-svg-icons/faHandPaper'),
  'info-circle':          require('@fortawesome/free-solid-svg-icons/faInfoCircle'),
  'lock':                 require('@fortawesome/free-solid-svg-icons/faLock'),
  'paper-plane':          require('@fortawesome/free-solid-svg-icons/faPaperPlane'),
  'pencil-alt':           require('@fortawesome/free-solid-svg-icons/faPencilAlt'),
  'plus-circle':          require('@fortawesome/free-solid-svg-icons/faPlusCircle'),
  'plus-square':          require('@fortawesome/free-solid-svg-icons/faPlusSquare'),
  'print':                require('@fortawesome/free-solid-svg-icons/faPrint'),
  'question-circle':      require('@fortawesome/free-solid-svg-icons/faQuestionCircle'),
  'sort':                 require('@fortawesome/free-solid-svg-icons/faSort'),
  'sort-down':            require('@fortawesome/free-solid-svg-icons/faSortDown'),
  'sort-up':              require('@fortawesome/free-solid-svg-icons/faSortUp'),
  'spinner':              require('@fortawesome/free-solid-svg-icons/faSpinner'),
  'th':                   require('@fortawesome/free-solid-svg-icons/faTh'),
  'thumbs-up':            require('@fortawesome/free-solid-svg-icons/faThumbsUp'),
  'trash':                require('@fortawesome/free-solid-svg-icons/faTrashAlt'),
  'user-plus':            require('@fortawesome/free-solid-svg-icons/faUserPlus'),
  'video':                require('@fortawesome/free-solid-svg-icons/faVideo'),

  // custom definitions
  'glasses':              require('./icons/glasses'),

};

Object.keys(Icons).forEach(k => {
  const icon = Icons[k];
  if (icon) {
    library.add(icon.definition);
    Icons[k] = icon.definition;
  } else {
    // eslint-disable-next-line no-console
    console.warn(`Icon ${k} was not imported correctly`);
  }
});

// aliases
Icons['wrong'] = Icons['close'];

export { Icons };

const defaultTooltipProps = {
  placement: 'auto',
  trigger: ['hover', 'focus'],
};

const IconWrapper = styled(FontAwesomeIcon)`
  margin-right: 0.5rem;
  margin-left: 0.5rem;
`;


const Variants = {
  errorInfo: {
    color: '#c2002f',
    type: 'exclamation-circle',
  },
  activity: {
    type: 'spinner',
    spin: true,
  },
};

export default
class Icon extends React.Component {

{'fraction_non_alphanumeric': 0.1685053649690192, 'fraction_numerical': 0.001360132990781321, 'mean_word_length': 3.2611075338055375, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 4, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3803846', 'n_tokens_mistral': 4326, 'n_tokens_neox': 4257, 'n_words': 497}