<commit_before>const html = require('choo/html');
const find = require('lodash/find');

module.exports = (state, prev, send) => {
  const issue = find(state.issues, ['id', state.location.params.issueid]);
  const currentIndex = state.contactIndices[issue.id];
  const currentContact = issue.contacts[currentIndex];

  const contactsLeft = issue.contacts.length - (currentIndex + 1);
  const callsPluralization = contactsLeft > 1 ? "people" : "person";

  const contactsLeftText = contactsLeft + " more " + callsPluralization +" to call for this issue.";

  function outcome(result) {
    if (result == null) {
      send('skipCall', { issueid: issue.id });
    } else {
      send('callComplete', { result: result, contactid: currentContact.id, issueid: issue.id });
    }
  }

  if (currentContact != null) {
    return html`<div class="call__outcomes">
      <h3 class="call__outcomes__header">Enter your call result to get the next call:</h3>
      <div class="call__outcomes__items">
        <button onclick=${() => outcome('unavailable')}>Unavailable</button>
        <button onclick=${() => outcome('vm')}>Left Voicemail</button>
        <button onclick=${() => outcome('contacted')}>Made Contact</button>
        <button onclick=${() => outcome()}>Skip</button>
      </div>

      ${contactsLeft > 0 ? html`<h3 aria-live="polite" class="call__contacts__left" >${contactsLeftText}</h3>` : null}
    </div>`
  } else {
    return html``
  }
}
<commit_msg>Unfocuses outcome buttons after click<commit_after>const html = require('choo/html');
const find = require('lodash/find');

module.exports = (state, prev, send) => {
  const issue = find(state.issues, ['id', state.location.params.issueid]);
  const currentIndex = state.contactIndices[issue.id];
  const currentContact = issue.contacts[currentIndex];

  const contactsLeft = issue.contacts.length - (currentIndex + 1);
  const callsPluralization = contactsLeft > 1 ? "people" : "person";

  const contactsLeftText = contactsLeft + " more " + callsPluralization +" to call for this issue.";

  function outcome(e, result) {
    e.target.blur()
    
    if (result == null) {
      send('skipCall', { issueid: issue.id });
    } else {
      send('callComplete', { result: result, contactid: currentContact.id, issueid: issue.id });
    }

    return true
  }

  if (currentContact != null) {
    return html`<div class="call__outcomes">
      <h3 class="call__outcomes__header">Enter your call result to get the next call:</h3>
      <div class="call__outcomes__items">
        <button onclick=${(e) => outcome(e, 'unavailable')}>Unavailable</button>
        <button onclick=${(e) => outcome(e, 'vm')}>Left Voicemail</button>
        <button onclick=${(e) => outcome(e, 'contacted')}>Made Contact</button>
        <button onclick=${(e) => outcome(e)}}>Skip</button>
      </div>

      ${contactsLeft > 0 ? html`<h3 aria-live="polite" class="call__contacts__left" >${contactsLeftText}</h3>` : null}
    </div>`
  } else {
    return html``
  }
}

{'fraction_non_alphanumeric': 0.16400532268795742, 'fraction_numerical': 0.004657351962741184, 'mean_word_length': 3.8973941368078178, 'pattern_counts': {'":': 0, '<': 35, '<?xml version=': 0, '>': 49, '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': '906799', 'n_tokens_mistral': 942, 'n_tokens_neox': 923, 'n_words': 215}