/** 
 * Kendo UI v2016.3.1118 (http://www.telerik.com/kendo-ui)                                                                                                                                              
 * Copyright 2016 Telerik AD. All rights reserved.                                                                                                                                                      
 *                                                                                                                                                                                                      
 * Kendo UI commercial licenses may be obtained at                                                                                                                                                      
 * http://www.telerik.com/purchase/license-agreement/kendo-ui-complete                                                                                                                                  
 * If you do not own a commercial license, this file shall be governed by the trial license terms.                                                                                                      
                                                                                                                                                                                                       
                                                                                                                                                                                                       
                                                                                                                                                                                                       
                                                                                                                                                                                                       
                                                                                                                                                                                                       
                                                                                                                                                                                                       
                                                                                                                                                                                                       
                                                                                                                                                                                                       
                                                                                                                                                                                                       
                                                                                                                                                                                                       
                                                                                                                                                                                                       
                                                                                                                                                                                                       
                                                                                                                                                                                                       
                                                                                                                                                                                                       
                                                                                                                                                                                                       

*/
!function(e,define){define("kendo.autocomplete.min",["kendo.list.min","kendo.mobile.scroller.min"],e)}(function(){return function(e,t){function s(e,t,s){return s?t.substring(0,e).split(s).length-1:0}function i(e,t,i){return t.split(i)[s(e,t,i)]}function a(e,t,i,a,n){var o=t.split(a);return o.splice(s(e,t,a),1,i),a&&""!==o[o.length-1]&&o.push(""),o.join(n)}var n=window.kendo,o=n.support,r=n.caret,l=n._activeElement,c=o.placeholder,u=n.ui,d=u.List,p=n.keys,_=n.data.DataSource,h="aria-disabled",f="aria-readonly",g="change",m="k-state-default",v="disabled",y="readonly",w="k-state-focused",k="k-state-selected",b="k-state-disabled",x="k-state-hover",C=".kendoAutoComplete",T="mouseenter"+C+" mouseleave"+C,S=e.proxy,V=d.extend({init:function(t,s){var i,a,o=this;o.ns=C,s=e.isArray(s)?{dataSource:s}:s,d.fn.init.call(o,t,s),t=o.element,s=o.options,s.placeholder=s.placeholder||t.attr("placeholder"),c&&t.attr("placeholder",s.placeholder),o._wrapper(),o._loader(),o._clearButton(),o._dataSource(),o._ignoreCase(),t[0].type="text",i=o.wrapper,o._popup(),t.addClass("k-input").on("keydown"+C,S(o._keydown,o)).on("keypress"+C,S(o._keypress,o)).on("paste"+C,S(o._search,o)).on("focus"+C,function(){o._prev=o._accessor(),o._oldText=o._prev,o._placeholder(!1),i.addClass(w)}).on("focusout"+C,function(){o._change(),o._placeholder(),i.removeClass(w)}).attr({autocomplete:"off",role:"textbox","aria-haspopup":!0}),o._clear.on("click"+C,S(o._clearValue,o)),o._enable(),o._old=o._accessor(),t[0].id&&t.attr("aria-owns",o.ul[0].id),o._aria(),o._placeholder(),o._initList(),a=e(o.element).parents("fieldset").is(":disabled"),a&&o.enable(!1),o.listView.bind("click",function(e){e.preventDefault()}),o._resetFocusItemHandler=e.proxy(o._resetFocusItem,o),n.notify(o)},options:{name:"AutoComplete",enabled:!0,suggest:!1,template:"",groupTemplate:"#:data#",fixedGroupTemplate:"#:data#",dataTextField:"",minLength:1,enforceMinLength:!1,delay:200,height:200,filter:"startswith",ignoreCase:!0,highlightFirst:!1,separator:null,placeholder:"",animation:{},virtual:!1,value:null,clearButton:!0},_dataSource:function(){var e=this;e.dataSource&&e._refreshHandler?e._unbindDataSource():(e._progressHandler=S(e._showBusy,e),e._errorHandler=S(e._hideBusy,e)),e.dataSource=_.create(e.options.dataSource).bind("progress",e._progressHandler).bind("error",e._errorHandler)},setDataSource:function(e){this.options.dataSource=e,this._dataSource(),this.listView.setDataSource(this.dataSource)},events:["open","close",g,"select","filtering","dataBinding","dataBound"],setOptions:function(e){var t=this._listOptions(e);d.fn.setOptions.call(this,e),this.listView.setOptions(t),this._accessors(),this._aria()},_listOptions:function(t){var s=d.fn._listOptions.call(this,e.extend(t,{skipUpdateOnBind:!0}));return s.dataValueField=s.dataTextField,s.selectedItemChange=null,s},_editable:function(e){var t=this,s=t.element,i=t.wrapper.off(C),a=e.readonly,n=e.disable;a||n?(i.addClass(n?b:m).removeClass(n?m:b),s.attr(v,n).attr(y,a).attr(h,n).attr(f,a)):(i.addClass(m).removeClass(b).on(T,t._toggleHover),s.removeAttr(v).removeAttr(y).attr(h,!1).attr(f,!1))},close:function(){var e=this,t=e.listView.focus();t&&t.removeClass(k),e.popup.close()},destroy:function(){var e=this;e.element.off(C),e._clear.off(C),e.wrapper.off(C),d.fn.destroy.call(e)},refresh:function(){this.listView.refresh()},select:function(e){this._select(e)},search:function(t){var s,a=this,n=a.options,o=n.ignoreCase,l=a._separator();t=t||a._accessor(),clearTimeout(a._typingTimeout),l&&(t=i(r(a.element)[0],t,l)),s=t.length,(!n.enforceMinLength&&!s||s>=n.minLength)&&(a._open=!0,a._mute(function(){this.listView.value([])}),a._filterSource({value:o?t.toLowerCase():t,operator:n.filter,field:n.dataTextField,ignoreCase:o}),a.one("close",e.proxy(a._unifySeparators,a)))},suggest:function(e){var i,a=this,n=a._last,o=a._accessor(),c=a.element[0],u=r(c)[0],_=a._separator(),h=o.split(_),f=s(u,o,_),g=u;return n==p.BACKSPACE||n==p.DELETE?(a._last=t,t):(e=e||"","string"!=typeof e&&(e[0]&&(e=a.dataSource.view()[d.inArray(e[0],a.ul[0])]),e=e?a._text(e):""),u<=0&&(u=o.toLowerCase().indexOf(e.toLowerCase())+1),i=o.substring(0,u).lastIndexOf(_),i=i>-1?u-(i+_.length):u,o=h[f].substring(0,i),e&&(e=""+e,i=e.toLowerCase().indexOf(o.toLowerCase()),i>-1&&(e=e.substring(i+o.length),g=u+e.length,o+=e),_&&""!==h[h.length-1]&&h.push("")),h[f]=o,a._accessor(h.join(_||"")),c===l()&&r(c,u,g),t)},value:function(e){return e===t?this._accessor():(this.listView.value(e),this._accessor(e),this._old=this._accessor(),this._oldText=this._accessor(),t)},_click:function(e){var s=e.item,i=this,a=i.element,n=i.listView.dataItemByIndex(i.listView.getElementIndex(s));return e.preventDefault(),i._active=!0,i.trigger("select",{dataItem:n,item:s})?(i.close(),t):(i._oldText=a.val(),i._select(s).done(function(){i._blur(),r(a,a.val().length)}),t)},_clearText:e.noop,_resetFocusItem:function(){var e=this.options.highlightFirst?0:-1;this.options.virtual&&this.listView.scrollTo(0),this.listView.focus(e)},_listBound:function(){var e,s=this,i=s.popup,a=s.options,n=s.dataSource.flatView(),o=n.length,r=s.element[0]===l();s._renderFooter(),s._renderNoData(),s._toggleNoData(!n.length),s._resizePopup(),i.position(),o&&a.suggest&&r&&s.suggest(n[0]),s._open&&(s._open=!1,e=s._allowOpening()?"open":"close",s._typingTimeout&&!r&&(e="close"),o&&(s._resetFocusItem(),a.virtual&&s.popup.unbind("activate",s._resetFocusItemHandler).one("activate",s._resetFocusItemHandler)),i[e](),s._typingTimeout=t),s._touchScroller&&s._touchScroller.reset(),s._hideBusy(),s._makeUnselectable(),s.trigger("dataBound")},_mute:function(e){this._muted=!0,e.call(this),this._muted=!1},_listChange:function(){var e=this._active||this.element[0]===l();e&&!this._muted&&this._selectValue(this.listView.selectedDataItems()[0])},_selectValue:function(e){var t=this._separator(),s="";e&&(s=this._text(e)),null===s&&(s=""),t&&(s=a(r(this.element)[0],this._accessor(),s,t,this._defaultSeparator())),this._prev=s,this._accessor(s),this._placeholder()},_unifySeparators:function(){return this._accessor(this.value().split(this._separator()).join(this._defaultSeparator())),this},_change:function(){var e=this,t=e._unifySeparators().value(),s=t!==d.unifyType(e._old,typeof t),i=s&&!e._typing,a=e._oldText!==t;e._old=t,e._oldText=t,(i||a)&&e.element.trigger(g),s&&e.trigger(g),e.typing=!1},_accessor:function(e){var s=this,i=s.element[0];return e===t?(e=i.value,i.className.indexOf("k-readonly")>-1&&e===s.options.placeholder?"":e):(i.value=null===e?"":e,s._placeholder(),t)},_keydown:function(e){var t,s,i=this,a=e.keyCode,n=i.listView,o=i.popup.visible(),r=n.focus();if(i._last=a,a===p.DOWN)o&&this._move(r?"focusNext":"focusFirst"),e.preventDefault();else if(a===p.UP)o&&this._move(r?"focusPrev":"focusLast"),e.preventDefault();else if(a===p.ENTER||a===p.TAB){if(a===p.ENTER&&o&&e.preventDefault(),o&&r){if(t=n.dataItemByIndex(n.getElementIndex(r)),i.trigger("select",{dataItem:t,item:r}))return;this._select(r)}this._blur()}else a===p.ESC?(o&&e.preventDefault(),i.close()):!i.popup.visible()||a!==p.PAGEDOWN&&a!==p.PAGEUP?i._search():(e.preventDefault(),s=a===p.PAGEDOWN?1:-1,n.scrollWith(s*n.screenHeight()))},_keypress:function(){this._oldText=this.element.val(),this._typing=!0},_move:function(e){this.listView[e](),this.options.suggest&&this.suggest(this.listView.focus())},_hideBusy:function(){var e=this;clearTimeout(e._busy),e._loading.hide(),e.element.attr("aria-busy",!1),e._busy=null,e._showClear()},_showBusy:function(){var e=this;e._busy||(e._busy=setTimeout(function(){e.element.attr("aria-busy",!0),e._loading.show(),e._hideClear()},100))},_placeholder:function(e){if(!c){var s,i=this,a=i.element,n=i.options.placeholder;if(n){if(s=a.val(),e===t&&(e=!s),e||(n=s!==n?s:""),s===i._old&&!e)return;a.toggleClass("k-readonly",e).val(n),n||a[0]!==document.activeElement||r(a[0],0,0)}}},_separator:function(){var e=this.options.separator;return e instanceof Array?RegExp(e.join("|"),"gi"):e},_defaultSeparator:function(){var e=this.options.separator;return e instanceof Array?e[0]:e},_inputValue:function(){return this.element.val()},_search:function(){var e=this;clearTimeout(e._typingTimeout),e._typingTimeout=setTimeout(function(){e._prev!==e._accessor()&&(e._prev=e._accessor(),e.search())},e.options.delay)},_select:function(e){var t=this;return t._active=!0,t.listView.select(e).done(function(){t._active=!1})},_loader:function(){this._loading=e('<span class="k-icon k-i-loading" style="display:none"></span>').insertAfter(this.element)},_clearButton:function(){this._clear=e('<span unselectable="on" class="k-icon k-i-close" title="clear"></span>').attr({role:"button",tabIndex:-1}),this.options.clearButton&&this._clear.insertAfter(this.element)},_toggleHover:function(t){e(t.currentTarget).toggleClass(x,"mouseenter"===t.type)},_wrapper:function(){var e,t=this,s=t.element,i=s[0];e=s.parent(),e.is("span.k-widget")||(e=s.wrap("<span />").parent()),e.attr("tabindex",-1),e.attr("role","presentation"),e[0].style.cssText=i.style.cssText,s.css({width:"100%",height:i.style.height}),t._focused=t.element,t.wrapper=e.addClass("k-widget k-autocomplete k-header").addClass(i.className)}});u.plugin(V)}(window.kendo.jQuery),window.kendo},"function"==typeof define&&define.amd?define:function(e,t,s){(s||t)()});
//# sourceMappingURL=kendo.autocomplete.min.js.map
