require('jquery');
var autoComplete = require('./autoComplete.js');

var createAutoCompleteCountries = function () {
  var $chooseCountryAutoCompleteElem = $('.js-choose-country-auto-complete');
  var $countryCodeInput = $('#countryCode');
  var suggestionDisplayTemplate = function (title, value) {
    return title + ' (+' + value + ')';
  };

  autoComplete($chooseCountryAutoCompleteElem.first(), countries, $countryCodeInput, suggestionDisplayTemplate);
};

module.exports = function () {
  createAutoCompleteCountries();
  // add other auto completes here
};

@@ -339,16 +339,78 @@
 ;%0A  %7D;%0A%0A
+  if ($chooseCountryAutoCompleteElem.length && countries) %7B%0A  
   autoCo
@@ -514,16 +514,20 @@
 plate);%0A
+  %7D%0A
 %7D;%0A%0Amodu

fix for autoComplete