// Generated by CoffeeScript 1.4.0
(function() {

  $(function() {
    var address_timeout;
    address_timeout = 0;
    return $('.cs-home-address-search').on('keyup change', function() {
      var $this;
      $this = $(this);
      if ($this.val().length < 4) {
        return;
      }
      clearTimeout(address_timeout);
      return address_timeout = setTimeout((function() {
        return ymaps.geocode($this.val()).then(function(res) {
          var coords;
          coords = res.geoObjects.get(0).geometry.getCoordinates();
          map.panTo(coords, {
            fly: true,
            checkZoomRange: true
          }).then(function() {
            return map.zoomRange.get(coords).then(function(zoomRange) {
              return map.setZoom(zoomRange[1], {
                duration: 500
              });
            });
          });
          return add_event_coords(coords);
        });
      }), 300);
    });
  });

}).call(this);
