/*
* Kendo UI v2014.1.611 (http://www.telerik.com/kendo-ui)
* Copyright 2014 Telerik AD. All rights reserved.
*
* Kendo UI commercial licenses may be obtained at
* http://www.telerik.com/purchase/license-agreement/kendo-ui-complete
* If you do not own a commercial license, this file shall be governed by the trial license terms.
*/
(function(f,define){define([],f)})(function(){(function(e,t){function n(){}function r(e,t){if(t)return"'"+e.split("'").join("\\'").split('\\"').join('\\\\\\"').replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/\t/g,"\\t")+"'";var n=e.charAt(0),r=e.substring(1);return"="===n?"+("+r+")+":":"===n?"+e("+r+")+":";"+e+";o+="}function o(e,t,n){return e+="",t=t||2,n=t-e.length,n?R[t].substring(0,n)+e:e}function i(e){var t=e.css(mt.support.transitions.css+"box-shadow")||e.css("box-shadow"),n=t?t.match(xt)||[0,0,0,0,0]:[0,0,0,0,0],r=wt.max(+n[3],+(n[4]||0));return{left:-n[1]+r,right:+n[1]+r,bottom:+n[2]+r}}function s(t,n){var r,o,s,a,u,l,c,d,f=Mt.browser,m="rtl"==t.css("direction");return t.parent().hasClass("k-animation-container")?(c=t.parent(".k-animation-container"),d=c[0].style,c.is(":hidden")&&c.show(),r=St.test(d.width)||St.test(d.height),r||c.css({width:t.outerWidth(),height:t.outerHeight(),boxSizing:"content-box",mozBoxSizing:"content-box",webkitBoxSizing:"content-box"})):(o=i(t),s=t[0].style.width,a=t[0].style.height,u=St.test(s),l=St.test(a),f.opera&&(o.left=o.right=o.bottom=5),r=u||l,!u&&(!n||n&&s)&&(s=t.outerWidth()),!l&&(!n||n&&a)&&(a=t.outerHeight()),t.wrap(e("<div/>").addClass("k-animation-container").css({width:s,height:a,marginLeft:o.left*(m?1:-1),paddingLeft:o.left,paddingRight:o.right,paddingBottom:o.bottom})),r&&t.css({width:"100%",height:"100%",boxSizing:"border-box",mozBoxSizing:"border-box",webkitBoxSizing:"border-box"})),f.msie&&wt.floor(f.version)<=7&&(t.css({zoom:1}),t.children(".k-menu").width(t.width())),t.parent()}function a(e){var t=1,n=arguments.length;for(t=1;n>t;t++)u(e,arguments[t]);return e}function u(e,t){var n,r,o,i,s=mt.data.ObservableArray,a=mt.data.DataSource,l=mt.data.HierarchicalDataSource;for(n in t)r=t[n],o=typeof r,o===Ct&&null!==r&&r.constructor!==Array&&r.constructor!==s&&r.constructor!==a&&r.constructor!==l?r instanceof Date?e[n]=new Date(r.getTime()):C(r.clone)?e[n]=r.clone():(i=e[n],e[n]=typeof i===Ct?i||{}:{},u(e[n],r)):o!==At&&(e[n]=r);return e}function l(e,n,r){for(var o in n)if(n.hasOwnProperty(o)&&n[o].test(e))return o;return r!==t?r:e}function c(e){return e.replace(/([a-z][A-Z])/g,function(e){return e.charAt(0)+"-"+e.charAt(1).toLowerCase()})}function d(e){return e.replace(/\-(\w)/g,function(e,t){return t.toUpperCase()})}function f(t,n){var r,o={};return document.defaultView&&document.defaultView.getComputedStyle?(r=document.defaultView.getComputedStyle(t,""),n&&e.each(n,function(e,t){o[t]=r.getPropertyValue(t)})):(r=t.currentStyle,n&&e.each(n,function(e,t){o[t]=r[d(t)]})),mt.size(o)||(o=r),o}function m(e){var t,n=0;for(t in e)e.hasOwnProperty(t)&&"toJSON"!=t&&n++;return n}function p(e,t,n){t||(t="offset");var r=e[t]();return Mt.browser.msie&&(Mt.pointers||Mt.msPointers)&&!n&&(r.top-=window.pageYOffset-document.documentElement.scrollTop,r.left-=window.pageXOffset-document.documentElement.scrollLeft),r}function h(e){var t={};return ht("string"==typeof e?e.split(" "):e,function(e){t[e]=this}),t}function g(e){return new mt.effects.Element(e)}function y(e,t,n,r){return typeof e===kt&&(C(t)&&(r=t,t=400,n=!1),C(n)&&(r=n,n=!1),typeof t===Et&&(n=t,t=400),e={effects:e,duration:t,reverse:n,complete:r}),pt({effects:{},duration:400,reverse:!1,init:vt,teardown:vt,hide:!1},e,{completeCallback:e.complete,complete:vt})}function v(t,n,r,o,i){for(var s,a=0,u=t.length;u>a;a++)s=e(t[a]),s.queue(function(){L.promise(s,y(n,r,o,i))});return t}function w(e,t,n,r){return t&&(t=t.split(" "),ht(t,function(t,n){e.toggleClass(n,r)})),e}function b(e){return(""+e).replace(j,"&amp;").replace(B,"&lt;").replace(Y,"&gt;").replace($,"&quot;").replace(J,"&#39;")}function M(e,n){var r;return 0===n.indexOf("data")&&(n=n.substring(4),n=n.charAt(0).toLowerCase()+n.substring(1)),n=n.replace(et,"-$1"),r=e.getAttribute("data-"+mt.ns+n),null===r?r=t:"null"===r?r=null:"true"===r?r=!0:"false"===r?r=!1:Dt.test(r)?r=parseFloat(r):K.test(r)&&!X.test(r)&&(r=Function("return ("+r+")")()),r}function S(n,r){var o,i,s={};for(o in r)i=M(n,o),i!==t&&(Z.test(o)&&(i=mt.template(e("#"+i).html())),s[o]=i);return s}function T(t,n){return e.contains(t,n)?-1:1}function x(){var t=e(this);return e.inArray(t.attr("data-role"),["slider","rangeslider"])>0||t.is(":visible")}function D(e,t){var n=e.nodeName.toLowerCase();return(/input|select|textarea|button|object/.test(n)?!e.disabled:"a"===n?e.href||t:t)&&O(e)}function O(t){return!e(t).parents().addBack().filter(function(){return"hidden"===e.css(this,"visibility")||e.expr.filters.hidden(this)}).length}function k(e,t){return new k.fn.init(e,t)}var z,C,H,E,A,N,P,F,_,I,U,R,W,L,j,B,$,J,Y,V,q,G,Q,Z,K,X,et,tt,nt,rt,ot,it,st,at,ut,lt,ct,dt,ft,mt=window.kendo=window.kendo||{cultures:{}},pt=e.extend,ht=e.each,gt=e.isArray,yt=e.proxy,vt=e.noop,wt=Math,bt=window.JSON||{},Mt={},St=/%/,Tt=/\{(\d+)(:[^\}]+)?\}/g,xt=/(\d+(?:\.?)\d*)px\s*(\d+(?:\.?)\d*)px\s*(\d+(?:\.?)\d*)px\s*(\d+)?/i,Dt=/^(\+|-?)\d+(\.?)\d*$/,Ot="function",kt="string",zt="number",Ct="object",Ht="null",Et="boolean",At="undefined",Nt={},Pt={},Ft=[].slice,_t=window.Globalize;mt.version="2014.1.611",n.extend=function(e){var t,n,r=function(){},o=this,i=e&&e.init?e.init:function(){o.apply(this,arguments)};r.prototype=o.prototype,n=i.fn=i.prototype=new r;for(t in e)n[t]=null!=e[t]&&e[t].constructor===Object?pt(!0,{},r.prototype[t],e[t]):e[t];return n.constructor=i,i.extend=o.extend,i},n.prototype._initOptions=function(e){this.options=a({},this.options,e)},C=mt.isFunction=function(e){return"function"==typeof e},H=function(){this._defaultPrevented=!0},E=function(){return this._defaultPrevented===!0},A=n.extend({init:function(){this._events={}},bind:function(e,n,r){var o,i,s,a,u,l=this,c=typeof e===kt?[e]:e,d=typeof n===Ot;if(n===t){for(o in e)l.bind(o,e[o]);return l}for(o=0,i=c.length;i>o;o++)e=c[o],a=d?n:n[e],a&&(r&&(s=a,a=function(){l.unbind(e,a),s.apply(l,arguments)},a.original=s),u=l._events[e]=l._events[e]||[],u.push(a));return l},one:function(e,t){return this.bind(e,t,!0)},first:function(e,t){var n,r,o,i,s=this,a=typeof e===kt?[e]:e,u=typeof t===Ot;for(n=0,r=a.length;r>n;n++)e=a[n],o=u?t:t[e],o&&(i=s._events[e]=s._events[e]||[],i.unshift(o));return s},trigger:function(e,t){var n,r,o=this,i=o._events[e];if(i){for(t=t||{},t.sender=o,t._defaultPrevented=!1,t.preventDefault=H,t.isDefaultPrevented=E,i=i.slice(),n=0,r=i.length;r>n;n++)i[n].call(o,t);return t._defaultPrevented===!0}return!1},unbind:function(e,n){var r,o=this,i=o._events[e];if(e===t)o._events={};else if(i)if(n)for(r=i.length-1;r>=0;r--)(i[r]===n||i[r].original===n)&&i.splice(r,1);else o._events[e]=[];return o}}),N=/^\w+/,P=/\$\{([^}]*)\}/g,F=/\\\}/g,_=/__CURLY__/g,I=/\\#/g,U=/__SHARP__/g,R=["","0","00","000","0000"],z={paramName:"data",useWithBlock:!0,render:function(e,t){var n,r,o="";for(n=0,r=t.length;r>n;n++)o+=e(t[n]);return o},compile:function(e,t){var n,o,i,s=pt({},this,t),a=s.paramName,u=a.match(N)[0],l=s.useWithBlock,c="var o,e=kendo.htmlEncode;";if(C(e))return e;for(c+=l?"with("+a+"){":"",c+="o=",o=e.replace(F,"__CURLY__").replace(P,"#=e($1)#").replace(_,"}").replace(I,"__SHARP__").split("#"),i=0;o.length>i;i++)c+=r(o[i],i%2===0);c+=l?";}":";",c+="return o;",c=c.replace(U,"#");try{return n=Function(u,c),n._slotCount=Math.floor(o.length/2),n}catch(d){throw Error(mt.format("Invalid template:'{0}' Generated code:'{1}'",e,c))}}},function(){function e(e){return s.lastIndex=0,s.test(e)?'"'+e.replace(s,function(e){var t=a[e];return typeof t===kt?t:"\\u"+("0000"+e.charCodeAt(0).toString(16)).slice(-4)})+'"':'"'+e+'"'}function t(o,s){var a,l,c,d,f,m,p=n,h=s[o];if(h&&typeof h===Ct&&typeof h.toJSON===Ot&&(h=h.toJSON(o)),typeof i===Ot&&(h=i.call(s,o,h)),m=typeof h,m===kt)return e(h);if(m===zt)return isFinite(h)?h+"":Ht;if(m===Et||m===Ht)return h+"";if(m===Ct){if(!h)return Ht;if(n+=r,f=[],"[object Array]"===u.apply(h)){for(d=h.length,a=0;d>a;a++)f[a]=t(a,h)||Ht;return c=0===f.length?"[]":n?"[\n"+n+f.join(",\n"+n)+"\n"+p+"]":"["+f.join(",")+"]",n=p,c}if(i&&typeof i===Ct)for(d=i.length,a=0;d>a;a++)typeof i[a]===kt&&(l=i[a],c=t(l,h),c&&f.push(e(l)+(n?": ":":")+c));else for(l in h)Object.hasOwnProperty.call(h,l)&&(c=t(l,h),c&&f.push(e(l)+(n?": ":":")+c));return c=0===f.length?"{}":n?"{\n"+n+f.join(",\n"+n)+"\n"+p+"}":"{"+f.join(",")+"}",n=p,c}}var n,r,i,s=/[\\\"\x00-\x1f\x7f-\x9f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,a={"\b":"\\b","	":"\\t","\n":"\\n","\f":"\\f","\r":"\\r",'"':'\\"',"\\":"\\\\"},u={}.toString;typeof Date.prototype.toJSON!==Ot&&(Date.prototype.toJSON=function(){var e=this;return isFinite(e.valueOf())?o(e.getUTCFullYear(),4)+"-"+o(e.getUTCMonth()+1)+"-"+o(e.getUTCDate())+"T"+o(e.getUTCHours())+":"+o(e.getUTCMinutes())+":"+o(e.getUTCSeconds())+"Z":null},String.prototype.toJSON=Number.prototype.toJSON=Boolean.prototype.toJSON=function(){return this.valueOf()}),typeof bt.stringify!==Ot&&(bt.stringify=function(e,o,s){var a;if(n="",r="",typeof s===zt)for(a=0;s>a;a+=1)r+=" ";else typeof s===kt&&(r=s);if(i=o,o&&typeof o!==Ot&&(typeof o!==Ct||typeof o.length!==zt))throw Error("JSON.stringify");return t("",{"":e})})}(),function(){function n(e){if(e){if(e.numberFormat)return e;if(typeof e===kt){var t=mt.cultures;return t[e]||t[e.split("-")[0]]||null}return null}return null}function r(e){return e&&(e=n(e)),e||mt.cultures.current}function i(e){e.groupSizes=e.groupSize,e.percent.groupSizes=e.percent.groupSize,e.currency.groupSizes=e.currency.groupSize}function s(e,n,i){i=r(i);var s=i.calendars.standard,a=s.days,u=s.months;return n=s.patterns[n]||n,n.replace(c,function(n){var r;return"d"===n?r=e.getDate():"dd"===n?r=o(e.getDate()):"ddd"===n?r=a.namesAbbr[e.getDay()]:"dddd"===n?r=a.names[e.getDay()]:"M"===n?r=e.getMonth()+1:"MM"===n?r=o(e.getMonth()+1):"MMM"===n?r=u.namesAbbr[e.getMonth()]:"MMMM"===n?r=u.names[e.getMonth()]:"yy"===n?r=o(e.getFullYear()%100):"yyyy"===n?r=o(e.getFullYear(),4):"h"===n?r=e.getHours()%12||12:"hh"===n?r=o(e.getHours()%12||12):"H"===n?r=e.getHours():"HH"===n?r=o(e.getHours()):"m"===n?r=e.getMinutes():"mm"===n?r=o(e.getMinutes()):"s"===n?r=e.getSeconds():"ss"===n?r=o(e.getSeconds()):"f"===n?r=wt.floor(e.getMilliseconds()/100):"ff"===n?(r=e.getMilliseconds(),r>99&&(r=wt.floor(r/10)),r=o(r)):"fff"===n?r=o(e.getMilliseconds(),3):"tt"===n&&(r=e.getHours()<12?s.AM[0]:s.PM[0]),r!==t?r:n.slice(1,n.length-1)})}function a(e,n,o){o=r(o);var i,s,a,l,c,b,M,S,T,x,D,O,k,z,C,H,E,A,N,P,F,_,I,U=o.numberFormat,R=U.groupSize[0],W=U[g],L=U[h],j=U.decimals,B=U.pattern[0],$=[],J=0>e,Y=p,V=p,q=-1;if(e===t)return p;if(!isFinite(e))return e;if(!n)return o.name.length?e.toLocaleString():""+e;if(c=d.exec(n)){if(n=c[1].toLowerCase(),s="c"===n,a="p"===n,(s||a)&&(U=s?U.currency:U.percent,R=U.groupSize[0],W=U[g],L=U[h],j=U.decimals,i=U.symbol,B=U.pattern[J?0:1]),l=c[2],l&&(j=+l),"e"===n)return l?e.toExponential(j):e.toExponential();if(a&&(e*=100),e=u(e,j),J=0>e,e=e.split(h),b=e[0],M=e[1],J&&(b=b.substring(1)),V=b,S=b.length,S>=R)for(V=p,x=0;S>x;x++)x>0&&(S-x)%R===0&&(V+=W),V+=b.charAt(x);if(M&&(V+=L+M),"n"===n&&!J)return V;for(e=p,x=0,D=B.length;D>x;x++)O=B.charAt(x),e+="n"===O?V:"$"===O||"%"===O?i:O;return e}if(J&&(e=-e),(n.indexOf("'")>-1||n.indexOf('"')>-1||n.indexOf("\\")>-1)&&(n=n.replace(f,function(e){var t=e.charAt(0).replace("\\",""),n=e.slice(1).replace(t,"");return $.push(n),w})),n=n.split(";"),J&&n[1])n=n[1],z=!0;else if(0===e){if(n=n[2]||n[0],-1==n.indexOf(y)&&-1==n.indexOf(v))return n}else n=n[0];if(P=n.indexOf("%"),F=n.indexOf("$"),a=-1!=P,s=-1!=F,a&&(e*=100),s&&"\\"===n[F-1]&&(n=n.split("\\").join(""),s=!1),(s||a)&&(U=s?U.currency:U.percent,R=U.groupSize[0],W=U[g],L=U[h],j=U.decimals,i=U.symbol),k=n.indexOf(g)>-1,k&&(n=n.replace(m,p)),C=n.indexOf(h),D=n.length,-1!=C?(M=(""+e).split("e"),M=M[1]?u(e,Math.abs(M[1])):M[0],M=M.split(h)[1]||p,E=n.lastIndexOf(v)-C,H=n.lastIndexOf(y)-C,A=E>-1,N=H>-1,x=M.length,A||N||(n=n.substring(0,C)+n.substring(C+1),D=n.length,C=-1,x=0),A&&E>H?x=E:H>E&&(N&&x>H?x=H:A&&E>x&&(x=E)),x>-1&&(e=u(e,x))):e=u(e),H=n.indexOf(y),_=E=n.indexOf(v),q=-1==H&&-1!=E?E:-1!=H&&-1==E?H:H>E?E:H,H=n.lastIndexOf(y),E=n.lastIndexOf(v),I=-1==H&&-1!=E?E:-1!=H&&-1==E?H:H>E?H:E,q==D&&(I=q),-1!=q){if(V=(""+e).split(h),b=V[0],M=V[1]||p,S=b.length,T=M.length,J&&-1*e>=0&&(J=!1),k)if(S===R&&C-_>S)b=W+b;else if(S>R){for(V=p,x=0;S>x;x++)x>0&&(S-x)%R===0&&(V+=W),V+=b.charAt(x);b=V}for(e=n.substring(0,q),J&&!z&&(e+="-"),x=q;D>x;x++){if(O=n.charAt(x),-1==C){if(S>I-x){e+=b;break}}else if(-1!=E&&x>E&&(Y=p),S>=C-x&&C-x>-1&&(e+=b,x=C),C===x){e+=(M?L:p)+M,x+=I-C+1;continue}O===v?(e+=O,Y=O):O===y&&(e+=Y)}if(I>=q&&(e+=n.substring(I+1)),s||a){for(V=p,x=0,D=e.length;D>x;x++)O=e.charAt(x),V+="$"===O||"%"===O?i:O;e=V}if(D=$.length)for(x=0;D>x;x++)e=e.replace(w,$[x])}return e}var u,l,c=/dddd|ddd|dd|d|MMMM|MMM|MM|M|yyyy|yy|HH|H|hh|h|mm|m|fff|ff|f|tt|ss|s|"[^"]*"|'[^']*'/g,d=/^(n|c|p|e)(\d*)$/i,f=/(\\.)|(['][^']*[']?)|(["][^"]*["]?)/g,m=/\,/g,p="",h=".",g=",",y="#",v="0",w="??",b="en-US",M={}.toString;mt.cultures["en-US"]={name:b,numberFormat:{pattern:["-n"],decimals:2,",":",",".":".",groupSize:[3],percent:{pattern:["-n %","n %"],decimals:2,",":",",".":".",groupSize:[3],symbol:"%"},currency:{pattern:["($n)","$n"],decimals:2,",":",",".":".",groupSize:[3],symbol:"$"}},calendars:{standard:{days:{names:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],namesAbbr:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],namesShort:["Su","Mo","Tu","We","Th","Fr","Sa"]},months:{names:["January","February","March","April","May","June","July","August","September","October","November","December"],namesAbbr:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"]},AM:["AM","am","AM"],PM:["PM","pm","PM"],patterns:{d:"M/d/yyyy",D:"dddd, MMMM dd, yyyy",F:"dddd, MMMM dd, yyyy h:mm:ss tt",g:"M/d/yyyy h:mm tt",G:"M/d/yyyy h:mm:ss tt",m:"MMMM dd",M:"MMMM dd",s:"yyyy'-'MM'-'ddTHH':'mm':'ss",t:"h:mm tt",T:"h:mm:ss tt",u:"yyyy'-'MM'-'dd HH':'mm':'ss'Z'",y:"MMMM, yyyy",Y:"MMMM, yyyy"},"/":"/",":":":",firstDay:0,twoDigitYearMax:2029}}},mt.culture=function(e){var r,o=mt.cultures;return e===t?o.current:(r=n(e)||o[b],r.calendar=r.calendars.standard,o.current=r,_t&&i(r.numberFormat),t)},mt.findCulture=n,mt.getCulture=r,mt.culture(b),u=function(e,t){return t=t||0,e=(""+e).split("e"),e=Math.round(+(e[0]+"e"+(e[1]?+e[1]+t:t))),e=(""+e).split("e"),e=+(e[0]+"e"+(e[1]?+e[1]-t:-t)),e.toFixed(t)},l=function(e,n,r){if(n){if("[object Date]"===M.call(e))return s(e,n,r);if(typeof e===zt)return a(e,n,r)}return e!==t?e:""},_t&&(l=function(t,n,r){return e.isPlainObject(r)&&(r=r.name),_t.format(t,n,r)}),mt.format=function(e){var t=arguments;return e.replace(Tt,function(e,n,r){var o=t[parseInt(n,10)+1];return l(o,r?r.substring(1):"")})},mt._extractFormat=function(e){return"{0:"===e.slice(0,3)&&(e=e.slice(3,e.length-1)),e},mt._activeElement=function(){try{return document.activeElement}catch(e){return document.documentElement.activeElement}},mt._round=u,mt.toString=l}(),function(){function n(e,t,n){return!(e>=t&&n>=e)}function r(e){return e.charAt(0)}function o(t){return e.map(t,r)}function i(e,t){t||23!==e.getHours()||e.setHours(e.getHours()+2)}function s(e){for(var t=0,n=e.length,r=[];n>t;t++)r[t]=(e[t]+"").toLowerCase();return r}function a(e){var t,n={};for(t in e)n[t]=s(e[t]);return n}function u(e,r,s){if(!e)return null;var u,l,c,d,p,h,g,v,w,b,M,S,T,x,D=function(e){for(var t=0;r[I]===e;)t++,I++;return t>0&&(I-=1),t},O=function(t){var n=y[t]||RegExp("^\\d{1,"+t+"}"),r=e.substr(U,t).match(n);return r?(r=r[0],U+=r.length,parseInt(r,10)):null},k=function(t,n){for(var r,o,i,s=0,a=t.length;a>s;s++)if(r=t[s],o=r.length,i=e.substr(U,o),n&&(i=i.toLowerCase()),i==r)return U+=o,s+1;return null},z=function(){var t=!1;return e.charAt(U)===r[I]&&(U++,t=!0),t},C=s.calendars.standard,H=null,E=null,A=null,N=null,P=null,F=null,_=null,I=0,U=0,R=!1,W=new Date,L=C.twoDigitYearMax||2029,j=W.getFullYear();for(r||(r="d"),d=C.patterns[r],d&&(r=d),r=r.split(""),c=r.length;c>I;I++)if(u=r[I],R)"'"===u?R=!1:z();else if("d"===u){if(l=D("d"),C._lowerDays||(C._lowerDays=a(C.days)),A=3>l?O(2):k(C._lowerDays[3==l?"namesAbbr":"names"],!0),null===A||n(A,1,31))return null}else if("M"===u){if(l=D("M"),C._lowerMonths||(C._lowerMonths=a(C.months)),E=3>l?O(2):k(C._lowerMonths[3==l?"namesAbbr":"names"],!0),null===E||n(E,1,12))return null;E-=1}else if("y"===u){if(l=D("y"),H=O(l),null===H)return null;2==l&&("string"==typeof L&&(L=j+parseInt(L,10)),H=j-j%100+H,H>L&&(H-=100))}else if("h"===u){if(D("h"),N=O(2),12==N&&(N=0),null===N||n(N,0,11))return null}else if("H"===u){if(D("H"),N=O(2),null===N||n(N,0,23))return null}else if("m"===u){if(D("m"),P=O(2),null===P||n(P,0,59))return null}else if("s"===u){if(D("s"),F=O(2),null===F||n(F,0,59))return null}else if("f"===u){if(l=D("f"),x=e.substr(U,l).match(y[3]),_=O(l),null!==_&&(x=x[0].length,3>x&&(_*=Math.pow(10,3-x)),l>3&&(_=parseInt((""+_).substring(0,3),10))),null===_||n(_,0,999))return null}else if("t"===u){if(l=D("t"),w=C.AM,b=C.PM,1===l&&(w=o(w),b=o(b)),p=k(b),!p&&!k(w))return null}else if("z"===u){if(h=!0,l=D("z"),"Z"===e.substr(U,1)){if(!g)return null;z();continue}if(v=e.substr(U,6).match(l>2?m:f),!v)return null;if(v=v[0],U=v.length,v=v.split(":"),M=parseInt(v[0],10),n(M,-12,13))return null;if(l>2&&(S=parseInt(v[1],10),isNaN(S)||n(S,0,59)))return null}else if("T"===u)g=z();else if("'"===u)R=!0,z();else if(!z())return null;return T=null!==N||null!==P||F||null,null===H&&null===E&&null===A&&T?(H=j,E=W.getMonth(),A=W.getDate()):(null===H&&(H=j),null===A&&(A=1)),p&&12>N&&(N+=12),h?(M&&(N+=-M),S&&(P+=-S),e=new Date(Date.UTC(H,E,A,N,P,F,_))):(e=new Date(H,E,A,N,P,F,_),i(e,N)),100>H&&e.setFullYear(H),e.getDate()!==A&&h===t?null:e}function l(e){var t="-"===e.substr(0,1)?-1:1;return e=e.substring(1),e=60*parseInt(e.substr(0,2),10)+parseInt(e.substring(2),10),t*e}var c=/\u00A0/g,d=/[eE][\-+]?[0-9]+/,f=/[+|\-]\d{1,2}/,m=/[+|\-]\d{1,2}:\d{2}/,p=/^\/Date\((.*?)\)\/$/,h=/[+-]\d*/,g=["G","g","d","F","D","y","m","T","t"],y={2:/^\d{1,2}/,3:/^\d{1,3}/,4:/^\d{4}/},v={}.toString;mt.parseDate=function(e,t,n){var r,o,i,s,a;if("[object Date]"===v.call(e))return e;if(r=0,o=null,e&&0===e.indexOf("/D")&&(o=p.exec(e)))return o=o[1],a=h.exec(o.substring(1)),o=new Date(parseInt(o,10)),a&&(a=l(a[0]),o=mt.timezone.apply(o,0),o=mt.timezone.convert(o,0,-1*a)),o;if(n=mt.getCulture(n),!t){for(t=[],s=n.calendar.patterns,i=g.length;i>r;r++)t[r]=s[g[r]];r=0,t=["yyyy/MM/dd HH:mm:ss","yyyy/MM/dd HH:mm","yyyy/MM/dd","ddd MMM dd yyyy HH:mm:ss","yyyy-MM-ddTHH:mm:ss.fffffffzzz","yyyy-MM-ddTHH:mm:ss.fffzzz","yyyy-MM-ddTHH:mm:sszzz","yyyy-MM-ddTHH:mm:ss.fffffff","yyyy-MM-ddTHH:mm:ss.fff","yyyy-MM-ddTHH:mmzzz","yyyy-MM-ddTHH:mmzz","yyyy-MM-ddTHH:mm:ss","yyyy-MM-ddTHH:mm","yyyy-MM-dd HH:mm:ss","yyyy-MM-dd HH:mm","yyyy-MM-dd","HH:mm:ss","HH:mm"].concat(t)}for(t=gt(t)?t:[t],i=t.length;i>r;r++)if(o=u(e,t[r],n))return o;return o},mt.parseInt=function(e,t){var n=mt.parseFloat(e,t);return n&&(n=0|n),n},mt.parseFloat=function(e,t,n){if(!e&&0!==e)return null;if(typeof e===zt)return e;e=""+e,t=mt.getCulture(t);var r,o,i=t.numberFormat,s=i.percent,a=i.currency,u=a.symbol,l=s.symbol,f=e.indexOf("-");return d.test(e)?(e=parseFloat(e.replace(i["."],".")),isNaN(e)&&(e=null),e):f>0?null:(f=f>-1,e.indexOf(u)>-1||n&&n.toLowerCase().indexOf("c")>-1?(i=a,r=i.pattern[0].replace("$",u).split("n"),e.indexOf(r[0])>-1&&e.indexOf(r[1])>-1&&(e=e.replace(r[0],"").replace(r[1],""),f=!0)):e.indexOf(l)>-1&&(o=!0,i=s,u=l),e=e.replace("-","").replace(u,"").replace(c," ").split(i[","].replace(c," ")).join("").replace(i["."],"."),e=parseFloat(e),isNaN(e)?e=null:f&&(e*=-1),e&&o&&(e/=100),e)},_t&&(mt.parseDate=function(e,t,n){return"[object Date]"===v.call(e)?e:_t.parseDate(e,t,n)},mt.parseFloat=function(n,r){return typeof n===zt?n:n===t||null===n?null:(e.isPlainObject(r)&&(r=r.name),n=_t.parseFloat(n,r),isNaN(n)?null:n)})}(),function(){var n,r,o,i,s,a,u;Mt.scrollbar=function(){var e,t=document.createElement("div");return t.style.cssText="overflow:scroll;overflow-x:hidden;zoom:1;clear:both;display:block",t.innerHTML="&nbsp;",document.body.appendChild(t),e=t.offsetWidth-t.scrollWidth,document.body.removeChild(t),e},Mt.isRtl=function(t){return e(t).closest(".k-rtl").length>0},n=document.createElement("table");try{n.innerHTML="<tr><td></td></tr>",Mt.tbodyInnerHtml=!0}catch(c){Mt.tbodyInnerHtml=!1}Mt.touch="ontouchstart"in window,Mt.msPointers=window.MSPointerEvent,Mt.pointers=window.PointerEvent,r=Mt.transitions=!1,o=Mt.transforms=!1,i="HTMLElement"in window?HTMLElement.prototype:[],Mt.hasHW3D="WebKitCSSMatrix"in window&&"m11"in new window.WebKitCSSMatrix||"MozPerspective"in document.documentElement.style||"msPerspective"in document.documentElement.style,ht(["Moz","webkit","O","ms"],function(){var e,i=""+this,s=typeof n.style[i+"Transition"]===kt;return s||typeof n.style[i+"Transform"]===kt?(e=i.toLowerCase(),o={css:"ms"!=e?"-"+e+"-":"",prefix:i,event:"o"===e||"webkit"===e?e:""},s&&(r=o,r.event=r.event?r.event+"TransitionEnd":"transitionend"),!1):t}),n=null,Mt.transforms=o,Mt.transitions=r,Mt.devicePixelRatio=window.devicePixelRatio===t?1:window.devicePixelRatio;try{Mt.screenWidth=window.outerWidth||window.screen?window.screen.availWidth:window.innerWidth,Mt.screenHeight=window.outerHeight||window.screen?window.screen.availHeight:window.innerHeight}catch(c){Mt.screenWidth=window.screen.availWidth,Mt.screenHeight=window.screen.availHeight}Mt.detectOS=function(e){var t,n,r=!1,o=[],i=!/mobile safari/i.test(e),s={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/},a={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/},u={tablet:/playbook|ipad|fire/i},c={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(n in s)if(s.hasOwnProperty(n)&&(o=e.match(s[n]))){if("windows"==n&&"plugins"in navigator)return!1;r={},r.device=n,r.tablet=l(n,u,!1),r.browser=l(e,c,"default"),r.name=l(n,a),r[r.name]=!0,r.majorVersion=o[2],r.minorVersion=o[3].replace("_","."),t=r.minorVersion.replace(".","").substr(0,2),r.flatVersion=r.majorVersion+t+Array(3-(3>t.length?t.length:2)).join("0"),r.cordova=typeof window.PhoneGap!==At||typeof window.cordova!==At,r.appMode=window.navigator.standalone||/file|local|wmapp/.test(window.location.protocol)||r.cordova,r.android&&(1.5>Mt.devicePixelRatio&&400>r.flatVersion||i)&&(Mt.screenWidth>800||Mt.screenHeight>800)&&(r.tablet=n);break}return r},s=Mt.mobileOS=Mt.detectOS(navigator.userAgent),Mt.wpDevicePixelRatio=s.wp?screen.width/320:0,Mt.kineticScrollNeeded=s&&(Mt.touch||Mt.msPointers||Mt.pointers),Mt.hasNativeScrolling=!1,(s.ios||s.android&&s.majorVersion>2||s.wp)&&(Mt.hasNativeScrolling=s),Mt.mouseAndTouchPresent=Mt.touch&&!(Mt.mobileOS.ios||Mt.mobileOS.android),Mt.detectBrowser=function(e){var t,n=!1,r=[],o={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(t in o)if(o.hasOwnProperty(t)&&(r=e.match(o[t]))){n={},n[t]=!0,n[r[1].toLowerCase()]=!0,n.version=parseInt(document.documentMode||r[2],10);break}return n},Mt.browser=Mt.detectBrowser(navigator.userAgent),Mt.zoomLevel=function(){try{return Mt.touch?document.documentElement.clientWidth/window.innerWidth:Mt.browser.msie&&Mt.browser.version>=10?(top||window).document.documentElement.offsetWidth/(top||window).innerWidth:1}catch(e){return 1}},Mt.cssBorderSpacing=t!==document.documentElement.style.borderSpacing&&!(Mt.browser.msie&&8>Mt.browser.version),function(t){var n="",r=e(document.documentElement),o=parseInt(t.version,10);t.msie?n="ie":t.mozilla?n="ff":t.safari?n="safari":t.webkit?n="webkit":t.opera&&(n="opera"),n&&(n="k-"+n+" k-"+n+o),Mt.mobileOS&&(n+=" k-mobile"),r.addClass(n)}(Mt.browser),Mt.eventCapture=document.documentElement.addEventListener,a=document.createElement("input"),Mt.placeholder="placeholder"in a,Mt.propertyChangeEvent="onpropertychange"in a,Mt.input=function(){for(var e,t=["number","date","time","month","week","datetime","datetime-local"],n=t.length,r="test",o={},i=0;n>i;i++)e=t[i],a.setAttribute("type",e),a.value=r,o[e.replace("-","")]="text"!==a.type&&a.value!==r;return o}(),a.style.cssText="float:left;",Mt.cssFloat=!!a.style.cssFloat,a=null,Mt.stableSort=function(){var e,t=513,n=[{index:0,field:"b"}];for(e=1;t>e;e++)n.push({index:e,field:"a"});return n.sort(function(e,t){return e.field>t.field?1:t.field>e.field?-1:0}),1===n[0].index}(),Mt.matchesSelector=i.webkitMatchesSelector||i.mozMatchesSelector||i.msMatchesSelector||i.oMatchesSelector||i.matchesSelector||i.matches||function(t){for(var n=document.querySelectorAll?(this.parentNode||document).querySelectorAll(t)||[]:e(t),r=n.length;r--;)if(n[r]==this)return!0;return!1},Mt.pushState=window.history&&window.history.pushState,u=document.documentMode,Mt.hashChange="onhashchange"in window&&!(Mt.browser.msie&&(!u||8>=u))}(),W={left:{reverse:"right"},right:{reverse:"left"},down:{reverse:"up"},up:{reverse:"down"},top:{reverse:"bottom"},bottom:{reverse:"top"},"in":{reverse:"out"},out:{reverse:"in"}},L={},e.extend(L,{enabled:!0,Element:function(t){this.element=e(t)},promise:function(e,t){e.is(":visible")||e.css({display:e.data("olddisplay")||"block"}).css("display"),t.hide&&e.data("olddisplay",e.css("display")).hide(),t.init&&t.init(),t.completeCallback&&t.completeCallback(e),e.dequeue()},disable:function(){this.enabled=!1,this.promise=this.promiseShim},enable:function(){this.enabled=!0,this.promise=this.animatedPromise}}),L.promiseShim=L.promise,"kendoAnimate"in e.fn||pt(e.fn,{kendoStop:function(e,t){return this.stop(e,t)},kendoAnimate:function(e,t,n,r){return v(this,e,t,n,r)},kendoAddClass:function(e,t){return mt.toggleClass(this,e,t,!0)},kendoRemoveClass:function(e,t){return mt.toggleClass(this,e,t,!1)},kendoToggleClass:function(e,t,n){return mt.toggleClass(this,e,t,n)}}),j=/&/g,B=/</g,$=/"/g,J=/'/g,Y=/>/g,V=function(e){return e.target},Mt.touch&&(V=function(e){var t="originalEvent"in e?e.originalEvent.changedTouches:"changedTouches"in e?e.changedTouches:null;return t?document.elementFromPoint(t[0].clientX,t[0].clientY):e.target},ht(["swipe","swipeLeft","swipeRight","swipeUp","swipeDown","doubleTap","tap"],function(t,n){e.fn[n]=function(e){return this.bind(n,e)}})),Mt.touch?Mt.mobileOS?(Mt.mousedown="touchstart",Mt.mouseup="touchend",Mt.mousemove="touchmove",Mt.mousecancel="touchcancel",Mt.click="touchend",Mt.resize="orientationchange"):(Mt.mousedown="mousedown touchstart",Mt.mouseup="mouseup touchend",Mt.mousemove="mousemove touchmove",Mt.mousecancel="mouseleave touchcancel",Mt.click="click",Mt.resize="resize"):Mt.pointers?(Mt.mousemove="pointermove",Mt.mousedown="pointerdown",Mt.mouseup="pointerup",Mt.mousecancel="pointercancel",Mt.click="pointerup",Mt.resize="orientationchange resize"):Mt.msPointers?(Mt.mousemove="MSPointerMove",Mt.mousedown="MSPointerDown",Mt.mouseup="MSPointerUp",Mt.mousecancel="MSPointerCancel",Mt.click="MSPointerUp",Mt.resize="orientationchange resize"):(Mt.mousemove="mousemove",Mt.mousedown="mousedown",Mt.mouseup="mouseup",Mt.mousecancel="mouseleave",Mt.click="click",Mt.resize="resize"),q=function(e,t){var n,r,o,i,s=t||"d",a=1;for(r=0,o=e.length;o>r;r++)i=e[r],""!==i&&(n=i.indexOf("["),0!==n&&(-1==n?i="."+i:(a++,i="."+i.substring(0,n)+" || {})"+i.substring(n))),a++,s+=i+(o-1>r?" || {})":")"));return Array(a).join("(")+s},G=/^([a-z]+:)?\/\//i,pt(mt,{ui:mt.ui||{},fx:mt.fx||g,effects:mt.effects||L,mobile:mt.mobile||{},data:mt.data||{},dataviz:mt.dataviz||{ui:{roles:{}}},keys:{INSERT:45,DELETE:46,BACKSPACE:8,TAB:9,ENTER:13,ESC:27,LEFT:37,UP:38,RIGHT:39,DOWN:40,END:35,HOME:36,SPACEBAR:32,PAGEUP:33,PAGEDOWN:34,F2:113,F10:121,F12:123,NUMPAD_PLUS:107,NUMPAD_MINUS:109,NUMPAD_DOT:110},support:mt.support||Mt,animate:mt.animate||v,ns:"",attr:function(e){return"data-"+mt.ns+e},getShadows:i,wrap:s,deepExtend:a,getComputedStyles:f,size:m,toCamelCase:d,toHyphens:c,getOffset:mt.getOffset||p,parseEffects:mt.parseEffects||h,toggleClass:mt.toggleClass||w,directions:mt.directions||W,Observable:A,Class:n,Template:z,template:yt(z.compile,z),render:yt(z.render,z),stringify:yt(bt.stringify,bt),eventTarget:V,htmlEncode:b,isLocalUrl:function(e){return e&&!G.test(e)},expr:function(e,t,n){return e=e||"",typeof t==kt&&(n=t,t=!1),n=n||"d",e&&"["!==e.charAt(0)&&(e="."+e),e=t?q(e.split("."),n):n+e},getter:function(e,t){return Nt[e]=Nt[e]||Function("d","return "+mt.expr(e,t))},setter:function(e){return Pt[e]=Pt[e]||Function("d,value",mt.expr(e)+"=value")},accessor:function(e){return{get:mt.getter(e),set:mt.setter(e)}},guid:function(){var e,t,n="";for(e=0;32>e;e++)t=16*wt.random()|0,(8==e||12==e||16==e||20==e)&&(n+="-"),n+=(12==e?4:16==e?3&t|8:t).toString(16);return n},roleSelector:function(e){return e.replace(/(\S+)/g,"["+mt.attr("role")+"=$1],").slice(0,-1)},triggeredByInput:function(e){return/^(label|input|textarea|select)$/i.test(e.target.tagName)},logToConsole:function(e){var n=window.console;!mt.suppressLog&&t!==n&&n.log&&n.log(e)}}),Q=A.extend({init:function(e,t){var n=this;n.element=mt.jQuery(e).handler(n),A.fn.init.call(n),t=n.options=pt(!0,{},n.options,t),n.element.attr(mt.attr("role"))||n.element.attr(mt.attr("role"),(t.name||"").toLowerCase()),n.element.data("kendo"+t.prefix+t.name,n),n.bind(n.events,t)},events:[],options:{prefix:""},_hasBindingTarget:function(){return!!this.element[0].kendoBindingTarget},_tabindex:function(e){e=e||this.wrapper;var t=this.element,n="tabindex",r=e.attr(n)||t.attr(n);t.removeAttr(n),e.attr(n,isNaN(r)?0:r)},setOptions:function(t){this._setEvents(t),e.extend(this.options,t)},_setEvents:function(e){for(var t,n=this,r=0,o=n.events.length;o>r;r++)t=n.events[r],n.options[t]&&e[t]&&n.unbind(t,n.options[t]);n.bind(n.events,e)},resize:function(e){var t=this.getSize(),n=this._size;(e||!n||t.width!==n.width||t.height!==n.height)&&(this._resize(t),this.trigger("resize",t),this._size=t)},getSize:function(){return mt.dimensions(this.element)},size:function(e){return e?(this.setSize(e),t):this.getSize()},setSize:e.noop,_resize:e.noop,destroy:function(){var e=this;e.element.removeData("kendo"+e.options.prefix+e.options.name),e.element.removeData("handler"),e.unbind()}}),mt.dimensions=function(e,t){var n=e[0];return t&&e.css(t),{width:n.offsetWidth,height:n.offsetHeight}},mt.notify=vt,Z=/template$/i,K=/^\s*(?:\{(?:.|\r\n|\n)*\}|\[(?:.|\r\n|\n)*\])\s*$/,X=/^\{(\d+)(:[^\}]+)?\}|^\[[A-Za-z_]*\]$/,et=/([A-Z])/g,mt.initWidget=function(n,r,o){var i,s,a,u,l,c,d,f;if(o?o.roles&&(o=o.roles):o=mt.ui.roles,n=n.nodeType?n:n[0],c=n.getAttribute("data-"+mt.ns+"role"),c&&(a=-1===c.indexOf(".")?o[c]:mt.getter(c)(window))){for(f=M(n,"dataSource"),r=e.extend({},S(n,a.fn.options),r),f&&(r.dataSource=typeof f===kt?mt.getter(f)(window):f),u=0,l=a.fn.events.length;l>u;u++)s=a.fn.events[u],d=M(n,s),d!==t&&(r[s]=mt.getter(d)(window));return i=e(n).data("kendo"+a.fn.options.prefix+a.fn.options.name),i?i.setOptions(r):i=new a(n,r),i}},mt.rolesFromNamespaces=function(e){var t,n,r=[];for(e[0]||(e=[mt.ui,mt.dataviz.ui]),t=0,n=e.length;n>t;t++)r[t]=e[t].roles;return pt.apply(null,[{}].concat(r.reverse()))},mt.init=function(t){var n=mt.rolesFromNamespaces(Ft.call(arguments,1));e(t).find("[data-"+mt.ns+"role]").addBack().each(function(){mt.initWidget(this,{},n)})},mt.destroy=function(t){e(t).find("[data-"+mt.ns+"role]").addBack().each(function(){var t,n=e(this).data();
for(t in n)0===t.indexOf("kendo")&&typeof n[t].destroy===Ot&&n[t].destroy()})},mt.resize=function(t,n){var r,o=e(t).find("[data-"+mt.ns+"role]").addBack().filter(x);o.length&&(r=e.makeArray(o),r.sort(T),e.each(r,function(){var t=mt.widgetInstance(e(this));t&&t.resize(n)}))},mt.parseOptions=S,pt(mt.ui,{Widget:Q,roles:{},progress:function(t,n){var r,o,i,s,a=t.find(".k-loading-mask"),u=mt.support,l=u.browser;n?a.length||(r=u.isRtl(t),o=r?"right":"left",s=t.scrollLeft(),i=l.webkit?r?t[0].scrollWidth-t.width()-2*s:0:0,a=e("<div class='k-loading-mask'><span class='k-loading-text'>Loading...</span><div class='k-loading-image'/><div class='k-loading-color'/></div>").width("100%").height("100%").css("top",t.scrollTop()).css(o,Math.abs(s)+i).prependTo(t)):a&&a.remove()},plugin:function(n,r,o){var i,s=n.fn.options.name;r=r||mt.ui,o=o||"",r[s]=n,r.roles[s.toLowerCase()]=n,i="getKendo"+o+s,s="kendo"+o+s,e.fn[s]=function(r){var o,i=this;return typeof r===kt?(o=Ft.call(arguments,1),this.each(function(){var n,a,u=e.data(this,s);if(!u)throw Error(mt.format("Cannot call method '{0}' of {1} before it is initialized",r,s));if(n=u[r],typeof n!==Ot)throw Error(mt.format("Cannot find method '{0}' of {1}",r,s));return a=n.apply(u,o),a!==t?(i=a,!1):t})):this.each(function(){new n(this,r)}),i},e.fn[i]=function(){return this.data(s)}}}),tt={bind:function(){return this},nullObject:!0,options:{}},nt=Q.extend({init:function(e,t){Q.fn.init.call(this,e,t),this.element.autoApplyNS(),this.wrapper=this.element,this.element.addClass("km-widget")},destroy:function(){Q.fn.destroy.call(this),this.element.kendoDestroy()},options:{prefix:"Mobile"},events:[],view:function(){var e=this.element.closest(mt.roleSelector("view splitview modalview drawer"));return mt.widgetInstance(e,mt.mobile.ui)||tt},viewHasNativeScrolling:function(){var e=this.view();return e&&e.options.useNativeScrolling},container:function(){var e=this.element.closest(mt.roleSelector("view layout modalview drawer"));return mt.widgetInstance(e,mt.mobile.ui)||tt}}),pt(mt.mobile,{init:function(e){mt.init(e,mt.mobile.ui,mt.ui,mt.dataviz.ui)},appLevelNativeScrolling:function(){return mt.mobile.application&&mt.mobile.application.options&&mt.mobile.application.options.useNativeScrolling},ui:{Widget:nt,roles:{},plugin:function(e){mt.ui.plugin(e,mt.mobile.ui,"Mobile")}}}),mt.touchScroller=function(t,n){return e(t).map(function(t,r){return r=e(r),Mt.kineticScrollNeeded&&mt.mobile.ui.Scroller&&!r.data("kendoMobileScroller")?(r.kendoMobileScroller(n),r.data("kendoMobileScroller")):!1})[0]},mt.preventDefault=function(e){e.preventDefault()},mt.widgetInstance=function(e,t){var n,r,o,i,s=e.data(mt.ns+"role"),a=[];if(s){if("content"===s&&(s="scroller"),t)if(t[0])for(n=0,r=t.length;r>n;n++)a.push(t[n].roles[s]);else a.push(t.roles[s]);else a=[mt.ui.roles[s],mt.dataviz.ui.roles[s],mt.mobile.ui.roles[s]];for(s.indexOf(".")>=0&&(a=[mt.getter(s)(window)]),n=0,r=a.length;r>n;n++)if(o=a[n],o&&(i=e.data("kendo"+o.fn.options.prefix+o.fn.options.name)))return i}},mt.onResize=function(t){var n=t;return Mt.mobileOS.android&&(n=function(){setTimeout(t,600)}),e(window).on(Mt.resize,n),n},mt.unbindResize=function(t){e(window).off(Mt.resize,t)},mt.attrValue=function(e,t){return e.data(mt.ns+t)},mt.days={Sunday:0,Monday:1,Tuesday:2,Wednesday:3,Thursday:4,Friday:5,Saturday:6},e.extend(e.expr[":"],{kendoFocusable:function(t){var n=e.attr(t,"tabindex");return D(t,!isNaN(n)&&n>-1)}}),rt=["mousedown","mousemove","mouseenter","mouseleave","mouseover","mouseout","mouseup","click"],ot="label, input, [data-rel=external]",it={setupMouseMute:function(){var t,n=0,r=rt.length,o=document.documentElement;if(!it.mouseTrap&&Mt.eventCapture)for(it.mouseTrap=!0,it.bustClick=!1,it.captureMouse=!1,t=function(t){it.captureMouse&&("click"===t.type?it.bustClick&&!e(t.target).is(ot)&&(t.preventDefault(),t.stopPropagation()):t.stopPropagation())};r>n;n++)o.addEventListener(rt[n],t,!0)},muteMouse:function(e){it.captureMouse=!0,e.data.bustClick&&(it.bustClick=!0),clearTimeout(it.mouseTrapTimeoutID)},unMuteMouse:function(){clearTimeout(it.mouseTrapTimeoutID),it.mouseTrapTimeoutID=setTimeout(function(){it.captureMouse=!1,it.bustClick=!1},400)}},st={down:"touchstart mousedown",move:"mousemove touchmove",up:"mouseup touchend touchcancel",cancel:"mouseleave touchcancel"},Mt.touch&&(Mt.mobileOS.ios||Mt.mobileOS.android)?st={down:"touchstart",move:"touchmove",up:"touchend touchcancel",cancel:"touchcancel"}:Mt.pointers?st={down:"pointerdown",move:"pointermove",up:"pointerup",cancel:"pointercancel pointerleave"}:Mt.msPointers&&(st={down:"MSPointerDown",move:"MSPointerMove",up:"MSPointerUp",cancel:"MSPointerCancel MSPointerLeave"}),!Mt.msPointers||"onmspointerenter"in window||e.each({MSPointerEnter:"MSPointerOver",MSPointerLeave:"MSPointerOut"},function(t,n){e.event.special[t]={delegateType:n,bindType:n,handle:function(t){var r,o=this,i=t.relatedTarget,s=t.handleObj;return(!i||i!==o&&!e.contains(o,i))&&(t.type=s.origType,r=s.handler.apply(this,arguments),t.type=n),r}}}),at=function(e){return st[e]||e},ut=/([^ ]+)/g,mt.applyEventMap=function(e,t){return e=e.replace(ut,at),t&&(e=e.replace(ut,"$1."+t)),e},lt=e.fn.on,pt(!0,k,e),k.fn=k.prototype=new e,k.fn.constructor=k,k.fn.init=function(t,n){return n&&n instanceof e&&!(n instanceof k)&&(n=k(n)),e.fn.init.call(this,t,n,ct)},k.fn.init.prototype=k.fn,ct=k(document),pt(k.fn,{handler:function(e){return this.data("handler",e),this},autoApplyNS:function(e){return this.data("kendoNS",e||mt.guid()),this},on:function(){var e,t,n,r,o,i,s=this,a=s.data("kendoNS");return 1===arguments.length?lt.call(s,arguments[0]):(e=s,t=Ft.call(arguments),typeof t[t.length-1]===At&&t.pop(),n=t[t.length-1],r=mt.applyEventMap(t[0],a),Mt.mouseAndTouchPresent&&r.search(/mouse|click/)>-1&&this[0]!==document.documentElement&&(it.setupMouseMute(),o=2===t.length?null:t[1],i=r.indexOf("click")>-1&&r.indexOf("touchend")>-1,lt.call(this,{touchstart:it.muteMouse,touchend:it.unMuteMouse},o,{bustClick:i})),typeof n===kt&&(e=s.data("handler"),n=e[n],t[t.length-1]=function(t){n.call(e,t)}),t[0]=r,lt.apply(s,t),s)},kendoDestroy:function(e){return e=e||this.data("kendoNS"),e&&this.off("."+e),this}}),mt.jQuery=k,mt.eventMap=st,mt.timezone=function(){function e(e,t){var n,r,o,i=t[3],s=t[4],a=t[5],u=t[8];return u||(t[8]=u={}),u[e]?u[e]:(isNaN(s)?0===s.indexOf("last")?(n=new Date(Date.UTC(e,c[i]+1,1,a[0]-24,a[1],a[2],0)),r=d[s.substr(4,3)],o=n.getUTCDay(),n.setUTCDate(n.getUTCDate()+r-o-(r>o?7:0))):s.indexOf(">=")>=0&&(n=new Date(Date.UTC(e,c[i],s.substr(5),a[0],a[1],a[2],0)),r=d[s.substr(0,3)],o=n.getUTCDay(),n.setUTCDate(n.getUTCDate()+r-o+(o>r?7:0))):n=new Date(Date.UTC(e,c[i],s,a[0],a[1],a[2],0)),u[e]=n)}function t(t,n,r){var o,i,s,a;return(n=n[r])?(s=new Date(t).getUTCFullYear(),n=jQuery.grep(n,function(e){var t=e[0],n=e[1];return s>=t&&(n>=s||t==s&&"only"==n||"max"==n)}),n.push(t),n.sort(function(t,n){return"number"!=typeof t&&(t=+e(s,t)),"number"!=typeof n&&(n=+e(s,n)),t-n}),a=n[jQuery.inArray(t,n)-1]||n[n.length-1],isNaN(a)?a:null):(o=r.split(":"),i=0,o.length>1&&(i=60*o[0]+ +o[1]),[-1e6,"max","-","Jan",1,[0,0,0],i,"-"])}function n(e,t,n){var r,o,i,s=t[n];if("string"==typeof s&&(s=t[s]),!s)throw Error('Timezone "'+n+'" is either incorrect, or kendo.timezones.min.js is not included.');for(r=s.length-1;r>=0&&(o=s[r][3],!(o&&e>o));r--);if(i=s[r+1],!i)throw Error('Timezone "'+n+'" not found on '+e+".");return i}function r(e,r,o,i){typeof e!=zt&&(e=Date.UTC(e.getFullYear(),e.getMonth(),e.getDate(),e.getHours(),e.getMinutes(),e.getSeconds(),e.getMilliseconds()));var s=n(e,r,i);return{zone:s,rule:t(e,o,s[1])}}function o(e,t){var n,o,i;return"Etc/UTC"==t||"Etc/GMT"==t?0:(n=r(e,this.zones,this.rules,t),o=n.zone,i=n.rule,i?o[0]-i[6]:o[0])}function i(e,t){var n=r(e,this.zones,this.rules,t),o=n.zone,i=n.rule,s=o[2];return s.indexOf("/")>=0?s.split("/")[i&&+i[6]?1:0]:s.indexOf("%s")>=0?s.replace("%s",i&&"-"!=i[7]?i[7]:""):s}function s(e,t,n){var r,o;return typeof t==kt&&(t=this.offset(e,t)),typeof n==kt&&(n=this.offset(e,n)),r=e.getTimezoneOffset(),e=new Date(e.getTime()+6e4*(t-n)),o=e.getTimezoneOffset(),new Date(e.getTime()+6e4*(o-r))}function a(e,t){return this.convert(e,e.getTimezoneOffset(),t)}function u(e,t){return this.convert(e,t,e.getTimezoneOffset())}function l(e){return this.apply(new Date(e),"Etc/UTC")}var c={Jan:0,Feb:1,Mar:2,Apr:3,May:4,Jun:5,Jul:6,Aug:7,Sep:8,Oct:9,Nov:10,Dec:11},d={Sun:0,Mon:1,Tue:2,Wed:3,Thu:4,Fri:5,Sat:6};return{zones:{},rules:{},offset:o,convert:s,apply:a,remove:u,abbr:i,toLocalDate:l}}(),mt.date=function(){function e(e,t){return 0===t&&23===e.getHours()?(e.setHours(e.getHours()+2),!0):!1}function t(t,n,r){var o=t.getHours();r=r||1,n=(n-t.getDay()+7*r)%7,t.setDate(t.getDate()+n),e(t,o)}function n(e,n,r){return e=new Date(e),t(e,n,r),e}function r(e){return new Date(e.getFullYear(),e.getMonth(),1)}function o(e){var t=new Date(e.getFullYear(),e.getMonth()+1,0),n=r(e),o=Math.abs(t.getTimezoneOffset()-n.getTimezoneOffset());return o&&t.setHours(n.getHours()+o/60),t}function i(t){return t=new Date(t.getFullYear(),t.getMonth(),t.getDate(),0,0,0),e(t,0),t}function s(e){return Date.UTC(e.getFullYear(),e.getMonth(),e.getDate(),e.getHours(),e.getMinutes(),e.getSeconds(),e.getMilliseconds())}function a(e){return e.getTime()-i(e)}function u(e,t,n){var r,o=a(t),i=a(n);return e&&o!=i?(t>=n&&(n+=g),r=a(e),o>r&&(r+=g),o>i&&(i+=g),r>=o&&i>=r):!0}function l(e,t,n){var r,o=t.getTime(),i=n.getTime();return o>=i&&(i+=g),r=e.getTime(),r>=o&&i>=r}function c(t,n){var r=t.getHours();return t=new Date(t),d(t,n*g),e(t,r),t}function d(e,t,n){var r,o=e.getTimezoneOffset();e.setTime(e.getTime()+t),n||(r=e.getTimezoneOffset()-o,e.setTime(e.getTime()+r*h))}function f(){return i(new Date)}function m(e){return i(e).getTime()==f().getTime()}function p(e){var t=new Date(1980,1,1,0,0,0);return e&&t.setHours(e.getHours(),e.getMinutes(),e.getSeconds(),e.getMilliseconds()),t}var h=6e4,g=864e5;return{adjustDST:e,dayOfWeek:n,setDayOfWeek:t,getDate:i,isInDateRange:l,isInTimeRange:u,isToday:m,nextDay:function(e){return c(e,1)},previousDay:function(e){return c(e,-1)},toUtcTime:s,MS_PER_DAY:g,MS_PER_HOUR:60*h,MS_PER_MINUTE:h,setTime:d,addDays:c,today:f,toInvariantTime:p,firstDayOfMonth:r,lastDayOfMonth:o,getMilliseconds:a}}(),mt.stripWhitespace=function(e){var t,n,r;if(document.createNodeIterator)for(t=document.createNodeIterator(e,NodeFilter.SHOW_TEXT,function(t){return t.parentNode==e?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_REJECT},!1);t.nextNode();)t.referenceNode&&!t.referenceNode.textContent.trim()&&t.referenceNode.parentNode.removeChild(t.referenceNode);else for(n=0;e.childNodes.length>n;n++)r=e.childNodes[n],3!=r.nodeType||/\S/.test(r.nodeValue)||(e.removeChild(r),n--),1==r.nodeType&&mt.stripWhitespace(r)},dt=window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.oRequestAnimationFrame||window.msRequestAnimationFrame||function(e){setTimeout(e,1e3/60)},mt.animationFrame=function(e){dt.call(window,e)},ft=[],mt.queueAnimation=function(e){ft[ft.length]=e,1===ft.length&&mt.runNextAnimation()},mt.runNextAnimation=function(){mt.animationFrame(function(){ft[0]&&(ft.shift()(),ft[0]&&mt.runNextAnimation())})},mt.parseQueryStringParams=function(e){for(var t=e.split("?")[1]||"",n={},r=t.split(/&|=/),o=r.length,i=0;o>i;i+=2)""!==r[i]&&(n[decodeURIComponent(r[i])]=decodeURIComponent(r[i+1]));return n},mt.elementUnderCursor=function(e){return document.elementFromPoint(e.x.client,e.y.client)},mt.wheelDeltaY=function(e){var n,r=e.originalEvent,o=r.wheelDeltaY;return r.wheelDelta?(o===t||o)&&(n=r.wheelDelta):r.detail&&r.axis===r.VERTICAL_AXIS&&(n=10*-r.detail),n},mt.throttle=function(e,n){var r,o=0;return!n||0>=n?e:function(){function i(){o=+new Date,e.apply(s,u)}var s=this,a=+new Date-o,u=arguments;return o?(r&&clearTimeout(r),a>n?i():r=setTimeout(i,n-a),t):i()}},mt.caret=function(n,r,o){var i,s,a,u,l=r!==t;if(o===t&&(o=r),n[0]&&(n=n[0]),!l||!n.disabled){try{n.selectionStart!==t?l?(n.focus(),n.setSelectionRange(r,o)):r=[n.selectionStart,n.selectionEnd]:document.selection&&(e(n).is(":visible")&&n.focus(),i=n.createTextRange(),l?(i.collapse(!0),i.moveStart("character",r),i.moveEnd("character",o-r),i.select()):(s=i.duplicate(),i.moveToBookmark(document.selection.createRange().getBookmark()),s.setEndPoint("EndToStart",i),a=s.text.length,u=a+i.text.length,r=[a,u]))}catch(c){r=[]}return r}}})(jQuery);(function(){return function(e,t){function n(e,t){if(!t)return e;e+"/"===t&&(e=t);var n=RegExp("^"+t,"i");return n.test(e)||(e=t+"/"+e),h.protocol+"//"+(h.host+"/"+e).replace(/\/\/+/g,"/")}function r(e){return e?"#!":"#"}function i(e){var t=h.href;return"#!"===e&&t.indexOf("#")>-1&&t.indexOf("#!")<0?null:t.split(e)[1]||""}function o(e,t){return 0===t.indexOf(e)?t.substr(e.length).replace(/\/\//g,"/"):t}function a(e){return e.replace(/^(#)?/,"#")}function s(e){return e.replace(/^(#(!)?)?/,"#!")}var u=window.kendo,l="change",c="back",d="same",f=u.support,h=window.location,p=window.history,m=50,g=u.support.browser.msie,y=/^#*/,v=window.document,w=u.Class.extend({back:function(){g?setTimeout(function(){p.back()}):p.back()},forward:function(){g?setTimeout(function(){p.forward()}):p.forward()},length:function(){return p.length},replaceLocation:function(e){h.replace(e)}}),b=w.extend({init:function(e){this.root=e},navigate:function(e){p.pushState({},v.title,n(e,this.root))},replace:function(e){p.replaceState({},v.title,n(e,this.root))},normalize:function(e){return o(this.root,e)},current:function(){var e=h.pathname;return h.search&&(e+=h.search),o(this.root,e)},change:function(t){e(window).bind("popstate.kendo",t)},stop:function(){e(window).unbind("popstate.kendo")},normalizeCurrent:function(e){var t,o=e.root,a=h.pathname,s=i(r(e.hashBang));o===a+"/"&&(t=o),o===a&&s&&(t=n(s.replace(y,""),o)),t&&p.pushState({},v.title,t)}}),M=w.extend({init:function(e){this._id=u.guid(),this.prefix=r(e),this.fix=e?s:a},navigate:function(e){h.hash=this.fix(e)},replace:function(e){this.replaceLocation(this.fix(e))},normalize:function(e){return e.indexOf(this.prefix)<0?e:e.split(this.prefix)[1]},change:function(t){f.hashChange?e(window).on("hashchange."+this._id,t):this._interval=setInterval(t,m)},stop:function(){e(window).off("hashchange."+this._id),clearInterval(this._interval)},current:function(){return i(this.prefix)},normalizeCurrent:function(e){var t=h.pathname,n=e.root;return e.pushState&&n!==t?(this.replaceLocation(n+this.prefix+o(n,t)),!0):!1}}),S=u.Observable.extend({start:function(t){if(t=t||{},this.bind([l,c,d],t),!this._started){this._started=!0,t.root=t.root||"/";var n,r=this.createAdapter(t);r.normalizeCurrent(t)||(n=r.current(),e.extend(this,{adapter:r,root:t.root,historyLength:r.length(),current:n,locations:[n]}),r.change(e.proxy(this,"_checkUrl")))}},createAdapter:function(e){return f.pushState&&e.pushState?new b(e.root):new M(e.hashBang)},stop:function(){this._started&&(this.adapter.stop(),this.unbind(l),this._started=!1)},change:function(e){this.bind(l,e)},replace:function(e,t){this._navigate(e,t,function(t){t.replace(e),this.locations[this.locations-1]=this.current})},navigate:function(e,n){return"#:back"===e?(this.adapter.back(),t):(this._navigate(e,n,function(t){t.navigate(e),this.locations.push(this.current)}),t)},_navigate:function(e,n,r){var i=this.adapter;return e=i.normalize(e),this.current===e||this.current===decodeURIComponent(e)?(this.trigger(d),t):((n||!this.trigger(l,{url:e}))&&(this.current=e,r.call(this,i),this.historyLength=i.length()),t)},_checkUrl:function(){var e=this.adapter,n=e.current(),r=e.length(),i=this.historyLength===r,o=n===this.locations[this.locations.length-2]&&i,a=this.current;return null===n||this.current===n||this.current===decodeURIComponent(n)?!0:(this.historyLength=r,this.current=n,o&&this.trigger("back",{url:a,to:n})?(e.forward(),this.current=a,t):this.trigger(l,{url:n})?(o?e.forward():(e.back(),this.historyLength--),this.current=a,t):(o?this.locations.pop():this.locations.push(n),t))}});u.History=S,u.History.HistoryAdapter=w,u.History.HashAdapter=M,u.History.PushStateAdapter=b,u.absoluteURL=n,u.history=new S}(window.kendo.jQuery),function(){function e(e,t){return t?e:"([^/]+)"}function t(t){return RegExp("^"+t.replace(p,"\\$&").replace(d,"(?:$1)?").replace(f,e).replace(h,"(.*?)")+"$")}function n(e){return e.replace(/(\?.*)|(#.*)/g,"")}var r=window.kendo,i=r.history,o=r.Observable,a="init",s="routeMissing",u="change",l="back",c="same",d=/\((.*?)\)/g,f=/(\(\?)?:\w+/g,h=/\*\w+/g,p=/[\-{}\[\]+?.,\\\^$|#\s]/g,m=r.Class.extend({init:function(e,n){e instanceof RegExp||(e=t(e)),this.route=e,this._callback=n},callback:function(e){var t,i,o=0,a=r.parseQueryStringParams(e);for(e=n(e),t=this.route.exec(e).slice(1),i=t.length;i>o;o++)void 0!==t[o]&&(t[o]=decodeURIComponent(t[o]));t.push(a),this._callback.apply(null,t)},worksWith:function(e){return this.route.test(n(e))?(this.callback(e),!0):!1}}),g=o.extend({init:function(e){e||(e={}),o.fn.init.call(this),this.routes=[],this.pushState=e.pushState,this.hashBang=e.hashBang,this.root=e.root,this.bind([a,s,u,c],e)},destroy:function(){i.unbind(u,this._urlChangedProxy),i.unbind(c,this._sameProxy),i.unbind(l,this._backProxy),this.unbind()},start:function(){var e,t=this,n=function(){t._same()},r=function(e){t._back(e)},o=function(e){t._urlChanged(e)};i.start({same:n,change:o,back:r,pushState:t.pushState,hashBang:t.hashBang,root:t.root}),e={url:i.current||"/",preventDefault:$.noop},t.trigger(a,e)||t._urlChanged(e),this._urlChangedProxy=o,this._backProxy=r},route:function(e,t){this.routes.push(new m(e,t))},navigate:function(e,t){r.history.navigate(e,t)},replace:function(e,t){r.history.replace(e,t)},_back:function(e){this.trigger(l,{url:e.url,to:e.to})&&e.preventDefault()},_same:function(){this.trigger(c)},_urlChanged:function(e){var t,n,i,o,a=e.url;if(a||(a="/"),this.trigger(u,{url:e.url,params:r.parseQueryStringParams(e.url)}))return e.preventDefault(),void 0;for(t=0,n=this.routes,o=n.length;o>t;t++)if(i=n[t],i.worksWith(a))return;this.trigger(s,{url:a,params:r.parseQueryStringParams(a)})&&e.preventDefault()}});r.Router=g}(),window.kendo})();(function(e,t){function n(i){var a,s,u,l,c,d,f,p,h=[],m=i.logic||"and",g=i.filters;for(a=0,s=g.length;s>a;a++)i=g[a],u=i.field,f=i.value,d=i.operator,i.filters?i=n(i):(p=i.ignoreCase,u=u.replace(/\./g,"/"),i=o[d],i&&f!==t&&(l=e.type(f),"string"===l?(c="'{1}'",f=f.replace(/'/g,"''"),p===!0&&(u="tolower("+u+")")):c="date"===l?"datetime'{1:yyyy-MM-ddTHH:mm:ss}'":"{1}",i.length>3?"substringof"!==i?c="{0}({2},"+c+")":(c="{0}("+c+",{2})","doesnotcontain"===d&&(c+=" eq false")):c="{2} {0} "+c,i=r.format(c,i,f,u))),h.push(i);return i=h.join(" "+m+" "),h.length>1&&(i="("+i+")"),i}var r=window.kendo,i=e.extend,o={eq:"eq",neq:"ne",gt:"gt",gte:"ge",lt:"lt",lte:"le",contains:"substringof",doesnotcontain:"substringof",endswith:"endswith",startswith:"startswith"},a={pageSize:e.noop,page:e.noop,filter:function(e,t){t&&(e.$filter=n(t))},sort:function(t,n){var r=e.map(n,function(e){var t=e.field.replace(/\./g,"/");return"desc"===e.dir&&(t+=" desc"),t}).join(",");r&&(t.$orderby=r)},skip:function(e,t){t&&(e.$skip=t)},take:function(e,t){t&&(e.$top=t)}},s={read:{dataType:"jsonp"}};i(!0,r.data,{schemas:{odata:{type:"json",data:function(e){return e.d.results||[e.d]},total:"d.__count"}},transports:{odata:{read:{cache:!0,dataType:"jsonp",jsonp:"$callback"},update:{cache:!0,dataType:"json",contentType:"application/json",type:"PUT"},create:{cache:!0,dataType:"json",contentType:"application/json",type:"POST"},destroy:{cache:!0,dataType:"json",type:"DELETE"},parameterMap:function(e,t){var n,i,o,u;if(e=e||{},t=t||"read",u=(this.options||s)[t],u=u?u.dataType:"json","read"===t){n={$inlinecount:"allpages"},"json"!=u&&(n.$format="json");for(o in e)a[o]?a[o](n,e[o]):n[o]=e[o]}else{if("json"!==u)throw Error("Only json dataType can be used for "+t+" operation.");if("destroy"!==t){for(o in e)i=e[o],"number"==typeof i&&(e[o]=i+"");n=r.stringify(e)}}return n}}}})})(window.kendo.jQuery);(function(e,t){var n=window.kendo,r=e.isArray,i=e.isPlainObject,o=e.map,a=e.each,s=e.extend,u=n.getter,l=n.Class,c=l.extend({init:function(e){var t,u,l,c,d=this,f=e.total,p=e.model,h=e.parse,m=e.errors,g=e.serialize,y=e.data;p&&(i(p)&&(t=e.modelBase||n.data.Model,p.fields&&a(p.fields,function(e,t){t=i(t)&&t.field?s(t,{field:d.getter(t.field)}):{field:d.getter(t)},p.fields[e]=t}),u=p.id,u&&(l={},l[d.xpathToMember(u,!0)]={field:d.getter(u)},p.fields=s(l,p.fields),p.id=d.xpathToMember(u)),p=t.define(p)),d.model=p),f&&("string"==typeof f?(f=d.getter(f),d.total=function(e){return parseInt(f(e),10)}):"function"==typeof f&&(d.total=f)),m&&("string"==typeof m?(m=d.getter(m),d.errors=function(e){return m(e)||null}):"function"==typeof m&&(d.errors=m)),y&&("string"==typeof y?(y=d.xpathToMember(y),d.data=function(e){var t,n=d.evaluate(e,y);return n=r(n)?n:[n],d.model&&p.fields?(t=new d.model,o(n,function(e){if(e){var n,r={};for(n in p.fields)r[n]=t._parse(n,p.fields[n].field(e));return r}})):n}):"function"==typeof y&&(d.data=y)),"function"==typeof h&&(c=d.parse,d.parse=function(e){var t=h.call(d,e);return c.call(d,t)}),"function"==typeof g&&(d.serialize=g)},total:function(e){return this.data(e).length},errors:function(e){return e?e.errors:null},serialize:function(e){return e},parseDOM:function(e){var n,i,o,a,s,u,l,c={},d=e.attributes,f=d.length;for(l=0;f>l;l++)u=d[l],c["@"+u.nodeName]=u.nodeValue;for(i=e.firstChild;i;i=i.nextSibling)o=i.nodeType,3===o||4===o?c["#text"]=i.nodeValue:1===o&&(n=this.parseDOM(i),a=i.nodeName,s=c[a],r(s)?s.push(n):s=s!==t?[s,n]:n,c[a]=s);return c},evaluate:function(e,t){for(var n,i,o,a,s,u=t.split(".");n=u.shift();)if(e=e[n],r(e)){for(i=[],t=u.join("."),s=0,o=e.length;o>s;s++)a=this.evaluate(e[s],t),a=r(a)?a:[a],i.push.apply(i,a);return i}return e},parse:function(t){var n,r,i={};return n=t.documentElement||e.parseXML(t).documentElement,r=this.parseDOM(n),i[n.nodeName]=r,i},xpathToMember:function(e,t){return e?(e=e.replace(/^\//,"").replace(/\//g,"."),e.indexOf("@")>=0?e.replace(/\.?(@.*)/,t?"$1":'["$1"]'):e.indexOf("text()")>=0?e.replace(/(\.?text\(\))/,t?"#text":'["#text"]'):e):""},getter:function(e){return u(this.xpathToMember(e),!0)}});e.extend(!0,n.data,{XmlDataReader:c,readers:{xml:c}})})(window.kendo.jQuery);(function(e,t){function n(e,t,n,r){return function(i){var o,a={};for(o in i)a[o]=i[o];a.field=r?n+"."+i.field:n,t==yt&&e._notifyChange&&e._notifyChange(a),e.trigger(t,a)}}function r(t,n){if(t===n)return!0;var i,o=e.type(t),a=e.type(n);if(o!==a)return!1;if("date"===o)return t.getTime()===n.getTime();if("object"!==o&&"array"!==o)return!1;for(i in t)if(!r(t[i],n[i]))return!1;return!0}function i(e,t){var n,r;for(r in e){if(n=e[r],tt(n)&&n.field&&n.field===t)return n;if(n===t)return n}return null}function o(e){this.data=e||[]}function a(e,n){if(e){var r=typeof e===ft?{field:e,dir:n}:e,i=rt(r)?r:r!==t?[r]:[];return it(i,function(e){return!!e.dir})}}function s(e){var t,n,r,i,o=e.filters;if(o)for(t=0,n=o.length;n>t;t++)r=o[t],i=r.operator,i&&typeof i===ft&&(r.operator=L[i.toLowerCase()]||i),s(r)}function u(e){return e&&!nt(e)?((rt(e)||!e.filters)&&(e={logic:"and",filters:rt(e)?e:[e]}),s(e),e):t}function l(e){return rt(e)?e:[e]}function c(e,n){var r=typeof e===ft?{field:e,dir:n}:e,i=rt(r)?r:r!==t?[r]:[];return R(i,function(e){return{field:e.field,dir:e.dir||"asc",aggregates:e.aggregates}})}function d(e,t){return e&&e.getTime&&t&&t.getTime?e.getTime()===t.getTime():e===t}function f(e,t,n,r,i,o){var a,s,u,l,c;for(t=t||[],l=t.length,a=0;l>a;a++)s=t[a],u=s.aggregate,c=s.field,e[c]=e[c]||{},o[c]=o[c]||{},o[c][u]=o[c][u]||{},e[c][u]=U[u.toLowerCase()](e[c][u],n,ut.accessor(c),r,i,o[c][u])}function h(e){return"number"==typeof e&&!isNaN(e)}function p(e){return e&&e.getTime}function g(e){var t,n=e.length,r=Array(n);for(t=0;n>t;t++)r[t]=e[t].toJSON();return r}function m(e,t){t=t||{};var n=new o(e),r=t.aggregate,i=t.filter;return i&&(n=n.filter(i)),n.aggregate(r)}function v(e,t,n,r,i){var o,a,s,u,l;for(u=0,l=e.length;l>u;u++){o=e[u];for(a in t)s=i[a],s&&s!==a&&(o[s]=t[a](o),delete o[a])}}function y(e,t,n,r,i){var o,a,s,u,l;for(u=0,l=e.length;l>u;u++){o=e[u];for(a in t)o[a]=n._parse(a,t[a](o)),s=i[a],s&&s!==a&&delete o[s]}}function _(e,t,n,r,i){var o,a,s,u;for(a=0,u=e.length;u>a;a++)o=e[a],s=r[o.field],s&&s!=o.field&&(o.field=s),o.value=n._parse(o.field,o.value),o.hasSubgroups?_(o.items,t,n,r,i):y(o.items,t,n,r,i)}function w(e,t,n,r,i,o){return function(a){return a=e(a),a&&!nt(r)&&("[object Array]"===Rt.call(a)||a instanceof Ut||(a=[a]),n(a,r,new t,i,o)),a||[]}}function b(e,t,n,r){for(var i,o,a,s=0;t.length&&r&&(i=t[s],o=i.items,a=o.length,e&&e.field===i.field&&e.value===i.value?(e.hasSubgroups&&e.items.length?b(e.items[e.items.length-1],i.items,n,r):(o=o.slice(n,n+r),e.items=e.items.concat(o)),t.splice(s--,1)):i.hasSubgroups&&o.length?b(i,o,n,r):(o=o.slice(n,n+r),i.items=o,i.items.length||t.splice(s--,1)),0===o.length?n-=a:(n=0,r-=o.length),!(++s>=t.length)););t.length>s&&t.splice(s,t.length-s)}function S(e){var t,n,r=[];for(t=0,n=e.length;n>t;t++)r=e[t].hasSubgroups?r.concat(S(e[t].items)):r.concat(e[t].items.slice());return r}function M(e,t){var n,r,i,o;if(t)for(n=0,r=e.length;r>n;n++)i=e[n],o=i.items,i.hasSubgroups?M(o,t):!o.length||o[0]instanceof t||(o.type=t,o.wrapAll(o,o))}function x(e,t){var n,r;for(n=0,r=e.length;r>n;n++)if(e[n].hasSubgroups){if(x(e[n].items,t))return!0}else if(t(e[n].items,e[n]))return!0}function k(e,t){var n,r;for(n=0,r=e.length;r>n;n++)if(e[n].uid==t.uid)return t=e[n],e.splice(n,1),t}function T(e,t){var n,r,i,o;for(i=e.length-1,o=0;i>=o;i--)r=e[i],n={value:t.get(r.field),field:r.field,items:n?[n]:[t],hasSubgroups:!!n,aggregates:{}};return n}function C(e,t){return t?z(e,function(e){return e[t.idField]===t.id}):-1}function O(e,t){return t?z(e,function(e){return e.uid==t.uid}):-1}function z(e,t){var n,r;for(n=0,r=e.length;r>n;n++)if(t(e[n]))return n;return-1}function D(e,t){var n,r;return e&&!nt(e)?(n=e[t],r=tt(n)?n.from||n.field||t:e[t]||t,lt(r)?t:r):t}function P(e,t){var n,r,i,o={};for(i in e)"filters"!==i&&(o[i]=e[i]);if(e.filters)for(o.filters=[],n=0,r=e.filters.length;r>n;n++)o.filters[n]=P(e.filters[n],t);else o.field=D(t.fields,o.field);return o}function A(e,t){var n,r,i,o,a,s=[];for(n=0,r=e.length;r>n;n++){i={},o=e[n];for(a in o)i[a]=o[a];i.field=D(t.fields,i.field),i.aggregates&&rt(i.aggregates)&&(i.aggregates=A(i.aggregates,t)),s.push(i)}return s}function F(t,n){var r,i,o,a,s,u=e(t)[0].children,l=[],c=n[0],d=n[1];for(r=0,i=u.length;i>r;r++)o={},s=u[r],s.disabled||(o[c.field]=s.text,a=s.attributes.value,a=a&&a.specified?s.value:s.text,o[d.field]=a,l.push(o));return l}function N(t,n){var r,i,o,a,s,u,l,c=e(t)[0].tBodies[0],d=c?c.rows:[],f=n.length,h=[];for(r=0,i=d.length;i>r;r++){for(s={},l=!0,a=d[r].cells,o=0;f>o;o++)u=a[o],"th"!==u.nodeName.toLowerCase()&&(l=!1,s[n[o].field]=u.innerHTML);l||h.push(s)}return h}function E(e){return function(){var t=this._data,n=J.fn[e].apply(this,Et.call(arguments));return this._data!=t&&this._attachBubbleHandlers(),n}}function H(t,n){function r(e,t){return e.filter(t).add(e.find(t))}var i,o,a,s,u,l,c,d,f=e(t).children(),h=[],p=n[0].field,g=n[1]&&n[1].field,m=n[2]&&n[2].field,v=n[3]&&n[3].field;for(i=0,o=f.length;o>i;i++)a={_loaded:!0},s=f.eq(i),l=s[0].firstChild,d=s.children(),t=d.filter("ul"),d=d.filter(":not(ul)"),u=s.attr("data-id"),u&&(a.id=u),l&&(a[p]=3==l.nodeType?l.nodeValue:d.text()),g&&(a[g]=r(d,"a").attr("href")),v&&(a[v]=r(d,"img").attr("src")),m&&(c=r(d,".k-sprite").prop("className"),a[m]=c&&e.trim(c.replace("k-sprite",""))),t.length&&(a.items=H(t.eq(0),n)),"true"==s.attr("data-hasChildren")&&(a.hasChildren=!0),h.push(a);return h}var R,q,I,j,L,U,B,W,$,G,J,V,Y,Q,Z,X,K=e.extend,et=e.proxy,tt=e.isPlainObject,nt=e.isEmptyObject,rt=e.isArray,it=e.grep,ot=e.ajax,at=e.each,st=e.noop,ut=window.kendo,lt=ut.isFunction,ct=ut.Observable,dt=ut.Class,ft="string",ht="function",pt="create",gt="read",mt="update",vt="destroy",yt="change",_t="sync",wt="get",bt="error",St="requestStart",Mt="progress",xt="requestEnd",kt=[pt,gt,mt,vt],Tt=function(e){return e},Ct=ut.getter,Ot=ut.stringify,zt=Math,Dt=[].push,Pt=[].join,At=[].pop,Ft=[].splice,Nt=[].shift,Et=[].slice,Ht=[].unshift,Rt={}.toString,qt=ut.support.stableSort,It=/^\/Date\((.*?)\)\/$/,jt=/(\r+|\n+)/g,Lt=/(?=['\\])/g,Ut=ct.extend({init:function(e,t){var n=this;n.type=t||Bt,ct.fn.init.call(n),n.length=e.length,n.wrapAll(e,n)},toJSON:function(){var e,t,n=this.length,r=Array(n);for(e=0;n>e;e++)t=this[e],t instanceof Bt&&(t=t.toJSON()),r[e]=t;return r},parent:st,wrapAll:function(e,t){var n,r,i=this,o=function(){return i};for(t=t||[],n=0,r=e.length;r>n;n++)t[n]=i.wrap(e[n],o);return t},wrap:function(e,t){var n,r=this;return null!==e&&"[object Object]"===Rt.call(e)&&(n=e instanceof r.type||e instanceof Gt,n||(e=e instanceof Bt?e.toJSON():e,e=new r.type(e)),e.parent=t,e.bind(yt,function(e){r.trigger(yt,{field:e.field,node:e.node,index:e.index,items:e.items||[this],action:e.node?e.action||"itemchange":"itemchange"})})),e},push:function(){var e,t=this.length,n=this.wrapAll(arguments);return e=Dt.apply(this,n),this.trigger(yt,{action:"add",index:t,items:n}),e},slice:Et,join:Pt,pop:function(){var e=this.length,t=At.apply(this);return e&&this.trigger(yt,{action:"remove",index:e-1,items:[t]}),t},splice:function(e,t,n){var r,i,o,a=this.wrapAll(Et.call(arguments,2));if(r=Ft.apply(this,[e,t].concat(a)),r.length)for(this.trigger(yt,{action:"remove",index:e,items:r}),i=0,o=r.length;o>i;i++)r[i].children&&r[i].unbind(yt);return n&&this.trigger(yt,{action:"add",index:e,items:a}),r},shift:function(){var e=this.length,t=Nt.apply(this);return e&&this.trigger(yt,{action:"remove",index:0,items:[t]}),t},unshift:function(){var e,t=this.wrapAll(arguments);return e=Ht.apply(this,t),this.trigger(yt,{action:"add",index:0,items:t}),e},indexOf:function(e){var t,n,r=this;for(t=0,n=r.length;n>t;t++)if(r[t]===e)return t;return-1},forEach:function(e){for(var t=0,n=this.length;n>t;t++)e(this[t],t,this)},map:function(e){for(var t=0,n=[],r=this.length;r>t;t++)n[t]=e(this[t],t,this);return n},filter:function(e){for(var t,n=0,r=[],i=this.length;i>n;n++)t=this[n],e(t,n,this)&&(r[r.length]=t);return r},find:function(e){for(var t,n=0,r=this.length;r>n;n++)if(t=this[n],e(t,n,this))return t},every:function(e){for(var t,n=0,r=this.length;r>n;n++)if(t=this[n],!e(t,n,this))return!1;return!0},some:function(e){for(var t,n=0,r=this.length;r>n;n++)if(t=this[n],e(t,n,this))return!0;return!1},remove:function(e){this.splice(this.indexOf(e),1)},empty:function(){this.splice(0,this.length)}}),Bt=ct.extend({init:function(e){var t,n,r=this,i=function(){return r};ct.fn.init.call(this);for(n in e)t=e[n],"_"!=n.charAt(0)&&(t=r.wrap(t,n,i)),r[n]=t;r.uid=ut.guid()},shouldSerialize:function(e){return this.hasOwnProperty(e)&&"_events"!==e&&typeof this[e]!==ht&&"uid"!==e},forEach:function(e){for(var t in this)this.shouldSerialize(t)&&e(this[t],t)},toJSON:function(){var e,t,n={};for(t in this)this.shouldSerialize(t)&&(e=this[t],(e instanceof Bt||e instanceof Ut)&&(e=e.toJSON()),n[t]=e);return n},get:function(e){var t,n=this;return n.trigger(wt,{field:e}),t="this"===e?n:ut.getter(e,!0)(n)},_set:function(e,t){var n,r,i,o=this,a=e.indexOf(".")>=0;if(a)for(n=e.split("."),r="";n.length>1;){if(r+=n.shift(),i=ut.getter(r,!0)(o),i instanceof Bt)return i.set(n.join("."),t),a;r+="."}return ut.setter(e)(o,t),a},set:function(e,t){var n=this,r=e.indexOf(".")>=0,i=ut.getter(e,!0)(n);i!==t&&(n.trigger("set",{field:e,value:t})||(r||(t=n.wrap(t,e,function(){return n})),(!n._set(e,t)||e.indexOf("(")>=0||e.indexOf("[")>=0)&&n.trigger(yt,{field:e})))},parent:st,wrap:function(e,t,r){var i,o,a=this,s=Rt.call(e);return null==e||"[object Object]"!==s&&"[object Array]"!==s||(i=e instanceof Ut,o=e instanceof J,"[object Object]"!==s||o||i?("[object Array]"===s||i||o)&&(i||o||(e=new Ut(e)),e.parent()!=r()&&e.bind(yt,n(a,yt,t,!1))):(e instanceof Bt||(e=new Bt(e)),e.parent()!=r()&&(e.bind(wt,n(a,wt,t,!0)),e.bind(yt,n(a,yt,t,!0)))),e.parent=r),e}}),Wt={number:function(e){return ut.parseFloat(e)
},date:function(e){return ut.parseDate(e)},"boolean":function(e){return typeof e===ft?"true"===e.toLowerCase():null!=e?!!e:e},string:function(e){return null!=e?e+"":e},"default":function(e){return e}},$t={string:"",number:0,date:new Date,"boolean":!1,"default":""},Gt=Bt.extend({init:function(n){var r=this;(!n||e.isEmptyObject(n))&&(n=e.extend({},r.defaults,n)),Bt.fn.init.call(r,n),r.dirty=!1,r.idField&&(r.id=r.get(r.idField),r.id===t&&(r.id=r._defaultId))},shouldSerialize:function(e){return Bt.fn.shouldSerialize.call(this,e)&&"uid"!==e&&!("id"!==this.idField&&"id"===e)&&"dirty"!==e&&"_accessors"!==e},_parse:function(e,t){var n,r=this,o=e,a=r.fields||{};return e=a[e],e||(e=i(a,o)),e&&(n=e.parse,!n&&e.type&&(n=Wt[e.type.toLowerCase()])),n?n(t):t},_notifyChange:function(e){var t=e.action;("add"==t||"remove"==t)&&(this.dirty=!0)},editable:function(e){return e=(this.fields||{})[e],e?e.editable!==!1:!0},set:function(e,t,n){var i=this;i.editable(e)&&(t=i._parse(e,t),r(t,i.get(e))||(i.dirty=!0,Bt.fn.set.call(i,e,t,n)))},accept:function(e){var t,n,r=this,i=function(){return r};for(t in e)n=e[t],"_"!=t.charAt(0)&&(n=r.wrap(e[t],t,i)),r._set(t,n);r.idField&&(r.id=r.get(r.idField)),r.dirty=!1},isNew:function(){return this.id===this._defaultId}});Gt.define=function(e,n){n===t&&(n=e,e=Gt);var r,i,o,a,s,u,l,c,d=K({defaults:{}},n),f={},h=d.id;if(h&&(d.idField=h),d.id&&delete d.id,h&&(d.defaults[h]=d._defaultId=""),"[object Array]"===Rt.call(d.fields)){for(u=0,l=d.fields.length;l>u;u++)o=d.fields[u],typeof o===ft?f[o]={}:o.field&&(f[o.field]=o);d.fields=f}for(i in d.fields)o=d.fields[i],a=o.type||"default",s=null,c=i,i=typeof o.field===ft?o.field:i,o.nullable||(s=d.defaults[c!==i?c:i]=o.defaultValue!==t?o.defaultValue:$t[a.toLowerCase()]),n.id===i&&(d._defaultId=s),d.defaults[c!==i?c:i]=s,o.parse=o.parse||Wt[a];return r=e.extend(d),r.define=function(e){return Gt.define(r,e)},d.fields&&(r.fields=d.fields,r.idField=d.idField),r},q={selector:function(e){return lt(e)?e:Ct(e)},compare:function(e){var t=this.selector(e);return function(e,n){return e=t(e),n=t(n),null==e&&null==n?0:null==e?-1:null==n?1:e.localeCompare?e.localeCompare(n):e>n?1:n>e?-1:0}},create:function(e){var t=e.compare||this.compare(e.field);return"desc"==e.dir?function(e,n){return t(n,e,!0)}:t},combine:function(e){return function(t,n){var r,i,o=e[0](t,n);for(r=1,i=e.length;i>r;r++)o=o||e[r](t,n);return o}}},I=K({},q,{asc:function(e){var t=this.selector(e);return function(e,n){var r=t(e),i=t(n);return r&&r.getTime&&i&&i.getTime&&(r=r.getTime(),i=i.getTime()),r===i?e.__position-n.__position:null==r?-1:null==i?1:r.localeCompare?r.localeCompare(i):r>i?1:-1}},desc:function(e){var t=this.selector(e);return function(e,n){var r=t(e),i=t(n);return r&&r.getTime&&i&&i.getTime&&(r=r.getTime(),i=i.getTime()),r===i?e.__position-n.__position:null==r?1:null==i?-1:i.localeCompare?i.localeCompare(r):i>r?1:-1}},create:function(e){return this[e.dir](e.field)}}),R=function(e,t){var n,r=e.length,i=Array(r);for(n=0;r>n;n++)i[n]=t(e[n],n,e);return i},j=function(){function e(e){return e.replace(Lt,"\\").replace(jt,"")}function t(t,n,r,i){var o;return null!=r&&(typeof r===ft&&(r=e(r),o=It.exec(r),o?r=new Date(+o[1]):i?(r="'"+r.toLowerCase()+"'",n="("+n+" || '').toLowerCase()"):r="'"+r+"'"),r.getTime&&(n="("+n+"?"+n+".getTime():"+n+")",r=r.getTime())),n+" "+t+" "+r}return{eq:function(e,n,r){return t("==",e,n,r)},neq:function(e,n,r){return t("!=",e,n,r)},gt:function(e,n,r){return t(">",e,n,r)},gte:function(e,n,r){return t(">=",e,n,r)},lt:function(e,n,r){return t("<",e,n,r)},lte:function(e,n,r){return t("<=",e,n,r)},startswith:function(t,n,r){return r&&(t="("+t+" || '').toLowerCase()",n&&(n=n.toLowerCase())),n&&(n=e(n)),t+".lastIndexOf('"+n+"', 0) == 0"},endswith:function(t,n,r){return r&&(t="("+t+" || '').toLowerCase()",n&&(n=n.toLowerCase())),n&&(n=e(n)),t+".indexOf('"+n+"', "+t+".length - "+(n||"").length+") >= 0"},contains:function(t,n,r){return r&&(t="("+t+" || '').toLowerCase()",n&&(n=n.toLowerCase())),n&&(n=e(n)),t+".indexOf('"+n+"') >= 0"},doesnotcontain:function(t,n,r){return r&&(t="("+t+" || '').toLowerCase()",n&&(n=n.toLowerCase())),n&&(n=e(n)),t+".indexOf('"+n+"') == -1"}}}(),o.filterExpr=function(e){var n,r,i,a,s,u,l=[],c={and:" && ",or:" || "},d=[],f=[],h=e.filters;for(n=0,r=h.length;r>n;n++)i=h[n],s=i.field,u=i.operator,i.filters?(a=o.filterExpr(i),i=a.expression.replace(/__o\[(\d+)\]/g,function(e,t){return t=+t,"__o["+(f.length+t)+"]"}).replace(/__f\[(\d+)\]/g,function(e,t){return t=+t,"__f["+(d.length+t)+"]"}),f.push.apply(f,a.operators),d.push.apply(d,a.fields)):(typeof s===ht?(a="__f["+d.length+"](d)",d.push(s)):a=ut.expr(s),typeof u===ht?(i="__o["+f.length+"]("+a+", "+i.value+")",f.push(u)):i=j[(u||"eq").toLowerCase()](a,i.value,i.ignoreCase!==t?i.ignoreCase:!0)),l.push(i);return{expression:"("+l.join(c[e.logic])+")",fields:d,operators:f}},L={"==":"eq",equals:"eq",isequalto:"eq",equalto:"eq",equal:"eq","!=":"neq",ne:"neq",notequals:"neq",isnotequalto:"neq",notequalto:"neq",notequal:"neq","<":"lt",islessthan:"lt",lessthan:"lt",less:"lt","<=":"lte",le:"lte",islessthanorequalto:"lte",lessthanequal:"lte",">":"gt",isgreaterthan:"gt",greaterthan:"gt",greater:"gt",">=":"gte",isgreaterthanorequalto:"gte",greaterthanequal:"gte",ge:"gte",notsubstringof:"doesnotcontain"},o.normalizeFilter=u,o.prototype={toArray:function(){return this.data},range:function(e,t){return new o(this.data.slice(e,e+t))},skip:function(e){return new o(this.data.slice(e))},take:function(e){return new o(this.data.slice(0,e))},select:function(e){return new o(R(this.data,e))},order:function(e,t){var n={dir:t};return e&&(e.compare?n.compare=e.compare:n.field=e),new o(this.data.slice(0).sort(q.create(n)))},orderBy:function(e){return this.order(e,"asc")},orderByDescending:function(e){return this.order(e,"desc")},sort:function(e,t,n){var r,i,o=a(e,t),s=[];if(n=n||q,o.length){for(r=0,i=o.length;i>r;r++)s.push(n.create(o[r]));return this.orderBy({compare:n.combine(s)})}return this},filter:function(e){var t,n,r,i,a,s,l,c,d=this.data,f=[];if(e=u(e),!e||0===e.filters.length)return this;for(i=o.filterExpr(e),s=i.fields,l=i.operators,a=c=Function("d, __f, __o","return "+i.expression),(s.length||l.length)&&(c=function(e){return a(e,s,l)}),t=0,r=d.length;r>t;t++)n=d[t],c(n)&&f.push(n);return new o(f)},group:function(e,t){e=c(e||[]),t=t||this.data;var n,r=this,i=new o(r.data);return e.length>0&&(n=e[0],i=i.groupBy(n).select(function(r){var i=new o(t).filter([{field:r.field,operator:"eq",value:r.value,ignoreCase:!1}]);return{field:r.field,value:r.value,items:e.length>1?new o(r.items).group(e.slice(1),i.toArray()).toArray():r.items,hasSubgroups:e.length>1,aggregates:i.aggregate(n.aggregates)}})),i},groupBy:function(e){if(nt(e)||!this.data.length)return new o([]);var t,n,r,i,a=e.field,s=this._sortForGrouping(a,e.dir||"asc"),u=ut.accessor(a),l=u.get(s[0],a),c={field:a,value:l,items:[]},f=[c];for(r=0,i=s.length;i>r;r++)t=s[r],n=u.get(t,a),d(l,n)||(l=n,c={field:a,value:l,items:[]},f.push(c)),c.items.push(t);return new o(f)},_sortForGrouping:function(e,t){var n,r,i=this.data;if(!qt){for(n=0,r=i.length;r>n;n++)i[n].__position=n;for(i=new o(i).sort(e,t,I).toArray(),n=0,r=i.length;r>n;n++)delete i[n].__position;return i}return this.sort(e,t).toArray()},aggregate:function(e){var t,n,r={},i={};if(e&&e.length)for(t=0,n=this.data.length;n>t;t++)f(r,e,this.data[t],t,n,i);return r}},U={sum:function(e,t,n){var r=n.get(t);return h(e)?h(r)&&(e+=r):e=r,e},count:function(e){return(e||0)+1},average:function(e,n,r,i,o,a){var s=r.get(n);return a.count===t&&(a.count=0),h(e)?h(s)&&(e+=s):e=s,h(s)&&a.count++,i==o-1&&h(e)&&(e/=a.count),e},max:function(e,t,n){var r=n.get(t);return h(e)||p(e)||(e=r),r>e&&(h(r)||p(r))&&(e=r),e},min:function(e,t,n){var r=n.get(t);return h(e)||p(e)||(e=r),e>r&&(h(r)||p(r))&&(e=r),e}},o.process=function(e,n){n=n||{};var r,i=new o(e),s=n.group,u=c(s||[]).concat(a(n.sort||[])),l=n.filter,d=n.skip,f=n.take;return l&&(i=i.filter(l),r=i.toArray().length),u&&(i=i.sort(u),s&&(e=i.toArray())),d!==t&&f!==t&&(i=i.range(d,f)),s&&(i=i.group(s,e)),{total:r,data:i.toArray()}},B=dt.extend({init:function(e){this.data=e.data},read:function(e){e.success(this.data)},update:function(e){e.success(e.data)},create:function(e){e.success(e.data)},destroy:function(e){e.success(e.data)}}),W=dt.extend({init:function(e){var t,n=this;e=n.options=K({},n.options,e),at(kt,function(t,n){typeof e[n]===ft&&(e[n]={url:e[n]})}),n.cache=e.cache?$.create(e.cache):{find:st,add:st},t=e.parameterMap,lt(e.push)&&(n.push=e.push),n.push||(n.push=Tt),n.parameterMap=lt(t)?t:function(e){var n={};return at(e,function(e,r){e in t&&(e=t[e],tt(e)&&(r=e.value(r),e=e.key)),n[e]=r}),n}},options:{parameterMap:Tt},create:function(e){return ot(this.setup(e,pt))},read:function(n){var r,i,o,a=this,s=a.cache;n=a.setup(n,gt),r=n.success||st,i=n.error||st,o=s.find(n.data),o!==t?r(o):(n.success=function(e){s.add(n.data,e),r(e)},e.ajax(n))},update:function(e){return ot(this.setup(e,mt))},destroy:function(e){return ot(this.setup(e,vt))},setup:function(e,t){e=e||{};var n,r=this,i=r.options[t],o=lt(i.data)?i.data(e.data):i.data;return e=K(!0,{},i,e),n=K(!0,{},o,e.data),e.data=r.parameterMap(n,t),lt(e.url)&&(e.url=e.url(n)),e}}),$=dt.extend({init:function(){this._store={}},add:function(e,n){e!==t&&(this._store[Ot(e)]=n)},find:function(e){return this._store[Ot(e)]},clear:function(){this._store={}},remove:function(e){delete this._store[Ot(e)]}}),$.create=function(e){var t={inmemory:function(){return new $}};return tt(e)&&lt(e.find)?e:e===!0?new $:t[e]()},G=dt.extend({init:function(e){var t,n,r,i,o,a,s,u,l,c,d,f,h,p=this;e=e||{};for(t in e)n=e[t],p[t]=typeof n===ft?Ct(n):n;i=e.modelBase||Gt,tt(p.model)&&(p.model=r=i.define(p.model)),p.model&&(o=et(p.data,p),a=et(p.groups,p),s=et(p.serialize,p),u={},l={},c={},d={},f=!1,r=p.model,r.fields&&(at(r.fields,function(e,t){var n;h=e,tt(t)&&t.field?h=t.field:typeof t===ft&&(h=t),tt(t)&&t.from&&(n=t.from),f=f||n&&n!==e||h!==e,l[e]=Ct(n||h),c[e]=Ct(e),u[n||h]=e,d[e]=n||h}),!e.serialize&&f&&(p.serialize=w(s,r,v,c,u,d))),p._dataAccessFunction=o,p.data=w(o,r,y,l,u,d),p.groups=w(a,r,_,l,u,d))},errors:function(e){return e?e.errors:null},parse:Tt,data:Tt,total:function(e){return e.length},groups:Tt,aggregates:function(){return{}},serialize:function(e){return e}}),J=ct.extend({init:function(e){var n,r,i=this;e&&(r=e.data),e=i.options=K({},i.options,e),i._map={},i._prefetch={},i._data=[],i._pristineData=[],i._ranges=[],i._view=[],i._pristineTotal=0,i._destroyed=[],i._pageSize=e.pageSize,i._page=e.page||(e.pageSize?1:t),i._sort=a(e.sort),i._filter=u(e.filter),i._group=c(e.group),i._aggregate=e.aggregate,i._total=e.total,ct.fn.init.call(i),i.transport=V.create(e,r),lt(i.transport.push)&&i.transport.push({pushCreate:et(i._pushCreate,i),pushUpdate:et(i._pushUpdate,i),pushDestroy:et(i._pushDestroy,i)}),i.reader=new ut.data.readers[e.schema.type||"json"](e.schema),n=i.reader.model||{},i._data=i._observe(i._data),i.bind(["push",bt,yt,St,_t,xt,Mt],e)},options:{data:[],schema:{modelBase:Gt},serverSorting:!1,serverPaging:!1,serverFiltering:!1,serverGrouping:!1,serverAggregates:!1,batch:!1},_isServerGrouped:function(){var e=this.group()||[];return this.options.serverGrouping&&e.length},_pushCreate:function(e){this._push(e,"pushCreate")},_pushUpdate:function(e){this._push(e,"pushUpdate")},_pushDestroy:function(e){this._push(e,"pushDestroy")},_push:function(e,t){var n=this._readData(e);n||(n=e),this[t](n)},_flatData:function(e){return this._isServerGrouped()?S(e):e},parent:st,get:function(e){var t,n,r=this._flatData(this._data);for(t=0,n=r.length;n>t;t++)if(r[t].id==e)return r[t]},getByUid:function(e){var t,n,r=this._flatData(this._data);if(r)for(t=0,n=r.length;n>t;t++)if(r[t].uid==e)return r[t]},indexOf:function(e){return O(this._data,e)},at:function(e){return this._data[e]},data:function(e){var n=this;return e===t?n._data:(n._data=this._observe(e),n._pristineData=e.slice(0),n._ranges=[],n._addRange(n._data),n._total=n._data.length,n._pristineTotal=n._total,n._process(n._data),t)},view:function(){return this._view},add:function(e){return this.insert(this._data.length,e)},_createNewModel:function(e){return this.reader.model?new this.reader.model(e):new Bt(e)},insert:function(e,t){return t||(t=e,e=0),t instanceof Gt||(t=this._createNewModel(t)),this._isServerGrouped()?this._data.splice(e,0,T(this.group(),t)):this._data.splice(e,0,t),t},pushCreate:function(e){var t,n,r,i,o,a;rt(e)||(e=[e]),t=[],n=this.options.autoSync,this.options.autoSync=!1;try{for(r=0;e.length>r;r++)i=e[r],o=this.add(i),t.push(o),a=o.toJSON(),this._isServerGrouped()&&(a=T(this.group(),a)),this._pristineData.push(a)}finally{this.options.autoSync=n}t.length&&this.trigger("push",{type:"create",items:t})},pushUpdate:function(e){var t,n,r,i,o;for(rt(e)||(e=[e]),t=[],n=0;e.length>n;n++)r=e[n],i=this._createNewModel(r),o=this.get(i.id),o?(t.push(o),o.accept(r),o.trigger("change"),this._updatePristineForModel(o,r)):this.pushCreate(r);t.length&&this.trigger("push",{type:"update",items:t})},pushDestroy:function(e){var t,n,r,i,o,a;rt(e)||(e=[e]),t=[],n=this.options.autoSync,this.options.autoSync=!1;try{for(r=0;e.length>r;r++)i=e[r],o=this._createNewModel(i),a=!1,this._eachItem(this._data,function(e){for(var n=0;e.length>n;n++)if(e[n].id===o.id){t.push(e[n]),e.splice(n,1),a=!0;break}}),a&&(this._removePristineForModel(o),this._destroyed.pop())}finally{this.options.autoSync=n}t.length&&this.trigger("push",{type:"destroy",items:t})},remove:function(e){var n,r=this,i=r._isServerGrouped();return this._eachItem(r._data,function(o){return n=k(o,e),n&&i?(n.isNew&&n.isNew()||r._destroyed.push(n),!0):t}),this._removeModelFromRanges(e),this._updateRangesLength(),e},sync:function(){var t,n,r,i=this,o=[],a=[],s=i._destroyed,u=i._flatData(i._data);if(i.reader.model){for(t=0,n=u.length;n>t;t++)u[t].isNew()?o.push(u[t]):u[t].dirty&&a.push(u[t]);r=i._send("create",o),r.push.apply(r,i._send("update",a)),r.push.apply(r,i._send("destroy",s)),e.when.apply(null,r).then(function(){var e,t;for(e=0,t=arguments.length;t>e;e++)i._accept(arguments[e]);i._change({action:"sync"}),i.trigger(_t)})}},cancelChanges:function(e){var t=this;e instanceof ut.data.Model?t._cancelModel(e):(t._destroyed=[],t._data=t._observe(t._pristineData),t.options.serverPaging&&(t._total=t._pristineTotal),t._change())},hasChanges:function(){var e,t,n=this._data;if(this._destroyed.length)return!0;for(e=0,t=n.length;t>e;e++)if(n[e].isNew()||n[e].dirty)return!0;return!1},_accept:function(t){var n,r=this,i=t.models,o=t.response,a=0,s=r._isServerGrouped(),u=r._pristineData,l=t.type;if(r.trigger(xt,{response:o,type:l}),o&&!nt(o)){if(o=r.reader.parse(o),r._handleCustomErrors(o))return;o=r.reader.data(o),rt(o)||(o=[o])}else o=e.map(i,function(e){return e.toJSON()});for("destroy"===l&&(r._destroyed=[]),a=0,n=i.length;n>a;a++)"destroy"!==l?(i[a].accept(o[a]),"create"===l?u.push(s?T(r.group(),i[a]):o[a]):"update"===l&&r._updatePristineForModel(i[a],o[a])):r._removePristineForModel(i[a])},_updatePristineForModel:function(e,t){this._executeOnPristineForModel(e,function(e,n){ut.deepExtend(n[e],t)})},_executeOnPristineForModel:function(e,n){this._eachPristineItem(function(r){var i=C(r,e);return i>-1?(n(i,r),!0):t})},_removePristineForModel:function(e){this._executeOnPristineForModel(e,function(e,t){t.splice(e,1)})},_readData:function(e){var t=this._isServerGrouped()?this.reader.groups:this.reader.data;return t(e)},_eachPristineItem:function(e){this._eachItem(this._pristineData,e)},_eachItem:function(e,t){e&&e.length&&(this._isServerGrouped()?x(e,t):t(e))},_pristineForModel:function(e){var n,r,i=function(i){return r=C(i,e),r>-1?(n=i[r],!0):t};return this._eachPristineItem(i),n},_cancelModel:function(e){var t,n=this._pristineForModel(e);this._eachItem(this._data,function(r){t=O(r,e),-1!=t&&(!e.isNew()&&n?r[t].accept(n):r.splice(t,1))})},_promise:function(t,n,r){var i=this,o=i.transport;return e.Deferred(function(e){i.trigger(St,{type:r}),o[r].call(o,K({success:function(t){e.resolve({response:t,models:n,type:r})},error:function(t,n,r){e.reject(t),i.error(t,n,r)}},t))}).promise()},_send:function(e,t){var n,r,i=this,o=[],a=i.reader.serialize(g(t));if(i.options.batch)t.length&&o.push(i._promise({data:{models:a}},t,e));else for(n=0,r=t.length;r>n;n++)o.push(i._promise({data:a[n]},[t[n]],e));return o},read:function(e){var t=this,n=t._params(e);t._queueRequest(n,function(){t.trigger(St,{type:"read"})?t._dequeueRequest():(t.trigger(Mt),t._ranges=[],t.transport.read({data:n,success:et(t.success,t),error:et(t.error,t)}))})},success:function(e){var n=this,r=n.options;return n.trigger(xt,{response:e,type:"read"}),e=n.reader.parse(e),n._handleCustomErrors(e)?(n._dequeueRequest(),t):(n._total=n.reader.total(e),n._pristineTotal=n._total,n._aggregate&&r.serverAggregates&&(n._aggregateResult=n.reader.aggregates(e)),e=n._readData(e),n._pristineData=e.slice(0),n._data=n._observe(e),n._addRange(n._data),n._process(n._data),n._dequeueRequest(),t)},_addRange:function(e){var t=this,n=t._skip||0,r=n+t._flatData(e).length;t._ranges.push({start:n,end:r,data:e}),t._ranges.sort(function(e,t){return e.start-t.start})},error:function(e,t,n){this._dequeueRequest(),this.trigger(xt,{}),this.trigger(bt,{xhr:e,status:t,errorThrown:n})},_params:function(e){var t=this,n=K({take:t.take(),skip:t.skip(),page:t.page(),pageSize:t.pageSize(),sort:t._sort,filter:t._filter,group:t._group,aggregate:t._aggregate},e);return t.options.serverPaging||(delete n.take,delete n.skip,delete n.page,delete n.pageSize),t.options.serverGrouping?t.reader.model&&n.group&&(n.group=A(n.group,t.reader.model)):delete n.group,t.options.serverFiltering?t.reader.model&&n.filter&&(n.filter=P(n.filter,t.reader.model)):delete n.filter,t.options.serverSorting?t.reader.model&&n.sort&&(n.sort=A(n.sort,t.reader.model)):delete n.sort,t.options.serverAggregates?t.reader.model&&n.aggregate&&(n.aggregate=A(n.aggregate,t.reader.model)):delete n.aggregate,n},_queueRequest:function(e,n){var r=this;r._requestInProgress?r._pending={callback:et(n,r),options:e}:(r._requestInProgress=!0,r._pending=t,n())},_dequeueRequest:function(){var e=this;e._requestInProgress=!1,e._pending&&e._queueRequest(e._pending.options,e._pending.callback)},_handleCustomErrors:function(e){if(this.reader.errors){var t=this.reader.errors(e);if(t)return this.trigger(bt,{xhr:null,status:"customerror",errorThrown:"custom error",errors:t}),!0}return!1},_observe:function(e){var t=this,n=t.reader.model,r=!1;return n&&e.length&&(r=!(e[0]instanceof n)),e instanceof Ut?r&&(e.type=t.reader.model,e.wrapAll(e,e)):(e=new Ut(e,t.reader.model),e.parent=function(){return t.parent()}),t._isServerGrouped()&&M(e,n),t._changeHandler&&t._data&&t._data instanceof Ut?t._data.unbind(yt,t._changeHandler):t._changeHandler=et(t._change,t),e.bind(yt,t._changeHandler)},_change:function(e){var t,n,r,i=this,o=e?e.action:"";if("remove"===o)for(t=0,n=e.items.length;n>t;t++)e.items[t].isNew&&e.items[t].isNew()||i._destroyed.push(e.items[t]);!i.options.autoSync||"add"!==o&&"remove"!==o&&"itemchange"!==o?(r=parseInt(i._total,10),h(i._total)||(r=parseInt(i._pristineTotal,10)),"add"===o?r+=e.items.length:"remove"===o?r-=e.items.length:"itemchange"===o||"sync"===o||i.options.serverPaging?"sync"===o&&(r=i._pristineTotal=parseInt(i._total,10)):r=i._pristineTotal,i._total=r,i._process(i._data,e)):i.sync()},_process:function(e,n){var r,i=this,a={};i.options.serverPaging!==!0&&(a.skip=i._skip,a.take=i._take||i._pageSize,a.skip===t&&i._page!==t&&i._pageSize!==t&&(a.skip=(i._page-1)*i._pageSize)),i.options.serverSorting!==!0&&(a.sort=i._sort),i.options.serverFiltering!==!0&&(a.filter=i._filter),i.options.serverGrouping!==!0&&(a.group=i._group),i.options.serverAggregates!==!0&&(a.aggregate=i._aggregate,i._aggregateResult=m(e,a)),r=o.process(e,a),i._view=r.data,r.total===t||i.options.serverFiltering||(i._total=r.total),n=n||{},n.items=n.items||i._view,i.trigger(yt,n)},_mergeState:function(e){var n=this;return e!==t&&(n._pageSize=e.pageSize,n._page=e.page,n._sort=e.sort,n._filter=e.filter,n._group=e.group,n._aggregate=e.aggregate,n._skip=e.skip,n._take=e.take,n._skip===t&&(n._skip=n.skip(),e.skip=n.skip()),n._take===t&&n._pageSize!==t&&(n._take=n._pageSize,e.take=n._take),e.sort&&(n._sort=e.sort=a(e.sort)),e.filter&&(n._filter=e.filter=u(e.filter)),e.group&&(n._group=e.group=c(e.group)),e.aggregate&&(n._aggregate=e.aggregate=l(e.aggregate))),e},query:function(e){var n,r=this,i=r.options.serverSorting||r.options.serverPaging||r.options.serverFiltering||r.options.serverGrouping||r.options.serverAggregates;i||(r._data===t||0===r._data.length)&&!r._destroyed.length?r.read(r._mergeState(e)):r.trigger(St,{type:"read"})||(r.trigger(Mt),n=o.process(r._data,r._mergeState(e)),r.options.serverFiltering||(r._total=n.total!==t?n.total:r._data.length),r._view=n.data,r._aggregateResult=m(r._data,e),r.trigger(xt,{}),r.trigger(yt,{items:n.data}))},fetch:function(t){var n=this;return e.Deferred(function(e){var r=function(r){n.unbind(bt,i),e.resolve(),t&&t.call(n,r)},i=function(t){e.reject(t)};n.one(yt,r),n.one(bt,i),n._query()}).promise()},_query:function(e){var t=this;t.query(K({},{page:t.page(),pageSize:t.pageSize(),sort:t.sort(),filter:t.filter(),group:t.group(),aggregate:t.aggregate()},e))},next:function(e){var n=this,r=n.page(),i=n.total();return e=e||{},!r||i&&r+1>n.totalPages()?t:(n._skip=r*n.take(),r+=1,e.page=r,n._query(e),r)},prev:function(e){var n=this,r=n.page();return e=e||{},r&&1!==r?(n._skip=n._skip-n.take(),r-=1,e.page=r,n._query(e),r):t},page:function(e){var n,r=this;return e!==t?(e=zt.max(zt.min(zt.max(e,1),r.totalPages()),1),r._query({page:e}),t):(n=r.skip(),n!==t?zt.round((n||0)/(r.take()||1))+1:t)},pageSize:function(e){var n=this;return e!==t?(n._query({pageSize:e,page:1}),t):n.take()},sort:function(e){var n=this;return e!==t?(n._query({sort:e}),t):n._sort},filter:function(e){var n=this;return e===t?n._filter:(n._query({filter:e,page:1}),t)},group:function(e){var n=this;return e!==t?(n._query({group:e}),t):n._group},total:function(){return parseInt(this._total||0,10)},aggregate:function(e){var n=this;return e!==t?(n._query({aggregate:e}),t):n._aggregate},aggregates:function(){return this._aggregateResult},totalPages:function(){var e=this,t=e.pageSize()||e.total();return zt.ceil((e.total()||0)/t)},inRange:function(e,t){var n=this,r=zt.min(e+t,n.total());return!n.options.serverPaging&&n._data.length>0?!0:n._findRange(e,r).length>0},lastRange:function(){var e=this._ranges;return e[e.length-1]||{start:0,end:0,data:[]}},firstItemUid:function(){var e=this._ranges;return e.length&&e[0].data.length&&e[0].data[0].uid},range:function(e,n){var r,i,o,a,s,u,l,c;if(e=zt.min(e||0,this.total()),r=this,i=zt.max(zt.floor(e/n),0)*n,o=zt.min(i+n,r.total()),r._skipRequestsInProgress=!1,a=r._findRange(e,zt.min(e+n,r.total())),a.length){r._requestInProgress&&(r._skipRequestsInProgress=!0),r._skip=e>r.skip()?zt.min(o,(r.totalPages()-1)*r.take()):i,r._take=n,s=r.options.serverPaging,u=r.options.serverSorting,l=r.options.serverFiltering,c=r.options.serverAggregates;try{r.options.serverPaging=!0,r._isServerGrouped()||r.group()&&r.group().length||(r.options.serverSorting=!0),r.options.serverFiltering=!0,r.options.serverPaging=!0,r.options.serverAggregates=!0,s&&(r._data=a=r._observe(a)),r._process(a)}finally{r.options.serverPaging=s,r.options.serverSorting=u,r.options.serverFiltering=l,r.options.serverAggregates=c}}else n!==t&&(r._rangeExists(i,o)?e>i&&r.prefetch(o,n,function(){r.range(e,n)}):r.prefetch(i,n,function(){e>i&&o<r.total()&&!r._rangeExists(o,zt.min(o+n,r.total()))?r.prefetch(o,n,function(){r.range(e,n)}):r.range(e,n)}))},_findRange:function(e,n){var r,i,s,u,l,d,f,h,p,g,m,v,y=this,_=y._ranges,w=[],b=y.options,S=b.serverSorting||b.serverPaging||b.serverFiltering||b.serverGrouping||b.serverAggregates;for(i=0,m=_.length;m>i;i++)if(r=_[i],e>=r.start&&r.end>=e){for(g=0,s=i;m>s;s++)if(r=_[s],p=y._flatData(r.data),p.length&&e+g>=r.start&&(d=r.data,f=r.end,S||(v=c(y.group()||[]).concat(a(y.sort()||[])),h=o.process(r.data,{sort:v,filter:y.filter()}),p=d=h.data,h.total!==t&&(f=h.total)),u=0,e+g>r.start&&(u=e+g-r.start),l=p.length,f>n&&(l-=f-n),g+=l-u,w=y._mergeGroups(w,d,u,l),r.end>=n&&g==n-e))return w;break}return[]},_mergeGroups:function(e,t,n,r){if(this._isServerGrouped()){var i,o=t.toJSON();return e.length&&(i=e[e.length-1]),b(i,o,n,r),e.concat(o)}return e.concat(t.slice(n,r))},skip:function(){var e=this;return e._skip===t?e._page!==t?(e._page-1)*(e.take()||1):t:e._skip},take:function(){return this._take||this._pageSize},_prefetchSuccessHandler:function(e,t,n){var r=this;return function(i){var o,a,s,u=!1,l={start:e,end:t,data:[]};if(r._dequeueRequest(),r.trigger(xt,{response:i,type:"read"}),i=r.reader.parse(i),s=r._readData(i),s.length){for(o=0,a=r._ranges.length;a>o;o++)if(r._ranges[o].start===e){u=!0,l=r._ranges[o];break}u||r._ranges.push(l)}l.data=r._observe(s),l.end=l.start+r._flatData(l.data).length,r._ranges.sort(function(e,t){return e.start-t.start}),r._total=r.reader.total(i),r._skipRequestsInProgress||(n&&s.length?n():r.trigger(yt,{}))}},prefetch:function(e,t,n){var r=this,i=zt.min(e+t,r.total()),o={take:t,skip:e,page:e/t+1,pageSize:t,sort:r._sort,filter:r._filter,group:r._group,aggregate:r._aggregate};r._rangeExists(e,i)?n&&n():(clearTimeout(r._timeout),r._timeout=setTimeout(function(){r._queueRequest(o,function(){r.trigger(St,{type:"read"})?r._dequeueRequest():r.transport.read({data:r._params(o),success:r._prefetchSuccessHandler(e,i,n)})})},100))},_rangeExists:function(e,t){var n,r,i=this,o=i._ranges;for(n=0,r=o.length;r>n;n++)if(e>=o[n].start&&o[n].end>=t)return!0;return!1},_removeModelFromRanges:function(e){var t,n,r,i,o;for(i=0,o=this._ranges.length;o>i&&(r=this._ranges[i],this._eachItem(r.data,function(r){t=k(r,e),t&&(n=!0)}),!n);i++);},_updateRangesLength:function(){var e,t,n,r,i=0;for(n=0,r=this._ranges.length;r>n;n++)e=this._ranges[n],e.start=e.start-i,t=this._flatData(e.data).length,i=e.end-t,e.end=e.start+t}}),V={},V.create=function(e,t){var n,r=e.transport;return r?(r.read=typeof r.read===ft?{url:r.read}:r.read,e.type&&(ut.data.transports[e.type]&&!tt(ut.data.transports[e.type])?n=new ut.data.transports[e.type](K(r,{data:t})):r=K(!0,{},ut.data.transports[e.type],r),e.schema=K(!0,{},ut.data.schemas[e.type],e.schema)),n||(n=lt(r.read)?r:new W(r))):n=new B({data:e.data}),n},J.create=function(e){(rt(e)||e instanceof Ut)&&(e={data:e});var t,n,r,i=e||{},o=i.data,a=i.fields,s=i.table,u=i.select,l={};if(o||!a||i.transport||(s?o=N(s,a):u&&(o=F(u,a))),ut.data.Model&&a&&(!i.schema||!i.schema.model)){for(t=0,n=a.length;n>t;t++)r=a[t],r.type&&(l[r.field]=r);nt(l)||(i.schema=K(!0,i.schema,{model:{fields:l}}))}return i.data=o,s=null,i.table=null,i instanceof J?i:new J(i)},Y=Gt.define({init:function(e){var t=this,n=t.hasChildren||e&&e.hasChildren,r="items",i={};ut.data.Model.fn.init.call(t,e),typeof t.children===ft&&(r=t.children),i={schema:{data:r,model:{hasChildren:n,id:t.idField,fields:t.fields}}},typeof t.children!==ft&&K(i,t.children),i.data=e,n||(n=i.schema.data),typeof n===ft&&(n=ut.getter(n)),lt(n)&&(t.hasChildren=!!n.call(t,t)),t._childrenOptions=i,t.hasChildren&&t._initChildren(),t._loaded=!(!e||!e[r]&&!e._loaded)},_initChildren:function(){var e,t,n,r=this;r.children instanceof Q||(e=r.children=new Q(r._childrenOptions),t=e.transport,n=t.parameterMap,t.parameterMap=function(e,t){return e[r.idField||"id"]=r.id,n&&(e=n(e,t)),e},e.parent=function(){return r},e.bind(yt,function(e){e.node=e.node||r,r.trigger(yt,e)}),e.bind(bt,function(e){var t=r.parent();t&&(e.node=e.node||r,t.trigger(bt,e))}),r._updateChildrenField())},append:function(e){this._initChildren(),this.loaded(!0),this.children.add(e)},hasChildren:!1,level:function(){for(var e=this.parentNode(),t=0;e&&e.parentNode;)t++,e=e.parentNode?e.parentNode():null;return t},_updateChildrenField:function(){var e=this._childrenOptions.schema.data;this[e||"items"]=this.children.data()},_childrenLoaded:function(){this._loaded=!0,this._updateChildrenField()},load:function(){var e,n={},r="_query";this.hasChildren?(this._initChildren(),e=this.children,n[this.idField||"id"]=this.id,this._loaded||(e._data=t,r="read"),e.one(yt,et(this._childrenLoaded,this)),e[r](n)):this.loaded(!0)},parentNode:function(){var e=this.parent();return e.parent()},loaded:function(e){return e===t?this._loaded:(this._loaded=e,t)},shouldSerialize:function(e){return Gt.fn.shouldSerialize.call(this,e)&&"children"!==e&&"_loaded"!==e&&"hasChildren"!==e&&"_childrenOptions"!==e}}),Q=J.extend({init:function(e){var t=Y.define({children:e});J.fn.init.call(this,K(!0,{},{schema:{modelBase:t,model:t}},e)),this._attachBubbleHandlers()},_attachBubbleHandlers:function(){var e=this;e._data.bind(bt,function(t){e.trigger(bt,t)})},remove:function(e){var t,n=e.parentNode(),r=this;return n&&n._initChildren&&(r=n.children),t=J.fn.remove.call(r,e),n&&!r.data().length&&(n.hasChildren=!1),t},success:E("success"),data:E("data"),insert:function(e,t){var n=this.parent();return n&&n._initChildren&&(n.hasChildren=!0,n._initChildren()),J.fn.insert.call(this,e,t)},_find:function(e,t){var n,r,i,o,a;if(i=J.fn[e].call(this,t))return i;if(o=this._flatData(this.data()))for(n=0,r=o.length;r>n;n++)if(a=o[n].children,a instanceof Q&&(i=a[e](t)))return i},get:function(e){return this._find("get",e)},getByUid:function(e){return this._find("getByUid",e)}}),Q.create=function(e){e=e&&e.push?{data:e}:e;var t=e||{},n=t.data,r=t.fields,i=t.list;return n&&n._dataSource?n._dataSource:(n||!r||t.transport||i&&(n=H(i,r)),t.data=n,t instanceof Q?t:new Q(t))},Z=ut.Observable.extend({init:function(e,t,n){ut.Observable.fn.init.call(this),this._prefetching=!1,this.dataSource=e,this.prefetch=!n;var r=this;e.bind("change",function(){r._change()}),this._syncWithDataSource(),this.setViewSize(t)},setViewSize:function(e){this.viewSize=e,this._recalculate()},at:function(e){var n,r,i=this.pageSize;return e>=this.total()?(this.trigger("endreached",{index:e}),t):this.useRanges?(this.useRanges&&((this.dataOffset>e||e>this.skip+i)&&(r=Math.floor(e/i)*i,this.range(r)),e===this.prefetchThreshold&&this._prefetch(),e===this.midPageThreshold?this.range(this.nextMidRange):e===this.nextPageThreshold?this.range(this.nextFullRange):e===this.pullBackThreshold&&(this.offset===this.skip?this.range(this.previousMidRange):this.range(this.previousFullRange)),n=this.dataSource.at(e-this.dataOffset)),n===t&&this.trigger("endreached",{index:e}),n):this.dataSource.view()[e]},indexOf:function(e){return this.dataSource.data().indexOf(e)+this.dataOffset},total:function(){return parseInt(this.dataSource.total(),10)},next:function(){var e=this,t=e.pageSize,n=e.skip-e.viewSize,r=zt.max(zt.floor(n/t),0)*t+t;this.offset=n,this.dataSource.prefetch(r,t,function(){e._goToRange(n,!0)})},range:function(e){if(this.offset!==e){var t=this,n=this.pageSize,r=zt.max(zt.floor(e/n),0)*n+n,i=this.dataSource;this.offset=e,this._recalculate(),i.inRange(e,n)?this._goToRange(e):this.prefetch&&i.prefetch(r,n,function(){t._goToRange(e,!0)})}},syncDataSource:function(){var e=this.offset;this.offset=null,this.range(e)},destroy:function(){this.unbind()},_prefetch:function(){var e=this,t=this.pageSize,n=this.skip+t,r=this.dataSource;r.inRange(n,t)||this._prefetching||!this.prefetch||(this._prefetching=!0,this.trigger("prefetching",{skip:n,take:t}),r.prefetch(n,t,function(){e._prefetching=!1,e.trigger("prefetched",{skip:n,take:t})}))},_goToRange:function(e,t){this.offset===e&&(this.dataOffset=e,this._expanding=t,this.dataSource.range(e,this.pageSize))},_change:function(){var e=this.dataSource,t=e.firstItemUid();this.length=this.useRanges?e.lastRange().end:e.view().length,this._firstItemUid===t&&this.useRanges||(this._syncWithDataSource(),this._recalculate(),this.trigger("reset",{offset:this.offset})),this.trigger("resize"),this._expanding&&this.trigger("expand"),delete this._expanding},_syncWithDataSource:function(){var e=this.dataSource;this._firstItemUid=e.firstItemUid(),this.dataOffset=this.offset=e.skip()||0,this.pageSize=e.pageSize(),this.useRanges=e.options.serverPaging
},_recalculate:function(){var e=this.pageSize,t=this.offset,n=this.viewSize,r=Math.ceil(t/e)*e;this.skip=r,this.midPageThreshold=r+e-1,this.nextPageThreshold=r+n-1,this.prefetchThreshold=r+Math.floor(e/3*2),this.pullBackThreshold=this.offset-1,this.nextMidRange=r+e-n,this.nextFullRange=r,this.previousMidRange=t-n,this.previousFullRange=r-e}}),X=ut.Observable.extend({init:function(e,t){var n=this;ut.Observable.fn.init.call(n),this.dataSource=e,this.batchSize=t,this._total=0,this.buffer=new Z(e,3*t),this.buffer.bind({endreached:function(e){n.trigger("endreached",{index:e.index})},prefetching:function(e){n.trigger("prefetching",{skip:e.skip,take:e.take})},prefetched:function(e){n.trigger("prefetched",{skip:e.skip,take:e.take})},reset:function(){n._total=0,n.trigger("reset")},resize:function(){n._total=Math.ceil(this.length/n.batchSize),n.trigger("resize",{total:n.total(),offset:this.offset})}})},syncDataSource:function(){this.buffer.syncDataSource()},at:function(e){var n,r,i=this.buffer,o=e*this.batchSize,a=this.batchSize,s=[];for(i.offset>o&&i.at(i.offset-1),r=0;a>r&&(n=i.at(o+r),n!==t);r++)s.push(n);return s},total:function(){return this._total},destroy:function(){this.buffer.destroy(),this.unbind()}}),K(!0,ut.data,{readers:{json:G},Query:o,DataSource:J,HierarchicalDataSource:Q,Node:Y,ObservableObject:Bt,ObservableArray:Ut,LocalTransport:B,RemoteTransport:W,Cache:$,DataReader:G,Model:Gt,Buffer:Z,BatchBuffer:X})})(window.kendo.jQuery);(function(e,t){function n(e){var t,i,r,o,a=[];for(t=0,i=e.length;i>t;t++)if(e[t].hasSubgroups)a=a.concat(n(e[t].items));else for(r=e[t].items,o=0;r.length>o;o++)a.push(r[o]);return a}function i(e,n){var i=x.initWidget(e,{},n);return i?new b(i):t}function r(e){var t,n,i,o,a,s,u,l={};for(u=e.match(w),t=0,n=u.length;n>t;t++)i=u[t],o=i.indexOf(":"),a=i.substring(0,o),s=i.substring(o+1),"{"==s.charAt(0)&&(s=r(s)),l[a]=s;return l}function o(e,t,n){var i,r={};for(i in e)r[i]=new n(t,e[i]);return r}function a(e,t,n,s){var l,c,d,f=e.getAttribute("data-"+x.ns+"role"),h=e.getAttribute("data-"+x.ns+"bind"),v=e.children,y=[],b=!0,w={};if(s=s||[t],(f||h)&&u(e),f&&(d=i(e,n)),h&&(h=r(h.replace(S,"")),d||(w=x.parseOptions(e,{textField:"",valueField:"",template:"",valueUpdate:E,valuePrimitive:!1,autoBind:!0}),w.roles=n,d=new _(e,w)),d.source=t,c=o(h,s,g),w.template&&(c.template=new m(s,"",w.template)),c.click&&(h.events=h.events||{},h.events.click=h.click,c.click.destroy(),delete c.click),c.source&&(b=!1),h.attr&&(c.attr=o(h.attr,s,g)),h.style&&(c.style=o(h.style,s,g)),h.events&&(c.events=o(h.events,s,p)),d.bind(c)),d&&(e.kendoBindingTarget=d),b&&v){for(l=0;v.length>l;l++)y[l]=v[l];for(l=0;y.length>l;l++)a(y[l],t,n,s)}}function s(t,n){var i,r,o,s=x.rolesFromNamespaces([].slice.call(arguments,2));for(n=x.observable(n),t=e(t),i=0,r=t.length;r>i;i++)o=t[i],1===o.nodeType&&a(o,n,s)}function u(e){var t=e.kendoBindingTarget;t&&(t.destroy(),H?delete e.kendoBindingTarget:e.removeAttribute?e.removeAttribute("kendoBindingTarget"):e.kendoBindingTarget=null)}function l(e){u(e),c(e)}function c(e){var t,n,i=e.children;if(i)for(t=0,n=i.length;n>t;t++)l(i[t])}function d(t){var n,i;for(t=e(t),n=0,i=t.length;i>n;n++)l(t[n])}function f(e,t){var n=e.element,i=n[0].kendoBindingTarget;i&&s(n,i.source,t)}var h,g,p,m,v,y,_,b,w,S,x=window.kendo,M=x.Observable,k=x.data.ObservableObject,T=x.data.ObservableArray,C={}.toString,O={},D=x.Class,z=e.proxy,A="value",F="source",P="events",N="checked",H=!0,E="change";!function(){var e=document.createElement("a");e.innerText!==t?h="innerText":e.textContent!==t&&(h="textContent");try{delete e.test}catch(n){H=!1}}(),g=M.extend({init:function(e,t){var n=this;M.fn.init.call(n),n.source=e[0],n.parents=e,n.path=t,n.dependencies={},n.dependencies[t]=!0,n.observable=n.source instanceof M,n._access=function(e){n.dependencies[e.field]=!0},n.observable&&(n._change=function(e){n.change(e)},n.source.bind(E,n._change))},_parents:function(){var t,n=this.parents,i=this.get();return i&&"function"==typeof i.parent&&(t=i.parent(),e.inArray(t,n)<0&&(n=[t].concat(n))),n},change:function(e){var t,n,i=e.field,r=this;if("this"===r.path)r.trigger(E,e);else for(t in r.dependencies)if(0===t.indexOf(i)&&(n=t.charAt(i.length),!n||"."===n||"["===n)){r.trigger(E,e);break}},start:function(e){e.bind("get",this._access)},stop:function(e){e.unbind("get",this._access)},get:function(){var e=this,n=e.source,i=0,r=e.path,o=n;if(!e.observable)return o;for(e.start(e.source),o=n.get(r);o===t&&n;)n=e.parents[++i],n instanceof k&&(o=n.get(r));if(o===t)for(n=e.source;o===t&&n;)n=n.parent(),n instanceof k&&(o=n.get(r));return"function"==typeof o&&(i=r.lastIndexOf("."),i>0&&(n=n.get(r.substring(0,i))),e.start(n),o=n!==e.source?o.call(n,e.source):o.call(n),e.stop(n)),n&&n!==e.source&&(e.currentSource=n,n.unbind(E,e._change).bind(E,e._change)),e.stop(e.source),o},set:function(e){var t=this.currentSource||this.source,n=x.getter(this.path)(t);"function"==typeof n?t!==this.source?n.call(t,this.source,e):n.call(t,e):t.set(this.path,e)},destroy:function(){this.observable&&this.source.unbind(E,this._change),this.unbind()}}),p=g.extend({get:function(){var e,t=this.source,n=this.path,i=0;for(e=t.get(n);!e&&t;)t=this.parents[++i],t instanceof k&&(e=t.get(n));return z(e,t)}}),m=g.extend({init:function(e,t,n){var i=this;g.fn.init.call(i,e,t),i.template=n},render:function(e){var t;return this.start(this.source),t=x.render(this.template,e),this.stop(this.source),t}}),v=D.extend({init:function(e,t,n){this.element=e,this.bindings=t,this.options=n},bind:function(e,t){var n=this;e=t?e[t]:e,e.bind(E,function(e){n.refresh(t||e)}),n.refresh(t)},destroy:function(){}}),O.attr=v.extend({refresh:function(e){this.element.setAttribute(e,this.bindings.attr[e].get())}}),O.style=v.extend({refresh:function(e){this.element.style[e]=this.bindings.style[e].get()||""}}),O.enabled=v.extend({refresh:function(){this.bindings.enabled.get()?this.element.removeAttribute("disabled"):this.element.setAttribute("disabled","disabled")}}),O.readonly=v.extend({refresh:function(){this.bindings.readonly.get()?this.element.setAttribute("readonly","readonly"):this.element.removeAttribute("readonly")}}),O.disabled=v.extend({refresh:function(){this.bindings.disabled.get()?this.element.setAttribute("disabled","disabled"):this.element.removeAttribute("disabled")}}),O.events=v.extend({init:function(e,t,n){v.fn.init.call(this,e,t,n),this.handlers={}},refresh:function(t){var n=e(this.element),i=this.bindings.events[t],r=this.handlers[t];r&&n.off(t,r),r=this.handlers[t]=i.get(),n.on(t,i.source,r)},destroy:function(){var t,n=e(this.element);for(t in this.handlers)n.off(t,this.handlers[t])}}),O.text=v.extend({refresh:function(){var e=this.bindings.text.get();null==e&&(e=""),this.element[h]=e}}),O.visible=v.extend({refresh:function(){this.element.style.display=this.bindings.visible.get()?"":"none"}}),O.invisible=v.extend({refresh:function(){this.element.style.display=this.bindings.invisible.get()?"none":""}}),O.html=v.extend({refresh:function(){this.element.innerHTML=this.bindings.html.get()}}),O.value=v.extend({init:function(t,n,i){v.fn.init.call(this,t,n,i),this._change=z(this.change,this),this.eventName=i.valueUpdate||E,e(this.element).on(this.eventName,this._change),this._initChange=!1},change:function(){var e,t;this._initChange=this.eventName!=E,e=this.element.value,t=this.element.type,"date"==t?e=x.parseDate(e,"yyyy-MM-dd"):"datetime-local"==t?e=x.parseDate(e,["yyyy-MM-ddTHH:mm:ss","yyyy-MM-ddTHH:mm"]):"number"==t&&(e=x.parseFloat(e)),this.bindings[A].set(e),this._initChange=!1},refresh:function(){var e,t;this._initChange||(e=this.bindings[A].get(),null==e&&(e=""),t=this.element.type,"date"==t?e=x.toString(e,"yyyy-MM-dd"):"datetime-local"==t&&(e=x.toString(e,"yyyy-MM-ddTHH:mm:ss")),this.element.value=e),this._initChange=!1},destroy:function(){e(this.element).off(this.eventName,this._change)}}),O.source=v.extend({init:function(e,t,n){v.fn.init.call(this,e,t,n);var i=this.bindings.source.get();i instanceof x.data.DataSource&&n.autoBind!==!1&&i.fetch()},refresh:function(e){var t=this,n=t.bindings.source.get();n instanceof T||n instanceof x.data.DataSource?(e=e||{},"add"==e.action?t.add(e.index,e.items):"remove"==e.action?t.remove(e.index,e.items):"itemchange"!=e.action&&t.render()):t.render()},container:function(){var e=this.element;return"table"==e.nodeName.toLowerCase()&&(e.tBodies[0]||e.appendChild(document.createElement("tbody")),e=e.tBodies[0]),e},template:function(){var e=this.options,t=e.template,n=this.container().nodeName.toLowerCase();return t||(t="select"==n?e.valueField||e.textField?x.format('<option value="#:{0}#">#:{1}#</option>',e.valueField||e.textField,e.textField||e.valueField):"<option>#:data#</option>":"tbody"==n?"<tr><td>#:data#</td></tr>":"ul"==n||"ol"==n?"<li>#:data#</li>":"#:data#",t=x.template(t)),t},add:function(t,n){var i,r,o,s,u=this.container(),l=u.cloneNode(!1),c=u.children[t];if(e(l).html(x.render(this.template(),n)),l.children.length)for(i=this.bindings.source._parents(),r=0,o=n.length;o>r;r++)s=l.children[0],u.insertBefore(s,c||null),a(s,n[r],this.options.roles,[n[r]].concat(i))},remove:function(e,t){var n,i,r=this.container();for(n=0;t.length>n;n++)i=r.children[e],l(i),r.removeChild(i)},render:function(){var t,n,i,r=this.bindings.source.get(),o=this.container(),s=this.template();if(r instanceof x.data.DataSource&&(r=r.view()),r instanceof T||"[object Array]"===C.call(r)||(r=[r]),this.bindings.template){if(c(o),e(o).html(this.bindings.template.render(r)),o.children.length)for(t=this.bindings.source._parents(),n=0,i=r.length;i>n;n++)a(o.children[n],r[n],this.options.roles,[r[n]].concat(t))}else e(o).html(x.render(s,r))}}),O.input={checked:v.extend({init:function(t,n,i){v.fn.init.call(this,t,n,i),this._change=z(this.change,this),e(this.element).change(this._change)},change:function(){var e,t,n=this.element,i=this.value();"radio"==n.type?this.bindings[N].set(i):"checkbox"==n.type&&(e=this.bindings[N].get(),e instanceof T?(i=this.element.value,"on"!==i&&"off"!==i&&(t=e.indexOf(i),t>-1?e.splice(t,1):e.push(i))):this.bindings[N].set(i))},refresh:function(){var e=this.bindings[N].get(),t=e,n=this.element;"checkbox"==n.type?(t instanceof T&&(e=this.element.value,t.indexOf(e)>=0&&(e=!0)),n.checked=e===!0):"radio"==n.type&&null!=e&&n.value===""+e&&(n.checked=!0)},value:function(){var e=this.element,t=e.value;return"checkbox"==e.type&&(t=e.checked),t},destroy:function(){e(this.element).off(E,this._change)}})},O.select={value:v.extend({init:function(t,n,i){v.fn.init.call(this,t,n,i),this._change=z(this.change,this),e(this.element).change(this._change)},change:function(){var e,t,n,i,r,o,a=[],s=this.element,u=this.options.valueField||this.options.textField,l=this.options.valuePrimitive;for(r=0,o=s.options.length;o>r;r++)t=s.options[r],t.selected&&(i=t.attributes.value,i=i&&i.specified?t.value:t.text,a.push(i));if(u)for(e=this.bindings.source.get(),n=0;a.length>n;n++)for(r=0,o=e.length;o>r;r++)if(e[r].get(u)==a[n]){a[n]=e[r];break}i=this.bindings[A].get(),i instanceof T?i.splice.apply(i,[0,i.length].concat(a)):l||!(i instanceof k)&&u?this.bindings[A].set(a[0].get(u)):this.bindings[A].set(a[0])},refresh:function(){var e,t,n,i=this.element,r=i.options,o=this.bindings[A].get(),a=o,s=this.options.valueField||this.options.textField,u=!1;for(a instanceof T||(a=new T([o])),i.selectedIndex=-1,n=0;a.length>n;n++)for(o=a[n],s&&o instanceof k&&(o=o.get(s)),e=0;r.length>e;e++)t=r[e].value,""===t&&""!==o&&(t=r[e].text),t==o&&(r[e].selected=!0,u=!0)},destroy:function(){e(this.element).off(E,this._change)}})},O.widget={events:v.extend({init:function(e,t,n){v.fn.init.call(this,e.element[0],t,n),this.widget=e,this.handlers={}},refresh:function(e){var t=this.bindings.events[e],n=this.handlers[e];n&&this.widget.unbind(e,n),n=t.get(),this.handlers[e]=function(e){e.data=t.source,n(e),e.data===t.source&&delete e.data},this.widget.bind(e,this.handlers[e])},destroy:function(){var e;for(e in this.handlers)this.widget.unbind(e,this.handlers[e])}}),checked:v.extend({init:function(e,t,n){v.fn.init.call(this,e.element[0],t,n),this.widget=e,this._change=z(this.change,this),this.widget.bind(E,this._change)},change:function(){this.bindings[N].set(this.value())},refresh:function(){this.widget.check(this.bindings[N].get()===!0)},value:function(){var e=this.element,t=e.value;return("on"==t||"off"==t)&&(t=e.checked),t},destroy:function(){this.widget.unbind(E,this._change)}}),visible:v.extend({init:function(e,t,n){v.fn.init.call(this,e.element[0],t,n),this.widget=e},refresh:function(){var e=this.bindings.visible.get();this.widget.wrapper[0].style.display=e?"":"none"}}),invisible:v.extend({init:function(e,t,n){v.fn.init.call(this,e.element[0],t,n),this.widget=e},refresh:function(){var e=this.bindings.invisible.get();this.widget.wrapper[0].style.display=e?"none":""}}),enabled:v.extend({init:function(e,t,n){v.fn.init.call(this,e.element[0],t,n),this.widget=e},refresh:function(){this.widget.enable&&this.widget.enable(this.bindings.enabled.get())}}),disabled:v.extend({init:function(e,t,n){v.fn.init.call(this,e.element[0],t,n),this.widget=e},refresh:function(){this.widget.enable&&this.widget.enable(!this.bindings.disabled.get())}}),source:v.extend({init:function(e,t,n){var i=this;v.fn.init.call(i,e.element[0],t,n),i.widget=e,i._dataBinding=z(i.dataBinding,i),i._dataBound=z(i.dataBound,i),i._itemChange=z(i.itemChange,i)},itemChange:function(e){a(e.item[0],e.data,this._ns(e.ns),[e.data].concat(this.bindings.source._parents()))},dataBinding:function(){var e,t,n=this.widget,i=n.items();for(e=0,t=i.length;t>e;e++)l(i[e])},_ns:function(t){t=t||x.ui;var n=[x.ui,x.dataviz.ui,x.mobile.ui];return n.splice(e.inArray(t,n),1),n.unshift(t),x.rolesFromNamespaces(n)},dataBound:function(e){var t,i,r,o=this.widget,s=o.items(),u=o.dataSource,l=u.view(),c=u.group()||[];if(s.length)for(c.length&&(l=n(l)),r=this.bindings.source._parents(),t=0,i=l.length;i>t;t++)a(s[t],l[t],this._ns(e.ns),[l[t]].concat(r))},refresh:function(e){var t,n=this,i=n.widget;e=e||{},e.action||(n.destroy(),i.bind("dataBinding",n._dataBinding),i.bind("dataBound",n._dataBound),i.bind("itemChange",n._itemChange),t=n.bindings.source.get(),i.dataSource instanceof x.data.DataSource&&i.dataSource!=t&&(t instanceof x.data.DataSource?i.setDataSource(t):t&&t._dataSource?i.setDataSource(t._dataSource):i.dataSource.data(t)))},destroy:function(){var e=this.widget;e.unbind("dataBinding",this._dataBinding),e.unbind("dataBound",this._dataBound),e.unbind("itemChange",this._itemChange)}}),value:v.extend({init:function(t,n,i){v.fn.init.call(this,t.element[0],n,i),this.widget=t,this._change=e.proxy(this.change,this),this.widget.first(E,this._change);var r=this.bindings.value.get();this._valueIsObservableObject=!i.valuePrimitive&&(null==r||r instanceof k),this._valueIsObservableArray=r instanceof T,this._initChange=!1},change:function(){var e,t,n,i,r,o,a,s=this.widget.value(),u=this.options.dataValueField||this.options.dataTextField,l="[object Array]"===C.call(s),c=this._valueIsObservableObject,d=[];if(this._initChange=!0,u)if(this.bindings.source&&(a=this.bindings.source.get()),""===s&&(c||this.options.valuePrimitive))s=null;else{for((!a||a instanceof x.data.DataSource)&&(a=this.widget.dataSource.view()),l&&(t=s.length,d=s.slice(0)),r=0,o=a.length;o>r;r++)if(n=a[r],i=n.get(u),l){for(e=0;t>e;e++)if(i==d[e]){d[e]=n;break}}else if(i==s){s=c?n:i;break}d[0]&&(s=this._valueIsObservableArray?d:c||!u?d[0]:d[0].get(u))}this.bindings.value.set(s),this._initChange=!1},refresh:function(){if(!this._initChange){var e,n=this.options.dataValueField||this.options.dataTextField,i=this.bindings.value.get(),r=0,o=[];if(i===t&&(i=null),n)if(i instanceof T){for(e=i.length;e>r;r++)o[r]=i[r].get(n);i=o}else i instanceof k&&(i=i.get(n));this.widget.value(i)}this._initChange=!1},destroy:function(){this.widget.unbind(E,this._change)}}),multiselect:{value:v.extend({init:function(t,n,i){v.fn.init.call(this,t.element[0],n,i),this.widget=t,this._change=e.proxy(this.change,this),this.widget.first(E,this._change),this._initChange=!1},change:function(){var e,t,n,i,r,o,a,s,u,l=this,c=l.bindings[A].get(),d=l.options.valuePrimitive,f=d?l.widget.value():l.widget.dataItems(),h=this.options.dataValueField||this.options.dataTextField;if(f=f.slice(0),l._initChange=!0,c instanceof T){for(e=[],t=f.length,n=0,i=0,r=c[n],o=!1;r;){for(u=!1,i=0;t>i;i++)if(d?o=f[i]==r:(s=f[i],s=s.get?s.get(h):s,o=s==(r.get?r.get(h):r)),o){f.splice(i,1),t-=1,u=!0;break}u?n+=1:(e.push(r),y(c,n,1),a=n),r=c[n]}y(c,c.length,0,f),e.length&&c.trigger("change",{action:"remove",items:e,index:a}),f.length&&c.trigger("change",{action:"add",items:f,index:c.length-1})}else l.bindings[A].set(f);l._initChange=!1},refresh:function(){if(!this._initChange){var e,n,i=this.options.dataValueField||this.options.dataTextField,r=this.bindings.value.get(),o=0,a=[];if(r===t&&(r=null),i)if(r instanceof T){for(e=r.length;e>o;o++)n=r[o],a[o]=n.get?n.get(i):n;r=a}else r instanceof k&&(r=r.get(i));this.widget.value(r)}},destroy:function(){this.widget.unbind(E,this._change)}})}},y=function(e,t,n,i){var r,o,a,s,u;if(i=i||[],n=n||0,r=i.length,o=e.length,a=[].slice.call(e,t+n),s=a.length,r){for(r=t+r,u=0;r>t;t++)e[t]=i[u],u++;e.length=r}else if(n)for(e.length=t,n+=t;n>t;)delete e[--n];if(s){for(s=t+s,u=0;s>t;t++)e[t]=a[u],u++;e.length=s}for(t=e.length;o>t;)delete e[t],t++},_=D.extend({init:function(e,t){this.target=e,this.options=t,this.toDestroy=[]},bind:function(e){var t,n,i,r,o=this.target.nodeName.toLowerCase(),a=O[o]||{};for(t in e)t==A?n=!0:t==F?i=!0:t==P?r=!0:this.applyBinding(t,e,a);i&&this.applyBinding(F,e,a),n&&this.applyBinding(A,e,a),r&&this.applyBinding(P,e,a)},applyBinding:function(e,t,n){var i,r=n[e]||O[e],o=this.toDestroy,a=t[e];if(r)if(r=new r(this.target,t,this.options),o.push(r),a instanceof g)r.bind(a),o.push(a);else for(i in a)r.bind(a,i),o.push(a[i]);else if("template"!==e)throw Error("The "+e+" binding is not supported by the "+this.target.nodeName.toLowerCase()+" element")},destroy:function(){var e,t,n=this.toDestroy;for(e=0,t=n.length;t>e;e++)n[e].destroy()}}),b=_.extend({bind:function(e){var t,n=this,i=!1,r=!1,o=O.widget[n.target.options.name.toLowerCase()]||{};for(t in e)t==A?i=!0:t==F?r=!0:n.applyBinding(t,e,o);r&&n.applyBinding(F,e,o),i&&n.applyBinding(A,e,o)},applyBinding:function(e,t,n){var i,r=n[e]||O.widget[e],o=this.toDestroy,a=t[e];if(!r)throw Error("The "+e+" binding is not supported by the "+this.target.options.name+" widget");if(r=new r(this.target,t,this.target.options),o.push(r),a instanceof g)r.bind(a),o.push(a);else for(i in a)r.bind(a,i),o.push(a[i])}}),w=/[A-Za-z0-9_\-]+:(\{([^}]*)\}|[^,}]+)/g,S=/\s/g,x.unbind=d,x.bind=s,x.data.binders=O,x.data.Binder=v,x.notify=f,x.observable=function(e){return e instanceof k||(e=new k(e)),e},x.observableHierarchy=function(e){function t(e){var n,i;for(n=0;e.length>n;n++)e[n]._initChildren(),i=e[n].children,i.fetch(),e[n].items=i.data(),t(e[n].items)}var n=x.data.HierarchicalDataSource.create(e);return n.fetch(),t(n.data()),n._data._dataSource=n,n._data}})(window.kendo.jQuery);(function(e,t){function n(e){return parseInt(e,10)}function i(e,t){return n(e.css(t))}function r(e){var t,n=[];for(t in e)n.push(t);return n}function o(e){for(var t in e)-1!=L.indexOf(t)&&-1==U.indexOf(t)&&delete e[t];return e}function a(e,t){var n,i,r,o,a=[],s={};for(i in t)n=i.toLowerCase(),o=P&&-1!=L.indexOf(n),!z.hasHW3D&&o&&-1==U.indexOf(n)?delete t[i]:(r=t[i],o?a.push(i+"("+r+")"):s[i]=r);return a.length&&(s[st]=a.join(" ")),s}function s(e,t){var i,r,o;return P?(i=e.css(st),i==Y?"scale"==t?1:0:(r=i.match(RegExp(t+"\\s*\\(([\\d\\w\\.]+)")),o=0,r?o=n(r[1]):(r=i.match(H)||[0,0,0,0,0],t=t.toLowerCase(),I.test(t)?o=parseFloat(r[3]/r[2]):"translatey"==t?o=parseFloat(r[4]/r[2]):"scale"==t?o=parseFloat(r[2]):"rotate"==t&&(o=parseFloat(Math.atan2(r[2],r[1])))),o)):parseFloat(e.css(t))}function u(e){return e.charAt(0).toUpperCase()+e.substring(1)}function l(e,t){var n=p.extend(t),i=n.prototype.directions;M[u(e)]=n,M.Element.prototype[e]=function(e,t,i,r){return new n(this.element,e,t,i,r)},C(i,function(t,i){M.Element.prototype[e+u(i)]=function(e,t,r){return new n(this.element,i,e,t,r)}})}function c(e,n,i,r){l(e,{directions:m,startValue:function(e){return this._startValue=e,this},endValue:function(e){return this._endValue=e,this},shouldHide:function(){return this._shouldHide},prepare:function(e,o){var a,s,u=this,l="out"===this._direction,c=u.element.data(n),d=!(isNaN(c)||c==i);a=d?c:t!==this._startValue?this._startValue:l?i:r,s=t!==this._endValue?this._endValue:l?r:i,this._reverse?(e[n]=s,o[n]=a):(e[n]=a,o[n]=s),u._shouldHide=o[n]===r}})}function d(e,t){var n=k.directions[t].vertical,i=e[n?X:Z]()/2+"px";return y[t].replace("$size",i)}var f,h,p,g,m,v,y,_,b,w,x,S,k=window.kendo,M=k.effects,C=e.each,T=e.extend,O=e.proxy,z=k.support,D=z.browser,P=z.transforms,A=z.transitions,F={scale:0,scalex:0,scaley:0,scale3d:0},N={translate:0,translatex:0,translatey:0,translate3d:0},E=t!==document.documentElement.style.zoom&&!P,H=/matrix3?d?\s*\(.*,\s*([\d\.\-]+)\w*?,\s*([\d\.\-]+)\w*?,\s*([\d\.\-]+)\w*?,\s*([\d\.\-]+)\w*?/i,R=/^(-?[\d\.\-]+)?[\w\s]*,?\s*(-?[\d\.\-]+)?[\w\s]*/i,I=/translatex?$/i,q=/(zoom|fade|expand)(\w+)/,B=/(zoom|fade|expand)/,j=/[xy]$/i,L=["perspective","rotate","rotatex","rotatey","rotatez","rotate3d","scale","scalex","scaley","scalez","scale3d","skew","skewx","skewy","translate","translatex","translatey","translatez","translate3d","matrix","matrix3d"],U=["rotate","scale","scalex","scaley","skew","skewx","skewy","translate","translatex","translatey","matrix"],W={rotate:"deg",scale:"",skew:"px",translate:"px"},$=P.css,V=Math.round,G="",J="px",Y="none",Q="auto",Z="width",X="height",K="hidden",et="origin",tt="abortId",nt="overflow",it="translate",rt="position",ot="completeCallback",at=$+"transition",st=$+"transform",ut=$+"backface-visibility",lt=$+"perspective",ct="1500px",dt="perspective("+ct+")",ft={left:{reverse:"right",property:"left",transition:"translatex",vertical:!1,modifier:-1},right:{reverse:"left",property:"left",transition:"translatex",vertical:!1,modifier:1},down:{reverse:"up",property:"top",transition:"translatey",vertical:!0,modifier:1},up:{reverse:"down",property:"top",transition:"translatey",vertical:!0,modifier:-1},top:{reverse:"bottom"},bottom:{reverse:"top"},"in":{reverse:"out",modifier:-1},out:{reverse:"in",modifier:1},vertical:{reverse:"vertical"},horizontal:{reverse:"horizontal"}};k.directions=ft,T(e.fn,{kendoStop:function(e,t){return A?M.stopQueue(this,e||!1,t||!1):this.stop(e,t)}}),P&&!A&&(C(U,function(n,i){e.fn[i]=function(n){if(t===n)return s(this,i);var r=e(this)[0],o=i+"("+n+W[i.replace(j,"")]+")";return-1==r.style.cssText.indexOf(st)?e(this).css(st,o):r.style.cssText=r.style.cssText.replace(RegExp(i+"\\(.*?\\)","i"),o),this},e.fx.step[i]=function(t){e(t.elem)[i](t.now)}}),f=e.fx.prototype.cur,e.fx.prototype.cur=function(){return-1!=U.indexOf(this.prop)?parseFloat(e(this.elem)[this.prop]()):f.apply(this,arguments)}),k.toggleClass=function(e,t,n,i){return t&&(t=t.split(" "),A&&(n=T({exclusive:"all",duration:400,ease:"ease-out"},n),e.css(at,n.exclusive+" "+n.duration+"ms "+n.ease),setTimeout(function(){e.css(at,"").css(X)},n.duration)),C(t,function(t,n){e.toggleClass(n,i)})),e},k.parseEffects=function(e,t){var n={};return"string"==typeof e?C(e.split(" "),function(e,i){var r=!B.test(i),o=i.replace(q,function(e,t,n){return t+":"+n.toLowerCase()}),a=o.split(":"),s=a[1],u={};a.length>1&&(u.direction=t&&r?ft[s].reverse:s),n[a[0]]=u}):C(e,function(e){var i=this.direction;i&&t&&!B.test(e)&&(this.direction=ft[i].reverse),n[e]=this}),n},A&&T(M,{transition:function(t,n,i){var o,s,u,l,c=0,d=t.data("keys")||[];i=T({duration:200,ease:"ease-out",complete:null,exclusive:"all"},i),u=!1,l=function(){u||(u=!0,s&&(clearTimeout(s),s=null),t.removeData(tt).dequeue().css(at,"").css(at),i.complete.call(t))},i.duration=e.fx?e.fx.speeds[i.duration]||i.duration:i.duration,o=a(t,n),e.merge(d,r(o)),t.data("keys",e.unique(d)).height(),t.css(at,i.exclusive+" "+i.duration+"ms "+i.ease).css(at),t.css(o).css(st),A.event&&(t.one(A.event,l),0!==i.duration&&(c=500)),s=setTimeout(l,i.duration+c),t.data(tt,s),t.data(ot,l)},stopQueue:function(e,t,n){var i,r=e.data("keys"),o=!n&&r,a=e.data(ot);return o&&(i=k.getComputedStyles(e[0],r)),a&&a(),o&&e.css(i),e.removeData("keys").stop(t)}}),h=k.Class.extend({init:function(e,t){var n=this;n.element=e,n.effects=[],n.options=t,n.restore=[]},run:function(t){var n,i,r,s,u,l,c,d=this,f=t.length,h=d.element,p=d.options,g=e.Deferred(),m={},v={};for(d.effects=t,g.then(e.proxy(d,"complete")),h.data("animating",!0),i=0;f>i;i++)for(n=t[i],n.setReverse(p.reverse),n.setOptions(p),d.addRestoreProperties(n.restore),n.prepare(m,v),u=n.children(),r=0,l=u.length;l>r;r++)u[r].duration(p.duration).run();for(c in p.effects)T(v,p.effects[c].properties);for(h.is(":visible")||T(m,{display:h.data("olddisplay")||"block"}),P&&!p.reset&&(s=h.data("targetTransform"),s&&(m=T(s,m))),m=a(h,m),P&&!A&&(m=o(m)),h.css(m).css(st),i=0;f>i;i++)t[i].setup();return p.init&&p.init(),h.data("targetTransform",v),M.animate(h,v,T({},p,{complete:g.resolve})),g.promise()},stop:function(){e(this.element).kendoStop(!0,!0)},addRestoreProperties:function(e){for(var t,n=this.element,i=0,r=e.length;r>i;i++)t=e[i],this.restore.push(t),n.data(t)||n.data(t,n.css(t))},restoreCallback:function(){var e,t,n,i=this.element;for(e=0,t=this.restore.length;t>e;e++)n=this.restore[e],i.css(n,i.data(n))},complete:function(){var t=this,n=0,i=t.element,r=t.options,o=t.effects,a=o.length;for(i.removeData("animating").dequeue(),r.hide&&i.data("olddisplay",i.css("display")).hide(),this.restoreCallback(),E&&!P&&setTimeout(e.proxy(this,"restoreCallback"),0);a>n;n++)o[n].teardown();r.completeCallback&&r.completeCallback(i)}}),M.promise=function(e,t){var n,i,r,o=[],a=new h(e,t),s=k.parseEffects(t.effects);t.effects=s;for(r in s)n=M[u(r)],n&&(i=new n(e,s[r].direction),o.push(i));o[0]?a.run(o):(e.is(":visible")||e.css({display:e.data("olddisplay")||"block"}).css("display"),t.init&&t.init(),e.dequeue(),a.complete())},T(M,{animate:function(n,r,a){var s=a.transition!==!1;delete a.transition,A&&"transition"in M&&s?M.transition(n,r,a):P?n.animate(o(r),{queue:!1,show:!1,hide:!1,duration:a.duration,complete:a.complete}):n.each(function(){var n=e(this),o={};C(L,function(e,a){var s,u,l,c,d,f,h,p=r?r[a]+" ":null;p&&(u=r,a in F&&r[a]!==t?(s=p.match(R),P&&T(u,{scale:+s[0]})):a in N&&r[a]!==t&&(l=n.css(rt),c="absolute"==l||"fixed"==l,n.data(it)||(c?n.data(it,{top:i(n,"top")||0,left:i(n,"left")||0,bottom:i(n,"bottom"),right:i(n,"right")}):n.data(it,{top:i(n,"marginTop")||0,left:i(n,"marginLeft")||0})),d=n.data(it),s=p.match(R),s&&(f=a==it+"y"?0:+s[1],h=a==it+"y"?+s[1]:+s[2],c?(isNaN(d.right)?isNaN(f)||T(u,{left:d.left+f}):isNaN(f)||T(u,{right:d.right-f}),isNaN(d.bottom)?isNaN(h)||T(u,{top:d.top+h}):isNaN(h)||T(u,{bottom:d.bottom-h})):(isNaN(f)||T(u,{marginLeft:d.left+f}),isNaN(h)||T(u,{marginTop:d.top+h})))),!P&&"scale"!=a&&a in u&&delete u[a],u&&T(o,u))}),D.msie&&delete o.scale,n.animate(o,{queue:!1,show:!1,hide:!1,duration:a.duration,complete:a.complete})})}}),M.animatedPromise=M.promise,p=k.Class.extend({init:function(e,t){var n=this;n.element=e,n._direction=t,n.options={},n._additionalEffects=[],n.restore||(n.restore=[])},reverse:function(){return this._reverse=!0,this.run()},play:function(){return this._reverse=!1,this.run()},add:function(e){return this._additionalEffects.push(e),this},direction:function(e){return this._direction=e,this},duration:function(e){return this._duration=e,this},compositeRun:function(){var e=this,t=new h(e.element,{reverse:e._reverse,duration:e._duration}),n=e._additionalEffects.concat([e]);return t.run(n)},run:function(){if(this._additionalEffects&&this._additionalEffects[0])return this.compositeRun();var t,n,i=this,r=i.element,s=0,u=i.restore,l=u.length,c=e.Deferred(),d={},f={},h=i.children(),p=h.length;for(c.then(e.proxy(i,"_complete")),r.data("animating",!0),s=0;l>s;s++)t=u[s],r.data(t)||r.data(t,r.css(t));for(s=0;p>s;s++)h[s].duration(i._duration).run();return i.prepare(d,f),r.is(":visible")||T(d,{display:r.data("olddisplay")||"block"}),P&&(n=r.data("targetTransform"),n&&(d=T(n,d))),d=a(r,d),P&&!A&&(d=o(d)),r.css(d).css(st),i.setup(),r.data("targetTransform",f),M.animate(r,f,{duration:i._duration,complete:c.resolve}),c.promise()},stop:function(){var t=0,n=this.children(),i=n.length;for(t=0;i>t;t++)n[t].stop();return e(this.element).kendoStop(!0,!0),this},restoreCallback:function(){var e,t,n,i=this.element;for(e=0,t=this.restore.length;t>e;e++)n=this.restore[e],i.css(n,i.data(n))},_complete:function(){var t=this,n=t.element;n.removeData("animating").dequeue(),t.restoreCallback(),t.shouldHide()&&n.data("olddisplay",n.css("display")).hide(),E&&!P&&setTimeout(e.proxy(t,"restoreCallback"),0),t.teardown()},setOptions:function(e){T(!0,this.options,e)},children:function(){return[]},shouldHide:e.noop,setup:e.noop,prepare:e.noop,teardown:e.noop,directions:[],setReverse:function(e){return this._reverse=e,this}}),g=["left","right","up","down"],m=["in","out"],l("slideIn",{directions:g,divisor:function(e){return this.options.divisor=e,this},prepare:function(e,t){var n,i=this,r=i.element,o=ft[i._direction],a=-o.modifier*(o.vertical?r.outerHeight():r.outerWidth()),s=a/(i.options&&i.options.divisor||1)+J,u="0px";i._reverse&&(n=e,e=t,t=n),P?(e[o.transition]=s,t[o.transition]=u):(e[o.property]=s,t[o.property]=u)}}),l("tile",{directions:g,init:function(e,t,n){p.prototype.init.call(this,e,t),this.options={previous:n}},previousDivisor:function(e){return this.options.previousDivisor=e,this},children:function(){var e=this,t=e._reverse,n=e.options.previous,i=e.options.previousDivisor||1,r=e._direction,o=[k.fx(e.element).slideIn(r).setReverse(t)];return n&&o.push(k.fx(n).slideIn(ft[r].reverse).divisor(i).setReverse(!t)),o}}),c("fade","opacity",1,0),c("zoom","scale",1,.01),l("slideMargin",{prepare:function(e,t){var n,i=this,r=i.element,o=i.options,a=r.data(et),s=o.offset,u=i._reverse;u||null!==a||r.data(et,parseFloat(r.css("margin-"+o.axis))),n=r.data(et)||0,t["margin-"+o.axis]=u?n:n+s}}),l("slideTo",{prepare:function(e,t){var n=this,i=n.element,r=n.options,o=r.offset.split(","),a=n._reverse;P?(t.translatex=a?0:o[0],t.translatey=a?0:o[1]):(t.left=a?0:o[0],t.top=a?0:o[1]),i.css("left")}}),l("expand",{directions:["horizontal","vertical"],restore:[nt],prepare:function(e,n){var i=this,r=i.element,o=i.options,a=i._reverse,s="vertical"===i._direction?X:Z,u=r[0].style[s],l=r.data(s),c=parseFloat(l||u),d=V(r.css(s,Q)[s]());e.overflow=K,c=o&&o.reset?d||c:c||d,n[s]=(a?0:c)+J,e[s]=(a?c:0)+J,l===t&&r.data(s,u)},shouldHide:function(){return this._reverse},teardown:function(){var e=this,t=e.element,n="vertical"===e._direction?X:Z,i=t.data(n);(i==Q||i===G)&&setTimeout(function(){t.css(n,Q).css(n)},0)}}),v={position:"absolute",marginLeft:0,marginTop:0,scale:1},l("transfer",{init:function(e,t){this.element=e,this.options={target:t},this.restore=[]},setup:function(){this.element.appendTo(document.body)},prepare:function(e,t){var n,i,r,o,a,u,l,c,d,f,h,p,g,m=this,y=m.element,_=m.options,b=m._reverse,w=_.target,x=s(y,"scale"),S=w.offset(),k=w.outerHeight()/y.outerHeight();T(e,v),t.scale=1,y.css(st,"scale(1)").css(st),n=y.offset(),y.css(st,"scale("+x+")"),i=0,r=0,o=S.left-n.left,a=S.top-n.top,u=i+y.outerWidth(),l=r,c=o+w.outerWidth(),d=a,f=(a-r)/(o-i),h=(d-l)/(c-u),p=(r-l-f*i+h*u)/(h-f),g=r+f*(p-i),e.top=n.top,e.left=n.left,e.transformOrigin=p+J+" "+g+J,b?e.scale=k:t.scale=k}}),y={top:"rect(auto auto $size auto)",bottom:"rect($size auto auto auto)",left:"rect(auto $size auto auto)",right:"rect(auto auto auto $size)"},_={top:{start:"rotatex(0deg)",end:"rotatex(180deg)"},bottom:{start:"rotatex(-180deg)",end:"rotatex(0deg)"},left:{start:"rotatey(0deg)",end:"rotatey(-180deg)"},right:{start:"rotatey(180deg)",end:"rotatey(0deg)"}},l("turningPage",{directions:g,init:function(e,t,n){p.prototype.init.call(this,e,t),this._container=n},prepare:function(e,t){var n=this,i=n._reverse,r=i?ft[n._direction].reverse:n._direction,o=_[r];
e.zIndex=1,n._clipInHalf&&(e.clip=d(n._container,k.directions[r].reverse)),e[ut]=K,t[st]=dt+(i?o.start:o.end),e[st]=dt+(i?o.end:o.start)},setup:function(){this._container.append(this.element)},face:function(e){return this._face=e,this},shouldHide:function(){var e=this,t=e._reverse,n=e._face;return t&&!n||!t&&n},clipInHalf:function(e){return this._clipInHalf=e,this},temporary:function(){return this.element.addClass("temp-page"),this}}),l("staticPage",{directions:g,init:function(e,t,n){p.prototype.init.call(this,e,t),this._container=n},restore:["clip"],prepare:function(e,t){var n=this,i=n._reverse?ft[n._direction].reverse:n._direction;e.clip=d(n._container,i),e.opacity=.999,t.opacity=1},shouldHide:function(){var e=this,t=e._reverse,n=e._face;return t&&!n||!t&&n},face:function(e){return this._face=e,this}}),l("pageturn",{directions:["horizontal","vertical"],init:function(e,t,n,i){p.prototype.init.call(this,e,t),this.options={},this.options.face=n,this.options.back=i},children:function(){var e,t=this,n=t.options,i="horizontal"===t._direction?"left":"top",r=k.directions[i].reverse,o=t._reverse,a=n.face.clone(!0).removeAttr("id"),s=n.back.clone(!0).removeAttr("id"),u=t.element;return o&&(e=i,i=r,r=e),[k.fx(n.face).staticPage(i,u).face(!0).setReverse(o),k.fx(n.back).staticPage(r,u).setReverse(o),k.fx(a).turningPage(i,u).face(!0).clipInHalf(!0).temporary().setReverse(o),k.fx(s).turningPage(r,u).clipInHalf(!0).temporary().setReverse(o)]},prepare:function(e,t){e[lt]=ct,e.transformStyle="preserve-3d",e.opacity=.999,t.opacity=1},teardown:function(){this.element.find(".temp-page").remove()}}),l("flip",{directions:["horizontal","vertical"],init:function(e,t,n,i){p.prototype.init.call(this,e,t),this.options={},this.options.face=n,this.options.back=i},children:function(){var e,t=this,n=t.options,i="horizontal"===t._direction?"left":"top",r=k.directions[i].reverse,o=t._reverse,a=t.element;return o&&(e=i,i=r,r=e),[k.fx(n.face).turningPage(i,a).face(!0).setReverse(o),k.fx(n.back).turningPage(r,a).setReverse(o)]},prepare:function(e){e[lt]=ct,e.transformStyle="preserve-3d"}}),b=!z.mobileOS.android,w=".km-touch-scrollbar",l("replace",{init:function(t,n,i){p.prototype.init.call(this,t),this._previous=e(n),this._transitionClass=i},duration:function(){throw Error("The replace effect does not support duration setting; the effect duration may be customized through the transition class rule")},_both:function(){return e().add(this._element).add(this._previous)},_containerClass:function(){var e=this._direction,t="k-fx k-fx-start k-fx-"+this._transitionClass;return e&&(t+=" k-fx-"+e),this._reverse&&(t+=" k-fx-reverse"),t},complete:function(t){if(!(!this.deferred||t&&e(t.target).is(w))){var n=this.container;n.removeClass("k-fx-end").removeClass(this._containerClass()).off(A.event,this.completeProxy),this._previous.hide().removeClass("k-fx-current"),this.element.removeClass("k-fx-next"),b&&n.css(nt,""),this.isAbsolute||this._both().css(rt,""),this.deferred.resolve(),delete this.deferred}},run:function(){if(this._additionalEffects&&this._additionalEffects[0])return this.compositeRun();var t,n=this,i=n.element,r=n._previous,o=i.parents().filter(r.parents()).first(),a=n._both(),s=e.Deferred(),u=i.css(rt);return o.length||(o=i.parent()),this.container=o,this.deferred=s,this.isAbsolute="absolute"==u,this.isAbsolute||a.css(rt,"absolute"),b&&(t=o.css(nt),o.css(nt,"hidden")),A?(i.addClass("k-fx-hidden"),o.addClass(this._containerClass()),this.completeProxy=e.proxy(this,"complete"),o.on(A.event,this.completeProxy),k.animationFrame(function(){i.removeClass("k-fx-hidden").addClass("k-fx-next"),r.css("display","").addClass("k-fx-current"),k.animationFrame(function(){o.removeClass("k-fx-start").addClass("k-fx-end")})})):this.complete(),s.promise()},stop:function(){this.complete()}}),x=k.Class.extend({init:function(){var e=this;e._tickProxy=O(e._tick,e),e._started=!1},tick:e.noop,done:e.noop,onEnd:e.noop,onCancel:e.noop,start:function(){this.enabled()&&(this.done()?this.onEnd():(this._started=!0,k.animationFrame(this._tickProxy)))},enabled:function(){return!0},cancel:function(){this._started=!1,this.onCancel()},_tick:function(){var e=this;e._started&&(e.tick(),e.done()?(e._started=!1,e.onEnd()):k.animationFrame(e._tickProxy))}}),S=x.extend({init:function(e){var t=this;T(t,e),x.fn.init.call(t)},done:function(){return this.timePassed()>=this.duration},timePassed:function(){return Math.min(this.duration,new Date-this.startDate)},moveTo:function(e){var t=this,n=t.movable;t.initial=n[t.axis],t.delta=e.location-t.initial,t.duration="number"==typeof e.duration?e.duration:300,t.tick=t._easeProxy(e.ease),t.startDate=new Date,t.start()},_easeProxy:function(e){var t=this;return function(){t.movable.moveAxis(t.axis,e(t.timePassed(),t.initial,t.delta,t.duration))}}}),T(S,{easeOutExpo:function(e,t,n,i){return e==i?t+n:n*(-Math.pow(2,-10*e/i)+1)+t},easeOutBack:function(e,t,n,i,r){return r=1.70158,n*((e=e/i-1)*e*((r+1)*e+r)+1)+t}}),M.Animation=x,M.Transition=S,M.createEffect=l})(window.kendo.jQuery);(function(e){function t(e){if(!e)return{};var t=e.match(g)||[];return{type:t[1],direction:t[3],reverse:"reverse"===t[5]}}var n=window.kendo,i=n.Observable,r="SCRIPT",o="init",a="show",s="hide",u="attach",l="detach",c=/unrecognized expression/,d=i.extend({init:function(e,t){var r=this;t=t||{},i.fn.init.call(r),r.content=e,r.id=n.guid(),r.tagName=t.tagName||"div",r.model=t.model,r._wrap=t.wrap!==!1,r._fragments={},r.bind([o,a,s],t)},render:function(t){var i=this,r=!i.element;return r&&(i.element=i._createElement()),t&&e(t).append(i.element),r&&(n.bind(i.element,i.model),i.trigger(o)),t&&(i._eachFragment(u),i.trigger(a)),i.element},clone:function(){return new f(this)},triggerBeforeShow:function(){return!0},showStart:function(){this.element.css("display","")},showEnd:function(){},hideStart:function(){},hideEnd:function(){this.hide()},hide:function(){this._eachFragment(l),this.element.detach(),this.trigger(s)},destroy:function(){var e=this.element;e&&(n.unbind(e),n.destroy(e),e.remove())},fragments:function(t){e.extend(this._fragments,t)},_eachFragment:function(e){for(var t in this._fragments)this._fragments[t][e](this,t)},_createElement:function(){var t,i,o=this,a=o._wrap,s="<"+o.tagName+" />";try{i=e(document.getElementById(o.content)||o.content),i[0].tagName===r&&(i=i.html())}catch(u){c.test(u.message)&&(i=o.content)}return"string"==typeof i?(t=e(s).append(i),n.stripWhitespace(t[0]),a||(t=t.contents())):(t=i,a&&(t=t.wrapAll(s).parent())),t}}),f=n.Class.extend({init:function(t){e.extend(this,{element:t.element.clone(!0),transition:t.transition,id:t.id}),t.element.parent().append(this.element)},hideStart:e.noop,hideEnd:function(){this.element.remove()}}),h=d.extend({init:function(e,t){d.fn.init.call(this,e,t),this.containers={}},container:function(e){var t=this.containers[e];return t||(t=this._createContainer(e),this.containers[e]=t),t},showIn:function(e,t,n){this.container(e).show(t,n)},_createContainer:function(e){var t,n=this.render(),i=n.find(e);if(!i.length&&n.is(e)){if(!n.is(e))throw Error("can't find a container with the specified "+e+" selector");i=n}return t=new m(i),t.bind("accepted",function(e){e.view.render(i)}),t}}),p=d.extend({attach:function(e,t){e.element.find(t).replaceWith(this.render())},detach:function(){}}),g=/^(\w+)(:(\w+))?( (\w+))?$/,m=i.extend({init:function(e){i.fn.init.call(this),this.container=e,this.history=[],this.view=null,this.running=!1},after:function(){this.running=!1,this.trigger("complete",{view:this.view}),this.trigger("after")},end:function(){this.view.showEnd(),this.previous.hideEnd(),this.after()},show:function(e,i,r){if(!e.triggerBeforeShow())return this.trigger("after"),!1;r=r||e.id;var o=this,a=e===o.view?e.clone():o.view,s=o.history,u=s[s.length-2]||{},l=u.id===r,c=i||(l?s[s.length-1].transition:e.transition),d=t(c);return o.running&&o.effect.stop(),"none"===c&&(c=null),o.trigger("accepted",{view:e}),o.view=e,o.previous=a,o.running=!0,l?s.pop():s.push({id:r,transition:c}),a?(a.hideStart(),c&&n.effects.enabled?(e.element.addClass("k-fx-hidden"),e.showStart(),l&&!i&&(d.reverse=!d.reverse),o.effect=n.fx(e.element).replace(a.element,d.type).direction(d.direction).setReverse(d.reverse),o.effect.run().then(function(){o.end()})):(e.showStart(),o.end()),!0):(e.showStart(),e.showEnd(),o.after(),!0)}});n.ViewContainer=m,n.Fragment=p,n.Layout=h,n.View=d,n.ViewClone=f})(window.kendo.jQuery);(function(){kendo.data.transports.signalr=kendo.data.RemoteTransport.extend({init:function(e){var t,n=e&&e.signalr?e.signalr:{},i=n.promise;if(!i)throw Error('The "promise" option must be set.');if("function"!=typeof i.done||"function"!=typeof i.fail)throw Error('The "promise" option must be a Promise.');if(this.promise=i,t=n.hub,!t)throw Error('The "hub" option must be set.');if("function"!=typeof t.on||"function"!=typeof t.invoke)throw Error('The "hub" option is not a valid SignalR hub proxy.');this.hub=t,kendo.data.RemoteTransport.fn.init.call(this,e)},push:function(e){var t=this.options.signalr.client||{};t.create&&this.hub.on(t.create,e.pushCreate),t.update&&this.hub.on(t.update,e.pushUpdate),t.destroy&&this.hub.on(t.destroy,e.pushDestroy)},_crud:function(e,t){var n,i,r=this.hub,o=this.options.signalr.server;if(!o||!o[t])throw Error(kendo.format('The "server.{0}" option must be set.',t));n=[o[t]],i=this.parameterMap(e.data,t),$.isEmptyObject(i)||n.push(i),this.promise.done(function(){r.invoke.apply(r,n).done(e.success).fail(e.error)})},read:function(e){this._crud(e,"read")},create:function(e){this._crud(e,"create")},update:function(e){this._crud(e,"update")},destroy:function(e){this._crud(e,"destroy")}})})();(function(e){function t(t){var n,i=s.ui.validator.ruleResolvers||{},r={};for(n in i)e.extend(!0,r,i[n].resolve(t));return r}function n(e){return e.replace(/&amp/g,"&amp;").replace(/&quot;/g,'"').replace(/&#39;/g,"'").replace(/&lt;/g,"<").replace(/&gt;/g,">")}function i(e){return e=(e+"").split("."),e.length>1?e[1].length:0}function r(t){return e.parseHTML?e(e.parseHTML(t)):e(t)}function o(t,n){var i,r,o,a,u=e();for(o=0,a=t.length;a>o;o++)i=t[o],d.test(i.className)&&(r=i.getAttribute(s.attr("for")),r===n&&(u=u.add(i)));return u}var a,s=window.kendo,u=s.ui.Widget,l=".kendoValidator",c="k-invalid-msg",d=RegExp(c,"i"),f="k-invalid",h=/^((([a-z]|\d|[!#\$%&'\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+(\.([a-z]|\d|[!#\$%&'\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+)*)|((\x22)((((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(([\x01-\x08\x0b\x0c\x0e-\x1f\x7f]|\x21|[\x23-\x5b]|[\x5d-\x7e]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(\\([\x01-\x09\x0b\x0c\x0d-\x7f]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]))))*(((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(\x22)))@((([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.)+(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))$/i,p=/^(https?|ftp):\/\/(((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:)*@)?(((\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5]))|((([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.)+(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.?)(:\d*)?)(\/((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)+(\/(([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)*)*)?)?(\?((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|[\uE000-\uF8FF]|\/|\?)*)?(\#((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|\/|\?)*)?$/i,g=":input:not(:button,[type=submit],[type=reset],[disabled],[readonly])",m=":checkbox:not([disabled],[readonly])",v="[type=number],[type=range]",y="blur",_="name",b="form",w="novalidate",x=e.proxy,F=function(e,t){return"string"==typeof t&&(t=RegExp("^(?:"+t+")$")),t.test(e)},k=function(e,t,n){var i=e.val();return e.filter(t).length&&""!==i?F(i,n):!0},S=function(e,t){return e.length?null!=e[0].attributes[t]:!1};s.ui.validator||(s.ui.validator={rules:{},messages:{}}),a=u.extend({init:function(n,i){var r=this,o=t(n),a="["+s.attr("validate")+"!=false]";i=i||{},i.rules=e.extend({},s.ui.validator.rules,o.rules,i.rules),i.messages=e.extend({},s.ui.validator.messages,o.messages,i.messages),u.fn.init.call(r,n,i),r._errorTemplate=s.template(r.options.errorTemplate),r.element.is(b)&&r.element.attr(w,w),r._inputSelector=g+a,r._checkboxSelector=m+a,r._errors={},r._attachEvents()},events:["validate"],options:{name:"Validator",errorTemplate:'<span class="k-widget k-tooltip k-tooltip-validation"><span class="k-icon k-warning"> </span> #=message#</span>',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(e){var t=e.filter("[type=checkbox]").length&&!e.is(":checked"),n=e.val();return!(S(e,"required")&&(""===n||!n||t))},pattern:function(e){return e.filter("[type=text],[type=email],[type=url],[type=tel],[type=search],[type=password]").filter("[pattern]").length&&""!==e.val()?F(e.val(),e.attr("pattern")):!0},min:function(e){if(e.filter(v+",["+s.attr("type")+"=number]").filter("[min]").length&&""!==e.val()){var t=parseFloat(e.attr("min"))||0,n=s.parseFloat(e.val());return n>=t}return!0},max:function(e){if(e.filter(v+",["+s.attr("type")+"=number]").filter("[max]").length&&""!==e.val()){var t=parseFloat(e.attr("max"))||0,n=s.parseFloat(e.val());return t>=n}return!0},step:function(e){if(e.filter(v+",["+s.attr("type")+"=number]").filter("[step]").length&&""!==e.val()){var t,n=parseFloat(e.attr("min"))||0,r=parseFloat(e.attr("step"))||1,o=parseFloat(e.val()),a=i(r);return a?(t=Math.pow(10,a),(o-n)*t%(r*t)/Math.pow(100,a)===0):(o-n)%r===0}return!0},email:function(e){return k(e,"[type=email],["+s.attr("type")+"=email]",h)},url:function(e){return k(e,"[type=url],["+s.attr("type")+"=url]",p)},date:function(e){return e.filter("[type^=date],["+s.attr("type")+"=date]").length&&""!==e.val()?null!==s.parseDate(e.val(),e.attr(s.attr("format"))):!0}},validateOnBlur:!0},destroy:function(){u.fn.destroy.call(this),this.element.off(l)},_submit:function(e){return this.validate()?!0:(e.stopPropagation(),e.stopImmediatePropagation(),e.preventDefault(),!1)},_attachEvents:function(){var t=this;t.element.is(b)&&t.element.on("submit"+l,x(t._submit,t)),t.options.validateOnBlur&&(t.element.is(g)?(t.element.on(y+l,function(){t.validateInput(t.element)}),t.element.is(m)&&t.element.on("click"+l,function(){t.validateInput(t.element)})):(t.element.on(y+l,t._inputSelector,function(){t.validateInput(e(this))}),t.element.on("click"+l,t._checkboxSelector,function(){t.validateInput(e(this))})))},validate:function(){var e,t,n,i,r=!1;if(this._errors={},this.element.is(g))r=this.validateInput(this.element);else{for(i=!1,e=this.element.find(this._inputSelector),t=0,n=e.length;n>t;t++)this.validateInput(e.eq(t))||(i=!0);r=!i}return this.trigger("validate",{valid:r}),r},validateInput:function(t){var i,o,a,s,u,l,d,h,p;return t=e(t),i=this,o=i._errorTemplate,a=i._checkValidity(t),s=a.valid,u="."+c,l=t.attr(_)||"",d=i._findMessageContainer(l).add(t.next(u)).hide(),t.removeAttr("aria-invalid"),s||(h=i._extractMessage(t,a.key),i._errors[l]=h,p=r(o({message:n(h)})),i._decorateMessageContainer(p,l),d.replaceWith(p).length||p.insertAfter(t),p.show(),t.attr("aria-invalid",!0)),t.toggleClass(f,!s),s},hideMessages:function(){var e=this,t="."+c,n=e.element;n.is(g)?n.next(t).hide():n.find(t).hide()},_findMessageContainer:function(t){var n,i,r,a=s.ui.validator.messageLocators,u=e();for(i=0,r=this.element.length;r>i;i++)u=u.add(o(this.element[i].getElementsByTagName("*"),t));for(n in a)u=u.add(a[n].locate(this.element,t));return u},_decorateMessageContainer:function(e,t){var n,i=s.ui.validator.messageLocators;e.addClass(c).attr(s.attr("for"),t||"");for(n in i)i[n].decorate(e,t);e.attr("role","alert")},_extractMessage:function(e,t){var n=this,i=n.options.messages[t],r=e.attr(_);return i=s.isFunction(i)?i(e):i,s.format(e.attr(s.attr(t+"-msg"))||e.attr("validationMessage")||e.attr("title")||i||"",r,e.attr(t))},_checkValidity:function(e){var t,n=this.options.rules;for(t in n)if(!n[t](e))return{valid:!1,key:t};return{valid:!0}},errors:function(){var e,t=[],n=this._errors;for(e in n)t.push(n[e]);return t}}),s.ui.plugin(a)})(window.kendo.jQuery);(function(e){function t(e,t){var n=e.x.location,i=e.y.location,r=t.x.location,o=t.y.location,a=n-r,s=i-o;return{center:{x:(n+r)/2,y:(i+o)/2},distance:Math.sqrt(a*a+s*s)}}function n(e){var t,n,i,r=[],a=e.originalEvent,s=e.currentTarget,u=0;if(e.api)r.push({id:2,event:e,target:e.target,currentTarget:e.target,location:e});else if(e.type.match(/touch/))for(n=a?a.changedTouches:[],t=n.length;t>u;u++)i=n[u],r.push({location:i,event:e,target:i.target,currentTarget:s,id:i.identifier});else o.pointers||o.msPointers?r.push({location:a,event:e,target:e.target,currentTarget:s,id:a.pointerId}):r.push({id:1,event:e,target:e.target,currentTarget:s,location:e});return r}function i(e){for(var t=r.eventMap.up.split(" "),n=0,i=t.length;i>n;n++)e(t[n])}var r=window.kendo,o=r.support,a=window.document,s=r.Class,u=r.Observable,l=e.now,c=e.extend,d=o.mobileOS,f=d&&d.android,h=800,p=o.browser.msie?5:0,g="press",m="hold",v="select",y="start",_="move",b="end",w="cancel",x="tap",F="release",k="gesturestart",S="gesturechange",M="gestureend",T="gesturetap",C=s.extend({init:function(e,t){var n=this;n.axis=e,n._updateLocationData(t),n.startLocation=n.location,n.velocity=n.delta=0,n.timeStamp=l()},move:function(e){var t=this,n=e["page"+t.axis],i=l(),r=i-t.timeStamp||1;(n||!f)&&(t.delta=n-t.location,t._updateLocationData(e),t.initialDelta=n-t.startLocation,t.velocity=t.delta/r,t.timeStamp=i)},_updateLocationData:function(e){var t=this,n=t.axis;t.location=e["page"+n],t.client=e["client"+n],t.screen=e["screen"+n]}}),D=s.extend({init:function(e,t,n){c(this,{x:new C("X",n.location),y:new C("Y",n.location),userEvents:e,target:t,currentTarget:n.currentTarget,initialTouch:n.target,id:n.id,pressEvent:n,_moved:!1,_finished:!1})},press:function(){this._holdTimeout=setTimeout(e.proxy(this,"_hold"),this.userEvents.minHold),this._trigger(g,this.pressEvent)},_hold:function(){this._trigger(m,this.pressEvent)},move:function(e){var t=this;if(!t._finished){if(t.x.move(e.location),t.y.move(e.location),!t._moved){if(t._withinIgnoreThreshold())return;if(z.current&&z.current!==t.userEvents)return t.dispose();t._start(e)}t._finished||t._trigger(_,e)}},end:function(e){var t=this;t.endTime=l(),t._finished||(t._finished=!0,t._moved?t._trigger(b,e):t._trigger(x,e),clearTimeout(t._holdTimeout),t._trigger(F,e),t.dispose())},dispose:function(){var t=this.userEvents,n=t.touches;this._finished=!0,this.pressEvent=null,clearTimeout(this._holdTimeout),n.splice(e.inArray(this,n),1)},skip:function(){this.dispose()},cancel:function(){this.dispose()},isMoved:function(){return this._moved},_start:function(e){clearTimeout(this._holdTimeout),this.startTime=l(),this._moved=!0,this._trigger(y,e)},_trigger:function(e,t){var n=this,i=t.event,r={touch:n,x:n.x,y:n.y,target:n.target,event:i};n.userEvents.notify(e,r)&&i.preventDefault()},_withinIgnoreThreshold:function(){var e=this.x.initialDelta,t=this.y.initialDelta;return Math.sqrt(e*e+t*t)<=this.userEvents.threshold}}),z=u.extend({init:function(t,n){var s,l,d,f=this,C=r.guid();n=n||{},s=f.filter=n.filter,f.threshold=n.threshold||p,f.minHold=n.minHold||h,f.touches=[],f._maxTouches=n.multiTouch?2:1,f.allowSelection=n.allowSelection,f.captureUpIfMoved=n.captureUpIfMoved,f.eventNS=C,t=e(t).handler(f),u.fn.init.call(f),c(f,{element:t,surface:n.global?e(a.documentElement):e(n.surface||t),stopPropagation:n.stopPropagation,pressed:!1}),f.surface.handler(f).on(r.applyEventMap("move",C),"_move").on(r.applyEventMap("up cancel",C),"_end"),t.on(r.applyEventMap("down",C),s,"_start"),(o.pointers||o.msPointers)&&t.css("-ms-touch-action","pinch-zoom double-tap-zoom"),n.preventDragEvent&&t.on(r.applyEventMap("dragstart",C),r.preventDefault),t.on(r.applyEventMap("mousedown",C),s,{root:t},"_select"),f.captureUpIfMoved&&o.eventCapture&&(l=f.surface[0],d=e.proxy(f.preventIfMoving,f),i(function(e){l.addEventListener(e,d,!0)})),f.bind([g,m,x,y,_,b,F,w,k,S,M,T,v],n)},preventIfMoving:function(e){this._isMoved()&&e.preventDefault()},destroy:function(){var e,t=this;t._destroyed||(t._destroyed=!0,t.captureUpIfMoved&&o.eventCapture&&(e=t.surface[0],i(function(n){e.removeEventListener(n,t.preventIfMoving)})),t.element.kendoDestroy(t.eventNS),t.surface.kendoDestroy(t.eventNS),t.element.removeData("handler"),t.surface.removeData("handler"),t._disposeAll(),t.unbind(),delete t.surface,delete t.element,delete t.currentTarget)},capture:function(){z.current=this},cancel:function(){this._disposeAll(),this.trigger(w)},notify:function(e,n){var i=this,r=i.touches;if(this._isMultiTouch()){switch(e){case _:e=S;break;case b:e=M;break;case x:e=T}c(n,{touches:r},t(r[0],r[1]))}return this.trigger(e,n)},press:function(e,t,n){this._apiCall("_start",e,t,n)},move:function(e,t){this._apiCall("_move",e,t)},end:function(e,t){this._apiCall("_end",e,t)},_isMultiTouch:function(){return this.touches.length>1},_maxTouchesReached:function(){return this.touches.length>=this._maxTouches},_disposeAll:function(){for(var e=this.touches;e.length>0;)e.pop().dispose()},_isMoved:function(){return e.grep(this.touches,function(e){return e.isMoved()}).length},_select:function(e){(!this.allowSelection||this.trigger(v,{event:e}))&&e.preventDefault()},_start:function(t){var i,r,o=this,a=0,s=o.filter,u=n(t),l=u.length,c=t.which;if(!(c&&c>1||o._maxTouchesReached()))for(z.current=null,o.currentTarget=t.currentTarget,o.stopPropagation&&t.stopPropagation();l>a&&!o._maxTouchesReached();a++)r=u[a],i=s?e(r.currentTarget):o.element,i.length&&(r=new D(o,i,r),o.touches.push(r),r.press(),o._isMultiTouch()&&o.notify("gesturestart",{}))},_move:function(e){this._eachTouch("move",e)},_end:function(e){this._eachTouch("end",e)},_eachTouch:function(e,t){var i,r,o,a,s=this,u={},l=n(t),c=s.touches;for(i=0;c.length>i;i++)r=c[i],u[r.id]=r;for(i=0;l.length>i;i++)o=l[i],a=u[o.id],a&&a[e](o)},_apiCall:function(t,n,i,r){this[t]({api:!0,pageX:n,pageY:i,clientX:n,clientY:i,target:e(r||this.element)[0],stopPropagation:e.noop,preventDefault:e.noop})}});z.minHold=function(e){h=e},r.getTouches=n,r.touchDelta=t,r.UserEvents=z})(window.kendo.jQuery);(function(e,t){function n(t,n){try{return e.contains(t,n)||t==n}catch(i){return!1}}function i(e,t){return parseInt(e.css(t),10)||0}function r(e,t){return Math.min(Math.max(e,t.min),t.max)}function o(e,t){var n=x(e),r=n.left+i(e,"borderLeftWidth")+i(e,"paddingLeft"),o=n.top+i(e,"borderTopWidth")+i(e,"paddingTop"),a=r+e.width()-t.outerWidth(!0),s=o+e.height()-t.outerHeight(!0);return{x:{min:r,max:a},y:{min:o,max:s}}}function a(e,n,i){for(var r,o,a=0,s=n&&n.length,u=i&&i.length;e&&e.parentNode;){for(a=0;s>a;a++)if(r=n[a],r.element[0]===e)return{target:r,targetElement:e};for(a=0;u>a;a++)if(o=i[a],p.matchesSelector.call(e,o.options.filter))return{target:o,targetElement:e};e=e.parentNode}return t}var s,u,l,c,d,f,h=window.kendo,p=h.support,g=window.document,m=h.Class,v=h.ui.Widget,y=h.Observable,_=h.UserEvents,b=e.proxy,w=e.extend,x=h.getOffset,F={},k={},S={},M=h.elementUnderCursor,T="keyup",C="change",D="dragstart",E="hold",z="drag",O="dragend",A="dragcancel",P="dragenter",N="dragleave",H="drop",R=y.extend({init:function(t,n){var i=this,r=t[0];i.capture=!1,r.addEventListener?(e.each(h.eventMap.down.split(" "),function(){r.addEventListener(this,b(i._press,i),!0)}),e.each(h.eventMap.up.split(" "),function(){r.addEventListener(this,b(i._release,i),!0)})):(e.each(h.eventMap.down.split(" "),function(){r.attachEvent(this,b(i._press,i))}),e.each(h.eventMap.up.split(" "),function(){r.attachEvent(this,b(i._release,i))})),y.fn.init.call(i),i.bind(["press","release"],n||{})},captureNext:function(){this.capture=!0},cancelCapture:function(){this.capture=!1},_press:function(e){var t=this;t.trigger("press"),t.capture&&e.preventDefault()},_release:function(e){var t=this;t.trigger("release"),t.capture&&(e.preventDefault(),t.cancelCapture())}}),I=y.extend({init:function(t){var n=this;y.fn.init.call(n),n.forcedEnabled=!1,e.extend(n,t),n.scale=1,n.horizontal?(n.measure="offsetWidth",n.scrollSize="scrollWidth",n.axis="x"):(n.measure="offsetHeight",n.scrollSize="scrollHeight",n.axis="y")},makeVirtual:function(){e.extend(this,{virtual:!0,forcedEnabled:!0,_virtualMin:0,_virtualMax:0})},virtualSize:function(e,t){(this._virtualMin!==e||this._virtualMax!==t)&&(this._virtualMin=e,this._virtualMax=t,this.update())},outOfBounds:function(e){return e>this.max||this.min>e},forceEnabled:function(){this.forcedEnabled=!0},getSize:function(){return this.container[0][this.measure]},getTotal:function(){return this.element[0][this.scrollSize]},rescale:function(e){this.scale=e},update:function(e){var t=this,n=t.virtual?t._virtualMax:t.getTotal(),i=n*t.scale,r=t.getSize();t.max=t.virtual?-t._virtualMin:0,t.size=r,t.total=i,t.min=Math.min(t.max,r-i),t.minScale=r/n,t.centerOffset=(i-r)/2,t.enabled=t.forcedEnabled||i>r,e||t.trigger(C,t)}}),q=y.extend({init:function(e){var t=this;y.fn.init.call(t),t.x=new I(w({horizontal:!0},e)),t.y=new I(w({horizontal:!1},e)),t.container=e.container,t.forcedMinScale=e.minScale,t.maxScale=e.maxScale||100,t.bind(C,e)},rescale:function(e){this.x.rescale(e),this.y.rescale(e),this.refresh()},centerCoordinates:function(){return{x:Math.min(0,-this.x.centerOffset),y:Math.min(0,-this.y.centerOffset)}},refresh:function(){var e=this;e.x.update(),e.y.update(),e.enabled=e.x.enabled||e.y.enabled,e.minScale=e.forcedMinScale||Math.min(e.x.minScale,e.y.minScale),e.fitScale=Math.max(e.x.minScale,e.y.minScale),e.trigger(C)}}),L=y.extend({init:function(e){var t=this;w(t,e),y.fn.init.call(t)},outOfBounds:function(){return this.dimension.outOfBounds(this.movable[this.axis])},dragMove:function(e){var t=this,n=t.dimension,i=t.axis,r=t.movable,o=r[i]+e;n.enabled&&((n.min>o&&0>e||o>n.max&&e>0)&&(e*=t.resistance),r.translateAxis(i,e),t.trigger(C,t))}}),B=m.extend({init:function(e){var t,n,i,r,o=this;w(o,{elastic:!0},e),i=o.elastic?.5:0,r=o.movable,o.x=t=new L({axis:"x",dimension:o.dimensions.x,resistance:i,movable:r}),o.y=n=new L({axis:"y",dimension:o.dimensions.y,resistance:i,movable:r}),o.userEvents.bind(["move","end","gesturestart","gesturechange"],{gesturestart:function(e){o.gesture=e,o.offset=o.dimensions.container.offset()},gesturechange:function(e){var i,a,s,u=o.gesture,l=u.center,c=e.center,d=e.distance/u.distance,f=o.dimensions.minScale,h=o.dimensions.maxScale;f>=r.scale&&1>d&&(d+=.8*(1-d)),r.scale*d>=h&&(d=h/r.scale),a=r.x+o.offset.left,s=r.y+o.offset.top,i={x:(a-l.x)*d+c.x-a,y:(s-l.y)*d+c.y-s},r.scaleWith(d),t.dragMove(i.x),n.dragMove(i.y),o.dimensions.rescale(r.scale),o.gesture=e,e.preventDefault()},move:function(e){e.event.target.tagName.match(/textarea|input/i)||(t.dimension.enabled||n.dimension.enabled?(t.dragMove(e.x.delta),n.dragMove(e.y.delta),e.preventDefault()):e.touch.skip())},end:function(e){e.preventDefault()}})}}),j=p.transitions.prefix+"Transform";u=p.hasHW3D?function(e,t,n){return"translate3d("+e+"px,"+t+"px,0) scale("+n+")"}:function(e,t,n){return"translate("+e+"px,"+t+"px) scale("+n+")"},l=y.extend({init:function(t){var n=this;y.fn.init.call(n),n.element=e(t),n.element[0].style.webkitTransformOrigin="left top",n.x=0,n.y=0,n.scale=1,n._saveCoordinates(u(n.x,n.y,n.scale))},translateAxis:function(e,t){this[e]+=t,this.refresh()},scaleTo:function(e){this.scale=e,this.refresh()},scaleWith:function(e){this.scale*=e,this.refresh()},translate:function(e){this.x+=e.x,this.y+=e.y,this.refresh()},moveAxis:function(e,t){this[e]=t,this.refresh()},moveTo:function(e){w(this,e),this.refresh()},refresh:function(){var e,t=this,n=t.x,i=t.y;t.round&&(n=Math.round(n),i=Math.round(i)),e=u(n,i,t.scale),e!=t.coordinates&&(h.support.browser.msie&&10>h.support.browser.version?(t.element[0].style.position="absolute",t.element[0].style.left=t.x+"px",t.element[0].style.top=t.y+"px"):t.element[0].style[j]=e,t._saveCoordinates(e),t.trigger(C))},_saveCoordinates:function(e){this.coordinates=e}}),c=v.extend({init:function(e,t){var n,i=this;v.fn.init.call(i,e,t),n=i.options.group,n in k?k[n].push(i):k[n]=[i]},events:[P,N,H],options:{name:"DropTarget",group:"default"},destroy:function(){var e,t=this.options.group,n=k[t]||S[t];if(n.length>1){for(v.fn.destroy.call(this),e=0;n.length>e;e++)if(n[e]==this){n.splice(e,1);break}}else c.destroyGroup(t)},_trigger:function(e,n){var i=this,r=F[i.options.group];return r?i.trigger(e,w({},n.event,{draggable:r,dropTarget:n.dropTarget})):t},_over:function(e){this._trigger(P,e)},_out:function(e){this._trigger(N,e)},_drop:function(e){var t=this,n=F[t.options.group];n&&(n.dropped=!t._trigger(H,e))}}),c.destroyGroup=function(e){var t,n=k[e]||S[e];if(n){for(t=0;n.length>t;t++)v.fn.destroy.call(n[t]);n.length=0,delete k[e],delete S[e]}},c._cache=k,d=c.extend({init:function(e,t){var n,i=this;v.fn.init.call(i,e,t),n=i.options.group,n in S?S[n].push(i):S[n]=[i]},options:{name:"DropTargetArea",group:"default",filter:null}}),f=v.extend({init:function(e,t){var n=this;v.fn.init.call(n,e,t),n._activated=!1,n.userEvents=new _(n.element,{global:!0,allowSelection:!0,filter:n.options.filter,threshold:n.options.distance,start:b(n._start,n),hold:b(n._hold,n),move:b(n._drag,n),end:b(n._end,n),cancel:b(n._cancel,n),select:b(n._select,n)}),n._afterEndHandler=b(n._afterEnd,n),n._captureEscape=b(n._captureEscape,n)},events:[E,D,z,O,A],options:{name:"Draggable",distance:5,group:"default",cursorOffset:null,axis:null,container:null,filter:null,ignore:null,holdToDrag:!1,dropped:!1},cancelHold:function(){this._activated=!1},_captureEscape:function(e){var t=this;e.keyCode===h.keys.ESC&&(t._trigger(A,{event:e}),t.userEvents.cancel())},_updateHint:function(t){var n,i=this,o=i.options,a=i.boundaries,s=o.axis,u=i.options.cursorOffset;u?n={left:t.x.location+u.left,top:t.y.location+u.top}:(i.hintOffset.left+=t.x.delta,i.hintOffset.top+=t.y.delta,n=e.extend({},i.hintOffset)),a&&(n.top=r(n.top,a.y),n.left=r(n.left,a.x)),"x"===s?delete n.top:"y"===s&&delete n.left,i.hint.css(n)},_shouldIgnoreTarget:function(t){var n=this.options.ignore;return n&&e(t).is(n)},_select:function(e){this._shouldIgnoreTarget(e.event.target)||e.preventDefault()},_start:function(n){var i,r=this,a=r.options,s=a.container,u=a.hint;return this._shouldIgnoreTarget(n.touch.initialTouch)||a.holdToDrag&&!r._activated?(r.userEvents.cancel(),t):(r.currentTarget=n.target,r.currentTargetOffset=x(r.currentTarget),u&&(r.hint&&r.hint.stop(!0,!0).remove(),r.hint=h.isFunction(u)?e(u.call(r,r.currentTarget)):u,i=x(r.currentTarget),r.hintOffset=i,r.hint.css({position:"absolute",zIndex:2e4,left:i.left,top:i.top}).appendTo(g.body)),F[a.group]=r,r.dropped=!1,s&&(r.boundaries=o(s,r.hint)),r._trigger(D,n)&&(r.userEvents.cancel(),r._afterEnd()),e(g).on(T,r._captureEscape),t)},_hold:function(e){this.currentTarget=e.target,this._trigger(E,e)?this.userEvents.cancel():this._activated=!0},_drag:function(n){var i=this;n.preventDefault(),i._withDropTarget(n,function(i,r){if(!i)return s&&(s._trigger(N,w(n,{dropTarget:e(s.targetElement)})),s=null),t;
if(s){if(r===s.targetElement)return;s._trigger(N,w(n,{dropTarget:e(s.targetElement)}))}i._trigger(P,w(n,{dropTarget:e(r)})),s=w(i,{targetElement:r})}),i._trigger(z,n),i.hint&&i._updateHint(n)},_end:function(t){var n=this;n._withDropTarget(t,function(n,i){n&&(n._drop(w({},t,{dropTarget:e(i)})),s=null)}),n._trigger(O,t),n._cancel(t.event)},_cancel:function(){var e=this;e._activated=!1,e.hint&&!e.dropped?setTimeout(function(){e.hint.stop(!0,!0).animate(e.currentTargetOffset,"fast",e._afterEndHandler)},0):e._afterEnd()},_trigger:function(e,t){var n=this;return n.trigger(e,w({},t.event,{x:t.x,y:t.y,currentTarget:n.currentTarget,dropTarget:t.dropTarget}))},_withDropTarget:function(e,t){var i,r,o=this,s=o.options,u=k[s.group],l=S[s.group];(u&&u.length||l&&l.length)&&(i=M(e),o.hint&&n(o.hint[0],i)&&(o.hint.hide(),i=M(e),i||(i=M(e)),o.hint.show()),r=a(i,u,l),r?t(r.target,r.targetElement):t())},destroy:function(){var e=this;v.fn.destroy.call(e),e._afterEnd(),e.userEvents.destroy(),e.currentTarget=null},_afterEnd:function(){var t=this;t.hint&&t.hint.remove(),delete F[t.options.group],t.trigger("destroy"),e(g).off(T,t._captureEscape)}}),h.ui.plugin(c),h.ui.plugin(d),h.ui.plugin(f),h.TapCapture=R,h.containerBoundaries=o,w(h.ui,{Pane:B,PaneDimensions:q,Movable:l})})(window.kendo.jQuery);(function(e,t){var n=window.kendo,i=n.mobile,r=n.effects,o=i.ui,a=e.proxy,s=e.extend,u=o.Widget,l=n.Class,c=n.ui.Movable,d=n.ui.Pane,f=n.ui.PaneDimensions,h=r.Transition,p=r.Animation,g=Math.abs,m=500,v=.7,y=.96,_=10,b=55,w=.5,x=5,F="km-scroller-release",k="km-scroller-refresh",S="pull",T="change",M="resize",C="scroll",D=2,E=p.extend({init:function(e){var t=this;p.fn.init.call(t),s(t,e),t.userEvents.bind("gestureend",a(t.start,t)),t.tapCapture.bind("press",a(t.cancel,t))},enabled:function(){return this.dimensions.minScale>this.movable.scale},done:function(){return.01>this.dimensions.minScale-this.movable.scale},tick:function(){var e=this.movable;e.scaleWith(1.1),this.dimensions.rescale(e.scale)},onEnd:function(){var e=this.movable;e.scaleTo(this.dimensions.minScale),this.dimensions.rescale(e.scale)}}),z=p.extend({init:function(e){var t=this;p.fn.init.call(t),s(t,e,{transition:new h({axis:e.axis,movable:e.movable,onEnd:function(){t._end()}})}),t.tapCapture.bind("press",function(){t.cancel()}),t.userEvents.bind("end",a(t.start,t)),t.userEvents.bind("gestureend",a(t.start,t)),t.userEvents.bind("tap",a(t.onEnd,t))},onCancel:function(){this.transition.cancel()},freeze:function(e){var t=this;t.cancel(),t._moveTo(e)},onEnd:function(){var e=this;e.paneAxis.outOfBounds()?e._snapBack():e._end()},done:function(){return g(this.velocity)<1},start:function(e){var t,n=this;n.dimension.enabled&&(n.paneAxis.outOfBounds()?n._snapBack():(t=e.touch.id===D?0:e.touch[n.axis].velocity,n.velocity=Math.max(Math.min(t*n.velocityMultiplier,b),-b),n.tapCapture.captureNext(),p.fn.start.call(n)))},tick:function(){var e=this,t=e.dimension,n=e.paneAxis.outOfBounds()?w:e.friction,i=e.velocity*=n,r=e.movable[e.axis]+i;!e.elastic&&t.outOfBounds(r)&&(r=Math.max(Math.min(r,t.max),t.min),e.velocity=0),e.movable.moveAxis(e.axis,r)},_end:function(){this.tapCapture.cancelCapture(),this.end()},_snapBack:function(){var e=this,t=e.dimension,n=e.movable[e.axis]>t.max?t.max:t.min;e._moveTo(n)},_moveTo:function(e){this.transition.moveTo({location:e,duration:m,ease:h.easeOutExpo})}}),O=p.extend({init:function(e){var t=this;n.effects.Animation.fn.init.call(this),s(t,e,{origin:{},destination:{},offset:{}})},tick:function(){this._updateCoordinates(),this.moveTo(this.origin)},done:function(){return g(this.offset.y)<x&&g(this.offset.x)<x},onEnd:function(){this.moveTo(this.destination)},setCoordinates:function(e,t){this.offset={},this.origin=e,this.destination=t},_updateCoordinates:function(){this.offset={x:(this.destination.x-this.origin.x)/4,y:(this.destination.y-this.origin.y)/4},this.origin={y:this.origin.y+this.offset.y,x:this.origin.x+this.offset.x}}}),A=l.extend({init:function(t){var n=this,i="x"===t.axis,r=e('<div class="km-touch-scrollbar km-'+(i?"horizontal":"vertical")+'-scrollbar" />');s(n,t,{element:r,elementSize:0,movable:new c(r),scrollMovable:t.movable,size:i?"width":"height"}),n.scrollMovable.bind(T,a(n._move,n)),n.container.append(r)},_move:function(){var e=this,t=e.axis,n=e.dimension,i=n.size,r=e.scrollMovable,o=i/n.total,a=Math.round(-r[t]*o),s=Math.round(i*o);a+s>i?s=i-a:0>a&&(s+=a,a=0),e.elementSize!=s&&(e.element.css(e.size,s+"px"),e.elementSize=s),e.movable.moveAxis(t,a)},show:function(){this.element.css({opacity:v,visibility:"visible"})},hide:function(){this.element.css({opacity:0})}}),P=u.extend({init:function(i,r){var o,l,h,p,m,v,y,_,b,w=this;return u.fn.init.call(w,i,r),i=w.element,(w._native=w.options.useNative&&n.support.hasNativeScrolling)?(i.addClass("km-native-scroller").prepend('<div class="km-scroll-header"/>'),s(w,{scrollElement:i,fixedContainer:i.children().first()}),t):(i.css("overflow","hidden").addClass("km-scroll-wrapper").wrapInner('<div class="km-scroll-container"/>').prepend('<div class="km-scroll-header"/>'),o=i.children().eq(1),l=new n.TapCapture(i),h=new c(o),p=new f({element:o,container:i,forcedEnabled:w.options.zoom}),m=this.options.avoidScrolling,v=new n.UserEvents(i,{allowSelection:!0,preventDragEvent:!0,captureUpIfMoved:!0,multiTouch:w.options.zoom,start:function(t){p.refresh();var n=g(t.x.velocity),i=g(t.y.velocity),r=2*n>=i,o=e.contains(w.fixedContainer[0],t.event.target),a=2*i>=n;!o&&!m(t)&&w.enabled&&(p.x.enabled&&r||p.y.enabled&&a)?v.capture():v.cancel()}}),y=new d({movable:h,dimensions:p,userEvents:v,elastic:w.options.elastic}),_=new E({movable:h,dimensions:p,userEvents:v,tapCapture:l}),b=new O({moveTo:function(e){w.scrollTo(e.x,e.y)}}),h.bind(T,function(){w.scrollTop=-h.y,w.scrollLeft=-h.x,w.trigger(C,{scrollTop:w.scrollTop,scrollLeft:w.scrollLeft})}),w.options.mousewheelScrolling&&i.on("DOMMouseScroll mousewheel",a(this,"_wheelScroll")),s(w,{movable:h,dimensions:p,zoomSnapBack:_,animatedScroller:b,userEvents:v,pane:y,tapCapture:l,pulled:!1,enabled:!0,scrollElement:o,scrollTop:0,scrollLeft:0,fixedContainer:i.children().first()}),w._initAxis("x"),w._initAxis("y"),w._wheelEnd=function(){w._wheel=!1,w.userEvents.end(0,w._wheelY)},p.refresh(),w.options.pullToRefresh&&w._initPullToRefresh(),t)},_wheelScroll:function(e){this._wheel||(this._wheel=!0,this._wheelY=0,this.userEvents.press(0,this._wheelY)),clearTimeout(this._wheelTimeout),this._wheelTimeout=setTimeout(this._wheelEnd,50);var t=n.wheelDeltaY(e);t&&(this._wheelY+=t,this.userEvents.move(0,this._wheelY)),e.preventDefault()},makeVirtual:function(){this.dimensions.y.makeVirtual()},virtualSize:function(e,t){this.dimensions.y.virtualSize(e,t)},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:!1,pullOffset:140,elastic:!0,useNative:!1,mousewheelScrolling:!0,avoidScrolling:function(){return!1},pullToRefresh:!1,pullTemplate:"Pull to refresh",releaseTemplate:"Release to refresh",refreshTemplate:"Refreshing"},events:[S,C,M],_resize:function(){this._native||this.contentResized()},setOptions:function(e){var t=this;u.fn.setOptions.call(t,e),e.pullToRefresh&&t._initPullToRefresh()},reset:function(){this._native?this.scrollElement.scrollTop(0):(this.movable.moveTo({x:0,y:0}),this._scale(1))},contentResized:function(){this.dimensions.refresh(),this.pane.x.outOfBounds()&&this.movable.moveAxis("x",this.dimensions.x.min),this.pane.y.outOfBounds()&&this.movable.moveAxis("y",this.dimensions.y.min)},zoomOut:function(){var e=this.dimensions;e.refresh(),this._scale(e.fitScale),this.movable.moveTo(e.centerCoordinates())},enable:function(){this.enabled=!0},disable:function(){this.enabled=!1},scrollTo:function(e,t){this._native?(this.scrollElement.scrollLeft(g(e)),this.scrollElement.scrollTop(g(t))):(this.dimensions.refresh(),this.movable.moveTo({x:e,y:t}))},animatedScrollTo:function(e,t){var n,i;this._native?this.scrollTo(e,t):(n={x:this.movable.x,y:this.movable.y},i={x:e,y:t},this.animatedScroller.setCoordinates(n,i),this.animatedScroller.start())},pullHandled:function(){var e=this;e.refreshHint.removeClass(k),e.hintContainer.html(e.pullTemplate({})),e.yinertia.onEnd(),e.xinertia.onEnd(),e.userEvents.cancel()},destroy:function(){u.fn.destroy.call(this),this.userEvents&&this.userEvents.destroy()},_scale:function(e){this.dimensions.rescale(e),this.movable.scaleTo(e)},_initPullToRefresh:function(){var e=this;e.dimensions.y.forceEnabled(),e.pullTemplate=n.template(e.options.pullTemplate),e.releaseTemplate=n.template(e.options.releaseTemplate),e.refreshTemplate=n.template(e.options.refreshTemplate),e.scrollElement.prepend('<span class="km-scroller-pull"><span class="km-icon"></span><span class="km-loading-left"></span><span class="km-loading-right"></span><span class="km-template">'+e.pullTemplate({})+"</span></span>"),e.refreshHint=e.scrollElement.children().first(),e.hintContainer=e.refreshHint.children(".km-template"),e.pane.y.bind("change",a(e._paneChange,e)),e.userEvents.bind("end",a(e._dragEnd,e))},_dragEnd:function(){var e=this;e.pulled&&(e.pulled=!1,e.refreshHint.removeClass(F).addClass(k),e.hintContainer.html(e.refreshTemplate({})),e.yinertia.freeze(e.options.pullOffset/2),e.trigger("pull"))},_paneChange:function(){var e=this;e.movable.y/w>e.options.pullOffset?e.pulled||(e.pulled=!0,e.refreshHint.removeClass(k).addClass(F),e.hintContainer.html(e.releaseTemplate({}))):e.pulled&&(e.pulled=!1,e.refreshHint.removeClass(F),e.hintContainer.html(e.pullTemplate({})))},_initAxis:function(e){var t=this,n=t.movable,i=t.dimensions[e],r=t.tapCapture,o=t.pane[e],a=new A({axis:e,movable:n,dimension:i,container:t.element});o.bind(T,function(){a.show()}),t[e+"inertia"]=new z({axis:e,paneAxis:o,movable:n,tapCapture:r,userEvents:t.userEvents,dimension:i,elastic:t.options.elastic,friction:t.options.friction||y,velocityMultiplier:t.options.velocityMultiplier||_,end:function(){a.hide(),t.trigger("scrollEnd",{axis:e,scrollTop:t.scrollTop,scrollLeft:t.scrollLeft})}})}});o.plugin(P)})(window.kendo.jQuery);(function(e,t){function n(e){return e.position().top+3}var i=window.kendo,r=i.ui.Widget,o=e.proxy,a=!1,s=".kendoGroupable",u="change",l=i.template('<div class="k-group-indicator" data-#=data.ns#field="${data.field}" data-#=data.ns#title="${data.title || ""}" data-#=data.ns#dir="${data.dir || "asc"}"><a href="\\#" class="k-link"><span class="k-icon k-si-arrow-${(data.dir || "asc") == "asc" ? "n" : "s"}">(sorted ${(data.dir || "asc") == "asc" ? "ascending": "descending"})</span>${data.title ? data.title: data.field}</a><a class="k-button k-button-icon k-button-bare"><span class="k-icon k-group-delete"></span></a></div>',{useWithBlock:!1}),c=function(t){return e('<div class="k-header k-drag-clue" />').css({width:t.width(),paddingLeft:t.css("paddingLeft"),paddingRight:t.css("paddingRight"),lineHeight:t.height()+"px",paddingTop:t.css("paddingTop"),paddingBottom:t.css("paddingBottom")}).html(t.attr(i.attr("title"))||t.attr(i.attr("field"))).prepend('<span class="k-icon k-drag-status k-denied" />')},d=e('<div class="k-grouping-dropclue"/>'),f=/("|\%|'|\[|\]|\$|\.|\,|\:|\;|\+|\*|\&|\!|\#|\(|\)|<|>|\=|\?|\@|\^|\{|\}|\~|\/|\||`)/g,h=r.extend({init:function(l,f){var h,p,g=this,m=i.guid(),v=o(g._intializePositions,g),y=g._dropCuePositions=[];r.fn.init.call(g,l,f),a=i.support.isRtl(l),p=a?"right":"left",g.draggable=h=g.options.draggable||new i.ui.Draggable(g.element,{filter:g.options.draggableElements,hint:c,group:m}),g.groupContainer=e(g.options.groupContainer,g.element).kendoDropTarget({group:h.options.group,dragenter:function(e){g._canDrag(e.draggable.currentTarget)&&(e.draggable.hint.find(".k-drag-status").removeClass("k-denied").addClass("k-add"),d.css("top",n(g.groupContainer)).css(p,0).appendTo(g.groupContainer))},dragleave:function(e){e.draggable.hint.find(".k-drag-status").removeClass("k-add").addClass("k-denied"),d.remove()},drop:function(t){var n,r=t.draggable.currentTarget,o=r.attr(i.attr("field")),s=r.attr(i.attr("title")),u=g.indicator(o),l=g._dropCuePositions,c=l[l.length-1];(r.hasClass("k-group-indicator")||g._canDrag(r))&&(c?(n=g._dropCuePosition(i.getOffset(d).left+parseInt(c.element.css("marginLeft"),10)*(a?-1:1)+parseInt(c.element.css("marginRight"),10)),n&&g._canDrop(e(u),n.element,n.left)&&(n.before?n.element.before(u||g.buildIndicator(o,s)):n.element.after(u||g.buildIndicator(o,s)),g._change())):(g.groupContainer.append(g.buildIndicator(o,s)),g._change()))}}).kendoDraggable({filter:"div.k-group-indicator",hint:c,group:h.options.group,dragcancel:o(g._dragCancel,g),dragstart:function(e){var t=e.currentTarget,i=parseInt(t.css("marginLeft"),10),r=t.position(),o=a?r.left-i:r.left+t.outerWidth();v(),d.css({top:n(g.groupContainer),left:o}).appendTo(g.groupContainer),this.hint.find(".k-drag-status").removeClass("k-denied").addClass("k-add")},dragend:function(){g._dragEnd(this)},drag:o(g._drag,g)}).on("click"+s,".k-button",function(t){t.preventDefault(),g._removeIndicator(e(this).parent())}).on("click"+s,".k-link",function(t){var n=e(this).parent(),r=g.buildIndicator(n.attr(i.attr("field")),n.attr(i.attr("title")),"asc"==n.attr(i.attr("dir"))?"desc":"asc");n.before(r).remove(),g._change(),t.preventDefault()}),h.bind(["dragend","dragcancel","dragstart","drag"],{dragend:function(){g._dragEnd(this)},dragcancel:o(g._dragCancel,g),dragstart:function(e){var n,i,r;return g.options.allowDrag||g._canDrag(e.currentTarget)?(v(),y.length?(n=y[y.length-1].element,i=parseInt(n.css("marginRight"),10),r=n.position().left+n.outerWidth()+i):r=0,t):(e.preventDefault(),t)},drag:o(g._drag,g)}),g.dataSource=g.options.dataSource,g.dataSource&&g._refreshHandler?g.dataSource.unbind(u,g._refreshHandler):g._refreshHandler=o(g.refresh,g),g.dataSource&&(g.dataSource.bind("change",g._refreshHandler),g.refresh())},refresh:function(){var t=this,n=t.dataSource;t.groupContainer&&t.groupContainer.empty().append(e.map(n.group()||[],function(e){var n=e.field.replace(f,"\\$1"),r=t.element.find(t.options.filter).filter("["+i.attr("field")+"="+n+"]");return t.buildIndicator(e.field,r.attr(i.attr("title")),e.dir)}).join("")),t._invalidateGroupContainer()},destroy:function(){var e=this;r.fn.destroy.call(e),e.groupContainer.off(s),e.groupContainer.data("kendoDropTarget")&&e.groupContainer.data("kendoDropTarget").destroy(),e.groupContainer.data("kendoDraggable")&&e.groupContainer.data("kendoDraggable").destroy(),e.options.draggable||e.draggable.destroy(),e.dataSource&&e._refreshHandler&&(e.dataSource.unbind("change",e._refreshHandler),e._refreshHandler=null),e.groupContainer=e.element=e.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(t){var n=e(".k-group-indicator",this.groupContainer);return e.grep(n,function(n){return e(n).attr(i.attr("field"))===t})[0]},buildIndicator:function(e,t,n){return l({field:e.replace(/"/g,"'"),dir:n,title:t,ns:i.ns})},descriptors:function(){var t,n,r,o,a,s=this,u=e(".k-group-indicator",s.groupContainer);return t=s.element.find(s.options.filter).map(function(){var t=e(this),r=t.attr(i.attr("aggregates")),s=t.attr(i.attr("field"));if(r&&""!==r)for(n=r.split(","),r=[],o=0,a=n.length;a>o;o++)r.push({field:s,aggregate:n[o]});return r}).toArray(),e.map(u,function(n){return n=e(n),r=n.attr(i.attr("field")),{field:r,dir:n.attr(i.attr("dir")),aggregates:t||[]}})},_removeIndicator:function(e){var t=this;e.remove(),t._invalidateGroupContainer(),t._change()},_change:function(){var e=this;e.dataSource&&e.dataSource.group(e.descriptors())},_dropCuePosition:function(t){var n,i,r,o,s,u=this._dropCuePositions;if(d.is(":visible")&&0!==u.length)return t=Math.ceil(t),n=u[u.length-1],i=n.left,r=n.right,o=parseInt(n.element.css("marginLeft"),10),s=parseInt(n.element.css("marginRight"),10),t>=r&&!a||i>t&&a?t={left:n.element.position().left+(a?-o:n.element.outerWidth()+s),element:n.element,before:!1}:(t=e.grep(u,function(e){return t>=e.left&&e.right>=t||a&&t>e.right})[0],t&&(t={left:a?t.element.position().left+t.element.outerWidth()+s:t.element.position().left-o,element:t.element,before:!0})),t},_drag:function(e){var t=this._dropCuePosition(e.x.location);t&&d.css({left:t.left,right:"auto"})},_canDrag:function(e){var t=e.attr(i.attr("field"));return"false"!=e.attr(i.attr("groupable"))&&t&&(e.hasClass("k-group-indicator")||!this.indicator(t))},_canDrop:function(e,t,n){var i=e.next(),r=e[0]!==t[0]&&(!i[0]||t[0]!==i[0]||!a&&n>i.position().left||a&&n<i.position().left);return r},_dragEnd:function(t){var n=this,r=t.currentTarget.attr(i.attr("field")),o=n.indicator(r);t!==n.options.draggable&&!t.dropped&&o&&n._removeIndicator(e(o)),n._dragCancel()},_dragCancel:function(){d.remove(),this._dropCuePositions=[]},_intializePositions:function(){var t,n=this,r=e(".k-group-indicator",n.groupContainer);n._dropCuePositions=e.map(r,function(n){return n=e(n),t=i.getOffset(n).left,{left:parseInt(t,10),right:parseInt(t+n.outerWidth(),10),element:n}})},_invalidateGroupContainer:function(){var e=this.groupContainer;e&&e.is(":empty")&&e.html(this.options.messages.empty)}});i.ui.plugin(h)})(window.kendo.jQuery);(function(e){function t(t,n){t=e(t),n?t.find(".k-drag-status").removeClass("k-add").addClass("k-denied"):t.find(".k-drag-status").removeClass("k-denied").addClass("k-add")}var n=window.kendo,i=n.getOffset,r=n.ui.Widget,a="change",o="k-reorderable",s=r.extend({init:function(s,u){var l,d=this,c=n.guid()+"-reorderable";r.fn.init.call(d,s,u),s=d.element.addClass(o),u=d.options,d.draggable=l=u.draggable||new n.ui.Draggable(s,{group:c,filter:u.filter,hint:u.hint}),d.reorderDropCue=e('<div class="k-reorder-cue"><div class="k-icon k-i-arrow-s"></div><div class="k-icon k-i-arrow-n"></div></div>'),s.find(l.options.filter).kendoDropTarget({group:l.options.group,dragenter:function(e){var n,r,a,o;d._draggable&&(n=this.element,a=!d._dropTargetAllowed(n)||d._isLastDraggable(),t(e.draggable.hint,a),a||(r=i(n),o=r.left,u.inSameContainer&&!u.inSameContainer(n,d._draggable)?d._dropTarget=n:d._elements.index(n)>d._elements.index(d._draggable)&&(o+=n.outerWidth()),d.reorderDropCue.css({height:n.outerHeight(),top:r.top,left:o}).appendTo(document.body)))},dragleave:function(e){t(e.draggable.hint,!0),d.reorderDropCue.remove(),d._dropTarget=null},drop:function(){var e,t,n;d._dropTarget=null,d._draggable&&(e=this.element,t=d._draggable,n=!1,d._dropTargetAllowed(e)&&!d._isLastDraggable()&&d.trigger(a,{element:d._draggable,oldIndex:d._elements.index(t),newIndex:d._elements.index(e),position:i(d.reorderDropCue).left>i(e).left?"after":"before"}))}}),l.bind(["dragcancel","dragend","dragstart","drag"],{dragcancel:function(){d.reorderDropCue.remove(),d._draggable=null,d._elements=null},dragend:function(){d.reorderDropCue.remove(),d._draggable=null,d._elements=null},dragstart:function(e){d._draggable=e.currentTarget,d._elements=d.element.find(d.draggable.options.filter)},drag:function(e){var t,n;d._dropTarget&&!this.hint.find(".k-drag-status").hasClass("k-denied")&&(t=i(d._dropTarget).left,n=d._dropTarget.outerWidth(),e.pageX>t+n/2?d.reorderDropCue.css({left:t+n}):d.reorderDropCue.css({left:t}))}})},options:{name:"Reorderable",filter:"*"},events:[a],_isLastDraggable:function(){var e,t=this.options.inSameContainer,n=this._draggable[0],i=this._elements.get(),r=!1;if(!t)return!1;for(;!r&&i.length>0;)e=i.pop(),r=n!==e&&t(n,e);return!r},_dropTargetAllowed:function(e){var t=this.options.inSameContainer,n=this.options.dragOverContainers,i=this._draggable;return i[0]===e[0]?!1:t&&n?t(i,e)?!0:n(this._elements.index(i)):!0},destroy:function(){var t=this;r.fn.destroy.call(t),t.element.find(t.draggable.options.filter).each(function(){var t=e(this);t.data("kendoDropTarget")&&t.data("kendoDropTarget").destroy()}),t.draggable&&(t.draggable.destroy(),t.draggable.element=t.draggable=null),t.elements=t.reorderDropCue=t._elements=t._draggable=null}});n.ui.plugin(s)})(window.kendo.jQuery);(function(e,t){var n=window.kendo,i=n.ui,r=i.Widget,o=e.proxy,a=n.isFunction,s=e.extend,u="horizontal",l="vertical",d="start",c="resize",f="resizeend",h=r.extend({init:function(e,t){var n=this;r.fn.init.call(n,e,t),n.orientation=n.options.orientation.toLowerCase()!=l?u:l,n._positionMouse=n.orientation==u?"x":"y",n._position=n.orientation==u?"left":"top",n._sizingDom=n.orientation==u?"outerWidth":"outerHeight",n.draggable=new i.Draggable(e,{distance:0,filter:t.handle,drag:o(n._resize,n),dragcancel:o(n._cancel,n),dragstart:o(n._start,n),dragend:o(n._stop,n)}),n.userEvents=n.draggable.userEvents},events:[c,f,d],options:{name:"Resizable",orientation:u},resize:function(){},_max:function(e){var n=this,i=n.hint?n.hint[n._sizingDom]():0,r=n.options.max;return a(r)?r(e):r!==t?n._initialElementPosition+r-i:r},_min:function(e){var n=this,i=n.options.min;return a(i)?i(e):i!==t?n._initialElementPosition+i:i},_start:function(t){var n=this,i=n.options.hint,r=e(t.currentTarget);n._initialElementPosition=r.position()[n._position],n._initialMousePosition=t[n._positionMouse].startLocation,i&&(n.hint=a(i)?e(i(r)):i,n.hint.css({position:"absolute"}).css(n._position,n._initialElementPosition).appendTo(n.element)),n.trigger(d,t),n._maxPosition=n._max(t),n._minPosition=n._min(t),e(document.body).css("cursor",r.css("cursor"))},_resize:function(e){var n,i=this,r=i._maxPosition,o=i._minPosition,a=i._initialElementPosition+(e[i._positionMouse].location-i._initialMousePosition);n=o!==t?Math.max(o,a):a,i.position=n=r!==t?Math.min(r,n):n,i.hint&&i.hint.toggleClass(i.options.invalidClass||"",n==r||n==o).css(i._position,n),i.resizing=!0,i.trigger(c,s(e,{position:n}))},_stop:function(t){var n=this;n.hint&&n.hint.remove(),n.resizing=!1,n.trigger(f,s(t,{position:n.position})),e(document.body).css("cursor","")},_cancel:function(e){var n=this;n.hint&&(n.position=t,n.hint.css(n._position,n._initialElementPosition),n._stop(e))},destroy:function(){var e=this;r.fn.destroy.call(e),e.draggable&&e.draggable.destroy()},press:function(e){if(e){var t=e.position(),n=this;n.userEvents.press(t.left,t.top,e[0]),n.targetPosition=t,n.target=e}},move:function(e){var n=this,i=n._position,r=n.targetPosition,o=n.position;o===t&&(o=r[i]),r[i]=o+e,n.userEvents.move(r.left,r.top)},end:function(){this.userEvents.end(),this.target=this.position=t}});n.ui.plugin(h)})(window.kendo.jQuery);(function(e,t){function n(t,n){try{return e.contains(t,n)||t==n}catch(i){return!1}}function i(e){return e.clone()}function r(e){return e.clone().removeAttr("id").css("visibility","hidden")}var o=window.kendo,a=o.ui.Widget,s="start",l="beforeMove",u="move",d="end",c="change",f="cancel",h="sort",p="remove",g="receive",m=">*",v=-1,_=a.extend({init:function(e,t){var n=this;a.fn.init.call(n,e,t),n.options.placeholder||(n.options.placeholder=r),n.options.hint||(n.options.hint=i),n._draggable=n._createDraggable(),n.floating=!1},events:[s,l,u,d,c,f],options:{name:"Sortable",hint:null,placeholder:null,filter:m,holdToDrag:!1,disabled:null,container:null,connectWith:null,handler:null,cursorOffset:null,axis:null,ignore:null,cursor:"auto"},destroy:function(){this._draggable.destroy(),a.fn.destroy.call(this)},_createDraggable:function(){var t=this,n=t.element,i=t.options;return new o.ui.Draggable(n,{filter:i.filter,hint:o.isFunction(i.hint)?i.hint:e(i.hint),holdToDrag:i.holdToDrag,container:i.container?e(i.container):null,cursorOffset:i.cursorOffset,axis:i.axis,ignore:i.ignore,dragstart:e.proxy(t._dragstart,t),dragcancel:e.proxy(t._dragcancel,t),drag:e.proxy(t._drag,t),dragend:e.proxy(t._dragend,t)})},_dragstart:function(t){var n=this.draggedElement=t.currentTarget,i=t.target||o.elementUnderCursor(t),r=this.options.disabled,a=this.options.handler,l=this.options.placeholder,u=this.placeholder=o.isFunction(l)?e(l.call(this,n)):e(l);r&&n.is(r)?t.preventDefault():a&&!e(i).is(a)?t.preventDefault():this.trigger(s,{item:n,draggableEvent:t})?t.preventDefault():(this.floating=this._isFloating(n),n.css("display","none"),n.before(u),this._setCursor())},_dragcancel:function(){this._cancel(),this.trigger(f,{item:this.draggedElement}),this._resetCursor()},_drag:function(n){var i,r,o,a,s,l=this.draggedElement,u=this._findTarget(n),d={left:n.x.location,top:n.y.location},c={x:n.x.delta,y:n.y.delta},f=this.options.axis,h={item:l,list:this,draggableEvent:n};if("x"===f||"y"===f)return this._movementByAxis(f,d,c[f],h),t;if(u){if(i=this._getElementCenter(u.element),r={left:Math.round(d.left-i.left),top:Math.round(d.top-i.top)},e.extend(h,{target:u.element}),u.appendToBottom)return this._movePlaceholder(u,null,h),t;if(u.appendAfterHidden&&this._movePlaceholder(u,"next",h),this.floating?0>c.x&&0>r.left?o="prev":c.x>0&&r.left>0&&(o="next"):0>c.y&&0>r.top?o="prev":c.y>0&&r.top>0&&(o="next"),o){for(s="prev"===o?jQuery.fn.prev:jQuery.fn.next,a=s.call(u.element);a.length&&!a.is(":visible");)a=s.call(a);a[0]!=this.placeholder[0]&&this._movePlaceholder(u,o,h)}}},_dragend:function(n){var i,r,o,a,s=this.placeholder,l=this.draggedElement,u=this.indexOf(l),f=this.indexOf(s),m=this.options.connectWith;return this._resetCursor(),o={action:h,item:l,oldIndex:u,newIndex:f,draggableEvent:n},f>=0?r=this.trigger(d,o):(i=s.parents(m).getKendoSortable(),o.action=p,a=e.extend({},o,{action:g,oldIndex:v,newIndex:i.indexOf(s)}),r=!(!this.trigger(d,o)&&!i.trigger(d,a))),r||f===u?(this._cancel(),t):(s.replaceWith(l),l.show(),this._draggable.dropped=!0,o={action:this.indexOf(l)!=v?h:p,item:l,oldIndex:u,newIndex:this.indexOf(l),draggableEvent:n},this.trigger(c,o),i&&(a=e.extend({},o,{action:g,oldIndex:v,newIndex:i.indexOf(l)}),i.trigger(c,a)),t)},_findTarget:function(n){var i,r,o=this._findElementUnderCursor(n),a=this.options.connectWith;return e.contains(this.element[0],o)?(i=this.items(),r=i.filter(o)[0]||i.has(o)[0],r?{element:e(r),sortable:this}:null):this.element[0]==o&&this._isEmpty()?{element:this.element,sortable:this,appendToBottom:!0}:this.element[0]==o&&this._isLastHidden()?(r=this.items().eq(0),{element:r,sortable:this,appendAfterHidden:!0}):a?this._searchConnectedTargets(o,n):t},_findElementUnderCursor:function(e){{var t=o.elementUnderCursor(e),i=e.sender;this.items()}return n(i.hint[0],t)&&(i.hint.hide(),t=o.elementUnderCursor(e),t||(t=o.elementUnderCursor(e)),i.hint.show()),t},_searchConnectedTargets:function(t,n){var i,r,o,a,s=e(this.options.connectWith);for(a=0;s.length>a;a++)if(i=s.eq(a).getKendoSortable(),e.contains(s[a],t)){if(i)return r=i.items(),o=r.filter(t)[0]||r.has(t)[0],o?(i.placeholder=this.placeholder,{element:e(o),sortable:i}):null}else if(s[a]==t){if(i&&i._isEmpty())return{element:s.eq(a),sortable:i,appendToBottom:!0};if(this._isCursorAfterLast(i,n))return o=i.items().last(),{element:o,sortable:i}}},_isCursorAfterLast:function(e,t){var n,i,r=e.items().last(),a={left:t.x.location,top:t.y.location};return n=o.getOffset(r),n.top+=r.outerHeight(),n.left+=r.outerWidth(),i=this.floating?n.left-a.left:n.top-a.top,0>i?!0:!1},_movementByAxis:function(t,n,i,r){var o,a="x"===t?n.left:n.top,s=0>i?this.placeholder.prev():this.placeholder.next();s.length&&!s.is(":visible")&&(s=0>i?s.prev():s.next()),e.extend(r,{target:s}),o=this._getElementCenter(s),o&&(o="x"===t?o.left:o.top),s.length&&0>i&&0>a-o?this._movePlaceholder({element:s,sortable:this},"prev",r):s.length&&i>0&&a-o>0&&this._movePlaceholder({element:s,sortable:this},"next",r)},_movePlaceholder:function(e,t,n){var i=this.placeholder;e.sortable.trigger(l,n)||(t?"prev"===t?e.element.before(i):"next"===t&&e.element.after(i):e.element.append(i),e.sortable.trigger(u,n))},_setCursor:function(){var t,n=this.options.cursor;n&&"auto"!==n&&(t=e(document.body),this._originalCursorType=t.css("cursor"),t.css({cursor:n}),this._cursorStylesheet||(this._cursorStylesheet=e("<style>* { cursor: "+n+" !important; }</style>")),this._cursorStylesheet.appendTo(t))},_resetCursor:function(){this._originalCursorType&&(e(document.body).css("cursor",this._originalCursorType),this._originalCursorType=null,this._cursorStylesheet.remove())},_getElementCenter:function(e){var t=e.length?o.getOffset(e):null;return t&&(t.top+=e.outerHeight()/2,t.left+=e.outerWidth()/2),t},_isFloating:function(e){return/left|right/.test(e.css("float"))||/inline|table-cell/.test(e.css("display"))},_cancel:function(){this.draggedElement.show(),this.placeholder.remove()},_items:function(){var e,t=this.options.filter;return e=t?this.element.find(t):this.element.children()},indexOf:function(e){var t=this._items(),n=this.placeholder,i=this.draggedElement;return n&&e[0]==n[0]?t.not(i).index(e):t.not(n).index(e)},items:function(){var e=this.placeholder,t=this._items();return e&&(t=t.not(e)),t},_isEmpty:function(){return!this.items().length},_isLastHidden:function(){return 1===this.items().length&&this.items().is(":hidden")}});o.ui.plugin(_)})(window.kendo.jQuery);(function(e,t){function n(e,t){var n=r.getOffset(e),i=t.left+t.width,o=t.top+t.height;return n.right=n.left+e.outerWidth(),n.bottom=n.top+e.outerHeight(),!(n.left>i||t.left>n.right||n.top>o||t.top>n.bottom)}var i,r=window.kendo,o=r.ui.Widget,a=e.proxy,s=Math.abs,l="aria-selected",u="k-state-selected",d="k-state-selecting",c="k-selectable",f="change",h=".kendoSelectable",p="k-state-unselecting",g="input,a,textarea,.k-multiselect-wrap,select,button",m=r.support.browser.msie,v=!1;!function(e){!function(){e('<div class="parent"><span /></div>').on("click",">*",function(){v=!0}).find("span").click().end().off()}()}(e),i=o.extend({init:function(t,n){var i,s=this;o.fn.init.call(s,t,n),s._marquee=e("<div class='k-marquee'><div class='k-marquee-color'></div></div>"),s._lastActive=null,s.element.addClass(c),s.relatedTarget=s.options.relatedTarget,i=s.options.multiple,s.userEvents=new r.UserEvents(s.element,{global:!0,allowSelection:!0,filter:(v?"":"."+c+" ")+s.options.filter,tap:a(s._tap,s)}),i&&s.userEvents.bind("start",a(s._start,s)).bind("move",a(s._move,s)).bind("end",a(s._end,s)).bind("select",a(s._select,s))},events:[f],options:{name:"Selectable",filter:">*",multiple:!1,relatedTarget:e.noop},_isElement:function(e){var t,n=this.element,i=n.length,r=!1;for(e=e[0],t=0;i>t;t++)if(n[t]===e){r=!0;break}return r},_tap:function(t){var n,i=e(t.target),r=this,o=t.event.ctrlKey||t.event.metaKey,a=r.options.multiple,s=a&&t.event.shiftKey,l=t.event.which,d=t.event.button;!r._isElement(i.closest("."+c))||l&&3==l||d&&2==d||this._allowSelection(t.event.target)&&(n=i.hasClass(u),a&&o||r.clear(),i=i.add(r.relatedTarget(i)),s?r.selectRange(r._firstSelectee(),i):(n&&o?(r._unselect(i),r._notify(f)):r.value(i),r._lastActive=r._downTarget=i))},_start:function(n){var i,r=this,o=e(n.target),a=o.hasClass(u),s=n.event.ctrlKey||n.event.metaKey;if(this._allowSelection(n.event.target)){if(r._downTarget=o,!r._isElement(o.closest("."+c)))return r.userEvents.cancel(),t;r.options.useAllItems?r._items=r.element.find(r.options.filter):(i=o.closest(r.element),r._items=i.find(r.options.filter)),r._marquee.appendTo(document.body).css({left:n.x.client+1,top:n.y.client+1,width:0,height:0}),s||r.clear(),o=o.add(r.relatedTarget(o)),a&&(r._selectElement(o,!0),s&&o.addClass(p))}},_move:function(e){var t=this,n={left:e.x.startLocation>e.x.location?e.x.location:e.x.startLocation,top:e.y.startLocation>e.y.location?e.y.location:e.y.startLocation,width:s(e.x.initialDelta),height:s(e.y.initialDelta)};t._marquee.css(n),t._invalidateSelectables(n,e.event.ctrlKey||e.event.metaKey),e.preventDefault()},_end:function(){var e,t=this;t._marquee.remove(),t._unselect(t.element.find(t.options.filter+"."+p)).removeClass(p),e=t.element.find(t.options.filter+"."+d),e=e.add(t.relatedTarget(e)),t.value(e),t._lastActive=t._downTarget,t._items=null},_invalidateSelectables:function(e,t){var i,r,o,a,s=this._downTarget[0],l=this._items;for(i=0,r=l.length;r>i;i++)a=l.eq(i),o=a.add(this.relatedTarget(a)),n(a,e)?a.hasClass(u)?t&&s!==a[0]&&o.removeClass(u).addClass(p):a.hasClass(d)||a.hasClass(p)||o.addClass(d):a.hasClass(d)?o.removeClass(d):t&&a.hasClass(p)&&o.removeClass(p).addClass(u)
},value:function(e){var n=this,i=a(n._selectElement,n);return e?(e.each(function(){i(this)}),n._notify(f),t):n.element.find(n.options.filter+"."+u)},_firstSelectee:function(){var e,t=this;return null!==t._lastActive?t._lastActive:(e=t.value(),e.length>0?e[0]:t.element.find(t.options.filter)[0])},_selectElement:function(t,n){var i=e(t),r=!n&&this._notify("select",{element:t});i.removeClass(d),r||(i.addClass(u),this.options.aria&&i.attr(l,!0))},_notify:function(e,t){return t=t||{},this.trigger(e,t)},_unselect:function(e){return e.removeClass(u),this.options.aria&&e.attr(l,!1),e},_select:function(t){this._allowSelection(t.event.target)&&(!m||m&&!e(r._activeElement()).is(g))&&t.preventDefault()},_allowSelection:function(t){return e(t).is(g)?(this.userEvents.cancel(),this._downTarget=null,!1):!0},clear:function(){var e=this.element.find(this.options.filter+"."+u);this._unselect(e)},selectRange:function(t,n){var i,r,o,a=this;for(a.clear(),a.element.length>1&&(o=a.options.continuousItems()),o&&o.length||(o=a.element.find(a.options.filter)),t=e.inArray(e(t)[0],o),n=e.inArray(e(n)[0],o),t>n&&(r=t,t=n,n=r),a.options.useAllItems||(n+=a.element.length-1),i=t;n>=i;i++)a._selectElement(o[i]);a._notify(f)},destroy:function(){var e=this;o.fn.destroy.call(e),e.element.off(h),e.userEvents.destroy(),e._marquee=e._lastActive=e.element=e.userEvents=null}}),r.ui.plugin(i)})(window.kendo.jQuery);(function(e,t){var n=window.kendo,i=n.ui.Widget,r=e.proxy,o=n.keys,a="click",s="k-button",l="k-button-icon",u="k-button-icontext",d=".kendoButton",c="disabled",f="k-state-disabled",h="k-state-focused",p="k-state-selected",g=i.extend({init:function(e,t){var o=this;i.fn.init.call(o,e,t),e=o.wrapper=o.element,t=o.options,e.addClass(s).attr("role","button"),t.enable=t.enable&&!e.attr(c),o.enable(t.enable),o._tabindex(),o._graphics(),e.on(a+d,r(o._click,o)).on("focus"+d,r(o._focus,o)).on("blur"+d,r(o._blur,o)).on("keydown"+d,r(o._keydown,o)).on("keyup"+d,r(o._keyup,o)),n.notify(o)},events:[a],options:{name:"Button",icon:"",spriteCssClass:"",imageUrl:"",enable:!0},_isNativeButton:function(){return"button"==this.element.prop("tagName").toLowerCase()},_click:function(e){this.options.enable&&this.trigger(a,{event:e})},_focus:function(){this.options.enable&&this.element.addClass(h)},_blur:function(){this.element.removeClass(h)},_keydown:function(e){var t=this;t._isNativeButton()||(e.keyCode==o.ENTER||e.keyCode==o.SPACEBAR)&&(e.keyCode==o.SPACEBAR&&(e.preventDefault(),t.options.enable&&t.element.addClass(p)),t._click(e))},_keyup:function(){this.element.removeClass(p)},_graphics:function(){var t,n,i,r=this,o=r.element,a=r.options,s=a.icon,d=a.spriteCssClass,c=a.imageUrl;(d||c||s)&&(i=!0,o.contents().not("span.k-sprite").not("span.k-icon").not("img.k-image").each(function(t,n){(1==n.nodeType||3==n.nodeType&&e.trim(n.nodeValue).length>0)&&(i=!1)}),i?o.addClass(l):o.addClass(u)),s?(t=o.children("span.k-icon").first(),t[0]||(t=e('<span class="k-icon"></span>').prependTo(o)),t.addClass("k-i-"+s)):d?(t=o.children("span.k-sprite").first(),t[0]||(t=e('<span class="k-sprite"></span>').prependTo(o)),t.addClass(d)):c&&(n=o.children("img.k-image").first(),n[0]||(n=e('<img alt="icon" class="k-image" />').prependTo(o)),n.attr("src",c))},enable:function(e){var n=this,i=n.element;e===t&&(e=!0),e=!!e,n.options.enable=e,i.toggleClass(f,!e).attr("aria-disabled",!e).attr(c,!e),i.blur()}});n.ui.plugin(g)})(window.kendo.jQuery);(function(e,t){function n(e,t,n,i,r){return e({idx:t,text:n,ns:u.ns,numeric:i,title:r||""})}function i(e,t,n){return x({className:e.substring(1),text:t,wrapClassName:n||""})}function r(e,t,n,i){e.find(t).parent().attr(u.attr("page"),n).attr("tabindex",-1).toggleClass("k-state-disabled",i)}function o(e,t){r(e,h,1,1>=t)}function a(e,t){r(e,g,Math.max(1,t-1),1>=t)}function s(e,t,n){r(e,m,Math.min(n,t+1),t>=n)}function l(e,t,n){r(e,p,n,t>=n)}var u=window.kendo,d=u.ui,c=d.Widget,f=e.proxy,h=".k-i-seek-w",p=".k-i-seek-e",g=".k-i-arrow-w",m=".k-i-arrow-e",v="change",_=".kendoPager",y="click",b="keydown",w="disabled",x=u.template('<a href="\\#" title="#=text#" class="k-link k-pager-nav #= wrapClassName #"><span class="k-icon #= className #">#=text#</span></a>'),k=c.extend({init:function(t,n){var r,d,w=this;c.fn.init.call(w,t,n),n=w.options,w.dataSource=u.data.DataSource.create(n.dataSource),w.linkTemplate=u.template(w.options.linkTemplate),w.selectTemplate=u.template(w.options.selectTemplate),r=w.page(),d=w.totalPages(),w._refreshHandler=f(w.refresh,w),w.dataSource.bind(v,w._refreshHandler),n.previousNext&&(w.element.find(h).length||(w.element.append(i(h,n.messages.first,"k-pager-first")),o(w.element,r,d)),w.element.find(g).length||(w.element.append(i(g,n.messages.previous)),a(w.element,r,d))),n.numeric&&(w.list=w.element.find(".k-pager-numbers"),w.list.length||(w.list=e('<ul class="k-pager-numbers k-reset" />').appendTo(w.element))),n.input&&(w.element.find(".k-pager-input").length||w.element.append('<span class="k-pager-input k-label">'+n.messages.page+'<input class="k-textbox">'+u.format(n.messages.of,d)+"</span>"),w.element.on(b+_,".k-pager-input input",f(w._keydown,w))),n.previousNext&&(w.element.find(m).length||(w.element.append(i(m,n.messages.next)),s(w.element,r,d)),w.element.find(p).length||(w.element.append(i(p,n.messages.last,"k-pager-last")),l(w.element,r,d))),n.pageSizes&&(w.element.find(".k-pager-sizes").length||e('<span class="k-pager-sizes k-label"><select/>'+n.messages.itemsPerPage+"</span>").appendTo(w.element).find("select").html(e.map(e.isArray(n.pageSizes)?n.pageSizes:[5,10,20],function(e){return"<option>"+e+"</option>"}).join("")).end().appendTo(w.element),w.element.find(".k-pager-sizes select").val(w.pageSize()),u.ui.DropDownList&&w.element.find(".k-pager-sizes select").show().kendoDropDownList(),w.element.on(v+_,".k-pager-sizes select",f(w._change,w))),n.refresh&&(w.element.find(".k-pager-refresh").length||w.element.append('<a href="#" class="k-pager-refresh k-link" title="'+n.messages.refresh+'"><span class="k-icon k-i-refresh">'+n.messages.refresh+"</span></a>"),w.element.on(y+_,".k-pager-refresh",f(w._refreshClick,w))),n.info&&(w.element.find(".k-pager-info").length||w.element.append('<span class="k-pager-info k-label" />')),w.element.on(y+_,"a",f(w._click,w)).addClass("k-pager-wrap k-widget"),n.autoBind&&w.refresh(),u.notify(w)},destroy:function(){var e=this;c.fn.destroy.call(e),e.element.off(_),e.dataSource.unbind(v,e._refreshHandler),e._refreshHandler=null,u.destroy(e.element),e.element=e.list=null},events:[v],options:{name:"Pager",selectTemplate:'<li><span class="k-state-selected">#=text#</span></li>',linkTemplate:'<li><a tabindex="-1" href="\\#" class="k-link" data-#=ns#page="#=idx#" #if (title !== "") {# title="#=title#" #}#>#=text#</a></li>',buttonCount:10,autoBind:!0,numeric:!0,info:!0,input:!1,previousNext:!0,pageSizes:!1,refresh:!1,messages:{display:"{0} - {1} of {2} items",empty:"No items to display",page:"Page",of:"of {0}",itemsPerPage:"items per page",first:"Go to the first page",previous:"Go to the previous page",next:"Go to the next page",last:"Go to the last page",refresh:"Refresh",morePages:"More pages"}},setDataSource:function(e){var t=this;t.dataSource.unbind(v,t._refreshHandler),t.dataSource=t.options.dataSource=e,e.bind(v,t._refreshHandler),t.options.autoBind&&e.fetch()},refresh:function(e){var t,i,r,d=this,c=1,f="",h=d.page(),p=d.options,g=d.pageSize(),m=d.dataSource.total(),v=d.totalPages(),_=d.linkTemplate,y=p.buttonCount;if(!e||"itemchange"!=e.action){if(p.numeric){for(h>y&&(r=h%y,c=0===r?h-y+1:h-r+1),i=Math.min(c+y-1,v),c>1&&(f+=n(_,c-1,"...",!1,p.messages.morePages)),t=c;i>=t;t++)f+=n(t==h?d.selectTemplate:_,t,t,!0);v>i&&(f+=n(_,t,"...",!1,p.messages.morePages)),""===f&&(f=d.selectTemplate({text:0})),d.list.html(f)}p.info&&(f=m>0?u.format(p.messages.display,(h-1)*g+1,Math.min(h*g,m),m):p.messages.empty,d.element.find(".k-pager-info").html(f)),p.input&&d.element.find(".k-pager-input").html(d.options.messages.page+'<input class="k-textbox">'+u.format(p.messages.of,v)).find("input").val(h).attr(w,1>m).toggleClass("k-state-disabled",1>m),p.previousNext&&(o(d.element,h,v),a(d.element,h,v),s(d.element,h,v),l(d.element,h,v)),p.pageSizes&&d.element.find(".k-pager-sizes select").val(g).filter("["+u.attr("role")+"=dropdownlist]").kendoDropDownList("value",g).kendoDropDownList("text",g)}},_keydown:function(e){if(e.keyCode===u.keys.ENTER){var t=this.element.find(".k-pager-input").find("input"),n=parseInt(t.val(),10);(isNaN(n)||1>n||n>this.totalPages())&&(n=this.page()),t.val(n),this.page(n)}},_refreshClick:function(e){e.preventDefault(),this.dataSource.read()},_change:function(e){var t=parseInt(e.currentTarget.value,10);isNaN(t)||this.dataSource.pageSize(t)},_click:function(t){var n=e(t.currentTarget);t.preventDefault(),n.is(".k-state-disabled")||this.page(n.attr(u.attr("page")))},totalPages:function(){return Math.ceil((this.dataSource.total()||0)/this.pageSize())},pageSize:function(){return this.dataSource.pageSize()||this.dataSource.total()},page:function(e){return e===t?this.dataSource.total()>0?this.dataSource.page():0:(this.dataSource.page(e),this.trigger(v,{index:e}),t)}});d.plugin(k)})(window.kendo.jQuery);(function(e){function t(t,n){return t===n||e.contains(t,n)}var n=window.kendo,i=n.ui,r=i.Widget,o=n.support,a=n.getOffset,s=n._activeElement,l="open",u="close",d="deactivate",c="activate",f="center",h="left",p="right",g="top",m="bottom",v="absolute",_="hidden",y="body",b="location",w="position",x="visible",k="effects",C="k-state-active",T="k-state-border",S=/k-state-border-(\w+)/,F=".k-picker-wrap, .k-dropdown-wrap, .k-link",M="down",D=e(window),E=e(document.documentElement),z="resize scroll",O=o.transitions.css,P=O+"transform",A=e.extend,H=".kendoPopup",N=["font-size","font-family","font-stretch","font-style","font-weight","line-height"],I=r.extend({init:function(t,i){var o,a=this;i=i||{},i.isRtl&&(i.origin=i.origin||m+" "+p,i.position=i.position||g+" "+p),r.fn.init.call(a,t,i),t=a.element,i=a.options,a.collisions=i.collision?i.collision.split(" "):[],1===a.collisions.length&&a.collisions.push(a.collisions[0]),o=e(a.options.anchor).closest(".k-popup,.k-group").filter(":not([class^=km-])"),i.appendTo=e(e(i.appendTo)[0]||o[0]||y),a.element.hide().addClass("k-popup k-group k-reset").toggleClass("k-rtl",!!i.isRtl).css({position:v}).appendTo(i.appendTo).on("mouseenter"+H,function(){a._hovered=!0}).on("mouseleave"+H,function(){a._hovered=!1}),a.wrapper=e(),i.animation===!1&&(i.animation={open:{effects:{}},close:{hide:!0,effects:{}}}),A(i.animation.open,{complete:function(){a.wrapper.css({overflow:x}),a.trigger(c)}}),A(i.animation.close,{complete:function(){a.wrapper.hide();var r,o,s=a.wrapper.data(b),l=e(i.anchor);s&&a.wrapper.css(s),i.anchor!=y&&(r=(l[0].className.match(S)||["","down"])[1],o=T+"-"+r,l.removeClass(o).children(F).removeClass(C).removeClass(o),t.removeClass(T+"-"+n.directions[r].reverse)),a._closing=!1,a.trigger(d)}}),a._mousedownProxy=function(e){a._mousedown(e)},a._resizeProxy=function(e){a._resize(e)},i.toggleTarget&&e(i.toggleTarget).on(i.toggleEvent+H,e.proxy(a.toggle,a))},events:[l,c,u,d],options:{name:"Popup",toggleEvent:"click",origin:m+" "+h,position:g+" "+h,anchor:y,collision:"flip fit",viewport:window,copyAnchorStyles:!0,autosize:!1,modal:!1,animation:{open:{effects:"slideIn:down",transition:!0,duration:200},close:{duration:100,hide:!0}}},destroy:function(){var t,i=this,o=i.options,a=i.element.off(H);r.fn.destroy.call(i),o.toggleTarget&&e(o.toggleTarget).off(H),o.modal||(E.unbind(M,i._mousedownProxy),D.unbind(z,i._resizeProxy)),n.destroy(i.element.children()),a.removeData(),o.appendTo[0]===document.body&&(t=a.parent(".k-animation-container"),t[0]?t.remove():a.remove())},open:function(t,i){var r,a,s,u=this,d={isFixed:!isNaN(parseInt(i,10)),x:t,y:i},c=u.element,f=u.options,h="down",p=e(f.anchor),m=c[0]&&c.hasClass("km-widget");if(!u.visible()){if(f.copyAnchorStyles&&(m&&"font-size"==N[0]&&N.shift(),c.css(n.getComputedStyles(p[0],N))),c.data("animating")||u.trigger(l))return;f.modal||(E.unbind(M,u._mousedownProxy).bind(M,u._mousedownProxy),o.mobileOS.ios||o.mobileOS.android||D.unbind(z,u._resizeProxy).bind(z,u._resizeProxy)),u.wrapper=a=n.wrap(c,f.autosize).css({overflow:_,display:"block",position:v}),o.mobileOS.android&&a.add(p).css(P,"translatez(0)"),a.css(w),e(f.appendTo)[0]==document.body&&a.css(g,"-10000px"),r=A(!0,{},f.animation.open),u.flipped=u._position(d),r.effects=n.parseEffects(r.effects,u.flipped),h=r.effects.slideIn?r.effects.slideIn.direction:h,f.anchor!=y&&(s=T+"-"+h,c.addClass(T+"-"+n.directions[h].reverse),p.addClass(s).children(F).addClass(C).addClass(s)),c.data(k,r.effects).kendoStop(!0).kendoAnimate(r)}},toggle:function(){var e=this;e[e.visible()?u:l]()},visible:function(){return this.element.is(":"+x)},close:function(){var t,i,r,o,a=this,s=a.options;if(a.visible()){if(t=a.wrapper[0]?a.wrapper:n.wrap(a.element).hide(),a._closing||a.trigger(u))return;a.element.find(".k-popup").each(function(){var t=e(this),n=t.data("kendoPopup");n&&n.close()}),E.unbind(M,a._mousedownProxy),D.unbind(z,a._resizeProxy),i=A(!0,{},s.animation.close),r=a.element.data(k),o=i.effects,!o&&!n.size(o)&&r&&n.size(r)&&(i.effects=r,i.reverse=!0),a._closing=!0,a.element.kendoStop(!0),t.css({overflow:_}),a.element.kendoAnimate(i)}},_resize:function(e){var n=this;"resize"===e.type?(clearTimeout(n._resizeTimeout),n._resizeTimeout=setTimeout(function(){n._position(),n._resizeTimeout=null},50)):n._hovered||t(n.element[0],s())||n.close()},_mousedown:function(i){var r=this,o=r.element[0],a=r.options,s=e(a.anchor)[0],l=a.toggleTarget,u=n.eventTarget(i),d=e(u).closest(".k-popup"),c=d.parent().parent(".km-shim").length;d=d[0],(c||!d||d===r.element[0])&&"popover"!==e(i.target).closest("a").data("rel")&&(t(o,u)||t(s,u)||l&&t(e(l)[0],u)||r.close())},_fit:function(e,t,n){var i=0;return e+t>n&&(i=n-(e+t)),0>e&&(i=-e),i},_flip:function(e,t,n,i,r,o,a){var s=0;return a=a||t,o!==r&&o!==f&&r!==f&&(e+a>i&&(s+=-(n+t)),0>e+s&&(s+=n+t)),s},_position:function(t){var n,i,r,s,l,u,d,c,f,h=this,p=h.element.css(w,""),g=h.wrapper,m=h.options,_=e(m.viewport),y=_.offset(),x=e(m.anchor),k=m.origin.toLowerCase().split(" "),C=m.position.toLowerCase().split(" "),T=h.collisions,S=o.zoomLevel(),F=10002,M=!!(_[0]==window&&window.innerWidth&&1.02>=S),D=0,E=M?window.innerWidth:_.width(),z=M?window.innerHeight:_.height(),O=x.parents().filter(g.siblings());if(O[0])if(i=Math.max(+O.css("zIndex"),0))F=i+10;else for(n=x.parentsUntil(O),r=n.length;r>D;D++)i=+e(n[D]).css("zIndex"),i&&i>F&&(F=i+10);return g.css("zIndex",F),t&&t.isFixed?g.css({left:t.x,top:t.y}):g.css(h._align(k,C)),s=a(g,w,x[0]===g.offsetParent()[0]),l=a(g),u=x.offsetParent().parent(".k-animation-container,.k-popup,.k-group"),u.length&&(s=a(g,w,!0),l=a(g)),_[0]===window?(l.top-=window.pageYOffset||document.documentElement.scrollTop||0,l.left-=window.pageXOffset||document.documentElement.scrollLeft||0):(l.top-=y.top,l.left-=y.left),h.wrapper.data(b)||g.data(b,A({},s)),d=A({},l),c=A({},s),"fit"===T[0]&&(c.top+=h._fit(d.top,g.outerHeight(),z/S)),"fit"===T[1]&&(c.left+=h._fit(d.left,g.outerWidth(),E/S)),f=A({},c),"flip"===T[0]&&(c.top+=h._flip(d.top,p.outerHeight(),x.outerHeight(),z/S,k[0],C[0],g.outerHeight())),"flip"===T[1]&&(c.left+=h._flip(d.left,p.outerWidth(),x.outerWidth(),E/S,k[1],C[1],g.outerWidth())),p.css(w,v),g.css(c),c.left!=f.left||c.top!=f.top},_align:function(t,n){var i,r=this,o=r.wrapper,s=e(r.options.anchor),l=t[0],u=t[1],d=n[0],c=n[1],h=a(s),g=e(r.options.appendTo),v=o.outerWidth(),_=o.outerHeight(),y=s.outerWidth(),b=s.outerHeight(),w=h.top,x=h.left,k=Math.round;return g[0]!=document.body&&(i=a(g),w-=i.top,x-=i.left),l===m&&(w+=b),l===f&&(w+=k(b/2)),d===m&&(w-=_),d===f&&(w-=k(_/2)),u===p&&(x+=y),u===f&&(x+=k(y/2)),c===p&&(x-=v),c===f&&(x-=k(v/2)),{top:w,left:x}}});i.plugin(I)})(window.kendo.jQuery);(function(e,t){var n=window.kendo,i=n.ui.Widget,r=e.proxy,o=e.extend,a=window.setTimeout,s="click",l="show",u="hide",d="k-notification",c=".k-notification-wrap .k-i-close",f="info",h="success",p="warning",g="error",m="top",v="left",_="bottom",y="right",b="up",w=".kendoNotification",x='<div class="k-widget k-notification"></div>',k='<div class="k-notification-wrap"><span class="k-icon k-i-note">#=typeIcon#</span>#=content#<span class="k-icon k-i-close">Hide</span></div>',T=i.extend({init:function(t,r){var o=this;i.fn.init.call(o,t,r),r=o.options,r.appendTo&&e(r.appendTo).is(t)||o.element.hide(),o._compileTemplates(r.templates),o._guid="_"+n.guid(),o._isRtl=n.support.isRtl(t),o._compileStacking(r.stacking,r.position.top),n.notify(o)},events:[l,u],options:{name:"Notification",position:{pinned:!0,top:null,left:null,bottom:20,right:20},stacking:"default",hideOnClick:!0,button:!1,allowHideAfter:0,autoHideAfter:5e3,appendTo:null,width:null,height:null,templates:[],animation:{open:{effects:"fade:in",duration:300},close:{effects:"fade:out",duration:600,hide:!0}}},_compileTemplates:function(t){var i=this,r=n.template;i._compiled={},e.each(t,function(t,n){i._compiled[n.type]=r(n.template||e("#"+n.templateId).html())}),i._defaultCompiled=r(k)},_getCompiled:function(e){var t=this,n=t._defaultCompiled;return e?t._compiled[e]||n:n},_compileStacking:function(e,t){var n,i,r=this,o={paddingTop:0,paddingRight:0,paddingBottom:0,paddingLeft:0};switch(e){case"down":n=_+" "+v,i=m+" "+v,delete o.paddingBottom;break;case y:n=m+" "+y,i=m+" "+v,delete o.paddingRight;break;case v:n=m+" "+v,i=m+" "+y,delete o.paddingLeft;break;case b:n=m+" "+v,i=_+" "+v,delete o.paddingTop;break;default:null!==t?(n=_+" "+v,i=m+" "+v,delete o.paddingBottom):(n=m+" "+v,i=_+" "+v,delete o.paddingTop)}r._popupOrigin=n,r._popupPosition=i,r._popupPaddings=o},_attachPopupEvents:function(e,t){function n(e){e.on(s+w,function(){t.close()})}var i,r=e.allowHideAfter,o=!isNaN(r)&&r>0;e.hideOnClick?t.bind("activate",function(){o?a(function(){n(t.element)},r):n(t.element)}):e.button&&(i=t.element.find(c),o?a(function(){n(i)},r):n(i))},_showPopup:function(t,i){var r,s,l=this,d=i.autoHideAfter,f=i.position.left,h=i.position.top;s=e("."+l._guid).last(),r=new n.ui.Popup(t,{anchor:s[0]?s:document.body,origin:l._popupOrigin,position:l._popupPosition,animation:i.animation,modal:!0,collision:"",isRtl:l._isRtl,close:function(){l.trigger(u,{element:this.element})},deactivate:function(e){e.sender.element.off(w),e.sender.element.find(c).off(w),e.sender.destroy()}}),l._attachPopupEvents(i,r),s[0]?r.open():(null===f&&(f=e(window).width()-t.width()-i.position.right),null===h&&(h=e(window).height()-t.height()-i.position.bottom),r.open(f,h)),r.wrapper.addClass(l._guid).css(o({margin:0},l._popupPaddings)),i.position.pinned?(r.wrapper.css("position","fixed"),s[0]&&l._togglePin(r.wrapper,!0)):s[0]||l._togglePin(r.wrapper,!1),d>0&&a(function(){r.close()},d)},_togglePin:function(t,n){var i=e(window),r=n?-1:1;t.css({top:parseInt(t.css(m),10)+r*i.scrollTop(),left:parseInt(t.css(v),10)+r*i.scrollLeft()})},_attachStaticEvents:function(e,t){function n(e){e.on(s+w,r(i._hideStatic,i,t))}var i=this,o=e.allowHideAfter,l=!isNaN(o)&&o>0;e.hideOnClick?l?a(function(){n(t)},o):n(t):e.button&&(l?a(function(){n(t.find(c))},o):n(t.find(c)))},_showStatic:function(e,t){var n=this,i=t.autoHideAfter,r=t.animation,o=t.stacking==b||t.stacking==v?"prependTo":"appendTo";e.addClass(n._guid)[o](t.appendTo).hide().kendoAnimate(r.open),n._attachStaticEvents(t,e),i>0&&a(function(){n._hideStatic(e)},i)},_hideStatic:function(e){e.kendoAnimate(o(this.options.animation.close,{complete:function(){e.off(w).find(c).off(w),e.remove()}})),this.trigger(u,{element:e})},show:function(i,r){var a,s,u=this,c=u.options,h=e(x);return r||(r=f),null!==i&&i!==t&&""!==i&&(n.isFunction(i)&&(i=i()),s={typeIcon:r,content:""},a=e.isPlainObject(i)?o(s,i):o(s,{content:i}),h.addClass(d+"-"+r).toggleClass(d+"-button",c.button).attr("data-role","alert").css({width:c.width,height:c.height}).append(u._getCompiled(r)(a)),e(c.appendTo)[0]?u._showStatic(h,c):u._showPopup(h,c),u.trigger(l,{element:h})),u},info:function(e){return this.show(e,f)},success:function(e){return this.show(e,h)},warning:function(e){return this.show(e,p)},error:function(e){return this.show(e,g)},hide:function(){var t=this,n=t.getNotifications();return t.options.appendTo?n.each(function(n,i){t._hideStatic(e(i))}):n.each(function(t,n){var i=e(n).data("kendoPopup");i&&i.close()}),t},getNotifications:function(){var t=this,n=e("."+t._guid);return t.options.appendTo?n:n.children("."+d)},setOptions:function(e){var n,r=this;i.fn.setOptions.call(r,e),n=r.options,e.templates!==t&&r._compileTemplates(n.templates),(e.stacking!==t||e.position!==t)&&r._compileStacking(n.stacking,n.position.top)},destroy:function(){i.fn.destroy.call(this),this.getNotifications().off(w).find(c).off(w)}});n.ui.plugin(T)})(window.kendo.jQuery);(function(e){function t(e){for(;e.length;)n(e),e=e.parent()}function n(e){var t=e.data(o.ns+"title");t&&(e.attr("title",t),e.removeData(o.ns+"title"))}function i(e){var t=e.attr("title");t&&(e.data(o.ns+"title",t),e.attr("title",""))}function r(e){for(;e.length&&!e.is("body");)i(e),e=e.parent()}var o=window.kendo,a=o.ui.Widget,s=o.ui.Popup,l=o.isFunction,u=e.isPlainObject,d=e.extend,c=e.proxy,f=e(document),h=o.isLocalUrl,p="_tt_active",g="aria-describedby",m="show",v="hide",_="error",y="contentLoad",b="requestStart",w="k-content-frame",x='<div role="tooltip" class="k-widget k-tooltip#if (!autoHide) {# k-tooltip-closable#}#">#if (!autoHide) {# <div class="k-tooltip-button"><a href="\\#" class="k-icon k-i-close">close</a></div> #}#<div class="k-tooltip-content"></div>#if (callout){ #<div class="k-callout k-callout-#=dir#"></div>#}#</div>',k=o.template("<iframe frameborder='0' class='"+w+"' src='#= content.url #'>This page requires frames in order to show content</iframe>"),T=".kendoTooltip",C={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"}},S={top:"bottom",bottom:"top",left:"right",right:"left",center:"center"},F={bottom:"n",top:"s",left:"e",right:"w",center:"n"},M={horizontal:{offset:"top",size:"outerHeight"},vertical:{offset:"left",size:"outerWidth"}},D=function(e){return e.target.data(o.ns+"title")},E=a.extend({init:function(e,t){var n,i=this;a.fn.init.call(i,e,t),n=i.options.position.match(/left|right/)?"horizontal":"vertical",i.dimensions=M[n],i._documentKeyDownHandler=c(i._documentKeyDown,i),i.element.on(i.options.showOn+T,i.options.filter,c(i._showOn,i)).on("mouseenter"+T,i.options.filter,c(i._mouseenter,i)),this.options.autoHide&&i.element.on("mouseleave"+T,i.options.filter,c(i._mouseleave,i))},options:{name:"Tooltip",filter:"",content:D,showAfter:100,callout:!0,position:"bottom",showOn:"mouseenter",autoHide:!0,width:null,height:null,animation:{open:{effects:"fade:in",duration:0},close:{effects:"fade:out",duration:40,hide:!0}}},events:[m,v,y,_,b],_mouseenter:function(t){r(e(t.currentTarget))},_showOn:function(t){var n=this,i=e(t.currentTarget);n.options.showOn&&n.options.showOn.match(/click|focus/)?n._show(i):(clearTimeout(n.timeout),n.timeout=setTimeout(function(){n._show(i)},n.options.showAfter))},_appendContent:function(e){var t,n=this,i=n.options.content,r=n.content,a=n.options.iframe;u(i)&&i.url?("iframe"in n.options||(a=!h(i.url)),n.trigger(b,{options:i,target:e}),a?(r.hide(),t=r.find("."+w)[0],t?t.src=i.url||t.src:r.html(k({content:i})),r.find("."+w).off("load"+T).on("load"+T,function(){n.trigger(y),r.show()})):(r.empty(),o.ui.progress(r,!0),n._ajaxRequest(i))):i&&l(i)?(i=i({sender:this,target:e}),n.content.html(i||"")):n.content.html(i)},_ajaxRequest:function(e){var t=this;jQuery.ajax(d({type:"GET",dataType:"html",cache:!1,error:function(e,n){o.ui.progress(t.content,!1),t.trigger(_,{status:n,xhr:e})},success:c(function(e){o.ui.progress(t.content,!1),t.content.html(e),t.trigger(y)},t)},e))},_documentKeyDown:function(e){e.keyCode===o.keys.ESC&&this.hide()},refresh:function(){var e=this,t=e.popup;t&&t.options.anchor&&e._appendContent(t.options.anchor)},hide:function(){this.popup&&this.popup.close()},show:function(e){e=e||this.element,r(e),this._show(e)},_show:function(e){var n=this,i=n.target();n.popup||n._initPopup(),i&&i[0]!=e[0]&&(n.popup.close(),n.popup.element.kendoStop(!0,!0)),i&&i[0]==e[0]||(n._appendContent(e),n.popup.options.anchor=e),n.popup.one("deactivate",function(){t(e),e.removeAttr(g),this.element.removeAttr("id").attr("aria-hidden",!0),f.off("keydown"+T,n._documentKeyDownHandler)}),n.popup.open()},_initPopup:function(){var t=this,n=t.options,i=e(o.template(x)({callout:n.callout&&"center"!==n.position,dir:F[n.position],autoHide:n.autoHide}));t.popup=new s(i,d({activate:function(){var e=this.options.anchor,i=e[0].id||t.element[0].id;i&&(e.attr(g,i+p),this.element.attr("id",i+p)),n.callout&&t._positionCallout(),this.element.removeAttr("aria-hidden"),f.on("keydown"+T,t._documentKeyDownHandler),t.trigger(m)},close:function(){t.trigger(v)},copyAnchorStyles:!1,animation:n.animation},C[n.position])),i.css({width:n.width,height:n.height}),t.content=i.find(".k-tooltip-content"),t.arrow=i.find(".k-callout"),n.autoHide?i.on("mouseleave"+T,c(t._mouseleave,t)):i.on("click"+T,".k-tooltip-button",c(t._closeButtonClick,t))},_closeButtonClick:function(e){e.preventDefault(),this.hide()},_mouseleave:function(n){if(this.popup){var i=e(n.currentTarget),r=i.offset(),o=n.pageX,a=n.pageY;if(r.right=r.left+i.outerWidth(),r.bottom=r.top+i.outerHeight(),o>r.left&&r.right>o&&a>r.top&&r.bottom>a)return;this.popup.close()}else t(e(n.currentTarget));clearTimeout(this.timeout)},_positionCallout:function(){var t=this,n=t.options.position,i=t.dimensions,r=i.offset,o=t.popup,a=o.options.anchor,s=e(a).offset(),l=parseInt(t.arrow.css("border-top-width"),10),u=e(o.element).offset(),d=F[o.flipped?S[n]:n],c=s[r]-u[r]+e(a)[i.size]()/2-l;t.arrow.removeClass("k-callout-n k-callout-s k-callout-w k-callout-e").addClass("k-callout-"+d).css(r,c)},target:function(){return this.popup?this.popup.options.anchor:null},destroy:function(){var e=this.popup;e&&(e.element.off(T),e.destroy()),this.element.off(T),f.off("keydown"+T,this._documentKeyDownHandler),a.fn.destroy.call(this)}});o.ui.plugin(E)})(window.kendo.jQuery);(function(e,t){function n(t,i){t.filters&&(t.filters=e.grep(t.filters,function(e){return n(e,i),e.filters?e.filters.length:e.field!=i}))}var i=window.kendo,r=i.ui,o=r.Widget,a=i.keys,s=i.support,l=i.htmlEncode,u=i._activeElement,d="id",c="li",f="change",h="k-state-focused",p="k-state-hover",g="k-loading",m="open",v="close",_="select",y="selected",b="progress",w="requestEnd",x="width",k=e.extend,T=e.proxy,S=s.browser,C=S.msie&&9>S.version,F=/"/g,D={ComboBox:"DropDownList",DropDownList:"ComboBox"},M=o.extend({init:function(t,n){var i,r=this,a=r.ns;o.fn.init.call(r,t,n),t=r.element,r._isSelect=t.is(_),r._template(),r.ul=e('<ul unselectable="on" class="k-list k-reset"/>').css({overflow:s.kineticScrollNeeded?"":"auto"}).on("mouseenter"+a,c,function(){e(this).addClass(p)}).on("mouseleave"+a,c,function(){e(this).removeClass(p)}).on("click"+a,c,T(r._click,r)).attr({tabIndex:-1,role:"listbox","aria-hidden":!0}),r.list=e("<div class='k-list-container'/>").append(r.ul).on("mousedown"+a,function(e){e.preventDefault()}),i=t.attr(d),i&&(r.list.attr(d,i+"-list"),r.ul.attr(d,i+"_listbox"),r._optionID=i+"_option_selected"),r._header(),r._accessors(),r._initValue()},options:{valuePrimitive:!1,headerTemplate:""},setOptions:function(e){o.fn.setOptions.call(this,e),e&&e.enable!==t&&(e.enabled=e.enable)},focus:function(){this._focused.focus()},readonly:function(e){this._editable({readonly:e===t?!0:e,disable:!1})},enable:function(e){this._editable({readonly:!1,disable:!(e=e===t?!0:e)})},_filterSource:function(e){var t=this,i=t.options,r=t.dataSource,o=r.filter()||{};n(o,i.dataTextField),e&&(o=o.filters||[],o.push(e)),r.filter(o)},_header:function(){var t,n=this.options.headerTemplate;e.isFunction(n)&&(n=n({})),n&&(this.list.prepend(n),t=this.ul.prev(),this.header=t[0]?t:null)},_initValue:function(){var e=this,t=e.options.value;null!==t?e.element.val(t):(t=e._accessor(),e.options.value=t),e._old=t},_ignoreCase:function(){var e,t=this,n=t.dataSource.reader.model;n&&n.fields&&(e=n.fields[t.options.dataTextField],e&&e.type&&"string"!==e.type&&(t.options.ignoreCase=!1))},items:function(){return this.ul[0].children},current:function(e){var n=this,i=n._optionID;return e===t?n._current:(n._current&&(n._current.removeClass(h).removeAttr("aria-selected").removeAttr(d),n._focused.removeAttr("aria-activedescendant")),e&&(e.addClass(h),n._scroll(e),i&&(e.attr("id",i),n._focused.attr("aria-activedescendant",i))),n._current=e,t)},destroy:function(){var e=this,t=e.ns;o.fn.destroy.call(e),e._unbindDataSource(),e.ul.off(t),e.list.off(t),e._touchScroller&&e._touchScroller.destroy(),e.popup.destroy(),e._form&&e._form.off("reset",e._resetHandler)},dataItem:function(e){var n=this;return e===t&&(e=n.selectedIndex),n._data()[e]},_accessors:function(){var e=this,t=e.element,n=e.options,r=i.getter,o=t.attr(i.attr("text-field")),a=t.attr(i.attr("value-field"));o&&(n.dataTextField=o),a&&(n.dataValueField=a),e._text=r(n.dataTextField),e._value=r(n.dataValueField)},_aria:function(e){var n=this,i=n.options,r=n._focused;i.suggest!==t&&r.attr("aria-autocomplete",i.suggest?"both":"list"),e=e?e+" "+n.ul[0].id:n.ul[0].id,r.attr("aria-owns",e),n.ul.attr("aria-live",i.filter&&"none"!==i.filter?"polite":"off")},_blur:function(){var e=this;e._change(),e.close()},_change:function(){var e,n=this,i=n.selectedIndex,r=n.options.value,o=n.value();n._isSelect&&!n._bound&&r&&(o=r),o!==n._old?e=!0:i!==t&&i!==n._oldIndex&&(e=!0),e&&(n._old=o,n._oldIndex=i,n.trigger(f),n.element.trigger(f))},_click:function(t){t.isDefaultPrevented()||this._accept(e(t.currentTarget))},_data:function(){return this.dataSource.view()},_enable:function(){var e=this,n=e.options,i=e.element.is("[disabled]");n.enable!==t&&(n.enabled=n.enable),!n.enabled||i?e.enable(!1):e.readonly(e.element.is("[readonly]"))},_focus:function(e){var n=this,i=!0;return n.popup.visible()&&e&&n.trigger(_,{item:e})?(n.close(),t):(n._select(e),n._triggerCascade(i),n._blur(),t)},_index:function(e){var t,n,i=this,r=i._data();for(t=0,n=r.length;n>t;t++)if(i._dataValue(r[t])==e)return t;return-1},_dataValue:function(e){var n=this._value(e);return n===t&&(n=this._text(e)),n},_height:function(e){if(e){var t,n=this,i=n.list,r=n.popup.visible(),o=n.options.height,a=n.header;t=i.add(i.parent(".k-animation-container")).show(),o=n.ul[0].scrollHeight>o?o:"auto",t.height(o),a&&n.ul.height("auto"==o?o:i.height()-a.height()),r||t.hide()}},_adjustListWidth:function(){var e,t,n=this.list,i=n[0].style.width,r=this.wrapper;if(n.data(x)||!i)return e=window.getComputedStyle?window.getComputedStyle(r[0],null):0,t=e?parseFloat(e.width):r.outerWidth(),e&&(S.mozilla||S.msie)&&(t+=parseFloat(e.paddingLeft)+parseFloat(e.paddingRight)+parseFloat(e.borderLeftWidth)+parseFloat(e.borderRightWidth)),i="border-box"!==n.css("box-sizing")?t-(n.outerWidth()-n.width()):t,n.css({fontFamily:r.css("font-family"),width:i}).data(x,i),!0},_popup:function(){var e=this,t=e.list,n=e._focused,o=e.options,a=e.wrapper;e.popup=new r.Popup(t,k({},o.popup,{anchor:a,open:function(t){e._adjustListWidth(),e.trigger(m)?t.preventDefault():(n.attr("aria-expanded",!0),e.ul.attr("aria-hidden",!1))},close:function(t){e.trigger(v)?t.preventDefault():(n.attr("aria-expanded",!1),e.ul.attr("aria-hidden",!0))},animation:o.animation,isRtl:s.isRtl(a)})),e.popup.one(m,function(){e._height(e._data().length)}),e._touchScroller=i.touchScroller(e.popup.element)},_makeUnselectable:function(){C&&this.list.find("*").attr("unselectable","on")},_toggleHover:function(t){e(t.currentTarget).toggleClass(p,"mouseenter"===t.type)},_toggle:function(e,n){var i=this,r=s.touch&&s.MSPointers&&s.pointers;e=e!==t?e:!i.popup.visible(),n||r||i._focused[0]===u()||i._focused.focus(),i[e?m:v]()
},_scroll:function(e){if(e){e[0]&&(e=e[0]);var t,n,i=this.ul[0],r=e.offsetTop,o=e.offsetHeight,a=i.scrollTop,s=i.clientHeight,l=r+o,u=this._touchScroller;u?(t=u.dimensions.y,t.enabled&&r>t.size&&(r=r-t.size+o+4,u.scrollTo(0,-r))):(n=this.header?this.header.outerHeight():0,i.scrollTop=a>r?r-n:l>a+s?l-s-n:a)}},_template:function(){var e=this,t=e.options,n=t.template,r=t.dataSource;e._isSelect&&e.element[0].length&&(r||(t.dataTextField=t.dataTextField||"text",t.dataValueField=t.dataValueField||"value")),n?(n=i.template(n),e.template=function(e){return'<li tabindex="-1" role="option" unselectable="on" class="k-item">'+n(e)+"</li>"}):e.template=i.template('<li tabindex="-1" role="option" unselectable="on" class="k-item">${'+i.expr(t.dataTextField,"data")+"}</li>",{useWithBlock:!1})},_triggerCascade:function(e){var t=this,n=t.value();(!t._bound&&n||t._old!==n)&&t.trigger("cascade",{userTriggered:e})},_unbindDataSource:function(){var e=this;e.dataSource.unbind(f,e._refreshHandler).unbind(b,e._progressHandler).unbind(w,e._requestEndHandler).unbind("error",e._errorHandler)}});k(M,{inArray:function(e,t){var n,i,r=t.children;if(!e||e.parentNode!==t)return-1;for(n=0,i=r.length;i>n;n++)if(e===r[n])return n;return-1}}),i.ui.List=M,r.Select=M.extend({init:function(e,t){M.fn.init.call(this,e,t),this._initial=this.element.val()},setDataSource:function(e){this.options.dataSource=e,this._dataSource(),this._bound=!1,this.options.autoBind&&this.dataSource.fetch()},close:function(){this.popup.close()},select:function(e){var n=this;return e===t?n.selectedIndex:(n._select(e),n._triggerCascade(),n._old=n._accessor(),n._oldIndex=n.selectedIndex,t)},_accessor:function(e,n){var i,r=this.element[0],o=this._isSelect,a=r.selectedIndex;return e===t?(o?a>-1&&(i=r.options[a],i&&(e=i.value)):e=r.value,e):(o?(a>-1&&r.options[a].removeAttribute(y),r.selectedIndex=n,i=r.options[n],i&&i.setAttribute(y,y)):r.value=e,t)},_hideBusy:function(){var e=this;clearTimeout(e._busy),e._arrow.removeClass(g),e._focused.attr("aria-busy",!1),e._busy=null},_showBusy:function(){var e=this;e._request=!0,e._busy||(e._busy=setTimeout(function(){e._focused.attr("aria-busy",!0),e._arrow.addClass(g)},100))},_requestEnd:function(){this._request=!1},_dataSource:function(){var t,n=this,r=n.element,o=n.options,a=o.dataSource||{};a=e.isArray(a)?{data:a}:a,n._isSelect&&(t=r[0].selectedIndex,t>-1&&(o.index=t),a.select=r,a.fields=[{field:o.dataTextField},{field:o.dataValueField}]),n.dataSource&&n._refreshHandler?n._unbindDataSource():(n._refreshHandler=T(n.refresh,n),n._progressHandler=T(n._showBusy,n),n._requestEndHandler=T(n._requestEnd,n),n._errorHandler=T(n._hideBusy,n)),n.dataSource=i.data.DataSource.create(a).bind(f,n._refreshHandler).bind(b,n._progressHandler).bind(w,n._requestEndHandler).bind("error",n._errorHandler)},_get:function(t){var n,i,r=this,o=r._data();if("function"==typeof t)for(n=0,i=o.length;i>n;n++)if(t(o[n])){t=n;break}if("number"==typeof t){if(0>t)return e();t=e(r.ul[0].children[t])}return t&&t.nodeType&&(t=e(t)),t},_move:function(e){var t,n,i=this,r=e.keyCode,o=i.ul[0],s=i.popup.visible()?"_select":"_accept",l=i._current,u=r===a.DOWN;if(r===a.UP||u){if(e.altKey)i.toggle(u);else{if(t=o.firstChild,!t&&!i._accessor()&&"filter"!==i._state)return i._fetch||(i.dataSource.one(f,function(){i._move(e),i._fetch=!1}),i._fetch=!0,i._filterSource()),e.preventDefault(),!0;u?(!l||-1===i.selectedIndex&&!i.value()&&l[0]===t?l=t:(l=l[0].nextSibling,l||t!==o.lastChild||(l=t)),i[s](l)):(l=l?l[0].previousSibling:o.lastChild,l||t!==o.lastChild||(l=t),i[s](l))}e.preventDefault(),n=!0}else r===a.ENTER||r===a.TAB?(i.popup.visible()&&e.preventDefault(),i.popup.visible()||l&&l.hasClass("k-state-selected")||(l=null),i._accept(l),n=!0):r===a.ESC&&(i.popup.visible()&&e.preventDefault(),i.close(),n=!0);return n},_selectItem:function(){var e,n,i=this,r=i._bound===t,o=i.options;e=i._isSelect&&!i._initial&&!o.value&&o.index&&!i._bound,e||(n=i._selectedValue||r&&o.value||i._accessor()),n?i.value(n):r&&i.select(o.index)},_fetchItems:function(e){var n=this,i=n.ul[0].firstChild;return n._request?!0:n._bound||n._fetch||i?t:n.options.cascadeFrom?!i:(n.dataSource.one(f,function(){n._old=t,n.value(e),n._fetch=!1}),n._fetch=!0,n.dataSource.fetch(),!0)},_options:function(e,n){var i,r,o,a,s=this,u=s.element,d=e.length,c="",f=0;for(n&&(f=1,c=n);d>f;f++)i="<option",r=e[f],o=s._text(r),a=s._value(r),a!==t&&(a+="",-1!==a.indexOf('"')&&(a=a.replace(F,"&quot;")),i+=' value="'+a+'"'),i+=">",o!==t&&(i+=l(o)),i+="</option>",c+=i;u.html(c)},_reset:function(){var t=this,n=t.element,i=n.attr("form"),r=i?e("#"+i):n.closest("form");r[0]&&(t._resetHandler=function(){setTimeout(function(){t.value(t._initial)})},t._form=r.on("reset",t._resetHandler))},_cascade:function(){var t,i,r,o,a,s=this,l=s.options,u=l.cascadeFrom;if(u){if(s._selectedValue=l.value||s._accessor(),i=e("#"+u),t=i.data("kendo"+l.name),t||(t=i.data("kendo"+D[l.name])),!t)return;l.autoBind=!1,o=l.cascadeFromField||t.options.dataValueField,a=function(){s.dataSource.unbind(f,a);var e=s._selectedValue||s.value();s._userTriggered?s._clearSelection(t,!0):e?(s.value(e),s.dataSource.view()[0]&&-1!==s.selectedIndex||s._clearSelection(t,!0)):s.select(l.index),s.enable(),s._triggerCascade(s._userTriggered),s._userTriggered=!1},r=function(){var e,i,r,l=t.dataItem(),u=l?t._value(l):null;u||0===u?(e=s.dataSource.filter()||{},n(e,o),i=e.filters||[],i.push({field:o,operator:"eq",value:u}),r=function(){s.unbind("dataBound",r),a.apply(s,arguments)},s.first("dataBound",r),s.dataSource.filter(i)):(s.enable(!1),s._clearSelection(t),s._triggerCascade(s._userTriggered),s._userTriggered=!1)},t.first("cascade",function(e){s._userTriggered=e.userTriggered,r()}),t._bound?r():t.value()||s.enable(!1)}}})})(window.kendo.jQuery);(function(e,t){function n(e,t,n,i){var r,o=e.getFullYear(),a=t.getFullYear(),s=n.getFullYear();return o-=o%i,r=o+(i-1),a>o&&(o=a),r>s&&(r=s),o+"-"+r}function i(e){for(var t,n=0,i=e.min,r=e.max,o=e.start,a=e.setter,l=e.build,u=e.cells||12,c=e.perRow||4,d=e.content||z,f=e.empty||O,h=e.html||'<table tabindex="0" role="grid" class="k-content k-meta-view" cellspacing="0"><tbody><tr role="row">';u>n;n++)n>0&&n%c===0&&(h+='</tr><tr role="row">'),t=l(o,n),h+=s(o,i,r)?d(t):f(t),a(o,1);return h+"</tr></tbody></table>"}function r(e,t,n){var i=e.getFullYear(),r=t.getFullYear(),o=r,a=0;return n&&(r-=r%n,o=r-r%n+n-1),i>o?a=1:r>i&&(a=-1),a}function o(){var e=new pt;return new pt(e.getFullYear(),e.getMonth(),e.getDate())}function a(e,t,n){var i=o();return e&&(i=new pt(+e)),t>i?i=new pt(+t):i>n&&(i=new pt(+n)),i}function s(e,t,n){return+e>=+t&&+n>=+e}function l(e,t){return e.slice(t).concat(e.slice(0,t))}function u(e,t,n){t=t instanceof pt?t.getFullYear():e.getFullYear()+n*t,e.setFullYear(t)}function c(t){e(this).toggleClass($,it.indexOf(t.type)>-1||t.type==tt)}function d(e){e.preventDefault()}function f(e){return D(e).calendars.standard}function h(e){var n=gt[e.start],i=gt[e.depth],r=D(e.culture);e.format=S(e.format||r.calendars.standard.patterns.d),isNaN(n)&&(n=0,e.start=W),(i===t||i>n)&&(e.depth=W),e.dates||(e.dates=[])}function p(e){A&&e.find("*").attr("unselectable","on")}function g(e,t){for(var n=0,i=t.length;i>n;n++)if(e===+t[n])return!0;return!1}function m(e,t){return e?e.getFullYear()===t.getFullYear()&&e.getMonth()===t.getMonth()&&e.getDate()===t.getDate():!1}function v(e,t){return e?e.getFullYear()===t.getFullYear()&&e.getMonth()===t.getMonth():!1}var _,y=window.kendo,b=y.support,w=y.ui,x=w.Widget,k=y.keys,T=y.parseDate,C=y.date.adjustDST,S=y._extractFormat,F=y.template,D=y.getCulture,M=y.support.transitions,E=M?M.css+"transform-origin":"",z=F('<td#=data.cssClass# role="gridcell"><a tabindex="-1" class="k-link" href="\\#" data-#=data.ns#value="#=data.dateString#">#=data.value#</a></td>',{useWithBlock:!1}),O=F('<td role="gridcell">&nbsp;</td>',{useWithBlock:!1}),P=y.support.browser,A=P.msie&&9>P.version,H=".kendoCalendar",N="click"+H,I="keydown"+H,R="id",B="min",L="left",q="slideIn",W="month",j="century",U="change",Y="navigate",V="value",$="k-state-hover",G="k-state-disabled",Q="k-state-focused",J="k-other-month",K=' class="'+J+'"',X="k-nav-today",Z="td:has(.k-link)",et="blur"+H,tt="focus",nt=tt+H,it=b.touch?"touchstart":"mouseenter",rt=b.touch?"touchstart"+H:"mouseenter"+H,ot=b.touch?"touchend"+H+" touchmove"+H:"mouseleave"+H,at=6e4,st=864e5,lt="_prevArrow",ut="_nextArrow",ct="aria-disabled",dt="aria-selected",ft=e.proxy,ht=e.extend,pt=Date,gt={month:0,year:1,decade:2,century:3},mt=x.extend({init:function(t,n){var i,r,o=this;x.fn.init.call(o,t,n),t=o.wrapper=o.element,n=o.options,n.url=window.unescape(n.url),o._templates(),o._header(),o._footer(o.footer),r=t.addClass("k-widget k-calendar").on(rt+" "+ot,Z,c).on(I,"table.k-content",ft(o._move,o)).on(N,Z,function(t){var n=t.currentTarget.firstChild;-1!=n.href.indexOf("#")&&t.preventDefault(),o._click(e(n))}).on("mouseup"+H,"table.k-content, .k-footer",function(){o._focusView(o.options.focusOnNav!==!1)}).attr(R),r&&(o._cellID=r+"_cell_selected"),h(n),i=T(n.value,n.format,n.culture),o._index=gt[n.start],o._current=new pt(+a(i,n.min,n.max)),o._addClassProxy=function(){o._active=!0,o._cell.addClass(Q)},o._removeClassProxy=function(){o._active=!1,o._cell.removeClass(Q)},o.value(i),y.notify(o)},options:{name:"Calendar",value:null,min:new pt(1900,0,1),max:new pt(2099,11,31),dates:[],url:"",culture:"",footer:"",format:"",month:{},start:W,depth:W,animation:{horizontal:{effects:q,reverse:!0,duration:500,divisor:2},vertical:{effects:"zoomIn",duration:400}}},events:[U,Y],setOptions:function(e){var t=this;h(e),e.dates[0]||(e.dates=t.options.dates),x.fn.setOptions.call(t,e),t._templates(),t._footer(t.footer),t._index=gt[t.options.start],t.navigate()},destroy:function(){var e=this,t=e._today;e.element.off(H),e._title.off(H),e[lt].off(H),e[ut].off(H),y.destroy(e._table),t&&y.destroy(t.off(H)),x.fn.destroy.call(e)},current:function(){return this._current},view:function(){return this._view},focus:function(e){e=e||this._table,this._bindTable(e),e.focus()},min:function(e){return this._option(B,e)},max:function(e){return this._option("max",e)},navigateToPast:function(){this._navigate(lt,-1)},navigateToFuture:function(){this._navigate(ut,1)},navigateUp:function(){var e=this,t=e._index;e._title.hasClass(G)||e.navigate(e._current,++t)},navigateDown:function(e){var n=this,i=n._index,r=n.options.depth;if(e)return i===gt[r]?(+n._value!=+e&&(n.value(e),n.trigger(U)),t):(n.navigate(e,--i),t)},navigate:function(n,i){i=isNaN(i)?gt[i]:i;var r,o,s,l,u=this,c=u.options,d=c.culture,f=c.min,h=c.max,g=u._title,m=u._table,v=u._oldTable,y=u._value,b=u._current,w=n&&+n>+b,x=i!==t&&i!==u._index;n||(n=b),u._current=n=new pt(+a(n,f,h)),i===t?i=u._index:u._index=i,u._view=o=_.views[i],s=o.compare,l=i===gt[j],g.toggleClass(G,l).attr(ct,l),l=s(n,f)<1,u[lt].toggleClass(G,l).attr(ct,l),l=s(n,h)>-1,u[ut].toggleClass(G,l).attr(ct,l),m&&v&&v.data("animating")&&(v.kendoStop(!0,!0),m.kendoStop(!0,!0)),u._oldTable=m,(!m||u._changeView)&&(g.html(o.title(n,f,h,d)),u._table=r=e(o.content(ht({min:f,max:h,date:n,url:c.url,dates:c.dates,format:c.format,culture:d},u[o.name]))),p(r),u._animate({from:m,to:r,vertical:x,future:w}),u._focus(n),u.trigger(Y)),i===gt[c.depth]&&y&&u._class("k-state-selected",o.toDateString(y)),u._class(Q,o.toDateString(n)),!m&&u._cell&&u._cell.removeClass(Q),u._changeView=!0},value:function(e){var n=this,i=n._view,r=n.options,o=n._view,a=r.min,l=r.max;return e===t?n._value:(e=T(e,r.format,r.culture),null!==e&&(e=new pt(+e),s(e,a,l)||(e=null)),n._value=e,o&&null===e&&n._cell?n._cell.removeClass("k-state-selected"):(n._changeView=!e||i&&0!==i.compare(e,n._current),n.navigate(e)),t)},_move:function(t){var n,i,r,o,s=this,l=s.options,u=t.keyCode,c=s._view,d=s._index,f=new pt(+s._current),h=y.support.isRtl(s.wrapper);return t.target===s._table[0]&&(s._active=!0),t.ctrlKey?u==k.RIGHT&&!h||u==k.LEFT&&h?(s.navigateToFuture(),i=!0):u==k.LEFT&&!h||u==k.RIGHT&&h?(s.navigateToPast(),i=!0):u==k.UP?(s.navigateUp(),i=!0):u==k.DOWN&&(s._click(e(s._cell[0].firstChild)),i=!0):(u==k.RIGHT&&!h||u==k.LEFT&&h?(n=1,i=!0):u==k.LEFT&&!h||u==k.RIGHT&&h?(n=-1,i=!0):u==k.UP?(n=0===d?-7:-4,i=!0):u==k.DOWN?(n=0===d?7:4,i=!0):u==k.ENTER?(s._click(e(s._cell[0].firstChild)),i=!0):u==k.HOME||u==k.END?(r=u==k.HOME?"first":"last",o=c[r](f),f=new pt(o.getFullYear(),o.getMonth(),o.getDate(),f.getHours(),f.getMinutes(),f.getSeconds(),f.getMilliseconds()),i=!0):u==k.PAGEUP?(i=!0,s.navigateToPast()):u==k.PAGEDOWN&&(i=!0,s.navigateToFuture()),(n||r)&&(r||c.setDate(f,n),s._focus(a(f,l.min,l.max)))),i&&t.preventDefault(),s._current},_animate:function(e){var t=this,n=e.from,i=e.to,r=t._active;n?n.parent().data("animating")?(n.parent().kendoStop(!0,!0).remove(),n.remove(),i.insertAfter(t.element[0].firstChild),t._focusView(r)):n.is(":visible")&&t.options.animation!==!1?t[e.vertical?"_vertical":"_horizontal"](n,i,e.future):(i.insertAfter(n),n.remove(),t._focusView(r)):(i.insertAfter(t.element[0].firstChild),t._bindTable(i))},_horizontal:function(e,n,i){var r=this,o=r._active,a=r.options.animation.horizontal,s=a.effects,l=e.outerWidth();s&&-1!=s.indexOf(q)&&(e.add(n).css({width:l}),e.wrap("<div/>"),r._focusView(o,e),e.parent().css({position:"relative",width:2*l,"float":L,"margin-left":i?0:-l}),n[i?"insertAfter":"insertBefore"](e),ht(a,{effects:q+":"+(i?"right":L),complete:function(){e.remove(),n.unwrap(),r._focusView(o),r._oldTable=t}}),e.parent().kendoStop(!0,!0).kendoAnimate(a))},_vertical:function(e,n){var i,r,o=this,a=o.options.animation.vertical,s=a.effects,l=o._active;s&&-1!=s.indexOf("zoom")&&(n.css({position:"absolute",top:e.prev().outerHeight(),left:0}).insertBefore(e),E&&(i=o._cellByDate(o._view.toDateString(o._current)),r=i.position(),r=r.left+parseInt(i.width()/2,10)+"px "+(r.top+parseInt(i.height()/2,10)+"px"),n.css(E,r)),e.kendoStop(!0,!0).kendoAnimate({effects:"fadeOut",duration:600,complete:function(){e.remove(),n.css({position:"static",top:0,left:0}),o._focusView(l),o._oldTable=t}}),n.kendoStop(!0,!0).kendoAnimate(a))},_cellByDate:function(t){return this._table.find("td:not(."+J+")").filter(function(){return e(this.firstChild).attr(y.attr(V))===t})},_class:function(t,n){var i=this,r=i._cellID,o=i._cell;o&&o.removeAttr(dt).removeAttr("aria-label").removeAttr(R),o=i._table.find("td:not(."+J+")").removeClass(t).filter(function(){return e(this.firstChild).attr(y.attr(V))===n}).attr(dt,!0),t!==Q||i._active||i.options.focusOnNav===!1||(t=""),o.addClass(t),o[0]&&(i._cell=o),r&&(o.attr(R,r),i._table.removeAttr("aria-activedescendant").attr("aria-activedescendant",r))},_bindTable:function(e){e.on(nt,this._addClassProxy).on(et,this._removeClassProxy)},_click:function(e){var t=this,n=t.options,i=new Date(+t._current),r=e.attr(y.attr(V)).split("/");r=new pt(r[0],r[1],r[2]),C(r,0),t._view.setDate(i,r),t.navigateDown(a(i,n.min,n.max))},_focus:function(e){var t=this,n=t._view;0!==n.compare(e,t._current)?t.navigate(e):(t._current=e,t._class(Q,n.toDateString(e)))},_focusView:function(e,t){e&&this.focus(t)},_footer:function(n){var i=this,r=o(),a=i.element,s=a.find(".k-footer");return n?(s[0]||(s=e('<div class="k-footer"><a href="#" class="k-link k-nav-today"></a></div>').appendTo(a)),i._today=s.show().find(".k-link").html(n(r)).attr("title",y.toString(r,"D",i.options.culture)),i._toggle(),t):(i._toggle(!1),s.hide(),t)},_header:function(){var e,t=this,n=t.element;n.find(".k-header")[0]||n.html('<div class="k-header"><a href="#" role="button" class="k-link k-nav-prev"><span class="k-icon k-i-arrow-w"></span></a><a href="#" role="button" aria-live="assertive" aria-atomic="true" class="k-link k-nav-fast"></a><a href="#" role="button" class="k-link k-nav-next"><span class="k-icon k-i-arrow-e"></span></a></div>'),e=n.find(".k-link").on(rt+" "+ot+" "+nt+" "+et,c).click(!1),t._title=e.eq(1).on(N,function(){t._active=t.options.focusOnNav!==!1,t.navigateUp()}),t[lt]=e.eq(0).on(N,function(){t._active=t.options.focusOnNav!==!1,t.navigateToPast()}),t[ut]=e.eq(2).on(N,function(){t._active=t.options.focusOnNav!==!1,t.navigateToFuture()})},_navigate:function(e,t){var n=this,i=n._index+1,r=new pt(+n._current);e=n[e],e.hasClass(G)||(i>3?r.setFullYear(r.getFullYear()+100*t):_.views[i].setDate(r,t),n.navigate(r))},_option:function(e,n){var i,r=this,o=r.options,a=r._value||r._current;return n===t?o[e]:(n=T(n,o.format,o.culture),n&&(o[e]=new pt(+n),i=e===B?n>a:a>n,(i||v(a,n))&&(i&&(r._value=null),r._changeView=!0),r._changeView||(r._changeView=!(!o.month.content&&!o.month.empty)),r.navigate(r._value),r._toggle()),t)},_toggle:function(e){var n=this,i=n.options,r=n._today;e===t&&(e=s(o(),i.min,i.max)),r&&(r.off(N),e?r.addClass(X).removeClass(G).on(N,ft(n._todayClick,n)):r.removeClass(X).addClass(G).on(N,d))},_todayClick:function(e){var t=this,n=gt[t.options.depth],i=o();e.preventDefault(),0===t._view.compare(t._current,i)&&t._index==n&&(t._changeView=!1),t._value=i,t.navigate(i,n),t.trigger(U)},_templates:function(){var e=this,t=e.options,n=t.footer,i=t.month,r=i.content,o=i.empty;e.month={content:F('<td#=data.cssClass# role="gridcell"><a tabindex="-1" class="k-link#=data.linkClass#" href="#=data.url#" '+y.attr("value")+'="#=data.dateString#" title="#=data.title#">'+(r||"#=data.value#")+"</a></td>",{useWithBlock:!!r}),empty:F('<td role="gridcell">'+(o||"&nbsp;")+"</td>",{useWithBlock:!!o})},e.footer=n!==!1?F(n||'#= kendo.toString(data,"D","'+t.culture+'") #',{useWithBlock:!1}):null}});w.plugin(mt),_={firstDayOfMonth:function(e){return new pt(e.getFullYear(),e.getMonth(),1)},firstVisibleDay:function(e,t){t=t||y.culture().calendar;for(var n=t.firstDay,i=new pt(e.getFullYear(),e.getMonth(),0,e.getHours(),e.getMinutes(),e.getSeconds(),e.getMilliseconds());i.getDay()!=n;)_.setTime(i,-1*st);return i},setTime:function(e,t){var n=e.getTimezoneOffset(),i=new pt(e.getTime()+t),r=i.getTimezoneOffset()-n;e.setTime(i.getTime()+r*at)},views:[{name:W,title:function(e,t,n,i){return f(i).months.names[e.getMonth()]+" "+e.getFullYear()},content:function(e){for(var t=this,n=0,r=e.min,o=e.max,a=e.date,s=e.dates,u=e.format,c=e.culture,d=e.url,h=d&&s[0],p=f(c),m=p.firstDay,v=p.days,b=l(v.names,m),w=l(v.namesShort,m),x=_.firstVisibleDay(a,p),k=t.first(a),T=t.last(a),S=t.toDateString,F=new pt,D='<table tabindex="0" role="grid" class="k-content" cellspacing="0"><thead><tr role="row">';7>n;n++)D+='<th scope="col" title="'+b[n]+'">'+w[n]+"</th>";return F=new pt(F.getFullYear(),F.getMonth(),F.getDate()),C(F,0),F=+F,i({cells:42,perRow:7,html:D+='</tr></thead><tbody><tr role="row">',start:new pt(x.getFullYear(),x.getMonth(),x.getDate()),min:new pt(r.getFullYear(),r.getMonth(),r.getDate()),max:new pt(o.getFullYear(),o.getMonth(),o.getDate()),content:e.content,empty:e.empty,setter:t.setDate,build:function(e){var t=[],n=e.getDay(),i="",r="#";return(k>e||e>T)&&t.push(J),+e===F&&t.push("k-today"),(0===n||6===n)&&t.push("k-weekend"),h&&g(+e,s)&&(r=d.replace("{0}",y.toString(e,u,c)),i=" k-action-link"),{date:e,dates:s,ns:y.ns,title:y.toString(e,"D",c),value:e.getDate(),dateString:S(e),cssClass:t[0]?' class="'+t.join(" ")+'"':"",linkClass:i,url:r}}})},first:function(e){return _.firstDayOfMonth(e)},last:function(e){var t=new pt(e.getFullYear(),e.getMonth()+1,0),n=_.firstDayOfMonth(e),i=Math.abs(t.getTimezoneOffset()-n.getTimezoneOffset());return i&&t.setHours(n.getHours()+i/60),t},compare:function(e,t){var n,i=e.getMonth(),r=e.getFullYear(),o=t.getMonth(),a=t.getFullYear();return n=r>a?1:a>r?-1:i==o?0:i>o?1:-1},setDate:function(e,t){var n=e.getHours();t instanceof pt?e.setFullYear(t.getFullYear(),t.getMonth(),t.getDate()):_.setTime(e,t*st),C(e,n)},toDateString:function(e){return e.getFullYear()+"/"+e.getMonth()+"/"+e.getDate()}},{name:"year",title:function(e){return e.getFullYear()},content:function(e){var t=f(e.culture).months.namesAbbr,n=this.toDateString,r=e.min,o=e.max;return i({min:new pt(r.getFullYear(),r.getMonth(),1),max:new pt(o.getFullYear(),o.getMonth(),1),start:new pt(e.date.getFullYear(),0,1),setter:this.setDate,build:function(e){return{value:t[e.getMonth()],ns:y.ns,dateString:n(e),cssClass:""}}})},first:function(e){return new pt(e.getFullYear(),0,e.getDate())},last:function(e){return new pt(e.getFullYear(),11,e.getDate())},compare:function(e,t){return r(e,t)},setDate:function(e,t){var n,i=e.getHours();t instanceof pt?(n=t.getMonth(),e.setFullYear(t.getFullYear(),n,e.getDate()),n!==e.getMonth()&&e.setDate(0)):(n=e.getMonth()+t,e.setMonth(n),n>11&&(n-=12),n>0&&e.getMonth()!=n&&e.setDate(0)),C(e,i)},toDateString:function(e){return e.getFullYear()+"/"+e.getMonth()+"/1"}},{name:"decade",title:function(e,t,i){return n(e,t,i,10)},content:function(e){var t=e.date.getFullYear(),n=this.toDateString;return i({start:new pt(t-t%10-1,0,1),min:new pt(e.min.getFullYear(),0,1),max:new pt(e.max.getFullYear(),0,1),setter:this.setDate,build:function(e,t){return{value:e.getFullYear(),ns:y.ns,dateString:n(e),cssClass:0===t||11==t?K:""}}})},first:function(e){var t=e.getFullYear();return new pt(t-t%10,e.getMonth(),e.getDate())},last:function(e){var t=e.getFullYear();return new pt(t-t%10+9,e.getMonth(),e.getDate())},compare:function(e,t){return r(e,t,10)},setDate:function(e,t){u(e,t,1)},toDateString:function(e){return e.getFullYear()+"/0/1"}},{name:j,title:function(e,t,i){return n(e,t,i,100)},content:function(e){var t=e.date.getFullYear(),n=e.min.getFullYear(),r=e.max.getFullYear(),o=this.toDateString,a=n,s=r;return a-=a%10,s-=s%10,10>s-a&&(s=a+9),i({start:new pt(t-t%100-10,0,1),min:new pt(a,0,1),max:new pt(s,0,1),setter:this.setDate,build:function(e,t){var i=e.getFullYear(),a=i+9;return n>i&&(i=n),a>r&&(a=r),{ns:y.ns,value:i+" - "+a,dateString:o(e),cssClass:0===t||11==t?K:""}}})},first:function(e){var t=e.getFullYear();return new pt(t-t%100,e.getMonth(),e.getDate())},last:function(e){var t=e.getFullYear();return new pt(t-t%100+99,e.getMonth(),e.getDate())},compare:function(e,t){return r(e,t,100)},setDate:function(e,t){u(e,t,10)},toDateString:function(e){var t=e.getFullYear();return t-t%10+"/0/1"}}]},_.isEqualDatePart=m,_.makeUnselectable=p,_.restrictValue=a,_.isInRange=s,_.normalize=h,_.viewsEnum=gt,y.calendar=_})(window.kendo.jQuery);(function(e,t){function n(t){var n=t.parseFormats,i=t.format;I.normalize(t),n=e.isArray(n)?n:[n],-1===e.inArray(i,n)&&n.splice(0,0,t.format),t.parseFormats=n}function i(e){e.preventDefault()}var r,o=window.kendo,a=o.ui,s=a.Widget,l=o.parseDate,u=o.keys,c=o.template,d=o._activeElement,f="<div />",h="<span />",p=".kendoDatePicker",g="click"+p,m="open",v="close",_="change",y="disabled",b="readonly",w="k-state-default",x="k-state-focused",k="k-state-selected",T="k-state-disabled",C="k-state-hover",S="mouseenter"+p+" mouseleave"+p,F="mousedown"+p,D="id",M="min",E="max",z="month",O="aria-disabled",A="aria-expanded",P="aria-hidden",H="aria-readonly",I=o.calendar,N=I.isInRange,R=I.restrictValue,B=I.isEqualDatePart,L=e.extend,q=e.proxy,W=Date,j=function(t){var n,i=this,r=document.body,s=e(f).attr(P,"true").addClass("k-calendar-container").appendTo(r);i.options=t=t||{},n=t.id,n&&(n+="_dateview",s.attr(D,n),i._dateViewID=n),i.popup=new a.Popup(s,L(t.popup,t,{name:"Popup",isRtl:o.support.isRtl(t.anchor)})),i.div=s,i.value(t.value)};j.prototype={_calendar:function(){var t,n=this,r=n.calendar,s=n.options;r||(t=e(f).attr(D,o.guid()).appendTo(n.popup.element).on(F,i).on(g,"td:has(.k-link)",q(n._click,n)),n.calendar=r=new a.Calendar(t),n._setOptions(s),o.calendar.makeUnselectable(r.element),r.navigate(n._value||n._current,s.start),n.value(n._value))},_setOptions:function(e){this.calendar.setOptions({focusOnNav:!1,change:e.change,culture:e.culture,dates:e.dates,depth:e.depth,footer:e.footer,format:e.format,max:e.max,min:e.min,month:e.month,start:e.start})},setOptions:function(e){var t=this.options;this.options=L(t,e,{change:t.change,close:t.close,open:t.open}),this.calendar&&this._setOptions(this.options)},destroy:function(){this.popup.destroy()},open:function(){var e=this;e._calendar(),e.popup.open()},close:function(){this.popup.close()},min:function(e){this._option(M,e)},max:function(e){this._option(E,e)},toggle:function(){var e=this;e[e.popup.visible()?v:m]()},move:function(e){var n=this,i=e.keyCode,r=n.calendar,o=e.ctrlKey&&i==u.DOWN||i==u.ENTER;if(i==u.ESC)return n.close(),t;if(e.altKey)return i==u.DOWN?(n.open(),e.preventDefault()):i==u.UP&&(n.close(),e.preventDefault()),t;if(n.popup.visible())return o&&r._cell.hasClass(k)?(n.close(),e.preventDefault(),t):(n._current=r._move(e),t)},current:function(e){this._current=e,this.calendar._focus(e)},value:function(e){var t=this,n=t.calendar,i=t.options;t._value=e,t._current=new W(+R(e,i.min,i.max)),n&&n.value(e)},_click:function(e){-1!==e.currentTarget.className.indexOf(k)&&this.close()},_option:function(e,t){var n=this,i=n.calendar;n.options[e]=t,i&&i[e](t)}},j.normalize=n,o.DateView=j,r=s.extend({init:function(e,t){var i,r,a=this;s.fn.init.call(a,e,t),e=a.element,t=a.options,t.min=l(e.attr("min"))||l(t.min),t.max=l(e.attr("max"))||l(t.max),n(t),a._wrapper(),a.dateView=new j(L({},t,{id:e.attr(D),anchor:a.wrapper,change:function(){a._change(this.value()),a.close()},close:function(t){a.trigger(v)?t.preventDefault():(e.attr(A,!1),r.attr(P,!0))},open:function(t){var n,i=a.options;a.trigger(m)?t.preventDefault():(a.element.val()!==a._oldText&&(n=l(e.val(),i.parseFormats,i.culture),a.dateView[n?"current":"value"](n)),e.attr(A,!0),r.attr(P,!1),a._updateARIA(n))}})),r=a.dateView.div,a._icon();try{e[0].setAttribute("type","text")}catch(u){e[0].type="text"}e.addClass("k-input").attr({role:"combobox","aria-expanded":!1,"aria-owns":a.dateView._dateViewID}),a._reset(),a._template(),i=e.is("[disabled]"),i?a.enable(!1):a.readonly(e.is("[readonly]")),a._old=a._update(t.value||a.element.val()),a._oldText=e.val(),o.notify(a)},events:[m,v,_],options:{name:"DatePicker",value:null,footer:"",format:"",culture:"",parseFormats:[],min:new Date(1900,0,1),max:new Date(2099,11,31),start:z,depth:z,animation:{},month:{},dates:[],ARIATemplate:'Current focused date is #=kendo.toString(data.current, "D")#'},setOptions:function(e){var t=this,i=t._value;s.fn.setOptions.call(t,e),e=t.options,e.min=l(e.min),e.max=l(e.max),n(e),t.dateView.setOptions(e),i&&(t.element.val(o.toString(i,e.format,e.culture)),t._updateARIA(i))},_editable:function(e){var t=this,n=t._dateIcon.off(p),r=t.element.off(p),o=t._inputWrapper.off(p),a=e.readonly,s=e.disable;a||s?(o.addClass(s?T:w).removeClass(s?w:T),r.attr(y,s).attr(b,a).attr(O,s).attr(H,a)):(o.addClass(w).removeClass(T).on(S,t._toggleHover),r.removeAttr(y).removeAttr(b).attr(O,!1).attr(H,!1).on("keydown"+p,q(t._keydown,t)).on("blur"+p,q(t._blur,t)).on("focus"+p,function(){t._inputWrapper.addClass(x)}),n.on(g,q(t._click,t)).on(F,i))},readonly:function(e){this._editable({readonly:e===t?!0:e,disable:!1})},enable:function(e){this._editable({readonly:!1,disable:!(e=e===t?!0:e)})},destroy:function(){var e=this;s.fn.destroy.call(e),e.dateView.destroy(),e.element.off(p),e._dateIcon.off(p),e._inputWrapper.off(p),e._form&&e._form.off("reset",e._resetHandler)},open:function(){this.dateView.open()},close:function(){this.dateView.close()},min:function(e){return this._option(M,e)},max:function(e){return this._option(E,e)},value:function(e){var n=this;return e===t?n._value:(n._old=n._update(e),null===n._old&&n.element.val(""),n._oldText=n.element.val(),t)},_toggleHover:function(t){e(t.currentTarget).toggleClass(C,"mouseenter"===t.type)},_blur:function(){var e=this,t=e.element.val();e.close(),t!==e._oldText&&e._change(t),e._inputWrapper.removeClass(x)},_click:function(){var e=this,t=e.element;e.dateView.toggle(),o.support.touch||t[0]===d()||t.focus()},_change:function(e){var t=this;e=t._update(e),+t._old!=+e&&(t._old=e,t._oldText=t.element.val(),t.trigger(_),t.element.trigger(_))},_keydown:function(e){var t=this,n=t.dateView,i=t.element.val();n.popup.visible()||e.keyCode!=u.ENTER||i===t._oldText?(n.move(e),t._updateARIA(n._current)):t._change(i)},_icon:function(){var t,n=this,i=n.element;t=i.next("span.k-select"),t[0]||(t=e('<span unselectable="on" class="k-select"><span unselectable="on" class="k-icon k-i-calendar">select</span></span>').insertAfter(i)),n._dateIcon=t.attr({role:"button","aria-controls":n.dateView._dateViewID})},_option:function(e,n){var i=this,r=i.options;return n===t?r[e]:(n=l(n,r.parseFormats,r.culture),n&&(r[e]=new W(+n),i.dateView[e](n)),t)},_update:function(e){var t,n=this,i=n.options,r=i.min,a=i.max,s=n._value,u=l(e,i.parseFormats,i.culture),c=null===u&&null===s||u instanceof Date&&s instanceof Date;return+u===+s&&c?(t=o.toString(u,i.format,i.culture),t!==e&&n.element.val(null===u?e:t),u):(null!==u&&B(u,r)?u=R(u,r,a):N(u,r,a)||(u=null),n._value=u,n.dateView.value(u),n.element.val(u?o.toString(u,i.format,i.culture):e),n._updateARIA(u),u)},_wrapper:function(){var t,n=this,i=n.element;t=i.parents(".k-datepicker"),t[0]||(t=i.wrap(h).parent().addClass("k-picker-wrap k-state-default"),t=t.wrap(h).parent()),t[0].style.cssText=i[0].style.cssText,i.css({width:"100%",height:i[0].style.height}),n.wrapper=t.addClass("k-widget k-datepicker k-header").addClass(i[0].className),n._inputWrapper=e(t[0].firstChild)},_reset:function(){var t=this,n=t.element,i=n.attr("form"),r=i?e("#"+i):n.closest("form");r[0]&&(t._resetHandler=function(){t.value(n[0].defaultValue)},t._form=r.on("reset",t._resetHandler))},_template:function(){this._ariaTemplate=c(this.options.ARIATemplate)},_updateARIA:function(e){var t,n=this,i=n.dateView.calendar;n.element.removeAttr("aria-activedescendant"),i&&(t=i._cell,t.attr("aria-label",n._ariaTemplate({current:e||i.current()})),n.element.attr("aria-activedescendant",t.attr("id")))}}),a.plugin(r)})(window.kendo.jQuery);(function(e,t){function n(e,t,n){return n?t.substring(0,e).split(n).length-1:0}function i(e,t,i){return t.split(i)[n(e,t,i)]}function r(e,t,i,r){var o=t.split(r);return o.splice(n(e,t,r),1,i),r&&""!==o[o.length-1]&&o.push(""),o.join(r)}var o=window.kendo,a=o.support,s=o.caret,l=o._activeElement,u=a.placeholder,c=o.ui,d=c.List,f=o.keys,h=o.data.DataSource,p="aria-disabled",g="aria-readonly",m="k-state-default",v="disabled",_="readonly",y="k-state-focused",b="k-state-selected",w="k-state-disabled",x="k-state-hover",k=".kendoAutoComplete",C="mouseenter"+k+" mouseleave"+k,T=e.proxy,S=d.extend({init:function(t,n){var i,r=this;r.ns=k,n=e.isArray(n)?{dataSource:n}:n,d.fn.init.call(r,t,n),t=r.element,n=r.options,n.placeholder=n.placeholder||t.attr("placeholder"),u&&t.attr("placeholder",n.placeholder),r._wrapper(),r._loader(),r._dataSource(),r._ignoreCase(),t[0].type="text",i=r.wrapper,r._popup(),t.addClass("k-input").on("keydown"+k,T(r._keydown,r)).on("paste"+k,T(r._search,r)).on("focus"+k,function(){r._prev=r._accessor(),r._placeholder(!1),i.addClass(y)}).on("blur"+k,function(){r._change(),r._placeholder(),i.removeClass(y)}).attr({autocomplete:"off",role:"textbox","aria-haspopup":!0}),r._enable(),r._old=r._accessor(),t[0].id&&t.attr("aria-owns",r.ul[0].id),r._aria(),r._placeholder(),o.notify(r)},options:{name:"AutoComplete",enabled:!0,suggest:!1,template:"",dataTextField:"",minLength:1,delay:200,height:200,filter:"startswith",ignoreCase:!0,highlightFirst:!1,separator:null,placeholder:"",animation:{},value:null},_dataSource:function(){var e=this;e.dataSource&&e._refreshHandler?e._unbindDataSource():(e._refreshHandler=T(e.refresh,e),e._progressHandler=T(e._showBusy,e)),e.dataSource=h.create(e.options.dataSource).bind("change",e._refreshHandler).bind("progress",e._progressHandler)},setDataSource:function(e){this.options.dataSource=e,this._dataSource()},events:["open","close","change","select","dataBinding","dataBound"],setOptions:function(e){d.fn.setOptions.call(this,e),this._template(),this._accessors(),this._aria()},_editable:function(e){var t=this,n=t.element,i=t.wrapper.off(k),r=e.readonly,o=e.disable;r||o?(i.addClass(o?w:m).removeClass(o?m:w),n.attr(v,o).attr(_,r).attr(p,o).attr(g,r)):(i.addClass(m).removeClass(w).on(C,t._toggleHover),n.removeAttr(v).removeAttr(_).attr(p,!1).attr(g,!1))},close:function(){var e=this,t=e._current;t&&t.removeClass(b),e.current(null),e.popup.close()
},destroy:function(){var e=this;e.element.off(k),e.wrapper.off(k),d.fn.destroy.call(e)},refresh:function(){var n,i=this,r=i.ul[0],a=i.popup,s=i.options,u=i._data(),c=u.length;i.trigger("dataBinding"),r.innerHTML=o.render(i.template,u),i._height(c),a.visible()&&a._position(),c&&(s.highlightFirst&&i.current(e(r.firstChild)),s.suggest&&i.suggest(e(r.firstChild))),i._open&&(i._open=!1,n=c?"open":"close",i._typing&&i.element[0]!==l()&&(n="close"),a[n](),i._typing=t),i._touchScroller&&i._touchScroller.reset(),i._makeUnselectable(),i._hideBusy(),i.trigger("dataBound")},select:function(e){this._select(e)},search:function(e){var t,n=this,r=n.options,o=r.ignoreCase,a=r.separator;e=e||n._accessor(),n._current=null,clearTimeout(n._typing),a&&(e=i(s(n.element)[0],e,a)),t=e.length,t?t>=n.options.minLength&&(n._open=!0,n._filterSource({value:o?e.toLowerCase():e,operator:r.filter,field:r.dataTextField,ignoreCase:o})):n.popup.close()},suggest:function(e){var i,r=this,o=r._last,a=r._accessor(),u=r.element[0],c=s(u)[0],h=r.options.separator,p=a.split(h),g=n(c,a,h),m=c;return o==f.BACKSPACE||o==f.DELETE?(r._last=t,t):(e=e||"","string"!=typeof e&&(i=d.inArray(e[0],r.ul[0]),e=i>-1?r._text(r._data()[i]):""),0>=c&&(c=a.toLowerCase().indexOf(e.toLowerCase())+1),i=a.substring(0,c).lastIndexOf(h),i=i>-1?c-(i+h.length):c,a=p[g].substring(0,i),e&&(i=e.toLowerCase().indexOf(a.toLowerCase()),i>-1&&(e=e.substring(i+a.length),m=c+e.length,a+=e),h&&""!==p[p.length-1]&&p.push("")),p[g]=a,r._accessor(p.join(h||"")),u===l()&&s(u,c,m),t)},value:function(e){return e===t?this._accessor():(this._accessor(e),this._old=e,t)},_accessor:function(e){var n=this,i=n.element[0];return e===t?(e=i.value,i.className.indexOf("k-readonly")>-1?e===n.options.placeholder?"":e:e):(i.value=null===e?"":e,n._placeholder(),t)},_accept:function(e){var t=this.element;this._focus(e),s(t,t.val().length)},_keydown:function(t){var n=this,i=n.ul[0],r=t.keyCode,o=n._current,a=n.popup.visible();n._last=r,r===f.DOWN?(a&&n._move(o?o.next():e(i.firstChild)),t.preventDefault()):r===f.UP?(a&&n._move(o?o.prev():e(i.lastChild)),t.preventDefault()):r===f.ENTER||r===f.TAB?(r===f.ENTER&&n.popup.visible()&&t.preventDefault(),n._accept(o)):r===f.ESC?(n.popup.visible()&&t.preventDefault(),n.close()):n._search()},_move:function(e){var t=this;e=e[0]?e:null,t.current(e),t.options.suggest&&t.suggest(e)},_hideBusy:function(){var e=this;clearTimeout(e._busy),e._loading.hide(),e.element.attr("aria-busy",!1),e._busy=null},_showBusy:function(){var e=this;e._busy||(e._busy=setTimeout(function(){e.element.attr("aria-busy",!0),e._loading.show()},100))},_placeholder:function(e){if(!u){var n,i=this,r=i.element,o=i.options.placeholder;if(o){if(n=r.val(),e===t&&(e=!n),e||(o=n!==o?n:""),n===i._old&&!e)return;r.toggleClass("k-readonly",e).val(o),o||r[0]!==document.activeElement||s(r[0],0,0)}}},_search:function(){var e=this;clearTimeout(e._typing),e._typing=setTimeout(function(){e._prev!==e._accessor()&&(e._prev=e._accessor(),e.search())},e.options.delay)},_select:function(t){var n,i,o=this,a=o.options.separator,l=o._data();t=e(t),t[0]&&!t.hasClass(b)&&(i=d.inArray(t[0],o.ul[0]),i>-1&&(l=l[i],n=o._text(l),a&&(n=r(s(o.element)[0],o._accessor(),n,a)),o._accessor(n),o._prev=o._accessor(),o.current(t.addClass(b))))},_loader:function(){this._loading=e('<span class="k-icon k-loading" style="display:none"></span>').insertAfter(this.element)},_toggleHover:function(t){e(t.currentTarget).toggleClass(x,"mouseenter"===t.type)},_wrapper:function(){var e,t=this,n=t.element,i=n[0];e=n.parent(),e.is("span.k-widget")||(e=n.wrap("<span />").parent()),e.attr("tabindex",-1),e.attr("role","presentation"),e[0].style.cssText=i.style.cssText,n.css({width:"100%",height:i.style.height}),t._focused=t.element,t.wrapper=e.addClass("k-widget k-autocomplete k-header").addClass(i.className)}});c.plugin(S)})(window.kendo.jQuery);(function(e,t){function n(e,t,n){for(var i,r=0,o=t.length-1;o>r;++r)i=t[r],i in e||(e[i]={}),e=e[i];e[t[o]]=n}var i=window.kendo,r=i.ui,o=r.Select,a=i.support.mobileOS,s=".kendoDropDownList",l="disabled",u="readonly",c="change",d="k-state-focused",f="k-state-default",h="k-state-disabled",p="aria-disabled",g="aria-readonly",m="k-state-selected",v="mouseenter"+s+" mouseleave"+s,_="tabindex",y=e.proxy,b=o.extend({init:function(n,r){var a,l,u,c=this,d=r&&r.index;c.ns=s,r=e.isArray(r)?{dataSource:r}:r,o.fn.init.call(c,n,r),c._focusHandler=function(){c.wrapper.focus()},r=c.options,n=c.element.on("focus"+s,c._focusHandler),this._inputTemplate(),c._reset(),c._word="",c._wrapper(),c._tabindex(),c.wrapper.data(_,c.wrapper.attr(_)),c._aria(),c._span(),c._popup(),c._mobile(),c._dataSource(),c._ignoreCase(),c._enable(),c._oldIndex=c.selectedIndex=-1,c._cascade(),d!==t&&(r.index=d),r.autoBind?c.dataSource.fetch():-1===c.selectedIndex&&(u=r.text||"",u||(a=r.optionLabel,l=a&&0===r.index,c._isSelect?u=l?a:n.children(":selected").text():!n[0].value&&l&&(u=a)),c._textAccessor(u)),i.notify(c)},options:{name:"DropDownList",enabled:!0,autoBind:!0,index:0,text:null,value:null,template:"",valueTemplate:"",delay:500,height:200,dataTextField:"",dataValueField:"",optionLabel:"",cascadeFrom:"",cascadeFromField:"",ignoreCase:!0,animation:{}},events:["open","close",c,"select","dataBinding","dataBound","cascade"],setOptions:function(e){o.fn.setOptions.call(this,e),this._template(),this._inputTemplate(),this._accessors(),this._aria()},destroy:function(){var e=this;e.wrapper.off(s),e.element.off(s),e._inputWrapper.off(s),o.fn.destroy.call(e)},open:function(){var e=this;e.ul[0].firstChild?(e.popup.open(),e._scroll(e._current)):(e._open=!0,e._request||e.dataSource.fetch())},toggle:function(e){this._toggle(e,!0)},refresh:function(){var e,t=this,n=t._data(),r=n.length,o=t.options.optionLabel,a=t.element[0];t.trigger("dataBinding"),t._current&&t.current(null),t.ul[0].innerHTML=i.render(t.template,n),t._height(r),t.popup.visible()&&t.popup._position(),t._isSelect&&(e=a.selectedIndex,o&&r&&(o='<option value="">'+t._optionLabelText(o)+"</option>"),t._options(n,o),a.selectedIndex=-1===e?0:e),t._open&&(t._open=!1,t.toggle(!!r)),t._hideBusy(),t._makeUnselectable(),t._fetch||(r?t._selectItem():t._textAccessor()!==o&&(t.element.val(""),t._textAccessor(""))),t._bound=!!r,t.trigger("dataBound")},search:function(e){if(e){var n=this,i=n.options.ignoreCase;i&&(e=e.toLowerCase()),n._select(function(r){var o=n._text(r);return o!==t?(o+="",i&&(o=o.toLowerCase()),0===o.indexOf(e)):t})}},text:function(e){var n,i,r=this,o=r.options.ignoreCase;return e=null===e?"":e,e===t?r._textAccessor():("string"==typeof e&&(i=o?e.toLowerCase():e,n=r._select(function(e){return e=r._text(e),o&&(e=(e+"").toLowerCase()),e===i}),n&&(e=n)),r._textAccessor(e),t)},value:function(e){var n,i,r=this;return e===t?r._accessor():(null!==e&&(e=""+e),r._selectedValue=e,i=e||r.options.optionLabel&&!r.element[0].disabled&&""===e,i&&r._fetchItems(e)||(n=r._index(e),r.select(n>-1?n:0)),t)},_editable:function(e){var t=this,n=t.element,r=e.disable,o=e.readonly,a=t.wrapper.off(s),c=t._inputWrapper.off(v),m=function(){c.addClass(d),t._blured=!1},b=function(){if(!t._blured){t._triggerCascade();var e=window.self!==window.top;i.support.mobileOS.ios&&e?t._change():t._blur(),c.removeClass(d),t._blured=!0,n.blur()}};o||r?(r?(a.removeAttr(_),c.addClass(h).removeClass(f)):(c.addClass(f).removeClass(h),a.on("focusin"+s,m).on("focusout"+s,b)),n.attr(l,r).attr(u,o),a.attr(p,r).attr(g,o)):(n.removeAttr(l).removeAttr(u),c.addClass(f).removeClass(h).on(v,t._toggleHover),a.attr(_,a.data(_)).attr(p,!1).attr(g,!1).on("click"+s,function(e){t._blured=!1,e.preventDefault(),t._toggle()}).on("keydown"+s,y(t._keydown,t)).on("keypress"+s,y(t._keypress,t)).on("focusin"+s,m).on("focusout"+s,b))},_accept:function(e){this._focus(e)},_optionLabelText:function(){var e=this.options,t=e.dataTextField,n=e.optionLabel;return n&&t&&"object"==typeof n?this._text(n):n},_data:function(){var e=this,t=e.options,r=t.optionLabel,o=t.dataTextField,a=t.dataValueField,s=e.dataSource.view(),l=s.length,u=r,c=0;if(r&&l){for("object"==typeof r?u=r:o&&(u={},o=o.split("."),a=a.split("."),n(u,a,""),n(u,o,r)),u=new i.data.ObservableArray([u]);l>c;c++)u.push(s[c]);s=u}return s},_selectItem:function(){o.fn._selectItem.call(this),this.current()||this.select(0)},_keydown:function(e){var t=this,n=e.keyCode,r=i.keys,o=t.ul[0];n===r.LEFT?n=r.UP:n===r.RIGHT&&(n=r.DOWN),e.keyCode=n,t._move(e),n===r.HOME?(e.preventDefault(),t._select(o.firstChild)):n===r.END&&(e.preventDefault(),t._select(o.lastChild))},_selectNext:function(e,n){for(var i,r=this,o=n,a=r._data(),s=a.length,l=r.options.ignoreCase,u=function(n,i){return n+="",l&&(n=n.toLowerCase()),0===n.indexOf(e)?(r._select(i),r._triggerEvents(),!0):t};s>n;n++)if(i=r._text(a[n]),i&&u(i,n))return!0;if(o>0&&s>o)for(n=0;o>=n;n++)if(i=r._text(a[n]),i&&u(i,n))return!0;return!1},_keypress:function(e){if(0!==e.which&&e.keyCode!==i.keys.ENTER){var t=this,n=String.fromCharCode(e.charCode||e.keyCode),r=t.selectedIndex,o=t._word;t.options.ignoreCase&&(n=n.toLowerCase())," "===n&&e.preventDefault(),t._last===n&&1>=o.length&&r>-1&&(o||(o=n),t._selectNext(o,r+1))||(t._word=o+n,t._last=n,t._search())}},_popup:function(){o.fn._popup.call(this),this.popup.one("open",y(function(){var e=this.popup;e.wrapper=i.wrap(e.element),e.element.closest(".km-root")[0]&&(e.wrapper.addClass("km-popup km-widget"),this.wrapper.addClass("km-widget"))},this))},_search:function(){var e=this,n=e.dataSource,i=e.selectedIndex,r=e._word;return clearTimeout(e._typing),e._typing=setTimeout(function(){e._word=""},e.options.delay),-1===i&&(i=0),e.ul[0].firstChild?(e._selectNext(r,i),e._triggerEvents(),t):(n.one(c,function(){n.data()[0]&&i>-1&&e._selectNext(r,i)}).fetch(),t)},_select:function(e){var n,i,o=this,a=o._current,s=null;return e=o._get(e),e&&e[0]&&!e.hasClass(m)&&(a&&a.removeClass(m),i=r.List.inArray(e[0],o.ul[0]),i>-1&&(s=o._data()[i],n=o._value(s),o.selectedIndex=i,o._textAccessor(s),o._accessor(n!==t?n:o._text(s),i),o._selectedValue=o._accessor(),o.current(e.addClass(m)),o._optionID&&o._current.attr("aria-selected",!0))),s},_triggerEvents:function(){this.popup.visible()||(this._triggerCascade(),this._change())},_mobile:function(){var e=this,t=e.popup,n=t.element.parents(".km-root").eq(0);n.length&&a&&(t.options.animation.open.effects=a.android||a.meego?"fadeIn":a.ios||a.wp?"slideIn:up":t.options.animation.open.effects)},_span:function(){var t,n=this,i=n.wrapper,r="span.k-input";t=i.find(r),t[0]||(i.append('<span unselectable="on" class="k-dropdown-wrap k-state-default"><span unselectable="on" class="k-input">&nbsp;</span><span unselectable="on" class="k-select"><span unselectable="on" class="k-icon k-i-arrow-s">select</span></span></span>').append(n.element),t=i.find(r)),n.span=t,n._inputWrapper=e(i[0].firstChild),n._arrow=i.find(".k-icon").mousedown(function(e){e.preventDefault()})},_wrapper:function(){var e,t=this,n=t.element,i=n[0];e=n.parent(),e.is("span.k-widget")||(e=n.wrap("<span />").parent(),e[0].style.cssText=i.style.cssText),n.hide(),t._focused=t.wrapper=e.addClass("k-widget k-dropdown k-header").addClass(i.className).css("display","").attr({unselectable:"on",role:"listbox","aria-haspopup":!0,"aria-expanded":!1})},_clearSelection:function(){var e=this,n=e.options.optionLabel;return e.options.value="",e._selectedValue="",e.dataSource.view()[0]&&(n||e._userTriggered)?(e.select(0),t):(e.selectedIndex=-1,e.element.val(""),e._textAccessor(e.options.optionLabel),t)},_inputTemplate:function(){var t=this,n=t.options.valueTemplate;n=n?i.template(n):e.proxy(i.template("#:this._text(data)#",{useWithBlock:!1}),t),t.valueTemplate=n},_textAccessor:function(r){var o=this.dataItem(),a=this.options,s=this.span;return r===t?s.text():(e.isPlainObject(r)||r instanceof i.data.ObservableObject?o=r:o&&this._text(o)===r||(a.dataTextField?(o={},n(o,a.dataTextField.split("."),r),n(o,a.dataValueField.split("."),this._accessor())):o=r),s.html(this.valueTemplate(o)),t)}});r.plugin(b)})(window.kendo.jQuery);(function(e,t){var n=window.kendo,i=n.ui,r=i.List,o=i.Select,a=n.caret,s=n.support,l=s.placeholder,u=n._activeElement,c=n.keys,d=".kendoComboBox",f="click"+d,h="mousedown"+d,p="disabled",g="readonly",m="change",v="k-state-default",_="k-state-focused",y="k-state-disabled",b="aria-disabled",w="aria-readonly",x="k-state-selected",k="filter",C="accept",T="rebind",S="mouseenter"+d+" mouseleave"+d,F=null,D=e.proxy,M=o.extend({init:function(t,i){var r,a=this;a.ns=d,i=e.isArray(i)?{dataSource:i}:i,o.fn.init.call(a,t,i),a._focusHandler=function(){a.input.focus()},i=a.options,t=a.element.on("focus"+d,a._focusHandler),i.placeholder=i.placeholder||t.attr("placeholder"),a._reset(),a._wrapper(),a._input(),a._tabindex(a.input),a._popup(),a._dataSource(),a._ignoreCase(),a._enable(),a._oldIndex=a.selectedIndex=-1,a._cascade(),a._aria(),i.autoBind?a._filterSource():(r=i.text,!r&&a._isSelect&&(r=t.children(":selected").text()),r&&(a.input.val(r),a._prev=r)),r||a._placeholder(),n.notify(a)},options:{name:"ComboBox",enabled:!0,index:-1,text:null,value:null,autoBind:!0,delay:200,dataTextField:"",dataValueField:"",minLength:0,height:200,highlightFirst:!0,template:"",filter:"none",placeholder:"",suggest:!1,cascadeFrom:"",cascadeFromField:"",ignoreCase:!0,animation:{}},events:["open","close",m,"select","dataBinding","dataBound","cascade"],setOptions:function(e){o.fn.setOptions.call(this,e),this._template(),this._accessors(),this._aria()},current:function(e){var n=this,i=n._current;return e===t?i:(i&&i.removeClass(x),o.fn.current.call(n,e),t)},destroy:function(){var e=this;e.input.off(d),e.element.off(d),e._inputWrapper.off(d),o.fn.destroy.call(e)},_editable:function(e){var t=this,n=e.disable,i=e.readonly,r=t._inputWrapper.off(d),o=t.element.add(t.input.off(d)),a=t._arrow.parent().off(f+" "+h);i||n?(r.addClass(n?y:v).removeClass(n?v:y),o.attr(p,n).attr(g,i).attr(b,n).attr(w,i)):(r.addClass(v).removeClass(y).on(S,t._toggleHover),o.removeAttr(p).removeAttr(g).attr(b,!1).attr(w,!1),a.on(f,function(){t._toggle()}).on(h,function(e){e.preventDefault()}),t.input.on("keydown"+d,D(t._keydown,t)).on("focus"+d,function(){r.addClass(_),t._placeholder(!1)}).on("blur"+d,function(){r.removeClass(_),clearTimeout(t._typing),t._typing=null,t.options.text!==t.input.val()&&t.text(t.text()),t._placeholder(),t._blur(),t.element.blur()}))},open:function(){var e=this,t=e.dataSource.options.serverFiltering;e.popup.visible()||(!e.ul[0].firstChild||e._state===C&&!t?(e._open=!0,e._state=T,e._filterSource()):(e.popup.open(),e._scroll(e._current)))},refresh:function(){var i,r,o=this,a=o.ul[0],s=o.options,l=o._state,c=o._data(),d=c.length,f=!0;o.trigger("dataBinding"),a.innerHTML=n.render(o.template,c),o._height(d),o.popup.visible()&&o.popup._position(),o._isSelect&&(i=o.element[0].children[0],l===T&&(o._state=""),r=o._option,o._option=t,o._options(c),r&&r[0].selected?o._custom(r.val(),f):o._bound||i||o._custom("",f)),d&&(s.highlightFirst&&o.current(e(a.firstChild)),s.suggest&&o.input.val()&&o._request!==t&&o.suggest(e(a.firstChild))),l===k||o._fetch||o._selectItem(),o._open&&(o._open=!1,o._typing&&o.input[0]!==u()?o.popup.close():o.toggle(!!d),o._typing=null),o._touchScroller&&o._touchScroller.reset(),o._makeUnselectable(),o._hideBusy(),o._bound=!0,o.trigger("dataBound")},search:function(e){e="string"==typeof e?e:this.text();var t=this,n=e.length,i=t.options,r=i.ignoreCase,o=i.filter,a=i.dataTextField;clearTimeout(t._typing),n>=i.minLength&&(t._state=k,"none"===o?t._filter(e):(t._open=!0,t._filterSource({value:r?e.toLowerCase():e,field:a,operator:o,ignoreCase:r})))},suggest:function(e){var n,i=this,o=i.input[0],s=i.text(),l=a(o)[0],d=i._last;return d==c.BACKSPACE||d==c.DELETE?(i._last=t,t):(e=e||"","string"!=typeof e&&(n=r.inArray(e[0],i.ul[0]),e=n>-1?i._text(i.dataSource.view()[n]):""),0>=l&&(l=s.toLowerCase().indexOf(e.toLowerCase())+1),e?(n=e.toLowerCase().indexOf(s.toLowerCase()),n>-1&&(s+=e.substring(n+s.length))):s=s.substring(0,l),s.length===l&&e||(o.value=s,o===u()&&a(o,l,s.length)),t)},text:function(e){var n,i,r,o,a,s;return e=null===e?"":e,n=this,i=n.input[0],r=n.options.ignoreCase,o=e,e===t?i.value:(a=n.dataItem(),a&&n._text(a)===e&&(s=n._value(a),null===s?s="":s+="",s===n._old)?(n._triggerCascade(),t):(r&&(o=o.toLowerCase()),n._select(function(e){return e=n._text(e),r&&(e=(e+"").toLowerCase()),e===o}),0>n.selectedIndex&&(n._custom(e),i.value=e),n._prev=i.value,n._triggerCascade(),t))},toggle:function(e){this._toggle(e,!0)},value:function(e){var n,i=this,r=i.options;return e===t?i._accessor():(null!==e&&(e=""+e),i._selectedValue=e,!i._open&&e&&i._fetchItems(e)||(n=i._index(e),n>-1?i.select(n):(i.current(F),i._custom(e),(r.value!==e||r.text!==i.input.val())&&(i.text(e),i._placeholder())),i._old=i._accessor(),i._oldIndex=i.selectedIndex),t)},_accept:function(e){var t=this;e?t._focus(e):(t.text(t.text()),t._change())},_custom:function(t,n){var i=this,r=i.element,o=i._option;i._state!==k||n||(i._state=C),i._isSelect?(o||(o=i._option=e("<option/>"),r.append(o)),o.text(t),o[0].selected=!0):r.val(t),i._selectedValue=t},_filter:function(e){var n=this,i=n.options,r=n.dataSource,o=i.ignoreCase,a=function(i){var r=n._text(i);return r!==t?(r+="",""!==r&&""===e?!1:(o&&(r=r.toLowerCase()),0===r.indexOf(e))):t};return o&&(e=e.toLowerCase()),n.ul[0].firstChild?(-1!==n._highlight(a)&&(i.suggest&&n._current&&n.suggest(n._current),n.open()),n._hideBusy(),t):(r.one(m,function(){r.data()[0]&&n.search(e)}).fetch(),t)},_highlight:function(n){var i,o=this;return n===t||null===n?-1:(n=o._get(n),i=r.inArray(n[0],o.ul[0]),-1==i&&(o.options.highlightFirst&&!o.text()?(n=o.ul[0].firstChild,n&&(n=e(n))):n=F),o.current(n),i)},_input:function(){var t,n=this,i=n.element.removeClass("k-input")[0],r=i.accessKey,o=n.wrapper,a="input.k-input",s=i.name||"";s&&(s='name="'+s+'_input" '),t=o.find(a),t[0]||(o.append('<span tabindex="-1" unselectable="on" class="k-dropdown-wrap k-state-default"><input '+s+'class="k-input" type="text" autocomplete="off"/><span tabindex="-1" unselectable="on" class="k-select"><span unselectable="on" class="k-icon k-i-arrow-s">select</span></span></span>').append(n.element),t=o.find(a)),t[0].style.cssText=i.style.cssText,i.maxLength>-1&&(t[0].maxLength=i.maxLength),t.addClass(i.className).val(this.options.text||i.value).css({width:"100%",height:i.style.height}).attr({role:"combobox","aria-expanded":!1}).show(),l&&t.attr("placeholder",n.options.placeholder),r&&(i.accessKey="",t[0].accessKey=r),n._focused=n.input=t,n._inputWrapper=e(o[0].firstChild),n._arrow=o.find(".k-icon").attr({role:"button",tabIndex:-1}),i.id&&n._arrow.attr("aria-controls",n.ul[0].id)},_keydown:function(e){var t=this,n=e.keyCode;t._last=n,clearTimeout(t._typing),t._typing=null,n==c.TAB||t._move(e)||t._search()},_placeholder:function(e){if(!l){var n,i=this,r=i.input,o=i.options.placeholder;if(o){if(n=i.value(),e===t&&(e=!n),r.toggleClass("k-readonly",e),!e){if(n)return;o=""}r.val(o),o||r[0]!==u()||a(r[0],0,0)}}},_search:function(){var e=this;e._typing=setTimeout(function(){var t=e.text();e._prev!==t&&(e._prev=t,e.search(t)),e._typing=null},e.options.delay)},_select:function(e){var n,i,r=this,o=r._data(),a=r._highlight(e);r.selectedIndex=a,-1!==a&&(r._state===k&&(r._state=C),r._current.addClass(x),o=o[a],n=r._text(o),i=r._value(o),r._prev=r.input[0].value=n,r._accessor(i!==t?i:n,a),r._selectedValue=r._accessor(),r._placeholder(),r._optionID&&r._current.attr("aria-selected",!0))},_wrapper:function(){var e=this,t=e.element,n=t.parent();n.is("span.k-widget")||(n=t.hide().wrap("<span />").parent(),n[0].style.cssText=t[0].style.cssText),e.wrapper=n.addClass("k-widget k-combobox k-header").addClass(t[0].className).css("display","")},_clearSelection:function(e,t){var n=this,i=e._selectedValue||e.value(),r=i&&-1===e.selectedIndex;(t||!i||r)&&(n.value(""),n.options.value="")}});i.plugin(M)})(window.kendo.jQuery);(function(e,t){function n(e,t){var n;if(null===e&&null!==t||null!==e&&null===t)return!1;if(n=e.length,n!==t.length)return!1;for(;n--;)if(e[n]!==t[n])return!1;return!0}function i(t){var n=t.firstChild;return n&&"none"===n.style.display&&(n=o(n,x)),n?e(n):n}function r(t){var n=t.lastChild;return n&&"none"===n.style.display&&(n=o(n,k)),n?e(n):n}function o(e,t){return e=e[t],e&&"none"===e.style.display&&(e=o(e,t)),e}var a=window.kendo,s=a.ui,l=s.List,u=a.keys,c=a._activeElement,d=a.data.ObservableArray,f=e.proxy,h="id",p="li",g="accept",m="filter",v="open",_="close",y="change",b="progress",w="select",x="nextSibling",k="previousSibling",C=' style="display:none"',T="aria-disabled",S="aria-readonly",F="k-state-focused",D="k-loading-hidden",M="k-state-hover",E="k-state-disabled",O="disabled",A="readonly",z=".kendoMultiSelect",P="click"+z,H="keydown"+z,I="mouseenter"+z,N="mouseleave"+z,L=I+" "+N,R=/"/g,B=e.isArray,W=["font-family","font-size","font-stretch","font-style","font-weight","letter-spacing","text-transform","line-height"],q=l.extend({init:function(t,n){var i,r,o=this;o.ns=z,l.fn.init.call(o,t,n),o._wrapper(),o._tagList(),o._input(),o._textContainer(),o._loader(),o._tabindex(o.input),t=o.element.attr("multiple","multiple").hide(),n=o.options,r=n.value,n.placeholder||(n.placeholder=t.data("placeholder")),i=t.attr(h),i&&(o._tagID=i+"_tag_active",i+="_taglist",o.tagList.attr(h,i)),o._aria(i),o._dataSource(),o._ignoreCase(),o._popup(),o._values=[],o._dataItems=[],o._reset(),o._enable(),o._placeholder(),n.autoBind?o.dataSource.fetch():r&&(B(r)||(r=[r]),(e.isPlainObject(r[0])||!n.dataValueField)&&(o._retrieveData=!0,o.dataSource.data(r),o.value(o._initialValues))),a.notify(o)},options:{name:"MultiSelect",enabled:!0,autoBind:!0,autoClose:!0,highlightFirst:!0,dataTextField:"",dataValueField:"",filter:"startswith",ignoreCase:!0,minLength:0,delay:100,value:null,maxSelectedItems:null,itemTemplate:"",tagTemplate:"",placeholder:"",height:200,animation:{}},events:[v,_,y,w,"dataBinding","dataBound"],setDataSource:function(e){this.options.dataSource=e,this._dataSource(),this.options.autoBind&&this.dataSource.fetch()},setOptions:function(e){l.fn.setOptions.call(this,e),this._template(),this._accessors(),this._aria(this.tagList.attr(h))},current:function(e){return this.currentTag(null),l.fn.current.call(this,e)},currentTag:function(e){var n=this;return e===t?n._currentTag:(n._currentTag&&(n._currentTag.removeClass(F).removeAttr(h),n.input.removeAttr("aria-activedescendant")),e&&(e.addClass(F).attr(h,n._tagID),n.input.attr("aria-activedescendant",n._tagID)),n._currentTag=e,t)},dataItems:function(){return this._dataItems},destroy:function(){var e=this,t=e.ns;e.wrapper.off(t),e.tagList.off(t),e.input.off(t),l.fn.destroy.call(e)},_editable:function(t){var n=this,i=t.disable,r=t.readonly,o=n.wrapper.off(z),a=n.tagList.off(z),s=n.element.add(n.input.off(z));r||i?(i?o.addClass(E):o.removeClass(E),s.attr(O,i).attr(A,r).attr(T,i).attr(S,r)):(o.removeClass(E).on(L,n._toggleHover).on("mousedown"+z,function(e){var t="input"!==e.target.nodeName.toLowerCase();t&&e.preventDefault(),-1===e.target.className.indexOf("k-delete")&&(n.input[0]!==c()&&t&&n.input.focus(),0===n.options.minLength&&n.open())}),n.input.on(H,f(n._keydown,n)).on("paste"+z,f(n._search,n)).on("focus"+z,function(){n._placeholder(!1),o.addClass(F)}).on("blur"+z,function(){clearTimeout(n._typing),o.removeClass(F),n._placeholder(!n._dataItems[0],!0),n.close(),n._state===m&&(n._state=g),n.element.blur()}),s.removeAttr(O).removeAttr(A).attr(T,!1).attr(S,!1),a.on(I,p,function(){e(this).addClass(M)}).on(N,p,function(){e(this).removeClass(M)}).on(P,".k-delete",function(t){n._unselect(e(t.target).closest(p)),n._change(),n.close()}))},_close:function(){var e=this;e.options.autoClose||!e._visibleItems?e.close():(e.current(e.options.highlightFirst?i(e.ul[0]):null),e.popup._position())},close:function(){this.popup.close(),this.current(null)},open:function(){var e=this;e._request&&(e._retrieveData=!1),!e.ul[0].firstChild||e._state===g||e._retrieveData?(e._state="",e._open=!0,e._retrieveData=!1,e._filterSource()):e._visibleItems&&e._allowSelection()&&(e.popup.open(),e.current(e.options.highlightFirst?i(e.ul[0]):null))},toggle:function(e){e=e!==t?e:!this.popup.visible(),this[e?v:_]()},refresh:function(){var e,t=this,n=null;t.trigger("dataBinding"),e=t._render(t.dataSource.view()),t._height(e),t._setInitialValues&&(t._setInitialValues=!1,t.value(t._initialValues)),t._open&&(t._open=!1,t.toggle(e)),t.popup.visible()&&(t.popup._position(),t.options.highlightFirst&&(n=i(t.ul[0]))),t.current(n),t._touchScroller&&t._touchScroller.reset(),t._makeUnselectable(),t._hideBusy(),t.trigger("dataBound")},search:function(e){var t=this,n=t.options,i=n.ignoreCase,r=n.filter,o=n.dataTextField,a=t.input.val();n.placeholder===a&&(a=""),clearTimeout(t._typing),e="string"==typeof e?e:a,e.length>=n.minLength&&(t._state=m,t._open=!0,t._filterSource({value:i?e.toLowerCase():e,field:o,operator:r,ignoreCase:i}))},value:function(n){var i,r=this,o=e(r.tagList[0].children),a=o.length,s=0;if(n===t)return r._values;if(!r._fetchItems(n)){for(;a>s;s++)r._unselect(o.eq(s));if(null!==n){for(n=B(n)||n instanceof d?n:[n],s=0,a=n.length;a>s;s++)i=r._index(n[s]),i>-1&&r._select(i);r._old=r._values.slice()}}},_dataSource:function(){var e=this,t=e.element,n=e.options,i=n.dataSource||{};i=B(i)?{data:i}:i,i.select=t,i.fields=[{field:n.dataTextField},{field:n.dataValueField}],e.dataSource&&e._refreshHandler?e._unbindDataSource():(e._refreshHandler=f(e.refresh,e),e._progressHandler=f(e._showBusy,e)),e.dataSource=a.data.DataSource.create(i).bind(y,e._refreshHandler).bind(b,e._progressHandler)},_fetchItems:function(n){var i=this,r=e.isArray(n)&&0===n.length;if(!r&&n)return i._fetch||i.ul[0].firstChild?t:(i.dataSource.one(y,function(){i.value(n),i._fetch=!1}),i._fetch=!0,i.dataSource.fetch(),!0)},_reset:function(){var t=this,n=t.element,i=n.attr("form"),r=i?e("#"+i):n.closest("form");r[0]&&(t._resetHandler=function(){setTimeout(function(){t.value(t._initialValues)})},t._form=r.on("reset",t._resetHandler))},_initValue:function(){var e=this,n=e.options.value||e.element.val();null===n?n=[]:(B(n)||(n=[n]),n=e._mapValues(n)),e._old=e._initialValues=n,e._setInitialValues=n[0]!==t},_mapValues:function(t){var n=this;return t&&e.isPlainObject(t[0])&&(t=e.map(t,function(e){return n._value(e)})),t},_change:function(){var e=this,t=e.value();n(t,e._old)||(e._old=t.slice(),e.trigger(y),e.element.trigger(y))},_click:function(n){var i=this,r=e(n.currentTarget);if(!n.isDefaultPrevented()){if(i.trigger(w,{item:r}))return i._close(),t;i._select(r),i._change(),i._close()}},_item:function(e,t){return e=e[t](),e[0]&&!e.is(":visible")&&(e=this._item(e,t)),e},_keydown:function(n){var s=this,l=n.keyCode,c=s._currentTag,d=s._current,f=s.input.val(),h=a.support.isRtl(s.wrapper),p=s.popup.visible();if(l===u.DOWN){if(n.preventDefault(),!p)return s.open(),t;d=d?o(d[0],x):i(s.ul[0]),d&&s.current(e(d))}else if(l===u.UP)p&&(d=d?o(d[0],k):r(s.ul[0]),s.current(e(d)),s._current[0]||s.close()),n.preventDefault();else if(l===u.LEFT&&!h||l===u.RIGHT&&h)f||(c=c?c.prev():e(s.tagList[0].lastChild),c[0]&&s.currentTag(c));else if(l===u.RIGHT&&!h||l===u.LEFT&&h)!f&&c&&(c=c.next(),s.currentTag(c[0]?c:null));else if(l===u.ENTER&&p){if(d){if(s.trigger(w,{item:d}))return s._close(),t;s._select(d)}s._change(),s._close(),n.preventDefault()}else l===u.ESC?(p?n.preventDefault():s.currentTag(null),s.close()):l===u.HOME?p?s.current(i(s.ul[0])):f||(c=s.tagList[0].firstChild,c&&s.currentTag(e(c))):l===u.END?p?s.current(r(s.ul[0])):f||(c=s.tagList[0].lastChild,c&&s.currentTag(e(c))):l!==u.DELETE&&l!==u.BACKSPACE||f?(clearTimeout(s._typing),setTimeout(function(){s._scale()}),s._search()):(l!==u.BACKSPACE||c||(c=e(s.tagList[0].lastChild)),c&&c[0]&&(s._unselect(c),s._change(),s._close()))},_hideBusy:function(){var e=this;clearTimeout(e._busy),e.input.attr("aria-busy",!1),e._loading.addClass(D),e._request=!1,e._busy=null},_showBusy:function(){var e=this;e._request=!0,e._busy||(e._busy=setTimeout(function(){e.input.attr("aria-busy",!0),e._loading.removeClass(D)},100))},_placeholder:function(e,n){var i=this,r=i.input,o=c();e===t&&(e=!1,r[0]!==o&&(e=!i._dataItems[0])),i._prev="",r.toggleClass("k-readonly",e).val(e?i.options.placeholder:""),r[0]!==o||n||a.caret(r[0],0,0),i._scale()},_scale:function(){var e,t=this,n=t.wrapper,i=n.width(),r=t._span.text(t.input.val());n.is(":visible")?e=r.width()+25:(r.appendTo(document.documentElement),i=e=r.width()+25,r.appendTo(n)),t.input.width(e>i?i:e)},_option:function(e,n){var i="<option",r=this._text(e),o=this._value(e);return o!==t&&(o+="",-1!==o.indexOf('"')&&(o=o.replace(R,"&quot;")),i+=' value="'+o+'"'),n&&(i+=' selected="selected"'),i+=">",r!==t&&(i+=a.htmlEncode(r)),i+="</option>"},_render:function(e){for(var t,n,i=this,r=e.length,o=i.itemTemplate,a=i._dataItems.slice(0),s=0,l=0,u="",c="";r>l;l++)t=e[l],n=i._selected(a,t),c+=o(t,l,n),u+=i._option(t,n),n||(s+=1);if(r=a.length)for(l=0;r>l;l++)u+=i._option(a[l],!0);return i.ul[0].innerHTML=c,i.element.html(u),i._visibleItems=s,s},_selected:function(e,n){var i,r=this,o=r._text,a=r._value,s=a(n),l=e.length,u=!1,c=0;for(s===t&&(s=o(n));l>c;c++)if(n=e[c],i=a(n),i===t&&(i=o(n)),i!==t&&i===s){u=!0;break}return u&&e.splice(c,1),u},_search:function(){var e=this;e._typing=setTimeout(function(){var t=e.input.val();e._prev!==t&&(e._prev=t,e.search(t))},e.options.delay)},_allowSelection:function(){var e=this.options.maxSelectedItems;return null===e||e>this._values.length},_select:function(e){var t,n,i=this,r=i._values;i._allowSelection()&&(isNaN(e)?n=e.hide().data("idx"):(n=e,i.ul[0].children[n].style.display="none"),i.element[0].children[n].selected=!0,t=i.dataSource.view()[n],i.tagList.append(i.tagTemplate(t)),i._dataItems.push(t),r.push(i._dataValue(t)),i._visibleItems-=1,i.currentTag(null),i._placeholder(),i._height(i._visibleItems),i._state===m&&(i._state=g))},_unselect:function(t){var n,i,r,o,a,s=this,l=t.index();if(t.remove(),s.currentTag(null),s._values.splice(l,1),n=s._dataItems.splice(l,1)[0],i=s._dataValue(n),l=s._index(i),-1!==l)e(s.ul[0].children[l]).show(),s.element[0].children[l].selected=!1,s._visibleItems+=1,s._height(s._visibleItems);else for(l=s.dataSource.view().length,r=s.element[0].children,a=r.length;a>l;l++)if(o=r[l],o.value==i){o.selected=!1;break}s._placeholder()},_template:function(){var e,t=this,n=t.options,i=n.itemTemplate,r=n.tagTemplate,o=n.dataSource;t.element[0].length&&!o&&(n.dataTextField=n.dataTextField||"text",n.dataValueField=n.dataValueField||"value"),e=a.template("#:"+a.expr(n.dataTextField,"data")+"#",{useWithBlock:!1}),i=i?a.template(i):e,r=r?a.template(r):e,t.itemTemplate=function(e,t,n){return'<li tabindex="-1" role="option" data-idx="'+t+'" unselectable="on" class="k-item"'+(n?C:"")+">"+i(e)+"</li>"},t.tagTemplate=function(e){return'<li class="k-button" unselectable="on"><span unselectable="on">'+r(e)+'</span><span unselectable="on" class="k-icon k-delete">delete</span></li>'}},_input:function(){var t=this,n=t.element[0].accessKey,i=t._innerWrapper.children("input.k-input");i[0]||(i=e('<input class="k-input" style="width: 25px" />').appendTo(t._innerWrapper)),t.element.removeAttr("accesskey"),t._focused=t.input=i.attr({accesskey:n,role:"listbox","aria-expanded":!1})},_tagList:function(){var t=this,n=t._innerWrapper.children("ul");n[0]||(n=e('<ul role="listbox" unselectable="on" class="k-reset"/>').appendTo(t._innerWrapper)),t.tagList=n},_loader:function(){this._loading=e('<span class="k-icon k-loading '+D+'"></span>').insertAfter(this.input)},_textContainer:function(){var t=a.getComputedStyles(this.input[0],W);t.position="absolute",t.visibility="hidden",t.top=-3333,t.left=-3333,this._span=e("<span/>").css(t).appendTo(this.wrapper)},_wrapper:function(){var t=this,n=t.element,i=n.parent("span.k-multiselect");i[0]||(i=n.wrap('<div class="k-widget k-multiselect k-header" unselectable="on" />').parent(),i[0].style.cssText=n[0].style.cssText,e('<div class="k-multiselect-wrap k-floatwrap" unselectable="on" />').insertBefore(n)),t.wrapper=i.addClass(n[0].className).css("display",""),t._innerWrapper=e(i[0].firstChild)
}});s.plugin(q)})(window.kendo.jQuery);(function(e,t){function n(e,t,n){var i=n?" k-slider-horizontal":" k-slider-vertical",r=e.style?e.style:t.attr("style"),a=t.attr("class")?" "+t.attr("class"):"",o="";return"bottomRight"==e.tickPlacement?o=" k-slider-bottomright":"topLeft"==e.tickPlacement&&(o=" k-slider-topleft"),r=r?" style='"+r+"'":"","<div class='k-widget k-slider"+i+a+"'"+r+"><div class='k-slider-wrap"+(e.showButtons?" k-slider-buttons":"")+o+"'></div></div>"}function i(e,t,n){var i="";return i="increase"==t?n?"k-i-arrow-e":"k-i-arrow-n":n?"k-i-arrow-w":"k-i-arrow-s","<a class='k-button k-button-"+t+"'><span class='k-icon "+i+"' title='"+e[t+"ButtonTitle"]+"'>"+e[t+"ButtonTitle"]+"</span></a>"}function r(e,t){var n,i="<ul class='k-reset k-slider-items'>",r=w.floor(u(t/e.smallStep))+1;for(n=0;r>n;n++)i+="<li class='k-tick' role='presentation'>&nbsp;</li>";return i+="</ul>"}function a(e,t){var n=t.is("input")?1:2,i=2==n?e.leftDragHandleTitle:e.dragHandleTitle;return"<div class='k-slider-track'><div class='k-slider-selection'><!-- --></div><a href='#' class='k-draghandle' title='"+i+"' role='slider' aria-valuemin='"+e.min+"' aria-valuemax='"+e.max+"' aria-valuenow='"+(n>1?e.selectionStart||e.min:e.value||e.min)+"'>Drag</a>"+(n>1?"<a href='#' class='k-draghandle' title='"+e.rightDragHandleTitle+"'role='slider' aria-valuemin='"+e.min+"' aria-valuemax='"+e.max+"' aria-valuenow='"+(e.selectionEnd||e.max)+"'>Drag</a>":"")+"</div>"}function o(e){return function(t){return t+e}}function s(e){return function(){return e}}function l(e){return(e+"").replace(".",p.cultures.current.numberFormat["."])}function u(e){e=parseFloat(e,10);var t=w.pow(10,U||0);return w.round(e*t)/t}function c(e,n){var i=_(e.getAttribute(n));return null===i&&(i=t),i}function d(e){return typeof e!==$}var f,p=window.kendo,h=p.ui.Widget,g=p.ui.Draggable,m=e.extend,v=p.format,_=p.parseFloat,y=e.proxy,b=e.isArray,w=Math,x=p.support,k=x.pointers,C=x.msPointers,T="change",S="slide",D=".slider",F="touchstart"+D+" mousedown"+D,E=k?"pointerdown"+D:C?"MSPointerDown"+D:F,M="touchend"+D+" mouseup"+D,z=k?"pointerup":C?"MSPointerUp"+D:M,A="moveSelection",O="keydown"+D,H="click"+D,I="mouseover"+D,P="focus"+D,N="blur"+D,L=".k-draghandle",R=".k-slider-track",B=".k-tick",W="k-state-selected",q="k-state-focused",V="k-state-default",j="k-state-disabled",U=3,Y="disabled",$="undefined",G="tabindex",Q=p.getTouches,K=h.extend({init:function(e,t){var n,i=this;h.fn.init.call(i,e,t),t=i.options,i._distance=t.max-t.min,i._isHorizontal="horizontal"==t.orientation,i._isRtl=i._isHorizontal&&p.support.isRtl(e),i._position=i._isHorizontal?"left":"bottom",i._sizeFn=i._isHorizontal?"width":"height",i._outerSize=i._isHorizontal?"outerWidth":"outerHeight",t.tooltip.format=t.tooltip.enabled?t.tooltip.format||"{0}":"{0}",i._createHtml(),i.wrapper=i.element.closest(".k-slider"),i._trackDiv=i.wrapper.find(R),i._setTrackDivWidth(),i._maxSelection=i._trackDiv[i._sizeFn](),i._sliderItemsInit(),i._tabindex(i.wrapper.find(L)),i[t.enabled?"enable":"disable"](),n=p.support.isRtl(i.wrapper)?-1:1,i._keyMap={37:o(-1*n*t.smallStep),40:o(-t.smallStep),39:o(1*n*t.smallStep),38:o(+t.smallStep),35:s(t.max),36:s(t.min),33:o(+t.largeStep),34:o(-t.largeStep)},p.notify(i)},events:[T,S],options:{enabled:!0,min:0,max:10,smallStep:1,largeStep:5,orientation:"horizontal",tickPlacement:"both",tooltip:{enabled:!0,format:"{0}"}},_resize:function(){this._setTrackDivWidth(),this.wrapper.find(".k-slider-items").remove(),this._maxSelection=this._trackDiv[this._sizeFn](),this._sliderItemsInit(),this._refresh()},_sliderItemsInit:function(){var e=this,t=e.options,n=e._maxSelection/((t.max-t.min)/t.smallStep),i=e._calculateItemsWidth(w.floor(e._distance/t.smallStep));"none"!=t.tickPlacement&&n>=2&&(e._trackDiv.before(r(t,e._distance)),e._setItemsWidth(i),e._setItemsTitle()),e._calculateSteps(i),"none"!=t.tickPlacement&&n>=2&&t.largeStep>=t.smallStep&&e._setItemsLargeTick()},getSize:function(){return p.dimensions(this.wrapper)},_setTrackDivWidth:function(){var e=this,t=2*parseFloat(e._trackDiv.css(e._isRtl?"right":e._position),10);e._trackDiv[e._sizeFn](e.wrapper[e._sizeFn]()-2-t)},_setItemsWidth:function(t){var n,i=this,r=i.options,a=0,o=t.length-1,s=i.wrapper.find(B),l=0,u=2,c=s.length,d=0;for(n=0;c-2>n;n++)e(s[n+1])[i._sizeFn](t[n]);if(i._isHorizontal?(e(s[a]).addClass("k-first")[i._sizeFn](t[o-1]),e(s[o]).addClass("k-last")[i._sizeFn](t[o])):(e(s[o]).addClass("k-first")[i._sizeFn](t[o]),e(s[a]).addClass("k-last")[i._sizeFn](t[o-1])),i._distance%r.smallStep!==0&&!i._isHorizontal){for(n=0;t.length>n;n++)d+=t[n];l=i._maxSelection-d,l+=parseFloat(i._trackDiv.css(i._position),10)+u,i.wrapper.find(".k-slider-items").css("padding-top",l)}},_setItemsTitle:function(){for(var t=this,n=t.options,i=t.wrapper.find(B),r=n.min,a=i.length,o=t._isHorizontal&&!t._isRtl?0:a-1,s=t._isHorizontal&&!t._isRtl?a:-1,l=t._isHorizontal&&!t._isRtl?1:-1;o-s!==0;o+=l)e(i[o]).attr("title",v(n.tooltip.format,u(r))),r+=n.smallStep},_setItemsLargeTick:function(){var t,n,i=this,r=i.options,a=i.wrapper.find(B),o=0;if(1e3*r.largeStep%(1e3*r.smallStep)===0||i._distance/r.largeStep>=3)for(i._isHorizontal||i._isRtl||(a=e.makeArray(a).reverse()),o=0;a.length>o;o++)t=e(a[o]),n=i._values[o],n%r.smallStep===0&&n%r.largeStep===0&&(t.addClass("k-tick-large").html("<span class='k-label'>"+t.attr("title")+"</span>"),0!==o&&o!==a.length-1&&t.css("line-height",t[i._sizeFn]()+"px"))},_calculateItemsWidth:function(e){var t,n,i,r=this,a=r.options,o=parseFloat(r._trackDiv.css(r._sizeFn))+1,s=o/r._distance;for(r._distance/a.smallStep-w.floor(r._distance/a.smallStep)>0&&(o-=r._distance%a.smallStep*s),t=o/e,n=[],i=0;e-1>i;i++)n[i]=t;return n[e-1]=n[e]=t/2,r._roundWidths(n)},_roundWidths:function(e){var t,n=0,i=e.length;for(t=0;i>t;t++)n+=e[t]-w.floor(e[t]),e[t]=w.floor(e[t]);return n=w.round(n),this._addAdditionalSize(n,e)},_addAdditionalSize:function(e,t){if(0===e)return t;var n,i=parseFloat(t.length-1)/parseFloat(1==e?e:e-1);for(n=0;e>n;n++)t[parseInt(w.round(i*n),10)]+=1;return t},_calculateSteps:function(e){var t,n=this,i=n.options,r=i.min,a=0,o=w.ceil(n._distance/i.smallStep),s=1;if(o+=n._distance/i.smallStep%1===0?1:0,e.splice(0,0,2*e[o-2]),e.splice(o-1,1,2*e.pop()),n._pixelSteps=[a],n._values=[r],0!==o){for(;o>s;)a+=(e[s-1]+e[s])/2,n._pixelSteps[s]=a,n._values[s]=r+=i.smallStep,s++;t=n._distance%i.smallStep===0?o-1:o,n._pixelSteps[t]=n._maxSelection,n._values[t]=i.max,n._isRtl&&(n._pixelSteps.reverse(),n._values.reverse())}},_getValueFromPosition:function(e,t){var n,i=this,r=i.options,a=w.max(r.smallStep*(i._maxSelection/i._distance),0),o=0,s=a/2;if(i._isHorizontal?(o=e-t.startPoint,i._isRtl&&(o=i._maxSelection-o)):o=t.startPoint-e,i._maxSelection-(parseInt(i._maxSelection%a,10)-3)/2<o)return r.max;for(n=0;i._pixelSteps.length>n;n++)if(w.abs(i._pixelSteps[n]-o)-1<=s)return u(i._values[n])},_getFormattedValue:function(e,t){var n,i,r,a=this,o="",s=a.options.tooltip;return b(e)?(i=e[0],r=e[1]):t&&t.type&&(i=t.selectionStart,r=t.selectionEnd),t&&(n=t.tooltipTemplate),!n&&s.template&&(n=p.template(s.template)),b(e)||t&&t.type?n?o=n({selectionStart:i,selectionEnd:r}):(i=v(s.format,i),r=v(s.format,r),o=i+" - "+r):(t&&(t.val=e),o=n?n({value:e}):v(s.format,e)),o},_getDraggableArea:function(){var e=this,t=p.getOffset(e._trackDiv);return{startPoint:e._isHorizontal?t.left:t.top+e._maxSelection,endPoint:e._isHorizontal?t.left+e._maxSelection:t.top}},_createHtml:function(){var e=this,t=e.element,r=e.options,o=t.find("input");2==o.length?(o.eq(0).val(r.selectionStart),o.eq(1).val(r.selectionEnd)):t.val(r.value),t.wrap(n(r,t,e._isHorizontal)).hide(),r.showButtons&&t.before(i(r,"increase",e._isHorizontal)).before(i(r,"decrease",e._isHorizontal)),t.before(a(r,t))},_focus:function(t){var n=this,i=t.target,r=n.value(),a=n._drag;a||(i==n.wrapper.find(L).eq(0)[0]?(a=n._firstHandleDrag,n._activeHandle=0):(a=n._lastHandleDrag,n._activeHandle=1),r=r[n._activeHandle]),e(i).addClass(q+" "+W),a&&(n._activeHandleDrag=a,a.selectionStart=n.options.selectionStart,a.selectionEnd=n.options.selectionEnd,a._updateTooltip(r))},_focusWithMouse:function(t){t=e(t);var n=this,i=t.is(L)?t.index():0;window.setTimeout(function(){n.wrapper.find(L)[2==i?1:0].focus()},1),n._setTooltipTimeout()},_blur:function(t){var n=this,i=n._activeHandleDrag;e(t.target).removeClass(q+" "+W),i&&(i._removeTooltip(),delete n._activeHandleDrag,delete n._activeHandle)},_setTooltipTimeout:function(){var e=this;e._tooltipTimeout=window.setTimeout(function(){var t=e._drag||e._activeHandleDrag;t&&t._removeTooltip()},300)},_clearTooltipTimeout:function(){var e,t=this;window.clearTimeout(this._tooltipTimeout),e=t._drag||t._activeHandleDrag,e&&e.tooltipDiv&&e.tooltipDiv.stop(!0,!1).css("opacity",1)}}),J=K.extend({init:function(n,i){var r,a=this;n.type="text",i=m({},{value:c(n,"value"),min:c(n,"min"),max:c(n,"max"),smallStep:c(n,"step")},i),n=e(n),i&&i.enabled===t&&(i.enabled=!n.is("[disabled]")),K.fn.init.call(a,n,i),i=a.options,d(i.value)&&null!==i.value||(i.value=i.min,n.val(i.min)),i.value=w.max(w.min(i.value,i.max),i.min),r=a.wrapper.find(L),new J.Selection(r,a,i),a._drag=new J.Drag(r,"",a,i)},options:{name:"Slider",showButtons:!0,increaseButtonTitle:"Increase",decreaseButtonTitle:"Decrease",dragHandleTitle:"drag",tooltip:{format:"{0:#,#.##}"},value:null},enable:function(n){var i,r,a,o=this,s=o.options;o.disable(),n!==!1&&(o.wrapper.removeClass(j).addClass(V),o.wrapper.find("input").removeAttr(Y),i=function(n){var i,r,a,s=Q(n)[0];if(s){if(i=o._isHorizontal?s.location.pageX:s.location.pageY,r=o._getDraggableArea(),a=e(n.target),a.hasClass("k-draghandle"))return a.addClass(q+" "+W),t;o._update(o._getValueFromPosition(i,r)),o._focusWithMouse(n.target),o._drag.dragstart(n),n.preventDefault()}},o.wrapper.find(B+", "+R).on(E,i).end().on(E,function(){e(document.documentElement).one("selectstart",p.preventDefault)}).on(z,function(){o._drag._end()}),o.wrapper.find(L).attr(G,0).on(M,function(){o._setTooltipTimeout()}).on(H,function(e){o._focusWithMouse(e.target),e.preventDefault()}).on(P,y(o._focus,o)).on(N,y(o._blur,o)),r=y(function(e){var t=o._nextValueByIndex(o._valueIndex+1*e);o._setValueInRange(t),o._drag._updateTooltip(t)},o),s.showButtons&&(a=y(function(e,t){this._clearTooltipTimeout(),(1===e.which||x.touch&&0===e.which)&&(r(t),this.timeout=setTimeout(y(function(){this.timer=setInterval(function(){r(t)},60)},this),200))},o),o.wrapper.find(".k-button").on(M,y(function(e){this._clearTimer(),o._focusWithMouse(e.target)},o)).on(I,function(t){e(t.currentTarget).addClass("k-state-hover")}).on("mouseout"+D,y(function(t){e(t.currentTarget).removeClass("k-state-hover"),this._clearTimer()},o)).eq(0).on(F,y(function(e){a(e,1)},o)).click(!1).end().eq(1).on(F,y(function(e){a(e,-1)},o)).click(p.preventDefault)),o.wrapper.find(L).off(O,!1).on(O,y(this._keydown,o)),s.enabled=!0)},disable:function(){var t=this;t.wrapper.removeClass(V).addClass(j),e(t.element).prop(Y,Y),t.wrapper.find(".k-button").off(F).on(F,p.preventDefault).off(M).on(M,p.preventDefault).off("mouseleave"+D).on("mouseleave"+D,p.preventDefault).off(I).on(I,p.preventDefault),t.wrapper.find(B+", "+R).off(E).off(z),t.wrapper.find(L).attr(G,-1).off(M).off(O).off(H).off(P).off(N),t.options.enabled=!1},_update:function(e){var t=this,n=t.value()!=e;t.value(e),n&&t.trigger(T,{value:t.options.value})},value:function(e){var n=this,i=n.options;return e=u(e),isNaN(e)?i.value:(e>=i.min&&i.max>=e&&i.value!=e&&(n.element.prop("value",l(e)),i.value=e,n._refreshAriaAttr(e),n._refresh()),t)},_refresh:function(){this.trigger(A,{value:this.options.value})},_refreshAriaAttr:function(e){var t,n=this,i=n._drag;t=i&&i._tooltipDiv?i._tooltipDiv.text():n._getFormattedValue(e,null),this.wrapper.find(L).attr("aria-valuenow",e).attr("aria-valuetext",t)},_clearTimer:function(){clearTimeout(this.timeout),clearInterval(this.timer)},_keydown:function(e){var t=this;e.keyCode in t._keyMap&&(t._clearTooltipTimeout(),t._setValueInRange(t._keyMap[e.keyCode](t.options.value)),t._drag._updateTooltip(t.value()),e.preventDefault())},_setValueInRange:function(e){var n=this,i=n.options;return e=u(e),isNaN(e)?(n._update(i.min),t):(e=w.max(w.min(e,i.max),i.min),n._update(e),t)},_nextValueByIndex:function(e){var t=this._values.length;return this._isRtl&&(e=t-1-e),this._values[w.max(0,w.min(e,t-1))]},destroy:function(){var e=this;h.fn.destroy.call(e),e.wrapper.off(D).find(".k-button").off(D).end().find(L).off(D).end().find(B+", "+R).off(D).end(),e._drag.draggable.destroy(),e._drag._removeTooltip(!0)}});J.Selection=function(e,t,n){function i(i){var r=i-n.min,a=t._valueIndex=w.ceil(u(r/n.smallStep)),o=parseInt(t._pixelSteps[a],10),s=t._trackDiv.find(".k-slider-selection"),l=parseInt(e[t._outerSize]()/2,10),c=t._isRtl?2:0;s[t._sizeFn](t._isRtl?t._maxSelection-o:o),e.css(t._position,o-l-c)}i(n.value),t.bind([T,S,A],function(e){i(parseFloat(e.value,10))})},J.Drag=function(e,t,n,i){var r=this;r.owner=n,r.options=i,r.element=e,r.type=t,r.draggable=new g(e,{distance:0,dragstart:y(r._dragstart,r),drag:y(r.drag,r),dragend:y(r.dragend,r),dragcancel:y(r.dragcancel,r)}),e.click(!1)},J.Drag.prototype={dragstart:function(e){this.owner._activeDragHandle=this,this.draggable.userEvents.cancel(),this.draggable.userEvents._start(e)},_dragstart:function(n){var i=this,r=i.owner,a=i.options;return a.enabled?(this.owner._activeDragHandle=this,r.element.off(I),i.element.addClass(q+" "+W),e(document.documentElement).css("cursor","pointer"),i.dragableArea=r._getDraggableArea(),i.step=w.max(a.smallStep*(r._maxSelection/r._distance),0),i.type?(i.selectionStart=a.selectionStart,i.selectionEnd=a.selectionEnd,r._setZIndex(i.type)):i.oldVal=i.val=a.value,i._removeTooltip(!0),i._createTooltip(),t):(n.preventDefault(),t)},_createTooltip:function(){var t,n,i=this,r=i.owner,a=i.options.tooltip,o="",s=e(window);a.enabled&&(a.template&&(t=i.tooltipTemplate=p.template(a.template)),e(".k-slider-tooltip").remove(),i.tooltipDiv=e("<div class='k-widget k-tooltip k-slider-tooltip'><!-- --></div>").appendTo(document.body),o=r._getFormattedValue(i.val||r.value(),i),i.type||(n="k-callout-"+(r._isHorizontal?"s":"e"),i.tooltipInnerDiv="<div class='k-callout "+n+"'><!-- --></div>",o+=i.tooltipInnerDiv),i.tooltipDiv.html(o),i._scrollOffset={top:s.scrollTop(),left:s.scrollLeft()},i.moveTooltip())},drag:function(e){var t,n=this,i=n.owner,r=e.x.location,a=e.y.location,o=n.dragableArea.startPoint,s=n.dragableArea.endPoint;e.preventDefault(),n.val=i._isHorizontal?i._isRtl?n.constrainValue(r,o,s,s>r):n.constrainValue(r,o,s,r>=s):n.constrainValue(a,s,o,s>=a),n.oldVal!=n.val&&(n.oldVal=n.val,n.type?("firstHandle"==n.type?n.selectionStart=n.selectionEnd>n.val?n.val:n.selectionEnd=n.val:n.val>n.selectionStart?n.selectionEnd=n.val:n.selectionStart=n.selectionEnd=n.val,t={values:[n.selectionStart,n.selectionEnd],value:[n.selectionStart,n.selectionEnd]}):t={value:n.val},i.trigger(S,t)),n._updateTooltip(n.val)},_updateTooltip:function(e){var t=this,n=t.options,i=n.tooltip,r="";i.enabled&&(t.tooltipDiv||t._createTooltip(),r=t.owner._getFormattedValue(u(e),t),t.type||(r+=t.tooltipInnerDiv),t.tooltipDiv.html(r),t.moveTooltip())},dragcancel:function(){return this.owner._refresh(),e(document.documentElement).css("cursor",""),this._end()},dragend:function(){var t=this,n=t.owner;return e(document.documentElement).css("cursor",""),t.type?n._update(t.selectionStart,t.selectionEnd):(n._update(t.val),t.draggable.userEvents._disposeAll()),t._end()},_end:function(){var e=this,t=e.owner;return t._focusWithMouse(e.element),t.element.on(I),!1},_removeTooltip:function(t){var n=this,i=n.owner;n.tooltipDiv&&i.options.tooltip.enabled&&i.options.enabled&&(t?(n.tooltipDiv.remove(),n.tooltipDiv=null):n.tooltipDiv.fadeOut("slow",function(){e(this).remove(),n.tooltipDiv=null}))},moveTooltip:function(){var t,n,i,r,a=this,o=a.owner,s=0,l=0,u=a.element,c=p.getOffset(u),d=8,f=e(window),h=a.tooltipDiv.find(".k-callout"),g=a.tooltipDiv.outerWidth(),m=a.tooltipDiv.outerHeight();a.type?(t=o.wrapper.find(L),c=p.getOffset(t.eq(0)),n=p.getOffset(t.eq(1)),o._isHorizontal?(s=n.top,l=c.left+(n.left-c.left)/2):(s=c.top+(n.top-c.top)/2,l=n.left),r=t.eq(0).outerWidth()+2*d):(s=c.top,l=c.left,r=u.outerWidth()+2*d),o._isHorizontal?(l-=parseInt((g-u[o._outerSize]())/2,10),s-=m+h.height()+d):(s-=parseInt((m-u[o._outerSize]())/2,10),l-=g+h.width()+d),o._isHorizontal?(i=a._flip(s,m,r,f.outerHeight()+a._scrollOffset.top),s+=i,l+=a._fit(l,g,f.outerWidth()+a._scrollOffset.left)):(i=a._flip(l,g,r,f.outerWidth()+a._scrollOffset.left),s+=a._fit(s,m,f.outerHeight()+a._scrollOffset.top),l+=i),i>0&&h&&(h.removeClass(),h.addClass("k-callout k-callout-"+(o._isHorizontal?"n":"w"))),a.tooltipDiv.css({top:s,left:l})},_fit:function(e,t,n){var i=0;return e+t>n&&(i=n-(e+t)),0>e&&(i=-e),i},_flip:function(e,t,n,i){var r=0;return e+t>i&&(r+=-(n+t)),0>e+r&&(r+=n+t),r},constrainValue:function(e,t,n,i){var r=this,a=0;return a=e>t&&n>e?r.owner._getValueFromPosition(e,r.dragableArea):i?r.options.max:r.options.min}},p.ui.plugin(J),f=K.extend({init:function(n,i){var r,a=this,o=e(n).find("input"),s=o.eq(0)[0],l=o.eq(1)[0];s.type="text",l.type="text",i=m({},{selectionStart:c(s,"value"),min:c(s,"min"),max:c(s,"max"),smallStep:c(s,"step")},{selectionEnd:c(l,"value"),min:c(l,"min"),max:c(l,"max"),smallStep:c(l,"step")},i),i&&i.enabled===t&&(i.enabled=!o.is("[disabled]")),K.fn.init.call(a,n,i),i=a.options,d(i.selectionStart)&&null!==i.selectionStart||(i.selectionStart=i.min,o.eq(0).val(i.min)),d(i.selectionEnd)&&null!==i.selectionEnd||(i.selectionEnd=i.max,o.eq(1).val(i.max)),r=a.wrapper.find(L),new f.Selection(r,a,i),a._firstHandleDrag=new J.Drag(r.eq(0),"firstHandle",a,i),a._lastHandleDrag=new J.Drag(r.eq(1),"lastHandle",a,i)},options:{name:"RangeSlider",leftDragHandleTitle:"drag",rightDragHandleTitle:"drag",tooltip:{format:"{0:#,#.##}"},selectionStart:null,selectionEnd:null},enable:function(n){var i,r=this,a=r.options;r.disable(),n!==!1&&(r.wrapper.removeClass(j).addClass(V),r.wrapper.find("input").removeAttr(Y),i=function(n){var i,o,s,l,u,c,d,f=Q(n)[0];if(f){if(i=r._isHorizontal?f.location.pageX:f.location.pageY,o=r._getDraggableArea(),s=r._getValueFromPosition(i,o),l=e(n.target),l.hasClass("k-draghandle"))return l.addClass(q+" "+W),t;a.selectionStart>s?(u=s,c=a.selectionEnd,d=r._firstHandleDrag):s>r.selectionEnd?(u=a.selectionStart,c=s,d=r._lastHandleDrag):a.selectionEnd-s>=s-a.selectionStart?(u=s,c=a.selectionEnd,d=r._firstHandleDrag):(u=a.selectionStart,c=s,d=r._lastHandleDrag),d.dragstart(n),r._setValueInRange(u,c),r._focusWithMouse(d.element)}},r.wrapper.find(B+", "+R).on(E,i).end().on(E,function(){e(document.documentElement).one("selectstart",p.preventDefault)}).on(z,function(){r._activeDragHandle&&r._activeDragHandle._end()}),r.wrapper.find(L).attr(G,0).on(M,function(){r._setTooltipTimeout()}).on(H,function(e){r._focusWithMouse(e.target),e.preventDefault()}).on(P,y(r._focus,r)).on(N,y(r._blur,r)),r.wrapper.find(L).off(O,p.preventDefault).eq(0).on(O,y(function(e){this._keydown(e,"firstHandle")},r)).end().eq(1).on(O,y(function(e){this._keydown(e,"lastHandle")},r)),r.options.enabled=!0)},disable:function(){var e=this;e.wrapper.removeClass(V).addClass(j),e.wrapper.find("input").prop(Y,Y),e.wrapper.find(B+", "+R).off(E).off(z),e.wrapper.find(L).attr(G,-1).off(M).off(O).off(H).off(P).off(N),e.options.enabled=!1},_keydown:function(e,t){var n,i,r,a=this,o=a.options.selectionStart,s=a.options.selectionEnd;e.keyCode in a._keyMap&&(a._clearTooltipTimeout(),"firstHandle"==t?(r=a._activeHandleDrag=a._firstHandleDrag,o=a._keyMap[e.keyCode](o),o>s&&(s=o)):(r=a._activeHandleDrag=a._lastHandleDrag,s=a._keyMap[e.keyCode](s),o>s&&(o=s)),a._setValueInRange(o,s),n=Math.max(o,a.options.selectionStart),i=Math.min(s,a.options.selectionEnd),r.selectionEnd=Math.max(i,a.options.selectionStart),r.selectionStart=Math.min(n,a.options.selectionEnd),r._updateTooltip(a.value()[a._activeHandle]),e.preventDefault())},_update:function(e,t){var n=this,i=n.value(),r=i[0]!=e||i[1]!=t;n.value([e,t]),r&&n.trigger(T,{values:[e,t],value:[e,t]})},value:function(e){return e&&e.length?this._value(e[0],e[1]):this._value()},_value:function(e,n){var i=this,r=i.options,a=r.selectionStart,o=r.selectionEnd;return isNaN(e)&&isNaN(n)?[a,o]:(e=u(e),n=u(n),e>=r.min&&r.max>=e&&n>=r.min&&r.max>=n&&n>=e&&(a!=e||o!=n)&&(i.element.find("input").eq(0).prop("value",l(e)).end().eq(1).prop("value",l(n)),r.selectionStart=e,r.selectionEnd=n,i._refresh(),i._refreshAriaAttr(e,n)),t)},values:function(e,t){return b(e)?this._value(e[0],e[1]):this._value(e,t)},_refresh:function(){var e=this,t=e.options;e.trigger(A,{values:[t.selectionStart,t.selectionEnd],value:[t.selectionStart,t.selectionEnd]}),t.selectionStart==t.max&&t.selectionEnd==t.max&&e._setZIndex("firstHandle")},_refreshAriaAttr:function(e,t){var n,i=this,r=i.wrapper.find(L),a=i._activeHandleDrag;n=i._getFormattedValue([e,t],a),r.eq(0).attr("aria-valuenow",e),r.eq(1).attr("aria-valuenow",t),r.attr("aria-valuetext",n)},_setValueInRange:function(e,t){var n=this.options;e=w.max(w.min(e,n.max),n.min),t=w.max(w.min(t,n.max),n.min),e==n.max&&t==n.max&&this._setZIndex("firstHandle"),this._update(w.min(e,t),w.max(e,t))},_setZIndex:function(t){this.wrapper.find(L).each(function(n){e(this).css("z-index","firstHandle"==t?1-n:n)})},destroy:function(){var e=this;h.fn.destroy.call(e),e.wrapper.off(D).find(B+", "+R).off(D).end().find(L).off(D),e._firstHandleDrag.draggable.destroy(),e._lastHandleDrag.draggable.destroy()}}),f.Selection=function(e,t,n){function i(i){i=i||[];var a=i[0]-n.min,o=i[1]-n.min,s=w.ceil(u(a/n.smallStep)),l=w.ceil(u(o/n.smallStep)),c=t._pixelSteps[s],d=t._pixelSteps[l],f=parseInt(e.eq(0)[t._outerSize]()/2,10),p=t._isRtl?2:0;e.eq(0).css(t._position,c-f-p).end().eq(1).css(t._position,d-f-p),r(c,d)}function r(e,n){var i,r,a=t._trackDiv.find(".k-slider-selection");i=w.abs(e-n),a[t._sizeFn](i),t._isRtl?(r=w.max(e,n),a.css("right",t._maxSelection-r-1)):(r=w.min(e,n),a.css(t._position,r-1))}i(t.value()),t.bind([T,S,A],function(e){i(e.values)})},p.ui.plugin(f)})(window.kendo.jQuery);(function(e,t,n){function i(e,t,n){n=o(n),n&&!n.equals(e.color())&&("change"==t&&(e._value=n),n=1!=n.a?n.toCssRgba():n.toCss(),e.trigger(t,{value:n}))}function r(e,t,n){for(n||(n="0"),e=e.toString(16);t>e.length;)e="0"+e;return e}function a(e){return parseFloat((+e).toFixed(3))}function o(e,i){if(null==e||"transparent"==e)return null;if(e instanceof D)return e;var r=/^#?([0-9a-f]{2})([0-9a-f]{2})([0-9a-f]{2})$/i.exec(e);if(r)return new M(t(r[1],16),t(r[2],16),t(r[3],16),1);if(r=/^#?([0-9a-f])([0-9a-f])([0-9a-f])$/i.exec(e))return new M(t(r[1]+r[1],16),t(r[2]+r[2],16),t(r[3]+r[3],16),1);if(r=/^rgb\(\s*([0-9]+)\s*,\s*([0-9]+)\s*,\s*([0-9]+)\s*\)/.exec(e))return new M(t(r[1],10),t(r[2],10),t(r[3],10),1);if(r=/^rgba\(\s*([0-9]+)\s*,\s*([0-9]+)\s*,\s*([0-9]+)\s*,\s*([0-9.]+)\s*\)/.exec(e))return new M(t(r[1],10),t(r[2],10),t(r[3],10),parseFloat(r[4]));if(r=/^rgb\(\s*([0-9]*\.?[0-9]+)%\s*,\s*([0-9]*\.?[0-9]+)%\s*,\s*([0-9]*\.?[0-9]+)%\s*\)/.exec(e))return new E(parseFloat(r[1])/100,parseFloat(r[2])/100,parseFloat(r[3])/100,1);if(r=/^rgba\(\s*([0-9]*\.?[0-9]+)%\s*,\s*([0-9]*\.?[0-9]+)%\s*,\s*([0-9]*\.?[0-9]+)%\s*,\s*([0-9.]+)\s*\)/.exec(e))return new E(parseFloat(r[1])/100,parseFloat(r[2])/100,parseFloat(r[3])/100,parseFloat(r[4]));if(!i)throw Error("Cannot parse color: "+e);return n}function s(e,t,n){var i,r;return e=Array.prototype.slice.call(e),i=e.length,r=e.indexOf(t),0>r?0>n?e[i-1]:e[0]:(r+=n,0>r?r+=i:r%=i,e[r])}function l(e){e.preventDefault()}function u(e,t){return function(){return e.apply(t,arguments)}}var c=window.kendo,d=c.Class,f=c.ui,p=f.Widget,h=c.keys,g="background-color",m="k-state-selected",v="000000,7f7f7f,880015,ed1c24,ff7f27,fff200,22b14c,00a2e8,3f48cc,a349a4,ffffff,c3c3c3,b97a57,ffaec9,ffc90e,efe4b0,b5e61d,99d9ea,7092be,c8bfe7",_="FFFFFF,FFCCFF,FF99FF,FF66FF,FF33FF,FF00FF,CCFFFF,CCCCFF,CC99FF,CC66FF,CC33FF,CC00FF,99FFFF,99CCFF,9999FF,9966FF,9933FF,9900FF,FFFFCC,FFCCCC,FF99CC,FF66CC,FF33CC,FF00CC,CCFFCC,CCCCCC,CC99CC,CC66CC,CC33CC,CC00CC,99FFCC,99CCCC,9999CC,9966CC,9933CC,9900CC,FFFF99,FFCC99,FF9999,FF6699,FF3399,FF0099,CCFF99,CCCC99,CC9999,CC6699,CC3399,CC0099,99FF99,99CC99,999999,996699,993399,990099,FFFF66,FFCC66,FF9966,FF6666,FF3366,FF0066,CCFF66,CCCC66,CC9966,CC6666,CC3366,CC0066,99FF66,99CC66,999966,996666,993366,990066,FFFF33,FFCC33,FF9933,FF6633,FF3333,FF0033,CCFF33,CCCC33,CC9933,CC6633,CC3333,CC0033,99FF33,99CC33,999933,996633,993333,990033,FFFF00,FFCC00,FF9900,FF6600,FF3300,FF0000,CCFF00,CCCC00,CC9900,CC6600,CC3300,CC0000,99FF00,99CC00,999900,996600,993300,990000,66FFFF,66CCFF,6699FF,6666FF,6633FF,6600FF,33FFFF,33CCFF,3399FF,3366FF,3333FF,3300FF,00FFFF,00CCFF,0099FF,0066FF,0033FF,0000FF,66FFCC,66CCCC,6699CC,6666CC,6633CC,6600CC,33FFCC,33CCCC,3399CC,3366CC,3333CC,3300CC,00FFCC,00CCCC,0099CC,0066CC,0033CC,0000CC,66FF99,66CC99,669999,666699,663399,660099,33FF99,33CC99,339999,336699,333399,330099,00FF99,00CC99,009999,006699,003399,000099,66FF66,66CC66,669966,666666,663366,660066,33FF66,33CC66,339966,336666,333366,330066,00FF66,00CC66,009966,006666,003366,000066,66FF33,66CC33,669933,666633,663333,660033,33FF33,33CC33,339933,336633,333333,330033,00FF33,00CC33,009933,006633,003333,000033,66FF00,66CC00,669900,666600,663300,660000,33FF00,33CC00,339900,336600,333300,330000,00FF00,00CC00,009900,006600,003300,000000",y={apply:"Apply",cancel:"Cancel"},b=".kendoColorTools",w="click"+b,k="keydown"+b,x=c.support.browser,C=x.msie&&9>x.version,F=p.extend({init:function(e,t){var n,i=this;p.fn.init.call(i,e,t),e=i.element,t=i.options,i._value=t.value=o(t.value),i._tabIndex=e.attr("tabIndex")||0,n=i._ariaId=t.ariaId,n&&e.attr("aria-labelledby",n),t._standalone&&(i._triggerSelect=i._triggerChange)},options:{name:"ColorSelector",value:null,_standalone:!0},events:["change","select","cancel"],color:function(e){return e!==n&&(this._value=o(e),this._updateUI(this._value)),this._value},value:function(e){return e=this.color(e),e&&(e=this.options.opacity?e.toCssRgba():e.toCss()),e||null},enable:function(t){0===arguments.length&&(t=!0),e(".k-disabled-overlay",this.wrapper).remove(),t||this.wrapper.append("<div class='k-disabled-overlay'></div>"),this._onEnable(t)},_select:function(e,t){var n=this._value;e=this.color(e),t||(e.equals(n)?this._standalone||this.trigger("cancel"):this.trigger("change",{value:this.value()}),this.element.trigger("change"))},_triggerSelect:function(e){i(this,"select",e)},_triggerChange:function(e){i(this,"change",e)},destroy:function(){this.element&&this.element.off(b),this.wrapper&&this.wrapper.off(b).find("*").off(b),this.wrapper=null,p.fn.destroy.call(this)},_updateUI:e.noop,_selectOnHide:function(){return null},_cancel:function(){this.trigger("cancel")}}),S=F.extend({init:function(t,n){var i,r,a,s,l=this;if(F.fn.init.call(l,t,n),t=l.wrapper=l.element,n=l.options,i=n.palette,"websafe"==i?(i=_,n.columns=18):"basic"==i&&(i=v),"string"==typeof i&&(i=i.split(",")),e.isArray(i)&&(i=e.map(i,function(e){return o(e)})),l._selectedID=(n.ariaId||c.guid())+"_selected",t.addClass("k-widget k-colorpalette").attr("role","grid").attr("aria-readonly","true").append(e(l._template({colors:i,columns:n.columns,tileSize:n.tileSize,value:l._value,id:n.ariaId}))).on(w,".k-item",function(t){l._select(e(t.currentTarget).css(g))}).attr("tabIndex",l._tabIndex).on(k,u(l._keydown,l)),r=n.tileSize){if(/number|string/.test(typeof r))a=s=parseFloat(r);else{if("object"!=typeof r)throw Error("Unsupported value for the 'tileSize' argument");a=parseFloat(r.width),s=parseFloat(r.height)}t.find(".k-item").css({width:a,height:s})}},focus:function(){this.wrapper.focus()},options:{name:"ColorPalette",columns:10,tileSize:null,palette:"basic"},_onEnable:function(e){e?this.wrapper.attr("tabIndex",this._tabIndex):this.wrapper.removeAttr("tabIndex")},_keydown:function(t){var n,i,r=this.wrapper,a=r.find(".k-item"),u=a.filter("."+m).get(0),c=t.keyCode;if(c==h.LEFT?n=s(a,u,-1):c==h.RIGHT?n=s(a,u,1):c==h.DOWN?n=s(a,u,this.options.columns):c==h.UP?n=s(a,u,-this.options.columns):c==h.ENTER?(l(t),u&&this._select(e(u).css(g))):c==h.ESC&&this._cancel(),n){l(t),this._current(n);try{i=o(n.css(g)),this._triggerSelect(i)}catch(d){}}},_current:function(t){this.wrapper.find("."+m).removeClass(m).attr("aria-selected",!1).removeAttr("id"),e(t).addClass(m).attr("aria-selected",!0).attr("id",this._selectedID),this.element.removeAttr("aria-activedescendant").attr("aria-activedescendant",this._selectedID)},_updateUI:function(t){var i=null;this.wrapper.find(".k-item").each(function(){var r=o(e(this).css(g));return r&&r.equals(t)?(i=this,!1):n}),this._current(i)},_template:c.template('<table class="k-palette k-reset" role="presentation"><tr role="row"># for (var i = 0; i < colors.length; ++i) { ## var selected = colors[i].equals(value); ## if (i && i % columns == 0) { # </tr><tr role="row"> # } #<td role="gridcell" unselectable="on" style="background-color:#= colors[i].toCss() #"#= selected ? " aria-selected=true" : "" # #=(id && i === 0) ? "id=\\""+id+"\\" " : "" # class="k-item#= selected ? " '+m+'" : "" #" aria-label="#= colors[i].toCss() #"></td># } #</tr></table>')}),T=F.extend({init:function(t,n){var i=this;F.fn.init.call(i,t,n),n=i.options,t=i.element,i.wrapper=t.addClass("k-widget k-flatcolorpicker").append(i._template(n)),i._hueElements=e(".k-hsv-rectangle, .k-transparency-slider .k-slider-track",t),i._selectedColor=e(".k-selected-color-display",t),i._colorAsText=e("input.k-color-value",t),i._sliders(),i._hsvArea(),i._updateUI(i._value||new E(1,0,0,1)),t.find("input.k-color-value").on(k,function(t){var n,r,a=this;if(t.keyCode==h.ENTER)try{n=o(a.value),r=i.color(),i._select(n,n.equals(r))}catch(s){e(a).addClass("k-state-error")}else i.options.autoupdate&&setTimeout(function(){var e=o(a.value,!0);e&&i._updateUI(e,!0)},10)}).end().on(w,".k-controls button.apply",function(){i._select(i._getHSV())}).on(w,".k-controls button.cancel",function(){i._updateUI(i.color()),i._cancel()}),C&&i._applyIEFilter()},destroy:function(){this._hueSlider.destroy(),this._opacitySlider&&this._opacitySlider.destroy(),this._hueSlider=this._opacitySlider=this._hsvRect=this._hsvHandle=this._hueElements=this._selectedColor=this._colorAsText=null,F.fn.destroy.call(this)},options:{name:"FlatColorPicker",opacity:!1,buttons:!1,input:!0,preview:!0,autoupdate:!0,messages:y},_applyIEFilter:function(){var e=this.element.find(".k-hue-slider .k-slider-track")[0],t=e.currentStyle.backgroundImage;t=t.replace(/^url\([\'\"]?|[\'\"]?\)$/g,""),e.style.filter="progid:DXImageTransform.Microsoft.AlphaImageLoader(src='"+t+"', sizingMethod='scale')"},_sliders:function(){function e(e){n._updateUI(n._getHSV(e.value,null,null,null))}function t(e){n._updateUI(n._getHSV(null,null,null,e.value/100))}var n=this,i=n.element;n._hueSlider=i.find(".k-hue-slider").kendoSlider({min:0,max:359,tickPlacement:"none",showButtons:!1,slide:e,change:e}).data("kendoSlider"),n._opacitySlider=i.find(".k-transparency-slider").kendoSlider({min:0,max:100,tickPlacement:"none",showButtons:!1,slide:t,change:t}).data("kendoSlider")},_hsvArea:function(){function e(e,n){var i=this.offset,r=e-i.left,a=n-i.top,o=this.width,s=this.height;r=0>r?0:r>o?o:r,a=0>a?0:a>s?s:a,t._svChange(r/o,1-a/s)}var t=this,n=t.element,i=n.find(".k-hsv-rectangle"),r=i.find(".k-draghandle").attr("tabIndex",0).on(k,u(t._keydown,t));t._hsvEvents=new c.UserEvents(i,{global:!0,press:function(t){this.offset=c.getOffset(i),this.width=i.width(),this.height=i.height(),r.focus(),e.call(this,t.x.location,t.y.location)},start:function(){i.addClass("k-dragging"),r.focus()},move:function(t){t.preventDefault(),e.call(this,t.x.location,t.y.location)},end:function(){i.removeClass("k-dragging")}}),t._hsvRect=i,t._hsvHandle=r},_onEnable:function(e){this._hueSlider.enable(e),this._opacitySlider&&this._opacitySlider.enable(e),this.wrapper.find("input").attr("disabled",!e);var t=this._hsvRect.find(".k-draghandle");e?t.attr("tabIndex",this._tabIndex):t.removeAttr("tabIndex")},_keydown:function(e){function t(t,n){var r=i._getHSV();r[t]+=n*(e.shiftKey?.01:.05),0>r[t]&&(r[t]=0),r[t]>1&&(r[t]=1),i._updateUI(r),l(e)
}function n(t){var n=i._getHSV();n.h+=t*(e.shiftKey?1:5),0>n.h&&(n.h=0),n.h>359&&(n.h=359),i._updateUI(n),l(e)}var i=this;switch(e.keyCode){case h.LEFT:e.ctrlKey?n(-1):t("s",-1);break;case h.RIGHT:e.ctrlKey?n(1):t("s",1);break;case h.UP:t(e.ctrlKey&&i._opacitySlider?"a":"v",1);break;case h.DOWN:t(e.ctrlKey&&i._opacitySlider?"a":"v",-1);break;case h.ENTER:i._select(i._getHSV());break;case h.F2:i.wrapper.find("input.k-color-value").focus().select();break;case h.ESC:i._cancel()}},focus:function(){this._hsvHandle.focus()},_getHSV:function(e,t,n,i){var r=this._hsvRect,a=r.width(),o=r.height(),s=this._hsvHandle.position();return null==e&&(e=this._hueSlider.value()),null==t&&(t=s.left/a),null==n&&(n=1-s.top/o),null==i&&(i=this._opacitySlider?this._opacitySlider.value()/100:1),new z(e,t,n,i)},_svChange:function(e,t){var n=this._getHSV(null,e,t,null);this._updateUI(n)},_updateUI:function(e,t){var n=this,i=n._hsvRect;e&&(this._colorAsText.removeClass("k-state-error"),n._selectedColor.css(g,e.toDisplay()),t||n._colorAsText.val(n._opacitySlider?e.toCssRgba():e.toCss()),n._triggerSelect(e),e=e.toHSV(),n._hsvHandle.css({left:e.s*i.width()+"px",top:(1-e.v)*i.height()+"px"}),n._hueElements.css(g,new z(e.h,1,1,1).toCss()),n._hueSlider.value(e.h),n._opacitySlider&&n._opacitySlider.value(100*e.a))},_selectOnHide:function(){return this.options.buttons?null:this._getHSV()},_template:c.template('# if (preview) { #<div class="k-selected-color"><div class="k-selected-color-display"><input class="k-color-value" #= !data.input ? \'style="visibility: hidden;"\' : "" #></div></div># } #<div class="k-hsv-rectangle"><div class="k-hsv-gradient"></div><div class="k-draghandle"></div></div><input class="k-hue-slider" /># if (opacity) { #<input class="k-transparency-slider" /># } ## if (buttons) { #<div unselectable="on" class="k-controls"><button class="k-button k-primary apply">#: messages.apply #</button> <button class="k-button cancel">#: messages.cancel #</button></div># } #')}),D=d.extend({toHSV:function(){return this},toRGB:function(){return this},toHex:function(){return this.toBytes().toHex()},toBytes:function(){return this},toCss:function(){return"#"+this.toHex()},toCssRgba:function(){var e=this.toBytes();return"rgba("+e.r+", "+e.g+", "+e.b+", "+a(this.a)+")"},toDisplay:function(){return C?this.toCss():this.toCssRgba()},equals:function(e){return e===this||null!==e&&this.toCssRgba()==o(e).toCssRgba()},diff:function(e){if(null==e)return 0/0;var t=this.toBytes();return e=e.toBytes(),Math.sqrt(Math.pow(.3*(t.r-e.r),2)+Math.pow(.59*(t.g-e.g),2)+Math.pow(.11*(t.b-e.b),2))},clone:function(){var e=this.toBytes();return e===this&&(e=new M(e.r,e.g,e.b,e.a)),e}}),E=D.extend({init:function(e,t,n,i){this.r=e,this.g=t,this.b=n,this.a=i},toHSV:function(){var e,t,n=this.r,i=this.g,r=this.b,a=Math.min(n,i,r),o=Math.max(n,i,r),s=o,l=o-a;return 0===l?new z(0,0,s,this.a):(0!==o?(t=l/o,e=n==o?(i-r)/l:i==o?2+(r-n)/l:4+(n-i)/l,e*=60,0>e&&(e+=360)):(t=0,e=-1),new z(e,t,s,this.a))},toBytes:function(){return new M(255*this.r,255*this.g,255*this.b,this.a)}}),M=E.extend({init:function(e,t,n,i){this.r=Math.round(e),this.g=Math.round(t),this.b=Math.round(n),this.a=i},toRGB:function(){return new E(this.r/255,this.g/255,this.b/255,this.a)},toHSV:function(){return this.toRGB().toHSV()},toHex:function(){return r(this.r,2)+r(this.g,2)+r(this.b,2)},toBytes:function(){return this}}),z=D.extend({init:function(e,t,n,i){this.h=e,this.s=t,this.v=n,this.a=i},toRGB:function(){var e,t,n,i,r,a,o,s,l=this.h,u=this.s,c=this.v;if(0===u)t=n=i=c;else switch(l/=60,e=Math.floor(l),r=l-e,a=c*(1-u),o=c*(1-u*r),s=c*(1-u*(1-r)),e){case 0:t=c,n=s,i=a;break;case 1:t=o,n=c,i=a;break;case 2:t=a,n=c,i=s;break;case 3:t=a,n=o,i=c;break;case 4:t=s,n=a,i=c;break;default:t=c,n=a,i=o}return new E(t,n,i,this.a)},toBytes:function(){return this.toRGB().toBytes()}}),A=p.extend({init:function(t,n){var i,r,a,s=this;p.fn.init.call(s,t,n),n=s.options,t=s.element,i=t.attr("value")||t.val(),i=i?o(i,!0):o(n.value,!0),s._value=n.value=i,r=s.wrapper=e(s._template(n)),t.hide().after(r),t.is("input")&&t.appendTo(r),s._tabIndex=t.attr("tabIndex")||0,s.enable(!t.attr("disabled")),a=t.attr("accesskey"),a&&(t.attr("accesskey",null),r.attr("accesskey",a)),s.bind("activate",function(e){e.isDefaultPrevented()||s.toggle()}),s._updateUI(i)},destroy:function(){this.wrapper.off(b).find("*").off(b),this._popup&&(this._selector.destroy(),this._popup.destroy()),this._selector=this._popup=this.wrapper=null,p.fn.destroy.call(this)},enable:function(e){var t=this,n=t.wrapper,i=n.children(".k-picker-wrap"),r=i.find(".k-select");0===arguments.length&&(e=!0),t.element.attr("disabled",!e),n.attr("aria-disabled",!e),r.off(b).on("mousedown"+b,l),n.addClass("k-state-disabled").removeAttr("tabIndex").add("*",n).off(b),e&&n.removeClass("k-state-disabled").attr("tabIndex",t._tabIndex).on("mouseenter"+b,function(){i.addClass("k-state-hover")}).on("mouseleave"+b,function(){i.removeClass("k-state-hover")}).on("focus"+b,function(){i.addClass("k-state-focused")}).on("blur"+b,function(){i.removeClass("k-state-focused")}).on(k,u(t._keydown,t)).on(w,".k-icon",u(t.toggle,t)).on(w,t.options.toolIcon?".k-tool-icon":".k-selected-color",function(){t.trigger("activate")})},_template:c.template('<span role="textbox" aria-haspopup="true" class="k-widget k-colorpicker k-header"><span class="k-picker-wrap k-state-default"># if (toolIcon) { #<span class="k-tool-icon #= toolIcon #"><span class="k-selected-color"></span></span># } else { #<span class="k-selected-color"></span># } #<span class="k-select" unselectable="on"><span class="k-icon k-i-arrow-s" unselectable="on"></span></span></span></span>'),options:{name:"ColorPicker",palette:null,columns:10,toolIcon:null,value:null,messages:y,opacity:!1,buttons:!0,preview:!0,ARIATemplate:'Current selected color is #=data || ""#'},events:["activate","change","select","open","close"],open:function(){this._getPopup().open()},close:function(){this._getPopup().close()},toggle:function(){this._getPopup().toggle()},color:F.fn.color,value:F.fn.value,_select:F.fn._select,_triggerSelect:F.fn._triggerSelect,_isInputTypeColor:function(){var e=this.element[0];return/^input$/i.test(e.tagName)&&/^color$/i.test(e.type)},_updateUI:function(e){var t="";e&&(t=this._isInputTypeColor()||1==e.a?e.toCss():e.toCssRgba(),this.element.val(t)),this._ariaTemplate||(this._ariaTemplate=c.template(this.options.ARIATemplate)),this.wrapper.attr("aria-label",this._ariaTemplate(t)),this._triggerSelect(e),this.wrapper.find(".k-selected-color").css(g,e?e.toDisplay():"transparent")},_keydown:function(e){var t=e.keyCode;this._getPopup().visible()?(t==h.ESC?this._selector._cancel():this._selector._keydown(e),l(e)):(t==h.ENTER||t==h.DOWN)&&(this.open(),l(e))},_getPopup:function(){var t,i,r,a,s=this,l=s._popup;return l||(t=s.options,i=t.palette?S:T,t._standalone=!1,delete t.select,delete t.change,delete t.cancel,r=c.guid(),a=s._selector=new i(e('<div id="'+r+'"/>').appendTo(document.body),t),s.wrapper.attr("aria-owns",r),s._popup=l=a.wrapper.kendoPopup({anchor:s.wrapper}).data("kendoPopup"),a.bind({select:function(e){s._updateUI(o(e.value))},change:function(){s._select(a.color()),s.close()},cancel:function(){s.close()}}),l.bind({close:function(e){if(s.trigger("close"))return e.preventDefault(),n;s.wrapper.children(".k-picker-wrap").removeClass("k-state-focused");var t=a._selectOnHide();t?s._select(t):(s.wrapper.focus(),s._updateUI(s.color()))},open:function(e){s.trigger("open")?e.preventDefault():s.wrapper.children(".k-picker-wrap").addClass("k-state-focused")},activate:function(){a._select(s.color(),!0),a.focus(),s.wrapper.children(".k-picker-wrap").addClass("k-state-focused")}})),l}});f.plugin(S),f.plugin(T),f.plugin(A),c.parseColor=o,c.Color={fromBytes:function(e,t,n,i){return new M(e,t,n,null!=i?i:1)},fromRGB:function(e,t,n,i){return new E(e,t,n,null!=i?i:1)},fromHSV:function(e,t,n,i){return new z(e,t,n,null!=i?i:1)}}})(jQuery,parseInt);(function(e,t){function n(e,t){return'<span unselectable="on" class="k-link"><span unselectable="on" class="k-icon k-i-arrow-'+e+'" title="'+t+'">'+t+"</span></span>"}var i=window.kendo,r=i.caret,a=i.keys,o=i.ui,s=o.Widget,l=i._activeElement,u=i._extractFormat,c=i.parseFloat,d=i.support.placeholder,f=i.getCulture,p=i._round,h="change",g="disabled",m="readonly",v="k-input",_="spin",y=".kendoNumericTextBox",w="touchend",b="mouseleave"+y,k="mouseenter"+y+" "+b,x="k-state-default",C="k-state-focused",F="k-state-hover",S="focus",T=".",D="k-state-selected",E="k-state-disabled",M="aria-disabled",A="aria-readonly",H=/^(-)?(\d*)$/,z=null,I=e.proxy,O=s.extend({init:function(e,n){var r,a,o,l,c,d=this,f=n&&n.step!==t;s.fn.init.call(d,e,n),n=d.options,e=d.element.on("blur"+y,I(d._focusout,d)).attr("role","spinbutton"),n.placeholder=n.placeholder||e.attr("placeholder"),d._reset(),d._wrapper(),d._arrows(),d._input(),i.support.mobileOS?d._text.on(w+y+" "+S+y,function(t){d._toggleText(!1),t.type===S&&e.focus()}):d._text.on(S+y,I(d._click,d)),r=d.min(e.attr("min")),a=d.max(e.attr("max")),o=d._parse(e.attr("step")),n.min===z&&r!==z&&(n.min=r),n.max===z&&a!==z&&(n.max=a),f||o===z||(n.step=o),e.attr("aria-valuemin",n.min).attr("aria-valuemax",n.max),n.format=u(n.format),l=n.value,d.value(l!==z?l:e.val()),c=e.is("[disabled]"),c?d.enable(!1):d.readonly(e.is("[readonly]")),i.notify(d)},options:{name:"NumericTextBox",decimals:z,min:z,max:z,value:z,step:1,culture:"",format:"n",spinners:!0,placeholder:"",upArrowText:"Increase value",downArrowText:"Decrease value"},events:[h,_],_editable:function(e){var t=this,n=t.element,i=e.disable,r=e.readonly,a=t._text.add(n),o=t._inputWrapper.off(k);t._toggleText(!0),t._upArrowEventHandler.unbind("press"),t._downArrowEventHandler.unbind("press"),n.off("keydown"+y).off("keypress"+y).off("paste"+y),r||i?(o.addClass(i?E:x).removeClass(i?x:E),a.attr(g,i).attr(m,r).attr(M,i).attr(A,r)):(o.addClass(x).removeClass(E).on(k,t._toggleHover),a.removeAttr(g).removeAttr(m).attr(M,!1).attr(A,!1),t._upArrowEventHandler.bind("press",function(e){e.preventDefault(),t._spin(1),t._upArrow.addClass(D)}),t._downArrowEventHandler.bind("press",function(e){e.preventDefault(),t._spin(-1),t._downArrow.addClass(D)}),t.element.on("keydown"+y,I(t._keydown,t)).on("keypress"+y,I(t._keypress,t)).on("paste"+y,I(t._paste,t)))},readonly:function(e){this._editable({readonly:e===t?!0:e,disable:!1})},enable:function(e){this._editable({readonly:!1,disable:!(e=e===t?!0:e)})},destroy:function(){var e=this;e.element.add(e._text).add(e._upArrow).add(e._downArrow).add(e._inputWrapper).off(y),e._upArrowEventHandler.destroy(),e._downArrowEventHandler.destroy(),e._form&&e._form.off("reset",e._resetHandler),s.fn.destroy.call(e)},min:function(e){return this._option("min",e)},max:function(e){return this._option("max",e)},step:function(e){return this._option("step",e)},value:function(e){var n,i=this;return e===t?i._value:(e=i._parse(e),n=i._adjust(e),e===n&&(i._update(e),i._old=i._value),t)},focus:function(){this._focusin()},_adjust:function(e){var t=this,n=t.options,i=n.min,r=n.max;return e===z?e:(i!==z&&i>e?e=i:r!==z&&e>r&&(e=r),e)},_arrows:function(){var t,r=this,a=function(){clearTimeout(r._spinning),t.removeClass(D)},o=r.options,s=o.spinners,l=r.element;t=l.siblings(".k-icon"),t[0]||(t=e(n("n",o.upArrowText)+n("s",o.downArrowText)).insertAfter(l),t.wrapAll('<span class="k-select"/>')),s||(t.parent().toggle(s),r._inputWrapper.addClass("k-expand-padding")),r._upArrow=t.eq(0),r._upArrowEventHandler=new i.UserEvents(r._upArrow,{release:a}),r._downArrow=t.eq(1),r._downArrowEventHandler=new i.UserEvents(r._downArrow,{release:a})},_blur:function(){var e=this;e._toggleText(!0),e._change(e.element.val())},_click:function(e){var t=this;clearTimeout(t._focusing),t._focusing=setTimeout(function(){var n,i,a,o=e.target,s=r(o)[0],l=o.value.substring(0,s),u=t._format(t.options.format),c=u[","],d=0;c&&(i=RegExp("\\"+c,"g"),a=RegExp("([\\d\\"+c+"]+)(\\"+u[T]+")?(\\d+)?")),a&&(n=a.exec(l)),n&&(d=n[0].replace(i,"").length,-1!=l.indexOf("(")&&0>t._value&&d++),t._focusin(),r(t.element[0],d)})},_change:function(e){var t=this;t._update(e),e=t._value,t._old!=e&&(t._old=e,t.trigger(h),t.element.trigger(h))},_culture:function(e){return e||f(this.options.culture)},_focusin:function(){var e=this;e._inputWrapper.addClass(C),e._toggleText(!1),e.element[0].focus()},_focusout:function(){var e=this;clearTimeout(e._focusing),e._inputWrapper.removeClass(C).removeClass(F),e._blur()},_format:function(e,t){var n=this._culture(t).numberFormat;return e=e.toLowerCase(),e.indexOf("c")>-1?n=n.currency:e.indexOf("p")>-1&&(n=n.percent),n},_input:function(){var t,n=this,i="k-formatted-value",r=n.element.addClass(v).show()[0],a=r.accessKey,o=n.wrapper;t=o.find(T+i),t[0]||(t=e('<input type="text"/>').insertBefore(r).addClass(i));try{r.setAttribute("type","text")}catch(s){r.type="text"}t[0].tabIndex=r.tabIndex,t[0].style.cssText=r.style.cssText,t.prop("placeholder",n.options.placeholder),a&&(t.attr("accesskey",a),r.accessKey=""),n._text=t.addClass(r.className)},_keydown:function(e){var t=this,n=e.keyCode;t._key=n,n==a.DOWN?t._step(-1):n==a.UP?t._step(1):n==a.ENTER&&t._change(t.element.val())},_keypress:function(e){var t,n,i,o,s,l,u,c,d,f,p;0===e.which||e.ctrlKey||e.keyCode===a.BACKSPACE||e.keyCode===a.ENTER||(t=this,n=t.options.min,i=t.element,o=r(i),s=o[0],l=o[1],u=String.fromCharCode(e.which),c=t._format(t.options.format),d=t._key===a.NUMPAD_DOT,f=i.val(),d&&(u=c[T]),f=f.substring(0,s)+u+f.substring(l),p=t._numericRegex(c).test(f),p&&d?(i.val(f),r(i,s+u.length),e.preventDefault()):(null!==n&&n>=0&&"-"===f.charAt(0)||!p)&&e.preventDefault(),t._key=0)},_numericRegex:function(e){var t=this,n=e[T],i=t.options.decimals;return n===T&&(n="\\"+n),i===z&&(i=e.decimals),0===i?H:(t._separator!==n&&(t._separator=n,t._floatRegExp=RegExp("^(-)?(((\\d+("+n+"\\d*)?)|("+n+"\\d*)))?$")),t._floatRegExp)},_paste:function(e){var t=this,n=e.target,i=n.value;setTimeout(function(){t._parse(n.value)===z&&t._update(i)})},_option:function(e,n){var i=this,r=i.options;return n===t?r[e]:(n=i._parse(n),(n||"step"!==e)&&(r[e]=n,i.element.attr("aria-value"+e,n).attr(e,n)),t)},_spin:function(e,t){var n=this;t=t||500,clearTimeout(n._spinning),n._spinning=setTimeout(function(){n._spin(e,50)},t),n._step(e)},_step:function(e){var t=this,n=t.element,i=t._parse(n.val())||0;l()!=n[0]&&t._focusin(),i+=t.options.step*e,t._update(t._adjust(i)),t.trigger(_)},_toggleHover:function(t){e(t.currentTarget).toggleClass(F,"mouseenter"===t.type)},_toggleText:function(e){var t=this;t._text.toggle(e),t.element.toggle(!e)},_parse:function(e,t){return c(e,this._culture(t),this.options.format)},_update:function(e){var t,n=this,r=n.options,a=r.format,o=r.decimals,s=n._culture(),l=n._format(a,s);o===z&&(o=l.decimals),e=n._parse(e,s),t=e!==z,t&&(e=parseFloat(p(e,o))),n._value=e=n._adjust(e),n._placeholder(i.toString(e,a,s)),t?(e=""+e,-1!==e.indexOf("e")&&(e=p(+e,o)),e=e.replace(T,l[T])):e="",n.element.val(e).attr("aria-valuenow",e)},_placeholder:function(e){this._text.val(e),d||e||this._text.val(this.options.placeholder)},_wrapper:function(){var t,n=this,i=n.element,r=i[0];t=i.parents(".k-numerictextbox"),t.is("span.k-numerictextbox")||(t=i.hide().wrap('<span class="k-numeric-wrap k-state-default" />').parent(),t=t.wrap("<span/>").parent()),t[0].style.cssText=r.style.cssText,r.style.width="",n.wrapper=t.addClass("k-widget k-numerictextbox").addClass(r.className).css("display",""),n._inputWrapper=e(t[0].firstChild)},_reset:function(){var t=this,n=t.element,i=n.attr("form"),r=i?e("#"+i):n.closest("form");r[0]&&(t._resetHandler=function(){setTimeout(function(){t.value(n[0].value)})},t._form=r.on("reset",t._resetHandler))}});o.plugin(O)})(window.kendo.jQuery);(function(e){function t(n,i){n.filters&&(n.filters=e.grep(n.filters,function(e){return t(e,i),e.filters?e.filters.length:e.field!=i}))}function n(e){var t,n,i,r,a,o;if(e&&e.length)for(o=[],t=0,n=e.length;n>t;t++)i=e[t],a=i.text||i.value||i,r=null==i.value?i.text||i:i.value,o[t]={text:a,value:r};return o}function i(t,n){return e.grep(t,function(t){return t.filters?(t.filters=e.grep(t.filters,function(e){return e.field!=n}),t.filters.length):t.field!=n})}var r=window.kendo,a=r.ui,o=e.proxy,s="kendoPopup",l="init",u=".kendoFilterMenu",c="Is equal to",d="Is not equal to",f={number:"numerictextbox",date:"datepicker"},p={string:"text",number:"number",date:"date"},h=r.isFunction,g=a.Widget,m='<div><div class="k-filter-help-text">#=messages.info#</div><label><input type="radio" data-#=ns#bind="checked: filters[0].value" value="true" name="filters[0].value"/>#=messages.isTrue#</label><label><input type="radio" data-#=ns#bind="checked: filters[0].value" value="false" name="filters[0].value"/>#=messages.isFalse#</label><div><button type="submit" class="k-button">#=messages.filter#</button><button type="reset" class="k-button">#=messages.clear#</button></div></div>',v='<div><div class="k-filter-help-text">#=messages.info#</div><select data-#=ns#bind="value: filters[0].operator" data-#=ns#role="dropdownlist">#for(var op in operators){#<option value="#=op#">#=operators[op]#</option>#}#</select>#if(values){#<select data-#=ns#bind="value:filters[0].value" data-#=ns#text-field="text" data-#=ns#value-field="value" data-#=ns#source=\'#=kendo.stringify(values).replace(/\'/g,"&\\#39;")#\' data-#=ns#role="dropdownlist" data-#=ns#option-label="#=messages.selectValue#"></select>#}else{#<input data-#=ns#bind="value:filters[0].value" class="k-textbox" type="text" #=role ? "data-" + ns + "role=\'" + role + "\'" : ""# />#}##if(extra){#<select class="k-filter-and" data-#=ns#bind="value: logic" data-#=ns#role="dropdownlist"><option value="and">#=messages.and#</option><option value="or">#=messages.or#</option></select><select data-#=ns#bind="value: filters[1].operator" data-#=ns#role="dropdownlist">#for(var op in operators){#<option value="#=op#">#=operators[op]#</option>#}#</select>#if(values){#<select data-#=ns#bind="value:filters[1].value" data-#=ns#text-field="text" data-#=ns#value-field="value" data-#=ns#source=\'#=kendo.stringify(values).replace(/\'/g,"&\\#39;")#\' data-#=ns#role="dropdownlist" data-#=ns#option-label="#=messages.selectValue#"></select>#}else{#<input data-#=ns#bind="value: filters[1].value" class="k-textbox" type="text" #=role ? "data-" + ns + "role=\'" + role + "\'" : ""#/>#}##}#<div><button type="submit" class="k-button k-primary">#=messages.filter#</button><button type="reset" class="k-button">#=messages.clear#</button></div></div>',_='<div data-#=ns#role="view" data-#=ns#init-widgets="false" class="k-grid-filter-menu"><div data-#=ns#role="header" class="k-header"><button class="k-button k-cancel">#=messages.cancel#</button>#=field#<button type="submit" class="k-button k-submit">#=messages.filter#</button></div><form class="k-filter-menu k-mobile-list"><ul class="k-filter-help-text"><li><span class="k-link">#=messages.info#</span><ul><li class="k-item"><label class="k-label">#=messages.operator#<select data-#=ns#bind="value: filters[0].operator">#for(var op in operators){#<option value="#=op#">#=operators[op]#</option>#}#</select></label></li><li class="k-item"><label class="k-label">#=messages.value##if(values){#<select data-#=ns#bind="value:filters[0].value"><option value="">#=messages.selectValue#</option>#for(var val in values){#<option value="#=values[val].value#">#=values[val].text#</option>#}#</select>#}else{#<input data-#=ns#bind="value:filters[0].value" class="k-textbox" type="#=inputType#" #=useRole ? "data-" + ns + "role=\'" + role + "\'" : ""# />#}#</label></li>#if(extra){#</ul><ul class="k-filter-help-text"><li><span class="k-link"></span><li class="k-item"><label class="k-label"><input type="radio" name="logic" class="k-check" data-#=ns#bind="checked: logic" value="and" />#=messages.and#</label></li><li class="k-item"><label class="k-label"><input type="radio" name="logic" class="k-check" data-#=ns#bind="checked: logic" value="or" />#=messages.or#</label></li></ul><ul class="k-filter-help-text"><li><span class="k-link"></span><li class="k-item"><label class="k-label">#=messages.operator#<select data-#=ns#bind="value: filters[1].operator">#for(var op in operators){#<option value="#=op#">#=operators[op]#</option>#}#</select></label></li><li class="k-item"><label class="k-label">#=messages.value##if(values){#<select data-#=ns#bind="value:filters[1].value"><option value="">#=messages.selectValue#</option>#for(var val in values){#<option value="#=values[val].value#">#=values[val].text#</option>#}#</select>#}else{#<input data-#=ns#bind="value:filters[1].value" class="k-textbox" type="#=inputType#" #=useRole ? "data-" + ns + "role=\'" + role + "\'" : ""# />#}#</label></li>#}#</ul></li><li class="k-button-container"><button type="reset" class="k-button">#=messages.clear#</button></li></ul></div></form></div>',y='<div data-#=ns#role="view" data-#=ns#init-widgets="false" class="k-grid-filter-menu"><div data-#=ns#role="header" class="k-header"><button class="k-button k-cancel">#=messages.cancel#</button>#=field#<button type="submit" class="k-button k-submit">#=messages.filter#</button></div><form class="k-filter-menu k-mobile-list"><ul class="k-filter-help-text"><li><span class="k-link">#=messages.info#</span><ul><li class="k-item"><label class="k-label"><input class="k-check" type="radio" data-#=ns#bind="checked: filters[0].value" value="true" name="filters[0].value"/>#=messages.isTrue#</label></li><li class="k-item"><label class="k-label"><input class="k-check" type="radio" data-#=ns#bind="checked: filters[0].value" value="false" name="filters[0].value"/>#=messages.isFalse#</label></li></ul></li><li class="k-button-container"><button type="reset" class="k-button">#=messages.clear#</button></li></ul></form></div>',b=g.extend({init:function(t,n){var i,a,s,l,c=this,d="string";g.fn.init.call(c,t,n),i=c.operators=n.operators||{},t=c.element,n=c.options,n.appendToElement||(s=t.addClass("k-with-icon k-filterable").find(".k-grid-filter"),s[0]||(s=t.prepend('<a class="k-grid-filter" href="#"><span class="k-icon k-filter"/></a>').find(".k-grid-filter")),s.attr("tabindex",-1).on("click"+u,o(c._click,c))),c.link=s||e(),c.dataSource=n.dataSource,c.field=n.field||t.attr(r.attr("field")),c.model=c.dataSource.reader.model,c._parse=function(e){return e+""},c.model&&c.model.fields&&(l=c.model.fields[c.field],l&&(d=l.type||"string",l.parse&&(c._parse=o(l.parse,l)))),n.values&&(d="enums"),c.type=d,i=i[d]||n.operators[d];for(a in i)break;c._defaultFilter=function(){return{field:c.field,operator:a||"eq",value:""}},c._refreshHandler=o(c.refresh,c),c.dataSource.bind("change",c._refreshHandler),n.appendToElement?c._init():c.refresh()},_init:function(){var t,n=this,i=n.options.ui,a=h(i);n.pane=n.options.pane,n.pane&&(n._isMobile=!0),a||(t=i||f[n.type]),n._isMobile?n._createMobileForm(t):n._createForm(t),n.form.on("submit"+u,o(n._submit,n)).on("reset"+u,o(n._reset,n)),a&&n.form.find(".k-textbox").removeClass("k-textbox").each(function(){i(e(this))}),n.form.find("["+r.attr("role")+"=numerictextbox]").removeClass("k-textbox").end().find("["+r.attr("role")+"=datetimepicker]").removeClass("k-textbox").end().find("["+r.attr("role")+"=timepicker]").removeClass("k-textbox").end().find("["+r.attr("role")+"=datepicker]").removeClass("k-textbox"),n.refresh(),n.trigger(l,{field:n.field,container:n.form})},_createForm:function(t){var i=this,a=i.options,l=i.operators||{},c=i.type;l=l[c]||a.operators[c],i.form=e('<form class="k-filter-menu"/>').html(r.template("boolean"===c?m:v)({field:i.field,format:a.format,ns:r.ns,messages:a.messages,extra:a.extra,operators:l,type:c,role:t,values:n(a.values)})),a.appendToElement?(i.element.append(i.form),i.popup=i.element.closest(".k-popup").data(s)):i.popup=i.form[s]({anchor:i.link,open:o(i._open,i),activate:o(i._activate,i),close:function(){i.options.closeCallback&&i.options.closeCallback(i.element)}}).data(s),i.form.on("keydown"+u,o(i._keydown,i))},_createMobileForm:function(t){var i=this,a=i.options,o=i.operators||{},s=i.type;o=o[s]||a.operators[s],i.form=e("<div />").html(r.template("boolean"===s?y:_)({field:i.field,format:a.format,ns:r.ns,messages:a.messages,extra:a.extra,operators:o,type:s,role:t,useRole:!r.support.input.date&&"date"===s||"number"===s,inputType:p[s],values:n(a.values)})),i.view=i.pane.append(i.form.html()),i.form=i.view.element.find("form"),i.view.element.on("click",".k-submit",function(e){i.form.submit(),e.preventDefault()}).on("click",".k-cancel",function(e){i._closeForm(),e.preventDefault()})},refresh:function(){var e=this,t=e.dataSource.filter()||{filters:[],logic:"and"};e.filterModel=r.observable({logic:"and",filters:[e._defaultFilter(),e._defaultFilter()]}),e.form&&r.bind(e.form.children().first(),e.filterModel),e._bind(t)?e.link.addClass("k-state-active"):e.link.removeClass("k-state-active")},destroy:function(){var e=this;g.fn.destroy.call(e),e.form&&(r.unbind(e.form),r.destroy(e.form),e.form.unbind(u),e.popup&&(e.popup.destroy(),e.popup=null),e.form=null),e.view&&(e.view.purge(),e.view=null),e.link.unbind(u),e._refreshHandler&&(e.dataSource.unbind("change",e._refreshHandler),e.dataSource=null),e.element=e.link=e._refreshHandler=e.filterModel=null},_bind:function(e){var t,n,i,r,a=this,o=e.filters,s=!1,l=0,u=a.filterModel;for(t=0,n=o.length;n>t;t++)r=o[t],r.field==a.field?(u.set("logic",e.logic),i=u.filters[l],i||(u.filters.push({field:a.field}),i=u.filters[l]),i.set("value",a._parse(r.value)),i.set("operator",r.operator),l++,s=!0):r.filters&&(s=s||a._bind(r));return s},_merge:function(n){var i,r,a,o=this,s=n.logic||"and",l=n.filters,u=o.dataSource.filter()||{filters:[],logic:"and"};for(t(u,o.field),l=e.grep(l,function(e){return""!==e.value&&null!=e.value}),r=0,a=l.length;a>r;r++)i=l[r],i.value=o._parse(i.value);return l.length&&(u.filters.length?(n.filters=l,"and"!==u.logic&&(u.filters=[{logic:u.logic,filters:u.filters}],u.logic="and"),l.length>1?u.filters.push(n):u.filters.push(l[0])):(u.filters=l,u.logic=s)),u},filter:function(e){e=this._merge(e),e.filters.length&&this.dataSource.filter(e)},clear:function(){var t=this,n=t.dataSource.filter()||{filters:[]};n.filters=e.grep(n.filters,function(e){return e.filters?(e.filters=i(e.filters,t.field),e.filters.length):e.field!=t.field}),n.filters.length||(n=null),t.dataSource.filter(n)},_submit:function(e){e.preventDefault(),e.stopPropagation(),this.filter(this.filterModel.toJSON()),this._closeForm()},_reset:function(){this.clear(),this._closeForm()},_closeForm:function(){this._isMobile?this.pane.navigate("",this.options.animations.right):this.popup.close()},_click:function(e){e.preventDefault(),e.stopPropagation(),this.popup||this.pane||this._init(),this._isMobile?this.pane.navigate(this.view,this.options.animations.left):this.popup.toggle()},_open:function(){var t;e(".k-filter-menu").not(this.form).each(function(){t=e(this).data(s),t&&t.close()})},_activate:function(){this.form.find(":kendoFocusable:first").focus()},_keydown:function(e){e.keyCode==r.keys.ESC&&this.popup.close()},events:[l],options:{name:"FilterMenu",extra:!0,appendToElement:!1,type:"string",operators:{string:{eq:c,neq:d,startswith:"Starts with",contains:"Contains",doesnotcontain:"Does not contain",endswith:"Ends with"},number:{eq:c,neq:d,gte:"Is greater than or equal to",gt:"Is greater than",lte:"Is less than or equal to",lt:"Is less than"},date:{eq:c,neq:d,gte:"Is after or equal to",gt:"Is after",lte:"Is before or equal to",lt:"Is before"},enums:{eq:c,neq:d}},messages:{info:"Show items with value that:",isTrue:"is true",isFalse:"is false",filter:"Filter",clear:"Clear",and:"And",or:"Or",selectValue:"-Select value-",operator:"Operator",value:"Value",cancel:"Cancel"},animations:{left:"slide",right:"slide:right"}}});a.plugin(b)})(window.kendo.jQuery);(function(e,t){function n(e,t){return e=e.split(" ")[!t+0]||e,e.replace("top","up").replace("bottom","down")}function i(e,t,n){e=e.split(" ")[!t+0]||e;var i={origin:["bottom",n?"right":"left"],position:["top",n?"right":"left"]},r=/left|right/.test(e);return r?(i.origin=["top",e],i.position[1]=l.directions[e].reverse):(i.origin[0]=e,i.position[0]=l.directions[e].reverse),i.origin=i.origin.join(" "),i.position=i.position.join(" "),i}function r(t,n){try{return e.contains(t,n)}catch(i){return!1}}function a(t){t=e(t),t.addClass("k-item").children(k).addClass(M),t.children("a").addClass(T).children(k).addClass(M),t.filter(":not([disabled])").addClass(W),t.filter(".k-separator:empty").append("&nbsp;"),t.filter("li[disabled]").addClass(j).removeAttr("disabled").attr("aria-disabled",!0),t.filter("[role]").length||t.attr("role","menuitem"),t.children("."+T).length||t.contents().filter(function(){return!(this.nodeName.match(b)||3==this.nodeType&&!e.trim(this.nodeValue))}).wrapAll("<span class='"+T+"'/>"),o(t),s(t)}function o(t){t=e(t),t.find("> .k-link > [class*=k-i-arrow]:not(.k-sprite)").remove(),t.filter(":has(.k-group)").children(".k-link:not(:has([class*=k-i-arrow]:not(.k-sprite)))").each(function(){var t=e(this),n=t.parent().parent();t.append("<span class='k-icon "+(n.hasClass(C+"-horizontal")?"k-i-arrow-s":"k-i-arrow-e")+"'/>")})}function s(t){t=e(t),t.filter(".k-first:not(:first-child)").removeClass(E),t.filter(".k-last:not(:last-child)").removeClass(S),t.filter(":first-child").addClass(E),t.filter(":last-child").addClass(S)}var l=window.kendo,u=l.ui,c=l._activeElement,d=l.support.touch&&l.support.mobileOS,f="mousedown",p="click",h=e.extend,g=e.proxy,m=e.each,v=l.template,_=l.keys,y=u.Widget,b=/^(ul|a|div)$/i,w=".kendoMenu",k="img",x="open",C="k-menu",T="k-link",S="k-last",F="close",D="timer",E="k-first",M="k-image",A="select",H="zIndex",I="activate",O="deactivate",z="touchstart"+w+" MSPointerDown"+w+" pointerdown"+w,P=l.support.pointers,R=l.support.msPointers,N=P?"pointerover":R?"MSPointerOver":"mouseenter",L=P?"pointerout":R?"MSPointerOut":"mouseleave",B=d||R||P,q="kendoPopup",W="k-state-default",V="k-state-hover",U="k-state-focused",j="k-state-disabled",Y=".k-group",$=Y+",.k-animation-container",G=":not(.k-list) > .k-item",Q=".k-item.k-state-disabled",K=".k-item:not(.k-state-disabled)",J=".k-item:not(.k-state-disabled) > .k-link",X=":not(.k-item.k-separator)",Z=X+":eq(0)",et=X+":last",tt="div:not(.k-animation-container,.k-list-container)",nt={content:v("<div class='k-content k-group' tabindex='-1'>#= content(item) #</div>"),group:v("<ul class='#= groupCssClass(group) #'#= groupAttributes(group) # role='menu' aria-hidden='true'>#= renderItems(data) #</ul>"),itemWrapper:v("<#= tag(item) # class='#= textClass(item) #'#= textAttributes(item) #>#= image(item) ##= sprite(item) ##= text(item) ##= arrow(data) #</#= tag(item) #>"),item:v("<li class='#= wrapperCssClass(group, item) #' role='menuitem' #=item.items ? \"aria-haspopup='true'\": \"\"##=item.enabled === false ? \"aria-disabled='true'\" : ''#>#= itemWrapper(data) ## if (item.items) { ##= subGroup({ items: item.items, menu: menu, group: { expanded: item.expanded } }) ## } else if (item.content || item.contentUrl) { ##= renderContent(data) ## } #</li>"),image:v("<img class='k-image' alt='' src='#= imageUrl #' />"),arrow:v("<span class='#= arrowClass(item, group) #'></span>"),sprite:v("<span class='k-sprite #= spriteCssClass #'></span>"),empty:v("")},it={wrapperCssClass:function(e,t){var n="k-item",i=t.index;return n+=t.enabled===!1?" k-state-disabled":" k-state-default",e.firstLevel&&0===i&&(n+=" k-first"),i==e.length-1&&(n+=" k-last"),t.cssClass&&(n+=" "+t.cssClass),n},textClass:function(){return T},textAttributes:function(e){return e.url?" href='"+e.url+"'":""},arrowClass:function(e,t){var n="k-icon";return n+=t.horizontal?" k-i-arrow-s":" k-i-arrow-e"},text:function(e){return e.encoded===!1?e.text:l.htmlEncode(e.text)},tag:function(e){return e.url?"a":"span"},groupAttributes:function(e){return e.expanded!==!0?" style='display:none'":""},groupCssClass:function(){return"k-group"},content:function(e){return e.content?e.content:"&nbsp;"}},rt=y.extend({init:function(t,n){var i=this;y.fn.init.call(i,t,n),t=i.wrapper=i.element,n=i.options,i._initData(n),i._updateClasses(),i._animations(n),i.nextItemZIndex=100,i._tabindex(),i._focusProxy=g(i._focusHandler,i),t.on(z,i._focusProxy).on(p+w,Q,!1).on(p+w,K,g(i._click,i)).on("keydown"+w,g(i._keydown,i)).on("focus"+w,g(i._focus,i)).on("focus"+w,".k-content",g(i._focus,i)).on(z+" "+f+w,".k-content",g(i._preventClose,i)).on("blur"+w,g(i._removeHoverItem,i)).on("blur"+w,"[tabindex]",g(i._checkActiveElement,i)).on(N+w,K,g(i._mouseenter,i)).on(L+w,K,g(i._mouseleave,i)).on(N+w+" "+L+w+" "+f+w+" "+p+w,J,g(i._toggleHover,i)),n.openOnClick&&(i.clicked=!1,i._documentClickHandler=g(i._documentClick,i),e(document).click(i._documentClickHandler)),t.attr("role","menubar"),t[0].id&&(i._ariaId=l.format("{0}_mn_active",t[0].id)),l.notify(i)
},events:[x,F,I,O,A],options:{name:"Menu",animation:{open:{duration:200},close:{duration:100}},orientation:"horizontal",direction:"default",openOnClick:!1,closeOnClick:!0,hoverDelay:100,popupCollision:t},_initData:function(e){var t=this;e.dataSource&&(t.element.empty(),t.append(e.dataSource,t.element))},setOptions:function(e){var t=this.options.animation;this._animations(e),e.animation=h(!0,t,e.animation),"dataSource"in e&&this._initData(e),y.fn.setOptions.call(this,e)},destroy:function(){var t=this;y.fn.destroy.call(t),t.element.off(w),t._documentClickHandler&&e(document).unbind("click",t._documentClickHandler),l.destroy(t.element)},enable:function(e,t){return this._toggleDisabled(e,t!==!1),this},disable:function(e){return this._toggleDisabled(e,!1),this},append:function(e,t){t=this.element.find(t);var n=this._insert(e,t,t.length?t.find("> .k-group, > .k-animation-container > .k-group"):null);return m(n.items,function(){n.group.append(this),o(this)}),o(t),s(n.group.find(".k-first, .k-last").add(n.items)),this},insertBefore:function(e,t){t=this.element.find(t);var n=this._insert(e,t,t.parent());return m(n.items,function(){t.before(this),o(this),s(this)}),s(t),this},insertAfter:function(e,t){t=this.element.find(t);var n=this._insert(e,t,t.parent());return m(n.items,function(){t.after(this),o(this),s(this)}),s(t),this},_insert:function(t,n,i){var r,o,s,l,u=this;return n&&n.length||(i=u.element),s=e.isPlainObject(t),l={firstLevel:i.hasClass(C),horizontal:i.hasClass(C+"-horizontal"),expanded:!0,length:i.children().length},n&&!i.length&&(i=e(rt.renderGroup({group:l})).appendTo(n)),s||e.isArray(t)?r=e(e.map(s?[t]:t,function(t,n){return"string"==typeof t?e(t).get():e(rt.renderItem({group:l,item:h(t,{index:n})})).get()})):(r="string"==typeof t&&"<"!=t[0]?u.element.find(t):e(t),o=r.find("> ul").addClass("k-group").attr("role","menu"),r=r.filter("li"),r.add(o.find("> li")).each(function(){a(this)})),{items:r,group:i}},remove:function(e){var t,n,i,r;return e=this.element.find(e),t=this,n=e.parentsUntil(t.element,G),i=e.parent("ul:not(.k-menu)"),e.remove(),i&&!i.children(G).length&&(r=i.parent(".k-animation-container"),r.length?r.remove():i.remove()),n.length&&(n=n.eq(0),o(n),s(n)),t},open:function(r){var a=this,o=a.options,s="horizontal"==o.orientation,u=o.direction,c=l.support.isRtl(a.wrapper);return r=a.element.find(r),/^(top|bottom|default)$/.test(u)&&(u=c?s?(u+" left").replace("default","bottom"):"left":s?(u+" right").replace("default","bottom"):"right"),r.siblings().find(">.k-popup:visible,>.k-animation-container>.k-popup:visible").each(function(){var t=e(this).data("kendoPopup");t&&t.close()}),r.each(function(){var r=e(this);clearTimeout(r.data(D)),r.data(D,setTimeout(function(){var d,f,p,g,m,v,_,y,b=r.find(".k-group:first:hidden");b[0]&&a.trigger(x,{item:r[0]})===!1&&(!b.find(".k-group")[0]&&b.children(".k-item").length>1?(f=e(window).height(),p=function(){b.css({maxHeight:f-(b.outerHeight()-b.height())-l.getShadows(b).bottom,overflow:"auto"})},l.support.browser.msie&&7>=l.support.browser.version?setTimeout(p,0):p()):b.css({maxHeight:"",overflow:""}),r.data(H,r.css(H)),r.css(H,a.nextItemZIndex++),d=b.data(q),g=r.parent().hasClass(C),m=g&&s,v=i(u,g,c),_=o.animation.open.effects,y=_!==t?_:"slideIn:"+n(u,g),d?(d=b.data(q),d.options.origin=v.origin,d.options.position=v.position,d.options.animation.open.effects=y):d=b.kendoPopup({activate:function(){a.trigger(I,{item:this.wrapper.parent()})},deactivate:function(){a.trigger(O,{item:this.wrapper.parent()})},origin:v.origin,position:v.position,collision:o.popupCollision!==t?o.popupCollision:m?"fit":"fit flip",anchor:r,appendTo:r,animation:{open:h(!0,{effects:y},o.animation.open),close:o.animation.close},close:function(e){var t=e.sender.wrapper.parent();a.trigger(F,{item:t[0]})?e.preventDefault():(t.css(H,t.data(H)),t.removeData(H),B&&(t.removeClass(V),a._removeHoverItem()))}}).data(q),b.removeAttr("aria-hidden"),d.open())},a.options.hoverDelay))}),a},close:function(t,n){var i=this,r=i.element;return t=r.find(t),t.length||(t=r.find(">.k-item")),t.each(function(){var t=e(this);!n&&i._isRootItem(t)&&(i.clicked=!1),clearTimeout(t.data(D)),t.data(D,setTimeout(function(){var e=t.find(".k-group:not(.k-list-container):not(.k-calendar-container):first:visible").data(q);e&&(e.close(),e.element.attr("aria-hidden",!0))},i.options.hoverDelay))}),i},_toggleDisabled:function(t,n){this.element.find(t).each(function(){e(this).toggleClass(W,n).toggleClass(j,!n).attr("aria-disabled",!n)})},_toggleHover:function(t){var n=e(l.eventTarget(t)||t.target).closest(G),i=t.type==N||-1!==f.indexOf(t.type);n.parents("li."+j).length||n.toggleClass(V,i||"mousedown"==t.type||"click"==t.type),this._removeHoverItem()},_preventClose:function(){this.options.closeOnClick||(this._closurePrevented=!0)},_checkActiveElement:function(t){var n=this,i=e(t?t.currentTarget:this._hoverItem()),a=n._findRootParent(i)[0];this._closurePrevented||setTimeout(function(){(!document.hasFocus()||!r(a,l._activeElement())&&t&&!r(a,t.currentTarget))&&n.close(a)},0),this._closurePrevented=!1},_removeHoverItem:function(){var e=this._hoverItem();e&&e.hasClass(U)&&(e.removeClass(U),this._oldHoverItem=null)},_updateClasses:function(){var e,t=this.element;t.addClass("k-widget k-reset k-header "+C).addClass(C+"-"+this.options.orientation),t.find("li > ul").addClass("k-group").attr("role","menu").attr("aria-hidden",t.is(":visible")).end().find("li > div").addClass("k-content").attr("tabindex","-1"),e=t.find("> li,.k-group > li"),e.each(function(){a(this)})},_mouseenter:function(t){var n=this,i=e(t.currentTarget),a=i.children(".k-animation-container").length||i.children(Y).length;t.delegateTarget==i.parents(".k-menu")[0]&&(n.options.openOnClick&&!n.clicked||d||!r(t.currentTarget,t.relatedTarget)&&a&&n.open(i),(n.options.openOnClick&&n.clicked||B)&&i.siblings().each(g(function(e,t){n.close(t,!0)},n)))},_mouseleave:function(n){var i=this,a=e(n.currentTarget),o=a.children(".k-animation-container").length||a.children(Y).length;return a.parentsUntil(".k-animation-container",".k-list-container,.k-calendar-container")[0]?(n.stopImmediatePropagation(),t):(i.options.openOnClick||d||(P||R)&&n.originalEvent.pointerType==n.originalEvent.MSPOINTER_TYPE_TOUCH||r(n.currentTarget,n.relatedTarget||n.target)||!o||r(n.currentTarget,l._activeElement())||i.close(a),t)},_click:function(n){var i,r,a,o=this,s=o.options,u=e(l.eventTarget(n)),c=u[0]?u[0].nodeName.toUpperCase():"",d="INPUT"==c||"SELECT"==c||"BUTTON"==c||"LABEL"==c,f=u.closest("."+T),p=u.closest(G),h=f.attr("href"),g=u.attr("href"),m=e("<a href='#' />").attr("href"),v=!!h&&h!==m,_=!!g&&g!==m;if(s.openOnClick||!p.children(tt)[0]){if(p.hasClass(j))return n.preventDefault(),t;if(n.handled||!o.trigger(A,{item:p[0]})||d||n.preventDefault(),n.handled=!0,r=p.children($),a=r.is(":visible"),s.closeOnClick&&!v&&(!r.length||s.openOnClick&&a))return p.removeClass(V).css("height"),o._oldHoverItem=o._findRootParent(p),o.close(f.parentsUntil(o.element,G)),o.clicked=!1,-1!="MSPointerUp".indexOf(n.type)&&n.preventDefault(),t;v&&n.enterKey&&f[0].click(),(p.parent().hasClass(C)&&s.openOnClick||l.support.touch)&&(v||d||_||n.preventDefault(),o.clicked=!0,i=r.is(":visible")?F:x,(s.closeOnClick||i!=F)&&o[i](p))}},_documentClick:function(e){r(this.element[0],e.target)||(this.clicked=!1)},_focus:function(n){var i=this,r=n.target,a=i._hoverItem(),o=c();return r==i.wrapper[0]||e(r).is(":kendoFocusable")?(o===n.currentTarget&&(a.length?i._moveHover([],a):i._oldHoverItem||i._moveHover([],i.wrapper.children().first())),t):(n.stopPropagation(),e(r).closest(".k-content").closest(".k-group").closest(".k-item").addClass(U),i.wrapper.focus(),t)},_keydown:function(e){var n,i,r,a=this,o=e.keyCode,s=a._oldHoverItem,u=l.support.isRtl(a.wrapper);if(e.target==e.currentTarget||o==_.ESC){if(s||(s=a._oldHoverItem=a._hoverItem()),i=a._itemBelongsToVertival(s),r=a._itemHasChildren(s),o==_.RIGHT)n=a[u?"_itemLeft":"_itemRight"](s,i,r);else if(o==_.LEFT)n=a[u?"_itemRight":"_itemLeft"](s,i,r);else if(o==_.DOWN)n=a._itemDown(s,i,r);else if(o==_.UP)n=a._itemUp(s,i,r);else if(o==_.ESC)n=a._itemEsc(s,i);else if(o==_.ENTER||o==_.SPACEBAR)n=s.children(".k-link"),n.length>0&&(a._click({target:n[0],preventDefault:function(){},enterKey:!0}),a._moveHover(s,a._findRootParent(s)));else if(o==_.TAB)return n=a._findRootParent(s),a._moveHover(s,n),a._checkActiveElement(),t;n&&n[0]&&(e.preventDefault(),e.stopPropagation())}},_hoverItem:function(){return this.wrapper.find(".k-item.k-state-hover,.k-item.k-state-focused").filter(":visible")},_itemBelongsToVertival:function(e){var t=this.wrapper.hasClass("k-menu-vertical");return e.length?e.parent().hasClass("k-group")||t:t},_itemHasChildren:function(e){return e.length?e.children("ul.k-group, div.k-animation-container").length>0:!1},_moveHover:function(t,n){var i=this,r=i._ariaId;t.length&&n.length&&t.removeClass(U),n.length&&(n[0].id&&(r=n[0].id),n.addClass(U),i._oldHoverItem=n,r&&(i.element.removeAttr("aria-activedescendant"),e("#"+r).removeAttr("id"),n.attr("id",r),i.element.attr("aria-activedescendant",r)))},_findRootParent:function(e){return e.parent().hasClass("k-menu")?e:e.parentsUntil(".k-menu","li.k-item").last()},_isRootItem:function(e){return e.parent().hasClass("k-menu")},_itemRight:function(e,t,n){var i,r,a=this;if(!e.hasClass(j))return t?n?(a.open(e),i=e.find(".k-group").children().first()):"horizontal"==a.options.orientation&&(r=a._findRootParent(e),a.close(r),i=r.nextAll(Z)):(i=e.nextAll(Z),i.length||(i=e.prevAll(et))),i&&!i.length?i=a.wrapper.children(".k-item").first():i||(i=[]),a._moveHover(e,i),i},_itemLeft:function(e,t){var n,i=this;return t?(n=e.parent().closest(".k-item"),i.close(n),i._isRootItem(n)&&"horizontal"==i.options.orientation&&(n=n.prevAll(Z))):(n=e.prevAll(Z),n.length||(n=e.nextAll(et))),n.length||(n=i.wrapper.children(".k-item").last()),i._moveHover(e,n),n},_itemDown:function(e,t,n){var i,r=this;if(t)i=e.nextAll(Z);else{if(!n||e.hasClass(j))return;r.open(e),i=e.find(".k-group").children().first()}return!i.length&&e.length?i=e.parent().children().first():e.length||(i=r.wrapper.children(".k-item").first()),r._moveHover(e,i),i},_itemUp:function(e,t){var n,i=this;if(t)return n=e.prevAll(Z),!n.length&&e.length?n=e.parent().children().last():e.length||(n=i.wrapper.children(".k-item").last()),i._moveHover(e,n),n},_itemEsc:function(e,t){var n,i=this;return t?(n=e.parent().closest(".k-item"),i.close(n),i._moveHover(e,n),n):e},_focusHandler:function(t){var n=this,i=e(l.eventTarget(t)).closest(G);setTimeout(function(){n._moveHover([],i),i.children(".k-content")[0]&&i.parent().closest(".k-item").removeClass(U)},200)},_animations:function(e){e&&"animation"in e&&!e.animation&&(e.animation={open:{effects:{}},close:{hide:!0,effects:{}}})}});h(rt,{renderItem:function(e){e=h({menu:{},group:{}},e);var t=nt.empty,n=e.item;return nt.item(h(e,{image:n.imageUrl?nt.image:t,sprite:n.spriteCssClass?nt.sprite:t,itemWrapper:nt.itemWrapper,renderContent:rt.renderContent,arrow:n.items||n.content?nt.arrow:t,subGroup:rt.renderGroup},it))},renderGroup:function(e){return nt.group(h({renderItems:function(e){for(var t="",n=0,i=e.items,r=i?i.length:0,a=h({length:r},e.group);r>n;n++)t+=rt.renderItem(h(e,{group:a,item:h({index:n},i[n])}));return t}},e,it))},renderContent:function(e){return nt.content(h(e,it))}}),l.ui.plugin(rt)})(window.kendo.jQuery);(function(e,t){function n(t){return e.trim(t).replace(/&nbsp;/gi,"")}function i(e,t){var n,i,r,a={};for(n=0,i=e.length;i>n;n++)r=e[n],a[r[t]]=r;return a}var r=window.kendo,a=r.ui,o=e.proxy,s=e.extend,l=e.grep,u=e.map,c=e.inArray,d="k-state-selected",f="asc",p="desc",h="change",g="init",m="select",v="kendoPopup",_="kendoFilterMenu",b="kendoMenu",k=".kendoColumnMenu",y=a.Widget,w=y.extend({init:function(t,n){var i,a=this;y.fn.init.call(a,t,n),t=a.element,n=a.options,a.owner=n.owner,a.dataSource=n.dataSource,a.field=t.attr(r.attr("field")),i=t.find(".k-header-column-menu"),i[0]||(i=t.addClass("k-with-icon").prepend('<a class="k-header-column-menu" href="#"><span class="k-icon k-i-arrowhead-s"/></a>').find(".k-header-column-menu")),a.link=i.attr("tabindex",-1).on("click"+k,o(a._click,a)),a.wrapper=e('<div class="k-column-menu"/>')},_init:function(){var e=this;e.pane=e.options.pane,e.pane&&(e._isMobile=!0),e._isMobile?e._createMobileMenu():e._createMenu(),e._sort(),e._columns(),e._filter(),e._lockColumns(),e.trigger(g,{field:e.field,container:e.wrapper})},events:[g],options:{name:"ColumnMenu",messages:{sortAscending:"Sort Ascending",sortDescending:"Sort Descending",filter:"Filter",columns:"Columns",done:"Done",settings:"Column Settings",lock:"Lock",unlock:"Unlock"},filter:"",columns:!0,sortable:!0,filterable:!0,animations:{left:"slide"}},_createMenu:function(){var e=this,t=e.options;e.wrapper.html(r.template(x)({ns:r.ns,messages:t.messages,sortable:t.sortable,filterable:t.filterable,columns:e._ownerColumns(),showColumns:t.columns,lockedColumns:t.lockedColumns})),e.popup=e.wrapper[v]({anchor:e.link,open:o(e._open,e),activate:o(e._activate,e),close:function(){e.options.closeCallback&&e.options.closeCallback(e.element)}}).data(v),e.menu=e.wrapper.children()[b]({orientation:"vertical",closeOnClick:!1}).data(b)},_createMobileMenu:function(){var e=this,t=e.options,n=r.template(C)({ns:r.ns,field:e.field,messages:t.messages,sortable:t.sortable,filterable:t.filterable,columns:e._ownerColumns(),showColumns:t.columns,lockedColumns:t.lockedColumns});e.view=e.pane.append(n),e.wrapper=e.view.element.find(".k-column-menu"),e.menu=new S(e.wrapper.children(),{pane:e.pane}),e.view.element.on("click",".k-done",function(t){e.close(),t.preventDefault()}),e.options.lockedColumns&&e.view.bind("show",function(){e._updateLockedColumns()})},destroy:function(){var e=this;y.fn.destroy.call(e),e.filterMenu&&e.filterMenu.destroy(),e._refreshHandler&&e.dataSource.unbind(h,e._refreshHandler),e.options.columns&&e.owner&&(e.owner.unbind("columnShow",e._updateColumnsMenuHandler),e.owner.unbind("columnHide",e._updateColumnsMenuHandler)),e.menu&&(e.menu.element.off(k),e.menu.destroy()),e.wrapper.off(k),e.popup&&e.popup.destroy(),e.view&&e.view.purge(),e.link.off(k),e.owner=null,e.wrapper=null,e.element=null},close:function(){this.menu.close(),this.popup&&(this.popup.close(),this.popup.element.off("keydown"+k))},_click:function(e){e.preventDefault(),e.stopPropagation();var t=this.options;t.filter&&this.element.is(!t.filter)||(this.popup||this.pane||this._init(),this._isMobile?this.pane.navigate(this.view,this.options.animations.left):this.popup.toggle())},_open:function(){var t=this;e(".k-column-menu").not(t.wrapper).each(function(){e(this).data(v).close()}),t.popup.element.on("keydown"+k,function(e){e.keyCode==r.keys.ESC&&t.close()}),t.options.lockedColumns&&t._updateLockedColumns()},_activate:function(){this.menu.element.focus()},_ownerColumns:function(){var e=this.owner.columns,t=l(e,function(e){var t=!0,i=n(e.title||"");return(e.menu===!1||!e.field&&!i.length)&&(t=!1),t});return u(t,function(t){return{originalField:t.field,field:t.field||t.title,title:t.title||t.field,hidden:t.hidden,index:c(t,e),locked:!!t.locked}})},_sort:function(){var t=this;t.options.sortable&&(t.refresh(),t._refreshHandler=o(t.refresh,t),t.dataSource.bind(h,t._refreshHandler),t.menu.bind(m,function(n){var i,r=e(n.item);r.hasClass("k-sort-asc")?i=f:r.hasClass("k-sort-desc")&&(i=p),i&&(r.parent().find(".k-sort-"+(i==f?p:f)).removeClass(d),t._sortDataSource(r,i),t.close())}))},_sortDataSource:function(e,n){var i,r,a=this,o=a.options.sortable,s=a.dataSource,l=s.sort()||[];if(e.hasClass(d)&&o&&o.allowUnsort!==!1?(e.removeClass(d),n=t):e.addClass(d),o===!0||"single"===o.mode)l=[{field:a.field,dir:n}];else{for(i=0,r=l.length;r>i;i++)if(l[i].field===a.field){l.splice(i,1);break}l.push({field:a.field,dir:n})}s.sort(l)},_columns:function(){var t=this;t.options.columns&&(t._updateColumnsMenu(),t._updateColumnsMenuHandler=o(t._updateColumnsMenu,t),t.owner.bind(["columnHide","columnShow"],t._updateColumnsMenuHandler),t.menu.bind(m,function(n){var i,a,o,s,u=e(n.item),d=t.owner.columns;t._isMobile&&n.preventDefault(),u.parent().closest("li.k-columns-item")[0]&&(i=u.find(":checkbox"),i.attr("disabled")||(s=i.attr(r.attr("field")),o=l(d,function(e){return e.field==s||e.title==s})[0],a=c(o,d),o.hidden===!0?t.owner.showColumn(a):t.owner.hideColumn(a)))}))},_updateColumnsMenu:function(){var e,t,n,i,a,o,s=r.attr("field"),d=r.attr("locked"),f=l(this._ownerColumns(),function(e){return!e.hidden}),p=l(f,function(e){return e.originalField}),h=l(p,function(e){return e.locked===!0}).length,g=l(p,function(e){return e.locked!==!0}).length;for(f=u(f,function(e){return e.field}),o=this.wrapper.find(".k-columns-item input["+s+"]").prop("disabled",!1).prop("checked",!1),e=0,t=o.length;t>e;e++)n=o.eq(e),a="true"===n.attr(d),i=!1,c(n.attr(s),f)>-1&&(i=!0,n.prop("checked",i)),i&&(1==h&&a&&n.prop("disabled",!0),1!=g||a||n.prop("disabled",!0))},_updateColumnsLockedState:function(){var e,t,n,a,o=r.attr("field"),s=r.attr("locked"),l=i(this._ownerColumns(),"field"),u=this.wrapper.find(".k-columns-item input[type=checkbox]");for(e=0,t=u.length;t>e;e++)n=u.eq(e),a=l[n.attr(o)],a&&n.attr(s,a.locked);this._updateColumnsMenu()},_filter:function(){var t=this,n=t.options;n.filterable!==!1&&(t.filterMenu=t.wrapper.find(".k-filterable")[_](s(!0,{},{appendToElement:!0,dataSource:n.dataSource,values:n.values,field:t.field},n.filterable)).data(_),t._isMobile&&t.menu.bind(m,function(n){var i=e(n.item);i.hasClass("k-filter-item")&&t.pane.navigate(t.filterMenu.view,t.options.animations.left)}))},_lockColumns:function(){var t=this;t.menu.bind(m,function(n){var i=e(n.item);i.hasClass("k-lock")?(t.owner.lockColumn(t.field),t.close()):i.hasClass("k-unlock")&&(t.owner.unlockColumn(t.field),t.close())})},_updateLockedColumns:function(){var e=this.field,t=this.owner.columns,n=l(t,function(t){return t.field==e||t.title==e})[0],i=n.locked===!0,r=l(t,function(e){return!e.hidden&&(e.locked&&i||!e.locked&&!i)}).length,a=this.wrapper.find(".k-lock").removeClass("k-state-disabled"),o=this.wrapper.find(".k-unlock").removeClass("k-state-disabled");(i||1==r)&&a.addClass("k-state-disabled"),i&&1!=r||o.addClass("k-state-disabled"),this._updateColumnsLockedState()},refresh:function(){var e,t,n,i=this,r=i.options.dataSource.sort()||[],a=i.field;for(i.wrapper.find(".k-sort-asc, .k-sort-desc").removeClass(d),t=0,n=r.length;n>t;t++)e=r[t],a==e.field&&i.wrapper.find(".k-sort-"+e.dir).addClass(d)}}),x='<ul>#if(sortable){#<li class="k-item k-sort-asc"><span class="k-link"><span class="k-sprite k-i-sort-asc"></span>${messages.sortAscending}</span></li><li class="k-item k-sort-desc"><span class="k-link"><span class="k-sprite k-i-sort-desc"></span>${messages.sortDescending}</span></li>#if(showColumns || filterable){#<li class="k-separator"></li>#}##}##if(showColumns){#<li class="k-item k-columns-item"><span class="k-link"><span class="k-sprite k-i-columns"></span>${messages.columns}</span><ul>#for (var idx = 0; idx < columns.length; idx++) {#<li><input type="checkbox" data-#=ns#field="#=columns[idx].field.replace(/"/g,"&\\#34;")#" data-#=ns#index="#=columns[idx].index#" data-#=ns#locked="#=columns[idx].locked#"/>#=columns[idx].title#</li>#}#</ul></li>#if(filterable || lockedColumns){#<li class="k-separator"></li>#}##}##if(filterable){#<li class="k-item k-filter-item"><span class="k-link"><span class="k-sprite k-filter"></span>${messages.filter}</span><ul><li><div class="k-filterable"></div></li></ul></li>#if(lockedColumns){#<li class="k-separator"></li>#}##}##if(lockedColumns){#<li class="k-item k-lock"><span class="k-link"><span class="k-sprite k-i-lock"></span>${messages.lock}</span></li><li class="k-item k-unlock"><span class="k-link"><span class="k-sprite k-i-unlock"></span>${messages.unlock}</span></li>#}#</ul>',C='<div data-#=ns#role="view" data-#=ns#init-widgets="false" class="k-grid-column-menu"><div data-#=ns#role="header" class="k-header">${messages.settings}<button class="k-button k-done">#=messages.done#</button></div><div class="k-column-menu k-mobile-list"><ul><li><span class="k-link">${field}</span><ul>#if(sortable){#<li class="k-item k-sort-asc"><span class="k-link"><span class="k-sprite k-i-sort-asc"></span>${messages.sortAscending}</span></li><li class="k-item k-sort-desc"><span class="k-link"><span class="k-sprite k-i-sort-desc"></span>${messages.sortDescending}</span></li>#}##if(lockedColumns){#<li class="k-item k-lock"><span class="k-link"><span class="k-sprite k-i-lock"></span>${messages.lock}</span></li><li class="k-item k-unlock"><span class="k-link"><span class="k-sprite k-i-unlock"></span>${messages.unlock}</span></li>#}##if(filterable){#<li class="k-item k-filter-item"><span class="k-link k-filterable"><span class="k-sprite k-filter"></span>${messages.filter}</span></li>#}#</ul></li>#if(showColumns){#<li class="k-columns-item"><span class="k-link">${messages.columns}</span><ul>#for (var idx = 0; idx < columns.length; idx++) {#<li class="k-item"><label class="k-label"><input type="checkbox" class="k-check" data-#=ns#field="#=columns[idx].field.replace(/"/g,"&\\#34;")#" data-#=ns#index="#=columns[idx].index#" data-#=ns#locked="#=columns[idx].locked#"/>#=columns[idx].title#</label></li>#}#</ul></li>#}#</ul></div></div>',S=y.extend({init:function(e,t){y.fn.init.call(this,e,t),this.element.on("click"+k,"li:not(.k-separator):not(.k-state-disabled)","_click")},events:[m],_click:function(e){e.preventDefault(),this.trigger(m,{item:e.currentTarget})},close:function(){this.options.pane.navigate("")},destroy:function(){y.fn.destroy.call(this),this.element.off(k)}});a.plugin(w)})(window.kendo.jQuery);(function(e,t){function n(t){return t=null!=t?t:"",t.type||e.type(t)||"string"}function i(t){t.find(":input:not(:button, ["+s.attr("role")+"=upload], ["+s.attr("skip")+"], [type=file]), select").each(function(){var t=s.attr("bind"),n=this.getAttribute(t)||"",i="checkbox"===this.type||"radio"===this.type?"checked:":"value:",r=this.name;-1===n.indexOf(i)&&r&&(n+=(n.length?",":"")+i+r,e(this).attr(t,n))})}function r(e){var t,i,r=(e.model.fields||e.model)[e.field],a=n(r),o=r?r.validation:{},l=s.attr("type"),u=s.attr("bind"),c={name:e.field};for(t in o)i=o[t],h(t,_)>=0?c[l]=t:f(i)||(c[t]=p(i)?i.value||t:i),c[s.attr(t+"-msg")]=i.message;return h(a,_)>=0&&(c[l]=a),c[u]=("boolean"===a?"checked:":"value:")+e.field,c}function a(e){var t,n,i,r,a,o;if(e&&e.length)for(o=[],t=0,n=e.length;n>t;t++)i=e[t],a=i.text||i.value||i,r=null==i.value?i.text||i:i.value,o[t]={text:a,value:r};return o}function o(e,t){var n,i,r=e?e.validation||{}:{};for(n in r)i=r[n],p(i)&&i.value&&(i=i.value),f(i)&&(t[n]=i)}var s=window.kendo,l=s.ui,u=l.Widget,c=e.extend,d=s.support.browser.msie&&9>s.support.browser.version,f=s.isFunction,p=e.isPlainObject,h=e.inArray,g=/("|\%|'|\[|\]|\$|\.|\,|\:|\;|\+|\*|\&|\!|\#|\(|\)|<|>|\=|\?|\@|\^|\{|\}|\~|\/|\||`)/g,m='<div class="k-widget k-tooltip k-tooltip-validation" style="margin:0.5em"><span class="k-icon k-warning"> </span>#=message#<div class="k-callout k-callout-n"></div></div>',v="change",_=["url","email","number","date","boolean"],b={number:function(t,n){var i=r(n);e('<input type="text"/>').attr(i).appendTo(t).kendoNumericTextBox({format:n.format}),e("<span "+s.attr("for")+'="'+n.field+'" class="k-invalid-msg"/>').hide().appendTo(t)},date:function(t,n){var i=r(n),a=n.format;a&&(a=s._extractFormat(a)),i[s.attr("format")]=a,e('<input type="text"/>').attr(i).appendTo(t).kendoDatePicker({format:n.format}),e("<span "+s.attr("for")+'="'+n.field+'" class="k-invalid-msg"/>').hide().appendTo(t)},string:function(t,n){var i=r(n);e('<input type="text" class="k-input k-textbox"/>').attr(i).appendTo(t)},"boolean":function(t,n){var i=r(n);e('<input type="checkbox" />').attr(i).appendTo(t)},values:function(t,n){var i=r(n);e("<select "+s.attr("text-field")+'="text"'+s.attr("value-field")+'="value"'+s.attr("source")+"='"+s.stringify(a(n.values)).replace(/\'/g,"&apos;")+"'"+s.attr("role")+'="dropdownlist"/>').attr(i).appendTo(t),e("<span "+s.attr("for")+'="'+n.field+'" class="k-invalid-msg"/>').hide().appendTo(t)}},k=u.extend({init:function(t,n){var i=this;u.fn.init.call(i,t,n),i._validateProxy=e.proxy(i._validate,i),i.refresh()},events:[v],options:{name:"Editable",editors:b,clearContainer:!0,errorTemplate:m},editor:function(e,t){var i=this,r=i.options.editors,a=p(e),o=a?e.field:e,l=i.options.model||{},u=a&&e.values,d=u?"values":n(t),f=a&&e.editor,h=f?e.editor:r[d],m=i.element.find("["+s.attr("container-for")+"="+o.replace(g,"\\$1")+"]");h=h?h:r.string,f&&"string"==typeof e.editor&&(h=function(t){t.append(e.editor)}),m=m.length?m:i.element,h(m,c(!0,{},a?e:{field:o},{model:l}))},_validate:function(t){var n,i=this,r=t.value,a=i._validationEventInProgress,o={},l=s.attr("bind"),u=t.field.replace(g,"\\$1"),c="checked:"+u,d="value:"+u;o[t.field]=t.value,n=e(":input["+l+'*="'+d+'"],:input['+l+'*="'+c+'"]',i.element).filter("["+s.attr("validate")+"!='false']"),n.length>1&&(n=n.filter(function(){var t=e(this),n=t.attr(l).split(","),i=h(d,n)>=0||h(c,n)>=0;return i&&(!t.is(":radio")||t.val()==r)}));try{i._validationEventInProgress=!0,(!i.validatable.validateInput(n)||!a&&i.trigger(v,{values:o}))&&t.preventDefault()}finally{i._validationEventInProgress=!1}},end:function(){return this.validatable.validate()},destroy:function(){var e=this;u.fn.destroy.call(e),e.options.model.unbind("set",e._validateProxy),s.unbind(e.element),e.validatable&&e.validatable.destroy(),s.destroy(e.element),e.element.removeData("kendoValidator")},refresh:function(){var n,r,a,l,u,c,f,h,g=this,m=g.options.fields||[],v=g.options.clearContainer?g.element.empty():g.element,_=g.options.model||{},b={};for(e.isArray(m)||(m=[m]),n=0,r=m.length;r>n;n++)a=m[n],l=p(a),u=l?a.field:a,c=(_.fields||_)[u],o(c,b),g.editor(a,c);if(!r){f=_.fields||_;for(u in f)o(f[u],b)}i(v),s.bind(v,g.options.model),g.options.model.unbind("set",g._validateProxy),g.options.model.bind("set",g._validateProxy),g.validatable=new s.ui.Validator(v,{validateOnBlur:!1,errorTemplate:g.options.errorTemplate||t,rules:b}),h=v.find(":kendoFocusable").eq(0).focus(),d&&h.focus()}});l.plugin(k)})(window.kendo.jQuery);(function(e,t){function n(e){return t!==e}function i(e,t,n){return Math.max(Math.min(parseInt(e,10),1/0===n?n:parseInt(n,10)),parseInt(t,10))}function r(e,t){return function(){var n=this,i=n.wrapper,r=i[0].style,o=n.options;if(!o.isMaximized&&!o.isMinimized)return n.restoreOptions={width:r.width,height:r.height},i.children(x).hide().end().children(w).find(j).parent().hide().eq(0).before(X.action({name:"Restore"})),t.call(n),"maximize"==e?n.wrapper.children(w).find(Y).parent().hide():n.wrapper.children(w).find(Y).parent().show(),n}}function o(){return!this.type||this.type.toLowerCase().indexOf("script")>=0}function a(e){var t=this;t.owner=e,t._draggable=new c(e.wrapper,{filter:x,group:e.wrapper.id+"-resizing",dragstart:p(t.dragstart,t),drag:p(t.drag,t),dragend:p(t.dragend,t)}),t._draggable.userEvents.bind("press",p(t.addOverlay,t)),t._draggable.userEvents.bind("release",p(t.removeOverlay,t))}function s(e,t){var n=this;n.owner=e,n._draggable=new c(e.wrapper,{filter:t,group:e.wrapper.id+"-moving",dragstart:p(n.dragstart,n),drag:p(n.drag,n),dragend:p(n.dragend,n),dragcancel:p(n.dragcancel,n)}),n._draggable.userEvents.stopPropagation=!1}var l=window.kendo,u=l.ui.Widget,c=l.ui.Draggable,d=e.isPlainObject,f=l._activeElement,p=e.proxy,h=e.extend,g=e.each,m=l.template,v="body",_=".kendoWindow",k=".k-window",b=".k-window-title",w=b+"bar",y=".k-window-content",x=".k-resize-handle",C=".k-overlay",T="k-content-frame",S="k-loading",F="k-state-hover",D="k-state-focused",E="k-window-maximized",M=":visible",z="hidden",H="cursor",A="open",I="activate",O="deactivate",P="close",R="refresh",N="resize",L="dragstart",B="dragend",W="error",q="overflow",V="zIndex",j=".k-window-actions .k-i-minimize,.k-window-actions .k-i-maximize",U=".k-i-pin",$=".k-i-unpin",Y=U+","+$,G=".k-window-titlebar .k-window-action",Q=".k-window-titlebar .k-i-refresh",K=l.isLocalUrl,J=u.extend({init:function(i,r){var a,s,c,f,h,g,m,v=this,x={},C=!1,T=r&&r.actions&&!r.actions.length;u.fn.init.call(v,i,r),r=v.options,f=r.position,i=v.element,h=r.content,T&&(r.actions=[]),v.appendTo=e(r.appendTo),v._animations(),h&&!d(h)&&(h=r.content={url:h}),i.find("script").filter(o).remove(),i.parent().is(v.appendTo)||f.top!==t&&f.left!==t||(i.is(M)?(x=i.offset(),C=!0):(s=i.css("visibility"),c=i.css("display"),i.css({visibility:z,display:""}),x=i.offset(),i.css({visibility:s,display:c})),f.top===t&&(f.top=x.top),f.left===t&&(f.left=x.left)),n(r.visible)&&null!==r.visible||(r.visible=i.is(M)),a=v.wrapper=i.closest(k),i.is(".k-content")&&a[0]||(i.addClass("k-window-content k-content"),v._createWindow(i,r),a=v.wrapper=i.closest(k),v._dimensions()),v._position(),r.pinned&&v.pin(!0),h&&v.refresh(h),r.visible&&v.toFront(),g=a.children(y),v._tabindex(g),r.visible&&r.modal&&v._overlay(a.is(M)).css({opacity:.5}),a.on("mouseenter"+_,G,p(v._buttonEnter,v)).on("mouseleave"+_,G,p(v._buttonLeave,v)).on("click"+_,"> "+G,p(v._windowActionHandler,v)),g.on("keydown"+_,p(v._keydown,v)).on("focus"+_,p(v._focus,v)).on("blur"+_,p(v._blur,v)),this._resizable(),this._draggable(),m=i.attr("id"),m&&(m+="_wnd_title",a.children(w).children(b).attr("id",m),g.attr({role:"dialog","aria-labelledby":m})),a.add(a.children(".k-resize-handle,"+w)).on("mousedown"+_,p(v.toFront,v)),v.touchScroller=l.touchScroller(i),v._resizeHandler=p(v._onDocumentResize,v),e(window).on("resize",v._resizeHandler),r.visible&&(v.trigger(A),v.trigger(I)),l.notify(v)},_buttonEnter:function(t){e(t.currentTarget).addClass(F)},_buttonLeave:function(t){e(t.currentTarget).removeClass(F)},_focus:function(){this.wrapper.addClass(D)},_blur:function(){this.wrapper.removeClass(D)},_dimensions:function(){var e,t,n=this.wrapper,r=this.options,o=r.width,a=r.height,s=r.maxHeight,l=["minWidth","minHeight","maxWidth","maxHeight"];for(this.title(r.title),e=0;l.length>e;e++)t=r[l[e]],t&&1/0!=t&&n.css(l[e],t);s&&1/0!=s&&this.element.css("maxHeight",s),o&&((""+o).indexOf("%")>0?n.width(o):n.width(i(o,r.minWidth,r.maxWidth))),a&&((""+a).indexOf("%")>0?n.height(a):n.height(i(a,r.minHeight,r.maxHeight))),r.visible||n.hide()},_position:function(){var e=this.wrapper,t=this.options.position;0===t.top&&(t.top=""+t.top),0===t.left&&(t.left=""+t.left),e.css({top:t.top||"",left:t.left||""})},_animations:function(){var e=this.options;e.animation===!1&&(e.animation={open:{effects:{}},close:{hide:!0,effects:{}}})},_resize:function(){l.resize(this.element.children())},_resizable:function(){var t=this.options.resizable,n=this.wrapper;this.resizing&&(n.off("dblclick"+_).children(x).remove(),this.resizing.destroy(),this.resizing=null),t&&(n.on("dblclick"+_,w,p(function(t){e(t.target).closest(".k-window-action").length||this.toggleMaximization()},this)),g("n e s w se sw ne nw".split(" "),function(e,t){n.append(X.resizeHandle(t))}),this.resizing=new a(this)),n=null},_draggable:function(){var e=this.options.draggable;this.dragging&&(this.dragging.destroy(),this.dragging=null),e&&(this.dragging=new s(this,e.dragHandle||w))},setOptions:function(e){u.fn.setOptions.call(this,e),this._animations(),this._dimensions(),this._position(),this._resizable(),this._draggable()},events:[A,I,O,P,R,N,L,B,W],options:{name:"Window",animation:{open:{effects:{zoom:{direction:"in"},fade:{direction:"in"}},duration:350},close:{effects:{zoom:{direction:"out",properties:{scale:.7}},fade:{direction:"out"}},duration:350,hide:!0}},title:"",actions:["Close"],autoFocus:!0,modal:!1,resizable:!0,draggable:!0,minWidth:90,minHeight:50,maxWidth:1/0,maxHeight:1/0,pinned:!1,position:{},content:null,visible:null,height:null,width:null,appendTo:"body"},_closable:function(){return e.inArray("close",e.map(this.options.actions,function(e){return e.toLowerCase()}))>-1},_keydown:function(e){var t,n,r,o,a,s,u=this,c=u.options,d=l.keys,f=e.keyCode,p=u.wrapper,h=10,g=u.options.isMaximized;e.target!=e.currentTarget||u._closing||(f==d.ESC&&u._closable()&&u._close(!1),!c.draggable||e.ctrlKey||g||(t=l.getOffset(p),f==d.UP?n=p.css("top",t.top-h):f==d.DOWN?n=p.css("top",t.top+h):f==d.LEFT?n=p.css("left",t.left-h):f==d.RIGHT&&(n=p.css("left",t.left+h))),c.resizable&&e.ctrlKey&&!g&&(f==d.UP?(n=!0,o=p.height()-h):f==d.DOWN&&(n=!0,o=p.height()+h),f==d.LEFT?(n=!0,r=p.width()-h):f==d.RIGHT&&(n=!0,r=p.width()+h),n&&(a=i(r,c.minWidth,c.maxWidth),s=i(o,c.minHeight,c.maxHeight),isNaN(a)||(p.width(a),u.options.width=a+"px"),isNaN(s)||(p.height(s),u.options.height=s+"px"),u.resize())),n&&e.preventDefault())
},_overlay:function(t){var n=this.appendTo.children(C),i=this.wrapper;return n.length||(n=e("<div class='k-overlay' />")),n.insertBefore(i[0]).toggle(t).css(V,parseInt(i.css(V),10)-1),n},_actionForIcon:function(e){var t=/\bk-i-\w+\b/.exec(e[0].className)[0];return{"k-i-close":"_close","k-i-maximize":"maximize","k-i-minimize":"minimize","k-i-restore":"restore","k-i-refresh":"refresh","k-i-pin":"pin","k-i-unpin":"unpin"}[t]},_windowActionHandler:function(n){var i,r;if(!this._closing)return i=e(n.target).closest(".k-window-action").find(".k-icon"),r=this._actionForIcon(i),r?(n.preventDefault(),this[r](),!1):t},_modals:function(){var t=this,n=e(k).filter(function(){var n=e(this),i=t._object(n),r=i&&i.options;return r&&r.modal&&r.visible&&n.is(M)}).sort(function(t,n){return+e(t).css("zIndex")-+e(n).css("zIndex")});return t=null,n},_object:function(e){var t=e.children(y);return t.data("kendoWindow")||t.data("kendo"+this.options.name)},center:function(){var t,n,i=this,r=i.options.position,o=i.wrapper,a=e(window),s=0,l=0;return i.options.isMaximized?i:(i.options.pinned||(s=a.scrollTop(),l=a.scrollLeft()),n=l+Math.max(0,(a.width()-o.width())/2),t=s+Math.max(0,(a.height()-o.height()-parseInt(o.css("paddingTop"),10))/2),o.css({left:n,top:t}),r.top=t,r.left=n,i)},title:function(e){var t=this,n=t.wrapper,i=t.options,r=n.children(w),o=r.children(b),a=r.outerHeight();return arguments.length?(e===!1?(n.addClass("k-window-titleless"),r.remove()):(r.length||n.prepend(X.titlebar(h(X,i))),n.css("padding-top",a),r.css("margin-top",-a)),o.text(e),t.options.title=e,t):o.text()},content:function(e){var t=this.wrapper.children(y),i=t.children(".km-scroll-container");return t=i[0]?i:t,n(e)?(l.destroy(this.element.children()),t.empty().html(e),this):t.html()},open:function(){var t,n,i=this,r=i.wrapper,o=i.options,a=o.animation.open,s=r.children(y);return i.trigger(A)||(i._closing&&r.kendoStop(!0,!0),i._closing=!1,i.toFront(),o.autoFocus&&i.element.focus(),o.visible=!0,o.modal&&(t=i._overlay(!1),t.kendoStop(!0,!0),a.duration&&l.effects.Fade?(n=l.fx(t).fadeIn(),n.duration(a.duration||0),n.endValue(.5),n.play()):t.css("opacity",.5),t.show()),r.is(M)||(s.css(q,z),r.show().kendoStop().kendoAnimate({effects:a.effects,duration:a.duration,complete:p(this._activate,this)}))),o.isMaximized&&(i._documentScrollTop=e(document).scrollTop(),e("html, body").css(q,z)),i},_activate:function(){this.options.autoFocus&&this.element.focus(),this.trigger(I),this.wrapper.children(y).css(q,"")},_removeOverlay:function(n){var i,r=this._modals(),o=this.options,a=o.modal&&!r.length,s=o.modal?this._overlay(!0):e(t),u=o.animation.close;a?!n&&u.duration&&l.effects.Fade?(i=l.fx(s).fadeOut(),i.duration(u.duration||0),i.startValue(.5),i.play()):this._overlay(!1).remove():r.length&&this._object(r.last())._overlay(!0)},_close:function(t){var n=this,i=n.wrapper,r=n.options,o=r.animation.open,a=r.animation.close;i.is(M)&&!n.trigger(P,{userTriggered:!t})&&(n._closing=!0,r.visible=!1,e(k).each(function(t,n){var r=e(n).children(y);n!=i&&r.find("> ."+T).length>0&&r.children(C).remove()}),this._removeOverlay(),i.kendoStop().kendoAnimate({effects:a.effects||o.effects,reverse:a.reverse===!0,duration:a.duration,complete:p(this._deactivate,this)})),n.options.isMaximized&&(e("html, body").css(q,""),n._documentScrollTop&&n._documentScrollTop>0&&e(document).scrollTop(n._documentScrollTop))},_deactivate:function(){this.wrapper.hide().css("opacity",""),this.trigger(O);var e=this._object(this._modals().last());e&&e.toFront()},close:function(){return this._close(!0),this},_actionable:function(t){return e(t).is(G+","+G+" .k-icon,:input,a")},_shouldFocus:function(t){var n=f(),i=this.element;return!(!this.options.autoFocus||e(n).is(i)||this._actionable(t)||i.find(n).length&&i.find(t).length)},toFront:function(t){var n,i,r=this,o=r.wrapper,a=o[0],s=+o.css(V),l=s,u=t&&t.target||null;return e(k).each(function(t,n){var i=e(n),r=i.css(V),o=i.children(y);isNaN(r)||(s=Math.max(+r,s)),n!=a&&o.find("> ."+T).length>0&&o.append(X.overlay)}),(!o[0].style.zIndex||s>l)&&o.css(V,s+2),r.element.find("> .k-overlay").remove(),r._shouldFocus(u)&&(r.element.focus(),n=e(window).scrollTop(),i=parseInt(o.position().top,10),i>0&&n>i&&(n>0?e(window).scrollTop(i):o.css("top",n))),o=null,r},toggleMaximization:function(){return this._closing?this:this[this.options.isMaximized?"restore":"maximize"]()},restore:function(){var t=this,n=t.options,i=n.minHeight,r=t.restoreOptions;return n.isMaximized||n.isMinimized?(i&&1/0!=i&&t.wrapper.css("min-height",i),t.wrapper.css({position:n.pinned?"fixed":"absolute",left:r.left,top:r.top,width:r.width,height:r.height}).removeClass(E).find(".k-window-content,.k-resize-handle").show().end().find(".k-window-titlebar .k-i-restore").parent().remove().end().end().find(j).parent().show().end().end().find(Y).parent().show(),t.options.width=r.width,t.options.height=r.height,e("html, body").css(q,""),this._documentScrollTop&&this._documentScrollTop>0&&e(document).scrollTop(this._documentScrollTop),n.isMaximized=n.isMinimized=!1,t.resize(),t):t},maximize:r("maximize",function(){var t=this,n=t.wrapper,i=n.position();h(t.restoreOptions,{left:i.left,top:i.top}),n.css({left:0,top:0,position:"fixed"}).addClass(E),this._documentScrollTop=e(document).scrollTop(),e("html, body").css(q,z),t.options.isMaximized=!0,t._onDocumentResize()}),minimize:r("minimize",function(){var e=this;e.wrapper.css({height:"",minHeight:""}),e.element.hide(),e.options.isMinimized=!0}),pin:function(t){var n=this,i=e(window),r=n.wrapper,o=parseInt(r.css("top"),10),a=parseInt(r.css("left"),10);(t||!n.options.pinned&&!n.options.isMaximized)&&(r.css({position:"fixed",top:o-i.scrollTop(),left:a-i.scrollLeft()}),r.children(w).find(U).addClass("k-i-unpin").removeClass("k-i-pin"),n.options.pinned=!0)},unpin:function(){var t=this,n=e(window),i=t.wrapper,r=parseInt(i.css("top"),10),o=parseInt(i.css("left"),10);t.options.pinned&&!t.options.isMaximized&&(i.css({position:"",top:r+n.scrollTop(),left:o+n.scrollLeft()}),i.children(w).find($).addClass("k-i-pin").removeClass("k-i-unpin"),t.options.pinned=!1)},_onDocumentResize:function(){var t,n,i=this,r=i.wrapper,o=e(window);i.options.isMaximized&&(t=o.width(),n=o.height()-parseInt(r.css("padding-top"),10),r.css({width:t,height:n}),i.options.width=t,i.options.height=n,i.resize())},refresh:function(t){var i,r,o,a=this,s=a.options,l=e(a.element);return d(t)||(t={url:t}),t=h({},s.content,t),r=n(s.iframe)?s.iframe:t.iframe,o=t.url,o?(n(r)||(r=!K(o)),r?(i=l.find("."+T)[0],i?i.src=o||i.src:l.html(X.contentFrame(h({},s,{content:t}))),l.find("."+T).unbind("load"+_).on("load"+_,p(this._triggerRefresh,this))):a._ajaxRequest(t)):(t.template&&a.content(m(t.template)({})),a.trigger(R)),l.toggleClass("k-window-iframecontent",r),a},_triggerRefresh:function(){this.trigger(R)},_ajaxComplete:function(){clearTimeout(this._loadingIconTimeout),this.wrapper.find(Q).removeClass(S)},_ajaxError:function(e,t){this.trigger(W,{status:t,xhr:e})},_ajaxSuccess:function(e){return function(t){e&&(t=m(e)(t||{})),this.content(t),this.element.prop("scrollTop",0),this.trigger(R)}},_showLoading:function(){this.wrapper.find(Q).addClass(S)},_ajaxRequest:function(t){this._loadingIconTimeout=setTimeout(p(this._showLoading,this),100),e.ajax(h({type:"GET",dataType:"html",cache:!1,error:p(this._ajaxError,this),complete:p(this._ajaxComplete,this),success:p(this._ajaxSuccess(t.template),this)},t))},destroy:function(){this.resizing&&this.resizing.destroy(),this.dragging&&this.dragging.destroy(),this.wrapper.off(_).children(y).off(_).end().find(".k-resize-handle,.k-window-titlebar").off(_),e(window).off("resize",this._resizeHandler),clearTimeout(this._loadingIconTimeout),u.fn.destroy.call(this),this.unbind(t),l.destroy(this.wrapper),this._removeOverlay(!0),this.wrapper.empty().remove(),this.wrapper=this.appendTo=this.element=e()},_createWindow:function(){var t,n,i=this.element,r=this.options,o=l.support.isRtl(i);r.scrollable===!1&&i.attr("style","overflow:hidden;"),n=e(X.wrapper(r)),r.title!==!1&&n.append(X.titlebar(h(X,r))),t=i.find("iframe:not(.k-content)").map(function(){var e=this.getAttribute("src");return this.src="",e}),n.toggleClass("k-rtl",o).appendTo(this.appendTo).append(i).find("iframe:not(.k-content)").each(function(e){this.src=t[e]}),n.find(".k-window-title").css(o?"left":"right",n.find(".k-window-actions").outerWidth()+10),i.show(),i.find("[data-role=editor]").each(function(){var t=e(this).data("kendoEditor");t&&t.refresh()}),n=i=null}}),X={wrapper:m("<div class='k-widget k-window' />"),action:m("<a role='button' href='\\#' class='k-window-action k-link'><span role='presentation' class='k-icon k-i-#= name.toLowerCase() #'>#= name #</span></a>"),titlebar:m("<div class='k-window-titlebar k-header'>&nbsp;<span class='k-window-title'>#= title #</span><div class='k-window-actions'># for (var i = 0; i < actions.length; i++) { ##= action({ name: actions[i] }) ## } #</div></div>"),overlay:"<div class='k-overlay' />",contentFrame:m("<iframe frameborder='0' title='#= title #' class='"+T+"' src='#= content.url #'>This page requires frames in order to show content</iframe>"),resizeHandle:m("<div class='k-resize-handle k-resize-#= data #'></div>")};a.prototype={addOverlay:function(){this.owner.wrapper.append(X.overlay)},removeOverlay:function(){this.owner.wrapper.find(C).remove()},dragstart:function(t){var n=this,i=n.owner,r=i.wrapper;n.elementPadding=parseInt(i.wrapper.css("padding-top"),10),n.initialCursorPosition=l.getOffset(r,"position"),n.resizeDirection=t.currentTarget.prop("className").replace("k-resize-handle k-resize-",""),n.initialSize={width:r.width(),height:r.height()},n.containerOffset=l.getOffset(i.appendTo),r.children(x).not(t.currentTarget).hide(),e(v).css(H,t.currentTarget.css(H))},drag:function(e){var t,n,r,o,a=this,s=a.owner,l=s.wrapper,u=s.options,c=a.resizeDirection,d=a.containerOffset,f=a.initialCursorPosition,p=a.initialSize,h=Math.max(e.x.location,d.left),g=Math.max(e.y.location,d.top);c.indexOf("e")>=0?(t=h-f.left,l.width(i(t,u.minWidth,u.maxWidth))):c.indexOf("w")>=0&&(o=f.left+p.width,t=i(o-h,u.minWidth,u.maxWidth),l.css({left:o-t-d.left,width:t})),c.indexOf("s")>=0?(n=g-f.top-a.elementPadding,l.height(i(n,u.minHeight,u.maxHeight))):c.indexOf("n")>=0&&(r=f.top+p.height,n=i(r-g,u.minHeight,u.maxHeight),l.css({top:r-n-d.top,height:n})),t&&(s.options.width=t+"px"),n&&(s.options.height=n+"px"),s.resize()},dragend:function(t){var n=this,i=n.owner,r=i.wrapper;return r.children(x).not(t.currentTarget).show(),e(v).css(H,""),i.touchScroller&&i.touchScroller.reset(),27==t.keyCode&&r.css(n.initialCursorPosition).css(n.initialSize),!1},destroy:function(){this._draggable&&this._draggable.destroy(),this._draggable=this.owner=null}},s.prototype={dragstart:function(t){var n=this.owner,i=n.element,r=i.find(".k-window-actions"),o=l.getOffset(n.appendTo);n.trigger(L),n.initialWindowPosition=l.getOffset(n.wrapper,"position"),n.startPosition={left:t.x.client-n.initialWindowPosition.left,top:t.y.client-n.initialWindowPosition.top},n.minLeftPosition=r.length>0?r.outerWidth()+parseInt(r.css("right"),10)-i.outerWidth():20-i.outerWidth(),n.minLeftPosition-=o.left,n.minTopPosition=-o.top,n.wrapper.append(X.overlay).children(x).hide(),e(v).css(H,t.currentTarget.css(H))},drag:function(t){var n=this.owner,i=n.options.position,r=Math.max(t.y.client-n.startPosition.top,n.minTopPosition),o=Math.max(t.x.client-n.startPosition.left,n.minLeftPosition),a={left:o,top:r};e(n.wrapper).css(a),i.top=r,i.left=o},_finishDrag:function(){var t=this.owner;t.wrapper.children(x).toggle(!t.options.isMinimized).end().find(C).remove(),e(v).css(H,"")},dragcancel:function(e){this._finishDrag(),e.currentTarget.closest(k).css(this.owner.initialWindowPosition)},dragend:function(){return this._finishDrag(),this.owner.trigger(B),!1},destroy:function(){this._draggable&&this._draggable.destroy(),this._draggable=this.owner=null}},l.ui.plugin(J)})(window.kendo.jQuery);(function(e,t){function n(e){var t,n,i=e.find(b("popover")),r=s.roles;for(t=0,n=i.length;n>t;t++)o.initWidget(i[t],{},r)}function i(e){o.triggeredByInput(e)||e.preventDefault()}function r(t){t.each(function(){o.initWidget(e(this),{},s.roles)})}var o=window.kendo,a=o.mobile,s=a.ui,l=o.attr,u=s.Widget,c=o.ViewClone,d="init",f='<div style="height: 100%; width: 100%; position: absolute; top: 0; left: 0; z-index: 20000; display: none" />',p="beforeShow",h="show",g="afterShow",m="beforeHide",v="hide",_="destroy",w=o.attrValue,b=o.roleSelector,k=u.extend({init:function(t,n){u.fn.init.call(this,t,n),this.params={},e.extend(this,n),this.transition=this.transition||this.defaultTransition,this._id(),this._layout(),this._overlay(),this._scroller(),this._model()},events:[d,p,h,g,m,v,_],options:{name:"View",title:"",reload:!1,transition:"",defaultTransition:"",useNativeScrolling:!1,stretch:!1,zoom:!1,model:null,initWidgets:!0},enable:function(e){t===e&&(e=!0),e?this.overlay.hide():this.overlay.show()},destroy:function(){this.layout&&this.layout.detach(this),this.trigger(_),u.fn.destroy.call(this),this.scroller&&this.scroller.destroy(),o.destroy(this.element)},purge:function(){this.destroy(),this.element.remove()},triggerBeforeShow:function(){return this.trigger(p,{view:this})?!1:!0},showStart:function(){var e=this;e.element.css("display",""),e.inited||(e.inited=!0,e.trigger(d,{view:e})),e.layout&&e.layout.attach(e),e._padIfNativeScrolling(),e.trigger(h,{view:e}),o.resize(e.element)},showEnd:function(){this.trigger(g,{view:this}),this._padIfNativeScrolling()},hideStart:function(){this.trigger(m,{view:this})},hideEnd:function(){var e=this;e.element.hide(),e.trigger(v,{view:e}),e.layout&&e.layout.trigger(v,{view:e,layout:e.layout})},_padIfNativeScrolling:function(){if(a.appLevelNativeScrolling()){var e=o.support.mobileOS&&o.support.mobileOS.android,t=e?"footer":"header",n=e?"header":"footer";this.content.css({paddingTop:this[t].height(),paddingBottom:this[n].height()})}},contentElement:function(){var e=this;return e.options.stretch?e.content:e.scrollerContent},clone:function(){return new c(this)},_scroller:function(){var t=this;a.appLevelNativeScrolling()||(t.options.stretch?t.content.addClass("km-stretched-view"):(t.content.kendoMobileScroller({zoom:t.options.zoom,useNative:t.options.useNativeScrolling}),t.scroller=t.content.data("kendoMobileScroller"),t.scrollerContent=t.scroller.scrollElement),o.support.kineticScrollNeeded&&(e(t.element).on("touchmove",".km-header",i),t.options.useNativeScrolling||e(t.element).on("touchmove",".km-content",i)))},_model:function(){var e=this,t=e.element,i=e.options.model;"string"==typeof i&&(i=o.getter(i)(window)),e.model=i,n(t),e.element.css("display",""),e.options.initWidgets&&(i?o.bind(t.children(),i,s,o.ui,o.dataviz.ui):a.init(t.children())),e.element.css("display","none")},_id:function(){var e=this.element,t=e.attr("id")||"";this.id=w(e,"url")||"#"+t,"#"==this.id&&(this.id=o.guid(),e.attr("id",this.id))},_layout:function(){var e=this,t=b("content"),n=e.element;n.addClass("km-view"),e.header=n.children(b("header")).addClass("km-header"),e.footer=n.children(b("footer")).addClass("km-footer"),n.children(t)[0]||n.wrapInner("<div "+l("role")+'="content"></div>'),e.content=n.children(b("content")).addClass("km-content"),e.element.prepend(e.header).append(e.footer),e.layout&&e.layout.setup(e)},_overlay:function(){this.overlay=e(f).appendTo(this.element)}}),y=u.extend({init:function(e,t){var i=this;u.fn.init.call(i,e,t),e=i.element,i.header=e.children(b("header")).addClass("km-header"),i.footer=e.children(b("footer")).addClass("km-footer"),i.elements=i.header.add(i.footer),n(e),o.mobile.init(i.element.children()),i.element.detach(),i.trigger(d,{layout:i})},options:{name:"Layout"},events:[d,h,v],setup:function(e){e.header[0]||(e.header=this.header),e.footer[0]||(e.footer=this.footer)},detach:function(e){var t=this;e.header===t.header&&t.header[0]&&e.element.prepend(t.header.detach()[0].cloneNode(!0)),e.footer===t.footer&&t.footer.length&&e.element.append(t.footer.detach()[0].cloneNode(!0))},attach:function(e){var t=this,n=t.currentView;n&&t.detach(n),e.header===t.header&&(t.header.detach(),e.element.children(b("header")).remove(),e.element.prepend(t.header)),e.footer===t.footer&&(t.footer.detach(),e.element.children(b("footer")).remove(),e.element.append(t.footer)),t.trigger(h,{layout:t,view:e}),t.currentView=e}}),x=o.Observable,C=/<body[^>]*>(([\u000a\u000d\u2028\u2029]|.)*)<\/body>/i,T="loadStart",S="loadComplete",F="showStart",D="sameViewRequested",E="viewShow",M="after",z=x.extend({init:function(t){var n,i,a,s=this;if(x.fn.init.call(s),e.extend(s,t),s.sandbox=e("<div />"),a=s.container,n=s._hideViews(a),s.rootView=n.first(),!s.rootView[0]&&t.rootNeeded)throw i=a[0]==o.mobile.application.element[0]?'Your kendo mobile application element does not contain any direct child elements with data-role="view" attribute set. Make sure that you instantiate the mobile application using the correct container.':'Your pane element does not contain any direct child elements with data-role="view" attribute set.',Error(i);s.layouts={},s.viewContainer=new o.ViewContainer(s.container),s.viewContainer.bind("accepted",function(e){e.view.params=s.params}),s.viewContainer.bind("complete",function(e){s.trigger(E,{view:e.view})}),s.viewContainer.bind(M,function(){s.trigger(M)}),s._setupLayouts(a),r(a.children(b("modalview drawer")))},destroy:function(){o.destroy(this.container);for(var e in this.layouts)this.layouts[e].destroy()},view:function(){return this.viewContainer.view},showView:function(e,t,n){if(e=e.replace(RegExp("^"+this.remoteViewURLPrefix),""),""===e&&this.remoteViewURLPrefix&&(e="/"),e===this.url)return this.trigger(D),!1;this.trigger(F);var i=this,r=function(n){return i.viewContainer.show(n,t,e)},a=i._findViewElement(e),s=o.widgetInstance(a);return i.url=e,i.params=n,s&&s.reload&&(s.purge(),a=[]),this.trigger("viewTypeDetermined",{remote:0===a.length,url:e}),a[0]?(s||(s=i._createView(a)),r(s)):(i._loadView(e,r),!0)},append:function(e,t){var n,i,o,a=this,s=a.sandbox,u=(t||"").split("?")[0],c=a.container;return C.test(e)&&(e=RegExp.$1),s[0].innerHTML=e,c.append(s.children("script, style")),n=a._hideViews(s),o=n.first(),o.length||(n=o=s.wrapInner("<div data-role=view />").children()),u&&o.hide().attr(l("url"),u),a._setupLayouts(s),i=s.children(b("modalview drawer")),c.append(s.children(b("layout modalview drawer")).add(n)),r(i),a._createView(o)},_findViewElement:function(e){var t,n=e.split("?")[0];return n?(t=this.container.children("["+l("url")+"='"+n+"']"),t[0]||-1!==n.indexOf("/")||(t=this.container.children("#"===n.charAt(0)?n:"#"+n)),t):this.rootView},_createView:function(e){var n,i=this,r=w(e,"layout");return t===r&&(r=i.layout),r&&(r=i.layouts[r]),n={defaultTransition:i.transition,loader:i.loader,container:i.container,layout:r,reload:w(e,"reload")},o.initWidget(e,n,s.roles)},_loadView:function(n,i){var r=this;return this.serverNavigation?(location.href=n,t):(r._xhr&&r._xhr.abort(),r.trigger(T),r._xhr=e.get(o.absoluteURL(n,r.remoteViewURLPrefix),function(e){r.trigger(S),i(r.append(e,n))},"html").fail(function(e){r.trigger(S),0===e.status&&e.responseText&&i(r.append(e.responseText,n))}),t)},_hideViews:function(e){return e.children(b("view splitview")).hide()},_setupLayouts:function(n){var i=this;n.children(b("layout")).each(function(){var n=e(this),r=w(n,"platform");(r===t||r===a.application.os.name)&&(i.layouts[o.attrValue(n,"id")]=o.initWidget(n,{},s.roles))})}});o.mobile.ViewEngine=z,s.plugin(k),s.plugin(y)})(window.kendo.jQuery);(function(e){var t=window.kendo,n=t.mobile.ui,i=n.Widget,r=e.map(t.eventMap,function(e){return e}).join(" ").split(" "),o=i.extend({init:function(t,n){var r=this,o=e('<div class="km-loader"><span class="km-loading km-spin"></span><span class="km-loading-left"></span><span class="km-loading-right"></span></div>');i.fn.init.call(r,o,n),r.container=t,r.captureEvents=!1,r._attachCapture(),o.append(r.options.loading).hide().appendTo(t)},options:{name:"Loader",loading:"<h1>Loading...</h1>",timeout:100},show:function(){var e=this;clearTimeout(e._loading),e.options.loading!==!1&&(e.captureEvents=!0,e._loading=setTimeout(function(){e.element.show()},e.options.timeout))},hide:function(){this.captureEvents=!1,clearTimeout(this._loading),this.element.hide()},changeMessage:function(e){this.options.loading=e,this.element.find(">h1").html(e)},transition:function(){this.captureEvents=!0,this.container.css("pointer-events","none")},transitionDone:function(){this.captureEvents=!1,this.container.css("pointer-events","")},_attachCapture:function(){function e(e){n.captureEvents&&e.preventDefault()}var t,n=this;for(n.captureEvents=!1,t=0;r.length>t;t++)n.container[0].addEventListener(r[t],e,!0)}});n.plugin(o)})(window.kendo.jQuery);(function(e,t){var n=window.kendo,i=n.mobile,r=n.roleSelector,o=i.ui,a=o.Widget,s=i.ViewEngine,l=o.View,u=i.ui.Loader,c="external",d="href",f="#!",p="navigate",h="viewShow",g="sameViewRequested",m=/popover|actionsheet|modalview|drawer/,v="#:back",_=n.attrValue,w="button backbutton detailbutton listview-link",b="tab",k=a.extend({init:function(e,t){var i=this;a.fn.init.call(i,e,t),t=i.options,e=i.element,e.addClass("km-pane"),i.options.collapsible&&e.addClass("km-collapsible-pane"),this.history=[],this.historyCallback=function(e,t){var n=i.transition;return i.transition=null,i.viewEngine.showView(e,n,t)},this._historyNavigate=function(e){if(e===v){if(1===i.history.length)return;i.history.pop(),e=i.history[i.history.length-1]}else i.history.push(e);i.historyCallback(e,n.parseQueryStringParams(e))},this._historyReplace=function(e){var t=n.parseQueryStringParams(e);i.history[i.history.length-1]=e,i.historyCallback(e,t)},i.loader=new u(e,{loading:i.options.loading}),i.viewEngine=new s({container:e,transition:t.transition,rootNeeded:!t.initial,serverNavigation:t.serverNavigation,remoteViewURLPrefix:t.root||"",layout:t.layout,loader:i.loader}),i.viewEngine.bind("showStart",function(){i.loader.transition(),i.closeActiveDialogs()}),i.viewEngine.bind("after",function(){i.loader.transitionDone()}),i.viewEngine.bind(h,function(e){i.trigger(h,e)}),i.viewEngine.bind("loadStart",function(){i.loader.show()}),i.viewEngine.bind("loadComplete",function(){i.loader.hide()}),i.viewEngine.bind(g,function(){i.trigger(g)}),i.viewEngine.bind("viewTypeDetermined",function(e){e.remote&&i.options.serverNavigation||i.trigger(p,{url:e.url})}),this._setPortraitWidth(),n.onResize(function(){i._setPortraitWidth()}),i._setupAppLinks()},closeActiveDialogs:function(){var t=this.element.find(r("actionsheet popover modalview")).filter(":visible");t.each(function(){n.widgetInstance(e(this),o).close()})},navigateToInitial:function(){var e=this.options.initial;e&&this.navigate(e)},options:{name:"Pane",portraitWidth:"",transition:"",layout:"",collapsible:!1,initial:null,loading:"<h1>Loading...</h1>"},events:[p,h,g],append:function(e){return this.viewEngine.append(e)},destroy:function(){a.fn.destroy.call(this),this.viewEngine.destroy()},navigate:function(e,t){e instanceof l&&(e=e.id),this.transition=t,this._historyNavigate(e)},replace:function(e,t){e instanceof l&&(e=e.id),this.transition=t,this._historyReplace(e)},bindToRouter:function(e){var t=this,i=t.options,r=i.initial,o=this.viewEngine;e.bind("init",function(t){var i=t.url,a=e.pushState?i:"/";o.rootView.attr(n.attr("url"),a),"/"===i&&r&&(e.navigate(r,!0),t.preventDefault())}),e.bind("routeMissing",function(e){t.historyCallback(e.url,e.params)||e.preventDefault()}),e.bind("same",function(){t.trigger(g)}),t._historyNavigate=function(t){e.navigate(t)},t._historyReplace=function(t){e.replace(t)}},hideLoading:function(){this.loader.hide()},showLoading:function(){this.loader.show()},changeLoadingMessage:function(e){this.loader.changeMessage(e)},view:function(){return this.viewEngine.view()},_setPortraitWidth:function(){var e,t=this.options.portraitWidth;t&&(e=n.mobile.application.element.is(".km-vertical")?t:"auto",this.element.css("width",e))},_setupAppLinks:function(){this.element.handler(this).on("down",r(b),"_mouseup").on("up",r(w),"_mouseup").on("click",r(b+" "+w),"_appLinkClick")},_appLinkClick:function(t){var n=e(t.currentTarget).attr("href"),i=n&&"#"!==n[0]&&this.options.serverNavigation;i||_(e(t.currentTarget),"rel")==c||t.preventDefault()},_mouseup:function(r){if(!(r.which>1||r.isDefaultPrevented())){var a=this,s=e(r.currentTarget),l=_(s,"transition"),u=_(s,"rel")||"",p=_(s,"target"),h=s.attr(d),g=h&&"#"!==h[0]&&this.options.serverNavigation;g||u===c||t===h||h===f||(s.attr(d,f),setTimeout(function(){s.attr(d,h)}),u.match(m)?(n.widgetInstance(e(h),o).openFor(s),("actionsheet"===u||"drawer"===u)&&r.stopPropagation()):("_top"===p?a=i.application.pane:p&&(a=e("#"+p).data("kendoMobilePane")),a.navigate(h,l)),r.preventDefault())}}});k.wrap=function(e){e.is(r("view"))||(e=e.wrap("<div data-"+n.ns+'role="view" data-stretch="true"></div>').parent());var t=e.wrap('<div class="km-pane-wrapper"><div></div></div>').parent(),i=new k(t);return i.navigate(""),i},o.plugin(k)})(window.kendo.jQuery);(function(e){var t=window.kendo,n=t.mobile,i=n.ui,r="show",o="hide",a="open",s="close",l='<div class="km-popup-wrapper" />',u='<div class="km-popup-arrow" />',c='<div class="km-popup-overlay" />',d="km-up km-down km-left km-right",p=i.Widget,f={down:{origin:"bottom center",position:"top center"},up:{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"}},h={animation:{open:{effects:"fade:in",duration:0},close:{effects:"fade:out",duration:400}}},g={horizontal:{offset:"top",size:"height"},vertical:{offset:"left",size:"width"}},m={up:"down",down:"up",left:"right",right:"left"},v=p.extend({init:function(n,i){var r,a,s=this,d=n.closest(".km-modalview-wrapper"),m=n.closest(".km-root").children(".km-pane").first(),v=d[0]?d:m;i.viewport?m=i.viewport:m[0]||(m=window),i.container?v=i.container:v[0]||(v=document.body),r={viewport:m,open:function(){s.overlay.show()},activate:e.proxy(s._activate,s),deactivate:function(){s.overlay.hide(),s.trigger(o)}},p.fn.init.call(s,n,i),n=s.element,i=s.options,n.wrap(l).addClass("km-popup").show(),a=s.options.direction.match(/left|right/)?"horizontal":"vertical",s.dimensions=g[a],s.wrapper=n.parent().css({width:i.width,height:i.height}).addClass("km-popup-wrapper km-"+i.direction).hide(),s.arrow=e(u).prependTo(s.wrapper).hide(),s.overlay=e(c).appendTo(v).hide(),r.appendTo=s.overlay,r.copyAnchorStyles=!1,r.autosize=!0,i.className&&s.overlay.addClass(i.className),s.popup=new t.ui.Popup(s.wrapper,e.extend(!0,r,h,f[i.direction]))},options:{name:"Popup",width:240,height:"",direction:"down",container:null,viewport:null},events:[r,o],show:function(t){var n=this,i=n.popup;i.options.anchor=e(t),i.open()},target:function(){return this.popup.options.anchor},hide:function(){this.popup.close()},destroy:function(){p.fn.destroy.call(this),this.popup.destroy(),this.overlay.remove()},_activate:function(){var t=this,n=t.options.direction,i=t.dimensions,o=i.offset,a=t.popup,s=a.options.anchor,l=e(s).offset(),u=e(a.element).offset(),c=a.flipped?m[n]:n,p=2*t.arrow[i.size](),f=t.element[i.size]()-t.arrow[i.size](),h=e(s)[i.size](),g=l[o]-u[o]+h/2;p>g&&(g=p),g>f&&(g=f),t.wrapper.removeClass(d).addClass("km-"+c),t.arrow.css(o,g).show(),t.trigger(r)}}),_=p.extend({init:function(n,r){var o,l=this;l.initialOpen=!1,p.fn.init.call(l,n,r),o=e.extend({className:"km-popover-root",show:function(){l.trigger(a,{target:l.popup.target()})},hide:function(){l.trigger(s)}},this.options.popup),l.popup=new v(l.element,o),l.popup.overlay.on("move",!1),l.pane=new i.Pane(l.element,this.options.pane),l.pane.navigateToInitial(),t.notify(l,i)},options:{name:"PopOver",popup:{},pane:{}},events:[a,s],open:function(e){this.openFor(e)},openFor:function(e){this.popup.show(e),this.initialOpen||(this.pane.navigate(""),this.popup.popup._position(),this.initialOpen=!0)},close:function(){this.popup.hide()},destroy:function(){p.fn.destroy.call(this),this.pane.destroy(),this.popup.destroy(),t.destroy(this.element)}});i.plugin(v),i.plugin(_)})(window.kendo.jQuery);(function(e,t){var n=window.kendo,i=n.mobile.ui,r=n.ui.Popup,o='<div class="km-shim"/>',a="show",s="hide",l=i.Widget,u=l.extend({init:function(t,i){var a=this,s=n.mobile.application,u=n.support.mobileOS,c=s?s.os.name:u?u.name:"ios",d="ios"===c||"wp"===c||(s?s.os.skin:!1),p="blackberry"===c,f=i.align||(d?"bottom center":p?"center right":"center center"),h=i.position||(d?"bottom center":p?"center right":"center center"),g=i.effect||(d?"slideIn:up":p?"slideIn:left":"fade:in"),m=e(o).handler(a).hide();l.fn.init.call(a,t,i),a.shim=m,t=a.element,i=a.options,i.className&&a.shim.addClass(i.className),i.modal||a.shim.on("up","hide"),(s?s.element:e(document.body)).append(m),a.popup=new r(a.element,{anchor:m,modal:!0,appendTo:m,origin:f,position:h,animation:{open:{effects:g,duration:i.duration},close:{duration:i.duration}},deactivate:function(){m.hide()},open:function(){m.show()}}),n.notify(a)},events:[a,s],options:{name:"Shim",modal:!1,align:t,position:t,effect:t,duration:200},show:function(){this.popup.open(),this.trigger(a)},hide:function(t){t&&e.contains(this.shim.children().children(".k-popup")[0],t.target)||(this.popup.close(),this.trigger(s))},destroy:function(){l.fn.destroy.call(this),this.shim.kendoDestroy(),this.popup.destroy(),this.shim.remove()}});i.plugin(u)})(window.kendo.jQuery);(function(e){var t=window.kendo,n=t.support,i=t.mobile.ui,r=i.Shim,o=i.Popup,a=i.Widget,s="open",l="close",u="command",c="li>a",d="actionsheetContext",p='<div class="km-actionsheet-wrapper" />',f=t.template('<li class="km-actionsheet-cancel"><a href="\\#">#:cancel#</a></li>'),h=a.extend({init:function(s,l){var u,d,h,g=this,m=n.mobileOS;a.fn.init.call(g,s,l),l=g.options,h=l.type,d="auto"===h?m&&m.tablet:"tablet"===h,u=d?o:r,s=g.element,l.cancelTemplate&&(f=t.template(l.cancelTemplate)),s.addClass("km-actionsheet").append(f({cancel:g.options.cancel})).wrap(p).on("up",c,"_click").on("click",c,t.preventDefault),g.view().bind("destroy",function(){g.destroy()}),g.wrapper=s.parent().addClass(h?" km-actionsheet-"+h:""),g.shim=new u(g.wrapper,e.extend({modal:m.ios&&7>m.majorVersion,className:"km-actionsheet-root"},g.options.popup)),t.notify(g,i),d&&t.onResize(e.proxy(this,"_resize"))},events:[s,l,u],options:{name:"ActionSheet",cancel:"Cancel",type:"auto",popup:{height:"auto"}},open:function(t,n){var i=this;i.target=e(t),i.context=n,i.shim.show(t)},close:function(){this.context=this.target=null,this.shim.hide()},openFor:function(e){var t=this,n=e.data(d);t.open(e,n),t.trigger(s,{target:e,context:n})},destroy:function(){a.fn.destroy.call(this),this.shim.destroy()},_click:function(n){var i,r;n.isDefaultPrevented()||(i=e(n.currentTarget),r=i.data("action"),r&&t.getter(r)(window)({target:this.target,context:this.context}),this.trigger(u,{target:this.target,context:this.context,currentTarget:i}),n.preventDefault(),this.close(),this.trigger(l))},_resize:function(){this.shim.hide()}});i.plugin(h)})(window.kendo.jQuery);(function(e,t){function n(e){return Array(e+1).join('<td class="k-group-cell">&nbsp;</td>')}function i(e){var t,n=" ";if(e){if(typeof e===Pt)return e;for(t in e)n+=t+'="'+e[t]+'"'}return n}function r(t){var n=0;return e("> .k-grouping-header, > .k-grid-toolbar",t).each(function(){n+=this.offsetHeight}),n}function o(t,n){e("th, th .k-grid-filter, th .k-link",t).add(document.body).css("cursor",n)}function a(e){var t,n,i={},r={};if(!nt(e))for(J(e)||(e=[e]),t=0,n=e.length;n>t;t++)i[e[t].aggregate]=0,r[e[t].field]=i;return r}function s(e,t,n,i){t=e.eq(t),"number"==typeof n?t[i?"insertBefore":"insertAfter"](e.eq(n)):t.appendTo(n)}function l(t,n,i){return e(t).add(n).find(i)}function d(e,t,n){var i,r,o,a;for(n=J(n)?n:[n],i=0,r=n.length;r>i;i++)o=n[i],Y(o)&&o.click&&(a=o.name||o.text,t.on(zt+pt,"a.k-grid-"+(a||"").replace(/\s/g,""),{commandName:a},et(o.click,e)))}function c(e){return K(e,function(e){return!e.hidden})}function u(e){var t,n,i,r=0;
for(n=0,i=e.length;i>n;n++)t=e[n].style.width,t&&-1==t.indexOf("%")&&(r+=parseInt(t,10));return r}function p(e){return K(e,function(e){return e.locked})}function f(e){return K(e,function(e){return!e.locked})}function h(e){return K(e,function(e){return!e.locked&&!e.hidden})}function g(e){return K(e,function(e){return e.locked&&!e.hidden})}function m(t,n,i){var r,o=t;return V?t[0].innerHTML=i:(r=document.createElement("div"),r.innerHTML="<table><tbody>"+i+"</tbody></table>",t=r.firstChild.firstChild,n[0].replaceChild(t,o[0]),t=e(t)),t}function v(e){e=e||{};var t=e.style;return t?(t=t.replace(/((.*)?display)(.*)?:([^;]*)/i,"$1:none"),t===e.style&&(t=t.replace(/(.*)?/i,"display:none;$1"))):t="display:none",G({},e,{style:t})}function _(e){e=e||{};var t=e.style;return t&&(e.style=t.replace(/(display\s*:\s*none\s*;?)*/gi,"")),e}function k(t,n,i,r){var o,a=t.find(">colgroup"),s=Q(n,function(e){return o=e.width,o&&0!==parseInt(o,10)?N.format('<col style="width:{0}"/>',typeof o===Pt?o:o+"px"):"<col />"});(i||a.find(".k-hierarchy-col").length)&&s.splice(0,0,'<col class="k-hierarchy-col" />'),a.length&&a.remove(),a=e(Array(r+1).join('<col class="k-group-col">')+s.join("")),a.is("colgroup")||(a=e("<colgroup/>").append(a)),t.prepend(a),en.msie&&8==en.version&&(t.css("display","inline-table"),window.setTimeout(function(){t.css("display","")},1))}function b(e,t){var n,i,r=0;for(n=0,i=t.length;i>n;n++)t[n].locked&&(e.eq(n).insertBefore(e.eq(r)),r++)}function w(e){var t,n,i,r={};for(n=0,i=e.length;i>n;n++)t=e[n],r[t.value]=t.text;return r}function y(e,t,n){var i=n&&n.length&&Y(n[0])&&"value"in n[0],r=i?w(n)[e]:e;return r=null!=r?r:"",t?N.format(t,r):r}function x(e,t,n){for(var i,r=0,o=e[r];o;){if(i=n?!0:"none"!==o.style.display,i&&!Vt.test(o.className)&&--t<0){o.style.display=n?"":"none";break}o=e[++r]}}function C(t,n){for(var i,r,o=0,a=t.length;a>o;o+=1)r=t.eq(o),r.is(".k-grouping-row,.k-detail-row")?(i=r.children(":not(.k-group-cell):first,.k-detail-cell").last(),i.attr("colspan",parseInt(i.attr("colspan"),10)-1)):(r.hasClass("k-grid-edit-row")&&(i=r.children(".k-edit-container")[0])&&(i=e(i),i.attr("colspan",parseInt(i.attr("colspan"),10)-1),i.find("col").eq(n).remove(),r=i.find("tr:first")),x(r[0].cells,n,!1))}function T(t,n){for(var i,r,o,a=0,s=t.length;s>a;a+=1)r=t.eq(a),r.is(".k-grouping-row,.k-detail-row")?(i=r.children(":not(.k-group-cell):first,.k-detail-cell").last(),i.attr("colspan",parseInt(i.attr("colspan"),10)+1)):(r.hasClass("k-grid-edit-row")&&(i=r.children(".k-edit-container")[0])&&(i=e(i),i.attr("colspan",parseInt(i.attr("colspan"),10)+1),k(i.find(">form>table"),c(o),!1,0),r=i.find("tr:first")),x(r[0].cells,n,!0))}function S(e,t){var n,i,r;for(i=0,r=e.length;r>i;i+=1)n=e.eq(i).children().last(),n.attr("colspan",parseInt(n.attr("colspan"),10)+1),n=t.eq(i).children().last(),n.attr("colspan",parseInt(n.attr("colspan"),10)-1)}function F(e){var t,n,i=0,r=e.find(">colgroup>col");for(t=0,n=r.length;n>t;t+=1)i+=parseInt(r[t].style.width,10);return i}function D(e,t){var n,i=e.clientHeight,r=t.clientHeight;i>r?n=i+"px":r>i&&(n=r+"px"),n&&(e.style.height=t.style.height=n)}function H(e,t){var n,i,r;if(typeof e===Pt&&e===t)return e;if(Y(e)&&e.name===t)return e;if(J(e))for(n=0,i=e.length;i>n;n++)if(r=e[n],typeof r===Pt&&r===t||r.name===t)return r;return null}function E(t,n){var i,r,o,a=en.msie;if(n===!0){if(t=e(t),i=!0,i&&(r=t.parent().scrollTop(),o=t.parent().scrollLeft()),a)try{t[0].setActive()}catch(s){t[0].focus()}else t[0].focus();i&&(t.parent().scrollTop(r),t.parent().scrollLeft(o))}else e(t).one("focusin",function(e){e.preventDefault()}).focus()}function M(t){var n=e(t.currentTarget),i=n.is("th"),r=this.table.add(this.lockedTable),o=this.thead.parent().add(e(">table",this.lockedHeader)),a=n.closest("table")[0];N.support.touch||(a===r[0]||a===r[1]||a===o[0]||a===o[1])&&(this.current(n),(i||!e(t.target).is(":button,a,:input,a>.k-icon,textarea,span.k-icon,span.k-link,.k-input,.k-multiselect-wrap"))&&setTimeout(function(){nn&&e(N._activeElement()).hasClass("k-widget")||E(a,!0)}),i&&t.preventDefault())}function z(t,n,i,r){if(t=e(t),r){var o=n;n=i,i=o}return n.not(t).length!=n.length?t:t[0]==i[0]?n.eq(0):n.eq(1)}function A(e,t,n,i,r){var o,a,s=r?"prevAll":"nextAll";return e?(o=e.parent()[s](lt).first(),o[0]||!r&&!e.is("th")||(t=z(t,n,i,r),E(t),o=t.find((r?">thead>":">tbody>")+lt).first()),a=e.index(),e=o.children().eq(a),e[0]&&e.is(dt)||(e=o.children(dt).first())):e=n.find(ct),e}function I(e,t,n,i,r){var o=n.length>1;return e?e.prev(":visible")[0]?e=e.prevAll(at).first():o&&(t==n[1]?(E(n[0]),e=r(e.parent()).children(at).last()):t==i[1]&&(E(i[0]),e=i.eq(0).find("tr>"+at).last())):e=n.find(ct),e}function O(e,t,n,i,r){var o=n.length>1;return e?e.next(":visible")[0]?e=e.nextAll(at).first():o&&(t==n[0]?(E(n[1]),e=r(e.parent()).children(at).first()):t==i[0]&&(E(i[1]),e=i.eq(1).find("tr>"+at).first())):e=n.find(ct),e}function P(e,t,n,i,r){var o=2==n.length,a=!0,s=r?e.prevAll(at+":first"):e.nextAll(":visible:first");return s.length||(s=e.parent(),o&&(a=r&&t==n[0]||!r&&t==n[1],s=i(s)),a&&(s=s[r?"prevAll":"nextAll"]("tr:not(.k-grouping-row):not(.k-detail-row):visible:first")),s=s.children(at+(r?":last":":first"))),s}function R(e,t,i){return'<tr class="k-grouping-row">'+n(t)+'<td colspan="'+e+'" aria-expanded="true"><p class="k-reset"><a class="k-icon k-i-collapse" href="#" tabindex="-1"></a>'+i+"</p></td></tr>"}function L(e){return'<tr class="k-grouping-row"><td colspan="'+e+'" aria-expanded="true"><p class="k-reset">&nbsp;</p></td></tr>'}var N=window.kendo,W=N.ui,B=N.data.DataSource,q=W.Groupable,V=N.support.tbodyInnerHtml,j=N._activeElement,U=W.Widget,$=N.keys,Y=e.isPlainObject,G=e.extend,Q=e.map,K=e.grep,J=e.isArray,X=e.inArray,Z=Array.prototype.push,et=e.proxy,tt=N.isFunction,nt=e.isEmptyObject,it=Math,rt="progress",ot="error",at=":not(.k-group-cell):not(.k-hierarchy-cell):visible",st="tbody>tr:not(.k-grouping-row):not(.k-detail-row):not(.k-group-footer) > td:not(.k-group-cell):not(.k-hierarchy-cell)",lt="tr:not(.k-footer-template):visible",dt=":not(.k-group-cell):not(.k-hierarchy-cell):visible",ct=lt+":first>"+dt+":first",ut="th.k-header:not(.k-group-cell):not(.k-hierarchy-cell)",pt=".kendoGrid",ft="edit",ht="save",gt="remove",mt="detailInit",vt="filterMenuInit",_t="columnMenuInit",kt="change",bt="columnHide",wt="columnShow",yt="saveChanges",xt="dataBound",Ct="detailExpand",Tt="detailCollapse",St="k-state-focused",Ft="k-state-selected",Dt="columnResize",Ht="columnReorder",Et="columnLock",Mt="columnUnlock",zt="click",At="height",It="tabIndex",Ot="function",Pt="string",Rt="Are you sure you want to delete this record?",Lt="Delete",Nt="Cancel",Wt=/(\}|\#)/gi,Bt=/#/gi,qt="[\\x20\\t\\r\\n\\f]",Vt=RegExp("(^|"+qt+")(k-group-cell|k-hierarchy-cell)("+qt+"|$)"),jt='<a class="k-button k-button-icontext #=className#" #=attr# href="\\#"><span class="#=iconClass# #=imageClass#"></span>#=text#</a>',Ut="dir",$t="asc",Yt="single",Gt="field",Qt="desc",Kt=".kendoSorter",Jt=".k-link",Xt="aria-sort",Zt=!1,en=N.support.browser,tn=en.msie&&7==en.version,nn=en.msie&&8==en.version,rn=U.extend({init:function(e,t){var n=this;U.fn.init.call(n,e,t),n._refreshHandler=et(n.refresh,n),n.setDataSource(t.dataSource),n.wrap()},setDataSource:function(e){var t=this;t.dataSource&&t.dataSource.unbind(kt,t._refreshHandler),t.dataSource=e,t.dataSource.bind(kt,t._refreshHandler)},options:{name:"VirtualScrollable",itemHeight:e.noop},destroy:function(){var e=this;U.fn.destroy.call(e),e.dataSource.unbind(kt,e._refreshHandler),e.wrapper.add(e.verticalScrollbar).off(pt),e.drag&&(e.drag.destroy(),e.drag=null),e.wrapper=e.element=e.verticalScrollbar=null,e._refreshHandler=null},wrap:function(){var t,n=this,i=N.support.scrollbar()+1,r=n.element;r.css({width:"auto",overflow:"hidden"}).css(Zt?"padding-left":"padding-right",i),n.content=r.children().first(),t=n.wrapper=n.content.wrap('<div class="k-virtual-scrollable-wrap"/>').parent().bind("DOMMouseScroll"+pt+" mousewheel"+pt,et(n._wheelScroll,n)),N.support.kineticScrollNeeded&&(n.drag=new N.UserEvents(n.wrapper,{global:!0,move:function(e){n.verticalScrollbar.scrollTop(n.verticalScrollbar.scrollTop()-e.y.delta),t.scrollLeft(t.scrollLeft()-e.x.delta),e.preventDefault()}})),n.verticalScrollbar=e('<div class="k-scrollbar k-scrollbar-vertical" />').css({width:i}).appendTo(r).bind("scroll"+pt,et(n._scroll,n))},_wheelScroll:function(t){var n=this.verticalScrollbar.scrollTop(),i=N.wheelDeltaY(t);i&&(t.preventDefault(),e(t.currentTarget).one("wheel"+pt,!1),this.verticalScrollbar.scrollTop(n+-i))},_scroll:function(e){var t=this,n=e.currentTarget.scrollTop,i=t.dataSource,r=t.itemHeight,o=i.skip()||0,a=t._rangeStart||o,s=t.element.innerHeight(),l=!!(t._scrollbarTop&&t._scrollbarTop>n),d=it.max(it.floor(n/r),0),c=it.max(d+it.floor(s/r),0);t._scrollTop=n-a*r,t._scrollbarTop=n,t._fetch(d,c,l)||(t.wrapper[0].scrollTop=t._scrollTop)},_fetch:function(e,t,n){var i=this,r=i.dataSource,o=i.itemHeight,a=r.take(),s=i._rangeStart||r.skip()||0,l=it.floor(e/a)*a,d=!1,c=.33;return s>e?(d=!0,s=it.max(0,t-a),i._scrollTop=(e-s)*o,i._page(s,a)):t>=s+a&&!n?(d=!0,s=e,i._scrollTop=o,i._page(s,a)):i._fetching||(l+a-a*c>e&&e>a&&r.prefetch(l-a,a),t>l+a*c&&r.prefetch(l+a,a)),d},_page:function(e,t){var n=this,i=n.dataSource;clearTimeout(n._timeout),n._fetching=!0,n._rangeStart=e,i.inRange(e,t)?i.range(e,t):(N.ui.progress(n.wrapper.parent(),!0),n._timeout=setTimeout(function(){i.range(e,t)},100))},refresh:function(){var e,t,n,i,r=this,o="",a=25e4,s=r.dataSource,l=r._rangeStart,d=N.support.kineticScrollNeeded?0:N.support.scrollbar(),c=r.wrapper[0];for(N.ui.progress(r.wrapper.parent(),!1),clearTimeout(r._timeout),n=r.itemHeight=r.options.itemHeight()||0,i=c.scrollWidth>c.offsetWidth?d:0,e=s.total()*n+i,t=0;t<it.floor(e/a);t++)o+='<div style="width:1px;height:'+a+'px"></div>';e%a&&(o+='<div style="width:1px;height:'+e%a+'px"></div>'),r.verticalScrollbar.html(o),c.scrollTop=r._scrollTop,r.drag&&r.drag.cancel(),l&&!r._fetching&&(r._rangeStart=s.skip(),1===s.page()&&(r.verticalScrollbar[0].scrollTop=0)),r._fetching=!1}}),on={create:{text:"Add new record",imageClass:"k-add",className:"k-grid-add",iconClass:"k-icon"},cancel:{text:"Cancel changes",imageClass:"k-cancel",className:"k-grid-cancel-changes",iconClass:"k-icon"},save:{text:"Save changes",imageClass:"k-update",className:"k-grid-save-changes",iconClass:"k-icon"},destroy:{text:"Delete",imageClass:"k-delete",className:"k-grid-delete",iconClass:"k-icon"},edit:{text:"Edit",imageClass:"k-edit",className:"k-grid-edit",iconClass:"k-icon"},update:{text:"Update",imageClass:"k-update",className:"k-primary k-grid-update",iconClass:"k-icon"},canceledit:{text:"Cancel",imageClass:"k-cancel",className:"k-grid-cancel",iconClass:"k-icon"}},an=U.extend({init:function(t,n){var i=this;n=J(n)?{dataSource:n}:n,U.fn.init.call(i,t,n),Zt=N.support.isRtl(t),i._element(),i._aria(),i._columns(i.options.columns),i._dataSource(),i._tbody(),i._pageable(),i._thead(),i._groupable(),i._toolbar(),i._setContentHeight(),i._templates(),i._navigatable(),i._selectable(),i._details(),i._editable(),i._attachCustomCommandsEvent(),i.options.autoBind?i.dataSource.fetch():i._footer(),i.lockedContent&&(i.wrapper.addClass("k-grid-lockedcolumns"),i._resizeHandler=function(){i.resize()},e(window).on("resize"+pt,i._resizeHandler)),N.notify(i)},events:[kt,"dataBinding","cancel",xt,Ct,Tt,mt,vt,_t,ft,ht,gt,yt,Dt,Ht,wt,bt,Et,Mt],setDataSource:function(e){var t=this;t.options.dataSource=e,t._dataSource(),t._pageable(),t._thead(),t.options.groupable&&t._groupable(),t.virtualScrollable&&t.virtualScrollable.setDataSource(t.options.dataSource),t.options.navigatable&&t._navigatable(),t.selectable&&t._selectable(),t.options.autoBind&&e.fetch()},options:{name:"Grid",columns:[],toolbar:null,autoBind:!0,filterable:!1,scrollable:!0,sortable:!1,selectable:!1,navigatable:!1,pageable:!1,editable:!1,groupable:!1,rowTemplate:"",altRowTemplate:"",dataSource:{},height:null,resizable:!1,reorderable:!1,columnMenu:!1,detailTemplate:null,columnResizeHandleWidth:3,mobile:""},destroy:function(){var t,n=this;U.fn.destroy.call(n),n._resizeHandler&&e(window).off("resize"+pt,n._resizeHandler),n.pager&&n.pager.element&&n.pager.destroy(),n.pager=null,n.groupable&&n.groupable.element&&n.groupable.element.kendoGroupable("destroy"),n.groupable=null,n.options.reorderable&&n.wrapper.data("kendoReorderable").destroy(),n.selectable&&n.selectable.destroy(),n.resizable&&(n.resizable.destroy(),n._resizeUserEvents&&(n._resizeHandleDocumentClickHandler&&e(document).off("click",n._resizeHandleDocumentClickHandler),n._resizeUserEvents.destroy(),n._resizeUserEvents=null),n.resizable=null),n.virtualScrollable&&n.virtualScrollable.element&&n.virtualScrollable.destroy(),n.virtualScrollable=null,n._destroyColumnAttachments(),n._destroyEditable(),n.dataSource&&(n.dataSource.unbind(kt,n._refreshHandler).unbind(rt,n._progressHandler).unbind(ot,n._errorHandler),n._refreshHandler=n._progressHandler=n._errorHandler=null),t=n.element.add(n.wrapper).add(n.table).add(n.thead).add(n.wrapper.find(">.k-grid-toolbar")),n.content&&(t=t.add(n.content).add(n.content.find(">.k-virtual-scrollable-wrap"))),n.lockedHeader&&n._removeLockedContainers(),n.pane&&n.pane.destroy(),n._draggableInstance&&n._draggableInstance.element&&n._draggableInstance.destroy(),n._draggableInstance=null,t.off(pt),N.destroy(n.wrapper),n.scrollables=n.thead=n.tbody=n.element=n.table=n.content=n.footer=n.wrapper=n._groupableClickHandler=n._setContentWidthHandler=null},setOptions:function(e){var t=this;U.fn.setOptions.call(this,e),t._templates()},items:function(){return this.tbody.children().filter(function(){var t=e(this);return!t.hasClass("k-grouping-row")&&!t.hasClass("k-detail-row")&&!t.hasClass("k-group-footer")})},_destroyColumnAttachments:function(){var t=this;t.resizeHandle=null,t.thead&&t.thead.find("th").each(function(){var t=e(this),n=t.data("kendoFilterMenu"),i=t.data("kendoSorter"),r=t.data("kendoColumnMenu");n&&n.destroy(),i&&i.destroy(),r&&r.destroy()})},_attachCustomCommandsEvent:function(){var e,t,n,i=this,r=i.columns||[];for(t=0,n=r.length;n>t;t++)e=r[t].command,e&&d(i,i.wrapper,e)},_aria:function(){var e=this.element.attr("id")||"aria";e&&(this._cellId=e+"_active_cell")},_element:function(){var t=this,n=t.element;n.is("table")||(n=t.options.scrollable?t.element.find("> .k-grid-content > table"):t.element.children("table"),n.length||(n=e("<table />").appendTo(t.element))),tn&&n.attr("cellspacing",0),t.table=n.attr("role",t._hasDetails()?"treegrid":"grid"),t._wrapper()},_createResizeHandle:function(t,n){var i,o,a,s,l,d=this,c=d.options.columnResizeHandleWidth,u=d.options.scrollable,p=d.resizeHandle;p&&d.lockedContent&&p.data("th")[0]!==n[0]&&(p.remove(),p=null),p||(p=d.resizeHandle=e('<div class="k-resize-handle"><div class="k-resize-handle-inner"></div></div>'),t.append(p)),Zt?(i=n.position().left,u&&(o=n.closest(".k-grid-header-wrap, .k-grid-header-locked"),a=en.msie?o.scrollLeft():0,s=en.webkit?o[0].scrollWidth-o[0].offsetWidth-o.scrollLeft():0,l=en.mozilla?o[0].scrollWidth-o[0].offsetWidth-(o[0].scrollWidth-o[0].offsetWidth-o.scrollLeft()):0,i-=s-l+a)):(i=n[0].offsetWidth,n.prevAll(":visible").each(function(){i+=this.offsetWidth})),p.css({top:u?0:r(d.wrapper),left:i-c,height:n.outerHeight(),width:3*c}).data("th",n).show()},_positionColumnResizeHandle:function(){var t=this,n=t.options.columnResizeHandleWidth,i=t.lockedHeader?t.lockedHeader.find("thead:first"):e();t.thead.add(i).on("mousemove"+pt,"th",function(i){var r,a,s,l=e(this);l.hasClass("k-group-cell")||l.hasClass("k-hierarchy-cell")||(r=i.clientX,a=e(window).scrollLeft(),s=l.offset().left+(Zt?0:this.offsetWidth),r+a>s-n&&s+n>r+a?t._createResizeHandle(l.closest("div"),l):t.resizeHandle?t.resizeHandle.hide():o(t.wrapper,""))})},_resizeHandleDocumentClick:function(t){e(t.target).closest(".k-column-active").length||(e(document).off(t),this._hideResizeHandle())},_hideResizeHandle:function(){this.resizeHandle&&(this.resizeHandle.data("th").removeClass("k-column-active"),this.lockedContent&&!this._isMobile?(this.resizeHandle.remove(),this.resizeHandle=null):this.resizeHandle.hide())},_positionColumnResizeHandleTouch:function(){var t=this,n=t.lockedHeader?t.lockedHeader.find("thead:first"):e();t._resizeUserEvents=new N.UserEvents(n.add(t.thead),{filter:"th:not(.k-group-cell):not(.k-hierarchy-cell)",threshold:10,hold:function(n){var i=e(n.target);n.preventDefault(),i.addClass("k-column-active"),t._createResizeHandle(i.closest("div"),i),t._resizeHandleDocumentClickHandler||(t._resizeHandleDocumentClickHandler=et(t._resizeHandleDocumentClick,t)),e(document).on("click",t._resizeHandleDocumentClickHandler)}})},_resizable:function(){var t,n,i,r,a,s,l,d=this,c=d.options,u=this._isMobile,p=N.support.mobileOS?0:N.support.scrollbar();c.resizable&&(t=c.scrollable?d.wrapper.find(".k-grid-header-wrap:first"):d.wrapper,u?d._positionColumnResizeHandleTouch(t):d._positionColumnResizeHandle(t),d.resizable&&d.resizable.destroy(),d.resizable=new W.Resizable(t.add(d.lockedHeader),{handle:".k-resize-handle",hint:function(t){return e('<div class="k-grid-resize-indicator" />').css({height:t.data("th").outerHeight()+d.tbody.attr("clientHeight")})},start:function(t){var p,f,h,g;l=e(t.currentTarget).data("th"),u&&d._hideResizeHandle(),p=e.inArray(l[0],l.parent().children(":visible")),f=l.closest("table"),a=f.parent().hasClass("k-grid-header-locked"),h=a?d.lockedTable:d.table,g=d.footer||e(),d.footer&&d.lockedContent&&(g=a?d.footer.children(".k-grid-footer-locked"):d.footer.children(".k-grid-footer-wrap")),o(d.wrapper,"col-resize"),s=c.scrollable?f.find("col:eq("+p+")").add(h.children("colgroup").find("col:eq("+p+")")).add(g.find("colgroup").find("col:eq("+p+")")):h.children("colgroup").find("col:eq("+p+")"),n=t.x.location,i=l.outerWidth(),r=a?h.children("tbody").outerWidth():d.tbody.outerWidth()},resize:function(t){var o,u,f,h,g,m,v=Zt?-1:1,_=i+t.x.location*v-n*v;c.scrollable?(o=(a?d.lockedFooter.children("table"):d.footer.find(">.k-grid-footer-wrap>table"))||e(),u=l.closest("table"),f=a?d.lockedTable:d.table,h=!1,g=d.wrapper.width()-p,m=_,a&&r-i+m>g&&(m=i+(g-r-2*p),0>m&&(m=_),h=!0),m>10&&(s.css("width",m),r&&(m=h?g-2*p:r+t.x.location*v-n*v,f.add(u).add(o).css("width",m),a||(d._footerWidth=m)))):_>10&&s.css("width",_)},resizeend:function(){var e,t,n=l.outerWidth();o(d.wrapper,""),i!=n&&(t=d.lockedHeader?d.lockedHeader.find("thead:first").add(d.thead):l.parent(),e=d.columns[t.find("th:not(.k-group-cell):not(.k-hierarchy-cell)").index(l)],e.width=n,d.trigger(Dt,{column:e,oldWidth:i,newWidth:n}),d._applyLockedContainersWidth(),d._syncLockedContentHeight(),d._syncLockedHeaderHeight()),d._hideResizeHandle(),l=null}}))},_draggable:function(){var t=this;t.options.reorderable&&(t._draggableInstance&&t._draggableInstance.destroy(),t._draggableInstance=t.wrapper.kendoDraggable({group:N.guid(),filter:t.content?".k-grid-header:first "+ut:"table:first>.k-grid-header "+ut,drag:function(){t._hideResizeHandle()},hint:function(t){return e('<div class="k-header k-drag-clue" />').css({width:t.width(),paddingLeft:t.css("paddingLeft"),paddingRight:t.css("paddingRight"),lineHeight:t.height()+"px",paddingTop:t.css("paddingTop"),paddingBottom:t.css("paddingBottom")}).html(t.attr(N.attr("title"))||t.attr(N.attr("field"))||t.text()).prepend('<span class="k-icon k-drag-status k-denied" />')}}).data("kendoDraggable"))},_reorderable:function(){var t=this;t.options.reorderable&&(t.wrapper.data("kendoReorderable")&&t.wrapper.data("kendoReorderable").destroy(),t.wrapper.kendoReorderable({draggable:t._draggableInstance,dragOverContainers:function(e){return t.columns[e].lockable!==!1},inSameContainer:function(t,n){return e(t).parent()[0]===e(n).parent()[0]},change:function(e){var n=t.columns[e.oldIndex];t.trigger(Ht,{newIndex:e.newIndex,oldIndex:X(n,t.columns),column:n}),t.reorderColumn(e.newIndex,n,"before"===e.position)}}))},reorderColumn:function(n,i,r){var o,a,d,u,h=this,g=h.columns,m=X(i,g),v=g[n],_=X(i,c(g)),k=X(v,c(g)),b=k,w=k,y=e(),x=!!v.locked,C=p(g).length,T=h.footer||h.wrapper.find(".k-grid-footer");if(m!==n&&!(!i.locked&&x&&1==f(g).length||i.locked&&!x&&1==C)){for(v.hidden&&(x?(k=h.lockedTable.find("colgroup"),b=h.lockedHeader.find("colgroup"),w=e(h.lockedFooter).find(">table>colgroup")):(k=h.tbody.prev(),b=h.thead.prev(),w=T.find(".k-grid-footer-wrap").find(">table>colgroup"))),u=!!i.locked,u=u!=x,i.locked=x,h._hideResizeHandle(),r===t&&(r=m>n),g.splice(r?n:n+1,0,i),g.splice(n>m?m:m+1,1),h._templates(),s(l(h.lockedHeader,h.thead.prev(),"col:not(.k-group-col,.k-hierarchy-col)"),_,b,r),h.options.scrollable&&s(l(h.lockedTable,h.tbody.prev(),"col:not(.k-group-col,.k-hierarchy-col)"),_,k,r),s(l(h.lockedHeader,h.thead,"th.k-header:not(.k-group-cell,.k-hierarchy-cell)"),m,n,r),T&&T.length&&(s(l(h.lockedFooter,T.find(".k-grid-footer-wrap"),">table>colgroup>col:not(.k-group-col,.k-hierarchy-col)"),_,w,r),s(T.find(".k-footer-template>td:not(.k-group-cell,.k-hierarchy-cell)"),m,n,r)),o=h.tbody.children(":not(.k-grouping-row,.k-detail-row)"),h.lockedTable&&(C>n?m>=C&&S(h.lockedTable.find(">tbody>tr.k-grouping-row"),h.table.find(">tbody>tr.k-grouping-row")):C>m&&S(h.table.find(">tbody>tr.k-grouping-row"),h.lockedTable.find(">tbody>tr.k-grouping-row")),y=h.lockedTable.find(">tbody>tr:not(.k-grouping-row,.k-detail-row)")),a=0,d=o.length;d>a;a+=1)s(l(y[a],o[a],">td:not(.k-group-cell,.k-hierarchy-cell)"),m,n,r);h._updateTablesWidth(),h._applyLockedContainersWidth(),h._syncLockedContentHeight(),u&&(x?h.trigger(Et,{column:i}):h.trigger(Mt,{column:i}))}},lockColumn:function(e){var t,n=this.columns;e="number"==typeof e?n[e]:K(n,function(t){return t.field===e})[0],!e||e.locked||e.hidden||(t=p(n).length-1,this.reorderColumn(t,e,!1))},unlockColumn:function(e){var t,n=this.columns;e="number"==typeof e?n[e]:K(n,function(t){return t.field===e})[0],e&&e.locked&&!e.hidden&&(t=p(n).length,this.reorderColumn(t,e,!0))},cellIndex:function(t){var n=0;return this.lockedTable&&!e.contains(this.lockedTable[0],t[0])&&(n=p(this.columns).length),e(t).parent().children("td:not(.k-group-cell,.k-hierarchy-cell)").index(t)+n},_modelForContainer:function(t){t=e(t),t.is("tr")||"popup"===this._editMode()||(t=t.closest("tr"));var n=t.attr(N.attr("uid"));return this.dataSource.getByUid(n)},_editable:function(){var t,n=this,i=n.selectable&&n.selectable.options.multiple,r=n.options.editable,o=function(){var t=j(),i=n._editContainer;!i||e.contains(i[0],t)||i[0]===t||e(t).closest(".k-animation-container").length||n.editable.end()&&n.closeCell()};r&&(t=n._editMode(),"incell"===t?r.update!==!1&&n.wrapper.on(zt+pt,"tr:not(.k-grouping-row) > td",function(t){var r=e(this),o=n.lockedTable&&r.closest("table")[0]===n.lockedTable[0];r.hasClass("k-hierarchy-cell")||r.hasClass("k-detail-cell")||r.hasClass("k-group-cell")||r.hasClass("k-edit-cell")||r.has("a.k-grid-delete").length||r.has("button.k-grid-delete").length||r.closest("tbody")[0]!==n.tbody[0]&&!o||e(t.target).is(":input")||(n.editable?n.editable.end()&&(i&&e(j()).blur(),n.closeCell(),n.editCell(r)):n.editCell(r))}).on("focusin"+pt,function(){clearTimeout(n.timer),n.timer=null}).on("focusout"+pt,function(){n.timer=setTimeout(o,1)}):r.update!==!1&&n.wrapper.on(zt+pt,"tbody>tr:not(.k-detail-row,.k-grouping-row):visible a.k-grid-edit",function(t){t.preventDefault(),n.editRow(e(this).closest("tr"))}),r.destroy!==!1?n.wrapper.on(zt+pt,"tbody>tr:not(.k-detail-row,.k-grouping-row):visible .k-grid-delete",function(t){t.preventDefault(),t.stopPropagation(),n.removeRow(e(this).closest("tr"))}):n.wrapper.on(zt+pt,"tbody>tr:not(.k-detail-row,.k-grouping-row):visible button.k-grid-delete",function(e){e.stopPropagation(),n._confirmation()||e.preventDefault()}))},editCell:function(t){var n,i,r,o;t=e(t),n=this,i=n.columns[n.cellIndex(t)],r=n._modelForContainer(t),n.closeCell(),!r||r.editable&&!r.editable(i.field)||i.command||!i.field||(n._attachModelChange(r),n._editContainer=t,n.editable=t.addClass("k-edit-cell").kendoEditable({fields:{field:i.field,format:i.format,editor:i.editor,values:i.values},model:r,change:function(e){n.trigger(ht,{values:e.values,container:t,model:r})&&e.preventDefault()}}).data("kendoEditable"),o=t.parent().addClass("k-grid-edit-row"),n.lockedContent&&D(o[0],n._relatedRow(o).addClass("k-grid-edit-row")[0]),n.trigger(ft,{container:t,model:r}))},_adjustLockedHorizontalScrollBar:function(){var e=this.table,t=e.parent(),n=e[0].offsetWidth>t[0].clientWidth?N.support.scrollbar():0;this.lockedContent.height(t.height()-n)},_syncLockedContentHeight:function(){this.lockedTable&&(this._adjustLockedHorizontalScrollBar(),this._adjustRowsHeight(this.table,this.lockedTable))},_syncLockedHeaderHeight:function(){this.lockedHeader&&this._adjustRowsHeight(this.lockedHeader.children("table"),this.thead.parent())},_syncLockedFooterHeight:function(){this.lockedFooter&&this.footer&&this.footer.length&&this._adjustRowsHeight(this.lockedFooter.children("table"),this.footer.find(".k-grid-footer-wrap > table"))},_destroyEditable:function(){var e=this,t=function(){e.editable&&(e._detachModelChange(),e.editable.destroy(),e.editable=null,e._editContainer=null,e._destroyEditView())};e.editable&&("popup"!==e._editMode()||e._isMobile?t():e._editContainer.data("kendoWindow").bind("deactivate",t).close()),e._actionSheet&&(e._actionSheet.destroy(),e._actionSheet=null)},_destroyEditView:function(){this.editView&&(this.editView.purge(),this.editView=null,this.pane.navigate(""))},_attachModelChange:function(e){var t=this;t._modelChangeHandler=function(e){t._modelChange({field:e.field,model:this})},e.bind("change",t._modelChangeHandler)},_detachModelChange:function(){var e=this,t=e._editContainer,n=e._modelForContainer(t);n&&n.unbind(kt,e._modelChangeHandler)},closeCell:function(t){var n,i,r,o,a=this,s=a._editContainer;s&&(n=s.closest("tr").attr(N.attr("uid")),o=a.dataSource.getByUid(n),t&&a.trigger("cancel",{container:s,model:o})||(s.removeClass("k-edit-cell"),i=a.columns[a.cellIndex(s)],r=s.parent().removeClass("k-grid-edit-row"),a._destroyEditable(),a._displayCell(s,i,o),s.hasClass("k-dirty-cell")&&e('<span class="k-dirty"/>').prependTo(s),a.lockedContent&&D(r.css("height","")[0],a._relatedRow(r).css("height","")[0])))},_displayCell:function(e,t,n){var i=this,r={storage:{},count:0},o=G({},N.Template,i.options.templateSettings),a=N.template(i._cellTmpl(t,r),o);r.count>0&&(a=et(a,r.storage)),e.empty().html(a(n))},removeRow:function(e){this._confirmation(e)&&this._removeRow(e)},_removeRow:function(t){var n,i=this,r=i._editMode();"incell"!==r&&i.cancelRow(),t=e(t).hide(),n=i._modelForContainer(t),n&&!i.trigger(gt,{row:t,model:n})?(i.dataSource.remove(n),("inline"===r||"popup"===r)&&i.dataSource.sync()):"incell"===r&&i._destroyEditable()},_editMode:function(){var e="incell",t=this.options.editable;return t!==!0&&(e="string"==typeof t?t:t.mode||e),e},editRow:function(n){var i,r,o,a,s=this;n instanceof N.data.ObservableObject?i=n:(n=e(n),i=s._modelForContainer(n)),r=s._editMode(),o=s.options.navigatable,s.cancelRow(),i&&(s._attachModelChange(i),"popup"===r?s._createPopupEditor(i):"inline"===r?s._createInlineEditor(n,i):"incell"===r&&e(n).children(at).each(function(){var n=e(this),r=s.columns[n.index()];return i=s._modelForContainer(n),i&&(!i.editable||i.editable(r.field))&&r.field?(s.editCell(n),!1):t}),a=s.editView?s.editView.element:s._editContainer,a.on(zt+pt,"a.k-grid-cancel",function(t){if(t.preventDefault(),t.stopPropagation(),!s.trigger("cancel",{container:a,model:i})){var n=s.items().index(e(s.current()).parent());s.cancelRow(),o&&(s.current(s.items().eq(n).children().filter(dt).first()),E(s.table,!0))}}),a.on(zt+pt,"a.k-grid-update",function(e){e.preventDefault(),e.stopPropagation(),s.saveRow()}))},_createPopupEditor:function(n){var i,r,o,a,s,l,d,c,u,p,f,h=this,g="<div "+N.attr("uid")+'="'+n.uid+'" class="k-popup-edit-form'+(h._isMobile?" k-mobile-list":"")+'"><div class="k-edit-form-container">',m=[],v=h.options.editable,_=v.template,k=Y(v)?v.window:{},b=G({},N.Template,h.options.templateSettings);if(k=k||{},_)for(typeof _===Pt&&(_=window.unescape(_)),g+=N.template(_,b)(n),o=0,a=h.columns.length;a>o;o++)i=h.columns[o],i.command&&(c=H(i.command,"edit"),c&&(r=c));else for(o=0,a=h.columns.length;a>o;o++)i=h.columns[o],i.command?i.command&&(c=H(i.command,"edit"),c&&(r=c)):(g+='<div class="k-edit-label"><label for="'+i.field+'">'+(i.title||i.field||"")+"</label></div>",n.editable&&!n.editable(i.field)||!i.field?(p={storage:{},count:0},s=N.template(h._cellTmpl(i,p),b),p.count>0&&(s=et(s,p.storage)),g+='<div class="k-edit-field">'+s(n)+"</div>"):(m.push({field:i.field,format:i.format,editor:i.editor,values:i.values}),g+="<div "+N.attr("container-for")+'="'+i.field+'" class="k-edit-field"></div>'));r&&Y(r)&&(r.text&&Y(r.text)&&(l=r.text.update,d=r.text.cancel),r.attr&&(u=r.attr)),h._isMobile?(g+="</div></div>",h.editView=h.pane.append("<div data-"+N.ns+'role="view" data-'+N.ns+'init-widgets="false" class="k-grid-edit-form"><div data-'+N.ns+'role="header" class="k-header">'+h._createButton({name:"update",text:l,attr:u})+(k.title||"Edit")+h._createButton({name:"canceledit",text:d,attr:u})+"</div>"+g+"</div>"),f=h._editContainer=h.editView.element.find(".k-popup-edit-form")):(g+='<div class="k-edit-buttons k-state-default">',g+=h._createButton({name:"update",text:l,attr:u})+h._createButton({name:"canceledit",text:d,attr:u}),g+="</div></div></div>",f=h._editContainer=e(g).appendTo(h.wrapper).eq(0).kendoWindow(G({modal:!0,resizable:!1,draggable:!0,title:"Edit",visible:!1,close:function(i){if(i.userTriggered){if(i.sender.element.focus(),h.trigger("cancel",{container:f,model:n}))return i.preventDefault(),t;var r=h.items().index(e(h.current()).parent());h.cancelRow(),h.options.navigatable&&(h.current(h.items().eq(r).children().filter(dt).first()),E(h.table,!0))}}},k))),h.editable=h._editContainer.kendoEditable({fields:m,model:n,clearContainer:!1}).data("kendoEditable"),h._isMobile&&f.find("input[type=checkbox],input[type=radio]").parent(".k-edit-field").addClass("k-check").prev(".k-edit-label").addClass("k-check").click(function(){e(this).next().children("input").click()}),h._openPopUpEditor(),h.trigger(ft,{container:f,model:n})},_openPopUpEditor:function(){this._isMobile?this.pane.navigate(this.editView,this._editAnimation):this._editContainer.data("kendoWindow").center().open()},_createInlineEditor:function(t,n){var i,r,o,a=this,s=[];a.lockedContent&&(t=t.add(a._relatedRow(t))),t.children(":not(.k-group-cell,.k-hierarchy-cell)").each(function(){if(r=e(this),i=a.columns[a.cellIndex(r)],i.command||!i.field||n.editable&&!n.editable(i.field)){if(i.command&&(o=H(i.command,"edit"))){r.empty();var t,l,d;Y(o)&&(o.text&&Y(o.text)&&(t=o.text.update,l=o.text.cancel),o.attr&&(d=o.attr)),e(a._createButton({name:"update",text:t,attr:d})+a._createButton({name:"canceledit",text:l,attr:d})).appendTo(r)}}else s.push({field:i.field,format:i.format,editor:i.editor,values:i.values}),r.attr(N.attr("container-for"),i.field),r.empty()}),a._editContainer=t,a.editable=new N.ui.Editable(t.addClass("k-grid-edit-row"),{fields:s,model:n,clearContainer:!1}),t.length>1&&(D(t[0],t[1]),a._applyLockedContainersWidth()),a.trigger(ft,{container:t,model:n})},cancelRow:function(){var e,t=this,n=t._editContainer;n&&(e=t._modelForContainer(n),t._destroyEditable(),t.dataSource.cancelChanges(e),"popup"!==t._editMode()?t._displayRow(n):t._displayRow(t.items().filter("["+N.attr("uid")+"="+e.uid+"]")))},saveRow:function(){var e=this,t=e._editContainer,n=e._modelForContainer(t),i=e.editable;t&&i&&i.end()&&!e.trigger(ht,{container:t,model:n})&&e.dataSource.sync()},_displayRow:function(t){var n,i,r,o=this,a=o._modelForContainer(t),s=t.hasClass("k-alt");a&&(o.lockedContent&&(n=e((s?o.lockedAltRowTemplate:o.lockedRowTemplate)(a)),o._relatedRow(t.last()).replaceWith(n)),i=e((s?o.altRowTemplate:o.rowTemplate)(a)),t.replaceWith(i),n&&D(i[0],n[0]),r=i.next(),r.hasClass("k-detail-row")&&r.is(":visible")&&i.find(".k-hierarchy-cell .k-icon").removeClass("k-plus").addClass("k-minus"))},_showMessage:function(t,n){var i,r,o,a=this;
return a._isMobile?(i=N.template('<ul><li class="km-actionsheet-title">#:title#</li><li><a href="\\#" class="k-button k-grid-delete">#:confirmDelete#</a></li></ul>'),r=e(i(t)).appendTo(a.view.element),o=a._actionSheet=new N.mobile.ui.ActionSheet(r,{cancel:t.cancelDelete,cancelTemplate:'<li class="km-actionsheet-cancel"><a class="k-button" href="\\#">#:cancel#</a></li>',close:function(){this.destroy()},command:function(t){var i=e(t.currentTarget).parent();i.hasClass("km-actionsheet-cancel")||a._removeRow(n)},popup:a._actionSheetPopupOptions}),o.open(n),!1):window.confirm(t.title)},_confirmation:function(e){var t=this,n=t.options.editable,i=n===!0||typeof n===Pt?Rt:n.confirmation;return i!==!1&&null!=i?(typeof i===Ot&&(i=i(t._modelForContainer(e))),t._showMessage({confirmDelete:n.confirmDelete||Lt,cancelDelete:n.cancelDelete||Nt,title:i===!0?Rt:i},e)):!0},cancelChanges:function(){this.dataSource.cancelChanges()},saveChanges:function(){var e=this;(e.editable&&e.editable.end()||!e.editable)&&!e.trigger(yt)&&e.dataSource.sync()},addRow:function(){var e,t,n,i,r,o,a=this,s=a.dataSource,l=a._editMode(),d=a.options.editable.createAt||"",c=s.pageSize(),u=s.view()||[];(a.editable&&a.editable.end()||!a.editable)&&("incell"!=l&&a.cancelRow(),e=s.indexOf(u[0]),"bottom"==d.toLowerCase()&&(e+=u.length,c&&!s.options.serverPaging&&u.length>=c&&(e-=1)),0>e&&(e=s.page()>s.totalPages()?(s.page()-1)*c:0),t=s.insert(e,{}),n=t.uid,i=a.lockedContent?a.lockedTable:a.table,r=i.find("tr["+N.attr("uid")+"="+n+"]"),o=r.children("td:not(.k-group-cell,.k-hierarchy-cell)").eq(a._firstEditableColumnIndex(r)),"inline"===l&&r.length?a.editRow(r):"popup"===l?a.editRow(t):o.length&&a.editCell(o),"bottom"==d.toLowerCase()&&a.lockedContent&&(a.lockedContent[0].scrollTop=a.content[0].scrollTop=a.content[0].offsetHeight))},_firstEditableColumnIndex:function(e){var t,n,i,r=this,o=r.columns,a=r._modelForContainer(e);for(n=0,i=o.length;i>n;n++)if(t=o[n],a&&(!a.editable||a.editable(t.field))&&!t.command&&t.field)return n;return-1},_toolbar:function(){var t,n=this,i=n.wrapper,r=n.options.toolbar,o=n.options.editable;r&&(t=n.wrapper.find(".k-grid-toolbar"),t.length||(tt(r)||(r=typeof r===Pt?r:n._toolbarTmpl(r).replace(Bt,"\\#"),r=et(N.template(r),n)),t=e('<div class="k-toolbar k-grid-toolbar" />').html(r({})).prependTo(i)),o&&o.create!==!1&&t.on(zt+pt,".k-grid-add",function(e){e.preventDefault(),n.addRow()}).on(zt+pt,".k-grid-cancel-changes",function(e){e.preventDefault(),n.cancelChanges()}).on(zt+pt,".k-grid-save-changes",function(e){e.preventDefault(),n.saveChanges()}))},_toolbarTmpl:function(e){var t,n,i=this,r="";if(J(e))for(t=0,n=e.length;n>t;t++)r+=i._createButton(e[t]);return r},_createButton:function(e){var t=e.template||jt,n=typeof e===Pt?e:e.name||e.text,r=on[n]?on[n].className:"k-grid-"+(n||"").replace(/\s/g,""),o={className:r,text:n,imageClass:"",attr:"",iconClass:""};if(!(n||Y(e)&&e.template))throw Error("Custom commands should have name specified");return Y(e)?(e.className&&(e.className+=" "+o.className),"edit"===n&&Y(e.text)&&(e=G(!0,{},e),e.text=e.text.edit),e.attr&&Y(e.attr)&&(e.attr=i(e.attr)),o=G(!0,o,on[n],e)):o=G(!0,o,on[n]),N.template(t)(o)},_hasFooters:function(){return!!this.footerTemplate||!!this.groupFooterTemplate||this.footer&&this.footer.length>0||this.wrapper.find(".k-grid-footer").length>0},_groupable:function(){var t=this;t._groupableClickHandler?t.table.add(t.lockedTable).off(zt+pt,t._groupableClickHandler):t._groupableClickHandler=function(n){var i=e(this),r=i.closest("tr");i.hasClass("k-i-collapse")?t.collapseGroup(r):t.expandGroup(r),n.preventDefault(),n.stopPropagation()},t._isLocked()?t.lockedTable.on(zt+pt,".k-grouping-row .k-i-collapse, .k-grouping-row .k-i-expand",t._groupableClickHandler):t.table.on(zt+pt,".k-grouping-row .k-i-collapse, .k-grouping-row .k-i-expand",t._groupableClickHandler),t._attachGroupable()},_attachGroupable:function(){var t=this,n=t.wrapper,i=t.options.groupable,r=ut+":visible["+N.attr("field")+"]",o=ut+"["+N.attr("field")+"]";i&&(n.has("div.k-grouping-header")[0]||e("<div>&nbsp;</div>").addClass("k-grouping-header").prependTo(n),t.groupable&&t.groupable.destroy(),t.groupable=new q(n,G({},i,{draggable:t._draggableInstance,groupContainer:">div.k-grouping-header",dataSource:t.dataSource,draggableElements:t.content?".k-grid-header:first "+r:"table:first>.k-grid-header "+r,filter:t.content?".k-grid-header:first "+o:"table:first>.k-grid-header "+o,allowDrag:t.options.reorderable})))},_continuousItems:function(t,n){var i,r,o,a,s,l,d,c;if(this.lockedContent){for(i=this,r=i.table.add(i.lockedTable),o=e(t,r[0]),a=e(t,r[1]),s=n?p(i.columns).length:1,l=n?i.columns.length-s:1,d=[],c=0;o.length>c;c+=s)Z.apply(d,o.slice(c,c+s)),Z.apply(d,a.splice(0,l));return d}},_selectable:function(){var n,i,r,o,a=this,s=[],l=a._isLocked(),d=a.options.selectable;d&&(a.selectable&&a.selectable.destroy(),n=typeof d===Pt&&d.toLowerCase().indexOf("multiple")>-1,i=typeof d===Pt&&d.toLowerCase().indexOf("cell")>-1,a._hasDetails()&&(s[s.length]=".k-detail-row"),(a.options.groupable||a._hasFooters())&&(s[s.length]=".k-grouping-row,.k-group-footer"),s=s.join(","),""!==s&&(s=":not("+s+")"),r=a.table,l&&(r=r.add(a.lockedTable)),o=">"+(i?st:"tbody>tr"+s),a.selectable=new N.ui.Selectable(r,{filter:o,aria:!0,multiple:n,change:function(){a.trigger(kt)},useAllItems:l&&n&&i,relatedTarget:function(t){var n,r,o,s;if(!i&&l){for(r=e(),o=0,s=t.length;s>o;o++)n=a._relatedRow(t[o]),X(n[0],t)<0&&(r=r.add(n));return r}},continuousItems:function(){return a._continuousItems(o,i)}}),a.options.navigatable&&r.on("keydown"+pt,function(o){var s=a.current(),d=o.target;if(o.keyCode===$.SPACEBAR&&e.inArray(d,r)>-1&&!s.is(".k-edit-cell,.k-header")&&s.parent().is(":not(.k-grouping-row,.k-detail-row,.k-group-footer)")){if(o.preventDefault(),o.stopPropagation(),s=i?s:s.parent(),l&&!i&&(s=s.add(a._relatedRow(s))),n)if(o.ctrlKey){if(s.hasClass(Ft))return s.removeClass(Ft),a.trigger(kt),t}else a.selectable.clear();else a.selectable.clear();a.selectable.value(s)}}))},_relatedRow:function(t){var n,i,r=this.lockedTable;return t=e(t),r?(n=t.closest(this.table.add(this.lockedTable)),i=n.find(">tbody>tr").index(t),n=n[0]===this.table[0]?r:this.table,n.find(">tbody>tr").eq(i)):t},clearSelection:function(){var e=this;e.selectable.clear(),e.trigger(kt)},select:function(n){var i=this,r=i.selectable;return n=e(n),n.length?(r.options.multiple||(r.clear(),n=n.first()),i._isLocked()&&(n=n.add(n.map(function(){return i._relatedRow(this)}))),r.value(n),t):r.value()},current:function(e){var n,i=this,r=i.options.scrollable,o=i._current,a=i.table.add(i.thead.parent());return e!==t&&e.length&&(o&&o[0]===e[0]||(o&&(o.removeClass(St).removeAttr("id"),a.removeAttr("aria-activedescendant")),e.attr("id",i._cellId),i._current=e.addClass(St),a.attr("aria-activedescendant",i._cellId),e.length&&r&&(n=e.closest("table").parent(),n.is(".k-grid-content")?i._scrollTo(e.parent()[0],i.content[0]):n.is(".k-grid-content-locked")&&(i._scrollTo(i._relatedRow(e.parent())[0],i.content[0]),i.lockedContent[0].scrollTop=i.content[0].scrollTop),n.is(".k-grid-content-locked,.k-grid-header-locked")||(r.virtual?i._scrollTo(e[0],i.content.find(">.k-virtual-scrollable-wrap")[0]):i._scrollTo(e[0],i.content[0]))))),i._current},_removeCurrent:function(){this._current&&(this._current.removeClass(St),this._current=null)},_scrollTo:function(e,t){var n=e.tagName.toLowerCase(),i="td"===n||"th"===n,r=e[i?"offsetLeft":"offsetTop"],o=e[i?"offsetWidth":"offsetHeight"],a=t[i?"scrollLeft":"scrollTop"],s=t[i?"clientWidth":"clientHeight"],l=r+o,d=0;d=a>r?r:l>a+s?s>=o?l-s:r:a,t[i?"scrollLeft":"scrollTop"]=d},_navigatable:function(){var t=this,n=et(t.current,t),i=t.table.add(t.lockedTable),r=t.thead.parent().add(e(">table",t.lockedHeader)),o=(t._isLocked(),i),a=N.support.isRtl(t.element);t.options.navigatable&&(t.options.scrollable&&(o=i.add(r),r.attr(It,-1)),o.off("mousedown"+pt+" focus"+pt+" focusout"+pt+" keydown"+pt),r.on("keydown"+pt,function(e){e.altKey&&e.keyCode==$.DOWN&&(n().find(".k-grid-filter, .k-header-column-menu").click(),e.stopImmediatePropagation())}).find("a.k-link").attr("tabIndex",-1),i.attr(It,it.max(i.attr(It)||0,0)).on("mousedown"+pt+" keydown"+pt,".k-detail-cell",function(e){e.target!==e.currentTarget&&e.stopImmediatePropagation()}),o.on(N.support.touch?"touchstart"+pt:"mousedown"+pt,lt+">"+dt,et(M,t)).on("focus"+pt,function(){if(!N.support.touch){var t=n();t&&t.is(":visible")?t.addClass(St):n(e(this).find(ct)),i.attr(It,-1),r.attr(It,-1),e(this).attr(It,0)}}).on("focusout"+pt,function(){var e=n();e&&e.removeClass(St)}).on("keydown"+pt,function(o){var s,l,d,c,u,p=o.keyCode,f=!1,h=!o.isDefaultPrevented()&&!e(o.target).is(":button,a,:input,a>.k-icon"),g=t.options.pageable,m=t.dataSource,v="incell"==t._editMode(),_=o.shiftKey,k=et(t._relatedRow,t),b=n();b&&b.is("th")&&(h=!0),h&&p==$.UP?(n(A(b,o.currentTarget,i,r,!0)),f=!0):h&&p==$.DOWN?(n(A(b,o.currentTarget,i,r)),f=!0):h&&p==(a?$.RIGHT:$.LEFT)?(n(I(b,o.currentTarget,i,r,k)),f=!0):h&&p==(a?$.LEFT:$.RIGHT)?(n(O(b,o.currentTarget,i,r,k)),f=!0):h&&g&&$.PAGEDOWN==p?(m.page(m.page()+1),f=!0):h&&g&&$.PAGEUP==p?(m.page(m.page()-1),f=!0):p==$.ENTER||$.F2==p?(b=b?b:i.find(ct),e(o.target).is("table")||e.contains(b[0],o.target)||(b=e(o.target).closest("[role=gridcell]")),b.is("th")?(b.find(".k-link").click(),f=!0):b.parent().is(".k-master-row,.k-grouping-row")?(b.parent().find(".k-icon:first").click(),f=!0):(d=b.find(":kendoFocusable:first"),!b.hasClass("k-edit-cell")&&d[0]&&b.hasClass("k-state-focused")?(d.focus(),f=!0):t.options.editable&&!e(o.target).is(":button,.k-button,textarea")&&(c=e(o.target).closest("[role=gridcell]"),c[0]||(c=b),t._handleEditing(c,!1,v?o.currentTarget:i[0]),f=!0))):$.ESC==p?(s=j(),b&&e.contains(b[0],s)&&!b.hasClass("k-edit-cell")&&!b.parent().hasClass("k-grid-edit-row")?(E(o.currentTarget,!0),f=!0):!t._editContainer||b&&!t._editContainer.has(b[0])&&b[0]!==t._editContainer[0]||(v?t.closeCell(!0):(l=e(b).parent().index(),s&&s.blur(),t.cancelRow(),l>=0&&t.current(i.find(">tbody>tr").eq(l).children().filter(dt).first())),en.msie&&9>en.version&&document.body.focus(),E(v?o.currentTarget:i[0],!0),f=!0)):$.TAB==p&&(b=e(b),t.options.editable&&v&&(u=e(j()).closest(".k-edit-cell"),u[0]&&u[0]!==b[0]&&(b=u)),u=P(b,o.currentTarget,i,k,_),!b.is("th")&&u.length&&t.options.editable&&v&&(t._handleEditing(b,u,u.closest(i)),f=!0)),f&&(o.preventDefault(),o.stopPropagation())}))},_handleEditing:function(n,i,r){var o,a,s=this,l=e(j()),d=s._editMode(),c=en.msie,u=c&&9>en.version,p=s._editContainer;if(r=e(r),a="incell"==d?n.hasClass("k-edit-cell"):n.parent().hasClass("k-grid-edit-row"),s.editable){if(e.contains(p[0],l[0])&&(en.opera||u?l.change().triggerHandler("blur"):(l.blur(),c&&l.blur())),!s.editable)return E(r),t;if(!s.editable.end())return"incell"==d?s.current(p):s.current(p.children().filter(at).first()),o=p.find(":kendoFocusable:first")[0],o&&o.focus(),t;"incell"==d?s.closeCell():(s.saveRow(),a=!0)}i&&s.current(i),u&&document.body.focus(),E(r,!0),(!a&&!i||i)&&("incell"==d?s.editCell(s.current()):s.editRow(s.current().parent()))},_wrapper:function(){var e=this,t=e.table,n=e.options.height,i=e.element;i.is("div")||(i=i.wrap("<div/>").parent()),e.wrapper=i.addClass("k-grid k-widget"),n&&(e.wrapper.css(At,n),t.css(At,"auto")),e._initMobile()},_initMobile:function(){var t,n=this.options,i=this;this._isMobile=n.mobile===!0&&N.support.mobileOS||"phone"===n.mobile||"tablet"===n.mobile,this._isMobile&&(t=this.wrapper.addClass("k-grid-mobile").wrap("<div data-"+N.ns+'role="view" data-'+N.ns+'init-widgets="false"></div>').parent(),this.pane=N.mobile.ui.Pane.wrap(t),this.view=this.pane.view(),this._actionSheetPopupOptions=e(document.documentElement).hasClass("km-root")?{modal:!1}:{align:"bottom center",position:"bottom center",effect:"slideIn:up"},n.height&&this.pane.element.parent().css(At,n.height),this._editAnimation="slide",this.view.bind("show",function(){i._isLocked()&&(i._updateTablesWidth(),i._applyLockedContainersWidth(),i._syncLockedContentHeight(),i._syncLockedHeaderHeight(),i._syncLockedFooterHeight())}))},_tbody:function(){var t,n=this,i=n.table;t=i.find(">tbody"),t.length||(t=e("<tbody/>").appendTo(i)),n.tbody=t.attr("role","rowgroup")},_scrollable:function(){var t,n,i,r,o=this,a=o.options,s=a.scrollable,l=s!==!0&&s.virtual&&!o.virtualScrollable,d=!N.support.kineticScrollNeeded||l?N.support.scrollbar():0;s&&(t=o.wrapper.children(".k-grid-header"),t[0]||(t=e('<div class="k-grid-header" />').insertBefore(o.table)),t.css(Zt?"padding-left":"padding-right",s.virtual?d+1:d),n=e('<table role="grid" />'),tn&&n.attr("cellspacing",0),n.append(o.thead),t.empty().append(e('<div class="k-grid-header-wrap" />').append(n)),o.content=o.table.parent(),o.content.is(".k-virtual-scrollable-wrap, .km-scroll-container")&&(o.content=o.content.parent()),o.content.is(".k-grid-content, .k-virtual-scrollable-wrap")||(o.content=o.table.wrap('<div class="k-grid-content" />').parent()),l&&(o.virtualScrollable=new rn(o.content,{dataSource:o.dataSource,itemHeight:function(){return o._averageRowHeight()}})),o.scrollables=t.children(".k-grid-header-wrap"),i=o.wrapper.find(".k-grid-footer"),i.length&&(o.scrollables=o.scrollables.add(i.children(".k-grid-footer-wrap"))),s.virtual?o.content.find(">.k-virtual-scrollable-wrap").bind("scroll"+pt,function(){o.scrollables.scrollLeft(this.scrollLeft),o.lockedContent&&(o.lockedContent[0].scrollTop=this.scrollTop)}):(o.content.bind("scroll"+pt,function(){o.scrollables.scrollLeft(this.scrollLeft),o.lockedContent&&(o.lockedContent[0].scrollTop=this.scrollTop)}),r=N.touchScroller(o.content),r&&r.movable&&(o.touchScroller=r,r.movable.bind("change",function(e){o.scrollables.scrollLeft(-e.sender.x),o.lockedContent&&o.lockedContent.scrollTop(-e.sender.y)}),o.one(xt,function(e){e.sender.wrapper.addClass("k-grid-backface")}))))},_setContentWidth:function(){var t,n=this,i="k-grid-content-expander",r='<div class="'+i+'"></div>',o=n.resizable;n.options.scrollable&&n.wrapper.is(":visible")&&(t=n.table.parent().children("."+i),n._setContentWidthHandler=et(n._setContentWidth,n),n.dataSource&&n.dataSource.view().length?t[0]&&(t.remove(),o&&o.unbind("resize",n._setContentWidthHandler)):(t[0]||(t=e(r).appendTo(n.table.parent()),o&&o.bind("resize",n._setContentWidthHandler)),n.thead&&t.width(n.thead.width())),n._applyLockedContainersWidth())},_applyLockedContainersWidth:function(){if(this.options.scrollable&&this.lockedHeader){var e,t=this.thead.parent(),n=t.parent(),i=this.wrapper[0].clientWidth,r=this._groups(),o=N.support.scrollbar(),a=this.lockedHeader.find(">table>colgroup>col:not(.k-group-col, .k-hierarchy-col)"),s=t.find(">colgroup>col:not(.k-group-col, .k-hierarchy-col)"),l=u(a),d=u(s);r>0&&(l+=this.lockedHeader.find(".k-group-cell:first").outerWidth()*r),l>=i&&(l=i-3*o),this.lockedHeader.add(this.lockedContent).width(l),n[0].style.width=n.parent().width()-l-2+"px",t.add(this.table).width(d),this.virtualScrollable&&(i-=o),this.content[0].style.width=i-l-2+"px",this.lockedFooter&&this.lockedFooter.length&&(this.lockedFooter.width(l),e=this.footer.find(".k-grid-footer-wrap"),e[0].style.width=n[0].clientWidth+"px",e.children().first().width(d))}},_setContentHeight:function(){var e,t=this,n=t.options,i=t.wrapper.innerHeight(),r=t.wrapper.children(".k-grid-header"),o=N.support.scrollbar();n.scrollable&&t.wrapper.is(":visible")&&(i-=r.outerHeight(),t.pager&&(i-=t.pager.element.outerHeight()),n.groupable&&(i-=t.wrapper.children(".k-grouping-header").outerHeight()),n.toolbar&&(i-=t.wrapper.children(".k-grid-toolbar").outerHeight()),t.footerTemplate&&(i-=t.wrapper.children(".k-grid-footer").outerHeight()),e=function(e){var t,n;return e[0].style.height?!0:(t=e.height(),e.height("auto"),n=e.height(),t!=n?(e.height(""),!0):(e.height(""),!1))},e(t.wrapper)&&(i>2*o?(t.lockedContent&&(o=t.table[0].offsetWidth>t.table.parent()[0].clientWidth?o:0,t.lockedContent.height(i-o)),t.content.height(i)):t.content.height(2*o+1)))},_averageRowHeight:function(){var e,t=this,n=t.items().length,i=t._rowHeight;return 0===n?i:(t._rowHeight||(t._rowHeight=i=t.table.outerHeight()/n,t._sum=i,t._measures=1),e=t.table.outerHeight()/n,i!==e&&(t._measures++,t._sum+=e,t._rowHeight=t._sum/t._measures),i)},_dataSource:function(){var e,n=this,i=n.options,r=i.dataSource;r=J(r)?{data:r}:r,Y(r)&&(G(r,{table:n.table,fields:n.columns}),e=i.pageable,Y(e)&&e.pageSize!==t&&(r.pageSize=e.pageSize)),n.dataSource&&n._refreshHandler?n.dataSource.unbind(kt,n._refreshHandler).unbind(rt,n._progressHandler).unbind(ot,n._errorHandler):(n._refreshHandler=et(n.refresh,n),n._progressHandler=et(n._requestStart,n),n._errorHandler=et(n._error,n)),n.dataSource=B.create(r).bind(kt,n._refreshHandler).bind(rt,n._progressHandler).bind(ot,n._errorHandler)},_error:function(){this._progress(!1)},_requestStart:function(){this._progress(!0)},_modelChange:function(t){var n,i,r,o,a,s=this,l=t.model,d=s.tbody.find("tr["+N.attr("uid")+"="+l.uid+"]"),c=d.hasClass("k-alt"),u=s.items().index(d),p=s.lockedContent;if(p&&(n=s._relatedRow(d)),d.add(n).children(".k-edit-cell").length&&!s.options.rowTemplate)d.add(n).children(":not(.k-group-cell,.k-hierarchy-cell)").each(function(){i=e(this),r=s.columns[s.cellIndex(i)],r.field===t.field&&(i.hasClass("k-edit-cell")?i.addClass("k-dirty-cell"):(s._displayCell(i,r,l),e('<span class="k-dirty"/>').prependTo(i)))});else if(!d.hasClass("k-grid-edit-row")){for(p&&(o=(c?s.lockedAltRowTemplate:s.lockedRowTemplate)(l),n.replaceWith(o)),o=(c?s.altRowTemplate:s.rowTemplate)(l),d.replaceWith(o),o=s.items().eq(u),p&&(n=s._relatedRow(o)[0],D(o[0],n),o=o.add(n)),u=0,a=s.columns.length;a>u;u++)r=s.columns[u],r.field===t.field&&(i=o.children(":not(.k-group-cell,.k-hierarchy-cell)").eq(u),e('<span class="k-dirty"/>').prependTo(i));s.trigger("itemChange",{item:o,data:l,ns:W})}},_pageable:function(){var t,n=this,i=n.options.pageable;i&&(t=n.wrapper.children("div.k-grid-pager"),t.length||(t=e('<div class="k-pager-wrap k-grid-pager"/>').appendTo(n.wrapper)),n.pager&&n.pager.destroy(),n.pager="object"==typeof i&&i instanceof N.ui.Pager?i:new N.ui.Pager(t,G({},i,{dataSource:n.dataSource})))},_footer:function(){var t,n,i,r,o=this,s=o.dataSource.aggregates(),l="",d=o.footerTemplate,c=o.options,u=o.footer||o.wrapper.find(".k-grid-footer");d?(s=nt(s)?a(o.dataSource.aggregate()):s,l=e(o._wrapFooter(d(s))),u.length?(n=l,u.replaceWith(n),u=o.footer=n):u=o.footer=c.scrollable?c.pageable?l.insertBefore(o.wrapper.children("div.k-grid-pager")):l.appendTo(o.wrapper):l.insertBefore(o.tbody)):u&&!o.footer&&(o.footer=u),u.length&&(c.scrollable&&(t=u.attr("tabindex",-1).children(".k-grid-footer-wrap"),o.scrollables=o.scrollables.filter(function(){return!e(this).is(".k-grid-footer-wrap")}).add(t)),o._footerWidth&&u.find("table").css("width",o._footerWidth),t&&(i=o.content.scrollLeft(),r=c.scrollable!==!0&&c.scrollable.virtual&&!o.virtualScrollable,r&&(i=o.wrapper.find(".k-virtual-scrollable-wrap").scrollLeft()),t.scrollLeft(i))),o.lockedContent&&(o._appendLockedColumnFooter(),o._applyLockedContainersWidth(),o._syncLockedFooterHeight())},_wrapFooter:function(t){var n=this,i="",r=N.support.mobileOS?0:N.support.scrollbar();return n.options.scrollable?(i=e('<div class="k-grid-footer"><div class="k-grid-footer-wrap"><table'+(tn?' cellspacing="0"':"")+"><tbody>"+t+"</tbody></table></div></div>"),n._appendCols(i.find("table")),i.css(Zt?"padding-left":"padding-right",r),i):'<tfoot class="k-grid-footer">'+t+"</tfoot>"},_columnMenu:function(){var e,t,n,i,r,o,a,s,l,d=this,c=d.columns,u=d.options,f=u.columnMenu,h=this._isMobile,g=function(e){d.trigger(_t,{field:e.field,container:e.container})},m=function(e){E(e.closest("table"),!0)};if(f)for("boolean"==typeof f&&(f={}),o=d.thead.find("th:not(.k-hierarchy-cell):not(.k-group-cell)"),a=0,s=o.length;s>a;a++)t=c[a],l=o.eq(a),t.command||!t.field&&!l.attr("data-"+N.ns+"field")||(e=l.data("kendoColumnMenu"),e&&e.destroy(),i=t.sortable!==!1&&f.sortable!==!1?u.sortable:!1,r=u.filterable&&t.filterable!==!1&&f.filterable!==!1?G({pane:d.pane},t.filterable,u.filterable):!1,n={dataSource:d.dataSource,values:t.values,columns:f.columns,sortable:i,filterable:r,messages:f.messages,owner:d,closeCallback:m,init:g,pane:d.pane,filter:h?":not(.k-column-active)":"",lockedColumns:t.lockable!==!1&&p(c).length>0},l.kendoColumnMenu(n))},_headerCells:function(){return this.thead.find("th").filter(function(){var t=e(this);return!t.hasClass("k-group-cell")&&!t.hasClass("k-hierarchy-cell")})},_filterable:function(){var e,t,n,i,r,o,a,s=this,l=s.columns,d=function(e){s.trigger(vt,{field:e.field,container:e.container})},c=function(e){E(e.closest("table"),!0)},u=s.options.filterable;if(u&&!s.options.columnMenu)for(t=s._headerCells(),i=0,r=t.length;r>i;i++)n=t.eq(i),l[i].filterable===!1||l[i].command||!l[i].field&&!n.attr("data-"+N.ns+"field")||(e=n.data("kendoFilterMenu"),e&&e.destroy(),o=l[i].filterable,a=G({},u,o,{dataSource:s.dataSource,values:l[i].values,closeCallback:c,init:d,pane:s.pane}),o&&o.messages&&(a.messages=G(!0,{},u.messages,o.messages)),n.kendoFilterMenu(a))},_sortable:function(){var e,t,n,i,r,o,a=this,s=a.columns,l=a.options.sortable;if(l){for(i=a._headerCells(),r=0,o=i.length;o>r;r++)e=s[r],e.sortable!==!1&&!e.command&&e.field&&(n=i.eq(r),t=n.data("kendoSorter"),t&&t.destroy(),n.attr("data-"+N.ns+"field",e.field).kendoSorter(G({},l,e.sortable,{dataSource:a.dataSource,aria:!0,filter:":not(.k-column-active)"})));i=null}},_columns:function(t){var n,i,r,o=this,a=o.table,s=a.find("col"),l=o.options.dataSource;if(t=t.length?t:Q(a.find("th"),function(t,n){t=e(t);var i=t.attr(N.attr("sortable")),r=t.attr(N.attr("filterable")),o=t.attr(N.attr("type")),a=t.attr(N.attr("groupable")),l=t.attr(N.attr("field")),d=t.attr(N.attr("menu"));return l||(l=t.text().replace(/\s|[^A-z0-9]/g,"")),{field:l,type:o,sortable:"false"!==i,filterable:"false"!==r,groupable:"false"!==a,menu:d,template:t.attr(N.attr("template")),width:s.eq(n).css("width")}}),n=!(o.table.find("tbody tr").length>0&&(!l||!l.transport)),o.options.scrollable){if(r=t,i=p(t),t=f(t),i.length>0&&0===t.length)throw Error("There should be at least one non locked columns");b(o.element.find("tr:has(th):first").find("th:not(.k-group-cell)"),r),t=i.concat(t)}o.columns=Q(t,function(e){return e=typeof e===Pt?{field:e}:e,e.hidden&&(e.attributes=v(e.attributes),e.footerAttributes=v(e.footerAttributes),e.headerAttributes=v(e.headerAttributes)),G({encoded:n},e)})},_groups:function(){var e=this.dataSource.group();return e?e.length:0},_tmpl:function(e,t,r,o){var a,s,l,d,c=this,u=G({},N.Template,c.options.templateSettings),p=t.length,f={storage:{},count:0},h=c._hasDetails(),g=[],m=c._groups();if(!e){for(e="<tr",r&&g.push("k-alt"),h&&g.push("k-master-row"),g.length&&(e+=' class="'+g.join(" ")+'"'),p&&(e+=" "+N.attr("uid")+'="#='+N.expr("uid",u.paramName)+'#"'),e+=" role='row'>",m>0&&!o&&(e+=n(m)),h&&(e+='<td class="k-hierarchy-cell"><a class="k-icon k-plus" href="\\#" tabindex="-1"></a></td>'),a=0;p>a;a++)l=t[a],s=l.template,d=typeof s,e+="<td"+i(l.attributes)+" role='gridcell'>",e+=c._cellTmpl(l,f),e+="</td>";e+="</tr>"}return e=N.template(e,u),f.count>0?et(e,f.storage):e},_headerCellText:function(e){var t=this,n=G({},N.Template,t.options.templateSettings),i=e.headerTemplate,r=typeof i,o=e.title||e.field||"";return r===Ot?o=N.template(i,n)({}):r===Pt&&(o=i),o},_cellTmpl:function(e,t){var n,i,r=this,o=G({},N.Template,r.options.templateSettings),a=e.template,s=o.paramName,l=e.field,d="",c=e.format,u=typeof a,p=e.values;if(e.command){if(J(e.command)){for(n=0,i=e.command.length;i>n;n++)d+=r._createButton(e.command[n]);return d.replace(Bt,"\\#")}return r._createButton(e.command).replace(Bt,"\\#")}return u===Ot?(t.storage["tmpl"+t.count]=a,d+="#=this.tmpl"+t.count+"("+s+")#",t.count++):u===Pt?d+=a:p&&p.length&&Y(p[0])&&"value"in p[0]&&l?(d+="#var v ="+N.stringify(w(p)).replace(Bt,"\\#")+"#",d+="#var f = v[",o.useWithBlock||(d+=s+"."),d+=l+"]#",d+="${f != null ? f : ''}"):(d+=e.encoded?"#:":"#=",c&&(d+='kendo.format("'+c.replace(Wt,"\\$1")+'",'),l?(l=N.expr(l,s),d+=l+"==null?'':"+l):d+="''",c&&(d+=")"),d+="#"),d},_templates:function(){var t=this,n=t.options,i=t.dataSource,r=i.group(),o=t.footer||t.wrapper.find(".k-grid-footer"),a=i.aggregate(),s=p(t.columns),l=n.scrollable?f(t.columns):t.columns;if(n.scrollable&&s.length){if(n.rowTemplate||n.altRowTemplate)throw Error("Having both row template and locked columns is not supported");t.rowTemplate=t._tmpl(n.rowTemplate,l,!1,!0),t.altRowTemplate=t._tmpl(n.altRowTemplate||n.rowTemplate,l,!0,!0),t.lockedRowTemplate=t._tmpl(n.rowTemplate,s),t.lockedAltRowTemplate=t._tmpl(n.altRowTemplate||n.rowTemplate,s,!0)}else t.rowTemplate=t._tmpl(n.rowTemplate,l),t.altRowTemplate=t._tmpl(n.altRowTemplate||n.rowTemplate,l,!0);t._hasDetails()&&(t.detailTemplate=t._detailTmpl(n.detailTemplate||"")),(t._group&&!nt(a)||!nt(a)&&!o.length||K(t.columns,function(e){return e.footerTemplate}).length)&&(t.footerTemplate=t._footerTmpl(t.columns,a,"footerTemplate","k-footer-template")),r&&K(t.columns,function(e){return e.groupFooterTemplate}).length&&(a=e.map(r,function(e){return e.aggregates}),t.groupFooterTemplate=t._footerTmpl(l,a,"groupFooterTemplate","k-group-footer",s.length),n.scrollable&&s.length&&(t.lockedGroupFooterTemplate=t._footerTmpl(s,a,"groupFooterTemplate","k-group-footer")))},_footerTmpl:function(e,t,r,o,s){var l,d,c,u,p,f=this,h=G({},N.Template,f.options.templateSettings),g=h.paramName,m="",v={},_=0,k={},b=f._groups(),w=a(t);for(m+='<tr class="'+o+'">',b>0&&!s&&(m+=n(b)),f._hasDetails()&&(m+='<td class="k-hierarchy-cell">&nbsp;</td>'),l=0,d=e.length;d>l;l++)p=e[l],c=p[r],u=typeof c,m+="<td"+i(p.footerAttributes)+">",c?(u!==Ot&&(k=w[p.field]?G({},h,{paramName:g+"."+p.field}):{},c=N.template(c,k)),v["tmpl"+_]=c,m+="#=this.tmpl"+_+"("+g+")#",_++):m+="&nbsp;",m+="</td>";return m+="</tr>",m=N.template(m,h),_>0?et(m,v):m},_detailTmpl:function(e){var t=this,i="",r=G({},N.Template,t.options.templateSettings),o=r.paramName,a={},s=0,l=t._groups(),d=c(t.columns).length,u=typeof e;return i+='<tr class="k-detail-row">',l>0&&(i+=n(l)),i+='<td class="k-hierarchy-cell"></td><td class="k-detail-cell"'+(d?' colspan="'+d+'"':"")+">",u===Ot?(a["tmpl"+s]=e,i+="#=this.tmpl"+s+"("+o+")#",s++):i+=e,i+="</td></tr>",i=N.template(i,r),s>0?et(i,a):i},_hasDetails:function(){var e=this;return null!==e.options.detailTemplate||(e._events[mt]||[]).length},_details:function(){var t=this;if(t.options.scrollable&&t._hasDetails()&&p(t.columns).length)throw Error("Having both detail template and locked columns is not supported");t.table.on(zt+pt,".k-hierarchy-cell .k-plus, .k-hierarchy-cell .k-minus",function(n){var i,r,o=e(this),a=o.hasClass("k-plus"),s=o.closest("tr.k-master-row"),l=t.detailTemplate,d=t._hasDetails();return o.toggleClass("k-plus",!a).toggleClass("k-minus",a),d&&!s.next().hasClass("k-detail-row")&&(r=t.dataItem(s),e(l(r)).addClass(s.hasClass("k-alt")?"k-alt":"").insertAfter(s),t.trigger(mt,{masterRow:s,detailRow:s.next(),data:r,detailCell:s.next().find(".k-detail-cell")})),i=s.next(),t.trigger(a?Ct:Tt,{masterRow:s,detailRow:i}),i.toggle(a),t._current&&t._current.attr("aria-expanded",a),n.preventDefault(),!1})},dataItem:function(t){if(t=e(t)[0],!t)return null;var n,i,r=this.tbody.children(),o=/k-grouping-row|k-detail-row|k-group-footer/,a=t.sectionRowIndex;for(i=a,n=0;a>n;n++)o.test(r[n].className)&&i--;return this._data[i]},expandRow:function(t){e(t).find("> td .k-plus, > td .k-i-expand").click()},collapseRow:function(t){e(t).find("> td .k-minus, > td .k-i-collapse").click()},_createHeaderCells:function(e){var n,r,o,a,s=this,l="";for(n=0,a=e.length;a>n;n++)r=e[n],o=s._headerCellText(r),r.command?l+="<th"+i(r.headerAttributes)+">"+o+"</th>":(l+="<th role='columnheader' "+N.attr("field")+"='"+(r.field||"")+"' ",r.title&&(l+=N.attr("title")+'="'+r.title.replace(/'/g,"'")+'" '),r.groupable!==t&&(l+=N.attr("groupable")+"='"+r.groupable+"' "),r.aggregates&&(l+=N.attr("aggregates")+"='"+r.aggregates+"'"),l+=i(r.headerAttributes),l+=">"+o+"</th>");return l},_appendLockedColumnContent:function(){var t,n,i,r=this.columns,o=this.table.find("colgroup"),a=o.find("col:not(.k-group-col,.k-hierarchy-col)"),s=e(),l=0;for(t=0,n=r.length;n>t;t++)r[t].locked&&(r[t].hidden?l++:s=s.add(a.eq(t-l)));i=e('<div class="k-grid-content-locked"><table'+(tn?' cellspacing="0"':"")+"><colgroup/><tbody></tbody></table></div>"),o.detach(),i.find("colgroup").append(s),o.insertBefore(this.table.find("tbody")),this.lockedContent=i.insertBefore(this.content),this.lockedTable=i.children("table")},_appendLockedColumnFooter:function(){var t,n,i=this,r=i.footer,o=r.find(".k-footer-template>td"),a=r.find(".k-grid-footer-wrap>table>colgroup>col"),s=e('<div class="k-grid-footer-locked"><table><colgroup /><tbody><tr class="k-footer-template"></tr></tbody></table></div>'),l=i._groups(),d=e(),c=e();for(d=d.add(o.filter(".k-group-cell")),t=0,n=p(i.columns).length;n>t;t++)d=d.add(o.eq(t+l));for(c=c.add(a.filter(".k-group-col")),t=0,n=g(i.columns).length;n>t;t++)c=c.add(a.eq(t+l));d.appendTo(s.find("tr")),c.appendTo(s.find("colgroup")),i.lockedFooter=s.prependTo(r)},_appendLockedColumnHeader:function(t){var n,i,r,o,a,s,l,d=this,c=this.columns,u=0,p=e(),f=e();for(o=d.thead.prev().find("col:not(.k-group-col,.k-hierarchy-col)"),l=d.thead.find(".k-header:not(.k-group-cell,.k-hierarchy-cell)"),n=0,r=c.length;r>n;n++)c[n].locked&&(c[n].hidden||(p=p.add(o.eq(n-u))),f=f.add(l.eq(n))),c[n].hidden&&u++;f.length&&(i='<div class="k-grid-header-locked" style="width:1px"><table'+(tn?' cellspacing="0"':"")+"><colgroup/><thead><tr></tr></thead></table></div>",s=e(i),o=s.find("colgroup"),a=s.find("thead tr"),o.append(d.thead.prev().find("col.k-group-col").add(p)),a.append(d.thead.find(".k-group-cell").add(f)),this.lockedHeader=s.prependTo(t),this._syncLockedHeaderHeight())},_removeLockedContainers:function(){var e=this.lockedHeader.add(this.lockedContent).add(this.lockedFooter);e.off(pt).remove(),this.lockedHeader=this.lockedContent=this.lockedFooter=null},_thead:function(){var t,n=this,i=n.columns,r=n._hasDetails()&&i.length,o="",a=n.table.find(">thead");a.length||(a=e("<thead/>").insertBefore(n.tbody)),n.lockedHeader&&n.thead?(t=n.thead.find("tr:has(th):first").html(""),n._removeLockedContainers()):t=n.element.find("tr:has(th):first"),t.length||(t=a.children().first(),t.length||(t=e("<tr/>"))),t.children().length?r&&!t.find(".k-hierarchy-cell")[0]&&t.prepend('<th class="k-hierarchy-cell">&nbsp;</th>'):(r&&(o+='<th class="k-hierarchy-cell">&nbsp;</th>'),o+=n._createHeaderCells(n.columns),t.html(o)),t.attr("role","row").find("th").addClass("k-header"),n.options.scrollable||a.addClass("k-grid-header"),t.find("script").remove().end().appendTo(a),n.thead&&n._destroyColumnAttachments(),n.thead=a.attr("role","rowgroup"),n._sortable(),n._filterable(),n._scrollable(),n._updateCols(),n._columnMenu(),this.options.scrollable&&p(this.columns).length&&(n._appendLockedColumnHeader(n.thead.closest(".k-grid-header")),n._appendLockedColumnContent(),n.lockedContent.bind("DOMMouseScroll"+pt+" mousewheel"+pt,et(n._wheelScroll,n)),n._applyLockedContainersWidth()),n._resizable(),n._draggable(),n._reorderable(),n.groupable&&n._attachGroupable()},_wheelScroll:function(t){var n,i,r=this.content;this.options.scrollable.virtual&&(r=this.virtualScrollable.verticalScrollbar),n=r.scrollTop(),i=N.wheelDeltaY(t),i&&(t.preventDefault(),e(t.currentTarget).one("wheel"+pt,!1),r.scrollTop(n+-i))},_isLocked:function(){return null!=this.lockedHeader},_updateCols:function(e){e=e||this.thead.parent().add(this.table),this._appendCols(e,this._isLocked())},_updateLockedCols:function(e){this._isLocked()&&(e=e||this.lockedHeader.find("table").add(this.lockedTable),k(e,g(this.columns),this._hasDetails(),this._groups()))},_appendCols:function(e,t){t?k(e,h(this.columns),this._hasDetails(),0):k(e,c(this.columns),this._hasDetails(),this._groups())},_autoColumns:function(e){if(e&&e.toJSON){var t,n=this;e=e.toJSON();for(t in e)n.columns.push({field:t});n._thead(),n._templates()
}},_rowsHtml:function(e,t){var n,i,r=this,o="",a=t.rowTemplate,s=t.altRowTemplate;for(n=0,i=e.length;i>n;n++)o+=n%2?s(e[n]):a(e[n]),r._data.push(e[n]);return o},_groupRowHtml:function(e,t,n,i,r,o){var a,s,l=this,d="",c=e.field,u=K(l.columns,function(e){return e.field==c})[0]||{},p=u.groupHeaderTemplate,f=(u.title||c)+": "+y(e.value,u.format,u.values),h=G({},{field:e.field,value:e.value},e.aggregates[e.field]),g=l._groupAggregatesDefaultObject||{},m=r.groupFooterTemplate,v=e.items;if(p&&(f=typeof p===Ot?p(h):N.template(p)(h)),d+=i(t,n,f),e.hasSubgroups)for(a=0,s=v.length;s>a;a++)d+=l._groupRowHtml(v[a],o?t:t-1,n+1,i,r,o);else d+=l._rowsHtml(v,r);return m&&(d+=m(G(g,e.aggregates))),d},collapseGroup:function(t){t=e(t);var n,i,r,o,a,s=1,l=e();for(this._isLocked()&&(t.closest("div").hasClass("k-grid-content-locked")?l=this.tbody.children("tr:eq("+t.index()+")").nextAll("tr"):(l=t.nextAll("tr"),t=this.lockedTable.find(">tbody>tr:eq("+t.index()+")"))),n=t.find(".k-group-cell").length,t.find(".k-icon").addClass("k-i-expand").removeClass("k-i-collapse"),t.find("td:first").attr("aria-expanded",!1),t=t.nextAll("tr"),r=0,o=t.length;o>r&&(a=t.eq(r),i=a.find(".k-group-cell").length,a.hasClass("k-grouping-row")?s++:a.hasClass("k-group-footer")&&s--,!(n>=i||a.hasClass("k-group-footer")&&0>s));r++)a.hide(),l.eq(r).hide()},expandGroup:function(t){t=e(t);var n,i,r,o,a,s=this,l=e(),d=1;for(this._isLocked()&&(t.closest("div").hasClass("k-grid-content-locked")?l=this.tbody.children("tr:eq("+t.index()+")").nextAll("tr"):(l=t.nextAll("tr"),t=this.lockedTable.find(">tbody>tr:eq("+t.index()+")"))),n=t.find(".k-group-cell").length,t.find(".k-icon").addClass("k-i-collapse").removeClass("k-i-expand"),t.find("td:first").attr("aria-expanded",!0),t=t.nextAll("tr"),o=0,a=t.length;a>o&&(i=t.eq(o),r=i.find(".k-group-cell").length,!(n>=r));o++)r!=n+1||i.hasClass("k-detail-row")||(i.show(),l.eq(o).show(),i.hasClass("k-grouping-row")&&i.find(".k-icon").hasClass("k-i-collapse")&&s.expandGroup(i),i.hasClass("k-master-row")&&i.find(".k-icon").hasClass("k-minus")&&(i.next().show(),l.eq(o+1).show())),i.hasClass("k-grouping-row")&&d++,i.hasClass("k-group-footer")&&(1==d?(i.show(),l.eq(o).show()):d--)},_updateHeader:function(t){var n=this,i=n._isLocked()?n.lockedHeader:n.thead,r=i.find("th.k-group-cell"),o=r.length;t>o?e(Array(t-o+1).join('<th class="k-group-cell k-header">&nbsp;</th>')).prependTo(i.find("tr")):o>t&&(o-=t,e(K(r,function(e,t){return o>t})).remove())},_firstDataItem:function(e,t){return e&&t&&(e=e.hasSubgroups?this._firstDataItem(e.items[0],t):e.items[0]),e},_updateTablesWidth:function(){var t,n=this;n._isLocked()&&(t=e(">.k-grid-footer>.k-grid-footer-wrap>table",n.wrapper).add(n.thead.parent()).add(n.table),n._footerWidth=F(t.eq(0)),t.width(n._footerWidth),t=e(">.k-grid-footer>.k-grid-footer-locked>table",n.wrapper).add(n.lockedHeader.find(">table")).add(n.lockedTable),t.width(F(t.eq(0))))},hideColumn:function(t){var n,i,r,o,a,s,d=this,u=0,p=d.footer||d.wrapper.find(".k-grid-footer"),f=d.columns,h=g(f).length;if(t="number"==typeof t?f[t]:K(f,function(e){return e.field===t})[0],t&&!t.hidden){if(s=X(t,c(f)),t.hidden=!0,t.attributes=v(t.attributes),t.footerAttributes=v(t.footerAttributes),t.headerAttributes=v(t.headerAttributes),d._templates(),d._updateCols(),d._updateLockedCols(),x(l(e(">table>thead",d.lockedHeader),d.thead,">tr>th"),s,!1),p[0]&&(d._updateCols(p.find(">.k-grid-footer-wrap>table")),d._updateLockedCols(p.find(">.k-grid-footer-locked>table")),x(p.find(".k-footer-template>td"),s,!1)),d.lockedTable&&h>s?C(d.lockedTable.find(">tbody>tr"),s):C(d.tbody.children(),s-h),d.lockedTable)d._updateTablesWidth(),d._applyLockedContainersWidth(),d._syncLockedContentHeight(),d._syncLockedHeaderHeight(),d._syncLockedFooterHeight();else{for(r=d.thead.prev().find("col"),i=0,a=r.length;a>i;i+=1){if(o=r[i].style.width,!o||-1!=o.indexOf("%")){u=0;break}u+=parseInt(o,10)}n=e(">.k-grid-header table:first,>.k-grid-footer table:first",d.wrapper).add(d.table),d._footerWidth=null,u&&(n.width(u),d._footerWidth=u),en.msie&&8==en.version&&(n.css("display","inline-table"),setTimeout(function(){n.css("display","table")},1))}d.trigger(bt,{column:t})}},showColumn:function(t){var n,i,r,o,a,s,d,c=this,u=c.columns,f=c.footer||c.wrapper.find(".k-grid-footer"),h=p(u).length;if(t="number"==typeof t?u[t]:K(u,function(e){return e.field===t})[0],t&&t.hidden){if(d=X(t,u),t.hidden=!1,t.attributes=_(t.attributes),t.footerAttributes=_(t.footerAttributes),t.headerAttributes=_(t.headerAttributes),c._templates(),c._updateCols(),c._updateLockedCols(),x(l(e(">table>thead",c.lockedHeader),c.thead,">tr>th"),d,!0),f[0]&&(c._updateCols(f.find(">.k-grid-footer-wrap>table")),c._updateLockedCols(f.find(">.k-grid-footer-locked>table")),x(f.find(".k-footer-template>td"),d,!0)),c.lockedTable&&h>d?T(c.lockedTable.find(">tbody>tr"),d):T(c.tbody.children(),d-h),c.lockedTable)c._updateTablesWidth(),c._applyLockedContainersWidth(),c._syncLockedContentHeight(),c._syncLockedHeaderHeight();else if(r=e(">.k-grid-header table:first,>.k-grid-footer table:first",c.wrapper).add(c.table),t.width){for(o=0,s=c.thead.prev().find("col"),n=0,i=s.length;i>n;n+=1){if(a=s[n].style.width,a.indexOf("%")>-1){o=0;break}o+=parseInt(a,10)}c._footerWidth=null,o&&(r.width(o),c._footerWidth=o)}else r.width("");c.trigger(wt,{column:t})}},_progress:function(e){var t=this.element;this.lockedContent?t=this.wrapper:this.element.is("table")?t=this.element.parent():this.content&&this.content.length&&(t=this.content),N.ui.progress(t,e)},_resize:function(){this.content&&(this._setContentHeight(),this._setContentWidth())},_isActiveInTable:function(){var t=j();return this.table[0]===t||e.contains(this.table[0],t)||this._isLocked()&&(this.lockedTable[0]===t||e.contains(this.lockedTable[0],t))},refresh:function(t){var n,i=this,r=i.dataSource.view(),o=i.options.navigatable,a=e(i.current()),s=!1,l=(i.dataSource.group()||[]).length,d=l+c(i.columns).length;t&&"itemchange"===t.action&&i.editable||(t=t||{},i.trigger("dataBinding",{action:t.action||"rebind",index:t.index,items:t.items})||(o&&(i._isActiveInTable()||i._editContainer&&i._editContainer.data("kendoWindow"))&&(s=a.is("th"),n=0,s&&(n=i.thead.find("th:not(.k-group-cell)").index(a))),i._destroyEditable(),i._progress(!1),i._hideResizeHandle(),i._data=[],i.columns.length||(i._autoColumns(i._firstDataItem(r[0],l)),d=l+i.columns.length),i._group=l>0||i._group,i._group&&(i._templates(),i._updateCols(),i._updateLockedCols(),i._updateHeader(l),i._group=l>0),i._renderContent(r,d,l),i._renderLockedContent(r,d,l),i._footer(),i._setContentHeight(),i._setContentWidth(),n>=0&&(i._removeCurrent(),s?i.current(i.thead.find("th:not(.k-group-cell)").eq(n)):i.current(i.table.add(i.lockedTable).find(ct).first()),i._current&&E(i._current.closest("table")[0],!0)),i.touchScroller&&i.touchScroller.contentResized(),i.trigger(xt)))},_renderContent:function(e,t,n){var i,r,o=this,s="",l=null!=o.lockedContent,d={rowTemplate:o.rowTemplate,altRowTemplate:o.altRowTemplate,groupFooterTemplate:o.groupFooterTemplate};if(t=l?t-g(o.columns).length:t,n>0)for(t=l?t-n:t,o.detailTemplate&&t++,o.groupFooterTemplate&&(o._groupAggregatesDefaultObject=a(o.dataSource.aggregate())),i=0,r=e.length;r>i;i++)s+=o._groupRowHtml(e[i],t,0,l?L:R,d,l);else s+=o._rowsHtml(e,d);o.tbody=m(o.tbody,o.table,s)},_renderLockedContent:function(e,t,n){var i,r,o,a="",s={rowTemplate:this.lockedRowTemplate,altRowTemplate:this.lockedAltRowTemplate,groupFooterTemplate:this.lockedGroupFooterTemplate};if(this.lockedContent){if(o=this.lockedTable,n>0)for(t-=h(this.columns).length,i=0,r=e.length;r>i;i++)a+=this._groupRowHtml(e[i],t,0,R,s);else a=this._rowsHtml(e,s);m(o.children("tbody"),o,a),this._syncLockedContentHeight()}},_adjustRowsHeight:function(e,t){var n,i,r,o,a=e[0].rows,s=a.length,l=t[0].rows,d=e.add(t),c=d.length,u=[];for(n=0;s>n;n++)a[n].style.height&&(a[n].style.height=l[n].style.height=""),i=a[n].offsetHeight,r=l[n].offsetHeight,o=0,i>r?o=i:r>i&&(o=r),u.push(o);for(n=0;c>n;n++)d[n].style.display="none";for(n=0;s>n;n++)u[n]&&(a[n].style.height=l[n].style.height=u[n]+"px");for(n=0;c>n;n++)d[n].style.display=""}}),sn=U.extend({init:function(e,t){var n,i=this;U.fn.init.call(i,e,t),i._refreshHandler=et(i.refresh,i),i.dataSource=i.options.dataSource.bind("change",i._refreshHandler),n=i.element.find(Jt),n[0]||(n=i.element.wrapInner('<a class="k-link" href="#"/>').find(Jt)),i.link=n,i.element.on("click"+Kt,et(i._click,i))},options:{name:"Sorter",mode:Yt,allowUnsort:!0,compare:null,filter:""},destroy:function(){var e=this;U.fn.destroy.call(e),e.element.off(Kt),e.dataSource.unbind("change",e._refreshHandler),e._refreshHandler=e.element=e.link=e.dataSource=null},refresh:function(){var t,n,i,r,o=this,a=o.dataSource.sort()||[],s=o.element,l=s.attr(N.attr(Gt));for(s.removeAttr(N.attr(Ut)),s.removeAttr(Xt),t=0,n=a.length;n>t;t++)i=a[t],l==i.field&&s.attr(N.attr(Ut),i.dir);r=s.attr(N.attr(Ut)),s.find(".k-i-arrow-n,.k-i-arrow-s").remove(),r===$t?(e('<span class="k-icon k-i-arrow-n" />').appendTo(o.link),s.attr(Xt,"ascending")):r===Qt&&(e('<span class="k-icon k-i-arrow-s" />').appendTo(o.link),s.attr(Xt,"descending"))},_click:function(e){var n,i,r=this,o=r.element,a=o.attr(N.attr(Gt)),s=o.attr(N.attr(Ut)),l=r.options,d=null==r.options.compare?t:r.options.compare,c=r.dataSource.sort()||[];if(e.preventDefault(),!l.filter||o.is(l.filter)){if(s=s===$t?Qt:s===Qt&&l.allowUnsort?t:$t,l.mode===Yt)c=[{field:a,dir:s,compare:d}];else if("multiple"===l.mode){for(n=0,i=c.length;i>n;n++)if(c[n].field===a){c.splice(n,1);break}c.push({field:a,dir:s,compare:d})}r.dataSource.sort(c)}}});W.plugin(an),W.plugin(rn),W.plugin(sn)})(window.kendo.jQuery);(function(e,t){var n=window.kendo,i="change",r="cancel",o="dataBound",a="dataBinding",s=n.ui.Widget,l=n.keys,d=">*",c="progress",u="error",p="k-state-focused",f="k-state-selected",h="k-edit-item",g="string",m="edit",v="remove",_="save",k="click",b=".kendoListView",w=e.proxy,y=n._activeElement,x=n.ui.progress,C=n.data.DataSource,T=s.extend({init:function(t,i){var r=this;i=e.isArray(i)?{dataSource:i}:i,s.fn.init.call(r,t,i),i=r.options,r.wrapper=t=r.element,t[0].id&&(r._itemId=t[0].id+"_lv_active"),r._element(),r._dataSource(),r._templates(),r._navigatable(),r._selectable(),r._pageable(),r._crudHandlers(),r.options.autoBind&&r.dataSource.fetch(),n.notify(r)},events:[i,r,a,o,m,v,_],options:{name:"ListView",autoBind:!0,selectable:!1,navigatable:!1,template:"",altTemplate:"",editTemplate:""},setOptions:function(e){s.fn.setOptions.call(this,e),this._templates()},_templates:function(){var e=this.options;this.template=n.template(e.template||""),this.altTemplate=n.template(e.altTemplate||e.template),this.editTemplate=n.template(e.editTemplate||"")},_item:function(e){return this.element.children()[e]()},items:function(){return this.element.children()},dataItem:function(t){var i=n.attr("uid"),r=e(t).closest("["+i+"]").attr(i);return this.dataSource.getByUid(r)},setDataSource:function(e){this.options.dataSource=e,this._dataSource(),this.options.autoBind&&e.fetch()},_unbindDataSource:function(){var e=this;e.dataSource.unbind(i,e._refreshHandler).unbind(c,e._progressHandler).unbind(u,e._errorHandler)},_dataSource:function(){var e=this;e.dataSource&&e._refreshHandler?e._unbindDataSource():(e._refreshHandler=w(e.refresh,e),e._progressHandler=w(e._progress,e),e._errorHandler=w(e._error,e)),e.dataSource=C.create(e.options.dataSource).bind(i,e._refreshHandler).bind(c,e._progressHandler).bind(u,e._errorHandler)},_progress:function(){x(this.element,!0)},_error:function(){x(this.element,!1)},_element:function(){this.element.addClass("k-widget k-listview").attr("role","listbox")},refresh:function(e){var i,r,s,l,d,c=this,u=c.dataSource.view(),p="",f=c.template,h=c.altTemplate,g=y();if(e=e||{},"itemchange"===e.action)return c._hasBindingTarget()||c.editable||(i=e.items[0],s=c.items().filter("["+n.attr("uid")+"="+i.uid+"]"),s.length>0&&(l=s.index(),s.replaceWith(f(i)),s=c.items().eq(l),s.attr(n.attr("uid"),i.uid),c.trigger("itemChange",{item:s,data:i}))),t;if(!c.trigger(a,{action:e.action||"rebind",items:e.items,index:e.index})){for(c._destroyEditable(),l=0,d=u.length;d>l;l++)p+=l%2?h(u[l]):f(u[l]);for(c.element.html(p),r=c.items(),l=0,d=u.length;d>l;l++)r.eq(l).attr(n.attr("uid"),u[l].uid).attr("role","option").attr("aria-selected","false");c.element[0]===g&&c.options.navigatable&&c.current(r.eq(0)),c.trigger(o)}},_pageable:function(){var t,i,r=this,o=r.options.pageable;e.isPlainObject(o)&&(i=o.pagerId,t=e.extend({},o,{dataSource:r.dataSource,pagerId:null}),r.pager=new n.ui.Pager(e("#"+i),t))},_selectable:function(){var e,r,o=this,a=o.options.selectable,s=o.options.navigatable;a&&(e=typeof a===g&&a.toLowerCase().indexOf("multiple")>-1,e&&o.element.attr("aria-multiselectable",!0),o.selectable=new n.ui.Selectable(o.element,{aria:!0,multiple:e,filter:d,change:function(){o.trigger(i)}}),s&&o.element.on("keydown"+b,function(n){if(n.keyCode===l.SPACEBAR){if(r=o.current(),n.target==n.currentTarget&&n.preventDefault(),e)if(n.ctrlKey){if(r&&r.hasClass(f))return r.removeClass(f),t}else o.selectable.clear();else o.selectable.clear();o.selectable.value(r)}}))},current:function(e){var n=this,i=n.element,r=n._current,o=n._itemId;return e===t?r:(r&&r[0]&&(r[0].id===o&&r.removeAttr("id"),r.removeClass(p),i.removeAttr("aria-activedescendant")),e&&e[0]&&(o=e[0].id||o,n._scrollTo(e[0]),i.attr("aria-activedescendant",o),e.addClass(p).attr("id",o)),n._current=e,t)},_scrollTo:function(t){var n,i,r=this,o=!1,a="scroll";"auto"==r.wrapper.css("overflow")||r.wrapper.css("overflow")==a?n=r.wrapper[0]:(n=window,o=!0),i=function(i,r){var s=o?e(t).offset()[i.toLowerCase()]:t["offset"+i],l=t["client"+r],d=e(n)[a+i](),c=e(n)[r.toLowerCase()]();s+l>d+c?e(n)[a+i](s+l-c):d>s&&e(n)[a+i](s)},i("Top","Height"),i("Left","Width")},_navigatable:function(){var t=this,i=t.options.navigatable,r=t.element,o=function(n){t.current(e(n.currentTarget)),e(n.target).is(":button,a,:input,a>.k-icon,textarea")||r.focus()};i&&(t._tabindex(),r.on("focus"+b,function(){var e=t._current;e&&e.is(":visible")||(e=t._item("first")),t.current(e)}).on("focusout"+b,function(){t._current&&t._current.removeClass(p)}).on("keydown"+b,function(i){var o,a,s=i.keyCode,d=t.current(),c=e(i.target),u=!c.is(":button,textarea,a,a>.t-icon,input"),p=c.is(":text"),f=n.preventDefault,g=r.find("."+h),m=y();if(!(!u&&!p&&l.ESC!=s||p&&l.ESC!=s&&l.ENTER!=s))if(l.UP===s||l.LEFT===s)d&&(d=d.prev()),t.current(d&&d[0]?d:t._item("last")),f(i);else if(l.DOWN===s||l.RIGHT===s)d&&(d=d.next()),t.current(d&&d[0]?d:t._item("first")),f(i);else if(l.PAGEUP===s)t.current(null),t.dataSource.page(t.dataSource.page()-1),f(i);else if(l.PAGEDOWN===s)t.current(null),t.dataSource.page(t.dataSource.page()+1),f(i);else if(l.HOME===s)t.current(t._item("first")),f(i);else if(l.END===s)t.current(t._item("last")),f(i);else if(l.ENTER===s)0!==g.length&&(u||p)?(o=t.items().index(g),m&&m.blur(),t.save(),a=function(){t.element.trigger("focus"),t.current(t.items().eq(o))},t.one("dataBound",a)):""!==t.options.editTemplate&&t.edit(d);else if(l.ESC===s){if(g=r.find("."+h),0===g.length)return;o=t.items().index(g),t.cancel(),t.element.trigger("focus"),t.current(t.items().eq(o))}}),r.on("mousedown"+b+" touchstart"+b,d,w(o,t)))},clearSelection:function(){var e=this;e.selectable.clear(),e.trigger(i)},select:function(n){var i=this,r=i.selectable;return n=e(n),n.length?(r.options.multiple||(r.clear(),n=n.first()),r.value(n),t):r.value()},_destroyEditable:function(){var e=this;e.editable&&(e.editable.destroy(),delete e.editable)},_modelFromElement:function(e){var t=e.attr(n.attr("uid"));return this.dataSource.getByUid(t)},_closeEditable:function(e){var t,i,r=this,o=r.editable,a=r.template,s=!0;return o&&(e&&(s=o.end()),s&&(o.element.index()%2&&(a=r.altTemplate),t=r._modelFromElement(o.element),r._destroyEditable(),i=o.element.index(),o.element.replaceWith(a(t)),r.items().eq(i).attr(n.attr("uid"),t.uid))),s},edit:function(e){var t,i,r=this,o=r._modelFromElement(e),a=o.uid;r.cancel(),e=r.items().filter("["+n.attr("uid")+"="+a+"]"),i=e.index(),e.replaceWith(r.editTemplate(o)),t=r.items().eq(i).addClass(h).attr(n.attr("uid"),o.uid),r.editable=t.kendoEditable({model:o,clearContainer:!1,errorTemplate:!1}).data("kendoEditable"),r.trigger(m,{model:o,item:t})},save:function(){var e,t=this,n=t.editable;n&&(n=n.element,e=t._modelFromElement(n),!t.trigger(_,{model:e,item:n})&&t._closeEditable(!0)&&t.dataSource.sync())},remove:function(e){var t=this,n=t.dataSource,i=t._modelFromElement(e);t.trigger(v,{model:i,item:e})||(e.hide(),n.remove(i),n.sync())},add:function(){var e=this,t=e.dataSource,n=t.indexOf((t.view()||[])[0]);0>n&&(n=0),e.cancel(),t.insert(n,{}),e.edit(e.element.children().first())},cancel:function(){var e,t,n=this,i=n.dataSource;n.editable&&(e=n.editable.element,t=n._modelFromElement(e),n.trigger(r,{model:t,container:e})||(i.cancelChanges(t),n._closeEditable(!1)))},_crudHandlers:function(){var t=this,i=k+b;t.element.on(i,".k-edit-button",function(i){var r=e(this).closest("["+n.attr("uid")+"]");t.edit(r),i.preventDefault()}),t.element.on(i,".k-delete-button",function(i){var r=e(this).closest("["+n.attr("uid")+"]");t.remove(r),i.preventDefault()}),t.element.on(i,".k-update-button",function(e){t.save(),e.preventDefault()}),t.element.on(i,".k-cancel-button",function(e){t.cancel(),e.preventDefault()})},destroy:function(){var e=this;s.fn.destroy.call(e),e._unbindDataSource(),e._destroyEditable(),e.element.off(b),e.pager&&e.pager.destroy(),n.destroy(e.element)}});n.ui.plugin(T)})(window.kendo.jQuery);(function(e,t){function n(t){return e.map(i(t),function(e){return e.name}).join(", ")}function i(e){var t=e[0];return t.files?r(t.files):[{name:s(t.value),extension:a(t.value),size:null}]}function r(t){return e.map(t,function(e){return o(e)})}function o(e){var t=e.name||e.fileName;return{name:k.htmlEncode(t),extension:a(t),size:e.size||e.fileSize,rawFile:e}}function a(e){var t=e.match(y);return t?t[0]:""}function s(e){var t=e.lastIndexOf("\\");return-1!=t?e.substr(t+1):e}function l(t,n){var i=k.guid();return e.map(t,function(e){return e.uid=n?k.guid():i,e})}function d(t,n,i){var r,o;n._supportsRemove()&&(r=t.data("fileNames"),o=e.map(r,function(e){return e.name}),n._submitRemove(o,i,function(e,i,o){n._removeFileEntry(t),n.trigger(S,{operation:"remove",files:r,response:e,XMLHttpRequest:o})},function(e){n.trigger(F,{operation:"remove",files:r,XMLHttpRequest:e}),w("Server response: "+e.responseText)}))}function c(t,n,i){var r=!1,o="";try{o=e.parseJSON(u(t)),r=!0}catch(a){i()}r&&n(o)}function u(e){return(t===e||""===e)&&(e="{}"),e}function p(e){e.stopPropagation(),e.preventDefault()}function f(e,t,n,i){var r,o;e.on("dragenter"+t,function(){n(),o=new Date,r||(r=setInterval(function(){var e=new Date-o;e>100&&(i(),clearInterval(r),r=null)},100))}).on("dragover"+t,function(){o=new Date})}function h(e){return e.is(".k-file-progress, .k-file-success, .k-file-error")}function g(t){return e(t.target).closest(".k-file")}function m(){var n={},i=e("meta[name=csrf-token]").attr("content"),r=e("meta[name=csrf-param]").attr("content");return e("input[name^='__RequestVerificationToken']").each(function(){n[this.name]=this.value}),r!==t&&i!==t&&(n[r]=i),n}var v,_,k=window.kendo,b=k.ui.Widget,w=k.logToConsole,y=/\.([^\.]+)$/,x=".kendoUpload",C="select",T="upload",S="success",F="error",D="complete",H="cancel",E="progress",M="remove",z=b.extend({init:function(t,n){var i,r,o,a=this;b.fn.init.call(a,t,n),a.name=t.name,a.multiple=a.options.multiple,a.localization=a.options.localization,i=a.element,a.wrapper=i.closest(".k-upload"),0===a.wrapper.length&&(a.wrapper=a._wrapInput(i)),a._activeInput(i),a.toggle(a.options.enabled),r=a._ns=x+"-"+k.guid(),i.closest("form").on("submit"+r,e.proxy(a._onParentFormSubmit,a)).on("reset"+r,e.proxy(a._onParentFormReset,a)),a.options.async.saveUrl?(a._module=a._supportsFormData()?new _(a):new v(a),a._async=!0,o=a.options.files,o.length>0&&a._renderInitialFiles(o)):a._module=new A(a),a._supportsDrop()&&a._setupDropZone(),a.wrapper.on("click",".k-upload-action",e.proxy(a._onFileAction,a)).on("click",".k-upload-selected",e.proxy(a._onUploadSelected,a)),a.element.val()&&a._onInputChange({target:a.element})},events:[C,T,S,F,D,H,E,M],options:{name:"Upload",enabled:!0,multiple:!0,showFileList:!0,template:"",files:[],async:{removeVerb:"POST",autoUpload:!0,withCredentials:!0},localization:{select:"Select files...",cancel:"Cancel",retry:"Retry",remove:"Remove",uploadSelectedFiles:"Upload files",dropFilesHere:"drop files here to upload",statusUploading:"uploading",statusUploaded:"uploaded",statusWarning:"warning",statusFailed:"failed",headerStatusUploading:"Uploading...",headerStatusUploaded:"Done"}},setOptions:function(e){var t=this,n=t.element;b.fn.setOptions.call(t,e),t.multiple=t.options.multiple,n.attr("multiple",t._supportsMultiple()?t.multiple:!1),t.toggle(t.options.enabled)},enable:function(e){e=t===e?!0:e,this.toggle(e)},disable:function(){this.toggle(!1)},toggle:function(e){e=t===e?e:!e,this.wrapper.toggleClass("k-state-disabled",e),this.element.prop("disabled",e)},destroy:function(){var t=this;e(document).add(e(".k-dropzone",t.wrapper)).add(t.wrapper.closest("form")).off(t._ns),e(t.element).off(x),b.fn.destroy.call(t)},_addInput:function(t){if(t[0].nodeType){var n=this,i=t.clone().val("");i.insertAfter(n.element).data("kendoUpload",n),e(n.element).hide().attr("tabindex","-1").removeAttr("id").off(x),n._activeInput(i),n.element.focus()}},_activeInput:function(t){var n=this,i=n.wrapper;n.element=t,t.attr("multiple",n._supportsMultiple()?n.multiple:!1).attr("autocomplete","off").on("click"+x,function(e){i.hasClass("k-state-disabled")&&e.preventDefault()}).on("focus"+x,function(){e(this).parent().addClass("k-state-focused")}).on("blur"+x,function(){e(this).parent().removeClass("k-state-focused")}).on("change"+x,e.proxy(n._onInputChange,n)).on("keydown"+x,e.proxy(n._onInputKeyDown,n))},_onInputKeyDown:function(e){var t=this,n=t.wrapper.find(".k-upload-action:first");e.keyCode===k.keys.TAB&&n.length>0&&(e.preventDefault(),n.focus())},_onInputChange:function(t){var n=this,i=e(t.target),r=l(n._inputFiles(i),n._isAsyncNonBatch()),o=n.trigger(C,{files:r});o?(n._addInput(i),i.remove()):n._module.onSelect({target:i},r)},_onDrop:function(t){var n,i=t.originalEvent.dataTransfer,o=this,a=i.files,s=l(r(a),o._isAsyncNonBatch());p(t),a.length>0&&(n=o.trigger(C,{files:s}),n||o._module.onSelect({target:e(".k-dropzone",o.wrapper)},s))},_isAsyncNonBatch:function(){return this._async&&!this.options.async.batch||!1},_renderInitialFiles:function(t){var n,i,r=this,o=0;for(t=l(t,!0),o=0;t.length>o;o++)n=t[o],i=r._enqueueFile(n.name,{fileNames:[n]}),i.addClass("k-file-success").data("files",[t[o]]),e(".k-progress",i).width("100%"),e(".k-upload-status",i).prepend("<span class='k-upload-pct'>100%</span>"),r._fileAction(i,M)},_prepareTemplateData:function(e,t){var n=t.fileNames,i={},r=0,o=0;for(o=0;n.length>o;o++)r+=n[o].size;return i.name=e,i.size=r,i.files=t.fileNames,i},_prepareDefaultFileEntryTemplate:function(t,n){var i="",r=e("<li class='k-file'><span class='k-progress'></span><span class='k-icon'></span><span class='k-filename' title='"+t+"'>"+t+"</span><strong class='k-upload-status'></strong></li>");return 1==n.fileNames.length&&n.fileNames[0].extension&&(i=n.fileNames[0].extension.substring(1),e(".k-icon",r).addClass("k-i-"+i)),r},_enqueueFile:function(t,n){var i,r,o,a=this,s=n.fileNames[0].uid,l=e(".k-upload-files",a.wrapper),d=a.options,c=d.template;return 0===l.length&&(l=e("<ul class='k-upload-files k-reset'></ul>").appendTo(a.wrapper),a.options.showFileList||l.hide(),a.wrapper.removeClass("k-upload-empty")),i=e(".k-file",l),c?(o=a._prepareTemplateData(t,n),c=k.template(c),r=e("<li class='k-file'>"+c(o)+"</li>"),r.find(".k-upload-action").addClass("k-button k-button-bare")):r=a._prepareDefaultFileEntryTemplate(t,n),r.attr(k.attr("uid"),s).appendTo(l).data(n),a._async||e(".k-progress",r).width("100%"),!a.multiple&&i.length>0&&a._module.onRemove({target:e(i,a.wrapper)}),r},_removeFileEntry:function(t){var n,i,r=this,o=t.closest(".k-upload-files");t.remove(),n=e(".k-file",o),i=e(".k-file-success, .k-file-error",o),i.length===n.length&&this._hideUploadButton(),0===n.length&&(o.remove(),r.wrapper.addClass("k-upload-empty"),r._hideHeaderUploadstatus())},_fileAction:function(e,t){var n={remove:"k-delete",cancel:"k-cancel",retry:"k-retry"},i={remove:"k-i-close",cancel:"k-i-close",retry:"k-i-refresh"};n.hasOwnProperty(t)&&(this._clearFileAction(e),this.options.template?e.find(".k-upload-action").addClass("k-button k-button-bare").append("<span class='k-icon "+i[t]+" "+n[t]+"' title='"+this.localization[t]+"'></span>").show():(e.find(".k-upload-status .k-upload-action").remove(),e.find(".k-upload-status").append(this._renderAction(n[t],this.localization[t],i[t]))))},_fileState:function(t,n){var i=this.localization,r={uploading:{text:i.statusUploading},uploaded:{text:i.statusUploaded},failed:{text:i.statusFailed}},o=r[n];o&&e(".k-icon:not(.k-delete, .k-cancel, .k-retry)",t).text(o.text)},_renderAction:function(t,n,i){return""!==t?e("<button type='button' class='k-button k-button-bare k-upload-action'><span class='k-icon "+i+" "+t+"' title='"+n+"'></span></button>"):e("<button type='button' class='k-button'>"+n+"</button>")},_clearFileAction:function(t){e(".k-upload-action",t).empty().hide()},_onFileAction:function(t){var n,i,r,o,a=this;return a.wrapper.hasClass("k-state-disabled")||(n=e(t.target).closest(".k-upload-action"),i=n.find(".k-icon"),r=n.closest(".k-file"),o={files:r.data("fileNames")},i.hasClass("k-delete")?a.trigger(M,o)||a._module.onRemove({target:e(r,a.wrapper)},o.data):i.hasClass("k-cancel")?(a.trigger(H,o),a._module.onCancel({target:e(r,a.wrapper)}),this._checkAllComplete(),a._updateHeaderUploadStatus()):i.hasClass("k-retry")&&(e(".k-warning",r).remove(),a._module.onRetry({target:e(r,a.wrapper)}))),!1},_onUploadSelected:function(){return this._module.onSaveSelected(),!1},_onFileProgress:function(t,n){var i;this.options.template?e(".k-progress",t.target).width(n+"%"):(i=e(".k-upload-pct",t.target),0===i.length&&e(".k-upload-status",t.target).prepend("<span class='k-upload-pct'></span>"),e(".k-upload-pct",t.target).text(n+"%"),e(".k-progress",t.target).width(n+"%")),this.trigger(E,{files:g(t).data("fileNames"),percentComplete:n})},_onUploadSuccess:function(e,t,n){var i=g(e);this._fileState(i,"uploaded"),i.removeClass("k-file-progress").addClass("k-file-success"),this._updateHeaderUploadStatus(),this.trigger(S,{files:i.data("fileNames"),response:t,operation:"upload",XMLHttpRequest:n}),this._supportsRemove()?this._fileAction(i,M):this._clearFileAction(i),this._checkAllComplete()},_onUploadError:function(t,n){var i=g(t),r=e(".k-upload-pct",i);this._fileState(i,"failed"),i.removeClass("k-file-progress").addClass("k-file-error"),e(".k-progress",i).width("100%"),r.length>0?r.empty().removeClass("k-upload-pct").addClass("k-icon k-warning"):e(".k-upload-status",i).prepend("<span class='k-icon k-warning'></span>"),this._updateHeaderUploadStatus(),this._fileAction(i,"retry"),this.trigger(F,{operation:"upload",files:i.data("fileNames"),XMLHttpRequest:n}),w("Server response: "+n.responseText),this._checkAllComplete()},_showUploadButton:function(){var t=e(".k-upload-selected",this.wrapper);0===t.length&&(t=this._renderAction("",this.localization.uploadSelectedFiles).addClass("k-upload-selected")),this.wrapper.append(t)},_hideUploadButton:function(){e(".k-upload-selected",this.wrapper).remove()},_showHeaderUploadStatus:function(){var t=this.localization,n=e(".k-dropzone",this.wrapper),i=e(".k-upload-status-total",this.wrapper);0!==i.length&&i.remove(),i='<strong class="k-upload-status k-upload-status-total">'+t.headerStatusUploading+'<span class="k-icon k-loading">'+t.statusUploading+"</span></strong>",n.length>0?n.append(i):e(".k-upload-button",this.wrapper).after(i)},_updateHeaderUploadStatus:function(){var t,n,i,r=this,o=r.localization,a=e(".k-file",r.wrapper).not(".k-file-success, .k-file-error");0===a.length&&(t=e(".k-file.k-file-error",r.wrapper),n=e(".k-upload-status-total",r.wrapper),i=e(".k-icon",n).removeClass("k-loading").addClass(0!==t.length?"k-warning":"k-i-tick").text(0!==t.length?o.statusWarning:o.statusUploaded),n.text(r.localization.headerStatusUploaded).append(i))},_hideHeaderUploadstatus:function(){e(".k-upload-status-total",this.wrapper).remove()},_onParentFormSubmit:function(){var n,i=this,r=i.element;t!==this._module.onAbort&&this._module.onAbort(),r.value||(n=e(r),n.attr("disabled","disabled"),window.setTimeout(function(){n.removeAttr("disabled")},0))},_onParentFormReset:function(){e(".k-upload-files",this.wrapper).remove()},_supportsFormData:function(){return"undefined"!=typeof FormData},_supportsMultiple:function(){var e=this._userAgent().indexOf("Windows")>-1;return!(k.support.browser.opera||k.support.browser.safari&&e)},_supportsDrop:function(){var e=this._userAgent().toLowerCase(),t=/chrome/.test(e),n=!t&&/safari/.test(e),i=n&&/windows/.test(e);return!i&&this._supportsFormData()&&this.options.async.saveUrl},_userAgent:function(){return navigator.userAgent},_setupDropZone:function(){var t,n,i=this;e(".k-upload-button",this.wrapper).wrap("<div class='k-dropzone'></div>"),t=i._ns,n=e(".k-dropzone",i.wrapper).append(e("<em>"+i.localization.dropFilesHere+"</em>")).on("dragenter"+t,p).on("dragover"+t,function(e){e.preventDefault()}).on("drop"+t,e.proxy(this._onDrop,this)),f(n,t,function(){n.addClass("k-dropzone-hovered")},function(){n.removeClass("k-dropzone-hovered")}),f(e(document),t,function(){n.addClass("k-dropzone-active"),n.closest(".k-upload").removeClass("k-upload-empty")},function(){n.removeClass("k-dropzone-active"),0===e("li.k-file",n.closest(".k-upload")).length&&n.closest(".k-upload").addClass("k-upload-empty")})},_supportsRemove:function(){return!!this.options.async.removeUrl},_submitRemove:function(t,n,i,r){var o=this,a=o.options.async.removeField||"fileNames",s=e.extend(n,m());s[a]=t,jQuery.ajax({type:this.options.async.removeVerb,dataType:"json",dataFilter:u,url:this.options.async.removeUrl,traditional:!0,data:s,success:i,error:r})},_wrapInput:function(e){var t=this,n=t.options;return e.wrap("<div class='k-widget k-upload k-header'><div class='k-button k-upload-button'></div></div>"),n.async.saveUrl||e.closest(".k-upload").addClass("k-upload-sync"),e.closest(".k-upload").addClass("k-upload-empty"),e.closest(".k-button").append("<span>"+this.localization.select+"</span>"),e.closest(".k-upload")},_checkAllComplete:function(){0===e(".k-file.k-file-progress",this.wrapper).length&&this.trigger(D)},_inputFiles:function(e){return i(e)}}),A=function(e){this.name="syncUploadModule",this.element=e.wrapper,this.upload=e,this.element.closest("form").attr("enctype","multipart/form-data").attr("encoding","multipart/form-data")};A.prototype={onSelect:function(t,i){var r,o=this.upload,a=e(t.target);o._addInput(a),r=o._enqueueFile(n(a),{relatedInput:a,fileNames:i}),o._fileAction(r,M)},onRemove:function(e){var t=g(e);t.data("relatedInput").remove(),this.upload._removeFileEntry(t)}},v=function(e){this.name="iframeUploadModule",this.element=e.wrapper,this.upload=e,this.iframes=[]},z._frameId=0,v.prototype={onSelect:function(t,n){var i=this.upload,r=e(t.target),o=this.prepareUpload(r,n);i.options.async.autoUpload?this.performUpload(o):(i._supportsRemove()&&this.upload._fileAction(o,M),i._showUploadButton())},prepareUpload:function(t,i){var r,o,a,s=this.upload,l=e(s.element),d=s.options.async.saveField||t.attr("name");return s._addInput(t),t.attr("name",d),r=this.createFrame(s.name+"_"+z._frameId++),this.registerFrame(r),o=this.createForm(s.options.async.saveUrl,r.attr("name")).append(l),a=s._enqueueFile(n(t),{frame:r,relatedInput:l,fileNames:i}),r.data({form:o,file:a}),a},performUpload:function(t){var n,i,r,o={files:t.data("fileNames")},a=t.data("frame"),s=this.upload;if(s.trigger(T,o))s._removeFileEntry(a.data("file")),this.cleanupFrame(a),this.unregisterFrame(a);
else{s._hideUploadButton(),s._showHeaderUploadStatus(),a.appendTo(document.body),n=a.data("form").attr("action",s.options.async.saveUrl).appendTo(document.body),o.data=e.extend({},o.data,m());for(i in o.data)r=n.find("input[name='"+i+"']"),0===r.length&&(r=e("<input>",{type:"hidden",name:i}).prependTo(n)),r.val(o.data[i]);s._fileAction(t,H),s._fileState(t,"uploading"),e(t).removeClass("k-file-error").addClass("k-file-progress"),a.one("load",e.proxy(this.onIframeLoad,this)),n[0].submit()}},onSaveSelected:function(){var t=this;e(".k-file",this.element).each(function(){var n=e(this),i=h(n);i||t.performUpload(n)})},onIframeLoad:function(t){var n,i=e(t.target);try{n=i.contents().text()}catch(r){n="Error trying to get server response: "+r}this.processResponse(i,n)},processResponse:function(t,n){var i=t.data("file"),r=this,o={responseText:n};c(n,function(n){e.extend(o,{statusText:"OK",status:"200"}),r.upload._onFileProgress({target:e(i,r.upload.wrapper)},100),r.upload._onUploadSuccess({target:e(i,r.upload.wrapper)},n,o),r.cleanupFrame(t),r.unregisterFrame(t)},function(){e.extend(o,{statusText:"error",status:"500"}),r.upload._onUploadError({target:e(i,r.upload.wrapper)},o)})},onCancel:function(t){var n=e(t.target).data("frame");this.stopFrameSubmit(n),this.cleanupFrame(n),this.unregisterFrame(n),this.upload._removeFileEntry(n.data("file"))},onRetry:function(e){var t=g(e);this.performUpload(t)},onRemove:function(e,t){var n=g(e),i=n.data("frame");i?(this.unregisterFrame(i),this.upload._removeFileEntry(n),this.cleanupFrame(i)):d(n,this.upload,t)},onAbort:function(){var t=this.element,n=this;e.each(this.iframes,function(){e("input",this.data("form")).appendTo(t),n.stopFrameSubmit(this[0]),this.data("form").remove(),this.remove()}),this.iframes=[]},createFrame:function(t){return e("<iframe name='"+t+"' id='"+t+"' style='display:none;' />")},createForm:function(t,n){return e("<form enctype='multipart/form-data' method='POST' action='"+t+"' target='"+n+"'/>")},stopFrameSubmit:function(e){t!==e.stop?e.stop():e.document&&e.document.execCommand("Stop")},registerFrame:function(e){this.iframes.push(e)},unregisterFrame:function(t){this.iframes=e.grep(this.iframes,function(e){return e.attr("name")!=t.attr("name")})},cleanupFrame:function(e){var t=e.data("form");e.data("file").data("frame",null),setTimeout(function(){t.remove(),e.remove()},1)}},_=function(e){this.name="formDataUploadModule",this.element=e.wrapper,this.upload=e},_.prototype={onSelect:function(t,n){var i=this.upload,r=this,o=e(t.target),a=this.prepareUpload(o,n);e.each(a,function(){i.options.async.autoUpload?r.performUpload(this):(i._supportsRemove()&&i._fileAction(this,M),i._showUploadButton())})},prepareUpload:function(t,n){var i=this.enqueueFiles(n);return t.is("input")&&(e.each(i,function(){e(this).data("relatedInput",t)}),t.data("relatedFileEntries",i),this.upload._addInput(t)),i},enqueueFiles:function(t){var n,i,r,o,a=this.upload,s=t.length,l=[];if(a.options.async.batch===!0)n=e.map(t,function(e){return e.name}).join(", "),o=a._enqueueFile(n,{fileNames:t}),o.data("files",t),l.push(o);else for(i=0;s>i;i++)r=t[i],n=r.name,o=a._enqueueFile(n,{fileNames:[r]}),o.data("files",[r]),l.push(o);return l},performUpload:function(t){var n,i=this.upload,r=this.createFormData(),o=this.createXHR(),a={files:t.data("fileNames"),XMLHttpRequest:o};if(i.trigger(T,a))this.removeFileEntry(t);else{i._fileAction(t,H),i._hideUploadButton(),i._showHeaderUploadStatus(),a.data=e.extend({},a.data,m());for(n in a.data)r.append(n,a.data[n]);this.populateFormData(r,t.data("files")),i._fileState(t,"uploading"),e(t).removeClass("k-file-error").addClass("k-file-progress"),this.postFormData(i.options.async.saveUrl,r,t,o)}},onSaveSelected:function(){var t=this;e(".k-file",this.element).each(function(){var n=e(this),i=h(n);i||t.performUpload(n)})},onCancel:function(e){var t=g(e);this.stopUploadRequest(t),this.removeFileEntry(t)},onRetry:function(e){var t=g(e);this.performUpload(t)},onRemove:function(e,t){var n=g(e);n.hasClass("k-file-success")?d(n,this.upload,t):this.removeFileEntry(n)},createXHR:function(){return new XMLHttpRequest},postFormData:function(e,t,n,i){var r=this;n.data("request",i),i.addEventListener("load",function(e){r.onRequestSuccess.call(r,e,n)},!1),i.addEventListener(F,function(e){r.onRequestError.call(r,e,n)},!1),i.upload.addEventListener("progress",function(e){r.onRequestProgress.call(r,e,n)},!1),i.open("POST",e,!0),i.withCredentials=this.upload.options.async.withCredentials,i.send(t)},createFormData:function(){return new FormData},populateFormData:function(e,t){var n,i=this.upload,r=t.length;for(n=0;r>n;n++)e.append(i.options.async.saveField||i.name,t[n].rawFile);return e},onRequestSuccess:function(t,n){function i(){o.upload._onUploadError({target:e(n,o.upload.wrapper)},r)}var r=t.target,o=this;r.status>=200&&299>=r.status?c(r.responseText,function(t){o.upload._onFileProgress({target:e(n,o.upload.wrapper)},100),o.upload._onUploadSuccess({target:e(n,o.upload.wrapper)},t,r),o.cleanupFileEntry(n)},i):i()},onRequestError:function(t,n){var i=t.target;this.upload._onUploadError({target:e(n,this.upload.wrapper)},i)},cleanupFileEntry:function(t){var n=t.data("relatedInput"),i=!0;n&&(e.each(n.data("relatedFileEntries")||[],function(){this.parent().length>0&&this[0]!=t[0]&&(i=i&&this.hasClass("k-file-success"))}),i&&n.remove())},removeFileEntry:function(e){this.cleanupFileEntry(e),this.upload._removeFileEntry(e)},onRequestProgress:function(t,n){var i=Math.round(100*t.loaded/t.total);this.upload._onFileProgress({target:e(n,this.upload.wrapper)},i)},stopUploadRequest:function(e){e.data("request").abort()}},k.ui.plugin(z)})(window.kendo.jQuery);(function(e,t){function n(e,t,n){var i,r;e.on("dragenter"+x,function(){t(),r=new Date,i||(i=setInterval(function(){var e=new Date-r;e>100&&(n(),clearInterval(i),i=null)},100))}).on("dragover"+x,function(){r=new Date})}function i(e,n){return e!==t&&e.match(/\/$/)||(e=(e||"")+"/"),e+n}function r(e){if(!e)return"";var t=" bytes";return e>=1073741824?(t=" GB",e/=1073741824):e>=1048576?(t=" MB",e/=1048576):e>=1024&&(t=" KB",e/=1024),Math.round(100*e)/100+t}function o(e,t){var n=e[t];return p(n)?n.from||n.field||t:n}var a,s,l,d,c=window.kendo,u=c.ui.Widget,p=e.isPlainObject,f=e.proxy,h=e.extend,g=c.support.placeholder,m=c.support.browser,v=c.isFunction,_=/(^\/|\/$)/g,k="change",b="apply",w="error",y="click",x=".kendoImageBrowser",C=".kendoBreadcrumbs",T=".kendoSearchBox",S="name",F="size",D="type",H={field:D,dir:"asc"},E=c.template('<li class="k-tile-empty"><strong>${text}</strong></li>'),M='<div class="k-widget k-toolbar k-header k-floatwrap"><div class="k-toolbar-wrap"># if (showUpload) { # <div class="k-widget k-upload"><div class="k-button k-button-icontext k-upload-button"><span class="k-icon k-add"></span>#=messages.uploadFile#<input type="file" name="file" /></div></div># } ## if (showCreate) { #<button type="button" class="k-button k-button-icon"><span class="k-icon k-addfolder" /></button># } ## if (showDelete) { #<button type="button" class="k-button k-button-icon k-state-disabled"><span class="k-icon k-delete" /></button>&nbsp;# } #</div><div class="k-tiles-arrange"><label>#=messages.orderBy#: <select /></label></a></div></div>';h(!0,c.data,{schemas:{imagebrowser:{data:function(e){return e.items||e||[]},model:{id:"name",fields:{name:"name",size:"size",type:"type"}}}}}),h(!0,c.data,{transports:{imagebrowser:c.data.RemoteTransport.extend({init:function(t){c.data.RemoteTransport.fn.init.call(this,e.extend(!0,{},this.options,t))},_call:function(t,n){n.data=e.extend({},n.data,{path:this.options.path()}),v(this.options[t])?this.options[t].call(this,n):c.data.RemoteTransport.fn[t].call(this,n)},read:function(e){this._call("read",e)},create:function(e){this._call("create",e)},destroy:function(e){this._call("destroy",e)},update:function(){},options:{read:{type:"POST"},update:{type:"POST"},create:{type:"POST"},destroy:{type:"POST"}}})}}),a=m.msie&&8>m.version?function(e){return e.offsetTop}:function(t){return t.offsetTop-e(t).height()},s=u.extend({init:function(e,t){var n=this;t=t||{},u.fn.init.call(n,e,t),n.element.addClass("k-imagebrowser"),n.element.on(y+x,".k-toolbar button:not(.k-state-disabled):has(.k-delete)",f(n._deleteClick,n)).on(y+x,".k-toolbar button:not(.k-state-disabled):has(.k-addfolder)",f(n._addClick,n)).on("keydown"+x,"li.k-state-selected input",f(n._directoryKeyDown,n)).on("blur"+x,"li.k-state-selected input",f(n._directoryBlur,n)),n._dataSource(),n.refresh(),n.path(n.options.path)},options:{name:"ImageBrowser",messages:{uploadFile:"Upload",orderBy:"Arrange by",orderByName:"Name",orderBySize:"Size",directoryNotFound:"A directory with this name was not found.",emptyFolder:"Empty Folder",deleteFile:'Are you sure you want to delete "{0}"?',invalidFileType:'The selected file "{0}" is not valid. Supported file types are {1}.',overwriteFile:'A file with name "{0}" already exists in the current directory. Do you want to overwrite it?',dropFilesHere:"drop file here to upload",search:"Search"},transport:{},path:"/",fileTypes:"*.png,*.gif,*.jpg,*.jpeg"},events:[w,k,b],destroy:function(){var e=this;u.fn.destroy.call(e),e.dataSource.unbind(w,e._errorHandler),e.element.add(e.list).add(e.toolbar).off(x),c.destroy(e.element)},value:function(){var e,n=this,r=n._selectedItem(),o=n.options.transport.imageUrl;return r&&"f"===r.get(D)?(e=i(n.path(),r.get(S)).replace(_,""),o&&(e=v(o)?o(e):c.format(o,encodeURIComponent(e))),e):t},_selectedItem:function(){var e=this.listView,n=e.select();return n.length?this.dataSource.getByUid(n.attr(c.attr("uid"))):t},_toolbar:function(){var t=this,n=c.template(M),i=t.options.messages,r=[{text:i.orderByName,value:"name"},{text:i.orderBySize,value:"size"}];t.toolbar=e(n({messages:i,showUpload:t.options.transport.uploadUrl,showCreate:t.options.transport.create,showDelete:t.options.transport.destroy})).appendTo(t.element).find(".k-upload input").kendoUpload({multiple:!1,localization:{dropFilesHere:i.dropFilesHere},async:{saveUrl:t.options.transport.uploadUrl,autoUpload:!0},upload:f(t._fileUpload,t),error:function(e){t._error({xhr:e.XMLHttpRequest,status:"error"})}}).end(),t.upload=t.toolbar.find(".k-upload input").data("kendoUpload"),t.arrangeBy=t.toolbar.find(".k-tiles-arrange select").kendoDropDownList({dataSource:r,dataTextField:"text",dataValueField:"value",change:function(){t.orderBy(this.value())}}).data("kendoDropDownList"),t._attachDropzoneEvents()},_attachDropzoneEvents:function(){var t=this;t.options.transport.uploadUrl&&(n(e(document.documentElement),e.proxy(t._dropEnter,t),e.proxy(t._dropLeave,t)),t._scrollHandler=f(t._positionDropzone,t))},_dropEnter:function(){this._positionDropzone(),e(document).on("scroll"+x,this._scrollHandler)},_dropLeave:function(){this._removeDropzone(),e(document).off("scroll"+x,this._scrollHandler)},_positionDropzone:function(){var e=this,t=e.element,n=t.offset();e.toolbar.find(".k-dropzone").addClass("k-imagebrowser-dropzone").offset(n).css({width:t[0].clientWidth,height:t[0].clientHeight,lineHeight:t[0].clientHeight+"px"})},_removeDropzone:function(){this.toolbar.find(".k-dropzone").removeClass("k-imagebrowser-dropzone").css({width:"",height:"",lineHeight:"",top:"",left:""})},_deleteClick:function(){var e=this,t=e.listView.select(),n=c.format(e.options.messages.deleteFile,t.find("strong").text());t.length&&e._showMessage(n,"confirm")&&e.listView.remove(t)},_addClick:function(){this.createDirectory()},_getFieldName:function(e){return o(this.dataSource.reader.model.fields,e)},_fileUpload:function(e){var t,n=this,i=n.options,r=i.fileTypes,o=RegExp(("("+r.split(",").join(")|(")+")").replace(/\*\./g,".*."),"i"),a=e.files[0].name,s=S,l=F;o.test(a)?(e.data={path:n.path()},t=n._createFile(a),t?n.upload.one("success",function(e){t.set(s,e.response[n._getFieldName(s)]),t.set(l,e.response[n._getFieldName(l)]),n._tiles=n.listView.items().filter("["+c.attr("type")+"=f]"),n._scroll()}):e.preventDefault()):(e.preventDefault(),n._showMessage(c.format(i.messages.invalidFileType,a,r)))},_findFile:function(e){var t,n,i,r=this.dataSource.data(),o=D,a=S;for(e=e.toLowerCase(),t=0,i=r.length;i>t;t++)if("f"===r[t].get(o)&&r[t].get(a).toLowerCase()===e){n=r[t];break}return n},_createFile:function(e){var t,n,i=this,r=0,o={},a=D,s=i.dataSource.view(),l=i._findFile(e);if(l&&!i._showMessage(c.format(i.options.messages.overwriteFile,e),"confirm"))return null;if(l)return l;for(t=0,n=s.length;n>t;t++)if("f"===s[t].get(a)){r=t;break}return o[a]="f",o[S]=e,o[F]=0,i.dataSource.insert(++r,o)},createDirectory:function(){var e,t,n=this,i=0,r=D,o=S,a=n.dataSource.data(),s=n._nameDirectory(),l=new n.dataSource.reader.model;for(e=0,t=a.length;t>e;e++)"d"===a[e].get(r)&&(i=e);l.set(r,"d"),l.set(o,s),n.listView.one("dataBound",function(){var e=n.listView.items().filter("["+c.attr("uid")+"="+l.uid+"]"),t=e.find("input");e.length&&this.edit(e),this.element.scrollTop(e.attr("offsetTop")-this.element[0].offsetHeight),setTimeout(function(){t.select()})}).one("save",function(e){var t=e.model.get(o);t?e.model.set(o,n._nameExists(t,l.uid)?n._nameDirectory():t):e.model.set(o,s)}),n.dataSource.insert(++i,l)},_directoryKeyDown:function(e){13==e.keyCode&&e.currentTarget.blur()},_directoryBlur:function(){this.listView.save()},_nameExists:function(e,t){var n,i,r=this.dataSource.data(),o=D,a=S;for(n=0,i=r.length;i>n;n++)if("d"===r[n].get(o)&&r[n].get(a).toLowerCase()===e.toLowerCase()&&r[n].uid!==t)return!0;return!1},_nameDirectory:function(){var t,n,i,r="New folder",o=this.dataSource.data(),a=[],s=D,l=S;for(n=0,i=o.length;i>n;n++)"d"===o[n].get(s)&&o[n].get(l).toLowerCase().indexOf(r.toLowerCase())>-1&&a.push(o[n].get(l));if(e.inArray(r,a)>-1){n=2;do t=r+" ("+n+")",n++;while(e.inArray(t,a)>-1);r=t}return r},orderBy:function(e){this.dataSource.sort([{field:D,dir:"asc"},{field:e,dir:"asc"}])},search:function(e){this.dataSource.filter({field:S,operator:"contains",value:e})},_content:function(){var t=this;t.list=e('<ul class="k-reset k-floats k-tiles" />').appendTo(t.element).on("scroll"+x,f(t._scroll,t)).on("dblclick"+x,"li",f(t._dblClick,t)),t.listView=new c.ui.ListView(t.list,{dataSource:t.dataSource,template:t._itemTmpl(),editTemplate:t._editTmpl(),selectable:!0,autoBind:!1,dataBinding:function(e){t.toolbar.find(".k-delete").parent().addClass("k-state-disabled"),("remove"===e.action||"sync"===e.action)&&e.preventDefault()},dataBound:function(){t.dataSource.view().length?(t._tiles=this.items().filter("["+c.attr("type")+"=f]"),t._scroll()):this.wrapper.append(E({text:t.options.messages.emptyFolder}))},change:f(t._listViewChange,t)})},_dblClick:function(t){var n,r=this,o=e(t.currentTarget);o.hasClass("k-edit-item")&&r._directoryBlur(),o.filter("["+c.attr("type")+"=d]").length?(n=r.dataSource.getByUid(o.attr(c.attr("uid"))),n&&(r.path(i(r.path(),n.get(S))),r.breadcrumbs.value(r.path()))):o.filter("["+c.attr("type")+"=f]").length&&r.trigger(b)},_listViewChange:function(){var e=this._selectedItem();e&&(this.toolbar.find(".k-delete").parent().removeClass("k-state-disabled"),"f"===e.get(D)&&this.trigger(k))},_dataSource:function(){var e,t=this,n=t.options,i=n.transport,r=h({},H),o={field:S,dir:"asc"},a={type:i.type||"imagebrowser",sort:[r,o]};p(i)&&(i.path=f(t.path,t),a.transport=i),p(n.schema)?a.schema=n.schema:i.type&&p(c.data.schemas[i.type])&&(e=c.data.schemas[i.type]),t.dataSource&&t._errorHandler?t.dataSource.unbind(w,t._errorHandler):t._errorHandler=f(t._error,t),t.dataSource=c.data.DataSource.create(a).bind(w,t._errorHandler)},_navigation:function(){var t=this,n=e('<div class="k-floatwrap"><input/><input/></div>').appendTo(this.element);t.breadcrumbs=n.find("input:first").kendoBreadcrumbs({value:t.options.path,change:function(){t.path(this.value())}}).data("kendoBreadcrumbs"),t.searchBox=n.parent().find("input:last").kendoSearchBox({label:t.options.messages.search,change:function(){t.search(this.value())}}).data("kendoSearchBox")},_error:function(e){var t,n=this;n.trigger(w,e)||(t=e.xhr.status,"error"==e.status?"404"==t?n._showMessage(n.options.messages.directoryNotFound):"0"!=t&&n._showMessage("Error! The requested URL returned "+t+" - "+e.xhr.statusText):"timeout"==t&&n._showMessage("Error! Server timeout."))},_showMessage:function(e,t){return window[t||"alert"](e)},refresh:function(){var e=this;e._navigation(),e._toolbar(),e._content()},_loadImage:function(t){var n=this,i=e(t),r=n.dataSource.getByUid(i.attr(c.attr("uid"))),o=r.get(S),a=n.options.transport.thumbnailUrl,s=e("<img />",{alt:o}),l="?";s.hide().on("load"+x,function(){e(this).prev().remove().end().addClass("k-image").fadeIn()}),i.find(".k-loading").after(s),v(a)?a=a(n.path(),encodeURIComponent(o)):(a.indexOf("?")>=0&&(l="&"),a=a+l+"path="+n.path()+encodeURIComponent(o)),s.attr("src",a),t.loaded=!0},_scroll:function(){var e=this;e.options.transport&&e.options.transport.thumbnailUrl&&(clearTimeout(e._timeout),e._timeout=setTimeout(function(){var n=e.list.outerHeight(),i=e.list.scrollTop(),r=i+n;e._tiles.each(function(){var n=a(this),o=n+this.offsetHeight;return(n>=i&&r>n||o>=i&&r>o)&&e._loadImage(this),n>r?!1:t}),e._tiles=e._tiles.filter(function(){return!this.loaded})},250))},_editTmpl:function(){var e='<li class="k-tile k-state-selected" '+c.attr("uid")+'="#=uid#" ';return e+=c.attr("type")+'="${'+D+'}">',e+="#if("+D+' == "d") { #',e+='<div class="k-thumb"><span class="k-icon k-folder"></span></div>',e+="#}else{#",e+='<div class="k-thumb"><span class="k-icon k-loading"></span></div>',e+="#}#",e+="#if("+D+' == "d") { #',e+='<input class="k-input" '+c.attr("bind")+'="value:'+S+'"/>',e+="#}#",e+="</li>",f(c.template(e),{sizeFormatter:r})},_itemTmpl:function(){var e=this,t='<li class="k-tile" '+c.attr("uid")+'="#=uid#" ';return t+=c.attr("type")+'="${'+D+'}">',t+="#if("+D+' == "d") { #',t+='<div class="k-thumb"><span class="k-icon k-folder"></span></div>',t+="#}else{#",t+=e.options.transport&&e.options.transport.thumbnailUrl?'<div class="k-thumb"><span class="k-icon k-loading"></span></div>':'<div class="k-thumb"><span class="k-icon k-file"></span></div>',t+="#}#",t+="<strong>${"+S+"}</strong>",t+="#if("+D+' == "f") { # <span class="k-filesize">${this.sizeFormatter('+F+")}</span> #}#",t+="</li>",f(c.template(t),{sizeFormatter:r})},path:function(e){var n=this,i=n._path||"";return e!==t?(n._path=e.replace(_,"")+"/",n.dataSource.read({path:n._path}),t):(i&&(i=i.replace(_,"")),"/"===i||""===i?"":i+"/")}}),l=u.extend({init:function(e,t){var n=this;t=t||{},u.fn.init.call(n,e,t),g&&n.element.attr("placeholder",n.options.label),n._wrapper(),n.element.on("keydown"+T,f(n._keydown,n)).on("change"+T,f(n._updateValue,n)),n.wrapper.on(y+T,"a",f(n._click,n)),g||n.element.on("focus"+T,f(n._focus,n)).on("blur"+T,f(n._blur,n))},options:{name:"SearchBox",label:"Search",value:""},events:[k],destroy:function(){var e=this;e.wrapper.add(e.element).add(e.label).off(T),u.fn.destroy.call(e)},_keydown:function(e){13===e.keyCode&&this._updateValue()},_click:function(e){e.preventDefault(),this._updateValue()},_updateValue:function(){var e=this,t=e.element.val();t!==e.value()&&(e.value(t),e.trigger(k))},_blur:function(){this._updateValue(),this._toggleLabel()},_toggleLabel:function(){g||this.label.toggle(!this.element.val())},_focus:function(){this.label.hide()},_wrapper:function(){var t=this.element,n=t.parents(".k-search-wrap");t[0].style.width="",t.addClass("k-input"),n.length||(n=t.wrap(e('<div class="k-widget k-search-wrap k-textbox"/>')).parent(),g||e('<label style="display:block">'+this.options.label+"</label>").insertBefore(t),e('<a href="#" class="k-icon k-i-search k-search"/>').appendTo(n)),this.wrapper=n,this.label=n.find(">label")},value:function(e){var n=this;return e!==t?(n.options.value=e,n.element.val(e),n._toggleLabel(),t):n.options.value}}),d=u.extend({init:function(e,t){var n=this;t=t||{},u.fn.init.call(n,e,t),n._wrapper(),n.wrapper.on("focus"+C,"input",f(n._focus,n)).on("blur"+C,"input",f(n._blur,n)).on("keydown"+C,"input",f(n._keydown,n)).on(y+C,"a.k-i-arrow-n:first",f(n._rootClick,n)).on(y+C,"a:not(.k-i-arrow-n)",f(n._click,n)),n.value(n.options.value)},options:{name:"Breadcrumbs",gap:50},events:[k],destroy:function(){var e=this;u.fn.destroy.call(e),e.wrapper.add(e.wrapper.find("input")).add(e.wrapper.find("a")).off(C)},_update:function(e){e="/"===(e||"").charAt(0)?e:"/"+(e||""),e!==this.value()&&(this.value(e),this.trigger(k))},_click:function(t){t.preventDefault(),this._update(this._path(e(t.target).prevAll("a:not(.k-i-arrow-n)").addBack()))},_rootClick:function(e){e.preventDefault(),this._update("")},_focus:function(){var e=this,t=e.element;e.overlay.hide(),e.element.val(e.value()),setTimeout(function(){t.select()})},_blur:function(){if(!this.overlay.is(":visible")){var e=this,t=e.element,n=t.val().replace(/\/{2,}/g,"/");e.overlay.show(),t.val(""),e._update(n)}},_keydown:function(e){var t=this;13===e.keyCode&&(t._blur(),setTimeout(function(){t.overlay.find("a:first").focus()}))},_wrapper:function(){var t,n=this.element,i=n.parents(".k-breadcrumbs");n[0].style.width="",n.addClass("k-input"),i.length||(i=n.wrap(e('<div class="k-widget k-breadcrumbs k-textbox"/>')).parent()),t=i.find(".k-breadcrumbs-wrap"),t.length||(t=e('<div class="k-breadcrumbs-wrap"/>').appendTo(i)),this.wrapper=i,this.overlay=t},refresh:function(){var n,i,r,o,a="",s=this.value();for(s!==t&&s.match(/^\//)||(s="/"+(s||"")),n=s.split("/"),r=0,o=n.length;o>r;r++)i=n[r],i&&(a||(a+='<a href="#" class="k-icon k-i-arrow-n">root</a>'),a+='<a class="k-link" href="#">'+n[r]+"</a>",a+='<span class="k-icon k-i-arrow-e">&gt;</span>');this.overlay.empty().append(e(a)),this._adjustSectionWidth()},_adjustSectionWidth:function(){var t,n=this,i=n.wrapper,r=i.width()-n.options.gap,o=n.overlay.find("a");o.each(function(n){t=e(this),t.parent().width()>r&&(n==o.length-1?t.width(r):t.prev().addBack().hide())})},value:function(e){return e!==t?(this._value=e.replace(/\/{2,}/g,"/"),this.refresh(),t):this._value},_path:function(t){return"/"+e.map(t,function(t){return e(t).text()}).join("/")}}),c.ui.plugin(s),c.ui.plugin(d),c.ui.plugin(l)})(window.kendo.jQuery);(function(){return function(e,t){var n,i,o,r=window.kendo,a=r.Class,s=r.ui.Widget,l=r.support.mobileOS,d=r.support.browser,c=e.extend,u=e.proxy,p=r.deepExtend,f=".kendoEditor",h=r.keys,g=a.extend({init:function(e){this.options=e},getHtml:function(){var e=this.options;return r.template(e.template,{useWithBlock:!1})(e)}}),m={editorWrapperTemplate:'<table cellspacing="4" cellpadding="0" class="k-widget k-editor k-header" role="presentation"><tbody><tr role="presentation"><td class="k-editor-toolbar-wrap" role="presentation"><ul class="k-editor-toolbar" role="toolbar" /></td></tr><tr><td class="k-editable-area" /></tr></tbody></table>',buttonTemplate:'<a href="" role="button" class="k-tool"#= data.popup ? " data-popup" : "" # unselectable="on" title="#= data.title #"><span class="k-tool-icon #= data.cssClass #">#= data.title #</span></a>',colorPickerTemplate:'<div class="k-colorpicker #= data.cssClass #" />',comboBoxTemplate:'<select title="#= data.title #" class="#= data.cssClass #" />',dropDownListTemplate:'<span class="k-editor-dropdown"><select title="#= data.title #" class="#= data.cssClass #" /></span>',separatorTemplate:'<span class="k-separator" />',formatByName:function(t,n){for(var i=0;n.length>i;i++)if(e.inArray(t,n[i].tags)>=0)return n[i]},registerTool:function(e,t){var n=t.options;n&&n.template&&(n.template.options.cssClass="k-"+e),t.name||(t.options.name=e,t.name=e.toLowerCase()),b.defaultTools[e]=t},registerFormat:function(e,t){b.fn.options.formats[e]=t}},v={bold:"Bold",italic:"Italic",underline:"Underline",strikethrough:"Strikethrough",superscript:"Superscript",subscript:"Subscript",justifyCenter:"Center text",justifyLeft:"Align text left",justifyRight:"Align text right",justifyFull:"Justify",insertUnorderedList:"Insert unordered list",insertOrderedList:"Insert ordered list",indent:"Indent",outdent:"Outdent",createLink:"Insert hyperlink",unlink:"Remove hyperlink",insertImage:"Insert image",insertHtml:"Insert HTML",viewHtml:"View HTML",fontName:"Select font family",fontNameInherit:"(inherited font)",fontSize:"Select font size",fontSizeInherit:"(inherited size)",formatBlock:"Format",formatting:"Format",foreColor:"Color",backColor:"Background color",style:"Styles",emptyFolder:"Empty Folder",uploadFile:"Upload",orderBy:"Arrange by:",orderBySize:"Size",orderByName:"Name",invalidFileType:'The selected file "{0}" is not valid. Supported file types are {1}.',deleteFile:'Are you sure you want to delete "{0}"?',overwriteFile:'A file with name "{0}" already exists in the current directory. Do you want to overwrite it?',directoryNotFound:"A directory with this name was not found.",imageWebAddress:"Web address",imageAltText:"Alternate text",imageWidth:"Width (px)",imageHeight:"Height (px)",linkWebAddress:"Web address",linkText:"Text",linkToolTip:"ToolTip",linkOpenInNewWindow:"Open link in new window",dialogUpdate:"Update",dialogInsert:"Insert",dialogButtonSeparator:"or",dialogCancel:"Cancel",createTable:"Create table",addColumnLeft:"Add column on the left",addColumnRight:"Add column on the right",addRowAbove:"Add row above",addRowBelow:"Add row below",deleteRow:"Delete row",deleteColumn:"Delete column"},_=!l||l.ios&&l.flatVersion>=500||!l.ios&&t!==document.documentElement.contentEditable,k={basic:["bold","italic","underline"],alignment:["justifyLeft","justifyCenter","justifyRight"],lists:["insertUnorderedList","insertOrderedList"],indenting:["indent","outdent"],links:["createLink","unlink"],tables:["createTable","addColumnLeft","addColumnRight","addRowAbove","addRowBelow","deleteRow","deleteColumn"]},b=s.extend({init:function(t,n){var i,o,a,l,d=this,h=r.ui.editor;_&&(s.fn.init.call(d,t,n),d.options=p({},d.options,n),t=d.element,l=h.Dom.name(t[0]),t.closest("form").on("submit"+f,function(){d.update()}),a=c({},d.options),a.editor=d,"textarea"==l?(d._wrapTextarea(),o=d.wrapper.find(".k-editor-toolbar"),t[0].id&&o.attr("aria-controls",t[0].id)):(d.element.attr("contenteditable",!0).addClass("k-widget k-editor k-editor-inline"),a.popup=!0,o=e('<ul class="k-editor-toolbar" role="toolbar" />').insertBefore(t)),d.toolbar=new h.Toolbar(o[0],a),d.toolbar.bindTo(d),d._initializeContentElement(d),d.keyboard=new h.Keyboard([new h.TypingHandler(d),new h.SystemHandler(d)]),d.clipboard=new h.Clipboard(this),d.undoRedoStack=new h.UndoRedoStack,i=n&&n.value?n.value:d.textarea?t.val().replace(/[\r\n\v\f\t ]+/gi," "):t[0].innerHTML,d.value(i),e(document).on("mousedown",u(d._endTyping,d)).on("mouseup",u(d._mouseup,d)),r.notify(d))},_endTyping:function(){var e=this.keyboard;try{e.isTypingInProgress()&&(e.endTyping(!0),this.saveSelection())}catch(t){}},_selectionChange:function(){d.msie||r.ui.editor.Dom.ensureTrailingBreaks(this.body),this._selectionStarted=!1,this.saveSelection(),this.trigger("select",{})},_wrapTextarea:function(){var t=this,n=t.element,i=n[0].style.width,o=n[0].style.height,r=m.editorWrapperTemplate,a=e(r).insertBefore(n).width(i).height(o),s=a.find(".k-editable-area");n.attr("autocomplete","off").appendTo(s).addClass("k-content k-raw-content").css("display","none"),t.textarea=n,t.wrapper=a},_createContentElement:function(t){var n,i,o,a=this,s=a.textarea,l=a.options.domain,d=l||document.domain,c="",u='javascript:""';return(l||d!=location.hostname)&&(c='<script>document.domain="'+d+'"</script>',u="javascript:document.write('"+c+"')"),s.hide(),n=e("<iframe />",{frameBorder:"0"})[0],e(n).css("display","").addClass("k-content").insertBefore(s),n.src=u,i=n.contentWindow||n,o=i.document||n.contentDocument,e(n).one("load",function(){a.toolbar.decorateFrom(o.body)}),o.open(),o.write("<!DOCTYPE html><html><head><meta charset='utf-8' /><style>html,body{padding:0;margin:0;height:100%;min-height:100%;}body{font-size:12px;font-family:Verdana,Geneva,sans-serif;padding-top:1px;margin-top:-1px;word-wrap: break-word;-webkit-nbsp-mode: space;-webkit-line-break: after-white-space;"+(r.support.isRtl(s)?"direction:rtl;":"")+"}h1{font-size:2em;margin:.67em 0}h2{font-size:1.5em}h3{font-size:1.16em}h4{font-size:1em}h5{font-size:.83em}h6{font-size:.7em}p{margin:0 0 1em;padding:0 .2em}.k-marker{display:none;}.k-paste-container,.Apple-style-span{position:absolute;left:-10000px;width:1px;height:1px;overflow:hidden}ul,ol{padding-left:2.5em}span{-ms-high-contrast-adjust:none;}a{color:#00a}code{font-size:1.23em}telerik\\3Ascript{display: none;}.k-table{table-layout:fixed;width:100%;border-spacing:0;margin: 0 0 1em;}.k-table td{min-width:1px;padding:.2em .3em;}.k-table,.k-table td{outline:0;border: 1px dotted #ccc;}.k-table p{margin:0;padding:0;}</style>"+c+"<script>(function(d,c){d[c]('header'),d[c]('article'),d[c]('nav'),d[c]('section'),d[c]('footer');})(document, 'createElement');</script>"+e.map(t,function(e){return"<link rel='stylesheet' href='"+e+"'>"}).join("")+"</head><body autocorrect='off' contenteditable='true'></body></html>"),o.close(),i},_blur:function(){var e=this.textarea,t=e?e.val():this._oldValue,n=this.options.encoded?this.encodedValue():this.value();this.update(),e&&e.trigger("blur"),n!=t&&this.trigger("change")},_initializeContentElement:function(){var n,i,o=this;o.textarea?(o.window=o._createContentElement(o.options.stylesheets),n=o.document=o.window.contentDocument||o.window.document,o.body=n.body,i=o.window,e(n).on("mouseup"+f,u(o._mouseup,o))):(o.window=window,n=o.document=document,o.body=o.element[0],i=o.body,o.toolbar.decorateFrom(o.body)),e(i).on("blur"+f,u(this._blur,this));try{n.execCommand("enableInlineTableEditing",null,!1)}catch(a){}r.support.touch&&e(n).on("selectionchange"+f,u(this._selectionChange,this)).on("keydown"+f,function(){r._activeElement()!=n.body&&o.window.focus()}),e(o.body).on("keydown"+f,function(e){var n,i,a,s,l,c,p,f,g;return e.keyCode===h.F10?(setTimeout(u(o.toolbar.focus,o.toolbar),100),e.preventDefault(),t):(e.keyCode===h.BACKSPACE?(n=o.getRange(),a=d.msie?"":'<br _moz_dirty="" />',s=r.ui.editor.Dom,n.deleteContents(),i=n.commonAncestorContainer,"p"===s.name(i)&&""===i.innerHTML&&(i.innerHTML=a,n.setStart(i,0),n.collapse(!0),o.selectRange(n))):(e.keyCode==h.LEFT||e.keyCode==h.RIGHT)&&(n=o.getRange(),l=e.keyCode==h.LEFT,c=n[l?"startContainer":"endContainer"],p=n[l?"startOffset":"endOffset"],f=l?-1:1,l&&(p-=1),p+f>0&&3==c.nodeType&&"﻿"==c.nodeValue[p]&&(n.setStart(c,p+f),n.collapse(!0),o.selectRange(n))),(g=o.keyboard.toolFromShortcut(o.toolbar.tools,e))?(e.preventDefault(),/^(undo|redo)$/.test(g)||o.keyboard.endTyping(!0),o.trigger("keydown",e),o.exec(g),!1):(o.keyboard.clearTimeout(),o.keyboard.keydown(e),t))}).on("keyup"+f,function(t){var n=[8,9,33,34,35,36,37,38,39,40,40,45,46];(e.inArray(t.keyCode,n)>-1||65==t.keyCode&&t.ctrlKey&&!t.altKey&&!t.shiftKey)&&o._selectionChange(),o.keyboard.keyup(t)}).on("mousedown"+f,function(t){o._selectionStarted=!0;var n=e(t.target);!d.gecko&&2==t.which&&n.is("a[href]")&&window.open(n.attr("href"),"_new")}).on("click"+f,function(e){var t,n=r.ui.editor.Dom;"img"===n.name(e.target)&&(t=o.createRange(),t.selectNode(e.target),o.selectRange(t))}).on("cut"+f+" paste"+f,function(e){o.clipboard["on"+e.type](e)}).on("focusin"+f,function(){e(this).addClass("k-state-active"),o.toolbar.show()}).on("focusout"+f,function(){setTimeout(function(){var t=r._activeElement(),n=o.body,i=o.toolbar;t==n||e.contains(n,t)||e(t).is(".k-editortoolbar-dragHandle")||i.focused()||(e(n).removeClass("k-state-active"),i.hide())},10)})},_mouseup:function(){var e=this;e._selectionStarted&&setTimeout(function(){e._selectionChange()},1)},refresh:function(){var e=this;e.textarea&&(e.textarea.val(e.value()),e.wrapper.find("iframe").remove(),e._initializeContentElement(e),e.value(e.textarea.val()))},events:["select","change","execute","error","paste","keydown","keyup"],options:{name:"Editor",messages:v,formats:{},encoded:!0,domain:null,serialization:{entities:!0},stylesheets:[],dialogOptions:{modal:!0,resizable:!1,draggable:!0,animation:!1},fontName:[{text:"Arial",value:"Arial,Helvetica,sans-serif"},{text:"Courier New",value:"'Courier New',Courier,monospace"},{text:"Georgia",value:"Georgia,serif"},{text:"Impact",value:"Impact,Charcoal,sans-serif"},{text:"Lucida Console",value:"'Lucida Console',Monaco,monospace"},{text:"Tahoma",value:"Tahoma,Geneva,sans-serif"},{text:"Times New Roman",value:"'Times New Roman',Times,serif"},{text:"Trebuchet MS",value:"'Trebuchet MS',Helvetica,sans-serif"},{text:"Verdana",value:"Verdana,Geneva,sans-serif"}],fontSize:[{text:"1 (8pt)",value:"xx-small"},{text:"2 (10pt)",value:"x-small"},{text:"3 (12pt)",value:"small"},{text:"4 (14pt)",value:"medium"},{text:"5 (18pt)",value:"large"},{text:"6 (24pt)",value:"x-large"},{text:"7 (36pt)",value:"xx-large"}],formatBlock:[{text:"Paragraph",value:"p"},{text:"Quotation",value:"blockquote"},{text:"Heading 1",value:"h1"},{text:"Heading 2",value:"h2"},{text:"Heading 3",value:"h3"},{text:"Heading 4",value:"h4"},{text:"Heading 5",value:"h5"},{text:"Heading 6",value:"h6"}],tools:[].concat.call(["formatting"],k.basic,k.alignment,k.lists,k.indenting,k.links,["insertImage"],k.tables)},destroy:function(){var t=this;
s.fn.destroy.call(t),e(t.window).add(t.document).add(t.body).add(t.wrapper).add(t.element.closest("form")).off(f),e(document).off("mousedown",u(t._endTyping,t)).off("mouseup",u(t._mouseup,t)),t.toolbar.destroy(),r.destroy(t.wrapper)},state:function(e){var t,n,i=b.defaultTools[e],o=i&&(i.options.finder||i.finder),a=r.ui.editor.RangeUtils;return o?(t=this.getRange(),n=a.textNodes(t),!n.length&&t.collapsed&&(n=[t.startContainer]),o.getFormat?o.getFormat(n):o.isFormatted(n)):!1},value:function(e){var n=this.body,i=r.ui.editor,o=i.Serializer.domToXhtml(n,this.options.serialization);return e===t?o:(e!=o&&(i.Serializer.htmlToDom(e,n),this.selectionRestorePoint=null,this.update()),t)},saveSelection:function(t){t=t||this.getRange();var n=t.commonAncestorContainer,i=this.body;(n==i||e.contains(i,n))&&(this.selectionRestorePoint=new r.ui.editor.RestorePoint(t))},_focusBody:function(){var e,t=this.body,n=this.document.documentElement;r._activeElement()!=t&&(e=n.scrollTop,t.focus(),n.scrollTop=e)},restoreSelection:function(){this._focusBody(),this.selectionRestorePoint&&this.selectRange(this.selectionRestorePoint.toRange())},focus:function(){this.restoreSelection()},update:function(e){e=e||this.options.encoded?this.encodedValue():this.value(),this.textarea?this.textarea.val(e):this._oldValue=e},encodedValue:function(){return r.ui.editor.Dom.encode(this.value())},createRange:function(e){return r.ui.editor.RangeUtils.createRange(e||this.document)},getSelection:function(){return r.ui.editor.SelectionUtils.selectionFromDocument(this.document)},selectRange:function(e){this._focusBody();var t=this.getSelection();t.removeAllRanges(),t.addRange(e),this.saveSelection(e)},getRange:function(){var e=this.getSelection(),t=e.rangeCount>0?e.getRangeAt(0):this.createRange(),n=this.document;return t.startContainer!=n||t.endContainer!=n||t.startOffset||t.endOffset||(t.setStart(this.body,0),t.collapse(!0)),t},selectedHtml:function(){return r.ui.editor.Serializer.domToXhtml(this.getRange().cloneContents())},paste:function(e,t){this.clipboard.paste(e,t)},exec:function(e,n){var i,o,r,a=this,s=null;if(!e)throw Error("kendoEditor.exec(): `name` parameter cannot be empty");if(e=e.toLowerCase(),a.keyboard.isTypingInProgress()||a.restoreSelection(),o=a.toolbar.toolById(e),!o)for(r in b.defaultTools)if(r.toLowerCase()==e){o=b.defaultTools[r];break}if(o){if(i=a.getRange(),o.command&&(s=o.command(c({range:i},n))),a.trigger("execute",{name:e,command:s}),/^(undo|redo)$/i.test(e))a.undoRedoStack[e]();else if(s&&(s.managesUndoRedo||a.undoRedoStack.push(s),s.editor=a,s.exec(),s.async))return s.change=u(a._selectionChange,a),t;a._selectionChange()}}});b.defaultTools={undo:{options:{key:"Z",ctrl:!0}},redo:{options:{key:"Y",ctrl:!0}}},r.ui.plugin(b),n=a.extend({init:function(e){this.options=e},initialize:function(e,t){e.attr({unselectable:"on",title:t.title})},command:function(e){return new this.options.command(e)},update:e.noop}),n.exec=function(e,t,n){e.exec(t,{value:n})},i=n.extend({init:function(e){n.fn.init.call(this,e)},command:function(e){var t=this;return new r.ui.editor.FormatCommand(c(e,{formatter:t.options.formatter}))},update:function(e,t){var n=this.options.finder.isFormatted(t);e.toggleClass("k-state-selected",n),e.attr("aria-pressed",n)}}),m.registerTool("separator",new n({template:new g({template:m.separatorTemplate})})),o=d.msie&&9>d.version?"﻿":"",c(r.ui,{editor:{ToolTemplate:g,EditorUtils:m,Tool:n,FormatTool:i,_bomFill:o,emptyElementContent:d.msie?"﻿":'<br _moz_dirty="" />'}})}(window.jQuery),function(e){function t(e){var t,n,i={};for(t=0,n=e.length;n>t;t++)i[e[t]]=!0;return i}var n,i,o,r,a,s,l,d,c,u,p=window.kendo,f=e.map,h=e.extend,g=p.support.browser,m="style",v="float",_="cssFloat",k="styleFloat",b="class",w="k-marker",y=t("area,base,basefont,br,col,frame,hr,img,input,isindex,link,meta,param,embed".split(",")),x="div,p,h1,h2,h3,h4,h5,h6,address,applet,blockquote,button,center,dd,dir,dl,dt,fieldset,form,frameset,hr,iframe,isindex,map,menu,noframes,noscript,object,pre,script,table,tbody,td,tfoot,th,thead,tr,header,article,nav,footer,section,aside,main,figure,figcaption".split(","),C=x.concat(["ul","ol","li"]),T=t(C),S="span,em,a,abbr,acronym,applet,b,basefont,bdo,big,br,button,cite,code,del,dfn,font,i,iframe,img,input,ins,kbd,label,map,object,q,s,samp,script,select,small,strike,strong,sub,sup,textarea,tt,u,var,data,time,mark,ruby".split(","),F=t(S),D=t("checked,compact,declare,defer,disabled,ismap,multiple,nohref,noresize,noshade,nowrap,readonly,selected".split(",")),E=function(e){1==e.nodeType&&e.normalize()};g.msie&&g.version>=8&&(E=function(e){if(1==e.nodeType&&e.firstChild)for(var t=e.firstChild,n=t;;){if(n=n.nextSibling,!n)break;3==n.nodeType&&3==t.nodeType&&(n.nodeValue=t.nodeValue+n.nodeValue,u.remove(t)),t=n}}),n=/^\s+$/,i=/rgb\s*\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*\)/i,o=/\ufeff/g,r=/^(\s+|\ufeff)$/,s="color,padding-left,padding-right,padding-top,padding-bottom,background-color,background-attachment,background-image,background-position,background-repeat,border-top-style,border-top-width,border-top-color,border-bottom-style,border-bottom-width,border-bottom-color,border-left-style,border-left-width,border-left-color,border-right-style,border-right-width,border-right-color,font-family,font-size,font-style,font-variant,font-weight,line-height".split(","),l=/[<>\&]/g,d=/[\u00A0-\u2666<>\&]/g,c={34:"quot",38:"amp",39:"apos",60:"lt",62:"gt",160:"nbsp",161:"iexcl",162:"cent",163:"pound",164:"curren",165:"yen",166:"brvbar",167:"sect",168:"uml",169:"copy",170:"ordf",171:"laquo",172:"not",173:"shy",174:"reg",175:"macr",176:"deg",177:"plusmn",178:"sup2",179:"sup3",180:"acute",181:"micro",182:"para",183:"middot",184:"cedil",185:"sup1",186:"ordm",187:"raquo",188:"frac14",189:"frac12",190:"frac34",191:"iquest",192:"Agrave",193:"Aacute",194:"Acirc",195:"Atilde",196:"Auml",197:"Aring",198:"AElig",199:"Ccedil",200:"Egrave",201:"Eacute",202:"Ecirc",203:"Euml",204:"Igrave",205:"Iacute",206:"Icirc",207:"Iuml",208:"ETH",209:"Ntilde",210:"Ograve",211:"Oacute",212:"Ocirc",213:"Otilde",214:"Ouml",215:"times",216:"Oslash",217:"Ugrave",218:"Uacute",219:"Ucirc",220:"Uuml",221:"Yacute",222:"THORN",223:"szlig",224:"agrave",225:"aacute",226:"acirc",227:"atilde",228:"auml",229:"aring",230:"aelig",231:"ccedil",232:"egrave",233:"eacute",234:"ecirc",235:"euml",236:"igrave",237:"iacute",238:"icirc",239:"iuml",240:"eth",241:"ntilde",242:"ograve",243:"oacute",244:"ocirc",245:"otilde",246:"ouml",247:"divide",248:"oslash",249:"ugrave",250:"uacute",251:"ucirc",252:"uuml",253:"yacute",254:"thorn",255:"yuml",402:"fnof",913:"Alpha",914:"Beta",915:"Gamma",916:"Delta",917:"Epsilon",918:"Zeta",919:"Eta",920:"Theta",921:"Iota",922:"Kappa",923:"Lambda",924:"Mu",925:"Nu",926:"Xi",927:"Omicron",928:"Pi",929:"Rho",931:"Sigma",932:"Tau",933:"Upsilon",934:"Phi",935:"Chi",936:"Psi",937:"Omega",945:"alpha",946:"beta",947:"gamma",948:"delta",949:"epsilon",950:"zeta",951:"eta",952:"theta",953:"iota",954:"kappa",955:"lambda",956:"mu",957:"nu",958:"xi",959:"omicron",960:"pi",961:"rho",962:"sigmaf",963:"sigma",964:"tau",965:"upsilon",966:"phi",967:"chi",968:"psi",969:"omega",977:"thetasym",978:"upsih",982:"piv",8226:"bull",8230:"hellip",8242:"prime",8243:"Prime",8254:"oline",8260:"frasl",8472:"weierp",8465:"image",8476:"real",8482:"trade",8501:"alefsym",8592:"larr",8593:"uarr",8594:"rarr",8595:"darr",8596:"harr",8629:"crarr",8656:"lArr",8657:"uArr",8658:"rArr",8659:"dArr",8660:"hArr",8704:"forall",8706:"part",8707:"exist",8709:"empty",8711:"nabla",8712:"isin",8713:"notin",8715:"ni",8719:"prod",8721:"sum",8722:"minus",8727:"lowast",8730:"radic",8733:"prop",8734:"infin",8736:"ang",8743:"and",8744:"or",8745:"cap",8746:"cup",8747:"int",8756:"there4",8764:"sim",8773:"cong",8776:"asymp",8800:"ne",8801:"equiv",8804:"le",8805:"ge",8834:"sub",8835:"sup",8836:"nsub",8838:"sube",8839:"supe",8853:"oplus",8855:"otimes",8869:"perp",8901:"sdot",8968:"lceil",8969:"rceil",8970:"lfloor",8971:"rfloor",9001:"lang",9002:"rang",9674:"loz",9824:"spades",9827:"clubs",9829:"hearts",9830:"diams",338:"OElig",339:"oelig",352:"Scaron",353:"scaron",376:"Yuml",710:"circ",732:"tilde",8194:"ensp",8195:"emsp",8201:"thinsp",8204:"zwnj",8205:"zwj",8206:"lrm",8207:"rlm",8211:"ndash",8212:"mdash",8216:"lsquo",8217:"rsquo",8218:"sbquo",8220:"ldquo",8221:"rdquo",8222:"bdquo",8224:"dagger",8225:"Dagger",8240:"permil",8249:"lsaquo",8250:"rsaquo",8364:"euro"},u={block:T,inline:F,findNodeIndex:function(e,t){var n=0;if(!e)return-1;for(;;){if(e=e.previousSibling,!e)break;t&&3==e.nodeType||n++}return n},isDataNode:function(e){return e&&null!==e.nodeValue&&null!==e.data},isAncestorOf:function(t,n){try{return!u.isDataNode(t)&&(e.contains(t,u.isDataNode(n)?n.parentNode:n)||n.parentNode==t)}catch(i){return!1}},isAncestorOrSelf:function(e,t){return u.isAncestorOf(e,t)||e==t},findClosestAncestor:function(e,t){if(u.isAncestorOf(e,t))for(;t&&t.parentNode!=e;)t=t.parentNode;return t},getNodeLength:function(e){return u.isDataNode(e)?e.length:e.childNodes.length},splitDataNode:function(e,t){for(var n=e.cloneNode(!1),i="",o=e;o.nextSibling&&3==o.nextSibling.nodeType&&o.nextSibling.nodeValue;)i+=o.nextSibling.nodeValue,o=o.nextSibling;e.deleteData(t,e.length),n.deleteData(0,t),n.nodeValue+=i,u.insertAfter(n,e)},attrEquals:function(e,t){var n,i;for(n in t)if(i=e[n],n==v&&(i=e[p.support.cssFloat?_:k]),"object"==typeof i){if(!u.attrEquals(i,t[n]))return!1}else if(i!=t[n])return!1;return!0},blockParentOrBody:function(e){return u.parentOfType(e,C)||e.ownerDocument.body},blockParents:function(t){var n,i,o,r=[];for(n=0,i=t.length;i>n;n++)o=u.parentOfType(t[n],u.blockElements),o&&e.inArray(o,r)<0&&r.push(o);return r},windowFromDocument:function(e){return e.defaultView||e.parentWindow},normalize:E,blockElements:C,nonListBlockElements:x,inlineElements:S,empty:y,fillAttrs:D,toHex:function(e){var t=i.exec(e);return t?"#"+f(t.slice(1),function(e){return e=parseInt(e,10).toString(16),e.length>1?e:"0"+e}).join(""):e},encode:function(e,t){var n=!t||t.entities?d:l;return e.replace(n,function(e){var t=e.charCodeAt(0),n=c[t];return n?"&"+n+";":e})},stripBom:function(e){return(e||"").replace(o,"")},insignificant:function(e){var t=e.attributes;return"k-marker"==e.className||u.is(e,"br")&&(t._moz_dirty||t._moz_editor_bogus_node)},emptyNode:function(t){var n=e.grep(t.childNodes,function(e){return u.is(e,"br")?!1:u.insignificant(e)?!1:3==e.nodeType&&r.test(e.nodeValue)?!1:u.is(e,"p")&&u.emptyNode(e)?!1:!0});return!n.length},name:function(e){return e.nodeName.toLowerCase()},significantChildNodes:function(t){return e.grep(t.childNodes,function(e){return 3!=e.nodeType||!u.isWhitespace(e)})},lastTextNode:function(e){var t,n=null;if(3==e.nodeType)return e;for(t=e.lastChild;t;t=t.previousSibling)if(n=u.lastTextNode(t))return n;return n},is:function(e,t){return u.name(e)==t},isMarker:function(e){return e.className==w},isWhitespace:function(e){return n.test(e.nodeValue)},isBlock:function(e){return T[u.name(e)]},isEmpty:function(e){return y[u.name(e)]},isInline:function(e){return F[u.name(e)]},scrollContainer:function(e){var t=u.windowFromDocument(e),n=(t.contentWindow||t).document||t.ownerDocument||t;return n=p.support.browser.webkit||"BackCompat"==n.compatMode?n.body:n.documentElement},scrollTo:function(t){var n,i,o=e(u.isDataNode(t)?t.parentNode:t),r=u.windowFromDocument(t.ownerDocument),a=r.innerHeight,s=u.scrollContainer(t.ownerDocument);"br"==u.name(o[0])&&(o=o.parent()),n=o.offset().top,i=o[0].offsetHeight,i+n>s.scrollTop+a&&(s.scrollTop=i+n-a)},persistScrollTop:function(e){a=u.scrollContainer(e).scrollTop},restoreScrollTop:function(e){u.scrollContainer(e).scrollTop=a},insertAt:function(e,t,n){e.insertBefore(t,e.childNodes[n]||null)},insertBefore:function(e,t){return t.parentNode?t.parentNode.insertBefore(e,t):t},insertAfter:function(e,t){return t.parentNode.insertBefore(e,t.nextSibling)},remove:function(e){e.parentNode.removeChild(e)},removeTextSiblings:function(e){for(var t=e.parentNode;e.nextSibling&&3==e.nextSibling.nodeType;)t.removeChild(e.nextSibling);for(;e.previousSibling&&3==e.previousSibling.nodeType;)t.removeChild(e.previousSibling)},trim:function(e){var t,n;for(t=e.childNodes.length-1;t>=0;t--)n=e.childNodes[t],u.isDataNode(n)?(u.stripBom(n.nodeValue).length||u.remove(n),u.isWhitespace(n)&&u.insertBefore(n,e)):n.className!=w&&(u.trim(n),n.childNodes.length||u.isEmpty(n)||u.remove(n));return e},closest:function(e,t){for(;e&&u.name(e)!=t;)e=e.parentNode;return e},sibling:function(e,t){do e=e[t];while(e&&1!=e.nodeType);return e},next:function(e){return u.sibling(e,"nextSibling")},prev:function(e){return u.sibling(e,"previousSibling")},parentOfType:function(e,t){do e=e.parentNode;while(e&&!u.ofType(e,t));return e},ofType:function(t,n){return e.inArray(u.name(t),n)>=0},changeTag:function(e,t){var n,i,o,r,a,s=u.create(e.ownerDocument,t),l=e.attributes;for(n=0,i=l.length;i>n;n++)a=l[n],a.specified&&(o=a.nodeName,r=a.nodeValue,o==b?s.className=r:o==m?s.style.cssText=e.style.cssText:s.setAttribute(o,r));for(;e.firstChild;)s.appendChild(e.firstChild);return u.insertBefore(s,e),u.remove(e),s},editableParent:function(e){for(;3==e.nodeType||"true"!==e.contentEditable;)e=e.parentNode;return e},wrap:function(e,t){return u.insertBefore(t,e),t.appendChild(e),t},unwrap:function(e){for(var t=e.parentNode;e.firstChild;)t.insertBefore(e.firstChild,e);t.removeChild(e)},create:function(e,t,n){return u.attr(e.createElement(t),n)},attr:function(e,t){t=h({},t),t&&m in t&&(u.style(e,t.style),delete t.style);for(var n in t)null===t[n]?(e.removeAttribute(n),delete t[n]):"className"==n&&(e[n]=t[n]);return h(e,t)},style:function(t,n){e(t).css(n||{})},unstyle:function(e,t){for(var n in t)n==v&&(n=p.support.cssFloat?_:k),e.style[n]="";""===e.style.cssText&&e.removeAttribute(m)},inlineStyle:function(t,n,i){var o,r=e(u.create(t.ownerDocument,n,i));return t.appendChild(r[0]),o=f(s,function(e){return g.msie&&"line-height"==e&&"1px"==r.css(e)?"line-height:1.5":e+":"+r.css(e)}).join(";"),r.remove(),o},getEffectiveBackground:function(e){var t=e.css("background-color");return t.indexOf("rgba(0, 0, 0, 0")<0&&"transparent"!==t?t:"html"===e[0].tagName.toLowerCase()?"Window":u.getEffectiveBackground(e.parent())},removeClass:function(t,n){var i,o,r=" "+t.className+" ",a=n.split(" ");for(i=0,o=a.length;o>i;i++)r=r.replace(" "+a[i]+" "," ");r=e.trim(r),r.length?t.className=r:t.removeAttribute(b)},commonAncestor:function(){var e,t,n,i,o,r=arguments.length,a=[],s=1/0,l=null;if(!r)return null;if(1==r)return arguments[0];for(e=0;r>e;e++){for(t=[],n=arguments[e];n;)t.push(n),n=n.parentNode;a.push(t.reverse()),s=Math.min(s,t.length)}if(1==r)return a[0][0];for(e=0;s>e;e++){for(i=a[0][e],o=1;r>o;o++)if(i!=a[o][e])return l;l=i}return l},closestSplittableParent:function(t){var n,i,o;return n=1==t.length?u.parentOfType(t[0],["ul","ol"]):u.commonAncestor.apply(null,t),n||(n=u.parentOfType(t[0],["p","td"])||t[0].ownerDocument.body),u.isInline(n)&&(n=u.blockParentOrBody(n)),i=f(t,u.editableParent),o=u.commonAncestor(i)[0],e.contains(n,o)&&(n=o),n},closestEditable:function(t,n){var i=u.parentOfType(t,n),o=u.editableParent(t);return i&&o&&e.contains(i,o)?i=o:!i&&o&&(i=o),i},closestEditableOfType:function(e,t){var n=u.closestEditable(e,t);return n&&u.ofType(n,t)?n:void 0},filter:function(e,t,n){for(var i,o=0,r=t.length,a=[];r>o;o++)i=u.name(t[o]),(!n&&i==e||n&&i!=e)&&a.push(t[o]);return a},ensureTrailingBreaks:function(t){var n=e(t).find("p,td,th"),i=n.length,o=0;if(i)for(;i>o;o++)u.ensureTrailingBreak(n[o]);else u.ensureTrailingBreak(t)},ensureTrailingBreak:function(e){var t,n=e.lastChild&&u.name(e.lastChild);(!n||"br"!=n&&"img"!=n)&&(t=e.ownerDocument.createElement("br"),t.setAttribute("_moz_dirty",!0),e.appendChild(t))}},p.ui.editor.Dom=u}(window.kendo.jQuery),function(e,t){var n,i,o=window.kendo,r=o.ui.editor,a=r.Dom,s=e.extend,l="xx-small,x-small,small,medium,large,x-large,xx-large".split(","),d=/"/g,c=/<br[^>]*>/i,u=/^\d+(\.\d*)?(px)?$/i,p=/<p><\/p>/i,f=/([\w|\-]+)\s*:\s*([^;]+);?/i,h=/^sizzle-\d+/i,g=/\s*onerror\s*=\s*(?:'|")?([^'">\s]*)(?:'|")?/i,m=document.createElement("div");m.innerHTML=" <hr>",n=3===m.firstChild.nodeType,m=null,i={toEditableHtml:function(e){var t='<br _moz_dirty="">';return e=e||"",e.replace(/<!\[CDATA\[(.*)?\]\]>/g,"<!--[CDATA[$1]]-->").replace(/<script([^>]*)>(.*)?<\/script>/gi,"<telerik:script$1>$2</telerik:script>").replace(/<img([^>]*)>/gi,function(e){return e.replace(g,"")}).replace(/(<\/?img[^>]*>)[\r\n\v\f\t ]+/gi,"$1").replace(/^<(table|blockquote)/i,t+"<$1").replace(/<\/(table|blockquote)>$/i,"</$1>"+t)},_fillEmptyElements:function(t){e(t).find("p").each(function(){var t,n=e(this);if(/^\s*$/g.test(n.text())&&!n.find("img,input").length){for(t=this;t.firstChild&&3!=t.firstChild.nodeType;)t=t.firstChild;1!=t.nodeType||a.empty[a.name(t)]||(t.innerHTML=o.ui.editor.emptyElementContent)}})},_removeSystemElements:function(t){e(".k-paste-container",t).remove()},_resetOrderedLists:function(e){var t,n,i,o=e.getElementsByTagName("ol");for(t=0;o.length>t;t++)n=o[t],i=n.getAttribute("start"),n.setAttribute("start",1),i?n.setAttribute("start",i):n.removeAttribute(i)},htmlToDom:function(t,n){var r,s,l=o.support.browser,d=l.msie,c=d&&9>l.version;return t=i.toEditableHtml(t),c&&(t="<br/>"+t,r="originalsrc",s="originalhref",t=t.replace(/href\s*=\s*(?:'|")?([^'">\s]*)(?:'|")?/,s+'="$1"'),t=t.replace(/src\s*=\s*(?:'|")?([^'">\s]*)(?:'|")?/,r+'="$1"')),n.innerHTML=t,c?(a.remove(n.firstChild),e(n).find("telerik\\:script,script,link,img,a").each(function(){var e=this;e[s]&&(e.setAttribute("href",e[s]),e.removeAttribute(s)),e[r]&&(e.setAttribute("src",e[r]),e.removeAttribute(r))})):d&&(a.normalize(n),i._resetOrderedLists(n)),i._fillEmptyElements(n),i._removeSystemElements(n),e("table",n).addClass("k-table"),n},domToXhtml:function(i,o){function r(t){var n,i,o,r,s=e.trim,l=s(t).split(";"),c=l.length;for(n=0,c=l.length;c>n;n++)l[n].length&&(i=f.exec(l[n]),i&&(o=s(i[1].toLowerCase()),r=s(i[2]),"font-size-adjust"!=o&&"font-stretch"!=o&&(o.indexOf("color")>=0?r=a.toHex(r):o.indexOf("font")>=0?r=r.replace(d,"'"):/\burl\(/g.test(r)&&(r=r.replace(d,"")),_.push(o),_.push(":"),_.push(r),_.push(";"))))}function s(n){var i,o,s,l,d,c,p,f,g,m=[],v=n.attributes;for(a.is(n,"img")&&(p=n.style.width,f=n.style.height,g=e(n),p&&u.test(p)&&(g.attr("width",parseInt(p,10)),a.unstyle(n,{width:t})),f&&u.test(f)&&(g.attr("height",parseInt(f,10)),a.unstyle(n,{height:t}))),o=0,s=v.length;s>o;o++)i=v[o],l=i.nodeName,d=i.nodeValue,c=i.specified,"value"==l&&"value"in n&&n.value?c=!0:"type"==l&&"text"==d?c=!0:"class"!=l||d?h.test(l)?c=!1:"complete"==l?c=!1:"altHtml"==l?c=!1:"start"==l&&(a.is(n,"ul")||a.is(n,"ol"))?c=!1:l.indexOf("_moz")>=0&&(c=!1):c=!1,c&&m.push(i);if(m.length)for(m.sort(function(e,t){return e.nodeName>t.nodeName?1:t.nodeName>e.nodeName?-1:0}),o=0,s=m.length;s>o;o++)i=m[o],l=i.nodeName,d=i.nodeValue,("class"!=l||"k-table"!=d)&&(_.push(" "),_.push(l),_.push('="'),"style"==l?r(d||n.style.cssText):"src"==l||"href"==l?_.push(n.getAttribute(l,2)):_.push(a.fillAttrs[l]?l:d),_.push('"'))}function g(e,t,n){for(var i=e.firstChild;i;i=i.nextSibling)v(i,t,n)}function m(e){return e.nodeValue.replace(/\ufeff/g,"")}function v(e,i,r){var l,d,c,u,p,f=e.nodeType;if(1==f){if(l=a.name(e),!l||a.insignificant(e))return;if(a.isInline(e)&&1==e.childNodes.length&&3==e.firstChild.nodeType&&!m(e.firstChild))return;if(d=k[l])return d.start(e),g(e,!1,d.skipEncoding),d.end(e),t;_.push("<"),_.push(l),s(e),a.empty[l]?_.push(" />"):(_.push(">"),g(e,i||a.is(e,"pre")),_.push("</"),_.push(l),_.push(">"))}else 3==f?(u=m(e),!i&&n&&(c=e.parentNode,p=e.previousSibling,p||(p=(a.isInline(c)?c:e).previousSibling),(!p||""===p.innerHTML||a.isBlock(p))&&(u=u.replace(/^[\r\n\v\f\t ]+/,"")),u=u.replace(/ +/," ")),_.push(r?u:a.encode(u,o))):4==f?(_.push("<![CDATA["),_.push(e.data),_.push("]]>")):8==f&&(e.data.indexOf("[CDATA[")<0?(_.push("<!--"),_.push(e.data),_.push("-->")):(_.push("<!"),_.push(e.data),_.push(">")))}var _=[],k={"telerik:script":{start:function(e){_.push("<script"),s(e),_.push(">")},end:function(){_.push("</script>")},skipEncoding:!0},b:{start:function(){_.push("<strong>")},end:function(){_.push("</strong>")}},i:{start:function(){_.push("<em>")},end:function(){_.push("</em>")}},u:{start:function(){_.push('<span style="text-decoration:underline;">')},end:function(){_.push("</span>")}},iframe:{start:function(e){_.push("<iframe"),s(e),_.push(">")},end:function(){_.push("</iframe>")}},font:{start:function(e){var t,n,i;_.push('<span style="'),t=e.getAttribute("color"),n=l[e.getAttribute("size")],i=e.getAttribute("face"),t&&(_.push("color:"),_.push(a.toHex(t)),_.push(";")),i&&(_.push("font-face:"),_.push(i),_.push(";")),n&&(_.push("font-size:"),_.push(n),_.push(";")),_.push('">')},end:function(){_.push("</span>")}}};return 1==i.childNodes.length&&3==i.firstChild.nodeType?a.encode(m(i.firstChild).replace(/[\r\n\v\f\t ]+/," "),o):(g(i),_=_.join(""),""===_.replace(c,"").replace(p,"")?"":_)}},s(r,{Serializer:i})}(window.kendo.jQuery),function(e){function t(e,t,n,i){var o,r,a,s;if(e==t)return i-n;for(o=t;o&&o.parentNode!=e;)o=o.parentNode;if(o)return f(o)-n;for(o=e;o&&o.parentNode!=t;)o=o.parentNode;if(o)return i-f(o)-1;for(r=p.commonAncestor(e,t),a=e;a&&a.parentNode!=r;)a=a.parentNode;for(a||(a=r),s=t;s&&s.parentNode!=r;)s=s.parentNode;return s||(s=r),a==s?0:f(s)-f(a)}function n(e,n){function i(e){try{return t(e.startContainer,e.endContainer,e.startOffset,e.endOffset)<0}catch(n){return!0}}i(e)&&(n?(e.commonAncestorContainer=e.endContainer=e.startContainer,e.endOffset=e.startOffset):(e.commonAncestorContainer=e.startContainer=e.endContainer,e.startOffset=e.endOffset),e.collapsed=!0)}function i(e){e.collapsed=e.startContainer==e.endContainer&&e.startOffset==e.endOffset;for(var t=e.startContainer;t&&t!=e.endContainer&&!p.isAncestorOf(t,e.endContainer);)t=t.parentNode;e.commonAncestorContainer=t}function o(e){var t=e.duplicate(),n=e.duplicate();return t.collapse(!0),n.collapse(!1),p.commonAncestor(e.parentElement(),t.parentElement(),n.parentElement())}function r(e,t,n){var i,o=t[n?"startContainer":"endContainer"],r=t[n?"startOffset":"endOffset"],a=0,s=h(o),l=s?o:o.childNodes[r]||null,d=s?o.parentNode:o,c=t.ownerDocument,u=c.body.createTextRange();(3==o.nodeType||4==o.nodeType)&&(a=r),d||(d=c.body),"img"==d.nodeName.toLowerCase()?(u.moveToElementText(d),u.collapse(!1),e.setEndPoint(n?"StartToStart":"EndToStart",u)):(i=d.insertBefore(p.create(c,"a"),l),u.moveToElementText(i),p.remove(i),u[n?"moveStart":"moveEnd"]("character",a),u.collapse(!1),e.setEndPoint(n?"StartToStart":"EndToStart",u))}function a(e,t,n,i){var o,r,a,s,l,d,c,u=p.create(t.ownerDocument,"a"),g=e.duplicate(),m=i?"StartToStart":"StartToEnd",v=!1;u.innerHTML="﻿",g.collapse(i),r=g.parentElement(),p.isAncestorOrSelf(n,r)||(r=n);do v?r.insertBefore(u,u.previousSibling):(r.appendChild(u),v=!0),g.moveToElementText(u);while((o=g.compareEndPoints(m,e))>0&&u.previousSibling);a=u.nextSibling,-1==o&&h(a)?(g.setEndPoint(i?"EndToStart":"EndToEnd",e),p.remove(u),d=[a,g.text.length]):(s=!i&&u.previousSibling,l=i&&u.nextSibling,h(l)?d=[l,0]:h(s)?d=[s,s.length]:(c=f(u),d=r.nextSibling&&c==r.childNodes.length-1?[r.nextSibling,0]:[r,c]),p.remove(u)),t[i?"setStart":"setEnd"].apply(t,d)}var s=window.kendo,l=s.Class,d=e.extend,c=s.ui.editor,u=s.support.browser,p=c.Dom,f=p.findNodeIndex,h=p.isDataNode,g=p.findClosestAncestor,m=p.getNodeLength,v=p.normalize,_={selectionFromWindow:function(e){return"getSelection"in e?e.getSelection():new w(e.document)},selectionFromRange:function(e){var t=S.documentFromRange(e);return _.selectionFromDocument(t)},selectionFromDocument:function(e){return _.selectionFromWindow(p.windowFromDocument(e))}},k=l.extend({init:function(t){e.extend(this,{ownerDocument:t,startContainer:t,endContainer:t,commonAncestorContainer:t,startOffset:0,endOffset:0,collapsed:!0})},setStart:function(e,t){this.startContainer=e,this.startOffset=t,i(this),n(this,!0)},setEnd:function(e,t){this.endContainer=e,this.endOffset=t,i(this),n(this,!1)},setStartBefore:function(e){this.setStart(e.parentNode,f(e))},setStartAfter:function(e){this.setStart(e.parentNode,f(e)+1)},setEndBefore:function(e){this.setEnd(e.parentNode,f(e))},setEndAfter:function(e){this.setEnd(e.parentNode,f(e)+1)},selectNode:function(e){this.setStartBefore(e),this.setEndAfter(e)},selectNodeContents:function(e){this.setStart(e,0),this.setEnd(e,e[1===e.nodeType?"childNodes":"nodeValue"].length)},collapse:function(e){var t=this;e?t.setEnd(t.startContainer,t.startOffset):t.setStart(t.endContainer,t.endOffset)},deleteContents:function(){var e=this,t=e.cloneRange();e.startContainer!=e.commonAncestorContainer&&e.setStartAfter(g(e.commonAncestorContainer,e.startContainer)),e.collapse(!0),function n(e){for(;e.next();)e.hasPartialSubtree()?n(e.getSubtreeIterator()):e.remove()}(new b(t))},cloneContents:function(){var e=S.documentFromRange(this);return function t(n){for(var i,o=e.createDocumentFragment();i=n.next();)i=i.cloneNode(!n.hasPartialSubtree()),n.hasPartialSubtree()&&i.appendChild(t(n.getSubtreeIterator())),o.appendChild(i);return o}(new b(this))},extractContents:function(){var e,t=this,n=t.cloneRange();return t.startContainer!=t.commonAncestorContainer&&t.setStartAfter(g(t.commonAncestorContainer,t.startContainer)),t.collapse(!0),e=S.documentFromRange(t),function i(n){for(var o,r=e.createDocumentFragment();o=n.next();)n.hasPartialSubtree()?(o=o.cloneNode(!1),o.appendChild(i(n.getSubtreeIterator()))):n.remove(t.originalRange),r.appendChild(o);return r}(new b(n))},insertNode:function(e){var t=this;h(t.startContainer)?(t.startOffset!=t.startContainer.nodeValue.length&&p.splitDataNode(t.startContainer,t.startOffset),p.insertAfter(e,t.startContainer)):p.insertAt(t.startContainer,e,t.startOffset),t.setStart(t.startContainer,t.startOffset)},cloneRange:function(){return e.extend(new k(this.ownerDocument),{startContainer:this.startContainer,endContainer:this.endContainer,commonAncestorContainer:this.commonAncestorContainer,startOffset:this.startOffset,endOffset:this.endOffset,collapsed:this.collapsed,originalRange:this})},toString:function(){var e=this.startContainer.nodeName,t=this.endContainer.nodeName;return("#text"==e?this.startContainer.nodeValue:e)+"("+this.startOffset+") : "+("#text"==t?this.endContainer.nodeValue:t)+"("+this.endOffset+")"}}),b=l.extend({init:function(t){if(e.extend(this,{range:t,_current:null,_next:null,_end:null}),!t.collapsed){var n=t.commonAncestorContainer;this._next=t.startContainer!=n||h(t.startContainer)?g(n,t.startContainer):t.startContainer.childNodes[t.startOffset],this._end=t.endContainer!=n||h(t.endContainer)?g(n,t.endContainer).nextSibling:t.endContainer.childNodes[t.endOffset]}},hasNext:function(){return!!this._next},next:function(){var e=this,t=e._current=e._next;return e._next=e._current&&e._current.nextSibling!=e._end?e._current.nextSibling:null,h(e._current)&&(e.range.endContainer==e._current&&(t=t.cloneNode(!0),t.deleteData(e.range.endOffset,t.length-e.range.endOffset)),e.range.startContainer==e._current&&(t=t.cloneNode(!0),t.deleteData(0,e.range.startOffset))),t},traverse:function(e){function t(){return i._current=i._next,i._next=i._current&&i._current.nextSibling!=i._end?i._current.nextSibling:null,i._current}for(var n,i=this;n=t();)i.hasPartialSubtree()?i.getSubtreeIterator().traverse(e):e(n);return n},remove:function(e){var t,n,i,o,r,a=this,s=a.range.startContainer==a._current,l=a.range.endContainer==a._current;h(a._current)&&(s||l)?(t=s?a.range.startOffset:0,n=l?a.range.endOffset:a._current.length,i=n-t,e&&(s||l)&&(a._current==e.startContainer&&e.startOffset>=t&&(e.startOffset-=i),a._current==e.endContainer&&e.endOffset>=n&&(e.endOffset-=i)),a._current.deleteData(t,i)):(o=a._current.parentNode,!e||a.range.startContainer!=o&&a.range.endContainer!=o||(r=f(a._current),o==e.startContainer&&e.startOffset>=r&&(e.startOffset-=1),o==e.endContainer&&e.endOffset>r&&(e.endOffset-=1)),p.remove(a._current))},hasPartialSubtree:function(){return!h(this._current)&&(p.isAncestorOrSelf(this._current,this.range.startContainer)||p.isAncestorOrSelf(this._current,this.range.endContainer))},getSubtreeIterator:function(){var e=this,t=e.range.cloneRange();return t.selectNodeContents(e._current),p.isAncestorOrSelf(e._current,e.range.startContainer)&&t.setStart(e.range.startContainer,e.range.startOffset),p.isAncestorOrSelf(e._current,e.range.endContainer)&&t.setEnd(e.range.endContainer,e.range.endOffset),new b(t)}}),w=l.extend({init:function(e){this.ownerDocument=e,this.rangeCount=1},addRange:function(e){var t=this.ownerDocument.body.createTextRange();r(t,e,!1),r(t,e,!0),t.select()},removeAllRanges:function(){var e=this.ownerDocument.selection;"None"!=e.type&&e.empty()},getRangeAt:function(){var e,t,n,i,r,s,l,d,c=new k(this.ownerDocument),u=this.ownerDocument.selection;try{if(e=u.createRange(),t=e.item?e.item(0):e.parentElement(),t.ownerDocument!=this.ownerDocument)return c}catch(p){return c}if("Control"==u.type)c.selectNode(e.item(0));else if(n=o(e),a(e,c,n,!0),a(e,c,n,!1),9==c.startContainer.nodeType&&c.setStart(c.endContainer,c.startOffset),9==c.endContainer.nodeType&&c.setEnd(c.startContainer,c.endOffset),0===e.compareEndPoints("StartToEnd",e)&&c.collapse(!1),i=c.startContainer,r=c.endContainer,s=this.ownerDocument.body,!(c.collapsed||0!==c.startOffset||c.endOffset!=m(c.endContainer)||i==r&&h(i)&&i.parentNode==s)){for(l=!1,d=!1;0===f(i)&&i==i.parentNode.firstChild&&i!=s;)i=i.parentNode,l=!0;for(;f(r)==m(r.parentNode)-1&&r==r.parentNode.lastChild&&r!=s;)r=r.parentNode,d=!0;i==s&&r==s&&l&&d&&(c.setStart(i,0),c.setEnd(r,m(s)))}return c}}),y=l.extend({init:function(e){this.enumerate=function(){function t(e){if(p.is(e,"img")||3==e.nodeType&&(!p.isWhitespace(e)||"﻿"==e.nodeValue))n.push(e);else for(e=e.firstChild;e;)t(e),e=e.nextSibling}var n=[];return new b(e).traverse(t),n}}}),x=l.extend({init:function(e,t){var n=this;n.range=e,n.rootNode=S.documentFromRange(e),n.body=t||n.getEditable(e),"body"!=p.name(n.body)&&(n.rootNode=n.body),n.html=n.body.innerHTML,n.startContainer=n.nodeToPath(e.startContainer),n.endContainer=n.nodeToPath(e.endContainer),n.startOffset=n.offset(e.startContainer,e.startOffset),n.endOffset=n.offset(e.endContainer,e.endOffset)},index:function(e){for(var t,n=0,i=e.nodeType;e=e.previousSibling;)t=e.nodeType,(3!=t||i!=t)&&n++,i=t;return n},getEditable:function(e){for(var t=e.commonAncestorContainer;t&&(3==t.nodeType||t.attributes&&!t.attributes.contentEditable);)t=t.parentNode;return t},restoreHtml:function(){this.body.innerHTML=this.html},offset:function(e,t){if(3==e.nodeType)for(;(e=e.previousSibling)&&3==e.nodeType;)t+=e.nodeValue.length;return t},nodeToPath:function(e){for(var t=[];e!=this.rootNode;)t.push(this.index(e)),e=e.parentNode;return t},toRangePoint:function(e,t,n,i){for(var o=this.rootNode,r=n.length,a=i;r--;)o=o.childNodes[n[r]];for(;3==o.nodeType&&a>o.nodeValue.length;)a-=o.nodeValue.length,o=o.nextSibling;e[t?"setStart":"setEnd"](o,a)},toRange:function(){var e=this,t=e.range.cloneRange();return e.toRangePoint(t,!0,e.startContainer,e.startOffset),e.toRangePoint(t,!1,e.endContainer,e.endOffset),t}}),C=l.extend({init:function(){this.caret=null},addCaret:function(e){var t=this;return t.caret=p.create(S.documentFromRange(e),"span",{className:"k-marker"}),e.insertNode(t.caret),e.selectNode(t.caret),t.caret},removeCaret:function(e){var t,n,i,o,r=this,a=r.caret.previousSibling,s=0;a&&(s=h(a)?a.nodeValue.length:f(a)),t=r.caret.parentNode,n=a?f(a):0,p.remove(r.caret),v(t),i=t.childNodes[n],h(i)?e.setStart(i,s):i?(o=p.lastTextNode(i),o?e.setStart(o,o.nodeValue.length):e[a?"setStartAfter":"setStartBefore"](i)):(u.msie||t.innerHTML||(t.innerHTML='<br _moz_dirty="" />'),e.selectNodeContents(t)),e.collapse(!0)},add:function(e,t){var n,i,o=this,r=e.collapsed&&!S.isExpandable(e),a=S.documentFromRange(e);return t&&e.collapsed&&(o.addCaret(e),e=S.expand(e)),n=e.cloneRange(),n.collapse(!1),o.end=p.create(a,"span",{className:"k-marker"}),n.insertNode(o.end),n=e.cloneRange(),n.collapse(!0),o.start=o.end.cloneNode(!0),n.insertNode(o.start),o._removeDeadMarkers(o.start,o.end),r&&(i=a.createTextNode("﻿"),p.insertAfter(i.cloneNode(),o.start),p.insertBefore(i,o.end)),e.setStartBefore(o.start),e.setEndAfter(o.end),v(e.commonAncestorContainer),e
},_removeDeadMarkers:function(e,t){e.previousSibling&&"﻿"==e.previousSibling.nodeValue&&p.remove(e.previousSibling),t.nextSibling&&"﻿"==t.nextSibling.nodeValue&&p.remove(t.nextSibling)},remove:function(e){var t,n,i,o,r,a,s,l,d,c,u,g,m,_=this,k=_.start,b=_.end;for(v(e.commonAncestorContainer);!k.nextSibling&&k.parentNode;)k=k.parentNode;for(;!b.previousSibling&&b.parentNode;)b=b.parentNode;if(t=k.previousSibling&&3==k.previousSibling.nodeType&&k.nextSibling&&3==k.nextSibling.nodeType,n=b.previousSibling&&3==b.previousSibling.nodeType&&b.nextSibling&&3==b.nextSibling.nodeType,i=t&&n,k=k.nextSibling,b=b.previousSibling,o=!1,r=!1,k==_.end&&(r=!!_.start.previousSibling,k=b=_.start.previousSibling||_.end.nextSibling,o=!0),p.remove(_.start),p.remove(_.end),!k||!b)return e.selectNodeContents(e.commonAncestorContainer),e.collapse(!0),void 0;if(a=o?h(k)?k.nodeValue.length:k.childNodes.length:0,s=h(b)?b.nodeValue.length:b.childNodes.length,3==k.nodeType)for(;k.previousSibling&&3==k.previousSibling.nodeType;)k=k.previousSibling,a+=k.nodeValue.length;if(3==b.nodeType)for(;b.previousSibling&&3==b.previousSibling.nodeType;)b=b.previousSibling,s+=b.nodeValue.length;for(l=f(k),d=k.parentNode,c=f(b),u=b.parentNode,g=k;g.previousSibling;g=g.previousSibling)3==g.nodeType&&3==g.previousSibling.nodeType&&l--;for(m=b;m.previousSibling;m=m.previousSibling)3==m.nodeType&&3==m.previousSibling.nodeType&&c--;v(d),3==k.nodeType&&(k=d.childNodes[l]),v(u),3==b.nodeType&&(b=u.childNodes[c]),o?(3==k.nodeType?e.setStart(k,a):e[r?"setStartAfter":"setStartBefore"](k),e.collapse(!0)):(3==k.nodeType?e.setStart(k,a):e.setStartBefore(k),3==b.nodeType?e.setEnd(b,s):e.setEndAfter(b)),_.caret&&_.removeCaret(e)}}),T=/[\u0009-\u000d]|\u0020|\u00a0|\ufeff|\.|,|;|:|!|\(|\)|\?/,S={nodes:function(e){var t=S.textNodes(e);return t.length||(e.selectNodeContents(e.commonAncestorContainer),t=S.textNodes(e),t.length||(t=p.significantChildNodes(e.commonAncestorContainer))),t},textNodes:function(e){return new y(e).enumerate()},documentFromRange:function(e){var t=e.startContainer;return 9==t.nodeType?t:t.ownerDocument},createRange:function(e){return u.msie&&9>u.version?new k(e):e.createRange()},selectRange:function(e){var t,n=S.image(e);n&&(e.setStartAfter(n),e.setEndAfter(n)),t=_.selectionFromRange(e),t.removeAllRanges(),t.addRange(e)},stringify:function(e){return s.format("{0}:{1} - {2}:{3}",p.name(e.startContainer),e.startOffset,p.name(e.endContainer),e.endOffset)},split:function(e,t,n){function i(i){var o,r=e.cloneRange();r.collapse(i),r[i?"setStartBefore":"setEndAfter"](t),o=r.extractContents(),n&&(o=p.trim(o)),p[i?"insertBefore":"insertAfter"](o,t)}i(!0),i(!1)},getMarkers:function(e){var t=[];return new b(e).traverse(function(e){"k-marker"==e.className&&t.push(e)}),t},image:function(e){var t=[];return new b(e).traverse(function(e){p.is(e,"img")&&t.push(e)}),1==t.length?t[0]:void 0},expand:function(e){var t,n,i,o,r=e.cloneRange(),a=r.startContainer.childNodes[0===r.startOffset?0:r.startOffset-1],s=r.endContainer.childNodes[r.endOffset];return h(a)&&h(s)?(t=a.nodeValue,n=s.nodeValue,t&&n?(i=t.split("").reverse().join("").search(T),o=n.search(T),i&&o?(o=-1==o?n.length:o,i=-1==i?0:t.length-i,r.setStart(a,i),r.setEnd(s,o),r):r):r):r},isExpandable:function(e){var t,n,i,o,r,a,s=e.startContainer,l=S.documentFromRange(e);return s==l||s==l.body?!1:(t=e.cloneRange(),(n=s.nodeValue)?(i=n.substring(0,t.startOffset),o=n.substring(t.startOffset),r=0,a=0,i&&(r=i.split("").reverse().join("").search(T)),o&&(a=o.search(T)),r&&a):!1)}};d(c,{SelectionUtils:_,W3CRange:k,RangeIterator:b,W3CSelection:w,RangeEnumerator:y,RestorePoint:x,Marker:C,RangeUtils:S})}(window.kendo.jQuery),function(e){var t=window.kendo,n=t.Class,i=t.ui.editor,o=i.EditorUtils,r=o.registerTool,a=i.Dom,s=i.Tool,l=i.ToolTemplate,d=i.RestorePoint,c=i.Marker,u=e.extend,p=n.extend({init:function(e){this.options=e,this.restorePoint=new d(e.range),this.marker=new c,this.formatter=e.formatter},getRange:function(){return this.restorePoint.toRange()},lockRange:function(e){return this.marker.add(this.getRange(),e)},releaseRange:function(e){this.marker.remove(e),this.editor.selectRange(e)},undo:function(){var e=this.restorePoint;e.restoreHtml(),this.editor.selectRange(e.toRange())},redo:function(){this.exec()},createDialog:function(n,i){var o=this.editor;return e(n).appendTo(document.body).kendoWindow(u({},o.options.dialogOptions,i)).closest(".k-window").toggleClass("k-rtl",t.support.isRtl(o.wrapper)).end()},exec:function(){var e=this.lockRange(!0);this.formatter.editor=this.editor,this.formatter.toggle(e),this.releaseRange(e)}}),f=n.extend({init:function(e,t){this.body=e.body,this.startRestorePoint=e,this.endRestorePoint=t},redo:function(){this.body.innerHTML=this.endRestorePoint.html,this.editor.selectRange(this.endRestorePoint.toRange())},undo:function(){this.body.innerHTML=this.startRestorePoint.html,this.editor.selectRange(this.startRestorePoint.toRange())}}),h=p.extend({init:function(e){p.fn.init.call(this,e),this.managesUndoRedo=!0},exec:function(){var e,t=this.editor,n=this.options,i=n.range,o=t.body,r=new d(i,o),a=n.html||n.value||"";t.selectRange(i),t.clipboard.paste(a,n),n.postProcess&&n.postProcess(t,t.getRange()),e=new f(r,new d(t.getRange(),o)),e.editor=t,t.undoRedoStack.push(e),t.focus()}}),g=s.extend({initialize:function(e,t){var n=t.editor,o=this.options,r=o.items?o.items:n.options.insertHtml;new i.SelectBox(e,{dataSource:r,dataTextField:"text",dataValueField:"value",change:function(){s.exec(n,"insertHtml",this.value())},title:n.options.messages.insertHtml,highlightFirst:!1})},command:function(e){return new h(e)},update:function(e){var t=e.data("kendoSelectBox")||e.find("select").data("kendoSelectBox");t.close(),t.value(t.options.title)}}),m=n.extend({init:function(){this.stack=[],this.currentCommandIndex=-1},push:function(e){this.stack=this.stack.slice(0,this.currentCommandIndex+1),this.currentCommandIndex=this.stack.push(e)-1},undo:function(){this.canUndo()&&this.stack[this.currentCommandIndex--].undo()},redo:function(){this.canRedo()&&this.stack[++this.currentCommandIndex].redo()},canUndo:function(){return this.currentCommandIndex>=0},canRedo:function(){return this.currentCommandIndex!=this.stack.length-1}}),v=n.extend({init:function(e){this.editor=e},keydown:function(t){var n,i=this,o=i.editor,r=o.keyboard,a=r.isTypingKey(t),s=u(e.Event(),t);return i.editor.trigger("keydown",s),s.isDefaultPrevented()&&t.preventDefault(),s.isDefaultPrevented()||!a||r.isTypingInProgress()?!1:(n=o.getRange(),i.startRestorePoint=new d(n),r.startTyping(function(){o.selectionRestorePoint=i.endRestorePoint=new d(o.getRange());var e=new f(i.startRestorePoint,i.endRestorePoint);e.editor=o,o.undoRedoStack.push(e)}),!0)},keyup:function(e){var t=this.editor.keyboard;return this.editor.trigger("keyup",e),t.isTypingInProgress()?(t.endTyping(),!0):!1}}),_=n.extend({init:function(e){this.editor=e,this.systemCommandIsInProgress=!1},createUndoCommand:function(){var e,t=this;t.endRestorePoint=new d(t.editor.getRange()),e=new f(t.startRestorePoint,t.endRestorePoint),e.editor=t.editor,t.editor.undoRedoStack.push(e),t.startRestorePoint=t.endRestorePoint},changed:function(){return this.startRestorePoint?this.startRestorePoint.html!=this.editor.body.innerHTML:!1},keydown:function(e){var t=this,n=t.editor,i=n.keyboard;return i.isModifierKey(e)?(i.isTypingInProgress()&&i.endTyping(!0),t.startRestorePoint=new d(n.getRange()),!0):i.isSystem(e)?(t.systemCommandIsInProgress=!0,t.changed()&&(t.systemCommandIsInProgress=!1,t.createUndoCommand()),!0):!1},keyup:function(e){var t=this;return t.systemCommandIsInProgress&&t.changed()?(t.systemCommandIsInProgress=!1,t.createUndoCommand(e),!0):!1}}),k=n.extend({init:function(e){this.handlers=e,this.typingInProgress=!1},isCharacter:function(e){return e>=48&&90>=e||e>=96&&111>=e||e>=186&&192>=e||e>=219&&222>=e||229==e},toolFromShortcut:function(t,n){var i,o,r=String.fromCharCode(n.keyCode);for(i in t)if(o=e.extend({ctrl:!1,alt:!1,shift:!1},t[i].options),(o.key==r||o.key==n.keyCode)&&o.ctrl==n.ctrlKey&&o.alt==n.altKey&&o.shift==n.shiftKey)return i},isTypingKey:function(e){var t=e.keyCode;return this.isCharacter(t)&&!e.ctrlKey&&!e.altKey||32==t||13==t||8==t||46==t&&!e.shiftKey&&!e.ctrlKey&&!e.altKey},isModifierKey:function(e){var t=e.keyCode;return 17==t&&!e.shiftKey&&!e.altKey||16==t&&!e.ctrlKey&&!e.altKey||18==t&&!e.ctrlKey&&!e.shiftKey},isSystem:function(e){return 46==e.keyCode&&e.ctrlKey&&!e.altKey&&!e.shiftKey},startTyping:function(e){this.onEndTyping=e,this.typingInProgress=!0},stopTyping:function(){this.typingInProgress&&this.onEndTyping&&this.onEndTyping(),this.typingInProgress=!1},endTyping:function(t){var n=this;n.clearTimeout(),t?n.stopTyping():n.timeout=window.setTimeout(e.proxy(n.stopTyping,n),1e3)},isTypingInProgress:function(){return this.typingInProgress},clearTimeout:function(){window.clearTimeout(this.timeout)},notify:function(e,t){var n,i=this.handlers;for(n=0;i.length>n&&!i[n][t](e);n++);},keydown:function(e){this.notify(e,"keydown")},keyup:function(e){this.notify(e,"keyup")}}),b=n.extend({init:function(e){this.editor=e,this.cleaners=[new y,new x,new C]},htmlToFragment:function(e){var t=this.editor,n=t.document,i=a.create(n,"div"),o=n.createDocumentFragment();for(i.innerHTML=e;i.firstChild;)o.appendChild(i.firstChild);return o},isBlock:function(e){return/<(div|p|ul|ol|table|h[1-6])/i.test(e)},_contentModification:function(e,t){var n,i,o=this,r=o.editor;o._inProgress||(o._inProgress=!0,n=r.getRange(),i=new d(n),a.persistScrollTop(r.document),e.call(o,r,n),setTimeout(function(){var e,a;t.call(o,r,n),e=new d(r.getRange()),a=new f(i,e),a.editor=r,r.undoRedoStack.push(a),r._selectionChange(),o._inProgress=!1}))},oncut:function(){this._contentModification(e.noop,e.noop)},onpaste:function(n){this._contentModification(function(i,o){var r,s,l,d=a.create(i.document,"div",{className:"k-paste-container",innerHTML:"﻿"}),c=t.support.browser;i.body.appendChild(d),c.msie&&11>c.version?(n.preventDefault(),r=i.createRange(),r.selectNodeContents(d),i.selectRange(r),s=i.document.body.createTextRange(),s.moveToElementText(d),e(i.body).unbind("paste"),s.execCommand("Paste"),e(i.body).bind("paste",e.proxy(this.onpaste,this))):(l=i.createRange(),l.selectNodeContents(d),i.selectRange(l)),o.deleteContents()},function(t,n){var i,o="",r={html:""};t.selectRange(n),i=e(t.body).children(".k-paste-container"),i.each(function(){var e=this.lastChild;e&&a.is(e,"br")&&a.remove(e),o+=this.innerHTML}),i.remove(),o=o.replace(/\ufeff/g,""),r.html=o,t.trigger("paste",r),t.clipboard.paste(r.html,{clean:!0})})},splittableParent:function(e,t){var n,i;if(e)return a.closestEditableOfType(t,["p","ul","ol"])||t.parentNode;if(n=t.parentNode,i=t.ownerDocument.body,a.isInline(n))for(;n.parentNode!=i&&!a.isBlock(n.parentNode);)n=n.parentNode;return n},paste:function(t,n){var o,r,s,l,d,p,f,h,g,m,v,_=this.editor;for(n=u({clean:!1,split:!0},n),o=0,r=this.cleaners.length;r>o;o++)this.cleaners[o].applicable(t)&&(t=this.cleaners[o].clean(t));if(n.clean&&(t=t.replace(/(<br>(\s|&nbsp;)*)+(<\/?(div|p|li|col|t))/gi,"$3"),t=t.replace(/<(a|span)[^>]*><\/\1>/gi,"")),t=t.replace(/^<li/i,"<ul><li").replace(/li>$/g,"li></ul>"),s=this.isBlock(t),_.focus(),l=_.getRange(),l.deleteContents(),l.startContainer==_.document&&l.selectNodeContents(_.body),d=new c,p=d.addCaret(l),f=this.splittableParent(s,p),h=!1,g=f!=_.body&&!a.is(f,"td"),n.split&&g&&(s||a.isInline(f))&&(l.selectNode(p),i.RangeUtils.split(l,f,!0),h=!0),m=this.htmlToFragment(t),m.firstChild&&"k-paste-container"===m.firstChild.className){for(v=[],o=0,r=m.childNodes.length;r>o;o++)v.push(m.childNodes[o].innerHTML);m=this.htmlToFragment(v.join("<br />"))}if(e(m.childNodes).filter("table").addClass("k-table").end().find("table").addClass("k-table"),l.insertNode(m),f=this.splittableParent(s,p),h){for(;p.parentNode!=f;)a.unwrap(p.parentNode);a.unwrap(p.parentNode)}a.normalize(l.commonAncestorContainer),p.style.display="inline",a.restoreScrollTop(_.document),a.scrollTo(p),d.removeCaret(l),_.selectRange(l)}}),w=n.extend({clean:function(e){var t,n,i=this,o=i.replacements;for(t=0,n=o.length;n>t;t+=2)e=e.replace(o[t],o[t+1]);return e}}),y=w.extend({init:function(){this.replacements=[/<(\/?)script([^>]*)>/i,"<$1telerik:script$2>"]},applicable:function(e){return/<script[^>]*>/i.test(e)}}),x=w.extend({init:function(){this.replacements=[/<\?xml[^>]*>/gi,"",/<!--(.|\n)*?-->/g,"",/&quot;/g,"'",/(?:<br>&nbsp;[\s\r\n]+|<br>)*(<\/?(h[1-6]|hr|p|div|table|tbody|thead|tfoot|th|tr|td|li|ol|ul|caption|address|pre|form|blockquote|dl|dt|dd|dir|fieldset)[^>]*>)(?:<br>&nbsp;[\s\r\n]+|<br>)*/g,"$1",/<br><br>/g,"<BR><BR>",/<br>(?!\n)/g," ",/<table([^>]*)>(\s|&nbsp;)+<t/gi,"<table$1><t",/<tr[^>]*>(\s|&nbsp;)*<\/tr>/gi,"",/<tbody[^>]*>(\s|&nbsp;)*<\/tbody>/gi,"",/<table[^>]*>(\s|&nbsp;)*<\/table>/gi,"",/<BR><BR>/g,"<br>",/^\s*(&nbsp;)+/gi,"",/(&nbsp;|<br[^>]*>)+\s*$/gi,"",/mso-[^;"]*;?/gi,"",/<(\/?)b(\s[^>]*)?>/gi,"<$1strong$2>",/<(\/?)i(\s[^>]*)?>/gi,"<$1em$2>",/<o:p>&nbsp;<\/o:p>/gi,"&nbsp;",/<\/?(meta|link|style|o:|v:|x:)[^>]*>((?:.|\n)*?<\/(meta|link|style|o:|v:|x:)[^>]*>)?/gi,"",/<\/o>/g,"",/style=(["|'])\s*\1/g,"",/(<br[^>]*>)?\n/g,function(e,t){return t?e:" "}]},applicable:function(e){return/class="?Mso|style="[^"]*mso-/i.test(e)||/urn:schemas-microsoft-com:office/.test(e)},stripEmptyAnchors:function(e){return e.replace(/<a([^>]*)>\s*<\/a>/gi,function(e,t){return!t||t.indexOf("href")<0?"":e})},listType:function(e){var t;return/^(<span [^>]*texhtml[^>]*>)?<span [^>]*(Symbol|Wingdings)[^>]*>/i.test(e)&&(t=!0),e=e.replace(/<\/?\w+[^>]*>/g,"").replace(/&nbsp;/g," "),!t&&/^[\u2022\u00b7\u00a7\u00d8o]\u00a0+/.test(e)||t&&/^.\u00a0+/.test(e)?"ul":/^\s*\w+[\.\)]\u00a0{2,}/.test(e)?"ol":void 0},lists:function(t){var n,i,o,r,s,l,d,c,u,p=e(a.blockElements.join(","),t),f=-1,h={ul:{},ol:{}},g=t;for(o=0;p.length>o;o++)if(r=p[o],s=this.listType(r.innerHTML),i=a.name(r),"td"!=i)if(s&&"p"==i){if(l=parseFloat(r.style.marginLeft||0),d=h[s][l],(l>f||!d)&&(d=a.create(document,s),g==t?a.insertBefore(d,r):g.appendChild(d),h[s][l]=d),n!=s)for(c in h)for(u in h[c])e.contains(d,h[c][u])&&delete h[c][u];a.remove(r.firstChild),g=a.create(document,"li",{innerHTML:r.innerHTML}),d.appendChild(g),a.remove(r),f=l,n=s}else r.innerHTML?(h={ul:{},ol:{}},g=t,f=-1):a.remove(r)},removeAttributes:function(e){for(var t=e.attributes,n=t.length;n--;)"colspan"!=a.name(t[n])&&e.removeAttributeNode(t[n])},createColGroup:function(n){var i=n.cells,o=e(n).closest("table"),r=o.children("colgroup");2>i.length||(r.length&&(i=r.children(),r[0].parentNode.removeChild(r[0])),r=e(e.map(i,function(e){var n=e.width;return n&&0!==parseInt(n,10)?t.format('<col style="width:{0}px;"/>',n):"<col />"}).join("")),r.is("colgroup")||(r=e("<colgroup/>").append(r)),r.prependTo(o))},convertHeaders:function(t){var n,i=t.cells,o=e.map(i,function(t){var n=e(t).children("p").children("strong")[0];return n&&"strong"==a.name(n)?n:void 0});if(o.length==i.length){for(n=0;o.length>n;n++)a.unwrap(o[n]);for(e(t).closest("table").find("colgroup").after("<thead></thead>").end().find("thead").append(t),n=0;i.length>n;n++)a.changeTag(i[n],"th")}},removeParagraphs:function(t){var n,i,o,r,s;for(n=0;t.length>n;n++)for(this.removeAttributes(t[n]),r=e(t[n]),s=r.children("p"),i=0,o=s.length;o>i;i++)o-1>i&&a.insertAfter(a.create(document,"br"),s[i]),a.unwrap(s[i])},removeDefaultColors:function(e){for(var t=0;e.length>t;t++)/^\s*color:\s*[^;]*;?$/i.test(e[t].style.cssText)&&a.unwrap(e[t])},tables:function(t){var n,i,o,r,a,s=e(t).find("table"),l=this;for(r=0;s.length>r;r++){for(n=s[r].rows,o=i=n[0],a=1;n.length>a;a++)n[a].cells.length>o.cells.length&&(o=n[a]);l.createColGroup(o),l.convertHeaders(i),l.removeAttributes(s[r]),l.removeParagraphs(s.eq(r).find("td,th")),l.removeDefaultColors(s.eq(r).find("span"))}},clean:function(e){var t,n=this;return e=w.fn.clean.call(n,e),e=n.stripEmptyAnchors(e),t=a.create(document,"div",{innerHTML:e}),n.lists(t),n.tables(t),e=t.innerHTML.replace(/(<[^>]*)\s+class="?[^"\s>]*"?/gi,"$1")}}),C=w.extend({init:function(){this.replacements=[/\s+class="Apple-style-span[^"]*"/gi,"",/<(div|p|h[1-6])\s+style="[^"]*"/gi,"<$1",/^<div>(.*)<\/div>$/,"$1"]},applicable:function(e){return/class="?Apple-style-span|style="[^"]*-webkit-nbsp-mode/i.test(e)}});u(i,{Command:p,GenericCommand:f,InsertHtmlCommand:h,InsertHtmlTool:g,UndoRedoStack:m,TypingHandler:v,SystemHandler:_,Keyboard:k,Clipboard:b,Cleaner:w,MSWordFormatCleaner:x,WebkitFormatCleaner:C}),r("insertHtml",new g({template:new l({template:o.dropDownListTemplate,title:"Insert HTML",initialValue:"Insert HTML"})}))}(window.kendo.jQuery),function(e){var t=window.kendo,n=t.Class,i=t.ui.editor,o=t.ui.Editor.fn.options.formats,r=i.EditorUtils,a=i.Tool,s=i.ToolTemplate,l=i.FormatTool,d=i.Dom,c=i.RangeUtils,u=e.extend,p=i.EditorUtils.registerTool,f=i.EditorUtils.registerFormat,h="k-marker",g=n.extend({init:function(e){this.format=e},numberOfSiblings:function(e){var t,n=0,i=0,o=0,r=e.parentNode;for(t=r.firstChild;t;t=t.nextSibling)t!=e&&(t.className==h?o++:3==t.nodeType?n++:i++);return o>1&&r.firstChild.className==h&&r.lastChild.className==h?0:i+n},findSuitable:function(e,t){return!t&&this.numberOfSiblings(e)>0?null:d.parentOfType(e,this.format[0].tags)},findFormat:function(e){var t,n,i,o,r,a=this.format,s=d.attrEquals;for(t=0,n=a.length;n>t;t++){if(i=e,o=a[t].tags,r=a[t].attr,i&&d.ofType(i,o)&&s(i,r))return i;for(;i;)if(i=d.parentOfType(i,o),i&&s(i,r))return i}return null},isFormatted:function(e){var t,n;for(t=0,n=e.length;n>t;t++)if(this.findFormat(e[t]))return!0;return!1}}),m=n.extend({init:function(e,t){var n=this;n.finder=new g(e),n.attributes=u({},e[0].attr,t),n.tag=e[0].tags[0]},wrap:function(e){return d.wrap(e,d.create(e.ownerDocument,this.tag,this.attributes))},activate:function(e,t){var n=this;n.finder.isFormatted(t)?(n.split(e),n.remove(t)):n.apply(t)},toggle:function(e){var t=c.textNodes(e);t.length>0&&this.activate(e,t)},apply:function(e){var t,n,i,o,r=this,a=[];for(t=0,n=e.length;n>t;t++)i=e[t],o=r.finder.findSuitable(i),o?d.attr(o,r.attributes):o=r.wrap(i),a.push(o);r.consolidate(a)},remove:function(e){var t,n,i,o=this;for(t=0,n=e.length;n>t;t++)i=o.finder.findFormat(e[t]),i&&(o.attributes&&o.attributes.style?(d.unstyle(i,o.attributes.style),i.style.cssText||i.attributes["class"]||d.unwrap(i)):d.unwrap(i))},split:function(e){var t,n,i=c.textNodes(e),o=i.length;if(o>0)for(t=0;o>t;t++)n=this.finder.findFormat(i[t]),n&&c.split(e,n,!0)},consolidate:function(e){for(var t,n;e.length>1;)if(t=e.pop(),n=e[e.length-1],t.previousSibling&&t.previousSibling.className==h&&n.appendChild(t.previousSibling),t.tagName==n.tagName&&t.previousSibling==n&&t.style.cssText==n.style.cssText){for(;t.firstChild;)n.appendChild(t.firstChild);d.remove(t)}}}),v=g.extend({init:function(e,t){var n=this;n.format=e,n.greedyProperty=t,g.fn.init.call(n,e)},getInlineCssValue:function(t){var n,i,o,r,a,s,l,c,u,p,f,h,g=t.attributes,m=e.trim;if(g)for(n=0,i=g.length;i>n;n++)if(o=g[n],r=o.nodeName,a=o.nodeValue,o.specified&&"style"==r)for(s=m(a||t.style.cssText).split(";"),c=0,u=s.length;u>c;c++)if(l=s[c],l.length){if(p=l.split(":"),f=m(p[0].toLowerCase()),h=m(p[1]),f!=this.greedyProperty)continue;return f.indexOf("color")>=0?d.toHex(h):h}},getFormatInner:function(t){var n,i,o,r=e(d.isDataNode(t)?t.parentNode:t),a=r.parentsUntil("[contentEditable]").addBack();for(n=0,i=a.length;i>n;n++)if(o="className"==this.greedyProperty?a[n].className:this.getInlineCssValue(a[n]))return o;return"inherit"},getFormat:function(e){var t,n,i=this.getFormatInner(e[0]);for(t=1,n=e.length;n>t;t++)if(i!=this.getFormatInner(e[t]))return"";return i},isFormatted:function(e){return""!==this.getFormat(e)}}),_=m.extend({init:function(e,n,i){m.fn.init.call(this,e,n),this.values=n,this.finder=new v(e,i),i&&(this.greedyProperty=t.toCamelCase(i))},activate:function(e,t){var n=this.greedyProperty,i="apply";this.split(e),n&&"inherit"==this.values.style[n]&&(i="remove"),this[i](t)}}),k=l.extend({init:function(e){l.fn.init.call(this,u(e,{finder:new g(e.format),formatter:function(){return new m(e.format)}}))}}),b=a.extend({update:function(e,t){var n=e.data(this.type);n.close(),n.value(this.finder.getFormat(t))}}),w=b.extend({init:function(e){var n=this;a.fn.init.call(n,e),n.type=t.support.browser.msie||t.support.touch?"kendoDropDownList":"kendoComboBox",n.format=[{tags:["span"]}],n.finder=new v(n.format,e.cssAttr)},command:function(e){var t=this.options,n=this.format,o={};return new i.FormatCommand(u(e,{formatter:function(){return o[t.domAttr]=e.value,new _(n,{style:o},t.cssAttr)}}))},initialize:function(e,t){var n,i=t.editor,o=this.options,r=o.name,s=[];o.defaultValue&&(s=[{text:i.options.messages[o.defaultValue[0].text],value:o.defaultValue[0].value}]),n=s.concat(o.items?o.items:i.options[r]),e[this.type]({dataTextField:"text",dataValueField:"value",dataSource:n,change:function(){a.exec(i,r,this.value())},highlightFirst:!1}),e.closest(".k-widget").removeClass("k-"+r).find("*").addBack().attr("unselectable","on"),e.data(this.type).value("inherit")}}),y=a.extend({init:function(e){a.fn.init.call(this,e),this.format=[{tags:["span"]}],this.finder=new v(this.format,e.cssAttr)},options:{palette:"websafe"},update:function(){this._widget.close()},command:function(e){var t=this.options,n=this.format,o={};return new i.FormatCommand(u(e,{formatter:function(){return o[t.domAttr]=e.value,new _(n,{style:o},t.cssAttr)}}))},initialize:function(n,i){var o=i.editor,r=this.name,s=u({},y.fn.options,this.options),l=s.palette;n=this._widget=new t.ui.ColorPicker(n,{value:e.isArray(l)?l[0]:"#000",toolIcon:"k-"+s.name,palette:l,change:function(){var e=n.value();e&&a.exec(o,r,e),o.focus()},activate:function(e){e.preventDefault(),n.trigger("change")}}),n.wrapper.attr({title:i.title,unselectable:"on"}).find("*").attr("unselectable","on")}});u(i,{InlineFormatFinder:g,InlineFormatter:m,DelayedExecutionTool:b,GreedyInlineFormatFinder:v,GreedyInlineFormatter:_,InlineFormatTool:k,FontTool:w,ColorTool:y}),f("bold",[{tags:["strong","b"]},{tags:["span"],attr:{style:{fontWeight:"bold"}}}]),p("bold",new k({key:"B",ctrl:!0,format:o.bold,template:new s({template:r.buttonTemplate,title:"Bold"})})),f("italic",[{tags:["em","i"]},{tags:["span"],attr:{style:{fontStyle:"italic"}}}]),p("italic",new k({key:"I",ctrl:!0,format:o.italic,template:new s({template:r.buttonTemplate,title:"Italic"})})),f("underline",[{tags:["span"],attr:{style:{textDecoration:"underline"}}},{tags:["u"]}]),p("underline",new k({key:"U",ctrl:!0,format:o.underline,template:new s({template:r.buttonTemplate,title:"Underline"})})),f("strikethrough",[{tags:["del","strike"]},{tags:["span"],attr:{style:{textDecoration:"line-through"}}}]),p("strikethrough",new k({format:o.strikethrough,template:new s({template:r.buttonTemplate,title:"Strikethrough"})})),f("superscript",[{tags:["sup"]}]),p("superscript",new k({format:o.superscript,template:new s({template:r.buttonTemplate,title:"Superscript"})})),f("subscript",[{tags:["sub"]}]),p("subscript",new k({format:o.subscript,template:new s({template:r.buttonTemplate,title:"Subscript"})})),p("foreColor",new y({cssAttr:"color",domAttr:"color",name:"foreColor",template:new s({template:r.colorPickerTemplate,title:"Color"})})),p("backColor",new y({cssAttr:"background-color",domAttr:"backgroundColor",name:"backColor",template:new s({template:r.colorPickerTemplate,title:"Background Color"})})),p("fontName",new w({cssAttr:"font-family",domAttr:"fontFamily",name:"fontName",defaultValue:[{text:"fontNameInherit",value:"inherit"}],template:new s({template:r.comboBoxTemplate,title:"Font Name"})})),p("fontSize",new w({cssAttr:"font-size",domAttr:"fontSize",name:"fontSize",defaultValue:[{text:"fontSizeInherit",value:"inherit"}],template:new s({template:r.comboBoxTemplate,title:"Font Size"})}))}(window.kendo.jQuery),function(e){var t,n=window.kendo,i=n.Class,o=e.extend,r=n.ui.editor,a=n.ui.Editor.fn.options.formats,s=r.Dom,l=r.Command,d=r.ToolTemplate,c=r.FormatTool,u=r.EditorUtils,p=u.registerTool,f=u.registerFormat,h=r.RangeUtils,g=i.extend({init:function(e){this.format=e},contains:function(e,t){var n,i,o;for(n=0,i=t.length;i>n;n++)if(o=t[n],!o||!s.isAncestorOrSelf(e,o))return!1;return!0},findSuitable:function(t){var n,i,o,r,a=this.format,l=[];for(n=0,i=t.length;i>n;n++){for(r=a.length-1;r>=0&&!(o=s.ofType(t[n],a[r].tags)?t[n]:s.parentOfType(t[n],a[r].tags));r--);if(!o||"true"===o.contentEditable)return[];e.inArray(o,l)<0&&l.push(o)}for(n=0,i=l.length;i>n;n++)if(this.contains(l[n],l))return[l[n]];return l},findFormat:function(e){var t,n,i,o,r,a=this.format;for(t=0,n=a.length;n>t;t++)for(i=e,o=a[t].tags,r=a[t].attr;i;){if(s.ofType(i,o)&&s.attrEquals(i,r))return i;i=i.parentNode}return null},getFormat:function(e){var t,n,i=this,o=function(e){return i.findFormat(s.isDataNode(e)?e.parentNode:e)},r=o(e[0]);if(!r)return"";for(t=1,n=e.length;n>t;t++)if(r!=o(e[t]))return"";return r.nodeName.toLowerCase()},isFormatted:function(e){for(var t=0,n=e.length;n>t;t++)if(!this.findFormat(e[t]))return!1;return!0}}),m=i.extend({init:function(e,t){this.format=e,this.values=t,this.finder=new g(e)},wrap:function(e,t,n){var i,o,r,a,l,d=1==n.length?s.blockParentOrBody(n[0]):s.commonAncestor.apply(null,n);for(s.isInline(d)&&(d=s.blockParentOrBody(d)),i=s.significantChildNodes(d),o=s.findNodeIndex(i[0]),r=s.create(d.ownerDocument,e,t),a=0;i.length>a;a++)l=i[a],s.isBlock(l)?(s.attr(l,t),r.childNodes.length&&(s.insertBefore(r,l),r=r.cloneNode(!1)),o=s.findNodeIndex(l)+1):r.appendChild(l);r.firstChild&&s.insertAt(d,r,o)},apply:function(t){function n(e){return o({},e&&e.attr,c)}var i,r,a,l,d,c=this.values,p=s.filter("img",t),f=u.formatByName("img",this.format),h=n(f);if(e.each(p,function(){s.attr(this,h)}),p.length!=t.length)if(r=s.filter("img",t,!0),a=this.finder.findSuitable(r),a.length)for(l=0,d=a.length;d>l;l++)i=u.formatByName(s.name(a[l]),this.format),s.attr(a[l],n(i));else i=this.format[0],this.wrap(i.tags[0],n(i),r)},remove:function(e){var t,n,i,o,r;for(t=0,n=e.length;n>t;t++)i=this.finder.findFormat(e[t]),i&&(r=s.name(i),"div"!=r||i.getAttribute("class")?(o=u.formatByName(r,this.format),o.attr.style&&s.unstyle(i,o.attr.style),o.attr.className&&s.removeClass(i,o.attr.className)):s.unwrap(i))},toggle:function(e){var t=this,n=h.nodes(e);t.finder.isFormatted(n)?t.remove(n):t.apply(n)}}),v=i.extend({init:function(e,t){var n=this;n.format=e,n.values=t,n.finder=new g(e)},apply:function(e){var t,n,i,o,a,l,d,c=this.format,u=s.blockParents(e),p=c[0].tags[0];if(u.length)for(t=0,n=u.length;n>t;t++)d=s.name(u[t]),"li"==d?(i=u[t].parentNode,o=new r.ListFormatter(i.nodeName.toLowerCase(),p),a=this.editor.createRange(),a.selectNode(u[t]),o.toggle(a)):p&&("td"==d||u[t].attributes.contentEditable)?new m(c,this.values).apply(u[t].childNodes):(l=s.changeTag(u[t],p),s.attr(l,c[0].attr));else new m(c,this.values).apply(e)},toggle:function(e){var t=h.textNodes(e);t.length||(e.selectNodeContents(e.commonAncestorContainer),t=h.textNodes(e),t.length||(t=s.significantChildNodes(e.commonAncestorContainer))),this.apply(t)}}),_=l.extend({init:function(e){e.formatter=e.formatter(),l.fn.init.call(this,e)}}),k=c.extend({init:function(e){c.fn.init.call(this,o(e,{finder:new g(e.format),formatter:function(){return new m(e.format)}}))}});o(r,{BlockFormatFinder:g,BlockFormatter:m,GreedyBlockFormatter:v,FormatCommand:_,BlockFormatTool:k}),t=["ul","ol","li"],f("justifyLeft",[{tags:s.nonListBlockElements,attr:{style:{textAlign:"left"}}},{tags:["img"],attr:{style:{"float":"left",display:"",marginLeft:"",marginRight:""}}},{tags:t,attr:{style:{textAlign:"left",listStylePosition:""}}}]),p("justifyLeft",new k({format:a.justifyLeft,template:new d({template:u.buttonTemplate,title:"Justify Left"})})),f("justifyCenter",[{tags:s.nonListBlockElements,attr:{style:{textAlign:"center"}}},{tags:["img"],attr:{style:{display:"block",marginLeft:"auto",marginRight:"auto","float":""}}},{tags:t,attr:{style:{textAlign:"center",listStylePosition:"inside"}}}]),p("justifyCenter",new k({format:a.justifyCenter,template:new d({template:u.buttonTemplate,title:"Justify Center"})})),f("justifyRight",[{tags:s.nonListBlockElements,attr:{style:{textAlign:"right"}}},{tags:["img"],attr:{style:{"float":"right",display:"",marginLeft:"",marginRight:""}}},{tags:t,attr:{style:{textAlign:"right",listStylePosition:"inside"}}}]),p("justifyRight",new k({format:a.justifyRight,template:new d({template:u.buttonTemplate,title:"Justify Right"})})),f("justifyFull",[{tags:s.nonListBlockElements,attr:{style:{textAlign:"justify"}}},{tags:["img"],attr:{style:{display:"block",marginLeft:"auto",marginRight:"auto","float":""}}},{tags:t,attr:{style:{textAlign:"justify",listStylePosition:""}}}]),p("justifyFull",new k({format:a.justifyFull,template:new d({template:u.buttonTemplate,title:"Justify Full"})}))}(window.kendo.jQuery),function(e){var t=window.kendo,n=e.extend,i=t.ui.editor,o=i.Dom,r=i.Command,a=i.Tool,s=i.BlockFormatter,l=o.normalize,d=i.RangeUtils,c=i.EditorUtils.registerTool,u=r.extend({init:function(e){this.options=e,r.fn.init.call(this,e)},_insertMarker:function(e,t){var n,i=o.create(e,"a");return i.className="k-marker",t.insertNode(i),i.parentNode||(n=t.commonAncestorContainer,n.innerHTML="",n.appendChild(i)),l(i.parentNode),i},_moveFocus:function(e,t){if(o.is(t,"img"))e.setStartBefore(t);else{e.selectNodeContents(t);var n=d.textNodes(e)[0];if(n)o.is(n,"img")?e.setStartBefore(n):e.selectNodeContents(n);else{for(;t.childNodes.length&&!o.is(t.firstChild,"br");)t=t.firstChild;e.selectNodeContents(t)}}},shouldTrim:function(e){var t="p,h1,h2,h3,h4,h5,h6".split(","),n=o.parentOfType(e.startContainer,t),i=o.parentOfType(e.endContainer,t);return n&&!i||!n&&i},_blankAfter:function(e){for(;e&&(o.isMarker(e)||""===o.stripBom(e.nodeValue));)e=e.nextSibling;return!e},exec:function(){var e,t,n,r,a,c,u,p,f=this.getRange(),h=d.documentFromRange(f),g=i.emptyElementContent,m=this.shouldTrim(f);f.deleteContents(),a=this._insertMarker(h,f),c=o.closestEditableOfType(a,["li"]),u=o.closestEditableOfType(a,"h1,h2,h3,h4,h5,h6".split(",")),c?o.emptyNode(c)&&(r=o.create(h,"p"),c.nextSibling&&(p=f.cloneRange(),p.selectNode(c),d.split(p,c.parentNode)),o.insertAfter(r,c.parentNode),o.remove(1==c.parentNode.childNodes.length?c.parentNode:c),r.innerHTML=g,n=r):u&&this._blankAfter(a)&&(r=o.create(h,"p"),o.insertAfter(r,u),r.innerHTML=g,o.remove(a),n=r),n||(c||u||new s([{tags:["p"]}]).apply([a]),f.selectNode(a),e=o.parentOfType(a,[c?"li":u?o.name(u):"p"]),d.split(f,e,m),t=e.previousSibling,o.is(t,"li")&&t.firstChild&&!o.is(t.firstChild,"br")&&(t=t.firstChild),n=e.nextSibling,o.is(n,"li")&&n.firstChild&&!o.is(n.firstChild,"br")&&(n=n.firstChild),o.remove(e),this.clean(t),this.clean(n,{links:!0}),l(t)),l(n),this._moveFocus(f,n),f.collapse(!0),o.scrollTo(n),d.selectRange(f)},clean:function(e,t){var n=e;if(e.firstChild&&o.is(e.firstChild,"br")&&o.remove(e.firstChild),o.isDataNode(e)&&!e.nodeValue&&(e=e.parentNode),e){for(;e.firstChild&&1==e.firstChild.nodeType;)e=e.firstChild;if(!o.isEmpty(e)&&/^\s*$/.test(e.innerHTML)&&(e.innerHTML=i.emptyElementContent),t&&t.links)for(;e!=n;){if(o.is(e,"a")&&o.emptyNode(e)){o.unwrap(e);break}e=e.parentNode}}}}),p=r.extend({init:function(e){this.options=e,r.fn.init.call(this,e)},exec:function(){var e,n=this.getRange(),i=o.create(d.documentFromRange(n),"br");n.deleteContents(),n.insertNode(i),l(i.parentNode),t.support.browser.msie||i.nextSibling&&!o.isWhitespace(i.nextSibling)||(e=i.cloneNode(!0),e.setAttribute("_moz_dirty",""),o.insertAfter(e,i)),n.setStartAfter(i),n.collapse(!0),o.scrollTo(i.nextSibling||i),d.selectRange(n)}});n(i,{ParagraphCommand:u,NewLineCommand:p}),c("insertLineBreak",new a({key:13,shift:!0,command:p})),c("insertParagraph",new a({key:13,command:u}))}(window.kendo.jQuery),function(e){var t=window.kendo,n=t.Class,i=e.extend,o=t.ui.editor,r=o.Dom,a=o.RangeUtils,s=o.EditorUtils,l=o.Command,d=o.ToolTemplate,c=o.FormatTool,u=o.BlockFormatFinder,p=a.textNodes,f=o.EditorUtils.registerTool,h=u.extend({init:function(e){this.tag=e;var t=this.tags=["ul"==e?"ol":"ul",e];
u.fn.init.call(this,[{tags:t}])},isFormatted:function(e){var t,n,i=[];for(n=0;e.length>n;n++)(t=this.findFormat(e[n]))&&r.name(t)==this.tag&&i.push(t);if(1>i.length)return!1;if(i.length!=e.length)return!1;for(n=0;i.length>n&&i[n].parentNode==t.parentNode;n++)if(i[n]!=t)return!1;return!0},findSuitable:function(e){var t=r.parentOfType(e[0],this.tags);return t&&r.name(t)==this.tag?t:null}}),g=n.extend({init:function(e,t){var n=this;n.finder=new h(e),n.tag=e,n.unwrapTag=t},isList:function(e){var t=r.name(e);return"ul"==t||"ol"==t||"dl"==t},wrap:function(e,t){var n,i,o=r.create(e.ownerDocument,"li");for(n=0;t.length>n;n++)if(i=t[n],r.is(i,"li"))e.appendChild(i);else if(this.isList(i))for(;i.firstChild;)e.appendChild(i.firstChild);else if(r.is(i,"td")){for(;i.firstChild;)o.appendChild(i.firstChild);e.appendChild(o),i.appendChild(e),e=e.cloneNode(!1),o=o.cloneNode(!1)}else o.appendChild(i),r.isBlock(i)&&(e.appendChild(o),r.unwrap(i),o=o.cloneNode(!1));o.firstChild&&e.appendChild(o)},containsAny:function(e,t){for(var n=0;t.length>n;n++)if(r.isAncestorOrSelf(e,t[n]))return!0;return!1},suitable:function(e,t){if("k-marker"==e.className){var n=e.nextSibling;if(n&&r.isBlock(n))return!1;if(n=e.previousSibling,n&&r.isBlock(n))return!1}return this.containsAny(e,t)||r.isInline(e)||3==e.nodeType},split:function(t){var n,i,o,s,l,d,c=p(t);if(c.length)for(n=r.parentOfType(c[0],["li"]),i=r.parentOfType(c[c.length-1],["li"]),t.setStartBefore(n),t.setEndAfter(i),o=0,s=c.length;s>o;o++)l=this.finder.findFormat(c[o]),l&&(d=e(l).parents("ul,ol"),d[0]?a.split(t,d.last()[0],!0):a.split(t,l,!0))},merge:function(e,t){for(var n,i=t.previousSibling;i&&("k-marker"==i.className||3==i.nodeType&&r.isWhitespace(i));)i=i.previousSibling;if(i&&r.name(i)==e){for(;t.firstChild;)i.appendChild(t.firstChild);r.remove(t),t=i}for(n=t.nextSibling;n&&("k-marker"==n.className||3==n.nodeType&&r.isWhitespace(n));)n=n.nextSibling;if(n&&r.name(n)==e){for(;t.lastChild;)n.insertBefore(t.lastChild,n.firstChild);r.remove(t)}},breakable:function(e){return e!=e.ownerDocument.body&&!/table|tbody|tr|td/.test(r.name(e))&&!e.attributes.contentEditable},applyOnSection:function(t,n){function i(){u.push(this)}var o,a,s,l,d=this.tag,c=r.closestSplittableParent(n),u=[],p=this.finder.findSuitable(n);for(p||(p=new h("ul"==d?"ol":"ul").findSuitable(n)),/table|tbody/.test(r.name(c))?o=e.map(n,function(e){return r.parentOfType(e,["td"])}):(o=r.significantChildNodes(c),e.grep(o,r.isBlock).length&&(o=e.grep(o,e.proxy(function(e){return this.containsAny(e,n)},this))),o.length||(o=n)),a=0;o.length>a;a++)s=o[a],l=(!p||!r.isAncestorOrSelf(p,s))&&this.suitable(s,n),l&&(p&&this.isList(s)?(e.each(s.childNodes,i),r.remove(s)):u.push(s));u.length==o.length&&this.breakable(c)&&(u=[c]),p||(p=r.create(c.ownerDocument,d),r.insertBefore(p,u[0])),this.wrap(p,u),r.is(p,d)||r.changeTag(p,d),this.merge(d,p)},apply:function(e){var t,n,i,o=0,a=[];do i=r.closestEditable(e[o],["td","body"]),t&&i==t?n.push(e[o]):(t&&a.push({section:t,nodes:n}),n=[e[o]],t=i),o++;while(e.length>o);for(a.push({section:t,nodes:n}),o=0;a.length>o;o++)this.applyOnSection(a[o].section,a[o].nodes)},unwrap:function(t){var n,i,o,a,s=t.ownerDocument.createDocumentFragment(),l=this.unwrapTag;for(i=t.firstChild;i;i=i.nextSibling){for(o=r.create(t.ownerDocument,l||"p");i.firstChild;)a=i.firstChild,r.isBlock(a)?(o.firstChild&&(s.appendChild(o),o=r.create(t.ownerDocument,l||"p")),s.appendChild(a)):o.appendChild(a);o.firstChild&&s.appendChild(o)}n=e(t).parents("ul,ol"),n[0]?(r.insertAfter(s,n.last()[0]),n.last().remove()):r.insertAfter(s,t),r.remove(t)},remove:function(e){var t,n,i;for(n=0,i=e.length;i>n;n++)t=this.finder.findFormat(e[n]),t&&this.unwrap(t)},toggle:function(e){var t,n=this,i=p(e),o=e.commonAncestorContainer;i.length||(e.selectNodeContents(o),i=p(e),i.length||(t=o.ownerDocument.createTextNode(""),e.startContainer.appendChild(t),i=[t],e.selectNode(t.parentNode))),n.finder.isFormatted(i)?(n.split(e),n.remove(i)):n.apply(i)}}),m=l.extend({init:function(e){e.formatter=new g(e.tag),l.fn.init.call(this,e)}}),v=c.extend({init:function(e){this.options=e,c.fn.init.call(this,i(e,{finder:new h(e.tag)}))},command:function(e){return new m(i(e,{tag:this.options.tag}))}});i(o,{ListFormatFinder:h,ListFormatter:g,ListCommand:m,ListTool:v}),f("insertUnorderedList",new v({tag:"ul",template:new d({template:s.buttonTemplate,title:"Insert unordered list"})})),f("insertOrderedList",new v({tag:"ol",template:new d({template:s.buttonTemplate,title:"Insert ordered list"})}))}(window.kendo.jQuery),function(e){var t=window.kendo,n=t.Class,i=e.extend,o=e.proxy,r=t.ui.editor,a=r.Dom,s=r.RangeUtils,l=r.EditorUtils,d=r.Command,c=r.Tool,u=r.ToolTemplate,p=r.InlineFormatter,f=r.InlineFormatFinder,h=s.textNodes,g=r.EditorUtils.registerTool,m=n.extend({findSuitable:function(e){return a.parentOfType(e,["a"])}}),v=n.extend({init:function(){this.finder=new m},apply:function(e,t){var n,i,o,r,l,d=h(e);t.innerHTML?(n=s.getMarkers(e),i=s.documentFromRange(e),e.deleteContents(),r=a.create(i,"a",t),e.insertNode(r),l=r.parentNode,"a"==a.name(l)&&a.insertAfter(r,l),a.emptyNode(l)&&a.remove(l),n.length>1&&(a.insertAfter(n[n.length-1],r),a.insertAfter(n[1],r),a[d.length>0?"insertBefore":"insertAfter"](n[0],r))):(o=new p([{tags:["a"]}],t),o.finder=this.finder,o.apply(d))}}),_=d.extend({init:function(e){e.formatter={toggle:function(e){new p([{tags:["a"]}]).remove(h(e))}},this.options=e,d.fn.init.call(this,e)}}),k=d.extend({init:function(e){var t=this;t.options=e,d.fn.init.call(t,e),t.formatter=new v,e.url?this.exec=function(){this.formatter.apply(e.range,{href:e.url,innerHTML:e.text||e.url,target:e.target})}:(t.attributes=null,t.async=!0)},_dialogTemplate:function(){return t.template("<div class=\"k-editor-dialog k-popup-edit-form k-edit-form-container\"><div class='k-edit-label'><label for='k-editor-link-url'>#: messages.linkWebAddress #</label></div><div class='k-edit-field'><input type='text' class='k-input k-textbox' id='k-editor-link-url'></div><div class='k-edit-label k-editor-link-text-row'><label for='k-editor-link-text'>#: messages.linkText #</label></div><div class='k-edit-field k-editor-link-text-row'><input type='text' class='k-input k-textbox' id='k-editor-link-text'></div><div class='k-edit-label'><label for='k-editor-link-title'>#: messages.linkToolTip #</label></div><div class='k-edit-field'><input type='text' class='k-input k-textbox' id='k-editor-link-title'></div><div class='k-edit-label'></div><div class='k-edit-field'><input type='checkbox' class='k-checkbox' id='k-editor-link-target'><label for='k-editor-link-target'>#: messages.linkOpenInNewWindow #</label></div><div class='k-edit-buttons k-state-default'><button class=\"k-dialog-insert k-button k-primary\">#: messages.dialogInsert #</button><button class=\"k-dialog-close k-button\">#: messages.dialogCancel #</button></div></div>")({messages:this.editor.options.messages})},exec:function(){var t,n,i,r,s=this.getRange().collapsed,l=this.editor.options.messages;this._initialText="",this._range=this.lockRange(!0),t=h(this._range),n=t.length?this.formatter.finder.findSuitable(t[0]):null,i=t.length&&"img"==a.name(t[0]),r=this.createDialog(this._dialogTemplate(),{title:l.createLink,close:o(this._close,this),visible:!1}),r.find(".k-dialog-insert").click(o(this._apply,this)).end().find(".k-dialog-close").click(o(this._close,this)).end().find(".k-edit-field input").keydown(o(this._keydown,this)).end().find("#k-editor-link-url").val(this.linkUrl(n)).end().find("#k-editor-link-text").val(this.linkText(t)).end().find("#k-editor-link-title").val(n?n.title:"").end().find("#k-editor-link-target").attr("checked",n?"_blank"==n.target:!1).end().find(".k-editor-link-text-row").toggle(!i),t.length>0&&!s&&(this._initialText=e("#k-editor-link-text",r).val()),this._dialog=r.data("kendoWindow").center().open(),e("#k-editor-link-url",r).focus().select()},_keydown:function(e){var n=t.keys;e.keyCode==n.ENTER?this._apply(e):e.keyCode==n.ESC&&this._close(e)},_apply:function(t){var n,i,o,r=this._dialog.element,s=e("#k-editor-link-url",r).val(),l=e("#k-editor-link-text",r);s&&"http://"!=s&&(s.indexOf("@")>0&&!/^(\w+:)|(\/\/)/i.test(s)&&(s="mailto:"+s),this.attributes={href:s},n=e("#k-editor-link-title",r).val(),n&&(this.attributes.title=n),l.is(":visible")&&(i=l.val(),i||this._initialText?i&&i!==this._initialText&&(this.attributes.innerHTML=a.stripBom(i)):this.attributes.innerHTML=s),o=e("#k-editor-link-target",r).is(":checked"),this.attributes.target=o?"_blank":null,this.formatter.apply(this._range,this.attributes)),this._close(t),this.change&&this.change()},_close:function(e){e.preventDefault(),this._dialog.destroy(),a.windowFromDocument(s.documentFromRange(this._range)).focus(),this.releaseRange(this._range)},linkUrl:function(e){return e?e.getAttribute("href",2):"http://"},linkText:function(e){var t="";return 1==e.length?t=e[0].nodeValue:e.length&&(t=e[0].nodeValue+e[1].nodeValue),a.stripBom(t||"")},redo:function(){var e=this.lockRange(!0);this.formatter.apply(e,this.attributes),this.releaseRange(e)}}),b=c.extend({init:function(t){this.options=t,this.finder=new f([{tags:["a"]}]),c.fn.init.call(this,e.extend(t,{command:_}))},initialize:function(e,t){c.fn.initialize.call(this,e,t),e.addClass("k-state-disabled")},update:function(e,t){e.toggleClass("k-state-disabled",!this.finder.isFormatted(t)).removeClass("k-state-hover")}});i(t.ui.editor,{LinkFormatFinder:m,LinkFormatter:v,UnlinkCommand:_,LinkCommand:k,UnlinkTool:b}),g("createLink",new c({key:"K",ctrl:!0,command:k,template:new u({template:l.buttonTemplate,title:"Create Link"})})),g("unlink",new b({key:"K",ctrl:!0,shift:!0,template:new u({template:l.buttonTemplate,title:"Remove Link"})}))}(window.kendo.jQuery),function(e,t){var n=window.kendo,i=e.extend,o=n.ui.editor,r=o.EditorUtils,a=o.Dom,s=r.registerTool,l=o.ToolTemplate,d=o.RangeUtils,c=o.Command,u=n.keys,p="#k-editor-image-url",f="#k-editor-image-title",h="#k-editor-image-width",g="#k-editor-image-height",m=c.extend({init:function(e){var t=this;c.fn.init.call(t,e),t.async=!0,t.attributes={}},insertImage:function(e,t){var n,i=this.attributes,o=d.documentFromRange(t);if(i.src&&"http://"!=i.src){if(n=function(){setTimeout(function(){i.width||e.removeAttribute("width"),i.height||e.removeAttribute("height"),e.removeAttribute("complete")})},!e)return e=a.create(o,"img",i),e.onload=e.onerror=function(){n()},t.deleteContents(),t.insertNode(e),e.nextSibling||a.insertAfter(o.createTextNode("﻿"),e),n(),t.setStartAfter(e),t.setEndAfter(e),d.selectRange(t),!0;a.attr(e,i),n()}return!1},_dialogTemplate:function(e){return n.template('<div class="k-editor-dialog k-popup-edit-form k-edit-form-container"># if (showBrowser) { #<div class="k-imagebrowser"></div># } #<div class=\'k-edit-label\'><label for="k-editor-image-url">#: messages.imageWebAddress #</label></div><div class=\'k-edit-field\'><input type="text" class="k-input k-textbox" id="k-editor-image-url"></div><div class=\'k-edit-label\'><label for="k-editor-image-title">#: messages.imageAltText #</label></div><div class=\'k-edit-field\'><input type="text" class="k-input k-textbox" id="k-editor-image-title"></div><div class=\'k-edit-label\'><label for="k-editor-image-width">#: messages.imageWidth #</label></div><div class=\'k-edit-field\'><input type="text" class="k-input k-textbox" id="k-editor-image-width"></div><div class=\'k-edit-label\'><label for="k-editor-image-height">#: messages.imageHeight #</label></div><div class=\'k-edit-field\'><input type="text" class="k-input k-textbox" id="k-editor-image-height"></div><div class="k-edit-buttons k-state-default"><button class="k-dialog-insert k-button k-primary">#: messages.dialogInsert #</button><button class="k-dialog-close k-button">#: messages.dialogCancel #</button></div></div>')({messages:this.editor.options.messages,showBrowser:e})},redo:function(){var e=this,t=e.lockRange();e.insertImage(d.image(t),t)||e.releaseRange(t)},exec:function(){function e(e){var t=s.element,n=parseInt(t.find(h).val(),10),i=parseInt(t.find(g).val(),10);l.attributes={src:t.find(p).val().replace(/ /g,"%20"),alt:t.find(f).val()},l.attributes.width=null,l.attributes.height=null,!isNaN(n)&&n>0&&(l.attributes.width=n),!isNaN(i)&&i>0&&(l.attributes.height=i),m=l.insertImage(v,c),o(e),l.change&&l.change()}function o(e){e.preventDefault(),s.destroy(),a.windowFromDocument(d.documentFromRange(c)).focus(),m||l.releaseRange(c)}function r(t){t.keyCode==u.ENTER?e(t):t.keyCode==u.ESC&&o(t)}var s,l=this,c=l.lockRange(),m=!1,v=d.image(c),_=v&&v.getAttribute("width")||"",k=v&&v.getAttribute("height")||"",b=l.editor.options,w=b.messages,y=b.imageBrowser,x=!!(n.ui.ImageBrowser&&y&&y.transport&&y.transport.read!==t);s=this.createDialog(l._dialogTemplate(x),{title:w.insertImage,close:o,visible:!1,resizable:x}).toggleClass("k-imagebrowser-dialog",x).find(".k-dialog-insert").click(e).end().find(".k-dialog-close").click(o).end().find(".k-edit-field input").keydown(r).end().find(p).val(v?v.getAttribute("src",2):"http://").end().find(f).val(v?v.alt:"").end().find(h).val(_).end().find(g).val(k).end().data("kendoWindow"),x&&new n.ui.ImageBrowser(s.element.find(".k-imagebrowser"),i({},y,{change:function(){s.element.find(p).val(this.value())},apply:e})),s.center().open(),s.element.find(p).focus().select()}});n.ui.editor.ImageCommand=m,s("insertImage",new o.Tool({command:m,template:new l({template:r.buttonTemplate,title:"Insert Image"})}))}(window.kendo.jQuery),function(e,t){var n=window.kendo,i=n.ui.DropDownList,o=n.ui.editor.Dom,r=i.extend({init:function(e,t){var o=this;i.fn.init.call(o,e,t),o.value(o.options.title),n.support.mobileOS.ios&&o._initSelectOverlay(),o.bind("open",function(){if(o.options.autoSize){var e,t=o.list;t.css({whiteSpace:"nowrap",width:"auto"}),e=t.width(),e?e+=20:e=o._listWidth,t.css("width",e+n.support.scrollbar()),o._listWidth=e}})},options:{name:"SelectBox"},_initSelectOverlay:function(){var t=e(this.element),n=e("<select class='k-select-overlay' />"),i=t.closest(".k-widget"),o=this;n.on("change",function(){o.value(this.value),o.trigger("change")}),this.bind("dataBound",function(){var e,t,i=o.value(),r=this.dataSource.view(),a="";for(t=0;r.length>t;t++)e=r[t],a+="<option value='"+e.value+"'",e.value==i&&(a+=" selected"),a+=">"+e.text+"</option>";n.html(a)}),n.insertAfter(i)},value:function(e){var n=this,o=i.fn.value.call(n,e);return e===t?o:(e!==i.fn.value.call(n)&&(n.text(n.options.title),n._current&&n._current.removeClass("k-state-selected"),n.current(null),n._oldIndex=n.selectedIndex=-1),t)},decorate:function(t){var n,i,r,a,s=this,l=s.dataSource,d=l.data();for(t&&s.list.css("background-color",o.getEffectiveBackground(e(t))),n=0;d.length>n;n++)i=d[n].tag||"span",r=d[n].className,a=o.inlineStyle(t,i,{className:r}),a=a.replace(/"/g,"'"),d[n].style=a+";display:inline-block";l.trigger("change")}});n.ui.plugin(r),n.ui.editor.SelectBox=r}(window.kendo.jQuery),function(e,t){function n(n,i){var o="rtl"==e(n).css("direction"),r=o?"Right":"Left",a="td"!=s.name(n)?"margin"+r:"padding"+r;return i===t?n.style[a]||0:(i>0?n.style[a]=i+"px":(n.style[a]="",n.style.cssText||n.removeAttribute("style")),t)}var i=window.kendo,o=i.Class,r=e.extend,a=i.ui.editor,s=a.Dom,l=a.EditorUtils,d=l.registerTool,c=a.Command,u=a.Tool,p=a.ToolTemplate,f=a.RangeUtils,h=s.blockElements,g=a.BlockFormatFinder,m=a.BlockFormatter,v=o.extend({init:function(){this.finder=new g([{tags:s.blockElements}])},apply:function(t){var i,o,r,a,l,d,c,u,p,f,h=this.finder.findSuitable(t),g=[];if(h.length){for(i=0,o=h.length;o>i;i++)s.is(h[i],"li")?e(h[i]).index()?e.inArray(h[i].parentNode,g)<0&&g.push(h[i]):g.push(h[i].parentNode):g.push(h[i]);for(;g.length;)if(r=g.shift(),s.is(r,"li"))if(a=r.parentNode,l=e(r).prev("li"),d=l.find("ul,ol").last(),c=e(r).children("ul,ol")[0],c&&l[0])d[0]?(d.append(r),d.append(e(c).children()),s.remove(c)):(l.append(c),c.insertBefore(r,c.firstChild));else for(c=l.children("ul,ol")[0],c||(c=s.create(r.ownerDocument,s.name(a)),l.append(c));r&&r.parentNode==a;)c.appendChild(r),r=g.shift();else for(u=parseInt(n(r),10)+30,n(r,u),p=0;g.length>p;p++)e.contains(r,g[p])&&g.splice(p,1)}else f=new m([{tags:["p"]}],{style:{marginLeft:30}}),f.apply(t)},remove:function(t){var i,o,r,a,s,l,d,c,u=this.finder.findSuitable(t);for(o=0,r=u.length;r>o;o++){if(d=e(u[o]),d.is("li")){if(a=d.parent(),s=a.parent(),s.is("li,ul,ol")&&!n(a[0])){if(i&&e.contains(i,s[0]))continue;l=d.nextAll("li"),l.length&&e(a[0].cloneNode(!1)).appendTo(d).append(l),s.is("li")?d.insertAfter(s):d.appendTo(s),a.children("li").length||a.remove();continue}if(i==a[0])continue;i=a[0]}else i=u[o];c=parseInt(n(i),10)-30,n(i,c)}}}),_=c.extend({init:function(e){e.formatter={toggle:function(e){(new v).apply(f.nodes(e))}},c.fn.init.call(this,e)}}),k=c.extend({init:function(e){e.formatter={toggle:function(e){(new v).remove(f.nodes(e))}},c.fn.init.call(this,e)}}),b=u.extend({init:function(e){u.fn.init.call(this,e),this.finder=new g([{tags:h}])},initialize:function(e,t){u.fn.initialize.call(this,e,t),e.addClass("k-state-disabled")},update:function(i,o){var r,a,l,d,c=this.finder.findSuitable(o);for(l=0,d=c.length;d>l;l++)if(r=n(c[l]),r||(a=e(c[l]).parents("ul,ol").length,r=s.is(c[l],"li")&&(a>1||n(c[l].parentNode))||s.ofType(c[l],["ul","ol"])&&a>0),r)return i.removeClass("k-state-disabled"),t;i.addClass("k-state-disabled").removeClass("k-state-hover")}});r(a,{IndentFormatter:v,IndentCommand:_,OutdentCommand:k,OutdentTool:b}),d("indent",new u({command:_,template:new p({template:l.buttonTemplate,title:"Indent"})})),d("outdent",new b({command:k,template:new p({template:l.buttonTemplate,title:"Outdent"})}))}(window.kendo.jQuery),function(e){var t=window.kendo,n=e.extend,i=t.ui.editor,o=i.EditorUtils,r=i.Command,a=i.Tool,s=i.ToolTemplate,l=r.extend({init:function(e){var t=this;t.options=e,r.fn.init.call(t,e),t.attributes=null,t.async=!0},exec:function(){function n(e){r.value(s.find(c).val()),i(e),o.change&&o.change(),r.trigger("change")}function i(e){e.preventDefault(),s.data("kendoWindow").destroy(),r.focus()}var o=this,r=o.editor,a=r.options.messages,s=e(t.template(l.template)(a)).appendTo(document.body),d=l.indent(r.value()),c=".k-editor-textarea";this.createDialog(s,{title:a.viewHtml,close:i,visible:!1}).find(c).val(d).end().find(".k-dialog-update").click(n).end().find(".k-dialog-close").click(i).end().data("kendoWindow").center().open(),s.find(c).focus()}});n(l,{template:"<div class='k-editor-dialog k-popup-edit-form k-edit-form-container k-viewhtml-dialog'><textarea class='k-editor-textarea k-input'></textarea><div class='k-edit-buttons k-state-default'><button class='k-dialog-update k-button k-primary'>#: dialogUpdate #</button><button class='k-dialog-close k-button'>#: dialogCancel #</button></div></div>",indent:function(e){return e.replace(/<\/(p|li|ul|ol|h[1-6]|table|tr|td|th)>/gi,"</$1>\n").replace(/<(ul|ol)([^>]*)><li/gi,"<$1$2>\n<li").replace(/<br \/>/gi,"<br />\n").replace(/\n$/,"")}}),t.ui.editor.ViewHtmlCommand=l,i.EditorUtils.registerTool("viewHtml",new a({command:l,template:new s({template:o.buttonTemplate,title:"View HTML"})}))}(window.kendo.jQuery),function(e){function t(t,n,i){return c.extend({init:function(e){c.fn.init.call(this,e),this.finder=i},command:function(t){var i=t.value;return e.isPlainObject(i)?i[n]=i.value:(t.value={},t.value[n]=i),c.fn.command.call(this,t)},initialize:function(e,t){var i,o=window.console,r=this.options.items;for(i=0;r.length>i;i++)r[i][n]=r[i].value;o&&o.warn("The `"+this.options.name+"` tool has been deprecated in favor of the `formatting` tool. See http://docs.telerik.com/kendo-ui/getting-started/changes-and-backward-compatibility for more information"),c.fn.initialize.call(this,e,t)}})}var n=window.kendo,i=n.ui.editor,o=i.Tool,r=i.ToolTemplate,a=i.DelayedExecutionTool,s=i.Dom,l=i.EditorUtils.dropDownListTemplate,d=i.EditorUtils.registerTool,c=a.extend({init:function(e){var t=this;o.fn.init.call(t,n.deepExtend({},t.options,e)),t.type="kendoSelectBox",t.finder={getFormat:function(){return""}}},options:{items:[{text:"Paragraph",value:"p"},{text:"Quotation",value:"blockquote"},{text:"Heading 1",value:"h1"},{text:"Heading 2",value:"h2"},{text:"Heading 3",value:"h3"},{text:"Heading 4",value:"h4"},{text:"Heading 5",value:"h5"},{text:"Heading 6",value:"h6"}],width:90},toFormattingItem:function(e){var t,n=e.value;return n?e.tag||e.className?e:(t=n.indexOf("."),0===t?e.className=n.substring(1):-1==t?e.tag=n:(e.tag=n.substring(0,t),e.className=n.substring(t+1)),e):e},command:function(t){var n=t.value;return n=this.toFormattingItem(n),new i.FormatCommand({range:t.range,formatter:function(){var t,o=(n.tag||n.context||"span").split(","),r=[{tags:o,attr:{className:n.className||""}}];return t=e.inArray(o[0],s.inlineElements)>=0?new i.GreedyInlineFormatter(r):new i.GreedyBlockFormatter(r)}})},initialize:function(e,t){var i=t.editor,r=this.options,a=r.name,s=this;e.width(r.width),e.kendoSelectBox({dataTextField:"text",dataValueField:"value",dataSource:r.items||i.options[a],title:i.options.messages[a],autoSize:!0,change:function(){o.exec(i,a,this.dataItem().toJSON())},dataBound:function(){var e,t=this.dataSource.data();for(e=0;t.length>e;e++)t[e]=s.toFormattingItem(t[e])},highlightFirst:!1,template:n.template('<span unselectable="on" style="display:block;#=(data.style||"")#">#:data.text#</span>')}),e.addClass("k-decorated").closest(".k-widget").removeClass("k-"+a).find("*").addBack().attr("unselectable","on")},getFormattingValue:function(t,n){var i,o,r,a,s,l,d;for(i=0;t.length>i;i++)if(o=t[i],r=o.tag||o.context||"",a=o.className?"."+o.className:"",s=r+a,l=e(n[0]).closest(s)[0]){if(1==n.length)return o.value;for(d=1;n.length>d&&e(n[d]).closest(s)[0];d++)if(d==n.length-1)return o.value}return""},update:function(t,n){var i,o,r,l,d,c=e(t).data(this.type);if(c){for(i=c.dataSource,o=i.data(),d=s.commonAncestor.apply(null,n),r=0;o.length>r;r++)l=o[r].context,o[r].visible=!l||!!e(d).closest(l).length;i.filter([{field:"visible",operator:"eq",value:!0}]),a.fn.update.call(this,t,n),c.value(this.getFormattingValue(i.view(),n)),c.wrapper.toggleClass("k-state-disabled",!i.view().length)}}}),u=t("style","className",new i.GreedyInlineFormatFinder([{tags:["span"]}],"className")),p=t("formatBlock","tag",new i.BlockFormatFinder([{tags:s.blockElements}]));e.extend(i,{FormattingTool:c,StyleTool:u,FormatBlockTool:p}),d("formatting",new c({template:new r({template:l,title:"Format"})})),d("style",new u({template:new r({template:l,title:"Styles"})})),d("formatBlock",new p({template:new r({template:l})}))}(window.kendo.jQuery),function(e){var t=window.kendo,n=t.ui,i=n.editor,o=n.Widget,r=e.extend,a=e.proxy,s=t.keys,l=".kendoEditor",d="a.k-tool:not(.k-state-disabled),.k-widget.k-colorpicker,.k-selectbox,.k-dropdown,.k-combobox .k-input",c=o.extend({init:function(e,t){var n=this;t=r({},t,{name:"EditorToolbar"}),o.fn.init.call(n,e,t),t.popup&&n._initPopup()},events:["execute"],groups:{basic:["bold","italic","underline","strikethrough"],scripts:["subscript","superscript"],alignment:["justifyLeft","justifyCenter","justifyRight","justifyFull"],links:["insertImage","createLink","unlink"],lists:["insertUnorderedList","insertOrderedList","indent","outdent"],tables:["createTable","addColumnLeft","addColumnRight","addRowAbove","addRowBelow","deleteRow","deleteColumn"],advanced:["viewHtml"]},_initPopup:function(){this.window=e(this.element).wrap("<div class='editorToolbarWindow k-header' />").parent().prepend("<button class='k-button k-button-bare k-editortoolbar-dragHandle'><span class='k-icon k-i-move' /></button>").kendoWindow({title:!1,resizable:!1,draggable:{dragHandle:".k-editortoolbar-dragHandle"},animation:{open:{effects:"fade:in"},close:{effects:"fade:out"}},minHeight:42,visible:!1,autoFocus:!1,actions:[],dragend:function(){this._moved=!0}}).on("mousedown",function(t){e(t.target).is(".k-icon")||t.preventDefault()}).data("kendoWindow")},items:function(){return this.element.children().find("> *, select")},focused:function(){return this.element.find(".k-state-focused").length>0},toolById:function(e){var t,n=this.tools;for(t in n)if(t.toLowerCase()==e)return n[t]},toolGroupFor:function(t){var n,i=this.groups;if(this.isCustomTool(t))return"custom";for(n in i)if(e.inArray(t,i[n])>=0)return n},bindTo:function(t){var n=this,i=n.window;n._editor&&n._editor.unbind("select",a(n._updateTool,n)),n._editor=t,n.tools=n.expandTools(t.options.tools),n.render(),n.element.find(".k-combobox .k-input").keydown(function(t){var n=e(this).closest(".k-combobox").data("kendoComboBox"),i=t.keyCode;i==s.RIGHT||i==s.LEFT?n.close():i==s.DOWN&&(n.dropDown.isOpened()||(t.stopImmediatePropagation(),n.open()))}),n._attachEvents(),n.items().each(function(){var i,o=n._toolName(this),r=n.tools[o],a=r&&r.options,s=t.options.messages,l=a&&a.tooltip||s[o],d=e(this);r&&r.initialize&&(("fontSize"==o||"fontName"==o)&&(i=s[o+"Inherit"],d.find("input").val(i).end().find("span.k-input").text(i).end()),r.initialize(d,{title:n._appendShortcutSequence(l,r),editor:n._editor}),d.closest(".k-widget",n.element).addClass("k-editor-widget"),d.closest(".k-colorpicker",n.element).next(".k-colorpicker").addClass("k-editor-widget"))}),t.bind("select",a(n._updateTool,n)),n.update(),i&&i.wrapper.css({top:"",left:"",width:""})},show:function(){var e,t,n=this,i=n.window,o=n.options.editor;i&&(e=i.wrapper,t=o.element,e.is(":visible")&&n.window.options.visible||(e[0].style.width||e.width(t.outerWidth()-parseInt(e.css("border-left-width"),10)-parseInt(e.css("border-right-width"),10)),i._moved||(e.css("top",parseInt(t.offset().top,10)-e.outerHeight()-parseInt(n.window.element.css("padding-bottom"),10)),e.css("left",parseInt(t.offset().left,10))),i.open()))},hide:function(){this.window&&this.window.close()},focus:function(){var e="tabIndex",t=this.element,n=this._editor.element.attr(e);t.attr(e,n||0).focus().find(d).first().focus(),n||0===n||t.removeAttr(e)},_appendShortcutSequence:function(e,t){if(!t.key)return e;var n=e+" (";return t.ctrl&&(n+="Ctrl + "),t.shift&&(n+="Shift + "),t.alt&&(n+="Alt + "),n+=t.key+")"},_nativeTools:["insertLineBreak","insertParagraph","redo","undo"],tools:{},isCustomTool:function(e){return!(e in t.ui.Editor.defaultTools)},expandTools:function(n){var o,a,s,l,d=this._nativeTools,c=t.deepExtend({},t.ui.Editor.defaultTools),u={};for(a=0;n.length>a;a++)o=n[a],l=o.name,e.isPlainObject(o)?l&&c[l]?(u[l]=r({},c[l]),r(u[l].options,o)):(s=r({cssClass:"k-i-custom",type:"button",title:""},o),s.name||(s.name="custom"),s.cssClass="k-"+("custom"==s.name?"i-custom":s.name),s.template||"button"!=s.type||(s.template=i.EditorUtils.buttonTemplate,s.title=s.title||s.tooltip),u[l]={options:s}):c[o]&&(u[o]=c[o]);for(a=0;d.length>a;a++)u[d[a]]||(u[d[a]]=c[d[a]]);return u},render:function(){function n(n){var i;return n.getHtml?i=n.getHtml():(e.isFunction(n)||(n=t.template(n)),i=n(r)),e.trim(i)}function i(){p.children().length&&p.appendTo(v)}function o(){p=e("<li class='k-tool-group' role='presentation' />")}var r,s,l,d,c,u,p,f,h=this,g=h.tools,m=h._editor.element,v=h.element.empty(),_=h._editor.options.tools,k=t.support.browser;for(v.empty(),o(),f=0;_.length>f;f++)d=_[f].name||_[f],r=g[d]&&g[d].options,!r&&e.isPlainObject(d)&&(r=d),s=r&&r.template,"break"==d&&(i(),e("<li class='k-row-break' />").appendTo(h.element),o()),s&&(u=h.toolGroupFor(d),c!=u&&(i(),o(),c=u),s=n(s),l=e(s).appendTo(p),"custom"==u&&(i(),o()),r.exec&&l.hasClass("k-tool")&&l.click(a(r.exec,m[0])));i(),e(h.element).children(":has(> .k-tool)").addClass("k-button-group"),h.options.popup&&k.msie&&9>k.version&&h.window.wrapper.find("*").attr("unselectable","on"),this.updateGroups()},updateGroups:function(){e(this.element).children().each(function(){e(this).children().filter(function(){return"none"!==this.style.display}).removeClass("k-group-end").first().addClass("k-group-start").end().last().addClass("k-group-end").end()})},decorateFrom:function(t){this.items().filter(".k-decorated").each(function(){var n=e(this).data("kendoSelectBox");n&&n.decorate(t)})},destroy:function(){o.fn.destroy.call(this);var e,t=this.tools;for(e in t)t[e].destroy&&t[e].destroy();this.window&&this.window.destroy()},_attachEvents:function(){var t=this,n="[role=button].k-tool",i=n+":not(.k-state-disabled)",o=n+".k-state-disabled";t.element.off(l).on("mouseenter"+l,i,function(){e(this).addClass("k-state-hover")}).on("mouseleave"+l,i,function(){e(this).removeClass("k-state-hover")}).on("mousedown"+l,n,function(e){e.preventDefault()}).on("keydown"+l,d,function(n){function i(e,n){var i=t.element.find(d),o=i.index(r)+e;return n&&(o=Math.max(0,Math.min(i.length-1,o))),i[o]}var o,r=this,a=n.keyCode;a==s.RIGHT||a==s.LEFT?e(r).hasClass(".k-dropdown")||(o=i(a==s.RIGHT?1:-1,!0)):a==s.ESC?o=t._editor:a!=s.TAB||n.ctrlKey||n.altKey||(n.shiftKey?o=i(-1):(o=i(1),o||(o=t._editor))),o&&(n.preventDefault(),o.focus())}).on("click"+l,i,function(n){var i=e(this);n.preventDefault(),n.stopPropagation(),i.removeClass("k-state-hover"),i.is("[data-popup]")||t._editor.exec(t._toolName(this))}).on("click"+l,o,function(e){e.preventDefault()})},_toolName:function(t){var n,i;if(t)return n=t.className,/k-tool\b/i.test(n)&&(n=t.firstChild.className),i=e.grep(n.split(" "),function(e){return!/^k-(widget|tool|tool-icon|state-hover|header|combobox|dropdown|selectbox|colorpicker)$/i.test(e)}),i[0]?i[0].substring(i[0].lastIndexOf("-")+1):"custom"},_updateTool:function(){var n=this,i=n._editor,o=i.getRange(),r=t.ui.editor.RangeUtils.textNodes(o);r.length||(r=[o.startContainer]),n.items().each(function(){var t=n.tools[n._toolName(this)];t&&t.update&&t.update(e(this),r)}),this.update()},update:function(){this.element.children().children().each(function(){var t=e(this);t.css("display",t.hasClass("k-state-disabled")?"none":"")}),this.updateGroups()}});e.extend(i,{Toolbar:c})}(window.jQuery),function(e){var t=window.kendo,n=e.extend,i=e.proxy,o=t.ui.editor,r=o.Dom,a=o.EditorUtils,s=o.Command,l=".kendoEditor",d="k-state-active",c="k-state-selected",u=o.Tool,p=o.ToolTemplate,f=o.InsertHtmlCommand,h=o.BlockFormatFinder,g=o.EditorUtils.registerTool,m="<td>"+o.emptyElementContent+"</td>",v=new h([{tags:["table"]}]),_=f.extend({_tableHtml:function(e,t){return e=e||1,t=t||1,"<table class='k-table' data-last>"+Array(e+1).join("<tr>"+Array(t+1).join(m)+"</tr>")+"</table>"},postProcess:function(t,n){var i=e("table[data-last]",t.document).removeAttr("data-last");n.selectNodeContents(i.find("td")[0]),t.selectRange(n)},exec:function(){var e=this.options;e.html=this._tableHtml(e.rows,e.columns),e.postProcess=this.postProcess,f.fn.exec.call(this)}}),k=u.extend({initialize:function(t,n){u.fn.initialize.call(this,t,n);var o=e(this.options.popupTemplate).appendTo("body").kendoPopup({anchor:t,copyAnchorStyles:!1,open:i(this._open,this),activate:i(this._activate,this),close:i(this._close,this)}).data("kendoPopup");t.click(i(this._toggle,this)).keydown(i(this._keydown,this)),this._editor=n.editor,this._popup=o},popup:function(){return this._popup},_activate:e.noop,_open:function(){this._popup.options.anchor.addClass(d)},_close:function(){this._popup.options.anchor.removeClass(d)},_keydown:function(e){var n=t.keys,i=e.keyCode;i==n.DOWN&&e.altKey?this._popup.open():i==n.ESC&&this._popup.close()},_toggle:function(t){var n=e(t.target).closest(".k-tool");n.hasClass("k-state-disabled")||this.popup().toggle()},update:function(e){this.popup().close(),e.removeClass("k-state-hover")},destroy:function(){this._popup.destroy()}}),b=k.extend({init:function(t){this.cols=8,this.rows=6,k.fn.init.call(this,e.extend(t,{command:_,popupTemplate:"<div class='k-ct-popup'>"+Array(this.cols*this.rows+1).join("<span class='k-ct-cell k-state-disabled' />")+"<div class='k-status'>Cancel</div></div>"}))},_activate:function(){function n(t){var n=e(window);return{row:Math.floor((t.clientY+n.scrollTop()-u.top)/o)+1,col:Math.floor((t.clientX+n.scrollLeft()-u.left)/i)+1}}var i,o,r=this,a=r._popup.element,s=a.find(".k-ct-cell"),d=s.eq(0),c=s.eq(s.length-1),u=t.getOffset(d),p=t.getOffset(c),f=r.cols,h=r.rows;p.left+=c[0].offsetWidth,p.top+=c[0].offsetHeight,i=(p.left-u.left)/f,o=(p.top-u.top)/h,a.on("mousemove"+l,function(e){r._setTableSize(n(e))
}).on("mouseleave"+l,function(){r._setTableSize()}).on("mouseup"+l,function(e){r._exec(n(e))})},_valid:function(e){return e&&e.row>0&&e.col>0&&this.rows>=e.row&&this.cols>=e.col},_exec:function(e){this._valid(e)&&(this._editor.exec("createTable",{rows:e.row,columns:e.col}),this._popup.close())},_setTableSize:function(n){var i=this._popup.element,o=i.find(".k-status"),r=i.find(".k-ct-cell"),a=this.cols;this._valid(n)?(o.text(t.format("Create a {0} x {1} table",n.row,n.col)),r.each(function(t){e(this).toggleClass(c,n.col>t%a&&n.row>t/a)})):(o.text("Cancel"),r.removeClass(c))},_keydown:function(e){var n,i,o,r,a,s,l,d;k.fn._keydown.call(this,e),n=t.keys,i=e.keyCode,o=this._popup.element.find(".k-ct-cell"),r=Math.max(o.filter(".k-state-selected").last().index(),0),a=Math.floor(r/this.cols),s=r%this.cols,l=!1,i!=n.DOWN||e.altKey?i==n.UP?(l=!0,a--):i==n.RIGHT?(l=!0,s++):i==n.LEFT&&(l=!0,s--):(l=!0,a++),d={row:Math.max(1,Math.min(this.rows,a+1)),col:Math.max(1,Math.min(this.cols,s+1))},i==n.ENTER?this._exec(d):this._setTableSize(d),l&&(e.preventDefault(),e.stopImmediatePropagation())},_open:function(){k.fn._open.call(this),this.popup().element.find(".k-ct-cell").removeClass(c)},_close:function(){k.fn._close.call(this),this.popup().element.off(l)},update:function(e,t){var n;k.fn.update.call(this,e),n=v.isFormatted(t),e.toggleClass("k-state-disabled",n)}}),w=s.extend({exec:function(){for(var e,t,n,i,a=this.lockRange(!0),s=a.endContainer;"td"!=r.name(s);)s=s.parentNode;for(t=s.parentNode,e=t.children.length,n=t.cloneNode(!0),i=0;t.cells.length>i;i++)n.cells[i].innerHTML=o.emptyElementContent;"before"==this.options.position?r.insertBefore(n,t):r.insertAfter(n,t),this.releaseRange(a)}}),y=s.extend({exec:function(){var e,t,n,i,a=this.lockRange(!0),s=r.closest(a.endContainer,"td"),l=r.closest(s,"table"),d=l.rows,c=this.options.position;for(e=r.findNodeIndex(s),t=0;d.length>t;t++)n=d[t].cells[e],i=n.cloneNode(),i.innerHTML=o.emptyElementContent,"before"==c?r.insertBefore(i,n):r.insertAfter(i,n);this.releaseRange(a)}}),x=s.extend({exec:function(){var e,t=this.lockRange(),n=r.closest(t.endContainer,"tr"),i=r.closest(n,"table"),o=i.rows.length;1==o?(e=r.next(i),(!e||r.insignificant(e))&&(e=r.prev(i)),r.remove(i)):(r.removeTextSiblings(n),e=r.next(n)||r.prev(n),e=e.cells[0],r.remove(n)),e&&(t.setStart(e,0),t.collapse(!0),this.editor.selectRange(t))}}),C=s.extend({exec:function(){var e,t,n=this.lockRange(),i=r.closest(n.endContainer,"td"),o=r.closest(i,"table"),a=o.rows,s=r.findNodeIndex(i,!0),l=a[0].cells.length;if(1==l)e=r.next(o),(!e||r.insignificant(e))&&(e=r.prev(o)),r.remove(o);else for(r.removeTextSiblings(i),e=r.next(i)||r.prev(i),t=0;a.length>t;t++)r.remove(a[t].cells[s]);e&&(n.setStart(e,0),n.collapse(!0),this.editor.selectRange(n))}}),T=u.extend({command:function(e){return e=n(e,this.options),"delete"==e.action?"row"==e.type?new x(e):new C(e):"row"==e.type?new w(e):new y(e)},initialize:function(e,t){u.fn.initialize.call(this,e,t),e.addClass("k-state-disabled")},update:function(e,t){var n=!v.isFormatted(t);e.toggleClass("k-state-disabled",n)}});n(t.ui.editor,{PopupTool:k,TableCommand:_,InsertTableTool:b,TableModificationTool:T,InsertRowCommand:w,InsertColumnCommand:y,DeleteRowCommand:x,DeleteColumnCommand:C}),g("createTable",new b({template:new p({template:a.buttonTemplate,popup:!0,title:"Create table"})})),g("addColumnLeft",new T({type:"column",position:"before",template:new p({template:a.buttonTemplate,title:"Add column on the left"})})),g("addColumnRight",new T({type:"column",template:new p({template:a.buttonTemplate,title:"Add column on the right"})})),g("addRowAbove",new T({type:"row",position:"before",template:new p({template:a.buttonTemplate,title:"Add row above"})})),g("addRowBelow",new T({type:"row",template:new p({template:a.buttonTemplate,title:"Add row below"})})),g("deleteRow",new T({type:"row",action:"delete",template:new p({template:a.buttonTemplate,title:"Delete row"})})),g("deleteColumn",new T({type:"column",action:"delete",template:new p({template:a.buttonTemplate,title:"Delete column"})}))}(window.kendo.jQuery),window.kendo})();(function(e,t){var n=window.kendo,i=n.caret,o=n.keys,r=n.ui,a=r.Widget,s=".kendoMaskedTextBox",l=e.proxy,d=(n.support.propertyChangeEvent?"propertychange":"input")+s,c="k-state-disabled",u="disabled",p="readonly",f="change",h=a.extend({init:function(t,o){var r,l,d=this;a.fn.init.call(d,t,o),d._rules=e.extend({},d.rules,d.options.rules),t=d.element,r=t[0],d.wrapper=t,d._tokenize(),d._reset(),d.element.addClass("k-textbox").attr("autocomplete","off").on("focus"+s,function(){var e=r.value;d._oldValue=e,e||(r.value=d._old=d._emptyMask),d._timeoutId=setTimeout(function(){i(t,0,e?d._maskLength:0)})}).on("blur"+s,function(){var e=t.val();clearTimeout(d._timeoutId),r.value=d._old="",e!==d._emptyMask&&(r.value=d._old=e),d._change()}),l=t.is("[disabled]"),l?d.enable(!1):d.readonly(t.is("[readonly]")),d.value(d.options.value||t.val()),n.notify(d)},options:{name:"MaskedTextBox",promptChar:"_",culture:"",rules:{},value:"",mask:""},events:[f],rules:{0:/\d/,9:/\d|\s/,"#":/\d|\s|\+|\-/,L:/[a-zA-Z]/,"?":/[a-zA-Z]|\s/,"&":/\S/,C:/./,A:/[a-zA-Z0-9]/,a:/[a-zA-Z0-9]|\s/},setOptions:function(t){var n=this;a.fn.setOptions.call(n,t),n._rules=e.extend({},n.rules,n.options.rules),n._tokenize(),this._unbindInput(),this._bindInput(),n.value(n.element.val())},destroy:function(){var e=this;e.element.off(s),e._form&&e._form.off("reset",e._resetHandler),a.fn.destroy.call(e)},value:function(e){var i=this.element,o=this._emptyMask;return e===t?this.element.val():o?(e=this._unmask(e+""),i.val(e?o:""),this._mask(0,this._maskLength,e),n._activeElement()!==i&&i.val()===o&&i.val(""),t):(i.val(e),t)},readonly:function(e){this._editable({readonly:e===t?!0:e,disable:!1})},enable:function(e){this._editable({readonly:!1,disable:!(e=e===t?!0:e)})},_bindInput:function(){var e=this;e._maskLength&&e.element.on("keydown"+s,l(e._keydown,e)).on("keypress"+s,l(e._keypress,e)).on("paste"+s,l(e._paste,e)).on(d,l(e._propertyChange,e))},_unbindInput:function(){this.element.off("keydown"+s).off("keypress"+s).off("paste"+s).off(d)},_editable:function(e){var t=this,n=t.element,i=e.disable,o=e.readonly;t._unbindInput(),o||i?n.attr(u,i).attr(p,o).toggleClass(c,i):(n.removeAttr(u).removeAttr(p).removeClass(c),t._bindInput())},_change:function(){var e=this,t=e.value();t!==e._oldValue&&(e._oldValue=t,e.trigger(f),e.element.trigger(f))},_propertyChange:function(){var e,t,n=this,o=n.element[0],r=o.value;r===n._old||n._pasting||(t=i(o)[0],e=n._unmask(r.substring(t),t),o.value=n._old=r.substring(0,t)+n._emptyMask.substring(t),n._mask(t,t,e),i(o,t))},_paste:function(e){var t=this,n=e.target,o=i(n),r=o[0],a=o[1],s=t._unmask(n.value.substring(a),a);t._pasting=!0,setTimeout(function(){var e=n.value,o=e.substring(r,i(n)[0]);n.value=t._old=e.substring(0,r)+t._emptyMask.substring(r),t._mask(r,r,o),r=i(n)[0],t._mask(r,r,s),i(n,r),t._pasting=!1})},_reset:function(){var t=this,n=t.element,i=n.attr("form"),o=i?e("#"+i):n.closest("form");o[0]&&(t._resetHandler=function(){setTimeout(function(){t.value(n[0].value)})},t._form=o.on("reset",t._resetHandler))},_keydown:function(e){var n,r=e.keyCode,a=this.element[0],s=i(a),l=s[0],d=s[1],c=r===o.BACKSPACE;c||r===o.DELETE?(l===d&&(c?l-=1:d+=1,n=this._find(l,c)),n!==t&&n!==l?(c&&(n+=1),i(a,n)):l>-1&&this._mask(l,d,"",c),e.preventDefault()):r===o.ENTER&&(this._change(),e.preventDefault())},_keypress:function(e){if(0!==e.which&&!e.ctrlKey){var t=i(this.element);this._mask(t[0],t[1],String.fromCharCode(e.which)),e.preventDefault()}},_find:function(e,t){var n=this.element.val()||this._emptyMask,i=1;for(t===!0&&(i=-1);e>-1||this._maskLength>=e;){if(n.charAt(e)!==this.tokens[e])return e;e+=i}return-1},_mask:function(e,o,r,a){var s,l,d,c,u=this.element[0],p=u.value||this._emptyMask,f=this.options.promptChar,h=0;for(e=this._find(e,a),e>o&&(o=e),l=this._unmask(p.substring(o),o),r=this._unmask(r,e),s=r.length,r&&(l=l.replace(RegExp("^_{0,"+s+"}"),"")),r+=l,p=p.split(""),d=r.charAt(h);this._maskLength>e;)p[e]=d||f,d=r.charAt(++h),c===t&&h>s&&(c=e),e=this._find(e+1);u.value=this._old=p.join(""),n._activeElement()===u&&(c===t&&(c=this._maskLength),i(u,c))},_unmask:function(t,n){var i,o,r,a,s,l,d,c;if(!t)return"";for(t=(t+"").split(""),r=0,a=n||0,s=this.options.promptChar,l=t.length,d=this.tokens.length,c="";d>a&&(i=t[r],o=this.tokens[a],i===o||i===s?(c+=i===s?s:"",r+=1,a+=1):"string"!=typeof o?((o.test&&o.test(i)||e.isFunction(o)&&o(i))&&(c+=i,a+=1),r+=1):a+=1,!(r>=l)););return c},_tokenize:function(){for(var e,t,i,o,r=[],a=0,s=this.options.mask||"",l=s.split(""),d=l.length,c=0,u="",p=this.options.promptChar,f=n.getCulture(this.options.culture).numberFormat,h=this._rules;d>c;c++)if(e=l[c],t=h[e])r[a]=t,u+=p,a+=1;else for("."===e||","===e?e=f[e]:"$"===e?e=f.currency.symbol:"\\"===e&&(c+=1,e=l[c]),e=e.split(""),i=0,o=e.length;o>i;i++)r[a]=e[i],u+=e[i],a+=1;this.tokens=r,this._emptyMask=u,this._maskLength=u.length}});r.plugin(h)})(window.kendo.jQuery);(function(e,t){function n(t){t=e(t),t.children(v).children(".k-icon").remove(),t.filter(":has(.k-panel),:has(.k-content)").children(".k-link:not(:has([class*=k-i-arrow]))").each(function(){var t=e(this),n=t.parent();t.append("<span class='k-icon "+(n.hasClass(I)?"k-i-arrow-n k-panelbar-collapse":"k-i-arrow-s k-panelbar-expand")+"'/>")})}function i(t){t=e(t),t.filter(".k-first:not(:first-child)").removeClass(C),t.filter(".k-last:not(:last-child)").removeClass(m),t.filter(":first-child").addClass(C),t.filter(":last-child").addClass(m)}var r=window.kendo,o=r.ui,a=r.keys,s=e.extend,l=e.each,d=r.template,c=o.Widget,u=/^(ul|a|div)$/i,p=".kendoPanelBar",f="img",h="href",m="k-last",g="k-link",v="."+g,_="error",k=".k-item",b=".k-group",w=b+":visible",y="k-image",C="k-first",x="expand",T="select",S="k-content",F="activate",D="collapse",E="mouseenter",H="mouseleave",A="contentLoad",I="k-state-active",M="> .k-panel",z="> .k-content",R="k-state-focused",N="k-state-disabled",O="k-state-selected",P="."+O,L="k-state-highlight",B=k+":not(.k-state-disabled)",W=B+" > .k-link",U=k+".k-state-disabled > .k-link",q="> li > "+P+", .k-panel > li > "+P,V="k-state-default",j="aria-disabled",$="aria-expanded",G="aria-hidden",Y="aria-selected",K=":visible",Q=":empty",J="single",X={content:d("<div role='region' class='k-content'#= contentAttributes(data) #>#= content(item) #</div>"),group:d("<ul role='group' aria-hidden='true' class='#= groupCssClass(group) #'#= groupAttributes(group) #>#= renderItems(data) #</ul>"),itemWrapper:d("<#= tag(item) # class='#= textClass(item, group) #' #= contentUrl(item) ##= textAttributes(item) #>#= image(item) ##= sprite(item) ##= text(item) ##= arrow(data) #</#= tag(item) #>"),item:d("<li role='menuitem' #=aria(item)#class='#= wrapperCssClass(group, item) #'>#= itemWrapper(data) ## if (item.items) { ##= subGroup({ items: item.items, panelBar: panelBar, group: { expanded: item.expanded } }) ## } else if (item.content || item.contentUrl) { ##= renderContent(data) ## } #</li>"),image:d("<img class='k-image' alt='' src='#= imageUrl #' />"),arrow:d("<span class='#= arrowClass(item) #'></span>"),sprite:d("<span class='k-sprite #= spriteCssClass #'></span>"),empty:d("")},Z={aria:function(e){var t="";return(e.items||e.content||e.contentUrl)&&(t+=$+"='"+(e.expanded?"true":"false")+"' "),e.enabled===!1&&(t+=j+"='true'"),t},wrapperCssClass:function(e,t){var n="k-item",i=t.index;return n+=t.enabled===!1?" "+N:t.expanded===!0?" "+I:" k-state-default",0===i&&(n+=" k-first"),i==e.length-1&&(n+=" k-last"),t.cssClass&&(n+=" "+t.cssClass),n},textClass:function(e,t){var n=g;return t.firstLevel&&(n+=" k-header"),n},textAttributes:function(e){return e.url?" href='"+e.url+"'":""},arrowClass:function(e){var t="k-icon";return t+=e.expanded?" k-i-arrow-n k-panelbar-collapse":" k-i-arrow-s k-panelbar-expand"},text:function(e){return e.encoded===!1?e.text:r.htmlEncode(e.text)},tag:function(e){return e.url||e.contentUrl?"a":"span"},groupAttributes:function(e){return e.expanded!==!0?" style='display:none'":""},groupCssClass:function(){return"k-group k-panel"},contentAttributes:function(e){return e.item.expanded!==!0?" style='display:none'":""},content:function(e){return e.content?e.content:e.contentUrl?"":"&nbsp;"},contentUrl:function(e){return e.contentUrl?'href="'+e.contentUrl+'"':""}},et=c.extend({init:function(t,n){var i,o=this;c.fn.init.call(o,t,n),t=o.wrapper=o.element.addClass("k-widget k-reset k-header k-panelbar"),n=o.options,t[0].id&&(o._itemId=t[0].id+"_pb_active"),o._tabindex(),o._initData(n),o._updateClasses(),o._animations(n),t.on("click"+p,W,function(t){o._click(e(t.currentTarget))&&t.preventDefault()}).on(E+p+" "+H+p,W,o._toggleHover).on("click"+p,U,!1).on("keydown"+p,e.proxy(o._keydown,o)).on("focus"+p,function(){var e=o.select();o._current(e[0]?e:o._first())}).on("blur"+p,function(){o._current(null)}).attr("role","menu"),i=t.find("li."+I+" > ."+S),i[0]&&o.expand(i.parent(),!1),r.notify(o)},events:[x,D,T,F,_,A],options:{name:"PanelBar",animation:{expand:{effects:"expand:vertical",duration:200},collapse:{duration:200}},expandMode:"multiple"},destroy:function(){c.fn.destroy.call(this),this.element.off(p),r.destroy(this.element)},_initData:function(e){var t=this;e.dataSource&&(t.element.empty(),t.append(e.dataSource,t.element))},setOptions:function(e){var t=this.options.animation;this._animations(e),e.animation=s(!0,t,e.animation),"dataSource"in e&&this._initData(e),c.fn.setOptions.call(this,e)},expand:function(t,n){var i=this,r={};return n=n!==!1,t=this.element.find(t),t.each(function(o,a){a=e(a);var s=a.find(M).add(a.find(z));if(!a.hasClass(N)&&s.length>0){if(i.options.expandMode==J&&i._collapseAllExpanded(a))return i;t.find("."+L).removeClass(L),a.addClass(L),n||(r=i.options.animation,i.options.animation={expand:{effects:{}},collapse:{hide:!0,effects:{}}}),i._triggerEvent(x,a)||i._toggleItem(a,!1),n||(i.options.animation=r)}}),i},collapse:function(t,n){var i=this,r={};return n=n!==!1,t=i.element.find(t),t.each(function(t,o){o=e(o);var a=o.find(M).add(o.find(z));!o.hasClass(N)&&a.is(K)&&(o.removeClass(L),n||(r=i.options.animation,i.options.animation={expand:{effects:{}},collapse:{hide:!0,effects:{}}}),i._triggerEvent(D,o)||i._toggleItem(o,!0),n||(i.options.animation=r))}),i},_toggleDisabled:function(e,t){e=this.element.find(e),e.toggleClass(V,t).toggleClass(N,!t).attr(j,!t)},select:function(n){var i=this;return n===t?i.element.find(q).parent():(i.element.find(n).each(function(){var n=e(this),r=n.children(v);return n.hasClass(N)?i:(i._triggerEvent(T,n)||i._updateSelected(r),t)}),i)},enable:function(e,t){return this._toggleDisabled(e,t!==!1),this},disable:function(e){return this._toggleDisabled(e,!1),this},append:function(e,t){t=this.element.find(t);var r=this._insert(e,t,t.length?t.find(M):null);return l(r.items,function(){r.group.append(this),i(this)}),n(t),i(r.group.find(".k-first, .k-last")),r.group.height("auto"),this},insertBefore:function(e,t){t=this.element.find(t);var n=this._insert(e,t,t.parent());return l(n.items,function(){t.before(this),i(this)}),i(t),n.group.height("auto"),this},insertAfter:function(e,t){t=this.element.find(t);var n=this._insert(e,t,t.parent());return l(n.items,function(){t.after(this),i(this)}),i(t),n.group.height("auto"),this},remove:function(e){e=this.element.find(e);var t=this,r=e.parentsUntil(t.element,k),o=e.parent("ul");return e.remove(),!o||o.hasClass("k-panelbar")||o.children(k).length||o.remove(),r.length&&(r=r.eq(0),n(r),i(r)),t},reload:function(t){var n=this;t=n.element.find(t),t.each(function(){var t=e(this);n._ajaxRequest(t,t.children("."+S),!t.is(K))})},_first:function(){return this.element.children(B).first()},_last:function(){var e=this.element.children(B).last(),t=e.children(w);return t[0]?t.children(B).last():e},_current:function(e){var n=this,i=n._focused,r=n._itemId;return e===t?i:(n.element.removeAttr("aria-activedescendant"),i&&(i[0].id===r&&i.removeAttr("id"),i.children(v).removeClass(R)),e&&(r=e[0].id||r,e.attr("id",r).children(v).addClass(R),n.element.attr("aria-activedescendant",r)),n._focused=e,t)},_keydown:function(e){var t=this,n=e.keyCode,i=t._current();e.target==e.currentTarget&&(n==a.DOWN||n==a.RIGHT?(t._current(t._nextItem(i)),e.preventDefault()):n==a.UP||n==a.LEFT?(t._current(t._prevItem(i)),e.preventDefault()):n==a.ENTER||n==a.SPACEBAR?(t._click(i.children(v)),e.preventDefault()):n==a.HOME?(t._current(t._first()),e.preventDefault()):n==a.END&&(t._current(t._last()),e.preventDefault()))},_nextItem:function(e){if(!e)return this._first();var t=e.children(w),n=e.next();return t[0]&&(n=t.children("."+C)),n[0]||(n=e.parent(w).parent(k).next()),n[0]&&n.is(":visible")||(n=this._first()),n.hasClass(N)&&(n=this._nextItem(n)),n},_prevItem:function(e){if(!e)return this._last();var t,n=e.prev();if(n[0])for(t=n;t[0];)t=t.children(w).children("."+m),t[0]&&(n=t);else n=e.parent(w).parent(k),n[0]||(n=this._last());return n.hasClass(N)&&(n=this._prevItem(n)),n},_insert:function(t,n,i){var r,o,a=this,l=e.isPlainObject(t),d=n&&n[0];return d||(i=a.element),o={firstLevel:i.hasClass("k-panelbar"),expanded:i.parent().hasClass(I),length:i.children().length},d&&!i.length&&(i=e(et.renderGroup({group:o})).appendTo(n)),l||e.isArray(t)?(r=e.map(l?[t]:t,function(t,n){return"string"==typeof t?e(t):e(et.renderItem({group:o,item:s(t,{index:n})}))}),d&&n.attr($,!1)):(r="string"==typeof t&&"<"!=t[0]?a.element.find(t):e(t),a._updateItemsClasses(r)),{items:r,group:i}},_toggleHover:function(t){var n=e(t.currentTarget);n.parents("li."+N).length||n.toggleClass("k-state-hover",t.type==E)},_updateClasses:function(){var t,r,o=this;t=o.element.find("li > ul").not(function(){return e(this).parentsUntil(".k-panelbar","div").length}).addClass("k-group k-panel").attr("role","group"),t.parent().attr($,!1).not("."+I).children("ul").attr(G,!0).hide(),r=o.element.add(t).children(),o._updateItemsClasses(r),n(r),i(r)},_updateItemsClasses:function(e){for(var t=e.length,n=0;t>n;n++)this._updateItemClasses(e[n],n)},_updateItemClasses:function(t,n){var i,o,a=this._selected,s=this.options.contentUrls,l=s&&s[n],d=this.element[0];t=e(t).addClass("k-item").attr("role","menuitem"),r.support.browser.msie&&t.css("list-style-position","inside").css("list-style-position",""),t.children(f).addClass(y),o=t.children("a").addClass(g),o[0]&&(o.attr("href",l),o.children(f).addClass(y)),t.filter(":not([disabled]):not([class*=k-state])").addClass("k-state-default"),t.filter("li[disabled]").addClass("k-state-disabled").attr(j,!0).removeAttr("disabled"),t.children("div").addClass(S).attr("role","region").attr(G,!0).hide().parent().attr($,!1),o=t.children(P),o[0]&&(a&&a.removeAttr(Y).children(P).removeClass(O),o.addClass(O),this._selected=t.attr(Y,!0)),t.children(v)[0]||(i="<span class='"+g+"'/>",s&&s[n]&&t[0].parentNode==d&&(i='<a class="k-link k-header" href="'+s[n]+'"/>'),t.contents().filter(function(){return!(this.nodeName.match(u)||3==this.nodeType&&!e.trim(this.nodeValue))}).wrapAll(i)),t.parent(".k-panelbar")[0]&&t.children(v).addClass("k-header")},_click:function(e){var t,n,i,r,o,a,s,l=this,d=l.element;if(!e.parents("li."+N).length&&e.closest(".k-widget")[0]==d[0]){if(o=e.closest(v),a=o.closest(k),l._updateSelected(o),n=a.find(M).add(a.find(z)),i=o.attr(h),r=i&&("#"==i.charAt(i.length-1)||-1!=i.indexOf("#"+l.element[0].id+"-")),t=!(!r&&!n.length),n.data("animating"))return t;if(l._triggerEvent(T,a)&&(t=!0),t!==!1)return l.options.expandMode==J&&l._collapseAllExpanded(a)?t:(n.length&&(s=n.is(K),l._triggerEvent(s?D:x,a)||(t=l._toggleItem(a,s))),t)}},_toggleItem:function(e,n){var i,r,o=this,a=e.find(M),s=e.find(v),l=s.attr(h);return a.length?(this._toggleGroup(a,n),i=!0):(r=e.children("."+S),r.length&&(i=!0,r.is(Q)&&l!==t?o._ajaxRequest(e,r,n):o._toggleGroup(r,n))),i},_toggleGroup:function(e,t){var n=this,i=n.options.animation,r=i.expand,o=s({},i.collapse),a=o&&"effects"in o;e.is(K)==t&&(e.parent().attr($,!t).attr(G,t).toggleClass(I,!t).find("> .k-link > .k-icon").toggleClass("k-i-arrow-n",!t).toggleClass("k-panelbar-collapse",!t).toggleClass("k-i-arrow-s",t).toggleClass("k-panelbar-expand",t),r=t?s(a?o:s({reverse:!0},r),{hide:!0}):s({complete:function(e){n._triggerEvent(F,e.closest(k))}},r),e.kendoStop(!0,!0).kendoAnimate(r))},_collapseAllExpanded:function(n){var i,r,o=this,a=!1;return n.children(v).hasClass("k-header")?(r=n.find(M).add(n.find(z)),r.is(K)&&(a=!0),r.is(K)||0===r.length||(i=e(o.element).children(),i.find(M).add(i.find(z)).filter(function(){return e(this).is(K)}).each(function(t,n){n=e(n),a=o._triggerEvent(D,n.closest(k)),a||o._toggleGroup(n,!0)})),a):t},_ajaxRequest:function(t,n,i){var r=this,o=t.find(".k-panelbar-collapse, .k-panelbar-expand"),a=t.find(v),s=setTimeout(function(){o.addClass("k-loading")},100),l={},d=a.attr(h);e.ajax({type:"GET",cache:!1,url:d,dataType:"html",data:l,error:function(e,t){o.removeClass("k-loading"),r.trigger(_,{xhr:e,status:t})&&this.complete()},complete:function(){clearTimeout(s),o.removeClass("k-loading")},success:function(e){try{n.html(e)}catch(o){var a=window.console;a&&a.error&&a.error(o.name+": "+o.message+" in "+d),this.error(this.xhr,"error")}r._toggleGroup(n,i),r.trigger(A,{item:t[0],contentElement:n[0]})}})},_triggerEvent:function(e,t){var n=this;return n.trigger(e,{item:t[0]})},_updateSelected:function(e){var t=this,n=t.element,i=e.parent(k),r=t._selected;r&&r.removeAttr(Y),t._selected=i.attr(Y,!0),n.find(q).removeClass(O),n.find("> ."+L+", .k-panel > ."+L).removeClass(L),e.addClass(O),e.parentsUntil(n,k).filter(":has(.k-header)").addClass(L),t._current(i)},_animations:function(e){e&&"animation"in e&&!e.animation&&(e.animation={expand:{effects:{}},collapse:{hide:!0,effects:{}}})}});s(et,{renderItem:function(e){e=s({panelBar:{},group:{}},e);var t=X.empty,n=e.item;return X.item(s(e,{image:n.imageUrl?X.image:t,sprite:n.spriteCssClass?X.sprite:t,itemWrapper:X.itemWrapper,renderContent:et.renderContent,arrow:n.items||n.content||n.contentUrl?X.arrow:t,subGroup:et.renderGroup},Z))},renderGroup:function(e){return X.group(s({renderItems:function(e){for(var t="",n=0,i=e.items,r=i?i.length:0,o=s({length:r},e.group);r>n;n++)t+=et.renderItem(s(e,{group:o,item:s({index:n},i[n])}));return t}},e,Z))},renderContent:function(e){return X.content(s(e,Z))}}),r.ui.plugin(et)})(window.kendo.jQuery);(function(e,t){var n=window.kendo,i=n.ui,r=i.Widget,o="horizontal",a="vertical",s=0,l=100,d=0,c=5,u="k-progressbar",p="k-progressbar-reverse",f="k-progressbar-indeterminate",h="k-complete",g="k-state-selected",m="k-progress-status",v="k-state-selected",_="k-state-default",k="k-state-disabled",b={VALUE:"value",PERCENT:"percent",CHUNK:"chunk"},w="change",y="complete",C="boolean",x=Math,T=e.extend,S=e.proxy,F=100,D=400,E=3,A={progressStatus:"<span class='k-progress-status-wrap'><span class='k-progress-status'></span></span>"},H=r.extend({init:function(e,t){var n=this;r.fn.init.call(this,e,t),t=n.options,n._progressProperty=t.orientation===o?"width":"height",n._fields(),t.value=n._validateValue(t.value),n._validateType(t.type),n._wrapper(),n._progressAnimation(),t.value!==t.min&&t.value!==!1&&n._updateProgress()},setOptions:function(e){var t=this;r.fn.setOptions.call(t,e),e.hasOwnProperty("reverse")&&t.wrapper.toggleClass("k-progressbar-reverse",e.reverse),e.hasOwnProperty("enable")&&t.enable(e.enable),t._progressAnimation(),t._validateValue(),t._updateProgress()},events:[w,y],options:{name:"ProgressBar",orientation:o,reverse:!1,min:s,max:l,value:d,enable:!0,type:b.VALUE,chunkCount:c,showStatus:!0,animation:{}},_fields:function(){var t=this;t._isStarted=!1,t.progressWrapper=t.progressStatus=e()},_validateType:function(i){var r=!1;if(e.each(b,function(e,n){return n===i?(r=!0,!1):t}),!r)throw Error(n.format("Invalid ProgressBar type '{0}'",i))},_wrapper:function(){var e,t=this,n=t.wrapper=t.element,i=t.options,r=i.orientation;n.addClass("k-widget "+u),n.addClass(u+"-"+(r===o?o:a)),i.enable===!1&&n.addClass(k),i.reverse&&n.addClass(p),i.value===!1&&n.addClass(f),i.type===b.CHUNK?t._addChunkProgressWrapper():i.showStatus&&(t.progressStatus=t.wrapper.prepend(A.progressStatus).find("."+m),e=i.value!==!1?i.value:i.min,i.type===b.VALUE?t.progressStatus.text(e):t.progressStatus.text(t._calculatePercentage(e)+"%"))},value:function(e){return this._value(e)},_value:function(e){var n,i=this,r=i.options;return e===t?r.value:(typeof e!==C?(e=i._roundValue(e),isNaN(e)||(n=i._validateValue(e),n!==r.value&&(i.wrapper.removeClass(f),r.value=n,i._isStarted=!0,i._updateProgress()))):e||(i.wrapper.addClass(f),r.value=!1),t)},_roundValue:function(e){e=parseFloat(e);var t=x.pow(10,E);return x.floor(e*t)/t},_validateValue:function(e){var t=this,n=t.options;if(e!==!1){if(n.min>=e||e===!0)return n.min;if(e>=n.max)return n.max}else if(e===!1)return!1;return isNaN(t._roundValue(e))?n.min:e},_updateProgress:function(){var e=this,t=e.options,n=e._calculatePercentage();t.type===b.CHUNK?(e._updateChunks(n),e._onProgressUpdateAlways(t.value)):e._updateProgressWrapper(n)},_updateChunks:function(e){var t,n=this,i=n.options,r=i.chunkCount,s=parseInt(F/r*100,10)/100,l=parseInt(100*e,10)/100,d=x.floor(l/s);t=i.orientation===o&&!i.reverse||i.orientation===a&&i.reverse?n.wrapper.find("li.k-item:lt("+d+")"):n.wrapper.find("li.k-item:gt(-"+(d+1)+")"),n.wrapper.find("."+v).removeClass(v).addClass(_),t.removeClass(_).addClass(v)},_updateProgressWrapper:function(e){var t=this,n=t.options,i=t.wrapper.find("."+g),r=t._isStarted?t._animation.duration:0,o={};0===i.length&&t._addRegularProgressWrapper(),o[t._progressProperty]=e+"%",t.progressWrapper.animate(o,{duration:r,start:S(t._onProgressAnimateStart,t),progress:S(t._onProgressAnimate,t),complete:S(t._onProgressAnimateComplete,t,n.value),always:S(t._onProgressUpdateAlways,t,n.value)})},_onProgressAnimateStart:function(){this.progressWrapper.show()},_onProgressAnimate:function(e){var t,n=this,i=n.options,r=parseFloat(e.elem.style[n._progressProperty],10);i.showStatus&&(t=1e4/parseFloat(n.progressWrapper[0].style[n._progressProperty]),n.progressWrapper.find(".k-progress-status-wrap").css(n._progressProperty,t+"%")),i.type!==b.CHUNK&&98>=r&&n.progressWrapper.removeClass(h)},_onProgressAnimateComplete:function(e){var t=this,n=t.options,i=parseFloat(t.progressWrapper[0].style[t._progressProperty]);n.type!==b.CHUNK&&i>98&&t.progressWrapper.addClass(h),n.showStatus&&(n.type===b.VALUE?t.progressStatus.text(e):t.progressStatus.text(x.floor(t._calculatePercentage(e))+"%")),e===n.min&&t.progressWrapper.hide()},_onProgressUpdateAlways:function(e){var t=this,n=t.options;t._isStarted&&t.trigger(w,{value:e}),e===n.max&&t._isStarted&&t.trigger(y,{value:n.max})},enable:function(e){var n=this,i=n.options;i.enable=t===e?!0:e,n.wrapper.toggleClass(k,!i.enable)},destroy:function(){var e=this;r.fn.destroy.call(e)},_addChunkProgressWrapper:function(){var e,t=this,n=t.options,i=t.wrapper,r=F/n.chunkCount,o="";for(1>=n.chunkCount&&(n.chunkCount=c),o+="<ul class='k-reset'>",e=n.chunkCount-1;e>=0;e--)o+="<li class='k-item k-state-default'></li>";o+="</ul>",i.append(o).find(".k-item").css(t._progressProperty,r+"%").first().addClass("k-first").end().last().addClass("k-last"),t._normalizeChunkSize()},_normalizeChunkSize:function(){var e=this,t=e.options,n=e.wrapper.find(".k-item:last"),i=parseFloat(n[0].style[e._progressProperty]),r=F-t.chunkCount*i;r>0&&n.css(e._progressProperty,i+r+"%")},_addRegularProgressWrapper:function(){var t=this;t.progressWrapper=e("<div class='"+g+"'></div>").appendTo(t.wrapper),t.options.showStatus&&(t.progressWrapper.append(A.progressStatus),t.progressStatus=t.wrapper.find("."+m))},_calculateChunkSize:function(){var e=this,t=e.options.chunkCount,n=e.wrapper.find("ul.k-reset");return(parseInt(n.css(e._progressProperty),10)-(t-1))/t},_calculatePercentage:function(e){var n=this,i=n.options,r=e!==t?e:i.value,o=i.min,a=i.max;return n._onePercent=x.abs((a-o)/100),x.abs((r-o)/n._onePercent)},_progressAnimation:function(){var e=this,t=e.options,n=t.animation;e._animation=n===!1?{duration:0}:T({duration:D},t.animation)}});n.ui.plugin(H)})(window.kendo.jQuery);(function(e,t){function n(t){t.children(m).addClass(C),t.children("a").addClass(_).children(m).addClass(C),t.filter(":not([disabled]):not([class*=k-state-disabled])").addClass(z),t.filter("li[disabled]").addClass(I).removeAttr("disabled"),t.filter(":not([class*=k-state])").children("a").filter(":focus").parent().addClass(M+" "+O),t.attr("role","tab"),t.filter("."+M).attr("aria-selected",!0),t.each(function(){var t=e(this);t.children("."+_).length||t.contents().filter(function(){return!(this.nodeName.match(f)||3==this.nodeType&&!d(this.nodeValue))}).wrapAll("<a class='"+_+"'/>")})}function i(e){var t=e.children(".k-item");t.filter(".k-first:not(:first-child)").removeClass(x),t.filter(".k-last:not(:last-child)").removeClass(k),t.filter(":first-child").addClass(x),t.filter(":last-child").addClass(k)}var r=window.kendo,o=r.ui,a=r.keys,s=e.map,l=e.each,d=e.trim,c=e.extend,u=r.template,p=o.Widget,f=/^(a|div)$/i,h=".kendoTabStrip",m="img",g="href",v="prev",_="k-link",k="k-last",b="click",w="error",y=":empty",C="k-image",x="k-first",T="select",S="activate",F="k-content",D="contentUrl",E="mouseenter",A="mouseleave",H="contentLoad",I="k-state-disabled",z="k-state-default",M="k-state-active",R="k-state-focused",N="k-state-hover",O="k-tab-on-top",P=".k-item:not(."+I+")",L=".k-tabstrip-items > "+P+":not(."+M+")",B={content:u("<div class='k-content'#= contentAttributes(data) # role='tabpanel'>#= content(item) #</div>"),itemWrapper:u("<#= tag(item) # class='k-link'#= contentUrl(item) ##= textAttributes(item) #>#= image(item) ##= sprite(item) ##= text(item) #</#= tag(item) #>"),item:u("<li class='#= wrapperCssClass(group, item) #' role='tab' #=item.active ? \"aria-selected='true'\" : ''#>#= itemWrapper(data) #</li>"),image:u("<img class='k-image' alt='' src='#= imageUrl #' />"),sprite:u("<span class='k-sprite #= spriteCssClass #'></span>"),empty:u("")},W={wrapperCssClass:function(e,t){var n="k-item",i=t.index;return n+=t.enabled===!1?" k-state-disabled":" k-state-default",0===i&&(n+=" k-first"),i==e.length-1&&(n+=" k-last"),n},textAttributes:function(e){return e.url?" href='"+e.url+"'":""},text:function(e){return e.encoded===!1?e.text:r.htmlEncode(e.text)},tag:function(e){return e.url?"a":"span"},contentAttributes:function(e){return e.active!==!0?" style='display:none' aria-hidden='true' aria-expanded='false'":""},content:function(e){return e.content?e.content:e.contentUrl?"":"&nbsp;"},contentUrl:function(e){return e.contentUrl?r.attr("content-url")+'="'+e.contentUrl+'"':""}},U=p.extend({init:function(t,n){var i,o,a=this;p.fn.init.call(a,t,n),a._animations(a.options),a.wrapper=a.element.is("ul")?a.element.wrapAll("<div />").parent():a.element,n=a.options,a._isRtl=r.support.isRtl(a.wrapper),a._tabindex(),a._updateClasses(),a._dataSource(),n.dataSource&&a.dataSource.fetch(),a.options.contentUrls&&a.wrapper.find(".k-tabstrip-items > .k-item").each(function(t,n){e(n).find(">."+_).data(D,a.options.contentUrls[t])}),a.wrapper.on(E+h+" "+A+h,L,a._toggleHover).on("focus"+h,e.proxy(a._active,a)).on("blur"+h,function(){a._current(null)}),a._keyDownProxy=e.proxy(a._keydown,a),n.navigatable&&a.wrapper.on("keydown"+h,a._keyDownProxy),a.wrapper.children(".k-tabstrip-items").on(b+h,".k-state-disabled .k-link",!1).on(b+h," > "+P,function(t){a.wrapper[0]!==document.activeElement&&a.wrapper.focus(),a._click(e(t.currentTarget))&&t.preventDefault()}),i=a.tabGroup.children("li."+M),o=a.contentHolder(i.index()),i[0]&&o.length>0&&0===o[0].childNodes.length&&a.activateTab(i.eq(0)),a.element.attr("role","tablist"),a.element[0].id&&(a._ariaId=a.element[0].id+"_ts_active"),r.notify(a)},_active:function(){var e=this.tabGroup.children().filter("."+M);e=e[0]?e:this._endItem("first"),e[0]&&this._current(e)},_endItem:function(e){return this.tabGroup.children(P)[e]()},_item:function(e,t){var n;return n=t===v?"last":"first",e?(e=e[t](),e[0]||(e=this._endItem(n)),e.hasClass(I)&&(e=this._item(e,t)),e):this._endItem(n)},_current:function(e){var n=this,i=n._focused,r=n._ariaId;
return e===t?i:(i&&(i[0].id===r&&i.removeAttr("id"),i.removeClass(R)),e&&(e.hasClass(M)||e.addClass(R),n.element.removeAttr("aria-activedescendant"),r=e[0].id||r,r&&(e.attr("id",r),n.element.attr("aria-activedescendant",r))),n._focused=e,t)},_keydown:function(e){var n,i=this,r=e.keyCode,o=i._current(),s=i._isRtl;if(e.target==e.currentTarget){if(r==a.DOWN||r==a.RIGHT)n=s?v:"next";else if(r==a.UP||r==a.LEFT)n=s?"next":v;else if(r==a.ENTER||r==a.SPACEBAR)i._click(o),e.preventDefault();else{if(r==a.HOME)return i._click(i._endItem("first")),e.preventDefault(),t;if(r==a.END)return i._click(i._endItem("last")),e.preventDefault(),t}n&&(i._click(i._item(o,n)),e.preventDefault())}},_dataSource:function(){var t=this;t.dataSource&&t._refreshHandler?t.dataSource.unbind("change",t._refreshHandler):t._refreshHandler=e.proxy(t.refresh,t),t.dataSource=r.data.DataSource.create(t.options.dataSource).bind("change",t._refreshHandler)},setDataSource:function(e){this.options.dataSource=e,this._dataSource(),e.fetch()},_animations:function(e){e&&"animation"in e&&!e.animation&&(e.animation={open:{effects:{}},close:{effects:{}}})},refresh:function(e){var t,n,i,o,a=this,s=a.options,l=r.getter(s.dataTextField),d=r.getter(s.dataContentField),c=r.getter(s.dataContentUrlField),u=r.getter(s.dataImageUrlField),p=r.getter(s.dataUrlField),f=r.getter(s.dataSpriteCssClass),h=[],m=a.dataSource.view();for(e=e||{},i=e.action,i&&(m=e.items),t=0,o=m.length;o>t;t++)n={text:l(m[t])},s.dataContentField&&(n.content=d(m[t])),s.dataContentUrlField&&(n.contentUrl=c(m[t])),s.dataUrlField&&(n.url=p(m[t])),s.dataImageUrlField&&(n.imageUrl=u(m[t])),s.dataSpriteCssClass&&(n.spriteCssClass=f(m[t])),h[t]=n;if("add"==e.action)e.index<a.tabGroup.children().length?a.insertBefore(h,a.tabGroup.children().eq(e.index)):a.append(h);else if("remove"==e.action)for(t=0;m.length>t;t++)a.remove(e.index);else"itemchange"==e.action?(t=a.dataSource.view().indexOf(m[0]),e.field===s.dataTextField&&a.tabGroup.children().eq(t).find(".k-link").text(m[0].get(e.field))):(a.trigger("dataBinding"),a.remove("li"),a.append(h),a.trigger("dataBound"))},value:function(n){var i=this;return n===t?i.select().text():(n!=i.value()&&i.tabGroup.children().each(function(){e.trim(e(this).text())==n&&i.select(this)}),t)},items:function(){return this.tabGroup[0].children},setOptions:function(e){var t=this,n=t.options.animation;t._animations(e),e.animation=c(!0,n,e.animation),e.navigatable?t.wrapper.on("keydown"+h,t._keyDownProxy):t.wrapper.off("keydown"+h,t._keyDownProxy),p.fn.setOptions.call(t,e)},events:[T,S,w,H,"change","dataBinding","dataBound"],options:{name:"TabStrip",dataTextField:"",dataContentField:"",dataImageUrlField:"",dataUrlField:"",dataSpriteCssClass:"",dataContentUrlField:"",animation:{open:{effects:"expand:vertical fadeIn",duration:200},close:{duration:200}},collapsible:!1,navigatable:!0,contentUrls:!1},destroy:function(){var e=this;p.fn.destroy.call(e),e._refreshHandler&&e.dataSource.unbind("change",e._refreshHandler),e.wrapper.off(h),e.wrapper.children(".k-tabstrip-items").off(h),r.destroy(e.wrapper)},select:function(t){var n=this;return 0===arguments.length?n.tabGroup.children("li."+M):(isNaN(t)||(t=n.tabGroup.children().get(t)),t=n.tabGroup.find(t),e(t).each(function(t,i){i=e(i),i.hasClass(M)||n.trigger(T,{item:i[0],contentElement:n.contentHolder(i.index())[0]})||n.activateTab(i)}),n)},enable:function(e,t){return this._toggleDisabled(e,t!==!1),this},disable:function(e){return this._toggleDisabled(e,!1),this},reload:function(t){t=this.tabGroup.find(t);var n=this;return t.each(function(){var t=e(this),i=t.find("."+_).data(D),r=n.contentHolder(t.index());i&&n.ajaxRequest(t,r,null,i)}),n},append:function(e){var t=this,n=t._create(e);return l(n.tabs,function(e){t.tabGroup.append(this),t.wrapper.append(n.contents[e])}),i(t.tabGroup),t._updateContentElements(),t},insertBefore:function(t,n){n=this.tabGroup.find(n);var r=this,o=r._create(t),a=e(r.contentElement(n.index()));return l(o.tabs,function(e){n.before(this),a.before(o.contents[e])}),i(r.tabGroup),r._updateContentElements(),r},insertAfter:function(t,n){n=this.tabGroup.find(n);var r=this,o=r._create(t),a=e(r.contentElement(n.index()));return l(o.tabs,function(e){n.after(this),a.after(o.contents[e])}),i(r.tabGroup),r._updateContentElements(),r},remove:function(t){var n=this,i=typeof t,r=e();return"string"===i?t=n.tabGroup.find(t):"number"===i&&(t=n.tabGroup.children().eq(t)),t.each(function(){r.push(n.contentElement(e(this).index()))}),t.remove(),r.remove(),n._updateContentElements(),n},_create:function(i){var r,o,a,l=e.isPlainObject(i),d=this;return l||e.isArray(i)?(i=e.isArray(i)?i:[i],r=s(i,function(t,n){return e(U.renderItem({group:d.tabGroup,item:c(t,{index:n})}))}),o=s(i,function(n,i){return"string"==typeof n.content||n.contentUrl?e(U.renderContent({item:c(n,{index:i})})):t})):(r="string"==typeof i&&"<"!=i[0]?d.element.find(i):e(i),o=e(),r.each(function(){if(a=e("<div class='"+F+"'/>"),/k-tabstrip-items/.test(this.parentNode.className)){var t=parseInt(this.getAttribute("aria-controls").replace(/^.*-/,""),10)-1;a=e(d.contentElement(t))}o=o.add(a)}),n(r)),{tabs:r,contents:o}},_toggleDisabled:function(t,n){t=this.tabGroup.find(t),t.each(function(){e(this).toggleClass(z,n).toggleClass(I,!n)})},_updateClasses:function(){var r,o,a,s=this;s.wrapper.addClass("k-widget k-header k-tabstrip"),s.tabGroup=s.wrapper.children("ul").addClass("k-tabstrip-items k-reset"),s.tabGroup[0]||(s.tabGroup=e("<ul class='k-tabstrip-items k-reset'/>").appendTo(s.wrapper)),r=s.tabGroup.find("li").addClass("k-item"),r.length&&(o=r.filter("."+M).index(),a=o>=0?o:t,s.tabGroup.contents().filter(function(){return 3==this.nodeType&&!d(this.nodeValue)}).remove()),o>=0&&r.eq(o).addClass(O),s.contentElements=s.wrapper.children("div"),s.contentElements.addClass(F).eq(a).addClass(M).css({display:"block"}),r.length&&(n(r),i(s.tabGroup),s._updateContentElements())},_updateContentElements:function(){var t=this,n=t.options.contentUrls||[],i=t.tabGroup.find(".k-item"),o=(t.element.attr("id")||r.guid())+"-",a=t.wrapper.children("div");a.length&&i.length>a.length?(a.each(function(e){var t=parseInt(this.id.replace(o,""),10),n=i.filter("[aria-controls="+o+t+"]"),r=o+(e+1);n.data("aria",r),this.setAttribute("id",r)}),i.each(function(){var t=e(this);this.setAttribute("aria-controls",t.data("aria")),t.removeData("aria")})):i.each(function(i){var r=a.eq(i),s=o+(i+1);this.setAttribute("aria-controls",s),!r.length&&n[i]?e("<div class='"+F+"'/>").appendTo(t.wrapper).attr("id",s):(r.attr("id",s),e(this).children(".k-loading")[0]||n[i]||e("<span class='k-loading k-complete'/>").prependTo(this)),r.attr("role","tabpanel"),r.filter(":not(."+M+")").attr("aria-hidden",!0).attr("aria-expanded",!1),r.filter("."+M).attr("aria-expanded",!0)}),t.contentElements=t.contentAnimators=t.wrapper.children("div"),r.kineticScrollNeeded&&r.mobile.ui.Scroller&&(r.touchScroller(t.contentElements),t.contentElements=t.contentElements.children(".km-scroll-container"))},_toggleHover:function(t){e(t.currentTarget).toggleClass(N,t.type==E)},_click:function(e){var t,n,i=this,r=e.find("."+_),o=r.attr(g),a=i.options.collapsible,s=i.contentHolder(e.index());if(e.closest(".k-widget")[0]==i.wrapper[0]){if(e.is("."+I+(a?"":",."+M)))return!0;if(n=r.data(D)||o&&("#"==o.charAt(o.length-1)||-1!=o.indexOf("#"+i.element[0].id+"-")),t=!o||n,i.tabGroup.children("[data-animating]").length)return t;if(i.trigger(T,{item:e[0],contentElement:s[0]}))return!0;if(t!==!1)return a&&e.is("."+M)?(i.deactivateTab(e),!0):(i.activateTab(e)&&(t=!0),t)}},deactivateTab:function(e){var t=this,n=t.options.animation,i=n.open,o=c({},n.close),a=o&&"effects"in o;e=t.tabGroup.find(e),o=c(a?o:c({reverse:!0},i),{hide:!0}),r.size(i.effects)?(e.kendoAddClass(z,{duration:i.duration}),e.kendoRemoveClass(M,{duration:i.duration})):(e.addClass(z),e.removeClass(M)),e.removeAttr("aria-selected"),t.contentAnimators.filter("."+M).kendoStop(!0,!0).kendoAnimate(o).removeClass(M).attr("aria-hidden",!0)},activateTab:function(e){var t,n,i,o,a,s,l,d,u,p,f,h,m,g,v;if(!this.tabGroup.children("[data-animating]").length)return e=this.tabGroup.find(e),t=this,n=t.options.animation,i=n.open,o=c({},n.close),a=o&&"effects"in o,s=e.parent().children(),l=s.filter("."+M),d=s.index(e),o=c(a?o:c({reverse:!0},i),{hide:!0}),r.size(i.effects)?(l.kendoRemoveClass(M,{duration:o.duration}),e.kendoRemoveClass(N,{duration:o.duration})):(l.removeClass(M),e.removeClass(N)),u=t.contentAnimators,t.inRequest&&(t.xhr.abort(),t.inRequest=!1),0===u.length?(l.removeClass(O),e.addClass(O).css("z-index"),e.addClass(M),t._current(e),t.trigger("change"),!1):(p=u.filter("."+M),f=t.contentHolder(d),h=f.closest(".k-content"),0===f.length?(p.removeClass(M).attr("aria-hidden",!0).kendoStop(!0,!0).kendoAnimate(o),!1):(e.attr("data-animating",!0),m=(e.children("."+_).data(D)||!1)&&f.is(y),g=function(){l.removeClass(O),e.addClass(O).css("z-index"),r.size(i.effects)?(l.kendoAddClass(z,{duration:i.duration}),e.kendoAddClass(M,{duration:i.duration})):(l.addClass(z),e.addClass(M)),l.removeAttr("aria-selected"),e.attr("aria-selected",!0),t._current(e),h.addClass(M).removeAttr("aria-hidden").kendoStop(!0,!0).attr("aria-expanded",!0).kendoAnimate(c({init:function(){t.trigger(S,{item:e[0],contentElement:f[0]})}},i,{complete:function(){e.removeAttr("data-animating")}}))},v=function(){m?(e.removeAttr("data-animating"),t.ajaxRequest(e,f,function(){e.attr("data-animating",!0),g(),t.trigger("change")})):(g(),t.trigger("change"))},p.removeClass(M),p.attr("aria-hidden",!0),p.attr("aria-expanded",!1),p.length?p.kendoStop(!0,!0).kendoAnimate(c({complete:v},o)):v(),!0))},contentElement:function(e){var n,i,o,a;if(isNaN(e-0))return t;if(n=this.contentElements&&this.contentElements[0]&&!r.kineticScrollNeeded?this.contentElements:this.contentAnimators,e=n&&0>e?n.length+e:e,i=RegExp("-"+(e+1)+"$"),n)for(o=0,a=n.length;a>o;o++)if(i.test(n.eq(o).closest(".k-content")[0].id))return n[o];return t},contentHolder:function(t){var n=e(this.contentElement(t)),i=n.children(".km-scroll-container");return r.support.touch&&i[0]?i:n},ajaxRequest:function(t,n,i,o){var a,s,l,d,c,u,p,f,h;t=this.tabGroup.find(t),a=this,s=e.ajaxSettings.xhr,l=t.find("."+_),d={},c=t.width()/2,u=!1,p=t.find(".k-loading").removeClass("k-complete"),p[0]||(p=e("<span class='k-loading'/>").prependTo(t)),f=2*c-p.width(),h=function(){p.animate({marginLeft:(parseInt(p.css("marginLeft"),10)||0)<c?f:0},500,h)},r.support.browser.msie&&10>r.support.browser.version&&setTimeout(h,40),o=o||l.data(D)||l.attr(g),a.inRequest=!0,a.xhr=e.ajax({type:"GET",cache:!1,url:o,dataType:"html",data:d,xhr:function(){var t=this,n=s(),i=t.progressUpload?"progressUpload":t.progress?"progress":!1;return n&&e.each([n,n.upload],function(){this.addEventListener&&this.addEventListener("progress",function(e){i&&t[i](e)},!1)}),t.noProgress=!(window.XMLHttpRequest&&"upload"in new XMLHttpRequest),n},progress:function(e){if(e.lengthComputable){var t=parseInt(e.loaded/e.total*100,10)+"%";p.stop(!0).addClass("k-progress").css({width:t,marginLeft:0})}},error:function(e,t){a.trigger("error",{xhr:e,status:t})&&this.complete()},stopProgress:function(){clearInterval(u),p.stop(!0).addClass("k-progress")[0].style.cssText=""},complete:function(e){a.inRequest=!1,this.noProgress?setTimeout(this.stopProgress,500):this.stopProgress(),"abort"==e.statusText&&p.remove()},success:function(e){var r,s,l;p.addClass("k-complete");try{r=this,s=10,r.noProgress&&(p.width(s+"%"),u=setInterval(function(){r.progress({lengthComputable:!0,loaded:Math.min(s,100),total:100}),s+=10},40)),n.html(e)}catch(d){l=window.console,l&&l.error&&l.error(d.name+": "+d.message+" in "+o),this.error(this.xhr,"error")}i&&i.call(a,n),a.trigger(H,{item:t[0],contentElement:n[0]})}})}});c(U,{renderItem:function(e){e=c({tabStrip:{},group:{}},e);var t=B.empty,n=e.item;return B.item(c(e,{image:n.imageUrl?B.image:t,sprite:n.spriteCssClass?B.sprite:t,itemWrapper:B.itemWrapper},W))},renderContent:function(e){return B.content(c(e,W))}}),r.ui.plugin(U)})(window.kendo.jQuery);(function(e,t){function n(e,t,n){var i,r=e.getTimezoneOffset();e.setTime(e.getTime()+t),n||(i=e.getTimezoneOffset()-r,e.setTime(e.getTime()+i*M))}function i(){var e=new $,t=new $(e.getFullYear(),e.getMonth(),e.getDate(),0,0,0),n=new $(e.getFullYear(),e.getMonth(),e.getDate(),12,0,0);return-1*(t.getTimezoneOffset()-n.getTimezoneOffset())}function r(e){return 60*e.getHours()*M+e.getMinutes()*M+1e3*e.getSeconds()+e.getMilliseconds()}function o(e,t,n){var i,o=r(t),a=r(n);return e&&o!=a?(i=r(e),o>i&&(i+=z),o>a&&(a+=z),i>=o&&a>=i):!0}function a(e){var t=e.parseFormats;e.format=h(e.format||c.getCulture(e.culture).calendars.standard.patterns.t),t=q(t)?t:[t],t.splice(0,0,e.format),e.parseFormats=t}function s(e){e.preventDefault()}var l,d,c=window.kendo,u=c.keys,p=c.parseDate,f=c._activeElement,h=c._extractFormat,m=c.support,g=m.browser,v=c.ui,_=v.Widget,k="open",b="close",w="change",y=".kendoTimePicker",C="click"+y,x="k-state-default",T="disabled",S="readonly",F="li",D="<span/>",E="k-state-focused",A="k-state-hover",H="mouseenter"+y+" mouseleave"+y,I="mousedown"+y,M=6e4,z=864e5,R="k-state-selected",N="k-state-disabled",O="aria-selected",P="aria-expanded",L="aria-hidden",B="aria-disabled",W="aria-readonly",U="aria-activedescendant",V="id",q=e.isArray,j=e.extend,G=e.proxy,$=Date,K=new $;K=new $(K.getFullYear(),K.getMonth(),K.getDate(),0,0,0),l=function(t){var n=this,i=t.id;n.options=t,n.ul=e('<ul tabindex="-1" role="listbox" aria-hidden="true" unselectable="on" class="k-list k-reset"/>').css({overflow:m.kineticScrollNeeded?"":"auto"}).on(C,F,G(n._click,n)).on("mouseenter"+y,F,function(){e(this).addClass(A)}).on("mouseleave"+y,F,function(){e(this).removeClass(A)}),n.list=e("<div class='k-list-container'/>").append(n.ul).on(I,s),i&&(n._timeViewID=i+"_timeview",n._optionID=i+"_option_selected",n.ul.attr(V,n._timeViewID)),n._popup(),n.template=c.template('<li tabindex="-1" role="option" class="k-item" unselectable="on">#=data#</li>',{useWithBlock:!1})},l.prototype={current:function(n){var i=this,r=i.options.active;return n===t?i._current:(i._current&&i._current.removeClass(R).removeAttr(O).removeAttr(V),n&&(n=e(n).addClass(R).attr(V,i._optionID).attr(O,!0),i.scroll(n[0])),i._current=n,r&&r(n),t)},close:function(){this.popup.close()},destroy:function(){var e=this;e.ul.off(y),e.list.off(y),e._touchScroller&&e._touchScroller.destroy(),e.popup.destroy()},open:function(){var e=this;e.ul[0].firstChild||e.bind(),e.popup.open(),e._current&&e.scroll(e._current[0])},dataBind:function(e){for(var t,n=this,i=n.options,r=i.format,a=c.toString,s=n.template,l=e.length,d=0,u="";l>d;d++)t=e[d],o(t,i.min,i.max)&&(u+=s(a(t,r,i.culture)));n._html(u,l)},refresh:function(){var e,t,o,a=this,s=a.options,l=s.format,d=i(),u=0>d,p=s.min,f=s.max,h=r(p),m=r(f),g=s.interval*M,v=c.toString,_=a.template,k=new $(+p),b=k.getDate(),w=0,y="";for(o=u?(z+d*M)/g:z/g,h!=m&&(h>m&&(m+=z),o=(m-h)/g+1),t=parseInt(o,10);o>w;w++)w&&n(k,g,u),m&&t==w&&(e=r(k),b<k.getDate()&&(e+=z),e>m&&(k=new $(+f))),y+=_(v(k,l,s.culture));a._html(y,o)},bind:function(){var e=this,t=e.options.dates;t&&t[0]?e.dataBind(t):e.refresh()},_html:function(e,t){var n=this;n.ul[0].innerHTML=e,n._height(t),n.current(null),n.select(n._value)},scroll:function(e){if(e){var t,n=this.ul[0],i=e.offsetTop,r=e.offsetHeight,o=n.scrollTop,a=n.clientHeight,s=i+r,l=this._touchScroller;l?(t=this.list.height(),i>t&&(i=i-t+r),l.scrollTo(0,-i)):n.scrollTop=o>i?i:s>o+a?s-a:o}},select:function(t){var n=this,i=n.options,r=n._current;t instanceof Date&&(t=c.toString(t,i.format,i.culture)),"string"==typeof t&&(r&&r.text()===t?t=r:(t=e.grep(n.ul[0].childNodes,function(e){return(e.textContent||e.innerText)==t}),t=t[0]?t:null)),n.current(t)},setOptions:function(e){var t=this.options;e.min=p(e.min),e.max=p(e.max),this.options=j(t,e,{active:t.active,change:t.change,close:t.close,open:t.open}),this.bind()},toggle:function(){var e=this;e.popup.visible()?e.close():e.open()},value:function(e){var t=this;t._value=e,t.ul[0].firstChild&&t.select(e)},_click:function(t){var n=this,i=e(t.currentTarget);t.isDefaultPrevented()||(n.select(i),n.options.change(i.text(),!0),n.close())},_height:function(e){if(e){var t=this,n=t.list,i=n.parent(".k-animation-container"),r=t.options.height;n.add(i).show().height(t.ul[0].scrollHeight>r?r:"auto").hide()}},_parse:function(e){var t=this,n=t.options,i=t._value||K;return e instanceof $?e:(e=p(e,n.parseFormats,n.culture),e&&(e=new $(i.getFullYear(),i.getMonth(),i.getDate(),e.getHours(),e.getMinutes(),e.getSeconds(),e.getMilliseconds())),e)},_adjustListWidth:function(){var e,t,n=this.list,i=n[0].style.width,r=this.options.anchor;(n.data("width")||!i)&&(e=window.getComputedStyle?window.getComputedStyle(r[0],null):0,t=e?parseFloat(e.width):r.outerWidth(),e&&(g.mozilla||g.msie)&&(t+=parseFloat(e.paddingLeft)+parseFloat(e.paddingRight)+parseFloat(e.borderLeftWidth)+parseFloat(e.borderRightWidth)),i=t-(n.outerWidth()-n.width()),n.css({fontFamily:r.css("font-family"),width:i}).data("width",i))},_popup:function(){var e=this,t=e.list,n=e.options,i=n.anchor;e.popup=new v.Popup(t,j(n.popup,{anchor:i,open:n.open,close:n.close,animation:n.animation,isRtl:m.isRtl(n.anchor)})),e._touchScroller=c.touchScroller(e.popup.element)},move:function(e){var n=this,i=e.keyCode,r=n.ul[0],o=n._current,a=i===u.DOWN;if(i===u.UP||a){if(e.altKey)return n.toggle(a),t;o=a?o?o[0].nextSibling:r.firstChild:o?o[0].previousSibling:r.lastChild,o&&n.select(o),n.options.change(n._current.text()),e.preventDefault()}else(i===u.ENTER||i===u.TAB||i===u.ESC)&&(e.preventDefault(),o&&n.options.change(o.text(),!0),n.close())}},l.getMilliseconds=r,c.TimeView=l,d=_.extend({init:function(e,t){var n,i,r,o=this;_.fn.init.call(o,e,t),e=o.element,t=o.options,t.min=p(e.attr("min"))||p(t.min),t.max=p(e.attr("max"))||p(t.max),a(t),o._wrapper(),o.timeView=i=new l(j({},t,{id:e.attr(V),anchor:o.wrapper,format:t.format,change:function(t,n){n?o._change(t):e.val(t)},open:function(t){o.timeView._adjustListWidth(),o.trigger(k)?t.preventDefault():(e.attr(P,!0),n.attr(L,!1))},close:function(t){o.trigger(b)?t.preventDefault():(e.attr(P,!1),n.attr(L,!0))},active:function(t){e.removeAttr(U),t&&e.attr(U,i._optionID)}})),n=i.ul,o._icon(),o._reset();try{e[0].setAttribute("type","text")}catch(s){e[0].type="text"}e.addClass("k-input").attr({role:"combobox","aria-expanded":!1,"aria-owns":i._timeViewID}),r=e.is("[disabled]"),r?o.enable(!1):o.readonly(e.is("[readonly]")),o._old=o._update(t.value||o.element.val()),o._oldText=e.val(),c.notify(o)},options:{name:"TimePicker",min:K,max:K,format:"",dates:[],parseFormats:[],value:null,interval:30,height:200,animation:{}},events:[k,b,w],setOptions:function(e){var t=this,n=t._value;_.fn.setOptions.call(t,e),e=t.options,a(e),t.timeView.setOptions(e),n&&t.element.val(c.toString(n,e.format,e.culture))},dataBind:function(e){q(e)&&this.timeView.dataBind(e)},_editable:function(e){var t=this,n=e.disable,i=e.readonly,r=t._arrow.off(y),o=t.element.off(y),a=t._inputWrapper.off(y);i||n?(a.addClass(n?N:x).removeClass(n?x:N),o.attr(T,n).attr(S,i).attr(B,n).attr(W,i)):(a.addClass(x).removeClass(N).on(H,t._toggleHover),o.removeAttr(T).removeAttr(S).attr(B,!1).attr(W,!1).on("keydown"+y,G(t._keydown,t)).on("blur"+y,G(t._blur,t)).on("focus"+y,function(){t._inputWrapper.addClass(E)}),r.on(C,G(t._click,t)).on(I,s))},readonly:function(e){this._editable({readonly:e===t?!0:e,disable:!1})},enable:function(e){this._editable({readonly:!1,disable:!(e=e===t?!0:e)})},destroy:function(){var e=this;_.fn.destroy.call(e),e.timeView.destroy(),e.element.off(y),e._arrow.off(y),e._inputWrapper.off(y),e._form&&e._form.off("reset",e._resetHandler)},close:function(){this.timeView.close()},open:function(){this.timeView.open()},min:function(e){return this._option("min",e)},max:function(e){return this._option("max",e)},value:function(e){var n=this;return e===t?n._value:(n._old=n._update(e),null===n._old&&n.element.val(""),n._oldText=n.element.val(),t)},_blur:function(){var e=this,t=e.element.val();e.close(),t!==e._oldText&&e._change(t),e._inputWrapper.removeClass(E)},_click:function(){var e=this,t=e.element;e.timeView.toggle(),m.touch||t[0]===f()||t.focus()},_change:function(e){var t=this;e=t._update(e),+t._old!=+e&&(t._old=e,t._oldText=t.element.val(),t.trigger(w),t.element.trigger(w))},_icon:function(){var t,n=this,i=n.element;t=i.next("span.k-select"),t[0]||(t=e('<span unselectable="on" class="k-select"><span unselectable="on" class="k-icon k-i-clock">select</span></span>').insertAfter(i)),n._arrow=t.attr({role:"button","aria-controls":n.timeView._timeViewID})},_keydown:function(e){var t=this,n=e.keyCode,i=t.timeView,r=t.element.val();i.popup.visible()||e.altKey?i.move(e):n===u.ENTER&&r!==t._oldText&&t._change(r)},_option:function(e,n){var i=this,r=i.options;return n===t?r[e]:(n=i.timeView._parse(n),n&&(n=new $(+n),r[e]=n,i.timeView.options[e]=n,i.timeView.bind()),t)},_toggleHover:function(t){e(t.currentTarget).toggleClass(A,"mouseenter"===t.type)},_update:function(e){var t=this,n=t.options,i=t.timeView,r=i._parse(e);return o(r,n.min,n.max)||(r=null),t._value=r,t.element.val(r?c.toString(r,n.format,n.culture):e),i.value(r),r},_wrapper:function(){var t,n=this,i=n.element;t=i.parents(".k-timepicker"),t[0]||(t=i.wrap(D).parent().addClass("k-picker-wrap k-state-default"),t=t.wrap(D).parent()),t[0].style.cssText=i[0].style.cssText,n.wrapper=t.addClass("k-widget k-timepicker k-header").addClass(i[0].className),i.css({width:"100%",height:i[0].style.height}),n._inputWrapper=e(t[0].firstChild)},_reset:function(){var t=this,n=t.element,i=n.attr("form"),r=i?e("#"+i):n.closest("form");r[0]&&(t._resetHandler=function(){t.value(n[0].defaultValue)},t._form=r.on("reset",t._resetHandler))}}),v.plugin(d)})(window.kendo.jQuery);(function(e,t){function n(e){var t=new Date(2100,0,1);return t.setMinutes(-e),t}function i(e){e.preventDefault()}function r(t){var n,i=o.getCulture(t.culture).calendars.standard.patterns;t.format=d(t.format||i.g),t.timeFormat=n=d(t.timeFormat||i.t),o.DateView.normalize(t),-1===e.inArray(n,t.parseFormats)&&t.parseFormats.splice(1,0,n)}var o=window.kendo,a=o.TimeView,s=o.parseDate,l=o._activeElement,d=o._extractFormat,c=o.calendar,u=c.isInRange,p=c.restrictValue,f=c.isEqualDatePart,h=a.getMilliseconds,m=o.ui,g=m.Widget,v="open",_="close",k="change",b=".kendoDateTimePicker",w="click"+b,y="disabled",C="readonly",x="k-state-default",T="k-state-focused",S="k-state-hover",F="k-state-disabled",D="mouseenter"+b+" mouseleave"+b,E="mousedown"+b,A="month",H="<span/>",I="aria-activedescendant",R="aria-expanded",M="aria-hidden",z="aria-owns",N="aria-disabled",O="aria-readonly",P=Date,L=new P(1900,0,1),B=new P(2099,11,31),W={view:"date"},U={view:"time"},V=e.extend,q=g.extend({init:function(e,t){var n,i=this;g.fn.init.call(i,e,t),e=i.element,t=i.options,t.min=s(e.attr("min"))||s(t.min),t.max=s(e.attr("max"))||s(t.max),r(t),i._wrapper(),i._views(),i._icons(),i._reset(),i._template();try{e[0].setAttribute("type","text")}catch(a){e[0].type="text"}e.addClass("k-input").attr({role:"combobox","aria-expanded":!1}),i._midnight=h(t.min)+h(t.max)===0,n=e.is("[disabled]"),n?i.enable(!1):i.readonly(e.is("[readonly]")),i._old=i._update(t.value||i.element.val()),i._oldText=e.val(),o.notify(i)},options:{name:"DateTimePicker",value:null,format:"",timeFormat:"",culture:"",parseFormats:[],dates:[],min:new P(L),max:new P(B),interval:30,height:200,footer:"",start:A,depth:A,animation:{},month:{},ARIATemplate:'Current focused date is #=kendo.toString(data.current, "d")#'},events:[v,_,k],setOptions:function(e){var t,n,i,a=this,l=a._value;g.fn.setOptions.call(a,e),e=a.options,e.min=t=s(e.min),e.max=n=s(e.max),r(e),i=e.value||a._value||a.dateView._current,t&&!f(t,i)&&(t=new P(L)),n&&!f(n,i)&&(n=new P(B)),a.dateView.setOptions(e),a.timeView.setOptions(V({},e,{format:e.timeFormat,min:t,max:n})),l&&(a.element.val(o.toString(l,e.format,e.culture)),a._updateARIA(l))},_editable:function(t){var n=this,r=n.element.off(b),a=n._dateIcon.off(b),s=n._timeIcon.off(b),d=n._inputWrapper.off(b),c=t.readonly,u=t.disable;c||u?(d.addClass(u?F:x).removeClass(u?x:F),r.attr(y,u).attr(C,c).attr(N,u).attr(O,c)):(d.addClass(x).removeClass(F).on(D,n._toggleHover),r.removeAttr(y).removeAttr(C).attr(N,!1).attr(O,!1).on("keydown"+b,e.proxy(n._keydown,n)).on("focus"+b,function(){n._inputWrapper.addClass(T)}).on("blur"+b,function(){n._inputWrapper.removeClass(T),r.val()!==n._oldText&&n._change(r.val()),n.close("date"),n.close("time")}),a.on(E,i).on(w,function(){n.toggle("date"),o.support.touch||r[0]===l()||r.focus()}),s.on(E,i).on(w,function(){n.toggle("time"),o.support.touch||r[0]===l()||r.focus()}))},readonly:function(e){this._editable({readonly:e===t?!0:e,disable:!1})},enable:function(e){this._editable({readonly:!1,disable:!(e=e===t?!0:e)})},destroy:function(){var e=this;g.fn.destroy.call(e),e.dateView.destroy(),e.timeView.destroy(),e.element.off(b),e._dateIcon.off(b),e._timeIcon.off(b),e._inputWrapper.off(b),e._form&&e._form.off("reset",e._resetHandler)},close:function(e){"time"!==e&&(e="date"),this[e+"View"].close()},open:function(e){"time"!==e&&(e="date"),this[e+"View"].open()},min:function(e){return this._option("min",e)},max:function(e){return this._option("max",e)},toggle:function(e){var t="timeView";"time"!==e?e="date":t="dateView",this[e+"View"].toggle(),this[t].close()},value:function(e){var n=this;return e===t?n._value:(n._old=n._update(e),null===n._old&&n.element.val(""),n._oldText=n.element.val(),t)},_change:function(e){var t=this;e=t._update(e),+t._old!=+e&&(t._old=e,t._oldText=t.element.val(),t.trigger(k),t.element.trigger(k))},_option:function(e,i){var r,o,a=this,l=a.options,d=a.timeView,c=d.options,u=a._value||a._old;if(i===t)return l[e];if(i=s(i,l.parseFormats,l.culture)){if(l.min.getTime()===l.max.getTime()&&(c.dates=[]),l[e]=new P(i.getTime()),a.dateView[e](i),a._midnight=h(l.min)+h(l.max)===0,u&&(r=f(l.min,u),o=f(l.max,u)),r||o){if(c[e]=i,r&&!o&&(c.max=n(l.interval)),o){if(a._midnight)return d.dataBind([B]),t;r||(c.min=L)}}else c.max=B,c.min=L;d.bind()}},_toggleHover:function(t){e(t.currentTarget).toggleClass(S,"mouseenter"===t.type)},_update:function(t){var i,r,a,l,d,c=this,h=c.options,m=h.min,g=h.max,v=h.dates,_=c.timeView,k=c._value,b=s(t,h.parseFormats,h.culture),w=null===b&&null===k||b instanceof Date&&k instanceof Date;return+b===+k&&w?(d=o.toString(b,h.format,h.culture),d!==t&&c.element.val(null===b?t:d),b):(null!==b&&f(b,m)?b=p(b,m,g):u(b,m,g)||(b=null),c._value=b,_.value(b),c.dateView.value(b),b&&(a=c._old,r=_.options,v[0]&&(v=e.grep(v,function(e){return f(b,e)}),v[0]&&(_.dataBind(v),l=!0)),l||(f(b,m)&&(r.min=m,r.max=n(h.interval),i=!0),f(b,g)&&(c._midnight?(_.dataBind([B]),l=!0):(r.max=g,i||(r.min=L),i=!0))),!l&&(!a&&i||a&&!f(a,b))&&(i||(r.max=B,r.min=L),_.bind())),c.element.val(b?o.toString(b,h.format,h.culture):t),c._updateARIA(b),b)},_keydown:function(e){var t=this,n=t.dateView,i=t.timeView,r=t.element.val(),a=n.popup.visible();e.altKey&&e.keyCode===o.keys.DOWN?t.toggle(a?"time":"date"):a?(n.move(e),t._updateARIA(n._current)):i.popup.visible()?i.move(e):e.keyCode===o.keys.ENTER&&r!==t._oldText&&t._change(r)},_views:function(){var e,t,n,i,r,l,d=this,c=d.element,p=d.options,f=c.attr("id");d.dateView=e=new o.DateView(V({},p,{id:f,anchor:d.wrapper,change:function(){var t,n=e.calendar.value(),i=+n,r=+p.min,o=+p.max;(i===r||i===o)&&(t=new P(+d._value),t.setFullYear(n.getFullYear(),n.getMonth(),n.getDate()),u(t,r,o)&&(n=t)),d._change(n),d.close("date")},close:function(e){d.trigger(_,W)?e.preventDefault():(c.attr(R,!1),n.attr(M,!0),t.popup.visible()||c.removeAttr(z))},open:function(t){d.trigger(v,W)?t.preventDefault():(d.element.val()!==d._oldText&&(l=s(c.val(),p.parseFormats,p.culture),d.dateView[l?"current":"value"](l)),n.attr(M,!1),c.attr(R,!0).attr(z,e._dateViewID),d._updateARIA(l))}})),n=e.div,r=p.min.getTime(),d.timeView=t=new a({id:f,value:p.value,anchor:d.wrapper,animation:p.animation,format:p.timeFormat,culture:p.culture,height:p.height,interval:p.interval,min:new P(L),max:new P(B),dates:r===p.max.getTime()?[new Date(r)]:[],parseFormats:p.parseFormats,change:function(n,i){n=t._parse(n),p.min>n?(n=new P(+p.min),t.options.min=n):n>p.max&&(n=new P(+p.max),t.options.max=n),i?(d._timeSelected=!0,d._change(n)):(c.val(o.toString(n,p.format,p.culture)),e.value(n),d._updateARIA(n))},close:function(t){d.trigger(_,U)?t.preventDefault():(i.attr(M,!0),c.attr(R,!1),e.popup.visible()||c.removeAttr(z))},open:function(e){t._adjustListWidth(),d.trigger(v,U)?e.preventDefault():(i.attr(M,!1),c.attr(R,!0).attr(z,t._timeViewID),t.options.active(t.current()))},active:function(e){c.removeAttr(I),e&&c.attr(I,t._optionID)}}),i=t.ul},_icons:function(){var t,n=this,i=n.element;t=i.next("span.k-select"),t[0]||(t=e('<span unselectable="on" class="k-select"><span unselectable="on" class="k-icon k-i-calendar">select</span><span unselectable="on" class="k-icon k-i-clock">select</span></span>').insertAfter(i)),t=t.children(),n._dateIcon=t.eq(0).attr({role:"button","aria-controls":n.dateView._dateViewID}),n._timeIcon=t.eq(1).attr({role:"button","aria-controls":n.timeView._timeViewID})},_wrapper:function(){var t,n=this,i=n.element;t=i.parents(".k-datetimepicker"),t[0]||(t=i.wrap(H).parent().addClass("k-picker-wrap k-state-default"),t=t.wrap(H).parent()),t[0].style.cssText=i[0].style.cssText,i.css({width:"100%",height:i[0].style.height}),n.wrapper=t.addClass("k-widget k-datetimepicker k-header").addClass(i[0].className),n._inputWrapper=e(t[0].firstChild)},_reset:function(){var t=this,n=t.element,i=n.attr("form"),r=i?e("#"+i):n.closest("form");r[0]&&(t._resetHandler=function(){t.value(n[0].defaultValue)},t._form=r.on("reset",t._resetHandler))},_template:function(){this._ariaTemplate=o.template(this.options.ARIATemplate)},_updateARIA:function(e){var t,n=this,i=n.dateView.calendar;n.element.removeAttr(I),i&&(t=i._cell,t.attr("aria-label",n._ariaTemplate({current:e||i.current()})),n.element.attr(I,t.attr("id")))}});m.plugin(q)})(window.kendo.jQuery);(function(e,t){function n(e){return function(t){var n=t.children(".k-animation-container");return n.length||(n=t),n.children(e)}}function i(e){return h.template(e,{useWithBlock:!1})}function r(e){return e.children("div").find(".k-checkbox:first :checkbox")}function o(e){return function(t,n){n=n.closest(q);var i,r=n.parent();return r.parent().is("li")&&(i=r.parent()),this._dataSourceMove(t,r,i,function(t,i){return this._insert(t.data(),i,n.index()+e)})}}function a(t,n){for(var i;t&&"ul"!=t.nodeName.toLowerCase();)i=t,t=t.nextSibling,3==i.nodeType&&(i.nodeValue=e.trim(i.nodeValue)),f.test(i.className)?n.insertBefore(i,n.firstChild):n.appendChild(i)}function s(t){var n=t.children("div"),i=t.children("ul"),r=n.children(".k-icon"),o=t.children(":checkbox"),s=n.children(".k-in");t.hasClass("k-treeview")||(n.length||(n=e("<div />").prependTo(t)),!r.length&&i.length?r=e("<span class='k-icon' />").prependTo(n):i.length&&i.children().length||(r.remove(),i.remove()),o.length&&e("<span class='k-checkbox' />").appendTo(n).append(o),s.length||(s=t.children("a").eq(0).addClass("k-in"),s.length||(s=e("<span class='k-in' />")),s.appendTo(n),n.length&&a(n[0].nextSibling,s[0])))}function l(e){var t=this;t.treeview=e,t.hovered=e.element,t._draggable=new m.Draggable(e.element,{filter:"div:not(.k-state-disabled) .k-in",hint:function(t){return e.templates.dragClue({item:e.dataItem(t),treeview:e.options})},cursorOffset:{left:10,top:h.support.touch||h.support.msPointers||h.support.pointers?-40/h.support.zoomLevel():10},dragstart:y(t.dragstart,t),dragcancel:y(t.dragcancel,t),drag:y(t.drag,t),dragend:y(t.dragend,t)})}var d,c,u,p,f,h=window.kendo,m=h.ui,g=h.data,v=e.extend,_=h.template,k=e.isArray,b=m.Widget,w=g.HierarchicalDataSource,y=e.proxy,C=h.keys,x=".kendoTreeView",T="select",S="navigate",F="expand",D="change",E="error",A="checked",H="indeterminate",I="collapse",N="dragstart",R="drag",M="drop",z="dragend",O="dataBound",P="click",L="visibility",B="undefined",W="k-state-hover",U="k-treeview",V=":visible",q=".k-item",j="string",G="aria-selected",$="aria-disabled",Y={text:"dataTextField",url:"dataUrlField",spriteCssClass:"dataSpriteCssClassField",imageUrl:"dataImageUrlField"},K=function(e){return"object"==typeof HTMLElement?e instanceof HTMLElement:e&&"object"==typeof e&&1===e.nodeType&&typeof e.nodeName===j
};c=n(".k-group"),u=n(".k-group,.k-content"),p=function(e){return e.children("div").children(".k-icon")},f=/k-sprite/,d=b.extend({init:function(e,t){var n,i,r=this,o=!1,a=t&&!!t.dataSource;k(t)&&(n=!0,t={dataSource:t}),t&&typeof t.loadOnDemand==B&&k(t.dataSource)&&(t.loadOnDemand=!1),b.prototype.init.call(r,e,t),e=r.element,t=r.options,i=e.is("ul")&&e||e.hasClass(U)&&e.children("ul"),o=!a&&i.length,o&&(t.dataSource.list=i),r._animation(),r._accessors(),r._templates(),e.hasClass(U)?(r.wrapper=e,r.root=e.children("ul").eq(0)):(r._wrapper(),i&&(r.root=e,r._group(r.wrapper))),r._tabindex(),r.wrapper.filter("[role=tree]").length||r.wrapper.attr("role","tree"),r._dataSource(o),r._attachEvents(),r._dragging(),o?r._syncHtmlAndDataSource():t.autoBind&&(r._progress(!0),r.dataSource.fetch()),t.checkboxes&&t.checkboxes.checkChildren&&r.updateIndeterminate(),r.element[0].id&&(r._ariaId=h.format("{0}_tv_active",r.element[0].id)),h.notify(r)},_attachEvents:function(){var t=this,n=".k-in:not(.k-state-selected,.k-state-disabled)",i="mouseenter";t.wrapper.on(i+x,".k-in.k-state-selected",function(e){e.preventDefault()}).on(i+x,n,function(){e(this).addClass(W)}).on("mouseleave"+x,n,function(){e(this).removeClass(W)}).on(P+x,n,y(t._click,t)).on("dblclick"+x,".k-in:not(.k-state-disabled)",y(t._toggleButtonClick,t)).on(P+x,".k-plus,.k-minus",y(t._toggleButtonClick,t)).on("keydown"+x,y(t._keydown,t)).on("focus"+x,y(t._focus,t)).on("blur"+x,y(t._blur,t)).on("mousedown"+x,".k-in,.k-checkbox :checkbox,.k-plus,.k-minus",y(t._mousedown,t)).on("change"+x,".k-checkbox :checkbox",y(t._checkboxChange,t)).on("click"+x,".k-checkbox :checkbox",y(t._checkboxClick,t)).on("click"+x,".k-request-retry",y(t._retryRequest,t)).on("click"+x,function(n){e(n.target).is(":kendoFocusable")||t.focus()})},_checkboxClick:function(t){var n=e(t.target);n.data(H)&&(n.data(H,!1).prop(H,!1).prop(A,!0),this._checkboxChange(t))},_syncHtmlAndDataSource:function(e,t){var n,i,o,a,s,l,d,c;for(e=e||this.root,t=t||this.dataSource,n=t.view(),i=h.attr("uid"),o=h.attr("expanded"),a=this.options.checkboxes,s=e.children("li"),l=0;s.length>l;l++)c=n[l],d=s.eq(l),d.attr("role","treeitem").attr(i,c.uid),c.expanded="true"===d.attr(o),a&&(c.checked=r(d).prop(A)),this._syncHtmlAndDataSource(d.children("ul"),c.children)},_animation:function(){var e=this.options,t=e.animation;t===!1?t={expand:{effects:{}},collapse:{hide:!0,effects:{}}}:t.collapse&&"effects"in t.collapse||(t.collapse=v({reverse:!0},t.expand)),v(t.collapse,{hide:!0}),e.animation=t},_dragging:function(){var e=this.options.dragAndDrop,t=this.dragging;e&&!t?this.dragging=new l(this):!e&&t&&(t.destroy(),this.dragging=null)},_templates:function(){var e=this,t=e.options,n=y(e._fieldAccessor,e);t.template&&typeof t.template==j?t.template=_(t.template):t.template||(t.template=i("# var text = "+n("text")+"(data.item); ## if (typeof data.item.encoded != 'undefined' && data.item.encoded === false) {##= text ## } else { ##: text ## } #")),e._checkboxes(),e.templates={wrapperCssClass:function(e,t){var n="k-item",i=t.index;return e.firstLevel&&0===i&&(n+=" k-first"),i==e.length-1&&(n+=" k-last"),n},cssClass:function(e,t){var n="",i=t.index,r=e.length-1;return e.firstLevel&&0===i&&(n+="k-top "),n+=0===i&&i!=r?"k-top":i==r?"k-bot":"k-mid"},textClass:function(e){var t="k-in";return e.enabled===!1&&(t+=" k-state-disabled"),e.selected===!0&&(t+=" k-state-selected"),t},toggleButtonClass:function(e){var t="k-icon";return t+=e.expanded!==!0?" k-plus":" k-minus",e.enabled===!1&&(t+="-disabled"),t},groupAttributes:function(e){return e.expanded!==!0?" style='display:none'":""},groupCssClass:function(e){var t="k-group";return e.firstLevel&&(t+=" k-treeview-lines"),t},dragClue:i("<div class='k-header k-drag-clue'><span class='k-icon k-drag-status' />#= data.treeview.template(data) #</div>"),group:i("<ul class='#= data.r.groupCssClass(data.group) #'#= data.r.groupAttributes(data.group) # role='group'>#= data.renderItems(data) #</ul>"),itemContent:i("# var imageUrl = "+n("imageUrl")+"(data.item); ## var spriteCssClass = "+n("spriteCssClass")+"(data.item); ## if (imageUrl) { #<img class='k-image' alt='' src='#= imageUrl #'># } ## if (spriteCssClass) { #<span class='k-sprite #= spriteCssClass #' /># } ##= data.treeview.template(data) #"),itemElement:i("# var item = data.item, r = data.r; ## var url = "+n("url")+"(item); #<div class='#= r.cssClass(data.group, item) #'># if (item.hasChildren) { #<span class='#= r.toggleButtonClass(item) #' role='presentation' /># } ## if (data.treeview.checkboxes) { #<span class='k-checkbox' role='presentation'>#= data.treeview.checkboxes.template(data) #</span># } ## var tag = url ? 'a' : 'span'; ## var textAttr = url ? ' href=\\'' + url + '\\'' : ''; #<#=tag#  class='#= r.textClass(item) #'#= textAttr #>#= r.itemContent(data) #</#=tag#></div>"),item:i("# var item = data.item, r = data.r; #<li role='treeitem' class='#= r.wrapperCssClass(data.group, item) #' "+h.attr("uid")+"='#= item.uid #'#=item.selected ? \"aria-selected='true'\" : ''##=item.enabled === false ? \"aria-disabled='true'\" : ''#>#= r.itemElement(data) #</li>"),loading:i("<div class='k-icon k-loading' /> #: data.messages.loading #"),retry:i("#: data.messages.requestFailed # <button class='k-button k-request-retry'>#: data.messages.retry #</button>")}},items:function(){return this.element.find(".k-item")},setDataSource:function(e){this.options.dataSource=e,this._dataSource(),this.dataSource.fetch()},_bindDataSource:function(){this._refreshHandler=y(this.refresh,this),this._errorHandler=y(this._error,this),this.dataSource.bind(D,this._refreshHandler),this.dataSource.bind(E,this._errorHandler)},_unbindDataSource:function(){var e=this.dataSource;e&&(e.unbind(D,this._refreshHandler),e.unbind(E,this._errorHandler))},_dataSource:function(e){function t(e){for(var n=0;e.length>n;n++)e[n]._initChildren(),e[n].children.fetch(),t(e[n].children.view())}var n=this,i=n.options,r=i.dataSource;r=k(r)?{data:r}:r,n._unbindDataSource(),r.fields||(r.fields=[{field:"text"},{field:"url"},{field:"spriteCssClass"},{field:"imageUrl"}]),n.dataSource=r=w.create(r),e&&(r.fetch(),t(r.view())),n._bindDataSource()},events:[N,R,M,z,O,F,I,T,D,S],options:{name:"TreeView",dataSource:{},animation:{expand:{effects:"expand:vertical",duration:200},collapse:{duration:100}},messages:{loading:"Loading...",requestFailed:"Request failed.",retry:"Retry"},dragAndDrop:!1,checkboxes:!1,autoBind:!0,loadOnDemand:!0,template:"",dataTextField:null},_accessors:function(){var e,t,n,i=this,r=i.options,o=i.element;for(e in Y)t=r[Y[e]],n=o.attr(h.attr(e+"-field")),!t&&n&&(t=n),t||(t=e),k(t)||(t=[t]),r[Y[e]]=t},_fieldAccessor:function(t){var n=this.options[Y[t]],i=n.length,r="(function(item) {";return 0===i?r+="return item['"+t+"'];":(r+="var levels = ["+e.map(n,function(e){return"function(d){ return "+h.expr(e)+"}"}).join(",")+"];",r+="return levels[Math.min(item.level(), "+i+"-1)](item)"),r+="})"},setOptions:function(e){b.fn.setOptions.call(this,e),this._animation(),this._dragging(),this._templates()},_trigger:function(e,t){return this.trigger(e,{node:t.closest(q)[0]})},_setChecked:function(t,n){if(t&&e.isFunction(t.view))for(var i=0,r=t.view();r.length>i;i++)r[i][A]=n,r[i].children&&this._setChecked(r[i].children,n)},_setIndeterminate:function(e){var t,n,i,o=c(e),a=!0;if(o.length&&(t=r(o.children()),n=t.length)){if(n>1){for(i=1;n>i;i++)if(t[i].checked!=t[i-1].checked||t[i].indeterminate||t[i-1].indeterminate){a=!1;break}}else a=!t[0].indeterminate;return r(e).data(H,!a).prop(H,!a).prop(A,a&&t[0].checked)}},updateIndeterminate:function(e){var t,n,i;if(e=e||this.wrapper,t=c(e).children(),t.length){for(n=0;t.length>n;n++)this.updateIndeterminate(t.eq(n));i=this._setIndeterminate(e),i&&i.prop(A)&&(this.dataItem(e).checked=!0)}},_bubbleIndeterminate:function(e){if(e.length){var t,n=this.parent(e);n.length&&(this._setIndeterminate(n),t=n.children("div").find(".k-checkbox :checkbox"),t.prop(H)===!1?this.dataItem(n).set(A,t.prop(A)):this.dataItem(n).checked=!1,this._bubbleIndeterminate(n))}},_checkboxChange:function(t){var n=e(t.target),i=n.prop(A),r=n.closest(q);this.dataItem(r).set(A,i)},_toggleButtonClick:function(t){this.toggle(e(t.target).closest(q))},_mousedown:function(t){var n=e(t.currentTarget).closest(q);this._clickTarget=n,this.current(n)},_focusable:function(e){return e&&e.length&&e.is(":visible")&&!e.find(".k-in:first").hasClass("k-state-disabled")},_focus:function(){var t=this.select(),n=this._clickTarget;h.support.touch||(n&&n.length&&(t=n),this._focusable(t)||(t=this.current()),this._focusable(t)||(t=this._nextVisible(e())),this.current(t))},focus:function(){var e,t=this.wrapper,n=t[0],i=[],r=[],o=document.documentElement;do n=n.parentNode,n.scrollHeight>n.clientHeight&&(i.push(n),r.push(n.scrollTop));while(n!=o);for(t.focus(),e=0;i.length>e;e++)i[e].scrollTop=r[e]},_blur:function(){this.current().find(".k-in:first").removeClass("k-state-focused")},_enabled:function(e){return!e.children("div").children(".k-in").hasClass("k-state-disabled")},parent:function(t){var n,i,r=/\bk-treeview\b/,o=/\bk-item\b/;typeof t==j&&(t=this.element.find(t)),K(t)||(t=t[0]),i=o.test(t.className);do t=t.parentNode,o.test(t.className)&&(i?n=t:i=!0);while(!r.test(t.className)&&!n);return e(n)},_nextVisible:function(e){function t(e){for(;e.length&&!e.next().length;)e=i.parent(e);return e.next().length?e.next():e}var n,i=this,r=i._expanded(e);return e.length&&e.is(":visible")?r?(n=c(e).children().first(),n.length||(n=t(e))):n=t(e):n=i.root.children().eq(0),i._enabled(n)||(n=i._nextVisible(n)),n},_previousVisible:function(e){var t,n,i=this;if(!e.length||e.prev().length)for(n=e.length?e.prev():i.root.children().last();i._expanded(n)&&(t=c(n).children().last(),t.length);)n=t;else n=i.parent(e)||e;return i._enabled(n)||(n=i._previousVisible(n)),n},_keydown:function(n){var i,r=this,o=n.keyCode,a=r.current(),s=r._expanded(a),l=a.find(".k-checkbox:first :checkbox"),d=h.support.isRtl(r.element);n.target==n.currentTarget&&(!d&&o==C.RIGHT||d&&o==C.LEFT?s?i=r._nextVisible(a):r.expand(a):!d&&o==C.LEFT||d&&o==C.RIGHT?s?r.collapse(a):(i=r.parent(a),r._enabled(i)||(i=t)):o==C.DOWN?i=r._nextVisible(a):o==C.UP?i=r._previousVisible(a):o==C.HOME?i=r._nextVisible(e()):o==C.END?i=r._previousVisible(e()):o==C.ENTER?a.find(".k-in:first").hasClass("k-state-selected")||r._trigger(T,a)||r.select(a):o==C.SPACEBAR&&l.length&&(l.prop(A,!l.prop(A)).data(H,!1).prop(H,!1),r._checkboxChange({target:l}),i=a),i&&(n.preventDefault(),a[0]!=i[0]&&(r._trigger(S,i),r.current(i))))},_click:function(t){var n,i=this,r=e(t.currentTarget),o=u(r.closest(q)),a=r.attr("href");n=a?"#"==a||a.indexOf("#"+this.element.id+"-")>=0:o.length&&!o.children().length,n&&t.preventDefault(),r.hasClass(".k-state-selected")||i._trigger(T,r)||i.select(r)},_wrapper:function(){var e,t,n=this,i=n.element,r="k-widget k-treeview";i.is("ul")?(e=i.wrap("<div />").parent(),t=i):(e=i,t=e.children("ul").eq(0)),n.wrapper=e.addClass(r),n.root=t},_group:function(e){var t=this,n=e.hasClass(U),i={firstLevel:n,expanded:n||t._expanded(e)},r=e.children("ul");r.addClass(t.templates.groupCssClass(i)).css("display",i.expanded?"":"none"),t._nodes(r,i)},_nodes:function(t,n){var i,r=this,o=t.children("li");n=v({length:o.length},n),o.each(function(t,o){o=e(o),i={index:t,expanded:r._expanded(o)},s(o),r._updateNodeClasses(o,n,i),r._group(o)})},_checkboxes:function(){var e,t=this.options,n=t.checkboxes;(n||t.checkboxTemplate)&&(t.checkboxTemplate?e=t.checkboxTemplate:(e="<input type='checkbox' #= (item.enabled === false) ? 'disabled' : '' # #= item.checked ? 'checked' : '' #",n.name&&(e+=" name='"+n.name+"'"),e+=" />"),n=v({template:e},t.checkboxes),typeof n.template==j&&(n.template=_(n.template)),t.checkboxes=n)},_updateNodeClasses:function(e,t,n){var i=e.children("div"),r=e.children("ul"),o=this.templates;e.hasClass("k-treeview")||(n=n||{},n.expanded=typeof n.expanded!=B?n.expanded:this._expanded(e),n.index=typeof n.index!=B?n.index:e.index(),n.enabled=typeof n.enabled!=B?n.enabled:!i.children(".k-in").hasClass("k-state-disabled"),t=t||{},t.firstLevel=typeof t.firstLevel!=B?t.firstLevel:e.parent().parent().hasClass(U),t.length=typeof t.length!=B?t.length:e.parent().children().length,e.removeClass("k-first k-last").addClass(o.wrapperCssClass(t,n)),i.removeClass("k-top k-mid k-bot").addClass(o.cssClass(t,n)),i.children(".k-in").removeClass("k-in k-state-default k-state-disabled").addClass(o.textClass(n)),(r.length||"true"==e.attr("data-hasChildren"))&&(i.children(".k-icon").removeClass("k-plus k-minus k-plus-disabled k-minus-disabled").addClass(o.toggleButtonClass(n)),r.addClass("k-group")))},_processNodes:function(t,n){var i=this;i.element.find(t).each(function(t,r){n.call(i,t,e(r).closest(q))})},dataItem:function(t){var n=e(t).closest(q).attr(h.attr("uid")),i=this.dataSource;return i&&i.getByUid(n)},_insertNode:function(t,n,i,r,o){var a,l,d,u,p=this,f=c(i),h=f.children().length+1,m={firstLevel:i.hasClass(U),expanded:!o,length:h},g="",v=function(e,t){e.appendTo(t)};for(d=0;t.length>d;d++)u=t[d],u.index=n+d,g+=p._renderItem({group:m,item:u});if(l=e(g),l.length){for(f.length||(f=e(p._renderGroup({group:m})).appendTo(i)),r(l,f),i.hasClass("k-item")&&(s(i),p._updateNodeClasses(i)),p._updateNodeClasses(l.prev().first()),p._updateNodeClasses(l.next().last()),d=0;t.length>d;d++)u=t[d],u.hasChildren&&(a=u.children.data(),a.length&&p._insertNode(a,u.index,l.eq(d),v,!p._expanded(l.eq(d))));return l}},_updateNode:function(t,n){function i(){f=!0}function r(e,t){e.find(".k-checkbox :checkbox").prop(A,t).data(H,!1).prop(H,!1)}var o,a,s,l,d,c=this,p={treeview:c.options,item:s},f=!1;if("selected"==t)s=n[0],a=c.findByUid(s.uid).find(".k-in:first").removeClass("k-state-hover").toggleClass("k-state-selected",s[t]).end(),s[t]?(c.current(a),a.attr(G,!0)):a.attr(G,!1);else for(e.inArray(t,c.options.dataTextField)>=0?f=!0:(p.item=n[0],p.item.bind("get",i),c.templates.itemContent(p),p.item.unbind("set",i)),o=0;n.length>o;o++)p.item=s=n[o],("spriteCssClass"==t||"imageUrl"==t||f)&&c.findByUid(s.uid).find(">div>.k-in").html(c.templates.itemContent(p)),t==A?(a=c.findByUid(s.uid),l=s[t],r(a.children("div"),l),c.options.checkboxes.checkChildren&&(r(a.children(".k-group"),l),c._setChecked(s.children,l),c._bubbleIndeterminate(a))):"expanded"==t?c._toggle(c.findByUid(s.uid),s,s[t]):"enabled"==t&&(a=c.findByUid(s.uid),a.find(".k-checkbox :checkbox").prop("disabled",!s[t]),d=!u(a).is(V),a.removeAttr($),s[t]||(s.selected&&s.set("selected",!1),s.expanded&&s.set("expanded",!1),d=!0,a.removeAttr(G).attr($,!0)),c._updateNodeClasses(a,{},{enabled:s[t],expanded:!d}))},_appendItems:function(e,t,n){var i=c(n),r=i.children(),o=!this._expanded(n);typeof e==B&&(e=r.length),this._insertNode(t,e,n,function(t,n){e>=r.length?t.appendTo(n):t.insertBefore(r.eq(e))},o),this._expanded(n)&&(this._updateNodeClasses(n),c(n).css("display","block"))},refresh:function(n){var i,r,o,a=this,l=a.wrapper,d=n.node,u=n.action,p=n.items,f=a.options,h=f.loadOnDemand,m=f.checkboxes&&f.checkboxes.checkChildren;if(n.field){if(!p[0].level)return;return a._updateNode(n.field,p)}if(d&&(l=a.findByUid(d.uid),a._progress(l,!1)),m&&"remove"!=u&&d&&d.checked)for(i=0;p.length>i;i++)p[i].checked=!0;for("add"==u?this._appendItems(n.index,p,l):"remove"==u?a._remove(a.findByUid(p[0].uid),!1):d?(c(l).empty(),p.length?(this._appendItems(n.index,p,l),h&&m&&this._bubbleIndeterminate(c(l).children().last())):s(l)):(r=a._renderGroup({items:p,group:{firstLevel:!0,expanded:!0}}),a.root.length?(o=e(r),a.root.attr("class",o.attr("class")).attr("role",o.attr("role")).html(o.html())):a.root=a.wrapper.html(r).children("ul")),i=0;p.length>i;i++)(!h||p[i].expanded)&&p[i].load();a.trigger(O,{node:d?l:t})},_error:function(e){var t=e.node&&this.findByUid(e.node.uid),n=this.templates.retry({messages:this.options.messages});t?(this._progress(t,!1),this._expanded(t,!1),p(t).addClass("k-i-refresh"),e.node.loaded(!1)):(this._progress(!1),this.element.html(n))},_retryRequest:function(e){e.preventDefault(),this.dataSource.fetch()},expand:function(e){this._processNodes(e,function(e,t){this.toggle(t,!0)})},collapse:function(e){this._processNodes(e,function(e,t){this.toggle(t,!1)})},enable:function(e,t){t=2==arguments.length?!!t:!0,this._processNodes(e,function(e,n){this.dataItem(n).set("enabled",t)})},current:function(n){var i=this,r=i._current,o=i.element,a=i._ariaId;return arguments.length>0&&n&&n.length?(r&&(r[0].id===a&&r.removeAttr("id"),r.find(".k-in:first").removeClass("k-state-focused")),r=i._current=e(n,o).closest(q),r.find(".k-in:first").addClass("k-state-focused"),a=r[0].id||a,a&&(i.wrapper.removeAttr("aria-activedescendant"),r.attr("id",a),i.wrapper.attr("aria-activedescendant",a)),t):(r||(r=i._nextVisible(e())),r)},select:function(n){var i=this,r=i.element;return arguments.length?(n=e(n,r).closest(q),r.find(".k-state-selected").each(function(){var e=i.dataItem(this);e.set("selected",!1),delete e.selected}),n.length&&i.dataItem(n).set("selected",!0),i.trigger(D),t):r.find(".k-state-selected").closest(q)},_toggle:function(e,t,n){var i,r=this,o=r.options,a=u(e),s=n?"expand":"collapse",l=o.animation[s];if(!a.data("animating")&&!r._trigger(s,e))if(r._expanded(e,n),i=t&&t.loaded(),i&&a.children().length>0){if(r._updateNodeClasses(e,{},{expanded:n}),a.css("display")==(n?"block":"none"))return;n||a.css("height",a.height()).css("height"),a.kendoStop(!0,!0).kendoAnimate(v({reset:!0},l,{complete:function(){n&&a.css("height","")}}))}else n&&(o.loadOnDemand&&r._progress(e,!0),a.remove(),t.load())},toggle:function(t,n){t=e(t),p(t).is(".k-minus,.k-plus,.k-minus-disabled,.k-plus-disabled")&&(1==arguments.length&&(n=!this._expanded(t)),this._expanded(t,n))},destroy:function(){var e=this;b.fn.destroy.call(e),e.wrapper.off(x),e._unbindDataSource(),e.dragging&&e.dragging.destroy(),h.destroy(e.element),e.root=e.wrapper=e.element=null},_expanded:function(e,n){var i=h.attr("expanded"),r=this.dataItem(e);return 1==arguments.length?"true"===e.attr(i)||r&&r.expanded:(u(e).data("animating")||(r&&(r.set("expanded",n),n=r.expanded),n?(e.attr(i,"true"),e.attr("aria-expanded","true")):(e.removeAttr(i),e.attr("aria-expanded","false"))),t)},_progress:function(e,t){var n=this.element,i=this.templates.loading({messages:this.options.messages});1==arguments.length?(t=e,t?n.html(i):n.empty()):p(e).toggleClass("k-loading",t).removeClass("k-i-refresh")},text:function(e,n){var i=this.dataItem(e),r=this.options[Y.text],o=i.level(),a=r.length,s=r[Math.min(o,a-1)];return n?(i.set(s,n),t):i[s]},_objectOrSelf:function(t){return e(t).closest("[data-role=treeview]").data("kendoTreeView")||this},_dataSourceMove:function(e,t,n,i){var r,o=this._objectOrSelf(n||t),a=o.dataSource;return n&&n[0]!=o.element[0]&&(r=o.dataItem(n),r.loaded()||(o._progress(n,!0),r.load()),n!=this.root&&(a=r.children,a&&a instanceof w||(r._initChildren(),r.loaded(!0),a=r.children))),e=this._toObservableData(e),i.call(this,a,e)},_toObservableData:function(t){var n,i,r=t;return(t instanceof window.jQuery||K(t))&&(n=this._objectOrSelf(t).dataSource,i=e(t).attr(h.attr("uid")),r=n.getByUid(i),r&&(r=n.remove(r))),r},_insert:function(e,t,n){t instanceof h.data.ObservableArray?t=t.toJSON():k(t)||(t=[t]);var i=e.parent();return i&&i._initChildren&&(i.hasChildren=!0,i._initChildren()),e.splice.apply(e,[n,0].concat(t)),this.findByUid(e[n].uid)},insertAfter:o(1),insertBefore:o(0),append:function(t,n,i){var r=this,o=r.root;return i=i||e.noop,n&&(o=c(n)),r._dataSourceMove(t,o,n,function(e,t){function o(){n&&r._expanded(n,!0);var i=e.data(),o=Math.max(i.length,0);return r._insert(i,t,o)}var a;return e.data()?(a=o(),i(a),a):(e.one(D,function(){i(o())}),null)})},_remove:function(t,n){var i,r,o,a=this;return t=e(t,a.element),i=t.parent().parent(),r=t.prev(),o=t.next(),t[n?"detach":"remove"](),i.hasClass("k-item")&&(s(i),a._updateNodeClasses(i)),a._updateNodeClasses(r),a._updateNodeClasses(o),t},remove:function(e){var t=this.dataItem(e);t&&this.dataSource.remove(t)},detach:function(e){return this._remove(e,!0)},findByText:function(t){return e(this.element).find(".k-in").filter(function(n,i){return e(i).text()==t}).closest(q)},findByUid:function(e){return this.element.find(".k-item["+h.attr("uid")+"="+e+"]")},expandPath:function(n,i){var r=this.dataSource,o=r.get(n[0]);for(i=i||e.noop;n.length>0&&(o.expanded||o.loaded());)o.set("expanded",!0),n.shift(),o=r.get(n[0]);return n.length?(r.bind("change",function(e){var t=e.node&&e.node.id;t&&t===n[0]&&(n.shift(),n.length?r.get(n[0]).set("expanded",!0):i())}),o.set("expanded",!0),t):i()},_renderItem:function(e){return e.group||(e.group={}),e.treeview=this.options,e.r=this.templates,this.templates.item(e)},_renderGroup:function(e){var t=this;return e.renderItems=function(e){var n="",i=0,r=e.items,o=r?r.length:0,a=e.group;for(a.length=o;o>i;i++)e.group=a,e.item=r[i],e.item.index=i,n+=t._renderItem(e);return n},e.r=t.templates,t.templates.group(e)}}),l.prototype={_removeTouchHover:function(){var e=this;h.support.touch&&e.hovered&&(e.hovered.find("."+W).removeClass(W),e.hovered=!1)},_hintStatus:function(n){var i=this._draggable.hint.find(".k-drag-status")[0];return n?(i.className="k-icon k-drag-status "+n,t):e.trim(i.className.replace(/k-(icon|drag-status)/g,""))},dragstart:function(t){var n=this,i=n.treeview,r=n.sourceNode=t.currentTarget.closest(q);i.trigger(N,{sourceNode:r[0]})&&t.preventDefault(),n.dropHint=e("<div class='k-drop-hint' />").css(L,"hidden").appendTo(i.element)},drag:function(t){var n,i,r,o,a,s,l,d,c,u,p=this,f=p.treeview,m=p.sourceNode,g=p.dropTarget=e(h.eventTarget(t)),v=g.closest(".k-treeview");v.length?e.contains(m[0],g[0])?n="k-denied":(n="k-insert-middle",i=g.closest(".k-top,.k-mid,.k-bot"),i.length?(o=i.outerHeight(),a=h.getOffset(i).top,s=g.closest(".k-in"),l=o/(s.length>0?4:2),d=a+l>t.y.location,c=t.y.location>a+o-l,p._removeTouchHover(),u=s.length&&!d&&!c,p.hovered=u?v:!1,p.dropHint.css(L,u?"hidden":"visible"),s.toggleClass(W,u),u?n="k-add":(r=i.position(),r.top+=d?0:o,p.dropHint.css(r)[d?"prependTo":"appendTo"](g.closest(q).children("div:first")),d&&i.hasClass("k-top")&&(n="k-insert-top"),c&&i.hasClass("k-bot")&&(n="k-insert-bottom"))):g[0]!=p.dropHint[0]&&(n=v[0]!=f.element[0]?"k-add":"k-denied")):(n="k-denied",p._removeTouchHover()),f.trigger(R,{sourceNode:m[0],dropTarget:g[0],pageY:t.y.location,pageX:t.x.location,statusClass:n.substring(2),setStatusClass:function(e){n=e}}),0!==n.indexOf("k-insert")&&p.dropHint.css(L,"hidden"),p._hintStatus(n)},dragcancel:function(){this.dropHint.remove()},dragend:function(){function e(e){a.trigger(z,{sourceNode:e&&e[0],destinationNode:n[0],dropPosition:s})}var n,i,r,o=this,a=o.treeview,s="over",l=o.sourceNode,d=o.dropHint,c=o.dropTarget;return"visible"==d.css(L)?(s=d.prevAll(".k-in").length>0?"after":"before",n=d.closest(q)):c&&(n=c.closest(q),n.length||(n=c.closest(".k-treeview"))),i={sourceNode:l[0],destinationNode:n[0],valid:"k-denied"!=o._hintStatus(),setValid:function(e){this.valid=e},dropTarget:c[0],dropPosition:s},r=a.trigger(M,i),d.remove(),o._removeTouchHover(),!i.valid||r?(o._draggable.dropped=i.valid,t):(o._draggable.dropped=!0,"over"==s?a.append(l,n,e):("before"==s?l=a.insertBefore(l,n):"after"==s&&(l=a.insertAfter(l,n)),e(l)),t)},destroy:function(){this._draggable.destroy()}},m.plugin(d)})(window.kendo.jQuery);(function(e,t){function n(e){return g.test(e)}function i(e){return m.test(e)||/^\d+$/.test(e)}function r(e){return!n(e)&&!i(e)}function o(e,n){return function(i,r){var o,a=this.element.find(i).data(D);return 1==arguments.length?a[e]:(a[e]=r,n&&(o=this.element.data("kendo"+this.options.name),o.resize(!0)),t)}}function a(e){var t=this,n=e.orientation;t.owner=e,t._element=e.element,t.orientation=n,p(t,n===C?l:s),t._resizable=new d.ui.Resizable(e.element,{orientation:n,handle:".k-splitbar-draggable-"+n+"[data-marker="+e._marker+"]",hint:f(t._createHint,t),start:f(t._start,t),max:f(t._max,t),min:f(t._min,t),invalidClass:"k-restricted-size-"+n,resizeend:f(t._stop,t)})}var s,l,d=window.kendo,c=d.ui,u=d.keys,p=e.extend,f=e.proxy,h=c.Widget,m=/^\d+(\.\d+)?px$/i,g=/^\d+(\.\d+)?%$/i,v=".kendoSplitter",_="expand",k="collapse",b="contentLoad",w="error",y="resize",x="layoutChange",C="horizontal",T="vertical",S="mouseenter",F="click",D="pane",E="mouseleave",A="k-state-focused",H="k-"+D,I="."+H,z=h.extend({init:function(e,t){var n,i=this;h.fn.init.call(i,e,t),i.wrapper=i.element,n=i.options.orientation.toLowerCase()!=T,i.orientation=n?C:T,i._dimension=n?"width":"height",i._keys={decrease:n?u.LEFT:u.UP,increase:n?u.RIGHT:u.DOWN},i._resizeStep=10,i._marker=d.guid().substring(0,8),i._resizeHandler=f(i.resize,i),i._initPanes(),i.resizing=new a(i),i.element.triggerHandler("init"+v)},events:[_,k,b,w,y,x],_attachEvents:function(){var t=this,n=t.options.orientation;t.element.children(".k-splitbar-draggable-"+n).on("keydown"+v,e.proxy(t._keydown,t)).on("mousedown"+v,function(e){e.currentTarget.focus()}).on("focus"+v,function(t){e(t.currentTarget).addClass(A)}).on("blur"+v,function(n){e(n.currentTarget).removeClass(A),t.resizing&&t.resizing.end()}).on(S+v,function(){e(this).addClass("k-splitbar-"+t.orientation+"-hover")}).on(E+v,function(){e(this).removeClass("k-splitbar-"+t.orientation+"-hover")}).on("mousedown"+v,function(){t._panes().append("<div class='k-splitter-overlay k-overlay' />")}).on("mouseup"+v,function(){t._panes().children(".k-splitter-overlay").remove()}).end().children(".k-splitbar").on("dblclick"+v,f(t._togglePane,t)).children(".k-collapse-next, .k-collapse-prev").on(F+v,t._arrowClick(k)).end().children(".k-expand-next, .k-expand-prev").on(F+v,t._arrowClick(_)).end().end(),e(window).on("resize",t._resizeHandler)},_detachEvents:function(){var t=this;t.element.children(".k-splitbar-draggable-"+t.orientation).off(v).end().children(".k-splitbar").off("dblclick"+v).children(".k-collapse-next, .k-collapse-prev, .k-expand-next, .k-expand-prev").off(v),e(window).off("resize",t._resizeHandler)},options:{name:"Splitter",orientation:C,panes:[]},destroy:function(){h.fn.destroy.call(this),this._detachEvents(),this.resizing&&this.resizing.destroy(),d.destroy(this.element),this.wrapper=this.element=null},_keydown:function(t){var n,i=this,r=t.keyCode,o=i.resizing,a=e(t.currentTarget),s=i._keys,l=r===s.increase,d=r===s.decrease;l||d?(t.ctrlKey?(n=a[d?"next":"prev"](),o&&o.isResizing()&&o.end(),n[i._dimension]()?i._triggerAction(k,a[d?"prev":"next"]()):i._triggerAction(_,n)):o&&o.move((d?-1:1)*i._resizeStep,a),t.preventDefault()):r===u.ENTER&&o&&(o.end(),t.preventDefault())},_initPanes:function(){var e=this.options.panes||[],t=this;this.element.addClass("k-widget").addClass("k-splitter").children().each(function(n,i){"script"!=i.nodeName.toLowerCase()&&t._initPane(i,e[n])}),this.resize()},_initPane:function(t,n){t=e(t).attr("role","group").addClass(H),t.data(D,n?n:{}).toggleClass("k-scrollable",n?n.scrollable!==!1:!0),this.ajaxRequest(t)},ajaxRequest:function(e,t,n){var i,r=this;e=r.element.find(e),i=e.data(D),t=t||i.contentUrl,t&&(e.append("<span class='k-icon k-loading k-pane-loading' />"),d.isLocalUrl(t)?jQuery.ajax({url:t,data:n||{},type:"GET",dataType:"html",success:function(t){e.html(t),r.trigger(b,{pane:e[0]})},error:function(t,n){r.trigger(w,{pane:e[0],status:n,xhr:t})}}):e.removeClass("k-scrollable").html("<iframe src='"+t+"' frameborder='0' class='k-content-frame'>This page requires frames in order to show content</iframe>"))},_triggerAction:function(e,t){this.trigger(e,{pane:t[0]})||this[e](t[0])},_togglePane:function(t){var n,i=this,r=e(t.target);r.closest(".k-splitter")[0]==i.element[0]&&(n=r.children(".k-icon:not(.k-resize-handle)"),1===n.length&&(n.is(".k-collapse-prev")?i._triggerAction(k,r.prev()):n.is(".k-collapse-next")?i._triggerAction(k,r.next()):n.is(".k-expand-prev")?i._triggerAction(_,r.prev()):n.is(".k-expand-next")&&i._triggerAction(_,r.next())))},_arrowClick:function(t){var n=this;return function(i){var r,o=e(i.target);o.closest(".k-splitter")[0]==n.element[0]&&(r=o.is(".k-"+t+"-prev")?o.parent().prev():o.parent().next(),n._triggerAction(t,r))}},_updateSplitBar:function(e,t,n){var i=function(e,t){return t?"<div class='k-icon "+e+"' />":""},r=this.orientation,o=t.resizable!==!1&&n.resizable!==!1,a=t.collapsible,s=t.collapsed,l=n.collapsible,d=n.collapsed;e.addClass("k-splitbar k-state-default k-splitbar-"+r).attr("role","separator").attr("aria-expanded",!(s||d)).removeClass("k-splitbar-"+r+"-hover").toggleClass("k-splitbar-draggable-"+r,o&&!s&&!d).toggleClass("k-splitbar-static-"+r,!o&&!a&&!l).html(i("k-collapse-prev",a&&!s&&!d)+i("k-expand-prev",a&&s&&!d)+i("k-resize-handle",o)+i("k-collapse-next",l&&!d&&!s)+i("k-expand-next",l&&d&&!s))},_updateSplitBars:function(){var t=this;this.element.children(".k-splitbar").each(function(){var n=e(this),i=n.prevAll(I).first().data(D),r=n.nextAll(I).first().data(D);r&&t._updateSplitBar(n,i,r)})},_removeSplitBars:function(){this.element.children(".k-splitbar").remove()},_panes:function(){return this.element.children(I)},_resize:function(){var i,o,a,s,l,c,u,p,f,h,m=this,g=m.element,v=g.children(I),_=m.orientation==C,k=g.children(".k-splitbar"),b=k.length,w=_?"width":"height",y=g[w]();0===b?(b=v.length-1,v.slice(0,b).after("<div tabindex='0' class='k-splitbar' data-marker='"+m._marker+"' />"),m._updateSplitBars(),k=g.children(".k-splitbar")):m._updateSplitBars(),k.each(function(){y-=this[_?"offsetWidth":"offsetHeight"]}),i=0,o=0,a=e(),v.css({position:"absolute",top:0})[w](function(){var s,l=e(this).data(D)||{};if(l.collapsed)s=0,e(this).css("overflow","hidden");else{if(r(l.size))return a=a.add(this),t;s=parseInt(l.size,10),n(l.size)&&(s=Math.floor(s*y/100))}return o++,i+=s,s}),y-=i,s=a.length,l=Math.floor(y/s),a.slice(0,s-1).css(w,l).end().eq(s-1).css(w,y-(s-1)*l),c=0,u=_?"height":"width",p=_?"left":"top",f=_?"offsetWidth":"offsetHeight",0===s&&(h=v.filter(function(){return!(e(this).data(D)||{}).collapsed}).last(),h[w](y+h[0][f])),g.children().css(u,g[u]()).each(function(e,t){"script"!=t.tagName.toLowerCase()&&(t.style[p]=Math.floor(c)+"px",c+=t[f])}),m._detachEvents(),m._attachEvents(),d.resize(v),m.trigger(x)},toggle:function(e,n){var i,r=this;e=r.element.find(e),i=e.data(D),(n||i.collapsible)&&(1==arguments.length&&(n=i.collapsed===t?!1:i.collapsed),i.collapsed=!n,i.collapsed?e.css("overflow","hidden"):e.css("overflow",""),r.resize(!0))},collapse:function(e){this.toggle(e,!1)},expand:function(e){this.toggle(e,!0)},_addPane:function(e,t,n){var i=this;return n.length&&(i.options.panes.splice(t,0,e),i._initPane(n,e),i._removeSplitBars(),i.resize(!0)),n},append:function(t){t=t||{};var n=this,i=e("<div />").appendTo(n.element);return n._addPane(t,n.options.panes.length,i)},insertBefore:function(t,n){n=e(n),t=t||{};var i=this,r=i.wrapper.children(".k-pane").index(n),o=e("<div />").insertBefore(e(n));return i._addPane(t,r,o)},insertAfter:function(t,n){n=e(n),t=t||{};var i=this,r=i.wrapper.children(".k-pane").index(n),o=e("<div />").insertAfter(e(n));return i._addPane(t,r+1,o)},remove:function(t){t=e(t);var n=this;return t.length&&(d.destroy(t),t.each(function(t,i){n.options.panes.splice(n.wrapper.children(".k-pane").index(i),1),e(i).remove()}),n._removeSplitBars(),n.options.panes.length&&n.resize(!0)),n},size:o("size",!0),min:o("min"),max:o("max")});c.plugin(z),s={sizingProperty:"height",sizingDomProperty:"offsetHeight",alternateSizingProperty:"width",positioningProperty:"top",mousePositioningProperty:"pageY"},l={sizingProperty:"width",sizingDomProperty:"offsetWidth",alternateSizingProperty:"height",positioningProperty:"left",mousePositioningProperty:"pageX"},a.prototype={press:function(e){this._resizable.press(e)},move:function(e,t){this.pressed||(this.press(t),this.pressed=!0),this._resizable.target||this._resizable.press(t),this._resizable.move(e)},end:function(){this._resizable.end(),this.pressed=!1},destroy:function(){this._resizable.destroy(),this._resizable=this._element=this.owner=null},isResizing:function(){return this._resizable.resizing},_createHint:function(t){var n=this;return e("<div class='k-ghost-splitbar k-ghost-splitbar-"+n.orientation+" k-state-default' />").css(n.alternateSizingProperty,t[n.alternateSizingProperty]())
},_start:function(t){var n=this,r=e(t.currentTarget),o=r.prev(),a=r.next(),s=o.data(D),l=a.data(D),d=parseInt(o[0].style[n.positioningProperty],10),c=parseInt(a[0].style[n.positioningProperty],10)+a[0][n.sizingDomProperty]-r[0][n.sizingDomProperty],u=parseInt(n._element.css(n.sizingProperty),10),p=function(e){var t=parseInt(e,10);return(i(e)?t:u*t/100)||0},f=p(s.min),h=p(s.max)||c-d,m=p(l.min),g=p(l.max)||c-d;n.previousPane=o,n.nextPane=a,n._maxPosition=Math.min(c-m,d+h),n._minPosition=Math.max(d+f,c-g)},_max:function(){return this._maxPosition},_min:function(){return this._minPosition},_stop:function(t){var n,i,o,a,s,l,c,u,p=this,f=e(t.currentTarget),h=p.owner;return h._panes().children(".k-splitter-overlay").remove(),t.keyCode!==d.keys.ESC&&(n=t.position,i=f.prev(),o=f.next(),a=i.data(D),s=o.data(D),l=n-parseInt(i[0].style[p.positioningProperty],10),c=parseInt(o[0].style[p.positioningProperty],10)+o[0][p.sizingDomProperty]-n-f[0][p.sizingDomProperty],u=p._element.children(I).filter(function(){return r(e(this).data(D).size)}).length,(!r(a.size)||u>1)&&(r(a.size)&&u--,a.size=l+"px"),(!r(s.size)||u>1)&&(s.size=c+"px"),h.resize(!0)),!1}}})(window.kendo.jQuery);(function(e){function t(e,t){function n(e,r){var o,a;if(r=r[t])for(o=i[e]=i[e]||[],a=0;r.length>a;a++)o.push(r[a]),n(e+1,r[a])}var i=[];return n(0,e),i}function n(){return H.support.cssBorderSpacing?"":'cellspacing="0"'}function i(t,i){return t.length?"<table "+n()+' class="'+e.trim("k-scheduler-table "+(i||""))+'"><tr>'+t.join("</tr><tr>")+"</tr></table>":""}function r(e,t){return e.length?"<div style='position:relative'>"+i(e,t)+"</div>":""}function o(t,n,r){var o,a=[];if(r>0)for(o=0;t>o;o++)a.push("<th></th>");return n&&a.push('<th class="k-scheduler-times-all-day">'+n.text+"</th>"),1>r?e():e('<div class="k-scheduler-times">'+i(a)+"</div>")}function a(t,n,o){var a,s,l,d,c,u,p,f,h,m=[];for(s=0;t.length>s;s++){for(l=t[s],d=[],c=n/l.length,a=0;l.length>a;a++)d.push('<th colspan="'+c+'" class="'+(l[a].className||"")+'">'+l[a].text+"</th>");m.push(d.join(""))}if(u=[],o){for(p=t[t.length-1],f=[],h=o.cellContent,a=0;p.length>a;a++)f.push('<td class="'+(p[a].className||"")+'">'+(h?h(a):"&nbsp;")+"</th>");u.push(f.join(""))}return e('<div class="k-scheduler-header k-state-default"><div class="k-scheduler-header-wrap">'+i(m)+r(u,"k-scheduler-header-all-day")+"</div></div>")}function s(t,n){var r,o,a,s,l,d=Array(n).join().split(","),c=[];for(o=0;t.length>o;o++)for(a=t[o],s=n/a.length,r=0;a.length>r;r++)l=a[r].className||"",a[r].allDay&&(l="k-scheduler-times-all-day"),d[s*r]+='<th class="'+l+'" rowspan="'+s+'">'+a[r].text+"</th>";for(r=0;n>r;r++)c.push(d[r]);return 1>n?e():e('<div class="k-scheduler-times">'+i(c)+"</div>")}function l(){return e('<div class="k-scheduler-content"><table '+n()+' class="k-scheduler-table"/></div>')}function d(){return F=F?F:H.support.scrollbar()}function c(e,t,n){var i,r,o,a,s;for(i=e.length-1;i>=0;i--)r=u(e[i]),o=r.start,s=r.end,a=t>=o&&s>=t,(a||o>=t&&n>=s||o>=t&&n>=o)&&(t>o&&(t=o),s>n&&(n=s));return p(e,t,n)}function u(e){return{start:e.start,end:e.end}}function p(e,t,n){var i,r,o=[];for(i=0;e.length>i;i++)r=u(e[i]),(t>r.start&&r.end>t||r.start>=t&&n>=r.end)&&o.push(e[i]);return o}function f(e){return m(e)}function h(e){return m(e)}function m(e){var t,n,i,r,o,a,s,l=[];for(t=0;e.length>t;t++){for(n=e[t],i=u(n),r=null,o=0,a=l.length;a>o;o++)if(s=i.start>l[o].end,l[o].start>i.start||s){r=l[o],i.end>r.end&&(r.end=i.end);break}r||(r={start:i.start,end:i.end,events:[]},l.push(r)),r.events.push(n)}return l}function g(e,t,n){var i,r,o,a,s=t[0];if(s){for(i=[],r=s.dataSource.view(),o=0;r.length>o;o++)a={text:H.getter(s.dataTextField)(r[o]),className:"k-slot-cell"},a[e]=g(e,t.slice(1),n),i.push(a);return i}return n}function v(t){return function(n){if(e.isArray(n)||n instanceof H.data.ObservableArray){for(var i=0;n.length>i;i++)if(n[i]==t)return!0;return!1}return n==t}}function _(e){e.className=e.className.replace(E,"")+" k-state-selected"}var k,b,w,y,C,x,T,S,F,D,E,H=window.kendo,A=H.ui,I=A.Widget,z=H.keys,R=".kendoSchedulerView",N=Math,M='<div class="k-marquee k-scheduler-marquee"><div class="k-marquee-color"></div><div class="k-marquee-text"><div class="k-label-top"></div><div class="k-label-bottom"></div></div></div>';H.ui.scheduler={},k=H.Class.extend({init:function(e){this._index=e,this._timeSlotCollections=[],this._daySlotCollections=[]},addTimeSlotCollection:function(e,t){return this._addCollection(e,t,this._timeSlotCollections)},addDaySlotCollection:function(e,t){return this._addCollection(e,t,this._daySlotCollections)},_addCollection:function(e,t,n){var i=new C(e,t,this._index,n.length);return n.push(i),i},timeSlotCollectionCount:function(){return this._timeSlotCollections.length},daySlotCollectionCount:function(){return this._daySlotCollections.length},daySlotByPosition:function(e,t){return this._slotByPosition(e,t,this._daySlotCollections)},timeSlotByPosition:function(e,t){return this._slotByPosition(e,t,this._timeSlotCollections)},_slotByPosition:function(e,t,n){var i,r,o,a;for(i=0;n.length>i;i++)for(r=n[i],o=0;o<r.count();o++)if(a=r.at(o),e>=a.offsetLeft&&a.offsetLeft+a.clientWidth>e&&t>=a.offsetTop&&a.offsetTop+a.clientHeight>=t)return a},refresh:function(){var e;for(e=0;this._daySlotCollections.length>e;e++)this._daySlotCollections[e].refresh();for(e=0;this._timeSlotCollections.length>e;e++)this._timeSlotCollections[e].refresh()},timeSlotRanges:function(e,t){var n,i=this._timeSlotCollections,r=this._startSlot(e,i);return!r.inRange&&e>=r.slot.end&&(r=null),n=r,t>e&&(n=this._endSlot(t,i)),n&&!n.inRange&&n.slot.start>=t&&(n=null),null===r&&null===n?[]:(null===r&&(r={inRange:!0,slot:i[n.slot.collectionIndex].first()}),null===n&&(n={inRange:!0,slot:i[r.slot.collectionIndex].last()}),this._continuousRange(w,i,r,n))},daySlotRanges:function(e,t,n){var i,r=this._daySlotCollections,o=this._startSlot(e,r,n);if(!o.inRange&&e>=o.slot.end&&(o=null),i=o,t>e&&(i=this._endSlot(t,r,n)),i&&!i.inRange&&i.slot.start>=t&&(i=null),null===o&&null===i)return[];if(null===o)do e+=H.date.MS_PER_DAY,o=this._startSlot(e,r,n);while(!o.inRange&&e>=o.slot.end);if(null===i)do t-=H.date.MS_PER_DAY,i=this._endSlot(t,r,n);while(!i.inRange&&i.slot.start>=t);return this._continuousRange(y,r,o,i)},_continuousRange:function(e,t,n,i){var r,o,a,s,l,d,c=n.slot,u=i.slot,p=c.collectionIndex,f=u.collectionIndex,h=[];for(r=p;f>=r;r++)o=t[r],a=o.first(),s=o.last(),l=!1,d=!1,r==p&&(d=!n.inRange),r==f&&(l=!i.inRange),c.start>a.start&&(a=c),s.start>u.start&&(s=u),f>p&&(r==p?l=!0:r==f?d=!0:l=d=!0),h.push(new e({start:a,end:s,collection:o,head:l,tail:d}));return h},slotRanges:function(e,t){var n=e.startTime||H.date.toUtcTime(e.start),i=e.endTime||H.date.toUtcTime(e.end);return void 0===t&&(t=e.isMultiDay()),t?this.daySlotRanges(n,i,e.isAllDay):this.timeSlotRanges(n,i)},ranges:function(e,t,n,i){return"number"!=typeof e&&(e=H.date.toUtcTime(e)),"number"!=typeof t&&(t=H.date.toUtcTime(t)),n?this.daySlotRanges(e,t,i):this.timeSlotRanges(e,t)},_startCollection:function(e,t){var n,i;for(n=0;t.length>n;n++)if(i=t[n],i.startInRange(e))return i;return null},_endCollection:function(e,t,n){var i,r;for(i=0;t.length>i;i++)if(r=t[i],r.endInRange(e,n))return r;return null},_getCollections:function(e){return e?this._daySlotCollections:this._timeSlotCollections},continuousSlot:function(e,t){var n=t?-1:1,i=this._getCollections(e.isDaySlot),r=i[e.collectionIndex+n];return r?r[t?"last":"first"]():void 0},firstSlot:function(){var e=this._getCollections(this.daySlotCollectionCount());return e[0].first()},lastSlot:function(){var e=this._getCollections(this.daySlotCollectionCount());return e[e.length-1].last()},upSlot:function(e,t){var n=this,i=function(e,i,r){var o=0===r;return!t&&!e&&o&&n.daySlotCollectionCount()?n._daySlotCollections[0].at(i):void 0};return this.timeSlotCollectionCount()||(t=!0),this._verticalSlot(e,-1,i)},downSlot:function(e,t){var n=this,i=function(e,i,r){return!t&&e&&n.timeSlotCollectionCount()?n._timeSlotCollections[r].at(0):void 0};return this.timeSlotCollectionCount()||(t=!0),this._verticalSlot(e,1,i)},leftSlot:function(e){return this._horizontalSlot(e,-1)},rightSlot:function(e){return this._horizontalSlot(e,1)},_horizontalSlot:function(e,t){var n,i=e.index,r=e.isDaySlot,o=e.collectionIndex,a=this._getCollections(r);return r?i+=t:o+=t,n=a[o],n?n.at(i):void 0},_verticalSlot:function(e,t,n){var i,r=e.index,o=e.isDaySlot,a=e.collectionIndex,s=this._getCollections(o);return(e=n(o,a,r))?e:(o?a+=t:r+=t,i=s[a],i?i.at(r):void 0)},_collection:function(e,t){var n=t?this._daySlotCollections:this._timeSlotCollections;return n[e]},_startSlot:function(e,t,n){var i,r=this._startCollection(e,t),o=!0;return r||(r=t[0],o=!1),i=r.slotByStartDate(e,n),i||(i=r.first(),o=!1),{slot:i,inRange:o}},_endSlot:function(e,t,n){var i,r=this._endCollection(e,t,n),o=!0;return r||(r=t[t.length-1],o=!1),i=r.slotByEndDate(e,n),i||(i=r.last(),o=!1),{slot:i,inRange:o}},getSlotCollection:function(e,t){return this[t?"getDaySlotCollection":"getTimeSlotCollection"](e)},getTimeSlotCollection:function(e){return this._timeSlotCollections[e]},getDaySlotCollection:function(e){return this._daySlotCollections[e]}}),b=H.Class.extend({init:function(t){e.extend(this,t)},innerHeight:function(){var e,t=this.collection,n=this.start.index,i=this.end.index,r=0;for(e=n;i>=e;e++)r+=t.at(e).offsetHeight;return r},events:function(){return this.collection.events()},addEvent:function(e){this.events().push(e)},startSlot:function(){return this.start.offsetLeft>this.end.offsetLeft?this.end:this.start},endSlot:function(){return this.start.offsetLeft>this.end.offsetLeft?this.start:this.end}}),w=b.extend({innerHeight:function(){var e,t=this.collection,n=this.start.index,i=this.end.index,r=0;for(e=n;i>=e;e++)r+=t.at(e).offsetHeight;return r},outerRect:function(e,t,n){return this._rect("offset",e,t,n)},_rect:function(e,t,n,i){var r,o,a,s,l,d,c=this.start,u=this.end;return"number"!=typeof t&&(t=H.date.toUtcTime(t)),"number"!=typeof n&&(n=H.date.toUtcTime(n)),i?(r=c.offsetTop,o=u.offsetTop+u[e+"Height"]):(a=t-c.start,0>a&&(a=0),s=c.end-c.start,r=c.offsetTop+c[e+"Height"]*a/s,l=u.end-n,0>l&&(l=0),d=u.end-u.start,o=u.offsetTop+u[e+"Height"]-u[e+"Height"]*l/d),{top:r,bottom:o}},innerRect:function(e,t,n){return this._rect("client",e,t,n)}}),y=b.extend({innerWidth:function(){var e,t=this.collection,n=this.start.index,i=this.end.index,r=0,o=n!==i?"offsetWidth":"clientWidth";for(e=n;i>=e;e++)r+=t.at(e)[o];return r}}),C=H.Class.extend({init:function(e,t,n,i){this._slots=[],this._events=[],this._start=H.date.toUtcTime(e),this._end=H.date.toUtcTime(t),this._groupIndex=n,this._collectionIndex=i},refresh:function(){for(var e=0;this._slots.length>e;e++)this._slots[e].refresh()},startInRange:function(e){return e>=this._start&&this._end>e},endInRange:function(e,t){var n=t?this._end>e:this._end>=e;return e>=this._start&&n},slotByStartDate:function(e){var t,n,i=e;for("number"!=typeof i&&(i=H.date.toUtcTime(e)),t=0;this._slots.length>t;t++)if(n=this._slots[t],n.startInRange(i))return n;return null},slotByEndDate:function(e,t){var n,i,r=e;if("number"!=typeof r&&(r=H.date.toUtcTime(e)),t)return this.slotByStartDate(e,!1);for(n=0;this._slots.length>n;n++)if(i=this._slots[n],i.endInRange(r))return i;return null},count:function(){return this._slots.length},events:function(){return this._events},addTimeSlot:function(e,t,n){var i=new T(e,t,n,this._groupIndex,this._collectionIndex,this._slots.length);this._slots.push(i)},addDaySlot:function(e,t,n,i){var r=new S(e,t,n,this._groupIndex,this._collectionIndex,this._slots.length,i);this._slots.push(r)},first:function(){return this._slots[0]},last:function(){return this._slots[this._slots.length-1]},at:function(e){return this._slots[e]}}),x=H.Class.extend({init:function(e,t,n,i,r,o){this.element=e,this.clientWidth=e.clientWidth,this.clientHeight=e.clientHeight,this.offsetWidth=e.offsetWidth,this.offsetHeight=e.offsetHeight,this.offsetTop=e.offsetTop,this.offsetLeft=e.offsetLeft,this.start=t,this.end=n,this.element=e,this.groupIndex=i,this.collectionIndex=r,this.index=o,this.isDaySlot=!1},startDate:function(){return H.timezone.toLocalDate(this.start)},endDate:function(){return H.timezone.toLocalDate(this.end)},startInRange:function(e){return e>=this.start&&this.end>e},endInRange:function(e){return e>this.start&&this.end>=e},startOffset:function(){return this.start},endOffset:function(){return this.end}}),T=x.extend({refresh:function(){this.offsetTop=this.element.offsetTop},offsetX:function(e,t){return e?this.offsetLeft+t:this.offsetLeft+t},startInRange:function(e){return e>=this.start&&this.end>e},endInRange:function(e){return e>this.start&&this.end>=e},startOffset:function(t,n,i){var r,o,a,s;return i?this.start:(r=e(this.element).offset(),o=n-r.top,a=this.end-this.start,s=Math.floor(a*(o/this.offsetHeight)),this.start+s)},endOffset:function(t,n,i){var r,o,a,s;return i?this.end:(r=e(this.element).offset(),o=n-r.top,a=this.end-this.start,s=Math.floor(a*(o/this.offsetHeight)),this.start+s)}}),S=x.extend({init:function(e,t,n,i,r,o,a){x.fn.init.apply(this,arguments),this.eventCount=a,this.isDaySlot=!0,this.element.children.length?(this.firstChildHeight=this.element.children[0].offsetHeight+3,this.firstChildTop=this.element.children[0].offsetTop):(this.firstChildHeight=3,this.firstChildTop=0)},refresh:function(){this.clientHeight=this.element.clientHeight,this.offsetTop=this.element.offsetTop},startDate:function(){var e=new Date(this.start);return H.timezone.apply(e,"Etc/UTC")},endDate:function(){var e=new Date(this.end);return H.timezone.apply(e,"Etc/UTC")},startInRange:function(e){return e>=this.start&&this.end>e},endInRange:function(e){return e>this.start&&this.end>=e}}),H.ui.SchedulerView=I.extend({init:function(t,n){I.fn.init.call(this,t,n),this._scrollbar=d(),this._isRtl=H.support.isRtl(t),this._resizeHint=e(),this._moveHint=e(),this._cellId=H.guid(),this._resourcesForGroups(),this._selectedSlots=[]},_isMobile:function(){var e=this.options;return e.mobile===!0&&H.support.mobileOS||"phone"===e.mobile||"tablet"===e.mobile},_isMobilePhoneView:function(){var e=this.options;return e.mobile===!0&&H.support.mobileOS&&!H.support.mobileOS.tablet||"phone"===e.mobile},_addResourceView:function(){var e=new k(this.groups.length);return this.groups.push(e),e},dateForTitle:function(){return H.format(this.options.selectedDateFormat,this.startDate(),this.endDate())},_changeGroup:function(e,t){var n=t?"prevGroupSlot":"nextGroupSlot",i=this[n](e.start,e.groupIndex,e.isAllDay);return i&&(e.groupIndex+=t?-1:1),i},_changeGroupContinuously:function(){return null},_changeViewPeriod:function(){return!1},_horizontalSlots:function(e,t,n,i){var r,o,a=i?"leftSlot":"rightSlot",s=t[0].start,l=t[t.length-1].end,d=this.groups[e.groupIndex];return n||(r=this._normalizeHorizontalSelection(e,t,i),r&&(s=l=r)),s=d[a](s),l=d[a](l),n||this._isVerticallyGrouped()||s&&l||(s=l=this._changeGroup(e,i)),s&&l||(o=this._continuousSlot(e,t,i),o=this._changeGroupContinuously(e,o,n,i),o&&(s=l=o)),{startSlot:s,endSlot:l}},_verticalSlots:function(e,t,n,i){var r,o,a=t[0].start,s=t[t.length-1].end,l=this.groups[e.groupIndex];return n||(r=this._normalizeVerticalSelection(e,t,i),r&&(a=s=r)),o=i?"upSlot":"downSlot",a=l[o](a,n),s=l[o](s,n),n||!this._isVerticallyGrouped()||a&&s||(a=s=this._changeGroup(e,i)),{startSlot:a,endSlot:s}},_normalizeHorizontalSelection:function(){return null},_normalizeVerticalSelection:function(e,t,n){var i;return i=n?t[0].start:t[t.length-1].end},_continuousSlot:function(){return null},constrainSelection:function(e){var t,n=this.groups[0];this.inRange(e)?n.daySlotCollectionCount()||(e.isAllDay=!1):(t=n.firstSlot(),e.isAllDay=t.isDaySlot,e.start=t.startDate(),e.end=t.endDate()),this.groups[e.groupIndex]||(e.groupIndex=0)},move:function(e,t,n){var i,r,o,a,s,l,d=!1,c=this.groups[e.groupIndex];if(c.timeSlotCollectionCount()||(e.isAllDay=!0),i=c.ranges(e.start,e.end,e.isAllDay,!1),t===z.DOWN||t===z.UP){if(d=!0,a=t===z.UP,this._updateDirection(e,i,n,a,!0),s=this._verticalSlots(e,i,n,a),!s.startSlot&&!n&&this._changeViewPeriod(e,a,!0))return d}else if((t===z.LEFT||t===z.RIGHT)&&(d=!0,a=t===z.LEFT,this._updateDirection(e,i,n,a,!1),s=this._horizontalSlots(e,i,n,a),!s.startSlot&&!n&&this._changeViewPeriod(e,a,!1)))return d;return d&&(r=s.startSlot,o=s.endSlot,n?(l=e.backward,l&&r?e.start=r.startDate():!l&&o&&(e.end=o.endDate())):r&&o&&(e.isAllDay=r.isDaySlot,e.start=r.startDate(),e.end=o.endDate()),e.events=[]),d},moveToEventInGroup:function(t,n,i,r){for(var o,a,s=t._continuousEvents||[],l=r?-1:1,d=s.length,c=r?d-1:0;d>c&&c>-1;){if(a=s[c],(!r&&a.start.startDate()>=n.startDate()||r&&a.start.startDate()<=n.startDate())&&(i.length&&(a=s[c+l]),a&&-1===e.inArray(a.uid,i))){o=!!a;break}c+=l}return a},moveToEvent:function(e,t){for(var n,i=e.groupIndex,r=this.groups[i],o=r.ranges(e.start,e.end,e.isAllDay,!1)[0].start,a=this.groups.length,s=t?-1:1,l=e.events;a>i&&i>-1&&(n=this.moveToEventInGroup(r,o,l,t),i+=s,r=this.groups[i],r&&!n);)l=[],o=t?r.lastSlot():r.firstSlot(!0);return n&&(e.events=[n.uid],e.start=n.start.startDate(),e.end=n.end.endDate(),e.isAllDay=n.start.isDaySlot,e.groupIndex=n.start.groupIndex),!!n},current:function(e){return void 0===e?this._current:(this._current=e,this._scrollTo(e,this.content[0]),void 0)},select:function(e){this.clearSelection(),this._selectEvents(e)||this._selectSlots(e)},_selectSlots:function(e){var t,n,i,r,o,a,s,l=e.isAllDay,d=this.groups[e.groupIndex];for(d.timeSlotCollectionCount()||(l=!0),this._selectedSlots=[],t=d.ranges(e.start,e.end,l,!1),r=0;t.length>r;r++)for(o=t[r],a=o.collection,s=o.start.index;o.end.index>=s;s++)i=a.at(s),n=i.element,n.setAttribute("aria-selected",!0),_(n),this._selectedSlots.push({start:i.startDate(),end:i.endDate(),element:n});e.backward&&(n=t[0].start.element),this.current(n)},_selectEvents:function(t){var n,i,r=!1,o=t.events,a=this.groups[t.groupIndex]._continuousEvents||[],s=a.length;if(!o[0]||!a[0])return r;for(i=e(),n=0;s>n;n++)e.inArray(a[n].uid,o)>-1&&(i=i.add(a[n].element));return i[0]&&(i.addClass("k-state-selected").attr("aria-selected",!0),this.current(i.last()[0]),this._selectedSlots=[],r=!0),r},inRange:function(e){var t=this.startDate(),n=H.date.addDays(this.endDate(),1),i=e.start,r=e.end;return i>=t&&n>i&&r>t&&n>=r},_resourceValue:function(e,t){return e.valuePrimitive&&(t=H.getter(e.dataValueField)(t)),t},_resourceBySlot:function(e){var t,n,i,r,o,a=this.groupedResources,s={};if(a.length)for(t=e.groupIndex,n=a.length-1;n>=0;n--)i=a[n],r=this._resourceValue(i,i.dataSource.view()[t%i.dataSource.total()]),i.multiple&&(r=[r]),o=H.setter(i.field),o(s,r),t=Math.floor(t/i.dataSource.total());return s},_createResizeHint:function(t,n,i,r){return e(M).css({left:t,top:n,width:i,height:r})},_removeResizeHint:function(){this._resizeHint.remove(),this._resizeHint=e()},_removeMoveHint:function(){this._moveHint.remove(),this._moveHint=e()},_scrollTo:function(e,t){var n=e.offsetTop,i=e.offsetHeight,r=t.scrollTop,o=t.clientHeight,a=n+i,s=0;s=r>n?n:a>r+o?o>=i?a-o:n:r,t.scrollTop=s},_shouldInverseResourceColor:function(e){var t=new D(e.color).isDark(),n=this.element.css("color"),i=new D(n).isDark();return t==i},eventResources:function(e){var t,n,i,r,o,a,s,l,d,c,u=[],p=this.options;if(!p.resources)return u;for(t=0;p.resources.length>t;t++)if(n=p.resources[t],i=n.field,r=H.getter(i)(e))for(n.multiple||(r=[r]),o=n.dataSource.view(),a=0;r.length>a;a++){for(s=null,l=r[a],n.valuePrimitive||(l=H.getter(n.dataValueField)(l)),d=0;o.length>d;d++)if(o[d].get(n.dataValueField)==l){s=o[d];break}null!==s&&(c=H.getter(n.dataColorField)(s),u.push({field:n.field,title:n.title,name:n.name,text:H.getter(n.dataTextField)(s),value:l,color:c}))}return u},createLayout:function(i){var r,o,a,s,l,d=-1;for(i.rows||(i.rows=[]),r=0;i.rows.length>r;r++)if(i.rows[r].allDay){d=r;break}o=i.rows[d],d>=0&&i.rows.splice(d,1),a=this.columnLevels=t(i,"columns"),s=this.rowLevels=t(i,"rows"),this.table=e("<table "+n()+' class="k-scheduler-layout k-scheduler-'+this.name+'view"/>'),l=s[s.length-1].length,this.table.append(this._topSection(a,o,l)),this.table.append(this._bottomSection(a,s,l)),this.element.append(this.table),this._scroller()},refreshLayout:function(){var t,n,i,r,o,a,s=this,l=s.element.find(">.k-scheduler-toolbar"),d=s.element.innerHeight(),c=this._scrollbar,u=0,p=this._isRtl?"left":"right";for(t=0;l.length>t;t++)d-=l.eq(t).outerHeight();s.datesHeader&&(u=s.datesHeader.outerHeight()),s.timesHeader&&s.timesHeader.outerHeight()>u&&(u=s.timesHeader.outerHeight()),s.datesHeader&&s.timesHeader&&(n=s.datesHeader.find("table:first tr"),s.timesHeader.find("tr").height(function(t){e(this).height(n.eq(t).height())})),u&&(d-=u),s.footer&&(d-=s.footer.outerHeight()),i=function(e){var t,n;return e[0].style.height?!0:(t=e.height(),e.height("auto"),n=e.height(),t!=n?(e.height(""),!0):(e.height(""),!1))},r=s.content[0],o=H.support.kineticScrollNeeded?0:c,i(s.element)&&(d>2*c?s.content.height(d):s.content.height(2*c+1),s.times.height(r.clientHeight),a=s.times.find("table"),a.length&&a.height(s.content.find("table")[0].clientHeight)),r.offsetWidth-r.clientWidth>0?(s.table.addClass("k-scrollbar-v"),s.datesHeader.css("padding-"+p,o-parseInt(s.datesHeader.children().css("border-"+p+"-width"),10))):s.datesHeader.css("padding-"+p,""),r.offsetHeight-r.clientHeight>0||r.clientHeight>s.content.children(".k-scheduler-table").height()?s.table.addClass("k-scrollbar-h"):s.table.removeClass("k-scrollbar-h")},_topSection:function(t,n,i){this.timesHeader=o(t.length,n,i);var r=t[t.length-1].length;return this.datesHeader=a(t,r,n),e("<tr>").append(this.timesHeader.add(this.datesHeader).wrap("<td>").parent())},_bottomSection:function(t,n,i){return this.times=s(n,i),this.content=l(t[t.length-1],n[n.length-1]),e("<tr>").append(this.times.add(this.content).wrap("<td>").parent())},_scroller:function(){var t,n=this;this.content.bind("scroll"+R,function(){n.datesHeader.find(">.k-scheduler-header-wrap").scrollLeft(this.scrollLeft),n.times.scrollTop(this.scrollTop)}),t=H.touchScroller(this.content,{avoidScrolling:function(t){return e(t.event.target).closest(".k-event.k-event-active").length>0}}),t&&t.movable&&(this._touchScroller=t,this.content=t.scrollElement,t.movable.bind("change",function(e){n.datesHeader.find(">.k-scheduler-header-wrap").scrollLeft(-e.sender.x),n.times.scrollTop(-e.sender.y)}))},_resourcesForGroups:function(){var e,t,n,i,r=[],o=this.options.group,a=this.options.resources;if(o=o&&o.resources?o.resources:[],a&&o.length)for(e=0,t=a.length;t>e;e++)for(n=0,i=o.length;i>n;n++)a[e].name===o[n]&&r.push(a[e]);this.groupedResources=r},_createColumnsLayout:function(e,t){return g("columns",e,t)},_groupOrientation:function(){var e=this.options.group;return e&&e.resources?e.orientation:"horizontal"},_isVerticallyGrouped:function(){return this.groupedResources.length&&"vertical"===this._groupOrientation()},_createRowsLayout:function(e,t){return g("rows",e,t)},selectionByElement:function(){return null},clearSelection:function(){this.content.find(".k-state-selected").removeAttr("id").attr("aria-selected",!1).removeClass("k-state-selected")},destroy:function(){var e=this;I.fn.destroy.call(this),e.table&&(H.destroy(e.table),e.table.remove()),e.groups=null,e.table=null,e.content=null,e.times=null,e.datesHeader=null,e.timesHeader=null,e.footer=null,e._resizeHint=null,e._moveHint=null},calendarInfo:function(){return H.getCulture().calendars.standard},prevGroupSlot:function(e,t,n){var i,r=this.groups[t],o=r.ranges(e,e,n,!1)[0].start;if(!(0>=t))return this._isVerticallyGrouped()?r.timeSlotCollectionCount()?(i=r._collection(n?o.index:o.collectionIndex,!1),i.last()):(i=r._collection(r.daySlotCollectionCount()-1,!0),i.at(o.index)):r.timeSlotCollectionCount()?(i=r._collection(n?0:r.timeSlotCollectionCount()-1,n),n?i.last():i.at(o.index)):(i=r._collection(o.collectionIndex,!0),i.last())},nextGroupSlot:function(e,t,n){var i,r,o=this.groups[t],a=o.ranges(e,e,n,!1)[0].start;if(!(t>=this.groups.length-1))return this._isVerticallyGrouped()?o.timeSlotCollectionCount()?(r=o.daySlotCollectionCount(),i=o._collection(r?0:a.collectionIndex,r),n?i.first():i.at(a.collectionIndex)):(i=o._collection(0,!0),i.at(a.index)):o.timeSlotCollectionCount()?(i=o._collection(0,n),n?i.first():i.at(a.index)):(i=o._collection(a.collectionIndex,!0),i.first())}}),D=function(e){var t,n,i,r,o,a=this,s=D.formats;if(1===arguments.length)for(e=a.resolveColor(e),r=0;s.length>r;r++)t=s[r].re,n=s[r].process,i=t.exec(e),i&&(o=n(i),a.r=o[0],a.g=o[1],a.b=o[2]);else a.r=arguments[0],a.g=arguments[1],a.b=arguments[2];a.r=a.normalizeByte(a.r),a.g=a.normalizeByte(a.g),a.b=a.normalizeByte(a.b)},D.prototype={resolveColor:function(e){return e=e||"#000","#"==e.charAt(0)&&(e=e.substr(1,6)),e=e.replace(/ /g,""),e=e.toLowerCase(),e=D.namedColors[e]||e},normalizeByte:function(e){return 0>e||isNaN(e)?0:e>255?255:e},percBrightness:function(){var e=this;return N.sqrt(.241*e.r*e.r+.691*e.g*e.g+.068*e.b*e.b)},isDark:function(){var e=this,t=e.percBrightness();return 180>t}},D.formats=[{re:/^rgb\((\d{1,3}),\s*(\d{1,3}),\s*(\d{1,3})\)$/,process:function(e){return[parseInt(e[1],10),parseInt(e[2],10),parseInt(e[3],10)]}},{re:/^(\w{2})(\w{2})(\w{2})$/,process:function(e){return[parseInt(e[1],16),parseInt(e[2],16),parseInt(e[3],16)]}},{re:/^(\w{1})(\w{1})(\w{1})$/,process:function(e){return[parseInt(e[1]+e[1],16),parseInt(e[2]+e[2],16),parseInt(e[3]+e[3],16)]}}],D.namedColors={aqua:"00ffff",azure:"f0ffff",beige:"f5f5dc",black:"000000",blue:"0000ff",brown:"a52a2a",coral:"ff7f50",cyan:"00ffff",darkblue:"00008b",darkcyan:"008b8b",darkgray:"a9a9a9",darkgreen:"006400",darkorange:"ff8c00",darkred:"8b0000",dimgray:"696969",fuchsia:"ff00ff",gold:"ffd700",goldenrod:"daa520",gray:"808080",green:"008000",greenyellow:"adff2f",indigo:"4b0082",ivory:"fffff0",khaki:"f0e68c",lightblue:"add8e6",lightgrey:"d3d3d3",lightgreen:"90ee90",lightpink:"ffb6c1",lightyellow:"ffffe0",lime:"00ff00",limegreen:"32cd32",linen:"faf0e6",magenta:"ff00ff",maroon:"800000",mediumblue:"0000cd",navy:"000080",olive:"808000",orange:"ffa500",orangered:"ff4500",orchid:"da70d6",pink:"ffc0cb",plum:"dda0dd",purple:"800080",red:"ff0000",royalblue:"4169e1",salmon:"fa8072",silver:"c0c0c0",skyblue:"87ceeb",slateblue:"6a5acd",slategray:"708090",snow:"fffafa",steelblue:"4682b4",tan:"d2b48c",teal:"008080",tomato:"ff6347",turquoise:"40e0d0",violet:"ee82ee",wheat:"f5deb3",white:"ffffff",whitesmoke:"f5f5f5",yellow:"ffff00",yellowgreen:"9acd32"},E=/\s*k-state-selected/,e.extend(A.SchedulerView,{createColumns:f,createRows:h,rangeIndex:u,collidingEvents:c,groupEqFilter:v})})(window.kendo.jQuery);(function(e,t){function n(e){var t=new Date(1980,1,1,0,0,0);return d(t,g(e)),t}function i(e,t,n){return e>=t&&n>=e}function r(e,t,n,i){return i=i?n>=e:n>e,e>t&&i}function o(e,t,n,i){var r,o=e._continuousEvents,a=o[o.length-1],l=f(t.start.startDate()).getTime();if(i&&a&&f(a.start.startDate()).getTime()==l){for(r=o.length-1;r>-1&&!(o[r].isAllDay||f(o[r].start.startDate()).getTime()<l);r--);o.splice(r+1,0,{element:n,isAllDay:!0,uid:n.attr(s.attr("uid")),start:t.start,end:t.end})}else o.push({element:n,isAllDay:i,uid:n.attr(s.attr("uid")),start:t.start,end:t.end})}function a(e){var t=[],n=e.workWeekStart;for(t.push(n);e.workWeekEnd!=n;)n>6?n-=7:n++,t.push(n);return t}var s=window.kendo,l=s.ui,d=s.date.setTime,c=l.SchedulerView,u=e.extend,p=e.proxy,f=s.date.getDate,h=s.date.MS_PER_MINUTE,m=s.date.MS_PER_DAY,g=s.date.getMilliseconds,v=".kendoMultiDayView",_=s.template('<div title="(#=kendo.format("{0:t} - {1:t}", start, end)#): #=title.replace(/"/g,"&\\#34;")#"><div class="k-event-template k-event-time">#:kendo.format("{0:t} - {1:t}", start, end)#</div><div class="k-event-template">${title}</div></div>'),k=s.template('<div title="(#=kendo.format("{0:t}", start)#): #=title.replace(/"/g,"&\\#34;")#"><div class="k-event-template">${title}</div></div>'),b=s.template("<span class='k-link k-nav-day'>#=kendo.toString(date, 'ddd M/dd')#</span>"),w='<div role="gridcell" aria-selected="false" data-#=ns#uid="#=uid#"#if (resources[0]) { #style="background-color:#=resources[0].color#; border-color: #=resources[0].color#"class="k-event#=inverseColor ? " k-event-inverse" : ""#" #} else {#class="k-event"#}#><span class="k-event-actions"># if(data.tail || data.middle) {#<span class="k-icon k-i-arrow-w"></span>#}## if(data.isException()) {#<span class="k-icon k-i-exception"></span># } else if(data.isRecurring()) {#<span class="k-icon k-i-refresh"></span># } #</span>{0}<span class="k-event-actions">#if (showDelete) {#<a href="\\#" class="k-link k-event-delete"><span class="k-icon k-si-close"></span></a>#}## if(data.head || data.middle) {#<span class="k-icon k-i-arrow-e"></span>#}#</span>#if(resizable && !singleDay && !data.tail && !data.middle){#<span class="k-resize-handle k-resize-w"></span>#}##if(resizable && !singleDay && !data.head && !data.middle){#<span class="k-resize-handle k-resize-e"></span>#}#</div>',y='<div role="gridcell" aria-selected="false" data-#=ns#uid="#=uid#" #if (resources[0]) { #style="background-color:#=resources[0].color #; border-color: #=resources[0].color#"class="k-event#=inverseColor ? " k-event-inverse" : ""#"#} else {#class="k-event"#}#><span class="k-event-actions"># if(data.isException()) {#<span class="k-icon k-i-exception"></span># } else if(data.isRecurring()) {#<span class="k-icon k-i-refresh"></span># } #</span>{0}<span class="k-event-actions">#if (showDelete) {#<a href="\\#" class="k-link k-event-delete"><span class="k-icon k-si-close"></span></a>#}#</span><span class="k-event-top-actions"># if(data.tail || data.middle) {#<span class="k-icon k-i-arrow-n"></span># } #</span><span class="k-event-bottom-actions"># if(data.head || data.middle) {#<span class="k-icon k-i-arrow-s"></span># } #</span># if(resizable && !data.tail && !data.middle) {#<span class="k-resize-handle k-resize-n"></span># } ## if(resizable && !data.head && !data.middle) {#<span class="k-resize-handle k-resize-s"></span># } #</div>',C=c.extend({init:function(e,t){var n=this;c.fn.init.call(n,e,t),n.title=n.options.title||n.options.name,n._workDays=a(n.options),n._templates(),n._editable(),n.calculateDateRange(),n._groups()},_updateResizeHint:function(e,t,n,i){var r,o,a,l,d,u,p,f,h,m,g=e.isMultiDay(),v=this.groups[t],_=v.ranges(n,i,g,e.isAllDay);for(this._removeResizeHint(),r=0;_.length>r;r++)o=_[r],a=o.startSlot(),l=a.offsetWidth,d=a.clientHeight,u=a.offsetTop,g?l=o.innerWidth():(p=o.outerRect(n,i,this.options.snap),u=p.top,d=p.bottom-p.top),f=c.fn._createResizeHint.call(this,a.offsetLeft,u,l,d),this._resizeHint=this._resizeHint.add(f);h="t",m=this.content,g&&(h="M/dd",m=this.element.find(".k-scheduler-header-wrap:has(.k-scheduler-header-all-day) > div"),m.length||(m=this.content)),this._resizeHint.appendTo(m),this._resizeHint.find(".k-label-top,.k-label-bottom").text(""),this._resizeHint.first().addClass("k-first").find(".k-label-top").text(s.toString(s.timezone.toLocalDate(n),h)),this._resizeHint.last().addClass("k-last").find(".k-label-bottom").text(s.toString(s.timezone.toLocalDate(i),h))},_updateMoveHint:function(e,t,n){var i,r,o,a,l,d,c,u=e.isMultiDay(),p=this.groups[t],f=s.date.toUtcTime(e.start)+n,h=f+e.duration(),m=p.ranges(f,h,u,e.isAllDay);for(f=s.timezone.toLocalDate(f),h=s.timezone.toLocalDate(h),this._removeMoveHint(),!u&&(0===g(h)||g(h)<g(this.startTime()))&&m.length>1&&m.pop(),i=0;m.length>i;i++)r=m[i],o=r.start,a=this._createEventElement(e.clone({start:f,end:h}),!u),a.addClass("k-event-drag-hint"),l={left:o.offsetLeft+2,top:o.offsetTop},this._isRtl&&(l.left=.1*o.clientWidth+o.offsetLeft+2),u?l.width=r.innerWidth()-4:(d=r.outerRect(f,h,this.options.snap),l.top=d.top,l.height=d.bottom-d.top,l.width=.9*o.clientWidth-4),a.css(l),this._moveHint=this._moveHint.add(a);c=this.content,u&&(c=this.element.find(".k-scheduler-header-wrap:has(.k-scheduler-header-all-day) > div"),c.length||(c=this.content)),this._moveHint.appendTo(c)},_slotByPosition:function(e,t){var n,i,r,o;for(this._isVerticallyGrouped()?(i=this.content.offset(),t+=this.content[0].scrollTop,e+=this.content[0].scrollLeft):i=this.element.find(".k-scheduler-header-wrap:has(.k-scheduler-header-all-day)").find(">div").offset(),i&&(e-=i.left,t-=i.top),e=Math.ceil(e),t=Math.ceil(t),o=0;this.groups.length>o;o++)if(r=this.groups[o],n=r.daySlotByPosition(e,t))return n;
for(i&&(e+=i.left,t+=i.top),i=this.content.offset(),e-=i.left,t-=i.top,this._isVerticallyGrouped()||(t+=this.content[0].scrollTop,e+=this.content[0].scrollLeft),e=Math.ceil(e),t=Math.ceil(t),o=0;this.groups.length>o;o++)if(r=this.groups[o],n=r.timeSlotByPosition(e,t))return n;return null},_groupCount:function(){var e=this.groupedResources;return e.length?"vertical"===this._groupOrientation()?this._rowCountForLevel(e.length-1):this._columnCountForLevel(e.length)/this._columnOffsetForResource(e.length):1},_columnCountInResourceView:function(){var e=this.groupedResources;return!e.length||this._isVerticallyGrouped()?this._columnCountForLevel(0):this._columnOffsetForResource(e.length)},_timeSlotGroups:function(e,t){var n,i,r,o,a,s,l,d,c,u,p,f,h,m,v,_,k=this._timeSlotInterval(),b=this.content.find("tr:not(.k-scheduler-header-all-day)");for(b.attr("role","row"),n=b.length,this._isVerticallyGrouped()&&(n=Math.floor(n/e)),i=0;e>i;i++)for(r=0,this._isVerticallyGrouped()&&(r=i),o=r*n,s=0,this._isVerticallyGrouped()||(s=i);(r+1)*n>o;){for(l=b[o].children,d=this.groups[i],o%n===0&&(a=g(new Date(+this.startTime()))),c=s*t;(s+1)*t>c;c++)u=l[c],p=c%t,f=d.getTimeSlotCollection(p),h=this._dates[p],m=Date.UTC(h.getFullYear(),h.getMonth(),h.getDate()),v=m+a,_=v+k,u.setAttribute("role","gridcell"),u.setAttribute("aria-selected",!1),f.addTimeSlot(u,v,_);a+=k,o++}},_daySlotGroups:function(e,t){var n,i,r,o,a,l,d,c,u,p,f,h;for(n=this._isVerticallyGrouped()?this.element.find(".k-scheduler-header-all-day"):this.element.find(".k-scheduler-header-all-day tr"),n.attr("role","row"),i=0;e>i;i++)for(r=0,this._isVerticallyGrouped()&&(r=i),o=this.groups[i],a=o.getDaySlotCollection(0),l=n[r].children,d=0,this._isVerticallyGrouped()||(d=i),c=0,u=d*t;(d+1)*t>u;u++)p=l[u],u%t===0&&(c=0),f=this._dates[c],h=Date.UTC(f.getFullYear(),f.getMonth(),f.getDate()),c++,p.setAttribute("role","gridcell"),p.setAttribute("aria-selected",!1),a.addDaySlot(p,h,h+s.date.MS_PER_DAY)},_groups:function(){var e,t,n,i=this._groupCount(),r=this._columnCountInResourceView();for(this.groups=[],e=0;i>e;e++){for(t=this._addResourceView(e),n=0;r>n;n++)t.addTimeSlotCollection(this._dates[n],s.date.addDays(this._dates[n],1));this.options.allDaySlot&&t.addDaySlotCollection(this._dates[0],s.date.addDays(this._dates[this._dates.length-1],1))}this._timeSlotGroups(i,r),this.options.allDaySlot&&this._daySlotGroups(i,r)},options:{name:"MultiDayView",selectedDateFormat:"{0:D}",allDaySlot:!0,showWorkHours:!1,title:"",startTime:s.date.today(),endTime:s.date.today(),minorTickCount:2,majorTick:60,majorTimeHeaderTemplate:"#=kendo.toString(date, 't')#",minorTimeHeaderTemplate:"&nbsp;",slotTemplate:"&nbsp;",allDaySlotTemplate:"&nbsp;",eventTemplate:_,allDayEventTemplate:k,dateHeaderTemplate:b,editable:!0,workDayStart:new Date(1980,1,1,8,0,0),workDayEnd:new Date(1980,1,1,17,0,0),workWeekStart:1,workWeekEnd:5,footer:{command:"workDay"},messages:{allDay:"all day",showFullDay:"Show full day",showWorkDay:"Show business hours"}},events:["remove","add","edit"],_templates:function(){var e=this.options,t=u({},s.Template,e.templateSettings);this.eventTemplate=this._eventTmpl(e.eventTemplate,y),this.allDayEventTemplate=this._eventTmpl(e.allDayEventTemplate,w),this.majorTimeHeaderTemplate=s.template(e.majorTimeHeaderTemplate,t),this.minorTimeHeaderTemplate=s.template(e.minorTimeHeaderTemplate,t),this.dateHeaderTemplate=s.template(e.dateHeaderTemplate,t),this.slotTemplate=s.template(e.slotTemplate,t),this.allDaySlotTemplate=s.template(e.allDaySlotTemplate,t)},_editable:function(){this.options.editable&&(this._isMobile()?this._touchEditable():this._mouseEditable())},_mouseEditable:function(){var t=this;t.element.on("click"+v,".k-event a:has(.k-si-close)",function(n){t.trigger("remove",{uid:e(this).closest(".k-event").attr(s.attr("uid"))}),n.preventDefault()}),t.options.editable.create!==!1&&t.element.on("dblclick"+v,".k-scheduler-content td",function(n){var i,r;e(this).parent().hasClass("k-scheduler-header-all-day")||(i=t._slotByPosition(n.pageX,n.pageY),i&&(r=t._resourceBySlot(i),t.trigger("add",{eventInfo:u({start:i.startDate(),end:i.endDate()},r)})),n.preventDefault())}).on("dblclick"+v,".k-scheduler-header-all-day td",function(e){var n,i=t._slotByPosition(e.pageX,e.pageY);i&&(n=t._resourceBySlot(i),t.trigger("add",{eventInfo:u({},{isAllDay:!0,start:s.date.getDate(i.startDate()),end:s.date.getDate(i.startDate())},n)})),e.preventDefault()}),t.options.editable.update!==!1&&t.element.on("dblclick"+v,".k-event",function(n){t.trigger("edit",{uid:e(this).closest(".k-event").attr(s.attr("uid"))}),n.preventDefault()})},_touchEditable:function(){var t=this;t.options.editable.create!==!1&&(t._addUserEvents=new s.UserEvents(t.element,{filter:".k-scheduler-content td",tap:function(n){var i,r;e(n.target).parent().hasClass("k-scheduler-header-all-day")||(i=t._slotByPosition(n.x.location,n.y.location),i&&(r=t._resourceBySlot(i),t.trigger("add",{eventInfo:u({start:i.startDate(),end:i.endDate()},r)})),n.preventDefault())}}),t._allDayUserEvents=new s.UserEvents(t.element,{filter:".k-scheduler-header-all-day td",tap:function(e){var n,i=t._slotByPosition(e.x.location,e.y.location);i&&(n=t._resourceBySlot(i),t.trigger("add",{eventInfo:u({},{isAllDay:!0,start:s.date.getDate(i.startDate()),end:s.date.getDate(i.startDate())},n)})),e.preventDefault()}})),t.options.editable.update!==!1&&(t._editUserEvents=new s.UserEvents(t.element,{filter:".k-event",tap:function(n){var i=e(n.target).closest(".k-event");i.hasClass("k-event-active")||t.trigger("edit",{uid:i.attr(s.attr("uid"))}),n.preventDefault()}}))},_layout:function(e){var t,n,i,r=[],o=[],a=this.options,l=this;for(t=0;e.length>t;t++)n={},n.text=l.dateHeaderTemplate({date:e[t]}),s.date.isToday(e[t])&&(n.className="k-today"),r.push(n);return i=this.groupedResources,a.allDaySlot&&o.push({text:a.messages.allDay,allDay:!0,cellContent:function(t){var n=t;return t=i.length&&"vertical"!==l._groupOrientation()?t%e.length:t,l.allDaySlotTemplate({date:e[t],resources:function(){return l._resourceBySlot({groupIndex:n})}})}}),this._forTimeRange(this.startTime(),this.endTime(),function(e,t,n,i){var r=t?l.majorTimeHeaderTemplate:l.minorTimeHeaderTemplate,a={text:r({date:e}),className:i?"k-slot-cell":""};o.push(a)}),i.length&&("vertical"===this._groupOrientation()?o=this._createRowsLayout(i,o):r=this._createColumnsLayout(i,r)),{columns:r,rows:o}},_footer:function(){var t,n,i,r=this.options;r.footer!==!1&&(t='<div class="k-header k-scheduler-footer">',n=r.footer.command,n&&"workDay"===n?(t+='<ul class="k-reset k-header k-toolbar">',t+='<li class="k-state-default k-scheduler-fullday"><a href="#" class="k-link"><span class="k-icon k-i-clock"></span>',t+=(r.showWorkHours?r.messages.showFullDay:r.messages.showWorkDay)+"</a></li>",t+="</ul>"):t+="&nbsp;",t+="</div>",this.footer=e(t).appendTo(this.element),i=this,this.footer.on("click"+v,".k-scheduler-fullday",function(e){e.preventDefault(),i.trigger("navigate",{view:i.name||r.name,date:i.startDate(),isWorkDay:!r.showWorkHours})}))},_forTimeRange:function(e,t,i,r){var o,a,s,l,c,u,p,f,v,_,k,b,w,y,C,x;for(e=n(e),t=n(t),o=this,a=g(e),s=g(t),l=o.options.minorTickCount,c=o.options.majorTick*h,u=c/l||1,p=new Date(+e),f=p.getDate(),_=0,b="",k=m/u,a!=s&&(a>s&&(s+=m),k=(s-a)/u),k=Math.round(k);k>_;_++)w=_%(c/u),y=0===w,C=l-1>w,x=w===l-1,b+=i(p,y,C,x),d(p,u,!1);return s&&(v=g(p),f<p.getDate()&&(v+=m),v>s&&(p=new Date(+t))),r&&(b+=r(p)),b},_content:function(e){var t,n,i,r=this,o=r.options,a=r.startTime(),l=this.endTime(),d=1,c=1,u=e.length,p="",f=this.groupedResources,h=this.slotTemplate,m=this.allDaySlotTemplate,g=!1;for(f.length&&(g="vertical"===r._groupOrientation(),g?(c=this._rowCountForLevel(this.rowLevels.length-2),o.allDaySlot&&(t=function(t){var n,i,o='<tr class="k-scheduler-header-all-day">',a=function(){return r._resourceBySlot({groupIndex:t})};for(n=0,i=e.length;i>n;n++)o+="<td>"+m({date:e[n],resources:a})+"</td>";return o+"</tr>"})):d=this._columnCountForLevel(this.columnLevels.length-2)),p+="<tbody>",n=function(t,n){var o,a,l,c,p="",f="",m=0;for(p="<tr"+(n?' class="k-middle-row"':"")+">",c=function(e){return function(){return r._resourceBySlot({groupIndex:e})}};d>m;m++)for(o=0,a=u;a>o;o++)f="",s.date.isToday(e[o])&&(f+="k-today"),(s.date.getMilliseconds(t)<s.date.getMilliseconds(r.options.workDayStart)||s.date.getMilliseconds(t)>=s.date.getMilliseconds(r.options.workDayEnd)||!r._isWorkDay(e[o]))&&(f+=" k-nonwork-hour"),p+="<td"+(""!==f?' class="'+f+'"':"")+">",l=s.date.getDate(e[o]),s.date.setTime(l,s.date.getMilliseconds(t)),p+=h({date:l,resources:c(g?i:m)}),p+="</td>";return p+="</tr>"},i=0;c>i;i++)p+=t?t(i):"",p+=this._forTimeRange(a,l,n);p+="</tbody>",this.content.find("table").append(p)},_isWorkDay:function(e){var t,n=e.getDay(),i=this._workDays;for(t=0;i.length>t;t++)if(i[t]===n)return!0;return!1},_render:function(t){var n,i=this;t=t||[],this._dates=t,this._startDate=t[0],this._endDate=t[t.length-1||0],this.createLayout(this._layout(t)),this._content(t),this._footer(),this.refreshLayout(),n=this.element.find(".k-scheduler-header-all-day td"),n.length&&(this._allDayHeaderHeight=n.first()[0].clientHeight),i.datesHeader.on("click"+v,".k-nav-day",function(t){var n=e(t.currentTarget).closest("th"),r=n.offset(),o=i._slotByPosition(r.left,r.top+n.outerHeight());i.trigger("navigate",{view:"day",date:o.startDate()})})},startTime:function(){var e=this.options;return e.showWorkHours?e.workDayStart:e.startTime},endTime:function(){var e=this.options;return e.showWorkHours?e.workDayEnd:e.endTime},startDate:function(){return this._startDate},endDate:function(){return this._endDate},_end:function(e){var t=g(this.endTime())||m;return e&&(t=0),new Date(this._endDate.getTime()+t)},nextDate:function(){return s.date.nextDay(this.endDate())},previousDate:function(){return s.date.previousDay(this.startDate())},calculateDateRange:function(){this._render([this.options.date])},destroy:function(){var e=this;e.datesHeader&&e.datesHeader.off(v),e.element&&e.element.off(v),e.footer&&e.footer.remove(),c.fn.destroy.call(this),this._isMobile()&&e.options.editable&&(e.options.editable.create!==!1&&(e._addUserEvents.destroy(),e._allDayUserEvents.destroy()),e.options.editable.update!==!1&&e._editUserEvents.destroy())},inRange:function(e){var t=c.fn.inRange.call(this,e),n=g(this.startTime()),i=g(this.endTime())||s.date.MS_PER_DAY,r=g(e.start),o=g(e.end)||s.date.MS_PER_DAY;return t&&r>=n&&i>=o},selectionByElement:function(e){var t=e.offset();return this._slotByPosition(t.left,t.top)},_timeSlotInterval:function(){var e=this.options;return e.majorTick/e.minorTickCount*h},_timeSlotIndex:function(e){var t=this.options,n=g(e),i=g(this.startTime()),r=t.majorTick/t.minorTickCount*h;return(n-i)/r},_slotIndex:function(e,t){return t?this._dateSlotIndex(e):this._timeSlotIndex(e)},_dateSlotIndex:function(e,t){var n,r,o,a,l=this._dates||[],d=1;for(n=0,r=l.length;r>n;n++)if(o=s.date.getDate(l[n]),a=new Date(s.date.getDate(l[n]).getTime()+m-(t?0:1)),i(e,o,a))return n*d;return-1},_positionAllDayEvent:function(t,n){var i,r,o,a,s,l,d,u=n.innerWidth(),p=n.start.index,f=n.end.index,h=c.collidingEvents(n.events(),p,f),m=this._headerColumnCount||0,g=2,v=p!==f?5:4,_=this._allDayHeaderHeight,k=n.startSlot();for(t.css({left:k.offsetLeft+g,width:u-v}),n.addEvent({slotIndex:p,start:p,end:f,element:t}),h.push({slotIndex:p,start:p,end:f,element:t}),i=c.createRows(h),i.length&&i.length>m&&(this._headerColumnCount=i.length),r=n.start.offsetTop,o=0,a=i.length;a>o;o++)for(s=i[o].events,l=0,d=s.length;d>l;l++)e(s[l].element).css({top:r+o*_})},_arrangeColumns:function(e,t,n,i){var r,o,a,s,l,d,u,p,f,h,m,g=i.start;for(e={element:e,slotIndex:g.index,start:t,end:t+n},o=g.clientWidth,a=.1*o,l=i.events(),d=c.collidingEvents(l,e.start,e.end),i.addEvent(e),d.push(e),r=c.createColumns(d),u=(o-a)/r.length,p=0,f=r.length;f>p;p++)for(s=r[p].events,h=0,m=s.length;m>h;h++)s[h].element[0].style.width=u-4+"px",s[h].element[0].style.left=(this._isRtl?a:0)+g.offsetLeft+p*u+2+"px"},_positionEvent:function(e,t,n){var i=e.startTime||e.start,r=e.endTime||e.end,o=n.innerRect(i,r,!1),a=o.bottom-o.top-2;0>a&&(a=0),t.css({top:o.top,height:a}),this._arrangeColumns(t,o.top,t[0].clientHeight,n)},_eventTmpl:function(e,t){var n,i=this.options,r=u({},s.Template,i.templateSettings),o=r.paramName,a="",l=typeof e,d={storage:{},count:0};return"function"===l?(d.storage["tmpl"+d.count]=e,a+="#=this.tmpl"+d.count+"("+o+")#",d.count++):"string"===l&&(a+=e),n=s.template(s.format(t,a),r),d.count>0&&(n=p(n,d.storage)),n},_createEventElement:function(t,n,r,o){var a,l,d,c,p=n?this.eventTemplate:this.allDayEventTemplate,h=this.options,v=h.editable,_=this._isMobile(),k=v&&v.destroy!==!1&&!_,b=v&&v.resize!==!1,w=f(this.startDate()),y=f(this.endDate()),C=g(this.startTime()),x=g(this.endTime()),T=t._time("start"),S=t._time("end");return C>=x&&(x=g(new Date(this.endTime().getTime()+m-1))),n||t.isAllDay||(y=new Date(y.getTime()+m)),l=t.start,d=t.end,t.isAllDay&&(d=f(t.end)),!i(f(l),w,y)&&!i(d,w,y)||n&&C>T&&S>x?a=!0:f(l)<w||n&&C>T?o=!0:(d>y&&!n||n&&S>x)&&(r=!0),c=this.eventResources(t),t.startTime&&(l=new Date(T),l=s.timezone.apply(l,"Etc/UTC")),t.endTime&&(d=new Date(S),d=s.timezone.apply(d,"Etc/UTC")),e(p(u({},{ns:s.ns,resizable:b,showDelete:k,middle:a,head:r,tail:o,singleDay:1==this._dates.length,resources:c,inverseColor:c&&c[0]?this._shouldInverseResourceColor(c[0]):!1},t,{start:l,end:d})))},_isInTimeSlot:function(e){var t,n=this.startTime(),i=this.endTime(),o=e.startTime||e.start,a=e.endTime||e.end;return g(i)===g(s.date.getDate(i))&&(i=s.date.getDate(i),d(i,m-1)),e._date("end")>e._date("start")&&(a=+e._date("end")+(m-1)),a-=e._date("end"),o-=e._date("start"),i=g(i),n=g(n),n===o&&o===a?!0:(t=o!==i,r(o,n,i,t)||r(a,n,i,t)||r(n,o,a)||r(i,o,a))},_isInDateSlot:function(e){var t=this.groups[0],n=t.firstSlot().start,r=t.lastSlot().end-1,o=s.date.toUtcTime(e.start),a=s.date.toUtcTime(e.end);return(i(o,n,r)||i(a,n,r)||i(n,o,a)||i(r,o,a))&&(!i(a,n,n)||i(a,o,o)||e.isAllDay)},_updateAllDayHeaderHeight:function(e){var t,n;if(this._height!==e&&(this._height=e,t=this.element.find(".k-scheduler-header-all-day td"),t.length))for(t.parent().add(this.element.find(".k-scheduler-times-all-day").parent()).height(e),n=0;this.groups.length>n;n++)this.groups[n].refresh()},_renderEvents:function(e,t){var n,i,r,a,s,l,d,c,u,p,f,h,g,v,_,k=this.datesHeader.find(".k-scheduler-header-wrap > div");for(i=0,r=e.length;r>i;i++)if(n=e[i],this._isInDateSlot(n))if(a=n.isAllDay||n.end.getTime()-n.start.getTime()>=m,s=a&&!this._isVerticallyGrouped()?k:this.content,a)this.options.allDaySlot&&(c=this.groups[t],c._continuousEvents||(c._continuousEvents=[]),d=c.slotRanges(n),d.length&&(l=this._createEventElement(n,!a),this._positionAllDayEvent(l,d[0]),o(c,d[0],l,!0),l.appendTo(s)));else if(this._isInTimeSlot(n))for(c=this.groups[t],c._continuousEvents||(c._continuousEvents=[]),d=c.slotRanges(n),u=d.length,p=0;u>p;p++)f=d[p],h=n.start,g=n.end,u>1&&(0===p?g=f.end.endDate():p==u-1?h=f.start.startDate():(h=f.start.startDate(),g=f.end.endDate())),v=n.clone({start:h,end:g,startTime:n.startTime,endTime:n.endTime}),this._isInTimeSlot(v)&&(_=f.head,l=this._createEventElement(n,!a,_,f.tail),l.appendTo(s),this._positionEvent(v,l,f),o(c,f,l,!1))},render:function(t){var n,r,o,a,l;for(this._headerColumnCount=0,this._groups(),this.element.find(".k-event").remove(),t=new s.data.Query(t).sort([{field:"start",dir:"asc"},{field:"end",dir:"desc"}]).toArray(),n=[],this._eventsByResource(t,this.groupedResources,n),r=this,o=e.map(this._dates,function(t){return Math.max.apply(null,e.map(n,function(n){return e.grep(n,function(e){return e.isMultiDay()&&i(t,f(e.start),f(e.end))}).length}))}),a=Math.max.apply(null,o),this._updateAllDayHeaderHeight((a+1)*this._allDayHeaderHeight),l=0;n.length>l;l++)this._renderEvents(n[l],l);this.refreshLayout(),this.trigger("activate")},_eventsByResource:function(e,t,n){var i,r,o,a,l=t[0];if(l)for(i=l.dataSource.view(),r=0;i.length>r;r++)o=this._resourceValue(l,i[r]),a=new s.data.Query(e).filter({field:l.field,operator:c.groupEqFilter(o)}).toArray(),t.length>1?this._eventsByResource(a,t.slice(1),n):n.push(a);else n.push(e)},_columnOffsetForResource:function(e){return this._columnCountForLevel(e)/this._columnCountForLevel(e-1)},_columnCountForLevel:function(e){var t=this.columnLevels[e];return t?t.length:0},_rowCountForLevel:function(e){var t=this.rowLevels[e];return t?t.length:0},clearSelection:function(){this.content.add(this.datesHeader).find(".k-state-selected").removeAttr("id").attr("aria-selected",!1).removeClass("k-state-selected")},_updateDirection:function(e,t,n,i,r){var o=e.isAllDay,a=t[0].start,s=t[t.length-1].end;n&&(r?o||a.index!==s.index||a.collectionIndex!==s.collectionIndex||(e.backward=i):(o&&a.index===s.index||!o&&a.collectionIndex===s.collectionIndex)&&(e.backward=i))},_changeViewPeriod:function(e,n,i){var r,o,a,s;return i?t:(r=n?this.previousDate():this.nextDate(),o=e.start,a=e.end,e.start=new Date(r),e.end=new Date(r),s=e.isAllDay?m:g(a),d(e.start,g(o)),d(e.end,s),this._isVerticallyGrouped()||(e.groupIndex=n?this.groups.length-1:0),e.events=[],!0)}});u(!0,l,{MultiDayView:C,DayView:C.extend({options:{title:"Day"},name:"day"}),WeekView:C.extend({options:{title:"Week",selectedDateFormat:"{0:D} - {1:D}"},name:"week",calculateDateRange:function(){var e,t,n=this.options.date,i=s.date.dayOfWeek(n,this.calendarInfo().firstDay,-1),r=[];for(e=0,t=7;t>e;e++)r.push(i),i=s.date.nextDay(i);this._render(r)}}),WorkWeekView:C.extend({options:{title:"Work Week",selectedDateFormat:"{0:D} - {1:D}"},name:"workweek",nextDate:function(){return s.date.dayOfWeek(s.date.nextDay(this.endDate()),this.options.workWeekStart,1)},previousDate:function(){return s.date.previousDay(this.startDate())},calculateDateRange:function(){for(var e=this.options.date,t=s.date.dayOfWeek(e,this.options.workWeekStart,-1),n=s.date.dayOfWeek(t,this.options.workWeekEnd,1),i=[];n>=t;)i.push(t),t=s.date.nextDay(t);this._render(i)}})})})(window.kendo.jQuery);(function(e){function t(e){var t,n,i=0;for(t=0,n=e.length;n>t;t++)i+=e[t].items.length;return i}function n(e,t){return e.valuePrimitive&&(t=o.getter(e.dataValueField)(t)),t}function i(e){for(var t,n=0,i=e.length,o=[];i>n;n++)t=e[n],t.groups?(t=r(t.groups),o=o.concat(t)):o=o.concat(r(t.items));return o}function r(e){for(var t=[].concat(e),n=t.shift(),i=[],r=[].push;n;)n.groups?r.apply(t,n.groups):n.items?r.apply(t,n.items):r.call(i,n),n=t.shift();return i}var o=window.kendo,a=o.ui,s=".kendoAgendaView";a.AgendaView=a.SchedulerView.extend({init:function(t,n){a.SchedulerView.fn.init.call(this,t,n),n=this.options,n.editable&&(n.editable=e.extend({"delete":!0},n.editable,{create:!1,update:!1})),this.title=n.title,this.name="agenda",this._eventTemplate=o.template(n.eventTemplate),this._dateTemplate=o.template(n.eventDateTemplate),this._groupTemplate=o.template(n.eventGroupTemplate),this._timeTemplate=o.template(n.eventTimeTemplate),this.element.on("mouseenter"+s,".k-scheduler-agenda .k-scheduler-content tr","_mouseenter").on("mouseleave"+s,".k-scheduler-agenda .k-scheduler-content tr","_mouseleave").on("click"+s,".k-scheduler-agenda .k-scheduler-content .k-link:has(.k-si-close)","_remove"),this._renderLayout(n.date)},_mouseenter:function(t){e(t.currentTarget).addClass("k-state-hover")},_mouseleave:function(t){e(t.currentTarget).removeClass("k-state-hover")},_remove:function(t){t.preventDefault(),this.trigger("remove",{uid:e(t.currentTarget).closest(".k-task").attr(o.attr("uid"))})},nextDate:function(){return o.date.nextDay(this.startDate())},startDate:function(){return this._startDate},endDate:function(){return this._endDate},previousDate:function(){return o.date.previousDay(this.startDate())},_renderLayout:function(e){this._startDate=e,this._endDate=o.date.addDays(e,7),this.createLayout(this._layout()),this.table.addClass("k-scheduler-agenda")},_layout:function(){var e,t,n,i=[{text:this.options.messages.time,className:"k-scheduler-timecolumn"},{text:this.options.messages.event}];if(this._isMobilePhoneView()||i.splice(0,0,{text:this.options.messages.date,className:"k-scheduler-datecolumn"}),e=this.groupedResources,e.length){for(t=[],n=0;e.length>n;n++)t.push({text:"",className:"k-scheduler-groupcolumn"});i=t.concat(i)}return{columns:i}},_tasks:function(e){var t,n,i,r,a,s,l,d=[];for(t=0;e.length>t;t++)if(n=e[t],i=n.start,r=n.end,a=(o.date.getDate(r)-o.date.getDate(i))/o.date.MS_PER_DAY+1,s=n.clone(),s.startDate=o.date.getDate(i),s.startDate>=this.startDate()&&d.push(s),a>1)for(s.end=o.date.nextDay(i),s.head=!0,l=1;a>l;l++)i=s.end,s=n.clone(),s.start=i,s.startDate=o.date.getDate(i),s.end=o.date.nextDay(i),l==a-1?(s.end=new Date(s.start.getFullYear(),s.start.getMonth(),s.start.getDate(),r.getHours(),r.getMinutes(),r.getSeconds(),r.getMilliseconds()),s.tail=!0):(s.isAllDay=!0,s.middle=!0),s.end<=this.endDate()&&s.start>=this.startDate()&&d.push(s);return new o.data.Query(d).sort([{field:"start",dir:"asc"},{field:"end",dir:"asc"}]).groupBy({field:"startDate"}).toArray()},_renderTaskGroups:function(e,t){var n,i,r,a,s,l,d,c,u,p=[],f=this.options.editable,h=f&&f.destroy!==!1&&!this._isMobile(),m=this._isMobilePhoneView();for(n=0;e.length>n;n++)for(i=e[n].value,r=e[n].items,a=o.date.isToday(i),s=0;r.length>s;s++){if(l=r[s],d=[],c=m?[]:d,0===n&&0===s&&t.length)for(u=0;t.length>u;u++)c.push(o.format('<td class="k-scheduler-groupcolumn{2}" rowspan="{0}">{1}</td>',t[u].rowSpan,this._groupTemplate({value:t[u].text}),t[u].className));0===s&&(m?(c.push(o.format('<td class="k-scheduler-datecolumn" colspan="2">{0}</td>',this._dateTemplate({date:i}))),p.push('<tr role="row" aria-selected="false"'+(a?' class="k-today">':">")+c.join("")+"</tr>")):d.push(o.format('<td class="k-scheduler-datecolumn{3}{2}" rowspan="{0}">{1}</td>',r.length,this._dateTemplate({date:i}),n!=e.length-1||t.length?"":" k-last",t.length?"":" k-first"))),l.format=l.head?"{0:t}":l.tail?"{1:t}":"{0:t}-{1:t}",l.resources=this.eventResources(l),d.push(o.format('<td class="k-scheduler-timecolumn"><div>{0}{1}{2}</div></td><td>{3}</td>',l.tail||l.middle?'<span class="k-icon k-i-arrow-w"></span>':"",this._timeTemplate(l.clone({start:l.startTime||l.start,end:l.endTime||l.end})),l.head||l.middle?'<span class="k-icon k-i-arrow-e"></span>':"",this._eventTemplate(l.clone({showDelete:h})))),p.push('<tr role="row" aria-selected="false"'+(a?' class="k-today">':">")+d.join("")+"</tr>")}return p.join("")},render:function(e){var t,n=this.content.find("table").empty(),r=[];e.length>0&&(t=this.groupedResources,t.length?(r=this._createGroupConfiguration(e,t,null),this._renderGroups(r,n,[])):(r=this._tasks(e),n.append(this._renderTaskGroups(r,[])))),this._eventsList=i(r),this.refreshLayout(),this.trigger("activate")},_renderGroups:function(e,t,n){var i,r,o;for(i=0,r=e.length;r>i;i++)o=n.splice(0),o.push(e[i]),e[i].groups?this._renderGroups(e[i].groups,t,o):t.append(this._renderTaskGroups(e[i].items,o))},_createGroupConfiguration:function(e,i,r){var s,l,d,c,u,p,f,h=i[0],m=[],g=h.dataSource.view(),v=this._isMobilePhoneView();for(s=0;g.length>s;s++)l=n(h,g[s]),d=new o.data.Query(e).filter({field:h.field,operator:a.SchedulerView.groupEqFilter(l)}).toArray(),d.length&&(c=this._tasks(d),u=r?"":" k-first",s===g.length-1&&(!r||r.className.indexOf("k-last")>-1)&&(u+=" k-last"),p={text:o.getter(h.dataTextField)(g[s]),value:l,rowSpan:0,className:u},i.length>1?(p.groups=this._createGroupConfiguration(d,i.slice(1),p),r&&(r.rowSpan+=p.rowSpan)):(p.items=c,f=t(p.items),v&&(f+=p.items.length),p.rowSpan=f,r&&(r.rowSpan+=f)),m.push(p));return m},selectionByElement:function(t){var n,i,r;return t=e(t),t.hasClass("k-scheduler-datecolumn")?void 0:(this._isMobile()?(r=t.parent(),n=r.parent().children().filter(function(){return e(this).children(":not(.k-scheduler-datecolumn)").length}).index(r)):n=t.parent().index(),i=this._eventsList[n],{index:n,start:i.start,end:i.end,isAllDay:i.isAllDay,uid:i.uid})},select:function(e){this.clearSelection();var t=this.table.find(".k-task").eq(e.index).closest("tr").addClass("k-state-selected").attr("aria-selected",!0)[0];this.current(t)},move:function(e,t){var n,i=!1,r=e.index;return t==o.keys.UP?(r--,i=!0):t==o.keys.DOWN&&(r++,i=!0),i&&(n=this._eventsList[r],n&&(e.start=n.start,e.end=n.end,e.isAllDay=n.isAllDay,e.events=[n.uid],e.index=r)),i},moveToEvent:function(){return!1},constrainSelection:function(e){var t=this._eventsList[0];t&&(e.start=t.start,e.end=t.end,e.isAllDay=t.isAllDay,e.events=[t.uid],e.index=0)},isInRange:function(){return!0},destroy:function(){this.element&&this.element.off(s),a.SchedulerView.fn.destroy.call(this)},options:{title:"Agenda",name:"agenda",editable:!0,selectedDateFormat:"{0:D}-{1:D}",eventTemplate:'<div class="k-task" title="#:title.replace(/"/g,"\'")#" data-#=kendo.ns#uid="#=uid#"># if (resources[0]) {#<span class="k-scheduler-mark" style="background-color:#=resources[0].color#"></span># } ## if (data.isException()) { #<span class="k-icon k-i-exception"></span># } else if (data.isRecurring()) {#<span class="k-icon k-i-refresh"></span># } ##:title##if (showDelete) {#<a href="\\#" class="k-link k-event-delete"><span class="k-icon k-si-close"></span></a>#}#</div>',eventTimeTemplate:"#if(data.isAllDay) {##=this.options.messages.allDay##} else { ##=kendo.format(format, start, end)## } #",eventDateTemplate:'<strong class="k-scheduler-agendaday">#=kendo.toString(date, "dd")#</strong><em class="k-scheduler-agendaweek">#=kendo.toString(date,"dddd")#</em><span class="k-scheduler-agendadate">#=kendo.toString(date, "y")#</span>',eventGroupTemplate:'<strong class="k-scheduler-adgendagroup">#=value#</strong>',messages:{event:"Event",date:"Date",time:"Time",allDay:"all day"}}})})(window.kendo.jQuery);(function(e){function t(e,t){return e.slice(t).concat(e.slice(0,t))}function n(e,t){for(var n=t.firstDay,i=new Date(e.getFullYear(),e.getMonth(),0,e.getHours(),e.getMinutes(),e.getSeconds(),e.getMilliseconds());i.getDay()!=n;)r.date.setTime(i,-1*u);return i}function i(e,t,n){var i,r=t,o=n;return i=e,i>=r&&o>=i}var r=window.kendo,o=r.ui,a=o.SchedulerView,s=".kendoMonthView",l=e.extend,d=e.proxy,c=r.date.getDate,u=r.date.MS_PER_DAY,p=6,f=7,h=r.template('<span class="k-link k-nav-day">#:kendo.toString(date, "dd")#</span>'),m='<div role="gridcell" aria-selected="false" data-#=ns#uid="#=uid#"#if (resources[0]) { #style="background-color:#=resources[0].color #; border-color: #=resources[0].color#"class="k-event#=inverseColor ? " k-event-inverse" : ""#"#} else {#class="k-event"#}#><span class="k-event-actions"># if(data.tail || data.middle) {#<span class="k-icon k-i-arrow-w"></span>#}## if(data.isException()) {#<span class="k-icon k-i-exception"></span># } else if(data.isRecurring()) {#<span class="k-icon k-i-refresh"></span>#}#</span>{0}<span class="k-event-actions">#if (showDelete) {#<a href="\\#" class="k-link k-event-delete"><span class="k-icon k-si-close"></span></a>#}## if(data.head || data.middle) {#<span class="k-icon k-i-arrow-e"></span>#}#</span># if(resizable && !data.tail && !data.middle) {#<span class="k-resize-handle k-resize-w"></span>#}## if(resizable && !data.head && !data.middle) {#<span class="k-resize-handle k-resize-e"></span>#}#</div>',g=r.template('<div title="#=title.replace(/"/g,"&\\#34;")#"><div class="k-event-template">#:title#</div></div>'),v=r.template('<div style="width:#=width#px;left:#=left#px;top:#=top#px" class="k-more-events k-button"><span>...</span></div>');o.MonthView=a.extend({init:function(e,t){var n=this;a.fn.init.call(n,e,t),n.title=n.options.title,n.name="month",n._templates(),n._editable(),n._renderLayout(n.options.date),n._groups()},_updateDirection:function(e,t,n,i,r){var o,a,s,l,d;n&&(o=t[0].start,a=t[t.length-1].end,s=o.index===a.index,l=o.collectionIndex===a.collectionIndex,d=r?s&&l||l:s&&l,d&&(e.backward=i))},_changeViewPeriod:function(e,t,n){var i=n?7:1;return t&&(i*=-1),e.start=r.date.addDays(e.start,i),e.end=r.date.addDays(e.end,i),(!n||n&&this._isVerticallyGrouped())&&(e.groupIndex=t?this.groups.length-1:0),e.events=[],!0},_continuousSlot:function(e,t,n){var i=e.backward?0:t.length-1,r=this.groups[e.groupIndex];return r.continuousSlot(t[i].start,n)},_changeGroupContinuously:function(e,t,n,i){var r,o,a,s;return n||(r=e.groupIndex,o=this.groups.length-1,a=this._isVerticallyGrouped(),s=this.groups[r],!t&&a?(t=s[i?"lastSlot":"firstSlot"](),r+=i?-1:1):t&&!a&&(r=i?o:0),(0>r||r>o)&&(r=i?o:0,t=null),e.groupIndex=r),t},_normalizeHorizontalSelection:function(e,t,n){var i;return i=n?t[0].start:t[t.length-1].end},_normalizeVerticalSelection:function(e,t){var n;return n=e.backward?t[0].start:t[t.length-1].end},_templates:function(){var e=this.options,t=l({},r.Template,e.templateSettings);this.eventTemplate=this._eventTmpl(e.eventTemplate),this.dayTemplate=r.template(e.dayTemplate,t)},dateForTitle:function(){return r.format(this.options.selectedDateFormat,this._firstDayOfMonth,this._lastDayOfMonth)},nextDate:function(){return r.date.nextDay(this._lastDayOfMonth)},previousDate:function(){return r.date.previousDay(this._firstDayOfMonth)},startDate:function(){return this._startDate},endDate:function(){return this._endDate},_renderLayout:function(t){var i=this;this._firstDayOfMonth=r.date.firstDayOfMonth(t),this._lastDayOfMonth=r.date.lastDayOfMonth(t),this._startDate=n(t,this.calendarInfo()),this.createLayout(this._layout()),this._content(),this.refreshLayout(),this.content.on("click"+s,".k-nav-day,.k-more-events",function(t){var n=e(t.currentTarget).offset(),r=i._slotByPosition(n.left,n.top);t.preventDefault(),i.trigger("navigate",{view:"day",date:r.startDate()})})},_editable:function(){this.options.editable&&!this._isMobilePhoneView()&&(this._isMobile()?this._touchEditable():this._mouseEditable())},_mouseEditable:function(){var t=this;t.element.on("click"+s,".k-scheduler-monthview .k-event a:has(.k-si-close)",function(n){t.trigger("remove",{uid:e(this).closest(".k-event").attr(r.attr("uid"))}),n.preventDefault()}),t.options.editable.create!==!1&&t.element.on("dblclick"+s,".k-scheduler-monthview .k-scheduler-content td",function(n){var i,r=e(n.currentTarget).offset(),o=t._slotByPosition(r.left,r.top);o&&(i=t._resourceBySlot(o),t.trigger("add",{eventInfo:l({isAllDay:!0,start:o.startDate(),end:o.startDate()},i)})),n.preventDefault()}),t.options.editable.update!==!1&&t.element.on("dblclick"+s,".k-scheduler-monthview .k-event",function(n){t.trigger("edit",{uid:e(this).closest(".k-event").attr(r.attr("uid"))}),n.preventDefault()})},_touchEditable:function(){var t=this;t.options.editable.create!==!1&&(t._addUserEvents=new r.UserEvents(t.element,{filter:".k-scheduler-monthview .k-scheduler-content td",tap:function(n){var i,r=e(n.target).offset(),o=t._slotByPosition(r.left,r.top);o&&(i=t._resourceBySlot(o),t.trigger("add",{eventInfo:l({isAllDay:!0,start:o.startDate(),end:o.startDate()},i)})),n.preventDefault()}})),t.options.editable.update!==!1&&(t._editUserEvents=new r.UserEvents(t.element,{filter:".k-scheduler-monthview .k-event",tap:function(n){0===e(n.event.target).closest("a:has(.k-si-close)").length&&(t.trigger("edit",{uid:e(n.target).closest(".k-event").attr(r.attr("uid"))}),n.preventDefault())}}))},selectionByElement:function(t){var n=e(t).offset();return this._slotByPosition(n.left,n.top)},_columnCountForLevel:function(e){var t=this.columnLevels[e];return t?t.length:0},_rowCountForLevel:function(e){var t=this.rowLevels[e];return t?t.length:0},_content:function(){var e,t="<tbody>",n=1,i=this.groupedResources;for(i.length&&this._isVerticallyGrouped()&&(n=this._rowCountForLevel(i.length-1)),e=0;n>e;e++)t+=this._createCalendar(e);t+="</tbody>",this.content.find("table").html(t)},_createCalendar:function(e){var t,n,i,o,a=this.startDate(),s=f*p,l=f,d=[a],c="",u=1,h=this._isVerticallyGrouped(),m=this.groupedResources;for(m.length&&(h||(u=this._columnCountForLevel(m.length-1))),this._slotIndices={},t=0,n=s/l;n>t;t++){for(c+="<tr>",d.push(a),i=t*l,o=0;u>o;o++)c+=this._createRow(a,i,l,h?e:o);a=r.date.addDays(a,l),c+="</tr>"}return this._weekStartDates=d,this._endDate=r.date.previousDay(a),c
},_createRow:function(e,t,n,i){var o,a=this,s=a._firstDayOfMonth,l=a._lastDayOfMonth,d=a.dayTemplate,u="",p="",f=function(){return a._resourceBySlot({groupIndex:i})};for(o=0;n>o;o++)u="",r.date.isToday(e)&&(u+="k-today"),r.date.isInDateRange(e,s,l)||(u+=" k-other-month"),p+="<td ",""!==u&&(p+='class="'+u+'"'),p+=">",p+=d({date:e,resources:f}),p+="</td>",a._slotIndices[c(e).getTime()]=t+o,e=r.date.nextDay(e);return p},_layout:function(){var n,i,r,o=this.calendarInfo(),a=this._isMobile()?o.days.namesShort:o.days.names,s=t(a,o.firstDay),l=e.map(s,function(e){return{text:e}}),d=this.groupedResources;if(d.length)if(this._isVerticallyGrouped()){for(i=[],r=0;6>r;r++)i.push({text:"<div>&nbsp;</div>",className:"k-hidden k-slot-cell"});n=this._createRowsLayout(d,i)}else l=this._createColumnsLayout(d,l);return{columns:l,rows:n}},_eventTmpl:function(e){var t,n=this.options,i=l({},r.Template,n.templateSettings),o=i.paramName,a="",s=typeof e,c={storage:{},count:0};return"function"===s?(c.storage["tmpl"+c.count]=e,a+="#=this.tmpl"+c.count+"("+o+")#",c.count++):"string"===s&&(a+=e),t=r.template(r.format(m,a),i),c.count>0&&(t=d(t,c.storage)),t},_createEventElement:function(t){var n=this.options,i=n.editable,o=this._isMobile();return t.showDelete=i&&i.destroy!==!1&&!o,t.resizable=i&&i.resize!==!1&&!o,t.ns=r.ns,t.resources=this.eventResources(t),t.inverseColor=t.resources&&t.resources[0]?this._shouldInverseResourceColor(t.resources[0]):!1,e(this.eventTemplate(t))},_isInDateSlot:function(e){var t=this.groups[0],n=t.firstSlot().start,o=t.lastSlot().end-1,a=r.date.toUtcTime(e.start),s=r.date.toUtcTime(e.end);return(i(a,n,o)||i(s,n,o)||i(n,a,s)||i(o,a,s))&&(!i(s,n,n)||i(s,a,a)||e.isAllDay)},_slotIndex:function(e){return this._slotIndices[c(e).getTime()]},_positionMobileEvent:function(t,n,i){var o,s,l,d,c,u,p,f=t.start;t.start.offsetLeft>t.end.offsetLeft&&(f=t.end),o=t.start.index,s=o,l=3,d=a.collidingEvents(t.events(),o,s),d.push({element:n,start:o,end:s}),c=a.createRows(d),u=t.collection.at(o),p=u.container,p||(p=e(r.format('<div class="k-events-container" style="top:{0};left:{1};width:{2}"/>',f.offsetTop+f.firstChildTop+f.firstChildHeight-3+"px",f.offsetLeft+"px",f.offsetWidth+"px")),u.container=p,this.content[0].appendChild(p[0])),l>=c.length&&(t.addEvent({element:n,start:o,end:s,groupIndex:f.groupIndex}),i._continuousEvents.push({element:n,uid:n.attr(r.attr("uid")),start:t.start,end:t.end}),p[0].appendChild(n[0]))},_positionEvent:function(t,n,i){var o,s,l,d,c,u,p,f,h,m,g,_,k,b,w,y=this.options.eventHeight,x=t.start;for(t.start.offsetLeft>t.end.offsetLeft&&(x=t.end),o=t.start.index,s=t.end.index,l=x.eventCount,d=a.collidingEvents(t.events(),o,s),c=o!==s?5:4,d.push({element:n,start:o,end:s}),u=a.createRows(d),p=0,f=Math.min(u.length,l);f>p;p++)for(h=u[p].events,m=x.offsetTop+x.firstChildHeight+p*y+3*p+"px",g=0,_=h.length;_>g;g++)h[g].element[0].style.top=m;if(u.length>l)for(k=o;s>=k;k++){if(b=t.collection,w=b.at(k),w.more)return;w.more=e(v({ns:r.ns,start:k,end:k,width:w.clientWidth-2,left:w.offsetLeft+2,top:w.offsetTop+w.firstChildHeight+l*y+3*l})),this.content[0].appendChild(w.more[0])}else t.addEvent({element:n,start:o,end:s,groupIndex:x.groupIndex}),n[0].style.width=t.innerWidth()-c+"px",n[0].style.left=x.offsetLeft+2+"px",n[0].style.height=y+"px",i._continuousEvents.push({element:n,uid:n.attr(r.attr("uid")),start:t.start,end:t.end}),this.content[0].appendChild(n[0])},_slotByPosition:function(e,t){var n,i,r=this.content.offset();for(e-=r.left,t-=r.top,t+=this.content[0].scrollTop,e+=this.content[0].scrollLeft,e=Math.ceil(e),t=Math.ceil(t),n=0;this.groups.length>n;n++)if(i=this.groups[n].daySlotByPosition(e,t))return i;return null},_createResizeHint:function(e){var t=e.startSlot().offsetLeft,n=e.start.offsetTop,i=e.innerWidth(),r=e.start.clientHeight-2,o=a.fn._createResizeHint.call(this,t,n,i,r);o.appendTo(this.content),this._resizeHint=this._resizeHint.add(o)},_updateResizeHint:function(e,t,n,i){var o,a,s;for(this._removeResizeHint(),o=this.groups[t],a=o.ranges(n,i,!0,e.isAllDay),s=0;a.length>s;s++)this._createResizeHint(a[s]);this._resizeHint.find(".k-label-top,.k-label-bottom").text(""),this._resizeHint.first().addClass("k-first").find(".k-label-top").text(r.toString(r.timezone.toLocalDate(n),"M/dd")),this._resizeHint.last().addClass("k-last").find(".k-label-bottom").text(r.toString(r.timezone.toLocalDate(i),"M/dd"))},_updateMoveHint:function(e,t,n){var i,o,a,s,l,d=r.date.toUtcTime(e.start)+n,c=d+e.duration(),u=this.groups[t],p=u.ranges(d,c,!0,e.isAllDay);for(this._removeMoveHint(),i=0;p.length>i;i++)o=p[i],a=o.startSlot(),s=o.endSlot(),l=this._createEventElement(e.clone({head:o.head,tail:o.tail})),l.css({left:a.offsetLeft+2,top:a.offsetTop+a.firstChildHeight,height:this.options.eventHeight,width:o.innerWidth()-(a.index!==s.index?5:4)}),l.addClass("k-event-drag-hint"),l.appendTo(this.content),this._moveHint=this._moveHint.add(l)},_groups:function(){var e,t,n,i,o,a,s,l,d,c,u,h,m,g,v,_,k,b=this._groupCount(),w=f,y=p;for(this.groups=[],e=0;b>e;e++)this._addResourceView(e);for(t=this.content[0].getElementsByTagName("tr"),n=0;b>n;n++)for(i=0,o=0,this._isVerticallyGrouped()&&(o=n),a=o*y;(o+1)*y>a;a++)for(s=this.groups[n],l=s.addDaySlotCollection(r.date.addDays(this.startDate(),i),r.date.addDays(this.startDate(),i+w)),d=t[a],c=d.children,u=0,d.setAttribute("role","row"),this._isVerticallyGrouped()||(u=n),h=u*w;(u+1)*w>h;h++)m=c[h],g=m.clientHeight,v=m.children.length?m.children[0].offsetHeight+3:0,_=r.date.toUtcTime(r.date.addDays(this.startDate(),i)),i++,k=Math.floor((g-v-this.options.moreButtonHeight)/(this.options.eventHeight+3)),m.setAttribute("role","gridcell"),m.setAttribute("aria-selected",!1),l.addDaySlot(m,_,_+r.date.MS_PER_DAY,k)},render:function(e){this.content.children(".k-event,.k-more-events,.k-events-container").remove(),this._groups(),e=new r.data.Query(e).sort([{field:"start",dir:"asc"},{field:"end",dir:"desc"}]).toArray();var t=this.groupedResources;t.length?this._renderGroups(e,t,0,1):this._renderEvents(e,0),this.refreshLayout(),this.trigger("activate")},_renderEvents:function(e,t){var n,i,r,o,a,s,l,d,c,u,p,f=this._isMobilePhoneView();for(i=0,r=e.length;r>i;i++)if(n=e[i],this._isInDateSlot(n))for(o=this.groups[t],o._continuousEvents||(o._continuousEvents=[]),a=o.slotRanges(n,!0),s=a.length,l=0;s>l;l++)d=a[l],c=n.start,u=n.end,s>1&&(0===l?u=d.end.endDate():l==s-1?c=d.start.startDate():(c=d.start.startDate(),u=d.end.endDate())),p=n.clone({start:c,end:u,head:d.head,tail:d.tail}),f?this._positionMobileEvent(d,this._createEventElement(p),o):this._positionEvent(d,this._createEventElement(p),o)},_renderGroups:function(e,t,n,i){var o,s,l,d,c=t[0];if(c)for(o=c.dataSource.view(),s=0;o.length>s;s++)l=this._resourceValue(c,o[s]),d=new r.data.Query(e).filter({field:c.field,operator:a.groupEqFilter(l)}).toArray(),t.length>1?n=this._renderGroups(d,t.slice(1),n++,i+1):this._renderEvents(d,n++);return n},_groupCount:function(){var e=this.groupedResources;return e.length?this._isVerticallyGrouped()?this._rowCountForLevel(e.length-1):this._columnCountForLevel(e.length)/this._columnOffsetForResource(e.length):1},_columnOffsetForResource:function(e){return this._columnCountForLevel(e)/this._columnCountForLevel(e-1)},destroy:function(){this.table&&this.table.removeClass("k-scheduler-monthview"),this.content&&this.content.off(s),this.element&&this.element.off(s),a.fn.destroy.call(this),this._isMobile()&&!this._isMobilePhoneView()&&this.options.editable&&(this.options.editable.create!==!1&&this._addUserEvents.destroy(),this.options.editable.update!==!1&&this._editUserEvents.destroy())},events:["remove","add","edit","navigate"],options:{title:"Month",name:"month",eventHeight:25,moreButtonHeight:13,editable:!0,selectedDateFormat:"{0:y}",dayTemplate:h,eventTemplate:g}})})(window.kendo.jQuery);(function(e,t){function n(e,t){var n;return 0!==e&&t>e?n=t-e:(n=e%t,n&&(n=t-n)),n}function i(e){var t=e.getMonth(),n=g(e)?et[t]:tt[t];return n+e.getDate()}function r(e,n){var i,r;return e=new Date(e.getFullYear(),e.getMonth(),e.getDate()),J(e,0),i=e.getFullYear(),n!==t?(K(e,n,-1),e.setDate(e.getDate()+4)):e.setDate(e.getDate()+(4-(e.getDay()||7))),J(e,0),r=Math.floor((e.getTime()-new Date(i,0,1,-6))/864e5),1+Math.floor(r/7)}function a(e,t){var n=X(e).getDay(),i=7-(n+7-(t||7))||7;return 0>i&&(i+=7),Math.ceil((e.getDate()-i)/7)+1}function o(e,t){return e+(t>e?7:0)}function s(e,t,n){var i,r,s,l,d,c=t.offset;return c?(i=new Date(e.getFullYear(),e.getMonth()+1,0),r=a(i,n),s=o(t.day,n),l=s<o(new Date(e.getFullYear(),e.getMonth(),1).getDay(),n),d=s>o(i.getDay(),n),0>c?c=r+(c+1-(d?1:0)):l&&(c+=1),r-=d?1:0,(l?1:0)>c||c>r?null:c):a(e,n)}function l(e,t){return a(new Date(e.getFullYear(),e.getMonth()+1,0),t)}function d(e,t,n){return a(e,n)===s(e,t,n)}function c(e,t,n){for(var i,r,l,d,c=o(t.getDay(),n),u=e.length,p=[],f=0;u>f;f++)if(r=e[f],d=a(t,n),i=s(t,r,n),null!==i)if(i>d)p.push(r);else if(d===i)if(l=o(r.day,n),l>c)p.push(r);else if(c===l)return null;return p}function u(e,t,n){for(var i,r=0,a=e.length,o=[];a>r;r++){if(i=e[r],n&&(i=n(i)),t===i)return null;i>t&&o.push(i)}return o}function p(e,t){for(var n,i=0,r=e.length;r>i;i++){if(n=parseInt(e[i],10),isNaN(n)||t.start>n||n>t.end||0===n&&0>t.start)return null;e[i]=n}return e.sort(v)}function f(e){for(var n,i,r,a=0,o=e.length;o>a;a++){if(n=e[a],i=n.length,r=n.substring(i-2).toUpperCase(),r=rt[r],r===t)return null;e[a]={offset:parseInt(n.substring(0,i-2),10)||0,day:r}}return e}function h(e){for(var t,n,i=0,r=e.length,a=[];r>i;i++)t=e[i],"string"==typeof t?n=t:(n=""+it[t.day],t.offset&&(n=t.offset+n)),a.push(n);return""+a}function m(e){var t=e.getMonth();return 1===t?1===new Date(e.getFullYear(),1,29).getMonth()?29:28:nt[t]}function g(e){return e=e.getFullYear(),e%4===0&&e%100!==0||e%400===0}function v(e,t){return e-t}function _(e,t){var n,i,r=0,a=[];if(e)for(e=e.split(";"),n=e.length;n>r;r++)i=T(e[r],t),i&&a.push(i);return a}function k(t,n,i){for(var r=e.isArray(t)?t:_(t,i),a=n.getTime()-n.getMilliseconds(),o=0,s=r.length;s>o;o++)if(r[o].getTime()===a)return!0;return!1}function b(e,t){var n,i,r=0,a=[].concat(e);for(n=a.length;n>r;r++)i=a[r],i=V.timezone.convert(i,t||i.getTimezoneOffset(),"Etc/UTC"),a[r]=V.toString(i,lt);return a.join(";")+";"}function y(e,t){var n=new Date(e);switch(t.freq){case"yearly":n.setFullYear(n.getFullYear(),0,1);break;case"monthly":n.setFullYear(n.getFullYear(),n.getMonth(),1);break;case"weekly":K(n,t.weekStart,-1)}return t.hours&&n.setHours(0),t.minutes&&n.setMinutes(0),t.seconds&&n.setSeconds(0),n}function w(e,t){var n=new Date(e);switch(t.freq){case"yearly":n.setFullYear(n.getFullYear(),11,31);break;case"monthly":n.setFullYear(n.getFullYear(),n.getMonth()+1,0);break;case"weekly":K(n,t.weekStart,-1),n.setDate(n.getDate()+6)}return t.hours&&n.setHours(23),t.minutes&&n.setMinutes(59),t.seconds&&n.setSeconds(59),n}function x(e,t,n){var i,r,a,o,s=e.slice(n._startIdx),l=s.length,d=n.positions,c=[];for(a=0,o=d.length;o>a;a++)i=d[a],0>i?i=l+i:i-=1,r=s[i],r&&r.start>=t&&c.push(r);return e=e.slice(0,n._startIdx).concat(c),n._startIdx=e.length,e}function C(e,n,i,r){var a,o,s,l,d,c,u,p,f,h,m,g,v,C,T,S,F,E,H,A,I,M,R=D(e.recurrenceRule,r),z=[];if(!R)return[e];for(A=R.positions,I=A?0:1,h=R.start,m=R.end,(h||m)&&(e=e.clone({start:h?new Date(h.value[0]):t,end:m?new Date(m.value[0]):t})),F=e.start,S=F.getTime(),T=Z(F),C=_(e.recurrenceException,r),!C[0]&&R.exdates&&(C=R.exdates.value,e.set("recurrenceException",b(C,r))),p=n=new Date(n),i=new Date(i),v=R.freq,H=gt[v],E=R.count,R.until&&i>R.until&&(i=new Date(R.until)),g="yearly"===v||"monthly"===v||"weekly"===v,S>n||E||R.interval>1||g?n=new Date(S):(l=n.getHours(),d=n.getMinutes(),c=n.getSeconds(),R.hours||(l=F.getHours()),R.minutes||(d=F.getMinutes()),R.seconds||(c=F.getSeconds()),n.setHours(l,d,c,F.getMilliseconds())),R._startPeriod=new Date(n),A&&(n=y(n,R),i=w(i,R),M=Z(i)-Z(n),0>M&&(l=n.getHours(),i.setHours(l,n.getMinutes(),n.getSeconds(),n.getMilliseconds()),$.adjustDST(i,l)),R._startPeriod=new Date(n),R._endPeriod=w(n,R),R._startIdx=0),u=e.duration(),R._startTime=a=$.toInvariantTime(n),H.setup&&H.setup(R,F,n),H.limit(n,i,R);i>=n;)if(s=new Date(n),Q(s,u),f=n>=p||s>p,(f&&!k(C,n,r)||A)&&(a=$.toUtcTime($.getDate(n))+Z(R._startTime),o=a+u,S!==n.getTime()||T!==Z(R._startTime)?z.push(e.toOccurrence({start:new Date(n),end:s,startTime:a,endTime:o})):(e.startTime=a,e.endTime=o,z.push(e))),A){if(H.next(n,R),H.limit(n,i,R),n>R._endPeriod&&(z=x(z,F,R),R._endPeriod=w(n,R),I=z.length),E&&E===I)break}else{if(E&&E===I)break;I++,H.next(n,R),H.limit(n,i,R)}return z}function T(e,t){return e=V.parseDate(e,at),e&&t&&(e=U.convert(e,e.getTimezoneOffset(),t)),e}function S(e,n){var i,r,a,o,s,l,d,c,u=e.split(";");for(d=0,c=u.length;c>d;d++)if(i=u[d].split(":"),r=i[0],a=i[1],-1!==r.indexOf("TZID")&&(o=r.substring(r.indexOf("TZID")).split("=")[1]),a)for(a=a.split(","),s=0,l=a.length;l>s;s++)a[s]=T(a[s],o||n);return a?{value:a,tzid:o}:t}function D(n,i){var r,a,o,s,l,d,c,u,h,m={},g=0,v=!1,_=function(e,t){var n=e.day,i=t.day;return u>n&&(n+=7),u>i&&(i+=7),n-i};if(!n)return null;for(d=n.split("\n"),d[1]||-1===n.indexOf("DTSTART")&&-1===n.indexOf("DTEND")&&-1===n.indexOf("EXDATE")||(d=n.split(" ")),g=0,o=d.length;o>g;g++)l=d[g],-1!==l.indexOf("DTSTART")?m.start=S(l,i):-1!==l.indexOf("DTEND")?m.end=S(l,i):-1!==l.indexOf("EXDATE")?m.exdates=S(l,i):s=-1!==l.indexOf("RRULE")?l.substring(6):l;for(s=s.split(";"),g=0,o=s.length;o>g;g++)switch(c=s[g],r=c.split("="),a=e.trim(r[1]).split(","),e.trim(r[0]).toUpperCase()){case"FREQ":m.freq=a[0].toLowerCase();break;case"UNTIL":m.until=T(a[0],i);break;case"COUNT":m.count=parseInt(a[0],10);break;case"INTERVAL":m.interval=parseInt(a[0],10);break;case"BYSECOND":m.seconds=p(a,{start:0,end:60}),v=!0;break;case"BYMINUTE":m.minutes=p(a,{start:0,end:59}),v=!0;break;case"BYHOUR":m.hours=p(a,{start:0,end:23}),v=!0;break;case"BYMONTHDAY":m.monthDays=p(a,{start:-31,end:31}),v=!0;break;case"BYYEARDAY":m.yearDays=p(a,{start:-366,end:366}),v=!0;break;case"BYMONTH":m.months=p(a,{start:1,end:12}),v=!0;break;case"BYDAY":m.weekDays=h=f(a),v=!0;break;case"BYWEEKNO":m.weeks=p(a,{start:-53,end:53}),v=!0;break;case"BYSETPOS":m.positions=p(a,{start:-366,end:366});break;case"WKST":m.weekStart=u=rt[a[0]]}return m.freq===t||m.count!==t&&m.until?null:(m.interval||(m.interval=1),u===t&&(m.weekStart=u=V.culture().calendar.firstDay),h&&(m.weekDays=h.sort(_)),m.positions&&!v&&(m.positions=null),m._hasRuleValue=v,m)}function F(e,t){for(var n,i=e.value,r=e.tzid||"",a=i.length,o=0;a>o;o++)n=i[o],n=U.convert(n,r||t||n.getTimezoneOffset(),"Etc/UTC"),i[o]=V.toString(n,"yyyyMMddTHHmmssZ");return r&&(r=";TZID="+r),r+":"+i.join(",")+" "}function E(e,n){var i=e.weekStart,r="FREQ="+e.freq.toUpperCase(),a=e.exdates||"",o=e.start||"",s=e.end||"",l=e.until;return e.interval>1&&(r+=";INTERVAL="+e.interval),e.count&&(r+=";COUNT="+e.count),l&&(l=U.convert(l,n||l.getTimezoneOffset(),"Etc/UTC"),r+=";UNTIL="+V.toString(l,"yyyyMMddTHHmmssZ")),e.months&&(r+=";BYMONTH="+e.months),e.weeks&&(r+=";BYWEEKNO="+e.weeks),e.yearDays&&(r+=";BYYEARDAY="+e.yearDays),e.monthDays&&(r+=";BYMONTHDAY="+e.monthDays),e.weekDays&&(r+=";BYDAY="+h(e.weekDays)),e.hours&&(r+=";BYHOUR="+e.hours),e.minutes&&(r+=";BYMINUTE="+e.minutes),e.seconds&&(r+=";BYSECOND="+e.seconds),e.positions&&(r+=";BYSETPOS="+e.positions),i!==t&&(r+=";WKST="+it[i]),o&&(o="DTSTART"+F(o,n)),s&&(s="DTEND"+F(s,n)),a&&(a="EXDATE"+F(a,n)),(o||s||a)&&(r=o+s+a+"RRULE:"+r),r}var H,A,I,M,R,z,N,O,P,L,B,W,V=window.kendo,U=V.timezone,q=V.Class,j=V.ui,G=j.Widget,Y=j.DropDownList,$=V.date,Q=$.setTime,K=$.setDayOfWeek,J=$.adjustDST,X=$.firstDayOfMonth,Z=$.getMilliseconds,et=[0,31,60,91,121,152,182,213,244,274,305,335,366],tt=[0,31,59,90,120,151,181,212,243,273,304,334,365],nt=[31,28,30,31,30,31,30,31,30,31,30,31],it={0:"SU",1:"MO",2:"TU",3:"WE",4:"TH",5:"FR",6:"SA"},rt={SU:0,MO:1,TU:2,WE:3,TH:4,FR:5,SA:6},at=["yyyy-MM-ddTHH:mm:ss.fffzzz","yyyy-MM-ddTHH:mm:sszzz","yyyy-MM-ddTHH:mm:ss","yyyy-MM-ddTHH:mm","yyyy-MM-ddTHH","yyyy-MM-dd","yyyyMMddTHHmmssfffzzz","yyyyMMddTHHmmsszzz","yyyyMMddTHHmmss","yyyyMMddTHHmm","yyyyMMddTHH","yyyyMMdd"],ot=["months","weeks","yearDays","monthDays","weekDays","hours","minutes","seconds"],st=ot.length,lt="yyyyMMddTHHmmssZ",dt={months:function(e,t,n){var i=n.months,r=u(i,e.getMonth()+1),a=!1;return null!==r&&(r.length?e.setMonth(r[0]-1,1):e.setFullYear(e.getFullYear()+1,i[0]-1,1),a=!0),a},monthDays:function(e,t,n){for(var i,r,a,o=!1,s=e.getHours(),l=function(e){return 0>e&&(e=i+e),e};t>=e;){if(r=e.getMonth(),i=m(e),a=u(n.monthDays,e.getDate(),l),null===a)return o;if(o=!0,a.length){if(e.setMonth(r,a.sort(v)[0]),J(e,s),r===e.getMonth())break}else e.setMonth(r+1,1)}return o},yearDays:function(e,t,n){for(var r,a,o=!1,s=e.getHours(),l=function(e){return 0>e&&(e=r+e),e};t>e;){if(r=g(e)?366:365,a=u(n.yearDays,i(e),l),null===a)return o;if(o=!0,r=e.getFullYear(),a.length){e.setFullYear(r,0,a.sort(v)[0]),J(e,s);break}e.setFullYear(r+1,0,1)}return o},weeks:function(e,t,n){for(var i,a,o,s=n.weekStart,l=!1,d=e.getHours(),c=function(e){return 0>e&&(e=53+e),e};t>e;){if(a=u(n.weeks,r(e,s),c),null===a)return l;if(l=!0,i=e.getFullYear(),a.length){o=7*a.sort(v)[0]-1,e.setFullYear(i,0,o),K(e,s,-1),J(e,d);break}e.setFullYear(i+1,0,1)}return l},weekDays:function(e,t,n){var i,r,o=n.weekDays,s=n.weekStart,u=c(o,e,s),p=e.getHours();if(null===u)return!1;if(i=u[0],i||(i=o[0],K(e,s)),r=i.day,i.offset)for(;t>=e&&!d(e,i,s);)a(e,s)===l(e,s)?(e.setMonth(e.getMonth()+1,1),J(e,p)):(e.setDate(e.getDate()+7),J(e,p),K(e,s,-1));return e.getDay()!==r&&K(e,r),!0},hours:function(e,t,n){var i=n.hours,r=n._startTime,a=r.getHours(),o=u(i,a),s=!1;return null!==o&&(s=!0,e.setHours(a),J(e,a),o.length?(o=o[0],e.setHours(o)):(o=e.getHours(),e.setDate(e.getDate()+1),J(e,o),o=i[0],e.setHours(o),J(e,o)),n.minutes&&e.setMinutes(0),r.setHours(o,e.getMinutes())),s},minutes:function(e,t,n){var i=n.minutes,r=e.getMinutes(),a=u(i,r),o=n._startTime.getHours(),s=!1;return null!==a&&(s=!0,a.length?a=a[0]:(o+=1,a=i[0]),n.seconds&&e.setSeconds(0),e.setHours(o,a),o%=24,J(e,o),n._startTime.setHours(o,a,e.getSeconds())),s},seconds:function(e,t,n){var i=n.seconds,r=n._startTime.getHours(),a=u(i,e.getSeconds()),o=e.getMinutes(),s=!1;return null!==a&&(s=!0,a.length?e.setSeconds(a[0]):(o+=1,e.setMinutes(o,i[0]),o>59&&(o%=60,r=(r+1)%24)),n._startTime.setHours(r,o,e.getSeconds())),s}},ct=q.extend({next:function(e,t){var n,i,r=t._startTime,a=r.getDate();if(t.seconds)i=e.getSeconds()+1,e.setSeconds(i),r.setSeconds(i),r.setDate(a);else{if(!t.minutes)return!1;n=e.getMinutes()+1,e.setMinutes(n),r.setMinutes(n),r.setDate(a)}return!0},normalize:function(e){var t=e.rule;4===e.idx&&t.hours&&(t._startTime.setHours(0),this._hour(e.date,t))},limit:function(e,n,i){for(var r,a,o,s,l,d=i.interval;n>=e;){for(o=a=t,l=e.getDate(),s=0;st>s;s++){if(r=ot[s],i[r]){if(o=dt[r](e,n,i),a!==t&&o)break;a=o}o&&this.normalize({date:e,rule:i,day:l,idx:s})}if((1===d||!this.interval(i,e))&&s===st)break}},interval:function(e,t){var i,a,o=new Date(e._startPeriod),s=new Date(t),l=t.getHours(),d=e.weekStart,c=e.interval,u=e.freq,p=!1,f=0,h=0,m=1;return"hourly"===u?(i=s.getTimezoneOffset()-o.getTimezoneOffset(),a=e._startTime.getHours(),s=s.getTime(),l!==a&&(s+=(a-l)*$.MS_PER_HOUR),s-=o,i&&(s-=i*$.MS_PER_MINUTE),i=Math.floor(s/$.MS_PER_HOUR),f=n(i,c),0!==f&&(this._hour(t,e,f),p=!0)):"daily"===u?($.setTime(s,-o),i=Math.floor(s/$.MS_PER_DAY),f=n(i,c),0!==f&&(this._date(t,e,f),p=!0)):"weekly"===u?(i=52*(t.getFullYear()-o.getFullYear()),f=r(t,d)-r(o,d)+i,f=n(f,c),0!==f&&($.setDayOfWeek(t,e.weekStart,-1),t.setDate(t.getDate()+7*f),J(t,l),p=!0)):"monthly"===u?(i=t.getFullYear()-o.getFullYear(),i=t.getMonth()-o.getMonth()+12*i,f=n(i,c),0!==f&&(m=e._hasRuleValue?1:t.getDate(),t.setFullYear(t.getFullYear(),t.getMonth()+f,m),J(t,l),p=!0)):"yearly"===u&&(i=t.getFullYear()-o.getFullYear(),f=n(i,c),e.months||(h=t.getMonth()),e.yearDays||e.monthDays||e.weekDays||(m=t.getDate()),0!==f&&(t.setFullYear(t.getFullYear()+f,h,m),J(t,l),p=!0)),p},_hour:function(e,t,n){var i=t._startTime,r=i.getHours();n&&(r+=n),e.setHours(r),r%=24,i.setHours(r),J(e,r)},_date:function(e,t,n){var i=e.getHours();e.setDate(e.getDate()+n),J(e,i)||this._hour(e,t)}}),ut=ct.extend({next:function(e,t){ct.fn.next(e,t)||this._hour(e,t,1)},normalize:function(e){var t=e.rule;4===e.idx&&(t._startTime.setHours(0),this._hour(e.date,t))}}),pt=ct.extend({next:function(e,t){ct.fn.next(e,t)||this[t.hours?"_hour":"_date"](e,t,1)}}),ft=pt.extend({setup:function(e,t){e.weekDays||(e.weekDays=[{day:t.getDay(),offset:0}])}}),ht=ct.extend({next:function(e,t){var n,i;if(!ct.fn.next(e,t))if(t.hours)this._hour(e,t,1);else if(t.monthDays||t.weekDays||t.yearDays||t.weeks)this._date(e,t,1);else{for(n=e.getDate(),i=e.getHours(),e.setMonth(e.getMonth()+1),J(e,i);e.getDate()!==n;)e.setDate(n),J(e,i);this._hour(e,t)}},normalize:function(e){var t=e.rule,n=e.date,i=n.getHours();0!==e.idx||t.monthDays||t.weekDays?ct.fn.normalize(e):(n.setDate(e.day),J(n,i))},setup:function(e,t,n){e.monthDays||e.weekDays||n.setDate(t.getDate())}}),mt=ht.extend({next:function(e,t){var n,i=e.getHours();if(!ct.fn.next(e,t))if(t.hours)this._hour(e,t,1);else if(t.monthDays||t.weekDays||t.yearDays||t.weeks)this._date(e,t,1);else if(t.months){for(n=e.getDate(),e.setMonth(e.getMonth()+1),J(e,i);e.getDate()!==n;)e.setDate(n),J(e,i);this._hour(e,t)}else e.setFullYear(e.getFullYear()+1),J(e,i),this._hour(e,t)},setup:function(){}}),gt={hourly:new ut,daily:new pt,weekly:new ft,monthly:new ht,yearly:new mt},vt="click";V.recurrence={rule:{parse:D,serialize:E},expand:C,dayInYear:i,weekInYear:r,weekInMonth:a,numberOfWeeks:l,isException:k,toExceptionString:b},H=function(e){for(var t=V.culture().calendar.days.namesShort,n=t.length,i="",r=0,a=[];n>r;r++)a.push(r);for(t=t.slice(e).concat(t.slice(0,e)),a=a.slice(e).concat(a.slice(0,e)),r=0;n>r;r++)i+='<label class="k-check"><input class="k-recur-weekday-checkbox" type="checkbox" value="'+a[r]+'" /> '+t[r]+"</label>";return i},A=V.template('# if (frequency !== "never") { #<div class="k-edit-label"><label>#:messages.repeatEvery#</label></div><div class="k-edit-field"><input class="k-recur-interval"/>#:messages.interval#</div># } ## if (frequency === "weekly") { #<div class="k-edit-label"><label>#:messages.repeatOn#</label></div><div class="k-edit-field">#=weekDayCheckBoxes(firstWeekDay)#</div># } else if (frequency === "monthly") { #<div class="k-edit-label"><label>#:messages.repeatOn#</label></div><div class="k-edit-field"><ul class="k-reset"><li><label><input class="k-recur-month-radio" type="radio" name="month" value="monthday" />#:messages.day#</label><input class="k-recur-monthday" /></li><li><input class="k-recur-month-radio" type="radio" name="month" value="weekday" /><input class="k-recur-weekday-offset" /><input class="k-recur-weekday" /></li></ul></div># } else if (frequency === "yearly") { #<div class="k-edit-label"><label>#:messages.repeatOn#</label></div><div class="k-edit-field"><ul class="k-reset"><li><input class="k-recur-year-radio" type="radio" name="year" value="monthday" /><input class="k-recur-month" /><input class="k-recur-monthday" /></li><li><input class="k-recur-year-radio" type="radio" name="year" value="weekday" /><input class="k-recur-weekday-offset" /><input class="k-recur-weekday" />#:messages.of#<input class="k-recur-month" /></li></ul></div># } ## if (frequency !== "never") { #<div class="k-edit-label"><label>#:end.label#</label></div><div class="k-edit-field"><ul class="k-reset"><li><label><input class="k-recur-end-never" type="radio" name="end" value="never" />#:end.never#</label></li><li><label><input class="k-recur-end-count" type="radio" name="end" value="count" />#:end.after#</label><input class="k-recur-count" />#:end.occurrence#</li><li><label><input class="k-recur-end-until" type="radio" name="end" value="until" />#:end.on#</label><input class="k-recur-until" /></li></ul></div># } #'),I=[{day:0,offset:0},{day:1,offset:0},{day:2,offset:0},{day:3,offset:0},{day:4,offset:0},{day:5,offset:0},{day:6,offset:0}],M=[{day:1,offset:0},{day:2,offset:0},{day:3,offset:0},{day:4,offset:0},{day:5,offset:0}],R=[{day:0,offset:0},{day:6,offset:0}],z=G.extend({init:function(e,t){var n,i=this,r=t&&t.frequencies;G.fn.init.call(i,e,t),i.wrapper=i.element,t=i.options,t.start=n=t.start||$.today(),r&&(t.frequencies=r),"string"==typeof n&&(t.start=V.parseDate(n,"yyyyMMddTHHmmss")),null===t.firstWeekDay&&(t.firstWeekDay=V.culture().calendar.firstDay),i._namespace="."+t.name},options:{value:"",start:"",timezone:"",spinners:!0,firstWeekDay:null,frequencies:["never","daily","weekly","monthly","yearly"],mobile:!1,messages:{frequencies:{never:"Never",hourly:"Hourly",daily:"Daily",weekly:"Weekly",monthly:"Monthly",yearly:"Yearly"},hourly:{repeatEvery:"Repeat every: ",interval:" hour(s)"},daily:{repeatEvery:"Repeat every: ",interval:" day(s)"},weekly:{interval:" week(s)",repeatEvery:"Repeat every: ",repeatOn:"Repeat on: "},monthly:{repeatEvery:"Repeat every: ",repeatOn:"Repeat on: ",interval:" month(s)",day:"Day "},yearly:{repeatEvery:"Repeat every: ",repeatOn:"Repeat on: ",interval:" year(s)",of:" of "},end:{label:"End:",mobileLabel:"Ends",never:"Never",after:"After ",occurrence:" occurrence(s)",on:"On "},offsetPositions:{first:"first",second:"second",third:"third",fourth:"fourth",last:"last"},weekdays:{day:"day",weekday:"weekday",weekend:"weekend day"}}},events:["change"],_initInterval:function(){var e=this,t=e._value;e._container.find(".k-recur-interval").kendoNumericTextBox({spinners:e.options.spinners,value:t.interval||1,decimals:0,format:"#",min:1,change:function(){t.interval=this.value(),e._trigger()}})},_weekDayRule:function(e){var t=this,n=(t._weekDay.element||t._weekDay).val(),i=+(t._weekDayOffset.element||t._weekDayOffset).val(),r=null,a=null;e||("day"===n?(r=I,a=i):"weekday"===n?(r=M,a=i):"weekend"===n?(r=R,a=i):r=[{offset:i,day:+n}]),t._value.weekDays=r,t._value.positions=a},_weekDayView:function(){var e,t,n,i,r=this,a=r._value.weekDays,o=r._value.positions,s=r._weekDayOffset;a&&(n=a.length,o&&(7===n?(t="day",e=o):5===n?(t="weekday",e=o):2===n&&(t="weekend",e=o)),t||(a=a[0],t=a.day,e=a.offset||""),i=s.value?"value":"val",s[i](e),r._weekDay[i](t))},_initWeekDay:function(){var t,n=this,i=n.options.messages.weekdays,r=n.options.messages.offsetPositions,a=n._container.find(".k-recur-weekday"),o=function(){n._weekDayRule(),n._trigger()};a[0]&&(n._weekDayOffset=new Y(n._container.find(".k-recur-weekday-offset"),{change:o,dataTextField:"text",dataValueField:"value",dataSource:[{text:r.first,value:"1"},{text:r.second,value:"2"},{text:r.third,value:"3"},{text:r.fourth,value:"4"},{text:r.last,value:"-1"}]}),t=[{text:i.day,value:"day"},{text:i.weekday,value:"weekday"},{text:i.weekend,value:"weekend"}],n._weekDay=new Y(a,{value:n.options.start.getDay(),change:o,dataTextField:"text",dataValueField:"value",dataSource:t.concat(e.map(V.culture().calendar.days.names,function(e,t){return{text:e,value:t}}))}),n._weekDayView())},_initWeekDays:function(){var t,n,i,r,a,o=this,s=o._value,l=o._container.find(".k-recur-weekday-checkbox");if(l[0]&&(l.on(vt+o._namespace,function(){s.weekDays=e.map(l.filter(":checked"),function(e){return{day:+e.value,offset:0}}),o.options.mobile||o._trigger()}),s.weekDays))for(i=0,r=l.length,a=s.weekDays.length;r>i;i++)for(n=l[i],t=0;a>t;t++)n.value==s.weekDays[t].day&&(n.checked=!0)},_initMonthDay:function(){var e=this,t=e._value,n=e._container.find(".k-recur-monthday");n[0]&&(e._monthDay=new V.ui.NumericTextBox(n,{spinners:e.options.spinners,min:1,max:31,decimals:0,format:"#",value:t.monthDays?t.monthDays[0]:e.options.start.getDate(),change:function(){var n=this.value();t.monthDays=n?[n]:n,e._trigger()}}))},_initCount:function(){var e=this,t=e._container.find(".k-recur-count"),n=e._value;e._count=t.kendoNumericTextBox({spinners:e.options.spinners,value:n.count||1,decimals:0,format:"#",min:1,change:function(){n.count=this.value(),e._trigger()}}).data("kendoNumericTextBox")},_initUntil:function(){var e=this,t=e._container.find(".k-recur-until"),n=e.options.start,i=e._value,r=i.until;e._until=t.kendoDatePicker({min:r&&n>r?r:n,value:r||n,change:function(){i.until=this.value(),e._trigger()}}).data("kendoDatePicker")},_trigger:function(){this.options.mobile||this.trigger("change")}}),N=z.extend({init:function(e,t){var n=this;z.fn.init.call(n,e,t),n._initFrequency(),n._initContainer(),n.value(n.options.value)},options:{name:"RecurrenceEditor"},events:["change"],destroy:function(){var e=this;e._frequency.destroy(),e._container.find("input[type=radio],input[type=checkbox]").off(vt+e._namespace),V.destroy(e._container),z.fn.destroy.call(e)},value:function(e){var n=this,i=n.options.timezone;return e===t?n._value.freq?E(n._value,i):"":(n._value=D(e,i)||{},n._frequency.value(n._value.freq||""),n._initView(n._frequency.value()),t)},_initContainer:function(){var t=this.element,n=e('<div class="k-recur-view" />'),i=t.parent(".k-edit-field");i[0]?n.insertAfter(i):t.append(n),this._container=n},_initFrequency:function(){var t,n=this,i=n.options,r=i.frequencies,a=i.messages.frequencies,o=e("<input />");r=e.map(r,function(e){return{text:a[e],value:e}}),t=r[0],t&&"never"===t.value&&(t.value=""),n.element.append(o),n._frequency=new Y(o,{dataTextField:"text",dataValueField:"value",dataSource:r,change:function(){n._value={},n._initView(n._frequency.value()),n.trigger("change")}})},_initView:function(e){var n=this,i=n._value,r=n.options,a={frequency:e||"never",weekDayCheckBoxes:H,firstWeekDay:r.firstWeekDay,messages:r.messages[e],end:r.messages.end};return V.destroy(n._container),n._container.html(A(a)),e?(i.freq=e,"weekly"!==e||i.weekDays||(i.weekDays=[{day:r.start.getDay(),offset:0}]),n._initInterval(),n._initWeekDays(),n._initMonthDay(),n._initWeekDay(),n._initMonth(),n._initCount(),n._initUntil(),n._period(),n._end(),t):(n._value={},t)},_initMonth:function(){var t,n=this,i=n._value,r=i.months||[n.options.start.getMonth()+1],a=n._container.find(".k-recur-month");a[0]&&(t={change:function(){i.months=[+this.value()],n.trigger("change")},dataTextField:"text",dataValueField:"value",dataSource:e.map(V.culture().calendar.months.names,function(e,t){return{text:e,value:t+1}})},n._month1=new Y(a[0],t),n._month2=new Y(a[1],t),r&&(r=r[0],n._month1.value(r),n._month2.value(r)))},_end:function(){var e,t=this,n=t._value,i=t._container,r=t._namespace,a=function(e){t._toggleEnd(e.currentTarget.value),t.trigger("change")};t._buttonNever=i.find(".k-recur-end-never").on(vt+r,a),t._buttonCount=i.find(".k-recur-end-count").on(vt+r,a),t._buttonUntil=i.find(".k-recur-end-until").on(vt+r,a),n.count?e="count":n.until&&(e="until"),t._toggleEnd(e)},_period:function(){var e=this,t=e._value,n="monthly"===t.freq,i=n?e._toggleMonthDay:e._toggleYear,r=".k-recur-"+(n?"month":"year")+"-radio",a=e._container.find(r);(n||"yearly"===t.freq)&&(a.on(vt+e._namespace,function(t){i.call(e,t.currentTarget.value),e.trigger("change")}),e._buttonMonthDay=a.eq(0),e._buttonWeekDay=a.eq(1),i.call(e,t.weekDays?"weekday":"monthday"))},_toggleEnd:function(e){var t,n,i,r,a=this;"count"===e?(a._buttonCount.prop("checked",!0),i=!0,r=!1,t=a._count.value(),n=null):"until"===e?(a._buttonUntil.prop("checked",!0),i=!1,r=!0,t=null,n=a._until.value()):(a._buttonNever.prop("checked",!0),i=r=!1,t=n=null),a._count.enable(i),a._until.enable(r),a._value.count=t,a._value.until=n},_toggleMonthDay:function(e){var t,n=this,i=!1,r=!0,a=!1;"monthday"===e?(n._buttonMonthDay.prop("checked",!0),t=[n._monthDay.value()],i=!0,r=!1,a=!0):(n._buttonWeekDay.prop("checked",!0),t=null),n._weekDay.enable(r),n._weekDayOffset.enable(r),n._monthDay.enable(i),n._value.monthDays=t,n._weekDayRule(a)},_toggleYear:function(e){var t,n=this,i=!1,r=!0;"monthday"===e?(i=!0,r=!1,t=n._month1.value()):t=n._month2.value(),n._month1.enable(i),n._month2.enable(r),n._value.months=[t],n._toggleMonthDay(e)}}),j.plugin(N),O=V.template('<div class="k-edit-label"><label>#:headerTitle#</label></div><div class="k-edit-field k-recur-pattern k-scheduler-toolbar"></div><div class="k-recur-view"></div>'),P=V.template('# if (frequency !== "never") { #<div class="k-edit-label"><label>#:messages.repeatEvery#</label></div><div class="k-edit-field"><input class="k-recur-interval" pattern="\\\\d*"/>#:messages.interval#</div># } ## if (frequency === "weekly") { #<div class="k-edit-label"><label>#:messages.repeatOn#</label></div><div class="k-edit-field">#=weekDayCheckBoxes(firstWeekDay)#</div># } else if (frequency === "monthly") { #<div class="k-edit-label"><label>#:messages.repeatBy#</label></div><div class="k-edit-field k-scheduler-toolbar k-repeat-rule"></div><div class="k-monthday-view" style="display:none"><div class="k-edit-label"><label>#:messages.day#</label></div><div class="k-edit-field"><input class="k-recur-monthday" pattern="\\\\d*"/></div></div><div class="k-weekday-view" style="display:none"><div class="k-edit-label"><label>#:messages.every#</label></div><div class="k-edit-field"><select class="k-recur-weekday-offset"></select></div><div class="k-edit-label"><label>#:messages.day#</label></div><div class="k-edit-field"><select class="k-recur-weekday"></select></div></div># } else if (frequency === "yearly") { #<div class="k-edit-label"><label>#:messages.repeatBy#</label></div><div class="k-edit-field k-scheduler-toolbar k-repeat-rule"></div><div class="k-monthday-view" style="display:none"><div class="k-edit-label"><label>#:messages.day#</label></div><div class="k-edit-field"><input class="k-recur-monthday" pattern="\\\\d*"/></div></div><div class="k-weekday-view" style="display:none"><div class="k-edit-label"><label>#:messages.every#</label></div><div class="k-edit-field"><select class="k-recur-weekday-offset"></select></div><div class="k-edit-label"><label>#:messages.day#</label></div><div class="k-edit-field"><select class="k-recur-weekday"></select></div></div><div class="k-edit-label"><label>#:messages.month#</label></div><div class="k-edit-field"><select class="k-recur-month"></select></div># } #'),L=V.template('# if (endPattern === "count") { #<div class="k-edit-label"><label>#:messages.after#</label></div><div class="k-edit-field"><input class="k-recur-count" pattern="\\\\d*" /></div># } else if (endPattern === "until") { #<div class="k-edit-label"><label>#:messages.on#</label></div><div class="k-edit-field"><input type="date" class="k-recur-until" /></div># } #'),B=V.template('<ul class="k-reset k-header k-toolbar k-scheduler-navigation">#for (var i = 0, length = dataSource.length; i < length; i++) {#<li class="k-state-default #= value === dataSource[i].value ? "k-state-selected" : "" #"><a role="button" href="\\#" class="k-link" data-#=ns#value="#=dataSource[i].value#">#:dataSource[i].text#</a></li>#}#</ul>'),W=z.extend({init:function(e,t){var n=this;
z.fn.init.call(n,e,t),t=n.options,n._optionTemplate=V.template('<option value="#:value#">#:text#</option>'),n.value(t.value),n._pane=t.pane,n._initRepeatButton(),n._initRepeatEnd(),n._defaultValue=n._value},options:{name:"MobileRecurrenceEditor",animations:{left:"slide",right:"slide:right"},mobile:!0,messages:{cancel:"Cancel",update:"Save",endTitle:"Repeat ends",repeatTitle:"Repeat pattern",headerTitle:"Repeat event",end:{patterns:{never:"Never",after:"After...",on:"On..."},never:"Never",after:"End repeat after",on:"End repeat on"},daily:{interval:""},hourly:{interval:""},weekly:{interval:""},monthly:{interval:"",repeatBy:"Repeat by: ",dayOfMonth:"Day of the month",dayOfWeek:"Day of the week",repeatEvery:"Repeat every",every:"Every",day:"Day "},yearly:{interval:"",repeatBy:"Repeat by: ",dayOfMonth:"Day of the month",dayOfWeek:"Day of the week",repeatEvery:"Repeat every: ",every:"Every",month:"Month",day:"Day"}}},events:["change"],value:function(e){var n=this,i=n.options.timezone;return e===t?n._value.freq?E(n._value,i):"":(n._value=D(e,i)||{},t)},destroy:function(){this._destroyView(),V.destroy(this._endFields),this._repeatButton.off(vt+this._namespace),z.fn.destroy.call(this)},_initRepeatButton:function(){var t=this,n=t.options.messages.frequencies[this._value.freq||"never"];t._repeatButton=e('<a href="#" class="k-button k-scheduler-recur">'+n+"</a>").on(vt+t._namespace,function(e){e.preventDefault(),t._createView("repeat"),t._pane.navigate("recurrence",t.options.animations.left)}),t.element.append(t._repeatButton)},_initRepeatEnd:function(){var t=this,n=e('<div class="k-edit-label"><label>'+t.options.messages.end.mobileLabel+"</label></div>").insertAfter(t.element.parent(".k-edit-field")),i=e('<div class="k-edit-field"><a href="#" class="k-button k-scheduler-recur-end"></a></div>').on(vt+t._namespace,function(e){e.preventDefault(),t._value.freq&&(t._createView("end"),t._pane.navigate("recurrence",t.options.animations.left))}).insertAfter(n);t._endFields=n.add(i).toggleClass("k-state-disabled",!t._value.freq),t._endButton=i.find(".k-scheduler-recur-end").text(t._endText())},_endText:function(){var e=this._value,t=this.options.messages.end,n=t.never;return e.count?n=V.format("{0} {1}",t.after,e.count):e.until&&(n=V.format("{0} {1:d}",t.on,e.until)),n},_initFrequency:function(){var t=this,n=t.options.messages.frequencies,i=B({dataSource:e.map(this.options.frequencies,function(e){return{text:n[e],value:"never"!==e?e:""}}),value:t._value.freq||"",ns:V.ns});t._view.element.find(".k-recur-pattern").append(i).on(vt+t._namespace,".k-scheduler-navigation li",function(n){var i=e(this);n.preventDefault(),i.addClass("k-state-selected").siblings().removeClass("k-state-selected"),t._value={freq:i.children("a").attr(V.attr("value"))},t._initRepeatView()})},_initEndNavigation:function(){var t,n=this,i=n.options.messages.end.patterns,r=n._value,a="";r.count?a="count":r.until&&(a="until"),t=B({dataSource:[{text:i.never,value:""},{text:i.after,value:"count"},{text:i.on,value:"until"}],value:a,ns:V.ns}),n._view.element.find(".k-recur-pattern").append(t).on(vt+n._namespace,".k-scheduler-navigation li",function(t){var i=e(this),a=null,o=null;t.preventDefault(),i.addClass("k-state-selected").siblings().removeClass("k-state-selected"),n._initEndView(i.children("a").attr(V.attr("value"))),n._count?(a=n._count.value(),o=null):n._until&&(a=null,o=n._until.val?V.parseDate(n._until.val(),"yyyy-MM-dd"):n._until.value()),r.count=a,r.until=o})},_createView:function(t){var n=this,i=n.options,r=i.messages,a=r["repeat"===t?"repeatTitle":"endTitle"],o='<div data-role="view" class="k-popup-edit-form k-scheduler-edit-form k-mobile-list" id="recurrence"><div data-role="header" class="k-header"><a href="#" class="k-button k-scheduler-cancel">'+r.cancel+"</a>"+r.headerTitle+'<a href="#" class="k-button k-scheduler-update">'+r.update+"</a></div>",s=n._pane.view().id;n._view=n._pane.append(o+O({headerTitle:a})),n._view.element.on(vt+n._namespace,"a.k-scheduler-cancel, a.k-scheduler-update",function(t){t.preventDefault(),t.stopPropagation(),e(this).hasClass("k-scheduler-update")?(n.trigger("change"),n._defaultValue=e.extend({},n._value)):n._value=n._defaultValue;var i=n._value.freq;n._endButton.text(n._endText()),n._endFields.toggleClass("k-state-disabled",!i),n._repeatButton.text(r.frequencies[i||"never"]),n._pane.one("viewShow",function(){n._destroyView()}),n._pane.navigate(s,n.options.animations.right)}),n._container=n._view.element.find(".k-recur-view"),"repeat"===t?(n._initFrequency(),n._initRepeatView()):(n._initEndNavigation(),n._initEndView())},_destroyView:function(){this._view&&(this._view.destroy(),this._view.element.remove()),this._view=null},_initRepeatView:function(){var e=this,n=e._value.freq||"never",i={frequency:n,weekDayCheckBoxes:H,firstWeekDay:e.options.firstWeekDay,messages:e.options.messages[n]},r=P(i),a=e._container,o=e._value;return V.destroy(a),a.html(r),r?("weekly"!==n||o.weekDays||(o.weekDays=[{day:e.options.start.getDay(),offset:0}]),e._initInterval(),e._initMonthDay(),e._initWeekDays(),e._initWeekDay(),e._initMonth(),e._period(),t):(e._value={},t)},_initEndView:function(e){var n,i=this,r=i._value;e===t&&(r.count?e="count":r.until&&(e="until")),n={endPattern:e,messages:i.options.messages.end},V.destroy(i._container),i._container.html(L(n)),i._initCount(),i._initUntil()},_initWeekDay:function(){var t,n=this,i=n.options.messages.weekdays,r=n.options.messages.offsetPositions,a=n._container.find(".k-recur-weekday"),o=function(){n._weekDayRule(),n.trigger("change")};a[0]&&(n._weekDayOffset=n._container.find(".k-recur-weekday-offset").html(n._options([{text:r.first,value:"1"},{text:r.second,value:"2"},{text:r.third,value:"3"},{text:r.fourth,value:"4"},{text:r.last,value:"-1"}])).change(o),t=[{text:i.day,value:"day"},{text:i.weekday,value:"weekday"},{text:i.weekend,value:"weekend"}],t=t.concat(e.map(V.culture().calendar.days.names,function(e,t){return{text:e,value:t}})),n._weekDay=a.html(n._options(t)).change(o).val(n.options.start.getDay()),n._weekDayView())},_initMonth:function(){var t,n=this,i=n._value,r=n.options.start,a=i.months||[r.getMonth()+1],o=n._container.find(".k-recur-month"),s=V.culture().calendar.months.names;o[0]&&(t=e.map(s,function(e,t){return{text:e,value:t+1}}),o.html(n._options(t)).change(function(){i.months=[+this.value]}),n._monthSelect=o,a&&o.val(a[0]))},_period:function(){var t,n,i,r=this,a=r._value,o=r._container,s=r.options.messages[a.freq],l=o.find(".k-repeat-rule"),d=o.find(".k-weekday-view"),c=o.find(".k-monthday-view");l[0]&&(t=a.weekDays?"weekday":"monthday",n=B({value:t,dataSource:[{text:s.dayOfMonth,value:"monthday"},{text:s.dayOfWeek,value:"weekday"}],ns:V.ns}),i=function(e){var t=r._weekDay.val(),n=r._weekDayOffset.val(),i=r._monthDay.value(),o=r._monthSelect?r._monthSelect.val():null;"monthday"===e?(a.weekDays=null,a.monthDays=i?[i]:i,a.months=o?[+o]:o,d.hide(),c.show()):(a.monthDays=null,a.months=o?[+o]:o,a.weekDays=[{offset:+n,day:+t}],d.show(),c.hide())},l.append(n).on(vt+r._namespace,".k-scheduler-navigation li",function(t){var n,r=e(this).addClass("k-state-selected");t.preventDefault(),r.siblings().removeClass("k-state-selected"),n=r.children("a").attr(V.attr("value")),i(n)}),i(t))},_initUntil:function(){var e=this,t=e._container.find(".k-recur-until"),n=e.options.start,i=e._value,r=i.until,a=r&&n>r?r:n;e._until=V.support.input.date?t.attr("min",V.toString(a,"yyyy-MM-dd")).val(V.toString(r||n,"yyyy-MM-dd")).on("change",function(){i.until=V.parseDate(this.value,"yyyy-MM-dd")}):t.kendoDatePicker({min:a,value:r||n,change:function(){i.until=this.value()}}).data("kendoDatePicker")},_options:function(e,t){var n=0,i="",r=e.length,a=this._optionTemplate;for(t&&(i+=a({value:"",text:t}));r>n;n++)i+=a(e[n]);return i}}),j.plugin(W)})(window.kendo.jQuery);(function(e,t){function n(e,t){return t=t||"",e.startTimezone&&(t=e.startTimezone,e.endTimezone&&(t+=" | "+e.endTimezone)),t}function i(e,t){var n=t.timezone;n&&(e[F.attr("timezone")]=n)}function r(e,t){var n,i=t.model.fields[t.field].validation;i&&(n=i.dateCompare,n&&V(n)&&n.message&&(e[F.attr("dateCompare-msg")]=n.message))}function a(e,t){return function(n){return n=e(n),s(n,"apply",t),n||[]}}function o(e,t){return function(n){return n&&("[object Array]"===j.call(n)||n instanceof F.data.ObservableArray||(n=[n])),s(n,"remove",t,!0),n=e(n),n||[]}}function s(e,t,n,i){var r,a,o;for(e=e||[],a=0,o=e.length;o>a;a++)r=e[a],i?r.startTimezone||r.endTimezone?n?(r.start=F.timezone.convert(r.start,r.startTimezone||r.endTimezone,n),r.end=F.timezone.convert(r.end,r.endTimezone||r.startTimezone,n),r.start=F.timezone[t](r.start,n),r.end=F.timezone[t](r.end,n)):(r.start=F.timezone[t](r.start,r.startTimezone||r.endTimezone),r.end=F.timezone[t](r.end,r.endTimezone||r.startTimezone)):n&&(r.start=F.timezone[t](r.start,n),r.end=F.timezone[t](r.end,n)):r.startTimezone||r.endTimezone?(r.start=F.timezone[t](r.start,r.startTimezone||r.endTimezone),r.end=F.timezone[t](r.end,r.endTimezone||r.startTimezone),n&&(r.start=F.timezone.convert(r.start,r.startTimezone||r.endTimezone,n),r.end=F.timezone.convert(r.end,r.endTimezone||r.startTimezone,n))):n&&(r.start=F.timezone[t](r.start,n),r.end=F.timezone[t](r.end,n)),i&&delete r.uid;return e}function l(e,t){for(var n,i=e.length,r=0;i>r;r++)if(n=e[r],n.uid===t)return n}function d(e,t,n){return e=n?F.timezone.convert(e,t,n):F.timezone.remove(e,t)}function c(e){var t,n,i,r,a,o,s,l,c,u,p,f;return e.filter("[name=end]").length&&(t=e.closest(".k-scheduler-edit-form"),n=t.find("[name=start]:visible"),i=t.find("[name=end]:visible"),i[0]&&n[0]&&(o=F.widgetInstance(n,F.ui),s=F.widgetInstance(i,F.ui),l=t.data("kendoEditable"),c=l?l.options.model:null,o&&s?(r=o.value(),a=s.value()):(r=F.parseDate(n.val()),a=F.parseDate(i.val())),r&&a))?(c&&(u=n.attr(F.attr("timezone")),p=c.startTimezone,f=c.endTimezone,p=p||f,f=f||p,p&&(r=d(r,p,u),a=d(a,f,u))),a>=r):!0}function u(e,t,n,i){for(var r=e.length,a=[],o=0;r>o;o++)a=a.concat(e[o].expand(t,n,i));return a}function p(e){return delete e.name,delete e.prefix,delete e.remove,delete e.edit,delete e.add,delete e.navigate,e}function f(t){return function(n){e(F.format('<select data-{0}bind="value:{1}">',F.ns,t.field)).appendTo(n).kendoDropDownList({dataTextField:t.dataTextField,dataValueField:t.dataValueField,dataSource:t.dataSource,valuePrimitive:t.valuePrimitive,optionLabel:"None",template:F.format('<span class="k-scheduler-mark" style="background-color:#= data.{0}?{0}:"none" #"></span>#={1}#',t.dataColorField,t.dataTextField)})}}function h(t){return function(n){e(F.format('<select data-{0}bind="value:{1}">',F.ns,t.field)).appendTo(n).kendoMultiSelect({dataTextField:t.dataTextField,dataValueField:t.dataValueField,dataSource:t.dataSource,valuePrimitive:t.valuePrimitive,itemTemplate:F.format('<span class="k-scheduler-mark" style="background-color:#= data.{0}?{0}:"none" #"></span>#={1}#',t.dataColorField,t.dataTextField),tagTemplate:F.format('<span class="k-scheduler-mark" style="background-color:#= data.{0}?{0}:"none" #"></span>#={1}#',t.dataColorField,t.dataTextField)})}}function m(t){return function(n){var i,r,a="",o=t.dataSource.view();for(i=0,r=o.length;r>i;i++)a+=F.format('<option value="{0}">{1}</option>',F.getter(t.dataValueField)(o[i]),F.getter(t.dataTextField)(o[i]));e(F.format('<select data-{0}bind="value:{1}" multiple="multiple" data-{0}value-primitive="{3}">{2}</select>',F.ns,t.field,a,t.valuePrimitive)).appendTo(n)}}function g(e,t){var n,i=e.end.getTime()-e.start.getTime(),r=new Date(e.start.getTime());return F.date.setTime(r,t),n=new Date(r.getTime()),F.date.setTime(n,i,!0),{start:r,end:n}}var v,_,k,b,y,w,x,C,T,S,D,F=window.kendo,E=F.date,z=F.support.input,H=E.MS_PER_DAY,A=E.getDate,I=F.date.getMilliseconds,M=F.recurrence,R=F.keys,N=F.ui,O=N.Widget,P="string",L=N.Popup,B=N.Calendar,W=F.data.DataSource,V=e.isPlainObject,U=e.extend,q=e.proxy,j=Object.prototype.toString,G=e.isArray,Y=".kendoScheduler",$="click",K="change",Q="cancel",J="remove",X="save",Z="add",et="edit",tt=/(?:value:start|value:end)(?:,|$)/,nt=A(new Date),it="recurrenceException",rt="Are you sure you want to delete this event?",at="Do you want to delete only this event occurrence or the whole series?",ot="Do you want to edit only this event occurrence or the whole series?",st='<a class="k-button #=className#" #=attr# href="\\#">#=text#</a>',lt=F.template('<div class="k-floatwrap k-header k-scheduler-toolbar"><ul class="k-reset k-header k-toolbar k-scheduler-navigation"><li class="k-state-default k-nav-today"><a role="button" href="\\#" class="k-link">${messages.today}</a></li><li class="k-state-default k-nav-prev"><a role="button" href="\\#" class="k-link"><span class="k-icon k-i-arrow-w"></span></a></li><li class="k-state-default k-nav-next"><a role="button" href="\\#" class="k-link"><span class="k-icon k-i-arrow-e"></span></a></li><li class="k-state-default k-nav-current"><a role="button" href="\\#" class="k-link"><span class="k-icon k-i-calendar"></span><span data-#=ns#bind="text: formattedDate"></span></a></li></ul><ul class="k-reset k-header k-toolbar k-scheduler-views">#for(var view in views){#<li class="k-state-default k-view-#= view.toLowerCase() #" data-#=ns#name="#=view#"><a role="button" href="\\#" class="k-link">${views[view].title}</a></li>#}#</ul></div>'),dt=F.template('<div class="k-floatwrap k-header k-scheduler-toolbar"><ul class="k-reset k-header k-toolbar k-scheduler-navigation"><li class="k-state-default k-nav-today"><a role="button" href="\\#" class="k-link">${messages.today}</a></li></ul><ul class="k-reset k-header k-toolbar k-scheduler-views">#for(var view in views){#<li class="k-state-default k-view-#= view.toLowerCase() #" data-#=ns#name="#=view#"><a role="button" href="\\#" class="k-link">${views[view].title}</a></li>#}#</ul></div><div class="k-floatwrap k-header k-scheduler-toolbar"><ul class="k-reset k-header k-toolbar k-scheduler-navigation"><li class="k-state-default k-nav-prev"><a role="button" href="\\#" class="k-link"><span class="k-icon k-i-arrow-w"></span></a></li><li class="k-state-default k-nav-current"><span data-#=ns#bind="text: formattedDate"></span></li><li class="k-state-default k-nav-next"><a role="button" href="\\#" class="k-link"><span class="k-icon k-i-arrow-e"></span></a></li></ul></div>'),ct=function(t,n){var a={name:n.field},o=z.date?"":F.attr("role")+'="datepicker" ',s=F.attr("role")+'="datetimepicker" ',l=n.model.isAllDay,d=F.attr("validate")+"='"+!l+"'",c=F.attr("validate")+"='"+l+"'";i(a,n),r(a,n),e('<input type="datetime-local" required '+F.attr("type")+'="date" '+s+F.attr("bind")+'="value:'+n.field+',invisible:isAllDay" '+d+"/>").attr(a).appendTo(t),e('<input type="date" required '+F.attr("type")+'="date" '+o+F.attr("bind")+'="value:'+n.field+',visible:isAllDay" '+c+"/>").attr(a).appendTo(t),e("<span "+F.attr("for")+'="'+n.field+'" class="k-invalid-msg"/>').hide().appendTo(t)},ut=function(t,n){var a={name:n.field},o=n.model.isAllDay,s=F.attr("validate")+"='"+!o+"' ",l=F.attr("validate")+"='"+o+"' ";i(a,n),r(a,n),e('<input type="text" required '+F.attr("type")+'="date" '+F.attr("role")+'="datetimepicker" '+F.attr("bind")+'="value:'+n.field+',invisible:isAllDay" '+s+"/>").attr(a).appendTo(t),e('<input type="text" required '+F.attr("type")+'="date" '+F.attr("role")+'="datepicker" '+F.attr("bind")+'="value:'+n.field+',visible:isAllDay" '+l+"/>").attr(a).appendTo(t),e("<span "+F.attr("bind")+'="text: '+n.field+'Timezone"></span>').appendTo(t),"end"===n.field&&e("<span "+F.attr("bind")+'="text: startTimezone, invisible: endTimezone"></span>').appendTo(t),e("<span "+F.attr("for")+'="'+n.field+'" class="k-invalid-msg"/>').hide().appendTo(t)},pt=function(t,n){e("<div "+F.attr("bind")+'="value:'+n.field+'" />').attr({name:n.field}).appendTo(t).kendoRecurrenceEditor({start:n.model.start,timezone:n.timezone,messages:n.messages})},ft=function(t,n){e("<div "+F.attr("bind")+'="value:'+n.field+'" />').attr({name:n.field}).appendTo(t).kendoMobileRecurrenceEditor({start:n.model.start,timezone:n.timezone,messages:n.messages,pane:n.pane,value:n.model[n.field]})},ht=function(t,i){var r=n(i.model,i.messages.noTimezone);e('<a href="#" class="k-button k-timezone-button" data-bind="invisible:isAllDay">'+r+"</a>").click(i.click).appendTo(t)},mt=function(t,n){e('<a href="#" class="k-button" data-bind="invisible:isAllDay">'+n.messages.timezoneEditorButton+"</a>").click(n.click).appendTo(t)},gt=function(t,n){e("<div "+F.attr("bind")+'="value:'+n.field+'" />').attr({name:n.field}).toggle(n.visible).appendTo(t).kendoMobileTimezoneEditor({optionLabel:n.noTimezone})},vt=function(t,n){e("<div "+F.attr("bind")+'="value:'+n.field+'" />').attr({name:n.field}).toggle(n.visible).appendTo(t).kendoTimezoneEditor({optionLabel:n.noTimezone})},_t=F.Class.extend({init:function(t,n){var i=t.timezone;this.reader=n,n.model&&(this.model=n.model),this.timezone=i,this.data=a(e.proxy(this.data,this),i),this.serialize=o(e.proxy(this.serialize,this),i)},errors:function(e){return this.reader.errors(e)},parse:function(e){return this.reader.parse(e)},data:function(e){return this.reader.data(e)},total:function(e){return this.reader.total(e)},groups:function(e){return this.reader.groups(e)},aggregates:function(e){return this.reader.aggregates(e)},serialize:function(e){return this.reader.serialize(e)}}),kt=F.data.Model.define({init:function(e){var t=this;F.data.Model.fn.init.call(t,e),t._defaultId=t.defaults[t.idField]},_time:function(e){var t=this[e],n=e+"Time";return this[n]?this[n]-F.date.toUtcTime(F.date.getDate(t)):I(t)},_date:function(e){var t=e+"Time";return this[t]?this[t]-this._time(e):F.date.getDate(this[e])},clone:function(t,n){var i=this.uid,r=new this.constructor(e.extend({},this.toJSON(),t));return n||(r.uid=i),r},duration:function(){var e=this.end,t=this.start,n=(e.getTimezoneOffset()-t.getTimezoneOffset())*F.date.MS_PER_MINUTE;return e-t-n},expand:function(e,t,n){return M?M.expand(this,e,t,n):[this]},update:function(e){for(var t in e)this.set(t,e[t]);this.startTime&&this.set("startTime",F.date.toUtcTime(this.start)),this.endTime&&this.set("endTime",F.date.toUtcTime(this.end))},isMultiDay:function(){return this.isAllDay||this.duration()>=F.date.MS_PER_DAY},isException:function(){return!this.isNew()&&this.recurrenceId},isOccurrence:function(){return this.isNew()&&this.recurrenceId},isRecurring:function(){return!(!this.recurrenceRule&&!this.recurrenceId)},isRecurrenceHead:function(){return!(!this.id||!this.recurrenceRule)},toOccurrence:function(t){return t=e.extend(t,{recurrenceException:null,recurrenceRule:null,recurrenceId:this.id||this.recurrenceId}),t[this.idField]=this.defaults[this.idField],this.clone(t,!0)},toJSON:function(){var e=F.data.Model.fn.toJSON.call(this);return e.uid=this.uid,delete e.startTime,delete e.endTime,e},shouldSerialize:function(e){return F.data.Model.fn.shouldSerialize.call(this,e)&&"_defaultId"!==e},set:function(e,t){var n,i,r,a=this.isAllDay||!1;F.data.Model.fn.set.call(this,e,t),"isAllDay"==e&&t!=a&&(n=F.date.getDate(this.start),i=new Date(this.end),r=F.date.getMilliseconds(i),0===r&&t&&(r=H),this.set("start",n),t===!0?(F.date.setTime(i,-r),n>i&&(i=n)):F.date.setTime(i,H-r),this.set("end",i))},id:"id",fields:{id:{type:"number"},title:{defaultValue:"",type:"string"},start:{type:"date",validation:{required:!0}},startTimezone:{type:"string"},end:{type:"date",validation:{required:!0,dateCompare:{value:c,message:"End date should be greater than or equal to the start date"}}},endTimezone:{type:"string"},recurrenceRule:{defaultValue:"",type:"string"},recurrenceException:{defaultValue:"",type:"string"},isAllDay:{type:"boolean",defaultValue:!1},description:{type:"string"}}}),bt=W.extend({init:function(e){W.fn.init.call(this,U(!0,{},{schema:{modelBase:kt,model:kt}},e)),this.reader=new _t(this.options.schema,this.reader)},expand:function(e,t){var n=this.view(),i={};return e&&t&&(t=new Date(t.getTime()+H-1),i={logic:"or",filters:[{logic:"and",filters:[{field:"start",operator:"gte",value:e},{field:"end",operator:"gte",value:e},{field:"start",operator:"lte",value:t}]},{logic:"and",filters:[{field:"start",operator:"lte",value:new Date(e.getTime()+H-1)},{field:"end",operator:"gte",value:e}]}]},n=new F.data.Query(u(n,e,t,this.reader.timezone)).filter(i).toArray()),n},cancelChanges:function(e){e&&e.isOccurrence()&&this._removeExceptionDate(e),W.fn.cancelChanges.call(this,e)},insert:function(e,t){if(t){if(!(t instanceof kt)){var n=t;t=this._createNewModel(),t.accept(n)}return(t.isRecurrenceHead()||t.recurrenceId)&&(t=t.recurrenceId?t:t.toOccurrence(),this._addExceptionDate(t)),W.fn.insert.call(this,e,t)}},remove:function(e){return e.isRecurrenceHead()?this._removeExceptions(e):e.isRecurring()&&this._addExceptionDate(e),W.fn.remove.call(this,e)},_removeExceptions:function(e){for(var t=this.data().slice(0),n=t.shift(),i=e.id;n;)n.recurrenceId===i&&W.fn.remove.call(this,n),n=t.shift();e.set(it,"")},_removeExceptionDate:function(e){var t,n;e.recurrenceId&&(t=this.get(e.recurrenceId),t&&(n=e.start,t.set(it,t.recurrenceException.replace(M.toExceptionString(n,this.reader.timezone),""))))},_addExceptionDate:function(e){var t=e.start,n=this.reader.timezone,i=this.get(e.recurrenceId),r=i.recurrenceException||"";M.isException(r,t,n)||i.set(it,r+M.toExceptionString(t,n))}});bt.create=function(e){e=e&&e.push?{data:e}:e;var t=e||{},n=t.data;if(t.data=n,!(t instanceof bt)&&t instanceof F.data.DataSource)throw Error("Incorrect DataSource type. Only SchedulerDataSource instances are supported");return t instanceof bt?t:new bt(t)},U(!0,F.data,{SchedulerDataSource:bt,SchedulerDataReader:_t,SchedulerEvent:kt}),v={update:{text:"Save",className:"k-primary k-scheduler-update"},canceledit:{text:"Cancel",className:"k-scheduler-cancel"},destroy:{text:"Delete",imageClass:"k-delete",className:"k-primary k-scheduler-delete",iconClass:"k-icon"}},_={mobile:{dateRange:ct,timezonePopUp:ht,timezone:gt,recurrence:ft,description:'<textarea name="description" class="k-textbox"/>',multipleResources:m,resources:f},desktop:{dateRange:ut,timezonePopUp:mt,timezone:vt,recurrence:pt,description:'<textarea name="description" class="k-textbox"/>',multipleResources:h,resources:f}},k=F.Observable.extend({init:function(e,t){F.Observable.fn.init.call(this),this.element=e,this.options=U(!0,{},this.options,t),this.createButton=this.options.createButton,this.toggleDateValidationHandler=q(this._toggleDateValidation,this)},_toggleDateValidation:function(t){if("isAllDay"==t.field){var n,i,r,a=this.container,o=this.editable.options.model.isAllDay,s=F.attr("bind");a.find("["+s+"*=end],["+s+"*=start]").each(function(){n=e(this),tt.test(n.attr(s))&&(i=n.is("["+F.attr("role")+"=datetimepicker],[type*=datetime]"),r=o!==i,n.attr(F.attr("validate"),r))})}},fields:function(e,t){var n,i,r=this,a=r.options.messages,o=r.options.timezone,s=function(e){e.preventDefault(),r._initTimezoneEditor(t,this)},l=[{field:"title",title:a.editor.title},{field:"start",title:a.editor.start,editor:e.dateRange,timezone:o},{field:"end",title:a.editor.end,editor:e.dateRange,timezone:o},{field:"isAllDay",title:a.editor.allDayEvent}];F.timezone.windows_zones&&(l.push({field:"timezone",title:a.editor.timezone,editor:e.timezonePopUp,click:s,messages:a.editor,model:t}),l.push({field:"startTimezone",title:a.editor.startTimezone,editor:e.timezone,noTimezone:a.editor.noTimezone}),l.push({field:"endTimezone",title:a.editor.endTimezone,editor:e.timezone,noTimezone:a.editor.noTimezone})),t.recurrenceId||l.push({field:"recurrenceRule",title:a.editor.repeat,editor:e.recurrence,timezone:o,messages:a.recurrenceEditor,pane:this.pane}),"description"in t&&l.push({field:"description",title:a.editor.description,editor:e.description});for(n=0;this.options.resources.length>n;n++)i=this.options.resources[n],l.push({field:i.field,title:i.title,editor:i.multiple?e.multipleResources(i):e.resources(i)});return l},end:function(){return this.editable.end()},_buildEditTemplate:function(e,t,n){var i,r,a,o,s=this.options.messages,l=U({},F.Template,this.options.templateSettings),d=l.paramName,c=this.options.editable.template,u="";if(c)typeof c===P&&(c=window.unescape(c)),u+=F.template(c,l)(e);else for(i=0,r=t.length;r>i;i++)a=t[i],"startTimezone"===a.field&&(u+='<div class="k-popup-edit-form k-scheduler-edit-form k-scheduler-timezones" style="display:none">',u+='<div class="k-edit-form-container">',u+='<div class="k-edit-label"></div>',u+='<div class="k-edit-field"><label class="k-check"><input class="k-timezone-toggle" type="checkbox" />'+s.editor.separateTimezones+"</label></div>"),u+='<div class="k-edit-label"><label for="'+a.field+'">'+(a.title||a.field||"")+"</label></div>",!e.editable||e.editable(a.field)?(n.push(a),u+="<div "+F.attr("container-for")+'="'+a.field+'" class="k-edit-field"></div>'):(o="#:",a.field?(a=F.expr(a.field,d),o+=a+"==null?'':"+a):o+="''",o+="#",o=F.template(o,l),u+='<div class="k-edit-field">'+o(e)+"</div>"),"endTimezone"===a.field&&(u+=this._createEndTimezoneButton());return u},_createEndTimezoneButton:function(){return"</div></div>"},_revertTimezones:function(e){e.set("startTimezone",this._startTimezone),e.set("endTimezone",this._endTimezone),delete this._startTimezone,delete this._endTimezone}}),b=k.extend({init:function(){k.fn.init.apply(this,arguments),this.pane=F.mobile.ui.Pane.wrap(this.element),this.pane.element.parent().css("height",this.options.height),this.view=this.pane.view(),this._actionSheetButtonTemplate=F.template('<li><a #=attr# class="k-button #=className#" href="\\#">#:text#</a></li>'),this._actionSheetPopupOptions=e(document.documentElement).hasClass("km-root")?{modal:!1}:{align:"bottom center",position:"bottom center",effect:"slideIn:up"}},options:{animations:{left:"slide",right:"slide:right"}},destroy:function(){this.close(),this.unbind(),this.pane.destroy()},_initTimezoneEditor:function(t){var i,r=this,a=r.pane,o=r.options.messages,s=r.timezoneView,l=r.container.find(".k-scheduler-timezones"),d=l.find(".k-timezone-toggle"),c=l.find(".k-edit-label:last").add(l.find(".k-edit-field:last")),u=function(e){if("startTimezone"===e.field){var n=t.startTimezone;d.prop("disabled",!n),n||(c.hide(),t.set("endTimezone",""),d.prop("checked",!1))}};r._startTimezone=t.startTimezone||"",r._endTimezone=t.endTimezone||"",s||(i='<div data-role="view" class="k-popup-edit-form k-scheduler-edit-form k-mobile-list"><div data-role="header" class="k-header"><a href="#" class="k-button k-scheduler-cancel">'+o.cancel+"</a>"+o.editor.timezoneTitle+'<a href="#" class="k-button k-scheduler-update">'+o.save+"</a></div></div>",this.timezoneView=s=a.append(i),s.contentElement().append(l.show()),s.element.on($+Y,".k-scheduler-cancel, .k-scheduler-update",function(i){var s,l;i.preventDefault(),i.stopPropagation(),e(this).hasClass("k-scheduler-cancel")&&r._revertTimezones(t),t.unbind("change",u),s=a.element.find("#edit").data("kendoMobileView"),l=n(t,o.editor.noTimezone),s.contentElement().find(".k-timezone-button").text(l),a.navigate(s,r.options.animations.right)}),d.click(function(){c.toggle(d.prop("checked")),t.set("endTimezone","")}),t.bind("change",u)),d.prop("checked",t.endTimezone).prop("disabled",!t.startTimezone),t.endTimezone?c.show():c.hide(),a.navigate(s,r.options.animations.left)},_createActionSheetButton:function(e){return e.template=this._actionSheetButtonTemplate,this.createButton(e)},showDialog:function(t){var n,i,r="",a='<ul><li class="km-actionsheet-title">'+t.title+"</li>",o=this.element.find(".k-event["+F.attr("uid")+"='"+t.model.uid+"']");for(this.container&&(o=this.container.find(".k-scheduler-delete"),o[0]&&(r="phone")),n=0;t.buttons.length>n;n++)a+=this._createActionSheetButton(t.buttons[n]);a+="</ul>",i=e(a).appendTo(this.pane.view().element).kendoMobileActionSheet({type:r,cancel:this.options.messages.cancel,cancelTemplate:'<li class="km-actionsheet-cancel"><a class="k-button" href="\\#">#:cancel#</a></li>',close:function(){this.destroy()},command:function(n){var r=i.element.find("li:not(.km-actionsheet-cancel) > .k-button").index(e(n.currentTarget));r>-1&&(i.close(),t.buttons[r].click())},popup:this._actionSheetPopupOptions}).data("kendoMobileActionSheet"),i.open(o)},editEvent:function(t){var n,i,r,a,o,s=this.pane,l="",d=this.options.messages,c=d.save,u=d.destroy,p=d.cancel,f=d.editor.editorTitle;return l+='<div data-role="view" class="k-popup-edit-form k-scheduler-edit-form k-mobile-list" id="edit" '+F.attr("uid")+'="'+t.uid+'"><div data-role="header" class="k-header"><a href="#" class="k-button k-scheduler-cancel">'+p+"</a>"+f+'<a href="#" class="k-button k-scheduler-update">'+c+"</a></div>",n=this.fields(_.mobile,t),i=this,r=[],l+=this._buildEditTemplate(t,n,r),!t.isNew()&&this.options.editable&&this.options.editable.destroy!==!1&&(l+='<div class="k-edit-buttons"><a href="#" class="k-scheduler-delete k-button">'+u+"</a></div>"),l+="</div>",a=s.append(l),o=this.container=a.element,this.editable=o.kendoEditable({fields:r,model:t,clearContainer:!1,validateOnBlur:!0}).data("kendoEditable"),o.find("input[type=checkbox],input[type=radio]").parent(".k-edit-field").addClass("k-check").prev(".k-edit-label").addClass("k-check").click(function(){e(this).next().children("input").click()}),this.trigger("edit",{container:o,model:t})?this.trigger("cancel",{container:o,model:t}):(o.on($+Y,"a.k-scheduler-edit, a.k-scheduler-cancel, a.k-scheduler-update, a.k-scheduler-delete",function(n){var r,a;n.preventDefault(),n.stopPropagation(),r=e(this),r.hasClass("k-scheduler-edit")?s.navigate("#edit",i.options.animations.right):(a="cancel",r.hasClass("k-scheduler-update")?a="save":r.hasClass("k-scheduler-delete")&&(a="remove"),i.trigger(a,{container:o,model:t}))}),s.navigate(a,i.options.animations.left),t.bind("change",i.toggleDateValidationHandler)),this.editable},_views:function(){return this.pane.element.find(F.roleSelector("view")).not(this.view.element)},close:function(){var e,t,n,i;if(this.container){for(this.pane.navigate("",this.options.animations.right),e=this._views(),n=0,i=e.length;i>n;n++)t=e.eq(n).data("kendoMobileView"),t&&t.purge();e.remove(),this.container=null,this.editable&&(this.editable.options.model.unbind("change",this.toggleDateValidationHandler),this.editable.destroy(),this.editable=null),this.timezoneView=null}}}),y=k.extend({destroy:function(){this.close(),this.unbind()},editEvent:function(e){return this.editable=this._createPopupEditor(e)},close:function(){var e=this,t=function(){e.editable&&(e.editable.options.model.unbind("change",e.toggleDateValidationHandler),e.editable.destroy(),e.editable=null,e.container=null),e.popup&&(e.popup.destroy(),e.popup=null)};e.editable?(e._timezonePopup&&e._timezonePopup.data("kendoWindow")&&(e._timezonePopup.data("kendoWindow").destroy(),e._timezonePopup=null),e.container.is(":visible")?e.container.data("kendoWindow").bind("deactivate",t).close():t()):t()},_createEndTimezoneButton:function(){var e=this.options.messages,t="";return t+='<div class="k-edit-buttons k-state-default">',t+=this.createButton({name:"savetimezone",text:e.save})+this.createButton({name:"canceltimezone",text:e.cancel}),t+="</div></div></div>"},showDialog:function(t){var n,i,r,a=F.format("<div class='k-popup-edit-form'><div class='k-edit-form-container'><p class='k-popup-message'>{0}</p>",t.text);for(a+='<div class="k-edit-buttons k-state-default">',n=0;t.buttons.length>n;n++)a+=this.createButton(t.buttons[n]);a+="</div></div></div>",i=this.element,this.popup&&this.popup.destroy(),r=this.popup=e(a).appendTo(i).eq(0).on("click",".k-button",function(n){n.preventDefault(),r.close();var i=e(n.currentTarget).index();t.buttons[i].click()}).kendoWindow({modal:!0,resizable:!1,draggable:!1,title:t.title,visible:!1,close:function(){this.destroy(),i.focus()}}).getKendoWindow(),r.center().open()},_createPopupEditor:function(t){var n,i,r,a,o=this,s=o.options.editable,l="<div "+F.attr("uid")+'="'+t.uid+'" class="k-popup-edit-form k-scheduler-edit-form"><div class="k-edit-form-container">',d=o.options.messages,c=d.save,u=d.cancel,p=d.destroy,f=this.fields(_.desktop,t),h=[];
return l+=this._buildEditTemplate(t,f,h),i=V(s)?s.window:{},l+='<div class="k-edit-buttons k-state-default">',l+=this.createButton({name:"update",text:c,attr:n})+this.createButton({name:"canceledit",text:u,attr:n}),t.isNew()||s.destroy===!1||(l+=this.createButton({name:"delete",text:p,attr:n})),l+="</div></div></div>",r=this.container=e(l).appendTo(o.element).eq(0).kendoWindow(U({modal:!0,resizable:!1,draggable:!0,title:d.editor.editorTitle,visible:!1,close:function(e){e.userTriggered&&o.trigger(Q,{container:r,model:t})&&e.preventDefault()}},i)),a=r.kendoEditable({fields:h,model:t,clearContainer:!1,validateOnBlur:!0}).data("kendoEditable"),o.trigger(et,{container:r,model:t})?o.trigger(Q,{container:r,model:t}):(r.data("kendoWindow").center().open(),r.on($+Y,"a.k-scheduler-cancel",function(e){e.preventDefault(),e.stopPropagation(),o.trigger(Q,{container:r,model:t})}),r.on($+Y,"a.k-scheduler-update",function(e){e.preventDefault(),e.stopPropagation(),o.trigger("save",{container:r,model:t})}),r.on($+Y,"a.k-scheduler-delete",function(e){e.preventDefault(),e.stopPropagation(),o.trigger(J,{container:r,model:t})}),t.bind("change",o.toggleDateValidationHandler)),a},_initTimezoneEditor:function(e,t){var n,i=this,r=i.container.find(".k-scheduler-timezones"),a=r.find(".k-timezone-toggle"),o=r.find(".k-edit-label:last").add(r.find(".k-edit-field:last")),s=r.find(".k-scheduler-savetimezone"),l=r.find(".k-scheduler-canceltimezone"),d=i._timezonePopup,c=function(t){if("startTimezone"===t.field){var n=e.startTimezone;a.prop("disabled",!n),n||(o.hide(),e.set("endTimezone",""),a.prop("checked",!1))}};i._startTimezone=e.startTimezone,i._endTimezone=e.endTimezone,d||(i._timezonePopup=d=r.kendoWindow({modal:!0,resizable:!1,draggable:!0,title:i.options.messages.editor.timezoneEditorTitle,visible:!1,close:function(n){e.unbind("change",c),n.userTriggered&&i._revertTimezones(e),t&&t.focus()}}),a.click(function(){o.toggle(a.prop("checked")),e.set("endTimezone","")}),s.click(function(e){e.preventDefault(),n.close()}),l.click(function(t){t.preventDefault(),i._revertTimezones(e),n.close()}),e.bind("change",c)),a.prop("checked",e.endTimezone).prop("disabled",!e.startTimezone),e.endTimezone?o.show():o.hide(),n=d.data("kendoWindow"),n.center().open()}}),w=O.extend({init:function(t,n){var i=this;O.fn.init.call(i,t,n),i.options.views&&i.options.views.length||(i.options.views=["day","week"]),i.resources=[],i._initModel(),i._wrapper(),i._views(),i._toolbar(),i._dataSource(),i._resources(),i._resizeHandler=q(i.resize,i),i.wrapper.on("mousedown"+Y+" selectstart"+Y,function(e){e.preventDefault()}),i.options.editable&&i.options.editable.resize!==!1&&i._resizable(),i._movable(),e(window).on("resize"+Y,i._resizeHandler),i.options.messages&&i.options.messages.recurrence&&(M.options=i.options.messages.recurrence),i._selectable(),i._ariaId=F.guid(),i._createEditor()},_isMobile:function(){var e=this.options;return e.mobile===!0&&F.support.mobileOS||"phone"===e.mobile||"tablet"===e.mobile},_isMobilePhoneView:function(){var e=this.options;return e.mobile===!0&&F.support.mobileOS&&!F.support.mobileOS.tablet||"phone"===e.mobile},_selectable:function(){var t,n=this,i=n.wrapper,r=F.support.mobileOS?"touchend":"mousedown";n.options.selectable&&(n._tabindex(),i.on(r+Y,".k-scheduler-header-all-day td, .k-scheduler-content td, .k-event",function(e){var t=e.which,r=e.button,a=F.support.browser,o=t&&3===t||r&&2==r;F.support.mobileOS&&e.isDefaultPrevented()||(o||n._createSelection(e.currentTarget),i.focus(),a.msie&&9>a.version&&setTimeout(function(){i.focus()}))}),t=e.proxy(n._mouseMove,n),i.on("mousedown"+Y,".k-scheduler-header-all-day td, .k-scheduler-content td",function(e){var n=e.which,r=e.button,a=n&&3===n||r&&2==r;a||i.on("mousemove"+Y,".k-scheduler-header-all-day td, .k-scheduler-content td",t)}),i.on("mouseup"+Y+" mouseleave"+Y,function(){i.off("mousemove"+Y,".k-scheduler-header-all-day td, .k-scheduler-content td",t)}),i.on("focus"+Y,function(){n._selection||n._createSelection(e(".k-scheduler-content").find("td:first")),n._select()}),i.on("focusout"+Y,function(){n.view().clearSelection(),n._ctrlKey=n._shiftKey=!1}),i.on("keydown"+Y,q(n._keydown,n)),i.on("keyup"+Y,function(e){n._ctrlKey=e.ctrlKey,n._shiftKey=e.shiftKey}))},_select:function(){var e,t,n,i,r=this,a=r.view(),o=r.wrapper,s=a.current(),l=r._selection;s&&(s.removeAttribute("id"),s.removeAttribute("aria-label"),o.removeAttr("aria-activedescendant")),a.select(l),s=a.current(),s&&r._old!==s&&(t=l,n=r._selectedEvents(),i=a._selectedSlots,n[0]?(t=n[0]||l,e=F.format(r.options.messages.ariaEventLabel,t.title,t.start,t.start)):e=F.format(r.options.messages.ariaSlotLabel,t.start,t.end),s.setAttribute("id",r._ariaId),s.setAttribute("aria-label",e),o.attr("aria-activedescendant",r._ariaId),r._old=s,r.trigger("change",{start:l.start,end:l.end,events:n,slots:i,resources:a._resourceBySlot(l)}))},_selectedEvents:function(){for(var e,t=this._selection.events,n=t.length,i=0,r=[];n>i;i++)e=this.occurrenceByUid(t[i]),e&&r.push(e);return r},_mouseMove:function(t){var n=this;clearTimeout(n._moveTimer),n._moveTimer=setTimeout(function(){var i,r,a,o=n.view(),s=n._selection;s&&(i=o.selectionByElement(e(t.currentTarget)),i&&s.groupIndex===i.groupIndex&&(r=i.startDate(),a=i.endDate(),r>=s.end?s.backward=!1:s.start>=a&&(s.backward=!0),s.backward?s.start=r:s.end=a,n._select()))},5)},_viewByIndex:function(e){var t,n=this.views;for(t in n){if(!e)return t;e--}},_keydown:function(t){var n=this,i=t.keyCode,r=n.view(),a=r.options.editable,o=n._selection,s=t.shiftKey;n._ctrlKey=t.ctrlKey,n._shiftKey=t.shiftKey,i===R.TAB?r.moveToEvent(o,s)&&(n._select(),t.preventDefault()):a&&i===R.ENTER?o.events.length?a.update!==!1&&n.editEvent(o.events[0]):a.create!==!1&&(o.isAllDay&&(o=e.extend({},o,{end:F.date.addDays(o.end,-1)})),n.addEvent(U({},o,r._resourceBySlot(o)))):i===R.DELETE&&a!==!1&&a.destroy!==!1?n.removeEvent(o.events[0]):i>=49&&57>=i?n.view(n._viewByIndex(i-49)):r.move(o,i,s)&&(r.inRange(o)?n._select():n.date(o.start),t.preventDefault()),n._adjustSelectedDate()},_createSelection:function(t){var n,i,r;this._selection&&(this._ctrlKey||this._shiftKey)||(this._selection={events:[],groupIndex:0}),t=e(t),r=this._selection,n=t.attr(F.attr("uid")),i=this.view().selectionByElement(t),i&&(r.groupIndex=i.groupIndex||0),n&&(i=l(this._data,n)),i&&i.uid&&(n=[i.uid]),this._updateSelection(i,n),this._adjustSelectedDate()},_updateSelection:function(e,t){var n,i,r=this._selection;e&&r&&(this._shiftKey&&r.start&&r.end?(n=r.end>e.end,i=this.view(),r.end=e.endDate?e.endDate():e.end,n&&i._timeSlotInterval&&F.date.setTime(r.end,-i._timeSlotInterval())):(r.start=e.startDate?e.startDate():e.start,r.end=e.endDate?e.endDate():e.end),r.isAllDay="isDaySlot"in e?e.isDaySlot:e.isAllDay,r.index=e.index,r.events=this._ctrlKey?r.events.concat(t||[]):t||[])},options:{name:"Scheduler",date:nt,editable:!0,autoBind:!0,snap:!0,mobile:!1,timezone:"",allDaySlot:!0,min:new Date(1900,0,1),max:new Date(2099,11,31),messages:{today:"Today",save:"Save",cancel:"Cancel",destroy:"Delete",deleteWindowTitle:"Delete event",ariaSlotLabel:"Selected from {0:t} to {1:t}",ariaEventLabel:"{0} on {1:D} at {2:t}",views:{day:"Day",week:"Week",workWeek:"Work Week",agenda:"Agenda",month:"Month"},recurrenceMessages:{deleteWindowTitle:"Delete Recurring Item",deleteWindowOccurrence:"Delete current occurrence",deleteWindowSeries:"Delete the series",editWindowTitle:"Edit Recurring Item",editWindowOccurrence:"Edit current occurrence",editWindowSeries:"Edit the series"},editor:{title:"Title",start:"Start",end:"End",allDayEvent:"All day event",description:"Description",repeat:"Repeat",timezone:" ",startTimezone:"Start timezone",endTimezone:"End timezone",separateTimezones:"Use separate start and end time zones",timezoneEditorTitle:"Timezones",timezoneEditorButton:"Time zone",timezoneTitle:"Time zones",noTimezone:"No timezone",editorTitle:"Event"}},height:null,width:null,resources:[],group:{resources:[],direction:"horizontal"},views:[],selectable:!1},events:[J,et,Q,X,"add","dataBinding","dataBound","moveStart","move","moveEnd","resizeStart","resize","resizeEnd","navigate","change"],destroy:function(){var t,n=this;O.fn.destroy.call(n),n.dataSource&&n.dataSource.unbind(K,n._refreshHandler),n.calendar&&(n.calendar.destroy(),n.popup.destroy()),n.view()&&n.view().destroy(),n._editor&&n._editor.destroy(),this._moveDraggable&&this._moveDraggable.destroy(),this._resizeDraggable&&this._resizeDraggable.destroy(),t=n.element.add(n.wrapper).add(n.toolbar).add(n.popup),t.off(Y),clearTimeout(n._moveTimer),n._model=null,n.toolbar=null,n.element=null,e(window).off("resize"+Y,n._resizeHandler),F.destroy(n.wrapper)},setDataSource:function(e){this.options.dataSource=e,this._dataSource(),this.options.autoBind&&e.fetch()},items:function(){return this.wrapper.children(".k-event, .k-task")},_movable:function(){var n,i,r,a,o,s=this,l=s._isMobile(),d=s.options.editable&&s.options.editable.move!==!1,c=s.options.editable&&s.options.editable.resize!==!1;(d||c&&l)&&(s._moveDraggable=new F.ui.Draggable(s.element,{distance:0,filter:".k-event",holdToDrag:l}),d&&s._moveDraggable.bind("dragstart",function(e){var a=s.view(),d=e.currentTarget;return a.options.editable&&a.options.editable.move!==!1?l&&!d.hasClass("k-event-active")?(s.element.find(".k-event-active").removeClass("k-event-active"),e.preventDefault(),t):(o=s.occurrenceByUid(d.attr(F.attr("uid"))),n=a._slotByPosition(e.x.location,e.y.location),r=n.startOffset(e.x.location,e.y.location,s.options.snap),i=n,(!n||s.trigger("moveStart",{event:o}))&&e.preventDefault(),t):(e.preventDefault(),t)}).bind("drag",function(e){var t,n,l=s.view(),d=l._slotByPosition(e.x.location,e.y.location);d&&(a=d.startOffset(e.x.location,e.y.location,s.options.snap),t=a-r,l._updateMoveHint(o,d.groupIndex,t),n=g(o,t),s.trigger("move",{event:o,slot:{element:d.element,start:d.startDate(),end:d.endDate()},resources:l._resourceBySlot(d),start:n.start,end:n.end})?l._updateMoveHint(o,d.groupIndex,t):i=d)}).bind("dragend",function(t){var l,d,c,u,p,f,h;s.view()._removeMoveHint(),l=a-r,d=g(o,l),c=d.start,u=d.end,p=s.view()._resourceBySlot(i),f=s.view()._resourceBySlot(n),h=s.trigger("moveEnd",{event:o,slot:{element:i.element,start:i.startDate(),end:i.endDate()},start:c,end:u,resources:p}),h||o.start.getTime()==c.getTime()&&o.end.getTime()==u.getTime()&&F.stringify(p)==F.stringify(f)||s._updateEvent(null,o,e.extend({start:c,end:u},p)),t.currentTarget.removeClass("k-event-active"),this.cancelHold()}).bind("dragcancel",function(){s.view()._removeMoveHint(),this.cancelHold()}),l&&(s._moveDraggable.bind("hold",function(e){s.element.find(".k-scheduler-monthview").length&&e.preventDefault(),s.element.find(".k-event-active").removeClass("k-event-active"),e.currentTarget.addClass("k-event-active")}),s._moveDraggable.userEvents.bind("press",function(e){e.preventDefault()})))},_resizable:function(){function t(e){var t,n={"k-resize-e":"east","k-resize-w":"west","k-resize-n":"north","k-resize-s":"south"};for(t in n)if(e.hasClass(t))return n[t]}var n,i,r,a,o=this;o._resizeDraggable=new F.ui.Draggable(o.element,{distance:0,filter:".k-resize-handle",dragstart:function(t){var s=e(t.currentTarget),l=s.closest(".k-event"),d=l.attr(F.attr("uid"));r=o.occurrenceByUid(d),a=o.view()._slotByPosition(t.x.location,t.y.location),o.trigger("resizeStart",{event:r})&&t.preventDefault(),n=F.date.toUtcTime(r.start),i=F.date.toUtcTime(r.end)},drag:function(s){var l,d,c,u,p,f;a&&(l=e(s.currentTarget),d=t(l),c=o.view(),u=c._slotByPosition(s.x.location,s.y.location),u&&a.groupIndex==u.groupIndex&&(a=u,p=n,f=i,"south"==d?!a.isDaySlot&&a.end-F.date.toUtcTime(r.start)>=c._timeSlotInterval()&&(i=r.isAllDay?a.startOffset(s.x.location,s.y.location,o.options.snap):a.endOffset(s.x.location,s.y.location,o.options.snap)):"north"==d?!a.isDaySlot&&F.date.toUtcTime(r.end)-a.start>=c._timeSlotInterval()&&(n=a.startOffset(s.x.location,s.y.location,o.options.snap)):"east"==d?a.isDaySlot&&F.date.toUtcTime(F.date.getDate(a.endDate()))>=F.date.toUtcTime(F.date.getDate(r.start))&&(i=r.isAllDay?a.startOffset(s.x.location,s.y.location,o.options.snap):a.endOffset(s.x.location,s.y.location,o.options.snap)):"west"==d&&a.isDaySlot&&F.date.toUtcTime(F.date.getDate(r.end))>=F.date.toUtcTime(F.date.getDate(a.startDate()))&&(n=a.startOffset(s.x.location,s.y.location,o.options.snap)),o.trigger("resize",{event:r,slot:{element:a.element,start:a.startDate(),end:a.endDate()},start:F.timezone.toLocalDate(n),end:F.timezone.toLocalDate(i),resources:c._resourceBySlot(a)})?(n=p,i=f):c._updateResizeHint(r,a.groupIndex,n,i)))},dragend:function(s){var l,d=e(s.currentTarget),c=new Date(r.start.getTime()),u=new Date(r.end.getTime()),p=t(d);o.view()._removeResizeHint(),"south"==p?u=F.timezone.toLocalDate(i):"north"==p?c=F.timezone.toLocalDate(n):"east"==p?u=F.date.getDate(F.timezone.toLocalDate(i)):"west"==p&&(c=new Date(F.timezone.toLocalDate(n)),c.setHours(0),c.setMinutes(0)),l=o.trigger("resizeEnd",{event:r,slot:{element:a.element,start:a.startDate(),end:a.endDate()},start:c,end:u,resources:o.view()._resourceBySlot(a)}),!l&&u.getTime()>=c.getTime()&&(r.start.getTime()!=c.getTime()||r.end.getTime()!=u.getTime())&&o._updateEvent(p,r,{start:c,end:u}),a=null,r=null},dragcancel:function(){o.view()._removeResizeHint(),a=null,r=null}})},_updateEvent:function(e,t,n){var i=this,r=function(e,t){try{i._preventRefresh=!0,e.update(n),i._convertDates(e)}finally{i._preventRefresh=!1}i.trigger(X,{event:e})||(t&&t(),i._updateSelection(e),i.dataSource.sync())},a=function(e){return e.recurrenceRule?i.dataSource.getByUid(e.uid):i.dataSource.get(e.recurrenceId)},o=function(){var o,s,l=a(t);("south"==e||"north"==e)&&(n.start&&(o=F.date.getDate(l.start),F.date.setTime(o,I(n.start)),n.start=o),n.end&&(s=F.date.getDate(l.end),F.date.setTime(s,I(n.end)),n.end=s)),i.dataSource._removeExceptions(l),r(l)},s=function(){var e=a(t),n=function(){i._convertDates(e)},o=e.toOccurrence({start:t.start,end:t.end});r(i.dataSource.add(o),n)},l=i.options.messages.recurrenceMessages;t.recurrenceRule||t.isOccurrence()?i.showDialog({model:t,title:l.editWindowTitle,text:l.editRecurring?l.editRecurring:ot,buttons:[{text:l.editWindowOccurrence,click:s},{text:l.editWindowSeries,click:o}]}):r(i.dataSource.getByUid(t.uid))},_modelForContainer:function(t){return t=e(t).closest("["+F.attr("uid")+"]"),this.dataSource.getByUid(t.attr(F.attr("uid")))},showDialog:function(e){this._editor.showDialog(e)},focus:function(){this.wrapper.focus()},_confirmation:function(e,t){var n,i,r,a=this.options.editable;a===!0||a.confirmation!==!1?(n=this.options.messages,i=typeof a.confirmation===P?a.confirmation:rt,r=[{name:"destroy",text:n.destroy,click:function(){e()}}],this._isMobile()&&F.mobile.ui.Pane||r.push({name:"canceledit",text:n.cancel,click:function(){e(!0)}}),this.showDialog({model:t,text:i,title:n.deleteWindowTitle,buttons:r})):e()},addEvent:function(e){var t,n,i=this._editor.editable,r=this.dataSource;e=e||{},n=this.trigger("add",{event:e}),!n&&(i&&i.end()||!i)&&(this.cancelEvent(),e&&e.toJSON&&(e=e.toJSON()),t=r.add(e),t&&(this.cancelEvent(),this._editEvent(t)))},saveEvent:function(){var e,t,n,i=this._editor;i&&(e=i.editable,t=i.container,n=this._modelForContainer(t),t&&e&&e.end()&&!this.trigger(X,{container:t,event:n})&&(n.isRecurrenceHead()&&this.dataSource._removeExceptions(n),n.dirty||n.isOccurrence()||this._convertDates(n,"remove"),this.dataSource.sync()))},cancelEvent:function(){var e,t=this._editor,n=t.container;n&&(e=this._modelForContainer(n),e&&e.isOccurrence()&&(this._convertDates(e,"remove"),this._convertDates(this.dataSource.get(e.recurrenceId),"remove")),this.dataSource.cancelChanges(e),t.close())},editEvent:function(e){var t="string"==typeof e?this.occurrenceByUid(e):e;t&&(this.cancelEvent(),t.isRecurring()?this._editRecurringDialog(t):this._editEvent(t))},_editEvent:function(e){this._createPopupEditor(e)},_editRecurringDialog:function(e){var t=this,n=function(){e.isException()?t._editEvent(e):t.addEvent(e)},i=function(){e.recurrenceId&&(e=t.dataSource.get(e.recurrenceId)),t._editEvent(e)},r=t.options.messages.recurrenceMessages;t.showDialog({model:e,title:r.editWindowTitle,text:r.editRecurring?r.editRecurring:ot,buttons:[{text:r.editWindowOccurrence,click:n},{text:r.editWindowSeries,click:i}]})},_createButton:function(e){var t=e.template||st,n=typeof e===P?e:e.name||e.text,i={className:"k-scheduler-"+(n||"").replace(/\s/g,""),text:n,attr:""};if(!(n||V(e)&&e.template))throw Error("Custom commands should have name specified");return V(e)?(e.className&&(e.className+=" "+i.className),"edit"===n&&V(e.text)&&(e=U(!0,{},e),e.text=e.text.edit),i=U(!0,i,v[n],e)):i=U(!0,i,v[n]),F.template(t)(i)},_convertDates:function(e,t){var n=this.dataSource.reader.timezone,i=e.startTimezone,r=e.endTimezone,a=e.start,o=e.start;t=t||"apply",i=i||r,r=r||i,i&&(n?"apply"===t?(a=F.timezone.convert(e.start,n,i),o=F.timezone.convert(e.end,n,r)):(a=F.timezone.convert(e.start,i,n),o=F.timezone.convert(e.end,r,n)):(a=F.timezone[t](e.start,i),o=F.timezone[t](e.end,r)),e._set("start",a),e._set("end",o))},_createEditor:function(){var e,n=this;e=n._editor=this._isMobile()&&F.mobile.ui.Pane?new b(this.wrapper,U({},this.options,{timezone:n.dataSource.reader.timezone,resources:n.resources,createButton:q(this._createButton,this)})):new y(this.wrapper,U({},this.options,{createButton:q(this._createButton,this),timezone:n.dataSource.reader.timezone,resources:n.resources})),e.bind("cancel",function(e){return n.trigger("cancel",{container:e.container,event:e.model})?(e.preventDefault(),t):(n.cancelEvent(),n.focus(),t)}),e.bind("edit",function(e){n.trigger(et,{container:e.container,event:e.model})&&e.preventDefault()}),e.bind("save",function(){n.saveEvent()}),e.bind("remove",function(e){n.removeEvent(e.model)})},_createPopupEditor:function(e){var t=this._editor;(!e.isNew()||e.isOccurrence())&&(e.isOccurrence()&&this._convertDates(e.recurrenceId?this.dataSource.get(e.recurrenceId):e),this._convertDates(e)),this.editable=t.editEvent(e)},removeEvent:function(e){var t=this,n="string"==typeof e?t.occurrenceByUid(e):e;n&&(n.isRecurring()?t._deleteRecurringDialog(n):t._confirmation(function(e){e||t._removeEvent(n)},n))},occurrenceByUid:function(e){var t=this.dataSource.getByUid(e);return t||(t=l(this._data,e)),t},occurrencesInRange:function(e,t){return new F.data.Query(this._data).filter({logic:"or",filters:[{logic:"and",filters:[{field:"start",operator:"gte",value:e},{field:"end",operator:"gte",value:e},{field:"start",operator:"lt",value:t}]},{logic:"and",filters:[{field:"start",operator:"lte",value:e},{field:"end",operator:"gt",value:e}]}]}).toArray()},_removeEvent:function(e){this.trigger(J,{event:e})||this.dataSource.remove(e)&&this.dataSource.sync()},_deleteRecurringDialog:function(e){var t=this,n=e,i=function(){var e=n.recurrenceId?n:n.toOccurrence(),i=t.dataSource.get(e.recurrenceId);t._convertDates(i),t._removeEvent(e)},r=function(){n.recurrenceId&&(n=t.dataSource.get(n.recurrenceId)),t._removeEvent(n)},a=t.options.messages.recurrenceMessages;t.showDialog({model:e,title:a.deleteWindowTitle,text:a.deleteRecurring?a.deleteRecurring:at,buttons:[{text:a.deleteWindowOccurrence,click:i},{text:a.deleteWindowSeries,click:r}]})},_unbindView:function(e){e.destroy()},_bindView:function(e){var t=this;t.options.editable&&(t._viewRemoveHandler&&e.unbind(J,t._viewRemoveHandler),t._viewRemoveHandler=function(e){t.removeEvent(e.uid)},e.bind(J,t._viewRemoveHandler),t._viewAddHandler&&e.unbind(Z,t._viewAddHandler),t._viewAddHandler=function(e){t.addEvent(e.eventInfo)},e.bind(Z,this._viewAddHandler),t._viewEditHandler&&e.unbind(et,t._viewEditHandler),t._viewEditHandler=function(e){t.editEvent(e.uid)},e.bind(et,this._viewEditHandler)),t._viewNavigateHandler&&e.unbind("navigate",t._viewNavigateHandler),t._viewNavigateHandler=function(e){var n,i;e.view&&(n="isWorkDay"in e,i=n?"changeWorkDay":"changeView",t.trigger("navigate",{view:e.view,isWorkDay:e.isWorkDay,action:i,date:e.date})||(n&&(t._workDayMode=e.isWorkDay),t._selectView(e.view),t.date(e.date)))},e.bind("navigate",t._viewNavigateHandler),t._viewActivateHandler&&e.unbind("activate",t._viewActivateHandler),t._viewActivateHandler=function(){var e=this;t._selection&&(e.constrainSelection(t._selection),t._select(),t._adjustSelectedDate())},e.bind("activate",t._viewActivateHandler)},_selectView:function(e){var t=this;e&&t.views[e]&&(t._selectedView&&t._unbindView(t._selectedView),t._selectedView=t._renderView(e),t._selectedViewName=e,t.toolbar.find(".k-scheduler-views li").removeClass("k-state-selected").end().find(".k-view-"+e.replace(/\./g,"\\.").toLowerCase()).addClass("k-state-selected"))},view:function(e){var n=this;return e?(n._selectView(e),n.rebind(),t):n._selectedView},_renderView:function(e){var t=this._initializeView(e);return this._bindView(t),this._model.set("formattedDate",t.dateForTitle()),t},resize:function(e){var t=this.getSize(),n=this._size,i=this.view();i&&i.groups&&(e||!n||t.width!==n.width||t.height!==n.height)&&(this.refresh({action:"resize"}),this._size=t)},_adjustSelectedDate:function(){var e=this._model.selectedDate,t=this._selection,n=t.start;n&&!F.date.isInDateRange(e,A(n),A(t.end))&&e.setFullYear(n.getFullYear(),n.getMonth(),n.getDate())},_initializeView:function(e){var t,n,i=this.views[e];if(i){if(t=V(i),n=i.type,typeof n===P&&(n=F.getter(i.type)(window)),!n)throw Error("There is no such view");i=new n(this.wrapper,p(U(!0,{},this.options,t?i:{},{resources:this.resources,date:this.date(),showWorkHours:this._workDayMode})))}return i},_views:function(){var e,t,n,i,r,a,o,s,l,d=this.options.views;for(this.views={},o=0,s=d.length;s>o;o++)l=!1,e=d[o],i=V(e),i?(a=r=e.type?e.type:e,typeof a!==P&&(r=e.title,l=!0)):a=r=e,t=x[r],t&&!l&&(e.type=t.type,t.title=this.options.messages.views[r],"day"===t.type?t.messages={allDay:this.options.messages.allDay}:"agenda"===t.type&&(t.messages={event:this.options.messages.event,date:this.options.messages.date,time:this.options.messages.time})),e=U({title:r},t,i?e:{}),r&&(this.views[r]=e,(!n||e.selected)&&(n=r));n&&(this._selectedViewName=n)},rebind:function(){this.dataSource.fetch()},_dataSource:function(){var e=this,t=e.options,n=t.dataSource;n=G(n)?{data:n}:n,!t.timezone||n instanceof bt||(n=U(!0,n,{schema:{timezone:t.timezone}})),e.dataSource&&e._refreshHandler?e.dataSource.unbind(K,e._refreshHandler).unbind("progress",e._progressHandler).unbind("error",e._errorHandler):(e._refreshHandler=q(e.refresh,e),e._progressHandler=q(e._requestStart,e),e._errorHandler=q(e._error,e)),e.dataSource=F.data.SchedulerDataSource.create(n).bind(K,e._refreshHandler).bind("progress",e._progressHandler).bind("error",e._errorHandler)},_error:function(){this._progress(!1)},_requestStart:function(){this._progress(!0)},_progress:function(e){var t=this.element.find(".k-scheduler-content");F.ui.progress(t,e)},_resources:function(){var t,n,i,r,a,o=this,s=o.options.resources;for(t=0;s.length>t;t++){if(n=s[t],i=n.field,r=n.dataSource,!i||!r)throw Error('The "field" and "dataSource" options of the scheduler resource are mandatory.');o.resources.push({field:i,name:n.name||i,title:n.title||i,dataTextField:n.dataTextField||"text",dataValueField:n.dataValueField||"value",dataColorField:n.dataColorField||"color",valuePrimitive:null!=n.valuePrimitive?n.valuePrimitive:!0,multiple:n.multiple||!1,dataSource:F.data.DataSource.create(r)})}a=e.map(o.resources,function(e){return e.dataSource.fetch()}),e.when.apply(null,a).then(function(){o.options.autoBind?o.view(o._selectedViewName):o._selectView(o._selectedViewName)})},_initModel:function(){var e=this;e._model=F.observable({selectedDate:new Date(this.options.date),formattedDate:""}),e._model.bind("change",function(t){"selectedDate"===t.field&&e.view(e._selectedViewName)})},_wrapper:function(){var e=this,t=e.options,n=t.height,i=t.width;e.wrapper=e.element.addClass("k-widget k-scheduler k-floatwrap").attr("role","grid").attr("aria-multiselectable",!0),e._isMobile()&&e.wrapper.addClass("k-scheduler-mobile"),e._isMobilePhoneView()&&e.wrapper.addClass("k-scheduler-phone"),n&&e.wrapper.height(n),i&&e.wrapper.width(i)},date:function(e){return null!=e&&A(e)>=A(this.options.min)&&A(e)<=A(this.options.max)&&this._model.set("selectedDate",e),A(this._model.get("selectedDate"))},_toolbar:function(){var n=this,i=n.options,r=this._isMobilePhoneView()?dt:lt,a=e(r({messages:i.messages,ns:F.ns,views:n.views}));n.wrapper.append(a),n.toolbar=a,F.bind(n.toolbar,n._model),a.on($+Y,".k-scheduler-navigation li",function(i){var r=e(this),a=new Date(n.date()),o="";if(i.preventDefault(),r.hasClass("k-nav-today"))o="today",a=new Date;else if(r.hasClass("k-nav-next"))o="next",a=n.view().nextDate();else if(r.hasClass("k-nav-prev"))o="previous",a=n.view().previousDate();else if(r.hasClass("k-nav-current")&&!n._isMobilePhoneView())return n._showCalendar(),t;n.trigger("navigate",{view:n._selectedViewName,action:o,date:a})||n.date(a)}),a.on($+Y,".k-scheduler-views li",function(t){t.preventDefault();var i=e(this).attr(F.attr("name"));n.trigger("navigate",{view:i,action:"changeView",date:n.date()})||n.view(i)}),a.find("li").hover(function(){e(this).addClass("k-state-hover")},function(){e(this).removeClass("k-state-hover")})},_showCalendar:function(){var t=this,n=t.toolbar.find(".k-nav-current"),i=e('<div class="k-calendar-container"><div class="k-scheduler-calendar"/></div>');t.popup||(t.popup=new L(i,{anchor:n,activate:function(){t.calendar||(t.calendar=new B(this.element.find(".k-scheduler-calendar"),{change:function(){var e=this.value();t.trigger("navigate",{view:t._selectedViewName,action:"changeDate",date:e})||(t.date(e),t.popup.close())},min:t.options.min,max:t.options.max})),t.calendar.value(t.date())},copyAnchorStyles:!1})),t.popup.open()},refresh:function(e){var t=this.view();this._progress(!1),e=e||{},t&&(e&&"itemchange"===e.action&&(this._editor.editable||this._preventRefresh)||this.trigger("dataBinding",{action:e.action||"rebind",index:e.index,items:e.items})||(e&&"resize"===e.action||!this._editor||this._editor.close(),this._data=this.dataSource.expand(t.startDate(),t.endDate()),t.render(this._data),this.trigger("dataBound")))},slotByPosition:function(e,t){var n,i=this.view();return i._slotByPosition?(n=i._slotByPosition(e,t),n?{startDate:n.startDate(),endDate:n.endDate(),groupIndex:n.groupIndex,element:n.element,isDaySlot:n.isDaySlot}:null):null},slotByElement:function(t){var n=e(t).offset();return this.slotByPosition(n.left,n.top)},resourcesBySlot:function(e){return this.view()._resourceBySlot(e)}}),x={day:{type:"kendo.ui.DayView"},week:{type:"kendo.ui.WeekView"},workWeek:{type:"kendo.ui.WorkWeekView"},agenda:{type:"kendo.ui.AgendaView"},month:{type:"kendo.ui.MonthView"}},N.plugin(w),C=O.extend({init:function(e,t){var n=this,i=F.timezone.windows_zones;if(!i||!F.timezone.zones_titles)throw Error("kendo.timezones.min.js is not included.");O.fn.init.call(n,e,t),n.wrapper=n.element,n._zonesQuery=new F.data.Query(i),n._zoneTitleId=F.guid(),n._zoneTitlePicker(),n._zonePicker(),n.value(n.options.value)},options:{name:"TimezoneEditor",value:"",optionLabel:"No timezone"},events:["change"],_zoneTitlePicker:function(){var t=this,n=e('<input id="'+t._zoneTitleId+'"/>').appendTo(t.wrapper);t._zoneTitle=new F.ui.DropDownList(n,{dataSource:F.timezone.zones_titles,dataValueField:"other_zone",dataTextField:"name",optionLabel:t.options.optionLabel,cascade:function(){this.value()||t._zone.wrapper.hide()}})},_zonePicker:function(){var t=this,n=e("<input />").appendTo(this.wrapper);t._zone=new F.ui.DropDownList(n,{dataValueField:"zone",dataTextField:"territory",dataSource:t._zonesQuery.data,cascadeFrom:t._zoneTitleId,cascade:function(){t._value=this.value(),t.trigger("change")},dataBound:function(){t._value=this.value(),this.wrapper.toggle(this.dataSource.view().length>1)}}),t._zone.wrapper.hide()},destroy:function(){O.fn.destroy.call(this),F.destroy(this.wrapper)},value:function(e){var n,i=this;return e===t?i._value:(n=i._zonesQuery.filter({field:"zone",operator:"eq",value:e}).data[0],n?(i._zoneTitle.value(n.other_zone),i._zone.value(n.zone)):i._zoneTitle.value(""),t)}}),N.plugin(C),T=F.template('<option value="#=other_zone#">#=name#</option>'),S=F.template('<option value="#=zone#">#=territory#</option>'),D=O.extend({init:function(e,t){var n=this,i=F.timezone.windows_zones;if(!i||!F.timezone.zones_titles)throw Error("kendo.timezones.min.js is not included.");O.fn.init.call(n,e,t),n.wrapper=n.element,n._zonesQuery=new F.data.Query(i),n._zoneTitlePicker(),n._zonePicker(),n.value(n.options.value)},options:{name:"MobileTimezoneEditor",optionLabel:"No timezone",value:""},events:["change"],_bindZones:function(e){var t=e?this._filter(e):[];this._zone.html(this._options(t,S))},_filter:function(e){return this._zonesQuery.filter({field:"other_zone",operator:"eq",value:e}).data},_options:function(e,t,n){var i=0,r="",a=e.length;for(n&&(r+=t({other_zone:"",name:n}));a>i;i++)r+=t(e[i]);return r},_zoneTitlePicker:function(){var t=this,n=t._options(F.timezone.zones_titles,T,t.options.optionLabel);t._zoneTitle=e("<select>"+n+"</select>").appendTo(t.wrapper).change(function(){var e=this.value,n=t._zone;t._bindZones(e),e&&n[0].children.length>1?n.show():n.hide(),t._value=n[0].value,t.trigger("change")})},_zonePicker:function(){var t=this;t._zone=e('<select style="display:none"></select>').appendTo(this.wrapper).change(function(){t._value=this.value,t.trigger("change")}),t._bindZones(t._zoneTitle.val()),t._value=t._zone[0].value},destroy:function(){O.fn.destroy.call(this),F.destroy(this.wrapper)},value:function(e){var n,i=this,r=i._zone,a="",o="";return e===t?i._value:(n=i._zonesQuery.filter({field:"zone",operator:"eq",value:e}).data[0],n&&(o=n.zone,a=n.other_zone),i._zoneTitle.val(a),i._bindZones(a),r.val(o),o=r[0].value,o&&r[0].children.length>1?r.show():r.hide(),i._value=o,t)}}),N.plugin(D)})(window.kendo.jQuery);return window.kendo},typeof define=="function"&&define.amd?define:function(_,f){f()});