/** @license DayPilot Pro Copyright (c) 2005 - 2017 Annpoint s.r.o. http://www.daypilot.org/ Use of this software is subject to license terms. Version: 3027 */ if("undefined"==typeof DayPilot)var DayPilot={};if("undefined"==typeof DayPilot.Global&&(DayPilot.Global={}),function(){function e(e){var t=DayPilot.Date.Cache.Ticks;if(t[e])return DayPilot.Stats.cacheHitsTicks+=1,t[e];var i,n=new Date(e),a=n.getUTCMilliseconds();i=0===a?"":a<10?".00"+a:a<100?".0"+a:"."+a;var o=n.getUTCSeconds();o<10&&(o="0"+o);var r=n.getUTCMinutes();r<10&&(r="0"+r);var l=n.getUTCHours();l<10&&(l="0"+l);var s=n.getUTCDate();s<10&&(s="0"+s);var d=n.getUTCMonth()+1;d<10&&(d="0"+d);var c=n.getUTCFullYear();if(c<=0)throw"The minimum year supported is 1.";c<10?c="000"+c:c<100?c="00"+c:c<1e3&&(c="0"+c);var h=c+"-"+d+"-"+s+"T"+l+":"+r+":"+o+i;return t[e]=h,h}function t(e,t){return!DayPilot.Util.isNullOrUndefined(e)&&(!DayPilot.Util.isNullOrUndefined(t)&&e.toLocaleLowerCase()===t.toLocaleLowerCase())}if("undefined"==typeof DayPilot.$){DayPilot.$=function(e){return document.getElementById(e)},DayPilot.isKhtml=navigator&&navigator.userAgent&&navigator.userAgent.indexOf("KHTML")!==-1,DayPilot.isIE=navigator&&navigator.userAgent&&(navigator.userAgent.indexOf("MSIE")!==-1||navigator.userAgent.indexOf("Trident")!==-1),DayPilot.isIEQuirks=DayPilot.isIE&&document.compatMode&&"BackCompat"===document.compatMode,DayPilot.browser={},DayPilot.browser.ie8=function(){var e=document.createElement("div");return e.innerHTML="",1===e.getElementsByTagName("i").length}(),DayPilot.browser.ie9=function(){var e=document.createElement("div");return e.innerHTML="",1===e.getElementsByTagName("i").length}(),DayPilot.browser.ielt9=function(){var e=document.createElement("div");return e.innerHTML="",1===e.getElementsByTagName("i").length}(),DayPilot.browser.ff=navigator&&navigator.userAgent&&navigator.userAgent.indexOf("Firefox")!==-1,DayPilot.browser.chrome=navigator&&navigator.userAgent&&navigator.userAgent.indexOf("Chrome")!==-1,DayPilot.browser.ie=DayPilot.isIE,DayPilot.browser.webkit=navigator&&navigator.userAgent&&navigator.userAgent.indexOf("WebKit")!==-1,DayPilot.browser.passiveEvents=!1,function(){try{window.addEventListener("test",null,Object.defineProperty({},"passive",{"get":function(){DayPilot.browser.passiveEvents=!0}}))}catch(e){}}(),DayPilot.libs={},DayPilot.libs.angularjs="object"==typeof angularjs,DayPilot.touch={},DayPilot.touch.start=window.navigator.msPointerEnabled?"MSPointerDown":"touchstart",DayPilot.touch.move=window.navigator.msPointerEnabled?"MSPointerMove":"touchmove",DayPilot.touch.end=window.navigator.msPointerEnabled?"MSPointerUp":"touchend",DayPilot.mo2=function(e,t){if(t=t||window.event,"undefined"!=typeof t.offsetX){var i={x:t.offsetX+1,y:t.offsetY+1};if(!e)return i;for(var n=t.srcElement;n&&n!==e;)"SPAN"!==n.tagName&&(i.x+=n.offsetLeft,n.offsetTop>0&&(i.y+=n.offsetTop-n.scrollTop)),n=n.offsetParent;return n?i:null}if("undefined"!=typeof t.layerX){var i={x:t.layerX,y:t.layerY,src:t.target};if(!e)return i;for(var n=t.target;n&&"absolute"!==n.style.position&&"relative"!==n.style.position;)n=n.parentNode,DayPilot.isKhtml&&(i.y+=n.scrollTop);for(;n&&n!==e;)i.x+=n.offsetLeft,i.y+=n.offsetTop-n.scrollTop,n=n.offsetParent;return n?i:null}return null},DayPilot.mo3=function(e,t){t=t||window.event;var i,n=DayPilot.page(t);if(n){var a=DayPilot.abs(e);i={x:n.x-a.x,y:n.y-a.y}}else i=DayPilot.mo2(e,t);return i.shift=t.shiftKey,i.meta=t.metaKey,i.ctrl=t.ctrlKey,i.alt=t.altKey,i},DayPilot.mc=function(e){return e.pageX||e.pageY?{x:e.pageX,y:e.pageY}:{x:e.clientX+document.documentElement.scrollLeft,y:e.clientY+document.documentElement.scrollTop}},DayPilot.Stats={},DayPilot.Stats.eventObjects=0,DayPilot.Stats.dateObjects=0,DayPilot.Stats.cacheHitsCtor=0,DayPilot.Stats.cacheHitsParsing=0,DayPilot.Stats.cacheHitsTicks=0,DayPilot.Stats.print=function(){console.log("DayPilot.Stats.eventObjects: "+DayPilot.Stats.eventObjects),console.log("DayPilot.Stats.dateObjects: "+DayPilot.Stats.dateObjects),console.log("DayPilot.Stats.cacheHitsCtor: "+DayPilot.Stats.cacheHitsCtor),console.log("DayPilot.Stats.cacheHitsParsing: "+DayPilot.Stats.cacheHitsParsing),console.log("DayPilot.Stats.cacheHitsTicks: "+DayPilot.Stats.cacheHitsTicks),console.log("DayPilot.Date.Cache.Ctor keys: "+Object.keys(DayPilot.Date.Cache.Ctor).length),console.log("DayPilot.Date.Cache.Parsing keys: "+Object.keys(DayPilot.Date.Cache.Parsing).length)},DayPilot.list=function(e,t){if(e&&e.isDayPilotList&&!t)return e;var i=DayPilot.isArray(e)||"[object NodeList]"===Object.prototype.toString.call(e),n=!i&&!DayPilot.Util.isNullOrUndefined(e),a=[];if(a.isDayPilotList=!0,a.clone=function(){var e=DayPilot.list();return a.each(function(t){e.push(t)}),e},a.each=function(e){if(e){if(a.forEach)return void a.forEach(e);for(var t=0;to.y&&(d-=180);var b=document.createElement("div");b.style.borderColor="black",b.style.width="10px",b.style.height="10px",b.style.borderRadius="10px",b.style.backgroundColor="black",b.style.position="absolute",b.style.left=m+"px",b.style.top=y+"px",g.appendChild(b)}return g},DayPilot.deg=function(e,t,i,n){var a,o=Math.abs(e-i),r=Math.abs(t-n),l=(e+i)/2,s=(t+n)/2,d=Math.sqrt(o*o+r*r),c=l-d/2,h=s;o=d/2,a=Math.abs(l-c),r=Math.sqrt(Math.abs(e-c)*Math.abs(e-c)+Math.abs(t-h)*Math.abs(t-h));var u=(r*r-o*o-a*a)/(2*o*a);return 180*Math.acos(u)/Math.PI},DayPilot.complete=function(e){return"complete"===document.readyState?void e():(DayPilot.complete.list||(DayPilot.complete.list=[],DayPilot.re(document,"readystatechange",function(){if("complete"===document.readyState){for(var e=0;e0&&i.x+i.w>e.clientWidth&&(i.w-=i.x+i.w-e.clientWidth),e.scrollTop&&i.y+i.h>e.clientHeight&&(i.h-=i.y+i.h-e.clientHeight)),i.x+=e.offsetLeft,i.y+=e.offsetTop;var n=DayPilot.pageOffset();return i.x+=n.x,i.y+=n.y,i},DayPilot.wd=function(){var e=DayPilot.isIEQuirks,t=document.documentElement.clientHeight;e&&(t=document.body.clientHeight);var i=document.documentElement.clientWidth;e&&(i=document.body.clientWidth);var n=document.documentElement&&document.documentElement.scrollTop||document.body.scrollTop,a=document.documentElement&&document.documentElement.scrollLeft||document.body.scrollLeft,o={};return o.width=i,o.height=t,o.scrollTop=n,o.scrollLeft=a,o},DayPilot.op=function(e){try{return e.offsetParent}catch(e){return document.body}},DayPilot.distance=function(e,t){return Math.sqrt(Math.pow(e.x-t.x,2)+Math.pow(e.y-t.y,2))},DayPilot.doc=function(){var e=document.documentElement;return e&&e.clientHeight?e:document.body},DayPilot.pageOffset=function(){if("undefined"!=typeof window.pageXOffset)return{x:window.pageXOffset,y:window.pageYOffset};var e=DayPilot.doc();return{x:e.scrollLeft,y:e.scrollTop}},DayPilot.ac=function(e,t){if(!t)var t=[];for(var i=0;e.children&&i/g,">"),t=t.replace(/"/g,""")},DayPilot.he2=function(e){var t=document.createTextNode(e),i=document.createElement("div");return i.appendChild(t),i.innerHTML},DayPilot.us=function(e){if(e){e.setAttribute("unselectable","on"),e.style.userSelect="none",e.style.MozUserSelect="none",e.style.KhtmlUserSelect="none",e.style.webkitUserSelect="none";for(var t=0;t0,o=t<0;if(0!==t){if(a?e.status="in":o&&(e.status="out"),a&&!n)e.target=parseFloat(e.style.opacity),e.opacity=0,e.style.opacity=0,e.style.filter="alpha(opacity=0)",e.style.display="";else if(o&&!e.target)e.target=e.style.opacity;else{var r=e.opacity,l=Math.floor(10*(r+t))/10;a&&l>e.target&&(l=e.target),o&&l<0&&(l=0);var s=100*l;e.opacity=l,e.style.opacity=l,e.style.filter="alpha(opacity="+s+")"}if(a&&(e.opacity>=e.target||e.opacity>=1)||o&&e.opacity<=0){if(e.target=null,o){e.style.opacity=e.target,e.opacity=e.target;var d=e.target?"alpha(opacity="+100*e.target+")":null;e.style.filter=d,e.style.display="none"}i&&"function"==typeof i&&(e.status=null,i())}else e.messageTimeout=setTimeout(function(){DayPilot.fade(e,t,i)},50)}}},DayPilot.sw=function(e){return e?e.offsetWidth-e.clientWidth:0},DayPilot.swa=function(){var e=document.createElement("div");e.style.position="absolute",e.style.top="-2000px",e.style.left="-2000px",e.style.width="200px",e.style.height="100px",e.style.overflow="auto";var t=document.createElement("div");t.style.width="300px",t.style.height="300px",e.appendChild(t),document.body.appendChild(e);var i=DayPilot.sw(e);return document.body.removeChild(e),i},DayPilot.sh=function(e){return e?e.offsetHeight-e.clientHeight:0},DayPilot.guid=function(){var e=function(){return(65536*(1+Math.random())|0).toString(16).substring(1)};return""+e()+e()+"-"+e()+"-"+e()+"-"+e()+"-"+e()+e()+e()},DayPilot.ua=function(e){if("string"==typeof e||"number"==typeof e)return[e];for(var t={},i=[],n=0,a=e.length;n.8;n-=i)e.push(n),t=n;for(var n=t;n<=1;n+=i)e.push(n),t=n;return e},i=function(){var e=[];e.time=10;var t,i=.04;t=.1;for(var n=t;n<=1;n+=i)e.push(n),t=n;return e},n=function(){var e=[];e.time=10;var t,i=.08;t=.1;for(var n=t;n<=1;n+=i)e.push(n),t=n;return e},a={"fast":n,"slow":i,"jump":t};return a[e]||(e="fast"),a[e]()}function i(e){var t,n=e.div,a=e[e.i],o=a*e.target.h;switch(e.config.vertical){case"center":t=e.target.y-(o-e.target.h)/2;break;case"top":t=e.target.y;break;case"bottom":t=e.target.y-(o-e.target.h);break;default:throw"Unexpected 'vertical' value."}var r,l=a*e.target.w;switch(e.config.horizontal){case"left":r=e.target.x;break;case"center":r=e.target.x-(l-e.target.w)/2;break;case"right":r=e.target.x-(l-e.target.w);break;default:throw"Unexpected 'horizontal' value."}var s=DayPilot.wd(),d=s.height+s.scrollTop-(t+o);d<0&&(t+=d);var c=s.width-(r+l);c<0&&(r+=c),n.style.height=o+"px",n.style.top=t+"px",n.style.width=l+"px",n.style.left=r+"px",n.style.visibility="visible",e.i++,e.i=n)},DayPilot.Util.isMouseEvent=function(e){return!!navigator.msPointerEnabled&&(!!e.pointerType&&("mouse"===e.pointerType||4===e.pointerType))},DayPilot.Util.mouseButton=function(e){var t={};if(e=e||window.event,"undefined"==typeof e.which)switch(e.button){case 1:t.left=!0;break;case 4:t.middle=!0;break;case 2:t.right=!0;break;case 0:t.unknown=!0}else switch(e.which){case 1:t.left=!0;break;case 2:t.middle=!0;break;case 3:t.right=!0}return t},DayPilot.Util.membersPlain=function(e){var t=DayPilot.Util.members(e,2),i=function(e){for(var t=0;t=0)&&(!(t.indexOf("after")>=0)&&("onrowfilter"!==t&&"oneventfilter"!==t))},DayPilot.Util.safeApply=function(e,t){var i=e["$root"]["$$phase"];"$apply"===i||"$digest"===i?e["$eval"](t):e["$apply"](t)},DayPilot.Util.members=function(e,t){var i=DayPilot.list(),n=DayPilot.list(),a=DayPilot.list(),o=e&&e.members?e.members.obsolete:[],r=e&&e.members?e.members.noCssOnly:[],l=e&&e.members?e.members.ignore:[],s=e&&e.members&&e.members.ignoreFilter?e.members.ignoreFilter:function(){return!1};for(var d in e)if(0!==d.indexOf("$")&&0!==d.indexOf("_")&&0!==d.indexOf("number")&&0!==d.indexOf("is")&&"v"!==d&&!DayPilot.contains(l,d)&&!s(d))if(0!==d.indexOf("on"))if("function"!=typeof e[d])if("object"!=typeof e[d])a.push(d);else{var c=e[d];if(0===t){a.push(d);continue}if(c&&c.nodeType>0){a.push(d);continue}if(c instanceof DayPilot.Bubble){a.push(d);continue}if(c instanceof DayPilot.Date){a.push(d);continue}if(c instanceof DayPilot.Menu){a.push(d);continue}if(c instanceof DayPilot.Scheduler){a.push(d);continue}if(DayPilot.isArray(c)){a.push(d);continue}null===c&&a.push(d);var h=null;"number"==typeof t&&(h=t-1);for(var u=DayPilot.Util.members(c,h),f=0;f/gm,"");throw new DayPilot.Error("Unable to strip tags from a non-string")},DayPilot.Areas={},DayPilot.Areas.attach=function(e,t,n){var n=n||{},a=n.areas,o=n.allowed||function(){return!0},r=n.offsetX||0;a=i(t,a),a&&DayPilot.isArray(a)&&0!==a.length&&(DayPilot.re(e,"mousemove",function(i){e.active||e.areasDisabled||!o()||DayPilot.Areas.showAreas(e,t,i,a,{"offsetX":r,"eventDiv":n.eventDiv})}),DayPilot.re(e,"mouseout",function(t){DayPilot.Areas.hideAreas(e,t)}),DayPilot.list(a).each(function(i){if("Visible"===(i.visibility||i.v||"Visible")){var a=DayPilot.Areas.createArea(e,t,i,{"offsetX":r,"eventDiv":n.eventDiv});e.appendChild(a)}}))},DayPilot.Areas.disable=function(e){e.areasDisabled=!0,DayPilot.list(e.childNodes).filter(function(e){return e.isActiveArea&&!e.area.start}).each(function(e){e.style.display="none"})},DayPilot.Areas.enable=function(e){e.areasDisabled=!1,DayPilot.list(e.childNodes).filter(function(e){return e.isActiveArea&&!e.area.start}).each(function(e){e.style.display=""})},DayPilot.Areas.remove=function(e){var t=DayPilot.list(e.childNodes).filter(function(e){return e.isActiveArea});DayPilot.de(t)};var i=function(e,t){return DayPilot.isArray(t)||(t=e.areas,t||(e.cache?t=e.cache.areas:e.data&&(t=e.data.areas))),t};DayPilot.Areas.showAreas=function(e,t,i,n,a){if(!DayPilot.Global.resizing&&!DayPilot.Global.moving){if(DayPilot.Areas.all&&DayPilot.Areas.all.length>0)for(var o=0;o0))){e.areas=[];for(var o=0;o0){for(;e>=12;)e-=12,i++;e>12-n?(i++,n=e-(12-n)):n+=e}else{for(;e<=-12;)e+=12,i--;n+e<=0?(i--,n=12+n+e):n+=e}var a=new Date(t.getTime());a.setUTCDate(1),a.setUTCFullYear(i),a.setUTCMonth(n-1);var o=new DayPilot.Date(a).daysInMonth();return a.setUTCDate(Math.min(o,t.getUTCDate())),new DayPilot.Date(a)},DayPilot.Date.prototype.addSeconds=function(e){return this.addTime(1e3*e)},DayPilot.Date.prototype.addTime=function(e){return e instanceof DayPilot.Duration&&(e=e.ticks),new DayPilot.Date(this.ticks+e)},DayPilot.Date.prototype.addYears=function(e){var t=new Date(this.ticks),i=new Date(this.ticks),n=this.getYear()+e,a=this.getMonth();i.setUTCDate(1),i.setUTCFullYear(n),i.setUTCMonth(a);var o=new DayPilot.Date(i).daysInMonth();return i.setUTCDate(Math.min(o,t.getUTCDate())),new DayPilot.Date(i)},DayPilot.Date.prototype.dayOfWeek=function(){return new Date(this.ticks).getUTCDay()},DayPilot.Date.prototype.getDayOfWeek=function(){return new Date(this.ticks).getUTCDay()},DayPilot.Date.prototype.daysInMonth=function(){var e=new Date(this.ticks),t=e.getUTCMonth()+1,i=e.getUTCFullYear(),n=[31,28,31,30,31,30,31,31,30,31,30,31];return 2!==t?n[t-1]:i%4!==0?n[1]:i%100===0&&i%400!==0?n[1]:n[1]+1},DayPilot.Date.prototype.daysInYear=function(){var e=this.getYear();return e%4!==0?365:e%100===0&&e%400!==0?365:366},DayPilot.Date.prototype.dayOfYear=function(){return Math.ceil((this.getDatePart().getTime()-this.firstDayOfYear().getTime())/864e5)+1},DayPilot.Date.prototype.equals=function(e){if(null===e)return!1;if(e instanceof DayPilot.Date)return this===e;throw"The parameter must be a DayPilot.Date object (DayPilot.Date.equals())"},DayPilot.Date.prototype.firstDayOfMonth=function(){var e=new Date;return e.setUTCFullYear(this.getYear(),this.getMonth(),1),e.setUTCHours(0),e.setUTCMinutes(0),e.setUTCSeconds(0),e.setUTCMilliseconds(0),new DayPilot.Date(e)},DayPilot.Date.prototype.firstDayOfYear=function(){var e=this.getYear(),t=new Date;return t.setUTCFullYear(e,0,1),t.setUTCHours(0),t.setUTCMinutes(0),t.setUTCSeconds(0),t.setUTCMilliseconds(0),new DayPilot.Date(t)},DayPilot.Date.prototype.firstDayOfWeek=function(e){for(var t=this,e=e||0,i=t.dayOfWeek();i!==e;)t=t.addDays(-1),i=t.dayOfWeek();return new DayPilot.Date(t)},DayPilot.Date.prototype.getDay=function(){return new Date(this.ticks).getUTCDate()},DayPilot.Date.prototype.getDatePart=function(){var e=new Date(this.ticks);return e.setUTCHours(0),e.setUTCMinutes(0),e.setUTCSeconds(0),e.setUTCMilliseconds(0),new DayPilot.Date(e)},DayPilot.Date.prototype.getYear=function(){return new Date(this.ticks).getUTCFullYear()},DayPilot.Date.prototype.getHours=function(){return new Date(this.ticks).getUTCHours()},DayPilot.Date.prototype.getMilliseconds=function(){return new Date(this.ticks).getUTCMilliseconds()},DayPilot.Date.prototype.getMinutes=function(){return new Date(this.ticks).getUTCMinutes()},DayPilot.Date.prototype.getMonth=function(){return new Date(this.ticks).getUTCMonth()},DayPilot.Date.prototype.getSeconds=function(){return new Date(this.ticks).getUTCSeconds()},DayPilot.Date.prototype.getTotalTicks=function(){return this.getTime()},DayPilot.Date.prototype.getTime=function(){return this.ticks},DayPilot.Date.prototype.getTimePart=function(){var e=this.getDatePart();return DayPilot.DateUtil.diff(this,e)},DayPilot.Date.prototype.lastDayOfMonth=function(){var e=new Date(this.firstDayOfMonth().getTime()),t=this.daysInMonth();return e.setUTCDate(t),new DayPilot.Date(e)},DayPilot.Date.prototype.weekNumber=function(){var e=this.firstDayOfYear(),t=(this.getTime()-e.getTime())/864e5;return Math.ceil((t+e.dayOfWeek()+1)/7)},DayPilot.Date.prototype.weekNumberISO=function(){var e=!1,t=this.dayOfYear(),i=this.firstDayOfYear().dayOfWeek(),n=this.firstDayOfYear().addYears(1).addDays(-1).dayOfWeek();0===i&&(i=7),0===n&&(n=7);var a=8-i;4!==i&&4!==n||(e=!0);var o=Math.ceil((t-a)/7),r=o;return a>=4&&(r+=1),r>52&&!e&&(r=1),0===r&&(r=this.firstDayOfYear().addDays(-1).weekNumberISO()),r},DayPilot.Date.prototype.toDateLocal=function(){var e=new Date(this.ticks),t=new Date;return t.setFullYear(e.getUTCFullYear(),e.getUTCMonth(),e.getUTCDate()),t.setHours(e.getUTCHours()),t.setMinutes(e.getUTCMinutes()),t.setSeconds(e.getUTCSeconds()),t.setMilliseconds(e.getUTCMilliseconds()),t},DayPilot.Date.prototype.toDate=function(){return new Date(this.ticks)},DayPilot.Date.prototype.toJSON=function(){return this.value},DayPilot.Date.prototype.toString=function(e,t){return"undefined"==typeof e?this.toStringSortable():new a(e,t).print(this)},DayPilot.Date.prototype.toStringSortable=function(){return e(this.ticks)},DayPilot.Date.parse=function(e,t,i){return new a(t,i).parse(e)};var n=0;DayPilot.Date.today=function(){return new DayPilot.Date(DayPilot.DateUtil.localToday())},DayPilot.Date.fromYearMonthDay=function(e,t,i){t=t||1,i=i||1;var n=new Date(0);return n.setUTCFullYear(e),n.setUTCMonth(t-1),n.setUTCDate(i),new DayPilot.Date(n)},DayPilot.DateUtil={},DayPilot.DateUtil.fromStringSortable=function(e,t){if(!e)throw"Can't create DayPilot.Date from an empty string";var i=e.length,n=10===i,a=19===i,o=i>19;if(!n&&!a&&!o)throw"Invalid string format (use '2010-01-01' or '2010-01-01T00:00:00'): "+e;if(DayPilot.Date.Cache.Parsing[e]&&!t)return DayPilot.Stats.cacheHitsParsing+=1,DayPilot.Date.Cache.Parsing[e];var r=e.substring(0,4),l=e.substring(5,7),s=e.substring(8,10),d=new Date(0);if(d.setUTCFullYear(r,l-1,s),n)return DayPilot.Date.Cache.Parsing[e]=d,d;var c=e.substring(11,13),h=e.substring(14,16),u=e.substring(17,19);if(d.setUTCHours(c),d.setUTCMinutes(h),d.setUTCSeconds(u),a)return DayPilot.Date.Cache.Parsing[e]=d,d;var f=e[19],v=0;if("."===f){var p=parseInt(e.substring(20,23));d.setUTCMilliseconds(p),v=DayPilot.DateUtil.getTzOffsetMinutes(e.substring(23))}else v=DayPilot.DateUtil.getTzOffsetMinutes(e.substring(19));var g=new DayPilot.Date(d);return t||(g=g.addMinutes(-v)),d=g.toDate(),DayPilot.Date.Cache.Parsing[e]=d,d},DayPilot.DateUtil.getTzOffsetMinutes=function(e){if(DayPilot.Util.isNullOrUndefined(e)||""===e)return 0;if("Z"===e)return 0;var t=e[0],i=parseInt(e.substring(1,3)),n=parseInt(e.substring(4)),a=60*i+n;if("-"===t)return-a;if("+"===t)return a;throw"Invalid timezone spec: "+e},DayPilot.DateUtil.hasTzSpec=function(e){return!!e.indexOf("+")||!!e.indexOf("-")},DayPilot.DateUtil.daysDiff=function(e,t){if(e&&t||function(){throw"two parameters required"}(),e=new DayPilot.Date(e),t=new DayPilot.Date(t),e.getTime()>t.getTime())return null;for(var i=0,n=e.getDatePart(),a=t.getDatePart();nt.getTime()?e:t},DayPilot.DateUtil.min=function(e,t){return e.getTime()0){var d=s[0],c=i(d);c?r.push(c):r.push(d),o+=d.length,a=e.length<=o}else a=!0}for(var h=0;h12||i<1)return null;var n=this.day.findValue(e),a=DayPilot.Date.fromYearMonthDay(t,i).daysInMonth();if(n<1||n>a)return null;var o=this.hours?this.hours.findValue(e):0,r=this.minutes?this.minutes.findValue(e):0,l=this.seconds?this.seconds.findValue(e):0,s=this.ampm?this.ampm.findValue(e):null;if(this.ampm&&this.hours12){var d=this.hours12.findValue(e);if(d<1||d>12)return null;o="PM"===s?12===d?12:d+12:12===d?0:d}if(o<0||o>23)return null;if(r<0||r>59)return null;if(l<0||l>59)return null;var c=new Date;return c.setUTCFullYear(t,i-1,n),c.setUTCHours(o),c.setUTCMinutes(r),c.setUTCSeconds(l),c.setUTCMilliseconds(0),new DayPilot.Date(c)},this.init()};DayPilot.Canvas=function(e,t,i,n,a){function o(e,t,i){for(var n=t.split(" "),a=[],o=n[0],r=1;r"},this.getDataUri=function(){return r.toDataURL(i,a)},this.getDefaultFileName=function(){return this.defaultFileName},this.getBlob=function(){return r.msToBlob?r.msToBlob():DayPilot.Util.dataUriToBlob(this.getDataUri())}},DayPilot.Svg=function(e,t){function i(e,t){var i=null;if(e){if("string"==typeof e){if(0===e.indexOf("data:")){var n={};n.dataUri=e,t(n)}i=e}else i=e.src;var e=document.createElement("img");e.onload=function(){var e=document.createElement("canvas");e.width=this.naturalWidth,e.height=this.naturalHeight,e.getContext("2d").drawImage(this,0,0);var i={};i.dataUri=e.toDataURL("image/png"),t(i)},e.src=i}}var n="http://www.w3.org/2000/svg",a=document.createElementNS(n,"svg");a.outerHTML&&a.setAttribute("xmlns",n),a.setAttribute("viewBox","0 0 "+e+" "+t),this.defaultFileName="image.svg",this.fillRect=function(e,t){var i=document.createElementNS(n,"rect");i.setAttribute("x",e.x+.5),i.setAttribute("y",e.y+.5),i.setAttribute("width",e.w-1),i.setAttribute("height",e.h-1),i.setAttribute("fill",t),a.appendChild(i)},this.rect=function(e,t){var i=document.createElementNS(n,"rect");i.setAttribute("x",e.x+.5),i.setAttribute("y",e.y+.5),i.setAttribute("width",e.w-1),i.setAttribute("height",e.h-1),i.setAttribute("stroke",t),i.setAttribute("stroke-width","1"),i.setAttribute("fill","transparent"),a.appendChild(i)},this.text=function(e,t,i,o,r,l){function s(e,t,r){var l=document.createElementNS(n,"text");l.setAttribute("fill",o),l.setAttribute("font-family",i.family),l.setAttribute("font-size",i.size),l.setAttribute("font-style",i.style),l.setAttribute("x",t),l.setAttribute("y",r),l.setAttribute("dy","1em"),l.setAttribute("text-anchor",h),l.setAttribute("clip-path","url(#"+u.id+")");var s=document.createTextNode(e);l.appendChild(s),a.appendChild(l)}if("number"==typeof t&&(t=""+t),"string"!=typeof t)throw"String expected";var r=r||"left",l=l||0,d=3,c=e.x,h="start";switch(r){case"center":c+=e.w/2,h="middle";break;case"right":c+=e.w,h="end"}var u=document.createElementNS(n,"clipPath");u.id="clip"+DayPilot.guid();var f=document.createElementNS(n,"rect");f.setAttribute("x",e.x),f.setAttribute("y",e.y),f.setAttribute("width",e.w),f.setAttribute("height",e.h),u.appendChild(f),a.appendChild(u);for(var v=1.2*parseInt(i.size),p=t.split("\n"),g=e.y+l+d,y=0;y'+(new XMLSerializer).serializeToString(t)},this.getDataUri=function(){return"data:application/vnd.ms-excel,"+encodeURIComponent(this.getSource())},this.getElement=function(){return t},this.getDefaultFileName=function(){return"spreadsheet.xls"},this.getBlob=function(){return new Blob([this.getSource()])};var o=function(e){var i=t.createElement("Table");e.appendChild(i);var n=t.createElement("x:WorksheetOptions");e.appendChild(n),this.rows=[],this.setName=function(t){e.setAttribute("ss:Name",t)},this.cell=function(e,n){for(;n>=this.rows.length;){var o=t.createElement("Row");i.appendChild(o),this.rows.push(new a(o))}return this.rows[n].cell(e)},this.enableGridlines=function(e){var i=DayPilot.list(n.childNodes).find(function(e){return"x:DoNotDisplayGridlines"===e.tagName});if(!i&&!e){var a=t.createElement("x:DoNotDisplayGridlines");n.appendChild(a)}i&&e&&n.removeChild(i)};var a=function(e){this.cells=[],this.getElement=function(){return e},this.cell=function(n){for(;n>=this.cells.length;){var a=t.createElement("Cell");e.appendChild(a),this.cells.push(new i(a))}return this.cells[n]};var i=function(e){this.setText=function(i){var n=t.createElement("Data");n.setAttribute("ss:Type","String");var a=t.createTextNode(i);for(n.appendChild(a);e.firstChild;)e.removeChild(e.firstChild);return e.appendChild(n),this},this.setColspan=function(t){return t>1?e.setAttribute("ss:MergeAcross",t-1):e.removeAttribute("ss:MergeAcross"),this},this.setRowspan=function(t){return t>1?e.setAttribute("ss:MergeDown",t-1):e.removeAttribute("ss:MergeDown"),this},this.setStyle=function(t){if(!(t instanceof r))throw"Invalid argument, Style expected";return e.setAttribute("ss:StyleID",t.getId()),this}}}},r=function(e){var i=DayPilot.guid();e.setAttribute("ss:ID",i);var n=t.createElement("ss:Alignment");e.appendChild(n);var a=t.createElement("ss:Interior");e.appendChild(a);var o=t.createElement("ss:Borders");e.appendChild(o),this.setHorizontalAlignment=function(e){n.setAttribute("ss:Horizontal",e)},this.setVerticalAlignment=function(e){n.setAttribute("ss:Vertical",e)},this.setBackColor=function(e){var t=DayPilot.Util.normalizeColor(e);a.setAttribute("ss:Color",t),a.setAttribute("ss:Pattern","Solid")},this.setBorderColor=function(e){function i(e,i){var n=t.createElement("ss:Border");return n.setAttribute("ss:Position",e),n.setAttribute("ss:LineStyle","Continuous"),n.setAttribute("ss:Color",DayPilot.Util.normalizeColor(i)),n}this.clearBorders();var n=i("Left",e);o.appendChild(n);var a=i("Right",e);o.appendChild(a);var r=i("Top",e);o.appendChild(r);var l=i("Bottom",e);o.appendChild(l)},this.clearBorders=function(){for(;o.firstChild;)o.removeChild(o.firstChild)},this.getId=function(){return i},this.setId=function(t){i=t,e.setAttribute("ss:ID",i)},this.setName=function(t){e.setAttribute("ss:Name",t)}};this.init()},DayPilot.Export=function(e){this.toElement=function(){return e.getElement()},this.dimensions=function(){return{"width":e.getWidth(),"height":e.getHeight()}},this.toHtml=function(){return e.getSource()},this.toDataUri=function(){return e.getDataUri()},this.toBlob=function(){return e.getBlob()},this.print=function(t){t=t||{},t.orientation=t.orientation||"portrait";var i=document.createElement("iframe");i.setAttribute("width",0),i.setAttribute("height",0),i.setAttribute("frameborder",0),i.setAttribute("src","about:blank"),i.onload=function(){var n=i.contentWindow.document;if(n.body.appendChild(e.getElement()),"landscape"===t.orientation){var a=DayPilot.sheet(n);a.add("@page","size: landscape;"),a.commit()}i.contentWindow.document.execCommand("print",!1,null)||(i.contentWindow.focus(),i.contentWindow.print()),setTimeout(function(){document.body.removeChild(i)},10)},document.body.appendChild(i)},this.download=function(t){var t=t||e.getDefaultFileName(),i=e.getBlob();DayPilot.Util.downloadBlob(i,t)}},DayPilot.Exception=function(e){this.message=e,this.toString=function(){return this.message}},DayPilot.Locale=function(e,t){if(this.id=e,this.dayNames=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],this.dayNamesShort=["Su","Mo","Tu","We","Th","Fr","Sa"],this.monthNames=["January","February","March","April","May","June","July","August","September","October","November","December"],this.monthNamesShort=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],this.datePattern="M/d/yyyy",this.timePattern="H:mm",this.dateTimePattern="M/d/yyyy H:mm",this.timeFormat="Clock12Hours",this.weekStarts=0,t)for(var i in t)this[i]=t[i]},DayPilot.Locale.all={},DayPilot.Locale.find=function(e){if(!e)return null;var t=e.toLowerCase();return t.length>2&&(t=DayPilot.Util.replaceCharAt(t,2,"-")),DayPilot.Locale.all[t]},DayPilot.Locale.register=function(e){DayPilot.Locale.all[e.id]=e},DayPilot.Locale.register(new DayPilot.Locale("ca-es",{"dayNames":["diumenge","dilluns","dimarts","dimecres","dijous","divendres","dissabte"],"dayNamesShort":["dg","dl","dt","dc","dj","dv","ds"],"monthNames":["gener","febrer","març","abril","maig","juny","juliol","agost","setembre","octubre","novembre","desembre",""],"monthNamesShort":["gen.","febr.","març","abr.","maig","juny","jul.","ag.","set.","oct.","nov.","des.",""],"timePattern":"H:mm","datePattern":"dd/MM/yyyy","dateTimePattern":"dd/MM/yyyy H:mm","timeFormat":"Clock24Hours","weekStarts":1})),DayPilot.Locale.register(new DayPilot.Locale("cs-cz",{"dayNames":["neděle","pondělí","úterý","středa","čtvrtek","pátek","sobota"],"dayNamesShort":["ne","po","út","st","čt","pá","so"],"monthNames":["leden","únor","březen","duben","květen","červen","červenec","srpen","září","říjen","listopad","prosinec",""],"monthNamesShort":["I","II","III","IV","V","VI","VII","VIII","IX","X","XI","XII",""],"timePattern":"H:mm","datePattern":"d. M. yyyy","dateTimePattern":"d. M. yyyy H:mm","timeFormat":"Clock24Hours","weekStarts":1})),DayPilot.Locale.register(new DayPilot.Locale("da-dk",{"dayNames":["søndag","mandag","tirsdag","onsdag","torsdag","fredag","lørdag"],"dayNamesShort":["sø","ma","ti","on","to","fr","lø"],"monthNames":["januar","februar","marts","april","maj","juni","juli","august","september","oktober","november","december",""],"monthNamesShort":["jan","feb","mar","apr","maj","jun","jul","aug","sep","okt","nov","dec",""],"timePattern":"HH:mm","datePattern":"dd-MM-yyyy","dateTimePattern":"dd-MM-yyyy HH:mm","timeFormat":"Clock24Hours","weekStarts":1})),DayPilot.Locale.register(new DayPilot.Locale("de-at",{"dayNames":["Sonntag","Montag","Dienstag","Mittwoch","Donnerstag","Freitag","Samstag"],"dayNamesShort":["So","Mo","Di","Mi","Do","Fr","Sa"],"monthNames":["Jänner","Februar","März","April","Mai","Juni","Juli","August","September","Oktober","November","Dezember",""],"monthNamesShort":["Jän","Feb","Mär","Apr","Mai","Jun","Jul","Aug","Sep","Okt","Nov","Dez",""],"timePattern":"HH:mm","datePattern":"dd.MM.yyyy","dateTimePattern":"dd.MM.yyyy HH:mm","timeFormat":"Clock24Hours","weekStarts":1})),DayPilot.Locale.register(new DayPilot.Locale("de-ch",{"dayNames":["Sonntag","Montag","Dienstag","Mittwoch","Donnerstag","Freitag","Samstag"],"dayNamesShort":["So","Mo","Di","Mi","Do","Fr","Sa"],"monthNames":["Januar","Februar","März","April","Mai","Juni","Juli","August","September","Oktober","November","Dezember",""],"monthNamesShort":["Jan","Feb","Mrz","Apr","Mai","Jun","Jul","Aug","Sep","Okt","Nov","Dez",""],"timePattern":"HH:mm","datePattern":"dd.MM.yyyy","dateTimePattern":"dd.MM.yyyy HH:mm","timeFormat":"Clock24Hours","weekStarts":1})),DayPilot.Locale.register(new DayPilot.Locale("de-de",{"dayNames":["Sonntag","Montag","Dienstag","Mittwoch","Donnerstag","Freitag","Samstag"],"dayNamesShort":["So","Mo","Di","Mi","Do","Fr","Sa"],"monthNames":["Januar","Februar","März","April","Mai","Juni","Juli","August","September","Oktober","November","Dezember",""],"monthNamesShort":["Jan","Feb","Mrz","Apr","Mai","Jun","Jul","Aug","Sep","Okt","Nov","Dez",""],"timePattern":"HH:mm","datePattern":"dd.MM.yyyy","dateTimePattern":"dd.MM.yyyy HH:mm","timeFormat":"Clock24Hours","weekStarts":1})),DayPilot.Locale.register(new DayPilot.Locale("de-lu",{"dayNames":["Sonntag","Montag","Dienstag","Mittwoch","Donnerstag","Freitag","Samstag"],"dayNamesShort":["So","Mo","Di","Mi","Do","Fr","Sa"],"monthNames":["Januar","Februar","März","April","Mai","Juni","Juli","August","September","Oktober","November","Dezember",""],"monthNamesShort":["Jan","Feb","Mrz","Apr","Mai","Jun","Jul","Aug","Sep","Okt","Nov","Dez",""],"timePattern":"HH:mm","datePattern":"dd.MM.yyyy","dateTimePattern":"dd.MM.yyyy HH:mm","timeFormat":"Clock24Hours","weekStarts":1})),DayPilot.Locale.register(new DayPilot.Locale("en-au",{"dayNames":["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],"dayNamesShort":["Su","Mo","Tu","We","Th","Fr","Sa"],"monthNames":["January","February","March","April","May","June","July","August","September","October","November","December",""],"monthNamesShort":["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec",""],"timePattern":"h:mm tt","datePattern":"d/MM/yyyy","dateTimePattern":"d/MM/yyyy h:mm tt","timeFormat":"Clock12Hours","weekStarts":1})),DayPilot.Locale.register(new DayPilot.Locale("en-ca",{"dayNames":["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],"dayNamesShort":["Su","Mo","Tu","We","Th","Fr","Sa"],"monthNames":["January","February","March","April","May","June","July","August","September","October","November","December",""],"monthNamesShort":["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec",""],"timePattern":"h:mm tt","datePattern":"yyyy-MM-dd","dateTimePattern":"yyyy-MM-dd h:mm tt","timeFormat":"Clock12Hours","weekStarts":0})),DayPilot.Locale.register(new DayPilot.Locale("en-gb",{"dayNames":["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],"dayNamesShort":["Su","Mo","Tu","We","Th","Fr","Sa"],"monthNames":["January","February","March","April","May","June","July","August","September","October","November","December",""],"monthNamesShort":["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec",""],"timePattern":"HH:mm","datePattern":"dd/MM/yyyy","dateTimePattern":"dd/MM/yyyy HH:mm","timeFormat":"Clock24Hours","weekStarts":1})),DayPilot.Locale.register(new DayPilot.Locale("en-us",{"dayNames":["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],"dayNamesShort":["Su","Mo","Tu","We","Th","Fr","Sa"],"monthNames":["January","February","March","April","May","June","July","August","September","October","November","December",""],"monthNamesShort":["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec",""],"timePattern":"h:mm tt","datePattern":"M/d/yyyy","dateTimePattern":"M/d/yyyy h:mm tt","timeFormat":"Clock12Hours","weekStarts":0})),DayPilot.Locale.register(new DayPilot.Locale("es-es",{"dayNames":["domingo","lunes","martes","miércoles","jueves","viernes","sábado"],"dayNamesShort":["D","L","M","X","J","V","S"],"monthNames":["enero","febrero","marzo","abril","mayo","junio","julio","agosto","septiembre","octubre","noviembre","diciembre",""],"monthNamesShort":["ene.","feb.","mar.","abr.","may.","jun.","jul.","ago.","sep.","oct.","nov.","dic.",""],"timePattern":"H:mm","datePattern":"dd/MM/yyyy","dateTimePattern":"dd/MM/yyyy H:mm","timeFormat":"Clock24Hours","weekStarts":1})),DayPilot.Locale.register(new DayPilot.Locale("es-mx",{"dayNames":["domingo","lunes","martes","miércoles","jueves","viernes","sábado"],"dayNamesShort":["do.","lu.","ma.","mi.","ju.","vi.","sá."],"monthNames":["enero","febrero","marzo","abril","mayo","junio","julio","agosto","septiembre","octubre","noviembre","diciembre",""],"monthNamesShort":["ene.","feb.","mar.","abr.","may.","jun.","jul.","ago.","sep.","oct.","nov.","dic.",""],"timePattern":"hh:mm tt","datePattern":"dd/MM/yyyy","dateTimePattern":"dd/MM/yyyy hh:mm tt","timeFormat":"Clock12Hours","weekStarts":0})),DayPilot.Locale.register(new DayPilot.Locale("eu-es",{"dayNames":["igandea","astelehena","asteartea","asteazkena","osteguna","ostirala","larunbata"],"dayNamesShort":["ig","al","as","az","og","or","lr"],"monthNames":["urtarrila","otsaila","martxoa","apirila","maiatza","ekaina","uztaila","abuztua","iraila","urria","azaroa","abendua",""],"monthNamesShort":["urt.","ots.","mar.","api.","mai.","eka.","uzt.","abu.","ira.","urr.","aza.","abe.",""],"timePattern":"H:mm","datePattern":"yyyy/MM/dd","dateTimePattern":"yyyy/MM/dd H:mm","timeFormat":"Clock24Hours","weekStarts":1})),DayPilot.Locale.register(new DayPilot.Locale("fi-fi",{"dayNames":["sunnuntai","maanantai","tiistai","keskiviikko","torstai","perjantai","lauantai"],"dayNamesShort":["su","ma","ti","ke","to","pe","la"],"monthNames":["tammikuu","helmikuu","maaliskuu","huhtikuu","toukokuu","kesäkuu","heinäkuu","elokuu","syyskuu","lokakuu","marraskuu","joulukuu",""],"monthNamesShort":["tammi","helmi","maalis","huhti","touko","kesä","heinä","elo","syys","loka","marras","joulu",""],"timePattern":"H:mm","datePattern":"d.M.yyyy","dateTimePattern":"d.M.yyyy H:mm","timeFormat":"Clock24Hours","weekStarts":1})),DayPilot.Locale.register(new DayPilot.Locale("fr-be",{"dayNames":["dimanche","lundi","mardi","mercredi","jeudi","vendredi","samedi"],"dayNamesShort":["di","lu","ma","me","je","ve","sa"],"monthNames":["janvier","février","mars","avril","mai","juin","juillet","août","septembre","octobre","novembre","décembre",""],"monthNamesShort":["janv.","févr.","mars","avr.","mai","juin","juil.","août","sept.","oct.","nov.","déc.",""],"timePattern":"HH:mm","datePattern":"dd-MM-yy","dateTimePattern":"dd-MM-yy HH:mm","timeFormat":"Clock24Hours","weekStarts":1})),DayPilot.Locale.register(new DayPilot.Locale("fr-ca",{"dayNames":["dimanche","lundi","mardi","mercredi","jeudi","vendredi","samedi"],"dayNamesShort":["di","lu","ma","me","je","ve","sa"],"monthNames":["janvier","février","mars","avril","mai","juin","juillet","août","septembre","octobre","novembre","décembre",""],"monthNamesShort":["janv.","févr.","mars","avr.","mai","juin","juil.","août","sept.","oct.","nov.","déc.",""],"timePattern":"HH:mm","datePattern":"yyyy-MM-dd","dateTimePattern":"yyyy-MM-dd HH:mm","timeFormat":"Clock24Hours","weekStarts":0})),DayPilot.Locale.register(new DayPilot.Locale("fr-ch",{"dayNames":["dimanche","lundi","mardi","mercredi","jeudi","vendredi","samedi"],"dayNamesShort":["di","lu","ma","me","je","ve","sa"],"monthNames":["janvier","février","mars","avril","mai","juin","juillet","août","septembre","octobre","novembre","décembre",""],"monthNamesShort":["janv.","févr.","mars","avr.","mai","juin","juil.","août","sept.","oct.","nov.","déc.",""],"timePattern":"HH:mm","datePattern":"dd.MM.yyyy","dateTimePattern":"dd.MM.yyyy HH:mm","timeFormat":"Clock24Hours","weekStarts":1})),DayPilot.Locale.register(new DayPilot.Locale("fr-fr",{"dayNames":["dimanche","lundi","mardi","mercredi","jeudi","vendredi","samedi"],"dayNamesShort":["di","lu","ma","me","je","ve","sa"],"monthNames":["janvier","février","mars","avril","mai","juin","juillet","août","septembre","octobre","novembre","décembre",""],"monthNamesShort":["janv.","févr.","mars","avr.","mai","juin","juil.","août","sept.","oct.","nov.","déc.",""],"timePattern":"HH:mm","datePattern":"dd/MM/yyyy","dateTimePattern":"dd/MM/yyyy HH:mm","timeFormat":"Clock24Hours","weekStarts":1})),DayPilot.Locale.register(new DayPilot.Locale("fr-lu",{"dayNames":["dimanche","lundi","mardi","mercredi","jeudi","vendredi","samedi"],"dayNamesShort":["di","lu","ma","me","je","ve","sa"],"monthNames":["janvier","février","mars","avril","mai","juin","juillet","août","septembre","octobre","novembre","décembre",""],"monthNamesShort":["janv.","févr.","mars","avr.","mai","juin","juil.","août","sept.","oct.","nov.","déc.",""],"timePattern":"HH:mm","datePattern":"dd/MM/yyyy","dateTimePattern":"dd/MM/yyyy HH:mm","timeFormat":"Clock24Hours","weekStarts":1})),DayPilot.Locale.register(new DayPilot.Locale("gl-es",{"dayNames":["domingo","luns","martes","mércores","xoves","venres","sábado"],"dayNamesShort":["do","lu","ma","mé","xo","ve","sá"],"monthNames":["xaneiro","febreiro","marzo","abril","maio","xuño","xullo","agosto","setembro","outubro","novembro","decembro",""],"monthNamesShort":["xan","feb","mar","abr","maio","xuño","xul","ago","set","out","nov","dec",""],"timePattern":"H:mm","datePattern":"dd/MM/yyyy","dateTimePattern":"dd/MM/yyyy H:mm","timeFormat":"Clock24Hours","weekStarts":1})),DayPilot.Locale.register(new DayPilot.Locale("it-it",{"dayNames":["domenica","lunedì","martedì","mercoledì","giovedì","venerdì","sabato"],"dayNamesShort":["do","lu","ma","me","gi","ve","sa"],"monthNames":["gennaio","febbraio","marzo","aprile","maggio","giugno","luglio","agosto","settembre","ottobre","novembre","dicembre",""],"monthNamesShort":["gen","feb","mar","apr","mag","giu","lug","ago","set","ott","nov","dic",""],"timePattern":"HH:mm","datePattern":"dd/MM/yyyy","dateTimePattern":"dd/MM/yyyy HH:mm","timeFormat":"Clock24Hours","weekStarts":1})),DayPilot.Locale.register(new DayPilot.Locale("it-ch",{"dayNames":["domenica","lunedì","martedì","mercoledì","giovedì","venerdì","sabato"],"dayNamesShort":["do","lu","ma","me","gi","ve","sa"],"monthNames":["gennaio","febbraio","marzo","aprile","maggio","giugno","luglio","agosto","settembre","ottobre","novembre","dicembre",""],"monthNamesShort":["gen","feb","mar","apr","mag","giu","lug","ago","set","ott","nov","dic",""],"timePattern":"HH:mm","datePattern":"dd.MM.yyyy","dateTimePattern":"dd.MM.yyyy HH:mm","timeFormat":"Clock24Hours","weekStarts":1})),DayPilot.Locale.register(new DayPilot.Locale("ja-jp",{"dayNames":["日曜日","月曜日","火曜日","水曜日","木曜日","金曜日","土曜日"],"dayNamesShort":["日","月","火","水","木","金","土"],"monthNames":["1月","2月","3月","4月","5月","6月","7月","8月","9月","10月","11月","12月",""],"monthNamesShort":["1","2","3","4","5","6","7","8","9","10","11","12",""],"timePattern":"H:mm","datePattern":"yyyy/MM/dd","dateTimePattern":"yyyy/MM/dd H:mm","timeFormat":"Clock24Hours","weekStarts":0})),DayPilot.Locale.register(new DayPilot.Locale("nb-no",{"dayNames":["søndag","mandag","tirsdag","onsdag","torsdag","fredag","lørdag"],"dayNamesShort":["sø","ma","ti","on","to","fr","lø"],"monthNames":["januar","februar","mars","april","mai","juni","juli","august","september","oktober","november","desember",""],"monthNamesShort":["jan","feb","mar","apr","mai","jun","jul","aug","sep","okt","nov","des",""],"timePattern":"HH:mm","datePattern":"dd.MM.yyyy","dateTimePattern":"dd.MM.yyyy HH:mm","timeFormat":"Clock24Hours","weekStarts":1})),DayPilot.Locale.register(new DayPilot.Locale("nl-nl",{"dayNames":["zondag","maandag","dinsdag","woensdag","donderdag","vrijdag","zaterdag"],"dayNamesShort":["zo","ma","di","wo","do","vr","za"],"monthNames":["januari","februari","maart","april","mei","juni","juli","augustus","september","oktober","november","december",""],"monthNamesShort":["jan","feb","mrt","apr","mei","jun","jul","aug","sep","okt","nov","dec",""],"timePattern":"HH:mm","datePattern":"d-M-yyyy","dateTimePattern":"d-M-yyyy HH:mm","timeFormat":"Clock24Hours","weekStarts":1})),DayPilot.Locale.register(new DayPilot.Locale("nl-be",{"dayNames":["zondag","maandag","dinsdag","woensdag","donderdag","vrijdag","zaterdag"],"dayNamesShort":["zo","ma","di","wo","do","vr","za"],"monthNames":["januari","februari","maart","april","mei","juni","juli","augustus","september","oktober","november","december",""],"monthNamesShort":["jan","feb","mrt","apr","mei","jun","jul","aug","sep","okt","nov","dec",""],"timePattern":"H:mm","datePattern":"d/MM/yyyy","dateTimePattern":"d/MM/yyyy H:mm","timeFormat":"Clock24Hours","weekStarts":1})),DayPilot.Locale.register(new DayPilot.Locale("nn-no",{"dayNames":["søndag","måndag","tysdag","onsdag","torsdag","fredag","laurdag"],"dayNamesShort":["sø","må","ty","on","to","fr","la"],"monthNames":["januar","februar","mars","april","mai","juni","juli","august","september","oktober","november","desember",""],"monthNamesShort":["jan","feb","mar","apr","mai","jun","jul","aug","sep","okt","nov","des",""],"timePattern":"HH:mm","datePattern":"dd.MM.yyyy","dateTimePattern":"dd.MM.yyyy HH:mm","timeFormat":"Clock24Hours","weekStarts":1})),DayPilot.Locale.register(new DayPilot.Locale("pt-br",{"dayNames":["domingo","segunda-feira","terça-feira","quarta-feira","quinta-feira","sexta-feira","sábado"],"dayNamesShort":["D","S","T","Q","Q","S","S"],"monthNames":["janeiro","fevereiro","março","abril","maio","junho","julho","agosto","setembro","outubro","novembro","dezembro",""],"monthNamesShort":["jan","fev","mar","abr","mai","jun","jul","ago","set","out","nov","dez",""],"timePattern":"HH:mm","datePattern":"dd/MM/yyyy","dateTimePattern":"dd/MM/yyyy HH:mm","timeFormat":"Clock24Hours","weekStarts":0})),DayPilot.Locale.register(new DayPilot.Locale("pl-pl",{"dayNames":["niedziela","poniedziałek","wtorek","środa","czwartek","piątek","sobota"],"dayNamesShort":["N","Pn","Wt","Śr","Cz","Pt","So"],"monthNames":["styczeń","luty","marzec","kwiecień","maj","czerwiec","lipiec","sierpień","wrzesień","październik","listopad","grudzień",""],"monthNamesShort":["sty","lut","mar","kwi","maj","cze","lip","sie","wrz","paź","lis","gru",""],"timePattern":"HH:mm","datePattern":"yyyy-MM-dd","dateTimePattern":"yyyy-MM-dd HH:mm","timeFormat":"Clock24Hours","weekStarts":1})),DayPilot.Locale.register(new DayPilot.Locale("pt-pt",{"dayNames":["domingo","segunda-feira","terça-feira","quarta-feira","quinta-feira","sexta-feira","sábado"],"dayNamesShort":["D","S","T","Q","Q","S","S"],"monthNames":["janeiro","fevereiro","março","abril","maio","junho","julho","agosto","setembro","outubro","novembro","dezembro",""],"monthNamesShort":["jan","fev","mar","abr","mai","jun","jul","ago","set","out","nov","dez",""],"timePattern":"HH:mm","datePattern":"dd/MM/yyyy","dateTimePattern":"dd/MM/yyyy HH:mm","timeFormat":"Clock24Hours","weekStarts":0})),DayPilot.Locale.register(new DayPilot.Locale("ro-ro",{"dayNames":["duminică","luni","marți","miercuri","joi","vineri","sâmbătă"],"dayNamesShort":["D","L","Ma","Mi","J","V","S"],"monthNames":["ianuarie","februarie","martie","aprilie","mai","iunie","iulie","august","septembrie","octombrie","noiembrie","decembrie",""],"monthNamesShort":["ian.","feb.","mar.","apr.","mai.","iun.","iul.","aug.","sep.","oct.","nov.","dec.",""],"timePattern":"H:mm","datePattern":"dd.MM.yyyy","dateTimePattern":"dd.MM.yyyy H:mm","timeFormat":"Clock24Hours","weekStarts":1})),DayPilot.Locale.register(new DayPilot.Locale("ru-ru",{"dayNames":["воскресенье","понедельник","вторник","среда","четверг","пятница","суббота"],"dayNamesShort":["Вс","Пн","Вт","Ср","Чт","Пт","Сб"],"monthNames":["Январь","Февраль","Март","Апрель","Май","Июнь","Июль","Август","Сентябрь","Октябрь","Ноябрь","Декабрь",""],"monthNamesShort":["янв","фев","мар","апр","май","июн","июл","авг","сен","окт","ноя","дек",""],"timePattern":"H:mm","datePattern":"dd.MM.yyyy","dateTimePattern":"dd.MM.yyyy H:mm","timeFormat":"Clock24Hours","weekStarts":1})),DayPilot.Locale.register(new DayPilot.Locale("sk-sk",{"dayNames":["nedeľa","pondelok","utorok","streda","štvrtok","piatok","sobota"],"dayNamesShort":["ne","po","ut","st","št","pi","so"],"monthNames":["január","február","marec","apríl","máj","jún","júl","august","september","október","november","december",""],"monthNamesShort":["1","2","3","4","5","6","7","8","9","10","11","12",""],"timePattern":"H:mm","datePattern":"d.M.yyyy","dateTimePattern":"d.M.yyyy H:mm","timeFormat":"Clock24Hours","weekStarts":1})),DayPilot.Locale.register(new DayPilot.Locale("sv-se",{"dayNames":["söndag","måndag","tisdag","onsdag","torsdag","fredag","lördag"],"dayNamesShort":["sö","må","ti","on","to","fr","lö"],"monthNames":["januari","februari","mars","april","maj","juni","juli","augusti","september","oktober","november","december",""],"monthNamesShort":["jan","feb","mar","apr","maj","jun","jul","aug","sep","okt","nov","dec",""],"timePattern":"HH:mm","datePattern":"yyyy-MM-dd","dateTimePattern":"yyyy-MM-dd HH:mm","timeFormat":"Clock24Hours","weekStarts":1})),DayPilot.Locale.register(new DayPilot.Locale("tr-tr",{"dayNames":["Pazar","Pazartesi","Salı","Çarşamba","Perşembe","Cuma","Cumartesi"],"dayNamesShort":["Pz","Pt","Sa","Ça","Pe","Cu","Ct"],"monthNames":["Ocak","Şubat","Mart","Nisan","Mayıs","Haziran","Temmuz","Ağustos","Eylül","Ekim","Kasım","Aralık",""],"monthNamesShort":["Oca","Şub","Mar","Nis","May","Haz","Tem","Ağu","Eyl","Eki","Kas","Ara",""],"timePattern":"HH:mm","datePattern":"d.M.yyyy","dateTimePattern":"d.M.yyyy HH:mm","timeFormat":"Clock24Hours","weekStarts":1})),DayPilot.Locale.register(new DayPilot.Locale("zh-cn",{"dayNames":["星期日","星期一","星期二","星期三","星期四","星期五","星期六"],"dayNamesShort":["日","一","二","三","四","五","六"],"monthNames":["一月","二月","三月","四月","五月","六月","七月","八月","九月","十月","十一月","十二月",""],"monthNamesShort":["1月","2月","3月","4月","5月","6月","7月","8月","9月","10月","11月","12月",""],"timePattern":"H:mm","datePattern":"yyyy/M/d","dateTimePattern":"yyyy/M/d H:mm","timeFormat":"Clock24Hours","weekStarts":1})),DayPilot.Locale.US=DayPilot.Locale.find("en-us"),DayPilot.Switcher=function(e){function t(e,t,n){var a={};a.start=e,a.end=t,a.day=n,a.target=i.active.control,a.preventDefault=function(){this.preventDefault.value=!0};var o=i.k;o&&o.start===a.start&&o.end===a.end&&o.day===a.day&&o.target===a.target||(i.k=a,"function"==typeof i.onChange&&(i.onChange(a),a.preventDefault.value)||"function"==typeof i.onTimeRangeSelect&&(i.onTimeRangeSelect(a),a.preventDefault.value)||(i.active.sendNavigate(i.day),"function"==typeof i.onChanged&&i.onChanged(a),"function"==typeof i.onTimeRangeSelected&&i.onTimeRangeSelected(a)))}var i=this;this.views=[],this.triggers=[],this.navigator={},this.selectedClass=null,this.active=null,this.day=DayPilot.Date.today(),this.onChange=null,this.onChanged=null,this.navigator.updateMode=function(e){var t=i.navigator.control;t&&(t.selectMode=e,t.select(i.day))},this.addView=function(e,t){var n;if("string"==typeof e){if(n=document.getElementById(e),!n)throw"Element not found: "+e}else n=e;var a=n,o={};return o.isView=!0,o.id=a.id,o.control=a,o.options=t||{},o.hide=function(){a.hide?a.hide():a.nav&&a.nav.top?a.nav.top.style.display="none":a.style.display="none"},o.sendNavigate=function(e){(function(){return!!a.backendUrl||!("function"!=typeof WebForm_DoCallback||!a.uniqueID)})()?a.commandCallBack&&a.commandCallBack("navigate",{"day":e}):(a.startDate=e,a.update())},o.show=function(){i.c(),a.show?a.show():a.nav&&a.nav.top?a.nav.top.style.display="":a.style.display=""},o.selectMode=function(){if(o.options.navigatorSelectMode)return o.options.navigatorSelectMode;if(a.isCalendar)switch(a.viewType){case"Day":return"day";case"Week":return"week";case"WorkWeek":return"week";default:return"day"}else if(a.isMonth)switch(a.viewType){case"Month":return"month";case"Weeks":return"week";default:return"day"}return"day"},this.views.push(o),o},this.addTrigger=function(e,t){var n;if("string"==typeof e){if(n=document.getElementById(e),!n)throw"Element not found: "+e}else n=e;var a=this.f(t);a||(a=this.addView(t));var o={};return o.isTrigger=!0, o.element=n,o.id=n.id,o.view=a,o.onClick=function(e){i.show(o),i.g(o),e=e||window.event,e&&(e.preventDefault?e.preventDefault():e.returnValue=!1)},DayPilot.re(n,"click",o.onClick),this.triggers.push(o),o},this.addButton=this.addTrigger,this.select=function(e){var t=this.j(e);t?t.onClick():this.triggers.length>0&&this.triggers[0].onClick()},this.j=function(e){for(var t=0;t';"),e.add(".kanban_default_columnmove_handle","opacity: 0.5; background-repeat: no-repeat; background-position: center center; background-color: #ccc; background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAQAAAAKCAYAAACT+/8OAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAAadEVYdFNvZnR3YXJlAFBhaW50Lk5FVCB2My41LjExR/NCNwAAAClJREFUGFdj+P//P4O9vX2Bg4NDP4gNFgBytgPxebgAMsYuQGMz/jMAAFsTZDPYJlDHAAAAAElFTkSuQmCC); cursor: move;"),e.add(".kanban_default_columnmove_position","background-color: #333;"),e.add(".kanban_default_crosshair_vertical, .kanban_default_crosshair_horizontal, .kanban_default_crosshair_left, .kanban_default_crosshair_top","background-color: gray; opacity: 0.2; filter: alpha(opacity=20)"),e.commit(),DayPilot.Global.defaultCss=!0}}();var o=function(e){var t=this;this.id=e,this.widths=[],this.titles=[],this.height=null,this.splitterWidth=3,this.css={},this.css.title=null,this.css.titleInner=null,this.css.splitter=null,this.blocks=[],this.drag={},this.updated=function(){},this.updating=function(){},this.init=function(){var i;if(!e)throw"error: id not provided";if("string"==typeof e)i=document.getElementById(e);else{if(!e.appendChild)throw"error: invalid object provided";i=e}this.div=i,this.blocks=[];for(var n=0;nh-l+o){this.n.mouse.clientY-(h-l)+o;u=this.n.mouse.y-l-10}else u=this.n.mouse.y+22;if("number"==typeof u&&(r.style.top=Math.max(u,0)+"px"),this.n.mouse.clientX>c-s+o){var f=this.n.mouse.clientX-(c-s)+o;r.style.left=this.n.mouse.x-f+"px"}else r.style.left=this.n.mouse.x+"px"}else if("EventTop"===a){var v=2,u=this.n.mouse.y-l-v,p=d.scrollTop;uc&&(g=c-s-o),r.style.left=g+"px"}if(r.style.display="",t){r.style.display="";var y={};y.color=r.firstChild.style.color,y.overflow=r.style.overflow,r.firstChild.style.color="transparent",r.style.overflow="hidden",this.removeShadow(),DayPilot.pop(r,{"finished":function(){r.firstChild.style.color=y.color,r.style.overflow=y.overflow,i.addShadow()},"vertical":"bottom","horizontal":"left","animation":i.animation})}}},this.delayedHide=function(){e.cancelHiding(),e.cancelShowing();var t=e.active;if(t===this&&t.hideAfter>0){var i=t.hideAfter;e.timeoutHide=window.setTimeout(e.hideActive,i)}},this.showOnMouseOver=function(t){var n=function(e){return function(){i.show(e)}};clearTimeout(e.timeoutShow),e.timeoutShow=window.setTimeout(n(t),this.showAfter)},this.hideOnMouseOut=function(){this.delayedHide()},this.r=function(e){return!!e.calendar.backendUrl||!("function"!=typeof WebForm_DoCallback||!this.uniqueID)},this.addShadow=function(){if(this.useShadow&&!this.cssOnly&&n.div){var e=n.div;this.shadows&&this.shadows.length>0&&this.removeShadow(),this.shadows=[];for(var t=0;t<5;t++){var i=document.createElement("div");i.setAttribute("unselectable","on"),i.style.position="absolute",i.style.width=e.offsetWidth+"px",i.style.height=e.offsetHeight+"px",i.style.top=e.offsetTop+t+"px",i.style.left=e.offsetLeft+t+"px",i.style.zIndex=this.zIndex,i.style.filter="alpha(opacity:10)",i.style.opacity=.1,i.style.backgroundColor="#000000",this.rounded()&&(i.style.MozBorderRadius="5px",i.style.webkitBorderRadius="5px",i.style.borderRadius="5px"),document.body.appendChild(i),this.shadows.push(i)}}},this.removeShadow=function(){if(this.shadows){for(var e=0;e=10.5}return!1}(),this.C.webkit522=function(){if(/AppleWebKit[\/\s](\d+\.\d+)/.test(navigator.userAgent)){return new Number(RegExp.$1)>=522}return!1}(),this.clearSelection=function(){return this.selectedCells?(e.topSelectedCell=null,e.bottomSelectedCell=null,e.selecting=null,this.D(),void(this.selectedCells=[])):void(this.selectedCells=[])},this.D=function(){this.selectedCells&&!function(){DayPilot.de(a.elements.selection),a.elements.selection=[]}()},this.cleanSelection=this.clearSelection,this.E=function(e,t,i){var n={};n.action=e,n.parameters=i,n.data=t,n.header=this.F();var o="JSON"+DayPilot.JSON.stringify(n);__doPostBack(a.uniqueID,o)},this.G=function(e,t,i,n){if(!this.r())return void a.debug.message("Callback invoked without the server-side backend specified. Callback canceled.","warning");this.callbackTimeout&&window.clearTimeout(this.callbackTimeout),"undefined"==typeof n&&(n="CallBack"),this.callbackTimeout=window.setTimeout(function(){a.H()},100);var o={};o.action=e,o.type=n,o.parameters=t,o.data=i,o.header=this.F();var r="JSON"+DayPilot.JSON.stringify(o);this.backendUrl?DayPilot.request(this.backendUrl,this.I,r,this.J):"function"==typeof WebForm_DoCallback&&WebForm_DoCallback(this.uniqueID,r,this.K,this.clientName,this.onCallbackError,!0)},this.r=function(){return!!this.backendUrl||!("function"!=typeof WebForm_DoCallback||!this.uniqueID)},this.J=function(e){if("function"==typeof a.onAjaxError){var t={};t.request=e,a.onAjaxError(t)}else"function"==typeof a.ajaxError&&a.ajaxError(e)},this.dispose=function(){var t=a;t.nav.top&&(t.L(),t.M(),t.nav.messageClose&&(t.nav.messageClose.onclick=null),t.nav.hourTable&&(t.nav.hourTable.oncontextmenu=null),t.nav.hourTable&&(t.nav.hourTable.onmousemove=null),t.nav.header&&(t.nav.header.oncontextmenu=null),t.nav.corner&&(t.nav.corner.oncontextmenu=null),t.nav.zoom.onmousemove=null,t.nav.zoom.oncontextmenu=null,t.nav.scroll.onscroll=null,t.nav.scroll.root=null,DayPilot.pu(t.nav.loading),t.N(),t.O(),t.nav.select=null,t.nav.cornerRight=null,t.nav.scrollable=null,t.nav.bottomLeft=null,t.nav.bottomRight=null,t.nav.allday=null,t.nav.zoom=null,t.nav.loading=null,t.nav.events=null,t.nav.header=null,t.nav.hourTable=null,t.nav.scrolltop=null,t.nav.scroll=null,t.nav.vsph=null,t.nav.main=null,t.nav.message=null,t.nav.messageClose=null,t.nav.top.removeAttribute("style"),t.nav.top.removeAttribute("class"),t.nav.top.innerHTML="",t.nav.top.dp=null,t.nav.top=null,DayPilot.ue(window,"resize",t.P),e.unregister(t))},this.Q=function(){this.nav.top.dispose=this.dispose,this.nav.limit},this.I=function(e){a.K(e.responseText)},this.F=function(){var e={};return e.v=this.v,e.control="dpc",e.id=this.id,e.clientState=a.clientState,e.columns=this.R(),e.days=a.days,e.startDate=a.startDate,e.cellDuration=a.cellDuration,e.cssClassPrefix=a.cssClassPrefix,e.heightSpec=a.heightSpec,e.businessBeginsHour=a.businessBeginsHour,e.businessEndsHour=a.businessEndsHour,e.viewType=a.viewType,e.dayBeginsHour=a.dayBeginsHour,e.dayEndsHour=a.dayEndsHour,e.headerLevels=a.headerLevels,e.backColor=a.cellBackColor,e.nonBusinessBackColor=a.cellBackColorNonBusiness,e.eventHeaderVisible=a.eventHeaderVisible,e.timeFormat=a.timeFormat,e.timeHeaderCellDuration=a.timeHeaderCellDuration,e.locale=a.locale,e.scrollY=a.scrollPos,e.showAllDayEvents=a.showAllDayEvents,e.tagFields=a.tagFields,e.weekStarts=a.weekStarts,e.hourNameBackColor=a.hourNameBackColor,e.hourFontFamily=a.hourFontFamily,e.hourFontSize=a.hourFontSize,e.hourFontColor=a.hourFontColor,e.selected=a.multiselect.events(),e.hashes=a.hashes,e},this.S=function(){this.T(),DayPilot.Areas.hideAll()},this.R=function(){var e=[];if(e.ignoreToJSON=!0,!this.U)return e;for(var t=0;t=o&&(l=o-1),a.rtl&&(l=a.va.length-l-1);var s=n.rows[0].cells[l],d=0,c=0,h=0;if("undefined"!=typeof e.duration){var u=e.duration;h=Math.floor((a.coords.y-d+a.cellHeight/2)/a.cellHeight)*a.cellHeight+d,c=u*a.cellHeight/(60*a.cellDuration),c=Math.max(c,a.cellHeight)}else{var f=e.event;c=f.part.height,h=f.part.top}var v=document.createElement("div");v.setAttribute("unselectable","on"),v.style.position="absolute",v.style.width="100%",v.style.height=c+"px",v.style.left="0px",v.style.top=h+"px",v.style.zIndex=101,v.exclude=!0;var p=document.createElement("div");return v.appendChild(p),v.className=a.q("_shadow"),p.className=this.q("_shadow_inner"),s.events.appendChild(v),v},this.wa=function(){return this.xa()/36e5},this.ya=function(){return this.businessBeginsHour>this.businessEndsHour?24-this.businessBeginsHour+this.businessEndsHour:this.businessEndsHour-this.businessBeginsHour},this.za=function(){return this.dayBeginsHour>=this.dayEndsHour?24-this.dayBeginsHour+this.dayEndsHour:this.dayEndsHour-this.dayBeginsHour},this.xa=function(e){var t=0;if("BusinessHoursNoScroll"===this.heightSpec)t=this.ya();else if(this.hideFreeCells&&!e){var i=(this.Aa-1)*this.cellDuration/this.cellHeight,n=Math.ceil(i/60),a=this.businessBeginsHour>this.businessEndsHour?this.businessEndsHour+24:this.businessEndsHour;t=Math.max(this.dayBeginsHour+n,a)-this.Ba()}else t=this.za();return 60*t*60*1e3},this.message=function(e,t,i,n){if(e){var o,t=t||this.messageHideAfter||2e3,r=this.Ca(),l=this.showHours?this.hourWidth:0,s=DayPilot.sw(a.Da());if(a.rtl){var d=l;l=s,s=d}if(this.nav.message)o=a.nav.message,this.nav.message.style.top=r+"px";else{o=document.createElement("div"),o.style.position="absolute",o.style.left=l+"px",o.style.top=r+"px",o.style.right="0px",o.style.display="none",o.onmousemove=function(){o.messageTimeout&&!o.status&&clearTimeout(o.messageTimeout)},o.onmouseout=function(){"none"!==a.nav.message.style.display&&(o.messageTimeout=setTimeout(a.Ea,500))};var c=document.createElement("div");c.onclick=function(){a.nav.message.style.display="none"},c.className=this.q("_message"),o.appendChild(c);var h=document.createElement("div");h.style.position="absolute",h.className=this.q("_message_close"),h.onclick=function(){a.nav.message.style.display="none"},o.appendChild(h),this.nav.top.insertBefore(o,this.nav.loading),this.nav.message=o,this.nav.messageClose=h}this.nav.cornerRight?this.nav.message.style.right=s+"px":this.nav.message.style.right="0px";var u=function(){if(a.nav.message){a.nav.message.firstChild.innerHTML=e;var i=function(){o.messageTimeout=setTimeout(a.Ea,t)};DayPilot.fade(a.nav.message,.2,i)}};clearTimeout(o.messageTimeout),"none"!==this.nav.message.style.display?DayPilot.fade(a.nav.message,-.2,u):u()}},this.message.show=function(e){a.message(e)},this.message.hide=function(){a.Ea()},this.Ea=function(){var e=function(){a.nav.message.style.display="none"};DayPilot.fade(a.nav.message,-.2,e)},this.ga=function(){this.nav.message&&(this.nav.message.style.top=this.Ca()+"px")},this.Fa=function(){return this.xa()/(6e4*this.cellDuration)},this.eventClickPostBack=function(e,t){this.E("EventClick",t,e)},this.eventClickCallBack=function(e,t){this.G("EventClick",e,t)},this.Ga=function(e){var t=this,e=e||window.event,i=e.ctrlKey,n=e.metaKey;if("undefined"!=typeof DayPilot.Bubble&&DayPilot.Bubble.hideActive(),"Disabled"===a.eventDoubleClickHandling)return void a.Ha(t,i,n,e);if(a.timeouts){for(var o in a.timeouts)window.clearTimeout(a.timeouts[o]);a.timeouts=[]}else a.timeouts=[];var r=function(e,t,i,n){return function(){a.Ha(e,t,i,n)}};a.timeouts.push(window.setTimeout(r(this,i,n,e),a.doubleClickTimeout))},this.Ha=function(e,t,i,n){var o=e.event;if(o.client.clickEnabled())if(a.sa()){var r={};if(r.e=o,r.ctrl=t,r.meta=i,r.originalEvent=n,r.preventDefault=function(){this.preventDefault.value=!0},"function"==typeof a.onEventClick&&(a.onEventClick(r),r.preventDefault.value))return;switch(a.eventClickHandling){case"PostBack":a.eventClickPostBack(o);break;case"CallBack":a.eventClickCallBack(o);break;case"Edit":a.Ia(e);break;case"Select":a.Ja(e,o,t,i);break;case"Bubble":a.bubble&&a.bubble.showEvent(o);break;case"ContextMenu":var l=o.client.contextMenu();l?l.show(o):a.contextMenu&&a.contextMenu.show(o)}"function"==typeof a.onEventClicked&&a.onEventClicked(r)}else switch(a.eventClickHandling){case"PostBack":a.eventClickPostBack(o);break;case"CallBack":a.eventClickCallBack(o);break;case"JavaScript":a.onEventClick(o);break;case"Edit":a.Ia(e);break;case"Select":a.Ja(e,o,t,i);break;case"Bubble":a.bubble&&a.bubble.showEvent(o);break;case"ContextMenu":var l=o.client.contextMenu();l?l.show(o):a.contextMenu&&a.contextMenu.show(o)}},this.eventDoubleClickPostBack=function(e,t){this.E("EventDoubleClick",t,e)},this.eventDoubleClickCallBack=function(e,t){this.G("EventDoubleClick",e,t)},this.Ka=function(e){if("undefined"!=typeof DayPilot.Bubble&&DayPilot.Bubble.hideActive(),a.timeouts){for(var t in a.timeouts)window.clearTimeout(a.timeouts[t]);a.timeouts=null}var i=this.event,e=e||window.event;if(a.sa()){var n={};if(n.e=i,n.preventDefault=function(){this.preventDefault.value=!0},"function"==typeof a.onEventDoubleClick&&(a.onEventDoubleClick(n),n.preventDefault.value))return;switch(a.eventDoubleClickHandling){case"PostBack":a.eventDoubleClickPostBack(i);break;case"CallBack":a.eventDoubleClickCallBack(i);break;case"Edit":i.allday()||a.Ia(this);break;case"Select":i.allday()||a.Ja(this,i,e.ctrlKey);break;case"Bubble":a.bubble&&a.bubble.showEvent(i)}"function"==typeof a.onEventDoubleClicked&&a.onEventDoubleClicked(n)}else switch(a.eventDoubleClickHandling){case"PostBack":a.eventDoubleClickPostBack(i);break;case"CallBack":a.eventDoubleClickCallBack(i);break;case"JavaScript":a.onEventDoubleClick(i);break;case"Edit":i.allday()||a.Ia(this);break;case"Select":i.allday()||a.Ja(this,i,e.ctrlKey);break;case"Bubble":a.bubble&&a.bubble.showEvent(i)}},this.eventRightClickPostBack=function(e,t){this.E("EventRightClick",t,e)},this.eventRightClickCallBack=function(e,t){this.G("EventRightClick",e,t)},this.La=function(e){var t=this.event;if(e.stopPropagation&&e.stopPropagation(),!t.client.rightClickEnabled())return!1;if(a.sa()){var i={};if(i.e=t,i.preventDefault=function(){this.preventDefault.value=!0},"function"==typeof a.onEventRightClick&&(a.onEventRightClick(i),i.preventDefault.value))return!1;switch(a.eventRightClickHandling){case"PostBack":a.eventRightClickPostBack(t);break;case"CallBack":a.eventRightClickCallBack(t);break;case"ContextMenu":var n=t.client.contextMenu();n?n.show(t):a.contextMenu&&a.contextMenu.show(this.event);break;case"Bubble":a.bubble&&a.bubble.showEvent(t)}"function"==typeof a.onEventRightClicked&&a.onEventRightClicked(i)}else switch(a.eventRightClickHandling){case"PostBack":a.eventRightClickPostBack(t);break;case"CallBack":a.eventRightClickCallBack(t);break;case"JavaScript":a.onEventRightClick(t);break;case"ContextMenu":var n=t.client.contextMenu();n?n.show(t):a.contextMenu&&a.contextMenu.show(this.event);break;case"Bubble":a.bubble&&a.bubble.showEvent(t)}return e.preventDefault&&e.preventDefault(),!1},this.headerClickPostBack=function(e,t){this.E("HeaderClick",t,e)},this.headerClickCallBack=function(e,t){this.G("HeaderClick",e,t)},this.Ma=function(t){var i=this.data,n=new e.Column(i.id,i.name,i.start);if(a.sa()){var o={};if(o.header={},o.header.id=i.id,o.header.name=i.name,o.header.start=i.start,o.preventDefault=function(){this.preventDefault.value=!0},"function"==typeof a.onHeaderClick&&(a.onHeaderClick(o),o.preventDefault.value))return;switch(a.headerClickHandling){case"PostBack":a.headerClickPostBack(n);break;case"CallBack":a.headerClickCallBack(n)}"function"==typeof a.onHeaderClicked&&a.onHeaderClicked(o)}else switch(a.headerClickHandling){case"PostBack":a.headerClickPostBack(n);break;case"CallBack":a.headerClickCallBack(n);break;case"JavaScript":a.onHeaderClick(n)}},this.Na=function(){if("undefined"!=typeof DayPilot.Bubble&&a.columnBubble)if("Resources"===a.viewType){var t={};t.calendar=a,t.id=this.data.id,t.toJSON=function(){ var e={};return e.id=this.id,e},a.columnBubble.showResource(t)}else{var i=new DayPilot.Date(this.data.start),n=i.addDays(1),o={};o.calendar=a,o.start=i,o.end=n,o.toJSON=function(){var e={};return e.start=this.start,e.end=this.end,e},a.columnBubble.showTime(o)}var r=this,l=r.firstChild;if(!l.active){var s=r.data,d=new e.Column(s.id,s.name,s.start);d.areas=r.data.areas,DayPilot.Areas.showAreas(l,d)}},this.Oa=function(e){"undefined"!=typeof DayPilot.Bubble&&a.columnBubble&&a.columnBubble.hideOnMouseOut(),DayPilot.Areas.hideAreas(this.firstChild,e)},this.eventDeletePostBack=function(e,t){this.E("EventDelete",t,e)},this.eventDeleteCallBack=function(e,t){this.G("EventDelete",e,t)};this.Pa=function(e){var t;if(t=e&&e.isEvent?e:e.parentNode.parentNode.event,a.sa()){var i={};if(i.e=t,i.preventDefault=function(){this.preventDefault.value=!0},"function"==typeof a.onEventDelete&&(a.onEventDelete(i),i.preventDefault.value))return;switch(a.eventDeleteHandling){case"PostBack":a.eventDeletePostBack(t);break;case"CallBack":a.eventDeleteCallBack(t);break;case"Update":a.events.remove(t)}"function"==typeof a.onEventDeleted&&a.onEventDeleted(i)}else switch(a.eventDeleteHandling){case"PostBack":a.eventDeletePostBack(t);break;case"CallBack":a.eventDeleteCallBack(t);break;case"JavaScript":a.onEventDelete(t)}};this.eventResizePostBack=function(e,t,i,n){if(!t)throw"newStart is null";if(!i)throw"newEnd is null";var a={};a.e=e,a.newStart=t,a.newEnd=i,this.E("EventResize",n,a)},this.eventResizeCallBack=function(e,t,i,n){if(!t)throw"newStart is null";if(!i)throw"newEnd is null";var a={};a.e=e,a.newStart=t,a.newEnd=i,this.G("EventResize",a,n)},this.Qa=function(e,t,i,n){if("PostBack"===e)a.postBack2(t,i,n);else if("CallBack"===e)a.G(t,i,n,"CallBack");else if("Immediate"===e)a.G(t,i,n,"Notify");else if("Queue"===e)a.queue.add(new DayPilot.Action(this,t,i,n));else{if("Notify"!==e)throw"Invalid event invocation type";"Notify"===r.notifyType()?a.G(t,i,n,"Notify"):a.queue.add(new DayPilot.Action(a,t,i,n))}},this.Ba=function(e){if("BusinessHoursNoScroll"===this.heightSpec)return this.businessBeginsHour;if(this.hideFreeCells&&!e){var t=this.Ra*this.cellDuration/this.cellHeight,i=Math.floor(t/60);return i=Math.max(0,i),Math.min(this.dayBeginsHour+i,this.businessBeginsHour)}return this.dayBeginsHour},this.visibleStart=function(){if("Resources"===a.viewType){var e=DayPilot.list(a.va).map(function(e){return e.start.getTime()}),t=Math.min.apply(null,e);return new DayPilot.Date(t)}return this.va[0].start},this.visibleEnd=function(){if("Resources"===a.viewType){var e=DayPilot.list(a.va).map(function(e){return e.start.getTime()}),t=Math.max.apply(null,e);return new DayPilot.Date(t).addDays(1)}var i=this.va,t=i.length-1;return i[t].start.addDays(1)},this.sa=function(){return 2===a.api},this.Sa=function(e,t,i,n){if("Disabled"!==this.eventResizeHandling){var o=0,r=new Date,l=new Date,s=e.start(),d=(e.end(),a.cellDuration),c=a.va[e.part.dayIndex].start;if("top"===n){var c=s.getDatePart(),h=Math.floor((i-o)/a.cellHeight),u=h*d,f=60*u*1e3,v=60*a.Ba()*60*1e3;r=c.addTime(f+v),l=e.end()}else if("bottom"===n){var h=Math.floor((i+t-o)/a.cellHeight),u=h*d,f=60*u*1e3,v=60*a.Ba()*60*1e3;r=s,l=c.addTime(f+v)}if(a.sa()){var p={};if(p.e=e,p.newStart=r,p.newEnd=l,p.preventDefault=function(){this.preventDefault.value=!0},"function"==typeof a.onEventResize&&(a.onEventResize(p),p.preventDefault.value))return;switch(a.eventResizeHandling){case"PostBack":a.eventResizePostBack(e,r,l);break;case"CallBack":a.eventResizeCallBack(e,r,l);break;case"Notify":a.eventResizeNotify(e,r,l);break;case"Update":e.start(r),e.end(l),a.events.update(e)}"function"==typeof a.onEventResized&&a.onEventResized(p)}else switch(a.eventResizeHandling){case"PostBack":a.eventResizePostBack(e,r,l);break;case"CallBack":a.eventResizeCallBack(e,r,l);break;case"JavaScript":a.onEventResize(e,r,l);break;case"Notify":a.eventResizeNotify(e,r,l)}}},this.eventResizeNotify=function(e,t,i,n){var o=new DayPilot.Event(e.copy(),this);e.start(t),e.end(i),e.commit(),a.update(),this.Ta("Notify",o,t,i,n)},this.Ta=function(e,t,i,n,a){var o={};o.e=t,o.newStart=i,o.newEnd=n,this.Qa(e,"EventResize",o,a)},this.eventMovePostBack=function(e,t,i,n,a){if(!t)throw"newStart is null";if(!i)throw"newEnd is null";var o={};o.e=e,o.newStart=t,o.newEnd=i,o.newResource=n,this.E("EventMove",a,o)},this.eventMoveCallBack=function(e,t,i,n,a){if(!t)throw"newStart is null";if(!i)throw"newEnd is null";var o={};o.e=e,o.newStart=t,o.newEnd=i,o.newResource=n,this.G("EventMove",o,a)},this.Ua=function(e,t,i){var n=0,o=Math.floor((i-n)/a.cellHeight),r=a.cellDuration,l=o*r*60*1e3,s=e.start(),d=e.end(),c=new Date;s instanceof DayPilot.Date&&(s=s.toDate()),c.setTime(Date.UTC(s.getUTCFullYear(),s.getUTCMonth(),s.getUTCDate()));var h="Never"!==a.useEventBoxes?s.getTime()-(c.getTime()+3600*s.getUTCHours()*1e3+Math.floor(s.getUTCMinutes()/r)*r*60*1e3):0,u=d.getTime()-s.getTime(),f=3600*a.Ba()*1e3;"undefined"==typeof t&&(t=e.part.dayIndex);var v=this.va[t],p=v.start.getTime(),g=new Date;g.setTime(p+l+h+f);var y=new DayPilot.Date(g);return{"start":y,"end":y.addTime(u),"resource":v.id}},this.Va=function(e,t,i,n,o){if("Disabled"!==a.eventMoveHandling){var r=a.Ua(e,t,i),l=r.start,s=r.end,d=r.resource,c=!!o;if(a.sa()){var h={};if(h.e=e,h.newStart=r.start,h.newEnd=r.end,h.newResource=r.resource,h.external=c,h.ctrl=!1,n&&(h.ctrl=n.ctrlKey),h.shift=!1,n&&(h.shift=n.shiftKey),h.preventDefault=function(){this.preventDefault.value=!0},"function"==typeof a.onEventMove&&(a.onEventMove(h),h.preventDefault.value))return;switch(a.eventMoveHandling){case"PostBack":a.eventMovePostBack(e,l,s,d);break;case"CallBack":a.eventMoveCallBack(e,l,s,d);break;case"Notify":a.eventMoveNotify(e,l,s,d);break;case"Update":e.start(l),e.end(s),e.resource(d),c?(e.commit(),a.events.add(e)):a.events.update(e),a.Wa()}"function"==typeof a.onEventMoved&&a.onEventMoved(h)}else switch(a.eventMoveHandling){case"PostBack":a.eventMovePostBack(e,l,s,d);break;case"CallBack":a.eventMoveCallBack(e,l,s,d);break;case"JavaScript":a.onEventMove(e,l,s,d,c,!!n&&n.ctrlKey,!!n&&n.shiftKey);break;case"Notify":a.eventMoveNotify(e,l,s,d,null)}}},this.eventMoveNotify=function(e,t,i,n,o){var r=new DayPilot.Event(e.copy(),this);e.start(t),e.end(i),e.resource(n),e.commit(),a.update(),this.Xa("Notify",r,t,i,n,o)},this.Xa=function(e,t,i,n,a,o){var r={};r.e=t,r.newStart=i,r.newEnd=n,r.newResource=a,this.Qa(e,"EventMove",r,o)},this.Wa=function(){if(a.todo&&a.todo.del){var e=a.todo.del;e.parentNode.removeChild(e),a.todo.del=null}},this.Ya=function(e,t){var i=a.Za(t),n={};n.args=e,n.guid=i,a.G("Bubble",n)},this.Za=function(e){var t=DayPilot.guid();return this.bubbles||(this.bubbles=[]),this.bubbles[t]=e,t},this.eventMenuClickPostBack=function(e,t,i){var n={};n.e=e,n.command=t,this.E("EventMenuClick",i,n)},this.eventMenuClickCallBack=function(e,t,i){var n={};n.e=e,n.command=t,this.G("EventMenuClick",n,i)},this.$a=function(e,t,i){switch(i){case"PostBack":a.eventMenuClickPostBack(t,e);break;case"CallBack":a.eventMenuClickCallBack(t,e)}},this.timeRangeMenuClickPostBack=function(e,t,i){var n={};n.selection=e,n.command=t,this.E("TimeRangeMenuClick",i,n)},this.timeRangeMenuClickCallBack=function(e,t,i){var n={};n.selection=e,n.command=t,this.G("TimeRangeMenuClick",n,i)},this._a=function(e,t,i){switch(i){case"PostBack":a.timeRangeMenuClickPostBack(t,e);break;case"CallBack":a.timeRangeMenuClickCallBack(t,e)}},this.timeRangeSelectedPostBack=function(e,t,i,n){var a={};a.start=e,a.end=t,a.resource=i,this.E("TimeRangeSelected",n,a)},this.timeRangeSelectedCallBack=function(e,t,i,n){var a={};a.start=e,a.end=t,a.resource=i,this.G("TimeRangeSelected",a,n)},this.ab=function(e,t,i){e=new DayPilot.Date(e),t=new DayPilot.Date(t);var n=i;if(a.sa()){var o={};if(o.start=e,o.end=t,o.resource=n,o.control=a,o.preventDefault=function(){this.preventDefault.value=!0},"function"==typeof a.onTimeRangeSelect&&(a.onTimeRangeSelect(o),o.preventDefault.value))return;switch(a.timeRangeSelectedHandling){case"PostBack":a.timeRangeSelectedPostBack(e,t,n);break;case"CallBack":a.timeRangeSelectedCallBack(e,t,n)}"function"==typeof a.onTimeRangeSelected&&a.onTimeRangeSelected(o)}else switch(a.timeRangeSelectedHandling){case"PostBack":a.timeRangeSelectedPostBack(e,t,i);break;case"CallBack":a.timeRangeSelectedCallBack(e,t,i);break;case"JavaScript":a.onTimeRangeSelected(e,t,i)}},this.timeRangeDoubleClickPostBack=function(e,t,i,n){var a={};a.start=e,a.end=t,a.resource=i,this.E("TimeRangeDoubleClick",n,a)},this.timeRangeDoubleClickCallBack=function(e,t,i,n){var a={};a.start=e,a.end=t,a.resource=i,this.G("TimeRangeDoubleClick",a,n)},this.bb=function(e,t,i){if(a.sa()){var n=i,o={};if(o.start=e,o.end=t,o.resource=n,o.preventDefault=function(){this.preventDefault.value=!0},"function"==typeof a.onTimeRangeDoubleClick&&(a.onTimeRangeDoubleClick(o),o.preventDefault.value))return;switch(a.timeRangeDoubleClickHandling){case"PostBack":a.timeRangeDoubleClickPostBack(e,t,n);break;case"CallBack":a.timeRangeDoubleClickCallBack(e,t,n)}"function"==typeof a.onTimeRangeDoubleClicked&&a.onTimeRangeDoubleClicked(o)}else switch(a.timeRangeDoubleClickHandling){case"PostBack":a.timeRangeDoubleClickPostBack(e,t,i);break;case"CallBack":a.timeRangeDoubleClickCallBack(e,t,i);break;case"JavaScript":a.onTimeRangeDoubleClick(e,t,i)}},this.eventEditPostBack=function(e,t,i){var n={};n.e=e,n.newText=t,this.E("EventEdit",i,n)},this.eventEditCallBack=function(e,t,i){var n={};n.e=e,n.newText=t,this.G("EventEdit",n,i)},this.cb=function(e,t){if(a.sa()){var i={};if(i.e=e,i.newText=t,i.preventDefault=function(){this.preventDefault.value=!0},"function"==typeof a.onEventEdit&&(a.onEventEdit(i),i.preventDefault.value))return;switch(a.eventEditHandling){case"PostBack":a.eventEditPostBack(e,t);break;case"CallBack":a.eventEditCallBack(e,t);break;case"Update":e.text(t),a.events.update(e)}if("function"==typeof a.onEventEdited&&(a.onEventEdited(i),i.preventDefault.value))return}else switch(a.eventEditHandling){case"PostBack":a.eventEditPostBack(e,t);break;case"CallBack":a.eventEditCallBack(e,t);break;case"JavaScript":a.onEventEdit(e,t)}},this.eventSelectPostBack=function(e,t,i){var n={};n.e=e,n.change=t,this.E("EventSelect",i,n)},this.eventSelectCallBack=function(e,t,i){var n={};n.e=e,n.change=t,this.G("EventSelect",n,i)},this.db=function(e,t,i,n){var o=a.multiselect,r=o.isSelected(t);if(i||n||!r||1!==o.eb.length)if(a.sa()){o.previous=o.events();var l={};if(l.e=t,l.selected=o.isSelected(t),l.ctrl=i,l.meta=n,l.preventDefault=function(){this.preventDefault.value=!0},"function"==typeof a.onEventSelect&&(a.onEventSelect(l),l.preventDefault.value))return;switch(a.eventSelectHandling){case"PostBack":a.eventSelectPostBack(t,s);break;case"CallBack":"undefined"!=typeof WebForm_InitCallback&&(window.fb="",window.gb=[],WebForm_InitCallback()),a.eventSelectCallBack(t,s);break;case"Update":o.hb(e,i)}"function"==typeof a.onEventSelected&&(l.change=o.isSelected(t)?"selected":"deselected",l.selected=o.isSelected(t),a.onEventSelected(l))}else{o.previous=o.events(),o.hb(e,i);var s=o.isSelected(t)?"selected":"deselected";switch(a.eventSelectHandling){case"PostBack":a.eventSelectPostBack(t,s);break;case"CallBack":"undefined"!=typeof WebForm_InitCallback&&(window.fb="",window.gb=[],WebForm_InitCallback()),a.eventSelectCallBack(t,s);break;case"JavaScript":a.onEventSelect(t,s)}}},this.commandCallBack=function(e,t){this.L();var i={};i.command=e,this.G("Command",i,t)},this.ib=function(t){if(!o.active&&!o.using&&(clearTimeout(e.selectedTimeout),!e.selecting)){if(e.editing)return void e.editing.blur();if(a.selectedCells&&"Disabled"!==a.timeRangeDoubleClickHandling)for(var i=0;i0&&this.nav.main.rows[0].cells.length>0){for(var e=(this.va,this.showHours?this.hourWidth:0),t=this.nav.main.rows[0].cells[0].clientWidth,i=1,n=0;n=a.hourWidth?(d.style.top=this.Ca()+"px",d.style.display=""):d.style.display="none",u>=a.scrollPos+a.sb&&parseInt(c.style.left)>=a.hourWidth?(c.style.top=this.Ca()+this.sb-10+"px",c.style.display=""):c.style.display="none")}}}},this.vb=function(e){var t=e.parentNode,i=0,n=e.offsetTop,a=e.parentNode.offsetWidth,o=e.offsetHeight;e.event.allday()&&(i=e.offsetLeft,a=e.offsetWidth);var r=document.createElement("textarea");r.style.boxSizing="border-box",r.style.position="absolute",r.style.width=a+"px",r.style.height=o+"px";var l=DayPilot.gs(e,"fontFamily");l||(l=DayPilot.gs(e,"font-family")),r.style.fontFamily=l;var s=DayPilot.gs(e,"fontSize");return s||(s=DayPilot.gs(e,"font-size")),r.style.fontSize=s,r.style.left=i+"px",r.style.top=n+"px",r.style.border="1px solid black",r.style.padding="0px",r.style.marginTop="0px",r.style.backgroundColor="white",r.value=DayPilot.tr(e.event.text()),r.event=e.event,t.appendChild(r),r},this.Ja=function(e,t,i,n){a.db(e,t,i,n)},this.multiselect={},this.multiselect.Z=[],this.multiselect.eb=[],this.multiselect.wb=[],this.multiselect.xb=[],this.multiselect.yb=function(){var e=a.multiselect;return DayPilot.JSON.stringify(e.events())},this.multiselect.events=function(){var e=a.multiselect,t=[];t.ignoreToJSON=!0;for(var i=0;i1&&i.add(e.event,!0)}else i.clear(!0);else a.allowMultiSelect&&t?i.add(e.event,!0):(i.clear(!0),i.add(e.event,!0));i.redraw(),i.zb()},this.multiselect.Ab=function(e){var t=a.multiselect;return t.Bb(e,t.Z)},this.multiselect.Cb=function(){for(var e=a.multiselect,t=[],i=0;ithis.max-1)},i.putIntoLine=function(e){for(var t=0;to.part.top+o.part.height-1))return!1}return!0},i.push(e),this.lines.push(i),this.lines.length-1},i.events.push(e),i.min=e.part.top,i.max=e.part.top+e.part.height,this.blocks.push(i),this.blocks.length-1},t.putIntoLine=function(e){for(var t=0;to.part.top+o.part.height-1))return!1}return!0},i.push(e),this.lines.push(i),this.lines.length-1},e.children&&(t.children=this.Mb(e.children)),t},this.Mb=function(e){var t=DayPilot.list();return DayPilot.list(e).each(function(e){var i=a.Pb(e);t.push(i)}),t},this.Nb=function(e,t){for(var i=this.Kb()?this.va:this.U,n=[],a=0;a0&&(i=i.concat(n)),DayPilot.Areas.showAreas(t,t.event,null,i),DayPilot.Util.addClass(t,a.q("_alldayevent_hover"))}"undefined"!=typeof DayPilot.Bubble&&a.bubble&&"Disabled"!==a.eventHoverHandling&&a.bubble.showEvent(this.event)},d.onmouseout=function(e){var t=this;DayPilot.Util.removeClass(t,a.q("_alldayevent_hover")),DayPilot.Areas.hideAreas(this,e),a.bubble&&a.bubble.hideOnMouseOut()},this.showToolTip&&!this.bubble&&d.setAttribute("title",l.client.toolTip());var c=l.start().getTime()===l.part.start.getTime(),h=l.end().getTime()===l.part.end.getTime(),u=s.backColor,f=document.createElement("div");if(f.setAttribute("unselectable","on"),f.className=this.q("_alldayevent_inner"),u&&(f.style.background=u),s.fontColor&&(f.style.color=s.fontColor),s.borderColor&&(f.style.borderColor=s.borderColor),a.rtl?(c||DayPilot.Util.addClass(d,this.q("_alldayevent_continueright")),h||DayPilot.Util.addClass(d,this.q("_alldayevent_continueleft"))):(c||DayPilot.Util.addClass(d,this.q("_alldayevent_continueleft")),h||DayPilot.Util.addClass(d,this.q("_alldayevent_continueright"))),l.client.innerHTML()?f.innerHTML=l.client.innerHTML():f.innerHTML=l.text(),d.appendChild(f),a.sa()){if("function"==typeof a.onAfterEventRender){var v={};v.e=d.event,v.div=d,a.onAfterEventRender(v)}}else a.afterEventRender&&a.afterEventRender(d.event,d);this.nav.allday.appendChild(d),this.elements.events.push(d)}e.style.display=""}}},this.M=function(e){if(a.multiselect.Ib(),this.elements.events)for(var t=0;ta.rb().clientWidth&&(i=DayPilot.sw(a.nav.bottomRight)),a.nav.headerParent&&(a.nav.headerParent.style.width=n+i+"px"),a.nav.main.style.width=n+"px",a.nav.events.style.width=n+"px",a.nav.crosshair.style.width=n+"px"}else a.nav.headerParent&&(a.nav.headerParent.style.width="100%"),a.nav.main.style.width="100%",a.nav.events.style.width="100%",a.nav.crosshair.style.width="100%";this.cc()},this.ia=function(){this.u?this.dc():DayPilot.pu(this.nav.hourTable),this.nav.hoursPlaceholder&&(this.nav.hoursPlaceholder.innerHTML="",this.nav.hourTable=this.ec(),this.nav.hoursPlaceholder.appendChild(this.nav.hourTable))},this.dc=function(){if(this.nav.hourTable)for(var e=0;ethis.headerHeight&&(this.t.headerHeight=e,this.ca(),this.da())}},this.qb=!0,this.wc=function(){var e=this.qb?a.nav.bottomRight:a.nav.scroll;return DayPilot.sw(e)>0},this._b=function(){var e=document.createElement("div"),t="Fixed"===this.columnWidthSpec;t||(e.style.overflow="auto"),e.style.position="absolute",e.style.left="0px",e.style.right="0px";var i=document.createElement("div");i.style.position="relative",i.style.zoom="1";var n=null,t="Fixed"===this.columnWidthSpec;if(t||this.qb){var a=document.createElement("div");if(a.style.cssFloat="left",a.style.styleFloat="left",a.style.width=this.hourWidth+"px",this.showHours){var o=this.xc();this.nav.corner=o,a.appendChild(o),i.appendChild(a),this.nav.upperLeft=a}var r=document.createElement("div");this.showHours&&(r.style.marginLeft=this.hourWidth+"px"),r.style.position="relative",r.style.overflow="hidden",r.style.height=this.Ca()+"px",i.appendChild(r),this.nav.upperRight=r,n=document.createElement("div"),n.style.position="relative",r.appendChild(n)}else{var l=document.createElement("table");l.cellPadding="0",l.cellSpacing="0",l.border="0",l.style.width="100%",l.style.borderCollapse="separate",l.style.border="0px none";var s=l.insertRow(-1);if(this.nav.fullHeader=l,this.showHours){var d=s.insertCell(-1);d.style.padding="0px",d.style.border="0px none";var o=this.xc();d.appendChild(o),this.nav.corner=o}d=s.insertCell(-1),d.style.width="100%",d.valign="top",d.style.position="relative",d.style.padding="0px",d.style.border="0px none",n=document.createElement("div"),n.style.position="relative",n.style.height=this.Ca()+"px",n.style.overflow="hidden",d.appendChild(n),this.nav.mid=n,i.appendChild(l)}this.nav.headerParent=n,this.yc();var c=this.wc(),t="Fixed"===this.columnWidthSpec;return c&&!t&&this.zc(),e.appendChild(i),e},this.yc=function(){this.nav.unifiedCornerRight=null,this.nav.header=document.createElement("table"),this.nav.header.cellPadding="0",this.nav.header.cellSpacing="0";var e="Fixed"===this.columnWidthSpec;e||(this.nav.header.width="100%"),this.nav.header.style.tableLayout="fixed",this.nav.header.oncontextmenu=function(){return!1};this.wc();if(this.nav.headerParent.appendChild(this.nav.header),this.nav.allday&&DayPilot.de(this.nav.allday),this.showAllDayEvents){var t=document.createElement("div");t.style.position="absolute",t.style.top="0px",t.style.height="0px";var e="Fixed"===this.columnWidthSpec;e?t.style.width=this.va.length*this.columnWidth+"px":(t.style.left="0px",t.style.right="0px"),this.nav.allday=t,this.nav.headerParent.appendChild(t)}},this.zc=function(){if(this.nav.fullHeader){var e=this.nav.fullHeader.rows[0],t=e.insertCell(-1);t.style.padding="0px",t.style.verticalAlign="top",t.setAttribute("unselectable","on");var i=document.createElement("div");i.setAttribute("unselectable","on"),i.className=this.q("_cornerright"),i.style.overflow="hidden",i.style.position="relative",i.style.width="16px",i.style.height=this.Ca()+"px";var n=document.createElement("div");n.className=this.q("_cornerright_inner"),i.appendChild(n),t.appendChild(i),this.nav.cornerRight=i}},this.xc=function(){var e=document.createElement("div");e.style.position="relative",e.className=this.q("_corner"),e.style.width=this.hourWidth+"px",e.style.height=this.Ca()+"px",e.style.overflow="hidden",e.oncontextmenu=function(){return!1};var t=document.createElement("div");t.className=this.q("_corner_inner"),t.setAttribute("unselectable","on");var i=this.cornerHTML||this.cornerHtml;t.innerHTML=i?i:"",e.appendChild(t);var n=document.createElement("div");return n.style.position="absolute",n.style.padding="2px",n.style.top="0px",n.style.left="1px",n.style.backgroundColor="#FF6600",n.style.color="white",n.innerHTML="DEMO",n.setAttribute("unselectable","on"),DayPilot.Util.isNullOrUndefined("K5woOes")&&e.appendChild(n),e},this.N=function(){var e=this.nav.main;e.root=null,e.onmouseup=null;for(var t=0;t0;)this.u||DayPilot.pu(t.rows[0]),t.deleteRow(0);if(this.Bc=!0,this.scrollLabelsVisible)for(var o=this.va,s=this.showHours?this.hourWidth:0,d=(this.nav.scroll.clientWidth-s)/o.length,c=0;c0;)this.u||DayPilot.pu(p.rows[0]),p.deleteRow(0);for(var g=p.insertRow(-1),y=0;y=this.businessEndsHour||6===e.getDayOfWeek()||0===e.getDayOfWeek()):e.getHours()>=this.businessBeginsHour||e.getHours()l))return;e.movingShadow=a.ta(DayPilot.Global.moving,!a.C.ie,a.shadow),e.movingShadow.style.width=e.movingShadow.parentNode.offsetWidth+1+"px"}if(!a.coords)return;var s=a.cellHeight,d=0,c=e.moveOffsetY;c||(c=s/2),"Top"===this.moveBy&&(c=0);var h=Math.floor((a.coords.y-c-d+s/2)/s)*s+d;hf&&(h=f-v);var p=u.clientWidth/u.rows[0].cells.length,g=Math.floor(a.coords.x/p);g<0&&(g=0),a.rtl&&(g=a.va.length-g-1),function(){var t=a.Hc,i=DayPilot.Global.moving.event,n=a.Ua(i,g,h);if(!t||t.start.getTime()!==n.start.getTime()||t.end.getTime()!==n.end.getTime()||t.resource!==n.resource){var o={};o.e=i,o.start=n.start,o.end=n.end,o.resource=n.resource,o.html=null,a.Hc=o,"function"==typeof a.onEventMoving&&a.onEventMoving(o);var r=e.movingShadow;o.html?r.firstChild.innerHTML=o.html:r.firstChild.innerHTML=""}}(),e.movingShadow.style.top=h+"px";var y=a.nav.events;g=0&&e.movingShadow.column!==g&&(e.movingShadow.column=g,e.moveShadow(y.rows[0].cells[g]))}else if(e.firstMousePos){var m=a.Ic(a.coords.x),b=Math.floor(a.coords.y/a.cellHeight),w=a.nav.main.rows[b].cells[m];if(!e.selecting){var D=e.firstMousePos,k=a.coords;D.x===k.x&&D.y===k.y||(e.selecting={"calendar":a})}if(!e.selecting)return;var n=a.coords,x=e.getColumn(w);x!==e.column&&(w=a.nav.main.rows[b].cells[e.column]);var C=e.selecting;if(C.last&&C.last.x===m&&C.last.y===b)return;C.last={"x":m,"y":b},n.yl&&(r=l-e.originalTop),e.resizingShadow.style.height=r+"px"}else if("top"===DayPilot.Global.resizing.dpBorder){var s=Math.floor((e.originalTop+o-n+i/2)/i)*i+n;se.originalTop+e.originalHeight-i&&(s=e.originalTop+e.originalHeight-i);var r=e.originalHeight-(s-e.originalTop);ro.left;)n+=1,o=this.col(t,n);e.x=n-1;var r=0,l=Math.floor((a.coords.y-r)/a.cellHeight);return e.y=l,e.x<0?null:e},this.Kc.col=function(e,t){var i={};if(i.left=0,i.width=0,!e)return null;if(!e.rows)return null;if(0===e.rows.length)return null;if(0==e.rows[0].cells.length)return null;var n=e.rows[0].cells[t];if(!n)return null;var a=DayPilot.abs(e),o=DayPilot.abs(n);return i.left=o.x-a.x,i.width=n.offsetWidth,i},this.Fc=function(){this.T(),this.elements.crosshair||(this.elements.crosshair=[]);var e=this.Kc.getCellCoords();if(e){var t=e.x,i=Math.floor(e.y/(60/a.cellDuration)*(60/a.timeHeaderCellDuration));if(!(i<0)){if(this.nav.hourTable){if(i>=this.nav.hourTable.rows.length)return;var n=document.createElement("div");n.style.position="absolute",n.style.left="0px",n.style.right="0px",n.style.top="0px",n.style.bottom="0px",n.style.opacity=.5,n.style.backgroundColor=this.crosshairColor,n.style.opacity=this.crosshairOpacity/100,n.style.filter="alpha(opacity="+this.crosshairOpacity+")",this.nav.hourTable.rows[i].cells[0].firstChild.appendChild(n),this.elements.crosshair.push(n)}if(this.nav.header){var o=document.createElement("div");o.style.position="absolute",o.style.left="0px",o.style.right="0px",o.style.top="0px",o.style.bottom="0px",o.style.opacity=.5,o.style.backgroundColor=this.crosshairColor,o.style.opacity=this.crosshairOpacity/100,o.style.filter="alpha(opacity="+this.crosshairOpacity+")";var r=this.nav.header.rows[this.headerLevels-1];r.cells[t]&&(r.cells[t].firstChild.appendChild(o),this.elements.crosshair.push(o))}if("Header"!==this.crosshairType){var l=this.nav.crosshair,s=0,d=Math.floor((a.coords.y-s)/a.cellHeight)*a.cellHeight+s,c=a.cellHeight,h=document.createElement("div");h.style.position="absolute",h.style.left="0px",h.style.right="0px",h.style.top=d+"px",h.style.height=c+"px",h.style.backgroundColor=this.crosshairColor,h.style.opacity=this.crosshairOpacity/100,h.style.filter="alpha(opacity="+this.crosshairOpacity+")",h.onmousedown=this.Lc,l.appendChild(h),this.elements.crosshair.push(h);var u=this.Kc.col(this.nav.main,t);if(c=this.nav.main.clientHeight,u){var f=document.createElement("div");f.style.position="absolute",f.style.left=u.left+"px",f.style.width=u.width+"px",f.style.top="0px",f.style.height=c+"px",f.style.backgroundColor=this.crosshairColor,f.style.opacity=this.crosshairOpacity/100,f.style.filter="alpha(opacity="+this.crosshairOpacity+")",f.onmousedown=this.Lc,l.appendChild(f),this.elements.crosshair.push(f)}}}}},this.Lc=function(e){a.T();var t=a.Kc.getCellCoords(),i=0,n=a.nav.main.rows[t.y+i].cells[t.x];a.ib.apply(n,[e])},this.T=function(){if(this.elements.crosshair&&0!==this.elements.crosshair.length){for(var e=0;e0;)this.u||DayPilot.pu(e.rows[0]),e.deleteRow(0);this.Pc=!0;var o=a.cornerHTML||a.cornerHtml,l=a.nav.corner;l&&(this.u||DayPilot.pu(l.firstChild),l.firstChild.innerHTML=o?o:"");for(var s=0;s0&&e.offsetHeight>0},this.Tc=function(){var e=a.Sc;e()||a.Uc||(a.Uc=setInterval(function(){e()&&(clearInterval(a.Uc),a.Ac(),a.ka())},100))},this.scrollToY=function(e){this.rb().scrollTop=e},this.scrollToHour=function(e){var t=a.Rc(e);this.rb().scrollTop=t-this.ub()},this.rb=function(){return"Fixed"===this.columnWidthSpec||this.qb?this.nav.bottomRight:this.nav.scroll},this.onCallbackError=function(e,t){alert("Error!\r\nResult: "+e+"\r\nContext:"+t)},this.ka=function(){if(a.showHeader){var e=this.wc(),t=!!this.nav.cornerRight;if(this.qb){this.nav.unifiedCornerRight&&DayPilot.de(this.nav.unifiedCornerRight);var i=this.kc();if("100%"!=i&&parseInt(i)=this.autoRefreshMaxCount)){this.L();var t=this.autoRefreshInterval;if(!t||t<10)throw"The minimum autoRefreshInterval is 10 seconds";this.autoRefreshTimeout=window.setTimeout(function(){a.Vc()},1e3*this.autoRefreshInterval)}},this.L=function(){this.autoRefreshTimeout&&window.clearTimeout(this.autoRefreshTimeout)},this.Vc=function(){if(!(DayPilot.Global.resizing||DayPilot.Global.moving||e.drag||e.selecting)){var t=!1;if("function"==typeof this.onAutoRefresh){var i={};i.i=this.B,i.preventDefault=function(){this.preventDefault.value=!0},a.onAutoRefresh(i),i.preventDefault.value&&(t=!0)}!t&&this.r()&&this.commandCallBack(this.autoRefreshCommand),this.B++}this.B1))){o.using=!0;var t=o.getCellCoords(e);o.startCoords=t;var i=a.tapAndHoldTimeout;o.timeout=window.setTimeout(function(){switch(e.preventDefault(),o.active=!0,o.start=!1,a.timeRangeTapAndHoldHandling){case"Select":o.startSelecting(t);break;case"ContextMenu":o.startSelecting(t),o.active=!1,a.contextMenuSelection&&a.contextMenuSelection.show(a.getSelection())}},i)}},this.Vb.onCellTouchMove=function(e){},this.Vb.onCellTouchEnd=function(t){if(!o.active)return window.clearTimeout(o.timeout),void(o.start&&!function(t){if("Disabled"!==a.timeRangeSelectedHandling){a.clearSelection(),a.selectedCells=[t],e.topSelectedCell=t,e.bottomSelectedCell=t,a.jb();var i=a.getSelection();i.toString=function(){return"start: "+this.start+"\nend: "+this.end},setTimeout(function(){a.ab(i.start,i.end,i.resource)},10)}}(this));t.preventDefault(),o.startcell=null,o.start=!1;var i=a.getSelection();i.toString=function(){return"start: "+this.start+"\nend: "+this.end},a.ab(i.start,i.end,i.resource),window.setTimeout(function(){o.active=!1},500)},this.Vb.startMoving=function(t,i){DayPilot.Global.moving=t,(DayPilot.Global.moving.helper={}).oldColumn=a.va[t.event.part.dayIndex].id,e.originalMouse=i,e.originalTop=this.offsetTop;var n=DayPilot.abs(t);e.moveOffsetY=i.y-n.y,e.movingShadow||(e.movingShadow=a.ta(DayPilot.Global.moving,!a.C.ie,a.shadow),e.movingShadow.style.width=e.movingShadow.parentNode.offsetWidth+1+"px")},this.Vb.startResizing=function(t,i,n){DayPilot.Global.resizing=t,t.dpBorder=i,e.originalMouse=n,e.originalHeight=t.offsetHeight,e.originalTop=t.offsetTop},this.Vb.updateResizing=function(e){a.Gc(e)},this.Vb.updateMoving=function(){var t=a.coords,i=a.cellHeight,n=0,o=e.moveOffsetY;o||(o=i/2);var r=Math.floor((t.y-o-n+i/2)/i)*i+n;rs&&(r=s-d),e.movingShadow.style.top=r+"px";var c=l.clientWidth/l.rows[0].cells.length,h=Math.floor(t.x/c);h<0&&(h=0);var u=a.nav.events;h=0&&e.movingShadow.column!==h&&(e.movingShadow.column=h,e.moveShadow(u.rows[0].cells[h]))},this.Vb.onEventTouchStart=function(e){if(!o.active&&!DayPilot.Util.isMouseEvent(e)){e.stopPropagation(),o.preventEventTap=!1,o.using=!0,o.startCoords=o.getCellCoords(e);var t=this,i=e.touches?e.touches[0].pageX:e.pageX,n=e.touches?e.touches[0].pageY:e.pageY,r={x:i,y:n,div:this};a.coords=o.relativeCoords(e);var l=a.tapAndHoldTimeout;o.timeout=window.setTimeout(function(){var i=t.event;switch(o.active=!0,a.eventTapAndHoldHandling){case"Move":i.client.moveEnabled()&&o.startMoving(t,r);break;case"ContextMenu":var n=i.client.contextMenu();DayPilot.Menu&&DayPilot.Menu.touchPosition(e),n?n.show(i):a.contextMenu&&a.contextMenu.show(i)}},l)}},this.Vb.onMainTouchMove=function(t){if(!DayPilot.Util.isMouseEvent(t)){if(o.start=!1,o.timeout){var i=o.getCellCoords(t);i&&o.startCoords&&(i.pageX===o.startCoords.pageX&&i.pageY===o.startCoords.pageY||window.clearTimeout(a.Vb.timeout))}if(DayPilot.Global.moving&&e.movingShadow)return t.preventDefault(),a.coords=o.relativeCoords(t),void o.updateMoving();if(DayPilot.Global.resizing){t.preventDefault();var n=t.touches?t.touches[0]:t,i={x:n.pageX,y:n.pageY};return void o.updateResizing(i)}if(o.startcell){if(t.preventDefault(),!o.active)return void window.clearTimeout(o.timeout);var i=o.getCellCoords(t);o.extendSelection(i)}o.preventEventTap=!0}},this.Vb.relativeCoords=function(e){var t=a.nav.main,i=e.touches?e.touches[0].pageX:e.pageX,n=e.touches?e.touches[0].pageY:e.pageY,o=DayPilot.abs(t);return{x:i-o.x,y:n-o.y,"toString":function(){return"x: "+this.x+", y:"+this.y}}},this.Vb.onMainTouchEnd=function(t){if(!DayPilot.Util.isMouseEvent(t))if(DayPilot.Global.moving){o.active=!1,t.preventDefault(),t.stopPropagation();var i=e.movingShadow.offsetTop;DayPilot.de(e.movingShadow);var n=DayPilot.Global.moving.event,r=e.movingShadow.column;DayPilot.Global.moving=null,e.movingShadow=null,n.calendar.Va(n,r,i,t,e.drag)}else if(o.startcell){if(!o.active)return void window.clearTimeout(o.timeout);t.preventDefault(),o.startcell=null;var l=a.getSelection();l.toString=function(){return"start: "+this.start+"\nend: "+this.end},a.ab(l.start,l.end,l.resource),window.setTimeout(function(){o.active=!1},500)}},this.Vb.onEventTouchMove=function(e){o.preventEventTap=!0},this.Vb.onEventTouchEnd=function(e){if(!DayPilot.Util.isMouseEvent(e)){if(!o.active){if(o.preventEventTap)return;return window.clearTimeout(o.timeout),void a.Ha(this,!1,!1,e)}return o.active=!1,o.timeout?void window.clearTimeout(o.timeout):void 0}},this.Sb=function(t){var i=5,n=Math.max(a.durationBarWidth,10),o="Top"===a.moveBy;if("undefined"!=typeof e){var r=DayPilot.mo3(this,t);if(r){var l=this;if(!l.active){var s=[];l.event.client.deleteEnabled()&&s.push({"action":"JavaScript","v":"Hover","w":17,"h":17,"top":2,"right":2,"css":a.q("_event_delete"),"js":function(e){a.Pa(e)}});var d=l.event.cache?l.event.cache.areas:l.event.data.areas;d&&d.length>0&&(s=s.concat(d)),DayPilot.Areas.showAreas(l,l.event,null,s),DayPilot.Util.addClass(l,a.q("_event_hover"))}if(!DayPilot.Global.resizing&&!DayPilot.Global.moving){var c=this.isFirst,h=this.isLast;if("Disabled"!==a.moveBy&&"None"!==a.moveBy&&(!o&&r.x<=n&&this.event.client.moveEnabled()?c?this.style.cursor="move":this.style.cursor="not-allowed":!o&&r.y<=i&&this.event.client.resizeEnabled()?c?(this.style.cursor="n-resize",this.dpBorder="top"):this.style.cursor="not-allowed":o&&r.y<=n&&this.event.client.moveEnabled()?this.style.cursor="move":this.offsetHeight-r.y<=i&&this.event.client.resizeEnabled()?h?(this.style.cursor="s-resize",this.dpBorder="bottom"):this.style.cursor="not-allowed":DayPilot.Global.resizing||DayPilot.Global.moving||(this.event.client.clickEnabled()?this.style.cursor="pointer":this.style.cursor="default"),"undefined"!=typeof DayPilot.Bubble&&a.bubble&&"Disabled"!==a.eventHoverHandling&&("default"===this.style.cursor||"pointer"===this.style.cursor))){this.Yc&&r.x===this.Yc.x&&r.y===this.Yc.y||(this.Yc=r,a.bubble.showEvent(this.event))}}}}},this.Tb=function(e){DayPilot.Util.removeClass(this,a.q("_event_hover")),a.bubble&&a.bubble.hideOnMouseOut(),DayPilot.Areas.hideAreas(this,e)},this.Zc=null,this.ma=function(){if(this.showCurrentTime){this.$c();var e=(new DayPilot.Date).addMinutes(a.showCurrentTimeOffset);if("Full"===a.showCurrentTimeMode)this._c(e);else{if("Day"!==a.showCurrentTimeMode)throw"Invalid DayPilot.Calendar.showCurrentTimeMode value: "+a.showCurrentTimeMode;this.ad(e)}if(this.nav.events&&!this.Zc){this.Zc=setTimeout(function(){a.Zc=null,a.ma()},3e4)}}},this.$c=function(){DayPilot.de(a.elements.separators),a.elements.separators=[]},this.ad=function(e){var t=e.getTime(),i=a.nav.events;if(i)for(var n=0;n=h.getTime()):"Date"===a.allDayEnd?!(x=h.getTime()):!(x<=c.getTime()||k>=h.getTime()),s&&(C=C&&(l.resource===f.id||"*"===f.id)),C){var P=new DayPilot.Event(l,this);if(P.part.start=c.getTime()x?D:h,P.part.colStart=DayPilot.DateUtil.daysDiff(c,P.part.start),P.part.colWidth=DayPilot.DateUtil.daysSpan(P.part.start,P.part.end)+1,s&&(P.part.colStart=o,P.part.colWidth=1),"function"==typeof a.onEventFilter&&a.events.bd){var S={};if(S.filter=a.events.bd,S.visible=!0,S.e=P,a.onEventFilter(S),!S.visible)continue}this.Qb.events.push(P),("function"==typeof this.onBeforeEventRender||a.showEventStartEnd)&&(P.cache=this.t.events[m]),n[m]=!0,!s||P.part.start.getTime()===k&&P.part.end.getTime()===x||(n[m]=!1)}}else{var b=null;if("function"==typeof a.onBeforeEventRender&&(b=a.t.events[m]),b){if(b.hidden)continue}else if(l.hidden)continue;var C=!1;if(C=s?f.id===l.resource&&!(x<=p||k>=y):!(x<=p||k>=y)||x===k&&k===p){var P=new DayPilot.Event(l,a);P.part.dayIndex=o,P.part.start=px?D:g;var A=this.kb(P.part.start,f.start),T=this.kb(P.part.end,f.start),E=A.top,M=T.top;if(E===M&&(A.cut||T.cut))continue;P.part.box=r.useBox(x-k);var H=0;if(P.part.box){var _=T.boxBottom;P.part.top=Math.floor(E/this.cellHeight)*this.cellHeight+H,P.part.height=Math.max(Math.ceil(_/this.cellHeight)*this.cellHeight-P.part.top,this.cellHeight-1),P.part.barTop=Math.max(E-P.part.top-1,0),P.part.barHeight=Math.max(M-E-2,1)}else P.part.top=E+H,P.part.height=Math.max(M-E,0),P.part.barTop=0,P.part.barHeight=Math.max(M-E-2,1);if("function"==typeof a.onEventFilter&&a.events.bd){var S={};if(S.filter=a.events.bd,S.visible=!0,S.e=P,a.onEventFilter(S),!S.visible)continue}var w=P.part.top,D=P.part.top+P.part.height;w>u.maxStart&&(u.maxStart=w),Dthis.Aa&&(this.Aa=D),f.events.push(P),("function"==typeof this.onBeforeEventRender||a.showEventStartEnd)&&(P.cache=this.t.events[m]),P.part.start.getTime()===k&&P.part.end.getTime()===x&&(n[m]=!0)}}}}for(var o=0;oo.part.colStart+o.part.colWidth-1))return!1}return!0},i.push(e),this.lines.push(i),this.lines.length-1};for(var o=0;o-1?"&"+l:"?"+l,DayPilot.ajax({"method":"GET","url":r,"success":o,"error":n})}},this.queue={},this.queue.list=[],this.queue.list.ignoreToJSON=!0,this.queue.add=function(e){if(e){if(!e.isAction)throw"DayPilot.Action object required for queue.add()";a.queue.list.push(e)}},this.queue.notify=function(e){var t={};t.actions=a.queue.list,a.G("Notify",t,e,"Notify"),a.queue.list=[]},this.queue.clear=function(){a.queue.list=[]},this.queue.pop=function(){return a.queue.list.pop()},this.gd=function(e){if(this.A&&this.va){var e=e||{},t=!e.eventsOnly;a.cssOnly||(a.cssOnly=!0,DayPilot.Util.log("DayPilot: cssOnly = false mode is not supported since DayPilot Pro 8.0.")),this.r()||(a.cellProperties={}),t?(a.vc.clearCache(),a.M(),this.hd(),this._(),this.ba(),a.da(),a.ea(),a.ca(),a.fa(),a.ga(),a.D(),a.ha(),a.jb(),a.ia(),a.ja(),a.ka(),a.la(),a.jd(),this.oa(),this.pa(),this.ma(),a.qa()):(a.M(),a.ba(),a.ca(),a.oa(),a.pa(),a.qa()),this.visible?this.show():this.hide()}},this.update=function(){if(this.gd(),"function"==typeof a.onAfterRender){var e={};e.isUpdate=!0,e.data=null,a.onAfterRender(e)}},this.jd=function(){if(a.nav.top.className!==a.q("_main")){a.nav.top.className=a.q("_main");var e=a.nav.corner;e.className=a.q("_corner"),e.firstChild.className=a.q("_corner_inner");var t=a.nav.unifiedCornerRight;t&&(t.firstChild.className=a.q("_cornerright"),t.firstChild.firstChild.className=a.q("_cornerright_inner"))}},this.show=function(){a.visible=!0,a.nav.top.style.display="",a.P(),a.ka(),a.pb()},this.hide=function(){a.visible=!1,a.nav.top.style.display="none"},this.Qc={},this.Qc.scope=null,this.Qc.notify=function(){a.Qc.scope&&a.Qc.scope["$apply"]()},this.debug=new DayPilot.Debug(this),this.Ic=function(e){if(e<0)return null;for(var t=0,i=a.nav.events.rows[0].cells,n=0;n0&&(this.nav.scroll.style.height=e+"px",this.sb=a.nav.scroll.clientHeight,this.nav.bottomLeft&&(this.nav.bottomLeft.style.height=e+"px"),this.nav.bottomRight&&(this.nav.bottomRight.style.height=e+"px")),"Parent100Pct"===this.heightSpec?this.nav.top.style.height="100%":this.nav.top.style.height=this.Yb()+"px"},this.setHeight=function(e){"Parent100Pct"!==this.heightSpec&&(this.heightSpec="Fixed"),this.height=e-this.Ca(),this.ja()},this.md=function(e){var t=document.createElement("div");t.style.position="absolute",t.style.top="-2000px",t.style.left="-2000px",t.className=this.q(e),document.body.appendChild(t);var i=t.offsetHeight,n=t.offsetWidth;document.body.removeChild(t);var a={};return a.height=i,a.width=n,a},this.vc={};var r=this.vc;r.locale=function(){return DayPilot.Locale.find(a.locale)},r.weekStarts=function(){return"number"==typeof a.weekStarts?a.weekStarts:r.locale().weekStarts},r.timeFormat=function(){return"Auto"!==a.timeFormat?a.timeFormat:this.locale().timeFormat},r.useBox=function(e){return"Always"===a.useEventBoxes||"Never"!==a.useEventBoxes&&e<60*a.cellDuration*1e3},r.notifyType=function(){var e;if("Immediate"===a.notifyCommit)e="Notify";else{if("Queue"!==a.notifyCommit)throw"Invalid notifyCommit value: "+a.notifyCommit;e="Queue"}return e},r.clearCache=function(){delete a.t.allDayEventHeight,delete a.t.allDayHeaderHeight,delete a.t.headerHeight},r.allDayEventHeight=function(){if(a.t.allDayEventHeight)return a.t.allDayEventHeight;var e=a.md("_alldayevent_height").height;return e||(e=a.allDayEventHeight),a.t.allDayEventHeight=e,e},r.allDayHeaderHeight=function(){if(a.t.allDayHeaderHeight)return a.t.allDayHeaderHeight;var e=a.ld;return a.t.allDayHeaderHeight=e,e},r.headerHeight=function(){if(a.t.headerHeight)return a.t.headerHeight;var e=a.md("_header_height").height;return e||(e=a.headerHeight),a.t.headerHeight=e,e},this.exportAs=function(e,t){var i=l.generate(e,t);return new DayPilot.Export(i)},this.nd={};var l=this.nd;l.od=null,l.pd=null,l.generate=function(e,t){"object"==typeof e&&(t=e,e=null);var t=t||{},e=e||t.format||"svg",i=t.scale||1;if("config"!==e){"jpg"===e.toLowerCase()&&(e="jpeg");var n=t.area||"viewport";l.od=t,l.pd=n;var o,s=l.getWidth(),d=l.getHeight();switch(e.toLowerCase()){case"svg":o=new DayPilot.Svg(s,d);break;case"png":o=new DayPilot.Canvas(s,d,"image/png",i);break;case"jpeg":o=new DayPilot.Canvas(s,d,"image/jpeg",i,t.quality);break;default:throw"Export format not supported: "+e}var c=l.getRectangles(),h=new DayPilot.StyleReader(a.nav.top).getBackColor(),u=new DayPilot.StyleReader(a.nav.top).get("border-top-color");"0px"!==new DayPilot.StyleReader(a.nav.top).get("border-top-width")||(u="white");var f=new DayPilot.StyleReader(a.nav.corner.firstChild).getBackColor(h),v=a.nav.hourTable.rows[0].cells[0].firstChild.firstChild,p=new DayPilot.StyleReader(v).get("border-right-color"),g=new DayPilot.StyleReader(v).getBackColor(h),y=new DayPilot.StyleReader(v).getFont(),m=new DayPilot.StyleReader(v.firstChild.childNodes[1]).getFont(),b=new DayPilot.StyleReader(v.firstChild.childNodes[1]).getPx("padding-right"),w=new DayPilot.StyleReader(v).get("color"),D=a.nav.header.rows[0].cells[0].firstChild.firstChild,k=new DayPilot.StyleReader(D).getBackColor(h),x=new DayPilot.StyleReader(D).getFont(),C=new DayPilot.StyleReader(D).get("color"),P=new DayPilot.StyleReader(D).get("border-right-color"),S=a.nav.header.rows[a.nav.header.rows.length-1].cells[0].firstChild,A=S.firstChild,T=new DayPilot.StyleReader(S).getBackColor(h),E=new DayPilot.StyleReader(A).getBackColor(T),M=a.nav.main.rows[0].cells[0].firstChild.firstChild,H=new DayPilot.StyleReader(M).get("border-right-color"),M=l.fakeCell(),_=new DayPilot.StyleReader(M.firstChild).getBackColor();DayPilot.Util.addClass(M,a.q("_cell_business"));var R=new DayPilot.StyleReader(M.firstChild).getBackColor();DayPilot.de(M);var B=l.getViewportOffsetTop(),N=0;N="Fixed"===a.columnWidthSpec?a.columnWidth:c.gridContent.w/a.va.length,o.fillRect(c.main,"white"),o.fillRect(c.main,h);var U=c.corner.h-B;DayPilot.list.for(a.nc(),function(e){return a.sc(e)}).each(function(e){var t=a.pc(),i=e.hour,n=e.sup,r=i,l=20,s={"x":0,"y":U,"w":c.grid.x+1,"h":t+1},d={"x":0,"y":U,"w":c.grid.x+1-l,"h":t+1},h={"x":d.w,"y":U,"w":l-b-1,"h":t+1},u=g;o.fillRect(s,u),o.text(d,r,y,w,"right"),o.text(h,n,m,w,"right"),o.rect(s,p),U+=t});var L=60*a.cellDuration*1e3,z=c.grid.x;DayPilot.list(a.va).each(function(e,t){var i=N,n=c.grid.y-B;DayPilot.list.for(a.Fa()).each(function(r,s){var d=a.Dc(t,s)||{},c=null;if(d.cssClass){var h=l.fakeCell();DayPilot.Util.addClass(h,d.cssClass),c=new DayPilot.StyleReader(h.firstChild).getBackColor(),DayPilot.de(h)}var u=a.cellHeight,f={"x":z,"y":n,"w":i+1,"h":u+1},v=d.business,p={};p.cell={},p.cell.start=e.start.addTime(s*L).addHours(a.Ba()),p.cell.end=p.cell.start.addTime(L),p.cell.resource=e.id,DayPilot.Util.copyProps(d,p.cell,["cssClass","html","backImage","backRepeat","backColor","business"]),p.backColor=c||(v?R:_),"function"==typeof a.onBeforeCellExport&&a.onBeforeCellExport(p),o.fillRect(f,p.backColor),o.rect(f,H),n+=u}),z+=i});var O=c.grid.x;DayPilot.list(a.va).each(function(e){DayPilot.list(e.events).each(function(e){var t=e.cache||e.data,i=l.fakeEvent();i.className+=" "+t.cssClass;var n=i.firstChild,r=i.childNodes[1],s=new DayPilot.StyleReader(n).getBackColor(),d=new DayPilot.StyleReader(n.firstChild).getBackColor(),h=new DayPilot.StyleReader(n.firstChild).getPx("width"),u=new DayPilot.StyleReader(r).get("border-right-color"),f=new DayPilot.StyleReader(r).getFont(),v=new DayPilot.StyleReader(r).get("color"),p=new DayPilot.StyleReader(r).getBackColor(),g={};g.left=new DayPilot.StyleReader(r).getPx("padding-left"),g.right=new DayPilot.StyleReader(r).getPx("padding-right"),g.top=new DayPilot.StyleReader(r).getPx("padding-top"),g.bottom=new DayPilot.StyleReader(r).getPx("padding-bottom"),DayPilot.de(i);var y=O+N*e.part.left/100,m=(N-a.columnMarginRight)*e.part.width/100,b=e.part.top+c.grid.y-a.ub()-B,w=e.part.height,D=t.backColor||p,k=t.barColor||d,x=t.barBackColor||s,C={};C.e=e,C.text=e.text?e.text():e.client.html(),C.fontSize=f.size,C.fontFamily=f.family,C.fontStyle=f.style,C.fontColor=v,C.backColor=D,C.borderColor=u,C.horizontalAlignment="left",C.barWidth=h,C.barColor=k,C.barBackColor=x,"function"==typeof a.onBeforeEventExport&&a.onBeforeEventExport(C);var P={"x":y,"y":b,"w":m+1,"h":w+1},S=DayPilot.Util.copyProps(P);e.client.barVisible()&&(S.x+=h,S.w-=h);var A=DayPilot.Util.copyProps(S);if(A.x+=g.left,A.w-=g.left+g.right,A.y+=g.top,A.h-=g.top+g.bottom,o.fillRect(P,C.backColor),e.client.barVisible()){var T={"x":P.x,"y":P.y,"w":C.barWidth,"h":P.h},E={"x":P.x,"y":P.y+1+e.part.barTop,"w":C.barWidth,"h":e.part.barHeight+1};o.fillRect(T,C.barBackColor),o.fillRect(E,C.barColor)}o.text(A,C.text,{"size":C.fontSize,"family":C.fontFamily,"style":C.fontStyle},C.fontColor,C.horizontalAlignment),o.rect(P,C.borderColor);var y=P.x,M=P.x+P.w-2,b=P.y;DayPilot.list(t.areas).each(function(t){if("Hover"!==(t.visibility||t.v)){var i=t.left;t.start&&(i=a.getPixels(new DayPilot.Date(t.start)).left-e.part.left);var n=t.width||t.w,r=t.height||t.h;i||(i=M-n-y),t.right?n=e.part.width-t.right-i:t.end&&(n=a.getPixels(new DayPilot.Date(t.end)).left-t.left-e.part.left+1);var l=t.top;"number"==typeof t.bottom&&(r=e.part.height-t.bottom-l);var s={"x":y+i,"y":b+l,"w":n,"h":r};if(t.backColor&&o.fillRect(s,t.backColor),t.image){var d=new Image;d.src=t.image,o.image(s,d)}else t.html&&o.text(s,t.html,{"size":C.fontSize,"family":C.fontFamily,"style":C.fontStyle},t.fontColor||C.fontColor,null,t.padding)}})}),O+=N}),o.fillRect(c.corner,f);var z=c.gridContent.x;return DayPilot.list.for(a.headerLevels).each(function(e){var t=a.headerHeight*e,i=a.Nb(e);DayPilot.list(i).each(function(i){var n={};n.text=DayPilot.Util.stripTags(i.html),n.horizontalAlignment="center",n.backColor=i.backColor||k,n.fontSize=x.size,n.fontFamily=x.family,n.fontStyle=x.style,n.fontColor=C,n.header={},n.header.level=e,DayPilot.Util.copyProps(i,n.header,["id","start","name","html","backColor"]),"function"==typeof a.onBeforeHeaderExport&&a.onBeforeHeaderExport(n);var r=N,l=a.headerHeight,s={"x":z,"y":t,"w":r+1,"h":l+1};o.fillRect(s,n.backColor),o.rect(s,P),o.text(s,n.text,{"size":n.fontSize,"family":n.fontFamily,"style":n.fontStyle},n.fontColor,n.horizontalAlignment),z+=N})}),function(){if(a.showAllDayEvents){var e=a.headerHeight*a.headerLevels,t=c.gridContent.x;DayPilot.list(a.va).each(function(i){var n=N,a=r.allDayHeaderHeight(),l={"x":t,"y":e,"w":n+1,"h":a+1};o.fillRect(l,E),o.rect(l,P),t+=N}),DayPilot.list(a.Qb.lines).each(function(e,t){DayPilot.list(e).each(function(e){var i=l.fakeEvent("alldayevent");i.className+=" "+e.data.cssClass;var n=i.firstChild,s=new DayPilot.StyleReader(n).get("border-right-color"),d=new DayPilot.StyleReader(n).getFont(),h=new DayPilot.StyleReader(n).get("color"),u=new DayPilot.StyleReader(n).getBackColor(),f={}; f.left=new DayPilot.StyleReader(n).getPx("padding-left"),f.right=new DayPilot.StyleReader(n).getPx("padding-right"),f.top=new DayPilot.StyleReader(n).getPx("padding-top"),f.bottom=new DayPilot.StyleReader(n).getPx("padding-bottom"),DayPilot.de(i);var v=e.cache||e.data,p=v.backColor||u,g={};g.e=e,g.text=e.text?e.text():e.client.html(),g.fontSize=d.size,g.fontFamily=d.family,g.fontStyle=d.style,g.fontColor=h,g.backColor=p,g.borderColor=s,g.horizontalAlignment="left","function"==typeof a.onBeforeEventExport&&a.onBeforeEventExport(g);var y=e.part.colStart*N+c.gridContent.x+2,m=e.part.colWidth*N-4,b=r.allDayEventHeight()-1,w=a.headerLevels*r.headerHeight()+t*r.allDayEventHeight()+2,D={"x":y,"y":w,"w":m,"h":b},k=DayPilot.Util.copyProps(D);k.x+=f.left,k.w-=f.left+f.right,k.y+=f.top,k.h-=f.top+f.bottom,o.fillRect(D,g.backColor),o.text(k,g.text,{"size":g.fontSize,"family":g.fontFamily,"style":g.fontStyle},g.fontColor,g.horizontalAlignment),o.rect(D,g.borderColor)})})}}(),o.rect(c.main,u),o.line(c.grid.x,0,c.grid.x,c.main.h,p),o.line(0,c.grid.y,c.main.w,c.grid.y,p),o}},l.fakeCell=function(){var e=document.createElement("div");e.style.display="none",e.className=a.q("_cell"),e.style.position="absolute",e.style.top="-2000px",e.style.left="-2000px";var t=document.createElement("div");return t.className=a.q("_cell_inner"),e.appendChild(t),a.nav.bottomRight.appendChild(e),e},l.fakeEvent=function(e){e=e||"event";var t=document.createElement("div");if(t.style.position="absolute",t.style.top="-2000px",t.style.left="-2000px",t.style.display="none",t.className=a.q("_"+e),"event"===e){var i=document.createElement("div");i.className=a.q("_event_bar");var n=document.createElement("div");n.className=a.q("_event_bar_inner"),i.appendChild(n),t.appendChild(i)}var o=document.createElement("div");o.className=a.q("_"+e+"_inner"),t.appendChild(o);var r=a.nav.events.rows[0].cells[0].events;return"alldayevent"===e&&(r=a.nav.allday),r.appendChild(t),t},l.getViewportOffsetTop=function(){switch(l.pd){case"full":return 0;case"viewport":return a.rb().scrollTop;case"range":throw"Not implemented"}},l.getWidth=function(){var e=l.pd;switch(e){case"full":case"viewport":var t=a.nav.top.clientWidth,i=t-a.hourWidth,n=a.va.length;return Math.floor(i/n)*n+a.hourWidth;default:throw"Unsupported export mode: "+e}},l.getHeight=function(){var e=l.pd;switch(e){case"full":return a.hc()+a.Ca();case"viewport":return a.nav.top.offsetHeight-DayPilot.sh(a.nav.scroll)-1;default:throw"Unsupported export mode: "+e}},l.getRectangles=function(){var e=l.getRowHeaderWidth(),t=a.Ca(),i={};i.main={"x":0,"y":0,"w":l.getWidth(),"h":l.getHeight()},i.corner={"x":0,"y":0,"w":e,"h":t},i.grid={"x":e,"y":t,"w":l.getWidth()-e,"h":l.getHeight()-t};var n=l.innerWidth(),o=a.hc();return i.gridContent={"x":e,"y":t,"w":n,"h":o},i},l.getRowHeaderWidth=function(){return a.hourWidth},l.innerWidth=function(){var e=a.rb().offsetWidth,t=a.va.length;return Math.floor(e/t)*t},this.qd=function(){return!!this.backendUrl&&("undefined"==typeof a.events.list||!a.events.list)},this.rd=function(){if(this.id&&this.id.tagName)this.nav.top=this.id;else{if("string"!=typeof this.id)throw"DayPilot.Calendar() constructor requires the target element or its ID as a parameter";if(this.nav.top=document.getElementById(this.id),!this.nav.top)throw"DayPilot.Calendar: The placeholder element not found: '"+t+"'."}},this.sd=function(){this.rd(),this.hd(),this._(),this.$b(),this.da(),this.ea(),this.ha(),this.ka(),this.Ac(),this.Wc(),this.Q(),this.la(),e.register(this),this.P(),this.ma(),this.Tc(),this.ra(),this.G("Init")},this.init=function(){if(this.rd(),!this.nav.top.dp){var t=this.qd();if(a.cssOnly||(a.cssOnly=!0,DayPilot.Util.log("DayPilot: cssOnly = false mode is not supported since DayPilot Pro 8.0.")),t)return this.sd(),void(this.A=!0);this.hd(),this._(),this.aa(),this.events.list||(this.events.list=[]),this.ba(),this.$b(),this.da(),this.ea(),this.ha(),this.na(),this.la(),this.ka(),this.Ac(),this.Wc(),this.Q(),e.register(this),this.ca(),this.oa(),this.pa(),this.P(),this.messageHTML&&this.message(this.messageHTML),this.ma(),this.Y(null,!1),this.Tc(),this.ra(),this.A=!0,this.td()}},this.ud=null,this.vd=function(e){var t={"events":{"preInit":function(){var e=this.data;e&&(DayPilot.isArray(e.list)?a.events.list=e.list:a.events.list=e)}},"scrollToHour":{"postInit":function(){"undefined"!=typeof this.data&&a.scrollToHour(this.data)}}};this.ud=t;for(var i in e)if(t[i]){var n=t[i];n.data=e[i],n.preInit&&n.preInit()}else a[i]=e[i]},this.td=function(){var e=this.ud;for(var t in e){var i=e[t];i.postInit&&i.postInit()}},this.internal={},this.internal.initialized=function(){return a.A},this.internal.invokeEvent=this.Qa,this.internal.eventMenuClick=this.$a,this.internal.timeRangeMenuClick=this._a,this.internal.bubbleCallBack=this.Ya,this.internal.findEventDiv=this.fd,this.internal.eventDeleteDispatch=this.Pa,this.internal.touch=this.Vb,this.Init=this.init,this.vd(i)};var e={};e.topSelectedCell=null,e.bottomSelectedCell=null,e.selecting=null,e.column=null,e.firstSelected=null,e.firstMousePos=null,e.originalMouse=null,e.originalHeight=null,e.originalTop=null,e.globalHandlers=!1,e.editing=!1,e.originalText=null,e.register=function(t){e.registered||(e.registered=[]);for(var i=e.registered,n=0;n","compile":function(t,i){return t.replaceWith(this["template"].replace("{{id}}",i["id"])),function(t,i,n){var a=new DayPilot.Calendar(i[0]);a.Qc.scope=t,a.init();var o=n["id"];o&&(t[o]=a);var r=n["publishAs"];if(r){(0,e(r).assign)(t,a)}for(var l in n)if(0===l.indexOf("on")){var s=DayPilot.Util.shouldApply(l);s?!function(i){a[i]=function(a){var o=e(n[i]);t["$apply"](function(){o(t,{"args":a})})}}(l):!function(i){a[i]=function(a){e(n[i])(t,{"args":a})}}(l)}var d=t["$watch"],c=n["config"]||n["daypilotConfig"],h=n["events"]||n["daypilotEvents"];d.call(t,c,function(e,t){for(var i in e)a[i]=e[i];a.update()},!0),d.call(t,h,function(e){a.events.list=e,a.gd({"eventsOnly":!0})},!0)}}}}])}(),"undefined"!=typeof Sys&&Sys.Application&&Sys.Application.notifyScriptLoaded&&Sys.Application.notifyScriptLoaded()}}(),"undefined"==typeof DayPilot)var DayPilot={};if("undefined"==typeof DayPilot.Global&&(DayPilot.Global={}),function(){"undefined"==typeof DayPilot.DatePicker&&(DayPilot.DatePicker=function(e){this.v="3027";var t="navigator_"+(new Date).getTime(),i=this;this.onShow=null,this.onTimeRangeSelect=null,this.onTimeRangeSelected=null,this.prepare=function(){if(this.locale="en-us",this.target=null,this.resetTarget=!0,this.pattern=this.vc.locale().datePattern,this.theme=null,this.patterns=[],e)for(var t in e)this[t]=e[t];this.init()},this.init=function(){this.date=new DayPilot.Date(this.date);var e=this.xd();this.resetTarget&&!e&&this.yd(this.date);var t=this.zd();t&&DayPilot.re(t,"input",function(){i.date=i.xd()}),DayPilot.re(document,"mousedown",function(){i.close()})},this.close=function(){this.Sc&&(this.navigator&&this.navigator.dispose(),this.div.innerHTML="",this.div&&this.div.parentNode===document.body&&document.body.removeChild(this.div))},this.setDate=function(e){this.date=new DayPilot.Date(e),this.yd(this.date)},this.xd=function(){var e=this.zd();if(!e)return this.date;var t=null;if(t="INPUT"===e.tagName?e.value:e.innerText,!t)return null;for(var n=DayPilot.Date.parse(t,i.pattern),a=0;ao)&&(o=t.getTime())}i&&o?(e=new DayPilot.Date(i).getDatePart(),t=new DayPilot.Date(o).getDatePart().addDays(1),a.startDate=n.startDate||e,a.days=n.days||DayPilot.DateUtil.daysDiff(e,t)):(a.startDate=e,a.days=30)}},this.commandCallBack=function(e,t){l.translate(),a.commandCallBack(e,t)},this.message=function(e,t,i,n){a.message(e,t,i,n)},this.setHeight=function(e){a.setHeight(e)},this.qd=function(){return!!this.backendUrl&&(!DayPilot.isArray(n.tasks.list)||0==n.tasks.list.length)},this.init=function(){l.translate(),l.Cd(),l.Dd(),this.Fd(),a.init(),this.A=!0,this.td()},this.Gd=!1,this.dispose=function(){a.dispose(),n.Gd=!0},this.update=function(){if(n.Gd)throw new DayPilot.Error("This DayPilot.Gantt instance has been disposed.");l.translate(),l.Cd(),l.Dd(),n.Fd(),a.update()},this.scrollTo=function(e){a.scrollTo(e)},this.scrollToTask=function(e){a.scrollToResource(e)},this.Hd={};var r=this.Hd;r.cache={},r.clearCache=function(){r.cache={}},r.addToCache=function(e,t){var i=e.id;if(i){var n={};if(n.isTaskWrapper=!0,n.data=e,n.parent=t,r.cache[i])throw"Duplicate task id detected";r.cache[i]=n}},r.findInCache=function(e){return e?r.cache[e.toString()]:null},r.getProperty=function(e,t){return e.tags&&e.tags[t]?e.tags[t]:e[t]},r.findParentArray=function(e){return r.findInArray(n.tasks.list,e)},r.findInArray=function(e,t){if(DayPilot.indexOf(e,t)!==-1)return e;for(var i=0;i0){var a=r.findInArray(n.children,t);if(a)return a}}return null},this.Id={};var l=this.Id;l.translate=function(){if(a.internal.gantt=n,a.durationBarMode="PercentComplete",a.timeRangeSelectedHandling="Disabled",a.treeEnabled=!0,a.rowCreateHtml="",a.autoRefreshCommand=n.autoRefreshCommand,a.autoRefreshEnabled=n.autoRefreshEnabled,a.autoRefreshInterval=n.autoRefreshInterval,a.autoRefreshMaxCount=n.autoRefreshMaxCount,a.autoScroll=n.autoScroll,a.backendUrl=n.backendUrl,a.crosshairColor=n.crosshairColor,a.crosshairOpacity=n.crosshairOpacity,a.crosshairType=n.crosshairType,a.doubleClickTimeout=n.doubleClickTimeout,a.durationBarVisible=n.completeBarVisible,a.durationBarHeight=n.completeBarHeight,a.dynamicEventRendering=n.progressiveTaskRendering?"Progressive":"Disabled",a.dynamicEventRenderingMargin=n.progressiveTaskRenderingMargin,a.dynamicEventRenderingCacheSweeping=n.progressiveTaskRenderingCacheSweeping,a.dynamicEventRenderingCacheSize=n.progressiveTaskRenderingCacheSize,a.startDate=new DayPilot.Date(n.startDate),a.days=n.days,a.cellDuration=n.cellDuration,a.cellGroupBy=n.cellGroupBy,a.cellWidth=n.cellWidth,a.cellWidthSpec=n.cellWidthSpec,a.cornerHtml=n.cornerHtml,a.eventHeight=n.taskHeight,a.eventResizeMargin=n.taskResizeMargin,a.floatingEvents=n.floatingTasks,a.floatingTimeHeaders=n.floatingTimeHeaders,a.headerHeight=n.headerHeight,a.heightSpec=n.heightSpec,a.height=n.height,a.linkBottomMargin=n.linkBottomMargin,a.linkPointSize=n.linkPointSize,a.loadingLabelVisible=n.loadingLabelVisible,a.loadingLabelText=n.loadingLabelText,a.locale=n.locale,a.messageBarPosition=n.messageBarPosition,a.messageHideAfter=n.messageHideAfter,a.rowCreateHandling=n.rowCreateHandling,a.progressiveRowRendering=n.progressiveRowRendering,a.progressiveRowRenderingPreload=n.progressiveRowRenderingPreload,a.scale=n.scale,a.scrollDelayEvents=n.scrollDelayTasks,a.scrollDelayCells=n.scrollDelayCells,a.scrollDelayFloats=n.scrollDelayFloats,a.scrollX=n.scrollX,a.scrollY=n.scrollY,n.scrollToTaskId&&(a.scrollToResourceId=n.scrollToTaskId),a.separators=n.separators,a.tapAndHoldTimeout=n.tapAndHoldTimeout,a.eventHtmlLeftMargin=n.taskHtmlLeftMargin,a.eventHtmlRightMargin=n.taskHtmlRightMargin,a.eventMovingStartEndEnabled=n.taskMovingStartEndEnabled,a.eventMovingStartEndFormat=n.taskMovingStartEndFormat,a.eventResizingStartEndEnabled=n.taskResizingStartEndEnabled,a.eventResizingStartEndFormat=n.taskResizingStartEndFormat,a.hideUntilInit=n.hideUntilInit,a.treeIndent=n.treeIndent,a.treeAutoExpand=n.treeAutoExpand,a.treeImageMarginLeft=n.treeImageMarginLeft,a.treeImageMarginTop=n.treeImageMarginTop,a.timeHeaders=n.timeHeaders,a.rowHeaderHideIconEnabled=n.rowHeaderHideIconEnabled,a.rowHeaderScrolling=n.rowHeaderScrolling,a.rowHeaderSplitterWidth=n.rowHeaderSplitterWidth,a.rowHeaderWidth=n.rowHeaderWidth,a.rowHeaderWidthAutoFit=n.rowHeaderWidthAutoFit,a.rowMarginBottom=n.rowMarginBottom,a.rowMinHeight=n.rowMinHeight,a.selectedRows=n.selectedRows,a.theme=n.theme,a.useEventBoxes=n.useEventBoxes,a.snapToGrid=n.snapToGrid,a.uniqueID=n.uniqueID,a.bubble=n.bubbleTask,a.cellBubble=n.bubbleCell,a.resourceBubble=n.bubbleRow,a.contextMenu=n.contextMenuTask,a.contextMenuResource=n.contextMenuRow,a.contextMenuLink=n.contextMenuLink,a.syncResourceTree=n.syncTasks,a.syncLinks=n.syncLinks,a.timeline=n.timeline,a.visible=n.visible,a.eventMoveHandling=n.taskMoveHandling,a.eventClickHandling=n.taskClickHandling,a.eventResizeHandling=n.taskResizeHandling,a.linkCreateHandling=n.linkCreateHandling,a.eventRightClickHandling=n.taskRightClickHandling,a.eventDoubleClickHandling=n.taskDoubleClickHandling,a.rowMoveHandling=n.rowMoveHandling,a.rowClickHandling=n.rowClickHandling,a.rowDoubleClickHandling=n.rowDoubleClickHandling,a.rowEditHandling=n.rowEditHandling,a.rowSelectHandling=n.rowSelectHandling,a.eventVersionsEnabled=n.taskVersionsEnabled,a.eventVersionHeight=n.taskVersionHeight,a.eventVersionMargin=n.taskVersionMargin,a.eventVersionPosition=n.taskVersionPosition,DayPilot.isArray(n.columns)){a.rowHeaderColumns=[];for(var e=0;ei.getTime())&&(i=a.end)}return{"start":t,"end":i}},this.rows={},this.rows.expand=function(e){a.rows.expand(e)},this.rows.expandAll=function(){a.rows.expandAll()},this.rows.selection={},this.rows.selection.add=function(e){a.rows.find(e.data.id)},this.rows.selection.clear=function(){a.rows.selection.clear()},this.rows.selection.get=function(){return a.rows.selection.get().map(function(e){return new DayPilot.Task(e.$.row.task,n)})},this.ud=null,this.vd=function(e){var t={"tasks":{"preInit":function(){var e=this.data;e&&(DayPilot.isArray(e.list)?n.tasks.list=e.list:n.tasks.list=e)}},"links":{"preInit":function(){var e=this.data;e&&(DayPilot.isArray(e.list)?n.links.list=e.list:n.links.list=e)}},"scrollTo":{"postInit":function(){this.data&&n.scrollTo(this.data)}},"scrollToTask":{"postInit":function(){this.data&&n.scrollToTask(this.data)}}};this.ud=t;for(var i in e)if(t[i]){var a=t[i];a.data=e[i],a.preInit&&a.preInit()}else n[i]=e[i]},this.td=function(){var e=this.ud;for(var t in e){var i=e[t];i.postInit&&i.postInit()}},this.internal={},this.internal.initialized=function(){return n.A},this.internal.rowObjectForTaskData=l.Md,this.internal.loadOptions=n.vd,this.Qc={},this.Qc.scope=null,this.Qc.notify=function(){n.Qc.scope&&n.Qc.scope["$apply"]()},this.vd(i)},"undefined"!=typeof jQuery&&!function(e){e.fn.daypilotGantt=function(e){var t=null,i=this.each(function(){if(!this.daypilot){var i=new DayPilot.Gantt(this.id,e);i.init(),this.daypilot=i,t||(t=i)}});return 1===this.length?t:i}}(jQuery),function(){var e=DayPilot.am();e&&e.directive("daypilotGantt",["$parse",function(e){return{"restrict":"E","template":"
","compile":function(t,i){return t.replaceWith(this["template"].replace("{{id}}",i["id"])),function(t,i,n){var a=new DayPilot.Gantt(i[0]);a.Qc.scope=t,a.init();var o=n["id"];o&&(t[o]=a);var r=n["publishAs"];if(r){(0,e(r).assign)(t,a)}for(var l in n)if(0===l.indexOf("on")){var s=DayPilot.Util.shouldApply(l);s?!function(i){a[i]=function(a){var o=e(n[i]);t["$apply"](function(){o(t,{"args":a})})}}(l):!function(i){a[i]=function(a){e(n[i])(t,{"args":a})}}(l)}var d=t["$watch"],c=n["config"]||n["daypilotConfig"];d.call(t,c,function(e,t){a.vd(e),a.update()},!0)}}}}])}(),"undefined"!=typeof Sys&&Sys.Application&&Sys.Application.notifyScriptLoaded&&Sys.Application.notifyScriptLoaded()}}(),"undefined"==typeof DayPilot)var DayPilot={};if("undefined"==typeof DayPilot.Global&&(DayPilot.Global={}),function(){if("undefined"==typeof DayPilot.Kanban){var e=function(){};DayPilot.Kanban=function(t,i){this.v="3027";var n=this;this.barWidth=5,this.cardAutoHeight=!0,this.cardHeight=60,this.cardMarginLeft=5,this.cardMarginRight=5,this.cardMarginBottom=5,this.columnHeaderHeight=20,this.crosshairColor="gray",this.height=300,this.heightSpec="Auto",this.theme="kanban_default",this.cellMarginBottom=4,this.cellMarginTop=5,this.columnWidthSpec="Auto",this.columnWidth=200,this.rowMinHeight=0,this.swimlaneCollapsingEnabled=!1,this.swimlaneHeaderWidth=80,this.visible=!0,this.swimlanes={},this.swimlanes.list=[],this.columns={},this.columns.list=[],this.cards={},this.cards.list=[],this.cardDeleteHandling="Disabled",this.cardMoveHandling="Update",this.columnMoveHandling="Disabled",this.swimlaneMoveHandling="Disabled",this.onBeforeCellRender=null,this.onCardClick=null,this.onCardClicked=null,this.onCardDelete=null,this.onCardDeleted=null,this.onCardMove=null,this.onCardMoved=null,this.onColumnMove=null,this.onColumnMoved=null,this.onHeightChanged=null,this.onSwimlaneMove=null,this.onSwimlaneMoved=null;var a=new DayPilot.Scheduler(t);this.scheduler=a;var o={},r=15;e(),o.translate=function(){var e=a;e.startDate="2000-01-01",e.scale="Day",e.timeHeaders=[{groupBy:"Cell",format:"d"}],e.heightSpec=n.heightSpec,e.cellWidthSpec=n.columnWidthSpec,e.cellWidth=n.columnWidth,e.cellsMarkBusiness=!1,e.crosshairColor=n.crosshairColor,e.dynamicEventRendering="Disabled",e.floatingEvents=!1,e.floatingTimeHeaders=!1,e.rowMinHeight=n.rowMinHeight,e.rowMarginTop=n.cellMarginTop,e.rowMarginBottom=n.cellMarginBottom,e.eventMoveToPosition=!0,e.headerHeight=n.columnHeaderHeight,e.eventResizeHandling="Disabled",e.timeRangeSelectedHandling="Disabled",e.eventHeight=n.cardHeight,e.eventMarginLeft=n.cardMarginLeft,e.eventMarginRight=n.cardMarginRight,e.eventMarginBottom=n.cardMarginBottom,e.eventTextWrappingEnabled=!0,e.cellStacking=!0,e.cellStackingAutoHeight=n.cardAutoHeight,e.durationBarVisible=!1,e.theme=n.theme,e.visible=n.visible,e.rowHeaderWidth=n.swimlaneHeaderWidth,e.eventDeleteHandling=n.cardDeleteHandling,e.eventMoveHandling=n.cardMoveHandling,e.rowMoveHandling=DayPilot.list(n.swimlanes.list).isEmpty()?"Disabled":n.swimlaneMoveHandling,e.onHeightChanged=n.onHeightChanged,e.internal.cssNames.timeheadercol="_colheadercell",e.internal.cssNames.timeheadercolInner="_colheadercell_inner",e.internal.cssNames.resourcedivider="_rowheaderdivider",e.internal.cssNames.event="_card",e.internal.cssNames.eventInner="_card_inner",e.internal.cssNames.eventDelete="_card_delete",e.internal.cssNames.eventMovingSource="_card_moving_source",n.swimlaneCollapsingEnabled&&(e.rowHeaderWidthMarginRight=15),e.onBeforeTimeHeaderRender=function(e){var t=n.Qd(e.header.start);if(e.header.html=t.name,e.header.toolTip=t.toolTip||"",e.header.areas=DayPilot.list(t.areas).map(function(e){var t=[];return DayPilot.Util.copyProps(e,t),t}),DayPilot.list(e.header.areas).each(function(e){e.target=new DayPilot.Column(t,n)}),"Disabled"!==n.columnMoveHandling){var i=n.theme+"_columnmove_handle";e.header.areas.push({"left":0,"top":0,"width":20,"height":20,"css":i,"mousedown":n.Rd,"action":"None"})}},e.onBeforeCellRender=function(t){var i={};i.cell={},i.cell.column=new DayPilot.Column(n.Qd(t.cell.start),n),i.cell.swimlane=null;var a=n.Sd(t.cell.resource);a&&(i.cell.swimlane=new DayPilot.Swimlane(a,n)),i.cell.areas=[],i.cell.cssClass=null,i.cell.html=null,i.cell.backImage=null,i.cell.backRepeat=null,i.cell.backColor=null,"function"==typeof n.onBeforeCellRender&&(n.onBeforeCellRender(i),DayPilot.Util.copyProps(i.cell,t.cell,["areas","cssClass","html","backImage","backRepeat","backColor"]),DayPilot.list(t.cell.areas).each(function(e){e.target={"swimlane":i.cell.swimlane,"column":i.cell.column}}));var o=e.rows.find(t.cell.resource);e.resources[o.index].collapsed&&(t.cell.cssClass||(t.cell.cssClass=""),t.cell.cssClass+=" "+n.theme+"_collapsed")},e.onEventClick=function(e){var t=new DayPilot.Args(e);t.card=new DayPilot.Card(e.e.data.card,n),"function"==typeof n.onCardClick&&n.onCardClick(t),e.wrapped=t},e.onEventClicked=function(e){var t=e.wrapped;"function"==typeof n.onCardClicked&&n.onCardClicked(t)},e.onEventDelete=function(e){var t=new DayPilot.Args(e);t.card=new DayPilot.Card(e.e.data.card,n),"function"==typeof n.onCardDelete&&n.onCardDelete(t),e.wrapped=t},e.onEventDeleted=function(e){DayPilot.rfa(n.cards.list,e.e.data.card);var t=e.wrapped;"function"==typeof n.onCardDeleted&&n.onCardDeleted(t)},e.onEventMove=function(e){var t=new DayPilot.Args(e);t.card=new DayPilot.Card(e.e.data.card,n),t.column=new DayPilot.Column(n.Qd(e.newStart)),t.position=e.position,"*"!==e.newResource?t.swimlane=new DayPilot.Swimlane(n.Sd(e.newResource),n):t.swimlane=null;for(var i=a.cells.find(e.newStart,e.newResource)[0].events(),r=e.position,l=null,s=r-1;i[s];){if(i[s].data!==e.e.data){l=new DayPilot.Card(i[s]);break}s-=1}for(var d=null,c=r;i[c];){if(i[c].data!==e.e.data){d=new DayPilot.Card(i[c]);break}c+=1}if(t.previous=l,t.next=d,"function"==typeof n.onCardMove&&n.onCardMove(t),e.wrapped=t,!e.preventDefault.value){var h=0;d?h=d.wrapped.data.sort[0]:l&&(h=l.wrapped.data.sort[0]),e.e.data.sort=[h,(new DayPilot.Date).toString()],DayPilot.rfa(n.cards.list,e.e.data.card);var u=0;d?u=DayPilot.indexOf(n.cards.list,d.data):l&&(u=DayPilot.indexOf(n.cards.list,l.data)+1),n.cards.list.splice(u,0,e.e.data.card),o.updateSort()}},e.onEventMoved=function(e){var t=e.wrapped,i=DayPilot.list(n.cards.list).find(function(t){return e.e.data.card===t});i.swimlane=t.swimlane?t.swimlane.data.id:null,i.column=t.column.data.id,"function"==typeof n.onCardMoved&&n.onCardMoved(t)},e.onBeforeResHeaderRender=function(e){if(n.swimlaneCollapsingEnabled&&!DayPilot.list(n.swimlanes.list).isEmpty()){var t=n.theme+"_swimlane_collapse";e.resource.collapsed&&(t=n.theme+"_swimlane_expand"),e.resource.areas=[{"right":0,"top":0,"height":15,"width":r,"action":"JavaScript","css":t,"js":function(){n.Td(e.resource.index)}}]}},e.onRowMove=function(e){var t=new DayPilot.Args(e);e.wrapped=t,t.swimlane=new DayPilot.Swimlane(e.source.$.row.swimlane);var i=0;switch(e.position){case"before":i=e.target.index;break;case"after":i=e.target.index+1;break;default:throw"Unexpected target swimlane position: "+e.position}t.position=i,t.previous=null;for(var o=i-1;a.rowlist[o]&&a.rowlist[o].swimlane!==t.swimlane.data;)t.previous=new DayPilot.Swimlane(a.rowlist[o].swimlane),o-=1;t.next=null;for(var r=i;a.rowlist[r]&&a.rowlist[r].swimlane!==t.swimlane.data;)t.next=new DayPilot.Swimlane(a.rowlist[r].swimlane),r+=1;"function"==typeof n.onSwimlaneMove&&n.onSwimlaneMove(t)},e.onRowMoved=function(e){var t=e.wrapped;DayPilot.rfa(n.swimlanes.list,t.swimlane.data);var i=0;t.next?i=DayPilot.indexOf(n.swimlanes.list,t.next.data):t.previous&&(i=DayPilot.indexOf(n.swimlanes.list,t.previous.data)+1),n.swimlanes.list.splice(i,0,t.swimlane.data),"function"==typeof n.onSwimlaneMoved&&n.onSwimlaneMoved(t)},e.treePreventParentUsage=!0},o.loadCards=function(){var e=new DayPilot.Date("2000-01-01"),t=n.theme+"_card_header",i=n.theme+"_card_body",o=(new DayPilot.Date).toString();a.sortDirections=["asc","desc"],a.events.list=DayPilot.list(n.cards.list).map(function(a,r){var l=a.html||a.text||"",s=a.name||"",d={};return d.id=a.id,d.text=a.text,d.html="
"+s+"
"+l+"
",d.resource=a.swimlane,d.start=e.addDays(DayPilot.list(n.columns.list).findIndex(function(e){return a.column===e.id})),d.end=d.start.addDays(1),d.card=a,d.height=a.height,d.cssClass=a.cssClass,d.sort=[r,o],d.areas=DayPilot.list(a.areas).map(function(e){var t={};return DayPilot.Util.copyProps(e,t),e.js&&(t.js=function(t){e.js(new DayPilot.Card(t.data.card,n))}),t}),d.areas.push({"left":0,"width":5,"top":0,"bottom":0,"backColor":a.barColor,"cssClass":n.theme+"_card_bar"}),d})},o.updateSort=function(){var e=(new DayPilot.Date).toString();DayPilot.list(n.cards.list).each(function(t,i){var n=o.findSchedulerEventData(t);n&&(n.sort=[i,e])})},o.findSchedulerEventData=function(e){return DayPilot.list(a.events.list).find(function(t){return t.card===e})},o.loadSwimlanes=function(){var e=DayPilot.list(n.swimlanes.list);a.resources=e.map(function(e){var t={};return t.name=e.name,t.id=e.id,t.swimlane=e,e.collapsed&&(t.collapsed=!0,t.eventHeight=20,t.hideEvents=!0),t}),e.isEmpty()&&(a.resources=[{name:"",id:"*"}])},o.loadColumns=function(){var e=DayPilot.list(n.columns.list);a.days=e.length};var l={};l.active=null,l.div=null,l.update=function(){l.clear();var e=l.findPosition();l.draw(e)},l.clear=function(){DayPilot.de(l.div),l.div=null},l.draw=function(e){var t=0;if(e>=a.itline.length){var i=a.itline[a.itline.length-1];t=i.left+i.width-3}else t=a.itline[e].left;var o=document.createElement("div");o.style.position="absolute",o.style.left=t+"px",o.style.width="3px",o.style.top=0,o.style.height=a.headerHeight+"px",o.className=n.theme+"_columnmove_position",l.div=o,a.nav.timeHeader.appendChild(o)},l.findPosition=function(){if(n.coords.x<0)return 0;var e=DayPilot.list(a.itline).findIndex(function(e){var t=e.left+a.rowHeaderWidth,i=e.width;return n.coords.x0&&e.offsetHeight>0)},this.Tc=function(){var e=n,t=e.Sc;t()||e.Uc||(e.Uc=setInterval(function(){t()&&(e.update(),clearInterval(e.Uc))},100))},this.Vd=function(e){n.coords=DayPilot.mo3(a.nav.top,e),l.active&&l.update()},this.Ud=function(e){if(l.active){var t=l.active.source,i=l.findPosition(),a=n.Qd(t.start),o=new DayPilot.Args;o.column=new DayPilot.Column(a,n),o.position=i,o.previous=null,o.next=null;for(var r=null,s=o.position;0!==s&&!r;)a!==n.columns.list[s-1]&&(r=n.columns.list[s-1]),s-=1;r&&(o.previous=new DayPilot.Column(r,n));var d=null;for(s=o.position;s","compile":function(t,i){return t.replaceWith(this["template"].replace("{{id}}",i["id"])),function(t,i,n){var a=new DayPilot.Kanban(i[0]);a.Qc.scope=t,a.init();var o=n["id"];o&&(t[o]=a);var r=n["publishAs"];if(r){(0,e(r).assign)(t,a)}for(var l in n)if(0===l.indexOf("on")){var s=DayPilot.Util.shouldApply(l);s?!function(i){a[i]=function(a){var o=e(n[i]);t["$apply"](function(){o(t,{"args":a})})}}(l):!function(i){a[i]=function(a){e(n[i])(t,{"args":a})}}(l)}var d=t["$watch"],c=n["config"]||n["daypilotConfig"];d.call(t,c,function(e,t){a.vd(e),a.update()},!0)}}}}])}()}}(),"undefined"==typeof DayPilot)var DayPilot={};if("undefined"==typeof DayPilot.Global&&(DayPilot.Global={}),function(){if("undefined"==typeof DayPilot.Menu){var e=function(){},t={};t.mouse=null,t.menu=null,t.handlersRegistered=!1,t.hideTimeout=null,t.waitingSubmenu=null,DayPilot.Menu=function(i){var n=this,a=null;this.v="3027",this.zIndex=10,this.cssClassPrefix="menu_default",this.cssOnly=!0,this.menuTitle=null,this.showMenuTitle=!1,this.hideOnMouseOut=!1,this.theme=null,this.onShow=null,this.n=function(){},i&&DayPilot.isArray(i)&&(this.items=i),this.show=function(i,o){var o=o||{},r=null;if(i?"string"==typeof i.id||"number"==typeof i.id?r=i.id:"function"==typeof i.id?r=i.id():"function"==typeof i.value&&(r=i.value()):r=null,"undefined"!=typeof DayPilot.Bubble&&DayPilot.Bubble.hideActive(),o.submenu||t.menuClean(),this.n.submenu=null,null!==t.mouse){n.cssOnly||(n.cssOnly=!0,DayPilot.Util.log("DayPilot: cssOnly = false mode is not supported since DayPilot Pro 8.0."));var l=null;if(i&&i.isRow&&i.$.row.task?(l=new DayPilot.Task(i.$.row.task,i.calendar),l.menuType="resource"):l=i&&i.isEvent&&i.data.task?new DayPilot.Task(i,i.calendar):i,"function"==typeof n.onShow){var s={};if(s.source=l,s.menu=n,s.preventDefault=function(){s.preventDefault.value=!0},n.onShow(s),s.preventDefault.value)return}var d=document.createElement("div");if(d.style.position="absolute",d.style.top="0px",d.style.left="0px",d.style.display="none",d.style.overflow="hidden",d.style.zIndex=this.zIndex+1,d.className=this.applyCssClass("main"),d.onclick=function(e){e.cancelBubble=!0,this.parentNode.removeChild(this)},this.hideOnMouseOut&&(d.onmousemove=function(e){clearTimeout(t.hideTimeout)},d.onmouseout=function(e){n.delayedHide()}),!this.items||0===this.items.length)throw"No menu items defined.";if(this.showMenuTitle){var c=document.createElement("div");c.innerHTML=this.menuTitle,c.className=this.applyCssClass("title"),d.appendChild(c)}for(var h=0;hS-C&&0!==S){var n=i-document.body.scrollTop-(S-C)+T;d.style.top=i-n+"px"}else d.style.top=i+"px";if("right"===o.align&&(e-=P),e-document.body.scrollLeft>A-P&&0!==A){var a=e-document.body.scrollLeft-(A-P)+T;d.style.left=e-a+"px"}else d.style.left=e+"px"}(),o.parentLink){var E=o.parentLink,M=parseInt(new DayPilot.StyleReader(d).get("border-top-width")),H=DayPilot.abs(o.parentLink.parentNode),_=H.x+E.offsetWidth,R=H.y-M;_+P>A&&(_=Math.max(0,H.x-P));var B=document.body.scrollTop+document.documentElement.scrollTop;R+C-B>S&&(R=Math.max(0,S-C+B)),d.style.left=_+"px",d.style.top=R+"px"}d.style.display="",this.addShadow(d),this.n.div=d,o.submenu||(DayPilot.Menu.active=this)}},this.applyCssClass=function(e){var t=this.theme||this.cssClassPrefix,i=this.cssOnly?"_":"";return t?t+i+e:""},this.cloneOptions=function(){for(var e={},t=["cssOnly","cssClassPrefix","useShadow","zIndex"],i=0;i0){var e=this.list.pop();e&&e.hide()}},DayPilot.ModalStatic.remove=function(e){for(var t=DayPilot.ModalStatic.list,i=0;i0&&(t[t.length-1].result=e)},DayPilot.ModalStatic.displayed=function(e){for(var t=DayPilot.ModalStatic.list,i=0;i0){var e=this.list[this.list.length-1];e&&e.stretch()}},DayPilot.ModalStatic.last=function(){var e=DayPilot.ModalStatic.list;return e.length>0?e[e.length-1]:null};var e=function(){var e=document.createElement("style");e.setAttribute("type","text/css"),e.styleSheet||e.appendChild(document.createTextNode("")),(document.head||document.getElementsByTagName("head")[0]).appendChild(e);var t=!!e.styleSheet,i={};return i.rules=[],i.commit=function(){try{t&&(e.styleSheet.cssText=this.rules.join("\n"))}catch(e){}},i.add=function(i,n,a){if(t)return void this.rules.push(i+"{"+n+"}");if(e.sheet.insertRule)"undefined"==typeof a&&(a=e.sheet.cssRules.length),e.sheet.insertRule(i+"{"+n+"}",a);else{if(!e.sheet.addRule)throw"No CSS registration method found";e.sheet.addRule(i,n,a)}},i},t=new e;t.add(".modal_default_main","border: 10px solid #ccc;"),t.add(".modal_default_inner","padding: 10px;"),t.add(".modal_default_input","padding: 10px 0px;"),t.add(".modal_default_buttons","padding: 10px 0px;"),t.add(".modal_default_background","opacity: 0.3; background-color: #000;"),t.add(".modal_min_main","border: 1px solid #ccc;"),t.add(".modal_min_background","opacity: 0.3; background-color: #000;"),t.commit(),DayPilot.Modal=function(e){this.autoStretch=!0,this.autoStretchFirstLoadOnly=!1,this.className=null,this.theme="modal_default",this.disposeOnClose=!0,this.dragDrop=!0,this.loadingHtml=null,this.maxHeight=null,this.scrollWithPage=!0,this.useIframe=!0,this.zIndex=99999,this.left=null,this.width=500,this.top=20,this.height=200,this.closed=null,this.onClosed=null,this.onShow=null;var t=this;this.id="_"+(new Date).getTime()+"n"+10*Math.random(),this._d=!1,this.ae=null,this.be=null,this.showHtml=function(e){if(DayPilot.ModalStatic.displayed(this))throw"This modal dialog is already displayed.";if(this.div||this.ce(),this.gd(),this.useIframe){var t=function(e,t){return function(){e.setInnerHTML(e.id+"iframe",t)}};window.setTimeout(t(this,e),0)}else e.nodeType?this.div.appendChild(e):this.div.innerHTML=e;this.gd(),this.ee(),this.fe()},this.ge=function(){return this.corners&&"rounded"===this.corners.toLowerCase()},this.showUrl=function(e){if(DayPilot.ModalStatic.displayed(this))throw"This modal dialog is already displayed.";if(this.useIframe){this.div||this.ce();var i=this.loadingHtml;i&&(this.iframe.src="about:blank",this.setInnerHTML(this.id+"iframe",i)),this.re(this.iframe,"load",this.je),this.iframe.src=e,this.gd(),this.ee(),this.fe()}else t.ke({"url":e,"success":function(e){var i=e.request.responseText;t.showHtml(i)},"error":function(e){t.showHtml("Error loading the modal dialog")}})},this.fe=function(){if("function"==typeof t.onShow){var e={};e.root=t.le(),t.onShow(e)}},this.le=function(){return t.iframe?t.iframe.contentWindow.document:t.div},this.ke=function(e){var t=new XMLHttpRequest;if(t){var i=e.method||"GET",n=e.success||function(){},a=e.error||function(){},o=e.data,r=e.url;t.open(i,r,!0),t.setRequestHeader("Content-type","text/plain"),t.onreadystatechange=function(){if(4===t.readyState)if(200===t.status||304===t.status){var e={};e.request=t,n(e)}else if(a){var e={};e.request=t,a(e)}else window.console&&console.log("HTTP error "+t.status)},4!==t.readyState&&("object"==typeof o&&(o=JSON.stringify(o)),t.send(o))}},this.gd=function(){var e=window,i=document,n=e.pageYOffset?e.pageYOffset:i.documentElement&&i.documentElement.scrollTop?i.documentElement.scrollTop:i.body.scrollTop;this.theme&&(this.hideDiv.className=this.theme+"_background"),this.zIndex&&(this.hideDiv.style.zIndex=this.zIndex),this.hideDiv.style.display="",window.setTimeout(function(){t.hideDiv.onclick=function(){t.hide({"backgroundClick":!0})}},500),this.theme?this.div.className=this.theme+"_main":this.div.className="",this.className&&(this.div.className+=" "+this.className),this.left?this.div.style.left=this.left+"px":this.div.style.marginLeft="-"+Math.floor(this.width/2)+"px",this.div.style.position="absolute",this.div.style.boxSizing="content-box",this.div.style.top=n+this.top+"px",this.div.style.width=this.width+"px",this.zIndex&&(this.div.style.zIndex=this.zIndex),this.height&&(this.useIframe||!this.autoStretch?this.div.style.height=this.height+"px":this.div.style.height=""),this.useIframe&&this.height&&(this.iframe.style.height=this.height+"px"),this.div.style.display="",DayPilot.ModalStatic.list.push(this)},this.je=function(){t.iframe.contentWindow.modal=t,t.autoStretch&&t.stretch()},this.stretch=function(){var e=function(){return t.me().y},i=function(){return t.me().x};if(this.useIframe){for(var n=i()-40,a=this.width;at.clientWidth},this.oe=function(){for(var e=this.iframe.contentWindow.document,t="BackCompat"===e.compatMode?e.body:e.documentElement,i=t.scrollHeight,n=e.body.children,a=0;at.clientHeight},this.me=function(){var e=document;if("CSS1Compat"===e.compatMode&&e.documentElement&&e.documentElement.clientWidth){var t=e.documentElement.clientWidth,i=e.documentElement.clientHeight;return{x:t,y:i}}var t=e.body.clientWidth,i=e.body.clientHeight;return{x:t,y:i}},this.ee=function(){this._d||(this.re(window,"resize",this.pe),this.re(window,"scroll",this.qe),this.dragDrop&&(this.re(document,"mousemove",this.se),this.re(document,"mouseup",this.te)),this._d=!0)},this.ve=function(e){e.target===t.div&&(t.div.style.cursor="move",t.we(),t.be=t.mc(e||window.event),t.ae={x:t.div.offsetLeft,y:t.div.offsetTop})},this.se=function(e){if(t.be){var e=e||window.event,i=t.mc(e),n=i.x-t.be.x,a=i.y-t.be.y;t.div.style.marginLeft="0px",t.div.style.top=t.ae.y+a+"px",t.div.style.left=t.ae.x+n+"px"}},this.te=function(e){t.be&&(t.xe(),t.div.style.cursor=null,t.be=null)},this.we=function(){if(this.useIframe){var e=document.createElement("div");e.style.backgroundColor="#ffffff",e.style.filter="alpha(opacity=80)",e.style.opacity="0.80",e.style.width="100%",e.style.height=this.height+"px",e.style.position="absolute",e.style.left="0px",e.style.top="0px",this.div.appendChild(e),this.mask=e}},this.xe=function(){this.useIframe&&(this.div.removeChild(this.mask),this.mask=null)},this.pe=function(){t.ye},this.qe=function(){t.ye},this.ye=function(){if(t.hideDiv&&t.div&&"none"!==t.hideDiv.style.display&&"none"!==t.div.style.display){var e=window.pageYOffset?window.pageYOffset:document.documentElement&&document.documentElement.scrollTop?document.documentElement.scrollTop:document.body.scrollTop;t.scrollWithPage||(t.div.style.top=e+t.top+"px")}},this.re=function(e,t,i){e.addEventListener?e.addEventListener(t,i,!1):e.attachEvent&&e.attachEvent("on"+t,i)},this.ue=function(e,t,i){e.removeEventListener?e.removeEventListener(t,i,!1):e.detachEvent&&e.detachEvent("on"+t,i)},this.mc=function(e){return e.pageX||e.pageY?{x:e.pageX,y:e.pageY}:{x:e.clientX+document.documentElement.scrollLeft,y:e.clientY+document.documentElement.scrollTop}},this.abs=function(e){for(var t={x:e.offsetLeft,y:e.offsetTop};e.offsetParent;)e=e.offsetParent,t.x+=e.offsetLeft,t.y+=e.offsetTop;return t},this.ce=function(){var e=document.createElement("div");e.id=this.id+"hide",e.style.position="fixed",e.style.left="0px",e.style.top="0px",e.style.right="0px",e.style.bottom="0px",e.oncontextmenu=function(){return!1},e.onmousedown=function(){return!1},document.body.appendChild(e);var t=document.createElement("div");t.id=this.id+"popup",t.style.position="fixed",t.style.left="50%",t.style.top="0px",t.style.backgroundColor="white",t.style.width="50px",t.style.height="50px",this.dragDrop&&(t.onmousedown=this.ve);var i=null;this.useIframe&&(i=document.createElement("iframe"),i.id=this.id+"iframe",i.name=this.id+"iframe",i.frameBorder="0",i.style.width="100%",i.style.height="50px",t.appendChild(i)),document.body.appendChild(t),this.div=t,this.iframe=i,this.hideDiv=e},this.setInnerHTML=function(e,i){var n=window.frames[e],a=n.contentWindow||n.document||n.contentDocument;a.document&&(a=a.document),null==a.body&&a.write(""),i.nodeType?a.body.appendChild(i):a.body.innerHTML=i,t.autoStretch&&(t.autoStretchFirstLoadOnly&&t.ze||(t.stretch(),t.ze=!0))},this.close=function(e){this.result=e,this.hide()},this.hide=function(e){e=e||{};var i={};i.backgroundClick=!!e.backgroundClick,i.result=this.result,i.preventDefault=function(){this.preventDefault.value=!0},"function"==typeof this.onClose&&(this.onClose(i),i.preventDefault.value)||(this.div&&(this.div.style.display="none",this.hideDiv.style.display="none",this.useIframe||(this.div.innerHTML=null)),window.focus(),DayPilot.ModalStatic.remove(this),"function"==typeof this.onClosed?this.onClosed(i):this.closed&&this.closed(),this.result=null,this.disposeOnClose&&(t.Ae(t.div),t.Ae(t.hideDiv),t.div=null,t.hideDiv=null,t.iframe=null))},this.Ae=function(e){e&&e.parentNode&&e.parentNode.removeChild(e)},this.Be=function(){if(e)for(var t in e)this[t]=e[t]},this.Be()},DayPilot.Modal.alert=function(e,t){t=t||{},t.height=t.height||40,t.useIframe=!1;var i=t.okText||"OK";t.cancelText||"Cancel";return DayPilot.getPromise(function(n,a){t.onClosed=function(e){n(e)};var o=new DayPilot.Modal(t),r=document.createElement("div");r.className=o.theme+"_inner";var l=document.createElement("div");l.className=o.theme+"_content",l.innerHTML=e;var s=document.createElement("div");s.className=o.theme+"_buttons";var d=document.createElement("button");d.innerText=i,d.className=o.theme+"_ok",d.onclick=function(e){DayPilot.ModalStatic.close("OK")},s.appendChild(d),r.appendChild(l),r.appendChild(s),o.showHtml(r),d.focus()})},DayPilot.Modal.confirm=function(e,t){t=t||{},t.height=t.height||40,t.useIframe=!1;var i=t.okText||"OK",n=t.cancelText||"Cancel";return DayPilot.getPromise(function(a,o){t.onClosed=function(e){a(e)};var r=new DayPilot.Modal(t),l=document.createElement("div");l.className=r.theme+"_inner";var s=document.createElement("div");s.className=r.theme+"_content",s.innerHTML=e;var d=document.createElement("div");d.className=r.theme+"_buttons";var c=document.createElement("button");c.innerText=i,c.className=r.theme+"_ok",c.onclick=function(e){DayPilot.ModalStatic.close("OK")};var h=document.createTextNode(" "),u=document.createElement("button");u.innerText=n,u.className=r.theme+"_cancel",u.onclick=function(e){DayPilot.ModalStatic.close()},d.appendChild(c),d.appendChild(h),d.appendChild(u),l.appendChild(s),l.appendChild(d),r.showHtml(l),c.focus()})},DayPilot.Modal.prompt=function(e,t,i){"object"==typeof t&&(i=t),i=i||{},i.height=i.height||40,i.useIframe=!1;var n=i.okText||"OK",a=i.cancelText||"Cancel",o=t||"";return DayPilot.getPromise(function(t,r){i.onClosed=function(e){t(e)};var l=new DayPilot.Modal(i),s=document.createElement("div");s.className=l.theme+"_inner";var d=document.createElement("div");d.className=l.theme+"_content",d.innerHTML=e;var c=document.createElement("div");c.className=l.theme+"_input";var h=document.createElement("input");h.value=o,h.style.width="100%",h.onkeydown=function(e){switch(e.keyCode){case 13:parent.DayPilot.ModalStatic.close(this.value);break;case 27:parent.DayPilot.ModalStatic.close()}},c.appendChild(h);var u=document.createElement("div");u.className=l.theme+"_buttons";var f=document.createElement("button");f.innerText=n,f.className=l.theme+"_ok",f.onclick=function(e){DayPilot.ModalStatic.close(h.value)};var v=document.createTextNode(" "),p=document.createElement("button");p.innerText=a,p.className=l.theme+"_cancel",p.onclick=function(e){DayPilot.ModalStatic.close()},u.appendChild(f),u.appendChild(v),u.appendChild(p),s.appendChild(d),s.appendChild(c),s.appendChild(u),l.showHtml(s),h.focus()})},DayPilot.Modal.close=function(e){if(!(parent&&parent.DayPilot&&parent.DayPilot.ModalStatic))throw"Unable to close DayPilot.Modal dialog.";parent.DayPilot.ModalStatic.close(e)},DayPilot.Modal.closeSerialized=function(){for(var e=DayPilot.Modal.opener()||DayPilot.ModalStatic.last(),t=e.le(),i=t.querySelectorAll("input, textarea, select"),n={},a=0;ao.getTime()))for(var r=0;rd.getTime()))for(var e=0;e=i.start.getTime()&&s.getTime()=7;)i--,d-=7;if(d>e){d>e+(7-this.Je())?(i--,e=e+7-d):(l=l-d+e,e=0)}else e-=d;i<0&&(i=0,e=0);var c=null;for(t.resizingEvent?c="w-resize":t.movingEvent&&(c="move"),this.nav.top.style.cursor=c;l>0&&i0&&(t=t.concat(r)),DayPilot.Areas.showAreas(e,e.event,null,t)}}(),a.Ve(i.event).each(function(e){DayPilot.Util.addClass(e,a.q("_event_hover"))});var r=6;if(!a.cellMode&&o.x<=r&&n.client.resizeEnabled()?n.part.startsHere?(i.style.cursor="w-resize",i.dpBorder="left"):i.style.cursor="not-allowed":!a.cellMode&&i.clientWidth-o.x<=r&&n.client.resizeEnabled()?n.part.endsHere?(i.style.cursor="e-resize",i.dpBorder="right"):i.style.cursor="not-allowed":i.style.cursor="default","undefined"!=typeof DayPilot.Bubble&&a.bubble&&"Disabled"!==a.eventHoverHandling)if(t.movingEvent||t.resizingEvent)DayPilot.Bubble.hideActive();else{var l=this.Yc&&o.x===this.Yc.x&&o.y===this.Yc.y;l||(this.Yc=o,a.bubble.showEvent(i.event))}}}},this.Tb=function(e){var t=this;"undefined"!=typeof DayPilot.Bubble&&a.bubble&&a.bubble.hideOnMouseOut(),t.style.cursor="",a.Ve(t.event).each(function(e){DayPilot.Util.removeClass(e,a.q("_event_hover"))}),DayPilot.Areas.hideAreas(t,e)},this.Ue=function(){var e=this;return a.La(e.event),!1},this.Ub=function(e){if(!o.start){"undefined"!=typeof DayPilot.Bubble&&(DayPilot.Bubble.hideActive(),DayPilot.Bubble.cancelShowing());var i=this,n=i.event,r=n.part.row,l=n.part.colStart,s=n.part.line,d=n.part.colWidth;e=e||window.event;var c=DayPilot.Util.mouseButton(e);if(e.cancelBubble=!0,e.stopPropagation&&e.stopPropagation(),c.left)if("undefined"!=typeof DayPilot.Bubble&&a.bubble&&DayPilot.Bubble.hideActive(),t.movingEvent=null,"w-resize"===this.style.cursor||"e-resize"===this.style.cursor){var h={};h.start={},h.start.x=l,h.start.y=r,h.event=i.event,h.width=DayPilot.DateUtil.daysSpan(h.event.start(),h.event.end())+1,h.direction=this.style.cursor,t.resizingEvent=h}else if("move"===this.style.cursor||n.client.moveEnabled()){a.Qe();var u=DayPilot.mo3(a.nav.events,e);if(!u)return;var f=a.We(u.x,u.y);if(!f)return;var v=DayPilot.DateUtil.daysDiff(n.start(),a.rows[r].start),p=7*f.y+f.x-(7*r+l);v&&(p+=v);var g={};g.start={},g.start.x=l,g.start.y=r,g.start.line=s,g.offset=a.eventMoveToPosition?0:p,g.colWidth=d,g.event=i.event,g.coords=u,t.movingEvent=g}}},this.temp={},this.temp.getPosition=function(){if(!a.coords)return null;var e=a.We(a.coords.x,a.coords.y);if(!e)return null;var t=new DayPilot.Date(a.Re(e.x,e.y)),e={};return e.start=t,e.end=t.addDays(1),e},this.Vb={};var o=a.Vb;o.active=!1,o.start=!1,o.timeouts=[],o.onEventTouchStart=function(e){if(!o.active&&!o.start){o.clearTimeouts(),o.start=!0,o.active=!1;var t=this;if(t.event.client.moveEnabled()){var i=a.tapAndHoldTimeout;o.timeouts.push(window.setTimeout(function(){o.active=!0,o.start=!1;var i=o.relativeCoords(e);o.startMoving(t,i),e.preventDefault()},i))}e.stopPropagation()}},o.onEventTouchMove=function(e){o.clearTimeouts(),o.start=!1},o.onEventTouchEnd=function(e){o.clearTimeouts(),o.start&&a.Ha(this,e),window.setTimeout(function(){o.start=!1,o.active=!1},500)},o.onMainTouchStart=function(e){if(!o.active&&!o.start){o.clearTimeouts(),o.start=!0,o.active=!1;var t=a.tapAndHoldTimeout;o.timeouts.push(window.setTimeout(function(){ o.active=!0,o.start=!1,e.preventDefault();var t=o.relativeCoords(e);o.startRange(t)},t))}},o.onMainTouchMove=function(e){if(o.clearTimeouts(),o.start=!1,o.active){e.preventDefault();var t=o.relativeCoords(e);if(o.moving)return void o.updateMoving(t);o.range&&o.updateRange(t)}},o.onMainTouchEnd=function(e){if(o.clearTimeouts(),o.active){if(o.moving){var t=(o.moving,o.moving.event),i=a.shadow.start,n=a.shadow.position,r=o.moving.offset;a.Qe(),o.moving=null,a.Va(t,i.x,i.y,r,e,n)}if(o.range){var l=o.range,i=new DayPilot.Date(a.Re(l.from.x,l.from.y)),s=i.addDays(l.width);o.range=null,a.ab(i,s)}}window.setTimeout(function(){o.start=!1,o.active=!1},500)},o.clearTimeouts=function(){for(var e=0;e=this.end.getTime())},s.getPartStart=function(e){return DayPilot.DateUtil.max(this.start,e.start())},s.getPartEnd=function(e){return DayPilot.DateUtil.min(this.end,e.rawend())},s.getStartColumn=function(e){var t=this.getPartStart(e);return DayPilot.DateUtil.daysDiff(this.start,t)},s.getWidth=function(e){return DayPilot.DateUtil.daysSpan(this.getPartStart(e),this.getPartEnd(e))+1},s.putIntoLine=function(e,t,i,n){for(var a=this,o=0;oa.part.colStart+a.part.colWidth-1||(i=!1)}return i},r.addEvent=function(e,t,i,n,o){e.part.colStart=t,e.part.colWidth=i,e.part.row=n,e.part.line=o,e.part.startsHere=a.start.getTime()<=e.start().getTime(),e.part.endsHere=a.end.getTime()>=e.end().getTime(),this.push(e)},r.addEvent(e,t,i,n,this.lines.length),this.lines.push(r),this.lines.length-1},s.getStart=function(){for(var e=0,t=0;t=7;)i.y++,t-=7;return i.x=t,i},this.bf=function(){var e=DayPilot.sw(this.nav.scrollable);this.nav.header.style.marginRight=e+"px"};var r=null;this.Fe=function(){var e=this.nav.header,t=this.nav.events;this.cells=[];for(var i=0;i6&&(o-=7),!n){var n={};n.html=l.locale().dayNames[o]}if("function"==typeof a.onBeforeHeaderRender){var s={};s.header={},s.header.dayOfWeek=o;var d=["html","backColor","cssClass"];DayPilot.Util.copyProps(n,s.header,d),a.onBeforeHeaderRender(s),DayPilot.Util.copyProps(s.header,n,d)}var c=document.createElement("div");c.setAttribute("unselectable","on"),c.style.position="absolute",c.style.left=this.Pe()*i+"%",c.style.width=this.Pe()+"%",c.style.top="0px",c.style.height=l.headerHeight()+"px",function(e){c.onclick=function(){a.Ma(e)}}(o);var h=document.createElement("div");h.setAttribute("unselectable","on"),h.className=this.q("_header_inner"),h.innerHTML=n.html,c.appendChild(h),c.className=this.q("_header"),n&&(n.cssClass&&DayPilot.Util.addClass(c,n.cssClass),n.backColor&&(h.style.background=n.backColor)),e.appendChild(c);for(var u=0;us-l)return}"Disabled"!==a.timeRangeSelectedHandling&&(a.Qe(),t.timeRangeSelecting={"root":a,"x":n,"y":o,"from":{x:n,y:o},"width":1})},this.Je=function(){return this.showWeekend?7:5},this.Pe=function(){return this.showWeekend?14.285:20},this.hf=function(e){return 6===e.getUTCDay()||0===e.getUTCDay()?this.nonBusinessBackColor:this.backColor},this.Ne=function(e){for(var t=0,i=0;i6&&(i-=7),!t){var t={};t.html=l.locale().dayNames[i]}var n=0,r=b,s=l.headerHeight(),d=t.html,c={"x":w,"y":n,"w":r+1,"h":s+1},h=DayPilot.Util.copyProps(c);o.fillRect(c,v),o.rect(c,u),o.text(h,d,p,g,"center"),w+=r});var D=c.grid.y;return DayPilot.list(a.rows).each(function(e,t){var i=e.getHeight(),n=0;DayPilot.list.for(a.Je()).each(function(e){var r=a.cells[e][t],l=r.props,s=b,d=new DayPilot.StyleReader(a.cells[e][t].firstChild).get("background-color"),c=a.cells[e][t].firstChild.firstChild,h=new DayPilot.StyleReader(c).getFont(),u=new DayPilot.StyleReader(c).get("color"),f=new DayPilot.StyleReader(c).get("background-color"),v=a.firstDate.addDays(7*t+e),p={};p.cell={},p.cell.start=v,p.cell.end=v.addDays(1),p.backColor=d,p.text=l.headerHtml,p.horizontalAlignment="right","function"==typeof a.onBeforeCellExport&&a.onBeforeCellExport(p);var g={"x":n,"y":D,"w":s+1,"h":i+1};o.fillRect(g,p.backColor),o.rect(g,m);var y={"x":n,"y":D,"w":s-2,"h":a.cellHeaderHeight};o.fillRect(g,f),o.text(y,p.text,h,u,p.horizontalAlignment),n+=s}),D+=i}),DayPilot.list(a.rows).each(function(e){e.getHeight();DayPilot.list(e.lines).each(function(e){DayPilot.list(e).each(function(e){var t=e.cache||e.data,i=s.fakeEvent();i.className+=" "+t.cssClass;var n=i.firstChild,r=new DayPilot.StyleReader(n).get("border-right-color"),d=new DayPilot.StyleReader(n).getFont(),h=new DayPilot.StyleReader(n).get("color"),u=new DayPilot.StyleReader(n).getBackColor(),f={};f.left=new DayPilot.StyleReader(n).getPx("padding-left"),f.right=new DayPilot.StyleReader(n).getPx("padding-right"),f.top=new DayPilot.StyleReader(n).getPx("padding-top"),f.bottom=new DayPilot.StyleReader(n).getPx("padding-bottom"),DayPilot.de(i);var v=t.backColor||u,p={};p.e=e,p.text=e.text?e.text():e.client.html(),p.fontSize=d.size,p.fontFamily=d.family,p.fontStyle=d.style,p.fontColor=t.fontColor||h,p.backColor=t.backColor||v,p.borderColor=r,p.horizontalAlignment="left","function"==typeof a.onBeforeEventExport&&a.onBeforeEventExport(p);var g=b*e.part.colStart,y=b*e.part.colWidth,m=a.Oe(e.part.row,e.part.line)+c.grid.y+2,w=l.eventHeight(),D=2,k={"x":g+D,"y":m,"w":y+1-4,"h":w},x=DayPilot.Util.copyProps(k);x.x+=f.left,x.w-=f.left+f.right,x.y+=f.top,x.h-=f.top+f.bottom,o.fillRect(k,p.backColor),o.text(x,p.text,{"size":p.fontSize,"family":p.fontFamily,"style":p.fontStyle},p.fontColor,p.horizontalAlignment),o.rect(k,p.borderColor)})})}),o.rect(c.main,u),o.line(c.grid.x,0,c.grid.x,c.main.h,u),o.line(0,c.grid.y,c.main.w,c.grid.y,u),o}},s.fakeEvent=function(){var e=document.createElement("div");e.style.position="absolute",e.style.top="-2000px",e.style.left="-2000px",e.style.display="none",e.className=a.q("_event");var t=document.createElement("div");return t.className=a.q("_event_inner"),e.appendChild(t),a.nav.events.appendChild(e),e},s.fakeCell=function(){var e=document.createElement("div");e.style.position="absolute",e.style.top="-2000px",e.style.left="-2000px",e.style.display="none",e.className=a.q("_cell");var t=document.createElement("div");return t.className=a.q("_cell_inner"),e.appendChild(t),a.nav.events.appendChild(e),e},s.getWidth=function(){var e=s.pd;switch(e){case"viewport":case"full":return Math.floor(a.nav.top.clientWidth/a.Je())*a.Je();default:throw"Unsupported export mode: "+e}},s.getHeight=function(){var e=s.pd;switch(e){case"viewport":case"full":return a.nav.top.clientHeight;default:throw"Unsupported export mode: "+e}},s.getRectangles=function(){var e=l.headerHeight(),t={};return t.main={"x":0,"y":0,"w":s.getWidth(),"h":s.getHeight()},t.grid={"x":0,"y":e,"w":s.getWidth(),"h":s.getHeight()-e},t},this.multiselect={},this.multiselect.initList=[],this.multiselect.list=[],this.multiselect.divs=[],this.multiselect.previous=[],this.multiselect.yb=function(){var e=a.multiselect;return DayPilot.JSON.stringify(e.events())},this.multiselect.events=function(){var e=a.multiselect,t=[];t.ignoreToJSON=!0;for(var i=0;i1&&i.add(e.event,!0)}else i.clear(!0);else a.allowMultiSelect&&t?i.add(e.event,!0):(i.clear(!0),i.add(e.event,!0));i.redraw(),i.zb()},this.multiselect.Ab=function(e){var t=a.multiselect;return t.Bb(e,t.initList)},this.multiselect.Cb=function(){for(var e=a.multiselect,t=[],i=0;i-1?"&"+l:"?"+l,DayPilot.ajax({"method":"GET","url":r,"success":o,"error":n})}},this.queue={},this.queue.list=[],this.queue.list.ignoreToJSON=!0,this.queue.add=function(e){if(e){if(!e.isAction)throw"DayPilot.Action object required for queue.add()";a.queue.list.push(e)}},this.queue.notify=function(e){var t={};t.actions=a.queue.list,a.G("Notify",t,e,"Notify"),a.queue.list=[]},this.queue.clear=function(){a.queue.list=[]},this.queue.pop=function(){return a.queue.list.pop()},this.if=function(e){return"DateTime"===a.eventEndSpec?e:e.getDatePart().ticks===e.ticks?e.addDays(-1):e.getDatePart()},this.Ie=function(e){return"DateTime"===a.eventEndSpec?e:e.getDatePart().addDays(1)},this.kf=function(e){return"DateTime"===a.eventEndSpec?e:e.getDatePart()},this.ra=function(e){if(e&&(this.autoRefreshEnabled=!0),this.autoRefreshEnabled&&!(this.B>=this.autoRefreshMaxCount)){this.jf();var t=this.autoRefreshInterval;if(!t||t<10)throw"The minimum autoRefreshInterval is 10 seconds";this.autoRefreshTimeout=window.setTimeout(function(){a.Vc()},1e3*this.autoRefreshInterval)}},this.jf=function(){this.autoRefreshTimeout&&window.clearTimeout(this.autoRefreshTimeout)},this.Vc=function(){if(!t.eventResizing&&!t.eventMoving&&!t.timeRangeSelecting){var e=!1;if("function"==typeof this.onAutoRefresh){var i={};i.i=this.B,i.preventDefault=function(){this.preventDefault.value=!0},a.onAutoRefresh(i),i.preventDefault.value&&(e=!0)}!e&&this.r()&&this.commandCallBack(this.autoRefreshCommand),this.B++}this.B","compile":function(t,i){return t.replaceWith(this["template"].replace("{{id}}",i["id"])),function(t,i,n){var a=new DayPilot.Month(i[0]);a.Qc.scope=t,a.init();var o=n["id"];o&&(t[o]=a);var r=n["publishAs"];if(r){(0,e(r).assign)(t,a)}for(var l in n)if(0===l.indexOf("on")){var s=DayPilot.Util.shouldApply(l);s?!function(i){a[i]=function(a){var o=e(n[i]);t["$apply"](function(){o(t,{"args":a})})}}(l):!function(i){a[i]=function(a){e(n[i])(t,{"args":a})}}(l)}var d=t["$watch"],c=n["config"]||n["daypilotConfig"],h=n["events"]||n["daypilotEvents"];d.call(t,c,function(e,t){for(var i in e)a[i]=e[i];a.update()},!0),d.call(t,h,function(e){a.events.list=e,a.gd({"eventsOnly":!0})},!0)}}}}])}(),"undefined"!=typeof Sys&&Sys.Application&&Sys.Application.notifyScriptLoaded&&Sys.Application.notifyScriptLoaded()}}(),"undefined"==typeof DayPilot)var DayPilot={};if("undefined"==typeof DayPilot.Global&&(DayPilot.Global={}),function(){if("undefined"==typeof DayPilot.Navigator){DayPilot.Navigator=function(e,t){this.v="3027";var i=this;this.id=e,this.api=2,this.isNavigator=!0,this.autoFocusOnClick=!0,this.weekStarts="Auto",this.selectMode="day",this.titleHeight=20,this.dayHeaderHeight=20,this.bound=null,this.cellWidth=20,this.cellHeight=20,this.cssOnly=!0,this.cssClassPrefix="navigator_default",this.freeHandSelectionEnabled=!1,this.selectionStart=(new DayPilot.Date).getDatePart(),this.selectionEnd=null,this.selectionDay=null,this.showMonths=1,this.skipMonths=1,this.command="navigate",this.year=(new DayPilot.Date).getYear(),this.month=(new DayPilot.Date).getMonth()+1,this.showWeekNumbers=!1,this.weekNumberAlgorithm="Auto",this.rowsPerMonth="Six",this.orientation="Vertical",this.locale="en-us",this.visible=!0,this.timeRangeSelectedHandling="Bind",this.visibleRangeChangedHandling="Enabled",this.onVisibleRangeChange=null,this.onVisibleRangeChanged=null,this.onTimeRangeSelect=null,this.onTimeRangeSelected=null,this.nav={},this.t={},this.lf=function(){this.root.dp=this,this.cssOnly?this.root.className=this.q("_main"):this.root.className=this.q("main"),"Horizontal"===this.orientation?(this.root.style.width=this.showMonths*(7*o.cellWidth()+this.mf())+"px",this.root.style.height=6*this.cellHeight+this.titleHeight+this.dayHeaderHeight+"px"):this.root.style.width=7*o.cellWidth()+this.mf()+"px",this.root.style.position="relative",this.visible||(this.root.style.display="none");var e=document.createElement("input");e.type="hidden",e.name=i.id+"_state",e.id=e.name,this.root.appendChild(e),this.state=e,this.startDate?this.startDate=new DayPilot.Date(this.startDate).firstDayOfMonth():this.startDate=DayPilot.Date.fromYearMonthDay(this.year,this.month),this.calendars=[],this.selected=[],this.months=[]},this.sa=function(){return 2===i.api},this.Ee=function(){this.root.innerHTML=""},this.q=function(e){var t=this.theme||this.cssClassPrefix;return t?t+e:""},this.nf=function(e,t){var i=this.cssOnly?this.q("_"+t):this.q(t);DayPilot.Util.addClass(e,i)},this.of=function(e,t){var i=this.cssOnly?this.q("_"+t):this.q(t);DayPilot.Util.removeClass(e,i)},this.Fe=function(e,t){var n={};n.cells=[],n.days=[],n.weeks=[];var a=this.startDate.addMonths(e),r=t.before,l=t.after,s=a.firstDayOfMonth(),d=s.firstDayOfWeek(o.weekStarts()),c=s.addMonths(1),h=DayPilot.DateUtil.daysDiff(d,c),u="Auto"===this.rowsPerMonth?Math.ceil(h/7):6;n.rowCount=u;var f=(new DayPilot.Date).getDatePart(),v=7*o.cellWidth()+this.mf();n.width=v;var p=this.cellHeight*u+this.titleHeight+this.dayHeaderHeight;n.height=p;var g=document.createElement("div");if(g.style.width=v+"px",g.style.height=p+"px","Horizontal"===this.orientation)g.style.position="absolute",g.style.left=v*e+"px",g.style.top="0px",n.top=0,n.left=v*e;else{g.style.position="relative";var y=e>0?i.months[e-1].top+i.months[e-1].height:0;n.top=y,n.left=0}this.cssOnly?g.className=this.q("_month"):g.className=this.q("month"),g.style.cursor="default",g.style.MozUserSelect="none",g.style.KhtmlUserSelect="none",g.style.WebkitUserSelect="none",g.month=n,this.root.appendChild(g);var m=this.titleHeight+this.dayHeaderHeight,b=document.createElement("div");b.style.position="absolute",b.style.left="0px",b.style.top="0px",b.style.width=o.cellWidth()+"px",b.style.height=this.titleHeight+"px",b.style.lineHeight=this.titleHeight+"px",b.setAttribute("unselectable","on"),this.cssOnly?b.className=this.q("_titleleft"):b.className=this.q("titleleft"),t.left&&(b.style.cursor="pointer",b.innerHTML="<",b.onclick=this.pf),g.appendChild(b),this.tl=b;var w=document.createElement("div");w.style.position="absolute",w.style.left=o.cellWidth()+"px",w.style.top="0px",w.style.width=5*o.cellWidth()+this.mf()+"px",w.style.height=this.titleHeight+"px",w.style.lineHeight=this.titleHeight+"px",w.setAttribute("unselectable","on"),this.cssOnly?w.className=this.q("_title"):w.className=this.q("title"),w.innerHTML=o.locale().monthNames[a.getMonth()]+" "+a.getYear(),g.appendChild(w),this.ti=w;var D=document.createElement("div");D.style.position="absolute",D.style.left=6*o.cellWidth()+this.mf()+"px",D.style.top="0px",D.style.width=o.cellWidth()+"px",D.style.height=this.titleHeight+"px",D.style.lineHeight=this.titleHeight+"px",D.setAttribute("unselectable","on"),this.cssOnly?D.className=this.q("_titleright"):D.className=this.q("titleright"),t.right&&(D.style.cursor="pointer",D.innerHTML=">",D.onclick=this.qf),g.appendChild(D),this.tr=D;var k=this.mf();if(this.showWeekNumbers)for(var x=0;x"+P+"",g.appendChild(S),n.weeks.push(S)}for(var A=0;A<7;A++){n.cells[A]=[];var S=document.createElement("div");S.style.position="absolute",S.style.left=A*o.cellWidth()+k+"px",S.style.top=this.titleHeight+"px",S.style.width=o.cellWidth()+"px",S.style.height=this.dayHeaderHeight+"px",S.style.lineHeight=this.dayHeaderHeight+"px",S.setAttribute("unselectable","on"),this.cssOnly?S.className=this.q("_dayheader"):S.className=this.q("dayheader"),S.innerHTML=""+this.rf(A)+"",g.appendChild(S),n.days.push(S);for(var x=0;x=a.addMonths(1);if("month"===this.tf())T=T&&E;else if("day"===this.tf())T=T&&(E||r&&M||l&&H);else if("week"===this.tf()){var _=C.firstDayOfMonth()===a;T=T&&(_||r&&M||l&&H)}var R=document.createElement("div");n.cells[A][x]=R;var B=i.uf(A,x),N=B.x,U=B.y;R.day=C,R.x=A,R.y=x,R.left=N,R.top=U,R.isCurrentMonth=E,R.isNextMonth=H,R.isPrevMonth=M,R.showBefore=r,R.showAfter=l,this.cssOnly?R.className=this.q(E?"_day":"_dayother"):R.className=this.q(E?"day":"dayother"),i.nf(R,"cell"),C.getTime()===f.getTime()&&E&&this.nf(R,"today"),0!==C.dayOfWeek()&&6!==C.dayOfWeek()||this.nf(R,"weekend"),R.style.position="absolute",R.style.left=N+"px",R.style.top=U+"px",R.style.width=o.cellWidth()+"px",R.style.height=this.cellHeight+"px",R.style.lineHeight=this.cellHeight+"px";var L=document.createElement("div");L.style.position="absolute",this.cssOnly?L.className=C.getTime()===f.getTime()&&E?this.q("_todaybox"):this.q("_daybox"):L.className=C.getTime()===f.getTime()&&E?this.q("todaybox"):this.q("daybox"),i.nf(L,"cell_box"),L.style.left="0px",L.style.top="0px",L.style.right="0px",L.style.bottom="0px",R.appendChild(L);var z=null;if(this.cells&&this.cells[C.toStringSortable()]&&(z=this.cells[C.toStringSortable()]),"function"==typeof i.onBeforeCellRender){var O={};O.cell=z||{},O.cell.day=C,O.cell.isCurrentMonth=E,O.cell.isToday=C.getTime()===f.getTime()&&E,O.cell.isWeekend=0===C.dayOfWeek()||6===C.dayOfWeek(),z?(O.cell.html=z.html||C.getDay(),O.cell.cssClass=z.css):(O.cell.html=C.getDay(),O.cell.cssClass=null),i.onBeforeCellRender(O),z=O.cell}if(z&&DayPilot.Util.addClass(R,z.cssClass||z.css),E||r&&M||l&&H){var I=document.createElement("div");I.innerHTML=C.getDay(),I.style.position="absolute",I.style.left="0px",I.style.top="0px",I.style.right="0px",I.style.bottom="0px",i.nf(I,"cell_text"),R.style.cursor="pointer",R.isClickable=!0,z&&z.html&&(I.innerHTML=z.html),R.appendChild(I)}R.setAttribute("unselectable","on"),R.onclick=this.vf,g.appendChild(R),T&&(i.wf(g,A,x),this.selected.push(R))}}var F=document.createElement("div");F.style.position="absolute",F.style.left="0px",F.style.top=m-2+"px",F.style.width=7*o.cellWidth()+this.mf()+"px",F.style.height="1px",F.style.fontSize="1px",F.style.lineHeight="1px",this.cssOnly?F.className=this.q("_line"):F.className=this.q("line"),g.appendChild(F),this.months.push(n)},this.uf=function(e,t){var i=this.titleHeight+this.dayHeaderHeight,n=this.mf();return{"x":e*o.cellWidth()+n,"y":t*this.cellHeight+i}},this.wf=function(e,t,n){var a=e.month.cells[t][n];i.nf(a,"select")},this.xf=function(e,t,n){var a=e.month.cells[t][n];i.of(a,"select")},this.mf=function(){return this.showWeekNumbers?o.cellWidth():0},this.yf=function(){if(this.items)for(var e=0;e=this.Cf())&&(l=this.selectionStart.firstDayOfMonth()),l.toStringSortable()!==this.startDate.toStringSortable()&&(r=!0),this.startDate=l}this.Af(),this.Ee(),this.lf(),this.Df(),this.yf(),this.zf(),!n||a.equals(this.selectionStart)&&o.equals(this.selectionEnd)||this.ab(),r&&this.Ef()},this.update=function(){i.cssOnly||(i.cssOnly=!0,DayPilot.Util.log("DayPilot: cssOnly = false mode is not supported since DayPilot Pro 8.0.")),this.Ee(),this.lf(),this.Af(),this.Df(),this.ba(),this.yf(),this.zf(),this.visible?this.show():this.hide()},this.G=function(e,t,i){var n={};n.action=e,n.parameters=i,n.data=t,n.header=this.F();var a="JSON"+DayPilot.JSON.stringify(n);this.backendUrl?DayPilot.request(this.backendUrl,this.I,a,this.J):WebForm_DoCallback(this.uniqueID,a,this.K,null,this.callbackError,!0)},this.J=function(e){if("function"==typeof i.onAjaxError){var t={};t.request=e,i.onAjaxError(t)}else"function"==typeof i.ajaxError&&i.ajaxError(e)},this.I=function(e){i.K(e.responseText)},this.E=function(e,t,n){var a={};a.action=e,a.parameters=n,a.data=t,a.header=this.F();var o="JSON"+DayPilot.JSON.stringify(a);__doPostBack(i.uniqueID,o)},this.F=function(){var e={};return e.v=this.v,e.startDate=this.startDate,e.selectionStart=this.selectionStart,e.showMonths=this.showMonths,e},this.Ff=function(e,t){"refresh"===e&&this.Ef()},this.rf=function(e){var t=e+o.weekStarts();return t>6&&(t-=7),o.locale().dayNamesShort[t]},this.sf=function(e){return null!==this.selectionStart&&null!==this.selectionEnd&&(this.selectionStart.getTime()<=e.getTime()&&e.getTime()<=this.selectionEnd.getTime())},this.Gf=function(e){for(var t=0;ta&&(n.end=t)}n.end&&(n.clear(),n.draw())}},this.Kf={};var n=this.Kf;n.start=null,n.drawCell=function(e){var t=i.months[e.month],a=i.uf(e.x,e.y),o=t.top+a.y,r=t.left+a.x,l=document.createElement("div");l.style.position="absolute",l.style.left=r+"px",l.style.top=o+"px",l.style.height=i.cellHeight+"px",l.style.width=i.cellWidth+"px",l.style.backgroundColor="#ccc",l.style.opacity=.5,l.style.cursor="default",i.nav.preselection.appendChild(l),n.cells.push(l)},n.clear=function(){if(n.cells){for(var e=0;e0){o.month-=1;var r=i.months[o.month];o.x=6,o.y=r.rowCount-1}for(n.cells=[];!t.is(o);){n.drawCell(t);var l=new a(t).next();if(!l)return;t.month=l.month,t.x=l.x,t.y=l.y}n.drawCell(t)}},n.ordered=function(){var e=n.start,t=n.end,i={};return!t||new a(e).before(t)?(i.start=e,i.end=t):(i.start=t,i.end=e),i};var a=function(e,t,n){if(e instanceof a)return e;if("object"==typeof e){var o=e;this.month=o.month,this.x=o.x,this.y=o.y}else this.month=e,this.x=t,this.y=n;this.is=function(e){return this.month===e.month&&this.x===e.x&&this.y===e.y},this.next=function(){var e=this;if(e.x<6)return{"month":e.month,"x":e.x+1,"y":e.y};var t=i.months[e.month];return e.y0)return{"month":e.month,"x":e.x-1,"y":e.y};i.months[e.month];if(e.y>0)return{"month":e.month,"x":6,"y":e.y-1};if(e.month>0){var t=i.months[e.month-1];return{"month":e.month-1,"x":6,"y":t.rowCount-1}}return null},this.previousVisible=function(){for(var e=this;!e.visible();){var t=e.previous();if(!t)return null;e=new a(t)}return e},this.cell=function(){return i.months[this.month].cells[this.x][this.y]},this.date=function(){return this.cell().day},this.before=function(e){return this.date()=i.Cf())return void i.select(r)}var s=n.cells[a][o];i.wf(t,a,o),i.selected.push(s),i.selectionStart=s.day,i.selectionEnd=s.day;break;case"week":if(i.autoFocusOnClick){var l=n.cells[0][o].day,d=n.cells[6][o].day;if(l.firstDayOfMonth()===d.firstDayOfMonth()&&(l=i.Cf()))return void i.select(r)}for(var c=0;c<7;c++)i.wf(t,c,o),i.selected.push(n.cells[c][o]);i.selectionStart=n.cells[0][o].day,i.selectionEnd=n.cells[6][o].day;break;case"month":if(i.autoFocusOnClick){var l=r;if(r=i.Cf())return void i.select(r)}for(var l=null,d=null,o=0;o<6;o++)for(var a=0;a<7;a++){var s=n.cells[a][o];s&&s.day.getYear()===r.getYear()&&s.day.getMonth()===r.getMonth()&&(i.wf(t,a,o),i.selected.push(s),null===l&&(l=s.day),d=s.day)}i.selectionStart=l,i.selectionEnd=d;break;default:throw"unknown selectMode"}i.zf(),i.ab()}},this.ab=function(e){var t=i.selectionStart,n=i.selectionEnd.addDays(1),a=DayPilot.DateUtil.daysDiff(t,n),o=i.selectionDay;if(e=e||{},i.sa()){var r={};if(r.start=t,r.end=n,r.day=o,r.days=a,r.mode=e.mode||i.selectMode,r.preventDefault=function(){this.preventDefault.value=!0},"function"==typeof i.onTimeRangeSelect&&(i.onTimeRangeSelect(r),r.preventDefault.value))return;switch(i.timeRangeSelectedHandling){case"Bind":var l=DayPilot.Util.evalVariable(i.bound);if(l){var s={};s.start=t,s.end=n,s.days=a,s.day=o,l.commandCallBack(i.command,s)}break;case"None":break;case"PostBack":i.timeRangeSelectedPostBack(t,n,o)}"function"==typeof i.onTimeRangeSelected&&i.onTimeRangeSelected(r)}else switch(i.timeRangeSelectedHandling){case"Bind":var l=DayPilot.Util.evalVariable(i.bound);if(l){var s={};s.start=t,s.end=n,s.days=a,s.day=o,l.commandCallBack(i.command,s)}break;case"JavaScript":i.onTimeRangeSelected(t,n,o);break;case"None":break;case"PostBack":i.timeRangeSelectedPostBack(t,n,o)}},this.timeRangeSelectedPostBack=function(e,t,i,n){var a={};a.start=e,a.end=t,a.day=n,this.E("TimeRangeSelected",i,a)},this.qf=function(e){i.Lf(i.skipMonths)},this.pf=function(e){i.Lf(-i.skipMonths)},this.Lf=function(e){this.startDate=this.startDate.addMonths(e),this.Ee(),this.lf(),this.Df(),this.zf(),this.Ef(),this.yf()},this.Bf=function(){return i.startDate.firstDayOfMonth()},this.Cf=function(){return i.startDate.firstDayOfMonth().addMonths(this.showMonths)},this.visibleStart=function(){return i.startDate.firstDayOfMonth().firstDayOfWeek(o.weekStarts())},this.visibleEnd=function(){return i.startDate.firstDayOfMonth().addMonths(this.showMonths-1).firstDayOfWeek(o.weekStarts()).addDays(42)},this.Ef=function(){var e=this.visibleStart(),t=this.visibleEnd();if(i.sa()){var n={};if(n.start=e,n.end=t,n.preventDefault=function(){this.preventDefault.value=!0},"function"==typeof i.onVisibleRangeChange&&(i.onVisibleRangeChange(n),n.preventDefault.value))return;switch(this.visibleRangeChangedHandling){case"CallBack":this.visibleRangeChangedCallBack(null);break;case"PostBack":this.visibleRangeChangedPostBack(null);break;case"Disabled":}"function"==typeof i.onVisibleRangeChanged&&i.onVisibleRangeChanged(n)}else switch(this.visibleRangeChangedHandling){case"CallBack":this.visibleRangeChangedCallBack(null);break;case"PostBack":this.visibleRangeChangedPostBack(null);break;case"JavaScript":this.onVisibleRangeChanged(e,t);break;case"Disabled":}},this.visibleRangeChangedCallBack=function(e){var t={};this.G("Visible",e,t)},this.visibleRangeChangedPostBack=function(e){var t={};this.E("Visible",e,t)},this.K=function(e,t){var e=DayPilot.Util.parseJSON(e);i.items=e.Items,i.cells=e.Cells,i.cells?i.update():i.yf()},this.Df=function(){for(var e=0;ee&&(e=i.height)}return e}for(var n=0,t=0;t","compile":function(t,i){return t.replaceWith(this["template"].replace("{{id}}",i["id"])),function(t,i,n){var a=new DayPilot.Navigator(i[0]);a.Qc.scope=t,a.init();var o=n["id"];o&&(t[o]=a);var r=n["publishAs"];if(r){(0,e(r).assign)(t,a)}for(var l in n)if(0===l.indexOf("on")){var s=DayPilot.Util.shouldApply(l);s?!function(i){a[i]=function(a){var o=e(n[i]);t["$apply"](function(){o(t,{"args":a})})}}(l):!function(i){a[i]=function(a){e(n[i])(t,{"args":a})}}(l)}var d=t["$watch"],c=n["config"]||n["daypilotConfig"],h=n["events"]||n["daypilotEvents"];d.call(t,c,function(e,t){for(var i in e)a[i]=e[i];a.update()},!0),d.call(t,h,function(e){a.events.list=e,a.ba(),a.yf()},!0)}}}}])}(),"undefined"!=typeof Sys&&Sys.Application&&Sys.Application.notifyScriptLoaded&&Sys.Application.notifyScriptLoaded()}}(),"undefined"==typeof DayPilot)var DayPilot={};if("undefined"==typeof DayPilot.Global&&(DayPilot.Global={}),function(){function e(e){for(var t=e.touches[0].clientX,i=e.touches[0].clientY,n=document.elementFromPoint(t,i);n&&n.parentNode;)if(n=n.parentNode,n.daypilotMainD)return n.calendar;return!1}function t(e){var t=e.touches[0].pageX,i=e.touches[0].pageY,n={};return n.x=t,n.y=i,n}if("undefined"==typeof DayPilot.Scheduler){var i=function(){var e=navigator.userAgent;return e.indexOf("Mozilla/5.0")>-1&&e.indexOf("Android ")>-1&&e.indexOf("AppleWebKit")>-1&&!(e.indexOf("Chrome")>-1)}(),n={},a=function(){},o=!1;DayPilot.Scheduler=function(e,o){function d(e,t){return 1-e/t}this.v="3027";var c=this;this.id=e,this.isScheduler=!0,this.hideUntilInit=!0,this.api=2,this.allowDefaultContextMenu=!1,this.allowEventOverlap=!0,this.allowMultiMove=!1,this.allowMultiRange=!1,this.allowMultiResize=!1,this.allowMultiSelect=!0,this.multiSelectRectangle="Disabled",this.autoRefreshCommand="refresh",this.autoRefreshEnabled=!1,this.autoRefreshInterval=60,this.autoRefreshMaxCount=20,this.autoScroll="Drag",this.blockOnCallBack=!1,this.navigatorBackSync=null,this.beforeCellRenderCaching=!0,"function"==typeof DayPilot.Bubble?(this.bubble=new DayPilot.Bubble,this.cellBubble=new DayPilot.Bubble,this.resourceBubble=new DayPilot.Bubble):(this.bubble=null,this.cellBubble=null,this.resourceBubble=null),this.businessBeginsHour=9,this.businessEndsHour=18,this.businessWeekends=!1,this.cellDuration=60,this.cellGroupBy="Day",this.cellStacking=!1,this.cellStackingAutoHeight=!1,this.cellWidth=40,this.cellWidthMin=1,this.cellWidthSpec="Fixed",this.cellsMarkBusiness=!0,this.eventHtmlLeftMargin=20,this.eventHtmlRightMargin=20,this.eventMarginLeft=0,this.eventMarginRight=0,this.eventMarginBottom=0,this.eventsLoadMethod="GET",this.groupConcurrentEvents=!1,this.groupConcurrentEventsLimit=1,this.Pf=!0,this.Qf=!1,this.cellSweeping=!0,this.cellSweepingCacheSize=1e3,this.crosshairColor="Gray",this.crosshairOpacity=20,this.crosshairType="Header",this.Gd=!1,this.doubleClickTimeout=300,this.dragOutAllowed=!1,this.durationBarHeight=3,this.durationBarVisible=!0,this.durationBarMode="Duration",this.durationBarDetached=!1,this.days=1,this.drawBlankCells=!0,this.dynamicEventRendering="Progressive",this.dynamicEventRenderingMargin=50,this.dynamicEventRenderingMarginX=null,this.dynamicEventRenderingMarginY=null,this.dynamicEventRenderingCacheSweeping=!1,this.dynamicEventRenderingCacheSize=200,this.dynamicLoading=!1,this.eventBorderColor="#000000",this.eventBackColor="#FFFFFF",this.eventEditMinWidth=100,this.eventEndSpec="DateTime",this.eventFontFamily="Tahoma, Arial",this.eventFontSize="8pt",this.eventFontColor="#000000",this.eventHeight=25,this.eventMoveMargin=5,this.eventMoveToPosition=!1,this.eventMoveSkipNonBusiness=!1,this.eventResizeMargin=5,this.eventStackingLineHeight=100,this.eventTapAndHoldHandling="Move",this.eventTextWrappingEnabled=!1,this.eventUpdateInplaceOptimization=!1,this.Rf=!1,this.headerFontColor="#000000",this.headerFontFamily="Tahoma, Arial",this.headerFontSize="8pt",this.headerHeight=20,this.heightSpec="Auto",this.height=300,this.hideBorderFor100PctHeight=!1,this.hourFontFamily="Tahoma, Arial",this.hourFontSize="10pt",this.hourNameBackColor="#ECE9D8",this.hourNameBorderColor="#ACA899",this.infiniteScrollingEnabled=!1,this.Sf=10,this.Tf=30,this.initEventEnabled=!0,this.jointEventsResize=!0,this.jointEventsMove=!0,this.layout="Auto",this.linkCreateHandling="Disabled",this.linkBottomMargin=10,this.linkPointSize=10,this.linksLoadMethod="GET",this.locale="en-us",this.loadingLabelText="Loading...",this.loadingLabelVisible=!0,this.overrideWheelScrolling=!1,this.messageBarPosition="Top",this.messageHideAfter=5e3,this.messageHideOnMouseOut=!0,this.multiMoveVerticalMode="Disabled",this.moveBy="Full",this.notifyCommit="Immediate",this.progressiveRowRendering=!0,this.progressiveRowRenderingPreload=25,this.tapAndHoldTimeout=300,this.timeHeaders=[{"groupBy":"Default"},{"groupBy":"Cell"}],this.treePreventParentUsage=!1,this.treeAutoExpand=!0,this.rowCreateHeight=null,this.rowCreateHtml="New row...",this.rowHeaderColumnDefaultWidth=80,this.rowHeaderHideIconEnabled=!1,this.rowHeaderWidth=80,this.rowHeaderScrolling=!1,this.rowHeaderSplitterWidth=3,this.rowHeaderWidthAutoFit=!0,this.rowHeaderWidthMarginRight=0,this.rowHeaderCols=null,this.rowMarginBottom=0,this.rowMarginTop=0,this.rowMinHeight=0,this.rowsLoadMethod="GET",this.scale="CellDuration",this.scrollDelayDynamic=500,this.scrollDelayEvents=200,this.scrollDelayCells=0,this.scrollDelayFloats=0,this.scrollStep=null,this.scrollX=0,this.scrollY=0,this.selectedRows=[],this.showBaseTimeHeader=!0,this.showNonBusiness=!0,this.showToolTip=!0,this.snapToGrid=!0,this.startDate=DayPilot.Date.today(),this.syncResourceTree=!1,this.timeHeaderTextWrappingEnabled=!1,this.treeEnabled=!1,this.treeIndent=20,this.treeImageMarginLeft=5,this.treeImageMarginTop=5,this.timeFormat="Auto",this.useEventBoxes="Always",this.viewType="Resources",this.visible=!0,this.watchWidthChanges=!0,this.weekStarts="Auto",this.width=null,this.floatingEvents=!0,this.floatingTimeHeaders=!0,this.eventCorners="Regular",this.separators=[],this.cornerHtml="",this.Uf=!0,this.Vf=-1,this.Wf=-1,this.eventClickHandling="Enabled",this.eventDeleteHandling="Disabled",this.eventHoverHandling="Bubble",this.eventDoubleClickHandling="Disabled",this.eventEditHandling="Update",this.eventMoveHandling="Update",this.eventResizeHandling="Update",this.eventRightClickHandling="ContextMenu",this.eventSelectHandling="Update",this.resourceCollapseHandling="Enabled",this.resourceExpandHandling="Enabled",this.rowClickHandling="Enabled",this.rowDoubleClickHandling="Disabled",this.rowCreateHandling="Disabled",this.rowEditHandling="Update",this.rowHeaderColumnResizedHandling="Update",this.rowSelectHandling="Update",this.rowMoveHandling="Disabled",this.timeRangeClickHandling="Enabled",this.timeRangeDoubleClickHandling="Disabled",this.timeRangeSelectedHandling="Enabled",this.timeRangeRightClickHandling="ContextMenu",this.eventMovingStartEndEnabled=!1,this.eventMovingStartEndFormat="MMMM d, yyyy",this.timeRangeSelectingStartEndEnabled=!1,this.timeRangeSelectingStartEndFormat="MMMM d, yyyy",this.eventResizingStartEndEnabled=!1,this.eventResizingStartEndFormat="MMMM d, yyyy",this.cssOnly=!0,this.cssClassPrefix="scheduler_default",this.eventVersionsEnabled=!1,this.eventVersionHeight=25,this.eventVersionMargin=2,this.eventVersionPosition="Above";this.backendUrl=null;1===c.api&&(this.onEventMove=function(){},this.onEventResize=function(){},this.onResourceExpand=function(){},this.onResourceCollapse=function(){}),this.onEventClick=null,this.onEventClicked=null,this.onEventMove=null,this.onEventMoved=null,this.onEventMoving=null,this.onEventResize=null,this.onEventResized=null,this.onEventResizing=null,this.onEventRightClick=null,this.onEventRightClicked=null,this.onEventMouseOver=null,this.onEventMouseOut=null,this.onRowClick=null,this.onRowClicked=null,this.onTimeRangeClick=null,this.onTimeRangeClicked=null,this.onTimeRangeDoubleClick=null,this.onTimeRangeDoubleClicked=null,this.onTimeRangeSelect=null,this.onTimeRangeSelected=null,this.onTimeRangeSelecting=null,this.onTimeRangeRightClick=null,this.onTimeRangeRightClicked=null,this.onRowHeaderResized=null,this.onCellMouseOver=null,this.onCellMouseOut=null,this.onGridMouseDown=null,this.onBeforeCellRender=null,this.onBeforeEventRender=null,this.onBeforeTimeHeaderRender=null,this.onBeforeResHeaderRender=null,this.onBeforeRowHeaderRender=null,this.onBeforeCellExport=null,this.onBeforeEventExport=null,this.onBeforeTimeHeaderExport=null,this.onBeforeRowHeaderExport=null,this.onEventFilter=null,this.onRowFilter=null,this.onRectangleEventSelecting=null,this.onRectangleEventSelect=null,this.onRectangleEventSelected=null,this.onDimensionsChanged=null,this.onAfterUpdate=null,this.B=0,this.Xf=-1,this.rowlist=DayPilot.list(),this.itline=DayPilot.list(),this.timeline=null,this.events={},this.cells={},this.elements={},this.elements.events=[],this.elements.bars=[],this.elements.text=[],this.elements.cells=[],this.elements.linesVertical=[],this.elements.separators=[],this.elements.range=[],this.elements.breaks=[],this.elements.links=[],this.elements.linkpoints=[],this.elements.rectangle=[],this.elements.hover=[],this.t={},this.t.cells=[],this.t.linesVertical={},this.t.linesHorizontal={},this.t.timeHeaderGroups=[],this.t.timeHeader={},this.t.pixels=[],this.t.breaks=[],this.t.events=[],this.clientState={},this.members={},this.members.obsolete=["Init","cleanSelection","cssClassPrefix","getHScrollPosition","setHScrollPosition","getVScrollPosition","setVScrollPosition","showBaseTimeHeader"],this.members.ignoreFilter=function(e){return 0===e.indexOf("div")},this.members.ignore=["internal","nav","debug","temp","elements","members","cellProperties","itline","rowlist","timeHeader","timeouts"],this.members.noCssOnly=["eventCorners","eventFontColor","eventFontFamily","eventFontSize","headerFontColor","headerFontFamily","headerFontSize","hourFontFamily","hourFontSize","hourNameBackColor","hourNameBorderColor","loadingLabelBackColor","loadingLabelFontColor","loadingLabelFontFamily","loadingLabelFontSize","shadow","timeBreakColor"],this.nav={},this.K=function(e,t){var e=DayPilot.Util.parseJSON(e);if(c.onScrollCalled=!1,e.CallBackRedirect)return void(document.location.href=e.CallBackRedirect);if("function"==typeof c.onCallBackResult){var i={};if(i.result=e,i.preventDefault=function(){i.preventDefault.value=!0},c.onCallBackResult(i),i.preventDefault.value)return c.Wa(),c.X(),c.ra(),e.Message&&c.message&&c.message(e.Message),c.Y(e.CallBackData,!0),c.Yf(),void c.Zf()}if(e.BubbleGuid){var n=e.BubbleGuid,a=this.bubbles[n];return delete this.bubbles[n],c.X(),"undefined"!=typeof e.Result.BubbleHTML&&a&&a.updateView(e.Result.BubbleHTML,a),void c.Yf()}if("undefined"!=typeof DayPilot.Bubble&&DayPilot.Bubble.hideActive(),"undefined"!=typeof e.ClientState&&(null===e.ClientState?c.clientState={}:c.clientState=e.ClientState),"None"===e.UpdateType)return c.X(),c.Yf(),e.Message&&c.message(e.Message),void c.Y(e.CallBackData,!0);if(e.VsUpdate){var o=document.createElement("input");o.type="hidden",o.name=c.id+"_vsupdate",o.id=o.name,o.value=e.VsUpdate,c.Ce.innerHTML="",c.Ce.appendChild(o)}"undefined"!=typeof e.TagFields&&(c.tagFields=e.TagFields),"undefined"!=typeof e.SortDirections&&(c.sortDirections=e.SortDirections),c.t.drawArea=null,"Full"===e.UpdateType&&(c.resources=e.Resources,c.colors=e.Colors,c.palette=e.Palette,c.dirtyColors=e.DirtyColors,c.cellProperties=e.CellProperties,c.cellConfig=e.CellConfig,c.separators=e.Separators,c.timeline=e.Timeline,c.timeHeader=e.TimeHeader,c.timeHeaders=e.TimeHeaders,"undefined"!=typeof e.Links&&(c.links.list=e.Links),"undefined"!=typeof e.RowHeaderColumns&&(c.rowHeaderColumns=e.RowHeaderColumns),c.startDate=e.StartDate?new DayPilot.Date(e.StartDate):c.startDate,c.days=e.Days?e.Days:c.days,c.cellDuration=e.CellDuration?e.CellDuration:c.cellDuration,c.cellGroupBy=e.CellGroupBy?e.CellGroupBy:c.cellGroupBy,c.cellWidth=e.CellWidth?e.CellWidth:c.cellWidth,"undefined"!=typeof e.Scale&&(c.scale=e.Scale),c.viewType=e.ViewType?e.ViewType:c.viewType,c.hourNameBackColor=e.HourNameBackColor?e.HourNameBackColor:c.hourNameBackColor,"undefined"!=typeof e.ShowNonBusiness&&(c.showNonBusiness=e.ShowNonBusiness),c.businessBeginsHour=e.BusinessBeginsHour?e.BusinessBeginsHour:c.businessBeginsHour,c.businessEndsHour=e.BusinessEndsHour?e.BusinessEndsHour:c.businessEndsHour,"undefined"!=typeof e.DynamicLoading&&(c.dynamicLoading=e.DynamicLoading),"undefined"!=typeof e.TreeEnabled&&(c.treeEnabled=e.TreeEnabled),c.backColor=e.BackColor?e.BackColor:c.backColor,c.nonBusinessBackColor=e.NonBusinessBackColor?e.NonBusinessBackColor:c.nonBusinessBackColor,c.locale=e.Locale?e.Locale:c.locale,"undefined"!=typeof e.TimeZone&&(c.timeZone=e.TimeZone),c.timeFormat=e.TimeFormat?e.TimeFormat:c.timeFormat,c.rowHeaderCols=e.RowHeaderCols?e.RowHeaderCols:c.rowHeaderCols,"undefined"!=typeof e.DurationBarMode&&(c.durationBarMode=e.DurationBarMode),c.cornerBackColor=e.CornerBackColor?e.CornerBackColor:c.cornerBackColor,"undefined"!=typeof e.CornerHTML&&(c.cornerHtml=e.CornerHTML),c.hashes=e.Hashes,c.$f(),c._f(),c.ag(),c.aa()),"Scroll"!==e.Action&&c.ba(e.Events),"Full"===e.UpdateType&&(c.bg(),c.cg()),c.dg(),c.na(),c.eg(),c.t.drawArea=null,"Scroll"!==e.Action?(c.fg(),c.ca(),"Auto"!==c.heightSpec&&"Max"!==c.heightSpec||c.ja(),c.gg(),c.M(),c.hg(),c.multiselect.clear(!0),c.multiselect.ig(e.SelectedEvents),c.jg(),c.kg(),c.oa()):(c.multiselect.clear(!0),c.multiselect.ig(e.SelectedEvents),c.lg(e.Events)),"HoldForever"!==c.timeRangeSelectedHandling&&c.mg(),"Full"===e.UpdateType&&(c.setScroll(e.ScrollX,e.ScrollY),c.zf()),c.ng(),c.Wa(),e.SelectedRows&&c.og(e.SelectedRows),c.X(),"Full"===e.UpdateType&&navigator.appVersion.indexOf("MSIE 7.")!==-1&&window.setTimeout(function(){c.bg(),c.ja()},0),c.ra(),e.Message&&c.message&&c.message(e.Message),c.Y(e.CallBackData,!0),c.Yf(),c.Zf(),"Full"!==e.UpdateType||"Scroll"===e.Action||c.onScrollCalled||setTimeout(function(){c.pg()},0)},this.Wa=function(){if(c.todo&&c.todo.del){var e=c.todo.del;e.parentNode.removeChild(e),c.todo.del=null}},this.Y=function(e,t){var i=function(e,t){return function(){if(c.sa()){if("function"==typeof c.onAfterRender){var i={};i.isCallBack=t,i.isScroll=!1,i.data=e,c.onAfterRender(i)}}else c.afterRender&&c.afterRender(e,t)}};window.setTimeout(i(e,t),0)},this.scrollTo=function(e,t,i){c.qg.enabled?(c.qg.scrollToRequested=e,setTimeout(function(){var e=c.qg.scrollToRequested;e&&c.rg(e,t,i)},0)):c.rg(e,t,i)},this.rg=function(e,t,i){if(e){if("Days"===c.viewType){var n=c.sg(new DayPilot.Date(e));if(!n)return;return void setTimeout(function(){var e=n.top;c.nav.scroll.scrollTop=e},100)}var a;if(e instanceof DayPilot.Date)a=this.getPixels(e).left;else if("string"==typeof e)a=this.getPixels(new DayPilot.Date(e)).left;else{if("number"!=typeof e)throw"Invalid scrollTo() parameter. Accepted parameters: string (ISO date), number (pixels), DayPilot.Date object";a=e}var o=this.tg.clientWidth,r=this.nav.scroll.clientWidth;switch(i=i||"left",i.toLowerCase()){case"left":break;case"middle":a-=r/2;break;case"right":a-=r}if(a<0&&(a=0),a>o-r&&(a=o-r),!t)return void c.ug(a);var l=Math.abs(c.nav.scroll.scrollLeft-a),s=l/o,d=50;if("number"==typeof t)d=t;else if("string"==typeof t)switch(t){case"fast":d=30;break;case"normal":d=50;break;case"slow":d=100;break;case"linear":d=Math.floor(100*s)}s>.6&&(d=Math.min(d,80)),this.vg(a,d)}},this.vg=function(e,t){function i(e){var t=e.next();return"undefined"==typeof t?void(e.finished&&e.finished()):(c.setScrollX(t),window.clearTimeout(c.refreshTimeout),void setTimeout(function(){i(e)},e.delay))}var n={};n.steps=[],n.index=0,n.delay=10,n.next=function(){var e=n.steps[n.index];return n.index+=1,e},n.finished=function(){c.pg()};for(var a=c.getScrollX(),t=t||100,o=e-a,r=0;ri&&(e=i-t.clientWidth),c.divTimeScroll.scrollLeft=e,t.scrollLeft=e},this.setScrollY=function(e){c.qg.enabled?(c.qg.scrollYRequested=e,setTimeout(function(){var e=c.qg.scrollYRequested;"number"==typeof e&&c.Ig(e)},0)):c.Ig(e)},this.Ig=function(e){var t=c.nav.scroll,i=c.Xf;t.clientHeight+e>i&&(e=i-t.clientHeight),c.divResScroll.scrollTop=e,t.scrollTop=e},this.setScroll=function(e,t){c.setScrollX(e),c.setScrollY(t)},this.message=function(e,t){if(null!==e){var i={};"object"==typeof arguments[1]&&(i=arguments[1],t=i.delay);var n,t=t||this.messageHideAfter||2e3,a=this.Jg()+1,o=this.Kg()+_.splitterWidth(),r=DayPilot.sw(c.nav.scroll)+1,l=DayPilot.sh(c.nav.scroll)+1;if(this.nav.message)n=c.nav.message;else{n=document.createElement("div"),n.style.position="absolute",n.style.left=o+"px",n.style.right=r+"px",n.style.display="none",DayPilot.re(n,DayPilot.touch.start,function(e){c.nav.message.style.display="none",e.preventDefault(),e.stopPropagation()}),n.onmousemove=function(){c.messageHideOnMouseOut&&n.messageTimeout&&!n.status&&clearTimeout(n.messageTimeout)},n.onmouseout=function(){c.messageHideOnMouseOut&&"none"!==c.nav.message.style.display&&(n.messageTimeout=setTimeout(c.Ea,500))};var s=document.createElement("div");s.onclick=function(){c.nav.message.style.display="none"},s.className=this.q("_message"),n.appendChild(s);var d=document.createElement("div");d.style.position="absolute",d.className=this.q("_message_close"),d.onclick=function(){c.nav.message.style.display="none"},n.appendChild(d),this.nav.top.appendChild(n),this.nav.message=n}var h=function(){var n=c.nav.message;n.firstChild.className=c.q("_message"),i.cssClass&&DayPilot.Util.addClass(n.firstChild,i.cssClass),c.nav.message.firstChild.innerHTML=e;var o=DayPilot.sw(c.nav.scroll)+1;c.nav.message.style.right=o+"px";var r=c.messageBarPosition||"Top";"Bottom"===r?(c.nav.message.style.bottom=l+"px", c.nav.message.style.top=""):"Top"===r&&(c.nav.message.style.bottom="",c.nav.message.style.top=a+"px");var s=function(){n.messageTimeout=setTimeout(c.Ea,t)};DayPilot.fade(c.nav.message,.2,s)};clearTimeout(n.messageTimeout),"none"!==this.nav.message.style.display?DayPilot.fade(c.nav.message,-.2,h):h()}},this.Ea=function(){if(c.nav&&c.nav.message){var e=function(){c.nav.message.style.display="none"};DayPilot.fade(c.nav.message,-.2,e)}},this.Lg=function(){c.nav&&c.nav.message&&(c.nav.message.style.display="none")},this.message.show=function(e){c.message(e)},this.message.hide=function(){c.Ea()},this.Mg=null,this.ja=function(){if(this.nav.scroll){!function(){var e=c.Hg();c.tg.style.height=c.Xf+"px",c.tg.style.width=e+"px","Auto"!==c.cellWidthSpec||c.Ng?e>c.nav.scroll.clientWidth?c.nav.scroll.style.overflowX="auto":c.nav.scroll.style.overflowX="hidden":(c.nav.scroll.style.overflowX="hidden",c.nav.scroll.scrollLeft=0)}();var e=1;null!==this.Mg&&(this.nav.top.style.border=this.Mg,this.Mg=null),"Parent100Pct"!==this.heightSpec&&"Max100Pct"!==this.heightSpec||(this.nav.top.style.height="100%",this.hideBorderFor100PctHeight&&(this.Mg=this.nav.top.style.border,this.nav.top.style.border="0 none"),this.height=parseInt(this.nav.top.clientHeight,10)-this.Jg()-e),this.nav.scroll.style.height="30px";var t=this.Zb(),i=t+this.Jg()+e;t>=0&&(this.nav.scroll.style.height=t+"px",this.Og.style.height=t+"px"),this.nav.divider&&((!i||isNaN(i)||i<0)&&(i=0),this.nav.divider.style.height=i+"px"),"Parent100Pct"!==this.heightSpec&&(this.nav.top.style.height=i+"px"),c.nav.resScrollSpace&&(c.nav.resScrollSpace.style.height=t+20+"px");for(var n=0;n0&&i>0){var n=i/t;c.cellWidth=Math.max(n,c.cellWidthMin),c.Ng=n0&&(i=-c.getPixels(a).left),c.startDate=c.startDate.addDays(e),c.itline=DayPilot.list(),c.t.pixels=[],c.Qg(),u.updateRowStarts(),e<0&&(i=c.getPixels(n).left),c.timeHeader=[],c.Tg(),c.cg(),c.cellProperties={},c.gg(),c.hg(),c.ba(),c.M(),"undefined"!=typeof t?(c.scrollTo(new DayPilot.Date(t)),c.pg()):c.nav.scroll.scrollLeft+=i,c.oa(),u.active=!1},this.Qg=function(){for(var e="Days"!==this.viewType?this.startDate.addDays(this.days):this.startDate.addDays(1),t=this.startDate,i=this.Wg(t),n=!1,a=0;i.ticks<=e.ticks&&i.ticks>t.ticks;){if(this.Xg(t,i)){var o=Math.floor(a+this.cellWidth),r=o-Math.floor(a),l={};l.start=t,l.end=i,l.left=Math.floor(a),l.width=r,l.breakBefore=n,this.itline.push(l),a+=this.cellWidth,n=!1}else n=!0;t=i,i=this.Wg(t)}},this.Sg=function(){if(this.timeHeader)for(var e=0;e0){if("function"==typeof this.onBeforeTimeHeaderRender){var h={};h.start=l.start,h.end=l.end,h.text=l.innerHTML,h.html=l.innerHTML,h.toolTip=l.innerHTML,h.backColor=null,h.fontColor=null,h.level=this.timeHeader.length,h.cssClass=null;var u={};u.header=h,this.onBeforeTimeHeaderRender(u),l.text=l.innerHTML,l.innerHTML=h.html,l.backColor=h.backColor,l.fontColor=h.fontColor,l.toolTip=h.toolTip,l.areas=h.areas,l.cssClass=h.cssClass}o.push(l)}r=l.end}this.timeHeader.push(o)}},this.Xg=function(e,t){if("function"==typeof this.onIncludeTimeCell){var i={};i.start=e,i.end=t,i.visible=!0;var n={};return n.cell=i,this.onIncludeTimeCell(n),i.visible}return!!this.showNonBusiness||this.isBusiness({"start":e,"end":t})},this.getPixels=function(e){var t=e.ticks,i=this.t.pixels[t];if(i)return i;var n=2218768416e5;if(0===this.itline.length||tn){var a={};a.cut=!0,a.left=s.left,a.boxLeft=a.left,a.boxRight=a.left,a.i=l;break}n=c}if(!a){var u=this.itline[this.itline.length-1],a={};a.cut=!0,a.left=u.left+u.width,a.boxLeft=a.left,a.boxRight=a.left,a.i=null}return this.t.pixels[t]=a,a},this.getDate=function(e,t,i){var n=this.ah(e,i);if(!n)return null;var a=n.x,o=this.itline[a];if(!o)return null;var r=i&&!t?o.end:o.start;return t?r.addTime(this.bh(n.cell,n.offset)):r},this.ah=function(e,t){if(0===this.itline.length)return null;for(var i=0,n=0,a=0;a0?this.itline[i-1]:null,a.current=null,a.next=this.itline[i],a}}var a={};return a.past=!0,a.previous=this.itline[this.itline.length-1],a},this._g=function(e){var t=new DayPilot.Date(e),i=0,n=this.itline[0];if(t.ticksr.end.ticks){var a={};return a.past=!0,a.previous=this.itline[this.itline.length-1],a.i=this.itline.length,a}if(t.ticks===r.end.ticks){var a={};return a.past=!1,a.current=this.itline[this.itline.length-1],a.i=this.itline.length-1,a}for(var l=function(){for(var e,n=c.itline;i<=o;)if(e=Math.floor((i+o)/2),n[e].start.ticks>t.ticks)o=e-1;else{if(!(n[e].end.ticks0?this.itline[s-1]:null,a.current=null,a.next=this.itline[s],a.i=s,a}}var a={};return a.past=!0,a.previous=this.itline[this.itline.length-1],a.i=this.itline.length,a},this.kd=function(e,t){var i=e.width||this.cellWidth,n=e.end.ticks-e.start.ticks;return Math.floor(i*t/n)},this.bh=function(e,t){var i=e.end.ticks-e.start.ticks,n=e.width||this.cellWidth;return Math.floor(t/n*i)},this.Se=function(e){DayPilot.Global.touch.start||n.preventEventClick||(A={},c.Ga(this,e))},this.eventClickPostBack=function(e,t){this.E("EventClick",e,t)},this.eventClickCallBack=function(e,t){this.G("EventClick",e,t)},this.Ga=function(e,t){var i=e.event;if(i){var t=t||window.event;if("undefined"!=typeof DayPilot.Bubble&&DayPilot.Bubble.hideActive(),!i.client.doubleClickEnabled())return void c.Ha(e,t);c.timeouts.click||(c.timeouts.click=[]);var n=function(e,t){return function(){c.Ha(e,t)}};c.timeouts.click.push(window.setTimeout(n(e,t),c.doubleClickTimeout))}},this.eh=function(e){return c.itline[e]},this.Ha=function(e,t){if("boolean"==typeof t)throw"Invalid _eventClickSingle parameters";var i=e.event,n=t.ctrlKey,a=t.metaKey;if(i.client.clickEnabled())if(c.sa()){var o={};if(o.e=i,o.div=e,o.originalEvent=t,o.ctrl=n,o.meta=a,o.shift=t.shiftKey,o.preventDefault=function(){this.preventDefault.value=!0},"function"==typeof c.onEventClick&&(c.onEventClick(o),o.preventDefault.value))return;switch(c.eventClickHandling){case"PostBack":c.eventClickPostBack(i);break;case"CallBack":c.eventClickCallBack(i);break;case"Edit":c.Ia(e);break;case"Select":c.Ja(e,i,n,a);break;case"ContextMenu":var r=i.client.contextMenu();r?r.show(i):c.contextMenu&&c.contextMenu.show(i);break;case"Bubble":c.bubble&&c.bubble.showEvent(i);break;case"RectangleSelect":if("Disabled"!==c.multiSelectRectangle)return M.start(),!1}"function"==typeof c.onEventClicked&&c.onEventClicked(o)}else switch(c.eventClickHandling){case"PostBack":c.eventClickPostBack(i);break;case"CallBack":c.eventClickCallBack(i);break;case"JavaScript":c.onEventClick(i);break;case"Edit":c.Ia(e);break;case"Select":c.Ja(e,i,n,a);break;case"ContextMenu":var r=i.client.contextMenu();r?r.show(i):c.contextMenu&&c.contextMenu.show(i);break;case"Bubble":c.bubble&&c.bubble.showEvent(i);break;case"RectangleSelect":if("Disabled"!==c.multiSelectRectangle)return M.start(),!1}},this.Pa=function(e){if(c.sa()){var t={};if(t.e=e,t.preventDefault=function(){this.preventDefault.value=!0},"function"==typeof c.onEventDelete&&(c.onEventDelete(t),t.preventDefault.value))return;switch(c.eventDeleteHandling){case"PostBack":c.eventDeletePostBack(e);break;case"CallBack":c.eventDeleteCallBack(e);break;case"Update":c.events.remove(e)}"function"==typeof c.onEventDeleted&&c.onEventDeleted(t)}else switch(c.eventDeleteHandling){case"PostBack":c.eventDeletePostBack(e);break;case"CallBack":c.eventDeleteCallBack(e);break;case"JavaScript":c.onEventDelete(e)}},this.eventDeletePostBack=function(e,t){this.E("EventDelete",e,t)},this.eventDeleteCallBack=function(e,t){this.G("EventDelete",e,t)},this.setHScrollPosition=function(e){this.nav.scroll.scrollLeft=e},this.getScrollX=function(){return this.nav.scroll.scrollLeft},this.getHScrollPosition=this.getScrollX,this.getScrollY=function(){return this.nav.scroll.scrollTop},this.Ja=function(e,t,i,n){c.db(e,t,i,n)},this.eventSelectPostBack=function(e,t,i){var n={};n.e=e,n.change=t,this.E("EventSelect",n,i)},this.eventSelectCallBack=function(e,t,i){var n={};n.e=e,n.change=t,this.G("EventSelect",n,i)},this.db=function(e,t,i,n){var a=c.multiselect,o=a.isSelected(t);if(i||n||!o||1!==a.list.length)if(c.sa()){a.previous=a.events();var r={};if(r.e=t,r.selected=o,r.ctrl=i,r.meta=n,r.preventDefault=function(){this.preventDefault.value=!0},"function"==typeof c.onEventSelect&&(c.onEventSelect(r),r.preventDefault.value))return;switch(c.eventSelectHandling){case"PostBack":c.eventSelectPostBack(t,l);break;case"CallBack":"undefined"!=typeof WebForm_InitCallback&&(window.fb="",window.gb=[],WebForm_InitCallback()),c.eventSelectCallBack(t,l);break;case"Update":a.hb(e,i,n)}"function"==typeof c.onEventSelected&&(r.change=a.isSelected(t)?"selected":"deselected",r.selected=a.isSelected(t),c.onEventSelected(r))}else{a.previous=a.events(),a.hb(e,i,n);var l=a.isSelected(t)?"selected":"deselected";switch(c.eventSelectHandling){case"PostBack":c.eventSelectPostBack(t,l);break;case"CallBack":"undefined"!=typeof WebForm_InitCallback&&(window.fb="",window.gb=[],WebForm_InitCallback()),c.eventSelectCallBack(t,l);break;case"JavaScript":c.onEventSelect(t,l)}}},this.eventRightClickPostBack=function(e,t){this.E("EventRightClick",e,t)},this.eventRightClickCallBack=function(e,t){this.G("EventRightClick",e,t)},this.La=function(e){if(!DayPilot.Global.touch.active&&!DayPilot.Global.touch.start){var t=this.event;if(e=e||window.event,e.cancelBubble=!0,!this.event.client.rightClickEnabled())return!1;if(c.sa()){var i={};if(i.e=t,i.div=this,i.originalEvent=e,i.preventDefault=function(){this.preventDefault.value=!0},"function"==typeof c.onEventRightClick&&(c.onEventRightClick(i),i.preventDefault.value))return!1;switch(c.eventRightClickHandling){case"PostBack":c.eventRightClickPostBack(t);break;case"CallBack":c.eventRightClickCallBack(t);break;case"ContextMenu":var n=t.client.contextMenu();n?n.show(t):c.contextMenu&&c.contextMenu.show(this.event);break;case"Bubble":c.bubble&&c.bubble.showEvent(t)}"function"==typeof c.onEventRightClicked&&c.onEventRightClicked(i)}else switch(c.eventRightClickHandling){case"PostBack":c.eventRightClickPostBack(t);break;case"CallBack":c.eventRightClickCallBack(t);break;case"JavaScript":c.onEventRightClick(t);break;case"ContextMenu":var n=t.client.contextMenu();n?n.show(t):c.contextMenu&&c.contextMenu.show(this.event);break;case"Bubble":c.bubble&&c.bubble.showEvent(t)}return!1}},this.eventDoubleClickPostBack=function(e,t){this.E("EventDoubleClick",e,t)},this.eventDoubleClickCallBack=function(e,t){this.G("EventDoubleClick",e,t)},this.Ka=function(e){if("undefined"!=typeof DayPilot.Bubble&&DayPilot.Bubble.hideActive(),c.timeouts.click){for(var t in c.timeouts.click)window.clearTimeout(c.timeouts.click[t]);c.timeouts.click=null}var e=e||window.event,i=this.event;if(e.stopPropagation&&e.stopPropagation(),e.cancelBubble=!0,c.sa()){var n={};if(n.e=i,n.originalEvent=e,n.preventDefault=function(){this.preventDefault.value=!0},"function"==typeof c.onEventDoubleClick&&(c.onEventDoubleClick(n),n.preventDefault.value))return;switch(c.eventDoubleClickHandling){case"PostBack":c.eventDoubleClickPostBack(i);break;case"CallBack":c.eventDoubleClickCallBack(i);break;case"Edit":c.Ia(this);break;case"Select":c.Ja(div,i,e.ctrlKey,e.metaKey);break;case"Bubble":c.bubble&&c.bubble.showEvent(i);break;case"ContextMenu":var a=i.client.contextMenu();a?a.show(i):c.contextMenu&&c.contextMenu.show(i)}"function"==typeof c.onEventDoubleClicked&&c.onEventDoubleClicked(n)}else switch(c.eventDoubleClickHandling){case"PostBack":c.eventDoubleClickPostBack(i);break;case"CallBack":c.eventDoubleClickCallBack(i);break;case"JavaScript":c.onEventDoubleClick(i);break;case"Edit":c.Ia(this);break;case"Select":c.Ja(div,i,e.ctrlKey,e.metaKey);break;case"Bubble":c.bubble&&c.bubble.showEvent(i);break;case"ContextMenu":var a=i.client.contextMenu();a?a.show(i):c.contextMenu&&c.contextMenu.show(i)}},this.eventResizePostBack=function(e,t,i,n){this.Ta("PostBack",e,t,i,n)},this.eventResizeCallBack=function(e,t,i,n){this.Ta("CallBack",e,t,i,n)},this.Ta=function(e,t,i,n,a){var o={};o.e=t,o.newStart=i,o.newEnd=n,this.Qa(e,"EventResize",o,a)},this.Sa=function(e,t,i){if("Disabled"!==this.eventResizeHandling)if(i=c.if(i),c.sa()){var n={},a=function(){if(P.hide(),!n.preventDefault.value){switch(t=n.newStart,i=n.newEnd,c.eventResizeHandling){case"PostBack":c.eventResizePostBack(e,t,i);break;case"CallBack":c.eventResizeCallBack(e,t,i);break;case"Notify":c.eventResizeNotify(e,t,i);break;case"Update":c.fh(n)}"function"==typeof c.onEventResized&&c.onEventResized(n)}};n.e=e,n.async=!1,n.loaded=function(){a()},n.newStart=t,n.newEnd=i,n.preventDefault=function(){this.preventDefault.value=!0},n.multiresize=DayPilot.list(b.list);var o={};o.event=e,o.start=t,o.end=i,n.multiresize.splice(0,0,o),"function"==typeof c.onEventResize&&c.onEventResize(n),n.async?c.blockOnCallBack&&P.show():a()}else switch(c.eventResizeHandling){case"PostBack":c.eventResizePostBack(e,t,i);break;case"CallBack":c.eventResizeCallBack(e,t,i);break;case"JavaScript":c.onEventResize(e,t,i);break;case"Notify":c.eventResizeNotify(e,t,i);break;case"Update":c.fh(n)}},this.eventMovePostBack=function(e,t,i,n,a,o){this.Xa("PostBack",e,t,i,n,a,o)},this.eventMoveCallBack=function(e,t,i,n,a,o){this.Xa("CallBack",e,t,i,n,a,o)},this.Xa=function(e,t,i,n,a,o,r){var l=t&&!!t.preventDefault,s={};if(l){var d=t;s.e=d.e,s.newStart=d.newStart,s.newEnd=d.newEnd,s.newResource=d.newResource,s.position=d.position,s.multimove=[],d.multimove.each(function(e){var t={};if(t.e=e.event,t.newStart=e.start,t.newEnd=e.end,t.newResource=e.event.resource(),t.e===d.e||t.e.data.id==d.e.data.id)t.newResource=d.newResource;else if(w.rowoffset){var i=e.event.part.dayIndex+w.rowoffset;t.newResource=c.rowlist[i].id}s.multimove.push(t)})}else s.e=t,s.newStart=i,s.newEnd=n,s.newResource=a,s.position=r;this.Qa(e,"EventMove",s,o)},this.gh=function(e,t,i){var n={};n.start=t.start,n.end=t.end,n.resource=t.resource,n.multirange=[],t.multirange.each(function(e){var t={};t.start=e.start,t.end=e.end,t.resource=e.resource,n.multirange.push(t)}),this.Qa(e,"TimeRangeSelected",n,i)},this.Qa=function(e,t,i,n){if("PostBack"===e)c.E(t,i,n);else if("CallBack"===e)c.G(t,i,n,"CallBack");else if("Immediate"===e)c.G(t,i,n,"Notify");else if("Queue"===e)c.queue.add(new DayPilot.Action(this,t,i,n));else{if("Notify"!==e)throw"Invalid event invocation type";"Notify"===_.notifyType()?c.G(t,i,n,"Notify"):c.queue.add(new DayPilot.Action(c,t,i,n))}},this.eventMoveNotify=function(e,t,i,n,a,o){if(e&&!!e.preventDefault){var r=e;r.old=new DayPilot.Event(r.e.copy(),c),r.multimove.each(function(e){e.old=new DayPilot.Event(e.event.copy(),c)}),c.fh(r),r.e=r.old,delete r.old,r.multimove.each(function(e){e.event=e.old,delete e.old})}else{e=new DayPilot.Event(e.copy(),c);var l=c.events.hh(e.data);e.start(t),e.end(i),e.resource(n),e.commit(),l=l.concat(c.events.ih(e.data)),c.jh(l),c.kh(),c.lh(l)}this.Xa("Notify",e,t,i,n,a,o)},this.eventResizeNotify=function(e,t,i,n){var a=new DayPilot.Event(e.copy(),this),o=c.events.hh(e.data);e.start(t),e.end(i),e.commit(),o=o.concat(c.events.ih(e.data)),c.jh(o),c.kh(),c.lh(o),this.Ta("Notify",a,t,i,n)},this.multiselect={},this.multiselect.list=[],this.multiselect.divs=[],this.multiselect.previous=[],this.multiselect.ig=function(e){c.multiselect.list=DayPilot.list(e).map(function(e){return new DayPilot.Event(e,c)})},this.multiselect.yb=function(){var e=c.multiselect;return DayPilot.JSON.stringify(e.events())},this.multiselect.events=function(){var e=c.multiselect,t=DayPilot.list();t.ignoreToJSON=!0;for(var i=0;i1&&n.add(e.event,!0)}else n.clear();else c.allowMultiSelect&&(t||i)?n.add(e.event,!0):(n.clear(),n.add(e.event,!0));n.gd(e),n.zb()},this.multiselect.Ab=function(e){var t=c.multiselect;return t.Bb(e,t.initList)},this.multiselect.Cb=function(){for(var e=c.multiselect,t=[],i=0;i1)){var a,o,r=c.Ie(i),l=0;if("Days"===c.viewType){l=c.sg(t).start.getTime()-c.Ba().getTime()}t.getTime()=n&&(i.end.x=n-1),i},this.ai=function(e){var t={};if(this.itline.length<=0)return t.start=this.startDate,t.end=this.startDate,t;if(!this.itline[e.start.x])throw"Internal error: area.start.x is null.";return t.start=this.itline[e.start.x].start,t.end=this.itline[e.end.x].end,t},this.bi=function(e){if(!e)var e=this._h(this.nav.scroll.scrollLeft,this.nav.scroll.scrollTop);var t=[];t.ignoreToJSON=!0;for(var i=e.start.y;i<=e.end.y;i++){var n=c.rowlist[i];n&&!n.hidden&&t.push(n.id)}return t},this.ei=function(e){if(!e)var e=this._h(this.nav.scroll.scrollLeft,this.nav.scroll.scrollTop);var t={};if(0===c.rowlist.length)return t;var i=c.itline[c.itline.length-1].end.getTime()-c.itline[0].start.getTime();return t.start=c.rowlist[e.start.y]&&c.rowlist[e.start.y].start,t.end=c.rowlist[e.end.y]&&c.rowlist[e.end.y].start.addTime(i),t},this.R=function(){var e=[];e.ignoreToJSON=!0;for(var t=0;t0||i.isNewRow)){var n=this.V(t);e.push(n)}}return e},this.W=function(e){var t=[];t.ignoreToJSON=!0;for(var i=0;i-1?"&"+l:"?"+l}DayPilot.ajax({"method":"GET","url":r,"success":o,"error":a})}};var v={};this.mi=v,v.clear=function(){c.divLinksAbove.innerHTML="",c.divLinksBelow.innerHTML="",c.elements.links=[]},v.showLinkpoints=function(){h.events().each(function(e){v.showLinkpoint(e)})},v.showLinkpoint=function(e){var t=c.linkPointSize,i=t/2,n=e.event.part.left,a=c.rowlist[e.event.part.dayIndex].top+e.event.part.top,o=e.event.part.height,r=e.event.part.right,l=DayPilot.Util.div(c.divLinkpoints,n-i,a-i+o/2,t,t);l.className=c.q("_linkpoint"),l.style.boxSizing="border-box",l.coords={x:n,y:a+o/2},l.type="Start",l.event=e.event,v.activateLinkpoint(l),c.elements.linkpoints.push(l);var s=DayPilot.Util.div(c.divLinkpoints,r-i,a-i+o/2,t,t);s.className=c.q("_linkpoint"),s.style.boxSizing="border-box",s.coords={x:r,y:a+o/2},s.type="Finish",s.event=e.event,v.activateLinkpoint(s),c.elements.linkpoints.push(s)},v.activateLinkpoint=function(e){e.onmousedown=function(t){var t=t||window.event;return s.source=e,s.calendar=c,v.showLinkpoints(),t.preventDefault&&t.preventDefault(),t.stopPropagation&&t.stopPropagation(),!1},e.onmousemove=function(t){DayPilot.Util.addClass(e,c.q("_linkpoint_hover")),v.clearHideTimeout()},e.onmouseout=function(t){s.source&&s.source.event===e.event||DayPilot.Util.removeClass(e,c.q("_linkpoint_hover"))},e.onmouseup=function(t){if(s.source){var i=s.source.type+"To"+e.type,n=s.source.event.id(),a=e.event.id(),o={};if(o.from=n,o.to=a,o.type=i,o.id=null,o.preventDefault=function(){this.preventDefault.value=!0},"function"==typeof c.onLinkCreate&&(c.onLinkCreate(o),o.preventDefault.value))return;var r=function(){DayPilot.isArray(c.links.list)||(c.links.list=[]),c.links.list.push({"from":n,"to":a,"type":i,"id":o.id}),v.load()};switch(c.linkCreateHandling){case"Update":r();break;case"CallBack":c.ni(o);break;case"PostBack":c.oi(o);break;case"Notify":r(),c.pi(o)}"function"==typeof c.onLinkCreated&&c.onLinkCreated(o)}}},v.hideLinkpoints=function(){c.divLinkpoints.innerHTML="",c.elements.linkpoints=[]},v.hideTimeout=null,v.hideLinkpointsWithDelay=function(){v.hideTimeout=setTimeout(function(){v.hideLinkpoints()},100)},v.clearHideTimeout=function(){v.hideTimeout&&(clearTimeout(v.hideTimeout),v.hideTimeout=null)},v.load=function(){if(v.clear(),DayPilot.isArray(c.links.list))for(var e=0;er.y&&(d+g>s?r.y=o.y:o.x<=r.x&&(r.y+=g,r.bottom=!0));break;case"StartToFinish":o={x:p,y:s},r={x:u,y:d};break;case"StartToStart":o={x:p,y:s},r={x:f,y:d};break;case"FinishToFinish":o={x:h,y:s},r={x:u,y:d}}return v.drawLinkXy(o,r,i)}},v.clearShadow=function(){c.divLinkShadow.innerHTML="",c.elements.linkshadow=[]},v.drawShadow=function(e,t){if(v.clearShadow(),DayPilot.browser.ielt9)v.drawShadowOldStyle(e,t);else{var i=c.divLinkShadow,n=DayPilot.line(e.x,e.y,t.x,t.y,!0);i.appendChild(n),c.elements.linkshadow.push(n)}},v.drawShadowOldStyle=function(e,t){var i=Math.min(e.x,t.x),n=2,a=c.divLinkShadow,o="black",r=DayPilot.Util.div(a,i,e.y,e.x-i,n);r.style.backgroundColor=o,c.elements.linkshadow.push(r);var l=DayPilot.Util.div(a,i,e.y,n,t.y-e.y);l.style.backgroundColor=o,c.elements.linkshadow.push(l);var s=DayPilot.Util.div(a,i,t.y,t.x-i,n);s.style.backgroundColor=o,c.elements.linkshadow.push(s);var d=DayPilot.Util.div(a,t.x-6,t.y-5,0,0);d.style.borderColor="transparent transparent transparent black",d.style.borderStyle="solid",d.style.borderWidth="6px",c.elements.linkshadow.push(d)},v.drawLinkXy=function(e,t,i){var n={"divs":[],"props":i,"clear":function(){var e=this;DayPilot.de(e.divs),e.divs.forEach(function(e){DayPilot.rfa(c.elements.links,e)})}},a=c.eventHeight/2,o=i.width||1,r=i.type||"FinishToStart",l=i.color,s=i.style,d=i.layer||"Above",h="Above"===d,u=c.divLinksAbove,f=c.eventHeight,v=c.linkBottomMargin,p=function(e,t){l&&(e.style["border"+t+"Color"]=l),s&&(e.style["border"+t+"Style"]=s)},g=[],y=function(e,t){c.elements.links.push(e),b(e),m(e),e.divs=g,t||g.push(e),n.divs.push(e)},m=function(e){e.oncontextmenu=function(e){if(e=e||window.event,c.contextMenuLink){var t=new DayPilot.Link(i,c);c.contextMenuLink.show(t)}e.cancelBubble=!0,e.preventDefault?e.preventDefault():null}},b=function(e){e.onmouseenter=function(){DayPilot.Util.addClass(e.divs,c.q("_link_hover"))},e.onmouseleave=function(){DayPilot.Util.removeClass(e.divs,c.q("_link_hover"))}};if("FinishToStart"===r)if(e.y===t.y&&e.x===t.x){var w,D=10,k=e.x-5,x=e.y+f-v-5;l?(w=DayPilot.Util.div(u,k,x,D,D),w.style.borderRadius="10px",w.style.backgroundColor=l):(w=DayPilot.Util.div(u,k,x,D,D),w.className=c.q("_link_dot"),DayPilot.Util.addClass(w,i.cssClass)),y(w,!0)}else if(e.y>t.y||e.y==t.y&&t.bottom)if(e.x<=t.x){var C=e.x,P=e.y+f-v,k=t.x+a,x=t.y,S=DayPilot.Util.div(u,C,P,k-e.x,o);S.style.boxSizing="border-box",S.style.borderBottomWidth=o+"px",S.className=c.q("_link_horizontal"),DayPilot.Util.addClass(S,i.cssClass),p(S,"Bottom"),y(S);var A=DayPilot.Util.div(u,k,P,o,x-P);A.style.boxSizing="border-box",A.style.borderRightWidth=o+"px",A.className=c.q("_link_vertical"),DayPilot.Util.addClass(A,i.cssClass),p(A,"Right"),y(A);var w;l?(w=DayPilot.Util.div(u,k-5+Math.floor(o/2),x-5,0,0),e.yt.x){var h=5,E=t.y-h,S=DayPilot.Util.div(u,e.x,e.y+f-v,a+o,o);S.style.boxSizing="border-box",S.style.borderBottomWidth=o+"px",S.className=c.q("_link_horizontal"),DayPilot.Util.addClass(S,i.cssClass),p(S,"Bottom"),y(S);var A=DayPilot.Util.div(u,e.x+a,e.y+f-v,o,E-(e.y+f-v));A.style.boxSizing="border-box",A.style.borderRightWidth=o+"px",A.className=c.q("_link_vertical"),DayPilot.Util.addClass(A,i.cssClass),p(A,"Right"),y(A);var M=DayPilot.Util.div(u,t.x-a,E,e.x+2*a+o-t.x,o);M.style.boxSizing="border-box",M.style.borderBottomWidth=o+"px",M.className=c.q("_link_horizontal"),DayPilot.Util.addClass(M,i.cssClass),p(M,"Bottom"),y(M);var H=DayPilot.Util.div(u,t.x-a,E,o,t.y-E+f-v);H.style.boxSizing="border-box",H.style.borderRightWidth=o+"px",H.className=c.q("_link_vertical"),DayPilot.Util.addClass(H,i.cssClass),p(H,"Right"),y(H);var _=DayPilot.Util.div(u,t.x-a,t.y+f-v,a,o);_.style.boxSizing="border-box",_.style.borderBottomWidth=o+"px",_.className=c.q("_link_horizontal"),DayPilot.Util.addClass(_,i.cssClass),p(_,"Bottom"),y(_);var w;l?(w=DayPilot.Util.div(u,t.x-6,t.y+f-v-5,0,0),w.style.borderWidth="6px",w.style.borderColor="transparent transparent transparent "+l,w.style.borderStyle="solid"):(w=DayPilot.Util.div(u,t.x-6,t.y+f-v-5,6,6),w.className=c.q("_link_arrow_right"),DayPilot.Util.addClass(w,i.cssClass)),y(w,!0)}else{var C=e.x,P=e.y+f-v,k=t.x+a,x=t.y,S=DayPilot.Util.div(u,C,P,k-e.x,o);S.style.boxSizing="border-box",S.style.borderBottomWidth=o+"px",S.className=c.q("_link_horizontal"),DayPilot.Util.addClass(S,i.cssClass),p(S,"Bottom"),y(S);var A=DayPilot.Util.div(u,k,P,o,x-P);A.style.boxSizing="border-box",A.style.borderRightWidth=o+"px",A.className=c.q("_link_vertical"),DayPilot.Util.addClass(A,i.cssClass),p(A,"Right"),y(A);var w;l?(w=DayPilot.Util.div(u,k-5+Math.floor(o/2),x-5,0,0),e.ythis.rowlist.length-1)throw"Row index too high (DayPilotScheduler._getRowByIndex)";for(var a=0;a<=e;a++){var o=this.rowlist[a];o.hidden||(i+=o.height,n++)}t=i-o.height;var r={};return r.top=t,r.height=o.height,r.bottom=i,r.i=n-1,r.data=o,r},this.qd=function(){return!!this.backendUrl&&("undefined"==typeof c.events.list||!c.events.list)},this.events.find=function(e){if(!c.events.list||"undefined"==typeof c.events.list.length)return null;if("function"==typeof e)return c.ri(e);for(var t=c.events.list.length,i=0;i-1?"&"+r:"?"+r,DayPilot.ajax({"method":"GET","url":o,"success":a,"error":n})}},this.events.findRecurrent=function(e,t){if(!c.events.list||"undefined"==typeof c.events.list.length)return null;for(var i=c.events.list.length,n=0;n=0&&c.events.list.splice(a,1),c.Qc.scope)c.Qc.notify();else{c.qg.skip=!0;var o=c.events.hh(e.data);if(c.eventUpdateInplaceOptimization&&1===o.length&&!c.events.zi(e)){c.Ai(c.rowlist[o[0]]);var r=c.fd(e);if(r){var a=c.elements.events.indexOf(r);c.elements.events.splice(a,1),c.xi(r)}}else c.events.yi(o)}return n},this.events.add=function(e,t){e.calendar=c,c.events.list||(c.events.list=[]),DayPilot.list(c.events.list).find(function(t){return(t instanceof DayPilot.Event?t.data:t)===e.data})||c.events.list.push(e.data);var i=new DayPilot.Action(c,"EventAdd",n,t);if(!c.A)return i;if(c.Qc.scope)c.Qc.notify();else{c.qg.skip=!0;var n={};n.e=e;var a=c.events.ih(e.data),o=e.data.height||c.eventHeight;if(c.eventUpdateInplaceOptimization&&1===a.length&&!c.events.zi(e)&&o<=c.eventHeight&&!c.eventVersionsEnabled){var r=c.rowlist[a[0]];c.Ai(r);var l=r.events.find(function(t){return t.data===e.data});l.part.top=0,l.part.height=o,l.part.line=0,c.Rb(l)}else c.events.yi(a)}return i},this.events.zi=function(e){var t=e instanceof DayPilot.Event?e.data:e,i=new DayPilot.Date(t.start),n=new DayPilot.Date(t.end);return!!DayPilot.list(c.events.list).find(function(e){if(t===e||t.id==e.id)return!1;if(t.resource!==e.resource)return!1;var a=new DayPilot.Date(e.start),o=new DayPilot.Date(e.end);return DayPilot.Util.overlaps(i,n,a,o)})},this.events.addByData=function(e){c.events.add(new DayPilot.Event(e))},this.events.removeByData=function(e){var t=c.events.find(e.id);if(!t)throw new DayPilot.Error("The event to be removed was not found");c.events.remove(t)},this.events.updateByData=function(e){var t=c.events.find(e.id);if(!t)throw new DayPilot.Error("The event to be updated was not found");c.events.remove(t),c.events.add(new DayPilot.Event(e))},this.events.removeById=function(e){var t=c.events.find(e);if(!t)throw new DayPilot.Error("The event to be removed was not found");c.events.remove(t)},this.events.si={"rows":[]},this.events.Bi=null,this.events.uh=function(){clearTimeout(c.events.Bi),c.events.si.rows=[]},this.events.queueUpdateInterval=0,this.events.yi=function(e){var t=c.events.si.rows;DayPilot.list(e).each(function(e){t.push(e)}),c.events.si.rows=DayPilot.ua(t);var i=c.events.immediateRefresh;c.events.Bi||(c.events.Bi=setTimeout(i,c.events.queueUpdateInterval))},this.events.immediateRefresh=function(){clearTimeout(c.events.Bi),c.events.Bi=null;var e=c.events.si.rows;c.events.si.rows=[],c.jh(e),c.kh(),c.A&&("Gantt"===c.viewType?c.update():(c.lh(e),c.ja(),c.Ci()))},this.qg={},this.qg.enabled=!1,this.qg.skip=!1,this.qg.skipUpdate=function(){return c.qg.skip},this.qg.skipped=function(){c.qg.skip=!1},this.queue={},this.queue.list=[],this.queue.list.ignoreToJSON=!0,this.queue.add=function(e){if(e){if(!e.isAction)throw"DayPilot.Action object required for queue.add()";c.queue.list.push(e)}},this.queue.notify=function(e){var t={};t.actions=c.queue.list,c.G("Notify",t,e,"Notify"),c.queue.list=[]},this.queue.clear=function(){c.queue.list=[]},this.queue.pop=function(){return c.queue.list.pop()},this.cells.find=function(e,t){var i=c.getPixels(new DayPilot.Date(e));if(!i)return g();var n=i.i,a=c.wg(t);if(!a)return g();var o=a.index;return this.findXy(n,o)},this.cells.findByPixels=function(e,t){var i=c.ah(e);if(!i)return g();var e=i.x,n=c.fi(t);if(!n)return g();var t=n.i;return this.findXy(e,t)},this.cells.all=function(){for(var e=[],t=c.itline.length,i=c.rowlist.length,n=0;n=a.getTime()&&e.getTime()e.ticks;)i=i.addTime(-n);return i}if("Days"===c.viewType){var a=this.Hi(e),o=a.getTime()-c.Ba().getTime(),r=this.ch(e.addTime(-o));if(r.current)return r.current.start.addTime(o);if(r.past)return r.previous.end.addTime(o);throw"getBoxStart(): time not found"}var r=this.ch(e);if(r.current)return r.current.start;if(r.past)return r.previous.end;if(r.hidden){var l=r.next.start.getTime()-e.getTime(),s=r.next.end.getTime()-r.next.start.getTime(),d=Math.ceil(l/s)*s;return r.next.start.addTime(-d)}throw"getBoxStart(): time not found"},this.Ji=function(e){var t=this.fi(c.coords.y),i=e.event;if("function"!=typeof i.end)throw"e.end function is not defined";if(!i.end())throw"e.end() returns null";var a=DayPilot.DateUtil.diff(i.rawend(),i.start());a=Math.max(a,1);var o=_.useBox(a),r=i.data&&"Milestone"===i.data.type,l=c.eventHeight,s=0,d=c.coords.x;if(r&&(d+=l/2),"Manual"===c.scale){var h=function(){var e=c.getDate(c.coords.x,!0,!0),t=e.addTime(-a),i=c.getPixels(t).boxLeft,n=c.getPixels(e).boxRight,e=Math.min(n,c.coords.x);return e-i}(),u=Math.min(n.moveOffsetX?n.moveOffsetX:0,h);d=c.coords.x-u}var f=0,v="Days"===this.viewType||this.Ki();if(v&&!i.part.external&&(f=this.rowlist[i.part.dayIndex].start.getTime()-this.Ba().getTime()),o&&!r){var p=c.ch(i.start()),g=!p.hidden&&!p.past;s=i.start().getTime()-this.Ii(i.start().addTime(-f)).addTime(f).getTime(),g&&(s=function(e,t){var i=c.Li(c.ch(e).current),n=c.Li(c.ah(d).cell);if(i>1.2*n){for(var a=t>0?1:-1,t=Math.abs(t);t>=n;)t-=n;t*=a}return t}(i.start(),s))}var y=n.movingEvent?n.movingEvent.calendar:c;y!==c&&y.Mi()!==c.Mi()&&(s=0);var m=0;if(n.moveDragStart&&"Manual"!==c.scale&&y===c){if(o){var b=i.start().addTime(-f),w=this.Ii(b);if(c.eventMoveSkipNonBusiness){var D=c.Ni(w,t.i);if(!D)throw new DayPilot.Exception("No next cell found");D.start>w&&(w=D.start)}if(m=n.moveDragStart.getTime()-w.getTime(),c.eventMoveSkipNonBusiness){var k=c.Oi(w,n.moveDragStart);m-=k}var x=60*c.Mi()*1e3;m=Math.floor(m/x)*x}else if(m=n.moveDragStart.getTime()-i.start().addTime(-f).getTime(),c.eventMoveSkipNonBusiness){var k=c.Oi(i.start().addTime(-f),n.moveDragStart);m-=k}if(c.eventMoveSkipNonBusiness){var C=c.getDate(c.coords.x,!0);m=c.Pi(C,m,t.i)}}else m=0;this.eventMoveToPosition&&(m=0);var P=this.getDate(d,!0).addTime(-m).addTime(f);n.resizing&&(P=i.start()),this.snapToGrid&&(P=this.Ii(P.addTime(-f)).addTime(f)),P=P.addTime(s);var S=P.addTime(a),A=P,T=S;if(v){A=P.addTime(-f),T=A.addTime(a);var E=t.element.data.start.getTime()-this.Ba().getTime();P=A.addTime(E),S=P.addTime(a)}!function(){if(c.eventMoveSkipNonBusiness){var e=t.i,n=c.Qi(i),a=n,o=c.Ni(A,e);if(!o)throw new DayPilot.Exception("No next cell found");var r=DayPilot.indexOf(c.itline,o);if(o.start>P)P=o.start;else{if(n-=o.end.getTime()-A.getTime(),n<=0)return S=P.addTime(a),void(T=S.addTime(-f));r+=1}A=P.addTime(-f);for(var l=r;l1.2*n){for(var a=t>0?1:-1,t=Math.abs(t);t>=n;)t-=n;t*=a}return t}(e.start(),l))}var g=n.movingEvent?n.movingEvent.calendar:c;g!==c&&g.Mi()!==c.Mi()&&(l=0);var y=0;if(n.moveDragStart&&"Manual"!==c.scale&&g===c)if(a){var m=e.start().addTime(-u),b=this.Ii(m);y=n.moveDragStart.getTime()-b.getTime();var w=60*c.Mi()*1e3;y=Math.floor(y/w)*w}else y=n.moveDragStart.getTime()-e.start().addTime(-u).getTime();else y=0;this.eventMoveToPosition&&(y=0);var D=this.getDate(s,!0).addTime(-y).addTime(u);n.resizing&&(D=e.start()),this.snapToGrid&&(D=this.Ii(D.addTime(-u)).addTime(u)),D=D.addTime(l);var k=D.addTime(i),x=D,C=k;if(f){x=D.addTime(-u),C=x.addTime(i);var P=t.element.data.start.getTime()-this.Ba().getTime();D=x.addTime(P),k=D.addTime(i)}if(n.moveDragStart&&c.eventMoveSkipNonBusiness){var S=t.i,A=n.moveDragStart.addTime(u);this.snapToGrid&&(A=this.Ii(A.addTime(-u)).addTime(u));var T=!e.part.dayIndex,E=0;T||(E=c.Ri(e.start(),A,e.part.dayIndex));var i=c.Qi(e),M=c.getDate(s,!0);c.snapToGrid&&(M=c.getDate(s));var h=c.Si(M,E,S);D=M.addTime(-h).addTime(u),this.snapToGrid&&(D=this.Ii(D.addTime(-u)).addTime(u)),l=T?0:c.Ri(this.Ii(e.start().addTime(-u)).addTime(u),e.start(),S),D=D.addTime(l),k=c.Ti(D,i,S),k>=c.visibleEnd()&&(k=c.visibleEnd(),D=k.addTime(-c.Pi(k,i))),x=D.addTime(-u),C=k.addTime(-u)}var H=this.getPixels(x),R=this.getPixels(C),B=a?H.boxLeft:H.left,N=a?R.boxRight-B:R.left-B;o&&(N=r,B-=N/2);var U={};return U.top=t.top,U.left=B,U.row=t.element,U.rowIndex=t.i,U.width=N,U.start=D,U.end=k,U.relativeY=c.coords.y-t.top,U},this.Oi=function(e,t){var i=c.ch(e),n=c.ch(t),a=null,o=0;i.hidden&&(a=e);for(var r=i.i;r<=n.i;r++){var l=c.itline[r];a&&ae);else{if(n-=l.end.getTime()-r.getTime(),n<=0)return e.addTime(t);s+=1}for(var d=s;do?t.getTime()-l.start.addTime(a).getTime():t.getTime()-e.getTime();s+=o>l.start?l.end.getTime()-o.getTime():l.end.getTime()-l.start.getTime(),d+=1}for(var h=d;ha.current.start)return t;i+=e.getTime()-a.current.start.getTime(),n-=e.getTime()-a.current.start.getTime();var o=DayPilot.indexOf(c.itline,a.current);o-=1;for(var r=a.current.start;o>=0;){var a=c.itline[o];r>a.end&&(i+=r.getTime()-a.end.getTime()),r=a.start;var l=a.end.getTime()-a.start.getTime();if(n<=l)return i+=n;i+=l,n-=l,o-=1}throw new DayPilot.Exception("Unable to backward calculate offset in visible timeline")},this.Si=function(e,t,i){var n=0,a=t,o=c.ch(e);if(!o.current)throw new DayPilot.Exception("Current cell not found.");var r=DayPilot.indexOf(c.itline,o.current);if(c.Fi(r,i).business){if(e.addTime(-t)>=o.current.start)return t}else if(0===t||e.addTime(-t)>=o.current.start)return e.getTime()-c.Ni(e,i).start.getTime();n+=e.getTime()-o.current.start.getTime(),a-=e.getTime()-o.current.start.getTime(),r-=1;for(var l=o.current.start;r>=0;){var o=c.itline[r];l>o.end&&(n+=l.getTime()-o.end.getTime()),l=o.start;var s=o.end.getTime()-o.start.getTime();if(c.Fi(r,i).business){if(a<=s)return n+=a;n+=s,a-=s}else n+=s;r-=1}return n+a},this.Ni=function(e,t){var i=c.ch(e),n=0;if(i.past)return null;if(i.current)n=i.i;else{if(!i.next)return null;n=DayPilot.indexOf(c.itline,i.next)}for(var a=n;a0){var e=c.itline[0];return(e.end.getTime()-e.start.getTime())/6e4}return c.cellDuration}throw"can't guess cellDuration value"},this.Li=function(e){return e.end.ticks-e.start.ticks},this.li=function(e){return this.treePreventParentUsage&&this.Vi(e)},this.Vi=function(e){var t=this.rowlist[e];return!!t.isParent||!!(this.treeEnabled&&t.children&&t.children.length>0)},this.Wi={},this.Xi=function(){if(c.treeAutoExpand){var e=this.ki(n.movingEvent),t=e.rowIndex,i=this.Vi(t),a=this.Wi;if(a.timeout&&a.y!==t&&(clearTimeout(a.timeout),a.timeout=null),i){a.y=t;var o=!c.rowlist[a.y].expanded;!a.timeout&&o&&(a.timeout=setTimeout(function(){!c.rowlist[a.y].expanded&&(c.Yi(a.y),c.Zi()),a.timeout=null},500))}}},this.Gc=function(){var e=n.resizingShadow.width,t=n.resizingShadow.left,i=n.resizingEvent,a=n.resizing.dpBorder,o=c.rowlist[i.part.dayIndex],r=0;r=o.start.getTime()-c.Ba().getTime();var l=null,s=null,d=!c.snapToGrid;"left"===a?(l=c.getDate(t,d).addTime(r),s=i.rawend()):"right"===a&&(l=i.start(),s=c.getDate(t+e,d,!0).addTime(r)),n.resizingShadow.start=l,n.resizingShadow.end=s,b.update()},this.exportAs=function(e,t){var i=y.generate(e,t);return new DayPilot.Export(i)},this["export"]=this.exportAs,this.nd={};var y=this.nd;y.getWidth=function(){var e=y.pd;switch(e){case"viewport":return c.nav.top.offsetWidth;case"full":return c.Hg()+y.getRowHeaderWidth();case"range":return c.getPixels(y.getRangeEnd()).boxRight-c.getPixels(y.getRangeStart()).boxLeft+y.getRowHeaderWidth();default:throw"Unsupported export mode: "+e}},y.getHeight=function(){var e=y.pd;switch(e){case"viewport":return c.nav.top.offsetHeight-DayPilot.sh(c.nav.scroll)-1;case"full":return c.$i()+c.Jg()-DayPilot.sh(c.nav.scroll);case"range":var t=y.getRows();if(0===t.length)return c.Jg();var i=t.first(),n=t.last();return n.top-i.top+n.height+c.Jg();default:throw"Unsupported export mode: "+e}},y.getRangeStart=function(){var e=y.od.dateFrom||c.Ba();return new DayPilot.Date(e)},y.getRangeEnd=function(){var e=y.od.dateTo||c.Yg();return new DayPilot.Date(e)},y.getRangeResStart=function(){return y.od.resourceFrom?c.wg(y.od.resourceFrom):c.rowlist.find(function(e){return!e.hidden})},y.getRangeResEnd=function(){return y.od.resourceTo?c.wg(y.od.resourceTo):c.rowlist.last()},y.getRowHeaderWidth=function(){return c.Kg()},y.getTimeHeaderHeight=function(){return c.Jg()},y.getCanvas=function(){return y.canvas()},y.getRectangles=function(){var e=y.getRowHeaderWidth(),t=y.getTimeHeaderHeight(),i={};i.main={"x":0,"y":0,"w":y.getWidth(),"h":y.getHeight()},i.corner={"x":0,"y":0,"w":e,"h":t},i.grid={"x":e,"y":t,"w":y.getWidth()-e,"h":y.getHeight()-t};var n=i.grid.w,a=c.itline.last();a&&a.left+a.width0){var t=c.ch(y.getRangeStart()).i,i=c.ch(y.getRangeEnd()).i,n=c.aj();i=Math.min(i,n-1),t=Math.max(t,0);for(var a=t;a<=i;a++){var o=c.itline[a];e.push(o)}e.offset=t}return e},y.getViewportTimeline=function(){var e=DayPilot.list();if(c.itline&&c.itline.length>0){var t=c.bj,i=t+c.cj,n=c.ah(t).x,a=c.ah(i,!0).x,o=c.aj();a=Math.min(a,o),n=Math.max(n,0);for(var r=n;r<=a;r++){var l=c.itline[r];e.push(l)}e.offset=n}return e},y.getTimeHeader=function(e){if("full"===y.pd)return DayPilot.list(c.timeHeader[e]);var t,i,n=DayPilot.list();t=y.getViewportOffsetStart(),i=t+y.getViewportOffsetWidth();var a=c.dj(e,t),o=c.dj(e,i);o||(o={"x":c.timeHeader[e].length-1});for(var r=a.x;r<=o.x;r++){var l=c.timeHeader[e][r];n.push(l)}return n},y.fakeDurationBar=function(){var e=document.createElement("div");e.style.display="none",e.className=c.q(E.event);var t=document.createElement("div");t.className=c.q(E.eventBar);var i=document.createElement("div");return i.className=c.q(E.eventBarInner),document.body.appendChild(e),t.appendChild(i),e.appendChild(t),e},y.fakeCell=function(){var e=document.createElement("div");e.style.display="none",e.className=c.q("_cell"),e.style.position="absolute",e.style.top="-2000px",e.style.left="-2000px";var t=document.createElement("div");return t.className=c.q("_cell_inner"),e.appendChild(t),c.divCells.appendChild(e),e},y.fakeRowHeader=function(){var e=document.createElement("div");e.style.display="none",e.className=c.q("_rowheader"),e.style.position="absolute",e.style.top="-2000px",e.style.left="-2000px";var t=document.createElement("div");return t.className=c.q("_rowheader_inner"),e.appendChild(t),c.divResScroll.appendChild(e),e},y.fakeExpand=function(){var e=document.createElement("div");return e.style.display="none",e.className=c.q("_tree_image_expand"),document.body.appendChild(e),e},y.extractUrl=function(e){var t=/url\((")?([^"].*[^"])\1\)/.exec(e);return t?t[2]:null},y.getImages=function(){var e={},t=y.fakeExpand();return e.expand=y.extractUrl(new DayPilot.StyleReader(t).get("background-image")),t.className=c.q("_tree_image_collapse"),e.collapse=y.extractUrl(new DayPilot.StyleReader(t).get("background-image")),t.className=c.q("_tree_image_no_children"),e.nochildren=y.extractUrl(new DayPilot.StyleReader(t).get("background-image")),DayPilot.de(t),e},y.getFont=function(e){return new DayPilot.StyleReader(e).getFont()},y.getViewportOffsetStart=function(){switch(y.pd){case"full":return 0;case"viewport":return c.nav.scroll.scrollLeft;case"range":return c.getPixels(y.getRangeStart()).boxLeft}},y.getViewportOffsetTop=function(){switch(y.pd){case"full":return 0;case"viewport":return c.nav.scroll.scrollTop;case"range":return y.getRangeResStart().top}},y.getViewportOffsetWidth=function(){switch(y.pd){case"full":return c.Hg();case"viewport":return c.nav.scroll.offsetWidth;case"range":return c.getPixels(y.getRangeEnd()).boxRight-y.getViewportOffsetStart()}},y.excelBoard=function(){var e=new DayPilot.Excel,t=e.worksheets.create("Scheduler"),i=new DayPilot.StyleReader(c.nav.corner).get("background-color"),n=new DayPilot.StyleReader(c.nav.top).get("border-top-color"),a=DayPilot.list(c.elements.events).map(function(e){return e.firstChild}).last(),o=new DayPilot.StyleReader(a).get("border-right-color");e.styles.getDefault().setBackColor("#ffaaaa");var r=e.styles.create();r.setHorizontalAlignment("Center"),r.setBackColor(i),r.setBorderColor(n);var l=e.styles.create();l.setVerticalAlignment("Top"),l.setBackColor(i),l.setBorderColor(n);var s=e.styles.create();s.setVerticalAlignment("Top"),s.setBackColor("#ff0000"),s.setBorderColor(o),t.enableGridlines(!1),t.cell(0,0).setRowspan(c.timeHeader.length).setStyle(r),t.cell(10,10).setText("hi there"),DayPilot.list(c.timeHeader).each(function(e,i){var n={"x":1,"y":0};y.getTimeHeader(i,"full").each(function(e,a){var o=e.colspan;t.cell(a+n.x,i+n.y).setText(e.innerHTML).setColspan(o).setStyle(r)})}),DayPilot.list(c.rowlist).each(function(e,i){for(var n={"x":0,"y":1},a="",o=0;o0&&a.fillRect(T,u)),DayPilot.list(h.areas).each(function(t){if("Hover"!==(t.visibility||t.v)){var i=t.left;t.start&&(i=c.getPixels(new DayPilot.Date(t.start)).left-e.part.left);var n=t.width||t.w;t.right?n=e.part.width-t.right-i:t.end&&(n=c.getPixels(new DayPilot.Date(t.end)).left-t.left-e.part.left+1);var o=t.top,l=t.height||t.h;"number"==typeof t.bottom&&(l=e.part.height-t.bottom-o);var d={"x":s+i,"y":r+o,"w":n,"h":l};if(t.backColor&&a.fillRect(d,t.backColor),t.image){var h=new Image;h.src=t.image,a.image(d,h)}else t.html&&a.text(d,t.html,{"size":P.fontSize,"family":P.fontFamily,"style":P.fontStyle},t.fontColor||P.fontColor,null,t.padding)}})}),a.rect(l.main,u),a.line(l.grid.x,0,l.grid.x,l.main.h,f),a.line(0,l.grid.y,l.main.w,l.grid.y,f),a}},this.hj={};var m=this.hj;m.findJointDivs=function(e){var t=e.data.join;return t?DayPilot.list(c.elements.events).filter(function(i){return i.event.data.join===t&&i.event!==e}):DayPilot.list()},this.ij={};var b=this.ij;b.divs=[],b.list=[],b.forbidden=!1,b.additional=function(){var e=DayPilot.list(),t=c.multiselect.isSelected(n.resizing.event),i=c.allowMultiResize,e=DayPilot.list();if(t&&i&&(e=DayPilot.list(c.multiselect.divs).filter(function(e){return e!==n.resizing})),c.jointEventsResize){var a=m.findJointDivs(n.resizingEvent);e=e.concat(a)}return e},b.update=function(){b.clear(),b.draw()},b.clear=function(){DayPilot.de(b.divs),b.divs=[]},b.draw=function(){if(n.resizing){var e=n.resizingEvent,t=n.resizingShadow,i=t.start.getTime()-e.start().getTime(),a=t.end.getTime()-e.end().getTime(),o=0;if(b.list=[],b.forbidden=!1,b.invalid=!1,b.rowoffset=o,b.additional().each(function(e){if(e.event){var t=e.event,n=c.rowlist[t.part.dayIndex+o];if(!n)return void(b.invalid=!0);var r=t.part.top+n.top,l=t.part.height,s=t.start().addTime(i),d=t.end().addTime(a),h={};h.event=t,h.start=s,h.end=d,h.overlapping=!1,b.list.push(h);var u=c.getPixels(s),f=c.getPixels(d),v=DayPilot.DateUtil.diff(t.rawend(),t.start());v=Math.max(v,1);var p=_.useBox(v),g=p?u.boxLeft:u.left,y=p?f.boxRight-g:f.left-g,m=document.createElement("div");m.style.position="absolute",m.style.left=g+"px",m.style.top=r+"px",m.style.height=l+"px",m.style.width=y+"px",m.style.zIndex=101,m.style.overflow="hidden",m.className=c.q("_shadow"),m.info=h;var w=document.createElement("div");w.className=c.q("_shadow_inner"),m.appendChild(w),c.tg.appendChild(m),b.divs.push(m)}}),b.invalid){var r=c.q("_shadow_overlap");return void DayPilot.list(b.divs).each(function(e){DayPilot.Util.addClass(e,r)})}DayPilot.list(b.divs).each(function(e){if(e.info){var t=e,i=e.info,a=e.info.event,r=c.rowlist[a.part.dayIndex+o],l=c.getPixels(i.start),s=c.getPixels(i.end),d=l.left,h=s.left-d,u=DayPilot.list(b.list).map(function(e){return e.event.data}).add(n.resizing.event.data);c.jj(t,r,d,h,u),t.overlapping&&(i.overlapping=!0,b.forbidden=!0)}})}},this.kj={},this.kj.modifiedProps=function(){var e=new DayPilot.Scheduler,t=DayPilot.Util.members(c,2),i=[];return i.push("
"),i.push(""),i.join("\n")},this.lj={};var w=this.lj;w.divs=[],w.list=[],w.forbidden=!1,w.verticalAll=function(){return"All"===c.multiMoveVerticalMode},w.additional=function(){var e=DayPilot.list(),t=c.multiselect.isSelected(n.movingEvent),i=c.allowMultiMove,e=DayPilot.list();if(t&&i&&(e=DayPilot.list(c.multiselect.divs).filter(function(e){return e!==n.moving&&e!==A.moving})),c.jointEventsMove){var a=m.findJointDivs(n.movingEvent);e=e.concat(a)}return e},w.update=function(){w.clear(),w.draw()},w.draw=function(){if(n.moving){var e=n.movingEvent,t=n.movingShadow.start,i=t.getTime()-e.start().getTime(),a=e.part.dayIndex,o=DayPilot.indexOf(c.rowlist,n.movingShadow.row),r=o-a;if(w.verticalAll()||(r=0),w.list=[],w.forbidden=!1,w.invalid=!1,w.rowoffset=r,w.additional().each(function(e){if(e.event){var t=e.event,n=c.rowlist[t.part.dayIndex+r];if(!n)return void(w.invalid=!0);var a=t.part.top+n.top,o=t.part.height;r&&(a=n.top,o=n.height);var l=t.start().addTime(i),s=t.end().addTime(i),d={};d.event=t,d.start=l,d.end=s,d.resource=n.id,d.overlapping=!1,w.list.push(d);var h=c.getPixels(l),u=c.getPixels(s),f=DayPilot.DateUtil.diff(t.rawend(),t.start());f=Math.max(f,1);var v=_.useBox(f),p=v?h.boxLeft:h.left,g=v?u.boxRight-p:u.left-p,y=document.createElement("div");y.style.position="absolute",y.style.left=p+"px",y.style.top=a+"px",y.style.height=o+"px",y.style.width=g+"px",y.style.zIndex=101,y.style.overflow="hidden",y.className=c.q("_shadow"),y.info=d;var m=document.createElement("div");m.className=c.q("_shadow_inner"),y.appendChild(m),c.tg.appendChild(y),w.divs.push(y)}}),w.invalid){var l=c.q("_shadow_overlap");return void DayPilot.list(w.divs).each(function(e){DayPilot.Util.addClass(e,l)})}DayPilot.list(w.divs).each(function(e){if(e.info){var t=e,i=e.info,a=e.info.event,o=c.rowlist[a.part.dayIndex+r],l=c.getPixels(i.start),s=c.getPixels(i.end),d=l.left,h=s.left-d,u=DayPilot.list(w.list).map(function(e){return e.event.data}).add(n.movingEvent.data);c.jj(t,o,d,h,u),t.overlapping&&(i.overlapping=!0,w.forbidden=!0)}})}},w.clear=function(){DayPilot.de(w.divs),w.divs=[]},this.mj=function(){var e=c.coords,t=n.resizing.dpBorder,i=n.resizing.event,a=i.part.left;"right"==t&&(a+=i.part.width);var o,r,l=n.resizing.event.calendar.cellWidth,s=n.resizing.event.part.width,d=n.resizing.event.part.left,h=0,u=e.x-a;if("right"===t){if(o=d,c.snapToGrid){var f=c.ah(s+d+u).cell;r=f.left+f.width-d,rv&&(r=v-d),n.resizingShadow.left=d,n.resizingShadow.width=r}else{if("left"!==t)throw"Invalid dpBorder.";c.snapToGrid?(u>=s&&(u=s),o=Math.floor((d+u+0)/l)*l,ol.part.height/2&&(o=l.part.top+l.part.height+c.eventMarginBottom/2,a+=1))}else{for(var e=t.relativeY,n=t.row,s=0,d=c.vc.eventHeight(),h=n.lines.length,u=0;u0&&(o-=3);var r=i.cache&&"undefined"!=typeof i.cache.moveVDisabled?!i.cache.moveVDisabled:!i.data.moveVDisabled,l=i.cache&&"undefined"!=typeof i.cache.moveHDisabled?!i.cache.moveHDisabled:!i.data.moveHDisabled,s=!w.additional().isEmpty();if(s&&"Disabled"===c.multiMoveVerticalMode&&(r=!1),r)if(this.li(t.rowIndex)){var d=e.row,h=1;if(!d)return;h=t.rowIndex0?0:f.lines.length-1,e.style.top=t.top+o+"px",e.style.height="3px",e.line=a);break}}}else e.row=t.row,e.style.height=Math.max(t.row.height,0)+"px",e.style.top=t.top+"px",c.eventMoveToPosition&&(e.style.top=t.top+o+"px",e.style.height="3px",e.line=a);else{for(var d=c.rowlist[i.part.dayIndex],p=d.lines.length,u=0;ud.index&&p>0?p*c.vc.eventHeight()-3:0;e.style.top=d.top+g+"px",e.style.height="3px",e.line=0}}l?(e.style.left=t.left+"px",c.eventMoveToPosition?e.style.width=c.cellWidth+"px":e.style.width=t.width+"px",e.start=t.start,e.end=t.end):(e.style.left=i.part.left+"px",e.start=i.start(),e.end=i.rawend(),t.left=i.part.left),function(){var n=e.row,a=i.data,o=t.width,r=t.left,l=DayPilot.list(w.list).map(function(e){return e.event.data}).add(a);c.jj(e,n,r,o,l)}(),function(){var t=c.Hc;if(!t||t.start.getTime()!==e.start.getTime()||t.end.getTime()!==e.end.getTime()||t.resource!==e.row.id){w.update();var r=!!n.drag&&i.part.external,l={};l.start=e.start,l.end=c.if(e.end),l.duration=new DayPilot.Duration(l.start,l.end),l.e=i,l.external=r,l.resource=e.row.id,l.html=null,l.row=c.Nh(e.row),l.position=e.line,l.overlapping=e.overlapping||w.forbidden,l.allowed=!0,l.left={},l.left.html=l.start.toString(c.eventMovingStartEndFormat,_.locale()),l.left.enabled=c.eventMovingStartEndEnabled,l.left.space=5,l.left.width=null,l.right={},l.right.html=l.end.toString(c.eventMovingStartEndFormat,_.locale()),l.right.enabled=c.eventMovingStartEndEnabled,l.right.space=5,l.right.width=null,l.multimove=DayPilot.list(w.list),l.shift=c.coords.shift,l.ctrl=c.coords.ctrl,l.meta=c.coords.meta,l.alt=c.coords.alt,l.areaData=DayPilot.Global.movingAreaData,l.link=null;var s={};s.event=i,s.start=l.start,s.end=l.end,s.overlapping=l.overlapping,s.resource=l.resource,l.multimove.splice(0,0,s),c.Hc=l;var d={"start":l.start,"end":l.end,"resource":l.resource};if("function"==typeof c.onEventMoving&&c.onEventMoving(l),e.allowed=l.allowed,l.start!==d.start||l.end!==d.end){var h=l.start,u=c.Ie(l.end);e.start=h,e.end=u;var f=DayPilot.DateUtil.diff(h,u);f=Math.max(f,1);var p=_.useBox(f),g=p?c.getPixels(h).boxLeft:c.getPixels(h).left,y=p?c.getPixels(u).boxRight:c.getPixels(u).left;e.style.left=g+"px",e.style.width=y-g+"px"}if(l.resource!==d.resource){var m=c.wg(l.resource);m&&(e.row=m,e.style.height=Math.max(m.height,0)+"px",e.style.top=m.top+"px",c.eventMoveToPosition&&(e.style.top=m.top+o+"px",e.style.height="3px",e.line=a))}l.html?e.firstChild.innerHTML=l.html:e.firstChild.innerHTML="",c.oj(e,l),c.pj(n.movingShadow,l),l.link&&(DayPilot.Global.movingLink&&DayPilot.Global.movingLink.clear(),DayPilot.Global.movingLink=v.drawLink(l.link.from,e,l.link))}}()}}},this.jj=function(e,t,i,n,a){if(!c.allowEventOverlap){!function(){e.overlapping=!1;for(var o=0;o0&&(a.style.left=s+"px",a.style.top=i.top-c.nav.scroll.scrollTop+c.Jg()+"px",c.nav.top.appendChild(a),c.elements.hover.push(a))}var n=t.right.width||10,d=document.createElement("div");if(d.style.position="absolute",d.style.left=i.right+t.right.space+"px",d.style.top=i.top+"px",d.style.height=c.eventHeight+"px",d.style.overflow="hidden",d.style.boxSizing="border-box",t.right.width?d.style.width=t.right.width+"px":d.style.whiteSpace="nowrap",d.innerHTML=t.right.html,d.className=this.q("_event_move_right"),d.onmousemove=c.rj,t.right.enabled){c.divHover.appendChild(d);var h=c.nav.scroll.scrollWidth;i.right+t.right.space+d.offsetWidth>=h&&c.divHover.removeChild(d)}}},this.qj=function(){c.divHover.innerHTML="",DayPilot.de(c.elements.hover),c.elements.hover=[]},this.tj=function(){var e=c.rowHeaderColumnDefaultWidth;this.rowHeaderColumns&&(this.rowHeaderCols=DayPilot.Util.propArray(this.rowHeaderColumns,"width",e))},this.sj=function(){var e=0;if(this.tj(),this.rowHeaderCols)for(var t=0;tthis.rowHeaderCols[o]&&(this.rowHeaderCols[o]=n[o],e=!0),t+=this.rowHeaderCols[o]);else t=this.rowHeaderWidth,this.rowHeaderWidth0?(r.expanded?n.className=c.q("_tree_image_collapse"):n.className=c.q("_tree_image_expand"),n.style.cursor="pointer",n.index=e,n.onclick=function(e){c.Yi(this.index),e=e||window.event,e.cancelBubble=!0}):n.className=c.q("_tree_image_no_children"):(n.className=c.q("_tree_image_expand"),n.style.cursor="pointer",n.index=e,n.onclick=function(e){c.Jj(this.index),e=e||window.event,e.cancelBubble=!0}),v.appendChild(n)}var a=document.createElement("div");c.treeEnabled&&(a.style.marginLeft=t+i+"px"),a.innerHTML=h.html,d.textDiv=a,d.cellDiv=f,v.appendChild(a)}(),d.appendChild(f),t.appendChild(d),i.rows[e].cells.push(d),r.columns&&0!==r.columns.length)for(var w=u,D=1;D0?a:1,f.style.width=o+"px"}}},this.Gj=function(){var e=this.row;return e.contextMenu&&e.contextMenu.show(c.Nh(e)),!1},this.Hj=function(e){if(!x.cancelClick){var t=this.row,i=c.Nh(t,this.index);return t.isNewRow?void c.Th.edit(t):void c.Qh(i,e.ctrlKey,e.shiftKey,e.metaKey)}},this.Ij=function(e){if(c.timeouts.resClick){for(var t in c.timeouts.resClick)window.clearTimeout(c.timeouts.resClick[t]);c.timeouts.resClick=null}var i=this.row,n=c.Nh(i,this.index);if(c.sa()){var a={};if(a.resource=n,a.row=n,a.preventDefault=function(){this.preventDefault.value=!0},"function"==typeof c.onRowDoubleClick&&(c.onRowDoubleClick(a),a.preventDefault.value))return;switch(c.rowDoubleClickHandling){case"PostBack":c.rowDoubleClickPostBack(n);break;case"CallBack":c.rowDoubleClickCallBack(n);break;case"Select":c.Sh(i,e.ctrlKey,e.shiftKey,e.metaKey);break;case"Edit":c.Th.edit(i)}"function"==typeof c.onRowDoubleClicked&&c.onRowDoubleClicked(a)}else switch(c.rowDoubleClickHandling){case"PostBack":c.rowDoubleClickPostBack(n);break;case"CallBack":c.rowDoubleClickCallBack(n);break;case"JavaScript":c.onRowDoubleClick(n);break;case"Select":c.Sh(i,e.ctrlKey,e.shiftKey,e.metaKey);break;case"Edit":c.Th.edit(i)}},this.rowDoubleClickPostBack=function(e,t){var i={};i.resource=e,this.E("RowDoubleClick",i,t)},this.rowDoubleClickCallBack=function(e,t){var i={};i.resource=e,this.G("RowDoubleClick",i,t)},this.Kj=function(e){var t={};t.start=this.cell.start,t.level=this.cell.level,t.end=this.cell.end,t.end||(t.end=new DayPilot.Date(t.start).addMinutes(c.cellDuration)),c.Uh(t)},this.Nh=function(e){return new DayPilot.Row(e,c)},this.Vg=function(e){var t=this.rowlist[e];if(t.events||t.resetEvents(),!t.data){t.data={},t.data.start=new DayPilot.Date(t.start),t.data.startTicks=t.data.start.getTime();var i=this.Yg().getTime()-this.Ba().getTime();t.data.end=_.isResourcesView()?t.data.start.addTime(i):t.data.start.addDays(1),t.data.endTicks=t.data.end.getTime(),t.data.offset=t.start.getTime()-this.Ba().getTime(),t.data.i=e}},this.ba=function(e){if(e?this.events.list=e:this.events.list||(this.events.list=[]),null!=this.events.list&&!DayPilot.isArray(this.events.list))throw"DayPilot.Scheduler.events.list expects an array object";D.prepareRows(!0);for(var t,i=this.events.list,n=i.length,a="function"==typeof this.onBeforeEventRender,o="Resources"===c.viewType,r=0;r=t.data.endTicks)||a===o&&a===t.data.startTicks;break;case"Resources":s=(t.id===e.resource||"*"===t.id||"*"===e.resource)&&(!(o<=t.data.startTicks||a>=t.data.endTicks)||a===o&&a===t.data.startTicks);break;case"Gantt":s=t.id===e.id&&!(o<=t.data.startTicks||a>=t.data.endTicks)}if(!s)return null;var d=new DayPilot.Event(e,c);d.part.dayIndex=t.data.i,d.part.start=t.data.startTickso?n:t.data.end;var h=this.getPixels(d.part.start.addTime(-t.data.offset)),u=this.getPixels(d.part.end.addTime(-t.data.offset));d.part.start===d.part.end&&(u=this.getPixels(d.part.end.addTime(-t.data.offset).addSeconds(1))),r&&r.height?d.part.height=r.height:e.height&&(d.part.height=e.height),d.part.Oj=function(){var e=this.height;if(c.eventVersionsEnabled&&!DayPilot.list(d.data.versions).isEmpty()){var t=d.versions.length;e+=t*c.eventVersionHeight,e+=t*c.eventVersionMargin}return e+c.eventMarginBottom};var f=h.left,v=u.left;if(d.part.startPixels=h,d.part.endPixels=u,f===v){if(h.cut||u.cut)return null;var p=(d.part.start.addTime(-t.data.offset).getTime()+d.part.end.addTime(-t.data.offset).getTime())/2;if(c.getPixels(new DayPilot.Date(Math.floor(p))).cut)return null}d.part.box=_.useBox(o-a);var g=c.eventHeight;if("Milestone"===e.type){var y=e.width||g;d.part.end=d.part.start,d.part.left=f-y/2,d.part.width=y,d.part.barLeft=0,d.part.barWidth=y}else if(d.part.box){var m=h.boxLeft,b=u.boxRight;d.part.left=m,d.part.width=b-m,d.part.barLeft=Math.max(f-d.part.left,0),d.part.barWidth=Math.max(v-f,1)}else d.part.left=f,d.part.width=Math.max(v-f,1),d.part.barLeft=0,d.part.barWidth=Math.max(v-f-1,1);if(c.eventVersionsEnabled&&c.Pj(d,t),"function"==typeof c.onEventFilter&&c.events.bd){var w={};if(w.filter=c.events.bd,w.visible=!0,w.e=d,c.onEventFilter(w),!w.visible)return null}return t.events.push(d),d}},this.Pj=function(e,t){e.versions=[];var i=e.data,n=DayPilot.list(i.versions);n.isEmpty()||n.each(function(i){var n=new DayPilot.Date(i.start),a=new DayPilot.Date(i.end),o=c.getPixels(n.addTime(-t.data.offset)),r=c.getPixels(a.addTime(-t.data.offset));n.ticks===a.ticks&&(r=c.getPixels(a.addTime(-t.data.offset).addTime(1)));var l=o.left,s=r.left;if(l===s&&(o.cut||r.cut))return null;var d={};d.left=l,d.continueLeft=nt.data.end,d.width=s-l,e.versions.push(d)})},this.cd=function(e,t){if(!(e&&t&&e.start&&t.start))return 0;var i=e.start().ticks-t.start().ticks;return 0!==i?i:t.end().ticks-e.end().ticks},this.dd=function(e,t){if(!e||!t)return 0;if(!(e.data&&t.data&&e.data.sort&&t.data.sort&&0!==e.data.sort.length&&0!==t.data.sort.length))return c.cd(e,t);for(var i=0,n=0;0===i&&"undefined"!=typeof e.data.sort[n]&&"undefined"!=typeof t.data.sort[n];)i=e.data.sort[n]===t.data.sort[n]?0:"number"==typeof e.data.sort[n]&&"number"==typeof t.data.sort[n]?e.data.sort[n]-t.data.sort[n]:c.ed(e.data.sort[n],t.data.sort[n],c.sortDirections[n]),n++;return i},this.ed=function(e,t,i){var n="desc"!==i,a=n?-1:1,o=-a;if(null===e&&null===t)return 0;if(null===t)return o;if(null===e)return a;var r=[];return r[0]=e,r[1]=t,r.sort(),e===r[0]?a:o},this.Sh=function(e,t,i,n){if(c.sa()){var a=DayPilot.indexOf(c.rowlist,e),o=c.Nh(e,a),r=DayPilot.indexOf(x.selected,e)!==-1,l=r?"deselected":"selected",s={};if(s.row=o,s.selected=r,s.ctrl=t,s.shift=i,s.meta=n,s.preventDefault=function(){this.preventDefault.value=!0},"function"==typeof c.onRowSelect&&(c.onRowSelect(s),s.preventDefault.value))return;var d=i&&!t&&!n;if(i||(x.Qj={"row":e,"index":a}),d){x.fixRowSelectLast();var h=x.Qj.index,u=a;x.selectRange(h,u)}switch(c.rowSelectHandling){case"PostBack":c.rowSelectPostBack(o,l);break;case"CallBack":c.rowSelectCallBack(o,l);break;case"Notify":!d&&x.select(e,t,i,n),c.rowSelectNotify(o,l);break;case"Update":!d&&x.select(e,t,i,n)}"function"==typeof c.onRowSelected&&(s.selected=DayPilot.indexOf(x.selected,e)!==-1,c.onRowSelected(s))}else{x.select(e,t,i);var a=DayPilot.indexOf(c.rowlist,e),o=c.Nh(e,a),r=DayPilot.indexOf(x.selected,e)!==-1,l=r?"deselected":"selected";switch(c.rowSelectHandling){case"PostBack":c.rowSelectPostBack(o,l);break;case"CallBack":c.rowSelectCallBack(o,l);break;case"Notify":c.rowSelectNotify(o,l);break;case"JavaScript":c.onRowSelect(o,l)}}},this.rowSelectPostBack=function(e,t,i){var n={};n.resource=e,n.change=t,this.E("RowSelect",n,i)},this.rowSelectCallBack=function(e,t,i){var n={};n.resource=e,n.change=t,this.G("RowSelect",n,i)},this.rowSelectNotify=function(e,t,i){var n={};n.resource=e,n.change=t,this.G("RowSelect",n,i,"Notify")},this.rows={},this.rows.selection={};var k=this.rows.selection;k.get=function(){var e=[];return DayPilot.list(x.selected).each(function(t){e.push(c.Nh(t))}),e},k.clear=function(){x.clearSelection()},k.add=function(e){if(!e||!e.isRow)throw"DayPilot.Scheduler.rows.selection.add(): DayPilot.Row object expected"; DayPilot.list(x.selected).some(function(t){return t===e.$.row})||x.selected.push(e.$.row),x.Rj(),k.Sj()},k.remove=function(e){if(!e||!e.isRow)throw"DayPilot.Scheduler.rows.selection.remove(): DayPilot.Row object expected";k.isSelected(e)&&(x.unselect(e.$.row),DayPilot.rfa(x.selected,e.$.row)),k.Sj()},k.isSelected=function(e){if(!e||!e.isRow)throw"DayPilot.Scheduler.rows.selection.isSelected(): DayPilot.Row object expected";return DayPilot.indexOf(x.selected,e.$.row)!==-1},k.Sj=function(){c.selectedRows=DayPilot.list(x.selected).map(function(e){return e.id})},this.rows.all=function(){for(var e=[],t=0;t0&&t.push(a.index)}if(0!==t.length)if(1===t.length)c.Yi(t[0]);else{for(var n=0;n-1)){var t=c.wg(x.Qj.row.id);t?(e=DayPilot.indexOf(c.rowlist,t),x.Qj={"row":t,"index":e}):x.rowSelectLastSetDefault()}},x.createOverlay=function(e){var t=c.sj(),i=c.q("_rowmove_source"),n=DayPilot.Util.div(c.divHeader,0,e.top,t,e.height);n.className=i,e.moveOverlay=n},x.deleteOverlay=function(e){DayPilot.de(e.moveOverlay),e.moveOverlay=null},x.Zj=function(e){var t=x.$j(e),i=t.cells[0];if(i.input)return i.input;DayPilot.Areas.disable(i.firstChild);var n=i.clientWidth;e.isNewRow&&(n=c.Kg());var o=document.createElement("textarea");o.style.position="absolute",o.style.top="0px",o.style.left="0px",o.style.width=n+"px",o.style.height=e.height+"px",o.style.border="0px none",o.style.overflow="hidden",o.style.boxSizing="border-box",o.style.resize="none",o.style.paddingLeft=e.level*c.treeIndent+"px";var r=i.textDiv;o.style.fontFamily=DayPilot.gs(r,"fontFamily")||DayPilot.gs(r,"font-family"),o.style.fontSize=DayPilot.gs(r,"fontSize")||DayPilot.gs(r,"font-size"),o.value=e.name||"",i.firstChild.appendChild(o),i.input=o;var l=function(){try{i.input.parentNode.removeChild(i.input)}catch(e){a()}i.input=null};return o.focus(),o.onblur=function(){o.onblur=null;var t=o.value;l(),DayPilot.Areas.enable(i.firstChild),c.Ph(e,t,o.canceled)},o.onkeydown=function(e){var t=window.event?event.keyCode:e.keyCode;return 27===t&&(o.canceled=!0,l()),13!==t||(o.onblur(),!1)},o.setSelectionRange?o.setSelectionRange(0,9999):o.select(),o},x.selected=[],x.select=function(e,t,i,n){var a=DayPilot.indexOf(x.selected,e)!==-1;if(t||n){if(a)return x.unselect(e),void DayPilot.rfa(x.selected,e)}else a=!1,x.clearSelection();x._j(e),a||x.selected.push(e),k.Sj()},x.selectRange=function(e,t){x.clearSelection();for(var i=Math.min(e,t),n=Math.max(e,t),a=i;a<=n;a++){var o=c.rowlist[a];x._j(o),x.selected.push(o)}k.Sj()},x.Rj=function(){for(var e=0;e0){var a=C.findInArray(n.children,t);if(a)return a}}return null},this.ag=function(){this.rowlist=DayPilot.list();var e=this.resources,t=this.r();t||("Gantt"===this.viewType?e=this.bk():"Days"===this.viewType&&(e=this.ck())),!t||"Days"!==this.viewType||e&&0!==e.length||(e=this.ck());var i={};if(i.i=0,null!=e&&!DayPilot.isArray(e))throw"DayPilot.Scheduler.resources expects an array object";this.dk(e,i,0,null,this.treeEnabled,!1),"Disabled"!==c.rowCreateHandling&&this.ek()},this.ek=function(){var e={};e.id="NEW",e.isNewRow=!0,e.html="",e.index=c.rowlist.length,e.loaded=!0,e.start=this.startDate,e.children=[],e.height=c.eventHeight,e.marginBottom=0,e.marginTop=0,e.getHeight=function(){return c.rowCreateHeight?c.rowCreateHeight:c.eventHeight+c.rowMarginBottom+c.rowMarginTop},e.putIntoLine=function(){},e.resetEvents=function(){},this.rowlist.push(e)},this.bk=function(){var e=[];if(this.Rf&&this.resources)for(var t=0;t0?this.itline[0].start:this.startDate},this.Yg=function(){if(this.itline&&this.itline.length>0){var e=c.itline[this.itline.length-1].end;return"Days"!==c.viewType?e:e.addDays(c.days-1)}return c.startDate.addDays(c.days)},this.fk={};this.fk;this.visibleStart=function(){return this.Ba()},this.visibleEnd=function(){return this.Yg()},this.Wj=function(e,t){var i={};if(i.backColor=e.backColor,i.cssClass=e.cssClass,i.expanded=e.expanded,i.name=e.name,i.html=e.html?e.html:i.name,i.eventHeight="undefined"!=typeof e.eventHeight?e.eventHeight:c.vc.eventHeight(),i.minHeight="undefined"!=typeof e.minHeight?e.minHeight:c.rowMinHeight,i.marginBottom="undefined"!=typeof e.marginBottom?e.marginBottom:c.rowMarginBottom,i.marginTop="undefined"!=typeof e.marginTop?e.marginTop:c.rowMarginTop,i.eventStackingLineHeight="undefined"!=typeof e.eventStackingLineHeight?e.eventStackingLineHeight:c.eventStackingLineHeight,i.loaded=!e.dynamicChildren,i.id=e.id||e.value,i.toolTip=e.toolTip,i.children=[],i.columns=[],i.start=e.start?new DayPilot.Date(e.start):this.Ba(),i.isParent=e.isParent,i.contextMenu=e.contextMenu?DayPilot.Util.evalVariable(e.contextMenu):this.contextMenuResource,i.areas=e.areas,i.moveDisabled=e.moveDisabled,i.bubbleHtml=e.bubbleHtml,i.tags=e.tags,i.task=e.task,i.swimlane=e.swimlane,i.hideEvents=e.hideEvents,i.height=i.eventHeight,i.resource=e.gk,i.lines=[],i.blocks=[],i.isRow=!0,i.getHeight=function(){var e=0;if(c.groupConcurrentEvents)for(var t=0;t0){var n=this.lines.length-1,a=this.lines[n],o=a.height||this.eventHeight,r=a.top||0;e=r+o}return 0===e&&(e=this.eventHeight),e>this.minHeight?e:this.minHeight},i.resetEvents=function(){var e=this;e.events=DayPilot.list(),e.events.forRange=function(t,i){t=new DayPilot.Date(t),i=new DayPilot.Date(i);for(var n=DayPilot.list(),a=0;at&&(t=a)}return t},i},n}for(var i=this,n=i.sections=t(),a=0;ai.height&&(i.height=t)},i.isFree=function(e,t,i){for(var n=e+t-1,a=this.length,o=0;or.part.left+r.part.width-1)){if(DayPilot.contains(i,r.data))continue;return!1}}return!0},i.add(e),this.lines.push(i),this.lines.length-1},i.putIntoBlock=function(e){for(var t=0;ti.height&&(i.height=e.part.height)},i.isFree=function(e,t){for(var i=e+t-1,n=this.length,a=0;ao.part.left+o.part.width-1))return!1}return!0},i.add(e),this.lines.push(i)},i.overlapsWith=function(e,t){return!(e+t-1this.max-1)},i.getHeight=function(){if(!this.expanded)return c.eventHeight;if(this.lines.length>0){var e=this.lines.length-1,t=this.lines[e],i=t.height||c.eventHeight;return(t.top||0)+i}return c.eventHeight},i.clear=function(){i.events=DayPilot.list(),i.min=null,i.max=null},i.events.push(e),e.part.block=i,i.min=e.part.left,i.max=e.part.left+e.part.width,this.blocks.push(i)},i.hk=!1,i.ik=t,i.jk=function(){this.hidden=!this.kk(),this.hk=!1,this.ik&&this.ik.jk()},i.kk=function(){return!this.ik||this.ik.kk()&&this.ik.expanded},e.columns)for(var n=0;n0){r.columns=[];for(var i=0;i0){i.columns=[];for(var a=0;a0,v=function(){for(var e=i.i,t=a.level;e>=0;){var n=c.rowlist[e];if(e--,!(t<=n.level)){if(n===l.row)return!0;if(0===n.level)return!1;t=n.level}}return!1}(),p=c.treeEnabled;u=v||i.i===l.row.index?"forbidden":p?f?o1){var r=o.cells[0];t(r,e)}else if(this.rowHeaderCols)for(var l=0,s=0;s0){var i=document.createElement("div");i.style.position="absolute",i.style.top="0px",i.style.left="0px",i.style.right="0px",i.style.bottom=_.headerHeight()+1+"px",e.appendChild(i);var n=document.createElement("div");n.style.position="absolute",n.style.left="0px",n.style.right="0px",n.style.height="1px",n.style.bottom=_.headerHeight()+"px",n.className=this.q("_divider"),e.appendChild(n),i.appendChild(t),this.tk()}else e.appendChild(t);var a=document.createElement("div");a.style.position="absolute",a.style.padding="2px",a.style.top="0px",a.style.left="1px",a.style.backgroundColor="#FF6600",a.style.color="white",a.innerHTML="DEMO",DayPilot.Util.isNullOrUndefined("K5woOes")&&e.appendChild(a)},this.rk=function(){var e=3,t=this.Kg()+_.splitterWidth()-1,i=10,n=20,a=this.Jg()+e,o=DayPilot.Util.div(this.nav.top,t,a,i,n);o.style.cursor="pointer",o.className=c.q("_header_icon"),DayPilot.Util.addClass(o,c.q("_header_icon_hide")),o.onclick=function(){c.rows.headerToggle()},this.nav.hideIcon=o},this.xh=function(){c.nav.hideIcon&&(c.rowlist.length>0&&c.rowHeaderHideIconEnabled?c.nav.hideIcon.style.display="":c.nav.hideIcon.style.display="none")},this.xc=function(){var e=this.Kg(),t=document.createElement("div");return c.nav.corner=t,t.style.width=e+"px",t.style.height=this.Jg()+"px",t.style.overflow="hidden",t.style.position="relative",t.setAttribute("unselectable","on"),t.onmousemove=function(){c.S()},t.oncontextmenu=function(){return!1},this.wh(),t},this.Jg=function(){if(c.timeHeaders){var e=R.timeHeader(c.timeHeaders.length-1);return e.top+e.height}return this.timeHeader?c.timeHeader.length*_.headerHeight():0},this.uk=null,this.vk=function(){return c.scrollStep||c.eventHeight},this.nk=function(){var e=document.createElement("div");e.style.width=this.Kg()+"px",e.style.height=this.Zb()+"px",e.style.overflow="hidden",e.style.position="relative",e.className=c.q("_rowheader_scroll");var t=c.vk(),i=navigator.userAgent.indexOf("Mobile")!==-1;return i&&(e.style.overflowY="auto"),e.onmousemove=function(){c.S()},e.onscroll=function(){if(c.nav.columnScroll&&c.rowHeaderScrolling&&(c.nav.columnScroll.scrollLeft=e.scrollLeft),c.uk&&clearTimeout(c.uk),i){var t=c.$i()-c.nav.scroll.offsetHeight;e.scrollTop=Math.min(e.scrollTop,t),c.nav.scroll.scrollTop=e.scrollTop}else c.uk=setTimeout(function(){c.nav.scroll.scrollTop=e.scrollTop},500)},e.addEventListener("wheel",function(i){var n;n=c.overrideWheelScrolling?i.deltaY>0?t:-t:i.deltaY,c.nav.scroll.scrollTop=e.scrollTop+n,i.preventDefault&&i.preventDefault()},!1),e.oncontextmenu=function(){return!1},e.onmouseenter=function(){c.rowHeaderScrolling&&(e.style.overflowX="auto")},e.onmouseleave=function(){c.rowHeaderScrolling&&(e.style.overflowX="hidden")},e.setAttribute("role","region"),e.setAttribute("aria-label","scheduler rows"),this.divResScroll=e,this.Og=e,e},this.wk=function(e){if("TableBased"===_.layout()){var t=parseInt(this.width,10),i=isNaN(t)||this.width.indexOf("%")!==-1,n=(/MSIE/i.test(navigator.userAgent),this.sj());i?this.nav.top&&this.nav.top.offsetWidth>0&&(e.style.width=this.nav.top.offsetWidth-6-n+"px"):e.style.width=t-n+"px"}},this.pe=function(e){c.eg(),c.pg()},this.eg=function(){"TableBased"===c.vc.layout()&&(c.wk(c.nav.scroll),c.wk(c.divTimeScroll)),c.ja(),c.xj(),c.xk(),c.t.drawArea=null},this.yk=null,this.ii=null,this.zk=function(){c.watchWidthChanges&&(c.ii||(this.ii=setInterval(function(){return c.nav&&c.nav.top?(c.yk||(c.yk={},c.yk.counter=0,c.yk.changed=!1,c.yk.width=c.nav.top.offsetWidth),c.yk.width!==c.nav.top.offsetWidth&&(c.yk.changed=!0,c.yk.counter=0,c.yk.width=c.nav.top.offsetWidth),c.yk.changed&&(c.yk.counter+=1),void(c.yk.changed&&c.yk.counter>2&&(c.yk.changed=!1,c.eg(),c.pg()))):void clearInterval(c.ii)},20)))},this.xk=function(){var e=c.rangeHold;c.clearSelection(),c.rangeHold=e,c.Jh(e,!0)},this.xj=function(){c.A&&"Auto"===c.cellWidthSpec&&(c.$f(),c._f(),c.cg(),c.gg(),c.jg(),c.hg(),c.kg(),c.M(),c.ba(),c.oa(),c.ja())},this.$f=function(){if("Auto"===this.cellWidthSpec){var e=this.nav.top.clientWidth,t=this.Kg(),i=c.Ak(),n=e-t-i;if(this.aj()){var a=n/this.aj();this.cellWidth=Math.max(a,c.cellWidthMin),c.Ng=ac.height?DayPilot.sw(c.nav.scroll):0}return DayPilot.sw(c.nav.scroll)},this.Rg=function(){var e=this.nav.top.clientWidth,t=this.Kg(),i=this.Zb(),n=this.$i(),a="Auto"===c.heightSpec,o=0;return n>i&&!a&&(o=DayPilot.swa()),e-t-2-o},this.pk=function(){var e=document.createElement("div");e.style.overflow="hidden",e.style.position="absolute",e.style.display="block",e.style.top="0px",e.style.width="100%",e.style.height=this.Jg()+"px",e.style.overflow="hidden",e.onmousemove=function(){c.S(),c.cellBubble&&c.cellBubble.delayedHide()},this.wk(e),this.divTimeScroll=e;var t=document.createElement("div");return t.style.width=this.aj()*this.cellWidth+5e3+"px",this.divNorth=t,e.appendChild(t),e},this.Zb=function(){var e=0,t=c.heightSpec;return"Fixed"===t||"Parent100Pct"===t?this.height?this.height:0:(e=c.$i(),("Max"===t||"Max100Pct"===t)&&e>c.height?c.height:e)},this.Bk=null,this.Ck=0,this.Dk=0,this.Ek=0,this.Pg=function(){if("function"==typeof c.onHeightChanged||"function"==typeof c.onDimensionsChanged){c.Bk&&clearTimeout(c.Bk);var e=function(){var e=c.nav.top.offsetHeight,t=c.Ck;c.Ck=e;var i=c.nav.top.offsetWidth,n=c.Dk;c.Dk=i;var a=c.Kg(),o=c.Ek;if(c.Ek=a,"function"==typeof c.onHeightChanged&&e!==t){var r={};r.oldHeight=t,r.newHeight=e,c.onHeightChanged(r)}if("function"==typeof c.onDimensionsChanged&&(e!==t||i!==n||a!==o)){var r={};r.oldHeight=t,r.newHeight=e,r.oldWidth=n,r.newWidth=i,r.oldRowHeaderWidth=o,r.newRowHeaderWidth=a,c.onDimensionsChanged(r)}};c.Bk=setTimeout(e,100)}},this.$i=function(){var e;return this.Xf!==-1?(e=this.Xf, this.Xf>0&&"auto"===c.nav.scroll.style.overflowX&&(e+=DayPilot.sh(c.nav.scroll))):e=this.rowlist.length*this.vc.eventHeight(),e},this.S=function(){this.T(),this.Fk(),this.Gk(),this.qj(),c.cellBubble&&c.cellBubble.hideOnMouseOut(),c.bubble&&c.bubble.hideOnMouseOut()},this.qk=function(){var e=document.createElement("div");if(e.style.overflow="auto",e.style.overflowX="auto",e.style.overflowY="auto",e.style.position="absolute",e.style.height=this.Zb()+"px",e.style.top=this.Jg()+1+"px",e.style.width="100%",e.className=this.q("_scrollable"),e.oncontextmenu=function(){return!1},this.wk(e),c.overrideWheelScrolling){var t=c.scrollStep;e.onwheel=function(i){var n=i.deltaY>0?t:-t;c.nav.scroll.scrollTop=e.scrollTop+n,i.preventDefault&&i.preventDefault()},e.onmousewheel=function(i){i=i||window.event;var n=i.wheelDelta<0?t:-t;c.nav.scroll.scrollTop=e.scrollTop+n,i.preventDefault&&i.preventDefault(),i.returnValue=!1}}this.nav.scroll=e,this.tg=document.createElement("div"),this.tg.style.MozUserSelect="none",this.tg.style.KhtmlUserSelect="none",this.tg.style.webkitUserSelect="none",this.tg.daypilotMainD=!0,this.tg.calendar=this,i&&(this.tg.style.webkitTransform="translateZ(0px)"),this.tg.style.position="absolute";var n=this.Hg();return n>0&&!isNaN(n)&&(this.tg.style.width=n+"px"),this.tg.setAttribute("unselectable","on"),this.tg.onmousedown=this.Hk,this.tg.onmousemove=this.rj,this.tg.onmouseup=this.Ik,this.tg.oncontextmenu=this.Jk,this.tg.ondblclick=this.Kk,this.tg.className=this.q("_matrix"),this.divStretch=document.createElement("div"),this.divStretch.style.position="absolute",this.divStretch.style.height="1px",this.tg.appendChild(this.divStretch),this.divCells=document.createElement("div"),this.divCells.style.position="absolute",this.divCells.oncontextmenu=this.Jk,this.tg.appendChild(this.divCells),this.divLines=document.createElement("div"),this.divLines.style.position="absolute",this.divLines.oncontextmenu=this.Jk,this.tg.appendChild(this.divLines),this.divBreaks=document.createElement("div"),this.divBreaks.style.position="absolute",this.divBreaks.oncontextmenu=this.Jk,this.tg.appendChild(this.divBreaks),this.divSeparators=document.createElement("div"),this.divSeparators.style.position="absolute",this.divSeparators.oncontextmenu=this.Jk,this.tg.appendChild(this.divSeparators),this.divLinksBelow=document.createElement("div"),this.divLinksBelow.style.position="absolute",this.tg.appendChild(this.divLinksBelow),this.divCrosshair=document.createElement("div"),this.divCrosshair.style.position="absolute",this.divCrosshair.ondblclick=this.Kk,this.tg.appendChild(this.divCrosshair),this.divRange=document.createElement("div"),this.divRange.style.position="absolute",this.divRange.oncontextmenu=this.Jk,this.tg.appendChild(this.divRange),this.divEvents=document.createElement("div"),this.divEvents.style.position="absolute",this.tg.appendChild(this.divEvents),this.divSeparatorsAbove=document.createElement("div"),this.divSeparatorsAbove.style.position="absolute",this.divSeparatorsAbove.oncontextmenu=this.Jk,this.tg.appendChild(this.divSeparatorsAbove),this.divLinksAbove=document.createElement("div"),this.divLinksAbove.style.position="absolute",this.tg.appendChild(this.divLinksAbove),this.divLinkShadow=document.createElement("div"),this.divLinkShadow.style.position="absolute",this.tg.appendChild(this.divLinkShadow),this.divLinkpoints=document.createElement("div"),this.divLinkpoints.style.position="absolute",this.tg.appendChild(this.divLinkpoints),this.divRectangle=document.createElement("div"),this.divRectangle.style.position="absolute",this.tg.appendChild(this.divRectangle),this.divHover=document.createElement("div"),this.divHover.style.position="absolute",this.tg.appendChild(this.divHover),this.divShadow=document.createElement("div"),this.divShadow.style.position="absolute",this.tg.appendChild(this.divShadow),e.appendChild(this.tg),e},this.Lk={};var P=this.Lk;P.create=function(){if(!c.nav.overlay){var e=document.createElement("div");e.style.position="absolute",e.style.left="0px",e.style.right="0px",e.style.top="0px",e.style.bottom="0px",e.className=c.q("_block"),c.nav.top.appendChild(e),c.nav.overlay=e}},P.show=function(){P.create(),c.nav.overlay.style.display=""},P.hide=function(){c.nav.overlay&&(c.nav.overlay.style.display="none")},this.H=function(e){c.loadingTimeout&&window.clearTimeout(c.loadingTimeout);var t=e?0:100;c.loadingTimeout=window.setTimeout(function(){c.loadingLabelVisible&&(c.nav.loading.innerHTML=c.loadingLabelText,c.nav.loading.style.display=""),c.blockOnCallBack&&P.show()},t)},this.X=function(){this.loadingTimeout&&window.clearTimeout(this.loadingTimeout),this.nav.loading.style.display="none",this.blockOnCallBack&&P.hide()},this.uiBlock=function(){P.show()},this.uiUnblock=function(){P.hide()},this.hd=function(){this.startDate=new DayPilot.Date(this.startDate).getDatePart()},this.md=function(e){var t=document.createElement("div");t.style.position="absolute",t.style.top="-2000px",t.style.left="-2000px",t.className=this.q(e),document.body.appendChild(t);var i=t.offsetHeight,n=t.offsetWidth;document.body.removeChild(t);var a={};return a.height=i,a.width=n,a},this.ra=function(e){if(e&&(this.autoRefreshEnabled=!0),this.autoRefreshEnabled&&!(this.B>=this.autoRefreshMaxCount)){this.L();var t=this.autoRefreshInterval;if(!t||t<10)throw"The minimum autoRefreshInterval is 10 seconds";this.autoRefreshTimeout=window.setTimeout(function(){c.Vc()},1e3*this.autoRefreshInterval)}},this.L=function(){this.autoRefreshTimeout&&(window.clearTimeout(this.autoRefreshTimeout),this.autoRefreshTimeout=null)},this.autoRefreshStart=function(e){c.ra(e)},this.autoRefreshPause=function(){c.L()},this.Mk=function(){return!(n.resizing||n.moving||n.drag||n.range)},this.Vc=function(){if(c.Mk()){var e=!1;if("function"==typeof this.onAutoRefresh){var t={};t.i=this.B,t.preventDefault=function(){this.preventDefault.value=!0},c.onAutoRefresh(t),t.preventDefault.value&&(e=!0)}!e&&this.r()&&this.commandCallBack(this.autoRefreshCommand),this.B++}this.Ba.height&&(a.height=l),r.part.top=i+e.marginTop;var s="Above"===c.eventVersionPosition;if(c.eventVersionsEnabled&&!DayPilot.list(r.data.versions).isEmpty()){var d=(r.data.versions.length,r.part.top);s||(d+=r.part.height+c.eventVersionMargin),DayPilot.list(r.data.versions).each(function(e,t){if(r.versions[t]){var i=t*(c.eventVersionHeight+c.eventVersionMargin);r.versions[t].top=d+i,s&&(r.part.top+=c.eventVersionHeight,r.part.top+=c.eventVersionMargin)}})}r.part.top+=c.eventMarginBottom,r.part.detachedBarTop=r.part.top-t,r.part.right=r.part.left+r.part.width,r.part.fullTop=this.rowlist[r.part.dayIndex].top+r.part.top,r.part.fullBottom=r.part.fullTop+r.part.height}}i+=(a.height||e.eventHeight)*e.eventStackingLineHeight/100}};var S={};S.loadRow=function(e){e.evColumns=DayPilot.list(c.itline).map(function(e,t){return{"events":DayPilot.list()}}),DayPilot.list(e.events).each(function(t){var i=t.start(),n=c.ch(i);e.evColumns[n.i].events.push(t)})},S.calculateEventPositions=function(){var e=c.cellStackingAutoHeight,t=0;DayPilot.list(c.rowlist).each(function(i){var n=0;i.evColumns.each(function(t,a){var o=c.itline[a],r=c.rowMarginTop;t.events.each(function(t){t.part.left=o.left,t.part.width=o.width,t.part.top=r,t.part.height||(e?t.part.height=S.getEventAutoHeight(t)+c.durationBarHeight:t.part.height=i.eventHeight),r+=t.part.height+c.eventMarginBottom}),t.height=r,t.height>n&&(n=t.height)}),i.maxColumnHeight=n,i.top=t;var a=i.height;i.height=i.getHeight(),n>c.rowMarginTop&&(i.height=n+c.rowMarginBottom),a!==i.height&&(c.Ah=!0),t+=i.height}),c.Xf=t},S.getEventAutoHeight=function(e){var t=e.client.html(),i=document.createElement("div");i.style.position="absolute",i.style.top="-2000px",i.style.left="-2000px",i.style.width=e.part.width+"px",i.className=c.q(E.event);var n=document.createElement("div");n.className=c.q(E.eventInner),n.innerHTML=t,n.style.position="static",n.style.overflow="auto",i.appendChild(n);var a=c.divEvents;a.appendChild(i);var o=i.offsetHeight;return a.removeChild(i),o},S.calculateEventPositionsRow=function(e){S.calculateEventPositions()},S.drawEventsWithoutCheckingOverflow=function(){DayPilot.list(c.rowlist).each(function(e){S.drawEventsRow(e)})},S.drawEvents=function(){S.drawEventsWithoutCheckingOverflow(),S.checkOverflow(),c.fg(),c.ja()},S.checkOverflow=function(){if(c.cellStackingAutoHeight){var e=!1;DayPilot.list(c.elements.events).each(function(t){var i=t.firstChild,n=i.offsetHeight-i.clientHeight+t.offsetHeight-t.clientHeight,a=i.scrollHeight+n,o=t.event.part.height;t.event.part.height=a,o!==a&&(e=!0)}),e&&(c.M(),S.calculateEventPositions(),S.drawEventsWithoutCheckingOverflow(),c.gg(),c.jg())}},S.drawEventsRow=function(e){e.evColumns.each(function(e,t){e.events.each(function(e){c.Rb(e)})})},this.oa=function(e){if(!c.Gd){if(c.cellStacking)return void S.drawEvents();var t=this.Ok.step;this.Ok.layers&&(c.divEvents=document.createElement("div"),c.divEvents.style.position="absolute",c.tg.insertBefore(this.divEvents,this.divSeparatorsAbove)),"display"===this.Ok.mode?this.divEvents.style.display="none":"visibility"===this.Ok.mode&&(this.divEvents.style.visibility="hidden"),this.divEvents.setAttribute("role","region"),this.divEvents.setAttribute("aria-label","scheduler events");for(var i="Progressive"===this.dynamicEventRendering,n=this.yg(),a=n.pixels.top,o=n.pixels.bottom,r=c.allowMultiMove||c.allowMultiResize,l=0;l=h)){this.ej(s);for(var u=0;u=0;n--)this.elements.events.splice(i[n],1)}},this.xi=function(e){e.parentNode&&e.parentNode.removeChild(e),e.onclick=null,e.oncontextmenu=null,e.onmouseover=null,e.onmouseout=null,e.onmousemove=null,e.onmousedown=null,e.ondblclick=null,e.event&&(e.isBar||(e.event.rendered=null),e.event=null),e.related&&DayPilot.de(e.related)},this.Pk=function(e){e.event&&(e.event.rendered=!1),e.onclick=null,e.onmousedown=null,e.event=null,e.parentNode&&e.parentNode.removeChild(e)},this.Qk=function(e){if(e||(e=0),"Progressive"===this.dynamicEventRendering){this.divEvents.style.display="none";for(var t=[],i=0,n=this.elements.events.length,a=n-1;a>=0;a--){var o=this.elements.events[a];this.Rk(o.event)?e>0?(e--,t.unshift(o)):(this.xi(o),i++):t.unshift(o)}this.elements.events=t,this.divEvents.style.display=""}},this.Sk=function(e){for(var t=[],i=0,n=this.yg(),a=this.elements.cells.length,o=a-1;o>=0;o--){var r=this.elements.cells[o];n.xStart0?(e--,t.unshift(r)):(this.Ei(r),i++)}},this.Ei=function(e){if(e){var t=e.coords.x,i=e.coords.y;DayPilot.rfa(c.elements.cells,e),DayPilot.de(e),c.t.cells[t+"_"+i]=null}},this.hg=function(){if(this.elements.separators)for(var e=0;e=r))for(var l=0;l=o)},this.Rk=function(e){if(!e.rendered)return!0;var t=this.yg(),i=t.pixels.top,n=t.pixels.bottom,a=t.pixels.left-this.dynamicEventRenderingMargin,o=t.pixels.right+this.dynamicEventRenderingMargin,r=e.part.left,l=e.part.right,s=e.part.fullTop,d=e.part.fullBottom;return o<=r||a>=l||(n<=s||i>=d)},this.Nj=DayPilot.list(),this.Vk=function(e){if(e.rendered)return!1;if(e.row.hidden)return!1;var t=e.min,i=e.max-e.min,n=c.eventHeight,a=e.row.top,o=document.createElement("div");o.style.position="absolute",o.style.left=t+"px",o.style.top=a+"px",o.style.width=i+"px",o.style.height=n+"px",o.className=c.q("_event_group"),o.style.cursor="pointer";var r={};r.group={},r.group.count=e.events.length,r.group.events=DayPilot.list(e.events,!0),r.group.html="[+] "+e.events.length+" events","function"==typeof c.onBeforeGroupRender&&c.onBeforeGroupRender(r);var l=document.createElement("div");return l.innerHTML=r.group.html,o.appendChild(l),o.onmousedown=function(e){var e=e||window.event;e.cancelBubble=!0},o.onclick=function(e){var t=o.event;t.expanded=!0,c.Pk(o);var i=DayPilot.indexOf(c.elements.events,o);i!==-1&&c.elements.events.splice(i,1);var n=c.Nj;DayPilot.list(t.events).each(function(e){n.push(e.id())}),c.kh(),c.lh(t.part.dayIndex),c.ja();var e=e||window.event;e.cancelBubble=!0},e.part={},e.part.left=t,e.part.width=i,e.part.height=c.eventHeight,e.part.dayIndex=DayPilot.indexOf(c.rowlist,e.row),e.part.top=0,e.part.isBlock=!0,e.client={},e.client.html=function(){return r.group.html},e.data={},o.event=e,this.elements.events.push(o),this.divEvents.appendChild(o),e.rendered=!0,!0},this.Rb=function(e){if(e.rendered)return!1;if(c.groupConcurrentEvents){var t=e.part.block;if(t.events.length>1&&!t.expanded)return c.Vk(t)}var i="Progressive"===this.dynamicEventRendering,n=this.yg(),a=n.pixels.left-this.dynamicEventRenderingMargin,o=n.pixels.right+this.dynamicEventRenderingMargin,r=e.part.left,l=e.part.left+e.part.width,s=c.multiselect.Ab(e);if(i&&(o<=r||a>=l||s))return!1;var d=e.part.dayIndex,h=e.part.width,u=e.part.height,f=e.cache||e.data;h=Math.max(0,h),u=Math.max(0,u);var v=this.rowlist[d];if(v.hidden)return!1;var p=v.top,g=this.durationBarDetached,y=document.createElement("div");if(y.related=[],g){var m=e.part.barLeft,b=e.part.barWidth;"PercentComplete"===this.durationBarMode&&(m=0,b=(f.complete||0)/100*h);var w=document.createElement("div");w.style.position="absolute",w.style.left=e.part.left+m+"px",w.style.top=p+e.part.detachedBarTop+"px",w.style.width=b+"px",w.style.height="5px",w.style.backgroundColor="black",w.type="detachedBar",y.related.push(w),this.divEvents.appendChild(w)}if(function(t){c.eventVersionsEnabled&&DayPilot.list(e.data.versions).each(function(i,n){if(i){var a=e.versions[n];if(a){var o=document.createElement("div");o.style.position="absolute",o.style.left=a.left+"px",o.style.top=p+a.top+"px",o.style.width=a.width+"px",o.style.height=c.eventVersionHeight+"px",o.className=c.q(E.event)+" "+c.q("_event_previous")+" "+c.q("_event_version"),i.toolTip&&(o.title=i.toolTip),i.cssClass&&DayPilot.Util.addClass(o,i.cssClass);var r=document.createElement("div");r.setAttribute("unselectable","on"),r.className=c.q(E.eventInner),r.innerHTML=i.html||i.text||"",i.backColor&&(r.style.background=i.backColor,(DayPilot.browser.ie9||DayPilot.browser.ielt9)&&(r.style.filter="")),i.fontColor&&(r.style.color=i.fontColor),i.borderColor&&(r.style.borderColor=i.borderColor),i.backImage&&(r.style.backgroundImage="url("+i.backImage+")",i.backRepeat&&(r.style.backgroundRepeat=i.backRepeat)),o.appendChild(r),a.continueLeft&&DayPilot.Util.addClass(o,c.q("_event_continueleft")),a.continueRight&&DayPilot.Util.addClass(o,c.q("_event_continueright"));var l=c.durationBarVisible&&!i.barHidden,s=a.width;if(l&&s>0){var d=100*a.barLeft/s,h=Math.ceil(100*a.barWidth/s);"PercentComplete"===c.durationBarMode&&(d=0,h=i.complete||0);var u=document.createElement("div");u.setAttribute("unselectable","on"),u.className=c.q(E.eventBar),u.style.position="absolute",i.barBackColor&&(u.style.backgroundColor=i.barBackColor);var f=document.createElement("div");f.setAttribute("unselectable","on"),f.className=c.q(E.eventBarInner),f.style.left=d+"%",00){var m=100*e.part.barLeft/h,b=Math.ceil(100*e.part.barWidth/h);"PercentComplete"===this.durationBarMode&&(m=0,b=f.complete||0);var w=document.createElement("div");w.setAttribute("unselectable","on"),w.className=this.q(E.eventBar),w.style.position="absolute",f.barBackColor&&(w.style.backgroundColor=f.barBackColor);var A=document.createElement("div");A.setAttribute("unselectable","on"),A.className=this.q(E.eventBarInner),A.style.left=m+"%",00&&(n=n.concat(o)),DayPilot.Areas.showAreas(t,t.event,null,n),DayPilot.Util.addClass(t,c.q("_event_hover")),c.Yk(t)}"Disabled"===c.linkCreateHandling||s.source||(v.clearHideTimeout(),v.hideLinkpoints(),c.Mk()&&v.showLinkpoint(t)),e.srcElement?e.srcElement.insideEvent=!0:e.insideEvent=!0},this.$k={};var A=this.$k;this.Wk=function(e){if(c.ionicEventClickFix){var t=A.originalMouse;if(t){var i=DayPilot.mc(e);t.x===i.x&&t.y===i.y&&(c.Se.call(this,e),e.preventDefault(),e.stopPropagation())}}},this.Ub=function(e){if(c.S(),"undefined"!=typeof DayPilot.Bubble&&(DayPilot.Bubble.hideActive(),DayPilot.Bubble.cancelShowing()),e=e||window.event,!c.coords){var t=c.tg;c.coords=DayPilot.mo3(t,e)}var i=DayPilot.Util.mouseButton(e);if(e.preventDefault(),e.stopPropagation(),i.left){var a=e.shiftKey;if("Disabled"!==c.multiSelectRectangle&&a)return M.start(),!1;"w-resize"===this.style.cursor||"e-resize"===this.style.cursor?(n.preventEventClick=!0,n.resizing=this,n.resizingEvent=this.event,n.originalMouse=DayPilot.mc(e),document.body.style.cursor=this.style.cursor,v.hideLinkpoints()):("move"===this.style.cursor||"Full"===c.moveBy&&this.event.client.moveEnabled())&&(A.start=!0,A.moving=this,A.movingEvent=this.event,A.originalMouse=DayPilot.mc(e),A.moveOffsetX=DayPilot.mo3(this,e).x,A.moveDragStart=c.getDate(c.coords.x,!0),v.hideLinkpoints())}DayPilot.Menu&&DayPilot.Menu.active&&DayPilot.Menu.active.hide()},this.Vb={};var T=c.Vb;"undefined"==typeof DayPilot.Global.touch&&(DayPilot.Global.touch={}),DayPilot.Global.touch.active=!1,DayPilot.Global.touch.start=!1,T.timeouts=[],T.onEventTouchStart=function(e){if(!DayPilot.Global.touch.active&&!DayPilot.Global.touch.start){e.stopPropagation(),T.clearTimeouts(),DayPilot.Global.touch.start=!0,DayPilot.Global.touch.active=!1;var i=this,n=c.tapAndHoldTimeout;T.timeouts.push(window.setTimeout(function(){DayPilot.Global.touch.active=!0,DayPilot.Global.touch.start=!1,c.coords=T.relativeCoords(e),e.preventDefault();var n=i.event;switch(c.eventTapAndHoldHandling){case"Move":if(n.client.moveEnabled()){var a=t(e);T.startMoving(i,a)}break;case"ContextMenu":DayPilot.Menu&&DayPilot.Menu.touchPosition(e);var o=n.client.contextMenu();o?o.show(n):c.contextMenu&&c.contextMenu.show(n)}},n))}},T.onEventTouchMove=function(e){T.clearTimeouts(),DayPilot.Global.touch.start=!1},T.onEventTouchEnd=function(e){if(!DayPilot.Util.isMouseEvent(e)){if(T.clearTimeouts(),DayPilot.Global.touch.start){DayPilot.Global.touch.start=!1,e.preventDefault(),e.stopPropagation();var t=this;window.setTimeout(function(){c.Ha(t,e)})}window.setTimeout(function(){DayPilot.Global.touch.start=!1,DayPilot.Global.touch.active=!1},500)}},T.onMainTouchStart=function(e){if(!(DayPilot.Global.touch.active||DayPilot.Global.touch.start||e.touches.length>1||"Disabled"===c.timeRangeSelectedHandling)){T.clearTimeouts(),DayPilot.Global.touch.start=!0,DayPilot.Global.touch.active=!1;var t=c.tapAndHoldTimeout;T.timeouts.push(window.setTimeout(function(){DayPilot.Global.touch.active=!0,DayPilot.Global.touch.start=!1,e.preventDefault(),c.coords=T.relativeCoords(e),T.range=c._k()},t));c.coords=T.relativeCoords(e)}},T.onMainTouchMove=function(e){if(T.clearTimeouts(),DayPilot.Global.touch.start=!1,n.resizing)return e.preventDefault(),void T.updateResizing();if(DayPilot.Global.touch.active){if(e.preventDefault(),c.coords=T.relativeCoords(e),n.moving)return void T.updateMoving();if(T.range){var t=T.range;t.end={x:Math.floor(c.coords.x/c.cellWidth)},c.Jh(t)}}},T.onMainTouchEnd=function(e){T.clearTimeouts();if(DayPilot.Global.touch.active){if(n.moving){e.preventDefault();var t=n.movingEvent;if(c!==n.movingShadow.calendar)return;var i=n.movingShadow.start,a=n.movingShadow.end,o="Days"!==c.viewType?n.movingShadow.row.id:null,r=n.drag&&t.part.external,l=n.movingShadow.overlapping,s=!n.movingShadow.allowed;if(DayPilot.Util.removeClass(n.moving,c.q(c.al.eventMovingSource)),DayPilot.de(n.movingShadow),c.qj(),n.movingShadow.calendar=null,document.body.style.cursor="",n.moving=null,n.movingEvent=null,n.movingShadow=null,c.lj.clear(),l||s||c.lj.forbidden||c.lj.invalid)return;c.Va(t,i,a,o,r)}if(T.range){var d=T.range;T.range=null;var h=c.elements.range2;h&&h.overlapping?c.clearSelection():c.Gh(d)}}else if(DayPilot.Global.touch.start){if(c.coords.xi.start.x?i.start.x:i.end.x,r=i.end.x>i.start.x?i.end.x:i.start.x,l=0;l=t.start.getTime()-this.Ba().getTime();var s=this.itline[o].start.addTime(l),d=this.itline[r].end.addTime(l);return new DayPilot.Selection(s,d,a,c); },this.vb=function(e){var t=e.parentNode,i=c.eventEditMinWidth,n=document.createElement("textarea");return n.style.position="absolute",n.style.width=(e.offsetWidth0&&(this.divStretch.style.width=o+"px")}},this.$g=function(e,t){var i=null,n=this.vc.locale(),t=t||this.cellGroupBy,a=e.start;e.end;switch(t){case"Hour":i="Clock12Hours"===c.vc.timeFormat()?a.toString("h tt",n):a.toString("H",n);break;case"Day":i=a.toString(n.datePattern);break;case"Week":i=1===_.weekStarts()?a.weekNumberISO():a.weekNumber();break;case"Month":i=a.toString("MMMM yyyy",n);break;case"Quarter":i="Q"+Math.floor(a.getMonth()/3+1);break;case"Year":i=a.toString("yyyy");break;case"None":i="";break;case"Cell":var o=(e.end.ticks-e.start.ticks)/6e4;i=this.fl(a,o);break;default:throw"Invalid cellGroupBy value"}return i},this.fl=function(e,t){var i=this.vc.locale(),t=t||this.cellDuration;return t<60?e.toString("mm"):t<1440?"Clock12Hours"===c.vc.timeFormat()?e.toString("h tt",i):e.toString("H",i):t<10080?e.toString("d"):10080===t?1===_.weekStarts()?e.weekNumberISO():e.weekNumber():e.toString("MMMM yyyy",i)},this.Wg=function(e){var t=this.scale;switch(t){case"Cell":throw"Invalid scale: Cell";case"Manual":throw"Internal error (addScaleSize in Manual mode)";case"Minute":return e.addMinutes(1);case"CellDuration":return e.addMinutes(this.cellDuration);default:return this.Zg(e,t)}},this.Zg=function(e,t){var i,n="Days"!==this.viewType?this.days:1,a=this.startDate.addDays(n);"Manual"===c.scale&&(a=c.Yg());var t=t||this.cellGroupBy,o=60;switch(t){case"Hour":e.getHours()+e.getMinutes()+e.getSeconds()+e.getMilliseconds()>0&&(e=e.getDatePart().addHours(e.getHours())),i=e.addHours(1);break;case"Day":i=e.getDatePart().addDays(1);break;case"Week":for(i=e.getDatePart().addDays(1);i.dayOfWeek()!==_.weekStarts();)i=i.addDays(1);break;case"Month":i=e.addMonths(1),i=i.firstDayOfMonth();for(var r=DayPilot.DateUtil.diff(i,e)/6e4%o===0;!r;)i=i.addHours(1),r=DayPilot.DateUtil.diff(i,e)/6e4%o===0;break;case"Quarter":for(i=e.addMonths(1),i=i.firstDayOfMonth();i.getMonth()%3;)i=i.addMonths(1);for(var r=DayPilot.DateUtil.diff(i,e)/6e4%o===0;!r;)i=i.addHours(1),r=DayPilot.DateUtil.diff(i,e)/6e4%o===0;break;case"Year":i=e.addYears(1),i=i.firstDayOfYear();for(var r=DayPilot.DateUtil.diff(i,e)/6e4%o===0;!r;)i=i.addHours(1),r=DayPilot.DateUtil.diff(i,e)/6e4%o===0;break;case"None":i=a;break;case"Cell":var l=this.ch(e);i=l.current?l.current.end:l.past?l.previous.end:l.next.start;break;default:throw"Invalid cellGroupBy value"}return i.getTime()>a.getTime()&&(i=a),i},this.al={},this.al.timeheadercol="_timeheadercol",this.al.timeheadercolInner="_timeheadercol_inner",this.al.resourcedivider="_resourcedivider",this.al.eventFloat="_event_float",this.al.eventFloatInner="_event_float_inner",this.al.event="_event",this.al.eventInner="_event_inner",this.al.eventBar="_event_bar",this.al.eventBarInner="_event_bar_inner",this.al.eventDelete="_event_delete",this.al.eventLine="_event_line",this.al.eventMovingSource="_event_moving_source";var E=this.al;this.dl=function(e,t){var i=this.nav.timeHeader,n=this.timeHeader[t][e],a=t=this.Yg().getTime())){var l=this.getPixels(i);if(!l.cut&&!(l.left<0||l.left>this.aj()*this.cellWidth)){var s=document.createElement("div");s.style.width=a+"px",s.style.height=c.Xf+"px",s.style.position="absolute",s.style.left=l.left-1+"px",s.style.top="0px",s.style.backgroundColor=n,s.style.opacity=r/100,s.style.filter="alpha(opacity="+r+")",o?this.divSeparatorsAbove.appendChild(s):this.divSeparators.appendChild(s),this.elements.separators.push(s)}}},this.Kk=function(e){if("Disabled"===c.timeRangeDoubleClickHandling)return!1;n.timeRangeTimeout&&(clearTimeout(n.timeRangeTimeout),n.timeRangeTimeout=null);if(!c.coords){var t=c.tg;c.coords=DayPilot.mo3(t,e)}if(e=e||window.event,e.stopPropagation&&e.stopPropagation(),e.cancelBubble=!0,c.gl(c.coords)){var i=c.Hh(c.rangeHold);c.bb(i.start,i.end,i.resource)}else if(n.range=c._k(),n.range){n.rangeCalendar=c;var i=c.Hh(n.range);c.bb(i.start,i.end,i.resource),c.rangeHold=n.range}},this.Hk=function(e){if(!DayPilot.Global.touch.start&&!DayPilot.Global.touch.active){if(n.timeRangeTimeout,1,c.hl(),c.Fk(),!c.coords){var t=c.tg;c.coords=DayPilot.mo3(t,e)}if(n.rectangleSelect)return!1;e=e||window.event;var i=DayPilot.Util.mouseButton(e);if(i.middle||i.right&&c.gl(c.coords))return!1;if(c.gl(c.coords))return!1;var a=e.ctrlKey,o=e.metaKey,r=e.shiftKey,l=a||o,s={};if(s.action="None","Disabled"!==c.multiSelectRectangle&&r?s.action="RectangleSelect":"Disabled"!==c.timeRangeSelectedHandling&&(s.action="TimeRangeSelect"),s.shift=r,s.ctrl=r,s.meta=o,s.originalEvent=e,s.preventDefault=function(){s.action="None"},"function"==typeof c.onGridMouseDown&&c.onGridMouseDown(s),"None"===s.action)return e.preventDefault(),e.stopPropagation(),!1;if("RectangleSelect"===s.action){var d={};return d.start=c.coords,d.calendar=c,n.rectangleSelect=d,!1}c.allowMultiRange&&!l&&H.clear();var h=c.fi(c.coords.y).i;return!c.rowlist[h].isNewRow&&(n.range=c._k(),n.range&&(n.range.ctrl=l,n.rangeCalendar=c),!1)}},this._k=function(){var e={},t=this.ah(c.coords.x).x;return e.start={y:c.fi(c.coords.y).i,x:t},e.end={x:t},this.li(c.fi(c.coords.y).i)?null:(e.calendar=c,c.Jh(e),e)},this.nj=function(){c.Gc();var e=n.resizingShadow,t=n.resizing;!function(){var i=c.il,a={"start":e.start,"end":c.if(e.end)};e.original=a;var o=e.original;if(!o||!i||i.start!==o.start||i.end!==c.if(o.end)){var r={};r.start=a.start,r.end=a.end,r.duration=new DayPilot.Duration(r.start,r.end),r.e=t.event,r.allowed=!0,r.resizing="left"===n.resizing.dpBorder?"start":"end",r.left={},r.left.html=r.start.toString(c.eventResizingStartEndFormat,_.locale()),r.left.enabled=c.eventResizingStartEndEnabled,r.left.space=5,r.left.width=null,r.right={},r.right.html=r.end.toString(c.eventResizingStartEndFormat,_.locale()),r.right.enabled=c.eventResizingStartEndEnabled,r.right.space=5,r.right.width=null,r.multiresize=DayPilot.list(b.list);var l={};l.event=t,l.start=r.start,l.end=r.end,r.multiresize.splice(0,0,l),c.il=a,"function"==typeof c.onEventResizing&&c.onEventResizing(r),e.allowed=r.allowed;var s=r.start,d=c.Ie(r.end);if(e.finalStart=s,e.finalEnd=d,"Days"===c.viewType){var h=t.event.part.dayIndex,u=c.rowlist[h],f=u.start.getTime()-c.Ba().getTime();s=s.addTime(-f),d=d.addTime(-f)}var v=DayPilot.DateUtil.diff(s,d);v=Math.max(v,1);var p=_.useBox(v),g=p?c.getPixels(s).boxLeft:c.getPixels(s).left,y=p?c.getPixels(d).boxRight:c.getPixels(d).left;e.style.left=g+"px",e.style.width=y-g+"px",e.left=g,e.width=y-g,c.oj(n.resizingShadow,r),c.pj(n.resizingShadow,r)}}()},this.Ik=function(e){if(n.rectangleSelect){var e=e||window.event;return e.cancelBubble=!0,e.preventDefault&&e.preventDefault(),n.gMouseUp(e),!1}if(A={},c.rangeHold){if(DayPilot.Util.mouseButton(e).left){var t=c.rangeHold;if(c.gl(c.coords)){var i=function(e){return function(){n.timeRangeTimeout=null;var t=c.Hh(e);if(t){var i={};i.start=t.start,i.end=t.end,i.resource=t.resource,i.preventDefault=function(){i.preventDefault.value=!0},"function"==typeof c.onTimeRangeClick&&c.onTimeRangeClick(i),i.preventDefault.value||"function"==typeof c.onTimeRangeClicked&&c.onTimeRangeClicked(i)}}};"Disabled"!=c.timeRangeClickHandling&&("Disabled"===c.timeRangeDoubleClickHandling?i(t)():(clearTimeout(n.timeRangeTimeout),n.timeRangeTimeout=setTimeout(i(t),c.doubleClickTimeout)))}}}},this.jl=function(){return n.resizing||n.moving||n.range},this.rj=function(e){if(!DayPilot.Global.touch.active){n.activeCalendar=c,e=e||window.event;var t=DayPilot.mc(e);if(c.coords=DayPilot.mo3(c.tg,e),e.insideMainD=!0,window.event&&window.event.srcElement&&(window.event.srcElement.inside=!0),A.start){DayPilot.distance(A.originalMouse,t)>3&&(DayPilot.Util.copyProps(A,n),document.body.style.cursor="move",A={})}if(n.resizing&&n.resizingEvent.calendar===c)n.resizing.event||(n.resizing.event=n.resizingEvent),c.kl();else if(n.movingEvent&&(n.movingEvent.calendar===c||n.movingEvent.calendar.dragOutAllowed))c.ll();else if(n.range&&n.range.calendar===c)n.range.moved=!0,c.ml();else if(s.source){var i=s.source;v.drawShadow(i.coords,c.coords)}else n.rectangleSelect&&(n.rectangleSelect.moved=!0,M.draw());"Disabled"!==c.crosshairType&&c.nl(),c.ol();var a=e.insideEvent;if(window.event&&window.event.srcElement&&(a=window.event.srcElement.insideEvent),c.cellBubble&&c.coords&&c.rowlist&&c.rowlist.length>0&&!a){var o=c.ah(c.coords.x).x,r=c.fi(c.coords.y).i;if(0<=r&&r0){if(!n.movingEvent){n.moving=n.drag.schedulerSourceEvent||{};var h=n.drag.event;if(h){if(c!==h.calendar){var f=h.calendar,p=h,g=DayPilot.Util.copyProps(h.data);h=new DayPilot.Event(g),h.calendar=f,h.part.duration=f.Qi(p)}}else{var y=c.itline[0].start,e={"id":n.drag.id,"start":y,"end":y.addSeconds(n.drag.duration),"text":n.drag.text},m=n.drag.data;if(m){var b=["duration","element","remove","duration","id","text"];for(var w in m)DayPilot.contains(b,w)||(e[w]=m[w])}h=new DayPilot.Event(e),h.calendar=c,h.part.duration=n.drag.duration}h.part.external=!0;var i=n.drag.schedulerSourceEvent;i&&i.event&&i.event.calendar===c&&(h.part.external=!1),n.movingEvent=h}n.movingShadow=c.ta(n.movingEvent)}e.cancelBubble=!0}if("Always"===c.autoScroll||"Drag"===c.autoScroll&&(n.moving||n.resizing||n.range)){var D=c.nav.scroll,k={x:c.coords.x,y:c.coords.y};k.x-=D.scrollLeft,k.x+=u.shiftX,k.y-=D.scrollTop;var x=D.clientWidth,C=D.clientHeight,P=30,S=k.x-1||DayPilot.Util.addClass(n.moving,c.q(E.eventMovingSource));var e=n.movingEvent;n.movingShadow=c.ta(e)}c.Xi(),c.Zi()},this.ql={};var M=this.ql;M.start=function(){var e={};e.start=c.coords,e.calendar=c,n.rectangleSelect=e},M.draw=function(){var e=n.rectangleSelect,t=n.rectangleSelect.start,i=c.coords;M.clear();var a,o,r,l,s,d,u,f,v={"x":e.x,"y":e.y,"width":e.width,"height":e.height};if(function(){s=Math.min(t.x,i.x),u=Math.max(t.x,i.x),"Free"===c.multiSelectRectangle?(d=Math.min(t.y,i.y),f=Math.max(t.y,i.y)):"Row"===c.multiSelectRectangle&&(d=t.y,f=t.y)}(),"Free"===c.multiSelectRectangle)a=s,o=d,r=u-s,l=f-d;else{if("Row"!==c.multiSelectRectangle)throw"Invalid DayPilot.Scheduler.multiSelectRectangle value: "+c.multiSelectRectangle;var p=c.fi(d).i,g=c.rowlist[p];o=g.top,l=g.height;a=c.ah(s).cell.left;var y=c.ah(u).cell;r=y.left+y.width-a}var m=DayPilot.Util.div(c.divRectangle,a,o,r,l);if(m.style.boxSizing="border-box",m.style.backgroundColor="#0000ff",m.style.border="1px solid #000033",m.style.opacity=.4,e.x=a,e.y=o,e.width=r,e.height=l,(e.x!==v.x||e.y!==v.y||e.width!==v.width||e.height!==v.height)&&"function"==typeof c.onRectangleEventSelecting){var b={};b.events=h.eventsInRectangle(e.x,e.y,e.width,e.height).map(function(e){return e.event}),b.start=c.getDate(e.x,!0),b.end=c.getDate(e.x+e.width,!0),c.onRectangleEventSelecting(b)}},M.clear=function(){c.divRectangle.innerHTML="",c.elements.rectangle=[]},this.rl=function(){var e,t;if(!(c.coords&&c.rowlist&&c.rowlist.length>0&&c.itline&&c.itline.length>0))return null;if(e=c.ah(c.coords.x).x,t=c.fi(c.coords.y).i,!(t>=c.rowlist.length)){return c.cells.findXy(e,t)[0]}},this.ol=function(){var e=this.rl();if(this.hover.cell){if(this.hover.cell.x===e.x&&this.hover.cell.y===e.y)return;this.Gk()}if(this.hover.cell=e,"function"==typeof this.onCellMouseOver){var t={};t.cell=e,this.onCellMouseOver(t)}},this.Gk=function(){if(this.hover.cell){if("function"==typeof this.onCellMouseOut){var e={};e.cell=this.hover.cell,this.onCellMouseOut(e)}this.hover.cell=null}},this.hover={},this.nl=function(){var e=this.rl();this.hover.cell&&this.hover.cell.x===e.x&&this.hover.cell.y===e.y||this.Fc()},this.hl=function(){this.divCrosshair.innerHTML="",this.sl=null,this.ul=null},this.T=function(){if(this.hl(),this.vl&&this.vl.parentNode&&(this.vl.parentNode.removeChild(this.vl),this.vl=null),this.wl){for(var e=0;e0&&(e=c.ah(c.coords.x).x,t=c.fi(c.coords.y).i,!(t>=c.rowlist.length))){var i=this.crosshairType,n=c.rowlist[t];if("Full"===i){var a=this.itline[e],o=a.left,r=this.sl;if(!r){var r=document.createElement("div");r.style.height=c.Xf+"px",r.style.position="absolute",r.style.top="0px",r.className=c.q("_crosshair_vertical"),this.sl=r,this.divCrosshair.appendChild(r)}r.style.left=o+"px",r.style.width=a.width+"px";var l=n.top,s=n.height,d=this.Hg(),r=this.ul;if(!r){var r=document.createElement("div");r.style.width=d+"px",r.style.height=s+"px",r.style.position="absolute",r.style.top=l+"px",r.style.left="0px",r.className=c.q("_crosshair_horizontal"),this.ul=r,this.divCrosshair.appendChild(r)}r.style.top=l+"px",r.style.height=s+"px"}var h=this.xl(this.coords.x);if(h&&this.Wf!==h.x){this.vl&&this.vl.parentNode&&(this.vl.parentNode.removeChild(this.vl),this.vl=null);var s=R.timeHeader(c.timeHeaders.length-1).height,r=document.createElement("div");r.style.width=h.cell.width+"px",r.style.height=s+"px",r.style.left="0px",r.style.top="0px",r.style.position="absolute",r.className=c.q("_crosshair_top"),this.vl=r;var u=this.divNorth,f=this.timeHeader?this.timeHeader.length-1:1;this.nav.timeHeader?this.t.timeHeader[h.x+"_"+f].appendChild(r):u.firstChild.rows[f].cells[e]&&u.firstChild.rows[f].cells[e].firstChild.appendChild(r)}if(this.Vf!==t){if(this.wl){for(var v=0;v=a.left&&t=a&&e.x<=o&&e.y>=r&&e.y<=l},this.Jh=function(e,t){function i(e){var t=e.end.x>e.start.x?e.start.x:e.end.x,i=e.end.x>e.start.x?e.end.x:e.start.x,n=e.start.y,a=(c.rowlist[n],c.itline[t]),o=c.itline[i],r=a.left,l=o.left+o.width,s=l-r,d=c.elements.range2;if(!d){d=document.createElement("div"),d.style.position="absolute",d.setAttribute("unselectable","on"),d.className=c.q("_shadow");var h=document.createElement("div");h.className=c.q("_shadow_inner"),d.appendChild(h),c.divRange.appendChild(d)}return d.style.left=a.left+"px",d.style.top=c.rowlist[n].top+"px",d.style.width=s+"px",d.style.height=c.rowlist[n].height-1+"px",d.calendar=c,c.elements.range2=d,function(){var e=c.rowlist[n],t=a.left;c.jj(d,e,t,s,null)}(),d}var e=e||n.range;e&&e.calendar===c&&!function(){var n=e.end.x>e.start.x?e.start.x:e.end.x,a=e.end.x>e.start.x?e.end.x:e.start.x,o=e.start.y,r=c.rowlist[o];if(r){var l=c.itline[n],s=c.itline[a],d=c.yl,h=l.start.addTime(r.data.offset),u=s.end.addTime(r.data.offset);if(t||!d||d.start.getTime()!==h.getTime()||d.end.getTime()!==u.getTime()||d.resource!==c.rowlist[o].id){var f={"start":h,"end":c.if(u)},v={};v.start=f.start,v.end=f.end,v.duration=new DayPilot.Duration(f.start,f.end),v.resource=c.rowlist[o].id,v.allowed=!0,v.left={},v.left.html=v.start.toString(c.timeRangeSelectingStartEndFormat,_.locale()),v.left.enabled=c.timeRangeSelectingStartEndEnabled,v.left.space=5,v.left.width=null,v.right={},v.right.html=v.end.toString(c.timeRangeSelectingStartEndFormat,_.locale()),v.right.enabled=c.timeRangeSelectingStartEndEnabled,v.right.space=5,v.right.width=null,c.yl=v,"function"!=typeof c.onTimeRangeSelecting||t||c.onTimeRangeSelecting(v);var p=c.zl(e);c.Ih(p,v.start,v.end);var g=i(p);c.oj(g,v),e.bl=p,e.disabled=!v.allowed,c.pj(g,v),v.start=f.start,v.end=f.end}}}()},this.zl=function(e){return{"start":{"x":e.start.x,"y":e.start.y},"end":{"x":e.end.x},"disabled":e.disabled,"calendar":e.calendar}},this.range={},this.range.all=function(){return H.get()},this.Al={};var H=this.Al;this.Al.list=[],this.Al.clear=function(){DayPilot.de(DayPilot.list(H.list).map(function(e){return e.div})),H.list=[]},this.Al.add=function(e){e.div=c.elements.range2,c.elements.range2=null,c.qj(),H.list.push(e)},this.Al.get=function(){return DayPilot.list(H.list).map(function(e){return c.Hh(e)})},this.Al.dispatch=function(){if(c.allowMultiRange&&!n.range){var e=DayPilot.list(H.list).last();c.Gh(e)}},this.Bl=function(e){if("Disabled"===c.timeRangeSelectedHandling)return!1;if(!DayPilot.Global.touch.active&&!DayPilot.Global.touch.start){e=e||window.event;var t=DayPilot.Util.mouseButton(e);if(!n.range&&!n.rectangleSelect&&!(c.rangeHold&&c.gl(c.coords)&&(t.right||t.middle)||c.li(c.fi(c.coords.y).i))){var i={},a=c.ah(c.coords.x).x;i.start={y:c.fi(c.coords.y).i,x:a},i.end={x:a},i.calendar=c,c.rangeHold=i,c.Gh(i)}}},this.timeouts={},this.timeouts.drawEvents=null,this.timeouts.drawCells=null,this.timeouts.click=null,this.timeouts.resClick=[],this.timeouts.updateFloats=null,this.disableOnScroll=!1,this.pg=function(e){if(!c.disableOnScroll){c.Zf();var t=c.nav.scroll;if(c.bj=t.scrollLeft,c._i=t.scrollTop,c.cj=t.clientWidth,c.divTimeScroll.scrollLeft=c.bj,c.divResScroll.scrollTop=c._i,u.isEnabled()&&!u.active&&c.A&&"Auto"!=c.cellWidthSpec){if(c.nav.scroll.scrollLeft0?c.timeouts.drawEvents=setTimeout(c.Dl(),c.scrollDelayEvents):c.oa(),c.timeouts.drawCells&&(clearTimeout(c.timeouts.drawCells),c.timeouts.drawCells=null),c.scrollDelayCells>0)c.timeouts.drawCells=setTimeout(c.El(),c.scrollDelayCells);else{c.El()()}c.timeouts.updateFloats&&(clearTimeout(c.timeouts.updateFloats),c.timeouts.updateFloats=null),c.scrollDelayFloats>0?c.timeouts.updateFloats=setTimeout(function(){c.ng()},c.scrollDelayFloats):c.ng(),c.onScrollCalled=!0}},this.El=function(){return function(){c&&(c.zf(),c.jg())}},this.Dl=function(){var e=c.dynamicEventRenderingCacheSweeping,t=c.dynamicEventRenderingCacheSize;return function(){c&&(c.Tk()?window.setTimeout(function(){e&&c.Qk(t),window.setTimeout(function(){c.oa(!0)},50)},50):c.Bg())}},this.Zf=function(){this.t.eventHeight=null,this.t.drawArea=null},this.show=function(){this.visible=!0,this.Uf=!0,c.nav.top.style.display="",this.na(),this.eg(),this.Ci(),c.pg()},this.hide=function(){this.visible=!1,this.Uf=!1,c.nav.top.style.display="none"},this.Fl=function(){},this.Cl=function(){var e=c.nav.scroll;c.bj=e.scrollLeft,c._i=e.scrollTop,c.cj=e.clientWidth,c.divTimeScroll.scrollLeft=c.bj,c.divResScroll.scrollTop=c._i,c.refreshTimeout&&window.clearTimeout(c.refreshTimeout);var t=c.scrollDelayDynamic;c.refreshTimeout=window.setTimeout(c.Gl(e.scrollLeft,e.scrollTop),t),c.ng()},this.Hl=function(e){if(!c.events.list)return null;for(var t=e.id,i=new DayPilot.Date(e.start).toString(),n=0;n0){if(this.cellSweeping){var e=this.cellSweepingCacheSize;this.Sk(e)}this.Jl(),this.Ml(),x.Rj()}this.Ah=!1}},this.Ml=function(){for(var e=this.yg(),t=e.xStart;t0){r=c.ah(a).x,l=c.ah(o,!0).x;var s=this.aj();l=Math.min(l,s),r=Math.max(r,0)}var d=e-n,h=e+this.nav.scroll.offsetHeight+2*n,f=this.fi(d).i,v=this.fi(h).i;return v0&&(n=n.concat(s))}return n},this.pl=function(e,t){this.Fk(),this.Pl(e,t)},this.Ql=function(e){if(!e)return!1;var t=this.nav.scroll.scrollWidth,i=this.nav.scroll.scrollLeft,n=this.nav.scroll.clientWidth,a=i+n;return!(e<0&&i<=0)&&(!(e>0&&a>=t)&&(this.nav.scroll.scrollLeft+=e, c.coords.x+=e,c.Rl(),!0))},this.Sl=function(e){if(!e)return!1;var t=this.nav.scroll.scrollHeight,i=this.nav.scroll.scrollTop,n=this.nav.scroll.clientHeight,a=i+n;return!(e<0&&i<=0)&&(!(e>0&&a>=t)&&(this.nav.scroll.scrollTop+=e,c.coords.y+=e,c.Rl(),!0))},this.Rl=function(){n.resizing&&n.resizing.event.calendar===c?c.kl():n.moving&&(n.movingEvent.calendar===c||n.movingEvent.calendar.dragOutAllowed)?c.ll():n.range&&n.range.calendar===c&&c.ml()},this.Pl=function(e,t){if(this.Ql(e)||this.Sl(t)){var i=function(e,t){return function(){c.Pl(e,t)}};this.Tl=window.setTimeout(i(e,t),100)}},this.Fk=function(){c.Tl&&(window.clearTimeout(c.Tl),c.Tl=null)},this.dg=function(){for(var e=0,t=0;t',this.elements.range=[],this.elements.range2=null,this.qj(),c.rangeHold=null},this.vc={};var _=this.vc;_.clearCache=function(){delete c.t.eventHeight,delete c.t.headerHeight},_.locale=function(){return DayPilot.Locale.find(c.locale)},_.timeFormat=function(){return"Auto"!==c.timeFormat?c.timeFormat:_.locale().timeFormat},_.weekStarts=function(){if("Auto"===c.weekStarts){var e=_.locale();return e?e.weekStarts:0}return c.weekStarts||0},_.rounded=function(){return"Rounded"===c.eventCorners},_.layout=function(){var e=/MSIE 6/i.test(navigator.userAgent);return"Auto"===c.layout?e?"TableBased":"DivBased":c.layout},_.notifyType=function(){var e;if("Immediate"===c.notifyCommit)e="Notify";else{if("Queue"!==c.notifyCommit)throw"Invalid notifyCommit value: "+c.notifyCommit;e="Queue"}return e},_.isResourcesView=function(){return"Days"!==c.viewType},_.useBox=function(e){return"Always"===c.useEventBoxes||"Never"!==c.useEventBoxes&&e<60*c.Mi()*1e3},_.eventHeight=function(){if(c.t.eventHeight)return c.t.eventHeight;var e=c.md("_event_height").height;return e||(e=c.eventHeight),c.t.eventHeight=e,e},_.headerHeight=function(){if(c.t.headerHeight)return c.t.headerHeight;var e=c.md("_header_height").height;return e||(e=c.headerHeight),c.t.headerHeight=e,e},_.splitterWidth=function(){return c.rowHeaderScrolling?c.rowHeaderSplitterWidth:1},this.Zl={};var R=this.Zl;R.timeHeader=function(e){var t={};t.top=0,t.height=0;for(var i=_.headerHeight(),n=0;n<=e;n++){var a=c.timeHeaders[n];t.top+=t.height,t.height=a.height||i}return t},this.Ec=function(e,t){var i=e+"_"+t;return this.cellProperties&&this.cellProperties[i]?this.cellProperties[i].backColor:null},this.Fi=function(e,t){var i=e+"_"+t;if(c.cellConfig)for(var n=0,a=0;a=24)return!0;if(a>=this.businessEndsHour)return!1}return!0},this.na=function(){"hidden"===this.nav.top.style.visibility&&(this.nav.top.style.visibility="visible")},this.Sc=function(){var e=c.nav.top;return!!e&&(e.offsetWidth>0&&e.offsetHeight>0)},this.Tc=function(){var e=c.Sc;e()||c.Uc||(c.Uc=setInterval(function(){e()&&(clearInterval(c.Uc),c.show(),c.wj())},100))},this.bm=function(e){"Parent100Pct"!==this.heightSpec&&(this.heightSpec="Fixed"),this.height=e-(this.Jg()+2),this.ja()},this.setHeight=this.bm,this.wg=function(e){return DayPilot.list(D.rowcache[e]).first()},this.rd=function(){if(this.id&&this.id.tagName)this.nav.top=this.id;else{if("string"!=typeof this.id)throw"DayPilot.Scheduler() constructor requires the target element or its ID as a parameter";if(this.nav.top=document.getElementById(this.id),!this.nav.top)throw"DayPilot.Scheduler: The placeholder element not found: '"+e+"'."}},this.cm=function(){this.hd(),this.ag(),this.eg(),this.Wc(),this.Q(),n.register(this),this.Y(this.afterRenderData,!1),this.Nk(),this.ra(),this.G("Init")},this.init=function(){this.dm(),this.Tc(),this.zk()},this.dm=function(){if(this.rd(),!this.nav.top.dp){this.mk();if(this.qd())return this.cm(),this.A=!0,void this.Zf();this.Wc(),this.Q(),n.register(this),this.Nk(),this.gd(),this.A=!0;var angular=c.Qc.scope||c.qg.enabled;c.scrollToDate?c.scrollTo(c.scrollToDate):c.scrollX||c.scrollY?c.setScroll(c.scrollX,c.scrollY):angular||c.pg(),c.scrollToResourceId&&(c.scrollToResource(c.scrollToResourceId),c.scrollToResourceId=null);var e=function(){c.scrollY&&c.setScroll(c.scrollX,c.scrollY)};window.setTimeout(e,200),this.messageHTML&&window.setTimeout(function(){c.message(c.messageHTML)},0),this.ra(),this.Zf(),this.Y(this.afterRenderData,!1),c.initEventEnabled&&setTimeout(function(){c.G("Init")}),this.td(),this.hi=!0}},this.ud=null,this.vd=function(e){if(e){var t={"events":{"preInit":function(){var e=this.data;e&&(DayPilot.isArray(e.list)?c.events.list=e.list:c.events.list=e)},"postInit":function(){}},"links":{"preInit":function(){var e=this.data;e&&(DayPilot.isArray(e.list)?c.links.list=e.list:c.links.list=e)},"postInit":function(){}},"scrollTo":{"preInit":function(){},"postInit":function(){this.data&&c.scrollTo(this.data,e.scrollToAnimated,e.scrollToPosition)}},"scrollX":{"postInit":function(){this.data&&c.setScrollX(this.data)}},"scrollY":{"postInit":function(){this.data&&c.setScrollY(this.data)}}};c.ud=t,c.qg.scrollToRequested&&(t.scrollTo.data=c.qg.scrollToRequested,c.qg.scrollToRequested=null),c.qg.scrollXRequested&&(t.scrollX.data=c.qg.scrollXRequested,c.qg.scrollXRequested=null),c.qg.scrollYRequested&&(t.scrollY.data=c.qg.scrollYRequested,c.qg.scrollYRequested=null);for(var i in e)if(t[i]){var n=t[i];n.data=e[i],n.preInit&&n.preInit()}else c[i]=e[i]}},this.td=function(){var e=c.ud;for(var t in e){var i=e[t];i.postInit&&i.postInit()}c.ud={}},this.temp={},this.temp.getPosition=function(){var e=Math.floor(c.coords.x/c.cellWidth),t=c.fi(c.coords.y).i;if(tt.groupConcurrentEventsLimit&&e.push(new o(n))}return DayPilot.list(e)},a.groups.collapsed=function(){for(var e=[],t=0;tt.groupConcurrentEventsLimit){e.expanded=!1;var i=DayPilot.list(e.events).map(function(e){return e.id()});t.Nj=t.Nj.filter(function(e){return!DayPilot.contains(i,e)})}},this.collapse=function(){this.gm(),t.kh(),t.lh(e.row.index),t.ja()}},r=function(e,t){this.html=function(i){var n=e.calendar.divHeader,a=n.rows[e.index].cells[t],o=a.textDiv;return"undefined"==typeof i?o.innerHTML:void(o.innerHTML=i)}}},n.moving=null,n.movingEvent=null,n.originalMouse=null,n.resizing=null,n.resizingEvent=null,n.preventEventClick=!1,n.globalHandlers=!1,n.timeRangeTimeout=null,n.selectedCells=null,n.dragStart=function(e,t,i,a){DayPilot.us(e);var o=n.drag={};return o.element=e,o.duration=t,o.text=a,o.id=i,o.data={"id":i,"text":a,"duration":t,"externalHtml":a},!1},DayPilot.Scheduler.startDragging=function(e){var e=e||{},t=e.element,i=e.keepElement?null:t;DayPilot.us(t);var a=n.drag={};return a.element=i,a.id=e.id,a.duration=e.duration||60,a.text=e.text||"",a.data=e,!1},DayPilot.Scheduler.makeDraggable=function(e){function t(){var t=n.drag={};t.element=a,t.id=e.id,t.duration=e.duration||60,t.text=e.text||"",t.data=e}e=e||{};var i=e.element,a=e.keepElement?null:e.remove||i;DayPilot.us(i),DayPilot.re(i,"mousedown",function(e){if(DayPilot.Util.mouseButton(e).left){t();var i=e.target||e.srcElement;if(i.tagName){var n=i.tagName.toLowerCase();if("textarea"===n||"select"===n||"input"===n)return!1}return e.preventDefault&&e.preventDefault(),!1}}),i.ontouchstart=function(e){window.setTimeout(function(){t(),n.gTouchMove(e),e.preventDefault()},0),e.preventDefault()}},DayPilot.Scheduler.stopDragging=function(){if(n.drag&&n.drag.schedulerSourceEvent){var e=n.drag.schedulerSourceEvent,t=e.event.calendar;DayPilot.Util.removeClass(e,t.q(i.al.eventMovingSource))}if(n.dragStop(),n.resizing&&(DayPilot.de(n.resizingShadow),n.resizing=null,n.resizingEvent=null,n.resizingShadow=null),n.moving){var i=n.movingEvent.calendar;DayPilot.Util.removeClass(n.moving,i.q(i.al.eventMovingSource)),DayPilot.de(n.movingShadow),n.moving=null,n.movingEvent=null,n.movingShadow=null}if(n.range){var i=n.range.calendar;i.clearSelection(),n.range=null}document.body.style.cursor="",DayPilot.list(n.registered).each(function(e){e.Fk(),e.qj()})},n.dragStop=function(){n.gShadow&&(document.body.removeChild(n.gShadow),n.gShadow=null),n.drag=null},n.register=function(e){n.registered||(n.registered=DayPilot.list(),n.registered.out=function(){n.registered.forEach(function(e){e.S()})});for(var t=0;t0){if(!n.moving){n.moving={};var r=n.drag.event;if(!r){var l=a.itline[0].start,i={"id":n.drag.id,"start":l,"end":l.addSeconds(n.drag.duration),"text":n.drag.text},s=n.drag.data;if(s){var d=["duration","element","remove","id","text"];for(var c in s)DayPilot.contains(d,c)||(i[c]=s[c])}r=new DayPilot.Event(i),r.calendar=a,r.part.duration=n.drag.duration}r.part.external=!0;var h=n.drag.schedulerSourceEvent;h&&h.event&&h.event.calendar===a&&(r.part.external=!1),n.movingEvent=r}n.movingShadow=a.ta(n.movingEvent)}n.moving&&a.Vb.updateMoving()}else{DayPilot.de(n.movingShadow);var u=n.moving;n.moving=null,n.movingEvent=null,n.movingShadow=null,n.gShadow||(n.gShadow=n.createGShadow(n.drag.data),n.gShadow.source=u);var f=n.gShadow;f.style.left=o.x+"px",f.style.top=o.y+"px",n.registered.out()}}},n.gTouchEnd=function(e){n.gMouseUp(e)},n.gMouseMove=function(e){if("undefined"!=typeof n&&!(DayPilot.Global.touch.active||DayPilot.Global.touch.start||(e=e||window.event,e.insideMainD||e.srcElement&&e.srcElement.inside))){var t=DayPilot.mc(e);if(n.drag){if(!n.drag.startFired){var i=n.drag.data||{},a=i.onDragStart,o=!1;if("function"==typeof a){var r={};r.data=i,r.preventDefault=function(){r.preventDefault.value=!0},a(r),o=r.preventDefault.value}if(n.drag.startFired=!0,o)return void(n.drag=null)}document.body.style.cursor="move",n.gShadow||(n.gShadow=n.createGShadow(n.drag.data));var l=n.gShadow;if(l.style.left=t.x+"px",l.style.top=t.y+"px",n.moving=null,n.movingEvent=null,n.movingShadow){var s=n.movingShadow.calendar;s&&s.qj(),n.movingShadow.calendar=null,DayPilot.de(n.movingShadow),n.movingShadow=null}}else if(n.moving&&n.movingEvent&&n.movingEvent.calendar.dragOutAllowed&&!n.drag){var s=n.movingEvent.calendar,e=n.movingEvent;document.body.style.cursor="move",n.gShadow||(n.gShadow=n.createGShadow(e.data),n.gShadow.source=n.moving);var l=n.gShadow;l.style.left=t.x+"px",l.style.top=t.y+"px",n.drag={};var d=n.drag;d.schedulerSourceEvent=n.moving,d.element=null,d.duration=(e.rawend().getTime()-e.start().getTime())/1e3,d.text=e.text(),d.id=e.value(),d.event=DayPilot.Util.copyProps(e),s.qj(),DayPilot.de(n.movingShadow),n.movingShadow.calendar=null,n.movingShadow=null}n.registered.out()}},n.gUnload=function(e){if(n.registered)for(var t=0;t","compile":function(t,i){return t[0].removeAttribute("id"),t[0].innerHTML=this["template"].replace("{{id}}",i["id"]),function(t,i,n){var a=new DayPilot.Scheduler(i[0].firstChild);a.Qc.scope=t;var o=n["id"];o&&(t[o]=a);var r=n["publishAs"];if(r){(0,e(r).assign)(t,a)}for(var l in n)if(0===l.indexOf("on")){var s=DayPilot.Util.shouldApply(l);s?!function(i){a[i]=function(a){var o=e(n[i]);DayPilot.Util.safeApply(t,function(){o(t,{"args":a})})}}(l):!function(i){a[i]=function(a){e(n[i])(t,{"args":a})}}(l)}var d=t["$watch"],c=n["config"]||n["daypilotConfig"],h=n["events"]||n["daypilotEvents"];c||a.init(),d.call(t,c,function(e,t){a.vd(e),a.A?(a.update(),a.td()):a.init()},!0),d.call(t,h,function(e){a.events.list=e,a.gd({"eventsOnly":!0})},!0),t.$on("$destroy",function(){a.dispose()})}}}}])}(),"undefined"!=typeof Sys&&Sys.Application&&Sys.Application.notifyScriptLoaded&&Sys.Application.notifyScriptLoaded()}}(),"undefined"==typeof DayPilot)var DayPilot={};"undefined"==typeof DayPilot.Global&&(DayPilot.Global={}),function(){"undefined"==typeof DayPilot.Year&&(DayPilot.Year=function(e,t){this.v="3027";this.startDate=new DayPilot.Date,this.cssOnly=!0,this.cssClassPrefix=null,this.columns=4,this.cellWidth=20,this.showWeekNumbers=!1,this.im=[],this.lf=function(){this.root.dp=this,this.ae=new DayPilot.Date(this.startDate.toString("yyyy-01-01","en-us"))},this.q=function(e){return this.cssClassPrefix?this.cssClassPrefix+e:""},this.mf=function(){return this.showWeekNumbers?this.cellWidth:0},this.jm=function(){this.im=[];var e=this.columns,t=12/e;this.root.className=this.q("_main"),this.root.style.width=e*(7*this.cellWidth+this.mf())+"px";for(var i=0;i