text: var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
      var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
      if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
      else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
      return c > 3 && r && Object.defineProperty(target, key, r), r;
  };
  var __metadata = (this && this.__metadata) || function (k, v) {
      if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
  };
  import { Component } from '@angular/core';
  import { FormControl } from '@angular/forms';
  import { map, startWith } from 'rxjs/operators';
  var State = /** @class */ (function () {
      function State(name, population, flag) {
          this.name = name;
          this.population = population;
          this.flag = flag;
      }
      return State;
  }());
  export { State };
  var AutoCompleteComponent = /** @class */ (function () {
      function AutoCompleteComponent() {
          var _this = this;
          this.states = [
              {
                  name: 'Arkansas',
                  population: '2.978M',
                  // https://commons.wikimedia.org/wiki/File:Flag_of_Arkansas.svg
                  flag: 'https://upload.wikimedia.org/wikipedia/commons/9/9d/Flag_of_Arkansas.svg'
              },
              {
                  name: 'California',
                  population: '39.14M',
                  // https://commons.wikimedia.org/wiki/File:Flag_of_California.svg
                  flag: 'https://upload.wikimedia.org/wikipedia/commons/0/01/Flag_of_California.svg'
              },
              {
                  name: 'Florida',
                  population: '20.27M',
                  // https://commons.wikimedia.org/wiki/File:Flag_of_Florida.svg
                  flag: 'https://upload.wikimedia.org/wikipedia/commons/f/f7/Flag_of_Florida.svg'
              },
              {
                  name: 'Texas',
                  population: '27.47M',
                  // https://commons.wikimedia.org/wiki/File:Flag_of_Texas.svg
                  flag: 'https://upload.wikimedia.org/wikipedia/commons/f/f7/Flag_of_Texas.svg'
              }
          ];
          this.stateCtrl = new FormControl();
          this.filteredStates = this.stateCtrl.valueChanges.pipe(startWith(''), map(function (state) { return (state ? _this.filterStates(state) : _this.states.slice()); }));
      }
      AutoCompleteComponent.prototype.ngOnInit = function () { };
      AutoCompleteComponent.prototype.filterStates = function (name) {
          return this.states.filter(function (state) { return state.name.toLowerCase().indexOf(name.toLowerCase()) === 0; });
      };
      AutoCompleteComponent = __decorate([
          Component({
              selector: 'app-auto-complete',
              templateUrl: './auto-complete.component.html',
              styleUrls: ['./auto-complete.component.scss']
          }),
          __metadata("design:paramtypes", [])
      ], AutoCompleteComponent);
      return AutoCompleteComponent;
  }());
  export { AutoCompleteComponent };
  //# sourceMappingURL=auto-complete.component.js.map