define(["template7"],(function(t){var i=function(t){t&&(this.options=t,this.list=document.querySelector(this.options.listSelector),this.bind())};return i.prototype.bind=function(){var t=this.input=document.querySelector(this.options.selector);t&&(t.onkeydown=this.onkeydown.bind(this),this.options.onlyData||(t.onblur=this.onblur.bind(this)),t.onkeyup=this.onkeyup.bind(this))},i.prototype.onblur=function(t){var i=this.list.firstElementChild,e=t.target;if(i&&e){var o=e.value.toLowerCase().trim(),s=i.textContent.toLowerCase().trim();if(o===s&&o.length&&s.length){var n=document.createEvent("MouseEvents");n.initEvent("mousedown",!0,!0),i.dispatchEvent(n)}}this.list.style.display="none"},i.prototype.onkeydown=function(t){var i=t.keyCode||t.charCode,e=this.input.value;return!(t.target.className.search("disabled")>=0)&&((8===i||46===i)&&e.length-1this.options.minLength?this.createRequest(i):i||(this.list.innerHTML="",this.options.callback&&this.options.callback([])));switch(e){case 40:this.move("bottom");break;case 38:this.move("top");break;case 13:this.close()}return!i||i.length36&&t<=40||t>15&&t<19||t>47&&t<58},i.prototype.move=function(t){var i=this.list.querySelectorAll("li"),e=this.list.querySelector(".active");if(i&&i.length){if(!e&&"bottom"===t)return i[0].classList.add("active"),void(this.options.select&&this.options.select(i[0]));var o=[].indexOf.call(i,e),s="bottom"===t?i[++o]:i[--o];if(s){if(this.removeClass(i,"active"),s.classList.add("active"),this.dropdownHeight()'+o[0]+""):t},i.prototype.spinner=function(t){var i=this.input.parentNode,e=i.querySelector(".loading_indicator");e&&(e.style.display=t?"block":"none")},i.prototype.updateOptions=function(t){this.options=Z.extend(this.options,t)},i.prototype.bindItems=function(){for(var t,i=this.list.querySelectorAll("li"),e=i.length;e--;)t=i[e],t.onmouseenter=this.mouseenter.bind(this)},i.prototype.mouseenter=function(){this.removeClass(this.list.querySelectorAll("li"),"active")},i.prototype.removeClass=function(t,i){[].forEach.call(t,(function(t){t.classList.remove(i)}))},i.prototype.dropdownHeight=function(){return this.list.getBoundingClientRect().top+parseInt(getComputedStyle(this.list).maxHeight,10)},i.prototype.dropdownRowOffsetHeight=function(t){var i=getComputedStyle(t);return t.offsetHeight+parseInt(i.marginTop,10)+parseInt(i.marginBottom,10)},i.prototype.dropdownScrollTopTo=function(t){this.list.scrollTop=this.list.scrollTop+t},i.prototype.dropdownRowTop=function(t){return t.getBoundingClientRect().top-(this.list.getBoundingClientRect().top+parseInt(getComputedStyle(this.list).paddingTop,10))},i})); //# sourceMappingURL=autocomplete-d366183edb.min.js.map