/*
 * Isomorphic SmartClient
 * Version v12.0p_2025-11-27 (2025-11-27)
 * Copyright(c) 1998 and beyond Isomorphic Software, Inc. All rights reserved.
 * "SmartClient" is a trademark of Isomorphic Software, Inc.
 *
 * licensing@smartclient.com
 *
 * http://smartclient.com/license
 */

if(window.isc&&window.isc.module_Core&&!window.isc.module_Calendar){isc.module_Calendar=1;isc._moduleStart=isc._Calendar_start=(isc.timestamp?isc.timestamp():new Date().getTime());if(isc._moduleEnd&&(!isc.Log||(isc.Log&&isc.Log.logIsDebugEnabled('loadTime')))){isc._pTM={message:'Calendar load/parse time: '+(isc._moduleStart-isc._moduleEnd)+'ms',category:'loadTime'};if(isc.Log&&isc.Log.logDebug)isc.Log.logDebug(isc._pTM.message,'loadTime');else if(isc._preLog)isc._preLog[isc._preLog.length]=isc._pTM;else isc._preLog=[isc._pTM]}isc.definingFramework=true;if(window.isc&&isc.version!="v12.0p_2025-11-27/LGPL Development Only"&&!isc.DevUtil){isc.logWarn("SmartClient module version mismatch detected: This application is loading the core module from SmartClient version '"+isc.version+"' and additional modules from 'v12.0p_2025-11-27/LGPL Development Only'. Mixing resources from different SmartClient packages is not supported and may lead to unpredictable behavior. If you are deploying resources from a single package you may need to clear your browser cache, or restart your browser."+(isc.Browser.isSGWT?" SmartGWT developers may also need to clear the gwt-unitCache and run a GWT Compile.":""))}
isc.ClassFactory.defineClass("CalendarView","ListGrid");isc.A=isc.CalendarView.getPrototype();isc.B=isc._allFuncs;isc.C=isc.B._maxIndex;isc.D=isc._funcClasses;isc.D[isc.C]=isc.A.Class;isc.A.isCalendarView=true;isc.A.showHeaderSpanContextMenu=false;isc.A.autoDraw=false;isc.A.verticalEvents=true;isc.A.allowMultiDayEvents=false;isc.A.showDateChooserTimeItem=false;isc.A.hiliteRowOnFocus=false;isc.A.hoverDelay=0;isc.A.showHover=true;isc.A.canHover=true;isc.A.hoverByCell=null;isc.A.hoverAutoFitWidth=true;isc.A.hoverAutoFitMaxWidth=200;isc.A.canFreezeFields=false;isc.A.alternateFieldStyles=false;isc.A.dateEditingStyle="time";isc.A.canTabToHeader=false;isc.A.rangeCriteriaMode=null;isc.A.$81i=/^\d{4}.\d\d?.\d\d?$/;isc.A.$81j=/^\d\d?.\d\d.\d{4}?$/;isc.A.rangeUnit="D";isc.A.showLaneFields=null;isc.A.useEventCanvasPool=true;isc.A.eventCanvasPoolingMode="data";isc.A.headerRowPrintHeight=30;isc.A.eventDragCanvasStyleName="eventDragCanvas";isc.A.eventDragCanvasDefaults={_constructor:"Canvas",width:1,height:1,snapToGrid:false,autoDraw:false,moveWithMouse:false,dragAppearance:"target",visibility:"hidden",hideUsingDisplayNone:true,keepInParentRect:true,hoverMoveWithMouse:true,showHover:true,hoverDelay:0,hoverProps:{overflow:"visible",hoverMoveWithMouse:this.hoverMoveWithMouse},getHoverHTML:function(){var _1=this.eventCanvas,_2=_1.event,_3=_1.$1245;if(!_3)return;var _4=_3.$131e,_5=_3.$131f,_6=this.view.calendar.createEventObject(_2,_4,_5,_3.$130b,_3.$1298);return this.view.calendar.$140a(this.view,_6)},setView:function(_1){this.view=_1},getEventPadding:function(){var _1=this.eventCanvas.calendar;return _1.useDragPadding?_1.getLanePadding(this.view):0},show:function(){if(this.$193z)return;return this.Super("show",arguments)},fillOverlapSlots:true,positionToEventCanvas:function(_1){if(this.$1930||!this.eventCanvas){this.hide();return isc.EH.STOP_BUBBLING}
var _2=this.eventCanvas,_3=_2.calendar,_4=this.view,_5=_4.getEventLeft(_2.event)+this.getEventPadding(),_6=_2.getTop(),_7=(_4.$732?_4.$732(_2.event):_2.getVisibleWidth()),_8=_2.getVisibleHeight(),_9=_2.$1245;if(this.fillOverlapSlots){if(_4.isTimelineView()){var _10=_2.$1245.$8l;_6=_4.body.getRowTop(_10);if(_2.isIndicatorCanvas){_8=_2.getVisibleHeight();_9.$142h=true}else if(!_9.$1297){_8=_4.getLaneHeight(_10)}else{_6+=_9.$1298.top;_8=_9.$1298.height}}else{var _11=_2.$1245.$644;_5=_4.body.getColumnLeft(_11);if(_9.$1299){if(!_9.$1297){_7=_4.getLaneWidth(_11)}else{_5+=_9.$1298.left;_7=_9.$1298.width}}else{_7=_4.body.getColumnWidth(_11)}}}
if(this.$1244){if(_4.isTimelineView()){_6=_4.body.getRowTop(_2.$1245.$8l)}else{_5=_4.body.getColumnLeft(_2.$1245.$644)}}
if(_5<0)_5=0;this.moveTo(_5,_6);this.resizeTo(_7,_8);if(_1){if(!this.isDrawn())this.draw();this.show();this.bringToFront()}
if(_4.shouldShowDragHovers())this.handleHover()},moveToEvent:function(){},dragRepositionStart:function(){if(!this.eventCanvas)return isc.EH.STOP_BUBBLING;var _1=this.eventCanvas,_2=_1.event,_3=_1.calendar,_4=this.view,_5=_4.body;if(!_3.canDragEvent(_2,_4))return false;this.$1246=true;var _6=_5.getEventRow(),_7=_5.getRowTop(_6),_8=_5.getRowHeight(_4.getRecord(_6),_6),_9=_4.getEventLeft(_2)+1,_10=_5.getEventColumn(_9),_11=_5.getColumnLeft(_10),_12=_5.getColumnWidth(_10),_13=_5.getOffsetX()-_1.getLeft(),_14=_5.getOffsetY()-_1.getTop();var _15=_4.isTimelineView();var _16=_1.$1245={};_16.$126l=!_15;_16.$8l=_6;_16.$644=_10;_16.$1249=_8;_16.$1248=_12;_16.$117y=_15?_4.$732(_2):_16.$1248;_16.$126o=_15?_16.$1249:_1.getVisibleHeight();_16.$936=_6;_16.$937=_10;_16.$116y=_13;_16.$1247=_14;_16.$126p=Math.round(_16.$126o/_16.$1249);_16.$126q=_4.data.getLength()-_16.$126p;_16.$126r=_4.getRowTop(_16.$126q);_16.$126s=_15?_5.getScrollWidth()-_16.$117y:_5.getColumnLeft(_5.fields.length-1);_16.$126t=_15?_5.getEventColumn(_16.$126s):_5.fields.length-1;_16.$131e=_3.getEventStartDate(_2);_16.$131f=_3.getEventEndDate(_2);_16.$142s=_16.$131e.duplicate();_16.$142t=_16.$131f.duplicate();_16.$1670=_4.getDateFromPoint()||_16.$131e.duplicate();_16.$131h=_16.$1670.duplicate();_16.$1299=_4.usesLanes()&&!_1.isIndicatorCanvas&&!_1.isZoneCanvas;if(_16.$1299){var _17=_4.getLane(_2[_3.laneNameField]),_18=!_17||!_17.sublanes?null:_17.sublanes.find(_3.laneNameField,_2[_3.sublaneNameField]);_16.$130a=_17;_16.$130b=_17;_16.$1297=_3.useSublanes&&_17&&_17.sublanes&&_17.sublanes.length>0;_16.$130c=_18;_16.$1298=_18;_16.$130d=!_3.canEditEventLane(_2,_4);_16.$130e=!_3.canEditEventSublane(_2,_4)}
this.positionToEventCanvas(true);return isc.EH.STOP_BUBBLING},dragRepositionMove:function(){if(!this.eventCanvas)return isc.EH.STOP_BUBBLING;var _1=this.eventCanvas,_2=_1.$1245,_3=_1.event,_4=_1.calendar,_5=this.view,_6=_4.getSnapGapPixels(_5),_7=_5.isTimelineView(),_8=_5.body,_9=this.getEventPadding(),_10=_2.$142h!=null?_2.$142h:-1,_11=-1,_12=-1,_13=-1;var _14=_5.getDateFromPoint();if(!_14)return;var _15=_5.getLaneFromPoint();if(_2.$1299&&!_15)return;if(_2.$131h&&_2.$131h.getTime()==_14.getTime()&&_2.$130b&&_2.$130b==_15)return;if(_2.$1299){var _16=_15,_17=_2.$1297?_5.getSublaneFromPoint():null;if(!_16||_5.isGroupNode(_16)){_16=_2.$130b;_17=_2.$1298}else{if(_2.$130d){_16=_2.$130a;if(_2.$1297&&(_2.$130e||!_16.sublanes.contains(_17)))
{_17=_2.$130c}}else{if(_2.$1297){if(_2.$130e){var _18=_16.sublanes?_16.sublanes.find(_4.laneNameField,_2.$130c.name):null;if(_18){_17=_18}else{_16=_2.$130b;_17=_2.$1298}}else{if(_16!=_2.$130b){if(!_16.sublanes){_16=_2.$130b;_17=_2.$1298}}}}}}
if(_7){var _19=_5.getRecordIndex(_16);_10=_5.getRowTop(_19);if(_17)_10+=_17.top;_13=(_17?_17.height:_16.height);_2.$936=_19}else{var _19=_5.getLaneIndex(_16.name);_11=_5.body.getColumnLeft(_19);_12=_5.getLaneWidth(_16.name);if(_17){_11+=_17.left;_12=_17.width}
_2.$937=_19}}
var _20=_8.getEventRow(),_21=Math.min(_2.$126q,(_20<0?0:_20)),_22=_8.getRowTop(_21),_23=_8.getOffsetY(),_24=Math.floor((Math.floor((_23-_22)/_6))*_6),_25=_7?_22:Math.min(_2.$126r,_22+_24),_26=this.getVisibleHeight(),_27=_26;var _28=_14.getTime()-_2.$131h.getTime(),_29=_28<0?-1:_28==0?0:1,_30=Math.floor(Math.abs(_28)/_5.getTimePerSnapGap("ms"));var _31=_4.addSnapGapsToDate(_2.$131e,_5,_30*_29);var _32=_4.addSnapGapsToDate(_2.$131f,_5,_30*_29);var _33=_31.duplicate();var _34=_32.duplicate();if(_7){if(_31.getTime()<_5.startDate.getTime()){_33=_5.startDate.duplicate()}
if(_32.getTime()>_5.endDate.getTime()){_34=_5.endDate.duplicate()}}
var _35=Math.min(_2.$126t,_8.getEventColumn()),_36=_8.getColumnLeft(_35),_37=(_8.getOffsetX()-_2.$116y),_38=Math.max(0,_37-((_37-_36)%_6)+1),_39=_5.getDateFromPoint(_38,_25,null,true),_40=Math.min(_2.$126s,(_7?_4.getDateLeftOffset(_39,_5):_36)),_41=_40+(_7?(_2.$117y):_1.getVisibleWidth());if(!_7){if(_21!=_2.$936){if(_21<0){_21=0;_25=0}else{var _42=_22+_2.$126o;var _43=_8.getEventRow(_22+_2.$126o-_2.$1249);if(_43<0){_21=_2.$936;_25=_8.getRowTop(_21)}else{_2.$936=_21}}}}
var _44=_5.isTimelineView()?(_10>=0&&_13>=0):(_2.$1299?(_11>=0&&_12>=0):false)
if(!_44){_2.$936=_21}
if(_35!=_2.$937){if(_5.isDayView()||_5.isWeekView()){if(_5.usesLanes()&&!_4.canEditEventLane(_3,_5)){_35=_2.$937;_40=_2.$117z}else{if(_35==-1)_2.$937=0;else if(_35==-2)_2.$937=_2.$937;else _2.$937=_35;_40=_8.getColumnLeft(_2.$937)}}else{_2.$937=Math.max(1,_35)}}
var _45=Math.max(0,(_10>=0?_10:_25)),_42=Math.min(_5.body.getScrollHeight(),_45+_2.$126o);if(!_5.isTimelineView()){_31=_5.getDateFromPoint(_40+1,_45+1);_32=_5.getDateFromPoint(_41-1,_42);_33=_31.duplicate();_34=_32.duplicate()}
if(_5.isDayView()||_5.isWeekView()){if(_31.getDate()!=_32.getDate()){}}
var _46=_32.duplicate();_46.setTime(_32.getTime()-1);var _47=true;var _48=_4.createEventObject(_3,_31,_46,_16&&_16.name,_17&&_17.name);_47=_4.eventRepositionMove(_3,_48,this);if(_44){if(_7){_45=_10;_2.$125b=_13;_40=_5.getDateLeftOffset(_33);_41=_5.getDateRightOffset(_34);_2.$117y=_41-_40;this.resizeTo(_2.$117y,_13)}else{_40=_11;_2.$131b=_12;this.resizeTo(_12,null)}
_2.$1298=_17;_2.$130b=_16}else{if(_45+_27>_5.body.getScrollHeight()-1){_27=_5.body.getScrollHeight()-1-_45}
_2.$125b=_27;this.resizeTo(null,_27)}
_2.$125a=_45;_2.$117z=_40;_2.$131e=_31.duplicate();_2.$131f=_32.duplicate();_2.$131h=_14.duplicate();if(_47){_2.$142s=_31.duplicate();_2.$142t=_32.duplicate();this.setDragCursor("default")}else{this.setDragCursor("not-allowed")}
this.moveTo(_2.$117z,_2.$125a);if(_5.shouldShowDragHovers())isc.Hover.show(this.getHoverHTML(),this.hoverProps);return isc.EH.STOP_BUBBLING},dragRepositionStop:function(){if(!this.eventCanvas)return isc.EH.STOP_BUBBLING;var _1=this.eventCanvas,_2=_1.$1245,_3=_1.calendar,_4=this.view,_5=_4.body,_6=_1.event;if(_4.shouldShowDragHovers())isc.Hover.hide();this.hide();var _7=(this.cursor!="default"&&_3.eventUseLastValidDropDates!=true);this.setDragCursor("default");if(_7)return;var _8=_1.isIndicatorCanvas;var _9=_2.$1299&&_3.canEditEventLane(_6,_4),_10=_2.$1299&&_3.canEditEventSublane(_6,_4),_11,_12;if(!_8){if(_4.isTimelineView()){if(_9||_10){if(_9)_11=_2.$130b.name;if(_10&&_3.useSublanes&&_2.$1298){_12=_2.$1298.name}}}else if(_4.usesLanes()){if(_9||_10){if(_9)_11=_2.$130b.name;if(_10&&_3.useSublanes&&_2.$1298){_12=_2.$1298.name}}else return false}
var _13=_2.$142s.duplicate();_13.setTime(_13.getTime()+_3.getEventLength(_6,"ms"));var _14=[_2.$142s.duplicate(),_13];var _15=_14[0].getTime()-_3.getEventStartDate(_6).getTime(),_16=Math.floor(_15/(1000*60)),_17={};if(_4.isTimelineView()){if(_6[_3.leadingDateField]&&_6[_3.trailingDateField]){_14.add(_6[_3.leadingDateField].duplicate());_14[2].setMinutes(_14[2].getMinutes()+_16);_14.add(_6[_3.trailingDateField].duplicate());_14[3].setMinutes(_14[3].getMinutes()+_16);_17[_3.leadingDateField]=_14[2];_17[_3.trailingDateField]=_14[3]}}
if(_11==null)_11=_6[_3.laneNameField];if(_3.adjustEventTimes){var _18=_3.adjustEventTimes(_6,_1,_14[0],_14[1],_11);if(_18){_14[0]=_18[0].duplicate();_14[1]=_18[1].duplicate()}}
if(_3.allowEventOverlap==false){var _19=_3.checkForOverlap(_4,_1,_6,_14[0],_14[1],_11);if(_19==true){if(_3.timelineEventOverlap){_3.timelineEventOverlap(false,_6,_1,_14[0],_14[1],_11)}
return false}else if(isc.isAn.Array(_19)){_14[0]=_19[0].duplicate();_14[1]=_19[1].duplicate();if(_3.timelineEventOverlap){_3.timelineEventOverlap(true,_6,_1,_14[0],_14[1],_11)}}}
if(_3.isZeroLengthEvent(_6))_14[1]=null;if(_14[0]!=_2.$142s)_2.$142s=_14[0];if(_14[1]!=_2.$142t)_2.$142t=_14[1]}else{_2.$142t=_2.$142s}
var _20=isc.addProperties({},_6,_17);var _21=_3.createEventObject(_20,_2.$142s,_2.$142t,_2.$130b&&_2.$130b.name,_2.$1298&&_2.$1298.name);if(_3.getEventStartDate(_20).getTime()==_3.getEventStartDate(_21).getTime()){if(!_4.usesLanes()||_20[_3.laneNameField]==_21[_3.laneNameField]){return}}
var _22=_3.eventRepositionStop(_6,_21,_17,this);this.$1246=false;if(_22!=false){if(!_8){if(_4.isTimelineView()){if(_3.timelineEventMoved(_6,_2.$142s,_2.$142t,_11)==false)return false}else{if(_3.eventMoved(_2.$142s,_6,_11)==false)return false}
_3.updateCalendarEvent(_6,_21,_17)}else{var _23=_3.indicators.find(_3.nameField,_6[_3.nameField]);_23[_3.startDateField]=_2.$142s;_1.calendarView.drawIndicators();_1.calendarView.drawZones()}}
delete _1.$1245;return isc.EH.STOP_BUBBLING},handleDragResizeStart:function(){var _1=this.eventCanvas,_2=_1.event,_3=_1.calendar,_4=this.view,_5=_4.body;if(!_3.canResizeEvent(_1.event,_4))return false;this.$1244=true;var _6=_5.getEventRow(),_7=_5.getRowTop(_6),_8=_5.getRowHeight(_4.getRecord(_6),_6),_9=_5.getEventColumn(),_10=_5.getColumnLeft(_9),_11=_5.getColumnWidth(_9),_12=_5.getOffsetX()-_1.getLeft(),_13=_5.getOffsetY()-_1.getTop(),_14=_1.getVisibleWidth(),_15=_4.usesLanes(),_16=_4.isTimelineView(),_17=_16&&(_12<_14/2),_18=_15?_4.getLaneFromPoint():null,_19=_18&&_3.useSublanes?_3.getSublaneFromPoint():null;var _20;if(_16){_20={$8l:_6,$644:_9,$1299:_4.usesLanes(),$1297:_3.useSublanes,$117z:_4.getDateLeftOffset(_3.getEventStartDate(_2)),$1171:_1.getLeft()+_14,$125a:_7+(_19?_19.top:0),$125b:_19?_19.height:_18.height,$131b:_1.getVisibleWidth(),$1172:_17,$131q:!_17,$131e:_3.getEventStartDate(_1.event),$131f:_3.getEventEndDate(_1.event),$130b:_18,$1298:_19}}else{_20={$8l:_6,$644:_9,$1299:_4.usesLanes(),$1297:_3.useSublanes,$117z:_10+(_15&&_19?_19.left:0),$1171:_1.getLeft()+_14,$125a:_1.getTop(),$125b:_1.getVisibleHeight(),$131b:(_19?_19.width:(_18&&_4.getLaneWidth?_4.getLaneWidth(_2[_3.laneNameField]):_11)),$131g:true,$131e:_3.getEventStartDate(_1.event),$131f:_3.getEventEndDate(_1.event),$130b:_18,$1298:_19}}
if(_20.$125a==-1){_20.$125a=0;_20.$125b-=_5.getScrollTop()}
_1.$1245=_20;this.positionToEventCanvas(true);_20.$1827=false;return isc.EH.STOP_BUBBLING},dragResizeMove:function(){var _1=this.eventCanvas,_2=_1.$1245,_3=_1.event,_4=_1.calendar,_5=this.view,_6=_2.$125a,_7=_2.$117z,_8=_2.$125b,_9=_2.$131b,_10=_2.$131e,_11=_2.$131f,_12=isc.DateUtil;var _13=_5.getSnapData();var _14;if(_2.$131g){_14=_13.endDate;_11=_14;if(_11.getDate()!=_10.getDate()){}
var _15=_5.getDateTopOffset(_11);_8=_15-_6}else if(_2.$1172){_14=_13&&_13.startDate.duplicate();if(!_14)_14=_5.startDate.duplicate();_10=_14;var _16=_7+_9;if(_3[_4.durationField]!=null){var _17=_11.getTime()-_10.getTime(),_18=_3[_4.durationUnitField],_19=_12.getTimeUnitMilliseconds(_18);if(_17%_19!=0){var _20=Math.round(_12.convertPeriodUnit(_17,"ms",_18)),_10=_12.dateAdd(_11,_18,_20*-1,null,null,null,this.firstDayOfWeek)}}
var _21=_5.getSnapData(null,null,_10);var _7=_21.startLeftOffset;_9=(_16-_7)}else{_14=_13&&_13.endDate.duplicate();if(!_14)_14=_5.endDate.duplicate();_11=_14.duplicate();var _22=_4.getVisibleEndDate(_5);if(_11.getTime()>_22.getTime()){_11.setTime(_22.getTime())}
if(_3[_4.durationField]!=null){var _17=_11.getTime()-_10.getTime(),_18=_3[_4.durationUnitField],_19=_12.getTimeUnitMilliseconds(_18);if(_17%_19!=0){var _20=Math.round(_12.convertPeriodUnit(_17,"ms",_18)),_11=_12.dateAdd(_10,_18,_20,null,null,null,this.firstDayOfWeek)}}
var _21=_5.getSnapData(null,null,_10);var _23=_5.getSnapData(null,null,_11);var _7=_21?_21.startLeftOffset:0,_16=_23.endLeftOffset;_9=_16-_7}
if(_11.getTime()<=_10.getTime()||_9<=0||_8<=0){return isc.EH.STOP_BUBBLING}
var _24=_4.createEventObject(_3,_10,_11);var _25=_4.eventResizeMove(_3,_24,_5,_2);_2.$131e=_10;_2.$131f=_11;_2.$125a=_6;_2.$117z=_7;_2.$131b=_9;_2.$125b=_8;this.setRect(_2.$117z,_2.$125a,_2.$131b,_2.$125b);if(_25!=false){_2.$1827=false;_2.$142s=_10.duplicate();_2.$142t=_11.duplicate();this.setDragCursor("default")}else{_2.$1827=true;this.setDragCursor("not-allowed")}
if(_5.shouldShowDragHovers())isc.Hover.show(this.getHoverHTML(),this.hoverProps);return isc.EH.STOP_BUBBLING},setDragCursor:function(_1){var _2=this.getCurrentCursor();if(_2==_1)return;this.setCursor(_1);this.eventCanvas.setCursor(_1);this.view.setCursor(_1);if(this.view.body)this.view.body.setCursor(_1);if(this.view.frozenBody)this.view.frozenBody.setCursor(_1);if(isc.EH.lastEvent&&isc.EH.lastEvent.target&&isc.EH.lastEvent.target.setCursor){isc.EH.lastEvent.target.setCursor(_1)}},dragResizeStop:function(){var _1=this.eventCanvas,_2=_1.$1245,_3=_1.calendar,_4=this.view,_5=_1.event,_6=_2.$142s,_7=_2.$142t;if(_2.$1827&&!_3.eventUseLastValidDropDates){_6=null;_7=null}
this.setDragCursor("default");if(_4.shouldShowDragHovers())isc.Hover.hide();this.hide();if((_2.$1172&&!_6)||(_2.$131q&&!_7)){this.$1244=false;return isc.EH.STOP_BUBBLING}
var _8=_3.createEventObject(_5,_6,_7);if(_5[_3.durationField]!=null){var _9=_7.getTime()-_6.getTime();var _10=Math.round(isc.DateUtil.convertPeriodUnit(_9,"ms",_5[_3.durationUnitField]));_8[_3.durationField]=_10;_7=_2.$142t=_3.getEventEndDate(_8);_8[_3.endDateField]=_7}
if(_3.getEventStartDate(_5).getTime()==_3.getEventStartDate(_8).getTime()&&_3.getEventEndDate(_5).getTime()==_3.getEventEndDate(_8).getTime())
{return}
if(_4.isTimelineView()){if(_2.$1172&&_5[_3.leadingDateField]){var _11=_5[_3.leadingDateField].duplicate();var _12=isc.DateUtil.getPeriodLength(_5[_3.startDateField],_8[_3.startDateField],"mn");_11.setMinutes(_11.getMinutes()+_12);_8[_3.leadingDateField]=_11}
if(!_2.$1172&&_5[_3.trailingDateField]){var _13=_5[_3.trailingDateField].duplicate();var _12=isc.DateUtil.getPeriodLength(_5[_3.endDateField],_8[_3.endDateField],"mn");_13.setMinutes(_13.getMinutes()+_12);_8[_3.trailingDateField]=_13}}
var _14=_3.eventResizeStop(_5,_8,null,this);if(_14!=false){if(_4.isTimelineView()){if(_3.timelineEventResized(_5,_6,_7)==false)return false}else{if(_3.eventResized(_7,_5)==false)return false}
_3.updateCalendarEvent(_5,_8)}
this.$1244=false;return isc.EH.STOP_BUBBLING}};isc.A.$171d="center";isc.B.push(isc.A.mouseUp=function isc_CalendarView_mouseUp(){return isc.EH.STOP_BUBBLING},isc.A.mouseDown=function isc_CalendarView_mouseDown(){return isc.EH.STOP_BUBBLING},isc.A.init=function isc_CalendarView_init(){this.calendar=this.creator;this.resetEventCaches(true);this.resetCanvasCaches(true);this.resetLaneCaches(true);return this.Super("init",arguments)},isc.A.resetEventCaches=function isc_CalendarView_resetEventCaches(_1){this.$232i=_1?{}:null;this.$232j=_1?{}:null;this.$232k=_1?{}:null},isc.A.resetCanvasCaches=function isc_CalendarView_resetCanvasCaches(_1){this.$232l=_1?{}:null;this.$232m=_1?{}:null;this.$232n=_1?{}:null;this.$232o=_1?{}:null},isc.A.resetLaneCaches=function isc_CalendarView_resetLaneCaches(_1){this.laneMap=_1?{}:null;this.laneIndexCache=_1?{}:null;this.laneHeightCache=_1?{}:null},isc.A.initWidget=function isc_CalendarView_initWidget(){this.$27q={};this.$1743=[];this.$1725=[];var _1=this.calendar;this.firstDayOfWeek=_1.firstDayOfWeek;var _2=this.showHover;if(_2==null)_2=_1.showViewHovers;this.setShowHover(_2);this.Super("initWidget",arguments);if(this.installLocalHandlers)this.installLocalHandlers()
this.setChosenDate(this.chosenDate)},isc.A.setEventData=function isc_CalendarView_setEventData(_1){this.$1743=_1},isc.A.getEventData=function isc_CalendarView_getEventData(){if(!this.$1743)this.$1743=[];return this.$1743},isc.A.addEventData=function isc_CalendarView_addEventData(_1){var _2=this.getEventData();if(!_2.contains(_1)){_2.add(_1);return true}
return false},isc.A.removeEventData=function isc_CalendarView_removeEventData(_1){this.getEventData().remove(_1)},isc.A.viewMouseMove=function isc_CalendarView_viewMouseMove(_1,_2,_3,_4,_5){},isc.A.viewDragMove=function isc_CalendarView_viewDragMove(_1){this.logInfo("In viewDragMove");this.viewMouseMove()},isc.A.getMouseData=function isc_CalendarView_getMouseData(){return this.$1744},isc.A.getVisibleStartDate=function isc_CalendarView_getVisibleStartDate(){return this.startDate},isc.A.getVisibleEndDate=function isc_CalendarView_getVisibleEndDate(){return this.endDate},isc.A.setChosenDate=function isc_CalendarView_setChosenDate(_1){var _2=_1.logicalDate?_1.duplicate():isc.DateUtil.getLogicalDateOnly(_1);var _3=_2.getWeek();this.logicalDate=_2.duplicate();this.chosenDate=_2;this.chosenWeek=_3;this.firstDayOfWeek=this.calendar.firstDayOfWeek;var _4=this.firstDayOfWeek;if(this.rangeUnit){this.periodStartDate=this.startDate=isc.DateUtil.getStartOf(this.chosenDate,this.rangeUnit,false,_4);this.periodEndDate=this.endDate=isc.DateUtil.getEndOf(this.chosenDate,this.rangeUnit,false,_4);this.logicalDate=isc.DateUtil.createLogicalDate(this.startDate)}
this.$132n=false;if(this.isSelectedView()){this.updateRange();this.$1739()}else{this.$220m=true;this.$123s=true}},isc.A.getPeriodStartDate=function isc_CalendarView_getPeriodStartDate(){return this.periodStartDate},isc.A.getPeriodEndDate=function isc_CalendarView_getPeriodEndDate(){return this.periodEndDate},isc.A.updateRange=function isc_CalendarView_updateRange(_1){delete this.$220m;if(this.isWeekView()||this.isDayView()){this.updateFieldDates();this.updateRowDates();this.markForRedraw()}else if(this.isMonthView()){}},isc.A.getFieldTitle=function isc_CalendarView_getFieldTitle(_1){var _2=this.calendar,_3=this.Super("getFieldTitle",arguments),_4=this.getUnderlyingField(_1);if(_4){var _5=_4.date,_6=_5?_5.getDay():_4.$654;if(_6!=null){if(_2.getDateHeaderTitle){_3=_2.getDateHeaderTitle(_5,_6,_3,this)||_3}}}
return _3},isc.A.getMinimumSnapGapTime=function isc_CalendarView_getMinimumSnapGapTime(_1){var _2=this.$27q,_3=_2.minimumSnapGapMillis;if(!_3){var _4=[1,5,10,15,20,30,60,120,180,240,360,480,720,1440];var _5=isc.DateUtil.convertPeriodUnit(_2.millisPerPixel,"ms","mn");for(var i=0;i<_4.length;i++){if(_5<=_4[i]){_5=_4[i];break}}
_3=isc.DateUtil.convertPeriodUnit(_5,"mn","ms")}
if(!_1)_1="mn";return Math.floor(isc.DateUtil.convertPeriodUnit(_3,"ms",_1))},isc.A.getTimePerCell=function isc_CalendarView_getTimePerCell(_1){var _2=this.calendar,_3=this.$27q,_4=_3.millisPerCell;if(!_4){_4=isc.DateUtil.convertPeriodUnit(_2.minutesPerRow,"mn","ms")}
if(!_1)_1="mn";return Math.floor(isc.DateUtil.convertPeriodUnit(_4,"ms",_1))},isc.A.getTimePerSnapGap=function isc_CalendarView_getTimePerSnapGap(_1){var _2=this.calendar,_3=this.$27q,_4=_3.millisPerSnapGap;if(!_4){if(_3.calendarEventSnapGap==null){_4=this.getTimePerCell("ms")}else if(_3.calendarEventSnapGap==0){_4=this.getMinimumSnapGapTime("ms")}else{_4=isc.DateUtil.convertPeriodUnit(_3.calendarEventSnapGap,"mn","ms")}
_3.millisPerSnapGap=_4}
if(!_1)_1="mn";return isc.DateUtil.convertPeriodUnit(_4,"ms",_1)},isc.A.getTimePerPixel=function isc_CalendarView_getTimePerPixel(_1){var _2=this.calendar,_3=this.$27q;var _4=Math.floor(this.getTimePerCell("ms")/this.getRowHeight(this.getRecord(0),0));if(!_1)_1="mn";return isc.DateUtil.convertPeriodUnit(_4,"ms",_1)},isc.A.getSnapGapPixels=function isc_CalendarView_getSnapGapPixels(_1,_2){var _3=this.getTimePerCell()/this.getTimePerSnapGap();return Math.round(this.cellHeight/_3)},isc.A.getDateLabelText=function isc_CalendarView_getDateLabelText(_1,_2){return null},isc.A.setShowHover=function isc_CalendarView_setShowHover(_1){if(this.showViewHovers==false)return;this.showHover=_1;this.canHover=_1},isc.A.shouldShowEventHovers=function isc_CalendarView_shouldShowEventHovers(){if(this.showHover==false||this.calendar.showViewHovers==false)return false;if(this.showEventHovers!=null)return this.showEventHovers;return this.calendar.showEventHovers},isc.A.shouldShowHeaderHovers=function isc_CalendarView_shouldShowHeaderHovers(){if(this.showHover==false||this.calendar.showViewHovers==false)return false;if(this.showHeaderHovers!=null)return this.showHeaderHovers;return this.calendar.showHeaderHovers},isc.A.shouldShowLaneFieldHovers=function isc_CalendarView_shouldShowLaneFieldHovers(){if(this.showHover==false)return false;if(this.showLaneFieldHovers!=null)return this.showLaneFieldHovers;return this.calendar.showLaneFieldHovers},isc.A.shouldShowCellHovers=function isc_CalendarView_shouldShowCellHovers(){if(this.showHover==false)return false;if(this.showCellHovers!=null)return this.showCellHovers;return this.calendar.showCellHovers},isc.A.shouldShowDragHovers=function isc_CalendarView_shouldShowDragHovers(){if(this.showHover==false)return false;if(this.showDragHovers!=null)return this.showDragHovers;return this.calendar.showDragHovers});isc.evalBoundary;isc.B.push(isc.A.shouldShowZoneHovers=function isc_CalendarView_shouldShowZoneHovers(){if(this.shouldShowCellHovers())return false;if(this.showZoneHovers!=null)return this.showZoneHovers;return this.calendar.showZoneHovers},isc.A.isSelectedView=function isc_CalendarView_isSelectedView(){return this.creator.getCurrentViewName()==this.viewName},isc.A.isTimelineView=function isc_CalendarView_isTimelineView(){return this.viewName=="timeline"},isc.A.isDayView=function isc_CalendarView_isDayView(){return this.viewName=="day"},isc.A.isWeekView=function isc_CalendarView_isWeekView(){return this.viewName=="week"},isc.A.isMonthView=function isc_CalendarView_isMonthView(){return this.viewName=="month"},isc.A.updateLaneRollover=function isc_CalendarView_updateLaneRollover(_1){if(!this.isTimelineView())return;this.clearLastHilite();if(_1==null)return;this.body.lastOverRow=_1;this.body.updateRollOver(_1)},isc.A.rebuild=function isc_CalendarView_rebuild(_1){if(_1==null)_1=true;if(this.$152e)this.$152e(_1);else if(this.rebuildFields){this.rebuildFields();this.setChosenDate(this.chosenDate)}else{if(this.isMonthView())this.refreshFields();this.refreshEvents("rebuild")}},isc.A.initCacheValues=function isc_CalendarView_initCacheValues(){var _1=this.calendar;this.$27q={firstDayOfWeek:this.firstDayOfWeek,rangeStartDate:_1.getPeriodStartDate(this),rangeEndDate:_1.getPeriodEndDate(this),calendarEventSnapGap:_1.eventSnapGap};this.$27q.rangeStartMillis=this.$27q.rangeStartDate.getTime();this.$27q.rangeEndMillis=this.$27q.rangeEndDate.getTime();this.updateSnapProperties();return this.$27q},isc.A.updateSnapProperties=function isc_CalendarView_updateSnapProperties(){delete this.$27q.millisPerCell;delete this.$27q.millisPerSnapGap;delete this.$27q.millisPerPixel;delete this.$27q.snapGapPixels;this.$27q.millisPerCell=this.getTimePerCell("ms");this.$27q.millisPerPixel=this.getTimePerPixel("ms");this.$27q.minimumSnapGapMillis=this.getMinimumSnapGapTime("ms");this.$27q.millisPerSnapGap=this.getTimePerSnapGap("ms")},isc.A.getLaneIndex=function isc_CalendarView_getLaneIndex(_1){return null},isc.A.getLane=function isc_CalendarView_getLane(_1){return null},isc.A.getLaneFromPoint=function isc_CalendarView_getLaneFromPoint(_1,_2){return null},isc.A.getSublane=function isc_CalendarView_getSublane(_1,_2){if(!this.hasSublanes())return null;var _3=this.getLane(_1),_4=_3&&_3.sublanes?isc.isAn.Object(_2)?_2:_3.sublanes.find(this.calendar.laneNameField,_2):null;return _4},isc.A.getSublaneFromPoint=function isc_CalendarView_getSublaneFromPoint(_1,_2){return null},isc.A.updateLanes=function isc_CalendarView_updateLanes(_1){this.setLanes(_1,true);this.body.redraw()},isc.A.getLaneMap=function isc_CalendarView_getLaneMap(){return this.laneMap},isc.A.usesLanes=function isc_CalendarView_usesLanes(){return this.isTimelineView()||(this.isDayView()&&this.calendar.showDayLanes)},isc.A.hasLanes=function isc_CalendarView_hasLanes(){return this.usesLanes()&&this.lanes&&this.lanes.length>0},isc.A.hasSublanes=function isc_CalendarView_hasSublanes(){return this.calendar.useSublanes&&this.usesLanes()},isc.A.useLanePadding=function isc_CalendarView_useLanePadding(){if(this.isTimelineView())return true;if(this.usesLanes()){return this.calendar.eventOverlap?false:true}
return false},isc.A.canScrollToEvent=function isc_CalendarView_canScrollToEvent(_1){var _2=this.startDate.getTime(),_3=this.endDate.getTime(),_4=this.calendar.getEventStartDate(_1),_5=this.calendar.getEventEndDate(_1);if((_4.getTime()>=_2&&_4.getTime()<=_3)||(_5.getTime()>=_2&&_5.getTime()<=_3))
{return true}
return false},isc.A.scrollToEvent=function isc_CalendarView_scrollToEvent(_1){var _2=this.calendar,_3={start:this.startDate.getTime(),end:this.endDate.getTime()},_4=_2.getEventStartDate(_1),_5=_2.getEventEndDate(_1);if(this.canScrollToEvent(_1)){var x=null,y=null;var _8=this.getCurrentEventCanvas(_1);if(_8){x=_8.getLeft();y=_8.getTop()}else{x=this.getDateLeftOffset(_4);if(this.isTimelineView()){y=this.getRowTop(this.getLaneIndex(_1[_2.laneNameField]))}else{y=this.getDateTopOffset(_4,_1[_2.laneNameField])}}
this.body.scrollTo(x,y)}},isc.A.getCellCSSText=function isc_CalendarView_getCellCSSText(_1,_2,_3){var _4=this.calendar.$116j(this,_1,_2,_3);return _4},isc.A.getEventCanvasStyle=function isc_CalendarView_getEventCanvasStyle(_1){if(this.usesLanes()){var _2=this.calendar,_3=_2.laneNameField,_4=_2.sublaneNameField,_5=_2.eventStyleNameField,_6=this.getLane(_1[_3]),_7=_6&&_2.useSublanes?this.getSublane(_6[_3],_1[_4]):null;return(_7&&_7.eventStyleName)||(_6&&_6.eventStyleName)||this.eventStyleName}
return this.eventStyleName},isc.A.getDateFromPoint=function isc_CalendarView_getDateFromPoint(){return this.getCellDate()},isc.A.cellHoverHTML=function isc_CalendarView_cellHoverHTML(_1,_2,_3){var _4=this.calendar.$140d(this,_1,_2,_3);return _4},isc.A.headerHoverHTML=function isc_CalendarView_headerHoverHTML(_1){var _2=this.getField(_1);return this.calendar.$140e(this,this.fieldHeaderLevel,_2,_2.date,_2.endDate)},isc.A.getPrintHTML=function isc_CalendarView_getPrintHTML(_1,_2){if(this.isMonthView())return this.Super("getPrintHTML",arguments);if(_2){this.delayCall("asyncGetPrintHTML",[_1,_2]);return null}else{return this.asyncGetPrintHTML(_1,_2)}},isc.A.asyncGetPrintHTML=function isc_CalendarView_asyncGetPrintHTML(_1,_2){this.$158l=true;this.refreshVisibleEvents(true,"asyncGetPrintHTML");_1=isc.addProperties({},_1);this.body.printChildrenAbsolutelyPositioned=true;var _3=this.calendar,_4=this.isTimelineView(),_5=this.isWeekView(),_6=this.isDayView(),_7=this.isMonthView();if(_7)return;var _8=this.getVisibleFields(this.completeFields),_9=this.getData(),_10=isc.StringBuffer.create(),_11=0,_12=[];if(isc.isA.Tree(_9))_9=_9.$27m;for(var i=0;i<_8.length;i++){var _14=_8[i];var _15=this.getFieldHeaderButton(_14.masterIndex);var _16=_15?_15.width||_15.getVisibleWidth():null;if(_16==null)_16=this.getFieldWidth(_14);_16=_4?Math.ceil(_16):Math.floor(_16);_12.add(_16)}
_11=_12.sum();var _17="<TR",_18="</TR>",_19=">",_20=" HEIGHT=",_21=" VALIGN=";var _22=40;_10.append("<div style='position:relative;'>");_10.append("<TABLE cellpadding='0' cellspacing='0' WIDTH='",_11,"' style='","border: 1px solid grey;'>");_10.append("<THEAD>");if(this.showHeader){var _23=this.getPrintHeaders(0,this.fields.length,_12);this.$238k=isc.Canvas.measureContent(_23,"printHeader",true,true,{wrap:false});_10.append(_23)}
_10.append("</THEAD>");_22+=this.getHeaderHeight();_10.append("<TBODY>");for(var i=0;i<_9.length;i++){var _24=Math.floor(this.getRowHeight(_9[i],i));_10.append(_17,_20,_24,_19);for(var j=0;j<_8.length;j++){var _26=this.getCellValue(_9[i],i,j);_10.append("<TD class='",this.getCellStyle(_9[i],i,j),"' ","style='width:",_12[j]-1,"px; ","box-sizing: border-box; ","max-width:",_12[j]-1+"px;","border-width: 0px 1px 1px 0px; ","height: ",_24,"px;","border-bottom: 1px solid #ABABAB; border-right: 1px solid #ABABAB; ","border-top: none; border-left: none;",this.getCellCSSText(_9[i],i,j),"'>");_10.append(this.getCellValue(_9[i],i,j)||"&nbsp;");_10.append("</TD>")}
_10.append(_18)}
_10.append("</TBODY>");_10.append("</TABLE>");var _27=this.body.children;for(var i=0,_28=_27.length;i<_28;i++){var _29=_27[i],_30=_29.isEventCanvas||_29.isZoneCanvas||_29.isIndicatorCanvas;if(!_30)continue;if(!_29.isDrawn()||!_29.isVisible())continue;if(_29.isZoneCanvas)_1.i=0;else if(_29.isIndicatorCanvas)_1.i=_28;else _1.i=i;var _31=_29.getPrintHTML(_1);_10.append(_31)}
_10.append("</div>");var _16=_10.release(false);if(_2){this.fireCallback(_2,"HTML",[_16])}
delete this.$158l;return _16},isc.A.getPrintHeaders=function isc_CalendarView_getPrintHeaders(_1,_2,_3){var _4=(this.isRTL()?isc.Canvas.LEFT:isc.Canvas.RIGHT),_5=this.headerBaseStyle,_6;var _7=this.headerRowPrintHeight;if(this.headerSpans){var _8=[],_9=1;for(var i=_1;i<_2;i++){var _11=this.getField(i);_8[i]=[_11];var _12=this.spanMap[_11.name];while(_12!=null){_8[i].add(_12);_12=_12.parentSpan}
_9=Math.max(_8[i].length,_9)}
_6=[];for(var i=_9-1;i>=0;i--){_6[_6.length]="<TR HEIGHT="+_7+">";var _13=null,_14=null;for(var _15=_1;_15<_2;_15++){var _16=1,_17=1;var _18=(i==0);var _19=_8[_15][i];if(_19=="spanned"){continue}
var _20,_21=_15,_22=[];_17=0;while(_21<_2){var _23=null,_24=false;for(var _25=0;(i-_25)>=0;_25++){_23=_8[_21][i-_25];if(_23!=null){if(_19==null){_19=_23;_20=_25;if(i-_25==0){_18=true}}
if(_19==_23){_22[_17]=_25;_20=Math.min(_25,_20)}else{_24=true}
break}}
if(_24){break}
_21++;_17++}
if(_20!=null){_16=_20+1}
for(var _26=0;_26<_22.length;_26++)
{var _27=_8[_26+_15],_25=_22[_26];for(var _28=0;_28<=_25;_28++){if(_26==0&&_28==0){_27[i-_28]=_19}else if(_28<=_20){_27[i-_28]="spanned"}else{_27[i-_28]=null}}}
if(_19==null){this.logWarn("Error in getPrintHeaders() - unable to generate print header HTML from this component's specified headerSpans")}
var _29="center",_30;if(_18){_29=_19.align||_4;_30=this.getHeaderButtonTitle(_19.masterIndex)}else{_30=_19.title}
var _31=_6.length;_6[_6.length]="<TD class='";_6[_6.length]=_5;_6[_6.length]="' align='";_6[_6.length]="center";_6[_6.length]="' rowSpan='";_6[_6.length]=_16;_6[_6.length]="' colSpan='";_6[_6.length]=_17;_6[_6.length]="' ";var _32=_3[(_18?_19.masterIndex:_15)];_6[_6.length]="style='margin: 0px; padding: 0px; width:"+_32+"px; height:"+_7+"px; border-width: 0px 1px 1px 0px;' ";_6[_6.length]=">";_6[_6.length]=_30;_6[_6.length]="</TD>"}
_6[_6.length]="</TR>"}}else{_6=["<TR HEIGHT="+_7+">"];var _33=["<TD CLASS='",_5,"' HEIGHT="+_7+" ALIGN="].join(""),_34=this.frozenBody?this.frozenBody.fields.length:0;if(this.frozenBody){for(var _35=0;_35<_34;_35++){var _11=this.frozenBody.fields[_35];if(!_11)continue;var _29=_11.align||_4;var _36=_3[_35];var _37=this.getHeaderButtonTitle(_11.masterIndex);_6.addList([_33,_29," style='margin: 0px; padding: 0px; width:"+_36+"px; height:"+_7+"px; border-width: 0px 1px 1px 0px;'>",_37,"</TD>"])}}
for(var _35=0;_35<(_2-_34);_35++){var _11=this.body.fields[_35];if(!_11)continue;var _29=_11.align||_4;var _36=_3[_35+_34];_6.addList([_33,_29," style='width:"+_36+"px;'>",this.getHeaderButtonTitle(_11.masterIndex),"</TD>"])}
_6[_6.length]="</TR>"}
return _6.join(isc.emptyString)},isc.A.scrolled=function isc_CalendarView_scrolled(){if(this.renderEventsOnDemand&&this.refreshVisibleEvents){delete this.$27q.viewportStartMillis;delete this.$27q.viewportEndMillis;this.delayedRefreshVisibleEvents(null,"scrolled")}},isc.A.resized=function isc_CalendarView_resized(_1,_2,_3){var _4=this.Super('resized',arguments);if(this.renderEventsOnDemand){if(!this.$81r&&this.isDrawn()){this.refreshVisibleEvents(null,"resized - "+_3)}}
return _4},isc.A.forceDataSort=function isc_CalendarView_forceDataSort(_1,_2){var _3=this.calendar,_4=[];if(this.usesLanes()){_4.add({property:_3.laneNameField,direction:"ascending"})}
if(_3.overlapSortSpecifiers){_4.addList(_3.overlapSortSpecifiers)}else{_4.add({property:_3.startDateField,direction:"ascending"})}
if(_2||!_1){if(!_1)_1=this.getEventData()}
_1.setSort(_4)},isc.A.findEventsInRange=function isc_CalendarView_findEventsInRange(_1,_2,_3,_4){var _5=this.calendar,_6={},_7=_3!=null&&this.usesLanes();_6[_5.startDateField]=_1;_6[_5.endDateField]=_2;if(_7)_6[_5.laneNameField]=_3;var _8=this.findOverlappingEvents(_6,_6,[_6],_7,_4,true);return _8},isc.A.findOverlappingEvents=function isc_CalendarView_findOverlappingEvents(_1,_2,_3,_4,_5,_6){var _7=this.calendar,_8=_5!=null;var _9=_8?_5:this.getEventData();if(!_8)this.forceDataSort(_9,_6);var _10=[],_11=_9.getLength(),_12=_7.getEventStartDate(_2),_13=_7.getEventEndDate(_2);var _14={};var _15=_4?_1[_7.laneNameField]:null,_16=0;if(_15)_16=_9.findIndex(_7.laneNameField,_15);if(_16<0)return _10;var _17=this.isTimelineView();for(var i=_16;i<_11;i++){var _19=_9.get(i);if(!_19){isc.logWarn('findOverlappingEvents: potentially invalid index: '+i);break}
if(_4&&_19[_7.laneNameField]!=_15)break;var _20=false;if(_3&&_3.length>0){for(var j=0;j<_3.length;j++){if(_7.eventsAreSame(_19,_3[j])){_20=true;break}}
if(_20)continue}
if(_17){if(_19[_7.leadingDateField]&&_19[_7.trailingDateField]){_14[_7.leadingDateField]=_2[_7.leadingDateField];_14[_7.trailingDateField]=_2[_7.trailingDateField];if(_14[_7.trailingDateField]&&this.endDate){if(_14[_7.trailingDateField].getTime()>this.endDate.getTime()){_14[_7.trailingDateField].setTime(this.endDate.getTime()-1)}}}else{_14[_7.startDateField]=_12;_14[_7.endDateField]=_13;if(_14[_7.endDateField].getTime()>this.endDate.getTime()){_14[_7.endDateField].setTime(this.endDate.getTime()-1)}}}else{var _22=isc.DateUtil.getStartOf(_13,"d",false).getTime(),_23=isc.DateUtil.getEndOf(_12,"d",false).getTime(),_24=_7.getEventStartDate(_19),_25=_24.getTime(),_26=_7.getEventEndDate(_19),_27=_26.getTime();if(_25>_23||_27<_22)continue;if(_25<_22&&_27>_23){if(this.isWeekView())continue;_25=_22}
_14[_7.startDateField]=_12;if(_14[_7.startDateField].getTime()<_22){_14[_7.startDateField].setTime(_22)}
_14[_7.endDateField]=_13;if(_14[_7.endDateField].getTime()>_23){_14[_7.endDateField].setTime(_23)}}
_14[_7.laneNameField]=_19[_7.laneNameField];if(this.eventsOverlap(_14,_19,_4)){_10.add(_19)}}
return _10},isc.A.eventsOverlap=function isc_CalendarView_eventsOverlap(_1,_2,_3){var a=_1,_5=a["_"+this.viewName]||{},b=_2,_7=b["_"+this.viewName]||{},_8=this.calendar,_9=_8.startDateField,_10=_8.endDateField;if(_3&&a[_8.laneNameField]!=b[_8.laneNameField])return false;if(this.isTimelineView()){if(a[_8.leadingDateField]&&b[_8.leadingDateField])_9=_8.leadingDateField;if(a[_8.trailingDateField]&&b[_8.trailingDateField])_10=_8.trailingDateField}
var _11=a[_9],_12=a[_10]||_8.getEventEndDate(a);if(!_11||!_12)return false;var _13=_11.duplicate(),_14=_12.duplicate(),_15=b[_9],_16=b[_10]||_8.getEventEndDate(b),_17=_15.duplicate(),_18=_16.duplicate();if(this.isTimelineView()){if(_15.getTime()>this.endDate.getTime())return false;if(_16.getTime()<this.startDate.getTime())return false;if(_17.getTime()<_14.getTime()&&_18.getTime()>_13.getTime())return true;if(_17.getTime()!=_14.getTime()&&_18.getTime()!=_13.getTime()){var _19=Math.round(_8.getSnapGapPixels(this));_13=_5.snapStartLeftOffset||this.getDateLeftOffset(_11);_14=Math.max((_5.snapEndLeftOffset||this.getDateRightOffset(_12)),_13);if(_14-_13<_19)_14=_13+_19;_17=_7.snapStartLeftOffset||this.getDateLeftOffset(_15);_18=Math.max((_7.snapEndLeftOffset||this.getDateRightOffset(_16)),_17);if(_18-_17<_19)_18=_17+_19}}
if(_8.equalDatesOverlap&&_8.allowEventOverlap){if((_13<_17&&_14>=_18&&_13<=_18)||(_13<=_18&&_14>_18)||(_13<=_17&&_14>=_18)||(_13>=_17&&_14<=_18)){return true}else{return false}}else{if(_17<_14&&_18>_13)return true;return false}},isc.A.updateEventRange=function isc_CalendarView_updateEventRange(_1,_2){if(!isc.isAn.Object(_2))_2=this.overlapRanges.ranges[_2];var _3=_2.events;_3.remove(_1);this.updateOverlapRanges(_3)},isc.A.updateOverlapRanges=function isc_CalendarView_updateOverlapRanges(_1){var _2=this.calendar,_3=_1||this.getEventData(),_4=this.overlapRanges||[],_5=_3.getLength(),_6=this.isTimelineView(),_7=this.usesLanes(),_8=!_6,_9=[],_10=this.startDate,_11=this.endDate;var _12=(isc.isA.ResultSet(_3)?_3.allRows:_3);_12.setProperty("tagged",false);_12.setProperty("overlapProps",null);_12.setProperty("slotNum",null);_12.setSort([{property:_2.laneNameField,direction:"ascending"},{property:_2.startDateField,direction:"ascending"},{property:_2.endDateField,direction:"descending"}]);for(var i=0;i<_5;i++){var _14=_12.get(i);var _15={events:[_14]};_15[_2.startDateField]=_2.getEventStartDate(_14);if(_15[_2.startDateField]<_10)_15[_2.startDateField]=_10;_15[_2.endDateField]=_2.getEventEndDate(_14);if(_15[_2.endDateField]>_11)_15[_2.endDateField]=isc.DateUtil.adjustDate(_11,"-1ms");_15[_2.laneNameField]=_15.lane=_7?_14[_2.laneNameField]:null;var _16=true;for(var j=0;j<_4.length;j++){if(_15[_2.laneNameField]!=_4[j][_2.laneNameField])continue;else{if(_15[_2.endDateField].getDate()<_4[j][_2.startDateField].getDate()||_15[_2.startDateField].getDate()>_4[j][_2.endDateField].getDate()){continue}}
if(this.eventsOverlap(_15,_4[j],_7)){this.mergeOverlapRanges(_15,_4[j]);_16=false}
if(!_16)break}
if(_16){_4.add(_15);if(!_9.contains(_15))_9.add(_15)}}
for(i=0;i<_4.length;i++){var _18=_4[i];_18.id="range_"+i+"_"+this.viewName;if(_18.lane)_18.id+="_lane_"+_18.lane;_18.events.setProperty("overlapRangeId",_18.id);var _19=this.getFieldFromDate(_18[_2.startDateField],_18[_2.laneNameField]);if(_19){_18.fieldName=_19.name;_18.colNum=_19.masterIndex;if(_19.endDate&&_19.endDate<=_18.endDate){_18.endDate=_19.endDate.duplicate()}}}
this.overlapRanges=_4;return _9},isc.A.getTouchedOverlapRanges=function isc_CalendarView_getTouchedOverlapRanges(_1,_2,_3){if(!this.overlapRanges)this.overlapRanges=[];var _4=true,_5=this.calendar,_6=this.overlapRanges,r={},_8=[];r[_5.startDateField]=_1;r[_5.endDateField]=_2;r[_5.laneNameField]=_3;for(var k=0;k<_6.length;k++){var _10=_6[k];if(_3!=null&&_10[_5.laneNameField]!=_3)continue;var _11=this.eventsOverlap(r,_10,true);if(_11){_8.add(_10)}}
return _8},isc.A.mergeOverlapRanges=function isc_CalendarView_mergeOverlapRanges(_1,_2){if(!isc.isAn.Array(_1))_1=[_1];var _3=this.calendar,b=_2,_5,_6;for(var i=0;i<_1.length;i++){var a=_1[i];if(a[_3.leadingDateField]&&b[_3.leadingDateField]){_5=_3.leadingDateField;_6=_3.trailingDateField}else{_5=_3.startDateField;_6=_3.endDateField}
if(a[_5]<b[_5])b[_5]=a[_5];if(a[_6]>b[_6])b[_6]=a[_6];if(a.totalSlots>b.totalSlots)b.totalSlots=a.totalSlots;b.events.addList(a.events);b.events=b.events.getUniqueItems()}},isc.A.getEventLaneIndex=function isc_CalendarView_getEventLaneIndex(_1){return this.getLaneIndex(_1[this.calendar.laneNameField])},isc.A.getEventLane=function isc_CalendarView_getEventLane(_1){return this.getLane(_1[this.calendar.laneNameField])},isc.A.hasOverlapRanges=function isc_CalendarView_hasOverlapRanges(){return this.overlapRanges!=null&&this.overlapRanges.length>0},isc.A.getLaneOverlapRanges=function isc_CalendarView_getLaneOverlapRanges(_1){if(!this.hasOverlapRanges())return;var _2=this.calendar,_3=[];this.overlapRanges.map(function(_4){if(_4[_2.laneNameField]==_1)_3.add(_4)});return _3},isc.A.getDayOverlapRanges=function isc_CalendarView_getDayOverlapRanges(_1){if(!this.hasOverlapRanges())return;var _2=this.getFieldNameFromDate(_1);if(_2)return this.getColOverlapRanges(_2)},isc.A.getColOverlapRanges=function isc_CalendarView_getColOverlapRanges(_1){if(!this.hasOverlapRanges())return;var _2=[];if(isc.isAn.String(_1)){_2=this.overlapRanges.findAll("fieldName",_1)}else{_2=this.overlapRanges.findAll("colNum",_1)}
return _2},isc.A.removeOverlapRanges=function isc_CalendarView_removeOverlapRanges(_1){if(!this.hasOverlapRanges()||!_1)return;_1.map(function(_2){_2.events.setProperty("overlapRangeId",null)});this.overlapRanges.removeList(_1)},isc.A.getEventOverlapRange=function isc_CalendarView_getEventOverlapRange(_1){if(!this.hasOverlapRanges())return;return this.overlapRanges.find("id",_1.overlapRangeId)},isc.A.getDateOverlapRange=function isc_CalendarView_getDateOverlapRange(_1,_2){if(!this.hasOverlapRanges())return;var _3=this.calendar,_4=_1.getTime();var _5=this.overlapRanges.map(function(_6){if(_4>=_6[_3.startDateField].getTime()&&_4<=_6[_3.endDateField].getTime()&&(!_2||_2==_6[_3.laneNameField]))
{return _6}});if(_5)_5.removeEmpty();return _5&&_5.length&&_5[0]?_5[0]:null},isc.A.retagLaneEvents=function isc_CalendarView_retagLaneEvents(_1){if(!this.usesLanes())return;var _2=this.getLaneIndex(_1);if(this.isTimelineView()){this.retagRowEvents(_2,true)}else{this.retagColumnEvents(_2,true)}},isc.A.retagDayEvents=function isc_CalendarView_retagDayEvents(_1){if(this.isTimelineView())return;var _2=this.getFieldFromDate(_1);if(_2)this.retagColumnEvents(_2,false)},isc.A.retagColumnEvents=function isc_CalendarView_retagColumnEvents(_1,_2){if(this.isTimelineView())return;var _3;if(isc.isA.Number(_1)){_3=this.body.getField(_1)}else{_3=_1;_1=this.body.getFieldNum(_3)}
this.removeOverlapRanges(this.getColOverlapRanges(_3.name));var _4=_3.startDate;if(!_4)return;var _5=_4,_6=this.getCellEndDate(this.data.length-1,_1);var _7=this.findEventsInRange(_5,_6,(_2?_3.name:null));this.renderEvents(_7,_2)},isc.A.retagRowEvents=function isc_CalendarView_retagRowEvents(_1){if(!this.isTimelineView())return;var _2=this.calendar,_3;if(isc.isA.Number(_1)){_3=this.getRecord(_1)}else{_3=_1;_1=this.isGrouped?this.getGroupedRecordIndex():this.getRecordIndex(_3)}
var _4=_3.name;this.removeOverlapRanges(this.getLaneOverlapRanges(_4));var _5=this.startDate,_6=this.endDate;var _7=this.findEventsInRange(_5,_6,_4);this.renderEvents(_7,true)},isc.A.retagOverlapRange=function isc_CalendarView_retagOverlapRange(_1,_2,_3){var _4=this.calendar,_5=this.getTouchedOverlapRanges(_1,_2,_3),_6=_5?_5[0]:null,_7=_1.duplicate(),_8=_2.duplicate();if(_6){_5.removeAt(0);this.mergeOverlapRanges(_5,_6);_7=_6[_4.startDateField];_8=_6[_4.endDateField];this.removeOverlapRanges(_5);this.removeOverlapRanges([_6]);var _9=this.findEventsInRange(_7,_8,_3,_6.events);this.renderEvents(_9,(_3!=null))}else{var _9=this.findEventsInRange(_7,_8,_3,this.getEventData());this.renderEvents(_9,(_3!=null))}},isc.A.sortForRender=function isc_CalendarView_sortForRender(_1){var _2=this.calendar,_3=[];if(this.usesLanes()){_3.add({property:_2.laneNameField,direction:"ascending"})}
if(_2.overlapSortSpecifiers){_3.addList(_2.overlapSortSpecifiers)}else{_3.add({property:"slotNum",direction:"ascending"});_3.add({property:_2.startDateField,direction:"ascending"})}
_1.setSort(_3)},isc.A.renderEvents=function isc_CalendarView_renderEvents(_1,_2){if(!_1||_1.length==0)return;this.tagDataForOverlap(_1,_2);this.sortForRender(_1);var _3=this.calendar,_4=this.isTimelineView(),_5=_2?(_4?this.body.getVisibleRows():this.body.getVisibleColumns()):[],_6=this;for(var i=0;i<_1.length;i++){var _8=_1.get(i),_9=_8.overlapProps,_10=_2?_6.getLaneIndex(_8[_3.laneNameField]):null;if(!_2||(_10>=_5[0]&&_10<=_5[1])){var _11=this.getCurrentEventCanvas(_8);if(_11){if(_11.setEvent)_11.setEvent(_8);else _11.event=_8;_6.sizeEventCanvas(_11,false,"renderEvents")}else{_11=this.addEvent(_8)}}}},isc.A.sizeEventCanvas=function isc_CalendarView_sizeEventCanvas(_1,_2,_3){if(!_1||!_1.event||Array.isLoading(_1.event))return;var _4=this.calendar;if(_4==null)return;var _5=_1.event,_6=this.isTimelineView(),_7=this.isWeekView(),_8=this.usesLanes(),_9=_4.getEventStartDate(_5),_10=_4.getEventEndDate(_5);var _11=_1.hasFocus;var _12,_13,_14,_15,_16=_8?this.getLaneIndex(_5[_4.laneNameField]):null,_17=_8?this.getLane(_5[_4.laneNameField]):null,_18=_4.getLanePadding(this);;if(_6){if(!_17)return;_15=this.getLaneHeight(_17);_14=Math.round(this.$732(_5));var _19=Math.round(_4.getSnapGapPixels(this));if(_4.isDurationEvent(_5)&&_4.getEventDuration(_5)==0){_19=_4.zeroLengthEventSize+(_18*2)}
_14=Math.max(_14,_19);_13=this.getDateLeftOffset(_9);_12=this.getRowTop(_16);if(_18>0){_12+=_18;_13+=_18;_14-=(_18*2);_15-=(_18*2);if(_19>(_18*2))_19-=(_18*2)}
if(_4.eventsOverlapGridLines){_13-=1;_14+=1;_12-=1;_15+=1}
if(this.eventDragGap>0){_14=Math.max(this.eventDragGap,_14-this.eventDragGap)}
_14=Math.max(_14,_19)}else{if(_1.$172y){delete _1.$172y.$184b;delete _1.$172y.$963}
var _20=isc.DateUtil.createLogicalDate(_9.getFullYear(),_9.getMonth(),_9.getDate());var _21;if(this.isDayView()){if(this.usesLanes())_21=_16;else _21=0}else{_21=this.getColFromDate(_20)}
var _22=this.getCellDate(0,_21);_13=this.body.getColumnLeft(_21);_14=this.body.getColumnWidth(_21);var _23=this.body.getRowHeight(this.getRecord(1),1),_24=false,_25=this.getTimePerCell(),_26=_4.getRowsPerHour(this),_27=null;if(_22&&_9.getTime()<_22.getTime()){_20=_22.duplicate();_24=true}
var _28=isc.DateUtil.getLogicalDateOnly(_10);if(_28.getDate()!=_20.getDate()){_28=isc.DateUtil.getEndOf(_20,"d",false);_24=true;_27=24}
var _29=isc.DateUtil.getLogicalTimeOnly(_9);var _30=isc.DateUtil.getLogicalTimeOnly(_10);if(_27==null){_27=_30.getHours()==0&&_28.getDate()!=_20.getDate()?24:_30.getHours()}
_12=this.getRowTop(_29.getHours()*_26);_15=(_27-_29.getHours())*(_23*_26);_15-=1;if(_4.showDayLanes){if(_18>0){_12+=_18;_13+=_18;_14-=(_18*2);_15-=(_18*2)}}
var _31=_29.getMinutes();if(_31>0){var _32=_4.getMinutePixels(_31,_23,this);_15-=_32;_12+=_32}
if(_30.getMinutes()>0&&!_24){_15+=_4.getMinutePixels(_30.getMinutes(),_23,this)}
if(_4.eventsOverlapGridLines){_13-=1;_14+=1;_12-=1;_15+=1}
var _33=this.body.getScrollHeight();if(_12+_15>_33){_15=_33-_12}}
var _34=true;if(_4.useSublanes&&_17&&_17.sublanes){this.sizeEventCanvasToSublane(_1,_17,_13,_12,_14,_15)}else{_34=this.adjustDimensionsForOverlap(_1,_13,_12,_14,_15)}
if(!_1.isDrawn()){_1.draw()}else _1.redraw();_1.show();if(_6&&_5!=null){if(_5[_4.leadingDateField]&&_5[_4.trailingDateField]){if(_1.leadingIcon)_1.updateLeadingTrailingDates();else _1.delayCall("updateLeadingTrailingDates")}}
if(_11&&!_1.hasFocus){_1.focus("restore calendar event focus after redraw")}
delete _1.needsResize},isc.A.adjustDimensionsForOverlap=function isc_CalendarView_adjustDimensionsForOverlap(_1,_2,_3,_4,_5){var _6=this.calendar,_7=_1.event.overlapProps;if(!_7){return}
var _8=this.isTimelineView(),_9=this.useLanePadding(),_10=_9?_6.getLanePadding(this):0,_11=_9?Math.floor(_10/2):0,_12=_9&&_7?(_7.totalSlots-1)*_10:0;if(_7.slotNum==null){_7.slotNum=1}
if(_7&&_7.totalSlots>0){var _13;if(_8){_13=Math.floor((_5-_12)/_7.totalSlots);_5=_13;if(_7.slotCount){_5*=_7.slotCount;_5+=(_7.slotCount-1)*_10}
if(_7.totalSlots!=1){if(_7.slotNum==_7.totalSlots)_5-=_11}
_3=_3+Math.floor((_13*(_7.slotNum-1)));if(_7.slotNum>1)_3+=(_10*(_7.slotNum-1));if(_6.eventOverlap&&_7.$64m!=false){if(_7.slotNum>1){_3-=Math.floor(_13*(_6.eventOverlapPercent/100));_5+=Math.floor(_13*(_6.eventOverlapPercent/100))}}}else{_13=Math.floor((_4-_12)/_7.totalSlots);_4=_13;if(_7.slotCount){_4*=_7.slotCount;_4+=(_7.slotCount-1)*_10}
if(_7.totalSlots!=1){if(_7.slotNum==_7.totalSlots)_4-=_11}
_2=_2+Math.floor((_13*(_7.slotNum-1)));if(!_6.eventOverlap&&_7.slotNum>1)_2+=(_10*(_7.slotNum-1));if(_6.eventOverlap&&_7.$64m!=false){if(_7.slotNum>1){_2-=Math.floor(_13*(_6.eventOverlapPercent/100));_4+=Math.floor(_13*(_6.eventOverlapPercent/100))}}
var _14=!_7?true:(_7.slotNum==_7.totalSlots||(_7.slotNum+_7.slotCount)-1==_7.totalSlots);if(_14){_4-=_6.eventDragGap||1}}}else{if(_8){}else{_4-=_6.eventDragGap||1}}
if(_6.eventsOverlapGridLines){if(_8){if(_7&&_7.totalSlots>1)_5+=1}else{_5+=1;if(_7&&_7.slotNum>0&&!_6.eventOverlap){_4+=1}}}
var _15=_1.getRect();if(_15[0]==_2&&_15[1]==_3&&_15[2]==_4&&_15[3]==_5){this.logDebug("Not resizing event '"+_1.event.name+"'.");return false}
_1.renderEvent(_3,_2,_4,_5);return true});isc.evalBoundary;isc.B.push(isc.A.sizeEventCanvasToSublane=function isc_CalendarView_sizeEventCanvasToSublane(_1,_2,_3,_4,_5,_6){var _7=this.calendar,_8=_1.event,_9=_2.sublanes,_10=_9.findIndex("name",_8[this.calendar.sublaneNameField]),_11=this.isTimelineView(),_12=_9.length,_13=_7.getLanePadding(this),_14=0;if(_10<0)return;for(var i=0;i<=_10;i++){if(i==_10){if(_11){_4+=_14;_6=_9[i].height-_13}else{_3+=_14;_5=_9[i].width-_13;if(_3+_5+1<this.body.getScrollWidth())_5+=1;if(_4+_6+1<this.body.getScrollHeight())_6+=1}
break}
if(_11)_14+=_9[i].height;else _14+=_9[i].width}
if(_10>0&&_13>0){if(_11)_6-=Math.floor(_13/_9.length);else _5-=Math.floor(_13/_9.length)}
_1.renderEvent(_4,_3,_5,_6)},isc.A.getOverlapSlot=function isc_CalendarView_getOverlapSlot(_1,_2){var _3={slotNum:_1,events:[],snapGaps:[]};for(var i=0;i<_2;i++)_3.snapGaps[i]=0;return _3},isc.A.getSnapData=function isc_CalendarView_getSnapData(_1,_2,_3,_4,_5,_6){var _7=this.calendar,_8=this.getTimePerSnapGap("mn"),_9=this.getSnapGapPixels(0),_10={};if(_3==null){_3=this.getDateFromPoint(_1,_2)}
if(_3!=null){var d=(isc.isA.Date(_3)?_3.duplicate():new Date(_3));if(_4){if(d.getTime()<this.startDate.getTime()){d=this.startDate.duplicate()}else if(d.getTime()>this.endDate.getTime()){d=this.endDate.duplicate()}}
if(!_6)d.setTime(d.getTime()+1);_10.startTopOffset=this.getDateTopOffset(d,_5);var _12=isc.DateUtil.dateAdd(d,"mn",_8);if(d.getDate()==_12.getDate()){_10.endTopOffset=this.getDateTopOffset(_12,_5)}else{_10.endTopOffset=this.body.getScrollHeight()}
_10.index=Math.floor(_10.startTopOffset/_9);_10[_7.startDateField]=this.getDateFromPoint(null,_10.startTopOffset);_10[_7.endDateField]=this.getDateFromPoint(null,_10.endTopOffset)}
return _10},isc.A.tagDataForOverlap=function isc_CalendarView_tagDataForOverlap(_1,_2){_1=_1||this.getEventData();if(_1.getLength()==0)return;var _3=this.calendar,_4=[],_5=0,_6=0,_7=0,_8=this.isTimelineView();if(_3.eventAutoArrange==false)return;this.forceDataSort(_1);var _9=_1.get(0),_10=_9[_3.laneNameField];var _11=[];_1.setProperty("overlapProps",null);_1.setProperty("slotNum",null);var _12=this.usesLanes();var _13=this.updateOverlapRanges(_1);var _14=[];if(_12){_14.add({property:_3.laneNameField,direction:"ascending"})}
if(_3.overlapSortSpecifiers){_14.addList(_3.overlapSortSpecifiers)}else{_14.add({property:"eventLength",direction:"descending"});_14.add({property:_3.startDateField,direction:"ascending"});_14.add({property:_3.endDateField,direction:"ascending"})}
var _15=false;if(_15){this.logWarn("tagDataForOverlap: about to loop over "+_13.length+" overlap ranges")}
var _16=this.getLastSnapIndex();for(var j=0;j<_13.length;j++){var _18=_13[j];if(_15){this.logWarn("range: "+isc.echoFull(_18)+"")}
var _19=(_18.fieldName?this.getFieldByName(_18.fieldName):null);var _20=this.getSnapData(null,null,_18[_3.startDateField],true,_18[_3.laneNameField]),_21=_20?_20.index:0,_22=this.getSnapData(null,null,_18[_3.endDateField],true,_18[_3.laneNameField],true),_23=_22?_22.index:this.$1725.length-1,_24=(_23-_21)+1,_25=[],_26=1;_25[0]=this.getOverlapSlot(0,_24);var _27=_18.events;for(var _28=0;_28<_27.length;_28++){var _29=_27[_28];_29.overlapProps={};var _30=_29.overlapProps;if(_15){this.logWarn("Processing event "+_29.name)}
var _31=_3.getEventStartDate(_29),_32=_3.getEventEndDate(_29);var _33=isc.DateUtil.getLogicalDateOnly(_31);var _34=isc.DateUtil.getLogicalTimeOnly(_31);_31=isc.DateUtil.combineLogicalDateAndTime(_33,_34);var _35=isc.DateUtil.getLogicalDateOnly(_32);var _36=isc.DateUtil.getLogicalTimeOnly(_32);_32=isc.DateUtil.combineLogicalDateAndTime(_35,_36);_32=isc.DateUtil.adjustDate(_32,"-1ms");if(_19&&_19.endDate&&_32>_19.endDate){_32=_19.endDate.duplicate()}
if(_15){this.logWarn("    startDate: "+_31+"\n      endDate: "+_32)}
_30.eventStartSnap=this.getSnapData(null,null,_31.getTime()+1,true,_29[_3.laneNameField]);_30.eventEndSnap=this.getSnapData(null,null,_32.getTime()-1,true,_29[_3.laneNameField]);var _37=(_30.eventStartSnap?_30.eventStartSnap.index:_30.nextValidSnap.index)-_21;var _38=(_30.eventEndSnap?_30.eventEndSnap.index:_30.lastValidSnap.index)-_21;_38++;_38=Math.min(_38,_16);var _39=false;var _40=null;for(var _41=0;_41<_26;_41++){var _42=_25[_41].snapGaps.slice(_37,_38);var _43=_42.sum()>0;if(_15){this.logWarn("    checking slots: "+_37+" to "+_38);this.logWarn("    used is: "+_43);this.logWarn("    gaps are: "+isc.echoFull(_42))}
if(!_43){_39=true;_25[_41].snapGaps.fill(1,_37,_38);_25[_41].events.add(_29);_29.overlapProps.slotNum=_41;if(_15){this.logWarn("event "+_29.name+" now occupying slot "+_41)}
break}}
if(!_39){_25[_26]=this.getOverlapSlot(_26,_24);_25[_26].snapGaps.fill(1,_37,_38);_25[_26].events.add(_29);_29.overlapProps.slotNum=_26
if(_15){this.logWarn("event "+_29.name+" added to new slot index "+_26)}
_26++}}
for(var i=0;i<_25.length;i++){var _40=_25[i];for(var _45=0;_45<_40.events.length;_45++){var _29=_40.events[_45];var _30=_29.overlapProps;_30.totalSlots=_26;var _37=(_30.eventStartSnap?_30.eventStartSnap.index:_21)-_21;var _38=(_30.eventEndSnap?_30.eventEndSnap.index:_21)-_21;_38++;var _39=false;for(var _46=i+1;_46<_25.length;_46++){var _42=_25[_46].snapGaps.slice(_37,_38);var _43=_42.sum()>0;if(_43){_30.slotCount=_46-_30.slotNum;_39=true;break}}
if(!_39){_30.slotCount=_26-_30.slotNum}
_30.slotNum++;_29.slotNum=_30.slotNum}}
_18.slotList=_25;if(_15){this.logWarn("***** slotList *****\n"+isc.echoFull(_25))}}},isc.A.getLastSnapIndex=function isc_CalendarView_getLastSnapIndex(){var _1=this.getSnapData(null,null,isc.DateUtil.adjustDate(this.endDate,"-1ms"),true);if(_1)return _1.index},isc.A.getVisibleDateRange=function isc_CalendarView_getVisibleDateRange(_1){var _2=this.calendar;if(_1){return[_2.getVisibleStartDate(this),_2.getVisibleEndDate(this)]}
if(!this.renderEventsOnDemand){return[this.startDate.duplicate(),this.endDate.duplicate()]}
if(this.isTimelineView()){}
var _3=this.body.getScrollLeft(),_4=_3+this.body.getVisibleWidth(),_5=this.body.getEventColumn(_3+1),_6=this.body.getEventColumn(_4),_7=this.body.getScrollTop(),_8=_7+this.body.getVisibleHeight(),_9=this.body.getEventRow(_7+1),_10=this.body.getEventRow(_8);if(_10<0||isNaN(_10))_10=this.data.getLength()-1;if(_6<0||isNaN(_6)){if(this.isTimelineView()){_6=this.$116z}else{_6=this.body.fields.length-1}}
_6=Math.min(_6,this.body.fields.length-1);_10=Math.min(_10,this.data.length-1);var _11=this.getCellDate(_9,_5)||this.startDate,_12=(this.getCellEndDate?this.getCellEndDate(_10,_6):this.getCellDate(_10,_6))||this.endDate;this.$27q.viewportStartMillis=_11.getTime();this.$27q.viewportEndMillis=_12.getTime();return[_11,_12]},isc.A.getVisibleRowRange=function isc_CalendarView_getVisibleRowRange(){if(!this.renderEventsOnDemand){return[0,this.data.getLength()]}
return this.getVisibleRows()},isc.A.getVisibleColumnRange=function isc_CalendarView_getVisibleColumnRange(){if(!this.renderEventsOnDemand){return[0,this.fields.getLength()]}
return this.body.getVisibleColumns()},isc.A.delayedRefreshVisibleEvents=function isc_CalendarView_delayedRefreshVisibleEvents(_1,_2){if(this.refreshVisibleEventsTimer)isc.Timer.clear(this.refreshVisibleEventsTimer);var _3=this;this.refreshVisibleEventsTimer=isc.Timer.setTimeout(function(){isc.Timer.clear(_3.refreshVisibleEventsTimer);delete _3.refreshVisibleEventsTimer;_3.refreshVisibleEvents(_1,_2)},100)},isc.A.refreshVisibleEvents=function isc_CalendarView_refreshVisibleEvents(_1,_2){if(!this.isDrawn()||!this.body||!this.body.isDrawn())return;if(this.$236y||this.$222w){return}
var _3=this.getVisibleEvents(_1);this.sortForRender(_3);var _4=_3.getLength();var _5=this.useEventCanvasPool?isc.addProperties({},this.$232j):{},_6={};this.logDebug('refreshing visible events','calendar');var _7=_3.makeIndex("$232p");var _8=(_2=="scrolled");for(var _9 in _7){var _10=_7[_9],_11=this.$232j[_9]!=null;if(_11){delete _5[_9];if(!_8&&(this.isGrouped||this.useEventCanvasPool)){var _12=this.getCurrentEventCanvas(_10);this.sizeEventCanvas(_12,null,"refreshVisibleEvents")}
continue}
_6[_10.$232p]=_10}
if(this.isGrouped||(this.useEventCanvasPool&&this.eventCanvasPoolingMode=="viewport"))
{for(var _9 in _5){var _12=this.$232l[_5[_9]];if(_12)this.clearEventCanvas(_12)}}
_5=null;if(isc.getKeys(_6).length>0){for(var _9 in _6){var _10=_6[_9];this.addEvent(_10,false,true)}}
_6=null;if(!this.$158l){this.drawZones();this.drawIndicators()}
if(this.calendar.canSelectEvents)this.setEventCanvasTabPositions();this.$222e()},isc.A.$222e=function isc_CalendarView__eventsRendered(){var _1=this.calendar;if(this.$222f){this.scrollToEvent(this.$222f);this.$222f=null}
if(_1.eventsRendered&&isc.isA.Function(_1.eventsRendered)){_1.eventsRendered()}},isc.A.setEventCanvasTabPositions=function isc_CalendarView_setEventCanvasTabPositions(){if(!this.calendar.canSelectEvents)return;var _1=this.getEventData();this.forceDataSort(_1);for(var j=0;j<_1.length;j++){var _3=this.getCurrentEventCanvas(_1[j]);if(_3&&_3.isEventCanvas&&_3.event){var _4=0;if(this.usesLanes()){_4=this.getLaneIndex(_3.event[this.calendar.laneNameField])*1000}
_4+=j;_3.setRelativeTabPosition(_4)}}},isc.A.getVisibleEvents=function isc_CalendarView_getVisibleEvents(_1){var _2=this.calendar;if(!this.renderEventsOnDemand)return this.getEventData();var _3=this.isTimelineView(),_4=this.getVisibleDateRange(_1),_5=this.usesLanes(),_6=_5?(_3?this.getVisibleRowRange():this.getVisibleColumnRange()):null;var _7=this.getEventData(),_8=_4[0].getTime(),_9=_4[1].getTime(),_10=_7.getLength(),_11=[],_12=this.isWeekView(),_13=this.isGrouped?this.data.getOpenList():null;for(var i=0;i<_10;i++){var _15=_7.get(i);if(!_15){isc.logWarn('getVisibleEvents: potentially invalid index: '+i);break}
if(isc.isA.String(_15))return[];if(_2.shouldShowEvent(_15,this)==false)continue;if(_5&&_2.shouldShowLane(this.getLane(_15[_2.laneNameField]),this)==false)continue;var _16=_2.getEventLeadingDate(_15)||_2.getEventStartDate(_15);if(!_16){if(_15.loadingMarker){this.logWarn(this.viewName+".getVisibleEvents() encountered a place-holder for a loading record, rather than a valid record. Can't continue:  "+isc.echoFull(this.getStackTrace()));break}
this.logWarn(this.viewName+".getVisibleEvents() - event has no start-date: "+isc.echoFull(_15));continue}
var _17=_2.getEventTrailingDate(_15)||_2.getEventEndDate(_15),_18=_17.getTime();if(_18<=_8)continue;if(_16.getTime()>=_9)continue;if(_12){var _19=isc.DateUtil.getLogicalDateOnly(_16),_20=isc.DateUtil.getLogicalDateOnly(_17);if(_19.getDate()!=_20.getDate()){_17=isc.DateUtil.getEndOf(_16,"d",false)}}
var _21={};if(_5){if(this.isGrouped){var _22=_13.findIndex("name",_15[_2.laneNameField]);if(_22<0)continue}else{if(_1!=true){var _23=this.getEventLaneIndex(_15);if(_23==null||_23<_6[0]||_23>_6[1])
continue}}
_21[_2.laneNameField]=_15[_2.laneNameField]}
if(_3){if(_15[_2.leadingDateField]&&_15[_2.trailingDateField]){_21[_2.leadingDateField]=_4[0];_21[_2.trailingDateField]=_4[1]}else{_21[_2.startDateField]=_4[0];_21[_2.endDateField]=_4[1]}}else{_21[_2.startDateField]=_4[0];_21[_2.endDateField]=_4[1]}
if(this.eventsOverlap(_21,_15,_5)){_11.add(_15)}}
return _11},isc.A.clearEventCanvas=function isc_CalendarView_clearEventCanvas(_1,_2){if(_1){if(!isc.isAn.Array(_1))_1=[_1];var _3=_1.length;while(--_3>=0){var _4=_1[_3];if(_4.hide)_4.hide();if(_4.clear)_4.clear();delete this.$232n[_4.ID];if(_4.event){delete this.$232j[_4.event.$232p]}
if(this.useEventCanvasPool&&!_2){this.poolEventCanvas(_4)}else{_4.event=null;_4.destroy();_4=null}}}},isc.A.clearEvents=function isc_CalendarView_clearEvents(_1,_2){if(!_1)_1=0;if(_2==null)_2=!this.useEventCanvasPool;for(var _3 in this.$232n){this.clearEventCanvas(this.$232l[_3],_2)}},isc.A.areSame=function isc_CalendarView_areSame(_1,_2){if(!_1||!_2)return false;var _3=this.calendar;if(_3.dataSource){var _4=_3.getEventPKs(),_5=true;for(var i=0,_7=_4.length;i<_7;i++){if(_1[_4[i]]!=_2[_4[i]]){_5=false;break}}
return _5}else{return(_1===_2)}},isc.A.getEventCanvasConstructor=function isc_CalendarView_getEventCanvasConstructor(_1){return this.eventCanvasConstructor},isc.A.getCurrentEventCanvas=function isc_CalendarView_getCurrentEventCanvas(_1){var _2=this.$232j[_1.$232p];return _2!=null?this.$232l[_2]:null},isc.A.poolEventCanvas=function isc_CalendarView_poolEventCanvas(_1){if(this.body){var _2;delete this.$232n[_1.ID];if(_1.event){_2=_1.event.$232p;delete this.$232j[_2];this.logInfo("pooling canvas "+_1.ID+" for event + "+_2,"calendar");_1.event=null}
_1.availableForUse=true;this.$232m[_1.ID]=_1;return true}else return false},isc.A.getPooledEventCanvas=function isc_CalendarView_getPooledEventCanvas(_1){if(!this.body)return;var _2=null;var _3=null;var _4=this.$232k[_1.$232p];if(_4&&this.$232m[_4]){_2=_4;_3=this.$232l[_2];this.logInfo("re-using canvas "+_2+" for event + "+_1.$232p,"calendar")}else{var _5=isc.getKeys(this.$232m);if(_5.length>0){_3=this.$232m[_5[0]];_2=_3.ID;this.logInfo("un-pooling canvas "+_2+" for event + "+_1.$232p,"calendar")}}
if(!_3)return;this.$232j[_1.$232p]=_2;this.$232k[_1.$232p]=_2;this.$232n[_2]=_1.$232p;this.$232o[_2]=_1.$232p;delete this.$232m[_2];_3.availableForUse=false;return _3},isc.A.addEvent=function isc_CalendarView_addEvent(_1,_2,_3){if(!_1.$232p)this.calendar.getEventKey(_1,this);this.clearSelection();this.addEventData(_1);var _4=this.calendar,_5=false;var _6=this.getCurrentEventCanvas(_1)
if(!_6)_6=this.getPooledEventCanvas(_1);if(!_6)_6=_4.$129r(_1,this);if(_6.isDrawn())_6.clear();_6.dragTarget=this.eventDragCanvas;_6.setEvent(_1);if(_6.parentElement!=this.body){this.body.addChild(_6,null,false)}
_6.needsResize=true;this.$232n[_6.ID]=_1.$232p;this.$232o[_6.ID]=_1.$232p;this.$232j[_1.$232p]=_6.ID;this.$232k[_1.$232p]=_6.ID;_6.$53i=this.isWeekView();if(this.isDayView()&&this.usesLanes()){var _7=_1[_4.laneNameField];if(!this.getLane(_7))_5=true}
if(!_5&&this.body&&this.body.isDrawn()){if(_2){if(this.verticalEvents){this.retagDayEvents(_4.getEventStartDate(_1))}else{this.retagOverlapRange(_4.getEventStartDate(_1),_4.getEventEndDate(_1),_1[_4.laneNameField])}}else{this.sizeEventCanvas(_6,null,"addEvent");_6.bringToFront()}}},isc.A.removeEvent=function isc_CalendarView_removeEvent(_1){var _2=this.getCurrentEventCanvas(_1);if(_2){this.clearEventCanvas(_2,!this.useEventCanvasPool);this.removeEventData(_1);return true}else{return false}},isc.A.clearZones=function isc_CalendarView_clearZones(){var _1=(this.$131c||[]);_1.callMethod("clear");_1.callMethod("deparent");_1.callMethod("destroy");_1=null;this.$131c=[]},isc.A.drawZones=function isc_CalendarView_drawZones(){if(this.$131c)this.clearZones();if(!this.calendar.showZones)return;var _1=this.calendar,_2=_1.zones||[],_3=this.$131c=[];if(this.isGrouped){this.logInfo("Zones are not currently supported in grouped Calendar views.");return}
if(!_2||_2.length<=0)return;var _4=[],_5=this.getVisibleDateRange(),_6=_5[0].getTime(),_7=_5[1].getTime();for(var i=0;i<_2.length;i++){var _9=_2[i];if(_9[_1.startDateField].getTime()<_7&&_9[_1.endDateField].getTime()>_6)
{_4.add(_9)}
_9.styleName=_1.getZoneCanvasStyle(_9,this)}
for(var i=0;i<_4.length;i++){var _9=_4[i],_10=_1.getZoneCanvas(_9,this),_11=this.getDateLeftOffset(_9[_1.startDateField]),_12=this.getDateLeftOffset(_9[_1.endDateField]),_13=this.data.getProperty("height").sum();this.body.addChild(_10,null,false)
_10.renderEvent(0,_11,_12-_11,_13,true);_3.add(_10)}},isc.A.clearIndicators=function isc_CalendarView_clearIndicators(){var _1=(this.$131d||[]);_1.callMethod("clear");_1.callMethod("deparent");_1.callMethod("destroy");_1=null;this.$131d=[]},isc.A.drawIndicators=function isc_CalendarView_drawIndicators(){if(this.$131d)this.clearIndicators();if(!this.calendar.showIndicators)return;var _1=this.calendar,_2=_1.indicators||[],_3=this.$131d=[];if(this.isGrouped){this.logInfo("Indicators are not currently supported in grouped Calendar views.");return}
if(!_2||_2.length<=0)return;var _4=[],_5=this.getVisibleDateRange(),_6=_5[0].getTime(),_7=_5[1].getTime();for(var i=0;i<_2.length;i++){var _9=_2[i];delete _9[_1.endDateField];_9.duration=0;_9.durationUnit="minute";var _10=_1.getEventStartDate(_9).getTime();if(_10>=_6&&_10<_7){_4.add(_9)}};for(var i=0;i<_4.length;i++){var _9=_4[i],_11=_1.getIndicatorCanvas(_9,this),_12=this.getDateLeftOffset(_9[_1.startDateField]),_13=this.data.getProperty("height").sum();this.body.addChild(_11,null,false)
_11.renderEvent(0,_12,_1.zeroLengthEventSize,_13,!_1.showIndicatorsInFront);_3.add(_11)}},isc.A.$1739=function isc_CalendarView__refreshEvents(){if(!this.isDrawn()){this.$128r=true;return}
if(this.calendar.shouldIncludeRangeCriteria(this)){this.$116v();return}
this.refreshEvents("$1739")},isc.A.delayedRefreshEvents=function isc_CalendarView_delayedRefreshEvents(_1){if(this.refreshEventsTimer)isc.Timer.clear(this.refreshEventsTimer);var _2=this;this.refreshEventsTimer=isc.Timer.setTimeout(function(){isc.Timer.clear(_2.refreshEventsTimer);delete _2.refreshEventsTimer;_2.refreshEvents(_1)},100)},isc.A.refreshEvents=function isc_CalendarView_refreshEvents(_1){if(this.$132n)return;var _2=this.calendar;if(!this.body||!this.body.isDrawn()||!_2.hasData())return;this.$129s=true;this.$132n=true;this.clearZones();this.clearIndicators();this.clearEvents(0,!this.useEventCanvasPool);this.setEventData([]);this.$232j={};if(!this.isTimelineView()){this.initCacheValues()}
var _3=_2.getVisibleStartDate(this)||this.startDate,_4=_3.getTime(),_5=_2.getVisibleEndDate(this)||this.endDate,_6=_5.getTime();this.overlapRanges=[];var _7=_2.data.getLength();var _8=_2.data.getRange(0,_7);var _9;if(this.usesLanes())_9=_2.lanes?_2.lanes.makeIndex("name"):null;var _10=[];this.$232i={}
while(--_7>=0){var _11=_8.get(_7);if(!_11)continue;if(!isc.isA.String(_11)){if(_2.shouldShowEvent(_11,this)==false)continue;if(_9&&_11[_2.laneNameField]&&!_9[_11[_2.laneNameField]]){continue}
var _12=_2.getEventStartDate(_11);if(!_12){if(_11.loadingMarker){this.logWarn(this.viewName+".refreshEvents() encountered a place-holder for a loading record, rather than a valid record. Can't continue:  "+isc.echoFull(this.getStackTrace()));break}
this.logWarn(this.viewName+".refreshEvents() - event has no start-date: "+isc.echoFull(_11));continue}
var _13=_2.getEventDates(_11),_14=_13[_2.leadingDateField],_15=_13[_2.startDateField],_16=_13[_2.endDateField],_17=_13[_2.trailingDateField];if((_15&&_15.getTime()>=_4&&_15.getTime()<_6)||(_16&&_16.getTime()>_4&&_16.getTime()<=_6)||(!this.verticalEvents&&_15.getTime()<=_4&&_16.getTime()>=_6))
{var _18=this.getSnapData(null,null,_15),_19=this.getSnapData(null,null,_16);if(_18&&_18.startHidden&&_19&&_19.endHidden){if(_18.lastValidSnap==_19.lastValidSnap&&_18.nextValidSnap==_19.nextValidSnap)
{continue}}
_11.eventLength=(_16.getTime()-_15.getTime());if(_11[_2.durationField]!=null){_11.isDuration=true;_11.isZeroDuration=_11[_2.durationField]==0}
if(!_11.$232p){_11.$232p=_2.getEventKey(_11)}
this.$232i[_11.$232p]=_11;_10.add(_11)}}};if(this.usesLanes()&&_2.lanes){var _20=[];var _21=_10.getProperty(_2.laneNameField).getUniqueItems();for(var i=0;i<_2.lanes.length;i++){if(_2.hideUnusedLanes){if(_21.contains(_2.lanes[i].name)){_20.add(_2.lanes[i])}}else _20.add(_2.lanes[i])}
var _23=_20.length!=this.lanes.length;for(var i=0;i<this.lanes.length;i++){if(!_20[i]||_20[i].name!=this.lanes[i].name){_23=true;break}}
if(_23)this.updateLanes(_20,true)}
this.setEventData(_10);this.tagDataForOverlap();this.refreshVisibleEvents(null,"refreshEvents");if(this.$123r){this.body.scrollTo(null,this.$123r);delete this.$123r}
delete this.$123s;delete this.$132n},isc.A.$116v=function isc_CalendarView__refreshData(){var _1=this.calendar;if(_1.dataSource&&isc.ResultSet&&isc.isA.ResultSet(_1.data)){_1.$53e=true;_1.invalidateCache();_1.fetchData(_1.getCriteria())}else{_1.dataChanged()}},isc.A.getFrozenLength=function isc_CalendarView_getFrozenLength(){if(this.frozenBody&&this.frozenBody.fields)return this.frozenBody.fields.length;return 0},isc.A.getCellAlign=function isc_CalendarView_getCellAlign(_1,_2,_3){if(this.isMonthView())return;var _4=this.calendar,_5=this.fields[_3],_6=_1?_1.cellAlign:null,_7=null;if(_5){if(_5.frozen){return _5.cellAlign||_6||this.labelColumnAlign}
var _8=this.getFrozenLength();if(_4.getDateCellAlign){var _9=this.getCellDate(_2,_3-_8);if(_9)_7=_4.getDateCellAlign(_9,_2,_3-_8,this)}
_5=this.body.fields[_3-_8];if(_7||_5.cellAlign||_6){return _7||_5.cellAlign||_6}}
return this.Super("getCellAlign",arguments)},isc.A.getCellVAlign=function isc_CalendarView_getCellVAlign(_1,_2,_3){if(this.isMonthView())return;var _4=this.calendar,_5=this.fields[_3],_6=_1?_1.cellVAlign:null,_7=null;if(_5){if(_5.frozen){return _5.cellVAlign||_6||this.labelColumnVAlign||this.$171d}
var _8=this.getFrozenLength();if(_4.getDateCellVAlign){var _9=this.getCellDate(_2,_3-_8);if(_9)_7=_4.getDateCellVAlign(_9,_2,_3-_8,this)}
_5=this.body.fields[_3-_8];if(_7||_6||_5.cellVAlign){return _7||_6||_5.cellVAlign}}
return _6||this.$171d},isc.A.getCellValue=function isc_CalendarView_getCellValue(_1,_2,_3){if(!this.calendar.getDateHTML)return this.Super("getCellValue",arguments);if(this.isMonthView())return this.Super("getCellValue",arguments);var _4=this.calendar,_5=this.getFrozenLength();if(_3-_5>=0){var _6=this.getCellDate(_2,_3-_5);if(_6){var _7=_4.getDateHTML(_6,_2,_3-_5,this);if(_7)return _7}}
return this.Super("getCellValue",arguments)},isc.A.destroyEvents=function isc_CalendarView_destroyEvents(){if(!this.body||!this.body.children)return;if(this.clearZones)this.clearZones();if(this.clearIndicators)this.clearIndicators();var _1=this.body.children.length;while(--_1>=0){var _2=this.body.children[_1];if(_2&&!_2.destroyed){_2.clear();_2.deparent();_2.destroy()}
_2=null}
this.resetEventCaches()},isc.A.destroy=function isc_CalendarView_destroy(){if(this.removeLocalHandlers)this.removeLocalHandlers();this.destroyEvents(true);if(this.clearZones)this.clearZones();if(this.clearIndicators)this.clearIndicators();this.calendar=null;this.overlapRanges=null;this.$1725=null;this.$27q=null;this.lanes=null;this.resetLaneCaches();this.resetEventCaches();this.resetCanvasCaches();if(this.cellSelection){if(this.cellSelection.destroy)this.cellSelection.destroy();this.cellSelection=null}
if(this.data){if(this.data.destroy)this.data.destroy();this.data=null}
this.Super("destroy",arguments)},isc.A.draw=function isc_CalendarView_draw(){var _1=this.Super("draw",arguments);if(this.$198x){this["scrollTo"+this.$198x]();delete this.$198x}},isc.A.scrollToStart=function isc_CalendarView_scrollToStart(){if(!this.isDrawn()){this.$198x="Start";return}
if(this.verticalEvents){this.body.scrollToTop()}else{this.body.scrollToLeft()}},isc.A.scrollToEnd=function isc_CalendarView_scrollToEnd(){if(!this.isDrawn()){this.$198x="End";return}
if(this.verticalEvents){this.body.scrollToBottom()}else{this.body.scrollToRight()}},isc.A.getNewEventDefaults=function isc_CalendarView_getNewEventDefaults(_1){var _2=_1||{};var _3=this.calendar;var _4=_2[_3.startDateField];if(!_4){_4=this.getDateFromPoint()||isc.DateUtil.createDatetime();if(_4.getHours()>22)_4.setHours(22);_2[_3.startDateField]=_4}
if(!_2[_3.endDateField]){var _5=_4.duplicate();_5.setHours(_4.getHours()+1);_2[_3.endDateField]=_5}
return _2},isc.A.getEditDialogPosition=function isc_CalendarView_getEditDialogPosition(_1){var _2=this.calendar,_3=_2.getEventStartDate(_1),_4=this.getColFromDate(_3,_1[_2.laneNameField]),_5;_5=this.body.getEventRow(this.getDateTopOffset(_3));var _6=this.body.getCellPageRect(_5,_4);return{left:Math.max(_6[0],this.body.getPageLeft()),top:Math.max(_6[1],this.body.getPageTop())}});isc.B._maxIndex=isc.C+133;isc.CalendarView.changeDefaults("bodyDefaults",{canFocus:false,drawChildWithParent:function(_1){if(_1.isEventCanvas)return false;return this.Super("drawChildWithParent",arguments)}});isc.CalendarView.changeDefaults("frozenBodyDefaults",{canFocus:false});isc.ClassFactory.defineClass("DaySchedule","CalendarView");isc.DaySchedule.changeDefaults("bodyProperties",{snapToCells:false,suppressVSnapOffset:true,suppressHSnapOffset:true,childrenSnapToGrid:false});isc.A=isc.DaySchedule.getPrototype();isc.B=isc._allFuncs;isc.C=isc.B._maxIndex;isc.D=isc._funcClasses;isc.D[isc.C]=isc.A.Class;isc.A.autoDraw=false;isc.A.canSort=false;isc.A.canResizeFields=false;isc.A.canReorderFields=false;isc.A.showHeader=false;isc.A.showHeaderContextMenu=false;isc.A.showAllRecords=true;isc.A.fixedRecordHeights=true;isc.A.labelColumnWidth=60;isc.A.labelColumnAlign="right";isc.A.labelColumnPosition="left";isc.A.labelColumnBaseStyle="labelColumn";isc.A.showRollOver=true;isc.A.useCellRollOvers=true;isc.A.canAutoFitFields=false;isc.A.canSelectCells=true;isc.A.navigateOnTab=false;isc.B.push(isc.A.getDateLabelText=function isc_DaySchedule_getDateLabelText(_1,_2){if(this.isWeekView()){return"<b>"+isc.DateUtil.getFormattedDateRangeString(_1,_2)+"</b>"}
return"<b>"+isc.DateUtil.getFormattedDateRangeString(_1)+"</b>"},isc.A.initWidget=function isc_DaySchedule_initWidget(){var _1=this.calendar;if(this.isDayView()&&this.usesLanes()&&_1.alternateLaneStyles){this.alternateFieldStyles=true;this.alternateFieldFrequency=_1.alternateFieldFrequency}
if(_1.labelColumnWidth&&_1.labelColumnWidth!=this.labelColumnWidth){this.labelColumnWidth=_1.labelColumnWidth}
this.renderEventsOnDemand=_1.renderEventsOnDemand;this.eventDragGap=_1.eventDragGap;var _2=this.calendar.firstDayOfWeek;if(this.rangeUnit){this.periodStartDate=this.startDate=isc.DateUtil.getStartOf(this.chosenDate,this.rangeUnit,false,_2);this.periodEndDate=this.endDate=isc.DateUtil.getEndOf(this.chosenDate,this.rangeUnit,false,_2)}
if(!this.logicalDate){this.logicalDate=isc.DateUtil.getLogicalDateOnly(this.chosenDate)}
if(this.usesLanes()){this.lanes=_1.lanes?_1.lanes.duplicate():[];this.laneMap=this.lanes.makeIndex("name")}
this.rebuildFields();this.Super("initWidget",arguments);if(isc.isAn.Array(_1.data)){this.$128r=true;this.$53e=true}
this.addAutoChild("eventDragCanvas",{styleName:this.eventDragCanvasStyleName})},isc.A.getFirstDateColumn=function isc_DaySchedule_getFirstDateColumn(){return this.frozenBody?this.frozenBody.fields.length:0},isc.A.reorderFields=function isc_DaySchedule_reorderFields(_1,_2,_3){this.Super("reorderFields",arguments);this.refreshEvents("reorderFields")},isc.A.$220n=function isc_DaySchedule__getLabelFieldProperties(){return{autoFitWidth:true,minWidth:this.labelColumnWidth,width:this.labelColumnWidth,name:"label",isLabelField:true,title:" ",cellAlign:"right",calendar:this.calendar,frozen:this.labelColumnPosition=="left",formatCellValue:function(_4,_5,_6,_7,_8){var _1=_8.calendar;var _2=_5.logicalTime;var _3=(_2.getHours()*60)+_2.getMinutes();if(_3%_1.rowTitleFrequency==0){return isc.Time.toShortTime(_2,_8.creator.timeFormatter,true)}else{return""}}}},isc.A.rebuildFields=function isc_DaySchedule_rebuildFields(){this.initCacheValues();var _1=this.calendar,_2=[],_3=this.labelColumnPosition=="left";this.showLabelColumn=_1.showLabelColumn;if(this.showLabelColumn&&_3){_2.add(this.$220n())}
var _4=[];if(this.usesLanes()){_4=this.lanes||[];if(_4.length==0){isc.logWarn("Calendar.showDayLanes has been turned off because no lanes have been provided.");this.calendar.showDayLanes=false}}
if(_4.length>0){var d=this.startDate.duplicate(),_6=isc.DaySchedule.$126v(this),_7=isc.DateUtil.createLogicalDate(d.getFullYear(),d.getMonth(),d.getDate()),_8={align:"center",canReorder:_1.canReorderLanes,date:_7,startDate:isc.DateUtil.getStartOf(isc.DateUtil.createDatetime(_7),"D",false),endDate:isc.DateUtil.getEndOf(isc.DateUtil.createDatetime(_7),"D",false)};for(var i=0;i<_4.length;i++){var _10=_4[i],_11=_10.name,p=isc.addProperties({},_8,{name:_11});p[_1.laneNameField]=_11;if(_10.sublanes){var _13=this.getLaneWidth(_10),_14=_10.sublanes.length,_15=Math.floor(_13/_14),_16=0;for(var j=0;j<_14;j++){var _18=_10.sublanes[j];_18[_1.laneNameField]=_18.name;_18.left=_16;if(_18.width==null)_18.width=_15;_16+=_18.width}
_10.width=_10.sublanes.getProperty("width").sum()}
_2.add(isc.addProperties(p,_10))}
_6.setProperty(_11,"");this.setShowHeader(true);if(_1.canReorderLanes)this.canReorderFields=_1.canReorderLanes;if(_1.minLaneWidth!=null)this.minFieldWidth=_1.minLaneWidth;this.data=_6}else{var _7=isc.DateUtil.getLogicalDateOnly(this.startDate);var _19=_1.getWeekendDays();var _20=isc.DateUtil.getShortDayNames();var _21=this.isWeekView()?7:1;for(var i=0;i<_21;i++){var _22=_7.toShortDate(this.dateFormatter,false);if(_22.match(this.$81i)!=null)_22=_22.substring(5);else if(_22.match(this.$81j))_22=_22.substring(0,_22.length-5);var _23="day"+(i+1);var _24={name:_23,width:"*",autoFitWidth:false,align:"right",showIf:"return list.calendar.showWeekends || !field.isWeekend;",isWeekend:_19.contains(_7.getDay()),title:_20[_7.getDay()]+" "+_22,date:isc.DateUtil.getLogicalDateOnly(_7),startDate:isc.DateUtil.getStartOf(isc.DateUtil.createDatetime(_7),"D",false),endDate:isc.DateUtil.getEndOf(isc.DateUtil.createDatetime(_7),"D",false),$654:_7.getDay(),$658:_7.getDate(),$659:_7.getMonth(),$66a:_7.getFullYear()};_2.add(_24);_7.setDate(_7.getDate()+1)}
this.setShowHeader(this.isWeekView());this.data=isc.DaySchedule.$126v(this)}
if(this.showLabelColumn&&!_3){_2.add(this.$220n())}
if(this.isDrawn())this.setFields(_2);else this.fields=_2},isc.A.updateFieldDates=function isc_DaySchedule_updateFieldDates(){var _1=isc.DateUtil.getShortDayNames();var _2=this.calendar.getWeekendDays();var _3=this.isWeekView()?7:1;var _4=this.logicalDate.duplicate()
for(var i=0;i<_3;i++){var _6=_4.toShortDate(this.dateFormatter,false);if(_6.match(this.$81i)!=null)_6=_6.substring(5);else if(_6.match(this.$81j))_6=_6.substring(0,_6.length-5);var _7="day"+(i+1);var _8={title:_1[_4.getDay()]+" "+_6,date:_4.duplicate(),$654:_4.getDay(),$658:_4.getDate(),$659:_4.getMonth(),$66a:_4.getFullYear()};this.setFieldProperties(_7,_8);_4.setDate(_4.getDate()+1)}
if(this.header)this.header.markForRedraw()},isc.A.updateRowDates=function isc_DaySchedule_updateRowDates(){var _1=this.getTimePerCell(),_2=(60/_1)*24,_3=this.startDate,_4=isc.DateUtil.getLogicalDateOnly(_3);isc.DaySchedule.$129g(this);_4=isc.DateUtil.createDatetime(_4.getFullYear(),_4.getMonth(),_4.getDate(),0,0,0,0);var _5=this.logicalDate.duplicate(),_6=isc.DateUtil.createLogicalTime(0,0,0);for(var i=0;i<_2;i++){var _8=isc.DateUtil.combineLogicalDateAndTime(_5,_6);var _9=this.data[i];_9.time=_8.duplicate();_9.logicalDate=_5.duplicate();_9.logicalTime=_6.duplicate();_6.setMinutes(_6.getMinutes()+_1)}},isc.A.getDateFromPoint=function isc_DaySchedule_getDateFromPoint(_1,_2,_3,_4){var _5=this.calendar;if(_1==null&&_2==null){_2=this.body.getOffsetY();_1=this.body.getOffsetX()}
var _6=this.body.getEventRow(_2);if(_6==-1)_6=0;else if(_6==-2)_6=this.getTotalRows()-1;var _7=this.body.getRowHeight(this.getRecord(_6),_6),_8=this.body.getRowTop(_6),_9=this.body.getEventColumn(_1),_10=(_9<0);if(_9==-1)_9=0;else if(_9==-2)_9=this.body.fields.length-1;var _11=this.getCellDate(_6,_9);if(!_11)return null;var _12=this.getTimePerCell(),_13=_5.getRowsPerHour(this),_14=_2-_8,_15=_5.getSnapGapPixels(this),_16=_14-(_14%_15),_17=Math.round(_12/(_7/_15)),_18=_16/_15,_19=_17*_18;_11.setMinutes(_11.getMinutes()+_19);return _11},isc.A.getCellDate=function isc_DaySchedule_getCellDate(_1,_2){if(!this.body||!this.body.fields||!this.$129f||!this.body.fields[_2]){return null}
if(_1<0)_1=this.data.getLength()-1;var _3=this.isDayView()?"day1":this.body.fields[_2][this.fieldIdProperty];if(!_3.startsWith("day"))return;var _4=this.$129f[_1];if(!_4||!_4[_3])return null;var _5=isc.DateUtil.combineLogicalDateAndTime(_4[_3+"$220o"],_4.logicalTime);return _5},isc.A.getCellEndDate=function isc_DaySchedule_getCellEndDate(_1,_2){if(!this.body||!this.body.fields||!this.$129f||!this.body.fields[_2]){return null}
if(_1<0)_1=this.data.getLength()-1;var _3=this.isDayView()?"day1":this.body.fields[_2][this.fieldIdProperty];if(!_3.startsWith("day"))return;var _4=this.$129f[_1];if(!_4||!_4[_3])return null;var _5=isc.DateUtil.combineLogicalDateAndTime(_4[_3+"$220o"],_4.logicalEndTime);return _5},isc.A.getEventLeft=function isc_DaySchedule_getEventLeft(_1){var _2=this.getColFromDate(this.calendar.getEventStartDate(_1),_1[this.calendar.laneNameField]);return this.body.getColumnLeft(_2)},isc.A.getEventRight=function isc_DaySchedule_getEventRight(_1){var _2=this.getColFromDate(this.calendar.getEventEndDate(_1),_1[this.calendar.laneNameField]);return this.body.getColumnLeft(_2)+this.body.getColumnWidth(_2)},isc.A.getDateLeftOffset=function isc_DaySchedule_getDateLeftOffset(_1){var _2=this.getColFromDate(_1);if(_2!=null)return this.body.getColumnLeft(_2);return 0},isc.A.getDateTopOffset=function isc_DaySchedule_getDateTopOffset(_1,_2){var _3=(_1.getHours()*60)+_1.getMinutes();var _4=Math.floor(_3/this.getTimePerSnapGap("mn"));var _5=_4*this.getSnapGapPixels();return _5},isc.A.setLanes=function isc_DaySchedule_setLanes(_1,_2){var _3=this.creator;_3.checkLaneNames(_1);this.lanes=_1;this.laneMap=this.lanes.makeIndex("name");this.rebuildFields();if(!_2)this.refreshEvents("setLanes")},isc.A.getLane=function isc_DaySchedule_getLane(_1){return this.getLaneMap()[_1]},isc.A.getLaneIndex=function isc_DaySchedule_getLaneIndex(_1){if(!this.usesLanes())return;var _2=this.body.fields,_3=-1;if(isc.isAn.Object(_1))_3=_2.indexOf(_1)
else if(isc.isA.String(_1)){_3=_2.findIndex("name",_1);if(_3<0)_3=_2.findIndex(this.calendar.laneNameField,_1)}
return _3},isc.A.getLaneWidth=function isc_DaySchedule_getLaneWidth(_1){var _2=null;if(isc.isA.String(_1))_1=this.getLane(_1);if(_1){if(_1.width)_2=_1.width;else{var _3=this.calendar.laneNameField,_4=this.body.fields.findIndex(_3,_1[_3]);_2=_4>=0?this.body.getColumnWidth(_4):null}}
return _2},isc.A.getLaneFromPoint=function isc_DaySchedule_getLaneFromPoint(_1,_2){if(!this.usesLanes())return null;if(_1==null)_1=this.body.getOffsetX();var _3=this.body.getEventColumn(_1),_4=this.body.fields[_3];return!this.isGroupNode(_4)?_4:null},isc.A.getSublaneFromPoint=function isc_DaySchedule_getSublaneFromPoint(_1,_2){if(!this.hasSublanes())return null;if(_1==null)_1=this.body.getOffsetX();var _3=this.body.getEventColumn(_1),_4=this.body.fields[_3],_5=_4?_4.sublanes:null;if(!_5)return null;var _6=this.body.getColumnLeft(_3),_7=_1-_6,_8=this.getLaneWidth(_4),_9=_5.length,_10=0;for(var i=0;i<_9;i++){if(_10+_5[i].width>_7){return _5[i]}
_10+=_5[i].width}
return null},isc.A.draw=function isc_DaySchedule_draw(_1,_2,_3,_4){this.invokeSuper(isc.DaySchedule,"draw",_1,_2,_3,_4);this.logDebug('draw','calendar');this.body.addChild(this.eventDragCanvas,null,false);this.eventDragCanvas.setView(this);if(this.$128r){delete this.$128r;this.refreshEvents("draw")}
if(this.calendar.scrollToWorkday)this.scrollToWorkdayStart();if(this.$191w){delete this.$191w;this.calendar.currentViewChanged(this.viewName)}},isc.A.scrollToWorkdayStart=function isc_DaySchedule_scrollToWorkdayStart(){var _1=this.calendar;if(this.$166u)return;if(_1.scrollToWorkday){var _2=this.calcRowHeight();if(_2!=_1.rowHeight){this.$166u=true;_1.setRowHeight(_2,true);delete this.$166u}}
this.updateSnapProperties();this.$166u=true;var _3=this.getWorkdayRange(),_4=isc.DateUtil.combineLogicalDateAndTime(this.chosenDate,_3.start),_5=this.getDateTopOffset(_4);this.body.delayCall("scrollTo",[0,_5]);delete this.$166u},isc.A.getWorkdayRange=function isc_DaySchedule_getWorkdayRange(){var _1=this.body.fields,_2={start:isc.Time.parseInput("23:59"),end:isc.Time.parseInput("00:01")},_3=this.calendar,_4=_3.chosenDate,_5;if(this.isWeekView()){for(var i=0;i<_1.length;i++){_4=this.getDateFromCol(i);if(isc.isA.Date(_4)){_5=isc.Time.parseInput(_3.getWorkdayStart(_4));if(isc.DateUtil.compareDates(_2.start,_5)<0){_2.start=_5}
_5=isc.Time.parseInput(_3.getWorkdayEnd(_4));if(isc.DateUtil.compareDates(_2.end,_5)>0){_2.end=_5}}}}else if(_3.showDayLanes){for(var i=0;i<_1.length;i++){var _7=_1[i],_8=_7[_3.laneNameField];if(isc.isA.Date(_4)){_5=isc.Time.parseInput(_3.getWorkdayStart(_4,_8));if(isc.DateUtil.compareDates(_2.start,_5)<0){_2.start=_5}
_5=isc.Time.parseInput(_3.getWorkdayEnd(_4,_8));if(isc.DateUtil.compareDates(_2.end,_5)>0){_2.end=_5}}}}else{_2.start=isc.Time.parseInput(_3.getWorkdayStart(_3.chosenDate));_2.end=isc.Time.parseInput(_3.getWorkdayEnd(_3.chosenDate))}
return _2},isc.A.calcRowHeight=function isc_DaySchedule_calcRowHeight(){var _1=this.getWorkdayRange(),_2=_1.end.getHours()-_1.start.getHours(),_3=this.calendar.rowHeight;if(_2<=0)return _3;var _4=Math.ceil(this.body.getViewportHeight()/
(_2*this.calendar.getRowsPerHour(this)))-1;return _4<_3?_3:_4},isc.A.getRowHeight=function isc_DaySchedule_getRowHeight(_1,_2){return this.calendar.rowHeight},isc.A.getDayFromCol=function isc_DaySchedule_getDayFromCol(_1){if(_1<0)return null;var _2=this.body.fields.get(_1).$654;return _2},isc.A.getDateFromCol=function isc_DaySchedule_getDateFromCol(_1){if(_1<0)return null;var _2=this.getCellDate(0,_1);return _2},isc.A.getColFromDate=function isc_DaySchedule_getColFromDate(_1,_2){var _3=isc.DateUtil.getLogicalDateOnly(_1);for(var i=0;i<this.body.fields.length;i++){var _5=this.body.fields.get(i);if(!_5.date)continue;if(isc.DateUtil.compareLogicalDates(_3,_5.date)==0){if(this.usesLanes()&&_2){if(_5.lane==_2)return i}else return i}}
return null},isc.A.getFieldNameFromDate=function isc_DaySchedule_getFieldNameFromDate(_1,_2){var _3=this.getFieldFromDate(_1,_2);if(_3)return _3.name;return""},isc.A.getFieldFromDate=function isc_DaySchedule_getFieldFromDate(_1,_2){var _3=isc.DateUtil.getLogicalDateOnly(_1);for(var i=0;i<this.body.fields.length;i++){var _5=this.body.fields.get(i);if(!_5.date)continue;if(isc.DateUtil.compareLogicalDates(_3,_5.date)==0){if(this.usesLanes()&&_2){if(_5.lane==_2)return _5}else return _5}}
return null},isc.A.isLabelCol=function isc_DaySchedule_isLabelCol(_1){var _2=this.frozenFields?this.frozenFields.length:0;if(_1<_2)return true;var _3=this.getCellDate(1,_1-_2);return _3==null},isc.A.cellDisabled=function isc_DaySchedule_cellDisabled(_1,_2){var _3=this.getFieldBody(_2);if(!_3||_3==this.frozenBody)return false;var _4=this.getLocalFieldNum(_2),_5=this.getCellDate(_1,_4);if(this.$142y){var _6=this.$142y;for(var i=0;i<_6.length;i++){if(_6[i].rowNum==_1&&_6[i].colNum==_4){return true}}}
return this.calendar.shouldDisableDate(_5,this)},isc.A.refreshStyle=function isc_DaySchedule_refreshStyle(){if(!this.body)return;if(this.isWeekView()||this.calendar.showDayLanes){this.markForRedraw();return}
for(var i=0;i<this.data.length;i++){this.body.refreshCellStyle(i,1)}},isc.A.headerClick=function isc_DaySchedule_headerClick(_1,_2){var _3=this.calendar;if(this.isLabelCol(_1))return true;if(_3.showDayLanes&&!this.isWeekView())return true;var _4=this.getField(_1);_3.selectTab(0);_3.setChosenDate(_4.date);return true},isc.A.cellMouseDown=function isc_DaySchedule_cellMouseDown(_1,_2,_3){if(this.isLabelCol(_3)||this.cellDisabled(_2,_3))return true;var _4=this.calendar;var _5=this.getCellDate(this.body.getEventRow(),this.body.getEventColumn());if(_4.backgroundMouseDown&&_4.backgroundMouseDown(_5)==false)return;if(!_4.canCreateEvents)return true;this.clearSelection();this.$53q={};this.$53q.colNum=_3;this.$53q.startRowNum=_2;this.$53q.endRowNum=_2;this.$53r=true;this.refreshCellStyle(_2,_3)},isc.A.cellOver=function isc_DaySchedule_cellOver(_1,_2,_3){if(this.calendar.canDragCreateEvents==false)return;if(this.$53r&&this.$53q){var _4;if(this.$53q.startRowNum<this.$53q.endRowNum){if(_2>this.$53q.endRowNum){_4=_2}else{_4=this.$53q.endRowNum}
this.$53q.endRowNum=_2}else{if(_2<this.$53q.endRowNum){_4=_2}else{_4=this.$53q.endRowNum}
this.$53q.endRowNum=_2}
var _5=6,_6=this.$53q.colNum,_7=this.getTotalRows();for(var i=_4-_5;i<_4+_5;i++){if(i>=0&&i<_7)this.refreshCellStyle(i,_6)}}},isc.A.cellMouseUp=function isc_DaySchedule_cellMouseUp(_1,_2,_3){if(!this.$53q)return true;this.$53r=false;var _4,_5,_6;if(this.$53q.startRowNum>this.$53q.endRowNum){_4=this.$53q.endRowNum;_5=this.$53q.startRowNum}else{_5=this.$53q.endRowNum;_4=this.$53q.startRowNum}
_6=_5-_4+1;var _7=this.calendar,_8=_7.getCellDate(_4,_3,this),_9=_7.getCellDate(_4+_6,_3,this);if(!_9){_9=isc.DateUtil.getEndOf(_8,"D",false,this.firstDayOfWeek)}
if(_6==1&&_7.backgroundClick){if(_7.backgroundClick(_8,_9)==false){this.clearSelection();return}}
if(_7.backgroundMouseUp){if(_7.backgroundMouseUp(_8,_9)==false){this.clearSelection();return}}
var _10,_11;if(_7.showDayLanes&&_7.dayViewSelected()){_10=this.getLaneFromPoint();_11=_10?this.getSublaneFromPoint():null}
var _12=_7.createEventObject(null,_8,_9,_10&&_10.name,_11&&_11.name);_7.showEventDialog(_12,true);return isc.EH.STOP_BUBBLING},isc.A.getCellStyle=function isc_DaySchedule_getCellStyle(_1,_2,_3){var _4=this.calendar,_5=this.getBaseStyle(_1,_2,_3);if(this.isLabelCol(_3))return _5;if(this.cellDisabled(_2,_3))return _5+"Disabled";if(this.$53q&&this.$53q.colNum==_3){var _6=this.$53q.startRowNum,_7=this.$53q.endRowNum;if(_2>=_6&&_2<=_7||_2>=_7&&_2<=_6){if(_5==_4.workdayBaseStyle)return _5+"Selected";return _4.selectedCellStyle}}
if(!this.isWeekView()&&this.alternateRecordStyles&&_2%2!=0){if(_5==_4.workdayBaseStyle)return _5;return _5+"Dark"}
if(_4.dayViewSelected()&&_4.showDayLanes&&this.alternateFieldStyles&&_3%2!=0){if(_5==_4.workdayBaseStyle)return _5;return _5+"Dark"}
return _5},isc.A.getBaseStyle=function isc_DaySchedule_getBaseStyle(_1,_2,_3){var _4=this.calendar,_5=_4.getCellDate(_2,_3,this),_6=this.getField(_3),_7=(_6&&_6.styleName)||(_5&&_4.getDateStyle?_4.getDateStyle(_5,_2,_3,this):null),_8=this.isWeekView();if(_7){return _7}
if(this.isLabelCol(_3))return this.labelColumnBaseStyle;if(!_4.showWorkday)return this.baseStyle;var _9=this.getFieldBody(_3),_10=_3;if(_9==this.body)_10=this.getLocalFieldNum(_3);var _11=_8?this.getDayFromCol(_10):_4.chosenDate.getDay();var _12=_8?this.getDateFromCol(_10):_4.chosenDate.duplicate(),_13=_12.duplicate(),_14=_5?_5.duplicate():null,_15=this.usesLanes()?this.body.getField(_10)[_4.laneNameField]:null;if(_14){var _16=isc.Time.parseInput(_4.getWorkdayStart(_14,_15)),_17=isc.Time.parseInput(_4.getWorkdayEnd(_14,_15));_12.setHours(_16.getHours(),_16.getMinutes(),0,0);_13.setHours(_17.getHours(),_17.getMinutes(),0,0);var _18=_4.dateIsWorkday(_14,_15);_14=_14.getTime();if(_18&&_12.getTime()<=_14&&_14<_13.getTime()){return _4.workdayBaseStyle}else{return this.baseStyle}}else{return this.baseStyle}},isc.A.clearSelection=function isc_DaySchedule_clearSelection(){if(this.$53q){var _1,_2,_3=this.$53q.colNum;if(this.$53q.startRowNum<this.$53q.endRowNum){_1=this.$53q.startRowNum;_2=this.$53q.endRowNum}else{_1=this.$53q.endRowNum;_2=this.$53q.startRowNum}
this.$53q=null;for(var i=_1;i<_2+1;i++){this.refreshCellStyle(i,_3)}}},isc.A.destroyEvents=function isc_DaySchedule_destroyEvents(){if(!this.body||!this.body.children)return;var _1=this.body.children.length;while(--_1>=0){var _2=this.body.children[_1];if(_2&&!_2.destroyed){_2.clear();_2.deparent();_2.destroy()}
_2=null}
this.$232j=null;this.$232n=null;this.$128h=null});isc.B._maxIndex=isc.C+42;isc.ClassFactory.defineClass("WeekSchedule","DaySchedule");isc.A=isc.WeekSchedule.getPrototype();isc.A.rangeUnit="W";isc.ClassFactory.defineClass("MonthSchedule","CalendarView");isc.ClassFactory.defineClass("MonthScheduleBody","GridBody");isc.MonthSchedule.changeDefaults("headerButtonProperties",{showRollOver:false,showDown:false,cursor:"default"});isc.MonthSchedule.changeDefaults("bodyProperties",{redrawOnResize:true,fixedRowHeights:false});isc.A=isc.MonthSchedule.getPrototype();isc.B=isc._allFuncs;isc.C=isc.B._maxIndex;isc.D=isc._funcClasses;isc.D[isc.C]=isc.A.Class;isc.A.rangeUnit="M";isc.A.autoDraw=false;isc.A.leaveScrollbarGap=false;isc.A.showAllRecords=true;isc.A.showHeader=true;isc.A.showHeaderContextMenu=false;isc.A.canSort=false;isc.A.canResizeFields=false;isc.A.canReorderFields=false;isc.A.canAutoFitFields=false;isc.A.canHover=true;isc.A.showHover=true;isc.A.showRollOver=true;isc.A.useCellRollOvers=true;isc.A.hoverByCell=true;isc.A.showViewHovers=false;isc.A.canSelectCells=true;isc.A.navigateOnTab=false;isc.A.dayHeaderHeight=20;isc.A.alternateRecordStyles=false;isc.A.$160h="date";isc.A.cellHeight=1;isc.A.enforceVClipping=true;isc.B.push(isc.A.getDateLabelText=function isc_MonthSchedule_getDateLabelText(_1,_2){return"<b>"+this.chosenDate.getShortMonthName()+" "+this.chosenDate.getFullYear()+"</b>"},isc.A.initWidget=function isc_MonthSchedule_initWidget(){var _1=this.calendar;this.fields=[{name:"day1",align:"center"},{name:"day2",align:"center"},{name:"day3",align:"center"},{name:"day4",align:"center"},{name:"day5",align:"center"},{name:"day6",align:"center"},{name:"day7",align:"center"}];this.firstDayOfWeek=_1.firstDayOfWeek;var _2=isc.DateUtil.getShortDayNames();var _3=_1.getWeekendDays();for(var i=0;i<7;i++){var _5=(i+this.firstDayOfWeek)%7;this.fields[i].title=_2[_5];this.fields[i].$654=_5;this.fields[i].$66b=i+1;if(_3.contains(_5)){this.fields[i].showIf="list.creator.showWeekends!=false;"}}
this.minimumDayHeight=_1.minimumDayHeight;if(this.rangeUnit){this.periodStartDate=this.startDate=isc.DateUtil.getStartOf(this.chosenDate,this.rangeUnit,false,this.firstDayOfWeek);this.periodEndDate=this.endDate=isc.DateUtil.getEndOf(this.chosenDate,this.rangeUnit,false,this.firstDayOfWeek)}
this.Super("initWidget",arguments);this.$128r=true},isc.A.canSelectCell=function isc_MonthSchedule_canSelectCell(_1,_2){return!this.calendar.shouldDisableDate(this.calendar.getCellDate(_1,_2,this))},isc.A.getCalendar=function isc_MonthSchedule_getCalendar(){return this.calendar},isc.A.getTimePerCell=function isc_MonthSchedule_getTimePerCell(_1){return isc.DateUtil.convertPeriodUnit(1,"d","mn")},isc.A.getTimePerSnapGap=function isc_MonthSchedule_getTimePerSnapGap(_1){return isc.DateUtil.convertPeriodUnit(1,"d","mn")},isc.A.getDayArray=function isc_MonthSchedule_getDayArray(){var _1=[],_2,_3,_4=this.calendar,_5=isc.DateUtil.createLogicalDate(_4.year,_4.month,1);while(_5.getDay()!=this.firstDayOfWeek){this.incrementDate(_5,-1)}
if(!_4.showWeekends){var _6=_4.getWeekendDays();var _7=_5.duplicate();var _8=true;for(var i=0;i<=7-_6.length;i++){if(_7.getMonth()==_4.month){_8=false;break}
this.incrementDate(_7,1)}
if(_8)this.incrementDate(_5,7)}
_3=isc.DateUtil.createLogicalDate(_4.year,_4.month,_5.getDate()+40);_2=_4.$53g(_5,_3,this);_2.sortByProperty("name",true,function(_10,_11,_12){return _10[_12.startDateField].getTime()},_4);this.$53t=0;for(var i=0;i<6;i++){if(_4.showDayHeaders)_1.add(this.getHeaderRowObject(_5));_1.add(this.getEventRowObject(_5,_2));this.incrementDate(_5,7);if(_5.getMonth()!=_4.month)break}
this.cacheRowHeights(_1);this.$204a=_1;return _1},isc.A.resized=function isc_MonthSchedule_resized(){if(!this.$204a)return;this.cacheRowHeights();this.markForRedraw()},isc.A.cacheRowHeights=function isc_MonthSchedule_cacheRowHeights(_1){_1=_1||this.$204a;var _2=this.calendar,_3=_2.showDayHeaders,_4=_3?this.dayHeaderHeight:0,_5=_3?_1.length/2:_1.length,_6=this.body.getVisibleHeight(),_7=_3?_4*_5:0,_8=Math.floor(_6/_1.length);if(_3){_8=Math.floor((_6-_7)/_5);var _9=this.minimumDayHeight-_4;if(_8<_9)_8=_9;_7+=(_8*_5)}else{_7=_8*_1.length}
var _10=_6-_7;for(var i=0;i<_1.length;i++){if(_1[i].isHeaderRow)_1[i].rowHeight=_4;else{_1[i].rowHeight=_8;if(_10>0&&i==_1.length-1){_1[i].rowHeight+=_10}}}},isc.A.getHeaderRowObject=function isc_MonthSchedule_getHeaderRowObject(_1){var _2={};var _3=_1.duplicate();for(var i=0;i<7;i++){_2["day"+(i+1)]=_3.getDate();_2["date"+(i+1)]=_3.duplicate();this.incrementDate(_3,1)}
_2.isHeaderRow=true;return _2},isc.A.getCellDate=function isc_MonthSchedule_getCellDate(_1,_2){if(_1==null&&_2==null){_1=this.getEventRow();_2=this.getEventColumn()}
if(_1<0||_2<0)return null;var _3=this.body.fields.get(_2).$66b,_4=this.getRecord(_1),_5=[this.$160h,_3].join(""),_6=_4[_5];return _6},isc.A.getCellEndDate=function isc_MonthSchedule_getCellEndDate(_1,_2){var _3=this.getCellDate(_1,_2);if(!_3)return null;return isc.DateUtil.getEndOf(_3,"d",false)},isc.A.incrementDate=function isc_MonthSchedule_incrementDate(_1,_2){var _3=_1.getDate();_1.setDate(_3+_2);if(_1.getDate()==(_3+_2)-1){_1.setHours(_1.getHours()+1);_1.setDate(_3+_2)}
return _1},isc.A.getEventRowObject=function isc_MonthSchedule_getEventRowObject(_1,_2){var _3={};var _4=_1.duplicate();for(var i=0;i<7;i++){var _6=[];while(this.$53t<_2.length){var _7=_2[this.$53t];if(_7[this.calendar.startDateField].getMonth()!=_4.getMonth()||_7[this.calendar.startDateField].getDate()!=_4.getDate()){break}else{_6.add(_7);this.$53t+=1}}
_3["day"+(i+1)]=_4.getDate();_3["date"+(i+1)]=_4.duplicate();_3["event"+(i+1)]=_6;this.incrementDate(_4,1)}
return _3},isc.A.getEvents=function isc_MonthSchedule_getEvents(_1,_2){var _3=this.getFieldBody(_2);if(!_3||_3==this.frozenBody)return false;var _4=this.getLocalFieldNum(_2);var _5=this.getDayFromCol(_4);var _6=this.fields.get(_4).$66b;var _7=this.data[_1]["event"+_6];return _7},isc.A.getEventCell=function isc_MonthSchedule_getEventCell(_1){var _2=this.data;for(var _3=0;_3<this.fields.length;_3++){var _4=this.fields[_3].$66b,_5="event"+_4;for(var _6=0;_6<_2.length;_6++){var _7=_2.get(_6)[_5];if(_7!=null&&_7.contains(_1)){return[_6,_3]}}}},isc.A.getDayFromCol=function isc_MonthSchedule_getDayFromCol(_1){var _2=this.body.fields.get(_1).$654;return _2},isc.A.getDateCells=function isc_MonthSchedule_getDateCells(_1){for(var i=0;i<this.data.length;i++){var _3=this.data[i];for(var _4 in _3){if(_4.startsWith("date")&&isc.DateUtil.compareLogicalDates(_1,_3[_4])==0)
{var _5=[];if(this.calendar.showDayHeaders)
_5.add([i+1,new Number(_4.substring(4,5))-1]);_5.add([i,new Number(_4.substring(4,5))-1])
return _5}}}
return null},isc.A.cellDisabled=function isc_MonthSchedule_cellDisabled(_1,_2){var _3=this.getFieldBody(_2);if(!_3||_3==this.frozenBody)return false;var _4=this.getLocalFieldNum(_2),_5=this.getCellDate(_1,_4);return this.calendar.shouldDisableDate(_5,this)},isc.A.refreshEvents=function isc_MonthSchedule_refreshEvents(){var _1=this.calendar;if(!_1.hasData())return;this.logDebug('refreshEvents: month','calendar');this.year=_1.year;this.month=_1.month;var _2=this.getDayArray();if(this.data)this.setData([]);this.setData(_2);this.selectChosenDateCells();if(_1.eventsRendered&&isc.isA.Function(_1.eventsRendered))
_1.eventsRendered()},isc.A.rowIsHeader=function isc_MonthSchedule_rowIsHeader(_1){var _2=this.calendar;if(!_2.showDayHeaders||(_2.showDayHeaders&&_1%2==1))return false;else return true},isc.A.formatCellValue=function isc_MonthSchedule_formatCellValue(_1,_2,_3,_4){if(!_2)return;var _5=this.calendar,_6=this.fields.get(_4).$66b,_7=_2["event"+_6],_8=_2["date"+_6],_9=_8.getMonth()!=_5.month;if(this.rowIsHeader(_3)){if(!_5.showOtherDays&&_9){return""}else{return _5.getDayHeaderHTML(_8,_7,_5,_3,_4)}}else{if(!_5.showOtherDays&&_9){return""}else{return _5.getDayBodyHTML(_8,_7,_5,_3,_4)}}},isc.A.getRowHeight=function isc_MonthSchedule_getRowHeight(_1,_2){if(_1&&_1.rowHeight!=null)return _1.rowHeight;return this.cellHeight},isc.A.getCellAlign=function isc_MonthSchedule_getCellAlign(_1,_2,_3){if(this.rowIsHeader(_2))return"right";else return"left"},isc.A.getCellVAlign=function isc_MonthSchedule_getCellVAlign(_1,_2,_3){if(!this.rowIsHeader(_2))return"top";else return"center"},isc.A.cellHoverHTML=function isc_MonthSchedule_cellHoverHTML(_1,_2,_3){var _4=this.fields.get(_3).$66b;var _5=_1["date"+_4];var _6=_1["event"+_4];if(!this.rowIsHeader(_2)&&_6!=null){var _7=this.calendar;return _7.getMonthViewHoverHTML(_5,_6)}},isc.A.getBaseStyle=function isc_MonthSchedule_getBaseStyle(_1,_2,_3){var _4=this.calendar,_5=this.fields.get(_3).$66b;var _6;if(this.rowIsHeader(_2)){if((_2==0&&_1["day"+_5]>7)||(_2==this.data.length-2&&_1["day"+_5]<7)){if(!_4.showOtherDays)return _4.otherDayBlankStyle;else _6=_4.otherDayHeaderBaseStyle}else _6=_4.dayHeaderBaseStyle}else{var _7=this.cellDisabled(_2,_3),_8=_4.showDayHeaders?1:0,_9=this.data.length-1;if((_2==_8&&this.data[_8]["day"+_5]>7)||(_2==_9&&this.data[_9]["day"+_5]<7)){if(!_4.showOtherDays)return _4.otherDayBlankStyle;else _6=_4.otherDayBodyBaseStyle}else _6=_4.dayBodyBaseStyle}
return _6},isc.A.selectChosenDateCells=function isc_MonthSchedule_selectChosenDateCells(){var _1=this.calendar;if(_1.selectChosenDate){this.getCellSelection().deselectAll();var _2=isc.Calendar.$1833(_1.chosenDate),_3=this.getDateCells(_2);this.getCellSelection().selectCellList(_3)}},isc.A.cellClick=function isc_MonthSchedule_cellClick(_1,_2,_3){var _4=this.calendar,_5,_6,_7=this.fields.get(_3).$66b,_8=_1["date"+_7],_9=_1["event"+_7],_10=_4.month!=_8.getMonth(),_11=false;if(!_4.showOtherDays&&_10)return;var _12=isc.DateUtil.createLogicalDate(_8.getFullYear(),_8.getMonth(),_8.getDate())
_4.setChosenDate(_12);if(this.rowIsHeader(_2)){if(!(!_4.showOtherDays&&_10)){_11=_4.dayHeaderClick(_12,_9,_4,_2,_3)}
if(_11){_4.selectTab(0)}}else{if(_10)return;if(!this.cellDisabled(_2,_3)){_11=_4.dayBodyClick(_12,_9,_4,_2,_3);if(_11&&_4.canCreateEvents){var _13=_4.getCellDate(_2,_3,this),_14=this.getCellEndDate(_2,_3,this);var _15=_4.createEventObject(null,_13,_14);_4.showEventDialog(_15,true)}}}},isc.A.draw=function isc_MonthSchedule_draw(){this.Super("draw",arguments);if(this.$128r){delete this.$128r;this.setChosenDate(this.calendar.chosenDate)}
if(this.$191w){delete this.$191w;this.calendar.currentViewChanged(this.viewName)}},isc.A.getEditDialogPosition=function isc_MonthSchedule_getEditDialogPosition(_1){var _2=this.body.getCellPageRect(this.getEventRow(),this.getEventColumn());return{left:Math.max(_2[0],this.body.getPageLeft()),top:Math.max(_2[1],this.body.getPageTop())}});isc.B._maxIndex=isc.C+31;isc.ClassFactory.defineClass("TimelineView","CalendarView");isc.TimelineView.changeDefaults("bodyProperties",{snapToCells:false,suppressVSnapOffset:true,suppressHSnapOffset:true,childrenSnapToGrid:false});isc.A=isc.TimelineView.getPrototype();isc.B=isc._allFuncs;isc.C=isc.B._maxIndex;isc.D=isc._funcClasses;isc.D[isc.C]=isc.A.Class;isc.A.canSort=false;isc.A.canResizeFields=false;isc.A.canAutoFitFields=false;isc.A.canReorderFields=false;isc.A.showHeaderContextMenu=false;isc.A.showAllRecords=true;isc.A.alternateRecordStyles=false;isc.A.showRollOver=false;isc.A.useCellRollOvers=false;isc.A.canSelectCells=false;isc.A.selectionType="multiple";isc.A.laneNameField="lane";isc.A.columnWidth=60;isc.A.laneHeight=60;isc.A.labelColumnWidth=75;isc.A.labelColumnBaseStyle="labelColumn";isc.A.labelColumnAlign="left";isc.A.eventPageSize=30;isc.A.trailIconSize=16;isc.A.leadIconSize=16;isc.A.scrollToToday=false;isc.A.lineImage="[SKINIMG]Stretchbar/hsplit_over_stretch.gif";isc.A.trailingEndPointImage="[SKINIMG]Calendar/trailingDateGripper.png";isc.A.leadingEndPointImage="[SKINIMG]Calendar/leadingDateGripper.png";isc.A.headerSpanHeight=28;isc.A.headerProperties={inherentWidth:false};isc.A.dateEditingStyle=null;isc.A.showDateChooserTimeItem=null;isc.A.verticalEvents=false;isc.A.allowMultiDayEvents=true;isc.A.animateFolders=false;isc.A.includeRangeCriteria=true;isc.A.unitSnapGapsPerCell={minute:1,hour:15,day:60,week:1440,month:1440,year:1440*30};isc.A.groupNodeStyle=null;isc.A.groupNodeBaseStyle="groupNode";isc.A.dragSelectCanvasDefaults={_constructor:"Canvas",styleName:"calendarCellSelected",opacity:60,width:1,height:1,disabled:true,visibility:"hidden",autoDraw:false,resizeNow:function(_1){var _2=this.creator,_3=_2.calendar,p=isc.addProperties({},this.props,_1);var _5=p.lane?_2.getLane(p.lane):null;var _6=p.lane&&p.sublane?_2.getSublane(p.sublane):null;if(p.top==null){p.top=_2.getRowTop(_2.getLaneIndex(p.lane));if(_6)p.top+=_6.top}
if(p.height==null){p.height=_6?_6.height:_2.getLaneHeight(p.lane)}
var _7=p.startSnap.startLeftOffset,_8=p.endSnap.endLeftOffset,_9=Math.abs(_8-_7);this.props=p;this.moveTo(_7,p.top);this.resizeTo(_9,p.height);if(!this.isDrawn())this.draw();if(!this.isVisible()){this.show()}
if(_2.shouldShowDragHovers())isc.Hover.show(this.getHoverHTML())},hoverMoveWithMouse:true,showHover:true,hoverDelay:0,hoverProps:{overflow:"visible",hoverMoveWithMouse:this.hoverMoveWithMouse},getHoverHTML:function(){var _1=this.creator,_2=this.props,_3=_2.startSnap[_1.calendar.startDateField],_4=_2.endSnap[_1.calendar.endDateField];var _5=_1.calendar.createEventObject({},_3,_4,_2.lane,_2.sublane);return _1.calendar.$140a(_1,_5)}};isc.A.laneIndexCache={};isc.A.groupRowHeight=30;isc.A.rangeCriteriaMode="view";isc.A.maximumTimelineColumns=400;isc.A.laneHeightCache={};isc.B.push(isc.A.getTimePerCell=function isc_TimelineView_getTimePerCell(_1){var _2=this.calendar,_3=this.$27q,_4=_3.millisPerCell;if(!_4){_4=isc.DateUtil.convertPeriodUnit(1*_3.unitsPerColumn,_3.granularity,"ms")}
if(!_1)_1="mn";return Math.floor(isc.DateUtil.convertPeriodUnit(_4,"ms",_1))},isc.A.getTimePerSnapGap=function isc_TimelineView_getTimePerSnapGap(_1){var _2=this.calendar,_3=this.$27q,_4=_3.millisPerSnapGap;if(!_4){if(_3.calendarEventSnapGap==null){_4=this.getTimePerCell("ms")}else if(_3.calendarEventSnapGap==0){if(_3.unitsPerColumn>1){_4=isc.DateUtil.convertPeriodUnit(1,_3.innerHeaderUnit||_3.granularity,"ms")}else{_4=isc.DateUtil.convertPeriodUnit(this.unitSnapGapsPerCell[_3.granularity],"mn","ms");_4=Math.max(_4,_3.minimumSnapGapMillis)}}else{_4=isc.DateUtil.convertPeriodUnit(_3.calendarEventSnapGap,"mn","ms");var _5=_3.minimumSnapGapMillis;if(_4<_5){this.logWarn("Invalid eventSnapGap - "+((_4/1000)/60)+" minutes - altered to the lowest sensible time that can be represented by the column-widths in the current view: "+((_5/1000)/60)+" minutes.");_4=_5}}
_3.calendarEventSnapGap=isc.DateUtil.convertPeriodUnit(_4,"ms","mn")}
if(!_1)_1="mn";return isc.DateUtil.convertPeriodUnit(_4,"ms",_1)},isc.A.getHeaderButtonWidth=function isc_TimelineView_getHeaderButtonWidth(_1){var _2=this.columnWidth;var _3=this.calendar;if(_3.headerLevels){var l=_3.headerLevels[_3.headerLevels.length-1];if(l.headerWidth!=null)_2=l.headerWidth}
return _2},isc.A.getTimePerPixel=function isc_TimelineView_getTimePerPixel(_1){var _2=this.calendar,_3=this.$27q,_4=_3.millisPerPixel;if(!_4){_4=this.getTimePerCell("ms")/this.getHeaderButtonWidth()}
if(!_1)_1="mn";return isc.DateUtil.convertPeriodUnit(_4,"ms",_1)},isc.A.getSnapGapPixels=function isc_TimelineView_getSnapGapPixels(_1,_2){var _3=this.getTimePerCell()/this.getTimePerSnapGap();return this.getHeaderButtonWidth()/_3},isc.A.getVisibleStartDate=function isc_TimelineView_getVisibleStartDate(){var _1=this.getFirstVisibleSnap();if(_1)return _1.startDate;return this.startDate},isc.A.getVisibleEndDate=function isc_TimelineView_getVisibleEndDate(){var _1=this.getLastVisibleSnap();if(_1)return _1.endDate;return this.endDate},isc.A.getFirstVisibleSnap=function isc_TimelineView_getFirstVisibleSnap(){if(this.$1725){return this.$1725[this.$1725.firstVisibleIndex]}
return null},isc.A.getLastVisibleSnap=function isc_TimelineView_getLastVisibleSnap(){if(this.$1725){return this.$1725[this.$1725.lastVisibleIndex]}
return null},isc.A.setChosenDate=function isc_TimelineView_setChosenDate(_1){this.chosenDate=_1.duplicate();this.logicalDate=isc.DateUtil.createLogicalDate(this.chosenDate);this.remapCalendarSettings();var _2=isc.DateUtil.getTimeUnitKey(this.timelineGranularity);this.startDate=isc.DateUtil.getStartOf(this.chosenDate,_2,false,this.firstDayOfWeek);this.endDate=isc.DateUtil.dateAdd(this.startDate,_2,((this.calendar.timelineColumnSpan-1)*this.timelineUnitsPerColumn),1,null,null,this.firstDayOfWeek)
this.endDate=isc.DateUtil.getEndOf(this.endDate,_2,null,this.firstDayOfWeek);this.setTimelineRange(this.startDate,this.endDate)},isc.A.getDateLabelText=function isc_TimelineView_getDateLabelText(_1,_2){if(!_1||!_2){this.logInfo("missing dates in getDateLabelText()");return""}
var _3=new Date(_1.getTime()+1),_4=new Date(_2.getTime()-1);var _5=_3.getFullYear(),_6=_3.getMonth(),_7=_3.getDate(),_8=_4.getFullYear(),_9=_4.getMonth(),_10=_4.getDate(),s="";if(_5==_8){if(_6==_9){if(_7==_10){s=_3.getShortMonthName()+" "+_7+", "+_5}else{s=_3.getShortMonthName()+" "+_7+" - "+_10+", "+_8}}else{s=_3.getShortMonthName()+" "+_7+" - "+_4.getShortMonthName()+" "+_10+", "+_8}}else{s=_3.getShortMonthName()+" "+_7+", "+_5+" - "+_4.getShortMonthName()+" "+_10+", "+_8}
return"<b>"+s+"</b>"},isc.A.initWidget=function isc_TimelineView_initWidget(){this.fields=[];this.$963=this.headerHeight;this.remapCalendarSettings();var c=this.calendar;var _2=isc.DateUtil.getTimeUnitKey(this.timelineGranularity);if(c.startDate){c.startDate=isc.DateUtil.getStartOf(c.startDate,_2,false,this.firstDayOfWeek);this.startDate=c.startDate.duplicate()}
if(c.endDate){c.endDate=isc.DateUtil.getEndOf(c.endDate,_2,false,this.firstDayOfWeek);this.endDate=c.endDate.duplicate()}
if(!this.startDate){this.startDate=c.startDate=isc.DateUtil.getAbsoluteDate("-0"+_2,c.chosenDate)}
if(!this.endDate){this.endDate=c.endDate=isc.DateUtil.getAbsoluteDate("+"+c.defaultTimelineColumnSpan+_2,this.startDate)}else if(isc.DateUtil.compareDates(this.startDate,this.endDate)==-1){var s=this.startDate;this.startDate=c.startDate=this.endDate.duplicate();this.endDate=c.endDate=s;this.logWarn("Timeline startDate is later than endDate - switching the values.")}
this.initCacheValues();this.Super("initWidget",arguments);this.$128r=true;this.addAutoChild("eventDragCanvas",{styleName:this.eventDragCanvasStyleName});this.initCacheValues();if(c.canGroupLanes==true)this.$222w=true},isc.A.remapCalendarSettings=function isc_TimelineView_remapCalendarSettings(){var c=this.calendar;this.firstDayOfWeek=c.firstDayOfWeek;if(c.renderEventsOnDemand!=null)this.renderEventsOnDemand=c.renderEventsOnDemand;if(c.laneNameField)this.laneNameField=c.laneNameField;if(c.labelColumnWidth!=null)this.labelColumnWidth=c.labelColumnWidth;if(c.alternateLaneStyles!=null)this.alternateRecordStyles=c.alternateLaneStyles;if(c.showLaneRollOver!=null){this.showRollOver=c.showLaneRollOver;this.useCellRollOvers=false}
if(c.canReorderLanes!=null)this.canReorderRecords=c.canReorderLanes;if(c.eventDragGap!=null)this.eventDragGap=c.eventDragGap;this.cellHeight=this.laneHeight;if(c.headerLevels){this.headerLevels=isc.shallowClone(c.headerLevels)}
var _2=this.headerLevels&&this.headerLevels.length>0?this.headerLevels[this.headerLevels.length-1]:null;if(_2){this.timelineGranularity=_2.unit;c.timelineGranularity=_2.unit}else{this.timelineGranularity=c.timelineGranularity}
this.timelineUnitsPerColumn=c.timelineUnitsPerColumn},isc.A.installLocalHandlers=function isc_TimelineView_installLocalHandlers(){if(this.calendar.showLaneRollOver){this.viewMouseMoveEventId=isc.Page.setEvent("mouseMove",this.getID()+".viewMouseMove()");this.viewDragMoveEventId=isc.Page.setEvent("dragMove",this.getID()+".viewDragMove()");this.viewDragRepositionMoveEventId=isc.Page.setEvent("dragRepositionMove",this.getID()+".viewDragMove()");this.$1745=true}},isc.A.removeLocalHandlers=function isc_TimelineView_removeLocalHandlers(){if(this.$1745){isc.Page.clearEvent("mouseMove",this.viewMouseMoveEventId);isc.Page.clearEvent("dragMove",this.viewDragMoveEventId);isc.Page.clearEvent("dragRepositionMove",this.viewDragRepositionMoveEventId);delete this.$1745}},isc.A.initCacheValues=function isc_TimelineView_initCacheValues(){var _1=this.calendar;this.$27q={alternateLaneStyles:this.alternateRecordStyles,firstDayOfWeek:this.firstDayOfWeek,granularity:this.timelineGranularity,unitsPerColumn:this.timelineUnitsPerColumn||1,rangeStartDate:this.startDate,rangeEndDate:this.endDate,calendarEventSnapGap:_1.eventSnapGap};this.$27q.rangeStartMillis=this.$27q.rangeStartDate.getTime();this.$27q.rangeEndMillis=this.$27q.rangeEndDate.getTime();this.updateSnapProperties();return this.$27q},isc.A.updateSnapProperties=function isc_TimelineView_updateSnapProperties(){if(this.fieldHeaderLevel)this.$27q.innerHeaderUnit=this.fieldHeaderLevel.unit;this.Super("updateSnapProperties",arguments)},isc.A.getDragSelectCanvas=function isc_TimelineView_getDragSelectCanvas(_1){if(!this.body)return null;if(!this.dragSelectCanvas){this.dragSelectCanvas=this.createAutoChild("dragSelectCanvas",{eventProxy:this.body});this.body.addChild(this.dragSelectCanvas)}
return this.dragSelectCanvas},isc.A.cellMouseDown=function isc_TimelineView_cellMouseDown(_1,_2,_3){if(isc.EH.dragTarget||isc.EH.lastTarget!=this.body)return;if((_1&&_1.$52e)||this.isLabelCol(_3)){return true}
var _4=this.calendar;if(_4.canDragCreateEvents==false&&this.canDragScroll){this.$50p=true;this.$171u=this.body.getScrollLeft();this.$171v=this.$171w=this.getOffsetX();this.$53r=true;return false}
var _5=this.getMouseData()||{x:this.body.getOffsetX(),y:this.body.getOffsetY()},_6=this.getSnapData(_5.x,_5.y),_7=_6&&_6[_4.startDateField];if(_4.shouldDisableDate(_7,this)){return false}
if(_4.backgroundMouseDown&&_4.backgroundMouseDown(_7)==false)return;if(!_4.canCreateEvents||_4.canDragCreateEvents==false)return true;this.clearSelection();var _8=this.getDragSelectCanvas(),_9=_6[_4.endDateField],_10=this.getLaneFromPoint(),_11=this.getSublaneFromPoint();var p={top:null,height:null};p.lane=_10&&_10.name;p.sublane=_11&&_11.name;p.draggingLeftEdge=false;p.startSnap=_6;p.endSnap=_6;_8.resizeNow(p);this.$53r=true;return false},isc.A.cellOver=function isc_TimelineView_cellOver(_1,_2,_3){_3-=1;this.$152f=_2;if(this.$50p){var _4=this.body.getScrollLeft(),_5=this.getOffsetX(),_6=this.$171w-_5;this.$171w=_5;var _7=Math.max(0,this.$171u+_6);this.body.scrollBy(_6)}else if(this.$53r){var _8=this.getDragSelectCanvas(),_9=_8.props,_10=this.getMouseData()||{x:this.body.getOffsetX(),y:this.body.getOffsetY()},_11=this.getSnapData(_10.x,_10.y);if(_11){if(_11.index<_9.startSnap.index){if(_9.draggingLeftEdge)_9.startSnap=_11;else{_9.endSnap=_9.startSnap;_9.startSnap=_11;_9.draggingLeftEdge=true}}else if(_11.index>_9.endSnap.index){if(!_9.draggingLeftEdge)_9.endSnap=_11;else{_9.startSnap=_9.endSnap;_9.endSnap=_11;_9.draggingLeftEdge=false}}else{if(_9.draggingLeftEdge)_9.startSnap=_11;else _9.endSnap=_11}
_8.resizeNow(_9)}}
return this.Super("cellOver",arguments)},isc.A.cellMouseUp=function isc_TimelineView_cellMouseUp(_1,_2,_3){if(!this.$53r)return;this.$53r=false;if(this.shouldShowDragHovers())isc.Hover.hide();if(this.$50p){this.$171v=null;this.$171u=null;this.$50p=false;return isc.EH.STOP_BUBBLING}
var _4=this.calendar,_5=this.getDragSelectCanvas(),_6=_5.props,_7=_6.startSnap[_4.startDateField],_8=_6.endSnap[_4.endDateField];if(_4.backgroundClick){if(_4.backgroundClick(_7,_8)==false){this.clearSelection();return}}
if(_4.backgroundMouseUp){if(_4.backgroundMouseUp(_7,_8)==false){this.clearSelection();return}}
if(_4.shouldDisableDate(isc.DateUtil.dateAdd(_8,"ms",-1),this)){this.clearSelection();return false}
var _9=_4.createEventObject(null,_7,_8,_6.lane,_6.sublane);_4.showEventDialog(_9,true);return isc.EH.STOP_BUBBLING},isc.A.clearSelection=function isc_TimelineView_clearSelection(){var _1=this.getDragSelectCanvas();if(_1)_1.hide()},isc.A.getCellDate=function isc_TimelineView_getCellDate(_1,_2){if(!this.body)return null;var _3=this.body.getField(_2);if(!_3||!_3.date)return null;return _3.date},isc.A.getCellEndDate=function isc_TimelineView_getCellEndDate(_1,_2){if(!this.body)return null;var _3=this.body.getField(_2);if(!_3||!_3.endDate)return null;return _3.endDate},isc.A.recordDrop=function isc_TimelineView_recordDrop(_1,_2,_3,_4){this.Super("recordDrop",arguments);this.$116v();this.markForRedraw()},isc.A.getFirstDateColumn=function isc_TimelineView_getFirstDateColumn(){return this.frozenBody?this.frozenBody.fields.length:0},isc.A.updateOverlapRanges=function isc_TimelineView_updateOverlapRanges(_1){var _2=this.calendar,_3=_1||this.getEventData(),_4=_3.getLength(),_5=this.overlapRanges||[],_6=[],_7=this.startDate,_8=this.endDate;var _9=(isc.isA.ResultSet(_3)?_3.allRows:_3);_9.setProperty("tagged",false);_9.setProperty("overlapProps",null);_9.setProperty("slotNum",null);_9.setSort([{property:_2.laneNameField,direction:"ascending"},{property:_2.startDateField,direction:"ascending"},{property:_2.endDateField,direction:"descending"}]);for(var i=0;i<_4;i++){var _11=_9.get(i);var _12={events:[_11]};_12[_2.leadingDateField]=_11[_2.leadingDateField];_12[_2.startDateField]=_2.getEventStartDate(_11);if(_12[_2.leadingDateField]>_8)_12[_2.leadingDateField]=_8;if(_12[_2.startDateField]<_7)_12[_2.startDateField]=_7;_12[_2.trailingDateField]=_11[_2.trailingDateField];_12[_2.endDateField]=_2.getEventEndDate(_11);if(_12[_2.trailingDateField]>_8)_12[_2.trailingDateField]=_8;if(_12[_2.endDateField]>_8)_12[_2.endDateField]=_8;_12[_2.laneNameField]=_12.lane=_11[_2.laneNameField];var _13=true;for(var j=0;j<_5.length;j++){if(_12[_2.laneNameField]!=_5[j][_2.laneNameField])continue;if(this.eventsOverlap(_12,_5[j],true)){this.mergeOverlapRanges(_12,_5[j]);_13=false}
if(!_13)break}
if(_13){_5.add(_12);if(!_6.contains(_12))_6.add(_12)}}
for(i=0;i<_5.length;i++){var _15=_5[i];_15.id="range_"+i+"_lane_"+_15.lane;_15.events.setProperty("overlapRangeId",_15.id)}
this.overlapRanges=_5;return _6},isc.A.getOverlapSlot=function isc_TimelineView_getOverlapSlot(_1,_2){var _3={slotNum:_1,events:[],snapGaps:[]};for(var i=0;i<_2;i++)_3.snapGaps[i]=0;return _3},isc.A.tagDataForOverlap=function isc_TimelineView_tagDataForOverlap(_1,_2){_1=_1||this.getEventData();if(_1.getLength()==0)return;var _3=false;var _4=this.calendar;if(_4.eventAutoArrange==false)return;this.forceDataSort(_1);var _5=this.usesLanes();var _6=this.updateOverlapRanges(_1);var _7=[];if(_5){_7.add({property:_4.laneNameField,direction:"ascending"})}
if(_4.overlapSortSpecifiers){_7.addList(_4.overlapSortSpecifiers)}else{_7.add({property:"eventLength",direction:"descending"});_7.add({property:_4.startDateField,direction:"ascending"});_7.add({property:_4.endDateField,direction:"ascending"})}
if(_3){this.logWarn("tagDataForOverlap: about to loop over "+_6.length+" overlap ranges")}
for(var j=0;j<_6.length;j++){var _9=_6[j];if(_3){this.logWarn("range: "+isc.echoFull(_9)+"")}
var _10=_9[_4.leadingDateField]||_9[_4.startDateField]
var _11=_9[_4.trailingDateField]||_9[_4.endDateField]
var _12=this.getSnapData(null,null,_10),_13=_12?_12.index:0,_14=this.getSnapData(null,null,_11),_15=_14?_14.index:this.$1725.length-1,_16=(_15-_13)+1,_17=[],_18=1;_17[0]=this.getOverlapSlot(0,_16);var _19=_9.events;_19.setSort(_7);for(var _20=0;_20<_19.length;_20++){var _21=_19[_20];_21.overlapProps={};var _22=_21.overlapProps;var _23=_21[_4.leadingDateField]||_4.getEventStartDate(_21),_24=_21[_4.trailingDateField]||_4.getEventEndDate(_21);_22.eventStartSnap=this.getSnapData(null,null,_23.getTime()+1,true);_22.eventEndSnap=this.getSnapData(null,null,_24.getTime()-1,true);var _25=(_22.eventStartSnap?_22.eventStartSnap.index:_22.nextValidSnap.index)-_13;var _26=(_22.eventEndSnap?_22.eventEndSnap.index:_22.lastValidSnap.index)-_13;var _27=false;var _28=null;for(var _29=0;_29<_18;_29++){var _30=_17[_29].snapGaps.slice(_25,_26+1);var _31=_30.sum()>0;if(!_31){_27=true;_17[_29].snapGaps.fill(1,_25,_26+1);_17[_29].events.add(_21);_21.overlapProps.slotNum=_29
if(_3){this.logWarn("event "+_21.name+" occupying slot "+_29)}
break}}
if(!_27){_17[_18]=this.getOverlapSlot(_18,_16);_17[_18].snapGaps.fill(1,_25,_26+1);_17[_18].events.add(_21);_21.overlapProps.slotNum=_18
if(_3){this.logWarn("event "+_21.name+" added to new slot index "+_18)}
_18++}}
for(var i=0;i<_17.length;i++){var _28=_17[i];for(var _33=0;_33<_28.events.length;_33++){var _21=_28.events[_33];var _22=_21.overlapProps;_22.totalSlots=_18;var _25=(_22.eventStartSnap?_22.eventStartSnap.index:_13)-_13;var _26=(_22.eventEndSnap?_22.eventEndSnap.index:_13)-_13;var _27=false;for(var _34=i+1;_34<_17.length;_34++){var _30=_17[_34].snapGaps.slice(_25,_26+1);var _31=_30.sum()>0;if(_31){_22.slotCount=_34-_22.slotNum;_27=true;break}}
if(!_27){_22.slotCount=_18-_22.slotNum}
_22.slotNum++;_21.slotNum=_22.slotNum}}
_9.slotList=_17;if(_3){this.logWarn("***** slotList *****\n"+isc.echoFull(_17))}}},isc.A.getSnapData=function isc_TimelineView_getSnapData(_1,_2,_3,_4){var _5=this.$1725,_6=_5.length,_7=(_3!=null),_8=null;if(_7){if(isc.isA.Number(_3))_8=_3;else if(_3.getTime)_8=_3.getTime()}else{if(_1==null)_1=this.body.getOffsetX()}
if(_8!=null){if(_8<_5[_5.firstVisibleIndex].startMillis){if(_4)return _5[_5.firstVisibleIndex];return null}
if(_8>_5[_5.lastVisibleIndex].endMillis){if(_4)return _5[_5.lastVisibleIndex];return null}}
for(var i=0;i<_6;i++){var _10=_5[i];if(_7){if(_10.startMillis<=_8&&_10.endMillis>=_8){return _10}}else{if(_10.startHidden&&_10.endHidden)continue;if(_1>=_10.startLeftOffset&&_1<=_10.endLeftOffset)return _10}}
return null},isc.A.buildSnapGapList=function isc_TimelineView_buildSnapGapList(_1){if(!this.$27q)return;if(!this.body)return;var _2=this.creator,_3=this.frozenBody?this.body.fields:this.getFields(),_4=_2.getSnapGapPixels(this),_5=this.getTimePerPixel("ms"),_6=this.getTimePerSnapGap("ms"),_7=this.getTimePerSnapGap("mn"),_8=this.$27q.rangeStartDate,_9=this.$27q.rangeStartMillis,_10=this.$27q.rangeEndMillis,_11=this.$27q.rangeEndDate,_12=this.$27q.rangeStartDate.duplicate(),_13=_9,i=0,_15=[],_16=false,_17=null,_18=0,_19=null,_20=null,_21;while(_13<_10){var _22=_13+_6;if(_22==_21){this.logWarn("snapGaps "+i+" and "+(i+1)+" have identical times")}else if(_22>=_10){_22=_10;_16=true}
if(_7==1440){_12.setDate(_12.getDate()+1);_22=_12.getTime()}else{_12.setTime(_22-1)}
_21=_22;_21--;var _23={index:i++,startMillis:_13,endMillis:_21,startDate:new Date(_13),endDate:new Date(_21)};_23.startField=this.getFieldContainingDate(_13+1,true);if(_23.startField){_23.startCol=_3.indexOf(_23.startField)}else{_23.startHidden=true}
if(_23.startField){if(_23.startCol==_17){_18++}else{_17=_23.startCol;_18=0}
_23.fieldSnapIndex=_18;var _24=_2.getMinutePixels(Math.floor((_13-_23.startField.date.getTime())/1000/60),null,this);_23.startLeftOffset=_23.startField.startLeftOffset+_24}
_23.endField=this.getFieldContainingDate(_21,true);if(!_23.endField){_23.endField=this.getFieldContainingDate(_21,false)}
if(_23.endField){_23.endCol=_3.indexOf(_23.endField)}else{_23.endHidden=true}
if(_23.endField){var _25=_2.getMinutePixels(Math.floor((_23.endField.endDate.getTime()-_21)/1000/60),null,this);_23.endLeftOffset=_23.endField.endLeftOffset-_25}
_23[_2.startDateField]=new Date(_13);_23[_2.endDateField]=new Date(_21);_15.add(_23);if(!_23.startHidden){if(_19==null)_19=_23.index;if(_20==null||_23.index>_20)_20=_23.index}
if(_16)break;_13=_21+1}
var _26;var _27;var _28;for(var i=0;i<_15.length;i++){var _23=_15[i];if(_23.startHidden){if(_27==null)_27=i}else{if(_27!=null){for(var j=_27;j<i;j++){_15[j].nextValidSnap=_23}
_27=null}}
if(_23.endHidden){_23.lastValidSnap=_15[_28]}else{_28=i}
_26=_23}
if(_19!=null)_15.firstVisibleIndex=_19;if(_20!=null)_15.lastVisibleIndex=_20;this.$1725=_15},isc.A.$1731=function isc_TimelineView__rebuildFields(){this.$171x=true;var _1=this.calcFields();if(this.isDrawn()){this.body.removeChild(this.eventDragCanvas);this.setFields(_1);this.body.addChild(this.eventDragCanvas,null,false)}else this.fields=_1;this.buildSnapGapList("$1731");if(this.isDrawn()&&this.scrollToToday!==false){var _2=isc.DateUtil.getLogicalDateOnly(new Date());_2.setDate(_2.getDate()-this.scrollToToday);var _3=this.getColFromDate(_2,true);if(_3!=null){this.bodies[1]&&this.bodies[1].scrollTo(this.bodies[1].getColumnLeft(_3),0)}}},isc.A.$152e=function isc_TimelineView__rebuild(_1){this.clearEvents();this.setShowHover(this.calendar.showViewHovers);this.$1731();if(!this.$2160){var _2=this.lanes||this.calendar.lanes||[];this.setLanes(_2.duplicate(),true)}
this.$730();if(_1){this.$116v()}else{this.refreshEvents("$152e")}},isc.A.refreshEvents=function isc_TimelineView_refreshEvents(){this.buildSnapGapList("refreshEvents");return this.Super("refreshEvents",arguments)},isc.A.setLanes=function isc_TimelineView_setLanes(_1,_2){this.resetLaneCaches(true);var _3=this.calendar,_4=_3.laneNameField;_3.checkLaneNames(_1);this.lanes=[];for(var i=0;i<_1.length;i++){if(this.calendar.shouldShowLane(_1[i]))this.lanes.add(_1[i])}
var _6=this.lanes.length;for(var i=0;i<_6;i++){var _7=this.lanes[i];if(_7.sublanes){var _8=this.getLaneHeight(_7),_9=_7.sublanes.length,_10=Math.floor(_8/_9),_11=0;for(var j=0;j<_9;j++){var _13=_7.sublanes[j];_13[_4]=_13.name;_13.top=_11;if(_13.height==null)_13.height=_10;_11+=_13.height}
_7.height=_7.sublanes.getProperty("height").sum()}else{_7.height=this.getLaneHeight(_7)}}
this.setData(this.lanes);this.laneMap=(this.originalData||this.data).makeIndex("name");if(!_2)this.refreshEvents("setLanes");return},isc.A.getLaneIndex=function isc_TimelineView_getLaneIndex(_1){var _2=null;if(_2==null){var _3;if(isc.isAn.Object(_1))_3=_1;else if(this.data){_3=this.laneMap[_1]||this.data.find(this.calendar.laneNameField,_1)}else _2=-1;if(_2==null)_2=this.getRecordIndex(_3);this.laneIndexCache[_1]=_2}
return _2},isc.A.getLane=function isc_TimelineView_getLane(_1){return this.getLaneMap()[_1]},isc.A.getLaneFromPoint=function isc_TimelineView_getLaneFromPoint(_1,_2){if(_2==null)_2=this.body.getOffsetY();var _3=this.getEventRow(_2),_4=this.getRecord(_3);return!this.isGroupNode(_4)?_4:null},isc.A.getSublaneFromPoint=function isc_TimelineView_getSublaneFromPoint(_1,_2){if(_2==null)_2=this.body.getOffsetY();var _3=this.getEventRow(_2),_4=this.getRecord(_3),_5=_4?_4.sublanes:null;if(!_5)return null;var _6=this.getRowTop(_3),_7=_2-_6,_8=this.getLaneHeight(_4),_9=_5.length,_10=0;for(var i=0;i<_9;i++){if(_10+_5[i].height>=_7){return _5[i]}
_10+=_5[i].height}
return null},isc.A.$730=function isc_TimelineView__scrubDateRange(){var _1=this.calendar.timelineGranularity;if(_1=="month"){this.startDate.setDate(1)}else if(_1=="week"){this.startDate=isc.DateUtil.getStartOf(this.startDate,"w",true,this.calendar.firstDayOfWeek)}else if(_1=="day"){this.startDate.setHours(0);this.startDate.setMinutes(0);this.startDate.setSeconds(0);this.startDate.setMilliseconds(0)}else if(_1=="hour"){this.startDate.setMinutes(0);this.startDate.setSeconds(0);this.startDate.setMilliseconds(0)}else if(_1=="minute"){this.startDate.setSeconds(0);this.startDate.setMilliseconds(0)}},isc.A.scrollTimelineTo=function isc_TimelineView_scrollTimelineTo(_1){this.bodies[1]&&this.bodies[1].scrollTo(_1)},isc.A.setLaneHeight=function isc_TimelineView_setLaneHeight(_1){this.laneHeight=_1;this.setCellHeight(_1);this.refreshEvents("setLaneHeight")},isc.A.getRowHeight=function isc_TimelineView_getRowHeight(_1,_2){var _3=null;if(_1){if(this.isGroupNode(_1))_3=this.groupRowHeight;else _3=_1.height}
return Math.round(_3||this.Super("getRowHeight",arguments))},isc.A.setInnerColumnWidth=function isc_TimelineView_setInnerColumnWidth(_1){this.columnWidth=_1;this.$152e(true)},isc.A.setTimelineRange=function isc_TimelineView_setTimelineRange(_1,_2){var _3=this.calendar;this.timelineGranularity=_3.timelineGranularity;this.timelineUnitsPerColumn=_3.timelineUnitsPerColumn;this.timelineColumnSpan=_3.timelineColumnSpan;var _4=this.timelineColumnSpan||this.$178u||_3.defaultTimelineColumnSpan,_5=false,_6=this.timelineGranularity.toLowerCase(),_7=isc.DateUtil.getTimeUnitKey(_6);;_1=_1||this.startDate;_1=isc.DateUtil.getStartOf(_1,_7,false,this.firstDayOfWeek);if(!_2){if(_1.getTime()==this.startDate.getTime()&&this.endDate)_2=this.endDate;else _2=isc.DateUtil.getAbsoluteDate("+"+(_4*this.timelineUnitsPerColumn)+_7,_1)}
var _8=this.rangeCriteriaMode||_3.rangeCriteriaMode;if(_8&&_8!="none")_5=true;if(_1.logicalDate){_1=isc.DateUtil.getStartOf(_1,_7,false,this.firstDayOfWeek)}
if(_2.logicalDate){_2=isc.DateUtil.getEndOf(_2,_7,false,this.firstDayOfWeek)}
if(isc.DateUtil.compareLogicalDates(_1,_2)==0){if(_3.showWeekends==false&&_3.dateIsWeekend(_1)){_3.showWeekends=true;this.logWarn("showWeekends was automatically switched on because the dates provided for the timeline spanned less than one day and the day is a weekend.")}}
this.startDate=this.periodStartDate=_1.duplicate();this.endDate=this.periodEndDate=_2.duplicate();_3.startDate=_1.duplicate();_3.endDate=_2.duplicate();this.initCacheValues();_3.setDateLabel();if(_3.autoFetchData&&_3.$1737)_5=false;this.$152e(_5)},isc.A.addUnits=function isc_TimelineView_addUnits(_1,_2,_3){_3=_3||this.calendar.timelineGranularity;if(_3=="century"){_1.setFullYear(_1.getFullYear()+(_2*100))}else if(_3=="decade"){_1.setFullYear(_1.getFullYear()+(_2*10))}else if(_3=="year"){_1.setFullYear(_1.getFullYear()+_2)}else if(_3=="quarter"){_1.setMonth(_1.getMonth()+(_2*3))}else if(_3=="month"){_1.setMonth(_1.getMonth()+_2)}else if(_3=="week"){_1.setDate(_1.getDate()+(_2*7))}else if(_3=="day"){_1.setDate(_1.getDate()+_2)}else if(_3=="hour"){_1.setHours(_1.getHours()+_2)}else if(_3=="minute"){_1.setMinutes(_1.getMinutes()+_2)}else if(_3=="second"){_1.setSeconds(_1.getSeconds()+_2)}else if(_3=="millisecond"){_1.setMilliseconds(_1.getMilliseconds()+_2)}
return _1},isc.A.getColFromDate=function isc_TimelineView_getColFromDate(_1,_2){var _3=this.frozenBody?this.body.fields:this.getFields(),_4=(_1&&_1.getTime)?_1.getTime():_1;if(_1){for(var i=0;i<_3.length;i++){var _6=_3[i],_7=_6&&_6.date?_6.date.getTime():null,_8=_6&&_6.endDate?_6.endDate.getTime():null;if(!_7||!_8)continue;if(_2){if(_4>=_7&&_4<_8){return i}}else{if(_7>=_4){return i}}}}
return null});isc.evalBoundary;isc.B.push(isc.A.getFieldContainingDate=function isc_TimelineView_getFieldContainingDate(_1,_2){var _3=this.frozenBody?this.body.fields:this.getFields(),_4=(_1&&_1.getTime)?_1.getTime():_1;if(_4){if(_4<this.startDate.getTime())return _3[0];if(_4>=this.endDate.getTime()){return _2?null:_3[_3.length-1]}
for(var i=0;i<_3.length;i++){var _6=_3[i],_7=_6&&_6.date?_6.date.getTime():null,_8=_6&&_6.endDate?_6.endDate.getTime():null;if(_4>=_7&&_4<=_8){return _6}}}
return null},isc.A.calcFields=function isc_TimelineView_calcFields(){var _1=[],_2=this.calendar;if(this.showLaneFields!=false){var _3=this.shouldShowLaneFieldHovers();if(_2.laneFields){var _4=_2.laneFields;for(var i=0;i<_4.length;i++){var _6=isc.addProperties({},{hoverDelay:this.hoverDelay+1,hoverMoveWithMouse:true,frozen:true,isLaneField:true,baseStyle:this.getLaneFieldStyleName(_4[i],{}),minWidth:this.labelColumnWidth,width:this.labelColumnWidth,canHover:_3,showHover:_3},_4[i]);_1.add(_6)}}else{var _7=isc.addProperties({autoFitWidth:true,width:this.labelColumnWidth,minWidth:this.labelColumnWidth,baseStyle:this.labelColumnBaseStyle,name:"title",title:" ",showTitle:false,frozen:true,isLaneField:true,hoverDelay:this.hoverDelay+1,hoverMoveWithMouse:true,canHover:_3,showHover:_3});_1.add(_7)}}
if(!_2.headerLevels&&!this.headerLevels){_2.headerLevels=[{unit:_2.timelineGranularity}]}
if(_2.headerLevels){this.headerLevels=isc.shallowClone(_2.headerLevels)}
if(this.headerLevels){this.fieldHeaderLevel=this.headerLevels[this.headerLevels.length-1];if(this.fieldHeaderLevel.headerWidth!=null){this.columnWidth=this.fieldHeaderLevel.headerWidth}
this.headerLevels.remove(this.fieldHeaderLevel);_2.timelineGranularity=this.fieldHeaderLevel.unit;this.$27q.innerHeaderLevel=this.fieldHeaderLevel;this.$27q.granularity=_2.timelineGranularity;this.updateSnapProperties()}
this.adjustTimelineForHeaders();var _8=this.startDate.duplicate(),_9=this.endDate.duplicate(),_10=_2.timelineUnitsPerColumn,_11=0,_12=this.fieldHeaderLevel,_13=_12&&_12.titles?_12.titles:[];if(_12.headerWidth)this.columnWidth=_12.headerWidth;var _14=_9.getTime(),_15=this.getHeaderButtonWidth(),_16=0,_17=_16+_15,_18=this.getTimePerCell("d"),_19=_18>1,_20;this.$178u=0;var _21=this.shouldShowCellHovers();var _22=this.getHeaderButtonWidth()
while(_8.getTime()<=_14){var _23=_8.duplicate(),_24=_19||_2.shouldShowDate(_8,this);_23=isc.DateUtil.getStartOf(_23,_2.timelineGranularity,false,this.firstDayOfWeek);if(_23.getTime()>=_14)break;this.$178u++;_20=isc.DateUtil.getEndOf(this.addUnits(_8.duplicate(),_10),_2.timelineGranularity,false,this.firstDayOfWeek);var _25=null;if(_20.getTime()>_14){_20.setTime(_14)}
if(_24){var _26=this.getInnerFieldTitle(_12,_11,_8);_25=isc.addProperties({},{name:"f"+_11,headerLevel:_12,title:_26,width:_12.headerWidth||_22,cellAlign:_12.cellAlign,cellVAlign:_12.cellVAlign,date:_23.duplicate(),logicalDate:isc.DateUtil.getLogicalDateOnly(_23),logicalTime:isc.DateUtil.getLogicalTimeOnly(_23),canGroup:false,canSort:false,canFreeze:false,canFocus:false,startLeftOffset:_16,endLeftOffset:_17,hoverDelay:this.hoverDelay+1,hoverMoveWithMouse:true,canHover:_21,showHover:_21},this.getFieldProperties(_23));if(_2.shouldDisableDate(_23)){_25.dateDisabled=true;_25.baseStyle="calendarDisabled"}}
_8=_20.duplicate();if(_24){_25.endDate=_8.duplicate();_25.endDate.setTime(_25.endDate.getTime()-1);_25.logicalEndDate=isc.DateUtil.getLogicalDateOnly(_8);_25.logicalEndTime=isc.DateUtil.getLogicalTimeOnly(_8),_1.add(_25);_11++;_16+=_15;_17+=_15}
if(_1.length>=this.maximumTimelineColumns){this.endDate=_8.duplicate();this.logWarn("Date-range too large - limiting to "+this.maximumTimelineColumns+" columns.");break}}
var _27=this.shouldShowHeaderHovers();var _28={hoverDelay:this.hoverDelay+1,hoverMoveWithMouse:true,canHover:_27,showHover:_27,getHoverHTML:function(){var _29=this.grid;return _29.calendar.$140e(_29,_29.fieldHeaderLevel,this,this.date,this.endDate)}};for(var i=0,_30=_1.length;i<_30;i++){var _31=_1[i];isc.addProperties(_31,_28);_31.headerLevel=this.fieldHeaderLevel}
this.buildHeaderSpans(_1,this.headerLevels,this.startDate,this.endDate);this.$116z=_11-1;return _1},isc.A.redraw=function isc_TimelineView_redraw(){this.Super("redraw",arguments);if(!this.animateFolders&&this.$236z){delete this.$236z;this.laneHeightCache={};this.laneIndexCache={};this.delayedRefreshVisibleEvents()}},isc.A.toggleFolder=function isc_TimelineView_toggleFolder(_1){this.Super("toggleFolder",arguments);this.$236z=true;this.markForRedraw()},isc.A.rowAnimationComplete=function isc_TimelineView_rowAnimationComplete(_1,_2){this.Super("rowAnimationComplete",arguments);if(!this.$64v){delete this.body.$8s;this.refreshVisibleEvents()}},isc.A.adjustTimelineForHeaders=function isc_TimelineView_adjustTimelineForHeaders(){var _1=this.calendar,_2=this.fieldHeaderLevel?this.fieldHeaderLevel.unit:_1.timelineGranularity,_3=this.startDate,_4=new Date(this.endDate.getTime()-1);var _5=isc.DateUtil.getTimeUnitKey(_2);this.startDate=isc.DateUtil.getStartOf(_3,_5,false,this.firstDayOfWeek);this.endDate=isc.DateUtil.getEndOf(_4,_5,false,this.firstDayOfWeek)},isc.A.buildHeaderSpans=function isc_TimelineView_buildHeaderSpans(_1,_2,_3,_4){var _5=_3.duplicate(),c=this.calendar,_7=[],_8=[];if(_2&&_2.length>0){_8=this.getHeaderSpans(_3,_4,_2,0,_1);this.headerHeight=this.$963+(_2.length*this.headerSpanHeight)}
if(_8&&_8.length>0){this.setHeaderSpans(_8,true)}},isc.A.getHeaderSpans=function isc_TimelineView_getHeaderSpans(_1,_2,_3,_4,_5){var _6=_1.duplicate(),c=this.calendar,_8=_3[_4],_9=_8.unit,_10=isc.DateUtil.getTimeUnitKey(_9),_11=_4>0?_3[_4-1].unit:_9,_12=c.timelineUnitsPerColumn,_13=_8.titles||[],_14=[],_15=0;if(_4>0){if(isc.DateUtil.compareTimeUnits(_9,_11)>0){isc.logWarn("The order of the specified HeaderLevels is incorrect - '"+_9+"' is of a larger granularity than '"+_11+"'")}}
var _16=isc.DateUtil;var _17=this.shouldShowHeaderHovers();var _18=true;while(_6<=_2){_6=_16.dateAdd(_6,"mn",1,1);if(_18){_18=false;var _19=isc.DateUtil.getEndOf(_6,_10,false,c.firstDayOfWeek)}else{var _19=this.addUnits(_6.duplicate(),_12,_9)}
var _20={unit:_9,hoverDelay:this.hoverDelay+1,hoverMoveWithMouse:true,canHover:_17,showHover:_17,canFocus:false,headerLevel:_8,getHoverHTML:function(){var _21=this.creator;return _21.calendar.$140e(_21,this.headerLevel,this,this.startDate,this.endDate)}};_20.startDate=_6.duplicate();_20.endDate=_19.duplicate();this.setSpanDates(_20,_6.duplicate());_19=_20.endDate;var _22=this.getHeaderLevelTitle(_8,_15,_6,_19);_20.title=_22;_20.fields=[];for(var i=0;i<_5.length;i++){var _24=_5[i];if(_24.isLaneField||_24.date<_20.startDate)continue;if(_24.date>=_20.endDate)break;_24.headerLevel=_3[_4];_20.fields.add(_24.name)}
if(_4<_3.length-1){_20.spans=this.getHeaderSpans(_20.startDate,_20.endDate,_3,_4+1,_5);if(_20.spans&&_20.spans.length>0)_20.fields=null;if(_8.titles&&_8.titles.length!=_20.spans.length){isc.logWarn("The titles array provided for the "+_8.unit+" levelHeader has a length mismatch: expected "+_20.spans.length+" but "+_8.titles.length+" are present.  Some titles  may be auto-generated according to TimeUnit.")}}
_14.add(isc.clone(_20));_6=_19.duplicate();_15++}
return _14},isc.A.getHeaderLevelTitle=function isc_TimelineView_getHeaderLevelTitle(_1,_2,_3,_4){var _5=_1.unit,_6=_1.titles?_1.titles[_2]:null;if(!_6){if(_5=="century"||_5=="decade"){_6=_3.getFullYear()+" - "+_3.getFullYear()}else if(_5=="year"){_6=_3.getFullYear()}else if(_5=="quarter"){_6=_3.getShortMonthName()+" - "+_4.getShortMonthName()}else if(_5=="month"){_6=_3.getShortMonthName()}else if(_5=="week"){var _7=isc.DateUtil.getStartOf(_3,"W",false,this.calendar.firstDayOfWeek);_7.setDate(_7.getDate()+(_7.firstWeekIncludesDay-this.calendar.firstDayOfWeek));_6=this.calendar.weekPrefix+" "+_7.getWeek(this.calendar.firstDayOfWeek)}else if(_5=="day"){_6=_3.getShortDayName()}else{if(_5=="hour")_6=_3.getHours();if(_5=="minute")_6=_3.getMinutes();if(_5=="second")_6=_3.getSeconds();if(_5=="millisecond")_6=_3.getMilliseconds();if(_5=="hour")_6=_3.getHours()}
_6=""+_6;if(isc.isA.Function(_1.titleFormatter)){_6=_1.titleFormatter(_1,_3,_4,_6,this.calendar)}}
return _6},isc.A.setSpanDates=function isc_TimelineView_setSpanDates(_1,_2){var _3=isc.DateUtil.getTimeUnitKey(_1.unit);var _4=this.calendar;_1.startDate=isc.DateUtil.getStartOf(_2,_3,false,this.firstDayOfWeek);_1.endDate=isc.DateUtil.getEndOf(_1.startDate,_3,false,this.firstDayOfWeek)},isc.A.getFieldProperties=function isc_TimelineView_getFieldProperties(_1){return null},isc.A.getInnerFieldTitle=function isc_TimelineView_getInnerFieldTitle(_1,_2,_3,_4){var _5=_1.unit,_6=_1.titles?_1.titles[_2]:null;if(!_6){if(_5=="year"){_6=_3.getFullYear()}else if(_5=="month"){_6=_3.getShortMonthName()}else if(_5=="week"){var _7=isc.DateUtil.getStartOf(_3,"W",null,this.calendar.firstDayOfWeek);_7.setDate(_7.getDate()+(_7.firstWeekIncludesDay-this.calendar.firstDayOfWeek));_6=this.calendar.weekPrefix+" "+_7.getWeek(this.calendar.firstDayOfWeek)}else if(_5=="day"){var _8=isc.DateUtil.getInputFormat();if(isc.isA.String(_8)){_8=_8.replace("Y","");_8=_8.replace("D","d");_8=_8[0]+isc.DateUtil.getDefaultDateSeparator()+_8[1];_6=isc.DateUtil.format(_3,_8)}else{_6=(_3.getMonth()+1)+"/"+_3.getDate()}}else{var _9=_3.getMinutes().toString();if(_9.length==1)_9="0"+_9;_6=_3.getHours()+":"+_9}
if(isc.isA.Function(_1.titleFormatter)){_6=_1.titleFormatter(_1,_3,_4,_6,this.calendar)}}
return _6},isc.A.draw=function isc_TimelineView_draw(_1,_2,_3,_4){this.invokeSuper(isc.TimelineView,"draw",_1,_2,_3,_4);var _5=this.calendar;this.logDebug('draw','calendar');this.body.addChild(this.eventDragCanvas,null,false);this.eventDragCanvas.setView(this);if(this.$128r){delete this.$128r}
if(this.$222w){this.canGroupBy=true;this.groupByField=_5.laneGroupByField;if(_5.laneGroupStartOpen!=null)this.groupStartOpen=_5.laneGroupStartOpen;this.$236y=true;this.delayCall("groupBy",[this.groupByField],0)}
if(this.$191w){delete this.$191w;this.calendar.currentViewChanged(this.viewName)}},isc.A.groupByComplete=function isc_TimelineView_groupByComplete(){delete this.$222w;delete this.$236y;this.delayedRefreshVisibleEvents();return},isc.A.formatDateForDisplay=function isc_TimelineView_formatDateForDisplay(_1){return _1.getShortMonthName()+" "+_1.getDate()+", "+_1.getFullYear()},isc.A.getLabelColCount=function isc_TimelineView_getLabelColCount(){var _1=this.calendar,_2=1;if(_1.laneFields){_2=0;for(var i=0;i<_1.laneFields.length;i++){if(_1.laneFields[i].hidden!=true)_2++}}
return _2},isc.A.isLabelCol=function isc_TimelineView_isLabelCol(_1){var _2=this.getField(_1);return _2&&_2.frozen},isc.A.showField=function isc_TimelineView_showField(){this.Super("showField",arguments);this.refreshEvents("showField")},isc.A.hideField=function isc_TimelineView_hideField(){this.Super("hideField",arguments);this.refreshEvents("hideField")},isc.A.getLaneStyleName=function isc_TimelineView_getLaneStyleName(_1){if(_1&&_1.styleName)return _1.styleName},isc.A.getLaneFieldStyleName=function isc_TimelineView_getLaneFieldStyleName(_1,_2){if(_1&&_1.styleName)return _1.styleName;if(_2&&_2.fieldStyleName)return _2.fieldStyleName;return this.labelColumnBaseStyle},isc.A.getBaseStyle=function isc_TimelineView_getBaseStyle(_1,_2,_3){var _4=this.calendar;if(_1.$52e)return this.groupNodeBaseStyle;return this.Super("getBaseStyle",arguments)},isc.A.slideRange=function isc_TimelineView_slideRange(_1){var c=this.calendar,_3=this.timelineGranularity.toLowerCase(),_4=isc.DateUtil.getTimeUnitKey(_3),_5=this.timelineUnitsPerColumn||1,_6=this.startDate.duplicate(),_7=this.endDate.duplicate(),_8=_1?1:-1,_9=c.columnsPerPage||(this.getFields().length-this.getLabelColCount());_6=isc.DateUtil.dateAdd(_6,_4,_9*_5,_8,false,null,this.firstDayOfWeek);_6=isc.DateUtil.getStartOf(_6,_4,false,this.firstDayOfWeek);this.$2160=true;this.calendar.setChosenDate(_6);delete this.$2160},isc.A.nextOrPrev=function isc_TimelineView_nextOrPrev(_1){this.slideRange(_1)},isc.A.compareDates=function isc_TimelineView_compareDates(_1,_2,_3){if(_1.getFullYear()<_2.getFullYear()){return 1}else if(_1.getFullYear()>_2.getFullYear()){return-1}
if(_1.getMonth()<_2.getMonth()){return 1}else if(_1.getMonth()>_2.getMonth()){return-1}
if(_1.getDate()<_2.getDate()){return 1}else if(_1.getDate()>_2.getDate()){return-1}
return 0},isc.A.getDateFromPoint=function isc_TimelineView_getDateFromPoint(_1,_2,_3,_4){var _5=this.calendar;if(_1==null&&_2==null){_1=this.body.getOffsetX()}
var _6=this.getSnapData(_1,null,null,true);if(_6){if(_6.nextValidSnap){return _6.nextValidSnap[_5.startDateField].duplicate()}else if(_6.lastValidSnap){return _6.lastValidSnap[_5.endDateField].duplicate()}
return _6[_5.endDateField].duplicate()}
if(_1<0||_2<0)return null;var _7=this.body.getEventColumn(_1);if(_7==-2)_7=this.body.fields.length-1;if(_7==-1)return null;if(_4==null)_4=true;var _8=Math.max(_5.getSnapGapPixels(this),1);if(_4){var r=_1%_8;if(r)_1-=r}
var _10=this.body.fields[_7].date,_11=this.body.getColumnLeft(_7),_12=_1-_11,_13=Math.floor(_12/_8);if(_13)_10=_5.addSnapGapsToDate(_10.duplicate(),this,_13);return _10},isc.A.$732=function isc_TimelineView__getEventBreadth(_1,_2){var _3=_1&&_1["_"+this.viewName];if(_3){if(_2&&_3.exactBreadth)return _3.exactBreadth;if(!_2&&_3.snapBreadth)return _3.snapBreadth}
var _4=this.calendar,_5=_4.getEventStartDate(_1),_6=_4.getEventEndDate(_1),_7=_4.getVisibleStartDate(this),_8=_4.getVisibleEndDate(this);if(_5.getTime()<_7.getTime())_5=_7;if(_6.getTime()>_8.getTime())_6=_8;var _9=this.getDateLeftOffset(_5,null,_2),_10=this.getDateRightOffset(_6,_2),_11=_10-_9;if(_3){if(_2)_3.exactBreadth=_11;else _3.snapBreadth=_11}
return _11},isc.A.getDateRightOffset=function isc_TimelineView_getDateRightOffset(_1,_2){if(!_1)return 0;var _3=this.getSnapData(null,null,_1,true);var _4=0;if(_3){if(_3.lastValidSnap){_4=_3.lastValidSnap.endLeftOffset}else _4=_3.endLeftOffset}
return _4},isc.A.getDateLeftOffset=function isc_TimelineView_getDateLeftOffset(_1,_2,_3){if(!_1)return 0;var _4=this.getSnapData(null,null,_1,true);if(_4){if(_4.nextValidSnap){return _4.nextValidSnap.startLeftOffset}else if(_4.lastValidSnap){return _4.lastValidSnap.endLeftOffset}
return _4.startLeftOffset}
var _5=this.calendar.getVisibleStartDate(this).getTime();var _6=this.calendar.getVisibleEndDate(this).getTime();var _7=isc.isA.Number(_1)?_1:_1.getTime();if(_7<=_5)_7=_5+1;if(_7>=_6)_7=_6;var _8=this.calendar,_9=_8.getSnapGapPixels(this),_10=_8.getSnapGapMinutes(this);var _11=this.body.fields,_12=_11.getLength(),_13=Math.floor(_7/60000),_14=this.body.getColumnWidth(0),_15=this.getTimePerCell("mn");for(var i=0;i<_12;i++){var _17=_11[i];var _18=_17.date.getTime(),_19=_17.endDate.getTime(),_20=Math.floor(_17.date.getTime()/60000),_21=Math.floor(_17.endDate.getTime()/60000);if(_13==_21){return this.body.getColumnLeft(i)+_14}else if(_13<_21){if(_13==_20){return this.body.getColumnLeft(i)}else if(_13>_20){var _22=(_14*i),_23=_13-_20,_24=Math.floor(_23/_10),_25=_23%_10;if(_2){if(_25>0||_23<_10)_24++}
var _26=_22+Math.round((_24*_9));if(_3)_26+=Math.round(_8.getMinutePixels(_25,null,this));return _26}else{return(_14*i)}}}
return-1},isc.A.getEventLeft=function isc_TimelineView_getEventLeft(_1){return this.getDateLeftOffset(this.calendar.getEventStartDate(_1))},isc.A.getEventRight=function isc_TimelineView_getEventRight(_1){return this.getDateRightOffset(this.calendar.getEventEndDate(_1))},isc.A.getLaneHeight=function isc_TimelineView_getLaneHeight(_1){var _2=isc.isA.String(_1)?_1:(isc.isAn.Object(_1)?_1.name:null);var _3=(_1&&_1.height)||this.cellHeight;if(!_2){if(isc.isA.Number(_1))_1=this.getRecord(_1);if(_1){_2=_1.name;if(_1.height!=null)_3=_1.height;_1=null}}
var _4=this.laneHeightCache[_2];if(_4==null){this.laneHeightCache[_2]=_3}
return this.laneHeightCache[_2]},isc.A.getSublaneHeight=function isc_TimelineView_getSublaneHeight(_1,_2){if(!isc.isAn.Object(_1)){if(!_2||!_2.sublanes)return null;if(isc.isA.Number(_1))_1=_2.sublanes[_1];else if(isc.isA.String(_1)){_1=_2.sublanes.find(this.calendar.laneNameField,_1)}}
return _1?_1.height:null},isc.A.getEditDialogPosition=function isc_TimelineView_getEditDialogPosition(_1){var _2=this.calendar,_3=this.getColFromDate(_2.getEventStartDate(_1),_1[_2.laneNameField]),_4=this.getEventLaneIndex(_1),_5=this.body.getCellPageRect(_4,_3);return{left:Math.max(_5[0],this.body.getPageLeft()),top:Math.max(_5[1],this.body.getPageTop())}});isc.B._maxIndex=isc.C+81;isc.A=isc.DaySchedule;isc.B=isc._allFuncs;isc.C=isc.B._maxIndex;isc.D=isc._funcClasses;isc.D[isc.C]=isc.A.Class;isc.B.push(isc.A.$126v=function isc_c_DaySchedule__getEventScaffolding(_1){var _2=_1.getTimePerCell(),_3=(60/_2)*24,_4=[],_5={label:"",day1:"",day2:"",day3:"",day4:"",day5:"",day6:"",day7:""};isc.DaySchedule.$129g(_1);var _6=_1.logicalDate.duplicate(),_7=isc.DateUtil.createLogicalTime(0,0,0);for(var i=0;i<_3;i++){var _9=isc.DateUtil.combineLogicalDateAndTime(_6,_7);var _10=_4.add(isc.addProperties({},_5));_10.time=_9.duplicate();_10.logicalTime=_7.duplicate();_10.logicalDate=_6.duplicate();_7.setMinutes(_7.getMinutes()+_2)}
return _4},isc.A.$129g=function isc_c_DaySchedule__getCellDates(_1){var _2=_1.startDate||new Date();var _3=_1.getTimePerCell(),_4=(60/_3)*24,_5=_1.isDayView()?1:7,_6=[];var _7=_1.logicalDate.duplicate();var _8=isc.DateUtil.createDatetime(_7.getFullYear(),_7.getMonth(),_7.getDate(),0,0,0,0);_1.$142y=null;for(var j=0;j<_5;j++){var _10=_8.duplicate();for(var i=0;i<_4;i++){if(j==_5-1&&i==_4)break;if(!_6[i])_6[i]={};_6[i]["day"+(j+1)]=_10.duplicate();_6[i].logicalTime=isc.DateUtil.getLogicalTimeOnly(_10);var _12=_3*(i+1);var _13=isc.DateUtil.dateAdd(_8,"mn",_12,1);var _14=isc.DateUtil.getLogicalTimeOnly(_13,true);_14.setTime(_14.getTime()+(_12*60000));_6[i]["day"+(j+1)+"_end"]=isc.DateUtil.dateAdd(_13,"ms",-1);_6[i].logicalEndTime=isc.DateUtil.getLogicalTimeOnly(_6[i]["day"+(j+1)+"_end"]);var _15=_10.getDate(),_16=_13.getDate(),_17=_14.getHours(),_18=_14.getMinutes(),_19=isc.Date.getLogicalTimeOnly(_13,true),_20=_19.getHours(),_21=_19.getMinutes();_1.calendar.ignoreDST=true;if(_1.calendar.ignoreDST){_10=_13.duplicate()}else{if(_17!=_20||_18!=_21){if(!_1.$142y)_1.$142y=[];_1.$142y.add({rowNum:i+1,colNum:j})}else{_10=_13.duplicate()}}
_6[i]["day"+(j+1)+"$220o"]=_7.duplicate()}
_8=isc.DateUtil.dateAdd(_8,"d",1);_7=isc.DateUtil.dateAdd(_7,"d",1)}
_1.$129f=_6;return _6});isc.B._maxIndex=isc.C+2;isc.ClassFactory.defineClass("Calendar","Canvas","DataBoundComponent");isc.A=isc.Calendar.getPrototype();isc.B=isc._allFuncs;isc.C=isc.B._maxIndex;isc.D=isc._funcClasses;isc.D[isc.C]=isc.A.Class;isc.A.defaultWidth="100%";isc.A.defaultHeight="100%";isc.A.overflow="hidden";isc.A.year=new Date().getFullYear();isc.A.month=new Date().getMonth();isc.A.baseStyle="calendar";isc.A.dayHeaderBaseStyle="calMonthDayHeader";isc.A.dayBodyBaseStyle="calMonthDayBody";isc.A.otherDayHeaderBaseStyle="calMonthOtherDayHeader";isc.A.otherDayBodyBaseStyle="calMonthOtherDayBody";isc.A.otherDayBlankStyle="calMonthOtherDayBlank";isc.A.minimumDayHeight=80;isc.A.showDayView=true;isc.A.showWeekView=true;isc.A.showMonthView=true;isc.A.selectedCellStyle="calendarCellSelected";isc.A.eventStyleName="eventWindow";isc.A.calMonthEventLinkStyle="calMonthEventLink";isc.A.workdayBaseStyle="calendarWorkday";isc.A.workdayStart="9:00am";isc.A.workdayEnd="5:00pm";isc.A.showWorkday=false;isc.A.workdays=[1,2,3,4,5];isc.A.scrollToWorkday=false;isc.A.minutesPerRow=30;isc.A.rowTitleFrequency=60;isc.A.nameField="name";isc.A.descriptionField="description";isc.A.startDateField="startDate";isc.A.endDateField="endDate";isc.A.durationField="duration";isc.A.durationUnitField="durationUnit";isc.A.laneNameField="lane";isc.A.sublaneNameField="sublane";isc.A.leadingDateField="leadingDate";isc.A.trailingDateField="trailingDate";isc.A.labelColumnWidth=60;isc.A.showLabelColumn=true;isc.A.eventWindowStyleField="eventWindowStyle";isc.A.eventStyleNameField="styleName";isc.A.canEditField="canEdit";isc.A.canEditLaneField="canEditLane";isc.A.canEditSublaneField="canEditSublane";isc.A.canRemoveField="canRemove";isc.A.canDragEventField="canDrag";isc.A.canResizeEventField="canResize";isc.A.durationUnitOptions=["minute","hour","day","week"];isc.A.laneEventPadding=0;isc.A.eventDragGap=10;isc.A.weekEventBorderOverlap=false;isc.A.showQuickEventDialog=true;isc.A.canCreateEvents=true;isc.A.canEditEvents=true;isc.A.canRemoveEvents=true;isc.A.canDragEvents=null;isc.A.canResizeEvents=true;isc.A.showDateChooser=false;isc.A.disableWeekends=true;isc.A.showWeekends=true;isc.A.showDayHeaders=true;isc.A.showOtherDays=true;isc.A.selectChosenDate=true;isc.A.eventAutoArrange=true;isc.A.eventOverlap=true;isc.A.eventOverlapPercent=10;isc.A.minimalUI=null;isc.A.canDragCreateEvents=null;isc.A.alternateLaneFrequency=1;isc.A.showTimelineView=false;isc.A.renderEventsOnDemand=true;isc.A.timelineGranularity="day";isc.A.timelineUnitsPerColumn=1;isc.A.canResizeTimelineEvents=false;isc.A.defaultTimelineColumnSpan=20;isc.A.weekPrefix="Week";isc.A.hoverDelay=0;isc.A.laneGroupStartOpen="first";isc.A.showEventDescriptions=true;isc.A.showEventHeaders=true;isc.A.eventHeaderWrap=true;isc.A.eventHeaderHeight=14;isc.A.allowEventOverlap=true;isc.A.sizeEventsToGrid=true;isc.A.dayViewTitle="Day";isc.A.weekViewTitle="Week";isc.A.monthViewTitle="Month";isc.A.timelineViewTitle="Timeline";isc.A.eventNameFieldTitle="Event Name";isc.A.eventStartDateFieldTitle="From";isc.A.eventEndDateFieldTitle="To";isc.A.eventDescriptionFieldTitle="Description";isc.A.eventLaneFieldTitle="Lane";isc.A.eventSublaneFieldTitle="Sublane";isc.A.eventDurationFieldTitle="Duration";isc.A.eventDurationUnitFieldTitle="&nbsp;";isc.A.saveButtonTitle="Save Event";isc.A.detailsButtonTitle="Edit Details";isc.A.removeButtonTitle="Remove Event";isc.A.cancelButtonTitle="Cancel";isc.A.monthButtonTitle="&lt; ${monthName}";isc.A.monthMoreEventsLinkTitle="+ ${eventCount} more...";isc.A.backButtonTitle="Back";isc.A.previousButtonHoverText="Previous";isc.A.nextButtonHoverText="Next";isc.A.addEventButtonHoverText="Add an event";isc.A.datePickerHoverText="Choose a date";isc.A.invalidDateMessage="From must be before To";isc.A.dayViewConstructor="DaySchedule";isc.A.weekViewConstructor="WeekSchedule";isc.A.monthViewConstructor="MonthSchedule";isc.A.timelineViewConstructor="TimelineView";isc.A.mainViewDefaults={_constructor:isc.TabSet,defaultWidth:"80%",defaultHeight:"100%",tabBarAlign:"right",selectedTab:1};isc.A.dateChooserConstructor="DateChooser";isc.A.dateChooserDefaults={left:0,top:-9999,autoDraw:false,visibility:"hidden",autoHide:true,showCancelButton:true,closeOnEscapeKeypress:true};isc.A.eventDialogConstructor="Window";isc.A.eventDialogDefaults={showHeaderIcon:false,showMinimizeButton:false,showMaximumButton:false,canDragReposition:true,overflow:"visible",bodyProperties:{overflow:"visible"},keepInParentRect:true,maxWidth:400,height:100,visibility:"hidden",autoDraw:false};isc.A.eventEditorLayoutConstructor="Window";isc.A.eventEditorLayoutDefaults={showHeaderIcon:false,showShadow:false,showMinimizeButton:false,showMaximumButton:false,canDragReposition:false,visibility:"hidden",autoDraw:false};isc.A.eventEditorConstructor="DynamicForm";isc.A.eventEditorDefaults={padding:4,numCols:5,colWidths:[80,40,40,"*","*"],showInlineErrors:false,width:460,titleWidth:80,wrapItemTitles:false,autoDraw:false};isc.A.eventEditorButtonLayoutConstructor="HLayout";isc.A.eventEditorButtonLayoutDefaults={width:"100%",height:"100%",membersMargin:5,layoutMargin:10};isc.A.saveButtonConstructor="IButton";isc.A.saveButtonDefaults={autoFit:true,click:function(){this.calendar.addEventOrUpdateEventFields()}};isc.A.removeButtonConstructor="IButton";isc.A.removeButtonDefaults={autoFit:true,click:function(){var _1=this.calendar;if(_1.eventRemoveClick(_1.eventEditorLayout.event,_1.getCurrentViewName())!=false){_1.removeEvent(_1.eventEditorLayout.event)}
_1.eventEditorLayout.hide()}};isc.A.cancelButtonConstructor="IButton";isc.A.cancelButtonDefaults={autoFit:true,click:function(){this.calendar.eventEditorLayout.hide()}};isc.A.addEventButtonConstructor="ImgButton";isc.A.addEventButtonDefaults={title:"",src:"[SKINIMG]actions/add.png",showRollOver:false,showDown:false,showFocused:false,autoDraw:false,width:16,height:16};isc.A.datePickerButtonConstructor="ImgButton";isc.A.datePickerButtonDefaults={title:"",src:"[SKIN]/controls/date_control.gif",width:16,height:16,showRollOver:false,showFocused:false,autoDraw:false};isc.A.showControlsBar=true;isc.A.controlsBarConstructor="HLayout";isc.A.controlsBarDefaults={defaultLayoutAlign:"center",layoutAlign:"center",width:1,height:1,overflow:"visible",autoDraw:false,layoutMargin:5,membersMargin:5};isc.A.monthButtonConstructor="NavigationButton";isc.A.monthButtonDefaults={click:function(){var _1=this.creator,_2=_1.getCurrentViewName();if(_2!="month"){this.previousViewName=_2;this.creator.setCurrentViewName("month");_1.updateMonthButton()}else{this.creator.setCurrentViewName(this.previousViewName);delete this.previousViewName;_1.updateMonthButton()}}};isc.A.previousButtonConstructor="ImgButton";isc.A.previousButtonDefaults={title:"",src:"[SKINIMG]actions/back.png",showFocused:false,width:16,height:16,click:function(){this.creator.previous()},showRollOver:false,showDown:false};isc.A.nextButtonConstructor="ImgButton";isc.A.nextButtonDefaults={title:"",src:"[SKINIMG]actions/forward.png",showFocused:false,width:16,height:16,click:function(){this.creator.next()},showRollOver:false,showDown:false};isc.A.dateLabelConstructor="Label";isc.A.dateLabelDefaults={wrap:false,width:5,contents:"-"};isc.A.DAY="day";isc.A.WEEK="week";isc.A.MONTH="month";isc.A.TIMELINE="timeline";isc.A.rowHeight=isc.ListGrid.getInstanceProperty("cellHeight");isc.A.$1716=null;isc.A.zeroLengthEventSize=2;isc.A.$1290="mn";isc.A.dateFormatter=null;isc.A.timeFormatter=null;isc.A.alwaysShowEventHovers=false;isc.A.showIndicatorsInFront=true;isc.A.showCellHovers=false;isc.A.showHeaderHovers=false;isc.A.showViewHovers=true;isc.A.showEventHovers=true;isc.A.showZoneHovers=true;isc.A.showLaneFieldHovers=false;isc.A.showDragHovers=false;isc.A.eventCanvasConstructor="EventCanvas";isc.A.eventCanvasDefaults={autoDraw:false,visibility:"hidden",_redrawWithParent:false};isc.A.eventCanvasContextMenuConstructor="Menu";isc.A.eventCanvasContextMenuStyle="eventWindowContextMenu";isc.A.eventCanvasContextMenuDefaults={};isc.A.useEventCanvasRolloverControls=true;isc.A.eventCanvasGripperConstructor="Img";isc.A.eventCanvasGripperDefaults={width:11,height:10,padding:0,margin:0,overflow:"visible",imageType:"center",autoDraw:false,visibility:"hidden",showDown:false,showOver:false,showRollOver:false,canDrag:true,layoutAlign:"center",cursor:isc.Canvas.MOVE};isc.A.eventCanvasGripperIcon="[SKIN]/Calendar/gripper.png";isc.A.eventCanvasLabelConstructor="Label";isc.A.eventCanvasLabelDefaults={height:1,width:1,autoSize:true,wrap:false,overflow:"visible",autoDraw:false,visibility:"hidden",padding:2,minWidth:40,maxWidth:150,showOver:false,showDown:false,showRollOver:true,layoutAlign:"center",click:function(){},isEventCanvasLabel:true};isc.A.eventCanvasButtonLayoutConstructor="HLayout";isc.A.eventCanvasButtonLayoutDefaults={width:1,height:1,overflow:"visible",autoDraw:false,snapTo:"TR",membersMargin:1,layoutTopMargin:3,layoutRightMargin:3,mouseOver:function(){return isc.EH.STOP_BUBBLING}};isc.A.eventCanvasCloseButtonConstructor="ImgButton";isc.A.eventCanvasCloseButtonDefaults={width:11,height:10,autoDraw:false,showDown:false,showRollOver:true,layoutAlign:"center",src:"[SKIN]/headerIcons/close.png",baseStyle:"eventCanvasCloseButton",click:function(){var _1=this.eventCanvas;this.creator.$174b(_1);return false}};isc.A.eventCanvasContextButtonConstructor="ImgButton";isc.A.eventCanvasContextButtonDefaults={width:11,height:10,autoDraw:false,showDown:false,showRollOver:true,layoutAlign:"left",src:"[SKIN]/headerIcons/arrow_down.png",click:function(){this.creator.$1700(this.eventCanvas);return false}};isc.A.eventCanvasVResizerConstructor="Img";isc.A.eventCanvasVResizerDefaults={width:12,height:6,overflow:"hidden",src:"[SKIN]/Window/v_resizer.png",autoDraw:false,cursor:isc.Canvas.ROW_RESIZE,canDragResize:true};isc.A.eventCanvasHResizerConstructor="Img";isc.A.eventCanvasHResizerDefaults={width:6,height:12,overflow:"hidden",src:"[SKIN]/Window/h_resizer.png",autoDraw:false,cursor:isc.Canvas.COL_RESIZE,canDragResize:true};isc.A.zoneStyleName="zoneCanvas";isc.A.zoneCanvasConstructor="ZoneCanvas";isc.A.zoneTitleOrientation="bottom";isc.A.indicatorStyleName="indicatorCanvas";isc.A.indicatorCanvasConstructor="IndicatorCanvas";isc.A.eventsOverlapGridLines=true;isc.A.includeRangeCriteria=false;isc.A.newEventWindowTitle="New Event";isc.A.monthMoreEventsMenuConstructor="Menu";isc.A.monthMoreEventsMenuDefaults={autoDraw:false,visibility:"hidden",keepInParentRect:true};isc.B.push(isc.A.getMinutesPerRow=function isc_Calendar_getMinutesPerRow(_1){_1=_1||this.getSelectedView();if(_1&&_1.verticalEvents)return _1.getTimePerCell("mn");return null},isc.A.getMinutesPerCol=function isc_Calendar_getMinutesPerCol(_1){_1=_1||this.getSelectedView();if(_1&&!_1.verticalEvents)return _1.getTimePerCell("mn");return null},isc.A.getSnapGapMinutes=function isc_Calendar_getSnapGapMinutes(_1,_2,_3){_1=_1||this.getSelectedView();if(_1)return _1.getTimePerSnapGap("mn")},isc.A.getSnapGapPixels=function isc_Calendar_getSnapGapPixels(_1,_2,_3){_1=_1||this.getSelectedView();if(_1.$171x||_1.$27q.snapGapPixels==null||isNaN(_1.$27q.snapGapPixels)){if(_2==null)_2=0;if(_3==null)_3=0;var _4=_1&&_1.verticalEvents==false,_5=this.getSnapGapMinutes(_1,_2,_3),_6=_1.getTimePerCell(),_7;if(_1&&_1.body){_7=_4?_1.body.getColumnWidth(_3):_1.getRowHeight(_1.getRecord(_2),_2)}else{if(_4){var _8=_1&&_1.fieldHeaderLevel;_7=(_8&&_8.headerWidth)||(_1&&_1.columnWidth)}else _7=this.rowHeight}
var _9=_7/((_6/_5));delete _1.$171x;_1.$27q.snapGapPixels=Math.max(_9,1)}
return _1.$27q.snapGapPixels},isc.A.addSnapGapsToDate=function isc_Calendar_addSnapGapsToDate(_1,_2,_3){if(!_1)return null;if(_3==0)return _1.duplicate();_2=_2||this.getSelectedView();if(_3==null)_3=1;var _4=this.getSnapGapMinutes(_2),_5=(_4*_3)*60000,_6=_1.duplicate();if(_4==1440)_6.setDate(_6.getDate()+_3);else _6.setTime(_6.getTime()+_5);return _6},isc.A.getRowsPerHour=function isc_Calendar_getRowsPerHour(_1){return Math.floor(60/_1.getTimePerCell("mn"))},isc.A.getRowFromDate=function isc_Calendar_getRowFromDate(_1,_2){var _3=_1.getTimePerCell("mn"),_4=this.getRowsPerHour(_1),_5=Math.floor(_2.getMinutes()/_3),_6=(_2.getMinutes()%_3==0?0:1),_7=(_2.getHours()*_4)+_5+_6;return _7},isc.A.getMinutePixels=function isc_Calendar_getMinutePixels(_1,_2,_3){_3=_3||this.getSelectedView();if(_3.isTimelineView()){var _4=_3.getTimePerCell()/_3.columnWidth;return Math.round(_1/_4)}else if(_3.isDayView()||_3.isWeekView()){var _5=(_2!=null?_2:_3.getRowHeight(_3.getRecord(0),0))*
this.getRowsPerHour(_3);return Math.round((_5/60)*_1)}},isc.A.scrollToTime=function isc_Calendar_scrollToTime(_1,_2){if(!this.isDrawn()){this.$187g=_1;return}
_2=_2||this.getSelectedView();_1=isc.Time.parseInput(_1);if(isc.isA.Date(_1)){var _3=this.getRowFromDate(_2,_1);var _4=_2.getRowHeight(_2.getRecord(0),0)*_3;_2.body.scrollTo(0,_4);_2.redraw()}},isc.A.scrollToStart=function isc_Calendar_scrollToStart(_1){_1=_1||this.getSelectedView();if(_1)_1.scrollToStart()},isc.A.scrollToEnd=function isc_Calendar_scrollToEnd(_1){_1=_1||this.getSelectedView();if(_1)_1.scrollToEnd()},isc.A.moveToEvent=function isc_Calendar_moveToEvent(_1,_2){_2=_2||this.getSelectedView();this.setChosenDate(this.getEventStartDate(_1))},isc.A.scrollToEvent=function isc_Calendar_scrollToEvent(_1,_2,_3){_3=_3||this.getSelectedView();if(_2!=false&&!_3.canScrollToEvent(_1)){_3.$222f=_1;this.setChosenDate(this.getEventStartDate(_1));return}
_3.scrollToEvent(_1)},isc.A.setHideUnusedLanes=function isc_Calendar_setHideUnusedLanes(_1){this.hideUnusedLanes=_1;if(this.dayView&&this.showDayLanes)this.dayView.refreshEvents("setHideUnusedLanes");if(this.timelineView)this.timelineView.refreshEvents("setHideUnusedLanes")},isc.A.getDurationUnitMap=function isc_Calendar_getDurationUnitMap(){var _1=this.durationUnitOptions,_2=isc.DateUtil,_3={};for(var i=0;i<_1.length;i++){_3[_2.getTimeUnitKey(_1[i])]=_2.getTimeUnitTitle(_1[i])+"s"}
return _3},isc.A.setHeaderLevels=function isc_Calendar_setHeaderLevels(_1){this.headerLevels=_1;if(this.timelineView)this.timelineView.rebuild(true)},isc.A.dateIsWeekend=function isc_Calendar_dateIsWeekend(_1){var _2=isc.DateUtil.getLogicalDateOnly(_1);return this.getWeekendDays().contains(_2.getDay())},isc.A.getWeekendDays=function isc_Calendar_getWeekendDays(){return this.weekendDays},isc.A.shouldDisableDate=function isc_Calendar_shouldDisableDate(_1,_2,_3){if(!_1)return false;if(!this.disableWeekends||_3)return false;_2=_2||this.getSelectedView();var _4=isc.DateUtil.getLogicalDateOnly(_1);if(this.dateIsWeekend(_4))return true;return false},isc.A.shouldShowDate=function isc_Calendar_shouldShowDate(_1,_2){_2=_2||this.getSelectedView();if(_2.isTimelineView()){if(!this.showWeekends&&this.dateIsWeekend(_1))return false}
return true},isc.A.shouldShowLane=function isc_Calendar_shouldShowLane(_1,_2){_2=_2||this.getSelectedView();if(this.hideUnusedLanes&&!this.laneHasVisibleEvents(_1)){return false}
return true},isc.A.shouldShowEvent=function isc_Calendar_shouldShowEvent(_1,_2){return true},isc.A.getWorkdayStart=function isc_Calendar_getWorkdayStart(_1,_2){return this.workdayStart},isc.A.getWorkdayEnd=function isc_Calendar_getWorkdayEnd(_1,_2){return this.workdayEnd},isc.A.getVisibleStartDate=function isc_Calendar_getVisibleStartDate(_1){_1=_1||this.getSelectedView();if(!_1||isc.isAn.emptyString(_1))return null;if(_1.isMonthView()||(_1.body&&_1.bodies.length>1))return _1.getCellDate(0,0);return _1.startDate},isc.A.getVisibleEndDate=function isc_Calendar_getVisibleEndDate(_1){_1=_1||this.getSelectedView();if(!_1||isc.isAn.emptyString(_1))return null;if(!_1.body||(_1.bodies.length==1&&!_1.isMonthView()))return _1.endDate;var _2=_1.getData().length-1,_3=_1.body.fields.length-1;if(_1.getCellEndDate)return _1.getCellEndDate(_2,_3);return _1.getCellDate(_2,_3)},isc.A.getPeriodStartDate=function isc_Calendar_getPeriodStartDate(_1){_1=_1||this.getSelectedView();if(_1)return _1.getPeriodStartDate()},isc.A.getPeriodEndDate=function isc_Calendar_getPeriodEndDate(_1){_1=_1||this.getSelectedView();if(_1)return _1.getPeriodEndDate()},isc.A.groupLanesBy=function isc_Calendar_groupLanesBy(_1){if(this.timelineView){this.timelineView.groupBy(_1)}},isc.A.setLanes=function isc_Calendar_setLanes(_1,_2){if(!_1){return}
this.checkLaneNames(_1);this.lanes=_1;if(this.timelineView){this.timelineView.setLanes(this.lanes,_2)}
if(this.showDayLanes&&this.dayView){this.dayView.setLanes(this.lanes,_2)}},isc.A.checkLaneNames=function isc_Calendar_checkLaneNames(_1){if(!_1||_1.length==0)return;var _2=this;if(_2.laneNameField&&_2.laneNameField!="name"){_1.map(function(_3){if(!_3.name&&_3[_2.laneNameField]){_2.logInfo("No lane.name provided - mapping to laneNameField ("+_2.laneNameField+") - lane.name is now '"+_3[_2.laneNameField]+"'");_3.name=_3[_2.laneNameField]}})}},isc.A.addLane=function isc_Calendar_addLane(_1,_2){var _3;if(this.timelineViewSelected()){_3=this.timelineView}
else if(this.dayViewSelected()&&this.showDayLanes){_3=this.dayView}
if(!_3){return}
if(!this.lanes)this.lanes=[];if(_2==null)_2=this.lanes.length;this.lanes.add(_1,_2);_3.setLanes(this.lanes)},isc.A.removeLane=function isc_Calendar_removeLane(_1){var _2;if(this.timelineViewSelected())_2=this.timelineView;else if(this.dayViewSelected()&&this.showDayLanes)_2=this.dayView;if(!_2||!this.lanes)return;if(isc.isA.String(_1))_1=this.lanes.find("name",_1);else if(isc.isAn.Object(_1))_1=this.lanes.find("name",_1.name);if(_1){this.lanes.remove(_1);_2.setLanes(this.lanes)}},isc.A.setShowDayLanes=function isc_Calendar_setShowDayLanes(_1){if(this.showDayLanes==_1)return;this.showDayLanes=_1;if(this.dayView){this.dayView.$123r=this.dayView.body.getScrollTop();this.dayView.rebuildFields();if(this.dayViewSelected()){this.dayView.refreshEvents("setShowDayLanes")}else{this.dayView.$123s=true}}},isc.A.initWidget=function isc_Calendar_initWidget(){if(this.startDate&&this.endDate&&this.endDate.getTime()<this.startDate.getTime()){this.logWarn("endDate ("+this.endDate+") is before startDate ("+this.startDate+") - switching values");var _1=this.startDate.duplicate();this.startDate=this.endDate.duplicate();this.endDate=_1}
if(!this.chosenDate){if(this.startDate)this.chosenDate=this.startDate.duplicate();else this.chosenDate=new Date()}
var _2=isc.Calendar.$1833(this.chosenDate);this.year=_2.getFullYear();this.month=_2.getMonth();this.displayDate=_2.getDate();if(this.twentyFourHourTime==null){this.twentyFourHourTime=isc.Time.use24HourTime}else{if(!this.timeFormatter){this.timeFormatter=this.twentyFourHourTime?"toShortPadded24HourTime":"toShortPaddedTime"}}
if(this.firstDayOfWeek==null)
this.firstDayOfWeek=Number(isc.DateChooser.getInstanceProperty("firstDayOfWeek"));if(!this.weekendDays)this.weekendDays=isc.DateUtil.getWeekendDays();if(this.laneGroupByField&&!isc.isAn.Array(this.laneGroupByField)){this.laneGroupByField=[this.laneGroupByField]}
if(this.showTimelineView){if(this.endDate){this.timelineColumnSpan=Math.round(isc.DateUtil.getPeriodLength(this.startDate,this.endDate,this.timelineGranularity)/this.timelineUnitsPerColumn)}else{if(!this.timelineColumnSpan)this.timelineColumnSpan=this.defaultTimelineColumnSpan}}
if(this.timelineSnapGap!=null){this.snapGap=this.timelineSnapGap;delete this.timelineSnapGap}
if(this.timelineStartDate!=null){this.startDate=this.timelineStartDate.duplicate();delete this.timelineStartDate}
if(this.timelineEndDate!=null){this.endDate=this.timelineEndDate.duplicate();delete this.timelineEndDate}
if(this.timelineLabelFields!=null){this.laneFields=this.timelineLabelFields;this.timelineLabelFields=null}
if(this.eventTypeData!=null){this.lanes=isc.clone(this.eventTypeData);this.eventTypeData=null}
if(this.eventTypeField!=null){this.laneNameField=this.eventTypeField;delete this.eventTypeField}
if(this.showDescription!=null){this.showEventDescriptions=this.showDescription;delete this.showDescription}
if(this.canEditEventType!=null){this.canEditLane=this.canEditEventType;delete this.canEditEventType}
if(this.canDeleteEvents!=null){this.canRemoveEvents=this.canDeleteEvents;delete this.canDeleteEvents}
var _3=isc.Browser.isTouch?true:false;if(this.canDragCreateEvents==null)this.canDragCreateEvents=!_3;if(this.canDragEvents==null)this.canDragEvents=!_3;if(this.minimalUI==null)this.minimalUI=isc.Browser.isHandset;if(this.minimalUI){this.mainViewDefaults.showTabBar=false;var _4=this;this.orientationEventId=isc.Page.setEvent("orientationChange",function(){_4.pageOrientationChanged()})}
if(this.eventWindowDefaults!=null){this.eventCanvasDefaults=isc.addProperties({},this.eventWindowDefaults,this.eventCanvasDefaults);delete this.eventWindowDefaults}
if(this.eventWindowProperties!=null){this.eventCanvasProperties=isc.addProperties({},this.eventWindowProperties,this.eventCanvasProperties);delete this.eventWindowProperties}
if(this.overlapSortSpecifiers&&!isc.isAn.Array(this.overlapSortSpecifiers)){this.overlapSortSpecifiers=[this.overlapSortSpecifiers]}
if(!this.data)this.data=this.getDefaultData();if(this.canSelectEvents)this.createSelectionModel();this.previousButtonDefaults.prompt=this.previousButtonHoverText;this.nextButtonDefaults.prompt=this.nextButtonHoverText;this.datePickerButtonDefaults.prompt=this.datePickerHoverText;this.addEventButtonDefaults.prompt=this.addEventButtonHoverText;if(this.dataSource)this.autoDetectFieldNames();this.invokeSuper(isc.Calendar,"initWidget");this.createChildren()},isc.A.updateMonthButton=function isc_Calendar_updateMonthButton(){if(this.getCurrentViewName()=="month"){this.monthButton.setTitle(this.backButtonTitle)}else{var _1=this.chosenDate.getMonthName();this.monthButton.setTitle(this.monthButtonTitle.evalDynamicString(this,{monthName:_1}))}},isc.A.pageOrientationChanged=function isc_Calendar_pageOrientationChanged(_1){_1=_1||isc.Page.getOrientation();if(_1=="landscape"&&this.showWeekView)this.setCurrentViewName("week");if(_1=="portrait"&&this.showDayView)this.setCurrentViewName("day")},isc.A.autoDetectFieldNames=function isc_Calendar_autoDetectFieldNames(){this.dataSource=isc.DS.getDataSource(this.dataSource);var _1=this.dataSource,_2=isc.getValues(_1.getFields()),_3=1024000,_4=null,_5;if(this.fieldIsMissing(this.nameField,_1)){this.nameField=_1.getTitleField();if(this.fieldIsMissing(this.nameField,_1)){this.logWarn("Specified field '"+this.nameField+"' is not present in the DataSource and no suitable alternative was auto-detected.")}else{this.logInfo("Specified event name field is not present in the DataSource - using DataSource.getTitleField() instead: '"+this.nameField+"'")}}
if(this.fieldIsMissing(this.descriptionField,_1)){_2.sortByProperties(["length"],[false]);_4={length:0};for(var i=0;i<_2.length;i++){_5=_2.get(i);if(!_5.type||_5.type=="text"||_5.type=="string"){if(_5.length>255&&_5.length<_3){this.descriptionField=_5.name;break}else if(_5.length&&_5.length<_3&&_5.length>_4.length){_4=_5}else if(!_5.length){if(!_4)_4=_5}}}
if(_4!=null&&this.fieldIsMissing(this.descriptionField,_1))
this.descriptionField=_4.name;if(this.fieldIsMissing(this.descriptionField,_1)){this.logWarn("Specified field '"+this.descriptionField+"' is not present in the DataSource and no suitable alternative was auto-detected.")}else{this.logInfo("Specified event description field is not present in the DataSource - using auto-detected field '"+this.descriptionField+"' instead.")}}
if(this.fieldIsMissing(this.startDateField,_1)){_4=null;for(var i=0;i<_2.length;i++){_5=_2.get(i);if((_5.type=="date"||_5.type=="datetime")){if(_5.name.toLowerCase().indexOf("start")>=0||_5.name.toLowerCase().indexOf("begin")>=0)
{this.startDateField=_5.name;break}else _4=_5}}
if(_4!=null&&this.fieldIsMissing(this.startDateField,_1))
this.startDateField=_4.name;if(this.fieldIsMissing(this.startDateField,_1)){this.logWarn("Specified field '"+this.startDateField+"' is not present in the DataSource and no suitable alternative was auto-detected.")}else{this.logInfo("Specified event startDate field is not present in the DataSource - using auto-detected field '"+this.startDateField+"' instead.")}}
if(this.fieldIsMissing(this.endDateField,_1)){_4=null;for(var i=0;i<_2.length;i++){_5=_2.get(i);if((_5.type=="date"||_5.type=="datetime")){if(_5.name.toLowerCase().indexOf("end")>=0||_5.name.toLowerCase().indexOf("stop")>=0)
{this.endDateField=_5.name;break}else if(_5.name!=this.startDateField)
_4=_5}}
if(_4!=null&&this.fieldIsMissing(this.endDateField,_1))
this.endDateField=_4.name;if(this.fieldIsMissing(this.endDateField,_1)){this.logWarn("Specified field '"+this.endDateField+"' is not present in the DataSource and no suitable alternative was auto-detected.")}else{this.logInfo("Specified event endDate field is not present in the DataSource - using auto-detected field '"+this.endDateField+"' instead.")}}
if(this.showTimelineView!=false||(this.showDayView!=false&&this.showDayLanes)){if(this.useSublanes&&this.fieldIsMissing(this.sublaneNameField,_1)){_4=null;for(var i=0;i<_2.length;i++){_5=_2.get(i);if(!_5.type||_5.type=="text"||_5.type=="string"){var _7=_5.name.toLowerCase();if(_7.contains("sublane")){this.sublaneNameField=_5.name;break}}}
if(this.fieldIsMissing(this.sublaneNameField,_1)){this.logWarn("Specified field '"+this.sublaneNameField+"' is not present in the DataSource and no suitable alternative was auto-detected.")}else{this.logInfo("Specified event sublane field is not present in the DataSource - using auto-detected field '"+this.sublaneNameField+"' instead.")}}
if(this.fieldIsMissing(this.laneNameField,_1)){_4=null;for(var i=0;i<_2.length;i++){_5=_2.get(i);if(!_5.type||_5.type=="text"||_5.type=="string"){var _7=_5.name.toLowerCase();if(_7.contains("lane")&&_7!=this.sublaneNameField){this.laneNameField=_5.name;break}}}
if(this.fieldIsMissing(this.laneNameField,_1)){this.logWarn("Specified field '"+this.laneNameField+"' is not present in the DataSource and no suitable alternative was auto-detected.")}else{this.logInfo("Specified event lane field is not present in the DataSource - using auto-detected field '"+this.laneNameField+"' instead.")}}}},isc.A.fieldIsMissing=function isc_Calendar_fieldIsMissing(_1,_2){return(!_1||_1==""||(_2&&!_2.getField(_1)))},isc.A.getDefaultData=function isc_Calendar_getDefaultData(){return[]},isc.A.setData=function isc_Calendar_setData(_1){if(this.data==_1)return;if(this.data){this.ignore(this.data,"dataChanged");if(this.data.$31k&&isc.isA.Function(this.data.destroy))
this.data.destroy()}
if(_1)this.data=_1;if(!this.data)return;this.observe(this.data,"dataChanged","observer.dataChanged(arguments)");if(this.hasData()){this.dataChanged("fetch")}},isc.A.getData=function isc_Calendar_getData(){return this.data},isc.A.hasData=function isc_Calendar_hasData(){if(!this.data||(isc.ResultSet&&isc.isA.ResultSet(this.data)&&!this.data.lengthIsKnown()))
{return false}else{return true}},isc.A.dataChanged=function isc_Calendar_dataChanged(){if(this.destroying||this.destroyed)return;if(!this.dataIsAvailable()){this.$53e=true;this.$1746=true}else{delete this.$1746}
if(this.$53e){this.logDebug('dataChanged, ignoring','calendar');this.$53e=false}else{this.logDebug('dataChanged, refreshing','calendar');delete this.$1746;this.refreshSelectedView()}},isc.A.dataIsAvailable=function isc_Calendar_dataIsAvailable(){if(isc.isAn.Array(this.data))return true;if(this.data.allMatchingRowsCached())return true;return false},isc.A.destroy=function isc_Calendar_destroy(){if(this.orientationEventId)isc.Page.clearEvent("orientationChange",this.orientationEventId);if(this.data){if(this.isObserving(this.data,"dataChanged"))this.ignore(this.data,"dataChanged");if(this.isObserving(this.data,"dataArrived"))this.ignore(this.data,"dataArrived");if(this.data.destroy)this.data.destroy();this.data=null}
if(this.controlsBar)this.controlsBar.destroy();if(this.controlsBarContainer)this.controlsBarContainer.destroy();if(this.dateChooser)this.dateChooser.destroy();if(this.eventCanvasButtonLayout)this.eventCanvasButtonLayout.destroy();if(this.mainLayout)this.mainLayout.destroy();this.Super("destroy",arguments)},isc.A.refreshSelectedView=function isc_Calendar_refreshSelectedView(){var _1=this.getSelectedView();if(!_1)return;if(!_1.isDrawn()){_1.$128r=true
return}
if(this.dayViewSelected()){this.dayView.delayedRefreshEvents("refreshSelectedView");if(this.weekView)this.weekView.$123s=true;if(this.monthView)this.monthView.$123s=true}else if(this.weekViewSelected()){this.weekView.delayedRefreshEvents("refreshSelectedView");if(this.dayView)this.dayView.$123s=true;if(this.monthView)this.monthView.$123s=true}else if(this.monthViewSelected()){this.monthView.refreshEvents("refreshSelectedView");if(this.dayView)this.dayView.$123s=true;if(this.weekView)this.weekView.$123s=true}else if(this.timelineViewSelected()){this.timelineView.delayedRefreshEvents("refreshSelectedView")}},isc.A.getSelectedView=function isc_Calendar_getSelectedView(){if(this.dayViewSelected()){return this.dayView}else if(this.weekViewSelected()){return this.weekView}else if(this.monthViewSelected()){return this.monthView}else if(this.timelineViewSelected()){return this.timelineView}},isc.A.getView=function isc_Calendar_getView(_1){if(!_1)return this.getSelectedView();if(_1=="day")return this.dayView;if(_1=="week")return this.weekView;if(_1=="month")return this.monthView;if(_1=="timeline")return this.timelineView},isc.A.setRowHeight=function isc_Calendar_setRowHeight(_1,_2){this.rowHeight=_1;if(this.dayView){this.dayView.setCellHeight(this.rowHeight);this.dayView.refreshEvents("setRowHeight");if(this.scrollToWorkday&&!_2)this.dayView.scrollToWorkdayStart()}
if(this.weekView){this.weekView.setCellHeight(this.rowHeight);this.weekView.refreshEvents("setRowHeight");if(this.scrollToWorkday&&!_2)this.weekView.scrollToWorkdayStart()}},isc.A.getCurrentViewName=function isc_Calendar_getCurrentViewName(){var _1=this.getSelectedView();return _1!=null?_1.viewName:null},isc.A.setCurrentViewName=function isc_Calendar_setCurrentViewName(_1){this.$567=_1;if(this.mainView&&this.mainView.tabs){var _2=this.mainView.tabs.findIndex("viewName",_1);if(_2!=null){this.selectTab(_2)}}
return _1},isc.A.getEventPKs=function isc_Calendar_getEventPKs(_1){if(!this.$129u){_1=_1||this.getDataSource();if(_1){this.$129u=_1.getPrimaryKeyFieldNames()}}
return this.$129u||[]},isc.A.getRandomEventKey=function isc_Calendar_getRandomEventKey(){return"_event_"+(Math.random()*100)+"_"+((Math.random()*Math.random())*100)},isc.A.getEventKey=function isc_Calendar_getEventKey(_1){if(!_1.$232p){if(!this.dataSource){_1.$232p=this.getRandomEventKey();return _1.$232p}else{var _2=this.getEventPKs().duplicate(),_3=this.$1716;if(!_3)_3=isc.StringBuffer.create();if(_2.length>0){_3.append(this.getID(),"_event_");for(var i=0;i<_2.length;i++){_3.append(_1[_2[i]]);if(i==_2.length)break}}
var _5=_3.release(false);_1.$232p=_5}}
return _1.$232p},isc.A.clearViewSelection=function isc_Calendar_clearViewSelection(_1){if(_1){if(_1.clearSelection)_1.clearSelection()}else{if(this.dayView)this.dayView.clearSelection();if(this.weekView)this.weekView.clearSelection();if(this.timelineView)this.timelineView.clearSelection()}},isc.A.getDayDiff=function isc_Calendar_getDayDiff(_1,_2,_3){return Math.abs(isc.DateUtil.$1094(_1,_2,_3,false,this.getWeekendDays()))},isc.A.getEventStartCol=function isc_Calendar_getEventStartCol(_1,_2,_3){var _4=_3||(_2?_2.calendarView:this.getSelectedView()),_5=_2||_4.getCurrentEventCanvas(_1),_6=_4.getEventColumn(_5.getLeft()+1);return _6},isc.A.getEventEndCol=function isc_Calendar_getEventEndCol(_1,_2,_3){var _4=_4||(_2?_2.calendarView:this.getSelectedView()),_5=_2||_4.getCurrentEventCanvas(_1),_6=_4.getEventColumn(_5.getLeft()+_5.getVisibleWidth()+1);return _6},isc.A.getEventLeft=function isc_Calendar_getEventLeft(_1,_2){_2=_2||this.getSelectedView();if(_2.getEventLeft)return _2.getEventLeft(_1);var _3=_2.body.getColumnWidth(0),_4=0;if(_2.isWeekView()){var _4=_2.getColumnLeft(_2.getColFromDate(this.getEventStartDate(_1)))}else if(this.showDayLanes){var _5=_2.completeFields.findIndex("name",_1[this.laneNameField]);if(_5){_4=_2.body.getColumnLeft(_5)}}else{var _5=_2.getColFromDate(this.getEventStartDate(_1));if(_5){_4=_2.body.getColumnLeft(_5)}}
if(this.logIsDebugEnabled("calendar")){this.logDebug('calendar.getEventLeft() = '+_4+' for:'+isc.Log.echoFull(_1),'calendar')}
return _4});isc.evalBoundary;isc.B.push(isc.A.getEventHeaderHTML=function isc_Calendar_getEventHeaderHTML(_1,_2){if(!_1)return null;var _3=this.getEventStartDate(_1);var _4=isc.Time.toShortTime(_3,this.timeFormatter,false);var _5=_2.isTimelineView()?null:_4,_6=(_5?_5+" ":"")+(_1[this.nameField]||"");return _6},isc.A.getEventBodyHTML=function isc_Calendar_getEventBodyHTML(_1,_2){if(!_1)return null;return _1[this.descriptionField]},isc.A.getEventLeadingDate=function isc_Calendar_getEventLeadingDate(_1,_2){if(!_1)return null;var _3=_1[this.leadingDateField];return _3?_3.duplicate():null},isc.A.getEventTrailingDate=function isc_Calendar_getEventTrailingDate(_1,_2){if(!_1)return null;var _3=_1[this.trailingDateField];return _3?_3.duplicate():null},isc.A.getEventStartDate=function isc_Calendar_getEventStartDate(_1,_2){if(!_1||!_1[this.startDateField])return null;return _1[this.startDateField].duplicate()},isc.A.getEventDates=function isc_Calendar_getEventDates(_1,_2){var _3={};_3[this.leadingDateField]=this.getEventLeadingDate(_1);_3[this.startDateField]=this.getEventStartDate(_1);_3[this.endDateField]=this.getEventEndDate(_1);_3[this.trailingDateField]=this.getEventTrailingDate(_1);return _3},isc.A.getEventEndDate=function isc_Calendar_getEventEndDate(_1,_2){if(!_1)return null;var _3=this.getEventDuration(_1),_4=_1[this.endDateField];if(_3!=null){var _5=this.getEventDurationUnit(_1)||"mn"
_4=this.getEventStartDate(_1);if(_5){_4=isc.DateUtil.dateAdd(_4,_5,_3,null,null,null,this.firstDayOfWeek)}}
return _4?_4.duplicate():null},isc.A.isDurationEvent=function isc_Calendar_isDurationEvent(_1){return(!_1[this.endDateField]&&_1[this.durationField]!=null)},isc.A.getEventDuration=function isc_Calendar_getEventDuration(_1,_2){return _1[this.durationField]},isc.A.getEventDurationUnit=function isc_Calendar_getEventDurationUnit(_1,_2){return _1[this.durationUnitField]||this.$1290},isc.A.isZeroLengthEvent=function isc_Calendar_isZeroLengthEvent(_1){var _2=this.isDurationEvent(_1),_3=_2&&this.getEventDuration(_1)==0;return _3},isc.A.setShowWeekends=function isc_Calendar_setShowWeekends(_1){if(_1==this.showWeekends)return;this.showWeekends=_1;this.dayView&&this.dayView.rebuild();this.weekView&&this.weekView.rebuild();this.monthView&&this.monthView.rebuild();this.timelineView&&this.timelineView.rebuild();this.setDateLabel()},isc.A.canEditEvent=function isc_Calendar_canEditEvent(_1,_2){if(!_1)return false;_2=_2||this.getSelectedView();if(_1[this.canEditField]!=null)return _1[this.canEditField];if(_1.duration==0)return this.canEditEvents;var _3=isc.DateUtil.getLogicalDateOnly(this.getEventStartDate(_1)),_4=isc.DateUtil.getLogicalDateOnly(new Date(this.getEventEndDate(_1).getTime()-1)),_5=(isc.DateUtil.compareLogicalDates(_3,_4)==0);if(!_2.allowMultiDayEvents&&!_5){return false}else return this.canEditEvents},isc.A.canDragEvent=function isc_Calendar_canDragEvent(_1,_2){_2=_2||this.getSelectedView();if(!_1||!this.canEditEvent(_1,_2))return false;if(_1[this.canDragEventField]!=null)return _1[this.canDragEventField];else return this.canDragEvents},isc.A.canResizeEvent=function isc_Calendar_canResizeEvent(_1,_2){_2=_2||this.getSelectedView();if(!_1||!this.canEditEvent(_1,_2)||!this.canDragEvent(_1,_2))return false;if(_1[this.canResizeEventField]!=null)return _1[this.canResizeEventField];else if(this.isZeroLengthEvent(_1))return false;else return this.canResizeEvents},isc.A.canRemoveEvent=function isc_Calendar_canRemoveEvent(_1,_2){if(!_1)return false;if(_1[this.canRemoveField]!=null)return _1[this.canRemoveField];return this.canRemoveEvents&&this.canEditEvent(_1,_2||this.getSelectedView())},isc.A.getDateEditingStyle=function isc_Calendar_getDateEditingStyle(){var _1=this.getSelectedView();if(_1.dateEditingStyle){return _1.dateEditingStyle}
var _2=this.dateEditingStyle;if(!_2){if(this.dataSource)_2=this.getDataSource().getField(this.startDateField).type;if(!_2){switch(this.timelineGranularity){case"day":if(!this.timelineView)_2="date";else if(this.getSnapGapPixels(this.timelineView)<this.timelineView.columnWidth){_2="datetime"}else{_2="date"}
break;case"hour":_2="datetime";break;case"millisecond":case"second":case"minute":_2="time";break;default:_2="date";break}}}
return _2},isc.A.addLaneEvent=function isc_Calendar_addLaneEvent(_1,_2,_3,_4,_5,_6){_6=_6||{};var _7=this.createEventObject(null,_2,_3,_1,_6[this.sublaneNameField],_4,_5);this.addCalendarEvent(_7,_6)},isc.A.getCleanEventRecord=function isc_Calendar_getCleanEventRecord(_1){if(isc.propertyDefined(_1,"overlapProps"))delete _1.overlapProps;if(isc.propertyDefined(_1,"overlapRangeId"))delete _1.overlapRangeId;if(isc.propertyDefined(_1,"slotNum"))delete _1.slotNum;if(isc.propertyDefined(_1,"tagged"))delete _1.tagged;return _1},isc.A.createEventObject=function isc_Calendar_createEventObject(_1,_2,_3,_4,_5,_6,_7){var _8=isc.addProperties({},_1);if(_2)_8[this.startDateField]=_2;if(_3)_8[this.endDateField]=_3;if(_4)_8[this.laneNameField]=_4;if(_5)_8[this.sublaneNameField]=_5;if(_6)_8[this.nameField]=_6;if(_7)_8[this.descriptionField]=_7;delete _8.eventLength;delete _8.__ref;return _8},isc.A.addEvent=function isc_Calendar_addEvent(_1,_2,_3,_4,_5,_6,_7){_5=_5||{};var _8;if(isc.isA.Date(_1)){_8=this.createEventObject(null,_1,_2,_6||_5[this.laneNameField],_5[this.sublaneNameField],_3,_4)}else if(isc.isAn.Object(_1)){_8=_1}else{isc.logWarn('addEvent error: startDate parameter must be either a Date or a CalendarEvent');return}
this.addCalendarEvent(_8,_5,_7)},isc.A.addCalendarEvent=function isc_Calendar_addCalendarEvent(_1,_2,_3){if(!_1)return;if(_3==null)_3=true;var _4=this.getEventStartDate(_1);if(!isc.isA.Date(_4)){isc.logWarn('addCalendarEvent: passed event has no start date');return}
_1=this.getCleanEventRecord(isc.addProperties(_1,_2));if(_3)this.$53e=true;if(this.dataSource){var _5=this;isc.DataSource.get(this.dataSource).addData(_1,function(_6,_7,_8){_5.processSaveResponse(_6,_7,_8)},{componentId:this.ID,willHandleError:true});return}else{this.$53e=true;this.data.add(_1);this.processSaveResponse({status:0},[_1],{operationType:"add"})}},isc.A.removeEvent=function isc_Calendar_removeEvent(_1,_2){if(_2==null)_2=true;var _3=this.getEventStartDate(_1),_4=this.getEventEndDate(_1);var _5=this;var _6=function(){if(_5.$53b(_3,_4)){_5.dayView.removeEvent(_1)}
if(_5.$53c(_3,_4)){_5.weekView.removeEvent(_1)}
if(_5.$53d(_3,_4)){_5.monthView.refreshEvents("removeEvent")}
if(_5.$131r(_3,_4)){_5.timelineView.removeEvent(_1);if(!_5.dataSource)_5.timelineView.retagLaneEvents(_1[_5.laneNameField])}
if(_5.eventAutoArrange){if(_5.dayView){if(_5.dayView.isSelectedView())_5.dayView.refreshEvents("removeEvent");else _5.dayView.$123s=true}
if(_5.weekView){if(_5.weekView.isSelectedView())_5.weekView.retagDayEvents(_3);else _5.weekView.$123s=true}}
if(_5.eventRemoved)_5.eventRemoved(_1)};if(_2)this.$53e=true;_1=this.getCleanEventRecord(_1);if(this.dataSource){isc.DataSource.get(this.dataSource).removeData(_1,_6,{componentId:this.ID,oldValues:_1});return}else{this.data.remove(_1);_6()}},isc.A.updateEvent=function isc_Calendar_updateEvent(_1,_2,_3,_4,_5,_6,_7,_8,_9){if(_7==null)_7=true;if(!isc.isAn.Object(_6))_6={};var _10=this.createEventObject(_1,_2,_3,_8||_6[this.laneNameField],_9||_6[this.sublaneNameField],_4,_5);this.updateCalendarEvent(_1,_10,_6,_7)},isc.A.updateCalendarEvent=function isc_Calendar_updateCalendarEvent(_1,_2,_3,_4){if(_4)this.$53e=true;_3=_3||{};var _5=this.getSelectedView();var _6=_5.getCurrentEventCanvas(_1);if(_6){if(this.dataSource)_5.clearEventCanvas(_6)}
if(this.dataSource){var _7=isc.DataSource.get(this.dataSource);var _8=this.getCleanEventRecord(isc.addProperties({},_2,_3));var _9=this.getCleanEventRecord(isc.addProperties({},_1));var _10=this;_7.updateData(_8,function(_12,_13,_14){_10.processSaveResponse(_12,_13,_14,_9)},{oldValues:_9,componentId:this.ID,willHandleError:true});return}else{var _11=isc.addProperties({},_1);isc.addProperties(_1,_2,_3);this.processSaveResponse({status:0},[_1],{operationType:"update"},_11)}},isc.A.processSaveResponse=function isc_Calendar_processSaveResponse(_1,_2,_3,_4){var _5=isc.isAn.Array(_2)?_2[0]:_2,_6=_3?_3.operationType:null,_7=_6=="update",_8=_6=="add",_9=this.$1115,_10=this.$1116;delete this.$1115;delete this.$1116;if(_1&&_1.status<0){var _11=_1?_1.errors:null;if(_1.status==isc.RPCResponse.STATUS_VALIDATION_ERROR){if(_9){if(_11)this.eventDialog.items[0].setErrors(_11,true);this.displayEventDialog(true);return}else if(_10){this.eventEditorLayout.show();if(_11)this.eventEditor.setErrors(_11,true);return}}
if(_7&&_4){var _12=this.getSelectedView();if(_12){_12.addEvent(_4);if(this.canSelectEvents&&(_9||_10)){var _13=_12.getCurrentEventCanvas(_4);if(_13)_13.focus()}}}
isc.RPCManager.$a0(_1,_3);return}
if(!_5||isc.isA.String(_5)){if(_8){this.logWarn("Calendar Add operation did not return a record. The operation succeeded but no CalendarViews will be refreshed.")
return}else _5=_4}
var _14=_7&&_4?this.getEventStartDate(_4):null,_15=_7&&_4?this.getEventEndDate(_4):null,_16=_7&&_4?_4[this.laneNameField]:null,_17=this.getEventStartDate(_5),_18=this.getEventEndDate(_5),_19=_5[this.laneNameField];_5.eventLength=(_18.getTime()-_17.getTime());if(_5[this.durationField]!=null){_5.isDuration=true;_5.isZeroDuration=_5[this.durationField]==0}
var _12=this.getSelectedView();if(this.$53b(_17,_18)||(_7&&this.$53b(_14,_15)))
{if(!this.dayViewSelected())this.dayView.$123s=true;else{if(_7){var _12=this.dayView;if(this.showDayLanes){_12.retagLaneEvents(_16);if(_19!=_16)_12.retagLaneEvents(_19)}else{_12.refreshEvents("processSaveResponse")}}else if(_8){_12.refreshEvents("processSaveResponse")}}}
if(this.$53c(_17,_18)){if(!this.weekViewSelected())this.weekView.$123s=true;else{var _12=this.weekView;if(_7){var _20=isc.DateUtil.getLogicalDateOnly(_14);var _21=isc.DateUtil.getLogicalDateOnly(_17);_12.retagDayEvents(_20);if(isc.DateUtil.compareLogicalDates(_20,_21)!=0){_12.retagDayEvents(_21)}}else if(_8){_12.addEvent(_5,true);_12.retagDayEvents(_17)}}}
if(this.$53d(_17,_18)){if(!this.monthViewSelected())this.monthView.$123s=true;else this.monthView.refreshEvents("processSaveResponse")}
if(this.$131r(_17,_18)){if(!this.timelineViewSelected())this.timelineView.$123s=true;else{var _12=this.timelineView;if(_7){if(_16&&_16!=_19)_12.retagLaneEvents(_16);_12.retagLaneEvents(_19)}else if(_8){_12.refreshEvents("processSaveResponse")}}}
if(this.$53e)delete this.$53e;if(this.canSelectEvents&&(_9||_10)){var _13=_12.getCurrentEventCanvas(_4||_5);if(_13)_13.focus()}
if(_7&&this.eventChanged)this.eventChanged(_5);if(_8&&this.eventAdded)this.eventAdded(_5)},isc.A.refreshEvent=function isc_Calendar_refreshEvent(_1){var _2=this.getSelectedView();var _3=_2.getCurrentEventCanvas(_1);if(_3){_3.setEvent(_1)
_3.markForRedraw()}},isc.A.setEventStyle=function isc_Calendar_setEventStyle(_1,_2){_1.eventWindowStyle=_2;var _3=this.getSelectedView().getCurrentEventCanvas(_1);if(_3){_3.setEventStyle(_2);_3.markForRedraw()}},isc.A.eventsAreSame=function isc_Calendar_eventsAreSame(_1,_2){if(!_1||!_2)return false;if(this.dataSource){var _3=isc.DataSource.get(this.dataSource),_4=this.getEventPKs(),_5=true;for(var i=0;i<_4.length;i++){var _7=_4[i];if(_1[_7]!=_2[_7]){_5=false;break}}
return _5}else{return(_1===_2)}},isc.A.$141h=function isc_Calendar__getEventHoverHTML(_1,_2,_3){var _4=this,_5=_4.getEventStartDate(_1),_6=_5.toShortDate(this.dateFormatter,true),_7=isc.Time.toShortTime(_5,this.timeFormatter,false),_8=this.getEventEndDate(_1),_9=_8.toShortDate(this.dateFormatter,false),_10=isc.Time.toShortTime(_8,this.timeFormatter,false),_11=_1[_4.nameField],_12=_1[_4.descriptionField],_13=isc.StringBuffer.create();if(_3.isTimelineView()){if(isc.DateUtil.compareLogicalDates(_5,_8)!=0){_13.append(_6,"&nbsp;",_7,"&nbsp;-&nbsp;",_9,"&nbsp;",_10)}else{_13.append(_6,"&nbsp;",_7,"&nbsp;-&nbsp;",_10)}}else{_13.append(_6,"&nbsp;",_7,"&nbsp;-&nbsp;",_10)}
if(_11)_13.append("<br><br>",_11);if(_12)_13.append("<br>",_12);var _14=_13.release(false);return this.getEventHoverHTML(_1,_2,_3,_14)},isc.A.getEventHoverHTML=function isc_Calendar_getEventHoverHTML(_1,_2,_3,_4){return _4},isc.A.$141i=function isc_Calendar__getZoneHoverHTML(_1,_2,_3){var _4=this.$141h(_1,_2,_3);return this.getZoneHoverHTML(_1,_2,_3,_4)},isc.A.getZoneHoverHTML=function isc_Calendar_getZoneHoverHTML(_1,_2,_3,_4){return _4},isc.A.indicatorClick=function isc_Calendar_indicatorClick(_1,_2){return true},isc.A.$141j=function isc_Calendar__getIndicatorHoverHTML(_1,_2,_3){var _4=this.$141h(_1,_2,_3);return this.getIndicatorHoverHTML(_1,_2,_3,_4)},isc.A.getIndicatorHoverHTML=function isc_Calendar_getIndicatorHoverHTML(_1,_2,_3,_4){return _4},isc.A.$140d=function isc_Calendar__getCellHoverHTML(_1,_2,_3,_4){var _5=_1.getField(_4),_6=null,_7=null;if(!_5)return;if(_5.isLaneField){if(!_1.shouldShowLaneFieldHovers())return;_7=_2&&_2[_5[_1.fieldIdProperty]];if(_5.hoverHTML){_7=_5.hoverHTML(_2,_7,_3,_4,_1)}}else{if(!_1.shouldShowCellHovers())return;var _6=_1.getDateFromPoint();if(_6){_7="<nobr>"+this.$178v(_6,_1.isMonthView())+"</nobr>"}}
return this.getCellHoverHTML(_1,_2,_3,_4,_6,_7)},isc.A.getCellHoverHTML=function isc_Calendar_getCellHoverHTML(_1,_2,_3,_4,_5,_6){return _6},isc.A.$140e=function isc_Calendar__getHeaderHoverHTML(_1,_2,_3,_4,_5){if(!_1.shouldShowHeaderHovers())return;var _6=_3&&(_3.title||_3.name);if(_2.hoverHTML){_6=_2.hoverHTML(_1,_4,_5,_6)}
return this.getHeaderHoverHTML(_1,_2,_4,_5,_6)},isc.A.getHeaderHoverHTML=function isc_Calendar_getHeaderHoverHTML(_1,_2,_3,_4,_5){return _5},isc.A.setShowViewHovers=function isc_Calendar_setShowViewHovers(_1,_2){this.showViewHovers=_1;if(_2){_2.setShowHover(_1)}else{if(this.dayView)this.dayView.setShowHover(_1);if(this.weekView)this.weekView.setShowHover(_1);if(this.monthView)this.monthView.setShowHover(_1);if(this.timelineView)this.timelineView.setShowHover(_1)}},isc.A.$140a=function isc_Calendar__getDragHoverHTML(_1,_2){_2=_2||{};var _3=_2.hoverStyleName||this.hoverStyleName||"";var _4=_2[this.startDateField],_5=_2[this.endDateField],_6="<div style='"+_3+"'><nobr>"+this.$178v(_4)+"</nobr></div><div style='"+_3+"'><nobr>"+this.$178v(_5)+"</nobr></div>";return this.getDragHoverHTML(_1,_2,_6)},isc.A.$178v=function isc_Calendar___getLocalDatetimeString(_1,_2){var _3=isc.DateUtil.getLogicalDateOnly(_1);var _4=isc.DateUtil.getLogicalTimeOnly(_1);var _5=_3.toShortDate(this.dateFormatter);if(!_2){_5+=" "+isc.Time.toShortTime(_4,this.timeFormatter,true)}
return _5},isc.A.getDragHoverHTML=function isc_Calendar_getDragHoverHTML(_1,_2,_3){return _3},isc.A.$53b=function isc_Calendar__shouldRefreshDay(_1,_2){if(!this.dayView||!this.dayView.body)return false;var _3=isc.DateUtil.getLogicalDateOnly(this.dayView.startDate);var _4=isc.DateUtil.getLogicalDateOnly(_1);var _5=isc.DateUtil.getLogicalDateOnly(_2);var _6=isc.DateUtil.compareLogicalDates(_4,_3)==0;var _7=isc.DateUtil.compareLogicalDates(_5,_3)==0;return(_6||_7)},isc.A.$53c=function isc_Calendar__shouldRefreshWeek(_1,_2){if(!this.weekView||!this.weekView.body)return false;var _3=_1.getTime()<this.weekView.endDate.getTime(),_4=_2.getTime()>this.weekView.startDate.getTime();return(_3||_4)},isc.A.$53d=function isc_Calendar__shouldRefreshMonth(_1,_2){if(!this.monthView||!this.monthView.body)return false;var _3=new Date(this.year,this.month,-7,0,0,0).getTime(),_4=new Date(this.year,this.month,37,23,59,59).getTime();return(_1.getTime()<_4&&_2.getTime()>_3)},isc.A.$131r=function isc_Calendar__shouldRefreshTimeline(_1,_2){if(!this.timelineView||!this.timelineView.body)return false;var _3=_1.getTime()<this.timelineView.endDate.getTime(),_4=_2.getTime()>this.timelineView.startDate.getTime();return(_3&&_4)},isc.A.getEventCanvasConstructor=function isc_Calendar_getEventCanvasConstructor(_1,_2){_2=_2||this.getSelectedView();return _2.getEventCanvasConstructor(_1)||this.eventCanvasConstructor},isc.A.getEventCanvasStyle=function isc_Calendar_getEventCanvasStyle(_1,_2){_2=_2||this.getSelectedView();var _3=this.$131j(_1)||_2.getEventCanvasStyle(_1)||this.eventWindowStyle||this.eventStyleName;return _3},isc.A.$1700=function isc_Calendar__showEventCanvasContextMenu(_1){if(this.showEventCanvasContextMenu==false)return false;var _2=this.getEventCanvasMenuItems(_1);if(_2&&_2.length>0){if(!this.eventCanvasContextMenu)this.addAutoChild("eventCanvasContextMenu");this.eventCanvasContextMenu.setData(_2);_1.contextMenu=this.eventCanvasContextMenu;_1.showContextMenu();return false}
return true},isc.A.$1701=function isc_Calendar__eventCanvasContextClick(_1){return this.$1700(_1)},isc.A.getEventCanvasMenuItems=function isc_Calendar_getEventCanvasMenuItems(_1,_2){return},isc.A.hideEventCanvasControls=function isc_Calendar_hideEventCanvasControls(_1,_2){var _3=_1[_2];if(!_3)return;var _4=["closeButton","contextButton"];for(var _5 in _3){var _6=_3[_5];_6.hide();delete _6.eventCanvas;if(!_4.contains(_5))this.addChild(_6,null,false)}
delete _1[_2]},isc.A.$174c=function isc_Calendar__createEventCanvasControls(_1,_2){var _3={};var _4=this.createAutoChild("eventCanvasButtonLayout");_3.contextButton=this.createAutoChild("eventCanvasContextButton");_4.addMember(_3.contextButton);if(this.canRemoveEvents!=false){_3.closeButton=this.createAutoChild("eventCanvasCloseButton");_4.addMember(_3.closeButton)}
_3.buttonLayout=_4;if(this.canResizeEvents!=false){var _5=this.getSelectedView();var _6=(_1&&_1.verticalResize)||_5.verticalEvents;if(!_1||_6){_3.endResizerB=this.getEventCanvasResizer(null,"B",_2)}
if(!_1||!_6){_3.startResizerL=this.getEventCanvasResizer(null,"L",_2);_3.endResizerR=this.getEventCanvasResizer(null,"R",_2)}}
return _3},isc.A.$174d=function isc_Calendar__getRolloverControls(){if(!this.$129e){this.$129e=this.$174c()}
return this.$129e},isc.A.selectSingleEvent=function isc_Calendar_selectSingleEvent(_1,_2){return this.selectEvent(_1,_2,true)},isc.A.selectEvent=function isc_Calendar_selectEvent(_1,_2,_3){var _4=this.getSelection();if(_3){this.deselectAllEvents()}
var _5=_4.select(_1);if(_5){if(!_2){var _6=this.getSelectedView();_2=_6.getCurrentEventCanvas(_1)}
this.selectEventCanvas(_2);this.selectionChanged(_1,_4.getSelection())}
return _5},isc.A.selectEvents=function isc_Calendar_selectEvents(_1){var _2=false;if(_1&&_1.length>0){for(var i=0;i<_1.length;i++){var _4=this.selectEvent(_1[i]);if(_4)_2=true}}
return _2},isc.A.selectEventCanvas=function isc_Calendar_selectEventCanvas(_1){_1.bringToFront();_1.isSelected=true;_1.event.isSelected=true;_1.setEventStyle(_1.$172y.eventStyleName)},isc.A.deselectEvent=function isc_Calendar_deselectEvent(_1,_2){var _3=this.getSelection();var _4=_3.deselect(_1);if(_4){if(!_2){var _5=this.getSelectedView();_2=_5.getCurrentEventCanvas(_1)}
this.deselectEventCanvas(_2);this.selectionChanged(_1,_3.getSelection())}
return _4},isc.A.deselectEvents=function isc_Calendar_deselectEvents(_1){var _2=false;if(_1&&_1.length>0){for(var i=0;i<_1.length;i++){var _4=this.deselectEvent(_1[i]);if(_4)_2=true}}
return _2},isc.A.deselectAllEvents=function isc_Calendar_deselectAllEvents(){var _1=false;var _2=this.getSelectedEvents();for(var i=0;i<_2.length;i++){var _4=this.deselectEvent(_2[i]);if(_4)_1=true}
return _1},isc.A.deselectEventCanvas=function isc_Calendar_deselectEventCanvas(_1){_1.isSelected=false;_1.event.isSelected=false;_1.setEventStyle(_1.$172y.eventStyleName)},isc.A.selectionChanged=function isc_Calendar_selectionChanged(_1,_2){},isc.A.selectionUpdated=function isc_Calendar_selectionUpdated(_1,_2){},isc.A.getSelection=function isc_Calendar_getSelection(){return this.selectionManager},isc.A.clearSelection=function isc_Calendar_clearSelection(){this.deselectAllEvents()},isc.A.getSelectedEvent=function isc_Calendar_getSelectedEvent(){var _1=this.getSelectedEvents();if(_1)_1=_1[0];return _1},isc.A.getSelectedEvents=function isc_Calendar_getSelectedEvents(){var _1=this.getSelection();if(_1)_1=_1.getSelection();return _1},isc.A.$174e=function isc_Calendar__getFocusControls(){if(!this.$174f){this.$174f=this.$174c(null,true)}
return this.$174f},isc.A.$174g=function isc_Calendar__focusEventCanvas(_1){if(!_1)return;if(_1.$174h){return}
if(_1.$129e){this.hideEventCanvasControls(_1,"$129e")}
_1.updateRolloverControls();_1.parentElement.scrollIntoView(_1.getLeft(),_1.getTop(),_1.getWidth(),_1.getHeight());if(this.$195l){delete this.$195l;this.selectSingleEvent(_1.event,_1)}},isc.A.$174i=function isc_Calendar__blurEventCanvas(_1){if(!_1||_1.$174h){return}
this.hideEventCanvasControls(_1,"$174f");_1.updateRolloverControls();if(this.$195m){delete this.$195m;this.$195l=true}},isc.A.getEventCanvasGripper=function isc_Calendar_getEventCanvasGripper(_1,_2,_3){_1=_1||{};_1.src=this.getEventCanvasGripperIcon(_2,_3);var _4=this.createAutoChild("eventCanvasGripper",_1);_3.addChild(_4,null,false);return _4},isc.A.getEventCanvasGripperIcon=function isc_Calendar_getEventCanvasGripperIcon(_1,_2){return _1.gripperIcon||this.eventCanvasGripperIcon},isc.A.getEventCanvasLabel=function isc_Calendar_getEventCanvasLabel(_1,_2){var _3=this.createAutoChild("eventCanvasLabel",_1);_2.addChild(_3,null,false);return _3},isc.A.$174b=function isc_Calendar__eventCanvasCloseClick(_1){if(this.eventRemoveClick(_1.event,_1.calendarView.viewName)!=false){this.removeEvent(_1.event,false)}},isc.A.getEventCanvasCloseButton=function isc_Calendar_getEventCanvasCloseButton(_1){if(this.useEventCanvasRolloverControls){if(!this.eventCanvasCloseButton){this.eventCanvasCloseButton=this.addAutoChild("eventCanvasCloseButton")}
return this.eventCanvasCloseButton}else{return this.createAutoChild("eventCanvasCloseButton")}},isc.A.getEventCanvasContextButton=function isc_Calendar_getEventCanvasContextButton(_1){if(this.useEventCanvasRolloverControls){if(!this.eventCanvasContextButton){this.eventCanvasContextButton=this.addAutoChild("eventCanvasContextButton")}
return this.eventCanvasContextButton}else{return this.createAutoChild("eventCanvasContextButton")}},isc.A.getEventCanvasResizer=function isc_Calendar_getEventCanvasResizer(_1,_2,_3){var _4="eventCanvasResizer"+_2,_5=_3?null:this[_4];if(!this.useEventCanvasRolloverControls||!_5){var _6="eventCanvas"+(["T","B"].contains(_2)?"V":"H")+"Resizer",_7={snapTo:_2,getEventEdge:function(){return this.snapTo}};_5=this.createAutoChild(_6,_7);if(!_3&&this.useEventCanvasRolloverControls)this[_4]=_5}
return _5},isc.A.setShowZones=function isc_Calendar_setShowZones(_1){this.showZones=_1;var _2=this.timelineView;if(_2&&_2.isSelectedView())_2.refreshEvents("setShowZones");else if(_2)_2.$123s=true},isc.A.setZones=function isc_Calendar_setZones(_1){if(!_1){return}
this.zones=_1;if(this.timelineView){this.timelineView.drawZones()}},isc.A.addZone=function isc_Calendar_addZone(_1){if(!_1)return;this.zones=this.zones||[];this.zones.add(_1);this.setZones(this.zones)},isc.A.removeZone=function isc_Calendar_removeZone(_1){if(!_1||!this.zones)return;if(isc.isA.String(_1))_1=this.zones.find(this.nameField,_1);if(_1){this.zones.remove(_1);this.setZones(this.zones)}},isc.A.zoneClick=function isc_Calendar_zoneClick(_1,_2){return true},isc.A.getZoneCanvas=function isc_Calendar_getZoneCanvas(_1,_2){var _3={calendar:this,calendarView:_2,event:_1,isZoneCanvas:true,styleName:this.getZoneCanvasStyle(_1,_2)};var _4=this.createAutoChild("zoneCanvas",_3,this.zoneCanvasConstructor);if(this.customizeCanvas)this.customizeCanvas(_4,_2);return _4},isc.A.$131j=function isc_Calendar__getEventStyleName(_1){return _1[this.eventWindowStyleField]||_1[this.eventStyleNameField]},isc.A.getZoneCanvasStyle=function isc_Calendar_getZoneCanvasStyle(_1,_2){_2=_2||this.getSelectedView();var _3=this.$131j(_1)||(_2&&_2.zoneStyleName)||this.zoneStyleName;return _3},isc.A.setShowIndicators=function isc_Calendar_setShowIndicators(_1){this.showIndicators=_1;var _2=this.timelineView;if(_2&&_2.isSelectedView())_2.refreshEvents("setShowIndicators");else if(_2)_2.$123s=true},isc.A.getIndicatorCanvas=function isc_Calendar_getIndicatorCanvas(_1,_2){_2=_2||this.getSelectedView();var _3={calendar:this,calendarView:_2,event:_1,isIndicatorCanvas:true,styleName:this.getIndicatorCanvasStyle(_1,_2),dragTarget:_2.eventDragCanvas},_4=this.createAutoChild("indicatorCanvas",_3,this.indicatorCanvasConstructor);if(this.customizeCanvas)this.customizeCanvas(_4,_2);return _4},isc.A.getIndicatorCanvasStyle=function isc_Calendar_getIndicatorCanvasStyle(_1,_2){_2=_2||this.getSelectedView();return this.$131j(_1)||(_2&&_2.indicatorStyleName)||this.indicatorStyleName},isc.A.setIndicators=function isc_Calendar_setIndicators(_1){if(!_1){return}
this.indicators=_1;if(this.timelineView){this.timelineView.drawIndicators()}},isc.A.addIndicator=function isc_Calendar_addIndicator(_1){if(!_1)return;this.indicators=this.indicators||[];this.indicators.add(_1);this.setIndicators(this.indicators)},isc.A.removeIndicator=function isc_Calendar_removeIndicator(_1){if(!_1||!this.indicators)return;if(isc.isA.String(_1))_1=this.indicators.find(this.nameField,_1);if(_1){this.indicators.remove(_1);this.setIndicators(this.indicators)}},isc.A.$129r=function isc_Calendar__getEventCanvas(_1,_2){var _3=isc.addProperties({calendar:this,calendarView:_2,overflow:"hidden"},this.eventCanvasDefaults,this.eventCanvasProperties);var _4=this.getEventCanvasConstructor(_1,_2),_5=this.createAutoChild("eventCanvas",_3,_4);_2.$232l[_5.ID]=_5;_2.$232n[_5.ID]=_1.$232p;_2.$232j[_1.$232p]=_5.ID;return _5},isc.A.$53g=function isc_Calendar__getEventsInRange(_1,_2,_3,_4){var _5=[],_6=this.getWeekendDays(),_7=this.data.getLength(),_8=[],_9=_1.getTime(),_10=_2.getTime();_3=_3||this.getSelectedView();if(_4){var _11=_3.body.getVisibleColumns();if(_11[0]>=0&&_11[1]>=0){for(var i=_11[0];i<=_11[1];i++){_8.add(_3.body.fields[i][this.laneNameField])}}}
for(var i=0;i<_7;i++){var _13=this.data.get(i),_14=this.getEventStartDate(_13);if(_4&&!_8.contains(_13[this.laneNameField]))continue;if(!_13||!_14)return[];if(_14.getTime()>=_1.getTime()&&_14.getTime()<=_2.getTime()&&(this.showWeekends||!_6.contains(_14.getDay())))
{if(_3&&(_3.isWeekView()||_3.isMonthView()))_5.add(_13);else if(!this.showDayLanes||_8.contains(_13[this.laneNameField]))
_5.add(_13)}}
return _5},isc.A.getDayEnd=function isc_Calendar_getDayEnd(_1){return isc.DateUtil.getEndOf(_1,"d",false,this.firstDayOfWeek)},isc.A.isTimeline=function isc_Calendar_isTimeline(){var _1=this.getCurrentViewName()=="timeline";return _1},isc.A.setChosenDate=function isc_Calendar_setChosenDate(_1,_2){var _3=this.getSelectedView();this.chosenDate=isc.DateUtil.getLogicalDateOnly(_1);this.year=this.chosenDate.getFullYear();this.month=this.chosenDate.getMonth();this.displayDate=this.chosenDate.getDate();if(this.dayView)this.dayView.setChosenDate(this.chosenDate);if(this.weekView)this.weekView.setChosenDate(this.chosenDate);if(this.monthView)this.monthView.setChosenDate(this.chosenDate);if(this.timelineView)this.timelineView.setChosenDate(_1);if(this.monthButton)this.updateMonthButton();this.setDateLabel();this.dateChanged()},isc.A.dateIsWorkday=function isc_Calendar_dateIsWorkday(_1,_2){if(!_1||!this.workdays)return false;var _3=isc.DateUtil.getLogicalDateOnly(_1);return this.workdays.contains(_3.getDay())},isc.A.adjustCriteria=function isc_Calendar_adjustCriteria(_1){return _1},isc.A.shouldIncludeRangeCriteria=function isc_Calendar_shouldIncludeRangeCriteria(_1){_1=_1||this.getSelectedView();if(_1&&_1.includeRangeCriteria!=null)return _1.includeRangeCriteria;return this.includeRangeCriteria},isc.A.$wo=function isc_Calendar__filter(_1,_2,_3,_4,_5){var _6=this.getSelectedView();if(this.shouldIncludeRangeCriteria(_6)){if(_2){_2=isc.DS.removeCriteriaForField(_2,this.startDateField);_2=isc.DS.removeCriteriaForField(_2,this.endDateField)}
var _7=this.getRangeCriteria(_6);if(_7){if(!_2||isc.isA.emptyObject(_2))_2=_7;else{_2=isc.DS.combineCriteria(_2,_7)}}
_2=isc.DS.compressNestedCriteria(_2)}
return this.Super("$wo",arguments)},isc.A.getRangeCriteria=function isc_Calendar_getRangeCriteria(_1){_1=_1||this.getSelectedView();if(!_1)return null;if(!this.shouldIncludeRangeCriteria(_1))return null;var _2=null,_3=null,_4={},_5=_1.rangeCriteriaMode||this.rangeCriteriaMode||"none";if(_5=="auto"){var _6=this.getLargestScrollableRange();_2=_6[0];_3=_6[1]}else if(_5!="none"){_2=this.getVisibleStartDate(_1);_3=this.getVisibleEndDate(_1)}
if(_2&&_3){_4={_constructor:"AdvancedCriteria",operator:"and",criteria:[{fieldName:this.startDateField,operator:"lessThan",value:_3},{fieldName:this.endDateField,operator:"greaterThan",value:_2}]}}
_4=this.adjustCriteria(_4);return _4},isc.A.next=function isc_Calendar_next(){var _1;if(this.dayViewSelected()){_1=isc.DateUtil.createLogicalDate(this.year,this.month,this.displayDate+1);if(!this.showWeekends){var _2=this.getWeekendDays();for(var i=0;i<_2.length;i++){if(_2.contains(_1.getDay()))_1.setDate(_1.getDate()+1)}}}else if(this.weekViewSelected()){_1=isc.DateUtil.createLogicalDate(this.year,this.month,this.chosenDate.getDate()+7)}else if(this.monthViewSelected()){_1=isc.DateUtil.createLogicalDate(this.year,this.month+1,1)}else if(this.timelineViewSelected()){this.timelineView.nextOrPrev(true);return}
if(this.showDateChooser&&this.dateChooser)this.dateChooser.setData(_1);this.setChosenDate(_1)},isc.A.previous=function isc_Calendar_previous(){var _1;if(this.dayViewSelected()){_1=isc.DateUtil.createLogicalDate(this.year,this.month,this.displayDate-1);if(!this.showWeekends){var _2=this.getWeekendDays();for(var i=0;i<_2.length;i++){if(_2.contains(_1.getDay()))_1.setDate(_1.getDate()-1)}}}else if(this.weekViewSelected()){_1=isc.DateUtil.createLogicalDate(this.year,this.month,this.displayDate-7)}else if(this.monthViewSelected()){_1=isc.DateUtil.createLogicalDate(this.year,this.month-1,1)}else if(this.timelineViewSelected()){this.timelineView.nextOrPrev(false);return}
if(this.showDateChooser)this.dateChooser.setData(_1);this.setChosenDate(_1)},isc.A.dataArrived=function isc_Calendar_dataArrived(){if(this.$1746)this.dataChanged();return true},isc.A.draw=function isc_Calendar_draw(_1,_2,_3,_4){this.$1737=true;this.invokeSuper(isc.Calendar,"draw",_1,_2,_3,_4);if(isc.ResultSet&&isc.isA.ResultSet(this.data)&&this.dataSource){if(!this.isObserving(this.data,"dataArrived")){this.observe(this.data,"dataArrived","observer.dataArrived(arguments[0], arguments[1])")}}
if(this.mainView.isA("TabSet")){if(this.showControlsBar!=false){this.mainView.addChild(this.controlsBar);this.controlsBar.moveAbove(this.mainView.tabBar)}}
if(!isc.isA.TabSet(this.mainView)){this.setChosenDate(this.chosenDate)}else{this.setDateLabel()}
delete this.$1737;if(this.$187g){var _5=this.$187g;delete this.$187g;this.scrollToTime(_5)}});isc.evalBoundary;isc.B.push(isc.A.$232v=function isc_Calendar__getTabPane(_1){var _2={viewName:_1,calendar:this,baseStyle:this.baseStyle,chosenDate:this.chosenDate};if(_1=="day"){this.dayView=this.createAutoChild("dayView",isc.addProperties({},_2,{cellHeight:this.rowHeight,enforceVClipping:true}));return this.dayView}else if(_1=="week"){this.weekView=this.createAutoChild("weekView",isc.addProperties({$128r:true},_2,{cellHeight:this.rowHeight,enforceVClipping:true}));return this.weekView}else if(_1=="month"){this.monthView=this.createAutoChild("monthView",isc.addProperties({},_2,{bodyConstructor:"MonthScheduleBody"}));return this.monthView}else if(_1=="timeline"){this.timelineView=this.createAutoChild("timelineView",isc.addProperties({},_2));return this.timelineView}},isc.A.$653=function isc_Calendar__getTabs(){var _1=[];if(this.showDayView!=false){_1.add({title:this.dayViewTitle,pane:null,viewName:"day"})}
if(this.showWeekView!=false){_1.add({title:this.weekViewTitle,pane:null,viewName:"week"})}
if(this.showMonthView!=false){_1.add({title:this.monthViewTitle,pane:null,viewName:"month"})}
if(this.showTimelineView!=false){_1.add({title:this.timelineViewTitle,pane:null,viewName:"timeline"})}
return _1},isc.A.$655=function isc_Calendar__createTabSet(_1){if(_1.length>1){this.mainView=this.createAutoChild("mainView",{tabs:_1,$8c:function(_6){this.Super("$8c",arguments);var _2=this.getTabPane(_6);if(!_2){this.updateTab(_6,this.creator.$232v(_6.viewName));_2=this.getTabPane(_6)}
this.creator.$567=_2.viewName;this.creator.setDateLabel();var _3=this.creator.getSelectedView();if(_3.$220m)_3.updateRange();if(_3.isDrawn())_3.redraw();else{_3.$191w=true}
if(_3.$123s){_3.$1739()}
if(!_3.$191w){this.creator.currentViewChanged(_2.viewName)}}});var _4;if(this.currentViewName){_4=_1.find("viewName",this.currentViewName);if(_4)this.mainView.selectTab(_4)}else if(this.minimalUI){this.pageOrientationChanged()}else{var _5=this.weekView?"week":(this.dayView?"day":(this.monthView?"month":(this.timelineView?"timeline":null)));if(_5){_4=_1.find("viewName",_5);if(_4){this.mainView.selectTab(_4);this.mainView.viewName=_5;this.$567=_5}}}}else{this.mainView=this.$232v(_1[0].viewName)}},isc.A.getLaneMap=function isc_Calendar_getLaneMap(){if(!this.isTimeline()&&!this.showDayLanes)return{};if(this.laneMap)return this.laneMap;var _1=this.showDayLanes?this.lanes:this.canGroupLanes?this.timelineView.getOriginalData():this.timelineView.data,_2={};for(var i=0;i<_1.length;i++){var _4=_1[i].name||_1[i][this.laneNameField],_5=_1[i].title||_4;_2[_4]=_5}
this.laneMap=isc.addProperties({},_2);return _2},isc.A.getSublaneMap=function isc_Calendar_getSublaneMap(_1,_2){_2=_2||this.getSelectedView();var _3={};if(isc.isA.String(_1))_1=_2.getLane(_1);if(_1&&_1.sublanes){for(var i=0;i<_1.sublanes.length;i++){var _5=_1.sublanes[i],_6=_5.name||_5[this.laneNameField],_7=_5.title||_6;_3[_6]=_7}}
return _3},isc.A.getLanePadding=function isc_Calendar_getLanePadding(_1){_1=_1||this.getSelectedView();if(_1&&_1.useLanePadding())return this.laneEventPadding;return 0},isc.A.getLaneEvents=function isc_Calendar_getLaneEvents(_1,_2){var _3=isc.isAn.Object(_1)?_1.name:_1;if(!_3||!isc.isA.String(_3))return[];_2=_2||this.getSelectedView();var _4=this.data.findAll(this.laneNameField,_3)||[],_5=[];for(var i=0;i<_4.length;i++){var _7=_4[i];if(!_7)continue;if(this.shouldShowEvent(_7,_2)){_5.add(_7)}}
return _5},isc.A.laneHasVisibleEvents=function isc_Calendar_laneHasVisibleEvents(_1,_2){var _3=isc.isAn.Object(_1)?_1.name:_1;if(!_3||!isc.isA.String(_3))return[];_2=_2||this.getSelectedView();var _4=this.data.findAll(this.laneNameField,_3)||[];for(var i=0;i<_4.length;i++){if(!_4[i])continue;if(this.shouldShowEvent(_4[i],_2))return true}
return false},isc.A.getSublaneEvents=function isc_Calendar_getSublaneEvents(_1,_2,_3){var _4=isc.isAn.Object(_1)?_1.name:_1,_5=isc.isAn.Object(_2)?_2.name:_2;if((!_4||!isc.isA.String(_4))||(!_5||!isc.isA.String(_5))){return[]}
_3=_3||this.getSelectedView();var _6=this.getLaneEvents(_4,_3),_7=_6.findAll(this.sublaneNameField,_5);return _7},isc.A.createChildren=function isc_Calendar_createChildren(){var _1=this.$653();this.$655(_1);var _2=20;if(this.showControlsBar!=false){this.dateLabel=this.createAutoChild("dateLabel");this.addEventButton=this.createAutoChild("addEventButton",{click:function(){var _3=this.creator;var _4=_3.getSelectedView();var _5=new Date(),_6=null,_7=_3.chosenDate.duplicate();if(_4.isDayView()){_5=_7}else if(_4.isWeekView()){if(_4.startDate.getTime()>_5.getTime()){_5=_4.startDate.duplicate()}
if(!this.showWeekends){var _8=_3.getWeekendDays();for(var i=0;i<_8.length;i++){if(_8.contains(_5.getDay()))_5.setDate(_5.getDate()+1)}}
_5.setMinutes(0);if(_5.getHours()>22){_5.setDate(_5.getDate()+1);_5.setHours(0)}
else _5.setHours(_5.getHours()+1)}else if(_4.isMonthView()){_7.setDate(1);if(_7.getTime()>_5.getTime())_5=_7}else if(_3.isTimeline()){var _10=_3.timelineView,_11=_10.getVisibleDateRange();_5=_11[0];_6=_5.duplicate();_6=_10.addUnits(_6,1,_3.timelineGranularity)}
var _12={};_12[_3.startDateField]=_5;_12[_3.endDateField]=_6;_3.showEventEditor(_12,true)}});this.datePickerButton=this.createAutoChild("datePickerButton",{click:function(){var _3=this.creator;var _13=_3.getDateChooser();_13.firstDayOfWeek=_3.firstDayOfWeek;var _14=_3.getSelectedView();var _15=_3.getSelectedView().showDateChooserTimeItem;if(_15==null){var _16=_3.getDateEditingStyle();_15=!(_16=="date")}
if(_15!=null)_13.showTimeItem=_15;_13.setData(_14.chosenDate,_15==null);if(!_13.isDrawn())_13.draw();else _13.redraw();_13.placeNear(this.getPageLeft(),this.getPageTop()+this.getHeight());_13.show()}});if(this.minimalUI&&this.showMonthButton!=false&&this.showMonthView!=false){this.monthButton=this.createAutoChild("monthButton");this.updateMonthButton()}
this.previousButton=this.createAutoChild("previousButton",{});this.nextButton=this.createAutoChild("nextButton",{})}
var _17=[];if(this.monthButton)_17.add(this.monthButton);if(this.showPreviousButton!=false)_17.add(this.previousButton);if(this.showDateLabel!=false)_17.add(this.dateLabel);if(this.showDatePickerButton!=false)_17.add(this.datePickerButton);if(this.canCreateEvents&&this.showAddEventButton!=false)_17.add(this.addEventButton);if(this.showNextButton!=false)_17.add(this.nextButton);if(this.showControlsBar!=false){this.controlsBar=this.createAutoChild("controlsBar",{members:_17})}
var _3=this;if(!this.children)this.children=[];var _18=[];if(this.showDateChooser){this.addChild(this.getDateChooser());var _19=[];_19.add(this.dateChooser);_18.add(isc.VLayout.create({autoDraw:false,width:"20%",membersMargin:10,layoutTopMargin:10,members:_19}))}
if(this.mainView.isA("TabSet")){_18.add(this.mainView)}else{if(this.showControlsBar!=false){this.controlsBarContainer=this.createAutoChild("controlsBarContainer",{autoDraw:false,height:this.controlsBar.getVisibleHeight(),width:"100%"},isc.HLayout);this.controlsBarContainer.addMember(isc.LayoutSpacer.create({autoDraw:false,width:"*"}));this.controlsBarContainer.addMember(this.controlsBar);this.controlsBarContainer.addMember(isc.LayoutSpacer.create({autoDraw:false,width:"*"}));this.mainLayout=this.createAutoChild("mainLayout",{autoDraw:false,members:[this.controlsBarContainer,this.mainView]},isc.VLayout);_18.add(this.mainLayout)}else{_18.add(this.mainView)}}
this.children.add(isc.HLayout.create({autoDraw:false,overflow:"hidden",width:"100%",height:"100%",members:_18}))},isc.A.getDateChooser=function isc_Calendar_getDateChooser(){if(this.dateChooser)return this.dateChooser;this.dateChooser=this.createAutoChild("dateChooser",{disableWeekends:this.disableChooserWeekends!=null?this.disableChooserWeekends:false,showWeekends:this.showChooserWeekends!=null?this.showChooserWeekends:true,weekendDays:this.getWeekendDays(),chosenDate:this.chosenDate,month:this.month,year:this.year,closeOnEscapeKeypress:true,autoHide:true,autoClose:true,visibility:"hidden",firstDayOfweek:this.firstDayOfWeek,dataChanged:function(){var _1=this.getData();this.creator.getSelectedView().$2160=true;if(_1)this.creator.setChosenDate(_1);delete this.creator.getSelectedView().$2160;return _1},show:function(){this.Super("show",arguments);this.bringToFront();this.focus()}});this.dateChooser.deparent();return this.dateChooser},isc.A.getEventDialog=function isc_Calendar_getEventDialog(){if(this.eventDialog)return this.eventDialog;var _1=this;this.eventDialog=this.createAutoChild("eventDialog",{items:[isc.DynamicForm.create({autoDraw:false,padding:4,calendar:this,saveOnEnter:true,implicitSave:false,implicitSaveOnBlur:false,useAllDataSourceFields:true,numCols:2,colWidths:[80,"*"],$642:[_1.nameField,_1.laneNameField,_1.sublaneNameField],getCustomValues:function(){if(!this.calendar.eventDialogFields)return;var _2=this.$642;var _3=this.calendar.eventDialogFields;var _4={};for(var i=0;i<_3.length;i++){var _6=_3[i];if(_6.name&&!_2.contains(_6.name)){_4[_6.name]=this.getValue(_6.name)}}
return _4},setCustomValues:function(_30){if(!this.calendar.eventDialogFields)return;var _2=this.$642;var _3=this.calendar.eventDialogFields;for(var i=0;i<_3.length;i++){var _6=_3[i];if(_6.name&&!_2.contains(_6.name)){this.setValue(_6.name,_30[_6.name])}}},createFields:function(_30){var _1=this.calendar,_7=_1.eventDialog.isNewEvent,_8=_1.isTimeline()||(_1.showDayLanes&&_1.dayViewSelected()),_9=_8&&_1.useSublanes;var _10=[{name:_1.nameField,title:_1.eventNameFieldTitle,type:"text",width:250,wrapTitle:false},{name:_1.laneNameField,title:_1.eventLaneFieldTitle,type:"select",width:150,valueMap:_1.getLaneMap(),showIf:_8?"true":"false",changed:function(_31,_32,_33){var _11=_1.lanes.find("name",_33);if(_33&&_11){var _12=_31.getItem(_1.sublaneNameField);if(_12)_12.setValueMap(_1.getSublaneMap(_11))}}},{name:_1.sublaneNameField,title:_1.eventSublaneFieldTitle,type:"select",width:150,valueMap:[],showIf:_9?"true":"false"},{name:"save",title:_1.saveButtonTitle,editorType:"SubmitItem",endRow:false},{name:"details",title:_1.detailsButtonTitle,type:"button",startRow:false,click:function(_31,_32){var _1=_31.calendar,_13=_1.eventDialog.isNewEvent,_14=_1.eventDialog.event||{},_15=_31.getValue(_1.nameField),_16=_31.getValue(_1.laneNameField),_17=_31.getValue(_1.sublaneNameField);if(_13){_14[_1.nameField]=_15;if(_16)_14[_1.laneNameField]=_16;if(_17)_14[_1.sublaneNameField]=_16}
_1.showEventEditor(_14,_13)}}];if(this.ds){if(this.ds.destroy)this.ds.destroy();this.ds=null}
this.ds=isc.DataSource.create({fields:_10,clientOnly:true});this.setDataSource(this.ds);this.setFields(isc.shallowClone(this.calendar.eventDialogFields))},submit:function(){var _1=this.calendar,_7=_1.eventDialog.isNewEvent,_18=_1.eventDialog.event||{},_19=_1.eventDialog.currentStart,_20=_1.eventDialog.currentEnd,_21=this,_11=null,_22=null;if(!_21.validate())return;if(_1.isTimeline()||(_1.dayViewSelected()&&_1.showDayLanes)){_11=_21.getValue(_1.laneNameField);_22=_21.getValue(_1.sublaneNameField)}
var _23=isc.addProperties({},_21.getCustomValues());_1.$1115=true;var _24=_1.createEventObject(_18,_18[_1.startDateField],_18[_1.endDateField],_11,_22,_21.getValue(_1.nameField));if(!_7){_1.updateCalendarEvent(_18,_24,_23)}else{_1.addCalendarEvent(_24,_23)}
_1.hideEventDialog()},getCalendarView:function(){return this.calendar.getSelectedView()},destroy:function(){if(this.ds){if(this.ds.destroy)this.ds.destroy();this.ds=null}
this.calendar=null;return this.Super("destroy",arguments)}})],setDate:function(_30,_31){var _1=this.creator;if(!_31){if(_30.getHours()==23&&_30.getMinutes()==(60-_1.getSelectedView().getTimePerCell())){_31=isc.DateUtil.createDatetime(_30.getFullYear(),_30.getMonth(),_30.getDate()+1)}else{_31=isc.DateUtil.createDatetime(_30.getFullYear(),_30.getMonth(),_30.getDate(),_30.getHours()+1,_30.getMinutes())}}
this.logicalStartDate=isc.DateUtil.getLogicalDateOnly(_30);this.logicalStartTime=isc.DateUtil.getLogicalTimeOnly(_30);this.logicalEndDate=isc.DateUtil.getLogicalDateOnly(_31);this.logicalEndTime=isc.DateUtil.getLogicalTimeOnly(_31);this.setTitle(_1.$53k(_30,_31));if(this.isNewEvent){this.event[_1.startDateField]=_30.duplicate();this.event[_1.endDateField]=_31.duplicate()}
this.currentStart=_30;this.currentEnd=_31;this.items[0].setValue(_1.nameField,"")},setLane:function(_11){var _1=this.creator;if(isc.isA.Number(_11))_11=_1.lanes[_11].name;this.items[0].getItem(_1.laneNameField).setValue(_11)},setEvent:function(_14){this.event=_14;var _25=this.items[0],_26=this.items[1],_1=this.creator,_27=_1.getSelectedView(),_13=!!this.isNewEvent,_28=_13||_1.canEditEventLane(_14,_27);if(_27.usesLanes())_25.getItem(_1.laneNameField).setDisabled(!_28);if(_1.eventDialogFields){_25.clearErrors(true);_25.setCustomValues(_14)}
this.setDate(_1.getEventStartDate(_14),_1.getEventEndDate(_14));if(_27.hasSublanes()&&_14[_1.laneNameField]){var _11=_27.getLane(_14[_1.laneNameField]);if(_11){var _12=_25.getItem(_1.sublaneNameField);_12.setValueMap(_1.getSublaneMap(_11))}}
_25.setValues(_14)},closeClick:function(){this.Super('closeClick',arguments);if(this.creator.canSelectEvents){var _27=this.creator.getSelectedView(),_29=_27&&_27.getCurrentEventCanvas(this.event);if(_29&&_29.$kk()){_29.focus()}}
this.creator.clearViewSelection()},show:function(){if(this.creator.showQuickEventDialog){if(!this.isDrawn())this.draw();this.Super('show',arguments);this.items[0].getItem(this.creator.nameField).focusInItem()}else{this.creator.showEventEditor(this.event,this.isNewEvent)}},hide:function(){this.Super('hide',arguments);this.moveTo(0,0)},destroy:function(){this.calendar=null;this.Super("destroy",arguments)}});this.eventDialog.form=this.eventDialog.items[0];return this.eventDialog},isc.A.getEventEditorLayout=function isc_Calendar_getEventEditorLayout(){if(this.eventEditorLayout)return this.eventEditorLayout;var _1=this;this.eventEditor=this.createAutoChild("eventEditor",{useAllDataSourceFields:true,titleWidth:80,calendar:this,initWidget:function(){this.invokeSuper(isc.DynamicForm,"initWidget",arguments);var _1=this.creator;this.timeFormat=_1.timeFormat;this.rebuildFieldList()},rebuildFieldList:function(){var _1=this.creator,_2=_1.getSelectedView(),_3=[],_4=_1.getDateEditingStyle(),_5=[{name:"endType",type:"text",showTitle:false,width:"*",editorType:"SelectItem",textAlign:"right",valueMap:[_1.eventDurationFieldTitle,_1.eventEndDateFieldTitle],endRow:false,changed:function(_33,_46,_47){var _1=_33.calendar;_4=_1.getDateEditingStyle();if(_47==_1.eventDurationFieldTitle){_33.getItem(_1.durationField).show();_33.getItem(_1.durationUnitField).show();if(_4=="time"){_33.getItem("endHours").hide();_33.getItem("endMinutes").hide();_33.getItem("endAMPM").hide()}else{_33.getItem(_1.endDateField).hide()}}else{_33.getItem(_1.durationField).hide();_33.getItem(_1.durationUnitField).hide();if(_4=="time"){_33.getItem("endHours").show();_33.getItem("endMinutes").show();_33.getItem("endAMPM").show()}else{_33.getItem(_1.endDateField).show()}}}},{name:_1.durationField,type:"integer",editorType:"SpinnerItem",title:_1.eventDurationFieldTitle,endRow:false,showTitle:false,width:"*",colSpan:1,defaultValue:1},{name:_1.durationUnitField,type:"text",showTitle:false,endRow:true,title:_1.eventDurationUnitFieldTitle,width:"*",colSpan:1,valueMap:_1.getDurationUnitMap(),defaultValue:"minute"}];this.$642.addList([_1.nameField,_1.descriptionField,_1.startDateField,"endType",_1.durationField,_1.durationUnitField,_1.endDateField]);if(_2.usesLanes()){var _6=_1.getLaneMap(),_7={name:_1.laneNameField,title:_1.eventLaneFieldTitle,type:"select",valueMap:_6,endRow:true,width:"*",colSpan:3,changed:function(_33,_46,_47){var _1=_33.calendar;var _8=_1.lanes.find("name",_47);if(_47&&_8){var _9=_33.getItem(_1.sublaneNameField);if(_9)_9.setValueMap(_1.getSublaneMap(_8))}}};_3.add(_7);if(_1.useSublanes){var _10={},_11={name:_1.sublaneNameField,title:_1.eventSublaneFieldTitle,type:"select",valueMap:_10,endRow:true,width:"*",colSpan:3};_3.add(_11)}}
var _12=_1.allowDurationEvents;if(_4=="date"||_4=="datetime"){_3.add({name:_1.startDateField,title:_1.eventStartDateFieldTitle,type:_4,colSpan:"*",endRow:true});if(_12)_3.addList(_5);_3.addList([{name:_1.endDateField,title:_1.eventEndDateFieldTitle,showTitle:!_12,type:_4,colSpan:"*",endRow:true},{name:"invalidDate",type:"blurb",width:"*",colSpan:"*",visible:false,defaultValue:_1.invalidDateMessage,cellStyle:this.errorStyle||"formCellError",endRow:true}])}else if(_4=="time"){var _13=isc.SelectItem.getInstanceProperty("textBoxStyle"),_14=isc.SelectItem.getInstanceProperty("controlStyle"),_15=isc.SelectItem.getInstanceProperty("pickerIconStyle"),_16=isc.SelectItem.getInstanceProperty("pickerIconWidth")+isc.Element.getHMarginSize(_13)+isc.Element.$yp(_13)+4;if(_14){_16+=isc.Element.getHMarginSize(_14);_16+=isc.Element.$yp(_14)}
if(_15){_16+=isc.Element.getHMarginSize(_15);_16+=isc.Element.$yp(_15)}
_19=isc.getValues(this.getTimeValues("hours")).join("<br>");var _17=isc.Canvas.measureContent(_19,_13)+_16;_19=isc.getValues(this.getTimeValues("minutes")).join("<br>");var _18=isc.Canvas.measureContent(_19,_13)+_16;var _19=isc.getValues(this.getTimeValues()).join("<br>");var _20=isc.Canvas.measureContent(_19,_13)+_16;this.numCols=5;this.setColWidths([this.titleWidth,_17,_18,_20,"*"]);_3.addList([{name:"startHours",title:_1.eventStartDateFieldTitle,type:"integer",width:_17,editorType:"select",valueMap:this.getTimeValues("hours")},{name:"startMinutes",showTitle:false,type:"integer",width:_18,editorType:"select",valueMap:this.getTimeValues("minutes")},{name:"startAMPM",showTitle:false,type:"select",width:_20,valueMap:this.getTimeValues(),endRow:true,showIf:function(_46){if(!_46.form)return"false";return _46.form.calendar.twentyFourHourTime?"false":"true"}},{name:"invalidDate",type:"blurb",colSpan:4,visible:false,defaultValue:_1.invalidDateMessage,cellStyle:this.errorStyle||"formCellError",endRow:true}]);if(_12)_3.addList(_5);_3.addList([{name:"endHours",type:"integer",width:"*",startRow:true,title:_1.eventEndDateFieldTitle,showTitle:!_12,editorType:"select",valueMap:this.getTimeValues("hours")},{name:"endMinutes",showTitle:false,type:"integer",width:"*",editorType:"select",valueMap:this.getTimeValues("minutes")},{name:"endAMPM",showTitle:false,type:"select",width:_20,valueMap:this.getTimeValues(),endRow:true,showIf:function(_46){if(!_46.form)return"false";return _46.form.calendar.twentyFourHourTime?"false":"true"}}])}
_3.addList([{name:_1.nameField,title:_1.eventNameFieldTitle,type:"text",colSpan:"*",width:"*",startRow:true},{name:_1.descriptionField,title:_1.eventDescriptionFieldTitle,type:"textArea",colSpan:"*",width:"*",height:50,startRow:true}]);if(this.ds){if(this.ds.destroy)this.ds.destroy();this.ds=null}
this.ds=isc.DataSource.create({fields:_3,clientOnly:true});this.setDataSource(this.ds);var _21=isc.shallowClone(_1.eventEditorFields);this.setFields(_21);this.$172z=true},getTimeValues:function(_47){var _22={},_1=this.calendar;if(_47=="hours"){var _23=_1.twentyFourHourTime,_24=_23?24:12,_25=_23?0:1;for(var i=0;i<_24;i++){var _27=(i+_25<10?"0":"")+(i+_25);_22[""+(i+_25)]=_27}}else if(_47=="minutes"){for(var i=0;i<60;i++){var _28=i<10?"0"+i:""+i;_22[i+""]=_28}}else{_22["am"]=isc.Time.AMIndicator;_22["pm"]=isc.Time.PMIndicator}
return _22},$642:["startHours","startMinutes","startAMPM","endHours","endMinutes","endAMPM"],getCustomValues:function(){if(!this.creator.eventEditorFields)return;var _1=this.calendar,_29=this.$642;var _30=this.creator.eventEditorFields;var _31={};for(var i=0;i<_30.length;i++){var _32=_30[i];if(_32.name&&!_29.contains(_32.name)){_31[_32.name]=this.getValue(_32.name)}}
return _31},setCustomValues:function(_47){if(!this.calendar.eventEditorFields)return;var _29=this.$642;var _30=this.calendar.eventEditorFields;for(var i=0;i<_30.length;i++){var _32=_30[i];if(_32.name&&!_29.contains(_32.name)){this.setValue(_32.name,_47[_32.name])}}},destroy:function(){if(this.ds){if(this.ds.destroy)this.ds.destroy();this.ds=null}
this.calendar=null;return this.Super("destroy",arguments)}});this.eventEditorLayout=this.createAutoChild("eventEditorLayout",isc.addProperties({calendar:this,setDate:function(_47,_45,_48,_8,_49){if(!_48)_48="";if(!_45){_45=isc.DateUtil.dateAdd(_47,"h")}
var _1=this.calendar;this.logicalStartDate=isc.DateUtil.getLogicalDateOnly(_47);this.logicalStartTime=isc.DateUtil.getLogicalTimeOnly(_47);this.logicalEndDate=isc.DateUtil.getLogicalDateOnly(_45);this.logicalEndTime=isc.DateUtil.getLogicalTimeOnly(_45);this.setTitle(_1.$53k(_47,_45));this.currentStart=_47;this.currentEnd=_45;var _4=_1.getDateEditingStyle(),_33=this.items[0];if(_4=="date"||_4=="datetime"){_33.setValue(_1.startDateField,_47.duplicate());_33.setValue(_1.endDateField,_45.duplicate())}else if(_4=="time"){var _34=_1.twentyFourHourTime?"toShortPadded24HourTime":_1.timeFormatter,_35=this.logicalStartTime,_36=this.logicalEndTime;_33.setValue("startHours",_35.getHours());_33.setValue("endHours",_36.getHours());_33.setValue("startMinutes",_35.getMinutes());_33.setValue("endMinutes",_36.getMinutes());if(!_1.twentyFourHourTime){_33.setValue("startAMPM",this.getAMPM(_35.getHours()));_33.setValue("endAMPM",this.getAMPM(_36.getHours()))}}},getHours:function(_47){if(this.creator.twentyFourHourTime)return _47;else return this.creator.$53n(_47)},getAMPM:function(_47){if(_47<12)return"am";else return"pm"},createButtonLayout:function(){this.buttonLayout=this.calendar.createAutoChild("eventEditorButtonLayout");this.saveButton=this.calendar.createAutoChild("saveButton",{title:this.calendar.saveButtonTitle,calendar:this.calendar});this.removeButton=this.calendar.createAutoChild("removeButton",{title:this.calendar.removeButtonTitle,calendar:this.calendar});this.cancelButton=this.calendar.createAutoChild("cancelButton",{title:this.calendar.cancelButtonTitle,calendar:this.calendar});this.buttonLayout.addMembers([this.saveButton,this.removeButton,this.cancelButton]);this.addItem(this.calendar.eventEditor);this.addItem(this.buttonLayout)},setEvent:function(_47){if(!this.buttonLayout){this.createButtonLayout()}
var _33=this.items[0],_1=this.calendar,_2=this.view,_37=_33.getItem(_1.laneNameField),_38=_33.getItem(_1.sublaneNameField),_12=_1.allowDurationEvents,_39=_33.getItem("endType"),_40=_33.getItem(_1.durationField),_41=_33.getItem(_1.durationUnitField);if(!_1.twentyFourHourTime){if(_33.getItem("startAMPM"))_33.showItem("startAMPM");if(_33.getItem("endAMPM"))_33.showItem("endAMPM")}else{if(_33.getItem("startAMPM"))_33.hideItem("startAMPM");if(_33.getItem("endAMPM"))_33.hideItem("endAMPM")}
this.event=_47;if(_1.eventEditorFields){_33.clearErrors(true);_33.setCustomValues(_47)}
if(_37){_37.setValueMap(_1.getLaneMap());_37.setValue(_47[_1.laneNameField]);_37.setDisabled(this.isNewEvent?false:!_1.canEditEventLane(_47,_2));var _42=_2.isTimelineView()||(_2.isDayView()&&_1.showDayLanes);if(_42)_37.show();else _37.hide()}
if(_38){_38.setValueMap(_1.getSublaneMap(_47[_1.laneNameField]));_38.setValue(_47[_1.sublaneNameField]);_38.setDisabled(this.isNewEvent?false:!_1.canEditEventSublane(_47));var _42=_1.useSublanes&&(_2.isTimelineView()||(_2.isDayView()&&_1.showDayLanes));if(_42)_38.show();else _38.hide()}
if(_12){var _43=_47[_1.durationField],_44=_47[_1.durationUnitField]||"minute";if(_43!=null){_39.setValue(_1.eventDurationFieldTitle);_40.setValue(_43);_40.show();_41.setValue(_44);_41.show();if(_1.getDateEditingStyle()=="time"){if(_33.getField("endHours"))_33.hideField("endHours");if(_33.getField("endMinutes"))_33.hideField("endMinutes");if(_33.getField("endAMPM"))_33.hideField("endAMPM")}else{_33.hideField(_1.endDateField)}}else{_39.setValue(_1.eventEndDateFieldTitle);_40.hide();_41.hide();var _45=_47[_1.endDateField];if(_1.getDateEditingStyle()=="time"){_33.showField("endHours");_33.setValue("endHours",_45.getHours());_33.showField("endMinutes");_33.setValue("endMinutes",_45.getMinutes())}else{_33.showField(_1.endDateField);_33.setValue(_1.endDateField,_45)}}}
this.setDate(_1.getEventStartDate(_47),_1.getEventEndDate(_47));if(!_47[_1.nameField]){_47[_1.nameField]=this.getDefaultItemValue(_1.nameField)}
_33.setValue(_1.nameField,_47[_1.nameField]);if(!_47[_1.descriptionField]){_47[_1.descriptionField]=this.getDefaultItemValue(_1.descriptionField)}
_33.setValue(_1.descriptionField,_47[_1.descriptionField]);this.originalStart=this.currentStart.duplicate();this.originalEnd=this.currentEnd.duplicate();if(!this.isNewEvent&&_1.canRemoveEvent(_47,_2))this.removeButton.show();else this.removeButton.hide()},getDefaultItemValue:function(_47){var _33=this.items[0],_46=_33.getItem(_47);return _46&&_46.defaultValue},hide:function(){this.Super('hide',arguments);this.calendar.clearViewSelection();this.calendar.eventEditor&&this.calendar.eventEditor.hideItem("invalidDate")},sizeMe:function(){this.setWidth(this.calendar.mainView.getVisibleWidth());this.setHeight(this.calendar.mainView.getVisibleHeight());this.setLeft(this.calendar.mainView.getLeft())},draw:function(){var _33=this.items&&this.items[0];if(_33&&!_33.$172z)_33.rebuildFieldList();this.Super("draw",arguments)},items:[this.eventEditor]},this.eventEditorLayoutProperties));return this.eventEditorLayout});isc.evalBoundary;isc.B.push(isc.A.hideEventDialog=function isc_Calendar_hideEventDialog(){if(this.eventDialog&&this.eventDialog.isVisible())this.eventDialog.hide()},isc.A.displayEventDialog=function isc_Calendar_displayEventDialog(_1){var _2=this.eventDialog;if(_1&&_2.$193l){_2.placeNear(_2.$193l[0],_2.$193l[1])}
_2.show()},isc.A.addEventOrUpdateEventFields=function isc_Calendar_addEventOrUpdateEventFields(){var _1=this,_2=this.getSelectedView(),_3=_1.eventEditorLayout.isNewEvent,_4=_1.eventEditorLayout.event,_5=_1.eventEditor,_6=_1.getDateEditingStyle(),_7=_5.getValues(),_8=_1.isTimeline()||(_1.dayViewSelected()&&_1.showDayLanes)&&_1.canEditLane,_9=_8?_7[_1.laneNameField]:null,_10=_8&&_1.useSublanes?_7[_1.sublaneNameField]:null,_11=_7["endType"]==this.eventDurationFieldTitle,_12=_11?_7[this.durationField]||1:null,_13=_11?_7[this.durationUnitField]||(_6=="time"?"minute":"hour"):null;var _14=isc.addProperties({},_4,{eventLength:null});_14[this.nameField]=_7[this.nameField];_14[this.descriptionField]=_7[this.descriptionField];if(_9)_14[this.laneNameField]=_9;if(_10)_14[this.sublaneNameField]=_10;if(_6=="date"||_6=="datetime"){var _15=_7[this.startDateField],_16=!_11?_7[this.endDateField]:null;if(!_11&&_16<_15){_5.showItem("invalidDate");return false}
if(!_5.validate())return false;_14[_1.startDateField]=_15;_14.isDuration=_11;if(_11){_14[_1.durationField]=_12;_14[_1.durationUnitField]=_13;delete _14[_1.endDateField]}else{_14[_1.endDateField]=_16;delete _14[_1.durationField];delete _14[_1.durationUnitField]}
_1.eventEditorLayout.currentStart=_15;_1.eventEditorLayout.currentEnd=_1.getEventEndDate(_14);_1.eventEditorLayout.hide();_1.$1116=true}else if(_6=="time"){var _17=_7["startAMPM"],_18=_1.$534(_7["startHours"],_17),_19=_7["startMinutes"];var _20=isc.DateUtil.createDatetime(_1.eventEditorLayout.logicalStartDate,null,null,_18,_19,0,0);var _21=_20.getTime(),_22=isc.DateUtil.getEndOf(_20,"D",false);_14[_1.startDateField]=_20;if(_11){var _23=_22.getTime(),_24=isc.DateUtil.convertPeriodUnit(_12,_13,"ms"),_25=Math.min(_21+_24,_23);if(_25!=_21+_24){_12=isc.DateUtil.convertPeriodUnit(_25-_21,"ms",_13);_12=Math.round(_12)}
_14[this.durationField]=_12;_14[this.durationUnitField]=_13}else{var _26=_7["endHours"],_27=_7["endMinutes"],_28;if(!_1.twentyFourHourTime){_28=_7["endAMPM"];_26=_1.$534(_26,_28)}
if((_26<_18&&_26+_27!=0)||(_26==_18&&_27<=_19)){_5.showItem("invalidDate");return false}
if(_26==0&&_27==0)_26=24;if(!_5.validate())return false;var _29=isc.DateUtil.getLogicalDateOnly(_20);var _30=isc.DateUtil.createDatetime(_29,null,null,_26,_27,0,0);if(_30.getTime()>_22.getTime()){}
if(isc.DateUtil.compareDates(_20,_30)==0){_5.showItem("invalidDate");return false}
_14[_1.endDateField]=_30;_1.$1116=true}}
if(_2.isTimelineView()){if(_4[_1.leadingDateField]&&_4[_1.startDateField]!=_14[_1.startDateField]){var _31=_4[_1.leadingDateField].duplicate();var _32=isc.DateUtil.getPeriodLength(_4[_1.startDateField],_14[_1.startDateField],"mn");_31.setMinutes(_31.getMinutes()+_32);_14[_1.leadingDateField]=_31}
if(_4[_1.trailingDateField]&&_4[_1.endDateField]!=_14[_1.endDateField]){var _33=_4[_1.trailingDateField].duplicate();var _32=isc.DateUtil.getPeriodLength(_4[_1.endDateField],_14[_1.endDateField],"mn");_33.setMinutes(_33.getMinutes()+_32);_14[_1.trailingDateField]=_33}}
var _34=isc.addProperties({},_5.getCustomValues());_1.eventEditorLayout.hide();if(!_3){_1.updateCalendarEvent(_4,_14,_34)}else{_1.addCalendarEvent(_14,_34,false)}
return true},isc.A.setDateLabel=function isc_Calendar_setDateLabel(){var _1=this.getSelectedView();if(!_1||!this.dateLabel)return;var _2=_1.isDayView()?null:_1.endDate;var _3=this.getDateLabelText(_1.viewName,_1.logicalDate||_1.startDate,_1.logicalEndDate||_1.endDate);this.dateLabel.setContents(_3)},isc.A.getDateLabelText=function isc_Calendar_getDateLabelText(_1,_2,_3){var _4=(_1?this.getView(_1):null)||this.getSelectedView();var _5=_4&&_4.getDateLabelText(_2?isc.DateUtil.getLogicalDateOnly(_2):null,_3?isc.DateUtil.getLogicalDateOnly(_3):null);return _5||""},isc.A.dayViewSelected=function isc_Calendar_dayViewSelected(){if(this.mainView&&!this.mainView.isA("TabSet"))return this.mainView.viewName=="day";else return this.$567=="day"},isc.A.weekViewSelected=function isc_Calendar_weekViewSelected(){if(this.mainView&&!this.mainView.isA("TabSet"))return this.mainView.viewName=="week";else return this.$567=="week"},isc.A.monthViewSelected=function isc_Calendar_monthViewSelected(){if(this.mainView&&!this.mainView.isA("TabSet"))return this.mainView.viewName=="month";else return this.$567=="month"},isc.A.timelineViewSelected=function isc_Calendar_timelineViewSelected(){if(this.mainView&&!this.mainView.isA("TabSet"))return this.mainView.viewName=="timeline";else return this.$567=="timeline"},isc.A.cancelEditing=function isc_Calendar_cancelEditing(){var _1=this.getSelectedView();if(_1&&_1.clearSelection)_1.clearSelection();if(this.eventDialog&&this.eventDialog.isVisible()){this.hideEventDialog()}
if(this.eventEditor&&this.eventEditor.isVisible()){this.hideEventDialog()}},isc.A.showEventDialog=function isc_Calendar_showEventDialog(_1,_2){if(_2==null)_2=(_1==null);this.$53l(_1,_2)},isc.A.showNewEventDialog=function isc_Calendar_showNewEventDialog(_1){_1=_1||{};this.showEventDialog(_1,true)},isc.A.$53l=function isc_Calendar__showEventDialog(_1,_2){var _3=this.getEventDialog();_3.eventWindow=null;_3.event=null;_3.isNewEvent=_2;_3.items[0].createFields();_3.moveTo(0,-9999);if(!_3.isDrawn())_3.draw();else _3.redraw();var _4=this.getSelectedView();if(_2)_1=_4.getNewEventDefaults(_1);var _5=_4.getCurrentEventCanvas(_1);var _6={};if(_5){if(this.bringEventsToFront)_5.bringToFront();var _7=_5.getPageRect();_6.left=Math.max(_7[0],_4.body.getPageLeft());_6.top=Math.max(_7[1],_4.body.getPageTop())}else{_6=_4.getEditDialogPosition(_1)}
_3.setEvent(_5?_5.event:_1);if(this.eventEditorLayout){this.eventEditorLayout.event=_1;this.eventEditorLayout.isNewEvent=_2}
var _8=this.getPageTop()+this.getHeight();var _9=_3.getVisibleHeight();var _10=_6.top;if(_10+_9>=_8){_10=_8-(_9+2)}
_3.$193l=[_6.left,_10];_3.placeNear(_3.$193l[0],_3.$193l[1]);_3.show();_3.bringToFront();_3.form.setDisabled(!this.canEditEvent(_1,_4));return},isc.A.visibilityChanged=function isc_Calendar_visibilityChanged(_1){if(!_1)this.hideEventDialog()},isc.A.showEventEditor=function isc_Calendar_showEventEditor(_1,_2){if(_2==null)_2=(_1==null);this.$53j(_1,_2)},isc.A.showNewEventEditor=function isc_Calendar_showNewEventEditor(_1){this.showEventEditor(_1,true)},isc.A.$53j=function isc_Calendar__showEventEditor(_1,_2){var _3=this.getEventEditorLayout();if(!_3.isDrawn()){_3.setVisibility(isc.Canvas.INHERIT);_3.draw()}
_3.setWidth(this.mainView.getVisibleWidth());_3.setHeight(this.mainView.getVisibleHeight());_3.setPageLeft(this.mainView.getPageLeft());_3.setPageTop(this.getPageTop());_3.isNewEvent=_2;_3.view=this.getSelectedView();var _4=this.getDateEditingStyle();if(this.eventEditor.dateEditingStyle!=_4){this.eventEditor.dateEditingStyle=_4;this.eventEditor.rebuildFieldList()}
if(_1){_3.setEvent(_1)}else{this.eventEditor.clearValues();_3.setTitle(this.newEventWindowTitle);if(this.eventDialog&&this.eventDialog.isVisible()){if(this.eventEditorFields){_3.items[0].setCustomValues(this.eventDialog.items[0].getCustomValues())}
var _5=this.eventDialog.items[0].getValue(this.nameField);var _6=this.eventDialog.items[0].getItem(this.laneNameField);var _7=_6?_6.getValue():null;var _8=new Date();_3.setDate(_8,this.eventDialog.currentEnd,_5,_7)}}
this.hideEventDialog();var _9=this.canEditEvent(_1,this.getSelectedView());this.eventEditor.setDisabled(!_9);_3.saveButton.setDisabled(!_9);_3.show()},isc.A.$53k=function isc_Calendar__getEventDialogTitle(_1,_2){var _3=isc.DateUtil.getShortDayNames(),_4=isc.DateUtil.getShortMonthNames(),_5=isc.Time.toShortTime(_1,this.timeFormatter),_6=isc.Time.toShortTime(_2,this.timeFormatter),_7;if(this.isTimeline()){var _8=(isc.DateUtil.compareLogicalDates(_1,_2)!=0);if(_8){_7=_3[_1.getDay()]+", "+_4[_1.getMonth()]+" "+_1.getDate()+", "+_5+" - "+_3[_2.getDay()]+", "+_4[_2.getMonth()]+" "+_2.getDate()+", "+_6;return _7}}
var _9=_5+" - "+_6;return _3[_1.getDay()]+", "+_4[_1.getMonth()]+" "+_1.getDate()+", "+_9},isc.A.$53n=function isc_Calendar__to12HrNotation(_1){if(_1==0)return 12;else if(_1<13)return _1;else return _1-12},isc.A.$534=function isc_Calendar__to24HourNotation(_1,_2){_1=parseInt(_1);if(_2==null)return _1;else if(_2.toLowerCase()=="am"&&_1==12){return 0}else if(_2.toLowerCase()=="pm"&&_1<12){return _1+12}else{return _1}},isc.A.$116j=function isc_Calendar__getCellCSSText(_1,_2,_3,_4){var _5=this.getCellDate(_3,_4,_1);if(!_5)return null;var _6=this.getDateCSSText?this.getDateCSSText(_5,_3,_4,_1):null;if(_6)return _6;if(this.todayBackgroundColor){var _7=isc.DateUtil.$179o(new Date());var _8=isc.DateUtil.compareLogicalDates(_5,_7);if((_8!==false&&_8==0)){return"background-color:"+this.todayBackgroundColor+";"}}
return null},isc.A.getDateHeaderTitle=function isc_Calendar_getDateHeaderTitle(_1,_2,_3,_4){return null},isc.A.getCellDate=function isc_Calendar_getCellDate(_1,_2,_3){_3=_3||this.getSelectedView();var _4;if(_1==null&&_2==null){_1=_3.getEventRow();_2=_3.getEventCol()}
var _5=_3.frozenFields?_3.frozenFields.length:0;if(_3.isDayView()||_3.isWeekView()||_3.isTimelineView()){var _6=_2-_5;_4=_6>=0?_3.getCellDate(_1,_6):null}else if(_3.isMonthView()){if(_2>=_3.getFields().length)
_2=_3.getFields().length-1;var _7=_3.data.get(_1);var _8=_3.getField(_2).$66b;if(_7&&_7["date"+_8]!=null){_4=_7["date"+_8].duplicate();_4.setHours(0);_4.setMinutes(0);_4.setSeconds(0)}}else{return}
return _4},isc.A.getDateFromPoint=function isc_Calendar_getDateFromPoint(_1,_2,_3,_4){_4=_4||this.getSelectedView();if(_3==null)_3=true;if(_4.getDateFromPoint)return _4.getDateFromPoint(_1,_2,null,_3);if(_1==null&&_2==null){_1=_4.body.getOffsetX();_2=_4.body.getOffsetY()}
var _5=_4.body.getEventColumn(_1),_6=_4.body.getEventRow(_2),_7;if(_4.isMonthView()){_7=this.getCellDate(_6,_5,_4)}else{return}
return _7},isc.A.getLane=function isc_Calendar_getLane(_1,_2){if(!_1)return null;_2=_2||this.getSelectedView();if(_2.getLane)return _2.getLane(_1);return null},isc.A.getEventLane=function isc_Calendar_getEventLane(_1,_2){if(!_1)return null;return this.getLane(_1[this.laneNameField],_2)},isc.A.getSublane=function isc_Calendar_getSublane(_1,_2,_3){if(!_1)return null;_3=_3||this.getSelectedView();if(_3.getSublane)return _3.getSublane(_1,_2);return null},isc.A.getEventSublane=function isc_Calendar_getEventSublane(_1,_2){if(!_1)return null;return this.getSublane(_1[this.laneNameField],_1[this.sublaneNameField],_2)},isc.A.getLaneFromPoint=function isc_Calendar_getLaneFromPoint(_1,_2,_3){_3=_3||this.getSelectedView();if(!_3.usesLanes())return null;if(_3.getLaneFromPoint)return _3.getLaneFromPoint(_1,_2);return null},isc.A.getSublaneFromPoint=function isc_Calendar_getSublaneFromPoint(_1,_2,_3){_3=_3||this.getSelectedView();if(_3.getSublaneFromPoint)return _3.getSublaneFromPoint(_1,_2);return null},isc.A.getDateLeftOffset=function isc_Calendar_getDateLeftOffset(_1,_2){if(_2&&_2.getDateLeftOffset)return _2.getDateLeftOffset(_1)},isc.A.currentViewChanged=function isc_Calendar_currentViewChanged(_1){},isc.A.getDayBodyHTML=function isc_Calendar_getDayBodyHTML(_1,_2,_3,_4,_5){if(!_1||!_2||_2.length==0)return"";var _6=_3.monthView,_7=_1.getDay(),_8=_6.getRecord(_4),_9=_6.getRowHeight(_8,_4),_10="",_11=null,_12="";for(var i=0;i<_2.length;i++){if(i>0)_10+="<br>";_10+="<nobr>"+_2[i].name+"</nobr>";var _14=isc.Canvas.measureContent(_10,this.dayBodyBaseStyle,true);if(_14>=_9){_11=i-1;break}}
if(_11==null)_11=_2.length;for(var i=0;i<_11;i++){var _15=this.getEventHeaderHTML(_2[i],_6);if(!this.isPrinting){var _16="<a href='javascript:"+this.ID+".monthViewEventClick("+_4+","+_5+","+i+");' class='"+this.calMonthEventLinkStyle+"'>";_12+=_16+_15+"</a><br/>"}else{_12+=_15+"<br/>"}}
if(_11!=_2.length&&!this.isPrinting){var _17="<a href='javascript:"+this.ID+".monthMoreEventsLinkClick("+_4+","+_5+","+_11+");' class='"+this.calMonthEventLinkStyle+"'>",_18=this.monthMoreEventsLinkTitle,_15=_18.evalDynamicString(this,{eventCount:(_2.length-i)});_12+=_17+_15+"</a><br/>"}
return _12},isc.A.monthViewEventClick=function isc_Calendar_monthViewEventClick(_1,_2,_3){if(this.monthView.isDisabled())return;var _4=this.monthView.getEvents(_1,_2);var _5=_4[_3];if(this.eventClick(_5,"month"))this.showEventEditor(_5)},isc.A.$167z=function isc_Calendar__getMonthMoreEventsMenu(){if(!this.monthMoreEventsMenu){this.monthMoreEventsMenu=this.createAutoChild("monthMoreEventsMenu")}
return this.monthMoreEventsMenu},isc.A.monthMoreEventsLinkClick=function isc_Calendar_monthMoreEventsLinkClick(_1,_2,_3){var _4=this,_5=this.monthView,_6=_5&&_5.getEvents(_1,_2)||[],_7=[];for(var i=_3;i<_6.length;i++){var _9=_6[i];_7.add({title:_9[this.nameField],event:_9,calendar:_4,click:function(){if(this.calendar.eventClick(this.event,"month")){this.calendar.showEventEditor(this.event)}}})}
var _10=this.$167z();_10.setItems(_7);_10.positionContextMenu();_10.show()},isc.A.getMonthViewHoverHTML=function isc_Calendar_getMonthViewHoverHTML(_1,_2){if(_2!=null){var _3="";var _4=this.creator||this;for(var i=0;i<_2.length;i++){var _6=isc.Time.toShortTime(_4.getEventStartDate(_2[i]),_4.timeFormatter,true);_3+="<nobr>"+_6+" "+_2[i][_4.nameField]+"<nobr/><br/>"}
return _3}},isc.A.getDayHeaderHTML=function isc_Calendar_getDayHeaderHTML(_1,_2,_3,_4,_5){return _1.getDate()},isc.A.dayBodyClick=function isc_Calendar_dayBodyClick(_1,_2,_3,_4,_5){return true},isc.A.dayHeaderClick=function isc_Calendar_dayHeaderClick(_1,_2,_3,_4,_5){return true},isc.A.eventClick=function isc_Calendar_eventClick(_1,_2){return true},isc.A.$129v=function isc_Calendar__eventCanvasClick(_1,_2){var _3=_1.event,_4=_1.calendarView,_5=_4.isWeekView(),_6=(_2?true:this.eventClick(_3,_4.viewName))!=false;if(!_2){if(this.canSelectEvents){if(isc.EH.modifierKeyDown()){if(!this.getSelection().isSelected(_3)){this.selectEvent(_3,_1)}else{this.deselectEvent(_3,_1)}}else{this.selectSingleEvent(_3,_1)}
return}else if(this.bringEventsToFront){_1.bringToFront()}}
if(_6){this.clearViewSelection();if(!_4.isTimelineView()){var _7=this.getEventStartDate(_3);var _8=(_4.frozenFields?_4.frozenFields.length:0);var _9=_5?_7.getDay()-this.firstDayOfWeek+_8:_8;if(_5&&this.showWeekends==false)_9--;var _10=_7.getHours()*this.getRowsPerHour(_4)}
if(!this.canEditEvent(_3,_4)){this.showEventEditor(_3)}else{this.showEventDialog(_3)}
return isc.EH.STOP_BUBBLING}},isc.A.$195n=function isc_Calendar__eventCanvasKeyPress(_1,_2){var _3=_1.calendarView,_4=_1.$172y;if(_2){if(_2=="Enter"){if(_4.canEdit)this.$129v(_1,true)}else if(_2=="Backspace"||_2=="Delete"){if(_4.showCloseButton){var _5=this.getSelectedEvents();for(var i=0;i<_5.length;i++){var _7=_3.getCurrentEventCanvas(_5[i])
this.$174b(_7)}}}else if(_2=="Tab"){this.$195m=true}}},isc.A.eventDoubleClick=function isc_Calendar_eventDoubleClick(_1,_2){return true},isc.A.$195c=function isc_Calendar__eventCanvasDoubleClick(_1){var _2=_1.event,_3=_1.calendarView,_4=_3.isWeekView(),_5=this.eventDoubleClick(_2,_3.viewName)!=false;if(this.canSelectEvents){this.$129v(_1,true)}else if(this.bringEventsToFront){_1.bringToFront()}},isc.A.eventRemoveClick=function isc_Calendar_eventRemoveClick(_1,_2){return true},isc.A.eventMoved=function isc_Calendar_eventMoved(_1,_2,_3){return true},isc.A.eventResized=function isc_Calendar_eventResized(_1,_2){return true},isc.A.timelineEventMoved=function isc_Calendar_timelineEventMoved(_1,_2,_3,_4){return true},isc.A.timelineEventResized=function isc_Calendar_timelineEventResized(_1,_2,_3){return true},isc.A.getValidSnapDate=function isc_Calendar_getValidSnapDate(_1,_2){if(this.isTimeline()){}else{var _3=this.getSnapGapPixels();var _4=((_1.getHours()*60)+_1.getMinutes())%_3;var _5=(_2.getHours()*60)+_2.getMinutes();var _6=Math.round((_5-_4)/_3);var _7=(_6*_3)+_4;var _8=Math.floor(_7/60),_9=_7%60;_2.setHours(_8);_2.setMinutes(_9)}
return _2},isc.A.selectTab=function isc_Calendar_selectTab(_1){if(this.mainView&&this.mainView.isA("TabSet")&&this.mainView.tabs.getLength()>_1){this.mainView.selectTab(_1);return true}else{return false}},isc.A.parentResized=function isc_Calendar_parentResized(){this.Super('parentResized',arguments);if(this.eventEditorLayout&&this.eventEditorLayout.isVisible())this.eventEditorLayout.sizeMe()},isc.A.dateChanged=function isc_Calendar_dateChanged(){return true},isc.A.getActiveDay=function isc_Calendar_getActiveDay(){var _1=this.getActiveTime();if(_1)return _1.getDay()},isc.A.getActiveTime=function isc_Calendar_getActiveTime(){var _1=this.ns.EH,_2=this.getSelectedView();var _3=_2.getEventRow();var _4=_2.getEventColumn();return this.getCellDate(_3,_4,_2)},isc.A.setTimelineRange=function isc_Calendar_setTimelineRange(_1,_2,_3){var _4=this.timelineView;var _5=this.headerLevels&&this.headerLevels.length>1;var _6=!this.showWeekends||this.shouldShowDate!=null;_1=isc.DateUtil.getStartOf(_1,this.timelineGranularity,false,this.firstDayOfWeek);if(!_2){var _7=Math.round(isc.DateUtil.getPeriodLength(_4.startDate,_4.endDate,this.timelineGranularity));_2=isc.DateUtil.dateAdd(_1,this.timelineGranularity,_7,1,null,null,this.firstDayOfWeek)}
var _8=Math.round(isc.DateUtil.getPeriodLength(_1,_2,this.timelineGranularity)/this.timelineUnitsPerColumn);if(_8!=this.timelineColumnSpan){this.timelineColumnSpan=_8;if(this.timelineView)this.timelineView.setTimelineRange(_1,_2)}else{_4.setChosenDate(_1)}
if(_3)this.fireCallback(_3)},isc.A.setResolution=function isc_Calendar_setResolution(_1,_2,_3,_4,_5){this.timelineUnitsPerColumn=_4||1;if(_2)this.timelineGranularity=_2;if(_1)this.headerLevels=_1;if(_1.length>0){this.timelineGranularity=_1[_1.length-1].unit}
var _6=this.timelineView;var _7=_2;var _8=isc.DateUtil.dateAdd(this.startDate,_7,_3,1,null,null,this.firstDayOfWeek);var _9=Math.round(isc.DateUtil.getPeriodLength(this.startDate,_8,this.timelineGranularity)/this.timelineUnitsPerColumn);if(_9!=this.timelineColumnSpan){this.timelineColumnSpan=_9}
if(_6)_6.setChosenDate(this.startDate);if(_5)this.fireCallback(_5)},isc.A.getEventLength=function isc_Calendar_getEventLength(_1,_2){var _3=_1.eventLength,_4=isc.DateUtil;if(_3==null){_3=_4.getPeriodLength(this.getEventStartDate(_1),this.getEventEndDate(_1));_1.eventLength=_3}
if(_2){return _4.convertPeriodUnit(_1.eventLength,"ms",_2)}
return _1.eventLength},isc.A.canEditEventLane=function isc_Calendar_canEditEventLane(_1,_2){_2=_2||this.getSelectedView();if(!_2.usesLanes())return false;var _3=_1[this.canEditLaneField]!=null?_1[this.canEditLaneField]:this.canEditLane!=false;return _3},isc.A.canEditEventSublane=function isc_Calendar_canEditEventSublane(_1,_2){if(!this.useSublanes)return false;var _3=_1[this.canEditSublaneField];if(_3==null)_3=(this.canEditSublane!=false);return _3},isc.A.eventRepositionMove=function isc_Calendar_eventRepositionMove(_1,_2,_3){var _4=this.getEventStartDate(_2),_5=this.getEventEndDate(_2);if(this.shouldDisableDate(_4,_3)||this.shouldDisableDate(_5,_3)){return false}
return true},isc.A.eventRepositionStop=function isc_Calendar_eventRepositionStop(_1,_2,_3,_4){return true},isc.A.eventResizeMove=function isc_Calendar_eventResizeMove(_1,_2,_3,_4){var _5=this.getEventStartDate(_2),_6=this.getEventEndDate(_2);if(_5.getTime()==_6.getTime())return false;_6.setTime(_6.getTime()-1);if(((_4.$1172||_4.$159n)&&this.shouldDisableDate(_5,_3))||((_4.$131q||_4.$131g)&&this.shouldDisableDate(_6,_3))){return false}
return true},isc.A.eventResizeStop=function isc_Calendar_eventResizeStop(_1,_2,_3,_4){return true},isc.A.checkForOverlap=function isc_Calendar_checkForOverlap(_1,_2,_3,_4,_5,_6){var _7={},_8=this.startDateField,_9=this.endDateField;_7[_8]=_4.duplicate();_7[_9]=_5.duplicate();_7[this.laneNameField]=_6;var _10=this.data;if(_6){_10=this.getLaneEvents(_6,_1)}
var _11=_1.findOverlappingEvents(_3,_7,null,(_6!=null),_10);if(_11.length==0){return false}else if(_11.length>1){return true}else{var _12=_11[0];if((this.equalDatesOverlap==false?_5>_12[_8]:_5>=_12[_8])&&_4<_12[_8])
{_5=_12[_8].duplicate();_4=_5.duplicate();_4.setMinutes(_4.getMinutes()-this.getEventLength(_3,"minute"));return[_4,_5]}else if((this.equalDatesOverlap==false?_4<_12[_9]:_4<=_12[_9])&&_5>_12[_9])
{_4=_12[_9].duplicate();_5=_4.duplicate();_5.setMinutes(_5.getMinutes()+this.getEventLength(_3,"minute"));return[_4,_5]}else{return true}}},isc.A.getPrintHTML=function isc_Calendar_getPrintHTML(_1,_2){isc.$238m=true;if(_2){this.delayCall("asyncGetPrintHTML",[_1,_2]);return null}else{return this.asyncGetPrintHTML(_1,_2)}},isc.A.asyncGetPrintHTML=function isc_Calendar_asyncGetPrintHTML(_1,_2){var _3=this.controlsBar.getHandle().innerHTML;var _4=this.getSelectedView();_3+=_4.getPrintHTML();if(isc.isA.Function(_2))_2(_3);if(_2&&isc.isA.Function(_2.callback))_2.callback(_3);return _3});isc.B._maxIndex=isc.C+249;isc.A=isc.Calendar;isc.B=isc._allFuncs;isc.C=isc.B._maxIndex;isc.D=isc._funcClasses;isc.D[isc.C]=isc.A.Class;isc.B.push(isc.A.$1833=function isc_c_Calendar__getAsDisplayDate(_1){if(!isc.Time.$854){return new Date(_1.getFullYear(),_1.getMonth(),_1.getDate())}
var _2=_1.$68g(isc.Time.getUTCHoursDisplayOffset(_1),isc.Time.getUTCMinutesDisplayOffset(_1));return new Date(_2.getUTCFullYear(),_2.getUTCMonth(),_2.getUTCDate())});isc.B._maxIndex=isc.C+1;isc.ClassFactory.defineClass("EventWindow","Window");isc.EventWindow.changeDefaults("resizerDefaults",{overflow:"hidden",height:6,snapTo:"B",canDragResize:true});isc.EventWindow.changeDefaults("headerDefaults",{layoutMargin:0,layoutLeftMargin:3,layoutRightMargin:3});isc.A=isc.EventWindow.getPrototype();isc.B=isc._allFuncs;isc.C=isc.B._maxIndex;isc.D=isc._funcClasses;isc.D[isc.C]=isc.A.Class;isc.A.autoDraw=false;isc.A.minHeight=5;isc.A.minWidth=5;isc.A.showHover=true;isc.A.canHover=true;isc.A.hoverAutoFitWidth=true;isc.A.hoverAutoFitMaxWidth=200;isc.A.canDragResize=true;isc.A.canDragReposition=true;isc.A.resizeFrom=["B"];isc.A.showShadow=false;isc.A.showEdges=false;isc.A.showHeaderBackground=false;isc.A.useBackMask=false;isc.A.keepInParentRect=true;isc.A.headerProperties={padding:0,margin:0,height:14};isc.A.closeButtonProperties={height:10,width:10};isc.A.bodyColor=null;isc.A.showHeaderIcon=false;isc.A.showMinimizeButton=false;isc.A.showMaximimumButton=false;isc.A.showFooter=true;isc.A.baseStyle="eventWindow";isc.A.dragAppearance="none";isc.A.$125c={overflow:"hidden",defaultLayoutAlign:"center",height:7};isc.B.push(isc.A.initWidget=function isc_EventWindow_initWidget(){this.addProperties(this.creator.viewProps);this.addProperties(this.creator.gridProps);this.addProperties(this.creator.timelineViewProperties);this.descriptionText=this.event[this.calendar.descriptionField];this.showHeader=this.calendar.showEventHeaders;this.showBody=this.calendar.showEventDescriptions;this.footerProperties=isc.addProperties({dragTarget:this.eventDragCanvas},this.footerProperties,this.$125c);if(this.bodyConstructor==null)this.bodyConstructor=isc.HTMLFlow;if(this.calendar.showEventDescriptions!=false){this.bodyProperties=isc.addProperties({},this.bodyProperties,{contents:this.descriptionText,valign:"top",overflow:"hidden"})}
if(this.calendar.showEventBody==false){this.showBody=false;this.showTitle=false}
this.Super("initWidget",arguments);if(this.calendar.showEventDescriptions==false){var _1=isc.Label.create({autoDraw:true,border:"0px",padding:3,height:1,width:1,backgroundColor:this.event.backgroundColor,textColor:this.event.textColor,setContents:function(_2){this.$116k=_2;this.Super("setContents",arguments)},canHover:true,showHover:true,eventCanvas:this,getHoverHTML:function(){return this.eventCanvas.getHoverHTML()},redrawWithParent:true});_1.addMember=function(_2){this.addChild(_2)};_1.addChild(this.resizer);this.addChild(_1);this.header=_1;this.$128l=_1;this.$77n=true}
this.setEventStyle(this.baseStyle)},isc.A.getEvent=function isc_EventWindow_getEvent(){return this.event},isc.A.getCalendar=function isc_EventWindow_getCalendar(){return this.calendar},isc.A.getCalendarView=function isc_EventWindow_getCalendarView(){return this.calendarView},isc.A.setDragProperties=function isc_EventWindow_setDragProperties(_1,_2,_3){this.canDragResize=_2==null?true:_2;if(_1==null)_1=true;this.dragTarget=_3;this.setCanDragReposition(_1,_3);if(this.canDragResize){if(!this.resizer)this.makeFooter();else if(!this.resizer.isVisible())this.resizer.show()}else{if(this.resizer&&this.resizer.isVisible())this.resizer.hide()}},isc.A.setEventStyle=function isc_EventWindow_setEventStyle(_1,_2,_3){_2=_2||this.headerStyle||_1+"Header";_3=_3||this.bodyStyle||_1+"Body";this.baseStyle=_1;this.styleName=_1;this.bodyStyle=_3;this.headerStyle=_2;this.setStyleName(_1);if(this.header)this.header.setStyleName(this.headerStyle);if(this.headerLabel){this.headerLabel.setStyleName(this.headerStyle)}else{this.headerLabelProperties=isc.addProperties({},this.headerLabelProperties,{styleName:this.headerStyle})}
if(this.body)this.body.setStyleName(this.bodyStyle);if(this.$128l)this.$128l.setStyleName(this.bodyStyle)},isc.A.mouseUp=function isc_EventWindow_mouseUp(){return isc.EH.STOP_BUBBLING},isc.A.makeFooter=function isc_EventWindow_makeFooter(){if(!this.showFooter||this.canDragResize==false)return;var _1={dragTarget:this.dragTarget,styleName:this.baseStyle+"Resizer"};if(this.$77n)_1.snapTo="B";this.resizer=this.createAutoChild("resizer",_1);if(this.$77n){this.header.addChild(this.resizer)}else{this.addChild(this.resizer)}
if(this.resizer)this.resizer.bringToFront()},isc.A.setDescriptionText=function isc_EventWindow_setDescriptionText(_1){_1=_1||"";if(this.calendar.getDescriptionText){_1=this.calendar.getDescriptionText(this.event)}
if(this.body){this.descriptionText=_1;this.body.setContents(_1)}else{this.descriptionText=_1;if(this.$734){this.$734.setWidth("100%");this.$734.setContents(_1)}else if(this.calendar.showEventDescriptions==false){this.$128l.setContents(_1);this.$128l.redraw()}}},isc.A.click=function isc_EventWindow_click(){if(this.$53u)return;if(this.$67e){this.$67e=null;return}
var _1=this.calendar;if(_1.bringEventsToFront)this.bringToFront();var _2=_1.eventClick(this.event,this.$53i?"week":"day");if(_2){if(!_1.canEditEvent(this.event,this.calendarView))return;_1.clearViewSelection();var _3=(this.$53i&&_1.weekView.isLabelCol(0)?1:0);var _4=this.$53i?_1.getEventStartDate(this.event).getDay()-
_1.firstDayOfWeek+_3:_3;if(this.$53i&&_1.showWeekends==false)_4--;_1.showEventDialog(this.event)}},isc.A.mouseDown=function isc_EventWindow_mouseDown(){if(this.dragTarget)this.dragTarget.eventCanvas=this;this.calendar.hideEventDialog();return isc.EH.STOP_BUBBLING},isc.A.renderEvent=function isc_EventWindow_renderEvent(_1,_2,_3,_4){var _5=this.calendar,_6=this.event;if(isc.isA.Number(_3)&&isc.isA.Number(_4)){this.resizeTo(Math.round(_3),Math.round(_4))}
if(isc.isA.Number(_1)&&isc.isA.Number(_2)){this.moveTo(Math.round(_2),Math.round(_1))}
var _7=_5.getEventHeaderHTML(_6,this.calendarView),_8=_7,_9="";if(_6.headerBackgroundColor)_9+="backgroundColor: "+_6.headerBackgroundColor+";";if(_6.headerTextColor)_9+="backgroundColor: "+_6.headerTextColor+";";if(_6.headerBorderColor)_9+="border-color: "+_6.headerBorderColor+";";if(_9!="")_8="<span style='"+_9+"'>"+_8+"<span>";this.setTitle(_8);this.updateColors(_7);if(this.$77n){this.header.resizeTo(Math.round(_3),Math.round(_4));this.header.setContents(_8)}
if(!this.isDrawn())this.draw();this.show();this.bringToFront()},isc.A.updateColors=function isc_EventWindow_updateColors(_1){var _2=this.calendar,_3=this.event,_4=this.header,_5=_4?_4.getMember?_4.getMember(0):_4:null,_6=_5,_7=_1||_2.getEventHeaderHTML(_3,this.calendarView);if(!_3)return;if(_5&&_5.children&&_5.children[0]){var _8=_5.children[0].members;if(_8&&_8.length>0)_6=_8[0]}
if(_3.backgroundColor){this.setBackgroundColor(_3.backgroundColor);if(this.body)this.body.setBackgroundColor(_3.backgroundColor)}else{this.backgroundColor=null;if(this.isDrawn()&&this.getStyleHandle()){this.getStyleHandle().backgroundColor=null}
if(this.body){this.body.backgroundColor=null;if(this.body.isDrawn()&&this.body.getStyleHandle()){this.body.getStyleHandle().backgroundColor=null}}
if(_6){_6.backgroundColor=null;if(_6.isDrawn()&&_6.getStyleHandle()){_6.getStyleHandle().backgroundColor=null}}}
if(_3.textColor){this.setTextColor(_3.textColor);if(this.body){var _9="color:"+_3.textColor+";"
this.body.setTextColor(_3.textColor);this.body.setContents("<span style='"+_9+"'>"+_3[_2.descriptionField]||"</span>")}}else{if(this.textColor){this.setTextColor(null);if(this.isDrawn()&&this.getStyleHandle()){this.getStyleHandle().color=null}
if(this.body){this.body.setTextColor(null);this.body.setContents(_3[_2.descriptionField])}
if(_6){_6.setTextColor(null);_6.setContents(_7)}
if(this.$128l){this.$128l.setTextColor(null);this.$128l.setContents(_7)}}}
if(this.header){var _10,_11;if(_2.showEventDescriptions==false){_10=_3.backgroundColor;_11=_3.textColor}else{_10=_3.headerBackgroundColor;_11=_3.headerTextColor}
if(_10){this.header.setBackgroundColor(_10);if(_6)_6.setBackgroundColor(_10)}else{this.header.backgroundColor=null;if(this.isDrawn()&&this.header.getStyleHandle()){this.header.getStyleHandle().backgroundColor=null}
if(_6){_6.backgroundColor=null;if(_6.getStyleHandle()){_6.getStyleHandle().backgroundColor=null}}}
if(_11){this.header.setTextColor(_11);var _9="color:"+_11+";",_12=_2.showEventDescriptions==false?this.header.$116k:_7,_13="<span style='"+_9+"'>"+_12+"</span>";if(!_6){if(this.header.setContents)this.header.setContents(_13)}else{_6.setTextColor(_11);_6.setContents(_13)}}else{if(this.header.textColor){this.header.setTextColor(null);if(this.isDrawn()&&this.header.getStyleHandle()){this.header.getStyleHandle().color=null}
if(_6){_6.setTextColor(null);if(_6.isDrawn()&&_6.getStyleHandle()){_6.getStyleHandle().color=null}}}}
this.markForRedraw()}},isc.A.getPrintHTML=function isc_EventWindow_getPrintHTML(_1,_2){var _3=isc.StringBuffer.create(),_4=this.calendar,_5=_4.isTimeline(),_6=this.parentElement,_7=_6.grid,_8=40+_7.getHeaderHeight(),_9=this.getTop(),_10=_6.getPageTop(),_11=(_9)+_8+1,_12=_6.$26a,_13=_7.getLeft()+_6.getLeft()+(_7.getEventLeft?_7.getEventLeft(this.event):_4.getEventLeft(this.event,_7)),_14=this.getVisibleWidth(),_15=this.getVisibleHeight()-2,i=(_1&&_1.i?_1.i:1);var _17=_4.getEventStartCol(this.event,this,this.calendarView),_18=_4.getEventEndCol(this.event,this,this.calendarView);if(_5){_13+=(14+((_17-1)*2));_14+=_18-_17}else{_13+=_7.$53i?6:8}
var _19=_5?this.baseStyle:this.body.styleName;_3.append("<div class='",_19,"' ","style='border: 1px solid grey; vertical-align: ",(_4.showEventDescriptions?"top":"middle"),"; ",(_5?"overflow:hidden; ":""),"position: absolute; ","left:",_13,"; top:",_11,"; width: ",_14,"; height: ",_15,"; ","z-index:",i+2,";'>");if(_4.showEventDescriptions){_3.append(this.title,"<br>",this.event[_4.descriptionField])}else{_3.append(this.title)}
_3.append("</div>");var _20=_3.release(false);return _20},isc.A.getHoverHTML=function isc_EventWindow_getHoverHTML(){return this.calendar.$141h(this.event,this,this.calendarView)},isc.A.closeClick=function isc_EventWindow_closeClick(){var _1=this.calendar;if(_1.eventRemoveClick(this.event)==false){this.$67e=true;return}
this.Super("closeClick",arguments);this.calendar.removeEvent(this.event,true);this.$53u=true},isc.A.parentResized=function isc_EventWindow_parentResized(){this.Super('parentResized',arguments);if(this.event)this.calendarView.sizeEventCanvas(this)},isc.A.getEventLength=function isc_EventWindow_getEventLength(){return this.event.eventLength},isc.A.show=function isc_EventWindow_show(){this.Super("show",arguments)},isc.A.resized=function isc_EventWindow_resized(){if(this.$77n){this.header.resizeTo(this.getVisibleWidth(),this.getVisibleHeight())}});isc.B._maxIndex=isc.C+20;isc.ClassFactory.defineClass("TimelineWindow","EventWindow");isc.A=isc.TimelineWindow.getPrototype();isc.B=isc._allFuncs;isc.C=isc.B._maxIndex;isc.D=isc._funcClasses;isc.D[isc.C]=isc.A.Class;isc.A.showFooter=false;isc.A.resizeFrom=["L","R"];isc.A.dragAppearance="none";isc.B.push(isc.A.initWidget=function isc_TimelineWindow_initWidget(){if(this.calendar.showEventWindowHeader==false){this.showBody=false;this.showTitle=false}
this.Super("initWidget",arguments)},isc.A.draw=function isc_TimelineWindow_draw(_1,_2,_3,_4){this.invokeSuper(isc.TimelineWindow,"draw",_1,_2,_3,_4);if(this.calendar.showEventWindowHeader==false){var _5=isc.Canvas.create({autoDraw:false,width:"100%",height:0,top:0,contents:(this.descriptionText?this.descriptionText:" "),backgroundColor:this.event.backgroundColor,textColor:this.event.textColor});if(this.body)this.body.addMember(_5);else this.addMember(_5);_5.setHeight("100%");this.$734=_5}},isc.A.click=function isc_TimelineWindow_click(){var _1=this.calendar,_2=_1.timelineView,_3=_1.eventClick(this.event,"timeline");if(_3){if(!_1.canEditEvent(this.event,_2))return;_1.showEventDialog(this.event)}else return isc.EH.STOP_BUBBLING},isc.A.destroyLines=function isc_TimelineWindow_destroyLines(){if(this.$645){if(this.$645[0])this.$645[0].destroy();if(this.$645[1])this.$645[1].destroy();if(this.$645[2])this.$645[2].destroy();if(this.$645[3])this.$645[3].destroy()}},isc.A.hideLines=function isc_TimelineWindow_hideLines(){if(this.$645){if(this.$645[0])this.$645[0].hide();if(this.$645[1])this.$645[1].hide();if(this.$645[2])this.$645[2].hide();if(this.$645[3])this.$645[3].hide()}},isc.A.showLines=function isc_TimelineWindow_showLines(){if(this.$645){if(this.$645[0])this.$645[0].show();if(this.$645[1])this.$645[1].show();if(this.$645[2])this.$645[2].show();if(this.$645[3])this.$645[3].show()}});isc.B._maxIndex=isc.C+6;isc.Calendar.registerStringMethods({getDayBodyHTML:"date,events,calendar,rowNum,colNum",getDayHeaderHTML:"date,events,calendar,rowNum,colNum",dayBodyClick:"date,events,calendar,rowNum,colNum",dayHeaderClick:"date,events,calendar,rowNum,colNum",eventClick:"event,viewName",eventChanged:"event",eventMoved:"newDate,event",eventResized:"newDate,event",backgroundClick:"startDate,endDate",backgroundMouseDown:"startDate",backgroundMouseUp:"startDate,endDate"});isc.defineClass("EventCanvas","VLayout");isc.A=isc.EventCanvas;isc.B=isc._allFuncs;isc.C=isc.B._maxIndex;isc.D=isc._funcClasses;isc.D[isc.C]=isc.A.Class;isc.A.headerSizer=null;isc.B.push(isc.A.getHeaderHeight=function isc_c_EventCanvas_getHeaderHeight(_1,_2,_3,_4,_5){var _6=isc.EventCanvas;if(!_6.headerSizer){_6.headerSizer=isc.Canvas.create({ID:"$151s",autoDraw:false,visibility:"hidden",left:0,top:-1000})}
_6.headerSizer.setProperties({height:_4?1:_3,maxHeight:_4?null:_3,width:_2,maxWidth:_2,overflow:_4?"visible":"hidden",contents:_1,styleName:_5.getHeaderStyle()});if(!_6.headerSizer.isDrawn())_6.headerSizer.draw();else _6.headerSizer.redraw();var _7=_6.headerSizer.getVisibleHeight();_6.headerSizer.hide();_6.headerSizer.clear();return _7});isc.B._maxIndex=isc.C+1;isc.A=isc.EventCanvas.getPrototype();isc.B=isc._allFuncs;isc.C=isc.B._maxIndex;isc.D=isc._funcClasses;isc.D[isc.C]=isc.A.Class;isc.A.visibility="hidden";isc.A.autoDraw=false;isc.A.overflow="hidden";isc.A.minHeight=1;isc.A.minWidth=1;isc.A.hideUsingDisplayNone=true;isc.A.showHover=true;isc.A.canHover=true;isc.A.hoverMoveWithMouse=true;isc.A.hoverAutoFitWidth=true;isc.A.hoverAutoFitMaxWidth=200;isc.A.dragType="EventCanvas";isc.A.snapToGrid=false;isc.A.dragAppearance="none";isc.A.canDragResize=true;isc.A.canDragReposition=true;isc.A.isEventCanvas=true;isc.A.isZoneCanvas=false;isc.A.isIndicatorCanvas=false;isc.A.$142u=null;isc.A.labelOffsetX=0;isc.A.labelOffsetY=0;isc.A.titleOrientation="top";isc.A.maxLabelWidth=150;isc.A.isEventCanvas=true;isc.A.allowBodyScroll=false;isc.A.headerLabelDefaults={_constructor:"Canvas",width:"100%",height:1,autoDraw:false,overflow:"visible"};isc.A.bodyLabelDefaults={_constructor:"Canvas",width:"100%",height:"*",overflow:"auto",autoDraw:false};isc.A.leadingTrailingIconDefaults={_constructor:"Img",autoDraw:false,_redrawWithParent:false,getCalendar:function(){return this.creator.calendar},getView:function(){return this.creator.calendarView},getEventCanvas:function(){return this.creator},getEventInstance:function(){return this.creator.event},mouseDown:function(){this.Super("mouseDown",arguments);return isc.EH.STOP_BUBBLING},dragAppearance:"target",dragRepositionStart:function(){this.startTop=this.getTop();this.lastleft=this.getLeft()},dragRepositionMove:function(){this.setTop(this.startTop);var _1=this.getView().getDateFromPoint();var _2=this.getView().getDateLeftOffset(_1);var _3=window[this.lineID];if(this.type=="trail"){_2+=this.getView().getSnapGapPixels();_2-=this.getWidth();if(_2+1<this.getEventCanvas().getLeft()+this.getEventCanvas().getWidth()){this.setLeft(this.lastleft);return}
_3.setWidth(Math.round((_2-_3.getLeft())+this.getWidth()))}else{if(_2-1>this.getEventCanvas().getLeft()){this.setLeft(this.lastleft);return}
_3.setLeft(_2);_3.setWidth(Math.round(this.getEventCanvas().getLeft()-_2))}
this.lastLeft=_2;this.setLeft(_2)},dragRepositionStop:function(){this.setTop(this.startTop);var _1=this.getLeft();if(this.type=="trail")_1-=1;var _2=this.getView().getDateFromPoint(_1+1);var _3=this.getCalendar();var _4=this.getEventInstance();var _5=this.type=="trail"?_3.trailingDateField:_3.leadingDateField;var _6={};_6[_5]=_2;var _7=isc.addProperties({},_4,_6);_3.updateCalendarEvent(_4,_7);return true}};isc.A.leadingTrailingLineDefaults={_constructor:"Canvas",autoDraw:false,_redrawWithParent:false,height:2,overflow:"hidden",styleName:"eventLine"};isc.A.padding=null;isc.A.showContextButton=false;isc.A.showRolloverControls=true;isc.A.$174j=["closeButton","contextButton"];isc.B.push(isc.A.getShowHeader=function isc_EventCanvas_getShowHeader(){if(this.showHeader!=null)return this.showHeader;return this.calendar.showEventHeaders},isc.A.getShowBody=function isc_EventCanvas_getShowBody(){if(this.showBody!=null)return this.showBody;return this.calendar.showEventDescriptions},isc.A.initWidget=function isc_EventCanvas_initWidget(){if(this.verticalResize==null)this.verticalResize=this.calendarView.verticalEvents;this.resizeFrom=[];this.hoverDelay=this.calendar.hoverDelay+1;if(this.useStaticControls==null){this.useStaticControls=(this.calendar.useEventCanvasRolloverControls==false)}
if(this.canFocus==null){this.setCanFocus(this.calendar.canSelectEvents)}
this.Super("initWidget",arguments);if(this.shouldShowGripper())this.createGripper();if(this.shouldShowLabel())this.createLabel();if(this.$142u==null&&!this.calendarView.shouldShowEventHovers()){}
this.createHeaderAndBody();this.updateShowHovers()},isc.A.createHeaderAndBody=function isc_EventCanvas_createHeaderAndBody(){if(this.getShowHeader()){var _1={dragTarget:this};if(this.headerHeight!=null){_1.height=this.headerHeight;_1.overflow="hidden"}
if(!this.getShowBody())_1.height="*";this.addAutoChild("headerLabel",_1);this.addMember(this.headerLabel)}
if(this.getShowBody()){var _2={dragTarget:this};if(this.autoFit)_2.overflow="visible";else if(!this.allowBodyScroll)_2.overflow="hidden";this.addAutoChild("bodyLabel",_2)}
if(this.bodyLabel){this.addMember(this.bodyLabel,(this.titleOrientation=="bottom"?0:null))}},isc.A.updateShowHovers=function isc_EventCanvas_updateShowHovers(){if(this.$142u)this.eventProxy=this.calendarView},isc.A.shouldShowGripper=function isc_EventCanvas_shouldShowGripper(){var _1=this.calendar;if(!this.event||!_1.canEditEvent(this.event,this.calendarView)||!_1.canDragEvent(this.event,this.calendarView)){return false}
if(this.showGripper!=null)return this.showGripper;if(this.calendar.isZeroLengthEvent(this.event))return true;return false},isc.A.createGripper=function isc_EventCanvas_createGripper(){if(this.gripper)return;var _1={canDrag:true,dragTarget:this.dragTarget,eventProxy:this,eventCanvas:this,canDragResize:false,styleName:this.gripperStyle||this.styleName+"Gripper"};this.gripper=this.calendar.getEventCanvasGripper(_1,this,this.calendarView)},isc.A.shouldShowLabel=function isc_EventCanvas_shouldShowLabel(){if(!this.event)return false;if(this.showLabel!=null)return this.showLabel;if(this.calendar.isZeroLengthEvent(this.event))return true;return false},isc.A.createLabel=function isc_EventCanvas_createLabel(){if(this.label)return;var _1={canDrag:false,eventCanvas:this,canDragResize:false,canHover:true,showHover:true,showOver:false,showRollOver:false,margin:3,styleName:this.labelStyle||this.styleName+"Gripper",contents:this.getHeaderHTML(),getHoverHTML:function(){return this.eventCanvas.getHoverHTML()}};this.label=this.calendar.getEventCanvasLabel(_1,this.calendarView)},isc.A.parentScrolled=function isc_EventCanvas_parentScrolled(){if(this.gripper||this.label)this.repositionPeers()},isc.A.redraw=function isc_EventCanvas_redraw(){var _1=this.Super("redraw",arguments);if(this.gripper||this.label)this.repositionPeers();return _1},isc.A.draw=function isc_EventCanvas_draw(){var _1=this.Super("draw",arguments);delete this.$221l;this.updateCanvasColors();return _1},isc.A.hide=function isc_EventCanvas_hide(){this.Super("hide",arguments);if(this.gripper)this.gripper.hide();if(this.label)this.label.hide();this.hideLeadingTrailingDates()},isc.A.createLeadingTrailingDates=function isc_EventCanvas_createLeadingTrailingDates(){var _1=this.calendarView;if(!this.leadingIcon){this.leadingLine=this.createAutoChild("leadingTrailingLine",{type:"lead"});this.leadingIcon=this.createAutoChild("leadingTrailingIcon",{width:_1.leadIconSize,height:_1.leadIconSize,lineID:this.leadingLine.getID(),type:"lead",src:_1.leadingEndPointImage,canDragReposition:this.canDragReposition,canDrag:this.canDrag});this.trailingLine=this.createAutoChild("leadingTrailingLine",{type:"trail"});this.trailingIcon=this.createAutoChild("leadingTrailingIcon",{width:_1.trailIconSize,height:_1.trailIconSize,lineID:this.trailingLine.getID(),type:"trail",src:_1.trailingEndPointImage,canDragReposition:this.canDragReposition,canDrag:this.canDrag})}
if(this.leadingLine.parentElement!=_1.body)_1.body.addChild(this.leadingLine,null,false);if(this.leadingIcon.parentElement!=_1.body)_1.body.addChild(this.leadingIcon,null,false);if(this.trailingLine.parentElement!=_1.body)_1.body.addChild(this.trailingLine,null,false);if(this.trailingIcon.parentElement!=_1.body)_1.body.addChild(this.trailingIcon,null,false)},isc.A.hideLeadingTrailingDates=function isc_EventCanvas_hideLeadingTrailingDates(){this.leadingIcon&&this.leadingIcon.hide();this.leadingLine&&this.leadingLine.hide();this.trailingIcon&&this.trailingIcon.hide();this.trailingLine&&this.trailingLine.hide()},isc.A.updateLeadingTrailingDates=function isc_EventCanvas_updateLeadingTrailingDates(_1){if(!this.leadingIcon){this.createLeadingTrailingDates()}
var _2=this.$65t(this.leadingIcon,this.leadingLine);var _3=this.$65t(this.trailingIcon,this.trailingLine);if(this.leadingLine.getWidth()>0){if(!this.leadingLine.isDrawn())this.leadingLine.draw();this.leadingLine.show()}else this.leadingLine.hide();if(_2){if(!this.leadingIcon.isDrawn())this.leadingIcon.draw();this.leadingIcon.show()}else this.leadingIcon.hide();if(this.trailingLine.getWidth()>0){if(!this.trailingLine.isDrawn())this.trailingLine.draw();this.trailingLine.show()}else this.trailingLine.hide();if(_3){if(!this.trailingIcon.isDrawn())this.trailingIcon.draw();this.trailingIcon.show()}else this.trailingIcon.hide()},isc.A.$65t=function isc_EventCanvas__positionIcon(_1,_2){var _3=this.calendar,_4=this.calendarView,_5=this,_6=_5.event,_7=_1.type,_8=_5.getTop(),_9=_5.getLeft(),_10=_5.getVisibleWidth(),_11=_5.getVisibleHeight();var _12=true;var _13=0;var _14=Math.round(_8+((_11-_1.height)/2));if(!_2)_2=window[_1.lineID];var _15=_9;var _16=Math.round(_8+((_11-_2.getHeight())/2));var _17=0;if(_7=="trail"){_12=_4.compareDates(_6[_3.trailingDateField],_4.endDate)>=0;_13=_4.getDateLeftOffset(_6[_3.trailingDateField]);_13+=_4.getSnapGapPixels()-1;_13-=_1.width;_15+=_10;if(_12)_17=(_13+_1.width)-_15;else _17=_4.body.$26a.sum()-_15}else{_12=_4.compareDates(_6[_3.leadingDateField],_4.startDate)<0;_13=_4.getDateLeftOffset(_6[_3.leadingDateField]);_15=Math.max(0,_13);_17=_9-_15}
_2.setRect(Math.round(_15),Math.round(_16),(Math.round(_17)>0?Math.round(_17):null));if(_12){_1.setRect(Math.round(_13),Math.round(_14))}else{_1.hide()}
return _12},isc.A.repositionPeers=function isc_EventCanvas_repositionPeers(_1){if(!this.gripper&&!this.label)return;var _2=this.calendarView,_3=_2.body,_4=this.shouldShowLabel(),_5=this.shouldShowGripper();var _6=_3.getLeft(),_7=_3.getScrollLeft(),_8=_3.getVisibleWidth(),_9=this.isDrawn()?this.getWidth():_2.$732(this.event),_10=this.getLeft()+Math.floor(_9/2);if(_10<_7||_10>_7+_8){if(this.gripper&&this.gripper.isVisible())this.gripper.hide();if(this.label&&this.label.isVisible())this.label.hide();return}
var _11=_3.getTop(),_12=_3.getScrollTop(),_13=_3.getViewportHeight(),_14=this.getTop(),_15=this.getHeight(),_16=_14+_15,_17=false,_18=false;if(_14<_12||_14>_12+_13)_17=true;if(_16<_12||_16>_12+_13+1)_18=true;if(this.gripper){if(_17||!_5)this.gripper.hide();else{var _19=_10+_6-_7,_20=_2.header.getHeight()+_14-_12;if(!_1&&this.isDrawn()&&!this.gripper.isDrawn())this.gripper.draw();_19=Math.floor(_19-Math.floor(this.gripper.getVisibleWidth()/2));_20=Math.floor(_20-(this.gripper.getVisibleHeight()/2));this.gripper.moveTo(_19,_20);if(!_1&&this.isDrawn()&&!this.gripper.isVisible()){this.gripper.show();this.gripper.bringToFront()}}}
if(this.label){if(_18||!_4){this.label.hide()}else{var _19=_10+_6-_7,_20=_2.header.getHeight()+_16-_12,_21=this.getHeaderHTML(),_22=isc.EventCanvas.getHeaderHeight(_21,(this.maxLabelWidth||_9),this.headerHeight,this.getHeaderWrap(),this);this.label.setContents(_21);if(!_1&&this.isDrawn()&&!this.label.isDrawn())this.label.draw();_19=Math.floor(_19-Math.floor(this.label.getVisibleWidth()/2));_20=Math.floor(_20-(_22/2));this.label.moveTo(_19,_20);if(!_1&&this.isDrawn()&&!this.label.isVisible()){this.label.show();this.label.bringToFront()}}}},isc.A.setEvent=function isc_EventCanvas_setEvent(_1,_2,_3,_4){var _5=this.calendar,_6=this.calendarView;var _7=this.$172w(_1,_2,_3,_4);this.sortValue=_1[_5.startDateField].duplicate();this.canDragReposition=_7.canDragMove;this.canDragResize=_7.canDragResize;if(this.canDragReposition==false){this.setCursor(isc.Canvas.DEFAULT)}else{this.setCursor(isc.Canvas.MOVE)}
this.resizeFrom=[];if(_7.canDragResize){if(_7.canDragStartDate){if(!this.verticalResize)this.resizeFrom.add("L")}
if(_7.canDragEndDate){if(!this.verticalResize)this.resizeFrom.add("R");else this.resizeFrom.add("B")}}
if(this.shouldShowGripper())this.createGripper();else if(this.gripper)this.gripper.hide();if(this.shouldShowLabel())this.createLabel();else if(this.label)this.label.hide();this.checkStyle();this.$238s=null;this.$238t=0;if(this.getShowHeader()){this.headerLabel.setContents(this.getHeaderHTML()||"")}
if(this.getShowBody()){this.bodyLabel.setContents(this.getBodyHTML()||"")}},isc.A.setCursor=function isc_EventCanvas_setCursor(_1){this.Super("setCursor",arguments);if(this.getShowHeader())this.headerLabel.setCursor(this.cursor)
if(this.getShowBody())this.bodyLabel.setCursor(this.cursor)},isc.A.$172x=function isc_EventCanvas__getCacheValue(_1){return this.$172y&&this.$172y[_1]},isc.A.$172w=function isc_EventCanvas__updateValueCache(_1,_2,_3,_4){this.$172y={};this.event=_1;if(this.event){var _5=this.calendar,_6=this.calendarView,_7=this.$172y;_7.canEdit=_5.canEditEvent(_1,_6);_7.canDrag=_7.canDragMove=_5.canDragEvent(_1,_6);_7.canDragResize=_5.canResizeEvent(_1,_6);_7.canRemove=_5.canRemoveEvent(_1,_6);if(this.$239v){_7.canDrag=false;_7.canDragMove=false;_7.canDragResize=false;_7.canRemove=false}
_7.eventStartDate=_5.getEventStartDate(_1).getTime();_7.eventEndDate=_5.getEventEndDate(_1).getTime();_7.eventStyleName=_5.getEventCanvasStyle(_1,_6);_7.eventLane=_1[_5.laneNameField];var _6=this.calendarView;_7.viewStartDate=_5.getPeriodStartDate(_6).getTime();_7.viewEndDate=_5.getPeriodEndDate(_6).getTime();_7.canDragStartDate=_7.canDragResize&&_7.eventStartDate>=_7.viewStartDate;if(_6.verticalEvents)_7.canDragStartDate=false;_7.canDragEndDate=_7.canDragResize&&_7.eventEndDate&&_7.eventEndDate<=_7.viewEndDate;_7.showCloseButton=_7.canRemove}
return this.$172y},isc.A.createRolloverControls=function isc_EventCanvas_createRolloverControls(){return this.calendar.$174c(this)},isc.A.updateRolloverControls=function isc_EventCanvas_updateRolloverControls(_1){var _2=this.calendar,c=this.$174h||this.$174f||this.$129e;if(!c){if(this.useStaticControls)this.$174h=this.createRolloverControls();else if(this.isFocused())this.$174f=_2.$174e();else if(_1)this.$129e=_2.$174d();c=this.$174h||this.$174f||this.$129e}
if(!c)return;for(var _4 in c){c[_4].eventCanvas=this;this[_4]=c[_4]}
if(this.closeButton)this.closeButton.canFocus=false;if(this.buttonLayout){this.buttonLayout.canFocus=false;this.addChild(this.buttonLayout,null,false)}
if(this.verticalResize){this.startResizer=null;this.endResizer=this.endResizerB}else{this.startResizer=this.startResizerL;this.endResizer=this.endResizerR}
if(this.startResizer){this.startResizer.dragTarget=this.dragTarget;this.addChild(this.startResizer,null,false)}
if(this.endResizer){this.endResizer.dragTarget=this.dragTarget;this.addChild(this.endResizer,null,false)}
var _5=this.$172y||{};if(!this.buttonLayout.isDrawn()&&this.isDrawn())this.buttonLayout.draw();this.buttonLayout.show();this.buttonLayout.bringToFront();if(this.closeButton){if(!_5.showCloseButton)this.closeButton.hide();else{if(!this.closeButton.isDrawn()&&this.isDrawn())this.closeButton.draw();this.closeButton.show()}}
if(this.contextButton){if(!this.shouldShowContextButton())this.contextButton.hide()
else{var _6=this.calendar.getEventCanvasMenuItems(this,this.calendarView);if(_6){if(!this.contextButton.isDrawn()&&this.isDrawn())this.contextButton.draw();this.contextButton.show()}else this.contextButton.hide()}}
if(this.startResizer){if(!_5.canDragStartDate)this.startResizer.hide();else{if(!this.startResizer.isDrawn()&&this.isDrawn())this.startResizer.draw();this.startResizer.show();this.startResizer.bringToFront()}}
if(this.endResizer){if(!_5.canDragEndDate)this.endResizer.hide();else{if(!this.endResizer.isDrawn()&&this.isDrawn())this.endResizer.draw();this.endResizer.show();this.endResizer.bringToFront()}}},isc.A.markForColorUpdate=function isc_EventCanvas_markForColorUpdate(_1){this.needsColorUpdateOnSetEvent=true},isc.A.setEventStyle=function isc_EventCanvas_setEventStyle(_1,_2,_3){_2=_2||this.headerStyle||(_1+"Header");_3=_3||this.bodyStyle||(_1+"Body");this.baseStyle=_1;if(this.event.isSelected){this.baseStyle+="Selected";_2+="Selected";_3+="Selected";_1+="Selected"}
this.$129w=_3;this.$7m=_2;if(this.gripper){this.gripper.setStyleName(this.gripperStyle||_1+"Gripper")}
if(this.label)this.label.setStyleName(this.labelStyle||_1+"Label");if(this.$172y)delete this.$172y.$184b;if(this.needsColorUpdateOnSetEvent||this.styleName!=_1){delete this.needsColorUpdateOnSetEvent;this.setStyleName(_1);if(this.getShowHeader())this.headerLabel.setStyleName(this.$7m);if(this.getShowBody())this.bodyLabel.setStyleName(this.$129w);this.markForRedraw()}
this.updateCanvasColors()},isc.A.updateCanvasColors=function isc_EventCanvas_updateCanvasColors(){if(!this.event)return;var e=this.event;var _2=false;if(e.textColor||e.backgroundColor||e.borderColor){var _3=this.getStyleHandle();if(_3){_3["background-color"]=e.backgroundColor;if(e.borderColor){_3["border-style"]="solid";_3["border-color"]=e.borderColor}else{_3["border-color"]=null}}
if(e.textColor||e.backgroundColor){var _4=this.bodyLabel?this.bodyLabel.getStyleHandle():null;if(_4){_4["background-color"]=e.backgroundColor;if(e.textColor)_4["color"]=e.textColor}}
_2=true}
if(e.headerTextColor||e.headerBackgroundColor||e.headerBorderColor){var _5=this.headerLabel?this.headerLabel.getStyleHandle():null;if(_5){if(e.headerBackgroundColor)_5["background-color"]=e.headerBackgroundColor;if(e.headerTextColor)_5["color"]=e.headerTextColor;if(e.headerBorderColor)_5["border-color"]=e.headerBorderColor}
_2=true}
if(_2)this.markForColorUpdate()},isc.A.getStartDate=function isc_EventCanvas_getStartDate(){return this.$172x("eventStartDate")||this.calendar.getEventStartDate(this.event)},isc.A.getEndDate=function isc_EventCanvas_getEndDate(){return this.$172x("eventEndDate")||this.calendar.getEventEndDate(this.event)},isc.A.getDuration=function isc_EventCanvas_getDuration(){return this.event[this.calendar.durationField]},isc.A.getEventLength=function isc_EventCanvas_getEventLength(_1){if(this.event.eventLength)return this.event.eventLength;return this.calendar.getEventLength(this.event,_1||"minute")},isc.A.isZeroLengthEvent=function isc_EventCanvas_isZeroLengthEvent(){return this.calendar.isZeroLengthEvent(this.event)},isc.A.getHeaderWrap=function isc_EventCanvas_getHeaderWrap(){if(this.headerWrap!=null)return this.headerWrap;return this.calendar.eventHeaderWrap},isc.A.getHeaderHeight=function isc_EventCanvas_getHeaderHeight(_1){var _2;if(_1||this.getShowBody()){var _3=this.$151t(),_4=this.isDrawn()||!this.calendarView.isTimelineView()?this.getWidth():this.calendarView.$732(this.event),_5=_4-(this.calendar.getLanePadding()*2);var _6=isc.EventCanvas.getHeaderHeight(this.getHeaderHTML(),_5,_3,this.getHeaderWrap(),this);_2=_6}else{_2=this.getInnerHeight()}
return _2},isc.A.$151t=function isc_EventCanvas__getDefinedHeaderHeight(){return this.headerHeight!=null?this.headerHeight:this.calendar.eventHeaderHeight},isc.A.getHeaderStyle=function isc_EventCanvas_getHeaderStyle(){return this.$7m},isc.A.getHeaderHTML=function isc_EventCanvas_getHeaderHTML(){if(!this.event){return"No event"}
return this.calendar.getEventHeaderHTML(this.event,this.calendarView)},isc.A.getBodyStyle=function isc_EventCanvas_getBodyStyle(){return this.$129w},isc.A.getBodyHTML=function isc_EventCanvas_getBodyHTML(){if(!this.event){return""}
return this.calendar.getEventBodyHTML(this.event,this.calendarView)},isc.A.willShowHover=function isc_EventCanvas_willShowHover(){if(this.calendar.alwaysShowEventHovers==true)return true;if(this.autoFit)return false;if(this.$238s==null){var _1=this.getInnerWidth();if(this.getShowHeader()){var _2=this.getHeaderHTML()||"";this.$238t+=isc.Canvas.measureContent(_2,this.headerLabel.styleName,true,true,{width:_1,maxWidth:_1});this.$239u=isc.Canvas.measureContent(_2,this.headerLabel.styleName,false,true,{width:_1})}
if(this.getShowBody()){var _3=this.getBodyHTML()||"";this.$238t+=isc.Canvas.measureContent(_3,this.bodyLabel.styleName,true,true,{width:_1,maxWidth:_1});var _4=isc.Canvas.measureContent(_3,this.bodyLabel.styleName,false,true,{width:_1});this.$239u=Math.max((this.$239u||0),_4)}
this.$238s=this.getVisibleHeight()<this.$238t||this.getVisibleWidth()<this.$239u}
return this.$238s},isc.A.getHoverHTML=function isc_EventCanvas_getHoverHTML(){if(this.calendarView.shouldShowEventHovers()){if(this.willShowHover()){return this.calendar.$141h(this.event,this,this.calendarView)}}},isc.A.shouldShowCloseButton=function isc_EventCanvas_shouldShowCloseButton(){if(this.showCloseButton!=null)return this.showCloseButton!=false;return this.$172x("showCloseButton")},isc.A.shouldShowContextButton=function isc_EventCanvas_shouldShowContextButton(){if(this.showContextButton!=null)return this.showContextButton!=false;return this.$172x("showContextButton")},isc.A.getRolloverControls=function isc_EventCanvas_getRolloverControls(){return null},isc.A.renderEvent=function isc_EventCanvas_renderEvent(_1,_2,_3,_4,_5){this.setRect(_2,_1,_3,_4);this.checkStyle();if(!this.parentElement||!this.parentElement.isDrawn())return;if(!this.isDrawn())this.draw();this.show();if(_5)this.sendToBack();else this.bringToFront();if(this.shouldShowGripper()||this.shouldShowLabel()){this.repositionPeers()}
if(this.useStaticControls&&!this.isZoneCanvas&&!this.isIndicatorCanvas){this.updateRolloverControls()}},isc.A.checkStyle=function isc_EventCanvas_checkStyle(){var _1=this.calendar.getEventCanvasStyle(this.event,this.calendarView);if(this.needsColorUpdateOnSetEvent||this.calendar.canSelectEvents||_1!=this.styleName){this.setEventStyle(_1)}
this.updateCanvasColors()},isc.A.click=function isc_EventCanvas_click(){this.calendar.$129v(this)},isc.A.doubleClick=function isc_EventCanvas_doubleClick(){this.calendar.$195c(this)},isc.A.handleShowContextMenu=function isc_EventCanvas_handleShowContextMenu(){return this.calendar.$1701(this)},isc.A.mouseUp=function isc_EventCanvas_mouseUp(){return isc.EH.STOP_BUBBLING},isc.A.rightMouseDown=function isc_EventCanvas_rightMouseDown(){if(this.dragTarget&&this.dragTarget!=this){this.dragTarget.eventCanvas=null;this.dragTarget.$1930=true;this.dragTarget.hide();return false}},isc.A.mouseDown=function isc_EventCanvas_mouseDown(){if(!isc.EH.rightButtonDown()){if(this.dragTarget){this.dragTarget.eventCanvas=this;delete this.dragTarget.$1930}}
this.calendar.hideEventDialog();return isc.EH.STOP_BUBBLING},isc.A.focusChanged=function isc_EventCanvas_focusChanged(_1){var _2=isc.EH.getTarget();if(_2!=this&&this.contains(_2))return;if(_1&&!this.$174f){this.calendar.$174g(this)}else if(this.$174f){this.calendar.$174i(this)}},isc.A.keyPress=function isc_EventCanvas_keyPress(){var _1=this.calendar,_2=isc.EventHandler.getKey();var _3=_1.$195n(this,_2);if(_3==false)return;return this.Super("keyPress",arguments)},isc.A.handleMouseMove=function isc_EventCanvas_handleMouseMove(){return false},isc.A.handleMouseOver=function isc_EventCanvas_handleMouseOver(){if(this.$174h||this.$174f)return;if(this.showRolloverControls==false)return;if(this.$129e){var _1=isc.EH.lastEvent.target;if(_1==this||_1.eventCanvas==this)return}
this.updateRolloverControls(true)},isc.A.mouseOut=function isc_EventCanvas_mouseOut(){if(this.$174h||this.$174f)return;if(this.showRolloverControls==false||!this.$129e)return;var _1=isc.EH.lastEvent.target;if(_1&&(_1.eventCanvas==this||_1==isc.Hover.hoverCanvas))return;this.calendar.hideEventCanvasControls(this,"$129e")},isc.A.parentResized=function isc_EventCanvas_parentResized(){this.Super('parentResized',arguments);if(this.shouldShowGripper()||this.shouldShowLabel()){this.repositionPeers()}},isc.A.destroy=function isc_EventCanvas_destroy(){if(this.$174h){var _1=["closeButton","contextButton"];for(var _2 in this.$174h){var _3=this.$174h[_2];_3.hide();if(!_1.contains(_2))this.removeChild(_3);_3.destroy();delete this[_2];_3=null}
delete this.$174h}else{if(this.$174f){this.calendar.hideEventCanvasControls(this,"$174f")}else if(this.$129e){this.calendar.hideEventCanvasControls(this,"$129e")}}
if(this.gripper){this.calendarView.removeChild(this.gripper);this.gripper.destroy();this.gripper=null}
if(this.label){this.calendarView.removeChild(this.label);this.label.destroy();this.label=null}
if(this.dragTarget)this.dragTarget=null;this.leadingIcon&&this.leadingIcon.destroy();this.leadingLine&&this.leadingLine.destroy();this.trailingIcon&&this.trailingIcon.destroy();this.trailingLine&&this.trailingLine.destroy();this.leadingIcon=this.leadingLine=this.trailingIcon=this.trailingLine=null;this.calendarView=null;this.calendar=null;this.event=null;this.$172y=null;this.Super("destroy",arguments)},isc.A.getPrintHTML=function isc_EventCanvas_getPrintHTML(_1,_2){if(_2){this.delayCall("asyncGetPrintHTML",[_1,_2]);return null}else{return this.asyncGetPrintHTML(_1,_2)}},isc.A.asyncGetPrintHTML=function isc_EventCanvas_asyncGetPrintHTML(_1,_2){var _3=this.getHandle(),_4=isc.StringBuffer.create(),_5=this.calendar,_6=this.calendarView,_7=_6.isTimelineView(),_8=Math.round(_6.frozenBody?_6.frozenBody.getVisibleWidth():0),_9=this.event,_10=0,_11=0,_12=parseInt(_3.style.width),_13=parseInt(_3.style.height),i=(_1&&_1.i?_1.i:1);var _15=_6.body.getTop()+(_6.header?_6.header.getVisibleHeight():0);var _16=_5.headerLevels?_5.headerLevels.length:1;var _17=_6.headerRowPrintHeight*_16;if(_7){_10=_15+this.getTop();_10=_17+this.getTop();_10=_10+1;_11=_8+this.getLeft()}else{_11=_8+this.getLeft();_10=_17+this.getTop();_10+=1;_12=parseInt(_3.style.width);_13=parseInt(_3.style.height)}
if(isc.Browser.isFirefox){_12-=4;_13-=4;if(_7)_11+=1}
var _18=this.styleName;_4.append("<div class='",_18,"' ","style='vertical-align: ",(_5.showEventDescriptions?"top":"middle"),"; ",(_9.backgroundColor?"background-color: "+_9.backgroundColor+";":""),(_9.textColor?"color: "+_9.textColor+";":""),(_9.borderColor?"border-color: "+_9.borderColor+";":""),"overflow: hidden; ","position: absolute; ","left: ",_11,"px; top: ",_10,"px; width: ",_12,"px; height: ",_13,"px; ","z-index:",i+2,";","'>");this.$239v=true;this.setEvent(this.event);this.redraw();var _19=this.getHandle().innerHTML;_4.append(_19);_4.append("</div>");delete this.$239v;this.setEvent(this.event);this.redraw();if(this.label){_10=_10+_13-5;_12=this.label.getVisibleWidth();_13=this.label.getInnerHeight();_11-=Math.floor(_12/2);_4.append("<div class='",_18+"Header","' ","style='overflow:hidden; ","position: absolute; ","padding:2px; ","z-index:",i+2,";","left:",_11,"px; top:",_10,"px; width: ",_12,"px; height: ",_13,"px; ","'>");_4.append(this.getHeaderHTML());_4.append("</div>")}
return _4.release(false)});isc.B._maxIndex=isc.C+61;isc.defineClass("ZoneCanvas","EventCanvas");isc.A=isc.ZoneCanvas.getPrototype();isc.B=isc._allFuncs;isc.C=isc.B._maxIndex;isc.D=isc._funcClasses;isc.D[isc.C]=isc.A.Class;isc.A.titleOrientation=null;isc.A.showHeader=true;isc.A.showBody=true;isc.A.canEdit=false;isc.A.canDrag=false;isc.A.canDragReposition=false;isc.A.canDragResize=false;isc.A.canRemove=false;isc.A.showRolloverControls=false;isc.A.isEventCanvas=false;isc.A.isZoneCanvas=true;isc.A.maxLabelWidth=null;isc.B.push(isc.A.initWidget=function isc_ZoneCanvas_initWidget(){this.showCloseButton=false;this.canDragReposition=false;this.canDragResize=false;if(this.titleOrientation==null)this.titleOrientation=this.calendar.zoneTitleOrientation;this.$142u=!this.calendarView.shouldShowZoneHovers();this.Super("initWidget",arguments)},isc.A.setEvent=function isc_ZoneCanvas_setEvent(_1,_2,_3,_4){this.event=_1;this.showCloseButton=false;this.canDragReposition=false;this.canDragResize=false;var _5=this.calendar;_2=_2||_5.getZoneCanvasStyle(_1,this.calendarView);this.setEventStyle(_2,_3,_4)},isc.A.click=function isc_ZoneCanvas_click(){if(this.calendar.zoneClick)this.calendar.zoneClick(this.event,this.calendarView.viewName)},isc.A.getHoverHTML=function isc_ZoneCanvas_getHoverHTML(){if(this.calendarView.shouldShowZoneHovers()){var _1=this.calendar.$141i(this.event,this,this.calendarView);return _1}},isc.A.checkStyle=function isc_ZoneCanvas_checkStyle(){},isc.A.updateRolloverControls=function isc_ZoneCanvas_updateRolloverControls(){});isc.B._maxIndex=isc.C+6;isc.defineClass("IndicatorCanvas","EventCanvas");isc.A=isc.IndicatorCanvas.getPrototype();isc.B=isc._allFuncs;isc.C=isc.B._maxIndex;isc.D=isc._funcClasses;isc.D[isc.C]=isc.A.Class;isc.A.showHeader=false;isc.A.showBody=false;isc.A.headerSnapTo="B";isc.A.showGripper=true;isc.A.showLabel=true;isc.A.isEventCanvas=false;isc.A.isIndicatorCanvas=true;isc.A.canDrag=true;isc.A.canDragReposition=true;isc.A.dragRepositionCursor=isc.Canvas.MOVE;isc.A.canDragResize=false;isc.A.canRemove=false;isc.A.showRolloverControls=false;isc.B.push(isc.A.initWidget=function isc_IndicatorCanvas_initWidget(){this.showCloseButton=false;this.canDragResize=false;this.Super("initWidget",arguments);if(this.event)this.setEvent(this.event)},isc.A.setEvent=function isc_IndicatorCanvas_setEvent(_1,_2,_3,_4){this.event=_1;var _5=this.$172w(_1,_2,_3,_4);this.canEdit=_5.canEdit;this.canDrag=_5.canDrag;this.canDragResize=false;this.canDragReposition=_5.canDragMove;if(this.canDragReposition==false){this.setCursor(isc.Canvas.DEFAULT)}else{this.setCursor(isc.Canvas.MOVE)}
this.showCloseButton=false;var _6=this.calendar;_2=_2||_6.getIndicatorCanvasStyle(_1,this.calendarView);this.setEventStyle(_2,_3,_4)},isc.A.click=function isc_IndicatorCanvas_click(){if(this.calendar.indicatorClick)this.calendar.indicatorClick(this.event,this.calendarView.viewName)},isc.A.getHoverHTML=function isc_IndicatorCanvas_getHoverHTML(){return this.calendar.$141j(this.event,this,this.calendarView)},isc.A.checkStyle=function isc_IndicatorCanvas_checkStyle(){},isc.A.updateRolloverControls=function isc_IndicatorCanvas_updateRolloverControls(){});isc.B._maxIndex=isc.C+6;isc.AutoTest.customizeCalendar();isc.ClassFactory.defineClass("Timeline","Calendar");isc.A=isc.Timeline.getPrototype();isc.A.showTimelineView=true;isc.A.showDayView=false;isc.A.showWeekView=false;isc.A.showMonthView=false;isc.A.showControlBar=false;isc.A.labelColumnWidth=75;isc.A.sizeEventsToGrid=false;isc.A.eventDragGap=0;isc.A.eventOverlap=false;isc._nonDebugModules=(isc._nonDebugModules!=null?isc._nonDebugModules:[]);isc._nonDebugModules.push('Calendar');isc.checkForDebugAndNonDebugModules();isc._moduleEnd=isc._Calendar_end=(isc.timestamp?isc.timestamp():new Date().getTime());if(isc.Log&&isc.Log.logIsInfoEnabled('loadTime'))isc.Log.logInfo('Calendar module init time: '+(isc._moduleEnd-isc._moduleStart)+'ms','loadTime');delete isc.definingFramework;if(isc.Page)isc.Page.handleEvent(null,"moduleLoaded",{moduleName:'Calendar',loadTime:(isc._moduleEnd-isc._moduleStart)});}else{if(window.isc&&isc.Log&&isc.Log.logWarn)isc.Log.logWarn("Duplicate load of module 'Calendar'.");}
