text: 'use strict';
  
  Object.defineProperty(exports, "__esModule", {
    value: true
  });
  
  var _bindProps = require('../utils/bindProps.js');
  
  var _simulateArrowDown = require('../utils/simulateArrowDown.js');
  
  var _simulateArrowDown2 = _interopRequireDefault(_simulateArrowDown);
  
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
  
  function _objectWithoutProperties(obj, keys) { var target = {}; for (var i in obj) { if (keys.indexOf(i) >= 0) continue; if (!Object.prototype.hasOwnProperty.call(obj, i)) continue; target[i] = obj[i]; } return target; }
  
  var props = {
    bounds: {
      type: Object
    },
    defaultPlace: {
      type: String,
      default: ''
    },
    componentRestrictions: {
      type: Object,
      default: null
    },
    types: {
      type: Array,
      default: function _default() {
        return [];
      }
    },
    placeholder: {
      required: false,
      type: String
    },
    className: {
      required: false,
      type: String
    },
    label: {
      required: false,
      type: String,
      default: null
    },
    selectFirstOnEnter: {
      require: false,
      type: Boolean,
      default: false
    }
  };
  
  exports.default = {
    mounted: function mounted() {
      var _this = this;
  
      var input = this.$refs.input;
  
      // Allow default place to be set
      input.value = this.defaultPlace;
      this.$watch('defaultPlace', function () {
        input.value = _this.defaultPlace;
      });
  
      this.$gmapApiPromiseLazy().then(function () {
        var options = (0, _bindProps.getPropsValues)(_this, props);
        if (_this.selectFirstOnEnter) {
          (0, _simulateArrowDown2.default)(_this.$refs.input);
        }
  
        if (typeof google.maps.places.Autocomplete !== 'function') {
          throw new Error('google.maps.places.Autocomplete is undefined. Did you add \'places\' to libraries when loading Google Maps?');
        }
  
        _this.autoCompleter = new google.maps.places.Autocomplete(_this.$refs.input, options);
  
        var placeholder = props.placeholder,
            place = props.place,
            defaultPlace = props.defaultPlace,
            className = props.className,
            label = props.label,
            selectFirstOnEnter = props.selectFirstOnEnter,
            rest = _objectWithoutProperties(props, ['placeholder', 'place', 'defaultPlace', 'className', 'label', 'selectFirstOnEnter']); // eslint-disable-line
  
  
        (0, _bindProps.bindProps)(_this, _this.autoCompleter, rest);
  
        _this.autoCompleter.addListener('place_changed', function () {
          _this.$emit('place_changed', _this.autoCompleter.getPlace());
        });
      });
    },
    created: function created() {
      console.warn('The PlaceInput class is deprecated! Please consider using the Autocomplete input instead'); // eslint-disable-line no-console
    },
  
    props: props
  };