text: !function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e(require("@angular/core"),require("@angular/common"),require("@angular/forms"),require("@angular/platform-browser")):"function"==typeof define&&define.amd?define(["@angular/core","@angular/common","@angular/forms","@angular/platform-browser"],e):"object"==typeof exports?exports["ng2-select-compat.umd.min"]=e(require("@angular/core"),require("@angular/common"),require("@angular/forms"),require("@angular/platform-browser")):t["ng2-select-compat.umd.min"]=e(t["@angular/core"],t["@angular/common"],t["@angular/forms"],t["@angular/platform-browser"])}(this,function(t,e,i,n){return function(t){function e(n){if(i[n])return i[n].exports;var o=i[n]={i:n,l:!1,exports:{}};return t[n].call(o.exports,o,o.exports,e),o.l=!0,o.exports}var i={};return e.m=t,e.c=i,e.i=function(t){return t},e.d=function(t,i,n){e.o(t,i)||Object.defineProperty(t,i,{configurable:!1,enumerable:!0,get:n})},e.n=function(t){var i=t&&t.__esModule?function(){return t.default}:function(){return t};return e.d(i,"a",i),i},e.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},e.p="/",e(e.s=10)}([function(e,i){e.exports=t},function(t,e,i){"use strict";function n(t){return t.replace(/([.?*+^$[\]\\(){}|-])/g,"\\$1")}e.escapeRegexp=n},function(t,e,i){"use strict";function n(t){var e=/<\/?([a-z][a-z0-9]*)\b[^>]*>/gi,i=/<!--[\s\S]*?-->|<\?(?:php)?[\s\S]*?\?>/gi;return t.replace(i,"").replace(e,"")}var o=this&&this.__decorate||function(t,e,i,n){var o,r=arguments.length,s=r<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,i,n);else for(var c=t.length-1;c>=0;c--)(o=t[c])&&(s=(r<3?o(s):r>3?o(e,i,s):o(e,i))||s);return r>3&&s&&Object.defineProperty(e,i,s),s},r=i(0),s=i(1),c=function(){function t(){}return t.prototype.transform=function(t,e){if(e.length<1)return t;if(e){var i=new RegExp("<[^<>]*>","ig"),n=t.match(i),o=t.replace(i,"$!$");t=o.replace(new RegExp(s.escapeRegexp(e),"gi"),"<strong>$&</strong>");for(var r=0;t.indexOf("$!$")>-1;r++)t=t.replace("$!$",n[r])}return t},t}();c=o([r.Pipe({name:"highlight"})],c),e.HighlightPipe=c,e.stripTags=n},function(t,e,i){"use strict";var n=this&&this.__decorate||function(t,e,i,n){var o,r=arguments.length,s=r<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,i,n);else for(var c=t.length-1;c>=0;c--)(o=t[c])&&(s=(r<3?o(s):r>3?o(e,i,s):o(e,i))||s);return r>3&&s&&Object.defineProperty(e,i,s),s},o=this&&this.__metadata||function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},r=i(0),s=function(){function t(){}return t.prototype.onClick=function(t){t.stopPropagation()},t.prototype.ngOnInit=function(){var t=this;setTimeout(function(){"undefined"!=typeof document&&document.addEventListener("click",t.offClickHandler)},0)},t.prototype.ngOnDestroy=function(){"undefined"!=typeof document&&document.removeEventListener("click",this.offClickHandler)},t}();n([r.Input("offClick"),o("design:type",Object)],s.prototype,"offClickHandler",void 0),n([r.HostListener("click",["$event"]),o("design:type",Function),o("design:paramtypes",[MouseEvent]),o("design:returntype",void 0)],s.prototype,"onClick",null),s=n([r.Directive({selector:"[offClick]"})],s),e.OffClickDirective=s},function(t,e,i){"use strict";var n=function(){function t(e){var i=this;"string"==typeof e&&(this.id=this.text=e),"object"==typeof e&&(this.id=e.id||e.text,this.text=e.text,e.children&&e.text&&(this.children=e.children.map(function(e){var n=new t(e);return n.parent=i,n}),this.text=e.text))}return t.prototype.fillChildrenHash=function(t,e){var i=e;return this.children.map(function(e){t.set(e.id,i++)}),i},t.prototype.hasChildren=function(){return this.children&&this.children.length>0},t.prototype.getSimilar=function(){var e=new t(!1);return e.id=this.id,e.text=this.text,e.parent=this.parent,e},t}();e.SelectItem=n},function(t,e,i){"use strict";var n=this&&this.__extends||function(t,e){function i(){this.constructor=t}for(var n in e)e.hasOwnProperty(n)&&(t[n]=e[n]);t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)},o=this&&this.__decorate||function(t,e,i,n){var o,r=arguments.length,s=r<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,i,n);else for(var c=t.length-1;c>=0;c--)(o=t[c])&&(s=(r<3?o(s):r>3?o(e,i,s):o(e,i))||s);return r>3&&s&&Object.defineProperty(e,i,s),s},r=this&&this.__metadata||function(t,e){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,e)},s=i(0),c=i(8),a=i(9),l=i(4),p=i(2),h=i(1),u="\n  .ui-select-toggle {\n    position: relative;\n  }\n\n  /* Fix caret going into new line in Firefox */\n  .ui-select-placeholder {\n    float: left;\n  }\n  \n  /* Fix Bootstrap dropdown position when inside a input-group */\n  .input-group > .dropdown {\n    /* Instead of relative */\n    position: static;\n  }\n  \n  .ui-select-match > .btn {\n    /* Instead of center because of .btn */\n    text-align: left !important;\n  }\n  \n  .ui-select-match > .caret {\n    position: absolute;\n    top: 45%;\n    right: 15px;\n  }\n  \n  .ui-disabled {\n    background-color: #eceeef;\n    border-radius: 4px;\n    position: absolute;\n    width: 100%;\n    height: 100%;\n    z-index: 5;\n    opacity: 0.6;\n    top: 0;\n    left: 0;\n    cursor: not-allowed;\n  }\n  \n  .ui-select-choices {\n    width: 100%;\n    height: auto;\n    max-height: 200px;\n    overflow-x: hidden;\n    margin-top: 0;\n  }\n  \n  .ui-select-multiple .ui-select-choices {\n    margin-top: 1px;\n  }\n  .ui-select-choices-row>a {\n      display: block;\n      padding: 3px 20px;\n      clear: both;\n      font-weight: 400;\n      line-height: 1.42857143;\n      color: #333;\n      white-space: nowrap;\n  }\n  .ui-select-choices-row.active>a {\n      color: #fff;\n      text-decoration: none;\n      outline: 0;\n      background-color: #428bca;\n  }\n  \n  .ui-select-multiple {\n    height: auto;\n    padding:3px 3px 0 3px;\n  }\n  \n  .ui-select-multiple input.ui-select-search {\n    background-color: transparent !important; /* To prevent double background when disabled */\n    border: none;\n    outline: none;\n    box-shadow: none;\n    height: 1.6666em;\n    padding: 0;\n    margin-bottom: 3px;\n    \n  }\n  .ui-select-match .close {\n      font-size: 1.6em;\n      line-height: 0.75;\n  }\n  \n  .ui-select-multiple .ui-select-match-item {\n    outline: 0;\n    margin: 0 3px 3px 0;\n  }\n  .ui-select-toggle > .caret {\n      position: absolute;\n      height: 10px;\n      top: 50%;\n      right: 10px;\n      margin-top: -2px;\n  }\n",d=m=function(){function t(t,e){this.sanitizer=e,this.allowClear=!1,this.placeholder="",this.idField="id",this.textField="text",this.childrenField="children",this.multiple=!1,this.data=new s.EventEmitter,this.selected=new s.EventEmitter,this.removed=new s.EventEmitter,this.typed=new s.EventEmitter,this.opened=new s.EventEmitter,this.options=[],this.itemObjects=[],this.onChange=Function.prototype,this.onTouched=Function.prototype,this.inputMode=!1,this._optionsOpened=!1,this.inputValue="",this._items=[],this._disabled=!1,this._active=[],this.element=t,this.clickedOutside=this.clickedOutside.bind(this)}return Object.defineProperty(t.prototype,"items",{set:function(t){var e=this;t?(this._items=t.filter(function(t){if("string"==typeof t||"object"==typeof t&&t&&t[e.textField]&&t[e.idField])return t}),this.itemObjects=this._items.map(function(t){return"string"==typeof t?new l.SelectItem(t):new l.SelectItem({id:t[e.idField],text:t[e.textField],children:t[e.childrenField]})})):this._items=this.itemObjects=[]},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"disabled",{get:function(){return this._disabled},set:function(t){this._disabled=t,this._disabled===!0&&this.hideOptions()},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"active",{get:function(){return this._active},set:function(t){var e=this;if(t&&0!==t.length){var i="string"==typeof t[0];this._active=t.map(function(t){var n=i?t:{id:t[e.idField],text:t[e.textField]};return new l.SelectItem(n)})}else this._active=[]},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"optionsOpened",{get:function(){return this._optionsOpened},set:function(t){this._optionsOpened=t,this.opened.emit(t)},enumerable:!0,configurable:!0}),t.prototype.sanitize=function(t){return this.sanitizer.bypassSecurityTrustHtml(t)},t.prototype.inputEvent=function(t,e){if(void 0===e&&(e=!1),9!==t.keyCode){if(e&&(37===t.keyCode||39===t.keyCode||38===t.keyCode||40===t.keyCode||13===t.keyCode))return void t.preventDefault();if(!e&&8===t.keyCode){var i=this.element.nativeElement.querySelector("div.ui-select-container > input");(!i.value||i.value.length<=0)&&(this.active.length>0&&this.remove(this.active[this.active.length-1]),t.preventDefault())}if(!e&&27===t.keyCode)return this.hideOptions(),this.element.nativeElement.children[0].focus(),void t.preventDefault();if(e||46!==t.keyCode||(this.active.length>0&&this.remove(this.active[this.active.length-1]),t.preventDefault()),!e&&37===t.keyCode&&this._items.length>0)return this.behavior.first(),void t.preventDefault();if(!e&&39===t.keyCode&&this._items.length>0)return this.behavior.last(),void t.preventDefault();if(!e&&38===t.keyCode)return this.behavior.prev(),void t.preventDefault();if(!e&&40===t.keyCode)return this.behavior.next(),void t.preventDefault();if(!e&&13===t.keyCode)return this.active.indexOf(this.activeOption)===-1&&(this.selectActiveMatch(),this.behavior.next()),void t.preventDefault();var n=t.target||t.srcElement;n&&n.value?(this.inputValue=n.value,this.behavior.filter(new RegExp(h.escapeRegexp(this.inputValue),"ig")),this.doEvent("typed",this.inputValue)):this.open()}},t.prototype.ngOnInit=function(){this.behavior=this.firstItemHasChildren?new g(this):new v(this)},t.prototype.remove=function(t){if(this._disabled!==!0){if(this.multiple===!0&&this.active){var e=this.active.indexOf(t);this.active.splice(e,1),this.data.next(this.active),this.doEvent("removed",t)}this.multiple===!1&&(this.active=[],this.data.next(this.active),this.doEvent("removed",t))}},t.prototype.doEvent=function(t,e){this[t]&&e&&this[t].next(e),this.onTouched(),"selected"!==t&&"removed"!==t||this.onChange(this.active)},t.prototype.clickedOutside=function(){this.inputMode=!1,this.optionsOpened=!1},Object.defineProperty(t.prototype,"firstItemHasChildren",{get:function(){return this.itemObjects[0]&&this.itemObjects[0].hasChildren()},enumerable:!0,configurable:!0}),t.prototype.writeValue=function(t){this.active=t,this.data.emit(this.active)},t.prototype.registerOnChange=function(t){this.onChange=t},t.prototype.registerOnTouched=function(t){this.onTouched=t},t.prototype.matchClick=function(t){this._disabled!==!0&&(this.inputMode=!this.inputMode,this.inputMode===!0&&(this.multiple===!0&&t||this.multiple===!1)&&(this.focusToInput(),this.open()))},t.prototype.mainClick=function(t){if(this.inputMode!==!0&&this._disabled!==!0){if(46===t.keyCode)return t.preventDefault(),void this.inputEvent(t);if(8===t.keyCode)return t.preventDefault(),void this.inputEvent(t,!0);if(9===t.keyCode||13===t.keyCode||27===t.keyCode||t.keyCode>=37&&t.keyCode<=40)return void t.preventDefault();this.inputMode=!0;var e=String.fromCharCode(96<=t.keyCode&&t.keyCode<=105?t.keyCode-48:t.keyCode).toLowerCase();this.focusToInput(e),this.open();var i=t.target||t.srcElement;i.value=e,this.inputEvent(t)}},t.prototype.selectActive=function(t){this.activeOption=t},t.prototype.isActive=function(t){return this.activeOption.id===t.id},t.prototype.removeClick=function(t,e){e.stopPropagation(),this.remove(t)},t.prototype.focusToInput=function(t){var e=this;void 0===t&&(t=""),setTimeout(function(){var i=e.element.nativeElement.querySelector("div.ui-select-container > input");i&&(i.focus(),i.value=t)},0)},t.prototype.open=function(){var t=this;this.options=this.itemObjects.filter(function(e){return t.multiple===!1||t.multiple===!0&&!t.active.find(function(t){return e.text===t.text})}),this.options.length>0&&this.behavior.first(),this.optionsOpened=!0},t.prototype.hideOptions=function(){this.inputMode=!1,this.optionsOpened=!1},t.prototype.selectActiveMatch=function(){this.selectMatch(this.activeOption)},t.prototype.selectMatch=function(t,e){void 0===e&&(e=void 0),e&&(e.stopPropagation(),e.preventDefault()),this.options.length<=0||(this.multiple===!0&&(this.active.push(t),this.data.next(this.active)),this.multiple===!1&&(this.active[0]=t,this.data.next(this.active[0])),this.doEvent("selected",t),this.hideOptions(),this.multiple===!0?this.focusToInput(""):(this.focusToInput(p.stripTags(t.text)),this.element.nativeElement.querySelector(".ui-select-container").focus()))},t}();o([s.Input(),r("design:type",Boolean)],d.prototype,"allowClear",void 0),o([s.Input(),r("design:type",String)],d.prototype,"placeholder",void 0),o([s.Input(),r("design:type",String)],d.prototype,"idField",void 0),o([s.Input(),r("design:type",String)],d.prototype,"textField",void 0),o([s.Input(),r("design:type",String)],d.prototype,"childrenField",void 0),o([s.Input(),r("design:type",Boolean)],d.prototype,"multiple",void 0),o([s.Input(),r("design:type",Array),r("design:paramtypes",[Array])],d.prototype,"items",null),o([s.Input(),r("design:type",Boolean),r("design:paramtypes",[Boolean])],d.prototype,"disabled",null),o([s.Input(),r("design:type",Array),r("design:paramtypes",[Array])],d.prototype,"active",null),o([s.Output(),r("design:type",s.EventEmitter)],d.prototype,"data",void 0),o([s.Output(),r("design:type",s.EventEmitter)],d.prototype,"selected",void 0),o([s.Output(),r("design:type",s.EventEmitter)],d.prototype,"removed",void 0),o([s.Output(),r("design:type",s.EventEmitter)],d.prototype,"typed",void 0),o([s.Output(),r("design:type",s.EventEmitter)],d.prototype,"opened",void 0),d=m=o([s.Component({selector:"ng-select",styles:[u],providers:[{provide:c.NG_VALUE_ACCESSOR,useExisting:s.forwardRef(function(){return m}),multi:!0}],template:'\n  <div tabindex="0"\n     *ngIf="multiple === false"\n     (keyup)="mainClick($event)"\n     [offClick]="clickedOutside"\n     class="ui-select-container dropdown open show">\n    <div [ngClass]="{\'ui-disabled\': disabled}"></div>\n    <div class="ui-select-match"\n         *ngIf="!inputMode">\n      <span tabindex="-1"\n          class="btn btn-default btn-secondary form-control ui-select-toggle"\n          (click)="matchClick($event)"\n          style="outline: 0;">\n        <span *ngIf="active.length <= 0" class="ui-select-placeholder text-muted">{{placeholder}}</span>\n        <span *ngIf="active.length > 0" class="ui-select-match-text pull-left"\n              [ngClass]="{\'ui-select-allow-clear\': allowClear && active.length > 0}"\n              [innerHTML]="sanitize(active[0].text)"></span>\n        <i class="dropdown-toggle pull-right"></i>\n        <i class="caret pull-right"></i>\n        <a *ngIf="allowClear && active.length>0" class="btn btn-xs btn-link pull-right" style="margin-right: 10px; padding: 0;" (click)="removeClick(active[0], $event)">\n           <i class="glyphicon glyphicon-remove"></i>\n        </a>\n      </span>\n    </div>\n    <input type="text" autocomplete="false" tabindex="-1"\n           (keydown)="inputEvent($event)"\n           (keyup)="inputEvent($event, true)"\n           [disabled]="disabled"\n           class="form-control ui-select-search"\n           *ngIf="inputMode"\n           placeholder="{{active.length <= 0 ? placeholder : \'\'}}">\n     <!-- options template -->\n     <ul *ngIf="optionsOpened && options && options.length > 0 && !firstItemHasChildren"\n          class="ui-select-choices dropdown-menu" role="menu">\n        <li *ngFor="let o of options" role="menuitem">\n          <div class="ui-select-choices-row"\n               [class.active]="isActive(o)"\n               (mouseenter)="selectActive(o)"\n               (click)="selectMatch(o, $event)">\n            <a href="javascript:void(0)" class="dropdown-item">\n              <div [innerHtml]="sanitize(o.text | highlight:inputValue)"></div>\n            </a>\n          </div>\n        </li>\n      </ul>\n  \n      <ul *ngIf="optionsOpened && options && options.length > 0 && firstItemHasChildren"\n          class="ui-select-choices dropdown-menu" role="menu">\n        <li *ngFor="let c of options; let index=index" role="menuitem">\n          <div class="divider dropdown-divider" *ngIf="index > 0"></div>\n          <div class="dropdown-header">{{c.text}}</div>\n  \n          <div *ngFor="let o of c.children"\n               class="ui-select-choices-row"\n               [class.active]="isActive(o)"\n               (mouseenter)="selectActive(o)"\n               (click)="selectMatch(o, $event)"\n               [ngClass]="{\'active\': isActive(o)}">\n            <a href="javascript:void(0)" class="dropdown-item">\n              <div [innerHtml]="sanitize(o.text | highlight:inputValue)"></div>\n            </a>\n          </div>\n        </li>\n      </ul>\n  </div>\n\n  <div tabindex="0"\n     *ngIf="multiple === true"\n     (keyup)="mainClick($event)"\n     (focus)="focusToInput(\'\')"\n     [offClick]="clickedOutside"\n     class="ui-select-container ui-select-multiple dropdown form-control open">\n    <div [ngClass]="{\'ui-disabled\': disabled}"></div>\n    <span class="ui-select-match">\n        <span *ngFor="let a of active">\n            <span class="ui-select-match-item btn btn-default btn-secondary btn-xs"\n                  tabindex="-1"\n                  type="button"\n                  [ngClass]="{\'btn-default\': true}">\n               <a class="close"\n                  style="margin-left: 5px; padding: 0;"\n                  (click)="removeClick(a, $event)">&times;</a>\n               <span [innerHtml]="sanitize(a.text)"></span>\n           </span>\n        </span>\n    </span>\n    <input type="text"\n           (keydown)="inputEvent($event)"\n           (keyup)="inputEvent($event, true)"\n           (click)="matchClick($event)"\n           [disabled]="disabled"\n           autocomplete="false"\n           autocorrect="off"\n           autocapitalize="off"\n           spellcheck="false"\n           class="form-control ui-select-search"\n           placeholder="{{active.length <= 0 ? placeholder : \'\'}}"\n           role="combobox">\n     <!-- options template -->\n     <ul *ngIf="optionsOpened && options && options.length > 0 && !firstItemHasChildren"\n          class="ui-select-choices dropdown-menu" role="menu">\n        <li *ngFor="let o of options" role="menuitem">\n          <div class="ui-select-choices-row"\n               [class.active]="isActive(o)"\n               (mouseenter)="selectActive(o)"\n               (click)="selectMatch(o, $event)">\n            <a href="javascript:void(0)" class="dropdown-item">\n              <div [innerHtml]="sanitize(o.text | highlight:inputValue)"></div>\n            </a>\n          </div>\n        </li>\n      </ul>\n  \n      <ul *ngIf="optionsOpened && options && options.length > 0 && firstItemHasChildren"\n          class="ui-select-choices dropdown-menu" role="menu">\n        <li *ngFor="let c of options; let index=index" role="menuitem">\n          <div class="divider dropdown-divider" *ngIf="index > 0"></div>\n          <div class="dropdown-header">{{c.text}}</div>\n  \n          <div *ngFor="let o of c.children"\n               class="ui-select-choices-row"\n               [class.active]="isActive(o)"\n               (mouseenter)="selectActive(o)"\n               (click)="selectMatch(o, $event)"\n               [ngClass]="{\'active\': isActive(o)}">\n            <a href="javascript:void(0)" class="dropdown-item">\n              <div [innerHtml]="sanitize(o.text | highlight:inputValue)"></div>\n            </a>\n          </div>\n        </li>\n      </ul>\n  </div>\n  '}),r("design:paramtypes",[s.ElementRef,a.DomSanitizer])],d),e.SelectComponent=d;var f=function(){function t(t){this.optionsMap=new Map,this.actor=t}return t.prototype.fillOptionsMap=function(){var t=this;this.optionsMap.clear();var e=0;this.actor.itemObjects.map(function(i){e=i.fillChildrenHash(t.optionsMap,e)})},t.prototype.ensureHighlightVisible=function(t){void 0===t&&(t=void 0);var e=this.actor.element.nativeElement.querySelector(".ui-select-choices-content");if(e){var i=e.querySelectorAll(".ui-select-choices-row");if(!(i.length<1)){var n=this.getActiveIndex(t);if(!(n<0)){var o=i[n];if(o){var r=o.offsetTop+o.clientHeight-e.scrollTop,s=e.offsetHeight;r>s?e.scrollTop+=r-s:r<o.clientHeight&&(e.scrollTop-=o.clientHeight-r)}}}}},t.prototype.getActiveIndex=function(t){void 0===t&&(t=void 0);var e=this.actor.options.indexOf(this.actor.activeOption);return e<0&&void 0!==t&&(e=t.get(this.actor.activeOption.id)),e},t}();e.Behavior=f;var v=function(t){function e(e){return t.call(this,e)||this}return n(e,t),e.prototype.first=function(){this.actor.activeOption=this.actor.options[0],t.prototype.ensureHighlightVisible.call(this)},e.prototype.last=function(){this.actor.activeOption=this.actor.options[this.actor.options.length-1],t.prototype.ensureHighlightVisible.call(this)},e.prototype.prev=function(){var e=this.actor.options.indexOf(this.actor.activeOption);this.actor.activeOption=this.actor.options[e-1<0?this.actor.options.length-1:e-1],t.prototype.ensureHighlightVisible.call(this)},e.prototype.next=function(){var e=this.actor.options.indexOf(this.actor.activeOption);this.actor.activeOption=this.actor.options[e+1>this.actor.options.length-1?0:e+1],t.prototype.ensureHighlightVisible.call(this)},e.prototype.filter=function(e){var i=this,n=this.actor.itemObjects.filter(function(t){return p.stripTags(t.text).match(e)&&(i.actor.multiple===!1||i.actor.multiple===!0&&i.actor.active.map(function(t){return t.id}).indexOf(t.id)<0)});this.actor.options=n,this.actor.options.length>0&&(this.actor.activeOption=this.actor.options[0],t.prototype.ensureHighlightVisible.call(this))},e}(f);e.GenericBehavior=v;var g=function(t){function e(e){return t.call(this,e)||this}return n(e,t),e.prototype.first=function(){this.actor.activeOption=this.actor.options[0].children[0],this.fillOptionsMap(),this.ensureHighlightVisible(this.optionsMap)},e.prototype.last=function(){this.actor.activeOption=this.actor.options[this.actor.options.length-1].children[this.actor.options[this.actor.options.length-1].children.length-1],this.fillOptionsMap(),this.ensureHighlightVisible(this.optionsMap)},e.prototype.prev=function(){var t=this,e=this.actor.options.findIndex(function(e){return t.actor.activeOption.parent&&t.actor.activeOption.parent.id===e.id}),i=this.actor.options[e].children.findIndex(function(e){return t.actor.activeOption&&t.actor.activeOption.id===e.id});this.actor.activeOption=this.actor.options[e].children[i-1],this.actor.activeOption||this.actor.options[e-1]&&(this.actor.activeOption=this.actor.options[e-1].children[this.actor.options[e-1].children.length-1]),this.actor.activeOption||this.last(),this.fillOptionsMap(),this.ensureHighlightVisible(this.optionsMap)},e.prototype.next=function(){var t=this,e=this.actor.options.findIndex(function(e){return t.actor.activeOption.parent&&t.actor.activeOption.parent.id===e.id}),i=this.actor.options[e].children.findIndex(function(e){return t.actor.activeOption&&t.actor.activeOption.id===e.id});this.actor.activeOption=this.actor.options[e].children[i+1],this.actor.activeOption||this.actor.options[e+1]&&(this.actor.activeOption=this.actor.options[e+1].children[0]),this.actor.activeOption||this.first(),this.fillOptionsMap(),this.ensureHighlightVisible(this.optionsMap)},e.prototype.filter=function(e){for(var i=[],n=new Map,o=0,r=0,s=this.actor.itemObjects;r<s.length;r++){var c=s[r],a=c.children.filter(function(t){return e.test(t.text)});if(o=c.fillChildrenHash(n,o),a.length>0){var l=c.getSimilar();l.children=a,i.push(l)}}this.actor.options=i,this.actor.options.length>0&&(this.actor.activeOption=this.actor.options[0].children[0],t.prototype.ensureHighlightVisible.call(this,n))},e}(f);e.ChildrenBehavior=g;var m},function(t,e,i){"use strict";var n=this&&this.__decorate||function(t,e,i,n){var o,r=arguments.length,s=r<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,i,n);else for(var c=t.length-1;c>=0;c--)(o=t[c])&&(s=(r<3?o(s):r>3?o(e,i,s):o(e,i))||s);return r>3&&s&&Object.defineProperty(e,i,s),s},o=i(0),r=i(7),s=i(5),c=i(2),a=i(3),l=function(){function t(){}return t}();l=n([o.NgModule({imports:[r.CommonModule],declarations:[s.SelectComponent,c.HighlightPipe,a.OffClickDirective],exports:[s.SelectComponent,c.HighlightPipe,a.OffClickDirective]})],l),e.SelectModule=l},function(t,i){t.exports=e},function(t,e){t.exports=i},function(t,e){t.exports=n},function(t,e,i){"use strict";function n(t){for(var i in t)e.hasOwnProperty(i)||(e[i]=t[i])}n(i(1)),n(i(3)),n(i(6)),n(i(5)),n(i(4)),n(i(2))}])});