var a,b;a=this,b=function(){"use strict";function i(e,t){for(var n=0;n").concat(e,"")},c=function(e,o,r){var s=document.createDocumentFragment();o.forEach(function(e,t){var n=document.createElement(r.element),i=o[t].index;n.setAttribute(a,i),n.setAttribute("class",l),r.content?r.content(e,n):n.innerHTML=e.match||e,s.appendChild(n)}),e.appendChild(s)},p=function(t,n,i,o){function r(e){c.classList.remove(h),a=1===e?c.nextSibling:c.previousSibling}function s(e){(c=e).classList.add(h)}var a,l=n.childNodes,u=l.length-1,c=void 0;t.onkeydown=function(e){if(0a.threshold&&o.replace(/ /g,"").length;if(e){var s=a.resultsList.view;g(s);r?a.listMatchedResults(a.dataStream,t).then(function(e){n(t,e),a.resultsList.render&&(0===e.list.length&&a.noResults?a.noResults():(c(s,e.list,a.resultItem),a.onSelection&&(a.resultsList.navigation?a.resultsList.navigation(t,l,s,a.onSelection,e):p(l,s,a.onSelection,e))))}):n(t)}else!e&&r&&a.listMatchedResults(a.dataStream,t).then(function(e){n(t,e)})}(t)})}this.trigger.event.forEach(function(e){l.addEventListener(e,function(n,i){var o;return function(){var e=this,t=arguments;clearTimeout(o),o=setTimeout(function(){return n.apply(e,t)},i)}}(function(e){return t(e)},a.debounce))})}},{key:"init",value:function(){var t=this;this.data.cache?Promise.resolve(this.data.src()).then(function(e){t.dataStream=e,t.ignite()}):this.ignite(),y.initElementClosestPolyfill()}}]),K}()},"object"==typeof exports&&"undefined"!=typeof module?module.exports=b():"function"==typeof define&&define.amd?define(b):a.autoComplete=b();