/** 
 * 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.multiselect.min",["kendo.list.min","kendo.mobile.scroller.min"],e)}(function(){return function(e,t){function a(e,t){var a;if(null===e&&null!==t||null!==e&&null===t)return!1;if(a=e.length,a!==t.length)return!1;for(;a--;)if(e[a]!==t[a])return!1;return!0}var i=window.kendo,n=i.ui,s=n.List,l=i.keys,o=i._activeElement,r=i.data.ObservableArray,u=e.proxy,c="id",d="li",p="accept",_="filter",h="rebind",f="open",m="close",g="change",v="progress",T="select",w="deselect",b="aria-disabled",k="k-state-focused",y="k-loading-hidden",x="k-state-hover",C="k-state-disabled",I="disabled",V="readonly",S=".kendoMultiSelect",D="click"+S,O="keydown"+S,L="mouseenter"+S,F="mouseleave"+S,B=L+" "+F,E=/"/g,A=e.isArray,M=["font-family","font-size","font-stretch","font-style","font-weight","letter-spacing","text-transform","line-height"],H=s.extend({init:function(t,a){var n,l,o=this;o.ns=S,s.fn.init.call(o,t,a),o._optionsMap={},o._customOptions={},o._wrapper(),o._tagList(),o._input(),o._textContainer(),o._loader(),o._clearButton(),o._tabindex(o.input),t=o.element.attr("multiple","multiple").hide(),a=o.options,a.placeholder||(a.placeholder=t.data("placeholder")),n=t.attr(c),n&&(o._tagID=n+"_tag_active",n+="_taglist",o.tagList.attr(c,n)),o._aria(n),o._dataSource(),o._ignoreCase(),o._popup(),o._tagTemplate(),o.requireValueMapper(o.options),o._initList(),o._reset(),o._enable(),o._placeholder(),a.autoBind?o.dataSource.fetch():a.value&&o._preselect(a.value),l=e(o.element).parents("fieldset").is(":disabled"),l&&o.enable(!1),i.notify(o)},options:{name:"MultiSelect",tagMode:"multiple",enabled:!0,autoBind:!0,autoClose:!0,highlightFirst:!0,dataTextField:"",dataValueField:"",filter:"startswith",ignoreCase:!0,minLength:1,enforceMinLength:!1,delay:100,value:null,maxSelectedItems:null,placeholder:"",height:200,animation:{},virtual:!1,itemTemplate:"",tagTemplate:"",groupTemplate:"#:data#",fixedGroupTemplate:"#:data#",clearButton:!0},events:[f,m,g,T,w,"filtering","dataBinding","dataBound"],setDataSource:function(e){this.options.dataSource=e,this._state="",this._dataSource(),this.listView.setDataSource(this.dataSource),this.options.autoBind&&this.dataSource.fetch()},setOptions:function(e){var t=this._listOptions(e);s.fn.setOptions.call(this,e),this.listView.setOptions(t),this._accessors(),this._aria(this.tagList.attr(c)),this._tagTemplate()},currentTag:function(e){var a=this;return e===t?a._currentTag:(a._currentTag&&(a._currentTag.removeClass(k).removeAttr(c),a.input.removeAttr("aria-activedescendant")),e&&(e.addClass(k).attr(c,a._tagID),a.input.attr("aria-activedescendant",a._tagID)),a._currentTag=e,t)},dataItems:function(){return this.listView.selectedDataItems()},destroy:function(){var e=this,t=e.ns;clearTimeout(e._busy),clearTimeout(e._typingTimeout),e.wrapper.off(t),e.tagList.off(t),e.input.off(t),e._clear.off(t),s.fn.destroy.call(e)},_activateItem:function(){s.fn._activateItem.call(this),this.currentTag(null)},_listOptions:function(t){var a=this,n=s.fn._listOptions.call(a,e.extend(t,{selectedItemChange:u(a._selectedItemChange,a),selectable:"multiple"})),l=this.options.itemTemplate||this.options.template,o=n.itemTemplate||l||n.template;return o||(o="#:"+i.expr(n.dataTextField,"data")+"#"),n.template=o,n},_setListValue:function(){s.fn._setListValue.call(this,this._initialValues.slice(0))},_listChange:function(e){var a,i=this.dataSource.flatView(),n=this._optionsMap,s=this._value;for(this._state===h&&(this._state=""),a=0;a<e.added.length;a++)if(n[s(e.added[a].dataItem)]===t){this._render(i);break}this._selectValue(e.added,e.removed)},_selectedItemChange:function(e){var t,a,i=e.items;for(a=0;a<i.length;a++)t=i[a],this.tagList.children().eq(t.index).children("span:first").html(this.tagTextTemplate(t.item))},_wrapperMousedown:function(t){var a=this,n="input"!==t.target.nodeName.toLowerCase(),s=e(t.target),l=s.hasClass("k-select")||s.hasClass("k-icon");l&&(l=!s.closest(".k-select").children(".k-i-arrow-s").length),!n||l&&i.support.mobileOS||t.preventDefault(),l||(a.input[0]!==o()&&n&&a.input.focus(),1===a.options.minLength&&a.open())},_inputFocus:function(){this._placeholder(!1),this.wrapper.addClass(k)},_inputFocusout:function(){var e=this;clearTimeout(e._typingTimeout),e.wrapper.removeClass(k),e._placeholder(!e.listView.selectedDataItems()[0],!0),e.close(),e._state===_&&(e._state=p,e.listView.skipUpdate(!0)),e.element.blur()},_removeTag:function(e){var a,i,n=this,s=n._state,l=e.index(),o=n.listView,r=o.value()[l],u=n.listView.selectedDataItems()[l],c=n._customOptions[r];return n.trigger(w,{dataItem:u,item:e})?(n._close(),t):(c!==t||s!==p&&s!==_||(c=n._optionsMap[r]),i=function(){n.currentTag(null),n._change(),n._close()},c===t?o.select(o.select()[l]).done(i):(a=n.element[0].children[c],a.selected=!1,o.removeAt(l),e.remove(),i()),t)},_tagListClick:function(t){var a=e(t.currentTarget);a.children(".k-i-arrow-s").length||this._removeTag(a.closest(d))},_clearClick:function(){this.value(null),this.trigger("change")},_editable:function(t){var a=this,i=t.disable,n=t.readonly,s=a.wrapper.off(S),l=a.tagList.off(S),o=a.element.add(a.input.off(S));n||i?(i?s.addClass(C):s.removeClass(C),o.attr(I,i).attr(V,n).attr(b,i)):(s.removeClass(C).on(B,a._toggleHover).on("mousedown"+S+" touchend"+S,u(a._wrapperMousedown,a)),a.input.on(O,u(a._keydown,a)).on("paste"+S,u(a._search,a)).on("focus"+S,u(a._inputFocus,a)).on("focusout"+S,u(a._inputFocusout,a)),a._clear.on("click"+S,u(a._clearClick,a)),o.removeAttr(I).removeAttr(V).attr(b,!1),l.on(L,d,function(){e(this).addClass(x)}).on(F,d,function(){e(this).removeClass(x)}).on(D,"li.k-button .k-select",u(a._tagListClick,a)))},_close:function(){var e=this;e.options.autoClose?e.close():e.popup.position()},_filterSource:function(e,t){t||(t=this._retrieveData),this._retrieveData=!1,s.fn._filterSource.call(this,e,t)},close:function(){this.popup.close()},open:function(){var e=this;e._request&&(e._retrieveData=!1),e._retrieveData||!e.listView.bound()||e._state===p?(e._open=!0,e._state=h,e.listView.skipUpdate(!0),e._filterSource()):e._allowOpening()&&(e.popup.open(),e._focusItem())},toggle:function(e){e=e!==t?e:!this.popup.visible(),this[e?f:m]()},refresh:function(){this.listView.refresh()},_listBound:function(){var e=this,a=e.dataSource.flatView(),i=e.listView.skip();e._render(a),e._renderFooter(),e._renderNoData(),e._toggleNoData(!a.length),e._resizePopup(),e._open&&(e._open=!1,e.toggle(e._allowOpening())),e.popup.position(),!e.options.highlightFirst||i!==t&&0!==i||e.listView.focusFirst(),e._touchScroller&&e._touchScroller.reset(),e._hideBusy(),e._makeUnselectable(),e.trigger("dataBound")},_inputValue:function(){var e=this,t=e.input.val();return e.options.placeholder===t&&(t=""),t},value:function(e){var a=this,i=a.listView,n=i.value().slice(),s=a.options.maxSelectedItems,l=i.bound()&&i.isFiltered();return e===t?n:(a.requireValueMapper(a.options,e),e=a._normalizeValues(e),null!==s&&e.length>s&&(e=e.slice(0,s)),l&&a._clearFilter(),i.value(e),a._old=i.value(),l||a._fetchData(),t)},_preselect:function(t,a){var n=this;A(t)||t instanceof i.data.ObservableArray||(t=[t]),(e.isPlainObject(t[0])||t[0]instanceof i.data.ObservableObject||!n.options.dataValueField)&&(n.dataSource.data(t),n.value(a||n._initialValues),n._retrieveData=!0)},_setOption:function(e,t){var a=this.element[0].children[this._optionsMap[e]];a&&(a.selected=t)},_fetchData:function(){var e=this,t=!!e.dataSource.view().length,a=0===e.listView.value().length;a||e._request||(e._retrieveData||!e._fetch&&!t)&&(e._fetch=!0,e._retrieveData=!1,e.dataSource.read().done(function(){e._fetch=!1}))},_isBound:function(){return this.listView.bound()&&!this._retrieveData},_dataSource:function(){var e=this,t=e.element,a=e.options,n=a.dataSource||{};n=A(n)?{data:n}:n,n.select=t,n.fields=[{field:a.dataTextField},{field:a.dataValueField}],e.dataSource&&e._refreshHandler?e._unbindDataSource():(e._progressHandler=u(e._showBusy,e),e._errorHandler=u(e._hideBusy,e)),e.dataSource=i.data.DataSource.create(n).bind(v,e._progressHandler).bind("error",e._errorHandler)},_reset:function(){var t=this,a=t.element,i=a.attr("form"),n=i?e("#"+i):a.closest("form");n[0]&&(t._resetHandler=function(){setTimeout(function(){t.value(t._initialValues),t._placeholder()})},t._form=n.on("reset",t._resetHandler))},_initValue:function(){var e=this.options.value||this.element.val();this._old=this._initialValues=this._normalizeValues(e)},_normalizeValues:function(t){var a=this;return null===t?t=[]:t&&e.isPlainObject(t)?t=[a._value(t)]:t&&e.isPlainObject(t[0])?t=e.map(t,function(e){return a._value(e)}):A(t)||t instanceof r?A(t)&&(t=t.slice()):t=[t],t},_change:function(){var e=this,t=e.value();a(t,e._old)||(e._old=t.slice(),e.trigger(g),e.element.trigger(g))},_click:function(e){var t=this,a=e.item;e.preventDefault(),t._select(a).done(function(){t._change(),t._close()})},_keydown:function(a){var n,s=this,o=a.keyCode,r=s._currentTag,u=s.listView,c=u.focus(),d=s.input.val(),p=i.support.isRtl(s.wrapper),_=s.popup.visible();if(o===l.DOWN){if(a.preventDefault(),!_)return s.open(),c||u.focusFirst(),t;c?(u.focusNext(),u.focus()||u.focusLast()):u.focusFirst()}else if(o===l.UP)_&&(c&&u.focusPrev(),u.focus()||s.close()),a.preventDefault();else if(o===l.LEFT&&!p||o===l.RIGHT&&p)d||(r=r?r.prev():e(s.tagList[0].lastChild),r[0]&&s.currentTag(r));else if(o===l.RIGHT&&!p||o===l.LEFT&&p)!d&&r&&(r=r.next(),s.currentTag(r[0]?r:null));else if(o===l.ENTER&&_)s._select(c).done(function(){s._change(),s._close()}),a.preventDefault();else if(o===l.ESC)_?a.preventDefault():s.currentTag(null),s.close();else if(o===l.HOME)_?u.focusFirst():d||(r=s.tagList[0].firstChild,r&&s.currentTag(e(r)));else if(o===l.END)_?u.focusLast():d||(r=s.tagList[0].lastChild,r&&s.currentTag(e(r)));else if(o!==l.DELETE&&o!==l.BACKSPACE||d)!s.popup.visible()||o!==l.PAGEDOWN&&o!==l.PAGEUP?(clearTimeout(s._typingTimeout),setTimeout(function(){s._scale()}),s._search()):(a.preventDefault(),n=o===l.PAGEDOWN?1:-1,u.scrollWith(n*u.screenHeight()));else{if("single"===s.options.tagMode)return u.value([]),s._change(),s._close(),t;o!==l.BACKSPACE||r||(r=e(s.tagList[0].lastChild)),r&&r[0]&&s._removeTag(r)}},_hideBusy:function(){var e=this;clearTimeout(e._busy),e.input.attr("aria-busy",!1),e._loading.addClass(y),e._request=!1,e._busy=null,e._showClear()},_showBusyHandler:function(){this.input.attr("aria-busy",!0),this._loading.removeClass(y),this._hideClear()},_showBusy:function(){var e=this;e._request=!0,e._busy||(e._busy=setTimeout(u(e._showBusyHandler,e),100))},_placeholder:function(e,a){var n=this,s=n.input,l=o(),r=n.options.placeholder,u=s.val(),c=s[0]===l,d=u.length;c&&!n.options.autoClose&&u!==r||(d=0,u=""),e===t&&(e=!1,s[0]!==l&&(e=!n.listView.selectedDataItems()[0])),n._prev=u,s.toggleClass("k-readonly",e).val(e?r:u),c&&!a&&i.caret(s[0],d,d),n._scale()},_scale:function(){var e,t=this,a=t.wrapper,i=a.width(),n=t._span.text(t.input.val());a.is(":visible")?e=n.width()+25:(n.appendTo(document.documentElement),i=e=n.width()+25,n.appendTo(a)),t.input.width(e>i?i:e)},_option:function(e,a,n){var s="<option";return e!==t&&(e+="",e.indexOf('"')!==-1&&(e=e.replace(E,"&quot;")),s+=' value="'+e+'"'),n&&(s+=" selected"),s+=">",a!==t&&(s+=i.htmlEncode(a)),s+="</option>"},_render:function(e){var t,a,i,n,s,l,o=this.listView.selectedDataItems(),r=this.listView.value(),u=e.length,c="";for(r.length!==o.length&&(o=this._buildSelectedItems(r)),s={},l={},n=0;n<u;n++)a=e[n],i=this._value(a),t=this._selectedItemIndex(i,o),t!==-1&&o.splice(t,1),l[i]=n,c+=this._option(i,this._text(a),t!==-1);if(o.length)for(n=0;n<o.length;n++)a=o[n],i=this._value(a),s[i]=u,l[i]=u,u+=1,c+=this._option(i,this._text(a),!0);this._customOptions=s,this._optionsMap=l,this.element.html(c)},_buildSelectedItems:function(e){var t,a,i=this.options.dataValueField,n=this.options.dataTextField,s=[];for(a=0;a<e.length;a++)t={},t[i]=e[a],t[n]=e[a],s.push(t);return s},_selectedItemIndex:function(e,t){for(var a=this._value,i=0;i<t.length;i++)if(e===a(t[i]))return i;return-1},_search:function(){var e=this;e._typingTimeout=setTimeout(function(){var t=e.input.val();e._prev!==t&&(e._prev=t,e.search(t))},e.options.delay)},_allowOpening:function(){return this._allowSelection()&&s.fn._allowOpening.call(this)},_allowSelection:function(){var e=this.options.maxSelectedItems;return null===e||e>this.listView.value().length},_angularTagItems:function(t){var a=this;a.angular(t,function(){return{elements:a.tagList[0].children,data:e.map(a.dataItems(),function(e){return{dataItem:e}})}})},_selectValue:function(e,t){var a,i,n,s=this,l=s.value(),o=s.dataSource.total(),r=s.tagList,u=s._value;if(s._angularTagItems("cleanup"),"multiple"===s.options.tagMode){for(n=t.length-1;n>-1;n--)a=t[n],r[0].removeChild(r[0].children[a.position]),s._setOption(u(a.dataItem),!1);for(n=0;n<e.length;n++)i=e[n],r.append(s.tagTemplate(i.dataItem)),s._setOption(u(i.dataItem),!0)}else{for((!s._maxTotal||s._maxTotal<o)&&(s._maxTotal=o),r.html(""),l.length&&r.append(s.tagTemplate({values:l,dataItems:s.dataItems(),maxTotal:s._maxTotal,currentTotal:o})),n=t.length-1;n>-1;n--)s._setOption(u(t[n].dataItem),!1);for(n=0;n<e.length;n++)s._setOption(u(e[n].dataItem),!0)}s._angularTagItems("compile"),s._placeholder()},_select:function(t){var a,i,n,s,l=e.Deferred().resolve();return t?(a=this,i=a.listView,n=i.dataItemByIndex(i.getElementIndex(t)),s=t.hasClass("k-state-selected"),a._state===h&&(a._state=""),a._allowSelection()?a.trigger(s?w:T,{dataItem:n,item:t})?(a._close(),l):i.select(t).done(function(){a._placeholder(),a._state===_&&(a._state=p,i.skipUpdate(!0))}):l):l},_input:function(){var t=this,a=t.element,i=a[0].accessKey,n=t._innerWrapper.children("input.k-input");n[0]||(n=e('<input class="k-input" style="width: 25px" />').appendTo(t._innerWrapper)),a.removeAttr("accesskey"),t._focused=t.input=n.attr({accesskey:i,autocomplete:"off",role:"listbox",title:a[0].title,"aria-expanded":!1})},_tagList:function(){var t=this,a=t._innerWrapper.children("ul");a[0]||(a=e('<ul role="listbox" deselectable="on" class="k-reset"/>').appendTo(t._innerWrapper)),t.tagList=a},_tagTemplate:function(){var e,t=this,a=t.options,n=a.tagTemplate,s=a.dataSource,l="multiple"===a.tagMode;t.element[0].length&&!s&&(a.dataTextField=a.dataTextField||"text",a.dataValueField=a.dataValueField||"value"),e=l?i.template("#:"+i.expr(a.dataTextField,"data")+"#",{useWithBlock:!1}):i.template("#:values.length# item(s) selected"),t.tagTextTemplate=n=n?i.template(n):e,t.tagTemplate=function(e){return'<li class="k-button" deselectable="on"><span deselectable="on">'+n(e)+'</span><span unselectable="on" aria-label="'+(l?"delete":"open")+'" class="k-select"><span class="k-icon '+(l?"k-i-close":"k-i-arrow-s")+'"></span></span></li>'}},_loader:function(){this._loading=e('<span class="k-icon k-i-loading '+y+'"></span>').insertAfter(this.input)},_clearButton:function(){this._clear=e('<span deselectable="on" class="k-icon k-i-close" title="clear"></span>').attr({role:"button",tabIndex:-1}),this.options.clearButton&&this._clear.insertAfter(this.input)},_textContainer:function(){var t=i.getComputedStyles(this.input[0],M);t.position="absolute",t.visibility="hidden",t.top=-3333,t.left=-3333,this._span=e("<span/>").css(t).appendTo(this.wrapper)},_wrapper:function(){var t=this,a=t.element,i=a.parent("span.k-multiselect");i[0]||(i=a.wrap('<div class="k-widget k-multiselect k-header" deselectable="on" />').parent(),i[0].style.cssText=a[0].style.cssText,i[0].title=a[0].title,e('<div class="k-multiselect-wrap k-floatwrap" deselectable="on" />').insertBefore(a)),t.wrapper=i.addClass(a[0].className).css("display",""),t._innerWrapper=e(i[0].firstChild)}});n.plugin(H)}(window.kendo.jQuery),window.kendo},"function"==typeof define&&define.amd?define:function(e,t,a){(a||t)()});
//# sourceMappingURL=kendo.multiselect.min.js.map
