<commit_before>class ApiService {
  constructor () {
    this.url = 'https://36yfx8yfid.execute-api.eu-west-1.amazonaws.com/dev';
  }
}


class TopicsService {
  constructor ($http, apiService) {
    Object.assign(this, {$http, apiService});
  }

  getTopics () {
    if (!this.topicsPromise) {
      this.topicsPromise = this.$http.get(`${this.apiService.url}/topics`);
    }

    return this.topicsPromise;
  }

  createTopic (topic) {
    return this.$http.post(`${this.apiService.url}/topics`, topic);
  }
}


class VotingService {
  constructor ($http, apiService) {
    Object.assign(this, {$http, apiService});
  }

  vote (id, vote) {
    this.$http.post(`${this.apiService.url}/votes`, {topic_id: id, vote});
  }

  downVote (topic) {
    this.vote(topic.id, '-1');
  }

  upVote (topic) {
    this.vote(topic.id, '1');
  }
}


class VotingTopicsComponentController {
  constructor (topicsService) {
    this.loading = true;
    topicsService.getTopics().then(({data}) => {
      if (data.errorMessage) {
        this.error = data.errorMessage;
      } else if (data.length >= 0) {
        this.topics = data;
        this.loading = false;
      }
    });
  }
}


class VoterComponentController {
  constructor (votingService) {
    this.votingService = votingService;
  }

  downVote () {
    this.clickedDownVote = true;
    this.votingService.downVote(this.topic);
    this.topic.total--;
  }

  upVote () {
    this.clickedUpVote = true;
    this.votingService.upVote(this.topic);
    this.topic.total++;
  }
}


class topicCreatorComponentController {
  constructor (topicsService) {<commit_msg>colours change properly<commit_after>class ApiService {
  constructor () {
    this.url = 'https://36yfx8yfid.execute-api.eu-west-1.amazonaws.com/dev';
  }
}


class TopicsService {
  constructor ($http, apiService) {
    Object.assign(this, {$http, apiService});
  }

  getTopics () {
    if (!this.topicsPromise) {
      this.topicsPromise = this.$http.get(`${this.apiService.url}/topics`);
    }

    return this.topicsPromise;
  }

  createTopic (topic) {
    return this.$http.post(`${this.apiService.url}/topics`, topic);
  }
}


class VotingService {
  constructor ($http, apiService) {
    Object.assign(this, {$http, apiService});
  }

  vote (id, vote) {
    this.$http.post(`${this.apiService.url}/votes`, {topic_id: id, vote});
  }

  downVote (topic) {
    this.vote(topic.id, '-1');
  }

  upVote (topic) {
    this.vote(topic.id, '1');
  }
}


class VotingTopicsComponentController {
  constructor (topicsService) {
    this.loading = true;
    topicsService.getTopics().then(({data}) => {
      if (data.errorMessage) {
        this.error = data.errorMessage;
      } else if (data.length >= 0) {
        this.topics = data;
        this.loading = false;
      }
    });
  }
}


class VoterComponentController {
  constructor (votingService) {
    this.votingService = votingService;
  }

  downVote () {
    this.clickedDownVote = true;
    this.clickedUpVote = false;
    this.votingService.downVote(this.topic);
    this.topic.total--;
  }

  upVote () {
    this.clickedUpVote = true;
    this.clickedDownVote = false;
    this.votingService.upVote(this.topic);
    this.topic.total++;
  }
}


class topicCreatorComponentController {
  constructor (topicsService) {
{'fraction_non_alphanumeric': 0.15361262902246509, 'fraction_numerical': 0.004250151791135397, 'mean_word_length': 3.0133982947624847, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 7, 'https://': 2, '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': '269742', 'n_tokens_mistral': 1170, 'n_tokens_neox': 1147, 'n_words': 180}