<commit_before>(function ($) {
  'use strict';

  window.PWO = window.PWO || {};

  var eligibility = {
    init: function () {
      this.cache();
      this.bindEvents();
    },
    cache: function () {
      this.$wrapper = $('.display_if_eligible');
      this.$input = $('input[name="appointment_summary[has_defined_contribution_pension]"]');
    },
    bindEvents: function () {
      var that = this;
      this.$input.on('change', function () {
        if (this.value !== 'no') {
          that.$wrapper.fadeIn();
        } else {
          that.$wrapper.fadeOut();
        }
        $.publish('eligibilityChange', this.value);
      });
    }
  };

  PWO.eligibility = eligibility;

})(jQuery);
<commit_msg>Open value section on error page if eligible<commit_after>(function ($) {
  'use strict';

  window.PWO = window.PWO || {};

  var eligibility = {
    init: function () {
      this.cache();
      this.bindEvents();
      this.ensureCorrectState();
    },
    cache: function () {
      this.$wrapper = $('.display_if_eligible');
      this.$input = $('input[name="appointment_summary[has_defined_contribution_pension]"]');
    },
    bindEvents: function () {
      var that = this;
      this.$input.on('change', function () {
        if (this.value !== 'no') {
          that.$wrapper.fadeIn();
        } else {
          that.$wrapper.fadeOut();
        }
        $.publish('eligibilityChange', this.value);
      });
    },
    ensureCorrectState: function() {
      if (this.$input.is(':checked')) {
        this.$input.filter(':checked').trigger('change');
      }
    }
  };

  PWO.eligibility = eligibility;

})(jQuery);

{'fraction_non_alphanumeric': 0.1798298906439854, 'fraction_numerical': 0.0, 'mean_word_length': 2.402892561983471, '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': '5379199', 'n_tokens_mistral': 524, 'n_tokens_neox': 489, 'n_words': 83}