(function(f,define){define([],f)})(function(){(function($,undefined){var kendo=window.kendo=window.kendo||{cultures:{}},extend=$.extend,each=$.each,isArray=$.isArray,proxy=$.proxy,noop=$.noop,math=Math,Template,JSON=window.JSON||{},support={},percentRegExp=/%/,formatRegExp=/\{(\d+)(:[^\}]+)?\}/g,boxShadowRegExp=/(\d+(?:\.?)\d*)px\s*(\d+(?:\.?)\d*)px\s*(\d+(?:\.?)\d*)px\s*(\d+)?/i,numberRegExp=/^(\+|-?)\d+(\.?)\d*$/,FUNCTION="function",STRING="string",NUMBER="number",OBJECT="object",NULL="null",BOOLEAN="boolean",UNDEFINED="undefined",getterCache={},setterCache={},slice=[].slice,globalize=window.Globalize;kendo.version="2014.2.716";function Class(){}Class.extend=function(proto){var base=function(){},member,that=this,subclass=proto&&proto.init?proto.init:function(){that.apply(this,arguments)},fn;base.prototype=that.prototype;fn=subclass.fn=subclass.prototype=new base();for(member in proto){if(proto[member]!=null&&proto[member].constructor===Object){fn[member]=extend(true,{},base.prototype[member],proto[member])}else{fn[member]=proto[member]}}fn.constructor=subclass;subclass.extend=that.extend;return subclass};Class.prototype._initOptions=function(options){this.options=deepExtend({},this.options,options)};var isFunction=kendo.isFunction=function(fn){return typeof fn==="function"};var preventDefault=function(){this._defaultPrevented=true};var isDefaultPrevented=function(){return this._defaultPrevented===true};var Observable=Class.extend({init:function(){this._events={}},bind:function(eventName,handlers,one){var that=this,idx,eventNames=typeof eventName===STRING?[eventName]:eventName,length,original,handler,handlersIsFunction=typeof handlers===FUNCTION,events;if(handlers===undefined){for(idx in eventName){that.bind(idx,eventName[idx])}return that}for(idx=0,length=eventNames.length;idx=0;idx--){if(events[idx]===handler||events[idx].original===handler){events.splice(idx,1)}}}else{that._events[eventName]=[]}}}return that}});function compilePart(part,stringPart){if(stringPart){return"'"+part.split("'").join("\\'").split('\\"').join('\\\\\\"').replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/\t/g,"\\t")+"'"}else{var first=part.charAt(0),rest=part.substring(1);if(first==="="){return"+("+rest+")+"}else{if(first===":"){return"+e("+rest+")+"}else{return";"+part+";o+="}}}}var argumentNameRegExp=/^\w+/,encodeRegExp=/\$\{([^}]*)\}/g,escapedCurlyRegExp=/\\\}/g,curlyRegExp=/__CURLY__/g,escapedSharpRegExp=/\\#/g,sharpRegExp=/__SHARP__/g,zeros=["","0","00","000","0000"];Template={paramName:"data",useWithBlock:true,render:function(template,data){var idx,length,html="";for(idx=0,length=data.length;idx99){result=math.floor(result/10)}result=pad(result)}else{if(match==="fff"){result=pad(date.getMilliseconds(),3)}else{if(match==="tt"){result=date.getHours()<12?calendar.AM[0]:calendar.PM[0]}}}}}}}}}}}}}}}}}}}}}}return result!==undefined?result:match.slice(1,match.length-1)})}function formatNumber(number,format,culture){culture=getCulture(culture);var numberFormat=culture.numberFormat,groupSize=numberFormat.groupSize[0],groupSeparator=numberFormat[COMMA],decimal=numberFormat[POINT],precision=numberFormat.decimals,pattern=numberFormat.pattern[0],literals=[],symbol,isCurrency,isPercent,customPrecision,formatAndPrecision,negative=number<0,integer,fraction,integerLength,fractionLength,replacement=EMPTY,value=EMPTY,idx,length,ch,hasGroup,hasNegativeFormat,decimalIndex,sharpIndex,zeroIndex,hasZero,hasSharp,percentIndex,currencyIndex,startZeroIndex,start=-1,end;if(number===undefined){return EMPTY}if(!isFinite(number)){return number}if(!format){return culture.name.length?number.toLocaleString():number.toString()}formatAndPrecision=standardFormatRegExp.exec(format);if(formatAndPrecision){format=formatAndPrecision[1].toLowerCase();isCurrency=format==="c";isPercent=format==="p";if(isCurrency||isPercent){numberFormat=isCurrency?numberFormat.currency:numberFormat.percent;groupSize=numberFormat.groupSize[0];groupSeparator=numberFormat[COMMA];decimal=numberFormat[POINT];precision=numberFormat.decimals;symbol=numberFormat.symbol;pattern=numberFormat.pattern[negative?0:1]}customPrecision=formatAndPrecision[2];if(customPrecision){precision=+customPrecision}if(format==="e"){return customPrecision?number.toExponential(precision):number.toExponential()}if(isPercent){number*=100}number=round(number,precision);negative=number<0;number=number.split(POINT);integer=number[0];fraction=number[1];if(negative){integer=integer.substring(1)}value=integer;integerLength=integer.length;if(integerLength>=groupSize){value=EMPTY;for(idx=0;idx0&&(integerLength-idx)%groupSize===0){value+=groupSeparator}value+=integer.charAt(idx)}}if(fraction){value+=decimal+fraction}if(format==="n"&&!negative){return value}number=EMPTY;for(idx=0,length=pattern.length;idx-1||format.indexOf('"')>-1||format.indexOf("\\")>-1){format=format.replace(literalRegExp,function(match){var quoteChar=match.charAt(0).replace("\\",""),literal=match.slice(1).replace(quoteChar,"");literals.push(literal);return PLACEHOLDER})}format=format.split(";");if(negative&&format[1]){format=format[1];hasNegativeFormat=true}else{if(number===0){format=format[2]||format[0];if(format.indexOf(SHARP)==-1&&format.indexOf(ZERO)==-1){return format}}else{format=format[0]}}percentIndex=format.indexOf("%");currencyIndex=format.indexOf("$");isPercent=percentIndex!=-1;isCurrency=currencyIndex!=-1;if(isPercent){number*=100}if(isCurrency&&format[currencyIndex-1]==="\\"){format=format.split("\\").join("");isCurrency=false}if(isCurrency||isPercent){numberFormat=isCurrency?numberFormat.currency:numberFormat.percent;groupSize=numberFormat.groupSize[0];groupSeparator=numberFormat[COMMA];decimal=numberFormat[POINT];precision=numberFormat.decimals;symbol=numberFormat.symbol}hasGroup=format.indexOf(COMMA)>-1;if(hasGroup){format=format.replace(commaRegExp,EMPTY)}decimalIndex=format.indexOf(POINT);length=format.length;if(decimalIndex!=-1){fraction=number.toString().split("e");if(fraction[1]){fraction=round(number,Math.abs(fraction[1]))}else{fraction=fraction[0]}fraction=fraction.split(POINT)[1]||EMPTY;zeroIndex=format.lastIndexOf(ZERO)-decimalIndex;sharpIndex=format.lastIndexOf(SHARP)-decimalIndex;hasZero=zeroIndex>-1;hasSharp=sharpIndex>-1;idx=fraction.length;if(!hasZero&&!hasSharp){format=format.substring(0,decimalIndex)+format.substring(decimalIndex+1);length=format.length;decimalIndex=-1;idx=0}if(hasZero&&zeroIndex>sharpIndex){idx=zeroIndex}else{if(sharpIndex>zeroIndex){if(hasSharp&&idx>sharpIndex){idx=sharpIndex}else{if(hasZero&&idx-1){number=round(number,idx)}}else{number=round(number)}sharpIndex=format.indexOf(SHARP);startZeroIndex=zeroIndex=format.indexOf(ZERO);if(sharpIndex==-1&&zeroIndex!=-1){start=zeroIndex}else{if(sharpIndex!=-1&&zeroIndex==-1){start=sharpIndex}else{start=sharpIndex>zeroIndex?zeroIndex:sharpIndex}}sharpIndex=format.lastIndexOf(SHARP);zeroIndex=format.lastIndexOf(ZERO);if(sharpIndex==-1&&zeroIndex!=-1){end=zeroIndex}else{if(sharpIndex!=-1&&zeroIndex==-1){end=sharpIndex}else{end=sharpIndex>zeroIndex?sharpIndex:zeroIndex}}if(start==length){end=start}if(start!=-1){value=number.toString().split(POINT);integer=value[0];fraction=value[1]||EMPTY;integerLength=integer.length;fractionLength=fraction.length;if(negative&&(number*-1)>=0){negative=false}if(hasGroup){if(integerLength===groupSize&&integerLengthgroupSize){value=EMPTY;for(idx=0;idx0&&(integerLength-idx)%groupSize===0){value+=groupSeparator}value+=integer.charAt(idx)}integer=value}}}number=format.substring(0,start);if(negative&&!hasNegativeFormat){number+="-"}for(idx=start;idx-1){number+=integer;idx=decimalIndex}if(decimalIndex===idx){number+=(fraction?decimal:EMPTY)+fraction;idx+=end-decimalIndex+1;continue}}if(ch===ZERO){number+=ch;replacement=ch}else{if(ch===SHARP){number+=replacement}}}if(end>=start){number+=format.substring(end+1)}if(isCurrency||isPercent){value=EMPTY;for(idx=0,length=number.length;idx=start&&value<=end)}function designatorPredicate(designator){return designator.charAt(0)}function mapDesignators(designators){return $.map(designators,designatorPredicate)}function adjustDST(date,hours){if(!hours&&date.getHours()===23){date.setHours(date.getHours()+2)}}function lowerArray(data){var idx=0,length=data.length,array=[];for(;idx0){idx-=1}return i},getNumber=function(size){var rg=numberRegExp[size]||new RegExp("^\\d{1,"+size+"}"),match=value.substr(valueIdx,size).match(rg);if(match){match=match[0];valueIdx+=match.length;return parseInt(match,10)}return null},getIndexByName=function(names,lower){var i=0,length=names.length,name,nameLength,subValue;for(;itwoDigitYearMax){year-=100}}}else{if(ch==="h"){lookAhead("h");hours=getNumber(2);if(hours==12){hours=0}if(hours===null||outOfRange(hours,0,11)){return null}}else{if(ch==="H"){lookAhead("H");hours=getNumber(2);if(hours===null||outOfRange(hours,0,23)){return null}}else{if(ch==="m"){lookAhead("m");minutes=getNumber(2);if(minutes===null||outOfRange(minutes,0,59)){return null}}else{if(ch==="s"){lookAhead("s");seconds=getNumber(2);if(seconds===null||outOfRange(seconds,0,59)){return null}}else{if(ch==="f"){count=lookAhead("f");match=value.substr(valueIdx,count).match(numberRegExp[3]);milliseconds=getNumber(count);if(milliseconds!==null){match=match[0].length;if(match<3){milliseconds*=Math.pow(10,(3-match))}if(count>3){milliseconds=parseInt(milliseconds.toString().substring(0,3),10)}}if(milliseconds===null||outOfRange(milliseconds,0,999)){return null}}else{if(ch==="t"){count=lookAhead("t");amDesignators=calendar.AM;pmDesignators=calendar.PM;if(count===1){amDesignators=mapDesignators(amDesignators);pmDesignators=mapDesignators(pmDesignators)}pmHour=getIndexByName(pmDesignators);if(!pmHour&&!getIndexByName(amDesignators)){return null}}else{if(ch==="z"){UTC=true;count=lookAhead("z");if(value.substr(valueIdx,1)==="Z"){if(!ISO8601){return null}checkLiteral();continue}matches=value.substr(valueIdx,6).match(count>2?longTimeZoneRegExp:shortTimeZoneRegExp);if(!matches){return null}matches=matches[0];valueIdx=matches.length;matches=matches.split(":");hoursOffset=parseInt(matches[0],10);if(outOfRange(hoursOffset,-12,13)){return null}if(count>2){minutesOffset=parseInt(matches[1],10);if(isNaN(minutesOffset)||outOfRange(minutesOffset,0,59)){return null}}}else{if(ch==="T"){ISO8601=checkLiteral()}else{if(ch==="'"){literal=true;checkLiteral()}else{if(!checkLiteral()){return null}}}}}}}}}}}}}}}hasTime=hours!==null||minutes!==null||seconds||null;if(year===null&&month===null&&day===null&&hasTime){year=defaultYear;month=date.getMonth();day=date.getDate()}else{if(year===null){year=defaultYear}if(day===null){day=1}}if(pmHour&&hours<12){hours+=12}if(UTC){if(hoursOffset){hours+=-hoursOffset}if(minutesOffset){minutes+=-minutesOffset}value=new Date(Date.UTC(year,month,day,hours,minutes,seconds,milliseconds))}else{value=new Date(year,month,day,hours,minutes,seconds,milliseconds);adjustDST(value,hours)}if(year<100){value.setFullYear(year)}if(value.getDate()!==day&&UTC===undefined){return null}return value}function parseMicrosoftFormatOffset(offset){var sign=offset.substr(0,1)==="-"?-1:1;offset=offset.substring(1);offset=(parseInt(offset.substr(0,2),10)*60)+parseInt(offset.substring(2),10);return sign*offset}kendo.parseDate=function(value,formats,culture){if(objectToString.call(value)==="[object Date]"){return value}var idx=0;var date=null;var length,patterns;var tzoffset;var sign;if(value&&value.indexOf("/D")===0){date=dateRegExp.exec(value);if(date){date=date[1];tzoffset=offsetRegExp.exec(date.substring(1));date=new Date(parseInt(date,10));if(tzoffset){tzoffset=parseMicrosoftFormatOffset(tzoffset[0]);date=kendo.timezone.apply(date,0);date=kendo.timezone.convert(date,0,-1*tzoffset)}return date}}culture=kendo.getCulture(culture);if(!formats){formats=[];patterns=culture.calendar.patterns;length=formatsSequence.length;for(;idx0){return null}else{negative=negative>-1}if(value.indexOf(symbol)>-1||(format&&format.toLowerCase().indexOf("c")>-1)){number=currency;parts=number.pattern[0].replace("$",symbol).split("n");if(value.indexOf(parts[0])>-1&&value.indexOf(parts[1])>-1){value=value.replace(parts[0],"").replace(parts[1],"");negative=true}}else{if(value.indexOf(percentSymbol)>-1){isPercent=true;number=percent;symbol=percentSymbol}}value=value.replace("-","").replace(symbol,"").replace(nonBreakingSpaceRegExp," ").split(number[","].replace(nonBreakingSpaceRegExp," ")).join("").replace(number["."],".");value=parseFloat(value);if(isNaN(value)){value=null}else{if(negative){value*=-1}}if(value&&isPercent){value/=100}return value};if(globalize&&!globalize.load){kendo.parseDate=function(value,format,culture){if(objectToString.call(value)==="[object Date]"){return value}return globalize.parseDate(value,format,culture)};kendo.parseFloat=function(value,culture){if(typeof value===NUMBER){return value}if(value===undefined||value===null){return null}if($.isPlainObject(culture)){culture=culture.name}value=globalize.parseFloat(value,culture);return isNaN(value)?null:value}}})();function getShadows(element){var shadow=element.css(kendo.support.transitions.css+"box-shadow")||element.css("box-shadow"),radius=shadow?shadow.match(boxShadowRegExp)||[0,0,0,0,0]:[0,0,0,0,0],blur=math.max((+radius[3]),+(radius[4]||0));return{left:(-radius[1])+blur,right:(+radius[1])+blur,bottom:(+radius[2])+blur}}function wrap(element,autosize){var browser=support.browser,percentage,isRtl=element.css("direction")=="rtl";if(!element.parent().hasClass("k-animation-container")){var shadows=getShadows(element),width=element[0].style.width,height=element[0].style.height,percentWidth=percentRegExp.test(width),percentHeight=percentRegExp.test(height);if(browser.opera){shadows.left=shadows.right=shadows.bottom=5}percentage=percentWidth||percentHeight;if(!percentWidth&&(!autosize||(autosize&&width))){width=element.outerWidth()}if(!percentHeight&&(!autosize||(autosize&&height))){height=element.outerHeight()}element.wrap($("
").addClass("k-animation-container").css({width:width,height:height,marginLeft:shadows.left*(isRtl?1:-1),paddingLeft:shadows.left,paddingRight:shadows.right,paddingBottom:shadows.bottom}));if(percentage){element.css({width:"100%",height:"100%",boxSizing:"border-box",mozBoxSizing:"border-box",webkitBoxSizing:"border-box"})}}else{var wrapper=element.parent(".k-animation-container"),wrapperStyle=wrapper[0].style;if(wrapper.is(":hidden")){wrapper.show()}percentage=percentRegExp.test(wrapperStyle.width)||percentRegExp.test(wrapperStyle.height);if(!percentage){wrapper.css({width:element.outerWidth(),height:element.outerHeight(),boxSizing:"content-box",mozBoxSizing:"content-box",webkitBoxSizing:"content-box"})}}if(browser.msie&&math.floor(browser.version)<=7){element.css({zoom:1});element.children(".k-menu").width(element.width())}return element.parent()}function deepExtend(destination){var i=1,length=arguments.length;for(i=1;i0};var table=document.createElement("table");try{table.innerHTML="";support.tbodyInnerHtml=true}catch(e){support.tbodyInnerHtml=false}support.touch="ontouchstart" in window;support.msPointers=window.MSPointerEvent;support.pointers=window.PointerEvent;var transitions=support.transitions=false,transforms=support.transforms=false,elementProto="HTMLElement" in window?HTMLElement.prototype:[];support.hasHW3D=("WebKitCSSMatrix" in window&&"m11" in new window.WebKitCSSMatrix())||"MozPerspective" in document.documentElement.style||"msPerspective" in document.documentElement.style;each(["Moz","webkit","O","ms"],function(){var prefix=this.toString(),hasTransitions=typeof table.style[prefix+"Transition"]===STRING;if(hasTransitions||typeof table.style[prefix+"Transform"]===STRING){var lowPrefix=prefix.toLowerCase();transforms={css:(lowPrefix!="ms")?"-"+lowPrefix+"-":"",prefix:prefix,event:(lowPrefix==="o"||lowPrefix==="webkit")?lowPrefix:""};if(hasTransitions){transitions=transforms;transitions.event=transitions.event?transitions.event+"TransitionEnd":"transitionend"}return false}});table=null;support.transforms=transforms;support.transitions=transitions;support.devicePixelRatio=window.devicePixelRatio===undefined?1:window.devicePixelRatio;try{support.screenWidth=window.outerWidth||window.screen?window.screen.availWidth:window.innerWidth;support.screenHeight=window.outerHeight||window.screen?window.screen.availHeight:window.innerHeight}catch(e){support.screenWidth=window.screen.availWidth;support.screenHeight=window.screen.availHeight}support.detectOS=function(ua){var os=false,minorVersion,match=[],notAndroidPhone=!/mobile safari/i.test(ua),agentRxs={fire:/(Silk)\/(\d+)\.(\d+(\.\d+)?)/,android:/(Android|Android.*(?:Opera|Firefox).*?\/)\s*(\d+)\.(\d+(\.\d+)?)/,iphone:/(iPhone|iPod).*OS\s+(\d+)[\._]([\d\._]+)/,ipad:/(iPad).*OS\s+(\d+)[\._]([\d_]+)/,meego:/(MeeGo).+NokiaBrowser\/(\d+)\.([\d\._]+)/,webos:/(webOS)\/(\d+)\.(\d+(\.\d+)?)/,blackberry:/(BlackBerry|BB10).*?Version\/(\d+)\.(\d+(\.\d+)?)/,playbook:/(PlayBook).*?Tablet\s*OS\s*(\d+)\.(\d+(\.\d+)?)/,wp:/(Windows Phone(?: OS)?)\s(\d+)\.(\d+(\.\d+)?)/,windows:/(MSIE)\s+(\d+)\.(\d+(\.\d+)?)/,tizen:/(tizen).*?Version\/(\d+)\.(\d+(\.\d+)?)/i,sailfish:/(sailfish).*rv:(\d+)\.(\d+(\.\d+)?).*firefox/i,ffos:/(Mobile).*rv:(\d+)\.(\d+(\.\d+)?).*Firefox/},osRxs={ios:/^i(phone|pad|pod)$/i,android:/^android|fire$/i,blackberry:/^blackberry|playbook/i,windows:/windows/,wp:/wp/,flat:/sailfish|ffos|tizen/i,meego:/meego/},formFactorRxs={tablet:/playbook|ipad|fire/i},browserRxs={omini:/Opera\sMini/i,omobile:/Opera\sMobi/i,firefox:/Firefox|Fennec/i,mobilesafari:/version\/.*safari/i,chrome:/chrome|crios/i,webkit:/webkit/i,ie:/MSIE|Windows\sPhone/i};for(var agent in agentRxs){if(agentRxs.hasOwnProperty(agent)){match=ua.match(agentRxs[agent]);if(match){if(agent=="windows"&&"plugins" in navigator){return false}os={};os.device=agent;os.tablet=testRx(agent,formFactorRxs,false);os.browser=testRx(ua,browserRxs,"default");os.name=testRx(agent,osRxs);os[os.name]=true;os.majorVersion=match[2];os.minorVersion=match[3].replace("_",".");minorVersion=os.minorVersion.replace(".","").substr(0,2);os.flatVersion=os.majorVersion+minorVersion+(new Array(3-(minorVersion.length<3?minorVersion.length:2)).join("0"));os.cordova=typeof window.PhoneGap!==UNDEFINED||typeof window.cordova!==UNDEFINED;os.appMode=window.navigator.standalone||(/file|local|wmapp/).test(window.location.protocol)||os.cordova;if(os.android&&(support.devicePixelRatio<1.5&&os.flatVersion<400||notAndroidPhone)&&(support.screenWidth>800||support.screenHeight>800)){os.tablet=agent}break}}}return os};var mobileOS=support.mobileOS=support.detectOS(navigator.userAgent);support.wpDevicePixelRatio=mobileOS.wp?screen.width/320:0;support.kineticScrollNeeded=mobileOS&&(support.touch||support.msPointers||support.pointers);support.hasNativeScrolling=false;if(mobileOS.ios||(mobileOS.android&&mobileOS.majorVersion>2)||mobileOS.wp){support.hasNativeScrolling=mobileOS}support.mouseAndTouchPresent=support.touch&&!(support.mobileOS.ios||support.mobileOS.android);support.detectBrowser=function(ua){var browser=false,match=[],browserRxs={webkit:/(chrome)[ \/]([\w.]+)/i,safari:/(webkit)[ \/]([\w.]+)/i,opera:/(opera)(?:.*version|)[ \/]([\w.]+)/i,msie:/(msie\s|trident.*? rv:)([\w.]+)/i,mozilla:/(mozilla)(?:.*? rv:([\w.]+)|)/i};for(var agent in browserRxs){if(browserRxs.hasOwnProperty(agent)){match=ua.match(browserRxs[agent]);if(match){browser={};browser[agent]=true;browser[match[1].toLowerCase()]=true;browser.version=parseInt(document.documentMode||match[2],10);break}}}return browser};support.browser=support.detectBrowser(navigator.userAgent);support.zoomLevel=function(){try{return support.touch?(document.documentElement.clientWidth/window.innerWidth):support.browser.msie&&support.browser.version>=10?((top||window).document.documentElement.offsetWidth/(top||window).innerWidth):1}catch(e){return 1}};support.cssBorderSpacing=typeof document.documentElement.style.borderSpacing!="undefined"&&!(support.browser.msie&&support.browser.version<8);(function(browser){var cssClass="",docElement=$(document.documentElement),majorVersion=parseInt(browser.version,10);if(browser.msie){cssClass="ie"}else{if(browser.mozilla){cssClass="ff"}else{if(browser.safari){cssClass="safari"}else{if(browser.webkit){cssClass="webkit"}else{if(browser.opera){cssClass="opera"}}}}}if(cssClass){cssClass="k-"+cssClass+" k-"+cssClass+majorVersion}if(support.mobileOS){cssClass+=" k-mobile"}docElement.addClass(cssClass)})(support.browser);support.eventCapture=document.documentElement.addEventListener;var input=document.createElement("input");support.placeholder="placeholder" in input;support.propertyChangeEvent="onpropertychange" in input;support.input=(function(){var types=["number","date","time","month","week","datetime","datetime-local"];var length=types.length;var value="test";var result={};var idx=0;var type;for(;idxb.field?1:(a.field/g;function htmlEncode(value){return(""+value).replace(ampRegExp,"&").replace(ltRegExp,"<").replace(gtRegExp,">").replace(quoteRegExp,""").replace(aposRegExp,"'")}var eventTarget=function(e){return e.target};if(support.touch){eventTarget=function(e){var touches="originalEvent" in e?e.originalEvent.changedTouches:"changedTouches" in e?e.changedTouches:null;return touches?document.elementFromPoint(touches[0].clientX,touches[0].clientY):e.target};each(["swipe","swipeLeft","swipeRight","swipeUp","swipeDown","doubleTap","tap"],function(m,value){$.fn[value]=function(callback){return this.bind(value,callback)}})}if(support.touch){if(!support.mobileOS){support.mousedown="mousedown touchstart";support.mouseup="mouseup touchend";support.mousemove="mousemove touchmove";support.mousecancel="mouseleave touchcancel";support.click="click";support.resize="resize"}else{support.mousedown="touchstart";support.mouseup="touchend";support.mousemove="touchmove";support.mousecancel="touchcancel";support.click="touchend";support.resize="orientationchange"}}else{if(support.pointers){support.mousemove="pointermove";support.mousedown="pointerdown";support.mouseup="pointerup";support.mousecancel="pointercancel";support.click="pointerup";support.resize="orientationchange resize"}else{if(support.msPointers){support.mousemove="MSPointerMove";support.mousedown="MSPointerDown";support.mouseup="MSPointerUp";support.mousecancel="MSPointerCancel";support.click="MSPointerUp";support.resize="orientationchange resize"}else{support.mousemove="mousemove";support.mousedown="mousedown";support.mouseup="mouseup";support.mousecancel="mouseleave";support.click="click";support.resize="resize"}}}var wrapExpression=function(members,paramName){var result=paramName||"d",index,idx,length,member,count=1;for(idx=0,length=members.length;idx0)||widget.is(":visible")}kendo.resize=function(element,force){var widgets=$(element).find("[data-"+kendo.ns+"role]").addBack().filter(resizableWidget);if(!widgets.length){return}var widgetsArray=$.makeArray(widgets);widgetsArray.sort(containmentComparer);$.each(widgetsArray,function(){var widget=kendo.widgetInstance($(this));if(widget){widget.resize(force)}})};kendo.parseOptions=parseOptions;extend(kendo.ui,{Widget:Widget,DataBoundWidget:DataBoundWidget,roles:{},progress:function(container,toggle){var mask=container.find(".k-loading-mask"),support=kendo.support,browser=support.browser,isRtl,leftRight,webkitCorrection,containerScrollLeft;if(toggle){if(!mask.length){isRtl=support.isRtl(container);leftRight=isRtl?"right":"left";containerScrollLeft=container.scrollLeft();webkitCorrection=browser.webkit?(!isRtl?0:container[0].scrollWidth-container.width()-2*containerScrollLeft):0;mask=$("
Loading...
").width("100%").height("100%").css("top",container.scrollTop()).css(leftRight,Math.abs(containerScrollLeft)+webkitCorrection).prependTo(container)}}else{if(mask){mask.remove()}}},plugin:function(widget,register,prefix){var name=widget.fn.options.name,getter;register=register||kendo.ui;prefix=prefix||"";register[name]=widget;register.roles[name.toLowerCase()]=widget;getter="getKendo"+prefix+name;name="kendo"+prefix+name;$.fn[name]=function(options){var value=this,args;if(typeof options===STRING){args=slice.call(arguments,1);this.each(function(){var widget=$.data(this,name),method,result;if(!widget){throw new Error(kendo.format("Cannot call method '{0}' of {1} before it is initialized",options,name))}method=widget[options];if(typeof method!==FUNCTION){throw new Error(kendo.format("Cannot find method '{0}' of {1}",options,name))}result=method.apply(widget,args);if(result!==undefined){value=result;return false}})}else{this.each(function(){new widget(this,options)})}return value};$.fn[getter]=function(){return this.data(name)}}});var ContainerNullObject={bind:function(){return this},nullObject:true,options:{}};var MobileWidget=Widget.extend({init:function(element,options){Widget.fn.init.call(this,element,options);this.element.autoApplyNS();this.wrapper=this.element;this.element.addClass("km-widget")},destroy:function(){Widget.fn.destroy.call(this);this.element.kendoDestroy()},options:{prefix:"Mobile"},events:[],view:function(){var viewElement=this.element.closest(kendo.roleSelector("view splitview modalview drawer"));return kendo.widgetInstance(viewElement,kendo.mobile.ui)||ContainerNullObject},viewHasNativeScrolling:function(){var view=this.view();return view&&view.options.useNativeScrolling},container:function(){var element=this.element.closest(kendo.roleSelector("view layout modalview drawer splitview"));return kendo.widgetInstance(element.eq(0),kendo.mobile.ui)||ContainerNullObject}});extend(kendo.mobile,{init:function(element){kendo.init(element,kendo.mobile.ui,kendo.ui,kendo.dataviz.ui)},appLevelNativeScrolling:function(){return kendo.mobile.application&&kendo.mobile.application.options&&kendo.mobile.application.options.useNativeScrolling},ui:{Widget:MobileWidget,DataBoundWidget:DataBoundWidget.extend(MobileWidget.prototype),roles:{},plugin:function(widget){kendo.ui.plugin(widget,kendo.mobile.ui,"Mobile")}}});kendo.touchScroller=function(elements,options){return $(elements).map(function(idx,element){element=$(element);if(support.kineticScrollNeeded&&kendo.mobile.ui.Scroller&&!element.data("kendoMobileScroller")){element.kendoMobileScroller(options);return element.data("kendoMobileScroller")}else{return false}})[0]};kendo.preventDefault=function(e){e.preventDefault()};kendo.widgetInstance=function(element,suites){var role=element.data(kendo.ns+"role"),widgets=[],i,length;if(role){if(role==="content"){role="scroller"}if(suites){if(suites[0]){for(i=0,length=suites.length;i=0){widgets=[kendo.getter(role)(window)]}for(i=0,length=widgets.length;i-1)}});var MOUSE_EVENTS=["mousedown","mousemove","mouseenter","mouseleave","mouseover","mouseout","mouseup","click"];var EXCLUDE_BUST_CLICK_SELECTOR="label, input, [data-rel=external]";var MouseEventNormalizer={setupMouseMute:function(){var idx=0,length=MOUSE_EVENTS.length,element=document.documentElement;if(MouseEventNormalizer.mouseTrap||!support.eventCapture){return}MouseEventNormalizer.mouseTrap=true;MouseEventNormalizer.bustClick=false;MouseEventNormalizer.captureMouse=false;var handler=function(e){if(MouseEventNormalizer.captureMouse){if(e.type==="click"){if(MouseEventNormalizer.bustClick&&!$(e.target).is(EXCLUDE_BUST_CLICK_SELECTOR)){e.preventDefault();e.stopPropagation()}}else{e.stopPropagation()}}};for(;idx-1&&this[0]!==document.documentElement){MouseEventNormalizer.setupMouseMute();var selector=args.length===2?null:args[1],bustClick=events.indexOf("click")>-1&&events.indexOf("touchend")>-1;on.call(this,{touchstart:MouseEventNormalizer.muteMouse,touchend:MouseEventNormalizer.unMuteMouse},selector,{bustClick:bustClick})}if(typeof callback===STRING){context=that.data("handler");callback=context[callback];args[args.length-1]=function(e){callback.call(context,e)}}args[0]=events;on.apply(that,args);return that},kendoDestroy:function(ns){ns=ns||this.data("kendoNS");if(ns){this.off("."+ns)}return this}});kendo.jQuery=kendoJQuery;kendo.eventMap=eventMap;kendo.timezone=(function(){var months={Jan:0,Feb:1,Mar:2,Apr:3,May:4,Jun:5,Jul:6,Aug:7,Sep:8,Oct:9,Nov:10,Dec:11};var days={Sun:0,Mon:1,Tue:2,Wed:3,Thu:4,Fri:5,Sat:6};function ruleToDate(year,rule){var date;var targetDay;var ourDay;var month=rule[3];var on=rule[4];var time=rule[5];var cache=rule[8];if(!cache){rule[8]=cache={}}if(cache[year]){return cache[year]}if(!isNaN(on)){date=new Date(Date.UTC(year,months[month],on,time[0],time[1],time[2],0))}else{if(on.indexOf("last")===0){date=new Date(Date.UTC(year,months[month]+1,1,time[0]-24,time[1],time[2],0));targetDay=days[on.substr(4,3)];ourDay=date.getUTCDay();date.setUTCDate(date.getUTCDate()+targetDay-ourDay-(targetDay>ourDay?7:0))}else{if(on.indexOf(">=")>=0){date=new Date(Date.UTC(year,months[month],on.substr(5),time[0],time[1],time[2],0));targetDay=days[on.substr(0,3)];ourDay=date.getUTCDay();date.setUTCDate(date.getUTCDate()+targetDay-ourDay+(targetDay1){offset=time[0]*60+Number(time[1])}return[-1000000,"max","-","Jan",1,[0,0,0],offset,"-"]}var year=new Date(utcTime).getUTCFullYear();rules=jQuery.grep(rules,function(rule){var from=rule[0];var to=rule[1];return from<=year&&(to>=year||(from==year&&to=="only")||to=="max")});rules.push(utcTime);rules.sort(function(a,b){if(typeof a!="number"){a=Number(ruleToDate(year,a))}if(typeof b!="number"){b=Number(ruleToDate(year,b))}return a-b});var rule=rules[jQuery.inArray(utcTime,rules)-1]||rules[rules.length-1];return isNaN(rule)?rule:null}function findZone(utcTime,zones,timezone){var zoneRules=zones[timezone];if(typeof zoneRules==="string"){zoneRules=zones[zoneRules]}if(!zoneRules){throw new Error('Timezone "'+timezone+'" is either incorrect, or kendo.timezones.min.js is not included.')}for(var idx=zoneRules.length-1;idx>=0;idx--){var until=zoneRules[idx][3];if(until&&utcTime>until){break}}var zone=zoneRules[idx+1];if(!zone){throw new Error('Timezone "'+timezone+'" not found on '+utcTime+".")}return zone}function zoneAndRule(utcTime,zones,rules,timezone){if(typeof utcTime!=NUMBER){utcTime=Date.UTC(utcTime.getFullYear(),utcTime.getMonth(),utcTime.getDate(),utcTime.getHours(),utcTime.getMinutes(),utcTime.getSeconds(),utcTime.getMilliseconds())}var zone=findZone(utcTime,zones,timezone);return{zone:zone,rule:findRule(utcTime,rules,zone[1])}}function offset(utcTime,timezone){if(timezone=="Etc/UTC"||timezone=="Etc/GMT"){return 0}var info=zoneAndRule(utcTime,this.zones,this.rules,timezone);var zone=info.zone;var rule=info.rule;return kendo.parseFloat(rule?zone[0]-rule[6]:zone[0])}function abbr(utcTime,timezone){var info=zoneAndRule(utcTime,this.zones,this.rules,timezone);var zone=info.zone;var rule=info.rule;var base=zone[2];if(base.indexOf("index.html")>=0){return base.split("index.html")[rule&&+rule[6]?1:0]}else{if(base.indexOf("%s")>=0){return base.replace("%s",(!rule||rule[7]=="-")?"":rule[7])}}return base}function convert(date,fromOffset,toOffset){if(typeof fromOffset==STRING){fromOffset=this.offset(date,fromOffset)}if(typeof toOffset==STRING){toOffset=this.offset(date,toOffset)}var fromLocalOffset=date.getTimezoneOffset();date=new Date(date.getTime()+(fromOffset-toOffset)*60000);var toLocalOffset=date.getTimezoneOffset();return new Date(date.getTime()+(toLocalOffset-fromLocalOffset)*60000)}function apply(date,timezone){return this.convert(date,date.getTimezoneOffset(),timezone)}function remove(date,timezone){return this.convert(date,timezone,date.getTimezoneOffset())}function toLocalDate(time){return this.apply(new Date(time),"Etc/UTC")}return{zones:{},rules:{},offset:offset,convert:convert,apply:apply,remove:remove,abbr:abbr,toLocalDate:toLocalDate}})();kendo.date=(function(){var MS_PER_MINUTE=60000,MS_PER_DAY=86400000;function adjustDST(date,hours){if(hours===0&&date.getHours()===23){date.setHours(date.getHours()+2);return true}return false}function setDayOfWeek(date,day,dir){var hours=date.getHours();dir=dir||1;day=((day-date.getDay())+(7*dir))%7;date.setDate(date.getDate()+day);adjustDST(date,hours)}function dayOfWeek(date,day,dir){date=new Date(date);setDayOfWeek(date,day,dir);return date}function firstDayOfMonth(date){return new Date(date.getFullYear(),date.getMonth(),1)}function lastDayOfMonth(date){var last=new Date(date.getFullYear(),date.getMonth()+1,0),first=firstDayOfMonth(date),timeOffset=Math.abs(last.getTimezoneOffset()-first.getTimezoneOffset());if(timeOffset){last.setHours(first.getHours()+(timeOffset/60))}return last}function getDate(date){date=new Date(date.getFullYear(),date.getMonth(),date.getDate(),0,0,0);adjustDST(date,0);return date}function toUtcTime(date){return Date.UTC(date.getFullYear(),date.getMonth(),date.getDate(),date.getHours(),date.getMinutes(),date.getSeconds(),date.getMilliseconds())}function getMilliseconds(date){return date.getTime()-getDate(date)}function isInTimeRange(value,min,max){var msMin=getMilliseconds(min),msMax=getMilliseconds(max),msValue;if(!value||msMin==msMax){return true}if(min>=max){max+=MS_PER_DAY}msValue=getMilliseconds(value);if(msMin>msValue){msValue+=MS_PER_DAY}if(msMax=msMin&&msValue<=msMax}function isInDateRange(value,min,max){var msMin=min.getTime(),msMax=max.getTime(),msValue;if(msMin>=msMax){msMax+=MS_PER_DAY}msValue=value.getTime();return msValue>=msMin&&msValue<=msMax}function addDays(date,offset){var hours=date.getHours();date=new Date(date);setTime(date,offset*MS_PER_DAY);adjustDST(date,hours);return date}function setTime(date,milliseconds,ignoreDST){var offset=date.getTimezoneOffset();var difference;date.setTime(date.getTime()+milliseconds);if(!ignoreDST){difference=date.getTimezoneOffset()-offset;date.setTime(date.getTime()+difference*MS_PER_MINUTE)}}function today(){return getDate(new Date())}function isToday(date){return getDate(date).getTime()==today().getTime()}function toInvariantTime(date){var staticDate=new Date(1980,1,1,0,0,0);if(date){staticDate.setHours(date.getHours(),date.getMinutes(),date.getSeconds(),date.getMilliseconds())}return staticDate}return{adjustDST:adjustDST,dayOfWeek:dayOfWeek,setDayOfWeek:setDayOfWeek,getDate:getDate,isInDateRange:isInDateRange,isInTimeRange:isInTimeRange,isToday:isToday,nextDay:function(date){return addDays(date,1)},previousDay:function(date){return addDays(date,-1)},toUtcTime:toUtcTime,MS_PER_DAY:MS_PER_DAY,MS_PER_HOUR:60*MS_PER_MINUTE,MS_PER_MINUTE:MS_PER_MINUTE,setTime:setTime,addDays:addDays,today:today,toInvariantTime:toInvariantTime,firstDayOfMonth:firstDayOfMonth,lastDayOfMonth:lastDayOfMonth,getMilliseconds:getMilliseconds}})();kendo.stripWhitespace=function(element){if(document.createNodeIterator){var iterator=document.createNodeIterator(element,NodeFilter.SHOW_TEXT,function(node){return node.parentNode==element?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_REJECT},false);while(iterator.nextNode()){if(iterator.referenceNode&&!iterator.referenceNode.textContent.trim()){iterator.referenceNode.parentNode.removeChild(iterator.referenceNode)}}}else{for(var i=0;idelay){exec()}else{timeout=setTimeout(exec,delay-elapsed)}}};kendo.caret=function(element,start,end){var rangeElement;var isPosition=start!==undefined;if(end===undefined){end=start}if(element[0]){element=element[0]}if(isPosition&&element.disabled){return}try{if(element.selectionStart!==undefined){if(isPosition){element.focus();element.setSelectionRange(start,end)}else{start=[element.selectionStart,element.selectionEnd]}}else{if(document.selection){if($(element).is(":visible")){element.focus()}rangeElement=element.createTextRange();if(isPosition){rangeElement.collapse(true);rangeElement.moveStart("character",start);rangeElement.moveEnd("character",end-start);rangeElement.select()}else{var rangeDuplicated=rangeElement.duplicate(),selectionStart,selectionEnd;rangeElement.moveToBookmark(document.selection.createRange().getBookmark());rangeDuplicated.setEndPoint("EndToStart",rangeElement);selectionStart=rangeDuplicated.text.length;selectionEnd=selectionStart+rangeElement.text.length;start=[selectionStart,selectionEnd]}}}}catch(e){start=[]}return start}})(jQuery);(function($,undefined){var kendo=window.kendo,CHANGE="change",BACK="back",SAME="same",support=kendo.support,location=window.location,history=window.history,CHECK_URL_INTERVAL=50,BROKEN_BACK_NAV=kendo.support.browser.msie,hashStrip=/^#*/,document=window.document;function absoluteURL(path,pathPrefix){if(!pathPrefix){return path}if(path+"/"===pathPrefix){path=pathPrefix}var regEx=new RegExp("^"+pathPrefix,"i");if(!regEx.test(path)){path=pathPrefix+"/"+path}return location.protocol+"//"+(location.host+"/"+path).replace(/\/\/+/g,"index.html")}function hashDelimiter(bang){return bang?"#!":"#"}function locationHash(hashDelimiter){var href=location.href;if(hashDelimiter==="#!"&&href.indexOf("#")>-1&&href.indexOf("#!")<0){return null}return href.split(hashDelimiter)[1]||""}function stripRoot(root,url){if(url.indexOf(root)===0){return(url.substr(root.length)).replace(/\/\//g,"/")}else{return url}}var HistoryAdapter=kendo.Class.extend({back:function(){if(BROKEN_BACK_NAV){setTimeout(function(){history.back()})}else{history.back()}},forward:function(){if(BROKEN_BACK_NAV){setTimeout(function(){history.forward()})}else{history.forward()}},length:function(){return history.length},replaceLocation:function(url){location.replace(url)}});var PushStateAdapter=HistoryAdapter.extend({init:function(root){this.root=root},navigate:function(to){history.pushState({},document.title,absoluteURL(to,this.root))},replace:function(to){history.replaceState({},document.title,absoluteURL(to,this.root))},normalize:function(url){return stripRoot(this.root,url)},current:function(){var current=location.pathname;if(location.search){current+=location.search}return stripRoot(this.root,current)},change:function(callback){$(window).bind("popstate.kendo",callback)},stop:function(){$(window).unbind("popstate.kendo")},normalizeCurrent:function(options){var fixedUrl,root=options.root,pathname=location.pathname,hash=locationHash(hashDelimiter(options.hashBang));if(root===pathname+"/"){fixedUrl=root}if(root===pathname&&hash){fixedUrl=absoluteURL(hash.replace(hashStrip,""),root)}if(fixedUrl){history.pushState({},document.title,fixedUrl)}}});function fixHash(url){return url.replace(/^(#)?/,"#")}function fixBang(url){return url.replace(/^(#(!)?)?/,"#!")}var HashAdapter=HistoryAdapter.extend({init:function(bang){this._id=kendo.guid();this.prefix=hashDelimiter(bang);this.fix=bang?fixBang:fixHash},navigate:function(to){location.hash=this.fix(to)},replace:function(to){this.replaceLocation(this.fix(to))},normalize:function(url){if(url.indexOf(this.prefix)<0){return url}else{return url.split(this.prefix)[1]}},change:function(callback){if(support.hashChange){$(window).on("hashchange."+this._id,callback)}else{this._interval=setInterval(callback,CHECK_URL_INTERVAL)}},stop:function(){$(window).off("hashchange."+this._id);clearInterval(this._interval)},current:function(){return locationHash(this.prefix)},normalizeCurrent:function(options){var pathname=location.pathname,root=options.root;if(options.pushState&&root!==pathname){this.replaceLocation(root+this.prefix+stripRoot(root,pathname));return true}return false}});var History=kendo.Observable.extend({start:function(options){options=options||{};this.bind([CHANGE,BACK,SAME],options);if(this._started){return}this._started=true;options.root=options.root||"/";var adapter=this.createAdapter(options),current;if(adapter.normalizeCurrent(options)){return}current=adapter.current();$.extend(this,{adapter:adapter,root:options.root,historyLength:adapter.length(),current:current,locations:[current]});adapter.change($.proxy(this,"_checkUrl"))},createAdapter:function(options){return support.pushState&&options.pushState?new PushStateAdapter(options.root):new HashAdapter(options.hashBang)},stop:function(){if(!this._started){return}this.adapter.stop();this.unbind(CHANGE);this._started=false},change:function(callback){this.bind(CHANGE,callback)},replace:function(to,silent){this._navigate(to,silent,function(adapter){adapter.replace(to);this.locations[this.locations-1]=this.current})},navigate:function(to,silent){if(to==="#:back"){this.backCalled=true;this.adapter.back();return}this._navigate(to,silent,function(adapter){adapter.navigate(to);this.locations.push(this.current)})},_navigate:function(to,silent,callback){var adapter=this.adapter;to=adapter.normalize(to);if(this.current===to||this.current===decodeURIComponent(to)){this.trigger(SAME);return}if(!silent){if(this.trigger(CHANGE,{url:to})){return}}this.current=to;callback.call(this,adapter);this.historyLength=adapter.length()},_checkUrl:function(){var adapter=this.adapter,current=adapter.current(),newLength=adapter.length(),navigatingInExisting=this.historyLength===newLength,back=current===this.locations[this.locations.length-2]&&navigatingInExisting,backCalled=this.backCalled,prev=this.current;if(current===null||this.current===current||this.current===decodeURIComponent(current)){return true}this.historyLength=newLength;this.backCalled=false;this.current=current;if(back&&this.trigger("back",{url:prev,to:current})){adapter.forward();this.current=prev;return}if(this.trigger(CHANGE,{url:current,backButtonPressed:!backCalled})){if(back){adapter.forward()}else{adapter.back();this.historyLength--}this.current=prev;return}if(back){this.locations.pop()}else{this.locations.push(current)}}});kendo.History=History;kendo.History.HistoryAdapter=HistoryAdapter;kendo.History.HashAdapter=HashAdapter;kendo.History.PushStateAdapter=PushStateAdapter;kendo.absoluteURL=absoluteURL;kendo.history=new History()})(window.kendo.jQuery);(function(){var kendo=window.kendo,history=kendo.history,Observable=kendo.Observable,INIT="init",ROUTE_MISSING="routeMissing",CHANGE="change",BACK="back",SAME="same",optionalParam=/\((.*?)\)/g,namedParam=/(\(\?)?:\w+/g,splatParam=/\*\w+/g,escapeRegExp=/[\-{}\[\]+?.,\\\^$|#\s]/g;function namedParamReplace(match,optional){return optional?match:"([^/]+)"}function routeToRegExp(route){return new RegExp("^"+route.replace(escapeRegExp,"\\$&").replace(optionalParam,"(?:$1)?").replace(namedParam,namedParamReplace).replace(splatParam,"(.*?)")+"$")}function stripUrl(url){return url.replace(/(\?.*)|(#.*)/g,"")}var Route=kendo.Class.extend({init:function(route,callback){if(!(route instanceof RegExp)){route=routeToRegExp(route)}this.route=route;this._callback=callback},callback:function(url){var params,idx=0,length,queryStringParams=kendo.parseQueryStringParams(url);url=stripUrl(url);params=this.route.exec(url).slice(1);length=params.length;for(;idx3){if(filter!=="substringof"){format="{0}({2},"+format+")"}else{format="{0}("+format+",{2})";if(operator==="doesnotcontain"){format+=" eq false"}}}else{format="{2} {0} "+format}filter=kendo.format(format,filter,value,field)}}result.push(filter)}filter=result.join(" "+logic+" ");if(result.length>1){filter="("+filter+")"}return filter}extend(true,kendo.data,{schemas:{odata:{type:"json",data:function(data){return data.d.results||[data.d]},total:"d.__count"}},transports:{odata:{read:{cache:true,dataType:"jsonp",jsonp:"$callback"},update:{cache:true,dataType:"json",contentType:"application/json",type:"PUT"},create:{cache:true,dataType:"json",contentType:"application/json",type:"POST"},destroy:{cache:true,dataType:"json",type:"DELETE"},parameterMap:function(options,type){var params,value,option,dataType;options=options||{};type=type||"read";dataType=(this.options||defaultDataType)[type];dataType=dataType?dataType.dataType:"json";if(type==="read"){params={$inlinecount:"allpages"};if(dataType!="json"){params.$format="json"}for(option in options){if(mappers[option]){mappers[option](params,options[option])}else{params[option]=options[option]}}}else{if(dataType!=="json"){throw new Error("Only json dataType can be used for "+type+" operation.")}if(type!=="destroy"){for(option in options){value=options[option];if(typeof value==="number"){options[option]=value+""}}params=kendo.stringify(options)}}return params}}}})})(window.kendo.jQuery);(function($,undefined){var kendo=window.kendo,isArray=$.isArray,isPlainObject=$.isPlainObject,map=$.map,each=$.each,extend=$.extend,getter=kendo.getter,Class=kendo.Class;var XmlDataReader=Class.extend({init:function(options){var that=this,total=options.total,model=options.model,parse=options.parse,errors=options.errors,serialize=options.serialize,data=options.data;if(model){if(isPlainObject(model)){var base=options.modelBase||kendo.data.Model;if(model.fields){each(model.fields,function(field,value){if(isPlainObject(value)&&value.field){value=extend(value,{field:that.getter(value.field)})}else{value={field:that.getter(value)}}model.fields[field]=value})}var id=model.id;if(id){var idField={};idField[that.xpathToMember(id,true)]={field:that.getter(id)};model.fields=extend(idField,model.fields);model.id=that.xpathToMember(id)}model=base.define(model)}that.model=model}if(total){if(typeof total=="string"){total=that.getter(total);that.total=function(data){return parseInt(total(data),10)}}else{if(typeof total=="function"){that.total=total}}}if(errors){if(typeof errors=="string"){errors=that.getter(errors);that.errors=function(data){return errors(data)||null}}else{if(typeof errors=="function"){that.errors=errors}}}if(data){if(typeof data=="string"){data=that.xpathToMember(data);that.data=function(value){var result=that.evaluate(value,data),modelInstance;result=isArray(result)?result:[result];if(that.model&&model.fields){modelInstance=new that.model();return map(result,function(value){if(value){var record={},field;for(field in model.fields){record[field]=modelInstance._parse(field,model.fields[field].field(value))}return record}})}return result}}else{if(typeof data=="function"){that.data=data}}}if(typeof parse=="function"){var xmlParse=that.parse;that.parse=function(data){var xml=parse.call(that,data);return xmlParse.call(that,xml)}}if(typeof serialize=="function"){that.serialize=serialize}},total:function(result){return this.data(result).length},errors:function(data){return data?data.errors:null},serialize:function(data){return data},parseDOM:function(element){var result={},parsedNode,node,nodeType,nodeName,member,attribute,attributes=element.attributes,attributeCount=attributes.length,idx;for(idx=0;idx=0){return member.replace(/\.?(@.*)/,raw?"$1":'["$1"]')}if(member.indexOf("text()")>=0){return member.replace(/(\.?text\(\))/,raw?"#text":'["#text"]')}return member},getter:function(member){return getter(this.xpathToMember(member),true)}});$.extend(true,kendo.data,{XmlDataReader:XmlDataReader,readers:{xml:XmlDataReader}})})(window.kendo.jQuery);(function($,undefined){var extend=$.extend,proxy=$.proxy,isPlainObject=$.isPlainObject,isEmptyObject=$.isEmptyObject,isArray=$.isArray,grep=$.grep,ajax=$.ajax,map,each=$.each,noop=$.noop,kendo=window.kendo,isFunction=kendo.isFunction,Observable=kendo.Observable,Class=kendo.Class,STRING="string",FUNCTION="function",CREATE="create",READ="read",UPDATE="update",DESTROY="destroy",CHANGE="change",SYNC="sync",GET="get",ERROR="error",REQUESTSTART="requestStart",PROGRESS="progress",REQUESTEND="requestEnd",crud=[CREATE,READ,UPDATE,DESTROY],identity=function(o){return o},getter=kendo.getter,stringify=kendo.stringify,math=Math,push=[].push,join=[].join,pop=[].pop,splice=[].splice,shift=[].shift,slice=[].slice,unshift=[].unshift,toString={}.toString,stableSort=kendo.support.stableSort,dateRegExp=/^\/Date\((.*?)\)\/$/,newLineRegExp=/(\r+|\n+)/g,quoteRegExp=/(?=['\\])/g;var ObservableArray=Observable.extend({init:function(array,type){var that=this;that.type=type||ObservableObject;Observable.fn.init.call(that);that.length=array.length;that.wrapAll(array,that)},toJSON:function(){var idx,length=this.length,value,json=new Array(length);for(idx=0;idx=0;if(composite){var paths=field.split("."),path="";while(paths.length>1){path+=paths.shift();var obj=kendo.getter(path,true)(that);if(obj instanceof ObservableObject){obj.set(paths.join("."),value);return composite}path+="."}}kendo.setter(field)(that,value);return composite},set:function(field,value){var that=this,composite=field.indexOf(".")>=0,current=kendo.getter(field,true)(that);if(current!==value){if(!that.trigger("set",{field:field,value:value})){if(!composite){value=that.wrap(value,field,function(){return that})}if(!that._set(field,value)||field.indexOf("(")>=0||field.indexOf("[")>=0){that.trigger(CHANGE,{field:field})}}}},parent:noop,wrap:function(object,field,parent){var that=this,type=toString.call(object);if(object!=null&&(type==="[object Object]"||type==="[object Array]")){var isObservableArray=object instanceof ObservableArray;var isDataSource=object instanceof DataSource;if(type==="[object Object]"&&!isDataSource&&!isObservableArray){if(!(object instanceof ObservableObject)){object=new ObservableObject(object)}if(object.parent()!=parent()){object.bind(GET,eventHandler(that,GET,field,true));object.bind(CHANGE,eventHandler(that,CHANGE,field,true))}}else{if(type==="[object Array]"||isObservableArray||isDataSource){if(!isObservableArray&&!isDataSource){object=new ObservableArray(object)}if(object.parent()!=parent()){object.bind(CHANGE,eventHandler(that,CHANGE,field,false))}}}object.parent=parent}return object}});function equal(x,y){if(x===y){return true}var xtype=$.type(x),ytype=$.type(y),field;if(xtype!==ytype){return false}if(xtype==="date"){return x.getTime()===y.getTime()}if(xtype!=="object"&&xtype!=="array"){return false}for(field in x){if(!equal(x[field],y[field])){return false}}return true}var parsers={number:function(value){return kendo.parseFloat(value)},date:function(value){return kendo.parseDate(value)},"boolean":function(value){if(typeof value===STRING){return value.toLowerCase()==="true"}return value!=null?!!value:value},string:function(value){return value!=null?(value+""):value},"default":function(value){return value}};var defaultValues={string:"",number:0,date:new Date(),"boolean":false,"default":""};function getFieldByName(obj,name){var field,fieldName;for(fieldName in obj){field=obj[fieldName];if(isPlainObject(field)&&field.field&&field.field===name){return field}else{if(field===name){return field}}}return null}var Model=ObservableObject.extend({init:function(data){var that=this;if(!data||$.isEmptyObject(data)){data=$.extend({},that.defaults,data);if(that._initializers){for(var idx=0;idx0){proto._initializers=functionFields}model=base.extend(proto);model.define=function(options){return Model.define(model,options)};if(proto.fields){model.fields=proto.fields;model.idField=proto.idField}return model};var Comparer={selector:function(field){return isFunction(field)?field:getter(field)},compare:function(field){var selector=this.selector(field);return function(a,b){a=selector(a);b=selector(b);if(a==null&&b==null){return 0}if(a==null){return -1}if(b==null){return 1}if(a.localeCompare){return a.localeCompare(b)}return a>b?1:(avalueB?1:-1}},desc:function(field){var selector=this.selector(field);return function(a,b){var valueA=selector(a);var valueB=selector(b);if(valueA&&valueA.getTime&&valueB&&valueB.getTime){valueA=valueA.getTime();valueB=valueB.getTime()}if(valueA===valueB){return a.__position-b.__position}if(valueA==null){return 1}if(valueB==null){return -1}if(valueB.localeCompare){return valueB.localeCompare(valueA)}return valueA",a,b,ignore)},gte:function(a,b,ignore){return operator(">=",a,b,ignore)},lt:function(a,b,ignore){return operator("<",a,b,ignore)},lte:function(a,b,ignore){return operator("<=",a,b,ignore)},startswith:function(a,b,ignore){if(ignore){a="("+a+" || '').toLowerCase()";if(b){b=b.toLowerCase()}}if(b){b=quote(b)}return a+".lastIndexOf('"+b+"', 0) == 0"},endswith:function(a,b,ignore){if(ignore){a="("+a+" || '').toLowerCase()";if(b){b=b.toLowerCase()}}if(b){b=quote(b)}return a+".indexOf('"+b+"', "+a+".length - "+(b||"").length+") >= 0"},contains:function(a,b,ignore){if(ignore){a="("+a+" || '').toLowerCase()";if(b){b=b.toLowerCase()}}if(b){b=quote(b)}return a+".indexOf('"+b+"') >= 0"},doesnotcontain:function(a,b,ignore){if(ignore){a="("+a+" || '').toLowerCase()";if(b){b=b.toLowerCase()}}if(b){b=quote(b)}return a+".indexOf('"+b+"') == -1"}}})();function Query(data){this.data=data||[]}Query.filterExpr=function(expression){var expressions=[],logic={and:" && ",or:" || "},idx,length,filter,expr,fieldFunctions=[],operatorFunctions=[],field,operator,filters=expression.filters;for(idx=0,length=filters.length;idx":"gt",isgreaterthan:"gt",greaterthan:"gt",greater:"gt",">=":"gte",isgreaterthanorequalto:"gte",greaterthanequal:"gte",ge:"gte",notsubstringof:"doesnotcontain"};function normalizeOperator(expression){var idx,length,filter,operator,filters=expression.filters;if(filters){for(idx=0,length=filters.length;idx0){descriptor=descriptors[0];result=result.groupBy(descriptor).select(function(group){var data=new Query(allData).filter([{field:group.field,operator:"eq",value:group.value,ignoreCase:false}]);return{field:group.field,value:group.value,items:descriptors.length>1?new Query(group.items).group(descriptors.slice(1),data.toArray()).toArray():group.items,hasSubgroups:descriptors.length>1,aggregates:data.aggregate(descriptor.aggregates)}})}return result},groupBy:function(descriptor){if(isEmptyObject(descriptor)||!this.data.length){return new Query([])}var field=descriptor.field,sorted=this._sortForGrouping(field,descriptor.dir||"asc"),accessor=kendo.accessor(field),item,groupValue=accessor.get(sorted[0],field),group={field:field,value:groupValue,items:[]},currentValue,idx,len,result=[group];for(idx=0,len=sorted.length;idxvalue&&(isNumber(value)||isDate(value))){accumulator=value}return accumulator}};function isNumber(val){return typeof val==="number"&&!isNaN(val)}function isDate(val){return val&&val.getTime}function toJSON(array){var idx,length=array.length,result=new Array(length);for(idx=0;idx=dest.length){break}}if(idx=length;idx--){group=groups[idx];parent={value:model.get(group.field),field:group.field,items:parent?[parent]:[model],hasSubgroups:!!parent,aggregates:{}}}return parent}function indexOfPristineModel(data,model){if(model){return indexOf(data,function(item){return item[model.idField]===model.id})}return -1}function indexOfModel(data,model){if(model){return indexOf(data,function(item){return item.uid==model.uid})}return -1}function indexOf(data,comparer){var idx,length;for(idx=0,length=data.length;idx-1){callback(index,items);return true}})},_removePristineForModel:function(model){this._executeOnPristineForModel(model,function(index,items){items.splice(index,1)})},_readData:function(data){var read=!this._isServerGrouped()?this.reader.data:this.reader.groups;return read.call(this.reader,data)},_eachPristineItem:function(callback){this._eachItem(this._pristineData,callback)},_eachItem:function(data,callback){if(data&&data.length){if(this._isServerGrouped()){eachGroupItems(data,callback)}else{callback(data)}}},_pristineForModel:function(model){var pristine,idx,callback=function(items){idx=indexOfPristineModel(items,model);if(idx>-1){pristine=items[idx];return true}};this._eachPristineItem(callback);return pristine},_cancelModel:function(model){var pristine=this._pristineForModel(model),idx;this._eachItem(this._data,function(items){idx=indexOfModel(items,model);if(idx!=-1){if(!model.isNew()&&pristine){items[idx].accept(pristine)}else{items.splice(idx,1)}}})},_promise:function(data,models,type){var that=this,transport=that.transport;return $.Deferred(function(deferred){that.trigger(REQUESTSTART,{type:type});transport[type].call(transport,extend({success:function(response){deferred.resolve({response:response,models:models,type:type})},error:function(response,status,error){deferred.reject(response);that.error(response,status,error)}},data))}).promise()},_send:function(method,data){var that=this,idx,length,promises=[],converted=that.reader.serialize(toJSON(data));if(that.options.batch){if(data.length){promises.push(that._promise({data:{models:converted}},data,method))}}else{for(idx=0,length=data.length;idxthat.totalPages())){return}that._skip=page*that.take();page+=1;options.page=page;that._query(options);return page},prev:function(options){var that=this,page=that.page();options=options||{};if(!page||page===1){return}that._skip=that._skip-that.take();page-=1;options.page=page;that._query(options);return page},page:function(val){var that=this,skip;if(val!==undefined){val=math.max(math.min(math.max(val,1),that.totalPages()),1);that._query({page:val});return}skip=that.skip();return skip!==undefined?math.round((skip||0)/(that.take()||1))+1:undefined},pageSize:function(val){var that=this;if(val!==undefined){that._query({pageSize:val,page:1});return}return that.take()},sort:function(val){var that=this;if(val!==undefined){that._query({sort:val});return}return that._sort},filter:function(val){var that=this;if(val===undefined){return that._filter}that._query({filter:val,page:1})},group:function(val){var that=this;if(val!==undefined){that._query({group:val});return}return that._group},total:function(){return parseInt(this._total||0,10)},aggregate:function(val){var that=this;if(val!==undefined){that._query({aggregate:val});return}return that._aggregate},aggregates:function(){return this._aggregateResult},totalPages:function(){var that=this,pageSize=that.pageSize()||that.total();return math.ceil((that.total()||0)/pageSize)},inRange:function(skip,take){var that=this,end=math.min(skip+take,that.total());if(!that.options.serverPaging&&that._data.length>0){return true}return that._findRange(skip,end).length>0},lastRange:function(){var ranges=this._ranges;return ranges[ranges.length-1]||{start:0,end:0,data:[]}},firstItemUid:function(){var ranges=this._ranges;return ranges.length&&ranges[0].data.length&&ranges[0].data[0].uid},enableRequestsInProgress:function(){this._skipRequestsInProgress=false},range:function(skip,take){skip=math.min(skip||0,this.total());var that=this,pageSkip=math.max(math.floor(skip/take),0)*take,size=math.min(pageSkip+take,that.total()),data;that._skipRequestsInProgress=false;data=that._findRange(skip,math.min(skip+take,that.total()));if(data.length){that._skipRequestsInProgress=true;that._pending=undefined;that._skip=skip>that.skip()?math.min(size,(that.totalPages()-1)*that.take()):pageSkip;that._take=take;var paging=that.options.serverPaging;var sorting=that.options.serverSorting;var filtering=that.options.serverFiltering;var aggregates=that.options.serverAggregates;try{that.options.serverPaging=true;if(!that._isServerGrouped()&&!(that.group()&&that.group().length)){that.options.serverSorting=true}that.options.serverFiltering=true;that.options.serverPaging=true;that.options.serverAggregates=true;if(paging){that._data=data=that._observe(data)}that._process(data)}finally{that.options.serverPaging=paging;that.options.serverSorting=sorting;that.options.serverFiltering=filtering;that.options.serverAggregates=aggregates}return}if(take!==undefined){if(!that._rangeExists(pageSkip,size)){that.prefetch(pageSkip,take,function(){if(skip>pageSkip&&size=range.start&&start<=range.end){count=0;for(takeIdx=skipIdx;takeIdx=range.start){rangeData=range.data;rangeEnd=range.end;if(!remote){var sort=normalizeGroup(that.group()||[]).concat(normalizeSort(that.sort()||[]));processed=Query.process(range.data,{sort:sort,filter:that.filter()});flatData=rangeData=processed.data;if(processed.total!==undefined){rangeEnd=processed.total}}startIndex=0;if(start+count>range.start){startIndex=(start+count)-range.start}endIndex=flatData.length;if(rangeEnd>end){endIndex=endIndex-(rangeEnd-end)}count+=endIndex-startIndex;data=that._mergeGroups(data,rangeData,startIndex,endIndex);if(end<=range.end&&count==end-start){return data}}}break}}return[]},_mergeGroups:function(data,range,skip,take){if(this._isServerGrouped()){var temp=range.toJSON(),prevGroup;if(data.length){prevGroup=data[data.length-1]}mergeGroups(prevGroup,temp,skip,take);return data.concat(temp)}return data.concat(range.slice(skip,take))},skip:function(){var that=this;if(that._skip===undefined){return(that._page!==undefined?(that._page-1)*(that.take()||1):undefined)}return that._skip},take:function(){return this._take||this._pageSize},_prefetchSuccessHandler:function(skip,size,callback){var that=this;return function(data){var found=false,range={start:skip,end:size,data:[]},idx,length,temp;that._dequeueRequest();that.trigger(REQUESTEND,{response:data,type:"read"});data=that.reader.parse(data);temp=that._readData(data);if(temp.length){for(idx=0,length=that._ranges.length;idx=end){return true}}return false},_removeModelFromRanges:function(model){var result,found,range;for(var idx=0,length=this._ranges.length;idx=this.total()){this.trigger("endreached",{index:index});return}if(!this.useRanges){return this.dataSource.view()[index]}if(this.useRanges){if(indexthis.skip+pageSize){var offset=Math.floor(index/pageSize)*pageSize;this.range(offset)}if(index===this.prefetchThreshold){this._prefetch()}if(index===this.midPageThreshold){this.range(this.nextMidRange)}else{if(index===this.nextPageThreshold){this.range(this.nextFullRange)}else{if(index===this.pullBackThreshold){if(this.offset===this.skip){this.range(this.previousMidRange)}else{this.range(this.previousFullRange)}}}}item=this.dataSource.at(index-this.dataOffset)}if(item===undefined){this.trigger("endreached",{index:index})}return item},indexOf:function(item){return this.dataSource.data().indexOf(item)+this.dataOffset},total:function(){return parseInt(this.dataSource.total(),10)},next:function(){var buffer=this,pageSize=buffer.pageSize,offset=buffer.skip-buffer.viewSize,pageSkip=math.max(math.floor(offset/pageSize),0)*pageSize+pageSize;this.offset=offset;this.dataSource.prefetch(pageSkip,pageSize,function(){buffer._goToRange(offset,true)})},range:function(offset){if(this.offset===offset){return}var buffer=this,pageSize=this.pageSize,pageSkip=math.max(math.floor(offset/pageSize),0)*pageSize+pageSize,dataSource=this.dataSource;this.offset=offset;this._recalculate();if(dataSource.inRange(offset,pageSize)){this._goToRange(offset)}else{if(this.prefetch){dataSource.prefetch(pageSkip,pageSize,function(){buffer._goToRange(offset,true)})}}},syncDataSource:function(){var offset=this.offset;this.offset=null;this.range(offset)},destroy:function(){this.unbind()},_prefetch:function(){var buffer=this,pageSize=this.pageSize,prefetchOffset=this.skip+pageSize,dataSource=this.dataSource;if(!dataSource.inRange(prefetchOffset,pageSize)&&!this._prefetching&&this.prefetch){this._prefetching=true;this.trigger("prefetching",{skip:prefetchOffset,take:pageSize});dataSource.prefetch(prefetchOffset,pageSize,function(){buffer._prefetching=false;buffer.trigger("prefetched",{skip:prefetchOffset,take:pageSize})})}},_goToRange:function(offset,expanding){if(this.offset!==offset){return}this.dataOffset=offset;this._expanding=expanding;this.dataSource.range(offset,this.pageSize);this.dataSource.enableRequestsInProgress()},_change:function(){var dataSource=this.dataSource,firstItemUid=dataSource.firstItemUid();this.length=this.useRanges?dataSource.lastRange().end:dataSource.view().length;if(this._firstItemUid!==firstItemUid||!this.useRanges){this._syncWithDataSource();this._recalculate();this.trigger("reset",{offset:this.offset})}this.trigger("resize");if(this._expanding){this.trigger("expand")}delete this._expanding},_syncWithDataSource:function(){var dataSource=this.dataSource;this._firstItemUid=dataSource.firstItemUid();this.dataOffset=this.offset=dataSource.skip()||0;this.pageSize=dataSource.pageSize();this.useRanges=dataSource.options.serverPaging},_recalculate:function(){var pageSize=this.pageSize,offset=this.offset,viewSize=this.viewSize,skip=Math.ceil(offset/pageSize)*pageSize;this.skip=skip;this.midPageThreshold=skip+pageSize-1;this.nextPageThreshold=skip+viewSize-1;this.prefetchThreshold=skip+Math.floor(pageSize/3*2);this.pullBackThreshold=this.offset-1;this.nextMidRange=skip+pageSize-viewSize;this.nextFullRange=skip;this.previousMidRange=offset-viewSize;this.previousFullRange=skip-pageSize}});var BatchBuffer=kendo.Observable.extend({init:function(dataSource,batchSize){var batchBuffer=this;kendo.Observable.fn.init.call(batchBuffer);this.dataSource=dataSource;this.batchSize=batchSize;this._total=0;this.buffer=new Buffer(dataSource,batchSize*3);this.buffer.bind({endreached:function(e){batchBuffer.trigger("endreached",{index:e.index})},prefetching:function(e){batchBuffer.trigger("prefetching",{skip:e.skip,take:e.take})},prefetched:function(e){batchBuffer.trigger("prefetched",{skip:e.skip,take:e.take})},reset:function(){batchBuffer._total=0;batchBuffer.trigger("reset")},resize:function(){batchBuffer._total=Math.ceil(this.length/batchBuffer.batchSize);batchBuffer.trigger("resize",{total:batchBuffer.total(),offset:this.offset})}})},syncDataSource:function(){this.buffer.syncDataSource()},at:function(index){var buffer=this.buffer,skip=index*this.batchSize,take=this.batchSize,view=[],item;if(buffer.offset>skip){buffer.at(buffer.offset-1)}for(var i=0;i0){source=source.get(path.substring(0,index))}that.start(source);if(source!==that.source){result=result.call(source,that.source)}else{result=result.call(source)}that.stop(source)}if(source&&source!==that.source){that.currentSource=source;source.unbind(CHANGE,that._change).bind(CHANGE,that._change)}that.stop(that.source);return result},set:function(value){var source=this.currentSource||this.source;var field=kendo.getter(this.path)(source);if(typeof field==="function"){if(source!==this.source){field.call(source,this.source,value)}else{field.call(source,value)}}else{source.set(this.path,value)}},destroy:function(){if(this.observable){this.source.unbind(CHANGE,this._change)}this.unbind()}});var EventBinding=Binding.extend({get:function(){var source=this.source,path=this.path,index=0,handler;handler=source.get(path);while(!handler&&source){source=this.parents[++index];if(source instanceof ObservableObject){handler=source.get(path)}}return proxy(handler,source)}});var TemplateBinding=Binding.extend({init:function(source,path,template){var that=this;Binding.fn.init.call(that,source,path);that.template=template},render:function(value){var html;this.start(this.source);html=kendo.render(this.template,value);this.stop(this.source);return html}});var Binder=Class.extend({init:function(element,bindings,options){this.element=element;this.bindings=bindings;this.options=options},bind:function(binding,attribute){var that=this;binding=attribute?binding[attribute]:binding;binding.bind(CHANGE,function(e){that.refresh(attribute||e)});that.refresh(attribute)},destroy:function(){}});binders.attr=Binder.extend({refresh:function(key){this.element.setAttribute(key,this.bindings.attr[key].get())}});binders.style=Binder.extend({refresh:function(key){this.element.style[key]=this.bindings.style[key].get()||""}});binders.enabled=Binder.extend({refresh:function(){if(this.bindings.enabled.get()){this.element.removeAttribute("disabled")}else{this.element.setAttribute("disabled","disabled")}}});binders.readonly=Binder.extend({refresh:function(){if(this.bindings.readonly.get()){this.element.setAttribute("readonly","readonly")}else{this.element.removeAttribute("readonly")}}});binders.disabled=Binder.extend({refresh:function(){if(this.bindings.disabled.get()){this.element.setAttribute("disabled","disabled")}else{this.element.removeAttribute("disabled")}}});binders.events=Binder.extend({init:function(element,bindings,options){Binder.fn.init.call(this,element,bindings,options);this.handlers={}},refresh:function(key){var element=$(this.element),binding=this.bindings.events[key],handler=this.handlers[key];if(handler){element.off(key,handler)}handler=this.handlers[key]=binding.get();element.on(key,binding.source,handler)},destroy:function(){var element=$(this.element),handler;for(handler in this.handlers){element.off(handler,this.handlers[handler])}}});binders.text=Binder.extend({refresh:function(){var text=this.bindings.text.get();if(text==null){text=""}this.element[innerText]=text}});binders.visible=Binder.extend({refresh:function(){if(this.bindings.visible.get()){this.element.style.display=""}else{this.element.style.display="none"}}});binders.invisible=Binder.extend({refresh:function(){if(!this.bindings.invisible.get()){this.element.style.display=""}else{this.element.style.display="none"}}});binders.html=Binder.extend({refresh:function(){this.element.innerHTML=this.bindings.html.get()}});binders.value=Binder.extend({init:function(element,bindings,options){Binder.fn.init.call(this,element,bindings,options);this._change=proxy(this.change,this);this.eventName=options.valueUpdate||CHANGE;$(this.element).on(this.eventName,this._change);this._initChange=false},change:function(){this._initChange=this.eventName!=CHANGE;var value=this.element.value;var type=this.element.type;if(type=="date"){value=kendo.parseDate(value,"yyyy-MM-dd")}else{if(type=="datetime-local"){value=kendo.parseDate(value,["yyyy-MM-ddTHH:mm:ss","yyyy-MM-ddTHH:mm"])}else{if(type=="number"){value=kendo.parseFloat(value)}}}this.bindings[VALUE].set(value);this._initChange=false},refresh:function(){if(!this._initChange){var value=this.bindings[VALUE].get();if(value==null){value=""}var type=this.element.type;if(type=="date"){value=kendo.toString(value,"yyyy-MM-dd")}else{if(type=="datetime-local"){value=kendo.toString(value,"yyyy-MM-ddTHH:mm:ss")}}this.element.value=value}this._initChange=false},destroy:function(){$(this.element).off(this.eventName,this._change)}});binders.source=Binder.extend({init:function(element,bindings,options){Binder.fn.init.call(this,element,bindings,options);var source=this.bindings.source.get();if(source instanceof kendo.data.DataSource&&options.autoBind!==false){source.fetch()}},refresh:function(e){var that=this,source=that.bindings.source.get();if(source instanceof ObservableArray||source instanceof kendo.data.DataSource){e=e||{};if(e.action=="add"){that.add(e.index,e.items)}else{if(e.action=="remove"){that.remove(e.index,e.items)}else{if(e.action!="itemchange"){that.render()}}}}else{that.render()}},container:function(){var element=this.element;if(element.nodeName.toLowerCase()=="table"){if(!element.tBodies[0]){element.appendChild(document.createElement("tbody"))}element=element.tBodies[0]}return element},template:function(){var options=this.options,template=options.template,nodeName=this.container().nodeName.toLowerCase();if(!template){if(nodeName=="select"){if(options.valueField||options.textField){template=kendo.format('',options.valueField||options.textField,options.textField||options.valueField)}else{template=""}}else{if(nodeName=="tbody"){template="#:data#"}else{if(nodeName=="ul"||nodeName=="ol"){template="
  • #:data#
  • "}else{template="#:data#"}}}template=kendo.template(template)}return template},add:function(index,items){var element=this.container(),parents,idx,length,child,clone=element.cloneNode(false),reference=element.children[index];$(clone).html(kendo.render(this.template(),items));if(clone.children.length){parents=this.bindings.source._parents();for(idx=0,length=items.length;idx-1){source.splice(index,1)}else{source.push(value)}}}else{this.bindings[CHECKED].set(value)}}}},refresh:function(){var value=this.bindings[CHECKED].get(),source=value,element=this.element;if(element.type=="checkbox"){if(source instanceof ObservableArray){value=this.element.value;if(source.indexOf(value)>=0){value=true}}element.checked=value===true}else{if(element.type=="radio"&&value!=null){if(element.value===value.toString()){element.checked=true}}}},value:function(){var element=this.element,value=element.value;if(element.type=="checkbox"){value=element.checked}return value},destroy:function(){$(this.element).off(CHANGE,this._change)}})};binders.select={value:Binder.extend({init:function(target,bindings,options){Binder.fn.init.call(this,target,bindings,options);this._change=proxy(this.change,this);$(this.element).change(this._change)},change:function(){var values=[],element=this.element,source,field=this.options.valueField||this.options.textField,valuePrimitive=this.options.valuePrimitive,option,valueIndex,value,idx,length;for(idx=0,length=element.options.length;idx1){effectBody.direction=(mirror&&redirectedEffect?directions[direction].reverse:direction)}effects[effect[0]]=effectBody})}else{each(input,function(idx){var direction=this.direction;if(direction&&mirror&&!singleEffectRegExp.test(idx)){this.direction=directions[direction].reverse}effects[idx]=this})}return effects};function parseInteger(value){return parseInt(value,10)}function parseCSS(element,property){return parseInteger(element.css(property))}function keys(obj){var acc=[];for(var propertyName in obj){acc.push(propertyName)}return acc}function strip3DTransforms(properties){for(var key in properties){if(transformProps.indexOf(key)!=-1&&transform2d.indexOf(key)==-1){delete properties[key]}}return properties}function normalizeCSS(element,properties){var transformation=[],cssValues={},lowerKey,key,value,isTransformed;for(key in properties){lowerKey=key.toLowerCase();isTransformed=transforms&&transformProps.indexOf(lowerKey)!=-1;if(!support.hasHW3D&&isTransformed&&transform2d.indexOf(lowerKey)==-1){delete properties[key]}else{value=properties[key];if(isTransformed){transformation.push(key+"("+value+")")}else{cssValues[key]=value}}}if(transformation.length){cssValues[TRANSFORM]=transformation.join(" ")}return cssValues}if(transitions){extend(fx,{transition:function(element,properties,options){var css,delay=0,oldKeys=element.data("keys")||[],timeoutID;options=extend({duration:200,ease:"ease-out",complete:null,exclusive:"all"},options);var stopTransitionCalled=false;var stopTransition=function(){if(!stopTransitionCalled){stopTransitionCalled=true;if(timeoutID){clearTimeout(timeoutID);timeoutID=null}element.removeData(ABORT_ID).dequeue().css(TRANSITION,"").css(TRANSITION);options.complete.call(element)}};options.duration=$.fx?$.fx.speeds[options.duration]||options.duration:options.duration;css=normalizeCSS(element,properties);$.merge(oldKeys,keys(css));element.data("keys",$.unique(oldKeys)).height();element.css(TRANSITION,options.exclusive+" "+options.duration+"ms "+options.ease).css(TRANSITION);element.css(css).css(TRANSFORM);if(transitions.event){element.one(transitions.event,stopTransition);if(options.duration!==0){delay=500}}timeoutID=setTimeout(stopTransition,options.duration+delay);element.data(ABORT_ID,timeoutID);element.data(COMPLETE_CALLBACK,stopTransition)},stopQueue:function(element,clearQueue,gotoEnd){var cssValues,taskKeys=element.data("keys"),retainPosition=(!gotoEnd&&taskKeys),completeCallback=element.data(COMPLETE_CALLBACK);if(retainPosition){cssValues=kendo.getComputedStyles(element[0],taskKeys)}if(completeCallback){completeCallback()}if(retainPosition){element.css(cssValues)}return element.removeData("keys").stop(clearQueue)}})}function animationProperty(element,property){if(transforms){var transform=element.css(TRANSFORM);if(transform==NONE){return property=="scale"?1:0}var match=transform.match(new RegExp(property+"\\s*\\(([\\d\\w\\.]+)")),computed=0;if(match){computed=parseInteger(match[1])}else{match=transform.match(matrix3dRegExp)||[0,0,0,0,0];property=property.toLowerCase();if(translateXRegExp.test(property)){computed=parseFloat(match[3]/match[2])}else{if(property=="translatey"){computed=parseFloat(match[4]/match[2])}else{if(property=="scale"){computed=parseFloat(match[2])}else{if(property=="rotate"){computed=parseFloat(Math.atan2(match[2],match[1]))}}}}}return computed}else{return parseFloat(element.css(property))}}var EffectSet=kendo.Class.extend({init:function(element,options){var that=this;that.element=element;that.effects=[];that.options=options;that.restore=[]},run:function(effects){var that=this,effect,idx,jdx,length=effects.length,element=that.element,options=that.options,deferred=$.Deferred(),start={},end={},target,children,childrenLength;that.effects=effects;deferred.then($.proxy(that,"complete"));element.data("animating",true);for(idx=0;idx=this.duration},timePassed:function(){return Math.min(this.duration,(new Date())-this.startDate)},moveTo:function(options){var that=this,movable=that.movable;that.initial=movable[that.axis];that.delta=options.location-that.initial;that.duration=typeof options.duration=="number"?options.duration:300;that.tick=that._easeProxy(options.ease);that.startDate=new Date();that.start()},_easeProxy:function(ease){var that=this;return function(){that.movable.moveAxis(that.axis,ease(that.timePassed(),that.initial,that.delta,that.duration))}}});extend(Transition,{easeOutExpo:function(t,b,c,d){return(t==d)?b+c:c*(-Math.pow(2,-10*t/d)+1)+b},easeOutBack:function(t,b,c,d,s){s=1.70158;return c*((t=t/d-1)*t*((s+1)*t+s)+1)+b}});fx.Animation=Animation;fx.Transition=Transition;fx.createEffect=createEffect;fx.box=function(element){element=$(element);var result=element.offset();result.width=element.outerWidth();result.height=element.outerHeight();return result};fx.transformOrigin=function(inner,outer){var x=(inner.left-outer.left)*outer.width/(outer.width-inner.width),y=(inner.top-outer.top)*outer.height/(outer.height-inner.height);return{x:isNaN(x)?0:x,y:isNaN(y)?0:y}};fx.fillScale=function(inner,outer){return Math.min(inner.width/outer.width,inner.height/outer.height)};fx.fitScale=function(inner,outer){return Math.max(inner.width/outer.width,inner.height/outer.height)}})(window.kendo.jQuery);(function($,undefined){var kendo=window.kendo,Observable=kendo.Observable,SCRIPT="SCRIPT",INIT="init",SHOW="show",HIDE="hide",TRANSITION_START="transitionStart",TRANSITION_END="transitionEnd",ATTACH="attach",DETACH="detach",sizzleErrorRegExp=/unrecognized expression/;var View=Observable.extend({init:function(content,options){var that=this;options=options||{};Observable.fn.init.call(that);that.content=content;that.id=kendo.guid();that.tagName=options.tagName||"div";that.model=options.model;that._wrap=options.wrap!==false;this._evalTemplate=options.evalTemplate||false;that._fragments={};that.bind([INIT,SHOW,HIDE,TRANSITION_START,TRANSITION_END],options)},render:function(container){var that=this,notInitialized=!that.element;if(notInitialized){that.element=that._createElement()}if(container){$(container).append(that.element)}if(notInitialized){kendo.bind(that.element,that.model);that.trigger(INIT)}if(container){that._eachFragment(ATTACH);that.trigger(SHOW)}return that.element},clone:function(back){return new ViewClone(this)},triggerBeforeShow:function(){return true},showStart:function(){this.element.css("display","")},showEnd:function(){},hideStart:function(){},hideEnd:function(){this.hide()},beforeTransition:function(type){this.trigger(TRANSITION_START,{type:type})},afterTransition:function(type){this.trigger(TRANSITION_END,{type:type})},hide:function(){this._eachFragment(DETACH);this.element.detach();this.trigger(HIDE)},destroy:function(){var element=this.element;if(element){kendo.unbind(element);kendo.destroy(element);element.remove()}},fragments:function(fragments){$.extend(this._fragments,fragments)},_eachFragment:function(methodName){for(var placeholder in this._fragments){this._fragments[placeholder][methodName](this,placeholder)}},_createElement:function(){var that=this,wrapper="<"+that.tagName+" />",element,content;try{content=$(document.getElementById(that.content)||that.content);if(content[0].tagName===SCRIPT){content=content.html()}}catch(e){if(sizzleErrorRegExp.test(e.message)){content=that.content}}if(typeof content==="string"){content=content.replace(/^\s+|\s+$/g,"");if(that._evalTemplate){content=kendo.template(content)(that.model||{})}element=$(wrapper).append(content);if(!that._wrap){element=element.contents()}}else{element=content;if(that._wrap){element=element.wrapAll(wrapper).parent()}}return element}});var ViewClone=kendo.Class.extend({init:function(view){$.extend(this,{element:view.element.clone(true),transition:view.transition,id:view.id});view.element.parent().append(this.element)},hideStart:$.noop,hideEnd:function(){this.element.remove()},beforeTransition:$.noop,afterTransition:$.noop});var Layout=View.extend({init:function(content,options){View.fn.init.call(this,content,options);this.containers={}},container:function(selector){var container=this.containers[selector];if(!container){container=this._createContainer(selector);this.containers[selector]=container}return container},showIn:function(selector,view,transition){this.container(selector).show(view,transition)},_createContainer:function(selector){var root=this.render(),element=root.find(selector),container;if(!element.length&&root.is(selector)){if(root.is(selector)){element=root}else{throw new Error("can't find a container with the specified "+selector+" selector")}}container=new ViewContainer(element);container.bind("accepted",function(e){e.view.render(element)});return container}});var Fragment=View.extend({attach:function(view,placeholder){view.element.find(placeholder).replaceWith(this.render())},detach:function(){}});var transitionRegExp=/^(\w+)(:(\w+))?( (\w+))?$/;function parseTransition(transition){if(!transition){return{}}var matches=transition.match(transitionRegExp)||[];return{type:matches[1],direction:matches[3],reverse:matches[5]==="reverse"}}var ViewContainer=Observable.extend({init:function(container){Observable.fn.init.call(this);this.container=container;this.history=[];this.view=null;this.running=false},after:function(){this.running=false;this.trigger("complete",{view:this.view});this.trigger("after")},end:function(){this.view.showEnd();this.previous.hideEnd();this.after()},show:function(view,transition,locationID){if(!view.triggerBeforeShow()){this.trigger("after");return false}locationID=locationID||view.id;var that=this,current=(view===that.view)?view.clone():that.view,history=that.history,previousEntry=history[history.length-2]||{},back=previousEntry.id===locationID,theTransition=transition||(back?history[history.length-1].transition:view.transition),transitionData=parseTransition(theTransition);if(that.running){that.effect.stop()}if(theTransition==="none"){theTransition=null}that.trigger("accepted",{view:view});that.view=view;that.previous=current;that.running=true;if(!back){history.push({id:locationID,transition:theTransition})}else{history.pop()}if(!current){view.showStart();view.showEnd();that.after();return true}current.hideStart();if(!theTransition||!kendo.effects.enabled){view.showStart();that.end()}else{view.element.addClass("k-fx-hidden");view.showStart();if(back&&!transition){transitionData.reverse=!transitionData.reverse}that.effect=kendo.fx(view.element).replace(current.element,transitionData.type).beforeTransition(function(){view.beforeTransition("show");current.beforeTransition("hide")}).afterTransition(function(){view.afterTransition("show");current.afterTransition("hide")}).direction(transitionData.direction).setReverse(transitionData.reverse);that.effect.run().then(function(){that.end()})}return true}});kendo.ViewContainer=ViewContainer;kendo.Fragment=Fragment;kendo.Layout=Layout;kendo.View=View;kendo.ViewClone=ViewClone})(window.kendo.jQuery);(function(kendo){function Node(){this.node=null}Node.prototype={remove:function(){this.node.parentNode.removeChild(this.node)}};function Element(nodeName,attr,children){this.nodeName=nodeName;this.attr=attr||{};this.cssText=null;this.children=children||[]}Element.prototype=new Node();Element.prototype.render=function(parent,cached){var node;var index;var children=this.children;var length=children.length;if(!cached||cached.nodeName!==this.nodeName){if(cached){cached.remove();cached=null}node=document.createElement(this.nodeName);for(index=0;index2){this.render({appendChild:function(node){parent.replaceChild(node,cached.node)}},null);return}for(index=0;index")}function numberOfDecimalDigits(value){value=(value+"").split(".");if(value.length>1){return value[1].length}return 0}function parseHtml(text){if($.parseHTML){return $($.parseHTML(text))}return $(text)}function searchForMessageContainer(elements,fieldName){var containers=$(),element,attr;for(var idx=0,length=elements.length;idx #=message#',messages:{required:"{0} is required",pattern:"{0} is not valid",min:"{0} should be greater than or equal to {1}",max:"{0} should be smaller than or equal to {1}",step:"{0} is not valid",email:"{0} is not valid email",url:"{0} is not valid URL",date:"{0} is not valid date"},rules:{required:function(input){var checkbox=input.filter("[type=checkbox]").length&&!input.is(":checked"),value=input.val();return !(hasAttribute(input,"required")&&(value===""||!value||checkbox))},pattern:function(input){if(input.filter("[type=text],[type=email],[type=url],[type=tel],[type=search],[type=password]").filter("[pattern]").length&&input.val()!==""){return patternMatcher(input.val(),input.attr("pattern"))}return true},min:function(input){if(input.filter(NUMBERINPUTSELECTOR+",["+kendo.attr("type")+"=number]").filter("[min]").length&&input.val()!==""){var min=parseFloat(input.attr("min"))||0,val=kendo.parseFloat(input.val());return min<=val}return true},max:function(input){if(input.filter(NUMBERINPUTSELECTOR+",["+kendo.attr("type")+"=number]").filter("[max]").length&&input.val()!==""){var max=parseFloat(input.attr("max"))||0,val=kendo.parseFloat(input.val());return max>=val}return true},step:function(input){if(input.filter(NUMBERINPUTSELECTOR+",["+kendo.attr("type")+"=number]").filter("[step]").length&&input.val()!==""){var min=parseFloat(input.attr("min"))||0,step=parseFloat(input.attr("step"))||1,val=parseFloat(input.val()),decimals=numberOfDecimalDigits(step),raise;if(decimals){raise=Math.pow(10,decimals);return(((val-min)*raise)%(step*raise))/Math.pow(100,decimals)===0}return((val-min)%step)===0}return true},email:function(input){return matcher(input,"[type=email],["+kendo.attr("type")+"=email]",emailRegExp)},url:function(input){return matcher(input,"[type=url],["+kendo.attr("type")+"=url]",urlRegExp)},date:function(input){if(input.filter("[type^=date],["+kendo.attr("type")+"=date]").length&&input.val()!==""){return kendo.parseDate(input.val(),input.attr(kendo.attr("format")))!==null}return true}},validateOnBlur:true},destroy:function(){Widget.fn.destroy.call(this);this.element.off(NS)},value:function(){if(!this._isValidated){return false}return this.errors().length===0},_submit:function(e){if(!this.validate()){e.stopPropagation();e.stopImmediatePropagation();e.preventDefault();return false}return true},_checkElement:function(element){var state=this.value();this.validateInput(element);if(this.value()!==state){this.trigger("change")}},_attachEvents:function(){var that=this;if(that.element.is(FORM)){that.element.on("submit"+NS,proxy(that._submit,that))}if(that.options.validateOnBlur){if(!that.element.is(INPUTSELECTOR)){that.element.on(BLUR+NS,that._inputSelector,function(){that._checkElement($(this))});that.element.on("click"+NS,that._checkboxSelector,function(){that._checkElement($(this))})}else{that.element.on(BLUR+NS,function(){that._checkElement(that.element)});if(that.element.is(CHECKBOXSELECTOR)){that.element.on("click"+NS,function(){that._checkElement(that.element)})}}}},validate:function(){var inputs;var idx;var result=false;var length;var isValid=this.value();this._errors={};if(!this.element.is(INPUTSELECTOR)){var invalid=false;inputs=this.element.find(this._inputSelector);for(idx=0,length=inputs.length;idx1},_maxTouchesReached:function(){return this.touches.length>=this._maxTouches},_disposeAll:function(){var touches=this.touches;while(touches.length>0){touches.pop().dispose()}},_isMoved:function(){return $.grep(this.touches,function(touch){return touch.isMoved()}).length},_select:function(e){if(!this.allowSelection||this.trigger(SELECT,{event:e})){e.preventDefault()}},_start:function(e){var that=this,idx=0,filter=that.filter,target,touches=getTouches(e),length=touches.length,touch,which=e.which;if((which&&which>1)||(that._maxTouchesReached())){return}UserEvents.current=null;that.currentTarget=e.currentTarget;if(that.stopPropagation){e.stopPropagation()}for(;idxthis.max||offsetsize);if(!silent){that.trigger(CHANGE,that)}}});var PaneDimensions=Observable.extend({init:function(options){var that=this;Observable.fn.init.call(that);that.x=new PaneDimension(extend({horizontal:true},options));that.y=new PaneDimension(extend({horizontal:false},options));that.container=options.container;that.forcedMinScale=options.minScale;that.maxScale=options.maxScale||100;that.bind(CHANGE,options)},rescale:function(newScale){this.x.rescale(newScale);this.y.rescale(newScale);this.refresh()},centerCoordinates:function(){return{x:Math.min(0,-this.x.centerOffset),y:Math.min(0,-this.y.centerOffset)}},refresh:function(){var that=this;that.x.update();that.y.update();that.enabled=that.x.enabled||that.y.enabled;that.minScale=that.forcedMinScale||Math.min(that.x.minScale,that.y.minScale);that.fitScale=Math.max(that.x.minScale,that.y.minScale);that.trigger(CHANGE)}});var PaneAxis=Observable.extend({init:function(options){var that=this;extend(that,options);Observable.fn.init.call(that)},outOfBounds:function(){return this.dimension.outOfBounds(this.movable[this.axis])},dragMove:function(delta){var that=this,dimension=that.dimension,axis=that.axis,movable=that.movable,position=movable[axis]+delta;if(!dimension.enabled){return}if((positiondimension.max&&delta>0)){delta*=that.resistance}movable.translateAxis(axis,delta);that.trigger(CHANGE,that)}});var Pane=Class.extend({init:function(options){var that=this,x,y,resistance,movable;extend(that,{elastic:true},options);resistance=that.elastic?0.5:0;movable=that.movable;that.x=x=new PaneAxis({axis:"x",dimension:that.dimensions.x,resistance:resistance,movable:movable});that.y=y=new PaneAxis({axis:"y",dimension:that.dimensions.y,resistance:resistance,movable:movable});that.userEvents.bind(["move","end","gesturestart","gesturechange"],{gesturestart:function(e){that.gesture=e;that.offset=that.dimensions.container.offset()},gesturechange:function(e){var previousGesture=that.gesture,previousCenter=previousGesture.center,center=e.center,scaleDelta=e.distance/previousGesture.distance,minScale=that.dimensions.minScale,maxScale=that.dimensions.maxScale,coordinates;if(movable.scale<=minScale&&scaleDelta<1){scaleDelta+=(1-scaleDelta)*0.8}if(movable.scale*scaleDelta>=maxScale){scaleDelta=maxScale/movable.scale}var offsetX=movable.x+that.offset.left,offsetY=movable.y+that.offset.top;coordinates={x:(offsetX-previousCenter.x)*scaleDelta+center.x-offsetX,y:(offsetY-previousCenter.y)*scaleDelta+center.y-offsetY};movable.scaleWith(scaleDelta);x.dragMove(coordinates.x);y.dragMove(coordinates.y);that.dimensions.rescale(movable.scale);that.gesture=e;e.preventDefault()},move:function(e){if(e.event.target.tagName.match(/textarea|input/i)){return}if(x.dimension.enabled||y.dimension.enabled){x.dragMove(e.x.delta);y.dragMove(e.y.delta);e.preventDefault()}else{e.touch.skip()}},end:function(e){e.preventDefault()}})}});var TRANSFORM_STYLE=support.transitions.prefix+"Transform",translate;if(support.hasHW3D){translate=function(x,y,scale){return"translate3d("+x+"px,"+y+"px,0) scale("+scale+")"}}else{translate=function(x,y,scale){return"translate("+x+"px,"+y+"px) scale("+scale+")"}}var Movable=Observable.extend({init:function(element){var that=this;Observable.fn.init.call(that);that.element=$(element);that.element[0].style.webkitTransformOrigin="left top";that.x=0;that.y=0;that.scale=1;that._saveCoordinates(translate(that.x,that.y,that.scale))},translateAxis:function(axis,by){this[axis]+=by;this.refresh()},scaleTo:function(scale){this.scale=scale;this.refresh()},scaleWith:function(scaleDelta){this.scale*=scaleDelta;this.refresh()},translate:function(coordinates){this.x+=coordinates.x;this.y+=coordinates.y;this.refresh()},moveAxis:function(axis,value){this[axis]=value;this.refresh()},moveTo:function(coordinates){extend(this,coordinates);this.refresh()},refresh:function(){var that=this,x=that.x,y=that.y,newCoordinates;if(that.round){x=Math.round(x);y=Math.round(y)}newCoordinates=translate(x,y,that.scale);if(newCoordinates!=that.coordinates){if(kendo.support.browser.msie&&kendo.support.browser.version<10){that.element[0].style.position="absolute";that.element[0].style.left=that.x+"px";that.element[0].style.top=that.y+"px"}else{that.element[0].style[TRANSFORM_STYLE]=newCoordinates}that._saveCoordinates(newCoordinates);that.trigger(CHANGE)}},_saveCoordinates:function(coordinates){this.coordinates=coordinates}});var DropTarget=Widget.extend({init:function(element,options){var that=this;Widget.fn.init.call(that,element,options);var group=that.options.group;if(!(group in dropTargets)){dropTargets[group]=[that]}else{dropTargets[group].push(that)}},events:[DRAGENTER,DRAGLEAVE,DROP],options:{name:"DropTarget",group:"default"},destroy:function(){var groupName=this.options.group,group=dropTargets[groupName]||dropAreas[groupName],i;if(group.length>1){Widget.fn.destroy.call(this);for(i=0;idimension.max?dimension.max:dimension.min;that._moveTo(snapBack)},_moveTo:function(location){this.transition.moveTo({location:location,duration:SNAPBACK_DURATION,ease:Transition.easeOutExpo})}});var AnimatedScroller=Animation.extend({init:function(options){var that=this;kendo.effects.Animation.fn.init.call(this);extend(that,options,{origin:{},destination:{},offset:{}})},tick:function(){this._updateCoordinates();this.moveTo(this.origin)},done:function(){return abs(this.offset.y)');extend(that,options,{element:element,elementSize:0,movable:new Movable(element),scrollMovable:options.movable,alwaysVisible:options.alwaysVisible,size:horizontal?"width":"height"});that.scrollMovable.bind(CHANGE,proxy(that.refresh,that));that.container.append(element);if(options.alwaysVisible){that.show()}},refresh:function(){var that=this,axis=that.axis,dimension=that.dimension,paneSize=dimension.size,scrollMovable=that.scrollMovable,sizeRatio=paneSize/dimension.total,position=Math.round(-scrollMovable[axis]*sizeRatio),size=Math.round(paneSize*sizeRatio);if(sizeRatio>=1){this.element.css("display","none")}else{this.element.css("display","")}if(position+size>paneSize){size=paneSize-position}else{if(position<0){size+=position;position=0}}if(that.elementSize!=size){that.element.css(that.size,size+"px");that.elementSize=size}that.movable.moveAxis(axis,position)},show:function(){this.element.css({opacity:SCROLLBAR_OPACITY,visibility:"visible"})},hide:function(){if(!this.alwaysVisible){this.element.css({opacity:0})}}});var Scroller=Widget.extend({init:function(element,options){var that=this;Widget.fn.init.call(that,element,options);element=that.element;that._native=that.options.useNative&&kendo.support.hasNativeScrolling;if(that._native){element.addClass("km-native-scroller").prepend('
    ');extend(that,{scrollElement:element,fixedContainer:element.children().first()});return}element.css("overflow","hidden").addClass("km-scroll-wrapper").wrapInner('
    ').prepend('
    ');var inner=element.children().eq(1),tapCapture=new kendo.TapCapture(element),movable=new Movable(inner),dimensions=new PaneDimensions({element:inner,container:element,forcedEnabled:that.options.zoom}),avoidScrolling=this.options.avoidScrolling,userEvents=new kendo.UserEvents(element,{allowSelection:true,preventDragEvent:true,captureUpIfMoved:true,multiTouch:that.options.zoom,start:function(e){dimensions.refresh();var velocityX=abs(e.x.velocity),velocityY=abs(e.y.velocity),horizontalSwipe=velocityX*2>=velocityY,originatedFromFixedContainer=$.contains(that.fixedContainer[0],e.event.target),verticalSwipe=velocityY*2>=velocityX;if(!originatedFromFixedContainer&&!avoidScrolling(e)&&that.enabled&&(dimensions.x.enabled&&horizontalSwipe||dimensions.y.enabled&&verticalSwipe)){userEvents.capture()}else{userEvents.cancel()}}}),pane=new Pane({movable:movable,dimensions:dimensions,userEvents:userEvents,elastic:that.options.elastic}),zoomSnapBack=new ZoomSnapBack({movable:movable,dimensions:dimensions,userEvents:userEvents,tapCapture:tapCapture}),animatedScroller=new AnimatedScroller({moveTo:function(coordinates){that.scrollTo(coordinates.x,coordinates.y)}});movable.bind(CHANGE,function(){that.scrollTop=-movable.y;that.scrollLeft=-movable.x;that.trigger(SCROLL,{scrollTop:that.scrollTop,scrollLeft:that.scrollLeft})});if(that.options.mousewheelScrolling){element.on("DOMMouseScroll mousewheel",proxy(this,"_wheelScroll"))}extend(that,{movable:movable,dimensions:dimensions,zoomSnapBack:zoomSnapBack,animatedScroller:animatedScroller,userEvents:userEvents,pane:pane,tapCapture:tapCapture,pulled:false,enabled:true,scrollElement:inner,scrollTop:0,scrollLeft:0,fixedContainer:element.children().first()});that._initAxis("x");that._initAxis("y");that._wheelEnd=function(){that._wheel=false;that.userEvents.end(0,that._wheelY)};dimensions.refresh();if(that.options.pullToRefresh){that._initPullToRefresh()}},_wheelScroll:function(e){if(!this._wheel){this._wheel=true;this._wheelY=0;this.userEvents.press(0,this._wheelY)}clearTimeout(this._wheelTimeout);this._wheelTimeout=setTimeout(this._wheelEnd,50);var delta=kendo.wheelDeltaY(e);if(delta){this._wheelY+=delta;this.userEvents.move(0,this._wheelY)}e.preventDefault()},makeVirtual:function(){this.dimensions.y.makeVirtual()},virtualSize:function(min,max){this.dimensions.y.virtualSize(min,max)},height:function(){return this.dimensions.y.size},scrollHeight:function(){return this.scrollElement[0].scrollHeight},scrollWidth:function(){return this.scrollElement[0].scrollWidth},options:{name:"Scroller",zoom:false,pullOffset:140,visibleScrollHints:false,elastic:true,useNative:false,mousewheelScrolling:true,avoidScrolling:function(){return false},pullToRefresh:false,pullTemplate:"Pull to refresh",releaseTemplate:"Release to refresh",refreshTemplate:"Refreshing"},events:[PULL,SCROLL,RESIZE],_resize:function(){if(!this._native){this.contentResized()}},setOptions:function(options){var that=this;Widget.fn.setOptions.call(that,options);if(options.pullToRefresh){that._initPullToRefresh()}},reset:function(){if(this._native){this.scrollElement.scrollTop(0)}else{this.movable.moveTo({x:0,y:0});this._scale(1)}},contentResized:function(){this.dimensions.refresh();if(this.pane.x.outOfBounds()){this.movable.moveAxis("x",this.dimensions.x.min)}if(this.pane.y.outOfBounds()){this.movable.moveAxis("y",this.dimensions.y.min)}},zoomOut:function(){var dimensions=this.dimensions;dimensions.refresh();this._scale(dimensions.fitScale);this.movable.moveTo(dimensions.centerCoordinates())},enable:function(){this.enabled=true},disable:function(){this.enabled=false},scrollTo:function(x,y){if(this._native){this.scrollElement.scrollLeft(abs(x));this.scrollElement.scrollTop(abs(y))}else{this.dimensions.refresh();this.movable.moveTo({x:x,y:y})}},animatedScrollTo:function(x,y,callback){var from,to;if(this._native){this.scrollTo(x,y)}else{from={x:this.movable.x,y:this.movable.y};to={x:x,y:y};this.animatedScroller.setCoordinates(from,to);this.animatedScroller.setCallback(callback);this.animatedScroller.start()}},pullHandled:function(){var that=this;that.refreshHint.removeClass(REFRESHCLASS);that.hintContainer.html(that.pullTemplate({}));that.yinertia.onEnd();that.xinertia.onEnd();that.userEvents.cancel()},destroy:function(){Widget.fn.destroy.call(this);if(this.userEvents){this.userEvents.destroy()}},_scale:function(scale){this.dimensions.rescale(scale);this.movable.scaleTo(scale)},_initPullToRefresh:function(){var that=this;that.dimensions.y.forceEnabled();that.pullTemplate=kendo.template(that.options.pullTemplate);that.releaseTemplate=kendo.template(that.options.releaseTemplate);that.refreshTemplate=kendo.template(that.options.refreshTemplate);that.scrollElement.prepend(''+that.pullTemplate({})+"");that.refreshHint=that.scrollElement.children().first();that.hintContainer=that.refreshHint.children(".km-template");that.pane.y.bind("change",proxy(that._paneChange,that));that.userEvents.bind("end",proxy(that._dragEnd,that))},_dragEnd:function(){var that=this;if(!that.pulled){return}that.pulled=false;that.refreshHint.removeClass(RELEASECLASS).addClass(REFRESHCLASS);that.hintContainer.html(that.refreshTemplate({}));that.yinertia.freeze(that.options.pullOffset/2);that.trigger("pull")},_paneChange:function(){var that=this;if(that.movable.y/OUT_OF_BOUNDS_FRICTION>that.options.pullOffset){if(!that.pulled){that.pulled=true;that.refreshHint.removeClass(REFRESHCLASS).addClass(RELEASECLASS);that.hintContainer.html(that.releaseTemplate({}))}}else{if(that.pulled){that.pulled=false;that.refreshHint.removeClass(RELEASECLASS);that.hintContainer.html(that.pullTemplate({}))}}},_initAxis:function(axis){var that=this,movable=that.movable,dimension=that.dimensions[axis],tapCapture=that.tapCapture,paneAxis=that.pane[axis],scrollBar=new ScrollBar({axis:axis,movable:movable,dimension:dimension,container:that.element,alwaysVisible:that.options.visibleScrollHints});dimension.bind(CHANGE,function(){scrollBar.refresh()});paneAxis.bind(CHANGE,function(){scrollBar.show()});that[axis+"inertia"]=new DragInertia({axis:axis,paneAxis:paneAxis,movable:movable,tapCapture:tapCapture,userEvents:that.userEvents,dimension:dimension,elastic:that.options.elastic,friction:that.options.friction||FRICTION,velocityMultiplier:that.options.velocityMultiplier||VELOCITY_MULTIPLIER,end:function(){scrollBar.hide();that.trigger("scrollEnd",{axis:axis,scrollTop:that.scrollTop,scrollLeft:that.scrollLeft})}})}});ui.plugin(Scroller)})(window.kendo.jQuery);(function($,undefined){var kendo=window.kendo,Widget=kendo.ui.Widget,proxy=$.proxy,isRtl=false,NS=".kendoGroupable",CHANGE="change",indicatorTmpl=kendo.template('',{useWithBlock:false}),hint=function(target){return $('
    ').css({width:target.width(),paddingLeft:target.css("paddingLeft"),paddingRight:target.css("paddingRight"),lineHeight:target.height()+"px",paddingTop:target.css("paddingTop"),paddingBottom:target.css("paddingBottom")}).html(target.attr(kendo.attr("title"))||target.attr(kendo.attr("field"))).prepend('')},dropCue=$('
    '),nameSpecialCharRegExp=/("|\%|'|\[|\]|\$|\.|\,|\:|\;|\+|\*|\&|\!|\#|\(|\)|<|>|\=|\?|\@|\^|\{|\}|\~|\/|\||`)/g;function dropCueOffsetTop(element){return element.position().top+3}var Groupable=Widget.extend({init:function(element,options){var that=this,groupContainer,group=kendo.guid(),intializePositions=proxy(that._intializePositions,that),draggable,horizontalCuePosition,dropCuePositions=that._dropCuePositions=[];Widget.fn.init.call(that,element,options);isRtl=kendo.support.isRtl(element);horizontalCuePosition=isRtl?"right":"left";that.draggable=draggable=that.options.draggable||new kendo.ui.Draggable(that.element,{filter:that.options.draggableElements,hint:hint,group:group});that.groupContainer=$(that.options.groupContainer,that.element).kendoDropTarget({group:draggable.options.group,dragenter:function(e){if(that._canDrag(e.draggable.currentTarget)){e.draggable.hint.find(".k-drag-status").removeClass("k-denied").addClass("k-add");dropCue.css("top",dropCueOffsetTop(that.groupContainer)).css(horizontalCuePosition,0).appendTo(that.groupContainer)}},dragleave:function(e){e.draggable.hint.find(".k-drag-status").removeClass("k-add").addClass("k-denied");dropCue.remove()},drop:function(e){var targetElement=e.draggable.currentTarget,field=targetElement.attr(kendo.attr("field")),title=targetElement.attr(kendo.attr("title")),sourceIndicator=that.indicator(field),dropCuePositions=that._dropCuePositions,lastCuePosition=dropCuePositions[dropCuePositions.length-1],position;if(!targetElement.hasClass("k-group-indicator")&&!that._canDrag(targetElement)){return}if(lastCuePosition){position=that._dropCuePosition(kendo.getOffset(dropCue).left+parseInt(lastCuePosition.element.css("marginLeft"),10)*(isRtl?-1:1)+parseInt(lastCuePosition.element.css("marginRight"),10));if(position&&that._canDrop($(sourceIndicator),position.element,position.left)){if(position.before){position.element.before(sourceIndicator||that.buildIndicator(field,title))}else{position.element.after(sourceIndicator||that.buildIndicator(field,title))}that._change()}}else{that.groupContainer.append(that.buildIndicator(field,title));that._change()}}}).kendoDraggable({filter:"div.k-group-indicator",hint:hint,group:draggable.options.group,dragcancel:proxy(that._dragCancel,that),dragstart:function(e){var element=e.currentTarget,marginLeft=parseInt(element.css("marginLeft"),10),elementPosition=element.position(),left=isRtl?elementPosition.left-marginLeft:elementPosition.left+element.outerWidth();intializePositions();dropCue.css({top:dropCueOffsetTop(that.groupContainer),left:left}).appendTo(that.groupContainer);this.hint.find(".k-drag-status").removeClass("k-denied").addClass("k-add")},dragend:function(){that._dragEnd(this)},drag:proxy(that._drag,that)}).on("click"+NS,".k-button",function(e){e.preventDefault();that._removeIndicator($(this).parent())}).on("click"+NS,".k-link",function(e){var current=$(this).parent(),newIndicator=that.buildIndicator(current.attr(kendo.attr("field")),current.attr(kendo.attr("title")),current.attr(kendo.attr("dir"))=="asc"?"desc":"asc");current.before(newIndicator).remove();that._change();e.preventDefault()});draggable.bind(["dragend","dragcancel","dragstart","drag"],{dragend:function(){that._dragEnd(this)},dragcancel:proxy(that._dragCancel,that),dragstart:function(e){var element,marginRight,left;if(!that.options.allowDrag&&!that._canDrag(e.currentTarget)){e.preventDefault();return}intializePositions();if(dropCuePositions.length){element=dropCuePositions[dropCuePositions.length-1].element;marginRight=parseInt(element.css("marginRight"),10);left=element.position().left+element.outerWidth()+marginRight}else{left=0}},drag:proxy(that._drag,that)});that.dataSource=that.options.dataSource;if(that.dataSource&&that._refreshHandler){that.dataSource.unbind(CHANGE,that._refreshHandler)}else{that._refreshHandler=proxy(that.refresh,that)}if(that.dataSource){that.dataSource.bind("change",that._refreshHandler);that.refresh()}},refresh:function(){var that=this,dataSource=that.dataSource;if(that.groupContainer){that.groupContainer.empty().append($.map(dataSource.group()||[],function(item){var fieldName=item.field.replace(nameSpecialCharRegExp,"\\$1");var element=that.element.find(that.options.filter).filter("["+kendo.attr("field")+"="+fieldName+"]");return that.buildIndicator(item.field,element.attr(kendo.attr("title")),item.dir)}).join(""))}that._invalidateGroupContainer()},destroy:function(){var that=this;Widget.fn.destroy.call(that);that.groupContainer.off(NS);if(that.groupContainer.data("kendoDropTarget")){that.groupContainer.data("kendoDropTarget").destroy()}if(that.groupContainer.data("kendoDraggable")){that.groupContainer.data("kendoDraggable").destroy()}if(!that.options.draggable){that.draggable.destroy()}if(that.dataSource&&that._refreshHandler){that.dataSource.unbind("change",that._refreshHandler);that._refreshHandler=null}that.groupContainer=that.element=that.draggable=null},options:{name:"Groupable",filter:"th",draggableElements:"th",messages:{empty:"Drag a column header and drop it here to group by that column"}},indicator:function(field){var indicators=$(".k-group-indicator",this.groupContainer);return $.grep(indicators,function(item){return $(item).attr(kendo.attr("field"))===field})[0]},buildIndicator:function(field,title,dir){return indicatorTmpl({field:field.replace(/"/g,"'"),dir:dir,title:title,ns:kendo.ns})},descriptors:function(){var that=this,indicators=$(".k-group-indicator",that.groupContainer),aggregates,names,field,idx,length;aggregates=that.element.find(that.options.filter).map(function(){var cell=$(this),aggregate=cell.attr(kendo.attr("aggregates")),member=cell.attr(kendo.attr("field"));if(aggregate&&aggregate!==""){names=aggregate.split(",");aggregate=[];for(idx=0,length=names.length;idx=right&&!isRtl||positionitem.right)})[0];if(position){position={left:isRtl?position.element.position().left+position.element.outerWidth()+marginRight:position.element.position().left-marginLeft,element:position.element,before:true}}}return position},_drag:function(event){var position=this._dropCuePosition(event.x.location);if(position){dropCue.css({left:position.left,right:"auto"})}},_canDrag:function(element){var field=element.attr(kendo.attr("field"));return element.attr(kendo.attr("groupable"))!="false"&&field&&(element.hasClass("k-group-indicator")||!this.indicator(field))},_canDrop:function(source,target,position){var next=source.next(),result=source[0]!==target[0]&&(!next[0]||target[0]!==next[0]||(!isRtl&&position>next.position().left||isRtl&&position
    ');element.find(draggable.options.filter).kendoDropTarget({group:draggable.options.group,dragenter:function(e){if(!that._draggable){return}var dropTarget=this.element,offset;var denied=!that._dropTargetAllowed(dropTarget)||that._isLastDraggable();toggleHintClass(e.draggable.hint,denied);if(!denied){offset=getOffset(dropTarget);var left=offset.left;if(options.inSameContainer&&!options.inSameContainer(dropTarget,that._draggable)){that._dropTarget=dropTarget}else{if(that._elements.index(dropTarget)>that._elements.index(that._draggable)){left+=dropTarget.outerWidth()}}that.reorderDropCue.css({height:dropTarget.outerHeight(),top:offset.top,left:left}).appendTo(document.body)}},dragleave:function(e){toggleHintClass(e.draggable.hint,true);that.reorderDropCue.remove();that._dropTarget=null},drop:function(){that._dropTarget=null;if(!that._draggable){return}var dropTarget=this.element;var draggable=that._draggable;var containerChange=false;if(that._dropTargetAllowed(dropTarget)&&!that._isLastDraggable()){that.trigger(CHANGE,{element:that._draggable,oldIndex:that._elements.index(draggable),newIndex:that._elements.index(dropTarget),position:getOffset(that.reorderDropCue).left>getOffset(dropTarget).left?"after":"before"})}}});draggable.bind(["dragcancel","dragend","dragstart","drag"],{dragcancel:function(){that.reorderDropCue.remove();that._draggable=null;that._elements=null},dragend:function(){that.reorderDropCue.remove();that._draggable=null;that._elements=null},dragstart:function(e){that._draggable=e.currentTarget;that._elements=that.element.find(that.draggable.options.filter)},drag:function(e){if(!that._dropTarget||this.hint.find(".k-drag-status").hasClass("k-denied")){return}var dropStartOffset=getOffset(that._dropTarget).left;var width=that._dropTarget.outerWidth();if(e.pageX>dropStartOffset+width/2){that.reorderDropCue.css({left:dropStartOffset+width})}else{that.reorderDropCue.css({left:dropStartOffset})}}})},options:{name:"Reorderable",filter:"*"},events:[CHANGE],_isLastDraggable:function(){var inSameContainer=this.options.inSameContainer,draggable=this._draggable[0],elements=this._elements.get(),found=false,item;if(!inSameContainer){return false}while(!found&&elements.length>0){item=elements.pop();found=draggable!==item&&inSameContainer(draggable,item)}return !found},_dropTargetAllowed:function(dropTarget){var inSameContainer=this.options.inSameContainer,dragOverContainers=this.options.dragOverContainers,draggable=this._draggable;if(draggable[0]===dropTarget[0]){return false}if(!inSameContainer||!dragOverContainers){return true}if(inSameContainer(draggable,dropTarget)){return true}return dragOverContainers(this._elements.index(draggable))},destroy:function(){var that=this;Widget.fn.destroy.call(that);that.element.find(that.draggable.options.filter).each(function(){var item=$(this);if(item.data("kendoDropTarget")){item.data("kendoDropTarget").destroy()}});if(that.draggable){that.draggable.destroy();that.draggable.element=that.draggable=null}that.elements=that.reorderDropCue=that._elements=that._draggable=null}});kendo.ui.plugin(Reorderable)})(window.kendo.jQuery);(function($,undefined){var kendo=window.kendo,ui=kendo.ui,Widget=ui.Widget,proxy=$.proxy,isFunction=kendo.isFunction,extend=$.extend,HORIZONTAL="horizontal",VERTICAL="vertical",START="start",RESIZE="resize",RESIZEEND="resizeend";var Resizable=Widget.extend({init:function(element,options){var that=this;Widget.fn.init.call(that,element,options);that.orientation=that.options.orientation.toLowerCase()!=VERTICAL?HORIZONTAL:VERTICAL;that._positionMouse=that.orientation==HORIZONTAL?"x":"y";that._position=that.orientation==HORIZONTAL?"left":"top";that._sizingDom=that.orientation==HORIZONTAL?"outerWidth":"outerHeight";that.draggable=new ui.Draggable(element,{distance:0,filter:options.handle,drag:proxy(that._resize,that),dragcancel:proxy(that._cancel,that),dragstart:proxy(that._start,that),dragend:proxy(that._stop,that)});that.userEvents=that.draggable.userEvents},events:[RESIZE,RESIZEEND,START],options:{name:"Resizable",orientation:HORIZONTAL},resize:function(){},_max:function(e){var that=this,hintSize=that.hint?that.hint[that._sizingDom]():0,size=that.options.max;return isFunction(size)?size(e):size!==undefined?(that._initialElementPosition+size)-hintSize:size},_min:function(e){var that=this,size=that.options.min;return isFunction(size)?size(e):size!==undefined?that._initialElementPosition+size:size},_start:function(e){var that=this,hint=that.options.hint,el=$(e.currentTarget);that._initialElementPosition=el.position()[that._position];that._initialMousePosition=e[that._positionMouse].startLocation;if(hint){that.hint=isFunction(hint)?$(hint(el)):hint;that.hint.css({position:"absolute"}).css(that._position,that._initialElementPosition).appendTo(that.element)}that.trigger(START,e);that._maxPosition=that._max(e);that._minPosition=that._min(e);$(document.body).css("cursor",el.css("cursor"))},_resize:function(e){var that=this,maxPosition=that._maxPosition,minPosition=that._minPosition,currentPosition=that._initialElementPosition+(e[that._positionMouse].location-that._initialMousePosition),position;position=minPosition!==undefined?Math.max(minPosition,currentPosition):currentPosition;that.position=position=maxPosition!==undefined?Math.min(maxPosition,position):position;if(that.hint){that.hint.toggleClass(that.options.invalidClass||"",position==maxPosition||position==minPosition).css(that._position,position)}that.resizing=true;that.trigger(RESIZE,extend(e,{position:position}))},_stop:function(e){var that=this;if(that.hint){that.hint.remove()}that.resizing=false;that.trigger(RESIZEEND,extend(e,{position:that.position}));$(document.body).css("cursor","")},_cancel:function(e){var that=this;if(that.hint){that.position=undefined;that.hint.css(that._position,that._initialElementPosition);that._stop(e)}},destroy:function(){var that=this;Widget.fn.destroy.call(that);if(that.draggable){that.draggable.destroy()}},press:function(target){if(!target){return}var position=target.position(),that=this;that.userEvents.press(position.left,position.top,target[0]);that.targetPosition=position;that.target=target},move:function(delta){var that=this,orientation=that._position,position=that.targetPosition,current=that.position;if(current===undefined){current=position[orientation]}position[orientation]=current+delta;that.userEvents.move(position.left,position.top)},end:function(){this.userEvents.end();this.target=this.position=undefined}});kendo.ui.plugin(Resizable)})(window.kendo.jQuery);(function($,undefined){var kendo=window.kendo,Widget=kendo.ui.Widget,START="start",BEFORE_MOVE="beforeMove",MOVE="move",END="end",CHANGE="change",CANCEL="cancel",ACTION_SORT="sort",ACTION_REMOVE="remove",ACTION_RECEIVE="receive",DEFAULT_FILTER=">*",MISSING_INDEX=-1;function containsOrEqualTo(parent,child){try{return $.contains(parent,child)||parent==child}catch(e){return false}}function defaultHint(element){return element.clone()}function defaultPlaceholder(element){return element.clone().removeAttr("id").css("visibility","hidden")}var Sortable=Widget.extend({init:function(element,options){var that=this;Widget.fn.init.call(that,element,options);if(!that.options.placeholder){that.options.placeholder=defaultPlaceholder}if(!that.options.hint){that.options.hint=defaultHint}that._draggable=that._createDraggable();that.floating=false},events:[START,BEFORE_MOVE,MOVE,END,CHANGE,CANCEL],options:{name:"Sortable",hint:null,placeholder:null,filter:DEFAULT_FILTER,holdToDrag:false,disabled:null,container:null,connectWith:null,handler:null,cursorOffset:null,axis:null,ignore:null,cursor:"auto"},destroy:function(){this._draggable.destroy();Widget.fn.destroy.call(this)},_createDraggable:function(){var that=this,element=that.element,options=that.options;return new kendo.ui.Draggable(element,{filter:options.filter,hint:kendo.isFunction(options.hint)?options.hint:$(options.hint),holdToDrag:options.holdToDrag,container:options.container?$(options.container):null,cursorOffset:options.cursorOffset,axis:options.axis,ignore:options.ignore,dragstart:$.proxy(that._dragstart,that),dragcancel:$.proxy(that._dragcancel,that),drag:$.proxy(that._drag,that),dragend:$.proxy(that._dragend,that)})},_dragstart:function(e){var draggedElement=this.draggedElement=e.currentTarget,target=e.target||kendo.elementUnderCursor(e),disabled=this.options.disabled,handler=this.options.handler,_placeholder=this.options.placeholder,placeholder=this.placeholder=kendo.isFunction(_placeholder)?$(_placeholder.call(this,draggedElement)):$(_placeholder);if(disabled&&draggedElement.is(disabled)){e.preventDefault()}else{if(handler&&!$(target).is(handler)){e.preventDefault()}else{if(this.trigger(START,{item:draggedElement,draggableEvent:e})){e.preventDefault()}else{this.floating=this._isFloating(draggedElement);draggedElement.css("display","none");draggedElement.before(placeholder);this._setCursor()}}}},_dragcancel:function(e){this._cancel();this.trigger(CANCEL,{item:this.draggedElement});this._resetCursor()},_drag:function(e){var draggedElement=this.draggedElement,target=this._findTarget(e),targetCenter,cursorOffset={left:e.x.location,top:e.y.location},offsetDelta,axisDelta={x:e.x.delta,y:e.y.delta},direction,sibling,getSibling,axis=this.options.axis,eventData={item:draggedElement,list:this,draggableEvent:e};if(axis==="x"||axis==="y"){this._movementByAxis(axis,cursorOffset,axisDelta[axis],eventData);return}if(target){targetCenter=this._getElementCenter(target.element);offsetDelta={left:Math.round(cursorOffset.left-targetCenter.left),top:Math.round(cursorOffset.top-targetCenter.top)};$.extend(eventData,{target:target.element});if(target.appendToBottom){this._movePlaceholder(target,null,eventData);return}if(target.appendAfterHidden){this._movePlaceholder(target,"next",eventData)}if(this.floating){if(axisDelta.x<0&&offsetDelta.left<0){direction="prev"}else{if(axisDelta.x>0&&offsetDelta.left>0){direction="next"}}}else{if(axisDelta.y<0&&offsetDelta.top<0){direction="prev"}else{if(axisDelta.y>0&&offsetDelta.top>0){direction="next"}}}if(direction){getSibling=(direction==="prev")?jQuery.fn.prev:jQuery.fn.next;sibling=getSibling.call(target.element);while(sibling.length&&!sibling.is(":visible")){sibling=getSibling.call(sibling)}if(sibling[0]!=this.placeholder[0]){this._movePlaceholder(target,direction,eventData)}}}},_dragend:function(e){var placeholder=this.placeholder,draggedElement=this.draggedElement,draggedIndex=this.indexOf(draggedElement),placeholderIndex=this.indexOf(placeholder),connectWith=this.options.connectWith,connectedList,isDefaultPrevented,eventData,connectedListEventData;this._resetCursor();eventData={action:ACTION_SORT,item:draggedElement,oldIndex:draggedIndex,newIndex:placeholderIndex,draggableEvent:e};if(placeholderIndex>=0){isDefaultPrevented=this.trigger(END,eventData)}else{connectedList=placeholder.parents(connectWith).getKendoSortable();eventData.action=ACTION_REMOVE;connectedListEventData=$.extend({},eventData,{action:ACTION_RECEIVE,oldIndex:MISSING_INDEX,newIndex:connectedList.indexOf(placeholder)});isDefaultPrevented=!(!this.trigger(END,eventData)&&!connectedList.trigger(END,connectedListEventData))}if(isDefaultPrevented||placeholderIndex===draggedIndex){this._cancel();return}placeholder.replaceWith(draggedElement);draggedElement.show();this._draggable.dropped=true;eventData={action:this.indexOf(draggedElement)!=MISSING_INDEX?ACTION_SORT:ACTION_REMOVE,item:draggedElement,oldIndex:draggedIndex,newIndex:this.indexOf(draggedElement),draggableEvent:e};this.trigger(CHANGE,eventData);if(connectedList){connectedListEventData=$.extend({},eventData,{action:ACTION_RECEIVE,oldIndex:MISSING_INDEX,newIndex:connectedList.indexOf(draggedElement)});connectedList.trigger(CHANGE,connectedListEventData)}},_findTarget:function(e){var element=this._findElementUnderCursor(e),items,connectWith=this.options.connectWith,node;if($.contains(this.element[0],element)){items=this.items();node=items.filter(element)[0]||items.has(element)[0];return node?{element:$(node),sortable:this}:null}else{if(this.element[0]==element&&this._isEmpty()){return{element:this.element,sortable:this,appendToBottom:true}}else{if(this.element[0]==element&&this._isLastHidden()){node=this.items().eq(0);return{element:node,sortable:this,appendAfterHidden:true}}else{if(connectWith){return this._searchConnectedTargets(element,e)}}}}},_findElementUnderCursor:function(e){var elementUnderCursor=kendo.elementUnderCursor(e),draggable=e.sender,disabled=this.options.disabled,filter=this.options.filter,items=this.items();if(containsOrEqualTo(draggable.hint[0],elementUnderCursor)){draggable.hint.hide();elementUnderCursor=kendo.elementUnderCursor(e);if(!elementUnderCursor){elementUnderCursor=kendo.elementUnderCursor(e)}draggable.hint.show()}return elementUnderCursor},_searchConnectedTargets:function(element,e){var connected=$(this.options.connectWith),sortableInstance,items,node;for(var i=0;i0&&cursorPosition-targetCenter>0){this._movePlaceholder({element:target,sortable:this},"next",eventData)}}},_movePlaceholder:function(target,direction,eventData){var placeholder=this.placeholder;if(!target.sortable.trigger(BEFORE_MOVE,eventData)){if(!direction){target.element.append(placeholder)}else{if(direction==="prev"){target.element.before(placeholder)}else{if(direction==="next"){target.element.after(placeholder)}}}target.sortable.trigger(MOVE,eventData)}},_setCursor:function(){var cursor=this.options.cursor,body;if(cursor&&cursor!=="auto"){body=$(document.body);this._originalCursorType=body.css("cursor");body.css({cursor:cursor});if(!this._cursorStylesheet){this._cursorStylesheet=$("")}this._cursorStylesheet.appendTo(body)}},_resetCursor:function(){if(this._originalCursorType){$(document.body).css("cursor",this._originalCursorType);this._originalCursorType=null;this._cursorStylesheet.remove()}},_getElementCenter:function(element){var center=element.length?kendo.getOffset(element):null;if(center){center.top+=element.outerHeight()/2;center.left+=element.outerWidth()/2}return center},_isFloating:function(item){return(/left|right/).test(item.css("float"))||(/inline|table-cell/).test(item.css("display"))},_cancel:function(){this.draggedElement.show();this.placeholder.remove()},_items:function(){var filter=this.options.filter,items;if(filter){items=this.element.find(filter)}else{items=this.element.children()}return items},indexOf:function(element){var items=this._items(),placeholder=this.placeholder,draggedElement=this.draggedElement;if(placeholder&&element[0]==placeholder[0]){return items.not(draggedElement).index(element)}else{return items.not(placeholder).index(element)}},items:function(){var placeholder=this.placeholder,items=this._items();if(placeholder){items=items.not(placeholder)}return items},_isEmpty:function(){return !this.items().length},_isLastHidden:function(){return this.items().length===1&&this.items().is(":hidden")}});kendo.ui.plugin(Sortable)})(window.kendo.jQuery);(function($,undefined){var kendo=window.kendo,Widget=kendo.ui.Widget,proxy=$.proxy,abs=Math.abs,shift=Array.prototype.shift,ARIASELECTED="aria-selected",SELECTED="k-state-selected",ACTIVE="k-state-selecting",SELECTABLE="k-selectable",CHANGE="change",NS=".kendoSelectable",UNSELECTING="k-state-unselecting",INPUTSELECTOR="input,a,textarea,.k-multiselect-wrap,select,button",msie=kendo.support.browser.msie,supportEventDelegation=false;(function($){(function(){$('
    ').on("click",">*",function(){supportEventDelegation=true}).find("span").click().end().off()})()})($);var Selectable=Widget.extend({init:function(element,options){var that=this,multiple;Widget.fn.init.call(that,element,options);that._marquee=$("
    ");that._lastActive=null;that.element.addClass(SELECTABLE);that.relatedTarget=that.options.relatedTarget;multiple=that.options.multiple;that.userEvents=new kendo.UserEvents(that.element,{global:true,allowSelection:true,filter:(!supportEventDelegation?"."+SELECTABLE+" ":"")+that.options.filter,tap:proxy(that._tap,that)});if(multiple){that.userEvents.bind("start",proxy(that._start,that)).bind("move",proxy(that._move,that)).bind("end",proxy(that._end,that)).bind("select",proxy(that._select,that))}},events:[CHANGE],options:{name:"Selectable",filter:">*",multiple:false,relatedTarget:$.noop},_isElement:function(target){var elements=this.element;var idx,length=elements.length,result=false;target=target[0];for(idx=0;idxe.x.location?e.x.location:e.x.startLocation,top:e.y.startLocation>e.y.location?e.y.location:e.y.startLocation,width:abs(e.x.initialDelta),height:abs(e.y.initialDelta)};that._marquee.css(position);that._invalidateSelectables(position,(e.event.ctrlKey||e.event.metaKey));e.preventDefault()},_end:function(){var that=this;that._marquee.remove();that._unselect(that.element.find(that.options.filter+"."+UNSELECTING)).removeClass(UNSELECTING);var target=that.element.find(that.options.filter+"."+ACTIVE);target=target.add(that.relatedTarget(target));that.value(target);that._lastActive=that._downTarget;that._items=null},_invalidateSelectables:function(position,ctrlKey){var idx,length,target=this._downTarget[0],items=this._items,related,toSelect;for(idx=0,length=items.length;idx0?selected[0]:that.element.find(that.options.filter)[0]},_selectElement:function(element,preventNotify){var toSelect=$(element),isPrevented=!preventNotify&&this._notify("select",{element:element});toSelect.removeClass(ACTIVE);if(!isPrevented){toSelect.addClass(SELECTED);if(this.options.aria){toSelect.attr(ARIASELECTED,true)}}},_notify:function(name,args){args=args||{};return this.trigger(name,args)},_unselect:function(element){element.removeClass(SELECTED);if(this.options.aria){element.attr(ARIASELECTED,false)}return element},_select:function(e){if(this._allowSelection(e.event.target)){if(!msie||(msie&&!$(kendo._activeElement()).is(INPUTSELECTOR))){e.preventDefault()}}},_allowSelection:function(target){if($(target).is(INPUTSELECTOR)){this.userEvents.cancel();this._downTarget=null;return false}return true},clear:function(){var items=this.element.find(this.options.filter+"."+SELECTED);this._unselect(items)},selectRange:function(start,end){var that=this,idx,tmp,items;that.clear();if(that.element.length>1){items=that.options.continuousItems()}if(!items||!items.length){items=that.element.find(that.options.filter)}start=$.inArray($(start)[0],items);end=$.inArray($(end)[0],items);if(start>end){tmp=start;start=end;end=tmp}if(!that.options.useAllItems){end+=that.element.length-1}for(idx=start;idx<=end;idx++){that._selectElement(items[idx])}that._notify(CHANGE)},destroy:function(){var that=this;Widget.fn.destroy.call(that);that.element.off(NS);that.userEvents.destroy();that._marquee=that._lastActive=that.element=that.userEvents=null}});function collision(element,position){var elementPosition=kendo.getOffset(element),right=position.left+position.width,bottom=position.top+position.height;elementPosition.right=elementPosition.left+element.outerWidth();elementPosition.bottom=elementPosition.top+element.outerHeight();return !(elementPosition.left>right||elementPosition.rightbottom||elementPosition.bottom0){isEmpty=false}});if(isEmpty){element.addClass(KBUTTONICON)}else{element.addClass(KBUTTONICONTEXT)}}if(icon){span=element.children("span.k-icon").first();if(!span[0]){span=$('').prependTo(element)}span.addClass("k-i-"+icon)}else{if(spriteCssClass){span=element.children("span.k-sprite").first();if(!span[0]){span=$('').prependTo(element)}span.addClass(spriteCssClass)}else{if(imageUrl){img=element.children("img.k-image").first();if(!img[0]){img=$('icon').prependTo(element)}img.attr("src",imageUrl)}}}},enable:function(enable){var that=this,element=that.element;if(enable===undefined){enable=true}enable=!!enable;that.options.enable=enable;element.toggleClass(DISABLEDSTATE,!enable).attr("aria-disabled",!enable).attr(DISABLED,!enable);element.blur()}});kendo.ui.plugin(Button)})(window.kendo.jQuery);(function($,undefined){var kendo=window.kendo,ui=kendo.ui,Widget=ui.Widget,proxy=$.proxy,FIRST=".k-i-seek-w",LAST=".k-i-seek-e",PREV=".k-i-arrow-w",NEXT=".k-i-arrow-e",CHANGE="change",NS=".kendoPager",CLICK="click",KEYDOWN="keydown",DISABLED="disabled",iconTemplate=kendo.template('#=text#');function button(template,idx,text,numeric,title){return template({idx:idx,text:text,ns:kendo.ns,numeric:numeric,title:title||""})}function icon(className,text,wrapClassName){return iconTemplate({className:className.substring(1),text:text,wrapClassName:wrapClassName||""})}function update(element,selector,page,disabled){element.find(selector).parent().attr(kendo.attr("page"),page).attr("tabindex",-1).toggleClass("k-state-disabled",disabled)}function first(element,page){update(element,FIRST,1,page<=1)}function prev(element,page){update(element,PREV,Math.max(1,page-1),page<=1)}function next(element,page,totalPages){update(element,NEXT,Math.min(totalPages,page+1),page>=totalPages)}function last(element,page,totalPages){update(element,LAST,totalPages,page>=totalPages)}var Pager=Widget.extend({init:function(element,options){var that=this,page,totalPages;Widget.fn.init.call(that,element,options);options=that.options;that.dataSource=kendo.data.DataSource.create(options.dataSource);that.linkTemplate=kendo.template(that.options.linkTemplate);that.selectTemplate=kendo.template(that.options.selectTemplate);page=that.page();totalPages=that.totalPages();that._refreshHandler=proxy(that.refresh,that);that.dataSource.bind(CHANGE,that._refreshHandler);if(options.previousNext){if(!that.element.find(FIRST).length){that.element.append(icon(FIRST,options.messages.first,"k-pager-first"));first(that.element,page,totalPages)}if(!that.element.find(PREV).length){that.element.append(icon(PREV,options.messages.previous));prev(that.element,page,totalPages)}}if(options.numeric){that.list=that.element.find(".k-pager-numbers");if(!that.list.length){that.list=$('
      ').appendTo(that.element)}}if(options.input){if(!that.element.find(".k-pager-input").length){that.element.append(''+options.messages.page+''+kendo.format(options.messages.of,totalPages)+"")}that.element.on(KEYDOWN+NS,".k-pager-input input",proxy(that._keydown,that))}if(options.previousNext){if(!that.element.find(NEXT).length){that.element.append(icon(NEXT,options.messages.next));next(that.element,page,totalPages)}if(!that.element.find(LAST).length){that.element.append(icon(LAST,options.messages.last,"k-pager-last"));last(that.element,page,totalPages)}}if(options.pageSizes){if(!that.element.find(".k-pager-sizes").length){$(''+kendo.format(options.messages.of,totalPages)).find("input").val(page).attr(DISABLED,total<1).toggleClass("k-state-disabled",total<1)}if(options.previousNext){first(that.element,page,totalPages);prev(that.element,page,totalPages);next(that.element,page,totalPages);last(that.element,page,totalPages)}if(options.pageSizes){that.element.find(".k-pager-sizes select").val(pageSize).filter("["+kendo.attr("role")+"=dropdownlist]").kendoDropDownList("value",pageSize).kendoDropDownList("text",pageSize)}},_keydown:function(e){if(e.keyCode===kendo.keys.ENTER){var input=this.element.find(".k-pager-input").find("input"),page=parseInt(input.val(),10);if(isNaN(page)||page<1||page>this.totalPages()){page=this.page()}input.val(page);this.page(page)}},_refreshClick:function(e){e.preventDefault();this.dataSource.read()},_change:function(e){var pageSize=parseInt(e.currentTarget.value,10);if(!isNaN(pageSize)){this.dataSource.pageSize(pageSize)}},_click:function(e){var target=$(e.currentTarget);e.preventDefault();if(!target.is(".k-state-disabled")){this.page(target.attr(kendo.attr("page")))}},totalPages:function(){return Math.ceil((this.dataSource.total()||0)/this.pageSize())},pageSize:function(){return this.dataSource.pageSize()||this.dataSource.total()},page:function(page){if(page!==undefined){this.dataSource.page(page);this.trigger(CHANGE,{index:page})}else{if(this.dataSource.total()>0){return this.dataSource.page()}else{return 0}}}});ui.plugin(Pager)})(window.kendo.jQuery);(function($,undefined){var kendo=window.kendo,ui=kendo.ui,Widget=ui.Widget,support=kendo.support,getOffset=kendo.getOffset,activeElement=kendo._activeElement,OPEN="open",CLOSE="close",DEACTIVATE="deactivate",ACTIVATE="activate",CENTER="center",LEFT="left",RIGHT="right",TOP="top",BOTTOM="bottom",ABSOLUTE="absolute",HIDDEN="hidden",BODY="body",LOCATION="location",POSITION="position",VISIBLE="visible",EFFECTS="effects",ACTIVE="k-state-active",ACTIVEBORDER="k-state-border",ACTIVEBORDERREGEXP=/k-state-border-(\w+)/,ACTIVECHILDREN=".k-picker-wrap, .k-dropdown-wrap, .k-link",MOUSEDOWN="down",DOCUMENT_ELEMENT=$(document.documentElement),RESIZE_SCROLL="resize scroll",cssPrefix=support.transitions.css,TRANSFORM=cssPrefix+"transform",extend=$.extend,NS=".kendoPopup",styles=["font-size","font-family","font-stretch","font-style","font-weight","line-height"];function contains(container,target){return container===target||$.contains(container,target)}var Popup=Widget.extend({init:function(element,options){var that=this,parentPopup;options=options||{};if(options.isRtl){options.origin=options.origin||BOTTOM+" "+RIGHT;options.position=options.position||TOP+" "+RIGHT}Widget.fn.init.call(that,element,options);element=that.element;options=that.options;that.collisions=options.collision?options.collision.split(" "):[];that.downEvent=kendo.applyEventMap(MOUSEDOWN,kendo.guid());if(that.collisions.length===1){that.collisions.push(that.collisions[0])}parentPopup=$(that.options.anchor).closest(".k-popup,.k-group").filter(":not([class^=km-])");options.appendTo=$($(options.appendTo)[0]||parentPopup[0]||BODY);that.element.hide().addClass("k-popup k-group k-reset").toggleClass("k-rtl",!!options.isRtl).css({position:ABSOLUTE}).appendTo(options.appendTo).on("mouseenter"+NS,function(){that._hovered=true}).on("mouseleave"+NS,function(){that._hovered=false});that.wrapper=$();if(options.animation===false){options.animation={open:{effects:{}},close:{hide:true,effects:{}}}}extend(options.animation.open,{complete:function(){that.wrapper.css({overflow:VISIBLE});that._trigger(ACTIVATE)}});extend(options.animation.close,{complete:function(){that._animationClose()}});that._mousedownProxy=function(e){that._mousedown(e)};that._resizeProxy=function(e){that._resize(e)};if(options.toggleTarget){$(options.toggleTarget).on(options.toggleEvent+NS,$.proxy(that.toggle,that))}},events:[OPEN,ACTIVATE,CLOSE,DEACTIVATE],options:{name:"Popup",toggleEvent:"click",origin:BOTTOM+" "+LEFT,position:TOP+" "+LEFT,anchor:BODY,appendTo:null,collision:"flip fit",viewport:window,copyAnchorStyles:true,autosize:false,modal:false,animation:{open:{effects:"slideIn:down",transition:true,duration:200},close:{duration:100,hide:true}}},_animationClose:function(){var that=this,options=that.options;that.wrapper.hide();var location=that.wrapper.data(LOCATION),anchor=$(options.anchor),direction,dirClass;if(location){that.wrapper.css(location)}if(options.anchor!=BODY){direction=(anchor[0].className.match(ACTIVEBORDERREGEXP)||["","down"])[1];dirClass=ACTIVEBORDER+"-"+direction;anchor.removeClass(dirClass).children(ACTIVECHILDREN).removeClass(ACTIVE).removeClass(dirClass);that.element.removeClass(ACTIVEBORDER+"-"+kendo.directions[direction].reverse)}that._closing=false;that._trigger(DEACTIVATE)},destroy:function(){var that=this,options=that.options,element=that.element.off(NS),parent;Widget.fn.destroy.call(that);if(options.toggleTarget){$(options.toggleTarget).off(NS)}if(!options.modal){DOCUMENT_ELEMENT.unbind(that.downEvent,that._mousedownProxy);that._scrollableParents().unbind(RESIZE_SCROLL,that._resizeProxy)}kendo.destroy(that.element.children());element.removeData();if(options.appendTo[0]===document.body){parent=element.parent(".k-animation-container");if(parent[0]){parent.remove()}else{element.remove()}}},open:function(x,y){var that=this,fixed={isFixed:!isNaN(parseInt(y,10)),x:x,y:y},element=that.element,options=that.options,direction="down",animation,wrapper,anchor=$(options.anchor),mobile=element[0]&&element.hasClass("km-widget");if(!that.visible()){if(options.copyAnchorStyles){if(mobile&&styles[0]=="font-size"){styles.shift()}element.css(kendo.getComputedStyles(anchor[0],styles))}if(element.data("animating")||that._trigger(OPEN)){return}if(!options.modal){DOCUMENT_ELEMENT.unbind(that.downEvent,that._mousedownProxy).bind(that.downEvent,that._mousedownProxy);if(!(support.mobileOS.ios||support.mobileOS.android)){this._scrollableParents().unbind(RESIZE_SCROLL,that._resizeProxy).bind(RESIZE_SCROLL,that._resizeProxy)}}that.wrapper=wrapper=kendo.wrap(element,options.autosize).css({overflow:HIDDEN,display:"block",position:ABSOLUTE});if(support.mobileOS.android){wrapper.css(TRANSFORM,"translatez(0)")}wrapper.css(POSITION);if($(options.appendTo)[0]==document.body){wrapper.css(TOP,"-10000px")}animation=extend(true,{},options.animation.open);that.flipped=that._position(fixed);animation.effects=kendo.parseEffects(animation.effects,that.flipped);direction=animation.effects.slideIn?animation.effects.slideIn.direction:direction;if(options.anchor!=BODY){var dirClass=ACTIVEBORDER+"-"+direction;element.addClass(ACTIVEBORDER+"-"+kendo.directions[direction].reverse);anchor.addClass(dirClass).children(ACTIVECHILDREN).addClass(ACTIVE).addClass(dirClass)}element.data(EFFECTS,animation.effects).kendoStop(true).kendoAnimate(animation)}},toggle:function(){var that=this;that[that.visible()?CLOSE:OPEN]()},visible:function(){return this.element.is(":"+VISIBLE)},close:function(skipEffects){var that=this,options=that.options,wrap,animation,openEffects,closeEffects;if(that.visible()){wrap=(that.wrapper[0]?that.wrapper:kendo.wrap(that.element).hide());if(that._closing||that._trigger(CLOSE)){return}that.element.find(".k-popup").each(function(){var that=$(this),popup=that.data("kendoPopup");if(popup){popup.close(skipEffects)}});DOCUMENT_ELEMENT.unbind(that.downEvent,that._mousedownProxy);that._scrollableParents().unbind(RESIZE_SCROLL,that._resizeProxy);if(skipEffects){animation={hide:true,effects:{}}}else{animation=extend(true,{},options.animation.close);openEffects=that.element.data(EFFECTS);closeEffects=animation.effects;if(!closeEffects&&!kendo.size(closeEffects)&&openEffects&&kendo.size(openEffects)){animation.effects=openEffects;animation.reverse=true}that._closing=true}that.element.kendoStop(true);wrap.css({overflow:HIDDEN});that.element.kendoAnimate(animation)}},_trigger:function(ev){return this.trigger(ev,{type:ev})},_resize:function(e){var that=this;if(e.type==="resize"){clearTimeout(that._resizeTimeout);that._resizeTimeout=setTimeout(function(){that._position();that._resizeTimeout=null},50)}else{if(!that._hovered&&!contains(that.element[0],activeElement())){that.close()}}},_mousedown:function(e){var that=this,container=that.element[0],options=that.options,anchor=$(options.anchor)[0],toggleTarget=options.toggleTarget,target=kendo.eventTarget(e),popup=$(target).closest(".k-popup"),mobile=popup.parent().parent(".km-shim").length;popup=popup[0];if(!mobile&&popup&&popup!==that.element[0]){return}if($(e.target).closest("a").data("rel")==="popover"){return}if(!contains(container,target)&&!contains(anchor,target)&&!(toggleTarget&&contains($(toggleTarget)[0],target))){that.close()}},_fit:function(position,size,viewPortSize){var output=0;if(position+size>viewPortSize){output=viewPortSize-(position+size)}if(position<0){output=-position}return output},_flip:function(offset,size,anchorSize,viewPortSize,origin,position,boxSize){var output=0;boxSize=boxSize||size;if(position!==origin&&position!==CENTER&&origin!==CENTER){if(offset+boxSize>viewPortSize){output+=-(anchorSize+size)}if(offset+output<0){output+=anchorSize+size}}return output},_scrollableParents:function(){return $(this.options.anchor).parentsUntil("body").filter(function(index,element){var computedStyle=kendo.getComputedStyles(element,["overflow"]);return computedStyle.overflow!="visible"}).add(window)},_position:function(fixed){var that=this,element=that.element.css(POSITION,""),wrapper=that.wrapper,options=that.options,viewport=$(options.viewport),viewportOffset=viewport.offset(),anchor=$(options.anchor),origins=options.origin.toLowerCase().split(" "),positions=options.position.toLowerCase().split(" "),collisions=that.collisions,zoomLevel=support.zoomLevel(),siblingContainer,parents,parentZIndex,zIndex=10002,isWindow=!!((viewport[0]==window)&&window.innerWidth&&(zoomLevel<=1.02)),idx=0,length,viewportWidth,viewportHeight;viewportWidth=isWindow?window.innerWidth:viewport.width();viewportHeight=isWindow?window.innerHeight:viewport.height();siblingContainer=anchor.parents().filter(wrapper.siblings());if(siblingContainer[0]){parentZIndex=Math.max(Number(siblingContainer.css("zIndex")),0);if(parentZIndex){zIndex=parentZIndex+10}else{parents=anchor.parentsUntil(siblingContainer);for(length=parents.length;idx0,closeIcon;function attachClick(target){target.on(CLICK+NS,function(){popup.close()})}if(options.hideOnClick){popup.bind("activate",function(e){if(attachDelay){setTimeout(function(){attachClick(popup.element)},allowHideAfter)}else{attachClick(popup.element)}})}else{if(options.button){closeIcon=popup.element.find(KICLOSE);if(attachDelay){setTimeout(function(){attachClick(closeIcon)},allowHideAfter)}else{attachClick(closeIcon)}}}},_showPopup:function(wrapper,options){var that=this,autoHideAfter=options.autoHideAfter,x=options.position.left,y=options.position.top,allowHideAfter=options.allowHideAfter,popup,openPopup,attachClick,closeIcon;openPopup=$("."+that._guid).last();popup=new kendo.ui.Popup(wrapper,{anchor:openPopup[0]?openPopup:document.body,origin:that._popupOrigin,position:that._popupPosition,animation:options.animation,modal:true,collision:"",isRtl:that._isRtl,close:function(e){that.trigger(HIDE,{element:this.element})},deactivate:function(e){e.sender.element.off(NS);e.sender.element.find(KICLOSE).off(NS);e.sender.destroy()}});that._attachPopupEvents(options,popup);if(openPopup[0]){popup.open()}else{if(x===null){x=$(window).width()-wrapper.width()-options.position.right}if(y===null){y=$(window).height()-wrapper.height()-options.position.bottom}popup.open(x,y)}popup.wrapper.addClass(that._guid).css(extend({margin:0},that._popupPaddings));if(options.position.pinned){popup.wrapper.css("position","fixed");if(openPopup[0]){that._togglePin(popup.wrapper,true)}}else{if(!openPopup[0]){that._togglePin(popup.wrapper,false)}}if(autoHideAfter>0){setTimeout(function(){popup.close()},autoHideAfter)}},_togglePin:function(wrapper,pin){var win=$(window),sign=pin?-1:1;wrapper.css({top:parseInt(wrapper.css(TOP),10)+sign*win.scrollTop(),left:parseInt(wrapper.css(LEFT),10)+sign*win.scrollLeft()})},_attachStaticEvents:function(options,wrapper){var that=this,allowHideAfter=options.allowHideAfter,attachDelay=!isNaN(allowHideAfter)&&allowHideAfter>0;function attachClick(target){target.on(CLICK+NS,proxy(that._hideStatic,that,wrapper))}if(options.hideOnClick){if(attachDelay){setTimeout(function(){attachClick(wrapper)},allowHideAfter)}else{attachClick(wrapper)}}else{if(options.button){if(attachDelay){setTimeout(function(){attachClick(wrapper.find(KICLOSE))},allowHideAfter)}else{attachClick(wrapper.find(KICLOSE))}}}},_showStatic:function(wrapper,options){var that=this,autoHideAfter=options.autoHideAfter,animation=options.animation,insertionMethod=options.stacking==UP||options.stacking==LEFT?"prependTo":"appendTo",attachClick;wrapper.addClass(that._guid)[insertionMethod](options.appendTo).hide().kendoAnimate(animation.open);that._attachStaticEvents(options,wrapper);if(autoHideAfter>0){setTimeout(function(){that._hideStatic(wrapper)},autoHideAfter)}},_hideStatic:function(wrapper){wrapper.kendoAnimate(extend(this.options.animation.close,{complete:function(){wrapper.off(NS).find(KICLOSE).off(NS);wrapper.remove()}}));this.trigger(HIDE,{element:wrapper})},show:function(content,type){var that=this,options=that.options,wrapper=$(WRAPPER),args,defaultArgs,popup;if(!type){type=INFO}if(content!==null&&content!==undefined&&content!==""){if(kendo.isFunction(content)){content=content()}defaultArgs={typeIcon:type,content:""};if($.isPlainObject(content)){args=extend(defaultArgs,content)}else{args=extend(defaultArgs,{content:content})}wrapper.addClass(KNOTIFICATION+"-"+type).toggleClass(KNOTIFICATION+"-button",options.button).attr("data-role","alert").css({width:options.width,height:options.height}).append(that._getCompiled(type)(args));if($(options.appendTo)[0]){that._showStatic(wrapper,options)}else{that._showPopup(wrapper,options)}that.trigger(SHOW,{element:wrapper})}return that},info:function(content){return this.show(content,INFO)},success:function(content){return this.show(content,SUCCESS)},warning:function(content){return this.show(content,WARNING)},error:function(content){return this.show(content,ERROR)},hide:function(){var that=this,openedNotifications=that.getNotifications();if(that.options.appendTo){openedNotifications.each(function(idx,element){that._hideStatic($(element))})}else{openedNotifications.each(function(idx,element){var popup=$(element).data("kendoPopup");if(popup){popup.close()}})}return that},getNotifications:function(){var that=this,guidElements=$("."+that._guid);if(that.options.appendTo){return guidElements}else{return guidElements.children("."+KNOTIFICATION)}},setOptions:function(newOptions){var that=this,options;Widget.fn.setOptions.call(that,newOptions);options=that.options;if(newOptions.templates!==undefined){that._compileTemplates(options.templates)}if(newOptions.stacking!==undefined||newOptions.position!==undefined){that._compileStacking(options.stacking,options.position.top)}},destroy:function(){Widget.fn.destroy.call(this);this.getNotifications().off(NS).find(KICLOSE).off(NS)}});kendo.ui.plugin(Notification)})(window.kendo.jQuery);(function($,undefined){var kendo=window.kendo,Widget=kendo.ui.Widget,Popup=kendo.ui.Popup,isFunction=kendo.isFunction,isPlainObject=$.isPlainObject,extend=$.extend,proxy=$.proxy,DOCUMENT=$(document),isLocalUrl=kendo.isLocalUrl,ARIAIDSUFFIX="_tt_active",DESCRIBEDBY="aria-describedby",SHOW="show",HIDE="hide",ERROR="error",CONTENTLOAD="contentLoad",REQUESTSTART="requestStart",KCONTENTFRAME="k-content-frame",TEMPLATE='',IFRAMETEMPLATE=kendo.template(""),NS=".kendoTooltip",POSITIONS={bottom:{origin:"bottom center",position:"top center"},top:{origin:"top center",position:"bottom center"},left:{origin:"center left",position:"center right",collision:"fit flip"},right:{origin:"center right",position:"center left",collision:"fit flip"},center:{position:"center center",origin:"center center"}},REVERSE={top:"bottom",bottom:"top",left:"right",right:"left",center:"center"},DIRCLASSES={bottom:"n",top:"s",left:"e",right:"w",center:"n"},DIMENSIONS={horizontal:{offset:"top",size:"outerHeight"},vertical:{offset:"left",size:"outerWidth"}},DEFAULTCONTENT=function(e){return e.target.data(kendo.ns+"title")};function restoreTitle(element){while(element.length){restoreTitleAttributeForElement(element);element=element.parent()}}function restoreTitleAttributeForElement(element){var title=element.data(kendo.ns+"title");if(title){element.attr("title",title);element.removeData(kendo.ns+"title")}}function saveTitleAttributeForElement(element){var title=element.attr("title");if(title){element.data(kendo.ns+"title",title);element.attr("title","")}}function saveTitleAttributes(element){while(element.length&&!element.is("body")){saveTitleAttributeForElement(element);element=element.parent()}}var Tooltip=Widget.extend({init:function(element,options){var that=this,axis;Widget.fn.init.call(that,element,options);axis=that.options.position.match(/left|right/)?"horizontal":"vertical";that.dimensions=DIMENSIONS[axis];that._documentKeyDownHandler=proxy(that._documentKeyDown,that);that.element.on(that.options.showOn+NS,that.options.filter,proxy(that._showOn,that)).on("mouseenter"+NS,that.options.filter,proxy(that._mouseenter,that));if(this.options.autoHide){that.element.on("mouseleave"+NS,that.options.filter,proxy(that._mouseleave,that))}},options:{name:"Tooltip",filter:"",content:DEFAULTCONTENT,showAfter:100,callout:true,position:"bottom",showOn:"mouseenter",autoHide:true,width:null,height:null,animation:{open:{effects:"fade:in",duration:0},close:{effects:"fade:out",duration:40,hide:true}}},events:[SHOW,HIDE,CONTENTLOAD,ERROR,REQUESTSTART],_mouseenter:function(e){saveTitleAttributes($(e.currentTarget))},_showOn:function(e){var that=this;var currentTarget=$(e.currentTarget);if(that.options.showOn&&that.options.showOn.match(/click|focus/)){that._show(currentTarget)}else{clearTimeout(that.timeout);that.timeout=setTimeout(function(){that._show(currentTarget)},that.options.showAfter)}},_appendContent:function(target){var that=this,contentOptions=that.options.content,element=that.content,showIframe=that.options.iframe,iframe;if(isPlainObject(contentOptions)&&contentOptions.url){if(!("iframe" in that.options)){showIframe=!isLocalUrl(contentOptions.url)}that.trigger(REQUESTSTART,{options:contentOptions,target:target});if(!showIframe){element.empty();kendo.ui.progress(element,true);that._ajaxRequest(contentOptions)}else{element.hide();iframe=element.find("."+KCONTENTFRAME)[0];if(iframe){iframe.src=contentOptions.url||iframe.src}else{element.html(IFRAMETEMPLATE({content:contentOptions}))}element.find("."+KCONTENTFRAME).off("load"+NS).on("load"+NS,function(){that.trigger(CONTENTLOAD);element.show()})}}else{if(contentOptions&&isFunction(contentOptions)){contentOptions=contentOptions({sender:this,target:target});element.html(contentOptions||"")}else{element.html(contentOptions)}}that.angular("compile",function(){return{elements:element}})},_ajaxRequest:function(options){var that=this;jQuery.ajax(extend({type:"GET",dataType:"html",cache:false,error:function(xhr,status){kendo.ui.progress(that.content,false);that.trigger(ERROR,{status:status,xhr:xhr})},success:proxy(function(data){kendo.ui.progress(that.content,false);that.content.html(data);that.trigger(CONTENTLOAD)},that)},options))},_documentKeyDown:function(e){if(e.keyCode===kendo.keys.ESC){this.hide()}},refresh:function(){var that=this,popup=that.popup;if(popup&&popup.options.anchor){that._appendContent(popup.options.anchor)}},hide:function(){if(this.popup){this.popup.close()}},show:function(target){target=target||this.element;saveTitleAttributes(target);this._show(target)},_show:function(target){var that=this,current=that.target();if(!that.popup){that._initPopup()}if(current&¤t[0]!=target[0]){that.popup.close();that.popup.element.kendoStop(true,true)}if(!current||current[0]!=target[0]){that._appendContent(target);that.popup.options.anchor=target}that.popup.one("deactivate",function(){restoreTitle(target);target.removeAttr(DESCRIBEDBY);this.element.removeAttr("id").attr("aria-hidden",true);DOCUMENT.off("keydown"+NS,that._documentKeyDownHandler)});that.popup.open()},_initPopup:function(){var that=this,options=that.options,wrapper=$(kendo.template(TEMPLATE)({callout:options.callout&&options.position!=="center",dir:DIRCLASSES[options.position],autoHide:options.autoHide}));that.popup=new Popup(wrapper,extend({activate:function(){var anchor=this.options.anchor,ariaId=anchor[0].id||that.element[0].id;if(ariaId){anchor.attr(DESCRIBEDBY,ariaId+ARIAIDSUFFIX);this.element.attr("id",ariaId+ARIAIDSUFFIX)}if(options.callout){that._positionCallout()}this.element.removeAttr("aria-hidden");DOCUMENT.on("keydown"+NS,that._documentKeyDownHandler);that.trigger(SHOW)},close:function(){that.trigger(HIDE)},copyAnchorStyles:false,animation:options.animation},POSITIONS[options.position]));wrapper.css({width:options.width,height:options.height});that.content=wrapper.find(".k-tooltip-content");that.arrow=wrapper.find(".k-callout");if(options.autoHide){wrapper.on("mouseleave"+NS,proxy(that._mouseleave,that))}else{wrapper.on("click"+NS,".k-tooltip-button",proxy(that._closeButtonClick,that))}},_closeButtonClick:function(e){e.preventDefault();this.hide()},_mouseleave:function(e){if(this.popup){var element=$(e.currentTarget),offset=element.offset(),pageX=e.pageX,pageY=e.pageY;offset.right=offset.left+element.outerWidth();offset.bottom=offset.top+element.outerHeight();if(pageX>offset.left&&pageXoffset.top&&pageY').css({overflow:support.kineticScrollNeeded?"":"auto"}).on("mouseenter"+ns,LI,function(){$(this).addClass(HOVER)}).on("mouseleave"+ns,LI,function(){$(this).removeClass(HOVER)}).on("click"+ns,LI,proxy(that._click,that)).attr({tabIndex:-1,role:"listbox","aria-hidden":true});that.list=$("
      ").append(that.ul).on("mousedown"+ns,function(e){if(!that.filterInput||that.filterInput[0]!==e.target){e.preventDefault()}});id=element.attr(ID);if(id){that.list.attr(ID,id+"-list");that.ul.attr(ID,id+"_listbox");that._optionID=id+"_option_selected"}that._header();that._accessors();that._initValue()},options:{valuePrimitive:false,headerTemplate:""},setOptions:function(options){Widget.fn.setOptions.call(this,options);if(options&&options.enable!==undefined){options.enabled=options.enable}},focus:function(){this._focused.focus()},readonly:function(readonly){this._editable({readonly:readonly===undefined?true:readonly,disable:false})},enable:function(enable){this._editable({readonly:false,disable:!(enable=enable===undefined?true:enable)})},_filterSource:function(filter){var that=this,options=that.options,dataSource=that.dataSource,expression=dataSource.filter()||{};removeFiltersForField(expression,options.dataTextField);if(filter){expression=expression.filters||[];expression.push(filter)}dataSource.filter(expression)},_header:function(){var template=this.options.headerTemplate;var header;if($.isFunction(template)){template=template({})}if(template){this.list.prepend(template);header=this.ul.prev();this.header=header[0]?header:null}},_initValue:function(){var that=this,value=that.options.value;if(value!==null){that.element.val(value)}else{value=that._accessor();that.options.value=value}that._old=value},_ignoreCase:function(){var that=this,model=that.dataSource.reader.model,field;if(model&&model.fields){field=model.fields[that.options.dataTextField];if(field&&field.type&&field.type!=="string"){that.options.ignoreCase=false}}},items:function(){return this.ul[0].children},current:function(candidate){var that=this;var focused=that._focused.add(that.filterInput);var id=that._optionID;if(candidate!==undefined){if(that._current){that._current.removeClass(FOCUSED).removeAttr("aria-selected").removeAttr(ID);focused.removeAttr("aria-activedescendant")}if(candidate){candidate.addClass(FOCUSED);that._scroll(candidate);if(id){candidate.attr("id",id);focused.attr("aria-activedescendant",id)}}that._current=candidate}else{return that._current}},destroy:function(){var that=this,ns=that.ns;Widget.fn.destroy.call(that);that._unbindDataSource();that.ul.off(ns);that.list.off(ns);if(that._touchScroller){that._touchScroller.destroy()}that.popup.destroy();if(that._form){that._form.off("reset",that._resetHandler)}},dataItem:function(index){var that=this;if(index===undefined){index=that.selectedIndex}else{if(typeof index!=="number"){index=$(that.items()).index(index)}}return that._data()[index]},_accessors:function(){var that=this,element=that.element,options=that.options,getter=kendo.getter,textField=element.attr(kendo.attr("text-field")),valueField=element.attr(kendo.attr("value-field"));if(textField){options.dataTextField=textField}if(valueField){options.dataValueField=valueField}that._text=getter(options.dataTextField);that._value=getter(options.dataValueField)},_aria:function(id){var that=this,options=that.options,element=that._focused.add(that.filterInput);if(options.suggest!==undefined){element.attr("aria-autocomplete",options.suggest?"both":"list")}id=id?id+" "+that.ul[0].id:that.ul[0].id;element.attr("aria-owns",id);that.ul.attr("aria-live",!options.filter||options.filter==="none"?"off":"polite")},_blur:function(){var that=this;that._change();that.close()},_change:function(){var that=this,index=that.selectedIndex,optionValue=that.options.value,value=that.value(),trigger;if(that._isSelect&&!that._bound&&optionValue){value=optionValue}if(value!==that._old){trigger=true}else{if(index!==undefined&&index!==that._oldIndex){trigger=true}}if(trigger){that._old=value;that._oldIndex=index;that.trigger(CHANGE);that.element.trigger(CHANGE)}},_click:function(e){if(!e.isDefaultPrevented()){this._accept($(e.currentTarget))}},_data:function(){return this.dataSource.view()},_enable:function(){var that=this,options=that.options,disabled=that.element.is("[disabled]");if(options.enable!==undefined){options.enabled=options.enable}if(!options.enabled||disabled){that.enable(false)}else{that.readonly(that.element.is("[readonly]"))}},_focus:function(li){var that=this;var userTriggered=true;if(that.popup.visible()&&li&&that.trigger(SELECT,{item:li})){that.close();return}that._select(li);that._triggerCascade(userTriggered);that._blur()},_index:function(value){var that=this,idx,length,data=that._data();for(idx=0,length=data.length;idxheight?height:"auto";popups.height(height);if(height!=="auto"){if(filterInput){offsetHeight+=filterInput.outerHeight()}if(header){offsetHeight+=header.outerHeight()}}if(offsetHeight){height=list.height()-offsetHeight}that.ul.height(height);if(!visible){popups.hide()}}},_adjustListWidth:function(){var list=this.list,width=list[0].style.width,wrapper=this.wrapper,computedStyle,computedWidth;if(!list.data(WIDTH)&&width){return}computedStyle=window.getComputedStyle?window.getComputedStyle(wrapper[0],null):0;computedWidth=computedStyle?parseFloat(computedStyle.width):wrapper.outerWidth();if(computedStyle&&(browser.mozilla||browser.msie)){computedWidth+=parseFloat(computedStyle.paddingLeft)+parseFloat(computedStyle.paddingRight)+parseFloat(computedStyle.borderLeftWidth)+parseFloat(computedStyle.borderRightWidth)}if(list.css("box-sizing")!=="border-box"){width=computedWidth-(list.outerWidth()-list.width())}else{width=computedWidth}list.css({fontFamily:wrapper.css("font-family"),width:width}).data(WIDTH,width);return true},_popup:function(){var that=this,list=that.list,focused=that._focused,options=that.options,wrapper=that.wrapper;that.popup=new ui.Popup(list,extend({},options.popup,{anchor:wrapper,open:function(e){that._adjustListWidth();if(that.trigger(OPEN)){e.preventDefault()}else{focused.attr("aria-expanded",true);that.ul.attr("aria-hidden",false)}},close:function(e){if(that.trigger(CLOSE)){e.preventDefault()}else{focused.attr("aria-expanded",false);that.ul.attr("aria-hidden",true)}},animation:options.animation,isRtl:support.isRtl(wrapper)}));that.popup.one(OPEN,function(){that._height(that._data().length)});that._touchScroller=kendo.touchScroller(that.popup.element)},_makeUnselectable:function(){if(isIE8){this.list.find("*").attr("unselectable","on")}},_toggleHover:function(e){$(e.currentTarget).toggleClass(HOVER,e.type==="mouseenter")},_toggle:function(open,preventFocus){var that=this;var touchEnabled=support.touch&&support.MSPointers&&support.pointers;open=open!==undefined?open:!that.popup.visible();if(!preventFocus&&!touchEnabled&&that._focused[0]!==activeElement()){that._focused.focus()}that[open?OPEN:CLOSE]()},_scroll:function(item){if(!item){return}if(item[0]){item=item[0]}var ul=this.ul[0],itemOffsetTop=item.offsetTop,itemOffsetHeight=item.offsetHeight,ulScrollTop=ul.scrollTop,ulOffsetHeight=ul.clientHeight,bottomDistance=itemOffsetTop+itemOffsetHeight,touchScroller=this._touchScroller,yDimension,offsetHeight;if(touchScroller){yDimension=touchScroller.dimensions.y;if(yDimension.enabled&&itemOffsetTop>yDimension.size){itemOffsetTop=itemOffsetTop-yDimension.size+itemOffsetHeight+4;touchScroller.scrollTo(0,-itemOffsetTop)}}else{offsetHeight=this.header?this.header.outerHeight():0;offsetHeight+=this.filterInput?this.filterInput.outerHeight():0;ul.scrollTop=ulScrollTop>itemOffsetTop?(itemOffsetTop-offsetHeight):bottomDistance>(ulScrollTop+ulOffsetHeight)?(bottomDistance-ulOffsetHeight-offsetHeight):ulScrollTop}},_template:function(){var that=this,options=that.options,template=options.template,hasDataSource=options.dataSource;if(that._isSelect&&that.element[0].length){if(!hasDataSource){options.dataTextField=options.dataTextField||"text";options.dataValueField=options.dataValueField||"value"}}if(!template){that.template=kendo.template('
    • ${'+kendo.expr(options.dataTextField,"data")+"}
    • ",{useWithBlock:false})}else{template=kendo.template(template);that.template=function(data){return'
    • '+template(data)+"
    • "}}},_triggerCascade:function(userTriggered){var that=this,value=that.value();if((!that._bound&&value)||that._old!==value){that.trigger("cascade",{userTriggered:userTriggered})}},_unbindDataSource:function(){var that=this;that.dataSource.unbind(CHANGE,that._refreshHandler).unbind(PROGRESS,that._progressHandler).unbind(REQUESTEND,that._requestEndHandler).unbind("error",that._errorHandler)}});extend(List,{inArray:function(node,parentNode){var idx,length,siblings=parentNode.children;if(!node||node.parentNode!==parentNode){return -1}for(idx=0,length=siblings.length;idx=options.minLength){that._state="filter";if(filter==="none"){that._filter(word)}else{that._open=true;that._filterSource({value:ignoreCase?word.toLowerCase():word,field:field,operator:filter,ignoreCase:ignoreCase})}}},_accessor:function(value,idx){var element=this.element[0],isSelect=this._isSelect,selectedIndex=element.selectedIndex,option;if(value===undefined){if(isSelect){if(selectedIndex>-1){option=element.options[selectedIndex];if(option){value=option.value}}}else{value=element.value}return value}else{if(isSelect){if(selectedIndex>-1){element.options[selectedIndex].removeAttribute(SELECTED)}element.selectedIndex=idx;option=element.options[idx];if(option){option.setAttribute(SELECTED,SELECTED)}}else{element.value=value}}},_hideBusy:function(){var that=this;clearTimeout(that._busy);that._arrow.removeClass(LOADING);that._focused.attr("aria-busy",false);that._busy=null},_showBusy:function(){var that=this;that._request=true;if(that._busy){return}that._busy=setTimeout(function(){that._focused.attr("aria-busy",true);that._arrow.addClass(LOADING)},100)},_requestEnd:function(){this._request=false},_dataSource:function(){var that=this,element=that.element,options=that.options,dataSource=options.dataSource||{},idx;dataSource=$.isArray(dataSource)?{data:dataSource}:dataSource;if(that._isSelect){idx=element[0].selectedIndex;if(idx>-1){options.index=idx}dataSource.select=element;dataSource.fields=[{field:options.dataTextField},{field:options.dataValueField}]}if(that.dataSource&&that._refreshHandler){that._unbindDataSource()}else{that._refreshHandler=proxy(that.refresh,that);that._progressHandler=proxy(that._showBusy,that);that._requestEndHandler=proxy(that._requestEnd,that);that._errorHandler=proxy(that._hideBusy,that)}that.dataSource=kendo.data.DataSource.create(dataSource).bind(CHANGE,that._refreshHandler).bind(PROGRESS,that._progressHandler).bind(REQUESTEND,that._requestEndHandler).bind("error",that._errorHandler)},_get:function(li){var that=this,data=that._data(),idx,length;if(typeof li==="function"){for(idx=0,length=data.length;idx";options+=option}element.html(options)},_reset:function(){var that=this,element=that.element,formId=element.attr("form"),form=formId?$("#"+formId):element.closest("form");if(form[0]){that._resetHandler=function(){setTimeout(function(){that.value(that._initial)})};that._form=form.on("reset",that._resetHandler)}},_cascade:function(){var that=this,options=that.options,cascade=options.cascadeFrom,parent,parentElement,select,valueField,change;if(cascade){that._selectedValue=options.value||that._accessor();parentElement=$("#"+cascade);parent=parentElement.data("kendo"+options.name);if(!parent){parent=parentElement.data("kendo"+alternativeNames[options.name])}if(!parent){return}options.autoBind=false;valueField=options.cascadeFromField||parent.options.dataValueField;change=function(){that.dataSource.unbind(CHANGE,change);var value=that._selectedValue||that.value();if(that._userTriggered){that._clearSelection(parent,true)}else{if(value){that.value(value);if(!that.dataSource.view()[0]||that.selectedIndex===-1){that._clearSelection(parent,true)}}else{that.select(options.index)}}that.enable();that._triggerCascade(that._userTriggered);that._userTriggered=false};select=function(){var dataItem=parent.dataItem(),filterValue=dataItem?parent._value(dataItem):null,expressions,filters;if(filterValue||filterValue===0){expressions=that.dataSource.filter()||{};removeFiltersForField(expressions,valueField);filters=expressions.filters||[];filters.push({field:valueField,operator:"eq",value:filterValue});var handler=function(){that.unbind("dataBound",handler);change.apply(that,arguments)};that.first("dataBound",handler);that.dataSource.filter(filters)}else{that.enable(false);that._clearSelection(parent);that._triggerCascade(that._userTriggered);that._userTriggered=false}};parent.first("cascade",function(e){that._userTriggered=e.userTriggered;select()});if(parent._bound){select()}else{if(!parent.value()){that.enable(false)}}}}});function removeFiltersForField(expression,field){if(expression.filters){expression.filters=$.grep(expression.filters,function(filter){removeFiltersForField(filter,field);if(filter.filters){return filter.filters.length}else{return filter.field!=field}})}}})(window.kendo.jQuery);(function($,undefined){var kendo=window.kendo,support=kendo.support,ui=kendo.ui,Widget=ui.Widget,keys=kendo.keys,parse=kendo.parseDate,adjustDST=kendo.date.adjustDST,extractFormat=kendo._extractFormat,template=kendo.template,getCulture=kendo.getCulture,transitions=kendo.support.transitions,transitionOrigin=transitions?transitions.css+"transform-origin":"",cellTemplate=template('#=data.value#',{useWithBlock:false}),emptyCellTemplate=template(' ',{useWithBlock:false}),browser=kendo.support.browser,isIE8=browser.msie&&browser.version<9,ns=".kendoCalendar",CLICK="click"+ns,KEYDOWN_NS="keydown"+ns,ID="id",MIN="min",LEFT="left",SLIDE="slideIn",MONTH="month",CENTURY="century",CHANGE="change",NAVIGATE="navigate",VALUE="value",HOVER="k-state-hover",DISABLED="k-state-disabled",FOCUSED="k-state-focused",OTHERMONTH="k-other-month",OTHERMONTHCLASS=' class="'+OTHERMONTH+'"',TODAY="k-nav-today",CELLSELECTOR="td:has(.k-link)",BLUR="blur"+ns,FOCUS="focus",FOCUS_WITH_NS=FOCUS+ns,MOUSEENTER=support.touch?"touchstart":"mouseenter",MOUSEENTER_WITH_NS=support.touch?"touchstart"+ns:"mouseenter"+ns,MOUSELEAVE=support.touch?"touchend"+ns+" touchmove"+ns:"mouseleave"+ns,MS_PER_MINUTE=60000,MS_PER_DAY=86400000,PREVARROW="_prevArrow",NEXTARROW="_nextArrow",ARIA_DISABLED="aria-disabled",ARIA_SELECTED="aria-selected",proxy=$.proxy,extend=$.extend,DATE=Date,views={month:0,year:1,decade:2,century:3};var Calendar=Widget.extend({init:function(element,options){var that=this,value,id;Widget.fn.init.call(that,element,options);element=that.wrapper=that.element;options=that.options;options.url=window.unescape(options.url);that._templates();that._header();that._footer(that.footer);id=element.addClass("k-widget k-calendar").on(MOUSEENTER_WITH_NS+" "+MOUSELEAVE,CELLSELECTOR,mousetoggle).on(KEYDOWN_NS,"table.k-content",proxy(that._move,that)).on(CLICK,CELLSELECTOR,function(e){var link=e.currentTarget.firstChild;if(link.href.indexOf("#")!=-1){e.preventDefault()}that._click($(link))}).on("mouseup"+ns,"table.k-content, .k-footer",function(){that._focusView(that.options.focusOnNav!==false)}).attr(ID);if(id){that._cellID=id+"_cell_selected"}normalize(options);value=parse(options.value,options.format,options.culture);that._index=views[options.start];that._current=new DATE(+restrictValue(value,options.min,options.max));that._addClassProxy=function(){that._active=true;that._cell.addClass(FOCUSED)};that._removeClassProxy=function(){that._active=false;that._cell.removeClass(FOCUSED)};that.value(value);kendo.notify(that)},options:{name:"Calendar",value:null,min:new DATE(1900,0,1),max:new DATE(2099,11,31),dates:[],url:"",culture:"",footer:"",format:"",month:{},start:MONTH,depth:MONTH,animation:{horizontal:{effects:SLIDE,reverse:true,duration:500,divisor:2},vertical:{effects:"zoomIn",duration:400}}},events:[CHANGE,NAVIGATE],setOptions:function(options){var that=this;normalize(options);if(!options.dates[0]){options.dates=that.options.dates}Widget.fn.setOptions.call(that,options);that._templates();that._footer(that.footer);that._index=views[that.options.start];that.navigate()},destroy:function(){var that=this,today=that._today;that.element.off(ns);that._title.off(ns);that[PREVARROW].off(ns);that[NEXTARROW].off(ns);kendo.destroy(that._table);if(today){kendo.destroy(today.off(ns))}Widget.fn.destroy.call(that)},current:function(){return this._current},view:function(){return this._view},focus:function(table){table=table||this._table;this._bindTable(table);table.focus()},min:function(value){return this._option(MIN,value)},max:function(value){return this._option("max",value)},navigateToPast:function(){this._navigate(PREVARROW,-1)},navigateToFuture:function(){this._navigate(NEXTARROW,1)},navigateUp:function(){var that=this,index=that._index;if(that._title.hasClass(DISABLED)){return}that.navigate(that._current,++index)},navigateDown:function(value){var that=this,index=that._index,depth=that.options.depth;if(!value){return}if(index===views[depth]){if(+that._value!=+value){that.value(value);that.trigger(CHANGE)}return}that.navigate(value,--index)},navigate:function(value,view){view=isNaN(view)?views[view]:view;var that=this,options=that.options,culture=options.culture,min=options.min,max=options.max,title=that._title,from=that._table,old=that._oldTable,selectedValue=that._value,currentValue=that._current,future=value&&+value>+currentValue,vertical=view!==undefined&&view!==that._index,to,currentView,compare,disabled;if(!value){value=currentValue}that._current=value=new DATE(+restrictValue(value,min,max));if(view===undefined){view=that._index}else{that._index=view}that._view=currentView=calendar.views[view];compare=currentView.compare;disabled=view===views[CENTURY];title.toggleClass(DISABLED,disabled).attr(ARIA_DISABLED,disabled);disabled=compare(value,min)<1;that[PREVARROW].toggleClass(DISABLED,disabled).attr(ARIA_DISABLED,disabled);disabled=compare(value,max)>-1;that[NEXTARROW].toggleClass(DISABLED,disabled).attr(ARIA_DISABLED,disabled);if(from&&old&&old.data("animating")){old.kendoStop(true,true);from.kendoStop(true,true)}that._oldTable=from;if(!from||that._changeView){title.html(currentView.title(value,min,max,culture));that._table=to=$(currentView.content(extend({min:min,max:max,date:value,url:options.url,dates:options.dates,format:options.format,culture:culture},that[currentView.name])));makeUnselectable(to);that._animate({from:from,to:to,vertical:vertical,future:future});that._focus(value);that.trigger(NAVIGATE)}if(view===views[options.depth]&&selectedValue){that._class("k-state-selected",currentView.toDateString(selectedValue))}that._class(FOCUSED,currentView.toDateString(value));if(!from&&that._cell){that._cell.removeClass(FOCUSED)}that._changeView=true},value:function(value){var that=this,view=that._view,options=that.options,old=that._view,min=options.min,max=options.max;if(value===undefined){return that._value}value=parse(value,options.format,options.culture);if(value!==null){value=new DATE(+value);if(!isInRange(value,min,max)){value=null}}that._value=value;if(old&&value===null&&that._cell){that._cell.removeClass("k-state-selected")}else{that._changeView=!value||view&&view.compare(value,that._current)!==0;that.navigate(value)}},_move:function(e){var that=this,options=that.options,key=e.keyCode,view=that._view,index=that._index,currentValue=new DATE(+that._current),isRtl=kendo.support.isRtl(that.wrapper),value,prevent,method,temp;if(e.target===that._table[0]){that._active=true}if(e.ctrlKey){if(key==keys.RIGHT&&!isRtl||key==keys.LEFT&&isRtl){that.navigateToFuture();prevent=true}else{if(key==keys.LEFT&&!isRtl||key==keys.RIGHT&&isRtl){that.navigateToPast();prevent=true}else{if(key==keys.UP){that.navigateUp();prevent=true}else{if(key==keys.DOWN){that._click($(that._cell[0].firstChild));prevent=true}}}}}else{if(key==keys.RIGHT&&!isRtl||key==keys.LEFT&&isRtl){value=1;prevent=true}else{if(key==keys.LEFT&&!isRtl||key==keys.RIGHT&&isRtl){value=-1;prevent=true}else{if(key==keys.UP){value=index===0?-7:-4;prevent=true}else{if(key==keys.DOWN){value=index===0?7:4;prevent=true}else{if(key==keys.ENTER){that._click($(that._cell[0].firstChild));prevent=true}else{if(key==keys.HOME||key==keys.END){method=key==keys.HOME?"first":"last";temp=view[method](currentValue);currentValue=new DATE(temp.getFullYear(),temp.getMonth(),temp.getDate(),currentValue.getHours(),currentValue.getMinutes(),currentValue.getSeconds(),currentValue.getMilliseconds());prevent=true}else{if(key==keys.PAGEUP){prevent=true;that.navigateToPast()}else{if(key==keys.PAGEDOWN){prevent=true;that.navigateToFuture()}}}}}}}}if(value||method){if(!method){view.setDate(currentValue,value)}that._focus(restrictValue(currentValue,options.min,options.max))}}if(prevent){e.preventDefault()}return that._current},_animate:function(options){var that=this,from=options.from,to=options.to,active=that._active;if(!from){to.insertAfter(that.element[0].firstChild);that._bindTable(to)}else{if(from.parent().data("animating")){from.parent().kendoStop(true,true).remove();from.remove();to.insertAfter(that.element[0].firstChild);that._focusView(active)}else{if(!from.is(":visible")||that.options.animation===false){to.insertAfter(from);from.remove();that._focusView(active)}else{that[options.vertical?"_vertical":"_horizontal"](from,to,options.future)}}}},_horizontal:function(from,to,future){var that=this,active=that._active,horizontal=that.options.animation.horizontal,effects=horizontal.effects,viewWidth=from.outerWidth();if(effects&&effects.indexOf(SLIDE)!=-1){from.add(to).css({width:viewWidth});from.wrap("
      ");that._focusView(active,from);from.parent().css({position:"relative",width:viewWidth*2,"float":LEFT,"margin-left":future?0:-viewWidth});to[future?"insertAfter":"insertBefore"](from);extend(horizontal,{effects:SLIDE+":"+(future?"right":LEFT),complete:function(){from.remove();to.unwrap();that._focusView(active);that._oldTable=undefined}});from.parent().kendoStop(true,true).kendoAnimate(horizontal)}},_vertical:function(from,to){var that=this,vertical=that.options.animation.vertical,effects=vertical.effects,active=that._active,cell,position;if(effects&&effects.indexOf("zoom")!=-1){to.css({position:"absolute",top:from.prev().outerHeight(),left:0}).insertBefore(from);if(transitionOrigin){cell=that._cellByDate(that._view.toDateString(that._current));position=cell.position();position=(position.left+parseInt(cell.width()/2,10))+"px "+(position.top+parseInt(cell.height()/2,10)+"px");to.css(transitionOrigin,position)}from.kendoStop(true,true).kendoAnimate({effects:"fadeOut",duration:600,complete:function(){from.remove();to.css({position:"static",top:0,left:0});that._focusView(active);that._oldTable=undefined}});to.kendoStop(true,true).kendoAnimate(vertical)}},_cellByDate:function(value){return this._table.find("td:not(."+OTHERMONTH+")").filter(function(){return $(this.firstChild).attr(kendo.attr(VALUE))===value})},_class:function(className,value){var that=this,id=that._cellID,cell=that._cell;if(cell){cell.removeAttr(ARIA_SELECTED).removeAttr("aria-label").removeAttr(ID)}cell=that._table.find("td:not(."+OTHERMONTH+")").removeClass(className).filter(function(){return $(this.firstChild).attr(kendo.attr(VALUE))===value}).attr(ARIA_SELECTED,true);if(className===FOCUSED&&!that._active&&that.options.focusOnNav!==false){className=""}cell.addClass(className);if(cell[0]){that._cell=cell}if(id){cell.attr(ID,id);that._table.removeAttr("aria-activedescendant").attr("aria-activedescendant",id)}},_bindTable:function(table){table.on(FOCUS_WITH_NS,this._addClassProxy).on(BLUR,this._removeClassProxy)},_click:function(link){var that=this,options=that.options,currentValue=new Date(+that._current),value=link.attr(kendo.attr(VALUE)).split("/");value=new DATE(value[0],value[1],value[2]);adjustDST(value,0);that._view.setDate(currentValue,value);that.navigateDown(restrictValue(currentValue,options.min,options.max))},_focus:function(value){var that=this,view=that._view;if(view.compare(value,that._current)!==0){that.navigate(value)}else{that._current=value;that._class(FOCUSED,view.toDateString(value))}},_focusView:function(active,table){if(active){this.focus(table)}},_footer:function(template){var that=this,today=getToday(),element=that.element,footer=element.find(".k-footer");if(!template){that._toggle(false);footer.hide();return}if(!footer[0]){footer=$('').appendTo(element)}that._today=footer.show().find(".k-link").html(template(today)).attr("title",kendo.toString(today,"D",that.options.culture));that._toggle()},_header:function(){var that=this,element=that.element,links;if(!element.find(".k-header")[0]){element.html('
      ')}links=element.find(".k-link").on(MOUSEENTER_WITH_NS+" "+MOUSELEAVE+" "+FOCUS_WITH_NS+" "+BLUR,mousetoggle).click(false);that._title=links.eq(1).on(CLICK,function(){that._active=that.options.focusOnNav!==false;that.navigateUp()});that[PREVARROW]=links.eq(0).on(CLICK,function(){that._active=that.options.focusOnNav!==false;that.navigateToPast()});that[NEXTARROW]=links.eq(2).on(CLICK,function(){that._active=that.options.focusOnNav!==false;that.navigateToFuture()})},_navigate:function(arrow,modifier){var that=this,index=that._index+1,currentValue=new DATE(+that._current);arrow=that[arrow];if(!arrow.hasClass(DISABLED)){if(index>3){currentValue.setFullYear(currentValue.getFullYear()+100*modifier)}else{calendar.views[index].setDate(currentValue,modifier)}that.navigate(currentValue)}},_option:function(option,value){var that=this,options=that.options,currentValue=that._value||that._current,isBigger;if(value===undefined){return options[option]}value=parse(value,options.format,options.culture);if(!value){return}options[option]=new DATE(+value);if(option===MIN){isBigger=value>currentValue}else{isBigger=currentValue>value}if(isBigger||isEqualMonth(currentValue,value)){if(isBigger){that._value=null}that._changeView=true}if(!that._changeView){that._changeView=!!(options.month.content||options.month.empty)}that.navigate(that._value);that._toggle()},_toggle:function(toggle){var that=this,options=that.options,link=that._today;if(toggle===undefined){toggle=isInRange(getToday(),options.min,options.max)}if(link){link.off(CLICK);if(toggle){link.addClass(TODAY).removeClass(DISABLED).on(CLICK,proxy(that._todayClick,that))}else{link.removeClass(TODAY).addClass(DISABLED).on(CLICK,prevent)}}},_todayClick:function(e){var that=this,depth=views[that.options.depth],today=getToday();e.preventDefault();if(that._view.compare(that._current,today)===0&&that._index==depth){that._changeView=false}that._value=today;that.navigate(today,depth);that.trigger(CHANGE)},_templates:function(){var that=this,options=that.options,footer=options.footer,month=options.month,content=month.content,empty=month.empty;that.month={content:template(''+(content||"#=data.value#")+"",{useWithBlock:!!content}),empty:template(''+(empty||" ")+"",{useWithBlock:!!empty})};that.footer=footer!==false?template(footer||'#= kendo.toString(data,"D","'+options.culture+'") #',{useWithBlock:false}):null}});ui.plugin(Calendar);var calendar={firstDayOfMonth:function(date){return new DATE(date.getFullYear(),date.getMonth(),1)},firstVisibleDay:function(date,calendarInfo){calendarInfo=calendarInfo||kendo.culture().calendar;var firstDay=calendarInfo.firstDay,firstVisibleDay=new DATE(date.getFullYear(),date.getMonth(),0,date.getHours(),date.getMinutes(),date.getSeconds(),date.getMilliseconds());while(firstVisibleDay.getDay()!=firstDay){calendar.setTime(firstVisibleDay,-1*MS_PER_DAY)}return firstVisibleDay},setTime:function(date,time){var tzOffsetBefore=date.getTimezoneOffset(),resultDATE=new DATE(date.getTime()+time),tzOffsetDiff=resultDATE.getTimezoneOffset()-tzOffsetBefore;date.setTime(resultDATE.getTime()+tzOffsetDiff*MS_PER_MINUTE)},views:[{name:MONTH,title:function(date,min,max,culture){return getCalendarInfo(culture).months.names[date.getMonth()]+" "+date.getFullYear()},content:function(options){var that=this,idx=0,min=options.min,max=options.max,date=options.date,dates=options.dates,format=options.format,culture=options.culture,navigateUrl=options.url,hasUrl=navigateUrl&&dates[0],currentCalendar=getCalendarInfo(culture),firstDayIdx=currentCalendar.firstDay,days=currentCalendar.days,names=shiftArray(days.names,firstDayIdx),shortNames=shiftArray(days.namesShort,firstDayIdx),start=calendar.firstVisibleDay(date,currentCalendar),firstDayOfMonth=that.first(date),lastDayOfMonth=that.last(date),toDateString=that.toDateString,today=new DATE(),html='';for(;idx<7;idx++){html+='"}today=new DATE(today.getFullYear(),today.getMonth(),today.getDate());adjustDST(today,0);today=+today;return view({cells:42,perRow:7,html:html+='',start:new DATE(start.getFullYear(),start.getMonth(),start.getDate()),min:new DATE(min.getFullYear(),min.getMonth(),min.getDate()),max:new DATE(max.getFullYear(),max.getMonth(),max.getDate()),content:options.content,empty:options.empty,setter:that.setDate,build:function(date){var cssClass=[],day=date.getDay(),linkClass="",url="#";if(datelastDayOfMonth){cssClass.push(OTHERMONTH)}if(+date===today){cssClass.push("k-today")}if(day===0||day===6){cssClass.push("k-weekend")}if(hasUrl&&inArray(+date,dates)){url=navigateUrl.replace("{0}",kendo.toString(date,format,culture));linkClass=" k-action-link"}return{date:date,dates:dates,ns:kendo.ns,title:kendo.toString(date,"D",culture),value:date.getDate(),dateString:toDateString(date),cssClass:cssClass[0]?' class="'+cssClass.join(" ")+'"':"",linkClass:linkClass,url:url}}})},first:function(date){return calendar.firstDayOfMonth(date)},last:function(date){var last=new DATE(date.getFullYear(),date.getMonth()+1,0),first=calendar.firstDayOfMonth(date),timeOffset=Math.abs(last.getTimezoneOffset()-first.getTimezoneOffset());if(timeOffset){last.setHours(first.getHours()+(timeOffset/60))}return last},compare:function(date1,date2){var result,month1=date1.getMonth(),year1=date1.getFullYear(),month2=date2.getMonth(),year2=date2.getFullYear();if(year1>year2){result=1}else{if(year1month2?1:-1}}return result},setDate:function(date,value){var hours=date.getHours();if(value instanceof DATE){date.setFullYear(value.getFullYear(),value.getMonth(),value.getDate())}else{calendar.setTime(date,value*MS_PER_DAY)}adjustDST(date,hours)},toDateString:function(date){return date.getFullYear()+"/"+date.getMonth()+"/"+date.getDate()}},{name:"year",title:function(date){return date.getFullYear()},content:function(options){var namesAbbr=getCalendarInfo(options.culture).months.namesAbbr,toDateString=this.toDateString,min=options.min,max=options.max;return view({min:new DATE(min.getFullYear(),min.getMonth(),1),max:new DATE(max.getFullYear(),max.getMonth(),1),start:new DATE(options.date.getFullYear(),0,1),setter:this.setDate,build:function(date){return{value:namesAbbr[date.getMonth()],ns:kendo.ns,dateString:toDateString(date),cssClass:""}}})},first:function(date){return new DATE(date.getFullYear(),0,date.getDate())},last:function(date){return new DATE(date.getFullYear(),11,date.getDate())},compare:function(date1,date2){return compare(date1,date2)},setDate:function(date,value){var month,hours=date.getHours();if(value instanceof DATE){month=value.getMonth();date.setFullYear(value.getFullYear(),month,date.getDate());if(month!==date.getMonth()){date.setDate(0)}}else{month=date.getMonth()+value;date.setMonth(month);if(month>11){month-=12}if(month>0&&date.getMonth()!=month){date.setDate(0)}}adjustDST(date,hours)},toDateString:function(date){return date.getFullYear()+"/"+date.getMonth()+"/1"}},{name:"decade",title:function(date,min,max){return title(date,min,max,10)},content:function(options){var year=options.date.getFullYear(),toDateString=this.toDateString;return view({start:new DATE(year-year%10-1,0,1),min:new DATE(options.min.getFullYear(),0,1),max:new DATE(options.max.getFullYear(),0,1),setter:this.setDate,build:function(date,idx){return{value:date.getFullYear(),ns:kendo.ns,dateString:toDateString(date),cssClass:idx===0||idx==11?OTHERMONTHCLASS:""}}})},first:function(date){var year=date.getFullYear();return new DATE(year-year%10,date.getMonth(),date.getDate())},last:function(date){var year=date.getFullYear();return new DATE(year-year%10+9,date.getMonth(),date.getDate())},compare:function(date1,date2){return compare(date1,date2,10)},setDate:function(date,value){setDate(date,value,1)},toDateString:function(date){return date.getFullYear()+"/0/1"}},{name:CENTURY,title:function(date,min,max){return title(date,min,max,100)},content:function(options){var year=options.date.getFullYear(),min=options.min.getFullYear(),max=options.max.getFullYear(),toDateString=this.toDateString,minYear=min,maxYear=max;minYear=minYear-minYear%10;maxYear=maxYear-maxYear%10;if(maxYear-minYear<10){maxYear=minYear+9}return view({start:new DATE(year-year%100-10,0,1),min:new DATE(minYear,0,1),max:new DATE(maxYear,0,1),setter:this.setDate,build:function(date,idx){var start=date.getFullYear(),end=start+9;if(startmax){end=max}return{ns:kendo.ns,value:start+" - "+end,dateString:toDateString(date),cssClass:idx===0||idx==11?OTHERMONTHCLASS:""}}})},first:function(date){var year=date.getFullYear();return new DATE(year-year%100,date.getMonth(),date.getDate())},last:function(date){var year=date.getFullYear();return new DATE(year-year%100+99,date.getMonth(),date.getDate())},compare:function(date1,date2){return compare(date1,date2,100)},setDate:function(date,value){setDate(date,value,10)},toDateString:function(date){var year=date.getFullYear();return(year-year%10)+"/0/1"}}]};function title(date,min,max,modular){var start=date.getFullYear(),minYear=min.getFullYear(),maxYear=max.getFullYear(),end;start=start-start%modular;end=start+(modular-1);if(startmaxYear){end=maxYear}return start+"-"+end}function view(options){var idx=0,data,min=options.min,max=options.max,start=options.start,setter=options.setter,build=options.build,length=options.cells||12,cellsPerRow=options.perRow||4,content=options.content||cellTemplate,empty=options.empty||emptyCellTemplate,html=options.html||'
      '+shortNames[idx]+"
      ';for(;idx0&&idx%cellsPerRow===0){html+=''}data=build(start,idx);html+=isInRange(start,min,max)?content(data):empty(data);setter(start,1)}return html+"
      "}function compare(date1,date2,modifier){var year1=date1.getFullYear(),start=date2.getFullYear(),end=start,result=0;if(modifier){start=start-start%modifier;end=start-start%modifier+modifier-1}if(year1>end){result=1}else{if(year1today){today=new DATE(+min)}else{if(max=+min&&+date<=+max}function shiftArray(array,idx){return array.slice(idx).concat(array.slice(0,idx))}function setDate(date,value,multiplier){value=value instanceof DATE?value.getFullYear():date.getFullYear()+multiplier*value;date.setFullYear(value)}function mousetoggle(e){$(this).toggleClass(HOVER,MOUSEENTER.indexOf(e.type)>-1||e.type==FOCUS)}function prevent(e){e.preventDefault()}function getCalendarInfo(culture){return getCulture(culture).calendars.standard}function normalize(options){var start=views[options.start],depth=views[options.depth],culture=getCulture(options.culture);options.format=extractFormat(options.format||culture.calendars.standard.patterns.d);if(isNaN(start)){start=0;options.start=MONTH}if(depth===undefined||depth>start){options.depth=MONTH}if(!options.dates){options.dates=[]}}function makeUnselectable(element){if(isIE8){element.find("*").attr("unselectable","on")}}function inArray(date,dates){for(var i=0,length=dates.length;i",SPAN="",ns=".kendoDatePicker",CLICK="click"+ns,OPEN="open",CLOSE="close",CHANGE="change",DATEVIEW="dateView",DISABLED="disabled",READONLY="readonly",DEFAULT="k-state-default",FOCUSED="k-state-focused",SELECTED="k-state-selected",STATEDISABLED="k-state-disabled",HOVER="k-state-hover",KEYDOWN="keydown"+ns,HOVEREVENTS="mouseenter"+ns+" mouseleave"+ns,MOUSEDOWN="mousedown"+ns,ID="id",MIN="min",MAX="max",MONTH="month",ARIA_DISABLED="aria-disabled",ARIA_EXPANDED="aria-expanded",ARIA_HIDDEN="aria-hidden",ARIA_READONLY="aria-readonly",calendar=kendo.calendar,isInRange=calendar.isInRange,restrictValue=calendar.restrictValue,isEqualDatePart=calendar.isEqualDatePart,extend=$.extend,proxy=$.proxy,DATE=Date;function normalize(options){var parseFormats=options.parseFormats,format=options.format;calendar.normalize(options);parseFormats=$.isArray(parseFormats)?parseFormats:[parseFormats];if($.inArray(format,parseFormats)===-1){parseFormats.splice(0,0,options.format)}options.parseFormats=parseFormats}function preventDefault(e){e.preventDefault()}var DateView=function(options){var that=this,id,body=document.body,div=$(DIV).attr(ARIA_HIDDEN,"true").addClass("k-calendar-container").appendTo(body);that.options=options=options||{};id=options.id;if(id){id+="_dateview";div.attr(ID,id);that._dateViewID=id}that.popup=new ui.Popup(div,extend(options.popup,options,{name:"Popup",isRtl:kendo.support.isRtl(options.anchor)}));that.div=div;that.value(options.value)};DateView.prototype={_calendar:function(){var that=this;var calendar=that.calendar;var options=that.options;var div;if(!calendar){div=$(DIV).attr(ID,kendo.guid()).appendTo(that.popup.element).on(MOUSEDOWN,preventDefault).on(CLICK,"td:has(.k-link)",proxy(that._click,that));that.calendar=calendar=new ui.Calendar(div);that._setOptions(options);kendo.calendar.makeUnselectable(calendar.element);calendar.navigate(that._value||that._current,options.start);that.value(that._value)}},_setOptions:function(options){this.calendar.setOptions({focusOnNav:false,change:options.change,culture:options.culture,dates:options.dates,depth:options.depth,footer:options.footer,format:options.format,max:options.max,min:options.min,month:options.month,start:options.start})},setOptions:function(options){var old=this.options;this.options=extend(old,options,{change:old.change,close:old.close,open:old.open});if(this.calendar){this._setOptions(this.options)}},destroy:function(){this.popup.destroy()},open:function(){var that=this;that._calendar();that.popup.open()},close:function(){this.popup.close()},min:function(value){this._option(MIN,value)},max:function(value){this._option(MAX,value)},toggle:function(){var that=this;that[that.popup.visible()?CLOSE:OPEN]()},move:function(e){var that=this,key=e.keyCode,calendar=that.calendar,selectIsClicked=e.ctrlKey&&key==keys.DOWN||key==keys.ENTER;if(key==keys.ESC){that.close();return}if(e.altKey){if(key==keys.DOWN){that.open();e.preventDefault()}else{if(key==keys.UP){that.close();e.preventDefault()}}return}if(!that.popup.visible()){return}if(selectIsClicked&&calendar._cell.hasClass(SELECTED)){that.close();e.preventDefault();return}that._current=calendar._move(e)},current:function(date){this._current=date;this.calendar._focus(date)},value:function(value){var that=this,calendar=that.calendar,options=that.options;that._value=value;that._current=new DATE(+restrictValue(value,options.min,options.max));if(calendar){calendar.value(value)}},_click:function(e){if(e.currentTarget.className.indexOf(SELECTED)!==-1){this.close()}},_option:function(option,value){var that=this;var calendar=that.calendar;that.options[option]=value;if(calendar){calendar[option](value)}}};DateView.normalize=normalize;kendo.DateView=DateView;var DatePicker=Widget.extend({init:function(element,options){var that=this,disabled,div;Widget.fn.init.call(that,element,options);element=that.element;options=that.options;options.min=parse(element.attr("min"))||parse(options.min);options.max=parse(element.attr("max"))||parse(options.max);normalize(options);that._wrapper();that.dateView=new DateView(extend({},options,{id:element.attr(ID),anchor:that.wrapper,change:function(){that._change(this.value());that.close()},close:function(e){if(that.trigger(CLOSE)){e.preventDefault()}else{element.attr(ARIA_EXPANDED,false);div.attr(ARIA_HIDDEN,true)}},open:function(e){var options=that.options,date;if(that.trigger(OPEN)){e.preventDefault()}else{if(that.element.val()!==that._oldText){date=parse(element.val(),options.parseFormats,options.culture);that.dateView[date?"current":"value"](date)}element.attr(ARIA_EXPANDED,true);div.attr(ARIA_HIDDEN,false);that._updateARIA(date)}}}));div=that.dateView.div;that._icon();try{element[0].setAttribute("type","text")}catch(e){element[0].type="text"}element.addClass("k-input").attr({role:"combobox","aria-expanded":false,"aria-owns":that.dateView._dateViewID});that._reset();that._template();disabled=element.is("[disabled]");if(disabled){that.enable(false)}else{that.readonly(element.is("[readonly]"))}that._old=that._update(options.value||that.element.val());that._oldText=element.val();kendo.notify(that)},events:[OPEN,CLOSE,CHANGE],options:{name:"DatePicker",value:null,footer:"",format:"",culture:"",parseFormats:[],min:new Date(1900,0,1),max:new Date(2099,11,31),start:MONTH,depth:MONTH,animation:{},month:{},dates:[],ARIATemplate:'Current focused date is #=kendo.toString(data.current, "D")#'},setOptions:function(options){var that=this;var value=that._value;Widget.fn.setOptions.call(that,options);options=that.options;options.min=parse(options.min);options.max=parse(options.max);normalize(options);that.dateView.setOptions(options);if(value){that.element.val(kendo.toString(value,options.format,options.culture));that._updateARIA(value)}},_editable:function(options){var that=this,icon=that._dateIcon.off(ns),element=that.element.off(ns),wrapper=that._inputWrapper.off(ns),readonly=options.readonly,disable=options.disable;if(!readonly&&!disable){wrapper.addClass(DEFAULT).removeClass(STATEDISABLED).on(HOVEREVENTS,that._toggleHover);element.removeAttr(DISABLED).removeAttr(READONLY).attr(ARIA_DISABLED,false).attr(ARIA_READONLY,false).on("keydown"+ns,proxy(that._keydown,that)).on("focusout"+ns,proxy(that._blur,that)).on("focus"+ns,function(){that._inputWrapper.addClass(FOCUSED)});icon.on(CLICK,proxy(that._click,that)).on(MOUSEDOWN,preventDefault)}else{wrapper.addClass(disable?STATEDISABLED:DEFAULT).removeClass(disable?DEFAULT:STATEDISABLED);element.attr(DISABLED,disable).attr(READONLY,readonly).attr(ARIA_DISABLED,disable).attr(ARIA_READONLY,readonly)}},readonly:function(readonly){this._editable({readonly:readonly===undefined?true:readonly,disable:false})},enable:function(enable){this._editable({readonly:false,disable:!(enable=enable===undefined?true:enable)})},destroy:function(){var that=this;Widget.fn.destroy.call(that);that.dateView.destroy();that.element.off(ns);that._dateIcon.off(ns);that._inputWrapper.off(ns);if(that._form){that._form.off("reset",that._resetHandler)}},open:function(){this.dateView.open()},close:function(){this.dateView.close()},min:function(value){return this._option(MIN,value)},max:function(value){return this._option(MAX,value)},value:function(value){var that=this;if(value===undefined){return that._value}that._old=that._update(value);if(that._old===null){that.element.val("")}that._oldText=that.element.val()},_toggleHover:function(e){$(e.currentTarget).toggleClass(HOVER,e.type==="mouseenter")},_blur:function(){var that=this,value=that.element.val();that.close();if(value!==that._oldText){that._change(value)}that._inputWrapper.removeClass(FOCUSED)},_click:function(){var that=this,element=that.element;that.dateView.toggle();if(!kendo.support.touch&&element[0]!==activeElement()){element.focus()}},_change:function(value){var that=this;value=that._update(value);if(+that._old!=+value){that._old=value;that._oldText=that.element.val();that.trigger(CHANGE);that.element.trigger(CHANGE)}},_keydown:function(e){var that=this,dateView=that.dateView,value=that.element.val();if(!dateView.popup.visible()&&e.keyCode==keys.ENTER&&value!==that._oldText){that._change(value)}else{dateView.move(e);that._updateARIA(dateView._current)}},_icon:function(){var that=this,element=that.element,icon;icon=element.next("span.k-select");if(!icon[0]){icon=$('select').insertAfter(element)}that._dateIcon=icon.attr({role:"button","aria-controls":that.dateView._dateViewID})},_option:function(option,value){var that=this,options=that.options;if(value===undefined){return options[option]}value=parse(value,options.parseFormats,options.culture);if(!value){return}options[option]=new DATE(+value);that.dateView[option](value)},_update:function(value){var that=this,options=that.options,min=options.min,max=options.max,current=that._value,date=parse(value,options.parseFormats,options.culture),isSameType=(date===null&¤t===null)||(date instanceof Date&¤t instanceof Date),formattedValue;if(+date===+current&&isSameType){formattedValue=kendo.toString(date,options.format,options.culture);if(formattedValue!==value){that.element.val(date===null?value:formattedValue)}return date}if(date!==null&&isEqualDatePart(date,min)){date=restrictValue(date,min,max)}else{if(!isInRange(date,min,max)){date=null}}that._value=date;that.dateView.value(date);that.element.val(date?kendo.toString(date,options.format,options.culture):value);that._updateARIA(date);return date},_wrapper:function(){var that=this,element=that.element,wrapper;wrapper=element.parents(".k-datepicker");if(!wrapper[0]){wrapper=element.wrap(SPAN).parent().addClass("k-picker-wrap k-state-default");wrapper=wrapper.wrap(SPAN).parent()}wrapper[0].style.cssText=element[0].style.cssText;element.css({width:"100%",height:element[0].style.height});that.wrapper=wrapper.addClass("k-widget k-datepicker k-header").addClass(element[0].className);that._inputWrapper=$(wrapper[0].firstChild)},_reset:function(){var that=this,element=that.element,formId=element.attr("form"),form=formId?$("#"+formId):element.closest("form");if(form[0]){that._resetHandler=function(){that.value(element[0].defaultValue)};that._form=form.on("reset",that._resetHandler)}},_template:function(){this._ariaTemplate=template(this.options.ARIATemplate)},_updateARIA:function(date){var cell;var that=this;var calendar=that.dateView.calendar;that.element.removeAttr("aria-activedescendant");if(calendar){cell=calendar._cell;cell.attr("aria-label",that._ariaTemplate({current:date||calendar.current()}));that.element.attr("aria-activedescendant",cell.attr("id"))}}});ui.plugin(DatePicker)})(window.kendo.jQuery);(function($,undefined){var kendo=window.kendo,support=kendo.support,caret=kendo.caret,activeElement=kendo._activeElement,placeholderSupported=support.placeholder,ui=kendo.ui,List=ui.List,keys=kendo.keys,DataSource=kendo.data.DataSource,ARIA_DISABLED="aria-disabled",ARIA_READONLY="aria-readonly",DEFAULT="k-state-default",DISABLED="disabled",READONLY="readonly",FOCUSED="k-state-focused",SELECTED="k-state-selected",STATEDISABLED="k-state-disabled",HOVER="k-state-hover",ns=".kendoAutoComplete",HOVEREVENTS="mouseenter"+ns+" mouseleave"+ns,proxy=$.proxy;function indexOfWordAtCaret(caretIdx,text,separator){return separator?text.substring(0,caretIdx).split(separator).length-1:0}function wordAtCaret(caretIdx,text,separator){return text.split(separator)[indexOfWordAtCaret(caretIdx,text,separator)]}function replaceWordAtCaret(caretIdx,text,word,separator){var words=text.split(separator);words.splice(indexOfWordAtCaret(caretIdx,text,separator),1,word);if(separator&&words[words.length-1]!==""){words.push("")}return words.join(separator)}var AutoComplete=List.extend({init:function(element,options){var that=this,wrapper;that.ns=ns;options=$.isArray(options)?{dataSource:options}:options;List.fn.init.call(that,element,options);element=that.element;options=that.options;options.placeholder=options.placeholder||element.attr("placeholder");if(placeholderSupported){element.attr("placeholder",options.placeholder)}that._wrapper();that._loader();that._dataSource();that._ignoreCase();element[0].type="text";wrapper=that.wrapper;that._popup();element.addClass("k-input").on("keydown"+ns,proxy(that._keydown,that)).on("paste"+ns,proxy(that._search,that)).on("focus"+ns,function(){that._prev=that._accessor();that._placeholder(false);wrapper.addClass(FOCUSED)}).on("focusout"+ns,function(){that._change();that._placeholder();wrapper.removeClass(FOCUSED)}).attr({autocomplete:"off",role:"textbox","aria-haspopup":true});that._enable();that._old=that._accessor();if(element[0].id){element.attr("aria-owns",that.ul[0].id)}that._aria();that._placeholder();kendo.notify(that)},options:{name:"AutoComplete",enabled:true,suggest:false,template:"",dataTextField:"",minLength:1,delay:200,height:200,filter:"startswith",ignoreCase:true,highlightFirst:false,separator:null,placeholder:"",animation:{},value:null},_dataSource:function(){var that=this;if(that.dataSource&&that._refreshHandler){that._unbindDataSource()}else{that._refreshHandler=proxy(that.refresh,that);that._progressHandler=proxy(that._showBusy,that)}that.dataSource=DataSource.create(that.options.dataSource).bind("change",that._refreshHandler).bind("progress",that._progressHandler)},setDataSource:function(dataSource){this.options.dataSource=dataSource;this._dataSource()},events:["open","close","change","select","dataBinding","dataBound"],setOptions:function(options){List.fn.setOptions.call(this,options);this._template();this._accessors();this._aria()},_editable:function(options){var that=this,element=that.element,wrapper=that.wrapper.off(ns),readonly=options.readonly,disable=options.disable;if(!readonly&&!disable){wrapper.addClass(DEFAULT).removeClass(STATEDISABLED).on(HOVEREVENTS,that._toggleHover);element.removeAttr(DISABLED).removeAttr(READONLY).attr(ARIA_DISABLED,false).attr(ARIA_READONLY,false)}else{wrapper.addClass(disable?STATEDISABLED:DEFAULT).removeClass(disable?DEFAULT:STATEDISABLED);element.attr(DISABLED,disable).attr(READONLY,readonly).attr(ARIA_DISABLED,disable).attr(ARIA_READONLY,readonly)}},close:function(){var that=this,current=that._current;if(current){current.removeClass(SELECTED)}that.current(null);that.popup.close()},destroy:function(){var that=this;that.element.off(ns);that.wrapper.off(ns);List.fn.destroy.call(that)},refresh:function(){var that=this,ul=that.ul[0],popup=that.popup,options=that.options,data=that._data(),length=data.length,action;that._angularItems("cleanup");that.trigger("dataBinding");ul.innerHTML=kendo.render(that.template,data);that._height(length);if(popup.visible()){popup._position()}if(length){if(options.highlightFirst){that.current($(ul.firstChild))}if(options.suggest){that.suggest($(ul.firstChild))}}if(that._open){that._open=false;action=length?"open":"close";if(that._typing&&that.element[0]!==activeElement()){action="close"}popup[action]();that._typing=undefined}if(that._touchScroller){that._touchScroller.reset()}that._makeUnselectable();that._hideBusy();that._angularItems("compile");that.trigger("dataBound")},select:function(li){this._select(li)},search:function(word){var that=this,options=that.options,ignoreCase=options.ignoreCase,separator=options.separator,length;word=word||that._accessor();that._current=null;clearTimeout(that._typing);if(separator){word=wordAtCaret(caret(that.element)[0],word,separator)}length=word.length;if(!length){that.popup.close()}else{if(length>=that.options.minLength){that._open=true;that._filterSource({value:ignoreCase?word.toLowerCase():word,operator:options.filter,field:options.dataTextField,ignoreCase:ignoreCase})}}},suggest:function(word){var that=this,key=that._last,value=that._accessor(),element=that.element[0],caretIdx=caret(element)[0],separator=that.options.separator,words=value.split(separator),wordIndex=indexOfWordAtCaret(caretIdx,value,separator),selectionEnd=caretIdx,idx;if(key==keys.BACKSPACE||key==keys.DELETE){that._last=undefined;return}word=word||"";if(typeof word!=="string"){idx=List.inArray(word[0],that.ul[0]);if(idx>-1){word=that._text(that._data()[idx])}else{word=""}}if(caretIdx<=0){caretIdx=value.toLowerCase().indexOf(word.toLowerCase())+1}idx=value.substring(0,caretIdx).lastIndexOf(separator);idx=idx>-1?caretIdx-(idx+separator.length):caretIdx;value=words[wordIndex].substring(0,idx);if(word){idx=word.toLowerCase().indexOf(value.toLowerCase());if(idx>-1){word=word.substring(idx+value.length);selectionEnd=caretIdx+word.length;value+=word}if(separator&&words[words.length-1]!==""){words.push("")}}words[wordIndex]=value;that._accessor(words.join(separator||""));if(element===activeElement()){caret(element,caretIdx,selectionEnd)}},value:function(value){if(value!==undefined){this._accessor(value);this._old=this._accessor()}else{return this._accessor()}},_accessor:function(value){var that=this,element=that.element[0];if(value!==undefined){element.value=value===null?"":value;that._placeholder()}else{value=element.value;if(element.className.indexOf("k-readonly")>-1){if(value===that.options.placeholder){return""}else{return value}}return value}},_accept:function(li){var element=this.element;this._focus(li);caret(element,element.val().length)},_keydown:function(e){var that=this,ul=that.ul[0],key=e.keyCode,current=that._current,visible=that.popup.visible();that._last=key;if(key===keys.DOWN){if(visible){that._move(current?current.next():$(ul.firstChild))}e.preventDefault()}else{if(key===keys.UP){if(visible){that._move(current?current.prev():$(ul.lastChild))}e.preventDefault()}else{if(key===keys.ENTER||key===keys.TAB){if(key===keys.ENTER&&that.popup.visible()){e.preventDefault()}that._accept(current)}else{if(key===keys.ESC){if(that.popup.visible()){e.preventDefault()}that.close()}else{that._search()}}}}},_move:function(li){var that=this;li=li[0]?li:null;that.current(li);if(that.options.suggest){that.suggest(li)}},_hideBusy:function(){var that=this;clearTimeout(that._busy);that._loading.hide();that.element.attr("aria-busy",false);that._busy=null},_showBusy:function(){var that=this;if(that._busy){return}that._busy=setTimeout(function(){that.element.attr("aria-busy",true);that._loading.show()},100)},_placeholder:function(show){if(placeholderSupported){return}var that=this,element=that.element,placeholder=that.options.placeholder,value;if(placeholder){value=element.val();if(show===undefined){show=!value}if(!show){if(value!==placeholder){placeholder=value}else{placeholder=""}}if(value===that._old&&!show){return}element.toggleClass("k-readonly",show).val(placeholder);if(!placeholder&&element[0]===document.activeElement){caret(element[0],0,0)}}},_search:function(){var that=this;clearTimeout(that._typing);that._typing=setTimeout(function(){if(that._prev!==that._accessor()){that._prev=that._accessor();that.search()}},that.options.delay)},_select:function(li){var that=this,separator=that.options.separator,data=that._data(),text,idx;li=$(li);if(li[0]&&!li.hasClass(SELECTED)){idx=List.inArray(li[0],that.ul[0]);if(idx>-1){data=data[idx];text=that._text(data);if(separator){text=replaceWordAtCaret(caret(that.element)[0],that._accessor(),text,separator)}that._accessor(text);that._prev=that._accessor();that.current(li.addClass(SELECTED))}}},_loader:function(){this._loading=$('').insertAfter(this.element)},_toggleHover:function(e){$(e.currentTarget).toggleClass(HOVER,e.type==="mouseenter")},_wrapper:function(){var that=this,element=that.element,DOMelement=element[0],wrapper;wrapper=element.parent();if(!wrapper.is("span.k-widget")){wrapper=element.wrap("").parent()}wrapper.attr("tabindex",-1);wrapper.attr("role","presentation");wrapper[0].style.cssText=DOMelement.style.cssText;element.css({width:"100%",height:DOMelement.style.height});that._focused=that.element;that.wrapper=wrapper.addClass("k-widget k-autocomplete k-header").addClass(DOMelement.className)}});ui.plugin(AutoComplete)})(window.kendo.jQuery);(function($,undefined){var kendo=window.kendo,ui=kendo.ui,Select=ui.Select,os=kendo.support.mobileOS,activeElement=kendo._activeElement,keys=kendo.keys,ns=".kendoDropDownList",DISABLED="disabled",READONLY="readonly",CHANGE="change",FOCUSED="k-state-focused",DEFAULT="k-state-default",STATEDISABLED="k-state-disabled",ARIA_DISABLED="aria-disabled",ARIA_READONLY="aria-readonly",SELECTED="k-state-selected",HOVEREVENTS="mouseenter"+ns+" mouseleave"+ns,TABINDEX="tabindex",STATE_FILTER="filter",STATE_ACCEPT="accept",proxy=$.proxy;var DropDownList=Select.extend({init:function(element,options){var that=this,index=options&&options.index,optionLabel,useOptionLabel,text;that.ns=ns;options=$.isArray(options)?{dataSource:options}:options;Select.fn.init.call(that,element,options);that._focusHandler=function(){that.wrapper.focus()};options=that.options;element=that.element.on("focus"+ns,that._focusHandler);this._inputTemplate();that._reset();that._prev="";that._word="";that._wrapper();that._tabindex();that.wrapper.data(TABINDEX,that.wrapper.attr(TABINDEX));that._span();that._popup();that._mobile();that._dataSource();that._ignoreCase();that._filterHeader();that._aria();that._enable();that._oldIndex=that.selectedIndex=-1;that._cascade();if(index!==undefined){options.index=index}if(options.autoBind){that.dataSource.fetch()}else{if(that.selectedIndex===-1){text=options.text||"";if(!text){optionLabel=options.optionLabel;useOptionLabel=optionLabel&&options.index===0;if(that._isSelect){if(useOptionLabel){text=optionLabel}else{text=element.children(":selected").text()}}else{if(!element[0].value&&useOptionLabel){text=optionLabel}}}that._textAccessor(text)}}kendo.notify(that)},options:{name:"DropDownList",enabled:true,autoBind:true,index:0,text:null,value:null,template:"",valueTemplate:"",delay:500,height:200,dataTextField:"",dataValueField:"",optionLabel:"",cascadeFrom:"",cascadeFromField:"",ignoreCase:true,animation:{},filter:"none",minLength:1},events:["open","close",CHANGE,"select","dataBinding","dataBound","cascade"],setOptions:function(options){Select.fn.setOptions.call(this,options);this._template();this._inputTemplate();this._accessors();this._filterHeader();this._enable();this._aria()},destroy:function(){var that=this;that.wrapper.off(ns);that.element.off(ns);that._inputWrapper.off(ns);Select.fn.destroy.call(that)},open:function(){var that=this;if(that.popup.visible()){return}if(!that.ul[0].firstChild||that._state===STATE_ACCEPT){that._open=true;that._state="rebind";if(that.filterInput){that.filterInput.val("")}that._filterSource()}else{that.popup.open();that._focusElement(that.filterInput);that._scroll(that._current)}},toggle:function(toggle){this._toggle(toggle,true)},refresh:function(){var that=this,data=that._data(),length=data.length,optionLabel=that.options.optionLabel,filtered=that._state===STATE_FILTER,element=that.element[0],selectedIndex,value;that.trigger("dataBinding");if(that._current){that.current(null)}that._angularItems("cleanup");that.ul[0].innerHTML=kendo.render(that.template,data);that._angularItems("compile");that._height(filtered?(length||1):length);if(that.popup.visible()){that.popup._position()}if(that._isSelect){selectedIndex=element.selectedIndex;value=that.value();if(length){if(optionLabel){optionLabel=that._option("",that._optionLabelText(optionLabel))}}else{if(value){selectedIndex=0;optionLabel=that._option(value,that.text())}}that._options(data,optionLabel);element.selectedIndex=selectedIndex===-1?0:selectedIndex}that._hideBusy();that._makeUnselectable();if(!filtered){if(that._open){that.toggle(!!length)}that._open=false;if(!that._fetch){if(length){that._selectItem()}else{if(that._textAccessor()!==optionLabel){that.element.val("");that._textAccessor("")}}}}else{that.current($(that.ul[0].firstChild))}that._bound=!!length;that.trigger("dataBound")},text:function(text){var that=this;var dataItem,loweredText;var ignoreCase=that.options.ignoreCase;text=text===null?"":text;if(text!==undefined){if(typeof text==="string"){loweredText=ignoreCase?text.toLowerCase():text;dataItem=that._select(function(data){data=that._text(data);if(ignoreCase){data=(data+"").toLowerCase()}return data===loweredText});if(dataItem){text=dataItem}}that._textAccessor(text)}else{return that._textAccessor()}},value:function(value){var that=this,idx,hasValue;if(value!==undefined){if(value!==null){value=value.toString()}that._selectedValue=value;hasValue=value||(that.options.optionLabel&&!that.element[0].disabled&&value==="");if(hasValue&&that._fetchItems(value)){return}idx=that._index(value);that.select(idx>-1?idx:0)}else{return that._accessor()}},_editable:function(options){var that=this,element=that.element,disable=options.disable,readonly=options.readonly,wrapper=that.wrapper.add(that.filterInput).off(ns),dropDownWrapper=that._inputWrapper.off(HOVEREVENTS),focusin=function(){dropDownWrapper.addClass(FOCUSED);that._prevent=false},focusout=function(){if(!that._prevent){var filtered=that._state===STATE_FILTER;var isIFrame=window.self!==window.top;if(filtered){that._select(that._current)}if(!filtered||that.dataItem()){that._triggerCascade()}if(kendo.support.mobileOS.ios&&isIFrame){that._change()}else{that._blur()}dropDownWrapper.removeClass(FOCUSED);that._prevent=true;that._open=false;element.blur()}that._wrapperClicked=false};if(!readonly&&!disable){element.removeAttr(DISABLED).removeAttr(READONLY);dropDownWrapper.addClass(DEFAULT).removeClass(STATEDISABLED).on(HOVEREVENTS,that._toggleHover);wrapper.attr(TABINDEX,wrapper.data(TABINDEX)).attr(ARIA_DISABLED,false).attr(ARIA_READONLY,false).on("keydown"+ns,proxy(that._keydown,that)).on("focusin"+ns,focusin).on("focusout"+ns,focusout).on("mousedown"+ns,function(e){that._prevent=true});that.wrapper.on("click"+ns,function(e){e.preventDefault();that._focused=that.wrapper;that._toggle()});if(!that.filterInput){wrapper.on("keypress"+ns,proxy(that._keypress,that))}}else{if(disable){wrapper.removeAttr(TABINDEX);dropDownWrapper.addClass(STATEDISABLED).removeClass(DEFAULT)}else{dropDownWrapper.addClass(DEFAULT).removeClass(STATEDISABLED);wrapper.on("focusin"+ns,focusin).on("focusout"+ns,focusout)}}element.attr(DISABLED,disable).attr(READONLY,readonly);wrapper.attr(ARIA_DISABLED,disable).attr(ARIA_READONLY,readonly)},_accept:function(li,key){var that=this;var activeFilter=that.filterInput&&that.filterInput[0]===activeElement();that._focus(li);that._focusElement(that.wrapper);if(activeFilter&&key===keys.TAB){that.wrapper.focusout()}},_option:function(value,text){return'"},_optionLabelText:function(){var options=this.options,dataTextField=options.dataTextField,optionLabel=options.optionLabel;if(optionLabel&&dataTextField&&typeof optionLabel==="object"){return this._text(optionLabel)}return optionLabel},_data:function(){var that=this,options=that.options,optionLabel=options.optionLabel,textField=options.dataTextField,valueField=options.dataValueField,data=that.dataSource.view(),length=data.length,first=optionLabel,idx=0;if(optionLabel&&length){if(typeof optionLabel==="object"){first=optionLabel}else{if(textField){first={};textField=textField.split(".");valueField=valueField.split(".");assign(first,valueField,"");assign(first,textField,optionLabel)}}first=new kendo.data.ObservableArray([first]);for(;idx0&&startIndex-1){if(!word){word=character}if(that._selectNext(word,index+1)){return}}that._word=word+character;that._last=character;that._search()},_popup:function(){Select.fn._popup.call(this);this.popup.one("open",proxy(function(){var popup=this.popup;popup.wrapper=kendo.wrap(popup.element);if(popup.element.closest(".km-root")[0]){popup.wrapper.addClass("km-popup km-widget");this.wrapper.addClass("km-widget")}},this))},_focusElement:function(element){var active=activeElement();var wrapper=this.wrapper;var filterInput=this.filterInput;var compareElement=element===filterInput?wrapper:filterInput;if(filterInput&&compareElement[0]===active){this._prevent=true;this._focused=element.focus()}},_filter:function(word){if(word){var that=this;var ignoreCase=that.options.ignoreCase;if(ignoreCase){word=word.toLowerCase()}that._select(function(dataItem){var text=that._text(dataItem);if(text!==undefined){text=(text+"");if(ignoreCase){text=text.toLowerCase()}return text.indexOf(word)===0}})}},_search:function(){var that=this,dataSource=that.dataSource,index=that.selectedIndex,word=that._word;clearTimeout(that._typing);if(that.options.filter!=="none"){that._typing=setTimeout(function(){var value=that.filterInput.val();if(that._prev!==value){that._prev=value;that.search(value)}that._typing=null},that.options.delay)}else{that._typing=setTimeout(function(){that._word=""},that.options.delay);if(index===-1){index=0}if(!that.ul[0].firstChild){dataSource.one(CHANGE,function(){if(dataSource.data()[0]&&index>-1){that._selectNext(word,index)}}).fetch();return}that._selectNext(word,index);that._triggerEvents()}},_select:function(li){var that=this,current=that._current,data=null,value,idx;li=that._get(li);if(li&&li[0]&&!li.hasClass(SELECTED)){if(that._state===STATE_FILTER){that._state=STATE_ACCEPT}if(current){current.removeClass(SELECTED)}idx=ui.List.inArray(li[0],that.ul[0]);if(idx>-1){data=that._data()[idx];value=that._value(data);that.selectedIndex=idx;that._textAccessor(data);that._accessor(value!==undefined?value:that._text(data),idx);that._selectedValue=that._accessor();that.current(li.addClass(SELECTED));if(that._optionID){that._current.attr("aria-selected",true)}}}return data},_triggerEvents:function(){if(!this.popup.visible()){this._triggerCascade();this._change()}},_mobile:function(){var that=this,popup=that.popup,root=popup.element.parents(".km-root").eq(0);if(root.length&&os){popup.options.animation.open.effects=(os.android||os.meego)?"fadeIn":(os.ios||os.wp)?"slideIn:up":popup.options.animation.open.effects}},_filterHeader:function(){var options=this.options;var filterEnalbed=options.filter!=="none";if(this.filterInput&&!filterEnalbed){this.filterInput.off(ns).parent().remove();this.filterInput=null;return}if(filterEnalbed){var icon='select';this.filterInput=$('').attr({role:"listbox","aria-haspopup":true,"aria-expanded":false});this.list.prepend($('').append(this.filterInput.add(icon)))}},_span:function(){var that=this,wrapper=that.wrapper,SELECTOR="span.k-input",span;span=wrapper.find(SELECTOR);if(!span[0]){wrapper.append(' select').append(that.element);span=wrapper.find(SELECTOR)}that.span=span;that._inputWrapper=$(wrapper[0].firstChild);that._arrow=wrapper.find(".k-icon").mousedown(function(e){e.preventDefault()})},_wrapper:function(){var that=this,element=that.element,DOMelement=element[0],wrapper;wrapper=element.parent();if(!wrapper.is("span.k-widget")){wrapper=element.wrap("").parent();wrapper[0].style.cssText=DOMelement.style.cssText}element.hide();that._focused=that.wrapper=wrapper.addClass("k-widget k-dropdown k-header").addClass(DOMelement.className).css("display","").attr({unselectable:"on",role:"listbox","aria-haspopup":true,"aria-expanded":false})},_clearSelection:function(){var that=this;var optionLabel=that.options.optionLabel;that.options.value="";that._selectedValue="";if(that.dataSource.view()[0]&&(optionLabel||that._userTriggered)){that.select(0);return}that.selectedIndex=-1;that.element.val("");that._textAccessor(that.options.optionLabel)},_inputTemplate:function(){var that=this,template=that.options.valueTemplate;if(!template){template=$.proxy(kendo.template("#:this._text(data)#",{useWithBlock:false}),that)}else{template=kendo.template(template)}that.valueTemplate=template},_textAccessor:function(text){var dataItem=this.dataItem();var options=this.options;var span=this.span;if(text!==undefined){if($.isPlainObject(text)||text instanceof kendo.data.ObservableObject){dataItem=text}else{if(!dataItem||this._text(dataItem)!==text){if(options.dataTextField){dataItem={};assign(dataItem,options.dataTextField.split("."),text);assign(dataItem,options.dataValueField.split("."),this._accessor())}else{dataItem=text}}}var getElements=function(){return{elements:span.get(),data:[{dataItem:dataItem}]}};this.angular("cleanup",getElements);span.html(this.valueTemplate(dataItem));this.angular("compile",getElements)}else{return span.text()}}});function assign(instance,fields,value){var idx=0,lastIndex=fields.length-1,field;for(;idx-1){word=that._text(that.dataSource.view()[idx])}else{word=""}}if(caretIdx<=0){caretIdx=value.toLowerCase().indexOf(word.toLowerCase())+1}if(word){idx=word.toLowerCase().indexOf(value.toLowerCase());if(idx>-1){value+=word.substring(idx+value.length)}}else{value=value.substring(0,caretIdx)}if(value.length!==caretIdx||!word){element.value=value;if(element===activeElement()){caret(element,caretIdx,value.length)}}},text:function(text){text=text===null?"":text;var that=this;var input=that.input[0];var ignoreCase=that.options.ignoreCase;var loweredText=text;var dataItem;var value;if(text!==undefined){dataItem=that.dataItem();if(dataItem&&that._text(dataItem)===text){value=that._value(dataItem);if(value===null){value=""}else{value+=""}if(value===that._old){that._triggerCascade();return}}if(ignoreCase){loweredText=loweredText.toLowerCase()}that._select(function(data){data=that._text(data);if(ignoreCase){data=(data+"").toLowerCase()}return data===loweredText});if(that.selectedIndex<0){that._custom(text);input.value=text}that._prev=input.value;that._triggerCascade()}else{return input.value}},toggle:function(toggle){this._toggle(toggle,true)},value:function(value){var that=this,options=that.options,idx;if(value!==undefined){if(value!==null){value=value.toString()}that._selectedValue=value;if(!that._open&&value&&that._fetchItems(value)){return}idx=that._index(value);if(idx>-1){that.select(idx)}else{that.current(NULL);that._custom(value);if(options.value!==value||options.text!==that.input.val()){that.text(value);that._placeholder()}}that._old=that._accessor();that._oldIndex=that.selectedIndex}else{return that._accessor()}},_accept:function(li){var that=this;if(li){that._focus(li)}else{that.text(that.text());that._change()}},_custom:function(value,keepState){var that=this;var element=that.element;var custom=that._option;if(that._state===STATE_FILTER&&!keepState){that._state=STATE_ACCEPT}if(that._isSelect){if(!custom){custom=that._option=$("
    ";var WINDOWTEMPLATE='
    ';ui.plugin(PivotFieldMenu)})(window.kendo.jQuery);(function($,undefined){var kendo=window.kendo,ui=kendo.ui,DataSource=kendo.data.DataSource,Widget=ui.Widget,CHANGE="change",BOOL="boolean",ENUM="enums",STRING="string",NS=".kendoFilterCell",EQ="Is equal to",NEQ="Is not equal to",proxy=$.proxy;function findFilterForField(filter,field){var filters=[];if($.isPlainObject(filter)){if(filter.hasOwnProperty("filters")){filters=filter.filters}else{if(filter.field==field){return filter}}}if(($.isArray(filter))){filters=filter}for(var i=0;i").appendTo(element);var that=this,dataSource,suggestDataSource,viewModel,type,operators=that.operators=options.operators||{},input=that.input=$("").attr(kendo.attr("bind"),"value: value").appendTo(wrapper);Widget.fn.init.call(that,element[0],options);options=that.options;dataSource=that.dataSource=options.dataSource;that.model=dataSource.reader.model;type=options.type=kendo.getter("reader.model.fields['"+options.field+"'].type",true)(dataSource)||STRING;if(options.values){options.type=type=ENUM}operators=operators[type]||options.operators[type];that._parse=function(value){return value+""};if(that.model&&that.model.fields){var field=that.model.fields[options.field];if(field){if(field.parse){that._parse=proxy(field.parse,field)}}}that.viewModel=viewModel=kendo.observable({operator:options.operator,value:null,operatorVisible:function(){var val=this.get("value");return val!==null&&val!==undefined&&val!="undefined"}});viewModel.bind(CHANGE,proxy(that.updateDsFilter,that));that._setInputType(options,type);if(type!=BOOL&&options.showOperators!==false){that._createOperatorDropDown(operators)}that._createClearIcon();kendo.bind(this.wrapper,viewModel);if(type==STRING){suggestDataSource=that.suggestDataSource=options.suggestDataSource;if(!(suggestDataSource instanceof DataSource)){if(!options.customDataSource&&suggestDataSource){suggestDataSource.data=undefined;suggestDataSource.group=undefined}suggestDataSource=that.suggestDataSource=DataSource.create(suggestDataSource)}that.setSuggestDataSource(suggestDataSource)}if(type==ENUM){that.setComboBoxSource(that.options.values)}that._refreshUI();that._refreshHandler=proxy(that._refreshUI,that);that.dataSource.bind(CHANGE,that._refreshHandler)},_setInputType:function(options,type){var that=this,input=that.input;if(typeof(options.template)=="function"){options.template.call(that.viewModel,that.input)}else{if(type==STRING){input.attr(kendo.attr("role"),"autocomplete").attr(kendo.attr("text-field"),that.options.dataTextField||that.options.field).attr(kendo.attr("delay"),this.options.delay).attr(kendo.attr("value-primitive"),true)}else{if(type=="date"){input.attr(kendo.attr("role"),"datepicker")}else{if(type==BOOL){var wrapper=this.wrapper;var inputName=kendo.guid();var labelTrue=$("