<commit_before>Template.InternationalPhoneSingleInput.helpers({
  phoneNumber: function () {
    var input = PhoneInput(this.id);

    var dialCode = '';
    if(!input.hideDialCode) {
      dialCode = input.getDialCode();
    }

    return dialCode ? dialCode + ' ' : '' + (input.getPhoneNumber() || '');
  },
  exampleCountryNumber: function () {
    var input = PhoneInput(this.id);
    var countryCode = input.getCountryCode();

    var exampleNumber = Phoneformat.exampleMobileNumber(countryCode);
    var intlNumber = Phoneformat.formatInternational(countryCode, exampleNumber);

    var dialCode = '';
    if (!input.hideDialCode) {
      dialCode = input.getDialCode();
    }

    return dialCode ? dialCode + ' ' : '' + intlNumber.replace(/[0-9]/g, 'x');
  },
  maxPhoneNumberLength: function () {
    return PhoneInput(this.id).maxLength();
  }
});

Template.InternationalPhoneSingleInput.events({
  'input .js-intlSinglePhone-phoneNumber': function (event, template) {
    var input = PhoneInput(template.data.id);

    var phoneNumber = event.currentTarget.value;

    var countryCode = input.getCountryCode();
    var formattedNumber = Phoneformat.formatInternational(countryCode, phoneNumber);
    var unmaskedValue = phoneNumber.replace(/\(|\)|\-/g, '');
    if (isNaN(unmaskedValue)) {
      template.$('.js-intlSinglePhone-phoneNumber').val(formattedNumber);
    }

    // Set the phone number on the phone input object.
    if (template.data.hideDialCode) {<commit_msg>Simplify hideDialCode display logic<commit_after>Template.InternationalPhoneSingleInput.helpers({
  phoneNumber: function () {
    var input = PhoneInput(this.id);

    return (!input.hideDialCode ? input.getDialCode() + ' ' : '') + (input.getPhoneNumber() || '');
  },
  exampleCountryNumber: function () {
    var input = PhoneInput(this.id);
    var countryCode = input.getCountryCode();

    var exampleNumber = Phoneformat.exampleMobileNumber(countryCode);
    var intlNumber = Phoneformat.formatInternational(countryCode, exampleNumber);

    return (!input.hideDialCode ? input.getDialCode() + ' ' : '') + intlNumber.replace(/[0-9]/g, 'x');
  },
  maxPhoneNumberLength: function () {
    return PhoneInput(this.id).maxLength();
  }
});

Template.InternationalPhoneSingleInput.events({
  'input .js-intlSinglePhone-phoneNumber': function (event, template) {
    var input = PhoneInput(template.data.id);

    var phoneNumber = event.currentTarget.value;

    var countryCode = input.getCountryCode();
    var formattedNumber = Phoneformat.formatInternational(countryCode, phoneNumber);
    var unmaskedValue = phoneNumber.replace(/\(|\)|\-/g, '');
    if (isNaN(unmaskedValue)) {
      template.$('.js-intlSinglePhone-phoneNumber').val(formattedNumber);
    }

    // Set the phone number on the phone input object.
    if (template.data.hideDialCode) {
{'fraction_non_alphanumeric': 0.140597539543058, 'fraction_numerical': 0.00140597539543058, 'mean_word_length': 4.019400352733686, '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': '7234958', 'n_tokens_mistral': 863, 'n_tokens_neox': 836, 'n_words': 154}