<commit_before>import React from 'react';
import PropTypes from 'prop-types';

import SpellLink from 'common/SpellLink';
import { captureException } from 'common/errorLogger';

import Requirement from './Requirement';

/**
 * This is a common requirement for all checklists that uses settings for CastEfficiency to create a Requirement. It shows the spell and your efficiency as performance depending on the configured cast efficiency efficiency thresholds.
 *
 * This requirement is automatically disabled if the ability's CastEfficiency suggestion is disabled (i.e. if the ability's castEfficiency: { suggestion } is unset or false), or the ability is disabled completely. If you set `onlyWithSuggestion` to `false` in the object when creating this requirement you can change this behavior to always show if the ability is enabled, regardless of the CastEfficiency suggestion property being set.
 */
class GenericMaxCastEfficiencyRequirement extends React.PureComponent {
  static propTypes = {
    spell: PropTypes.number.isRequired,
    name: PropTypes.node,
    castEfficiency: PropTypes.shape({
      efficiency: PropTypes.number.isRequired,
      gotMaxCasts: PropTypes.bool.isRequired,
      recommendedEfficiency: PropTypes.number.isRequired,
      averageIssueEfficiency: PropTypes.number.isRequired,
      majorIssueEfficiency: PropTypes.number.isRequired,
    }).isRequired,
  };

  get thresholds() {
    if (!this.props.castEfficiency) {
      captureException(new Error(`GenericMaxCastEfficiencyRequirement requires that you pass the castEfficiency object yourself. Spell: ${this.props.spell}`));
      return null;
    }
    const {
      casts,
      maxCasts,
    } = this.props.castEfficiency;<commit_msg>Updated MaxCast component proptypes<commit_after>import React from 'react';
import PropTypes from 'prop-types';

import SpellLink from 'common/SpellLink';
import { captureException } from 'common/errorLogger';

import Requirement from './Requirement';

/**
 * This is a common requirement for all checklists that uses settings for CastEfficiency to create a Requirement. It shows the spell and your efficiency as performance depending on the configured cast efficiency efficiency thresholds.
 *
 * This requirement is automatically disabled if the ability's CastEfficiency suggestion is disabled (i.e. if the ability's castEfficiency: { suggestion } is unset or false), or the ability is disabled completely. If you set `onlyWithSuggestion` to `false` in the object when creating this requirement you can change this behavior to always show if the ability is enabled, regardless of the CastEfficiency suggestion property being set.
 */
class GenericMaxCastEfficiencyRequirement extends React.PureComponent {
  static propTypes = {
    spell: PropTypes.number.isRequired,
    name: PropTypes.node,
    castEfficiency: PropTypes.shape({
      casts: PropTypes.number.isRequired,
      maxCasts: PropTypes.number.isRequired,
    }).isRequired,
  };

  get thresholds() {
    if (!this.props.castEfficiency) {
      captureException(new Error(`GenericMaxCastEfficiencyRequirement requires that you pass the castEfficiency object yourself. Spell: ${this.props.spell}`));
      return null;
    }
    const {
      casts,
      maxCasts,
    } = this.props.castEfficiency;
{'fraction_non_alphanumeric': 0.0729483282674772, 'fraction_numerical': 0.0, 'mean_word_length': 4.448675496688741, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5016113', 'n_tokens_mistral': 839, 'n_tokens_neox': 820, 'n_words': 318}